zelari-code 1.26.0 → 1.27.0

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,447 @@
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 LLM_TIMEOUT_MS = 90_000;
25
+ const MAX_PLAN_ATTEMPTS = 2;
26
+ /**
27
+ * Default max_tokens for the planner's completion request. Complex/long
28
+ * prompts against reasoning-capable models can burn most or all of a small
29
+ * budget on chain-of-thought before ever emitting the JSON answer, leaving
30
+ * `message.content` empty (finish_reason='length') — the retry loop alone
31
+ * can't fix that since it repeats the exact same truncation. Override with
32
+ * ZELARI_KRAKEN_PLANNER_MAX_TOKENS for especially large planning prompts.
33
+ */
34
+ const DEFAULT_LLM_MAX_TOKENS = 8192;
35
+ function resolvePlannerMaxTokens(env = process.env) {
36
+ const raw = env.ZELARI_KRAKEN_PLANNER_MAX_TOKENS;
37
+ if (raw === undefined || raw === '')
38
+ return DEFAULT_LLM_MAX_TOKENS;
39
+ const n = Number.parseInt(raw, 10);
40
+ return Number.isFinite(n) && n > 0 ? n : DEFAULT_LLM_MAX_TOKENS;
41
+ }
42
+ /** Default retry budget per auto-generated/planned node kind. */
43
+ const DEFAULT_MAX_RETRIES = {
44
+ explore: 0,
45
+ general: 1,
46
+ verify: 1,
47
+ fix: 0,
48
+ merge: 0,
49
+ };
50
+ export const KRAKEN_PLANNER_SYSTEM_PROMPT = [
51
+ 'You are the PLANNER for Kraken, a multi-agent graph executor.',
52
+ "Decompose the user's goal into a small DAG of sub-agent tasks (\"tentacles\").",
53
+ '',
54
+ 'Return ONLY a single JSON object (no markdown fences, no prose) of the form:',
55
+ '{ "nodes": [ { "id": string, "kind": "explore"|"general", "label": string, ' +
56
+ '"prompt": string, "scope"?: string[], "acceptance"?: string[], "deps": string[] } ] }',
57
+ '',
58
+ 'Rules:',
59
+ '- kind "explore": read-only research (no edits). Use to gather context before edits.',
60
+ '- kind "general": can edit files for one bounded, self-contained unit of work.',
61
+ '- Do NOT emit "verify", "fix", or "merge" nodes — the executor adds those automatically.',
62
+ '- "id" must be short, unique, kebab-case (e.g. "e1", "g-auth", "g-ui").',
63
+ '- "prompt" must be fully self-contained: the sub-agent sees ONLY this prompt, not this conversation.',
64
+ '- "deps" lists ids of nodes that must finish first (topological order); [] if none.',
65
+ '- When two "general" nodes touch disjoint parts of the codebase, give each a "scope" ' +
66
+ '(path/glob allowlist) so they can run in parallel safely. If scopes might overlap, ' +
67
+ 'either omit scope (forces sequential execution) or add a dep between them.',
68
+ '- Prefer one "explore" node feeding several parallel "general" nodes over one giant node.',
69
+ '- Keep the graph small: most goals need 3-8 nodes total.',
70
+ '- "acceptance" (optional) lists concrete, checkable criteria for a "general" node.',
71
+ ].join('\n');
72
+ const PlannedNodeSchema = z.object({
73
+ id: z
74
+ .string()
75
+ .min(1)
76
+ .max(64)
77
+ .regex(/^[a-zA-Z0-9_-]+$/, 'id must be alphanumeric/dash/underscore'),
78
+ kind: z.enum(['explore', 'general']),
79
+ label: z.string().min(1).max(200),
80
+ prompt: z.string().min(1),
81
+ scope: z.array(z.string().min(1)).max(32).optional(),
82
+ acceptance: z.array(z.string().min(1)).max(16).optional(),
83
+ deps: z.array(z.string()).max(32).default([]),
84
+ });
85
+ const PlannedGraphSchema = z.object({
86
+ nodes: z.array(PlannedNodeSchema).min(1).max(DEFAULT_MAX_NODES),
87
+ });
88
+ /**
89
+ * Strip ```json fences, extract the first balanced `{...}` object (tolerating
90
+ * trailing text), and parse it — falling back to {@link repairLooseJson} when
91
+ * a strict parse fails. Some models emit JS-object-literal-ish output
92
+ * (unquoted keys, single-quoted strings, trailing commas) despite explicit
93
+ * "valid JSON only" instructions; repairing once here is cheaper and more
94
+ * reliable than relying solely on the retry-with-feedback loop for a mistake
95
+ * a model tends to repeat identically.
96
+ */
97
+ export function extractJsonObject(text) {
98
+ const trimmed = text.trim();
99
+ const fenced = /^```(?:json)?\s*([\s\S]*?)```$/i.exec(trimmed);
100
+ const body = fenced ? fenced[1].trim() : trimmed;
101
+ const balanced = extractBalancedJsonObject(body);
102
+ const candidate = balanced ?? body;
103
+ try {
104
+ return JSON.parse(candidate);
105
+ }
106
+ catch (err) {
107
+ try {
108
+ return JSON.parse(repairLooseJson(candidate));
109
+ }
110
+ catch {
111
+ throw err instanceof Error ? err : new Error(String(err));
112
+ }
113
+ }
114
+ }
115
+ /**
116
+ * Find the first top-level `{...}` object by brace depth, ignoring braces
117
+ * inside "double" or 'single' quoted strings (some models emit single-quoted
118
+ * strings despite JSON instructions — without tracking those too, a `}`
119
+ * inside one would prematurely close the balance count).
120
+ */
121
+ function extractBalancedJsonObject(s) {
122
+ const start = s.indexOf('{');
123
+ if (start < 0)
124
+ return null;
125
+ let depth = 0;
126
+ let quote = null;
127
+ let escape = false;
128
+ for (let i = start; i < s.length; i++) {
129
+ const ch = s[i];
130
+ if (quote) {
131
+ if (escape)
132
+ escape = false;
133
+ else if (ch === '\\')
134
+ escape = true;
135
+ else if (ch === quote)
136
+ quote = null;
137
+ continue;
138
+ }
139
+ if (ch === '"' || ch === "'") {
140
+ quote = ch;
141
+ continue;
142
+ }
143
+ if (ch === '{')
144
+ depth += 1;
145
+ else if (ch === '}') {
146
+ depth -= 1;
147
+ if (depth === 0)
148
+ return s.slice(start, i + 1);
149
+ }
150
+ }
151
+ return null;
152
+ }
153
+ /**
154
+ * Best-effort repair for the JSON mistakes models make most often despite
155
+ * being told "valid JSON only": single-quoted strings (Python/JS-dict
156
+ * style), unquoted/bareword object keys (JS-object-literal style), and
157
+ * trailing commas before `}`/`]`. Deliberately permissive — this is a
158
+ * fallback tried only after a strict `JSON.parse` has already failed, not a
159
+ * general JSON5 parser.
160
+ */
161
+ function repairLooseJson(s) {
162
+ let out = '';
163
+ let i = 0;
164
+ const n = s.length;
165
+ while (i < n) {
166
+ const ch = s[i];
167
+ if (ch === '"') {
168
+ out += ch;
169
+ i += 1;
170
+ while (i < n) {
171
+ const c = s[i];
172
+ out += c;
173
+ i += 1;
174
+ if (c === '\\') {
175
+ if (i < n) {
176
+ out += s[i];
177
+ i += 1;
178
+ }
179
+ continue;
180
+ }
181
+ if (c === '"')
182
+ break;
183
+ }
184
+ continue;
185
+ }
186
+ if (ch === "'") {
187
+ // Convert a single-quoted string to a double-quoted JSON string.
188
+ let value = '';
189
+ i += 1;
190
+ while (i < n) {
191
+ const c = s[i];
192
+ if (c === '\\' && i + 1 < n) {
193
+ value += s[i + 1] === "'" ? "'" : c + s[i + 1];
194
+ i += 2;
195
+ continue;
196
+ }
197
+ if (c === "'") {
198
+ i += 1;
199
+ break;
200
+ }
201
+ value += c;
202
+ i += 1;
203
+ }
204
+ out += `"${value.replace(/"/g, '\\"')}"`;
205
+ continue;
206
+ }
207
+ // Bare identifier immediately followed by `:` (optionally spaced) outside
208
+ // any string — quote it as a JSON object key.
209
+ if (/[A-Za-z_$]/.test(ch)) {
210
+ let j = i + 1;
211
+ while (j < n && /[A-Za-z0-9_$]/.test(s[j]))
212
+ j += 1;
213
+ let k = j;
214
+ while (k < n && /\s/.test(s[k]))
215
+ k += 1;
216
+ if (s[k] === ':') {
217
+ out += `"${s.slice(i, j)}"`;
218
+ i = j;
219
+ continue;
220
+ }
221
+ out += s.slice(i, j);
222
+ i = j;
223
+ continue;
224
+ }
225
+ out += ch;
226
+ i += 1;
227
+ }
228
+ return stripTrailingCommas(out);
229
+ }
230
+ /** Drop a `,` immediately before a closing `}`/`]` (string-aware). */
231
+ function stripTrailingCommas(s) {
232
+ let out = '';
233
+ let i = 0;
234
+ const n = s.length;
235
+ while (i < n) {
236
+ const ch = s[i];
237
+ if (ch === '"') {
238
+ out += ch;
239
+ i += 1;
240
+ while (i < n) {
241
+ const c = s[i];
242
+ out += c;
243
+ i += 1;
244
+ if (c === '\\') {
245
+ if (i < n) {
246
+ out += s[i];
247
+ i += 1;
248
+ }
249
+ continue;
250
+ }
251
+ if (c === '"')
252
+ break;
253
+ }
254
+ continue;
255
+ }
256
+ if (ch === ',') {
257
+ let j = i + 1;
258
+ while (j < n && /\s/.test(s[j]))
259
+ j += 1;
260
+ if (s[j] === '}' || s[j] === ']') {
261
+ i += 1; // drop the trailing comma
262
+ continue;
263
+ }
264
+ }
265
+ out += ch;
266
+ i += 1;
267
+ }
268
+ return out;
269
+ }
270
+ async function resolveLlm(opts) {
271
+ const active = (opts.provider?.trim() || getProviderConfig().activeProviderId);
272
+ const meta = await resolveApiKeyWithMeta(active);
273
+ if (!meta?.apiKey) {
274
+ throw new Error(`No API key for provider '${active}'. Save a key in Settings → Provider.`);
275
+ }
276
+ const baseUrl = resolveBaseUrl(active);
277
+ if (!baseUrl) {
278
+ throw new Error(`No base URL for provider '${active}'. Set a custom endpoint in Settings.`);
279
+ }
280
+ const model = opts.model?.trim() || getModelForProvider(active) || process.env.ZELARI_MODEL || '';
281
+ if (!model) {
282
+ throw new Error(`No model selected for provider '${active}'`);
283
+ }
284
+ return { provider: active, model, apiKey: meta.apiKey, baseUrl };
285
+ }
286
+ async function createDefaultLlmClient(opts) {
287
+ const llm = await resolveLlm(opts);
288
+ return {
289
+ async complete({ system, user }) {
290
+ const controller = new AbortController();
291
+ const t = setTimeout(() => controller.abort(), LLM_TIMEOUT_MS);
292
+ try {
293
+ const url = `${llm.baseUrl.replace(/\/$/, '')}/chat/completions`;
294
+ const res = await fetch(url, {
295
+ method: 'POST',
296
+ signal: controller.signal,
297
+ headers: {
298
+ 'content-type': 'application/json',
299
+ authorization: `Bearer ${llm.apiKey}`,
300
+ },
301
+ body: JSON.stringify({
302
+ model: llm.model,
303
+ temperature: 0.2,
304
+ max_tokens: resolvePlannerMaxTokens(),
305
+ stream: false,
306
+ messages: [
307
+ { role: 'system', content: system },
308
+ { role: 'user', content: user },
309
+ ],
310
+ }),
311
+ });
312
+ if (!res.ok) {
313
+ const errBody = await res.text().catch(() => '');
314
+ throw new Error(`LLM HTTP ${res.status}${errBody ? `: ${errBody.slice(0, 200)}` : ''}`);
315
+ }
316
+ const json = (await res.json());
317
+ const choice = json.choices?.[0];
318
+ const text = choice?.message?.content?.trim();
319
+ if (text)
320
+ return text;
321
+ // Some reasoning models put chain-of-thought in `reasoning_content`
322
+ // and can leave `content` empty if truncated (finish_reason='length')
323
+ // before ever emitting the JSON answer. Try to salvage a JSON object
324
+ // from the reasoning trace itself before giving up — it's often the
325
+ // last thing the model was writing when it ran out of budget.
326
+ const reasoning = choice?.message?.reasoning_content?.trim();
327
+ if (reasoning && extractBalancedJsonObject(reasoning))
328
+ return reasoning;
329
+ const reason = choice?.finish_reason;
330
+ throw new Error(`Empty model response${reason ? ` (finish_reason=${reason})` : ''}` +
331
+ (reason === 'length'
332
+ ? ' — the model likely ran out of tokens before producing JSON;' +
333
+ ' raise ZELARI_KRAKEN_PLANNER_MAX_TOKENS or simplify the prompt.'
334
+ : ''));
335
+ }
336
+ finally {
337
+ clearTimeout(t);
338
+ }
339
+ },
340
+ };
341
+ }
342
+ function buildPlannerUserPrompt(prompt) {
343
+ return `Goal:\n${prompt.trim()}\n\nReturn ONLY the JSON object described in the system prompt.`;
344
+ }
345
+ function uniqueId(base, existing) {
346
+ if (!existing.has(base))
347
+ return base;
348
+ let i = 2;
349
+ while (existing.has(`${base}-${i}`))
350
+ i += 1;
351
+ return `${base}-${i}`;
352
+ }
353
+ function buildAutoVerifyPrompt(general) {
354
+ const acc = general.acceptance && general.acceptance.length > 0
355
+ ? `\n\nAcceptance criteria to check:\n${general.acceptance.map((a) => `- ${a}`).join('\n')}`
356
+ : '';
357
+ return `Verify the following work was completed correctly on disk: ${general.label}.${acc}`;
358
+ }
359
+ /**
360
+ * Convert LLM-planned nodes into a full `TaskGraph`, auto-injecting a
361
+ * `verify` node after every `general` node and, once ≥2 `general` nodes
362
+ * exist, a `merge` node depending on all their (auto-injected) verify
363
+ * nodes — mirroring the F3 executor's sequential worktree-merge handling.
364
+ */
365
+ export function buildGraphFromPlan(graphId, planned) {
366
+ const nodes = planned.map((p) => ({
367
+ id: p.id,
368
+ kind: p.kind,
369
+ label: p.label,
370
+ prompt: p.prompt,
371
+ scope: p.scope,
372
+ acceptance: p.acceptance,
373
+ deps: [...p.deps],
374
+ status: 'pending',
375
+ retryCount: 0,
376
+ maxRetries: DEFAULT_MAX_RETRIES[p.kind],
377
+ }));
378
+ const ids = new Set(nodes.map((n) => n.id));
379
+ const generalNodes = nodes.filter((n) => n.kind === 'general');
380
+ const verifyIdsForMerge = [];
381
+ for (const g of generalNodes) {
382
+ const verifyId = uniqueId(`verify-${g.id}`, ids);
383
+ ids.add(verifyId);
384
+ nodes.push({
385
+ id: verifyId,
386
+ kind: 'verify',
387
+ label: `verify: ${g.label}`,
388
+ prompt: buildAutoVerifyPrompt(g),
389
+ deps: [g.id],
390
+ status: 'pending',
391
+ retryCount: 0,
392
+ maxRetries: DEFAULT_MAX_RETRIES.verify,
393
+ });
394
+ verifyIdsForMerge.push(verifyId);
395
+ }
396
+ if (generalNodes.length >= 2) {
397
+ const mergeId = uniqueId('merge', ids);
398
+ ids.add(mergeId);
399
+ nodes.push({
400
+ id: mergeId,
401
+ kind: 'merge',
402
+ label: 'merge parallel work',
403
+ prompt: 'Sequentially merge the parallel general tentacles once verified.',
404
+ deps: verifyIdsForMerge,
405
+ status: 'pending',
406
+ retryCount: 0,
407
+ maxRetries: DEFAULT_MAX_RETRIES.merge,
408
+ });
409
+ }
410
+ return createGraph(graphId, nodes);
411
+ }
412
+ /**
413
+ * Ask the LLM for a task DAG and return a validated, ready-to-execute
414
+ * `TaskGraph`. Retries once with corrective feedback if the model's
415
+ * response is malformed JSON, fails schema validation, or produces an
416
+ * invalid graph (cycle, unknown dep, too many nodes); throws with the last
417
+ * error after `MAX_PLAN_ATTEMPTS`.
418
+ */
419
+ export async function planTaskGraph(opts) {
420
+ const client = opts.llmClient ?? (await createDefaultLlmClient({ provider: opts.provider, model: opts.model }));
421
+ const maxNodes = opts.maxNodes ?? DEFAULT_MAX_NODES;
422
+ const graphId = opts.graphId ?? `kraken-${Date.now().toString(36)}`;
423
+ const userBase = buildPlannerUserPrompt(opts.prompt);
424
+ let lastError;
425
+ let userMessage = userBase;
426
+ for (let attempt = 1; attempt <= MAX_PLAN_ATTEMPTS; attempt++) {
427
+ try {
428
+ const text = await client.complete({ system: KRAKEN_PLANNER_SYSTEM_PROMPT, user: userMessage });
429
+ const parsedJson = extractJsonObject(text);
430
+ const validated = PlannedGraphSchema.parse(parsedJson);
431
+ const graph = buildGraphFromPlan(graphId, validated.nodes);
432
+ const check = validateGraph(graph, { maxNodes });
433
+ if (!check.ok) {
434
+ throw new Error(`invalid graph: ${check.errors.join('; ')}`);
435
+ }
436
+ return graph;
437
+ }
438
+ catch (err) {
439
+ lastError = err instanceof Error ? err.message : String(err);
440
+ userMessage =
441
+ `${userBase}\n\nYour previous response was invalid (${lastError}). ` +
442
+ 'Return ONLY corrected JSON matching the schema exactly — no prose, no markdown fences.';
443
+ }
444
+ }
445
+ throw new Error(`kraken planner: failed to produce a valid task graph after ${MAX_PLAN_ATTEMPTS} attempts — ${lastError}`);
446
+ }
447
+ //# 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,cAAc,GAAG,MAAM,CAAC;AAC9B,MAAM,iBAAiB,GAAG,CAAC,CAAC;AAE5B;;;;;;;GAOG;AACH,MAAM,sBAAsB,GAAG,IAAI,CAAC;AAEpC,SAAS,uBAAuB,CAAC,MAAyB,OAAO,CAAC,GAAG;IACnE,MAAM,GAAG,GAAG,GAAG,CAAC,gCAAgC,CAAC;IACjD,IAAI,GAAG,KAAK,SAAS,IAAI,GAAG,KAAK,EAAE;QAAE,OAAO,sBAAsB,CAAC;IACnE,MAAM,CAAC,GAAG,MAAM,CAAC,QAAQ,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;IACnC,OAAO,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,sBAAsB,CAAC;AAClE,CAAC;AAED,iEAAiE;AACjE,MAAM,mBAAmB,GAAiC;IACxD,OAAO,EAAE,CAAC;IACV,OAAO,EAAE,CAAC;IACV,MAAM,EAAE,CAAC;IACT,GAAG,EAAE,CAAC;IACN,KAAK,EAAE,CAAC;CACT,CAAC;AAEF,MAAM,CAAC,MAAM,4BAA4B,GAAG;IAC1C,+DAA+D;I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AAC;YACH,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,4BAA4B,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC,CAAC;YAChG,MAAM,UAAU,GAAG,iBAAiB,CAAC,IAAI,CAAC,CAAC;YAC3C,MAAM,SAAS,GAAG,kBAAkB,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;YACvD,MAAM,KAAK,GAAG,kBAAkB,CAAC,OAAO,EAAE,SAAS,CAAC,KAAK,CAAC,CAAC;YAC3D,MAAM,KAAK,GAAG,aAAa,CAAC,KAAK,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC;YACjD,IAAI,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC;gBACd,MAAM,IAAI,KAAK,CAAC,kBAAkB,KAAK,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,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"}