Interface: PrefixGroupBuilder
Defined in: builders/prefix-group-builder.ts:12
Fluent builder for run-immutable KV-cache prompt prefix groups (P.prefixGroup(id)).
Defines the shared toolsMode, sharedGrounding, sharedInstructions, and sharedRules pinned in Slot 1 of the 4-slot wire compilation order.
Extends
Methods
sharedGrounding()
sharedGrounding(...sources): PrefixGroupBuilder;Defined in: builders/prefix-group-builder.ts:36
Appends shared grounding files or inline strings pinned at the top of the wire system prompt in declaration order.
Sources are resolved once at run start and frozen for the lifetime of the run.
Parameters
| Parameter | Type | Description |
|---|---|---|
...sources | readonly MaybeSource<string>[] | Grounding sources or strings. |
Returns
PrefixGroupBuilder
New immutable prefix group builder.
sharedInstructions()
sharedInstructions(...sources): PrefixGroupBuilder;Defined in: builders/prefix-group-builder.ts:47
Appends shared instruction sources or inline strings pinned in the wire system prompt in declaration order.
Appears immediately after sharedGrounding in the compiled wire system prompt.
Parameters
| Parameter | Type | Description |
|---|---|---|
...sources | readonly MaybeSource<string>[] | Instruction sources or strings. |
Returns
PrefixGroupBuilder
New immutable prefix group builder.
sharedRules()
sharedRules(rules): PrefixGroupBuilder;Defined in: builders/prefix-group-builder.ts:58
Binds a shared RulesNode whose globalRules are pinned in the wire system prompt.
Ensures every agent sharing this prefix group sees an identical [GLOBAL_RULES] block.
Parameters
| Parameter | Type | Description |
|---|---|---|
rules | MaybeBuilder<RulesNode> | Compiled RulesNode or P.rules(...) builder. |
Returns
PrefixGroupBuilder
New immutable prefix group builder.
toAST()
toAST(): PrefixGroupNode;Defined in: ast/ast-builder.ts:20
Compiles the current builder configuration into a deeply frozen passive AST node.
Validates required builder invariants at compilation time and returns an immutable plain-object AST representation containing zero execution methods.
Returns
Deeply frozen passive AST node.
Inherited from
toolsMode()
toolsMode(mode): PrefixGroupBuilder;Defined in: builders/prefix-group-builder.ts:25
Configures whether wire tools arrays are cached per role ('role-scoped', default) or unified across all roles ('union').
Required to be 'union' when any member agent uses historyMode: 'clone-transcript' forks with differing toolsets.
Parameters
| Parameter | Type | Description |
|---|---|---|
mode | "union" | "role-scoped" | Wire tool schema caching mode. |
Returns
PrefixGroupBuilder
New immutable prefix group builder.
Properties
| Property | Modifier | Type | Description | Defined in |
|---|---|---|---|---|
id | readonly | string | Unique identifier of the prefix group. | builders/prefix-group-builder.ts:14 |