@rasensio/aidlc 1.8.1 → 1.9.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.
- package/dist/cli.js +2 -0
- package/dist/cli.js.map +1 -1
- package/dist/commands/add-action.d.ts.map +1 -1
- package/dist/commands/add-action.js +2 -3
- package/dist/commands/add-action.js.map +1 -1
- package/dist/commands/add-skill.d.ts +28 -0
- package/dist/commands/add-skill.d.ts.map +1 -0
- package/dist/commands/add-skill.js +315 -0
- package/dist/commands/add-skill.js.map +1 -0
- package/dist/commands/add.d.ts +25 -0
- package/dist/commands/add.d.ts.map +1 -0
- package/dist/commands/add.js +29 -0
- package/dist/commands/add.js.map +1 -0
- package/dist/commands/claim.d.ts +9 -0
- package/dist/commands/claim.d.ts.map +1 -1
- package/dist/commands/claim.js +26 -4
- package/dist/commands/claim.js.map +1 -1
- package/dist/commands/cost.d.ts.map +1 -1
- package/dist/commands/cost.js +3 -5
- package/dist/commands/cost.js.map +1 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +1 -10
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/update.d.ts.map +1 -1
- package/dist/commands/update.js +1 -9
- package/dist/commands/update.js.map +1 -1
- package/dist/compile/adapters/claude-code.d.ts.map +1 -1
- package/dist/compile/adapters/claude-code.js +3 -24
- package/dist/compile/adapters/claude-code.js.map +1 -1
- package/dist/compile/adapters/codex.d.ts.map +1 -1
- package/dist/compile/adapters/codex.js +3 -2
- package/dist/compile/adapters/codex.js.map +1 -1
- package/dist/compile/adapters/cursor.d.ts.map +1 -1
- package/dist/compile/adapters/cursor.js +4 -2
- package/dist/compile/adapters/cursor.js.map +1 -1
- package/dist/compile/adapters/kiro.d.ts.map +1 -1
- package/dist/compile/adapters/kiro.js +6 -10
- package/dist/compile/adapters/kiro.js.map +1 -1
- package/dist/compile/adapters/windsurf.d.ts.map +1 -1
- package/dist/compile/adapters/windsurf.js +9 -11
- package/dist/compile/adapters/windsurf.js.map +1 -1
- package/dist/compile/content-root.d.ts +22 -0
- package/dist/compile/content-root.d.ts.map +1 -0
- package/dist/compile/content-root.js +28 -0
- package/dist/compile/content-root.js.map +1 -0
- package/dist/compile/limits.d.ts +20 -0
- package/dist/compile/limits.d.ts.map +1 -0
- package/dist/compile/limits.js +20 -0
- package/dist/compile/limits.js.map +1 -0
- package/dist/compile/naming.d.ts +92 -0
- package/dist/compile/naming.d.ts.map +1 -0
- package/dist/compile/naming.js +105 -0
- package/dist/compile/naming.js.map +1 -0
- package/dist/concurrency/session-id.d.ts +12 -0
- package/dist/concurrency/session-id.d.ts.map +1 -1
- package/dist/concurrency/session-id.js +24 -4
- package/dist/concurrency/session-id.js.map +1 -1
- package/dist/cost/agent.d.ts +48 -0
- package/dist/cost/agent.d.ts.map +1 -0
- package/dist/cost/agent.js +167 -0
- package/dist/cost/agent.js.map +1 -0
- package/dist/cost/providers/index.d.ts +13 -0
- package/dist/cost/providers/index.d.ts.map +1 -0
- package/dist/cost/providers/index.js +23 -0
- package/dist/cost/providers/index.js.map +1 -0
- package/dist/cost/sync.d.ts.map +1 -1
- package/dist/cost/sync.js +114 -37
- package/dist/cost/sync.js.map +1 -1
- package/dist/doctor/migrations/index.d.ts.map +1 -1
- package/dist/doctor/migrations/index.js +2 -0
- package/dist/doctor/migrations/index.js.map +1 -1
- package/dist/doctor/migrations/unknown-agent-claims.d.ts +25 -0
- package/dist/doctor/migrations/unknown-agent-claims.d.ts.map +1 -0
- package/dist/doctor/migrations/unknown-agent-claims.js +82 -0
- package/dist/doctor/migrations/unknown-agent-claims.js.map +1 -0
- package/dist/operational/discover.d.ts +89 -0
- package/dist/operational/discover.d.ts.map +1 -0
- package/dist/operational/discover.js +132 -0
- package/dist/operational/discover.js.map +1 -0
- package/dist/operational/emit.d.ts +93 -0
- package/dist/operational/emit.d.ts.map +1 -0
- package/dist/operational/emit.js +227 -0
- package/dist/operational/emit.js.map +1 -0
- package/dist/operational/knowledge.d.ts +64 -0
- package/dist/operational/knowledge.d.ts.map +1 -0
- package/dist/operational/knowledge.js +144 -0
- package/dist/operational/knowledge.js.map +1 -0
- package/dist/operational/packagers.d.ts +67 -0
- package/dist/operational/packagers.d.ts.map +1 -0
- package/dist/operational/packagers.js +252 -0
- package/dist/operational/packagers.js.map +1 -0
- package/dist/operational/redact.d.ts +49 -0
- package/dist/operational/redact.d.ts.map +1 -0
- package/dist/operational/redact.js +135 -0
- package/dist/operational/redact.js.map +1 -0
- package/dist/operational/schema.d.ts +80 -0
- package/dist/operational/schema.d.ts.map +1 -0
- package/dist/operational/schema.js +205 -0
- package/dist/operational/schema.js.map +1 -0
- package/dist/operational/verify.d.ts +100 -0
- package/dist/operational/verify.d.ts.map +1 -0
- package/dist/operational/verify.js +175 -0
- package/dist/operational/verify.js.map +1 -0
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kiro.js","sourceRoot":"","sources":["../../../src/compile/adapters/kiro.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;
|
|
1
|
+
{"version":3,"file":"kiro.js","sourceRoot":"","sources":["../../../src/compile/adapters/kiro.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAaH,OAAO,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAE1E,8EAA8E;AAC9E,UAAU;AACV,8EAA8E;AAE9E;;;;;GAKG;AACH,SAAS,aAAa,CAAC,IAAY;IACjC,OAAO,kBAAkB,CAAC,IAAI,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;AACpD,CAAC;AAED;;;;;;;GAOG;AACH,SAAS,iBAAiB,CACxB,KAAY,EACZ,IAA0B;IAE1B,gCAAgC;IAChC,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,gBAAgB,EAAE,IAAI,CAAC;IAC/C,IAAI,IAAI,EAAE,CAAC;QACT,OAAO,IAAI,CAAC;IACd,CAAC;IA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,8EAA8E;AAC9E,mBAAmB;AACnB,8EAA8E;AAE9E;;GAEG;AACH,SAAS,oBAAoB,CAAC,KAAY;IACxC,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAClB,KAAK,CAAC,IAAI,CAAC,SAAS,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;IACvC,KAAK,CAAC,IAAI,CAAC,gBAAgB,KAAK,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC;IACrD,KAAK,CAAC,IAAI,CAAC,UAAU,KAAK,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC;IACzC,IAAI,KAAK,CAAC,IAAI,CAAC,QAAQ,KAAK,SAAS,EAAE,CAAC;QACtC,KAAK,CAAC,IAAI,CAAC,aAAa,KAAK,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;IACjD,CAAC;IACD,IAAI,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;QACvB,KAAK,CAAC,IAAI,CAAC,YAAY,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC;IAC/C,CAAC;IACD,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAClB,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACvB,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"windsurf.d.ts","sourceRoot":"","sources":["../../../src/compile/adapters/windsurf.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,KAAK,EACV,eAAe,EAOhB,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"windsurf.d.ts","sourceRoot":"","sources":["../../../src/compile/adapters/windsurf.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,KAAK,EACV,eAAe,EAOhB,MAAM,qBAAqB,CAAC;AA0K7B,eAAO,MAAM,eAAe,EAAE,eA0G7B,CAAC"}
|
|
@@ -20,24 +20,22 @@
|
|
|
20
20
|
*
|
|
21
21
|
* @module
|
|
22
22
|
*/
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
// ---------------------------------------------------------------------------
|
|
26
|
-
/** Maximum characters allowed per rule file. */
|
|
27
|
-
const MAX_FILE_CHARS = 6000;
|
|
28
|
-
/** Maximum total characters across all rule files. */
|
|
29
|
-
const MAX_TOTAL_CHARS = 12000;
|
|
30
|
-
/** Warning threshold — warn when total approaches this percentage of the limit. */
|
|
31
|
-
const TOTAL_WARN_THRESHOLD = 0.85;
|
|
23
|
+
import { prefixedRuleFilename, skillSlug as sharedSkillSlug } from '../naming.js';
|
|
24
|
+
import { MAX_FILE_CHARS, MAX_TOTAL_CHARS, TOTAL_WARN_THRESHOLD } from '../limits.js';
|
|
32
25
|
// ---------------------------------------------------------------------------
|
|
33
26
|
// Helpers
|
|
34
27
|
// ---------------------------------------------------------------------------
|
|
35
28
|
/**
|
|
36
29
|
* Derive a short filename-safe slug from a skill name.
|
|
37
30
|
* E.g., "aidlc-implementation" -> "aidlc-implementation"
|
|
31
|
+
*
|
|
32
|
+
* Windsurf's slug is deliberately weaker than the claude-code/kiro directory
|
|
33
|
+
* convention — it neither collapses hyphen runs nor truncates. Shared via
|
|
34
|
+
* naming.ts but kept distinct, because unifying them would change windsurf's
|
|
35
|
+
* output for non-conforming names and AC-33 forbids that here.
|
|
38
36
|
*/
|
|
39
37
|
function skillSlug(skill) {
|
|
40
|
-
return skill.meta.name
|
|
38
|
+
return sharedSkillSlug(skill.meta.name);
|
|
41
39
|
}
|
|
42
40
|
/**
|
|
43
41
|
* Determine the canonical skill filename for `.aidlc/skills/`.
|
|
@@ -214,7 +212,7 @@ export const windsurfAdapter = {
|
|
|
214
212
|
totalChars += ruleContent.length;
|
|
215
213
|
ops.push({
|
|
216
214
|
kind: 'create',
|
|
217
|
-
path: `.windsurf/rules
|
|
215
|
+
path: `.windsurf/rules/${prefixedRuleFilename(skillSlug(skill), '.md')}`,
|
|
218
216
|
content: ruleContent,
|
|
219
217
|
});
|
|
220
218
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"windsurf.js","sourceRoot":"","sources":["../../../src/compile/adapters/windsurf.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;
|
|
1
|
+
{"version":3,"file":"windsurf.js","sourceRoot":"","sources":["../../../src/compile/adapters/windsurf.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAWH,OAAO,EAAE,oBAAoB,EAAE,SAAS,IAAI,eAAe,EAAE,MAAM,cAAc,CAAC;AAClF,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAErF,8EAA8E;AAC9E,UAAU;AACV,8EAA8E;AAE9E;;;;;;;;GAQG;AACH,SAAS,SAAS,CAAC,KAAY;IAC7B,OAAO,eAAe,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1C,CAAC;AAED;;;GAGG;AACH,SAAS,sBAAsB,CAAC,KAAY;IAC1C,OAAO,GAAG,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC;AAClC,CAAC;AAED;;GAEG;AACH,SAAS,qBAAqB,CAAC,KAAY;IACzC,MAAM,KAAK,GAAa,CAAC,KAAK,CAAC,CAAC;IAChC,KAAK,CAAC,IAAI,CAAC,SAAS,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;IACvC,KAAK,CAAC,IAAI,CAAC,gBAAgB,KAAK,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC;IACrD,KAAK,CAAC,IAAI,CAAC,UAAU,KAAK,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC;I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CAAC,IAAI,CACT,QAAQ,EAAE,CAAC,IAAI,qCAAqC,SAAS,MAAM,cAAc,QAAQ,CAC1F,CAAC;QACJ,CAAC;QAED,mCAAmC;QACnC,IAAI,SAAS,GAAG,cAAc,GAAG,oBAAoB,IAAI,SAAS,IAAI,cAAc,EAAE,CAAC;YACrF,QAAQ,CAAC,IAAI,CACX,QAAQ,EAAE,CAAC,IAAI,uCAAuC,SAAS,IAAI,cAAc,QAAQ,CAC1F,CAAC;QACJ,CAAC;QAED,OAAO,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC;IAC1D,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Content-package location.
|
|
3
|
+
*
|
|
4
|
+
* `init.ts` and `update.ts` each defined this privately and identically. The
|
|
5
|
+
* operational-skill emitter is the third caller — it reads the verification-steps
|
|
6
|
+
* source straight from the installed package rather than from a project-level
|
|
7
|
+
* `.aidlc/guidance/` directory (AC-36) — so it moves here rather than being
|
|
8
|
+
* copied a third time.
|
|
9
|
+
*
|
|
10
|
+
* @module
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* Resolve the content package root directory (where `skills/`, `guidance/`,
|
|
14
|
+
* `templates/`, and `capabilities/` live).
|
|
15
|
+
*
|
|
16
|
+
* Uses module resolution rather than a relative path so it works from a global
|
|
17
|
+
* install, a workspace link, and a linked worktree alike.
|
|
18
|
+
*
|
|
19
|
+
* @returns Absolute path to the `@rasensio/aidlc-content` package root.
|
|
20
|
+
*/
|
|
21
|
+
export declare function getContentPackageRoot(): string;
|
|
22
|
+
//# sourceMappingURL=content-root.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"content-root.d.ts","sourceRoot":"","sources":["../../src/compile/content-root.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAKH;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,IAAI,MAAM,CAI9C"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Content-package location.
|
|
3
|
+
*
|
|
4
|
+
* `init.ts` and `update.ts` each defined this privately and identically. The
|
|
5
|
+
* operational-skill emitter is the third caller — it reads the verification-steps
|
|
6
|
+
* source straight from the installed package rather than from a project-level
|
|
7
|
+
* `.aidlc/guidance/` directory (AC-36) — so it moves here rather than being
|
|
8
|
+
* copied a third time.
|
|
9
|
+
*
|
|
10
|
+
* @module
|
|
11
|
+
*/
|
|
12
|
+
import { createRequire } from 'node:module';
|
|
13
|
+
import { dirname } from 'node:path';
|
|
14
|
+
/**
|
|
15
|
+
* Resolve the content package root directory (where `skills/`, `guidance/`,
|
|
16
|
+
* `templates/`, and `capabilities/` live).
|
|
17
|
+
*
|
|
18
|
+
* Uses module resolution rather than a relative path so it works from a global
|
|
19
|
+
* install, a workspace link, and a linked worktree alike.
|
|
20
|
+
*
|
|
21
|
+
* @returns Absolute path to the `@rasensio/aidlc-content` package root.
|
|
22
|
+
*/
|
|
23
|
+
export function getContentPackageRoot() {
|
|
24
|
+
const require = createRequire(import.meta.url);
|
|
25
|
+
const contentPkgPath = require.resolve('@rasensio/aidlc-content/package.json');
|
|
26
|
+
return dirname(contentPkgPath);
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=content-root.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"content-root.js","sourceRoot":"","sources":["../../src/compile/content-root.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC;;;;;;;;GAQG;AACH,MAAM,UAAU,qBAAqB;IACnC,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC/C,MAAM,cAAc,GAAG,OAAO,CAAC,OAAO,CAAC,sCAAsC,CAAC,CAAC;IAC/E,OAAO,OAAO,CAAC,cAAc,CAAC,CAAC;AACjC,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Platform-imposed size budgets for emitted rule files.
|
|
3
|
+
*
|
|
4
|
+
* Extracted from the windsurf adapter so operational packaging can enforce the
|
|
5
|
+
* same per-file ceiling instead of hardcoding a second copy of the number.
|
|
6
|
+
*
|
|
7
|
+
* Known limitation (AC-48): `MAX_TOTAL_CHARS` is enforced *within* a single
|
|
8
|
+
* InstallPlan. Framework and operational emission produce separate plans, so
|
|
9
|
+
* neither sees the other's contribution to the total. The per-file cap is
|
|
10
|
+
* enforced for both; the cross-plan total is not.
|
|
11
|
+
*
|
|
12
|
+
* @module
|
|
13
|
+
*/
|
|
14
|
+
/** Windsurf per-rule-file character ceiling. */
|
|
15
|
+
export declare const MAX_FILE_CHARS = 6000;
|
|
16
|
+
/** Windsurf total-rules character ceiling across all rule files. */
|
|
17
|
+
export declare const MAX_TOTAL_CHARS = 12000;
|
|
18
|
+
/** Fraction of a ceiling at which a warning is emitted. */
|
|
19
|
+
export declare const TOTAL_WARN_THRESHOLD = 0.85;
|
|
20
|
+
//# sourceMappingURL=limits.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"limits.d.ts","sourceRoot":"","sources":["../../src/compile/limits.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,gDAAgD;AAChD,eAAO,MAAM,cAAc,OAAO,CAAC;AAEnC,oEAAoE;AACpE,eAAO,MAAM,eAAe,QAAQ,CAAC;AAErC,2DAA2D;AAC3D,eAAO,MAAM,oBAAoB,OAAO,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Platform-imposed size budgets for emitted rule files.
|
|
3
|
+
*
|
|
4
|
+
* Extracted from the windsurf adapter so operational packaging can enforce the
|
|
5
|
+
* same per-file ceiling instead of hardcoding a second copy of the number.
|
|
6
|
+
*
|
|
7
|
+
* Known limitation (AC-48): `MAX_TOTAL_CHARS` is enforced *within* a single
|
|
8
|
+
* InstallPlan. Framework and operational emission produce separate plans, so
|
|
9
|
+
* neither sees the other's contribution to the total. The per-file cap is
|
|
10
|
+
* enforced for both; the cross-plan total is not.
|
|
11
|
+
*
|
|
12
|
+
* @module
|
|
13
|
+
*/
|
|
14
|
+
/** Windsurf per-rule-file character ceiling. */
|
|
15
|
+
export const MAX_FILE_CHARS = 6000;
|
|
16
|
+
/** Windsurf total-rules character ceiling across all rule files. */
|
|
17
|
+
export const MAX_TOTAL_CHARS = 12000;
|
|
18
|
+
/** Fraction of a ceiling at which a warning is emitted. */
|
|
19
|
+
export const TOTAL_WARN_THRESHOLD = 0.85;
|
|
20
|
+
//# sourceMappingURL=limits.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"limits.js","sourceRoot":"","sources":["../../src/compile/limits.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,gDAAgD;AAChD,MAAM,CAAC,MAAM,cAAc,GAAG,IAAI,CAAC;AAEnC,oEAAoE;AACpE,MAAM,CAAC,MAAM,eAAe,GAAG,KAAK,CAAC;AAErC,2DAA2D;AAC3D,MAAM,CAAC,MAAM,oBAAoB,GAAG,IAAI,CAAC"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared skill-naming conventions for platform packaging.
|
|
3
|
+
*
|
|
4
|
+
* Before this module the five adapters each restated their own naming rules in
|
|
5
|
+
* a private helper, so framework and operational packaging could drift apart
|
|
6
|
+
* (AC-34). The helpers were *not* equivalent — they implemented three distinct
|
|
7
|
+
* behaviours — so this module exposes the behaviour space explicitly rather than
|
|
8
|
+
* collapsing them into one function and silently changing adapter output:
|
|
9
|
+
*
|
|
10
|
+
* | Caller | Function | Behaviour |
|
|
11
|
+
* |---------------------|---------------------------|---------------------------------------------|
|
|
12
|
+
* | claude-code, kiro | `normalizeSkillName` | substitute, collapse, trim, prefix, truncate |
|
|
13
|
+
* | windsurf | `skillSlug` | lowercase + substitute only |
|
|
14
|
+
* | cursor, codex | `canonicalSkillFilename` | pass-through |
|
|
15
|
+
*
|
|
16
|
+
* Prefixing is a caller choice, never unconditional (AC-41): framework emission
|
|
17
|
+
* passes `prefix: true`, operational emission passes `prefix: false`. That is
|
|
18
|
+
* what lets operational skills stay out of the reserved `aidlc-` namespace
|
|
19
|
+
* (AC-19) while still reusing these conventions.
|
|
20
|
+
*
|
|
21
|
+
* Requirements: AC-19, AC-33, AC-34, AC-41
|
|
22
|
+
*
|
|
23
|
+
* @module
|
|
24
|
+
*/
|
|
25
|
+
/** Maximum length for a platform skill directory or file name. */
|
|
26
|
+
export declare const MAX_SKILL_NAME_LENGTH = 64;
|
|
27
|
+
/** The namespace prefix reserved for framework-owned skills. */
|
|
28
|
+
export declare const FRAMEWORK_PREFIX = "aidlc-";
|
|
29
|
+
/** Options controlling how a skill name becomes a path segment. */
|
|
30
|
+
export interface SkillNameOpts {
|
|
31
|
+
/**
|
|
32
|
+
* Apply the reserved `aidlc-` framework prefix. Always explicit — an
|
|
33
|
+
* unconditional prefix is what made AC-19 and AC-34 contradictory (AC-41).
|
|
34
|
+
*/
|
|
35
|
+
prefix: boolean;
|
|
36
|
+
/** Collapse runs of hyphens and trim leading/trailing ones. Default true. */
|
|
37
|
+
collapse?: boolean;
|
|
38
|
+
/** Truncate to this length. Default `MAX_SKILL_NAME_LENGTH`; 0 disables. */
|
|
39
|
+
truncate?: number;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Normalize a skill name into a filesystem-safe path segment.
|
|
43
|
+
*
|
|
44
|
+
* This is the claude-code / kiro directory convention: lowercase, non-charset
|
|
45
|
+
* characters substituted with hyphens, hyphen runs collapsed, ends trimmed,
|
|
46
|
+
* optionally prefixed, then truncated.
|
|
47
|
+
*
|
|
48
|
+
* @param name - Raw skill name.
|
|
49
|
+
* @param opts - Prefix choice plus optional collapse/truncate overrides.
|
|
50
|
+
* @returns A lowercase hyphenated segment safe to use as a directory name.
|
|
51
|
+
*/
|
|
52
|
+
export declare function normalizeSkillName(name: string, opts: SkillNameOpts): string;
|
|
53
|
+
/**
|
|
54
|
+
* Windsurf's weaker slug: lowercase and substitute, but neither collapse nor
|
|
55
|
+
* truncate nor prefix.
|
|
56
|
+
*
|
|
57
|
+
* Deliberately not unified with `normalizeSkillName`. The two agree on every
|
|
58
|
+
* name shipped today (all are already lowercase-hyphenated), but they diverge on
|
|
59
|
+
* non-conforming input, and changing windsurf's output would violate AC-33.
|
|
60
|
+
* `test/golden-adapters-refactor.test.ts` pins the difference.
|
|
61
|
+
*
|
|
62
|
+
* @param name - Raw skill name.
|
|
63
|
+
* @returns A lowercase slug with non-charset characters substituted.
|
|
64
|
+
*/
|
|
65
|
+
export declare function skillSlug(name: string): string;
|
|
66
|
+
/**
|
|
67
|
+
* The canonical `.aidlc/skills/` filename convention: the skill name verbatim
|
|
68
|
+
* plus `.md`.
|
|
69
|
+
*
|
|
70
|
+
* Used by claude-code, kiro, cursor, and codex. Windsurf routes its canonical
|
|
71
|
+
* filename through `skillSlug` instead — a pre-existing inconsistency preserved
|
|
72
|
+
* here rather than fixed, per AC-33.
|
|
73
|
+
*
|
|
74
|
+
* @param name - Raw skill name.
|
|
75
|
+
* @returns `<name>.md`.
|
|
76
|
+
*/
|
|
77
|
+
export declare function canonicalSkillFilename(name: string): string;
|
|
78
|
+
/**
|
|
79
|
+
* Build a platform rule/file name carrying the framework prefix.
|
|
80
|
+
*
|
|
81
|
+
* Several adapters built this prefix inline in a template literal
|
|
82
|
+
* (`.cursor/rules/aidlc-${name}.mdc`), which meant re-pointing the helpers alone
|
|
83
|
+
* would have left the convention restated per platform — the drift AC-34 exists
|
|
84
|
+
* to prevent. Note this reproduces the existing double-prefix for framework
|
|
85
|
+
* skills (`aidlc-aidlc-overview`), which AC-33 requires us to preserve.
|
|
86
|
+
*
|
|
87
|
+
* @param name - Raw skill name (or slug).
|
|
88
|
+
* @param ext - File extension including the dot, e.g. `.mdc`.
|
|
89
|
+
* @returns `aidlc-<name><ext>`.
|
|
90
|
+
*/
|
|
91
|
+
export declare function prefixedRuleFilename(name: string, ext: string): string;
|
|
92
|
+
//# sourceMappingURL=naming.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"naming.d.ts","sourceRoot":"","sources":["../../src/compile/naming.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,kEAAkE;AAClE,eAAO,MAAM,qBAAqB,KAAK,CAAC;AAQxC,gEAAgE;AAChE,eAAO,MAAM,gBAAgB,WAAW,CAAC;AAEzC,mEAAmE;AACnE,MAAM,WAAW,aAAa;IAC5B;;;OAGG;IACH,MAAM,EAAE,OAAO,CAAC;IAChB,6EAA6E;IAC7E,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,4EAA4E;IAC5E,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,aAAa,GAAG,MAAM,CAmB5E;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE9C;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE3D;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAEtE"}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared skill-naming conventions for platform packaging.
|
|
3
|
+
*
|
|
4
|
+
* Before this module the five adapters each restated their own naming rules in
|
|
5
|
+
* a private helper, so framework and operational packaging could drift apart
|
|
6
|
+
* (AC-34). The helpers were *not* equivalent — they implemented three distinct
|
|
7
|
+
* behaviours — so this module exposes the behaviour space explicitly rather than
|
|
8
|
+
* collapsing them into one function and silently changing adapter output:
|
|
9
|
+
*
|
|
10
|
+
* | Caller | Function | Behaviour |
|
|
11
|
+
* |---------------------|---------------------------|---------------------------------------------|
|
|
12
|
+
* | claude-code, kiro | `normalizeSkillName` | substitute, collapse, trim, prefix, truncate |
|
|
13
|
+
* | windsurf | `skillSlug` | lowercase + substitute only |
|
|
14
|
+
* | cursor, codex | `canonicalSkillFilename` | pass-through |
|
|
15
|
+
*
|
|
16
|
+
* Prefixing is a caller choice, never unconditional (AC-41): framework emission
|
|
17
|
+
* passes `prefix: true`, operational emission passes `prefix: false`. That is
|
|
18
|
+
* what lets operational skills stay out of the reserved `aidlc-` namespace
|
|
19
|
+
* (AC-19) while still reusing these conventions.
|
|
20
|
+
*
|
|
21
|
+
* Requirements: AC-19, AC-33, AC-34, AC-41
|
|
22
|
+
*
|
|
23
|
+
* @module
|
|
24
|
+
*/
|
|
25
|
+
/** Maximum length for a platform skill directory or file name. */
|
|
26
|
+
export const MAX_SKILL_NAME_LENGTH = 64;
|
|
27
|
+
/**
|
|
28
|
+
* The one skill that never takes the `aidlc-` prefix: the bare entry point.
|
|
29
|
+
* Both prefixing adapters exempt it, so the shared helper must too.
|
|
30
|
+
*/
|
|
31
|
+
const BARE_ENTRY_POINT = 'aidlc';
|
|
32
|
+
/** The namespace prefix reserved for framework-owned skills. */
|
|
33
|
+
export const FRAMEWORK_PREFIX = 'aidlc-';
|
|
34
|
+
/**
|
|
35
|
+
* Normalize a skill name into a filesystem-safe path segment.
|
|
36
|
+
*
|
|
37
|
+
* This is the claude-code / kiro directory convention: lowercase, non-charset
|
|
38
|
+
* characters substituted with hyphens, hyphen runs collapsed, ends trimmed,
|
|
39
|
+
* optionally prefixed, then truncated.
|
|
40
|
+
*
|
|
41
|
+
* @param name - Raw skill name.
|
|
42
|
+
* @param opts - Prefix choice plus optional collapse/truncate overrides.
|
|
43
|
+
* @returns A lowercase hyphenated segment safe to use as a directory name.
|
|
44
|
+
*/
|
|
45
|
+
export function normalizeSkillName(name, opts) {
|
|
46
|
+
const collapse = opts.collapse ?? true;
|
|
47
|
+
const truncate = opts.truncate ?? MAX_SKILL_NAME_LENGTH;
|
|
48
|
+
let normalized = name.toLowerCase().replace(/[^a-z0-9-]/g, '-');
|
|
49
|
+
if (collapse) {
|
|
50
|
+
normalized = normalized.replace(/-+/g, '-').replace(/^-|-$/g, '');
|
|
51
|
+
}
|
|
52
|
+
if (opts.prefix && normalized !== BARE_ENTRY_POINT && !normalized.startsWith(FRAMEWORK_PREFIX)) {
|
|
53
|
+
normalized = `${FRAMEWORK_PREFIX}${normalized}`;
|
|
54
|
+
}
|
|
55
|
+
if (truncate > 0 && normalized.length > truncate) {
|
|
56
|
+
normalized = normalized.slice(0, truncate);
|
|
57
|
+
}
|
|
58
|
+
return normalized;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Windsurf's weaker slug: lowercase and substitute, but neither collapse nor
|
|
62
|
+
* truncate nor prefix.
|
|
63
|
+
*
|
|
64
|
+
* Deliberately not unified with `normalizeSkillName`. The two agree on every
|
|
65
|
+
* name shipped today (all are already lowercase-hyphenated), but they diverge on
|
|
66
|
+
* non-conforming input, and changing windsurf's output would violate AC-33.
|
|
67
|
+
* `test/golden-adapters-refactor.test.ts` pins the difference.
|
|
68
|
+
*
|
|
69
|
+
* @param name - Raw skill name.
|
|
70
|
+
* @returns A lowercase slug with non-charset characters substituted.
|
|
71
|
+
*/
|
|
72
|
+
export function skillSlug(name) {
|
|
73
|
+
return name.toLowerCase().replace(/[^a-z0-9-]/g, '-');
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* The canonical `.aidlc/skills/` filename convention: the skill name verbatim
|
|
77
|
+
* plus `.md`.
|
|
78
|
+
*
|
|
79
|
+
* Used by claude-code, kiro, cursor, and codex. Windsurf routes its canonical
|
|
80
|
+
* filename through `skillSlug` instead — a pre-existing inconsistency preserved
|
|
81
|
+
* here rather than fixed, per AC-33.
|
|
82
|
+
*
|
|
83
|
+
* @param name - Raw skill name.
|
|
84
|
+
* @returns `<name>.md`.
|
|
85
|
+
*/
|
|
86
|
+
export function canonicalSkillFilename(name) {
|
|
87
|
+
return `${name}.md`;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Build a platform rule/file name carrying the framework prefix.
|
|
91
|
+
*
|
|
92
|
+
* Several adapters built this prefix inline in a template literal
|
|
93
|
+
* (`.cursor/rules/aidlc-${name}.mdc`), which meant re-pointing the helpers alone
|
|
94
|
+
* would have left the convention restated per platform — the drift AC-34 exists
|
|
95
|
+
* to prevent. Note this reproduces the existing double-prefix for framework
|
|
96
|
+
* skills (`aidlc-aidlc-overview`), which AC-33 requires us to preserve.
|
|
97
|
+
*
|
|
98
|
+
* @param name - Raw skill name (or slug).
|
|
99
|
+
* @param ext - File extension including the dot, e.g. `.mdc`.
|
|
100
|
+
* @returns `aidlc-<name><ext>`.
|
|
101
|
+
*/
|
|
102
|
+
export function prefixedRuleFilename(name, ext) {
|
|
103
|
+
return `${FRAMEWORK_PREFIX}${name}${ext}`;
|
|
104
|
+
}
|
|
105
|
+
//# sourceMappingURL=naming.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"naming.js","sourceRoot":"","sources":["../../src/compile/naming.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,kEAAkE;AAClE,MAAM,CAAC,MAAM,qBAAqB,GAAG,EAAE,CAAC;AAExC;;;GAGG;AACH,MAAM,gBAAgB,GAAG,OAAO,CAAC;AAEjC,gEAAgE;AAChE,MAAM,CAAC,MAAM,gBAAgB,GAAG,QAAQ,CAAC;AAezC;;;;;;;;;;GAUG;AACH,MAAM,UAAU,kBAAkB,CAAC,IAAY,EAAE,IAAmB;IAClE,MAAM,QA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|
|
14
14
|
* neither stash nor set the env var).
|
|
15
15
|
*/
|
|
16
|
+
import { type AgentMissReason } from '../cost/agent.js';
|
|
16
17
|
export interface SessionIdentity {
|
|
17
18
|
id: string;
|
|
18
19
|
source: 'platform' | 'agent';
|
|
19
20
|
agent: string;
|
|
21
|
+
/** Set when `agent` could not be determined — the caller warns (AC-5). */
|
|
22
|
+
agentMiss: AgentMissReason | null;
|
|
20
23
|
}
|
|
24
|
+
/**
|
|
25
|
+
* Session identity and platform are resolved independently.
|
|
26
|
+
*
|
|
27
|
+
* The id falls back to a synthetic `agent-<uuid>` whenever the stash cannot
|
|
28
|
+
* name a single session, but the *platform* is often still determinable — from
|
|
29
|
+
* stash agreement or provider detection. Deriving both from the same
|
|
30
|
+
* single-candidate rule is what made every claim record `agent: "unknown"`
|
|
31
|
+
* (cost-claim-attribution/AC-1, AC-4).
|
|
32
|
+
*/
|
|
21
33
|
export declare function resolveSessionIdentity(projectRoot: string): SessionIdentity;
|
|
22
34
|
//# sourceMappingURL=session-id.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session-id.d.ts","sourceRoot":"","sources":["../../src/concurrency/session-id.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;
|
|
1
|
+
{"version":3,"file":"session-id.d.ts","sourceRoot":"","sources":["../../src/concurrency/session-id.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,OAAO,EAAgB,KAAK,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAEtE,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,UAAU,GAAG,OAAO,CAAC;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,0EAA0E;IAC1E,SAAS,EAAE,eAAe,GAAG,IAAI,CAAC;CACnC;AAID;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CAAC,WAAW,EAAE,MAAM,GAAG,eAAe,CAyB3E"}
|
|
@@ -15,21 +15,41 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import { randomUUID } from 'node:crypto';
|
|
17
17
|
import { resolveCurrentSession } from '../cost/sessions.js';
|
|
18
|
+
import { resolveAgent } from '../cost/agent.js';
|
|
18
19
|
let processAgentId = null;
|
|
20
|
+
/**
|
|
21
|
+
* Session identity and platform are resolved independently.
|
|
22
|
+
*
|
|
23
|
+
* The id falls back to a synthetic `agent-<uuid>` whenever the stash cannot
|
|
24
|
+
* name a single session, but the *platform* is often still determinable — from
|
|
25
|
+
* stash agreement or provider detection. Deriving both from the same
|
|
26
|
+
* single-candidate rule is what made every claim record `agent: "unknown"`
|
|
27
|
+
* (cost-claim-attribution/AC-1, AC-4).
|
|
28
|
+
*/
|
|
19
29
|
export function resolveSessionIdentity(projectRoot) {
|
|
30
|
+
const resolved = resolveAgent(projectRoot);
|
|
31
|
+
const platform = { agent: resolved.agent, agentMiss: resolved.reason };
|
|
20
32
|
const envId = process.env.AIDLC_SESSION_ID;
|
|
21
33
|
if (envId && envId.trim() !== '') {
|
|
22
34
|
return {
|
|
23
35
|
id: envId.trim(),
|
|
24
36
|
source: envId.trim().startsWith('agent-') ? 'agent' : 'platform',
|
|
25
|
-
|
|
37
|
+
...platform,
|
|
26
38
|
};
|
|
27
39
|
}
|
|
28
40
|
const active = resolveCurrentSession(projectRoot);
|
|
29
|
-
|
|
30
|
-
|
|
41
|
+
// A resolved stash entry names the platform directly — strongest evidence
|
|
42
|
+
// there is, short of an explicit AIDLC_AGENT.
|
|
43
|
+
if (active) {
|
|
44
|
+
return {
|
|
45
|
+
id: active.session_id,
|
|
46
|
+
source: 'platform',
|
|
47
|
+
agent: resolved.via === 'env' ? resolved.agent : active.agent,
|
|
48
|
+
agentMiss: null,
|
|
49
|
+
};
|
|
50
|
+
}
|
|
31
51
|
if (processAgentId === null)
|
|
32
52
|
processAgentId = `agent-${randomUUID()}`;
|
|
33
|
-
return { id: processAgentId, source: 'agent',
|
|
53
|
+
return { id: processAgentId, source: 'agent', ...platform };
|
|
34
54
|
}
|
|
35
55
|
//# sourceMappingURL=session-id.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session-id.js","sourceRoot":"","sources":["../../src/concurrency/session-id.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"session-id.js","sourceRoot":"","sources":["../../src/concurrency/session-id.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAwB,MAAM,kBAAkB,CAAC;AAUtE,IAAI,cAAc,GAAkB,IAAI,CAAC;AAEzC;;;;;;;;GAQG;AACH,MAAM,UAAU,sBAAsB,CAAC,WAAmB;IACxD,MAAM,QAAQ,GAAG,YAAY,CAAC,WAAW,CAAC,CAAC;IAC3C,MAAM,QAAQ,GAAG,EAAE,KAAK,EAAE,QAAQ,CAAC,KAAK,EAAE,SAAS,EAAE,QAAQ,CAAC,MAAM,EAAE,CAAC;IAEvE,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC;IAC3C,IAAI,KAAK,IAAI,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC;QACjC,OAAO;YACL,EAAE,EAAE,KAAK,CAAC,IAAI,EAAE;YAChB,MAAM,EAAE,KAAK,CAAC,IAAI,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,UAAU;YAChE,GAAG,QAAQ;SACZ,CAAC;IACJ,CAAC;IACD,MAAM,MAAM,GAAG,qBAAqB,CAAC,WAAW,CAAC,CAAC;IAClD,0EAA0E;IAC1E,8CAA8C;IAC9C,IAAI,MAAM,EAAE,CAAC;QACX,OAAO;YACL,EAAE,EAAE,MAAM,CAAC,UAAU;YACrB,MAAM,EAAE,UAAU;YAClB,KAAK,EAAE,QAAQ,CAAC,GAAG,KAAK,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK;YAC7D,SAAS,EAAE,IAAI;SAChB,CAAC;IACJ,CAAC;IACD,IAAI,cAAc,KAAK,IAAI;QAAE,cAAc,GAAG,SAAS,UAAU,EAAE,EAAE,CAAC;IACtE,OAAO,EAAE,EAAE,EAAE,cAAc,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,QAAQ,EAAE,CAAC;AAC9D,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Platform ("agent") resolution for session events.
|
|
3
|
+
*
|
|
4
|
+
* Every `sessions.ndjson` event carries an `agent` field naming the platform
|
|
5
|
+
* the session ran on. `aidlc cost sync` resolves a CostProvider by that name,
|
|
6
|
+
* so a wrong or absent value costs the session its attribution permanently.
|
|
7
|
+
*
|
|
8
|
+
* The four write sites used to read `process.env.AIDLC_AGENT ?? 'unknown'`
|
|
9
|
+
* directly, and nothing in the framework ever set that variable — so every
|
|
10
|
+
* real claim recorded `unknown` and every session's usage went unattributed
|
|
11
|
+
* (cost-claim-attribution: 8 instances, 484 unattributed entries). Resolution
|
|
12
|
+
* order here, strongest evidence first:
|
|
13
|
+
*
|
|
14
|
+
* 1. AIDLC_AGENT — an explicit declaration by an agent that knows its own
|
|
15
|
+
* platform always wins (AC-3).
|
|
16
|
+
* 2. Stash agreement — the SessionStart stash records the platform directly.
|
|
17
|
+
* When several entries match this repo but all agree on `agent`, that
|
|
18
|
+
* agreement is usable even though the *session id* stays ambiguous (AC-4).
|
|
19
|
+
* Agent resolution and session-id resolution are independent questions.
|
|
20
|
+
* 3. Provider detection — exactly one detected provider names the platform
|
|
21
|
+
* (AC-1). Several or none is genuinely undetermined (AC-5).
|
|
22
|
+
*
|
|
23
|
+
* `unknown` remains a legal value: it means "nobody could tell", not "nobody
|
|
24
|
+
* looked". Resolution is fail-soft throughout — it must never fail a claim
|
|
25
|
+
* (AC-6, NFR-2).
|
|
26
|
+
*/
|
|
27
|
+
/** The value recorded when the platform cannot be determined. */
|
|
28
|
+
export declare const UNKNOWN_AGENT = "unknown";
|
|
29
|
+
/** Why resolution fell back to `unknown` — drives the caller's warning (AC-5). */
|
|
30
|
+
export type AgentMissReason = 'no-provider-detected' | 'multiple-providers-detected' | 'stash-disagreement';
|
|
31
|
+
export interface AgentResolution {
|
|
32
|
+
agent: string;
|
|
33
|
+
/** How the value was determined; `null` when `agent` is UNKNOWN_AGENT. */
|
|
34
|
+
via: 'env' | 'stash' | 'detect' | null;
|
|
35
|
+
/** Set only when `agent` is UNKNOWN_AGENT. */
|
|
36
|
+
reason: AgentMissReason | null;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* The platform every matching stash entry agrees on, or null when there are
|
|
40
|
+
* none or they disagree (AC-4).
|
|
41
|
+
*/
|
|
42
|
+
export declare function agentFromStash(projectRoot: string): string | null;
|
|
43
|
+
export declare function resolveAgent(projectRoot: string, home?: string): AgentResolution;
|
|
44
|
+
/** Human-readable warning for an unresolved platform (AC-5). */
|
|
45
|
+
export declare function agentMissWarning(reason: AgentMissReason): string;
|
|
46
|
+
/** Test seam: drop the memoized resolution. */
|
|
47
|
+
export declare function resetAgentCache(): void;
|
|
48
|
+
//# sourceMappingURL=agent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
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;AA0CD;;;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,CAEtC"}
|