@dudko.dev/agent-web 0.0.46 → 0.0.47

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/dist/index.d.cts CHANGED
@@ -2662,14 +2662,6 @@ declare const decisionEgressPolicy: (spec: IDecisionModelSpec) => IEgressPolicy;
2662
2662
  */
2663
2663
  declare const resolveDecisionModel: (input: IDecisionModel | IDecisionModelSpec | undefined, credentials?: CredentialStore) => Promise<IDecisionModel | undefined>;
2664
2664
 
2665
- /**
2666
- * `config.askUser`: the `ask_user` tool, with which the MODEL asks the person one closed question
2667
- * with 2-6 options (the rules and the bounds are `ask-user-shared.ts`, the same file as the Node
2668
- * package's). This file is the browser's wiring: the tool reads its run through `agentRun`
2669
- * (`ToolRunContext.askUser`), a helper the model started asks through its caller's channel
2670
- * (`SpawnSeed.askUser`), and a subagent the HOST defined (`createSubagentTool`, in-process) asks
2671
- * through the run that called it (`routeAskUser`).
2672
- */
2673
2665
  /** What `onQuestion` is given: the model's question and options, cleaned (see the shared file). */
2674
2666
  type AskUserRequest = AskUserRequest$1<IPlanStep>;
2675
2667
  /**
package/dist/index.d.ts CHANGED
@@ -2662,14 +2662,6 @@ declare const decisionEgressPolicy: (spec: IDecisionModelSpec) => IEgressPolicy;
2662
2662
  */
2663
2663
  declare const resolveDecisionModel: (input: IDecisionModel | IDecisionModelSpec | undefined, credentials?: CredentialStore) => Promise<IDecisionModel | undefined>;
2664
2664
 
2665
- /**
2666
- * `config.askUser`: the `ask_user` tool, with which the MODEL asks the person one closed question
2667
- * with 2-6 options (the rules and the bounds are `ask-user-shared.ts`, the same file as the Node
2668
- * package's). This file is the browser's wiring: the tool reads its run through `agentRun`
2669
- * (`ToolRunContext.askUser`), a helper the model started asks through its caller's channel
2670
- * (`SpawnSeed.askUser`), and a subagent the HOST defined (`createSubagentTool`, in-process) asks
2671
- * through the run that called it (`routeAskUser`).
2672
- */
2673
2665
  /** What `onQuestion` is given: the model's question and options, cleaned (see the shared file). */
2674
2666
  type AskUserRequest = AskUserRequest$1<IPlanStep>;
2675
2667
  /**
package/dist/index.js CHANGED
@@ -4017,6 +4017,7 @@ var askTheUser = async (deps, call, raw) => {
4017
4017
  };
4018
4018
 
4019
4019
  // src/tools/ask-user.ts
4020
+ var toolResultForLog = (name, output) => name === ASK_USER_TOOL ? "[the answer to the question is not logged]" : output;
4020
4021
  var routes = /* @__PURE__ */ new WeakMap();
4021
4022
  var routeAskUser = (config, channel, subagent) => {
4022
4023
  routes.set(config, { ...channel, subagent });
@@ -5024,7 +5025,10 @@ ${renderEarlierAttempts(attempt.earlier)}` : parts.prompt;
5024
5025
  if (attempt.calls) inFlight.push({ name, input });
5025
5026
  },
5026
5027
  onToolResult: (name, output, ok) => {
5027
- ctx.log.debug(`tool result: ${name} ${ok ? "ok" : "FAILED"}`, output);
5028
+ ctx.log.debug(
5029
+ `tool result: ${name} ${ok ? "ok" : "FAILED"}`,
5030
+ toolResultForLog(name, output)
5031
+ );
5028
5032
  ctx.emit({ type: "step.tool-result", step, name, output, ok });
5029
5033
  if (attempt.calls) {
5030
5034
  const at = inFlight.findIndex((c) => c.name === name);
@@ -7527,7 +7531,13 @@ ${renderActiveSkills(active)}`
7527
7531
  log.warn(`step ${stepNo} made no tool calls \u2014 nothing changed in this step`);
7528
7532
  }
7529
7533
  stepResult.toolCalls.filter((c) => !c.ok).forEach((c) => log.warn(`tool ${c.name} failed:`, c.output));
7530
- log.debug(`step ${stepNo} detail:`, stepResult);
7534
+ log.debug(`step ${stepNo} detail:`, {
7535
+ ...stepResult,
7536
+ toolCalls: stepResult.toolCalls.map((c) => ({
7537
+ ...c,
7538
+ output: toolResultForLog(c.name, c.output)
7539
+ }))
7540
+ });
7531
7541
  emit({ type: "step.complete", step, result: stepResult });
7532
7542
  const counts = stepResult.toolCalls.length ? ` [${applied} tool call(s) ok${failed ? `, ${failed} failed` : ""}]` : "";
7533
7543
  done.push(