@logictan/dsh-browser-agent 0.1.0 → 0.1.1

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 (2) hide show
  1. package/lib/config.js +8 -2
  2. package/package.json +1 -1
package/lib/config.js CHANGED
@@ -55,11 +55,16 @@ export const Config = z.object({
55
55
  * three-step fallback (configured pair, then the session's routed request, then
56
56
  * its options) that `ctx-mem` uses for its fill call.
57
57
  *
58
+ * The second argument is the tool EXECUTION CONTEXT, not the agent: that is
59
+ * what the tool body has in hand. The two are not interchangeable — reading
60
+ * agent fields off the context short-circuits every optional chain and silently
61
+ * reports "unconfigured" on a session that has a perfectly good route.
62
+ *
58
63
  * @param config - the resolved settings section.
59
- * @param agent - the calling agent, when the tool was invoked from a turn.
64
+ * @param exec - the tool execution context; its `agent` is the caller.
60
65
  * @returns the route to call; empty provider/model means "unconfigured".
61
66
  */
62
- export function resolveTextRoute(config, agent) {
67
+ export function resolveTextRoute(config, exec) {
63
68
  if (config.textProvider !== '' && config.textModel !== '') {
64
69
  return {
65
70
  provider: config.textProvider,
@@ -68,6 +73,7 @@ export function resolveTextRoute(config, agent) {
68
73
  };
69
74
  }
70
75
 
76
+ const agent = exec?.agent;
71
77
  const routed = agent?.session?.requestHeader?.()?.config;
72
78
  if (routed?.provider && routed?.model) {
73
79
  return { provider: routed.provider, model: routed.model, reasoningEffort: '' };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@logictan/dsh-browser-agent",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "DSH browser agent: a dynamic operation+target decision loop. TypeSafe picks the action, this plugin executes it over CDP against the user's own Chrome. DSH 浏览器 Agent 子插件。",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",