@ordewell/core 0.12.1 → 0.12.3

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 (44) hide show
  1. package/dist/{ModeResolver-CA2fUU9h.d.mts → ModeResolver-CkZnbIqs.d.mts} +1 -1
  2. package/dist/{ModeResolver-B64aUZXJ.d.ts → ModeResolver-DS-aCVOP.d.ts} +1 -1
  3. package/dist/{Task-CxGgN6I0.d.mts → Task-D3O49EUo.d.mts} +43 -6
  4. package/dist/{Task-CxGgN6I0.d.ts → Task-D3O49EUo.d.ts} +43 -6
  5. package/dist/{chunk-RZ23BMVR.mjs → chunk-3S5IVTZM.mjs} +80 -22
  6. package/dist/chunk-3S5IVTZM.mjs.map +1 -0
  7. package/dist/{chunk-FX33UKAD.mjs → chunk-IOYBL3E5.mjs} +3 -3
  8. package/dist/{chunk-UDUATSCJ.mjs → chunk-MJKCU4U7.mjs} +1 -1
  9. package/dist/{chunk-UDUATSCJ.mjs.map → chunk-MJKCU4U7.mjs.map} +1 -1
  10. package/dist/{chunk-PKJTN2PD.mjs → chunk-POD3KZQW.mjs} +7 -1
  11. package/dist/chunk-POD3KZQW.mjs.map +1 -0
  12. package/dist/{chunk-2IFKPYPO.mjs → chunk-YZDWWXCB.mjs} +58 -17
  13. package/dist/chunk-YZDWWXCB.mjs.map +1 -0
  14. package/dist/{eventStore-CTCSKS9E.d.ts → eventStore-BcoMsZtU.d.mts} +23 -7
  15. package/dist/{eventStore-CcB8yELZ.d.mts → eventStore-CSFKy48Y.d.ts} +23 -7
  16. package/dist/index.d.mts +248 -112
  17. package/dist/index.d.ts +248 -112
  18. package/dist/index.js +2576 -1104
  19. package/dist/index.js.map +1 -1
  20. package/dist/index.mjs +2240 -866
  21. package/dist/index.mjs.map +1 -1
  22. package/dist/parsing.d.mts +2 -2
  23. package/dist/parsing.d.ts +2 -2
  24. package/dist/parsing.js +43 -15
  25. package/dist/parsing.js.map +1 -1
  26. package/dist/parsing.mjs +3 -3
  27. package/dist/plan-utils.d.mts +27 -5
  28. package/dist/plan-utils.d.ts +27 -5
  29. package/dist/plan-utils.js +99 -14
  30. package/dist/plan-utils.js.map +1 -1
  31. package/dist/plan-utils.mjs +47 -3
  32. package/dist/plan-utils.mjs.map +1 -1
  33. package/dist/{runSettingsText-DFVpe6aU.d.mts → runSettingsText-C6eto6Uv.d.ts} +550 -26
  34. package/dist/{runSettingsText-lKLDsyli.d.ts → runSettingsText-DnzSrB0c.d.mts} +550 -26
  35. package/dist/testing.d.mts +2 -2
  36. package/dist/testing.d.ts +2 -2
  37. package/dist/testing.js.map +1 -1
  38. package/dist/testing.mjs +2 -2
  39. package/docker/task.Dockerfile +7 -4
  40. package/package.json +1 -1
  41. package/dist/chunk-2IFKPYPO.mjs.map +0 -1
  42. package/dist/chunk-PKJTN2PD.mjs.map +0 -1
  43. package/dist/chunk-RZ23BMVR.mjs.map +0 -1
  44. /package/dist/{chunk-FX33UKAD.mjs.map → chunk-IOYBL3E5.mjs.map} +0 -0
@@ -14,6 +14,9 @@ import {
14
14
  SEVERITY_LABEL,
15
15
  STALLED_LABEL,
16
16
  STOPPING_LABEL,
17
+ SUBPLANNER_ACCOUNTING,
18
+ SUBPLANNER_CHILD,
19
+ SUBPLANNER_SCOPE,
17
20
  SUPERVISOR_LEVEL_LABEL,
18
21
  WAITS_FOR_APPROVAL_LABEL,
19
22
  accountLimitPercentText,
@@ -48,6 +51,7 @@ import {
48
51
  closeTurn,
49
52
  compactionText,
50
53
  confirmedOverride,
54
+ containersOffered,
51
55
  contextMeterText,
52
56
  contextMeterTitle,
53
57
  costText,
@@ -84,6 +88,7 @@ import {
84
88
  isMeasured,
85
89
  isRepoGroup,
86
90
  isTaskRunning,
91
+ keptDelegationBudget,
87
92
  logContinues,
88
93
  logResumes,
89
94
  loopBodyLabel,
@@ -119,6 +124,7 @@ import {
119
124
  reconcileApprovals,
120
125
  reduceConversation,
121
126
  reduceTaskLog,
127
+ rememberDelegationBudget,
122
128
  repairWaitLabel,
123
129
  repairedLanded,
124
130
  repairedNotice,
@@ -165,7 +171,7 @@ import {
165
171
  usageText,
166
172
  wakeUpItems,
167
173
  worstSeverity
168
- } from "./chunk-RZ23BMVR.mjs";
174
+ } from "./chunk-3S5IVTZM.mjs";
169
175
  import {
170
176
  betweenRounds,
171
177
  checkOf,
@@ -175,7 +181,7 @@ import {
175
181
  onOneLine,
176
182
  outOfRounds,
177
183
  scriptTaskText
178
- } from "./chunk-2IFKPYPO.mjs";
184
+ } from "./chunk-YZDWWXCB.mjs";
179
185
  import {
180
186
  DEFAULT_RUNNERS,
181
187
  canSetDependencies,
@@ -194,9 +200,40 @@ import {
194
200
  titledTaskRef,
195
201
  titledTaskRefOf,
196
202
  walkPlan
197
- } from "./chunk-PKJTN2PD.mjs";
203
+ } from "./chunk-POD3KZQW.mjs";
204
+
205
+ // src/services/composerTips.ts
206
+ var COMPOSER_TIPS = [
207
+ // The per-runner model allowlist (ADR-0003) is the easiest command to miss.
208
+ { command: "allowlist", weight: 3, text: "Tip: Use /allowlist to limit which models the planner assigns per runner." },
209
+ { command: "planner", weight: 1, text: "Tip: Use /planner to pick the planner's harness, model and effort." },
210
+ { command: "runners", weight: 1, text: "Tip: Use /runners to turn runners on or off." },
211
+ { command: "settings", weight: 1, text: "Tip: Use /settings for autonomy, supervisor, merging, autorun and more." },
212
+ { command: "help", weight: 1, text: "Tip: Use /help to list every command." }
213
+ ];
214
+ function tipCycle(tips) {
215
+ const total = tips.reduce((sum, tip) => sum + Math.max(0, tip.weight), 0);
216
+ if (total === 0) return [];
217
+ const slots = new Array(total).fill(void 0);
218
+ const order = tips.map((tip, index) => ({ tip, index })).filter(({ tip }) => tip.weight > 0).sort((a, b) => b.tip.weight - a.tip.weight || a.index - b.index);
219
+ for (const { tip } of order) {
220
+ const free = slots.flatMap((slot, at) => slot === void 0 ? [at] : []);
221
+ for (let k = 0; k < tip.weight; k++) {
222
+ slots[free[Math.floor((k + 0.5) * free.length / tip.weight)]] = tip;
223
+ }
224
+ }
225
+ const cycle = slots.filter((tip) => tip !== void 0);
226
+ const start = cycle.indexOf(order[0].tip);
227
+ return [...cycle.slice(start), ...cycle.slice(0, start)];
228
+ }
229
+ function composerTip(seq, answers) {
230
+ const cycle = tipCycle(COMPOSER_TIPS.filter((tip) => answers.has(tip.command)));
231
+ if (cycle.length === 0) return null;
232
+ return cycle[(seq % cycle.length + cycle.length) % cycle.length].text;
233
+ }
198
234
  export {
199
235
  CHECKPOINT_TRUNCATE_LENGTH,
236
+ COMPOSER_TIPS,
200
237
  DEFAULT_RUNNERS,
201
238
  DELEGATION_OFFERED,
202
239
  EMPTY_CONVERSATION,
@@ -212,6 +249,9 @@ export {
212
249
  SEVERITY_LABEL,
213
250
  STALLED_LABEL,
214
251
  STOPPING_LABEL,
252
+ SUBPLANNER_ACCOUNTING,
253
+ SUBPLANNER_CHILD,
254
+ SUBPLANNER_SCOPE,
215
255
  SUPERVISOR_LEVEL_LABEL,
216
256
  WAITS_FOR_APPROVAL_LABEL,
217
257
  accountLimitPercentText,
@@ -249,7 +289,9 @@ export {
249
289
  clampThinkingEffort,
250
290
  closeTurn,
251
291
  compactionText,
292
+ composerTip,
252
293
  confirmedOverride,
294
+ containersOffered,
253
295
  contextMeterText,
254
296
  contextMeterTitle,
255
297
  costText,
@@ -288,6 +330,7 @@ export {
288
330
  isMeasured,
289
331
  isRepoGroup,
290
332
  isTaskRunning,
333
+ keptDelegationBudget,
291
334
  loadedSkillTokens,
292
335
  logContinues,
293
336
  logResumes,
@@ -329,6 +372,7 @@ export {
329
372
  reconcileApprovals,
330
373
  reduceConversation,
331
374
  reduceTaskLog,
375
+ rememberDelegationBudget,
332
376
  repairWaitLabel,
333
377
  repairedLanded,
334
378
  repairedNotice,
@@ -1 +1 @@
1
- {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
1
+ {"version":3,"sources":["../src/services/composerTips.ts"],"sourcesContent":["/**\n * The tips an empty planner chat composer shows (#137), one table for every\n * surface so the TUI and the webview agree on the wording and how often each\n * comes round. A surface offers only the tips for the commands it answers.\n */\n\nexport interface ComposerTip {\n /** The built-in planner chat command the tip names, without its slash. */\n command: string;\n /** How many times per cycle the tip comes round. */\n weight: number;\n /** Short enough to fit after the prompt and caret on an 80-column terminal. */\n text: string;\n}\n\nexport const COMPOSER_TIPS: readonly ComposerTip[] = [\n // The per-runner model allowlist (ADR-0003) is the easiest command to miss.\n { command: 'allowlist', weight: 3, text: 'Tip: Use /allowlist to limit which models the planner assigns per runner.' },\n { command: 'planner', weight: 1, text: \"Tip: Use /planner to pick the planner's harness, model and effort.\" },\n { command: 'runners', weight: 1, text: 'Tip: Use /runners to turn runners on or off.' },\n { command: 'settings', weight: 1, text: 'Tip: Use /settings for autonomy, supervisor, merging, autorun and more.' },\n { command: 'help', weight: 1, text: 'Tip: Use /help to list every command.' },\n];\n\n/**\n * One cycle of `tips`, each appearing exactly its weight times. Heavier tips\n * take their slots first, at the midpoints of equal shares of the free slots, so\n * raising a weight spreads it out instead of leaving it to run together at the\n * end of the cycle; where a tip outnumbers all the others, the touches it\n * cannot avoid are spread as evenly as the counts allow. The cycle starts on\n * the heaviest tip, so the first seq is the one the table weights most.\n */\nexport function tipCycle(tips: readonly ComposerTip[]): ComposerTip[] {\n const total = tips.reduce((sum, tip) => sum + Math.max(0, tip.weight), 0);\n if (total === 0) return [];\n const slots = new Array<ComposerTip | undefined>(total).fill(undefined);\n const order = tips\n .map((tip, index) => ({ tip, index }))\n .filter(({ tip }) => tip.weight > 0)\n .sort((a, b) => b.tip.weight - a.tip.weight || a.index - b.index);\n for (const { tip } of order) {\n const free = slots.flatMap((slot, at) => (slot === undefined ? [at] : []));\n for (let k = 0; k < tip.weight; k++) {\n slots[free[Math.floor(((k + 0.5) * free.length) / tip.weight)]] = tip;\n }\n }\n const cycle = slots.filter((tip): tip is ComposerTip => tip !== undefined);\n const start = cycle.indexOf(order[0].tip);\n return [...cycle.slice(start), ...cycle.slice(0, start)];\n}\n\n/**\n * The tip for the `seq`-th time the composer has been empty, among those for\n * the commands the surface answers, or null when it answers none of them. The\n * same `seq` always gives the same tip, so the surface decides when a new one\n * shows by when it moves `seq` on, and its rendering stays a function of state.\n */\nexport function composerTip(seq: number, answers: ReadonlySet<string>): string | null {\n const cycle = tipCycle(COMPOSER_TIPS.filter((tip) => answers.has(tip.command)));\n if (cycle.length === 0) return null;\n return cycle[((seq % cycle.length) + cycle.length) % cycle.length].text;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAeO,IAAM,gBAAwC;AAAA;AAAA,EAEnD,EAAE,SAAS,aAAa,QAAQ,GAAG,MAAM,4EAA4E;AAAA,EACrH,EAAE,SAAS,WAAW,QAAQ,GAAG,MAAM,qEAAqE;AAAA,EAC5G,EAAE,SAAS,WAAW,QAAQ,GAAG,MAAM,+CAA+C;AAAA,EACtF,EAAE,SAAS,YAAY,QAAQ,GAAG,MAAM,0EAA0E;AAAA,EAClH,EAAE,SAAS,QAAQ,QAAQ,GAAG,MAAM,wCAAwC;AAC9E;AAUO,SAAS,SAAS,MAA6C;AACpE,QAAM,QAAQ,KAAK,OAAO,CAAC,KAAK,QAAQ,MAAM,KAAK,IAAI,GAAG,IAAI,MAAM,GAAG,CAAC;AACxE,MAAI,UAAU,EAAG,QAAO,CAAC;AACzB,QAAM,QAAQ,IAAI,MAA+B,KAAK,EAAE,KAAK,MAAS;AACtE,QAAM,QAAQ,KACX,IAAI,CAAC,KAAK,WAAW,EAAE,KAAK,MAAM,EAAE,EACpC,OAAO,CAAC,EAAE,IAAI,MAAM,IAAI,SAAS,CAAC,EAClC,KAAK,CAAC,GAAG,MAAM,EAAE,IAAI,SAAS,EAAE,IAAI,UAAU,EAAE,QAAQ,EAAE,KAAK;AAClE,aAAW,EAAE,IAAI,KAAK,OAAO;AAC3B,UAAM,OAAO,MAAM,QAAQ,CAAC,MAAM,OAAQ,SAAS,SAAY,CAAC,EAAE,IAAI,CAAC,CAAE;AACzE,aAAS,IAAI,GAAG,IAAI,IAAI,QAAQ,KAAK;AACnC,YAAM,KAAK,KAAK,OAAQ,IAAI,OAAO,KAAK,SAAU,IAAI,MAAM,CAAC,CAAC,IAAI;AAAA,IACpE;AAAA,EACF;AACA,QAAM,QAAQ,MAAM,OAAO,CAAC,QAA4B,QAAQ,MAAS;AACzE,QAAM,QAAQ,MAAM,QAAQ,MAAM,CAAC,EAAE,GAAG;AACxC,SAAO,CAAC,GAAG,MAAM,MAAM,KAAK,GAAG,GAAG,MAAM,MAAM,GAAG,KAAK,CAAC;AACzD;AAQO,SAAS,YAAY,KAAa,SAA6C;AACpF,QAAM,QAAQ,SAAS,cAAc,OAAO,CAAC,QAAQ,QAAQ,IAAI,IAAI,OAAO,CAAC,CAAC;AAC9E,MAAI,MAAM,WAAW,EAAG,QAAO;AAC/B,SAAO,OAAQ,MAAM,MAAM,SAAU,MAAM,UAAU,MAAM,MAAM,EAAE;AACrE;","names":[]}