pantheon-opencode 1.6.2-beta.3 → 1.6.2-beta.5

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 (71) hide show
  1. package/CHANGELOG.md +42 -0
  2. package/README.md +209 -1
  3. package/bin/pantheon-init.mjs +22 -0
  4. package/package.json +9 -3
  5. package/plugin.json +1 -1
  6. package/pyproject.toml +1 -1
  7. package/scripts/decision-router-budget.mjs +781 -0
  8. package/scripts/decision-router-v2-budget.mjs +218 -0
  9. package/scripts/decision-router-v2-egress.mjs +272 -0
  10. package/scripts/decision-router.mjs +519 -0
  11. package/scripts/docs-check-changelog.mjs +5 -3
  12. package/scripts/install/decision-layer-preview.mjs +376 -0
  13. package/scripts/install/decision-router-config.mjs +579 -0
  14. package/scripts/install/interactive.mjs +76 -5
  15. package/scripts/install/opencode.mjs +12 -0
  16. package/scripts/install/state.mjs +5 -0
  17. package/scripts/install/strings.mjs +4 -0
  18. package/scripts/mcp_resources.py +11 -9
  19. package/scripts/release-notes.mjs +30 -7
  20. package/scripts/versioning.mjs +41 -5
  21. package/src/agents/zeus.md +12 -0
  22. package/src/mcp/eval_store.py +11 -4
  23. package/src/mcp/mcp_resources.py +11 -9
  24. package/src/mcp/memory_mcp.py +293 -150
  25. package/src/pantheon/local-decision-agents.ts +170 -0
  26. package/src/pantheon/local-decision-budget.ts +1043 -0
  27. package/src/pantheon/local-decision-egress-gate.ts +264 -0
  28. package/src/pantheon/local-decision-prompt.ts +268 -0
  29. package/src/pantheon/local-decision-provider-matrix.ts +92 -0
  30. package/src/pantheon/local-decision-provider-protocol.ts +335 -0
  31. package/src/pantheon/local-decision-provider.internal.ts +260 -0
  32. package/src/pantheon/local-decision-router.ts +225 -0
  33. package/src/pantheon/local-decision-skills.ts +281 -0
  34. package/src/pantheon/local-decision-tool.ts +160 -0
  35. package/src/pantheon/local-decision-turn.ts +338 -0
  36. package/src/pantheon/local-decision-usage-evidence.internal.ts +207 -0
  37. package/src/pantheon/local-orchestration.ts +322 -0
  38. package/src/pantheon/pantheon-decision-catalog.ts +101 -0
  39. package/src/pantheon/v2-decision-budget.ts +456 -0
  40. package/src/pantheon/v2-decision-contracts.ts +300 -0
  41. package/src/pantheon/v2-decision-egress.ts +203 -0
  42. package/src/pantheon/v2-decision-events.ts +180 -0
  43. package/src/pantheon/v2-decision-heuristic.ts +121 -0
  44. package/src/pantheon/v2-decision-points/p1-agent.ts +91 -0
  45. package/src/pantheon/v2-decision-points/p10-claims.ts +243 -0
  46. package/src/pantheon/v2-decision-points/p11-catalog.ts +220 -0
  47. package/src/pantheon/v2-decision-points/p2-skill.ts +83 -0
  48. package/src/pantheon/v2-decision-points/p3-complexity.ts +108 -0
  49. package/src/pantheon/v2-decision-points/p4-memory.ts +137 -0
  50. package/src/pantheon/v2-decision-points/p5-themis-verify.ts +190 -0
  51. package/src/pantheon/v2-decision-points/p6-council.ts +161 -0
  52. package/src/pantheon/v2-decision-points/p7-loop.ts +263 -0
  53. package/src/pantheon/v2-decision-points/p8-guardrail.ts +366 -0
  54. package/src/pantheon/v2-decision-points/p9-memory-compaction.ts +304 -0
  55. package/src/pantheon/v2-decision-points.ts +242 -0
  56. package/src/pantheon/v2-decision-policy.ts +166 -0
  57. package/src/pantheon/v2-decision-premises.ts +146 -0
  58. package/src/pantheon/v2-decision-prompt-surface.ts +115 -0
  59. package/src/pantheon/v2-decision-rank.ts +91 -0
  60. package/src/pantheon/v2-decision-registry.ts +391 -0
  61. package/src/pantheon/v2-decision-resource-ids.ts +127 -0
  62. package/src/pantheon/v2-decision-shadow.ts +123 -0
  63. package/src/pantheon/v2-decision-telemetry.ts +214 -0
  64. package/src/pantheon/v2-decision-verify.ts +51 -0
  65. package/src/pantheon/v2-tools.ts +35 -15
  66. package/src/plugin-v2.ts +357 -22
  67. package/src/plugin.ts +4 -0
  68. package/src/plugins/tui/dist/tui-v2.js +3 -3
  69. package/src/plugins/tui/dist/tui.js +1 -1
  70. package/src/plugins/tui/package-lock.json +2 -2
  71. package/src/plugins/tui/package.json +1 -1
@@ -0,0 +1,322 @@
1
+ import { readFile } from 'node:fs/promises'
2
+ import { load } from 'js-yaml'
3
+ import {
4
+ classifyLocalDecisionComplexity,
5
+ LOCAL_DECISION_COMPLEXITY_DIMENSIONS,
6
+ LOCAL_DECISION_ROUTER_POLICY_VERSION,
7
+ type LocalDecisionComplexityDimensions,
8
+ type LocalDecisionGateStatus,
9
+ } from './local-decision-router.ts'
10
+ import { isAgentAllowed, type PermissionTaskConfig } from './permission-globs.ts'
11
+ import { PANTHEON_AGENTS } from './v2-delegation-enforce.ts'
12
+
13
+ export interface LocalDecisionAgentPolicy {
14
+ canDelegateTo: readonly string[]
15
+ canReceiveDelegation: boolean
16
+ capabilities: readonly string[]
17
+ skills: readonly string[]
18
+ }
19
+
20
+ export interface LocalDecisionPolicy {
21
+ agents: Readonly<Record<string, LocalDecisionAgentPolicy>>
22
+ permissionTask: PermissionTaskConfig
23
+ }
24
+
25
+ export interface LocalOrchestrationInput {
26
+ schemaVersion: 1
27
+ candidateAgents: readonly string[]
28
+ domain: string | null
29
+ candidateSkillIds: readonly string[]
30
+ candidateResourceIds: readonly string[]
31
+ memorySearchRelevant: boolean
32
+ gateStatus: LocalDecisionGateStatus
33
+ complexity: LocalDecisionComplexityDimensions
34
+ }
35
+
36
+ export type LocalOrchestrationReasonCode =
37
+ | 'CALLER_NOT_ZEUS'
38
+ | 'INVALID_INPUT'
39
+ | 'POLICY_UNAVAILABLE'
40
+ | 'NO_ELIGIBLE_CANDIDATE'
41
+ | 'AMBIGUOUS_CANDIDATE'
42
+ | 'DOMAIN_NOT_ELIGIBLE'
43
+ | 'ADVISORY_ROUTE'
44
+ | 'PROVIDER_RECOMMENDATION'
45
+ | 'PROVIDER_ABSTENTION'
46
+
47
+ export interface LocalOrchestrationPlan {
48
+ schemaVersion: 1
49
+ policyVersion: typeof LOCAL_DECISION_ROUTER_POLICY_VERSION
50
+ decision: 'recommend' | 'abstain'
51
+ reasonCode: LocalOrchestrationReasonCode
52
+ agent: string | null
53
+ skillIds: string[]
54
+ resourceIds: string[]
55
+ recommendMemorySearch: boolean
56
+ gateStatus: LocalDecisionGateStatus
57
+ complexity: ReturnType<typeof classifyLocalDecisionComplexity>
58
+ action: 'advisory_only'
59
+ }
60
+
61
+ const GATE_STATUSES = new Set<LocalDecisionGateStatus>([
62
+ 'none',
63
+ 'review_required',
64
+ 'human_approval_required',
65
+ 'unresolved',
66
+ ])
67
+ const INPUT_KEYS = [
68
+ 'candidateAgents',
69
+ 'candidateResourceIds',
70
+ 'candidateSkillIds',
71
+ 'complexity',
72
+ 'domain',
73
+ 'gateStatus',
74
+ 'memorySearchRelevant',
75
+ 'schemaVersion',
76
+ ]
77
+ const RESOURCE_IDS = new Set(['pantheon://agents', 'pantheon://routing', 'pantheon://skills'])
78
+
79
+ function isRecord(value: unknown): value is Record<string, unknown> {
80
+ if (value === null || typeof value !== 'object' || Array.isArray(value)) return false
81
+ const prototype = Object.getPrototypeOf(value)
82
+ return prototype === Object.prototype || prototype === null
83
+ }
84
+
85
+ function exactKeys(value: Record<string, unknown>, keys: readonly string[]): boolean {
86
+ const actual = Object.keys(value).sort()
87
+ const expected = [...keys].sort()
88
+ return actual.length === expected.length && actual.every((key, index) => key === expected[index])
89
+ }
90
+
91
+ function stringArray(value: unknown): value is string[] {
92
+ return Array.isArray(value) && value.every((item) => typeof item === 'string')
93
+ }
94
+
95
+ function hasUsablePolicy(policy: LocalDecisionPolicy | undefined): policy is LocalDecisionPolicy {
96
+ if (
97
+ policy === undefined ||
98
+ !isRecord(policy.agents) ||
99
+ !isRecord(policy.permissionTask) ||
100
+ !isRecord(policy.agents.zeus)
101
+ ) {
102
+ return false
103
+ }
104
+ const grants = Object.entries(policy.permissionTask)
105
+ return (
106
+ grants.length > 0 &&
107
+ grants.every(([, action]) => action === 'allow' || action === 'deny') &&
108
+ stringArray(policy.agents.zeus.canDelegateTo) &&
109
+ stringArray(policy.agents.zeus.capabilities)
110
+ )
111
+ }
112
+
113
+ function parsePolicy(raw: unknown): LocalDecisionPolicy | undefined {
114
+ if (!isRecord(raw) || !isRecord(raw.agents) || !isRecord(raw.permission)) return undefined
115
+ const permission = raw.permission.task
116
+ if (!isRecord(permission)) return undefined
117
+
118
+ const permissionTask: Record<string, 'allow' | 'deny'> = {}
119
+ for (const [pattern, action] of Object.entries(permission)) {
120
+ if (action !== 'allow' && action !== 'deny') return undefined
121
+ permissionTask[pattern] = action
122
+ }
123
+ if (Object.keys(permissionTask).length === 0) return undefined
124
+
125
+ const agents: Record<string, LocalDecisionAgentPolicy> = {}
126
+ for (const [id, value] of Object.entries(raw.agents)) {
127
+ if (!PANTHEON_AGENTS.has(id) || !isRecord(value)) continue
128
+ const canDelegateTo =
129
+ value.subagent_can_delegate_to === undefined && value.can_delegate === false
130
+ ? []
131
+ : value.subagent_can_delegate_to
132
+ if (
133
+ typeof value.can_receive_delegation !== 'boolean' ||
134
+ !stringArray(canDelegateTo) ||
135
+ !stringArray(value.skills) ||
136
+ !stringArray(value.capabilities)
137
+ ) {
138
+ return undefined
139
+ }
140
+ if (
141
+ canDelegateTo.some((target) => !PANTHEON_AGENTS.has(target)) ||
142
+ value.skills.some((skill) => !/^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(skill))
143
+ ) {
144
+ return undefined
145
+ }
146
+ agents[id] = {
147
+ canDelegateTo,
148
+ canReceiveDelegation: value.can_receive_delegation,
149
+ capabilities: value.capabilities,
150
+ skills: value.skills,
151
+ }
152
+ }
153
+ if (agents.zeus === undefined) return undefined
154
+ return { agents, permissionTask }
155
+ }
156
+
157
+ let policyCache: Promise<LocalDecisionPolicy | undefined> | undefined
158
+
159
+ /**
160
+ * Load only local, non-secret policy metadata; missing or invalid policy abstains.
161
+ * `routing.yml` is a static package asset, so the parsed policy is cached for
162
+ * the process lifetime. Failures are not cached: the next prompt retries, and a
163
+ * test/admin can call `clearLocalDecisionPolicyCache()` to invalidate safely.
164
+ */
165
+ export async function loadLocalDecisionPolicy(): Promise<LocalDecisionPolicy | undefined> {
166
+ if (policyCache === undefined) {
167
+ policyCache = readLocalDecisionPolicy().then(
168
+ (policy) => {
169
+ if (policy === undefined) policyCache = undefined
170
+ return policy
171
+ },
172
+ () => {
173
+ policyCache = undefined
174
+ return undefined
175
+ },
176
+ )
177
+ }
178
+ return policyCache
179
+ }
180
+
181
+ /** Test/admin seam: drop the process policy cache without discharging any state. */
182
+ export function clearLocalDecisionPolicyCache(): void {
183
+ policyCache = undefined
184
+ }
185
+
186
+ async function readLocalDecisionPolicy(): Promise<LocalDecisionPolicy | undefined> {
187
+ try {
188
+ const routingUrl = new URL('../routing.yml', import.meta.url)
189
+ const parsed = load(await readFile(routingUrl, 'utf8'))
190
+ return parsePolicy(parsed)
191
+ } catch {
192
+ return undefined
193
+ }
194
+ }
195
+
196
+ function isValidInput(value: unknown): value is LocalOrchestrationInput {
197
+ if (!isRecord(value) || !exactKeys(value, INPUT_KEYS) || value.schemaVersion !== 1) return false
198
+ if (
199
+ !stringArray(value.candidateAgents) ||
200
+ value.candidateAgents.length > 14 ||
201
+ !stringArray(value.candidateSkillIds) ||
202
+ value.candidateSkillIds.length > 64 ||
203
+ !stringArray(value.candidateResourceIds) ||
204
+ value.candidateResourceIds.length > 32 ||
205
+ (value.domain !== null && typeof value.domain !== 'string') ||
206
+ typeof value.memorySearchRelevant !== 'boolean' ||
207
+ typeof value.gateStatus !== 'string' ||
208
+ !GATE_STATUSES.has(value.gateStatus as LocalDecisionGateStatus) ||
209
+ !isRecord(value.complexity)
210
+ ) {
211
+ return false
212
+ }
213
+ return (
214
+ exactKeys(value.complexity, LOCAL_DECISION_COMPLEXITY_DIMENSIONS) &&
215
+ classifyLocalDecisionComplexity(value.complexity).label !== 'abstain'
216
+ )
217
+ }
218
+
219
+ function abstain(
220
+ reasonCode: LocalOrchestrationReasonCode,
221
+ gateStatus: LocalDecisionGateStatus = 'unresolved',
222
+ complexity?: unknown,
223
+ ): LocalOrchestrationPlan {
224
+ return {
225
+ schemaVersion: 1,
226
+ policyVersion: LOCAL_DECISION_ROUTER_POLICY_VERSION,
227
+ decision: 'abstain',
228
+ reasonCode,
229
+ agent: null,
230
+ skillIds: [],
231
+ resourceIds: [],
232
+ recommendMemorySearch: false,
233
+ gateStatus,
234
+ complexity: classifyLocalDecisionComplexity(complexity),
235
+ action: 'advisory_only',
236
+ }
237
+ }
238
+
239
+ /** Build an advisory plan from structured candidate IDs; this function never dispatches. */
240
+ export function recommendLocalOrchestration(
241
+ input: unknown,
242
+ callerAgent: unknown,
243
+ policy: LocalDecisionPolicy | undefined,
244
+ ): LocalOrchestrationPlan {
245
+ try {
246
+ return evaluateLocalOrchestration(input, callerAgent, policy)
247
+ } catch {
248
+ return abstain('INVALID_INPUT')
249
+ }
250
+ }
251
+
252
+ function evaluateLocalOrchestration(
253
+ input: unknown,
254
+ callerAgent: unknown,
255
+ policy: LocalDecisionPolicy | undefined,
256
+ ): LocalOrchestrationPlan {
257
+ if (callerAgent !== 'zeus') return abstain('CALLER_NOT_ZEUS')
258
+ if (!hasUsablePolicy(policy)) {
259
+ return abstain('POLICY_UNAVAILABLE')
260
+ }
261
+ if (!isValidInput(input)) return abstain('INVALID_INPUT')
262
+
263
+ const gateStatus = input.gateStatus
264
+ const complexity = classifyLocalDecisionComplexity(input.complexity)
265
+ const zeus = policy.agents.zeus
266
+ if (zeus === undefined) return abstain('POLICY_UNAVAILABLE', gateStatus, input.complexity)
267
+ const eligible = [...new Set(input.candidateAgents)].filter((candidate) => {
268
+ const target = policy.agents[candidate]
269
+ return (
270
+ candidate !== 'zeus' &&
271
+ PANTHEON_AGENTS.has(candidate) &&
272
+ target?.canReceiveDelegation === true &&
273
+ zeus.canDelegateTo.includes(candidate) &&
274
+ isAgentAllowed(policy.permissionTask, candidate)
275
+ )
276
+ })
277
+
278
+ if (eligible.length === 0) return abstain('NO_ELIGIBLE_CANDIDATE', gateStatus, input.complexity)
279
+
280
+ let agent: string
281
+ if (input.domain !== null) {
282
+ if (!eligible.includes(input.domain)) {
283
+ return abstain('DOMAIN_NOT_ELIGIBLE', gateStatus, input.complexity)
284
+ }
285
+ agent = input.domain
286
+ } else if (eligible.length === 1) {
287
+ const [onlyEligible] = eligible
288
+ if (onlyEligible === undefined) {
289
+ return abstain('NO_ELIGIBLE_CANDIDATE', gateStatus, input.complexity)
290
+ }
291
+ agent = onlyEligible
292
+ } else {
293
+ return abstain('AMBIGUOUS_CANDIDATE', gateStatus, input.complexity)
294
+ }
295
+
296
+ const agentPolicy = policy.agents[agent]
297
+ if (agentPolicy === undefined) return abstain('POLICY_UNAVAILABLE', gateStatus, input.complexity)
298
+ const skillIds = input.candidateSkillIds.filter(
299
+ (skill, index, all) => all.indexOf(skill) === index && agentPolicy.skills.includes(skill),
300
+ )
301
+ const allowedResources = new Set(RESOURCE_IDS)
302
+ for (const skill of skillIds) allowedResources.add(`pantheon://skills/${skill}`)
303
+ if (PANTHEON_AGENTS.has(agent)) allowedResources.add(`pantheon://agents/${agent}`)
304
+ const resourceIds = input.candidateResourceIds.filter(
305
+ (resource, index, all) => all.indexOf(resource) === index && allowedResources.has(resource),
306
+ )
307
+
308
+ return {
309
+ schemaVersion: 1,
310
+ policyVersion: LOCAL_DECISION_ROUTER_POLICY_VERSION,
311
+ decision: 'recommend',
312
+ reasonCode: 'ADVISORY_ROUTE',
313
+ agent,
314
+ skillIds,
315
+ resourceIds,
316
+ recommendMemorySearch:
317
+ input.memorySearchRelevant && zeus.capabilities.includes('memory_recall'),
318
+ gateStatus,
319
+ complexity,
320
+ action: 'advisory_only',
321
+ }
322
+ }
@@ -0,0 +1,101 @@
1
+ /**
2
+ * Allowlisted, short Pantheon catalog used by the per-turn decision router.
3
+ *
4
+ * Only IDs and one-line descriptions live here. Full skill bodies, agent
5
+ * prompts, file paths, memory contents, and transcripts are never included in
6
+ * a provider payload.
7
+ */
8
+
9
+ export interface DecisionCatalogEntry {
10
+ id: string
11
+ description: string
12
+ }
13
+
14
+ export const PANTHEON_SKILL_CATALOG: readonly DecisionCatalogEntry[] = Object.freeze([
15
+ { id: 'agent-coordination', description: 'Multi-agent orchestration, routing, and delegation.' },
16
+ { id: 'artifact-management', description: 'Structured artifacts for planned or risky work.' },
17
+ { id: 'auto-continue', description: 'Continue multi-step todos while keeping safety gates.' },
18
+ { id: 'clonedeps', description: 'Clone dependency source locally for inspection.' },
19
+ { id: 'code-review-checklist', description: 'Systematic code review and quality gates.' },
20
+ { id: 'codemap', description: 'Map repository structure before deep reading.' },
21
+ { id: 'context-compression', description: 'Explicit compaction and resumable checkpoints.' },
22
+ { id: 'git-workflow-and-versioning', description: 'Atomic commits and versioning workflow.' },
23
+ { id: 'incremental-implementation', description: 'Thin, testable, rollback-safe slices.' },
24
+ { id: 'loop-engineering', description: 'Controlled iterative refinement cycles.' },
25
+ { id: 'memory-bank', description: 'Memory-bank structure, rules, and maintenance.' },
26
+ { id: 'reflect', description: 'Turn repeated workflow friction into reusable assets.' },
27
+ { id: 'security-hardening', description: 'Security gate: OWASP, secrets, dependencies.' },
28
+ { id: 'session-goal', description: 'Pin the session objective against scope creep.' },
29
+ { id: 'simplify', description: 'Behavior-preserving code simplification.' },
30
+ {
31
+ id: 'spec-driven-development',
32
+ description: 'Spec-first requirements and acceptance criteria.',
33
+ },
34
+ {
35
+ id: 'tdd-with-agents',
36
+ description: 'RED, GREEN, REFACTOR test-driven implementation.',
37
+ },
38
+ { id: 'verification-planning', description: 'Plan the evidence path before changing code.' },
39
+ {
40
+ id: 'visual-review-pipeline',
41
+ description: 'Automated visual review with screenshots and fixes.',
42
+ },
43
+ { id: 'worktrees', description: 'Isolated git worktrees for parallel or risky work.' },
44
+ ])
45
+
46
+ export const PANTHEON_AGENT_CATALOG: readonly DecisionCatalogEntry[] = Object.freeze([
47
+ { id: 'zeus', description: 'Central orchestrator; never implements.' },
48
+ { id: 'athena', description: 'Plan-only architect and strategic planner.' },
49
+ { id: 'apollo', description: 'Read-only investigation and discovery scout.' },
50
+ { id: 'hermes', description: 'Backend specialist: FastAPI, Python, async.' },
51
+ { id: 'aphrodite', description: 'Frontend specialist: React, TypeScript, WCAG.' },
52
+ { id: 'demeter', description: 'Database specialist: SQLAlchemy, migrations, queries.' },
53
+ { id: 'themis', description: 'Quality and security review gate.' },
54
+ { id: 'prometheus', description: 'Infrastructure, Docker, CI, and model providers.' },
55
+ { id: 'hephaestus', description: 'AI pipelines: LangChain, RAG, vector stores.' },
56
+ { id: 'nyx', description: 'Observability, tracing, and cost analytics.' },
57
+ { id: 'gaia', description: 'Remote sensing and geospatial analysis.' },
58
+ { id: 'iris', description: 'GitHub branches, pull requests, issues, releases.' },
59
+ { id: 'mnemosyne', description: 'Memory bank and ADR authoring on request.' },
60
+ { id: 'talos', description: 'Small hotfixes, typos, and CSS fixes.' },
61
+ ])
62
+
63
+ const SKILL_IDS = new Set(PANTHEON_SKILL_CATALOG.map((entry) => entry.id))
64
+ const AGENT_IDS = new Set(PANTHEON_AGENT_CATALOG.map((entry) => entry.id))
65
+
66
+ export const PANTHEON_SKILL_IDS: ReadonlySet<string> = SKILL_IDS
67
+ export const PANTHEON_AGENT_IDS: ReadonlySet<string> = AGENT_IDS
68
+
69
+ export function isPantheonSkillId(value: unknown): value is string {
70
+ return typeof value === 'string' && SKILL_IDS.has(value)
71
+ }
72
+
73
+ export function isPantheonAgentId(value: unknown): value is string {
74
+ return typeof value === 'string' && AGENT_IDS.has(value)
75
+ }
76
+
77
+ export function skillCatalogEntry(id: string): DecisionCatalogEntry | undefined {
78
+ return PANTHEON_SKILL_CATALOG.find((entry) => entry.id === id)
79
+ }
80
+
81
+ export function agentCatalogEntry(id: string): DecisionCatalogEntry | undefined {
82
+ return PANTHEON_AGENT_CATALOG.find((entry) => entry.id === id)
83
+ }
84
+
85
+ /** Build the short skill catalog subset for an explicit ID list. */
86
+ export function skillCatalogSubset(ids: readonly string[]): DecisionCatalogEntry[] {
87
+ const selected = new Set(ids)
88
+ return PANTHEON_SKILL_CATALOG.filter((entry) => selected.has(entry.id)).map((entry) => ({
89
+ id: entry.id,
90
+ description: entry.description,
91
+ }))
92
+ }
93
+
94
+ /** Build the short agent catalog subset for an explicit ID list. */
95
+ export function agentCatalogSubset(ids: readonly string[]): DecisionCatalogEntry[] {
96
+ const selected = new Set(ids)
97
+ return PANTHEON_AGENT_CATALOG.filter((entry) => selected.has(entry.id)).map((entry) => ({
98
+ id: entry.id,
99
+ description: entry.description,
100
+ }))
101
+ }