Skip to content

Interface: PNamespace ​

Defined in: p-namespace-contract.ts:47

Root declarative builder namespace (P) for constructing passive Paraharness AST definitions.

Exposes factory methods for every core orchestration construct alongside canonical Zod schemas.

Methods ​

agent() ​

ts
agent<THandle>(id): AgentBuilder<unknown, unknown, THandle>;

Defined in: p-namespace-contract.ts:184

Creates a fluent AgentBuilder for the universal LLM actor primitive (P.agent(id)).

Compiles to a passive AgentNode with canonical roleKey derivation.

Type Parameters ​

Type ParameterDefault typeDescription
THandleunknownIsolation scope handle type.

Parameters ​

ParameterTypeDescription
idstringUnique identifier of the base agent.

Returns ​

AgentBuilder<unknown, unknown, THandle>

Frozen AgentBuilder instance.


command() ​

ts
command<TIn, TOut, THandle>(id, options?): CommandBuilder<TIn, TOut, THandle>;

Defined in: p-namespace-contract.ts:175

Creates a fluent CommandBuilder for a deterministic TypeScript step command (P.command(id) or P.command(id, options)).

Supports both fluent method chaining and the 2-argument CommandConfigOptions overload.

Type Parameters ​

Type ParameterDefault typeDescription
TInunknownValidated command input payload type.
TOutunknownValidated command output payload type.
THandleunknownIsolation scope handle type.

Parameters ​

ParameterTypeDescription
idstringUnique identifier of the command step.
options?CommandConfigOptions<TIn, TOut, THandle>Optional direct command configuration.

Returns ​

CommandBuilder<TIn, TOut, THandle>

Frozen CommandBuilder instance.


env() ​

ts
env(key): EnvRef;

Defined in: p-namespace-contract.ts:55

Creates a symbolic environment variable reference (EnvRef) without reading process.env.

Resolved exclusively at leaf adapter invocation from explicitly injected environment maps.

Parameters ​

ParameterTypeDescription
keystringEnvironment variable name.

Returns ​

EnvRef

Deeply frozen symbolic EnvRef node.


flow() ​

ts
flow(id): FlowBuilder<unknown, unknown, never, unknown, Record<string, unknown>, Record<string, never>>;

Defined in: p-namespace-contract.ts:201

Creates a fluent FlowBuilder for a declarative multi-step workflow (P.flow(id)).

Threads scope handles, receipts, telemetry metrics, and step outputs across sequential steps and branches.

Parameters ​

ParameterTypeDescription
idstringUnique identifier of the flow.

Returns ​

FlowBuilder<unknown, unknown, never, unknown, Record<string, unknown>, Record<string, never>>

Frozen FlowBuilder instance.


harness() ​

ts
harness(id): HarnessBuilder;

Defined in: p-namespace-contract.ts:217

Creates a fluent HarnessBuilder for a root Paraharness application (P.harness(id)).

Binds the state ledger, pools, streams, lanes, signal notifications, and control planes.

Parameters ​

ParameterTypeDescription
idstringUnique identifier of the harness application.

Returns ​

HarnessBuilder

Frozen HarnessBuilder instance.


human() ​

ts
human(id): HumanBuilder<"bidirectional" | "notify-only">;

Defined in: p-namespace-contract.ts:118

Creates a fluent HumanBuilder for an external human authority or notification channel (P.human(id)).

Tracks bidirectional versus notify-only channel capabilities at the type level.

Parameters ​

ParameterTypeDescription
idstringUnique identifier of the human authority.

Returns ​

HumanBuilder<"bidirectional" | "notify-only">

Frozen HumanBuilder instance.


interrupt() ​

ts
interrupt<TPayload>(id, schema?): InterruptBuilder<TPayload>;

Defined in: p-namespace-contract.ts:75

Creates a fluent InterruptBuilder for an upward or guard-triggered interrupt (P.interrupt(id)).

Defaults the payload schema to z.unknown() when schema is omitted.

Type Parameters ​

Type ParameterDefault typeDescription
TPayloadunknownValidated interrupt payload type.

Parameters ​

ParameterTypeDescription
idstringUnique identifier of the interrupt.
schema?ZodType<TPayload, unknown, $ZodTypeInternals<TPayload, unknown>>Optional initial Zod payload schema.

Returns ​

InterruptBuilder<TPayload>

Frozen InterruptBuilder instance.


lane() ​

ts
lane(id): LaneBuilder<unknown, string>;

Defined in: p-namespace-contract.ts:209

Creates a fluent LaneBuilder for a concurrent work execution lane (P.lane(id)).

Configures tracker polling, flow execution, concurrency, priority aging, and signal rewinds.

Parameters ​

ParameterTypeDescription
idstringUnique identifier of the lane.

Returns ​

LaneBuilder<unknown, string>

Frozen LaneBuilder instance.


lessons() ​

ts
lessons<TIn>(id): LessonsBuilder<TIn>;

Defined in: p-namespace-contract.ts:154

Creates a fluent LessonsBuilder for empirical lesson recall, distillation, and scoring (P.lessons(id)).

Configures contrastive distillation, 4-state utility scoring, retirement, and promotion signals.

Type Parameters ​

Type ParameterDefault typeDescription
TInunknownActor input payload type for .queryFrom(...).

Parameters ​

ParameterTypeDescription
idstringUnique identifier of the lessons subsystem.

Returns ​

LessonsBuilder<TIn>

Frozen LessonsBuilder instance.


loop() ​

ts
loop<THandle>(id): LoopBuilder<unknown, unknown, THandle, string>;

Defined in: p-namespace-contract.ts:193

Creates a fluent LoopBuilder for an iterative action-and-evaluation refinement loop (P.loop(id)).

Pairs a write-capable .act() agent with a read-only adversarial .evaluate() agent.

Type Parameters ​

Type ParameterDefault typeDescription
THandleunknownIsolation scope handle type.

Parameters ​

ParameterTypeDescription
idstringUnique identifier of the loop.

Returns ​

LoopBuilder<unknown, unknown, THandle, string>

Frozen LoopBuilder instance.


policy() ​

ts
policy<THandle>(id): PolicyBuilder<THandle>;

Defined in: p-namespace-contract.ts:163

Creates a fluent PolicyBuilder for capability guards and quantitative limits (P.policy(id)).

Configures pre-flight/post-flight guard clauses, tripwires, and resource ceilings.

Type Parameters ​

Type ParameterDefault typeDescription
THandleunknownIsolation scope handle type.

Parameters ​

ParameterTypeDescription
idstringUnique identifier of the policy.

Returns ​

PolicyBuilder<THandle>

Frozen PolicyBuilder instance.


pool() ​

ts
pool<TItem>(id): PoolBuilder<TItem>;

Defined in: p-namespace-contract.ts:94

Creates a fluent PoolBuilder for an account seat or model pool (P.pool(id)).

Aggregates candidate items with a selection strategy and optional fallback item.

Type Parameters ​

Type ParameterDefault typeDescription
TItem extends ASTNodeASTNodeCandidate AST node type managed by the pool.

Parameters ​

ParameterTypeDescription
idstringUnique identifier of the pool.

Returns ​

PoolBuilder<TItem>

Frozen PoolBuilder instance.


prefixGroup() ​

ts
prefixGroup(id): PrefixGroupBuilder;

Defined in: p-namespace-contract.ts:102

Creates a fluent PrefixGroupBuilder for shared byte-identical wire system prompts (P.prefixGroup(id)).

Pins shared grounding, instructions, and global rules across multiple agent roles.

Parameters ​

ParameterTypeDescription
idstringUnique identifier of the prefix group.

Returns ​

PrefixGroupBuilder

Frozen PrefixGroupBuilder instance.


rules() ​

ts
rules(id): RulesBuilder;

Defined in: p-namespace-contract.ts:126

Creates a fluent RulesBuilder for global and scoped rules (P.rules(id)).

Aggregates always-active global rules and partition- or effect-scoped rules.

Parameters ​

ParameterTypeDescription
idstringUnique identifier of the rules registry.

Returns ​

RulesBuilder

Frozen RulesBuilder instance.


scopedRule() ​

ts
scopedRule(idOrSource): ScopedRuleBuilder;

Defined in: p-namespace-contract.ts:134

Creates a fluent ScopedRuleBuilder for a path/partition-activated rule (P.scopedRule(idOrSource)).

Binds activation predicates, directives, and optional beforeStop check gates.

Parameters ​

ParameterTypeDescription
idOrSource| string | MaybeBuilder<SourceASTNode<{ checks: BuiltInCheckASTNode<unknown>[]; directive: string; id: string; when: { effects?: FsGlobMatcherNode; partitions: string[]; }; }>>Unique identifier or frontmatter rule source.

Returns ​

ScopedRuleBuilder

Frozen ScopedRuleBuilder instance.


signal() ​

ts
signal<TPayload>(id, schema?): SignalBuilder<TPayload>;

Defined in: p-namespace-contract.ts:65

Creates a fluent SignalBuilder for a cross-lane or external signal (P.signal(id)).

Defaults the payload schema to z.unknown() when schema is omitted.

Type Parameters ​

Type ParameterDefault typeDescription
TPayloadunknownValidated signal payload type.

Parameters ​

ParameterTypeDescription
idstringUnique identifier of the signal.
schema?ZodType<TPayload, unknown, $ZodTypeInternals<TPayload, unknown>>Optional initial Zod payload schema.

Returns ​

SignalBuilder<TPayload>

Frozen SignalBuilder instance.


skill() ​

ts
skill<THandle>(idOrSource): SkillBuilder<THandle>;

Defined in: p-namespace-contract.ts:143

Creates a fluent SkillBuilder for a dynamically unlocked skill (P.skill(idOrSource)).

Configures pull-based instructions, unlocked tools, and background daemon services.

Type Parameters ​

Type ParameterDefault typeDescription
THandleunknownIsolation scope handle type.

Parameters ​

ParameterTypeDescription
idOrSource| string | MaybeBuilder<SourceASTNode<SkillNode<THandle>>>Unique identifier or frontmatter skill source.

Returns ​

SkillBuilder<THandle>

Frozen SkillBuilder instance.


stream() ​

ts
stream<TEvent, TPayload>(id): StreamBuilder<TEvent, TPayload>;

Defined in: p-namespace-contract.ts:85

Creates a fluent StreamBuilder for an inbound event stream (P.stream(id)).

Connects an external stream source to a typed signal emission rule.

Type Parameters ​

Type ParameterDefault typeDescription
TEventunknownRaw external event payload type.
TPayloadunknownEmitted signal payload type.

Parameters ​

ParameterTypeDescription
idstringUnique identifier of the stream.

Returns ​

StreamBuilder<TEvent, TPayload>

Frozen StreamBuilder instance.


topology() ​

ts
topology(id): TopologyConfigBuilder<string>;

Defined in: p-namespace-contract.ts:110

Creates a fluent TopologyConfigBuilder for a relational partition DAG (P.topology(id)).

Validates partition dependency graphs and configures signal-driven contract overlays.

Parameters ​

ParameterTypeDescription
idstringUnique identifier of the topology.

Returns ​

TopologyConfigBuilder<string>

Frozen TopologyConfigBuilder instance.

Properties ​

PropertyModifierTypeDescriptionDefined in
BudgetApprovalSchemareadonlyZodObject<{ approved: ZodBoolean; increaseLimitToUsd: ZodOptional<ZodNumber>; }, $strip>Canonical Zod schema for human budget approvals (BudgetApprovalSchema).p-namespace-contract.ts:225
DistilledLessonCandidateSchemareadonlyZodType<DistilledLessonCandidate, unknown, $ZodTypeInternals<DistilledLessonCandidate, unknown>>Canonical Zod schema for distilled lesson candidates (DistilledLessonCandidateSchema).p-namespace-contract.ts:227
GlobalRuleSchemareadonlyZodObject<{ directive: ZodString; id: ZodString; }, $strip>Canonical Zod schema for global rules (GlobalRuleSchema).p-namespace-contract.ts:221
ResumeForkInputSchemareadonlyZodObject<{ action: ZodDefault<ZodEnum<{ abort: "abort"; resume: "resume"; }>>; resolutionSummary: ZodString; suspendedForkIds: ZodArray<ZodString>; }, $strip>Canonical Zod schema for the native resumeFork tool (ResumeForkInputSchema).p-namespace-contract.ts:229
ScopedRuleSchemareadonlyZodObject<{ checks: ZodDefault<ZodArray<ZodCustom<BuiltInCheckASTNode<unknown>, BuiltInCheckASTNode<unknown>>>>; directive: ZodString; id: ZodString; when: ZodObject<{ effects: ZodOptional<ZodCustom<FsGlobMatcherNode, FsGlobMatcherNode>>; partitions: ZodDefault<ZodArray<ZodString>>; }, $strip>; }, $strip>Canonical Zod schema for scoped rules (ScopedRuleSchema).p-namespace-contract.ts:223
ScopePredicateSchemareadonlyZodObject<{ effects: ZodOptional<ZodCustom<FsGlobMatcherNode, FsGlobMatcherNode>>; partitions: ZodDefault<ZodArray<ZodString>>; }, $strip>Canonical Zod schema for scope activation predicates (ScopePredicateSchema).p-namespace-contract.ts:219
SpeculationCandidateSchemareadonly<TIn, TOut, TReceipt, TCross, TEscPayload>(inSchema, outSchema, receiptSchema, crossSchema?, escalationSchema?) => ZodDiscriminatedUnion<[ZodObject<{ branchIndex: ZodNumber; crossVerifyReport: ZodOptional<TCross> | ZodOptional<ZodUnknown>; input: TIn; output: TOut; scopeReceipt: TReceipt; status: ZodLiteral<"COMPLETED">; }, $strip>, ZodObject<{ branchIndex: ZodNumber; escalationPayload: ZodUnknown | TEscPayload; input: TIn; interruptId: ZodString; scopeReceipt: TReceipt; status: ZodLiteral<"PARKED_ON_ESCALATION">; }, $strip>], "status">Canonical Zod schema factory for a single speculative candidate (SpeculationCandidateSchema).p-namespace-contract.ts:231
SpeculationInputSchemareadonly<TIn, TOut, TReceipt, TCross, TEscPayload>(inSchema, outSchema, receiptSchema, crossSchema?, escalationSchema?) => ZodObject<{ candidates: ZodArray<ZodDiscriminatedUnion<[ZodObject<{ branchIndex: ZodNumber; crossVerifyReport: ZodOptional<ZodUnknown> | ZodOptional<TCross>; input: TIn; output: TOut; scopeReceipt: TReceipt; status: ZodLiteral<"COMPLETED">; }, $strip>, ZodObject<{ branchIndex: ZodNumber; escalationPayload: ZodUnknown | TEscPayload; input: TIn; interruptId: ZodString; scopeReceipt: TReceipt; status: ZodLiteral<"PARKED_ON_ESCALATION">; }, $strip>], "status">>; failedBranches: ZodDefault<ZodArray<ZodObject<{ branchIndex: ZodNumber; errorSummary: ZodString; }, $strip>>>; humanRulingsHistory: ZodDefault<ZodArray<ZodObject<{ branchIndex: ZodNumber; interruptId: ZodString; rulingSummary: ZodString; }, $strip>>>; }, $strip>Canonical Zod schema factory for arbiter speculation input (SpeculationInputSchema).p-namespace-contract.ts:233

Released under the MIT License.