@songsid/agend 2.1.10 → 2.1.11-beta.2
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/backend/antigravity.js +3 -2
- package/dist/backend/antigravity.js.map +1 -1
- package/dist/backend/claude-code.d.ts +7 -0
- package/dist/backend/claude-code.js +107 -3
- package/dist/backend/claude-code.js.map +1 -1
- package/dist/backend/cli-env-probe-worker.js +2 -10
- package/dist/backend/cli-env-probe-worker.js.map +1 -1
- package/dist/backend/cli-env-probe.d.ts +14 -0
- package/dist/backend/cli-env-probe.js +13 -0
- package/dist/backend/cli-env-probe.js.map +1 -0
- package/dist/backend/codex-metadata.d.ts +14 -0
- package/dist/backend/codex-metadata.js +70 -0
- package/dist/backend/codex-metadata.js.map +1 -0
- package/dist/backend/codex.d.ts +1 -2
- package/dist/backend/codex.js +112 -65
- package/dist/backend/codex.js.map +1 -1
- package/dist/backend/effort-metadata.d.ts +32 -0
- package/dist/backend/effort-metadata.js +21 -0
- package/dist/backend/effort-metadata.js.map +1 -0
- package/dist/backend/grok.js +3 -2
- package/dist/backend/grok.js.map +1 -1
- package/dist/backend/kiro-engine-ledger.d.ts +36 -0
- package/dist/backend/kiro-engine-ledger.js +113 -0
- package/dist/backend/kiro-engine-ledger.js.map +1 -0
- package/dist/backend/kiro-kas-store.d.ts +11 -0
- package/dist/backend/kiro-kas-store.js +67 -0
- package/dist/backend/kiro-kas-store.js.map +1 -0
- package/dist/backend/kiro-v3-identity.d.ts +28 -0
- package/dist/backend/kiro-v3-identity.js +213 -0
- package/dist/backend/kiro-v3-identity.js.map +1 -0
- package/dist/backend/kiro.d.ts +10 -0
- package/dist/backend/kiro.js +53 -5
- package/dist/backend/kiro.js.map +1 -1
- package/dist/backend/muse.js +3 -2
- package/dist/backend/muse.js.map +1 -1
- package/dist/backend/opencode-permission.d.ts +49 -0
- package/dist/backend/opencode-permission.js +181 -0
- package/dist/backend/opencode-permission.js.map +1 -0
- package/dist/backend/opencode.d.ts +37 -4
- package/dist/backend/opencode.js +112 -25
- package/dist/backend/opencode.js.map +1 -1
- package/dist/backend/types.d.ts +29 -1
- package/dist/backend/types.js.map +1 -1
- package/dist/channel/adapters/discord.js +35 -26
- package/dist/channel/adapters/discord.js.map +1 -1
- package/dist/channel/ipc-bridge.d.ts +1 -0
- package/dist/channel/ipc-bridge.js +1 -1
- package/dist/channel/ipc-bridge.js.map +1 -1
- package/dist/channel/mcp-tools.js +2 -0
- package/dist/channel/mcp-tools.js.map +1 -1
- package/dist/cli.js +48 -6
- package/dist/cli.js.map +1 -1
- package/dist/command-table.d.ts +99 -0
- package/dist/command-table.js +125 -0
- package/dist/command-table.js.map +1 -0
- package/dist/config.js +1 -0
- package/dist/config.js.map +1 -1
- package/dist/daemon.d.ts +60 -0
- package/dist/daemon.js +274 -14
- package/dist/daemon.js.map +1 -1
- package/dist/delivery-outbox.d.ts +16 -0
- package/dist/delivery-outbox.js +55 -6
- package/dist/delivery-outbox.js.map +1 -1
- package/dist/doctor.d.ts +3 -1
- package/dist/doctor.js +11 -0
- package/dist/doctor.js.map +1 -1
- package/dist/e2e-isolation.d.ts +122 -0
- package/dist/e2e-isolation.js +386 -0
- package/dist/e2e-isolation.js.map +1 -0
- package/dist/fleet-context.d.ts +2 -2
- package/dist/fleet-control-audit.d.ts +83 -0
- package/dist/fleet-control-audit.js +195 -0
- package/dist/fleet-control-audit.js.map +1 -0
- package/dist/fleet-manager.d.ts +69 -35
- package/dist/fleet-manager.js +596 -845
- package/dist/fleet-manager.js.map +1 -1
- package/dist/full-restart.js +2 -1
- package/dist/full-restart.js.map +1 -1
- package/dist/general-knowledge/skills/fleet-config/SKILL.md +3 -2
- package/dist/general-knowledge/skills/kiro-engine-migration/SKILL.md +56 -0
- package/dist/host-memory.d.ts +16 -0
- package/dist/host-memory.js +32 -0
- package/dist/host-memory.js.map +1 -0
- package/dist/instance-lifecycle.d.ts +2 -0
- package/dist/instance-lifecycle.js +18 -1
- package/dist/instance-lifecycle.js.map +1 -1
- package/dist/kiro-engine-status.d.ts +71 -0
- package/dist/kiro-engine-status.js +68 -0
- package/dist/kiro-engine-status.js.map +1 -0
- package/dist/locale.js +72 -16
- package/dist/locale.js.map +1 -1
- package/dist/log-tail.d.ts +34 -0
- package/dist/log-tail.js +66 -0
- package/dist/log-tail.js.map +1 -0
- package/dist/logger.d.ts +15 -0
- package/dist/logger.js +89 -1
- package/dist/logger.js.map +1 -1
- package/dist/login-controller.d.ts +1 -3
- package/dist/login-controller.js +2 -6
- package/dist/login-controller.js.map +1 -1
- package/dist/login-flows.d.ts +0 -8
- package/dist/login-flows.js +11 -11
- package/dist/login-flows.js.map +1 -1
- package/dist/login-manager.d.ts +5 -20
- package/dist/login-manager.js +0 -53
- package/dist/login-manager.js.map +1 -1
- package/dist/login-window-lock.d.ts +1 -1
- package/dist/login-window-lock.js +1 -1
- package/dist/memory-pressure.d.ts +41 -0
- package/dist/memory-pressure.js +117 -0
- package/dist/memory-pressure.js.map +1 -0
- package/dist/outbound-handlers.js +16 -1
- package/dist/outbound-handlers.js.map +1 -1
- package/dist/outbound-schemas.d.ts +3 -0
- package/dist/outbound-schemas.js +3 -0
- package/dist/outbound-schemas.js.map +1 -1
- package/dist/paths.d.ts +19 -0
- package/dist/paths.js +18 -5
- package/dist/paths.js.map +1 -1
- package/dist/probe-worker-pool.d.ts +28 -0
- package/dist/probe-worker-pool.js +129 -0
- package/dist/probe-worker-pool.js.map +1 -0
- package/dist/resource-report.d.ts +31 -0
- package/dist/resource-report.js +209 -0
- package/dist/resource-report.js.map +1 -0
- package/dist/rollout-index.d.ts +66 -0
- package/dist/rollout-index.js +124 -0
- package/dist/rollout-index.js.map +1 -0
- package/dist/slash-authz.d.ts +50 -0
- package/dist/slash-authz.js +19 -0
- package/dist/slash-authz.js.map +1 -0
- package/dist/spawn-gate.d.ts +13 -1
- package/dist/spawn-gate.js +108 -39
- package/dist/spawn-gate.js.map +1 -1
- package/dist/storm-window.d.ts +42 -0
- package/dist/storm-window.js +84 -1
- package/dist/storm-window.js.map +1 -1
- package/dist/tool-permissions.js +4 -2
- package/dist/tool-permissions.js.map +1 -1
- package/dist/topic-commands.d.ts +29 -2
- package/dist/topic-commands.js +77 -21
- package/dist/topic-commands.js.map +1 -1
- package/dist/transcript-sources.d.ts +21 -4
- package/dist/transcript-sources.js +55 -41
- package/dist/transcript-sources.js.map +1 -1
- package/dist/types.d.ts +5 -1
- package/dist/ui/settings.html +14 -13
- package/dist/ui/web-terminal/terminal-input.js +69 -0
- package/dist/ui/web-terminal/terminal.css +6 -0
- package/dist/ui/web-terminal/terminal.html +9 -1
- package/dist/ui/web-terminal/terminal.js +31 -2
- package/dist/web-terminal-http.js +1 -0
- package/dist/web-terminal-http.js.map +1 -1
- package/package.json +1 -1
|
@@ -9,13 +9,47 @@ export declare class OpenCodeBackend implements CliBackend {
|
|
|
9
9
|
private launchedSessionId;
|
|
10
10
|
/** Epoch ms of the last spawn — sessions created before it belong to someone else. */
|
|
11
11
|
private launchedAt;
|
|
12
|
+
/**
|
|
13
|
+
* Bumped by every buildCommand. A discovery is only ever valid for the launch it started
|
|
14
|
+
* under: the hijack guard below (created after OUR launch, or the id we resumed with) is
|
|
15
|
+
* defined against launchedAt/launchedSessionId, so a listing that comes back after a newer
|
|
16
|
+
* launch must not be judged against — or cached for — the newer one.
|
|
17
|
+
*/
|
|
18
|
+
private launchGeneration;
|
|
19
|
+
/** What discovery found, and for which launch. */
|
|
20
|
+
private discovered;
|
|
21
|
+
/** The discovery running now: concurrent callers share it instead of forking another CLI. */
|
|
22
|
+
private discovering;
|
|
12
23
|
constructor(instanceDir: string);
|
|
24
|
+
/**
|
|
25
|
+
* Find out, off the event loop, whether this binary's TUI takes `--auto` (cached per binary
|
|
26
|
+
* generation). The daemon awaits it before it builds the launch command; `buildCommand` itself
|
|
27
|
+
* only reads the answer.
|
|
28
|
+
*/
|
|
29
|
+
prepareLaunch(): Promise<void>;
|
|
13
30
|
buildCommand(config: CliBackendConfig): string;
|
|
14
31
|
writeConfig(config: CliBackendConfig): void;
|
|
15
32
|
getReadyPattern(): RegExp;
|
|
16
33
|
getErrorPatterns(): ErrorPattern[];
|
|
17
34
|
getContextUsage(): number | null;
|
|
35
|
+
/**
|
|
36
|
+
* Synchronous and cache-only (#1160): what the last finished discovery found for THIS launch, else
|
|
37
|
+
* the id persisted by a previous save (which also covers the daemon-start path where a stale
|
|
38
|
+
* window from the previous run is saved before any spawn in this process has captured
|
|
39
|
+
* workingDirectory). It never forks the CLI — it used to, for up to 15 s, on the fleet thread,
|
|
40
|
+
* from every idle observation. `refreshSessionId()` is what updates the cache.
|
|
41
|
+
*/
|
|
18
42
|
getSessionId(): string | null;
|
|
43
|
+
/**
|
|
44
|
+
* Find this instance's OpenCode session via the CLI's own listing and cache it for `getSessionId()`.
|
|
45
|
+
* Single-flight: a call made while a discovery is running gets that discovery's promise, so an
|
|
46
|
+
* idle observation and a stop/pause racing it cost ONE CLI run. Never rejects.
|
|
47
|
+
*
|
|
48
|
+
* Resolves to what `getSessionId()` answers afterwards. Before any spawn in this process
|
|
49
|
+
* (no workingDirectory/launchedAt to judge a row against) there is nothing to discover and that
|
|
50
|
+
* is the persisted id.
|
|
51
|
+
*/
|
|
52
|
+
refreshSessionId(): Promise<string | null>;
|
|
19
53
|
/**
|
|
20
54
|
* Find this instance's OpenCode session via the CLI's own listing —
|
|
21
55
|
* `opencode session list --format json` — the official output surface for
|
|
@@ -23,9 +57,8 @@ export declare class OpenCodeBackend implements CliBackend {
|
|
|
23
57
|
* session, newest first, subagent children excluded). This replaced a
|
|
24
58
|
* direct read of opencode.db: same information, but semver-protected CLI
|
|
25
59
|
* output instead of a private sqlite schema, and no node:sqlite
|
|
26
|
-
* requirement. ~1
|
|
27
|
-
*
|
|
28
|
-
* never on a hot path.
|
|
60
|
+
* requirement. ~1 s per call, which is why it runs asynchronously and
|
|
61
|
+
* single-flight (refreshSessionId) and is never on the synchronous path.
|
|
29
62
|
*
|
|
30
63
|
* A row is only accepted when it matches the spawn this backend performed:
|
|
31
64
|
* same directory AND (created after our launch, or the exact id we resumed
|
|
@@ -37,7 +70,7 @@ export declare class OpenCodeBackend implements CliBackend {
|
|
|
37
70
|
*/
|
|
38
71
|
private discoverSessionId;
|
|
39
72
|
/**
|
|
40
|
-
* `opencode session list --format json`, bounded and best-effort. Split out
|
|
73
|
+
* `opencode session list --format json`, bounded and best-effort, off the event loop. Split out
|
|
41
74
|
* as the process-spawning seam so tests stub it with fixture rows instead
|
|
42
75
|
* of a real CLI.
|
|
43
76
|
*
|
package/dist/backend/opencode.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { join } from "node:path";
|
|
2
|
-
import { execFileSync } from "node:child_process";
|
|
2
|
+
import { execFile, execFileSync } from "node:child_process";
|
|
3
|
+
import { promisify } from "node:util";
|
|
3
4
|
import { existsSync, readFileSync, unlinkSync, writeFileSync } from "node:fs";
|
|
4
5
|
import { resolveBinary, shellQuote, validateModel, warnIfModelMismatch } from "./types.js";
|
|
6
|
+
import { cachedOpencodeAutoSupport, opencodeAlwaysConfirmActive, opencodeAlwaysRequest, opencodePermissionPromptActive, opencodePermissionRequest, probeOpencodeAutoSupport, } from "./opencode-permission.js";
|
|
5
7
|
export class OpenCodeBackend {
|
|
6
8
|
instanceDir;
|
|
7
9
|
binaryName = "opencode";
|
|
@@ -12,16 +14,45 @@ export class OpenCodeBackend {
|
|
|
12
14
|
launchedSessionId = null;
|
|
13
15
|
/** Epoch ms of the last spawn — sessions created before it belong to someone else. */
|
|
14
16
|
launchedAt = null;
|
|
17
|
+
/**
|
|
18
|
+
* Bumped by every buildCommand. A discovery is only ever valid for the launch it started
|
|
19
|
+
* under: the hijack guard below (created after OUR launch, or the id we resumed with) is
|
|
20
|
+
* defined against launchedAt/launchedSessionId, so a listing that comes back after a newer
|
|
21
|
+
* launch must not be judged against — or cached for — the newer one.
|
|
22
|
+
*/
|
|
23
|
+
launchGeneration = 0;
|
|
24
|
+
/** What discovery found, and for which launch. */
|
|
25
|
+
discovered = null;
|
|
26
|
+
/** The discovery running now: concurrent callers share it instead of forking another CLI. */
|
|
27
|
+
discovering = null;
|
|
15
28
|
constructor(instanceDir) {
|
|
16
29
|
this.instanceDir = instanceDir;
|
|
17
30
|
this.binaryPath = resolveBinary("opencode");
|
|
18
31
|
}
|
|
32
|
+
/**
|
|
33
|
+
* Find out, off the event loop, whether this binary's TUI takes `--auto` (cached per binary
|
|
34
|
+
* generation). The daemon awaits it before it builds the launch command; `buildCommand` itself
|
|
35
|
+
* only reads the answer.
|
|
36
|
+
*/
|
|
37
|
+
async prepareLaunch() {
|
|
38
|
+
await probeOpencodeAutoSupport(this.binaryPath);
|
|
39
|
+
}
|
|
19
40
|
buildCommand(config) {
|
|
20
41
|
// Use per-instance config via OPENCODE_CONFIG env (set in writeConfig)
|
|
21
42
|
let cmd = this.binaryPath;
|
|
43
|
+
// Every other backend runs with its skip-permissions switch; OpenCode asks before it touches a
|
|
44
|
+
// path outside the project, so without one an instance parks on "Access external directory".
|
|
45
|
+
// `--auto` answers every ask "once" itself and keeps an explicit `deny`, but only a binary whose
|
|
46
|
+
// --help lists it may be given it (an unknown flag makes OpenCode exit 1). Anything else — an
|
|
47
|
+
// older OpenCode, an unreadable help — gets NO switch: the only version-independent form, the
|
|
48
|
+
// OPENCODE_PERMISSION env, is merged over the user's own config and would override their
|
|
49
|
+
// `deny`, and the runtime dialog below answers the prompt "once" instead. See opencode-permission.ts.
|
|
50
|
+
if (config.skipPermissions !== false && cachedOpencodeAutoSupport(this.binaryPath) === "yes")
|
|
51
|
+
cmd += " --auto";
|
|
22
52
|
this.workingDirectory = config.workingDirectory;
|
|
23
53
|
this.launchedSessionId = null;
|
|
24
54
|
this.launchedAt = Date.now();
|
|
55
|
+
this.launchGeneration++;
|
|
25
56
|
// Resume only a session explicitly persisted for this instance. OpenCode's
|
|
26
57
|
// --continue is global and can hijack an unrelated session from another cwd.
|
|
27
58
|
if (!config.skipResume) {
|
|
@@ -109,13 +140,16 @@ export class OpenCodeBackend {
|
|
|
109
140
|
getContextUsage() {
|
|
110
141
|
return null;
|
|
111
142
|
}
|
|
143
|
+
/**
|
|
144
|
+
* Synchronous and cache-only (#1160): what the last finished discovery found for THIS launch, else
|
|
145
|
+
* the id persisted by a previous save (which also covers the daemon-start path where a stale
|
|
146
|
+
* window from the previous run is saved before any spawn in this process has captured
|
|
147
|
+
* workingDirectory). It never forks the CLI — it used to, for up to 15 s, on the fleet thread,
|
|
148
|
+
* from every idle observation. `refreshSessionId()` is what updates the cache.
|
|
149
|
+
*/
|
|
112
150
|
getSessionId() {
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
return discovered;
|
|
116
|
-
// Fallback: the id persisted by a previous save (also covers the daemon-start
|
|
117
|
-
// path where a stale window from the previous run is saved before any spawn
|
|
118
|
-
// in this process has captured workingDirectory).
|
|
151
|
+
if (this.discovered && this.discovered.generation === this.launchGeneration)
|
|
152
|
+
return this.discovered.id;
|
|
119
153
|
try {
|
|
120
154
|
const f = join(this.instanceDir, "session-id");
|
|
121
155
|
return readFileSync(f, "utf-8").trim() || null;
|
|
@@ -124,6 +158,38 @@ export class OpenCodeBackend {
|
|
|
124
158
|
return null;
|
|
125
159
|
}
|
|
126
160
|
}
|
|
161
|
+
/**
|
|
162
|
+
* Find this instance's OpenCode session via the CLI's own listing and cache it for `getSessionId()`.
|
|
163
|
+
* Single-flight: a call made while a discovery is running gets that discovery's promise, so an
|
|
164
|
+
* idle observation and a stop/pause racing it cost ONE CLI run. Never rejects.
|
|
165
|
+
*
|
|
166
|
+
* Resolves to what `getSessionId()` answers afterwards. Before any spawn in this process
|
|
167
|
+
* (no workingDirectory/launchedAt to judge a row against) there is nothing to discover and that
|
|
168
|
+
* is the persisted id.
|
|
169
|
+
*/
|
|
170
|
+
refreshSessionId() {
|
|
171
|
+
if (!this.workingDirectory || this.launchedAt === null)
|
|
172
|
+
return Promise.resolve(this.getSessionId());
|
|
173
|
+
const generation = this.launchGeneration;
|
|
174
|
+
if (this.discovering && this.discovering.generation === generation)
|
|
175
|
+
return this.discovering.promise;
|
|
176
|
+
const launch = { workingDirectory: this.workingDirectory, launchedAt: this.launchedAt, launchedSessionId: this.launchedSessionId };
|
|
177
|
+
const entry = {
|
|
178
|
+
generation,
|
|
179
|
+
promise: this.discoverSessionId(launch).then(found => {
|
|
180
|
+
// A newer launch started while the CLI was listing: the rows were judged against the OLD
|
|
181
|
+
// launch's directory/time/resumed id and mean nothing for the new one. Drop them.
|
|
182
|
+
if (found && this.launchGeneration === generation)
|
|
183
|
+
this.discovered = { generation, id: found };
|
|
184
|
+
return this.getSessionId();
|
|
185
|
+
}, () => this.getSessionId()).finally(() => {
|
|
186
|
+
if (this.discovering === entry)
|
|
187
|
+
this.discovering = null;
|
|
188
|
+
}),
|
|
189
|
+
};
|
|
190
|
+
this.discovering = entry;
|
|
191
|
+
return entry.promise;
|
|
192
|
+
}
|
|
127
193
|
/**
|
|
128
194
|
* Find this instance's OpenCode session via the CLI's own listing —
|
|
129
195
|
* `opencode session list --format json` — the official output surface for
|
|
@@ -131,9 +197,8 @@ export class OpenCodeBackend {
|
|
|
131
197
|
* session, newest first, subagent children excluded). This replaced a
|
|
132
198
|
* direct read of opencode.db: same information, but semver-protected CLI
|
|
133
199
|
* output instead of a private sqlite schema, and no node:sqlite
|
|
134
|
-
* requirement. ~1
|
|
135
|
-
*
|
|
136
|
-
* never on a hot path.
|
|
200
|
+
* requirement. ~1 s per call, which is why it runs asynchronously and
|
|
201
|
+
* single-flight (refreshSessionId) and is never on the synchronous path.
|
|
137
202
|
*
|
|
138
203
|
* A row is only accepted when it matches the spawn this backend performed:
|
|
139
204
|
* same directory AND (created after our launch, or the exact id we resumed
|
|
@@ -143,25 +208,23 @@ export class OpenCodeBackend {
|
|
|
143
208
|
* listing is global; `--continue`'s apparent per-cwd behavior is an
|
|
144
209
|
* undocumented server-scoping side effect we deliberately do not rely on.
|
|
145
210
|
*/
|
|
146
|
-
discoverSessionId() {
|
|
147
|
-
|
|
148
|
-
return null;
|
|
149
|
-
const sessions = this.listSessions();
|
|
211
|
+
async discoverSessionId(launch) {
|
|
212
|
+
const sessions = await this.listSessions(launch.workingDirectory);
|
|
150
213
|
if (!sessions)
|
|
151
214
|
return null;
|
|
152
215
|
const candidates = sessions
|
|
153
|
-
.filter(s => s.directory ===
|
|
216
|
+
.filter(s => s.directory === launch.workingDirectory && !s.parentID)
|
|
154
217
|
.sort((a, b) => (b.updated ?? 0) - (a.updated ?? 0));
|
|
155
218
|
for (const session of candidates) {
|
|
156
|
-
if (session.id ===
|
|
219
|
+
if (session.id === launch.launchedSessionId)
|
|
157
220
|
return session.id;
|
|
158
|
-
if ((session.created ?? 0) >=
|
|
221
|
+
if ((session.created ?? 0) >= launch.launchedAt)
|
|
159
222
|
return session.id;
|
|
160
223
|
}
|
|
161
224
|
return null;
|
|
162
225
|
}
|
|
163
226
|
/**
|
|
164
|
-
* `opencode session list --format json`, bounded and best-effort. Split out
|
|
227
|
+
* `opencode session list --format json`, bounded and best-effort, off the event loop. Split out
|
|
165
228
|
* as the process-spawning seam so tests stub it with fixture rows instead
|
|
166
229
|
* of a real CLI.
|
|
167
230
|
*
|
|
@@ -172,12 +235,10 @@ export class OpenCodeBackend {
|
|
|
172
235
|
* exact-directory filter in discoverSessionId still applies on top, because
|
|
173
236
|
* a project can span several directories (worktrees, monorepo).
|
|
174
237
|
*/
|
|
175
|
-
listSessions() {
|
|
176
|
-
if (!this.workingDirectory)
|
|
177
|
-
return null;
|
|
238
|
+
async listSessions(workingDirectory) {
|
|
178
239
|
try {
|
|
179
|
-
const
|
|
180
|
-
const parsed = JSON.parse(
|
|
240
|
+
const { stdout } = await promisify(execFile)(this.binaryPath, ["session", "list", "--format", "json", "-n", "50"], { encoding: "utf-8", timeout: 15_000, cwd: workingDirectory });
|
|
241
|
+
const parsed = JSON.parse(stdout);
|
|
181
242
|
return Array.isArray(parsed) ? parsed : null;
|
|
182
243
|
}
|
|
183
244
|
catch {
|
|
@@ -209,9 +270,35 @@ export class OpenCodeBackend {
|
|
|
209
270
|
return { version: probeCliVersion(this.binaryPath), models: await this.listModels() };
|
|
210
271
|
}
|
|
211
272
|
getRuntimeDialogs() {
|
|
273
|
+
// Only reached when the launch switch (--auto / OPENCODE_PERMISSION) did not cover a prompt — a
|
|
274
|
+
// `.env` read on an older OpenCode, a user config's own `ask`. Answered with "Allow once": the
|
|
275
|
+
// option OpenCode selects by default, one Enter, nothing remembered. (This used to be
|
|
276
|
+
// Right+Enter = "Allow always", an implicit and wider grant.) Both are structural, not a
|
|
277
|
+
// viewport grep: a transcript that quotes the prompt has the idle prompt below it and is not
|
|
278
|
+
// answered, and while a real one is up the pane takes no delivery and is not "stuck".
|
|
212
279
|
return [
|
|
213
|
-
{
|
|
214
|
-
|
|
280
|
+
{
|
|
281
|
+
pattern: /Permission required/i,
|
|
282
|
+
isActive: opencodePermissionPromptActive,
|
|
283
|
+
requestIdentity: opencodePermissionRequest,
|
|
284
|
+
keys: ["Enter"],
|
|
285
|
+
description: "OpenCode permission prompt — Allow once",
|
|
286
|
+
blocksDelivery: true,
|
|
287
|
+
inputBlocked: true,
|
|
288
|
+
},
|
|
289
|
+
{
|
|
290
|
+
// The page behind "Allow always" (a human, or an older AgEnD, got that far): Escape is
|
|
291
|
+
// OpenCode's own Cancel there (verified on 1.16.2 / 1.17.20 / 1.18.34, whichever of
|
|
292
|
+
// Confirm / Cancel is highlighted) and goes back to the prompt above, which is then answered
|
|
293
|
+
// with "Allow once". Right+Enter is NOT a cancel: with Cancel already selected it wraps to Confirm.
|
|
294
|
+
pattern: /Always allow/i,
|
|
295
|
+
isActive: opencodeAlwaysConfirmActive,
|
|
296
|
+
requestIdentity: opencodeAlwaysRequest,
|
|
297
|
+
keys: ["Escape"],
|
|
298
|
+
description: "OpenCode 'Always allow' confirmation — Cancel (back to the prompt)",
|
|
299
|
+
blocksDelivery: true,
|
|
300
|
+
inputBlocked: true,
|
|
301
|
+
},
|
|
215
302
|
];
|
|
216
303
|
}
|
|
217
304
|
cleanup(config) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"opencode.js","sourceRoot":"","sources":["../../src/backend/opencode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"opencode.js","sourceRoot":"","sources":["../../src/backend/opencode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC9E,OAAO,EAAqG,aAAa,EAAE,UAAU,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAC9L,OAAO,EACL,yBAAyB,EACzB,2BAA2B,EAC3B,qBAAqB,EACrB,8BAA8B,EAC9B,yBAAyB,EACzB,wBAAwB,GACzB,MAAM,0BAA0B,CAAC;AAElC,MAAM,OAAO,eAAe;IAqBN;IApBX,UAAU,GAAG,UAAU,CAAC;IACzB,UAAU,CAAS;IAC3B,yFAAyF;IACjF,gBAAgB,GAAkB,IAAI,CAAC;IAC/C,iEAAiE;IACzD,iBAAiB,GAAkB,IAAI,CAAC;IAChD,sFAAsF;IAC9E,UAAU,GAAkB,IAAI,CAAC;IACzC;;;;;OAKG;IACK,gBAAgB,GAAG,CAAC,CAAC;IAC7B,kDAAkD;IAC1C,UAAU,GAA8C,IAAI,CAAC;IACrE,6FAA6F;IACrF,WAAW,GAAmE,IAAI,CAAC;IAE3F,YAAoB,WAAmB;QAAnB,gBAAW,GAAX,WAAW,CAAQ;QACrC,IAAI,CAAC,UAAU,GAAG,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AAC,CAAS,EAAE,EAAE,CAAC,CAAC,KAAK,SAAS,CAAC,CAAC;gBAC3E,CAAC;gBACD,aAAa,CAAC,UAAU,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;YACzD,CAAC;QACH,CAAC;QAAC,MAAM,CAAC,CAAC,iBAAiB,CAAC,CAAC;QAE7B,iCAAiC;QACjC,IAAI,CAAC;YACH,MAAM,SAAS,GAAG,IAAI,CAAC,MAAM,CAAC,WAAW,EAAE,uBAAuB,CAAC,CAAC;YACpE,IAAI,UAAU,CAAC,SAAS,CAAC;gBAAE,UAAU,CAAC,SAAS,CAAC,CAAC;QACnD,CAAC;QAAC,MAAM,CAAC,CAAC,iBAAiB,CAAC,CAAC;IAC/B,CAAC;CACF"}
|
package/dist/backend/types.d.ts
CHANGED
|
@@ -81,6 +81,10 @@ export interface ErrorPattern {
|
|
|
81
81
|
* immediately) whose backend ready-pattern only matches the startup banner,
|
|
82
82
|
* so waiting would block ALL future error detection forever. */
|
|
83
83
|
skipRecoveryWait?: boolean;
|
|
84
|
+
/** The CLI is still working the request this notice is about (e.g. Claude Code
|
|
85
|
+
* retrying an API call): it has NOT interrupted itself, so the lifecycle keeps
|
|
86
|
+
* the turn's Cancel button instead of retiring it. */
|
|
87
|
+
inProgress?: boolean;
|
|
84
88
|
/** This error is a property of the BACKEND (its service is unreachable), not
|
|
85
89
|
* of one instance: every instance on that CLI fails at once. The lifecycle
|
|
86
90
|
* then records a fleet-level backend outage, notifies ONCE fleet-wide instead
|
|
@@ -173,6 +177,15 @@ export interface RuntimeDialog {
|
|
|
173
177
|
* very bug being discussed) would count as a live dialog and receive keys.
|
|
174
178
|
*/
|
|
175
179
|
isActive?(pane: string): boolean;
|
|
180
|
+
/**
|
|
181
|
+
* WHICH request the dialog is showing — the text that identifies it (what is being asked, about which path or
|
|
182
|
+
* command), verbatim, excluding anything that merely ticks (a spinner, a timer, a status line). Two screens with
|
|
183
|
+
* equal identity are the same request; different identities are different requests. Return null when the dialog is
|
|
184
|
+
* not live. Optional: without it the daemon can only compare whole screens, and treats any difference as "not
|
|
185
|
+
* proven either way" (it never concludes that a request was replaced, so it keeps the dialog's parked clock running).
|
|
186
|
+
* Must be a pure function of the pane and must not be logged or sent anywhere: it can hold command arguments.
|
|
187
|
+
*/
|
|
188
|
+
requestIdentity?(pane: string): string | null;
|
|
176
189
|
/**
|
|
177
190
|
* Recognise the dialog but NEVER answer it. Implies `blocksDelivery`. If it
|
|
178
191
|
* persists, the daemon reports it for a human. Use for dialogs whose default
|
|
@@ -390,8 +403,17 @@ export interface CliBackend {
|
|
|
390
403
|
writeConfig(config: CliBackendConfig): void;
|
|
391
404
|
/** Read context window usage percentage (0-100). Returns null if unavailable. */
|
|
392
405
|
getContextUsage(): number | null;
|
|
393
|
-
/**
|
|
406
|
+
/**
|
|
407
|
+
* Read session ID for resume capability. Returns null if unavailable. Synchronous, so it must be
|
|
408
|
+
* cheap: a backend that has to ask a CLI answers from what `refreshSessionId` last found.
|
|
409
|
+
*/
|
|
394
410
|
getSessionId(): string | null;
|
|
411
|
+
/**
|
|
412
|
+
* Optional: look the session id up the slow way (a CLI listing) without blocking the event loop,
|
|
413
|
+
* and make `getSessionId()` answer with the result. Single-flight; never rejects; resolves to what
|
|
414
|
+
* `getSessionId()` returns afterwards. Backends whose id is a file read or null do not implement it.
|
|
415
|
+
*/
|
|
416
|
+
refreshSessionId?(): Promise<string | null>;
|
|
395
417
|
/** Regex to detect when the CLI is ready to accept input. */
|
|
396
418
|
getReadyPattern(): RegExp;
|
|
397
419
|
/**
|
|
@@ -447,6 +469,12 @@ export interface CliBackend {
|
|
|
447
469
|
getStartupDialogs?(): StartupDialog[];
|
|
448
470
|
/** Whether this backend re-reads instruction files on --resume (e.g. Claude Code's --append-system-prompt-file). */
|
|
449
471
|
readonly instructionsReloadedOnResume?: boolean;
|
|
472
|
+
/**
|
|
473
|
+
* Optional: whatever the backend has to ASK its CLI before `buildCommand` (a `--help` probe, a version)
|
|
474
|
+
* — awaited by the daemon right before the launch command is built, so the answer is cached and
|
|
475
|
+
* `buildCommand` never forks. Must not throw; a failed probe means "unknown", not a failed launch.
|
|
476
|
+
*/
|
|
477
|
+
prepareLaunch?(): Promise<void>;
|
|
450
478
|
/** Pre-approve a working directory to skip trust dialogs on startup. */
|
|
451
479
|
preTrust?(workingDirectory: string): void;
|
|
452
480
|
/** Resolve working directory (e.g. create symlink to avoid hidden paths). Returns resolved path. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/backend/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACvE,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAsB1C;;;;;;GAMG;AACH,MAAM,OAAO,mBAAoB,SAAQ,KAAK;IAC5C,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,qBAAqB,CAAC;IACpC,CAAC;CACF;
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/backend/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACvE,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAsB1C;;;;;;GAMG;AACH,MAAM,OAAO,mBAAoB,SAAQ,KAAK;IAC5C,YAAY,OAAe;QACzB,KAAK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-1,4 +1,5 @@
|
|
|
1
1
|
import { EventEmitter } from "node:events";
|
|
2
|
+
import { slashLock } from "../../command-table.js";
|
|
2
3
|
import { randomBytes } from "node:crypto";
|
|
3
4
|
import { t } from "../../locale.js";
|
|
4
5
|
import { mkdirSync } from "node:fs";
|
|
@@ -586,7 +587,8 @@ export class DiscordAdapter extends EventEmitter {
|
|
|
586
587
|
return;
|
|
587
588
|
}
|
|
588
589
|
if (interaction.guildId !== this.guildId) {
|
|
589
|
-
//
|
|
590
|
+
// Slash commands are let through to fleet-manager, which decides (src/slash-authz.ts): another
|
|
591
|
+
// guild's command is only honoured for a registered ClassicBot channel or `/start`, and a DM never.
|
|
590
592
|
if (!interaction.isChatInputCommand() && !this.openChannels.has(interaction.channelId ?? ""))
|
|
591
593
|
return;
|
|
592
594
|
}
|
|
@@ -966,7 +968,7 @@ export class DiscordAdapter extends EventEmitter {
|
|
|
966
968
|
try {
|
|
967
969
|
const registered = await client.application?.commands.set([
|
|
968
970
|
{
|
|
969
|
-
name: "start", description: t("slash.start"),
|
|
971
|
+
name: "start", description: slashLock("start") + t("slash.start"),
|
|
970
972
|
options: [{
|
|
971
973
|
name: "backend",
|
|
972
974
|
description: t("slash.option.backend"),
|
|
@@ -975,25 +977,25 @@ export class DiscordAdapter extends EventEmitter {
|
|
|
975
977
|
choices: DISCORD_START_BACKEND_CHOICES,
|
|
976
978
|
}],
|
|
977
979
|
},
|
|
978
|
-
{ name: "stop", description: t("slash.stop") },
|
|
980
|
+
{ name: "stop", description: slashLock("stop") + t("slash.stop") },
|
|
979
981
|
{
|
|
980
|
-
name: "pause", description: "
|
|
982
|
+
name: "pause", description: slashLock("pause") + t("slash.pause"),
|
|
981
983
|
options: [{ name: "instance", description: t("slash.option.instance"), type: ApplicationCommandOptionType.String, required: false }],
|
|
982
984
|
},
|
|
983
985
|
{
|
|
984
|
-
name: "wake", description: "
|
|
986
|
+
name: "wake", description: slashLock("wake") + t("slash.wake"),
|
|
985
987
|
options: [{ name: "instance", description: t("slash.option.instance"), type: ApplicationCommandOptionType.String, required: false }],
|
|
986
988
|
},
|
|
987
989
|
{
|
|
988
|
-
name: "chat", description: t("slash.chat"),
|
|
990
|
+
name: "chat", description: slashLock("chat") + t("slash.chat"),
|
|
989
991
|
options: [{ name: "message", description: t("slash.option.message"), type: 3, required: true }],
|
|
990
992
|
},
|
|
991
|
-
{ name: "status", description: "
|
|
992
|
-
{ name: "sysinfo", description: t("slash.sysinfo") },
|
|
993
|
-
{ name: "dashboard", description: t("slash.dashboard") },
|
|
994
|
-
{ name: "ctx", description: t("slash.ctx") },
|
|
993
|
+
{ name: "status", description: slashLock("status") + t("slash.status") },
|
|
994
|
+
{ name: "sysinfo", description: slashLock("sysinfo") + t("slash.sysinfo") },
|
|
995
|
+
{ name: "dashboard", description: slashLock("dashboard") + t("slash.dashboard") },
|
|
996
|
+
{ name: "ctx", description: slashLock("ctx") + t("slash.ctx") },
|
|
995
997
|
{
|
|
996
|
-
name: "restart", description: "
|
|
998
|
+
name: "restart", description: slashLock("restart") + t("slash.restart"),
|
|
997
999
|
options: [{
|
|
998
1000
|
name: "mode",
|
|
999
1001
|
description: t("slash.option.restart_mode"),
|
|
@@ -1002,11 +1004,11 @@ export class DiscordAdapter extends EventEmitter {
|
|
|
1002
1004
|
choices: [{ name: "full", value: "full" }],
|
|
1003
1005
|
}],
|
|
1004
1006
|
},
|
|
1005
|
-
{ name: "update", description: "
|
|
1006
|
-
{ name: "doctor", description: "
|
|
1007
|
-
{ name: "usage", description: t("slash.usage") },
|
|
1007
|
+
{ name: "update", description: slashLock("update") + t("slash.update") },
|
|
1008
|
+
{ name: "doctor", description: slashLock("doctor") + t("slash.doctor") },
|
|
1009
|
+
{ name: "usage", description: slashLock("usage") + t("slash.usage") },
|
|
1008
1010
|
{
|
|
1009
|
-
name: "tips", description: t("slash.tips"),
|
|
1011
|
+
name: "tips", description: slashLock("tips") + t("slash.tips"),
|
|
1010
1012
|
options: [{
|
|
1011
1013
|
name: "mode", description: t("slash.option.tips_mode"),
|
|
1012
1014
|
type: ApplicationCommandOptionType.String, required: false,
|
|
@@ -1017,23 +1019,30 @@ export class DiscordAdapter extends EventEmitter {
|
|
|
1017
1019
|
],
|
|
1018
1020
|
}],
|
|
1019
1021
|
},
|
|
1020
|
-
{ name: "compact", description: "🔒 " + t("slash.compact") },
|
|
1021
1022
|
{
|
|
1022
|
-
name: "
|
|
1023
|
+
name: "compact", description: slashLock("compact") + t("slash.compact"),
|
|
1024
|
+
options: [{
|
|
1025
|
+
// Optional, and honoured only by backends that take it (#1145).
|
|
1026
|
+
name: "instructions", description: t("slash.option.compact_instructions"),
|
|
1027
|
+
type: ApplicationCommandOptionType.String, required: false, maxLength: 1000,
|
|
1028
|
+
}],
|
|
1029
|
+
},
|
|
1030
|
+
{
|
|
1031
|
+
name: "steer", description: slashLock("steer") + t("slash.steer"),
|
|
1023
1032
|
options: [{
|
|
1024
1033
|
name: "message", description: t("slash.option.steer_message"),
|
|
1025
1034
|
type: ApplicationCommandOptionType.String, required: true,
|
|
1026
1035
|
}],
|
|
1027
1036
|
},
|
|
1028
1037
|
{
|
|
1029
|
-
name: "btw", description: t("slash.btw"),
|
|
1038
|
+
name: "btw", description: slashLock("btw") + t("slash.btw"),
|
|
1030
1039
|
options: [{
|
|
1031
1040
|
name: "message", description: t("slash.option.btw_message"),
|
|
1032
1041
|
type: ApplicationCommandOptionType.String, required: true,
|
|
1033
1042
|
}],
|
|
1034
1043
|
},
|
|
1035
1044
|
{
|
|
1036
|
-
name: "login", description: withFleetLabel("
|
|
1045
|
+
name: "login", description: withFleetLabel(slashLock("login") + t("slash.login"), this.fleetLabel),
|
|
1037
1046
|
options: [
|
|
1038
1047
|
{
|
|
1039
1048
|
name: "backend", description: t("slash.option.login_backend"),
|
|
@@ -1051,12 +1060,12 @@ export class DiscordAdapter extends EventEmitter {
|
|
|
1051
1060
|
{ name: "cancel", description: t("slash.option.login_cancel"), type: ApplicationCommandOptionType.Boolean, required: false },
|
|
1052
1061
|
],
|
|
1053
1062
|
},
|
|
1054
|
-
{ name: "clear", description: "
|
|
1063
|
+
{ name: "clear", description: slashLock("clear") + t("slash.clear") },
|
|
1055
1064
|
{
|
|
1056
|
-
name: "model", description: "
|
|
1065
|
+
name: "model", description: slashLock("model") + t("slash.model"),
|
|
1057
1066
|
},
|
|
1058
1067
|
{
|
|
1059
|
-
name: "effort", description: "
|
|
1068
|
+
name: "effort", description: slashLock("effort") + t("slash.effort"),
|
|
1060
1069
|
options: [{
|
|
1061
1070
|
name: "level", description: t("slash.option.effort_level"),
|
|
1062
1071
|
type: ApplicationCommandOptionType.String, required: false,
|
|
@@ -1067,19 +1076,19 @@ export class DiscordAdapter extends EventEmitter {
|
|
|
1067
1076
|
],
|
|
1068
1077
|
}],
|
|
1069
1078
|
},
|
|
1070
|
-
{ name: "collab", description: "
|
|
1079
|
+
{ name: "collab", description: slashLock("collab") + t("slash.collab") },
|
|
1071
1080
|
{
|
|
1072
|
-
name: "save", description: "
|
|
1081
|
+
name: "save", description: slashLock("save") + t("slash.save"),
|
|
1073
1082
|
options: [
|
|
1074
1083
|
{ name: "filename", description: t("slash.option.save_filename"), type: 3, required: true },
|
|
1075
1084
|
{ name: "force", description: t("slash.option.save_force"), type: 5, required: false },
|
|
1076
1085
|
],
|
|
1077
1086
|
},
|
|
1078
1087
|
{
|
|
1079
|
-
name: "load", description: "
|
|
1088
|
+
name: "load", description: slashLock("load") + t("slash.load"),
|
|
1080
1089
|
options: [{ name: "filename", description: t("slash.option.load_filename"), type: 3, required: true }],
|
|
1081
1090
|
},
|
|
1082
|
-
{ name: "cancel", description: t("slash.cancel") },
|
|
1091
|
+
{ name: "cancel", description: slashLock("cancel") + t("slash.cancel") },
|
|
1083
1092
|
]);
|
|
1084
1093
|
this.emitFromClient(client, generation, "slash_registration", { ok: true, count: registered?.size });
|
|
1085
1094
|
}
|