@agent-surface/cli 0.15.0 → 0.16.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 +6 -182
- package/dist/bin.js +181 -207
- package/dist/bin.js.map +1 -1
- package/dist/chunk-IA7FUP4R.js +125 -0
- package/dist/chunk-IA7FUP4R.js.map +1 -0
- package/dist/chunk-X6RGGBQ4.js +139 -0
- package/dist/chunk-X6RGGBQ4.js.map +1 -0
- package/dist/index.d.ts +31 -173
- package/dist/index.js +16 -5
- package/dist/index.js.map +1 -1
- package/dist/ink-E6DATMUQ.js +51 -0
- package/dist/ink-E6DATMUQ.js.map +1 -0
- package/package.json +4 -20
- package/dist/check-VWRYNYLN.js +0 -259
- package/dist/check-VWRYNYLN.js.map +0 -1
- package/dist/chunk-A2G4QLX5.js +0 -29
- package/dist/chunk-A2G4QLX5.js.map +0 -1
- package/dist/chunk-A5UCBF7D.js +0 -246
- package/dist/chunk-A5UCBF7D.js.map +0 -1
- package/dist/chunk-GYYWHZPM.js +0 -532
- package/dist/chunk-GYYWHZPM.js.map +0 -1
- package/dist/chunk-NFK3XWWH.js +0 -1475
- package/dist/chunk-NFK3XWWH.js.map +0 -1
- package/dist/chunk-Y2LSPEVK.js +0 -61
- package/dist/chunk-Y2LSPEVK.js.map +0 -1
- package/dist/collect.js +0 -52
- package/dist/collect.js.map +0 -1
- package/dist/config-rHD2wEws.d.ts +0 -60
- package/dist/init-BVZR6CRS.js +0 -164
- package/dist/init-BVZR6CRS.js.map +0 -1
- package/dist/ink-ZCQ26EY4.js +0 -345
- package/dist/ink-ZCQ26EY4.js.map +0 -1
- package/dist/inspect-3YFPCYQJ.js +0 -226
- package/dist/inspect-3YFPCYQJ.js.map +0 -1
- package/dist/snapshot-5QKLZKZI.js +0 -130
- package/dist/snapshot-5QKLZKZI.js.map +0 -1
- package/dist/vitest.d.ts +0 -30
- package/dist/vitest.js +0 -9
- package/dist/vitest.js.map +0 -1
package/dist/inspect-3YFPCYQJ.js
DELETED
|
@@ -1,226 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
coverageReport,
|
|
3
|
-
inventoryReport,
|
|
4
|
-
scenarioReport
|
|
5
|
-
} from "./chunk-Y2LSPEVK.js";
|
|
6
|
-
import {
|
|
7
|
-
createPresenter,
|
|
8
|
-
joinCoverage,
|
|
9
|
-
mountScenarios,
|
|
10
|
-
readInventory,
|
|
11
|
-
scopeCapabilityIds,
|
|
12
|
-
scopeInventory,
|
|
13
|
-
staticConfigScope
|
|
14
|
-
} from "./chunk-A5UCBF7D.js";
|
|
15
|
-
import {
|
|
16
|
-
write
|
|
17
|
-
} from "./chunk-GYYWHZPM.js";
|
|
18
|
-
import {
|
|
19
|
-
READING_SOURCE,
|
|
20
|
-
buildView,
|
|
21
|
-
catalogDetailParts,
|
|
22
|
-
catalogRows,
|
|
23
|
-
coverageSections,
|
|
24
|
-
failureSection,
|
|
25
|
-
flatRows,
|
|
26
|
-
mountingLabel,
|
|
27
|
-
neverCallable,
|
|
28
|
-
neverCallableSection,
|
|
29
|
-
noVerdictSection,
|
|
30
|
-
runHeaderBlocks,
|
|
31
|
-
scenarioStats,
|
|
32
|
-
scenarioTable,
|
|
33
|
-
surfaceSummaryRows,
|
|
34
|
-
trackReach
|
|
35
|
-
} from "./chunk-NFK3XWWH.js";
|
|
36
|
-
|
|
37
|
-
// src/commands/inspect.ts
|
|
38
|
-
async function runInspect(options) {
|
|
39
|
-
const analysis = {
|
|
40
|
-
configPath: options.configPath,
|
|
41
|
-
depth: options.depth,
|
|
42
|
-
...options.scenario ? { scenario: options.scenario } : {},
|
|
43
|
-
...options.scope ? { scope: options.scope } : {},
|
|
44
|
-
...options.tsconfig ? { tsconfig: options.tsconfig } : {},
|
|
45
|
-
...options.baselineDir ? { baselineDir: options.baselineDir } : {}
|
|
46
|
-
};
|
|
47
|
-
const detail = options.detail === true || options.explain === true || options.schemas === true;
|
|
48
|
-
const present = await createPresenter(options);
|
|
49
|
-
if (!options.json) await present.wait(READING_SOURCE);
|
|
50
|
-
const inventory = readInventory(analysis);
|
|
51
|
-
const scenarios = [];
|
|
52
|
-
const stats = [];
|
|
53
|
-
const views = [];
|
|
54
|
-
const reach = /* @__PURE__ */ new Map();
|
|
55
|
-
let plan;
|
|
56
|
-
const scope = () => plan?.scope ?? staticConfigScope(analysis);
|
|
57
|
-
const scopedInventory = () => scopeInventory(inventory, scope());
|
|
58
|
-
const domainCount = () => plan?.domainManifestConfigured ? scopeCapabilityIds(plan.domainCapabilities, scope()).length : void 0;
|
|
59
|
-
const header = async () => {
|
|
60
|
-
present.settle();
|
|
61
|
-
if (options.json) return;
|
|
62
|
-
const active = scope();
|
|
63
|
-
const catalog2 = scopedInventory();
|
|
64
|
-
await present.emit(
|
|
65
|
-
// At `--depth static` the catalog *is* the answer, so it opens the report
|
|
66
|
-
// beside the run it came from. At every other depth it is a detail behind
|
|
67
|
-
// the summary, and prints down there instead.
|
|
68
|
-
{
|
|
69
|
-
kind: "blocks",
|
|
70
|
-
blocks: runHeaderBlocks(
|
|
71
|
-
"SURFACE INSPECT",
|
|
72
|
-
{
|
|
73
|
-
configPath: options.configPath,
|
|
74
|
-
depth: options.depth,
|
|
75
|
-
...active ? { scope: active } : {},
|
|
76
|
-
...plan ? { scenarios: plan.scenarios, declaredScenarios: plan.declaredScenarios } : {}
|
|
77
|
-
},
|
|
78
|
-
plan ? void 0 : catalog2,
|
|
79
|
-
domainCount()
|
|
80
|
-
)
|
|
81
|
-
},
|
|
82
|
-
...!plan && catalog2 ? catalogDetailParts(catalog2, { ...detail ? { detail: true } : {} }) : []
|
|
83
|
-
);
|
|
84
|
-
};
|
|
85
|
-
const runtime = await mountScenarios(analysis, {
|
|
86
|
-
onPlan: async (current) => {
|
|
87
|
-
plan = current;
|
|
88
|
-
await header();
|
|
89
|
-
if (current.scenarios.length > 0) await present.wait(mountingLabel(current.scenarios, 0));
|
|
90
|
-
},
|
|
91
|
-
onEach: async (result) => {
|
|
92
|
-
const view = buildView(result, {
|
|
93
|
-
...options.explain ? { explain: true } : {},
|
|
94
|
-
...options.schemas ? { schemas: true } : {}
|
|
95
|
-
});
|
|
96
|
-
trackReach(reach, flatRows(view), result.scenario);
|
|
97
|
-
stats.push(scenarioStats(result));
|
|
98
|
-
if (options.json) {
|
|
99
|
-
scenarios.push(
|
|
100
|
-
scenarioReport(result, {
|
|
101
|
-
...options.explain ? { attribution: true } : {},
|
|
102
|
-
...options.schemas ? { schemas: true } : {}
|
|
103
|
-
})
|
|
104
|
-
);
|
|
105
|
-
} else {
|
|
106
|
-
views.push(view);
|
|
107
|
-
}
|
|
108
|
-
if (plan && stats.length < plan.scenarios.length) {
|
|
109
|
-
await present.wait(mountingLabel(plan.scenarios, stats.length));
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
});
|
|
113
|
-
present.settle();
|
|
114
|
-
if (!runtime) await header();
|
|
115
|
-
const effectiveScope = options.scope ?? runtime?.scope ?? staticConfigScope(analysis);
|
|
116
|
-
const reportInventory = scopeInventory(inventory, effectiveScope);
|
|
117
|
-
const reportDomain = runtime?.domainManifestConfigured ? scopeCapabilityIds(runtime.domainCapabilities, effectiveScope) : void 0;
|
|
118
|
-
const coverage = joinCoverage(inventory, runtime, analysis);
|
|
119
|
-
const dark = neverCallable(reach);
|
|
120
|
-
if (options.json) {
|
|
121
|
-
write(
|
|
122
|
-
JSON.stringify(
|
|
123
|
-
{
|
|
124
|
-
// One shape whatever the depth, so a consumer never branches on how
|
|
125
|
-
// the command was invoked. A half the depth did not compute is
|
|
126
|
-
// `null`, which is a different statement from `[]` or `{}`.
|
|
127
|
-
depth: options.depth,
|
|
128
|
-
catalog: inventoryReport(reportInventory, reportDomain),
|
|
129
|
-
scenarios,
|
|
130
|
-
failures: runtime?.failures ?? [],
|
|
131
|
-
coverage: coverageReport(coverage),
|
|
132
|
-
// Mounted, and callable in no scenario — a gap the coverage join
|
|
133
|
-
// cannot see, because every one of these *was* reached.
|
|
134
|
-
neverCallable: dark.map((entry) => ({
|
|
135
|
-
capabilityId: entry.capabilityId,
|
|
136
|
-
outcome: entry.best,
|
|
137
|
-
...entry.note ? { reason: entry.note } : {},
|
|
138
|
-
scenarios: entry.scenarios
|
|
139
|
-
}))
|
|
140
|
-
},
|
|
141
|
-
null,
|
|
142
|
-
2
|
|
143
|
-
)
|
|
144
|
-
);
|
|
145
|
-
return runtime && runtime.failures.length > 0 ? 2 : 0;
|
|
146
|
-
}
|
|
147
|
-
if (!runtime) return 0;
|
|
148
|
-
for (const failure of runtime.failures) {
|
|
149
|
-
stats.push({
|
|
150
|
-
scenario: failure.scenario,
|
|
151
|
-
callable: 0,
|
|
152
|
-
disabled: 0,
|
|
153
|
-
hidden: 0,
|
|
154
|
-
rejected: 0,
|
|
155
|
-
failed: true,
|
|
156
|
-
failure: failure.message
|
|
157
|
-
});
|
|
158
|
-
}
|
|
159
|
-
stats.sort((a, b) => runtime.scenarios.indexOf(a.scenario) - runtime.scenarios.indexOf(b.scenario));
|
|
160
|
-
const mounted = stats.filter((entry) => !entry.failed).length;
|
|
161
|
-
const parts = [
|
|
162
|
-
{
|
|
163
|
-
kind: "blocks",
|
|
164
|
-
blocks: [
|
|
165
|
-
{
|
|
166
|
-
title: "SURFACE SUMMARY",
|
|
167
|
-
rows: surfaceSummaryRows({
|
|
168
|
-
depth: options.depth,
|
|
169
|
-
...coverage ? { coverage } : {},
|
|
170
|
-
scenarios: stats,
|
|
171
|
-
failures: runtime.failures.length,
|
|
172
|
-
reach
|
|
173
|
-
})
|
|
174
|
-
}
|
|
175
|
-
]
|
|
176
|
-
}
|
|
177
|
-
];
|
|
178
|
-
if (stats.length > 1) {
|
|
179
|
-
const table = scenarioTable(stats);
|
|
180
|
-
parts.push({
|
|
181
|
-
kind: "table",
|
|
182
|
-
title: `SCENARIOS (${stats.length})`,
|
|
183
|
-
headers: table.headers,
|
|
184
|
-
rows: table.rows
|
|
185
|
-
});
|
|
186
|
-
}
|
|
187
|
-
if (runtime.failures.length > 0) {
|
|
188
|
-
parts.push({
|
|
189
|
-
kind: "findings",
|
|
190
|
-
stream: "err",
|
|
191
|
-
sections: [
|
|
192
|
-
failureSection(runtime.failures),
|
|
193
|
-
...inventory ? [noVerdictSection(runtime.failures)] : []
|
|
194
|
-
]
|
|
195
|
-
});
|
|
196
|
-
}
|
|
197
|
-
const sections = [
|
|
198
|
-
...coverage ? coverageSections(coverage) : [],
|
|
199
|
-
...dark.length > 0 && mounted > 1 ? [neverCallableSection(dark)] : []
|
|
200
|
-
];
|
|
201
|
-
if (sections.length > 0) parts.push({ kind: "findings", sections });
|
|
202
|
-
const catalog = scopeInventory(inventory, effectiveScope);
|
|
203
|
-
if (catalog) {
|
|
204
|
-
parts.push({
|
|
205
|
-
kind: "blocks",
|
|
206
|
-
blocks: [
|
|
207
|
-
{
|
|
208
|
-
title: "STATIC CATALOG",
|
|
209
|
-
rows: catalogRows(catalog, {
|
|
210
|
-
...domainCount() === void 0 ? {} : { domainCapabilities: domainCount() },
|
|
211
|
-
mounted: true
|
|
212
|
-
})
|
|
213
|
-
}
|
|
214
|
-
]
|
|
215
|
-
});
|
|
216
|
-
}
|
|
217
|
-
for (const view of views) {
|
|
218
|
-
parts.push({ kind: "surface", view, ...detail ? { detail: true } : {} });
|
|
219
|
-
}
|
|
220
|
-
await present.emit(...parts);
|
|
221
|
-
return runtime.failures.length > 0 ? 2 : 0;
|
|
222
|
-
}
|
|
223
|
-
export {
|
|
224
|
-
runInspect
|
|
225
|
-
};
|
|
226
|
-
//# sourceMappingURL=inspect-3YFPCYQJ.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/commands/inspect.ts"],"sourcesContent":["import {\n joinCoverage,\n mountScenarios,\n readInventory,\n scopeCapabilityIds,\n scopeInventory,\n staticConfigScope,\n type AnalysisOptions,\n type Depth,\n type RuntimePlan,\n} from \"../analysis.js\";\nimport { buildView, flatRows, type SurfaceView } from \"../render/model.js\";\nimport { createPresenter } from \"../render/present.js\";\nimport {\n catalogDetailParts,\n catalogRows,\n coverageSections,\n failureSection,\n mountingLabel,\n neverCallable,\n neverCallableSection,\n noVerdictSection,\n READING_SOURCE,\n runHeaderBlocks,\n scenarioStats,\n scenarioTable,\n surfaceSummaryRows,\n trackReach,\n type CapabilityReach,\n type FindingSection,\n type ReportPart,\n type ScenarioStats,\n} from \"../render/summary.js\";\nimport { write } from \"../output.js\";\nimport {\n coverageReport,\n inventoryReport,\n scenarioReport,\n type ScenarioReport,\n} from \"../report.js\";\n\nexport interface InspectOptions {\n configPath: string;\n depth: Depth;\n scenario?: string;\n scope?: string[];\n tsconfig?: string;\n baselineDir?: string;\n detail?: boolean;\n explain?: boolean;\n schemas?: boolean;\n json?: boolean;\n plain?: boolean;\n}\n\n/**\n * The whole surface: what this codebase authors, what a mount surfaces, and the\n * difference between them.\n *\n * It answers findings, it does not gate on them — exit `0` whatever it reports,\n * because `check` is the gate and a viewer that sometimes fails is a viewer\n * nobody puts in a pipeline. The exception is `2`, which is not a finding: the\n * command could not run at all.\n *\n * The report is read top-down, so it is written top-down: **summaries first,\n * details after.**\n *\n * 1. **The run** — the config, the depth, the scope, the scenarios. All of it is\n * known before the first mount, and the mounts are the slow half, so it\n * prints immediately rather than making a reader wait to learn what is being\n * measured.\n * 2. **The summary** — reach, what is callable, what the surface can do, the\n * verdict. The answer, before anything it was derived from.\n * 3. **One row per scenario**, for a config with more than one.\n * 4. **The findings** — unreached, never callable, unread call sites — each with\n * what to do about it.\n * 5. **The details** — the static catalog, then each scenario's own table.\n *\n * That order costs the streaming this command used to do: the summary is a\n * statement about every scenario, so it cannot be written until every scenario\n * has mounted. A terminal is told what it is waiting for instead — the header\n * is already on screen and a spinner names the scenario being mounted — and\n * `check`, whose output has always been a report, works the same way.\n */\nexport async function runInspect(options: InspectOptions): Promise<number> {\n const analysis: AnalysisOptions = {\n configPath: options.configPath,\n depth: options.depth,\n ...(options.scenario ? { scenario: options.scenario } : {}),\n ...(options.scope ? { scope: options.scope } : {}),\n ...(options.tsconfig ? { tsconfig: options.tsconfig } : {}),\n ...(options.baselineDir ? { baselineDir: options.baselineDir } : {}),\n };\n\n // Policy chains and JSON Schemas are multi-line by nature, so asking for\n // either is asking for the view that can hold them.\n const detail = options.detail === true || options.explain === true || options.schemas === true;\n const present = await createPresenter(options);\n\n // The TypeScript program is read synchronously and the app loads after it;\n // together that is seconds on a real repository, and a terminal that shows\n // nothing for them looks wedged.\n if (!options.json) await present.wait(READING_SOURCE);\n\n const inventory = readInventory(analysis);\n const scenarios: ScenarioReport[] = [];\n const stats: ScenarioStats[] = [];\n const views: SurfaceView[] = [];\n const reach = new Map<string, CapabilityReach>();\n let plan: RuntimePlan | undefined;\n\n const scope = (): string[] | undefined => plan?.scope ?? staticConfigScope(analysis);\n const scopedInventory = (): ReturnType<typeof scopeInventory> =>\n scopeInventory(inventory, scope());\n const domainCount = (): number | undefined =>\n plan?.domainManifestConfigured\n ? scopeCapabilityIds(plan.domainCapabilities, scope()).length\n : undefined;\n\n const header = async (): Promise<void> => {\n present.settle();\n if (options.json) return;\n const active = scope();\n const catalog = scopedInventory();\n await present.emit(\n // At `--depth static` the catalog *is* the answer, so it opens the report\n // beside the run it came from. At every other depth it is a detail behind\n // the summary, and prints down there instead.\n {\n kind: \"blocks\",\n blocks: runHeaderBlocks(\n \"SURFACE INSPECT\",\n {\n configPath: options.configPath,\n depth: options.depth,\n ...(active ? { scope: active } : {}),\n ...(plan\n ? { scenarios: plan.scenarios, declaredScenarios: plan.declaredScenarios }\n : {}),\n },\n plan ? undefined : catalog,\n domainCount(),\n ),\n },\n ...(!plan && catalog\n ? catalogDetailParts(catalog, { ...(detail ? { detail: true } : {}) })\n : []),\n );\n };\n\n const runtime = await mountScenarios(analysis, {\n onPlan: async (current) => {\n plan = current;\n await header();\n if (current.scenarios.length > 0) await present.wait(mountingLabel(current.scenarios, 0));\n },\n onEach: async (result) => {\n const view = buildView(result, {\n ...(options.explain ? { explain: true } : {}),\n ...(options.schemas ? { schemas: true } : {}),\n });\n trackReach(reach, flatRows(view), result.scenario);\n stats.push(scenarioStats(result));\n if (options.json) {\n scenarios.push(\n scenarioReport(result, {\n ...(options.explain ? { attribution: true } : {}),\n ...(options.schemas ? { schemas: true } : {}),\n }),\n );\n } else {\n views.push(view);\n }\n // Named, and only while there is one left: a spinner announcing work\n // nobody is doing has to be read twice before it can be dismissed.\n if (plan && stats.length < plan.scenarios.length) {\n await present.wait(mountingLabel(plan.scenarios, stats.length));\n }\n },\n });\n present.settle();\n if (!runtime) await header();\n\n const effectiveScope = options.scope ?? runtime?.scope ?? staticConfigScope(analysis);\n const reportInventory = scopeInventory(inventory, effectiveScope);\n const reportDomain = runtime?.domainManifestConfigured\n ? scopeCapabilityIds(runtime.domainCapabilities, effectiveScope)\n : undefined;\n const coverage = joinCoverage(inventory, runtime, analysis);\n const dark = neverCallable(reach);\n\n if (options.json) {\n write(\n JSON.stringify(\n {\n // One shape whatever the depth, so a consumer never branches on how\n // the command was invoked. A half the depth did not compute is\n // `null`, which is a different statement from `[]` or `{}`.\n depth: options.depth,\n catalog: inventoryReport(reportInventory, reportDomain),\n scenarios,\n failures: runtime?.failures ?? [],\n coverage: coverageReport(coverage),\n // Mounted, and callable in no scenario — a gap the coverage join\n // cannot see, because every one of these *was* reached.\n neverCallable: dark.map((entry) => ({\n capabilityId: entry.capabilityId,\n outcome: entry.best,\n ...(entry.note ? { reason: entry.note } : {}),\n scenarios: entry.scenarios,\n })),\n },\n null,\n 2,\n ),\n );\n return runtime && runtime.failures.length > 0 ? 2 : 0;\n }\n\n if (!runtime) return 0;\n\n // A scenario that threw is not in `stats`, and every count below is missing\n // whatever it held — so it takes a row of its own rather than appearing only\n // at the bottom of the report.\n for (const failure of runtime.failures) {\n stats.push({\n scenario: failure.scenario,\n callable: 0,\n disabled: 0,\n hidden: 0,\n rejected: 0,\n failed: true,\n failure: failure.message,\n });\n }\n stats.sort((a, b) => runtime.scenarios.indexOf(a.scenario) - runtime.scenarios.indexOf(b.scenario));\n const mounted = stats.filter((entry) => !entry.failed).length;\n\n const parts: ReportPart[] = [\n {\n kind: \"blocks\",\n blocks: [\n {\n title: \"SURFACE SUMMARY\",\n rows: surfaceSummaryRows({\n depth: options.depth,\n ...(coverage ? { coverage } : {}),\n scenarios: stats,\n failures: runtime.failures.length,\n reach,\n }),\n },\n ],\n },\n ];\n\n // One row per scenario, so a config with more than one can be compared in a\n // single place rather than by scrolling through its tables.\n if (stats.length > 1) {\n const table = scenarioTable(stats);\n parts.push({\n kind: \"table\",\n title: `SCENARIOS (${stats.length})`,\n headers: table.headers,\n rows: table.rows,\n });\n }\n\n if (runtime.failures.length > 0) {\n parts.push({\n kind: \"findings\",\n stream: \"err\",\n sections: [\n failureSection(runtime.failures),\n ...(inventory ? [noVerdictSection(runtime.failures)] : []),\n ],\n });\n }\n\n // Over one scenario, \"never callable\" repeats that scenario's own table row\n // for row. It is a finding only once there is more than one scenario for a\n // capability to have been callable in.\n const sections: FindingSection[] = [\n ...(coverage ? coverageSections(coverage) : []),\n ...(dark.length > 0 && mounted > 1 ? [neverCallableSection(dark)] : []),\n ];\n if (sections.length > 0) parts.push({ kind: \"findings\", sections });\n\n // Details. The catalog first, because the scenario tables below are what it\n // is the denominator of.\n const catalog = scopeInventory(inventory, effectiveScope);\n if (catalog) {\n parts.push({\n kind: \"blocks\",\n blocks: [\n {\n title: \"STATIC CATALOG\",\n rows: catalogRows(catalog, {\n ...(domainCount() === undefined ? {} : { domainCapabilities: domainCount()! }),\n mounted: true,\n }),\n },\n ],\n });\n }\n\n for (const view of views) {\n parts.push({ kind: \"surface\", view, ...(detail ? { detail: true } : {}) });\n }\n\n await present.emit(...parts);\n\n // A scenario that would not mount is not a finding about the surface, it is\n // the command failing to observe one. `2` — the same code a usage error gets,\n // because CI has to tell both apart from \"the surface changed\".\n return runtime.failures.length > 0 ? 2 : 0;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoFA,eAAsB,WA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E,oBAAoB,YAAY,EAAG;AAAA,YAC5E,SAAS;AAAA,UACX,CAAC;AAAA,QACH;AAAA,MACF;AAAA,IACF,CAAC;AAAA,EACH;AAEA,aAAW,QAAQ,OAAO;AACxB,UAAM,KAAK,EAAE,MAAM,WAAW,MAAM,GAAI,SAAS,EAAE,QAAQ,KAAK,IAAI,CAAC,EAAG,CAAC;AAAA,EAC3E;AAEA,QAAM,QAAQ,KAAK,GAAG,KAAK;AAK3B,SAAO,QAAQ,SAAS,SAAS,IAAI,IAAI;AAC3C;","names":["catalog"]}
|
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
scenarioBaseline
|
|
3
|
-
} from "./chunk-Y2LSPEVK.js";
|
|
4
|
-
import {
|
|
5
|
-
createPresenter,
|
|
6
|
-
joinCoverage,
|
|
7
|
-
mountScenarios,
|
|
8
|
-
readInventory
|
|
9
|
-
} from "./chunk-A5UCBF7D.js";
|
|
10
|
-
import {
|
|
11
|
-
UsageError,
|
|
12
|
-
baselinePath,
|
|
13
|
-
writeBaseline,
|
|
14
|
-
writeScenarioManifest
|
|
15
|
-
} from "./chunk-GYYWHZPM.js";
|
|
16
|
-
import {
|
|
17
|
-
READING_SOURCE,
|
|
18
|
-
buildView,
|
|
19
|
-
coverageSections,
|
|
20
|
-
displayPath,
|
|
21
|
-
failureSection,
|
|
22
|
-
flatRows,
|
|
23
|
-
mountingLabel,
|
|
24
|
-
neverCallable,
|
|
25
|
-
neverCallableSection,
|
|
26
|
-
noVerdictSection,
|
|
27
|
-
runHeaderBlocks,
|
|
28
|
-
scenarioStats,
|
|
29
|
-
surfaceSummaryRows,
|
|
30
|
-
trackReach
|
|
31
|
-
} from "./chunk-NFK3XWWH.js";
|
|
32
|
-
|
|
33
|
-
// src/commands/snapshot.ts
|
|
34
|
-
async function runSnapshot(options) {
|
|
35
|
-
if (options.depth === "static") {
|
|
36
|
-
throw new UsageError(
|
|
37
|
-
"snapshot --depth static has nothing to write \u2014 a baseline is a projection, and at this depth nothing is mounted."
|
|
38
|
-
);
|
|
39
|
-
}
|
|
40
|
-
const analysis = {
|
|
41
|
-
configPath: options.configPath,
|
|
42
|
-
depth: options.depth,
|
|
43
|
-
...options.scenario ? { scenario: options.scenario } : {},
|
|
44
|
-
...options.scope ? { scope: options.scope } : {},
|
|
45
|
-
...options.tsconfig ? { tsconfig: options.tsconfig } : {},
|
|
46
|
-
...options.baselineDir ? { baselineDir: options.baselineDir } : {}
|
|
47
|
-
};
|
|
48
|
-
const present = await createPresenter(options);
|
|
49
|
-
await present.wait(READING_SOURCE);
|
|
50
|
-
const inventory = readInventory(analysis);
|
|
51
|
-
let scenarios = [];
|
|
52
|
-
let mountedCount = 0;
|
|
53
|
-
const runtime = await mountScenarios(analysis, {
|
|
54
|
-
onPlan: async (plan) => {
|
|
55
|
-
scenarios = plan.scenarios;
|
|
56
|
-
await present.emit({
|
|
57
|
-
kind: "blocks",
|
|
58
|
-
blocks: runHeaderBlocks("SURFACE SNAPSHOT", {
|
|
59
|
-
configPath: options.configPath,
|
|
60
|
-
depth: options.depth,
|
|
61
|
-
...plan.scope ? { scope: plan.scope } : {},
|
|
62
|
-
scenarios: plan.scenarios,
|
|
63
|
-
declaredScenarios: plan.declaredScenarios
|
|
64
|
-
})
|
|
65
|
-
});
|
|
66
|
-
if (scenarios.length > 0) await present.wait(mountingLabel(scenarios, 0));
|
|
67
|
-
},
|
|
68
|
-
onEach: async () => {
|
|
69
|
-
mountedCount += 1;
|
|
70
|
-
if (mountedCount < scenarios.length) {
|
|
71
|
-
await present.wait(mountingLabel(scenarios, mountedCount));
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
});
|
|
75
|
-
present.settle();
|
|
76
|
-
if (!runtime) throw new UsageError("snapshot needs a mount, and this depth performs none");
|
|
77
|
-
const written = [];
|
|
78
|
-
for (const result of runtime.results) {
|
|
79
|
-
const path = baselinePath(runtime.baselineDir, result.scenario);
|
|
80
|
-
writeBaseline(path, scenarioBaseline(result));
|
|
81
|
-
written.push({ cells: [result.scenario, displayPath(path)] });
|
|
82
|
-
}
|
|
83
|
-
writeScenarioManifest(runtime.baselineDir, runtime.declaredScenarios);
|
|
84
|
-
const reach = /* @__PURE__ */ new Map();
|
|
85
|
-
for (const result of runtime.results) {
|
|
86
|
-
trackReach(reach, flatRows(buildView(result)), result.scenario);
|
|
87
|
-
}
|
|
88
|
-
const coverage = joinCoverage(inventory, runtime, analysis);
|
|
89
|
-
const stats = runtime.results.map(scenarioStats);
|
|
90
|
-
const dark = neverCallable(reach);
|
|
91
|
-
const parts = [
|
|
92
|
-
{ kind: "table", title: `WROTE (${written.length})`, headers: ["SCENARIO", "FILE"], rows: written }
|
|
93
|
-
];
|
|
94
|
-
const sections = [
|
|
95
|
-
...coverage ? coverageSections(coverage) : [],
|
|
96
|
-
...dark.length > 0 && stats.length > 1 ? [neverCallableSection(dark)] : []
|
|
97
|
-
];
|
|
98
|
-
if (sections.length > 0) parts.push({ kind: "findings", sections });
|
|
99
|
-
parts.push({
|
|
100
|
-
kind: "blocks",
|
|
101
|
-
blocks: [
|
|
102
|
-
{
|
|
103
|
-
title: "SURFACE SUMMARY",
|
|
104
|
-
rows: surfaceSummaryRows({
|
|
105
|
-
depth: options.depth,
|
|
106
|
-
...coverage ? { coverage } : {},
|
|
107
|
-
scenarios: stats,
|
|
108
|
-
failures: runtime.failures.length,
|
|
109
|
-
reach
|
|
110
|
-
})
|
|
111
|
-
}
|
|
112
|
-
]
|
|
113
|
-
});
|
|
114
|
-
if (runtime.failures.length > 0) {
|
|
115
|
-
parts.push({
|
|
116
|
-
kind: "findings",
|
|
117
|
-
stream: "err",
|
|
118
|
-
sections: [
|
|
119
|
-
failureSection(runtime.failures),
|
|
120
|
-
...inventory ? [noVerdictSection(runtime.failures)] : []
|
|
121
|
-
]
|
|
122
|
-
});
|
|
123
|
-
}
|
|
124
|
-
await present.emit(...parts);
|
|
125
|
-
return runtime.failures.length > 0 ? 2 : 0;
|
|
126
|
-
}
|
|
127
|
-
export {
|
|
128
|
-
runSnapshot
|
|
129
|
-
};
|
|
130
|
-
//# sourceMappingURL=snapshot-5QKLZKZI.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/commands/snapshot.ts"],"sourcesContent":["import {\n joinCoverage,\n mountScenarios,\n readInventory,\n UsageError,\n type AnalysisOptions,\n type Depth,\n} from \"../analysis.js\";\nimport { baselinePath, writeBaseline, writeScenarioManifest } from \"../baseline.js\";\nimport { scenarioBaseline } from \"../report.js\";\nimport { buildView, flatRows } from \"../render/model.js\";\nimport { createPresenter } from \"../render/present.js\";\nimport {\n coverageSections,\n displayPath,\n failureSection,\n mountingLabel,\n neverCallable,\n neverCallableSection,\n noVerdictSection,\n READING_SOURCE,\n runHeaderBlocks,\n scenarioStats,\n surfaceSummaryRows,\n trackReach,\n type CapabilityReach,\n type ReportPart,\n} from \"../render/summary.js\";\n\nexport interface SnapshotOptions {\n configPath: string;\n depth: Depth;\n scenario?: string;\n scope?: string[];\n tsconfig?: string;\n baselineDir?: string;\n json?: boolean;\n plain?: boolean;\n}\n\n/**\n * Writes (or refreshes) the committed baseline `check` compares against.\n *\n * It prints the coverage verdict too. This is the command you run to *accept* a\n * change to the surface, which makes it the last moment before a reviewer sees\n * the diff — and accepting a projection while a capability sits behind a route\n * no scenario visits is exactly the state worth hearing about. It reports;\n * `check` is still the only thing that fails.\n *\n * Its report opens the way every other one does (`AS-CLI-013`): what the run\n * was pointed at, then what it wrote, then the verdict. It used to open with\n * bare `wrote …` lines and no header at all, which left the one command that\n * *changes committed files* as the only one that never said what it had been\n * pointed at while it did.\n */\nexport async function runSnapshot(options: SnapshotOptions): Promise<number> {\n if (options.depth === \"static\") {\n throw new UsageError(\n \"snapshot --depth static has nothing to write — a baseline is a projection, and \" +\n \"at this depth nothing is mounted.\",\n );\n }\n\n const analysis: AnalysisOptions = {\n configPath: options.configPath,\n depth: options.depth,\n ...(options.scenario ? { scenario: options.scenario } : {}),\n ...(options.scope ? { scope: options.scope } : {}),\n ...(options.tsconfig ? { tsconfig: options.tsconfig } : {}),\n ...(options.baselineDir ? { baselineDir: options.baselineDir } : {}),\n };\n\n const present = await createPresenter(options);\n await present.wait(READING_SOURCE);\n\n const inventory = readInventory(analysis);\n let scenarios: string[] = [];\n let mountedCount = 0;\n const runtime = await mountScenarios(analysis, {\n onPlan: async (plan) => {\n scenarios = plan.scenarios;\n await present.emit({\n kind: \"blocks\",\n blocks: runHeaderBlocks(\"SURFACE SNAPSHOT\", {\n configPath: options.configPath,\n depth: options.depth,\n ...(plan.scope ? { scope: plan.scope } : {}),\n scenarios: plan.scenarios,\n declaredScenarios: plan.declaredScenarios,\n }),\n });\n if (scenarios.length > 0) await present.wait(mountingLabel(scenarios, 0));\n },\n onEach: async () => {\n mountedCount += 1;\n if (mountedCount < scenarios.length) {\n await present.wait(mountingLabel(scenarios, mountedCount));\n }\n },\n });\n present.settle();\n if (!runtime) throw new UsageError(\"snapshot needs a mount, and this depth performs none\");\n\n const written: Array<{ cells: string[] }> = [];\n for (const result of runtime.results) {\n const path = baselinePath(runtime.baselineDir, result.scenario);\n writeBaseline(path, scenarioBaseline(result));\n written.push({ cells: [result.scenario, displayPath(path)] });\n }\n writeScenarioManifest(runtime.baselineDir, runtime.declaredScenarios);\n\n const reach = new Map<string, CapabilityReach>();\n for (const result of runtime.results) {\n trackReach(reach, flatRows(buildView(result)), result.scenario);\n }\n const coverage = joinCoverage(inventory, runtime, analysis);\n const stats = runtime.results.map(scenarioStats);\n const dark = neverCallable(reach);\n\n const parts: ReportPart[] = [\n { kind: \"table\", title: `WROTE (${written.length})`, headers: [\"SCENARIO\", \"FILE\"], rows: written },\n ];\n\n // Over one scenario, \"never callable\" repeats that scenario's own table row\n // for row — see neverCallableSection().\n const sections = [\n ...(coverage ? coverageSections(coverage) : []),\n ...(dark.length > 0 && stats.length > 1 ? [neverCallableSection(dark)] : []),\n ];\n if (sections.length > 0) parts.push({ kind: \"findings\", sections });\n\n parts.push({\n kind: \"blocks\",\n blocks: [\n {\n title: \"SURFACE SUMMARY\",\n rows: surfaceSummaryRows({\n depth: options.depth,\n ...(coverage ? { coverage } : {}),\n scenarios: stats,\n failures: runtime.failures.length,\n reach,\n }),\n },\n ],\n });\n\n if (runtime.failures.length > 0) {\n // A baseline written for some scenarios and not others is a baseline that\n // will fail `check` for a reason that has nothing to do with the surface.\n parts.push({\n kind: \"findings\",\n stream: \"err\",\n sections: [\n failureSection(runtime.failures),\n ...(inventory ? [noVerdictSection(runtime.failures)] : []),\n ],\n });\n }\n\n await present.emit(...parts);\n return runtime.failures.length > 0 ? 2 : 0;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuDA,eAAsB,YAAY,SAA2C;AAC3E,MAAI,QAAQ,UAAU,UAAU;AAC9B,UAAM,IAAI;AAAA,MACR;AAAA,IAEF;AAAA,EACF;AAEA,QAAM,WAA4B;AAAA,IAChC,YAAY,QAAQ;AAAA,IACpB,OAAO,QAAQ;AAAA,IACf,GAAI,QAAQ,WAAW,EAAE,UAAU,QAAQ,SAAS,IAAI,CAAC;AAAA,IACzD,GAAI,QAAQ,QAAQ,EAAE,OAAO,QAAQ,MAAM,IAAI,CAAC;AAAA,IAChD,GAAI,QAAQ,WAAW,EAAE,UAAU,QAAQ,SAAS,IAAI,CAAC;AAAA,IACzD,GAAI,QAAQ,cAAc,EAAE,aAAa,QAAQ,YAAY,IAAI,CAAC;AAAA,EACpE;AAEA,QAAM,UAAU,MAAM,gBAAgB,OAAO;AAC7C,QAAM,QAAQ,KAAK,cAAc;AAEjC,QAAM,YAAY,cAAc,QAAQ;AACxC,MAAI,YAAsB,CAAC;AAC3B,MAAI,eAAe;AACnB,QAAM,UAAU,MAAM,eAAe,UAAU;AAAA,IAC7C,QAAQ,OAAO,SAAS;AACtB,kBAAY,KAAK;AACjB,YAAM,QAAQ,KAAK;AAAA,QACjB,MAAM;AAAA,QACN,QAAQ,gBAAgB,oBAAoB;AAA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AI,WAAW,iBAAiB,QAAQ,IAAI,CAAC;AAAA,IAC7C,GAAI,KAAK,SAAS,KAAK,MAAM,SAAS,IAAI,CAAC,qBAAqB,IAAI,CAAC,IAAI,CAAC;AAAA,EAC5E;AACA,MAAI,SAAS,SAAS,EAAG,OAAM,KAAK,EAAE,MAAM,YAAY,SAAS,CAAC;AAElE,QAAM,KAAK;AAAA,IACT,MAAM;AAAA,IACN,QAAQ;AAAA,MACN;AAAA,QACE,OAAO;AAAA,QACP,MAAM,mBAAmB;AAAA,UACvB,OAAO,QAAQ;AAAA,UACf,GAAI,WAAW,EAAE,SAAS,IAAI,CAAC;AAAA,UAC/B,WAAW;AAAA,UACX,UAAU,QAAQ,SAAS;AAAA,UAC3B;AAAA,QACF,CAAC;AAAA,MACH;AAAA,IACF;AAAA,EACF,CAAC;AAED,MAAI,QAAQ,SAAS,SAAS,GAAG;AAG/B,UAAM,KAAK;AAAA,MACT,MAAM;AAAA,MACN,QAAQ;AAAA,MACR,UAAU;AAAA,QACR,eAAe,QAAQ,QAAQ;AAAA,QAC/B,GAAI,YAAY,CAAC,iBAAiB,QAAQ,QAAQ,CAAC,IAAI,CAAC;AAAA,MAC1D;AAAA,IACF,CAAC;AAAA,EACH;AAEA,QAAM,QAAQ,KAAK,GAAG,KAAK;AAC3B,SAAO,QAAQ,SAAS,SAAS,IAAI,IAAI;AAC3C;","names":[]}
|
package/dist/vitest.d.ts
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { RenderedAgentSurface } from '@agent-surface/testing/react';
|
|
2
|
-
import { AgentConsumer } from '@agent-surface/core';
|
|
3
|
-
import { M as MountResult, S as ScenarioProps, a as SurfaceConfig } from './config-rHD2wEws.js';
|
|
4
|
-
import 'react';
|
|
5
|
-
|
|
6
|
-
declare const DEFAULT_CLI_CONSUMER: AgentConsumer;
|
|
7
|
-
interface MountScenarioOptions {
|
|
8
|
-
consumer?: AgentConsumer;
|
|
9
|
-
}
|
|
10
|
-
interface MountedScenario<TApp> {
|
|
11
|
-
scenario: string;
|
|
12
|
-
surface: RenderedAgentSurface;
|
|
13
|
-
mounted: MountResult<TApp>;
|
|
14
|
-
/**
|
|
15
|
-
* Whatever `mount()` returned as `app`. Typed as `TApp` rather than
|
|
16
|
-
* `TApp | undefined` because a config that never sets it infers `TApp` as
|
|
17
|
-
* `unknown`, and forcing a `!` on every test that *does* set it is worse
|
|
18
|
-
* than trusting the config's own return type.
|
|
19
|
-
*/
|
|
20
|
-
app: TApp;
|
|
21
|
-
consumer: AgentConsumer;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* The one mounting path. `agent-surface inspect` and the Vitest helper both
|
|
25
|
-
* come through here, so a scenario cannot behave one way in CI and another in
|
|
26
|
-
* the terminal — which is the entire reason scenarios live in one file.
|
|
27
|
-
*/
|
|
28
|
-
declare function mountScenario<TScenario extends ScenarioProps, TApp>(config: SurfaceConfig<TScenario, TApp>, scenario: string, options?: MountScenarioOptions): Promise<MountedScenario<TApp>>;
|
|
29
|
-
|
|
30
|
-
export { DEFAULT_CLI_CONSUMER, MountResult, type MountScenarioOptions, type MountedScenario, ScenarioProps, SurfaceConfig, mountScenario };
|
package/dist/vitest.js
DELETED
package/dist/vitest.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|