@oh-my-pi/pi-agent-core 19.2.0 → 19.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/types.ts CHANGED
@@ -25,6 +25,7 @@ import type { Dialect } from "@oh-my-pi/pi-ai/dialect";
25
25
  import type { HarmonyAuditEvent } from "@oh-my-pi/pi-ai/utils/harmony-leak";
26
26
  import type { AppendOnlyContextManager } from "./append-only-context";
27
27
  import type { AgentRunCoverage, AgentRunSummary } from "./run-collector";
28
+ import type { InheritedToolDescriptions } from "./inherited-tool-descriptions";
28
29
  import type { SentToolDefinitions } from "./sent-tool-definitions";
29
30
  import type { AgentTelemetryConfig } from "./telemetry";
30
31
 
@@ -101,6 +102,8 @@ export interface AgentTurnEndContext {
101
102
  additionalMessages?: AgentMessage[];
102
103
  /** True when the current tool-loop batch is continuing without yielding to post-turn steering. */
103
104
  willContinue: boolean;
105
+ /** Tool calls in `message` that resolved to no tool (unknown name), so nothing ran. */
106
+ unresolvedToolCallIds?: string[];
104
107
  }
105
108
 
106
109
  export interface AgentPreModelCallStop {
@@ -288,6 +291,9 @@ export interface AgentLoopConfig extends SimpleStreamOptions {
288
291
  /** Remembers sent tool definitions to fill {@link Context.inactiveTools}. */
289
292
  sentToolDefinitions?: SentToolDefinitions;
290
293
 
294
+ /** A fork's owner-worded tool descriptions; see {@link InheritedToolDescriptions}. */
295
+ inheritedToolDescriptions?: InheritedToolDescriptions;
296
+
291
297
  /**
292
298
  * Resolves the API key or resolver for the current model before each LLM call.
293
299
  *
@@ -1124,7 +1130,7 @@ export type ToolLoadMode = "essential" | "discoverable";
1124
1130
  * - object form — adds a `reason` (shown in the prompt) and/or `override: true`
1125
1131
  * (force-prompt even in modes that would otherwise auto-approve this tier).
1126
1132
  * `policy: "deny"` blocks the call at the approval gate.
1127
- * - function — dynamic, given parsed args. Returns either form above.
1133
+ * - function — dynamic, given parsed args and an optional {@link ToolApprovalQuery}. Returns either form above.
1128
1134
  *
1129
1135
  * Omitted approvals are treated as "exec" by callers that enforce approvals.
1130
1136
  */
@@ -1136,7 +1142,19 @@ export type ToolApprovalDecision =
1136
1142
  override?: boolean;
1137
1143
  policy?: "allow" | "deny" | "prompt";
1138
1144
  };
1139
- export type ToolApproval = ToolApprovalDecision | ((args: unknown, context?: AgentToolContext) => ToolApprovalDecision);
1145
+ export type ToolApproval =
1146
+ | ToolApprovalDecision
1147
+ | ((args: unknown, context?: AgentToolContext, query?: ToolApprovalQuery) => ToolApprovalDecision);
1148
+
1149
+ /** How the caller of a dynamic {@link ToolApproval} uses its decision. */
1150
+ export interface ToolApprovalQuery {
1151
+ /**
1152
+ * `false` when only `tier` and an explicit `policy` can affect the outcome: the gate
1153
+ * auto-approves every tier (yolo), or the caller reads just the tier. The tool may then
1154
+ * skip work that only feeds a prompt (`override`, `reason`). Absent means it may prompt.
1155
+ */
1156
+ prompts?: boolean;
1157
+ }
1140
1158
 
1141
1159
  /**
1142
1160
  * Context passed to tool execution.