@dudousxd/nestjs-agent-core 0.41.0 → 0.42.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -1,9 +1,9 @@
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-CF-6-Y6L.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 AgentStreamErrorCode, aQ as ApprovalDecisionRef, aR as ApprovalRequirement, aS as ApprovalThreadRef, aT as ApprovalToolRef, aU as AskToolInput, aV as ChatQueueState, aW as ClaimedActionApproval, aX as DEFAULT_INTAKE_PREAMBLE, aY as DEFAULT_TOOL_TRANSIENT_RETRY_ATTEMPTS, aZ as DEFAULT_TOOL_TRANSIENT_RETRY_BACKOFF_MS, a_ as DefaultApprovalPolicy, a$ as ELICITATION_INPUT_TYPES, b0 as ElicitationInput, b1 as ElicitationInputType, b2 as ElicitationOption, b3 as ElicitationOutcome, b4 as ElicitationQuestion, b5 as ElicitationReply, b6 as ElicitationResult, b7 as EmitUiOptions, b8 as HistoryPolicyContext, b9 as HistorySelection, ba as HistorySummary, bb as InvokeWithTransientRetryOptions, bc as MAX_ASK_QUESTIONS, bd as MessageFeedbackValue, be as MessageRole, bf as PersonaRef, bg as PromptContext, bh as QueuePauseReason, bi as QueuedMessageView, bj as QuotaView, bk as REQUESTER_APPROVER, bl as RUN_ENDED_BEFORE_TOOL_CALL, bm as RecordRunEndInput, bn as ResolveActionProposalApprovalInput, bo as ThreadTurnPage, bp as ThreadTurnQuery, bq as ThreadTurnReader, br as ToolCallApproval, bs as ToolCallApprovalColumns, bt as ToolCallApprovalStatus, bu as ToolCatalogEntry, bv as ToolDescription, bw as ToolKind, bx as ToolPreflightOptions, c as ToolPresentation, by as ToolPresentationTone, bz as ToolResultField, bA as ToolResultView, bB as ToolStepCtx, bC as ToolTransientRetryNumbers, bD as ToolTransientRetryOptions, bE as TurnPersona, bF as UNFINISHED_TOOL_CALL, bG as UsagePurpose, bH as askInputSchema, bI as askToolDefinition, bJ as danglingToolCallIds, bK as decodeStreamEvent, bL as defaultCanDecide, bM as encodeStreamEvent, bN as invokeWithTransientRetry, bO as isChatQueueStore, bP as isTransientToolError, bQ as isTypedQuestion, bR as mayDecideApproval, bS as normalizeElicitationReply, bT as questionOptions, bU as queuedMessageView, bV as readElicitationInput, bW as readElicitationQuestions, bX as releaseThreadRun, bY as renderElicitationAnswers, bZ as resolveActionProposalApproval, b_ as resolveElicitation, b$ as resolveToolTransientRetryNumbers, c0 as settleDanglingToolCalls, c1 as settleElicitation, c2 as toolCallApprovalFromRow, c3 as validateElicitationAnswer, c4 as validateElicitationValue } from './stream-events-CF-6-Y6L.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-BfxJAckJ.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-BfxJAckJ.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-BXM-MNga.cjs';
5
- export { D as DEFAULT_INCREMENTAL_LOOKBACK_CHARS, b as IncrementalGating, c as OutputRejectedError, d as OutputVerdict, e as ProcessorFailedError } from './processors-BXM-MNga.cjs';
6
- import { a as Catalog } from './catalog-BKS3Yxo6.cjs';
4
+ import { O as OutputProcessor, P as ProcessorContext, I as InputProcessor, a as ProcessedPrompt, M as ModelAnswer } from './processors-BANqZT3O.cjs';
5
+ export { D as DEFAULT_INCREMENTAL_LOOKBACK_CHARS, b as IncrementalGating, c as OutputRejectedError, d as OutputVerdict, e as ProcessorFailedError } from './processors-BANqZT3O.cjs';
6
+ import { a as Catalog } from './catalog-G8usJpx5.cjs';
7
7
  import { ChannelRegistry } from '@dudousxd/nestjs-diagnostics';
8
8
 
9
9
  /**
@@ -589,6 +589,12 @@ interface AgentRunner {
589
589
  start(input: AgentRunInput, options?: AgentRunStartOptions): Promise<{
590
590
  runId: string;
591
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;
592
598
  /**
593
599
  * OPTIONAL: whether `runId` is still running (or parked, or about to start) as far as this runner
594
600
  * can tell. Asked when a thread's admission is held by a run, to tell a live holder from a stale
package/dist/index.d.ts CHANGED
@@ -1,9 +1,9 @@
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-BGKLD6RX.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 AgentStreamErrorCode, aQ as ApprovalDecisionRef, aR as ApprovalRequirement, aS as ApprovalThreadRef, aT as ApprovalToolRef, aU as AskToolInput, aV as ChatQueueState, aW as ClaimedActionApproval, aX as DEFAULT_INTAKE_PREAMBLE, aY as DEFAULT_TOOL_TRANSIENT_RETRY_ATTEMPTS, aZ as DEFAULT_TOOL_TRANSIENT_RETRY_BACKOFF_MS, a_ as DefaultApprovalPolicy, a$ as ELICITATION_INPUT_TYPES, b0 as ElicitationInput, b1 as ElicitationInputType, b2 as ElicitationOption, b3 as ElicitationOutcome, b4 as ElicitationQuestion, b5 as ElicitationReply, b6 as ElicitationResult, b7 as EmitUiOptions, b8 as HistoryPolicyContext, b9 as HistorySelection, ba as HistorySummary, bb as InvokeWithTransientRetryOptions, bc as MAX_ASK_QUESTIONS, bd as MessageFeedbackValue, be as MessageRole, bf as PersonaRef, bg as PromptContext, bh as QueuePauseReason, bi as QueuedMessageView, bj as QuotaView, bk as REQUESTER_APPROVER, bl as RUN_ENDED_BEFORE_TOOL_CALL, bm as RecordRunEndInput, bn as ResolveActionProposalApprovalInput, bo as ThreadTurnPage, bp as ThreadTurnQuery, bq as ThreadTurnReader, br as ToolCallApproval, bs as ToolCallApprovalColumns, bt as ToolCallApprovalStatus, bu as ToolCatalogEntry, bv as ToolDescription, bw as ToolKind, bx as ToolPreflightOptions, c as ToolPresentation, by as ToolPresentationTone, bz as ToolResultField, bA as ToolResultView, bB as ToolStepCtx, bC as ToolTransientRetryNumbers, bD as ToolTransientRetryOptions, bE as TurnPersona, bF as UNFINISHED_TOOL_CALL, bG as UsagePurpose, bH as askInputSchema, bI as askToolDefinition, bJ as danglingToolCallIds, bK as decodeStreamEvent, bL as defaultCanDecide, bM as encodeStreamEvent, bN as invokeWithTransientRetry, bO as isChatQueueStore, bP as isTransientToolError, bQ as isTypedQuestion, bR as mayDecideApproval, bS as normalizeElicitationReply, bT as questionOptions, bU as queuedMessageView, bV as readElicitationInput, bW as readElicitationQuestions, bX as releaseThreadRun, bY as renderElicitationAnswers, bZ as resolveActionProposalApproval, b_ as resolveElicitation, b$ as resolveToolTransientRetryNumbers, c0 as settleDanglingToolCalls, c1 as settleElicitation, c2 as toolCallApprovalFromRow, c3 as validateElicitationAnswer, c4 as validateElicitationValue } from './stream-events-BGKLD6RX.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-DFa2Do42.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-DFa2Do42.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-ByDr5POu.js';
5
- export { D as DEFAULT_INCREMENTAL_LOOKBACK_CHARS, b as IncrementalGating, c as OutputRejectedError, d as OutputVerdict, e as ProcessorFailedError } from './processors-ByDr5POu.js';
6
- import { a as Catalog } from './catalog-BKS3Yxo6.js';
4
+ import { O as OutputProcessor, P as ProcessorContext, I as InputProcessor, a as ProcessedPrompt, M as ModelAnswer } from './processors-C9mor-73.js';
5
+ export { D as DEFAULT_INCREMENTAL_LOOKBACK_CHARS, b as IncrementalGating, c as OutputRejectedError, d as OutputVerdict, e as ProcessorFailedError } from './processors-C9mor-73.js';
6
+ import { a as Catalog } from './catalog-G8usJpx5.js';
7
7
  import { ChannelRegistry } from '@dudousxd/nestjs-diagnostics';
8
8
 
9
9
  /**
@@ -589,6 +589,12 @@ interface AgentRunner {
589
589
  start(input: AgentRunInput, options?: AgentRunStartOptions): Promise<{
590
590
  runId: string;
591
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;
592
598
  /**
593
599
  * OPTIONAL: whether `runId` is still running (or parked, or about to start) as far as this runner
594
600
  * can tell. Asked when a thread's admission is held by a run, to tell a live holder from a stale
package/dist/index.js CHANGED
@@ -3310,32 +3310,31 @@ function componentToText(catalog, component, props) {
3310
3310
  const root = props.root;
3311
3311
  return root === void 0 ? "" : treeToText(catalog, root);
3312
3312
  }
3313
- const fallback = catalog.get(component)?.fallbackText;
3313
+ return ownText(catalog, component, props) ?? "";
3314
+ }
3315
+ __name(componentToText, "componentToText");
3316
+ function ownText(catalog, component, props) {
3317
+ const definition = catalog.get(component);
3318
+ const fallback = definition?.fallbackText;
3319
+ let failed = false;
3314
3320
  if (fallback !== void 0) {
3315
3321
  try {
3316
3322
  const text = fallback(props);
3317
3323
  if (typeof text === "string" && text.trim().length > 0) return text;
3318
3324
  } catch {
3325
+ failed = true;
3319
3326
  }
3320
3327
  }
3328
+ if (definition?.children === true && !failed) return void 0;
3321
3329
  return jsonBlock(props);
3322
3330
  }
3323
- __name(componentToText, "componentToText");
3331
+ __name(ownText, "ownText");
3324
3332
  function treeToText(catalog, root) {
3325
3333
  const out = [];
3326
3334
  const visit = /* @__PURE__ */ __name((node, depth) => {
3327
3335
  if (depth > 32) return;
3328
- const definition = catalog.get(node.type);
3329
- if (definition?.fallbackText !== void 0) {
3330
- try {
3331
- const text = definition.fallbackText(node.props);
3332
- out.push(typeof text === "string" && text.trim().length > 0 ? text : jsonBlock(node.props));
3333
- } catch {
3334
- out.push(jsonBlock(node.props));
3335
- }
3336
- } else if (definition?.children !== true) {
3337
- out.push(jsonBlock(node.props));
3338
- }
3336
+ const text = ownText(catalog, node.type, node.props);
3337
+ if (text !== void 0) out.push(text);
3339
3338
  for (const child of node.children ?? []) visit(child, depth + 1);
3340
3339
  }, "visit");
3341
3340
  visit(root, 0);
@@ -3918,18 +3917,49 @@ var Chart = defineComponent({
3918
3917
  "series",
3919
3918
  "data"
3920
3919
  ]),
3921
- fallbackText: /* @__PURE__ */ __name((props) => {
3922
- const series = props.series ?? [];
3923
- const data = props.data ?? [];
3924
- const first = series[0]?.key ?? "";
3925
- const max = Math.max(0, ...data.map((point) => Math.abs(Number(point[first]) || 0)));
3926
- const unit = props.unit ? ` ${s(props.unit)}` : "";
3927
- const lines = data.slice(0, 20).map((point) => `${s(point[props.xKey]).slice(0, 18).padEnd(18)} ${bar(Number(point[first]) || 0, max)} ${s(point[first])}${unit}`);
3928
- return `${heading(props)}\`\`\`
3920
+ fallbackText: /* @__PURE__ */ __name((props) => chartText(props), "fallbackText")
3921
+ });
3922
+ function chartText(props) {
3923
+ const series = (props.series ?? []).filter((each) => typeof each?.key === "string");
3924
+ const data = props.data ?? [];
3925
+ const unit = props.unit ? ` ${s(props.unit)}` : "";
3926
+ const labelOf = /* @__PURE__ */ __name((each) => s(each.label) || each.key, "labelOf");
3927
+ if (props.type === "line") {
3928
+ const columns = [
3929
+ {
3930
+ key: s(props.xKey),
3931
+ label: s(props.xKey)
3932
+ },
3933
+ ...series.map((each) => ({
3934
+ key: each.key,
3935
+ label: `${labelOf(each)}${unit}`
3936
+ }))
3937
+ ];
3938
+ return `${heading(props)}${textTable(columns, data, 20)}`;
3939
+ }
3940
+ const max = Math.max(0, ...data.flatMap((point) => series.map((each) => Math.abs(Number(point[each.key]) || 0))));
3941
+ const shown = data.slice(0, 20);
3942
+ const lines = [];
3943
+ if (series.length <= 1) {
3944
+ const key = series[0]?.key ?? "";
3945
+ for (const point of shown) {
3946
+ lines.push(`${s(point[props.xKey]).slice(0, 18).padEnd(18)} ${bar(Number(point[key]) || 0, max)} ${s(point[key])}${unit}`);
3947
+ }
3948
+ } else {
3949
+ const width = Math.min(18, Math.max(...series.map((each) => labelOf(each).length)));
3950
+ for (const point of shown) {
3951
+ lines.push(s(point[props.xKey]).slice(0, 18));
3952
+ for (const each of series) {
3953
+ lines.push(` ${labelOf(each).slice(0, width).padEnd(width)} ${bar(Number(point[each.key]) || 0, max)} ${s(point[each.key])}${unit}`);
3954
+ }
3955
+ }
3956
+ }
3957
+ if (data.length > shown.length) lines.push(`\u2026 ${data.length - shown.length} more points`);
3958
+ return `${heading(props)}\`\`\`
3929
3959
  ${lines.join("\n")}
3930
3960
  \`\`\``;
3931
- }, "fallbackText")
3932
- });
3961
+ }
3962
+ __name(chartText, "chartText");
3933
3963
  var KpiCards = defineComponent({
3934
3964
  name: "KpiCards",
3935
3965
  title: "KPI cards",
@@ -7751,6 +7781,9 @@ var InMemoryAgentStore = class extends InMemoryActionProposalStore {
7751
7781
  ...input.uiCapabilities !== void 0 ? {
7752
7782
  uiCapabilities: input.uiCapabilities
7753
7783
  } : {},
7784
+ ...input.hostContext !== void 0 ? {
7785
+ hostContext: input.hostContext
7786
+ } : {},
7754
7787
  ...input.interrupt === true ? {
7755
7788
  interrupt: true
7756
7789
  } : {},