@burtson-labs/agent-core 1.6.42 → 1.6.44
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/graph/index.d.ts +1 -0
- package/dist/graph/index.d.ts.map +1 -1
- package/dist/graph/index.js +1 -0
- package/dist/graph/index.js.map +1 -1
- package/dist/graph/planner.d.ts +73 -0
- package/dist/graph/planner.d.ts.map +1 -0
- package/dist/graph/planner.js +175 -0
- package/dist/graph/planner.js.map +1 -0
- package/package.json +1 -1
package/dist/graph/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/graph/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/graph/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC"}
|
package/dist/graph/index.js
CHANGED
|
@@ -19,4 +19,5 @@ __exportStar(require("./scheduler"), exports);
|
|
|
19
19
|
__exportStar(require("./loopNode"), exports);
|
|
20
20
|
__exportStar(require("./contracts"), exports);
|
|
21
21
|
__exportStar(require("./envelopes"), exports);
|
|
22
|
+
__exportStar(require("./planner"), exports);
|
|
22
23
|
//# sourceMappingURL=index.js.map
|
package/dist/graph/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/graph/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAAwB;AACxB,8CAA4B;AAC5B,6CAA2B;AAC3B,8CAA4B;AAC5B,8CAA4B"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/graph/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAAwB;AACxB,8CAA4B;AAC5B,6CAA2B;AAC3B,8CAA4B;AAC5B,8CAA4B;AAC5B,4CAA0B"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Phase 9 — the planner: let the MODEL propose a graph; the HOST owns
|
|
3
|
+
* everything that runs.
|
|
4
|
+
*
|
|
5
|
+
* Hard boundary, per the plan ("the planner never owns the scheduler"):
|
|
6
|
+
* a proposal is pure DATA — ids, dependencies, per-node prompts, and a
|
|
7
|
+
* read-only hint. The model cannot name tools, pick executors, set
|
|
8
|
+
* concurrency, or touch scheduling. The host validates the proposal
|
|
9
|
+
* (structure, caps, DAG-ness), maps hints to envelopes it controls, builds
|
|
10
|
+
* the executors itself, and runs the graph with ITS options. A malicious or
|
|
11
|
+
* confused proposal can therefore only produce a smaller/different DAG of
|
|
12
|
+
* host-controlled work — never wider capabilities.
|
|
13
|
+
*
|
|
14
|
+
* Classification contract: the model first decides HOW a task should run —
|
|
15
|
+
* direct one answer, no tools needed beyond a single turn
|
|
16
|
+
* loop one focused multi-step turn (today's tool loop)
|
|
17
|
+
* graph ≥2 separable chunks that benefit from explicit deps/parallelism
|
|
18
|
+
* "graph always wins" is exactly the assumption Phase 10's bench exists to
|
|
19
|
+
* test, so `direct`/`loop` are first-class outcomes, not failures.
|
|
20
|
+
*/
|
|
21
|
+
import { type GraphSpec, type NodeEnvelope, type NodeExecutor } from './types';
|
|
22
|
+
export type ExecutionKind = 'direct' | 'loop' | 'graph';
|
|
23
|
+
/** One node as the model proposes it. Deliberately narrow: no tool names, no
|
|
24
|
+
* envelopes, no scheduler knobs — just work description + shape. */
|
|
25
|
+
export interface ProposalNode {
|
|
26
|
+
id: string;
|
|
27
|
+
/** Self-contained instruction for this node's turn. */
|
|
28
|
+
prompt: string;
|
|
29
|
+
label?: string;
|
|
30
|
+
dependsOn?: string[];
|
|
31
|
+
/** Hint that this node only reads/inspects. The HOST decides what envelope
|
|
32
|
+
* that maps to; in v1 hosts run ALL planned nodes read-only regardless. */
|
|
33
|
+
readOnly?: boolean;
|
|
34
|
+
}
|
|
35
|
+
export interface GraphProposal {
|
|
36
|
+
kind: ExecutionKind;
|
|
37
|
+
/** One sentence the UI can show for the classification. */
|
|
38
|
+
reason?: string;
|
|
39
|
+
/** Present iff kind === 'graph'. */
|
|
40
|
+
nodes?: ProposalNode[];
|
|
41
|
+
}
|
|
42
|
+
export interface PlannerLimits {
|
|
43
|
+
/** Cap on proposed nodes. Default 6 — enough to prove decomposition,
|
|
44
|
+
* small enough that a runaway proposal can't fan out a fleet. */
|
|
45
|
+
maxNodes?: number;
|
|
46
|
+
}
|
|
47
|
+
/** The classification+proposal prompt. One completion, no tools. */
|
|
48
|
+
export declare function buildPlannerPrompt(task: string, limits?: PlannerLimits): string;
|
|
49
|
+
export interface ParsedProposal {
|
|
50
|
+
ok: boolean;
|
|
51
|
+
proposal?: GraphProposal;
|
|
52
|
+
errors: string[];
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Parse + strictly validate a model response into a proposal. Never throws.
|
|
56
|
+
* Accepts a ```json fence or bare JSON amid prose (first balanced object).
|
|
57
|
+
*/
|
|
58
|
+
export declare function parseGraphProposal(text: string, limits?: PlannerLimits): ParsedProposal;
|
|
59
|
+
export interface MaterializeOptions {
|
|
60
|
+
/** Host-built executor for one proposed node (typically wrapLoopAsNode over
|
|
61
|
+
* the node's prompt). The proposal never supplies executors. */
|
|
62
|
+
makeExecutor: (node: ProposalNode) => NodeExecutor;
|
|
63
|
+
/** Host-owned envelope for one proposed node. The proposal's readOnly flag
|
|
64
|
+
* is a HINT; the host decides the actual bounds and may ignore or tighten
|
|
65
|
+
* it — it can never be loosened by the proposal. */
|
|
66
|
+
envelopeFor: (node: ProposalNode) => NodeEnvelope | undefined;
|
|
67
|
+
}
|
|
68
|
+
/** Turn a validated graph proposal into a runnable spec + executor map. */
|
|
69
|
+
export declare function materializeProposal(proposal: GraphProposal, opts: MaterializeOptions): {
|
|
70
|
+
spec: GraphSpec;
|
|
71
|
+
executors: Record<string, NodeExecutor>;
|
|
72
|
+
};
|
|
73
|
+
//# sourceMappingURL=planner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"planner.d.ts","sourceRoot":"","sources":["../../src/graph/planner.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EAAqC,KAAK,SAAS,EAAE,KAAK,YAAY,EAAE,KAAK,YAAY,EAAE,MAAM,SAAS,CAAC;AAElH,MAAM,MAAM,aAAa,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAC;AAExD;qEACqE;AACrE,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,uDAAuD;IACvD,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB;gFAC4E;IAC5E,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,aAAa,CAAC;IACpB,2DAA2D;IAC3D,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,oCAAoC;IACpC,KAAK,CAAC,EAAE,YAAY,EAAE,CAAC;CACxB;AAED,MAAM,WAAW,aAAa;IAC5B;sEACkE;IAClE,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAID,oEAAoE;AACpE,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,GAAE,aAAkB,GAAG,MAAM,CAuBnF;AAED,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,OAAO,CAAC;IACZ,QAAQ,CAAC,EAAE,aAAa,CAAC;IACzB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,GAAE,aAAkB,GAAG,cAAc,CA8D3F;AA6BD,MAAM,WAAW,kBAAkB;IACjC;qEACiE;IACjE,YAAY,EAAE,CAAC,IAAI,EAAE,YAAY,KAAK,YAAY,CAAC;IACnD;;yDAEqD;IACrD,WAAW,EAAE,CAAC,IAAI,EAAE,YAAY,KAAK,YAAY,GAAG,SAAS,CAAC;CAC/D;AAED,2EAA2E;AAC3E,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,aAAa,EACvB,IAAI,EAAE,kBAAkB,GACvB;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAA;CAAE,CAgB9D"}
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.buildPlannerPrompt = buildPlannerPrompt;
|
|
4
|
+
exports.parseGraphProposal = parseGraphProposal;
|
|
5
|
+
exports.materializeProposal = materializeProposal;
|
|
6
|
+
/**
|
|
7
|
+
* Phase 9 — the planner: let the MODEL propose a graph; the HOST owns
|
|
8
|
+
* everything that runs.
|
|
9
|
+
*
|
|
10
|
+
* Hard boundary, per the plan ("the planner never owns the scheduler"):
|
|
11
|
+
* a proposal is pure DATA — ids, dependencies, per-node prompts, and a
|
|
12
|
+
* read-only hint. The model cannot name tools, pick executors, set
|
|
13
|
+
* concurrency, or touch scheduling. The host validates the proposal
|
|
14
|
+
* (structure, caps, DAG-ness), maps hints to envelopes it controls, builds
|
|
15
|
+
* the executors itself, and runs the graph with ITS options. A malicious or
|
|
16
|
+
* confused proposal can therefore only produce a smaller/different DAG of
|
|
17
|
+
* host-controlled work — never wider capabilities.
|
|
18
|
+
*
|
|
19
|
+
* Classification contract: the model first decides HOW a task should run —
|
|
20
|
+
* direct one answer, no tools needed beyond a single turn
|
|
21
|
+
* loop one focused multi-step turn (today's tool loop)
|
|
22
|
+
* graph ≥2 separable chunks that benefit from explicit deps/parallelism
|
|
23
|
+
* "graph always wins" is exactly the assumption Phase 10's bench exists to
|
|
24
|
+
* test, so `direct`/`loop` are first-class outcomes, not failures.
|
|
25
|
+
*/
|
|
26
|
+
const types_1 = require("./types");
|
|
27
|
+
const DEFAULT_MAX_NODES = 6;
|
|
28
|
+
/** The classification+proposal prompt. One completion, no tools. */
|
|
29
|
+
function buildPlannerPrompt(task, limits = {}) {
|
|
30
|
+
const maxNodes = limits.maxNodes ?? DEFAULT_MAX_NODES;
|
|
31
|
+
return [
|
|
32
|
+
'You are a planning classifier for a coding agent. Decide how the task below should run and answer with ONE JSON object in a ```json fence and nothing else.',
|
|
33
|
+
'',
|
|
34
|
+
'Choose "kind":',
|
|
35
|
+
'- "direct": answerable in one response without multi-step tool work.',
|
|
36
|
+
'- "loop": one focused multi-step turn (read/edit/verify in sequence) — the default for most coding tasks.',
|
|
37
|
+
`- "graph": ONLY when the task splits into 2-${maxNodes} separable chunks where explicit dependencies or parallelism genuinely help (e.g. survey several areas independently, then synthesize).`,
|
|
38
|
+
'',
|
|
39
|
+
'JSON shape:',
|
|
40
|
+
'{"kind":"direct"|"loop"|"graph","reason":"one sentence","nodes":[{"id":"kebab-case","label":"short","prompt":"self-contained instruction","dependsOn":["other-id"],"readOnly":true}]}',
|
|
41
|
+
'',
|
|
42
|
+
'Rules for "graph":',
|
|
43
|
+
`- 2 to ${maxNodes} nodes; ids kebab-case and unique; dependsOn only lists earlier-declared ids; no cycles.`,
|
|
44
|
+
'- Each node prompt must stand alone (its reader sees ONLY that prompt plus its dependencies\' results).',
|
|
45
|
+
'- End with a node that depends on the others and synthesizes the final answer.',
|
|
46
|
+
'- Mark nodes that only read/inspect with "readOnly": true.',
|
|
47
|
+
'- Omit "nodes" entirely for "direct" and "loop".',
|
|
48
|
+
'',
|
|
49
|
+
'Task:',
|
|
50
|
+
task.trim()
|
|
51
|
+
].join('\n');
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Parse + strictly validate a model response into a proposal. Never throws.
|
|
55
|
+
* Accepts a ```json fence or bare JSON amid prose (first balanced object).
|
|
56
|
+
*/
|
|
57
|
+
function parseGraphProposal(text, limits = {}) {
|
|
58
|
+
const maxNodes = limits.maxNodes ?? DEFAULT_MAX_NODES;
|
|
59
|
+
const raw = extractJsonObject(text);
|
|
60
|
+
if (!raw)
|
|
61
|
+
return { ok: false, errors: ['no JSON object found in the planner response'] };
|
|
62
|
+
let parsed;
|
|
63
|
+
try {
|
|
64
|
+
parsed = JSON.parse(raw);
|
|
65
|
+
}
|
|
66
|
+
catch {
|
|
67
|
+
return { ok: false, errors: ['planner response JSON does not parse'] };
|
|
68
|
+
}
|
|
69
|
+
const obj = parsed;
|
|
70
|
+
const errors = [];
|
|
71
|
+
if (obj.kind !== 'direct' && obj.kind !== 'loop' && obj.kind !== 'graph') {
|
|
72
|
+
errors.push(`kind must be direct|loop|graph (got ${JSON.stringify(obj.kind)})`);
|
|
73
|
+
}
|
|
74
|
+
let nodes;
|
|
75
|
+
if (obj.kind === 'graph') {
|
|
76
|
+
if (!Array.isArray(obj.nodes) || obj.nodes.length === 0) {
|
|
77
|
+
errors.push('graph proposals need a non-empty "nodes" array');
|
|
78
|
+
}
|
|
79
|
+
else if (obj.nodes.length > maxNodes) {
|
|
80
|
+
errors.push(`too many nodes: ${obj.nodes.length} (max ${maxNodes})`);
|
|
81
|
+
}
|
|
82
|
+
else {
|
|
83
|
+
nodes = [];
|
|
84
|
+
for (const [i, n] of obj.nodes.entries()) {
|
|
85
|
+
const node = n;
|
|
86
|
+
if (!node || typeof node.id !== 'string' || node.id.trim() === '') {
|
|
87
|
+
errors.push(`node[${i}]: missing id`);
|
|
88
|
+
continue;
|
|
89
|
+
}
|
|
90
|
+
if (typeof node.prompt !== 'string' || node.prompt.trim().length < 8) {
|
|
91
|
+
errors.push(`node "${node.id}": missing or trivial prompt`);
|
|
92
|
+
continue;
|
|
93
|
+
}
|
|
94
|
+
nodes.push({
|
|
95
|
+
id: node.id.trim(),
|
|
96
|
+
prompt: node.prompt.trim(),
|
|
97
|
+
label: typeof node.label === 'string' ? node.label : undefined,
|
|
98
|
+
dependsOn: Array.isArray(node.dependsOn) ? node.dependsOn.filter((d) => typeof d === 'string') : undefined,
|
|
99
|
+
readOnly: node.readOnly === true,
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
if (errors.length === 0 && nodes.length > 0) {
|
|
103
|
+
// Structural validation via the same code the scheduler trusts.
|
|
104
|
+
const structural = (0, types_1.validateGraph)({ nodes: nodes.map(({ id, dependsOn }) => ({ id, dependsOn })) });
|
|
105
|
+
if (!structural.ok)
|
|
106
|
+
errors.push(...structural.errors);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
if (errors.length > 0)
|
|
111
|
+
return { ok: false, errors };
|
|
112
|
+
return {
|
|
113
|
+
ok: true,
|
|
114
|
+
errors: [],
|
|
115
|
+
proposal: {
|
|
116
|
+
kind: obj.kind,
|
|
117
|
+
reason: typeof obj.reason === 'string' ? obj.reason : undefined,
|
|
118
|
+
nodes,
|
|
119
|
+
},
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
/** First ```json fence, else the first balanced top-level {...}. */
|
|
123
|
+
function extractJsonObject(text) {
|
|
124
|
+
const fence = /```(?:json)?\s*([\s\S]*?)```/.exec(text);
|
|
125
|
+
if (fence && fence[1].trim().startsWith('{'))
|
|
126
|
+
return fence[1].trim();
|
|
127
|
+
const start = text.indexOf('{');
|
|
128
|
+
if (start === -1)
|
|
129
|
+
return null;
|
|
130
|
+
let depth = 0;
|
|
131
|
+
let inString = false;
|
|
132
|
+
let escaped = false;
|
|
133
|
+
for (let i = start; i < text.length; i++) {
|
|
134
|
+
const ch = text[i];
|
|
135
|
+
if (inString) {
|
|
136
|
+
if (escaped)
|
|
137
|
+
escaped = false;
|
|
138
|
+
else if (ch === '\\')
|
|
139
|
+
escaped = true;
|
|
140
|
+
else if (ch === '"')
|
|
141
|
+
inString = false;
|
|
142
|
+
continue;
|
|
143
|
+
}
|
|
144
|
+
if (ch === '"')
|
|
145
|
+
inString = true;
|
|
146
|
+
else if (ch === '{')
|
|
147
|
+
depth += 1;
|
|
148
|
+
else if (ch === '}') {
|
|
149
|
+
depth -= 1;
|
|
150
|
+
if (depth === 0)
|
|
151
|
+
return text.slice(start, i + 1);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
return null;
|
|
155
|
+
}
|
|
156
|
+
/** Turn a validated graph proposal into a runnable spec + executor map. */
|
|
157
|
+
function materializeProposal(proposal, opts) {
|
|
158
|
+
if (proposal.kind !== 'graph' || !proposal.nodes || proposal.nodes.length === 0) {
|
|
159
|
+
throw new Error('materializeProposal: only graph proposals with nodes can be materialized');
|
|
160
|
+
}
|
|
161
|
+
const specNodes = proposal.nodes.map((n) => ({
|
|
162
|
+
id: n.id,
|
|
163
|
+
label: n.label ?? n.id,
|
|
164
|
+
dependsOn: n.dependsOn,
|
|
165
|
+
envelope: opts.envelopeFor(n),
|
|
166
|
+
// Every planned node must actually produce something — silence is the
|
|
167
|
+
// graph version of a claim without work.
|
|
168
|
+
contract: { outputNonEmpty: true },
|
|
169
|
+
}));
|
|
170
|
+
const executors = {};
|
|
171
|
+
for (const n of proposal.nodes)
|
|
172
|
+
executors[n.id] = opts.makeExecutor(n);
|
|
173
|
+
return { spec: { nodes: specNodes }, executors };
|
|
174
|
+
}
|
|
175
|
+
//# sourceMappingURL=planner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"planner.js","sourceRoot":"","sources":["../../src/graph/planner.ts"],"names":[],"mappings":";;AAsDA,gDAuBC;AAYD,gDA8DC;AAwCD,kDAmBC;AAlND;;;;;;;;;;;;;;;;;;;GAmBG;AACH,mCAAkH;AA+BlH,MAAM,iBAAiB,GAAG,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