@vibe-engineer/adapter-pi 0.1.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.
@@ -0,0 +1,243 @@
1
+ import {
2
+ GENERATED_FILE_FAMILY_IDS,
3
+ SKILL_IDS,
4
+ validateCapabilityMatrix
5
+ } from "./chunk-VXZJPOEE.js";
6
+
7
+ // src/capabilities/index.ts
8
+ var PI_ADAPTER_ID = "pi";
9
+ var PI_ADAPTER_CAPABILITY_SCHEMA_VERSION = "pi-adapter-capability-matrix/v1";
10
+ var VIBE_ENGINEER_SKILLS = [...SKILL_IDS];
11
+ var known = (source, notes) => ({ state: "known", source, notes });
12
+ var unknown = (source, notes) => ({ state: "unknown", source, notes });
13
+ var deferred = (source, notes) => ({ state: "deferred", source, notes });
14
+ var surface = (evidence, support, details, downstreamConsequence) => ({
15
+ evidence,
16
+ support,
17
+ details,
18
+ downstreamConsequence
19
+ });
20
+ var piSkill = (skillId) => ({
21
+ skillId,
22
+ nativeCommand: `/skill:${skillId}`,
23
+ resourceFamily: "pi-skill-files",
24
+ evidence: known("DL-03 skill protocols + DL-06 pi skills decision", "The six locked skills are generated as Agent Skills-compatible SKILL.md resources."),
25
+ readiness: "ready",
26
+ protocolSource: "DL-03-skill-protocols.md"
27
+ });
28
+ var nonPiAdapter = (adapterId, displayName, evidence) => ({
29
+ adapterId,
30
+ displayName,
31
+ evidenceStatus: evidence,
32
+ versionCompatibility: {
33
+ harnessName: displayName,
34
+ harnessVersionRange: "unknown",
35
+ resourceFormatVersion: "unknown",
36
+ runtimeRequirements: ["future evidence-backed decision required"],
37
+ compatibilityEvidence: evidence
38
+ },
39
+ skillsCommandsSurface: {
40
+ ...surface(evidence, evidence.state === "deferred" ? "deferred" : "unknown", "No v1 native generated-resource contract is authorized for this harness.", "Any dependent selection or generation for this harness must block until a future adapter decision supplies evidence."),
41
+ nativeFormat: "unknown",
42
+ autoloadDiscovery: ["unknown"],
43
+ skills: []
44
+ },
45
+ promptTemplateSurface: surface(evidence, evidence.state === "deferred" ? "deferred" : "unknown", "Prompt template semantics are not evidenced for v1.", "Prompt generation must block for this harness."),
46
+ hookEventSupport: surface(evidence, evidence.state === "deferred" ? "deferred" : "unknown", "Hook/event semantics are not evidenced for v1.", "Hook, tool, event, UI, plan-mode, or subagent generation must block."),
47
+ subagentCapability: {
48
+ ...surface(evidence, evidence.state === "deferred" ? "deferred" : "unknown", "Subagent capability is not evidenced for v1.", "Subagent-dependent behavior must block."),
49
+ implementationKind: "unsupported",
50
+ requiresGeneratedExtension: false
51
+ },
52
+ planModeCapability: {
53
+ ...surface(evidence, evidence.state === "deferred" ? "deferred" : "unknown", "Plan-mode capability is not evidenced for v1.", "Plan-mode-dependent behavior must block."),
54
+ implementationKind: "unsupported",
55
+ requiresGeneratedExtension: false
56
+ },
57
+ contextFileConventions: surface(evidence, evidence.state === "deferred" ? "deferred" : "unknown", "Context-file conventions are not evidenced for v1.", "Context file generation must block for this harness."),
58
+ commandInvocationModel: {
59
+ interactive: surface(evidence, "unknown", "Unknown invocation model.", "Invocation must block."),
60
+ printMode: surface(evidence, "unknown", "Unknown print/non-interactive model.", "Invocation must block."),
61
+ jsonMode: surface(evidence, "unknown", "Unknown machine-readable event model.", "Automation must block."),
62
+ rpcMode: surface(evidence, "unknown", "Unknown RPC model.", "Automation must block."),
63
+ sdk: surface(evidence, "unknown", "Unknown SDK model.", "Automation must block."),
64
+ shellCommandPolicy: "blocked"
65
+ },
66
+ generatedFiles: {
67
+ evidence,
68
+ manifestSchemaVersion: "pi-generated-file-manifest/v1",
69
+ families: [],
70
+ downstreamConsequence: "No non-pi generated files may be emitted by v1 lanes."
71
+ },
72
+ packageDistribution: {
73
+ ...surface(evidence, evidence.state === "deferred" ? "deferred" : "unknown", "Package distribution semantics are not evidenced for v1.", "Package generation or install claims must block."),
74
+ distributionKinds: [],
75
+ trustUpdatePolicy: "blocked until future adapter evidence exists"
76
+ },
77
+ securityTrust: {
78
+ evidence,
79
+ projectTrustRequired: false,
80
+ extensionExecution: "none",
81
+ commandPolicy: "default-deny",
82
+ sandboxCapability: "unknown",
83
+ credentialPolicy: "unknown-blocked",
84
+ destructiveOperations: "forbidden",
85
+ externalIntegration: "unknown-blocked",
86
+ trustBoundary: "No v1 trust boundary is declared; non-pi rows are non-selectable."
87
+ },
88
+ capabilityFlags: {
89
+ skills: false,
90
+ prompts: false,
91
+ hooks: false,
92
+ extensions: false,
93
+ subagents: false,
94
+ planMode: false,
95
+ contextFiles: false,
96
+ rpc: false,
97
+ sdk: false,
98
+ jsonMode: false,
99
+ packages: false,
100
+ ui: false,
101
+ unsupportedFeaturePolicy: "block"
102
+ },
103
+ realBoundaryWitness: {
104
+ evidence,
105
+ boundaryStatus: evidence.state === "deferred" ? "deferred" : "unknown",
106
+ producer: "future adapter lane",
107
+ carrier: "future generated-resource manifest",
108
+ consumer: "future harness runtime/API consumer",
109
+ evidencePath: "future evidence-backed decision required",
110
+ runtimeExecutionClaim: "not-claimed"
111
+ },
112
+ selection: {
113
+ manifestSelectable: false,
114
+ createImportSelectable: false,
115
+ readiness: evidence.state === "blocked" ? "blocked" : evidence.state === "deferred" ? "deferred" : "unknown",
116
+ reason: "Non-pi harnesses are explicit future/deferred/unknown rows and are never ready or selectable in v1."
117
+ }
118
+ });
119
+ var piAdapter = {
120
+ adapterId: PI_ADAPTER_ID,
121
+ displayName: "Pi Coding Agent",
122
+ evidenceStatus: known("DL-06-agentic-harness-integrations.md", "Pi is the only v1 live adapter target; this row declares the typed manifest contract and does not claim live runtime execution."),
123
+ versionCompatibility: {
124
+ harnessName: "pi",
125
+ harnessVersionRange: "unknown until I-14B/live runtime records installed pi version",
126
+ resourceFormatVersion: "Agent Skills standard plus pi-specific prompt/template/extension/package resource formats",
127
+ runtimeRequirements: ["Node/TypeScript extension runtime", "project trust for project-local .pi resources", "DL-22 default-deny command policy"],
128
+ compatibilityEvidence: known("DL-06 pi mechanisms and explicit limitations", "Design evidence is known; live runtime compatibility remains I-14B pending-live.")
129
+ },
130
+ skillsCommandsSurface: {
131
+ ...surface(known("DL-03 + DL-06", "All six locked skills map to pi Agent Skills slash commands."), "ready", "Generate `.pi/skills/<skill>/SKILL.md` and/or `.agents/skills/<skill>/SKILL.md` assets exposing `/skill:<skill>`.", "Downstream lanes may consume the typed mapping, but I-14B owns actual file generation/runtime loading."),
132
+ nativeFormat: "Agent Skills SKILL.md",
133
+ autoloadDiscovery: [".pi/skills/<skill>/SKILL.md", ".agents/skills/<skill>/SKILL.md"],
134
+ skills: VIBE_ENGINEER_SKILLS.map((skillId) => piSkill(skillId))
135
+ },
136
+ promptTemplateSurface: surface(known("DL-06 pi prompt templates", "Pi prompt templates are `.pi/prompts/*.md` markdown files with filename-derived slash commands and frontmatter/arguments."), "ready", "Reusable slash-command prompt templates may be declared in `.pi/prompts/<name>.md`.", "Downstream generation must validate template family metadata before writing files."),
137
+ hookEventSupport: surface(known("DL-06 pi extensions", "Pi TypeScript extensions can register commands/tools and subscribe to events; deterministic gates must not be advisory-only."), "ready", "Optional `.pi/extensions/**` TypeScript extensions can provide commands, tools, hooks/events, permission gates, and dynamic resources.", "Executable extension files require DL-22 trust/security metadata and later runtime proof."),
138
+ subagentCapability: {
139
+ ...surface(known("DL-06 explicit pi limitations", "Pi does not ship built-in subagents; subagent behavior is extension/package-built only."), "blocked", "No built-in subagent claim is made in I-14A.", "Any subagent-dependent lane must wait for generated extension/package implementation and live proof."),
140
+ implementationKind: "extension-built",
141
+ requiresGeneratedExtension: true
142
+ },
143
+ planModeCapability: {
144
+ ...surface(known("DL-06 explicit pi limitations", "Pi does not ship built-in plan mode; plan-mode-like behavior is extension/package-built only."), "blocked", "No built-in plan-mode claim is made in I-14A.", "Any plan-mode-dependent lane must wait for generated extension/package implementation and live proof."),
145
+ implementationKind: "extension-built",
146
+ requiresGeneratedExtension: true
147
+ },
148
+ contextFileConventions: surface(known("DL-06 context files", "Pi loads AGENTS.md and optional CLAUDE.md context files subject to trust and load timing."), "ready", "Context file families are `AGENTS.md` and optional `CLAUDE.md`, with generated content preserving project-owned instructions.", "Downstream writers must use the generated-file manifest and DL-22 trust fields before emitting context files."),
149
+ commandInvocationModel: {
150
+ interactive: surface(known("DL-06 CLI modes", "Interactive mode is user-facing operation."), "ready", "User operation through `pi` interactive mode.", "No automation may infer machine success from prose."),
151
+ printMode: surface(known("DL-06 CLI modes", "`pi -p`/`--print` is available for one-shot prompts."), "ready", "One-shot prompt mode can be used by future runtime witnesses where safe.", "Future runtime lanes must validate machine-readable outputs where they rely on automation."),
152
+ jsonMode: surface(known("DL-06 JSON mode", "`--mode json` provides event-stream observation."), "ready", "JSON mode is the preferred observation surface for event-stream runtime proof.", "I-14A does not execute live pi runtime; I-14B owns it."),
153
+ rpcMode: surface(known("DL-06 RPC", "RPC `get_commands` can observe generated commands."), "ready", "RPC command listing is a preferred real-boundary observation point.", "I-14A proves manifest API consumption only; live pi RPC is pending I-14B."),
154
+ sdk: surface(known("DL-06 SDK", "SDK/ResourceLoader APIs can observe generated resources."), "ready", "SDK resource loading can be used by future live witnesses.", "I-14A does not claim SDK runtime loading."),
155
+ shellCommandPolicy: "default-deny"
156
+ },
157
+ generatedFiles: {
158
+ evidence: known("DL-06 pi generated-file families", "The generated-file manifest enumerates every permitted pi family and its owner/trust/version/consumer fields."),
159
+ manifestSchemaVersion: "pi-generated-file-manifest/v1",
160
+ families: [...GENERATED_FILE_FAMILY_IDS],
161
+ downstreamConsequence: "Downstream lanes must validate the manifest before generating pi files; malformed or missing family metadata blocks."
162
+ },
163
+ packageDistribution: {
164
+ ...surface(known("DL-06 pi packages", "Pi packages may declare resources through a package.json `pi` key; trust/update behavior must be explicit."), "ready", "Primary v1 generation uses project-local files; optional package distribution is declared but not generated in I-14A.", "Package distribution requires explicit generated-file manifest metadata and later lane implementation."),
165
+ distributionKinds: ["project-local-files", "pi-package"],
166
+ trustUpdatePolicy: "Project-local files require project trust; package install/update/trust behavior must be explicit before use."
167
+ },
168
+ securityTrust: {
169
+ evidence: known("DL-22 + DL-06", "Adapter declares project trust, executable extension, command policy, sandbox non-claims, credential, destructive-operation, and external-integration defaults."),
170
+ projectTrustRequired: true,
171
+ extensionExecution: "typescript-extension",
172
+ commandPolicy: "default-deny",
173
+ sandboxCapability: "not_provided",
174
+ credentialPolicy: "no-credentials-required",
175
+ destructiveOperations: "forbidden",
176
+ externalIntegration: "disabled-by-default",
177
+ trustBoundary: "Project-local pi resources and TypeScript extensions run only after trust; I-14A claims no OS/network/process sandbox beyond policy declarations."
178
+ },
179
+ capabilityFlags: {
180
+ skills: true,
181
+ prompts: true,
182
+ hooks: true,
183
+ extensions: true,
184
+ subagents: false,
185
+ planMode: false,
186
+ contextFiles: true,
187
+ rpc: true,
188
+ sdk: true,
189
+ jsonMode: true,
190
+ packages: true,
191
+ ui: false,
192
+ unsupportedFeaturePolicy: "block"
193
+ },
194
+ realBoundaryWitness: {
195
+ evidence: known("I-14A implementer witness", "Actual package API is consumed by fixture generator/validator and persisted downstream summary; live pi runtime remains out of lane."),
196
+ boundaryStatus: "implemented",
197
+ producer: "@vibe-engineer/adapter-pi subpath APIs under packages/adapters/pi/src/{capabilities,generated-file-manifest,schema}",
198
+ carrier: "packages/adapters/pi/fixtures/manifest and examples/harness-integrations/pi/manifest-fixtures JSON carriers",
199
+ consumer: ".vibe/work/I-14A-pi-adapter-capability-generated-file-manifest/witnesses/manifest-api-consumer.mjs",
200
+ evidencePath: ".vibe/work/I-14A-pi-adapter-capability-generated-file-manifest/downstream-summary.json",
201
+ runtimeExecutionClaim: "not-claimed"
202
+ },
203
+ selection: {
204
+ manifestSelectable: true,
205
+ createImportSelectable: false,
206
+ readiness: "ready",
207
+ reason: "Ready only as a typed manifest/API contract for downstream consumers; create/import selected-harness behavior belongs to I-15A."
208
+ }
209
+ };
210
+ var PI_ADAPTER_CAPABILITY_MATRIX = {
211
+ schemaVersion: PI_ADAPTER_CAPABILITY_SCHEMA_VERSION,
212
+ producedByLane: "I-14A-pi-adapter-capability-generated-file-manifest",
213
+ adapterPackage: "@vibe-engineer/adapter-pi",
214
+ adapters: [
215
+ piAdapter,
216
+ nonPiAdapter("claude-code", "Claude Code", deferred("DL-06 other harness disposition", "No local authoritative Claude Code harness generated-resource docs were provided for v1.")),
217
+ nonPiAdapter("codex", "Codex", deferred("DL-06 other harness disposition", "No local authoritative Codex harness generated-resource docs were provided for v1.")),
218
+ nonPiAdapter("opencode", "OpenCode", deferred("DL-06 other harness disposition", "Local pi docs mention OpenCode providers, not OpenCode harness asset semantics.")),
219
+ nonPiAdapter("later-integrations", "Later integrations", unknown("DL-06 future integrations", "Future harnesses require future evidence-backed decisions."))
220
+ ]
221
+ };
222
+ var getPiAdapterCapabilityMatrix = () => structuredClone(PI_ADAPTER_CAPABILITY_MATRIX);
223
+ var validatePiAdapterCapabilityMatrix = (value) => validateCapabilityMatrix(value);
224
+ var getAdapterCapabilityById = (matrix, adapterId) => matrix.adapters.find((adapter) => adapter.adapterId === adapterId);
225
+ var isAdapterManifestSelectable = (matrix, adapterId) => {
226
+ const validation = validateCapabilityMatrix(matrix);
227
+ if (!validation.valid) {
228
+ return false;
229
+ }
230
+ const adapter = getAdapterCapabilityById(matrix, adapterId);
231
+ return adapter?.selection.manifestSelectable === true && adapter.selection.readiness === "ready";
232
+ };
233
+
234
+ export {
235
+ PI_ADAPTER_ID,
236
+ PI_ADAPTER_CAPABILITY_SCHEMA_VERSION,
237
+ VIBE_ENGINEER_SKILLS,
238
+ PI_ADAPTER_CAPABILITY_MATRIX,
239
+ getPiAdapterCapabilityMatrix,
240
+ validatePiAdapterCapabilityMatrix,
241
+ getAdapterCapabilityById,
242
+ isAdapterManifestSelectable
243
+ };