@eddyskywalker/dsh-chatgpt-subscription 0.63.1 → 0.64.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/lib/index.js CHANGED
@@ -808,7 +808,7 @@ const ROUTE_PREFIX$5 = "/api/dsh-chatgpt-subscription";
808
808
  * `test/responses-client.test.ts` asserts the two agree, so a release that
809
809
  * forgets this constant fails the suite instead of shipping quietly.
810
810
  */
811
- const PLUGIN_VERSION = "0.63.1";
811
+ const PLUGIN_VERSION = "0.64.0";
812
812
  const CODEX_CHATGPT_PROVIDER_ID = "codex-chatgpt";
813
813
  const CODEX_API_BASE = "https://chatgpt.com/backend-api/codex";
814
814
  const CODEX_RESPONSES_URL = `${CODEX_API_BASE}/responses`;
@@ -87285,10 +87285,12 @@ function prefixedModelReason(pair, allowed) {
87285
87285
  * @param toolName - the tool the model called.
87286
87286
  * @param provider - the provider the call named.
87287
87287
  * @param model - the model the call named.
87288
+ * @param explicitTools - Tools that DO expose a route pair; naming them gives the
87289
+ * next call a concrete target instead of "some other tool".
87288
87290
  * @returns the corrective reason handed back to the model.
87289
87291
  */
87290
- function inheritOverrideReason(toolName, provider, model) {
87291
- return `subagent model selection: "${toolName}" always runs on the calling agent's own route and accepts no provider/model. This call named "${provider}/${model}". Remove those fields, or delegate through a tool that supports explicit child model selection.`;
87292
+ function inheritOverrideReason(toolName, provider, model, explicitTools = []) {
87293
+ return `subagent model selection: "${toolName}" always runs on the calling agent's own route and accepts no provider/model. This call named "${provider}/${model}". Remove those fields to keep the child on your own route, or delegate through ${explicitTools.length === 0 ? "a tool that supports explicit child model selection" : explicitTools.map((name) => "\"" + name + "\"").join(" or ")} with provider and model.`;
87292
87294
  }
87293
87295
  /**
87294
87296
  * Build the denial reason for an inherit-mode delegation whose inherited route
@@ -87561,31 +87563,58 @@ function rewriteAuthorizedToolDescriptions(text, allowed) {
87561
87563
  return text.replaceAll("Catalog membership is advisory: an adapter may accept an unlisted model id.", `Output is already filtered to this Session's allowlist (${routes}); only these authorized provider/model routes are accepted.`).replace(/Child LLM selection is optional\.\s*Omit `?provider`?, `?model`?, and `?reasoning_effort`? to use configured child defaults and (?:inherit compatible missing values from the parent Agent|this provider's route defaults)\./g, required).replace(/Supply `provider` and `model` together\. Omitted values use child defaults, falling back to (?:this backend's route defaults|compatible parent values)\./g, required).replace(/Supply together with model; omit both to use configured child defaults or (?:inherit the parent route|this provider's route defaults)\.|Omit to use the configured child default or inherit from the parent Agent\./g, `Required in this Session: pass an authorized provider id from list_subagent_models (${routes}).`).replace(/Supply together with provider; omit both to use configured child defaults or (?:inherit the parent route|this provider's route defaults)\.|Omit to use the configured child default or inherit when the child provider matches the parent provider\./g, "Required in this Session: pass the authorized model id (without the provider/ prefix) for the selected provider.").replaceAll("Child LLM provider id.", `Required in this Session: pass an authorized provider id from list_subagent_models (${routes}).`).replaceAll("Model id within that provider.", "Required in this Session: pass the authorized model id (without the provider/ prefix) for the selected provider.");
87562
87564
  }
87563
87565
  /**
87566
+ * The sentence that keeps a route out of an inherit-mode delegation tool.
87567
+ *
87568
+ * The persona can say "pass provider and model" while the inherit tool has no such
87569
+ * field, and no upstream description says so: the inherited route is implied by the
87570
+ * tool itself. Stating it in the tool's own description is the only place the model
87571
+ * reads immediately before it decides how to spell the call.
87572
+ * @param explicitTools - Tools that expose a `provider`/`model` pair.
87573
+ * @param inheritTools - Tools whose child always runs on the caller's own route.
87574
+ * @param target - Which side of the pair is being described.
87575
+ * @returns one sentence, or '' when there is nothing to say.
87576
+ */
87577
+ function inheritRouteNoticeSentence(explicitTools, inheritTools, target) {
87578
+ if (explicitTools.length === 0 || inheritTools.length === 0) return "";
87579
+ const explicit = explicitTools.map((name) => "\"" + name + "\"").join(" or ");
87580
+ const inherit = inheritTools.map((name) => "\"" + name + "\"").join(" or ");
87581
+ return target === "explicit" ? "Never pass provider/model to " + inherit + ": it always runs its child on the calling agent's own route and rejects any route field." : "This tool takes no provider/model: its child always runs on the calling agent's own route. To choose a route, call " + explicit + " with provider and model.";
87582
+ }
87583
+ /**
87564
87584
  * Rewrite one assembled prompt's `tools:sdk` section and native tool schemas
87565
87585
  * when the target Agent's Session enforces a subagent model allowlist.
87566
87586
  * @param assembly - Assembled prompt from `system-prompt/assemble`.
87567
87587
  * @param allowed - Routes the calling Session authorizes.
87568
87588
  * @param toolNames - Explicit-route delegation tool names.
87589
+ * @param inheritToolNames - Tools whose child keeps the caller's route; their
87590
+ * descriptions gain the matching route notice.
87569
87591
  * @returns the updated assembly, or the original object when nothing changed.
87570
87592
  */
87571
- function rewriteAuthorizedPromptAssembly(assembly, allowed, toolNames = DEFAULT_DELEGATION_TOOLS) {
87593
+ function rewriteAuthorizedPromptAssembly(assembly, allowed, toolNames = DEFAULT_DELEGATION_TOOLS, inheritToolNames = DEFAULT_SUBAGENT_INHERIT_TOOLS) {
87572
87594
  if (allowed.length === 0) return assembly;
87573
87595
  let sectionsChanged = false;
87574
87596
  const sections = Array.isArray(assembly.sections) ? assembly.sections.map((section) => {
87575
87597
  if (section?.name !== "tools:sdk" || typeof section.text !== "string") return section;
87576
87598
  const rewritten = rewriteAuthorizedToolDescriptions(section.text, allowed);
87577
- if (rewritten === section.text) return section;
87599
+ const notice = inheritRouteNoticeSentence(toolNames, inheritToolNames, "explicit");
87600
+ const text = notice.length > 0 && !rewritten.includes(notice) ? rewritten + "\n\n" + notice : rewritten;
87601
+ if (text === section.text) return section;
87578
87602
  sectionsChanged = true;
87579
87603
  return {
87580
87604
  ...section,
87581
- text: rewritten
87605
+ text
87582
87606
  };
87583
87607
  }) : assembly.sections;
87584
87608
  let toolsChanged = false;
87585
87609
  const tools = Array.isArray(assembly.tools) ? assembly.tools.map((tool) => {
87586
87610
  const name = asString$6(tool?.name);
87587
- if (name === void 0 || name !== "list_subagent_models" && !toolNames.includes(name)) return tool;
87588
- const description = typeof tool.description === "string" ? rewriteAuthorizedToolDescriptions(tool.description, allowed) : tool.description;
87611
+ if (name === void 0) return tool;
87612
+ const isExplicit = toolNames.includes(name);
87613
+ const isInherit = inheritToolNames.includes(name);
87614
+ if (name !== "list_subagent_models" && !isExplicit && !isInherit) return tool;
87615
+ const rewrittenDescription = typeof tool.description === "string" ? rewriteAuthorizedToolDescriptions(tool.description, allowed) : tool.description;
87616
+ const notice = isExplicit || isInherit ? inheritRouteNoticeSentence(toolNames, inheritToolNames, isExplicit ? "explicit" : "inherit") : "";
87617
+ const description = typeof rewrittenDescription === "string" && notice.length > 0 && !rewrittenDescription.includes(notice) ? rewrittenDescription + " " + notice : rewrittenDescription;
87589
87618
  let params = tool.parameters;
87590
87619
  const paramsRecord = asRecord$2(params);
87591
87620
  const propsRecord = asRecord$2(paramsRecord?.["properties"]);
@@ -87653,7 +87682,7 @@ function delegationDenialReason(agent, toolName, args, preference, sessions, too
87653
87682
  const requestedProvider = asString$6(request["provider"]);
87654
87683
  const requestedModel = asString$6(request["model"]);
87655
87684
  if (mode === "inherit") {
87656
- if (requestedProvider !== void 0 || requestedModel !== void 0) return inheritOverrideReason(toolName, requestedProvider ?? "", requestedModel ?? "");
87685
+ if (requestedProvider !== void 0 || requestedModel !== void 0) return inheritOverrideReason(toolName, requestedProvider ?? "", requestedModel ?? "", toolNames);
87657
87686
  if (parentForkToolNames.includes(toolName) && effectiveAllowParentFork(agent, preference, sessions, lockSnapshot)) return;
87658
87687
  return inheritedRouteDenial(agent, toolName, allowed);
87659
87688
  }
@@ -87827,7 +87856,7 @@ function installSubagentModelAuthorization(ctx, sessions, config = {}) {
87827
87856
  return decision;
87828
87857
  });
87829
87858
  const disposeAssemble = eventHost.on?.("system-prompt/assemble", async (_assembly, context, next) => {
87830
- return rewriteAuthorizedPromptAssembly(await next(), effectiveAllowedRoutes(context?.agent ?? context?.scope, currentPreference(), sessions, scope, true), toolNames);
87859
+ return rewriteAuthorizedPromptAssembly(await next(), effectiveAllowedRoutes(context?.agent ?? context?.scope, currentPreference(), sessions, scope, true), toolNames, inheritToolNames);
87831
87860
  });
87832
87861
  return () => {
87833
87862
  disposeGuard();
@@ -90673,6 +90702,8 @@ function promptRefDescriptor(promptText) {
90673
90702
  }
90674
90703
  /** 默认承认的派发工具名。 */
90675
90704
  const DEFAULT_DISPATCH_TOOLS = ["subagent", "subagent_fork"];
90705
+ /** 模型选择守卫拒绝时记下的拒绝码。 */
90706
+ const SUBAGENT_SELECTION_DENIAL_CODE = "SUBAGENT_MODEL_SELECTION";
90676
90707
  const ATTEMPT_SCHEMA = z.strictObject({
90677
90708
  callId: z.string(),
90678
90709
  ns: z.string(),
@@ -90938,7 +90969,9 @@ function detectGuardDenialCode(content) {
90938
90969
  const texts = textBlocksOf(content);
90939
90970
  if (texts.length === 0) return void 0;
90940
90971
  const joined = texts.join("\n").trim();
90941
- return (/* @__PURE__ */ new RegExp("^(?:Error:\\s*)?DISPATCH_LEDGER_V2:([A-Z_]+)")).exec(joined)?.[1];
90972
+ const match = (/* @__PURE__ */ new RegExp("^(?:Error:\\s*)?DISPATCH_LEDGER_V2:([A-Z_]+)")).exec(joined);
90973
+ if (match?.[1] !== void 0) return match[1];
90974
+ return (/* @__PURE__ */ new RegExp("^(?:Error:\\s*)?subagent model selection:")).test(joined) ? SUBAGENT_SELECTION_DENIAL_CODE : void 0;
90942
90975
  }
90943
90976
  /**
90944
90977
  * 聚合一次运行的 attempt 计数,得出它的状态。
@@ -90948,15 +90981,18 @@ function detectGuardDenialCode(content) {
90948
90981
  * 两条额外的单调性规则:
90949
90982
  *
90950
90983
  * 1. **报告是终态**:报告到达之后,后来的 attempt 不再改写状态。
90951
- * 2. **终态不被后来的 attempt 改写**:released / denied / completed / blocked
90984
+ * 2. **已落地的终态不被后来的 attempt 改写**:released / completed / blocked
90952
90985
  * 之后不再回到 booked——否则"第二次被拒的失败"会把第一次的结论改掉。
90986
+ * `denied` **是例外**:它只说明这个运行的尝试全部被守卫在派发前拒掉,
90987
+ * 没有任何已经发生的派发值得保护,所以再收到一次尝试时按计数重算
90988
+ * (修正后的同一命名空间因此能真的派发出去)。
90953
90989
  * @param run - 当前运行记录。
90954
90990
  * @param totals - attempt 聚合计数。
90955
90991
  * @returns 运行状态。
90956
90992
  */
90957
90993
  function aggregateRunState(run, totals) {
90958
90994
  if (run.report !== void 0) return run.state;
90959
- if (run.state !== "booked") return run.state;
90995
+ if (run.state !== "booked" && run.state !== "denied") return run.state;
90960
90996
  if (totals.succeeded > 0) return "booked";
90961
90997
  if (totals.unknown > 0) return "booked";
90962
90998
  if (totals.toolError > 0) return "released";
@@ -91094,12 +91130,16 @@ function recordAttempt(state, header, callId, tool, outcome, denialCode, seq, at
91094
91130
  counters
91095
91131
  });
91096
91132
  }
91097
- const run = applyAttemptToRun(existing, attempt);
91133
+ const run = applyAttemptToRun(existing.state === "denied" ? {
91134
+ ...existing,
91135
+ body_sha256: sha256Hex(body),
91136
+ tool
91137
+ } : existing, attempt);
91098
91138
  const runs = {
91099
91139
  ...state.runs,
91100
91140
  [ns]: run
91101
91141
  };
91102
- const counters = {
91142
+ const counters = existing.state === "denied" ? state.counters : {
91103
91143
  ...state.counters,
91104
91144
  duplicates: state.counters.duplicates + 1
91105
91145
  };
@@ -92010,6 +92050,10 @@ function createDispatchLedgerReservations(options = {}) {
92010
92050
  if (entry === void 0) return false;
92011
92051
  return entry.callId !== callId;
92012
92052
  },
92053
+ holder(issuer, ns) {
92054
+ prune();
92055
+ return entries.get(keyOf(issuer, ns))?.callId;
92056
+ },
92013
92057
  reserve(issuer, ns, callId) {
92014
92058
  prune();
92015
92059
  const key = keyOf(issuer, ns);
@@ -92075,6 +92119,22 @@ function dispatchCapacityExcluding(state, brief_id, currentNs, callId) {
92075
92119
  };
92076
92120
  }
92077
92121
  /**
92122
+ * 这条运行除「本次调用自己那条待结算 attempt」以外,是否有过真实的派发尝试。
92123
+ *
92124
+ * 判定只读 `attemptTotals`:它是权威计数,而展示用的 `attempts` 会被截断。
92125
+ * `succeeded` / `toolError` 都证明那次调用真的执行过;`unknown` 还包含「结局
92126
+ * 丢失但其实派出去了」——这些都必须继续占住命名空间。只有「本次调用自己的
92127
+ * 那条」要减掉,因为宿主在守卫之前就把它写进了日志。
92128
+ * @param run - 运行记录。
92129
+ * @param ownPending - 本次调用自己的那条 attempt 是否仍在待结算表里。
92130
+ * @returns 除本次调用外是否有过真实派发。
92131
+ */
92132
+ function runClaimedByDispatch(run, ownPending) {
92133
+ const totals = run.attemptTotals;
92134
+ const unknownOthers = totals.unknown - (ownPending ? 1 : 0);
92135
+ return totals.succeeded > 0 || totals.toolError > 0 || unknownOthers > 0;
92136
+ }
92137
+ /**
92078
92138
  * 校验一次**派发**调用。
92079
92139
  * @param header - 派发头。
92080
92140
  * @param state - 调用方会话的账本状态。
@@ -92087,7 +92147,8 @@ function checkDispatchMandate(header, state, callId, policy, promptRef, reserved
92087
92147
  if (promptRef !== void 0 && header.prompt_ref !== promptRef) return dispatchDenial("MANDATE_VERSION", "the header carries prompt_ref \"" + header.prompt_ref + "\" but this host runs prompt_ref \"" + promptRef + "\". Copy it verbatim from dispatch_ledger {action:\"self\"}.");
92088
92148
  const ns = mandateNamespaceKey(header);
92089
92149
  const existing = runOf(state, ns);
92090
- if (existing !== void 0 && existing.createdByCallId !== callId) return dispatchDenial("MANDATE_DUPLICATE", "the namespace (brief_id \"" + header.brief_id + "\", run_id \"" + header.run_id + "\", idem \"" + header.idem + "\") is already claimed by call " + existing.createdByCallId + ". A namespace is never reusable: use a NEW run_id AND a NEW idem, and set parent_mandate.");
92150
+ const ownPending = callId !== void 0 && state.pending[callId] === ns;
92151
+ if (existing !== void 0 && existing.createdByCallId !== callId && runClaimedByDispatch(existing, ownPending)) return dispatchDenial("MANDATE_DUPLICATE", "the namespace (brief_id \"" + header.brief_id + "\", run_id \"" + header.run_id + "\", idem \"" + header.idem + "\") is already claimed by call " + existing.createdByCallId + ". A namespace is never reusable: use a NEW run_id AND a NEW idem, and set parent_mandate.");
92091
92152
  if (reserved?.(ns) === true) return dispatchDenial("MANDATE_DUPLICATE", "the namespace (brief_id \"" + header.brief_id + "\", run_id \"" + header.run_id + "\", idem \"" + header.idem + "\") is reserved by another call in flight.");
92092
92153
  const capacity = dispatchCapacityExcluding(state, header.brief_id, ns, callId);
92093
92154
  if (capacity.full) return dispatchDenial("MANDATE_LEDGER_FULL", "the ledger already holds " + capacity.runs + " runs and " + capacity.briefs + " briefs (limits 256/64). Report it instead of reusing an old namespace.");
@@ -92186,7 +92247,14 @@ function createDispatchLedgerGuard(options) {
92186
92247
  const callId = asString$2(execution?.callId);
92187
92248
  const issuer = session === void 0 ? void 0 : sessionIdOf(session);
92188
92249
  const ns = mandateNamespaceKey(header);
92189
- const denial = checkDispatchMandate(header, state, callId, policy, options.promptRef, issuer === void 0 ? void 0 : (key) => reservations.conflicts(issuer, key, callId ?? ""));
92250
+ const denial = checkDispatchMandate(header, state, callId, policy, options.promptRef, issuer === void 0 ? void 0 : (key) => {
92251
+ if (!reservations.conflicts(issuer, key, callId ?? "")) return false;
92252
+ const holder = reservations.holder(issuer, key);
92253
+ const heldRun = runOf(state, key);
92254
+ const ownPendingForHeld = callId !== void 0 && state.pending[callId] === key;
92255
+ if (holder !== void 0 && heldRun !== void 0 && heldRun.createdByCallId === holder && !runClaimedByDispatch(heldRun, ownPendingForHeld)) return false;
92256
+ return true;
92257
+ });
92190
92258
  if (denial === void 0 && issuer !== void 0 && callId !== void 0) reservations.reserve(issuer, ns, callId);
92191
92259
  return denial;
92192
92260
  }
@@ -92254,7 +92322,24 @@ const DISPATCH_MANDATE_PROTOCOL = [
92254
92322
  "may precede it; the body follows the closing fence.",
92255
92323
  "",
92256
92324
  "```dsh-mandate-v2",
92257
- "{\"v\":2,\"kind\":\"dispatch\",\"brief_id\":\"b-7f\",\"run_id\":\"r-1\",\"idem\":\"i-1\",\"mandate_version\":1,\"prompt_ref\":\"plan-v3\",\"policy\":{\"id\":\"dsh-dispatch-ledger\",\"version\":\"1\",\"sha256\":\"3f9a1c2b3c4d5e6f\"},\"task\":[\"task://req-42\"],\"boundary\":[\"src/host/dispatch-ledger/**\"],\"followup\":[\"ctx://plan-v3\"],\"parent_mandate\":null}",
92325
+ "{",
92326
+ " \"v\": 2,",
92327
+ " \"kind\": \"dispatch\",",
92328
+ " \"brief_id\": \"b-7f\",",
92329
+ " \"run_id\": \"r-1\",",
92330
+ " \"idem\": \"i-1\",",
92331
+ " \"mandate_version\": 1,",
92332
+ " \"prompt_ref\": \"plan-v3\",",
92333
+ " \"policy\": {",
92334
+ " \"id\": \"dsh-dispatch-ledger\",",
92335
+ " \"version\": \"1\",",
92336
+ " \"sha256\": \"3f9a1c2b3c4d5e6f\"",
92337
+ " },",
92338
+ " \"task\": [\"task://req-42\"],",
92339
+ " \"boundary\": [\"src/host/dispatch-ledger/**\"],",
92340
+ " \"followup\": [\"ctx://plan-v3\"],",
92341
+ " \"parent_mandate\": null",
92342
+ "}",
92258
92343
  "```",
92259
92344
  "",
92260
92345
  "2. PER KIND. Each kind carries its own fields and NO others: one foreign field",
@@ -92289,8 +92374,10 @@ const DISPATCH_MANDATE_PROTOCOL = [
92289
92374
  "MANDATE_MALFORMED: the header does not parse, or carries a field its kind does",
92290
92375
  " not allow. Re-send with exactly the fields of that kind.",
92291
92376
  "MANDATE_KIND: the kind does not match the tool.",
92292
- "MANDATE_DUPLICATE: the namespace (brief_id, run_id, idem) is claimed and never",
92293
- " reusable. Use a NEW run_id AND a NEW idem, and set parent_mandate.",
92377
+ "MANDATE_DUPLICATE: the namespace (brief_id, run_id, idem) is claimed by an attempt",
92378
+ " that actually dispatched, and is never reusable after that. Use a NEW run_id AND",
92379
+ " a NEW idem, and set parent_mandate. A call rejected before dispatch (for instance",
92380
+ " for its provider/model) does not claim the namespace, so retry with the SAME ids.",
92294
92381
  "MANDATE_BRIEF_BUSY: another run of this brief is still booked. Wait, or use a new brief_id.",
92295
92382
  "MANDATE_LINEAGE_REQUIRED: the brief already has a run, but parent_mandate is missing.",
92296
92383
  "MANDATE_LINEAGE: parent_mandate does not point at the latest settled run of the brief.",
@@ -92479,8 +92566,25 @@ function skeletonId(prefix) {
92479
92566
  * @param header - 头部值。
92480
92567
  * @returns 引导语 + 围栏块;判不出 `ok` 时 undefined。
92481
92568
  */
92569
+ /**
92570
+ * 把一段头部值渲染成**多行缩进**的 JSON。
92571
+ *
92572
+ * 头部是模型与人都要读的东西:单行压缩后放进窄栏里就是一整块糊掉的文本,
92573
+ * 谁也扫不出 brief / run / policy 在哪。解析器只做 `JSON.parse`,多行与单行
92574
+ * 等价,所以这里换成键各占一行(数组仍内联,免得一个两项数组占掉三行)。
92575
+ * @param header - 头部值。
92576
+ * @returns 多行 JSON 文本。
92577
+ */
92578
+ function prettyHeaderJson(header) {
92579
+ const rows = [];
92580
+ for (const [key, value] of Object.entries(header)) {
92581
+ const rendered = isRecord$7(value) ? "{\n" + Object.entries(value).map(([innerKey, innerValue]) => " " + JSON.stringify(innerKey) + ": " + JSON.stringify(innerValue)).join(",\n") + "\n }" : JSON.stringify(value);
92582
+ rows.push(" " + JSON.stringify(key) + ": " + rendered);
92583
+ }
92584
+ return "{\n" + rows.join(",\n") + "\n}";
92585
+ }
92482
92586
  function readyToSendBlock(lead, header) {
92483
- const block = "```dsh-mandate-v2\n" + JSON.stringify(header) + "\n```";
92587
+ const block = "```dsh-mandate-v2\n" + prettyHeaderJson(header) + "\n```";
92484
92588
  if (parseMandateHeader(block).state !== "ok") return void 0;
92485
92589
  return lead + "\n" + block;
92486
92590
  }
@@ -93594,10 +93698,10 @@ Check whether list_subagent_models exists. The tool row and provider/model/reaso
93594
93698
  - If the output says neither—no authorized-routes block and no "No allowlist is in force" sentence—the annotation is absent and you cannot read the posture. Treat it as [State: Unlisted] for behaviour, but say "unconfirmed" rather than claiming either posture, and never report a route as authorized.
93595
93699
  - [State: Listed] Output ends with "Authorized child routes for this Session": enforcement is active.
93596
93700
  - The sole source of truth for the allowlist is list_subagent_models: call list_subagent_models({}) to list authorized providers, and call list_subagent_models({ provider }) to list authorized models under that provider; trust its output directly without cross-checking local config files or workspace code (even if upstream tool text says "Catalog membership is advisory", the runtime output is already filtered to this session's allowlist).
93597
- - Before every dispatch, write route: <provider>/<model> (+ reasoning_effort when applicable) and pass split provider and model (model without the <provider>/ prefix).
93701
+ - Before every dispatch through an explicit-route tool (subagent), write route: <provider>/<model> (+ reasoning_effort when applicable) and pass split provider and model (model without the <provider>/ prefix). Never pass provider/model to subagent_fork: it exposes no route field and rejects any such call, so if you want a different route, dispatch through subagent instead.
93598
93702
  - [State: Unlisted] Output states no allowlist is in force: no Session allowlist is recorded; omitting provider/model follows the tool's normal inheritance/default behavior. On Harness >=0.2.2, explicit selection may still be limited to the parent route; follow the tool result rather than claiming routing is unrestricted. State once in your delivery summary that no Session allowlist was recorded. Never claim per-task routing is in force here.
93599
93703
  - [State: Unmounted] list_subagent_models is absent and subagent exposes no route fields: subagents inherit your route; omit the route: line.
93600
- - subagent_fork shares the parent route and KV cache; its admission is decided by the route the calling session is actually running (including same-model fork authorization), so it still works when list_subagent_models is absent: try subagent_fork once and read the denial if rejected. Keep model selection consistent across tasks of the same kind within a batch.
93704
+ - subagent_fork shares the parent route and KV cache; its admission is decided by the route the calling session is actually running (including same-model fork authorization), so it still works when list_subagent_models is absent: try subagent_fork once and read the denial if rejected. Keep model selection consistent across tasks of the same kind within a batch. Never pass provider/model to it.
93601
93705
 
93602
93706
  ## R3 · Subagent Autonomy & R4 · Subagent Role
93603
93707
  A subagent has full authority to plan, execute, and self-verify within its assigned module; do not edit its files while it works. Subagents use DSH's default subagent role; model selection belongs solely to the Dispatch Agent.
@@ -0,0 +1,75 @@
1
+ /**
2
+ * `subagent` / `subagent_fork` 在对话流里的**派发卡片**。
3
+ *
4
+ * ## 为什么要有这张卡
5
+ *
6
+ * DSH 的通用工具行把调用参数当纯文本铺开,而派发的参数是一段 `dsh-mandate-v2`
7
+ * 围栏 + JSON 头 + 任务正文:几十行挤在窄栏里,brief / run / 路由 / 边界谁也扫不出来,
8
+ * 而一旦被守卫拒,拒绝码又埋在那团文本里。这张卡把头部拆成结构,把结果与
9
+ * `MANDATE_*` 拒绝码单独留在醒目位置。
10
+ *
11
+ * ## 一旦占用 key,整行就是我们渲染
12
+ *
13
+ * `tool.call.toolview` 是按工具名键控的槽,「占用即替换」。所以**结果文本必须自己画**
14
+ * (被拒的调用只有那段错误是唯一有用信息),并且保留一个「原始参数」开关:
15
+ * 出问题时能拿到完整证据,不因为换了呈现而丢信息。
16
+ *
17
+ * @module @eddyskywalker/dsh-chatgpt-subscription/client/dispatch-ledger/MandateToolView
18
+ */
19
+ import { type DispatchLedgerLocaleKey } from './locales.ts';
20
+ /** 结果内容块(只用到文本)。 */
21
+ export interface MandateContentBlock {
22
+ readonly type?: string;
23
+ readonly text?: string;
24
+ }
25
+ /** 槽传给视图的那份 phase 数据。 */
26
+ export interface MandateBlock {
27
+ readonly callId?: string;
28
+ readonly phase?: 'preparing' | 'start' | 'result' | string;
29
+ readonly kind?: string;
30
+ readonly isError?: boolean;
31
+ readonly content?: readonly MandateContentBlock[];
32
+ readonly argsRaw?: string;
33
+ readonly call?: {
34
+ readonly name?: string;
35
+ readonly argsRaw?: string;
36
+ };
37
+ readonly args?: {
38
+ readonly text?: (key: string) => unknown;
39
+ readonly complete?: (key: string) => boolean;
40
+ };
41
+ }
42
+ /** 展开状态(复用宿主传下来的 `useDisclosure`)。 */
43
+ export interface MandateDisclosure {
44
+ readonly expanded: boolean;
45
+ readonly toggle: () => void;
46
+ }
47
+ /** 卡片收到的 props(槽位环境另带若干字段)。 */
48
+ export interface MandateToolViewProps {
49
+ readonly callId?: string;
50
+ readonly toolName?: string;
51
+ readonly phase?: string;
52
+ readonly block?: MandateBlock;
53
+ readonly useDisclosure?: (() => MandateDisclosure) | undefined;
54
+ readonly t?: ((key: DispatchLedgerLocaleKey) => string) | undefined;
55
+ readonly [key: string]: unknown;
56
+ }
57
+ /** 从原始参数 JSON 或流式参数视图里读出参数对象。 */
58
+ export declare function mandateArgsOf(block: MandateBlock): Record<string, unknown>;
59
+ /** 一份拆开的派发:头部(解析失败时为 null)、正文、以及原始提示词。 */
60
+ export interface ParsedDispatch {
61
+ readonly header: Record<string, unknown> | null;
62
+ readonly body: string;
63
+ readonly rawPrompt: string;
64
+ }
65
+ /**
66
+ * 拆开 `subagent.prompt`:围栏在最前面时解析头部,其后是任务正文。
67
+ * @param prompt - 提示词原文。
68
+ * @returns 头部、正文与原文。
69
+ */
70
+ export declare function parseDispatchPrompt(prompt: string): ParsedDispatch;
71
+ /** 结果区文本:成功是「started subagent …」,被拒是整段拒绝说明。 */
72
+ export declare function mandateResultText(block: MandateBlock): string;
73
+ /** 派发卡片。 */
74
+ export declare function MandateToolView(props: MandateToolViewProps): React.JSX.Element;
75
+ //# sourceMappingURL=MandateToolView.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MandateToolView.d.ts","sourceRoot":"","sources":["../../../../src/client/dispatch-ledger/MandateToolView.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAGH,OAAO,EAAM,KAAK,uBAAuB,EAAE,MAAM,cAAc,CAAA;AAE/D,oBAAoB;AACpB,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CACvB;AAED,yBAAyB;AACzB,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,KAAK,CAAC,EAAE,WAAW,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAA;IAC1D,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAA;IAC1B,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,mBAAmB,EAAE,CAAA;IACjD,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAA;IACzB,QAAQ,CAAC,IAAI,CAAC,EAAE;QAAE,QAAQ,CAAC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,CAAC,SAAS,EAAE,MAAM,CAAA;CAC3B;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG,cAAc,CAkBlE;AAED,+CAA+C;AAC/C,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,YAAY,GAAG,MAAM,CAE7D;AAwBD,YAAY;AACZ,wBAAgB,eAAe,CAAC,KAAK,EAAE,oBAAoB,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CAkJ9E"}
@@ -0,0 +1,63 @@
1
+ /**
2
+ * 「派发卡片」在 locale 服务里的命名空间。
3
+ *
4
+ * 与其余线路同一个命名习惯(`dsh-<线路>`):账单相关的文案自成一表,
5
+ * 不去占本插件通用字典的键位。
6
+ */
7
+ export declare const NS_DISPATCH_LEDGER: "dsh-dispatch-ledger";
8
+ /** 中文文案。 */
9
+ export declare const zh: {
10
+ mandateTitle: string;
11
+ mandateTitleFork: string;
12
+ mandatePreparing: string;
13
+ mandateRunning: string;
14
+ mandateDone: string;
15
+ mandateFailed: string;
16
+ mandateExpand: string;
17
+ mandateCollapse: string;
18
+ mandateBrief: string;
19
+ mandateRun: string;
20
+ mandateIdem: string;
21
+ mandateRoute: string;
22
+ mandateTask: string;
23
+ mandateBoundary: string;
24
+ mandateFollowup: string;
25
+ mandateBody: string;
26
+ mandateResult: string;
27
+ mandateRawShow: string;
28
+ mandateRawHide: string;
29
+ mandateNoHeader: string;
30
+ mandateNoBody: string;
31
+ };
32
+ /** 该表全部键。 */
33
+ export type DispatchLedgerLocaleKey = keyof typeof zh;
34
+ /** 英文文案。 */
35
+ export declare const en: Record<DispatchLedgerLocaleKey, string>;
36
+ /** 注册进 locale 服务的双语字典。 */
37
+ export declare const dictionaries: {
38
+ zh: {
39
+ mandateTitle: string;
40
+ mandateTitleFork: string;
41
+ mandatePreparing: string;
42
+ mandateRunning: string;
43
+ mandateDone: string;
44
+ mandateFailed: string;
45
+ mandateExpand: string;
46
+ mandateCollapse: string;
47
+ mandateBrief: string;
48
+ mandateRun: string;
49
+ mandateIdem: string;
50
+ mandateRoute: string;
51
+ mandateTask: string;
52
+ mandateBoundary: string;
53
+ mandateFollowup: string;
54
+ mandateBody: string;
55
+ mandateResult: string;
56
+ mandateRawShow: string;
57
+ mandateRawHide: string;
58
+ mandateNoHeader: string;
59
+ mandateNoBody: string;
60
+ };
61
+ en: Record<"mandateTitle" | "mandateTitleFork" | "mandatePreparing" | "mandateRunning" | "mandateDone" | "mandateFailed" | "mandateExpand" | "mandateCollapse" | "mandateBrief" | "mandateRun" | "mandateIdem" | "mandateRoute" | "mandateTask" | "mandateBoundary" | "mandateFollowup" | "mandateBody" | "mandateResult" | "mandateRawShow" | "mandateRawHide" | "mandateNoHeader" | "mandateNoBody", string>;
62
+ };
63
+ //# sourceMappingURL=locales.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"locales.d.ts","sourceRoot":"","sources":["../../../../src/client/dispatch-ledger/locales.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,EAAG,qBAA8B,CAAA;AAEhE,YAAY;AACZ,eAAO,MAAM,EAAE;;;;;;;;;;;;;;;;;;;;;;CAsBd,CAAA;AAED,aAAa;AACb,MAAM,MAAM,uBAAuB,GAAG,MAAM,OAAO,EAAE,CAAA;AAErD,YAAY;AACZ,eAAO,MAAM,EAAE,EAAE,MAAM,CAAC,uBAAuB,EAAE,MAAM,CAsBtD,CAAA;AAED,0BAA0B;AAC1B,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;CAAa,CAAA"}
@@ -0,0 +1,3 @@
1
+ /** 安装样式(重复调用是幂等的)。 */
2
+ export declare function installDispatchLedgerStyles(): void;
3
+ //# sourceMappingURL=styles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../src/client/dispatch-ledger/styles.ts"],"names":[],"mappings":"AA4BA,sBAAsB;AACtB,wBAAgB,2BAA2B,IAAI,IAAI,CAElD"}
@@ -14,6 +14,7 @@ import { type OpenDesignLocaleKey } from './opendesign/locales.ts';
14
14
  import { type ProgressUpdatesLocaleKey } from './progress-updates/locales.ts';
15
15
  import { type WorkBuddyLocaleKey } from './workbuddy/locales.ts';
16
16
  import { type SubagentLocaleKey } from './subagent/locales.ts';
17
+ import { type DispatchLedgerLocaleKey } from './dispatch-ledger/locales.ts';
17
18
  declare module '@deepseek-ai/dsh-client-ui-slots' {
18
19
  /**
19
20
  * Every namespace this plugin registers, typed by that line's own dictionary.
@@ -39,6 +40,7 @@ declare module '@deepseek-ai/dsh-client-ui-slots' {
39
40
  'dsh-progress-updates': ProgressUpdatesLocaleKey;
40
41
  'dsh-workbuddy': WorkBuddyLocaleKey;
41
42
  'dsh-subagent-settings': SubagentLocaleKey;
43
+ 'dsh-dispatch-ledger': DispatchLedgerLocaleKey;
42
44
  }
43
45
  }
44
46
  export declare const inject: string[];
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/client/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAenE,OAAO,EAAoB,KAAK,SAAS,EAAE,MAAM,cAAc,CAAA;AAS/D,OAAO,EAAoD,KAAK,oBAAoB,EAAE,MAAM,0BAA0B,CAAA;AAGtH,OAAO,EAA0C,KAAK,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAGlG,OAAO,EAAqD,KAAK,oBAAoB,EAAE,MAAM,2BAA2B,CAAA;AAExH,OAAO,EAA+C,KAAK,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAM5G,OAAO,EAAqD,KAAK,oBAAoB,EAAE,MAAM,2BAA2B,CAAA;AAKxH,OAAO,EAA0D,KAAK,sBAAsB,EAAE,MAAM,8BAA8B,CAAA;AAElI,OAAO,EAA0C,KAAK,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAElG,OAAO,EAA+C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oBAAoB,CAAA;QACxC,qBAAqB,EAAE,sBAAsB,CAAA;QAC7C,YAAY,EAAE,eAAe,CAAA;QAC7B,eAAe,EAAE,iBAAiB,CAAA;QAClC,gBAAgB,EAAE,kBAAkB,CAAA;QACpC,WAAW,EAAE,cAAc,CAAA;QAC3B,gBAAgB,EAAE,mBAAmB,CAAA;QACrC,sBAAsB,EAAE,wBAAwB,CAAA;QAChD,eAAe,EAAE,kBAAkB,CAAA;QACnC,uBAAuB,EAAE,iBAAiB,CAAA;QAC1C,qBAAqB,EAAE,uBAAuB,CAAA;KAC/C;CACF;AAED,eAAO,MAAM,MAAM,UAQlB,CAAA;AAED,wBAAgB,KAAK,CAAC,GAAG,EAAE,aAAa,GAAG,IAAI,CAsQ9C"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Russian dictionary for the dispatch-ledger namespace.
3
+ *
4
+ * Key set and order mirror the `zh` source; meaning follows `en`.
5
+ */
6
+ import type { DispatchLedgerLocaleKey } from '../dispatch-ledger/locales.ts';
7
+ export declare const dictionary: Record<DispatchLedgerLocaleKey, string>;
8
+ //# sourceMappingURL=dispatch-ledger.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dispatch-ledger.d.ts","sourceRoot":"","sources":["../../../../src/client/locales-ru/dispatch-ledger.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAA;AAE5E,eAAO,MAAM,UAAU,EAAE,MAAM,CAAC,uBAAuB,EAAE,MAAM,CAsB9D,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/client/locales-ru/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,KAAK,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,qBAAqB,CAAA;AA+BnE,yEAAyE;AACzE,eAAO,MAAM,SAAS,OAAO,CAAA;AAE7B;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,aAAa,GAAG,IAAI,CAsD7D"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/client/locales-ru/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,KAAK,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAiCnE,yEAAyE;AACzE,eAAO,MAAM,SAAS,OAAO,CAAA;AAE7B;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,aAAa,GAAG,IAAI,CAuD7D"}
@@ -76,7 +76,7 @@ export declare const ROUTE_PREFIX: "/api/dsh-chatgpt-subscription";
76
76
  * `test/responses-client.test.ts` asserts the two agree, so a release that
77
77
  * forgets this constant fails the suite instead of shipping quietly.
78
78
  */
79
- export declare const PLUGIN_VERSION: "0.63.1";
79
+ export declare const PLUGIN_VERSION: "0.64.0";
80
80
  export declare const CODEX_CHATGPT_PROVIDER_ID: "codex-chatgpt";
81
81
  export { MINIMAX_CODE_PROVIDER_ID, MINIMAX_CODE_ROUTE_PREFIX } from './shared/minimax-code-contracts.ts';
82
82
  export declare const CODEX_API_BASE: "https://chatgpt.com/backend-api/codex";
@@ -170,6 +170,16 @@ export interface DispatchLedgerReservations {
170
170
  * @returns 是否冲突。
171
171
  */
172
172
  conflicts(issuer: string, ns: string, callId: string): boolean;
173
+ /**
174
+ * 这个命名空间当前由哪一次调用预约(没有时 undefined)。
175
+ *
176
+ * 守卫用它判定「这条预约是不是来自一个从未派发出去的调用」——那种预约
177
+ * 只可能属于一次被派发前拒绝的尝试,不能挡住修正后的重试。
178
+ * @param issuer - 签发方会话 id。
179
+ * @param ns - 命名空间键。
180
+ * @returns 预约者的调用 id;没有预约(或已过期)时 undefined。
181
+ */
182
+ holder(issuer: string, ns: string): string | undefined;
173
183
  /**
174
184
  * 预约一个命名空间(**只有所有校验通过之后**才调用)。
175
185
  * @param issuer - 签发方会话 id。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