ex-workflow 0.0.0-stage → 0.1.0-stage

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 (68) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/LICENSE +21 -0
  3. package/README.md +130 -2
  4. package/dist/adapters/index.cjs +2 -0
  5. package/dist/adapters/index.cjs.map +1 -0
  6. package/dist/adapters/index.d.cts +17 -0
  7. package/dist/adapters/index.d.ts +17 -0
  8. package/dist/adapters/index.mjs +2 -0
  9. package/dist/adapters/index.mjs.map +1 -0
  10. package/dist/chunk-2FRRD6A3.mjs +2 -0
  11. package/dist/chunk-2FRRD6A3.mjs.map +1 -0
  12. package/dist/chunk-5XAKW64K.cjs +2 -0
  13. package/dist/chunk-5XAKW64K.cjs.map +1 -0
  14. package/dist/chunk-6R3YFUUV.cjs +6 -0
  15. package/dist/chunk-6R3YFUUV.cjs.map +1 -0
  16. package/dist/chunk-B7MP6Y3W.mjs +2 -0
  17. package/dist/chunk-B7MP6Y3W.mjs.map +1 -0
  18. package/dist/chunk-CPGDAHAU.cjs +2 -0
  19. package/dist/chunk-CPGDAHAU.cjs.map +1 -0
  20. package/dist/chunk-D7U3ES2L.mjs +2 -0
  21. package/dist/chunk-D7U3ES2L.mjs.map +1 -0
  22. package/dist/chunk-DZ7AN6H5.mjs +2 -0
  23. package/dist/chunk-DZ7AN6H5.mjs.map +1 -0
  24. package/dist/chunk-KIQOUUEZ.mjs +2 -0
  25. package/dist/chunk-KIQOUUEZ.mjs.map +1 -0
  26. package/dist/chunk-LPQSNYYT.cjs +2 -0
  27. package/dist/chunk-LPQSNYYT.cjs.map +1 -0
  28. package/dist/chunk-PO2SPQJP.cjs +2 -0
  29. package/dist/chunk-PO2SPQJP.cjs.map +1 -0
  30. package/dist/chunk-ROH3RYBI.mjs +2 -0
  31. package/dist/chunk-ROH3RYBI.mjs.map +1 -0
  32. package/dist/chunk-S3BXVHO7.cjs +2 -0
  33. package/dist/chunk-S3BXVHO7.cjs.map +1 -0
  34. package/dist/chunk-VGD4V5BA.mjs +6 -0
  35. package/dist/chunk-VGD4V5BA.mjs.map +1 -0
  36. package/dist/chunk-WAMNJUQ4.cjs +2 -0
  37. package/dist/chunk-WAMNJUQ4.cjs.map +1 -0
  38. package/dist/cli/bin.cjs +5 -0
  39. package/dist/cli/bin.cjs.map +1 -0
  40. package/dist/cli/bin.d.cts +1 -0
  41. package/dist/cli/bin.d.ts +1 -0
  42. package/dist/cli/bin.mjs +5 -0
  43. package/dist/cli/bin.mjs.map +1 -0
  44. package/dist/cli/index.cjs +2 -0
  45. package/dist/cli/index.cjs.map +1 -0
  46. package/dist/cli/index.d.cts +13 -0
  47. package/dist/cli/index.d.ts +13 -0
  48. package/dist/cli/index.mjs +2 -0
  49. package/dist/cli/index.mjs.map +1 -0
  50. package/dist/index.cjs +2 -0
  51. package/dist/index.cjs.map +1 -0
  52. package/dist/index.d.cts +133 -0
  53. package/dist/index.d.ts +133 -0
  54. package/dist/index.mjs +2 -0
  55. package/dist/index.mjs.map +1 -0
  56. package/dist/scrum/index.cjs +2 -0
  57. package/dist/scrum/index.cjs.map +1 -0
  58. package/dist/scrum/index.d.cts +59 -0
  59. package/dist/scrum/index.d.ts +59 -0
  60. package/dist/scrum/index.mjs +2 -0
  61. package/dist/scrum/index.mjs.map +1 -0
  62. package/dist/types.cjs +2 -0
  63. package/dist/types.cjs.map +1 -0
  64. package/dist/types.d.cts +320 -0
  65. package/dist/types.d.ts +320 -0
  66. package/dist/types.mjs +2 -0
  67. package/dist/types.mjs.map +1 -0
  68. package/package.json +133 -4
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/cli/commands.ts"],"names":["METHODOLOGIES","scrum","USAGE","parseArgs","argv","positional","flags","a","key","val","readJson","file","readFile","e","fail","methodologyOf","state","f","num","v","WRITERS","runCommand","cwd","cmd","sub","writes","withStateLock","execute","WorkflowError","rest","by","now","name","stat","statePath","config","path","roles","res","init","saveState","s","loadState","item","s2","addItem","getItem","editItem","opts","next","b","saveBrief","handoff","role","durationMs","acc","complete","saveHandoff","m","c","input","lastEvent","entry","p","decide","counts","i","openIteration","st","action","validateAction","registerRole"],"mappings":"6aA+BA,IAAMA,CAAAA,CAAmD,CAAE,MAAOC,mBAA2B,CAAA,CAEhFC,EAAQ,CACnB,oDAAA,CACA,8EACA,+HAAA,CACA,8CAAA,CACA,iEAAA,CACA,mDAAA,CACA,gFACF,EAMO,SAASC,EAAUC,CAAAA,CAAwB,CAChD,IAAMC,CAAAA,CAAuB,EAAC,CACxBC,CAAAA,CAAgC,EAAC,CACvC,IAAA,IAAS,EAAI,CAAA,CAAG,CAAA,CAAIF,EAAK,MAAA,CAAQ,CAAA,EAAA,CAAK,CACpC,IAAMG,EAAIH,CAAAA,CAAK,CAAC,EAChB,GAAIG,CAAAA,CAAE,WAAW,IAAI,CAAA,CAAG,CACtB,IAAMC,EAAMD,CAAAA,CAAE,KAAA,CAAM,CAAC,CAAA,CACfE,CAAAA,CAAML,EAAK,CAAA,CAAI,CAAC,CAAA,CAClBK,CAAAA,GAAQ,QAAa,CAACA,CAAAA,CAAI,WAAW,IAAI,CAAA,EAC3CH,EAAME,CAAG,CAAA,CAAIC,CAAAA,CACb,CAAA,EAAA,EACKH,EAAME,CAAG,CAAA,CAAI,OACtB,CAAA,KAAOH,CAAAA,CAAW,KAAKE,CAAC,EAC1B,CACA,OAAO,CAAE,UAAA,CAAAF,CAAAA,CAAY,MAAAC,CAAM,CAC7B,CAEA,eAAeI,CAAAA,CAAYC,CAAAA,CAA0B,CACnD,GAAI,CACF,OAAO,KAAK,KAAA,CAAM,MAAMC,kBAASD,CAAAA,CAAM,MAAM,CAAC,CAChD,OAASE,CAAAA,CAAG,CACV,OAAOC,mBAAAA,CACL,eAAA,CACA,yBAAyBH,CAAI,CAAA,EAAA,EAAME,CAAAA,CAAY,OAAO,GACtD,gDACF,CACF,CACF,CAEA,SAASE,EAAcC,CAAAA,CAAmC,CACxD,IAAMC,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WAMNJUQ4.cjs","sourcesContent":["import { readFile, stat } from \"node:fs/promises\";\nimport path from \"node:path\";\nimport {\n loadState,\n saveBrief,\n saveHandoff,\n saveState,\n statePath,\n withStateLock,\n} from \"../adapters/file.ts\";\nimport { next as planNext } from \"../brief.ts\";\nimport { complete } from \"../complete.ts\";\nimport { WorkflowError, fail } from \"../errors.ts\";\nimport { decide } from \"../gates.ts\";\nimport { addItem, editItem, getItem, type ItemPatch } from \"../items.ts\";\nimport { init, validateAction } from \"../methodology.ts\";\nimport { openIteration } from \"../planner.ts\";\nimport { registerRole } from \"../roles.ts\";\nimport { lastEvent } from \"../state.ts\";\nimport { scrum } from \"../scrum/index.ts\";\nimport type {\n Accounting,\n Action,\n Handoff,\n ItemStatus,\n Methodology,\n NewItem,\n Role,\n WorkflowState,\n} from \"../types.ts\";\n\nconst METHODOLOGIES: Record<string, () => Methodology> = { scrum: scrum as () => Methodology };\n\nexport const USAGE = [\n \"exwf init <scrum> --config <file> [--roles <file>]\",\n \"exwf add <item.json> [--by who] exwf edit <id> <patch.json> [--by who]\",\n \"exwf next [--max n] exwf complete <id> <handoff.json> --tokens-in n --tokens-out n --duration-ms n --model m\",\n \"exwf ceremony <name> [input.json] [--by who]\",\n \"exwf decide <pendingId> approve|reject [--by who] [--note text]\",\n \"exwf status | board | metrics | pending | lessons\",\n \"exwf validate <action.json> exwf role add <manifest.json> | role list\",\n];\n\nexport interface Parsed {\n positional: string[];\n flags: Record<string, string>;\n}\nexport function parseArgs(argv: string[]): Parsed {\n const positional: string[] = [];\n const flags: Record<string, string> = {};\n for (let i = 0; i < argv.length; i++) {\n const a = argv[i]!;\n if (a.startsWith(\"--\")) {\n const key = a.slice(2);\n const val = argv[i + 1];\n if (val !== undefined && !val.startsWith(\"--\")) {\n flags[key] = val;\n i++;\n } else flags[key] = \"true\";\n } else positional.push(a);\n }\n return { positional, flags };\n}\n\nasync function readJson<T>(file: string): Promise<T> {\n try {\n return JSON.parse(await readFile(file, \"utf8\")) as T;\n } catch (e) {\n return fail(\n \"invalid-input\",\n `cannot read JSON from ${file}: ${(e as Error).message}`,\n \"check the path and that the file is valid JSON\",\n );\n }\n}\n\nfunction methodologyOf(state: WorkflowState): Methodology {\n const f = Object.hasOwn(METHODOLOGIES, state.methodology)\n ? METHODOLOGIES[state.methodology]\n : undefined;\n if (!f)\n fail(\n \"config-invalid\",\n `methodology \"${state.methodology}\" is not available in this build`,\n `available: ${Object.keys(METHODOLOGIES).join(\", \")}`,\n );\n return f();\n}\n\nfunction num(flags: Record<string, string>, key: string): number {\n const v = Number(flags[key]);\n if (!Number.isFinite(v))\n fail(\n \"invalid-input\",\n `--${key} must be a number (got ${JSON.stringify(flags[key])})`,\n `pass --${key} <n>`,\n );\n return v;\n}\n\nexport interface CommandResult {\n exit: 0 | 1 | 2;\n out: unknown;\n}\n\n/** Commands that load, change and save the state: they run under .workflow/state.lock. */\nconst WRITERS = new Set([\"init\", \"add\", \"edit\", \"next\", \"complete\", \"ceremony\", \"decide\"]);\n\nexport async function runCommand(argv: string[], cwd: string): Promise<CommandResult> {\n const [cmd, sub] = parseArgs(argv).positional;\n const writes = cmd !== undefined && (WRITERS.has(cmd) || (cmd === \"role\" && sub === \"add\"));\n try {\n return writes ? await withStateLock(cwd, () => execute(argv, cwd)) : await execute(argv, cwd);\n } catch (e) {\n if (e instanceof WorkflowError) return { exit: 1, out: { ok: false, error: e.toJSON() } };\n throw e;\n }\n}\n\nasync function execute(argv: string[], cwd: string): Promise<CommandResult> {\n const { positional, flags } = parseArgs(argv);\n const [cmd, ...rest] = positional;\n const by = flags[\"by\"] ?? \"human\";\n const now = new Date().toISOString();\n switch (cmd) {\n case \"init\": {\n const [name] = rest;\n const f = name && Object.hasOwn(METHODOLOGIES, name) ? METHODOLOGIES[name] : undefined;\n if (!f || !flags[\"config\"]) return { exit: 2, out: { ok: false, usage: USAGE } };\n try {\n await stat(statePath(cwd));\n fail(\n \"invalid-input\",\n `${statePath(cwd)} already exists`,\n \"delete .workflow/state.json to start over\",\n );\n } catch (e) {\n if (e instanceof WorkflowError) throw e;\n if ((e as NodeJS.ErrnoException).code !== \"ENOENT\") throw e;\n }\n const config = await readJson<unknown>(path.resolve(cwd, flags[\"config\"]));\n const roles = flags[\"roles\"]\n ? await readJson<Role[]>(path.resolve(cwd, flags[\"roles\"]))\n : undefined;\n const res = init(\n roles\n ? { methodology: f(), config, roles, by, now }\n : { methodology: f(), config, by, now },\n );\n await saveState(cwd, res.state);\n return {\n exit: 0,\n out: {\n ok: true,\n warnings: res.warnings,\n state: {\n methodology: res.state.methodology,\n stages: res.state.stages.map((s) => s.id),\n roles: Object.keys(res.state.roles),\n },\n },\n };\n }\n case \"add\": {\n if (!rest[0]) return { exit: 2, out: { ok: false, usage: USAGE } };\n const state = await loadState(cwd);\n const item = await readJson<NewItem>(path.resolve(cwd, rest[0]));\n const s2 = addItem(state, item, by, now);\n await saveState(cwd, s2);\n return { exit: 0, out: { ok: true, item: getItem(s2, item.id) } };\n }\n case \"edit\": {\n if (!rest[0] || !rest[1]) return { exit: 2, out: { ok: false, usage: USAGE } };\n const state = await loadState(cwd);\n const s2 = editItem(\n state,\n rest[0],\n await readJson<ItemPatch>(path.resolve(cwd, rest[1])),\n by,\n now,\n );\n await saveState(cwd, s2);\n return { exit: 0, out: { ok: true, item: getItem(s2, rest[0]) } };\n }\n case \"next\": {\n const state = await loadState(cwd);\n const opts = flags[\"max\"] ? { max: num(flags, \"max\"), now } : { now };\n const res = planNext(state, methodologyOf(state), opts);\n await saveState(cwd, res.state);\n for (const b of res.briefs) await saveBrief(cwd, b);\n return { exit: 0, out: { ok: true, reason: res.reason ?? null, briefs: res.briefs } };\n }\n case \"complete\": {\n if (!rest[0] || !rest[1]) return { exit: 2, out: { ok: false, usage: USAGE } };\n const state = await loadState(cwd);\n const handoff = await readJson<Handoff>(path.resolve(cwd, rest[1]));\n if (handoff.item !== rest[0])\n fail(\n \"handoff-invalid\",\n `handoff.item \"${handoff.item}\" differs from the command's item \"${rest[0]}\"`,\n \"make them match\",\n );\n const role = flags[\"role\"] ?? handoff.role;\n const durationMs = num(flags, \"duration-ms\");\n const acc: Accounting = {\n item: rest[0],\n role,\n model: flags[\"model\"] ?? \"\",\n tokensIn: num(flags, \"tokens-in\"),\n tokensOut: num(flags, \"tokens-out\"),\n durationMs,\n startedAt: new Date(Date.parse(now) - durationMs).toISOString(),\n endedAt: now,\n };\n const res = complete(state, methodologyOf(state), { ...handoff, role }, acc, now);\n await saveState(cwd, res.state);\n await saveHandoff(cwd, handoff, res.state.events.length);\n return {\n exit: 0,\n out: { ok: true, warnings: res.warnings, item: getItem(res.state, rest[0]) },\n };\n }\n case \"ceremony\": {\n if (!rest[0]) return { exit: 2, out: { ok: false, usage: USAGE } };\n const state = await loadState(cwd);\n const m = methodologyOf(state);\n const c = Object.hasOwn(m.ceremonies, rest[0]) ? m.ceremonies[rest[0]] : undefined;\n if (!c)\n fail(\n \"unknown-ceremony\",\n `\"${rest[0]}\" is not a ${m.name} ceremony`,\n `available: ${Object.keys(m.ceremonies).join(\", \")}`,\n );\n const input = rest[1]\n ? await readJson<Record<string, unknown>>(path.resolve(cwd, rest[1]))\n : {};\n const res = c(state, { ...input, by, now });\n await saveState(cwd, res.state);\n return {\n exit: 0,\n out: { ok: true, warnings: res.warnings, lastEvent: lastEvent(res.state) },\n };\n }\n case \"decide\": {\n if (!rest[0] || (rest[1] !== \"approve\" && rest[1] !== \"reject\"))\n return { exit: 2, out: { ok: false, usage: USAGE } };\n const state = await loadState(cwd);\n const entry = state.pending.find((p) => p.id === rest[0]);\n const s2 = decide(state, rest[0], rest[1], by, flags[\"note\"] ?? \"\", now);\n await saveState(cwd, s2);\n return { exit: 0, out: { ok: true, item: entry?.item ? getItem(s2, entry.item) : null } };\n }\n case \"status\": {\n const state = await loadState(cwd);\n const counts: Record<ItemStatus, number> = {\n todo: 0,\n in_progress: 0,\n blocked: 0,\n review: 0,\n awaiting_human: 0,\n done: 0,\n dropped: 0,\n };\n for (const i of Object.values(state.items)) counts[i.status] += 1;\n return {\n exit: 0,\n out: {\n ok: true,\n methodology: state.methodology,\n openIteration: openIteration(state) ?? null,\n counts,\n pending: state.pending,\n lastEvent: lastEvent(state),\n },\n };\n }\n case \"board\": {\n const state = await loadState(cwd);\n const columns = state.stages.map((st) => ({\n stage: st.id,\n wipLimit: st.wipLimit ?? null,\n items: Object.values(state.items)\n .filter((i) => i.stage === st.id && i.status !== \"dropped\")\n .map((i) => ({\n id: i.id,\n title: i.title,\n status: i.status,\n role: i.role ?? null,\n age: i.transitions.length\n ? Date.parse(now) - Date.parse(i.transitions[i.transitions.length - 1]!.at)\n : null,\n })),\n }));\n return { exit: 0, out: { ok: true, columns } };\n }\n case \"metrics\": {\n const state = await loadState(cwd);\n return { exit: 0, out: { ok: true, metrics: methodologyOf(state).metrics(state) } };\n }\n case \"pending\":\n return { exit: 0, out: { ok: true, pending: (await loadState(cwd)).pending } };\n case \"lessons\":\n return { exit: 0, out: { ok: true, lessons: (await loadState(cwd)).lessons } };\n case \"validate\": {\n if (!rest[0]) return { exit: 2, out: { ok: false, usage: USAGE } };\n const state = await loadState(cwd);\n const action = await readJson<Action>(path.resolve(cwd, rest[0]));\n return {\n exit: 0,\n out: { ok: true, violations: validateAction(state, methodologyOf(state), action) },\n };\n }\n case \"role\": {\n const state = await loadState(cwd);\n if (rest[0] === \"list\")\n return {\n exit: 0,\n out: { ok: true, roles: Object.keys(state.roles), detail: state.roles },\n };\n if (rest[0] === \"add\" && rest[1]) {\n const s2 = registerRole(state, await readJson<Role>(path.resolve(cwd, rest[1])), by, now);\n await saveState(cwd, s2);\n return { exit: 0, out: { ok: true, roles: Object.keys(s2.roles) } };\n }\n return { exit: 2, out: { ok: false, usage: USAGE } };\n }\n default:\n return { exit: 2, out: { ok: false, usage: USAGE } };\n }\n}\n"]}
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env node
2
+ 'use strict';var chunkWAMNJUQ4_cjs=require('../chunk-WAMNJUQ4.cjs');require('../chunk-CPGDAHAU.cjs'),require('../chunk-LPQSNYYT.cjs'),require('../chunk-5XAKW64K.cjs'),require('../chunk-6R3YFUUV.cjs'),require('../chunk-S3BXVHO7.cjs');chunkWAMNJUQ4_cjs.c(process.argv.slice(2),process.cwd()).then(r=>{process.stdout.write(JSON.stringify(r.out,null,2)+`
3
+ `),process.exitCode=r.exit;},r=>{process.stderr.write(`exwf crashed: ${r.stack??String(r)}
4
+ `),process.exitCode=2;});//# sourceMappingURL=bin.cjs.map
5
+ //# sourceMappingURL=bin.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/cli/bin.ts"],"names":["runCommand","e"],"mappings":";yOAGAA,mBAAAA,CAAW,OAAA,CAAQ,KAAK,KAAA,CAAM,CAAC,EAAG,OAAA,CAAQ,GAAA,EAAK,CAAA,CAAE,IAAA,CAC9C,GAAM,CACL,OAAA,CAAQ,OAAO,KAAA,CAAM,IAAA,CAAK,UAAU,CAAA,CAAE,GAAA,CAAK,IAAA,CAAM,CAAC,CAAA,CAAI;AAAA,CAAI,EAC1D,OAAA,CAAQ,QAAA,CAAW,CAAA,CAAE,KACvB,EACCC,CAAAA,EAAe,CACd,OAAA,CAAQ,MAAA,CAAO,MAAM,CAAA,cAAA,EAAkBA,CAAAA,CAAY,KAAA,EAAS,MAAA,CAAOA,CAAC,CAAC;AAAA,CAAI,CAAA,CACzE,OAAA,CAAQ,QAAA,CAAW,EACrB,CACF,CAAA","file":"bin.cjs","sourcesContent":["#!/usr/bin/env node\nimport { runCommand } from \"./commands.ts\";\n\nrunCommand(process.argv.slice(2), process.cwd()).then(\n (r) => {\n process.stdout.write(JSON.stringify(r.out, null, 2) + \"\\n\");\n process.exitCode = r.exit;\n },\n (e: unknown) => {\n process.stderr.write(`exwf crashed: ${(e as Error).stack ?? String(e)}\\n`);\n process.exitCode = 2;\n },\n);\n"]}
@@ -0,0 +1 @@
1
+ #!/usr/bin/env node
@@ -0,0 +1 @@
1
+ #!/usr/bin/env node
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env node
2
+ import {c}from'../chunk-DZ7AN6H5.mjs';import'../chunk-B7MP6Y3W.mjs';import'../chunk-ROH3RYBI.mjs';import'../chunk-D7U3ES2L.mjs';import'../chunk-VGD4V5BA.mjs';import'../chunk-2FRRD6A3.mjs';c(process.argv.slice(2),process.cwd()).then(r=>{process.stdout.write(JSON.stringify(r.out,null,2)+`
3
+ `),process.exitCode=r.exit;},r=>{process.stderr.write(`exwf crashed: ${r.stack??String(r)}
4
+ `),process.exitCode=2;});//# sourceMappingURL=bin.mjs.map
5
+ //# sourceMappingURL=bin.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/cli/bin.ts"],"names":["runCommand","e"],"mappings":";4LAGAA,CAAAA,CAAW,OAAA,CAAQ,KAAK,KAAA,CAAM,CAAC,EAAG,OAAA,CAAQ,GAAA,EAAK,CAAA,CAAE,IAAA,CAC9C,GAAM,CACL,OAAA,CAAQ,OAAO,KAAA,CAAM,IAAA,CAAK,UAAU,CAAA,CAAE,GAAA,CAAK,IAAA,CAAM,CAAC,CAAA,CAAI;AAAA,CAAI,EAC1D,OAAA,CAAQ,QAAA,CAAW,CAAA,CAAE,KACvB,EACCC,CAAAA,EAAe,CACd,OAAA,CAAQ,MAAA,CAAO,MAAM,CAAA,cAAA,EAAkBA,CAAAA,CAAY,KAAA,EAAS,MAAA,CAAOA,CAAC,CAAC;AAAA,CAAI,CAAA,CACzE,OAAA,CAAQ,QAAA,CAAW,EACrB,CACF,CAAA","file":"bin.mjs","sourcesContent":["#!/usr/bin/env node\nimport { runCommand } from \"./commands.ts\";\n\nrunCommand(process.argv.slice(2), process.cwd()).then(\n (r) => {\n process.stdout.write(JSON.stringify(r.out, null, 2) + \"\\n\");\n process.exitCode = r.exit;\n },\n (e: unknown) => {\n process.stderr.write(`exwf crashed: ${(e as Error).stack ?? String(e)}\\n`);\n process.exitCode = 2;\n },\n);\n"]}
@@ -0,0 +1,2 @@
1
+ 'use strict';var chunkWAMNJUQ4_cjs=require('../chunk-WAMNJUQ4.cjs');require('../chunk-CPGDAHAU.cjs'),require('../chunk-LPQSNYYT.cjs'),require('../chunk-5XAKW64K.cjs'),require('../chunk-6R3YFUUV.cjs'),require('../chunk-S3BXVHO7.cjs');Object.defineProperty(exports,"USAGE",{enumerable:true,get:function(){return chunkWAMNJUQ4_cjs.a}});Object.defineProperty(exports,"parseArgs",{enumerable:true,get:function(){return chunkWAMNJUQ4_cjs.b}});Object.defineProperty(exports,"runCommand",{enumerable:true,get:function(){return chunkWAMNJUQ4_cjs.c}});//# sourceMappingURL=index.cjs.map
2
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.cjs"}
@@ -0,0 +1,13 @@
1
+ declare const USAGE: string[];
2
+ interface Parsed {
3
+ positional: string[];
4
+ flags: Record<string, string>;
5
+ }
6
+ declare function parseArgs(argv: string[]): Parsed;
7
+ interface CommandResult {
8
+ exit: 0 | 1 | 2;
9
+ out: unknown;
10
+ }
11
+ declare function runCommand(argv: string[], cwd: string): Promise<CommandResult>;
12
+
13
+ export { type CommandResult, type Parsed, USAGE, parseArgs, runCommand };
@@ -0,0 +1,13 @@
1
+ declare const USAGE: string[];
2
+ interface Parsed {
3
+ positional: string[];
4
+ flags: Record<string, string>;
5
+ }
6
+ declare function parseArgs(argv: string[]): Parsed;
7
+ interface CommandResult {
8
+ exit: 0 | 1 | 2;
9
+ out: unknown;
10
+ }
11
+ declare function runCommand(argv: string[], cwd: string): Promise<CommandResult>;
12
+
13
+ export { type CommandResult, type Parsed, USAGE, parseArgs, runCommand };
@@ -0,0 +1,2 @@
1
+ export{a as USAGE,b as parseArgs,c as runCommand}from'../chunk-DZ7AN6H5.mjs';import'../chunk-B7MP6Y3W.mjs';import'../chunk-ROH3RYBI.mjs';import'../chunk-D7U3ES2L.mjs';import'../chunk-VGD4V5BA.mjs';import'../chunk-2FRRD6A3.mjs';//# sourceMappingURL=index.mjs.map
2
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.mjs"}
package/dist/index.cjs ADDED
@@ -0,0 +1,2 @@
1
+ 'use strict';require('./chunk-PO2SPQJP.cjs');var chunkCPGDAHAU_cjs=require('./chunk-CPGDAHAU.cjs'),chunk5XAKW64K_cjs=require('./chunk-5XAKW64K.cjs'),chunkS3BXVHO7_cjs=require('./chunk-S3BXVHO7.cjs');var M="0.1.0-stage";Object.defineProperty(exports,"complete",{enumerable:true,get:function(){return chunkCPGDAHAU_cjs.c}});Object.defineProperty(exports,"next",{enumerable:true,get:function(){return chunkCPGDAHAU_cjs.b}});Object.defineProperty(exports,"synthesizeBrief",{enumerable:true,get:function(){return chunkCPGDAHAU_cjs.a}});Object.defineProperty(exports,"ZERO_SPENT",{enumerable:true,get:function(){return chunk5XAKW64K_cjs.I}});Object.defineProperty(exports,"addEvidence",{enumerable:true,get:function(){return chunk5XAKW64K_cjs.w}});Object.defineProperty(exports,"addItem",{enumerable:true,get:function(){return chunk5XAKW64K_cjs.t}});Object.defineProperty(exports,"addSpent",{enumerable:true,get:function(){return chunk5XAKW64K_cjs.J}});Object.defineProperty(exports,"appendEvent",{enumerable:true,get:function(){return chunk5XAKW64K_cjs.c}});Object.defineProperty(exports,"applyAction",{enumerable:true,get:function(){return chunk5XAKW64K_cjs.U}});Object.defineProperty(exports,"approversFor",{enumerable:true,get:function(){return chunk5XAKW64K_cjs.k}});Object.defineProperty(exports,"assertPolicies",{enumerable:true,get:function(){return chunk5XAKW64K_cjs.C}});Object.defineProperty(exports,"assignRole",{enumerable:true,get:function(){return chunk5XAKW64K_cjs.O}});Object.defineProperty(exports,"authorOf",{enumerable:true,get:function(){return chunk5XAKW64K_cjs.E}});Object.defineProperty(exports,"checkGate",{enumerable:true,get:function(){return chunk5XAKW64K_cjs.F}});Object.defineProperty(exports,"clearBlocker",{enumerable:true,get:function(){return chunk5XAKW64K_cjs.y}});Object.defineProperty(exports,"coreRulesFor",{enumerable:true,get:function(){return chunk5XAKW64K_cjs.S}});Object.defineProperty(exports,"createState",{enumerable:true,get:function(){return chunk5XAKW64K_cjs.b}});Object.defineProperty(exports,"decide",{enumerable:true,get:function(){return chunk5XAKW64K_cjs.H}});Object.defineProperty(exports,"editItem",{enumerable:true,get:function(){return chunk5XAKW64K_cjs.u}});Object.defineProperty(exports,"estimateTokens",{enumerable:true,get:function(){return chunk5XAKW64K_cjs.M}});Object.defineProperty(exports,"evaluatePolicies",{enumerable:true,get:function(){return chunk5XAKW64K_cjs.B}});Object.defineProperty(exports,"getItem",{enumerable:true,get:function(){return chunk5XAKW64K_cjs.s}});Object.defineProperty(exports,"hasCapability",{enumerable:true,get:function(){return chunk5XAKW64K_cjs.h}});Object.defineProperty(exports,"init",{enumerable:true,get:function(){return chunk5XAKW64K_cjs.V}});Object.defineProperty(exports,"isExhausted",{enumerable:true,get:function(){return chunk5XAKW64K_cjs.L}});Object.defineProperty(exports,"isTerminalStage",{enumerable:true,get:function(){return chunk5XAKW64K_cjs.p}});Object.defineProperty(exports,"lastDispatchBefore",{enumerable:true,get:function(){return chunk5XAKW64K_cjs.D}});Object.defineProperty(exports,"lastEvent",{enumerable:true,get:function(){return chunk5XAKW64K_cjs.d}});Object.defineProperty(exports,"moveItem",{enumerable:true,get:function(){return chunk5XAKW64K_cjs.v}});Object.defineProperty(exports,"nextStageOf",{enumerable:true,get:function(){return chunk5XAKW64K_cjs.o}});Object.defineProperty(exports,"nowOf",{enumerable:true,get:function(){return chunk5XAKW64K_cjs.a}});Object.defineProperty(exports,"openIteration",{enumerable:true,get:function(){return chunk5XAKW64K_cjs.N}});Object.defineProperty(exports,"plan",{enumerable:true,get:function(){return chunk5XAKW64K_cjs.R}});Object.defineProperty(exports,"raiseBlocker",{enumerable:true,get:function(){return chunk5XAKW64K_cjs.x}});Object.defineProperty(exports,"raisePending",{enumerable:true,get:function(){return chunk5XAKW64K_cjs.G}});Object.defineProperty(exports,"registerRole",{enumerable:true,get:function(){return chunk5XAKW64K_cjs.f}});Object.defineProperty(exports,"remaining",{enumerable:true,get:function(){return chunk5XAKW64K_cjs.K}});Object.defineProperty(exports,"requireCapabilities",{enumerable:true,get:function(){return chunk5XAKW64K_cjs.l}});Object.defineProperty(exports,"resourceCapsFor",{enumerable:true,get:function(){return chunk5XAKW64K_cjs.P}});Object.defineProperty(exports,"retireRole",{enumerable:true,get:function(){return chunk5XAKW64K_cjs.g}});Object.defineProperty(exports,"rolesWith",{enumerable:true,get:function(){return chunk5XAKW64K_cjs.i}});Object.defineProperty(exports,"separationLost",{enumerable:true,get:function(){return chunk5XAKW64K_cjs.m}});Object.defineProperty(exports,"stageOf",{enumerable:true,get:function(){return chunk5XAKW64K_cjs.n}});Object.defineProperty(exports,"toExNodes",{enumerable:true,get:function(){return chunk5XAKW64K_cjs.Q}});Object.defineProperty(exports,"validateAction",{enumerable:true,get:function(){return chunk5XAKW64K_cjs.T}});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=M;//# sourceMappingURL=index.cjs.map
2
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts"],"names":["VERSION"],"mappings":"uMAAO,IAAMA,CAAAA,CAAU","file":"index.cjs","sourcesContent":["export const VERSION = \"0.1.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} 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 } 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"]}
@@ -0,0 +1,133 @@
1
+ import { ErrorCode, WorkflowState, MethodologyName, Stage, Role, Event, Capability, WorkItem, Evidence, NewItem, ItemStatus, Policy, Violation, Gate, Transition, PendingHuman, Budget, Accounting, Iteration, Methodology, Brief, Handoff, ApplyResult, Rule, Action } from './types.cjs';
2
+ export { Baseline, Blocker, Ceremony, CeremonyInput, ClassOfService, CoreTerm, GateRequirement, ItemType, Lesson, LessonChange, ModelTier, Phase, PlannerOptions, Verdict } from './types.cjs';
3
+ import { ExNode } from 'ex-flow';
4
+
5
+ interface WorkflowErrorExtra {
6
+ items?: string[];
7
+ rule?: string;
8
+ }
9
+ declare class WorkflowError extends Error {
10
+ readonly code: ErrorCode;
11
+ readonly fix: string;
12
+ readonly items?: string[];
13
+ readonly rule?: string;
14
+ constructor(code: ErrorCode, message: string, fix: string, extra?: WorkflowErrorExtra);
15
+ toJSON(): {
16
+ code: ErrorCode;
17
+ message: string;
18
+ fix: string;
19
+ items?: string[];
20
+ rule?: string;
21
+ };
22
+ }
23
+ declare function fail(code: ErrorCode, message: string, fix: string, extra?: WorkflowErrorExtra): never;
24
+ /** Ids become object keys and file names: letters, digits, `.`, `_`, `-`; no `..`, no prototype names. */
25
+ declare function assertId(id: unknown, what: string): void;
26
+
27
+ declare function nowOf(now?: string): string;
28
+ interface CreateStateInput {
29
+ methodology: MethodologyName;
30
+ config: unknown;
31
+ stages: Stage[];
32
+ roles: Role[];
33
+ now?: string;
34
+ }
35
+ declare function createState(input: CreateStateInput): WorkflowState;
36
+ declare function appendEvent(state: WorkflowState, type: string, by: string, payload: unknown, now?: string): WorkflowState;
37
+ declare function lastEvent(state: WorkflowState, type?: string): Event | undefined;
38
+
39
+ declare function registerRole(state: WorkflowState, role: Role, by: string, now?: string): WorkflowState;
40
+ declare function retireRole(state: WorkflowState, roleId: string, by: string, now?: string): WorkflowState;
41
+ declare function hasCapability(role: Role, cap: Capability): boolean;
42
+ declare function rolesWith(state: WorkflowState, cap: Capability): Role[];
43
+ declare function approversFor(state: WorkflowState, gateId: string): Role[];
44
+ declare function requireCapabilities(state: WorkflowState, required: Capability[], exclusive: Capability[]): void;
45
+ declare function separationLost(state: WorkflowState, required: Capability[]): Role[];
46
+
47
+ declare function stageOf(state: WorkflowState, stageId: string): Stage;
48
+ declare function nextStageOf(state: WorkflowState, stageId: string): Stage | undefined;
49
+ declare function isTerminalStage(state: WorkflowState, stageId: string): boolean;
50
+ declare function getItem(state: WorkflowState, id: string): WorkItem;
51
+ declare function addItem(state: WorkflowState, input: NewItem, by: string, now?: string): WorkflowState;
52
+ type ItemPatch = Partial<Omit<WorkItem, "id" | "stage" | "status" | "transitions" | "evidence" | "blockers">>;
53
+ declare function editItem(state: WorkflowState, id: string, patch: ItemPatch, by: string, now?: string): WorkflowState;
54
+ declare function moveItem(state: WorkflowState, id: string, to: {
55
+ stage?: string;
56
+ status: ItemStatus;
57
+ }, by: string, now?: string): WorkflowState;
58
+ declare function addEvidence(state: WorkflowState, id: string, evidence: Omit<Evidence, "at">, now?: string): WorkflowState;
59
+ declare function raiseBlocker(state: WorkflowState, id: string, reason: string, owner: string, by: string, now?: string): WorkflowState;
60
+ declare function clearBlocker(state: WorkflowState, id: string, blockerId: string, by: string, now?: string): WorkflowState;
61
+
62
+ declare function evaluatePolicies(state: WorkflowState, item: WorkItem, policies: Policy[]): Violation[];
63
+ declare function assertPolicies(state: WorkflowState, item: WorkItem, policies: Policy[], context: string): void;
64
+
65
+ type GateResult = {
66
+ outcome: "pass";
67
+ } | {
68
+ outcome: "human";
69
+ } | {
70
+ outcome: "fail";
71
+ violations: Violation[];
72
+ };
73
+ /** Last in_progress dispatch made from a stage that comes STRICTLY BEFORE the item's current stage in `state.stages` order (unknown stage ids count as not-before). */
74
+ declare function lastDispatchBefore(state: WorkflowState, item: WorkItem): Transition | undefined;
75
+ /** Role that did the work the gate guards: the last dispatch made from a stage strictly before the current one (so a reviewer dispatched into the gated stage is not its author); else the last dispatch of any stage; undefined if never dispatched. */
76
+ declare function authorOf(state: WorkflowState, item: WorkItem): string | undefined;
77
+ declare function checkGate(state: WorkflowState, item: WorkItem, gate: Gate, by: string): GateResult;
78
+ declare function raisePending(state: WorkflowState, pending: Omit<PendingHuman, "id" | "raisedAt">, now?: string): WorkflowState;
79
+ declare function decide(state: WorkflowState, pendingId: string, decision: "approve" | "reject", by: string, note: string, now?: string): WorkflowState;
80
+
81
+ declare const ZERO_SPENT: Required<Budget>;
82
+ declare function addSpent(spent: Required<Budget>, acc: Accounting): Required<Budget>;
83
+ declare function remaining(budget: Budget, spent: Required<Budget>): Budget;
84
+ declare function isExhausted(budget: Budget, spent: Required<Budget>): boolean;
85
+ declare function estimateTokens(state: WorkflowState, weight: number | undefined, fallbackPerWeight?: number): number;
86
+
87
+ type NodeData = {
88
+ id: string;
89
+ };
90
+ declare function openIteration(state: WorkflowState): Iteration | undefined;
91
+ declare function assignRole(state: WorkflowState, item: WorkItem): Role;
92
+ declare function resourceCapsFor(state: WorkflowState): Record<string, number>;
93
+ declare function toExNodes(items: WorkItem[], state: WorkflowState): ExNode<NodeData>[];
94
+ interface PlanOptions {
95
+ max?: number;
96
+ now?: string;
97
+ fallbackTokensPerWeight?: number;
98
+ }
99
+ type PlanReason = "no-candidates" | "budget-exhausted" | "wip-full";
100
+ interface PlanResult {
101
+ state: WorkflowState;
102
+ dispatched: WorkItem[];
103
+ reason?: PlanReason;
104
+ }
105
+ declare function plan(state: WorkflowState, methodology: Methodology, opts?: PlanOptions): PlanResult;
106
+
107
+ declare function synthesizeBrief(state: WorkflowState, methodology: Methodology, item: WorkItem): Brief;
108
+ interface NextResult {
109
+ state: WorkflowState;
110
+ briefs: Brief[];
111
+ reason?: PlanReason;
112
+ }
113
+ declare function next(state: WorkflowState, methodology: Methodology, opts?: PlanOptions): NextResult;
114
+
115
+ declare function complete(state: WorkflowState, methodology: Methodology, handoff: Handoff, acc: Accounting, now?: string): ApplyResult;
116
+
117
+ declare function coreRulesFor(methodology: Pick<Methodology, "requiredCapabilities">): Rule[];
118
+
119
+ declare function validateAction(state: WorkflowState, methodology: Methodology, action: Action): Violation[];
120
+ declare function applyAction(state: WorkflowState, methodology: Methodology, action: Action, reduce: (s: WorkflowState) => WorkflowState): ApplyResult;
121
+ interface InitInput<C> {
122
+ methodology: Methodology<C>;
123
+ config: unknown;
124
+ roles?: Role[];
125
+ stages?: Stage[];
126
+ by?: string;
127
+ now?: string;
128
+ }
129
+ declare function init<C>(input: InitInput<C>): ApplyResult;
130
+
131
+ declare const VERSION = "0.1.0-stage";
132
+
133
+ export { Accounting, Action, ApplyResult, Brief, Budget, Capability, ErrorCode, Event, Evidence, Gate, type GateResult, Handoff, type InitInput, type ItemPatch, ItemStatus, Iteration, Methodology, MethodologyName, NewItem, type NextResult, PendingHuman, type PlanOptions, type PlanReason, type PlanResult, Policy, Role, Rule, Stage, Transition, VERSION, Violation, WorkItem, WorkflowError, WorkflowState, ZERO_SPENT, addEvidence, addItem, addSpent, appendEvent, applyAction, approversFor, assertId, assertPolicies, assignRole, authorOf, checkGate, clearBlocker, complete, coreRulesFor, createState, decide, editItem, estimateTokens, evaluatePolicies, fail, getItem, hasCapability, init, isExhausted, isTerminalStage, lastDispatchBefore, lastEvent, moveItem, next, nextStageOf, nowOf, openIteration, plan, raiseBlocker, raisePending, registerRole, remaining, requireCapabilities, resourceCapsFor, retireRole, rolesWith, separationLost, stageOf, synthesizeBrief, toExNodes, validateAction };
@@ -0,0 +1,133 @@
1
+ import { ErrorCode, WorkflowState, MethodologyName, Stage, Role, Event, Capability, WorkItem, Evidence, NewItem, ItemStatus, Policy, Violation, Gate, Transition, PendingHuman, Budget, Accounting, Iteration, Methodology, Brief, Handoff, ApplyResult, Rule, Action } from './types.js';
2
+ export { Baseline, Blocker, Ceremony, CeremonyInput, ClassOfService, CoreTerm, GateRequirement, ItemType, Lesson, LessonChange, ModelTier, Phase, PlannerOptions, Verdict } from './types.js';
3
+ import { ExNode } from 'ex-flow';
4
+
5
+ interface WorkflowErrorExtra {
6
+ items?: string[];
7
+ rule?: string;
8
+ }
9
+ declare class WorkflowError extends Error {
10
+ readonly code: ErrorCode;
11
+ readonly fix: string;
12
+ readonly items?: string[];
13
+ readonly rule?: string;
14
+ constructor(code: ErrorCode, message: string, fix: string, extra?: WorkflowErrorExtra);
15
+ toJSON(): {
16
+ code: ErrorCode;
17
+ message: string;
18
+ fix: string;
19
+ items?: string[];
20
+ rule?: string;
21
+ };
22
+ }
23
+ declare function fail(code: ErrorCode, message: string, fix: string, extra?: WorkflowErrorExtra): never;
24
+ /** Ids become object keys and file names: letters, digits, `.`, `_`, `-`; no `..`, no prototype names. */
25
+ declare function assertId(id: unknown, what: string): void;
26
+
27
+ declare function nowOf(now?: string): string;
28
+ interface CreateStateInput {
29
+ methodology: MethodologyName;
30
+ config: unknown;
31
+ stages: Stage[];
32
+ roles: Role[];
33
+ now?: string;
34
+ }
35
+ declare function createState(input: CreateStateInput): WorkflowState;
36
+ declare function appendEvent(state: WorkflowState, type: string, by: string, payload: unknown, now?: string): WorkflowState;
37
+ declare function lastEvent(state: WorkflowState, type?: string): Event | undefined;
38
+
39
+ declare function registerRole(state: WorkflowState, role: Role, by: string, now?: string): WorkflowState;
40
+ declare function retireRole(state: WorkflowState, roleId: string, by: string, now?: string): WorkflowState;
41
+ declare function hasCapability(role: Role, cap: Capability): boolean;
42
+ declare function rolesWith(state: WorkflowState, cap: Capability): Role[];
43
+ declare function approversFor(state: WorkflowState, gateId: string): Role[];
44
+ declare function requireCapabilities(state: WorkflowState, required: Capability[], exclusive: Capability[]): void;
45
+ declare function separationLost(state: WorkflowState, required: Capability[]): Role[];
46
+
47
+ declare function stageOf(state: WorkflowState, stageId: string): Stage;
48
+ declare function nextStageOf(state: WorkflowState, stageId: string): Stage | undefined;
49
+ declare function isTerminalStage(state: WorkflowState, stageId: string): boolean;
50
+ declare function getItem(state: WorkflowState, id: string): WorkItem;
51
+ declare function addItem(state: WorkflowState, input: NewItem, by: string, now?: string): WorkflowState;
52
+ type ItemPatch = Partial<Omit<WorkItem, "id" | "stage" | "status" | "transitions" | "evidence" | "blockers">>;
53
+ declare function editItem(state: WorkflowState, id: string, patch: ItemPatch, by: string, now?: string): WorkflowState;
54
+ declare function moveItem(state: WorkflowState, id: string, to: {
55
+ stage?: string;
56
+ status: ItemStatus;
57
+ }, by: string, now?: string): WorkflowState;
58
+ declare function addEvidence(state: WorkflowState, id: string, evidence: Omit<Evidence, "at">, now?: string): WorkflowState;
59
+ declare function raiseBlocker(state: WorkflowState, id: string, reason: string, owner: string, by: string, now?: string): WorkflowState;
60
+ declare function clearBlocker(state: WorkflowState, id: string, blockerId: string, by: string, now?: string): WorkflowState;
61
+
62
+ declare function evaluatePolicies(state: WorkflowState, item: WorkItem, policies: Policy[]): Violation[];
63
+ declare function assertPolicies(state: WorkflowState, item: WorkItem, policies: Policy[], context: string): void;
64
+
65
+ type GateResult = {
66
+ outcome: "pass";
67
+ } | {
68
+ outcome: "human";
69
+ } | {
70
+ outcome: "fail";
71
+ violations: Violation[];
72
+ };
73
+ /** Last in_progress dispatch made from a stage that comes STRICTLY BEFORE the item's current stage in `state.stages` order (unknown stage ids count as not-before). */
74
+ declare function lastDispatchBefore(state: WorkflowState, item: WorkItem): Transition | undefined;
75
+ /** Role that did the work the gate guards: the last dispatch made from a stage strictly before the current one (so a reviewer dispatched into the gated stage is not its author); else the last dispatch of any stage; undefined if never dispatched. */
76
+ declare function authorOf(state: WorkflowState, item: WorkItem): string | undefined;
77
+ declare function checkGate(state: WorkflowState, item: WorkItem, gate: Gate, by: string): GateResult;
78
+ declare function raisePending(state: WorkflowState, pending: Omit<PendingHuman, "id" | "raisedAt">, now?: string): WorkflowState;
79
+ declare function decide(state: WorkflowState, pendingId: string, decision: "approve" | "reject", by: string, note: string, now?: string): WorkflowState;
80
+
81
+ declare const ZERO_SPENT: Required<Budget>;
82
+ declare function addSpent(spent: Required<Budget>, acc: Accounting): Required<Budget>;
83
+ declare function remaining(budget: Budget, spent: Required<Budget>): Budget;
84
+ declare function isExhausted(budget: Budget, spent: Required<Budget>): boolean;
85
+ declare function estimateTokens(state: WorkflowState, weight: number | undefined, fallbackPerWeight?: number): number;
86
+
87
+ type NodeData = {
88
+ id: string;
89
+ };
90
+ declare function openIteration(state: WorkflowState): Iteration | undefined;
91
+ declare function assignRole(state: WorkflowState, item: WorkItem): Role;
92
+ declare function resourceCapsFor(state: WorkflowState): Record<string, number>;
93
+ declare function toExNodes(items: WorkItem[], state: WorkflowState): ExNode<NodeData>[];
94
+ interface PlanOptions {
95
+ max?: number;
96
+ now?: string;
97
+ fallbackTokensPerWeight?: number;
98
+ }
99
+ type PlanReason = "no-candidates" | "budget-exhausted" | "wip-full";
100
+ interface PlanResult {
101
+ state: WorkflowState;
102
+ dispatched: WorkItem[];
103
+ reason?: PlanReason;
104
+ }
105
+ declare function plan(state: WorkflowState, methodology: Methodology, opts?: PlanOptions): PlanResult;
106
+
107
+ declare function synthesizeBrief(state: WorkflowState, methodology: Methodology, item: WorkItem): Brief;
108
+ interface NextResult {
109
+ state: WorkflowState;
110
+ briefs: Brief[];
111
+ reason?: PlanReason;
112
+ }
113
+ declare function next(state: WorkflowState, methodology: Methodology, opts?: PlanOptions): NextResult;
114
+
115
+ declare function complete(state: WorkflowState, methodology: Methodology, handoff: Handoff, acc: Accounting, now?: string): ApplyResult;
116
+
117
+ declare function coreRulesFor(methodology: Pick<Methodology, "requiredCapabilities">): Rule[];
118
+
119
+ declare function validateAction(state: WorkflowState, methodology: Methodology, action: Action): Violation[];
120
+ declare function applyAction(state: WorkflowState, methodology: Methodology, action: Action, reduce: (s: WorkflowState) => WorkflowState): ApplyResult;
121
+ interface InitInput<C> {
122
+ methodology: Methodology<C>;
123
+ config: unknown;
124
+ roles?: Role[];
125
+ stages?: Stage[];
126
+ by?: string;
127
+ now?: string;
128
+ }
129
+ declare function init<C>(input: InitInput<C>): ApplyResult;
130
+
131
+ declare const VERSION = "0.1.0-stage";
132
+
133
+ export { Accounting, Action, ApplyResult, Brief, Budget, Capability, ErrorCode, Event, Evidence, Gate, type GateResult, Handoff, type InitInput, type ItemPatch, ItemStatus, Iteration, Methodology, MethodologyName, NewItem, type NextResult, PendingHuman, type PlanOptions, type PlanReason, type PlanResult, Policy, Role, Rule, Stage, Transition, VERSION, Violation, WorkItem, WorkflowError, WorkflowState, ZERO_SPENT, addEvidence, addItem, addSpent, appendEvent, applyAction, approversFor, assertId, assertPolicies, assignRole, authorOf, checkGate, clearBlocker, complete, coreRulesFor, createState, decide, editItem, estimateTokens, evaluatePolicies, fail, getItem, hasCapability, init, isExhausted, isTerminalStage, lastDispatchBefore, lastEvent, moveItem, next, nextStageOf, nowOf, openIteration, plan, raiseBlocker, raisePending, registerRole, remaining, requireCapabilities, resourceCapsFor, retireRole, rolesWith, separationLost, stageOf, synthesizeBrief, toExNodes, validateAction };
package/dist/index.mjs ADDED
@@ -0,0 +1,2 @@
1
+ import'./chunk-KIQOUUEZ.mjs';export{c as complete,b as next,a as synthesizeBrief}from'./chunk-B7MP6Y3W.mjs';export{I as ZERO_SPENT,w as addEvidence,t as addItem,J as addSpent,c as appendEvent,U as applyAction,k as approversFor,C as assertPolicies,O as assignRole,E as authorOf,F as checkGate,y as clearBlocker,S as coreRulesFor,b as createState,H as decide,u as editItem,M as estimateTokens,B as evaluatePolicies,s as getItem,h as hasCapability,V as init,L as isExhausted,p as isTerminalStage,D as lastDispatchBefore,d as lastEvent,v as moveItem,o as nextStageOf,a as nowOf,N as openIteration,R as plan,x as raiseBlocker,G as raisePending,f as registerRole,K as remaining,l as requireCapabilities,P as resourceCapsFor,g as retireRole,i as rolesWith,m as separationLost,n as stageOf,Q as toExNodes,T as validateAction}from'./chunk-D7U3ES2L.mjs';export{a as WorkflowError,c as assertId,b as fail}from'./chunk-2FRRD6A3.mjs';var M="0.1.0-stage";export{M as VERSION};//# sourceMappingURL=index.mjs.map
2
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts"],"names":["VERSION"],"mappings":"y5BAAO,IAAMA,CAAAA,CAAU","file":"index.mjs","sourcesContent":["export const VERSION = \"0.1.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} 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 } 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"]}
@@ -0,0 +1,2 @@
1
+ 'use strict';var chunkLPQSNYYT_cjs=require('../chunk-LPQSNYYT.cjs');require('../chunk-5XAKW64K.cjs'),require('../chunk-S3BXVHO7.cjs');Object.defineProperty(exports,"SCRUM_VOCABULARY",{enumerable:true,get:function(){return chunkLPQSNYYT_cjs.i}});Object.defineProperty(exports,"canDo",{enumerable:true,get:function(){return chunkLPQSNYYT_cjs.a}});Object.defineProperty(exports,"closeSprint",{enumerable:true,get:function(){return chunkLPQSNYYT_cjs.k}});Object.defineProperty(exports,"configOf",{enumerable:true,get:function(){return chunkLPQSNYYT_cjs.j}});Object.defineProperty(exports,"dailyReport",{enumerable:true,get:function(){return chunkLPQSNYYT_cjs.b}});Object.defineProperty(exports,"scrum",{enumerable:true,get:function(){return chunkLPQSNYYT_cjs.l}});Object.defineProperty(exports,"scrumCeremonies",{enumerable:true,get:function(){return chunkLPQSNYYT_cjs.c}});Object.defineProperty(exports,"scrumMetrics",{enumerable:true,get:function(){return chunkLPQSNYYT_cjs.e}});Object.defineProperty(exports,"scrumRoles",{enumerable:true,get:function(){return chunkLPQSNYYT_cjs.f}});Object.defineProperty(exports,"scrumRules",{enumerable:true,get:function(){return chunkLPQSNYYT_cjs.g}});Object.defineProperty(exports,"scrumStages",{enumerable:true,get:function(){return chunkLPQSNYYT_cjs.h}});Object.defineProperty(exports,"validateScrumConfig",{enumerable:true,get:function(){return chunkLPQSNYYT_cjs.d}});//# sourceMappingURL=index.cjs.map
2
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.cjs"}
@@ -0,0 +1,59 @@
1
+ import { Budget, Policy, WorkflowState, Role, Rule, Stage, ItemStatus, Capability, Methodology, Ceremony, CoreTerm } from '../types.cjs';
2
+
3
+ interface ScrumConfig {
4
+ sprintBudget: Budget;
5
+ productGoal: string;
6
+ definitionOfDone: Policy[];
7
+ refinementSharePct: number;
8
+ allowMidSprintAdd: "never" | "po-only" | "any";
9
+ inProgressWipLimit?: number;
10
+ }
11
+ declare function validateScrumConfig(raw: unknown): ScrumConfig;
12
+
13
+ interface ScrumMetrics {
14
+ velocity: number[];
15
+ meanVelocity: number;
16
+ burndown: number[];
17
+ commitmentReliability: number;
18
+ sprintGoalHitRate: number;
19
+ carryoverRatio: number;
20
+ budgetUtilisation: number;
21
+ costPerPoint: number;
22
+ }
23
+ declare function scrumMetrics(state: WorkflowState): ScrumMetrics;
24
+
25
+ declare function scrumRoles(): Role[];
26
+
27
+ declare function scrumRules(): Rule[];
28
+
29
+ declare function scrumStages(config: ScrumConfig): Stage[];
30
+
31
+ declare function canDo(state: WorkflowState, by: string, ...caps: Capability[]): boolean;
32
+ interface DailyReport {
33
+ sprint: string | null;
34
+ goal: string | null;
35
+ byStatus: Record<ItemStatus, number>;
36
+ blockers: Array<{
37
+ item: string;
38
+ blocker: string;
39
+ owner: string;
40
+ reason: string;
41
+ }>;
42
+ spent: Required<Budget>;
43
+ remaining: Budget;
44
+ remainingWeight: number;
45
+ raisedLessons: number;
46
+ velocity: number | null;
47
+ forecast: "on-track" | "at-risk" | "unknown";
48
+ }
49
+ declare function dailyReport(state: WorkflowState): DailyReport;
50
+ declare function scrumCeremonies(methodology: () => Methodology): Record<string, Ceremony>;
51
+
52
+ declare const SCRUM_VOCABULARY: Record<CoreTerm, string>;
53
+ /** Advanced; used by ceremonies. */
54
+ declare function configOf(state: WorkflowState): ScrumConfig;
55
+ /** Advanced; used by ceremonies. Closes the open sprint and returns unfinished work (and its open questions) to the backlog. */
56
+ declare function closeSprint(state: WorkflowState, reason: "budget" | "review" | "cancel", now: string): WorkflowState;
57
+ declare function scrum(): Methodology<ScrumConfig>;
58
+
59
+ export { type DailyReport, SCRUM_VOCABULARY, type ScrumConfig, type ScrumMetrics, canDo, closeSprint, configOf, dailyReport, scrum, scrumCeremonies, scrumMetrics, scrumRoles, scrumRules, scrumStages, validateScrumConfig };
@@ -0,0 +1,59 @@
1
+ import { Budget, Policy, WorkflowState, Role, Rule, Stage, ItemStatus, Capability, Methodology, Ceremony, CoreTerm } from '../types.js';
2
+
3
+ interface ScrumConfig {
4
+ sprintBudget: Budget;
5
+ productGoal: string;
6
+ definitionOfDone: Policy[];
7
+ refinementSharePct: number;
8
+ allowMidSprintAdd: "never" | "po-only" | "any";
9
+ inProgressWipLimit?: number;
10
+ }
11
+ declare function validateScrumConfig(raw: unknown): ScrumConfig;
12
+
13
+ interface ScrumMetrics {
14
+ velocity: number[];
15
+ meanVelocity: number;
16
+ burndown: number[];
17
+ commitmentReliability: number;
18
+ sprintGoalHitRate: number;
19
+ carryoverRatio: number;
20
+ budgetUtilisation: number;
21
+ costPerPoint: number;
22
+ }
23
+ declare function scrumMetrics(state: WorkflowState): ScrumMetrics;
24
+
25
+ declare function scrumRoles(): Role[];
26
+
27
+ declare function scrumRules(): Rule[];
28
+
29
+ declare function scrumStages(config: ScrumConfig): Stage[];
30
+
31
+ declare function canDo(state: WorkflowState, by: string, ...caps: Capability[]): boolean;
32
+ interface DailyReport {
33
+ sprint: string | null;
34
+ goal: string | null;
35
+ byStatus: Record<ItemStatus, number>;
36
+ blockers: Array<{
37
+ item: string;
38
+ blocker: string;
39
+ owner: string;
40
+ reason: string;
41
+ }>;
42
+ spent: Required<Budget>;
43
+ remaining: Budget;
44
+ remainingWeight: number;
45
+ raisedLessons: number;
46
+ velocity: number | null;
47
+ forecast: "on-track" | "at-risk" | "unknown";
48
+ }
49
+ declare function dailyReport(state: WorkflowState): DailyReport;
50
+ declare function scrumCeremonies(methodology: () => Methodology): Record<string, Ceremony>;
51
+
52
+ declare const SCRUM_VOCABULARY: Record<CoreTerm, string>;
53
+ /** Advanced; used by ceremonies. */
54
+ declare function configOf(state: WorkflowState): ScrumConfig;
55
+ /** Advanced; used by ceremonies. Closes the open sprint and returns unfinished work (and its open questions) to the backlog. */
56
+ declare function closeSprint(state: WorkflowState, reason: "budget" | "review" | "cancel", now: string): WorkflowState;
57
+ declare function scrum(): Methodology<ScrumConfig>;
58
+
59
+ export { type DailyReport, SCRUM_VOCABULARY, type ScrumConfig, type ScrumMetrics, canDo, closeSprint, configOf, dailyReport, scrum, scrumCeremonies, scrumMetrics, scrumRoles, scrumRules, scrumStages, validateScrumConfig };
@@ -0,0 +1,2 @@
1
+ export{i as SCRUM_VOCABULARY,a as canDo,k as closeSprint,j as configOf,b as dailyReport,l as scrum,c as scrumCeremonies,e as scrumMetrics,f as scrumRoles,g as scrumRules,h as scrumStages,d as validateScrumConfig}from'../chunk-ROH3RYBI.mjs';import'../chunk-D7U3ES2L.mjs';import'../chunk-2FRRD6A3.mjs';//# sourceMappingURL=index.mjs.map
2
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.mjs"}
package/dist/types.cjs ADDED
@@ -0,0 +1,2 @@
1
+ 'use strict';require('./chunk-PO2SPQJP.cjs');//# sourceMappingURL=types.cjs.map
2
+ //# sourceMappingURL=types.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"types.cjs"}