@rasensio/aidlc 1.15.0 → 1.15.2
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 +0 -3
- package/dist/commands/add-action.d.ts.map +1 -1
- package/dist/commands/add-action.js +31 -14
- package/dist/commands/add-action.js.map +1 -1
- package/dist/commands/add-skill.js +7 -3
- package/dist/commands/add-skill.js.map +1 -1
- package/dist/commands/cost.d.ts.map +1 -1
- package/dist/commands/cost.js +37 -1
- package/dist/commands/cost.js.map +1 -1
- package/dist/commands/init.d.ts +16 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +40 -26
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/knowledge.js +8 -3
- package/dist/commands/knowledge.js.map +1 -1
- package/dist/commands/start.d.ts.map +1 -1
- package/dist/commands/start.js +10 -8
- package/dist/commands/start.js.map +1 -1
- package/dist/compile/loaders.d.ts.map +1 -1
- package/dist/compile/loaders.js +12 -2
- package/dist/compile/loaders.js.map +1 -1
- package/dist/core/prompt.d.ts +140 -0
- package/dist/core/prompt.d.ts.map +1 -0
- package/dist/core/prompt.js +115 -0
- package/dist/core/prompt.js.map +1 -0
- package/dist/cost/agent.d.ts.map +1 -1
- package/dist/cost/agent.js +2 -11
- package/dist/cost/agent.js.map +1 -1
- package/dist/cost/hooks/claude-code.d.ts +17 -1
- package/dist/cost/hooks/claude-code.d.ts.map +1 -1
- package/dist/cost/hooks/claude-code.js +30 -5
- package/dist/cost/hooks/claude-code.js.map +1 -1
- package/dist/cost/hooks/kiro.d.ts.map +1 -1
- package/dist/cost/hooks/kiro.js +42 -26
- package/dist/cost/hooks/kiro.js.map +1 -1
- package/dist/cost/sessions.d.ts +85 -2
- package/dist/cost/sessions.d.ts.map +1 -1
- package/dist/cost/sessions.js +132 -9
- package/dist/cost/sessions.js.map +1 -1
- package/dist/cost/types.d.ts +10 -0
- package/dist/cost/types.d.ts.map +1 -1
- package/dist/cost/types.js.map +1 -1
- package/dist/doctor/migrations/index.d.ts.map +1 -1
- package/dist/doctor/migrations/index.js +8 -0
- package/dist/doctor/migrations/index.js.map +1 -1
- package/dist/doctor/migrations/outdated-cost-hooks.d.ts +35 -0
- package/dist/doctor/migrations/outdated-cost-hooks.d.ts.map +1 -0
- package/dist/doctor/migrations/outdated-cost-hooks.js +81 -0
- package/dist/doctor/migrations/outdated-cost-hooks.js.map +1 -0
- package/dist/doctor/migrations/trust-run-actions.d.ts +14 -0
- package/dist/doctor/migrations/trust-run-actions.d.ts.map +1 -0
- package/dist/doctor/migrations/trust-run-actions.js +68 -0
- package/dist/doctor/migrations/trust-run-actions.js.map +1 -0
- package/dist/doctor/runner.d.ts.map +1 -1
- package/dist/doctor/runner.js +5 -3
- package/dist/doctor/runner.js.map +1 -1
- package/dist/events/event-bus.d.ts +3 -1
- package/dist/events/event-bus.d.ts.map +1 -1
- package/dist/events/event-bus.js +40 -10
- package/dist/events/event-bus.js.map +1 -1
- package/dist/menu/index.d.ts +5 -2
- package/dist/menu/index.d.ts.map +1 -1
- package/dist/menu/index.js +13 -7
- package/dist/menu/index.js.map +1 -1
- package/dist/security/action-trust.d.ts +34 -0
- package/dist/security/action-trust.d.ts.map +1 -0
- package/dist/security/action-trust.js +82 -0
- package/dist/security/action-trust.js.map +1 -0
- package/dist/traceability/gate-criterion.d.ts.map +1 -1
- package/dist/traceability/gate-criterion.js +7 -0
- package/dist/traceability/gate-criterion.js.map +1 -1
- package/package.json +2 -2
- package/dist/menu/prompt.d.ts +0 -74
- package/dist/menu/prompt.d.ts.map +0 -1
- package/dist/menu/prompt.js +0 -69
- package/dist/menu/prompt.js.map +0 -1
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The prompt seam — the one module in this package that talks to
|
|
3
|
+
* `@clack/prompts` (single-clack-prompt-seam/AC-1 … AC-9).
|
|
4
|
+
*
|
|
5
|
+
* `tty-prompt-guard` made the interactivity check *available* at all 16 prompt
|
|
6
|
+
* call sites; it did not make it *unskippable*. The thirteenth prompt could
|
|
7
|
+
* still forget, and the only thing standing in its way was a test that spawned
|
|
8
|
+
* every registered command under a non-TTY stdin — proof that the guard held
|
|
9
|
+
* that time, not that it cannot be skipped.
|
|
10
|
+
*
|
|
11
|
+
* Now every question in the CLI comes through here, and every function below
|
|
12
|
+
* consults `isInteractive()` **before** touching clack. Opening an unanswerable
|
|
13
|
+
* prompt therefore requires importing clack directly, which
|
|
14
|
+
* `test/prompt-seam.test.ts` forbids structurally
|
|
15
|
+
* (single-clack-prompt-seam/AC-2).
|
|
16
|
+
*
|
|
17
|
+
* ## What this module deliberately does not do
|
|
18
|
+
*
|
|
19
|
+
* It does not decide what a command does when nobody can answer. Those
|
|
20
|
+
* behaviours legitimately differ: `init`'s cost-hooks consent adopts the yes
|
|
21
|
+
* that `--non-interactive` already gives, `add skill` exits 1 so "you said no"
|
|
22
|
+
* stays distinguishable from "I could not ask", `knowledge
|
|
23
|
+
* install-merge-driver` fails closed after printing its plan, and `add action`'s
|
|
24
|
+
* save confirm gets its own arm rather than joining `--non-interactive` (which
|
|
25
|
+
* writes). A seam that picked one policy would silently change three of them.
|
|
26
|
+
* So the seam reports `reason: 'no-tty'` and the call site keeps its tier
|
|
27
|
+
* (single-clack-prompt-seam/AC-6).
|
|
28
|
+
*
|
|
29
|
+
* @module
|
|
30
|
+
*/
|
|
31
|
+
/**
|
|
32
|
+
* The outcome of asking a question (single-clack-prompt-seam/AC-7).
|
|
33
|
+
*
|
|
34
|
+
* Three outcomes, not two: a real answer, a user cancellation, and *nobody was
|
|
35
|
+
* there to ask*. The shape follows the `ok | reason` convention the cost
|
|
36
|
+
* module's `ResolveResult` already set in this package, so a reader meets one
|
|
37
|
+
* idiom rather than two.
|
|
38
|
+
*
|
|
39
|
+
* The predecessor was `string | typeof CANCEL` in `menu/prompt.ts`. It could not
|
|
40
|
+
* express the third outcome without a second exported sentinel, and a union of
|
|
41
|
+
* two sentinels is precisely what `ok | reason` exists to avoid. It also made
|
|
42
|
+
* the dangerous case cheap to write: `if (answer)` reads as "they said yes" even
|
|
43
|
+
* when `answer` is a sentinel. `!result.ok` cannot be mistaken for a truthy yes,
|
|
44
|
+
* which matters most at the three sites that write to disk after a confirm.
|
|
45
|
+
*/
|
|
46
|
+
export type PromptResult<T> = {
|
|
47
|
+
ok: true;
|
|
48
|
+
value: T;
|
|
49
|
+
} | {
|
|
50
|
+
ok: false;
|
|
51
|
+
reason: PromptMiss;
|
|
52
|
+
};
|
|
53
|
+
/** Why a question produced no answer. */
|
|
54
|
+
export type PromptMiss = 'cancelled' | 'no-tty';
|
|
55
|
+
export interface SelectOption {
|
|
56
|
+
value: string;
|
|
57
|
+
label: string;
|
|
58
|
+
hint?: string;
|
|
59
|
+
}
|
|
60
|
+
export interface SelectRequest {
|
|
61
|
+
message: string;
|
|
62
|
+
options: SelectOption[];
|
|
63
|
+
/** Pre-highlighted option, as `init`'s template and scope pickers use. */
|
|
64
|
+
initialValue?: string;
|
|
65
|
+
}
|
|
66
|
+
export interface MultiselectRequest {
|
|
67
|
+
message: string;
|
|
68
|
+
options: SelectOption[];
|
|
69
|
+
/** `false` lets the user submit an empty set — `init`'s platform picker does. */
|
|
70
|
+
required?: boolean;
|
|
71
|
+
}
|
|
72
|
+
export interface TextRequest {
|
|
73
|
+
message: string;
|
|
74
|
+
placeholder?: string;
|
|
75
|
+
/**
|
|
76
|
+
* Return a message to reject the value and re-prompt.
|
|
77
|
+
*
|
|
78
|
+
* The value is optional because clack passes `undefined` before the field has
|
|
79
|
+
* been touched — which is exactly the empty case that must be rejected.
|
|
80
|
+
*/
|
|
81
|
+
validate?: (value: string | undefined) => string | undefined;
|
|
82
|
+
}
|
|
83
|
+
export interface ConfirmRequest {
|
|
84
|
+
message: string;
|
|
85
|
+
initialValue?: boolean;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Everything the CLI does that touches a terminal
|
|
89
|
+
* (single-clack-prompt-seam/AC-9).
|
|
90
|
+
*
|
|
91
|
+
* Injected by optional parameter defaulting to {@link defaultPrompter} — the
|
|
92
|
+
* same shape `doctor/runner.ts` uses for `ConfirmFn` and the menu used for
|
|
93
|
+
* `MenuDeps`. Deliberately not a mutable module-level singleton: a global the
|
|
94
|
+
* tests swap is a cross-test coupling this suite does not need, and it would
|
|
95
|
+
* reintroduce the "did someone reset it?" failure mode.
|
|
96
|
+
*/
|
|
97
|
+
export interface Prompter {
|
|
98
|
+
select(req: SelectRequest): Promise<PromptResult<string>>;
|
|
99
|
+
multiselect(req: MultiselectRequest): Promise<PromptResult<string[]>>;
|
|
100
|
+
text(req: TextRequest): Promise<PromptResult<string>>;
|
|
101
|
+
confirm(req: ConfirmRequest): Promise<PromptResult<boolean>>;
|
|
102
|
+
/**
|
|
103
|
+
* Output only. These write and return; they cannot block, so they have no
|
|
104
|
+
* result type and need no guard. They live here anyway because leaving them on
|
|
105
|
+
* a direct clack import would defeat AC-1 — `init.ts` would still import the
|
|
106
|
+
* package (single-clack-prompt-seam/AC-9, D6).
|
|
107
|
+
*/
|
|
108
|
+
intro(message: string): void;
|
|
109
|
+
outro(message: string): void;
|
|
110
|
+
note(message: string, title?: string): void;
|
|
111
|
+
/** Whether a prompt can be answered at all. */
|
|
112
|
+
interactive(): boolean;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* The only place `@clack/prompts` is invoked.
|
|
116
|
+
*
|
|
117
|
+
* Note the order in every question function: guard, *then* prompt. Reversed, or
|
|
118
|
+
* with the guard left to the caller, this is the hang `tty-prompt-guard`
|
|
119
|
+
* diagnosed — closed stdin exits 13 on an unsettled top-level await, an open but
|
|
120
|
+
* silent stdin (vitest, CI) waits forever.
|
|
121
|
+
*
|
|
122
|
+
* `clack.isCancel` is called here and nowhere else. clack exports no cancel
|
|
123
|
+
* symbol — its value is a private `Symbol("clack:cancel")` that is not
|
|
124
|
+
* `Symbol.for`-registered, so only the predicate is public. Translating once
|
|
125
|
+
* means an injected test double returns exactly what production returns.
|
|
126
|
+
*/
|
|
127
|
+
export declare const defaultPrompter: Prompter;
|
|
128
|
+
/**
|
|
129
|
+
* Reject empty or whitespace-only input for a required positional.
|
|
130
|
+
*
|
|
131
|
+
* clack's text prompt yields `''` — not the cancel symbol — when Enter is
|
|
132
|
+
* pressed on an empty field with no default, so without this the menu would
|
|
133
|
+
* dispatch a meaningless invocation the user cannot distinguish from a cancel.
|
|
134
|
+
* Commander would reject a missing `<arg>`; this rejects it earlier, where the
|
|
135
|
+
* user can still fix it.
|
|
136
|
+
*
|
|
137
|
+
* Moved here from `menu/prompt.ts` with the rest of the seam.
|
|
138
|
+
*/
|
|
139
|
+
export declare function requireNonEmpty(label: string): (value: string | undefined) => string | undefined;
|
|
140
|
+
//# sourceMappingURL=prompt.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prompt.d.ts","sourceRoot":"","sources":["../../src/core/prompt.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAUH;;;;;;;;;;;;;;GAcG;AACH,MAAM,MAAM,YAAY,CAAC,CAAC,IACtB;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,KAAK,EAAE,CAAC,CAAA;CAAE,GACtB;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,UAAU,CAAA;CAAE,CAAC;AAEtC,yCAAyC;AACzC,MAAM,MAAM,UAAU,GAAG,WAAW,GAAG,QAAQ,CAAC;AAShD,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,YAAY,EAAE,CAAC;IACxB,0EAA0E;IAC1E,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,kBAAkB;IACjC,OAA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ACZ,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,KAAK,MAAM,GAAG,SAAS,CAEnD"}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The prompt seam — the one module in this package that talks to
|
|
3
|
+
* `@clack/prompts` (single-clack-prompt-seam/AC-1 … AC-9).
|
|
4
|
+
*
|
|
5
|
+
* `tty-prompt-guard` made the interactivity check *available* at all 16 prompt
|
|
6
|
+
* call sites; it did not make it *unskippable*. The thirteenth prompt could
|
|
7
|
+
* still forget, and the only thing standing in its way was a test that spawned
|
|
8
|
+
* every registered command under a non-TTY stdin — proof that the guard held
|
|
9
|
+
* that time, not that it cannot be skipped.
|
|
10
|
+
*
|
|
11
|
+
* Now every question in the CLI comes through here, and every function below
|
|
12
|
+
* consults `isInteractive()` **before** touching clack. Opening an unanswerable
|
|
13
|
+
* prompt therefore requires importing clack directly, which
|
|
14
|
+
* `test/prompt-seam.test.ts` forbids structurally
|
|
15
|
+
* (single-clack-prompt-seam/AC-2).
|
|
16
|
+
*
|
|
17
|
+
* ## What this module deliberately does not do
|
|
18
|
+
*
|
|
19
|
+
* It does not decide what a command does when nobody can answer. Those
|
|
20
|
+
* behaviours legitimately differ: `init`'s cost-hooks consent adopts the yes
|
|
21
|
+
* that `--non-interactive` already gives, `add skill` exits 1 so "you said no"
|
|
22
|
+
* stays distinguishable from "I could not ask", `knowledge
|
|
23
|
+
* install-merge-driver` fails closed after printing its plan, and `add action`'s
|
|
24
|
+
* save confirm gets its own arm rather than joining `--non-interactive` (which
|
|
25
|
+
* writes). A seam that picked one policy would silently change three of them.
|
|
26
|
+
* So the seam reports `reason: 'no-tty'` and the call site keeps its tier
|
|
27
|
+
* (single-clack-prompt-seam/AC-6).
|
|
28
|
+
*
|
|
29
|
+
* @module
|
|
30
|
+
*/
|
|
31
|
+
import * as clack from '@clack/prompts';
|
|
32
|
+
import { isInteractive } from './tty.js';
|
|
33
|
+
/** Shared constructor so the guard clause reads the same in all four functions. */
|
|
34
|
+
const miss = (reason) => ({ ok: false, reason });
|
|
35
|
+
// ---------------------------------------------------------------------------
|
|
36
|
+
// The clack-backed implementation
|
|
37
|
+
// ---------------------------------------------------------------------------
|
|
38
|
+
/**
|
|
39
|
+
* The only place `@clack/prompts` is invoked.
|
|
40
|
+
*
|
|
41
|
+
* Note the order in every question function: guard, *then* prompt. Reversed, or
|
|
42
|
+
* with the guard left to the caller, this is the hang `tty-prompt-guard`
|
|
43
|
+
* diagnosed — closed stdin exits 13 on an unsettled top-level await, an open but
|
|
44
|
+
* silent stdin (vitest, CI) waits forever.
|
|
45
|
+
*
|
|
46
|
+
* `clack.isCancel` is called here and nowhere else. clack exports no cancel
|
|
47
|
+
* symbol — its value is a private `Symbol("clack:cancel")` that is not
|
|
48
|
+
* `Symbol.for`-registered, so only the predicate is public. Translating once
|
|
49
|
+
* means an injected test double returns exactly what production returns.
|
|
50
|
+
*/
|
|
51
|
+
export const defaultPrompter = {
|
|
52
|
+
async select(req) {
|
|
53
|
+
if (!isInteractive())
|
|
54
|
+
return miss('no-tty');
|
|
55
|
+
const value = await clack.select({
|
|
56
|
+
message: req.message,
|
|
57
|
+
options: req.options,
|
|
58
|
+
...(req.initialValue === undefined ? {} : { initialValue: req.initialValue }),
|
|
59
|
+
});
|
|
60
|
+
return clack.isCancel(value) ? miss('cancelled') : { ok: true, value: value };
|
|
61
|
+
},
|
|
62
|
+
async multiselect(req) {
|
|
63
|
+
if (!isInteractive())
|
|
64
|
+
return miss('no-tty');
|
|
65
|
+
const value = await clack.multiselect({
|
|
66
|
+
message: req.message,
|
|
67
|
+
options: req.options,
|
|
68
|
+
...(req.required === undefined ? {} : { required: req.required }),
|
|
69
|
+
});
|
|
70
|
+
return clack.isCancel(value) ? miss('cancelled') : { ok: true, value: value };
|
|
71
|
+
},
|
|
72
|
+
async text(req) {
|
|
73
|
+
if (!isInteractive())
|
|
74
|
+
return miss('no-tty');
|
|
75
|
+
const value = await clack.text({
|
|
76
|
+
message: req.message,
|
|
77
|
+
placeholder: req.placeholder,
|
|
78
|
+
validate: req.validate,
|
|
79
|
+
});
|
|
80
|
+
return clack.isCancel(value) ? miss('cancelled') : { ok: true, value: value };
|
|
81
|
+
},
|
|
82
|
+
async confirm(req) {
|
|
83
|
+
if (!isInteractive())
|
|
84
|
+
return miss('no-tty');
|
|
85
|
+
const value = await clack.confirm({
|
|
86
|
+
message: req.message,
|
|
87
|
+
...(req.initialValue === undefined ? {} : { initialValue: req.initialValue }),
|
|
88
|
+
});
|
|
89
|
+
// `=== true` rather than a truthiness check: the cancel symbol is truthy,
|
|
90
|
+
// and this is the branch three write-after-confirm sites depend on.
|
|
91
|
+
return clack.isCancel(value) ? miss('cancelled') : { ok: true, value: value === true };
|
|
92
|
+
},
|
|
93
|
+
intro: (message) => clack.intro(message),
|
|
94
|
+
outro: (message) => clack.outro(message),
|
|
95
|
+
note: (message, title) => clack.note(message, title),
|
|
96
|
+
interactive: isInteractive,
|
|
97
|
+
};
|
|
98
|
+
// ---------------------------------------------------------------------------
|
|
99
|
+
// Validators
|
|
100
|
+
// ---------------------------------------------------------------------------
|
|
101
|
+
/**
|
|
102
|
+
* Reject empty or whitespace-only input for a required positional.
|
|
103
|
+
*
|
|
104
|
+
* clack's text prompt yields `''` — not the cancel symbol — when Enter is
|
|
105
|
+
* pressed on an empty field with no default, so without this the menu would
|
|
106
|
+
* dispatch a meaningless invocation the user cannot distinguish from a cancel.
|
|
107
|
+
* Commander would reject a missing `<arg>`; this rejects it earlier, where the
|
|
108
|
+
* user can still fix it.
|
|
109
|
+
*
|
|
110
|
+
* Moved here from `menu/prompt.ts` with the rest of the seam.
|
|
111
|
+
*/
|
|
112
|
+
export function requireNonEmpty(label) {
|
|
113
|
+
return (value) => ((value ?? '').trim() === '' ? `${label} is required` : undefined);
|
|
114
|
+
}
|
|
115
|
+
//# sourceMappingURL=prompt.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prompt.js","sourceRoot":"","sources":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IAC9C,MAAM,EAAE,eAAe,GAAG,IAAI,CAAC;CAChC;
|
|
1
|
+
{"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../src/cost/agent.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AASH,iEAAiE;AACjE,eAAO,MAAM,aAAa,YAAY,CAAC;AAEvC,kFAAkF;AAClF,MAAM,MAAM,eAAe,GACvB,sBAAsB,GACtB,6BAA6B,GAC7B,oBAAoB,CAAC;AAEzB,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,0EAA0E;IAC1E,GAAG,EAAE,KAAK,GAAG,OAAO,GAAG,QAAQ,GAAG,IAAI,CAAC;IACvC,8CAA8C;IAC9C,MAAM,EAAE,eAAe,GAAG,IAAI,CAAC;CAChC;AA2DD;;;GAGG;AACH,wBAAgB,cAAc,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAOjE;AAyBD,wBAAgB,YAAY,CAAC,WAAW,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,eAAe,CAKhF;AAqCD,gEAAgE;AAChE,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,eAAe,GAAG,MAAM,CAShE;AAED,+CAA+C;AAC/C,wBAAgB,eAAe,IAAI,IAAI,CAKtC"}
|
package/dist/cost/agent.js
CHANGED
|
@@ -24,9 +24,9 @@
|
|
|
24
24
|
* looked". Resolution is fail-soft throughout — it must never fail a claim
|
|
25
25
|
* (AC-6, NFR-2).
|
|
26
26
|
*/
|
|
27
|
-
import { readFileSync, readdirSync, existsSync
|
|
27
|
+
import { readFileSync, readdirSync, existsSync } from 'node:fs';
|
|
28
28
|
import { join } from 'node:path';
|
|
29
|
-
import { stashDir, repoIdentity } from './sessions.js';
|
|
29
|
+
import { stashDir, repoIdentity, canonical } from './sessions.js';
|
|
30
30
|
import { allProviders } from './providers/provider.js';
|
|
31
31
|
import { registerBuiltinProviders } from './providers/index.js';
|
|
32
32
|
/** The value recorded when the platform cannot be determined. */
|
|
@@ -91,15 +91,6 @@ function identityOf(dir) {
|
|
|
91
91
|
identityCache.set(dir, value);
|
|
92
92
|
return value;
|
|
93
93
|
}
|
|
94
|
-
/** Resolve symlinks for comparison; unresolvable paths compare as written. */
|
|
95
|
-
function canonical(p) {
|
|
96
|
-
try {
|
|
97
|
-
return realpathSync(p);
|
|
98
|
-
}
|
|
99
|
-
catch {
|
|
100
|
-
return p;
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
94
|
/**
|
|
104
95
|
* The platform every matching stash entry agrees on, or null when there are
|
|
105
96
|
* none or they disagree (AC-4).
|
package/dist/cost/agent.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent.js","sourceRoot":"","sources":["../../src/cost/agent.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,
|
|
1
|
+
{"version":3,"file":"agent.js","sourceRoot":"","sources":["../../src/cost/agent.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAChE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAEhE,iEAAiE;AACjE,MAAM,CAAC,MAAM,aAAa,GAAG,SAAS,CAAC;AAgBvC;;;;;;;GAOG;AACH,SAAS,oBAAoB,CAAC,WAAmB;IAC/C,MAAM,GAAG,GAAG,QAAQ,CAAC,WAAW,CAAC,CAAC;IAClC,IAA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QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IAEtF,uEAAuE;IACvE,uEAAuE;IACvE,MAAM,MAAM,GACV,UAAU,GAAG,CAAC;QACZ,CAAC,CAAC,oBAAoB;QACtB,CAAC,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC;YACnB,CAAC,CAAC,6BAA6B;YAC/B,CAAC,CAAC,sBAAsB,CAAC;IAC/B,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;AACrD,CAAC;AAED,gEAAgE;AAChE,MAAM,UAAU,gBAAgB,CAAC,MAAuB;IACtD,QAAQ,MAAM,EAAE,CAAC;QACf,KAAK,6BAA6B;YAChC,OAAO,4IAA4I,CAAC;QACtJ,KAAK,oBAAoB;YACvB,OAAO,oJAAoJ,CAAC;QAC9J,KAAK,sBAAsB;YACzB,OAAO,2EAA2E,CAAC;IACvF,CAAC;AACH,CAAC;AAED,+CAA+C;AAC/C,MAAM,UAAU,eAAe;IAC7B,MAAM,GAAG,IAAI,CAAC;IACd,8EAA8E;IAC9E,oEAAoE;IACpE,aAAa,CAAC,KAAK,EAAE,CAAC;AACxB,CAAC"}
|
|
@@ -25,7 +25,7 @@ export declare const HOOK_MARKER = "#aidlc-cost-hook";
|
|
|
25
25
|
* `nodePath`/`cliPath` are still taken, but only to seed the shim's *hints*;
|
|
26
26
|
* they no longer appear in the command text.
|
|
27
27
|
*/
|
|
28
|
-
export declare function hookCommands(_nodePath
|
|
28
|
+
export declare function hookCommands(_nodePath?: string, _cliPath?: string): {
|
|
29
29
|
sessionEnd: string;
|
|
30
30
|
sessionStart: string;
|
|
31
31
|
};
|
|
@@ -62,6 +62,22 @@ export interface HookStatus {
|
|
|
62
62
|
* `shim.ts:shimProblem`.
|
|
63
63
|
*/
|
|
64
64
|
shim: ShimProblem | null;
|
|
65
|
+
/**
|
|
66
|
+
* The installed command text is not what the current installer would write, so
|
|
67
|
+
* the hook is armed with an older contract.
|
|
68
|
+
*
|
|
69
|
+
* Generic on purpose. `legacy` answers one historical question (does this
|
|
70
|
+
* predate the shim?) and needed a migration written for it; this asks the
|
|
71
|
+
* question that recurs — *is the command current?* — so the next command-shape
|
|
72
|
+
* change is repaired by the machinery already here rather than by another
|
|
73
|
+
* bespoke detector. `stash-unstash-on-end` is the first such change: a
|
|
74
|
+
* SessionEnd hook without `--session-end` still works via the payload signal,
|
|
75
|
+
* but it should not stay behind.
|
|
76
|
+
*
|
|
77
|
+
* A legacy hook is outdated too. Order in the migration registry settles that:
|
|
78
|
+
* `legacy-cost-hooks` re-installs first, and this then reads clean.
|
|
79
|
+
*/
|
|
80
|
+
outdated: boolean;
|
|
65
81
|
}
|
|
66
82
|
export declare function claudeCodeHookStatus(projectRoot: string): HookStatus;
|
|
67
83
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claude-code.d.ts","sourceRoot":"","sources":["../../../src/cost/hooks/claude-code.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAKH,OAAO,EAA0C,KAAK,WAAW,EAAE,MAAM,WAAW,CAAC;AAErF,eAAO,MAAM,WAAW,qBAAqB,CAAC;AAuB9C;;;;;;;;;;;;GAYG;AACH,wBAAgB,YAAY,CAAC,SAAS,
|
|
1
|
+
{"version":3,"file":"claude-code.d.ts","sourceRoot":"","sources":["../../../src/cost/hooks/claude-code.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAKH,OAAO,EAA0C,KAAK,WAAW,EAAE,MAAM,WAAW,CAAC;AAErF,eAAO,MAAM,WAAW,qBAAqB,CAAC;AAuB9C;;;;;;;;;;;;GAYG;AACH,wBAAgB,YAAY,CAAC,SAAS,SAAK,EAAE,QAAQ,SAAK,GAAG;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAA;CAAE,CAUxG;AAwBD;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CAAC,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,CAgBnG;AAED,0DAA0D;AAC1D,wBAAgB,qBAAqB,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAW/D;AAED,MAAM,WAAW,UAAU;IACzB,SAAS,EAAE,OAAO,CAAC;IACnB;;;;;;;;OAQG;IACH,MAAM,EAAE,OAAO,CAAC;IAChB;;;;;;;;;OASG;IACH,IAAI,EAAE,WAAW,GAAG,IAAI,CAAC;IACzB;;;;;;;;;;;;;;OAcG;IACH,QAAQ,EAAE,OAAO,CAAC;CACnB;AAoBD,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,MAAM,GAAG,UAAU,CAwBpE;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAGpE"}
|
|
@@ -30,10 +30,14 @@ function settingsPath(projectRoot) {
|
|
|
30
30
|
* `nodePath`/`cliPath` are still taken, but only to seed the shim's *hints*;
|
|
31
31
|
* they no longer appear in the command text.
|
|
32
32
|
*/
|
|
33
|
-
export function hookCommands(_nodePath, _cliPath) {
|
|
33
|
+
export function hookCommands(_nodePath = '', _cliPath = '') {
|
|
34
34
|
const base = shimInvocation();
|
|
35
35
|
return {
|
|
36
|
-
|
|
36
|
+
// `--session-end` declares what the event means, so the recorder drops the
|
|
37
|
+
// session's active-session stash entry. The payload also names the event, and
|
|
38
|
+
// `cost record` accepts either — that fallback is what fixes installs whose
|
|
39
|
+
// command text still predates this flag.
|
|
40
|
+
sessionEnd: `${base} cost record --provider claude-code --detach --session-end ${HOOK_MARKER}`,
|
|
37
41
|
sessionStart: `${base} cost session-start --provider claude-code ${HOOK_MARKER}`,
|
|
38
42
|
};
|
|
39
43
|
}
|
|
@@ -96,25 +100,46 @@ export function removeClaudeCodeHooks(projectRoot) {
|
|
|
96
100
|
delete settings.hooks;
|
|
97
101
|
saveSettings(projectRoot, settings);
|
|
98
102
|
}
|
|
103
|
+
/** Command bodies of our marked hooks under one event, in file order. */
|
|
104
|
+
function markedCommands(groups) {
|
|
105
|
+
return (groups ?? [])
|
|
106
|
+
.flatMap((g) => g.hooks)
|
|
107
|
+
.filter((h) => h.command.endsWith(HOOK_MARKER))
|
|
108
|
+
.map((h) => h.command);
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Whether the marked hooks for one event are exactly what the installer writes:
|
|
112
|
+
* one command, byte-identical. The installer replaces every marked hook with a
|
|
113
|
+
* single group, so anything else is drift.
|
|
114
|
+
*/
|
|
115
|
+
function commandsCurrent(groups, expected) {
|
|
116
|
+
const found = markedCommands(groups);
|
|
117
|
+
return found.length === 1 && found[0] === expected;
|
|
118
|
+
}
|
|
99
119
|
export function claudeCodeHookStatus(projectRoot) {
|
|
100
120
|
let settings;
|
|
101
121
|
try {
|
|
102
122
|
settings = loadSettings(projectRoot);
|
|
103
123
|
}
|
|
104
124
|
catch {
|
|
105
|
-
return { installed: false, legacy: false, shim: null };
|
|
125
|
+
return { installed: false, legacy: false, shim: null, outdated: false };
|
|
106
126
|
}
|
|
107
127
|
const installed = hasMarkedHook(settings.hooks?.SessionEnd) && hasMarkedHook(settings.hooks?.SessionStart);
|
|
128
|
+
// An absent hook is a different condition from a stale one, so nothing that
|
|
129
|
+
// describes staleness is reported for it.
|
|
108
130
|
if (!installed)
|
|
109
|
-
return { installed: false, legacy: false, shim: null };
|
|
131
|
+
return { installed: false, legacy: false, shim: null, outdated: false };
|
|
110
132
|
const cmd = (settings.hooks?.SessionEnd ?? [])
|
|
111
133
|
.flatMap((g) => g.hooks)
|
|
112
134
|
.find((h) => h.command.endsWith(HOOK_MARKER))?.command;
|
|
113
135
|
const legacy = isLegacyCommand(cmd);
|
|
136
|
+
const expected = hookCommands();
|
|
137
|
+
const outdated = !commandsCurrent(settings.hooks?.SessionEnd, expected.sessionEnd) ||
|
|
138
|
+
!commandsCurrent(settings.hooks?.SessionStart, expected.sessionStart);
|
|
114
139
|
// A legacy hook does not go through the shim at all, so the shim's state is
|
|
115
140
|
// not what is wrong with it — reporting both would send the reader down the
|
|
116
141
|
// wrong repair.
|
|
117
|
-
return { installed, legacy, shim: legacy ? null : shimProblem(projectRoot) };
|
|
142
|
+
return { installed, legacy, shim: legacy ? null : shimProblem(projectRoot), outdated };
|
|
118
143
|
}
|
|
119
144
|
/**
|
|
120
145
|
* A hook command predates the shim when it does not invoke it. Matching on the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claude-code.js","sourceRoot":"","sources":["../../../src/cost/hooks/claude-code.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAC7E,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAE1C,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,WAAW,EAAoB,MAAM,WAAW,CAAC;AAErF,MAAM,CAAC,MAAM,WAAW,GAAG,kBAAkB,CAAC;AAmB9C,SAAS,YAAY,CAAC,WAAmB;IACvC,OAAO,IAAI,CAAC,WAAW,EAAE,SAAS,EAAE,eAAe,CAAC,CAAC;AACvD,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,YAAY,CAAC,
|
|
1
|
+
{"version":3,"file":"claude-code.js","sourceRoot":"","sources":["../../../src/cost/hooks/claude-code.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAC7E,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAE1C,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,WAAW,EAAoB,MAAM,WAAW,CAAC;AAErF,MAAM,CAAC,MAAM,WAAW,GAAG,kBAAkB,CAAC;AAmB9C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C,MAAM,QAAQ,GACZ,CAAC,eAAe,CAAC,QAAQ,CAAC,KAAK,EAAE,UAAU,EAAE,QAAQ,CAAC,UAAU,CAAC;QACjE,CAAC,eAAe,CAAC,QAAQ,CAAC,KAAK,EAAE,YAAY,EAAE,QAAQ,CAAC,YAAY,CAAC,CAAC;IACxE,4EAA4E;IAC5E,4EAA4E;IAC5E,gBAAgB;IAChB,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,WAAW,CAAC,WAAW,CAAC,EAAE,QAAQ,EAAE,CAAC;AACzF,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAAC,OAA2B;IACzD,IAAI,CAAC,OAAO;QAAE,OAAO,KAAK,CAAC;IAC3B,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,wBAAwB,CAAC,CAAC;AACrD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kiro.d.ts","sourceRoot":"","sources":["../../../src/cost/hooks/kiro.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,OAAO,EAAgC,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"kiro.d.ts","sourceRoot":"","sources":["../../../src/cost/hooks/kiro.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,OAAO,EAAgC,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAwCjF;;;;;;;;;;;;;GAaG;AACH,wBAAgB,gBAAgB,CAAC,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,CAM7F;AAED,wBAAgB,eAAe,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAGzD;AAED,wBAAgB,cAAc,CAAC,WAAW,EAAE,MAAM,GAAG,UAAU,CAmB9D"}
|
package/dist/cost/hooks/kiro.js
CHANGED
|
@@ -15,6 +15,38 @@ import { shimInvocation, writeShim, shimProblem } from './shim.js';
|
|
|
15
15
|
function hookFilePath(projectRoot) {
|
|
16
16
|
return join(projectRoot, '.kiro', 'hooks', 'aidlc-cost.json');
|
|
17
17
|
}
|
|
18
|
+
/**
|
|
19
|
+
* The hook entries this version installs — the single declaration site, so
|
|
20
|
+
* `kiroHookStatus` can tell an out-of-date command from a current one without
|
|
21
|
+
* restating the text.
|
|
22
|
+
*
|
|
23
|
+
* `Stop` deliberately carries no `--session-end`: it fires after every response,
|
|
24
|
+
* not at session end, and unstashing there would delete a live session's entry
|
|
25
|
+
* dozens of times an hour. Kiro exposes no session-end event, so a kiro entry
|
|
26
|
+
* leaves the stash on the TTL — which is what the liveness rule's
|
|
27
|
+
* "no transcript declared, so unmeasurable" case protects.
|
|
28
|
+
*/
|
|
29
|
+
function kiroHooks() {
|
|
30
|
+
const base = shimInvocation('AIDLC_PROJECT_ROOT');
|
|
31
|
+
return [
|
|
32
|
+
{
|
|
33
|
+
name: 'aidlc-cost-record',
|
|
34
|
+
trigger: 'Stop',
|
|
35
|
+
action: {
|
|
36
|
+
type: 'command',
|
|
37
|
+
command: `${base} cost record --provider kiro --detach ${HOOK_MARKER}`,
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
name: 'aidlc-cost-session-start',
|
|
42
|
+
trigger: 'SessionStart',
|
|
43
|
+
action: {
|
|
44
|
+
type: 'command',
|
|
45
|
+
command: `${base} cost session-start --provider kiro ${HOOK_MARKER}`,
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
];
|
|
49
|
+
}
|
|
18
50
|
/**
|
|
19
51
|
* Install the kiro cost hooks.
|
|
20
52
|
*
|
|
@@ -31,28 +63,7 @@ function hookFilePath(projectRoot) {
|
|
|
31
63
|
*/
|
|
32
64
|
export function installKiroHooks(projectRoot, nodePath, cliPath) {
|
|
33
65
|
writeShim(projectRoot, nodePath, cliPath);
|
|
34
|
-
const
|
|
35
|
-
const file = {
|
|
36
|
-
version: 'v1',
|
|
37
|
-
hooks: [
|
|
38
|
-
{
|
|
39
|
-
name: 'aidlc-cost-record',
|
|
40
|
-
trigger: 'Stop',
|
|
41
|
-
action: {
|
|
42
|
-
type: 'command',
|
|
43
|
-
command: `${base} cost record --provider kiro --detach ${HOOK_MARKER}`,
|
|
44
|
-
},
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
name: 'aidlc-cost-session-start',
|
|
48
|
-
trigger: 'SessionStart',
|
|
49
|
-
action: {
|
|
50
|
-
type: 'command',
|
|
51
|
-
command: `${base} cost session-start --provider kiro ${HOOK_MARKER}`,
|
|
52
|
-
},
|
|
53
|
-
},
|
|
54
|
-
],
|
|
55
|
-
};
|
|
66
|
+
const file = { version: 'v1', hooks: kiroHooks() };
|
|
56
67
|
const path = hookFilePath(projectRoot);
|
|
57
68
|
mkdirSync(dirname(path), { recursive: true });
|
|
58
69
|
writeFileSync(path, JSON.stringify(file, null, 2) + '\n');
|
|
@@ -65,16 +76,21 @@ export function removeKiroHooks(projectRoot) {
|
|
|
65
76
|
export function kiroHookStatus(projectRoot) {
|
|
66
77
|
const path = hookFilePath(projectRoot);
|
|
67
78
|
if (!existsSync(path))
|
|
68
|
-
return { installed: false, legacy: false, shim: null };
|
|
79
|
+
return { installed: false, legacy: false, shim: null, outdated: false };
|
|
69
80
|
try {
|
|
70
81
|
const parsed = JSON.parse(readFileSync(path, 'utf8'));
|
|
71
|
-
const
|
|
82
|
+
const found = (parsed.hooks ?? [])
|
|
83
|
+
.map((h) => h.action?.command)
|
|
84
|
+
.filter((c) => typeof c === 'string' && c.includes(HOOK_MARKER));
|
|
85
|
+
const cmd = found[0];
|
|
72
86
|
const legacy = isLegacyCommand(cmd);
|
|
87
|
+
const expected = kiroHooks().map((h) => h.action.command);
|
|
88
|
+
const outdated = found.length !== expected.length || expected.some((c, i) => found[i] !== c);
|
|
73
89
|
// Kiro's hook file invokes the same generated shim, so it fails the same way.
|
|
74
|
-
return { installed: true, legacy, shim: legacy ? null : shimProblem(projectRoot) };
|
|
90
|
+
return { installed: true, legacy, shim: legacy ? null : shimProblem(projectRoot), outdated };
|
|
75
91
|
}
|
|
76
92
|
catch {
|
|
77
|
-
return { installed: false, legacy: false, shim: null };
|
|
93
|
+
return { installed: false, legacy: false, shim: null, outdated: false };
|
|
78
94
|
}
|
|
79
95
|
}
|
|
80
96
|
//# sourceMappingURL=kiro.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kiro.js","sourceRoot":"","sources":["../../../src/cost/hooks/kiro.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACzF,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,eAAe,EAAmB,MAAM,kBAAkB,CAAC;AACjF,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAEnE,SAAS,YAAY,CAAC,WAAmB;IACvC,OAAO,IAAI,CAAC,WAAW,EAAE,OAAO,EAAE,OAAO,EAAE,iBAAiB,CAAC,CAAC;AAChE,CAAC;AAED
|
|
1
|
+
{"version":3,"file":"kiro.js","sourceRoot":"","sources":["../../../src/cost/hooks/kiro.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACzF,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,eAAe,EAAmB,MAAM,kBAAkB,CAAC;AACjF,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,WAAW,C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