@skillstate/opencode 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -0
- package/dist/opencode-adapter.d.ts +90 -0
- package/dist/opencode-adapter.d.ts.map +1 -0
- package/dist/opencode-adapter.js +263 -0
- package/dist/opencode-adapter.js.map +1 -0
- package/package.json +24 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,uBAAuB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,oDAAoD;AACpD,cAAc,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @non-paper adapter — no adapters exist in arXiv 2608.26263v3.
|
|
3
|
+
*
|
|
4
|
+
* Bridges the skillstate runtime into OpenCode via:
|
|
5
|
+
* - Prompts formatted with the skillstate XML-style skill envelope
|
|
6
|
+
* (delegates to PromptTransformer.formatForOpenCode).
|
|
7
|
+
* - A generated SKILL.md so OpenCode discovers the skill and follows the
|
|
8
|
+
* state-based execution process.
|
|
9
|
+
* - A generated plugin that hooks `experimental.chat.messages.transform` for
|
|
10
|
+
* real O(1) history trimming: old messages are dropped, only the last N
|
|
11
|
+
* non-system messages plus injected state are sent to the LLM.
|
|
12
|
+
* - `experimental.session.compacting` injects state into compaction context.
|
|
13
|
+
* - `tool.execute.after` persists state updates from LLM responses.
|
|
14
|
+
*/
|
|
15
|
+
import type { SkillState, StatePatch, ProceduralSpec, Observation, PlatformAdapter } from '@skillstate/core';
|
|
16
|
+
import type { StatePathRef } from '@skillstate/core';
|
|
17
|
+
/**
|
|
18
|
+
* OpenCode platform adapter (@non-paper; see module doc).
|
|
19
|
+
*/
|
|
20
|
+
export declare class OpenCodeAdapter implements PlatformAdapter {
|
|
21
|
+
readonly name = "opencode";
|
|
22
|
+
private transformer;
|
|
23
|
+
/**
|
|
24
|
+
* Produce a prompt string carrying the current state and skill
|
|
25
|
+
* instructions, directing the LLM to reason and then emit a JSON block
|
|
26
|
+
* with `state_patch` and `action`.
|
|
27
|
+
*/
|
|
28
|
+
injectState(state: SkillState, spec: ProceduralSpec): string;
|
|
29
|
+
/**
|
|
30
|
+
* Extract the state_patch from an LLM response containing a fenced JSON block.
|
|
31
|
+
*/
|
|
32
|
+
extractPatch(response: string): StatePatch | null;
|
|
33
|
+
/**
|
|
34
|
+
* Extract the action string from an LLM response containing a fenced JSON block.
|
|
35
|
+
*/
|
|
36
|
+
extractAction(response: string): string | null;
|
|
37
|
+
/**
|
|
38
|
+
* Format the full prompt (instructions + state + observation).
|
|
39
|
+
*
|
|
40
|
+
* @non-paper — adapter convenience (delegates to the transformer).
|
|
41
|
+
* Paper-exact callers use `PromptTransformer.formatPaper` (Appendix A.4).
|
|
42
|
+
*/
|
|
43
|
+
formatPrompt(state: SkillState, observation: Observation, spec: ProceduralSpec): string;
|
|
44
|
+
/**
|
|
45
|
+
* Generate a SKILL.md suitable for OpenCode's skill system.
|
|
46
|
+
*
|
|
47
|
+
* The frontmatter carries the skill name/description plus an
|
|
48
|
+
* execution_context block pointing at the persisted state file; the body
|
|
49
|
+
* describes the state-based execution process. History is discarded by
|
|
50
|
+
* the plugin's `messages.transform` hook — the LLM sees only the state.
|
|
51
|
+
*/
|
|
52
|
+
generateSkillMd(spec: ProceduralSpec, statePath?: string): string;
|
|
53
|
+
/**
|
|
54
|
+
* Generate an OpenCode plugin with real O(1) prompt economy.
|
|
55
|
+
*
|
|
56
|
+
* Hooks:
|
|
57
|
+
* - `experimental.chat.messages.transform`: trims history to the last
|
|
58
|
+
* `maxHistoryMessages` non-system messages, injects a synthetic state
|
|
59
|
+
* message — real O(1) prompt footprint.
|
|
60
|
+
* - `experimental.session.compacting`: injects state into the compaction
|
|
61
|
+
* context so the summary preserves it.
|
|
62
|
+
* - `tool.execute.after`: persists state updates from LLM responses.
|
|
63
|
+
*/
|
|
64
|
+
generatePluginCode(statePath: string, options?: {
|
|
65
|
+
maxHistoryMessages?: number;
|
|
66
|
+
}): string;
|
|
67
|
+
/**
|
|
68
|
+
* @non-paper additive overload: accept a `{ root, name }` ref confined
|
|
69
|
+
* via `resolveStatePath` — `..` escapes throw instead of embedding an
|
|
70
|
+
* unsafe path into the generated plugin.
|
|
71
|
+
*/
|
|
72
|
+
generatePluginCode(stateRef: StatePathRef, options?: {
|
|
73
|
+
maxHistoryMessages?: number;
|
|
74
|
+
}): string;
|
|
75
|
+
/**
|
|
76
|
+
* @non-paper additive helper: generate the plugin and persist it via
|
|
77
|
+
* `atomicWriteFile` (tmp + fsync + rename). Both the destination and the
|
|
78
|
+
* embedded state path accept raw strings (legacy behavior) or
|
|
79
|
+
* `{ root, name }` refs confined by `resolveStatePath`. Returns the
|
|
80
|
+
* absolute destination path.
|
|
81
|
+
*/
|
|
82
|
+
savePluginCode(target: string | StatePathRef, statePath: string | StatePathRef, options?: {
|
|
83
|
+
maxHistoryMessages?: number;
|
|
84
|
+
}): Promise<string>;
|
|
85
|
+
/**
|
|
86
|
+
* Describe the schema fields for inclusion in prompts.
|
|
87
|
+
*/
|
|
88
|
+
private describeSchema;
|
|
89
|
+
}
|
|
90
|
+
//# sourceMappingURL=opencode-adapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"opencode-adapter.d.ts","sourceRoot":"","sources":["../src/opencode-adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,KAAK,EACV,UAAU,EACV,UAAU,EACV,cAAc,EACd,WAAW,EACX,eAAe,EAChB,MAAM,kBAAkB,CAAC;AAM1B,OAAO,KAAK,E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
+
import { atomicWriteFile, resolveStatePath, } from '@skillstate/core';
|
|
3
|
+
/**
|
|
4
|
+
* OpenCode platform adapter (@non-paper; see module doc).
|
|
5
|
+
*/
|
|
6
|
+
export class OpenCodeAdapter {
|
|
7
|
+
name = 'opencode';
|
|
8
|
+
transformer = new PromptTransformer({ platform: 'opencode' });
|
|
9
|
+
/**
|
|
10
|
+
* Produce a prompt string carrying the current state and skill
|
|
11
|
+
* instructions, directing the LLM to reason and then emit a JSON block
|
|
12
|
+
* with `state_patch` and `action`.
|
|
13
|
+
*/
|
|
14
|
+
injectState(state, spec) {
|
|
15
|
+
const stateJson = JSON.stringify(state);
|
|
16
|
+
const schemaDesc = this.describeSchema(spec.schema);
|
|
17
|
+
return `<skill name="${spec.id}">
|
|
18
|
+
<instructions>${spec.instructions}</instructions>
|
|
19
|
+
${schemaDesc}
|
|
20
|
+
<state>
|
|
21
|
+
${stateJson}
|
|
22
|
+
</state>
|
|
23
|
+
</skill>
|
|
24
|
+
|
|
25
|
+
Respond with step-by-step reasoning followed by a JSON block containing both your State Patch and your Action. The JSON block MUST have exactly these two keys:
|
|
26
|
+
|
|
27
|
+
\`\`\`json
|
|
28
|
+
{
|
|
29
|
+
"state_patch": { "key": "new_value", "obsolete_key": null },
|
|
30
|
+
"action": "your_action_here"
|
|
31
|
+
}
|
|
32
|
+
\`\`\`
|
|
33
|
+
|
|
34
|
+
In \`state_patch\`, set keys to null to delete them. Only include fields you want to change. Omit fields to leave them unchanged.`;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Extract the state_patch from an LLM response containing a fenced JSON block.
|
|
38
|
+
*/
|
|
39
|
+
extractPatch(response) {
|
|
40
|
+
return this.transformer.extractStatePatch(response);
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Extract the action string from an LLM response containing a fenced JSON block.
|
|
44
|
+
*/
|
|
45
|
+
extractAction(response) {
|
|
46
|
+
return this.transformer.extractAction(response);
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Format the full prompt (instructions + state + observation).
|
|
50
|
+
*
|
|
51
|
+
* @non-paper — adapter convenience (delegates to the transformer).
|
|
52
|
+
* Paper-exact callers use `PromptTransformer.formatPaper` (Appendix A.4).
|
|
53
|
+
*/
|
|
54
|
+
formatPrompt(state, observation, spec) {
|
|
55
|
+
return this.transformer.formatForOpenCode(spec, state, observation);
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Generate a SKILL.md suitable for OpenCode's skill system.
|
|
59
|
+
*
|
|
60
|
+
* The frontmatter carries the skill name/description plus an
|
|
61
|
+
* execution_context block pointing at the persisted state file; the body
|
|
62
|
+
* describes the state-based execution process. History is discarded by
|
|
63
|
+
* the plugin's `messages.transform` hook — the LLM sees only the state.
|
|
64
|
+
*/
|
|
65
|
+
generateSkillMd(spec, statePath) {
|
|
66
|
+
const resolvedStatePath = statePath ?? './.skillstate.json';
|
|
67
|
+
return `---
|
|
68
|
+
name: ${JSON.stringify(spec.name)}
|
|
69
|
+
description: ${JSON.stringify(spec.instructions)}
|
|
70
|
+
version: ${spec.version}
|
|
71
|
+
execution_context:
|
|
72
|
+
state_path: ${resolvedStatePath}
|
|
73
|
+
format: json
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
# ${spec.name}
|
|
77
|
+
|
|
78
|
+
${spec.instructions}
|
|
79
|
+
|
|
80
|
+
## Execution Context
|
|
81
|
+
|
|
82
|
+
Your execution state is persisted at \`${resolvedStatePath}\`. Read it at the
|
|
83
|
+
start of every step to recover where you are — never rely on conversation
|
|
84
|
+
history to carry state between steps. History is automatically trimmed by the
|
|
85
|
+
plugin; only the current state and the latest observation matter.
|
|
86
|
+
|
|
87
|
+
## Process
|
|
88
|
+
|
|
89
|
+
1. Read the current state from the state file.
|
|
90
|
+
2. Observe the result of your last action.
|
|
91
|
+
3. Reason about what to do next, given the state and the observation.
|
|
92
|
+
4. Respond with a JSON block containing both your State Patch and your Action. The JSON block MUST have exactly these two keys:
|
|
93
|
+
|
|
94
|
+
\`\`\`json
|
|
95
|
+
{
|
|
96
|
+
"state_patch": { "key": "new_value", "obsolete_key": null },
|
|
97
|
+
"action": "next_action_name"
|
|
98
|
+
}
|
|
99
|
+
\`\`\`
|
|
100
|
+
|
|
101
|
+
- In \`state_patch\`, set keys to null to delete them. Only include fields you
|
|
102
|
+
want to change. Omit fields to leave them unchanged.
|
|
103
|
+
- \`action\` names what you will do next (e.g. "continue", "done").
|
|
104
|
+
- Reasoning is discarded after execution — put anything you need to persist
|
|
105
|
+
into \`state_patch\`.`;
|
|
106
|
+
}
|
|
107
|
+
generatePluginCode(statePathOrRef, options) {
|
|
108
|
+
const statePath = typeof statePathOrRef === 'string'
|
|
109
|
+
? statePathOrRef
|
|
110
|
+
: resolveStatePath(statePathOrRef.root, statePathOrRef.name);
|
|
111
|
+
const sp = JSON.stringify(statePath);
|
|
112
|
+
const maxHistory = options?.maxHistoryMessages ?? 3;
|
|
113
|
+
return `// OpenCode plugin generated by skillstate.
|
|
114
|
+
// Real O(1) prompt economy via experimental.chat.messages.transform:
|
|
115
|
+
// trims history to last ${maxHistory} non-system messages + injected state.
|
|
116
|
+
|
|
117
|
+
import { existsSync, readFileSync, writeFileSync } from "node:fs";
|
|
118
|
+
import type { Plugin } from "@opencode-ai/plugin";
|
|
119
|
+
|
|
120
|
+
const STATE_PATH = ${sp};
|
|
121
|
+
const MAX_HISTORY = ${maxHistory};
|
|
122
|
+
|
|
123
|
+
function readSkillState(): Record<string, unknown> {
|
|
124
|
+
try {
|
|
125
|
+
if (existsSync(STATE_PATH)) {
|
|
126
|
+
return JSON.parse(readFileSync(STATE_PATH, "utf-8"));
|
|
127
|
+
}
|
|
128
|
+
} catch {
|
|
129
|
+
// Corrupt or unreadable state file — fall back to empty state.
|
|
130
|
+
}
|
|
131
|
+
return {};
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
function saveSkillState(state: Record<string, unknown>): void {
|
|
135
|
+
try {
|
|
136
|
+
writeFileSync(STATE_PATH, JSON.stringify(state, null, 2));
|
|
137
|
+
} catch {
|
|
138
|
+
// Best-effort: read-only environments or permission issues.
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
function mergePatch(base: Record<string, unknown>, patch: Record<string, unknown>): Record<string, unknown> {
|
|
143
|
+
const result = { ...base };
|
|
144
|
+
for (const key of Object.keys(patch)) {
|
|
145
|
+
if (patch[key] === null) {
|
|
146
|
+
delete result[key];
|
|
147
|
+
} else if (
|
|
148
|
+
typeof patch[key] === "object" && patch[key] !== null &&
|
|
149
|
+
!Array.isArray(patch[key]) &&
|
|
150
|
+
typeof result[key] === "object" && result[key] !== null &&
|
|
151
|
+
!Array.isArray(result[key])
|
|
152
|
+
) {
|
|
153
|
+
result[key] = mergePatch(result[key] as Record<string, unknown>, patch[key] as Record<string, unknown>);
|
|
154
|
+
} else {
|
|
155
|
+
result[key] = patch[key];
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
return result;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
function extractPatch(response: string): Record<string, unknown> | null {
|
|
162
|
+
const match = response.match(/\`\`\`json\\s*\\n?([\\s\\S]*?)\\n?\\s*\`\`\`/);
|
|
163
|
+
if (!match) return null;
|
|
164
|
+
try {
|
|
165
|
+
const parsed = JSON.parse(match[1]);
|
|
166
|
+
if (parsed.state_patch && typeof parsed.state_patch === "object" && !Array.isArray(parsed.state_patch)) {
|
|
167
|
+
return parsed.state_patch;
|
|
168
|
+
}
|
|
169
|
+
} catch {
|
|
170
|
+
// Malformed JSON — ignore.
|
|
171
|
+
}
|
|
172
|
+
return null;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
export const SkillStatePlugin: Plugin = async ({ project, client, $ }) => {
|
|
176
|
+
return {
|
|
177
|
+
// ── O(1) history trimming ──────────────────────────────────────────
|
|
178
|
+
// Filters messages BEFORE each LLM call: keeps all system messages
|
|
179
|
+
// plus the last ${maxHistory} non-system messages, then injects a
|
|
180
|
+
// synthetic user message with the current state. This is real O(1):
|
|
181
|
+
// old messages are DROPPED from the prompt, not just hidden.
|
|
182
|
+
"experimental.chat.messages.transform": async (input, output) => {
|
|
183
|
+
const state = readSkillState();
|
|
184
|
+
const messages = output.messages ?? [];
|
|
185
|
+
const systemMessages = messages.filter((m) => m.role === "system");
|
|
186
|
+
const nonSystem = messages.filter((m) => m.role !== "system");
|
|
187
|
+
const trimmed = nonSystem.slice(-MAX_HISTORY);
|
|
188
|
+
|
|
189
|
+
const stateMessage = {
|
|
190
|
+
role: "user",
|
|
191
|
+
content: "Current skill state (JSON): " + JSON.stringify(state),
|
|
192
|
+
};
|
|
193
|
+
|
|
194
|
+
output.messages = [...systemMessages, ...trimmed, stateMessage];
|
|
195
|
+
return output;
|
|
196
|
+
},
|
|
197
|
+
|
|
198
|
+
// ── Compaction context injection ───────────────────────────────────
|
|
199
|
+
// Before compaction, inject the current state into the context so the
|
|
200
|
+
// compaction summary preserves state even after history is compressed.
|
|
201
|
+
"experimental.session.compacting": async (input, output) => {
|
|
202
|
+
const state = readSkillState();
|
|
203
|
+
const stateContext = "Skillstate: " + JSON.stringify(state);
|
|
204
|
+
if (!Array.isArray(output.context)) {
|
|
205
|
+
output.context = [];
|
|
206
|
+
}
|
|
207
|
+
output.context.push(stateContext);
|
|
208
|
+
return output;
|
|
209
|
+
},
|
|
210
|
+
|
|
211
|
+
// ── State persistence from LLM responses ───────────────────────────
|
|
212
|
+
// After tool execution, extract state_patch from the assistant's last
|
|
213
|
+
// response, merge it, and save to disk.
|
|
214
|
+
"tool.execute.after": async (input, output) => {
|
|
215
|
+
const response = output?.result ?? "";
|
|
216
|
+
if (typeof response === "string") {
|
|
217
|
+
const patch = extractPatch(response);
|
|
218
|
+
if (patch) {
|
|
219
|
+
const current = readSkillState();
|
|
220
|
+
const merged = mergePatch(current, patch);
|
|
221
|
+
saveSkillState(merged);
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
return output;
|
|
225
|
+
},
|
|
226
|
+
};
|
|
227
|
+
};
|
|
228
|
+
|
|
229
|
+
export default SkillStatePlugin;
|
|
230
|
+
`;
|
|
231
|
+
}
|
|
232
|
+
/**
|
|
233
|
+
* @non-paper additive helper: generate the plugin and persist it via
|
|
234
|
+
* `atomicWriteFile` (tmp + fsync + rename). Both the destination and the
|
|
235
|
+
* embedded state path accept raw strings (legacy behavior) or
|
|
236
|
+
* `{ root, name }` refs confined by `resolveStatePath`. Returns the
|
|
237
|
+
* absolute destination path.
|
|
238
|
+
*/
|
|
239
|
+
async savePluginCode(target, statePath, options) {
|
|
240
|
+
const dest = typeof target === 'string'
|
|
241
|
+
? target
|
|
242
|
+
: resolveStatePath(target.root, target.name);
|
|
243
|
+
const resolvedState = typeof statePath === 'string'
|
|
244
|
+
? statePath
|
|
245
|
+
: resolveStatePath(statePath.root, statePath.name);
|
|
246
|
+
const plugin = this.generatePluginCode(resolvedState, options);
|
|
247
|
+
await atomicWriteFile(dest, plugin);
|
|
248
|
+
return dest;
|
|
249
|
+
}
|
|
250
|
+
/* ------------------------------------------------------------------ */
|
|
251
|
+
/* Internal helpers */
|
|
252
|
+
/* ------------------------------------------------------------------ */
|
|
253
|
+
/**
|
|
254
|
+
* Describe the schema fields for inclusion in prompts.
|
|
255
|
+
*/
|
|
256
|
+
describeSchema(schema) {
|
|
257
|
+
const fields = Object.entries(schema)
|
|
258
|
+
.map(([name, field]) => `- ${name} (${field.type}): ${field.description ?? 'no description'}`)
|
|
259
|
+
.join('\n');
|
|
260
|
+
return `## Schema\n${fields}`;
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
//# sourceMappingURL=opencode-adapter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"opencode-adapter.js","sourceRoot":"","sources":["../src/opencode-adapter.ts"],"names":[],"mappings":"AAqBA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EACL,eAAe,EACf,gBAAgB,GACjB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IACzE,wEAAwE;IAExE;;OAEG;IACK,cAAc,CAAC,MAAgC;QACrD,MAAM,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC;aAClC,GAAG,CACF,CAAC,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE,EAAE,CAChB,KAAK,IAAI,KAAK,KAAK,CAAC,IAAI,MAAM,KAAK,CAAC,WAAW,IAAI,gBAAgB,EAAE,CACxE;aACA,IAAI,CAAC,IAAI,CAAC,CAAC;QACd,OAAO,cAAc,MAAM,EAAE,CAAC;IAChC,CAAC;CACF"}
|
package/package.json
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@skillstate/opencode",
|
|
3
|
+
"version": "2.0.0",
|
|
4
|
+
"description": "OpenCode platform adapter for the skillstate runtime.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"default": "./dist/index.js"
|
|
12
|
+
},
|
|
13
|
+
"./package.json": "./package.json"
|
|
14
|
+
},
|
|
15
|
+
"files": ["dist"],
|
|
16
|
+
"sideEffects": false,
|
|
17
|
+
"engines": {
|
|
18
|
+
"node": ">=20"
|
|
19
|
+
},
|
|
20
|
+
"license": "MIT",
|
|
21
|
+
"dependencies": {
|
|
22
|
+
"@skillstate/core": "^2.0.0"
|
|
23
|
+
}
|
|
24
|
+
}
|