zelari-code 1.26.0 → 1.27.1

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.
@@ -0,0 +1,514 @@
1
+ /**
2
+ * Kraken graph engine — planner (F4).
3
+ *
4
+ * Turns a free-text prompt into a validated `TaskGraph` by asking an LLM for
5
+ * a small JSON DAG of explore/general nodes, then deterministically
6
+ * post-processing it: a `verify` node is auto-injected after every
7
+ * `general` node, and a `merge` node is auto-injected once two or more
8
+ * `general` nodes exist (so their worktree-isolated work gets sequentially
9
+ * merged after verification — see the F3 executor's merge handling).
10
+ *
11
+ * Follows the existing one-shot "LLM → JSON → parse with fallback" pattern
12
+ * used by `generateSkillFromUrl.ts` (raw `fetch` to `/chat/completions`,
13
+ * `stream: false`) rather than spinning up the full `AgentHarness` tool
14
+ * loop, since planning is a single structured-completion request with no
15
+ * tool use of its own.
16
+ *
17
+ * @since v0.10.x — Kraken graph engine (F4)
18
+ */
19
+ import { z } from 'zod';
20
+ import { createGraph, validateGraph, DEFAULT_MAX_NODES, } from '@zelari/core';
21
+ import { getModelForProvider, getProviderConfig } from '../providerConfig.js';
22
+ import { resolveApiKeyWithMeta } from '../keyStore.js';
23
+ import { resolveBaseUrl } from '../provider/openai-compatible.js';
24
+ const MAX_PLAN_ATTEMPTS = 2;
25
+ /**
26
+ * Default wall-clock budget for the planner's (non-streaming) completion
27
+ * request. Matches the executor's `DEFAULT_NODE_TIMEOUT_MS`: a single graph
28
+ * node is already allowed 5 minutes, so capping the planning step at less
29
+ * made no sense — reasoning-capable models routinely spend well over a
30
+ * minute on chain-of-thought before emitting the JSON answer, and a
31
+ * non-streaming request shows nothing until it's done. Set
32
+ * ZELARI_KRAKEN_PLANNER_TIMEOUT_MS=0 to disable the timer entirely.
33
+ */
34
+ const DEFAULT_LLM_TIMEOUT_MS = 300_000;
35
+ function resolvePlannerTimeoutMs(env = process.env) {
36
+ const raw = env.ZELARI_KRAKEN_PLANNER_TIMEOUT_MS;
37
+ if (raw === undefined || raw === '')
38
+ return DEFAULT_LLM_TIMEOUT_MS;
39
+ const n = Number.parseInt(raw, 10);
40
+ return Number.isFinite(n) && n >= 0 ? n : DEFAULT_LLM_TIMEOUT_MS;
41
+ }
42
+ /**
43
+ * A failure of the LLM *transport* (timeout, HTTP error, network error) as
44
+ * opposed to a malformed-but-received response. The retry-with-corrective-
45
+ * feedback loop in {@link planTaskGraph} only helps for the latter: re-asking
46
+ * a model that never answered just doubles the wait, with an even longer
47
+ * prompt than the one that already timed out.
48
+ */
49
+ export class PlannerTransportError extends Error {
50
+ constructor(message) {
51
+ super(message);
52
+ this.name = 'PlannerTransportError';
53
+ }
54
+ }
55
+ /**
56
+ * Default max_tokens for the planner's completion request. Complex/long
57
+ * prompts against reasoning-capable models can burn most or all of a small
58
+ * budget on chain-of-thought before ever emitting the JSON answer, leaving
59
+ * `message.content` empty (finish_reason='length') — the retry loop alone
60
+ * can't fix that since it repeats the exact same truncation. Override with
61
+ * ZELARI_KRAKEN_PLANNER_MAX_TOKENS for especially large planning prompts.
62
+ */
63
+ const DEFAULT_LLM_MAX_TOKENS = 8192;
64
+ function resolvePlannerMaxTokens(env = process.env) {
65
+ const raw = env.ZELARI_KRAKEN_PLANNER_MAX_TOKENS;
66
+ if (raw === undefined || raw === '')
67
+ return DEFAULT_LLM_MAX_TOKENS;
68
+ const n = Number.parseInt(raw, 10);
69
+ return Number.isFinite(n) && n > 0 ? n : DEFAULT_LLM_MAX_TOKENS;
70
+ }
71
+ /** Default retry budget per auto-generated/planned node kind. */
72
+ const DEFAULT_MAX_RETRIES = {
73
+ explore: 0,
74
+ general: 1,
75
+ verify: 1,
76
+ fix: 0,
77
+ merge: 0,
78
+ };
79
+ export const KRAKEN_PLANNER_SYSTEM_PROMPT = [
80
+ 'You are the PLANNER for Kraken, a multi-agent graph executor.',
81
+ "Decompose the user's goal into a small DAG of sub-agent tasks (\"tentacles\").",
82
+ '',
83
+ 'Return ONLY a single JSON object (no markdown fences, no prose) of the form:',
84
+ '{ "nodes": [ { "id": string, "kind": "explore"|"general", "label": string, ' +
85
+ '"prompt": string, "scope"?: string[], "acceptance"?: string[], "deps": string[] } ] }',
86
+ '',
87
+ 'Rules:',
88
+ '- kind "explore": read-only research (no edits). Use to gather context before edits.',
89
+ '- kind "general": can edit files for one bounded, self-contained unit of work.',
90
+ '- Do NOT emit "verify", "fix", or "merge" nodes — the executor adds those automatically.',
91
+ '- "id" must be short, unique, kebab-case (e.g. "e1", "g-auth", "g-ui").',
92
+ '- "prompt" must be fully self-contained: the sub-agent sees ONLY this prompt, not this conversation.',
93
+ '- "deps" lists ids of nodes that must finish first (topological order); [] if none.',
94
+ '- When two "general" nodes touch disjoint parts of the codebase, give each a "scope" ' +
95
+ '(path/glob allowlist) so they can run in parallel safely. If scopes might overlap, ' +
96
+ 'either omit scope (forces sequential execution) or add a dep between them.',
97
+ '- Prefer one "explore" node feeding several parallel "general" nodes over one giant node.',
98
+ '- Keep the graph small: most goals need 3-8 nodes total.',
99
+ '- "acceptance" (optional) lists concrete, checkable criteria for a "general" node.',
100
+ ].join('\n');
101
+ const PlannedNodeSchema = z.object({
102
+ id: z
103
+ .string()
104
+ .min(1)
105
+ .max(64)
106
+ .regex(/^[a-zA-Z0-9_-]+$/, 'id must be alphanumeric/dash/underscore'),
107
+ kind: z.enum(['explore', 'general']),
108
+ label: z.string().min(1).max(200),
109
+ prompt: z.string().min(1),
110
+ scope: z.array(z.string().min(1)).max(32).optional(),
111
+ acceptance: z.array(z.string().min(1)).max(16).optional(),
112
+ deps: z.array(z.string()).max(32).default([]),
113
+ });
114
+ const PlannedGraphSchema = z.object({
115
+ nodes: z.array(PlannedNodeSchema).min(1).max(DEFAULT_MAX_NODES),
116
+ });
117
+ /**
118
+ * Strip ```json fences, extract the first balanced `{...}` object (tolerating
119
+ * trailing text), and parse it — falling back to {@link repairLooseJson} when
120
+ * a strict parse fails. Some models emit JS-object-literal-ish output
121
+ * (unquoted keys, single-quoted strings, trailing commas) despite explicit
122
+ * "valid JSON only" instructions; repairing once here is cheaper and more
123
+ * reliable than relying solely on the retry-with-feedback loop for a mistake
124
+ * a model tends to repeat identically.
125
+ */
126
+ export function extractJsonObject(text) {
127
+ const trimmed = text.trim();
128
+ const fenced = /^```(?:json)?\s*([\s\S]*?)```$/i.exec(trimmed);
129
+ const body = fenced ? fenced[1].trim() : trimmed;
130
+ const balanced = extractBalancedJsonObject(body);
131
+ const candidate = balanced ?? body;
132
+ try {
133
+ return JSON.parse(candidate);
134
+ }
135
+ catch (err) {
136
+ try {
137
+ return JSON.parse(repairLooseJson(candidate));
138
+ }
139
+ catch {
140
+ throw err instanceof Error ? err : new Error(String(err));
141
+ }
142
+ }
143
+ }
144
+ /**
145
+ * Find the first top-level `{...}` object by brace depth, ignoring braces
146
+ * inside "double" or 'single' quoted strings (some models emit single-quoted
147
+ * strings despite JSON instructions — without tracking those too, a `}`
148
+ * inside one would prematurely close the balance count).
149
+ */
150
+ function extractBalancedJsonObject(s) {
151
+ const start = s.indexOf('{');
152
+ if (start < 0)
153
+ return null;
154
+ let depth = 0;
155
+ let quote = null;
156
+ let escape = false;
157
+ for (let i = start; i < s.length; i++) {
158
+ const ch = s[i];
159
+ if (quote) {
160
+ if (escape)
161
+ escape = false;
162
+ else if (ch === '\\')
163
+ escape = true;
164
+ else if (ch === quote)
165
+ quote = null;
166
+ continue;
167
+ }
168
+ if (ch === '"' || ch === "'") {
169
+ quote = ch;
170
+ continue;
171
+ }
172
+ if (ch === '{')
173
+ depth += 1;
174
+ else if (ch === '}') {
175
+ depth -= 1;
176
+ if (depth === 0)
177
+ return s.slice(start, i + 1);
178
+ }
179
+ }
180
+ return null;
181
+ }
182
+ /**
183
+ * Best-effort repair for the JSON mistakes models make most often despite
184
+ * being told "valid JSON only": single-quoted strings (Python/JS-dict
185
+ * style), unquoted/bareword object keys (JS-object-literal style), and
186
+ * trailing commas before `}`/`]`. Deliberately permissive — this is a
187
+ * fallback tried only after a strict `JSON.parse` has already failed, not a
188
+ * general JSON5 parser.
189
+ */
190
+ function repairLooseJson(s) {
191
+ let out = '';
192
+ let i = 0;
193
+ const n = s.length;
194
+ while (i < n) {
195
+ const ch = s[i];
196
+ if (ch === '"') {
197
+ out += ch;
198
+ i += 1;
199
+ while (i < n) {
200
+ const c = s[i];
201
+ out += c;
202
+ i += 1;
203
+ if (c === '\\') {
204
+ if (i < n) {
205
+ out += s[i];
206
+ i += 1;
207
+ }
208
+ continue;
209
+ }
210
+ if (c === '"')
211
+ break;
212
+ }
213
+ continue;
214
+ }
215
+ if (ch === "'") {
216
+ // Convert a single-quoted string to a double-quoted JSON string.
217
+ let value = '';
218
+ i += 1;
219
+ while (i < n) {
220
+ const c = s[i];
221
+ if (c === '\\' && i + 1 < n) {
222
+ value += s[i + 1] === "'" ? "'" : c + s[i + 1];
223
+ i += 2;
224
+ continue;
225
+ }
226
+ if (c === "'") {
227
+ i += 1;
228
+ break;
229
+ }
230
+ value += c;
231
+ i += 1;
232
+ }
233
+ out += `"${value.replace(/"/g, '\\"')}"`;
234
+ continue;
235
+ }
236
+ // Bare identifier immediately followed by `:` (optionally spaced) outside
237
+ // any string — quote it as a JSON object key.
238
+ if (/[A-Za-z_$]/.test(ch)) {
239
+ let j = i + 1;
240
+ while (j < n && /[A-Za-z0-9_$]/.test(s[j]))
241
+ j += 1;
242
+ let k = j;
243
+ while (k < n && /\s/.test(s[k]))
244
+ k += 1;
245
+ if (s[k] === ':') {
246
+ out += `"${s.slice(i, j)}"`;
247
+ i = j;
248
+ continue;
249
+ }
250
+ out += s.slice(i, j);
251
+ i = j;
252
+ continue;
253
+ }
254
+ out += ch;
255
+ i += 1;
256
+ }
257
+ return stripTrailingCommas(out);
258
+ }
259
+ /** Drop a `,` immediately before a closing `}`/`]` (string-aware). */
260
+ function stripTrailingCommas(s) {
261
+ let out = '';
262
+ let i = 0;
263
+ const n = s.length;
264
+ while (i < n) {
265
+ const ch = s[i];
266
+ if (ch === '"') {
267
+ out += ch;
268
+ i += 1;
269
+ while (i < n) {
270
+ const c = s[i];
271
+ out += c;
272
+ i += 1;
273
+ if (c === '\\') {
274
+ if (i < n) {
275
+ out += s[i];
276
+ i += 1;
277
+ }
278
+ continue;
279
+ }
280
+ if (c === '"')
281
+ break;
282
+ }
283
+ continue;
284
+ }
285
+ if (ch === ',') {
286
+ let j = i + 1;
287
+ while (j < n && /\s/.test(s[j]))
288
+ j += 1;
289
+ if (s[j] === '}' || s[j] === ']') {
290
+ i += 1; // drop the trailing comma
291
+ continue;
292
+ }
293
+ }
294
+ out += ch;
295
+ i += 1;
296
+ }
297
+ return out;
298
+ }
299
+ async function resolveLlm(opts) {
300
+ const active = (opts.provider?.trim() || getProviderConfig().activeProviderId);
301
+ const meta = await resolveApiKeyWithMeta(active);
302
+ if (!meta?.apiKey) {
303
+ throw new Error(`No API key for provider '${active}'. Save a key in Settings → Provider.`);
304
+ }
305
+ const baseUrl = resolveBaseUrl(active);
306
+ if (!baseUrl) {
307
+ throw new Error(`No base URL for provider '${active}'. Set a custom endpoint in Settings.`);
308
+ }
309
+ // Precedence mirrors the tentacle model routing in `tools/krakenModel.ts`:
310
+ // an explicit caller override first (Desktop's picker / --model, see the
311
+ // provider-anchoring fix in 734766f), then the planner-specific env, then
312
+ // the persisted default. Planning is one structured completion with no tool
313
+ // use, so pointing it at a cheap non-reasoning model is usually the right
314
+ // call even when the main model is a slow reasoner.
315
+ const model = opts.model?.trim() ||
316
+ process.env.ZELARI_KRAKEN_PLANNER_MODEL?.trim() ||
317
+ getModelForProvider(active) ||
318
+ process.env.ZELARI_MODEL ||
319
+ '';
320
+ if (!model) {
321
+ throw new Error(`No model selected for provider '${active}'`);
322
+ }
323
+ return { provider: active, model, apiKey: meta.apiKey, baseUrl };
324
+ }
325
+ async function createDefaultLlmClient(opts) {
326
+ const llm = await resolveLlm(opts);
327
+ return {
328
+ async complete({ system, user }) {
329
+ const timeoutMs = resolvePlannerTimeoutMs();
330
+ const controller = new AbortController();
331
+ let timedOut = false;
332
+ const t = timeoutMs > 0
333
+ ? setTimeout(() => {
334
+ timedOut = true;
335
+ controller.abort();
336
+ }, timeoutMs)
337
+ : undefined;
338
+ try {
339
+ const url = `${llm.baseUrl.replace(/\/$/, '')}/chat/completions`;
340
+ let res;
341
+ try {
342
+ res = await fetch(url, {
343
+ method: 'POST',
344
+ signal: controller.signal,
345
+ headers: {
346
+ 'content-type': 'application/json',
347
+ authorization: `Bearer ${llm.apiKey}`,
348
+ },
349
+ body: JSON.stringify({
350
+ model: llm.model,
351
+ temperature: 0.2,
352
+ max_tokens: resolvePlannerMaxTokens(),
353
+ stream: false,
354
+ messages: [
355
+ { role: 'system', content: system },
356
+ { role: 'user', content: user },
357
+ ],
358
+ }),
359
+ });
360
+ }
361
+ catch (err) {
362
+ // The raw AbortError ("This operation was aborted") says nothing
363
+ // about which budget ran out or how to raise it.
364
+ if (timedOut) {
365
+ throw new PlannerTransportError(`Planner request timed out after ${Math.round(timeoutMs / 1000)}s (no response). ` +
366
+ `Raise ZELARI_KRAKEN_PLANNER_TIMEOUT_MS, or set ZELARI_KRAKEN_PLANNER_MODEL ` +
367
+ `to a faster non-reasoning model.`);
368
+ }
369
+ throw new PlannerTransportError(`Planner request failed: ${err instanceof Error ? err.message : String(err)}`);
370
+ }
371
+ if (!res.ok) {
372
+ const errBody = await res.text().catch(() => '');
373
+ throw new PlannerTransportError(`LLM HTTP ${res.status}${errBody ? `: ${errBody.slice(0, 200)}` : ''}`);
374
+ }
375
+ const json = (await res.json());
376
+ const choice = json.choices?.[0];
377
+ const text = choice?.message?.content?.trim();
378
+ if (text)
379
+ return text;
380
+ // Some reasoning models put chain-of-thought in `reasoning_content`
381
+ // and can leave `content` empty if truncated (finish_reason='length')
382
+ // before ever emitting the JSON answer. Try to salvage a JSON object
383
+ // from the reasoning trace itself before giving up — it's often the
384
+ // last thing the model was writing when it ran out of budget.
385
+ const reasoning = choice?.message?.reasoning_content?.trim();
386
+ if (reasoning && extractBalancedJsonObject(reasoning))
387
+ return reasoning;
388
+ const reason = choice?.finish_reason;
389
+ throw new Error(`Empty model response${reason ? ` (finish_reason=${reason})` : ''}` +
390
+ (reason === 'length'
391
+ ? ' — the model likely ran out of tokens before producing JSON;' +
392
+ ' raise ZELARI_KRAKEN_PLANNER_MAX_TOKENS or simplify the prompt.'
393
+ : ''));
394
+ }
395
+ finally {
396
+ if (t !== undefined)
397
+ clearTimeout(t);
398
+ }
399
+ },
400
+ };
401
+ }
402
+ function buildPlannerUserPrompt(prompt) {
403
+ return `Goal:\n${prompt.trim()}\n\nReturn ONLY the JSON object described in the system prompt.`;
404
+ }
405
+ function uniqueId(base, existing) {
406
+ if (!existing.has(base))
407
+ return base;
408
+ let i = 2;
409
+ while (existing.has(`${base}-${i}`))
410
+ i += 1;
411
+ return `${base}-${i}`;
412
+ }
413
+ function buildAutoVerifyPrompt(general) {
414
+ const acc = general.acceptance && general.acceptance.length > 0
415
+ ? `\n\nAcceptance criteria to check:\n${general.acceptance.map((a) => `- ${a}`).join('\n')}`
416
+ : '';
417
+ return `Verify the following work was completed correctly on disk: ${general.label}.${acc}`;
418
+ }
419
+ /**
420
+ * Convert LLM-planned nodes into a full `TaskGraph`, auto-injecting a
421
+ * `verify` node after every `general` node and, once ≥2 `general` nodes
422
+ * exist, a `merge` node depending on all their (auto-injected) verify
423
+ * nodes — mirroring the F3 executor's sequential worktree-merge handling.
424
+ */
425
+ export function buildGraphFromPlan(graphId, planned) {
426
+ const nodes = planned.map((p) => ({
427
+ id: p.id,
428
+ kind: p.kind,
429
+ label: p.label,
430
+ prompt: p.prompt,
431
+ scope: p.scope,
432
+ acceptance: p.acceptance,
433
+ deps: [...p.deps],
434
+ status: 'pending',
435
+ retryCount: 0,
436
+ maxRetries: DEFAULT_MAX_RETRIES[p.kind],
437
+ }));
438
+ const ids = new Set(nodes.map((n) => n.id));
439
+ const generalNodes = nodes.filter((n) => n.kind === 'general');
440
+ const verifyIdsForMerge = [];
441
+ for (const g of generalNodes) {
442
+ const verifyId = uniqueId(`verify-${g.id}`, ids);
443
+ ids.add(verifyId);
444
+ nodes.push({
445
+ id: verifyId,
446
+ kind: 'verify',
447
+ label: `verify: ${g.label}`,
448
+ prompt: buildAutoVerifyPrompt(g),
449
+ deps: [g.id],
450
+ status: 'pending',
451
+ retryCount: 0,
452
+ maxRetries: DEFAULT_MAX_RETRIES.verify,
453
+ });
454
+ verifyIdsForMerge.push(verifyId);
455
+ }
456
+ if (generalNodes.length >= 2) {
457
+ const mergeId = uniqueId('merge', ids);
458
+ ids.add(mergeId);
459
+ nodes.push({
460
+ id: mergeId,
461
+ kind: 'merge',
462
+ label: 'merge parallel work',
463
+ prompt: 'Sequentially merge the parallel general tentacles once verified.',
464
+ deps: verifyIdsForMerge,
465
+ status: 'pending',
466
+ retryCount: 0,
467
+ maxRetries: DEFAULT_MAX_RETRIES.merge,
468
+ });
469
+ }
470
+ return createGraph(graphId, nodes);
471
+ }
472
+ /**
473
+ * Ask the LLM for a task DAG and return a validated, ready-to-execute
474
+ * `TaskGraph`. Retries once with corrective feedback if the model's
475
+ * response is malformed JSON, fails schema validation, or produces an
476
+ * invalid graph (cycle, unknown dep, too many nodes); throws with the last
477
+ * error after `MAX_PLAN_ATTEMPTS`. A {@link PlannerTransportError} (timeout,
478
+ * HTTP or network failure) is rethrown on the first attempt instead — see the
479
+ * catch block.
480
+ */
481
+ export async function planTaskGraph(opts) {
482
+ const client = opts.llmClient ?? (await createDefaultLlmClient({ provider: opts.provider, model: opts.model }));
483
+ const maxNodes = opts.maxNodes ?? DEFAULT_MAX_NODES;
484
+ const graphId = opts.graphId ?? `kraken-${Date.now().toString(36)}`;
485
+ const userBase = buildPlannerUserPrompt(opts.prompt);
486
+ let lastError;
487
+ let userMessage = userBase;
488
+ for (let attempt = 1; attempt <= MAX_PLAN_ATTEMPTS; attempt++) {
489
+ try {
490
+ const text = await client.complete({ system: KRAKEN_PLANNER_SYSTEM_PROMPT, user: userMessage });
491
+ const parsedJson = extractJsonObject(text);
492
+ const validated = PlannedGraphSchema.parse(parsedJson);
493
+ const graph = buildGraphFromPlan(graphId, validated.nodes);
494
+ const check = validateGraph(graph, { maxNodes });
495
+ if (!check.ok) {
496
+ throw new Error(`invalid graph: ${check.errors.join('; ')}`);
497
+ }
498
+ return graph;
499
+ }
500
+ catch (err) {
501
+ // A transport failure means the model never answered — corrective
502
+ // feedback has nothing to correct, and the retry would re-send an even
503
+ // longer prompt into the same wall. Surface it immediately.
504
+ if (err instanceof PlannerTransportError)
505
+ throw err;
506
+ lastError = err instanceof Error ? err.message : String(err);
507
+ userMessage =
508
+ `${userBase}\n\nYour previous response was invalid (${lastError}). ` +
509
+ 'Return ONLY corrected JSON matching the schema exactly — no prose, no markdown fences.';
510
+ }
511
+ }
512
+ throw new Error(`kraken planner: failed to produce a valid task graph after ${MAX_PLAN_ATTEMPTS} attempts — ${lastError}`);
513
+ }
514
+ //# sourceMappingURL=planner.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"planner.js","sourceRoot":"","sources":["../../../src/cli/kraken/planner.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,WAAW,EACX,aAAa,EACb,iBAAiB,GAIlB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAC9E,OAAO,EAAE,qBAAqB,EAAqB,MAAM,gBAAgB,CAAC;AAC1E,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAElE,MAAM,iBAAiB,GAAG,CAAC,CAAC;AAE5B;;;;;;;;GAQG;AACH,MAAM,sBAAsB,GAAG,OAAO,CAAC;AAEvC,SAAS,uBAAuB,CAAC,MAAyB,OAAO,CAAC,GAAG;IACnE,MAAM,GAAG,GAAG,GAAG,CAAC,gCAAgC,CAAC;IACjD,IAAI,GAAG,KAAK,SAAS,IAAI,GAAG,KAA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,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;YAC/D,CAAC;YACD,OAAO,KAAK,CAAC;QACf,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,kEAAkE;YAClE,uEAAuE;YACvE,4DAA4D;YAC5D,IAAI,GAAG,YAAY,qBAAqB;gBAAE,MAAM,GAAG,CAAC;YACpD,SAAS,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;YAC7D,WAAW;gBACT,GAAG,QAAQ,2CAA2C,SAAS,KAAK;oBACpE,wFAAwF,CAAC;QAC7F,CAAC;IACH,CAAC;IAED,MAAM,IAAI,KAAK,CACb,8DAA8D,iBAAiB,eAAe,SAAS,EAAE,CAC1G,CAAC;AACJ,CAAC"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Kraken graph engine — tentacle run surface (F2).
3
+ *
4
+ * Stable import path for the graph executor (F3) and any orchestration code
5
+ * that needs to drive a sub-agent tentacle directly, WITHOUT the `task` tool's
6
+ * per-turn spawn cap. The implementation lives in `tools/taskTool.ts` (shared
7
+ * with the `task` tool so behavior stays identical); this module re-exports the
8
+ * orchestration-facing subset.
9
+ *
10
+ * @since v0.10.x — Kraken graph engine (F2)
11
+ */
12
+ export { runTentacle, runSubAgent, } from '../tools/taskTool.js';
13
+ //# sourceMappingURL=tentacle.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tentacle.js","sourceRoot":"","sources":["../../../src/cli/kraken/tentacle.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EACL,WAAW,EACX,WAAW,GAUZ,MAAM,sBAAsB,CAAC"}