@alfe.ai/openclaw-sync 0.3.6 → 0.3.7

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
@@ -142,26 +142,32 @@ declare class AgentApiTransport {
142
142
  * `Content-Type: application/json` and parses a `{ data: T }` envelope,
143
143
  * neither of which fits a raw-audio flow (voice TTS/STT), so those go
144
144
  * through this instead. Auth (Bearer), the request budget, and the single
145
- * retry on transient 5xx / network errors are kept in sync with
146
- * `request()`. Retries fire only on statuses produced BEFORE the route
147
- * handler runs (authorizer-timeout 500 + LB 502/503/504), so re-issuing a
148
- * POST does not risk a duplicate side effect.
145
+ * retry policy on transient 5xx / network errors is kept in sync with
146
+ * `request()`. Safe read methods retry once by default; mutation methods do
147
+ * not, because a response can be lost after a handler or provider call has
148
+ * already succeeded.
149
149
  */
150
150
  rawRequest(path: string, init: {
151
151
  method: string;
152
152
  headers: Headers;
153
153
  body?: BodyInit | Uint8Array;
154
+ }, extra?: {
155
+ retry?: boolean;
154
156
  }): Promise<Response>;
155
157
  /**
156
158
  * @param extra.timeoutMs Per-request abort timeout (default REQUEST_TIMEOUT_MS).
157
159
  * Long endpoints (image generation) pass a larger value so the gateway's
158
160
  * own timeout wins with a readable status instead of a client-side abort.
159
- * @param extra.retry Whether to retry once on transient failures (default
160
- * true). Expensive/non-idempotent endpoints pass false.
161
+ * @param extra.retry Whether to retry once on transient failures. Safe reads
162
+ * (GET/HEAD/OPTIONS) default to true; mutations default to false. Set true
163
+ * only when the endpoint's server-side contract is explicitly idempotent.
164
+ * @param extra.signal Optional caller cancellation combined with the client's
165
+ * own timeout budget. Aborting either signal cancels the request.
161
166
  */
162
167
  request<T>(path: string, options?: RequestInit, extra?: {
163
168
  timeoutMs?: number;
164
169
  retry?: boolean;
170
+ signal?: AbortSignal;
165
171
  }): Promise<T>;
166
172
  }
167
173
  /**
@@ -177,7 +183,7 @@ declare class ApiBase {
177
183
  //# sourceMappingURL=transport.d.ts.map
178
184
  //#endregion
179
185
  //#region src/domains/workspace.d.ts
180
- /** Response of GET /agents/me/workspace (services/agents). */
186
+ /** Response of GET /agent/workspace (services/agents). */
181
187
  interface AgentWorkspaceInfo {
182
188
  templateKey?: string;
183
189
  defaultModel?: string;
@@ -205,7 +211,7 @@ interface AgentWorkspaceInfo {
205
211
  }
206
212
  declare class WorkspaceApi extends ApiBase {
207
213
  /**
208
- * GET /agents/me/workspace — workspace config for the authenticated agent
214
+ * GET /agent/workspace — workspace config for the authenticated agent
209
215
  * (template assignment, default model, org roster).
210
216
  */
211
217
  getWorkspace(): Promise<AgentWorkspaceInfo>;
@@ -348,6 +354,8 @@ declare class SyncApi extends ApiBase {
348
354
  sharedListFiles(args: {
349
355
  scope: "org" | "team" | "project";
350
356
  scopeId: string;
357
+ limit?: number;
358
+ cursor?: string;
351
359
  }): Promise<{
352
360
  files: SharedFileEntry[];
353
361
  nextCursor: string | null;
@@ -507,7 +515,9 @@ declare class KnowledgeApi extends ApiBase {
507
515
  * from `services/org`, then fetches the bytes directly from S3 (the one
508
516
  * legitimate raw fetch in a plugin — same pattern as sync).
509
517
  */
510
- readScopeDoc(scopeType: KnowledgeScopeType, scopeId: string, filePath: string): Promise<{
518
+ readScopeDoc(scopeType: KnowledgeScopeType, scopeId: string, filePath: string, opts?: {
519
+ maxBytes?: number;
520
+ }): Promise<{
511
521
  filePath: string;
512
522
  text: string;
513
523
  }>;
@@ -546,15 +556,11 @@ interface MobileAvailableNumber {
546
556
  }
547
557
  /** Approved WhatsApp content template from GET /mobile/whatsapp/templates. */
548
558
  interface WhatsAppTemplate {
549
- sid: string;
550
- friendlyName: string;
559
+ contentSid: string;
560
+ name: string;
551
561
  language: string;
552
562
  body: string;
553
563
  variables: Record<string, string>;
554
- dateCreated: string;
555
- dateUpdated: string;
556
- approvalStatus?: string;
557
- rejectionReason?: string;
558
564
  category?: string;
559
565
  }
560
566
  declare class MobileApi extends ApiBase {
@@ -802,15 +808,22 @@ declare class SearchApi extends ApiBase {
802
808
  offset?: number;
803
809
  country?: string;
804
810
  freshness?: string;
811
+ }, options?: {
812
+ signal?: AbortSignal;
805
813
  }): Promise<unknown>;
806
814
  searchImages(params: {
807
815
  query: string;
808
816
  count?: number;
817
+ }, options?: {
818
+ signal?: AbortSignal;
809
819
  }): Promise<unknown>;
810
820
  searchNews(params: {
811
821
  query: string;
812
822
  count?: number;
823
+ offset?: number;
813
824
  freshness?: string;
825
+ }, options?: {
826
+ signal?: AbortSignal;
814
827
  }): Promise<unknown>;
815
828
  /** Search news across the selected provider's corpus. → POST /agent/news/search */
816
829
  newsSearch(params: {
@@ -834,6 +847,48 @@ declare class SearchApi extends ApiBase {
834
847
  }
835
848
  //# sourceMappingURL=search.d.ts.map
836
849
  //#endregion
850
+ //#region src/domains/webhooks.d.ts
851
+ interface AgentWebhook {
852
+ webhookId: string;
853
+ tenantId: string;
854
+ agentId: string;
855
+ name: string;
856
+ provider: string;
857
+ active: boolean;
858
+ createdBy: string;
859
+ createdAt: string;
860
+ updatedAt: string;
861
+ }
862
+ interface CreatedAgentWebhook extends AgentWebhook {
863
+ url: string;
864
+ signingSecret: string;
865
+ }
866
+ interface AgentWebhookDelivery {
867
+ deliveryId: string;
868
+ webhookId: string;
869
+ status: string;
870
+ attempts: number;
871
+ createdAt: string;
872
+ deliveredAt?: string;
873
+ }
874
+ declare class WebhooksApi extends ApiBase {
875
+ createWebhook(args: {
876
+ name: string;
877
+ provider?: "generic" | "github" | "stripe" | "slack";
878
+ }): Promise<CreatedAgentWebhook>;
879
+ listWebhooks(): Promise<AgentWebhook[]>;
880
+ deleteWebhook(webhookId: string): Promise<{
881
+ webhookId: string;
882
+ active: false;
883
+ }>;
884
+ rotateWebhookSecret(webhookId: string): Promise<{
885
+ webhookId: string;
886
+ signingSecret: string;
887
+ }>;
888
+ listWebhookDeliveries(webhookId: string): Promise<AgentWebhookDelivery[]>;
889
+ }
890
+ //# sourceMappingURL=webhooks.d.ts.map
891
+ //#endregion
837
892
  //#region src/domains/chat.d.ts
838
893
  declare class ChatApi extends ApiBase {
839
894
  presignAttachments(files: {
@@ -970,8 +1025,9 @@ declare class ConnectCredentialsApi extends ApiBase {
970
1025
  * selector arg (e.g. `xeroTenantId`) on every credential-touching tool
971
1026
  * and look up the matching account by that selector at dispatch time.
972
1027
  *
973
- * Returned `accounts[i].accountIdentifier` is the Xero tenantId the
974
- * stable cross-session identifier the LLM should pass.
1028
+ * `xeroTenantId` is the model-facing organisation selector. The separate
1029
+ * `accountIdentifier` is the Connect persistence key used for refresh and
1030
+ * may be an email; never substitute one for the other.
975
1031
  */
976
1032
  getXeroAccounts(): Promise<{
977
1033
  accounts: {
@@ -989,12 +1045,12 @@ declare class ConnectCredentialsApi extends ApiBase {
989
1045
  expiresAt: string;
990
1046
  }>;
991
1047
  /**
992
- * Pattern A: refresh a specific Xero connection by its `accountIdentifier`
993
- * (the Xero `tenantId`). The legacy `refreshXeroToken()` only refreshes
994
- * the *primary* connection, which is wrong for multi-tenant Xero where
995
- * each tenant has its own non-interchangeable access token.
1048
+ * Refresh a specific Xero Connection by its exact `accountIdentifier` from
1049
+ * `getXeroAccounts()`. Do not substitute `xeroTenantId`: current Xero OAuth
1050
+ * rows may use the account email as their persistence key even when a sole
1051
+ * organisation tenant ID is available in provider metadata.
996
1052
  */
997
- refreshXeroAccountToken(xeroTenantId: string): Promise<{
1053
+ refreshXeroAccountToken(accountIdentifier: string): Promise<{
998
1054
  accessToken: string;
999
1055
  accessTokenExpiresAt: string;
1000
1056
  expiresAt: string;
@@ -1149,6 +1205,21 @@ declare class ConnectCredentialsApi extends ApiBase {
1149
1205
  accessToken: string;
1150
1206
  expiresAt: string;
1151
1207
  }>;
1208
+ /**
1209
+ * Pattern A: refresh one MYOB Connection by its stable
1210
+ * `accountIdentifier` (the MYOB business id returned by
1211
+ * `getMYOBAccounts()`).
1212
+ *
1213
+ * MYOB refresh tokens belong to individual Connection rows. A
1214
+ * multi-business client must use this method instead of refreshing the
1215
+ * primary Connection and copying that access token into every cached
1216
+ * business client.
1217
+ */
1218
+ refreshMYOBAccountToken(accountIdentifier: string): Promise<{
1219
+ accessToken: string;
1220
+ accessTokenExpiresAt: string;
1221
+ expiresAt: string;
1222
+ }>;
1152
1223
  /**
1153
1224
  * @deprecated Returns a single primary credential blob. Use
1154
1225
  * `getSalesforceAccounts()` for the multi-account shape required by
@@ -1211,9 +1282,6 @@ declare class ConnectCredentialsApi extends ApiBase {
1211
1282
  connectedAt: string;
1212
1283
  accessToken: string;
1213
1284
  accessTokenExpiresAt: string;
1214
- refreshToken: string;
1215
- clientId: string;
1216
- clientSecret: string;
1217
1285
  email: string;
1218
1286
  microsoftTenantId: string;
1219
1287
  workspaceDomain: string;
@@ -1487,59 +1555,35 @@ declare class IdentityApi extends ApiBase {
1487
1555
  }>;
1488
1556
  mergeIdentities(survivorId: string, args: {
1489
1557
  mergedId: string;
1490
- changedBy: {
1491
- type: string;
1492
- id: string;
1493
- name?: string;
1494
- };
1495
1558
  }): Promise<{
1496
1559
  ok: boolean;
1497
1560
  error?: string;
1498
1561
  }>;
1499
- unmergeIdentity(identityId: string, args: {
1500
- changedBy: {
1501
- type: string;
1502
- id: string;
1503
- name?: string;
1504
- };
1505
- }): Promise<{
1562
+ unmergeIdentity(identityId: string): Promise<{
1506
1563
  ok: boolean;
1507
1564
  error?: string;
1508
1565
  }>;
1509
1566
  addIdentityNote(identityId: string, args: {
1510
1567
  content: string;
1511
1568
  category?: string;
1512
- changedBy: {
1513
- type: string;
1514
- id: string;
1515
- name?: string;
1516
- };
1517
1569
  }): Promise<{
1518
1570
  noteId: string | null;
1519
1571
  }>;
1520
1572
  tagIdentity(identityId: string, args: {
1521
1573
  tag: string;
1522
1574
  action: "add" | "remove";
1523
- changedBy: {
1524
- type: string;
1525
- id: string;
1526
- name?: string;
1527
- };
1528
1575
  }): Promise<{
1529
1576
  ok: boolean;
1530
1577
  }>;
1531
1578
  getIdentityChangelog(identityId: string, args?: {
1532
1579
  limit?: number;
1580
+ cursor?: string;
1533
1581
  }): Promise<{
1534
1582
  entries: unknown[];
1583
+ cursor: string | null;
1535
1584
  }>;
1536
1585
  rollbackIdentity(identityId: string, args: {
1537
1586
  targetVersion: number;
1538
- changedBy: {
1539
- type: string;
1540
- id: string;
1541
- name?: string;
1542
- };
1543
1587
  }): Promise<{
1544
1588
  ok: boolean;
1545
1589
  entry?: unknown;
@@ -1578,7 +1622,7 @@ declare class IdentityApi extends ApiBase {
1578
1622
  verified: boolean;
1579
1623
  identityId?: string;
1580
1624
  /** Phase 2: how the confirm resolved — Scenario A vs B. */
1581
- action?: "merged" | "contact_verified";
1625
+ action?: "merged" | "contact_verified" | "already_confirmed";
1582
1626
  error?: string;
1583
1627
  }>;
1584
1628
  /**
@@ -1710,8 +1754,21 @@ declare class MemoryApi extends ApiBase {
1710
1754
  messageCount: number;
1711
1755
  }>;
1712
1756
  memoryLoadContext(tier?: number, topicHint?: string): Promise<{
1757
+ tier: number;
1758
+ facts: {
1759
+ subject: string;
1760
+ predicate: string;
1761
+ object: string;
1762
+ since: string;
1763
+ }[];
1764
+ memories: {
1765
+ text: string;
1766
+ topic: string;
1767
+ subtopic: string;
1768
+ score: number;
1769
+ }[];
1770
+ tokenEstimate: number;
1713
1771
  formatted: string;
1714
- [key: string]: unknown;
1715
1772
  }>;
1716
1773
  memoryLookupEntity(subject: string): Promise<{
1717
1774
  subject: string;
@@ -1943,7 +2000,7 @@ declare class TeamsApi extends ApiBase {
1943
2000
 
1944
2001
  //#endregion
1945
2002
  //#region src/index.d.ts
1946
- interface AgentApiClient extends SyncApi, IntegrationsApi, WorkspaceApi, ConnectCredentialsApi, TeamsApi, ChatApi, SecretsApi, IdentityApi, MemoryApi, SearchApi, KnowledgeApi, DatabaseApi, MobileApi, RemoteApi, SelfApi, VoiceApi, ImagesApi {}
2003
+ interface AgentApiClient extends SyncApi, IntegrationsApi, WorkspaceApi, ConnectCredentialsApi, TeamsApi, ChatApi, SecretsApi, IdentityApi, MemoryApi, SearchApi, KnowledgeApi, DatabaseApi, MobileApi, RemoteApi, SelfApi, VoiceApi, ImagesApi, WebhooksApi {}
1947
2004
  declare class AgentApiClient extends ApiBase {
1948
2005
  constructor(config: AgentApiClientConfig);
1949
2006
  }
@@ -2187,6 +2244,25 @@ interface RetryOptions {
2187
2244
  declare function withRetry<T>(fn: () => Promise<T>, options?: RetryOptions): Promise<T>;
2188
2245
  //# sourceMappingURL=retry.d.ts.map
2189
2246
  //#endregion
2247
+ //#region src/path-contract.d.ts
2248
+ /**
2249
+ * Canonical path contract for the private workspace sync data plane.
2250
+ *
2251
+ * Paths received from manifests, relays, CLI arguments, and watcher events
2252
+ * are identifiers relative to the configured workspace. Keep validation in
2253
+ * one place so a malformed remote path can never become an arbitrary local
2254
+ * read, write, or delete.
2255
+ */
2256
+ declare function validatePrivateRelativePath(relativePath: string): string;
2257
+ declare function resolvePrivateWorkspacePath(workspacePath: string, relativePath: string): string;
2258
+ /**
2259
+ * Reject an existing symlink in any path component. Lexical containment alone
2260
+ * is insufficient: `workspace/link/file` can escape when `link` points out of
2261
+ * the workspace. This check covers reads, writes, and parent-directory walks.
2262
+ */
2263
+ declare function assertNoSymlinkTraversal(workspacePath: string, relativePath: string): Promise<string>;
2264
+ //# sourceMappingURL=path-contract.d.ts.map
2265
+ //#endregion
2190
2266
  //#region src/shared-sync.d.ts
2191
2267
  interface SharedScope {
2192
2268
  scopeType: "team" | "project" | "org";
@@ -2212,5 +2288,5 @@ interface SharedSyncEngine {
2212
2288
  }
2213
2289
  declare function createSharedSyncEngine(config: SharedSyncConfig, log: PluginLogger): SharedSyncEngine;
2214
2290
  //#endregion
2215
- export { DEFAULT_IGNORES, type DownloadResult, type IgnoreRules, type LocalManifest, type ManifestDiff, type ManifestEntry, type RemoteManifest, type RetryOptions, type SharedScope, type SharedSyncConfig, type SharedSyncEngine, type SyncEngine, type SyncPluginConfig, type SyncResult, type UploadResult, type WatcherOptions, computeFileHash, createSharedSyncEngine, createSyncEngine, diffManifests, downloadFiles, filterIgnored, loadIgnorePatterns, plugin, readManifest, removeManifestEntry, shouldIgnore, shouldIgnoreDir, startWatcher, updateManifestEntry, uploadFiles, withRetry, writeManifest };
2291
+ export { DEFAULT_IGNORES, type DownloadResult, type IgnoreRules, type LocalManifest, type ManifestDiff, type ManifestEntry, type RemoteManifest, type RetryOptions, type SharedScope, type SharedSyncConfig, type SharedSyncEngine, type SyncEngine, type SyncPluginConfig, type SyncResult, type UploadResult, type WatcherOptions, assertNoSymlinkTraversal, computeFileHash, createSharedSyncEngine, createSyncEngine, diffManifests, downloadFiles, filterIgnored, loadIgnorePatterns, plugin, readManifest, removeManifestEntry, resolvePrivateWorkspacePath, shouldIgnore, shouldIgnoreDir, startWatcher, updateManifestEntry, uploadFiles, validatePrivateRelativePath, withRetry, writeManifest };
2216
2292
  //# sourceMappingURL=index.d.cts.map