@dudousxd/nestjs-agent 1.20.0 → 1.21.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 +51 -0
- package/dist/{chat-queue.service-C0hr7dqx.d.ts → chat-queue.service-CGsR40Ct.d.cts} +16 -2
- package/dist/{chat-queue.service-C0hr7dqx.d.cts → chat-queue.service-XG9RQCjU.d.ts} +16 -2
- package/dist/durable/index.cjs +1556 -830
- package/dist/durable/index.cjs.map +1 -1
- package/dist/durable/index.d.cts +3 -1
- package/dist/durable/index.d.ts +3 -1
- package/dist/durable/index.js +1290 -564
- package/dist/durable/index.js.map +1 -1
- package/dist/genui/index.d.cts +1 -1
- package/dist/genui/index.d.ts +1 -1
- package/dist/index.cjs +1487 -825
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +111 -9
- package/dist/index.d.ts +111 -9
- package/dist/index.js +1258 -599
- package/dist/index.js.map +1 -1
- package/package.json +6 -6
package/dist/index.d.cts
CHANGED
|
@@ -1,17 +1,58 @@
|
|
|
1
|
-
import { DynamicModule, Type, OnApplicationBootstrap, OnModuleInit, ConflictException } from '@nestjs/common';
|
|
2
|
-
import { b as AgentModuleOptions, c as AgentModuleAsyncOptions, A as AgentDepsFactory, C as ChatQueueService, d as AgentProtocolAdapter, e as AgentSkillsOptions } from './chat-queue.service-
|
|
3
|
-
export { f as AGENT_TOOL_BRAND, g as AgentAttachmentsOptions, h as AgentDeps, i as AgentMemoryOptions, a as AgentSurface, F as FunctionalTool, L as LedgerQuotaProvider, Q as QueuePlan, j as QueueSettleOutcome, k as QueuedTurn, l as QueuedTurnStarter, m as QuotaLimits, n as QuotaWindowLimits, o as delegateToolName, p as provideAgentTool, q as provideAgentTools, u as utcDay } from './chat-queue.service-
|
|
4
|
-
import
|
|
1
|
+
import { DynamicModule, Type, OnApplicationBootstrap, OnModuleInit, ConflictException, OnModuleDestroy } from '@nestjs/common';
|
|
2
|
+
import { b as AgentModuleOptions, c as AgentModuleAsyncOptions, A as AgentDepsFactory, C as ChatQueueService, d as AgentProtocolAdapter, e as AgentSkillsOptions } from './chat-queue.service-CGsR40Ct.cjs';
|
|
3
|
+
export { f as AGENT_TOOL_BRAND, g as AgentAttachmentsOptions, h as AgentDeps, i as AgentMemoryOptions, a as AgentSurface, F as FunctionalTool, L as LedgerQuotaProvider, Q as QueuePlan, j as QueueSettleOutcome, k as QueuedTurn, l as QueuedTurnStarter, m as QuotaLimits, n as QuotaWindowLimits, o as delegateToolName, p as provideAgentTool, q as provideAgentTools, u as utcDay } from './chat-queue.service-CGsR40Ct.cjs';
|
|
4
|
+
import * as _dudousxd_nestjs_agent_core from '@dudousxd/nestjs-agent-core';
|
|
5
|
+
import { AgentStore, Actor, ListActionProposals, ActionProposalMutationResult, AgentRunner, AttachmentStagingStore, ModelCatalog, QuotaProvider, QuotaReport, ModelCatalogView, AttachmentRef, PageContext, ChatQueueState, HumanReply, ThreadSummary, ThreadDetail, UpdateThreadInput, MessageFeedbackValue, MessageFeedback, StagedAttachment, ActorResolver, AgentApprovalPort, MessageAttachment, AgentAttachmentConfig, AgentClientConfig, ToolSpec, ToolPresentation, AgentHistoryWindow, AgentIntake, Persona, SkillContext, ToolRegistry, AgentRegistry, PromptContributor, SkillsConfig, SkillCatalogEntry, ToolCatalogEntry, MemoryConfig, MemoryDigestEntry, SkillProvider, AgentRunInput, AgentRunStartOptions, TokenStreamSink, SinkWriter } from '@dudousxd/nestjs-agent-core';
|
|
5
6
|
export * from '@dudousxd/nestjs-agent-core';
|
|
6
7
|
import { Request, Response } from 'express';
|
|
8
|
+
import { UiCapabilities } from '@dudousxd/nestjs-agent-core/genui';
|
|
7
9
|
import { StandardSchemaV1 } from '@standard-schema/spec';
|
|
8
10
|
import { DiscoveryService, MetadataScanner } from '@nestjs/core';
|
|
11
|
+
import './genui/index.cjs';
|
|
9
12
|
|
|
10
13
|
declare class AgentModule {
|
|
11
14
|
static forRoot(options: AgentModuleOptions): DynamicModule;
|
|
12
15
|
static forRootAsync(options: AgentModuleAsyncOptions): DynamicModule;
|
|
13
16
|
}
|
|
14
17
|
|
|
18
|
+
declare class ActionProposalService {
|
|
19
|
+
private readonly store;
|
|
20
|
+
private readonly options;
|
|
21
|
+
constructor(store: AgentStore, options: Pick<AgentModuleOptions, 'approvalPolicy'>);
|
|
22
|
+
private capability;
|
|
23
|
+
private scope;
|
|
24
|
+
private mayDecide;
|
|
25
|
+
listPage(threadId: string, actor: Actor, query?: Pick<ListActionProposals, 'after'>): Promise<{
|
|
26
|
+
next?: {
|
|
27
|
+
createdAt: number;
|
|
28
|
+
id: string;
|
|
29
|
+
};
|
|
30
|
+
items: _dudousxd_nestjs_agent_core.ActionProposal[];
|
|
31
|
+
}>;
|
|
32
|
+
list(threadId: string, actor: Actor): Promise<_dudousxd_nestjs_agent_core.ActionProposal[]>;
|
|
33
|
+
decide(threadId: string, proposalId: string, actor: Actor, command: {
|
|
34
|
+
decision: 'approved' | 'rejected';
|
|
35
|
+
remember?: boolean;
|
|
36
|
+
reason?: string;
|
|
37
|
+
via?: string;
|
|
38
|
+
}): Promise<ActionProposalMutationResult>;
|
|
39
|
+
handleTextDecision(threadId: string, actor: Actor, text: string): Promise<{
|
|
40
|
+
status: "unmatched";
|
|
41
|
+
} | {
|
|
42
|
+
threadId: string;
|
|
43
|
+
proposalDecision: ActionProposalMutationResult;
|
|
44
|
+
text: string;
|
|
45
|
+
} | {
|
|
46
|
+
threadId: string;
|
|
47
|
+
proposalDecision: {
|
|
48
|
+
status: "ambiguous";
|
|
49
|
+
proposalIds: string[];
|
|
50
|
+
};
|
|
51
|
+
text: string;
|
|
52
|
+
}>;
|
|
53
|
+
private textReceipt;
|
|
54
|
+
}
|
|
55
|
+
|
|
15
56
|
/**
|
|
16
57
|
* What a send does when its thread already has a turn running:
|
|
17
58
|
* - `'auto'` (default) — run now when the thread is idle, else wait in the thread's queue.
|
|
@@ -39,8 +80,14 @@ type ChatSendResult = {
|
|
|
39
80
|
runId: string;
|
|
40
81
|
threadId: string;
|
|
41
82
|
queued?: undefined;
|
|
42
|
-
} | QueuedSend
|
|
83
|
+
} | QueuedSend | {
|
|
84
|
+
threadId: string;
|
|
85
|
+
proposalDecision: unknown;
|
|
86
|
+
text: string;
|
|
87
|
+
queued?: undefined;
|
|
88
|
+
};
|
|
43
89
|
interface ChatParams {
|
|
90
|
+
uiCapabilities?: UiCapabilities;
|
|
44
91
|
actor: Actor;
|
|
45
92
|
message: string;
|
|
46
93
|
threadId?: string;
|
|
@@ -103,7 +150,22 @@ declare class AgentService {
|
|
|
103
150
|
private readonly quotaProvider?;
|
|
104
151
|
private readonly options?;
|
|
105
152
|
private readonly queue?;
|
|
106
|
-
|
|
153
|
+
private readonly proposals?;
|
|
154
|
+
constructor(runner: AgentRunner, store: AgentStore, deps: AgentDepsFactory, staging?: AttachmentStagingStore | undefined, models?: ModelCatalog | undefined, quotaProvider?: QuotaProvider | undefined, options?: Pick<AgentModuleOptions, "quota" | "actionApprovalMode"> | undefined, queue?: ChatQueueService | undefined, proposals?: ActionProposalService | undefined);
|
|
155
|
+
handleTextDecision(threadId: string, actor: Actor, text: string): Promise<{
|
|
156
|
+
status: "unmatched";
|
|
157
|
+
} | {
|
|
158
|
+
threadId: string;
|
|
159
|
+
proposalDecision: _dudousxd_nestjs_agent_core.ActionProposalMutationResult;
|
|
160
|
+
text: string;
|
|
161
|
+
} | {
|
|
162
|
+
threadId: string;
|
|
163
|
+
proposalDecision: {
|
|
164
|
+
status: "ambiguous";
|
|
165
|
+
proposalIds: string[];
|
|
166
|
+
};
|
|
167
|
+
text: string;
|
|
168
|
+
}>;
|
|
107
169
|
/** The queue service when the bound store can hold a queue, else `undefined`. */
|
|
108
170
|
private queueing;
|
|
109
171
|
/** The queue service, or a 501 naming what is missing. */
|
|
@@ -149,7 +211,9 @@ declare class AgentService {
|
|
|
149
211
|
* Send a message: start a turn, or — when its thread already has one running — queue the message
|
|
150
212
|
* to run after it (see {@link ChatSendMode}). What `POST <base>/chat` calls.
|
|
151
213
|
*/
|
|
152
|
-
send(params: ChatParams
|
|
214
|
+
send(params: ChatParams, sendOptions?: {
|
|
215
|
+
textDecisions?: boolean;
|
|
216
|
+
}): Promise<ChatSendResult>;
|
|
153
217
|
/**
|
|
154
218
|
* Start a turn the thread is already claimed for, under the claimed id. A runner that minted an
|
|
155
219
|
* id of its own anyway gets the thread re-pointed at it; one that fails to start frees the thread.
|
|
@@ -492,7 +556,24 @@ declare function agUiAdapter(options?: AgUiAdapterOptions): AgentProtocolAdapter
|
|
|
492
556
|
*/
|
|
493
557
|
declare class AgentApprovalPortAdapter implements AgentApprovalPort {
|
|
494
558
|
private readonly agent;
|
|
495
|
-
|
|
559
|
+
private readonly proposals?;
|
|
560
|
+
constructor(agent: AgentService, proposals?: ActionProposalService | undefined);
|
|
561
|
+
approveActionProposal(actor: Actor, target: {
|
|
562
|
+
kind: 'proposal';
|
|
563
|
+
threadId: string;
|
|
564
|
+
proposalId: string;
|
|
565
|
+
}, opts?: {
|
|
566
|
+
remember?: boolean;
|
|
567
|
+
decidedVia?: string;
|
|
568
|
+
}): Promise<_dudousxd_nestjs_agent_core.ActionProposalMutationResult>;
|
|
569
|
+
rejectActionProposal(actor: Actor, target: {
|
|
570
|
+
kind: 'proposal';
|
|
571
|
+
threadId: string;
|
|
572
|
+
proposalId: string;
|
|
573
|
+
}, opts?: {
|
|
574
|
+
reason?: string;
|
|
575
|
+
decidedVia?: string;
|
|
576
|
+
}): Promise<_dudousxd_nestjs_agent_core.ActionProposalMutationResult>;
|
|
496
577
|
approve(toolCallId: string, opts?: {
|
|
497
578
|
executedByRef?: string;
|
|
498
579
|
remember?: boolean;
|
|
@@ -581,6 +662,7 @@ declare class ConfigController {
|
|
|
581
662
|
|
|
582
663
|
declare const AI_TOOL_METADATA: unique symbol;
|
|
583
664
|
interface AiToolOptions {
|
|
665
|
+
replacementKey?: ToolSpec['replacementKey'];
|
|
584
666
|
/**
|
|
585
667
|
* What the model calls it. Omit → the class name, camelCased, with a trailing `Tool` dropped
|
|
586
668
|
* (`GetWeatherTool` → `getWeather`).
|
|
@@ -1334,4 +1416,24 @@ declare class RunNotActiveException extends ConflictException {
|
|
|
1334
1416
|
constructor(runId: string);
|
|
1335
1417
|
}
|
|
1336
1418
|
|
|
1337
|
-
|
|
1419
|
+
declare class ActionProposalController {
|
|
1420
|
+
private readonly proposals;
|
|
1421
|
+
private readonly actors;
|
|
1422
|
+
constructor(proposals: ActionProposalService, actors: ActorResolver);
|
|
1423
|
+
list(threadId: string, request: Request, cursor: unknown, response: Response): Promise<_dudousxd_nestjs_agent_core.ActionProposal[]>;
|
|
1424
|
+
approve(threadId: string, proposalId: string, request: Request, body: unknown): Promise<_dudousxd_nestjs_agent_core.ActionProposalMutationResult>;
|
|
1425
|
+
reject(threadId: string, proposalId: string, request: Request, body: unknown): Promise<_dudousxd_nestjs_agent_core.ActionProposalMutationResult>;
|
|
1426
|
+
}
|
|
1427
|
+
|
|
1428
|
+
declare class ActionProposalWorkerService implements OnModuleInit, OnModuleDestroy {
|
|
1429
|
+
private readonly store;
|
|
1430
|
+
private readonly options;
|
|
1431
|
+
private readonly deps;
|
|
1432
|
+
private worker;
|
|
1433
|
+
private readonly logger;
|
|
1434
|
+
constructor(store: AgentStore, options: AgentModuleOptions, deps: AgentDepsFactory);
|
|
1435
|
+
onModuleInit(): void;
|
|
1436
|
+
onModuleDestroy(): Promise<void>;
|
|
1437
|
+
}
|
|
1438
|
+
|
|
1439
|
+
export { AGENT_CHAT_QUEUE, AGENT_METADATA, AI_TOOL_METADATA, ATTACHMENT_PAGE_SIZE, ActionProposalController, ActionProposalService, ActionProposalWorkerService, type AgUiAdapterOptions, AgUiRunHandler, Agent, AgentApprovalPortAdapter, AgentDepsFactory, AgentDiscoveryService, AgentModule, AgentModuleAsyncOptions, AgentModuleOptions, type AgentOptions, AgentProtocolAdapter, 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, type ThreadPersonaReader, ToolsController, agUiAdapter, attachmentLimits, declaredSkillProvider, defaultRequestUserMapper, readAgentMetadata, readAiToolMetadata, readSkillMetadata, requestUserActorResolver, resolveSkillsConfig, skillScope, threadPersona, toolNameFromClass };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,17 +1,58 @@
|
|
|
1
|
-
import { DynamicModule, Type, OnApplicationBootstrap, OnModuleInit, ConflictException } from '@nestjs/common';
|
|
2
|
-
import { b as AgentModuleOptions, c as AgentModuleAsyncOptions, A as AgentDepsFactory, C as ChatQueueService, d as AgentProtocolAdapter, e as AgentSkillsOptions } from './chat-queue.service-
|
|
3
|
-
export { f as AGENT_TOOL_BRAND, g as AgentAttachmentsOptions, h as AgentDeps, i as AgentMemoryOptions, a as AgentSurface, F as FunctionalTool, L as LedgerQuotaProvider, Q as QueuePlan, j as QueueSettleOutcome, k as QueuedTurn, l as QueuedTurnStarter, m as QuotaLimits, n as QuotaWindowLimits, o as delegateToolName, p as provideAgentTool, q as provideAgentTools, u as utcDay } from './chat-queue.service-
|
|
4
|
-
import
|
|
1
|
+
import { DynamicModule, Type, OnApplicationBootstrap, OnModuleInit, ConflictException, OnModuleDestroy } from '@nestjs/common';
|
|
2
|
+
import { b as AgentModuleOptions, c as AgentModuleAsyncOptions, A as AgentDepsFactory, C as ChatQueueService, d as AgentProtocolAdapter, e as AgentSkillsOptions } from './chat-queue.service-XG9RQCjU.js';
|
|
3
|
+
export { f as AGENT_TOOL_BRAND, g as AgentAttachmentsOptions, h as AgentDeps, i as AgentMemoryOptions, a as AgentSurface, F as FunctionalTool, L as LedgerQuotaProvider, Q as QueuePlan, j as QueueSettleOutcome, k as QueuedTurn, l as QueuedTurnStarter, m as QuotaLimits, n as QuotaWindowLimits, o as delegateToolName, p as provideAgentTool, q as provideAgentTools, u as utcDay } from './chat-queue.service-XG9RQCjU.js';
|
|
4
|
+
import * as _dudousxd_nestjs_agent_core from '@dudousxd/nestjs-agent-core';
|
|
5
|
+
import { AgentStore, Actor, ListActionProposals, ActionProposalMutationResult, AgentRunner, AttachmentStagingStore, ModelCatalog, QuotaProvider, QuotaReport, ModelCatalogView, AttachmentRef, PageContext, ChatQueueState, HumanReply, ThreadSummary, ThreadDetail, UpdateThreadInput, MessageFeedbackValue, MessageFeedback, StagedAttachment, ActorResolver, AgentApprovalPort, MessageAttachment, AgentAttachmentConfig, AgentClientConfig, ToolSpec, ToolPresentation, AgentHistoryWindow, AgentIntake, Persona, SkillContext, ToolRegistry, AgentRegistry, PromptContributor, SkillsConfig, SkillCatalogEntry, ToolCatalogEntry, MemoryConfig, MemoryDigestEntry, SkillProvider, AgentRunInput, AgentRunStartOptions, TokenStreamSink, SinkWriter } from '@dudousxd/nestjs-agent-core';
|
|
5
6
|
export * from '@dudousxd/nestjs-agent-core';
|
|
6
7
|
import { Request, Response } from 'express';
|
|
8
|
+
import { UiCapabilities } from '@dudousxd/nestjs-agent-core/genui';
|
|
7
9
|
import { StandardSchemaV1 } from '@standard-schema/spec';
|
|
8
10
|
import { DiscoveryService, MetadataScanner } from '@nestjs/core';
|
|
11
|
+
import './genui/index.js';
|
|
9
12
|
|
|
10
13
|
declare class AgentModule {
|
|
11
14
|
static forRoot(options: AgentModuleOptions): DynamicModule;
|
|
12
15
|
static forRootAsync(options: AgentModuleAsyncOptions): DynamicModule;
|
|
13
16
|
}
|
|
14
17
|
|
|
18
|
+
declare class ActionProposalService {
|
|
19
|
+
private readonly store;
|
|
20
|
+
private readonly options;
|
|
21
|
+
constructor(store: AgentStore, options: Pick<AgentModuleOptions, 'approvalPolicy'>);
|
|
22
|
+
private capability;
|
|
23
|
+
private scope;
|
|
24
|
+
private mayDecide;
|
|
25
|
+
listPage(threadId: string, actor: Actor, query?: Pick<ListActionProposals, 'after'>): Promise<{
|
|
26
|
+
next?: {
|
|
27
|
+
createdAt: number;
|
|
28
|
+
id: string;
|
|
29
|
+
};
|
|
30
|
+
items: _dudousxd_nestjs_agent_core.ActionProposal[];
|
|
31
|
+
}>;
|
|
32
|
+
list(threadId: string, actor: Actor): Promise<_dudousxd_nestjs_agent_core.ActionProposal[]>;
|
|
33
|
+
decide(threadId: string, proposalId: string, actor: Actor, command: {
|
|
34
|
+
decision: 'approved' | 'rejected';
|
|
35
|
+
remember?: boolean;
|
|
36
|
+
reason?: string;
|
|
37
|
+
via?: string;
|
|
38
|
+
}): Promise<ActionProposalMutationResult>;
|
|
39
|
+
handleTextDecision(threadId: string, actor: Actor, text: string): Promise<{
|
|
40
|
+
status: "unmatched";
|
|
41
|
+
} | {
|
|
42
|
+
threadId: string;
|
|
43
|
+
proposalDecision: ActionProposalMutationResult;
|
|
44
|
+
text: string;
|
|
45
|
+
} | {
|
|
46
|
+
threadId: string;
|
|
47
|
+
proposalDecision: {
|
|
48
|
+
status: "ambiguous";
|
|
49
|
+
proposalIds: string[];
|
|
50
|
+
};
|
|
51
|
+
text: string;
|
|
52
|
+
}>;
|
|
53
|
+
private textReceipt;
|
|
54
|
+
}
|
|
55
|
+
|
|
15
56
|
/**
|
|
16
57
|
* What a send does when its thread already has a turn running:
|
|
17
58
|
* - `'auto'` (default) — run now when the thread is idle, else wait in the thread's queue.
|
|
@@ -39,8 +80,14 @@ type ChatSendResult = {
|
|
|
39
80
|
runId: string;
|
|
40
81
|
threadId: string;
|
|
41
82
|
queued?: undefined;
|
|
42
|
-
} | QueuedSend
|
|
83
|
+
} | QueuedSend | {
|
|
84
|
+
threadId: string;
|
|
85
|
+
proposalDecision: unknown;
|
|
86
|
+
text: string;
|
|
87
|
+
queued?: undefined;
|
|
88
|
+
};
|
|
43
89
|
interface ChatParams {
|
|
90
|
+
uiCapabilities?: UiCapabilities;
|
|
44
91
|
actor: Actor;
|
|
45
92
|
message: string;
|
|
46
93
|
threadId?: string;
|
|
@@ -103,7 +150,22 @@ declare class AgentService {
|
|
|
103
150
|
private readonly quotaProvider?;
|
|
104
151
|
private readonly options?;
|
|
105
152
|
private readonly queue?;
|
|
106
|
-
|
|
153
|
+
private readonly proposals?;
|
|
154
|
+
constructor(runner: AgentRunner, store: AgentStore, deps: AgentDepsFactory, staging?: AttachmentStagingStore | undefined, models?: ModelCatalog | undefined, quotaProvider?: QuotaProvider | undefined, options?: Pick<AgentModuleOptions, "quota" | "actionApprovalMode"> | undefined, queue?: ChatQueueService | undefined, proposals?: ActionProposalService | undefined);
|
|
155
|
+
handleTextDecision(threadId: string, actor: Actor, text: string): Promise<{
|
|
156
|
+
status: "unmatched";
|
|
157
|
+
} | {
|
|
158
|
+
threadId: string;
|
|
159
|
+
proposalDecision: _dudousxd_nestjs_agent_core.ActionProposalMutationResult;
|
|
160
|
+
text: string;
|
|
161
|
+
} | {
|
|
162
|
+
threadId: string;
|
|
163
|
+
proposalDecision: {
|
|
164
|
+
status: "ambiguous";
|
|
165
|
+
proposalIds: string[];
|
|
166
|
+
};
|
|
167
|
+
text: string;
|
|
168
|
+
}>;
|
|
107
169
|
/** The queue service when the bound store can hold a queue, else `undefined`. */
|
|
108
170
|
private queueing;
|
|
109
171
|
/** The queue service, or a 501 naming what is missing. */
|
|
@@ -149,7 +211,9 @@ declare class AgentService {
|
|
|
149
211
|
* Send a message: start a turn, or — when its thread already has one running — queue the message
|
|
150
212
|
* to run after it (see {@link ChatSendMode}). What `POST <base>/chat` calls.
|
|
151
213
|
*/
|
|
152
|
-
send(params: ChatParams
|
|
214
|
+
send(params: ChatParams, sendOptions?: {
|
|
215
|
+
textDecisions?: boolean;
|
|
216
|
+
}): Promise<ChatSendResult>;
|
|
153
217
|
/**
|
|
154
218
|
* Start a turn the thread is already claimed for, under the claimed id. A runner that minted an
|
|
155
219
|
* id of its own anyway gets the thread re-pointed at it; one that fails to start frees the thread.
|
|
@@ -492,7 +556,24 @@ declare function agUiAdapter(options?: AgUiAdapterOptions): AgentProtocolAdapter
|
|
|
492
556
|
*/
|
|
493
557
|
declare class AgentApprovalPortAdapter implements AgentApprovalPort {
|
|
494
558
|
private readonly agent;
|
|
495
|
-
|
|
559
|
+
private readonly proposals?;
|
|
560
|
+
constructor(agent: AgentService, proposals?: ActionProposalService | undefined);
|
|
561
|
+
approveActionProposal(actor: Actor, target: {
|
|
562
|
+
kind: 'proposal';
|
|
563
|
+
threadId: string;
|
|
564
|
+
proposalId: string;
|
|
565
|
+
}, opts?: {
|
|
566
|
+
remember?: boolean;
|
|
567
|
+
decidedVia?: string;
|
|
568
|
+
}): Promise<_dudousxd_nestjs_agent_core.ActionProposalMutationResult>;
|
|
569
|
+
rejectActionProposal(actor: Actor, target: {
|
|
570
|
+
kind: 'proposal';
|
|
571
|
+
threadId: string;
|
|
572
|
+
proposalId: string;
|
|
573
|
+
}, opts?: {
|
|
574
|
+
reason?: string;
|
|
575
|
+
decidedVia?: string;
|
|
576
|
+
}): Promise<_dudousxd_nestjs_agent_core.ActionProposalMutationResult>;
|
|
496
577
|
approve(toolCallId: string, opts?: {
|
|
497
578
|
executedByRef?: string;
|
|
498
579
|
remember?: boolean;
|
|
@@ -581,6 +662,7 @@ declare class ConfigController {
|
|
|
581
662
|
|
|
582
663
|
declare const AI_TOOL_METADATA: unique symbol;
|
|
583
664
|
interface AiToolOptions {
|
|
665
|
+
replacementKey?: ToolSpec['replacementKey'];
|
|
584
666
|
/**
|
|
585
667
|
* What the model calls it. Omit → the class name, camelCased, with a trailing `Tool` dropped
|
|
586
668
|
* (`GetWeatherTool` → `getWeather`).
|
|
@@ -1334,4 +1416,24 @@ declare class RunNotActiveException extends ConflictException {
|
|
|
1334
1416
|
constructor(runId: string);
|
|
1335
1417
|
}
|
|
1336
1418
|
|
|
1337
|
-
|
|
1419
|
+
declare class ActionProposalController {
|
|
1420
|
+
private readonly proposals;
|
|
1421
|
+
private readonly actors;
|
|
1422
|
+
constructor(proposals: ActionProposalService, actors: ActorResolver);
|
|
1423
|
+
list(threadId: string, request: Request, cursor: unknown, response: Response): Promise<_dudousxd_nestjs_agent_core.ActionProposal[]>;
|
|
1424
|
+
approve(threadId: string, proposalId: string, request: Request, body: unknown): Promise<_dudousxd_nestjs_agent_core.ActionProposalMutationResult>;
|
|
1425
|
+
reject(threadId: string, proposalId: string, request: Request, body: unknown): Promise<_dudousxd_nestjs_agent_core.ActionProposalMutationResult>;
|
|
1426
|
+
}
|
|
1427
|
+
|
|
1428
|
+
declare class ActionProposalWorkerService implements OnModuleInit, OnModuleDestroy {
|
|
1429
|
+
private readonly store;
|
|
1430
|
+
private readonly options;
|
|
1431
|
+
private readonly deps;
|
|
1432
|
+
private worker;
|
|
1433
|
+
private readonly logger;
|
|
1434
|
+
constructor(store: AgentStore, options: AgentModuleOptions, deps: AgentDepsFactory);
|
|
1435
|
+
onModuleInit(): void;
|
|
1436
|
+
onModuleDestroy(): Promise<void>;
|
|
1437
|
+
}
|
|
1438
|
+
|
|
1439
|
+
export { AGENT_CHAT_QUEUE, AGENT_METADATA, AI_TOOL_METADATA, ATTACHMENT_PAGE_SIZE, ActionProposalController, ActionProposalService, ActionProposalWorkerService, type AgUiAdapterOptions, AgUiRunHandler, Agent, AgentApprovalPortAdapter, AgentDepsFactory, AgentDiscoveryService, AgentModule, AgentModuleAsyncOptions, AgentModuleOptions, type AgentOptions, AgentProtocolAdapter, 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, type ThreadPersonaReader, ToolsController, agUiAdapter, attachmentLimits, declaredSkillProvider, defaultRequestUserMapper, readAgentMetadata, readAiToolMetadata, readSkillMetadata, requestUserActorResolver, resolveSkillsConfig, skillScope, threadPersona, toolNameFromClass };
|