@agent-surface/cli 0.10.0 → 0.11.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.
Files changed (40) hide show
  1. package/README.md +64 -23
  2. package/dist/bin.js +63 -41
  3. package/dist/bin.js.map +1 -1
  4. package/dist/check-BYQ34OVQ.js +122 -0
  5. package/dist/check-BYQ34OVQ.js.map +1 -0
  6. package/dist/chunk-DYDSJM7R.js +170 -0
  7. package/dist/chunk-DYDSJM7R.js.map +1 -0
  8. package/dist/{chunk-4AEQKM2X.js → chunk-GXXKZTQB.js} +261 -206
  9. package/dist/chunk-GXXKZTQB.js.map +1 -0
  10. package/dist/{chunk-FYEXHWGG.js → chunk-QIVOZAWX.js} +52 -2
  11. package/dist/chunk-QIVOZAWX.js.map +1 -0
  12. package/dist/chunk-RXX63JSL.js +298 -0
  13. package/dist/chunk-RXX63JSL.js.map +1 -0
  14. package/dist/index.d.ts +15 -1
  15. package/dist/init-LYYVXFEQ.js +141 -0
  16. package/dist/init-LYYVXFEQ.js.map +1 -0
  17. package/dist/{ink-HBPOQTRS.js → ink-P23VKP4H.js} +102 -33
  18. package/dist/ink-P23VKP4H.js.map +1 -0
  19. package/dist/inspect-3CBRKTDM.js +108 -0
  20. package/dist/inspect-3CBRKTDM.js.map +1 -0
  21. package/dist/snapshot-DJ22WCT4.js +59 -0
  22. package/dist/snapshot-DJ22WCT4.js.map +1 -0
  23. package/package.json +4 -4
  24. package/dist/capabilities-OLFYMHCL.js +0 -37
  25. package/dist/capabilities-OLFYMHCL.js.map +0 -1
  26. package/dist/check-IN4XKAND.js +0 -84
  27. package/dist/check-IN4XKAND.js.map +0 -1
  28. package/dist/chunk-4AEQKM2X.js.map +0 -1
  29. package/dist/chunk-A27Y7ALQ.js +0 -51
  30. package/dist/chunk-A27Y7ALQ.js.map +0 -1
  31. package/dist/chunk-FYEXHWGG.js.map +0 -1
  32. package/dist/chunk-ODUIFFPM.js +0 -104
  33. package/dist/chunk-ODUIFFPM.js.map +0 -1
  34. package/dist/coverage-HCHLJTDD.js +0 -133
  35. package/dist/coverage-HCHLJTDD.js.map +0 -1
  36. package/dist/ink-HBPOQTRS.js.map +0 -1
  37. package/dist/inspect-NJNB6CAS.js +0 -213
  38. package/dist/inspect-NJNB6CAS.js.map +0 -1
  39. package/dist/snapshot-JQAB73OV.js +0 -38
  40. package/dist/snapshot-JQAB73OV.js.map +0 -1
@@ -0,0 +1,170 @@
1
+ // src/render/model.ts
2
+ function flatRows(view) {
3
+ return view.groups.flatMap((group) => group.rows);
4
+ }
5
+ function pathOf(capabilityId) {
6
+ return capabilityId.replace(/^(view|domain):/, "");
7
+ }
8
+ function leafOf(capabilityId) {
9
+ const withoutPlane = pathOf(capabilityId);
10
+ const dot = withoutPlane.lastIndexOf(".");
11
+ return dot === -1 ? withoutPlane : withoutPlane.slice(dot + 1);
12
+ }
13
+ function actionFlags(action) {
14
+ const flags = [];
15
+ if (action.idempotent) flags.push("idempotent");
16
+ if (action.reversible) flags.push("reversible");
17
+ if (action.confirmation !== "never") flags.push(`confirmation:${action.confirmation}`);
18
+ return flags;
19
+ }
20
+ function procedureFlags(procedure) {
21
+ const flags = [];
22
+ if (procedure.confirmation !== "never") flags.push(`confirmation:${procedure.confirmation}`);
23
+ for (const field of procedure.boundFields) {
24
+ flags.push(`${field.path} bound${field.locked ? "+locked" : ""}`);
25
+ }
26
+ return flags;
27
+ }
28
+ function explanationIndex(explanation) {
29
+ const index = /* @__PURE__ */ new Map();
30
+ for (const capability of explanation.capabilities) {
31
+ index.set(`${capability.capabilityId}\0${capability.registrationId}`, capability);
32
+ }
33
+ return index;
34
+ }
35
+ function buildView(result, options = {}) {
36
+ const { snapshot, explanation } = result;
37
+ const index = explanationIndex(explanation);
38
+ const groups = [];
39
+ const counts = { callable: 0, disabled: 0, hidden: 0 };
40
+ const enrich = (row, capabilityId, registrationId) => {
41
+ const explained = index.get(`${capabilityId}\0${registrationId}`);
42
+ if (options.explain && explained) {
43
+ row.policies = explained.policies;
44
+ row.availability = explained.availability;
45
+ }
46
+ return row;
47
+ };
48
+ for (const component of snapshot.components) {
49
+ const rows = [];
50
+ for (const observation of component.observations) {
51
+ rows.push(
52
+ enrich(
53
+ rowFor(observation, "observation", void 0, [], options, {
54
+ input: void 0,
55
+ output: observation.outputSchema
56
+ }),
57
+ observation.capabilityId,
58
+ component.registrationId
59
+ )
60
+ );
61
+ }
62
+ for (const action of component.actions) {
63
+ rows.push(
64
+ enrich(
65
+ rowFor(action, "action", action.effect, actionFlags(action), options, {
66
+ input: action.inputSchema,
67
+ output: action.outputSchema
68
+ }),
69
+ action.capabilityId,
70
+ component.registrationId
71
+ )
72
+ );
73
+ }
74
+ groups.push({
75
+ heading: component.instanceId === "default" ? component.type : `${component.type}@${component.instanceId}`,
76
+ rows
77
+ });
78
+ }
79
+ if (snapshot.procedures.length > 0) {
80
+ groups.push({
81
+ heading: "authoritative (domain)",
82
+ rows: snapshot.procedures.map(
83
+ (procedure) => enrich(
84
+ {
85
+ capabilityId: procedure.procedureId,
86
+ name: procedure.procedureId.replace(/^domain:/, ""),
87
+ path: pathOf(procedure.procedureId),
88
+ kind: "procedure",
89
+ plane: "domain",
90
+ outcome: procedure.available ? "expose" : "disable",
91
+ description: procedure.description,
92
+ ...procedure.unavailableReason ? { reason: procedure.unavailableReason } : {},
93
+ effect: procedure.effect,
94
+ flags: procedureFlags(procedure),
95
+ tags: [procedure.effect, ...procedureFlags(procedure)],
96
+ ...options.schemas ? { schemas: { input: procedure.inputSchema, output: procedure.outputSchema } } : {}
97
+ },
98
+ procedure.procedureId,
99
+ procedure.registrationId
100
+ )
101
+ )
102
+ });
103
+ }
104
+ const hidden = explanation.capabilities.filter((c) => c.outcome === "hide");
105
+ if (hidden.length > 0) {
106
+ groups.push({
107
+ heading: "hidden by policy (absent from the snapshot)",
108
+ rows: hidden.map((capability) => ({
109
+ capabilityId: capability.capabilityId,
110
+ name: leafOf(capability.capabilityId),
111
+ path: pathOf(capability.capabilityId),
112
+ kind: capability.kind,
113
+ plane: capability.plane,
114
+ outcome: "hide",
115
+ description: capability.description,
116
+ // No reason line, deliberately. The reason a hidden capability carries
117
+ // is its *availability* reason — "The drawer is not open" — and printing
118
+ // that under a row marked `hidden` says the UI declined when authority
119
+ // did. Authority hides, state discloses (D11/D12), and the two must
120
+ // never look alike. Why it was hidden is a policy question, which is
121
+ // what `--explain` answers.
122
+ //
123
+ // A hidden capability has no snapshot entry, so there is no effect to
124
+ // report — the table prints an em dash rather than inventing one. The
125
+ // capability path already carries the component type; only a non-default
126
+ // instance adds anything.
127
+ flags: capability.component.instanceId === "default" ? [] : [`@${capability.component.instanceId}`],
128
+ tags: [`${capability.component.type}@${capability.component.instanceId}`],
129
+ ...options.explain ? { policies: capability.policies, availability: capability.availability } : {}
130
+ }))
131
+ });
132
+ }
133
+ for (const capability of explanation.capabilities) {
134
+ if (capability.outcome === "expose") counts.callable += 1;
135
+ else if (capability.outcome === "disable") counts.disabled += 1;
136
+ else counts.hidden += 1;
137
+ }
138
+ return {
139
+ scenario: result.scenario,
140
+ ...snapshot.route?.path ? { route: snapshot.route.path } : {},
141
+ ...result.scope ? { scope: result.scope } : {},
142
+ groups,
143
+ counts,
144
+ rejections: result.rejections ?? [],
145
+ explained: options.explain === true
146
+ };
147
+ }
148
+ function rowFor(descriptor, kind, effect, flags, options, schemas) {
149
+ return {
150
+ capabilityId: descriptor.capabilityId,
151
+ name: descriptor.name,
152
+ path: pathOf(descriptor.capabilityId),
153
+ kind,
154
+ plane: "view",
155
+ outcome: descriptor.available ? "expose" : "disable",
156
+ description: descriptor.description,
157
+ ...descriptor.unavailableReason ? { reason: descriptor.unavailableReason } : {},
158
+ ...effect ? { effect } : {},
159
+ flags,
160
+ // The grouped detail view prints one combined list, the way it always has.
161
+ tags: effect ? [effect, ...flags] : [kind, ...flags],
162
+ ...options.schemas ? { schemas } : {}
163
+ };
164
+ }
165
+
166
+ export {
167
+ flatRows,
168
+ buildView
169
+ };
170
+ //# sourceMappingURL=chunk-DYDSJM7R.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/render/model.ts"],"sourcesContent":["import type {\n AgentActionDescriptor,\n AgentObservationDescriptor,\n AgentProcedureDescriptor,\n AgentSurfaceSnapshot,\n} from \"@agent-surface/core\";\nimport type { CapabilityExplanation, SurfaceExplanation } from \"@agent-surface/core/explain\";\nimport type { CollectResult, RegistrationRejection } from \"../collect.js\";\n\n/**\n * One view model, two renderers. The Ink UI and the plain-text fallback both\n * consume this, so `--plain` can never drift into showing something different\n * from what a TTY shows.\n */\nexport interface CapabilityRow {\n capabilityId: string;\n /** Leaf name — the group heading already carries the rest of the id. */\n name: string;\n /**\n * The id minus its plane prefix. The table is flat, so its first column has\n * to carry the whole path; the grouped detail view uses `name`.\n */\n path: string;\n kind: \"observation\" | \"action\" | \"procedure\";\n plane: \"view\" | \"domain\";\n outcome: \"expose\" | \"disable\" | \"hide\";\n description: string;\n reason?: string;\n /** The effect, alone, for the table's own column. Observations have none. */\n effect?: string;\n /** What is left of `tags` once the effect has its own column. */\n flags: string[];\n /** Effect and flags together — what the grouped detail view prints. */\n tags: string[];\n policies?: CapabilityExplanation[\"policies\"];\n availability?: CapabilityExplanation[\"availability\"];\n schemas?: { input?: unknown; output?: unknown };\n}\n\nexport interface CapabilityGroup {\n heading: string;\n rows: CapabilityRow[];\n}\n\nexport interface SurfaceView {\n scenario: string;\n route?: string;\n /**\n * The scope the counts below were computed under (`AS-CLI-007`). A scope\n * filters the snapshot *and* the explanation, so without it on screen the\n * header reads as a statement about the whole surface when it is a statement\n * about one prefix of it.\n */\n scope?: string[];\n groups: CapabilityGroup[];\n counts: { callable: number; disabled: number; hidden: number };\n /** Refused during the mount — absent from both projections (`AS-CLI-006`). */\n rejections: RegistrationRejection[];\n explained: boolean;\n}\n\nexport interface ViewOptions {\n explain?: boolean;\n schemas?: boolean;\n}\n\n/**\n * The table is flat — `groups` exist for the grouped detail view, which is what\n * `--detail`, `--explain` and `--schemas` render. Flattening here rather than in\n * each renderer keeps the two views over one order.\n */\nexport function flatRows(view: SurfaceView): CapabilityRow[] {\n return view.groups.flatMap((group) => group.rows);\n}\n\nfunction pathOf(capabilityId: string): string {\n return capabilityId.replace(/^(view|domain):/, \"\");\n}\n\nfunction leafOf(capabilityId: string): string {\n const withoutPlane = pathOf(capabilityId);\n const dot = withoutPlane.lastIndexOf(\".\");\n return dot === -1 ? withoutPlane : withoutPlane.slice(dot + 1);\n}\n\n/**\n * The effect gets its own table column; everything else is a flag. An\n * observation reads state and has no effect at all, which the table shows as\n * an em dash rather than inventing one.\n */\nfunction actionFlags(action: AgentActionDescriptor): string[] {\n const flags: string[] = [];\n if (action.idempotent) flags.push(\"idempotent\");\n if (action.reversible) flags.push(\"reversible\");\n if (action.confirmation !== \"never\") flags.push(`confirmation:${action.confirmation}`);\n return flags;\n}\n\nfunction procedureFlags(procedure: AgentProcedureDescriptor): string[] {\n const flags: string[] = [];\n if (procedure.confirmation !== \"never\") flags.push(`confirmation:${procedure.confirmation}`);\n for (const field of procedure.boundFields) {\n flags.push(`${field.path} bound${field.locked ? \"+locked\" : \"\"}`);\n }\n return flags;\n}\n\nfunction explanationIndex(explanation: SurfaceExplanation): Map<string, CapabilityExplanation> {\n const index = new Map<string, CapabilityExplanation>();\n for (const capability of explanation.capabilities) {\n // Keyed by id + registration so two instances of one component stay apart.\n index.set(`${capability.capabilityId}\\u0000${capability.registrationId}`, capability);\n }\n return index;\n}\n\nexport function buildView(result: CollectResult, options: ViewOptions = {}): SurfaceView {\n const { snapshot, explanation } = result;\n const index = explanationIndex(explanation);\n const groups: CapabilityGroup[] = [];\n const counts = { callable: 0, disabled: 0, hidden: 0 };\n\n const enrich = (\n row: CapabilityRow,\n capabilityId: string,\n registrationId: string,\n ): CapabilityRow => {\n const explained = index.get(`${capabilityId}\\u0000${registrationId}`);\n if (options.explain && explained) {\n row.policies = explained.policies;\n row.availability = explained.availability;\n }\n return row;\n };\n\n for (const component of snapshot.components) {\n const rows: CapabilityRow[] = [];\n\n for (const observation of component.observations) {\n rows.push(\n enrich(\n rowFor(observation, \"observation\", undefined, [], options, {\n input: undefined,\n output: observation.outputSchema,\n }),\n observation.capabilityId,\n component.registrationId,\n ),\n );\n }\n for (const action of component.actions) {\n rows.push(\n enrich(\n rowFor(action, \"action\", action.effect, actionFlags(action), options, {\n input: action.inputSchema,\n output: action.outputSchema,\n }),\n action.capabilityId,\n component.registrationId,\n ),\n );\n }\n\n groups.push({\n heading:\n component.instanceId === \"default\"\n ? component.type\n : `${component.type}@${component.instanceId}`,\n rows,\n });\n }\n\n if (snapshot.procedures.length > 0) {\n groups.push({\n heading: \"authoritative (domain)\",\n rows: snapshot.procedures.map((procedure) =>\n enrich(\n {\n capabilityId: procedure.procedureId,\n name: procedure.procedureId.replace(/^domain:/, \"\"),\n path: pathOf(procedure.procedureId),\n kind: \"procedure\",\n plane: \"domain\",\n outcome: procedure.available ? \"expose\" : \"disable\",\n description: procedure.description,\n ...(procedure.unavailableReason ? { reason: procedure.unavailableReason } : {}),\n effect: procedure.effect,\n flags: procedureFlags(procedure),\n tags: [procedure.effect, ...procedureFlags(procedure)],\n ...(options.schemas\n ? { schemas: { input: procedure.inputSchema, output: procedure.outputSchema } }\n : {}),\n },\n procedure.procedureId,\n procedure.registrationId,\n ),\n ),\n });\n }\n\n // Hidden capabilities exist only in the explanation — that is the whole point\n // of it. They get their own group so nobody mistakes them for callable.\n //\n // Unconditional, not behind `--explain`, for the reason `AS-CLI-007` moved\n // the hidden *count* out from behind it: signed out, the example app rendered\n // `0 callable, 0 visible-disabled` over eleven perfectly good capabilities\n // that authority had hidden, and a reader who did not know to re-run with a\n // flag read that as an app which annotated nothing. The explanation is\n // collected on every run regardless, so this costs nothing. The policy\n // *attribution* still needs `--explain`; only the rows moved.\n const hidden = explanation.capabilities.filter((c) => c.outcome === \"hide\");\n if (hidden.length > 0) {\n groups.push({\n heading: \"hidden by policy (absent from the snapshot)\",\n rows: hidden.map((capability) => ({\n capabilityId: capability.capabilityId,\n name: leafOf(capability.capabilityId),\n path: pathOf(capability.capabilityId),\n kind: capability.kind,\n plane: capability.plane,\n outcome: \"hide\" as const,\n description: capability.description,\n // No reason line, deliberately. The reason a hidden capability carries\n // is its *availability* reason — \"The drawer is not open\" — and printing\n // that under a row marked `hidden` says the UI declined when authority\n // did. Authority hides, state discloses (D11/D12), and the two must\n // never look alike. Why it was hidden is a policy question, which is\n // what `--explain` answers.\n //\n // A hidden capability has no snapshot entry, so there is no effect to\n // report — the table prints an em dash rather than inventing one. The\n // capability path already carries the component type; only a non-default\n // instance adds anything.\n flags:\n capability.component.instanceId === \"default\"\n ? []\n : [`@${capability.component.instanceId}`],\n tags: [`${capability.component.type}@${capability.component.instanceId}`],\n ...(options.explain\n ? { policies: capability.policies, availability: capability.availability }\n : {}),\n })),\n });\n }\n\n for (const capability of explanation.capabilities) {\n if (capability.outcome === \"expose\") counts.callable += 1;\n else if (capability.outcome === \"disable\") counts.disabled += 1;\n else counts.hidden += 1;\n }\n\n return {\n scenario: result.scenario,\n ...(snapshot.route?.path ? { route: snapshot.route.path } : {}),\n ...(result.scope ? { scope: result.scope } : {}),\n groups,\n counts,\n rejections: result.rejections ?? [],\n explained: options.explain === true,\n };\n}\n\nfunction rowFor(\n descriptor: AgentObservationDescriptor | AgentActionDescriptor,\n kind: \"observation\" | \"action\",\n effect: string | undefined,\n flags: string[],\n options: ViewOptions,\n schemas: { input?: unknown; output?: unknown },\n): CapabilityRow {\n return {\n capabilityId: descriptor.capabilityId,\n name: descriptor.name,\n path: pathOf(descriptor.capabilityId),\n kind,\n plane: \"view\",\n outcome: descriptor.available ? \"expose\" : \"disable\",\n description: descriptor.description,\n ...(descriptor.unavailableReason ? { reason: descriptor.unavailableReason } : {}),\n ...(effect ? { effect } : {}),\n flags,\n // The grouped detail view prints one combined list, the way it always has.\n tags: effect ? [effect, ...flags] : [kind, ...flags],\n ...(options.schemas ? { schemas } : {}),\n };\n}\n"],"mappings":";AAuEO,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