@corenel/harness 0.11.0 → 0.13.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.
Files changed (77) hide show
  1. package/dist/core/fileChanges.d.ts +18 -0
  2. package/dist/core/fileChanges.d.ts.map +1 -0
  3. package/dist/core/fileChanges.js +85 -0
  4. package/dist/core/fileChanges.js.map +1 -0
  5. package/dist/core/loop.d.ts +10 -0
  6. package/dist/core/loop.d.ts.map +1 -1
  7. package/dist/core/loop.js +32 -2
  8. package/dist/core/loop.js.map +1 -1
  9. package/dist/core/spawn.d.ts +4 -0
  10. package/dist/core/spawn.d.ts.map +1 -1
  11. package/dist/core/spawn.js +11 -4
  12. package/dist/core/spawn.js.map +1 -1
  13. package/dist/dag/executeNode.d.ts +5 -0
  14. package/dist/dag/executeNode.d.ts.map +1 -1
  15. package/dist/dag/executeNode.js +5 -1
  16. package/dist/dag/executeNode.js.map +1 -1
  17. package/dist/guardrail/permission-service.d.ts +4 -0
  18. package/dist/guardrail/permission-service.d.ts.map +1 -1
  19. package/dist/guardrail/permission-service.js +10 -3
  20. package/dist/guardrail/permission-service.js.map +1 -1
  21. package/dist/guardrail/serialize.d.ts.map +1 -1
  22. package/dist/guardrail/serialize.js +4 -0
  23. package/dist/guardrail/serialize.js.map +1 -1
  24. package/dist/guardrail/validate.d.ts.map +1 -1
  25. package/dist/guardrail/validate.js +3 -1
  26. package/dist/guardrail/validate.js.map +1 -1
  27. package/dist/orchestrator/agentSearch.d.ts.map +1 -1
  28. package/dist/orchestrator/agentSearch.js +10 -0
  29. package/dist/orchestrator/agentSearch.js.map +1 -1
  30. package/dist/orchestrator/planDoc.d.ts +26 -0
  31. package/dist/orchestrator/planDoc.d.ts.map +1 -1
  32. package/dist/orchestrator/planDoc.js +132 -10
  33. package/dist/orchestrator/planDoc.js.map +1 -1
  34. package/dist/orchestrator/record.d.ts +100 -4
  35. package/dist/orchestrator/record.d.ts.map +1 -1
  36. package/dist/orchestrator/record.js +238 -4
  37. package/dist/orchestrator/record.js.map +1 -1
  38. package/dist/orchestrator/sidecarTools.d.ts +5 -0
  39. package/dist/orchestrator/sidecarTools.d.ts.map +1 -1
  40. package/dist/orchestrator/sidecarTools.js +53 -15
  41. package/dist/orchestrator/sidecarTools.js.map +1 -1
  42. package/dist/prompts/init.d.ts +12 -0
  43. package/dist/prompts/init.d.ts.map +1 -0
  44. package/dist/prompts/init.js +48 -0
  45. package/dist/prompts/init.js.map +1 -0
  46. package/dist/prompts/library/defaults.generated.js +2 -2
  47. package/dist/prompts/library/defaults.generated.js.map +1 -1
  48. package/dist/sidecar/deviceKeys.d.ts +75 -0
  49. package/dist/sidecar/deviceKeys.d.ts.map +1 -0
  50. package/dist/sidecar/deviceKeys.js +142 -0
  51. package/dist/sidecar/deviceKeys.js.map +1 -0
  52. package/dist/sidecar/host.d.ts +157 -23
  53. package/dist/sidecar/host.d.ts.map +1 -1
  54. package/dist/sidecar/host.js +340 -15
  55. package/dist/sidecar/host.js.map +1 -1
  56. package/dist/sidecar/identity.d.ts +41 -17
  57. package/dist/sidecar/identity.d.ts.map +1 -1
  58. package/dist/sidecar/identity.js +10 -21
  59. package/dist/sidecar/identity.js.map +1 -1
  60. package/dist/sidecar/server.d.ts +202 -30
  61. package/dist/sidecar/server.d.ts.map +1 -1
  62. package/dist/sidecar/server.js +722 -109
  63. package/dist/sidecar/server.js.map +1 -1
  64. package/dist/sidecar/testing.d.ts +97 -0
  65. package/dist/sidecar/testing.d.ts.map +1 -0
  66. package/dist/sidecar/testing.js +259 -0
  67. package/dist/sidecar/testing.js.map +1 -0
  68. package/dist/sidecar/wsChannel.d.ts +8 -1
  69. package/dist/sidecar/wsChannel.d.ts.map +1 -1
  70. package/dist/sidecar/wsChannel.js +17 -1
  71. package/dist/sidecar/wsChannel.js.map +1 -1
  72. package/dist/tools/callAgent.d.ts.map +1 -1
  73. package/dist/tools/callAgent.js +33 -13
  74. package/dist/tools/callAgent.js.map +1 -1
  75. package/dist/tools/orchestration.js +1 -1
  76. package/dist/tools/orchestration.js.map +1 -1
  77. package/package.json +2 -2
@@ -3,8 +3,80 @@
3
3
  * callee -- spawn gives every child a fresh runState) and is flushed best-effort
4
4
  * to `<runsRoot>/<id>/orchestrator.json` after each change. A failed write never
5
5
  * fails the tool that caused it. */
6
- import { runsRoot } from '@corenel/protocol';
6
+ import { runsRoot, } from '@corenel/protocol';
7
7
  const KEY = 'orchestrator.record';
8
+ /** How many files a record lists. */
9
+ export const MAX_OUTPUTS = 500;
10
+ /** How much of a callee's report the record keeps (its head). */
11
+ export const MAX_REPORT_CHARS = 16000;
12
+ /** How much of the closing message the record keeps (its head). */
13
+ export const MAX_SUMMARY_CHARS = 32000;
14
+ /** How much of a check's output the record keeps (its tail: where the failure is). */
15
+ export const MAX_CHECK_TAIL_CHARS = 4000;
16
+ /** The first `max` characters, with the full length only when it was cut. */
17
+ export function headOf(text, max) {
18
+ return text.length > max ? { text: text.slice(0, max), chars: text.length } : { text };
19
+ }
20
+ /** The last `max` characters, with the full length only when it was cut. */
21
+ export function tailOf(text, max) {
22
+ return text.length > max ? { text: text.slice(text.length - max), chars: text.length } : { text };
23
+ }
24
+ /** Log one file change in the record. One entry per root and path: the last
25
+ * change wins, except that a file this run created stays `created` through
26
+ * later edits, and a file deleted and written again reads `modified` (it was
27
+ * there before the run). Past MAX_OUTPUTS a new file is only counted. */
28
+ export function noteOutput(rec, c, at = Date.now()) {
29
+ const list = (rec.outputs ?? (rec.outputs = []));
30
+ const i = list.findIndex((o) => o.path === c.path && (o.root ?? '') === (c.root ?? ''));
31
+ const prev = i >= 0 ? list[i] : undefined;
32
+ let change = c.change;
33
+ if (prev?.change === 'created' && change === 'modified')
34
+ change = 'created';
35
+ else if (prev?.change === 'deleted' && change === 'created')
36
+ change = 'modified';
37
+ const entry = {
38
+ path: c.path, ...(c.root ? { root: c.root } : {}), change, agent: c.agent,
39
+ ...(c.task !== undefined ? { task: c.task } : {}), ...(c.bytes !== undefined ? { bytes: c.bytes } : {}), at,
40
+ };
41
+ if (i >= 0) {
42
+ list[i] = entry;
43
+ return;
44
+ }
45
+ if (list.length >= MAX_OUTPUTS) {
46
+ rec.outputsOverflow = (rec.outputsOverflow ?? 0) + 1;
47
+ return;
48
+ }
49
+ list.push(entry);
50
+ }
51
+ /** runState key: the root a change that names none is under (see
52
+ * captureOrchestratorOutputs). Shared by every recorder of the run, so the
53
+ * orchestrator's and its callees' writes to one file are one entry. */
54
+ const OUTPUT_ROOT_KEY = 'orchestrator.outputRoot';
55
+ /** An observer (ToolContext.onFileChange) that logs each change in this run's
56
+ * record under `agent` and `task`, then flushes. A change that named no root
57
+ * gets the run's default root, when the host set one. */
58
+ export function outputRecorder(ctx, who) {
59
+ return async (c) => {
60
+ const rec = recordOf(ctx);
61
+ if (!rec)
62
+ return;
63
+ const fallback = ctx.runState?.[OUTPUT_ROOT_KEY];
64
+ const root = c.root ?? (typeof fallback === 'string' && fallback ? fallback : undefined);
65
+ noteOutput(rec, { ...c, ...(root ? { root } : {}), agent: who.agent, ...(who.task !== undefined ? { task: who.task } : {}) });
66
+ await flushRecord(ctx);
67
+ };
68
+ }
69
+ /** Log the files an orchestrator run changes itself. Its callees' changes are
70
+ * attributed by call_agent, which hands each spawn its own recorder.
71
+ * `defaultRoot`: where a tool that names no root writes (the daemon's work
72
+ * root); absent when the host cannot say. Needs the run's `runState`. */
73
+ export function captureOrchestratorOutputs(ctx, who) {
74
+ if (!ctx.runState)
75
+ return;
76
+ if (who.defaultRoot)
77
+ ctx.runState[OUTPUT_ROOT_KEY] = who.defaultRoot;
78
+ ctx.onFileChange = outputRecorder(ctx, { agent: who.agent });
79
+ }
8
80
  /** runState key a host may set to a `(rec: OrchestratorRecord) => void`
9
81
  * observer; flushRecord calls it after every save. An observer only: a
10
82
  * throwing hook never fails the tool that caused the flush. */
@@ -121,12 +193,45 @@ export function stageOf(rec) {
121
193
  return 'pr';
122
194
  if (rec.checks?.length)
123
195
  return 'checks';
124
- if (rec.branch)
196
+ if (rec.branch || rec.workInPlace)
125
197
  return 'build';
126
198
  if (rec.planApprovedAt)
127
199
  return 'branch';
128
200
  return 'plan';
129
201
  }
202
+ /**
203
+ * Whether an orchestrator run may end now, for the loop's `beforeStop` hook:
204
+ * null lets it end, a string is the next user turn that keeps it going.
205
+ *
206
+ * Decided from the RECORD, never from what the model said: found live
207
+ * 2026-09-29, a model answered "Ready to proceed with Task 1" in text right
208
+ * after its plan was approved, and a text-only turn is the loop's normal end,
209
+ * so the run finished with 0 of 4 tasks started.
210
+ *
211
+ * It keeps going only when there is unambiguous work left: the plan is
212
+ * approved, nothing has stopped the run, and either a planned task was never
213
+ * started, or every task is settled but the run (on a branch) has no pull
214
+ * request yet. A run that works in place ends with a report, so settled tasks
215
+ * are enough for it. The loop bounds how many times this can fire in a row.
216
+ */
217
+ export function continuationNudge(rec) {
218
+ if (!rec || !rec.planApprovedAt || !rec.planTasks?.length)
219
+ return null;
220
+ const stage = stageOf(rec);
221
+ if (stage === 'done' || stage === 'stopped')
222
+ return null;
223
+ const next = rec.planTasks.find((t) => t.status === 'pending');
224
+ if (next) {
225
+ return `The plan is approved and Task ${next.n} ("${next.title}") has not been started. `
226
+ + `Continue now: delegate it to ${next.agent} with call_agent, passing task: ${next.n}. `
227
+ + 'If something prevents you, say exactly what is blocking you instead.';
228
+ }
229
+ if (rec.workInPlace)
230
+ return null;
231
+ return 'Every task in the plan is settled but there is no pull request yet. '
232
+ + 'Continue now: run the confirmed checks, then commit, push and open the pull request. '
233
+ + 'If something prevents you, say exactly what is blocking you instead.';
234
+ }
130
235
  /** The compact task view a host shows for a run; null without a task. `round`
131
236
  * is the most calls made to any one agent (the review loop's round count). */
132
237
  export function taskSummaryOf(rec) {
@@ -143,6 +248,126 @@ export function taskSummaryOf(rec) {
143
248
  ...(rec.prUrl ? { prUrl: rec.prUrl } : {}),
144
249
  };
145
250
  }
251
+ /** The longest plan text a run-plan answer carries. */
252
+ export const MAX_PLAN_VIEW_CHARS = 200000;
253
+ const PLAN_STATUSES = new Set(['pending', 'running', 'done', 'error']);
254
+ const textOf = (v, max) => (typeof v === 'string' && v.trim() ? v.slice(0, max) : undefined);
255
+ /** What a client may see of a run record read back from orchestrator.json.
256
+ * The file lives in the work tree, where a callee with write tools can reach
257
+ * it, so every field is checked and capped rather than trusted: a
258
+ * wrong-typed field is dropped, never passed on. Null for a non-object. */
259
+ export function planViewOf(raw, opts = {}) {
260
+ if (!raw || typeof raw !== 'object' || Array.isArray(raw))
261
+ return null;
262
+ const r = raw;
263
+ const out = {};
264
+ if (r.task && typeof r.task === 'object') {
265
+ const t = r.task;
266
+ const title = textOf(t.title, 200);
267
+ if (title) {
268
+ const criteria = Array.isArray(t.acceptanceCriteria) ? t.acceptanceCriteria : [];
269
+ out.task = {
270
+ title,
271
+ acceptanceCriteria: criteria.filter((c) => typeof c === 'string').slice(0, 30).map((c) => c.slice(0, 500)),
272
+ };
273
+ }
274
+ }
275
+ if (typeof r.planApprovedAt === 'number' && Number.isFinite(r.planApprovedAt))
276
+ out.planApprovedAt = r.planApprovedAt;
277
+ const markdown = textOf(r.plan, MAX_PLAN_VIEW_CHARS);
278
+ if (markdown)
279
+ out.markdown = markdown;
280
+ const planPath = textOf(r.planPath, 500);
281
+ if (planPath)
282
+ out.planPath = planPath;
283
+ const branch = textOf(r.branch, 300);
284
+ if (branch)
285
+ out.branch = branch;
286
+ if (Array.isArray(r.planTasks)) {
287
+ const tasks = [];
288
+ for (const v of r.planTasks.slice(0, 200)) {
289
+ if (!v || typeof v !== 'object')
290
+ continue;
291
+ const t = v;
292
+ const title = textOf(t.title, 300);
293
+ if (typeof t.n !== 'number' || !Number.isFinite(t.n) || !title)
294
+ continue;
295
+ if (typeof t.status !== 'string' || !PLAN_STATUSES.has(t.status))
296
+ continue;
297
+ tasks.push({ n: t.n, title, agent: typeof t.agent === 'string' ? t.agent.slice(0, 100) : '', status: t.status });
298
+ }
299
+ if (tasks.length)
300
+ out.planTasks = tasks;
301
+ }
302
+ if (opts.output)
303
+ out.output = outputViewOf(r);
304
+ return out;
305
+ }
306
+ const CHANGES = new Set(['created', 'modified', 'deleted']);
307
+ const finite = (v) => typeof v === 'number' && Number.isFinite(v);
308
+ const count = (v) => (finite(v) && v >= 0 ? Math.floor(v) : undefined);
309
+ /** What the run produced, read from a record off disk: checked and capped
310
+ * like the rest of planViewOf, a malformed entry dropped. */
311
+ function outputViewOf(r) {
312
+ const outputs = [];
313
+ for (const v of Array.isArray(r.outputs) ? r.outputs.slice(0, MAX_OUTPUTS) : []) {
314
+ if (!v || typeof v !== 'object')
315
+ continue;
316
+ const o = v;
317
+ const path = textOf(o.path, 1000);
318
+ if (!path || typeof o.change !== 'string' || !CHANGES.has(o.change) || !finite(o.at))
319
+ continue;
320
+ const root = textOf(o.root, 1000);
321
+ const bytes = count(o.bytes);
322
+ outputs.push({
323
+ path, ...(root ? { root } : {}), change: o.change,
324
+ agent: typeof o.agent === 'string' ? o.agent.slice(0, 100) : '',
325
+ ...(finite(o.task) ? { task: o.task } : {}), ...(bytes !== undefined ? { bytes } : {}), at: o.at,
326
+ });
327
+ }
328
+ const delegations = [];
329
+ for (const v of Array.isArray(r.delegations) ? r.delegations.slice(0, 200) : []) {
330
+ if (!v || typeof v !== 'object')
331
+ continue;
332
+ const d = v;
333
+ if (typeof d.agent !== 'string' || !finite(d.at))
334
+ continue;
335
+ const report = textOf(d.report, MAX_REPORT_CHARS);
336
+ const reportChars = count(d.reportChars);
337
+ const error = textOf(d.error, 2000);
338
+ delegations.push({
339
+ agent: d.agent.slice(0, 100), ...(finite(d.task) ? { task: d.task } : {}), at: d.at,
340
+ stopReason: typeof d.stopReason === 'string' ? d.stopReason.slice(0, 100) : '',
341
+ ...(report ? { report } : {}), ...(reportChars !== undefined ? { reportChars } : {}), ...(error ? { error } : {}),
342
+ });
343
+ }
344
+ const checks = [];
345
+ for (const v of Array.isArray(r.checks) ? r.checks.slice(0, 100) : []) {
346
+ if (!v || typeof v !== 'object')
347
+ continue;
348
+ const k = v;
349
+ const name = textOf(k.name, 100);
350
+ if (!name || !finite(k.at))
351
+ continue;
352
+ const outputTail = typeof k.outputTail === 'string' ? tailOf(k.outputTail, MAX_CHECK_TAIL_CHARS).text : '';
353
+ const outputChars = count(k.outputChars);
354
+ checks.push({
355
+ name, exitCode: finite(k.exitCode) ? k.exitCode : null, timedOut: k.timedOut === true,
356
+ durationMs: count(k.durationMs) ?? 0, at: k.at,
357
+ ...(outputTail ? { outputTail } : {}), ...(outputChars !== undefined ? { outputChars } : {}),
358
+ });
359
+ }
360
+ const summary = textOf(r.summary, MAX_SUMMARY_CHARS);
361
+ const summaryChars = count(r.summaryChars);
362
+ const overflow = count(r.outputsOverflow);
363
+ return {
364
+ ...(summary ? { summary } : {}), ...(summaryChars !== undefined ? { summaryChars } : {}),
365
+ outputs, ...(overflow ? { outputsOverflow: overflow } : {}),
366
+ delegations, checks,
367
+ ...(finite(r.endedAt) ? { endedAt: r.endedAt } : {}),
368
+ ...(r.workInPlace && typeof r.workInPlace === 'object' ? { workInPlace: true } : {}),
369
+ };
370
+ }
146
371
  /** The run's record if one exists, WITHOUT creating it. For code that must not
147
372
  * turn an ordinary run (a callee's, a plain agent's) into an orchestrator run
148
373
  * just by looking. */
@@ -152,8 +377,9 @@ export function peekRecord(ctx) {
152
377
  }
153
378
  /** Close the record when the run ends. An in-progress record becomes
154
379
  * `stopped-budget` or `failed`; a normal end and any outcome a tool already set
155
- * are left alone. The caller flushes and releases `rec.lock`. */
156
- export function settleRecord(ctx, end) {
380
+ * are left alone. `summary` is the orchestrator's last message, kept (its
381
+ * head) when it says anything. The caller flushes and releases `rec.lock`. */
382
+ export function settleRecord(ctx, end, summary) {
157
383
  const rec = peekRecord(ctx);
158
384
  if (!rec)
159
385
  return null;
@@ -163,6 +389,14 @@ export function settleRecord(ctx, end) {
163
389
  else if (end === 'error')
164
390
  rec.outcome = 'failed';
165
391
  }
392
+ const said = summary?.trim();
393
+ if (said) {
394
+ const h = headOf(said, MAX_SUMMARY_CHARS);
395
+ rec.summary = h.text;
396
+ if (h.chars !== undefined)
397
+ rec.summaryChars = h.chars;
398
+ }
399
+ rec.endedAt = Date.now();
166
400
  return rec;
167
401
  }
168
402
  //# sourceMappingURL=record.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"record.js","sourceRoot":"","sources":["../../orchestrator/record.ts"],"names":[],"mappings":"AAAA;;;;oCAIoC;AACpC,OAAO,EAAE,QAAQ,EAAwE,MAAM,mBAAmB,CAAC;AA+BnH,MAAM,GAAG,GAAG,qBAAqB,CAAC;AAElC;;+DAE+D;AAC/D,MAAM,CAAC,MAAM,YAAY,GAAG,sBAAsB,CAAC;AAEnD,SAAS,KAAK;IACZ,OAAO,QAAQ,IAAI,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC;AACpF,CAAC;AAED;mDACmD;AACnD,MAAM,CAAC,MAAM,YAAY,GAAG,2EAA2E,CAAC;AAExG;;;;2EAI2E;AAC3E,MAAM,UAAU,QAAQ,CAAC,GAAgB;IACvC,MAAM,KAAK,GAAG,GAAG,CAAC,QAAQ,CAAC;IAC3B,IAAI,CAAC,KAAK;QAAE,OAAO,IAAI,CAAC;IACxB,MAAM,QAAQ,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC;IAC5B,IAAI,QAAQ,IAAI,OAAO,QAAQ,KAAK,QAAQ;QAAE,OAAO,QAA8B,CAAC;IACpF,MAAM,GAAG,GAAuB,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE,EAAE,WAAW,EAAE,EAAE,EAAE,OAAO,EAAE,aAAa,EAAE,CAAC;IAChH,KAAK,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC;IACjB,OAAO,GAAG,CAAC;AACb,CAAC;AAED,MAAM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G,EAAE,CAAC;IACzB,OAAO,GAAG,CAAC;AACb,CAAC"}
@@ -1,4 +1,9 @@
1
1
  import type { AgentTool } from '@corenel/protocol';
2
+ /** Appended to sidecar_git_branch's answer when the folder is not a git
3
+ * repository or git is not installed: not a stop, the run goes on in place. */
4
+ export declare const CONTINUE_WITHOUT_GIT: string;
5
+ /** What commit, push and open_pr answer in a run that works without git. */
6
+ export declare const NO_GIT_TO_FINISH: string;
2
7
  /** Wrap a host's tool list. Tools that are not orchestrator sidecar tools pass
3
8
  * through unchanged. */
4
9
  export declare function withOrchestratorSidecarTools(tools: AgentTool[], opts: {
@@ -1 +1 @@
1
- {"version":3,"file":"sidecarTools.d.ts","sourceRoot":"","sources":["../../orchestrator/sidecarTools.ts"],"names":[],"mappings":"AAyBA,OAAO,KAAK,EAAE,SAAS,EAA6E,MAAM,mBAAmB,CAAC;AAqH9H;wBACwB;AACxB,wBAAgB,4BAA4B,CAAC,KAAK,EAAE,SAAS,EAAE,EAAE,IAAI,EAAE;IAAE,YAAY,EAAE,OAAO,CAAA;CAAE,GAAG,SAAS,EAAE,CAS7G"}
1
+ {"version":3,"file":"sidecarTools.d.ts","sourceRoot":"","sources":["../../orchestrator/sidecarTools.ts"],"names":[],"mappings":"AAyBA,OAAO,KAAK,EAAE,SAAS,EAA6E,MAAM,mBAAmB,CAAC;AA6C9H;+EAC+E;AAC/E,eAAO,MAAM,oBAAoB,QAC8G,CAAC;AAEhJ,4EAA4E;AAC5E,eAAO,MAAM,gBAAgB,QAC0D,CAAC;AAwGxF;wBACwB;AACxB,wBAAgB,4BAA4B,CAAC,KAAK,EAAE,SAAS,EAAE,EAAE,IAAI,EAAE;IAAE,YAAY,EAAE,OAAO,CAAA;CAAE,GAAG,SAAS,EAAE,CAS7G"}
@@ -1,5 +1,6 @@
1
1
  import { ORCHESTRATOR_GIT_TOOLS, PREVIEWABLE_GIT_TOOLS, PREVIEW_PARAM, SIDECAR_GIT_BRANCH, SIDECAR_GIT_PUSH, SIDECAR_OPEN_PR, SIDECAR_RUN_CHECK, hostFilledParams, parseToolResult, stateDirName, } from '@corenel/protocol';
2
- import { recordOf, peekRecord, flushRecord, NO_RUN_STATE } from './record.js';
2
+ import { recordOf, peekRecord, flushRecord, tailOf, NO_RUN_STATE, MAX_CHECK_TAIL_CHARS } from './record.js';
3
+ import { reportFileChanges } from '../core/fileChanges.js';
3
4
  function modelFacing(parameters, hostFilled) {
4
5
  const props = parameters.properties;
5
6
  if (!props || typeof props !== 'object')
@@ -23,17 +24,31 @@ function wrapRunCheck(tool) {
23
24
  const raw = await tool.run({ ...withoutHostParams(args, hostFilled), state_dir: stateDirName(), ...(rec ? { run_id: rec.id } : {}) }, ctx);
24
25
  const r = parseToolResult(raw);
25
26
  if (rec && r?.ok) {
26
- (rec.checks ?? (rec.checks = [])).push({ name: r.name, exitCode: r.exitCode, durationMs: r.durationMs, timedOut: r.timedOut, at: Date.now() });
27
+ // The END of what it printed: where a failing check says why.
28
+ const tail = typeof r.output === 'string' ? tailOf(r.output, MAX_CHECK_TAIL_CHARS) : { text: '' };
29
+ (rec.checks ?? (rec.checks = [])).push({
30
+ name: r.name, exitCode: r.exitCode, durationMs: r.durationMs, timedOut: r.timedOut, at: Date.now(),
31
+ ...(tail.text ? { outputTail: tail.text } : {}), ...(tail.chars !== undefined ? { outputChars: tail.chars } : {}),
32
+ });
27
33
  await flushRecord(ctx);
28
34
  }
29
35
  return raw;
30
36
  },
31
37
  };
32
38
  }
39
+ /** Appended to sidecar_git_branch's answer when the folder is not a git
40
+ * repository or git is not installed: not a stop, the run goes on in place. */
41
+ export const CONTINUE_WITHOUT_GIT = 'Continue without git: the work happens in this folder as it is. Delegate the plan, run the confirmed checks, '
42
+ + 'and finish with a report of what changed (files touched, check results, anything left undone) instead of a commit, push and pull request.';
43
+ /** What commit, push and open_pr answer in a run that works without git. */
44
+ export const NO_GIT_TO_FINISH = 'This run works in a folder that is not a git repository, so there is nothing to commit, push or open. '
45
+ + 'Finish with a report of what changed, the check results and anything left undone.';
33
46
  /** Why the host refuses this git step before the sidecar sees it, or null. */
34
47
  function gitStepRefusal(toolName, rec) {
35
48
  if (!rec.planApprovedAt)
36
49
  return 'No approved plan. Call set_task, then submit_plan, before any git step.';
50
+ if (toolName !== SIDECAR_GIT_BRANCH && rec.workInPlace && !rec.branch)
51
+ return NO_GIT_TO_FINISH;
37
52
  if (toolName !== SIDECAR_GIT_BRANCH && !rec.branch)
38
53
  return 'This run has no branch yet. Call sidecar_git_branch first.';
39
54
  if (toolName === SIDECAR_OPEN_PR && !rec.pushedAt)
@@ -58,6 +73,29 @@ function previewOf(tool, hostFilled) {
58
73
  return parseToolResult(raw);
59
74
  };
60
75
  }
76
+ /** Write the approved structured plan to `rec.planPath` under `root`, through
77
+ * the sidecar's own confined write tool. Returns the note for the model, or
78
+ * null when there is no structured plan to write. A failed write never fails
79
+ * the step: the plan is still in the run record. */
80
+ async function writePlan(rec, root, writer, ctx) {
81
+ if (!rec.plan || !rec.planPath)
82
+ return null;
83
+ try {
84
+ if (!writer)
85
+ throw new Error('no file-writing tool on this host');
86
+ const args = { root, path: rec.planPath, content: `${rec.plan}\n` };
87
+ const result = await writer.run(args, ctx);
88
+ // The host wrote it, not a model, so the loop never saw the call: log it
89
+ // as one of the run's files here.
90
+ await reportFileChanges(ctx, writer.name, args, String(result), null);
91
+ rec.planWrittenAt = Date.now();
92
+ rec.planRoot = root;
93
+ return `Plan written to ${rec.planPath}.`;
94
+ }
95
+ catch (e) {
96
+ return `The plan could not be written (${e instanceof Error ? e.message : String(e)}); continue.`;
97
+ }
98
+ }
61
99
  function wrapGit(tool, writer) {
62
100
  const hostFilled = hostFilledParams(tool.name);
63
101
  const approvalDetail = previewOf(tool, hostFilled);
@@ -81,24 +119,24 @@ function wrapGit(tool, writer) {
81
119
  }, ctx);
82
120
  if (tool.name === SIDECAR_GIT_BRANCH) {
83
121
  const r = parseToolResult(raw);
122
+ if (r && !r.ok && 'noRepo' in r && r.noRepo === true && typeof r.root === 'string' && !rec.branch) {
123
+ // No repository (or no git): the run works in the folder as it is.
124
+ // The plan is written there once, at the same planPath, by the host.
125
+ rec.workInPlace = { root: r.root, reason: r.error };
126
+ const note = rec.planWrittenAt ? null : await writePlan(rec, r.root, writer, ctx);
127
+ await flushRecord(ctx);
128
+ return [raw, CONTINUE_WITHOUT_GIT, ...(note ? [note] : [])].join('\n');
129
+ }
84
130
  if (!r?.ok)
85
131
  return raw;
86
132
  rec.branch = r.branch;
87
133
  rec.lock = { root: r.root, stateDir };
88
- if (rec.plan && rec.planPath && r.created) {
89
- let note;
90
- try {
91
- if (!writer)
92
- throw new Error('no file-writing tool on this host');
93
- await writer.run({ root: r.root, path: rec.planPath, content: `${rec.plan}\n` }, ctx);
94
- rec.planWrittenAt = Date.now();
95
- note = `Plan written to ${rec.planPath}.`;
96
- }
97
- catch (e) {
98
- note = `The plan could not be written (${e instanceof Error ? e.message : String(e)}); continue.`;
134
+ if (r.created) {
135
+ const note = await writePlan(rec, r.root, writer, ctx);
136
+ if (note) {
137
+ await flushRecord(ctx);
138
+ return `${raw}\n${note}`;
99
139
  }
100
- await flushRecord(ctx);
101
- return `${raw}\n${note}`;
102
140
  }
103
141
  }
104
142
  else if (tool.name === SIDECAR_GIT_PUSH) {
@@ -1 +1 @@
1
- {"version":3,"file":"sidecarTools.js","sourceRoot":"","sources":["../../orchestrator/sidecarTools.ts"],"names":[],"mappings":"AA0BA,OAAO,EACL,sBAAsB,EAAE,qBAAqB,EAAE,aAAa,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,eAAe,EAAE,iBAAiB,EACtI,gBAAgB,EAAE,eAAe,EAAE,YAAY,GAChD,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,WAAW,EAAE,YAAY,EAA2B,MAAM,UAAU,CAAC;AAEpG,SAAS,WAAW,CAAC,UAAsB,EAAE,UAA6B;IACxE,MAAM,KAAK,GAAG,UAAU,CAAC,UAAU,CAAC;IACpC,I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AAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACnB,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
@@ -0,0 +1,12 @@
1
+ export interface InitPromptOptions {
2
+ /** The product the project is being initialized for, e.g. 'Corenel'. */
3
+ product: string;
4
+ /** The root instructions file the agent writes, e.g. 'CORENEL.md'. */
5
+ instructionsFile: string;
6
+ /** Extra text the user typed after `/init`. Blank adds nothing. */
7
+ focus?: string;
8
+ }
9
+ /** The instruction the agent executes for `/init`, built fresh each call so the
10
+ * scaffolded paths always name the host's actual state dir. */
11
+ export declare function initPrompt({ product, instructionsFile, focus }: InitPromptOptions): string;
12
+ //# sourceMappingURL=init.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../prompts/init.ts"],"names":[],"mappings":"AAiBA,MAAM,WAAW,iBAAiB;IAChC,wEAAwE;IACxE,OAAO,EAAE,MAAM,CAAC;IAChB,sEAAsE;IACtE,gBAAgB,EAAE,MAAM,CAAC;IACzB,mEAAmE;IACnE,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;+DAC+D;AAC/D,wBAAgB,UAAU,CAAC,EAAE,OAAO,EAAE,gBAAgB,EAAE,KAAK,EAAE,EAAE,iBAAiB,GAAG,MAAM,CA4B1F"}
@@ -0,0 +1,48 @@
1
+ /* The `/init` prompt: scan the open workspace and write the project's
2
+ * instructions file (plus scaffold the product's state dir), the way Claude
3
+ * Code's /init bootstraps a CLAUDE.md.
4
+ *
5
+ * It is a canned PROMPT the tool-capable agent runs (it explores with
6
+ * list_files / read_file and writes with write_file / create_file), not a
7
+ * deterministic generator -- so the output is tailored to what is actually in
8
+ * the repo, and every write goes through the active policy's approval gate
9
+ * like any other turn's.
10
+ *
11
+ * Shared by every face: the web's agent panels (through
12
+ * src/prompd/initCommand.ts, which supplies the host's product and file) and
13
+ * the terminal (@corenel/term's `/init`). The product and the file are the
14
+ * CALLER's to name -- this module never assumes which product it runs in. The
15
+ * state dir is read from `stateDirName()`, which the host has already set. */
16
+ import { stateDirName } from '@corenel/protocol';
17
+ /** The instruction the agent executes for `/init`, built fresh each call so the
18
+ * scaffolded paths always name the host's actual state dir. */
19
+ export function initPrompt({ product, instructionsFile, focus }) {
20
+ const dir = stateDirName();
21
+ // One dot-dir holds everything this product keeps in a project (its state AND
22
+ // its package installs), named for the product by the host. Another product's
23
+ // dot-dir may exist too, but it is never created here, so it is not ours to ignore.
24
+ const ignoreList = `\`${dir}/\``;
25
+ const prompt = [
26
+ `Initialize this project for ${product}. Use your file tools, then summarize what you did.`,
27
+ '',
28
+ '1. Explore the workspace to understand it: list the top-level files and directories, then read the key signals — the README, package manifests (package.json / pyproject.toml / go.mod / Cargo.toml, etc.), config files, and a representative sample of the source layout. Base everything on what you actually read; do not guess.',
29
+ '',
30
+ `2. Write a concise, factual ${instructionsFile} at the workspace ROOT (create it, or update it in place if it already exists — keep any hand-written notes you cannot re-derive). Keep it tight and useful for an agent working in this repo:`,
31
+ ' - # <Project name> — one line on what it is.',
32
+ ' - ## Stack — languages, frameworks, key dependencies.',
33
+ ' - ## Commands — exact install / build / test / run / lint commands (from the manifests + scripts).',
34
+ ' - ## Architecture — the main directories and what each holds; how the pieces fit.',
35
+ ' - ## Conventions — code style and patterns evident in the codebase.',
36
+ ' - ## Gotchas — only real, non-obvious things that would trip up a newcomer.',
37
+ ' Omit any section you have no real content for. No filler, no invented facts.',
38
+ '',
39
+ `3. Scaffold the ${product} project-state directory: create \`${dir}/memory/MEMORY.md\` with a short header ("# Memory index") and a one-line note that per-project memories are listed there, one line per fact. This establishes where project-scoped memory will live.`,
40
+ '',
41
+ `4. If a root \`.gitignore\` exists, make sure it ignores ${ignoreList} (add whichever are missing). If there is no .gitignore, skip this.`,
42
+ '',
43
+ 'Finally, give a short summary: which files you created or updated and the key facts you captured. Ask before overwriting anything you are unsure about.',
44
+ ].join('\n');
45
+ const extra = (focus ?? '').trim();
46
+ return extra ? `${prompt}\n\nExtra focus from the user: ${extra}` : prompt;
47
+ }
48
+ //# sourceMappingURL=init.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"init.js","sourceRoot":"","sources":["../../prompts/init.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;8EAc8E;AAC9E,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAWjD;+DAC+D;AAC/D,MAAM,UAAU,UAAU,CAAC,EAAE,OAAO,EAAE,gBAAgB,EAAE,KAAK,EAAqB;IAChF,MAAM,GAAG,GAAG,YAAY,EAAE,CAAC;IAC3B,8EAA8E;IAC9E,8EAA8E;IAC9E,oFAAoF;IACpF,MAAM,UAAU,GAAG,KAAK,GAAG,KAAK,CAAC;IACjC,MAAM,MAAM,GAAG;QACb,+BAA+B,OAAO,qDAAqD;QAC3F,EAAE;QACF,sUAAsU;QACtU,EAAE;QACF,+BAA+B,gBAAgB,gMAAgM;QAC/O,iDAAiD;QACjD,0DAA0D;QAC1D,uGAAuG;QACvG,sFAAsF;QACtF,wEAAwE;QACxE,gFAAgF;QAChF,iFAAiF;QACjF,EAAE;QACF,mBAAmB,OAAO,sCAAsC,GAAG,uMAAuM;QAC1Q,EAAE;QACF,4DAA4D,UAAU,qEAAqE;QAC3I,EAAE;QACF,yJAAyJ;KAC1J,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACb,MAAM,KAAK,GAAG,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;IACnC,OAAO,KAAK,CAAC,CAAC,CAAC,GAAG,MAAM,kCAAkC,KAAK,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC;AAC7E,CAAC"}
@@ -86,10 +86,10 @@ export const RAW_DEFAULTS = {
86
86
  "crew/marketing-strategist/PERSONA.md": "Direct and commercially minded. Argues from the audience's position rather than the\nseller's.\n",
87
87
  "crew/marketing-strategist/POLICY.yaml": "onViolation: stop\ndefaultPermission: ask\nmutatingDefault: ask\npermissions:\n read_file: allow\n list_files: allow\n search_files: allow\n stat_file: allow\n compile_prompd: allow\n web_search: allow\n save_memory: allow\n recall_memory: allow\n kv_get: allow\n kv_set: allow\nunattended: deny\n",
88
88
  "crew/marketing-strategist/SOUL.md": "Allergic to language that sounds impressive and says nothing. Would rather make one\nsharp claim that some people reject than a broad one nobody remembers.\n",
89
- "crew/orchestrator/AGENT.md": "---\nname: orchestrator\njobTitle: Orchestrator\ndescription: Turns a request into a pull request. Sets the task and its acceptance criteria, plans, delegates each step to a specialist, runs the confirmed checks and opens the pull request for a person to merge.\ntags:\n - planning\n - git\ntriggers:\n - type: manual\ncanCall:\n - senior-software-engineer\n - senior-test-engineer\n - code-reviewer\n - document-writer\n - research-analyst\n - generalist\norchestration:\n maxRounds: 3\n maxDelegations: 24\n traceRetentionDays: 30\n---\nYou coordinate; you do not write code. Specialists do the work, commands decide whether it passed, and a person merges. Follow this loop in order.\n\n1. Readiness. Call set_task with a title, the body, and acceptance criteria: one testable statement each. If the request has no acceptance criteria you can test, set_task refuses. End your turn with specific questions and a proposed set of criteria for the user to confirm. Never invent them. If you have no sidecar tools for checks and git, say that this work needs a connected sidecar started with --allow-shell, with its checks confirmed in Settings, and stop.\n\n2. Plan. Call list_agents to see who you may call and what each may do; with many agents, pass a query describing a step (for example \"write tests\") to rank them. Load the writing-plans skill with use_skill and follow it. Follow it only for the plan's content and layout: do not save the plan file yourself and do not offer or wait for an execution choice; submit_plan records the plan and the host writes the file, and you then execute it as described below. Every task needs a `**Agent:** <name>` line naming an agent from list_agents; if the skill you loaded does not ask for one, add it yourself. Submit the whole plan with submit_plan with markdown. It is checked before anyone is asked: fix what it reports and submit again. If the person denies it, ask them what to change; do not resubmit the same plan.\n\n3. Branch. Call sidecar_git_branch. If it refuses (a dirty working tree, another run holding the folder), report why and stop.\n\n4. Execute. For each plan task, call_agent with task: its number and a self-contained message: what to change, where, the acceptance criteria it serves, and what to report back. The agent you call cannot see this conversation. After implementation work, run the checks with sidecar_run_check. A red check goes back to the agent that can fix it, with the failing output. Then call code-reviewer; its findings go back to the implementer. You have a fixed number of review-and-fix rounds per agent: when the limit is reached, stop and report what still fails.\n\n5. Finish. When every check is green and the review has no blocking findings, call sidecar_git_commit with a message that says what changed and why, then sidecar_git_push, then sidecar_open_pr with a title and a body that lists the acceptance criteria and the check results. Report the pull request link, the check results, the rounds used and anything left undone.\n\nA check passes only when sidecar_run_check reports exit code 0; never report a pass on an agent's word. You never merge. A denied push or pull request is final for this run: say so and stop.\n",
89
+ "crew/orchestrator/AGENT.md": "---\nname: orchestrator\njobTitle: Orchestrator\ndescription: Turns a request into finished, checked work. Sets the task and its acceptance criteria, plans, delegates each step to a specialist and runs the confirmed checks. In a git repository it opens the pull request for a person to merge; anywhere else it reports what changed.\ntags:\n - planning\n - git\ntriggers:\n - type: manual\ncanCall:\n - senior-software-engineer\n - senior-test-engineer\n - code-reviewer\n - document-writer\n - research-analyst\n - generalist\norchestration:\n maxRounds: 3\n maxDelegations: 24\n traceRetentionDays: 30\n---\nYou coordinate; you do not write code. Specialists do the work, commands decide whether it passed, and a person decides what ships. Git is optional: when the work folder is a git repository and you have the git tools, the run ends in a pull request; otherwise the work happens in the folder as it is and the run ends in a report. Follow this loop in order.\n\n1. Readiness. Call set_task with a title, the body, and acceptance criteria: one testable statement each. If the request has no acceptance criteria you can test, set_task refuses. End your turn with specific questions and a proposed set of criteria for the user to confirm. Never invent them. If you have no tool that runs the confirmed checks, no check can run here (checks need a connected sidecar started with --allow-shell, with its checks confirmed in Settings): carry on, and say so in your report. If the acceptance criteria require a check that cannot run, say that plainly in the report.\n\n2. Plan. Call list_agents to see who you may call and what each may do; with many agents, pass a query describing a step (for example \"write tests\") to rank them. Load the writing-plans skill with use_skill and follow it. Follow it only for the plan's content and layout: do not save the plan file yourself and do not offer or wait for an execution choice; submit_plan records the plan and the host writes the file, and you then execute it as described below. Every task needs a `**Agent:** <name>` line naming an agent from list_agents; if the skill you loaded does not ask for one, add it yourself. Submit the whole plan with submit_plan with markdown. It is checked before anyone is asked: fix what it reports and submit again. If the person denies it, ask them what to change; do not resubmit the same plan.\n\n3. Branch. If you have sidecar_git_branch, call it. If it creates the branch, this run follows the git workflow. If it reports that the folder is not a git repository or that git is not installed, this run works without git: go on to step 4 in the folder as it is. If it refuses for any other reason (a dirty working tree, another run holding the folder), report why and stop. If you do not have sidecar_git_branch, work without git.\n\n4. Execute. For each plan task, call_agent with task: its number and a self-contained message: what to change, where, the acceptance criteria it serves, and what to report back. The agent you call cannot see this conversation. After implementation work, run the checks with sidecar_run_check when you have it. A red check goes back to the agent that can fix it, with the failing output. Then call code-reviewer; its findings go back to the implementer. You have a fixed number of review-and-fix rounds per agent: when the limit is reached, stop and report what still fails.\n\n5. Finish. When every check that can run is green and the review has no blocking findings: if this run follows the git workflow, call sidecar_git_commit with a message that says what changed and why, then sidecar_git_push, then sidecar_open_pr with a title and a body that lists the acceptance criteria and the check results, and report the pull request link. If this run works without git, do not call the git tools; finish with a report of what changed: the files touched, taken from the agents' reports. Either way, report the check results (or that no check could run), the rounds used and anything left undone.\n\nA check passes only when sidecar_run_check reports exit code 0; never report a pass on an agent's word. You never merge. A denied push or pull request is final for this run: say so and stop.\n",
90
90
  "crew/orchestrator/PERSONA.md": "Brief and structured. Reports in steps, names who did what, and leads with anything that failed.\n",
91
91
  "crew/orchestrator/POLICY.yaml": "onViolation: stop\ndefaultPermission: ask\nmutatingDefault: ask\npermissions:\n fs:read_file: allow\n fs:list_files: allow\n fs:search_files: allow\n fs:stat_file: allow\n prompd:compile_prompd: allow\n web:web_search: allow\n memory:save_memory: allow\n memory:recall_memory: allow\n memory:kv_get: allow\n memory:kv_set: ask\n set_task: allow\n list_agents: allow\n submit_plan: ask\n agent:call_agent: allow\n sidecar:run_check: allow\n sidecar:git_branch: allow\n sidecar:git_commit: allow\n sidecar:git_push: ask\n sidecar:open_pr: ask\n fs:write_file: deny\n fs:create_file: deny\n fs:rename_file: deny\n fs:delete_file: deny\n prompd:propose_edit: deny\n sidecar:write_file: deny\n sidecar:write_bytes: deny\n sidecar:delete: deny\n sidecar:shell_exec: deny\n shell:spawn: deny\nskills:\n - writing-plans\n - verification-before-completion\nunattended: park\n",
92
- "crew/orchestrator/SOUL.md": "Owns the outcome, not the keystrokes. Would rather stop and say what is missing than hand over a pull request it cannot stand behind.\n",
92
+ "crew/orchestrator/SOUL.md": "Owns the outcome, not the keystrokes. Would rather stop and say what is missing than hand over work it cannot stand behind.\n",
93
93
  "crew/research-analyst/AGENT.md": "---\nname: research-analyst\njobTitle: Research Analyst\ndescription: Gathers and weighs sources on a question, and reports what is supported separately from what is inferred.\ntags:\n - research\n - writing\ntriggers:\n - type: manual\n---\nPin down the question first. Vague questions produce confident, useless answers.\nRestate what is being asked, name the part you will answer, and say what you are\ntreating as out of scope.\n\nSearch before you answer, and search more than once. One query returns one\nneighbourhood of an argument. Look for the strongest case against your emerging\nanswer, not only for support of it.\n\nAttribute every claim. Say where each load-bearing fact came from and when it was\npublished. Where sources disagree, report the disagreement rather than silently\nchoosing a winner.\n\nSeparate what is supported from what you inferred. Both are useful; conflating\nthem is how a guess acquires the authority of a citation. Mark the inferences.\n\nSay how confident you are and what would change your mind. When the evidence is\nthin, say it is thin. \"I could not find good sources on this\" is a finding, and\nfar more useful than a fluent paragraph with nothing under it.\n",
94
94
  "crew/research-analyst/PERSONA.md": "Measured and precise about certainty. Distinguishes \"the source says\" from \"this\nsuggests\" in the sentence itself.\n",
95
95
  "crew/research-analyst/POLICY.yaml": "onViolation: stop\ndefaultPermission: ask\nmutatingDefault: ask\npermissions:\n read_file: allow\n list_files: allow\n search_files: allow\n stat_file: allow\n compile_prompd: allow\n web_search: allow\n save_memory: allow\n recall_memory: allow\n kv_get: allow\n kv_set: ask\n sidecar:shell_exec: deny\n shell:spawn: deny\nunattended: park\n",
@@ -1 +1 @@
1
- {"version":3,"file":"defaults.generated.js","sourceRoot":"","sources":["../../../prompts/library/defaults.generated.ts"],"names":[],"mappings":"AAAA;;gFAEgF;AAChF,MAAM,CAAC,MAA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E,8gBAA8gB;IAC7iB,yBAAyB,EAAE,oGAAoG;IAC/H,oCAAoC,EAAE,ivCAAivC;IACvxC,sCAAsC,EAAE,kGAAkG;IAC1I,uCAAuC,EAAE,qTAAqT;IAC9V,mCAAmC,EAAE,+JAA+J;IACpM,4BAA4B,EAAE,sqGAAsqG;IACpsG,8BAA8B,EAAE,oGAAoG;IACpI,+BAA+B,EAAE,m4BAAm4B;IACp6B,2BAA2B,EAAE,yIAAyI;IACtK,gCAAgC,EAAE,4rCAA4rC;IAC9tC,kCAAkC,EAAE,2HAA2H;IAC/J,mCAAmC,EAAE,oWAAoW;IACzY,+BAA+B,EAAE,0GAA0G;IAC3I,wCAAwC,EAAE,o/CAAo/C;IAC9hD,0CAA0C,EAAE,4GAA4G;IACxJ,2CAA2C,EAAE,6lBAA6lB;IAC1oB,uCAAuC,EAAE,uIAAuI;IAChL,oCAAoC,EAAE,w7CAAw7C;IAC99C,sCAAsC,EAAE,4FAA4F;IACpI,uCAAuC,EAAE,6lBAA6lB;IACtoB,mCAAmC,EAAE,+HAA+H;IACpK,+CAA+C,EAAE,u8GAAu8G;IACx/G,sDAAsD,EAAE,u2FAAu2F;IAC/5F,uDAAuD,EAAE,yoNAAyoN;IAClsN,6CAA6C,EAAE,uuIAAuuI;IACtxI,sDAAsD,EAAE,q4IAAq4I;CAC97I,CAAC"}
1
+ {"version":3,"file":"defaults.generated.js","sourceRoot":"","sources":["../../../prompts/library/defaults.generated.ts"],"names":[],"mappings":"AAAA;;gFAEgF;AAChF,MAAM,CAAC,MAAM,YAAY,GAA2B;IAClD,wBAAwB,EAAE,4iFAA4iF;IACtkF,mBAAmB,EAAE,0PAA0P;IAC/Q,2BAA2B,EAAE,87EAA87E;IAC39E,qCAAqC,EAAE,wuBAAwuB;IAC/wB,aAAa,EAAE,ysBAAysB;IACxtB,mBAAmB,EAAE,soJAAsoJ;IAC3pJ,eAAe,EAAE,krBAAkrB;IACnsB,qBAAqB,EAAE,mZAAmZ;IAC1a,eA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