@rynx-ai/daemon 0.1.11-beta.2 → 0.1.11-beta.21
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-plugins/plugins/lark/.rynx-plugin/plugin.json +0 -12
- package/bundled-plugins/plugins/lark/dist/cli-mirror/mirror-index.js +3 -1
- package/bundled-plugins/plugins/lark/dist/host-adapters.d.ts +3 -3
- package/bundled-plugins/plugins/lark/dist/host-adapters.js +20 -18
- package/bundled-plugins/plugins/lark/dist/lark.js +18 -12
- package/bundled-plugins/plugins/lark/dist/runtime.js +6046 -6022
- package/bundled-plugins/plugins/lark/dist/settings.js +6006 -5988
- package/bundled-plugins/plugins/lark/package.json +1 -1
- package/bundled-plugins/plugins/lark/ui/assets/index-CGUVAMsv.css +1 -0
- package/bundled-plugins/plugins/lark/ui/index.html +2 -2
- package/dist/agent-file.js +0 -1
- package/dist/browser-artifact-management.d.ts +4 -1
- package/dist/browser-artifact-management.js +22 -11
- package/dist/browser-artifacts.d.ts +1 -0
- package/dist/browser-artifacts.js +1 -0
- package/dist/chrome-for-testing-runtime.d.ts +27 -0
- package/dist/chrome-for-testing-runtime.js +194 -0
- package/dist/chrome-for-testing-store.d.ts +2 -0
- package/dist/chrome-for-testing-store.js +37 -6
- package/dist/control-deps.d.ts +6 -2
- package/dist/control-deps.js +87 -4
- package/dist/control-link-store.js +4 -3
- package/dist/daemon-owner.js +4 -7
- package/dist/daemon-server.d.ts +4 -1
- package/dist/daemon-server.js +158 -45
- package/dist/db.d.ts +2 -2
- package/dist/db.js +55 -20
- package/dist/entry-path.d.ts +3 -0
- package/dist/entry-path.js +12 -0
- package/dist/index-daemon.js +3 -87
- package/dist/lifecycle.d.ts +13 -0
- package/dist/lifecycle.js +19 -0
- package/dist/maintenance-lease.d.ts +39 -0
- package/dist/maintenance-lease.js +250 -0
- package/dist/migrations/cleanup-legacy-sessions.js +4 -3
- package/dist/plugin-cli.d.ts +10 -0
- package/dist/plugin-cli.js +19 -2
- package/dist/plugin-host-rpc.d.ts +35 -6
- package/dist/plugin-host-rpc.js +222 -59
- package/dist/plugin-installer.js +62 -2
- package/dist/plugin-management-service.js +0 -2
- package/dist/plugin-marketplace.js +2 -1
- package/dist/plugin-store.js +2 -4
- package/dist/plugin-supervisor.d.ts +5 -0
- package/dist/plugin-supervisor.js +218 -33
- package/dist/pm2.d.ts +11 -2
- package/dist/pm2.js +116 -19
- package/dist/process.d.ts +12 -0
- package/dist/process.js +91 -0
- package/dist/remote-runtime-access-store.d.ts +2 -2
- package/dist/remote-runtime-access-store.js +6 -9
- package/dist/remote-runtime-target-store.d.ts +2 -2
- package/dist/remote-runtime-target-store.js +6 -6
- package/dist/session-emulator-binding-store.js +4 -6
- package/dist/session-fork-store.js +24 -8
- package/dist/session-launch-operations.d.ts +10 -1
- package/dist/session-launch-operations.js +21 -11
- package/dist/session-log-store.js +2 -1
- package/dist/session-meta-store.d.ts +5 -0
- package/dist/session-meta-store.js +25 -2
- package/dist/session-portal-grant-store.d.ts +29 -0
- package/dist/session-portal-grant-store.js +85 -0
- package/dist/session-resource-store.js +3 -2
- package/dist/setup-service.d.ts +21 -0
- package/dist/setup-service.js +39 -0
- package/dist/skills-catalog.d.ts +11 -2
- package/dist/skills-catalog.js +307 -10
- package/dist/sqlite.d.ts +22 -0
- package/dist/sqlite.js +57 -0
- package/dist/system-dependencies.d.ts +22 -0
- package/dist/system-dependencies.js +79 -0
- package/package.json +37 -21
- package/bundled-plugins/plugins/lark/ui/assets/index-B2dhMlMU.css +0 -1
- package/dist/browser-cli-args.d.ts +0 -20
- package/dist/browser-cli-args.js +0 -100
- package/dist/cli.d.ts +0 -2
- package/dist/cli.js +0 -550
- package/dist/control-client.d.ts +0 -122
- package/dist/control-client.js +0 -855
- package/dist/control-endpoint.d.ts +0 -14
- package/dist/control-endpoint.js +0 -124
- package/dist/desktop-browser-host-client.d.ts +0 -35
- package/dist/desktop-browser-host-client.js +0 -415
- package/dist/setup.d.ts +0 -20
- package/dist/setup.js +0 -386
- package/dist/update.d.ts +0 -25
- package/dist/update.js +0 -133
- /package/bundled-plugins/plugins/lark/ui/assets/{index-D9N-AkLX.js → index-D8Amoe6a.js} +0 -0
|
@@ -5,18 +5,6 @@
|
|
|
5
5
|
"displayName": "Lark",
|
|
6
6
|
"description": "Lark and Feishu channel integration managed by the plugin.",
|
|
7
7
|
"apiRange": "^1.0.0",
|
|
8
|
-
"capabilities": [
|
|
9
|
-
"conversation.run",
|
|
10
|
-
"agent.catalog.read",
|
|
11
|
-
"runtime.catalog.read",
|
|
12
|
-
"session.cancel",
|
|
13
|
-
"session.fork",
|
|
14
|
-
"session.goal.read",
|
|
15
|
-
"session.goal.write",
|
|
16
|
-
"session.meta.read",
|
|
17
|
-
"session.meta.title.write",
|
|
18
|
-
"session.provision"
|
|
19
|
-
],
|
|
20
8
|
"runtime": {
|
|
21
9
|
"entry": "./dist/runtime.js"
|
|
22
10
|
},
|
|
@@ -35,7 +35,9 @@ export class CodexMirrorIndex {
|
|
|
35
35
|
chatId: directory.chatId,
|
|
36
36
|
threadId: directory.threadId,
|
|
37
37
|
participants: directory.participants ?? [],
|
|
38
|
-
model
|
|
38
|
+
// A null model means the provider CLI owns model selection. The mirror
|
|
39
|
+
// still needs a stable string label for transcript normalization.
|
|
40
|
+
model: session.execution.model ?? session.execution.provider,
|
|
39
41
|
};
|
|
40
42
|
}
|
|
41
43
|
/** All Codex threads currently bound to a Feishu conversation (those whose
|
|
@@ -13,8 +13,8 @@ interface HostSessionLaunchMeta {
|
|
|
13
13
|
export declare const LARK_RUN_EVENT_QUEUE_MAX_ITEMS = 256;
|
|
14
14
|
export declare const LARK_RUN_EVENT_QUEUE_MAX_BYTES: number;
|
|
15
15
|
/**
|
|
16
|
-
* ConversationRuntime-shaped adapter backed exclusively by
|
|
17
|
-
*
|
|
16
|
+
* ConversationRuntime-shaped adapter backed exclusively by the typed Host API.
|
|
17
|
+
* The plugin never receives the daemon's runtime, abort controller,
|
|
18
18
|
* steer controller, or session bus.
|
|
19
19
|
*/
|
|
20
20
|
export declare class HostConversationRuntime implements LarkConversationRuntime {
|
|
@@ -23,7 +23,7 @@ export declare class HostConversationRuntime implements LarkConversationRuntime
|
|
|
23
23
|
runLive(input: ConversationStreamRequest): Promise<{
|
|
24
24
|
provider: "codex" | "traex" | "claude";
|
|
25
25
|
threadId: string;
|
|
26
|
-
model: string;
|
|
26
|
+
model: string | null;
|
|
27
27
|
authSource: "codex_cli" | "traex_cli" | "claude_cli";
|
|
28
28
|
generator: AsyncGenerator<SessionEvent, any, any>;
|
|
29
29
|
}>;
|
|
@@ -6,8 +6,8 @@ import { FileLarkActiveSessionStore, } from "./lark-session-store.js";
|
|
|
6
6
|
export const LARK_RUN_EVENT_QUEUE_MAX_ITEMS = 256;
|
|
7
7
|
export const LARK_RUN_EVENT_QUEUE_MAX_BYTES = 8 * 1024 * 1024;
|
|
8
8
|
/**
|
|
9
|
-
* ConversationRuntime-shaped adapter backed exclusively by
|
|
10
|
-
*
|
|
9
|
+
* ConversationRuntime-shaped adapter backed exclusively by the typed Host API.
|
|
10
|
+
* The plugin never receives the daemon's runtime, abort controller,
|
|
11
11
|
* steer controller, or session bus.
|
|
12
12
|
*/
|
|
13
13
|
export class HostConversationRuntime {
|
|
@@ -37,7 +37,7 @@ export class HostConversationRuntime {
|
|
|
37
37
|
const interrupt = () => {
|
|
38
38
|
if (!runId || terminal)
|
|
39
39
|
return;
|
|
40
|
-
void this.host.
|
|
40
|
+
void this.host.sessions.interrupt({ runId }).catch(() => undefined);
|
|
41
41
|
};
|
|
42
42
|
const accept = (event, payload) => {
|
|
43
43
|
if (!runId) {
|
|
@@ -86,8 +86,10 @@ export class HostConversationRuntime {
|
|
|
86
86
|
unsubscribeEvents();
|
|
87
87
|
let started;
|
|
88
88
|
try {
|
|
89
|
-
started = await this.host.
|
|
89
|
+
started = await this.host.sessions.run({
|
|
90
90
|
sessionId: input.threadId,
|
|
91
|
+
model: input.model?.trim() || null,
|
|
92
|
+
reasoningEffort: input.reasoningEffort?.trim() || null,
|
|
91
93
|
message: input.message,
|
|
92
94
|
});
|
|
93
95
|
runId = started.runId;
|
|
@@ -109,7 +111,7 @@ export class HostConversationRuntime {
|
|
|
109
111
|
const unsteer = input.steer?.subscribe((text) => {
|
|
110
112
|
if (!runId || terminal)
|
|
111
113
|
return;
|
|
112
|
-
void this.host.
|
|
114
|
+
void this.host.sessions.steer({ runId, text }).catch(() => undefined);
|
|
113
115
|
});
|
|
114
116
|
input.signal?.addEventListener("abort", interrupt, { once: true });
|
|
115
117
|
const generator = (async function* () {
|
|
@@ -141,16 +143,16 @@ export class HostAgentCapabilities {
|
|
|
141
143
|
this.host = host;
|
|
142
144
|
}
|
|
143
145
|
listModels(runtime) {
|
|
144
|
-
return this.host.
|
|
146
|
+
return this.host.sessions.listModels(runtime ? { runtime } : undefined);
|
|
145
147
|
}
|
|
146
148
|
getGoal(sessionId) {
|
|
147
|
-
return this.host.
|
|
149
|
+
return this.host.sessions.goals.get({ sessionId });
|
|
148
150
|
}
|
|
149
151
|
setGoal(sessionId, objective) {
|
|
150
|
-
return this.host.
|
|
152
|
+
return this.host.sessions.goals.set({ sessionId, objective });
|
|
151
153
|
}
|
|
152
154
|
clearGoal(sessionId) {
|
|
153
|
-
return this.host.
|
|
155
|
+
return this.host.sessions.goals.clear({ sessionId });
|
|
154
156
|
}
|
|
155
157
|
}
|
|
156
158
|
/** Narrow agent catalog + first-turn execution resolver backed by Host RPC. */
|
|
@@ -160,13 +162,13 @@ export class HostAgentCatalog {
|
|
|
160
162
|
this.host = host;
|
|
161
163
|
}
|
|
162
164
|
list() {
|
|
163
|
-
return this.host.
|
|
165
|
+
return this.host.agents.list();
|
|
164
166
|
}
|
|
165
167
|
get(id) {
|
|
166
|
-
return this.host.
|
|
168
|
+
return this.host.agents.get({ id });
|
|
167
169
|
}
|
|
168
170
|
resolveExecution(input) {
|
|
169
|
-
return this.host.
|
|
171
|
+
return this.host.agents.resolveExecution(input);
|
|
170
172
|
}
|
|
171
173
|
}
|
|
172
174
|
/** Daemon-owned session allocator. operationId must identify one allocation attempt durably. */
|
|
@@ -179,7 +181,7 @@ export class HostSessionProvisioner {
|
|
|
179
181
|
this.instanceId = instanceId;
|
|
180
182
|
}
|
|
181
183
|
async provision(operationId, session = {}) {
|
|
182
|
-
const result = await this.host.
|
|
184
|
+
const result = await this.host.sessions.ensure({
|
|
183
185
|
scopeId: this.instanceId,
|
|
184
186
|
operationId,
|
|
185
187
|
session,
|
|
@@ -188,7 +190,7 @@ export class HostSessionProvisioner {
|
|
|
188
190
|
throw new Error("host did not return a provisioned session id");
|
|
189
191
|
this.resolvedExecutions.set(result.sessionId, {
|
|
190
192
|
runtime: result.execution.provider,
|
|
191
|
-
model: result.execution.model,
|
|
193
|
+
...(result.execution.model ? { model: result.execution.model } : {}),
|
|
192
194
|
...(result.execution.reasoningEffort
|
|
193
195
|
? { reasoningEffort: result.execution.reasoningEffort }
|
|
194
196
|
: {}),
|
|
@@ -203,10 +205,10 @@ export class HostSessionProvisioner {
|
|
|
203
205
|
}
|
|
204
206
|
async existingExecution(sessionId) {
|
|
205
207
|
try {
|
|
206
|
-
const session = await this.host.
|
|
208
|
+
const session = await this.host.sessions.get({ sessionId });
|
|
207
209
|
return {
|
|
208
210
|
runtime: session.execution.provider,
|
|
209
|
-
model: session.execution.model,
|
|
211
|
+
...(session.execution.model ? { model: session.execution.model } : {}),
|
|
210
212
|
...(session.execution.reasoningEffort
|
|
211
213
|
? { reasoningEffort: session.execution.reasoningEffort }
|
|
212
214
|
: {}),
|
|
@@ -225,7 +227,7 @@ export class HostSessionProvisioner {
|
|
|
225
227
|
return stableOperationId("fork", this.instanceId, fromSessionId, newSessionKey);
|
|
226
228
|
}
|
|
227
229
|
async fork(operationId, sourceSessionId, title) {
|
|
228
|
-
const result = await this.host.
|
|
230
|
+
const result = await this.host.sessions.fork({
|
|
229
231
|
sourceSessionId,
|
|
230
232
|
operationId,
|
|
231
233
|
...(title ? { title } : {}),
|
|
@@ -235,7 +237,7 @@ export class HostSessionProvisioner {
|
|
|
235
237
|
return result.sessionId;
|
|
236
238
|
}
|
|
237
239
|
async setTitle(sessionId, title) {
|
|
238
|
-
await this.host.
|
|
240
|
+
await this.host.sessions.setTitle({ sessionId, title });
|
|
239
241
|
}
|
|
240
242
|
}
|
|
241
243
|
/**
|
|
@@ -2,7 +2,7 @@ import { execFile } from "node:child_process";
|
|
|
2
2
|
import { randomUUID } from "node:crypto";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import { promisify } from "node:util";
|
|
5
|
-
import { CodexRuntimeError, collectLiveRun, } from "@rynx-ai/core";
|
|
5
|
+
import { AgentRuntimeError, CodexRuntimeError, collectLiveRun, } from "@rynx-ai/core";
|
|
6
6
|
const execFileAsync = promisify(execFile);
|
|
7
7
|
import { LarkSessionCardController, } from "./lark-card-stream.js";
|
|
8
8
|
import { buildLarkCardReplyPrompt, chunkLarkReplyText, extractLarkTextPrompt, isLarkNewSessionCommand, isLarkStopCommand, parseLarkCommand, } from "./lark-content.js";
|
|
@@ -23,10 +23,18 @@ const DEFAULT_EMPTY_RESPONSE = "抱歉,我暂时没有生成回复。";
|
|
|
23
23
|
const DEFAULT_NEW_SESSION_RESPONSE = "已开启新会话。";
|
|
24
24
|
const DEFAULT_STOP_NO_INFLIGHT_RESPONSE = "当前没有正在进行的任务。";
|
|
25
25
|
const DEFAULT_STOP_ACK_RESPONSE = "已停止当前任务。";
|
|
26
|
+
const LIVE_SESSION_UNAVAILABLE_RESPONSE = "当前设备的 Session 运行环境不可用,可能是内置 tmux 缺失或损坏。请执行 `rynx doctor` 查看状态。";
|
|
26
27
|
const LARK_WORK_STARTED_REACTION = "Get";
|
|
27
28
|
const LARK_WORK_COMPLETED_REACTION = "DONE";
|
|
28
29
|
/** Reaction added to a message whose text was steered into the running turn. */
|
|
29
30
|
const LARK_STEER_ACK_REACTION = "Get";
|
|
31
|
+
function buildRunFailureReply(error) {
|
|
32
|
+
if (error instanceof AgentRuntimeError &&
|
|
33
|
+
(error.code === "LIVE_SESSION_UNAVAILABLE" || error.code === "live_unavailable")) {
|
|
34
|
+
return LIVE_SESSION_UNAVAILABLE_RESPONSE;
|
|
35
|
+
}
|
|
36
|
+
return `处理失败:${toErrorMessage(error)}`;
|
|
37
|
+
}
|
|
30
38
|
const LARK_COMMANDS = [
|
|
31
39
|
{ name: "new", help: "/new — 开启新会话", category: "takeover" },
|
|
32
40
|
{ name: "stop", help: "/stop 或 /cancel — 停止当前正在进行的任务", category: "other" },
|
|
@@ -1308,11 +1316,9 @@ export class LarkMessageIngestor {
|
|
|
1308
1316
|
const effort = pending.effort !== SETTINGS_DEFAULT_VALUE && allowedEfforts.includes(pending.effort)
|
|
1309
1317
|
? pending.effort
|
|
1310
1318
|
: undefined;
|
|
1311
|
-
//
|
|
1312
|
-
// reasoning
|
|
1313
|
-
const rotate = runtime !== pending.currentRuntime
|
|
1314
|
-
model !== pending.currentModel ||
|
|
1315
|
-
effort !== pending.currentEffort;
|
|
1319
|
+
// Provider selects the immutable runtime implementation. Model and
|
|
1320
|
+
// reasoning effort are Turn settings and update the same idle Session.
|
|
1321
|
+
const rotate = runtime !== pending.currentRuntime;
|
|
1316
1322
|
await this.activeSessionStore.applySettings(sessionKey, {
|
|
1317
1323
|
runtime,
|
|
1318
1324
|
model,
|
|
@@ -1657,7 +1663,7 @@ export class LarkMessageIngestor {
|
|
|
1657
1663
|
error: errorMessage,
|
|
1658
1664
|
});
|
|
1659
1665
|
return {
|
|
1660
|
-
text:
|
|
1666
|
+
text: buildRunFailureReply(error),
|
|
1661
1667
|
provider: settings.provider,
|
|
1662
1668
|
};
|
|
1663
1669
|
}
|
|
@@ -1713,9 +1719,9 @@ export class LarkMessageIngestor {
|
|
|
1713
1719
|
await orchestrator.finalizeAll(cancelled ? "cancelled" : "failed");
|
|
1714
1720
|
return {
|
|
1715
1721
|
// A user-triggered cancel needs no redundant chat reply (the card carries it).
|
|
1716
|
-
text: cancelled ? "" :
|
|
1722
|
+
text: cancelled ? "" : buildRunFailureReply(error),
|
|
1717
1723
|
provider: started.provider,
|
|
1718
|
-
model: started.model,
|
|
1724
|
+
...(started.model ? { model: started.model } : {}),
|
|
1719
1725
|
};
|
|
1720
1726
|
}
|
|
1721
1727
|
// The card carries the answer; only emit a plain-text reply when no card
|
|
@@ -1723,7 +1729,7 @@ export class LarkMessageIngestor {
|
|
|
1723
1729
|
return {
|
|
1724
1730
|
text: orchestrator.cardStarted ? "" : orchestrator.fallbackText.trim() || DEFAULT_EMPTY_RESPONSE,
|
|
1725
1731
|
provider: started.provider,
|
|
1726
|
-
model: started.model,
|
|
1732
|
+
...(started.model ? { model: started.model } : {}),
|
|
1727
1733
|
};
|
|
1728
1734
|
}
|
|
1729
1735
|
/**
|
|
@@ -1765,7 +1771,7 @@ export class LarkMessageIngestor {
|
|
|
1765
1771
|
return {
|
|
1766
1772
|
text: answer.trim() || DEFAULT_EMPTY_RESPONSE,
|
|
1767
1773
|
provider: started.provider,
|
|
1768
|
-
model: started.model,
|
|
1774
|
+
...(started.model ? { model: started.model } : {}),
|
|
1769
1775
|
};
|
|
1770
1776
|
}
|
|
1771
1777
|
catch (error) {
|
|
@@ -1782,7 +1788,7 @@ export class LarkMessageIngestor {
|
|
|
1782
1788
|
error: errorMessage,
|
|
1783
1789
|
});
|
|
1784
1790
|
return {
|
|
1785
|
-
text:
|
|
1791
|
+
text: buildRunFailureReply(error),
|
|
1786
1792
|
provider: settings.provider,
|
|
1787
1793
|
};
|
|
1788
1794
|
}
|