@loomcycle/client 1.141.0 → 1.143.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.
@@ -2884,6 +2884,14 @@ class LoomcycleClient {
2884
2884
  async moveDocuments(input, opts) {
2885
2885
  return (await this.document({ op: "move_documents", ...input }, opts));
2886
2886
  }
2887
+ /** Find the copies in a set of documents (the Document tool's
2888
+ * `find_duplicates`, RFC GB): the same text by sha256, or the same title once
2889
+ * copy markers are stripped, each copy pointed at its original. A report
2890
+ * unless `propose: true`, which files a `duplicate_of` proposal per pair
2891
+ * for review. `opts` as on {@link LoomcycleClient.document}. */
2892
+ async findDuplicates(input, opts) {
2893
+ return (await this.document({ op: "find_duplicates", ...input }, opts));
2894
+ }
2887
2895
  /** Build the URL of an image chunk's asset (RFC BO) — `GET
2888
2896
  * /v1/_document/asset/{chunkId}`. Attach the bytes to a chunk with the
2889
2897
  * `set_asset` op via {@link LoomcycleClient.document}, then read them here.
@@ -3986,10 +3994,18 @@ function normalizeHookDef(d) {
3986
3994
  /** strings.TrimSpace: Go's Unicode White_Space set, which is not
3987
3995
  * String.prototype.trim's (Go trims U+0085 and keeps U+FEFF; JavaScript does
3988
3996
  * the reverse). Trimming differently could make two descriptions the server
3989
- * stores differently compare equal, and skip a real change. */
3990
- const goTrimRe = /^[\t\n\v\f\r \u0085\u00A0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]+|[\t\n\v\f\r \u0085\u00A0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]+$/g;
3997
+ * stores differently compare equal, and skip a real change. Scanned from
3998
+ * both ends rather than matched with /[\u2026]+$/, which backtracks
3999
+ * quadratically on a long whitespace run that is not at the end. */
4000
+ const goSpaceRe = /^[\t\n\v\f\r \u0085\u00A0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]$/;
3991
4001
  function goTrimSpace(s) {
3992
- return s.replace(goTrimRe, "");
4002
+ let start = 0;
4003
+ let end = s.length;
4004
+ while (start < end && goSpaceRe.test(s[start]))
4005
+ start++;
4006
+ while (end > start && goSpaceRe.test(s[end - 1]))
4007
+ end--;
4008
+ return s.slice(start, end);
3993
4009
  }
3994
4010
  /** Structural JSON equality, ignoring object key order (the server's
3995
4011
  * encoding orders keys by struct field, a caller's literal by whatever it
package/dist/cjs/index.js CHANGED
@@ -160,6 +160,7 @@
160
160
  * path(input): Promise<PathToolResponse> // resolve/ls/stat/mkdir/mv/rm
161
161
  * document(input): Promise<DocumentToolResponse> // 13 ops; needs SQL Memory
162
162
  * copyDocuments(input) / moveDocuments(input): Promise<DocumentTransferResult> // RFC FT, dry run by default
163
+ * findDuplicates(input): Promise<DocumentFindDuplicatesResult> // RFC GB, a report unless propose: true
163
164
  *
164
165
  * // History — browse/search/annotate past chats (RFC BE; tenant-confined)
165
166
  * history(input): Promise<HistoryToolResponse> // list/get/search/rename/annotate/pin/archive/recap/resume
package/dist/client.d.ts CHANGED
@@ -26,7 +26,7 @@
26
26
  import { InteractiveSession } from "./interactive.js";
27
27
  import { LoomcycleOAuth } from "./oauth.js";
28
28
  import { ClientToolHost, type ConnectClientToolsOptions } from "./client-tools.js";
29
- import type { ChangeFeedFrame, StreamChangesOptions, DocumentFeedFrame, DocumentFeedOptions, CredentialListResponse, CredentialMeta, CryptoKeyEncoding, CryptoKeyExport, CryptoKeyExternal, CryptoKeyType, CryptoRequest, CryptoResultByOp, DecideRequest, DecideResponse, DecisionModelsResponse, SpeechOptions, SpeechResult, TranscribeOptions, TranscribeResult, SpeechInfo, CredentialScope, DirectoryInspection, DirectoryTenant, DirectoryUser, ErasureReport, ErasureResult, MergeSubjectsResult, ReviewQueueFilter, ReviewQueueResult, RuleStatementsResult, RevertRulingResult, ListRulingsResult, ApplyReviewPolicyResult, BindSubjectPrincipalResult, Agent, AgentEvent, AgentList, CancelAgentResult, ClientOptions, ContinueOptions, RunOverrideOptions, EffectiveConfigResponse, RunFileInput, RunInboxDownload, AgentOverridableResponse, RetuneRunResponse, RunConfigResponse, RunPromptResponse, CreateSnapshotOptions, EnsureCodeAgentOptions, EnsureCodeAgentResult, EnsureHookDefOptions, EnsureHookDefResult, HookDefInput, HookDefOverlay, HookDefRowResponse, CreateDefOptions, ForkDefOptions, HookDefForkOverlay, ScheduleDefInput, ScheduleDefOverlay, ScheduleDefRowResponse, WebhookDefInput, WebhookDefOverlay, WebhookDefRowResponse, EnsureMcpServerOptions, EnsureMcpServerResult, HealthResponse, InterruptListResponse, InterruptStatus, ListUserAgentsOptions, WalkRunsPage, AckChannelOptions, AwaitChannelsOptions, BroadcastChannelsOptions, ChannelAckResult, ChannelAwaitResult, ChannelBroadcastResult, ChannelDescriptor, ChannelPeekResult, ListTeamChannelsOptions, PeekTeamChannelOptions, ReleaseTeamChannelOptions, TeamChannelPeekResult, TeamChannelReleaseResult, TeamChannelsResult, ChannelPublishResult, ChannelPurgeResult, ChannelReleaseResult, ChannelSubscribeResult, CreateChannelOptions, ListChannelsResponse, PeekChannelOptions, PublishChannelOptions, ReleaseChannelOptions, SetMemoryEntryOptions, SetMemoryEntryResponse, SubscribeChannelOptions, UpdateChannelOptions, LibraryAgentDefinition, LibraryListResponse, LibraryMcpServerDefinition, LibrarySkillDefinition, ListUsersResponse, UserRecord, CreateUserBody, UpdateUserBody, MintedUserToken, TokenSurface, ListUserTokensResponse, UserIdentitiesResponse, AuthGateListResponse, CreateInviteBody, CreatedInvite, AuthInviteListResponse, CreatedPasswordReset, GateIdentitiesResponse, GateTenantStatus, RunnableAgentsResponse, LLMChatOptions, LLMChatResponse, LLMChatStreamItem, LLMEmbeddingsOptions, LLMEmbeddingsResponse, MCPServerDefVerifyResult, MemoryEmbedStatsResponse, MemoryEntriesResponse, MemoryEntryResponse, MemoryBackfillResponse, MemoryPurgeResponse, MemoryReembedResponse, MemoryScopeIDsResponse, MemoryScopesResponse, MemorySearchInput, MemorySearchResponse, PauseResult, RetentionOverride, PersistentVolumesResponse, EphemeralVolumesResponse, ResolveInterruptOptions, ResumeResult, ResolverMatrix, CompactRunResult, RunTreeDeletion, ReplaySessionResult, CancelTurnResult, ReviewRunResult, RunBatchOptions, RunBatchResult, RunOptions, ConfiguredRun, ConfiguredRunPatch, RunStateStreamItem, RuntimeStateResponse, SnapshotCreateResponse, SnapshotDescriptor, SnapshotEnvelope, SnapshotRestoreResponse, StreamUserRunStatesOptions, SubstrateToolInput, SubstrateToolResponse, CreatedTeam, CreateTeamOptions, DefNamesResponse, ForkTeamOptions, ModelAliasesResponse, OperatorTokenDefNamesResponse, ProviderModelsResponse, RoutingResponse, ScheduleListResponse, SchedulePauseResult, ScheduleRunNowResult, ScheduleStateView, ListTeamsResponse, PromotedTeam, RetiredTeam, TeamBreakpoints, TeamDefDetail, TeamRunDetached, TeamRunTarget, TeamVerification, TeamDraft, TeamDraftVerification, TeamVersionList, TeamDiagram, TeamRunResult, PathToolInput, PathToolResponse, DocumentToolInput, DocumentToolResponse, DocumentCopyInput, DocumentMoveInput, DocumentTransferResult, HistoryToolInput, HistoryToolResponse, EvaluationSubmitInput, EvaluationGetInput, EvaluationListForRunInput, EvaluationListForDefInput, EvaluationAggregateInput, EvaluationInput, EvaluationSubmitResult, EvaluationRecord, EvaluationListForRunResult, EvaluationListForDefResult, EvaluationAggregate, TranscriptResponse, WhoamiResponse, UsageDimension, UsageBucket, UsageReportResponse, TokenLimit, TokenLimitsResponse, ConfigResponse, SetTokenLimitRequest, AclBinding, AclBindingListResponse, AclCatalog, AclDefInput, AclDefListResponse, AclDefNamesResponse, AclDefRow, AclRule, AclValidateResult, AuthzDecision, AuthzEvaluationRequest, AuthzEvaluationsRequest, AuthzEvaluationsResponse, AuthzExplainResponse, AuthzSimulateRequest, AuthzSimulateResponse, CreateAclBindingBody, CreateGroupBody, GroupDetail, GroupEffective, GroupListResponse, GroupMemberChange, GroupMemberKind, GroupRow, AppClientConfig, AppClientEntry, ClientDefInput, ClientDefListResponse, ClientDefNamesResponse, ClientDefRecord, ClientDefRetireResult, ClientDefVerifyResult, DeviceLoginOptions, DeviceLoginResult } from "./types.js";
29
+ import type { ChangeFeedFrame, StreamChangesOptions, DocumentFeedFrame, DocumentFeedOptions, CredentialListResponse, CredentialMeta, CryptoKeyEncoding, CryptoKeyExport, CryptoKeyExternal, CryptoKeyType, CryptoRequest, CryptoResultByOp, DecideRequest, DecideResponse, DecisionModelsResponse, SpeechOptions, SpeechResult, TranscribeOptions, TranscribeResult, SpeechInfo, CredentialScope, DirectoryInspection, DirectoryTenant, DirectoryUser, ErasureReport, ErasureResult, MergeSubjectsResult, ReviewQueueFilter, ReviewQueueResult, RuleStatementsResult, RevertRulingResult, ListRulingsResult, ApplyReviewPolicyResult, BindSubjectPrincipalResult, Agent, AgentEvent, AgentList, CancelAgentResult, ClientOptions, ContinueOptions, RunOverrideOptions, EffectiveConfigResponse, RunFileInput, RunInboxDownload, AgentOverridableResponse, RetuneRunResponse, RunConfigResponse, RunPromptResponse, CreateSnapshotOptions, EnsureCodeAgentOptions, EnsureCodeAgentResult, EnsureHookDefOptions, EnsureHookDefResult, HookDefInput, HookDefOverlay, HookDefRowResponse, CreateDefOptions, ForkDefOptions, HookDefForkOverlay, ScheduleDefInput, ScheduleDefOverlay, ScheduleDefRowResponse, WebhookDefInput, WebhookDefOverlay, WebhookDefRowResponse, EnsureMcpServerOptions, EnsureMcpServerResult, HealthResponse, InterruptListResponse, InterruptStatus, ListUserAgentsOptions, WalkRunsPage, AckChannelOptions, AwaitChannelsOptions, BroadcastChannelsOptions, ChannelAckResult, ChannelAwaitResult, ChannelBroadcastResult, ChannelDescriptor, ChannelPeekResult, ListTeamChannelsOptions, PeekTeamChannelOptions, ReleaseTeamChannelOptions, TeamChannelPeekResult, TeamChannelReleaseResult, TeamChannelsResult, ChannelPublishResult, ChannelPurgeResult, ChannelReleaseResult, ChannelSubscribeResult, CreateChannelOptions, ListChannelsResponse, PeekChannelOptions, PublishChannelOptions, ReleaseChannelOptions, SetMemoryEntryOptions, SetMemoryEntryResponse, SubscribeChannelOptions, UpdateChannelOptions, LibraryAgentDefinition, LibraryListResponse, LibraryMcpServerDefinition, LibrarySkillDefinition, ListUsersResponse, UserRecord, CreateUserBody, UpdateUserBody, MintedUserToken, TokenSurface, ListUserTokensResponse, UserIdentitiesResponse, AuthGateListResponse, CreateInviteBody, CreatedInvite, AuthInviteListResponse, CreatedPasswordReset, GateIdentitiesResponse, GateTenantStatus, RunnableAgentsResponse, LLMChatOptions, LLMChatResponse, LLMChatStreamItem, LLMEmbeddingsOptions, LLMEmbeddingsResponse, MCPServerDefVerifyResult, MemoryEmbedStatsResponse, MemoryEntriesResponse, MemoryEntryResponse, MemoryBackfillResponse, MemoryPurgeResponse, MemoryReembedResponse, MemoryScopeIDsResponse, MemoryScopesResponse, MemorySearchInput, MemorySearchResponse, PauseResult, RetentionOverride, PersistentVolumesResponse, EphemeralVolumesResponse, ResolveInterruptOptions, ResumeResult, ResolverMatrix, CompactRunResult, RunTreeDeletion, ReplaySessionResult, CancelTurnResult, ReviewRunResult, RunBatchOptions, RunBatchResult, RunOptions, ConfiguredRun, ConfiguredRunPatch, RunStateStreamItem, RuntimeStateResponse, SnapshotCreateResponse, SnapshotDescriptor, SnapshotEnvelope, SnapshotRestoreResponse, StreamUserRunStatesOptions, SubstrateToolInput, SubstrateToolResponse, CreatedTeam, CreateTeamOptions, DefNamesResponse, ForkTeamOptions, ModelAliasesResponse, OperatorTokenDefNamesResponse, ProviderModelsResponse, RoutingResponse, ScheduleListResponse, SchedulePauseResult, ScheduleRunNowResult, ScheduleStateView, ListTeamsResponse, PromotedTeam, RetiredTeam, TeamBreakpoints, TeamDefDetail, TeamRunDetached, TeamRunTarget, TeamVerification, TeamDraft, TeamDraftVerification, TeamVersionList, TeamDiagram, TeamRunResult, PathToolInput, PathToolResponse, DocumentToolInput, DocumentToolResponse, DocumentCopyInput, DocumentMoveInput, DocumentFindDuplicatesInput, DocumentFindDuplicatesResult, DocumentTransferResult, HistoryToolInput, HistoryToolResponse, EvaluationSubmitInput, EvaluationGetInput, EvaluationListForRunInput, EvaluationListForDefInput, EvaluationAggregateInput, EvaluationInput, EvaluationSubmitResult, EvaluationRecord, EvaluationListForRunResult, EvaluationListForDefResult, EvaluationAggregate, TranscriptResponse, WhoamiResponse, UsageDimension, UsageBucket, UsageReportResponse, TokenLimit, TokenLimitsResponse, ConfigResponse, SetTokenLimitRequest, AclBinding, AclBindingListResponse, AclCatalog, AclDefInput, AclDefListResponse, AclDefNamesResponse, AclDefRow, AclRule, AclValidateResult, AuthzDecision, AuthzEvaluationRequest, AuthzEvaluationsRequest, AuthzEvaluationsResponse, AuthzExplainResponse, AuthzSimulateRequest, AuthzSimulateResponse, CreateAclBindingBody, CreateGroupBody, GroupDetail, GroupEffective, GroupListResponse, GroupMemberChange, GroupMemberKind, GroupRow, AppClientConfig, AppClientEntry, ClientDefInput, ClientDefListResponse, ClientDefNamesResponse, ClientDefRecord, ClientDefRetireResult, ClientDefVerifyResult, DeviceLoginOptions, DeviceLoginResult } from "./types.js";
30
30
  export declare class LoomcycleClient {
31
31
  private ctx;
32
32
  private readonly tokenProvider?;
@@ -2137,6 +2137,16 @@ export declare class LoomcycleClient {
2137
2137
  scopeId?: string;
2138
2138
  tenant?: string;
2139
2139
  }): Promise<DocumentTransferResult>;
2140
+ /** Find the copies in a set of documents (the Document tool's
2141
+ * `find_duplicates`, RFC GB): the same text by sha256, or the same title once
2142
+ * copy markers are stripped, each copy pointed at its original. A report
2143
+ * unless `propose: true`, which files a `duplicate_of` proposal per pair
2144
+ * for review. `opts` as on {@link LoomcycleClient.document}. */
2145
+ findDuplicates(input: DocumentFindDuplicatesInput, opts?: {
2146
+ signal?: AbortSignal;
2147
+ scopeId?: string;
2148
+ tenant?: string;
2149
+ }): Promise<DocumentFindDuplicatesResult>;
2140
2150
  /** Build the URL of an image chunk's asset (RFC BO) — `GET
2141
2151
  * /v1/_document/asset/{chunkId}`. Attach the bytes to a chunk with the
2142
2152
  * `set_asset` op via {@link LoomcycleClient.document}, then read them here.
package/dist/client.js CHANGED
@@ -2881,6 +2881,14 @@ export class LoomcycleClient {
2881
2881
  async moveDocuments(input, opts) {
2882
2882
  return (await this.document({ op: "move_documents", ...input }, opts));
2883
2883
  }
2884
+ /** Find the copies in a set of documents (the Document tool's
2885
+ * `find_duplicates`, RFC GB): the same text by sha256, or the same title once
2886
+ * copy markers are stripped, each copy pointed at its original. A report
2887
+ * unless `propose: true`, which files a `duplicate_of` proposal per pair
2888
+ * for review. `opts` as on {@link LoomcycleClient.document}. */
2889
+ async findDuplicates(input, opts) {
2890
+ return (await this.document({ op: "find_duplicates", ...input }, opts));
2891
+ }
2884
2892
  /** Build the URL of an image chunk's asset (RFC BO) — `GET
2885
2893
  * /v1/_document/asset/{chunkId}`. Attach the bytes to a chunk with the
2886
2894
  * `set_asset` op via {@link LoomcycleClient.document}, then read them here.
@@ -3982,10 +3990,18 @@ function normalizeHookDef(d) {
3982
3990
  /** strings.TrimSpace: Go's Unicode White_Space set, which is not
3983
3991
  * String.prototype.trim's (Go trims U+0085 and keeps U+FEFF; JavaScript does
3984
3992
  * the reverse). Trimming differently could make two descriptions the server
3985
- * stores differently compare equal, and skip a real change. */
3986
- const goTrimRe = /^[\t\n\v\f\r \u0085\u00A0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]+|[\t\n\v\f\r \u0085\u00A0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]+$/g;
3993
+ * stores differently compare equal, and skip a real change. Scanned from
3994
+ * both ends rather than matched with /[\u2026]+$/, which backtracks
3995
+ * quadratically on a long whitespace run that is not at the end. */
3996
+ const goSpaceRe = /^[\t\n\v\f\r \u0085\u00A0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]$/;
3987
3997
  function goTrimSpace(s) {
3988
- return s.replace(goTrimRe, "");
3998
+ let start = 0;
3999
+ let end = s.length;
4000
+ while (start < end && goSpaceRe.test(s[start]))
4001
+ start++;
4002
+ while (end > start && goSpaceRe.test(s[end - 1]))
4003
+ end--;
4004
+ return s.slice(start, end);
3989
4005
  }
3990
4006
  /** Structural JSON equality, ignoring object key order (the server's
3991
4007
  * encoding orders keys by struct field, a caller's literal by whatever it
package/dist/index.d.ts CHANGED
@@ -159,6 +159,7 @@
159
159
  * path(input): Promise<PathToolResponse> // resolve/ls/stat/mkdir/mv/rm
160
160
  * document(input): Promise<DocumentToolResponse> // 13 ops; needs SQL Memory
161
161
  * copyDocuments(input) / moveDocuments(input): Promise<DocumentTransferResult> // RFC FT, dry run by default
162
+ * findDuplicates(input): Promise<DocumentFindDuplicatesResult> // RFC GB, a report unless propose: true
162
163
  *
163
164
  * // History — browse/search/annotate past chats (RFC BE; tenant-confined)
164
165
  * history(input): Promise<HistoryToolResponse> // list/get/search/rename/annotate/pin/archive/recap/resume
@@ -218,5 +219,5 @@ export { ClientToolHost, clientToolsURL, CLIENT_TOOL_SUBPROTOCOL } from "./clien
218
219
  export type { ClientToolSchema, ClientToolInvocation, ConnectClientToolsOptions, WebSocketLike, WebSocketCtor, } from "./client-tools.js";
219
220
  export { LoomcycleOAuth, OAuthTokenProvider, parseAuthorizeResponse, pkceChallenge } from "./oauth.js";
220
221
  export type { LoomcycleOAuthOptions, OAuthTokenProviderOptions } from "./oauth.js";
221
- export type { AgentEvent, ClientOptions, ContinueOptions, EventType, HostWidening, ImageMediaType, ParentContext, PromptContent, PromptSegment, RetryInfo, RunOptions, RunOverrideOptions, SamplingOptions, CompactionOptions, ContextOptions, ToolUse, Usage, CallTiming, Agent, AgentStatus, AwaitedState, AgentUsage, RunResult, RunSpec, RunSpecTeam, ConfiguredRun, ConfiguredRunPatch, ToolChoiceOptions, OutputFormatOptions, CancelAgentResult, ListAgentsResponse, ListUserAgentsOptions, AgentList, WalkRunsPage, RunBatchOptions, RunBatchResult, SpawnRunResult, CompactRunResult, RunTreeDeletion, RunTreeNotReached, DirectoryBudget, DirectoryInspection, DirectoryTenant, DirectoryUser, ErasureAccess, ErasureReport, ErasureResidue, ErasureResult, ErasureTier, MergeSubjectsResult, SubjectRef, BindSubjectPrincipalResult, ReviewQueueFilter, ReviewQueueGroup, ReviewQueueResult, RuleStatementsResult, RevertRulingResult, RulingBreakdown, RulingItem, RulingSelector, RulingRecord, ListRulingsResult, PolicyRuleCount, ApplyReviewPolicyResult, ErasureBoundSubject, ErasureTokenRef, CancelTurnResult, ReviewRunResult, ReplaySessionResult, TranscriptEvent, TranscriptResponse, HealthResponse, ListUsersResponse, UserSummary, UserStatus, UserRecord, CreateUserBody, UpdateUserBody, MintedUserToken, TokenRestrictions, TokenSurface, UserTokenMeta, ListUserTokensResponse, UserIdentity, UserIdentitiesResponse, AuthGateKind, AuthGate, AuthGateKey, AuthGateRemoval, AuthGateProbe, AuthGateListResponse, CreateInviteBody, CreatedInvite, AuthInviteState, AuthInvite, AuthInviteListResponse, CreatedPasswordReset, GateIdentity, GateIdentitiesResponse, GateTenantStatus, RunnableAgent, RunnableAgentsResponse, WhoamiResponse, WhoamiEffective, WhoamiAuth, PauseResult, RetentionOverride, ResumeResult, RuntimeStateResponse, RuntimeStateStatus, ResolverMatrix, ResolverModelStatus, ResolverProviderAvailability, CreateSnapshotOptions, SnapshotCreateResponse, SnapshotDescriptor, SnapshotEnvelope, SnapshotListResponse, SnapshotRestoreResponse, MemoryEntriesResponse, MemoryEntry, MemoryEntryResponse, MemoryScopeIDsResponse, MemoryScopeIDSummary, MemoryScopeKind, MemoryScopesResponse, MemorySearchDocumentFilter, MemorySearchInput, MemorySource, MemoryWhen, MemoryTimeFilter, MemorySearchEntry, MemorySearchResponse, MemoryEmbedModelStats, MemoryEmbedStatsResponse, MemoryReembedConfigured, MemoryReembedResponse, MemoryBackfillResponse, MemoryPurgeResponse, InterruptListResponse, InterruptRow, InterruptStatus, ResolveInterruptOptions, ChannelHookCall, ChannelHookResult, HookFailMode, HookPhase, HookToolCall, HookToolResult, PostHookCall, PostHookResult, PreHookCall, PreHookResult, SubstrateToolInput, SubstrateToolResponse, TeamNameSummary, ListTeamsResponse, TeamDiagram, CreatedTeam, PromotedTeam, RetiredTeam, TeamDefDetail, TeamVerification, TeamDraft, TeamDraftVerification, TeamIssue, TeamIssueKind, TeamVersion, TeamVersionList, TeamBreakpoints, TeamRunDetached, TeamRunResult, TeamRunTarget, CreateTeamOptions, ForkTeamOptions, DefNameSummary, DefNamesResponse, OperatorTokenDefNameSummary, OperatorTokenDefNamesResponse, ScheduleListEntry, ScheduleListResponse, ScheduleActiveRun, ScheduleStateView, ScheduleRunNowResult, SchedulePauseResult, ModelAlias, ModelAliasesResponse, RoutingResponse, RoutingUserTier, RoutingTier, RoutingCandidate, RoutingThroughput, RoutingProvider, SearchRoutingProvider, RoutingEmbedder, RoutingDecision, RoutingDecisionModel, ProviderModelsResponse, TeamRunStep, TeamDecisionHandler, TeamDecisionQuestion, TeamDecisionAnswer, PathToolInput, PathToolResponse, DocumentToolInput, DocumentEdgeEvidence, DocumentToolResponse, DocumentCopyInput, DocumentMoveInput, DocumentTransferEntry, DocumentTransferResult, DocumentSearchFilter, DocumentSearchHit, DocumentSearchResult, DocumentRelatedResult, GraphSnapshot, HistoryToolInput, HistoryToolResponse, EvaluationEmitterRole, EvaluationSubmitInput, EvaluationGetInput, EvaluationListForRunInput, EvaluationListForDefInput, EvaluationAggregateInput, EvaluationInput, EvaluationSubmitResult, EvaluationRecord, EvaluationListForRunResult, EvaluationListForDefResult, EvaluationScoreStats, EvaluationAggregate, VolumeMode, PersistentVolumeEntry, PersistentVolumesResponse, EphemeralVolumeEntry, EphemeralVolumesResponse, SystemPromptPayload, UserInputPayload, ChannelDescriptor, ListChannelsResponse, RunStateEvent, RunStateStreamClose, RunStateStreamItem, RunStateStreamOpen, StreamUserRunStatesOptions, ChangeFeedError, ChangeFeedFrame, ChangeFeedStatus, EmbedderHealth, MemoryChange, MemoryChangeScope, MemoryChangeType, StreamChangesOptions, DocumentFeedChange, DocumentFeedChangeType, DocumentFeedFrame, DocumentFeedOptions, DocumentFeedStatus, AckChannelOptions, ChannelAckResult, ChannelMessageItem, ChannelPeekResult, ListTeamChannelsOptions, PeekTeamChannelOptions, ReleaseTeamChannelOptions, TeamChannelReleaseResult, TeamChannelDeclaredIn, TeamChannelDescriptor, TeamChannelPeekResult, TeamChannelsResult, ChannelPublishResult, ChannelPurgeResult, ChannelReleaseResult, ChannelScope, ChannelSubscribeResult, PeekChannelOptions, PublishChannelOptions, SubscribeChannelOptions, AwaitChannelsOptions, BroadcastChannelsOptions, ChannelAwaitEntry, ChannelAwaitMode, ChannelAwaitResult, ChannelBroadcastEntry, ChannelBroadcastResult, CreateChannelOptions, ReleaseChannelOptions, UpdateChannelOptions, SetMemoryEntryOptions, SetMemoryEntryResponse, AgentDefRowResponse, AgentDefVerifyResult, SkillDefVerifyResult, EnsureMcpServerOptions, EnsureMcpServerResult, MCPServerDefRowResponse, MCPServerDefVerifyResult, AgentDefOverlay, AgentRouting, AgentChannelACL, AgentInterruptionACL, AgentDecision, MemoryRerank, AgentSampling, AgentCompaction, AgentTranscription, AgentSpeech, AgentContext, TierCandidate, CoreBlock, HookEvent, InlineWebhook, HookEntry, EventHooks, ToolEntry, ToolHooksByTool, EnsureCodeAgentOptions, EnsureCodeAgentResult, CreateDefOptions, ForkDefOptions, EnsureHookDefOptions, EnsureHookDefResult, HookDefBody, HookDefForkOverlay, HookDefInput, HookDefMatch, HookDefOverlay, HookDefRowResponse, HookDefVerifyResult, ScheduleDefInput, ScheduleDefOverlay, ScheduleDefRowResponse, ScheduledRunHook, ScheduledRunPromptContent, ScheduledRunPromptSegment, WebhookDefAuth, WebhookDefFilter, WebhookDefInput, WebhookDefOverlay, WebhookDefRateLimit, WebhookDefRowResponse, WebhookDefDeliveries, WebhookDefSyncResponse, LibraryAgentDefinition, LibraryEntry, LibraryListResponse, LibraryMcpServerDefinition, LibrarySkillDefinition, LLMChatContent, LLMChatMessage, LLMChatOptions, LLMChatResponse, LLMChatStreamDelta, LLMChatStreamItem, LLMChatToolCall, LLMChatUsage, LLMTool, LLMEmbeddingItem, LLMEmbeddingsOptions, LLMEmbeddingsResponse, LLMEmbeddingsUsage, UsageDimension, UsageBucket, UsageAggregate, UsageReportResponse, CapabilityInertInfo, LimitInfo, FileCapturedInfo, TranscriptionInfo, AdmissionInfo, ErrorInfo, CallFormat, CallRef, HookDecisionInfo, TeamDecisionInfo, OverrideInfo, FallbackInfo, InterruptionEventInfo, SpawnChildInfo, TurnCancelledInfo, ChannelEventInfo, ContextCompactionInfo, ContextRecapInfo, ContextStateInfo, ContextExhaustedInfo, ContextTierVerdict, ContextDistillDeclinedInfo, EffectiveConfigResponse, RunFileInput, RunFileImportSource, RunFileImportHeading, RunInboxDownload, EffectiveConfigSource, EffectiveValue, InertContextSetting, AgentOverridableResponse, OverridableField, OverrideLockReason, RetuneRunResponse, RunConfigRecord, SubagentHoldInfo, RunConfigResponse, RunPromptResponse, RunPromptSnapshot, PromptBlock, TokenLimit, TokenLimitsResponse, ConfigResponse, ConfigProvider, ConfigModel, ConfigSearch, ConfigInstance, SetTokenLimitRequest, CredentialScope, CredentialMeta, CredentialListResponse, CryptoKeyVersion, CryptoKeyExport, CryptoKeyType, CryptoKeyEncoding, CryptoKeyBackend, CryptoKeyExternal, CryptoOp, CryptoRequestBase, CryptoKeyRef, CryptoEncryptRequest, CryptoDecryptRequest, CryptoRewrapRequest, CryptoMacRequest, CryptoVerifyMacRequest, CryptoSignRequest, CryptoVerifyRequest, CryptoPublicKeyRequest, CryptoTotpRequest, CryptoHashRequest, CryptoRandomRequest, CryptoHashPasswordRequest, CryptoVerifyPasswordRequest, CryptoRequest, CryptoEncryptResult, CryptoDecryptResult, CryptoRewrapResult, CryptoMacResult, CryptoVerifyResult, CryptoSignResult, CryptoPublicJWK, CryptoPublicKeyResult, CryptoTotpResult, CryptoHashResult, CryptoRandomResult, CryptoHashPasswordResult, CryptoVerifyPasswordResult, CryptoResultByOp, CryptoResult, DecideRequest, DecideResponse, DecisionQuestion, DecisionChoiceQuestion, DecisionNoulQuestion, DecisionScoreQuestion, DecisionAnswer, DecisionChoiceAnswer, DecisionNoulAnswer, DecisionScoreAnswer, DecisionModel, DecisionModelsResponse, SpeechFormat, SpeechOptions, SpeechResult, TranscribeOptions, TranscribeResult, TranscriptSegment, SpeechInfo, SpeechDirectionInfo, SpeechLanguageInfo, TranscriptionDirectionInfo, AclMode, AclSource, AclEffect, AclSubjectKind, AclCondition, AclRule, AclList, AclDefRow, AclDefListResponse, AclDefNamesResponse, AclValidateResult, AclCatalogType, AclCatalog, AclDefOp, AclDefInput, GroupRow, GroupMemberKind, GroupMember, GroupListResponse, GroupDetail, GroupEffective, CreateGroupBody, GroupMemberChange, AclBinding, AclBindingListResponse, CreateAclBindingBody, AuthzReason, AuthzDecision, AuthzRequestContext, AuthzEvaluationRequest, AuthzEvaluationsSemantic, AuthzEvaluationsRequest, AuthzEvaluationsResponse, AuthzTrace, AuthzAppliedBinding, AuthzExplainResponse, AuthzDraftBinding, AuthzSimulateRequest, AuthzSimulateResult, AuthzSimulateResponse, OAuthServerMetadata, OAuthTokenResponse, OAuthTokenSet, BeginAuthorizeOptions, AuthorizeRequest, AuthorizeResponseParams, CompleteAuthorizeOptions, RefreshTokenOptions, RevokeTokenOptions, TokenProvider, AppClientRefresh, AppClientConfig, ClientDefInput, ClientDefRecord, ConfigAppClient, AppClientEntry, ClientDefListResponse, ClientDefVerifyResult, ClientDefRetireResult, ClientDefNameSummary, ClientDefNamesResponse, DeviceLoginPrompt, DeviceLoginOptions, DeviceLoginResult, } from "./types.js";
222
+ export type { AgentEvent, ClientOptions, ContinueOptions, EventType, HostWidening, ImageMediaType, ParentContext, PromptContent, PromptSegment, RetryInfo, RunOptions, RunOverrideOptions, SamplingOptions, CompactionOptions, ContextOptions, ToolUse, Usage, CallTiming, Agent, AgentStatus, AwaitedState, AgentUsage, RunResult, RunSpec, RunSpecTeam, ConfiguredRun, ConfiguredRunPatch, ToolChoiceOptions, OutputFormatOptions, CancelAgentResult, ListAgentsResponse, ListUserAgentsOptions, AgentList, WalkRunsPage, RunBatchOptions, RunBatchResult, SpawnRunResult, CompactRunResult, RunTreeDeletion, RunTreeNotReached, DirectoryBudget, DirectoryInspection, DirectoryTenant, DirectoryUser, ErasureAccess, ErasureReport, ErasureResidue, ErasureResult, ErasureTier, MergeSubjectsResult, SubjectRef, BindSubjectPrincipalResult, ReviewQueueFilter, ReviewQueueGroup, ReviewQueueResult, RuleStatementsResult, RevertRulingResult, RulingBreakdown, RulingItem, RulingSelector, RulingRecord, ListRulingsResult, PolicyRuleCount, ApplyReviewPolicyResult, ErasureBoundSubject, ErasureTokenRef, CancelTurnResult, ReviewRunResult, ReplaySessionResult, TranscriptEvent, TranscriptResponse, HealthResponse, ListUsersResponse, UserSummary, UserStatus, UserRecord, CreateUserBody, UpdateUserBody, MintedUserToken, TokenRestrictions, TokenSurface, UserTokenMeta, ListUserTokensResponse, UserIdentity, UserIdentitiesResponse, AuthGateKind, AuthGate, AuthGateKey, AuthGateRemoval, AuthGateProbe, AuthGateListResponse, CreateInviteBody, CreatedInvite, AuthInviteState, AuthInvite, AuthInviteListResponse, CreatedPasswordReset, GateIdentity, GateIdentitiesResponse, GateTenantStatus, RunnableAgent, RunnableAgentsResponse, WhoamiResponse, WhoamiEffective, WhoamiAuth, PauseResult, RetentionOverride, ResumeResult, RuntimeStateResponse, RuntimeStateStatus, ResolverMatrix, ResolverModelStatus, ResolverProviderAvailability, CreateSnapshotOptions, SnapshotCreateResponse, SnapshotDescriptor, SnapshotEnvelope, SnapshotListResponse, SnapshotRestoreResponse, MemoryEntriesResponse, MemoryEntry, MemoryEntryResponse, MemoryScopeIDsResponse, MemoryScopeIDSummary, MemoryScopeKind, MemoryScopesResponse, MemorySearchDocumentFilter, MemorySearchInput, MemorySource, MemoryWhen, MemoryTimeFilter, MemorySearchEntry, MemorySearchResponse, MemoryEmbedModelStats, MemoryEmbedStatsResponse, MemoryReembedConfigured, MemoryReembedResponse, MemoryBackfillResponse, MemoryPurgeResponse, InterruptListResponse, InterruptRow, InterruptStatus, ResolveInterruptOptions, ChannelHookCall, ChannelHookResult, HookFailMode, HookPhase, HookToolCall, HookToolResult, PostHookCall, PostHookResult, PreHookCall, PreHookResult, SubstrateToolInput, SubstrateToolResponse, TeamNameSummary, ListTeamsResponse, TeamDiagram, CreatedTeam, PromotedTeam, RetiredTeam, TeamDefDetail, TeamVerification, TeamDraft, TeamDraftVerification, TeamIssue, TeamIssueKind, TeamVersion, TeamVersionList, TeamBreakpoints, TeamRunDetached, TeamRunResult, TeamRunTarget, CreateTeamOptions, ForkTeamOptions, DefNameSummary, DefNamesResponse, OperatorTokenDefNameSummary, OperatorTokenDefNamesResponse, ScheduleListEntry, ScheduleListResponse, ScheduleActiveRun, ScheduleStateView, ScheduleRunNowResult, SchedulePauseResult, ModelAlias, ModelAliasesResponse, RoutingResponse, RoutingUserTier, RoutingTier, RoutingCandidate, RoutingThroughput, RoutingProvider, SearchRoutingProvider, RoutingEmbedder, RoutingDecision, RoutingDecisionModel, ProviderModelsResponse, TeamRunStep, TeamDecisionHandler, TeamDecisionQuestion, TeamDecisionAnswer, PathToolInput, PathToolResponse, DocumentToolInput, DocumentEdgeEvidence, DocumentToolResponse, DocumentCopyInput, DocumentMoveInput, DocumentTransferEntry, DocumentTransferResult, DocumentFindDuplicatesInput, DocumentDuplicatePair, DocumentFindDuplicatesResult, DocumentSearchFilter, DocumentSearchHit, DocumentSearchResult, DocumentRelatedResult, GraphSnapshot, HistoryToolInput, HistoryToolResponse, EvaluationEmitterRole, EvaluationSubmitInput, EvaluationGetInput, EvaluationListForRunInput, EvaluationListForDefInput, EvaluationAggregateInput, EvaluationInput, EvaluationSubmitResult, EvaluationRecord, EvaluationListForRunResult, EvaluationListForDefResult, EvaluationScoreStats, EvaluationAggregate, VolumeMode, PersistentVolumeEntry, PersistentVolumesResponse, EphemeralVolumeEntry, EphemeralVolumesResponse, SystemPromptPayload, UserInputPayload, ChannelDescriptor, ListChannelsResponse, RunStateEvent, RunStateStreamClose, RunStateStreamItem, RunStateStreamOpen, StreamUserRunStatesOptions, ChangeFeedError, ChangeFeedFrame, ChangeFeedStatus, EmbedderHealth, MemoryChange, MemoryChangeScope, MemoryChangeType, StreamChangesOptions, DocumentFeedChange, DocumentFeedChangeType, DocumentFeedFrame, DocumentFeedOptions, DocumentFeedStatus, AckChannelOptions, ChannelAckResult, ChannelMessageItem, ChannelPeekResult, ListTeamChannelsOptions, PeekTeamChannelOptions, ReleaseTeamChannelOptions, TeamChannelReleaseResult, TeamChannelDeclaredIn, TeamChannelDescriptor, TeamChannelPeekResult, TeamChannelsResult, ChannelPublishResult, ChannelPurgeResult, ChannelReleaseResult, ChannelScope, ChannelSubscribeResult, PeekChannelOptions, PublishChannelOptions, SubscribeChannelOptions, AwaitChannelsOptions, BroadcastChannelsOptions, ChannelAwaitEntry, ChannelAwaitMode, ChannelAwaitResult, ChannelBroadcastEntry, ChannelBroadcastResult, CreateChannelOptions, ReleaseChannelOptions, UpdateChannelOptions, SetMemoryEntryOptions, SetMemoryEntryResponse, AgentDefRowResponse, AgentDefVerifyResult, SkillDefVerifyResult, EnsureMcpServerOptions, EnsureMcpServerResult, MCPServerDefRowResponse, MCPServerDefVerifyResult, AgentDefOverlay, AgentRouting, AgentChannelACL, AgentInterruptionACL, AgentDecision, MemoryRerank, AgentSampling, AgentCompaction, AgentTranscription, AgentSpeech, AgentContext, TierCandidate, CoreBlock, HookEvent, InlineWebhook, HookEntry, EventHooks, ToolEntry, ToolHooksByTool, EnsureCodeAgentOptions, EnsureCodeAgentResult, CreateDefOptions, ForkDefOptions, EnsureHookDefOptions, EnsureHookDefResult, HookDefBody, HookDefForkOverlay, HookDefInput, HookDefMatch, HookDefOverlay, HookDefRowResponse, HookDefVerifyResult, ScheduleDefInput, ScheduleDefOverlay, ScheduleDefRowResponse, ScheduledRunHook, ScheduledRunPromptContent, ScheduledRunPromptSegment, WebhookDefAuth, WebhookDefFilter, WebhookDefInput, WebhookDefOverlay, WebhookDefRateLimit, WebhookDefRowResponse, WebhookDefDeliveries, WebhookDefSyncResponse, LibraryAgentDefinition, LibraryEntry, LibraryListResponse, LibraryMcpServerDefinition, LibrarySkillDefinition, LLMChatContent, LLMChatMessage, LLMChatOptions, LLMChatResponse, LLMChatStreamDelta, LLMChatStreamItem, LLMChatToolCall, LLMChatUsage, LLMTool, LLMEmbeddingItem, LLMEmbeddingsOptions, LLMEmbeddingsResponse, LLMEmbeddingsUsage, UsageDimension, UsageBucket, UsageAggregate, UsageReportResponse, CapabilityInertInfo, LimitInfo, FileCapturedInfo, TranscriptionInfo, AdmissionInfo, ErrorInfo, CallFormat, CallRef, HookDecisionInfo, TeamDecisionInfo, OverrideInfo, FallbackInfo, InterruptionEventInfo, SpawnChildInfo, TurnCancelledInfo, ChannelEventInfo, ContextCompactionInfo, ContextRecapInfo, ContextStateInfo, ContextExhaustedInfo, ContextTierVerdict, ContextDistillDeclinedInfo, EffectiveConfigResponse, RunFileInput, RunFileImportSource, RunFileImportHeading, RunInboxDownload, EffectiveConfigSource, EffectiveValue, InertContextSetting, AgentOverridableResponse, OverridableField, OverrideLockReason, RetuneRunResponse, RunConfigRecord, SubagentHoldInfo, RunConfigResponse, RunPromptResponse, RunPromptSnapshot, PromptBlock, TokenLimit, TokenLimitsResponse, ConfigResponse, ConfigProvider, ConfigModel, ConfigSearch, ConfigInstance, SetTokenLimitRequest, CredentialScope, CredentialMeta, CredentialListResponse, CryptoKeyVersion, CryptoKeyExport, CryptoKeyType, CryptoKeyEncoding, CryptoKeyBackend, CryptoKeyExternal, CryptoOp, CryptoRequestBase, CryptoKeyRef, CryptoEncryptRequest, CryptoDecryptRequest, CryptoRewrapRequest, CryptoMacRequest, CryptoVerifyMacRequest, CryptoSignRequest, CryptoVerifyRequest, CryptoPublicKeyRequest, CryptoTotpRequest, CryptoHashRequest, CryptoRandomRequest, CryptoHashPasswordRequest, CryptoVerifyPasswordRequest, CryptoRequest, CryptoEncryptResult, CryptoDecryptResult, CryptoRewrapResult, CryptoMacResult, CryptoVerifyResult, CryptoSignResult, CryptoPublicJWK, CryptoPublicKeyResult, CryptoTotpResult, CryptoHashResult, CryptoRandomResult, CryptoHashPasswordResult, CryptoVerifyPasswordResult, CryptoResultByOp, CryptoResult, DecideRequest, DecideResponse, DecisionQuestion, DecisionChoiceQuestion, DecisionNoulQuestion, DecisionScoreQuestion, DecisionAnswer, DecisionChoiceAnswer, DecisionNoulAnswer, DecisionScoreAnswer, DecisionModel, DecisionModelsResponse, SpeechFormat, SpeechOptions, SpeechResult, TranscribeOptions, TranscribeResult, TranscriptSegment, SpeechInfo, SpeechDirectionInfo, SpeechLanguageInfo, TranscriptionDirectionInfo, AclMode, AclSource, AclEffect, AclSubjectKind, AclCondition, AclRule, AclList, AclDefRow, AclDefListResponse, AclDefNamesResponse, AclValidateResult, AclCatalogType, AclCatalog, AclDefOp, AclDefInput, GroupRow, GroupMemberKind, GroupMember, GroupListResponse, GroupDetail, GroupEffective, CreateGroupBody, GroupMemberChange, AclBinding, AclBindingListResponse, CreateAclBindingBody, AuthzReason, AuthzDecision, AuthzRequestContext, AuthzEvaluationRequest, AuthzEvaluationsSemantic, AuthzEvaluationsRequest, AuthzEvaluationsResponse, AuthzTrace, AuthzAppliedBinding, AuthzExplainResponse, AuthzDraftBinding, AuthzSimulateRequest, AuthzSimulateResult, AuthzSimulateResponse, OAuthServerMetadata, OAuthTokenResponse, OAuthTokenSet, BeginAuthorizeOptions, AuthorizeRequest, AuthorizeResponseParams, CompleteAuthorizeOptions, RefreshTokenOptions, RevokeTokenOptions, TokenProvider, AppClientRefresh, AppClientConfig, ClientDefInput, ClientDefRecord, ConfigAppClient, AppClientEntry, ClientDefListResponse, ClientDefVerifyResult, ClientDefRetireResult, ClientDefNameSummary, ClientDefNamesResponse, DeviceLoginPrompt, DeviceLoginOptions, DeviceLoginResult, } from "./types.js";
222
223
  export { AclDeniedError, AgentIDInUseError, AgentNotFoundError, AlreadyPausingError, AuthError, BackpressureError, DeviceLoginError, NotFoundError, InsufficientScopeError, InvalidArgumentError, ChannelCursorRegressionError, LoomcycleError, NotPausedError, OAuthError, PauseNotConfiguredError, PerUserQuotaExhaustedError, PromptTooLargeError, RateLimitedError, RequestTooLargeError, SessionBusyError, SessionNotFoundError, SnapshotNotFoundError, SnapshotTooLargeError, SnapshotVersionError, SubstrateToolRefusedError, TokenLimitExceededError, UnavailableError, } from "./errors.js";
package/dist/index.js CHANGED
@@ -159,6 +159,7 @@
159
159
  * path(input): Promise<PathToolResponse> // resolve/ls/stat/mkdir/mv/rm
160
160
  * document(input): Promise<DocumentToolResponse> // 13 ops; needs SQL Memory
161
161
  * copyDocuments(input) / moveDocuments(input): Promise<DocumentTransferResult> // RFC FT, dry run by default
162
+ * findDuplicates(input): Promise<DocumentFindDuplicatesResult> // RFC GB, a report unless propose: true
162
163
  *
163
164
  * // History — browse/search/annotate past chats (RFC BE; tenant-confined)
164
165
  * history(input): Promise<HistoryToolResponse> // list/get/search/rename/annotate/pin/archive/recap/resume
package/dist/types.d.ts CHANGED
@@ -3784,7 +3784,7 @@ export type DocumentEdgeEvidence = {
3784
3784
  char_end?: number;
3785
3785
  };
3786
3786
  export type DocumentToolInput = {
3787
- op: "create_document" | "get_document" | "documents_summary" | "query_documents" | "graph_snapshot" | "delete_document" | "set_path" | "copy_documents" | "move_documents" | "create_chunk" | "upsert_chunk" | "get_chunk" | "update_chunk" | "delete_chunk" | "supersede_chunk" | "graph_recall" | "move_chunk" | "reorder_chunk" | "link_chunks" | "unlink_chunks" | "get_edges" | "get_edge" | "propose_statement" | "accept_statement" | "reject_statement" | "list_statements" | "judge_statements" | "maintain_statement" | "resolve_anchor" | "lease" | "release" | "describe_ontology" | "extract_citations" | "classify" | "accept_classification" | "query_chunks" | "add_tags" | "remove_tags" | "list_tags" | "define_type" | "list_types" | "set_asset" | "get_asset" | "export_md" | "import_md" | "backlinks" | "related" | "unlinked_mentions" | "history" | "get_version" | "diff" | "export_canvas" | "import_canvas" | "list_facts" | "judge_fact" | "verbatim_answer" | "verification_stats" | "remember" | "propose_entity" | "propose_subject" | "search" | "set_remote" | "sync" | "diff_remote";
3787
+ op: "create_document" | "get_document" | "documents_summary" | "query_documents" | "graph_snapshot" | "delete_document" | "set_path" | "copy_documents" | "move_documents" | "find_duplicates" | "create_chunk" | "upsert_chunk" | "get_chunk" | "update_chunk" | "delete_chunk" | "supersede_chunk" | "graph_recall" | "move_chunk" | "reorder_chunk" | "link_chunks" | "unlink_chunks" | "get_edges" | "get_edge" | "propose_statement" | "accept_statement" | "reject_statement" | "list_statements" | "judge_statements" | "maintain_statement" | "resolve_anchor" | "lease" | "release" | "describe_ontology" | "extract_citations" | "classify" | "accept_classification" | "query_chunks" | "add_tags" | "remove_tags" | "list_tags" | "define_type" | "list_types" | "set_asset" | "get_asset" | "export_md" | "import_md" | "backlinks" | "related" | "unlinked_mentions" | "history" | "get_version" | "diff" | "export_canvas" | "import_canvas" | "list_facts" | "judge_fact" | "verbatim_answer" | "verification_stats" | "remember" | "propose_entity" | "propose_subject" | "search" | "set_remote" | "sync" | "diff_remote";
3788
3788
  scope?: "agent" | "user" | "tenant";
3789
3789
  /** Document id (get/delete_document) or chunk id (get/update/delete/move_chunk). */
3790
3790
  id?: string;
@@ -3832,7 +3832,8 @@ export type DocumentToolInput = {
3832
3832
  kinds?: string[];
3833
3833
  /** link_chunks / propose_statement: the relation's qualifiers. */
3834
3834
  attributes?: Record<string, unknown>;
3835
- /** propose_statement / maintain_statement / upsert_chunk (its relation): how
3835
+ /** propose_statement / maintain_statement / upsert_chunk (its relation) /
3836
+ * find_duplicates (its proposals): how
3836
3837
  * the statement was made (maintain_statement: the judge of what it changes) — `rule:<name>` or `extractor:<name>`, the name `[a-z0-9_./-]{1,64}`.
3837
3838
  * Only a code-js agent whose `statement_methods` lists the prefix may send
3838
3839
  * it; anything else is refused with `method_not_granted`. Omitted = `manual`. */
@@ -3951,6 +3952,12 @@ export type DocumentToolInput = {
3951
3952
  /** move_documents: required with `dry_run: false` — the dry run's
3952
3953
  * `counts.documents`. */
3953
3954
  expect_count?: number;
3955
+ /** find_duplicates: how documents match — `sha256` (the same text) and/or
3956
+ * `title` (the same title once copy markers are stripped). Omitted = both. */
3957
+ basis?: ("sha256" | "title")[];
3958
+ /** find_duplicates: true files a `duplicate_of` proposal per pair; false (the
3959
+ * default) only reports. */
3960
+ propose?: boolean;
3954
3961
  /** search / related: never chunks of these documents (e.g. the document under
3955
3962
  * review, so its own text is not found as evidence for itself). */
3956
3963
  exclude_document_ids?: string[];
@@ -4172,6 +4179,56 @@ export interface DocumentTransferResult {
4172
4179
  statements_failed?: number;
4173
4180
  statement_error?: string;
4174
4181
  }
4182
+ /** The set and options of {@link LoomcycleClient.findDuplicates} — the
4183
+ * Document tool's find_duplicates, in its wire shape. `document_ids`,
4184
+ * `under_path` and `under_paths` combine (at most 5000 documents). A report
4185
+ * unless `propose: true`. */
4186
+ export interface DocumentFindDuplicatesInput {
4187
+ /** Where the documents are (default `user`). */
4188
+ scope?: "agent" | "user" | "tenant";
4189
+ document_ids?: string[];
4190
+ under_path?: string;
4191
+ under_paths?: string[];
4192
+ /** `sha256` (the same text) and/or `title` (the same title once copy markers
4193
+ * are stripped, and the same kind of document). Omitted = both. */
4194
+ basis?: ("sha256" | "title")[];
4195
+ /** true files a `duplicate_of` proposal from each copy to its original,
4196
+ * through propose_statement; false (the default) only reports. */
4197
+ propose?: boolean;
4198
+ /** `rule:<name>` or `extractor:<name>`, only for an agent granted that
4199
+ * statement method; omitted = the proposals are the caller's own. */
4200
+ method?: string;
4201
+ }
4202
+ /** One copy and its original. `copy_id` / `original_id` are document ids; the
4203
+ * statement, when one is filed, joins their root chunks. */
4204
+ export interface DocumentDuplicatePair {
4205
+ copy_id: string;
4206
+ original_id: string;
4207
+ copy_root_id: string;
4208
+ original_root_id: string;
4209
+ copy_title: string;
4210
+ original_title: string;
4211
+ basis: "sha256" | "title";
4212
+ /** 1.0 for sha256, 0.7 for title. */
4213
+ confidence: number;
4214
+ /** The proposal filed for this pair (propose: true). */
4215
+ statement_id?: string;
4216
+ status?: string;
4217
+ ontology_valid?: boolean;
4218
+ /** `exists` — the pair already has a duplicate_of statement, either way
4219
+ * round and in any status; `refused:<category>` — propose_statement refused
4220
+ * it, with its message in `detail`. */
4221
+ skipped?: string;
4222
+ detail?: string;
4223
+ }
4224
+ /** What {@link LoomcycleClient.findDuplicates} answers. */
4225
+ export interface DocumentFindDuplicatesResult {
4226
+ /** At most 1000 (`truncated` says so); every pair is still proposed. */
4227
+ pairs: DocumentDuplicatePair[];
4228
+ /** documents, pairs, sha256, title, proposed, skipped_existing, refused. */
4229
+ counts: Record<string, number>;
4230
+ truncated: boolean;
4231
+ }
4175
4232
  /** What a filtered `document({op:"search"|"related", …})` call resolved its
4176
4233
  * structural filter to — present on the response ONLY when a filter argument
4177
4234
  * was passed (a filter-free response has no `filter` key). */
@@ -5473,13 +5530,14 @@ export interface AgentDefOverlay {
5473
5530
  * Held to the author's own grant; a sub-agent may perform an operation
5474
5531
  * only when its parent run also may. */
5475
5532
  git_remote?: Array<'fetch' | 'push'>;
5476
- /** Which methods the agent may stamp on the document relations it writes:
5477
- * `'rule'` (its code found it) and/or `'extractor'` (a model it drives
5478
- * found it). Only for `provider: 'code-js'` — refused on any other
5479
- * provider. Unset or `[]` = none: every relation it writes is stamped
5480
- * `manual`. A new agent may list only what its author may stamp; a fork
5481
- * only what the version it forks held. */
5482
- statement_methods?: Array<'rule' | 'extractor'>;
5533
+ /** What the agent's runs may do with document statements. `'rule'` (its
5534
+ * code found the relation), `'extractor'` (a model it drives found it) and
5535
+ * `'judge'` (it records the judge's verdicts) are for `provider: 'code-js'`
5536
+ * only. `'link'`: its `link_chunks` in the tenant scope is asserted rather
5537
+ * than filed for review. `'remember'`: its runs may call Document
5538
+ * `remember`. Unset or `[]` = none. A new agent may list only what its
5539
+ * author holds; a fork only what the version it forks held. */
5540
+ statement_methods?: Array<'rule' | 'extractor' | 'judge' | 'link' | 'remember'>;
5483
5541
  /** Channel tool ACL (default-deny until set). */
5484
5542
  channels?: AgentChannelACL;
5485
5543
  /** Interruption tool gate — `enabled: true` REQUIRED for the tool to work. */
@@ -7143,6 +7201,10 @@ export interface SpeechDirectionInfo {
7143
7201
  export interface TranscriptionDirectionInfo {
7144
7202
  enabled: boolean;
7145
7203
  default_language?: string;
7204
+ /** The languages a request may name, when the operator set a list
7205
+ * (`transcription.stt.languages`); another is a 400
7206
+ * `unsupported_language`. Absent: any supported code. */
7207
+ languages?: string[];
7146
7208
  /** The recording types the route takes. `audio/wav` always; with a
7147
7209
  * converter, `audio/*` and `video/*`; without one, the types the engine
7148
7210
  * reads whole. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loomcycle/client",
3
- "version": "1.141.0",
3
+ "version": "1.143.0",
4
4
  "description": "TypeScript client for the loomcycle sidecar (HTTP+SSE). 71 methods covering run streaming, agent metadata, pause/resume/state, resolver re-probe (resolveProbe — issue #88 operator escape hatch), operator-token admin (operatorTokenDef — RFC L OSS multi-tenant auth) + whoami (RFC L authoritative principal, v0.17.0) + tenant-scoped listUsers / listUserAgents, dynamic MCP registration (mcpServerDef + v0.18.0 typed mcpServerDefVerify + ensureMcpServer idempotent register-if-changed), snapshot lifecycle, memory admin (incl. v0.9.0 Vector Memory embed_stats + reembed AND v0.11.5 setMemoryEntry + deleteMemoryEntry), interruption resolve, hook management, v0.8.22 substrate admin (agentDef + skillDef), v0.9.x n8n Phase 0 (listChannels + streamUserRunStates), v0.9.x Channel CRUD (publishChannel + subscribeChannel + peekChannel + ackChannel), v0.11.5 Channel admin CRUD (createChannel + updateChannel + deleteChannel — runtime substrate; yaml channels refuse mutation with HTTP 409), v0.9.x content_sha256 verify, v0.9.1 transcript first-cycle, v0.9.x dynamic MCP server registration (mcpServerDef + MCPServerDefVerifyResult), v0.10.3 Library v2 enumeration (listLibraryAgents + listLibrarySkills + listLibraryMcpServers), and v0.11.0 LLM Gateway (llmChat + llmStream — direct provider routing without agent overhead; primary target is n8n's LoomCycleChatModel AI Agent sub-node and any LangChain-compatible consumer). v0.10.1 — dual ESM + CommonJS distribution (additive — ESM consumers unchanged; CJS consumers like n8n's community-node loader now work). v0.19.0 — typed inline code-js agent ingestion (AgentDefOverlay.code_body + ensureCodeAgent — register a deterministic code agent through the substrate with no host filesystem bind; RFC J). v0.20.0 — ensureMcpServer surfaces discoveredToolCount straight from create (loomcycle now auto-discovers MCP tools at ingestion); rediscover is now an explicit force-refresh. v0.21.0 — run/continue accept optional non-secret `metadata` (repo name, review policy, …) passed to the agent, symmetric with the WebHook/Schedule trigger paths. v0.22.0 — version-aligned lockstep release; no client-surface change (RFC N tenant isolation of the agent/skill/MCP/Schedule/Webhook definition plane + real op-schemas on the builtin MCP meta-tools are both server-side). v0.23.0 — version-aligned lockstep release; no client-surface change (RFCs O/P/R MCP-server hardening + thin client and the RFC Q DeepSeek tool-content fix are all server-side / MCP-transport-side). v0.24.0 — purgeChannel clears a channel's buffered messages without deleting its definition (allowed on yaml-declared channels too, unlike deleteChannel — F20); AgentDefOverlay gains channels / evaluation_scopes / interruption so a COMPLETE interactive/multi-agent agent round-trips over the substrate (F14). (Consolidates the interim 0.24/0.25 package bumps, which were never tag-published, back into lockstep with the loomcycle v0.24.0 tag.) v0.25.0 — adds the RFC S channel fan-in/fan-out client twins: awaitChannels() (wait for any/all/at_least N messages across channels, or a timeout — non-committing) + broadcastChannels() (publish one payload to N channels in one atomic-pre-flight call), the client-facing counterparts of the in-band Channel.await / Channel.broadcast tool ops (the rest of v0.25.0 — the manual-management Web UI console + Context op=time + max_fires self-retiring schedules — is server-side / in-band, no client-surface change). v0.29.1 — Usage gains optional `max_context_tokens` (the serving model's context-window ceiling, stamped by the loop from Provider.Capabilities() on each usage event) so a consumer can render a 'context used / max' gauge without a hard-coded per-model table; additive + optional, no behavior change. (Lockstep catch-up: the field landed in loomcycle v0.29.0 but the adapter publish skipped on a version mismatch; v0.29.1 realigns the package version with the release tag so it publishes.) v0.33.0 — gRPC + TS client parity for the RFC Y external fan-out and the compaction surface: spawnRunBatch() (POST /v1/runs:batch — spawn up to 32 fresh runs concurrently in one call, combined index-aligned envelope, per-child failures in-envelope) + compactRun(runId) (POST /v1/runs/{run_id}/compact — summarize a parked run's context); plus per-run sampling + compaction overrides now accepted on runStreaming / continueSession (an explicit temperature 0 is preserved as deterministic, not dropped as falsy). (The gRPC half adds the matching SpawnRunBatch / CompactRun RPCs + the sampling/compaction fields on RunRequest/ContinueRequest — server-side.) v0.34.0 — version-aligned lockstep release; no client-surface change (context-transform plugins / RFC Z Phase 1a are server-side config; the exp7 hardening pass is server-side; the R2 cross-provider thinking-model downgrade surfaces a new `model_downgraded` SSE event the generic stream passes through unchanged). v0.35.0 — RFC AH dynamic filesystem volumes: volumeDef() (POST /v1/_volumedef — op-discriminated create/get/list/delete/purge; a Volume is flat, so delete unmaps + purge RemoveAll's, no retire/promote/fork) + listVolumes() / listEphemeralVolumes() (GET /v1/_volumes[/ephemeral] — tenant-scoped; host paths redacted for non-operator callers). Tenant-confined; the runtime derives the path inside an operator-blessed dynamic_root, so callers pass name + mode, never a host path. v1.1.1 — RFC AI interactive agentic sessions: an `interactive: true` flag on runStreaming/continueSession (a run that parks at end_turn for steering) + sendRunInput(runId, text) (POST /v1/runs/{id}/input — steer a live run) + streamRunByID(runId, {fromSeq}) (GET /v1/runs/{id}/stream — re-attach by run_id; the operator's prior turns replay as `steer` events so a cold client reconstructs the whole conversation) + a high-level InteractiveSession driver (client.interactiveSession / attachInteractiveSession — events()/send()/cancel(), the adapter port of the Web UI run terminal). The AgentEvent union gains awaiting_input/steer/context_compaction frames. Version-aligned with the loomcycle v1.1.x line so the v1.1.1 tag publishes it (also carrying the previously-unpublished v0.35.0 volume surface). v1.4.0 — RFC AL Path VFS + RFC AK Document on the wire: path(input) (POST /v1/_path — a Unix-like filesystem over Memory/Volumes/Documents; resolve/ls/stat/mkdir/mv/rm) + document(input) (POST /v1/_document — chunked-graph documents; 13 ops, needs SQL Memory on the sidecar). Scope (agent/user/tenant) + tenant are resolved server-side from the authenticated principal, never the wire; an off-run scope:'user' op keys on the principal subject so it interoperates with that user's agent runs. New PathToolInput / DocumentToolInput types; responses are op-varying (unknown — narrow as needed). v1.7.0 — RFC AT image/vision input: the PromptContent union gains an `image` variant ({ type:'image'; media_type: ImageMediaType; data: base64-no-prefix }) accepted in a user segment by runStreaming / continueSession (segments pass through unchanged — no method change). The model must be vision-capable or the run errors before the call. New ImageMediaType type (image/png|jpeg|gif|webp). v1.12.1 — Path/Document browse-by-subject + the full Document op set (RFC AS/AK): path(input, opts) / document(input, opts) accept optional scopeId / tenant browse overrides sent as ?scope_id= / ?tenant= query params (server reads them from the URL, re-checks authorization; omit both to browse your own subject — byte-identical to the pre-RFC-AS request), and DocumentToolInput.op now covers all 16 backend ops (adds set_path, export_md, import_md) with the matching include_metadata / markdown fields. Additive — existing path() / document() callers are unchanged. v1.16.0 — RFC BC client-executed tools (local tool host): connectClientTools({tools,onInvoke}) opens a persistent WebSocket to /v1/client-tools, registers tools this client runs on the user's machine (browser DOM / files / shell), and answers the invoke frames loomcycle routes when an agent of your principal calls a client:<tool> — returning your reply as an ordinary tool result. Returns a ClientToolHost driver (.close() to stop; auto-reconnect); dependency-free (global WebSocket in browsers / Node 22+, or an injected WebSocketImpl like the ws package on older Node); the bearer rides the Sec-WebSocket-Protocol subprotocol (browsers can't set an Authorization header on a WebSocket). The runtime's first WebSocket surface. v1.45.0 — RFC BL P5 subject erasure: erasureReport(subject, {tenant}) (GET /v1/_erasure — what this deployment holds about one subject, in three tiers: deletable with existing primitives, subject-keyed but not deletable, and facts ABOUT the subject in scopes they do not own) + erasureExecute(subject, {dryRun, confirm, tenant}) (POST /v1/_erasure — removes tiers 1 and 2). DEFAULTS TO A DRY RUN: dryRun defaults true and a live run also requires confirm === subject. The tier-3 residue is traceable only through the subject's chats, which a live run deletes, so a report afterwards shows rows: 0 while those facts remain — the returned object is the only durable record of what was not reached; persist it. New ErasureReport / ErasureResult / ErasureTier / ErasureResidue types. v1.47.0 — RFC BV memory-view SDK: memorySearch() (POST /v1/_memory/search — off-run unified semantic search spanning k/v entries AND document-chunk bodies in one ranked list, each hit tagged kind memory|document with chunk_id on document hits) + memoryEmbedStats(scope) + reembedMemory(scope, scopeId, {dryRun,limit}) (the Vector Memory embed-admin reads the memory-view console needs; dry_run defaults true). Fact reads (list_facts + get_chunk's entity block) ride the existing document() passthrough. Additive — existing callers unchanged. v1.61.0 — RFC CJ per-run context-window override: runStreaming / continueSession accept an optional maxContextTokens (integer tokens) that wins over the agent's own max_context_tokens; omitted inherits it (which defers to the provider/driver default). Distinct from a model's output cap; primarily for local inference (Ollama num_ctx). Serialized as the snake_case max_context_tokens field on POST /v1/runs + the continuation body; additive, existing callers unchanged. v1.72.1 — the TeamDef version lifecycle: listTeamVersions(name) (op=list — every version of one team, newest first), promoteTeam(defId) (op=promote — point the active pointer, which is what a run BY NAME executes; forkTeam defaults to promote:false, so authoring and putting in force stay two steps), retireTeam(defId, retired) (op=retire — reversible and version-scoped, unlike deleteTeam) and verifyTeam(name, contentSha256) (op=verify — the drift check for a workflow kept in source control and pushed to several deployments; an absent team answers deployed:false rather than raising). The ops existed on the substrate and over HTTP; a client that could author a team could not put one in force.",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -39,7 +39,7 @@
39
39
  "devDependencies": {
40
40
  "@types/node": "^26.6.6",
41
41
  "typescript": "^7.0.2",
42
- "vitest": "^5.0.5"
42
+ "vitest": "^5.1.0"
43
43
  },
44
44
  "engines": {
45
45
  "node": ">=18"