odai-dsh-agent 0.0.8 → 0.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -13,7 +13,7 @@ $DSH_HOME/.agent-presets/odai/
13
13
  .odai-agent.json
14
14
  ```
15
15
 
16
- The composition preserves every capability row and setting from the `standard` agent surface in `@deepseek-ai/dsh@0.1.0-rc.6`, then adds the scoped Odai runtime in default `auto` mode. Release verification compares the complete derived composition against that exact DSH Standard source; a missing, added, reordered, or changed Standard row fails the probe. Host-owned persistence, sandbox, approval, registries, and base controller selection remain in the selected DSH profile. Ordinary requests stay on that controller. A complete contextual high-impact decision gap upgrades the same turn only when a planner mapping exists; the controller's durable `request/header` proves the actual route. Explicit independent planning/review requests still start a verified child when their mappings exist. `execute` remains an explicit all-delegation comparison mode. `observe` changes no model and starts no child; it injects a local evidence-and-decision protocol and makes an unresolved high-impact turn read-only. For DSH compaction on the same provider/model, an omitted summarizer reasoning setting inherits the session's current user-selected reasoning effort so the auxiliary call remains cache-compatible. A user-selected cross-model target removes an effort matching that durable route; a distinct preselected effort is preserved because the request envelope exposes no stronger provenance.
16
+ The composition preserves every capability row and setting from the `standard` agent surface in `@deepseek-ai/dsh@0.1.0-rc.6`, then adds the scoped Odai runtime in default `auto` mode. Release verification compares the complete derived composition against that exact DSH Standard source; a missing, added, reordered, or changed Standard row fails the probe. Host-owned persistence, sandbox, approval, registries, and base controller selection remain in the selected DSH profile. Ordinary requests stay on that controller. A complete contextual high-impact decision gap upgrades the same turn only when a planner mapping exists; the controller's durable `request/header` proves the actual route. Explicit independent planning/review requests still start a verified child when their mappings exist. `execute` remains an explicit all-delegation comparison mode. `observe` changes no model and starts no child; it injects a local evidence-and-decision protocol and makes an unresolved high-impact turn read-only. For DSH compaction, an explicit user-selected summary reasoning effort overrides only that auxiliary call. When omitted, same-provider/model compaction inherits the session's current reasoning effort for cache compatibility; a cross-model target removes an effort matching that durable route, while a distinct preselected effort is preserved because the request envelope exposes no stronger provenance.
17
17
 
18
18
  ## Install
19
19
 
@@ -71,9 +71,9 @@ A same-provider/model compaction inherits controller reasoning while keeping its
71
71
 
72
72
  ## Compaction model
73
73
 
74
- The default compaction-summary model is `inherit`, which preserves the conversation's current provider/model behavior. A user can explicitly set a separate target in natural language, such as `压缩模型用 provider-x/model-summary`; `odai_compaction_config` persists that provider/model pair in `$DSH_HOME/odai/compaction.json`. Removing it restores inheritance. Agent and Plugin share the store when both are deliberately present.
74
+ The default compaction-summary model is `inherit`, which preserves the conversation's current provider/model behavior. A user can explicitly set a separate target and optional reasoning effort in natural language, such as `压缩模型用 provider-x/model-summary,推理档 high`; `odai_compaction_config` persists those explicit values in `$DSH_HOME/odai/compaction.json`. Removing the target restores inheritance. Agent and Plugin share the store when both are deliberately present.
75
75
 
76
- The target applies only to future `compaction` summary requests. It does not change the controller, planner, executor, reviewer, ordinary conversation, summary output budget, or cache-retention policy, never selects a new reasoning effort, and a cross-model target removes only reasoning proven by equality with the durable controller route while preserving a distinct preselected effort. Each configured target receives one provider-neutral integrity suffix that keeps current facts above superseded/rejected history, preserves continuation-critical opaque values exactly, and self-checks contradictions; duplicate Agent/Plugin runtime instances add it only once. Odai never chooses the target on the user's behalf. An invalid store is reported by the tool while runtime requests inherit safely until `set` or `remove` repairs it. An unavailable route, provider error, or incomplete summary fails closed: DSH retains the original history rather than replacing it with a partial checkpoint.
76
+ The target applies only to future `compaction` summary requests. It does not change the controller, planner, executor, reviewer, ordinary conversation, summary output budget, or cache-retention policy. An explicitly configured `reasoningEffort` overrides reasoning only for those summaries. When omitted, existing behavior remains: same-route summaries can inherit controller reasoning, while a cross-model target removes only reasoning proven by equality with the durable controller route and preserves a distinct preselected effort. Each configured target receives one provider-neutral integrity suffix that keeps current facts above superseded/rejected history, preserves continuation-critical opaque values exactly, and self-checks contradictions; duplicate Agent/Plugin runtime instances add it only once. Odai never chooses the provider, model, or reasoning effort on the user's behalf. An invalid store is reported by the tool while runtime requests inherit safely until `set` or `remove` repairs it. An unavailable route, provider error, or incomplete summary fails closed: DSH retains the original history rather than replacing it with a partial checkpoint.
77
77
 
78
78
  ## Skill sources
79
79
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "odai-dsh-agent",
3
- "version": "0.0.8",
3
+ "version": "0.0.9",
4
4
  "description": "完整继承 DSH 标准模式 全部能力的 Odai Agent preset。主要用于治理、规划、测试、验证 等,可当成默认总控使用。",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -12,7 +12,7 @@ import { dirname, resolve } from "node:path";
12
12
  import { acquireOwnedStoreLock } from "./store-lock.mjs";
13
13
 
14
14
  const STORE_SCHEMA_VERSION = 1;
15
- const TARGET_FIELDS = new Set(["provider", "model"]);
15
+ const TARGET_FIELDS = new Set(["provider", "model", "reasoningEffort"]);
16
16
  const STATE_PROTOCOL_SOURCE = Object.freeze({
17
17
  kind: "plugin",
18
18
  plugin: "odai-dsh-runtime",
@@ -29,9 +29,9 @@ export const COMPACTION_STATE_PROTOCOL = [
29
29
 
30
30
  export const COMPACTION_CONFIG_PROMPT = [
31
31
  "## Odai compaction model configuration",
32
- "When the user naturally asks to inspect, set, change, or reset the model used to summarize compacted context, use odai_compaction_config.",
33
- "Set a compaction model only when the user explicitly supplies both provider and model. Never infer or silently choose either value. Ask a concise clarification when one is missing or ambiguous.",
34
- "The default is inherit: compaction uses the current conversation route. A configured target changes only compaction-summary requests; it does not change the controller, planner, executor, reviewer, normal conversation, summary output budget, or cache-retention policy.",
32
+ "When the user naturally asks to inspect, set, change, or reset the model or reasoning effort used to summarize compacted context, use odai_compaction_config.",
33
+ "Set a compaction target only when the user explicitly supplies both provider and model. Pass reasoningEffort only when the user explicitly supplies it. Never infer or silently choose any value. If the user changes only the effort for an existing persisted target, inspect and preserve that exact provider/model pair.",
34
+ "The default is inherit: compaction uses the current conversation route. A configured target changes only compaction-summary requests; it does not change the controller, planner, executor, reviewer, normal conversation, summary output budget, or cache-retention policy. An optional explicit reasoning effort is likewise scoped only to compaction summaries; omitting it preserves the existing reasoning inheritance and cross-model isolation behavior.",
35
35
  "Configured targets also receive a provider-neutral checkpoint integrity protocol that keeps current facts above superseded or rejected history and preserves continuation-critical opaque values exactly.",
36
36
  "Do not ask the user to edit YAML, JSON, managed Agent files, or Plugin configuration. The tool owns persistence. Set/remove changes apply to the next compaction request.",
37
37
  "An invalid persisted store is visible through the tool while runtime requests safely inherit the conversation route. If the configured route fails or produces an incomplete summary, DSH must preserve the original history rather than landing a partial checkpoint.",
@@ -56,7 +56,15 @@ export function resolveCompactionTarget(value, field = "Odai compaction model ta
56
56
  if (typeof target.model !== "string" || target.model.trim() === "") {
57
57
  throw new TypeError(`${field}.model must be a non-empty string`);
58
58
  }
59
- return Object.freeze({ provider: target.provider.trim(), model: target.model.trim() });
59
+ if (target.reasoningEffort !== undefined
60
+ && (typeof target.reasoningEffort !== "string" || target.reasoningEffort.trim() === "")) {
61
+ throw new TypeError(`${field}.reasoningEffort must be a non-empty string`);
62
+ }
63
+ return Object.freeze({
64
+ provider: target.provider.trim(),
65
+ model: target.model.trim(),
66
+ ...(target.reasoningEffort === undefined ? {} : { reasoningEffort: target.reasoningEffort.trim() }),
67
+ });
60
68
  }
61
69
 
62
70
  export function resolveCompactionConfigPath(configuredPath, env = process.env) {
@@ -133,12 +141,15 @@ export function applyCompactionTarget(options, target, sessions) {
133
141
  && currentRoute.reasoningEffort.length > 0
134
142
  && options.reasoningEffort === currentRoute.reasoningEffort;
135
143
  const changesRoute = options.provider !== target.provider || options.model !== target.model;
136
- if (!changesRoute && !inheritedReasoning) return false;
144
+ const changesReasoning = target.reasoningEffort !== undefined
145
+ && options.reasoningEffort !== target.reasoningEffort;
146
+ if (!changesRoute && !inheritedReasoning && !changesReasoning) return false;
137
147
  if (!Object.isExtensible(options)) {
138
148
  throw new Error("configured Odai compaction model cannot be applied to an immutable request");
139
149
  }
140
150
 
141
- if (inheritedReasoning) delete options.reasoningEffort;
151
+ if (target.reasoningEffort !== undefined) options.reasoningEffort = target.reasoningEffort;
152
+ else if (inheritedReasoning) delete options.reasoningEffort;
142
153
  if (changesRoute) {
143
154
  options.provider = target.provider;
144
155
  options.model = target.model;
@@ -214,9 +225,9 @@ export function createCompactionConfigTool(configPath, options = {}) {
214
225
  return {
215
226
  name: "odai_compaction_config",
216
227
  description: [
217
- "Inspect, set, or remove the shared Odai compaction-summary model target.",
218
- "Use only when the user naturally asks about the compaction model or explicitly supplies the provider and model to set. Never select either value on the user's behalf.",
219
- "The default is inherit. A persisted target changes only future compaction-summary requests; controller and responsibility routes, output budget, and cache retention stay unchanged.",
228
+ "Inspect, set, or remove the shared Odai compaction-summary target.",
229
+ "Use only when the user naturally asks about the compaction model/reasoning effort or explicitly supplies the provider and model to set. Never select a provider, model, or reasoning effort on the user's behalf.",
230
+ "The default is inherit. A persisted target changes only future compaction-summary requests; controller and responsibility routes, output budget, and cache retention stay unchanged. An optional user-specified reasoning effort applies only to those summaries.",
220
231
  "Persisted targets also receive a provider-neutral integrity protocol that keeps current facts above superseded history and preserves continuation-critical opaque values exactly.",
221
232
  "An invalid store is reported while runtime requests safely inherit. If the configured route or summary fails, DSH preserves the original history. Changes apply from the next compaction request.",
222
233
  ].join(" "),
@@ -228,7 +239,7 @@ export function createCompactionConfigTool(configPath, options = {}) {
228
239
  action: {
229
240
  type: "string",
230
241
  enum: ["show", "set", "remove"],
231
- description: "Show the effective target, set a user-specified provider/model, or remove it to restore inheritance.",
242
+ description: "Show the effective target, set a user-specified provider/model and optional reasoning effort, or remove it to restore inheritance.",
232
243
  },
233
244
  provider: {
234
245
  type: "string",
@@ -238,6 +249,10 @@ export function createCompactionConfigTool(configPath, options = {}) {
238
249
  type: "string",
239
250
  description: "Model id explicitly supplied by the user; required for set.",
240
251
  },
252
+ reasoningEffort: {
253
+ type: "string",
254
+ description: "Optional compaction reasoning effort explicitly supplied by the user.",
255
+ },
241
256
  },
242
257
  },
243
258
  output: {
@@ -256,6 +271,7 @@ export function createCompactionConfigTool(configPath, options = {}) {
256
271
  properties: {
257
272
  provider: { type: "string" },
258
273
  model: { type: "string" },
274
+ reasoningEffort: { type: "string" },
259
275
  },
260
276
  },
261
277
  requiresNextCompaction: { type: "boolean" },
@@ -265,12 +281,12 @@ export function createCompactionConfigTool(configPath, options = {}) {
265
281
  },
266
282
  render(_args, value) {
267
283
  const target = value.target
268
- ? `${value.target.provider}/${value.target.model}`
269
- : "inherit the current conversation model";
284
+ ? `${value.target.provider}/${value.target.model} (reasoning: ${value.target.reasoningEffort ?? "not configured"})`
285
+ : "inherit the current conversation model and reasoning";
270
286
  return [{
271
287
  type: "text",
272
288
  text: [
273
- `${value.action === "show" ? "Current" : "Updated"} Odai compaction model (${value.source}): ${target}.`,
289
+ `${value.action === "show" ? "Current" : "Updated"} Odai compaction target (${value.source}): ${target}.`,
274
290
  " This affects compaction summaries only; other model routes, the summary budget, and cache retention are unchanged.",
275
291
  ...(value.invalidStore ? [" The persisted store is invalid, so runtime requests currently inherit; set or remove the target to repair it."] : []),
276
292
  ...(value.recoveredInvalidStore ? [" An invalid prior store was preserved before the configuration was repaired or reset."] : []),
@@ -283,12 +299,12 @@ export function createCompactionConfigTool(configPath, options = {}) {
283
299
  if (!execution.agent) throw new Error("odai_compaction_config requires an owning agent session");
284
300
  if (isChild(execution.agent)) throw new Error("child agents may not change Odai compaction model configuration");
285
301
  if (!args || typeof args !== "object" || Array.isArray(args)) throw new TypeError("arguments must be an object");
286
- const unknown = Object.keys(args).filter((field) => !["action", "provider", "model"].includes(field));
302
+ const unknown = Object.keys(args).filter((field) => !["action", "provider", "model", "reasoningEffort"].includes(field));
287
303
  if (unknown.length > 0) throw new TypeError(`unknown arguments: ${unknown.join(", ")}`);
288
304
  if (!["show", "set", "remove"].includes(args.action)) throw new TypeError("action must be show, set, or remove");
289
305
  if (args.action === "show") {
290
- if (args.provider !== undefined || args.model !== undefined) {
291
- throw new TypeError("provider and model must be omitted for show");
306
+ if (args.provider !== undefined || args.model !== undefined || args.reasoningEffort !== undefined) {
307
+ throw new TypeError("provider, model, and reasoningEffort must be omitted for show");
292
308
  }
293
309
  let selection;
294
310
  try {
@@ -299,11 +315,16 @@ export function createCompactionConfigTool(configPath, options = {}) {
299
315
  }
300
316
  return Promise.resolve(resultFor(configPath, "show", selection));
301
317
  }
302
- if (args.action === "remove" && (args.provider !== undefined || args.model !== undefined)) {
303
- throw new TypeError("provider and model must be omitted for remove");
318
+ if (args.action === "remove"
319
+ && (args.provider !== undefined || args.model !== undefined || args.reasoningEffort !== undefined)) {
320
+ throw new TypeError("provider, model, and reasoningEffort must be omitted for remove");
304
321
  }
305
322
  const proposed = args.action === "set"
306
- ? resolveCompactionTarget({ provider: args.provider, model: args.model })
323
+ ? resolveCompactionTarget({
324
+ provider: args.provider,
325
+ model: args.model,
326
+ ...(args.reasoningEffort === undefined ? {} : { reasoningEffort: args.reasoningEffort }),
327
+ })
307
328
  : undefined;
308
329
 
309
330
  const releaseLock = acquireOwnedStoreLock(configPath, "Odai compaction model configuration");