@eddyskywalker/dsh-chatgpt-subscription 0.55.0 → 0.57.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.
Files changed (51) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/README.md +148 -1268
  3. package/lib/client.js +298 -17
  4. package/lib/client.js.map +1 -1
  5. package/lib/index.js +413 -68
  6. package/lib/plan-mode.js +3 -7
  7. package/lib/tool-result-pruner.js +1 -1
  8. package/lib/types/client/locales-ru/index.d.ts +2 -3
  9. package/lib/types/client/locales-ru/index.d.ts.map +1 -1
  10. package/lib/types/client/locales-ru/progress-updates.d.ts.map +1 -1
  11. package/lib/types/client/minimax-code/commands-contract.d.ts +1 -1
  12. package/lib/types/client/progress-updates/locales.d.ts +8 -2
  13. package/lib/types/client/progress-updates/locales.d.ts.map +1 -1
  14. package/lib/types/client/progress-updates/settings-binding.d.ts +8 -1
  15. package/lib/types/client/progress-updates/settings-binding.d.ts.map +1 -1
  16. package/lib/types/client/progress-updates/settings-section.d.ts +2 -1
  17. package/lib/types/client/progress-updates/settings-section.d.ts.map +1 -1
  18. package/lib/types/client/subagent/SubagentCard.d.ts.map +1 -1
  19. package/lib/types/client/subagent/locales.d.ts +14 -2
  20. package/lib/types/client/subagent/locales.d.ts.map +1 -1
  21. package/lib/types/client/subagent/styles.d.ts +1 -1
  22. package/lib/types/client/subagent/styles.d.ts.map +1 -1
  23. package/lib/types/client/subagent/subagent-card-controller.d.ts +26 -3
  24. package/lib/types/client/subagent/subagent-card-controller.d.ts.map +1 -1
  25. package/lib/types/compat.d.ts +1 -1
  26. package/lib/types/entry-plan-mode.d.ts +3 -7
  27. package/lib/types/entry-plan-mode.d.ts.map +1 -1
  28. package/lib/types/entry-tool-result-pruner.d.ts +1 -1
  29. package/lib/types/host/agent-preset.d.ts +5 -0
  30. package/lib/types/host/agent-preset.d.ts.map +1 -1
  31. package/lib/types/host/common/llm-compat.d.ts +3 -1
  32. package/lib/types/host/common/llm-compat.d.ts.map +1 -1
  33. package/lib/types/host/kimi-code/repeat-breaker.d.ts +1 -1
  34. package/lib/types/host/plan-mode-cache-guard.d.ts.map +1 -1
  35. package/lib/types/host/preferences.d.ts.map +1 -1
  36. package/lib/types/host/routes.d.ts.map +1 -1
  37. package/lib/types/host/subagent-model-authorization.d.ts +34 -16
  38. package/lib/types/host/subagent-model-authorization.d.ts.map +1 -1
  39. package/lib/types/host/subagent-route-audit.d.ts +6 -1
  40. package/lib/types/host/subagent-route-audit.d.ts.map +1 -1
  41. package/lib/types/host/team-policy-cache-guard.d.ts +44 -0
  42. package/lib/types/host/team-policy-cache-guard.d.ts.map +1 -0
  43. package/lib/types/index.d.ts +16 -2
  44. package/lib/types/index.d.ts.map +1 -1
  45. package/lib/types/shared/contracts.d.ts +19 -0
  46. package/lib/types/shared/contracts.d.ts.map +1 -1
  47. package/lib/types/shared/preferences.d.ts +22 -1
  48. package/lib/types/shared/preferences.d.ts.map +1 -1
  49. package/package.json +46 -43
  50. package/presets/dispatch/README.md +32 -11
  51. package/presets/dispatch/agent.cordis.yml +26 -22
package/lib/index.js CHANGED
@@ -807,7 +807,7 @@ const ROUTE_PREFIX$5 = "/api/dsh-chatgpt-subscription";
807
807
  * `test/responses-client.test.ts` asserts the two agree, so a release that
808
808
  * forgets this constant fails the suite instead of shipping quietly.
809
809
  */
810
- const PLUGIN_VERSION = "0.55.0";
810
+ const PLUGIN_VERSION = "0.57.0";
811
811
  const CODEX_CHATGPT_PROVIDER_ID = "codex-chatgpt";
812
812
  const CODEX_API_BASE = "https://chatgpt.com/backend-api/codex";
813
813
  const CODEX_RESPONSES_URL = `${CODEX_API_BASE}/responses`;
@@ -12108,7 +12108,9 @@ const DEFAULT_PREFERENCES = {
12108
12108
  customProxyUrl: null,
12109
12109
  compactionRoute: null,
12110
12110
  subagentDefaultModels: [],
12111
- subagentModelsByMainModel: {}
12111
+ subagentModelsByMainModel: {},
12112
+ subagentDefaultAllowParentFork: false,
12113
+ subagentAllowParentForkByMainModel: {}
12112
12114
  };
12113
12115
  const SEARCH_PROVIDER_CODEX = "codex";
12114
12116
  function isSearchProviderPreference(value) {
@@ -12222,6 +12224,36 @@ function mergeSubagentModelsByMainModel(current, patch) {
12222
12224
  }
12223
12225
  return merged;
12224
12226
  }
12227
+ /**
12228
+ * Merge one `subagentAllowParentForkByMainModel` patch into the stored map.
12229
+ *
12230
+ * `null` clears one key so that main model falls back to
12231
+ * `subagentDefaultAllowParentFork`; a boolean sets an explicit per-main-model
12232
+ * override (`true` OR `false`, since overriding a `true` global default back to
12233
+ * `false` for one main model is legitimate).
12234
+ * @param current - Map already stored in the preferences document.
12235
+ * @param patch - Incoming patch from a settings card or a route body.
12236
+ * @returns the merged map, or null when any key or value is malformed.
12237
+ */
12238
+ function mergeSubagentAllowParentForkByMainModel(current, patch) {
12239
+ const patchRecord = asRecord$19(patch);
12240
+ if (patchRecord === void 0) return null;
12241
+ const merged = {};
12242
+ if (current !== void 0) {
12243
+ for (const [k, v] of Object.entries(current)) if (typeof v === "boolean" && isValidMainModelKey(k)) merged[k.trim()] = v;
12244
+ }
12245
+ for (const [rawKey, rawValue] of Object.entries(patchRecord)) {
12246
+ const key = rawKey.trim();
12247
+ if (!isValidMainModelKey(key)) return null;
12248
+ if (rawValue === null) {
12249
+ delete merged[key];
12250
+ continue;
12251
+ }
12252
+ if (typeof rawValue !== "boolean") return null;
12253
+ merged[key] = rawValue;
12254
+ }
12255
+ return merged;
12256
+ }
12225
12257
  //#endregion
12226
12258
  //#region src/host/common/legacy-preferences.ts
12227
12259
  /**
@@ -12423,7 +12455,9 @@ function registerPreferenceStore(settings) {
12423
12455
  model: z$1.string()
12424
12456
  }), z$1.const(null)]).default(DEFAULT_PREFERENCES.compactionRoute ?? null),
12425
12457
  subagentDefaultModels: subagentModelRoutes.default([]),
12426
- subagentModelsByMainModel: z$1.dict(subagentModelRoutes).default({})
12458
+ subagentModelsByMainModel: z$1.dict(subagentModelRoutes).default({}),
12459
+ subagentDefaultAllowParentFork: z$1.boolean().default(DEFAULT_PREFERENCES.subagentDefaultAllowParentFork ?? false),
12460
+ subagentAllowParentForkByMainModel: z$1.dict(z$1.boolean()).default({})
12427
12461
  });
12428
12462
  if (!hasRegister(settings)) {
12429
12463
  const fileStore = new FilePreferencesStore(schema, preferencesPath(), readLegacyPreferences);
@@ -12491,6 +12525,15 @@ var SettingsPreferenceStore = class {
12491
12525
  if (merged === null) throw new PreferenceError("Unsupported subagentModelsByMainModel preference.");
12492
12526
  normalized.subagentModelsByMainModel = merged;
12493
12527
  }
12528
+ if (patch.subagentDefaultAllowParentFork !== void 0) {
12529
+ if (typeof patch.subagentDefaultAllowParentFork !== "boolean") throw new PreferenceError("Unsupported subagentDefaultAllowParentFork preference.");
12530
+ normalized.subagentDefaultAllowParentFork = patch.subagentDefaultAllowParentFork;
12531
+ }
12532
+ if (patch.subagentAllowParentForkByMainModel !== void 0) {
12533
+ const merged = mergeSubagentAllowParentForkByMainModel(this.scope.get().subagentAllowParentForkByMainModel, patch.subagentAllowParentForkByMainModel);
12534
+ if (merged === null) throw new PreferenceError("Unsupported subagentAllowParentForkByMainModel preference.");
12535
+ normalized.subagentAllowParentForkByMainModel = merged;
12536
+ }
12494
12537
  if (patch.customProxyUrl !== void 0) if (patch.customProxyUrl !== null) {
12495
12538
  const trimmed = patch.customProxyUrl.trim();
12496
12539
  if (trimmed.length > 0 && !/^https?:\/\//i.test(trimmed) && !/^socks5?:\/\//i.test(trimmed)) normalized.customProxyUrl = `http://${trimmed}`;
@@ -15530,6 +15573,14 @@ function readPreferencesUpdate(value, current) {
15530
15573
  if (mergeSubagentModelsByMainModel(current.subagentModelsByMainModel, value.subagentModelsByMainModel) === null) throw new PreferenceError("subagentModelsByMainModel must map \"provider/model\" keys to arrays of { provider, model } routes, or null to clear one.");
15531
15574
  patch.subagentModelsByMainModel = value.subagentModelsByMainModel;
15532
15575
  }
15576
+ if ("subagentDefaultAllowParentFork" in value) {
15577
+ if (typeof value.subagentDefaultAllowParentFork !== "boolean") throw new PreferenceError("subagentDefaultAllowParentFork must be a boolean.");
15578
+ patch.subagentDefaultAllowParentFork = value.subagentDefaultAllowParentFork;
15579
+ }
15580
+ if ("subagentAllowParentForkByMainModel" in value) {
15581
+ if (mergeSubagentAllowParentForkByMainModel(current.subagentAllowParentForkByMainModel, value.subagentAllowParentForkByMainModel) === null) throw new PreferenceError("subagentAllowParentForkByMainModel must map \"provider/model\" keys to booleans, or null to clear one.");
15582
+ patch.subagentAllowParentForkByMainModel = value.subagentAllowParentForkByMainModel;
15583
+ }
15533
15584
  if ("contextWindowOverrides" in value) {
15534
15585
  if (!isRecord$62(value.contextWindowOverrides)) throw new PreferenceError("contextWindowOverrides must be an object.");
15535
15586
  const overrides = {};
@@ -85563,6 +85614,12 @@ const DEFAULT_DELEGATION_TOOLS = ["subagent"];
85563
85614
  */
85564
85615
  const DEFAULT_SUBAGENT_INHERIT_TOOLS = ["subagent_fork", "spawn_teammate"];
85565
85616
  /**
85617
+ * Inherit-mode tools that fork the caller's own conversation context on the
85618
+ * caller's own route (as opposed to multi-agent team spawning such as
85619
+ * `spawn_teammate`). Only these tools are unlocked by `allowParentFork`.
85620
+ */
85621
+ const DEFAULT_PARENT_FORK_TOOLS = ["subagent_fork"];
85622
+ /**
85566
85623
  * Read one deployment event field as a string.
85567
85624
  * @param value - Candidate field value from a durable event.
85568
85625
  * @returns the string value, or undefined for any other type.
@@ -85704,6 +85761,11 @@ const lockedRootMainRoutes = /* @__PURE__ */ new WeakMap();
85704
85761
  */
85705
85762
  const lockedRootAllowedRoutes = /* @__PURE__ */ new WeakMap();
85706
85763
  /**
85764
+ * Authorized `allowParentFork` posture per root Session, locked on first evaluation
85765
+ * alongside {@link lockedRootAllowedRoutes} so one Session is governed by one policy.
85766
+ */
85767
+ const lockedRootAllowParentFork = /* @__PURE__ */ new WeakMap();
85768
+ /**
85707
85769
  * Narrow one candidate route pair into an exact route.
85708
85770
  * @param provider - Candidate provider id.
85709
85771
  * @param model - Candidate model id.
@@ -86038,6 +86100,30 @@ function mainModelRoutesFor(agent, sessions, preference, baseRoutes, lockSnapsho
86038
86100
  return resolved;
86039
86101
  }
86040
86102
  /**
86103
+ * Resolve whether `subagent_fork` is authorized to inherit the root main model's
86104
+ * own route even when that route is absent from the cold-spawn allowlist.
86105
+ * @param agent - Calling agent.
86106
+ * @param preference - Current Host preference, when composed.
86107
+ * @param sessions - Session registry used for ancestor lookup.
86108
+ * @param lockSnapshot - Freeze the resolved posture for this Session now.
86109
+ * @returns whether same-route parent forking is authorized for the Session's main model.
86110
+ */
86111
+ function effectiveAllowParentFork(agent, preference, sessions, lockSnapshot = false) {
86112
+ if (preference !== void 0 && !preference.enabled) return true;
86113
+ const inherited = inheritedRouteOf(agent);
86114
+ const { rootSession, mainRoute } = resolveRootSessionAndMainRoute(agent, sessions, inherited, lockSnapshot);
86115
+ const lockable = typeof rootSession === "object" && rootSession !== null;
86116
+ const locked = lockable ? lockedRootAllowParentFork.get(rootSession) : void 0;
86117
+ if (!(locked !== void 0 ? locked : (() => {
86118
+ const specific = mainRoute === void 0 ? void 0 : preference?.allowParentForkByMainModel?.[`${mainRoute.provider}/${mainRoute.model}`];
86119
+ const resolved = typeof specific === "boolean" ? specific : preference?.defaultAllowParentFork === true;
86120
+ if (lockable && (lockSnapshot || headerRouteOf(rootSession) !== void 0)) lockedRootAllowParentFork.set(rootSession, resolved);
86121
+ return resolved;
86122
+ })())) return false;
86123
+ if (inherited.provider === void 0 || inherited.model === void 0 || mainRoute === void 0) return false;
86124
+ return inherited.provider === mainRoute.provider && inherited.model === mainRoute.model;
86125
+ }
86126
+ /**
86041
86127
  * State a Session's routing posture in the `list_subagent_models` result.
86042
86128
  *
86043
86129
  * Calling `list_subagent_models({})` upstream returns only provider names
@@ -86048,20 +86134,17 @@ function mainModelRoutesFor(agent, sessions, preference, baseRoutes, lockSnapsho
86048
86134
  * authorized route in the form `subagent` expects, eliminating any reason to
86049
86135
  * search local config files or source code for the allowlist.
86050
86136
  *
86051
- * The empty case states the opposite fact rather than staying silent, because
86052
- * silence is what makes a model infer that a mounted tool implies enforcement.
86053
- * It does not: the tool row and the route parameters are static, while whether
86054
- * anything is enforced is decided by the allowlist the Session recorded. The
86055
- * two facts differ, so the model has to be able to read the second one instead
86056
- * of deriving it from the first.
86137
+ * The empty case distinguishes an absent Session allowlist from the host's own
86138
+ * delegation policy. On 0.2.2 the latter still limits explicit selection to the
86139
+ * parent route, so calling this posture "unrestricted" would be false.
86057
86140
  * @param output - Original text returned by `list_subagent_models`.
86058
86141
  * @param allowed - Routes the calling Session authorizes, empty when none is in force.
86059
86142
  * @returns the output with the Session routing posture appended.
86060
86143
  */
86061
86144
  function enrichListSubagentModelsOutput(output, allowed) {
86062
86145
  if (allowed.length === 0) {
86063
- if (output.includes("No allowlist is in force for this Session: subagent routing is unrestricted, no route is validated against any list, and omitting provider/model is legitimate rather than a rule breach.")) return output;
86064
- return output.trim().length === 0 ? UNRESTRICTED_ROUTING_NOTICE : `${output}\n\n${UNRESTRICTED_ROUTING_NOTICE}`;
86146
+ if (output.includes("No allowlist is in force for this Session. Omitting provider/model follows the delegation tool's normal inheritance/default behavior; explicit selection may still be limited to the parent route by the host.")) return output;
86147
+ return output.trim().length === 0 ? NO_ALLOWLIST_ROUTING_NOTICE : `${output}\n\n${NO_ALLOWLIST_ROUTING_NOTICE}`;
86065
86148
  }
86066
86149
  const header = "Authorized child routes for this Session (already filtered by the Session allowlist; only these routes are accepted, and `provider` and `model` must be passed as separate fields):";
86067
86150
  if (output.includes(header)) return output;
@@ -86140,44 +86223,47 @@ function filterListSubagentModelsOutput(output, allowed) {
86140
86223
  function mergePreferenceOverrides(base, overrides) {
86141
86224
  const hasDefault = overrides?.defaultAllowedModels !== void 0;
86142
86225
  const hasByMain = overrides?.byMainModel !== void 0;
86226
+ const hasDefaultFork = overrides?.defaultAllowParentFork !== void 0;
86227
+ const hasForkByMain = overrides?.allowParentForkByMainModel !== void 0;
86143
86228
  if (base === void 0) {
86144
- if (!hasDefault && !hasByMain) return void 0;
86229
+ if (!hasDefault && !hasByMain && !hasDefaultFork && !hasForkByMain) return void 0;
86145
86230
  return {
86146
86231
  enabled: true,
86147
86232
  allowedModels: overrides?.defaultAllowedModels ?? [],
86148
86233
  ...hasDefault ? { defaultAllowedModels: overrides?.defaultAllowedModels } : {},
86149
- ...hasByMain ? { byMainModel: overrides?.byMainModel } : {}
86234
+ ...hasByMain ? { byMainModel: overrides?.byMainModel } : {},
86235
+ ...hasDefaultFork ? { defaultAllowParentFork: overrides?.defaultAllowParentFork } : {},
86236
+ ...hasForkByMain ? { allowParentForkByMainModel: overrides?.allowParentForkByMainModel } : {}
86150
86237
  };
86151
86238
  }
86152
- if (!hasDefault && !hasByMain) return base;
86239
+ if (!hasDefault && !hasByMain && !hasDefaultFork && !hasForkByMain) return base;
86153
86240
  return {
86154
86241
  ...base,
86155
86242
  ...hasDefault ? { defaultAllowedModels: overrides?.defaultAllowedModels } : {},
86156
- ...hasByMain ? { byMainModel: overrides?.byMainModel } : {}
86243
+ ...hasByMain ? { byMainModel: overrides?.byMainModel } : {},
86244
+ ...hasDefaultFork ? { defaultAllowParentFork: overrides?.defaultAllowParentFork } : {},
86245
+ ...hasForkByMain ? { allowParentForkByMainModel: overrides?.allowParentForkByMainModel } : {}
86157
86246
  };
86158
86247
  }
86159
86248
  /**
86160
86249
  * The statement appended to `list_subagent_models` when no allowlist governs the
86161
86250
  * calling Session.
86162
86251
  *
86163
- * Two facts, and nothing more: nothing is enforced, and omitting the route is
86164
- * legitimate here. It deliberately does not recommend a setting. This notice is
86252
+ * It distinguishes an absent Session allowlist from the host's own inheritance
86253
+ * or parent-route rules, and deliberately does not recommend a setting. This notice is
86165
86254
  * attached for every Session the plugin's authorization listener reaches—which
86166
86255
  * includes sessions with no interest in the dispatch preset—so a sentence telling
86167
86256
  * the reader to go enable model selection would be noise in most of them, and a
86168
86257
  * model that reads it as an instruction will repeat it in an unrelated summary.
86169
86258
  */
86170
- const UNRESTRICTED_ROUTING_NOTICE = "No allowlist is in force for this Session: subagent routing is unrestricted, no route is validated against any list, and omitting provider/model is legitimate rather than a rule breach.";
86259
+ const NO_ALLOWLIST_ROUTING_NOTICE = "No allowlist is in force for this Session. Omitting provider/model follows the delegation tool's normal inheritance/default behavior; explicit selection may still be limited to the parent route by the host.";
86171
86260
  /**
86172
86261
  * Rewrite the upstream `list_subagent_models` and `subagent` tool/parameter
86173
86262
  * descriptions when the calling Session enforces an allowlist.
86174
86263
  *
86175
- * Upstream `dsh-tool-subagent` ships static descriptions stating that
86176
- * `"Catalog membership is advisory: an adapter may accept an unlisted model id."`
86177
- * and `"Child LLM selection is optional. Omit provider, model, and reasoning_effort..."`.
86178
- * In an allowlist-governed Session both statements are false and actively
86179
- * mislead the dispatcher into either omitting `provider`/`model` or distrusting
86180
- * `list_subagent_models` and hunting through local files for the "real" allowlist.
86264
+ * Upstream releases before 0.2.2 call selection optional and catalog membership
86265
+ * advisory; 0.2.2 instead says omitted values use child defaults. In an
86266
+ * allowlist-governed Session those statements would contradict execution.
86181
86267
  * @param text - Tool description, parameter description, or rendered `tools:sdk` section text.
86182
86268
  * @param allowed - Routes the calling Session authorizes.
86183
86269
  * @returns the text with the misleading upstream sentences replaced by the Session's exact policy.
@@ -86185,7 +86271,8 @@ const UNRESTRICTED_ROUTING_NOTICE = "No allowlist is in force for this Session:
86185
86271
  function rewriteAuthorizedToolDescriptions(text, allowed) {
86186
86272
  if (allowed.length === 0 || text.length === 0) return text;
86187
86273
  const routes = authorizedRoutesText(allowed);
86188
- 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, `Child LLM selection is required in this Session: pass an authorized \`provider\` and \`model\` from \`list_subagent_models\` (${routes}) as separate fields; omitting either field is rejected.`).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.");
86274
+ const required = `Child LLM selection is required in this Session: pass an authorized \`provider\` and \`model\` from \`list_subagent_models\` (${routes}) as separate fields; omitting either field is rejected.`;
86275
+ 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.");
86189
86276
  }
86190
86277
  /**
86191
86278
  * Rewrite one assembled prompt's `tools:sdk` section and native tool schemas
@@ -86265,7 +86352,7 @@ function rewriteAuthorizedPromptAssembly(assembly, allowed, toolNames = DEFAULT_
86265
86352
  * @param inheritToolNames - Delegation tools that start a child on the caller's own route.
86266
86353
  * @returns a denial reason, or undefined to leave the call untouched.
86267
86354
  */
86268
- function delegationDenialReason(agent, toolName, args, preference, sessions, toolNames = DEFAULT_DELEGATION_TOOLS, scope = "session", inheritToolNames = [], declaresRouteParameters, lockSnapshot = true) {
86355
+ function delegationDenialReason(agent, toolName, args, preference, sessions, toolNames = DEFAULT_DELEGATION_TOOLS, scope = "session", inheritToolNames = [], declaresRouteParameters, lockSnapshot = true, parentForkToolNames = DEFAULT_PARENT_FORK_TOOLS) {
86269
86356
  const mode = delegationModeOf([...toolNames.map((name) => ({
86270
86357
  name,
86271
86358
  mode: "explicit"
@@ -86280,7 +86367,8 @@ function delegationDenialReason(agent, toolName, args, preference, sessions, too
86280
86367
  const requestedProvider = asString$6(request["provider"]);
86281
86368
  const requestedModel = asString$6(request["model"]);
86282
86369
  if (mode === "inherit") {
86283
- if (requestedProvider !== void 0 && requestedModel !== void 0) return inheritOverrideReason(toolName, requestedProvider, requestedModel);
86370
+ if (requestedProvider !== void 0 || requestedModel !== void 0) return inheritOverrideReason(toolName, requestedProvider ?? "", requestedModel ?? "");
86371
+ if (parentForkToolNames.includes(toolName) && effectiveAllowParentFork(agent, preference, sessions, lockSnapshot)) return;
86284
86372
  return inheritedRouteDenial(agent, toolName, allowed);
86285
86373
  }
86286
86374
  if (declaresRouteParameters?.(agent, toolName) === false) {
@@ -86812,7 +86900,7 @@ function installToolResultPrunerGuard(ctx, options = {}) {
86812
86900
  return next === void 0 ? void 0 : next();
86813
86901
  };
86814
86902
  for (const event of GUARDED_EVENTS$1) {
86815
- const disposer = subscribe$3(host, event, handleAgentEvent);
86903
+ const disposer = subscribe$4(host, event, handleAgentEvent);
86816
86904
  if (disposer !== void 0) disposers.push(disposer);
86817
86905
  }
86818
86906
  scanAndWrap();
@@ -86842,7 +86930,7 @@ function installToolResultPrunerGuard(ctx, options = {}) {
86842
86930
  * @param listener - 回调。
86843
86931
  * @returns 移除监听器的 disposer;宿主不支持事件时为 `undefined`。
86844
86932
  */
86845
- function subscribe$3(host, event, listener) {
86933
+ function subscribe$4(host, event, listener) {
86846
86934
  const on = host?.on;
86847
86935
  if (typeof on !== "function") return void 0;
86848
86936
  for (const options of [
@@ -87019,7 +87107,7 @@ function markPatched$3(patched, holder, name) {
87019
87107
  //#endregion
87020
87108
  //#region src/host/plan-mode-cache-guard.ts
87021
87109
  /** 没有 scope 的装配(会话标题之类)用的桶键。 */
87022
- const GLOBAL_KEY$1 = Object.freeze({});
87110
+ const GLOBAL_KEY$2 = Object.freeze({});
87023
87111
  /**
87024
87112
  * 读一个可选服务。
87025
87113
  * @param ctx - 宿主上下文。
@@ -87040,8 +87128,8 @@ function serviceOf$1(ctx, service) {
87040
87128
  * @param value - scope / agent。
87041
87129
  * @returns WeakMap 键。
87042
87130
  */
87043
- function bucketOf(value) {
87044
- return typeof value === "object" && value !== null ? value : GLOBAL_KEY$1;
87131
+ function bucketOf$1(value) {
87132
+ return typeof value === "object" && value !== null ? value : GLOBAL_KEY$2;
87045
87133
  }
87046
87134
  /**
87047
87135
  * 订阅一个事件。
@@ -87050,7 +87138,7 @@ function bucketOf(value) {
87050
87138
  * @param listener - 监听器。
87051
87139
  * @returns 解绑函数或 undefined。
87052
87140
  */
87053
- function subscribe$2(ctx, event, listener) {
87141
+ function subscribe$3(ctx, event, listener) {
87054
87142
  const on = ctx?.on;
87055
87143
  if (typeof on !== "function") return void 0;
87056
87144
  try {
@@ -87103,7 +87191,7 @@ function installPlanModeCacheGuard(ctx) {
87103
87191
  }
87104
87192
  kept.push(section);
87105
87193
  }
87106
- const state = stateOf(bucketOf(context?.scope ?? context?.agent));
87194
+ const state = stateOf(bucketOf$1(context?.scope ?? context?.agent));
87107
87195
  if (policy !== void 0) if (policy.trim() === "") {
87108
87196
  state.pending = void 0;
87109
87197
  state.delivered = false;
@@ -87122,7 +87210,7 @@ function installPlanModeCacheGuard(ctx) {
87122
87210
  if (decision === void 0 || decision.kind === "reject") return decision;
87123
87211
  if (payload?.signal?.aborted === true) return decision;
87124
87212
  const agent = payload?.agent;
87125
- const key = bucketOf(agent ?? void 0);
87213
+ const key = bucketOf$1(agent ?? void 0);
87126
87214
  const state = states.get(key);
87127
87215
  if (state === void 0) return decision;
87128
87216
  if (state.delivered) if (planActiveOf(ctx, agent?.session) === false) state.delivered = false;
@@ -87137,8 +87225,8 @@ function installPlanModeCacheGuard(ctx) {
87137
87225
  messages: [...messages, createPlanNotice(text, void 0, "Plan mode guidance")]
87138
87226
  };
87139
87227
  };
87140
- const offAssemble = subscribe$2(ctx, "system-prompt/assemble", onAssemble);
87141
- const offPreStep = subscribe$2(ctx, "agent/pre-step", onPreStep);
87228
+ const offAssemble = subscribe$3(ctx, "system-prompt/assemble", onAssemble);
87229
+ const offPreStep = subscribe$3(ctx, "agent/pre-step", onPreStep);
87142
87230
  if (offAssemble !== void 0) restores.push(() => {
87143
87231
  offAssemble();
87144
87232
  });
@@ -87167,7 +87255,7 @@ function installPlanModeCacheGuard(ctx) {
87167
87255
  restoreMethod$2(target);
87168
87256
  });
87169
87257
  if (typeof tools.get === "function") try {
87170
- if (tools.get("exit_plan_mode") !== void 0) logWarn(ctx, "[dsh-chatgpt-subscription] plan-mode cache guard was installed after exit_plan_mode was already registered; this session keeps the conditional admission");
87258
+ if (tools.get("exit_plan_mode") !== void 0) logWarn$1(ctx, "[dsh-chatgpt-subscription] plan-mode cache guard was installed after exit_plan_mode was already registered; this session keeps the conditional admission");
87171
87259
  } catch {}
87172
87260
  };
87173
87261
  const tools = serviceOf$1(ctx, "tools");
@@ -87214,7 +87302,7 @@ function planActiveOf(ctx, session) {
87214
87302
  * @param ctx - 宿主上下文。
87215
87303
  * @param message - 正文。
87216
87304
  */
87217
- function logWarn(ctx, message) {
87305
+ function logWarn$1(ctx, message) {
87218
87306
  const logger = ctx?.logger;
87219
87307
  try {
87220
87308
  logger?.warn(message);
@@ -87327,7 +87415,7 @@ const DEFAULT_PTC_SDK_CACHE_PROVIDERS = Object.freeze(["kimi-code", "minimax-cod
87327
87415
  /** PTC 生成的 SDK 段名。 */
87328
87416
  const PTC_SDK_SECTION_NAME = "tools:sdk";
87329
87417
  /** 没有 scope 的装配(会话标题之类)用的桶键。 */
87330
- const GLOBAL_KEY = Object.freeze({});
87418
+ const GLOBAL_KEY$1 = Object.freeze({});
87331
87419
  /**
87332
87420
  * 读一个装配 scope 的 provider。
87333
87421
  *
@@ -87421,7 +87509,7 @@ function installPtcSdkCacheGuard(ctx, options = {}) {
87421
87509
  * @param scope - 装配 scope。
87422
87510
  * @returns WeakMap 键。
87423
87511
  */
87424
- const bucketOf = (scope) => typeof scope === "object" && scope !== null ? scope : GLOBAL_KEY;
87512
+ const bucketOf = (scope) => typeof scope === "object" && scope !== null ? scope : GLOBAL_KEY$1;
87425
87513
  /**
87426
87514
  * 算未过滤工具集的名字指纹。
87427
87515
  *
@@ -87511,7 +87599,7 @@ function installPtcSdkCacheGuard(ctx, options = {}) {
87511
87599
  });
87512
87600
  return result;
87513
87601
  };
87514
- const offAssemble = subscribe$1(host, "system-prompt/assemble", onAssemble);
87602
+ const offAssemble = subscribe$2(host, "system-prompt/assemble", onAssemble);
87515
87603
  if (offAssemble !== void 0) disposers.push(offAssemble);
87516
87604
  const initialTools = serviceOf(host, "tools");
87517
87605
  if (initialTools !== void 0) {
@@ -87568,7 +87656,7 @@ function serviceOf(ctx, service) {
87568
87656
  * @param listener - 回调。
87569
87657
  * @returns 移除监听器的 disposer;宿主不支持事件时为 `undefined`。
87570
87658
  */
87571
- function subscribe$1(host, event, listener) {
87659
+ function subscribe$2(host, event, listener) {
87572
87660
  const on = host?.["on"];
87573
87661
  if (typeof on !== "function") return void 0;
87574
87662
  for (const options of [
@@ -87699,6 +87787,233 @@ function markPatched$1(patched, holder, name) {
87699
87787
  else names.add(name);
87700
87788
  }
87701
87789
  //#endregion
87790
+ //#region src/host/team-policy-cache-guard.ts
87791
+ /**
87792
+ * 「Agent Teams 策略段前缀缓存守卫」—— 把内置 `team:policy` 段从 system 里摘掉,
87793
+ * 改为切开关时**尾部投递**一次。
87794
+ *
87795
+ * ## 为什么需要它
87796
+ *
87797
+ * 内置 `@deepseek-ai/dsh-tool-agent-team` 注册一个段 `team:policy`,正文是
87798
+ * `enabled(agent) ? TEAM_POLICY : ''`:团队开关一开,system prompt 里凭空多出整段
87799
+ * 指引,从那里起的前缀全部作废。这与计划模式当初那处重建同构,本仓库已经用
87800
+ * 「摘段 + 尾部投递」把它压平过(见 `plan-mode-cache-guard.ts`),这里复用同一套
87801
+ * 做法,只是触发器从 `enter_plan_mode` 换成客户端远程调用 `agentTeams.setEnabled`
87802
+ * ——那一步只往会话里追加 `team/mode` 事件,段正文在**装配时**才翻面,所以守卫只要
87803
+ * 盯着装配结果就够,不需要订阅任何 team 服务。
87804
+ *
87805
+ * ## 三条动作
87806
+ *
87807
+ * 1. `system-prompt/assemble` 瀑布:把 `team:policy` 段从呈现里摘掉,并记下它的
87808
+ * 正文。system 段从此在开关前后逐字节恒定。
87809
+ * 2. `agent/pre-step`:把记下的正文作为**尾部用户消息**投一次(每次激活一次)。
87810
+ * 末尾追加不改变已发前缀,指引没有丢,只是从最前面的 system 段搬到了末尾。
87811
+ * 3. 段正文回到空串 = 本次激活结束:复位投递状态,并在下一步投一条**撤销**通知,
87812
+ * 免得历史里那句「这里有一块共享任务板」在关闭后继续误导模型。
87813
+ *
87814
+ * ## 抓的是官方原文,不是抄的副本
87815
+ *
87816
+ * 投递的正文永远是装配时从官方段里捕获到的那一份,不落任何本包的副本。harness 改
87817
+ * 措辞(它已经改过三次)不会让这里过期。代价是它依赖段名 `team:policy`:启用后
87818
+ * 若从未观察到该段,守卫记一条 warn 点名,而不是安静地什么都不做。
87819
+ *
87820
+ * ## 默认开启
87821
+ *
87822
+ * 会话中途切开关才会付一次重建;开会话时就是目标状态则本来就零成本。守卫本身不
87823
+ * 增加任何工具声明面,所以默认开着没有代价,由 `teamPolicyCacheGuard` 关闭,
87824
+ * 每次装配/每步重读活引用。
87825
+ *
87826
+ * @module @eddyskywalker/dsh-chatgpt-subscription/host/team-policy-cache-guard
87827
+ */
87828
+ /** 官方 Agent Teams 的指引段名。 */
87829
+ const TEAM_POLICY_SECTION = "team:policy";
87830
+ /** 尾部撤销通知的来源 kind(本包自有,见下方 MessageSourceMap 增补)。 */
87831
+ const TEAM_BOARD_NOTICE_SOURCE_KIND = "team-board-notice";
87832
+ /** 开关关掉时补投的那句话。 */
87833
+ const BOARD_OFF_NOTICE = "The shared team task board was turned off. Ignore earlier guidance describing an available board and coordinate through list_agents and send_message.";
87834
+ /**
87835
+ * 从插件配置里读开关。
87836
+ * @param config - 插件配置(结构化:只读一个键)。
87837
+ * @returns 是否启用本守卫;未声明时按开启处理(宿主 schema 的默认值)。
87838
+ */
87839
+ function resolveTeamPolicyCacheGuardEnabled(config) {
87840
+ return config?.teamPolicyCacheGuard !== false;
87841
+ }
87842
+ /** 没有 scope 的装配(会话标题之类)用的桶键。 */
87843
+ const GLOBAL_KEY = Object.freeze({});
87844
+ /**
87845
+ * 桶键:agent 对象本身,或全局桶。
87846
+ * @param value - scope / agent。
87847
+ * @returns WeakMap 键。
87848
+ */
87849
+ function bucketOf(value) {
87850
+ return typeof value === "object" && value !== null ? value : GLOBAL_KEY;
87851
+ }
87852
+ /**
87853
+ * 订阅一个事件。
87854
+ * @param ctx - 宿主上下文。
87855
+ * @param event - 事件名。
87856
+ * @param listener - 监听器。
87857
+ * @returns 解绑函数或 undefined。
87858
+ */
87859
+ function subscribe$1(ctx, event, listener) {
87860
+ const on = ctx?.on;
87861
+ if (typeof on !== "function") return void 0;
87862
+ try {
87863
+ return on.call(ctx, event, listener);
87864
+ } catch {
87865
+ return;
87866
+ }
87867
+ }
87868
+ /**
87869
+ * 记一条警告。
87870
+ * @param ctx - 宿主上下文。
87871
+ * @param message - 正文。
87872
+ */
87873
+ function logWarn(ctx, message) {
87874
+ try {
87875
+ ctx?.logger?.warn(message);
87876
+ } catch {}
87877
+ }
87878
+ /**
87879
+ * 造一条尾部通知消息。
87880
+ * @param text - 正文。
87881
+ * @param summary - 卡片上显示的一句摘要。
87882
+ * @returns 用户角色的通知消息。
87883
+ */
87884
+ function createBoardNotice(text, summary) {
87885
+ return createUserMessage({
87886
+ content: [{
87887
+ type: "text",
87888
+ text
87889
+ }],
87890
+ source: {
87891
+ kind: TEAM_BOARD_NOTICE_SOURCE_KIND,
87892
+ form: "notice",
87893
+ summary
87894
+ }
87895
+ });
87896
+ }
87897
+ /**
87898
+ * 装一台「Agent Teams 策略段缓存守卫」。
87899
+ *
87900
+ * 幂等性留给调用方:同一个 ctx 装两次会得到两条监听器,宿主入口应当只装一次。
87901
+ * @param ctx - 宿主上下文(结构化:老代 ctx 也认)。
87902
+ * @param options - 开关读取器。
87903
+ * @returns 句柄,dispose 摘掉全部挂载。
87904
+ */
87905
+ function installTeamPolicyCacheGuard(ctx, options = {}) {
87906
+ const states = /* @__PURE__ */ new WeakMap();
87907
+ const stats = {
87908
+ seen: false,
87909
+ warned: false
87910
+ };
87911
+ const restores = [];
87912
+ let closed = false;
87913
+ const enabled = () => {
87914
+ try {
87915
+ return options.enabled?.() === true;
87916
+ } catch {
87917
+ return false;
87918
+ }
87919
+ };
87920
+ const stateOf = (key) => {
87921
+ let state = states.get(key);
87922
+ if (state === void 0) {
87923
+ state = {
87924
+ policy: "",
87925
+ pending: void 0,
87926
+ delivered: false,
87927
+ revoked: false
87928
+ };
87929
+ states.set(key, state);
87930
+ }
87931
+ return state;
87932
+ };
87933
+ const onAssemble = async (_assembly, context, next) => {
87934
+ const result = await next();
87935
+ if (closed || !enabled()) return result;
87936
+ const sections = Array.isArray(result?.sections) ? result.sections : void 0;
87937
+ if (sections === void 0) return result;
87938
+ const kept = [];
87939
+ let policy;
87940
+ for (const section of sections) {
87941
+ if (section?.name === "team:policy") {
87942
+ stats.seen = true;
87943
+ policy = typeof section.text === "string" ? section.text : "";
87944
+ continue;
87945
+ }
87946
+ kept.push(section);
87947
+ }
87948
+ if (policy === void 0) {
87949
+ if (!stats.seen && !stats.warned) {
87950
+ stats.warned = true;
87951
+ logWarn(ctx, `[dsh-chatgpt-subscription] team policy cache guard is enabled but no "${TEAM_POLICY_SECTION}" section has appeared; the guard is inert on this deployment`);
87952
+ }
87953
+ return result;
87954
+ }
87955
+ const state = stateOf(bucketOf(context?.scope ?? context?.agent));
87956
+ if (policy.trim() === "") {
87957
+ if (state.delivered) state.revoked = true;
87958
+ state.delivered = false;
87959
+ state.pending = void 0;
87960
+ } else {
87961
+ state.policy = policy;
87962
+ state.revoked = false;
87963
+ if (!state.delivered) state.pending = policy;
87964
+ }
87965
+ if (kept.length === sections.length) return result;
87966
+ return {
87967
+ ...result,
87968
+ sections: kept
87969
+ };
87970
+ };
87971
+ const onPreStep = async (payload, next) => {
87972
+ const decision = await next();
87973
+ if (closed || decision === void 0 || decision.kind === "reject") return decision;
87974
+ if (payload?.signal?.aborted === true) return decision;
87975
+ if (!enabled()) return decision;
87976
+ const state = states.get(bucketOf(payload?.agent ?? void 0));
87977
+ if (state === void 0) return decision;
87978
+ const messages = Array.isArray(decision.messages) ? decision.messages : [];
87979
+ if (!state.delivered) {
87980
+ const text = state.pending;
87981
+ if (text !== void 0) {
87982
+ state.pending = void 0;
87983
+ state.delivered = true;
87984
+ state.revoked = false;
87985
+ return {
87986
+ ...decision,
87987
+ messages: [...messages, createBoardNotice(text, "Team board guidance")]
87988
+ };
87989
+ }
87990
+ }
87991
+ if (state.revoked) {
87992
+ state.revoked = false;
87993
+ return {
87994
+ ...decision,
87995
+ messages: [...messages, createBoardNotice(BOARD_OFF_NOTICE, "Team board off")]
87996
+ };
87997
+ }
87998
+ return decision;
87999
+ };
88000
+ const offAssemble = subscribe$1(ctx, "system-prompt/assemble", onAssemble);
88001
+ const offPreStep = subscribe$1(ctx, "agent/pre-step", onPreStep);
88002
+ if (offAssemble !== void 0) restores.push(() => {
88003
+ offAssemble();
88004
+ });
88005
+ if (offPreStep !== void 0) restores.push(() => {
88006
+ offPreStep();
88007
+ });
88008
+ return { dispose() {
88009
+ if (closed) return;
88010
+ closed = true;
88011
+ for (const restore of restores.splice(0)) try {
88012
+ restore();
88013
+ } catch {}
88014
+ } };
88015
+ }
88016
+ //#endregion
87702
88017
  //#region src/host/compaction-policy-guard.ts
87703
88018
  /**
87704
88019
  * 「压缩策略守卫」——把 `compaction-basic` 的预算换成 Kimi Code 的口径,
@@ -90318,14 +90633,16 @@ function routeAllowed(allowed, route) {
90318
90633
  * @param parent - the parent session to audit.
90319
90634
  * @param sessions - registry used to resolve children and parents.
90320
90635
  * @param allowed - routes the parent Session authorized, when it recorded any.
90636
+ * @param options - optional parent-fork exemption matching the live guard.
90321
90637
  * @returns violations, ordered as the children were discovered.
90322
90638
  */
90323
- function auditChildRoutes(parent, sessions, allowed) {
90639
+ function auditChildRoutes(parent, sessions, allowed, options) {
90324
90640
  if (allowed === void 0 || allowed.length === 0) return [];
90325
90641
  const violations = [];
90326
90642
  for (const finding of childRoutesOf(parent, sessions)) {
90327
90643
  const effective = effectiveRouteOf(finding, sessions);
90328
90644
  if (routeAllowed(allowed, effective)) continue;
90645
+ if (options?.allowParentFork === true && finding.provider === "fork" && effective.sameAsParent) continue;
90329
90646
  violations.push({
90330
90647
  finding,
90331
90648
  route: {
@@ -92025,6 +92342,8 @@ const PRESET_REGISTRY_PACKAGE = "@deepseek-ai/dsh-agent-preset";
92025
92342
  * registers `{{cwd}}` as a `systemPrompt` variable.
92026
92343
  */
92027
92344
  const WORKING_DIRECTORY_PACKAGE = "@deepseek-ai/dsh-working-directory";
92345
+ /** The standalone PTC executor introduced when tool presentation split into executor plugins. */
92346
+ const PTC_EXECUTOR_PACKAGE = "@deepseek-ai/dsh-tool-executor-ptc";
92028
92347
  /** The id the `dispatch` preset is selectable under. */
92029
92348
  const DISPATCH_PRESET_ID = "dispatch";
92030
92349
  /**
@@ -92051,26 +92370,26 @@ const DISPATCH_PRESET = {
92051
92370
  prefix: `[Role Identification] If your first user message is a task brief (rather than a direct request from the human user), you are a subagent: the coordinator-facing rules in R0, R0.5, R-G, R1, R2, R4, R5, and R-W do not apply to you. You are the executor—plan, execute, and self-verify strictly within your task boundary, and report concrete evidence back to the dispatcher; R3 remains in effect.
92052
92371
  - [Standing Subagent Contract] Unless overridden by the brief, every subagent inherits these standing limits: retry attempts at most 3 total per brief; file edits bounded strictly to the declared Boundary module or files; read, search, verification, and test commands unlimited within that boundary; no per-cycle banking (all limits are single-run task totals, and unused allowance is not banked).
92053
92372
  - [Subagent Report Protocol] Every subagent completion report states status: ready | hand_back | blocked | failed | dropped, a summary, and evidence (diffs, test commands and outputs, before/after captures for UI). A status: hand_back report adds a one-sentence hand_back_reason naming the out-of-boundary file/interface or broken premise, and mutates no file outside Boundary.
92054
- - [Coordinator-Only Tools] ask_user_question, enter_plan_mode, leave_plan_mode, exit_plan_mode, create_goal, update_goal, and present are coordinator-only: a subagent call is hard-blocked at execution time (DELEGATED_CALLER), while declarations remain visible to preserve the provider’s content-prefix cache (notably Kimi Code’s). Never call them as a subagent; escalate via status: hand_back or status: blocked. The bridge’s enforcement is generation-graded (see R9), so never rely on the rejection.
92373
+ - [Coordinator-Only Tools] ask_user_question, enter_plan_mode, leave_plan_mode, exit_plan_mode, create_goal, update_goal, and present are coordinator-only: a subagent call is hard-blocked at execution time (DELEGATED_CALLER), while declarations remain visible to preserve the provider’s content-prefix cache. Never call them as a subagent; escalate via status: hand_back or status: blocked. The bridge’s enforcement is generation-graded (see R9), so never rely on the rejection.
92055
92374
  - [Dispatch Ledger] Call dispatch_ledger {action:"self"} once before your first delegation — it prints the v2 mandate protocol at the tail of its result — and follow that protocol verbatim for every dispatch, report, and steer.
92056
92375
 
92057
- [Coordinator Identity] You are the Dispatch Agent for this session. Your deliverables are plans, task briefs, review verdicts, and delivery summaries—not code written on someone else's behalf.
92058
- [Execution Pipeline] R0.5 Compatibility Gate (once per new session) -> R0 Complexity Triage -> (L2) R-G Clarification Interview -> Planning -> R2 Model Routing -> R5 Task Brief Dispatch -> R-W Turn Boundary Wait -> R6 Review & Acceptance.
92376
+ [Coordinator Identity] You are the Lead & Dispatch Agent: converge requirements, plan architecture, select R1 topology (Lead-Core / Hybrid / Fan-out), orchestrate subagents where ROI is positive, and own final acceptance.
92377
+ [Execution Pipeline] R0.5 Gate -> R0 Triage -> (L2) R-G Interview -> R9 Plan -> R1 Topology -> (if delegating: R2 Routing -> R5 Brief -> R-W Wait) -> R6 Acceptance.
92059
92378
 
92060
92379
  ## R0.5 · Compatibility Gate (Once per New Session, Before R0)
92061
- Dispatch Mode is **incompatible** with Agent Teams and deliberately provides no fallback path: Agent Teams replaces send_message, list_agents, and interrupt_agent with team-scoped registrations, leaving spawned subagents invisible and unreachable.
92062
- Criterion: whether spawn_teammate and wait_agent exist (in PTC mode: tools.spawn_teammate / tools.wait_agent).
92063
- - Neither exists -> Write one line "Orchestration ready: subagent" and proceed to R0.
92064
- - Either exists -> This session is **not orchestratable**. Do these three things in order, and nothing else:
92065
- 1. State in one sentence that Agent Teams shadows the subagent coordination tools and this mode has no degraded path.
92066
- 2. Call ask_user_question once to hand the choice of exit path to the user (see R-W): (1) Disable Agent Teams, restart Host, and **must start a new session** for it to take effect; (2) Switch preset and do not orchestrate here; (3) Execute this task directly as a standalone agent without spawning subagents.
92067
- 3. **Do nothing else** until the user replies: do not triage, plan, dispatch, touch files, or propose workarounds.
92380
+ A legacy Agent Teams runtime (pre-#7519) registers spawn_teammate and replaces send_message / list_agents / interrupt_agent with team-scoped variants, leaving spawned subagents unreachable. The current runtime only adds a shared task board (team_task_create and its list/get/update siblings) and reuses this mode's tools.
92381
+ Criterion: whether spawn_teammate exists (PTC: tools.spawn_teammate). Never gate on wait_agent, send_message, list_agents, or interrupt_agent: this mode mounts those itself.
92382
+ - Absent -> Write "Orchestration ready: subagent" and proceed to R0. The board tools stay visible in the PTC SDK whether or not the board is on - frozen declaration, not availability - so confirm with team_task_list before relying on it. When the board is on it is bookkeeping, not a second dispatcher: the dispatch ledger stays the dispatch authority and R5 briefs stay the task contract; publish cross-agent dependencies (blocked_by) and write scopes on one team task per brief, claimed and completed by the child that owns it; never start work because a task is ready, and never reassign a task to skip R6.
92383
+ - Present -> This session runs the legacy runtime and is **not orchestratable**. In order, and nothing else:
92384
+ 1. State in one sentence that the legacy runtime shadows the coordination tools and this mode has no degraded path.
92385
+ 2. Call ask_user_question once (see R-W) offering: disable the legacy runtime, restart Host, **start a new session**; switch preset; or execute this task directly.
92386
+ 3. **Do nothing else** until the user replies: no triage, plan, dispatch, file edits, or workarounds.
92068
92387
 
92069
92388
  ## R0 · Complexity Triage (Triage First, Then Choose the Workflow)
92070
92389
  Upon receiving a task, determine its tier by semantic impact and uncertainty first, write one line stating "Tier + Rationale", and run the matching workflow:
92071
92390
  - L0 Simple / Single-point: single-file or single-point edit; unambiguous; reversible; no parallelism value. -> Execute directly and report; no interview or subagents.
92072
92391
  - L1 Moderate: unambiguous module-local work; edits at most 5 files (5 is a cap, not a range and not a target) with no cross-module contract break; at most 2 open points; limited parallelism gain. -> Ask at most 2 key questions (no full interview; 2 is the cap) -> brief plan -> execute yourself or dispatch 1 subagent.
92073
- - L2 Complex / Multi-step: cross-module or interface-contract changes, unsettled product/UI decisions, or independent subtasks suitable for parallel execution. -> Run full workflow: Clarification Interview -> Full Plan -> Parallel Subagents -> Layered Acceptance.
92392
+ - L2 Complex / Multi-step: cross-module/contract changes, unsettled product/UI decisions, or multi-part work. -> Full governance: R-G Interview -> R9 Plan & Approval -> execute via R1 topology -> R6 Acceptance.
92074
92393
  - [Stop by Impact, Not by Effort] Within an assigned module or interface boundary, a subagent fixes all affected call sites, types, and tests needed for a self-contained result. It pauses and reports status: hand_back immediately when a change would break an external caller’s contract, alter cross-module responsibilities, or require an unsettled product or UI design decision—even when that change is a single line.
92075
92394
  When in doubt, clarify before escalating; if complexity grows mid-task, stop, re-triage, and inform the user.
92076
92395
 
@@ -92082,8 +92401,11 @@ When in doubt, clarify before escalating; if complexity grows mid-task, stop, re
92082
92401
  - G5 Convergence: End the interview only when the frontier is empty and the user explicitly confirms shared understanding.
92083
92402
  - G6 Prohibited: Answering your own questions, making product/design decisions for the user, skipping the interview, or treating a casual remark as full sign-off.
92084
92403
 
92085
- ## R1 · Responsibility Boundary (Layered by Tier)
92086
- For L2 tasks, execute work yourself only in these seven categories: (1) Planning & decomposition; (2) Dispatching tasks; (3) Review; (4) Acceptance verification; (5) Documentation & delivery summary; (6) Tasks subagents cannot perform; (7) Independent parallel-module implementation sharing no files, unfinished interfaces, or acceptance dependencies with active subagents. For L0/L1 tasks, execute directly.
92404
+ ## R1 · Execution Topology & Boundary (Coupling × Fan-out ROI)
92405
+ L0/L1: execute directly (or 1 subagent for L1). L2: R-G, R9, and R6 are mandatory; pick topology in the plan by coupling vs. parallel ROI (tightly coupled code is never barred from direct execution):
92406
+ - Lead-Core: tightly coupled cross-module/contract changes or sequential chains where splitting duplicates reads or causes hand_back loops. -> Implement directly in continuous steps (track in todo_write, no self-briefs) and run R6 verification.
92407
+ - Hybrid: unsettled shared contracts/seams plus orthogonal downstream work. -> Implement & freeze core seams yourself first, then delegate orthogonal adapters/tests/noisy exploration per R2/R5 (or subagent_fork for warm-context isolation).
92408
+ - Fan-out: >=3 orthogonal subtasks with disjoint files, settled interfaces, and clear parallel/routing gain. -> Coordinate (plan, R2/R5 dispatch, R6 review/acceptance, docs, non-delegable or disjoint parallel modules); never edit an active child's Boundary.
92087
92409
 
92088
92410
  ## R2 · Model Routing (Check Availability First, Then Decide How to Dispatch)
92089
92411
  Check whether list_subagent_models exists (in PTC mode: tools.list_subagent_models). The tool row and provider/model/reasoning_effort parameters are mounted statically, so they are present even in a session that authorized no route at all. Read that fact instead of inferring it from the tool's output:
@@ -92091,9 +92413,9 @@ Check whether list_subagent_models exists (in PTC mode: tools.list_subagent_mode
92091
92413
  - [State: Listed] Output ends with "Authorized child routes for this Session": enforcement is active.
92092
92414
  - 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).
92093
92415
  - Before every dispatch, write route: <provider>/<model> (+ reasoning_effort when applicable) and pass split provider and model (model without the <provider>/ prefix).
92094
- - [State: Unlisted] Output states no allowlist is in force: routing is unrestricted; omitting provider/model is legitimate. State once in your delivery summary that routing is unrestricted because no allowlist was recorded. Never claim per-task routing is in force here.
92416
+ - [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.
92095
92417
  - [State: Unmounted] list_subagent_models is absent and subagent exposes no route fields: subagents inherit your route; omit the route: line.
92096
- - subagent_fork shares the parent route and KV cache; its admission is decided by the route the calling session is actually running, 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.
92418
+ - 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.
92097
92419
 
92098
92420
  ## R3 · Subagent Autonomy & R4 · Subagent Role
92099
92421
  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.
@@ -92107,8 +92429,8 @@ Every task brief covers six elements: Goal / Boundary (which files or modules ma
92107
92429
  ## R6 · Review & Acceptance
92108
92430
  Two layers: subagent self-check -> your independent review (reading diffs, running tests, checking each criterion). The completion notification is a post-hoc signal: it tells you a child stopped, not that the work passed.
92109
92431
  - Re-dispatch budget per brief: 1 first attempt + at most 2 re-dispatches = at most 3 runs total. Count runs, not failures; the number belongs in the task list item for that brief (R7), not in your memory. Only after the third run fails, transition to R8 Fallback.
92110
- - [Non-Penalized hand_back] A subagent that stops cleanly before mutating any out-of-boundary file and reports status: hand_back with a valid hand_back_reason is a scope routing event, not an execution failure, and does not increment the brief’s 3-run failure counter. When re-scoping or answering a child’s hand_back or blocked report, prefer continuing the existing child with send_message({ agent_id }) over spawning a fresh subagent to preserve its warm prefix cache—especially on kimi-code.
92111
- - [Noticed but not handled] Every defect found in review: the defect goes back out on a re-dispatch with evidence or go to the user via ask_user_question (R-W). Writing it into the delivery summary and shipping anyway is not an available outcome.
92432
+ - [Non-Penalized hand_back] A subagent that stops cleanly before mutating any out-of-boundary file and reports status: hand_back with a valid hand_back_reason is a scope routing event, not an execution failure, and does not increment the brief’s 3-run failure counter. When re-scoping or answering a child’s hand_back or blocked report, prefer continuing the existing child with send_message({ agent_id }) over spawning a fresh subagent to preserve its warm prefix cache.
92433
+ - [Noticed but not handled] Every defect found in review: the defect goes back out on a re-dispatch with evidence or go to the user via ask_user_question (R-W); on Lead-Core/Hybrid core, fix and re-verify before delivery. Writing it into the delivery summary and shipping anyway is not an available outcome.
92112
92434
  - [UI Visual Evidence Gate] For any task or subtask that changes visible UI or GUI layout, styling, or components, acceptance requires both Before and After visual evidence—screenshots or live DOM/rendered captures—taken under the same scenario, viewport, and theme. After-only evidence fails R6 review.
92113
92435
 
92114
92436
  ## R-W · Turn Boundary (Waiting / Goals / Questions)
@@ -92122,7 +92444,7 @@ Maintain the task list (in todo_write, not create_goal; see R-W), decision log,
92122
92444
  - [Clause Deletion Test] Keep complete engineering evidence in internal review verification, but before sending the final user-facing delivery summary, ask of each clause whether deleting it would prevent the user from understanding the outcome, risk, or required action—if not, omit it.
92123
92445
 
92124
92446
  ## R8 · Fallback
92125
- Fallback is a task-scoped, non-session-wide exception: it covers only the single task that triggered it. Execute a task yourself only on evidence of: L0/L1 task; subagent tools unmounted (R2 [State: Unmounted]—An unmounted tool is the only routing condition that permits fallback); non-delegable task; or the same task brief has still not passed review after its third run under R6. Fix trigger conditions on hard rejections (on active child limit -> wait and re-dispatch; on subagent model selection -> pass an explicit authorized route). When the next task begins, always return to R0 to triage anew.
92447
+ Fallback is a task-scoped, non-session-wide exception for delegated briefs: it covers only the single task that triggered it. Outside planned direct execution (L0/L1, R1 Lead-Core, or Hybrid core), execute a task yourself only on evidence of: subagent tools unmounted (R2 [State: Unmounted]—An unmounted tool is the only routing condition that permits fallback); non-delegable task; or the same task brief has still not passed review after its third run under R6. Fix trigger conditions on hard rejections (on active child limit -> wait and re-dispatch; on subagent model selection -> pass an explicit authorized route). When the next task begins, always return to R0 to triage anew.
92126
92448
 
92127
92449
  ## R9 · Plan Pipeline (Converged Interview -> Plan Mode -> Plan -> Approval)
92128
92450
  - Trigger: only for L2 once R-G has converged. Call enter_plan_mode immediately once that holds, as the sole action of that step. Read-only exploration and the decision-complete plan belong to the next turn, and exit_plan_mode must be the sole and final tool call of the turn that submits the plan.
@@ -92131,7 +92453,7 @@ Fallback is a task-scoped, non-session-wide exception: it covers only the single
92131
92453
 
92132
92454
  ## Anti-Patterns (Any Occurrence Is a Violation)
92133
92455
  1. Orchestrating or opening Plan Mode for an L0/L1 task, or before the R-G interview has converged (21. Entering Plan Mode for an L0/L1 task, or before the R-G interview has converged; 22. Using leave_plan_mode to bypass exit_plan_mode approval).
92134
- 2. Switching to teammate vocabulary to keep orchestrating when Agent Teams is detected, or Explaining an incompatibility in plain text and leaving the user to figure out the exit path (R0.5).
92456
+ 2. Switching to teammate vocabulary to keep orchestrating under the legacy team runtime, or Treating the team task board as a substitute for R1 topology, R2 routing, R5 briefs, R6 acceptance, or R-W waiting (R0.5).
92135
92457
  3. Omitting provider/model under [State: Listed], Second-guessing list_subagent_models output by hunting through local config or source files just to check which subagent models are allowed, or Reporting a route as "authorized", or claiming per-task routing is in force, when the session recorded no allowlist (R2).
92136
92458
  4. Writing a task brief with a range where a cap belongs ("2–5 files", "a few attempts"), or Asking a subagent to restate its rules as a correctness check (R0, R5).
92137
92459
  5. Running sleep, polling loops, or placeholder long commands to wait, Proactively creating a goal at the start of a task, or Ending with a paragraph of prose to wait for user sign-off instead of calling ask_user_question (R-W).
@@ -92197,7 +92519,7 @@ Fallback is a task-scoped, non-session-wide exception: it covers only the single
92197
92519
 
92198
92520
  [Read-Only Exploration & Clarification Interview] Inspect the repository first using non-mutating reads, searches, and static checks, preferring existing functions, utilities, and patterns; never edit or write files, mutate config, run formatters/codegen that rewrite tracked files, commit, or otherwise enact the plan. To verify repository facts (such as where code lives or how current behavior works), explore read-only yourself or dispatch read-only subagents per R2 (using the routes returned directly by list_subagent_models) without blocking unrelated frontier questions. Before drafting the plan, settle requirements with the user per R0 and R-G: for L2 tasks, work the R-G design tree in rounds—ask the entire current frontier in one ask_user_question call (numbered, titled, with your recommended answer marked first), wait for the answers, and recompute the frontier until it is empty (every branch visited, nothing left silently assumed) and the user explicitly confirms shared understanding; for L0/L1 tasks, keep the interview to at most 2 questions, the ones that actually change the outcome. When a technical, naming, layout, or styling choice can be derived from an established reference in the repository or in AGENTS.md (target_basis: existing-standard), treat it as a repository fact: follow the existing standard and do not ask the user; reserve ask_user_question for unsettled product or design decisions with no established precedent.
92199
92521
 
92200
- [Plan Completeness] Make the plan decision-complete: state the goal and success criteria; group implementation changes by subsystem; specify public API, schema, and data-flow changes; and cover edge cases, failure modes, test strategy, acceptance criteria, and explicit assumptions. Keep it concise enough to scan quickly while detailed enough that an executor or subagent can implement it without making further design decisions. When the plan changes visible UI or GUI layout, styling, or components, it names the Before and After visual evidence acceptance will require (same scenario, viewport, and theme); After-only evidence does not pass review.
92522
+ [Plan Completeness] Make the plan decision-complete: state the goal, success criteria, and R1 execution topology (Lead-Core, Hybrid, or Fan-out with subtask boundaries); group implementation changes by subsystem; specify public API, schema, and data-flow changes; and cover edge cases, failure modes, test strategy, acceptance criteria, and explicit assumptions. Keep it concise enough to scan quickly while detailed enough that an executor or subagent can implement it without making further design decisions. When the plan changes visible UI or GUI layout, styling, or components, it names the Before and After visual evidence acceptance will require (same scenario, viewport, and theme); After-only evidence does not pass review.
92201
92523
 
92202
92524
  [Plan Approval] When ready, call exit_plan_mode with the complete plan Markdown starting with a # Title heading, making exit_plan_mode the sole and final tool call of that turn: implementation or dispatch happens only in subsequent turns after approval. Never paste the final plan into a normal chat response or ask "Should I proceed?" in prose or via ask_user_question. If the user rejects the plan, fold in their feedback and resubmit via exit_plan_mode; if the approval channel is unavailable or aborted, stay in Plan Mode and ask the user to switch modes manually—never start implementing on your own.` }
92203
92525
  }, {
@@ -92353,13 +92675,17 @@ Fallback is a task-scoped, non-session-wide exception: it covers only the single
92353
92675
  * and remove its standalone `./list-agents` export. That row is omitted only when
92354
92676
  * the export is absent; older harnesses keep it because their main entry does not
92355
92677
  * register the tool.
92678
+ *
92679
+ * When the standalone PTC executor exists, it replaces the deprecated
92680
+ * agent-tool-presentation compatibility row and its `{ mode: 'ptc' }` config.
92356
92681
  * @param resolves - whether a bare specifier resolves in this installation.
92357
92682
  * @returns the preset definition for the running harness generation.
92358
92683
  */
92359
92684
  function resolveDispatchPreset(resolves = resolvesFromHere) {
92360
92685
  const hasWorkingDirectory = resolves(WORKING_DIRECTORY_PACKAGE);
92361
92686
  const hasLegacyListAgents = resolves("@deepseek-ai/dsh-tool-subagent-control/list-agents");
92362
- if (!hasWorkingDirectory && hasLegacyListAgents) return DISPATCH_PRESET;
92687
+ const hasPtcExecutor = resolves(PTC_EXECUTOR_PACKAGE);
92688
+ if (!hasWorkingDirectory && hasLegacyListAgents && !hasPtcExecutor) return DISPATCH_PRESET;
92363
92689
  return {
92364
92690
  ...DISPATCH_PRESET,
92365
92691
  plugins: DISPATCH_PRESET.plugins.map((row) => {
@@ -92367,6 +92693,14 @@ function resolveDispatchPreset(resolves = resolvesFromHere) {
92367
92693
  ...row,
92368
92694
  config: row.config.filter((nested) => nested.id !== "tool-subagent-list-agents")
92369
92695
  };
92696
+ if (row.id === "tool-presentation" && hasPtcExecutor) {
92697
+ const { config: _omitted, ...rest } = row;
92698
+ return {
92699
+ ...rest,
92700
+ id: "tool-executor-ptc",
92701
+ name: PTC_EXECUTOR_PACKAGE
92702
+ };
92703
+ }
92370
92704
  if (row.id !== "persona" || !hasWorkingDirectory || typeof row.config !== "object" || row.config === null) return row;
92371
92705
  const { suffix: _omitted, ...rest } = row.config;
92372
92706
  return {
@@ -102932,6 +103266,7 @@ const Config = z$1.object({
102932
103266
  ]).default("auto").volatile().description("进展更新的输出语言:auto 跟随对话语言,zh 中文,en 英文。"),
102933
103267
  planModePipeline: z$1.boolean().default(true).volatile().description("启用计划模式管线:允许调度模式在澄清访谈收敛后用 enter_plan_mode 进入计划模式,放弃规划时用 leave_plan_mode 退出。"),
102934
103268
  dispatchExecutionGuard: z$1.boolean().default(true).volatile().description("启用调度执行守卫:在执行期拦截子代理越权调用主控专用工具,并拦截等待子代理期间的纯 sleep 空等命令;不修改工具声明面,零损耗保护 Kimi 缓存。"),
103269
+ teamPolicyCacheGuard: z$1.boolean().default(true).volatile().description("把内置 Agent Teams 的 team:policy 段从 system prompt 摘掉,改为开关切换时以尾部用户消息投递一次,避免中途开团队协作时刷掉整段前缀缓存;默认开启。"),
102935
103270
  cacheWarmup: z$1.boolean().default(true).volatile().description(CACHE_WARMUP_SETTING_DESCRIPTION),
102936
103271
  cacheWarmupRetrieval: z$1.boolean().default(true).volatile().description(CACHE_WARMUP_RETRIEVAL_SETTING_DESCRIPTION),
102937
103272
  cacheWaitWarmup: z$1.boolean().default(true).volatile().description(CACHE_WAIT_WARMUP_SETTING_DESCRIPTION),
@@ -103000,6 +103335,10 @@ function apply(ctx, pluginConfig = {}) {
103000
103335
  const guard = installPtcSdkCacheGuard(ctx);
103001
103336
  return () => guard.dispose();
103002
103337
  }, "dsh-chatgpt-subscription: PTC SDK cache guard");
103338
+ ctx.effect(() => {
103339
+ const guard = installTeamPolicyCacheGuard(ctx, { enabled: () => resolveTeamPolicyCacheGuardEnabled(pluginConfig) });
103340
+ return () => guard.dispose();
103341
+ }, "dsh-chatgpt-subscription: team policy cache guard");
103003
103342
  ctx.effect(() => {
103004
103343
  const guard = installCompactionPolicyGuard(ctx);
103005
103344
  return () => guard.dispose();
@@ -103082,9 +103421,13 @@ function apply(ctx, pluginConfig = {}) {
103082
103421
  const current = preferences.status();
103083
103422
  const defaultAllowedModels = current.subagentDefaultModels ?? [];
103084
103423
  const byMainModel = current.subagentModelsByMainModel ?? {};
103424
+ const defaultAllowParentFork = current.subagentDefaultAllowParentFork;
103425
+ const allowParentForkByMainModel = current.subagentAllowParentForkByMainModel ?? {};
103085
103426
  return {
103086
103427
  ...defaultAllowedModels.length > 0 ? { defaultAllowedModels } : {},
103087
- ...Object.keys(byMainModel).length > 0 ? { byMainModel } : {}
103428
+ ...Object.keys(byMainModel).length > 0 ? { byMainModel } : {},
103429
+ ...defaultAllowParentFork === true ? { defaultAllowParentFork: true } : {},
103430
+ ...Object.keys(allowParentForkByMainModel).length > 0 ? { allowParentForkByMainModel } : {}
103088
103431
  };
103089
103432
  }
103090
103433
  });
@@ -103448,13 +103791,15 @@ function apply(ctx, pluginConfig = {}) {
103448
103791
  const override = mainRoute === void 0 ? void 0 : (current.subagentModelsByMainModel ?? {})[`${mainRoute.provider}/${mainRoute.model}`];
103449
103792
  const fallback = current.subagentDefaultModels ?? [];
103450
103793
  const allowed = audited === void 0 ? audited : override !== void 0 && override.length > 0 ? override : fallback.length > 0 ? fallback : audited;
103794
+ const forkOverride = mainRoute === void 0 ? void 0 : (current.subagentAllowParentForkByMainModel ?? {})[`${mainRoute.provider}/${mainRoute.model}`];
103795
+ const allowParentFork = typeof forkOverride === "boolean" ? forkOverride : current.subagentDefaultAllowParentFork === true;
103451
103796
  return Promise.resolve({
103452
103797
  sessionId,
103453
103798
  allowedModels: (allowed ?? []).map((route) => ({
103454
103799
  provider: route.provider,
103455
103800
  model: route.model
103456
103801
  })),
103457
- violations: auditChildRoutes(target, sessions, allowed).map((violation) => ({
103802
+ violations: auditChildRoutes(target, sessions, allowed, { allowParentFork }).map((violation) => ({
103458
103803
  childId: violation.finding.childId,
103459
103804
  parentId: violation.finding.parentId ?? null,
103460
103805
  provider: violation.finding.provider ?? null,
@@ -103738,4 +104083,4 @@ function apply(ctx, pluginConfig = {}) {
103738
104083
  }, "dsh-chatgpt-subscription: adapter, routes, and lifecycle");
103739
104084
  }
103740
104085
  //#endregion
103741
- export { AccountPoolCore, AccountPoolStore, AntigravityAdapter, CHANNEL_ALIASES, ADOPTED_CREDENTIAL_EXPIRED_HINT as CLAUDE_ADOPTED_CREDENTIAL_EXPIRED_HINT, API_BASE as CLAUDE_API_BASE, DEFAULT_VISIBLE_MODEL_IDS as CLAUDE_DEFAULT_VISIBLE_MODELS, FALLBACK_MODELS as CLAUDE_FALLBACK_MODELS, MESSAGES_PATH as CLAUDE_MESSAGES_PATH, CLAUDE_MODELS, CLAUDE_MODEL_IDS, PROVIDER_ID as CLAUDE_PROVIDER_ID, PROVIDER_NAME as CLAUDE_PROVIDER_NAME, QUOTA_CACHE_TTL_MS as CLAUDE_QUOTA_CACHE_TTL_MS, CLAUDE_REASONING_EFFORTS, ROUTE_PREFIX as CLAUDE_ROUTE_PREFIX, CLINE_PASS_API_KEY_ENV, DEFAULT_BASE_URL as CLINE_PASS_DEFAULT_BASE_URL, DEFAULT_MODELS as CLINE_PASS_DEFAULT_MODELS, MAX_UPSTREAMS as CLINE_PASS_MAX_UPSTREAMS, MODEL_CATALOG as CLINE_PASS_MODEL_CATALOG, POOL_COOLDOWN_MS as CLINE_PASS_POOL_COOLDOWN_MS, REASONING_EFFORTS as CLINE_PASS_REASONING_EFFORTS, CLINE_PASS_ROUTES, CLINE_PASS_ROUTE_PREFIX, CLINE_PASS_PROVIDER_ID as CLINE_PASS_ROUTE_PROVIDER_ID, CLINE_PASS_PROVIDER_NAME as CLINE_PASS_ROUTE_PROVIDER_NAME, ClaudeAccountPool, ClaudeAdapter, FileCredentialStore as ClaudeCredentialStore, FileModelSettingsStore as ClaudeModelSettingsStore, ClinePassAccountPool, ClinePassAdapter, FileCredentialStore$1 as ClinePassCredentialStore, ClinePassEngine, ClinePassModelSettingsStore, CodexAccountPool, CodexChatGptAdapter, CommandCodeAccountPool, CommandCodeAdapter, FileCredentialStore$2 as CommandCodeCredentialStore, FileModelSettingsStore$1 as CommandCodeModelSettingsStore, Config, DEFAULT_GUARD_OPTIONS, DEFAULT_SUBAGENT_INHERIT_TOOLS, FileCredentialStore$3 as FileCredentialStore, FileModelSettingsStore$2 as FileModelSettingsStore, GLM_CODING_PLAN_PREFERENCES_NAMESPACE, QUOTA_WINDOW_MINUTES as GLM_CODING_PLAN_QUOTA_WINDOW_MINUTES, GLM_CODING_PLAN_RETRY_POLICY_CONFIG, PROVIDER_ID$1 as GLM_CODING_PLAN_ROUTE_PROVIDER_ID, PROVIDER_NAME$1 as GLM_CODING_PLAN_ROUTE_PROVIDER_NAME, GLM_MODEL_CATALOG, GLM_MODEL_IDS, GLM_POOL_COOLDOWN_MS, GlmAdoptedCredentialRefreshError, GlmCodingPlanAccountPool, GlmCodingPlanAdapter, GlmCodingPlanCredentialStore, GlmCodingPlanModelSettingsStore, KIMI_CODE_MODELS, KIMI_CODE_RETRY_POLICY_CONFIG, KimiCodeAccountPool, KimiCodeAdapter, FileCredentialStore$4 as KimiCodeCredentialStore, FileModelSettingsStore$3 as KimiCodeModelSettingsStore, LinuxFileTokenStore, AGENT_LLM_PREFIX as MINIMAX_CODE_AGENT_LLM_PREFIX, DEFAULT_MAX_MESSAGE_BODY_BYTES as MINIMAX_CODE_MAX_MESSAGE_BODY_BYTES, MESSAGES_PATH$1 as MINIMAX_CODE_MESSAGES_PATH, MINIMAX_CODE_MODELS, PROBE_MODEL as MINIMAX_CODE_PROBE_MODEL, MINIMAX_CODE_PROVIDER_ID, MINIMAX_CODE_PROVIDER_NAME, MINIMAX_CODE_REASONING_EFFORTS, REGION_HOSTS as MINIMAX_CODE_REGION_HOSTS, MINIMAX_CODE_RETRY_POLICY_CONFIG, MINIMAX_CODE_ROUTE_PREFIX, MacKeychainTokenStore, MinimaxCodeAccountPool, MinimaxCodeAdapter, MinimaxCodeCheckinService, MinimaxCodeCredentialStore, MinimaxCodeModelSettingsStore, OAuthService, OPENDESIGN_API_KEY_ENV, OPENDESIGN_CONSOLE_URL, DEFAULT_BASE_URL$1 as OPENDESIGN_DEFAULT_BASE_URL, DEFAULT_CONTEXT_WINDOW as OPENDESIGN_DEFAULT_CONTEXT_WINDOW, DEFAULT_MAX_CONCURRENT_REQUESTS as OPENDESIGN_DEFAULT_MAX_CONCURRENT_REQUESTS, DEFAULT_MAX_TOKENS as OPENDESIGN_DEFAULT_MAX_TOKENS, DEFAULT_MODELS$1 as OPENDESIGN_DEFAULT_MODELS, DEFAULT_STREAM_IDLE_TIMEOUT_MS as OPENDESIGN_DEFAULT_STREAM_IDLE_TIMEOUT_MS, PROVIDER_ID$2 as OPENDESIGN_HOST_PROVIDER_ID, PROVIDER_NAME$2 as OPENDESIGN_HOST_PROVIDER_NAME, MODEL_CATALOG$1 as OPENDESIGN_MODEL_CATALOG, MODEL_PRICES_URL as OPENDESIGN_MODEL_PRICES_URL, NO_ANSWER_PHRASE as OPENDESIGN_NO_ANSWER_PHRASE, POOL_COOLDOWN_MS$1 as OPENDESIGN_POOL_COOLDOWN_MS, OPENDESIGN_PROVIDER_ID, OPENDESIGN_PROVIDER_NAME, REASONING_EFFORT_IDS as OPENDESIGN_REASONING_EFFORT_IDS, OPENDESIGN_ROUTES, OPENDESIGN_ROUTE_PREFIX, OpenDesignAccountPool, OpenDesignAdapter, FileCredentialStore$5 as OpenDesignCredentialStore, OpenDesignModelSettingsStore, ProxyManager, QODER_POOL_COOLDOWN_MS, QODER_PROVIDER_ID, QODER_PROVIDER_NAME, QODER_REGIONS, QODER_RETRY_POLICY_CONFIG, QODER_ROUTE_PREFIX, QoderAccountPool, QoderAdapter, QoderCredentialStore, QoderModelSettingsStore, RELAY_PROBE_ENV, RELAY_PROBE_FILE_ENV, RELAY_PROBE_FILE_NAME, RELAY_PROBE_MAX_BYTES, RELAY_SOURCE_KINDS, RESUME_HINT, RESUME_HINT_STRICT, RelayProbe, ResponsesClient, STEP_CODE_POOL_COOLDOWN_MS, STEP_CODE_PROFILES, STEP_CODE_PROVIDER_ID, STEP_CODE_PROVIDER_NAME, STEP_CODE_RETRY_POLICY_CONFIG, STEP_CODE_ROUTE_PREFIX, SUBAGENT_MODEL_SELECTION_NAMESPACE, SUBAGENT_POLICY_EVENT, SearchProviderSwitcher, StepCodeAccountPool, StepCodeAdapter, StepCodeCredentialRefreshError, StepCodeCredentialStore, StepCodeModelSettingsStore, StepCodeQuotaCredentialStore, UsageService, FALLBACK_MODELS$1 as WORKBUDDY_MODELS, WORKBUDDY_MODEL_IDS, WindowsDpapiTokenStore, WorkBuddyAdapter, WorkBuddyCheckinService, FileCredentialStore$6 as WorkBuddyCredentialStore, FileModelSettingsStore$4 as WorkBuddyModelSettingsStore, adoptZcodeSignIn as adoptGlmZcodeSignIn, adoptedPoolAccountKey, apply, assertRequestBodyFits as assertMinimaxCodeBodyFits, assertStreamComplete as assertMinimaxCodeStreamComplete, auditChildRoutes, auditedRoutesOf, authorizedRoutesFor, beginLogin as beginClaudeLogin, beginWebLogin as beginKimiCodeLogin, beginWebLogin$1 as beginMinimaxCodeLogin, beginWebLogin$2 as beginWebLogin, buildAttempts, buildClaudeModelOptions, buildClinePassBody, buildGlmRequestPlan, buildMinimaxCodeModelOptions, buildMinimaxRequest, buildOpenDesignBody, cachedQoderModelCatalog, cachedStepCodeModelCatalog, cancelLogin as cancelClaudeLogin, cancelWebLogin as cancelMinimaxCodeLogin, catalogModelOptions, channelNameFor, childRoutesOf, clampOutputToContext as clampMinimaxCodeOutputToContext, classifyFailure as classifyClaudeFailure, classifyKimiFailure, classifyMinimaxFailure, classifyUpstreamError, classifyFailure$1 as classifyWorkBuddyFailure, claudeCliVersion, claudeCodeCredentialPaths, claudeCodeCredentialPresence, codeForFailure as claudeCodeForFailure, credentialPath as claudeCredentialPath, defaultContextWindowFor as claudeDefaultContextWindow, maxOutputTokensFor as claudeMaxOutputTokens, claudeModelCanDisableThinking, modelSettingsPath as claudeModelSettingsPath, claudeModelSupportsImage, claudeModelSupportsTemperature, claudePoolPath, claudeReasoningEfforts, claudeThinkingMode, toLlmError as claudeToLlmError, clearCachedQuota, clearCachedCatalog as clearClaudeCatalog, clearCachedQuota$1 as clearClaudeQuota, clearCachedQuota$2 as clearCommandCodeQuota, clearCachedQuota$3 as clearKimiCodeQuota, clearCachedQuota$4 as clearMinimaxCodeQuota, clearCachedCatalog$1 as clearWorkBuddyCatalog, clearCachedQuota$5 as clearWorkBuddyQuota, clinePassAccountKey, clinePassAccountQuota, catalogEntry as clinePassCatalogEntry, chatCompletion as clinePassChatCompletion, chatURL as clinePassChatURL, credentialPath$1 as clinePassCredentialPath, defaultPin as clinePassDefaultPin, clinePassKnownModelIds, modelSettingsPath$1 as clinePassModelSettingsPath, clinePassPoolPath, clinePassVisibleModelIds, clinePassWindowDurationMins, clinePassWindowLabel, closeMinimaxStream, codexPoolPath, collapseScore, commandCodeAccountKey, credentialPath$2 as commandCodeCredentialPath, modelSettingsPath$2 as commandCodeModelSettingsPath, commandCodePoolPath, contextWindowForModel, convergeGlmEffort, createAntigravityImageTool, createClinePassLine, createClinePassStore, createCodexFetchProvider, createCodexImageTool, createCodexSearchProvider, createFileRelayProbeSink, createMinimaxCodeAccountsHandler, createMessage as createMinimaxCodeMessage, createPkcePair as createMinimaxCodePkcePair, createStreamState as createMinimaxCodeStreamState, createOpenDesignLine, createPlatformTokenStore, createSubagentAuthorization, credentialPath$3 as credentialPath, credentialsFromAdopt, credentialsFromCliLogin, defaultOpenDesignModelSettings, delegationDenialReason, delegationModeOf, describeCredentials as describeMinimaxCodeCredentials, detectSystemProxy, dshHomeDir, effectiveRouteOf, ensureAccessToken as ensureClaudeAccessToken, ensureAccessToken$1 as ensureKimiCodeAccessToken, ensureAccessToken$2 as ensureMinimaxCodeAccessToken, extractAvailableProviders, fetchAccountQuota, fetchAccountQuota$1 as fetchClaudeQuota, fetchGatewayCatalog as fetchClinePassGatewayCatalog, fetchOfficialModels as fetchClinePassOfficialModels, fetchUsageLimits as fetchClinePassUsageLimits, fetchAccountQuota$2 as fetchCommandCodeQuota, fetchGlmQuota, fetchAccountQuota$3 as fetchKimiCodeQuota, fetchUserInfo as fetchKimiCodeUserInfo, fetchTokenPlanQuota as fetchMinimaxCodeQuota, fetchGatewayCatalog$1 as fetchOpenDesignGatewayCatalog, fetchAccountQuota$4 as fetchWorkBuddyQuota, getCachedQuota as getCachedGlmCodingPlanQuota, getCachedQuota$1 as getCachedQuota, getLoginStatus as getClaudeLoginStatus, getCachedQuota$2 as getClaudeQuota, getClaudeWebStatus, getClinePassWebStatus, getWebLoginStatus as getCommandCodeLoginStatus, getCachedQuota$3 as getCommandCodeQuota, getCommandCodeWebStatus, getGlmCodingPlanStatus, getWebLoginStatus$1 as getKimiCodeLoginStatus, getCachedQuota$4 as getKimiCodeQuota, getKimiCodeWebStatus, getWebLogin as getMinimaxCodeLogin, getCachedQuota$5 as getMinimaxCodeQuota, getMinimaxCodeWebStatus, getOpenDesignWebStatus, getQoderStatus, getStepCodeStatus, getCachedQuota$6 as getWorkBuddyQuota, getWorkBuddyWebStatus, glmCatalogSize, authorizeUrl as glmCodingPlanAuthorizeUrl, catalogSize as glmCodingPlanCatalogCount, credentialPath$4 as glmCodingPlanCredentialPath, modelSettingsPath$3 as glmCodingPlanModelSettingsPath, modelsForRegion as glmCodingPlanModelsForRegion, glmCodingPlanPoolIdentity, glmCodingPlanPoolPath, glmCodingPlanPoolQuota, glmCodingPlanPoolStatus, glmCodingPlanSettingsSource, glmCooldownDecision, glmSubPathOf, inheritOverrideReason, inheritRouteDenialReason, inheritedRouteOf, inject, injectPrefs, installReasoningCollapseGuard, installRelayProbe, installSubagentModelAuthorization, isAdherenceOk, isAdoptedClaudeCredential, isAdoptedCredentialExpired, isAdoptedCredential as isAdoptedGlmCodingPlanCredential, isAdoptedZcodeCredential as isAdoptedGlmZcodeCredential, isAdoptedPoolCredential, isClaudeReasoningEffort, isClinePassPinMode, isGlmReasoningEffort, isMinimaxCodeReasoningEffort, isRefreshTokenRejected as isMinimaxCodeRefreshTokenRejected, isAuthenticationError as isOpenDesignAuthenticationError, isThinkingDisabledEffort, credentialPath$5 as kimiCodeCredentialPath, kimiCodeModelDef, modelSettingsPath$4 as kimiCodeModelSettingsPath, kimiCodePoolPath, listModelIds as listMinimaxCodeModelIds, loadCatalog as loadClaudeCatalog, loadProviderModels as loadCommandCodeModels, loadCatalog$1 as loadGlmCodingPlanCatalog, loadProviderModels$1 as loadKimiCodeModels, loadConfigCatalog as loadWorkBuddyModels, loginAndSave, mapCodexUsage, mapFinishReason, mapFinishReason$1 as mapOpenDesignFinishReason, mapUsage as mapOpenDesignUsage, mapUsage$1 as mapUsage, mergeGlmCodingPlanSettings, mergeUpstreams, accountFromCredentials as minimaxCodeAccountFromCredentials, accountHost as minimaxCodeAccountHost, agentBaseUrl as minimaxCodeAgentBaseUrl, authJsonPath as minimaxCodeAuthJsonPath, authStateJsonPath as minimaxCodeAuthStateJsonPath, catalogSize$1 as minimaxCodeCatalogSize, credentialIsFresh as minimaxCodeCredentialIsFresh, effortForModel as minimaxCodeEffortForModel, minimaxHomeDir as minimaxCodeHomeDir, maxMessageBodyBytes as minimaxCodeMaxMessageBodyBytes, maxOutputTokensFor$1 as minimaxCodeMaxOutputTokens, messagesUrl as minimaxCodeMessagesUrl, minimaxCodeModelDef, minimaxCodeModelIds, minimaxCodeModelName, modelRequestHeaders as minimaxCodeModelRequestHeaders, modelSettingsPath$5 as minimaxCodeModelSettingsPath, outputConfigFor as minimaxCodeOutputConfig, pluginCredentialPath as minimaxCodePluginCredentialPath, minimaxCodePoolIdentity, minimaxCodePoolPath, minimaxCodePoolStatus, quotaHostCandidates as minimaxCodeQuotaHostCandidates, quotaRequestHeaders as minimaxCodeQuotaRequestHeaders, subPathOf as minimaxCodeSubPathOf, tokenPlanRemainsUrl as minimaxCodeTokenPlanRemainsUrl, modelSettingsPath$6 as modelSettingsPath, normalizeDelegationToolNames, normalizeRegion as normalizeGlmCodingPlanRegion, normalizeInheritToolNames, normalizePinMode, normalizeRotationStrategy, normalizeSort, openChatStream as openClinePassChatStream, bearerFor as openDesignBearerFor, catalogEntry$1 as openDesignCatalogEntry, chatURL$1 as openDesignChatURL, credentialPath$6 as openDesignCredentialPath, credentialsIdentity as openDesignCredentialsIdentity, firstMessage as openDesignFirstMessage, openDesignKnownModelIds, modelSettingsPath$7 as openDesignModelSettingsPath, modelsURL as openDesignModelsURL, reasoningOf as openDesignReasoningOf, streamErrorCode as openDesignStreamErrorCode, openDesignVisibleModelIds, openChatStream$1 as openOpenDesignChatStream, opendesignAccountKey, opendesignPoolPath, parseAllowedRoutes, parseClaudeCredentialDocument, parseClaudeCredentials, parseClaudePoolData, parseUsagePayload as parseClaudeUsagePayload, parseClinePassCredentials, parseClinePassModelSettings, parseClinePassPoolData, parseCodexPoolData, parseCodexUsage, parseCommandCodePoolData, parseGlmCodingPlanCredentials, parseGlmCodingPlanPoolData, parseKimiCodePoolData, parseMinimaxCodeCredentials, parseMinimaxCodePoolData, parseTokenPlanQuota as parseMinimaxCodeQuota, parseAnthropicUsage as parseMinimaxCodeUsage, parseOpenDesignCredentials, parseOpenDesignModelSettings, parseOpenDesignPoolData, parseServerSentEvents as parseOpenDesignServerSentEvents, parseQoderCredentials, parseResponsesStream, parseRouting, parseServerSentEvents$1 as parseServerSentEvents, parseTier0, parseBilling as parseWorkBuddyBilling, parseConfigModels as parseWorkBuddyConfigModels, parseCredentialFile as parseWorkBuddyCredential, pinAdherence, pinWarnings, policyRoutesOf, pollWebLogin as pollMinimaxCodeLogin, probeConnection as probeClaudeConnection, processMinimaxStreamLine, qoderCatalogSize, credentialPath$7 as qoderCredentialPath, qoderCredentialsExpireAt, qoderCredentialsNeedRefresh, modelSettingsPath$8 as qoderModelSettingsPath, qoderPoolIdentity, qoderPoolPath, qoderPoolQuota, qoderPoolStatus, qoderPoolStatusSlice, qoderRefreshFailureStatus, qoderSettingsSource, qoderSubPathOf, readChildDescriptor, readClaudeCodeCredentials, readGlmResetAt, readQoderCacheStats, readStepCodeCacheStats, reasoningOf$1 as reasoningOf, redactToken as redactMinimaxCodeToken, refreshAntigravityToken, refreshAccessToken as refreshClaudeToken, refreshAccessToken$1 as refreshKimiCodeToken, refreshAccessToken$2 as refreshMinimaxCodeToken, refreshCredentials as refreshWorkBuddyCredentials, registerClaudePreferenceStore, registerClaudeRoutes, registerClinePassRoutes, registerCommandCodePreferenceStore, registerCommandCodeRoutes, registerGlmCodingPlanPreferenceStore, registerGlmCodingPlanRoutes, registerKimiCodePreferenceStore, registerKimiCodeRoutes, registerMinimaxCodePreferenceStore, registerMinimaxCodeRoutes, registerOpenDesignRoutes, registerQoderPreferenceStore, registerQoderRoutes, registerStepCodePreferenceStore, registerStepCodeRoutes, registerWorkBuddyPreferenceStore, registerWorkBuddyRoutes, relayProbeEnabled, relayProbeEnvFile, relayProbeEnvValue, relayProbeLogPath, rememberQoderCacheUsage, rememberStepCodeCacheUsage, requestDeviceAuthorization as requestKimiCodeDeviceAuthorization, requestDeviceAuthorization$1 as requestMinimaxCodeDeviceAuthorization, resetWebLogins as resetMinimaxCodeLogins, resolveEnabledModelIds as resolveClaudeEnabledModelIds, resolveLoginInput as resolveClaudeLoginInput, resolveClaudeModel, resolveGlmModel, resolveGuardOptions, resolveRegion as resolveKimiCodeRegion, resolveMinimaxCodeEnabledModelIds, resolveMinimaxCodeModelId, resolveQuotaCounts as resolveMinimaxCodeQuotaCounts, resolveModelInfo as resolveOpenDesignModelInfo, resolveOutputBudget as resolveOpenDesignOutputBudget, resolveWorkBuddyModel, revokeToken as revokeMinimaxCodeToken, saveApiKey as saveCommandCodeApiKey, scanCredentials as scanWorkBuddyCredentials, sendJSON as sendClinePassJSON, sendJSON$1 as sendOpenDesignJSON, serializeMessages, serializeMessages$1 as serializeOpenDesignMessages, setClaudeCliVersion, beginWebLogin$3 as startCommandCodeLogin, stepCodeCatalogSize, credentialPath$8 as stepCodeCredentialPath, stepCodeModelCatalogFrom, modelSettingsPath$9 as stepCodeModelSettingsPath, stepCodePoolIdentity, stepCodePoolPath, stepCodePoolQuota, stepCodePoolStatus, stepCodePoolStatusSlice, quotaCredentialPath as stepCodeQuotaCredentialPath, stepCodeSettingsSource, stepCodeSubPathOf, streamErrorCode$1 as streamErrorCode, subagentModelSelectionPreference, submitLoginInput as submitClaudeLoginInput, summarizeFailureBody as summarizeMinimaxCodeFailureBody, testConnection as testMinimaxCodeConnection, testApiKey as testOpenDesignApiKey, translate, translate$1 as translateOpenDesignStream, trimBase as trimClinePassBase, trimBase$1 as trimOpenDesignBase, unauthorizedRouteReason, validateAuthorizationScope, validateDelegationToolNames, validateInheritToolNames, verifyCodingPlanKey as verifyGlmCodingPlanKey, violationText, warmQoderCatalogOnStartup, withTimeout as withOpenDesignTimeout, modelSettingsPath$10 as workBuddyModelSettingsPath, modelsForRegion$1 as workBuddyModelsForRegion, zcodeCredentialsPath };
104086
+ export { AccountPoolCore, AccountPoolStore, AntigravityAdapter, CHANNEL_ALIASES, ADOPTED_CREDENTIAL_EXPIRED_HINT as CLAUDE_ADOPTED_CREDENTIAL_EXPIRED_HINT, API_BASE as CLAUDE_API_BASE, DEFAULT_VISIBLE_MODEL_IDS as CLAUDE_DEFAULT_VISIBLE_MODELS, FALLBACK_MODELS as CLAUDE_FALLBACK_MODELS, MESSAGES_PATH as CLAUDE_MESSAGES_PATH, CLAUDE_MODELS, CLAUDE_MODEL_IDS, PROVIDER_ID as CLAUDE_PROVIDER_ID, PROVIDER_NAME as CLAUDE_PROVIDER_NAME, QUOTA_CACHE_TTL_MS as CLAUDE_QUOTA_CACHE_TTL_MS, CLAUDE_REASONING_EFFORTS, ROUTE_PREFIX as CLAUDE_ROUTE_PREFIX, CLINE_PASS_API_KEY_ENV, DEFAULT_BASE_URL as CLINE_PASS_DEFAULT_BASE_URL, DEFAULT_MODELS as CLINE_PASS_DEFAULT_MODELS, MAX_UPSTREAMS as CLINE_PASS_MAX_UPSTREAMS, MODEL_CATALOG as CLINE_PASS_MODEL_CATALOG, POOL_COOLDOWN_MS as CLINE_PASS_POOL_COOLDOWN_MS, REASONING_EFFORTS as CLINE_PASS_REASONING_EFFORTS, CLINE_PASS_ROUTES, CLINE_PASS_ROUTE_PREFIX, CLINE_PASS_PROVIDER_ID as CLINE_PASS_ROUTE_PROVIDER_ID, CLINE_PASS_PROVIDER_NAME as CLINE_PASS_ROUTE_PROVIDER_NAME, ClaudeAccountPool, ClaudeAdapter, FileCredentialStore as ClaudeCredentialStore, FileModelSettingsStore as ClaudeModelSettingsStore, ClinePassAccountPool, ClinePassAdapter, FileCredentialStore$1 as ClinePassCredentialStore, ClinePassEngine, ClinePassModelSettingsStore, CodexAccountPool, CodexChatGptAdapter, CommandCodeAccountPool, CommandCodeAdapter, FileCredentialStore$2 as CommandCodeCredentialStore, FileModelSettingsStore$1 as CommandCodeModelSettingsStore, Config, DEFAULT_GUARD_OPTIONS, DEFAULT_PARENT_FORK_TOOLS, DEFAULT_SUBAGENT_INHERIT_TOOLS, FileCredentialStore$3 as FileCredentialStore, FileModelSettingsStore$2 as FileModelSettingsStore, GLM_CODING_PLAN_PREFERENCES_NAMESPACE, QUOTA_WINDOW_MINUTES as GLM_CODING_PLAN_QUOTA_WINDOW_MINUTES, GLM_CODING_PLAN_RETRY_POLICY_CONFIG, PROVIDER_ID$1 as GLM_CODING_PLAN_ROUTE_PROVIDER_ID, PROVIDER_NAME$1 as GLM_CODING_PLAN_ROUTE_PROVIDER_NAME, GLM_MODEL_CATALOG, GLM_MODEL_IDS, GLM_POOL_COOLDOWN_MS, GlmAdoptedCredentialRefreshError, GlmCodingPlanAccountPool, GlmCodingPlanAdapter, GlmCodingPlanCredentialStore, GlmCodingPlanModelSettingsStore, KIMI_CODE_MODELS, KIMI_CODE_RETRY_POLICY_CONFIG, KimiCodeAccountPool, KimiCodeAdapter, FileCredentialStore$4 as KimiCodeCredentialStore, FileModelSettingsStore$3 as KimiCodeModelSettingsStore, LinuxFileTokenStore, AGENT_LLM_PREFIX as MINIMAX_CODE_AGENT_LLM_PREFIX, DEFAULT_MAX_MESSAGE_BODY_BYTES as MINIMAX_CODE_MAX_MESSAGE_BODY_BYTES, MESSAGES_PATH$1 as MINIMAX_CODE_MESSAGES_PATH, MINIMAX_CODE_MODELS, PROBE_MODEL as MINIMAX_CODE_PROBE_MODEL, MINIMAX_CODE_PROVIDER_ID, MINIMAX_CODE_PROVIDER_NAME, MINIMAX_CODE_REASONING_EFFORTS, REGION_HOSTS as MINIMAX_CODE_REGION_HOSTS, MINIMAX_CODE_RETRY_POLICY_CONFIG, MINIMAX_CODE_ROUTE_PREFIX, MacKeychainTokenStore, MinimaxCodeAccountPool, MinimaxCodeAdapter, MinimaxCodeCheckinService, MinimaxCodeCredentialStore, MinimaxCodeModelSettingsStore, OAuthService, OPENDESIGN_API_KEY_ENV, OPENDESIGN_CONSOLE_URL, DEFAULT_BASE_URL$1 as OPENDESIGN_DEFAULT_BASE_URL, DEFAULT_CONTEXT_WINDOW as OPENDESIGN_DEFAULT_CONTEXT_WINDOW, DEFAULT_MAX_CONCURRENT_REQUESTS as OPENDESIGN_DEFAULT_MAX_CONCURRENT_REQUESTS, DEFAULT_MAX_TOKENS as OPENDESIGN_DEFAULT_MAX_TOKENS, DEFAULT_MODELS$1 as OPENDESIGN_DEFAULT_MODELS, DEFAULT_STREAM_IDLE_TIMEOUT_MS as OPENDESIGN_DEFAULT_STREAM_IDLE_TIMEOUT_MS, PROVIDER_ID$2 as OPENDESIGN_HOST_PROVIDER_ID, PROVIDER_NAME$2 as OPENDESIGN_HOST_PROVIDER_NAME, MODEL_CATALOG$1 as OPENDESIGN_MODEL_CATALOG, MODEL_PRICES_URL as OPENDESIGN_MODEL_PRICES_URL, NO_ANSWER_PHRASE as OPENDESIGN_NO_ANSWER_PHRASE, POOL_COOLDOWN_MS$1 as OPENDESIGN_POOL_COOLDOWN_MS, OPENDESIGN_PROVIDER_ID, OPENDESIGN_PROVIDER_NAME, REASONING_EFFORT_IDS as OPENDESIGN_REASONING_EFFORT_IDS, OPENDESIGN_ROUTES, OPENDESIGN_ROUTE_PREFIX, OpenDesignAccountPool, OpenDesignAdapter, FileCredentialStore$5 as OpenDesignCredentialStore, OpenDesignModelSettingsStore, ProxyManager, QODER_POOL_COOLDOWN_MS, QODER_PROVIDER_ID, QODER_PROVIDER_NAME, QODER_REGIONS, QODER_RETRY_POLICY_CONFIG, QODER_ROUTE_PREFIX, QoderAccountPool, QoderAdapter, QoderCredentialStore, QoderModelSettingsStore, RELAY_PROBE_ENV, RELAY_PROBE_FILE_ENV, RELAY_PROBE_FILE_NAME, RELAY_PROBE_MAX_BYTES, RELAY_SOURCE_KINDS, RESUME_HINT, RESUME_HINT_STRICT, RelayProbe, ResponsesClient, STEP_CODE_POOL_COOLDOWN_MS, STEP_CODE_PROFILES, STEP_CODE_PROVIDER_ID, STEP_CODE_PROVIDER_NAME, STEP_CODE_RETRY_POLICY_CONFIG, STEP_CODE_ROUTE_PREFIX, SUBAGENT_MODEL_SELECTION_NAMESPACE, SUBAGENT_POLICY_EVENT, SearchProviderSwitcher, StepCodeAccountPool, StepCodeAdapter, StepCodeCredentialRefreshError, StepCodeCredentialStore, StepCodeModelSettingsStore, StepCodeQuotaCredentialStore, UsageService, FALLBACK_MODELS$1 as WORKBUDDY_MODELS, WORKBUDDY_MODEL_IDS, WindowsDpapiTokenStore, WorkBuddyAdapter, WorkBuddyCheckinService, FileCredentialStore$6 as WorkBuddyCredentialStore, FileModelSettingsStore$4 as WorkBuddyModelSettingsStore, adoptZcodeSignIn as adoptGlmZcodeSignIn, adoptedPoolAccountKey, apply, assertRequestBodyFits as assertMinimaxCodeBodyFits, assertStreamComplete as assertMinimaxCodeStreamComplete, auditChildRoutes, auditedRoutesOf, authorizedRoutesFor, beginLogin as beginClaudeLogin, beginWebLogin as beginKimiCodeLogin, beginWebLogin$1 as beginMinimaxCodeLogin, beginWebLogin$2 as beginWebLogin, buildAttempts, buildClaudeModelOptions, buildClinePassBody, buildGlmRequestPlan, buildMinimaxCodeModelOptions, buildMinimaxRequest, buildOpenDesignBody, cachedQoderModelCatalog, cachedStepCodeModelCatalog, cancelLogin as cancelClaudeLogin, cancelWebLogin as cancelMinimaxCodeLogin, catalogModelOptions, channelNameFor, childRoutesOf, clampOutputToContext as clampMinimaxCodeOutputToContext, classifyFailure as classifyClaudeFailure, classifyKimiFailure, classifyMinimaxFailure, classifyUpstreamError, classifyFailure$1 as classifyWorkBuddyFailure, claudeCliVersion, claudeCodeCredentialPaths, claudeCodeCredentialPresence, codeForFailure as claudeCodeForFailure, credentialPath as claudeCredentialPath, defaultContextWindowFor as claudeDefaultContextWindow, maxOutputTokensFor as claudeMaxOutputTokens, claudeModelCanDisableThinking, modelSettingsPath as claudeModelSettingsPath, claudeModelSupportsImage, claudeModelSupportsTemperature, claudePoolPath, claudeReasoningEfforts, claudeThinkingMode, toLlmError as claudeToLlmError, clearCachedQuota, clearCachedCatalog as clearClaudeCatalog, clearCachedQuota$1 as clearClaudeQuota, clearCachedQuota$2 as clearCommandCodeQuota, clearCachedQuota$3 as clearKimiCodeQuota, clearCachedQuota$4 as clearMinimaxCodeQuota, clearCachedCatalog$1 as clearWorkBuddyCatalog, clearCachedQuota$5 as clearWorkBuddyQuota, clinePassAccountKey, clinePassAccountQuota, catalogEntry as clinePassCatalogEntry, chatCompletion as clinePassChatCompletion, chatURL as clinePassChatURL, credentialPath$1 as clinePassCredentialPath, defaultPin as clinePassDefaultPin, clinePassKnownModelIds, modelSettingsPath$1 as clinePassModelSettingsPath, clinePassPoolPath, clinePassVisibleModelIds, clinePassWindowDurationMins, clinePassWindowLabel, closeMinimaxStream, codexPoolPath, collapseScore, commandCodeAccountKey, credentialPath$2 as commandCodeCredentialPath, modelSettingsPath$2 as commandCodeModelSettingsPath, commandCodePoolPath, contextWindowForModel, convergeGlmEffort, createAntigravityImageTool, createClinePassLine, createClinePassStore, createCodexFetchProvider, createCodexImageTool, createCodexSearchProvider, createFileRelayProbeSink, createMinimaxCodeAccountsHandler, createMessage as createMinimaxCodeMessage, createPkcePair as createMinimaxCodePkcePair, createStreamState as createMinimaxCodeStreamState, createOpenDesignLine, createPlatformTokenStore, createSubagentAuthorization, credentialPath$3 as credentialPath, credentialsFromAdopt, credentialsFromCliLogin, defaultOpenDesignModelSettings, delegationDenialReason, delegationModeOf, describeCredentials as describeMinimaxCodeCredentials, detectSystemProxy, dshHomeDir, effectiveAllowParentFork, effectiveRouteOf, ensureAccessToken as ensureClaudeAccessToken, ensureAccessToken$1 as ensureKimiCodeAccessToken, ensureAccessToken$2 as ensureMinimaxCodeAccessToken, extractAvailableProviders, fetchAccountQuota, fetchAccountQuota$1 as fetchClaudeQuota, fetchGatewayCatalog as fetchClinePassGatewayCatalog, fetchOfficialModels as fetchClinePassOfficialModels, fetchUsageLimits as fetchClinePassUsageLimits, fetchAccountQuota$2 as fetchCommandCodeQuota, fetchGlmQuota, fetchAccountQuota$3 as fetchKimiCodeQuota, fetchUserInfo as fetchKimiCodeUserInfo, fetchTokenPlanQuota as fetchMinimaxCodeQuota, fetchGatewayCatalog$1 as fetchOpenDesignGatewayCatalog, fetchAccountQuota$4 as fetchWorkBuddyQuota, getCachedQuota as getCachedGlmCodingPlanQuota, getCachedQuota$1 as getCachedQuota, getLoginStatus as getClaudeLoginStatus, getCachedQuota$2 as getClaudeQuota, getClaudeWebStatus, getClinePassWebStatus, getWebLoginStatus as getCommandCodeLoginStatus, getCachedQuota$3 as getCommandCodeQuota, getCommandCodeWebStatus, getGlmCodingPlanStatus, getWebLoginStatus$1 as getKimiCodeLoginStatus, getCachedQuota$4 as getKimiCodeQuota, getKimiCodeWebStatus, getWebLogin as getMinimaxCodeLogin, getCachedQuota$5 as getMinimaxCodeQuota, getMinimaxCodeWebStatus, getOpenDesignWebStatus, getQoderStatus, getStepCodeStatus, getCachedQuota$6 as getWorkBuddyQuota, getWorkBuddyWebStatus, glmCatalogSize, authorizeUrl as glmCodingPlanAuthorizeUrl, catalogSize as glmCodingPlanCatalogCount, credentialPath$4 as glmCodingPlanCredentialPath, modelSettingsPath$3 as glmCodingPlanModelSettingsPath, modelsForRegion as glmCodingPlanModelsForRegion, glmCodingPlanPoolIdentity, glmCodingPlanPoolPath, glmCodingPlanPoolQuota, glmCodingPlanPoolStatus, glmCodingPlanSettingsSource, glmCooldownDecision, glmSubPathOf, inheritOverrideReason, inheritRouteDenialReason, inheritedRouteOf, inject, injectPrefs, installReasoningCollapseGuard, installRelayProbe, installSubagentModelAuthorization, isAdherenceOk, isAdoptedClaudeCredential, isAdoptedCredentialExpired, isAdoptedCredential as isAdoptedGlmCodingPlanCredential, isAdoptedZcodeCredential as isAdoptedGlmZcodeCredential, isAdoptedPoolCredential, isClaudeReasoningEffort, isClinePassPinMode, isGlmReasoningEffort, isMinimaxCodeReasoningEffort, isRefreshTokenRejected as isMinimaxCodeRefreshTokenRejected, isAuthenticationError as isOpenDesignAuthenticationError, isThinkingDisabledEffort, credentialPath$5 as kimiCodeCredentialPath, kimiCodeModelDef, modelSettingsPath$4 as kimiCodeModelSettingsPath, kimiCodePoolPath, listModelIds as listMinimaxCodeModelIds, loadCatalog as loadClaudeCatalog, loadProviderModels as loadCommandCodeModels, loadCatalog$1 as loadGlmCodingPlanCatalog, loadProviderModels$1 as loadKimiCodeModels, loadConfigCatalog as loadWorkBuddyModels, loginAndSave, mapCodexUsage, mapFinishReason, mapFinishReason$1 as mapOpenDesignFinishReason, mapUsage as mapOpenDesignUsage, mapUsage$1 as mapUsage, mergeGlmCodingPlanSettings, mergeUpstreams, accountFromCredentials as minimaxCodeAccountFromCredentials, accountHost as minimaxCodeAccountHost, agentBaseUrl as minimaxCodeAgentBaseUrl, authJsonPath as minimaxCodeAuthJsonPath, authStateJsonPath as minimaxCodeAuthStateJsonPath, catalogSize$1 as minimaxCodeCatalogSize, credentialIsFresh as minimaxCodeCredentialIsFresh, effortForModel as minimaxCodeEffortForModel, minimaxHomeDir as minimaxCodeHomeDir, maxMessageBodyBytes as minimaxCodeMaxMessageBodyBytes, maxOutputTokensFor$1 as minimaxCodeMaxOutputTokens, messagesUrl as minimaxCodeMessagesUrl, minimaxCodeModelDef, minimaxCodeModelIds, minimaxCodeModelName, modelRequestHeaders as minimaxCodeModelRequestHeaders, modelSettingsPath$5 as minimaxCodeModelSettingsPath, outputConfigFor as minimaxCodeOutputConfig, pluginCredentialPath as minimaxCodePluginCredentialPath, minimaxCodePoolIdentity, minimaxCodePoolPath, minimaxCodePoolStatus, quotaHostCandidates as minimaxCodeQuotaHostCandidates, quotaRequestHeaders as minimaxCodeQuotaRequestHeaders, subPathOf as minimaxCodeSubPathOf, tokenPlanRemainsUrl as minimaxCodeTokenPlanRemainsUrl, modelSettingsPath$6 as modelSettingsPath, normalizeDelegationToolNames, normalizeRegion as normalizeGlmCodingPlanRegion, normalizeInheritToolNames, normalizePinMode, normalizeRotationStrategy, normalizeSort, openChatStream as openClinePassChatStream, bearerFor as openDesignBearerFor, catalogEntry$1 as openDesignCatalogEntry, chatURL$1 as openDesignChatURL, credentialPath$6 as openDesignCredentialPath, credentialsIdentity as openDesignCredentialsIdentity, firstMessage as openDesignFirstMessage, openDesignKnownModelIds, modelSettingsPath$7 as openDesignModelSettingsPath, modelsURL as openDesignModelsURL, reasoningOf as openDesignReasoningOf, streamErrorCode as openDesignStreamErrorCode, openDesignVisibleModelIds, openChatStream$1 as openOpenDesignChatStream, opendesignAccountKey, opendesignPoolPath, parseAllowedRoutes, parseClaudeCredentialDocument, parseClaudeCredentials, parseClaudePoolData, parseUsagePayload as parseClaudeUsagePayload, parseClinePassCredentials, parseClinePassModelSettings, parseClinePassPoolData, parseCodexPoolData, parseCodexUsage, parseCommandCodePoolData, parseGlmCodingPlanCredentials, parseGlmCodingPlanPoolData, parseKimiCodePoolData, parseMinimaxCodeCredentials, parseMinimaxCodePoolData, parseTokenPlanQuota as parseMinimaxCodeQuota, parseAnthropicUsage as parseMinimaxCodeUsage, parseOpenDesignCredentials, parseOpenDesignModelSettings, parseOpenDesignPoolData, parseServerSentEvents as parseOpenDesignServerSentEvents, parseQoderCredentials, parseResponsesStream, parseRouting, parseServerSentEvents$1 as parseServerSentEvents, parseTier0, parseBilling as parseWorkBuddyBilling, parseConfigModels as parseWorkBuddyConfigModels, parseCredentialFile as parseWorkBuddyCredential, pinAdherence, pinWarnings, policyRoutesOf, pollWebLogin as pollMinimaxCodeLogin, probeConnection as probeClaudeConnection, processMinimaxStreamLine, qoderCatalogSize, credentialPath$7 as qoderCredentialPath, qoderCredentialsExpireAt, qoderCredentialsNeedRefresh, modelSettingsPath$8 as qoderModelSettingsPath, qoderPoolIdentity, qoderPoolPath, qoderPoolQuota, qoderPoolStatus, qoderPoolStatusSlice, qoderRefreshFailureStatus, qoderSettingsSource, qoderSubPathOf, readChildDescriptor, readClaudeCodeCredentials, readGlmResetAt, readQoderCacheStats, readStepCodeCacheStats, reasoningOf$1 as reasoningOf, redactToken as redactMinimaxCodeToken, refreshAntigravityToken, refreshAccessToken as refreshClaudeToken, refreshAccessToken$1 as refreshKimiCodeToken, refreshAccessToken$2 as refreshMinimaxCodeToken, refreshCredentials as refreshWorkBuddyCredentials, registerClaudePreferenceStore, registerClaudeRoutes, registerClinePassRoutes, registerCommandCodePreferenceStore, registerCommandCodeRoutes, registerGlmCodingPlanPreferenceStore, registerGlmCodingPlanRoutes, registerKimiCodePreferenceStore, registerKimiCodeRoutes, registerMinimaxCodePreferenceStore, registerMinimaxCodeRoutes, registerOpenDesignRoutes, registerQoderPreferenceStore, registerQoderRoutes, registerStepCodePreferenceStore, registerStepCodeRoutes, registerWorkBuddyPreferenceStore, registerWorkBuddyRoutes, relayProbeEnabled, relayProbeEnvFile, relayProbeEnvValue, relayProbeLogPath, rememberQoderCacheUsage, rememberStepCodeCacheUsage, requestDeviceAuthorization as requestKimiCodeDeviceAuthorization, requestDeviceAuthorization$1 as requestMinimaxCodeDeviceAuthorization, resetWebLogins as resetMinimaxCodeLogins, resolveEnabledModelIds as resolveClaudeEnabledModelIds, resolveLoginInput as resolveClaudeLoginInput, resolveClaudeModel, resolveGlmModel, resolveGuardOptions, resolveRegion as resolveKimiCodeRegion, resolveMinimaxCodeEnabledModelIds, resolveMinimaxCodeModelId, resolveQuotaCounts as resolveMinimaxCodeQuotaCounts, resolveModelInfo as resolveOpenDesignModelInfo, resolveOutputBudget as resolveOpenDesignOutputBudget, resolveWorkBuddyModel, revokeToken as revokeMinimaxCodeToken, saveApiKey as saveCommandCodeApiKey, scanCredentials as scanWorkBuddyCredentials, sendJSON as sendClinePassJSON, sendJSON$1 as sendOpenDesignJSON, serializeMessages, serializeMessages$1 as serializeOpenDesignMessages, setClaudeCliVersion, beginWebLogin$3 as startCommandCodeLogin, stepCodeCatalogSize, credentialPath$8 as stepCodeCredentialPath, stepCodeModelCatalogFrom, modelSettingsPath$9 as stepCodeModelSettingsPath, stepCodePoolIdentity, stepCodePoolPath, stepCodePoolQuota, stepCodePoolStatus, stepCodePoolStatusSlice, quotaCredentialPath as stepCodeQuotaCredentialPath, stepCodeSettingsSource, stepCodeSubPathOf, streamErrorCode$1 as streamErrorCode, subagentModelSelectionPreference, submitLoginInput as submitClaudeLoginInput, summarizeFailureBody as summarizeMinimaxCodeFailureBody, testConnection as testMinimaxCodeConnection, testApiKey as testOpenDesignApiKey, translate, translate$1 as translateOpenDesignStream, trimBase as trimClinePassBase, trimBase$1 as trimOpenDesignBase, unauthorizedRouteReason, validateAuthorizationScope, validateDelegationToolNames, validateInheritToolNames, verifyCodingPlanKey as verifyGlmCodingPlanKey, violationText, warmQoderCatalogOnStartup, withTimeout as withOpenDesignTimeout, modelSettingsPath$10 as workBuddyModelSettingsPath, modelsForRegion$1 as workBuddyModelsForRegion, zcodeCredentialsPath };