@relayfile/sdk 0.8.11 → 0.8.12

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/client.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { type AdminIngressStatusResponse, type AdminSyncStatusResponse, type BulkWriteInput, type BulkWriteResponse, type BackendStatusResponse, type AckResponse, type CommitForkInput, type CommitForkResponse, type CreateForkInput, type DeleteFileInput, type DeadLetterItem, type DeadLetterFeedResponse, type DiscardForkInput, type EventFeedResponse, type ExportJsonResponse, type ExportOptions, type FileQueryResponse, type FileReadResponse, type FilesystemEvent, type GetEventsOptions, type GetAdminIngressStatusOptions, type GetAdminSyncStatusOptions, type GetOperationsOptions, type GetSyncDeadLettersOptions, type GetSyncIngressStatusOptions, type GetSyncStatusOptions, type ListTreeOptions, type OperationFeedResponse, type OperationStatusResponse, type QueuedResponse, type ResourceAtEventResult, type ReadFileInput, type QueryFilesOptions, type Subscription, type SyncIngressStatusResponse, type SyncStatusResponse, type TreeResponse, type WriteFileInput, type WriteQueuedResponse, type IngestWebhookInput, type WritebackItem, type AckWritebackInput, type AckWritebackResponse, type ChangeEvent, type ChangeLogQueryResult, type ChangeStreamConnection, type ChangeStreamConnectionOptions, type SubscribeOptions } from "./types.js";
1
+ import { type AdminIngressStatusResponse, type AdminSyncStatusResponse, type BulkWriteInput, type BulkWriteResponse, type BackendStatusResponse, type AckResponse, type CommitForkInput, type CommitForkResponse, type CreateForkInput, type DeleteFileInput, type DeadLetterItem, type DeadLetterFeedResponse, type DiscardForkInput, type EventFeedResponse, type ExportJsonResponse, type ExportOptions, type FileQueryResponse, type FileReadResponse, type FilesystemEvent, type GetEventsOptions, type GetAdminIngressStatusOptions, type GetAdminSyncStatusOptions, type GetOperationsOptions, type GetSyncDeadLettersOptions, type GetSyncIngressStatusOptions, type GetSyncStatusOptions, type ListTreeOptions, type OperationFeedResponse, type OperationStatusResponse, type QueuedResponse, type ResourceAtEventResult, type ReadFileInput, type QueryFilesOptions, type Subscription, type SyncIngressStatusResponse, type SyncStatusResponse, type TreeResponse, type WriteFileInput, type WriteQueuedResponse, type IngestWebhookInput, type WritebackItem, type AckWritebackInput, type AckWritebackResponse, type SweepWritebackDraftsInput, type SweepWritebackDraftsResponse, type ChangeEvent, type ChangeLogQueryResult, type ChangeStreamConnection, type ChangeStreamConnectionOptions, type SubscribeOptions } from "./types.js";
2
2
  import type { ForkHandle } from "@relayfile/core";
3
3
  /**
4
4
  * Bearer token or token factory used for Relayfile API requests.
@@ -127,6 +127,11 @@ export declare class RelayFileClient {
127
127
  ingestWebhook(input: IngestWebhookInput): Promise<QueuedResponse>;
128
128
  listPendingWritebacks(workspaceId: string, correlationId?: string, signal?: AbortSignal): Promise<WritebackItem[]>;
129
129
  ackWriteback(input: AckWritebackInput): Promise<AckWritebackResponse>;
130
+ /**
131
+ * One-time residue sweep for accumulated writeback drafts (issue #242).
132
+ * Dry run unless `apply` is true; classification-exempt service-side.
133
+ */
134
+ sweepWritebackDrafts(input: SweepWritebackDraftsInput): Promise<SweepWritebackDraftsResponse>;
130
135
  private cacheWireChangeEvent;
131
136
  private primeReplayCache;
132
137
  private resolveWorkspaceId;
package/dist/client.js CHANGED
@@ -1523,7 +1523,26 @@ export class RelayFileClient {
1523
1523
  correlationId: input.correlationId,
1524
1524
  body: {
1525
1525
  success: input.success,
1526
- error: input.error
1526
+ error: input.error,
1527
+ externalId: input.externalId,
1528
+ canonicalPath: input.canonicalPath
1529
+ },
1530
+ signal: input.signal
1531
+ });
1532
+ }
1533
+ /**
1534
+ * One-time residue sweep for accumulated writeback drafts (issue #242).
1535
+ * Dry run unless `apply` is true; classification-exempt service-side.
1536
+ */
1537
+ async sweepWritebackDrafts(input) {
1538
+ return this.request({
1539
+ method: "POST",
1540
+ path: `/v1/workspaces/${encodeURIComponent(input.workspaceId)}/writeback/sweep-drafts`,
1541
+ correlationId: input.correlationId,
1542
+ body: {
1543
+ pathPrefix: input.pathPrefix,
1544
+ patterns: input.patterns,
1545
+ apply: input.apply === true
1527
1546
  },
1528
1547
  signal: input.signal
1529
1548
  });
package/dist/index.d.ts CHANGED
@@ -9,7 +9,7 @@ export { InvalidStateError, PayloadTooLargeError, QueueFullError, RelayFileApiEr
9
9
  export { IntegrationProvider, computeCanonicalPath } from "./provider.js";
10
10
  export type { WebhookInput, ListProviderFilesOptions, WatchProviderEventsOptions } from "./provider.js";
11
11
  export type { ConnectionProvider, NormalizedWebhook, ProxyHeaders, ProxyMethod, ProxyQuery, ProxyRequest, ProxyResponse, } from "./connection.js";
12
- export type { AckResponse, AckWritebackInput, AckWritebackResponse, AdminIngressAlert, AdminIngressAlertProfile, AdminIngressEffectiveAlertProfile, AdminIngressAlertSeverity, AdminIngressAlertThresholds, AdminIngressAlertTotals, AdminIngressAlertType, AdminIngressStatusResponse, AdminSyncAlert, AdminSyncAlertSeverity, AdminSyncAlertThresholds, AdminSyncAlertTotals, AdminSyncAlertType, AdminSyncStatusResponse, BackendStatusResponse, BulkWriteFile, BulkWriteInput, BulkWriteResponse, ChangeLogQueryResult, ChangeEvent, ChangeEventActor, ChangeEventResource, ChangeEventSummary, ChangeStreamConnection, ChangeStreamConnectionOptions, CommitForkInput, CommitForkResponse, ConflictErrorResponse, CreateForkInput, ContentIdentity, DeleteFileInput, DeadLetterFeedResponse, DeadLetterItem, DigestBullet, DigestContext, DigestHandler, DigestSection, DigestWindow, DiscardForkInput, ErrorResponse, EventSummary, EventFeedResponse, ExportFormat, ExportJsonResponse, ExportOptions, FileQueryItem, FileQueryResponse, FileReadResponse, FileSemantics, FileWriteRequest, FilesystemEvent, FilesystemEventType, EventOrigin, Expansion, ExpansionLevel, GetEventsOptions, GetAdminSyncStatusOptions, GetAdminIngressStatusOptions, GetOperationsOptions, GetSyncDeadLettersOptions, GetSyncIngressStatusOptions, GetSyncStatusOptions, IngestWebhookInput, LayoutManifest, LayoutManifestAlias, LayoutManifestResource, ListTreeOptions, OperationFeedResponse, OperationStatus, OperationStatusResponse, QueuedResponse, QueryFilesOptions, ReadFileInput, ReplayOptions, ResourceAtEventResult, SummaryExpansion, FullExpansion, DiffExpansion, ThreadExpansion, RelayFileJwtClaims, SubscribeOptions, Subscription, SyncIngressStatusResponse, SyncProviderStatus, SyncProviderStatusState, SyncRefreshRequest, SyncStatusResponse, TreeEntry, TreeResponse, WritebackActionType, WritebackDeadLetterError, WritebackDeadLetterErrorCode, WritebackListState, WritebackState, WritebackItem, WritebackItemDetail, WritebackSchemaRef, WriteFileInput, WriteQueuedResponse } from "./types.js";
12
+ export type { AckResponse, AckWritebackInput, AckWritebackDraftDisposition, AckWritebackResponse, AdminIngressAlert, AdminIngressAlertProfile, AdminIngressEffectiveAlertProfile, AdminIngressAlertSeverity, AdminIngressAlertThresholds, AdminIngressAlertTotals, AdminIngressAlertType, AdminIngressStatusResponse, AdminSyncAlert, AdminSyncAlertSeverity, AdminSyncAlertThresholds, AdminSyncAlertTotals, AdminSyncAlertType, AdminSyncStatusResponse, BackendStatusResponse, BulkWriteFile, BulkWriteInput, BulkWriteResponse, ChangeLogQueryResult, ChangeEvent, ChangeEventActor, ChangeEventResource, ChangeEventSummary, ChangeStreamConnection, ChangeStreamConnectionOptions, CommitForkInput, CommitForkResponse, ConflictErrorResponse, CreateForkInput, ContentIdentity, DeleteFileInput, DeadLetterFeedResponse, DeadLetterItem, DigestBullet, DigestContext, DigestHandler, DigestSection, DigestWindow, DiscardForkInput, ErrorResponse, EventSummary, EventFeedResponse, ExportFormat, ExportJsonResponse, ExportOptions, FileQueryItem, FileQueryResponse, FileReadResponse, FileSemantics, FileWriteRequest, FilesystemEvent, FilesystemEventType, EventOrigin, Expansion, ExpansionLevel, GetEventsOptions, GetAdminSyncStatusOptions, GetAdminIngressStatusOptions, GetOperationsOptions, GetSyncDeadLettersOptions, GetSyncIngressStatusOptions, GetSyncStatusOptions, IngestWebhookInput, LayoutManifest, LayoutManifestAlias, LayoutManifestResource, ListTreeOptions, OperationFeedResponse, OperationStatus, OperationStatusResponse, QueuedResponse, QueryFilesOptions, ReadFileInput, ReplayOptions, ResourceAtEventResult, SummaryExpansion, FullExpansion, DiffExpansion, ThreadExpansion, RelayFileJwtClaims, SubscribeOptions, Subscription, SyncIngressStatusResponse, SyncProviderStatus, SyncProviderStatusState, SyncRefreshRequest, SyncStatusResponse, SweepWritebackDraftsInput, SweepWritebackDraftsResponse, TreeEntry, TreeResponse, WritebackActionType, WritebackDeadLetterError, WritebackDeadLetterErrorCode, WritebackListState, WritebackState, WritebackItem, WritebackItemDetail, WritebackSchemaRef, WriteFileInput, WriteQueuedResponse } from "./types.js";
13
13
  export type { ForkHandle, ForkOptions } from "@relayfile/core";
14
14
  export type { WriteEvent, WriteEventActor, WriteEventOperation, WriteEventSource } from "@relayfile/core";
15
15
  export { WritebackConsumer } from "./writeback-consumer.js";
package/dist/types.d.ts CHANGED
@@ -700,12 +700,58 @@ export interface AckWritebackInput {
700
700
  itemId: string;
701
701
  success: boolean;
702
702
  error?: string;
703
+ /**
704
+ * Provider-assigned id of the created/updated object (e.g. the Slack
705
+ * message ts). When present on a successful ack, the service reconciles
706
+ * the agent-authored draft file per the draftFile() rename contract
707
+ * (issue #242): the draft is renamed to the canonical id, or removed when
708
+ * the canonical record already materialized. The mutation is
709
+ * classification-exempt — it can never enqueue a new writeback.
710
+ */
711
+ externalId?: string;
712
+ /**
713
+ * Optional canonical projection path for the draft rename. Must stay under
714
+ * the same provider root as the draft; otherwise the service falls back to
715
+ * the externalId-derived name next to the draft.
716
+ */
717
+ canonicalPath?: string;
703
718
  correlationId?: string;
704
719
  signal?: AbortSignal;
705
720
  }
721
+ /** Disposition of the agent-authored draft file after a successful ack. */
722
+ export interface AckWritebackDraftDisposition {
723
+ action: "renamed" | "removed" | "none";
724
+ from?: string;
725
+ to?: string;
726
+ }
706
727
  export interface AckWritebackResponse {
707
728
  status: "acknowledged";
708
729
  id: string;
709
730
  correlationId?: string;
710
731
  success: boolean;
732
+ /** Present only when the ack was successful and carried an externalId. */
733
+ draft?: AckWritebackDraftDisposition;
734
+ }
735
+ export interface SweepWritebackDraftsInput {
736
+ workspaceId: string;
737
+ /** Restrict the sweep to a subtree. */
738
+ pathPrefix?: string;
739
+ /** Basename globs for hand-named drafts, e.g. "wb-*.json". */
740
+ patterns?: string[];
741
+ /** Execute removals; when false the sweep is a dry run. */
742
+ apply?: boolean;
743
+ correlationId?: string;
744
+ signal?: AbortSignal;
745
+ }
746
+ export interface SweepWritebackDraftsResponse {
747
+ dryRun: boolean;
748
+ scanned: number;
749
+ removed: Array<{
750
+ path: string;
751
+ reason: "space-uuid-draft" | "pattern";
752
+ }>;
753
+ skipped: Array<{
754
+ path: string;
755
+ reason: "pending-writeback" | "provider-linked";
756
+ }>;
711
757
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@relayfile/sdk",
3
- "version": "0.8.11",
3
+ "version": "0.8.12",
4
4
  "description": "TypeScript SDK for relayfile — real-time filesystem for humans and agents",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -55,7 +55,7 @@
55
55
  "prepublishOnly": "npm run build"
56
56
  },
57
57
  "dependencies": {
58
- "@relayfile/core": "0.8.11",
58
+ "@relayfile/core": "0.8.12",
59
59
  "ignore": "^7.0.5",
60
60
  "tar": "^7.5.10"
61
61
  },