@dudousxd/nestjs-agent-core 0.28.0 → 0.30.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 +44 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +48 -6
- package/dist/index.d.ts +48 -6
- package/dist/index.js +42 -2
- package/dist/index.js.map +1 -1
- package/dist/{processors-Bhn6ehMM.d.ts → processors-8c9g9J6R.d.ts} +1 -1
- package/dist/{processors-nr6jwLAh.d.cts → processors-DdwZ0NFG.d.cts} +1 -1
- package/dist/{tool-BJ5jVoH2.d.cts → tool-CfnSyIQf.d.cts} +40 -0
- package/dist/{tool-BJ5jVoH2.d.ts → tool-CfnSyIQf.d.ts} +40 -0
- 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-CfnSyIQf.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
|
|
@@ -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-CfnSyIQf.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
|
|
@@ -152,6 +152,11 @@ interface ElicitationReply {
|
|
|
152
152
|
skipped?: boolean;
|
|
153
153
|
/** Opaque ref of WHO answered, when it wasn't the run's own actor. */
|
|
154
154
|
answeredByRef?: string;
|
|
155
|
+
/**
|
|
156
|
+
* The surface the answer came through — `'web'`, `'slack'`, `'console'`, … — the counterpart of
|
|
157
|
+
* an approval's `decidedVia`.
|
|
158
|
+
*/
|
|
159
|
+
answeredVia?: string;
|
|
155
160
|
}
|
|
156
161
|
/** A settled elicitation: what the agent proceeds on, and how it got there. */
|
|
157
162
|
interface ElicitationOutcome {
|
|
@@ -160,6 +165,13 @@ interface ElicitationOutcome {
|
|
|
160
165
|
skipped: boolean;
|
|
161
166
|
/** Question ids filled from the request's `defaults` rather than by the human. */
|
|
162
167
|
defaulted: string[];
|
|
168
|
+
/**
|
|
169
|
+
* Who answered (or skipped) — the reply's `answeredByRef`, which a host may make a display name.
|
|
170
|
+
* The counterpart of an approval's `decidedBy`. Absent when the reply did not say.
|
|
171
|
+
*/
|
|
172
|
+
answeredBy?: string;
|
|
173
|
+
/** The surface it came through (`'web'`, `'slack'`, …) — an approval's `decidedVia`. */
|
|
174
|
+
answeredVia?: string;
|
|
163
175
|
}
|
|
164
176
|
/**
|
|
165
177
|
* Read whatever the human channel delivered as an {@link ElicitationReply}.
|
|
@@ -544,6 +556,17 @@ type AgentStreamEvent = {
|
|
|
544
556
|
kind: 'title';
|
|
545
557
|
title: string;
|
|
546
558
|
}
|
|
559
|
+
/**
|
|
560
|
+
* Host-defined facts about the message being streamed (the model that answered, how long it took,
|
|
561
|
+
* the error it ended with), merged into the client message's `metadata`. The persisted
|
|
562
|
+
* counterpart is `StoredMessage.metadata`, so a reload reads the same values. The library's own
|
|
563
|
+
* loop never writes it; a runner that is not this library's loop uses it for what its store keeps
|
|
564
|
+
* per message.
|
|
565
|
+
*/
|
|
566
|
+
| {
|
|
567
|
+
kind: 'message-metadata';
|
|
568
|
+
metadata: Record<string, unknown>;
|
|
569
|
+
}
|
|
547
570
|
/**
|
|
548
571
|
* Someone stopped this run. The stream's LAST frame, written by the runner that settled the
|
|
549
572
|
* cancel, immediately before a normal `end()` — never a `fail()`, because a cancel is not an
|
|
@@ -853,6 +876,11 @@ interface ToolCallRequest {
|
|
|
853
876
|
* (defensively treated as `read` wherever a definite value is required).
|
|
854
877
|
*/
|
|
855
878
|
kind?: ToolKind;
|
|
879
|
+
/**
|
|
880
|
+
* The call this one ran inside (a code-mode `execute`, a delegated agent) — the same `parentId`
|
|
881
|
+
* the live `tool-input-*` frames carried, so a reloaded thread nests the call where the stream did.
|
|
882
|
+
*/
|
|
883
|
+
parentId?: string;
|
|
856
884
|
}
|
|
857
885
|
/** Result of running a tool. */
|
|
858
886
|
interface ToolResult {
|
|
@@ -1149,6 +1177,11 @@ interface AgentCatalogEntry {
|
|
|
1149
1177
|
description: string;
|
|
1150
1178
|
/** Whether this is the agent a turn uses when the caller names none. Omitted when not the default. */
|
|
1151
1179
|
isDefault?: boolean;
|
|
1180
|
+
/**
|
|
1181
|
+
* The catalog model this agent always runs on, when it is locked to one — an agent picker can say
|
|
1182
|
+
* so before a chat starts. `GET <base>/models?agent=` reports the same lock as `locked`.
|
|
1183
|
+
*/
|
|
1184
|
+
lockedModel?: string;
|
|
1152
1185
|
}
|
|
1153
1186
|
interface ThreadSummary {
|
|
1154
1187
|
id: string;
|
|
@@ -1215,6 +1248,13 @@ interface StoredMessage {
|
|
|
1215
1248
|
* nobody rated it, or on a store that does not record feedback.
|
|
1216
1249
|
*/
|
|
1217
1250
|
feedback?: MessageFeedback;
|
|
1251
|
+
/**
|
|
1252
|
+
* Host-defined facts about the message (which model answered, how long it took, the error a turn
|
|
1253
|
+
* ended with, …) — what a runner that is not this library's loop streamed as a
|
|
1254
|
+
* `message-metadata` frame. Replayed into the client message's `metadata`, under the library's
|
|
1255
|
+
* own keys (`usage`, `feedback`, `createdAt` win on a clash). Never read by the library itself.
|
|
1256
|
+
*/
|
|
1257
|
+
metadata?: Record<string, unknown>;
|
|
1218
1258
|
createdAt: string;
|
|
1219
1259
|
}
|
|
1220
1260
|
/** A thumbs-up/down on one message, with an optional free-text comment. */
|
|
@@ -152,6 +152,11 @@ interface ElicitationReply {
|
|
|
152
152
|
skipped?: boolean;
|
|
153
153
|
/** Opaque ref of WHO answered, when it wasn't the run's own actor. */
|
|
154
154
|
answeredByRef?: string;
|
|
155
|
+
/**
|
|
156
|
+
* The surface the answer came through — `'web'`, `'slack'`, `'console'`, … — the counterpart of
|
|
157
|
+
* an approval's `decidedVia`.
|
|
158
|
+
*/
|
|
159
|
+
answeredVia?: string;
|
|
155
160
|
}
|
|
156
161
|
/** A settled elicitation: what the agent proceeds on, and how it got there. */
|
|
157
162
|
interface ElicitationOutcome {
|
|
@@ -160,6 +165,13 @@ interface ElicitationOutcome {
|
|
|
160
165
|
skipped: boolean;
|
|
161
166
|
/** Question ids filled from the request's `defaults` rather than by the human. */
|
|
162
167
|
defaulted: string[];
|
|
168
|
+
/**
|
|
169
|
+
* Who answered (or skipped) — the reply's `answeredByRef`, which a host may make a display name.
|
|
170
|
+
* The counterpart of an approval's `decidedBy`. Absent when the reply did not say.
|
|
171
|
+
*/
|
|
172
|
+
answeredBy?: string;
|
|
173
|
+
/** The surface it came through (`'web'`, `'slack'`, …) — an approval's `decidedVia`. */
|
|
174
|
+
answeredVia?: string;
|
|
163
175
|
}
|
|
164
176
|
/**
|
|
165
177
|
* Read whatever the human channel delivered as an {@link ElicitationReply}.
|
|
@@ -544,6 +556,17 @@ type AgentStreamEvent = {
|
|
|
544
556
|
kind: 'title';
|
|
545
557
|
title: string;
|
|
546
558
|
}
|
|
559
|
+
/**
|
|
560
|
+
* Host-defined facts about the message being streamed (the model that answered, how long it took,
|
|
561
|
+
* the error it ended with), merged into the client message's `metadata`. The persisted
|
|
562
|
+
* counterpart is `StoredMessage.metadata`, so a reload reads the same values. The library's own
|
|
563
|
+
* loop never writes it; a runner that is not this library's loop uses it for what its store keeps
|
|
564
|
+
* per message.
|
|
565
|
+
*/
|
|
566
|
+
| {
|
|
567
|
+
kind: 'message-metadata';
|
|
568
|
+
metadata: Record<string, unknown>;
|
|
569
|
+
}
|
|
547
570
|
/**
|
|
548
571
|
* Someone stopped this run. The stream's LAST frame, written by the runner that settled the
|
|
549
572
|
* cancel, immediately before a normal `end()` — never a `fail()`, because a cancel is not an
|
|
@@ -853,6 +876,11 @@ interface ToolCallRequest {
|
|
|
853
876
|
* (defensively treated as `read` wherever a definite value is required).
|
|
854
877
|
*/
|
|
855
878
|
kind?: ToolKind;
|
|
879
|
+
/**
|
|
880
|
+
* The call this one ran inside (a code-mode `execute`, a delegated agent) — the same `parentId`
|
|
881
|
+
* the live `tool-input-*` frames carried, so a reloaded thread nests the call where the stream did.
|
|
882
|
+
*/
|
|
883
|
+
parentId?: string;
|
|
856
884
|
}
|
|
857
885
|
/** Result of running a tool. */
|
|
858
886
|
interface ToolResult {
|
|
@@ -1149,6 +1177,11 @@ interface AgentCatalogEntry {
|
|
|
1149
1177
|
description: string;
|
|
1150
1178
|
/** Whether this is the agent a turn uses when the caller names none. Omitted when not the default. */
|
|
1151
1179
|
isDefault?: boolean;
|
|
1180
|
+
/**
|
|
1181
|
+
* The catalog model this agent always runs on, when it is locked to one — an agent picker can say
|
|
1182
|
+
* so before a chat starts. `GET <base>/models?agent=` reports the same lock as `locked`.
|
|
1183
|
+
*/
|
|
1184
|
+
lockedModel?: string;
|
|
1152
1185
|
}
|
|
1153
1186
|
interface ThreadSummary {
|
|
1154
1187
|
id: string;
|
|
@@ -1215,6 +1248,13 @@ interface StoredMessage {
|
|
|
1215
1248
|
* nobody rated it, or on a store that does not record feedback.
|
|
1216
1249
|
*/
|
|
1217
1250
|
feedback?: MessageFeedback;
|
|
1251
|
+
/**
|
|
1252
|
+
* Host-defined facts about the message (which model answered, how long it took, the error a turn
|
|
1253
|
+
* ended with, …) — what a runner that is not this library's loop streamed as a
|
|
1254
|
+
* `message-metadata` frame. Replayed into the client message's `metadata`, under the library's
|
|
1255
|
+
* own keys (`usage`, `feedback`, `createdAt` win on a clash). Never read by the library itself.
|
|
1256
|
+
*/
|
|
1257
|
+
metadata?: Record<string, unknown>;
|
|
1218
1258
|
createdAt: string;
|
|
1219
1259
|
}
|
|
1220
1260
|
/** A thumbs-up/down on one message, with an optional free-text comment. */
|