@clawos-dev/clawd 0.2.383 → 0.2.384
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.
|
@@ -21468,11 +21468,21 @@ var DispatchRunArgsSchema = external_exports.object({
|
|
|
21468
21468
|
// 跨设备 dispatch:非空 = A 角色,转发到该 contact deviceId 的 peer daemon;
|
|
21469
21469
|
// 省略 = 本地 dispatch / B 角色本地执行。A 转发给 B 时 body 不带此字段。
|
|
21470
21470
|
targetDeviceId: external_exports.string().min(1).optional(),
|
|
21471
|
-
// 可选:override B session
|
|
21472
|
-
//
|
|
21473
|
-
//
|
|
21474
|
-
// protocol 层保持 string
|
|
21471
|
+
// 可选:override B session 使用的模型。缺省 = 用 persona 默认。
|
|
21472
|
+
// 合法值集**从属于 tool**(见下面的 tool 字段):claude 侧与 tools/claude.ts
|
|
21473
|
+
// CLAUDE_MODEL_IDS 一致,codex 侧是运行时查来的模型表;handler 层做二次校验,
|
|
21474
|
+
// 非法值 fail-fast。protocol 层保持 string(不在协议里钉死枚举)。
|
|
21475
|
+
// **只能用于新开 dispatch**:续派不改任何 spawn 参数(worker session 已经跑起来了),
|
|
21476
|
+
// 与 dispatchId 互斥(下方 refine 硬拒)。
|
|
21475
21477
|
model: external_exports.string().min(1).optional(),
|
|
21478
|
+
// 可选:override B session 使用的 agent tool(engine)。缺省 = 用 persona 绑定的 tool。
|
|
21479
|
+
// 语义是**一次性**——不改 persona 的持久绑定,只决定这条 dispatch 起的 worker session。
|
|
21480
|
+
// 为什么需要:`model` 的合法值集从属于 tool,想让一个 claude persona 这次用
|
|
21481
|
+
// `gpt-5.6-sol` 干活,必须能连 engine 一起换(否则 model 校验按 persona.tool 选表直接拒)。
|
|
21482
|
+
// 合法值集 = daemon 的 adapter 注册表('claude' / 'codex'),handler 层运行时校验;
|
|
21483
|
+
// protocol 层保持 string(与 model / SessionFile.tool 同款处理,不在协议里钉死枚举)。
|
|
21484
|
+
// 与 model 同样**只能用于新开 dispatch**(下方 refine 硬拒 dispatchId 组合)。
|
|
21485
|
+
tool: external_exports.string().min(1).optional(),
|
|
21476
21486
|
// 可选:给新 worker session 起 label(写入 SessionFile.label,sidebar 显示)。
|
|
21477
21487
|
// 仅在**新开 dispatch**(dispatchId 缺席)时生效;续派(dispatchId 非空)
|
|
21478
21488
|
// 时 daemon 层静默丢弃(避免半途改 label 造成 sidebar 抖动)。
|
|
@@ -21487,6 +21497,10 @@ var DispatchRunArgsSchema = external_exports.object({
|
|
|
21487
21497
|
message: "either targetPersona (new dispatch) or dispatchId (follow-up) is required"
|
|
21488
21498
|
}).refine((v) => !(v.dispatchId !== void 0 && v.targetDeviceId !== void 0), {
|
|
21489
21499
|
message: "cross-device dispatch cannot be continued (dispatchId + targetDeviceId are mutually exclusive)"
|
|
21500
|
+
}).refine((v) => !(v.tool !== void 0 && v.targetDeviceId !== void 0), {
|
|
21501
|
+
message: "engine override is not supported for cross-device dispatch (tool + targetDeviceId are mutually exclusive)"
|
|
21502
|
+
}).refine((v) => !(v.dispatchId !== void 0 && (v.tool !== void 0 || v.model !== void 0)), {
|
|
21503
|
+
message: "a follow-up dispatch cannot change engine or model (dispatchId excludes tool / model); start a new dispatch instead"
|
|
21490
21504
|
});
|
|
21491
21505
|
var DispatchCompleteArgsSchema = external_exports.object({
|
|
21492
21506
|
dispatchId: external_exports.string().min(1),
|
|
@@ -24636,6 +24650,9 @@ async function handlePersonaDispatchToolCall(input, ctx) {
|
|
|
24636
24650
|
// T-20: 可选 override B session 使用的 claude 模型;MCP tool 层已 enum 校验,
|
|
24637
24651
|
// daemon handler 层还会再校验一次(fail-fast)。
|
|
24638
24652
|
...input.model ? { model: input.model } : {},
|
|
24653
|
+
// 一次性 engine override(spec 2026-08-24):换 codex 的 model 必须连 engine 一起换。
|
|
24654
|
+
// 合法性 + 与 model 的匹配由 daemon handler 校验(错误消息列出 allowed 值)。
|
|
24655
|
+
...input.tool ? { tool: input.tool } : {},
|
|
24639
24656
|
// butler 顶部入口:可选 sessionLabel 落到新 worker SessionFile.label。
|
|
24640
24657
|
// 长度 1-60 由 protocol schema 强约束;续派场景(dispatchId 非空)daemon 层静默丢弃。
|
|
24641
24658
|
...input.sessionLabel ? { sessionLabel: input.sessionLabel } : {},
|
|
@@ -24807,13 +24824,13 @@ async function main() {
|
|
|
24807
24824
|
"personaDispatch",
|
|
24808
24825
|
{
|
|
24809
24826
|
title: "Dispatch task to another persona",
|
|
24810
|
-
description: "Delegate a task to another clawd persona. Use this when the user message contains `@persona/<id>` to hand the task off to that persona. Returns immediately with a dispatchId; the result will be delivered back into your session automatically when the target persona finishes \u2014 do not wait or poll. To continue an existing dispatched task (follow-up instruction into the same worker session), pass its dispatchId and omit targetPersona. Use personaDispatchList to check progress if asked.",
|
|
24827
|
+
description: "Delegate a task to another clawd persona. Use this when the user message contains `@persona/<id>` to hand the task off to that persona. Returns immediately with a dispatchId; the result will be delivered back into your session automatically when the target persona finishes \u2014 do not wait or poll. To continue an existing dispatched task (follow-up instruction into the same worker session), pass its dispatchId and omit targetPersona. Use personaDispatchList to check progress if asked. To run this one task on a different engine than the persona is bound to, pass tool (+ a matching model) \u2014 a one-off override that does not change the persona.",
|
|
24811
24828
|
inputSchema: {
|
|
24812
24829
|
targetPersona: external_exports.string().optional().describe(
|
|
24813
24830
|
"persona id (e.g. persona-app-builder); omit when continuing an existing dispatch via dispatchId"
|
|
24814
24831
|
),
|
|
24815
24832
|
dispatchId: external_exports.string().optional().describe(
|
|
24816
|
-
"continue an existing dispatched task: the prompt is delivered into the same worker session as a new turn (context preserved)
|
|
24833
|
+
"continue an existing dispatched task: the prompt is delivered into the same worker session as a new turn (context preserved). The worker session keeps its original engine and model \u2014 passing tool or model together with dispatchId is rejected; start a new dispatch to change either."
|
|
24817
24834
|
),
|
|
24818
24835
|
prompt: external_exports.string().describe(
|
|
24819
24836
|
"the task to perform, with the @persona/<id> token stripped out"
|
|
@@ -24827,7 +24844,13 @@ async function main() {
|
|
|
24827
24844
|
// 明明能选到的新模型。精确校验下沉到 daemon handler(按 target persona tool 查运行时
|
|
24828
24845
|
// capabilities,fail-fast 且错误消息列出 allowed 值,caller 据此自我纠正)。
|
|
24829
24846
|
model: external_exports.string().optional().describe(
|
|
24830
|
-
"override the target persona's default model. Omit to use the persona default.
|
|
24847
|
+
"override the target persona's default model for this one dispatch. New dispatches only (rejected together with dispatchId). Omit to use the persona default. The valid set depends on the engine that will actually run (see tool): claude \u2192 " + CLAUDE_MODEL_IDS.join(" / ") + "; codex \u2192 model ids vary by installed codex version (e.g. gpt-5.6-sol), omit unless you know the exact id (invalid values are rejected with the allowed list)."
|
|
24848
|
+
),
|
|
24849
|
+
// 一次性 engine override (spec 2026-08-24):model 的合法值集从属于 engine,所以
|
|
24850
|
+
// 「这次用 codex 的某个模型干」必须能连 engine 一起换,否则 model 校验按 persona
|
|
24851
|
+
// 绑定的 engine 选表直接拒。
|
|
24852
|
+
tool: external_exports.string().optional().describe(
|
|
24853
|
+
"run this one dispatch on a specific engine instead of the persona's bound one: 'claude' or 'codex'. One-off \u2014 the persona's own binding is untouched. Pass this whenever you pass a model that belongs to the other engine (e.g. tool='codex' + model='gpt-5.6-sol' for a persona bound to claude). New dispatches only: rejected together with dispatchId (follow-ups keep the worker session's engine) or with targetDeviceId (a remote persona keeps its owner's engine)."
|
|
24831
24854
|
),
|
|
24832
24855
|
// butler 顶部入口 (spec 2026-07-27):butler 给新 worker session 起 label 用。
|
|
24833
24856
|
// Sidebar 直接显示这个 label(否则兜底 cwd-basename 都是 persona 目录名,同一
|