@dudousxd/nestjs-agent 1.16.1 → 1.17.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/README.md +15 -0
- package/dist/durable/index.cjs +460 -400
- package/dist/durable/index.cjs.map +1 -1
- package/dist/durable/index.d.cts +1 -0
- package/dist/durable/index.d.ts +1 -0
- package/dist/durable/index.js +107 -47
- package/dist/durable/index.js.map +1 -1
- package/dist/index.cjs +442 -392
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +23 -2
- package/dist/index.d.ts +23 -2
- package/dist/index.js +64 -15
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DynamicModule, Type, OnApplicationBootstrap, OnModuleInit } from '@nestjs/common';
|
|
1
|
+
import { DynamicModule, Type, OnApplicationBootstrap, OnModuleInit, ConflictException } from '@nestjs/common';
|
|
2
2
|
import { b as AgentModuleOptions, c as AgentModuleAsyncOptions, A as AgentDepsFactory, C as ChatQueueService, d as AgentSkillsOptions } from './chat-queue.service-Bqq00NN1.cjs';
|
|
3
3
|
export { e as AGENT_TOOL_BRAND, f as AgentAttachmentsOptions, g as AgentDeps, h as AgentMemoryOptions, a as AgentSurface, F as FunctionalTool, L as LedgerQuotaProvider, Q as QueuePlan, i as QueueSettleOutcome, j as QueuedTurn, k as QueuedTurnStarter, l as QuotaLimits, m as QuotaWindowLimits, n as delegateToolName, p as provideAgentTool, o as provideAgentTools, u as utcDay } from './chat-queue.service-Bqq00NN1.cjs';
|
|
4
4
|
import { AgentRunner, AgentStore, AttachmentStagingStore, ModelCatalog, QuotaProvider, Actor, QuotaReport, ModelCatalogView, AttachmentRef, PageContext, ChatQueueState, HumanReply, ThreadSummary, ThreadDetail, UpdateThreadInput, MessageFeedbackValue, MessageFeedback, StagedAttachment, AgentApprovalPort, ActorResolver, MessageAttachment, AgentAttachmentConfig, AgentClientConfig, ToolPresentation, AgentHistoryWindow, AgentIntake, SkillContext, ToolRegistry, AgentRegistry, PromptContributor, SkillsConfig, SkillCatalogEntry, ToolCatalogEntry, MemoryConfig, MemoryDigestEntry, SkillProvider, AgentRunInput, AgentRunStartOptions, TokenStreamSink, SinkWriter } from '@dudousxd/nestjs-agent-core';
|
|
@@ -249,6 +249,14 @@ declare class AgentService {
|
|
|
249
249
|
* not the thread's own actor).
|
|
250
250
|
*/
|
|
251
251
|
signalToolCall(toolCallId: string, reply: HumanReply): Promise<void>;
|
|
252
|
+
/**
|
|
253
|
+
* Refuse a decision addressed at a run that is over (`409 run_not_active`). The runtime would take
|
|
254
|
+
* the signal and buffer it for a run that never comes back — the person's "yes" is accepted, the
|
|
255
|
+
* card says so, and nothing runs. Settles the calls the dead run left awaiting a decision on the
|
|
256
|
+
* way out, so the card stops asking. A runner that cannot say whether a run is alive is taken at
|
|
257
|
+
* its word that it is, and so is one that fails to answer.
|
|
258
|
+
*/
|
|
259
|
+
private assertRunWaiting;
|
|
252
260
|
cancel(actor: Actor, runId: string): Promise<void>;
|
|
253
261
|
listThreads(actorRef: string): Promise<ThreadSummary[]>;
|
|
254
262
|
getThread(actor: Actor, threadId: string): Promise<ThreadDetail | null>;
|
|
@@ -1185,4 +1193,17 @@ declare function defaultRequestUserMapper(user: Record<string, unknown>): Actor;
|
|
|
1185
1193
|
*/
|
|
1186
1194
|
declare function requestUserActorResolver<TUser = Record<string, unknown>>(map?: RequestUserMapper<TUser>): ActorResolver;
|
|
1187
1195
|
|
|
1188
|
-
|
|
1196
|
+
/**
|
|
1197
|
+
* `approve` / `reject` / `answer` / `skip` addressed at a run that is no longer running — answered
|
|
1198
|
+
* `409 { code: 'run_not_active', message }`.
|
|
1199
|
+
*
|
|
1200
|
+
* The runtime would take the signal and buffer it for a run that never comes back: the person's
|
|
1201
|
+
* "yes" is accepted, the card says so, and nothing runs. Refusing it is what lets a client say so.
|
|
1202
|
+
*/
|
|
1203
|
+
declare class RunNotActiveException extends ConflictException {
|
|
1204
|
+
readonly runId: string;
|
|
1205
|
+
readonly code = "run_not_active";
|
|
1206
|
+
constructor(runId: string);
|
|
1207
|
+
}
|
|
1208
|
+
|
|
1209
|
+
export { AGENT_METADATA, AI_TOOL_METADATA, ATTACHMENT_PAGE_SIZE, Agent, AgentApprovalPortAdapter, AgentDepsFactory, AgentDiscoveryService, AgentModule, AgentModuleAsyncOptions, AgentModuleOptions, type AgentOptions, AgentService, AgentSkillsOptions, AiTool, AiToolDiscoveryService, type AiToolOptions, type AnonymousActorOptions, AnonymousActorResolver, type AttachmentLimits, AttachmentsController, type ChatParams, ChatQueueService, type ChatSendMode, type ChatSendResult, ConfigController, DEFAULT_ALLOWED_ATTACHMENT_CONTENT_TYPES, DEFAULT_MAX_ATTACHMENT_BYTES, type DeclaredSkill, HeaderActorResolver, InProcessTokenStreamSink, InlineAgentRunner, MAX_ATTACHMENTS_PER_MESSAGE, MemoriesController, MessagesController, ModelsController, QueueController, type QueuedSend, type RequestUserMapper, type ResolvedAiToolOptions, RunNotActiveException, SKILL_METADATA, SYSTEM_PROMPT_CONTRIBUTOR_METADATA, SYSTEM_PROMPT_METADATA, Skill, type SkillBody, SkillDiscoveryService, type SkillOptions, SkillsController, SystemPrompt, SystemPromptContributor, type ThreadDefaultAgentReader, type ThreadModelReader, ToolsController, attachmentLimits, declaredSkillProvider, defaultRequestUserMapper, readAgentMetadata, readAiToolMetadata, readSkillMetadata, requestUserActorResolver, resolveSkillsConfig, skillScope, toolNameFromClass };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DynamicModule, Type, OnApplicationBootstrap, OnModuleInit } from '@nestjs/common';
|
|
1
|
+
import { DynamicModule, Type, OnApplicationBootstrap, OnModuleInit, ConflictException } from '@nestjs/common';
|
|
2
2
|
import { b as AgentModuleOptions, c as AgentModuleAsyncOptions, A as AgentDepsFactory, C as ChatQueueService, d as AgentSkillsOptions } from './chat-queue.service-Bqq00NN1.js';
|
|
3
3
|
export { e as AGENT_TOOL_BRAND, f as AgentAttachmentsOptions, g as AgentDeps, h as AgentMemoryOptions, a as AgentSurface, F as FunctionalTool, L as LedgerQuotaProvider, Q as QueuePlan, i as QueueSettleOutcome, j as QueuedTurn, k as QueuedTurnStarter, l as QuotaLimits, m as QuotaWindowLimits, n as delegateToolName, p as provideAgentTool, o as provideAgentTools, u as utcDay } from './chat-queue.service-Bqq00NN1.js';
|
|
4
4
|
import { AgentRunner, AgentStore, AttachmentStagingStore, ModelCatalog, QuotaProvider, Actor, QuotaReport, ModelCatalogView, AttachmentRef, PageContext, ChatQueueState, HumanReply, ThreadSummary, ThreadDetail, UpdateThreadInput, MessageFeedbackValue, MessageFeedback, StagedAttachment, AgentApprovalPort, ActorResolver, MessageAttachment, AgentAttachmentConfig, AgentClientConfig, ToolPresentation, AgentHistoryWindow, AgentIntake, SkillContext, ToolRegistry, AgentRegistry, PromptContributor, SkillsConfig, SkillCatalogEntry, ToolCatalogEntry, MemoryConfig, MemoryDigestEntry, SkillProvider, AgentRunInput, AgentRunStartOptions, TokenStreamSink, SinkWriter } from '@dudousxd/nestjs-agent-core';
|
|
@@ -249,6 +249,14 @@ declare class AgentService {
|
|
|
249
249
|
* not the thread's own actor).
|
|
250
250
|
*/
|
|
251
251
|
signalToolCall(toolCallId: string, reply: HumanReply): Promise<void>;
|
|
252
|
+
/**
|
|
253
|
+
* Refuse a decision addressed at a run that is over (`409 run_not_active`). The runtime would take
|
|
254
|
+
* the signal and buffer it for a run that never comes back — the person's "yes" is accepted, the
|
|
255
|
+
* card says so, and nothing runs. Settles the calls the dead run left awaiting a decision on the
|
|
256
|
+
* way out, so the card stops asking. A runner that cannot say whether a run is alive is taken at
|
|
257
|
+
* its word that it is, and so is one that fails to answer.
|
|
258
|
+
*/
|
|
259
|
+
private assertRunWaiting;
|
|
252
260
|
cancel(actor: Actor, runId: string): Promise<void>;
|
|
253
261
|
listThreads(actorRef: string): Promise<ThreadSummary[]>;
|
|
254
262
|
getThread(actor: Actor, threadId: string): Promise<ThreadDetail | null>;
|
|
@@ -1185,4 +1193,17 @@ declare function defaultRequestUserMapper(user: Record<string, unknown>): Actor;
|
|
|
1185
1193
|
*/
|
|
1186
1194
|
declare function requestUserActorResolver<TUser = Record<string, unknown>>(map?: RequestUserMapper<TUser>): ActorResolver;
|
|
1187
1195
|
|
|
1188
|
-
|
|
1196
|
+
/**
|
|
1197
|
+
* `approve` / `reject` / `answer` / `skip` addressed at a run that is no longer running — answered
|
|
1198
|
+
* `409 { code: 'run_not_active', message }`.
|
|
1199
|
+
*
|
|
1200
|
+
* The runtime would take the signal and buffer it for a run that never comes back: the person's
|
|
1201
|
+
* "yes" is accepted, the card says so, and nothing runs. Refusing it is what lets a client say so.
|
|
1202
|
+
*/
|
|
1203
|
+
declare class RunNotActiveException extends ConflictException {
|
|
1204
|
+
readonly runId: string;
|
|
1205
|
+
readonly code = "run_not_active";
|
|
1206
|
+
constructor(runId: string);
|
|
1207
|
+
}
|
|
1208
|
+
|
|
1209
|
+
export { AGENT_METADATA, AI_TOOL_METADATA, ATTACHMENT_PAGE_SIZE, Agent, AgentApprovalPortAdapter, AgentDepsFactory, AgentDiscoveryService, AgentModule, AgentModuleAsyncOptions, AgentModuleOptions, type AgentOptions, AgentService, AgentSkillsOptions, AiTool, AiToolDiscoveryService, type AiToolOptions, type AnonymousActorOptions, AnonymousActorResolver, type AttachmentLimits, AttachmentsController, type ChatParams, ChatQueueService, type ChatSendMode, type ChatSendResult, ConfigController, DEFAULT_ALLOWED_ATTACHMENT_CONTENT_TYPES, DEFAULT_MAX_ATTACHMENT_BYTES, type DeclaredSkill, HeaderActorResolver, InProcessTokenStreamSink, InlineAgentRunner, MAX_ATTACHMENTS_PER_MESSAGE, MemoriesController, MessagesController, ModelsController, QueueController, type QueuedSend, type RequestUserMapper, type ResolvedAiToolOptions, RunNotActiveException, SKILL_METADATA, SYSTEM_PROMPT_CONTRIBUTOR_METADATA, SYSTEM_PROMPT_METADATA, Skill, type SkillBody, SkillDiscoveryService, type SkillOptions, SkillsController, SystemPrompt, SystemPromptContributor, type ThreadDefaultAgentReader, type ThreadModelReader, ToolsController, attachmentLimits, declaredSkillProvider, defaultRequestUserMapper, readAgentMetadata, readAiToolMetadata, readSkillMetadata, requestUserActorResolver, resolveSkillsConfig, skillScope, toolNameFromClass };
|
package/dist/index.js
CHANGED
|
@@ -265,8 +265,8 @@ AgentDepsFactory2 = _ts_decorate([
|
|
|
265
265
|
], AgentDepsFactory2);
|
|
266
266
|
|
|
267
267
|
// src/agent.service.ts
|
|
268
|
-
import { AGENT_ATTACHMENT_STAGING as AGENT_ATTACHMENT_STAGING2, AGENT_DEPS_FACTORY, AGENT_MODEL_CATALOG, AGENT_OPTIONS as AGENT_OPTIONS3, AGENT_QUOTA_PROVIDER as AGENT_QUOTA_PROVIDER2, AGENT_RUNNER, AGENT_STORE as AGENT_STORE3, REQUESTER_APPROVER, findCatalogModel, mayDecideApproval, readElicitationQuestions, validateElicitationAnswer } from "@dudousxd/nestjs-agent-core";
|
|
269
|
-
import { BadRequestException, ConflictException, ForbiddenException, GoneException, HttpException, HttpStatus, Inject as Inject3, Injectable as Injectable3, NotFoundException, NotImplementedException as NotImplementedException2, Optional as Optional3 } from "@nestjs/common";
|
|
268
|
+
import { AGENT_ATTACHMENT_STAGING as AGENT_ATTACHMENT_STAGING2, AGENT_DEPS_FACTORY, AGENT_MODEL_CATALOG, AGENT_OPTIONS as AGENT_OPTIONS3, AGENT_QUOTA_PROVIDER as AGENT_QUOTA_PROVIDER2, AGENT_RUNNER, AGENT_STORE as AGENT_STORE3, REQUESTER_APPROVER, findCatalogModel, mayDecideApproval, readElicitationQuestions, settleDeadRun, validateElicitationAnswer } from "@dudousxd/nestjs-agent-core";
|
|
269
|
+
import { BadRequestException, ConflictException as ConflictException2, ForbiddenException, GoneException, HttpException, HttpStatus, Inject as Inject3, Injectable as Injectable3, NotFoundException, NotImplementedException as NotImplementedException2, Optional as Optional3 } from "@nestjs/common";
|
|
270
270
|
|
|
271
271
|
// src/agent-deps.ts
|
|
272
272
|
function utcDay(date = /* @__PURE__ */ new Date()) {
|
|
@@ -711,6 +711,24 @@ function queueFrame(items, paused, started) {
|
|
|
711
711
|
}
|
|
712
712
|
__name(queueFrame, "queueFrame");
|
|
713
713
|
|
|
714
|
+
// src/run-not-active.exception.ts
|
|
715
|
+
import { RUN_NOT_ACTIVE_CODE, RUN_NOT_ACTIVE_MESSAGE } from "@dudousxd/nestjs-agent-core";
|
|
716
|
+
import { ConflictException } from "@nestjs/common";
|
|
717
|
+
var RunNotActiveException = class extends ConflictException {
|
|
718
|
+
static {
|
|
719
|
+
__name(this, "RunNotActiveException");
|
|
720
|
+
}
|
|
721
|
+
runId;
|
|
722
|
+
code = RUN_NOT_ACTIVE_CODE;
|
|
723
|
+
constructor(runId) {
|
|
724
|
+
super({
|
|
725
|
+
statusCode: 409,
|
|
726
|
+
code: RUN_NOT_ACTIVE_CODE,
|
|
727
|
+
message: RUN_NOT_ACTIVE_MESSAGE
|
|
728
|
+
}), this.runId = runId;
|
|
729
|
+
}
|
|
730
|
+
};
|
|
731
|
+
|
|
714
732
|
// src/agent.service.ts
|
|
715
733
|
function _ts_decorate3(decorators, target, key, desc) {
|
|
716
734
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
@@ -908,7 +926,7 @@ var AgentService = class {
|
|
|
908
926
|
};
|
|
909
927
|
}
|
|
910
928
|
await this.requireQueue().publish(result.threadId);
|
|
911
|
-
throw new
|
|
929
|
+
throw new ConflictException2({
|
|
912
930
|
statusCode: 409,
|
|
913
931
|
code: "run_active",
|
|
914
932
|
message: `thread ${result.threadId} already has a turn running`
|
|
@@ -968,6 +986,11 @@ var AgentService = class {
|
|
|
968
986
|
}
|
|
969
987
|
const mode = params.mode ?? "auto";
|
|
970
988
|
const { live, stale } = await queue.holder(threadId, this.runner);
|
|
989
|
+
if (stale !== null) {
|
|
990
|
+
await settleDeadRun(this.store, {
|
|
991
|
+
runId: stale
|
|
992
|
+
});
|
|
993
|
+
}
|
|
971
994
|
if (live === null && mode !== "queue") {
|
|
972
995
|
const runId = crypto.randomUUID();
|
|
973
996
|
if (await queue.queueStore().claimActiveStream(threadId, runId, stale !== null ? {
|
|
@@ -980,7 +1003,7 @@ var AgentService = class {
|
|
|
980
1003
|
}
|
|
981
1004
|
}
|
|
982
1005
|
if (params.regenerate === true) {
|
|
983
|
-
throw new
|
|
1006
|
+
throw new ConflictException2({
|
|
984
1007
|
statusCode: 409,
|
|
985
1008
|
code: "run_active",
|
|
986
1009
|
message: "cannot regenerate while a turn is running on this thread"
|
|
@@ -1328,8 +1351,29 @@ var AgentService = class {
|
|
|
1328
1351
|
async signalToolCall(toolCallId2, reply) {
|
|
1329
1352
|
await this.assertNotExpired(toolCallId2);
|
|
1330
1353
|
const runId = await this.resolveRunForToolCall(toolCallId2);
|
|
1354
|
+
await this.assertRunWaiting(runId);
|
|
1331
1355
|
return this.runner.signal(runId, toolCallId2, reply);
|
|
1332
1356
|
}
|
|
1357
|
+
/**
|
|
1358
|
+
* Refuse a decision addressed at a run that is over (`409 run_not_active`). The runtime would take
|
|
1359
|
+
* the signal and buffer it for a run that never comes back — the person's "yes" is accepted, the
|
|
1360
|
+
* card says so, and nothing runs. Settles the calls the dead run left awaiting a decision on the
|
|
1361
|
+
* way out, so the card stops asking. A runner that cannot say whether a run is alive is taken at
|
|
1362
|
+
* its word that it is, and so is one that fails to answer.
|
|
1363
|
+
*/
|
|
1364
|
+
async assertRunWaiting(runId) {
|
|
1365
|
+
if (typeof this.runner.isRunActive !== "function") {
|
|
1366
|
+
return;
|
|
1367
|
+
}
|
|
1368
|
+
const active = await this.runner.isRunActive(runId).catch(() => true);
|
|
1369
|
+
if (active) {
|
|
1370
|
+
return;
|
|
1371
|
+
}
|
|
1372
|
+
await settleDeadRun(this.store, {
|
|
1373
|
+
runId
|
|
1374
|
+
});
|
|
1375
|
+
throw new RunNotActiveException(runId);
|
|
1376
|
+
}
|
|
1333
1377
|
async cancel(actor, runId) {
|
|
1334
1378
|
await this.assertOwnsActiveStream(actor, runId);
|
|
1335
1379
|
return this.runner.cancel(runId);
|
|
@@ -2013,7 +2057,7 @@ AttachmentsController = _ts_decorate6([
|
|
|
2013
2057
|
], AttachmentsController);
|
|
2014
2058
|
|
|
2015
2059
|
// src/controller/chat.controller.ts
|
|
2016
|
-
import { AGENT_ACTOR_RESOLVER as AGENT_ACTOR_RESOLVER2, AgentStreamError } from "@dudousxd/nestjs-agent-core";
|
|
2060
|
+
import { AGENT_ACTOR_RESOLVER as AGENT_ACTOR_RESOLVER2, AgentStreamError, streamFailure } from "@dudousxd/nestjs-agent-core";
|
|
2017
2061
|
import { BadRequestException as BadRequestException3, Body, Controller as Controller3, Get as Get3, Inject as Inject6, Param, Post as Post2, Query, Req as Req2, Res } from "@nestjs/common";
|
|
2018
2062
|
function _ts_decorate7(decorators, target, key, desc) {
|
|
2019
2063
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
@@ -2209,10 +2253,7 @@ data: ${line}
|
|
|
2209
2253
|
const payload = error instanceof AgentStreamError ? {
|
|
2210
2254
|
code: error.code,
|
|
2211
2255
|
message: error.message
|
|
2212
|
-
} :
|
|
2213
|
-
code: "run_failed",
|
|
2214
|
-
message: error instanceof Error ? error.message : "stream error"
|
|
2215
|
-
};
|
|
2256
|
+
} : streamFailure(error);
|
|
2216
2257
|
res.write(`event: error
|
|
2217
2258
|
data: ${JSON.stringify(payload)}
|
|
2218
2259
|
|
|
@@ -4228,7 +4269,7 @@ var LedgerQuotaProvider = class {
|
|
|
4228
4269
|
};
|
|
4229
4270
|
|
|
4230
4271
|
// src/runner/inline-agent-runner.ts
|
|
4231
|
-
import { AGENT_DEPS_FACTORY as AGENT_DEPS_FACTORY4, AGENT_STORE as AGENT_STORE4, RunCancelledError, agentFailureCode, encodeStreamEvent as encodeStreamEvent2, publishAgentRunFailed, releaseThreadRun, runAgentLoop, settleAll, settleUnsettledDelegation } from "@dudousxd/nestjs-agent-core";
|
|
4272
|
+
import { AGENT_DEPS_FACTORY as AGENT_DEPS_FACTORY4, AGENT_STORE as AGENT_STORE4, RUN_ENDED_BEFORE_TOOL_CALL, RunCancelledError, agentFailureCode, encodeStreamEvent as encodeStreamEvent2, publishAgentRunFailed, releaseThreadRun, runAgentLoop, settleAll, settleUnsettledDelegation, streamFailure as streamFailure2 } from "@dudousxd/nestjs-agent-core";
|
|
4232
4273
|
import { Inject as Inject20, Injectable as Injectable8, Logger as Logger5, Optional as Optional8 } from "@nestjs/common";
|
|
4233
4274
|
function _ts_decorate21(decorators, target, key, desc) {
|
|
4234
4275
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
@@ -4283,7 +4324,15 @@ var InlineAgentRunner = class _InlineAgentRunner {
|
|
|
4283
4324
|
* that was running it is gone (a restart), and a thread it still holds is a stale claim.
|
|
4284
4325
|
*/
|
|
4285
4326
|
async isRunActive(runId) {
|
|
4286
|
-
|
|
4327
|
+
if (this.live.has(runId)) {
|
|
4328
|
+
return true;
|
|
4329
|
+
}
|
|
4330
|
+
for (const key of this.pending.keys()) {
|
|
4331
|
+
if (key.startsWith(`${runId}:`)) {
|
|
4332
|
+
return true;
|
|
4333
|
+
}
|
|
4334
|
+
}
|
|
4335
|
+
return false;
|
|
4287
4336
|
}
|
|
4288
4337
|
async start(input, options = {}) {
|
|
4289
4338
|
const runId = options.runId ?? crypto.randomUUID();
|
|
@@ -4326,13 +4375,11 @@ var InlineAgentRunner = class _InlineAgentRunner {
|
|
|
4326
4375
|
errorCode: code,
|
|
4327
4376
|
errorMessage: message
|
|
4328
4377
|
});
|
|
4378
|
+
await Promise.resolve(this.store.failUnsettledToolCalls?.(runId, RUN_ENDED_BEFORE_TOOL_CALL)).catch(() => 0);
|
|
4329
4379
|
const writer = await deps.sink.open(runId);
|
|
4330
4380
|
await this.settleQueue(writer, input, runId, "failed", message);
|
|
4331
4381
|
await releaseThreadRun(this.store, input.threadId, runId);
|
|
4332
|
-
await writer.fail(
|
|
4333
|
-
code,
|
|
4334
|
-
message
|
|
4335
|
-
});
|
|
4382
|
+
await writer.fail(streamFailure2(error));
|
|
4336
4383
|
}).finally(() => {
|
|
4337
4384
|
this.cancelled.delete(runId);
|
|
4338
4385
|
this.live.delete(runId);
|
|
@@ -4606,6 +4653,7 @@ var InlineAgentRunner = class _InlineAgentRunner {
|
|
|
4606
4653
|
errorMessage: message
|
|
4607
4654
|
}
|
|
4608
4655
|
});
|
|
4656
|
+
await Promise.resolve(this.store.failUnsettledToolCalls?.(runId, RUN_ENDED_BEFORE_TOOL_CALL)).catch(() => 0);
|
|
4609
4657
|
await settleUnsettledDelegation({
|
|
4610
4658
|
store: this.store,
|
|
4611
4659
|
delivery: deliverTo,
|
|
@@ -5204,6 +5252,7 @@ export {
|
|
|
5204
5252
|
MessagesController,
|
|
5205
5253
|
ModelsController,
|
|
5206
5254
|
QueueController,
|
|
5255
|
+
RunNotActiveException,
|
|
5207
5256
|
SKILL_METADATA,
|
|
5208
5257
|
SYSTEM_PROMPT_CONTRIBUTOR_METADATA,
|
|
5209
5258
|
SYSTEM_PROMPT_METADATA,
|