@dudousxd/nestjs-agent-core 0.34.0 → 0.35.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ag-ui/index.cjs +1064 -0
- package/dist/ag-ui/index.cjs.map +1 -0
- package/dist/ag-ui/index.d.cts +479 -0
- package/dist/ag-ui/index.d.ts +479 -0
- package/dist/ag-ui/index.js +1025 -0
- package/dist/ag-ui/index.js.map +1 -0
- package/dist/genui/index.d.cts +2 -1
- package/dist/genui/index.d.ts +2 -1
- package/dist/guardrails/index.d.cts +3 -2
- package/dist/guardrails/index.d.ts +3 -2
- package/dist/index.cjs +11 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -4
- package/dist/index.d.ts +6 -4
- package/dist/index.js +11 -1
- package/dist/index.js.map +1 -1
- package/dist/{processors-CtrfAA0B.d.ts → processors-C0snQzZJ.d.cts} +1 -1
- package/dist/{processors-Bm2DniQ8.d.cts → processors-D5110pit.d.ts} +1 -1
- package/dist/{tool-C128TFWw.d.cts → stream-events-CgWqAI-1.d.cts} +455 -556
- package/dist/{tool-C128TFWw.d.ts → stream-events-CgWqAI-1.d.ts} +455 -556
- package/dist/tool-DklsS3JX.d.ts +119 -0
- package/dist/tool-DuJ-_qXM.d.cts +119 -0
- package/package.json +14 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import { M as ModelMessage, c as ToolDefinition, d as ToolCallRequest, e as MessageUsage, f as AgentUiComponent,
|
|
2
|
-
export {
|
|
1
|
+
import { M as ModelMessage, c as ToolDefinition, d as ToolCallRequest, e as MessageUsage, f as AgentUiComponent, a as Actor, A as AgentStreamEvent, T as ToolSpec, Q as QuotaState, g as AgentRunInput, H as HumanReply, h as MessageAttachment, i as ToolKind, j as ToolCallStatus, k as ToolCallApproval, l as HistoryPolicy, P as PageContext, m as AgentDefinition, n as AgentStore, o as AgentDelegation, D as DetachedDelivery, p as PromptBuilder, q as PromptContributor, r as ToolTransientRetrySetting, s as AgentIntake, t as Decision, E as ElicitationRequest, L as LlmStepEnvelope, u as ToolStepEnvelope, C as ChatQueueStore, v as CreateThreadInput, w as ThreadSummary, x as ThreadDetail, y as ToolCallApprovalState, U as UpdateThreadInput, R as RecordRunStartInput, z as EnqueueMessageInput, B as QueuedMessage, F as QueuedMessagePatch, G as QueuePause, I as AppendMessageInput, S as StoredMessage, J as ToolResult, K as MessageFeedback, N as RecordToolCallInput, O as ToolCallOutcome, V as UpdateToolCallInput, W as RecordUsageInput } from './stream-events-CgWqAI-1.cjs';
|
|
2
|
+
export { X as ALL_AGENTS, Y as ASK_TOOL_DESCRIPTION, Z as ASK_TOOL_NAME, _ as AgentApprovalRequest, $ as AgentApprovalSettlement, a0 as AgentAttachmentConfig, a1 as AgentCatalogEntry, a2 as AgentClientConfig, a3 as AgentHistoryWindow, a4 as AgentStreamErrorCode, a5 as AskToolInput, a6 as ChatQueueState, a7 as DEFAULT_INTAKE_PREAMBLE, a8 as DEFAULT_TOOL_TRANSIENT_RETRY_ATTEMPTS, a9 as DEFAULT_TOOL_TRANSIENT_RETRY_BACKOFF_MS, aa as ELICITATION_INPUT_TYPES, ab as ElicitationInput, ac as ElicitationInputType, ad as ElicitationOption, ae as ElicitationOutcome, af as ElicitationQuestion, ag as ElicitationReply, ah as ElicitationResult, ai as HistoryPolicyContext, aj as HistorySelection, ak as HistorySummary, al as InvokeWithTransientRetryOptions, am as MAX_ASK_QUESTIONS, an as MessageFeedbackValue, ao as MessageRole, ap as PromptContext, aq as QueuePauseReason, ar as QueuedMessageView, as as QuotaView, at as RUN_ENDED_BEFORE_TOOL_CALL, au as RecordRunEndInput, av as ThreadTurnPage, aw as ThreadTurnQuery, ax as ThreadTurnReader, ay as ToolCallApprovalStatus, az as ToolCatalogEntry, aA as ToolConfirmation, b as ToolPresentation, aB as ToolPresentationTone, aC as ToolResultField, aD as ToolResultView, aE as ToolStepCtx, aF as ToolTransientRetryNumbers, aG as ToolTransientRetryOptions, aH as UNFINISHED_TOOL_CALL, aI as UsagePurpose, aJ as askInputSchema, aK as askToolDefinition, aL as danglingToolCallIds, aM as decodeStreamEvent, aN as encodeStreamEvent, aO as invokeWithTransientRetry, aP as isChatQueueStore, aQ as isTransientToolError, aR as isTypedQuestion, aS as normalizeElicitationReply, aT as questionOptions, aU as queuedMessageView, aV as readElicitationInput, aW as readElicitationQuestions, aX as releaseThreadRun, aY as renderElicitationAnswers, aZ as resolveElicitation, a_ as resolveToolTransientRetryNumbers, a$ as settleDanglingToolCalls, b0 as settleElicitation, b1 as validateElicitationAnswer, b2 as validateElicitationValue } from './stream-events-CgWqAI-1.cjs';
|
|
3
|
+
import { A as AiToolCtx, T as ToolHandler, a as ToolDescribeScope } from './tool-DuJ-_qXM.cjs';
|
|
4
|
+
export { b as ToolDescription } from './tool-DuJ-_qXM.cjs';
|
|
3
5
|
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-
|
|
5
|
-
export { D as DEFAULT_INCREMENTAL_LOOKBACK_CHARS, b as IncrementalGating, c as OutputRejectedError, d as OutputVerdict, e as ProcessorFailedError } from './processors-
|
|
6
|
+
import { O as OutputProcessor, P as ProcessorContext, I as InputProcessor, a as ProcessedPrompt, M as ModelAnswer } from './processors-C0snQzZJ.cjs';
|
|
7
|
+
export { D as DEFAULT_INCREMENTAL_LOOKBACK_CHARS, b as IncrementalGating, c as OutputRejectedError, d as OutputVerdict, e as ProcessorFailedError } from './processors-C0snQzZJ.cjs';
|
|
6
8
|
import { ChannelRegistry } from '@dudousxd/nestjs-diagnostics';
|
|
7
9
|
|
|
8
10
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import { M as ModelMessage, c as ToolDefinition, d as ToolCallRequest, e as MessageUsage, f as AgentUiComponent,
|
|
2
|
-
export {
|
|
1
|
+
import { M as ModelMessage, c as ToolDefinition, d as ToolCallRequest, e as MessageUsage, f as AgentUiComponent, a as Actor, A as AgentStreamEvent, T as ToolSpec, Q as QuotaState, g as AgentRunInput, H as HumanReply, h as MessageAttachment, i as ToolKind, j as ToolCallStatus, k as ToolCallApproval, l as HistoryPolicy, P as PageContext, m as AgentDefinition, n as AgentStore, o as AgentDelegation, D as DetachedDelivery, p as PromptBuilder, q as PromptContributor, r as ToolTransientRetrySetting, s as AgentIntake, t as Decision, E as ElicitationRequest, L as LlmStepEnvelope, u as ToolStepEnvelope, C as ChatQueueStore, v as CreateThreadInput, w as ThreadSummary, x as ThreadDetail, y as ToolCallApprovalState, U as UpdateThreadInput, R as RecordRunStartInput, z as EnqueueMessageInput, B as QueuedMessage, F as QueuedMessagePatch, G as QueuePause, I as AppendMessageInput, S as StoredMessage, J as ToolResult, K as MessageFeedback, N as RecordToolCallInput, O as ToolCallOutcome, V as UpdateToolCallInput, W as RecordUsageInput } from './stream-events-CgWqAI-1.js';
|
|
2
|
+
export { X as ALL_AGENTS, Y as ASK_TOOL_DESCRIPTION, Z as ASK_TOOL_NAME, _ as AgentApprovalRequest, $ as AgentApprovalSettlement, a0 as AgentAttachmentConfig, a1 as AgentCatalogEntry, a2 as AgentClientConfig, a3 as AgentHistoryWindow, a4 as AgentStreamErrorCode, a5 as AskToolInput, a6 as ChatQueueState, a7 as DEFAULT_INTAKE_PREAMBLE, a8 as DEFAULT_TOOL_TRANSIENT_RETRY_ATTEMPTS, a9 as DEFAULT_TOOL_TRANSIENT_RETRY_BACKOFF_MS, aa as ELICITATION_INPUT_TYPES, ab as ElicitationInput, ac as ElicitationInputType, ad as ElicitationOption, ae as ElicitationOutcome, af as ElicitationQuestion, ag as ElicitationReply, ah as ElicitationResult, ai as HistoryPolicyContext, aj as HistorySelection, ak as HistorySummary, al as InvokeWithTransientRetryOptions, am as MAX_ASK_QUESTIONS, an as MessageFeedbackValue, ao as MessageRole, ap as PromptContext, aq as QueuePauseReason, ar as QueuedMessageView, as as QuotaView, at as RUN_ENDED_BEFORE_TOOL_CALL, au as RecordRunEndInput, av as ThreadTurnPage, aw as ThreadTurnQuery, ax as ThreadTurnReader, ay as ToolCallApprovalStatus, az as ToolCatalogEntry, aA as ToolConfirmation, b as ToolPresentation, aB as ToolPresentationTone, aC as ToolResultField, aD as ToolResultView, aE as ToolStepCtx, aF as ToolTransientRetryNumbers, aG as ToolTransientRetryOptions, aH as UNFINISHED_TOOL_CALL, aI as UsagePurpose, aJ as askInputSchema, aK as askToolDefinition, aL as danglingToolCallIds, aM as decodeStreamEvent, aN as encodeStreamEvent, aO as invokeWithTransientRetry, aP as isChatQueueStore, aQ as isTransientToolError, aR as isTypedQuestion, aS as normalizeElicitationReply, aT as questionOptions, aU as queuedMessageView, aV as readElicitationInput, aW as readElicitationQuestions, aX as releaseThreadRun, aY as renderElicitationAnswers, aZ as resolveElicitation, a_ as resolveToolTransientRetryNumbers, a$ as settleDanglingToolCalls, b0 as settleElicitation, b1 as validateElicitationAnswer, b2 as validateElicitationValue } from './stream-events-CgWqAI-1.js';
|
|
3
|
+
import { A as AiToolCtx, T as ToolHandler, a as ToolDescribeScope } from './tool-DklsS3JX.js';
|
|
4
|
+
export { b as ToolDescription } from './tool-DklsS3JX.js';
|
|
3
5
|
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-
|
|
5
|
-
export { D as DEFAULT_INCREMENTAL_LOOKBACK_CHARS, b as IncrementalGating, c as OutputRejectedError, d as OutputVerdict, e as ProcessorFailedError } from './processors-
|
|
6
|
+
import { O as OutputProcessor, P as ProcessorContext, I as InputProcessor, a as ProcessedPrompt, M as ModelAnswer } from './processors-D5110pit.js';
|
|
7
|
+
export { D as DEFAULT_INCREMENTAL_LOOKBACK_CHARS, b as IncrementalGating, c as OutputRejectedError, d as OutputVerdict, e as ProcessorFailedError } from './processors-D5110pit.js';
|
|
6
8
|
import { ChannelRegistry } from '@dudousxd/nestjs-diagnostics';
|
|
7
9
|
|
|
8
10
|
/**
|
package/dist/index.js
CHANGED
|
@@ -4577,6 +4577,7 @@ ${block}`;
|
|
|
4577
4577
|
};
|
|
4578
4578
|
}
|
|
4579
4579
|
const resolvedModelId = turn.modelId ?? deps.modelId ?? "unknown";
|
|
4580
|
+
const stepModel = turn.modelId ?? deps.modelId;
|
|
4580
4581
|
const costUsd = resolveCostUsd(turn.usage, turn.costUsd, priceByModel.get(resolvedModelId));
|
|
4581
4582
|
const toolCallsWithKind = turn.toolCalls.map((call) => ({
|
|
4582
4583
|
...call,
|
|
@@ -4778,6 +4779,9 @@ ${block}`;
|
|
|
4778
4779
|
costUsd,
|
|
4779
4780
|
...turn.reasoningMs !== void 0 ? {
|
|
4780
4781
|
reasoningMs: turn.reasoningMs
|
|
4782
|
+
} : {},
|
|
4783
|
+
...stepModel !== void 0 ? {
|
|
4784
|
+
model: stepModel
|
|
4781
4785
|
} : {}
|
|
4782
4786
|
}));
|
|
4783
4787
|
});
|
|
@@ -4842,6 +4846,9 @@ ${block}`;
|
|
|
4842
4846
|
costUsd,
|
|
4843
4847
|
...turn.reasoningMs !== void 0 ? {
|
|
4844
4848
|
reasoningMs: turn.reasoningMs
|
|
4849
|
+
} : {},
|
|
4850
|
+
...stepModel !== void 0 ? {
|
|
4851
|
+
model: stepModel
|
|
4845
4852
|
} : {}
|
|
4846
4853
|
}));
|
|
4847
4854
|
});
|
|
@@ -4917,7 +4924,10 @@ var InMemoryAgentStore = class {
|
|
|
4917
4924
|
return (/* @__PURE__ */ new Date()).toISOString();
|
|
4918
4925
|
}
|
|
4919
4926
|
async createThread(input) {
|
|
4920
|
-
const id = crypto.randomUUID();
|
|
4927
|
+
const id = input.id ?? crypto.randomUUID();
|
|
4928
|
+
if (this.threads.has(id)) {
|
|
4929
|
+
throw new Error(`thread ${id} already exists`);
|
|
4930
|
+
}
|
|
4921
4931
|
const ts = this.now();
|
|
4922
4932
|
const row = {
|
|
4923
4933
|
id,
|