@rasensio/aidlc 1.10.6 → 1.11.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.
- package/dist/commands/add-action.d.ts +1 -1
- package/dist/commands/add-action.js +2 -2
- package/dist/commands/cost.d.ts.map +1 -1
- package/dist/commands/cost.js +29 -7
- package/dist/commands/cost.js.map +1 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +5 -1
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/status.d.ts.map +1 -1
- package/dist/commands/status.js +22 -1
- package/dist/commands/status.js.map +1 -1
- package/dist/commands/update.d.ts.map +1 -1
- package/dist/commands/update.js +6 -1
- package/dist/commands/update.js.map +1 -1
- package/dist/compile/loaders.d.ts +42 -6
- package/dist/compile/loaders.d.ts.map +1 -1
- package/dist/compile/loaders.js +75 -9
- package/dist/compile/loaders.js.map +1 -1
- package/dist/concurrency/gitattributes.d.ts.map +1 -1
- package/dist/concurrency/gitattributes.js +10 -0
- package/dist/concurrency/gitattributes.js.map +1 -1
- package/dist/cost/hooks/claude-code.d.ts +38 -5
- package/dist/cost/hooks/claude-code.d.ts.map +1 -1
- package/dist/cost/hooks/claude-code.js +38 -13
- package/dist/cost/hooks/claude-code.js.map +1 -1
- package/dist/cost/hooks/entry.d.ts +14 -0
- package/dist/cost/hooks/entry.d.ts.map +1 -0
- package/dist/cost/hooks/entry.js +18 -0
- package/dist/cost/hooks/entry.js.map +1 -0
- package/dist/cost/hooks/kiro.d.ts +16 -4
- package/dist/cost/hooks/kiro.d.ts.map +1 -1
- package/dist/cost/hooks/kiro.js +21 -9
- package/dist/cost/hooks/kiro.js.map +1 -1
- package/dist/cost/hooks/shim.d.ts +54 -0
- package/dist/cost/hooks/shim.d.ts.map +1 -0
- package/dist/cost/hooks/shim.js +170 -0
- package/dist/cost/hooks/shim.js.map +1 -0
- package/dist/cost/recorder.d.ts +22 -0
- package/dist/cost/recorder.d.ts.map +1 -1
- package/dist/cost/recorder.js +44 -0
- package/dist/cost/recorder.js.map +1 -1
- package/dist/doctor/migrations/cost-gitignore.d.ts.map +1 -1
- package/dist/doctor/migrations/cost-gitignore.js +15 -1
- package/dist/doctor/migrations/cost-gitignore.js.map +1 -1
- package/dist/doctor/migrations/index.js +2 -2
- package/dist/doctor/migrations/index.js.map +1 -1
- package/dist/doctor/migrations/legacy-cost-hooks.d.ts +40 -0
- package/dist/doctor/migrations/legacy-cost-hooks.d.ts.map +1 -0
- package/dist/doctor/migrations/legacy-cost-hooks.js +92 -0
- package/dist/doctor/migrations/legacy-cost-hooks.js.map +1 -0
- package/package.json +2 -2
- package/dist/doctor/migrations/stale-cost-hooks.d.ts +0 -37
- package/dist/doctor/migrations/stale-cost-hooks.d.ts.map +0 -1
- package/dist/doctor/migrations/stale-cost-hooks.js +0 -85
- package/dist/doctor/migrations/stale-cost-hooks.js.map +0 -1
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* stale-cost-hooks migration: report installed cost hooks whose recorded CLI
|
|
3
|
-
* path no longer resolves on disk.
|
|
4
|
-
*
|
|
5
|
-
* Report-only, `safe` tier. The repair rewrites project files, so it belongs to
|
|
6
|
-
* `aidlc cost hooks install` — a diagnostic must not silently rewrite a user's
|
|
7
|
-
* .claude/settings.json or .kiro/hooks/. Same reasoning as unknown-agent-claims.
|
|
8
|
-
*
|
|
9
|
-
* Why this exists: hook commands are written with ABSOLUTE paths to both the
|
|
10
|
-
* node binary and the globally installed CLI. A username change, a new machine,
|
|
11
|
-
* or an `nvm` upgrade invalidates them, and the hook then fails silently —
|
|
12
|
-
* nothing executes, nothing reaches capture.log, and `aidlc cost` reports no
|
|
13
|
-
* data forever with no indication why. Observed in a real project whose hooks
|
|
14
|
-
* still named `/Users/rodrigo` and node v24.9.0 long after the account and
|
|
15
|
-
* runtime had moved on: capture had been dead for four days, every phase read
|
|
16
|
-
* $0.00, and no command said anything was wrong.
|
|
17
|
-
*
|
|
18
|
-
* The detection already existed — `commandResolvable` on both hook-status
|
|
19
|
-
* functions — and had no caller outside `aidlc cost hooks status`, which a
|
|
20
|
-
* human has to remember to run. A guard nobody invokes is the same shape as the
|
|
21
|
-
* cost feature whose arming was manual and therefore never armed.
|
|
22
|
-
*
|
|
23
|
-
* Self-clearing (the cost-capture-noise lesson: a suppression guard needs its
|
|
24
|
-
* counterpart verified to exist). Reinstalling the hooks makes the path resolve
|
|
25
|
-
* and silences this without anyone editing state.
|
|
26
|
-
*/
|
|
27
|
-
import { claudeCodeHookStatus } from '../../cost/hooks/claude-code.js';
|
|
28
|
-
import { kiroHookStatus } from '../../cost/hooks/kiro.js';
|
|
29
|
-
/*
|
|
30
|
-
* Deliberately NOT driven by allProviders(). That registry is populated by an
|
|
31
|
-
* explicit registerBuiltinProviders() call, so any caller that has not made it
|
|
32
|
-
* sees an EMPTY list — providers/index.ts documents that exact bug ("any code
|
|
33
|
-
* path that did not import that module saw an empty registry"), and this
|
|
34
|
-
* migration reproduced it on the first run: every case returned no findings
|
|
35
|
-
* because the loop had nothing to iterate. A diagnostic that silently finds
|
|
36
|
-
* nothing is worse than no diagnostic at all.
|
|
37
|
-
*
|
|
38
|
-
* Hook installation exists only for these two platforms, so the pairing is
|
|
39
|
-
* static and carries no hidden initialisation order.
|
|
40
|
-
*/
|
|
41
|
-
const HOOK_PLATFORMS = [
|
|
42
|
-
{ name: 'claude-code', status: claudeCodeHookStatus },
|
|
43
|
-
{ name: 'kiro', status: kiroHookStatus },
|
|
44
|
-
];
|
|
45
|
-
/**
|
|
46
|
-
* Platforms whose cost hooks are installed but point at a path that is gone.
|
|
47
|
-
* Read-only half, exported for reuse and for direct testing.
|
|
48
|
-
*
|
|
49
|
-
* Only installed hooks are reported: an absent hook is a different condition
|
|
50
|
-
* (never armed, not broken) and `aidlc cost hooks status` already says so.
|
|
51
|
-
*/
|
|
52
|
-
export function staleCostHookPlatforms(projectRoot) {
|
|
53
|
-
const stale = [];
|
|
54
|
-
for (const p of HOOK_PLATFORMS) {
|
|
55
|
-
const status = p.status(projectRoot);
|
|
56
|
-
if (status.installed && !status.commandResolvable)
|
|
57
|
-
stale.push(p.name);
|
|
58
|
-
}
|
|
59
|
-
return stale;
|
|
60
|
-
}
|
|
61
|
-
function summarize(stale) {
|
|
62
|
-
return (`${stale.length} cost hook${stale.length === 1 ? '' : 's'} ` +
|
|
63
|
-
`point at a path that no longer exists (${stale.join(', ')}) — ` +
|
|
64
|
-
'no usage is being captured; run `aidlc cost hooks install` to re-point ' +
|
|
65
|
-
'them at the current node and CLI');
|
|
66
|
-
}
|
|
67
|
-
export const staleCostHooks = {
|
|
68
|
-
id: 'stale-cost-hooks',
|
|
69
|
-
tier: 'safe',
|
|
70
|
-
check(ctx) {
|
|
71
|
-
const stale = staleCostHookPlatforms(ctx.projectRoot);
|
|
72
|
-
if (stale.length === 0)
|
|
73
|
-
return { applicable: true, pending: false };
|
|
74
|
-
return { applicable: true, pending: true, description: summarize(stale) };
|
|
75
|
-
},
|
|
76
|
-
apply(ctx) {
|
|
77
|
-
// Report-only. `changed: true` is what makes the finding visible: the runner
|
|
78
|
-
// maps changed:false to status 'clean', and commands/doctor.ts filters clean
|
|
79
|
-
// outcomes out of its report entirely, so a diagnostic returning false would
|
|
80
|
-
// be silently swallowed. The rendered line reads `stale-cost-hooks: <summary>`.
|
|
81
|
-
const stale = staleCostHookPlatforms(ctx.projectRoot);
|
|
82
|
-
return { changed: stale.length > 0, summary: summarize(stale) };
|
|
83
|
-
},
|
|
84
|
-
};
|
|
85
|
-
//# sourceMappingURL=stale-cost-hooks.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"stale-cost-hooks.js","sourceRoot":"","sources":["../../../src/doctor/migrations/stale-cost-hooks.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AACvE,OAAO,EAAE,cAAc,EAAE,MAA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