lark-remote 0.1.11 → 0.1.13
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/CHANGELOG.md +23 -0
- package/dist/bridge/inbound-media.d.ts +0 -3
- package/dist/bridge/inbound-media.js +0 -1
- package/dist/bridge/index.d.ts +7 -0
- package/dist/bridge/index.js +79 -70
- package/dist/card/card-shared.d.ts +1 -4
- package/dist/card/card-shared.js +2 -4
- package/dist/common/truncate.d.ts +0 -6
- package/dist/common/truncate.js +1 -1
- package/dist/common/ttl-cache.d.ts +24 -0
- package/dist/common/ttl-cache.js +53 -0
- package/dist/config/codex-config.d.ts +22 -0
- package/dist/config/codex-config.js +120 -25
- package/dist/config/index.d.ts +0 -3
- package/dist/config/index.js +0 -5
- package/dist/config/kimi-config.d.ts +1 -1
- package/dist/config/kimi-config.js +1 -1
- package/dist/config/opencode-config.d.ts +1 -1
- package/dist/config/opencode-config.js +3 -8
- package/dist/index.js +6 -0
- package/dist/router/index.d.ts +7 -0
- package/dist/router/index.js +229 -284
- package/dist/runner/claude/session.d.ts +0 -3
- package/dist/runner/claude/session.js +0 -5
- package/dist/runner/codex/app-server/runner.d.ts +1 -16
- package/dist/runner/codex/app-server/runner.js +2 -2
- package/dist/runner/common/acp/protocol-helpers.d.ts +31 -0
- package/dist/runner/common/acp/protocol-helpers.js +48 -0
- package/dist/runner/common/connection-based-runner.d.ts +0 -2
- package/dist/runner/common/connection-based-runner.js +1 -1
- package/dist/runner/dsh/index.d.ts +0 -2
- package/dist/runner/dsh/index.js +0 -2
- package/dist/runner/dsh/runner.d.ts +0 -2
- package/dist/runner/dsh/runner.js +1 -1
- package/dist/runner/index.d.ts +1 -1
- package/dist/runner/kimi/acp/runner.d.ts +18 -11
- package/dist/runner/kimi/acp/runner.js +95 -87
- package/dist/runner/kimi/acp/translator.d.ts +0 -1
- package/dist/runner/kimi/acp/translator.js +5 -13
- package/dist/runner/opencode/acp/error-monitor.d.ts +61 -0
- package/dist/runner/opencode/acp/error-monitor.js +150 -0
- package/dist/runner/opencode/acp/runner.d.ts +17 -0
- package/dist/runner/opencode/acp/runner.js +28 -42
- package/dist/runner/opencode/acp/translator.d.ts +0 -1
- package/dist/runner/opencode/acp/translator.js +3 -13
- package/dist/runner/pi/rpc/index.d.ts +0 -2
- package/dist/runner/pi/rpc/index.js +0 -2
- package/dist/runner/resolve-agent-choices.js +6 -2
- package/dist/runner/sync-agent-choices.js +1 -1
- package/dist/runner/types.d.ts +23 -0
- package/dist/session/claude/session-index.js +3 -1
- package/dist/session/claude/sessions.js +3 -7
- package/dist/session/codex/rollout-reader.d.ts +12 -2
- package/dist/session/codex/rollout-reader.js +259 -173
- package/dist/session/codex/sessions.d.ts +2 -1
- package/dist/session/codex/sessions.js +4 -1
- package/dist/session/common/pagination.d.ts +0 -2
- package/dist/session/common/pagination.js +1 -1
- package/dist/session/common/recency.d.ts +7 -0
- package/dist/session/common/recency.js +10 -0
- package/dist/session/common/usage-accumulator.d.ts +14 -0
- package/dist/session/common/usage-accumulator.js +15 -0
- package/dist/session/dsh/sessions.js +9 -6
- package/dist/session/kimi/sessions.d.ts +18 -4
- package/dist/session/kimi/sessions.js +49 -30
- package/dist/session/opencode/sessions.d.ts +2 -14
- package/dist/session/opencode/sessions.js +9 -7
- package/dist/session/pi/sessions.js +10 -22
- package/dist/update/index.d.ts +2 -2
- package/dist/update/index.js +1 -1
- package/package.json +1 -2
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* - catalog 模式(config.toml 声明 model_catalog_json):模型列表/档位来自活动目录
|
|
9
9
|
* - 非 catalog 模式:openai 用 bundled 全量;anthropic 仅在用户显式配置时存在
|
|
10
10
|
*/
|
|
11
|
-
import { execFileSync } from 'node:child_process';
|
|
11
|
+
import { execFileSync, execFile } from 'node:child_process';
|
|
12
12
|
import fs from 'node:fs';
|
|
13
13
|
import os from 'node:os';
|
|
14
14
|
import path from 'node:path';
|
|
@@ -31,21 +31,20 @@ export function resolveCodexHome(codexHome) {
|
|
|
31
31
|
* 配置 [model_providers.anthropic] 才存在,fallback 阶段不得虚构。
|
|
32
32
|
*/
|
|
33
33
|
const FALLBACK_PROVIDERS = ['openai'];
|
|
34
|
-
const FALLBACK_MODELS = [
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
'claude-sonnet-4-20250514',
|
|
42
|
-
'claude-opus-4-20250115',
|
|
43
|
-
];
|
|
34
|
+
const FALLBACK_MODELS = ['o3', 'o4-mini', 'gpt-4o', 'gpt-4.1', 'gpt-4.1-mini', 'gpt-4.1-nano'];
|
|
35
|
+
/**
|
|
36
|
+
* anthropic 的独立兜底模型表:anthropic 非内置 provider,仅在用户显式配置后使用。
|
|
37
|
+
* 不得混入 FALLBACK_MODELS——无 config.toml 时 openai 的模型列表会原样暴露这些
|
|
38
|
+
* claude 条目(claude 模型列在 openai provider 下是错的)。
|
|
39
|
+
*/
|
|
40
|
+
const ANTHROPIC_FALLBACK_MODELS = ['claude-sonnet-4-20250514', 'claude-opus-4-20250115'];
|
|
44
41
|
/** Bundled models from codex binary, 1h TTL is enough (only change on binary upgrade) */
|
|
45
42
|
const BUNDLED_CACHE_TTL_MS = 60 * 60 * 1000;
|
|
46
43
|
/** 失败/空结果负缓存 TTL:避免每次卡片构建同步阻塞最长 8s(P3-5) */
|
|
47
44
|
const NEGATIVE_CACHE_TTL_MS = 30 * 1000;
|
|
48
45
|
let catalogCache = null;
|
|
46
|
+
/** In-flight async catalog loads, keyed by cache key — dedup concurrent warm ups. */
|
|
47
|
+
const catalogInFlight = new Map();
|
|
49
48
|
/**
|
|
50
49
|
* Read config.toml `model_catalog_json` path (tilde-expanded).
|
|
51
50
|
* 返回语义:
|
|
@@ -153,8 +152,89 @@ export function parseCodexModelsOutput(stdout) {
|
|
|
153
152
|
* 缓存:键含 binary/home/mode/models.json mtime:size + config.toml mtime:size
|
|
154
153
|
* (P3-4/P3-15/P3-5);成功结果 TTL 1h,失败/空结果短 TTL 负缓存;stat 异常时
|
|
155
154
|
* 指纹为空(P1-1/P3-10)。
|
|
155
|
+
*
|
|
156
|
+
* 同步路径(卡片构建用):缓存命中直接返回;若有一个后台异步加载
|
|
157
|
+
* (`loadCodexCatalogModelsAsync` / 启动 warm)在途,则不阻塞事件循环、不重复
|
|
158
|
+
* spawn,直接返回 [] 走既有 fallback(FALLBACK_MODELS / currentModel)——该
|
|
159
|
+
* [] 状态与命令失败/超时的已有语义一致,由调用方既有 fallback 兜底。
|
|
156
160
|
*/
|
|
157
161
|
export function getCodexCatalogModels(codexHome) {
|
|
162
|
+
const { key, bundled } = computeCodexCatalogKey(codexHome);
|
|
163
|
+
const cached = readCachedCatalog(key);
|
|
164
|
+
if (cached !== undefined)
|
|
165
|
+
return cached;
|
|
166
|
+
// in-flight 异步加载进行中:不 execFileSync(会阻塞 8s),返回 [] 交给
|
|
167
|
+
// 调用方既有 fallback;in-flight 完成后下次读取命中缓存。
|
|
168
|
+
if (catalogInFlight.has(key)) {
|
|
169
|
+
return [];
|
|
170
|
+
}
|
|
171
|
+
const now = Date.now();
|
|
172
|
+
try {
|
|
173
|
+
const stdout = execFileSync('codex', catalogArgs(bundled), {
|
|
174
|
+
encoding: 'utf-8',
|
|
175
|
+
timeout: 8_000,
|
|
176
|
+
maxBuffer: 4 * 1024 * 1024,
|
|
177
|
+
env: process.env,
|
|
178
|
+
stdio: ['ignore', 'pipe', 'ignore'],
|
|
179
|
+
});
|
|
180
|
+
const models = parseCodexModelsOutput(stdout);
|
|
181
|
+
catalogCache = { key, models, ts: now, failed: models.length === 0 };
|
|
182
|
+
return models;
|
|
183
|
+
}
|
|
184
|
+
catch (err) {
|
|
185
|
+
getLogger().warn(`[codex-config] models unavailable for binary "codex": ${err.message}`);
|
|
186
|
+
catalogCache = { key, models: [], ts: now, failed: true };
|
|
187
|
+
return [];
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* 异步加载模型目录(execFile,不阻塞事件循环),写入与同步路径共享的
|
|
192
|
+
* `catalogCache`。按缓存 key 复用 in-flight Promise:并发调用(多个 warm /
|
|
193
|
+
* 显式调用)只 spawn 一次 `codex debug models`。
|
|
194
|
+
*
|
|
195
|
+
* 与同步路径的职责划分:启动时用 `warmCodexCatalogCache` 后台预热,使首次打开
|
|
196
|
+
* Codex 配置卡(同步读)时缓存已温、无需 8s execFileSync 阻塞;若用户在 warm
|
|
197
|
+
* 完成前打开卡片,同步路径会检测到 in-flight 并直接返回 [] fallback。
|
|
198
|
+
*/
|
|
199
|
+
export async function loadCodexCatalogModelsAsync(codexHome) {
|
|
200
|
+
const { key, bundled } = computeCodexCatalogKey(codexHome);
|
|
201
|
+
const cached = readCachedCatalog(key);
|
|
202
|
+
if (cached !== undefined)
|
|
203
|
+
return cached;
|
|
204
|
+
const inFlight = catalogInFlight.get(key);
|
|
205
|
+
if (inFlight)
|
|
206
|
+
return inFlight;
|
|
207
|
+
const p = (async () => {
|
|
208
|
+
const now = Date.now();
|
|
209
|
+
try {
|
|
210
|
+
const stdout = await execFileAsync('codex', catalogArgs(bundled));
|
|
211
|
+
const models = parseCodexModelsOutput(stdout);
|
|
212
|
+
catalogCache = { key, models, ts: now, failed: models.length === 0 };
|
|
213
|
+
return models;
|
|
214
|
+
}
|
|
215
|
+
catch (err) {
|
|
216
|
+
getLogger().warn(`[codex-config] models unavailable for binary "codex": ${err.message}`);
|
|
217
|
+
catalogCache = { key, models: [], ts: now, failed: true };
|
|
218
|
+
return [];
|
|
219
|
+
}
|
|
220
|
+
})();
|
|
221
|
+
catalogInFlight.set(key, p);
|
|
222
|
+
try {
|
|
223
|
+
return await p;
|
|
224
|
+
}
|
|
225
|
+
finally {
|
|
226
|
+
catalogInFlight.delete(key);
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
/**
|
|
230
|
+
* 启动/后台预热:fire-and-forget 调用异步加载,消除首次打开 Codex 配置卡时的
|
|
231
|
+
* 8s 同步阻塞。非致命——失败/未安装 codex 时静默落负缓存。
|
|
232
|
+
*/
|
|
233
|
+
export function warmCodexCatalogCache(codexHome) {
|
|
234
|
+
void loadCodexCatalogModelsAsync(codexHome);
|
|
235
|
+
}
|
|
236
|
+
/** 计算目录缓存键(binary/home/mode + 指纹),同步与异步路径共享。 */
|
|
237
|
+
function computeCodexCatalogKey(codexHome) {
|
|
158
238
|
const binary = 'codex';
|
|
159
239
|
const home = resolveCodexHome(codexHome);
|
|
160
240
|
const catalogPath = readModelCatalogJsonPath(home);
|
|
@@ -179,6 +259,10 @@ export function getCodexCatalogModels(codexHome) {
|
|
|
179
259
|
}
|
|
180
260
|
}
|
|
181
261
|
const key = `${binary}\u0000${home}\u0000${bundled ? 'bundled' : 'active'}\u0000${catalogFingerprint}\u0000${configFingerprint}`;
|
|
262
|
+
return { key, bundled };
|
|
263
|
+
}
|
|
264
|
+
/** 读取有效缓存(含负缓存 TTL);命中返回模型,否则 undefined。 */
|
|
265
|
+
function readCachedCatalog(key) {
|
|
182
266
|
const now = Date.now();
|
|
183
267
|
if (catalogCache && catalogCache.key === key) {
|
|
184
268
|
const ttl = catalogCache.failed ? NEGATIVE_CACHE_TTL_MS : BUNDLED_CACHE_TTL_MS;
|
|
@@ -186,24 +270,27 @@ export function getCodexCatalogModels(codexHome) {
|
|
|
186
270
|
return catalogCache.models;
|
|
187
271
|
}
|
|
188
272
|
}
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
273
|
+
return undefined;
|
|
274
|
+
}
|
|
275
|
+
/** `codex debug models` 参数(--bundled 与否)。 */
|
|
276
|
+
function catalogArgs(bundled) {
|
|
277
|
+
return bundled ? ['debug', 'models', '--bundled'] : ['debug', 'models'];
|
|
278
|
+
}
|
|
279
|
+
/** Promisify execFile with the same 8s timeout / 4MB cap as the sync path. */
|
|
280
|
+
function execFileAsync(file, args) {
|
|
281
|
+
return new Promise((resolve, reject) => {
|
|
282
|
+
execFile(file, args, {
|
|
192
283
|
encoding: 'utf-8',
|
|
193
284
|
timeout: 8_000,
|
|
194
285
|
maxBuffer: 4 * 1024 * 1024,
|
|
195
286
|
env: process.env,
|
|
196
|
-
|
|
287
|
+
}, (err, stdout) => {
|
|
288
|
+
if (err)
|
|
289
|
+
reject(err);
|
|
290
|
+
else
|
|
291
|
+
resolve(stdout);
|
|
197
292
|
});
|
|
198
|
-
|
|
199
|
-
catalogCache = { key, models, ts: now, failed: models.length === 0 };
|
|
200
|
-
return models;
|
|
201
|
-
}
|
|
202
|
-
catch (err) {
|
|
203
|
-
getLogger().warn(`[codex-config] models unavailable for binary "${binary}": ${err.message}`);
|
|
204
|
-
catalogCache = { key, models: [], ts: now, failed: true };
|
|
205
|
-
return [];
|
|
206
|
-
}
|
|
293
|
+
});
|
|
207
294
|
}
|
|
208
295
|
/**
|
|
209
296
|
* Test utility: clear the catalog cache. Tests that exercise the bundled
|
|
@@ -213,6 +300,10 @@ export function getCodexCatalogModels(codexHome) {
|
|
|
213
300
|
export function invalidateCodexBundledCache() {
|
|
214
301
|
catalogCache = null;
|
|
215
302
|
}
|
|
303
|
+
/** Test utility: clear in-flight async catalog loads (see async loader tests). */
|
|
304
|
+
export function _clearCodexCatalogInFlightForTest() {
|
|
305
|
+
catalogInFlight.clear();
|
|
306
|
+
}
|
|
216
307
|
/**
|
|
217
308
|
* Get supported reasoning effort options for a model.
|
|
218
309
|
* @param codexHome 可选 codex 配置目录覆盖(与 loadCodexConfig 的 codexHome 对齐,
|
|
@@ -257,7 +348,11 @@ export function loadCodexConfig(opts = {}) {
|
|
|
257
348
|
// 否则 = bundled(与原行为一致)
|
|
258
349
|
const catalogSlugs = getCodexCatalogModels(codexHome).map((m) => m.slug);
|
|
259
350
|
const allModels = catalogSlugs.length > 0 ? catalogSlugs : FALLBACK_MODELS;
|
|
260
|
-
|
|
351
|
+
// anthropic 模型列表仅在用户显式配置 anthropic 时使用:catalog 可用取 catalog 中的
|
|
352
|
+
// claude-*,否则用 ANTHROPIC_FALLBACK_MODELS(与 openai 兜底表隔离)
|
|
353
|
+
const anthropicModels = catalogSlugs.length > 0
|
|
354
|
+
? catalogSlugs.filter((m) => m.startsWith('claude-'))
|
|
355
|
+
: ANTHROPIC_FALLBACK_MODELS;
|
|
261
356
|
if (!fs.existsSync(configFile)) {
|
|
262
357
|
// 无 config.toml:默认模型取目录首个可用模型(codex default_model_from_available),
|
|
263
358
|
// 目录不可用时回退 'o3'(FALLBACK_MODELS 首项,非 catalog 默认)
|
package/dist/config/index.d.ts
CHANGED
|
@@ -237,9 +237,6 @@ export declare const AppConfigSchema: z.ZodObject<{
|
|
|
237
237
|
model: z.ZodOptional<z.ZodString>;
|
|
238
238
|
thinkingEffort: z.ZodOptional<z.ZodString>;
|
|
239
239
|
}, z.core.$strip>>;
|
|
240
|
-
dsh: z.ZodOptional<z.ZodObject<{
|
|
241
|
-
host: z.ZodOptional<z.ZodString>;
|
|
242
|
-
}, z.core.$strip>>;
|
|
243
240
|
}, z.core.$strip>>;
|
|
244
241
|
idle: z.ZodDefault<z.ZodObject<{
|
|
245
242
|
watchdogMinutes: z.ZodDefault<z.ZodNumber>;
|
package/dist/config/index.js
CHANGED
|
@@ -246,11 +246,6 @@ const AgentChoicesSchema = z.object({
|
|
|
246
246
|
thinkingEffort: z.string().optional(),
|
|
247
247
|
})
|
|
248
248
|
.optional(),
|
|
249
|
-
dsh: z
|
|
250
|
-
.object({
|
|
251
|
-
host: z.string().optional(),
|
|
252
|
-
})
|
|
253
|
-
.optional(),
|
|
254
249
|
});
|
|
255
250
|
export const AppConfigSchema = z.object({
|
|
256
251
|
feishu: FeishuConfigSchema,
|
|
@@ -22,7 +22,7 @@ interface KimiConfigResult {
|
|
|
22
22
|
/** Model -> default effort mapping */
|
|
23
23
|
modelDefaultEfforts: Record<string, string>;
|
|
24
24
|
}
|
|
25
|
-
/**
|
|
25
|
+
/** 清空缓存(仅供测试使用,生产代码无调用点) */
|
|
26
26
|
export declare function invalidateKimiConfigCache(): void;
|
|
27
27
|
/**
|
|
28
28
|
* Load Kimi models from `kimi provider list --json`.
|
|
@@ -10,7 +10,7 @@ import { getLogger } from '../logger/index.js';
|
|
|
10
10
|
export const KIMI_THINKING_EFFORTS = ['low', 'high', 'max'];
|
|
11
11
|
/** Fallback efforts when all values are filtered out */
|
|
12
12
|
export const FALLBACK_EFFORTS = ['low', 'high', 'max'];
|
|
13
|
-
/**
|
|
13
|
+
/** 清空缓存(仅供测试使用,生产代码无调用点) */
|
|
14
14
|
export function invalidateKimiConfigCache() {
|
|
15
15
|
kimiConfigCache = null;
|
|
16
16
|
}
|
|
@@ -9,7 +9,7 @@ interface OpencodeConfigResult {
|
|
|
9
9
|
/** 根据 provider 获取可用模型列表(返回纯 model ID,不带 provider 前缀) */
|
|
10
10
|
modelOptions: (provider?: string) => string[];
|
|
11
11
|
}
|
|
12
|
-
/**
|
|
12
|
+
/** 清空缓存(仅供测试使用,生产代码无调用点) */
|
|
13
13
|
export declare function invalidateOpencodeConfigCache(): void;
|
|
14
14
|
/**
|
|
15
15
|
* 加载 opencode 配置,执行 opencode models --verbose 并解析
|
|
@@ -10,18 +10,13 @@ import { getLogger } from '../logger/index.js';
|
|
|
10
10
|
* 当 opencode 命令失败时使用
|
|
11
11
|
* 格式:provider/model(内部用,modelOptions 返回时会去掉 provider 前缀)
|
|
12
12
|
*/
|
|
13
|
-
const FALLBACK_PROVIDERS = [
|
|
14
|
-
'opencode',
|
|
15
|
-
'deepseek',
|
|
16
|
-
'minimax-cn-coding-plan',
|
|
17
|
-
'myprovider',
|
|
18
|
-
'volcengine-plan',
|
|
19
|
-
];
|
|
20
13
|
const FALLBACK_MODELS = {
|
|
21
14
|
opencode: ['big-pickle'],
|
|
22
15
|
deepseek: ['deepseek-chat'],
|
|
23
16
|
'minimax-cn-coding-plan': ['MiniMax-M2.5'],
|
|
24
17
|
};
|
|
18
|
+
/** fallback provider 列表从模型表派生,保证不会出现空模型列表的 provider(历史曾混入无模型的 myprovider/volcengine-plan) */
|
|
19
|
+
const FALLBACK_PROVIDERS = Object.keys(FALLBACK_MODELS);
|
|
25
20
|
/** 正缓存 TTL:opencode models 列表短时间不变,1 分钟(与 kimi-config 对齐) */
|
|
26
21
|
const OPENCODE_CONFIG_CACHE_TTL_MS = 60_000;
|
|
27
22
|
/**
|
|
@@ -31,7 +26,7 @@ const OPENCODE_CONFIG_CACHE_TTL_MS = 60_000;
|
|
|
31
26
|
const OPENCODE_NEGATIVE_CACHE_TTL_MS = 30_000;
|
|
32
27
|
let opencodeConfigCache = null;
|
|
33
28
|
let opencodeConfigFailedAt = null;
|
|
34
|
-
/**
|
|
29
|
+
/** 清空缓存(仅供测试使用,生产代码无调用点) */
|
|
35
30
|
export function invalidateOpencodeConfigCache() {
|
|
36
31
|
opencodeConfigCache = null;
|
|
37
32
|
opencodeConfigFailedAt = null;
|
package/dist/index.js
CHANGED
|
@@ -6,6 +6,7 @@ import { FeishuConnector } from './connector/index.js';
|
|
|
6
6
|
import { ClaudeRunner, CodexAppServerRunner, OpencodeAcpRunner, PiRpcRunner, KimiAcpRunner, DshRunner, } from './runner/index.js';
|
|
7
7
|
import { AgentRegistry } from './runner/registry.js';
|
|
8
8
|
import { probeAllAgents } from './runner/probe.js';
|
|
9
|
+
import { warmCodexCatalogCache } from './config/codex-config.js';
|
|
9
10
|
import { SessionReaderRegistry, SessionStore } from './session/index.js';
|
|
10
11
|
import { ClaudeSessionReader, CodexSessionReader, OpencodeSessionReader, PiSessionReader, KimiSessionReader, DshSessionReader, } from './session/index.js';
|
|
11
12
|
import { CommandRouter, isImmediateAction } from './router/index.js';
|
|
@@ -289,6 +290,11 @@ function initializeRunner(config, configDir, cliArgs) {
|
|
|
289
290
|
.catch(() => {
|
|
290
291
|
// Probe failure is non-fatal; /config card will retry on open.
|
|
291
292
|
});
|
|
293
|
+
// Warm the codex model catalog in the background so the first Codex /config
|
|
294
|
+
// card open reads a warm cache instead of blocking the event loop for up to
|
|
295
|
+
// 8s (execFileSync cold path). Fire-and-forget; failure lands in negative
|
|
296
|
+
// cache and the sync card path falls back gracefully.
|
|
297
|
+
warmCodexCatalogCache();
|
|
292
298
|
return { agentRegistry, sessionReaderRegistry };
|
|
293
299
|
}
|
|
294
300
|
/** Setup message and card action handlers. */
|
package/dist/router/index.d.ts
CHANGED
|
@@ -203,6 +203,8 @@ export declare class CommandRouter {
|
|
|
203
203
|
* Routes to the appropriate bridge method based on value.cmd.
|
|
204
204
|
* Returns a toast response for immediate user feedback.
|
|
205
205
|
*/
|
|
206
|
+
/** queue.* 卡片动作通用守卫:workspace/messageId 缺失时回复错误并返回 null。 */
|
|
207
|
+
private queuePayloadOrReply;
|
|
206
208
|
/** 答案类操作的统一失败反馈:重复投递(同一 nonce 第二次点击)是已生效的
|
|
207
209
|
* 中性事件,报 error 会误导(首次点击实际已成功)。 */
|
|
208
210
|
private answerFailureToast;
|
|
@@ -300,6 +302,11 @@ export declare class CommandRouter {
|
|
|
300
302
|
* Handle order.aliasEdit: 展示别名编辑卡(input + ✓ 提交图标)。
|
|
301
303
|
* 有别名时预填;提交 `order.aliasInput` 处理(含校验与唯一性)。
|
|
302
304
|
*/
|
|
305
|
+
/**
|
|
306
|
+
* order 编辑卡公共骨架:payload 校验 → 查指令 → 构造 input 编辑卡 → 原地更新。
|
|
307
|
+
* handleOrderAliasEdit / handleOrderTextEdit 原先各持一份 ~90% 相同的 4 段结构。
|
|
308
|
+
*/
|
|
309
|
+
private showOrderEditCard;
|
|
303
310
|
private handleOrderAliasEdit;
|
|
304
311
|
/**
|
|
305
312
|
* Handle order.aliasInput: 提交别名(绑/改/解绑),随后重渲染 /order 列表卡。
|