opensip-cli 0.1.14 → 0.1.15

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 (103) hide show
  1. package/dist/bootstrap/artifact-retention.d.ts +62 -0
  2. package/dist/bootstrap/artifact-retention.d.ts.map +1 -0
  3. package/dist/bootstrap/artifact-retention.js +117 -0
  4. package/dist/bootstrap/artifact-retention.js.map +1 -0
  5. package/dist/bootstrap/artifact-seams.d.ts +21 -1
  6. package/dist/bootstrap/artifact-seams.d.ts.map +1 -1
  7. package/dist/bootstrap/artifact-seams.js +76 -4
  8. package/dist/bootstrap/artifact-seams.js.map +1 -1
  9. package/dist/bootstrap/atomic-artifact-write.d.ts.map +1 -1
  10. package/dist/bootstrap/atomic-artifact-write.js +7 -2
  11. package/dist/bootstrap/atomic-artifact-write.js.map +1 -1
  12. package/dist/bootstrap/bundled-tools.manifest.json +2 -1
  13. package/dist/bootstrap/dispatch-fork-core.d.ts +15 -2
  14. package/dist/bootstrap/dispatch-fork-core.d.ts.map +1 -1
  15. package/dist/bootstrap/dispatch-fork-core.js +22 -4
  16. package/dist/bootstrap/dispatch-fork-core.js.map +1 -1
  17. package/dist/bootstrap/dispatch-host-rpc-handler.d.ts.map +1 -1
  18. package/dist/bootstrap/dispatch-host-rpc-handler.js +10 -0
  19. package/dist/bootstrap/dispatch-host-rpc-handler.js.map +1 -1
  20. package/dist/bootstrap/run-plane.d.ts +10 -0
  21. package/dist/bootstrap/run-plane.d.ts.map +1 -1
  22. package/dist/bootstrap/run-plane.js +20 -0
  23. package/dist/bootstrap/run-plane.js.map +1 -1
  24. package/dist/bootstrap/tool-command-dispatch-types.d.ts +15 -0
  25. package/dist/bootstrap/tool-command-dispatch-types.d.ts.map +1 -1
  26. package/dist/bootstrap/tool-command-worker-context.d.ts +5 -4
  27. package/dist/bootstrap/tool-command-worker-context.d.ts.map +1 -1
  28. package/dist/bootstrap/tool-command-worker-context.js +6 -4
  29. package/dist/bootstrap/tool-command-worker-context.js.map +1 -1
  30. package/dist/bootstrap/tool-command-worker-entry.d.ts.map +1 -1
  31. package/dist/bootstrap/tool-command-worker-entry.js +30 -5
  32. package/dist/bootstrap/tool-command-worker-entry.js.map +1 -1
  33. package/dist/bootstrap/tool-command-worker-rpc.d.ts.map +1 -1
  34. package/dist/bootstrap/tool-command-worker-rpc.js +23 -1
  35. package/dist/bootstrap/tool-command-worker-rpc.js.map +1 -1
  36. package/dist/cli-context.d.ts.map +1 -1
  37. package/dist/cli-context.js +26 -3
  38. package/dist/cli-context.js.map +1 -1
  39. package/dist/commands/agent-catalog.d.ts +9 -56
  40. package/dist/commands/agent-catalog.d.ts.map +1 -1
  41. package/dist/commands/agent-catalog.js +8 -199
  42. package/dist/commands/agent-catalog.js.map +1 -1
  43. package/dist/commands/assemble-opts.d.ts +13 -0
  44. package/dist/commands/assemble-opts.d.ts.map +1 -0
  45. package/dist/commands/assemble-opts.js +85 -0
  46. package/dist/commands/assemble-opts.js.map +1 -0
  47. package/dist/commands/history.d.ts +7 -11
  48. package/dist/commands/history.d.ts.map +1 -1
  49. package/dist/commands/history.js +7 -39
  50. package/dist/commands/history.js.map +1 -1
  51. package/dist/commands/host-subcommand-groups.d.ts.map +1 -1
  52. package/dist/commands/host-subcommand-groups.js +12 -1
  53. package/dist/commands/host-subcommand-groups.js.map +1 -1
  54. package/dist/commands/mount-command-spec-wiring.d.ts +1 -0
  55. package/dist/commands/mount-command-spec-wiring.d.ts.map +1 -1
  56. package/dist/commands/mount-command-spec-wiring.js +5 -5
  57. package/dist/commands/mount-command-spec-wiring.js.map +1 -1
  58. package/dist/commands/session-show.d.ts.map +1 -1
  59. package/dist/commands/session-show.js +14 -41
  60. package/dist/commands/session-show.js.map +1 -1
  61. package/dist/commands/shared.d.ts +3 -1
  62. package/dist/commands/shared.d.ts.map +1 -1
  63. package/dist/commands/suite/capturing-context.d.ts +19 -0
  64. package/dist/commands/suite/capturing-context.d.ts.map +1 -0
  65. package/dist/commands/suite/capturing-context.js +62 -0
  66. package/dist/commands/suite/capturing-context.js.map +1 -0
  67. package/dist/commands/suite/orchestrator.d.ts +12 -0
  68. package/dist/commands/suite/orchestrator.d.ts.map +1 -0
  69. package/dist/commands/suite/orchestrator.js +216 -0
  70. package/dist/commands/suite/orchestrator.js.map +1 -0
  71. package/dist/commands/suite/suite-add.d.ts +18 -0
  72. package/dist/commands/suite/suite-add.d.ts.map +1 -0
  73. package/dist/commands/suite/suite-add.js +130 -0
  74. package/dist/commands/suite/suite-add.js.map +1 -0
  75. package/dist/commands/suite/suite-command-specs.d.ts +4 -0
  76. package/dist/commands/suite/suite-command-specs.d.ts.map +1 -0
  77. package/dist/commands/suite/suite-command-specs.js +150 -0
  78. package/dist/commands/suite/suite-command-specs.js.map +1 -0
  79. package/dist/commands/suite/validate-suite.d.ts +21 -0
  80. package/dist/commands/suite/validate-suite.d.ts.map +1 -0
  81. package/dist/commands/suite/validate-suite.js +89 -0
  82. package/dist/commands/suite/validate-suite.js.map +1 -0
  83. package/dist/commands/tools/list.d.ts.map +1 -1
  84. package/dist/commands/tools/list.js +54 -31
  85. package/dist/commands/tools/list.js.map +1 -1
  86. package/dist/index.js +1 -0
  87. package/dist/index.js.map +1 -1
  88. package/dist/report-compose.js +2 -2
  89. package/dist/report-compose.js.map +1 -1
  90. package/dist/ui/result-to-view.d.ts.map +1 -1
  91. package/dist/ui/result-to-view.js +22 -0
  92. package/dist/ui/result-to-view.js.map +1 -1
  93. package/dist/ui/views/misc-views.d.ts.map +1 -1
  94. package/dist/ui/views/misc-views.js +30 -7
  95. package/dist/ui/views/misc-views.js.map +1 -1
  96. package/dist/ui/views/suite-views.d.ts +6 -0
  97. package/dist/ui/views/suite-views.d.ts.map +1 -0
  98. package/dist/ui/views/suite-views.js +70 -0
  99. package/dist/ui/views/suite-views.js.map +1 -0
  100. package/dist/ui/views/tools-views.d.ts.map +1 -1
  101. package/dist/ui/views/tools-views.js +2 -0
  102. package/dist/ui/views/tools-views.js.map +1 -1
  103. package/package.json +34 -33
@@ -1,205 +1,14 @@
1
1
  /**
2
- * Structured catalog for AI agents.
3
- * Provides stable entry points, recommended patterns (including the new
4
- * agent ergonomics like --filter, --raw, --summary-only), and example shapes.
5
- * This is intentionally a small, self-contained surface so agents can
6
- * bootstrap their usage without parsing --help text or source.
2
+ * `agent-catalog` command adapter.
7
3
  *
8
- * Command taxonomy (tool-command-surface-taxonomy):
9
- * - Entry points are keyed by the PUBLIC command path. A `parent`-nested tool
10
- * verb (the `<tool> <verb>` grammar enabled by `CommandSpec.parent` e.g.
11
- * `graph export`, `fit list`) is catalogued UNDER its tool's entry point
12
- * (the `<tool> <verb>` form), NOT as a separate root entry point.
13
- * - Tier-3 `visibility: 'internal'` commands (`*-run-worker`, `*-shard-worker`,
14
- * `*-equivalence-check`) are NEVER catalogued here — the agent-catalog
15
- * primary surface excludes internal workers (the host-owned tiering pass
16
- * formalized in Phase 1 filters them when this surface becomes spec-derived).
4
+ * The catalog projection (`buildAgentCatalog` + its `AgentCatalog` / `CommandTier`
5
+ * types) was re-homed into `@opensip-cli/contracts` (ADR-0084) so
6
+ * `@opensip-cli/mcp` can serve the same surface without importing the
7
+ * composition root. This module re-exports it for existing call sites/tests and
8
+ * keeps the host rendering wrapper (`executeAgentCatalog`).
17
9
  */
18
- /**
19
- * Internal (Tier-3) command-name shapes the agent-catalog must NEVER surface:
20
- * the IPC/CI workers and the equivalence gate. The guard checks both the name
21
- * shape AND an explicit `tier: 'internal'` so a future edit can't slip one in by
22
- * either route. This is the by-construction complement to the Phase 4 test.
23
- */
24
- const INTERNAL_COMMAND_NAME_RE = /(?:-run-worker|-shard-worker|-equivalence-check)\b/;
25
- function compareCodePoint(left, right) {
26
- if (left < right)
27
- return -1;
28
- if (left > right)
29
- return 1;
30
- return 0;
31
- }
32
- /**
33
- * Throw if any entry point is a Tier-3 internal command (by name shape or by an
34
- * explicit `tier: 'internal'`). Called at catalog-build time so a regression that
35
- * pastes an internal command into `entryPoints` fails loudly the first time the
36
- * catalog is built, not silently at the agent boundary.
37
- *
38
- * @throws {Error} When an entry point is a Tier-3 internal command — by an
39
- * explicit `tier: 'internal'` or by an internal command-name shape
40
- * (`*-run-worker` / `*-shard-worker` / `*-equivalence-check`).
41
- */
42
- function assertNoInternalEntryPoints(entryPoints) {
43
- const leaked = entryPoints.find((e) => e.tier === 'internal' || INTERNAL_COMMAND_NAME_RE.test(e.command));
44
- if (leaked !== undefined) {
45
- throw new Error(`agent-catalog: Tier-3 internal command '${leaked.command}' must not appear in the ` +
46
- 'agent-catalog primary surface (tool-command-surface-taxonomy). Remove it from entryPoints.');
47
- }
48
- }
49
- const TOOL_ENTRY_OVERLAYS = {
50
- fitness: {
51
- description: 'Run fitness checks. Use --json for machine output (SignalEnvelope). Agent recipes: agent-fast, agent-risk, agent-final.',
52
- examples: [
53
- 'opensip fit --recipe agent-fast --json --filter errors-only',
54
- 'opensip fit --changed --include-impacted --json',
55
- 'opensip fit --recipe agent-final --gate-compare',
56
- ],
57
- },
58
- graph: {
59
- description: 'Build static call graph + rules. --json yields SignalEnvelope. Use graph impact for change-aware blast radius.',
60
- examples: [
61
- 'opensip graph --json',
62
- 'opensip graph impact --changed --json --top 20',
63
- 'opensip graph --recipe agent-risk --json --filter high-impact',
64
- ],
65
- },
66
- sim: {
67
- description: 'Run simulation scenarios. Use --json for machine output (SignalEnvelope).',
68
- examples: ['opensip sim --json', 'opensip sim --scenario default --json'],
69
- },
70
- yagni: {
71
- description: 'Run YAGNI reduction audit detectors. Advisory findings; --json yields SignalEnvelope.',
72
- examples: ['opensip yagni --json', 'opensip yagni --json packages/yagni/engine'],
73
- },
74
- };
75
- const PLATFORM_ENTRY_POINTS = [
76
- {
77
- command: 'sessions list',
78
- description: 'List stored sessions. --summary-only is agent-friendly (omits heavy payloads).',
79
- examples: [
80
- 'opensip sessions list --json --summary-only',
81
- 'opensip sessions list --json --tool fitness --limit 5',
82
- ],
83
- tier: 'platform',
84
- },
85
- {
86
- command: 'sessions show',
87
- description: 'Retrieve a prior run as SessionReplayResult (includes projected SignalEnvelope). ' +
88
- 'Supports latest + --tool and rich filtering.',
89
- examples: [
90
- 'opensip sessions show latest --tool fitness --json',
91
- 'opensip sessions show latest --tool fit --json --filter errors-only --filter top:20',
92
- 'opensip sessions show GRAPH_01... --json --raw',
93
- 'opensip sessions show previous --tool graph --json',
94
- ],
95
- tier: 'platform',
96
- },
97
- {
98
- command: 'agent-catalog',
99
- description: 'This command. Self-describing catalog for agents (JSON preferred).',
100
- examples: ['opensip agent-catalog --json'],
101
- tier: 'platform',
102
- },
103
- ];
104
- function publicPrimaryCommand(tool, internalCommands) {
105
- return (tool.commandSpecs ?? []).find((spec) => spec.parent === undefined &&
106
- spec.visibility !== 'internal' &&
107
- !internalCommands.has(spec.name) &&
108
- !INTERNAL_COMMAND_NAME_RE.test(spec.name));
109
- }
110
- function entryPointForTool(tool, internalCommands) {
111
- const primary = publicPrimaryCommand(tool, internalCommands);
112
- if (primary === undefined)
113
- return undefined;
114
- const overlay = TOOL_ENTRY_OVERLAYS[primary.name] ?? TOOL_ENTRY_OVERLAYS[tool.metadata.name];
115
- return {
116
- command: primary.name,
117
- description: overlay?.description ??
118
- `${primary.description} Use --json when available for machine output.`,
119
- examples: overlay?.examples ?? [`opensip ${primary.name} --json`],
120
- tier: 'tool',
121
- };
122
- }
123
- function deriveToolEntryPoints(tools, internalCommands) {
124
- return (tools?.list() ?? [])
125
- .map((tool) => entryPointForTool(tool, internalCommands))
126
- .filter((entry) => entry !== undefined)
127
- .sort((a, b) => compareCodePoint(a.command, b.command));
128
- }
129
- export function buildAgentCatalog(input = {}) {
130
- const entryPoints = [
131
- ...deriveToolEntryPoints(input.tools, input.internalCommands ?? new Set()),
132
- ...PLATFORM_ENTRY_POINTS,
133
- ];
134
- assertNoInternalEntryPoints(entryPoints);
135
- return {
136
- version: '1.0.0',
137
- description: 'Stable, machine-oriented surface for AI agents using OpenSIP CLI. ' +
138
- 'Focus on --json paths, sessions for historical results, and composable filters. ' +
139
- 'Human UX (tables, banners) is preserved unchanged.',
140
- entryPoints,
141
- commonPatterns: [
142
- {
143
- name: 'Read latest result first (read-latest-result)',
144
- description: 'When the user says a tool already reported findings, inspect the latest stored result before re-running.',
145
- example: 'opensip sessions show latest --tool fit --json --filter errors-only --filter top:20',
146
- },
147
- {
148
- name: 'Agent edit loop',
149
- description: 'Fast check → impact analysis → changed-only fit → final gate.',
150
- example: 'opensip fit --recipe agent-fast --json && opensip graph impact --changed --json && opensip fit --changed --include-impacted --json',
151
- },
152
- {
153
- name: 'Inspect latest fit with focus on errors',
154
- description: 'After a fit run, pull only actionable errors (high severity) and limit count.',
155
- example: 'opensip sessions show latest --tool fit --json --filter errors-only --filter top:10',
156
- },
157
- {
158
- name: 'Lean session menu for agents',
159
- description: 'Get pointers to interesting sessions without downloading full historical payloads.',
160
- example: 'opensip sessions list --json --summary-only --tool fit',
161
- },
162
- {
163
- name: 'Minimal raw envelope for token-sensitive agents',
164
- description: 'Bypass the standard CommandResult wrapper when you only need the core data.',
165
- example: 'opensip sessions show latest --tool graph --json --raw',
166
- },
167
- {
168
- name: 'Relative navigation',
169
- description: 'Walk backwards through recent runs of a specific tool without tracking IDs.',
170
- example: 'opensip sessions show previous --tool fit --json --filter warnings-only',
171
- },
172
- ],
173
- outputShapes: {
174
- signalEnvelope: 'The canonical cross-tool currency (schemaVersion, tool, runId, verdict, units, signals). ' +
175
- 'Every fit/graph/sim result (live or replayed) carries one. See contracts for full type.',
176
- sessionReplay: 'For sessions show: { session: {id,tool,startedAt,completedAt,score,passed,...}, fidelity: "projection", envelope: SignalEnvelope, filtersApplied?, ...counts }',
177
- history: 'For sessions list: { type: "history", sessions: HistorySession[] } where each has showCommand + optional summary.',
178
- },
179
- notes: [
180
- 'Agent recipes (when present): fit agent-fast / agent-risk / agent-final; graph agent-risk / agent-final.',
181
- 'Live runs support --filter/--top/--raw on fit/graph/sim --json (same engine as sessions show).',
182
- 'graph impact answers changed→impacted without a separate git diff dance.',
183
- 'All machine output is under --json. Use --raw on show for the smallest possible payload.',
184
- 'filtersApplied, originalSignalCount, returnedSignalCount appear when --filter is used.',
185
- 'The fidelity field on replays is always "projection" (rebuilt from persisted data).',
186
- 'Human-readable output (no --json) uses the same tables/banners as before — unchanged.',
187
- // Uniform tool-primary surface (host-guaranteed; decorateToolPrimary).
188
- 'Every tool primary (fit/graph/sim/yagni and any third-party tool) accepts `<tool> --version` ' +
189
- '(prints the TOOL version, e.g. `fit 0.1.6`; distinct from `opensip --version`, the CLI), ' +
190
- 'plus the guaranteed baseline flags --cwd, --json, --config, --quiet, --verbose.',
191
- 'Dogfood gate requires 0 errors + 0 warnings on fit:ci and graph:ci after any change.',
192
- // Hygiene invariant (host-planes-scope-seams-hygiene Phases 2-4): everything runs inside an
193
- // entered RunScope; the only sanctioned seams for output, delivery, baselines, toolState,
194
- // and hostPlanes (governance/audit/entitlements) are the documented methods on ToolCliContext
195
- // (render, emitJson, emitEnvelope, deliverSignals, writeArtifact, writeSarif, + the
196
- // baseline/toolState/hostPlanes accessors). Direct stdout, the old pre-scope holder, or
197
- // raw datastore from handlers is forbidden and caught by ESLint + fitness check + runtime
198
- // guards. Bootstrap root is exempted.
199
- 'Only the methods on the ToolCliContext you receive are allowed for emission/state/planes.',
200
- ],
201
- };
202
- }
10
+ import { buildAgentCatalog } from '@opensip-cli/contracts';
11
+ export { buildAgentCatalog } from '@opensip-cli/contracts';
203
12
  export function executeAgentCatalog(opts = {}) {
204
13
  const catalog = buildAgentCatalog({
205
14
  tools: opts.tools,
@@ -1 +1 @@
1
- {"version":3,"file":"agent-catalog.js","sourceRoot":"","sources":["../../src/commands/agent-catalog.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AA4CH;;;;;GAKG;AACH,MAAM,wBAAwB,GAAG,oDAAoD,CAAC;AAEtF,SAAS,gBAAgB,CAAC,IAAY,EAAE,KAAa;IACnD,IAAI,IAAI,GAAG,KAAK;QAAE,OAAO,CAAC,CAAC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I,EAAE,YAAY;QAClB,KAAK,EAAE,eAAe;QACtB,KAAK;KACN,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"agent-catalog.js","sourceRoot":"","sources":["../../src/commands/agent-catalog.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAI3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAG3D,MAAM,UAAU,mBAAmB,CACjC,OAII,EAAE;IAEN,MAAM,OAAO,GAAG,iBAAiB,CAAC;QAChC,KAAK,EAAE,IAAI,CAAC,KAAK;QACjB,gBAAgB,EAAE,IAAI,CAAC,gBAAgB;KACxC,CAAC,CAAC;IAEH,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC;QACd,wDAAwD;QACxD,sEAAsE;QACtE,gEAAgE;QAChE,OAAO;YACL,IAAI,EAAE,eAAe;YACrB,OAAO;SACR,CAAC;IACJ,CAAC;IAED,qDAAqD;IACrD,MAAM,KAAK,GAAa;QACtB,kEAAkE;QAClE,EAAE;QACF,8BAA8B;QAC9B,GAAG,OAAO,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,OAAO,EAAE,CAAC;QACnE,EAAE;QACF,oBAAoB,GAAG,OAAO,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;QAC3E,EAAE;QACF,sEAAsE;KACvE,CAAC;IAEF,OAAO;QACL,IAAI,EAAE,YAAY;QAClB,KAAK,EAAE,eAAe;QACtB,KAAK;KACN,CAAC;AACJ,CAAC"}
@@ -0,0 +1,13 @@
1
+ import { type OptionSpec } from '@opensip-cli/core';
2
+ export interface AssembleOptsInput {
3
+ readonly options: readonly OptionSpec[] | undefined;
4
+ readonly suppliedValues?: Readonly<Record<string, unknown>>;
5
+ }
6
+ export interface AssembledOpts {
7
+ readonly opts: Record<string, unknown>;
8
+ readonly knownKeys: ReadonlySet<string>;
9
+ }
10
+ export declare function optionKey(spec: OptionSpec): string;
11
+ export declare function assembleOptsFromSpec(input: AssembleOptsInput): AssembledOpts;
12
+ export declare function optionDefaultValue(spec: OptionSpec): unknown;
13
+ //# sourceMappingURL=assemble-opts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assemble-opts.d.ts","sourceRoot":"","sources":["../../src/commands/assemble-opts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,KAAK,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAIxE,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,OAAO,EAAE,SAAS,UAAU,EAAE,GAAG,SAAS,CAAC;IACpD,QAAQ,CAAC,cAAc,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;CAC7D;AAED,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACvC,QAAQ,CAAC,SAAS,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;CACzC;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,UAAU,GAAG,MAAM,CAQlD;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,iBAAiB,GAAG,aAAa,CAe5E;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAK5D"}
@@ -0,0 +1,85 @@
1
+ import { ConfigurationError } from '@opensip-cli/core';
2
+ const NO_PREVIOUS_VALUE = undefined;
3
+ export function optionKey(spec) {
4
+ const long = spec.flag
5
+ .split(',')
6
+ .map((part) => part.trim())
7
+ .find((part) => part.startsWith('--'));
8
+ const token = long ?? spec.flag.trim().split(/\s+/)[0] ?? '';
9
+ const withoutPrefix = token.replace(/^--no-/, '').replace(/^--/, '');
10
+ return withoutPrefix.replace(/-([a-z0-9])/g, (_, c) => c.toUpperCase());
11
+ }
12
+ export function assembleOptsFromSpec(input) {
13
+ const supplied = input.suppliedValues ?? {};
14
+ const opts = {};
15
+ const knownKeys = new Set();
16
+ for (const spec of input.options ?? []) {
17
+ const key = optionKey(spec);
18
+ knownKeys.add(key);
19
+ const value = parseOptionValue(spec, initialOptionValue(spec, supplied, key));
20
+ validateChoices(key, spec, value);
21
+ validateRequired(key, spec, value);
22
+ assignIfPresent(opts, key, value);
23
+ }
24
+ return { opts, knownKeys };
25
+ }
26
+ export function optionDefaultValue(spec) {
27
+ if (spec.arrayDefault !== undefined)
28
+ return [...spec.arrayDefault];
29
+ if (spec.default !== undefined)
30
+ return spec.default;
31
+ if (spec.negatable === true)
32
+ return true;
33
+ return undefined;
34
+ }
35
+ function initialOptionValue(spec, supplied, key) {
36
+ return Object.prototype.hasOwnProperty.call(supplied, key)
37
+ ? supplied[key]
38
+ : optionDefaultValue(spec);
39
+ }
40
+ function parseOptionValue(spec, value) {
41
+ if (value === undefined || spec.parse === undefined)
42
+ return value;
43
+ if (!Array.isArray(value))
44
+ return spec.parse(stringifyOptionValue(value), NO_PREVIOUS_VALUE);
45
+ let previous = spec.arrayDefault === undefined ? undefined : [...spec.arrayDefault];
46
+ for (const item of value) {
47
+ previous = spec.parse(stringifyOptionValue(item), previous);
48
+ }
49
+ return previous;
50
+ }
51
+ function validateChoices(key, spec, value) {
52
+ if (value === undefined || spec.choices === undefined || spec.choices.length === 0)
53
+ return;
54
+ const values = Array.isArray(value) ? value : [value];
55
+ for (const candidate of values) {
56
+ const text = stringifyOptionValue(candidate);
57
+ if (!spec.choices.includes(text)) {
58
+ throw new ConfigurationError(`Invalid value for option '${key}': ${text}. Expected one of: ${spec.choices.join(', ')}`, { code: 'CONFIG.SUITE.OPTION_CHOICE' });
59
+ }
60
+ }
61
+ }
62
+ function validateRequired(key, spec, value) {
63
+ if (spec.required !== true || (value !== undefined && value !== ''))
64
+ return;
65
+ throw new ConfigurationError(`Missing required option '${key}'.`, {
66
+ code: 'CONFIG.SUITE.OPTION_REQUIRED',
67
+ });
68
+ }
69
+ function assignIfPresent(opts, key, value) {
70
+ if (value !== undefined)
71
+ opts[key] = value;
72
+ }
73
+ function stringifyOptionValue(value) {
74
+ if (typeof value === 'string')
75
+ return value;
76
+ if (typeof value === 'number' || typeof value === 'boolean' || typeof value === 'bigint') {
77
+ return String(value);
78
+ }
79
+ if (value === null)
80
+ return 'null';
81
+ throw new ConfigurationError(`Invalid non-scalar value for option parsing.`, {
82
+ code: 'CONFIG.SUITE.OPTION_VALUE_TYPE',
83
+ });
84
+ }
85
+ //# sourceMappingURL=assemble-opts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assemble-opts.js","sourceRoot":"","sources":["../../src/commands/assemble-opts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAmB,MAAM,mBAAmB,CAAC;AAExE,MAAM,iBAAiB,GAAY,SAAS,CAAC;AAY7C,MAAM,UAAU,SAAS,CAAC,IAAgB;IACxC,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI;SACnB,KAAK,CAAC,GAAG,CAAC;SACV,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;SAC1B,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC;IACzC,MAAM,KAAK,GAAG,IAAI,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;IAC7D,MAAM,aAAa,GAAG,KAAK,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IACrE,OAAO,aAAa,CAAC,OAAO,CAAC,cAAc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AC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;YACjC,MAAM,IAAI,kBAAkB,CAC1B,6BAA6B,GAAG,MAAM,IAAI,sBAAsB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,EACzF,EAAE,IAAI,EAAE,4BAA4B,EAAE,CACvC,CAAC;QACJ,CAAC;IACH,CAAC;AACH,CAAC;AAED,SAAS,gBAAgB,CAAC,GAAW,EAAE,IAAgB,EAAE,KAAc;IACrE,IAAI,IAAI,CAAC,QAAQ,KAAK,IAAI,IAAI,CAAC,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,EAAE,CAAC;QAAE,OAAO;IAC5E,MAAM,IAAI,kBAAkB,CAAC,4BAA4B,GAAG,IAAI,EAAE;QAChE,IAAI,EAAE,8BAA8B;KACrC,CAAC,CAAC;AACL,CAAC;AAED,SAAS,eAAe,CAAC,IAA6B,EAAE,GAAW,EAAE,KAAc;IACjF,IAAI,KAAK,KAAK,SAAS;QAAE,IAAI,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;AAC7C,CAAC;AAED,SAAS,oBAAoB,CAAC,KAAc;IAC1C,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IAC5C,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,OAAO,KAAK,KAAK,SAAS,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QACzF,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC;IACvB,CAAC;IACD,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,MAAM,CAAC;IAClC,MAAM,IAAI,kBAAkB,CAAC,8CAA8C,EAAE;QAC3E,IAAI,EAAE,gCAAgC;KACvC,CAAC,CAAC;AACL,CAAC"}
@@ -1,15 +1,11 @@
1
1
  /**
2
2
  * history command — show run history.
3
+ *
4
+ * The read-only list projection was re-homed into `@opensip-cli/session-store`
5
+ * (ADR-0084) so `@opensip-cli/mcp` can list runs without importing the
6
+ * composition root. This module is now a thin adapter: it re-exports the
7
+ * extracted function under the historical `showHistory` name so the command
8
+ * registration + tests are unchanged.
3
9
  */
4
- import type { HistoryResult } from '@opensip-cli/contracts';
5
- import type { ToolRegistry, ToolShortId } from '@opensip-cli/core';
6
- import type { DataStore } from '@opensip-cli/datastore';
7
- export interface ShowHistoryOptions {
8
- readonly tool?: ToolShortId;
9
- readonly limit?: number;
10
- readonly summaryOnly?: boolean;
11
- /** When set, session list displays canonical tool names. */
12
- readonly registry?: ToolRegistry;
13
- }
14
- export declare function showHistory(datastore: DataStore, opts?: ShowHistoryOptions): HistoryResult;
10
+ export { listSessionSummaries as showHistory, type ListSessionSummariesOptions as ShowHistoryOptions, } from '@opensip-cli/session-store';
15
11
  //# sourceMappingURL=history.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"history.d.ts","sourceRoot":"","sources":["../../src/commands/history.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH,OAAO,KAAK,EAAE,aAAa,EAAiC,MAAM,wBAAwB,CAAC;AAC3F,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAExD,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,IAAI,CAAC,EAAE,WAAW,CAAC;IAC5B,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC;IAC/B,4DAA4D;IAC5D,QAAQ,CAAC,QAAQ,CAAC,EAAE,YAAY,CAAC;CAClC;AAED,wBAAgB,WAAW,CAAC,SAAS,EAAE,SAAS,EAAE,IAAI,GAAE,kBAAuB,GAAG,aAAa,CAS9F"}
1
+ {"version":3,"file":"history.d.ts","sourceRoot":"","sources":["../../src/commands/history.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EACL,oBAAoB,IAAI,WAAW,EACnC,KAAK,2BAA2B,IAAI,kBAAkB,GACvD,MAAM,4BAA4B,CAAC"}
@@ -1,43 +1,11 @@
1
1
  /**
2
2
  * history command — show run history.
3
+ *
4
+ * The read-only list projection was re-homed into `@opensip-cli/session-store`
5
+ * (ADR-0084) so `@opensip-cli/mcp` can list runs without importing the
6
+ * composition root. This module is now a thin adapter: it re-exports the
7
+ * extracted function under the historical `showHistory` name so the command
8
+ * registration + tests are unchanged.
3
9
  */
4
- import { buildToolIdentityIndex } from '@opensip-cli/core';
5
- import { SessionRepo } from '@opensip-cli/session-store';
6
- export function showHistory(datastore, opts = {}) {
7
- const repo = new SessionRepo(datastore);
8
- const identityIndex = opts.registry === undefined ? undefined : buildToolIdentityIndex(opts.registry);
9
- const sessions = repo.list(opts).map((s) => toHistorySession(s, opts.summaryOnly, identityIndex));
10
- return {
11
- type: 'history',
12
- sessions,
13
- };
14
- }
15
- function toHistorySession(session, summaryOnly = false, identityIndex) {
16
- const summary = sessionSummary(session.payload);
17
- const { payload, tool, ...rest } = session;
18
- const displayTool = identityIndex === undefined ? tool : identityIndex.canonicalForStoredTool(tool);
19
- return {
20
- ...rest,
21
- tool: displayTool,
22
- ...(summaryOnly ? {} : { payload }),
23
- ...(summary === undefined ? {} : { summary }),
24
- showCommand: `opensip sessions show ${session.id} --json`,
25
- };
26
- }
27
- function sessionSummary(payload) {
28
- if (payload === null || typeof payload !== 'object')
29
- return undefined;
30
- const summary = payload.summary;
31
- if (summary === null || typeof summary !== 'object')
32
- return undefined;
33
- const { total, passed, failed, errors, warnings } = summary;
34
- if (typeof total !== 'number' ||
35
- typeof passed !== 'number' ||
36
- typeof failed !== 'number' ||
37
- typeof errors !== 'number' ||
38
- typeof warnings !== 'number') {
39
- return undefined;
40
- }
41
- return { total, passed, failed, errors, warnings };
42
- }
10
+ export { listSessionSummaries as showHistory, } from '@opensip-cli/session-store';
43
11
  //# sourceMappingURL=history.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"history.js","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AC,CAAC,EAAE,OAAO,EAAE,CAAC;QAC7C,WAAW,EAAE,yBAAyB,OAAO,CAAC,EAAE,SAAS;KAC1D,CAAC;AACJ,CAAC;AAED,SAAS,cAAc,CAAC,OAAgB;IACtC,IAAI,OAAO,KAAK,IAAI,IAAI,OAAO,OAAO,KAAK,QAAQ;QAAE,OAAO,SAAS,CAAC;IACtE,MAAM,OAAO,GAAI,OAAiC,CAAC,OAAO,CAAC;IAC3D,IAAI,OAAO,KAAK,IAAI,IAAI,OAAO,OAAO,KAAK,QAAQ;QAAE,OAAO,SAAS,CAAC;IACtE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,OAAkC,CAAC;IACvF,IACE,OAAO,KAAK,KAAK,QAAQ;QACzB,OAAO,MAAM,KAAK,QAAQ;QAC1B,OAAO,MAAM,KAAK,QAAQ;QAC1B,OAAO,MAAM,KAAK,QAAQ;QAC1B,OAAO,QAAQ,KAAK,QAAQ,EAC5B,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC;AACrD,CAAC"}
1
+ {"version":3,"file":"history.js","sourceRoot":"","sources":["../../src/commands/history.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EACL,oBAAoB,IAAI,WAAW,GAEpC,MAAM,4BAA4B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"host-subcommand-groups.d.ts","sourceRoot":"","sources":["../../src/commands/host-subcommand-groups.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAIH,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAG5D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEtD,YAAY,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;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AM,CAAC;IACtB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,MAAM,EAAE,SAAS,QAAQ,EAAE,CAAC;CACtC;AAED;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,EAAE,SAAS,MAAM,EAK1C,CAAC;AAEX,gEAAgE;AAChE,wBAAgB,yBAAyB,CAAC,GAAG,EAAE,kBAAkB,GAAG,SAAS,mBAAmB,EAAE,CAuBjG;AAsBD,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,gBAAgB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC,CAAC,CAAC;CACxE;AAED,qFAAqF;AACrF,wBAAgB,yBAAyB,IAAI,oBAAoB,CAMhE"}
@@ -19,6 +19,7 @@
19
19
  */
20
20
  import { buildConfigGroupLeaves } from './host-subcommand-config.js';
21
21
  import { buildSessionsGroupLeaves } from './host-subcommand-sessions.js';
22
+ import { buildSuiteGroupLeaves } from './suite/suite-command-specs.js';
22
23
  import { buildToolsGroupLeaves } from './tools/index.js';
23
24
  export { effectiveCwd } from './host-subcommand-shared.js';
24
25
  export { buildToolPluginLeaves, buildToolPluginGroups, mountToolPluginGroups, } from './host-subcommand-plugins.js';
@@ -28,7 +29,12 @@ export { buildToolPluginLeaves, buildToolPluginGroups, mountToolPluginGroups, }
28
29
  * This is the FINITE, NAMED set the Phase 7 `command-surface-parity` guardrail
29
30
  * allow-lists as documented host exceptions. Every other host command IS a spec.
30
31
  */
31
- export const HOST_SUBCOMMAND_GROUPS = ['config', 'sessions', 'tools'];
32
+ export const HOST_SUBCOMMAND_GROUPS = [
33
+ 'config',
34
+ 'sessions',
35
+ 'suite',
36
+ 'tools',
37
+ ];
32
38
  /** Build the subcommand-group parents with their leaf specs. */
33
39
  export function buildHostSubcommandGroups(ctx) {
34
40
  return [
@@ -42,6 +48,11 @@ export function buildHostSubcommandGroups(ctx) {
42
48
  description: 'Manage session data',
43
49
  leaves: buildSessionsGroupLeaves(ctx),
44
50
  },
51
+ {
52
+ name: 'suite',
53
+ description: 'Run configured tool suites',
54
+ leaves: buildSuiteGroupLeaves(ctx),
55
+ },
45
56
  {
46
57
  name: 'tools',
47
58
  description: 'Manage whole Tool plugins (list, validate, install, uninstall)',
@@ -1 +1 @@
1
- {"version":3,"file":"host-subcommand-groups.js","sourceRoot":"","sources":["../../src/commands/host-subcommand-groups.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAEzE,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAKzD,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EACL,qBAAqB,EACrB,qBAAqB,EACrB,qBAAqB,GAEtB,MAAM,8BAA8B,CAAC;AAUtC;;;;;GAKG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAsB,CAAC,QAAQ,EAAE,UAAU,EAAE,OAAO,CAAU,CAAC;AAElG,gEAAgE;AAChE,MAAM,UAAU,yBAAyB,CAAC,GAAuB;IAC/D,OAAO;QACL;YACE,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,6CAA6C;YAC1D,MAAM,EAAE,sBAAsB,CAAC,GAAG,CAAC;SACpC;QACD;YACE,IAAI,EAAE,UAAU;YAChB,WAAW,EAAE,qBAAqB;YAClC,MAAM,EAAE,wBAAwB,CAAC,GAAG,CAAC;SACtC;QACD;YACE,IAAI,EAAE,OAAO;YACb,WAAW,EAAE,gEAAgE;YAC7E,MAAM,EAAE,qBAAqB,CAAC,GAAG,CAAC;SACnC;KACF,CAAC;AACJ,CAAC;AAED,MAAM,aAAa,GAAuB;IACxC,WAAW,EAAE,GAAG,EAAE;QAChB,uDAAuD;IACzD,CAAC;IACD,MAAM,EAAE,GAAG,EAAE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AC,CAAC,IAAI,CAAC,CAAC;IACjE,CAAC;IACD,OAAO,EAAE,gBAAgB,EAAE,CAAC;AAC9B,CAAC"}
@@ -6,6 +6,7 @@
6
6
  */
7
7
  import { Option } from 'commander';
8
8
  import type { ArgSpec, OptionSpec } from '@opensip-cli/core';
9
+ export { optionKey } from './assemble-opts.js';
9
10
  /**
10
11
  * Build a Commander {@link Option} from an {@link OptionSpec}, covering every
11
12
  * shape in the first-party flag corpus: boolean / value, negatable `--no-`,
@@ -1 +1 @@
1
- {"version":3,"file":"mount-command-spec-wiring.d.ts","sourceRoot":"","sources":["../../src/commands/mount-command-spec-wiring.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAEnC,OAAO,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE7D;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,CA+BzE;AAiBD;;;GAGG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,CAGpD"}
1
+ {"version":3,"file":"mount-command-spec-wiring.d.ts","sourceRoot":"","sources":["../../src/commands/mount-command-spec-wiring.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAInC,OAAO,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE7D,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE/C;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,CA8BzE;AAiBD;;;GAGG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,CAGpD"}
@@ -5,6 +5,8 @@
5
5
  * independently from the host-owned command lifecycle.
6
6
  */
7
7
  import { Option } from 'commander';
8
+ import { optionDefaultValue } from './assemble-opts.js';
9
+ export { optionKey } from './assemble-opts.js';
8
10
  /**
9
11
  * Build a Commander {@link Option} from an {@link OptionSpec}, covering every
10
12
  * shape in the first-party flag corpus: boolean / value, negatable `--no-`,
@@ -29,11 +31,9 @@ export function buildOption(spec, commandName) {
29
31
  }
30
32
  // `arrayDefault` (repeatable accumulators) wins over a scalar `default`;
31
33
  // Commander uses it as the seed the `parse` reducer accumulates onto.
32
- if (spec.arrayDefault !== undefined) {
33
- option.default([...spec.arrayDefault]);
34
- }
35
- else if (spec.default !== undefined) {
36
- option.default(spec.default);
34
+ const defaultValue = optionDefaultValue(spec);
35
+ if (defaultValue !== undefined) {
36
+ option.default(defaultValue);
37
37
  }
38
38
  if (spec.required === true) {
39
39
  if (valuePlaceholder === undefined) {
@@ -1 +1 @@
1
- {"version":3,"file":"mount-command-spec-wiring.js","sourceRoot":"","sources":["../../src/commands/mount-command-spec-wiring.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAInC;;;;;;;;GAQG;AACH,MAAM,UAAU,WAAW,CAAC,IAAgB,EAAE,WAAmB;IAC/D,MAAM,gBAAgB,GAAG,uBAAuB,CAAC,IAAI,CAAC,CAAC;IACvD,MAAM,KAAK,GAAG,gBAAgB,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,IAAI,gBAAgB,EAAE,CAAC;IAC9F,MAAM,MAAM,GAAG,IAAI,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;IAEnD,IAAI,IAAI,CAAC,OAAO,KAAK,SAAS,IAAI,IAAI,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC1D,MAAM,CAAC,OAAO,CAAC,CAAC,GAAG,IAA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AC;CACzD;AAED,wBAAsB,kBAAkB,CAAC,IAAI,EAAE,yBAAyB,GAAG,OAAO,CAAC,IAAI,CAAC,CAgEvF"}
@@ -1,6 +1,6 @@
1
- import { applyAgentFilters, EXIT_CODES } from '@opensip-cli/contracts';
1
+ import { EXIT_CODES } from '@opensip-cli/contracts';
2
2
  import { buildToolIdentityIndex, currentScope, SystemError } from '@opensip-cli/core';
3
- import { resolveSession } from '@opensip-cli/session-store';
3
+ import { resolveAndReplaySession } from '@opensip-cli/session-store';
4
4
  import { SessionReplayRegistry } from '../session-replay-registry.js';
5
5
  export async function executeSessionShow(opts) {
6
6
  const scope = currentScope();
@@ -15,42 +15,23 @@ export async function executeSessionShow(opts) {
15
15
  }
16
16
  const registry = opts.registry ?? currentScope()?.tools;
17
17
  const identityIndex = registry === undefined ? undefined : buildToolIdentityIndex(registry);
18
- const resolved = resolveSession(datastore, {
18
+ const replayRegistry = opts.replayRegistry ?? SessionReplayRegistry.empty();
19
+ // Resolve + replay + filter via the session-store read core (ADR-0084). The
20
+ // per-tool replay closure is injected from the host's replay registry (which
21
+ // carries the external-isolation gate); identity display + emission stay here.
22
+ const outcome = await resolveAndReplaySession(datastore, {
19
23
  ref: opts.ref,
20
24
  tool: opts.tool,
25
+ replayFor: (tool) => replayRegistry.get(tool)?.replaySession,
26
+ ...(opts.filters === undefined ? {} : { filters: opts.filters }),
21
27
  });
22
- if (!resolved.ok) {
23
- await emitSessionShowError(opts, resolved.reason, resolved.detail);
28
+ if (!outcome.ok) {
29
+ await emitSessionShowError(opts, outcome.reason, outcome.detail);
24
30
  return;
25
31
  }
26
- const contribution = (opts.replayRegistry ?? SessionReplayRegistry.empty()).get(resolved.session.tool);
27
- if (contribution === undefined) {
28
- await emitSessionShowError(opts, 'replay-unavailable', `session replay is not available for ${resolved.session.tool}`);
29
- return;
30
- }
31
- let replay;
32
- try {
33
- // ADR-0054 M4-F: replaySession may be ASYNC — a BUNDLED tool resolves
34
- // synchronously (in-host closure); an EXTERNAL tool forks a hook worker (its
35
- // runtime never runs in-host). Await covers both.
36
- replay = await contribution.replaySession(resolved.session);
37
- }
38
- catch (error) {
39
- // @handles — a corrupt/legacy stored payload is surfaced to the caller as a
40
- // structured `decode-error` outcome (not swallowed); see emitSessionShowError.
41
- await emitSessionShowError(opts, 'decode-error', error instanceof Error ? error.message : String(error));
42
- return;
43
- }
44
- // Apply agent filters (Phase 1) *after* tool replay but before host emission.
45
- // This keeps per-tool replays pure while enabling token-efficient, focused
46
- // historical results for agents. The resulting envelope remains a valid
47
- // (possibly filtered) SignalEnvelope.
48
- const originalSignalCount = replay.envelope.signals.length;
49
- const filteredReplay = opts.filters?.length
50
- ? applyFiltersToReplay(resolved.session, replay, opts.filters)
51
- : replay;
32
+ const { session, replay: filteredReplay, originalSignalCount } = outcome;
52
33
  if (opts.json === true) {
53
- const jsonPayload = sessionShowJson(resolved.session, filteredReplay, opts.filters, originalSignalCount, identityIndex);
34
+ const jsonPayload = sessionShowJson(session, filteredReplay, opts.filters, originalSignalCount, identityIndex);
54
35
  if (opts.raw) {
55
36
  // Raw mode for agents: emit the core payload directly (bypassing the
56
37
  // standard CommandOutcome {kind, status, data, ...} wrapper). This gives
@@ -66,19 +47,11 @@ export async function executeSessionShow(opts) {
66
47
  opts.emitJson(jsonPayload);
67
48
  return;
68
49
  }
69
- await opts.render(sessionReplayResult(resolved.session, filteredReplay, opts.filters, originalSignalCount, identityIndex));
50
+ await opts.render(sessionReplayResult(session, filteredReplay, opts.filters, originalSignalCount, identityIndex));
70
51
  }
71
52
  function canonicalToolForDisplay(tool, identityIndex) {
72
53
  return identityIndex === undefined ? tool : identityIndex.canonicalForStoredTool(tool);
73
54
  }
74
- /** Apply shared agent filters to a replay envelope (ADR-0085). */
75
- function applyFiltersToReplay(_session, replay, filters) {
76
- const filtered = applyAgentFilters(replay.envelope, filters);
77
- return {
78
- ...replay,
79
- envelope: filtered.envelope,
80
- };
81
- }
82
55
  function agentFilterMeta(returnedSignalCount, filters, originalSignalCount) {
83
56
  if (!filters?.length || originalSignalCount == null)
84
57
  return {};