@agent-surface/cli 0.14.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 +183 -191
- 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 -172
- 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-O7ENP4XP.js +0 -259
- package/dist/check-O7ENP4XP.js.map +0 -1
- package/dist/chunk-A2G4QLX5.js +0 -29
- package/dist/chunk-A2G4QLX5.js.map +0 -1
- package/dist/chunk-G7Z6PP6C.js +0 -532
- package/dist/chunk-G7Z6PP6C.js.map +0 -1
- package/dist/chunk-JR4GESLI.js +0 -61
- package/dist/chunk-JR4GESLI.js.map +0 -1
- package/dist/chunk-LQUL4OIA.js +0 -1441
- package/dist/chunk-LQUL4OIA.js.map +0 -1
- package/dist/chunk-YUT4FVQQ.js +0 -220
- package/dist/chunk-YUT4FVQQ.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-64GIHMKV.js +0 -164
- package/dist/init-64GIHMKV.js.map +0 -1
- package/dist/ink-ICJWXGZC.js +0 -345
- package/dist/ink-ICJWXGZC.js.map +0 -1
- package/dist/inspect-6OZ6ZBKZ.js +0 -226
- package/dist/inspect-6OZ6ZBKZ.js.map +0 -1
- package/dist/snapshot-GTDFQTN2.js +0 -130
- package/dist/snapshot-GTDFQTN2.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/ink-ICJWXGZC.js
DELETED
|
@@ -1,345 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
STATUS_WIDTH,
|
|
3
|
-
flatRows,
|
|
4
|
-
reportGrid,
|
|
5
|
-
riskClause
|
|
6
|
-
} from "./chunk-LQUL4OIA.js";
|
|
7
|
-
|
|
8
|
-
// src/render/ink.tsx
|
|
9
|
-
import { Box, Static, Text, useInput } from "ink";
|
|
10
|
-
import Spinner from "ink-spinner";
|
|
11
|
-
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
12
|
-
var OUTCOME = {
|
|
13
|
-
expose: { mark: "\u25CF", color: "green", state: "callable" },
|
|
14
|
-
disable: { mark: "\u25D0", color: "yellow", state: "disabled" },
|
|
15
|
-
hide: { mark: "\u25CB", color: "red", state: "hidden" }
|
|
16
|
-
};
|
|
17
|
-
var STATUS_COLOR = {
|
|
18
|
-
PASS: "green",
|
|
19
|
-
WARN: "yellow",
|
|
20
|
-
FAIL: "red",
|
|
21
|
-
ERROR: "red"
|
|
22
|
-
};
|
|
23
|
-
var TONE_COLOR = { good: "green", warn: "yellow", bad: "red" };
|
|
24
|
-
var NONE = "\u2014";
|
|
25
|
-
function widthsFor(headers, rows) {
|
|
26
|
-
return headers.map(
|
|
27
|
-
(header, column) => Math.max(header.length, ...rows.map((row) => (row[column] ?? "").length))
|
|
28
|
-
);
|
|
29
|
-
}
|
|
30
|
-
function pad(value, width) {
|
|
31
|
-
return value.padEnd(width);
|
|
32
|
-
}
|
|
33
|
-
function Confirm({
|
|
34
|
-
question,
|
|
35
|
-
onAnswer
|
|
36
|
-
}) {
|
|
37
|
-
useInput((input, key) => {
|
|
38
|
-
if (key.return || input.toLowerCase() === "y") onAnswer(true);
|
|
39
|
-
else if (key.escape || input.toLowerCase() === "n" || key.ctrl && input === "c") {
|
|
40
|
-
onAnswer(false);
|
|
41
|
-
}
|
|
42
|
-
});
|
|
43
|
-
return /* @__PURE__ */ jsxs(Box, { marginTop: 1, children: [
|
|
44
|
-
/* @__PURE__ */ jsx(Text, { bold: true, children: question }),
|
|
45
|
-
/* @__PURE__ */ jsx(Text, { dimColor: true, children: " (Y/n) " })
|
|
46
|
-
] });
|
|
47
|
-
}
|
|
48
|
-
function Loading({ label }) {
|
|
49
|
-
return /* @__PURE__ */ jsxs(Text, { children: [
|
|
50
|
-
/* @__PURE__ */ jsx(Text, { color: "cyan", children: /* @__PURE__ */ jsx(Spinner, { type: "dots" }) }),
|
|
51
|
-
/* @__PURE__ */ jsx(Text, { dimColor: true, children: ` ${label}\u2026` })
|
|
52
|
-
] });
|
|
53
|
-
}
|
|
54
|
-
function Row({ row, width, statuses }) {
|
|
55
|
-
return /* @__PURE__ */ jsxs(Box, { children: [
|
|
56
|
-
/* @__PURE__ */ jsx(Text, { dimColor: true, children: pad(row.label, width) }),
|
|
57
|
-
statuses ? /* @__PURE__ */ jsx(Text, { bold: true, color: row.status ? STATUS_COLOR[row.status] : void 0, children: pad(row.status ?? "", STATUS_WIDTH) }) : null,
|
|
58
|
-
/* @__PURE__ */ jsx(Text, { color: row.tone ? TONE_COLOR[row.tone] : void 0, wrap: "wrap", children: row.text })
|
|
59
|
-
] });
|
|
60
|
-
}
|
|
61
|
-
function Report({
|
|
62
|
-
blocks,
|
|
63
|
-
labelWidth
|
|
64
|
-
}) {
|
|
65
|
-
const grid = reportGrid(blocks, labelWidth);
|
|
66
|
-
const drawn = blocks.filter((block) => block.title || block.rows.length > 0);
|
|
67
|
-
return /* @__PURE__ */ jsx(
|
|
68
|
-
Static,
|
|
69
|
-
{
|
|
70
|
-
items: drawn.map((block, index) => ({ key: block.title ?? `block-${index}`, block, index })),
|
|
71
|
-
children: ({ key, block, index }) => /* @__PURE__ */ jsxs(Box, { flexDirection: "column", marginTop: index === 0 ? 0 : 1, children: [
|
|
72
|
-
block.title ? /* @__PURE__ */ jsx(Text, { bold: true, children: block.title }) : null,
|
|
73
|
-
block.rows.map((row) => /* @__PURE__ */ jsx(Row, { row, width: grid.label, statuses: grid.statuses }, row.label))
|
|
74
|
-
] }, key)
|
|
75
|
-
}
|
|
76
|
-
);
|
|
77
|
-
}
|
|
78
|
-
function Grid({ headers, rows }) {
|
|
79
|
-
const widths = widthsFor(
|
|
80
|
-
headers,
|
|
81
|
-
rows.map((row) => row.cells)
|
|
82
|
-
);
|
|
83
|
-
return /* @__PURE__ */ jsxs(Box, { flexDirection: "column", children: [
|
|
84
|
-
/* @__PURE__ */ jsx(Box, { children: headers.map((header, column) => /* @__PURE__ */ jsx(Text, { dimColor: true, bold: true, children: column === headers.length - 1 ? header : `${pad(header, widths[column])} ` }, header)) }),
|
|
85
|
-
rows.map((row, index) => /* @__PURE__ */ jsxs(Box, { flexDirection: "column", children: [
|
|
86
|
-
/* @__PURE__ */ jsx(Box, { children: row.cells.map((cell, column) => /* @__PURE__ */ jsx(Text, { bold: column === 0, children: column === headers.length - 1 ? cell : `${pad(cell, widths[column])} ` }, `${column}`)) }),
|
|
87
|
-
row.note ? /* @__PURE__ */ jsx(Box, { paddingLeft: 4, children: /* @__PURE__ */ jsx(Text, { dimColor: true, wrap: "wrap", children: `\u2937 ${row.note}` }) }) : null
|
|
88
|
-
] }, `${row.cells[0]}-${index}`))
|
|
89
|
-
] });
|
|
90
|
-
}
|
|
91
|
-
function Table({
|
|
92
|
-
title,
|
|
93
|
-
lead,
|
|
94
|
-
headers,
|
|
95
|
-
rows
|
|
96
|
-
}) {
|
|
97
|
-
return /* @__PURE__ */ jsx(Static, { items: [{ key: title }], children: (block) => /* @__PURE__ */ jsxs(Box, { flexDirection: "column", children: [
|
|
98
|
-
/* @__PURE__ */ jsx(Text, { bold: true, children: title }),
|
|
99
|
-
lead ? /* @__PURE__ */ jsx(Text, { dimColor: true, wrap: "wrap", children: lead }) : null,
|
|
100
|
-
/* @__PURE__ */ jsx(Grid, { headers, rows })
|
|
101
|
-
] }, block.key) });
|
|
102
|
-
}
|
|
103
|
-
function Note({
|
|
104
|
-
title,
|
|
105
|
-
lines,
|
|
106
|
-
muted
|
|
107
|
-
}) {
|
|
108
|
-
return /* @__PURE__ */ jsx(Static, { items: [{ key: title ?? lines[0] ?? "note" }], children: (block) => /* @__PURE__ */ jsxs(Box, { flexDirection: "column", children: [
|
|
109
|
-
title ? /* @__PURE__ */ jsx(Text, { bold: true, children: title }) : null,
|
|
110
|
-
lines.map((line, index) => /* @__PURE__ */ jsx(Text, { dimColor: muted === true, children: line }, `${index}`))
|
|
111
|
-
] }, block.key) });
|
|
112
|
-
}
|
|
113
|
-
function Steps({ title, steps }) {
|
|
114
|
-
return /* @__PURE__ */ jsx(Static, { items: [{ key: title }], children: (block) => /* @__PURE__ */ jsxs(Box, { flexDirection: "column", children: [
|
|
115
|
-
/* @__PURE__ */ jsx(Text, { bold: true, children: title }),
|
|
116
|
-
steps.map((step, index) => /* @__PURE__ */ jsxs(Box, { paddingLeft: 2, children: [
|
|
117
|
-
/* @__PURE__ */ jsx(Text, { color: "cyan", children: `${index + 1}. ` }),
|
|
118
|
-
/* @__PURE__ */ jsx(Text, { wrap: "wrap", children: step })
|
|
119
|
-
] }, `${index}`))
|
|
120
|
-
] }, block.key) });
|
|
121
|
-
}
|
|
122
|
-
function Findings({ sections }) {
|
|
123
|
-
return /* @__PURE__ */ jsx(
|
|
124
|
-
Static,
|
|
125
|
-
{
|
|
126
|
-
items: sections.map((section, index) => ({ key: `${section.title}-${index}`, section, index })),
|
|
127
|
-
children: ({ key, section, index }) => /* @__PURE__ */ jsxs(Box, { flexDirection: "column", marginTop: index === 0 ? 0 : 1, children: [
|
|
128
|
-
/* @__PURE__ */ jsxs(Box, { children: [
|
|
129
|
-
/* @__PURE__ */ jsx(
|
|
130
|
-
Text,
|
|
131
|
-
{
|
|
132
|
-
backgroundColor: section.tone === "notice" ? "yellow" : "red",
|
|
133
|
-
color: "black",
|
|
134
|
-
bold: true,
|
|
135
|
-
children: ` ${section.title} `
|
|
136
|
-
}
|
|
137
|
-
),
|
|
138
|
-
/* @__PURE__ */ jsx(Text, { dimColor: true, children: ` ${section.gloss}${section.count > 0 ? ` ${section.count}` : ""}` })
|
|
139
|
-
] }),
|
|
140
|
-
section.headers && section.rows ? /* @__PURE__ */ jsx(Grid, { headers: section.headers, rows: section.rows }) : null,
|
|
141
|
-
(section.lines ?? []).map((line, index2) => /* @__PURE__ */ jsx(Box, { paddingLeft: 2, children: /* @__PURE__ */ jsx(Text, { children: line }) }, `${index2}`)),
|
|
142
|
-
section.hint ? /* @__PURE__ */ jsx(Box, { paddingLeft: 2, children: /* @__PURE__ */ jsx(Text, { color: "cyan", wrap: "wrap", children: `\u2192 ${section.hint}` }) }) : null
|
|
143
|
-
] }, key)
|
|
144
|
-
}
|
|
145
|
-
);
|
|
146
|
-
}
|
|
147
|
-
function PolicyLine({
|
|
148
|
-
policy
|
|
149
|
-
}) {
|
|
150
|
-
const vote = policy.discovery?.decision;
|
|
151
|
-
const color = vote === "hide" ? "red" : vote === "disable" ? "yellow" : "green";
|
|
152
|
-
return /* @__PURE__ */ jsxs(Box, { paddingLeft: 6, children: [
|
|
153
|
-
/* @__PURE__ */ jsx(Text, { dimColor: true, children: "policy " }),
|
|
154
|
-
/* @__PURE__ */ jsx(Text, { bold: true, children: policy.name }),
|
|
155
|
-
/* @__PURE__ */ jsx(Text, { dimColor: true, children: ` (${policy.scope}${policy.phases.length ? `, ${policy.phases.join("/")}` : ""}) ` }),
|
|
156
|
-
vote ? /* @__PURE__ */ jsxs(Text, { color, children: [
|
|
157
|
-
vote,
|
|
158
|
-
policy.discovery?.decision === "disable" ? ` \u2014 ${policy.discovery.reason}` : ""
|
|
159
|
-
] }) : /* @__PURE__ */ jsx(Text, { dimColor: true, children: "no discovery hook" }),
|
|
160
|
-
policy.threw ? /* @__PURE__ */ jsx(Text, { color: "red", bold: true, children: " THREW" }) : null,
|
|
161
|
-
policy.confirmationEscalation ? /* @__PURE__ */ jsx(Text, { color: "magenta", children: " escalates-confirmation" }) : null
|
|
162
|
-
] });
|
|
163
|
-
}
|
|
164
|
-
function Capability({ row }) {
|
|
165
|
-
const outcome = OUTCOME[row.outcome];
|
|
166
|
-
return /* @__PURE__ */ jsxs(Box, { flexDirection: "column", marginTop: 1, children: [
|
|
167
|
-
/* @__PURE__ */ jsxs(Box, { children: [
|
|
168
|
-
/* @__PURE__ */ jsx(Text, { color: outcome.color, children: ` ${outcome.mark} ` }),
|
|
169
|
-
/* @__PURE__ */ jsx(Text, { bold: true, children: row.name }),
|
|
170
|
-
row.tags.length > 0 ? /* @__PURE__ */ jsx(Text, { dimColor: true, children: ` ${row.tags.join(" \xB7 ")}` }) : null
|
|
171
|
-
] }),
|
|
172
|
-
/* @__PURE__ */ jsx(Box, { paddingLeft: 4, children: /* @__PURE__ */ jsx(Text, { dimColor: true, wrap: "wrap", children: row.description }) }),
|
|
173
|
-
row.reason ? /* @__PURE__ */ jsx(Box, { paddingLeft: 4, children: /* @__PURE__ */ jsx(Text, { color: "yellow", wrap: "wrap", children: `\u2937 ${row.reason}` }) }) : null,
|
|
174
|
-
row.policies ? row.policies.length > 0 ? row.policies.map((policy, index) => /* @__PURE__ */ jsx(PolicyLine, { policy }, `${policy.name}-${index}`)) : [
|
|
175
|
-
/* @__PURE__ */ jsx(Box, { paddingLeft: 6, children: /* @__PURE__ */ jsx(Text, { dimColor: true, children: "policies: none" }) }, "none")
|
|
176
|
-
] : null,
|
|
177
|
-
row.policies && row.availability && !row.availability.available ? /* @__PURE__ */ jsx(Box, { paddingLeft: 6, children: /* @__PURE__ */ jsx(Text, { dimColor: true, children: `availability: unavailable${row.availability.reason ? ` \u2014 ${row.availability.reason}` : ""}` }) }) : null,
|
|
178
|
-
row.schemas?.input !== void 0 ? /* @__PURE__ */ jsx(Box, { paddingLeft: 6, children: /* @__PURE__ */ jsx(Text, { dimColor: true, wrap: "wrap", children: `input: ${JSON.stringify(row.schemas.input)}` }) }) : null,
|
|
179
|
-
row.schemas?.output !== void 0 ? /* @__PURE__ */ jsx(Box, { paddingLeft: 6, children: /* @__PURE__ */ jsx(Text, { dimColor: true, wrap: "wrap", children: `output: ${JSON.stringify(row.schemas.output)}` }) }) : null
|
|
180
|
-
] });
|
|
181
|
-
}
|
|
182
|
-
function Group({ group }) {
|
|
183
|
-
return /* @__PURE__ */ jsxs(Box, { flexDirection: "column", marginTop: 1, children: [
|
|
184
|
-
/* @__PURE__ */ jsxs(Box, { children: [
|
|
185
|
-
/* @__PURE__ */ jsx(Text, { backgroundColor: "blueBright", color: "black", bold: true, children: ` ${group.heading} ` }),
|
|
186
|
-
/* @__PURE__ */ jsx(Text, { dimColor: true, children: ` ${group.rows.length}` })
|
|
187
|
-
] }),
|
|
188
|
-
group.rows.map((row) => /* @__PURE__ */ jsx(Capability, { row }, `${row.capabilityId}-${row.name}`))
|
|
189
|
-
] });
|
|
190
|
-
}
|
|
191
|
-
function Header({ view }) {
|
|
192
|
-
const risk = riskClause(flatRows(view));
|
|
193
|
-
return /* @__PURE__ */ jsxs(Box, { children: [
|
|
194
|
-
/* @__PURE__ */ jsx(Text, { bold: true, children: view.scenario }),
|
|
195
|
-
view.route ? /* @__PURE__ */ jsx(Text, { dimColor: true, children: ` ${view.route}` }) : null,
|
|
196
|
-
view.scope && view.scope.length > 0 ? /* @__PURE__ */ jsx(Text, { color: "cyan", children: ` scope ${view.scope.join(" ")}` }) : null,
|
|
197
|
-
/* @__PURE__ */ jsx(Text, { dimColor: true, children: " \xB7 " }),
|
|
198
|
-
/* @__PURE__ */ jsx(Text, { color: "green", children: `${view.counts.callable} callable` }),
|
|
199
|
-
/* @__PURE__ */ jsx(Text, { dimColor: true, children: ", " }),
|
|
200
|
-
/* @__PURE__ */ jsx(Text, { color: "yellow", children: `${view.counts.disabled} visible-disabled` }),
|
|
201
|
-
/* @__PURE__ */ jsx(Text, { dimColor: true, children: ", " }),
|
|
202
|
-
/* @__PURE__ */ jsx(Text, { color: "red", children: `${view.counts.hidden} hidden` }),
|
|
203
|
-
view.rejections.length > 0 ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
204
|
-
/* @__PURE__ */ jsx(Text, { dimColor: true, children: ", " }),
|
|
205
|
-
/* @__PURE__ */ jsx(Text, { color: "magenta", children: `${view.rejections.length} registration${view.rejections.length === 1 ? "" : "s"} rejected` })
|
|
206
|
-
] }) : null,
|
|
207
|
-
risk ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
208
|
-
/* @__PURE__ */ jsx(Text, { dimColor: true, children: " \xB7 " }),
|
|
209
|
-
/* @__PURE__ */ jsx(Text, { color: "magenta", children: risk })
|
|
210
|
-
] }) : null
|
|
211
|
-
] });
|
|
212
|
-
}
|
|
213
|
-
function Rejections({ view }) {
|
|
214
|
-
return /* @__PURE__ */ jsxs(Box, { flexDirection: "column", marginTop: 1, children: [
|
|
215
|
-
/* @__PURE__ */ jsxs(Box, { children: [
|
|
216
|
-
/* @__PURE__ */ jsx(Text, { backgroundColor: "magenta", color: "black", bold: true, children: " rejected during mount " }),
|
|
217
|
-
/* @__PURE__ */ jsx(Text, { dimColor: true, children: ` ${view.rejections.length}` })
|
|
218
|
-
] }),
|
|
219
|
-
view.rejections.map((rejection) => /* @__PURE__ */ jsxs(Box, { children: [
|
|
220
|
-
/* @__PURE__ */ jsx(Text, { color: "magenta", children: " ! " }),
|
|
221
|
-
/* @__PURE__ */ jsx(Text, { bold: true, children: `${rejection.componentType} (${rejection.instanceId})` }),
|
|
222
|
-
/* @__PURE__ */ jsx(Text, { dimColor: true, children: rejection.reason === "duplicate" ? " duplicate \u2014 an earlier registration holds this key" : " guard \u2014 onRegister rejected this registration" })
|
|
223
|
-
] }, `${rejection.componentType}@${rejection.instanceId}-${rejection.reason}`))
|
|
224
|
-
] });
|
|
225
|
-
}
|
|
226
|
-
function Empty({ view }) {
|
|
227
|
-
if (view.counts.hidden > 0) {
|
|
228
|
-
return /* @__PURE__ */ jsxs(Box, { flexDirection: "column", marginTop: 1, children: [
|
|
229
|
-
/* @__PURE__ */ jsxs(Text, { dimColor: true, wrap: "wrap", children: [
|
|
230
|
-
`Nothing is callable here \u2014 all ${view.counts.hidden} registered capabilities were hidden by policy. `,
|
|
231
|
-
"The surface is empty by decision, not because nothing was annotated."
|
|
232
|
-
] }),
|
|
233
|
-
view.explained ? null : /* @__PURE__ */ jsx(Text, { dimColor: true, children: "Re-run with --explain to see which policy hid them." })
|
|
234
|
-
] });
|
|
235
|
-
}
|
|
236
|
-
return /* @__PURE__ */ jsxs(Box, { flexDirection: "column", marginTop: 1, children: [
|
|
237
|
-
/* @__PURE__ */ jsx(Text, { dimColor: true, wrap: "wrap", children: "Nothing is registered for this scenario \u2014 the agent has no surface here. That is the default: capabilities exist only where they were explicitly annotated." }),
|
|
238
|
-
view.explained ? null : /* @__PURE__ */ jsx(Text, { dimColor: true, children: "Re-run with --explain to see whether a policy hid it." })
|
|
239
|
-
] });
|
|
240
|
-
}
|
|
241
|
-
var HEADERS = ["CAPABILITY", "KIND", "EFFECT", "STATE", "FLAGS"];
|
|
242
|
-
function cellsFor(row) {
|
|
243
|
-
return [
|
|
244
|
-
row.path,
|
|
245
|
-
row.kind,
|
|
246
|
-
row.effect ?? NONE,
|
|
247
|
-
OUTCOME[row.outcome].state,
|
|
248
|
-
row.flags.length > 0 ? row.flags.join(" \xB7 ") : NONE
|
|
249
|
-
];
|
|
250
|
-
}
|
|
251
|
-
function TableRow({
|
|
252
|
-
row,
|
|
253
|
-
cells,
|
|
254
|
-
widths
|
|
255
|
-
}) {
|
|
256
|
-
const outcome = OUTCOME[row.outcome];
|
|
257
|
-
return /* @__PURE__ */ jsxs(Box, { flexDirection: "column", children: [
|
|
258
|
-
/* @__PURE__ */ jsxs(Box, { children: [
|
|
259
|
-
/* @__PURE__ */ jsx(Text, { bold: true, children: `${pad(cells[0], widths[0])} ` }),
|
|
260
|
-
/* @__PURE__ */ jsx(Text, { dimColor: true, children: `${pad(cells[1], widths[1])} ` }),
|
|
261
|
-
/* @__PURE__ */ jsx(Text, { children: `${pad(cells[2], widths[2])} ` }),
|
|
262
|
-
/* @__PURE__ */ jsx(Text, { color: outcome.color, children: `${pad(cells[3], widths[3])} ` }),
|
|
263
|
-
/* @__PURE__ */ jsx(Text, { dimColor: true, children: cells[4] })
|
|
264
|
-
] }),
|
|
265
|
-
row.reason ? /* @__PURE__ */ jsx(Box, { paddingLeft: 4, children: /* @__PURE__ */ jsx(Text, { color: "yellow", wrap: "wrap", children: `\u2937 ${row.reason}` }) }) : null
|
|
266
|
-
] });
|
|
267
|
-
}
|
|
268
|
-
function CapabilityTable({ rows }) {
|
|
269
|
-
const cells = rows.map(cellsFor);
|
|
270
|
-
const widths = widthsFor(HEADERS, cells);
|
|
271
|
-
return /* @__PURE__ */ jsxs(Box, { flexDirection: "column", marginTop: 1, children: [
|
|
272
|
-
/* @__PURE__ */ jsx(Box, { children: HEADERS.map((header, column) => /* @__PURE__ */ jsx(Text, { dimColor: true, bold: true, children: column === HEADERS.length - 1 ? header : `${pad(header, widths[column])} ` }, header)) }),
|
|
273
|
-
rows.map((row, index) => /* @__PURE__ */ jsx(
|
|
274
|
-
TableRow,
|
|
275
|
-
{
|
|
276
|
-
row,
|
|
277
|
-
cells: cells[index],
|
|
278
|
-
widths
|
|
279
|
-
},
|
|
280
|
-
`${row.capabilityId}-${index}`
|
|
281
|
-
))
|
|
282
|
-
] });
|
|
283
|
-
}
|
|
284
|
-
function Part({
|
|
285
|
-
part,
|
|
286
|
-
labelWidth
|
|
287
|
-
}) {
|
|
288
|
-
switch (part.kind) {
|
|
289
|
-
case "blocks":
|
|
290
|
-
return /* @__PURE__ */ jsx(Report, { blocks: part.blocks, ...labelWidth ? { labelWidth } : {} });
|
|
291
|
-
case "table":
|
|
292
|
-
return /* @__PURE__ */ jsx(
|
|
293
|
-
Table,
|
|
294
|
-
{
|
|
295
|
-
title: part.title,
|
|
296
|
-
...part.lead ? { lead: part.lead } : {},
|
|
297
|
-
headers: part.headers,
|
|
298
|
-
rows: part.rows
|
|
299
|
-
}
|
|
300
|
-
);
|
|
301
|
-
case "findings":
|
|
302
|
-
return /* @__PURE__ */ jsx(Findings, { sections: part.sections });
|
|
303
|
-
case "surface":
|
|
304
|
-
return /* @__PURE__ */ jsx(Surface, { view: part.view, ...part.detail ? { detail: true } : {} });
|
|
305
|
-
case "note":
|
|
306
|
-
return /* @__PURE__ */ jsx(
|
|
307
|
-
Note,
|
|
308
|
-
{
|
|
309
|
-
...part.title ? { title: part.title } : {},
|
|
310
|
-
...part.muted ? { muted: true } : {},
|
|
311
|
-
lines: part.lines
|
|
312
|
-
}
|
|
313
|
-
);
|
|
314
|
-
case "steps":
|
|
315
|
-
return /* @__PURE__ */ jsx(Steps, { title: part.title, steps: part.steps });
|
|
316
|
-
}
|
|
317
|
-
}
|
|
318
|
-
function Surface({
|
|
319
|
-
view,
|
|
320
|
-
detail
|
|
321
|
-
}) {
|
|
322
|
-
const populated = view.groups.filter((group) => group.rows.length > 0);
|
|
323
|
-
const rows = flatRows(view);
|
|
324
|
-
const blocks = [
|
|
325
|
-
{ key: "__header" },
|
|
326
|
-
...detail ? populated.map((group) => ({ key: group.heading, group })) : rows.length > 0 ? [{ key: "__table", rows }] : []
|
|
327
|
-
];
|
|
328
|
-
return /* @__PURE__ */ jsx(Static, { items: blocks, children: (block) => block.group ? /* @__PURE__ */ jsx(Group, { group: block.group }, block.key) : block.rows ? /* @__PURE__ */ jsx(CapabilityTable, { rows: block.rows }, block.key) : /* @__PURE__ */ jsxs(Box, { flexDirection: "column", children: [
|
|
329
|
-
/* @__PURE__ */ jsx(Header, { view }),
|
|
330
|
-
view.rejections.length > 0 ? /* @__PURE__ */ jsx(Rejections, { view }) : null,
|
|
331
|
-
rows.length === 0 ? /* @__PURE__ */ jsx(Empty, { view }) : null
|
|
332
|
-
] }, block.key) });
|
|
333
|
-
}
|
|
334
|
-
export {
|
|
335
|
-
Confirm,
|
|
336
|
-
Findings,
|
|
337
|
-
Loading,
|
|
338
|
-
Note,
|
|
339
|
-
Part,
|
|
340
|
-
Report,
|
|
341
|
-
Steps,
|
|
342
|
-
Surface,
|
|
343
|
-
Table
|
|
344
|
-
};
|
|
345
|
-
//# sourceMappingURL=ink-ICJWXGZC.js.map
|
package/dist/ink-ICJWXGZC.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/render/ink.tsx"],"sourcesContent":["import type { ReactElement } from \"react\";\nimport { Box, Static, Text, useInput } from \"ink\";\nimport Spinner from \"ink-spinner\";\nimport type { CapabilityRow, CapabilityGroup, SurfaceView } from \"./model.js\";\nimport { flatRows } from \"./model.js\";\nimport {\n reportGrid,\n riskClause,\n STATUS_WIDTH,\n type FindingSection,\n type ReportBlock,\n type ReportPart,\n type ReportRow,\n type TableRow,\n} from \"./summary.js\";\n\nconst OUTCOME = {\n expose: { mark: \"●\", color: \"green\" as const, state: \"callable\" },\n disable: { mark: \"◐\", color: \"yellow\" as const, state: \"disabled\" },\n hide: { mark: \"○\", color: \"red\" as const, state: \"hidden\" },\n};\n\nconst STATUS_COLOR = {\n PASS: \"green\",\n WARN: \"yellow\",\n FAIL: \"red\",\n ERROR: \"red\",\n} as const;\n\nconst TONE_COLOR = { good: \"green\", warn: \"yellow\", bad: \"red\" } as const;\n\nconst NONE = \"—\";\n\n/**\n * Same column widths as the plain renderer computes, and for the same reason:\n * from the content, never from the terminal. A TTY table that reflows on resize\n * and a piped table that does not would be two different renderings of one view\n * model, which is exactly what this file exists to prevent.\n */\nfunction widthsFor(headers: string[], rows: string[][]): number[] {\n return headers.map((header, column) =>\n Math.max(header.length, ...rows.map((row) => (row[column] ?? \"\").length)),\n );\n}\n\nfunction pad(value: string, width: number): string {\n return value.padEnd(width);\n}\n\n/**\n * `init`'s one question. Enter accepts, because the answer this asks for is the\n * one the summary above it has already made the case for — and because a\n * scaffold is the least destructive thing this package writes.\n */\nexport function Confirm({\n question,\n onAnswer,\n}: {\n question: string;\n onAnswer: (yes: boolean) => void;\n}): ReactElement {\n useInput((input, key) => {\n if (key.return || input.toLowerCase() === \"y\") onAnswer(true);\n else if (key.escape || input.toLowerCase() === \"n\" || (key.ctrl && input === \"c\")) {\n onAnswer(false);\n }\n });\n return (\n <Box marginTop={1}>\n <Text bold>{question}</Text>\n <Text dimColor>{\" (Y/n) \"}</Text>\n </Box>\n );\n}\n\nexport function Loading({ label }: { label: string }): ReactElement {\n return (\n <Text>\n <Text color=\"cyan\">\n <Spinner type=\"dots\" />\n </Text>\n <Text dimColor>{` ${label}…`}</Text>\n </Text>\n );\n}\n\n/** One `label STATUS text` row, coloured by whichever of the two it carries. */\nfunction Row({ row, width, statuses }: { row: ReportRow; width: number; statuses: boolean }): ReactElement {\n return (\n <Box>\n <Text dimColor>{pad(row.label, width)}</Text>\n {statuses ? (\n <Text bold color={row.status ? STATUS_COLOR[row.status] : undefined}>\n {pad(row.status ?? \"\", STATUS_WIDTH)}\n </Text>\n ) : null}\n <Text color={row.tone ? TONE_COLOR[row.tone] : undefined} wrap=\"wrap\">\n {row.text}\n </Text>\n </Box>\n );\n}\n\n/**\n * The labelled blocks a report is built from — the run header, the catalog\n * summary, the closing verdict. Same rows the plain renderer prints, same\n * widths from the same `reportGrid`, with the status word and the tone carrying\n * colour on a terminal.\n */\nexport function Report({\n blocks,\n labelWidth,\n}: {\n blocks: ReportBlock[];\n labelWidth?: number;\n}): ReactElement {\n const grid = reportGrid(blocks, labelWidth);\n // An empty, untitled block is dropped rather than painted, exactly as the\n // plain renderer drops it — otherwise the same report carries a blank line in\n // the terminal that a CI log does not have.\n const drawn = blocks.filter((block) => block.title || block.rows.length > 0);\n // Ink prints a newline of its own after each painted frame, so only the\n // blocks *within* one frame ask for the blank line above them. A margin on\n // the first would double it, which reads as a missing block rather than as\n // breathing room.\n return (\n <Static\n items={drawn.map((block, index) => ({ key: block.title ?? `block-${index}`, block, index }))}\n >\n {({ key, block, index }) => (\n <Box key={key} flexDirection=\"column\" marginTop={index === 0 ? 0 : 1}>\n {block.title ? <Text bold>{block.title}</Text> : null}\n {block.rows.map((row) => (\n <Row key={row.label} row={row} width={grid.label} statuses={grid.statuses} />\n ))}\n </Box>\n )}\n </Static>\n );\n}\n\nfunction Grid({ headers, rows }: { headers: string[]; rows: TableRow[] }): ReactElement {\n const widths = widthsFor(\n headers,\n rows.map((row) => row.cells),\n );\n return (\n <Box flexDirection=\"column\">\n <Box>\n {headers.map((header, column) => (\n <Text key={header} dimColor bold>\n {column === headers.length - 1 ? header : `${pad(header, widths[column]!)} `}\n </Text>\n ))}\n </Box>\n {rows.map((row, index) => (\n <Box key={`${row.cells[0]}-${index}`} flexDirection=\"column\">\n <Box>\n {row.cells.map((cell, column) => (\n <Text key={`${column}`} bold={column === 0}>\n {column === headers.length - 1 ? cell : `${pad(cell, widths[column]!)} `}\n </Text>\n ))}\n </Box>\n {row.note ? (\n <Box paddingLeft={4}>\n <Text dimColor wrap=\"wrap\">{`⤷ ${row.note}`}</Text>\n </Box>\n ) : null}\n </Box>\n ))}\n </Box>\n );\n}\n\nexport function Table({\n title,\n lead,\n headers,\n rows,\n}: {\n title: string;\n lead?: string;\n headers: string[];\n rows: TableRow[];\n}): ReactElement {\n return (\n <Static items={[{ key: title }]}>\n {(block) => (\n <Box key={block.key} flexDirection=\"column\">\n <Text bold>{title}</Text>\n {lead ? (\n <Text dimColor wrap=\"wrap\">\n {lead}\n </Text>\n ) : null}\n <Grid headers={headers} rows={rows} />\n </Box>\n )}\n </Static>\n );\n}\n\n/**\n * Lines that are neither a grid nor a finding: a closing hint, a list of keys\n * to copy. Never wrapped, and dimmed only where the part says so — an allowlist\n * key is read by selecting it, and a reflowed or greyed-out one is a key nobody\n * pastes.\n */\nexport function Note({\n title,\n lines,\n muted,\n}: {\n title?: string;\n lines: string[];\n muted?: boolean;\n}): ReactElement {\n return (\n <Static items={[{ key: title ?? lines[0] ?? \"note\" }]}>\n {(block) => (\n <Box key={block.key} flexDirection=\"column\">\n {title ? <Text bold>{title}</Text> : null}\n {lines.map((line, index) => (\n <Text key={`${index}`} dimColor={muted === true}>\n {line}\n </Text>\n ))}\n </Box>\n )}\n </Static>\n );\n}\n\n/** The commands that clear a report, in the order worth running them. */\nexport function Steps({ title, steps }: { title: string; steps: string[] }): ReactElement {\n return (\n <Static items={[{ key: title }]}>\n {(block) => (\n <Box key={block.key} flexDirection=\"column\">\n <Text bold>{title}</Text>\n {steps.map((step, index) => (\n <Box key={`${index}`} paddingLeft={2}>\n <Text color=\"cyan\">{`${index + 1}. `}</Text>\n <Text wrap=\"wrap\">{step}</Text>\n </Box>\n ))}\n </Box>\n )}\n </Static>\n );\n}\n\n/**\n * Findings. The heading says what it is, the gloss why it matters, and the hint\n * what to do — printed with the finding rather than left to be inferred.\n */\nexport function Findings({ sections }: { sections: FindingSection[] }): ReactElement {\n return (\n <Static\n items={sections.map((section, index) => ({ key: `${section.title}-${index}`, section, index }))}\n >\n {({ key, section, index }) => (\n <Box key={key} flexDirection=\"column\" marginTop={index === 0 ? 0 : 1}>\n <Box>\n <Text\n backgroundColor={section.tone === \"notice\" ? \"yellow\" : \"red\"}\n color=\"black\"\n bold\n >{` ${section.title} `}</Text>\n <Text dimColor>{` ${section.gloss}${section.count > 0 ? ` ${section.count}` : \"\"}`}</Text>\n </Box>\n {section.headers && section.rows ? (\n <Grid headers={section.headers} rows={section.rows} />\n ) : null}\n {(section.lines ?? []).map((line, index) => (\n <Box key={`${index}`} paddingLeft={2}>\n <Text>{line}</Text>\n </Box>\n ))}\n {section.hint ? (\n <Box paddingLeft={2}>\n <Text color=\"cyan\" wrap=\"wrap\">{`→ ${section.hint}`}</Text>\n </Box>\n ) : null}\n </Box>\n )}\n </Static>\n );\n}\n\nfunction PolicyLine({\n policy,\n}: {\n policy: NonNullable<CapabilityRow[\"policies\"]>[number];\n}): ReactElement {\n const vote = policy.discovery?.decision;\n const color = vote === \"hide\" ? \"red\" : vote === \"disable\" ? \"yellow\" : \"green\";\n return (\n <Box paddingLeft={6}>\n <Text dimColor>policy </Text>\n <Text bold>{policy.name}</Text>\n <Text dimColor>{` (${policy.scope}${policy.phases.length ? `, ${policy.phases.join(\"/\")}` : \"\"}) `}</Text>\n {vote ? (\n <Text color={color}>\n {vote}\n {policy.discovery?.decision === \"disable\" ? ` — ${policy.discovery.reason}` : \"\"}\n </Text>\n ) : (\n <Text dimColor>no discovery hook</Text>\n )}\n {policy.threw ? <Text color=\"red\" bold>{\" THREW\"}</Text> : null}\n {policy.confirmationEscalation ? (\n <Text color=\"magenta\">{\" escalates-confirmation\"}</Text>\n ) : null}\n </Box>\n );\n}\n\nfunction Capability({ row }: { row: CapabilityRow }): ReactElement {\n const outcome = OUTCOME[row.outcome];\n return (\n <Box flexDirection=\"column\" marginTop={1}>\n <Box>\n <Text color={outcome.color}>{` ${outcome.mark} `}</Text>\n <Text bold>{row.name}</Text>\n {row.tags.length > 0 ? <Text dimColor>{` ${row.tags.join(\" · \")}`}</Text> : null}\n </Box>\n <Box paddingLeft={4}>\n <Text dimColor wrap=\"wrap\">\n {row.description}\n </Text>\n </Box>\n {row.reason ? (\n <Box paddingLeft={4}>\n <Text color=\"yellow\" wrap=\"wrap\">{`⤷ ${row.reason}`}</Text>\n </Box>\n ) : null}\n {row.policies\n ? row.policies.length > 0\n ? row.policies.map((policy, index) => (\n <PolicyLine key={`${policy.name}-${index}`} policy={policy} />\n ))\n : [\n <Box key=\"none\" paddingLeft={6}>\n <Text dimColor>policies: none</Text>\n </Box>,\n ]\n : null}\n {row.policies && row.availability && !row.availability.available ? (\n <Box paddingLeft={6}>\n <Text dimColor>{`availability: unavailable${\n row.availability.reason ? ` — ${row.availability.reason}` : \"\"\n }`}</Text>\n </Box>\n ) : null}\n {row.schemas?.input !== undefined ? (\n <Box paddingLeft={6}>\n <Text dimColor wrap=\"wrap\">{`input: ${JSON.stringify(row.schemas.input)}`}</Text>\n </Box>\n ) : null}\n {row.schemas?.output !== undefined ? (\n <Box paddingLeft={6}>\n <Text dimColor wrap=\"wrap\">{`output: ${JSON.stringify(row.schemas.output)}`}</Text>\n </Box>\n ) : null}\n </Box>\n );\n}\n\nfunction Group({ group }: { group: CapabilityGroup }): ReactElement {\n return (\n <Box flexDirection=\"column\" marginTop={1}>\n <Box>\n <Text backgroundColor=\"blueBright\" color=\"black\" bold>{` ${group.heading} `}</Text>\n <Text dimColor>{` ${group.rows.length}`}</Text>\n </Box>\n {group.rows.map((row) => (\n <Capability key={`${row.capabilityId}-${row.name}`} row={row} />\n ))}\n </Box>\n );\n}\n\n/**\n * The header states everything the counts are relative to (`AS-CLI-007`): the\n * scenario, the route, and the scope when one is active — a scope filters both\n * projections, so an unqualified count reads as a claim about the whole surface.\n * `hidden` is unconditional here for the same reason it is in plain text.\n */\nfunction Header({ view }: { view: SurfaceView }): ReactElement {\n // What the surface can do, not just how much of it there is: \"one of these\n // deletes a device\" is the part a reader needs before they read anything else.\n const risk = riskClause(flatRows(view));\n return (\n <Box>\n <Text bold>{view.scenario}</Text>\n {view.route ? <Text dimColor>{` ${view.route}`}</Text> : null}\n {view.scope && view.scope.length > 0 ? (\n <Text color=\"cyan\">{` scope ${view.scope.join(\" \")}`}</Text>\n ) : null}\n <Text dimColor>{\" · \"}</Text>\n <Text color=\"green\">{`${view.counts.callable} callable`}</Text>\n <Text dimColor>{\", \"}</Text>\n <Text color=\"yellow\">{`${view.counts.disabled} visible-disabled`}</Text>\n <Text dimColor>{\", \"}</Text>\n <Text color=\"red\">{`${view.counts.hidden} hidden`}</Text>\n {view.rejections.length > 0 ? (\n <>\n <Text dimColor>{\", \"}</Text>\n <Text color=\"magenta\">\n {`${view.rejections.length} registration${\n view.rejections.length === 1 ? \"\" : \"s\"\n } rejected`}\n </Text>\n </>\n ) : null}\n {risk ? (\n <>\n <Text dimColor>{\" · \"}</Text>\n <Text color=\"magenta\">{risk}</Text>\n </>\n ) : null}\n </Box>\n );\n}\n\n/**\n * Rejected registrations (`AS-CLI-006`). A dead handle leaves no trace in either\n * projection, so without this block a copy-pasted component `type` removes a\n * capability and prints nothing anywhere.\n */\nfunction Rejections({ view }: { view: SurfaceView }): ReactElement {\n return (\n <Box flexDirection=\"column\" marginTop={1}>\n <Box>\n <Text backgroundColor=\"magenta\" color=\"black\" bold>\n {\" rejected during mount \"}\n </Text>\n <Text dimColor>{` ${view.rejections.length}`}</Text>\n </Box>\n {view.rejections.map((rejection) => (\n <Box key={`${rejection.componentType}@${rejection.instanceId}-${rejection.reason}`}>\n <Text color=\"magenta\">{\" ! \"}</Text>\n <Text bold>{`${rejection.componentType} (${rejection.instanceId})`}</Text>\n <Text dimColor>\n {rejection.reason === \"duplicate\"\n ? \" duplicate — an earlier registration holds this key\"\n : \" guard — onRegister rejected this registration\"}\n </Text>\n </Box>\n ))}\n </Box>\n );\n}\n\nfunction Empty({ view }: { view: SurfaceView }): ReactElement {\n if (view.counts.hidden > 0) {\n return (\n <Box flexDirection=\"column\" marginTop={1}>\n <Text dimColor wrap=\"wrap\">\n {`Nothing is callable here — all ${view.counts.hidden} registered capabilities were hidden by policy. `}\n The surface is empty by decision, not because nothing was annotated.\n </Text>\n {view.explained ? null : (\n <Text dimColor>Re-run with --explain to see which policy hid them.</Text>\n )}\n </Box>\n );\n }\n return (\n <Box flexDirection=\"column\" marginTop={1}>\n <Text dimColor wrap=\"wrap\">\n Nothing is registered for this scenario — the agent has no surface here. That is the\n default: capabilities exist only where they were explicitly annotated.\n </Text>\n {view.explained ? null : (\n <Text dimColor>Re-run with --explain to see whether a policy hid it.</Text>\n )}\n </Box>\n );\n}\n\nconst HEADERS = [\"CAPABILITY\", \"KIND\", \"EFFECT\", \"STATE\", \"FLAGS\"];\n\nfunction cellsFor(row: CapabilityRow): string[] {\n return [\n row.path,\n row.kind,\n row.effect ?? NONE,\n OUTCOME[row.outcome].state,\n row.flags.length > 0 ? row.flags.join(\" · \") : NONE,\n ];\n}\n\nfunction TableRow({\n row,\n cells,\n widths,\n}: {\n row: CapabilityRow;\n cells: string[];\n widths: number[];\n}): ReactElement {\n const outcome = OUTCOME[row.outcome];\n return (\n <Box flexDirection=\"column\">\n <Box>\n <Text bold>{`${pad(cells[0]!, widths[0]!)} `}</Text>\n <Text dimColor>{`${pad(cells[1]!, widths[1]!)} `}</Text>\n <Text>{`${pad(cells[2]!, widths[2]!)} `}</Text>\n <Text color={outcome.color}>{`${pad(cells[3]!, widths[3]!)} `}</Text>\n <Text dimColor>{cells[4]!}</Text>\n </Box>\n {row.reason ? (\n <Box paddingLeft={4}>\n <Text color=\"yellow\" wrap=\"wrap\">{`⤷ ${row.reason}`}</Text>\n </Box>\n ) : null}\n </Box>\n );\n}\n\n/**\n * One capability per line, aligned — the scanning view, and the default. The\n * grouped paragraphs below stay for `--detail`, `--explain` and `--schemas`,\n * whose payloads (policy chains, JSON Schemas) cannot live in a table cell.\n */\nfunction CapabilityTable({ rows }: { rows: CapabilityRow[] }): ReactElement {\n const cells = rows.map(cellsFor);\n const widths = widthsFor(HEADERS, cells);\n return (\n <Box flexDirection=\"column\" marginTop={1}>\n <Box>\n {HEADERS.map((header, column) => (\n <Text key={header} dimColor bold>\n {column === HEADERS.length - 1 ? header : `${pad(header, widths[column]!)} `}\n </Text>\n ))}\n </Box>\n {rows.map((row, index) => (\n <TableRow\n key={`${row.capabilityId}-${index}`}\n row={row}\n cells={cells[index]!}\n widths={widths}\n />\n ))}\n </Box>\n );\n}\n\ntype Block = { key: string; group?: CapabilityGroup; rows?: CapabilityRow[] };\n\n/**\n * One part of a report, drawn.\n *\n * This switch is the only place the terminal UI learns what a report can\n * contain, and it is the same list `renderPartPlain` switches on — so a part\n * that renders here renders there, and neither can grow a shape the other has\n * never heard of.\n */\nexport function Part({\n part,\n labelWidth,\n}: {\n part: ReportPart;\n labelWidth?: number;\n}): ReactElement {\n switch (part.kind) {\n case \"blocks\":\n return <Report blocks={part.blocks} {...(labelWidth ? { labelWidth } : {})} />;\n case \"table\":\n return (\n <Table\n title={part.title}\n {...(part.lead ? { lead: part.lead } : {})}\n headers={part.headers}\n rows={part.rows}\n />\n );\n case \"findings\":\n return <Findings sections={part.sections} />;\n case \"surface\":\n return <Surface view={part.view} {...(part.detail ? { detail: true } : {})} />;\n case \"note\":\n return (\n <Note\n {...(part.title ? { title: part.title } : {})}\n {...(part.muted ? { muted: true } : {})}\n lines={part.lines}\n />\n );\n case \"steps\":\n return <Steps title={part.title} steps={part.steps} />;\n }\n}\n\nexport function Surface({\n view,\n detail,\n}: {\n view: SurfaceView;\n detail?: boolean;\n}): ReactElement {\n const populated = view.groups.filter((group) => group.rows.length > 0);\n const rows = flatRows(view);\n\n // Everything goes through <Static>, header included. Ink paints static output\n // once, permanently, above the live frame — and erases the live frame on\n // unmount. A one-shot render that leaves anything outside <Static> therefore\n // prints it and then wipes it, which is exactly what happened to this header.\n const blocks: Block[] = [\n { key: \"__header\" },\n ...(detail\n ? populated.map((group) => ({ key: group.heading, group }))\n : rows.length > 0\n ? [{ key: \"__table\", rows }]\n : []),\n ];\n\n return (\n <Static items={blocks}>\n {(block) =>\n block.group ? (\n <Group key={block.key} group={block.group} />\n ) : block.rows ? (\n <CapabilityTable key={block.key} rows={block.rows} />\n ) : (\n <Box key={block.key} flexDirection=\"column\">\n <Header view={view} />\n {view.rejections.length > 0 ? <Rejections view={view} /> : null}\n {rows.length === 0 ? <Empty view={view} /> : null}\n </Box>\n )\n }\n </Static>\n );\n}\n\n"],"mappings":";;;;;;;;AACA,SAAS,KAAK,QAAQ,MAAM,gBAAgB;AAC5C,OAAO,aAAa;AAkEhB,SAoVI,UAnVF,KADF;AApDJ,IAAM,UAAU;AAAA,EACd,QAAQ,EAAE,MAAM,UAAK,OAAO,SAAkB,OAAO,WAAW;AAAA,EAChE,SAAS,EAAE,MAAM,UAAK,OAAO,UAAmB,OAAO,WAAW;AAAA,EAClE,MAAM,EAAE,MAAM,UAAK,OAAO,OAAgB,OAAO,SAAS;AAC5D;AAEA,IAAM,eAAe;AAAA,EACnB,MAAM;AAAA,EACN,MAAM;AAAA,EACN,MAAM;AAAA,EACN,OAAO;AACT;AAEA,IAAM,aAAa,EAAE,MAAM,SAAS,MAAM,UAAU,KAAK,MAAM;AAE/D,IAAM,OAAO;AAQb,SAAS,UAAU,SAAmB,MAA4B;AA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ACZ,WAAC,UACA,MAAM,QACJ,oBAAC,SAAsB,OAAO,MAAM,SAAxB,MAAM,GAAyB,IACzC,MAAM,OACR,oBAAC,mBAAgC,MAAM,MAAM,QAAvB,MAAM,GAAuB,IAEnD,qBAAC,OAAoB,eAAc,UACjC;AAAA,wBAAC,UAAO,MAAY;AAAA,IACnB,KAAK,WAAW,SAAS,IAAI,oBAAC,cAAW,MAAY,IAAK;AAAA,IAC1D,KAAK,WAAW,IAAI,oBAAC,SAAM,MAAY,IAAK;AAAA,OAHrC,MAAM,GAIhB,GAGN;AAEJ;","names":["index"]}
|
package/dist/inspect-6OZ6ZBKZ.js
DELETED
|
@@ -1,226 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
coverageReport,
|
|
3
|
-
inventoryReport,
|
|
4
|
-
scenarioReport
|
|
5
|
-
} from "./chunk-JR4GESLI.js";
|
|
6
|
-
import {
|
|
7
|
-
createPresenter,
|
|
8
|
-
joinCoverage,
|
|
9
|
-
mountScenarios,
|
|
10
|
-
readInventory,
|
|
11
|
-
scopeCapabilityIds,
|
|
12
|
-
scopeInventory,
|
|
13
|
-
staticConfigScope
|
|
14
|
-
} from "./chunk-YUT4FVQQ.js";
|
|
15
|
-
import {
|
|
16
|
-
write
|
|
17
|
-
} from "./chunk-G7Z6PP6C.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-LQUL4OIA.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-6OZ6ZBKZ.js.map
|