@rasensio/aidlc 1.10.5 → 1.10.8

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 (66) hide show
  1. package/dist/commands/cost.d.ts.map +1 -1
  2. package/dist/commands/cost.js +35 -9
  3. package/dist/commands/cost.js.map +1 -1
  4. package/dist/commands/init.d.ts.map +1 -1
  5. package/dist/commands/init.js +69 -29
  6. package/dist/commands/init.js.map +1 -1
  7. package/dist/commands/status.d.ts.map +1 -1
  8. package/dist/commands/status.js +22 -1
  9. package/dist/commands/status.js.map +1 -1
  10. package/dist/commands/update.d.ts.map +1 -1
  11. package/dist/commands/update.js +37 -10
  12. package/dist/commands/update.js.map +1 -1
  13. package/dist/compile/guidance-install.d.ts +51 -0
  14. package/dist/compile/guidance-install.d.ts.map +1 -0
  15. package/dist/compile/guidance-install.js +155 -0
  16. package/dist/compile/guidance-install.js.map +1 -0
  17. package/dist/compile/loaders.d.ts +36 -6
  18. package/dist/compile/loaders.d.ts.map +1 -1
  19. package/dist/compile/loaders.js +120 -17
  20. package/dist/compile/loaders.js.map +1 -1
  21. package/dist/concurrency/gitattributes.d.ts.map +1 -1
  22. package/dist/concurrency/gitattributes.js +10 -0
  23. package/dist/concurrency/gitattributes.js.map +1 -1
  24. package/dist/core/types.d.ts +7 -0
  25. package/dist/core/types.d.ts.map +1 -1
  26. package/dist/cost/agent.d.ts.map +1 -1
  27. package/dist/cost/agent.js +30 -2
  28. package/dist/cost/agent.js.map +1 -1
  29. package/dist/cost/hooks/claude-code.d.ts +38 -5
  30. package/dist/cost/hooks/claude-code.d.ts.map +1 -1
  31. package/dist/cost/hooks/claude-code.js +38 -13
  32. package/dist/cost/hooks/claude-code.js.map +1 -1
  33. package/dist/cost/hooks/entry.d.ts +14 -0
  34. package/dist/cost/hooks/entry.d.ts.map +1 -0
  35. package/dist/cost/hooks/entry.js +18 -0
  36. package/dist/cost/hooks/entry.js.map +1 -0
  37. package/dist/cost/hooks/kiro.d.ts +16 -4
  38. package/dist/cost/hooks/kiro.d.ts.map +1 -1
  39. package/dist/cost/hooks/kiro.js +21 -9
  40. package/dist/cost/hooks/kiro.js.map +1 -1
  41. package/dist/cost/hooks/shim.d.ts +54 -0
  42. package/dist/cost/hooks/shim.d.ts.map +1 -0
  43. package/dist/cost/hooks/shim.js +170 -0
  44. package/dist/cost/hooks/shim.js.map +1 -0
  45. package/dist/cost/recorder.d.ts +22 -0
  46. package/dist/cost/recorder.d.ts.map +1 -1
  47. package/dist/cost/recorder.js +44 -0
  48. package/dist/cost/recorder.js.map +1 -1
  49. package/dist/cost/report.d.ts.map +1 -1
  50. package/dist/cost/report.js +12 -2
  51. package/dist/cost/report.js.map +1 -1
  52. package/dist/doctor/migrations/cost-gitignore.d.ts.map +1 -1
  53. package/dist/doctor/migrations/cost-gitignore.js +15 -1
  54. package/dist/doctor/migrations/cost-gitignore.js.map +1 -1
  55. package/dist/doctor/migrations/index.d.ts.map +1 -1
  56. package/dist/doctor/migrations/index.js +4 -0
  57. package/dist/doctor/migrations/index.js.map +1 -1
  58. package/dist/doctor/migrations/install-guidance.d.ts +18 -0
  59. package/dist/doctor/migrations/install-guidance.d.ts.map +1 -0
  60. package/dist/doctor/migrations/install-guidance.js +61 -0
  61. package/dist/doctor/migrations/install-guidance.js.map +1 -0
  62. package/dist/doctor/migrations/legacy-cost-hooks.d.ts +40 -0
  63. package/dist/doctor/migrations/legacy-cost-hooks.d.ts.map +1 -0
  64. package/dist/doctor/migrations/legacy-cost-hooks.js +92 -0
  65. package/dist/doctor/migrations/legacy-cost-hooks.js.map +1 -0
  66. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"cost-gitignore.d.ts","sourceRoot":"","sources":["../../../src/doctor/migrations/cost-gitignore.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAG7C,eAAO,MAAM,iBAAiB,UAA8D,CAAC;AAM7F,eAAO,MAAM,aAAa,EAAE,SAsB3B,CAAC"}
1
+ {"version":3,"file":"cost-gitignore.d.ts","sourceRoot":"","sources":["../../../src/doctor/migrations/cost-gitignore.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAW7C,eAAO,MAAM,iBAAiB,UAM7B,CAAC;AAMF,eAAO,MAAM,aAAa,EAAE,SAsB3B,CAAC"}
@@ -7,7 +7,21 @@
7
7
  */
8
8
  import { join } from 'node:path';
9
9
  import { ensureIgnoreLines, missingIgnoreLines } from './nested-gitignore.js';
10
- export const COST_IGNORE_LINES = ['active-sessions/', 'capture.log', 'locks/', '.gitignore'];
10
+ /*
11
+ * `capture.sh` is generated per-install and its body embeds the node and CLI
12
+ * paths seen at install time as resolution *hints*. Those are machine-specific,
13
+ * so tracking the file would commit exactly the kind of absolute path this
14
+ * project just spent a bugfix removing from hook commands
15
+ * (cost-capture-goes-dark/AC-5). It is regenerated by `aidlc cost hooks install`
16
+ * and by the legacy-cost-hooks doctor migration, so nothing is lost by ignoring it.
17
+ */
18
+ export const COST_IGNORE_LINES = [
19
+ 'active-sessions/',
20
+ 'capture.log',
21
+ 'capture.sh',
22
+ 'locks/',
23
+ '.gitignore',
24
+ ];
11
25
  function ignorePath(projectRoot) {
12
26
  return join(projectRoot, '.aidlc', 'cost', '.gitignore');
13
27
  }
@@ -1 +1 @@
1
- {"version":3,"file":"cost-gitignore.js","sourceRoot":"","sources":["../../../src/doctor/migrations/cost-gitignore.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAE9E,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,kBAAkB,EAAE,aAAa,EAAE,QAAQ,EAAE,YAAY,CAAC,CAAC;AAE7F,S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["../../../src/doctor/migrations/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAY7C,eAAO,MAAM,UAAU,EAAE,SAAS,EAWjC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/doctor/migrations/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAc7C,eAAO,MAAM,UAAU,EAAE,SAAS,EAajC,CAAC"}
@@ -15,16 +15,20 @@ import { pruneCostLocks } from './prune-cost-locks.js';
15
15
  import { pruneCaptureLogMigration } from './prune-capture-log.js';
16
16
  import { pruneRegistry } from './prune-registry.js';
17
17
  import { unknownAgentClaims } from './unknown-agent-claims.js';
18
+ import { legacyCostHooks } from './legacy-cost-hooks.js';
19
+ import { installGuidance } from './install-guidance.js';
18
20
  export const MIGRATIONS = [
19
21
  costGitignore,
20
22
  knowledgeGitignore,
21
23
  gitattributes,
22
24
  shippedActions,
25
+ installGuidance,
23
26
  untrackCostEphemera,
24
27
  pruneSessionStash,
25
28
  pruneCostLocks,
26
29
  pruneCaptureLogMigration,
27
30
  pruneRegistry,
28
31
  unknownAgentClaims,
32
+ legacyCostHooks,
29
33
  ];
30
34
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/doctor/migrations/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE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;IACf,mBAAmB;IACnB,iBAAiB;IACjB,cAAc;IACd,wBAAwB;IACxB,aAAa;IACb,kBAAkB;IAClB,eAAe;CAChB,CAAC"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * install-guidance migration (guidance-layers-never-resolve/AC-2).
3
+ *
4
+ * Projects initialized before guidance installation existed have no
5
+ * `.aidlc/guidance/` at all — or only the layers they authored themselves — so
6
+ * every `{{guidance:<layer>}}` placeholder in their skills has nothing to resolve
7
+ * against. This migration installs the layers the content package ships.
8
+ *
9
+ * Safe tier: it only adds files that are absent and appends entries to
10
+ * `index.yaml`. A layer whose body has been edited locally is reported and left
11
+ * alone, so applying this can never overwrite project-authored guidance.
12
+ *
13
+ * Note this repairs the *layers*; the placeholders in already-emitted skill
14
+ * bodies are rewritten by the skill refresh in `aidlc update`.
15
+ */
16
+ import type { Migration } from '../types.js';
17
+ export declare const installGuidance: Migration;
18
+ //# sourceMappingURL=install-guidance.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"install-guidance.d.ts","sourceRoot":"","sources":["../../../src/doctor/migrations/install-guidance.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C,eAAO,MAAM,eAAe,EAAE,SA+C7B,CAAC"}
@@ -0,0 +1,61 @@
1
+ /**
2
+ * install-guidance migration (guidance-layers-never-resolve/AC-2).
3
+ *
4
+ * Projects initialized before guidance installation existed have no
5
+ * `.aidlc/guidance/` at all — or only the layers they authored themselves — so
6
+ * every `{{guidance:<layer>}}` placeholder in their skills has nothing to resolve
7
+ * against. This migration installs the layers the content package ships.
8
+ *
9
+ * Safe tier: it only adds files that are absent and appends entries to
10
+ * `index.yaml`. A layer whose body has been edited locally is reported and left
11
+ * alone, so applying this can never overwrite project-authored guidance.
12
+ *
13
+ * Note this repairs the *layers*; the placeholders in already-emitted skill
14
+ * bodies are rewritten by the skill refresh in `aidlc update`.
15
+ */
16
+ import { getContentPackageRoot } from '../../compile/content-root.js';
17
+ import { installBundledGuidance } from '../../compile/guidance-install.js';
18
+ export const installGuidance = {
19
+ id: 'install-guidance',
20
+ tier: 'safe',
21
+ check(ctx) {
22
+ let contentRoot;
23
+ try {
24
+ contentRoot = getContentPackageRoot();
25
+ }
26
+ catch {
27
+ return { applicable: false, reason: 'content package not resolvable' };
28
+ }
29
+ const report = installBundledGuidance(ctx.projectRoot, contentRoot, { dryRun: true });
30
+ if (report.installed.length === 0 && !report.indexUpdated) {
31
+ return { applicable: true, pending: false };
32
+ }
33
+ const parts = [];
34
+ if (report.installed.length > 0) {
35
+ parts.push(`install ${report.installed.length} guidance layer(s): ${report.installed.join(', ')}`);
36
+ }
37
+ if (report.indexUpdated) {
38
+ parts.push('register them in .aidlc/guidance/index.yaml');
39
+ }
40
+ return {
41
+ applicable: true,
42
+ pending: true,
43
+ description: `would ${parts.join(' and ')}`,
44
+ };
45
+ },
46
+ apply(ctx) {
47
+ const report = installBundledGuidance(ctx.projectRoot, getContentPackageRoot());
48
+ const parts = [];
49
+ if (report.installed.length > 0) {
50
+ parts.push(`installed guidance layer(s): ${report.installed.join(', ')}`);
51
+ }
52
+ if (report.locallyModified.length > 0) {
53
+ parts.push(`left locally modified alone: ${report.locallyModified.join(', ')}`);
54
+ }
55
+ return {
56
+ changed: report.installed.length > 0 || report.indexUpdated,
57
+ summary: parts.join('; ') || 'guidance layers already installed',
58
+ };
59
+ },
60
+ };
61
+ //# sourceMappingURL=install-guidance.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"install-guidance.js","sourceRoot":"","sources":["../../../src/doctor/migrations/install-guidance.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAG3E,MAAM,CAAC,MAAM,eAAe,GAAc;IACxC,EAAE,EAAE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,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAChC,KAAK,CAAC,IAAI,CAAC,gCAAgC,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAC5E,CAAC;QACD,IAAI,MAAM,CAAC,eAAe,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACtC,KAAK,CAAC,IAAI,CAAC,gCAAgC,MAAM,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAClF,CAAC;QAED,OAAO;YACL,OAAO,EAAE,MAAM,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,IAAI,MAAM,CAAC,YAAY;YAC3D,OAAO,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,mCAAmC;SACjE,CAAC;IACJ,CAAC;CACF,CAAC"}
@@ -0,0 +1,40 @@
1
+ /**
2
+ * legacy-cost-hooks migration: re-install cost hooks that predate the shim.
3
+ *
4
+ * Replaces `stale-cost-hooks` (cost-capture-goes-dark/AC-14, AC-18). That
5
+ * migration asked "does the absolute CLI path recorded in the hook still exist?"
6
+ * — the right question only while the command *contained* an absolute path. Hook
7
+ * commands now invoke `.aidlc/cost/capture.sh`, which resolves node and the CLI
8
+ * at run time, so there is no longer a path that can go stale and nothing left
9
+ * to detect. What remains is a one-time migration: hooks installed by an older
10
+ * version still carry the frozen paths and are still silently broken.
11
+ *
12
+ * WHY THIS ONE REPAIRS, WHERE ITS PREDECESSOR ONLY REPORTED. `stale-cost-hooks`
13
+ * was deliberately report-only, reasoning that "a diagnostic must not silently
14
+ * rewrite a user's .claude/settings.json". That reasoning was sound and is
15
+ * narrowed here rather than discarded: this migration only ever replaces hook
16
+ * entries carrying our own `#aidlc-cost-hook` marker, via the same
17
+ * merge-not-clobber installer that leaves every other key and every unmarked
18
+ * hook untouched. Nothing the user wrote is rewritten.
19
+ *
20
+ * The reason to change the stance at all is what report-only cost us: the
21
+ * detection was correct, the report printed on every `aidlc update`, and the
22
+ * data was lost anyway, because the last link in the chain was a human reading a
23
+ * line. A repair that needs to be noticed is a repair that does not happen. The
24
+ * failure it prevents is silent and unrecoverable — usage that was never
25
+ * captured cannot be reconstructed later.
26
+ *
27
+ * Self-clearing: re-installing produces the shim form, so `legacy` goes false
28
+ * and this stops reporting without anyone editing state.
29
+ */
30
+ import type { Migration } from '../types.js';
31
+ /**
32
+ * Platforms whose installed hook still uses the pre-shim absolute-path form.
33
+ * Read-only half, exported for reuse and direct testing.
34
+ *
35
+ * Only installed hooks are considered: an absent hook is a different condition
36
+ * (never armed, not broken), and `aidlc cost hooks status` already says so.
37
+ */
38
+ export declare function legacyCostHookPlatforms(projectRoot: string): string[];
39
+ export declare const legacyCostHooks: Migration;
40
+ //# sourceMappingURL=legacy-cost-hooks.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"legacy-cost-hooks.d.ts","sourceRoot":"","sources":["../../../src/doctor/migrations/legacy-cost-hooks.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAKH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAqB7C;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,EAAE,CAOrE;AAWD,eAAO,MAAM,eAAe,EAAE,SAsB7B,CAAC"}
@@ -0,0 +1,92 @@
1
+ /**
2
+ * legacy-cost-hooks migration: re-install cost hooks that predate the shim.
3
+ *
4
+ * Replaces `stale-cost-hooks` (cost-capture-goes-dark/AC-14, AC-18). That
5
+ * migration asked "does the absolute CLI path recorded in the hook still exist?"
6
+ * — the right question only while the command *contained* an absolute path. Hook
7
+ * commands now invoke `.aidlc/cost/capture.sh`, which resolves node and the CLI
8
+ * at run time, so there is no longer a path that can go stale and nothing left
9
+ * to detect. What remains is a one-time migration: hooks installed by an older
10
+ * version still carry the frozen paths and are still silently broken.
11
+ *
12
+ * WHY THIS ONE REPAIRS, WHERE ITS PREDECESSOR ONLY REPORTED. `stale-cost-hooks`
13
+ * was deliberately report-only, reasoning that "a diagnostic must not silently
14
+ * rewrite a user's .claude/settings.json". That reasoning was sound and is
15
+ * narrowed here rather than discarded: this migration only ever replaces hook
16
+ * entries carrying our own `#aidlc-cost-hook` marker, via the same
17
+ * merge-not-clobber installer that leaves every other key and every unmarked
18
+ * hook untouched. Nothing the user wrote is rewritten.
19
+ *
20
+ * The reason to change the stance at all is what report-only cost us: the
21
+ * detection was correct, the report printed on every `aidlc update`, and the
22
+ * data was lost anyway, because the last link in the chain was a human reading a
23
+ * line. A repair that needs to be noticed is a repair that does not happen. The
24
+ * failure it prevents is silent and unrecoverable — usage that was never
25
+ * captured cannot be reconstructed later.
26
+ *
27
+ * Self-clearing: re-installing produces the shim form, so `legacy` goes false
28
+ * and this stops reporting without anyone editing state.
29
+ */
30
+ import { claudeCodeHookStatus, installClaudeCodeHooks } from '../../cost/hooks/claude-code.js';
31
+ import { kiroHookStatus, installKiroHooks } from '../../cost/hooks/kiro.js';
32
+ import { cliEntryPath } from '../../cost/hooks/entry.js';
33
+ /*
34
+ * Deliberately NOT driven by allProviders(): that registry is populated by an
35
+ * explicit registerBuiltinProviders() call, so any caller that has not made it
36
+ * sees an EMPTY list — the predecessor migration reproduced exactly that bug on
37
+ * its first run and found nothing in every case. A diagnostic that silently
38
+ * finds nothing is worse than no diagnostic. Hook installation exists only for
39
+ * these two platforms, so the pairing is static.
40
+ */
41
+ const HOOK_PLATFORMS = [
42
+ { name: 'claude-code', status: claudeCodeHookStatus, install: installClaudeCodeHooks },
43
+ { name: 'kiro', status: kiroHookStatus, install: installKiroHooks },
44
+ ];
45
+ /**
46
+ * Platforms whose installed hook still uses the pre-shim absolute-path form.
47
+ * Read-only half, exported for reuse and direct testing.
48
+ *
49
+ * Only installed hooks are considered: an absent hook is a different condition
50
+ * (never armed, not broken), and `aidlc cost hooks status` already says so.
51
+ */
52
+ export function legacyCostHookPlatforms(projectRoot) {
53
+ const legacy = [];
54
+ for (const p of HOOK_PLATFORMS) {
55
+ const status = p.status(projectRoot);
56
+ if (status.installed && status.legacy)
57
+ legacy.push(p.name);
58
+ }
59
+ return legacy;
60
+ }
61
+ function summarize(legacy) {
62
+ const one = legacy.length === 1;
63
+ return (`${legacy.length} cost hook${one ? '' : 's'} ` +
64
+ `still ${one ? 'names' : 'name'} an absolute node/CLI path frozen at install time ` +
65
+ `(${legacy.join(', ')}) — re-installed so capture survives a node or machine change`);
66
+ }
67
+ export const legacyCostHooks = {
68
+ id: 'legacy-cost-hooks',
69
+ tier: 'safe',
70
+ check(ctx) {
71
+ const legacy = legacyCostHookPlatforms(ctx.projectRoot);
72
+ if (legacy.length === 0)
73
+ return { applicable: true, pending: false };
74
+ return { applicable: true, pending: true, description: summarize(legacy) };
75
+ },
76
+ apply(ctx) {
77
+ const legacy = legacyCostHookPlatforms(ctx.projectRoot);
78
+ if (legacy.length === 0)
79
+ return { changed: false, summary: 'no legacy cost hooks' };
80
+ // process.execPath and the resolved CLI are only *hints* for the shim; they
81
+ // are validated at run time and never written into the command text, so a
82
+ // hint captured here going stale later is no longer a failure mode.
83
+ const nodePath = process.execPath;
84
+ const cliPath = cliEntryPath();
85
+ for (const p of HOOK_PLATFORMS) {
86
+ if (legacy.includes(p.name))
87
+ p.install(ctx.projectRoot, nodePath, cliPath);
88
+ }
89
+ return { changed: true, summary: summarize(legacy) };
90
+ },
91
+ };
92
+ //# sourceMappingURL=legacy-cost-hooks.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"legacy-cost-hooks.js","sourceRoot":"","sources":["../../../src/doctor/migrations/legacy-cost-hooks.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AAC/F,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;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,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;QACrE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC;IAC7E,CAAC;IACD,KAAK,CAAC,GAAG;QACP,MAAM,MAAM,GAAG,uBAAuB,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;QACxD,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,sBAAsB,EAAE,CAAC;QAEpF,4EAA4E;QAC5E,0EAA0E;QAC1E,oEAAoE;QACpE,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC;QAClC,MAAM,OAAO,GAAG,YAAY,EAAE,CAAC;QAC/B,KAAK,MAAM,CAAC,IAAI,cAAc,EAAE,CAAC;YAC/B,IAAI,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC;gBAAE,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,WAAW,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;QAC7E,CAAC;QACD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC;IACvD,CAAC;CACF,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rasensio/aidlc",
3
- "version": "1.10.5",
3
+ "version": "1.10.8",
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.10.5"
27
+ "@rasensio/aidlc-content": "1.10.8"
28
28
  },
29
29
  "devDependencies": {
30
30
  "@types/node": "22.15.32",