loadouts 0.3.0 → 0.4.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/bundled/embedded/pi/loadouts-runtime.ts +6543 -1504
- package/bundled/extensions/loadouts-runtime/index.ts +6543 -1504
- package/bundled/loadouts/opencode-runtime.yaml +2 -4
- package/bundled/opencode/plugins/loadouts/index.js +39198 -0
- package/bundled/opencode/plugins/loadouts/package.json +9 -0
- package/bundled/{embedded/opencode/loadouts-runtime.tsx → opencode/plugins/loadouts/tui.js} +4008 -1556
- package/dist/builtins/agent-transforms.d.ts.map +1 -1
- package/dist/builtins/agent-transforms.js +31 -10
- package/dist/builtins/agent-transforms.js.map +1 -1
- package/dist/builtins/index.d.ts.map +1 -1
- package/dist/builtins/index.js +14 -5
- package/dist/builtins/index.js.map +1 -1
- package/dist/builtins/kinds/opencode-cli-config.d.ts +3 -0
- package/dist/builtins/kinds/opencode-cli-config.d.ts.map +1 -0
- package/dist/builtins/kinds/opencode-cli-config.js +10 -0
- package/dist/builtins/kinds/opencode-cli-config.js.map +1 -0
- package/dist/builtins/kinds/opencode-plugin-dir.d.ts +3 -0
- package/dist/builtins/kinds/opencode-plugin-dir.d.ts.map +1 -0
- package/dist/builtins/kinds/opencode-plugin-dir.js +11 -0
- package/dist/builtins/kinds/opencode-plugin-dir.js.map +1 -0
- package/dist/builtins/tools/opencode.d.ts.map +1 -1
- package/dist/builtins/tools/opencode.js +10 -7
- package/dist/builtins/tools/opencode.js.map +1 -1
- package/dist/cli/commands/activate.d.ts.map +1 -1
- package/dist/cli/commands/activate.js +0 -7
- package/dist/cli/commands/activate.js.map +1 -1
- package/dist/cli/commands/session.d.ts +3 -0
- package/dist/cli/commands/session.d.ts.map +1 -0
- package/dist/cli/commands/session.js +68 -0
- package/dist/cli/commands/session.js.map +1 -0
- package/dist/cli/commands/status.js +1 -1
- package/dist/cli/commands/status.js.map +1 -1
- package/dist/cli/commands/sync.d.ts.map +1 -1
- package/dist/cli/commands/sync.js +5 -5
- package/dist/cli/commands/sync.js.map +1 -1
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +2 -0
- package/dist/cli/index.js.map +1 -1
- package/dist/core/discovery.js +1 -1
- package/dist/core/discovery.js.map +1 -1
- package/dist/core/import-discovery.d.ts.map +1 -1
- package/dist/core/import-discovery.js +2 -0
- package/dist/core/import-discovery.js.map +1 -1
- package/dist/core/registry.d.ts +5 -0
- package/dist/core/registry.d.ts.map +1 -1
- package/dist/core/registry.js.map +1 -1
- package/dist/core/render.d.ts.map +1 -1
- package/dist/core/render.js +29 -1
- package/dist/core/render.js.map +1 -1
- package/dist/core/resolve.d.ts.map +1 -1
- package/dist/core/resolve.js +1 -0
- package/dist/core/resolve.js.map +1 -1
- package/dist/core/runtime.d.ts +4 -0
- package/dist/core/runtime.d.ts.map +1 -1
- package/dist/core/runtime.js +10 -3
- package/dist/core/runtime.js.map +1 -1
- package/dist/core/schema.d.ts +59 -0
- package/dist/core/schema.d.ts.map +1 -1
- package/dist/core/schema.js +5 -0
- package/dist/core/schema.js.map +1 -1
- package/dist/core/types.d.ts +13 -0
- package/dist/core/types.d.ts.map +1 -1
- package/dist/integrations/opencode/advertisement.d.ts +7 -0
- package/dist/integrations/opencode/advertisement.d.ts.map +1 -0
- package/dist/integrations/opencode/advertisement.js +17 -0
- package/dist/integrations/opencode/advertisement.js.map +1 -0
- package/dist/integrations/opencode/client.d.ts +12 -0
- package/dist/integrations/opencode/client.d.ts.map +1 -0
- package/dist/integrations/opencode/client.js +48 -0
- package/dist/integrations/opencode/client.js.map +1 -0
- package/dist/integrations/opencode/command.d.ts +11 -0
- package/dist/integrations/opencode/command.d.ts.map +1 -0
- package/dist/integrations/opencode/command.js +19 -0
- package/dist/integrations/opencode/command.js.map +1 -0
- package/dist/integrations/opencode/delta.d.ts +15 -0
- package/dist/integrations/opencode/delta.d.ts.map +1 -0
- package/dist/integrations/opencode/delta.js +75 -0
- package/dist/integrations/opencode/delta.js.map +1 -0
- package/dist/integrations/opencode/session.d.ts +207 -0
- package/dist/integrations/opencode/session.d.ts.map +1 -0
- package/dist/integrations/opencode/session.js +201 -0
- package/dist/integrations/opencode/session.js.map +1 -0
- package/dist/lib/gitignore.d.ts +7 -3
- package/dist/lib/gitignore.d.ts.map +1 -1
- package/dist/lib/gitignore.js +15 -7
- package/dist/lib/gitignore.js.map +1 -1
- package/dist/tui/core/actions.d.ts +3 -4
- package/dist/tui/core/actions.d.ts.map +1 -1
- package/dist/tui/core/actions.js +21 -15
- package/dist/tui/core/actions.js.map +1 -1
- package/dist/tui/core/controller.d.ts +28 -0
- package/dist/tui/core/controller.d.ts.map +1 -0
- package/dist/tui/core/controller.js +78 -0
- package/dist/tui/core/controller.js.map +1 -0
- package/dist/tui/core/data.d.ts +4 -2
- package/dist/tui/core/data.d.ts.map +1 -1
- package/dist/tui/core/data.js +14 -3
- package/dist/tui/core/data.js.map +1 -1
- package/dist/tui/core/host.d.ts +5 -11
- package/dist/tui/core/host.d.ts.map +1 -1
- package/dist/tui/core/intent.d.ts +18 -3
- package/dist/tui/core/intent.d.ts.map +1 -1
- package/dist/tui/core/keymap.d.ts +2 -1
- package/dist/tui/core/keymap.d.ts.map +1 -1
- package/dist/tui/core/keymap.js +38 -6
- package/dist/tui/core/keymap.js.map +1 -1
- package/dist/tui/core/model.d.ts +18 -6
- package/dist/tui/core/model.d.ts.map +1 -1
- package/dist/tui/core/model.js +4 -3
- package/dist/tui/core/model.js.map +1 -1
- package/dist/tui/core/selection.d.ts +12 -0
- package/dist/tui/core/selection.d.ts.map +1 -0
- package/dist/tui/core/selection.js +42 -0
- package/dist/tui/core/selection.js.map +1 -0
- package/dist/tui/core/update.d.ts.map +1 -1
- package/dist/tui/core/update.js +140 -126
- package/dist/tui/core/update.js.map +1 -1
- package/dist/tui/core/view.d.ts.map +1 -1
- package/dist/tui/core/view.js +43 -31
- package/dist/tui/core/view.js.map +1 -1
- package/dist/tui/core/viewport.d.ts +5 -0
- package/dist/tui/core/viewport.d.ts.map +1 -0
- package/dist/tui/core/viewport.js +33 -0
- package/dist/tui/core/viewport.js.map +1 -0
- package/dist/tui/core/viewspec.d.ts +5 -0
- package/dist/tui/core/viewspec.d.ts.map +1 -1
- package/dist/tui/hosts/pi/embed-entry.d.ts.map +1 -1
- package/dist/tui/hosts/pi/embed-entry.js +74 -197
- package/dist/tui/hosts/pi/embed-entry.js.map +1 -1
- package/dist/tui/hosts/pi/inject.d.ts +46 -29
- package/dist/tui/hosts/pi/inject.d.ts.map +1 -1
- package/dist/tui/hosts/pi/inject.js +25 -47
- package/dist/tui/hosts/pi/inject.js.map +1 -1
- package/dist/tui/hosts/standalone.d.ts.map +1 -1
- package/dist/tui/hosts/standalone.js +75 -111
- package/dist/tui/hosts/standalone.js.map +1 -1
- package/dist/tui/skins/pi-tui/input.js +4 -0
- package/dist/tui/skins/pi-tui/input.js.map +1 -1
- package/dist/tui/skins/pi-tui/render.d.ts +6 -3
- package/dist/tui/skins/pi-tui/render.d.ts.map +1 -1
- package/dist/tui/skins/pi-tui/render.js +32 -24
- package/dist/tui/skins/pi-tui/render.js.map +1 -1
- package/docs/archive/opencode-v2-runtime-beta-18707.md +813 -0
- package/docs/authoring.md +47 -44
- package/docs/commands.md +21 -1
- package/docs/compatibility.md +2 -2
- package/docs/concepts.md +2 -2
- package/docs/opencode-v2-probes.md +253 -0
- package/docs/opencode-v2-runtime.md +129 -0
- package/docs/registry.md +1366 -0
- package/docs/runtime.md +112 -82
- package/docs/troubleshooting.md +17 -15
- package/docs/tui-architecture.md +10 -8
- package/package.json +12 -7
- package/bundled/opencode/commands/loadouts.md +0 -3
- package/bundled/opencode/plugins/loadouts-runtime-tui.tsx +0 -14461
- package/bundled/opencode/plugins/loadouts-runtime.ts +0 -533
- package/bundled/opencode/tui.jsonc +0 -5
- package/dist/builtins/kinds/opencode-tui-config.d.ts +0 -3
- package/dist/builtins/kinds/opencode-tui-config.d.ts.map +0 -1
- package/dist/builtins/kinds/opencode-tui-config.js +0 -8
- package/dist/builtins/kinds/opencode-tui-config.js.map +0 -1
- package/dist/integrations/opencode-runtime/bridge.d.ts +0 -17
- package/dist/integrations/opencode-runtime/bridge.d.ts.map +0 -1
- package/dist/integrations/opencode-runtime/bridge.js +0 -60
- package/dist/integrations/opencode-runtime/bridge.js.map +0 -1
- package/dist/integrations/opencode-runtime/command.d.ts +0 -4
- package/dist/integrations/opencode-runtime/command.d.ts.map +0 -1
- package/dist/integrations/opencode-runtime/command.js +0 -200
- package/dist/integrations/opencode-runtime/command.js.map +0 -1
- package/dist/integrations/opencode-runtime/index.d.ts +0 -6
- package/dist/integrations/opencode-runtime/index.d.ts.map +0 -1
- package/dist/integrations/opencode-runtime/index.js +0 -5
- package/dist/integrations/opencode-runtime/index.js.map +0 -1
- package/dist/integrations/opencode-runtime/plugin.d.ts +0 -59
- package/dist/integrations/opencode-runtime/plugin.d.ts.map +0 -1
- package/dist/integrations/opencode-runtime/plugin.js +0 -238
- package/dist/integrations/opencode-runtime/plugin.js.map +0 -1
- package/dist/integrations/opencode-runtime/state.d.ts +0 -8
- package/dist/integrations/opencode-runtime/state.d.ts.map +0 -1
- package/dist/integrations/opencode-runtime/state.js +0 -27
- package/dist/integrations/opencode-runtime/state.js.map +0 -1
- package/dist/integrations/opencode-runtime/types.d.ts +0 -38
- package/dist/integrations/opencode-runtime/types.d.ts.map +0 -1
- package/dist/integrations/opencode-runtime/types.js +0 -2
- package/dist/integrations/opencode-runtime/types.js.map +0 -1
- package/dist/tui/hosts/_probe/embed-entry.d.ts +0 -5
- package/dist/tui/hosts/_probe/embed-entry.d.ts.map +0 -1
- package/dist/tui/hosts/_probe/embed-entry.js +0 -8
- package/dist/tui/hosts/_probe/embed-entry.js.map +0 -1
|
@@ -1,533 +0,0 @@
|
|
|
1
|
-
import crypto from "node:crypto";
|
|
2
|
-
import fs from "node:fs";
|
|
3
|
-
import os from "node:os";
|
|
4
|
-
import path from "node:path";
|
|
5
|
-
import { spawn } from "node:child_process";
|
|
6
|
-
|
|
7
|
-
type RuntimeScope = "local" | "global";
|
|
8
|
-
|
|
9
|
-
type RuntimeBundle = {
|
|
10
|
-
fingerprint: string;
|
|
11
|
-
injection: {
|
|
12
|
-
instructions: Array<{ relativePath: string; content: string }>;
|
|
13
|
-
rules: Array<{ relativePath: string; content: string }>;
|
|
14
|
-
skills: Array<{ name: string; description?: string; path: string; sourcePath: string }>;
|
|
15
|
-
};
|
|
16
|
-
capabilities: {
|
|
17
|
-
runtimeMode: string;
|
|
18
|
-
modelInjection: { instructions: boolean; rules: boolean };
|
|
19
|
-
skillPathDiscovery: boolean;
|
|
20
|
-
nativeSkillHotSwap: boolean;
|
|
21
|
-
};
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
type RuntimeState = {
|
|
25
|
-
activeNames: string[];
|
|
26
|
-
bundle: RuntimeBundle;
|
|
27
|
-
systemBlock: string;
|
|
28
|
-
activatedAt: string;
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
type RuntimeUiEvent = {
|
|
32
|
-
id: string;
|
|
33
|
-
sessionID: string;
|
|
34
|
-
title: string;
|
|
35
|
-
message: string;
|
|
36
|
-
variant: "info" | "success" | "error";
|
|
37
|
-
createdAt: string;
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
type OpenCodeClient = {
|
|
41
|
-
tui?: {
|
|
42
|
-
showToast?: (input: {
|
|
43
|
-
directory?: string;
|
|
44
|
-
title?: string;
|
|
45
|
-
message: string;
|
|
46
|
-
variant: "info" | "success" | "warning" | "error";
|
|
47
|
-
duration?: number;
|
|
48
|
-
}) => Promise<unknown> | unknown;
|
|
49
|
-
};
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
type OpenCodeConfigInput = {
|
|
53
|
-
command?: Record<string, { description?: string; template: string }>;
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
const DEFAULT_TOAST_DURATION_MS = 5000;
|
|
57
|
-
const MAX_TOAST_DURATION_MS = 3_600_000;
|
|
58
|
-
|
|
59
|
-
class LoadoutsRuntimeCommandHandledError extends Error {
|
|
60
|
-
constructor(message: string) {
|
|
61
|
-
super(message);
|
|
62
|
-
this.name = "LoadoutsRuntimeCommandHandledError";
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
const sessions = new Map<string, RuntimeState>();
|
|
67
|
-
|
|
68
|
-
const aliases: Record<string, string> = {
|
|
69
|
-
"": "help",
|
|
70
|
-
status: "status",
|
|
71
|
-
s: "status",
|
|
72
|
-
activate: "activate",
|
|
73
|
-
a: "activate",
|
|
74
|
-
use: "activate",
|
|
75
|
-
deactivate: "deactivate",
|
|
76
|
-
d: "deactivate",
|
|
77
|
-
remove: "deactivate",
|
|
78
|
-
rm: "deactivate",
|
|
79
|
-
clear: "deactivate",
|
|
80
|
-
list: "list",
|
|
81
|
-
ls: "list",
|
|
82
|
-
info: "info",
|
|
83
|
-
i: "info",
|
|
84
|
-
show: "show",
|
|
85
|
-
"system-block": "system-block",
|
|
86
|
-
help: "help",
|
|
87
|
-
"-h": "help",
|
|
88
|
-
"--help": "help",
|
|
89
|
-
};
|
|
90
|
-
|
|
91
|
-
function tokenize(text: string): string[] {
|
|
92
|
-
const tokens: string[] = [];
|
|
93
|
-
let current = "";
|
|
94
|
-
let quote: string | undefined;
|
|
95
|
-
|
|
96
|
-
for (let i = 0; i < text.length; i += 1) {
|
|
97
|
-
const ch = text[i];
|
|
98
|
-
if (quote) {
|
|
99
|
-
if (ch === "\\" && i + 1 < text.length) {
|
|
100
|
-
current += text[i + 1];
|
|
101
|
-
i += 1;
|
|
102
|
-
continue;
|
|
103
|
-
}
|
|
104
|
-
if (ch === quote) {
|
|
105
|
-
quote = undefined;
|
|
106
|
-
continue;
|
|
107
|
-
}
|
|
108
|
-
current += ch;
|
|
109
|
-
continue;
|
|
110
|
-
}
|
|
111
|
-
if (ch === "'" || ch === '"') {
|
|
112
|
-
quote = ch;
|
|
113
|
-
continue;
|
|
114
|
-
}
|
|
115
|
-
if (/\s/.test(ch)) {
|
|
116
|
-
if (current) tokens.push(current);
|
|
117
|
-
current = "";
|
|
118
|
-
continue;
|
|
119
|
-
}
|
|
120
|
-
current += ch;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
if (current) tokens.push(current);
|
|
124
|
-
return tokens;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
function parseArgs(argumentsText: string): { action: string; names: string[]; scope: RuntimeScope } {
|
|
128
|
-
const tokens = tokenize(argumentsText.trim());
|
|
129
|
-
if (tokens[0] === "/loadouts" || tokens[0] === "loadouts") {
|
|
130
|
-
tokens.shift();
|
|
131
|
-
}
|
|
132
|
-
const action = aliases[(tokens.shift() ?? "").toLowerCase()];
|
|
133
|
-
if (!action) throw new Error(`unknown /loadouts command: ${argumentsText || "(empty)"}`);
|
|
134
|
-
|
|
135
|
-
let local = false;
|
|
136
|
-
let global = false;
|
|
137
|
-
const names: string[] = [];
|
|
138
|
-
for (const token of tokens) {
|
|
139
|
-
if (token === "-l" || token === "--local") {
|
|
140
|
-
local = true;
|
|
141
|
-
continue;
|
|
142
|
-
}
|
|
143
|
-
if (token === "-g" || token === "--global") {
|
|
144
|
-
global = true;
|
|
145
|
-
continue;
|
|
146
|
-
}
|
|
147
|
-
names.push(token);
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
if (local && global) throw new Error("use either --local or --global, not both");
|
|
151
|
-
if ((local || global) && !["activate", "list", "info"].includes(action)) {
|
|
152
|
-
throw new Error("scope flags are only supported for activate, list, and info");
|
|
153
|
-
}
|
|
154
|
-
if (action === "activate" && names.length === 0) {
|
|
155
|
-
throw new Error("activate requires at least one loadout name");
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
return { action, names, scope: global ? "global" : "local" };
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
function scopeFlag(scope: RuntimeScope): string {
|
|
162
|
-
return scope === "global" ? "--global" : "--local";
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
function shortFingerprint(fingerprint: string): string {
|
|
166
|
-
return fingerprint.replace(/^sha256:/, "").slice(0, 12);
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
function execLoadouts(args: string[], cwd: string): Promise<string> {
|
|
170
|
-
return new Promise((resolve, reject) => {
|
|
171
|
-
const child = spawn("loadouts", args, { cwd, stdio: ["ignore", "pipe", "pipe"] });
|
|
172
|
-
let stdout = "";
|
|
173
|
-
let stderr = "";
|
|
174
|
-
child.stdout.setEncoding("utf-8");
|
|
175
|
-
child.stderr.setEncoding("utf-8");
|
|
176
|
-
child.stdout.on("data", (chunk: string) => {
|
|
177
|
-
stdout += chunk;
|
|
178
|
-
});
|
|
179
|
-
child.stderr.on("data", (chunk: string) => {
|
|
180
|
-
stderr += chunk;
|
|
181
|
-
});
|
|
182
|
-
child.on("error", reject);
|
|
183
|
-
child.on("close", (code) => {
|
|
184
|
-
if (code === 0) resolve(stdout);
|
|
185
|
-
else reject(new Error((stderr || stdout || `loadouts exited with ${code}`).trim()));
|
|
186
|
-
});
|
|
187
|
-
});
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
function renderSystemBlock(bundle: RuntimeBundle): string {
|
|
191
|
-
const lines: string[] = [];
|
|
192
|
-
lines.push("[loadout-runtime:v1]");
|
|
193
|
-
lines.push(`fingerprint: ${bundle.fingerprint}`);
|
|
194
|
-
lines.push(
|
|
195
|
-
`capabilities: mode=${bundle.capabilities.runtimeMode}, instructionInjection=${bundle.capabilities.modelInjection.instructions}, ruleInjection=${bundle.capabilities.modelInjection.rules}, skillPathDiscovery=${bundle.capabilities.skillPathDiscovery}, nativeSkillHotSwap=${bundle.capabilities.nativeSkillHotSwap}`
|
|
196
|
-
);
|
|
197
|
-
lines.push("");
|
|
198
|
-
lines.push("## Instructions (Model Injection Ready)");
|
|
199
|
-
for (const item of bundle.injection.instructions) {
|
|
200
|
-
lines.push(`### ${item.relativePath}`);
|
|
201
|
-
lines.push(item.content);
|
|
202
|
-
lines.push("");
|
|
203
|
-
}
|
|
204
|
-
if (bundle.injection.instructions.length === 0) lines.push("(none)");
|
|
205
|
-
lines.push("## Rules (Model Injection Ready)");
|
|
206
|
-
for (const item of bundle.injection.rules) {
|
|
207
|
-
lines.push(`### ${item.relativePath}`);
|
|
208
|
-
lines.push(item.content);
|
|
209
|
-
lines.push("");
|
|
210
|
-
}
|
|
211
|
-
if (bundle.injection.rules.length === 0) lines.push("(none)");
|
|
212
|
-
lines.push("## Skills (Path Discovery Only)");
|
|
213
|
-
lines.push("Native skill hot-swap is disabled in runtime v1.");
|
|
214
|
-
for (const skill of bundle.injection.skills) {
|
|
215
|
-
const description = skill.description ? ` - ${skill.description}` : "";
|
|
216
|
-
lines.push(`- ${skill.name}${description}`);
|
|
217
|
-
lines.push(` path: ${skill.path}`);
|
|
218
|
-
lines.push(` sourcePath: ${skill.sourcePath}`);
|
|
219
|
-
}
|
|
220
|
-
if (bundle.injection.skills.length === 0) lines.push("(none)");
|
|
221
|
-
return lines.join("\n").trimEnd() + "\n";
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
async function activate(names: string[], scope: RuntimeScope, sessionID: string, cwd: string): Promise<string> {
|
|
225
|
-
const json = await execLoadouts(["runtime", ...names, "--tool", "opencode", "--json", scopeFlag(scope)], cwd);
|
|
226
|
-
const bundle = JSON.parse(json) as RuntimeBundle;
|
|
227
|
-
sessions.set(sessionID, {
|
|
228
|
-
activeNames: names,
|
|
229
|
-
bundle,
|
|
230
|
-
systemBlock: renderSystemBlock(bundle),
|
|
231
|
-
activatedAt: new Date().toISOString(),
|
|
232
|
-
});
|
|
233
|
-
return `runtime: activated (${scope}) ${names.join(", ")} [${shortFingerprint(bundle.fingerprint)}]`;
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
function pluralize(count: number, singular: string, plural = `${singular}s`): string {
|
|
237
|
-
return `${count} ${count === 1 ? singular : plural}`;
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
function runtimeActivationToast(state: RuntimeState | undefined): string | undefined {
|
|
241
|
-
if (!state) return undefined;
|
|
242
|
-
const injected = state.bundle.injection;
|
|
243
|
-
return [
|
|
244
|
-
`Loaded ${state.activeNames.join(", ")}`,
|
|
245
|
-
`Injected: ${pluralize(injected.instructions.length, "instruction")}, ${pluralize(injected.rules.length, "rule")}, ${pluralize(injected.skills.length, "skill")}`,
|
|
246
|
-
`Fingerprint: ${shortFingerprint(state.bundle.fingerprint)}`,
|
|
247
|
-
].join("\n");
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
function runtimeToastVariant(action: string): "info" | "success" {
|
|
251
|
-
return action === "activate" || action === "deactivate" ? "success" : "info";
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
function runtimeEventTitle(action: string, variant: "info" | "success" | "error"): string {
|
|
255
|
-
if (variant === "error") return "Loadouts Error";
|
|
256
|
-
if (action === "activate") return "Loadouts Activated";
|
|
257
|
-
if (action === "deactivate") return "Loadouts Deactivated";
|
|
258
|
-
if (action === "list") return "Loadouts List";
|
|
259
|
-
if (action === "info") return "Loadouts Info";
|
|
260
|
-
if (action === "help") return "Loadouts Help";
|
|
261
|
-
return "Loadouts Runtime";
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
function helpText(): string {
|
|
265
|
-
return [
|
|
266
|
-
"runtime commands:",
|
|
267
|
-
" (empty|help|-h|--help)",
|
|
268
|
-
" status|s",
|
|
269
|
-
" activate|a|use <names...> [-l|--local|-g|--global]",
|
|
270
|
-
" deactivate|d|remove|rm|clear",
|
|
271
|
-
" list|ls [-l|--local|-g|--global]",
|
|
272
|
-
" info|i [names...] [-l|--local|-g|--global]",
|
|
273
|
-
" show",
|
|
274
|
-
" system-block",
|
|
275
|
-
].join("\n");
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
function parseToastDuration(value: unknown): number | undefined {
|
|
279
|
-
if (typeof value !== "number") return undefined;
|
|
280
|
-
if (!Number.isFinite(value) || value < 0) return undefined;
|
|
281
|
-
return Math.min(value, MAX_TOAST_DURATION_MS);
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
function parseToastDurationFromEnv(value: string | undefined): number | undefined {
|
|
285
|
-
if (value === undefined) return undefined;
|
|
286
|
-
const trimmed = value.trim();
|
|
287
|
-
if (trimmed.length === 0) return undefined;
|
|
288
|
-
return parseToastDuration(Number(trimmed));
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
function resolveToastDuration(runtimeOptions?: Record<string, unknown>): number {
|
|
292
|
-
const fromRuntime = parseToastDuration(runtimeOptions?.toastDuration);
|
|
293
|
-
if (fromRuntime !== undefined) return fromRuntime;
|
|
294
|
-
|
|
295
|
-
const fromEnv = parseToastDurationFromEnv(process.env.LOADOUTS_OPENCODE_TOAST_DURATION);
|
|
296
|
-
if (fromEnv !== undefined) return fromEnv;
|
|
297
|
-
|
|
298
|
-
return DEFAULT_TOAST_DURATION_MS;
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
async function handle(
|
|
302
|
-
argumentsText: string,
|
|
303
|
-
sessionID: string,
|
|
304
|
-
cwd: string
|
|
305
|
-
): Promise<{ action: string; text: string }> {
|
|
306
|
-
const command = parseArgs(argumentsText);
|
|
307
|
-
const state = sessions.get(sessionID);
|
|
308
|
-
|
|
309
|
-
if (command.action === "help") {
|
|
310
|
-
return {
|
|
311
|
-
action: command.action,
|
|
312
|
-
text: helpText(),
|
|
313
|
-
};
|
|
314
|
-
}
|
|
315
|
-
if (command.action === "activate") {
|
|
316
|
-
return {
|
|
317
|
-
action: command.action,
|
|
318
|
-
text: await activate(command.names, command.scope, sessionID, cwd),
|
|
319
|
-
};
|
|
320
|
-
}
|
|
321
|
-
if (command.action === "deactivate") {
|
|
322
|
-
return {
|
|
323
|
-
action: command.action,
|
|
324
|
-
text: sessions.delete(sessionID) ? "runtime: deactivated" : "runtime: already inactive",
|
|
325
|
-
};
|
|
326
|
-
}
|
|
327
|
-
if (command.action === "list") {
|
|
328
|
-
return { action: command.action, text: (await execLoadouts(["list", scopeFlag(command.scope)], cwd)).trim() };
|
|
329
|
-
}
|
|
330
|
-
if (command.action === "info") {
|
|
331
|
-
return {
|
|
332
|
-
action: command.action,
|
|
333
|
-
text: (await execLoadouts(["info", ...command.names, scopeFlag(command.scope)], cwd)).trim(),
|
|
334
|
-
};
|
|
335
|
-
}
|
|
336
|
-
if (command.action === "status") {
|
|
337
|
-
return {
|
|
338
|
-
action: command.action,
|
|
339
|
-
text: state
|
|
340
|
-
? `runtime: active ${state.activeNames.join(", ")} [${shortFingerprint(state.bundle.fingerprint)}]`
|
|
341
|
-
: "runtime: inactive",
|
|
342
|
-
};
|
|
343
|
-
}
|
|
344
|
-
if (command.action === "show") {
|
|
345
|
-
if (!state) return { action: command.action, text: "runtime: inactive" };
|
|
346
|
-
const injected = state.bundle.injection;
|
|
347
|
-
return {
|
|
348
|
-
action: command.action,
|
|
349
|
-
text: [
|
|
350
|
-
"runtime: active",
|
|
351
|
-
`loadouts: ${state.activeNames.join(", ")}`,
|
|
352
|
-
`fingerprint: ${state.bundle.fingerprint}`,
|
|
353
|
-
`injected: instructions=${injected.instructions.length}, rules=${injected.rules.length}, skills=${injected.skills.length}`,
|
|
354
|
-
`activatedAt: ${state.activatedAt}`,
|
|
355
|
-
].join("\n"),
|
|
356
|
-
};
|
|
357
|
-
}
|
|
358
|
-
if (command.action === "system-block") {
|
|
359
|
-
return {
|
|
360
|
-
action: command.action,
|
|
361
|
-
text: state?.systemBlock ?? "runtime: inactive",
|
|
362
|
-
};
|
|
363
|
-
}
|
|
364
|
-
return { action: command.action, text: "runtime: unsupported command" };
|
|
365
|
-
}
|
|
366
|
-
|
|
367
|
-
async function showRuntimeToast(
|
|
368
|
-
client: OpenCodeClient | undefined,
|
|
369
|
-
directory: string,
|
|
370
|
-
message: string,
|
|
371
|
-
variant: "info" | "success" | "error",
|
|
372
|
-
duration: number
|
|
373
|
-
): Promise<void> {
|
|
374
|
-
if (duration === 0) return;
|
|
375
|
-
|
|
376
|
-
const showToast = client?.tui?.showToast;
|
|
377
|
-
if (!showToast) return;
|
|
378
|
-
|
|
379
|
-
try {
|
|
380
|
-
await showToast({
|
|
381
|
-
directory,
|
|
382
|
-
title: "Loadouts",
|
|
383
|
-
message,
|
|
384
|
-
variant,
|
|
385
|
-
duration,
|
|
386
|
-
});
|
|
387
|
-
} catch {
|
|
388
|
-
// Toast delivery is best-effort; command consumption should not depend on TUI availability.
|
|
389
|
-
}
|
|
390
|
-
}
|
|
391
|
-
|
|
392
|
-
function runtimeStatePath(cwd: string): string {
|
|
393
|
-
const cacheRoot = process.env.XDG_CACHE_HOME || path.join(os.homedir(), ".cache");
|
|
394
|
-
const key = crypto.createHash("sha256").update(path.resolve(cwd)).digest("hex").slice(0, 32);
|
|
395
|
-
return path.join(cacheRoot, "loadouts", "opencode-runtime", `${key}.json`);
|
|
396
|
-
}
|
|
397
|
-
|
|
398
|
-
function runtimeEventPath(cwd: string): string {
|
|
399
|
-
const cacheRoot = process.env.XDG_CACHE_HOME || path.join(os.homedir(), ".cache");
|
|
400
|
-
const key = crypto.createHash("sha256").update(path.resolve(cwd)).digest("hex").slice(0, 32);
|
|
401
|
-
return path.join(cacheRoot, "loadouts", "opencode-runtime", `${key}.event.json`);
|
|
402
|
-
}
|
|
403
|
-
|
|
404
|
-
function readPersistedStates(cwd: string): Record<string, RuntimeState> {
|
|
405
|
-
try {
|
|
406
|
-
const file = runtimeStatePath(cwd);
|
|
407
|
-
if (!fs.existsSync(file)) return {};
|
|
408
|
-
return JSON.parse(fs.readFileSync(file, "utf-8")) as Record<string, RuntimeState>;
|
|
409
|
-
} catch {
|
|
410
|
-
return {};
|
|
411
|
-
}
|
|
412
|
-
}
|
|
413
|
-
|
|
414
|
-
function loadPersistedRuntimeState(cwd: string, sessionID: string): void {
|
|
415
|
-
if (sessions.has(sessionID)) return;
|
|
416
|
-
const state = readPersistedStates(cwd)[sessionID];
|
|
417
|
-
if (state) sessions.set(sessionID, state);
|
|
418
|
-
}
|
|
419
|
-
|
|
420
|
-
function persistRuntimeState(cwd: string, sessionID: string): void {
|
|
421
|
-
try {
|
|
422
|
-
const file = runtimeStatePath(cwd);
|
|
423
|
-
const states = readPersistedStates(cwd);
|
|
424
|
-
const state = sessions.get(sessionID);
|
|
425
|
-
if (state) states[sessionID] = state;
|
|
426
|
-
else delete states[sessionID];
|
|
427
|
-
|
|
428
|
-
fs.mkdirSync(path.dirname(file), { recursive: true });
|
|
429
|
-
fs.writeFileSync(file, JSON.stringify(states, null, 2), "utf-8");
|
|
430
|
-
} catch {
|
|
431
|
-
// The in-memory runtime still works inside a long-lived OpenCode process.
|
|
432
|
-
}
|
|
433
|
-
}
|
|
434
|
-
|
|
435
|
-
function readRuntimeUiEvents(cwd: string): Record<string, RuntimeUiEvent> {
|
|
436
|
-
try {
|
|
437
|
-
const file = runtimeEventPath(cwd);
|
|
438
|
-
if (!fs.existsSync(file)) return {};
|
|
439
|
-
return JSON.parse(fs.readFileSync(file, "utf-8")) as Record<string, RuntimeUiEvent>;
|
|
440
|
-
} catch {
|
|
441
|
-
return {};
|
|
442
|
-
}
|
|
443
|
-
}
|
|
444
|
-
|
|
445
|
-
function persistRuntimeUiEvent(
|
|
446
|
-
cwd: string,
|
|
447
|
-
sessionID: string,
|
|
448
|
-
title: string,
|
|
449
|
-
message: string,
|
|
450
|
-
variant: "info" | "success" | "error"
|
|
451
|
-
): void {
|
|
452
|
-
try {
|
|
453
|
-
const file = runtimeEventPath(cwd);
|
|
454
|
-
const events = readRuntimeUiEvents(cwd);
|
|
455
|
-
events[sessionID] = {
|
|
456
|
-
id: `${Date.now()}-${Math.random().toString(36).slice(2)}`,
|
|
457
|
-
sessionID,
|
|
458
|
-
title,
|
|
459
|
-
message,
|
|
460
|
-
variant,
|
|
461
|
-
createdAt: new Date().toISOString(),
|
|
462
|
-
};
|
|
463
|
-
fs.mkdirSync(path.dirname(file), { recursive: true });
|
|
464
|
-
fs.writeFileSync(file, JSON.stringify(events, null, 2), "utf-8");
|
|
465
|
-
} catch {
|
|
466
|
-
// TUI event delivery is best-effort and should not affect runtime injection.
|
|
467
|
-
}
|
|
468
|
-
}
|
|
469
|
-
|
|
470
|
-
export const LoadoutsRuntimePlugin = async ({
|
|
471
|
-
directory,
|
|
472
|
-
worktree,
|
|
473
|
-
client,
|
|
474
|
-
}: {
|
|
475
|
-
directory: string;
|
|
476
|
-
worktree: string;
|
|
477
|
-
client?: OpenCodeClient;
|
|
478
|
-
},
|
|
479
|
-
runtimeOptions?: Record<string, unknown>) => {
|
|
480
|
-
const toastDuration = resolveToastDuration(runtimeOptions);
|
|
481
|
-
|
|
482
|
-
return {
|
|
483
|
-
config: async (config: OpenCodeConfigInput) => {
|
|
484
|
-
config.command ??= {};
|
|
485
|
-
config.command.loadouts = {
|
|
486
|
-
description: "Manage session-local Loadouts runtime activation",
|
|
487
|
-
template: "",
|
|
488
|
-
};
|
|
489
|
-
},
|
|
490
|
-
|
|
491
|
-
"command.execute.before": async (
|
|
492
|
-
input: { command: string; sessionID: string; arguments: string },
|
|
493
|
-
output: { parts: Array<{ type: "text"; text: string }> }
|
|
494
|
-
) => {
|
|
495
|
-
if (input.command !== "loadouts") return;
|
|
496
|
-
const cwd = directory || worktree || process.cwd();
|
|
497
|
-
loadPersistedRuntimeState(cwd, input.sessionID);
|
|
498
|
-
try {
|
|
499
|
-
const result = await handle(input.arguments, input.sessionID, cwd);
|
|
500
|
-
output.parts = [];
|
|
501
|
-
persistRuntimeState(cwd, input.sessionID);
|
|
502
|
-
const state = sessions.get(input.sessionID);
|
|
503
|
-
const toastMessage =
|
|
504
|
-
result.action === "activate" ? runtimeActivationToast(state) ?? result.text : result.text;
|
|
505
|
-
const variant = runtimeToastVariant(result.action);
|
|
506
|
-
persistRuntimeUiEvent(cwd, input.sessionID, runtimeEventTitle(result.action, variant), toastMessage, variant);
|
|
507
|
-
await showRuntimeToast(client, cwd, toastMessage, variant, toastDuration);
|
|
508
|
-
throw new LoadoutsRuntimeCommandHandledError(result.text);
|
|
509
|
-
} catch (error) {
|
|
510
|
-
if (error instanceof LoadoutsRuntimeCommandHandledError) throw error;
|
|
511
|
-
|
|
512
|
-
const text = `runtime: error: ${error instanceof Error ? error.message : String(error)}`;
|
|
513
|
-
output.parts = [];
|
|
514
|
-
persistRuntimeUiEvent(cwd, input.sessionID, runtimeEventTitle("error", "error"), text, "error");
|
|
515
|
-
await showRuntimeToast(client, cwd, text, "error", toastDuration);
|
|
516
|
-
throw new LoadoutsRuntimeCommandHandledError(text);
|
|
517
|
-
}
|
|
518
|
-
},
|
|
519
|
-
|
|
520
|
-
"experimental.chat.system.transform": async (
|
|
521
|
-
input: { sessionID?: string },
|
|
522
|
-
output: { system: string[] }
|
|
523
|
-
) => {
|
|
524
|
-
if (!input.sessionID) return;
|
|
525
|
-
const cwd = directory || worktree || process.cwd();
|
|
526
|
-
loadPersistedRuntimeState(cwd, input.sessionID);
|
|
527
|
-
const state = sessions.get(input.sessionID);
|
|
528
|
-
if (state) output.system.push(state.systemBlock);
|
|
529
|
-
},
|
|
530
|
-
};
|
|
531
|
-
};
|
|
532
|
-
|
|
533
|
-
export default LoadoutsRuntimePlugin;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"opencode-tui-config.d.ts","sourceRoot":"","sources":["../../../src/builtins/kinds/opencode-tui-config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAEvD,eAAO,MAAM,qBAAqB,EAAE,QAMnC,CAAC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export const opencodeTuiConfigKind = {
|
|
2
|
-
id: "opencode-tui-config",
|
|
3
|
-
description: "Whole-file OpenCode TUI configuration.",
|
|
4
|
-
detect: (rel) => rel === "opencode/tui.json" || rel === "opencode/tui.jsonc",
|
|
5
|
-
layout: "file",
|
|
6
|
-
defaultTargets: {},
|
|
7
|
-
};
|
|
8
|
-
//# sourceMappingURL=opencode-tui-config.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"opencode-tui-config.js","sourceRoot":"","sources":["../../../src/builtins/kinds/opencode-tui-config.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,qBAAqB,GAAa;IAC7C,EAAE,EAAE,qBAAqB;IACzB,WAAW,EAAE,wCAAwC;IACrD,MAAM,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,KAAK,mBAAmB,IAAI,GAAG,KAAK,oBAAoB;IAC5E,MAAM,EAAE,MAAM;IACd,cAAc,EAAE,EAAE;CACnB,CAAC"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { Tool } from "../../core/types.js";
|
|
2
|
-
import type { BridgeCompileResult, RuntimeBridge, RuntimeScope } from "./types.js";
|
|
3
|
-
export interface CliRuntimeBridgeOptions {
|
|
4
|
-
bin?: string;
|
|
5
|
-
tool?: Tool;
|
|
6
|
-
}
|
|
7
|
-
export declare class CliRuntimeBridge implements RuntimeBridge {
|
|
8
|
-
private readonly bin;
|
|
9
|
-
private readonly tool;
|
|
10
|
-
constructor(options?: CliRuntimeBridgeOptions);
|
|
11
|
-
compile(names: string[], scope: RuntimeScope, cwd: string): Promise<BridgeCompileResult>;
|
|
12
|
-
list(scope: RuntimeScope, cwd: string): Promise<string>;
|
|
13
|
-
info(names: string[], scope: RuntimeScope, cwd: string): Promise<string>;
|
|
14
|
-
private execText;
|
|
15
|
-
private exec;
|
|
16
|
-
}
|
|
17
|
-
//# sourceMappingURL=bridge.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"bridge.d.ts","sourceRoot":"","sources":["../../../src/integrations/opencode-runtime/bridge.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,KAAK,EAAE,mBAAmB,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAOnF,MAAM,WAAW,uBAAuB;IACtC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,IAAI,CAAC;CACb;AAMD,qBAAa,gBAAiB,YAAW,aAAa;IACpD,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAS;IAC7B,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAO;gBAEhB,OAAO,GAAE,uBAA4B;IAK3C,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,YAAY,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAU9F,IAAI,CAAC,KAAK,EAAE,YAAY,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAIvD,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,YAAY,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;YAI1D,QAAQ;IAKtB,OAAO,CAAC,IAAI;CA8Bb"}
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { spawn } from "node:child_process";
|
|
2
|
-
import { renderRuntimeSystemBlock } from "../../core/runtime.js";
|
|
3
|
-
function scopeFlag(scope) {
|
|
4
|
-
return scope === "global" ? "--global" : "--local";
|
|
5
|
-
}
|
|
6
|
-
export class CliRuntimeBridge {
|
|
7
|
-
bin;
|
|
8
|
-
tool;
|
|
9
|
-
constructor(options = {}) {
|
|
10
|
-
this.bin = options.bin ?? "loadouts";
|
|
11
|
-
this.tool = options.tool ?? "opencode";
|
|
12
|
-
}
|
|
13
|
-
async compile(names, scope, cwd) {
|
|
14
|
-
const args = ["runtime", ...names, "--tool", this.tool, "--json", scopeFlag(scope)];
|
|
15
|
-
const { stdout } = await this.exec(args, cwd);
|
|
16
|
-
const bundle = JSON.parse(stdout);
|
|
17
|
-
return {
|
|
18
|
-
bundle,
|
|
19
|
-
systemBlock: renderRuntimeSystemBlock(bundle),
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
list(scope, cwd) {
|
|
23
|
-
return this.execText(["list", scopeFlag(scope)], cwd);
|
|
24
|
-
}
|
|
25
|
-
info(names, scope, cwd) {
|
|
26
|
-
return this.execText(["info", ...names, scopeFlag(scope)], cwd);
|
|
27
|
-
}
|
|
28
|
-
async execText(args, cwd) {
|
|
29
|
-
const { stdout } = await this.exec(args, cwd);
|
|
30
|
-
return stdout;
|
|
31
|
-
}
|
|
32
|
-
exec(args, cwd) {
|
|
33
|
-
return new Promise((resolve, reject) => {
|
|
34
|
-
const child = spawn(this.bin, args, {
|
|
35
|
-
cwd,
|
|
36
|
-
stdio: ["ignore", "pipe", "pipe"],
|
|
37
|
-
});
|
|
38
|
-
let stdout = "";
|
|
39
|
-
let stderr = "";
|
|
40
|
-
child.stdout.setEncoding("utf-8");
|
|
41
|
-
child.stderr.setEncoding("utf-8");
|
|
42
|
-
child.stdout.on("data", (chunk) => {
|
|
43
|
-
stdout += chunk;
|
|
44
|
-
});
|
|
45
|
-
child.stderr.on("data", (chunk) => {
|
|
46
|
-
stderr += chunk;
|
|
47
|
-
});
|
|
48
|
-
child.on("error", (error) => reject(error));
|
|
49
|
-
child.on("close", (code) => {
|
|
50
|
-
if (code === 0) {
|
|
51
|
-
resolve({ stdout, stderr });
|
|
52
|
-
return;
|
|
53
|
-
}
|
|
54
|
-
const detail = stderr.trim() || stdout.trim() || `process exited with code ${code}`;
|
|
55
|
-
reject(new Error(`loadouts command failed: ${detail}`));
|
|
56
|
-
});
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
//# sourceMappingURL=bridge.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"bridge.js","sourceRoot":"","sources":["../../../src/integrations/opencode-runtime/bridge.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { HandleRuntimeCommandOptions, HandleRuntimeCommandResult, ParsedRuntimeCommand } from "./types.js";
|
|
2
|
-
export declare function parseRuntimeCommand(argumentsText: string): ParsedRuntimeCommand;
|
|
3
|
-
export declare function handleRuntimeCommand(options: HandleRuntimeCommandOptions): Promise<HandleRuntimeCommandResult>;
|
|
4
|
-
//# sourceMappingURL=command.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../../../src/integrations/opencode-runtime/command.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EACV,2BAA2B,EAC3B,0BAA0B,EAC1B,oBAAoB,EAGrB,MAAM,YAAY,CAAC;AA8GpB,wBAAgB,mBAAmB,CAAC,aAAa,EAAE,MAAM,GAAG,oBAAoB,CAgC/E;AAoBD,wBAAsB,oBAAoB,CACxC,OAAO,EAAE,2BAA2B,GACnC,OAAO,CAAC,0BAA0B,CAAC,CAsErC"}
|