@dudousxd/nestjs-agent-core 0.27.0 → 0.29.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/genui/index.d.cts +1 -1
- package/dist/genui/index.d.ts +1 -1
- package/dist/guardrails/index.d.cts +2 -2
- package/dist/guardrails/index.d.ts +2 -2
- package/dist/index.cjs +2 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +22 -5
- package/dist/index.d.ts +22 -5
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/{processors-Bf1fYLbY.d.cts → processors-3FixaBnr.d.cts} +1 -1
- package/dist/{processors-CK1RWv0D.d.ts → processors-BrGKQgLf.d.ts} +1 -1
- package/dist/{tool-BXKG2xSm.d.cts → tool-CON4ZOrD.d.cts} +54 -2
- package/dist/{tool-BXKG2xSm.d.ts → tool-CON4ZOrD.d.ts} +54 -2
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { M as ModelMessage, A as Actor, d as ToolCallRequest } from './tool-
|
|
1
|
+
import { M as ModelMessage, A as Actor, d as ToolCallRequest } from './tool-CON4ZOrD.cjs';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* The two seams that see a turn's traffic to and from the model: an {@link InputProcessor} rewrites
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { M as ModelMessage, A as Actor, d as ToolCallRequest } from './tool-
|
|
1
|
+
import { M as ModelMessage, A as Actor, d as ToolCallRequest } from './tool-CON4ZOrD.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* The two seams that see a turn's traffic to and from the model: an {@link InputProcessor} rewrites
|
|
@@ -544,6 +544,17 @@ type AgentStreamEvent = {
|
|
|
544
544
|
kind: 'title';
|
|
545
545
|
title: string;
|
|
546
546
|
}
|
|
547
|
+
/**
|
|
548
|
+
* Host-defined facts about the message being streamed (the model that answered, how long it took,
|
|
549
|
+
* the error it ended with), merged into the client message's `metadata`. The persisted
|
|
550
|
+
* counterpart is `StoredMessage.metadata`, so a reload reads the same values. The library's own
|
|
551
|
+
* loop never writes it; a runner that is not this library's loop uses it for what its store keeps
|
|
552
|
+
* per message.
|
|
553
|
+
*/
|
|
554
|
+
| {
|
|
555
|
+
kind: 'message-metadata';
|
|
556
|
+
metadata: Record<string, unknown>;
|
|
557
|
+
}
|
|
547
558
|
/**
|
|
548
559
|
* Someone stopped this run. The stream's LAST frame, written by the runner that settled the
|
|
549
560
|
* cancel, immediately before a normal `end()` — never a `fail()`, because a cancel is not an
|
|
@@ -853,6 +864,11 @@ interface ToolCallRequest {
|
|
|
853
864
|
* (defensively treated as `read` wherever a definite value is required).
|
|
854
865
|
*/
|
|
855
866
|
kind?: ToolKind;
|
|
867
|
+
/**
|
|
868
|
+
* The call this one ran inside (a code-mode `execute`, a delegated agent) — the same `parentId`
|
|
869
|
+
* the live `tool-input-*` frames carried, so a reloaded thread nests the call where the stream did.
|
|
870
|
+
*/
|
|
871
|
+
parentId?: string;
|
|
856
872
|
}
|
|
857
873
|
/** Result of running a tool. */
|
|
858
874
|
interface ToolResult {
|
|
@@ -1215,6 +1231,13 @@ interface StoredMessage {
|
|
|
1215
1231
|
* nobody rated it, or on a store that does not record feedback.
|
|
1216
1232
|
*/
|
|
1217
1233
|
feedback?: MessageFeedback;
|
|
1234
|
+
/**
|
|
1235
|
+
* Host-defined facts about the message (which model answered, how long it took, the error a turn
|
|
1236
|
+
* ended with, …) — what a runner that is not this library's loop streamed as a
|
|
1237
|
+
* `message-metadata` frame. Replayed into the client message's `metadata`, under the library's
|
|
1238
|
+
* own keys (`usage`, `feedback`, `createdAt` win on a clash). Never read by the library itself.
|
|
1239
|
+
*/
|
|
1240
|
+
metadata?: Record<string, unknown>;
|
|
1218
1241
|
createdAt: string;
|
|
1219
1242
|
}
|
|
1220
1243
|
/** A thumbs-up/down on one message, with an optional free-text comment. */
|
|
@@ -1250,7 +1273,6 @@ interface ToolCallApproval {
|
|
|
1250
1273
|
}
|
|
1251
1274
|
interface ThreadDetail extends ThreadSummary {
|
|
1252
1275
|
messages: StoredMessage[];
|
|
1253
|
-
activeStreamId?: string;
|
|
1254
1276
|
}
|
|
1255
1277
|
type ToolCallStatus = 'auto_executed' | 'pending_approval' | 'executed' | 'rejected' | 'failed'
|
|
1256
1278
|
/** An approval request lapsed before anyone decided; the tool never ran. */
|
|
@@ -1316,6 +1338,36 @@ interface ToolStepEnvelope {
|
|
|
1316
1338
|
*/
|
|
1317
1339
|
collectUi?: boolean;
|
|
1318
1340
|
}
|
|
1341
|
+
/**
|
|
1342
|
+
* What `GET <base>/config` answers — server-side facts a client would otherwise repeat in its own
|
|
1343
|
+
* configuration (and let drift).
|
|
1344
|
+
*/
|
|
1345
|
+
interface AgentClientConfig {
|
|
1346
|
+
attachments: AgentAttachmentConfig;
|
|
1347
|
+
/** A model catalog is bound, so `GET <base>/models` lists something to pick. */
|
|
1348
|
+
models: {
|
|
1349
|
+
enabled: boolean;
|
|
1350
|
+
};
|
|
1351
|
+
/** Sends are refused with `429` once `GET <base>/quota` reports `blocked`. */
|
|
1352
|
+
quota: {
|
|
1353
|
+
enforced: boolean;
|
|
1354
|
+
};
|
|
1355
|
+
/** No `actorResolver`: every browser is its own anonymous actor. */
|
|
1356
|
+
identity: {
|
|
1357
|
+
anonymous: boolean;
|
|
1358
|
+
};
|
|
1359
|
+
}
|
|
1360
|
+
/** The attachment rules in force — what the upload route enforces. */
|
|
1361
|
+
interface AgentAttachmentConfig {
|
|
1362
|
+
/** A staging store is bound, so uploads work at all. */
|
|
1363
|
+
enabled: boolean;
|
|
1364
|
+
/** How a client uploads (`null` when `enabled` is false). */
|
|
1365
|
+
upload: 'multipart' | 'resumable' | null;
|
|
1366
|
+
maxBytes: number;
|
|
1367
|
+
allowedContentTypes: readonly string[];
|
|
1368
|
+
/** How many attachments one message may name. */
|
|
1369
|
+
maxPerMessage: number;
|
|
1370
|
+
}
|
|
1319
1371
|
|
|
1320
1372
|
/**
|
|
1321
1373
|
* Per-invocation context handed to a tool handler. Host-supplied bits are optional. Identity lives
|
|
@@ -1411,4 +1463,4 @@ interface ToolDescription {
|
|
|
1411
1463
|
inputSchema?: StandardSchemaV1;
|
|
1412
1464
|
}
|
|
1413
1465
|
|
|
1414
|
-
export { type
|
|
1466
|
+
export { type ElicitationOption as $, type Actor as A, type ToolStepEnvelope as B, ASK_TOOL_DESCRIPTION as C, type DetachedDelivery as D, type ElicitationRequest as E, ASK_TOOL_NAME as F, type AgentApprovalRequest as G, type HumanReply as H, type AgentApprovalSettlement as I, type AgentAttachmentConfig as J, type AgentCatalogEntry as K, type LlmStepEnvelope as L, type ModelMessage as M, type AgentClientConfig as N, type AgentHistoryWindow as O, type PageContext as P, type QuotaState as Q, type AskToolInput as R, type StoredMessage as S, type ToolSpec as T, type UsagePurpose as U, DEFAULT_INTAKE_PREAMBLE as V, DEFAULT_TOOL_TRANSIENT_RETRY_ATTEMPTS as W, DEFAULT_TOOL_TRANSIENT_RETRY_BACKOFF_MS as X, ELICITATION_INPUT_TYPES as Y, type ElicitationInput as Z, type ElicitationInputType as _, type ToolHandler as a, type ElicitationOutcome as a0, type ElicitationQuestion as a1, type ElicitationReply as a2, type ElicitationResult as a3, type HistoryPolicyContext as a4, type HistorySelection as a5, type HistorySummary as a6, type InvokeWithTransientRetryOptions as a7, MAX_ASK_QUESTIONS as a8, type MessageFeedbackValue as a9, resolveToolTransientRetryNumbers as aA, settleElicitation as aB, validateElicitationAnswer as aC, validateElicitationValue as aD, type MessageRole as aa, type PromptContext as ab, type QuotaView as ac, type ToolCallApprovalStatus as ad, type ToolCatalogEntry as ae, type ToolConfirmation as af, type ToolDescription as ag, type ToolPresentationTone as ah, type ToolResultField as ai, type ToolResultView as aj, type ToolStepCtx as ak, type ToolTransientRetryNumbers as al, type ToolTransientRetryOptions as am, askInputSchema as an, askToolDefinition as ao, decodeStreamEvent as ap, encodeStreamEvent as aq, invokeWithTransientRetry as ar, isTransientToolError as as, isTypedQuestion as at, normalizeElicitationReply as au, questionOptions as av, readElicitationInput as aw, readElicitationQuestions as ax, renderElicitationAnswers as ay, resolveElicitation as az, type ToolPresentation as b, type ToolDefinition as c, type ToolCallRequest as d, type MessageUsage as e, type AgentUiComponent as f, type AiToolCtx as g, type AgentStreamEvent as h, type ThreadSummary as i, type ThreadDetail as j, type ToolResult as k, type MessageAttachment as l, type MessageFeedback as m, type ToolCallStatus as n, type AgentRunInput as o, type ToolKind as p, type ToolCallApproval as q, type HistoryPolicy as r, type AgentDefinition as s, type AgentDelegation as t, type ToolDescribeScope as u, type PromptBuilder as v, type PromptContributor as w, type ToolTransientRetrySetting as x, type AgentIntake as y, type Decision as z };
|
|
@@ -544,6 +544,17 @@ type AgentStreamEvent = {
|
|
|
544
544
|
kind: 'title';
|
|
545
545
|
title: string;
|
|
546
546
|
}
|
|
547
|
+
/**
|
|
548
|
+
* Host-defined facts about the message being streamed (the model that answered, how long it took,
|
|
549
|
+
* the error it ended with), merged into the client message's `metadata`. The persisted
|
|
550
|
+
* counterpart is `StoredMessage.metadata`, so a reload reads the same values. The library's own
|
|
551
|
+
* loop never writes it; a runner that is not this library's loop uses it for what its store keeps
|
|
552
|
+
* per message.
|
|
553
|
+
*/
|
|
554
|
+
| {
|
|
555
|
+
kind: 'message-metadata';
|
|
556
|
+
metadata: Record<string, unknown>;
|
|
557
|
+
}
|
|
547
558
|
/**
|
|
548
559
|
* Someone stopped this run. The stream's LAST frame, written by the runner that settled the
|
|
549
560
|
* cancel, immediately before a normal `end()` — never a `fail()`, because a cancel is not an
|
|
@@ -853,6 +864,11 @@ interface ToolCallRequest {
|
|
|
853
864
|
* (defensively treated as `read` wherever a definite value is required).
|
|
854
865
|
*/
|
|
855
866
|
kind?: ToolKind;
|
|
867
|
+
/**
|
|
868
|
+
* The call this one ran inside (a code-mode `execute`, a delegated agent) — the same `parentId`
|
|
869
|
+
* the live `tool-input-*` frames carried, so a reloaded thread nests the call where the stream did.
|
|
870
|
+
*/
|
|
871
|
+
parentId?: string;
|
|
856
872
|
}
|
|
857
873
|
/** Result of running a tool. */
|
|
858
874
|
interface ToolResult {
|
|
@@ -1215,6 +1231,13 @@ interface StoredMessage {
|
|
|
1215
1231
|
* nobody rated it, or on a store that does not record feedback.
|
|
1216
1232
|
*/
|
|
1217
1233
|
feedback?: MessageFeedback;
|
|
1234
|
+
/**
|
|
1235
|
+
* Host-defined facts about the message (which model answered, how long it took, the error a turn
|
|
1236
|
+
* ended with, …) — what a runner that is not this library's loop streamed as a
|
|
1237
|
+
* `message-metadata` frame. Replayed into the client message's `metadata`, under the library's
|
|
1238
|
+
* own keys (`usage`, `feedback`, `createdAt` win on a clash). Never read by the library itself.
|
|
1239
|
+
*/
|
|
1240
|
+
metadata?: Record<string, unknown>;
|
|
1218
1241
|
createdAt: string;
|
|
1219
1242
|
}
|
|
1220
1243
|
/** A thumbs-up/down on one message, with an optional free-text comment. */
|
|
@@ -1250,7 +1273,6 @@ interface ToolCallApproval {
|
|
|
1250
1273
|
}
|
|
1251
1274
|
interface ThreadDetail extends ThreadSummary {
|
|
1252
1275
|
messages: StoredMessage[];
|
|
1253
|
-
activeStreamId?: string;
|
|
1254
1276
|
}
|
|
1255
1277
|
type ToolCallStatus = 'auto_executed' | 'pending_approval' | 'executed' | 'rejected' | 'failed'
|
|
1256
1278
|
/** An approval request lapsed before anyone decided; the tool never ran. */
|
|
@@ -1316,6 +1338,36 @@ interface ToolStepEnvelope {
|
|
|
1316
1338
|
*/
|
|
1317
1339
|
collectUi?: boolean;
|
|
1318
1340
|
}
|
|
1341
|
+
/**
|
|
1342
|
+
* What `GET <base>/config` answers — server-side facts a client would otherwise repeat in its own
|
|
1343
|
+
* configuration (and let drift).
|
|
1344
|
+
*/
|
|
1345
|
+
interface AgentClientConfig {
|
|
1346
|
+
attachments: AgentAttachmentConfig;
|
|
1347
|
+
/** A model catalog is bound, so `GET <base>/models` lists something to pick. */
|
|
1348
|
+
models: {
|
|
1349
|
+
enabled: boolean;
|
|
1350
|
+
};
|
|
1351
|
+
/** Sends are refused with `429` once `GET <base>/quota` reports `blocked`. */
|
|
1352
|
+
quota: {
|
|
1353
|
+
enforced: boolean;
|
|
1354
|
+
};
|
|
1355
|
+
/** No `actorResolver`: every browser is its own anonymous actor. */
|
|
1356
|
+
identity: {
|
|
1357
|
+
anonymous: boolean;
|
|
1358
|
+
};
|
|
1359
|
+
}
|
|
1360
|
+
/** The attachment rules in force — what the upload route enforces. */
|
|
1361
|
+
interface AgentAttachmentConfig {
|
|
1362
|
+
/** A staging store is bound, so uploads work at all. */
|
|
1363
|
+
enabled: boolean;
|
|
1364
|
+
/** How a client uploads (`null` when `enabled` is false). */
|
|
1365
|
+
upload: 'multipart' | 'resumable' | null;
|
|
1366
|
+
maxBytes: number;
|
|
1367
|
+
allowedContentTypes: readonly string[];
|
|
1368
|
+
/** How many attachments one message may name. */
|
|
1369
|
+
maxPerMessage: number;
|
|
1370
|
+
}
|
|
1319
1371
|
|
|
1320
1372
|
/**
|
|
1321
1373
|
* Per-invocation context handed to a tool handler. Host-supplied bits are optional. Identity lives
|
|
@@ -1411,4 +1463,4 @@ interface ToolDescription {
|
|
|
1411
1463
|
inputSchema?: StandardSchemaV1;
|
|
1412
1464
|
}
|
|
1413
1465
|
|
|
1414
|
-
export { type
|
|
1466
|
+
export { type ElicitationOption as $, type Actor as A, type ToolStepEnvelope as B, ASK_TOOL_DESCRIPTION as C, type DetachedDelivery as D, type ElicitationRequest as E, ASK_TOOL_NAME as F, type AgentApprovalRequest as G, type HumanReply as H, type AgentApprovalSettlement as I, type AgentAttachmentConfig as J, type AgentCatalogEntry as K, type LlmStepEnvelope as L, type ModelMessage as M, type AgentClientConfig as N, type AgentHistoryWindow as O, type PageContext as P, type QuotaState as Q, type AskToolInput as R, type StoredMessage as S, type ToolSpec as T, type UsagePurpose as U, DEFAULT_INTAKE_PREAMBLE as V, DEFAULT_TOOL_TRANSIENT_RETRY_ATTEMPTS as W, DEFAULT_TOOL_TRANSIENT_RETRY_BACKOFF_MS as X, ELICITATION_INPUT_TYPES as Y, type ElicitationInput as Z, type ElicitationInputType as _, type ToolHandler as a, type ElicitationOutcome as a0, type ElicitationQuestion as a1, type ElicitationReply as a2, type ElicitationResult as a3, type HistoryPolicyContext as a4, type HistorySelection as a5, type HistorySummary as a6, type InvokeWithTransientRetryOptions as a7, MAX_ASK_QUESTIONS as a8, type MessageFeedbackValue as a9, resolveToolTransientRetryNumbers as aA, settleElicitation as aB, validateElicitationAnswer as aC, validateElicitationValue as aD, type MessageRole as aa, type PromptContext as ab, type QuotaView as ac, type ToolCallApprovalStatus as ad, type ToolCatalogEntry as ae, type ToolConfirmation as af, type ToolDescription as ag, type ToolPresentationTone as ah, type ToolResultField as ai, type ToolResultView as aj, type ToolStepCtx as ak, type ToolTransientRetryNumbers as al, type ToolTransientRetryOptions as am, askInputSchema as an, askToolDefinition as ao, decodeStreamEvent as ap, encodeStreamEvent as aq, invokeWithTransientRetry as ar, isTransientToolError as as, isTypedQuestion as at, normalizeElicitationReply as au, questionOptions as av, readElicitationInput as aw, readElicitationQuestions as ax, renderElicitationAnswers as ay, resolveElicitation as az, type ToolPresentation as b, type ToolDefinition as c, type ToolCallRequest as d, type MessageUsage as e, type AgentUiComponent as f, type AiToolCtx as g, type AgentStreamEvent as h, type ThreadSummary as i, type ThreadDetail as j, type ToolResult as k, type MessageAttachment as l, type MessageFeedback as m, type ToolCallStatus as n, type AgentRunInput as o, type ToolKind as p, type ToolCallApproval as q, type HistoryPolicy as r, type AgentDefinition as s, type AgentDelegation as t, type ToolDescribeScope as u, type PromptBuilder as v, type PromptContributor as w, type ToolTransientRetrySetting as x, type AgentIntake as y, type Decision as z };
|