@rasensio/aidlc 1.9.0 → 1.10.1

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 (63) hide show
  1. package/README.md +2 -0
  2. package/dist/cli.d.ts +18 -1
  3. package/dist/cli.d.ts.map +1 -1
  4. package/dist/cli.js +76 -26
  5. package/dist/cli.js.map +1 -1
  6. package/dist/commands/claim.d.ts +9 -0
  7. package/dist/commands/claim.d.ts.map +1 -1
  8. package/dist/commands/claim.js +26 -4
  9. package/dist/commands/claim.js.map +1 -1
  10. package/dist/commands/cost.d.ts.map +1 -1
  11. package/dist/commands/cost.js +3 -5
  12. package/dist/commands/cost.js.map +1 -1
  13. package/dist/commands/menu.d.ts +21 -0
  14. package/dist/commands/menu.d.ts.map +1 -0
  15. package/dist/commands/menu.js +32 -0
  16. package/dist/commands/menu.js.map +1 -0
  17. package/dist/concurrency/session-id.d.ts +12 -0
  18. package/dist/concurrency/session-id.d.ts.map +1 -1
  19. package/dist/concurrency/session-id.js +24 -4
  20. package/dist/concurrency/session-id.js.map +1 -1
  21. package/dist/cost/agent.d.ts +48 -0
  22. package/dist/cost/agent.d.ts.map +1 -0
  23. package/dist/cost/agent.js +167 -0
  24. package/dist/cost/agent.js.map +1 -0
  25. package/dist/cost/providers/index.d.ts +13 -0
  26. package/dist/cost/providers/index.d.ts.map +1 -0
  27. package/dist/cost/providers/index.js +23 -0
  28. package/dist/cost/providers/index.js.map +1 -0
  29. package/dist/cost/sync.d.ts.map +1 -1
  30. package/dist/cost/sync.js +114 -37
  31. package/dist/cost/sync.js.map +1 -1
  32. package/dist/doctor/migrations/index.d.ts.map +1 -1
  33. package/dist/doctor/migrations/index.js +2 -0
  34. package/dist/doctor/migrations/index.js.map +1 -1
  35. package/dist/doctor/migrations/unknown-agent-claims.d.ts +25 -0
  36. package/dist/doctor/migrations/unknown-agent-claims.d.ts.map +1 -0
  37. package/dist/doctor/migrations/unknown-agent-claims.js +82 -0
  38. package/dist/doctor/migrations/unknown-agent-claims.js.map +1 -0
  39. package/dist/menu/dispatch.d.ts +59 -0
  40. package/dist/menu/dispatch.d.ts.map +1 -0
  41. package/dist/menu/dispatch.js +76 -0
  42. package/dist/menu/dispatch.js.map +1 -0
  43. package/dist/menu/index.d.ts +51 -0
  44. package/dist/menu/index.d.ts.map +1 -0
  45. package/dist/menu/index.js +117 -0
  46. package/dist/menu/index.js.map +1 -0
  47. package/dist/menu/invocation.d.ts +20 -0
  48. package/dist/menu/invocation.d.ts.map +1 -0
  49. package/dist/menu/invocation.js +22 -0
  50. package/dist/menu/invocation.js.map +1 -0
  51. package/dist/menu/prompt.d.ts +74 -0
  52. package/dist/menu/prompt.d.ts.map +1 -0
  53. package/dist/menu/prompt.js +71 -0
  54. package/dist/menu/prompt.js.map +1 -0
  55. package/dist/menu/resolve.d.ts +57 -0
  56. package/dist/menu/resolve.d.ts.map +1 -0
  57. package/dist/menu/resolve.js +76 -0
  58. package/dist/menu/resolve.js.map +1 -0
  59. package/dist/menu/roster.d.ts +51 -0
  60. package/dist/menu/roster.d.ts.map +1 -0
  61. package/dist/menu/roster.js +65 -0
  62. package/dist/menu/roster.js.map +1 -0
  63. package/package.json +2 -2
@@ -0,0 +1,76 @@
1
+ /**
2
+ * Roster → commander resolution (interactive-cli-menu/AC-16,
3
+ * interactive-cli-menu/AC-17, interactive-cli-menu/AC-34).
4
+ *
5
+ * Pure functions over a commander program. Required positionals are derived
6
+ * structurally from `registeredArguments` rather than restated in the roster, so
7
+ * the prompt set cannot go stale when a command's signature changes.
8
+ *
9
+ * @module
10
+ */
11
+ import { EXCLUSIONS, ROSTER } from './roster.js';
12
+ /**
13
+ * Walk an entry's path from the program root to its leaf command.
14
+ *
15
+ * @returns the leaf `Command`, or `null` if any segment is unregistered.
16
+ */
17
+ export function resolveEntry(program, entry) {
18
+ let current = program;
19
+ for (const segment of entry.path) {
20
+ const next = current.commands.find((child) => child.name() === segment);
21
+ if (!next)
22
+ return null;
23
+ current = next;
24
+ }
25
+ return current === program ? null : current;
26
+ }
27
+ /**
28
+ * Required positional arguments of a command, in declaration order
29
+ * (interactive-cli-menu/AC-34).
30
+ *
31
+ * `registeredArguments` is public commander API. Across the roster only
32
+ * `review <instance> <artifact>` and `knowledge query <term>` have any.
33
+ */
34
+ export function requiredArgs(cmd) {
35
+ return cmd.registeredArguments.filter((arg) => arg.required);
36
+ }
37
+ /**
38
+ * Secondary hint text for an entry: the leaf command's own description
39
+ * (interactive-cli-menu/AC-16). Never used as the label.
40
+ */
41
+ export function hintFor(cmd) {
42
+ return cmd.description();
43
+ }
44
+ /**
45
+ * Top-level command names on the program.
46
+ *
47
+ * Deliberately performs no hidden-command *detection*: `program.commands`
48
+ * already contains hidden commands (verified with the deprecated `setup`
49
+ * alias), `Command` exposes no public `hidden` accessor — the `hidden: boolean`
50
+ * in commander's typings belongs to `Option` — and the private `_hidden` must
51
+ * not be relied on. Commander's synthetic `help` command is absent from
52
+ * `program.commands` and needs no entry.
53
+ */
54
+ export function allTopLevelNames(program) {
55
+ return program.commands.map((cmd) => cmd.name());
56
+ }
57
+ /**
58
+ * Top-level names the roster accounts for — first path segments only.
59
+ *
60
+ * A nested entry such as `['knowledge','query']` accounts for nothing beyond
61
+ * `knowledge`'s appearance as a *rostered* name, which is why `knowledge` is
62
+ * also carried in `EXCLUSIONS`: the parent itself is not on the menu.
63
+ */
64
+ export function rosterTopLevelNames(roster = ROSTER) {
65
+ return roster.map((entry) => entry.path[0]);
66
+ }
67
+ /**
68
+ * Top-level commands accounted for by neither the roster nor the exclusion list
69
+ * (interactive-cli-menu/AC-17). A non-empty result is a contract violation: a
70
+ * command was registered and nobody decided whether it belongs on the menu.
71
+ */
72
+ export function unaccountedCommands(program, roster = ROSTER, exclusions = EXCLUSIONS) {
73
+ const rostered = new Set(roster.filter((entry) => entry.path.length === 1).map((entry) => entry.path[0]));
74
+ return allTopLevelNames(program).filter((name) => !rostered.has(name) && !(name in exclusions));
75
+ }
76
+ //# sourceMapp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,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAE,CAAC,CAAC;AAC/C,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,mBAAmB,CACjC,OAAgB,EAChB,SAA+B,MAAM,EACrC,aAA+C,UAAU;IAEzD,MAAM,QAAQ,GAAG,IAAI,GAAG,CACtB,MAAM,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAE,CAAC,CACjF,CAAC;IACF,OAAO,gBAAgB,CAAC,OAAO,CAAC,CAAC,MAAM,CACrC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,IAAI,UAAU,CAAC,CACvD,CAAC;AACJ,CAAC"}
@@ -0,0 +1,51 @@
1
+ /**
2
+ * The menu roster — the single declaration site for what the menu offers
3
+ * (interactive-cli-menu/AC-32, interactive-cli-menu/AC-33,
4
+ * interactive-cli-menu/AC-15, interactive-cli-menu/AC-16).
5
+ *
6
+ * Data only, no logic. Two properties are pinned by tests rather than by
7
+ * convention: array order IS display order, and every top-level command on the
8
+ * program appears in exactly one of `ROSTER` (by first path segment) or
9
+ * `EXCLUSIONS`.
10
+ *
11
+ * Labels are curated here rather than read from commander. Several
12
+ * `.description()` strings read poorly as menu labels — `doctor`'s is 76
13
+ * characters, and `add`/`knowledge` describe a group rather than an action — so
14
+ * descriptions serve as secondary hint text only.
15
+ *
16
+ * @module
17
+ */
18
+ /** Lifecycle stage an entry belongs to; drives visual grouping only. */
19
+ export type MenuBucket = 'setup' | 'begin' | 'resume' | 'inspect' | 'maintain';
20
+ export interface MenuEntry {
21
+ /** Command path from the program root: `['start']`, `['knowledge','query']`. */
22
+ readonly path: readonly string[];
23
+ /** Curated label — never commander's `.description()`. */
24
+ readonly label: string;
25
+ readonly bucket: MenuBucket;
26
+ /**
27
+ * Skip menu-side prompting for required positionals and let the command run
28
+ * its own wizard. `start` only (interactive-cli-menu/AC-35).
29
+ */
30
+ readonly delegatesArgs?: true;
31
+ }
32
+ /**
33
+ * The 12 menu entries, in display order: setup → begin → resume → inspect →
34
+ * maintain (interactive-cli-menu/AC-32).
35
+ */
36
+ export declare const ROSTER: readonly MenuEntry[];
37
+ /**
38
+ * Every top-level command deliberately kept out of the menu, with its reason
39
+ * (interactive-cli-menu/AC-33). Excluded commands stay fully usable by typing
40
+ * them; there is no "more" entry.
41
+ *
42
+ * The exclusion criterion is **not** whether a command is a group — it is
43
+ * whether its bare invocation does something useful. `cost` is a group *and* a
44
+ * useful bare report, so it is rostered. `knowledge` must be listed even though
45
+ * `knowledge query` is rostered, because the contract test compares top-level
46
+ * names and `knowledge` is one.
47
+ */
48
+ export declare const EXCLUSIONS: Readonly<Record<string, string>>;
49
+ /** Bucket order for grouping; matches the order entries appear in `ROSTER`. */
50
+ export declare const BUCKET_ORDER: readonly MenuBucket[];
51
+ //# sourceMappingURL=roster.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"roster.d.ts","sourceRoot":"","sources":["../../src/menu/roster.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,wEAAwE;AACxE,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG,OAAO,GAAG,QAAQ,GAAG,SAAS,GAAG,UAAU,CAAC;AAE/E,MAAM,WAAW,SAAS;IACxB,gFAAgF;IAChF,QAAQ,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,CAAC;IACjC,0DAA0D;IAC1D,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAC;IAC5B;;;OAGG;IACH,QAAQ,CAAC,aAAa,CAAC,EAAE,IAAI,CAAC;CAC/B;AAED;;;GAGG;AACH,eAAO,MAAM,MAAM,EAAE,SAAS,SAAS,EAatC,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,UAAU,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAUvD,CAAC;AAEF,+EAA+E;AAC/E,eAAO,MAAM,YAAY,EAAE,SAAS,UAAU,EAM7C,CAAC"}
@@ -0,0 +1,65 @@
1
+ /**
2
+ * The menu roster — the single declaration site for what the menu offers
3
+ * (interactive-cli-menu/AC-32, interactive-cli-menu/AC-33,
4
+ * interactive-cli-menu/AC-15, interactive-cli-menu/AC-16).
5
+ *
6
+ * Data only, no logic. Two properties are pinned by tests rather than by
7
+ * convention: array order IS display order, and every top-level command on the
8
+ * program appears in exactly one of `ROSTER` (by first path segment) or
9
+ * `EXCLUSIONS`.
10
+ *
11
+ * Labels are curated here rather than read from commander. Several
12
+ * `.description()` strings read poorly as menu labels — `doctor`'s is 76
13
+ * characters, and `add`/`knowledge` describe a group rather than an action — so
14
+ * descriptions serve as secondary hint text only.
15
+ *
16
+ * @module
17
+ */
18
+ /**
19
+ * The 12 menu entries, in display order: setup → begin → resume → inspect →
20
+ * maintain (interactive-cli-menu/AC-32).
21
+ */
22
+ export const ROSTER = [
23
+ { path: ['init'], bucket: 'setup', label: 'Set up AIDLC in this project' },
24
+ { path: ['doctor'], bucket: 'setup', label: 'Run health checks' },
25
+ { path: ['update'], bucket: 'setup', label: 'Update AIDLC' },
26
+ { path: ['start'], bucket: 'begin', label: 'Begin new work', delegatesArgs: true },
27
+ { path: ['discover'], bucket: 'begin', label: 'Explore the codebase' },
28
+ { path: ['continue'], bucket: 'resume', label: 'Resume work' },
29
+ { path: ['status'], bucket: 'inspect', label: 'Show progress' },
30
+ { path: ['cost'], bucket: 'inspect', label: 'Cost report' },
31
+ { path: ['metrics'], bucket: 'inspect', label: 'Project metrics' },
32
+ { path: ['knowledge', 'query'], bucket: 'inspect', label: 'Search project knowledge' },
33
+ { path: ['review'], bucket: 'inspect', label: 'Review an artifact' },
34
+ { path: ['docs'], bucket: 'maintain', label: 'Generate onboarding docs' },
35
+ ];
36
+ /**
37
+ * Every top-level command deliberately kept out of the menu, with its reason
38
+ * (interactive-cli-menu/AC-33). Excluded commands stay fully usable by typing
39
+ * them; there is no "more" entry.
40
+ *
41
+ * The exclusion criterion is **not** whether a command is a group — it is
42
+ * whether its bare invocation does something useful. `cost` is a group *and* a
43
+ * useful bare report, so it is rostered. `knowledge` must be listed even though
44
+ * `knowledge query` is rostered, because the contract test compares top-level
45
+ * names and `knowledge` is one.
46
+ */
47
+ export const EXCLUSIONS = {
48
+ gate: 'CI/automation surface — consumed by scripts, not people',
49
+ transition: 'CI/automation surface; the phase skills drive it',
50
+ claim: 'session plumbing, not a user task',
51
+ release: 'session plumbing, not a user task',
52
+ add: 'bare `aidlc add` exits 1 with help on stderr — no useful bare form',
53
+ knowledge: 'bare `aidlc knowledge` exits 1; its useful leaf `knowledge query` is a roster entry',
54
+ setup: 'hidden deprecated alias of `init`',
55
+ menu: 'itself',
56
+ };
57
+ /** Bucket order for grouping; matches the order entries appear in `ROSTER`. */
58
+ export const BUCKET_ORDER = [
59
+ 'setup',
60
+ 'begin',
61
+ 'resume',
62
+ 'inspect',
63
+ 'maintain',
64
+ ];
65
+ //# sourceMappingURL=roster.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"roster.js","sourceRoot":"","sources":["../../src/menu/roster.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAkBH;;;GAGG;AACH,MAAM,CAAC,MAAM,MAAM,GAAyB;IAC1C,EAAE,IAAI,EAAE,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,8BAA8B,EAAE;IAC1E,EAAE,IAAI,EAAE,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,mBAAmB,EAAE;IACjE,EAAE,IAAI,EAAE,CA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IACvF,KAAK,EAAE,mCAAmC;IAC1C,IAAI,EAAE,QAAQ;CACf,CAAC;AAEF,+EAA+E;AAC/E,MAAM,CAAC,MAAM,YAAY,GAA0B;IACjD,OAAO;IACP,OAAO;IACP,QAAQ;IACR,SAAS;IACT,UAAU;CACX,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rasensio/aidlc",
3
- "version": "1.9.0",
3
+ "version": "1.10.1",
4
4
  "description": "AI Development Lifecycle Framework — structured lifecycle guidance for AI coding agents across platforms",
5
5
  "type": "module",
6
6
  "main": "dist/cli.js",
@@ -24,7 +24,7 @@
24
24
  "commander": "15.0.0",
25
25
  "picomatch": "4.0.5",
26
26
  "yaml": "2.9.0",
27
- "@rasensio/aidlc-content": "1.9.0"
27
+ "@rasensio/aidlc-content": "1.10.1"
28
28
  },
29
29
  "devDependencies": {
30
30
  "@types/node": "22.15.32",