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()
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 Parameter | Default type | Description |
|---|---|---|
THandle | unknown | Isolation scope handle type. |
Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | Unique identifier of the base agent. |
Returns
AgentBuilder<unknown, unknown, THandle>
Frozen AgentBuilder instance.
command()
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 Parameter | Default type | Description |
|---|---|---|
TIn | unknown | Validated command input payload type. |
TOut | unknown | Validated command output payload type. |
THandle | unknown | Isolation scope handle type. |
Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | Unique identifier of the command step. |
options? | CommandConfigOptions<TIn, TOut, THandle> | Optional direct command configuration. |
Returns
CommandBuilder<TIn, TOut, THandle>
Frozen CommandBuilder instance.
env()
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
| Parameter | Type | Description |
|---|---|---|
key | string | Environment variable name. |
Returns
Deeply frozen symbolic EnvRef node.
flow()
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
| Parameter | Type | Description |
|---|---|---|
id | string | Unique identifier of the flow. |
Returns
FlowBuilder<unknown, unknown, never, unknown, Record<string, unknown>, Record<string, never>>
Frozen FlowBuilder instance.
harness()
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
| Parameter | Type | Description |
|---|---|---|
id | string | Unique identifier of the harness application. |
Returns
Frozen HarnessBuilder instance.
human()
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
| Parameter | Type | Description |
|---|---|---|
id | string | Unique identifier of the human authority. |
Returns
HumanBuilder<"bidirectional" | "notify-only">
Frozen HumanBuilder instance.
interrupt()
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 Parameter | Default type | Description |
|---|---|---|
TPayload | unknown | Validated interrupt payload type. |
Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | Unique identifier of the interrupt. |
schema? | ZodType<TPayload, unknown, $ZodTypeInternals<TPayload, unknown>> | Optional initial Zod payload schema. |
Returns
InterruptBuilder<TPayload>
Frozen InterruptBuilder instance.
lane()
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
| Parameter | Type | Description |
|---|---|---|
id | string | Unique identifier of the lane. |
Returns
LaneBuilder<unknown, string>
Frozen LaneBuilder instance.
lessons()
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 Parameter | Default type | Description |
|---|---|---|
TIn | unknown | Actor input payload type for .queryFrom(...). |
Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | Unique identifier of the lessons subsystem. |
Returns
LessonsBuilder<TIn>
Frozen LessonsBuilder instance.
loop()
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 Parameter | Default type | Description |
|---|---|---|
THandle | unknown | Isolation scope handle type. |
Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | Unique identifier of the loop. |
Returns
LoopBuilder<unknown, unknown, THandle, string>
Frozen LoopBuilder instance.
policy()
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 Parameter | Default type | Description |
|---|---|---|
THandle | unknown | Isolation scope handle type. |
Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | Unique identifier of the policy. |
Returns
PolicyBuilder<THandle>
Frozen PolicyBuilder instance.
pool()
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 Parameter | Default type | Description |
|---|---|---|
TItem extends ASTNode | ASTNode | Candidate AST node type managed by the pool. |
Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | Unique identifier of the pool. |
Returns
PoolBuilder<TItem>
Frozen PoolBuilder instance.
prefixGroup()
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
| Parameter | Type | Description |
|---|---|---|
id | string | Unique identifier of the prefix group. |
Returns
Frozen PrefixGroupBuilder instance.
rules()
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
| Parameter | Type | Description |
|---|---|---|
id | string | Unique identifier of the rules registry. |
Returns
Frozen RulesBuilder instance.
scopedRule()
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
| Parameter | Type | Description |
|---|---|---|
idOrSource | | string | MaybeBuilder<SourceASTNode<{ checks: BuiltInCheckASTNode<unknown>[]; directive: string; id: string; when: { effects?: FsGlobMatcherNode; partitions: string[]; }; }>> | Unique identifier or frontmatter rule source. |
Returns
Frozen ScopedRuleBuilder instance.
signal()
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 Parameter | Default type | Description |
|---|---|---|
TPayload | unknown | Validated signal payload type. |
Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | Unique identifier of the signal. |
schema? | ZodType<TPayload, unknown, $ZodTypeInternals<TPayload, unknown>> | Optional initial Zod payload schema. |
Returns
SignalBuilder<TPayload>
Frozen SignalBuilder instance.
skill()
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 Parameter | Default type | Description |
|---|---|---|
THandle | unknown | Isolation scope handle type. |
Parameters
| Parameter | Type | Description |
|---|---|---|
idOrSource | | string | MaybeBuilder<SourceASTNode<SkillNode<THandle>>> | Unique identifier or frontmatter skill source. |
Returns
SkillBuilder<THandle>
Frozen SkillBuilder instance.
stream()
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 Parameter | Default type | Description |
|---|---|---|
TEvent | unknown | Raw external event payload type. |
TPayload | unknown | Emitted signal payload type. |
Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | Unique identifier of the stream. |
Returns
StreamBuilder<TEvent, TPayload>
Frozen StreamBuilder instance.
topology()
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
| Parameter | Type | Description |
|---|---|---|
id | string | Unique identifier of the topology. |
Returns
TopologyConfigBuilder<string>
Frozen TopologyConfigBuilder instance.
Properties
| Property | Modifier | Type | Description | Defined in |
|---|---|---|---|---|
BudgetApprovalSchema | readonly | ZodObject<{ approved: ZodBoolean; increaseLimitToUsd: ZodOptional<ZodNumber>; }, $strip> | Canonical Zod schema for human budget approvals (BudgetApprovalSchema). | p-namespace-contract.ts:225 |
DistilledLessonCandidateSchema | readonly | ZodType<DistilledLessonCandidate, unknown, $ZodTypeInternals<DistilledLessonCandidate, unknown>> | Canonical Zod schema for distilled lesson candidates (DistilledLessonCandidateSchema). | p-namespace-contract.ts:227 |
GlobalRuleSchema | readonly | ZodObject<{ directive: ZodString; id: ZodString; }, $strip> | Canonical Zod schema for global rules (GlobalRuleSchema). | p-namespace-contract.ts:221 |
ResumeForkInputSchema | readonly | ZodObject<{ 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 |
ScopedRuleSchema | readonly | ZodObject<{ 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 |
ScopePredicateSchema | readonly | ZodObject<{ effects: ZodOptional<ZodCustom<FsGlobMatcherNode, FsGlobMatcherNode>>; partitions: ZodDefault<ZodArray<ZodString>>; }, $strip> | Canonical Zod schema for scope activation predicates (ScopePredicateSchema). | p-namespace-contract.ts:219 |
SpeculationCandidateSchema | readonly | <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 |
SpeculationInputSchema | readonly | <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 |