@dudousxd/nestjs-agent-store-drizzle 0.33.0 → 0.34.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/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as _dudousxd_nestjs_agent_core from '@dudousxd/nestjs-agent-core';
2
- import { MessageRole, ToolCallRequest, ToolResult, MessageAttachment, MessageUsage, AgentUiComponent, MessageFeedback, AgentHostContext, Actor, PageContext, QueuePause, ActionProposal, GenuiValidity, GenuiErrorCategory, CostSource, ToolKind, ToolCallStatus, ToolConfirmation, UsagePurpose, AgentStore, ThreadTurnReader, ThreadSettingsReader, ChatQueueStore, ActionProposalStore, ActionProposalWorkerStore, ActionProposalDiscoveryIndexStore, ActionProposalOutcomeStore, ActionProposalStoreOptions, ActionProposalSupersessionStore, CreateThreadInput, ThreadSummary, ThreadDetail, ThreadTurnQuery, ThreadTurnPage, ToolCallApprovalState, EnqueueMessageInput, QueuedMessage, QueuedMessagePatch, UpdateThreadInput, ThreadSettings, RecordRunStartInput, RecordRunEndInput, AppendMessageInput, StoredMessage, RecordToolCallInput, UpdateToolCallInput, ToolCallOutcome, RecordUsageInput, RecordGenuiCallInput, UsageTotals, CreateActionProposal, CreateActionProposalResult, ActionProposalScope, ActionProposalMutationResult, ListActionProposals, ActionProposalDecisionCommand, ClaimActionProposal, ExtendActionProposalLease, SettleActionProposal, ActionProposalOutcomeLease, AgentGovernanceQueries, AgentPricingStore, GovernanceRange, ModelSpendRow, ActorSpendRow, ThreadSpendRow, UsageTrendPoint, ToolCallActivityRow, ThreadActivityRow, RunMetrics, RunAgentBreakdownRow, RunErrorBreakdownRow, RunTrendPoint, RecentRunRow, PendingApprovalRow, ToolStatRow, GovernancePageQuery, ToolCallWhere, GovernancePage, ThreadWhere, RunWhere, ApprovalWhere, GovernanceRunDetail, GovernanceThreadDetailQuery, GovernanceThreadDetail, GenuiStats, MemoryProvider, ListMemoriesInput, MemoryRecord, ForgetMemoryInput, StoreMemoryInput, ModelPriceInput, CurrentModelPrice, StreamFrameTable, StreamFrameRow, SqlTokenStreamSink, SqlTokenStreamSinkOptions, ConfirmTokenStore, ConfirmTokenClaim, ChannelStore, PoppyStore, PoppyConversationRecord, PoppyConversationPatch, PoppyEventBody, StoredPoppyEvent, PoppyMessageReceipt, PoppyMessageClaim, PoppyConnectionStore, PoppyConnectionRecord, PoppyPendingConnect } from '@dudousxd/nestjs-agent-core';
2
+ import { MessageRole, ToolCallRequest, ToolResult, MessageAttachment, MessageUsage, AgentUiComponent, MessageFeedback, AgentHostContext, Actor, PageContext, QueuePause, ActionProposal, GenuiValidity, GenuiErrorCategory, CostSource, ToolKind, ToolCallStatus, ToolConfirmation, UsagePurpose, AgentStore, ThreadTurnReader, ThreadSettingsReader, ChatQueueStore, ActionProposalStore, ActionProposalWorkerStore, ActionProposalDiscoveryIndexStore, ActionProposalOutcomeStore, ActionProposalStoreOptions, ActionProposalSupersessionStore, CreateThreadInput, ThreadSummary, ThreadDetail, ThreadTurnQuery, ThreadTurnPage, ForkThreadOptions, ToolCallApprovalState, EnqueueMessageInput, QueuedMessage, QueuedMessagePatch, UpdateThreadInput, ThreadSettings, RecordRunStartInput, RecordRunEndInput, AppendMessageInput, StoredMessage, RecordToolCallInput, UpdateToolCallInput, ToolCallOutcome, RecordUsageInput, RecordGenuiCallInput, UsageTotals, CreateActionProposal, CreateActionProposalResult, ActionProposalScope, ActionProposalMutationResult, ListActionProposals, ActionProposalDecisionCommand, ClaimActionProposal, ExtendActionProposalLease, SettleActionProposal, ActionProposalOutcomeLease, AgentGovernanceQueries, AgentPricingStore, GovernanceRange, ModelSpendRow, ActorSpendRow, ThreadSpendRow, UsageTrendPoint, ToolCallActivityRow, ThreadActivityRow, RunMetrics, RunAgentBreakdownRow, RunErrorBreakdownRow, RunTrendPoint, RecentRunRow, PendingApprovalRow, ToolStatRow, GovernancePageQuery, ToolCallWhere, GovernancePage, ThreadWhere, RunWhere, ApprovalWhere, GovernanceRunDetail, GovernanceThreadDetailQuery, GovernanceThreadDetail, GenuiStats, MemoryProvider, ListMemoriesInput, MemoryRecord, ForgetMemoryInput, StoreMemoryInput, ModelPriceInput, CurrentModelPrice, StreamFrameTable, StreamFrameRow, SqlTokenStreamSink, SqlTokenStreamSinkOptions, ConfirmTokenStore, ConfirmTokenClaim, ChannelStore, PoppyStore, PoppyConversationRecord, PoppyConversationPatch, PoppyEventBody, StoredPoppyEvent, PoppyMessageReceipt, PoppyMessageClaim, PoppyConnectionStore, PoppyConnectionRecord, PoppyPendingConnect } from '@dudousxd/nestjs-agent-core';
3
3
  export { ThreadTurnPage, ThreadTurnQuery } from '@dudousxd/nestjs-agent-core';
4
4
  import * as drizzle_orm_sqlite_core from 'drizzle-orm/sqlite-core';
5
5
  import { BaseSQLiteDatabase } from 'drizzle-orm/sqlite-core';
@@ -9240,7 +9240,7 @@ declare class DrizzleAgentStore implements AgentStore, ThreadTurnReader, ThreadS
9240
9240
  */
9241
9241
  private lastMessageContents;
9242
9242
  softDeleteThread(threadId: string): Promise<void>;
9243
- forkThread(threadId: string, fromMessageId: string): Promise<ThreadSummary>;
9243
+ forkThread(threadId: string, fromMessageId: string, options?: ForkThreadOptions): Promise<ThreadSummary>;
9244
9244
  ownerOfThread(threadId: string): Promise<string | null>;
9245
9245
  ownerOfToolCall(toolCallId: string): Promise<string | null>;
9246
9246
  runForToolCall(toolCallId: string): Promise<string | null>;
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as _dudousxd_nestjs_agent_core from '@dudousxd/nestjs-agent-core';
2
- import { MessageRole, ToolCallRequest, ToolResult, MessageAttachment, MessageUsage, AgentUiComponent, MessageFeedback, AgentHostContext, Actor, PageContext, QueuePause, ActionProposal, GenuiValidity, GenuiErrorCategory, CostSource, ToolKind, ToolCallStatus, ToolConfirmation, UsagePurpose, AgentStore, ThreadTurnReader, ThreadSettingsReader, ChatQueueStore, ActionProposalStore, ActionProposalWorkerStore, ActionProposalDiscoveryIndexStore, ActionProposalOutcomeStore, ActionProposalStoreOptions, ActionProposalSupersessionStore, CreateThreadInput, ThreadSummary, ThreadDetail, ThreadTurnQuery, ThreadTurnPage, ToolCallApprovalState, EnqueueMessageInput, QueuedMessage, QueuedMessagePatch, UpdateThreadInput, ThreadSettings, RecordRunStartInput, RecordRunEndInput, AppendMessageInput, StoredMessage, RecordToolCallInput, UpdateToolCallInput, ToolCallOutcome, RecordUsageInput, RecordGenuiCallInput, UsageTotals, CreateActionProposal, CreateActionProposalResult, ActionProposalScope, ActionProposalMutationResult, ListActionProposals, ActionProposalDecisionCommand, ClaimActionProposal, ExtendActionProposalLease, SettleActionProposal, ActionProposalOutcomeLease, AgentGovernanceQueries, AgentPricingStore, GovernanceRange, ModelSpendRow, ActorSpendRow, ThreadSpendRow, UsageTrendPoint, ToolCallActivityRow, ThreadActivityRow, RunMetrics, RunAgentBreakdownRow, RunErrorBreakdownRow, RunTrendPoint, RecentRunRow, PendingApprovalRow, ToolStatRow, GovernancePageQuery, ToolCallWhere, GovernancePage, ThreadWhere, RunWhere, ApprovalWhere, GovernanceRunDetail, GovernanceThreadDetailQuery, GovernanceThreadDetail, GenuiStats, MemoryProvider, ListMemoriesInput, MemoryRecord, ForgetMemoryInput, StoreMemoryInput, ModelPriceInput, CurrentModelPrice, StreamFrameTable, StreamFrameRow, SqlTokenStreamSink, SqlTokenStreamSinkOptions, ConfirmTokenStore, ConfirmTokenClaim, ChannelStore, PoppyStore, PoppyConversationRecord, PoppyConversationPatch, PoppyEventBody, StoredPoppyEvent, PoppyMessageReceipt, PoppyMessageClaim, PoppyConnectionStore, PoppyConnectionRecord, PoppyPendingConnect } from '@dudousxd/nestjs-agent-core';
2
+ import { MessageRole, ToolCallRequest, ToolResult, MessageAttachment, MessageUsage, AgentUiComponent, MessageFeedback, AgentHostContext, Actor, PageContext, QueuePause, ActionProposal, GenuiValidity, GenuiErrorCategory, CostSource, ToolKind, ToolCallStatus, ToolConfirmation, UsagePurpose, AgentStore, ThreadTurnReader, ThreadSettingsReader, ChatQueueStore, ActionProposalStore, ActionProposalWorkerStore, ActionProposalDiscoveryIndexStore, ActionProposalOutcomeStore, ActionProposalStoreOptions, ActionProposalSupersessionStore, CreateThreadInput, ThreadSummary, ThreadDetail, ThreadTurnQuery, ThreadTurnPage, ForkThreadOptions, ToolCallApprovalState, EnqueueMessageInput, QueuedMessage, QueuedMessagePatch, UpdateThreadInput, ThreadSettings, RecordRunStartInput, RecordRunEndInput, AppendMessageInput, StoredMessage, RecordToolCallInput, UpdateToolCallInput, ToolCallOutcome, RecordUsageInput, RecordGenuiCallInput, UsageTotals, CreateActionProposal, CreateActionProposalResult, ActionProposalScope, ActionProposalMutationResult, ListActionProposals, ActionProposalDecisionCommand, ClaimActionProposal, ExtendActionProposalLease, SettleActionProposal, ActionProposalOutcomeLease, AgentGovernanceQueries, AgentPricingStore, GovernanceRange, ModelSpendRow, ActorSpendRow, ThreadSpendRow, UsageTrendPoint, ToolCallActivityRow, ThreadActivityRow, RunMetrics, RunAgentBreakdownRow, RunErrorBreakdownRow, RunTrendPoint, RecentRunRow, PendingApprovalRow, ToolStatRow, GovernancePageQuery, ToolCallWhere, GovernancePage, ThreadWhere, RunWhere, ApprovalWhere, GovernanceRunDetail, GovernanceThreadDetailQuery, GovernanceThreadDetail, GenuiStats, MemoryProvider, ListMemoriesInput, MemoryRecord, ForgetMemoryInput, StoreMemoryInput, ModelPriceInput, CurrentModelPrice, StreamFrameTable, StreamFrameRow, SqlTokenStreamSink, SqlTokenStreamSinkOptions, ConfirmTokenStore, ConfirmTokenClaim, ChannelStore, PoppyStore, PoppyConversationRecord, PoppyConversationPatch, PoppyEventBody, StoredPoppyEvent, PoppyMessageReceipt, PoppyMessageClaim, PoppyConnectionStore, PoppyConnectionRecord, PoppyPendingConnect } from '@dudousxd/nestjs-agent-core';
3
3
  export { ThreadTurnPage, ThreadTurnQuery } from '@dudousxd/nestjs-agent-core';
4
4
  import * as drizzle_orm_sqlite_core from 'drizzle-orm/sqlite-core';
5
5
  import { BaseSQLiteDatabase } from 'drizzle-orm/sqlite-core';
@@ -9240,7 +9240,7 @@ declare class DrizzleAgentStore implements AgentStore, ThreadTurnReader, ThreadS
9240
9240
  */
9241
9241
  private lastMessageContents;
9242
9242
  softDeleteThread(threadId: string): Promise<void>;
9243
- forkThread(threadId: string, fromMessageId: string): Promise<ThreadSummary>;
9243
+ forkThread(threadId: string, fromMessageId: string, options?: ForkThreadOptions): Promise<ThreadSummary>;
9244
9244
  ownerOfThread(threadId: string): Promise<string | null>;
9245
9245
  ownerOfToolCall(toolCallId: string): Promise<string | null>;
9246
9246
  runForToolCall(toolCallId: string): Promise<string | null>;
package/dist/index.js CHANGED
@@ -2437,7 +2437,7 @@ var DrizzleAgentStore = class {
2437
2437
  deletedAt: /* @__PURE__ */ new Date()
2438
2438
  }).where(eq2(this.t.agentThread.id, threadId));
2439
2439
  }
2440
- async forkThread(threadId, fromMessageId) {
2440
+ async forkThread(threadId, fromMessageId, options = {}) {
2441
2441
  const [source] = await this.db.select().from(this.t.agentThread).where(eq2(this.t.agentThread.id, threadId));
2442
2442
  if (source === void 0) {
2443
2443
  throw new Error(`thread ${threadId} not found`);
@@ -2448,8 +2448,8 @@ var DrizzleAgentStore = class {
2448
2448
  const now = /* @__PURE__ */ new Date();
2449
2449
  const fork = {
2450
2450
  id: crypto.randomUUID(),
2451
- actorRef: source.actorRef,
2452
- tenantRef: source.tenantRef,
2451
+ actorRef: options.actorRef ?? source.actorRef,
2452
+ tenantRef: options.tenantRef !== void 0 ? options.tenantRef : source.tenantRef,
2453
2453
  title: source.title,
2454
2454
  transient: false,
2455
2455
  activeStreamId: null,