@dudousxd/nestjs-agent-core 0.40.0 → 0.42.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 (36) hide show
  1. package/README.md +7 -0
  2. package/dist/ag-ui/index.cjs +46 -10
  3. package/dist/ag-ui/index.cjs.map +1 -1
  4. package/dist/ag-ui/index.d.cts +9 -3
  5. package/dist/ag-ui/index.d.ts +9 -3
  6. package/dist/ag-ui/index.js +46 -10
  7. package/dist/ag-ui/index.js.map +1 -1
  8. package/dist/{catalog-CrzetM3_.d.cts → catalog-BKS3Yxo6.d.cts} +2 -0
  9. package/dist/{catalog-CrzetM3_.d.ts → catalog-BKS3Yxo6.d.ts} +2 -0
  10. package/dist/genui/builtins.cjs.map +1 -1
  11. package/dist/genui/builtins.d.cts +1 -1
  12. package/dist/genui/builtins.d.ts +1 -1
  13. package/dist/genui/builtins.js.map +1 -1
  14. package/dist/genui/index.cjs +660 -68
  15. package/dist/genui/index.cjs.map +1 -1
  16. package/dist/genui/index.d.cts +5 -5
  17. package/dist/genui/index.d.ts +5 -5
  18. package/dist/genui/index.js +654 -68
  19. package/dist/genui/index.js.map +1 -1
  20. package/dist/guardrails/index.cjs +3 -1
  21. package/dist/guardrails/index.cjs.map +1 -1
  22. package/dist/guardrails/index.d.cts +5 -4
  23. package/dist/guardrails/index.d.ts +5 -4
  24. package/dist/guardrails/index.js +3 -1
  25. package/dist/guardrails/index.js.map +1 -1
  26. package/dist/index.cjs +1164 -421
  27. package/dist/index.cjs.map +1 -1
  28. package/dist/index.d.cts +124 -13
  29. package/dist/index.d.ts +124 -13
  30. package/dist/index.js +1156 -421
  31. package/dist/index.js.map +1 -1
  32. package/dist/{processors-BR3nICcp.d.ts → processors-BKILjME5.d.ts} +1 -1
  33. package/dist/{processors-B7nfbU6E.d.cts → processors-DpHBqRuE.d.cts} +1 -1
  34. package/dist/{stream-events-M0jc7lSW.d.cts → stream-events-C-pj3bVY.d.cts} +92 -4
  35. package/dist/{stream-events-DAmes2Of.d.ts → stream-events-D92SgfRk.d.ts} +92 -4
  36. package/package.json +1 -1
package/dist/index.d.cts CHANGED
@@ -1,9 +1,9 @@
1
- import { M as ModelMessage, d as ToolDefinition, e as ToolCallRequest, f as MessageUsage, g as AgentUiComponent, a as Actor, h as AiToolCtx, A as AgentStreamEvent, T as ToolSpec, Q as QuotaState, i as AgentRunInput, H as HumanReply, j as MessageAttachment, k as ActionProposalMutationResult, b as ToolHandler, l as AgentDefinition, m as Persona, o as PersonaCatalogEntry, q as HistoryPolicy, r as PageContext, s as AgentStore, t as AgentDelegation, D as DetachedDelivery, u as ToolDescribeScope, w as ToolPreflightResult, x as ApprovalPolicy, y as PromptBuilder, z as PromptContributor, B as ToolTransientRetrySetting, C as AgentIntake, E as Decision, F as ElicitationRequest, L as LlmStepEnvelope, G as ToolStepEnvelope, I as ClaimActionProposal, J as ActionProposal, K as ActionProposalStore, N as ActionProposalStoreOptions, O as CreateActionProposal, R as CreateActionProposalResult, S as ActionProposalScope, V as ListActionProposals, W as ActionProposalDecisionCommand, X as ExtendActionProposalLease, Y as SettleActionProposal, Z as ActionProposalOutcome, _ as ActionProposalOutcomeLease, $ as ToolCallStatus, a0 as ChatQueueStore, a1 as ActionProposalOutcomeStore, a2 as CreateThreadInput, a3 as ThreadSummary, a4 as ThreadDetail, a5 as ToolCallApprovalState, a6 as UpdateThreadInput, a7 as RecordRunStartInput, a8 as EnqueueMessageInput, a9 as QueuedMessage, aa as QueuedMessagePatch, ab as QueuePause, ac as AppendMessageInput, ad as StoredMessage, ae as ToolResult, af as MessageFeedback, ag as RecordToolCallInput, ah as ToolCallOutcome, ai as UpdateToolCallInput, aj as RecordUsageInput, ak as ToolConfirmation, al as ActionProposalDecision, am as ActionProposalSupersessionStore } from './stream-events-M0jc7lSW.cjs';
2
- export { an as ALL_AGENTS, ao as ASK_TOOL_DESCRIPTION, ap as ASK_TOOL_NAME, aq as ActionProposalDecisionAudit, ar as ActionProposalExecution, as as ActionProposalExecutionContext, at as ActionProposalLease, au as ActionProposalOutcomeDelivery, av as AgentApprovalRequest, aw as AgentApprovalSettlement, ax as AgentAttachmentConfig, ay as AgentCatalogEntry, az as AgentClientConfig, aA as AgentHistoryWindow, aB as AgentStreamErrorCode, aC as ApprovalDecisionRef, aD as ApprovalRequirement, aE as ApprovalThreadRef, aF as ApprovalToolRef, aG as AskToolInput, aH as ChatQueueState, aI as ClaimedActionApproval, aJ as DEFAULT_INTAKE_PREAMBLE, aK as DEFAULT_TOOL_TRANSIENT_RETRY_ATTEMPTS, aL as DEFAULT_TOOL_TRANSIENT_RETRY_BACKOFF_MS, aM as DefaultApprovalPolicy, aN as ELICITATION_INPUT_TYPES, aO as ElicitationInput, aP as ElicitationInputType, aQ as ElicitationOption, aR as ElicitationOutcome, aS as ElicitationQuestion, aT as ElicitationReply, aU as ElicitationResult, aV as EmitUiOptions, aW as HistoryPolicyContext, aX as HistorySelection, aY as HistorySummary, aZ as InvokeWithTransientRetryOptions, a_ as MAX_ASK_QUESTIONS, a$ as MessageFeedbackValue, b0 as MessageRole, b1 as PersonaRef, b2 as PromptContext, b3 as QueuePauseReason, b4 as QueuedMessageView, b5 as QuotaView, b6 as REQUESTER_APPROVER, b7 as RUN_ENDED_BEFORE_TOOL_CALL, b8 as RecordRunEndInput, b9 as ResolveActionProposalApprovalInput, ba as ThreadTurnPage, bb as ThreadTurnQuery, bc as ThreadTurnReader, bd as ToolCallApproval, be as ToolCallApprovalColumns, bf as ToolCallApprovalStatus, bg as ToolCatalogEntry, bh as ToolDescription, bi as ToolKind, bj as ToolPreflightOptions, c as ToolPresentation, bk as ToolPresentationTone, bl as ToolResultField, bm as ToolResultView, bn as ToolStepCtx, bo as ToolTransientRetryNumbers, bp as ToolTransientRetryOptions, bq as TurnPersona, br as UNFINISHED_TOOL_CALL, bs as UsagePurpose, bt as askInputSchema, bu as askToolDefinition, bv as danglingToolCallIds, bw as decodeStreamEvent, bx as defaultCanDecide, by as encodeStreamEvent, bz as invokeWithTransientRetry, bA as isChatQueueStore, bB as isTransientToolError, bC as isTypedQuestion, bD as mayDecideApproval, bE as normalizeElicitationReply, bF as questionOptions, bG as queuedMessageView, bH as readElicitationInput, bI as readElicitationQuestions, bJ as releaseThreadRun, bK as renderElicitationAnswers, bL as resolveActionProposalApproval, bM as resolveElicitation, bN as resolveToolTransientRetryNumbers, bO as settleDanglingToolCalls, bP as settleElicitation, bQ as toolCallApprovalFromRow, bR as validateElicitationAnswer, bS as validateElicitationValue } from './stream-events-M0jc7lSW.cjs';
1
+ import { M as ModelMessage, q as ToolDefinition, r as ToolCallRequest, u as MessageUsage, w as AgentUiComponent, a as Actor, x as AiToolCtx, A as AgentStreamEvent, T as ToolSpec, Q as QuotaState, y as AgentRunInput, H as HumanReply, z as MessageAttachment, B as ActionProposalMutationResult, D as ActionProposal, E as ActionProposalExecution, F as ActionProposalOutcomeDelivery, b as ToolHandler, G as AgentDefinition, I as Persona, J as PersonaCatalogEntry, K as HistoryPolicy, L as PageContext, N as AgentStore, O as AgentDelegation, R as DetachedDelivery, S as ToolDescribeScope, V as ToolPreflightResult, W as ApprovalPolicy, X as PromptBuilder, Y as PromptContributor, Z as ToolTransientRetrySetting, _ as AgentIntake, $ as Decision, a0 as ElicitationRequest, a1 as LlmStepEnvelope, a2 as ToolStepEnvelope, a3 as ClaimActionProposal, a4 as ActionProposalStore, a5 as ActionProposalStoreOptions, a6 as CreateActionProposal, a7 as CreateActionProposalResult, a8 as ActionProposalScope, a9 as ListActionProposals, aa as ActionProposalDecisionCommand, ab as ExtendActionProposalLease, ac as SettleActionProposal, ad as ActionProposalOutcome, ae as ActionProposalOutcomeLease, af as ToolCallStatus, ag as ChatQueueStore, ah as ActionProposalOutcomeStore, ai as CreateThreadInput, aj as ThreadSummary, ak as ThreadDetail, al as ToolCallApprovalState, am as UpdateThreadInput, an as RecordRunStartInput, ao as EnqueueMessageInput, ap as QueuedMessage, aq as QueuedMessagePatch, ar as QueuePause, as as AppendMessageInput, at as StoredMessage, au as ToolResult, av as MessageFeedback, aw as RecordToolCallInput, ax as ToolCallOutcome, ay as UpdateToolCallInput, az as RecordUsageInput, aA as ToolConfirmation, aB as ActionProposalDecision, aC as ActionProposalSupersessionStore } from './stream-events-C-pj3bVY.cjs';
2
+ export { aD as ALL_AGENTS, aE as ASK_TOOL_DESCRIPTION, aF as ASK_TOOL_NAME, aG as ActionProposalDecisionAudit, aH as ActionProposalExecutionContext, aI as ActionProposalLease, aJ as AgentApprovalRequest, aK as AgentApprovalSettlement, aL as AgentAttachmentConfig, aM as AgentCatalogEntry, aN as AgentClientConfig, aO as AgentHistoryWindow, aP as AgentHostContext, aQ as AgentStreamErrorCode, aR as ApprovalDecisionRef, aS as ApprovalRequirement, aT as ApprovalThreadRef, aU as ApprovalToolRef, aV as AskToolInput, aW as ChatQueueState, aX as ClaimedActionApproval, aY as DEFAULT_INTAKE_PREAMBLE, aZ as DEFAULT_TOOL_TRANSIENT_RETRY_ATTEMPTS, a_ as DEFAULT_TOOL_TRANSIENT_RETRY_BACKOFF_MS, a$ as DefaultApprovalPolicy, b0 as ELICITATION_INPUT_TYPES, b1 as ElicitationInput, b2 as ElicitationInputType, b3 as ElicitationOption, b4 as ElicitationOutcome, b5 as ElicitationQuestion, b6 as ElicitationReply, b7 as ElicitationResult, b8 as EmitUiOptions, b9 as HistoryPolicyContext, ba as HistorySelection, bb as HistorySummary, bc as InvokeWithTransientRetryOptions, bd as MAX_ASK_QUESTIONS, be as MessageFeedbackValue, bf as MessageRole, bg as PersonaRef, bh as PromptContext, bi as QueuePauseReason, bj as QueuedMessageView, bk as QuotaView, bl as REQUESTER_APPROVER, bm as RUN_ENDED_BEFORE_TOOL_CALL, bn as RecordRunEndInput, bo as ResolveActionProposalApprovalInput, bp as ThreadTurnPage, bq as ThreadTurnQuery, br as ThreadTurnReader, bs as ToolCallApproval, bt as ToolCallApprovalColumns, bu as ToolCallApprovalStatus, bv as ToolCatalogEntry, bw as ToolDescription, bx as ToolKind, by as ToolPreflightOptions, c as ToolPresentation, bz as ToolPresentationTone, bA as ToolResultField, bB as ToolResultView, bC as ToolStepCtx, bD as ToolTransientRetryNumbers, bE as ToolTransientRetryOptions, bF as TurnPersona, bG as UNFINISHED_TOOL_CALL, bH as UsagePurpose, bI as askInputSchema, bJ as askToolDefinition, bK as danglingToolCallIds, bL as decodeStreamEvent, bM as defaultCanDecide, bN as encodeStreamEvent, bO as invokeWithTransientRetry, bP as isChatQueueStore, bQ as isTransientToolError, bR as isTypedQuestion, bS as mayDecideApproval, bT as normalizeElicitationReply, bU as questionOptions, bV as queuedMessageView, bW as readElicitationInput, bX as readElicitationQuestions, bY as releaseThreadRun, bZ as renderElicitationAnswers, b_ as resolveActionProposalApproval, b$ as resolveElicitation, c0 as resolveToolTransientRetryNumbers, c1 as settleDanglingToolCalls, c2 as settleElicitation, c3 as toolCallApprovalFromRow, c4 as validateElicitationAnswer, c5 as validateElicitationValue } from './stream-events-C-pj3bVY.cjs';
3
3
  import { StandardSchemaV1 } from '@standard-schema/spec';
4
- import { O as OutputProcessor, P as ProcessorContext, I as InputProcessor, a as ProcessedPrompt, M as ModelAnswer } from './processors-B7nfbU6E.cjs';
5
- export { D as DEFAULT_INCREMENTAL_LOOKBACK_CHARS, b as IncrementalGating, c as OutputRejectedError, d as OutputVerdict, e as ProcessorFailedError } from './processors-B7nfbU6E.cjs';
6
- import { a as Catalog } from './catalog-CrzetM3_.cjs';
4
+ import { O as OutputProcessor, P as ProcessorContext, I as InputProcessor, a as ProcessedPrompt, M as ModelAnswer } from './processors-DpHBqRuE.cjs';
5
+ export { D as DEFAULT_INCREMENTAL_LOOKBACK_CHARS, b as IncrementalGating, c as OutputRejectedError, d as OutputVerdict, e as ProcessorFailedError } from './processors-DpHBqRuE.cjs';
6
+ import { a as Catalog } from './catalog-BKS3Yxo6.cjs';
7
7
  import { ChannelRegistry } from '@dudousxd/nestjs-diagnostics';
8
8
 
9
9
  /**
@@ -29,6 +29,11 @@ declare const AGENT_DURABLE_RUNNER: unique symbol;
29
29
  declare const AGENT_SINK: unique symbol;
30
30
  declare const AGENT_MODEL: unique symbol;
31
31
  declare const AGENT_ROLES_POLICY: unique symbol;
32
+ /**
33
+ * @deprecated Nothing binds or injects this token since the quota rework (#230): `AgentModule`
34
+ * enforces and reports the budget through {@link AGENT_QUOTA_PROVIDER}, configured with
35
+ * `AgentModule.forRoot({ quota })`. Inject `AGENT_QUOTA_PROVIDER` instead. Removed in the next major.
36
+ */
32
37
  declare const AGENT_QUOTA_STORE: unique symbol;
33
38
  declare const AGENT_TOOL_REGISTRY: unique symbol;
34
39
  declare const AGENT_REGISTRY: unique symbol;
@@ -449,7 +454,7 @@ interface QuotaQuery {
449
454
  }
450
455
  /**
451
456
  * The actor's budget across windows — the read behind `GET <base>/quota` and, when the host binds
452
- * one (`AgentModule.forRoot({ quotaProvider })`), the gate a send passes: a report with `blocked`
457
+ * one (`AgentModule.forRoot({ quota })`), the gate a send passes: a report with `blocked`
453
458
  * refuses the turn with `429` before it starts.
454
459
  *
455
460
  * The default reads the usage ledger (`LedgerQuotaProvider` in `@dudousxd/nestjs-agent`); a host
@@ -584,6 +589,12 @@ interface AgentRunner {
584
589
  start(input: AgentRunInput, options?: AgentRunStartOptions): Promise<{
585
590
  runId: string;
586
591
  }>;
592
+ /**
593
+ * OPTIONAL: the id a run of `input` should have, when the caller mints one before starting it (the
594
+ * chat queue claims a thread under the id first). A host whose ids carry meaning — a tenant
595
+ * prefix its durable store partitions by — answers here. Absent → a random UUID.
596
+ */
597
+ runIdFor?(input: AgentRunInput): string;
587
598
  /**
588
599
  * OPTIONAL: whether `runId` is still running (or parked, or about to start) as far as this runner
589
600
  * can tell. Asked when a thread's admission is held by a run, to tell a live holder from a stale
@@ -1136,6 +1147,26 @@ interface AttachmentStagingDescription {
1136
1147
  upload?: 'multipart' | 'resumable';
1137
1148
  }
1138
1149
 
1150
+ /**
1151
+ * What leaves the server about a proposal — the routes, a text decision's answer, AG-UI, the approval
1152
+ * port. The stored row minus what only the worker and the store may hold: the execution and
1153
+ * delivery leases (whose token lets a holder settle the work), the idempotency key the tool's side
1154
+ * effect is keyed on, and the execution address (the original preparation input and the request's
1155
+ * context).
1156
+ */
1157
+ interface ActionProposalView extends Omit<ActionProposal, 'execution' | 'outcomeDelivery' | 'idempotencyKey' | 'preparationInput' | 'executionContext'> {
1158
+ execution: Omit<ActionProposalExecution, 'lease'> | null;
1159
+ outcomeDelivery?: Omit<ActionProposalOutcomeDelivery, 'lease'>;
1160
+ }
1161
+ /** {@link ActionProposalMutationResult} with its proposal as an {@link ActionProposalView}. */
1162
+ interface ActionProposalMutationView extends Omit<ActionProposalMutationResult, 'proposal'> {
1163
+ proposal?: ActionProposalView;
1164
+ }
1165
+ /** The public view of a stored proposal. See {@link ActionProposalView}. */
1166
+ declare function toActionProposalView(proposal: ActionProposal): ActionProposalView;
1167
+ /** The public view of a mutation's answer. See {@link ActionProposalView}. */
1168
+ declare function toActionProposalMutationView(result: ActionProposalMutationResult): ActionProposalMutationView;
1169
+
1139
1170
  /**
1140
1171
  * Console-side HITL decisions. Implemented by the agent runtime (the nestjs package binds it to
1141
1172
  * the same signal path chat approvals use); the dashboard injects it OPTIONALLY — absent = the
@@ -1149,7 +1180,7 @@ interface AgentApprovalPort {
1149
1180
  }, opts?: {
1150
1181
  remember?: boolean;
1151
1182
  decidedVia?: string;
1152
- }): Promise<ActionProposalMutationResult>;
1183
+ }): Promise<ActionProposalMutationView>;
1153
1184
  rejectActionProposal?(actor: Actor, target: {
1154
1185
  kind: 'proposal';
1155
1186
  threadId: string;
@@ -1157,7 +1188,7 @@ interface AgentApprovalPort {
1157
1188
  }, opts?: {
1158
1189
  reason?: string;
1159
1190
  decidedVia?: string;
1160
- }): Promise<ActionProposalMutationResult>;
1191
+ }): Promise<ActionProposalMutationView>;
1161
1192
  /**
1162
1193
  * `remember` approves later calls of the same tool in the same thread; `decidedVia` names the
1163
1194
  * surface the decision came through (`'console'`, `'slack'`, …) and is persisted with the call.
@@ -2512,6 +2543,10 @@ declare class ToolInputDriftError extends Error {
2512
2543
  declare class ToolRegistry {
2513
2544
  private readonly entries;
2514
2545
  register(spec: ToolSpec, handler: ToolHandler): void;
2546
+ /** Whether a successful preflight shortcut has UI to journal. */
2547
+ hasPresentation(name: string): boolean;
2548
+ /** Present an already authorized successful domain result without executing its action again. */
2549
+ presentOutput(name: string, output: unknown, ctx: AiToolCtx): Promise<void>;
2515
2550
  has(name: string): boolean;
2516
2551
  /**
2517
2552
  * Give a name back, and report whether it was held. For an importer that registered tools on
@@ -2581,6 +2616,10 @@ interface ToolPreparationResult {
2581
2616
  * visitor included, when no resolver is configured); restrict with `@AiTool({ roles })` per tool,
2582
2617
  * `AgentModule.forRoot({ defaultRoles })` module-wide, or a `rolesPolicy` of your own. `action`
2583
2618
  * tools still park on approval either way.
2619
+ *
2620
+ * A tool gated by an `ability` and naming no `roles` is refused: this policy cannot evaluate an
2621
+ * ability, and falling through to the open default would hand the tool to everyone. Bind an
2622
+ * ability-aware policy (`AgentAuthzModule`) to reach it — or give the tool `roles` as well.
2584
2623
  */
2585
2624
  declare class DefaultRolesPolicy implements RolesPolicy {
2586
2625
  readonly defaultRoles: string[];
@@ -3172,10 +3211,22 @@ interface AgentToolCallEvent {
3172
3211
  status: string;
3173
3212
  durationMs?: number;
3174
3213
  }
3214
+ /**
3215
+ * A turn refused for budget. Published by the send gate (`429`) and the message queue when a
3216
+ * `QuotaProvider` reports `blocked`, and by the loop's own per-day `QuotaStore` gate. The figures
3217
+ * are the exhausted window's: a window that does not count tokens (a USD-only spend cap) carries no
3218
+ * token figures, never a made-up `0`.
3219
+ */
3175
3220
  interface AgentQuotaExceeded {
3176
3221
  actorId: string;
3177
- usedTokens: number;
3178
- limitTokens: number;
3222
+ /** The window that ran out. Absent from the loop's per-day `QuotaStore` gate. */
3223
+ period?: QuotaPeriod;
3224
+ /** The provider's words for the block, when it gave some. */
3225
+ reason?: string;
3226
+ usedTokens?: number;
3227
+ limitTokens?: number;
3228
+ usedUsd?: number;
3229
+ limitUsd?: number;
3179
3230
  }
3180
3231
  interface AgentRunFinished {
3181
3232
  runId: string;
@@ -4117,7 +4168,7 @@ type TextActionProposalResolution = {
4117
4168
  * resolve the authenticated actor and use the normal scoped decision service with via=text.
4118
4169
  * Never feed model output here or consume an unmatched message as an approval.
4119
4170
  */
4120
- declare function resolveTextActionProposalDecision(text: string, proposals: readonly TextActionProposalCandidate[]): TextActionProposalResolution;
4171
+ declare function resolveTextActionProposalDecision(text: string, proposals: readonly TextActionProposalCandidate[], vocabulary?: TextActionProposalVocabulary): TextActionProposalResolution;
4121
4172
  type TextActionProposalCommand = {
4122
4173
  status: 'unmatched';
4123
4174
  } | {
@@ -4126,8 +4177,54 @@ type TextActionProposalCommand = {
4126
4177
  remember: boolean;
4127
4178
  proposalId?: string;
4128
4179
  };
4180
+ /**
4181
+ * The words a whole chat message must consist of to decide a proposal by text. Matched
4182
+ * case-insensitively, as the complete message (an optional trailing `.`/`!`, an optional `#ID`).
4183
+ */
4184
+ interface TextActionProposalVocabulary {
4185
+ /** Approve, e.g. `sim`, `yes`. */
4186
+ approve: readonly string[];
4187
+ /** Reject, e.g. `não`, `no`. */
4188
+ reject: readonly string[];
4189
+ /** The phrase after an approve word that also approves later calls of the tool in this thread. */
4190
+ remember: readonly string[];
4191
+ }
4192
+ /**
4193
+ * English. Portuguese ships as {@link ptBrActionProposalText}; any other language through
4194
+ * `AgentModule.forRoot({ actionProposalText })`.
4195
+ */
4196
+ declare const DEFAULT_TEXT_ACTION_PROPOSAL_VOCABULARY: TextActionProposalVocabulary;
4197
+ /** What the agent answers to a text decision. Every field has an English default. */
4198
+ interface TextActionProposalReplies {
4199
+ approved: string;
4200
+ rejected: string;
4201
+ expired: string;
4202
+ /** The proposal could not change (already decided by someone else, superseded, …). */
4203
+ unchanged: string;
4204
+ /** More than one pending proposal could be meant: ask for the `#ID`. */
4205
+ ambiguous(proposalIds: readonly string[]): string;
4206
+ /** Too many pending proposals to pick one without an explicit `#ID`. */
4207
+ tooMany: string;
4208
+ }
4209
+ declare const DEFAULT_TEXT_ACTION_PROPOSAL_REPLIES: TextActionProposalReplies;
4210
+ /** `AgentModule.forRoot({ actionProposalText })`: either part replaces the default it names. */
4211
+ interface TextActionProposalConfig {
4212
+ vocabulary?: Partial<TextActionProposalVocabulary>;
4213
+ replies?: Partial<TextActionProposalReplies>;
4214
+ }
4215
+ /** The reply to a decision the store answered with `result`. */
4216
+ declare function textActionProposalReply(result: Pick<ActionProposalMutationResult, 'status'> & {
4217
+ proposal?: {
4218
+ decision: ActionProposalDecision;
4219
+ };
4220
+ }, decision: 'approved' | 'rejected', replies?: TextActionProposalReplies): string;
4129
4221
  /** Parse exact consent syntax only. Authentication and target lookup remain the caller's responsibility. */
4130
- declare function parseTextActionProposalCommand(text: string): TextActionProposalCommand;
4222
+ declare function parseTextActionProposalCommand(text: string, vocabulary?: TextActionProposalVocabulary): TextActionProposalCommand;
4223
+ /**
4224
+ * Brazilian Portuguese text decisions — `AgentModule.forRoot({ actionProposalText: ptBrActionProposalText })`.
4225
+ * Commands in Portuguese (English ones still work), replies in Portuguese.
4226
+ */
4227
+ declare const ptBrActionProposalText: Required<TextActionProposalConfig>;
4131
4228
 
4132
4229
  interface ActionProposalExecutionDeps {
4133
4230
  registry: ToolRegistry;
@@ -4188,4 +4285,18 @@ declare class ActionProposalWorker {
4188
4285
  type ActionProposalRuntimeStore = AgentStore & ActionProposalStore & ActionProposalWorkerStore & ActionProposalOutcomeStore & ActionProposalSupersessionStore;
4189
4286
  declare function assertIndependentActionCapabilities(store: AgentStore, resolver: BackgroundActorResolver | undefined): asserts store is ActionProposalRuntimeStore;
4190
4287
 
4191
- export { AGENT_ACTOR_DIRECTORY, AGENT_ACTOR_RESOLVER, AGENT_APPROVAL_PORT, AGENT_ATTACHMENT_STAGING, AGENT_CONFIRM_TOKEN_STORE, AGENT_DEPS_FACTORY, AGENT_DIAGNOSTIC_EVENTS, AGENT_DURABLE_RUNNER, AGENT_EMBEDDING_PROVIDER, AGENT_GOVERNANCE_QUERIES, AGENT_MEMORY, AGENT_MODEL, AGENT_MODEL_CATALOG, AGENT_OPTIONS, AGENT_PRICING_STORE, AGENT_PROMPT_CONTRIBUTORS, AGENT_QUOTA_PROVIDER, AGENT_QUOTA_STORE, AGENT_REGISTRY, AGENT_RETRIEVER, AGENT_ROLES_POLICY, AGENT_RUNNER, AGENT_SINK, AGENT_SKILLS, AGENT_SKILL_SOURCES, AGENT_SPAN_EVENTS, AGENT_STORE, AGENT_TOOL_REGISTRY, APPROVAL_EXPIRED_REASON, type ActionApprovalMode, ActionProposal, ActionProposalDecision, ActionProposalDecisionCommand, type ActionProposalDiscoveryIndexStore, type ActionProposalExecutionDeps, type ActionProposalExecutionResult, ActionProposalExecutor, type ActionProposalExecutorOptions, ActionProposalMutationResult, ActionProposalOutcome, ActionProposalOutcomeLease, ActionProposalOutcomeStore, type ActionProposalReceipt, type ActionProposalRuntimeStore, ActionProposalScope, ActionProposalStore, ActionProposalStoreOptions, ActionProposalSupersessionStore, type ActionProposalTarget, ActionProposalWorker, type ActionProposalWorkerOptions, type ActionProposalWorkerStore, Actor, type ActorDirectory, type ActorResolver, type ActorSpendRow, type AgentApprovalPort, AgentDefinition, type AgentDelegated, AgentDelegation, type AgentDiagnosticEvent, type AgentDiagnosticKey, type AgentFollowUpsSpan, type AgentGovernanceQueries, AgentIntake, type AgentLlmTurnSpan, type AgentLoopDeps, type AgentLoopHooks, type AgentLoopResult, type AgentMemoryResolved, type AgentMemoryWritten, type AgentMessageEvent, type AgentPricingStore, type AgentQuotaExceeded, AgentRegistry, type AgentRetrievalSpan, type AgentRetrieved, type AgentRunFailed, type AgentRunFinished, AgentRunInput, type AgentRunStartOptions, type AgentRunStarted, type AgentRunner, type AgentSkillsResolved, type AgentSpanEvent, AgentStore, AgentStreamError, AgentStreamEvent, type AgentStructuredOutputSpan, type AgentToolCallEvent, type AgentToolExecutionSpan, type AgentToolRetry, AgentUiComponent, AiToolCtx, AppendMessageInput, ApprovalPolicy, type ApprovalWhere, type AttachmentRef, type AttachmentStagingDescription, type AttachmentStagingStore, type BackgroundActorResolver, type BufferedModelTurnResult, type BuildMemoryBlockInput, CONFIRM_JSON_SCHEMA_PROPERTIES, ChatQueueStore, ClaimActionProposal, ClosedRolesPolicy, type ConfirmFields, type ConfirmTokenClaim, ConfirmTokenError, type ConfirmTokenStore, type ConfirmTokenSubject, type ConfirmedTool, type ConfirmedToolDone, type ConfirmedToolMessages, type ConfirmedToolOptions, type ConfirmedToolOutcome, type ConfirmedToolPreview, type ConfirmedToolResult, type ConfirmedToolSteps, type CostUsage, CreateActionProposal, CreateActionProposalResult, CreateThreadInput, type CurrentModelPrice, DEFAULT_CONFIRM_TTL_MS, DEFAULT_HISTORY_SUMMARY_INSTRUCTION, DEFAULT_MAX_FACT_CHARS, DEFAULT_MAX_MEMORIES, DEFAULT_MAX_SKILLS, DEFAULT_REFUSAL_REASON, DEFAULT_STRUCTURED_OUTPUT_INSTRUCTION, Decision, DefaultRolesPolicy, type DetachedDelegationOutcome, type DetachedDelegationReceipt, DetachedDelivery, type DetailThreadRef, ElicitationRequest, type EmbeddingProvider, type EmitUi, type EmptyRoles, EnqueueMessageInput, ExtendActionProposalLease, type ForgetMemoryInput, type FrameBuffer, GLOBAL_SCOPE, type GovernanceMessageRow, type GovernancePage, type GovernancePageQuery, type GovernancePendingApprovalRow, type GovernanceRange, type GovernanceRunDetail, type GovernanceRunRow, type GovernanceThreadDetail, type GovernanceThreadDetailQuery, type GovernanceThreadRow, type GovernanceToolCallRow, type GovernanceUsageInput, type GovernanceUsageRow, HistoryPolicy, HumanReply, InMemoryActionProposalStore, InMemoryAgentStore, InMemoryConfirmTokenStore, type IncrementalGate, InputProcessor, type InvokeOptions, ListActionProposals, type ListMemoriesInput, type ListSkillsInput, type ListStagedAttachmentsInput, LlmStepEnvelope, type LoadSkillInput, type MemoryAuthor, type MemoryConfig, type MemoryDigest, type MemoryDigestEntry, type MemoryFact, type MemoryForgetRequest, type MemoryOrigin, type MemoryProvider, type MemoryRecord, type MemoryVerdict, type MemoryWriteOutcome, type MemoryWriteRequest, MessageAttachment, MessageFeedback, MessageUsage, ModelAnswer, type ModelCatalog, type ModelCatalogEntry, type ModelCatalogLock, type ModelCatalogProviderGroup, type ModelCatalogQuery, type ModelCatalogView, ModelMessage, type ModelPrice, type ModelPriceInput, type ModelProvider, type ModelSpendRow, type ModelTurnArgs, type ModelTurnResult, type NegotiatedUiCollector, type ObservedTurnFrames, type OfferMemoriesInput, type OutputGateMode, type OutputGateResult, OutputProcessor, type OverriddenMemory, PageContext, type Passage, type PendingApprovalRow, Persona, type PersonaAlias, PersonaCatalogEntry, type PrepareOptions, ProcessedPrompt, ProcessorContext, PromptBuilder, PromptContributor, QueuePause, QueuedMessage, QueuedMessagePatch, type QuotaBlock, QuotaExceededError, type QuotaPeriod, type QuotaProvider, type QuotaQuery, type QuotaReport, QuotaState, type QuotaStore, type QuotaWarning, type QuotaWindow, REMEMBER_TOOL_DESCRIPTION, REMEMBER_TOOL_NAME, RUN_FAILED_MESSAGE, RUN_NOT_ACTIVE_CODE, RUN_NOT_ACTIVE_MESSAGE, RUN_NO_LONGER_RUNNING, type RecentRunRow, RecordRunStartInput, RecordToolCallInput, RecordUsageInput, type RememberToolInput, type RerankOptions, type Reranker, type ResolveAttachmentInput, type ResolveMemoryDigestInput, type ResolveToolUiCatalog, type ResolvedDelegation, type RetrieveOptions, type Retriever, type RolesPolicy, type RolesPolicyOptions, type RunAgentBreakdownRow, RunCancelledError, type RunErrorBreakdownRow, type RunMetrics, type RunToolCallRow, type RunTrendPoint, type RunWhere, SCHEMA_EXTENSION, SKILL_TOOL_DESCRIPTION, SKILL_TOOL_NAME, type SchemaExtension, type ScopeContext, type ScopeResolver, type SearchMemoriesInput, SettleActionProposal, type SettleDeadRunInput, type SettledTask, type SinkWriter, type Skill, type SkillAuthor, type SkillCatalogEntry, type SkillContext, type SkillLoadOutcome, type SkillOffer, type SkillProvider, type SkillSummary, type SkillToolInput, type SkillWriteRequest, type SkillWriteVerdict, type SkillsConfig, SqlTokenStreamSink, type SqlTokenStreamSinkOptions, type StageAttachmentInput, type StagedAttachment, type StoreMemoryInput, StoredMessage, type StreamError, type StreamFrameRow, type StreamFrameTable, type StructuredOutcome, StructuredOutputError, THREAD_DETAIL_CONTENT_CHARS, type TextActionProposalCandidate, type TextActionProposalCommand, type TextActionProposalResolution, type ThreadActivityRow, ThreadDetail, type ThreadMessageRow, type ThreadMeta, type ThreadSpendRow, ThreadSummary, type ThreadUsageRollup, type ThreadWhere, type TokenStreamSink, type ToolCallActivityRow, ToolCallApprovalState, ToolCallOutcome, ToolCallRequest, ToolCallStatus, type ToolCallWhere, ToolConfirmation, ToolDefinition, ToolDescribeScope, ToolDisabledError, ToolForbiddenError, ToolHandler, ToolInputDriftError, ToolInputInvalidError, type ToolKindDeps, ToolNotFoundError, ToolPreflightDeniedError, ToolPreflightResult, type ToolPreparationResult, ToolRegistry, ToolResult, ToolSpec, type ToolStatRow, ToolStepEnvelope, ToolTransientRetrySetting, type TurnFrameSummary, type UiCollector, UpdateThreadInput, UpdateToolCallInput, type UsageTrendPoint, type WindowHistoryOptions, type WithMemoryToolInput, type WriteMemoryInput, actionProposalCreationMatches, actionProposalOutcomeFenceValid, actionProposalOutcomeScope, actionProposalOutcomeText, actionProposalReceipt, actionProposalScopeMatches, actorScope, agentDiagnosticKey, agentFailureCode, assertIndependentActionCapabilities, attachActionProposalOutcome, bucketByActor, bucketByModel, bucketByThread, bucketUsageTrend, buildMemoryBlock, buildSkillsBlock, canActorUseTool, canonicalActionProposalJson, canonicalJson, claimActionProposalOutcome, closeEmptyRoles, compositeSkillProvider, confirmTokenExpiry, createFrameBuffer, createIncrementalGate, createNegotiatedUiCollector, createNoopEmitUi, createUiCollector, dayBoundsUtc, defaultScopeResolver, defineConfirmedTool, detachedDelivered, detachedStarted, detachedUnsettled, escapeUnsafeToolUiText, estimateCost, estimateMessageTokens, exhaustedWindow, exposeStreamErrorDetails, extractJson, filterToolsByAllowList, filterToolsByCanUse, filterToolsByEnabled, filterToolsByRole, findCatalogModel, findPersona, gateFollowUps, gateTail, hashConfirmToken, initialActionProposal, intersectAllowLists, isControlFlowSignal, isReplayIntegrityError, isToolEnabled, loadSkill, memoryForgetVerdict, memoryWriteVerdict, mergeUi, normalizeDelegation, observeTurnFrames, offerMemories, offerSkills, parseTextActionProposalCommand, personaCatalogEntry, prepareActionProposal, publishAgentDelegated, publishAgentMemoryResolved, publishAgentMemoryWritten, publishAgentMessage, publishAgentQuotaExceeded, publishAgentRetrieved, publishAgentRunFailed, publishAgentRunFinished, publishAgentRunStarted, publishAgentSkillsResolved, publishAgentToolCall, publishAgentToolRetry, quotaPeriodRange, quotaUsedRatio, quotaWarning, releaseGatedFrames, rememberInputSchema, rememberToolDefinition, repairInstruction, resolveGateLookback, resolveMemoryDigest, resolveOutputGateMode, resolvePersonaAlias, resolveSkillCatalog, resolveTextActionProposalDecision, rollupThreadUsage, runAgentLoop, runInputProcessors, runOutputProcessors, schemaExtensionOf, seedModelPrices, settleAll, settleDeadRun, settleUnsettledDelegation, signConfirmToken, skillInputSchema, skillToolDefinition, skillWriteVerdict, snapshotActionProposal, stampToolKinds, staticModelCatalog, staticSkillProvider, streamFailure, summarizeWithModel, tenantScope, toolCallContext, traceLlmTurn, traceToolExecution, transitionActionProposalClaim, transitionActionProposalDecision, transitionActionProposalLease, transitionActionProposalSettlement, transitionActionProposalSupersession, truncateDetailContent, unwrapToolStepOutput, validateActionProposalCreation, validateActionProposalDiscoveryIndexBatch, validateActionProposalExpiryBatch, validateActionProposalListQuery, validateActionProposalWorkerClaim, validateStructured, verifyConfirmToken, windowHistory, withAskTool, withConfirmFields, withMemoryTool, withSelectedModel, withSkillTool, withToolTimeout, withTurnFrames, wrapToolPreflightDenied, wrapToolStepOutput, writeMemory };
4288
+ interface FunctionalTool<I = unknown, O = unknown> {
4289
+ spec: ToolSpec;
4290
+ handler: ToolHandler<I, O>;
4291
+ }
4292
+ type FunctionalToolDefinition<I, O> = Omit<ToolSpec, 'inputSchema' | 'kind'> & {
4293
+ input: StandardSchemaV1<unknown, I>;
4294
+ kind?: ToolSpec['kind'];
4295
+ } & ToolHandler<I, O>;
4296
+ /** Framework-independent authoring; every method keeps the author's object as its receiver. */
4297
+ declare function createFunctionalTool<I, O>(definition: FunctionalToolDefinition<I, O>): FunctionalTool<I, O>;
4298
+
4299
+ /** Presentation failures must never cause a successful side effect to be retried. */
4300
+ declare function emitToolPresentations<I, O>(handler: ToolHandler<I, O>, output: O, ctx: AiToolCtx, toolName: string): Promise<void>;
4301
+
4302
+ export { AGENT_ACTOR_DIRECTORY, AGENT_ACTOR_RESOLVER, AGENT_APPROVAL_PORT, AGENT_ATTACHMENT_STAGING, AGENT_CONFIRM_TOKEN_STORE, AGENT_DEPS_FACTORY, AGENT_DIAGNOSTIC_EVENTS, AGENT_DURABLE_RUNNER, AGENT_EMBEDDING_PROVIDER, AGENT_GOVERNANCE_QUERIES, AGENT_MEMORY, AGENT_MODEL, AGENT_MODEL_CATALOG, AGENT_OPTIONS, AGENT_PRICING_STORE, AGENT_PROMPT_CONTRIBUTORS, AGENT_QUOTA_PROVIDER, AGENT_QUOTA_STORE, AGENT_REGISTRY, AGENT_RETRIEVER, AGENT_ROLES_POLICY, AGENT_RUNNER, AGENT_SINK, AGENT_SKILLS, AGENT_SKILL_SOURCES, AGENT_SPAN_EVENTS, AGENT_STORE, AGENT_TOOL_REGISTRY, APPROVAL_EXPIRED_REASON, type ActionApprovalMode, ActionProposal, ActionProposalDecision, ActionProposalDecisionCommand, type ActionProposalDiscoveryIndexStore, ActionProposalExecution, type ActionProposalExecutionDeps, type ActionProposalExecutionResult, ActionProposalExecutor, type ActionProposalExecutorOptions, ActionProposalMutationResult, type ActionProposalMutationView, ActionProposalOutcome, ActionProposalOutcomeDelivery, ActionProposalOutcomeLease, ActionProposalOutcomeStore, type ActionProposalReceipt, type ActionProposalRuntimeStore, ActionProposalScope, ActionProposalStore, ActionProposalStoreOptions, ActionProposalSupersessionStore, type ActionProposalTarget, type ActionProposalView, ActionProposalWorker, type ActionProposalWorkerOptions, type ActionProposalWorkerStore, Actor, type ActorDirectory, type ActorResolver, type ActorSpendRow, type AgentApprovalPort, AgentDefinition, type AgentDelegated, AgentDelegation, type AgentDiagnosticEvent, type AgentDiagnosticKey, type AgentFollowUpsSpan, type AgentGovernanceQueries, AgentIntake, type AgentLlmTurnSpan, type AgentLoopDeps, type AgentLoopHooks, type AgentLoopResult, type AgentMemoryResolved, type AgentMemoryWritten, type AgentMessageEvent, type AgentPricingStore, type AgentQuotaExceeded, AgentRegistry, type AgentRetrievalSpan, type AgentRetrieved, type AgentRunFailed, type AgentRunFinished, AgentRunInput, type AgentRunStartOptions, type AgentRunStarted, type AgentRunner, type AgentSkillsResolved, type AgentSpanEvent, AgentStore, AgentStreamError, AgentStreamEvent, type AgentStructuredOutputSpan, type AgentToolCallEvent, type AgentToolExecutionSpan, type AgentToolRetry, AgentUiComponent, AiToolCtx, AppendMessageInput, ApprovalPolicy, type ApprovalWhere, type AttachmentRef, type AttachmentStagingDescription, type AttachmentStagingStore, type BackgroundActorResolver, type BufferedModelTurnResult, type BuildMemoryBlockInput, CONFIRM_JSON_SCHEMA_PROPERTIES, ChatQueueStore, ClaimActionProposal, ClosedRolesPolicy, type ConfirmFields, type ConfirmTokenClaim, ConfirmTokenError, type ConfirmTokenStore, type ConfirmTokenSubject, type ConfirmedTool, type ConfirmedToolDone, type ConfirmedToolMessages, type ConfirmedToolOptions, type ConfirmedToolOutcome, type ConfirmedToolPreview, type ConfirmedToolResult, type ConfirmedToolSteps, type CostUsage, CreateActionProposal, CreateActionProposalResult, CreateThreadInput, type CurrentModelPrice, DEFAULT_CONFIRM_TTL_MS, DEFAULT_HISTORY_SUMMARY_INSTRUCTION, DEFAULT_MAX_FACT_CHARS, DEFAULT_MAX_MEMORIES, DEFAULT_MAX_SKILLS, DEFAULT_REFUSAL_REASON, DEFAULT_STRUCTURED_OUTPUT_INSTRUCTION, DEFAULT_TEXT_ACTION_PROPOSAL_REPLIES, DEFAULT_TEXT_ACTION_PROPOSAL_VOCABULARY, Decision, DefaultRolesPolicy, type DetachedDelegationOutcome, type DetachedDelegationReceipt, DetachedDelivery, type DetailThreadRef, ElicitationRequest, type EmbeddingProvider, type EmitUi, type EmptyRoles, EnqueueMessageInput, ExtendActionProposalLease, type ForgetMemoryInput, type FrameBuffer, type FunctionalTool, type FunctionalToolDefinition, GLOBAL_SCOPE, type GovernanceMessageRow, type GovernancePage, type GovernancePageQuery, type GovernancePendingApprovalRow, type GovernanceRange, type GovernanceRunDetail, type GovernanceRunRow, type GovernanceThreadDetail, type GovernanceThreadDetailQuery, type GovernanceThreadRow, type GovernanceToolCallRow, type GovernanceUsageInput, type GovernanceUsageRow, HistoryPolicy, HumanReply, InMemoryActionProposalStore, InMemoryAgentStore, InMemoryConfirmTokenStore, type IncrementalGate, InputProcessor, type InvokeOptions, ListActionProposals, type ListMemoriesInput, type ListSkillsInput, type ListStagedAttachmentsInput, LlmStepEnvelope, type LoadSkillInput, type MemoryAuthor, type MemoryConfig, type MemoryDigest, type MemoryDigestEntry, type MemoryFact, type MemoryForgetRequest, type MemoryOrigin, type MemoryProvider, type MemoryRecord, type MemoryVerdict, type MemoryWriteOutcome, type MemoryWriteRequest, MessageAttachment, MessageFeedback, MessageUsage, ModelAnswer, type ModelCatalog, type ModelCatalogEntry, type ModelCatalogLock, type ModelCatalogProviderGroup, type ModelCatalogQuery, type ModelCatalogView, ModelMessage, type ModelPrice, type ModelPriceInput, type ModelProvider, type ModelSpendRow, type ModelTurnArgs, type ModelTurnResult, type NegotiatedUiCollector, type ObservedTurnFrames, type OfferMemoriesInput, type OutputGateMode, type OutputGateResult, OutputProcessor, type OverriddenMemory, PageContext, type Passage, type PendingApprovalRow, Persona, type PersonaAlias, PersonaCatalogEntry, type PrepareOptions, ProcessedPrompt, ProcessorContext, PromptBuilder, PromptContributor, QueuePause, QueuedMessage, QueuedMessagePatch, type QuotaBlock, QuotaExceededError, type QuotaPeriod, type QuotaProvider, type QuotaQuery, type QuotaReport, QuotaState, type QuotaStore, type QuotaWarning, type QuotaWindow, REMEMBER_TOOL_DESCRIPTION, REMEMBER_TOOL_NAME, RUN_FAILED_MESSAGE, RUN_NOT_ACTIVE_CODE, RUN_NOT_ACTIVE_MESSAGE, RUN_NO_LONGER_RUNNING, type RecentRunRow, RecordRunStartInput, RecordToolCallInput, RecordUsageInput, type RememberToolInput, type RerankOptions, type Reranker, type ResolveAttachmentInput, type ResolveMemoryDigestInput, type ResolveToolUiCatalog, type ResolvedDelegation, type RetrieveOptions, type Retriever, type RolesPolicy, type RolesPolicyOptions, type RunAgentBreakdownRow, RunCancelledError, type RunErrorBreakdownRow, type RunMetrics, type RunToolCallRow, type RunTrendPoint, type RunWhere, SCHEMA_EXTENSION, SKILL_TOOL_DESCRIPTION, SKILL_TOOL_NAME, type SchemaExtension, type ScopeContext, type ScopeResolver, type SearchMemoriesInput, SettleActionProposal, type SettleDeadRunInput, type SettledTask, type SinkWriter, type Skill, type SkillAuthor, type SkillCatalogEntry, type SkillContext, type SkillLoadOutcome, type SkillOffer, type SkillProvider, type SkillSummary, type SkillToolInput, type SkillWriteRequest, type SkillWriteVerdict, type SkillsConfig, SqlTokenStreamSink, type SqlTokenStreamSinkOptions, type StageAttachmentInput, type StagedAttachment, type StoreMemoryInput, StoredMessage, type StreamError, type StreamFrameRow, type StreamFrameTable, type StructuredOutcome, StructuredOutputError, THREAD_DETAIL_CONTENT_CHARS, type TextActionProposalCandidate, type TextActionProposalCommand, type TextActionProposalConfig, type TextActionProposalReplies, type TextActionProposalResolution, type TextActionProposalVocabulary, type ThreadActivityRow, ThreadDetail, type ThreadMessageRow, type ThreadMeta, type ThreadSpendRow, ThreadSummary, type ThreadUsageRollup, type ThreadWhere, type TokenStreamSink, type ToolCallActivityRow, ToolCallApprovalState, ToolCallOutcome, ToolCallRequest, ToolCallStatus, type ToolCallWhere, ToolConfirmation, ToolDefinition, ToolDescribeScope, ToolDisabledError, ToolForbiddenError, ToolHandler, ToolInputDriftError, ToolInputInvalidError, type ToolKindDeps, ToolNotFoundError, ToolPreflightDeniedError, ToolPreflightResult, type ToolPreparationResult, ToolRegistry, ToolResult, ToolSpec, type ToolStatRow, ToolStepEnvelope, ToolTransientRetrySetting, type TurnFrameSummary, type UiCollector, UpdateThreadInput, UpdateToolCallInput, type UsageTrendPoint, type WindowHistoryOptions, type WithMemoryToolInput, type WriteMemoryInput, actionProposalCreationMatches, actionProposalOutcomeFenceValid, actionProposalOutcomeScope, actionProposalOutcomeText, actionProposalReceipt, actionProposalScopeMatches, actorScope, agentDiagnosticKey, agentFailureCode, assertIndependentActionCapabilities, attachActionProposalOutcome, bucketByActor, bucketByModel, bucketByThread, bucketUsageTrend, buildMemoryBlock, buildSkillsBlock, canActorUseTool, canonicalActionProposalJson, canonicalJson, claimActionProposalOutcome, closeEmptyRoles, compositeSkillProvider, confirmTokenExpiry, createFrameBuffer, createFunctionalTool, createIncrementalGate, createNegotiatedUiCollector, createNoopEmitUi, createUiCollector, dayBoundsUtc, defaultScopeResolver, defineConfirmedTool, detachedDelivered, detachedStarted, detachedUnsettled, emitToolPresentations, escapeUnsafeToolUiText, estimateCost, estimateMessageTokens, exhaustedWindow, exposeStreamErrorDetails, extractJson, filterToolsByAllowList, filterToolsByCanUse, filterToolsByEnabled, filterToolsByRole, findCatalogModel, findPersona, gateFollowUps, gateTail, hashConfirmToken, initialActionProposal, intersectAllowLists, isControlFlowSignal, isReplayIntegrityError, isToolEnabled, loadSkill, memoryForgetVerdict, memoryWriteVerdict, mergeUi, normalizeDelegation, observeTurnFrames, offerMemories, offerSkills, parseTextActionProposalCommand, personaCatalogEntry, prepareActionProposal, ptBrActionProposalText, publishAgentDelegated, publishAgentMemoryResolved, publishAgentMemoryWritten, publishAgentMessage, publishAgentQuotaExceeded, publishAgentRetrieved, publishAgentRunFailed, publishAgentRunFinished, publishAgentRunStarted, publishAgentSkillsResolved, publishAgentToolCall, publishAgentToolRetry, quotaPeriodRange, quotaUsedRatio, quotaWarning, releaseGatedFrames, rememberInputSchema, rememberToolDefinition, repairInstruction, resolveGateLookback, resolveMemoryDigest, resolveOutputGateMode, resolvePersonaAlias, resolveSkillCatalog, resolveTextActionProposalDecision, rollupThreadUsage, runAgentLoop, runInputProcessors, runOutputProcessors, schemaExtensionOf, seedModelPrices, settleAll, settleDeadRun, settleUnsettledDelegation, signConfirmToken, skillInputSchema, skillToolDefinition, skillWriteVerdict, snapshotActionProposal, stampToolKinds, staticModelCatalog, staticSkillProvider, streamFailure, summarizeWithModel, tenantScope, textActionProposalReply, toActionProposalMutationView, toActionProposalView, toolCallContext, traceLlmTurn, traceToolExecution, transitionActionProposalClaim, transitionActionProposalDecision, transitionActionProposalLease, transitionActionProposalSettlement, transitionActionProposalSupersession, truncateDetailContent, unwrapToolStepOutput, validateActionProposalCreation, validateActionProposalDiscoveryIndexBatch, validateActionProposalExpiryBatch, validateActionProposalListQuery, validateActionProposalWorkerClaim, validateStructured, verifyConfirmToken, windowHistory, withAskTool, withConfirmFields, withMemoryTool, withSelectedModel, withSkillTool, withToolTimeout, withTurnFrames, wrapToolPreflightDenied, wrapToolStepOutput, writeMemory };
package/dist/index.d.ts CHANGED
@@ -1,9 +1,9 @@
1
- import { M as ModelMessage, d as ToolDefinition, e as ToolCallRequest, f as MessageUsage, g as AgentUiComponent, a as Actor, h as AiToolCtx, A as AgentStreamEvent, T as ToolSpec, Q as QuotaState, i as AgentRunInput, H as HumanReply, j as MessageAttachment, k as ActionProposalMutationResult, b as ToolHandler, l as AgentDefinition, m as Persona, o as PersonaCatalogEntry, q as HistoryPolicy, r as PageContext, s as AgentStore, t as AgentDelegation, D as DetachedDelivery, u as ToolDescribeScope, w as ToolPreflightResult, x as ApprovalPolicy, y as PromptBuilder, z as PromptContributor, B as ToolTransientRetrySetting, C as AgentIntake, E as Decision, F as ElicitationRequest, L as LlmStepEnvelope, G as ToolStepEnvelope, I as ClaimActionProposal, J as ActionProposal, K as ActionProposalStore, N as ActionProposalStoreOptions, O as CreateActionProposal, R as CreateActionProposalResult, S as ActionProposalScope, V as ListActionProposals, W as ActionProposalDecisionCommand, X as ExtendActionProposalLease, Y as SettleActionProposal, Z as ActionProposalOutcome, _ as ActionProposalOutcomeLease, $ as ToolCallStatus, a0 as ChatQueueStore, a1 as ActionProposalOutcomeStore, a2 as CreateThreadInput, a3 as ThreadSummary, a4 as ThreadDetail, a5 as ToolCallApprovalState, a6 as UpdateThreadInput, a7 as RecordRunStartInput, a8 as EnqueueMessageInput, a9 as QueuedMessage, aa as QueuedMessagePatch, ab as QueuePause, ac as AppendMessageInput, ad as StoredMessage, ae as ToolResult, af as MessageFeedback, ag as RecordToolCallInput, ah as ToolCallOutcome, ai as UpdateToolCallInput, aj as RecordUsageInput, ak as ToolConfirmation, al as ActionProposalDecision, am as ActionProposalSupersessionStore } from './stream-events-DAmes2Of.js';
2
- export { an as ALL_AGENTS, ao as ASK_TOOL_DESCRIPTION, ap as ASK_TOOL_NAME, aq as ActionProposalDecisionAudit, ar as ActionProposalExecution, as as ActionProposalExecutionContext, at as ActionProposalLease, au as ActionProposalOutcomeDelivery, av as AgentApprovalRequest, aw as AgentApprovalSettlement, ax as AgentAttachmentConfig, ay as AgentCatalogEntry, az as AgentClientConfig, aA as AgentHistoryWindow, aB as AgentStreamErrorCode, aC as ApprovalDecisionRef, aD as ApprovalRequirement, aE as ApprovalThreadRef, aF as ApprovalToolRef, aG as AskToolInput, aH as ChatQueueState, aI as ClaimedActionApproval, aJ as DEFAULT_INTAKE_PREAMBLE, aK as DEFAULT_TOOL_TRANSIENT_RETRY_ATTEMPTS, aL as DEFAULT_TOOL_TRANSIENT_RETRY_BACKOFF_MS, aM as DefaultApprovalPolicy, aN as ELICITATION_INPUT_TYPES, aO as ElicitationInput, aP as ElicitationInputType, aQ as ElicitationOption, aR as ElicitationOutcome, aS as ElicitationQuestion, aT as ElicitationReply, aU as ElicitationResult, aV as EmitUiOptions, aW as HistoryPolicyContext, aX as HistorySelection, aY as HistorySummary, aZ as InvokeWithTransientRetryOptions, a_ as MAX_ASK_QUESTIONS, a$ as MessageFeedbackValue, b0 as MessageRole, b1 as PersonaRef, b2 as PromptContext, b3 as QueuePauseReason, b4 as QueuedMessageView, b5 as QuotaView, b6 as REQUESTER_APPROVER, b7 as RUN_ENDED_BEFORE_TOOL_CALL, b8 as RecordRunEndInput, b9 as ResolveActionProposalApprovalInput, ba as ThreadTurnPage, bb as ThreadTurnQuery, bc as ThreadTurnReader, bd as ToolCallApproval, be as ToolCallApprovalColumns, bf as ToolCallApprovalStatus, bg as ToolCatalogEntry, bh as ToolDescription, bi as ToolKind, bj as ToolPreflightOptions, c as ToolPresentation, bk as ToolPresentationTone, bl as ToolResultField, bm as ToolResultView, bn as ToolStepCtx, bo as ToolTransientRetryNumbers, bp as ToolTransientRetryOptions, bq as TurnPersona, br as UNFINISHED_TOOL_CALL, bs as UsagePurpose, bt as askInputSchema, bu as askToolDefinition, bv as danglingToolCallIds, bw as decodeStreamEvent, bx as defaultCanDecide, by as encodeStreamEvent, bz as invokeWithTransientRetry, bA as isChatQueueStore, bB as isTransientToolError, bC as isTypedQuestion, bD as mayDecideApproval, bE as normalizeElicitationReply, bF as questionOptions, bG as queuedMessageView, bH as readElicitationInput, bI as readElicitationQuestions, bJ as releaseThreadRun, bK as renderElicitationAnswers, bL as resolveActionProposalApproval, bM as resolveElicitation, bN as resolveToolTransientRetryNumbers, bO as settleDanglingToolCalls, bP as settleElicitation, bQ as toolCallApprovalFromRow, bR as validateElicitationAnswer, bS as validateElicitationValue } from './stream-events-DAmes2Of.js';
1
+ import { M as ModelMessage, q as ToolDefinition, r as ToolCallRequest, u as MessageUsage, w as AgentUiComponent, a as Actor, x as AiToolCtx, A as AgentStreamEvent, T as ToolSpec, Q as QuotaState, y as AgentRunInput, H as HumanReply, z as MessageAttachment, B as ActionProposalMutationResult, D as ActionProposal, E as ActionProposalExecution, F as ActionProposalOutcomeDelivery, b as ToolHandler, G as AgentDefinition, I as Persona, J as PersonaCatalogEntry, K as HistoryPolicy, L as PageContext, N as AgentStore, O as AgentDelegation, R as DetachedDelivery, S as ToolDescribeScope, V as ToolPreflightResult, W as ApprovalPolicy, X as PromptBuilder, Y as PromptContributor, Z as ToolTransientRetrySetting, _ as AgentIntake, $ as Decision, a0 as ElicitationRequest, a1 as LlmStepEnvelope, a2 as ToolStepEnvelope, a3 as ClaimActionProposal, a4 as ActionProposalStore, a5 as ActionProposalStoreOptions, a6 as CreateActionProposal, a7 as CreateActionProposalResult, a8 as ActionProposalScope, a9 as ListActionProposals, aa as ActionProposalDecisionCommand, ab as ExtendActionProposalLease, ac as SettleActionProposal, ad as ActionProposalOutcome, ae as ActionProposalOutcomeLease, af as ToolCallStatus, ag as ChatQueueStore, ah as ActionProposalOutcomeStore, ai as CreateThreadInput, aj as ThreadSummary, ak as ThreadDetail, al as ToolCallApprovalState, am as UpdateThreadInput, an as RecordRunStartInput, ao as EnqueueMessageInput, ap as QueuedMessage, aq as QueuedMessagePatch, ar as QueuePause, as as AppendMessageInput, at as StoredMessage, au as ToolResult, av as MessageFeedback, aw as RecordToolCallInput, ax as ToolCallOutcome, ay as UpdateToolCallInput, az as RecordUsageInput, aA as ToolConfirmation, aB as ActionProposalDecision, aC as ActionProposalSupersessionStore } from './stream-events-D92SgfRk.js';
2
+ export { aD as ALL_AGENTS, aE as ASK_TOOL_DESCRIPTION, aF as ASK_TOOL_NAME, aG as ActionProposalDecisionAudit, aH as ActionProposalExecutionContext, aI as ActionProposalLease, aJ as AgentApprovalRequest, aK as AgentApprovalSettlement, aL as AgentAttachmentConfig, aM as AgentCatalogEntry, aN as AgentClientConfig, aO as AgentHistoryWindow, aP as AgentHostContext, aQ as AgentStreamErrorCode, aR as ApprovalDecisionRef, aS as ApprovalRequirement, aT as ApprovalThreadRef, aU as ApprovalToolRef, aV as AskToolInput, aW as ChatQueueState, aX as ClaimedActionApproval, aY as DEFAULT_INTAKE_PREAMBLE, aZ as DEFAULT_TOOL_TRANSIENT_RETRY_ATTEMPTS, a_ as DEFAULT_TOOL_TRANSIENT_RETRY_BACKOFF_MS, a$ as DefaultApprovalPolicy, b0 as ELICITATION_INPUT_TYPES, b1 as ElicitationInput, b2 as ElicitationInputType, b3 as ElicitationOption, b4 as ElicitationOutcome, b5 as ElicitationQuestion, b6 as ElicitationReply, b7 as ElicitationResult, b8 as EmitUiOptions, b9 as HistoryPolicyContext, ba as HistorySelection, bb as HistorySummary, bc as InvokeWithTransientRetryOptions, bd as MAX_ASK_QUESTIONS, be as MessageFeedbackValue, bf as MessageRole, bg as PersonaRef, bh as PromptContext, bi as QueuePauseReason, bj as QueuedMessageView, bk as QuotaView, bl as REQUESTER_APPROVER, bm as RUN_ENDED_BEFORE_TOOL_CALL, bn as RecordRunEndInput, bo as ResolveActionProposalApprovalInput, bp as ThreadTurnPage, bq as ThreadTurnQuery, br as ThreadTurnReader, bs as ToolCallApproval, bt as ToolCallApprovalColumns, bu as ToolCallApprovalStatus, bv as ToolCatalogEntry, bw as ToolDescription, bx as ToolKind, by as ToolPreflightOptions, c as ToolPresentation, bz as ToolPresentationTone, bA as ToolResultField, bB as ToolResultView, bC as ToolStepCtx, bD as ToolTransientRetryNumbers, bE as ToolTransientRetryOptions, bF as TurnPersona, bG as UNFINISHED_TOOL_CALL, bH as UsagePurpose, bI as askInputSchema, bJ as askToolDefinition, bK as danglingToolCallIds, bL as decodeStreamEvent, bM as defaultCanDecide, bN as encodeStreamEvent, bO as invokeWithTransientRetry, bP as isChatQueueStore, bQ as isTransientToolError, bR as isTypedQuestion, bS as mayDecideApproval, bT as normalizeElicitationReply, bU as questionOptions, bV as queuedMessageView, bW as readElicitationInput, bX as readElicitationQuestions, bY as releaseThreadRun, bZ as renderElicitationAnswers, b_ as resolveActionProposalApproval, b$ as resolveElicitation, c0 as resolveToolTransientRetryNumbers, c1 as settleDanglingToolCalls, c2 as settleElicitation, c3 as toolCallApprovalFromRow, c4 as validateElicitationAnswer, c5 as validateElicitationValue } from './stream-events-D92SgfRk.js';
3
3
  import { StandardSchemaV1 } from '@standard-schema/spec';
4
- import { O as OutputProcessor, P as ProcessorContext, I as InputProcessor, a as ProcessedPrompt, M as ModelAnswer } from './processors-BR3nICcp.js';
5
- export { D as DEFAULT_INCREMENTAL_LOOKBACK_CHARS, b as IncrementalGating, c as OutputRejectedError, d as OutputVerdict, e as ProcessorFailedError } from './processors-BR3nICcp.js';
6
- import { a as Catalog } from './catalog-CrzetM3_.js';
4
+ import { O as OutputProcessor, P as ProcessorContext, I as InputProcessor, a as ProcessedPrompt, M as ModelAnswer } from './processors-BKILjME5.js';
5
+ export { D as DEFAULT_INCREMENTAL_LOOKBACK_CHARS, b as IncrementalGating, c as OutputRejectedError, d as OutputVerdict, e as ProcessorFailedError } from './processors-BKILjME5.js';
6
+ import { a as Catalog } from './catalog-BKS3Yxo6.js';
7
7
  import { ChannelRegistry } from '@dudousxd/nestjs-diagnostics';
8
8
 
9
9
  /**
@@ -29,6 +29,11 @@ declare const AGENT_DURABLE_RUNNER: unique symbol;
29
29
  declare const AGENT_SINK: unique symbol;
30
30
  declare const AGENT_MODEL: unique symbol;
31
31
  declare const AGENT_ROLES_POLICY: unique symbol;
32
+ /**
33
+ * @deprecated Nothing binds or injects this token since the quota rework (#230): `AgentModule`
34
+ * enforces and reports the budget through {@link AGENT_QUOTA_PROVIDER}, configured with
35
+ * `AgentModule.forRoot({ quota })`. Inject `AGENT_QUOTA_PROVIDER` instead. Removed in the next major.
36
+ */
32
37
  declare const AGENT_QUOTA_STORE: unique symbol;
33
38
  declare const AGENT_TOOL_REGISTRY: unique symbol;
34
39
  declare const AGENT_REGISTRY: unique symbol;
@@ -449,7 +454,7 @@ interface QuotaQuery {
449
454
  }
450
455
  /**
451
456
  * The actor's budget across windows — the read behind `GET <base>/quota` and, when the host binds
452
- * one (`AgentModule.forRoot({ quotaProvider })`), the gate a send passes: a report with `blocked`
457
+ * one (`AgentModule.forRoot({ quota })`), the gate a send passes: a report with `blocked`
453
458
  * refuses the turn with `429` before it starts.
454
459
  *
455
460
  * The default reads the usage ledger (`LedgerQuotaProvider` in `@dudousxd/nestjs-agent`); a host
@@ -584,6 +589,12 @@ interface AgentRunner {
584
589
  start(input: AgentRunInput, options?: AgentRunStartOptions): Promise<{
585
590
  runId: string;
586
591
  }>;
592
+ /**
593
+ * OPTIONAL: the id a run of `input` should have, when the caller mints one before starting it (the
594
+ * chat queue claims a thread under the id first). A host whose ids carry meaning — a tenant
595
+ * prefix its durable store partitions by — answers here. Absent → a random UUID.
596
+ */
597
+ runIdFor?(input: AgentRunInput): string;
587
598
  /**
588
599
  * OPTIONAL: whether `runId` is still running (or parked, or about to start) as far as this runner
589
600
  * can tell. Asked when a thread's admission is held by a run, to tell a live holder from a stale
@@ -1136,6 +1147,26 @@ interface AttachmentStagingDescription {
1136
1147
  upload?: 'multipart' | 'resumable';
1137
1148
  }
1138
1149
 
1150
+ /**
1151
+ * What leaves the server about a proposal — the routes, a text decision's answer, AG-UI, the approval
1152
+ * port. The stored row minus what only the worker and the store may hold: the execution and
1153
+ * delivery leases (whose token lets a holder settle the work), the idempotency key the tool's side
1154
+ * effect is keyed on, and the execution address (the original preparation input and the request's
1155
+ * context).
1156
+ */
1157
+ interface ActionProposalView extends Omit<ActionProposal, 'execution' | 'outcomeDelivery' | 'idempotencyKey' | 'preparationInput' | 'executionContext'> {
1158
+ execution: Omit<ActionProposalExecution, 'lease'> | null;
1159
+ outcomeDelivery?: Omit<ActionProposalOutcomeDelivery, 'lease'>;
1160
+ }
1161
+ /** {@link ActionProposalMutationResult} with its proposal as an {@link ActionProposalView}. */
1162
+ interface ActionProposalMutationView extends Omit<ActionProposalMutationResult, 'proposal'> {
1163
+ proposal?: ActionProposalView;
1164
+ }
1165
+ /** The public view of a stored proposal. See {@link ActionProposalView}. */
1166
+ declare function toActionProposalView(proposal: ActionProposal): ActionProposalView;
1167
+ /** The public view of a mutation's answer. See {@link ActionProposalView}. */
1168
+ declare function toActionProposalMutationView(result: ActionProposalMutationResult): ActionProposalMutationView;
1169
+
1139
1170
  /**
1140
1171
  * Console-side HITL decisions. Implemented by the agent runtime (the nestjs package binds it to
1141
1172
  * the same signal path chat approvals use); the dashboard injects it OPTIONALLY — absent = the
@@ -1149,7 +1180,7 @@ interface AgentApprovalPort {
1149
1180
  }, opts?: {
1150
1181
  remember?: boolean;
1151
1182
  decidedVia?: string;
1152
- }): Promise<ActionProposalMutationResult>;
1183
+ }): Promise<ActionProposalMutationView>;
1153
1184
  rejectActionProposal?(actor: Actor, target: {
1154
1185
  kind: 'proposal';
1155
1186
  threadId: string;
@@ -1157,7 +1188,7 @@ interface AgentApprovalPort {
1157
1188
  }, opts?: {
1158
1189
  reason?: string;
1159
1190
  decidedVia?: string;
1160
- }): Promise<ActionProposalMutationResult>;
1191
+ }): Promise<ActionProposalMutationView>;
1161
1192
  /**
1162
1193
  * `remember` approves later calls of the same tool in the same thread; `decidedVia` names the
1163
1194
  * surface the decision came through (`'console'`, `'slack'`, …) and is persisted with the call.
@@ -2512,6 +2543,10 @@ declare class ToolInputDriftError extends Error {
2512
2543
  declare class ToolRegistry {
2513
2544
  private readonly entries;
2514
2545
  register(spec: ToolSpec, handler: ToolHandler): void;
2546
+ /** Whether a successful preflight shortcut has UI to journal. */
2547
+ hasPresentation(name: string): boolean;
2548
+ /** Present an already authorized successful domain result without executing its action again. */
2549
+ presentOutput(name: string, output: unknown, ctx: AiToolCtx): Promise<void>;
2515
2550
  has(name: string): boolean;
2516
2551
  /**
2517
2552
  * Give a name back, and report whether it was held. For an importer that registered tools on
@@ -2581,6 +2616,10 @@ interface ToolPreparationResult {
2581
2616
  * visitor included, when no resolver is configured); restrict with `@AiTool({ roles })` per tool,
2582
2617
  * `AgentModule.forRoot({ defaultRoles })` module-wide, or a `rolesPolicy` of your own. `action`
2583
2618
  * tools still park on approval either way.
2619
+ *
2620
+ * A tool gated by an `ability` and naming no `roles` is refused: this policy cannot evaluate an
2621
+ * ability, and falling through to the open default would hand the tool to everyone. Bind an
2622
+ * ability-aware policy (`AgentAuthzModule`) to reach it — or give the tool `roles` as well.
2584
2623
  */
2585
2624
  declare class DefaultRolesPolicy implements RolesPolicy {
2586
2625
  readonly defaultRoles: string[];
@@ -3172,10 +3211,22 @@ interface AgentToolCallEvent {
3172
3211
  status: string;
3173
3212
  durationMs?: number;
3174
3213
  }
3214
+ /**
3215
+ * A turn refused for budget. Published by the send gate (`429`) and the message queue when a
3216
+ * `QuotaProvider` reports `blocked`, and by the loop's own per-day `QuotaStore` gate. The figures
3217
+ * are the exhausted window's: a window that does not count tokens (a USD-only spend cap) carries no
3218
+ * token figures, never a made-up `0`.
3219
+ */
3175
3220
  interface AgentQuotaExceeded {
3176
3221
  actorId: string;
3177
- usedTokens: number;
3178
- limitTokens: number;
3222
+ /** The window that ran out. Absent from the loop's per-day `QuotaStore` gate. */
3223
+ period?: QuotaPeriod;
3224
+ /** The provider's words for the block, when it gave some. */
3225
+ reason?: string;
3226
+ usedTokens?: number;
3227
+ limitTokens?: number;
3228
+ usedUsd?: number;
3229
+ limitUsd?: number;
3179
3230
  }
3180
3231
  interface AgentRunFinished {
3181
3232
  runId: string;
@@ -4117,7 +4168,7 @@ type TextActionProposalResolution = {
4117
4168
  * resolve the authenticated actor and use the normal scoped decision service with via=text.
4118
4169
  * Never feed model output here or consume an unmatched message as an approval.
4119
4170
  */
4120
- declare function resolveTextActionProposalDecision(text: string, proposals: readonly TextActionProposalCandidate[]): TextActionProposalResolution;
4171
+ declare function resolveTextActionProposalDecision(text: string, proposals: readonly TextActionProposalCandidate[], vocabulary?: TextActionProposalVocabulary): TextActionProposalResolution;
4121
4172
  type TextActionProposalCommand = {
4122
4173
  status: 'unmatched';
4123
4174
  } | {
@@ -4126,8 +4177,54 @@ type TextActionProposalCommand = {
4126
4177
  remember: boolean;
4127
4178
  proposalId?: string;
4128
4179
  };
4180
+ /**
4181
+ * The words a whole chat message must consist of to decide a proposal by text. Matched
4182
+ * case-insensitively, as the complete message (an optional trailing `.`/`!`, an optional `#ID`).
4183
+ */
4184
+ interface TextActionProposalVocabulary {
4185
+ /** Approve, e.g. `sim`, `yes`. */
4186
+ approve: readonly string[];
4187
+ /** Reject, e.g. `não`, `no`. */
4188
+ reject: readonly string[];
4189
+ /** The phrase after an approve word that also approves later calls of the tool in this thread. */
4190
+ remember: readonly string[];
4191
+ }
4192
+ /**
4193
+ * English. Portuguese ships as {@link ptBrActionProposalText}; any other language through
4194
+ * `AgentModule.forRoot({ actionProposalText })`.
4195
+ */
4196
+ declare const DEFAULT_TEXT_ACTION_PROPOSAL_VOCABULARY: TextActionProposalVocabulary;
4197
+ /** What the agent answers to a text decision. Every field has an English default. */
4198
+ interface TextActionProposalReplies {
4199
+ approved: string;
4200
+ rejected: string;
4201
+ expired: string;
4202
+ /** The proposal could not change (already decided by someone else, superseded, …). */
4203
+ unchanged: string;
4204
+ /** More than one pending proposal could be meant: ask for the `#ID`. */
4205
+ ambiguous(proposalIds: readonly string[]): string;
4206
+ /** Too many pending proposals to pick one without an explicit `#ID`. */
4207
+ tooMany: string;
4208
+ }
4209
+ declare const DEFAULT_TEXT_ACTION_PROPOSAL_REPLIES: TextActionProposalReplies;
4210
+ /** `AgentModule.forRoot({ actionProposalText })`: either part replaces the default it names. */
4211
+ interface TextActionProposalConfig {
4212
+ vocabulary?: Partial<TextActionProposalVocabulary>;
4213
+ replies?: Partial<TextActionProposalReplies>;
4214
+ }
4215
+ /** The reply to a decision the store answered with `result`. */
4216
+ declare function textActionProposalReply(result: Pick<ActionProposalMutationResult, 'status'> & {
4217
+ proposal?: {
4218
+ decision: ActionProposalDecision;
4219
+ };
4220
+ }, decision: 'approved' | 'rejected', replies?: TextActionProposalReplies): string;
4129
4221
  /** Parse exact consent syntax only. Authentication and target lookup remain the caller's responsibility. */
4130
- declare function parseTextActionProposalCommand(text: string): TextActionProposalCommand;
4222
+ declare function parseTextActionProposalCommand(text: string, vocabulary?: TextActionProposalVocabulary): TextActionProposalCommand;
4223
+ /**
4224
+ * Brazilian Portuguese text decisions — `AgentModule.forRoot({ actionProposalText: ptBrActionProposalText })`.
4225
+ * Commands in Portuguese (English ones still work), replies in Portuguese.
4226
+ */
4227
+ declare const ptBrActionProposalText: Required<TextActionProposalConfig>;
4131
4228
 
4132
4229
  interface ActionProposalExecutionDeps {
4133
4230
  registry: ToolRegistry;
@@ -4188,4 +4285,18 @@ declare class ActionProposalWorker {
4188
4285
  type ActionProposalRuntimeStore = AgentStore & ActionProposalStore & ActionProposalWorkerStore & ActionProposalOutcomeStore & ActionProposalSupersessionStore;
4189
4286
  declare function assertIndependentActionCapabilities(store: AgentStore, resolver: BackgroundActorResolver | undefined): asserts store is ActionProposalRuntimeStore;
4190
4287
 
4191
- export { AGENT_ACTOR_DIRECTORY, AGENT_ACTOR_RESOLVER, AGENT_APPROVAL_PORT, AGENT_ATTACHMENT_STAGING, AGENT_CONFIRM_TOKEN_STORE, AGENT_DEPS_FACTORY, AGENT_DIAGNOSTIC_EVENTS, AGENT_DURABLE_RUNNER, AGENT_EMBEDDING_PROVIDER, AGENT_GOVERNANCE_QUERIES, AGENT_MEMORY, AGENT_MODEL, AGENT_MODEL_CATALOG, AGENT_OPTIONS, AGENT_PRICING_STORE, AGENT_PROMPT_CONTRIBUTORS, AGENT_QUOTA_PROVIDER, AGENT_QUOTA_STORE, AGENT_REGISTRY, AGENT_RETRIEVER, AGENT_ROLES_POLICY, AGENT_RUNNER, AGENT_SINK, AGENT_SKILLS, AGENT_SKILL_SOURCES, AGENT_SPAN_EVENTS, AGENT_STORE, AGENT_TOOL_REGISTRY, APPROVAL_EXPIRED_REASON, type ActionApprovalMode, ActionProposal, ActionProposalDecision, ActionProposalDecisionCommand, type ActionProposalDiscoveryIndexStore, type ActionProposalExecutionDeps, type ActionProposalExecutionResult, ActionProposalExecutor, type ActionProposalExecutorOptions, ActionProposalMutationResult, ActionProposalOutcome, ActionProposalOutcomeLease, ActionProposalOutcomeStore, type ActionProposalReceipt, type ActionProposalRuntimeStore, ActionProposalScope, ActionProposalStore, ActionProposalStoreOptions, ActionProposalSupersessionStore, type ActionProposalTarget, ActionProposalWorker, type ActionProposalWorkerOptions, type ActionProposalWorkerStore, Actor, type ActorDirectory, type ActorResolver, type ActorSpendRow, type AgentApprovalPort, AgentDefinition, type AgentDelegated, AgentDelegation, type AgentDiagnosticEvent, type AgentDiagnosticKey, type AgentFollowUpsSpan, type AgentGovernanceQueries, AgentIntake, type AgentLlmTurnSpan, type AgentLoopDeps, type AgentLoopHooks, type AgentLoopResult, type AgentMemoryResolved, type AgentMemoryWritten, type AgentMessageEvent, type AgentPricingStore, type AgentQuotaExceeded, AgentRegistry, type AgentRetrievalSpan, type AgentRetrieved, type AgentRunFailed, type AgentRunFinished, AgentRunInput, type AgentRunStartOptions, type AgentRunStarted, type AgentRunner, type AgentSkillsResolved, type AgentSpanEvent, AgentStore, AgentStreamError, AgentStreamEvent, type AgentStructuredOutputSpan, type AgentToolCallEvent, type AgentToolExecutionSpan, type AgentToolRetry, AgentUiComponent, AiToolCtx, AppendMessageInput, ApprovalPolicy, type ApprovalWhere, type AttachmentRef, type AttachmentStagingDescription, type AttachmentStagingStore, type BackgroundActorResolver, type BufferedModelTurnResult, type BuildMemoryBlockInput, CONFIRM_JSON_SCHEMA_PROPERTIES, ChatQueueStore, ClaimActionProposal, ClosedRolesPolicy, type ConfirmFields, type ConfirmTokenClaim, ConfirmTokenError, type ConfirmTokenStore, type ConfirmTokenSubject, type ConfirmedTool, type ConfirmedToolDone, type ConfirmedToolMessages, type ConfirmedToolOptions, type ConfirmedToolOutcome, type ConfirmedToolPreview, type ConfirmedToolResult, type ConfirmedToolSteps, type CostUsage, CreateActionProposal, CreateActionProposalResult, CreateThreadInput, type CurrentModelPrice, DEFAULT_CONFIRM_TTL_MS, DEFAULT_HISTORY_SUMMARY_INSTRUCTION, DEFAULT_MAX_FACT_CHARS, DEFAULT_MAX_MEMORIES, DEFAULT_MAX_SKILLS, DEFAULT_REFUSAL_REASON, DEFAULT_STRUCTURED_OUTPUT_INSTRUCTION, Decision, DefaultRolesPolicy, type DetachedDelegationOutcome, type DetachedDelegationReceipt, DetachedDelivery, type DetailThreadRef, ElicitationRequest, type EmbeddingProvider, type EmitUi, type EmptyRoles, EnqueueMessageInput, ExtendActionProposalLease, type ForgetMemoryInput, type FrameBuffer, GLOBAL_SCOPE, type GovernanceMessageRow, type GovernancePage, type GovernancePageQuery, type GovernancePendingApprovalRow, type GovernanceRange, type GovernanceRunDetail, type GovernanceRunRow, type GovernanceThreadDetail, type GovernanceThreadDetailQuery, type GovernanceThreadRow, type GovernanceToolCallRow, type GovernanceUsageInput, type GovernanceUsageRow, HistoryPolicy, HumanReply, InMemoryActionProposalStore, InMemoryAgentStore, InMemoryConfirmTokenStore, type IncrementalGate, InputProcessor, type InvokeOptions, ListActionProposals, type ListMemoriesInput, type ListSkillsInput, type ListStagedAttachmentsInput, LlmStepEnvelope, type LoadSkillInput, type MemoryAuthor, type MemoryConfig, type MemoryDigest, type MemoryDigestEntry, type MemoryFact, type MemoryForgetRequest, type MemoryOrigin, type MemoryProvider, type MemoryRecord, type MemoryVerdict, type MemoryWriteOutcome, type MemoryWriteRequest, MessageAttachment, MessageFeedback, MessageUsage, ModelAnswer, type ModelCatalog, type ModelCatalogEntry, type ModelCatalogLock, type ModelCatalogProviderGroup, type ModelCatalogQuery, type ModelCatalogView, ModelMessage, type ModelPrice, type ModelPriceInput, type ModelProvider, type ModelSpendRow, type ModelTurnArgs, type ModelTurnResult, type NegotiatedUiCollector, type ObservedTurnFrames, type OfferMemoriesInput, type OutputGateMode, type OutputGateResult, OutputProcessor, type OverriddenMemory, PageContext, type Passage, type PendingApprovalRow, Persona, type PersonaAlias, PersonaCatalogEntry, type PrepareOptions, ProcessedPrompt, ProcessorContext, PromptBuilder, PromptContributor, QueuePause, QueuedMessage, QueuedMessagePatch, type QuotaBlock, QuotaExceededError, type QuotaPeriod, type QuotaProvider, type QuotaQuery, type QuotaReport, QuotaState, type QuotaStore, type QuotaWarning, type QuotaWindow, REMEMBER_TOOL_DESCRIPTION, REMEMBER_TOOL_NAME, RUN_FAILED_MESSAGE, RUN_NOT_ACTIVE_CODE, RUN_NOT_ACTIVE_MESSAGE, RUN_NO_LONGER_RUNNING, type RecentRunRow, RecordRunStartInput, RecordToolCallInput, RecordUsageInput, type RememberToolInput, type RerankOptions, type Reranker, type ResolveAttachmentInput, type ResolveMemoryDigestInput, type ResolveToolUiCatalog, type ResolvedDelegation, type RetrieveOptions, type Retriever, type RolesPolicy, type RolesPolicyOptions, type RunAgentBreakdownRow, RunCancelledError, type RunErrorBreakdownRow, type RunMetrics, type RunToolCallRow, type RunTrendPoint, type RunWhere, SCHEMA_EXTENSION, SKILL_TOOL_DESCRIPTION, SKILL_TOOL_NAME, type SchemaExtension, type ScopeContext, type ScopeResolver, type SearchMemoriesInput, SettleActionProposal, type SettleDeadRunInput, type SettledTask, type SinkWriter, type Skill, type SkillAuthor, type SkillCatalogEntry, type SkillContext, type SkillLoadOutcome, type SkillOffer, type SkillProvider, type SkillSummary, type SkillToolInput, type SkillWriteRequest, type SkillWriteVerdict, type SkillsConfig, SqlTokenStreamSink, type SqlTokenStreamSinkOptions, type StageAttachmentInput, type StagedAttachment, type StoreMemoryInput, StoredMessage, type StreamError, type StreamFrameRow, type StreamFrameTable, type StructuredOutcome, StructuredOutputError, THREAD_DETAIL_CONTENT_CHARS, type TextActionProposalCandidate, type TextActionProposalCommand, type TextActionProposalResolution, type ThreadActivityRow, ThreadDetail, type ThreadMessageRow, type ThreadMeta, type ThreadSpendRow, ThreadSummary, type ThreadUsageRollup, type ThreadWhere, type TokenStreamSink, type ToolCallActivityRow, ToolCallApprovalState, ToolCallOutcome, ToolCallRequest, ToolCallStatus, type ToolCallWhere, ToolConfirmation, ToolDefinition, ToolDescribeScope, ToolDisabledError, ToolForbiddenError, ToolHandler, ToolInputDriftError, ToolInputInvalidError, type ToolKindDeps, ToolNotFoundError, ToolPreflightDeniedError, ToolPreflightResult, type ToolPreparationResult, ToolRegistry, ToolResult, ToolSpec, type ToolStatRow, ToolStepEnvelope, ToolTransientRetrySetting, type TurnFrameSummary, type UiCollector, UpdateThreadInput, UpdateToolCallInput, type UsageTrendPoint, type WindowHistoryOptions, type WithMemoryToolInput, type WriteMemoryInput, actionProposalCreationMatches, actionProposalOutcomeFenceValid, actionProposalOutcomeScope, actionProposalOutcomeText, actionProposalReceipt, actionProposalScopeMatches, actorScope, agentDiagnosticKey, agentFailureCode, assertIndependentActionCapabilities, attachActionProposalOutcome, bucketByActor, bucketByModel, bucketByThread, bucketUsageTrend, buildMemoryBlock, buildSkillsBlock, canActorUseTool, canonicalActionProposalJson, canonicalJson, claimActionProposalOutcome, closeEmptyRoles, compositeSkillProvider, confirmTokenExpiry, createFrameBuffer, createIncrementalGate, createNegotiatedUiCollector, createNoopEmitUi, createUiCollector, dayBoundsUtc, defaultScopeResolver, defineConfirmedTool, detachedDelivered, detachedStarted, detachedUnsettled, escapeUnsafeToolUiText, estimateCost, estimateMessageTokens, exhaustedWindow, exposeStreamErrorDetails, extractJson, filterToolsByAllowList, filterToolsByCanUse, filterToolsByEnabled, filterToolsByRole, findCatalogModel, findPersona, gateFollowUps, gateTail, hashConfirmToken, initialActionProposal, intersectAllowLists, isControlFlowSignal, isReplayIntegrityError, isToolEnabled, loadSkill, memoryForgetVerdict, memoryWriteVerdict, mergeUi, normalizeDelegation, observeTurnFrames, offerMemories, offerSkills, parseTextActionProposalCommand, personaCatalogEntry, prepareActionProposal, publishAgentDelegated, publishAgentMemoryResolved, publishAgentMemoryWritten, publishAgentMessage, publishAgentQuotaExceeded, publishAgentRetrieved, publishAgentRunFailed, publishAgentRunFinished, publishAgentRunStarted, publishAgentSkillsResolved, publishAgentToolCall, publishAgentToolRetry, quotaPeriodRange, quotaUsedRatio, quotaWarning, releaseGatedFrames, rememberInputSchema, rememberToolDefinition, repairInstruction, resolveGateLookback, resolveMemoryDigest, resolveOutputGateMode, resolvePersonaAlias, resolveSkillCatalog, resolveTextActionProposalDecision, rollupThreadUsage, runAgentLoop, runInputProcessors, runOutputProcessors, schemaExtensionOf, seedModelPrices, settleAll, settleDeadRun, settleUnsettledDelegation, signConfirmToken, skillInputSchema, skillToolDefinition, skillWriteVerdict, snapshotActionProposal, stampToolKinds, staticModelCatalog, staticSkillProvider, streamFailure, summarizeWithModel, tenantScope, toolCallContext, traceLlmTurn, traceToolExecution, transitionActionProposalClaim, transitionActionProposalDecision, transitionActionProposalLease, transitionActionProposalSettlement, transitionActionProposalSupersession, truncateDetailContent, unwrapToolStepOutput, validateActionProposalCreation, validateActionProposalDiscoveryIndexBatch, validateActionProposalExpiryBatch, validateActionProposalListQuery, validateActionProposalWorkerClaim, validateStructured, verifyConfirmToken, windowHistory, withAskTool, withConfirmFields, withMemoryTool, withSelectedModel, withSkillTool, withToolTimeout, withTurnFrames, wrapToolPreflightDenied, wrapToolStepOutput, writeMemory };
4288
+ interface FunctionalTool<I = unknown, O = unknown> {
4289
+ spec: ToolSpec;
4290
+ handler: ToolHandler<I, O>;
4291
+ }
4292
+ type FunctionalToolDefinition<I, O> = Omit<ToolSpec, 'inputSchema' | 'kind'> & {
4293
+ input: StandardSchemaV1<unknown, I>;
4294
+ kind?: ToolSpec['kind'];
4295
+ } & ToolHandler<I, O>;
4296
+ /** Framework-independent authoring; every method keeps the author's object as its receiver. */
4297
+ declare function createFunctionalTool<I, O>(definition: FunctionalToolDefinition<I, O>): FunctionalTool<I, O>;
4298
+
4299
+ /** Presentation failures must never cause a successful side effect to be retried. */
4300
+ declare function emitToolPresentations<I, O>(handler: ToolHandler<I, O>, output: O, ctx: AiToolCtx, toolName: string): Promise<void>;
4301
+
4302
+ export { AGENT_ACTOR_DIRECTORY, AGENT_ACTOR_RESOLVER, AGENT_APPROVAL_PORT, AGENT_ATTACHMENT_STAGING, AGENT_CONFIRM_TOKEN_STORE, AGENT_DEPS_FACTORY, AGENT_DIAGNOSTIC_EVENTS, AGENT_DURABLE_RUNNER, AGENT_EMBEDDING_PROVIDER, AGENT_GOVERNANCE_QUERIES, AGENT_MEMORY, AGENT_MODEL, AGENT_MODEL_CATALOG, AGENT_OPTIONS, AGENT_PRICING_STORE, AGENT_PROMPT_CONTRIBUTORS, AGENT_QUOTA_PROVIDER, AGENT_QUOTA_STORE, AGENT_REGISTRY, AGENT_RETRIEVER, AGENT_ROLES_POLICY, AGENT_RUNNER, AGENT_SINK, AGENT_SKILLS, AGENT_SKILL_SOURCES, AGENT_SPAN_EVENTS, AGENT_STORE, AGENT_TOOL_REGISTRY, APPROVAL_EXPIRED_REASON, type ActionApprovalMode, ActionProposal, ActionProposalDecision, ActionProposalDecisionCommand, type ActionProposalDiscoveryIndexStore, ActionProposalExecution, type ActionProposalExecutionDeps, type ActionProposalExecutionResult, ActionProposalExecutor, type ActionProposalExecutorOptions, ActionProposalMutationResult, type ActionProposalMutationView, ActionProposalOutcome, ActionProposalOutcomeDelivery, ActionProposalOutcomeLease, ActionProposalOutcomeStore, type ActionProposalReceipt, type ActionProposalRuntimeStore, ActionProposalScope, ActionProposalStore, ActionProposalStoreOptions, ActionProposalSupersessionStore, type ActionProposalTarget, type ActionProposalView, ActionProposalWorker, type ActionProposalWorkerOptions, type ActionProposalWorkerStore, Actor, type ActorDirectory, type ActorResolver, type ActorSpendRow, type AgentApprovalPort, AgentDefinition, type AgentDelegated, AgentDelegation, type AgentDiagnosticEvent, type AgentDiagnosticKey, type AgentFollowUpsSpan, type AgentGovernanceQueries, AgentIntake, type AgentLlmTurnSpan, type AgentLoopDeps, type AgentLoopHooks, type AgentLoopResult, type AgentMemoryResolved, type AgentMemoryWritten, type AgentMessageEvent, type AgentPricingStore, type AgentQuotaExceeded, AgentRegistry, type AgentRetrievalSpan, type AgentRetrieved, type AgentRunFailed, type AgentRunFinished, AgentRunInput, type AgentRunStartOptions, type AgentRunStarted, type AgentRunner, type AgentSkillsResolved, type AgentSpanEvent, AgentStore, AgentStreamError, AgentStreamEvent, type AgentStructuredOutputSpan, type AgentToolCallEvent, type AgentToolExecutionSpan, type AgentToolRetry, AgentUiComponent, AiToolCtx, AppendMessageInput, ApprovalPolicy, type ApprovalWhere, type AttachmentRef, type AttachmentStagingDescription, type AttachmentStagingStore, type BackgroundActorResolver, type BufferedModelTurnResult, type BuildMemoryBlockInput, CONFIRM_JSON_SCHEMA_PROPERTIES, ChatQueueStore, ClaimActionProposal, ClosedRolesPolicy, type ConfirmFields, type ConfirmTokenClaim, ConfirmTokenError, type ConfirmTokenStore, type ConfirmTokenSubject, type ConfirmedTool, type ConfirmedToolDone, type ConfirmedToolMessages, type ConfirmedToolOptions, type ConfirmedToolOutcome, type ConfirmedToolPreview, type ConfirmedToolResult, type ConfirmedToolSteps, type CostUsage, CreateActionProposal, CreateActionProposalResult, CreateThreadInput, type CurrentModelPrice, DEFAULT_CONFIRM_TTL_MS, DEFAULT_HISTORY_SUMMARY_INSTRUCTION, DEFAULT_MAX_FACT_CHARS, DEFAULT_MAX_MEMORIES, DEFAULT_MAX_SKILLS, DEFAULT_REFUSAL_REASON, DEFAULT_STRUCTURED_OUTPUT_INSTRUCTION, DEFAULT_TEXT_ACTION_PROPOSAL_REPLIES, DEFAULT_TEXT_ACTION_PROPOSAL_VOCABULARY, Decision, DefaultRolesPolicy, type DetachedDelegationOutcome, type DetachedDelegationReceipt, DetachedDelivery, type DetailThreadRef, ElicitationRequest, type EmbeddingProvider, type EmitUi, type EmptyRoles, EnqueueMessageInput, ExtendActionProposalLease, type ForgetMemoryInput, type FrameBuffer, type FunctionalTool, type FunctionalToolDefinition, GLOBAL_SCOPE, type GovernanceMessageRow, type GovernancePage, type GovernancePageQuery, type GovernancePendingApprovalRow, type GovernanceRange, type GovernanceRunDetail, type GovernanceRunRow, type GovernanceThreadDetail, type GovernanceThreadDetailQuery, type GovernanceThreadRow, type GovernanceToolCallRow, type GovernanceUsageInput, type GovernanceUsageRow, HistoryPolicy, HumanReply, InMemoryActionProposalStore, InMemoryAgentStore, InMemoryConfirmTokenStore, type IncrementalGate, InputProcessor, type InvokeOptions, ListActionProposals, type ListMemoriesInput, type ListSkillsInput, type ListStagedAttachmentsInput, LlmStepEnvelope, type LoadSkillInput, type MemoryAuthor, type MemoryConfig, type MemoryDigest, type MemoryDigestEntry, type MemoryFact, type MemoryForgetRequest, type MemoryOrigin, type MemoryProvider, type MemoryRecord, type MemoryVerdict, type MemoryWriteOutcome, type MemoryWriteRequest, MessageAttachment, MessageFeedback, MessageUsage, ModelAnswer, type ModelCatalog, type ModelCatalogEntry, type ModelCatalogLock, type ModelCatalogProviderGroup, type ModelCatalogQuery, type ModelCatalogView, ModelMessage, type ModelPrice, type ModelPriceInput, type ModelProvider, type ModelSpendRow, type ModelTurnArgs, type ModelTurnResult, type NegotiatedUiCollector, type ObservedTurnFrames, type OfferMemoriesInput, type OutputGateMode, type OutputGateResult, OutputProcessor, type OverriddenMemory, PageContext, type Passage, type PendingApprovalRow, Persona, type PersonaAlias, PersonaCatalogEntry, type PrepareOptions, ProcessedPrompt, ProcessorContext, PromptBuilder, PromptContributor, QueuePause, QueuedMessage, QueuedMessagePatch, type QuotaBlock, QuotaExceededError, type QuotaPeriod, type QuotaProvider, type QuotaQuery, type QuotaReport, QuotaState, type QuotaStore, type QuotaWarning, type QuotaWindow, REMEMBER_TOOL_DESCRIPTION, REMEMBER_TOOL_NAME, RUN_FAILED_MESSAGE, RUN_NOT_ACTIVE_CODE, RUN_NOT_ACTIVE_MESSAGE, RUN_NO_LONGER_RUNNING, type RecentRunRow, RecordRunStartInput, RecordToolCallInput, RecordUsageInput, type RememberToolInput, type RerankOptions, type Reranker, type ResolveAttachmentInput, type ResolveMemoryDigestInput, type ResolveToolUiCatalog, type ResolvedDelegation, type RetrieveOptions, type Retriever, type RolesPolicy, type RolesPolicyOptions, type RunAgentBreakdownRow, RunCancelledError, type RunErrorBreakdownRow, type RunMetrics, type RunToolCallRow, type RunTrendPoint, type RunWhere, SCHEMA_EXTENSION, SKILL_TOOL_DESCRIPTION, SKILL_TOOL_NAME, type SchemaExtension, type ScopeContext, type ScopeResolver, type SearchMemoriesInput, SettleActionProposal, type SettleDeadRunInput, type SettledTask, type SinkWriter, type Skill, type SkillAuthor, type SkillCatalogEntry, type SkillContext, type SkillLoadOutcome, type SkillOffer, type SkillProvider, type SkillSummary, type SkillToolInput, type SkillWriteRequest, type SkillWriteVerdict, type SkillsConfig, SqlTokenStreamSink, type SqlTokenStreamSinkOptions, type StageAttachmentInput, type StagedAttachment, type StoreMemoryInput, StoredMessage, type StreamError, type StreamFrameRow, type StreamFrameTable, type StructuredOutcome, StructuredOutputError, THREAD_DETAIL_CONTENT_CHARS, type TextActionProposalCandidate, type TextActionProposalCommand, type TextActionProposalConfig, type TextActionProposalReplies, type TextActionProposalResolution, type TextActionProposalVocabulary, type ThreadActivityRow, ThreadDetail, type ThreadMessageRow, type ThreadMeta, type ThreadSpendRow, ThreadSummary, type ThreadUsageRollup, type ThreadWhere, type TokenStreamSink, type ToolCallActivityRow, ToolCallApprovalState, ToolCallOutcome, ToolCallRequest, ToolCallStatus, type ToolCallWhere, ToolConfirmation, ToolDefinition, ToolDescribeScope, ToolDisabledError, ToolForbiddenError, ToolHandler, ToolInputDriftError, ToolInputInvalidError, type ToolKindDeps, ToolNotFoundError, ToolPreflightDeniedError, ToolPreflightResult, type ToolPreparationResult, ToolRegistry, ToolResult, ToolSpec, type ToolStatRow, ToolStepEnvelope, ToolTransientRetrySetting, type TurnFrameSummary, type UiCollector, UpdateThreadInput, UpdateToolCallInput, type UsageTrendPoint, type WindowHistoryOptions, type WithMemoryToolInput, type WriteMemoryInput, actionProposalCreationMatches, actionProposalOutcomeFenceValid, actionProposalOutcomeScope, actionProposalOutcomeText, actionProposalReceipt, actionProposalScopeMatches, actorScope, agentDiagnosticKey, agentFailureCode, assertIndependentActionCapabilities, attachActionProposalOutcome, bucketByActor, bucketByModel, bucketByThread, bucketUsageTrend, buildMemoryBlock, buildSkillsBlock, canActorUseTool, canonicalActionProposalJson, canonicalJson, claimActionProposalOutcome, closeEmptyRoles, compositeSkillProvider, confirmTokenExpiry, createFrameBuffer, createFunctionalTool, createIncrementalGate, createNegotiatedUiCollector, createNoopEmitUi, createUiCollector, dayBoundsUtc, defaultScopeResolver, defineConfirmedTool, detachedDelivered, detachedStarted, detachedUnsettled, emitToolPresentations, escapeUnsafeToolUiText, estimateCost, estimateMessageTokens, exhaustedWindow, exposeStreamErrorDetails, extractJson, filterToolsByAllowList, filterToolsByCanUse, filterToolsByEnabled, filterToolsByRole, findCatalogModel, findPersona, gateFollowUps, gateTail, hashConfirmToken, initialActionProposal, intersectAllowLists, isControlFlowSignal, isReplayIntegrityError, isToolEnabled, loadSkill, memoryForgetVerdict, memoryWriteVerdict, mergeUi, normalizeDelegation, observeTurnFrames, offerMemories, offerSkills, parseTextActionProposalCommand, personaCatalogEntry, prepareActionProposal, ptBrActionProposalText, publishAgentDelegated, publishAgentMemoryResolved, publishAgentMemoryWritten, publishAgentMessage, publishAgentQuotaExceeded, publishAgentRetrieved, publishAgentRunFailed, publishAgentRunFinished, publishAgentRunStarted, publishAgentSkillsResolved, publishAgentToolCall, publishAgentToolRetry, quotaPeriodRange, quotaUsedRatio, quotaWarning, releaseGatedFrames, rememberInputSchema, rememberToolDefinition, repairInstruction, resolveGateLookback, resolveMemoryDigest, resolveOutputGateMode, resolvePersonaAlias, resolveSkillCatalog, resolveTextActionProposalDecision, rollupThreadUsage, runAgentLoop, runInputProcessors, runOutputProcessors, schemaExtensionOf, seedModelPrices, settleAll, settleDeadRun, settleUnsettledDelegation, signConfirmToken, skillInputSchema, skillToolDefinition, skillWriteVerdict, snapshotActionProposal, stampToolKinds, staticModelCatalog, staticSkillProvider, streamFailure, summarizeWithModel, tenantScope, textActionProposalReply, toActionProposalMutationView, toActionProposalView, toolCallContext, traceLlmTurn, traceToolExecution, transitionActionProposalClaim, transitionActionProposalDecision, transitionActionProposalLease, transitionActionProposalSettlement, transitionActionProposalSupersession, truncateDetailContent, unwrapToolStepOutput, validateActionProposalCreation, validateActionProposalDiscoveryIndexBatch, validateActionProposalExpiryBatch, validateActionProposalListQuery, validateActionProposalWorkerClaim, validateStructured, verifyConfirmToken, windowHistory, withAskTool, withConfirmFields, withMemoryTool, withSelectedModel, withSkillTool, withToolTimeout, withTurnFrames, wrapToolPreflightDenied, wrapToolStepOutput, writeMemory };