@dudousxd/nestjs-agent 1.5.0 → 1.6.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 +14 -0
- package/dist/durable/index.cjs +459 -313
- package/dist/durable/index.cjs.map +1 -1
- package/dist/durable/index.js +363 -217
- package/dist/durable/index.js.map +1 -1
- package/dist/index.cjs +465 -317
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +29 -2
- package/dist/index.d.ts +29 -2
- package/dist/index.js +364 -217
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DynamicModule, OnModuleInit, Type, OnApplicationBootstrap } from '@nestjs/common';
|
|
2
2
|
import { b as AgentModuleOptions, c as AgentModuleAsyncOptions, A as AgentDepsFactory, d as AgentSkillsOptions } from './agent-deps.factory-CUyVPsa1.cjs';
|
|
3
3
|
export { e as AGENT_TOOL_BRAND, f as AgentAttachmentsOptions, g as AgentDeps, h as AgentMemoryOptions, a as AgentSurface, F as FunctionalTool, i as delegateToolName, p as provideAgentTool, u as utcDay } from './agent-deps.factory-CUyVPsa1.cjs';
|
|
4
|
-
import { AgentRunner, AgentStore, QuotaStore, AttachmentStagingStore, Actor, AttachmentRef, PageContext, HumanReply, ThreadSummary, ThreadDetail, UpdateThreadInput, StagedAttachment, QuotaView, AgentApprovalPort, ActorResolver, MessageAttachment, ToolPresentation, AgentHistoryWindow, AgentIntake, SkillContext, ToolRegistry, AgentRegistry, PromptContributor, SkillsConfig, SkillCatalogEntry, ToolCatalogEntry, MemoryConfig, MemoryDigestEntry, SkillProvider, AgentRunInput, TokenStreamSink, SinkWriter, QuotaState } from '@dudousxd/nestjs-agent-core';
|
|
4
|
+
import { AgentRunner, AgentStore, QuotaStore, AttachmentStagingStore, Actor, AttachmentRef, PageContext, HumanReply, ThreadSummary, ThreadDetail, UpdateThreadInput, MessageFeedbackValue, MessageFeedback, StagedAttachment, QuotaView, AgentApprovalPort, ActorResolver, MessageAttachment, ToolPresentation, AgentHistoryWindow, AgentIntake, SkillContext, ToolRegistry, AgentRegistry, PromptContributor, SkillsConfig, SkillCatalogEntry, ToolCatalogEntry, MemoryConfig, MemoryDigestEntry, SkillProvider, AgentRunInput, TokenStreamSink, SinkWriter, QuotaState } from '@dudousxd/nestjs-agent-core';
|
|
5
5
|
export * from '@dudousxd/nestjs-agent-core';
|
|
6
6
|
import { Request } from 'express';
|
|
7
7
|
import { StandardSchemaV1 } from '@standard-schema/spec';
|
|
@@ -152,6 +152,15 @@ declare class AgentService {
|
|
|
152
152
|
* thread-scoped mutations.
|
|
153
153
|
*/
|
|
154
154
|
truncateThreadFrom(actor: Actor, threadId: string, messageId: string): Promise<void>;
|
|
155
|
+
/**
|
|
156
|
+
* Rate a message in one of `actor`'s threads: `'up'`/`'down'` with an optional comment, or `null`
|
|
157
|
+
* to clear the rating. Answers `404` for an unknown message, `403` for another actor's, and `501`
|
|
158
|
+
* on a store without `threadOfMessage` + `setMessageFeedback`.
|
|
159
|
+
*/
|
|
160
|
+
setMessageFeedback(actor: Actor, messageId: string, input: {
|
|
161
|
+
value: MessageFeedbackValue | null;
|
|
162
|
+
comment?: string;
|
|
163
|
+
}): Promise<MessageFeedback | null>;
|
|
155
164
|
/**
|
|
156
165
|
* Every file this actor has staged, newest first — across threads, including uploads that were
|
|
157
166
|
* never sent, which nothing else on this surface can see.
|
|
@@ -668,6 +677,24 @@ declare class SkillsController {
|
|
|
668
677
|
threadId?: string): Promise<SkillCatalogEntry[]>;
|
|
669
678
|
}
|
|
670
679
|
|
|
680
|
+
interface FeedbackBody {
|
|
681
|
+
/** `null` clears the rating. */
|
|
682
|
+
value: MessageFeedbackValue | null;
|
|
683
|
+
comment?: string;
|
|
684
|
+
}
|
|
685
|
+
declare class MessagesController {
|
|
686
|
+
private readonly agent;
|
|
687
|
+
private readonly actorResolver;
|
|
688
|
+
constructor(agent: AgentService, actorResolver: ActorResolver);
|
|
689
|
+
/**
|
|
690
|
+
* Rate a message: `{ value: 'up' | 'down' | null, comment? }`. Answers the stored rating
|
|
691
|
+
* (`{ feedback: null }` once cleared). Only the thread's owner may rate its messages.
|
|
692
|
+
*/
|
|
693
|
+
feedback(req: Request, id: string, body: FeedbackBody): Promise<{
|
|
694
|
+
feedback: MessageFeedback | null;
|
|
695
|
+
}>;
|
|
696
|
+
}
|
|
697
|
+
|
|
671
698
|
/**
|
|
672
699
|
* The tools THIS caller can reach through an agent, with how a chat surface should talk about each
|
|
673
700
|
* one (`@AiTool({ presentation })`) — so a client narrates "Querying orders" instead of printing
|
|
@@ -871,4 +898,4 @@ declare class HeaderActorResolver implements ActorResolver {
|
|
|
871
898
|
resolve(req: unknown): Actor;
|
|
872
899
|
}
|
|
873
900
|
|
|
874
|
-
export { AGENT_METADATA, AI_TOOL_METADATA, ATTACHMENT_PAGE_SIZE, Agent, AgentApprovalPortAdapter, AgentDepsFactory, AgentDiscoveryService, AgentModule, AgentModuleAsyncOptions, AgentModuleOptions, type AgentOptions, AgentService, AgentSkillsOptions, AiTool, AiToolDiscoveryService, type AiToolOptions, AttachmentsController, type ChatParams, DEFAULT_ALLOWED_ATTACHMENT_CONTENT_TYPES, DEFAULT_MAX_ATTACHMENT_BYTES, type DeclaredSkill, HeaderActorResolver, InProcessTokenStreamSink, InlineAgentRunner, LedgerQuotaStore, MemoriesController, SKILL_METADATA, SYSTEM_PROMPT_CONTRIBUTOR_METADATA, SYSTEM_PROMPT_METADATA, Skill, type SkillBody, SkillDiscoveryService, type SkillOptions, SkillsController, SystemPrompt, SystemPromptContributor, type ThreadDefaultAgentReader, ToolsController, declaredSkillProvider, readAgentMetadata, readAiToolMetadata, readSkillMetadata, resolveSkillsConfig, skillScope };
|
|
901
|
+
export { AGENT_METADATA, AI_TOOL_METADATA, ATTACHMENT_PAGE_SIZE, Agent, AgentApprovalPortAdapter, AgentDepsFactory, AgentDiscoveryService, AgentModule, AgentModuleAsyncOptions, AgentModuleOptions, type AgentOptions, AgentService, AgentSkillsOptions, AiTool, AiToolDiscoveryService, type AiToolOptions, AttachmentsController, type ChatParams, DEFAULT_ALLOWED_ATTACHMENT_CONTENT_TYPES, DEFAULT_MAX_ATTACHMENT_BYTES, type DeclaredSkill, HeaderActorResolver, InProcessTokenStreamSink, InlineAgentRunner, LedgerQuotaStore, MemoriesController, MessagesController, SKILL_METADATA, SYSTEM_PROMPT_CONTRIBUTOR_METADATA, SYSTEM_PROMPT_METADATA, Skill, type SkillBody, SkillDiscoveryService, type SkillOptions, SkillsController, SystemPrompt, SystemPromptContributor, type ThreadDefaultAgentReader, ToolsController, declaredSkillProvider, readAgentMetadata, readAiToolMetadata, readSkillMetadata, resolveSkillsConfig, skillScope };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DynamicModule, OnModuleInit, Type, OnApplicationBootstrap } from '@nestjs/common';
|
|
2
2
|
import { b as AgentModuleOptions, c as AgentModuleAsyncOptions, A as AgentDepsFactory, d as AgentSkillsOptions } from './agent-deps.factory-CUyVPsa1.js';
|
|
3
3
|
export { e as AGENT_TOOL_BRAND, f as AgentAttachmentsOptions, g as AgentDeps, h as AgentMemoryOptions, a as AgentSurface, F as FunctionalTool, i as delegateToolName, p as provideAgentTool, u as utcDay } from './agent-deps.factory-CUyVPsa1.js';
|
|
4
|
-
import { AgentRunner, AgentStore, QuotaStore, AttachmentStagingStore, Actor, AttachmentRef, PageContext, HumanReply, ThreadSummary, ThreadDetail, UpdateThreadInput, StagedAttachment, QuotaView, AgentApprovalPort, ActorResolver, MessageAttachment, ToolPresentation, AgentHistoryWindow, AgentIntake, SkillContext, ToolRegistry, AgentRegistry, PromptContributor, SkillsConfig, SkillCatalogEntry, ToolCatalogEntry, MemoryConfig, MemoryDigestEntry, SkillProvider, AgentRunInput, TokenStreamSink, SinkWriter, QuotaState } from '@dudousxd/nestjs-agent-core';
|
|
4
|
+
import { AgentRunner, AgentStore, QuotaStore, AttachmentStagingStore, Actor, AttachmentRef, PageContext, HumanReply, ThreadSummary, ThreadDetail, UpdateThreadInput, MessageFeedbackValue, MessageFeedback, StagedAttachment, QuotaView, AgentApprovalPort, ActorResolver, MessageAttachment, ToolPresentation, AgentHistoryWindow, AgentIntake, SkillContext, ToolRegistry, AgentRegistry, PromptContributor, SkillsConfig, SkillCatalogEntry, ToolCatalogEntry, MemoryConfig, MemoryDigestEntry, SkillProvider, AgentRunInput, TokenStreamSink, SinkWriter, QuotaState } from '@dudousxd/nestjs-agent-core';
|
|
5
5
|
export * from '@dudousxd/nestjs-agent-core';
|
|
6
6
|
import { Request } from 'express';
|
|
7
7
|
import { StandardSchemaV1 } from '@standard-schema/spec';
|
|
@@ -152,6 +152,15 @@ declare class AgentService {
|
|
|
152
152
|
* thread-scoped mutations.
|
|
153
153
|
*/
|
|
154
154
|
truncateThreadFrom(actor: Actor, threadId: string, messageId: string): Promise<void>;
|
|
155
|
+
/**
|
|
156
|
+
* Rate a message in one of `actor`'s threads: `'up'`/`'down'` with an optional comment, or `null`
|
|
157
|
+
* to clear the rating. Answers `404` for an unknown message, `403` for another actor's, and `501`
|
|
158
|
+
* on a store without `threadOfMessage` + `setMessageFeedback`.
|
|
159
|
+
*/
|
|
160
|
+
setMessageFeedback(actor: Actor, messageId: string, input: {
|
|
161
|
+
value: MessageFeedbackValue | null;
|
|
162
|
+
comment?: string;
|
|
163
|
+
}): Promise<MessageFeedback | null>;
|
|
155
164
|
/**
|
|
156
165
|
* Every file this actor has staged, newest first — across threads, including uploads that were
|
|
157
166
|
* never sent, which nothing else on this surface can see.
|
|
@@ -668,6 +677,24 @@ declare class SkillsController {
|
|
|
668
677
|
threadId?: string): Promise<SkillCatalogEntry[]>;
|
|
669
678
|
}
|
|
670
679
|
|
|
680
|
+
interface FeedbackBody {
|
|
681
|
+
/** `null` clears the rating. */
|
|
682
|
+
value: MessageFeedbackValue | null;
|
|
683
|
+
comment?: string;
|
|
684
|
+
}
|
|
685
|
+
declare class MessagesController {
|
|
686
|
+
private readonly agent;
|
|
687
|
+
private readonly actorResolver;
|
|
688
|
+
constructor(agent: AgentService, actorResolver: ActorResolver);
|
|
689
|
+
/**
|
|
690
|
+
* Rate a message: `{ value: 'up' | 'down' | null, comment? }`. Answers the stored rating
|
|
691
|
+
* (`{ feedback: null }` once cleared). Only the thread's owner may rate its messages.
|
|
692
|
+
*/
|
|
693
|
+
feedback(req: Request, id: string, body: FeedbackBody): Promise<{
|
|
694
|
+
feedback: MessageFeedback | null;
|
|
695
|
+
}>;
|
|
696
|
+
}
|
|
697
|
+
|
|
671
698
|
/**
|
|
672
699
|
* The tools THIS caller can reach through an agent, with how a chat surface should talk about each
|
|
673
700
|
* one (`@AiTool({ presentation })`) — so a client narrates "Querying orders" instead of printing
|
|
@@ -871,4 +898,4 @@ declare class HeaderActorResolver implements ActorResolver {
|
|
|
871
898
|
resolve(req: unknown): Actor;
|
|
872
899
|
}
|
|
873
900
|
|
|
874
|
-
export { AGENT_METADATA, AI_TOOL_METADATA, ATTACHMENT_PAGE_SIZE, Agent, AgentApprovalPortAdapter, AgentDepsFactory, AgentDiscoveryService, AgentModule, AgentModuleAsyncOptions, AgentModuleOptions, type AgentOptions, AgentService, AgentSkillsOptions, AiTool, AiToolDiscoveryService, type AiToolOptions, AttachmentsController, type ChatParams, DEFAULT_ALLOWED_ATTACHMENT_CONTENT_TYPES, DEFAULT_MAX_ATTACHMENT_BYTES, type DeclaredSkill, HeaderActorResolver, InProcessTokenStreamSink, InlineAgentRunner, LedgerQuotaStore, MemoriesController, SKILL_METADATA, SYSTEM_PROMPT_CONTRIBUTOR_METADATA, SYSTEM_PROMPT_METADATA, Skill, type SkillBody, SkillDiscoveryService, type SkillOptions, SkillsController, SystemPrompt, SystemPromptContributor, type ThreadDefaultAgentReader, ToolsController, declaredSkillProvider, readAgentMetadata, readAiToolMetadata, readSkillMetadata, resolveSkillsConfig, skillScope };
|
|
901
|
+
export { AGENT_METADATA, AI_TOOL_METADATA, ATTACHMENT_PAGE_SIZE, Agent, AgentApprovalPortAdapter, AgentDepsFactory, AgentDiscoveryService, AgentModule, AgentModuleAsyncOptions, AgentModuleOptions, type AgentOptions, AgentService, AgentSkillsOptions, AiTool, AiToolDiscoveryService, type AiToolOptions, AttachmentsController, type ChatParams, DEFAULT_ALLOWED_ATTACHMENT_CONTENT_TYPES, DEFAULT_MAX_ATTACHMENT_BYTES, type DeclaredSkill, HeaderActorResolver, InProcessTokenStreamSink, InlineAgentRunner, LedgerQuotaStore, MemoriesController, MessagesController, SKILL_METADATA, SYSTEM_PROMPT_CONTRIBUTOR_METADATA, SYSTEM_PROMPT_METADATA, Skill, type SkillBody, SkillDiscoveryService, type SkillOptions, SkillsController, SystemPrompt, SystemPromptContributor, type ThreadDefaultAgentReader, ToolsController, declaredSkillProvider, readAgentMetadata, readAiToolMetadata, readSkillMetadata, resolveSkillsConfig, skillScope };
|