ex-workflow 0.4.0-stage → 1.0.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 (103) hide show
  1. package/CHANGELOG.md +58 -2
  2. package/README.md +68 -32
  3. package/dist/adapters/index.cjs +1 -1
  4. package/dist/adapters/index.mjs +1 -1
  5. package/dist/{roles-BLBRKhUZ.d.ts → budget-Cx63FX2K.d.ts} +9 -2
  6. package/dist/{roles-aneKYJ3Z.d.cts → budget-JyNKxP5N.d.cts} +9 -2
  7. package/dist/chunk-3KFQPSRX.mjs +2 -0
  8. package/dist/chunk-3KFQPSRX.mjs.map +1 -0
  9. package/dist/chunk-5PHK72VM.cjs +2 -0
  10. package/dist/chunk-5PHK72VM.cjs.map +1 -0
  11. package/dist/chunk-5TXYMLBF.mjs +3 -0
  12. package/dist/chunk-5TXYMLBF.mjs.map +1 -0
  13. package/dist/chunk-7IG6EQI4.mjs +6 -0
  14. package/dist/chunk-7IG6EQI4.mjs.map +1 -0
  15. package/dist/chunk-CYXVGHQM.cjs +2 -0
  16. package/dist/chunk-CYXVGHQM.cjs.map +1 -0
  17. package/dist/chunk-FKTCGQYB.cjs +2 -0
  18. package/dist/chunk-FKTCGQYB.cjs.map +1 -0
  19. package/dist/chunk-HIHMBMB5.cjs +2 -0
  20. package/dist/chunk-HIHMBMB5.cjs.map +1 -0
  21. package/dist/chunk-MQWMQ4PD.mjs +2 -0
  22. package/dist/chunk-MQWMQ4PD.mjs.map +1 -0
  23. package/dist/chunk-QDMEM62U.mjs +2 -0
  24. package/dist/chunk-QDMEM62U.mjs.map +1 -0
  25. package/dist/chunk-U3OXAO67.mjs +2 -0
  26. package/dist/chunk-U3OXAO67.mjs.map +1 -0
  27. package/dist/chunk-UZQV73X7.mjs +2 -0
  28. package/dist/chunk-UZQV73X7.mjs.map +1 -0
  29. package/dist/chunk-VXH2FAKV.cjs +2 -0
  30. package/dist/chunk-VXH2FAKV.cjs.map +1 -0
  31. package/dist/chunk-WOGK54HB.cjs +3 -0
  32. package/dist/chunk-WOGK54HB.cjs.map +1 -0
  33. package/dist/chunk-XMO2RCXB.cjs +2 -0
  34. package/dist/chunk-XMO2RCXB.cjs.map +1 -0
  35. package/dist/chunk-YBHHICTZ.mjs +2 -0
  36. package/dist/chunk-YBHHICTZ.mjs.map +1 -0
  37. package/dist/chunk-YJN4JEJU.cjs +2 -0
  38. package/dist/chunk-YJN4JEJU.cjs.map +1 -0
  39. package/dist/chunk-YRATJT7P.cjs +6 -0
  40. package/dist/chunk-YRATJT7P.cjs.map +1 -0
  41. package/dist/chunk-Z2G7DGDF.mjs +2 -0
  42. package/dist/chunk-Z2G7DGDF.mjs.map +1 -0
  43. package/dist/cli/bin.cjs +1 -1
  44. package/dist/cli/bin.mjs +1 -1
  45. package/dist/cli/index.cjs +1 -1
  46. package/dist/cli/index.mjs +1 -1
  47. package/dist/index.cjs +1 -1
  48. package/dist/index.cjs.map +1 -1
  49. package/dist/index.d.cts +35 -12
  50. package/dist/index.d.ts +35 -12
  51. package/dist/index.mjs +1 -1
  52. package/dist/index.mjs.map +1 -1
  53. package/dist/kanban/index.cjs +1 -1
  54. package/dist/kanban/index.mjs +1 -1
  55. package/dist/schema/index.cjs +1 -1
  56. package/dist/schema/index.mjs +1 -1
  57. package/dist/scrum/index.cjs +1 -1
  58. package/dist/scrum/index.d.cts +18 -3
  59. package/dist/scrum/index.d.ts +18 -3
  60. package/dist/scrum/index.mjs +1 -1
  61. package/dist/types.d.cts +23 -1
  62. package/dist/types.d.ts +23 -1
  63. package/dist/waterfall/index.cjs +1 -1
  64. package/dist/waterfall/index.d.cts +4 -1
  65. package/dist/waterfall/index.d.ts +4 -1
  66. package/dist/waterfall/index.mjs +1 -1
  67. package/package.json +1 -1
  68. package/dist/chunk-36M6OVUJ.mjs +0 -2
  69. package/dist/chunk-36M6OVUJ.mjs.map +0 -1
  70. package/dist/chunk-7KF5K3L7.cjs +0 -2
  71. package/dist/chunk-7KF5K3L7.cjs.map +0 -1
  72. package/dist/chunk-CWBH7H52.cjs +0 -2
  73. package/dist/chunk-CWBH7H52.cjs.map +0 -1
  74. package/dist/chunk-DXC2RSN5.cjs +0 -3
  75. package/dist/chunk-DXC2RSN5.cjs.map +0 -1
  76. package/dist/chunk-GATJZYTB.mjs +0 -2
  77. package/dist/chunk-GATJZYTB.mjs.map +0 -1
  78. package/dist/chunk-GFH2FEZH.mjs +0 -2
  79. package/dist/chunk-GFH2FEZH.mjs.map +0 -1
  80. package/dist/chunk-HHC5EZ54.cjs +0 -2
  81. package/dist/chunk-HHC5EZ54.cjs.map +0 -1
  82. package/dist/chunk-KSKEFYY7.cjs +0 -2
  83. package/dist/chunk-KSKEFYY7.cjs.map +0 -1
  84. package/dist/chunk-KUUIAKEJ.cjs +0 -2
  85. package/dist/chunk-KUUIAKEJ.cjs.map +0 -1
  86. package/dist/chunk-L2ZN6HEL.mjs +0 -2
  87. package/dist/chunk-L2ZN6HEL.mjs.map +0 -1
  88. package/dist/chunk-NDORREWR.mjs +0 -2
  89. package/dist/chunk-NDORREWR.mjs.map +0 -1
  90. package/dist/chunk-NZ2DIDOD.mjs +0 -2
  91. package/dist/chunk-NZ2DIDOD.mjs.map +0 -1
  92. package/dist/chunk-OHSQ52DW.mjs +0 -6
  93. package/dist/chunk-OHSQ52DW.mjs.map +0 -1
  94. package/dist/chunk-RSKZVOYC.cjs +0 -6
  95. package/dist/chunk-RSKZVOYC.cjs.map +0 -1
  96. package/dist/chunk-S22CPYXJ.mjs +0 -3
  97. package/dist/chunk-S22CPYXJ.mjs.map +0 -1
  98. package/dist/chunk-SHAPFMVP.mjs +0 -2
  99. package/dist/chunk-SHAPFMVP.mjs.map +0 -1
  100. package/dist/chunk-SJRRQZ3R.cjs +0 -2
  101. package/dist/chunk-SJRRQZ3R.cjs.map +0 -1
  102. package/dist/chunk-UM5X2JHB.cjs +0 -2
  103. package/dist/chunk-UM5X2JHB.cjs.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/brief.ts","../src/complete.ts","../src/accounting.ts"],"names":["completions","state","itemId","out","ev","lastCompletion","all","synthesizeBrief","methodology","item","fail","role","roleOf","upstream","doNot","sources","dep","p","d","priorHandoffs","touched","relatedBugs","b","a","it","openIteration","gate","stageOf","brief","remaining","openQuestions","last","next","opts","res","plan","briefs","VERDICTS","LESSON_SCOPES","isObj","x","str","validate","handoff","acc","getItem","bad","what","fix","verdict","lessons","l","followUps","f","k","pulledFromStage","i","t","reworkStage","lastDispatchBefore","complete","now","result","ruled","applyAction","completeBody","at","nowOf","id","s","addEvidence","addSpent","lid","appendEvent","n","first","_drop","rest","addItem","warnings","clearRole","moveItem","lastStageId","stage","assertPolicies","checkGate","v","raisePending","advanceItem","raiseBlocker","thinker","rolesWith","qid","parent","pulledFrom","q","patchItem","NUMERIC","pick","correctAccounting","patch","by","line","indexes","idx","before","flag","after","delta","owner"],"mappings":"gJAiBA,SAASA,CAAAA,CACPC,CAAAA,CACAC,CAAAA,CAC0C,CAC1C,IAAMC,CAAAA,CAAgD,EAAC,CACvD,IAAA,IAAWC,CAAAA,IAAMH,CAAAA,CAAM,MAAA,CACjBG,CAAAA,CAAG,IAAA,GAAS,gBAAA,EAAqBA,CAAAA,CAAG,OAAA,CAA6B,EAAA,GAAOF,CAAAA,EAC1EC,CAAAA,CAAI,IAAA,CAAK,CAAE,GAAIC,CAAAA,CAAG,OAAA,CAA8B,EAAA,CAAIA,CAAAA,CAAG,EAAG,CAAC,CAAA,CAE/D,OAAOD,CACT,CAEA,SAASE,CAAAA,CAAeJ,CAAAA,CAAsBC,CAAAA,CAA8C,CAC1F,IAAMI,CAAAA,CAAMN,CAAAA,CAAYC,CAAAA,CAAOC,CAAM,CAAA,CACrC,OAAOI,CAAAA,CAAIA,CAAAA,CAAI,MAAA,CAAS,CAAC,CAC3B,CAEO,SAASC,EAAAA,CACdN,CAAAA,CACAO,CAAAA,CACAC,GAAAA,CACO,CACFA,GAAAA,CAAK,IAAA,EACRC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ClE,CACF,CAAA,CACApF,CACN,CACF,CAAA,CAAA,CACKiD,CAAAA,CACLJ,CAAAA,CACA,sBAAA,CACAgC,CAAAA,CACA,CACE,KAAMnG,CAAAA,CACN,IAAA,CAAMwE,CAAAA,CACN,SAAA,CAAWmC,GAAAA,EAAO,EAAA,EAAM,IAAA,CACxB,MAAA,CAAQvF,CAAAA,CACR,KAAA,CAAOC,CAAAA,CACP,KAAA,CAAAqF,CACF,CAAA,CACAzC,CAAAA,CAAMN,CAAG,CACX,CACF","file":"chunk-Z2G7DGDF.mjs","sourcesContent":["import { remaining } from \"./budget.ts\";\nimport { fail } from \"./errors.ts\";\nimport { stageOf } from \"./items.ts\";\nimport { openIteration, plan, type PlanOptions, type PlanReason, type Skipped } from \"./planner.ts\";\nimport { roleOf } from \"./roles.ts\";\nimport type { Brief, Handoff, Methodology, Verdict, WorkItem, WorkflowState } from \"./types.ts\";\n\ninterface CompletedPayload {\n id: string;\n role: string;\n verdict: Verdict;\n produced: Handoff[\"produced\"];\n notes: string;\n do_not: string[];\n open_questions?: string[];\n}\n\nfunction completions(\n state: WorkflowState,\n itemId: string,\n): Array<CompletedPayload & { at: string }> {\n const out: Array<CompletedPayload & { at: string }> = [];\n for (const ev of state.events) {\n if (ev.type === \"item.completed\" && (ev.payload as CompletedPayload).id === itemId)\n out.push({ ...(ev.payload as CompletedPayload), at: ev.at });\n }\n return out;\n}\n\nfunction lastCompletion(state: WorkflowState, itemId: string): CompletedPayload | undefined {\n const all = completions(state, itemId);\n return all[all.length - 1];\n}\n\nexport function synthesizeBrief(\n state: WorkflowState,\n methodology: Methodology,\n item: WorkItem,\n): Brief {\n if (!item.role)\n fail(\n \"unknown-role\",\n `item \"${item.id}\" has no role assigned`,\n \"dispatch it with next() or set item.role\",\n { items: [item.id] },\n );\n const role = roleOf(state, item.role);\n if (!role)\n fail(\n \"unknown-role\",\n `role \"${item.role}\" does not exist`,\n `registered roles: ${Object.keys(state.roles).join(\", \")}`,\n );\n const upstream: Brief[\"upstream\"] = [];\n const doNot = [...role.do_not];\n const sources = [\n ...item.dependsOn,\n ...(item.type === \"bug\" || item.type === \"change-request\" ? (item.affects ?? []) : []),\n ];\n for (const dep of sources) {\n const p = lastCompletion(state, dep);\n if (!p) continue;\n upstream.push({ item: dep, produced: p.produced, notes: p.notes });\n for (const d of p.do_not) if (!doNot.includes(d)) doNot.push(d);\n }\n const priorHandoffs: Brief[\"priorHandoffs\"] = completions(state, item.id).map((p) => ({\n role: p.role,\n verdict: p.verdict,\n notes: p.notes,\n produced: p.produced,\n at: p.at,\n }));\n const touched = new Set([item.id, ...item.dependsOn]);\n const relatedBugs: Brief[\"relatedBugs\"] = Object.values(state.items)\n .filter(\n (b) =>\n (b.type === \"bug\" || b.type === \"change-request\") &&\n b.id !== item.id &&\n b.status !== \"done\" &&\n b.status !== \"dropped\" &&\n (b.affects ?? []).some((a) => touched.has(a)),\n )\n .map((b) => ({ id: b.id, title: b.title, affects: b.affects ?? [] }));\n const it = openIteration(state);\n const gate = stageOf(state, item.stage).gate;\n const brief: Brief = {\n item,\n role,\n modelTier: role.modelTier,\n invariants: [...methodology.invariants(state, item), ...state.agreements],\n do_not: doNot,\n acceptance: item.acceptance,\n upstream,\n priorHandoffs,\n relatedBugs,\n budgetRemaining: it ? remaining(it.budget, it.spent) : {},\n };\n if (gate) brief.gateAhead = gate;\n if (item.type === \"question\" && item.parent) {\n const p = lastCompletion(state, item.parent);\n if (p) {\n brief.parent = {\n item: item.parent,\n role: p.role,\n notes: p.notes,\n produced: p.produced,\n open_questions: p.open_questions ?? [],\n do_not: p.do_not,\n };\n for (const d of p.do_not) if (!doNot.includes(d)) doNot.push(d);\n }\n }\n return brief;\n}\n\n/** Open questions of finished items: the last completion per item, verdict done/needs-review, with open_questions left unanswered. */\nexport function openQuestions(\n state: WorkflowState,\n): Array<{ item: string; role: string; questions: string[]; at: string }> {\n const last = new Map<string, CompletedPayload & { at: string }>();\n for (const ev of state.events) {\n if (ev.type !== \"item.completed\") continue;\n const p = ev.payload as CompletedPayload;\n last.delete(p.id);\n last.set(p.id, { ...p, at: ev.at });\n }\n return [...last.values()]\n .filter(\n (p) =>\n (p.verdict === \"done\" || p.verdict === \"needs-review\") &&\n (p.open_questions ?? []).length > 0,\n )\n .map((p) => ({ item: p.id, role: p.role, questions: p.open_questions ?? [], at: p.at }));\n}\n\nexport interface NextResult {\n state: WorkflowState;\n briefs: Brief[];\n skipped: Skipped[];\n reason?: PlanReason;\n}\n\nexport function next(\n state: WorkflowState,\n methodology: Methodology,\n opts: PlanOptions = {},\n): NextResult {\n const res = plan(state, methodology, opts);\n const briefs = res.dispatched.map((d) =>\n synthesizeBrief(res.state, methodology, res.state.items[d.id]!),\n );\n return res.reason\n ? { state: res.state, briefs, skipped: res.skipped, reason: res.reason }\n : { state: res.state, briefs, skipped: res.skipped };\n}\n","import { addSpent } from \"./budget.ts\";\nimport { fail } from \"./errors.ts\";\nimport { checkGate, lastDispatchBefore, raisePending } from \"./gates.ts\";\nimport {\n addEvidence,\n addItem,\n advanceItem,\n clearRole,\n getItem,\n moveItem,\n patchItem,\n raiseBlocker,\n stageOf,\n} from \"./items.ts\";\nimport { applyAction } from \"./methodology.ts\";\nimport { assertPolicies } from \"./policies.ts\";\nimport { openIteration } from \"./planner.ts\";\nimport { rolesWith } from \"./roles.ts\";\nimport { appendEvent, nowOf } from \"./state.ts\";\nimport type {\n Accounting,\n ApplyResult,\n Handoff,\n Methodology,\n NewItem,\n Violation,\n WorkItem,\n WorkflowState,\n} from \"./types.ts\";\n\nconst VERDICTS: readonly string[] = [\"done\", \"needs-review\", \"rework\", \"blocked\", \"escalate\"];\nconst LESSON_SCOPES: readonly string[] = [\"policy\", \"skill\", \"memory\", \"spec\", \"review\"];\n\nconst isObj = (x: unknown): x is Record<string, unknown> =>\n typeof x === \"object\" && x !== null && !Array.isArray(x);\nconst str = (x: unknown) => typeof x === \"string\";\n\nfunction validate(state: WorkflowState, handoff: Handoff, acc: Accounting): void {\n const item = getItem(state, handoff.item);\n if (item.status !== \"in_progress\")\n fail(\n \"invalid-transition\",\n `item \"${item.id}\" is ${item.status}, not in_progress`,\n \"only dispatched items can be completed; call next() first\",\n { items: [item.id] },\n );\n if (!Array.isArray(handoff.do_not))\n fail(\n \"handoff-invalid\",\n `handoff for \"${item.id}\" has no do_not array`,\n \"set handoff.do_not to [] when there is nothing to forbid\",\n { items: [item.id] },\n );\n if (!Array.isArray(handoff.produced) || !Array.isArray(handoff.open_questions))\n fail(\n \"handoff-invalid\",\n `handoff for \"${item.id}\" needs produced[] and open_questions[]`,\n \"pass empty arrays when there is nothing\",\n { items: [item.id] },\n );\n const bad = (what: string, fix: string) =>\n fail(\"handoff-invalid\", `handoff for \"${item.id}\": ${what}`, fix, { items: [item.id] });\n const verdict = handoff.verdict ?? \"done\";\n if (!VERDICTS.includes(verdict))\n bad(`unknown verdict ${JSON.stringify(verdict)}`, `use one of: ${VERDICTS.join(\", \")}`);\n if (!handoff.produced.every((p) => isObj(p) && str(p.kind) && str(p.ref)))\n bad(\"produced[] entries need string kind and ref\", 'use { \"kind\": \"code\", \"ref\": \"src/a.ts\" }');\n const lessons: unknown = handoff.lessons ?? [];\n if (\n !Array.isArray(lessons) ||\n !lessons.every((l) => isObj(l) && str(l.text) && LESSON_SCOPES.includes(l.scope as string))\n )\n bad(\n \"lessons[] entries need a text and a scope\",\n `scope is one of: ${LESSON_SCOPES.join(\", \")}`,\n );\n const followUps: unknown = handoff.follow_ups ?? [];\n if (!Array.isArray(followUps) || !followUps.every((f) => isObj(f) && str(f.id) && str(f.title)))\n bad(\"follow_ups[] entries need a string id and title\", \"describe each follow-up as a new item\");\n if (handoff.role !== item.role)\n fail(\n \"handoff-invalid\",\n `handoff role \"${handoff.role}\" differs from the dispatched role \"${item.role}\"`,\n `complete as \"${item.role}\" or re-dispatch`,\n { items: [item.id] },\n );\n if (!acc.model || acc.model.trim() === \"\")\n fail(\n \"accounting-invalid\",\n `accounting for \"${item.id}\" has no model`,\n \"record the model id that actually ran the work\",\n { items: [item.id] },\n );\n for (const k of [\"tokensIn\", \"tokensOut\", \"durationMs\"] as const) {\n if (!Number.isFinite(acc[k]) || acc[k] < 0)\n fail(\n \"accounting-invalid\",\n `accounting.${k} must be a non-negative number`,\n `measure ${k} from the host's usage report`,\n { items: [item.id] },\n );\n }\n if (acc.tokensIn + acc.tokensOut === 0 && acc.estimate !== true)\n fail(\n \"accounting-invalid\",\n `accounting for \"${item.id}\" records 0 tokens`,\n \"pass the host's usage figures, or set estimate: true (CLI --estimate) to record a placeholder and correct it later with correctAccounting / exwf account\",\n { items: [item.id] },\n );\n}\n\n/** Stage the item was pulled from: the `from.stage` of its last transition into in_progress, else its current stage. */\nfunction pulledFromStage(item: WorkItem): string {\n for (let i = item.transitions.length - 1; i >= 0; i--) {\n const t = item.transitions[i]!;\n if (t.to.status === \"in_progress\") return t.from.stage;\n }\n return item.stage;\n}\n\n/** Stage a reworked item returns to: the from.stage of the last dispatch made from a stage strictly before the current one (so a reviewer's rework lands where the work was pulled from), else the plain pulled-from stage. */\nfunction reworkStage(state: WorkflowState, item: WorkItem): string {\n return lastDispatchBefore(state, item)?.from.stage ?? pulledFromStage(item);\n}\n\nexport function complete(\n state: WorkflowState,\n methodology: Methodology,\n handoff: Handoff,\n acc: Accounting,\n now?: string,\n): ApplyResult {\n validate(state, handoff, acc);\n // the methodology's rules see the completion (applyAction validates, appends nothing, then reduces)\n let result: ApplyResult | undefined;\n const ruled = applyAction(\n state,\n methodology,\n { type: \"item.complete\", by: handoff.role, payload: { item: handoff.item, handoff } },\n () => {\n result = completeBody(state, methodology, handoff, acc, now);\n return result.state;\n },\n );\n return { state: ruled.state, warnings: [...ruled.warnings, ...result!.warnings] };\n}\n\nfunction completeBody(\n state: WorkflowState,\n methodology: Methodology,\n handoff: Handoff,\n acc: Accounting,\n now?: string,\n): ApplyResult {\n const at = nowOf(now);\n const id = handoff.item;\n const role = handoff.role;\n let s: WorkflowState = { ...state, accounting: [...state.accounting, acc] };\n for (const p of handoff.produced)\n s = addEvidence(s, id, { kind: p.kind, ref: p.ref, by: role }, at);\n const it = openIteration(s);\n if (it && (it.committed.includes(id) || getItem(s, id).iteration === it.id)) {\n s = {\n ...s,\n iterations: s.iterations.map((x) =>\n x.id === it.id ? { ...x, spent: addSpent(x.spent, acc) } : x,\n ),\n };\n }\n\n for (const l of handoff.lessons ?? []) {\n const lid = `L${s.lessons.length + 1}`;\n s = {\n ...s,\n lessons: [\n ...s.lessons,\n { id: lid, at, text: l.text, scope: l.scope, status: \"raised\", from: role, item: id },\n ],\n };\n s = appendEvent(\n s,\n \"lesson.raised\",\n role,\n { id: lid, from: role, item: id, scope: l.scope },\n at,\n );\n }\n\n const followUps: string[] = [];\n for (const n of handoff.follow_ups ?? []) {\n const first = s.stages[0]!;\n const { iteration: _drop, ...rest } = n;\n s = addItem(\n s,\n { ...rest, stage: first.id, parent: id, tags: [...(n.tags ?? []), \"follow-up\"] },\n role,\n at,\n );\n followUps.push(n.id);\n }\n\n const verdict = handoff.verdict ?? \"done\";\n const warnings: Violation[] = [];\n if ((verdict === \"done\" || verdict === \"needs-review\") && handoff.open_questions.length > 0)\n warnings.push({\n rule: \"open-questions-ignored\",\n severity: \"warning\",\n item: id,\n message: `\"${id}\" finished with ${handoff.open_questions.length} open question(s) nobody will see: ${handoff.open_questions.join(\" | \")}`,\n fix: 'use verdict \"escalate\" to route them to a role with capability escalate, or answer them in the next brief',\n });\n if (verdict === \"rework\") {\n if (!handoff.notes || handoff.notes.trim() === \"\")\n fail(\n \"handoff-invalid\",\n `rework on \"${id}\" needs notes`,\n \"say what must change in handoff.notes\",\n { items: [id] },\n );\n const item = getItem(s, id);\n s = clearRole(moveItem(s, id, { stage: reworkStage(s, item), status: \"todo\" }, role, at), id);\n s = appendEvent(s, \"item.rework\", role, { id, by: role, notes: handoff.notes }, at);\n } else if (\n (verdict === \"done\" || verdict === \"needs-review\") &&\n getItem(s, id).type === \"question\"\n ) {\n // a question is answered, not delivered: it skips exit policies and gates\n const lastStageId = s.stages[s.stages.length - 1]!.id;\n s = moveItem(s, id, { stage: lastStageId, status: \"done\" }, role, at);\n } else if (verdict === \"done\" || verdict === \"needs-review\") {\n const item = getItem(s, id);\n const stage = stageOf(s, item.stage);\n assertPolicies(s, item, stage.exitPolicy, `leave \"${stage.id}\"`);\n if (stage.gate) {\n const res = checkGate(s, item, stage.gate, role);\n if (res.outcome === \"fail\")\n fail(\n \"gate-unmet\",\n `gate \"${stage.gate.id}\" blocks \"${id}\": ${res.violations.map((v) => v.message).join(\"; \")}`,\n res.violations.map((v) => v.fix).join(\"; \"),\n { items: [id], rule: res.violations[0]!.rule },\n );\n if (res.outcome === \"human\") {\n s = raisePending(\n s,\n {\n kind: \"gate\",\n item: id,\n gate: stage.gate.id,\n question: `Approve gate \"${stage.gate.id}\" for \"${item.title}\" (${id})?`,\n },\n at,\n );\n } else {\n s = appendEvent(\n advanceItem(s, id, role, verdict === \"needs-review\", at),\n \"gate.passed\",\n role,\n { item: id, gate: stage.gate.id },\n at,\n );\n }\n } else {\n s = advanceItem(s, id, role, verdict === \"needs-review\", at);\n }\n } else if (verdict === \"blocked\") {\n s = raiseBlocker(s, id, handoff.notes || \"blocked by worker\", role, role, at);\n } else if (verdict === \"escalate\") {\n const thinker = rolesWith(s, \"escalate\")[0];\n if (!thinker)\n fail(\n \"missing-capability\",\n `no role has capability \"escalate\" to receive the question from \"${id}\"`,\n \"register a role with capability escalate\",\n { items: [id] },\n );\n const n = Object.keys(s.items).filter((k) => k.startsWith(`${id}-q`)).length + 1;\n const qid = `${id}-q${n}`;\n const parent = getItem(s, id);\n const pulledFrom = pulledFromStage(parent);\n const q: NewItem = {\n id: qid,\n type: \"question\",\n title: handoff.open_questions.join(\" | \") || handoff.notes || `question from ${id}`,\n parent: id,\n role: thinker.id,\n priority: Number.MAX_SAFE_INTEGER,\n stage: pulledFrom,\n };\n if (parent.iteration !== undefined) q.iteration = parent.iteration;\n s = addItem(s, q, role, at);\n s = moveItem(s, id, { stage: pulledFrom, status: \"todo\" }, role, at);\n s = patchItem(s, id, (x) => ({ ...x, dependsOn: [...x.dependsOn, qid] }));\n s = appendEvent(s, \"item.escalated\", role, { id, question: qid, to: thinker.id }, at);\n }\n\n s = appendEvent(\n s,\n \"item.completed\",\n role,\n {\n id,\n role,\n verdict,\n produced: handoff.produced,\n notes: handoff.notes,\n do_not: handoff.do_not,\n open_questions: handoff.open_questions,\n followUps,\n tokens: acc.tokensIn + acc.tokensOut,\n durationMs: acc.durationMs,\n model: acc.model,\n },\n at,\n );\n if (methodology.afterComplete) s = methodology.afterComplete(s, id, at);\n return { state: s, warnings };\n}\n","import { fail } from \"./errors.ts\";\nimport { getItem } from \"./items.ts\";\nimport { appendEvent, nowOf } from \"./state.ts\";\nimport type { Accounting, Iteration, WorkflowState } from \"./types.ts\";\n\nexport interface AccountingPatch {\n tokensIn?: number;\n tokensOut?: number;\n durationMs?: number;\n model?: string;\n}\n\nconst NUMERIC = [\n [\"tokensIn\", \"tokens-in\"],\n [\"tokensOut\", \"tokens-out\"],\n [\"durationMs\", \"duration-ms\"],\n] as const;\n\nconst pick = (a: Accounting) => ({\n tokensIn: a.tokensIn,\n tokensOut: a.tokensOut,\n durationMs: a.durationMs,\n model: a.model,\n});\n\n/**\n * Rewrite one accounting line of an item (`line` is 1-based among the item's lines, default the last).\n * The owning iteration's spent follows the delta, open or closed; the event records before/after.\n */\nexport function correctAccounting(\n state: WorkflowState,\n itemId: string,\n patch: AccountingPatch,\n by: string,\n now?: string,\n line?: number,\n): WorkflowState {\n getItem(state, itemId);\n const indexes: number[] = [];\n state.accounting.forEach((a, i) => {\n if (a.item === itemId) indexes.push(i);\n });\n if (indexes.length === 0)\n fail(\n \"invalid-input\",\n `item \"${itemId}\" has no accounting line to correct`,\n `complete \"${itemId}\" first (exwf complete), then exwf account`,\n { items: [itemId] },\n );\n const n = line ?? indexes.length;\n if (!Number.isInteger(n) || n < 1 || n > indexes.length)\n fail(\n \"invalid-input\",\n `item \"${itemId}\" has ${indexes.length} accounting line(s), not line ${String(line)}`,\n `pass --line 1..${indexes.length}`,\n { items: [itemId] },\n );\n const idx = indexes[n - 1]!;\n const before = state.accounting[idx]!;\n for (const [k, flag] of NUMERIC) {\n const v = patch[k];\n if (v !== undefined && (!Number.isFinite(v) || v < 0))\n fail(\n \"accounting-invalid\",\n `${k} must be a non-negative number`,\n `pass --${flag} <n> with a measured figure`,\n { items: [itemId] },\n );\n }\n if (patch.model !== undefined && patch.model.trim() === \"\")\n fail(\n \"accounting-invalid\",\n \"model must not be empty\",\n \"pass --model with the model id that ran the work\",\n { items: [itemId] },\n );\n const { estimate: _drop, ...rest } = before;\n const after: Accounting = {\n ...rest,\n tokensIn: patch.tokensIn ?? before.tokensIn,\n tokensOut: patch.tokensOut ?? before.tokensOut,\n durationMs: patch.durationMs ?? before.durationMs,\n model: patch.model ?? before.model,\n };\n if (after.tokensIn + after.tokensOut === 0)\n fail(\n \"accounting-invalid\",\n `the correction leaves \"${itemId}\" at 0 tokens`,\n \"pass the host's usage figures with --tokens-in / --tokens-out\",\n { items: [itemId] },\n );\n const b = pick(before);\n const a = pick(after);\n const unchanged =\n b.tokensIn === a.tokensIn &&\n b.tokensOut === a.tokensOut &&\n b.durationMs === a.durationMs &&\n b.model === a.model;\n // replacing a placeholder with the same figures still settles it, so it is not a no-op\n if (unchanged && before.estimate !== true)\n fail(\n \"no-op\",\n `accounting for \"${itemId}\" line ${n} already has these figures`,\n \"pass at least one different value to exwf account\",\n { items: [itemId] },\n );\n const delta = {\n tokens: a.tokensIn + a.tokensOut - (b.tokensIn + b.tokensOut),\n durationMs: a.durationMs - b.durationMs,\n };\n const item = state.items[itemId]!;\n let owner: Iteration | undefined;\n for (const it of state.iterations) {\n // the last iteration that was open when the line was recorded and carried the item\n if (\n (it.committed.includes(itemId) || item.iteration === it.id) &&\n it.startedAt <= before.endedAt &&\n (it.endedAt === undefined || before.endedAt <= it.endedAt)\n )\n owner = it;\n }\n let s: WorkflowState = {\n ...state,\n accounting: state.accounting.map((x, i) => (i === idx ? after : x)),\n };\n if (owner)\n s = {\n ...s,\n iterations: s.iterations.map((it) =>\n it.id === owner.id\n ? {\n ...it,\n spent: {\n ...it.spent,\n tokens: Math.max(0, it.spent.tokens + delta.tokens),\n wallclockMs: Math.max(0, it.spent.wallclockMs + delta.durationMs),\n },\n }\n : it,\n ),\n };\n return appendEvent(\n s,\n \"accounting.corrected\",\n by,\n {\n item: itemId,\n line: n,\n iteration: owner?.id ?? null,\n before: b,\n after: a,\n delta,\n },\n nowOf(now),\n );\n}\n"]}
package/dist/cli/bin.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- 'use strict';var chunkKUUIAKEJ_cjs=require('../chunk-KUUIAKEJ.cjs');require('../chunk-HHC5EZ54.cjs'),require('../chunk-7KF5K3L7.cjs'),require('../chunk-UM5X2JHB.cjs'),require('../chunk-KSKEFYY7.cjs'),require('../chunk-CWBH7H52.cjs'),require('../chunk-SJRRQZ3R.cjs'),require('../chunk-RSKZVOYC.cjs'),require('../chunk-DXC2RSN5.cjs'),require('../chunk-S3BXVHO7.cjs');chunkKUUIAKEJ_cjs.c(process.argv.slice(2),process.cwd()).then(r=>{process.stdout.write(JSON.stringify(r.out,null,2)+`
2
+ 'use strict';var chunkYJN4JEJU_cjs=require('../chunk-YJN4JEJU.cjs');require('../chunk-5PHK72VM.cjs'),require('../chunk-HIHMBMB5.cjs'),require('../chunk-CYXVGHQM.cjs'),require('../chunk-FKTCGQYB.cjs'),require('../chunk-VXH2FAKV.cjs'),require('../chunk-XMO2RCXB.cjs'),require('../chunk-YRATJT7P.cjs'),require('../chunk-WOGK54HB.cjs'),require('../chunk-S3BXVHO7.cjs');chunkYJN4JEJU_cjs.c(process.argv.slice(2),process.cwd()).then(r=>{process.stdout.write(JSON.stringify(r.out,null,2)+`
3
3
  `),process.exitCode=r.exit;},r=>{process.stderr.write(`exwf crashed: ${r.stack??String(r)}
4
4
  `),process.exitCode=2;});//# sourceMappingURL=bin.cjs.map
5
5
  //# sourceMappingURL=bin.cjs.map
package/dist/cli/bin.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import {c}from'../chunk-36M6OVUJ.mjs';import'../chunk-NZ2DIDOD.mjs';import'../chunk-L2ZN6HEL.mjs';import'../chunk-GATJZYTB.mjs';import'../chunk-NDORREWR.mjs';import'../chunk-GFH2FEZH.mjs';import'../chunk-SHAPFMVP.mjs';import'../chunk-OHSQ52DW.mjs';import'../chunk-S22CPYXJ.mjs';import'../chunk-2FRRD6A3.mjs';c(process.argv.slice(2),process.cwd()).then(r=>{process.stdout.write(JSON.stringify(r.out,null,2)+`
2
+ import {c}from'../chunk-MQWMQ4PD.mjs';import'../chunk-Z2G7DGDF.mjs';import'../chunk-QDMEM62U.mjs';import'../chunk-UZQV73X7.mjs';import'../chunk-3KFQPSRX.mjs';import'../chunk-U3OXAO67.mjs';import'../chunk-YBHHICTZ.mjs';import'../chunk-7IG6EQI4.mjs';import'../chunk-5TXYMLBF.mjs';import'../chunk-2FRRD6A3.mjs';c(process.argv.slice(2),process.cwd()).then(r=>{process.stdout.write(JSON.stringify(r.out,null,2)+`
3
3
  `),process.exitCode=r.exit;},r=>{process.stderr.write(`exwf crashed: ${r.stack??String(r)}
4
4
  `),process.exitCode=2;});//# sourceMappingURL=bin.mjs.map
5
5
  //# sourceMappingURL=bin.mjs.map
@@ -1,2 +1,2 @@
1
- 'use strict';var chunkKUUIAKEJ_cjs=require('../chunk-KUUIAKEJ.cjs');require('../chunk-HHC5EZ54.cjs'),require('../chunk-7KF5K3L7.cjs'),require('../chunk-UM5X2JHB.cjs'),require('../chunk-KSKEFYY7.cjs'),require('../chunk-CWBH7H52.cjs'),require('../chunk-SJRRQZ3R.cjs'),require('../chunk-RSKZVOYC.cjs'),require('../chunk-DXC2RSN5.cjs'),require('../chunk-S3BXVHO7.cjs');Object.defineProperty(exports,"USAGE",{enumerable:true,get:function(){return chunkKUUIAKEJ_cjs.a}});Object.defineProperty(exports,"parseArgs",{enumerable:true,get:function(){return chunkKUUIAKEJ_cjs.b}});Object.defineProperty(exports,"runCommand",{enumerable:true,get:function(){return chunkKUUIAKEJ_cjs.c}});//# sourceMappingURL=index.cjs.map
1
+ 'use strict';var chunkYJN4JEJU_cjs=require('../chunk-YJN4JEJU.cjs');require('../chunk-5PHK72VM.cjs'),require('../chunk-HIHMBMB5.cjs'),require('../chunk-CYXVGHQM.cjs'),require('../chunk-FKTCGQYB.cjs'),require('../chunk-VXH2FAKV.cjs'),require('../chunk-XMO2RCXB.cjs'),require('../chunk-YRATJT7P.cjs'),require('../chunk-WOGK54HB.cjs'),require('../chunk-S3BXVHO7.cjs');Object.defineProperty(exports,"USAGE",{enumerable:true,get:function(){return chunkYJN4JEJU_cjs.a}});Object.defineProperty(exports,"parseArgs",{enumerable:true,get:function(){return chunkYJN4JEJU_cjs.b}});Object.defineProperty(exports,"runCommand",{enumerable:true,get:function(){return chunkYJN4JEJU_cjs.c}});//# sourceMappingURL=index.cjs.map
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1,2 +1,2 @@
1
- export{a as USAGE,b as parseArgs,c as runCommand}from'../chunk-36M6OVUJ.mjs';import'../chunk-NZ2DIDOD.mjs';import'../chunk-L2ZN6HEL.mjs';import'../chunk-GATJZYTB.mjs';import'../chunk-NDORREWR.mjs';import'../chunk-GFH2FEZH.mjs';import'../chunk-SHAPFMVP.mjs';import'../chunk-OHSQ52DW.mjs';import'../chunk-S22CPYXJ.mjs';import'../chunk-2FRRD6A3.mjs';//# sourceMappingURL=index.mjs.map
1
+ export{a as USAGE,b as parseArgs,c as runCommand}from'../chunk-MQWMQ4PD.mjs';import'../chunk-Z2G7DGDF.mjs';import'../chunk-QDMEM62U.mjs';import'../chunk-UZQV73X7.mjs';import'../chunk-3KFQPSRX.mjs';import'../chunk-U3OXAO67.mjs';import'../chunk-YBHHICTZ.mjs';import'../chunk-7IG6EQI4.mjs';import'../chunk-5TXYMLBF.mjs';import'../chunk-2FRRD6A3.mjs';//# sourceMappingURL=index.mjs.map
2
2
  //# sourceMappingURL=index.mjs.map
package/dist/index.cjs CHANGED
@@ -1,2 +1,2 @@
1
- 'use strict';require('./chunk-PO2SPQJP.cjs');var chunkHHC5EZ54_cjs=require('./chunk-HHC5EZ54.cjs'),chunkCWBH7H52_cjs=require('./chunk-CWBH7H52.cjs'),chunkSJRRQZ3R_cjs=require('./chunk-SJRRQZ3R.cjs'),chunkS3BXVHO7_cjs=require('./chunk-S3BXVHO7.cjs');var U="0.4.0-stage";Object.defineProperty(exports,"complete",{enumerable:true,get:function(){return chunkHHC5EZ54_cjs.c}});Object.defineProperty(exports,"next",{enumerable:true,get:function(){return chunkHHC5EZ54_cjs.b}});Object.defineProperty(exports,"synthesizeBrief",{enumerable:true,get:function(){return chunkHHC5EZ54_cjs.a}});Object.defineProperty(exports,"ZERO_SPENT",{enumerable:true,get:function(){return chunkCWBH7H52_cjs.a}});Object.defineProperty(exports,"addSpent",{enumerable:true,get:function(){return chunkCWBH7H52_cjs.b}});Object.defineProperty(exports,"assignRole",{enumerable:true,get:function(){return chunkCWBH7H52_cjs.g}});Object.defineProperty(exports,"estimateTokens",{enumerable:true,get:function(){return chunkCWBH7H52_cjs.e}});Object.defineProperty(exports,"isExhausted",{enumerable:true,get:function(){return chunkCWBH7H52_cjs.d}});Object.defineProperty(exports,"openIteration",{enumerable:true,get:function(){return chunkCWBH7H52_cjs.f}});Object.defineProperty(exports,"plan",{enumerable:true,get:function(){return chunkCWBH7H52_cjs.j}});Object.defineProperty(exports,"remaining",{enumerable:true,get:function(){return chunkCWBH7H52_cjs.c}});Object.defineProperty(exports,"resourceCapsFor",{enumerable:true,get:function(){return chunkCWBH7H52_cjs.h}});Object.defineProperty(exports,"toExNodes",{enumerable:true,get:function(){return chunkCWBH7H52_cjs.i}});Object.defineProperty(exports,"addEvidence",{enumerable:true,get:function(){return chunkSJRRQZ3R_cjs.y}});Object.defineProperty(exports,"addItem",{enumerable:true,get:function(){return chunkSJRRQZ3R_cjs.v}});Object.defineProperty(exports,"appendEvent",{enumerable:true,get:function(){return chunkSJRRQZ3R_cjs.c}});Object.defineProperty(exports,"applyAction",{enumerable:true,get:function(){return chunkSJRRQZ3R_cjs.M}});Object.defineProperty(exports,"approversFor",{enumerable:true,get:function(){return chunkSJRRQZ3R_cjs.k}});Object.defineProperty(exports,"assertPolicies",{enumerable:true,get:function(){return chunkSJRRQZ3R_cjs.E}});Object.defineProperty(exports,"authorOf",{enumerable:true,get:function(){return chunkSJRRQZ3R_cjs.G}});Object.defineProperty(exports,"canDo",{enumerable:true,get:function(){return chunkSJRRQZ3R_cjs.n}});Object.defineProperty(exports,"checkGate",{enumerable:true,get:function(){return chunkSJRRQZ3R_cjs.H}});Object.defineProperty(exports,"clearBlocker",{enumerable:true,get:function(){return chunkSJRRQZ3R_cjs.A}});Object.defineProperty(exports,"coreRulesFor",{enumerable:true,get:function(){return chunkSJRRQZ3R_cjs.K}});Object.defineProperty(exports,"createState",{enumerable:true,get:function(){return chunkSJRRQZ3R_cjs.b}});Object.defineProperty(exports,"decide",{enumerable:true,get:function(){return chunkSJRRQZ3R_cjs.J}});Object.defineProperty(exports,"editItem",{enumerable:true,get:function(){return chunkSJRRQZ3R_cjs.w}});Object.defineProperty(exports,"evaluatePolicies",{enumerable:true,get:function(){return chunkSJRRQZ3R_cjs.D}});Object.defineProperty(exports,"getItem",{enumerable:true,get:function(){return chunkSJRRQZ3R_cjs.u}});Object.defineProperty(exports,"hasCapability",{enumerable:true,get:function(){return chunkSJRRQZ3R_cjs.h}});Object.defineProperty(exports,"init",{enumerable:true,get:function(){return chunkSJRRQZ3R_cjs.N}});Object.defineProperty(exports,"isTerminalStage",{enumerable:true,get:function(){return chunkSJRRQZ3R_cjs.r}});Object.defineProperty(exports,"lastDispatchBefore",{enumerable:true,get:function(){return chunkSJRRQZ3R_cjs.F}});Object.defineProperty(exports,"lastEvent",{enumerable:true,get:function(){return chunkSJRRQZ3R_cjs.d}});Object.defineProperty(exports,"moveItem",{enumerable:true,get:function(){return chunkSJRRQZ3R_cjs.x}});Object.defineProperty(exports,"nextStageOf",{enumerable:true,get:function(){return chunkSJRRQZ3R_cjs.q}});Object.defineProperty(exports,"nowOf",{enumerable:true,get:function(){return chunkSJRRQZ3R_cjs.a}});Object.defineProperty(exports,"raiseBlocker",{enumerable:true,get:function(){return chunkSJRRQZ3R_cjs.z}});Object.defineProperty(exports,"raisePending",{enumerable:true,get:function(){return chunkSJRRQZ3R_cjs.I}});Object.defineProperty(exports,"registerRole",{enumerable:true,get:function(){return chunkSJRRQZ3R_cjs.f}});Object.defineProperty(exports,"requireCap",{enumerable:true,get:function(){return chunkSJRRQZ3R_cjs.o}});Object.defineProperty(exports,"requireCapabilities",{enumerable:true,get:function(){return chunkSJRRQZ3R_cjs.l}});Object.defineProperty(exports,"retireRole",{enumerable:true,get:function(){return chunkSJRRQZ3R_cjs.g}});Object.defineProperty(exports,"rolesWith",{enumerable:true,get:function(){return chunkSJRRQZ3R_cjs.i}});Object.defineProperty(exports,"separationLost",{enumerable:true,get:function(){return chunkSJRRQZ3R_cjs.m}});Object.defineProperty(exports,"stageOf",{enumerable:true,get:function(){return chunkSJRRQZ3R_cjs.p}});Object.defineProperty(exports,"validateAction",{enumerable:true,get:function(){return chunkSJRRQZ3R_cjs.L}});Object.defineProperty(exports,"WorkflowError",{enumerable:true,get:function(){return chunkS3BXVHO7_cjs.a}});Object.defineProperty(exports,"assertId",{enumerable:true,get:function(){return chunkS3BXVHO7_cjs.c}});Object.defineProperty(exports,"fail",{enumerable:true,get:function(){return chunkS3BXVHO7_cjs.b}});exports.VERSION=U;//# sourceMappingURL=index.cjs.map
1
+ 'use strict';require('./chunk-PO2SPQJP.cjs');var chunk5PHK72VM_cjs=require('./chunk-5PHK72VM.cjs'),chunkXMO2RCXB_cjs=require('./chunk-XMO2RCXB.cjs'),chunkS3BXVHO7_cjs=require('./chunk-S3BXVHO7.cjs');var te="1.0.0";Object.defineProperty(exports,"complete",{enumerable:true,get:function(){return chunk5PHK72VM_cjs.d}});Object.defineProperty(exports,"correctAccounting",{enumerable:true,get:function(){return chunk5PHK72VM_cjs.e}});Object.defineProperty(exports,"next",{enumerable:true,get:function(){return chunk5PHK72VM_cjs.c}});Object.defineProperty(exports,"openQuestions",{enumerable:true,get:function(){return chunk5PHK72VM_cjs.b}});Object.defineProperty(exports,"synthesizeBrief",{enumerable:true,get:function(){return chunk5PHK72VM_cjs.a}});Object.defineProperty(exports,"ZERO_SPENT",{enumerable:true,get:function(){return chunkXMO2RCXB_cjs.M}});Object.defineProperty(exports,"addEvidence",{enumerable:true,get:function(){return chunkXMO2RCXB_cjs.y}});Object.defineProperty(exports,"addItem",{enumerable:true,get:function(){return chunkXMO2RCXB_cjs.v}});Object.defineProperty(exports,"addSpent",{enumerable:true,get:function(){return chunkXMO2RCXB_cjs.N}});Object.defineProperty(exports,"appendEvent",{enumerable:true,get:function(){return chunkXMO2RCXB_cjs.c}});Object.defineProperty(exports,"applyAction",{enumerable:true,get:function(){return chunkXMO2RCXB_cjs.Y}});Object.defineProperty(exports,"applyAgreement",{enumerable:true,get:function(){return chunkXMO2RCXB_cjs.D}});Object.defineProperty(exports,"approversFor",{enumerable:true,get:function(){return chunkXMO2RCXB_cjs.k}});Object.defineProperty(exports,"assertPolicies",{enumerable:true,get:function(){return chunkXMO2RCXB_cjs.G}});Object.defineProperty(exports,"assignRole",{enumerable:true,get:function(){return chunkXMO2RCXB_cjs.S}});Object.defineProperty(exports,"authorOf",{enumerable:true,get:function(){return chunkXMO2RCXB_cjs.I}});Object.defineProperty(exports,"canDo",{enumerable:true,get:function(){return chunkXMO2RCXB_cjs.n}});Object.defineProperty(exports,"changeConfig",{enumerable:true,get:function(){return chunkXMO2RCXB_cjs._}});Object.defineProperty(exports,"checkGate",{enumerable:true,get:function(){return chunkXMO2RCXB_cjs.J}});Object.defineProperty(exports,"clearBlocker",{enumerable:true,get:function(){return chunkXMO2RCXB_cjs.A}});Object.defineProperty(exports,"coreRulesFor",{enumerable:true,get:function(){return chunkXMO2RCXB_cjs.W}});Object.defineProperty(exports,"createState",{enumerable:true,get:function(){return chunkXMO2RCXB_cjs.b}});Object.defineProperty(exports,"decide",{enumerable:true,get:function(){return chunkXMO2RCXB_cjs.L}});Object.defineProperty(exports,"editItem",{enumerable:true,get:function(){return chunkXMO2RCXB_cjs.w}});Object.defineProperty(exports,"estimateTokens",{enumerable:true,get:function(){return chunkXMO2RCXB_cjs.Q}});Object.defineProperty(exports,"evaluatePolicies",{enumerable:true,get:function(){return chunkXMO2RCXB_cjs.F}});Object.defineProperty(exports,"getItem",{enumerable:true,get:function(){return chunkXMO2RCXB_cjs.u}});Object.defineProperty(exports,"hasCapability",{enumerable:true,get:function(){return chunkXMO2RCXB_cjs.h}});Object.defineProperty(exports,"init",{enumerable:true,get:function(){return chunkXMO2RCXB_cjs.Z}});Object.defineProperty(exports,"isExhausted",{enumerable:true,get:function(){return chunkXMO2RCXB_cjs.P}});Object.defineProperty(exports,"isTerminalStage",{enumerable:true,get:function(){return chunkXMO2RCXB_cjs.r}});Object.defineProperty(exports,"lastDispatchBefore",{enumerable:true,get:function(){return chunkXMO2RCXB_cjs.H}});Object.defineProperty(exports,"lastEvent",{enumerable:true,get:function(){return chunkXMO2RCXB_cjs.d}});Object.defineProperty(exports,"moveItem",{enumerable:true,get:function(){return chunkXMO2RCXB_cjs.x}});Object.defineProperty(exports,"nextStageOf",{enumerable:true,get:function(){return chunkXMO2RCXB_cjs.q}});Object.defineProperty(exports,"nowOf",{enumerable:true,get:function(){return chunkXMO2RCXB_cjs.a}});Object.defineProperty(exports,"openIteration",{enumerable:true,get:function(){return chunkXMO2RCXB_cjs.R}});Object.defineProperty(exports,"plan",{enumerable:true,get:function(){return chunkXMO2RCXB_cjs.V}});Object.defineProperty(exports,"raiseBlocker",{enumerable:true,get:function(){return chunkXMO2RCXB_cjs.z}});Object.defineProperty(exports,"raisePending",{enumerable:true,get:function(){return chunkXMO2RCXB_cjs.K}});Object.defineProperty(exports,"registerRole",{enumerable:true,get:function(){return chunkXMO2RCXB_cjs.f}});Object.defineProperty(exports,"remaining",{enumerable:true,get:function(){return chunkXMO2RCXB_cjs.O}});Object.defineProperty(exports,"requireCap",{enumerable:true,get:function(){return chunkXMO2RCXB_cjs.o}});Object.defineProperty(exports,"requireCapabilities",{enumerable:true,get:function(){return chunkXMO2RCXB_cjs.l}});Object.defineProperty(exports,"resourceCapsFor",{enumerable:true,get:function(){return chunkXMO2RCXB_cjs.T}});Object.defineProperty(exports,"retireAgreement",{enumerable:true,get:function(){return chunkXMO2RCXB_cjs.E}});Object.defineProperty(exports,"retireRole",{enumerable:true,get:function(){return chunkXMO2RCXB_cjs.g}});Object.defineProperty(exports,"rolesWith",{enumerable:true,get:function(){return chunkXMO2RCXB_cjs.i}});Object.defineProperty(exports,"separationLost",{enumerable:true,get:function(){return chunkXMO2RCXB_cjs.m}});Object.defineProperty(exports,"stageOf",{enumerable:true,get:function(){return chunkXMO2RCXB_cjs.p}});Object.defineProperty(exports,"toExNodes",{enumerable:true,get:function(){return chunkXMO2RCXB_cjs.U}});Object.defineProperty(exports,"validateAction",{enumerable:true,get:function(){return chunkXMO2RCXB_cjs.X}});Object.defineProperty(exports,"WorkflowError",{enumerable:true,get:function(){return chunkS3BXVHO7_cjs.a}});Object.defineProperty(exports,"assertId",{enumerable:true,get:function(){return chunkS3BXVHO7_cjs.c}});Object.defineProperty(exports,"fail",{enumerable:true,get:function(){return chunkS3BXVHO7_cjs.b}});exports.VERSION=te;//# sourceMappingURL=index.cjs.map
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"names":["VERSION"],"mappings":"yPAAO,IAAMA,CAAAA,CAAU","file":"index.cjs","sourcesContent":["export const VERSION = \"0.4.0-stage\";\nexport * from \"./types.ts\";\nexport { WorkflowError, fail } from \"./errors.ts\";\nexport { createState, appendEvent, lastEvent, nowOf } from \"./state.ts\";\nexport {\n registerRole,\n retireRole,\n hasCapability,\n rolesWith,\n approversFor,\n requireCapabilities,\n separationLost,\n canDo,\n requireCap,\n} from \"./roles.ts\";\nexport {\n assertId,\n stageOf,\n nextStageOf,\n isTerminalStage,\n getItem,\n addItem,\n editItem,\n moveItem,\n addEvidence,\n raiseBlocker,\n clearBlocker,\n} from \"./items.ts\";\nexport type { ItemPatch } from \"./items.ts\";\nexport { evaluatePolicies, assertPolicies } from \"./policies.ts\";\nexport { checkGate, authorOf, lastDispatchBefore, raisePending, decide } from \"./gates.ts\";\nexport type { GateResult } from \"./gates.ts\";\nexport { ZERO_SPENT, addSpent, remaining, isExhausted, estimateTokens } from \"./budget.ts\";\nexport { plan, toExNodes, assignRole, resourceCapsFor, openIteration } from \"./planner.ts\";\nexport type { PlanOptions, PlanReason, PlanResult, Skipped } from \"./planner.ts\";\nexport { synthesizeBrief, next } from \"./brief.ts\";\nexport type { NextResult } from \"./brief.ts\";\nexport { complete } from \"./complete.ts\";\nexport { coreRulesFor } from \"./rules.ts\";\nexport { applyAction, validateAction, init } from \"./methodology.ts\";\nexport type { InitInput } from \"./methodology.ts\";\n"]}
1
+ {"version":3,"sources":["../src/index.ts"],"names":["VERSION"],"mappings":"uMAAO,IAAMA,EAAAA,CAAU","file":"index.cjs","sourcesContent":["export const VERSION = \"1.0.0\";\nexport * from \"./types.ts\";\nexport { WorkflowError, fail } from \"./errors.ts\";\nexport { createState, appendEvent, lastEvent, nowOf } from \"./state.ts\";\nexport {\n registerRole,\n retireRole,\n hasCapability,\n rolesWith,\n approversFor,\n requireCapabilities,\n separationLost,\n canDo,\n requireCap,\n} from \"./roles.ts\";\nexport {\n assertId,\n stageOf,\n nextStageOf,\n isTerminalStage,\n getItem,\n addItem,\n editItem,\n moveItem,\n addEvidence,\n raiseBlocker,\n clearBlocker,\n} from \"./items.ts\";\nexport type { ItemPatch } from \"./items.ts\";\nexport { applyAgreement, retireAgreement } from \"./agreements.ts\";\nexport { evaluatePolicies, assertPolicies } from \"./policies.ts\";\nexport { checkGate, authorOf, lastDispatchBefore, raisePending, decide } from \"./gates.ts\";\nexport type { GateResult } from \"./gates.ts\";\nexport { ZERO_SPENT, addSpent, remaining, isExhausted, estimateTokens } from \"./budget.ts\";\nexport type { EstimateMode } from \"./budget.ts\";\nexport { plan, toExNodes, assignRole, resourceCapsFor, openIteration } from \"./planner.ts\";\nexport type { PlanOptions, PlanReason, PlanResult, Skipped } from \"./planner.ts\";\nexport { synthesizeBrief, next, openQuestions } from \"./brief.ts\";\nexport type { NextResult } from \"./brief.ts\";\nexport { complete } from \"./complete.ts\";\nexport { correctAccounting } from \"./accounting.ts\";\nexport type { AccountingPatch } from \"./accounting.ts\";\nexport { coreRulesFor } from \"./rules.ts\";\nexport { applyAction, validateAction, init, changeConfig } from \"./methodology.ts\";\nexport type { InitInput } from \"./methodology.ts\";\n"]}
package/dist/index.d.cts CHANGED
@@ -1,6 +1,6 @@
1
- import { ErrorCode, WorkflowState, MethodologyName, Stage, Role, Event, Evidence, NewItem, ItemPatch, WorkItem, ItemStatus, Policy, Violation, Gate, Methodology, Transition, PendingHuman, Budget, Accounting, Iteration, Brief, Handoff, ApplyResult, Rule, Action } from './types.cjs';
2
- export { Baseline, Blocker, Capability, Ceremony, CeremonyInput, ClassOfService, CoreTerm, GateRequirement, ImpactAnalysis, ItemType, Lesson, LessonChange, ModelTier, Phase, PlannerOptions, Produced, Spent, Verdict } from './types.cjs';
3
- export { a as approversFor, c as canDo, h as hasCapability, r as registerRole, b as requireCap, d as requireCapabilities, e as retireRole, f as rolesWith, s as separationLost } from './roles-aneKYJ3Z.cjs';
1
+ import { ErrorCode, WorkflowState, MethodologyName, Stage, Role, Event, Evidence, NewItem, ItemPatch, WorkItem, ItemStatus, Policy, Violation, Gate, Methodology, Transition, PendingHuman, Iteration, Brief, Handoff, Accounting, ApplyResult, Rule, Action } from './types.cjs';
2
+ export { Baseline, Blocker, Budget, Capability, Ceremony, CeremonyInput, ClassOfService, CoreTerm, GateRequirement, ImpactAnalysis, ItemType, Lesson, LessonChange, ModelTier, Phase, PlannerOptions, Produced, Spent, Verdict } from './types.cjs';
3
+ export { E as EstimateMode, Z as ZERO_SPENT, a as addSpent, b as approversFor, c as canDo, e as estimateTokens, h as hasCapability, i as isExhausted, r as registerRole, d as remaining, f as requireCap, g as requireCapabilities, j as retireRole, k as rolesWith, s as separationLost } from './budget-JyNKxP5N.cjs';
4
4
  import { ExNode } from 'ex-flow';
5
5
 
6
6
  interface WorkflowErrorExtra {
@@ -50,7 +50,15 @@ declare function moveItem(state: WorkflowState, id: string, to: {
50
50
  }, by: string, now?: string): WorkflowState;
51
51
  declare function addEvidence(state: WorkflowState, id: string, evidence: Omit<Evidence, "at">, now?: string): WorkflowState;
52
52
  declare function raiseBlocker(state: WorkflowState, id: string, reason: string, owner: string, by: string, now?: string): WorkflowState;
53
- declare function clearBlocker(state: WorkflowState, id: string, blockerId: string, by: string, now?: string): WorkflowState;
53
+ declare function clearBlocker(state: WorkflowState, id: string, blockerId: string, by: string, now?: string, note?: string): WorkflowState;
54
+
55
+ /** Adds an agreement (idempotent); with `replaces`, retires that one in the same step. */
56
+ declare function applyAgreement(state: WorkflowState, change: {
57
+ text: string;
58
+ replaces?: string;
59
+ }, by: string, now: string): WorkflowState;
60
+ /** Removes an agreement and records why it left (replacedBy null). */
61
+ declare function retireAgreement(state: WorkflowState, text: string, by: string, now: string): WorkflowState;
54
62
 
55
63
  declare function evaluatePolicies(state: WorkflowState, item: WorkItem, policies: Policy[]): Violation[];
56
64
  declare function assertPolicies(state: WorkflowState, item: WorkItem, policies: Policy[], context: string): void;
@@ -71,12 +79,6 @@ declare function checkGate(state: WorkflowState, item: WorkItem, gate: Gate, by:
71
79
  declare function raisePending(state: WorkflowState, pending: Omit<PendingHuman, "id" | "raisedAt">, now?: string): WorkflowState;
72
80
  declare function decide(state: WorkflowState, pendingId: string, decision: "approve" | "reject", by: string, note: string, now?: string, methodology?: Methodology): WorkflowState;
73
81
 
74
- declare const ZERO_SPENT: Required<Budget>;
75
- declare function addSpent(spent: Required<Budget>, acc: Accounting): Required<Budget>;
76
- declare function remaining(budget: Budget, spent: Required<Budget>): Budget;
77
- declare function isExhausted(budget: Budget, spent: Required<Budget>): boolean;
78
- declare function estimateTokens(state: WorkflowState, weight: number | undefined, fallbackPerWeight?: number): number;
79
-
80
82
  type NodeData = {
81
83
  id: string;
82
84
  };
@@ -105,6 +107,13 @@ interface PlanResult {
105
107
  declare function plan(state: WorkflowState, methodology: Methodology, opts?: PlanOptions): PlanResult;
106
108
 
107
109
  declare function synthesizeBrief(state: WorkflowState, methodology: Methodology, item: WorkItem): Brief;
110
+ /** Open questions of finished items: the last completion per item, verdict done/needs-review, with open_questions left unanswered. */
111
+ declare function openQuestions(state: WorkflowState): Array<{
112
+ item: string;
113
+ role: string;
114
+ questions: string[];
115
+ at: string;
116
+ }>;
108
117
  interface NextResult {
109
118
  state: WorkflowState;
110
119
  briefs: Brief[];
@@ -115,6 +124,18 @@ declare function next(state: WorkflowState, methodology: Methodology, opts?: Pla
115
124
 
116
125
  declare function complete(state: WorkflowState, methodology: Methodology, handoff: Handoff, acc: Accounting, now?: string): ApplyResult;
117
126
 
127
+ interface AccountingPatch {
128
+ tokensIn?: number;
129
+ tokensOut?: number;
130
+ durationMs?: number;
131
+ model?: string;
132
+ }
133
+ /**
134
+ * Rewrite one accounting line of an item (`line` is 1-based among the item's lines, default the last).
135
+ * The owning iteration's spent follows the delta, open or closed; the event records before/after.
136
+ */
137
+ declare function correctAccounting(state: WorkflowState, itemId: string, patch: AccountingPatch, by: string, now?: string, line?: number): WorkflowState;
138
+
118
139
  declare function coreRulesFor(methodology: Pick<Methodology, "requiredCapabilities">): Rule[];
119
140
 
120
141
  declare function validateAction(state: WorkflowState, methodology: Methodology, action: Action): Violation[];
@@ -128,7 +149,9 @@ interface InitInput<C> {
128
149
  now?: string;
129
150
  }
130
151
  declare function init<C>(input: InitInput<C>): ApplyResult;
152
+ /** Change the config between iterations: re-validated, recorded as config.changed, derived state kept in step by the methodology hook. */
153
+ declare function changeConfig(state: WorkflowState, methodology: Methodology, patch: Record<string, unknown>, by: string, now?: string): ApplyResult;
131
154
 
132
- declare const VERSION = "0.4.0-stage";
155
+ declare const VERSION = "1.0.0";
133
156
 
134
- export { Accounting, Action, ApplyResult, Brief, Budget, ErrorCode, Event, Evidence, Gate, type GateResult, Handoff, type InitInput, ItemPatch, ItemStatus, Iteration, Methodology, MethodologyName, NewItem, type NextResult, PendingHuman, type PlanOptions, type PlanReason, type PlanResult, Policy, Role, Rule, type Skipped, Stage, Transition, VERSION, Violation, WorkItem, WorkflowError, WorkflowState, ZERO_SPENT, addEvidence, addItem, addSpent, appendEvent, applyAction, assertId, assertPolicies, assignRole, authorOf, checkGate, clearBlocker, complete, coreRulesFor, createState, decide, editItem, estimateTokens, evaluatePolicies, fail, getItem, init, isExhausted, isTerminalStage, lastDispatchBefore, lastEvent, moveItem, next, nextStageOf, nowOf, openIteration, plan, raiseBlocker, raisePending, remaining, resourceCapsFor, stageOf, synthesizeBrief, toExNodes, validateAction };
157
+ export { Accounting, type AccountingPatch, Action, ApplyResult, Brief, ErrorCode, Event, Evidence, Gate, type GateResult, Handoff, type InitInput, ItemPatch, ItemStatus, Iteration, Methodology, MethodologyName, NewItem, type NextResult, PendingHuman, type PlanOptions, type PlanReason, type PlanResult, Policy, Role, Rule, type Skipped, Stage, Transition, VERSION, Violation, WorkItem, WorkflowError, WorkflowState, addEvidence, addItem, appendEvent, applyAction, applyAgreement, assertId, assertPolicies, assignRole, authorOf, changeConfig, checkGate, clearBlocker, complete, coreRulesFor, correctAccounting, createState, decide, editItem, evaluatePolicies, fail, getItem, init, isTerminalStage, lastDispatchBefore, lastEvent, moveItem, next, nextStageOf, nowOf, openIteration, openQuestions, plan, raiseBlocker, raisePending, resourceCapsFor, retireAgreement, stageOf, synthesizeBrief, toExNodes, validateAction };
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- import { ErrorCode, WorkflowState, MethodologyName, Stage, Role, Event, Evidence, NewItem, ItemPatch, WorkItem, ItemStatus, Policy, Violation, Gate, Methodology, Transition, PendingHuman, Budget, Accounting, Iteration, Brief, Handoff, ApplyResult, Rule, Action } from './types.js';
2
- export { Baseline, Blocker, Capability, Ceremony, CeremonyInput, ClassOfService, CoreTerm, GateRequirement, ImpactAnalysis, ItemType, Lesson, LessonChange, ModelTier, Phase, PlannerOptions, Produced, Spent, Verdict } from './types.js';
3
- export { a as approversFor, c as canDo, h as hasCapability, r as registerRole, b as requireCap, d as requireCapabilities, e as retireRole, f as rolesWith, s as separationLost } from './roles-BLBRKhUZ.js';
1
+ import { ErrorCode, WorkflowState, MethodologyName, Stage, Role, Event, Evidence, NewItem, ItemPatch, WorkItem, ItemStatus, Policy, Violation, Gate, Methodology, Transition, PendingHuman, Iteration, Brief, Handoff, Accounting, ApplyResult, Rule, Action } from './types.js';
2
+ export { Baseline, Blocker, Budget, Capability, Ceremony, CeremonyInput, ClassOfService, CoreTerm, GateRequirement, ImpactAnalysis, ItemType, Lesson, LessonChange, ModelTier, Phase, PlannerOptions, Produced, Spent, Verdict } from './types.js';
3
+ export { E as EstimateMode, Z as ZERO_SPENT, a as addSpent, b as approversFor, c as canDo, e as estimateTokens, h as hasCapability, i as isExhausted, r as registerRole, d as remaining, f as requireCap, g as requireCapabilities, j as retireRole, k as rolesWith, s as separationLost } from './budget-Cx63FX2K.js';
4
4
  import { ExNode } from 'ex-flow';
5
5
 
6
6
  interface WorkflowErrorExtra {
@@ -50,7 +50,15 @@ declare function moveItem(state: WorkflowState, id: string, to: {
50
50
  }, by: string, now?: string): WorkflowState;
51
51
  declare function addEvidence(state: WorkflowState, id: string, evidence: Omit<Evidence, "at">, now?: string): WorkflowState;
52
52
  declare function raiseBlocker(state: WorkflowState, id: string, reason: string, owner: string, by: string, now?: string): WorkflowState;
53
- declare function clearBlocker(state: WorkflowState, id: string, blockerId: string, by: string, now?: string): WorkflowState;
53
+ declare function clearBlocker(state: WorkflowState, id: string, blockerId: string, by: string, now?: string, note?: string): WorkflowState;
54
+
55
+ /** Adds an agreement (idempotent); with `replaces`, retires that one in the same step. */
56
+ declare function applyAgreement(state: WorkflowState, change: {
57
+ text: string;
58
+ replaces?: string;
59
+ }, by: string, now: string): WorkflowState;
60
+ /** Removes an agreement and records why it left (replacedBy null). */
61
+ declare function retireAgreement(state: WorkflowState, text: string, by: string, now: string): WorkflowState;
54
62
 
55
63
  declare function evaluatePolicies(state: WorkflowState, item: WorkItem, policies: Policy[]): Violation[];
56
64
  declare function assertPolicies(state: WorkflowState, item: WorkItem, policies: Policy[], context: string): void;
@@ -71,12 +79,6 @@ declare function checkGate(state: WorkflowState, item: WorkItem, gate: Gate, by:
71
79
  declare function raisePending(state: WorkflowState, pending: Omit<PendingHuman, "id" | "raisedAt">, now?: string): WorkflowState;
72
80
  declare function decide(state: WorkflowState, pendingId: string, decision: "approve" | "reject", by: string, note: string, now?: string, methodology?: Methodology): WorkflowState;
73
81
 
74
- declare const ZERO_SPENT: Required<Budget>;
75
- declare function addSpent(spent: Required<Budget>, acc: Accounting): Required<Budget>;
76
- declare function remaining(budget: Budget, spent: Required<Budget>): Budget;
77
- declare function isExhausted(budget: Budget, spent: Required<Budget>): boolean;
78
- declare function estimateTokens(state: WorkflowState, weight: number | undefined, fallbackPerWeight?: number): number;
79
-
80
82
  type NodeData = {
81
83
  id: string;
82
84
  };
@@ -105,6 +107,13 @@ interface PlanResult {
105
107
  declare function plan(state: WorkflowState, methodology: Methodology, opts?: PlanOptions): PlanResult;
106
108
 
107
109
  declare function synthesizeBrief(state: WorkflowState, methodology: Methodology, item: WorkItem): Brief;
110
+ /** Open questions of finished items: the last completion per item, verdict done/needs-review, with open_questions left unanswered. */
111
+ declare function openQuestions(state: WorkflowState): Array<{
112
+ item: string;
113
+ role: string;
114
+ questions: string[];
115
+ at: string;
116
+ }>;
108
117
  interface NextResult {
109
118
  state: WorkflowState;
110
119
  briefs: Brief[];
@@ -115,6 +124,18 @@ declare function next(state: WorkflowState, methodology: Methodology, opts?: Pla
115
124
 
116
125
  declare function complete(state: WorkflowState, methodology: Methodology, handoff: Handoff, acc: Accounting, now?: string): ApplyResult;
117
126
 
127
+ interface AccountingPatch {
128
+ tokensIn?: number;
129
+ tokensOut?: number;
130
+ durationMs?: number;
131
+ model?: string;
132
+ }
133
+ /**
134
+ * Rewrite one accounting line of an item (`line` is 1-based among the item's lines, default the last).
135
+ * The owning iteration's spent follows the delta, open or closed; the event records before/after.
136
+ */
137
+ declare function correctAccounting(state: WorkflowState, itemId: string, patch: AccountingPatch, by: string, now?: string, line?: number): WorkflowState;
138
+
118
139
  declare function coreRulesFor(methodology: Pick<Methodology, "requiredCapabilities">): Rule[];
119
140
 
120
141
  declare function validateAction(state: WorkflowState, methodology: Methodology, action: Action): Violation[];
@@ -128,7 +149,9 @@ interface InitInput<C> {
128
149
  now?: string;
129
150
  }
130
151
  declare function init<C>(input: InitInput<C>): ApplyResult;
152
+ /** Change the config between iterations: re-validated, recorded as config.changed, derived state kept in step by the methodology hook. */
153
+ declare function changeConfig(state: WorkflowState, methodology: Methodology, patch: Record<string, unknown>, by: string, now?: string): ApplyResult;
131
154
 
132
- declare const VERSION = "0.4.0-stage";
155
+ declare const VERSION = "1.0.0";
133
156
 
134
- export { Accounting, Action, ApplyResult, Brief, Budget, ErrorCode, Event, Evidence, Gate, type GateResult, Handoff, type InitInput, ItemPatch, ItemStatus, Iteration, Methodology, MethodologyName, NewItem, type NextResult, PendingHuman, type PlanOptions, type PlanReason, type PlanResult, Policy, Role, Rule, type Skipped, Stage, Transition, VERSION, Violation, WorkItem, WorkflowError, WorkflowState, ZERO_SPENT, addEvidence, addItem, addSpent, appendEvent, applyAction, assertId, assertPolicies, assignRole, authorOf, checkGate, clearBlocker, complete, coreRulesFor, createState, decide, editItem, estimateTokens, evaluatePolicies, fail, getItem, init, isExhausted, isTerminalStage, lastDispatchBefore, lastEvent, moveItem, next, nextStageOf, nowOf, openIteration, plan, raiseBlocker, raisePending, remaining, resourceCapsFor, stageOf, synthesizeBrief, toExNodes, validateAction };
157
+ export { Accounting, type AccountingPatch, Action, ApplyResult, Brief, ErrorCode, Event, Evidence, Gate, type GateResult, Handoff, type InitInput, ItemPatch, ItemStatus, Iteration, Methodology, MethodologyName, NewItem, type NextResult, PendingHuman, type PlanOptions, type PlanReason, type PlanResult, Policy, Role, Rule, type Skipped, Stage, Transition, VERSION, Violation, WorkItem, WorkflowError, WorkflowState, addEvidence, addItem, appendEvent, applyAction, applyAgreement, assertId, assertPolicies, assignRole, authorOf, changeConfig, checkGate, clearBlocker, complete, coreRulesFor, correctAccounting, createState, decide, editItem, evaluatePolicies, fail, getItem, init, isTerminalStage, lastDispatchBefore, lastEvent, moveItem, next, nextStageOf, nowOf, openIteration, openQuestions, plan, raiseBlocker, raisePending, resourceCapsFor, retireAgreement, stageOf, synthesizeBrief, toExNodes, validateAction };
package/dist/index.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import'./chunk-KIQOUUEZ.mjs';export{c as complete,b as next,a as synthesizeBrief}from'./chunk-NZ2DIDOD.mjs';export{a as ZERO_SPENT,b as addSpent,g as assignRole,e as estimateTokens,d as isExhausted,f as openIteration,j as plan,c as remaining,h as resourceCapsFor,i as toExNodes}from'./chunk-GFH2FEZH.mjs';export{y as addEvidence,v as addItem,c as appendEvent,M as applyAction,k as approversFor,E as assertPolicies,G as authorOf,n as canDo,H as checkGate,A as clearBlocker,K as coreRulesFor,b as createState,J as decide,w as editItem,D as evaluatePolicies,u as getItem,h as hasCapability,N as init,r as isTerminalStage,F as lastDispatchBefore,d as lastEvent,x as moveItem,q as nextStageOf,a as nowOf,z as raiseBlocker,I as raisePending,f as registerRole,o as requireCap,l as requireCapabilities,g as retireRole,i as rolesWith,m as separationLost,p as stageOf,L as validateAction}from'./chunk-SHAPFMVP.mjs';export{a as WorkflowError,c as assertId,b as fail}from'./chunk-2FRRD6A3.mjs';var U="0.4.0-stage";export{U as VERSION};//# sourceMappingURL=index.mjs.map
1
+ import'./chunk-KIQOUUEZ.mjs';export{d as complete,e as correctAccounting,c as next,b as openQuestions,a as synthesizeBrief}from'./chunk-Z2G7DGDF.mjs';export{M as ZERO_SPENT,y as addEvidence,v as addItem,N as addSpent,c as appendEvent,Y as applyAction,D as applyAgreement,k as approversFor,G as assertPolicies,S as assignRole,I as authorOf,n as canDo,_ as changeConfig,J as checkGate,A as clearBlocker,W as coreRulesFor,b as createState,L as decide,w as editItem,Q as estimateTokens,F as evaluatePolicies,u as getItem,h as hasCapability,Z as init,P as isExhausted,r as isTerminalStage,H as lastDispatchBefore,d as lastEvent,x as moveItem,q as nextStageOf,a as nowOf,R as openIteration,V as plan,z as raiseBlocker,K as raisePending,f as registerRole,O as remaining,o as requireCap,l as requireCapabilities,T as resourceCapsFor,E as retireAgreement,g as retireRole,i as rolesWith,m as separationLost,p as stageOf,U as toExNodes,X as validateAction}from'./chunk-YBHHICTZ.mjs';export{a as WorkflowError,c as assertId,b as fail}from'./chunk-2FRRD6A3.mjs';var te="1.0.0";export{te as VERSION};//# sourceMappingURL=index.mjs.map
2
2
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"names":["VERSION"],"mappings":"s9BAAO,IAAMA,CAAAA,CAAU","file":"index.mjs","sourcesContent":["export const VERSION = \"0.4.0-stage\";\nexport * from \"./types.ts\";\nexport { WorkflowError, fail } from \"./errors.ts\";\nexport { createState, appendEvent, lastEvent, nowOf } from \"./state.ts\";\nexport {\n registerRole,\n retireRole,\n hasCapability,\n rolesWith,\n approversFor,\n requireCapabilities,\n separationLost,\n canDo,\n requireCap,\n} from \"./roles.ts\";\nexport {\n assertId,\n stageOf,\n nextStageOf,\n isTerminalStage,\n getItem,\n addItem,\n editItem,\n moveItem,\n addEvidence,\n raiseBlocker,\n clearBlocker,\n} from \"./items.ts\";\nexport type { ItemPatch } from \"./items.ts\";\nexport { evaluatePolicies, assertPolicies } from \"./policies.ts\";\nexport { checkGate, authorOf, lastDispatchBefore, raisePending, decide } from \"./gates.ts\";\nexport type { GateResult } from \"./gates.ts\";\nexport { ZERO_SPENT, addSpent, remaining, isExhausted, estimateTokens } from \"./budget.ts\";\nexport { plan, toExNodes, assignRole, resourceCapsFor, openIteration } from \"./planner.ts\";\nexport type { PlanOptions, PlanReason, PlanResult, Skipped } from \"./planner.ts\";\nexport { synthesizeBrief, next } from \"./brief.ts\";\nexport type { NextResult } from \"./brief.ts\";\nexport { complete } from \"./complete.ts\";\nexport { coreRulesFor } from \"./rules.ts\";\nexport { applyAction, validateAction, init } from \"./methodology.ts\";\nexport type { InitInput } from \"./methodology.ts\";\n"]}
1
+ {"version":3,"sources":["../src/index.ts"],"names":["VERSION"],"mappings":"yhCAAO,IAAMA,EAAAA,CAAU","file":"index.mjs","sourcesContent":["export const VERSION = \"1.0.0\";\nexport * from \"./types.ts\";\nexport { WorkflowError, fail } from \"./errors.ts\";\nexport { createState, appendEvent, lastEvent, nowOf } from \"./state.ts\";\nexport {\n registerRole,\n retireRole,\n hasCapability,\n rolesWith,\n approversFor,\n requireCapabilities,\n separationLost,\n canDo,\n requireCap,\n} from \"./roles.ts\";\nexport {\n assertId,\n stageOf,\n nextStageOf,\n isTerminalStage,\n getItem,\n addItem,\n editItem,\n moveItem,\n addEvidence,\n raiseBlocker,\n clearBlocker,\n} from \"./items.ts\";\nexport type { ItemPatch } from \"./items.ts\";\nexport { applyAgreement, retireAgreement } from \"./agreements.ts\";\nexport { evaluatePolicies, assertPolicies } from \"./policies.ts\";\nexport { checkGate, authorOf, lastDispatchBefore, raisePending, decide } from \"./gates.ts\";\nexport type { GateResult } from \"./gates.ts\";\nexport { ZERO_SPENT, addSpent, remaining, isExhausted, estimateTokens } from \"./budget.ts\";\nexport type { EstimateMode } from \"./budget.ts\";\nexport { plan, toExNodes, assignRole, resourceCapsFor, openIteration } from \"./planner.ts\";\nexport type { PlanOptions, PlanReason, PlanResult, Skipped } from \"./planner.ts\";\nexport { synthesizeBrief, next, openQuestions } from \"./brief.ts\";\nexport type { NextResult } from \"./brief.ts\";\nexport { complete } from \"./complete.ts\";\nexport { correctAccounting } from \"./accounting.ts\";\nexport type { AccountingPatch } from \"./accounting.ts\";\nexport { coreRulesFor } from \"./rules.ts\";\nexport { applyAction, validateAction, init, changeConfig } from \"./methodology.ts\";\nexport type { InitInput } from \"./methodology.ts\";\n"]}
@@ -1,2 +1,2 @@
1
- 'use strict';var chunkUM5X2JHB_cjs=require('../chunk-UM5X2JHB.cjs');require('../chunk-SJRRQZ3R.cjs'),require('../chunk-S3BXVHO7.cjs');Object.defineProperty(exports,"ACTIVE",{enumerable:true,get:function(){return chunkUM5X2JHB_cjs.a}});Object.defineProperty(exports,"CADENCE_EVENT",{enumerable:true,get:function(){return chunkUM5X2JHB_cjs.s}});Object.defineProperty(exports,"CLASSES",{enumerable:true,get:function(){return chunkUM5X2JHB_cjs.k}});Object.defineProperty(exports,"DAY_MS",{enumerable:true,get:function(){return chunkUM5X2JHB_cjs.l}});Object.defineProperty(exports,"DEFAULT_COLUMNS",{enumerable:true,get:function(){return chunkUM5X2JHB_cjs.n}});Object.defineProperty(exports,"KANBAN_CADENCES",{enumerable:true,get:function(){return chunkUM5X2JHB_cjs.j}});Object.defineProperty(exports,"KANBAN_VOCABULARY",{enumerable:true,get:function(){return chunkUM5X2JHB_cjs.F}});Object.defineProperty(exports,"OPEN",{enumerable:true,get:function(){return chunkUM5X2JHB_cjs.b}});Object.defineProperty(exports,"activeExpedites",{enumerable:true,get:function(){return chunkUM5X2JHB_cjs.h}});Object.defineProperty(exports,"addedAt",{enumerable:true,get:function(){return chunkUM5X2JHB_cjs.p}});Object.defineProperty(exports,"board",{enumerable:true,get:function(){return chunkUM5X2JHB_cjs.r}});Object.defineProperty(exports,"byClassThenAge",{enumerable:true,get:function(){return chunkUM5X2JHB_cjs.H}});Object.defineProperty(exports,"cadencesDue",{enumerable:true,get:function(){return chunkUM5X2JHB_cjs.t}});Object.defineProperty(exports,"cardAge",{enumerable:true,get:function(){return chunkUM5X2JHB_cjs.q}});Object.defineProperty(exports,"columnIndex",{enumerable:true,get:function(){return chunkUM5X2JHB_cjs.f}});Object.defineProperty(exports,"columnStays",{enumerable:true,get:function(){return chunkUM5X2JHB_cjs.w}});Object.defineProperty(exports,"commitmentColumn",{enumerable:true,get:function(){return chunkUM5X2JHB_cjs.d}});Object.defineProperty(exports,"configOf",{enumerable:true,get:function(){return chunkUM5X2JHB_cjs.m}});Object.defineProperty(exports,"deliveryColumn",{enumerable:true,get:function(){return chunkUM5X2JHB_cjs.e}});Object.defineProperty(exports,"enteredStageAt",{enumerable:true,get:function(){return chunkUM5X2JHB_cjs.i}});Object.defineProperty(exports,"kanban",{enumerable:true,get:function(){return chunkUM5X2JHB_cjs.I}});Object.defineProperty(exports,"kanbanCeremonies",{enumerable:true,get:function(){return chunkUM5X2JHB_cjs.B}});Object.defineProperty(exports,"kanbanMetrics",{enumerable:true,get:function(){return chunkUM5X2JHB_cjs.x}});Object.defineProperty(exports,"kanbanRoles",{enumerable:true,get:function(){return chunkUM5X2JHB_cjs.C}});Object.defineProperty(exports,"kanbanRules",{enumerable:true,get:function(){return chunkUM5X2JHB_cjs.D}});Object.defineProperty(exports,"kanbanStages",{enumerable:true,get:function(){return chunkUM5X2JHB_cjs.E}});Object.defineProperty(exports,"onBoard",{enumerable:true,get:function(){return chunkUM5X2JHB_cjs.g}});Object.defineProperty(exports,"opsReport",{enumerable:true,get:function(){return chunkUM5X2JHB_cjs.y}});Object.defineProperty(exports,"optionsColumn",{enumerable:true,get:function(){return chunkUM5X2JHB_cjs.c}});Object.defineProperty(exports,"percentile",{enumerable:true,get:function(){return chunkUM5X2JHB_cjs.v}});Object.defineProperty(exports,"priorityByClass",{enumerable:true,get:function(){return chunkUM5X2JHB_cjs.G}});Object.defineProperty(exports,"replay",{enumerable:true,get:function(){return chunkUM5X2JHB_cjs.u}});Object.defineProperty(exports,"riskReport",{enumerable:true,get:function(){return chunkUM5X2JHB_cjs.z}});Object.defineProperty(exports,"validateKanbanConfig",{enumerable:true,get:function(){return chunkUM5X2JHB_cjs.o}});Object.defineProperty(exports,"wantItems",{enumerable:true,get:function(){return chunkUM5X2JHB_cjs.A}});//# sourceMappingURL=index.cjs.map
1
+ 'use strict';var chunkCYXVGHQM_cjs=require('../chunk-CYXVGHQM.cjs');require('../chunk-VXH2FAKV.cjs'),require('../chunk-XMO2RCXB.cjs'),require('../chunk-S3BXVHO7.cjs');Object.defineProperty(exports,"ACTIVE",{enumerable:true,get:function(){return chunkCYXVGHQM_cjs.a}});Object.defineProperty(exports,"CADENCE_EVENT",{enumerable:true,get:function(){return chunkCYXVGHQM_cjs.s}});Object.defineProperty(exports,"CLASSES",{enumerable:true,get:function(){return chunkCYXVGHQM_cjs.k}});Object.defineProperty(exports,"DAY_MS",{enumerable:true,get:function(){return chunkCYXVGHQM_cjs.l}});Object.defineProperty(exports,"DEFAULT_COLUMNS",{enumerable:true,get:function(){return chunkCYXVGHQM_cjs.n}});Object.defineProperty(exports,"KANBAN_CADENCES",{enumerable:true,get:function(){return chunkCYXVGHQM_cjs.j}});Object.defineProperty(exports,"KANBAN_VOCABULARY",{enumerable:true,get:function(){return chunkCYXVGHQM_cjs.F}});Object.defineProperty(exports,"OPEN",{enumerable:true,get:function(){return chunkCYXVGHQM_cjs.b}});Object.defineProperty(exports,"activeExpedites",{enumerable:true,get:function(){return chunkCYXVGHQM_cjs.h}});Object.defineProperty(exports,"addedAt",{enumerable:true,get:function(){return chunkCYXVGHQM_cjs.p}});Object.defineProperty(exports,"board",{enumerable:true,get:function(){return chunkCYXVGHQM_cjs.r}});Object.defineProperty(exports,"byClassThenAge",{enumerable:true,get:function(){return chunkCYXVGHQM_cjs.H}});Object.defineProperty(exports,"cadencesDue",{enumerable:true,get:function(){return chunkCYXVGHQM_cjs.t}});Object.defineProperty(exports,"cardAge",{enumerable:true,get:function(){return chunkCYXVGHQM_cjs.q}});Object.defineProperty(exports,"columnIndex",{enumerable:true,get:function(){return chunkCYXVGHQM_cjs.f}});Object.defineProperty(exports,"columnStays",{enumerable:true,get:function(){return chunkCYXVGHQM_cjs.w}});Object.defineProperty(exports,"commitmentColumn",{enumerable:true,get:function(){return chunkCYXVGHQM_cjs.d}});Object.defineProperty(exports,"configOf",{enumerable:true,get:function(){return chunkCYXVGHQM_cjs.m}});Object.defineProperty(exports,"deliveryColumn",{enumerable:true,get:function(){return chunkCYXVGHQM_cjs.e}});Object.defineProperty(exports,"enteredStageAt",{enumerable:true,get:function(){return chunkCYXVGHQM_cjs.i}});Object.defineProperty(exports,"kanban",{enumerable:true,get:function(){return chunkCYXVGHQM_cjs.I}});Object.defineProperty(exports,"kanbanCeremonies",{enumerable:true,get:function(){return chunkCYXVGHQM_cjs.B}});Object.defineProperty(exports,"kanbanMetrics",{enumerable:true,get:function(){return chunkCYXVGHQM_cjs.x}});Object.defineProperty(exports,"kanbanRoles",{enumerable:true,get:function(){return chunkCYXVGHQM_cjs.C}});Object.defineProperty(exports,"kanbanRules",{enumerable:true,get:function(){return chunkCYXVGHQM_cjs.D}});Object.defineProperty(exports,"kanbanStages",{enumerable:true,get:function(){return chunkCYXVGHQM_cjs.E}});Object.defineProperty(exports,"onBoard",{enumerable:true,get:function(){return chunkCYXVGHQM_cjs.g}});Object.defineProperty(exports,"opsReport",{enumerable:true,get:function(){return chunkCYXVGHQM_cjs.y}});Object.defineProperty(exports,"optionsColumn",{enumerable:true,get:function(){return chunkCYXVGHQM_cjs.c}});Object.defineProperty(exports,"percentile",{enumerable:true,get:function(){return chunkCYXVGHQM_cjs.v}});Object.defineProperty(exports,"priorityByClass",{enumerable:true,get:function(){return chunkCYXVGHQM_cjs.G}});Object.defineProperty(exports,"replay",{enumerable:true,get:function(){return chunkCYXVGHQM_cjs.u}});Object.defineProperty(exports,"riskReport",{enumerable:true,get:function(){return chunkCYXVGHQM_cjs.z}});Object.defineProperty(exports,"validateKanbanConfig",{enumerable:true,get:function(){return chunkCYXVGHQM_cjs.o}});Object.defineProperty(exports,"wantItems",{enumerable:true,get:function(){return chunkCYXVGHQM_cjs.A}});//# sourceMappingURL=index.cjs.map
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1,2 +1,2 @@
1
- export{a as ACTIVE,s as CADENCE_EVENT,k as CLASSES,l as DAY_MS,n as DEFAULT_COLUMNS,j as KANBAN_CADENCES,F as KANBAN_VOCABULARY,b as OPEN,h as activeExpedites,p as addedAt,r as board,H as byClassThenAge,t as cadencesDue,q as cardAge,f as columnIndex,w as columnStays,d as commitmentColumn,m as configOf,e as deliveryColumn,i as enteredStageAt,I as kanban,B as kanbanCeremonies,x as kanbanMetrics,C as kanbanRoles,D as kanbanRules,E as kanbanStages,g as onBoard,y as opsReport,c as optionsColumn,v as percentile,G as priorityByClass,u as replay,z as riskReport,o as validateKanbanConfig,A as wantItems}from'../chunk-GATJZYTB.mjs';import'../chunk-SHAPFMVP.mjs';import'../chunk-2FRRD6A3.mjs';//# sourceMappingURL=index.mjs.map
1
+ export{a as ACTIVE,s as CADENCE_EVENT,k as CLASSES,l as DAY_MS,n as DEFAULT_COLUMNS,j as KANBAN_CADENCES,F as KANBAN_VOCABULARY,b as OPEN,h as activeExpedites,p as addedAt,r as board,H as byClassThenAge,t as cadencesDue,q as cardAge,f as columnIndex,w as columnStays,d as commitmentColumn,m as configOf,e as deliveryColumn,i as enteredStageAt,I as kanban,B as kanbanCeremonies,x as kanbanMetrics,C as kanbanRoles,D as kanbanRules,E as kanbanStages,g as onBoard,y as opsReport,c as optionsColumn,v as percentile,G as priorityByClass,u as replay,z as riskReport,o as validateKanbanConfig,A as wantItems}from'../chunk-UZQV73X7.mjs';import'../chunk-U3OXAO67.mjs';import'../chunk-YBHHICTZ.mjs';import'../chunk-2FRRD6A3.mjs';//# sourceMappingURL=index.mjs.map
2
2
  //# sourceMappingURL=index.mjs.map
@@ -1,2 +1,2 @@
1
- 'use strict';var chunkDXC2RSN5_cjs=require('../chunk-DXC2RSN5.cjs');require('../chunk-S3BXVHO7.cjs');Object.defineProperty(exports,"DRAFT_07",{enumerable:true,get:function(){return chunkDXC2RSN5_cjs.c}});Object.defineProperty(exports,"assertValid",{enumerable:true,get:function(){return chunkDXC2RSN5_cjs.b}});Object.defineProperty(exports,"handoffSchema",{enumerable:true,get:function(){return chunkDXC2RSN5_cjs.h}});Object.defineProperty(exports,"itemPatchSchema",{enumerable:true,get:function(){return chunkDXC2RSN5_cjs.g}});Object.defineProperty(exports,"kanbanConfigSchema",{enumerable:true,get:function(){return chunkDXC2RSN5_cjs.j}});Object.defineProperty(exports,"newItemSchema",{enumerable:true,get:function(){return chunkDXC2RSN5_cjs.f}});Object.defineProperty(exports,"roleSchema",{enumerable:true,get:function(){return chunkDXC2RSN5_cjs.e}});Object.defineProperty(exports,"scrumConfigSchema",{enumerable:true,get:function(){return chunkDXC2RSN5_cjs.i}});Object.defineProperty(exports,"validate",{enumerable:true,get:function(){return chunkDXC2RSN5_cjs.a}});Object.defineProperty(exports,"waterfallConfigSchema",{enumerable:true,get:function(){return chunkDXC2RSN5_cjs.k}});Object.defineProperty(exports,"workflowStateSchema",{enumerable:true,get:function(){return chunkDXC2RSN5_cjs.d}});//# sourceMappingURL=index.cjs.map
1
+ 'use strict';var chunkWOGK54HB_cjs=require('../chunk-WOGK54HB.cjs');require('../chunk-S3BXVHO7.cjs');Object.defineProperty(exports,"DRAFT_07",{enumerable:true,get:function(){return chunkWOGK54HB_cjs.c}});Object.defineProperty(exports,"assertValid",{enumerable:true,get:function(){return chunkWOGK54HB_cjs.b}});Object.defineProperty(exports,"handoffSchema",{enumerable:true,get:function(){return chunkWOGK54HB_cjs.h}});Object.defineProperty(exports,"itemPatchSchema",{enumerable:true,get:function(){return chunkWOGK54HB_cjs.g}});Object.defineProperty(exports,"kanbanConfigSchema",{enumerable:true,get:function(){return chunkWOGK54HB_cjs.j}});Object.defineProperty(exports,"newItemSchema",{enumerable:true,get:function(){return chunkWOGK54HB_cjs.f}});Object.defineProperty(exports,"roleSchema",{enumerable:true,get:function(){return chunkWOGK54HB_cjs.e}});Object.defineProperty(exports,"scrumConfigSchema",{enumerable:true,get:function(){return chunkWOGK54HB_cjs.i}});Object.defineProperty(exports,"validate",{enumerable:true,get:function(){return chunkWOGK54HB_cjs.a}});Object.defineProperty(exports,"waterfallConfigSchema",{enumerable:true,get:function(){return chunkWOGK54HB_cjs.k}});Object.defineProperty(exports,"workflowStateSchema",{enumerable:true,get:function(){return chunkWOGK54HB_cjs.d}});//# sourceMappingURL=index.cjs.map
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1,2 +1,2 @@
1
- export{c as DRAFT_07,b as assertValid,h as handoffSchema,g as itemPatchSchema,j as kanbanConfigSchema,f as newItemSchema,e as roleSchema,i as scrumConfigSchema,a as validate,k as waterfallConfigSchema,d as workflowStateSchema}from'../chunk-S22CPYXJ.mjs';import'../chunk-2FRRD6A3.mjs';//# sourceMappingURL=index.mjs.map
1
+ export{c as DRAFT_07,b as assertValid,h as handoffSchema,g as itemPatchSchema,j as kanbanConfigSchema,f as newItemSchema,e as roleSchema,i as scrumConfigSchema,a as validate,k as waterfallConfigSchema,d as workflowStateSchema}from'../chunk-5TXYMLBF.mjs';import'../chunk-2FRRD6A3.mjs';//# sourceMappingURL=index.mjs.map
2
2
  //# sourceMappingURL=index.mjs.map
@@ -1,2 +1,2 @@
1
- 'use strict';var chunk7KF5K3L7_cjs=require('../chunk-7KF5K3L7.cjs');require('../chunk-CWBH7H52.cjs');var chunkSJRRQZ3R_cjs=require('../chunk-SJRRQZ3R.cjs');require('../chunk-S3BXVHO7.cjs');Object.defineProperty(exports,"SCRUM_VOCABULARY",{enumerable:true,get:function(){return chunk7KF5K3L7_cjs.h}});Object.defineProperty(exports,"closeSprint",{enumerable:true,get:function(){return chunk7KF5K3L7_cjs.j}});Object.defineProperty(exports,"configOf",{enumerable:true,get:function(){return chunk7KF5K3L7_cjs.i}});Object.defineProperty(exports,"dailyReport",{enumerable:true,get:function(){return chunk7KF5K3L7_cjs.a}});Object.defineProperty(exports,"scrum",{enumerable:true,get:function(){return chunk7KF5K3L7_cjs.k}});Object.defineProperty(exports,"scrumCeremonies",{enumerable:true,get:function(){return chunk7KF5K3L7_cjs.b}});Object.defineProperty(exports,"scrumMetrics",{enumerable:true,get:function(){return chunk7KF5K3L7_cjs.d}});Object.defineProperty(exports,"scrumRoles",{enumerable:true,get:function(){return chunk7KF5K3L7_cjs.e}});Object.defineProperty(exports,"scrumRules",{enumerable:true,get:function(){return chunk7KF5K3L7_cjs.f}});Object.defineProperty(exports,"scrumStages",{enumerable:true,get:function(){return chunk7KF5K3L7_cjs.g}});Object.defineProperty(exports,"validateScrumConfig",{enumerable:true,get:function(){return chunk7KF5K3L7_cjs.c}});Object.defineProperty(exports,"canDo",{enumerable:true,get:function(){return chunkSJRRQZ3R_cjs.n}});//# sourceMappingURL=index.cjs.map
1
+ 'use strict';var chunkHIHMBMB5_cjs=require('../chunk-HIHMBMB5.cjs');require('../chunk-VXH2FAKV.cjs');var chunkXMO2RCXB_cjs=require('../chunk-XMO2RCXB.cjs');require('../chunk-S3BXVHO7.cjs');Object.defineProperty(exports,"SCRUM_VOCABULARY",{enumerable:true,get:function(){return chunkHIHMBMB5_cjs.h}});Object.defineProperty(exports,"closeSprint",{enumerable:true,get:function(){return chunkHIHMBMB5_cjs.k}});Object.defineProperty(exports,"configOf",{enumerable:true,get:function(){return chunkHIHMBMB5_cjs.i}});Object.defineProperty(exports,"dailyReport",{enumerable:true,get:function(){return chunkHIHMBMB5_cjs.a}});Object.defineProperty(exports,"resumeStageOf",{enumerable:true,get:function(){return chunkHIHMBMB5_cjs.j}});Object.defineProperty(exports,"scrum",{enumerable:true,get:function(){return chunkHIHMBMB5_cjs.l}});Object.defineProperty(exports,"scrumCeremonies",{enumerable:true,get:function(){return chunkHIHMBMB5_cjs.b}});Object.defineProperty(exports,"scrumMetrics",{enumerable:true,get:function(){return chunkHIHMBMB5_cjs.d}});Object.defineProperty(exports,"scrumRoles",{enumerable:true,get:function(){return chunkHIHMBMB5_cjs.e}});Object.defineProperty(exports,"scrumRules",{enumerable:true,get:function(){return chunkHIHMBMB5_cjs.f}});Object.defineProperty(exports,"scrumStages",{enumerable:true,get:function(){return chunkHIHMBMB5_cjs.g}});Object.defineProperty(exports,"validateScrumConfig",{enumerable:true,get:function(){return chunkHIHMBMB5_cjs.c}});Object.defineProperty(exports,"canDo",{enumerable:true,get:function(){return chunkXMO2RCXB_cjs.n}});//# sourceMappingURL=index.cjs.map
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1,5 +1,6 @@
1
- import { Budget, Policy, WorkflowState, Role, Rule, Stage, ItemStatus, Methodology, Ceremony, CoreTerm } from '../types.cjs';
2
- export { c as canDo } from '../roles-aneKYJ3Z.cjs';
1
+ import { Budget, Policy, WorkflowState, Role, Rule, Stage, ItemStatus, Methodology, Ceremony, CoreTerm, WorkItem } from '../types.cjs';
2
+ import { E as EstimateMode } from '../budget-JyNKxP5N.cjs';
3
+ export { c as canDo } from '../budget-JyNKxP5N.cjs';
3
4
 
4
5
  interface ScrumConfig {
5
6
  sprintBudget: Budget;
@@ -8,6 +9,12 @@ interface ScrumConfig {
8
9
  refinementSharePct: number;
9
10
  allowMidSprintAdd: "never" | "po-only" | "any";
10
11
  inProgressWipLimit?: number;
12
+ /** Close the sprint automatically when its budget is spent and nothing is in flight; default true. */
13
+ autoClose?: boolean;
14
+ /** How the planner and sprint planning price a candidate; default "per-weight". */
15
+ estimateMode?: EstimateMode;
16
+ /** Tokens per weight unit when no accounting history exists; default 20000. */
17
+ fallbackTokensPerWeight?: number;
11
18
  }
12
19
  declare function validateScrumConfig(raw: unknown): ScrumConfig;
13
20
 
@@ -20,6 +27,8 @@ interface ScrumMetrics {
20
27
  carryoverRatio: number;
21
28
  budgetUtilisation: number;
22
29
  costPerPoint: number;
30
+ /** The open sprint right now; all zeros when none is open. */
31
+ current: Record<string, number>;
23
32
  }
24
33
  declare function scrumMetrics(state: WorkflowState): ScrumMetrics;
25
34
 
@@ -52,8 +61,14 @@ declare function scrumCeremonies(methodology: () => Methodology): Record<string,
52
61
  declare const SCRUM_VOCABULARY: Record<CoreTerm, string>;
53
62
  /** Advanced; used by ceremonies. */
54
63
  declare function configOf(state: WorkflowState): ScrumConfig;
64
+ /**
65
+ * The stage a carried-over item was returned from when it was in a review stage: it resumes there, not at the
66
+ * sprint start. closeSprint releases blocked and awaiting_human items, so the stage (its `review` flag) is read from
67
+ * the last system transition, not the status. Without `state` only a `review` status is recognised.
68
+ */
69
+ declare function resumeStageOf(item: WorkItem, state?: WorkflowState): string | undefined;
55
70
  /** Advanced; used by ceremonies. Closes the open sprint and returns unfinished work (and its open questions) to the backlog. */
56
71
  declare function closeSprint(state: WorkflowState, reason: "budget" | "review" | "cancel", now: string): WorkflowState;
57
72
  declare function scrum(): Methodology<ScrumConfig>;
58
73
 
59
- export { type DailyReport, SCRUM_VOCABULARY, type ScrumConfig, type ScrumMetrics, closeSprint, configOf, dailyReport, scrum, scrumCeremonies, scrumMetrics, scrumRoles, scrumRules, scrumStages, validateScrumConfig };
74
+ export { type DailyReport, SCRUM_VOCABULARY, type ScrumConfig, type ScrumMetrics, closeSprint, configOf, dailyReport, resumeStageOf, scrum, scrumCeremonies, scrumMetrics, scrumRoles, scrumRules, scrumStages, validateScrumConfig };
@@ -1,5 +1,6 @@
1
- import { Budget, Policy, WorkflowState, Role, Rule, Stage, ItemStatus, Methodology, Ceremony, CoreTerm } from '../types.js';
2
- export { c as canDo } from '../roles-BLBRKhUZ.js';
1
+ import { Budget, Policy, WorkflowState, Role, Rule, Stage, ItemStatus, Methodology, Ceremony, CoreTerm, WorkItem } from '../types.js';
2
+ import { E as EstimateMode } from '../budget-Cx63FX2K.js';
3
+ export { c as canDo } from '../budget-Cx63FX2K.js';
3
4
 
4
5
  interface ScrumConfig {
5
6
  sprintBudget: Budget;
@@ -8,6 +9,12 @@ interface ScrumConfig {
8
9
  refinementSharePct: number;
9
10
  allowMidSprintAdd: "never" | "po-only" | "any";
10
11
  inProgressWipLimit?: number;
12
+ /** Close the sprint automatically when its budget is spent and nothing is in flight; default true. */
13
+ autoClose?: boolean;
14
+ /** How the planner and sprint planning price a candidate; default "per-weight". */
15
+ estimateMode?: EstimateMode;
16
+ /** Tokens per weight unit when no accounting history exists; default 20000. */
17
+ fallbackTokensPerWeight?: number;
11
18
  }
12
19
  declare function validateScrumConfig(raw: unknown): ScrumConfig;
13
20
 
@@ -20,6 +27,8 @@ interface ScrumMetrics {
20
27
  carryoverRatio: number;
21
28
  budgetUtilisation: number;
22
29
  costPerPoint: number;
30
+ /** The open sprint right now; all zeros when none is open. */
31
+ current: Record<string, number>;
23
32
  }
24
33
  declare function scrumMetrics(state: WorkflowState): ScrumMetrics;
25
34
 
@@ -52,8 +61,14 @@ declare function scrumCeremonies(methodology: () => Methodology): Record<string,
52
61
  declare const SCRUM_VOCABULARY: Record<CoreTerm, string>;
53
62
  /** Advanced; used by ceremonies. */
54
63
  declare function configOf(state: WorkflowState): ScrumConfig;
64
+ /**
65
+ * The stage a carried-over item was returned from when it was in a review stage: it resumes there, not at the
66
+ * sprint start. closeSprint releases blocked and awaiting_human items, so the stage (its `review` flag) is read from
67
+ * the last system transition, not the status. Without `state` only a `review` status is recognised.
68
+ */
69
+ declare function resumeStageOf(item: WorkItem, state?: WorkflowState): string | undefined;
55
70
  /** Advanced; used by ceremonies. Closes the open sprint and returns unfinished work (and its open questions) to the backlog. */
56
71
  declare function closeSprint(state: WorkflowState, reason: "budget" | "review" | "cancel", now: string): WorkflowState;
57
72
  declare function scrum(): Methodology<ScrumConfig>;
58
73
 
59
- export { type DailyReport, SCRUM_VOCABULARY, type ScrumConfig, type ScrumMetrics, closeSprint, configOf, dailyReport, scrum, scrumCeremonies, scrumMetrics, scrumRoles, scrumRules, scrumStages, validateScrumConfig };
74
+ export { type DailyReport, SCRUM_VOCABULARY, type ScrumConfig, type ScrumMetrics, closeSprint, configOf, dailyReport, resumeStageOf, scrum, scrumCeremonies, scrumMetrics, scrumRoles, scrumRules, scrumStages, validateScrumConfig };
@@ -1,2 +1,2 @@
1
- export{h as SCRUM_VOCABULARY,j as closeSprint,i as configOf,a as dailyReport,k as scrum,b as scrumCeremonies,d as scrumMetrics,e as scrumRoles,f as scrumRules,g as scrumStages,c as validateScrumConfig}from'../chunk-L2ZN6HEL.mjs';import'../chunk-GFH2FEZH.mjs';export{n as canDo}from'../chunk-SHAPFMVP.mjs';import'../chunk-2FRRD6A3.mjs';//# sourceMappingURL=index.mjs.map
1
+ export{h as SCRUM_VOCABULARY,k as closeSprint,i as configOf,a as dailyReport,j as resumeStageOf,l as scrum,b as scrumCeremonies,d as scrumMetrics,e as scrumRoles,f as scrumRules,g as scrumStages,c as validateScrumConfig}from'../chunk-QDMEM62U.mjs';import'../chunk-U3OXAO67.mjs';export{n as canDo}from'../chunk-YBHHICTZ.mjs';import'../chunk-2FRRD6A3.mjs';//# sourceMappingURL=index.mjs.map
2
2
  //# sourceMappingURL=index.mjs.map