@agent-surface/cli 0.12.1 → 0.14.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/README.md +44 -6
- package/dist/bin.js +22 -13
- package/dist/bin.js.map +1 -1
- package/dist/check-O7ENP4XP.js +259 -0
- package/dist/check-O7ENP4XP.js.map +1 -0
- package/dist/chunk-G7Z6PP6C.js +532 -0
- package/dist/chunk-G7Z6PP6C.js.map +1 -0
- package/dist/chunk-JR4GESLI.js +61 -0
- package/dist/chunk-JR4GESLI.js.map +1 -0
- package/dist/chunk-LQUL4OIA.js +1441 -0
- package/dist/chunk-LQUL4OIA.js.map +1 -0
- package/dist/chunk-YUT4FVQQ.js +220 -0
- package/dist/chunk-YUT4FVQQ.js.map +1 -0
- package/dist/{init-LFQ5R3G7.js → init-64GIHMKV.js} +64 -41
- package/dist/init-64GIHMKV.js.map +1 -0
- package/dist/{ink-P23VKP4H.js → ink-ICJWXGZC.js} +153 -25
- package/dist/ink-ICJWXGZC.js.map +1 -0
- package/dist/inspect-6OZ6ZBKZ.js +226 -0
- package/dist/inspect-6OZ6ZBKZ.js.map +1 -0
- package/dist/snapshot-GTDFQTN2.js +130 -0
- package/dist/snapshot-GTDFQTN2.js.map +1 -0
- package/package.json +4 -4
- package/dist/check-POE5VRSE.js +0 -183
- package/dist/check-POE5VRSE.js.map +0 -1
- package/dist/chunk-DYDSJM7R.js +0 -170
- package/dist/chunk-DYDSJM7R.js.map +0 -1
- package/dist/chunk-J2NN3J5N.js +0 -541
- package/dist/chunk-J2NN3J5N.js.map +0 -1
- package/dist/chunk-Q5WOLWEW.js +0 -984
- package/dist/chunk-Q5WOLWEW.js.map +0 -1
- package/dist/chunk-QIVOZAWX.js +0 -169
- package/dist/chunk-QIVOZAWX.js.map +0 -1
- package/dist/init-LFQ5R3G7.js.map +0 -1
- package/dist/ink-P23VKP4H.js.map +0 -1
- package/dist/inspect-XMDZBSK2.js +0 -119
- package/dist/inspect-XMDZBSK2.js.map +0 -1
- package/dist/snapshot-FLXE5UC6.js +0 -61
- package/dist/snapshot-FLXE5UC6.js.map +0 -1
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import {
|
|
2
|
+
normalize
|
|
3
|
+
} from "./chunk-G7Z6PP6C.js";
|
|
4
|
+
import {
|
|
5
|
+
buildView,
|
|
6
|
+
flatRows
|
|
7
|
+
} from "./chunk-LQUL4OIA.js";
|
|
8
|
+
|
|
9
|
+
// src/report.ts
|
|
10
|
+
import { basename, relative } from "path";
|
|
11
|
+
function scenarioReport(result, options = {}) {
|
|
12
|
+
const view = buildView(result, {
|
|
13
|
+
...options.attribution ? { explain: true } : {},
|
|
14
|
+
...options.schemas ? { schemas: true } : {}
|
|
15
|
+
});
|
|
16
|
+
const capabilities = flatRows(view);
|
|
17
|
+
return {
|
|
18
|
+
scenario: result.scenario,
|
|
19
|
+
...result.scope ? { scope: result.scope } : {},
|
|
20
|
+
snapshot: normalize(result.snapshot),
|
|
21
|
+
// Includes expose, disable and hide. Rows never contain runtime ids.
|
|
22
|
+
capabilities,
|
|
23
|
+
rejections: [...result.rejections].sort(
|
|
24
|
+
(a, b) => a.componentType.localeCompare(b.componentType) || a.instanceId.localeCompare(b.instanceId) || a.reason.localeCompare(b.reason)
|
|
25
|
+
),
|
|
26
|
+
...options.attribution ? { explanation: { capabilities } } : {}
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
function scenarioBaseline(result) {
|
|
30
|
+
const report = scenarioReport(result);
|
|
31
|
+
return {
|
|
32
|
+
...report.snapshot,
|
|
33
|
+
capabilities: report.capabilities,
|
|
34
|
+
rejections: report.rejections
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
function inventoryReport(inventory, domainCapabilities) {
|
|
38
|
+
if (!inventory) return null;
|
|
39
|
+
return {
|
|
40
|
+
...inventory,
|
|
41
|
+
root: ".",
|
|
42
|
+
tsconfig: relative(inventory.root, inventory.tsconfig) || "tsconfig.json",
|
|
43
|
+
...domainCapabilities ? { domain: { source: "manifest", capabilities: [...domainCapabilities].sort() } } : {}
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
function coverageReport(report) {
|
|
47
|
+
if (!report) return null;
|
|
48
|
+
return {
|
|
49
|
+
...report,
|
|
50
|
+
allowlistPath: basename(report.allowlistPath),
|
|
51
|
+
unreadAllowlistPath: basename(report.unreadAllowlistPath)
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export {
|
|
56
|
+
scenarioReport,
|
|
57
|
+
scenarioBaseline,
|
|
58
|
+
inventoryReport,
|
|
59
|
+
coverageReport
|
|
60
|
+
};
|
|
61
|
+
//# sourceMappingURL=chunk-JR4GESLI.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/report.ts"],"sourcesContent":["import { basename, relative } from \"node:path\";\nimport type { CollectResult } from \"./collect.js\";\nimport type { CoverageReport } from \"./coverage.js\";\nimport type { CapabilityInventory } from \"./extract.js\";\nimport { normalize } from \"./baseline.js\";\nimport { buildView, flatRows, type CapabilityRow } from \"./render/model.js\";\n\n/** Stable, complete per-scenario document shared by JSON, baselines and check. */\nexport interface ScenarioReport {\n scenario: string;\n scope?: string[];\n snapshot: unknown;\n capabilities: CapabilityRow[];\n rejections: CollectResult[\"rejections\"];\n explanation?: { capabilities: CapabilityRow[] };\n}\n\nexport function scenarioReport(\n result: CollectResult,\n options: { attribution?: boolean; schemas?: boolean } = {},\n): ScenarioReport {\n const view = buildView(result, {\n ...(options.attribution ? { explain: true } : {}),\n ...(options.schemas ? { schemas: true } : {}),\n });\n const capabilities = flatRows(view);\n return {\n scenario: result.scenario,\n ...(result.scope ? { scope: result.scope } : {}),\n snapshot: normalize(result.snapshot),\n // Includes expose, disable and hide. Rows never contain runtime ids.\n capabilities,\n rejections: [...result.rejections].sort(\n (a, b) =>\n a.componentType.localeCompare(b.componentType) ||\n a.instanceId.localeCompare(b.instanceId) ||\n a.reason.localeCompare(b.reason),\n ),\n ...(options.attribution ? { explanation: { capabilities } } : {}),\n };\n}\n\n/** Baseline payload: same semantic document, without invocation-only labels. */\nexport function scenarioBaseline(result: CollectResult): Record<string, unknown> {\n const report = scenarioReport(result);\n return {\n ...(report.snapshot as Record<string, unknown>),\n capabilities: report.capabilities,\n rejections: report.rejections,\n };\n}\n\n/** Machine output must not contain checkout-specific absolute paths. */\nexport function inventoryReport(\n inventory: CapabilityInventory | undefined,\n domainCapabilities?: string[],\n): unknown {\n if (!inventory) return null;\n return {\n ...inventory,\n root: \".\",\n tsconfig: relative(inventory.root, inventory.tsconfig) || \"tsconfig.json\",\n ...(domainCapabilities\n ? { domain: { source: \"manifest\", capabilities: [...domainCapabilities].sort() } }\n : {}),\n };\n}\n\nexport function coverageReport(report: CoverageReport | undefined): unknown {\n if (!report) return null;\n return {\n ...report,\n allowlistPath: basename(report.allowlistPath),\n unreadAllowlistPath: basename(report.unreadAllowlistPath),\n };\n}\n"],"mappings":";;;;;;;;;AAAA,SAAS,UAAU,gBAAgB;AAiB5B,SAAS,eACd,QACA,UAAwD,CAAC,GACzC;AAChB,QAAM,OAAO,UAAU,QAAQ;AAAA,IAC7B,GAAI,QAAQ,cAAc,EAAE,SAAS,KAAK,IAAI,CAAC;AAAA,IAC/C,GAAI,QAAQ,UAAU,EAAE,SAAS,KAAK,IAAI,CAAC;AAAA,EAC7C,CAAC;AACD,QAAM,eAAe,SAAS,IAAI;AAClC,SAAO;AAAA,IACL,UAAU,OAAO;AAAA,IACjB,GAAI,OAAO,QAAQ,EAAE,OAAO,OAAO,MAAM,IAAI,CAAC;AAAA,IAC9C,UAAU,UAAU,OAAO,QAAQ;AAAA;AAAA,IAEnC;AAAA,IACA,YAAY,CAAC,GAAG,OAAO,UAAU,EAAE;AAAA,MACjC,CAAC,GAAG,MACF,EAAE,cAAc,cAAc,EAAE,aAAa,KAC7C,EAAE,WAAW,cAAc,EAAE,UAAU,KACvC,EAAE,OAAO,cAAc,EAAE,MAAM;A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