@skaile/workspaces 0.52.0 → 1.0.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.
Files changed (140) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/dist/{asset-feeds-OEGJ6NOF.js → asset-feeds-677S5NX7.js} +7 -7
  3. package/dist/{asset-feeds-OEGJ6NOF.js.map → asset-feeds-677S5NX7.js.map} +1 -1
  4. package/dist/asset-manager/index.js +5 -5
  5. package/dist/asset-manager/installer.js +4 -4
  6. package/dist/{chunk-6K4RVXAM.js → chunk-43JDPQJ4.js} +3 -3
  7. package/dist/{chunk-6K4RVXAM.js.map → chunk-43JDPQJ4.js.map} +1 -1
  8. package/dist/{chunk-EOINYN5T.js → chunk-DW5MIJK3.js} +3 -3
  9. package/dist/{chunk-EOINYN5T.js.map → chunk-DW5MIJK3.js.map} +1 -1
  10. package/dist/{chunk-VE2UIJ7Y.js → chunk-EXNTTJGP.js} +3 -43
  11. package/dist/chunk-EXNTTJGP.js.map +1 -0
  12. package/dist/{chunk-7ZWLZ5H3.js → chunk-FLRHP3UC.js} +3 -3
  13. package/dist/{chunk-7ZWLZ5H3.js.map → chunk-FLRHP3UC.js.map} +1 -1
  14. package/dist/{chunk-MGB657EG.js → chunk-K5JIAHDV.js} +16 -7
  15. package/dist/chunk-K5JIAHDV.js.map +1 -0
  16. package/dist/{chunk-3IHBGDCG.js → chunk-KSISPZV3.js} +2 -2
  17. package/dist/{chunk-3IHBGDCG.js.map → chunk-KSISPZV3.js.map} +1 -1
  18. package/dist/{chunk-WD2NRI3T.js → chunk-PLQVAEM2.js} +2 -2
  19. package/dist/{chunk-WD2NRI3T.js.map → chunk-PLQVAEM2.js.map} +1 -1
  20. package/dist/{chunk-TCNYSHPM.js → chunk-SFVEHSCI.js} +4 -4
  21. package/dist/{chunk-TCNYSHPM.js.map → chunk-SFVEHSCI.js.map} +1 -1
  22. package/dist/{chunk-QLLFCQU5.js → chunk-WSQ5J7CE.js} +403 -1469
  23. package/dist/chunk-WSQ5J7CE.js.map +1 -0
  24. package/dist/{chunk-BXC5547R.js → chunk-XD7GYMAU.js} +3 -3
  25. package/dist/{chunk-BXC5547R.js.map → chunk-XD7GYMAU.js.map} +1 -1
  26. package/dist/cli/index.js +30 -32
  27. package/dist/cli/index.js.map +1 -1
  28. package/dist/connectors/config.js +4 -4
  29. package/dist/connectors/index.js +5 -7
  30. package/dist/connectors/src/config.d.ts +1 -74
  31. package/dist/connectors/src/config.d.ts.map +1 -1
  32. package/dist/connectors/src/connector-manager.d.ts +13 -137
  33. package/dist/connectors/src/connector-manager.d.ts.map +1 -1
  34. package/dist/connectors/src/connector-types.d.ts +3 -25
  35. package/dist/connectors/src/connector-types.d.ts.map +1 -1
  36. package/dist/connectors/src/fleet-utils.d.ts +2 -30
  37. package/dist/connectors/src/fleet-utils.d.ts.map +1 -1
  38. package/dist/connectors/src/fs-utils.d.ts +1 -2
  39. package/dist/connectors/src/fs-utils.d.ts.map +1 -1
  40. package/dist/connectors/src/index.d.ts +2 -12
  41. package/dist/connectors/src/index.d.ts.map +1 -1
  42. package/dist/connectors/src/watcher.d.ts +1 -5
  43. package/dist/connectors/src/watcher.d.ts.map +1 -1
  44. package/dist/core/index.js +3 -3
  45. package/dist/deploy/index.js +3 -3
  46. package/dist/{ensure-sources-GJOXWVWO.js → ensure-sources-OCMHK7LT.js} +5 -5
  47. package/dist/{ensure-sources-GJOXWVWO.js.map → ensure-sources-OCMHK7LT.js.map} +1 -1
  48. package/dist/factory-assets/connectors/deploy.js +5 -7
  49. package/dist/factory-assets/connectors/devserver.js +5 -7
  50. package/dist/factory-assets/connectors/flow/adapter.js +5 -7
  51. package/dist/factory-assets/connectors/flow/engine.js +3 -3
  52. package/dist/factory-assets/connectors/flow/run-flow.js +6 -8
  53. package/dist/factory-assets/connectors/flow.js +5 -7
  54. package/dist/factory-assets/connectors/git.js +5 -7
  55. package/dist/factory-assets/connectors/gmail.js +5 -7
  56. package/dist/factory-assets/connectors/googledrive/CONNECTOR.md +14 -128
  57. package/dist/factory-assets/connectors/googledrive/driver.d.ts +6 -13
  58. package/dist/factory-assets/connectors/googledrive/driver.d.ts.map +1 -1
  59. package/dist/factory-assets/connectors/googledrive.js +5 -7
  60. package/dist/factory-assets/connectors/local.js +5 -7
  61. package/dist/factory-assets/connectors/mattermost.js +5 -7
  62. package/dist/factory-assets/connectors/memory.js +5 -7
  63. package/dist/factory-assets/connectors/minio.js +5 -7
  64. package/dist/factory-assets/connectors/postgres.js +5 -7
  65. package/dist/factory-assets/connectors/s3.js +5 -7
  66. package/dist/factory-assets/connectors/sharepoint/CONNECTOR.md +13 -159
  67. package/dist/factory-assets/connectors/sharepoint/driver.d.ts +6 -12
  68. package/dist/factory-assets/connectors/sharepoint/driver.d.ts.map +1 -1
  69. package/dist/factory-assets/connectors/sharepoint.js +5 -7
  70. package/dist/factory-assets/connectors/sqlite.js +5 -7
  71. package/dist/factory-assets/connectors/static-server.js +5 -7
  72. package/dist/factory-assets/connectors/tunnel.js +5 -7
  73. package/dist/factory-assets/connectors/webdav/CONNECTOR.md +13 -118
  74. package/dist/factory-assets/connectors/webdav/driver.d.ts +6 -15
  75. package/dist/factory-assets/connectors/webdav/driver.d.ts.map +1 -1
  76. package/dist/factory-assets/connectors/webdav.js +5 -7
  77. package/dist/factory-assets/connectors/xstate-store.js +5 -7
  78. package/dist/factory-assets/connectors/xstate.js +5 -7
  79. package/dist/{flows-AGPIE6JM.js → flows-36PZESON.js} +4 -4
  80. package/dist/{flows-AGPIE6JM.js.map → flows-36PZESON.js.map} +1 -1
  81. package/dist/library/index.js +4 -4
  82. package/dist/library/install.js +3 -3
  83. package/dist/{open-library-ERKRGH4B.js → open-library-WRFYABFP.js} +7 -7
  84. package/dist/{open-library-ERKRGH4B.js.map → open-library-WRFYABFP.js.map} +1 -1
  85. package/dist/{paths-D6RUQ522.js → paths-EUNVMONC.js} +5 -5
  86. package/dist/{paths-D6RUQ522.js.map → paths-EUNVMONC.js.map} +1 -1
  87. package/dist/{plugin-store-SGNJTBYS.js → plugin-store-35KIMX6W.js} +5 -5
  88. package/dist/{plugin-store-SGNJTBYS.js.map → plugin-store-35KIMX6W.js.map} +1 -1
  89. package/dist/runner/index.js +7 -9
  90. package/dist/runner/src/serve.d.ts +6 -4
  91. package/dist/runner/src/serve.d.ts.map +1 -1
  92. package/dist/sdk/asset-manager.js +5 -5
  93. package/dist/sdk/core.js +3 -3
  94. package/dist/sdk/flow.js +3 -3
  95. package/dist/sdk/index.js +7 -9
  96. package/dist/sdk/index.js.map +1 -1
  97. package/dist/sdk/runner.js +7 -9
  98. package/dist/{setup-IV2JFW3T.js → setup-HM6HATAC.js} +5 -5
  99. package/dist/{setup-IV2JFW3T.js.map → setup-HM6HATAC.js.map} +1 -1
  100. package/dist/{source-FGOMQMZT.js → source-EZ5Y3CKP.js} +8 -8
  101. package/dist/{source-FGOMQMZT.js.map → source-EZ5Y3CKP.js.map} +1 -1
  102. package/dist/{store-client-GJT2XQ5Z.js → store-client-BUUF7BPK.js} +5 -5
  103. package/dist/{store-client-GJT2XQ5Z.js.map → store-client-BUUF7BPK.js.map} +1 -1
  104. package/dist/tui/index.js +7 -9
  105. package/dist/tui/index.js.map +1 -1
  106. package/dist/workspace-plugin/adapters/mcp.js +3 -3
  107. package/dist/workspace-plugin/adapters/omp.js +3 -3
  108. package/dist/workspace-plugin/index.js +1 -1
  109. package/package.json +1 -13
  110. package/dist/chunk-MGB657EG.js.map +0 -1
  111. package/dist/chunk-OVRSNIKJ.js +0 -72
  112. package/dist/chunk-OVRSNIKJ.js.map +0 -1
  113. package/dist/chunk-QLLFCQU5.js.map +0 -1
  114. package/dist/chunk-RAIRWFAN.js +0 -843
  115. package/dist/chunk-RAIRWFAN.js.map +0 -1
  116. package/dist/chunk-VE2UIJ7Y.js.map +0 -1
  117. package/dist/connectors/rclone-config.d.ts +0 -2
  118. package/dist/connectors/rclone-config.js +0 -4
  119. package/dist/connectors/rclone-config.js.map +0 -1
  120. package/dist/connectors/rclone.d.ts +0 -2
  121. package/dist/connectors/rclone.js +0 -5
  122. package/dist/connectors/rclone.js.map +0 -1
  123. package/dist/connectors/src/fleet-health-gate.d.ts +0 -105
  124. package/dist/connectors/src/fleet-health-gate.d.ts.map +0 -1
  125. package/dist/connectors/src/mount-placeholder.d.ts +0 -131
  126. package/dist/connectors/src/mount-placeholder.d.ts.map +0 -1
  127. package/dist/connectors/src/rclone-config/googledrive.d.ts +0 -59
  128. package/dist/connectors/src/rclone-config/googledrive.d.ts.map +0 -1
  129. package/dist/connectors/src/rclone-config/index.d.ts +0 -9
  130. package/dist/connectors/src/rclone-config/index.d.ts.map +0 -1
  131. package/dist/connectors/src/rclone-config/onedrive.d.ts +0 -48
  132. package/dist/connectors/src/rclone-config/onedrive.d.ts.map +0 -1
  133. package/dist/connectors/src/rclone-config/sanitize.d.ts +0 -9
  134. package/dist/connectors/src/rclone-config/sanitize.d.ts.map +0 -1
  135. package/dist/connectors/src/rclone-config/webdav.d.ts +0 -50
  136. package/dist/connectors/src/rclone-config/webdav.d.ts.map +0 -1
  137. package/dist/connectors/src/rclone-process-manager.d.ts +0 -316
  138. package/dist/connectors/src/rclone-process-manager.d.ts.map +0 -1
  139. package/dist/connectors/src/rclone-token-refresh.d.ts +0 -84
  140. package/dist/connectors/src/rclone-token-refresh.d.ts.map +0 -1
@@ -1,59 +0,0 @@
1
- /**
2
- * Render an rclone INI config snippet for a single Google Drive remote.
3
- *
4
- * Pure helper — no IO, no logging — so it can be unit-tested by string compare.
5
- * The output is the full text for one `[<remoteName>]` section using rclone's
6
- * `drive` backend. The OAuth `token` field is a single-line JSON literal as
7
- * rclone expects, in the same shape used by the OneDrive renderer.
8
- *
9
- * Lives in `@skaile/workspaces/connectors/rclone-config` so both consumers can
10
- * reach it: the in-container `googledrive` mount driver
11
- * (`factory-assets/connectors/googledrive/driver.ts`) and the platform-side
12
- * `RcloneFleetService` (`platform/backend/libs/session/`) which renders the
13
- * same INI on the host before spawning a shared rclone process.
14
- */
15
- /**
16
- * Google Drive OAuth scope values accepted by rclone's `drive` backend.
17
- * `drive` = full read/write, `drive.readonly` = read-only, `drive.file` =
18
- * only files created/opened by the app, `drive.appfolder` = the app's hidden
19
- * data folder, `drive.metadata.readonly` = metadata only.
20
- * @docLink packages/connectors/api-reference#google-drive-scope
21
- */
22
- export type GoogleDriveScope = "drive" | "drive.readonly" | "drive.file" | "drive.appfolder" | "drive.metadata.readonly";
23
- /**
24
- * Options for `renderGoogleDriveConfig`. Carries OAuth token, optional client
25
- * credentials, optional scope and root/shared-drive restrictions.
26
- * @docLink packages/connectors/api-reference#render-google-drive-config-options
27
- */
28
- export interface RenderGoogleDriveConfigOptions {
29
- /** The rclone remote section name (e.g. `skaile-gdrive`). */
30
- remoteName: string;
31
- /** Current OAuth access token. */
32
- accessToken: string;
33
- /** Long-lived refresh token (embedded in the rclone `token` JSON field). */
34
- refreshToken?: string | null;
35
- /** Expiry of the access token as a Unix timestamp in milliseconds. */
36
- expiresAtMs?: number | null;
37
- /** OAuth client (application) ID. */
38
- clientId?: string | null;
39
- /** OAuth client secret. */
40
- clientSecret?: string | null;
41
- /** OAuth scope. Defaults to `"drive"` (full access). */
42
- scope?: GoogleDriveScope;
43
- /** Optional Drive folder ID to mount as the remote root. */
44
- rootFolderId?: string | null;
45
- /** Optional Shared Drive (Team Drive) ID. */
46
- teamDrive?: string | null;
47
- /** Optional path to a service account JSON file (used instead of OAuth). */
48
- serviceAccountFile?: string | null;
49
- }
50
- /**
51
- * Render an rclone INI config section for a Google Drive remote. Pure — no IO, no side effects.
52
- * The `token` field is serialised as a single-line JSON literal as rclone expects.
53
- * All interpolated values are stripped of CR/LF to prevent INI injection.
54
- * @param opts - Remote name, OAuth token, optional client credentials and scope/root restrictions.
55
- * @returns Full INI text for one `[<remoteName>]` rclone section.
56
- * @docLink packages/connectors/api-reference#render-google-drive-config
57
- */
58
- export declare function renderGoogleDriveConfig(opts: RenderGoogleDriveConfigOptions): string;
59
- //# sourceMappingURL=googledrive.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"googledrive.d.ts","sourceRoot":"","sources":["../../../../connectors/src/rclone-config/googledrive.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH;;;;;;GAMG;AACH,MAAM,MAAM,gBAAgB,GACxB,OAAO,GACP,gBAAgB,GAChB,YAAY,GACZ,iBAAiB,GACjB,yBAAyB,CAAC;AAE9B;;;;GAIG;AACH,MAAM,WAAW,8BAA8B;IAC7C,6DAA6D;IAC7D,UAAU,EAAE,MAAM,CAAC;IACnB,kCAAkC;IAClC,WAAW,EAAE,MAAM,CAAC;IACpB,4EAA4E;IAC5E,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,sEAAsE;IACtE,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,qCAAqC;IACrC,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,2BAA2B;IAC3B,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,wDAAwD;IACxD,KAAK,CAAC,EAAE,gBAAgB,CAAC;IACzB,4DAA4D;IAC5D,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,6CAA6C;IAC7C,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,4EAA4E;IAC5E,kBAAkB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACpC;AAID;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,8BAA8B,GAAG,MAAM,CA0BpF"}
@@ -1,9 +0,0 @@
1
- /**
2
- * rclone INI rendering helpers — pure string-template functions for one
3
- * `[remote]` section per backend. Consumed by both the in-container mount
4
- * drivers and the platform-side fleet service.
5
- */
6
- export { type GoogleDriveScope, type RenderGoogleDriveConfigOptions, renderGoogleDriveConfig, } from "./googledrive.js";
7
- export { type RenderOneDriveConfigOptions, renderOneDriveConfig } from "./onedrive.js";
8
- export { type RenderWebDAVConfigOptions, renderWebDAVConfig, type WebDAVVendor, } from "./webdav.js";
9
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../connectors/src/rclone-config/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,8BAA8B,EACnC,uBAAuB,GACxB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,KAAK,2BAA2B,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AACvF,OAAO,EACL,KAAK,yBAAyB,EAC9B,kBAAkB,EAClB,KAAK,YAAY,GAClB,MAAM,aAAa,CAAC"}
@@ -1,48 +0,0 @@
1
- /**
2
- * Render an rclone INI config snippet for a single OneDrive/SharePoint remote.
3
- *
4
- * Pure helper — no IO, no logging — so it can be unit-tested by string compare.
5
- * The output is the full text for one `[<remoteName>]` section using rclone's
6
- * `onedrive` backend. The OAuth `token` field is a single-line JSON literal as
7
- * rclone expects.
8
- *
9
- * Lives in `@skaile/workspaces/connectors/rclone-config` so both consumers can
10
- * reach it: the in-container `sharepoint` mount driver
11
- * (`ai-assets-skaile/mounts/sharepoint/driver.ts`) and the platform-side
12
- * `RcloneFleetService` (`platform/backend/libs/session/`) which renders the
13
- * same INI on the host before spawning a shared rclone process.
14
- */
15
- /**
16
- * Options for `renderOneDriveConfig`. Carries OAuth token, drive ID, and optional tenant/client credentials.
17
- * @docLink packages/connectors/api-reference#render-one-drive-config-options
18
- */
19
- export interface RenderOneDriveConfigOptions {
20
- /** The rclone remote section name (e.g. `skaile-sharepoint`). */
21
- remoteName: string;
22
- /** Current OAuth access token. */
23
- accessToken: string;
24
- /** Long-lived refresh token (embedded in the rclone `token` JSON field). */
25
- refreshToken?: string | null;
26
- /** Expiry of the access token as a Unix timestamp in milliseconds. */
27
- expiresAtMs?: number | null;
28
- /** Azure tenant ID for MSAL authentication. */
29
- tenantId?: string | null;
30
- /** OAuth client (application) ID. */
31
- clientId?: string | null;
32
- /** OAuth client secret. */
33
- clientSecret?: string | null;
34
- /** OneDrive drive ID (required by the rclone `onedrive` backend). */
35
- driveId: string;
36
- /** Drive type. Defaults to `"business"`. */
37
- driveType?: "business" | "personal" | "documentLibrary";
38
- }
39
- /**
40
- * Render an rclone INI config section for a OneDrive / SharePoint remote. Pure — no IO, no side effects.
41
- * The `token` field is serialised as a single-line JSON literal as rclone expects.
42
- * All interpolated values are stripped of CR/LF to prevent INI injection.
43
- * @param opts - Remote name, OAuth token, drive ID, and optional tenant/client credentials.
44
- * @returns Full INI text for one `[<remoteName>]` rclone section.
45
- * @docLink packages/connectors/api-reference#render-one-drive-config
46
- */
47
- export declare function renderOneDriveConfig(opts: RenderOneDriveConfigOptions): string;
48
- //# sourceMappingURL=onedrive.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"onedrive.d.ts","sourceRoot":"","sources":["../../../../connectors/src/rclone-config/onedrive.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH;;;GAGG;AACH,MAAM,WAAW,2BAA2B;IAC1C,iEAAiE;IACjE,UAAU,EAAE,MAAM,CAAC;IACnB,kCAAkC;IAClC,WAAW,EAAE,MAAM,CAAC;IACpB,4EAA4E;IAC5E,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,sEAAsE;IACtE,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,+CAA+C;IAC/C,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,qCAAqC;IACrC,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,2BAA2B;IAC3B,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,qEAAqE;IACrE,OAAO,EAAE,MAAM,CAAC;IAChB,4CAA4C;IAC5C,SAAS,CAAC,EAAE,UAAU,GAAG,UAAU,GAAG,iBAAiB,CAAC;CACzD;AAID;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,2BAA2B,GAAG,MAAM,CAqB9E"}
@@ -1,9 +0,0 @@
1
- /**
2
- * Strip CR/LF from a value before interpolating it into an rclone INI line.
3
- * Without this, a value containing `\n` would smuggle an extra `key = ...`
4
- * pair — or even a new `[section]` — into the rendered config.
5
- *
6
- * Used by every renderer in `@skaile/workspaces/connectors/rclone-config`.
7
- */
8
- export declare function sanitizeIniValue(value: string): string;
9
- //# sourceMappingURL=sanitize.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sanitize.d.ts","sourceRoot":"","sources":["../../../../connectors/src/rclone-config/sanitize.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAEtD"}
@@ -1,50 +0,0 @@
1
- /**
2
- * Render an rclone INI config snippet for a single WebDAV remote.
3
- *
4
- * Pure helper -- no IO, no logging -- so it can be unit-tested by string compare.
5
- * The output is the full text for one `[<remoteName>]` section using rclone's
6
- * `webdav` backend.
7
- *
8
- * NOTE: rclone's `pass` field is not plaintext; it must already be passed
9
- * through `rclone obscure` by the caller. See the driver's `obscurePassword`
10
- * helper for the spawn that produces it.
11
- *
12
- * Lives in `@skaile/workspaces/connectors/rclone-config` so both consumers can
13
- * reach it: the in-container `webdav` mount driver
14
- * (`ai-assets-skaile/mounts/webdav/driver.ts`) and the platform-side
15
- * `RcloneFleetService` (`platform/backend/libs/session/`) which renders the
16
- * same INI on the host before spawning a shared rclone process.
17
- */
18
- /**
19
- * Supported WebDAV vendor identifiers for the rclone `webdav` backend.
20
- * @docLink packages/connectors/api-reference#web-dav-vendor
21
- */
22
- export type WebDAVVendor = "nextcloud" | "owncloud" | "sharepoint" | "fastmail" | "other";
23
- /**
24
- * Options for `renderWebDAVConfig`. Carries remote name, URL, vendor, and credentials.
25
- * @docLink packages/connectors/api-reference#render-web-dav-config-options
26
- */
27
- export interface RenderWebDAVConfigOptions {
28
- /** The rclone remote section name (e.g. `skaile-docs`). */
29
- remoteName: string;
30
- /** Base URL of the WebDAV server. */
31
- url: string;
32
- /** WebDAV vendor; drives rclone's `vendor =` field. */
33
- vendor: WebDAVVendor;
34
- /** Basic-auth username. */
35
- username?: string | null;
36
- /** Already passed through `rclone obscure`. */
37
- obscuredPassword?: string | null;
38
- /** OAuth bearer token (used instead of basic-auth for SharePoint). */
39
- bearerToken?: string | null;
40
- }
41
- /**
42
- * Render an rclone INI config section for a WebDAV remote. Pure — no IO, no side effects.
43
- * The `obscuredPassword` field must already have been processed through `rclone obscure`.
44
- * All interpolated values are stripped of CR/LF to prevent INI injection.
45
- * @param opts - Remote name, URL, vendor, and credentials.
46
- * @returns Full INI text for one `[<remoteName>]` rclone section.
47
- * @docLink packages/connectors/api-reference#render-web-dav-config
48
- */
49
- export declare function renderWebDAVConfig(opts: RenderWebDAVConfigOptions): string;
50
- //# sourceMappingURL=webdav.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"webdav.d.ts","sourceRoot":"","sources":["../../../../connectors/src/rclone-config/webdav.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH;;;GAGG;AACH,MAAM,MAAM,YAAY,GAAG,WAAW,GAAG,UAAU,GAAG,YAAY,GAAG,UAAU,GAAG,OAAO,CAAC;AAE1F;;;GAGG;AACH,MAAM,WAAW,yBAAyB;IACxC,2DAA2D;IAC3D,UAAU,EAAE,MAAM,CAAC;IACnB,qCAAqC;IACrC,GAAG,EAAE,MAAM,CAAC;IACZ,uDAAuD;IACvD,MAAM,EAAE,YAAY,CAAC;IACrB,2BAA2B;IAC3B,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,+CAA+C;IAC/C,gBAAgB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,sEAAsE;IACtE,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B;AAID;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,yBAAyB,GAAG,MAAM,CAW1E"}
@@ -1,316 +0,0 @@
1
- /**
2
- * RcloneProcessManager — supervises an rclone FUSE subprocess per mount.
3
- *
4
- * Responsibilities:
5
- * - Spawn rclone with a per-mount config + cache dir, wait for the FUSE
6
- * mountpoint to appear, then return a handle.
7
- * - Pipe rclone's JSON-formatted log lines into the parent driver's
8
- * {@link Logger} via a child source `${driverName}+rclone`.
9
- * - Coordinate graceful stop (flush → SIGTERM → fusermount fallback).
10
- * - Expose `flush` (POST /vfs/refresh + poll /vfs/stats), `statSize`
11
- * (operations/stat → authoritative remote size, backing the read-path
12
- * stale-tail gate) and `status` (process liveness + cache-dir size).
13
- *
14
- * Cross-link: see `workspaces/core/CLAUDE.md` § Logging for the
15
- * `createLogger` / `LogStore` contract, and
16
- * `_devlog/specs/2026-05-01-debug-logging-design.md` for the source taxonomy.
17
- */
18
- import type { Logger } from "@skaile/workspaces/types";
19
- /** Default rclone `--vfs-write-back` delay; raised from 5s so a rapidly-rewritten file settles before upload (avoids mid-write "sizes differ" aborts). */
20
- export declare const DEFAULT_VFS_WRITE_BACK = "30s";
21
- /** Consecutive failed upload retries for one object before a stuck-upload error is surfaced. */
22
- export declare const DEFAULT_UPLOAD_STUCK_THRESHOLD = 3;
23
- /**
24
- * Spawn-time configuration for a single rclone FUSE mount.
25
- * @docLink packages/connectors/api-reference#rclone-spawn-config
26
- */
27
- export interface RcloneSpawnConfig {
28
- /** Logical mount id; used as `instance` and as part of the rclone config filename. */
29
- mountId: string;
30
- /**
31
- * Driver name (e.g. "sharepoint", "webdav"); used to derive the rclone
32
- * subprocess child logger subkind: `${driverName}+rclone`.
33
- */
34
- driverName: string;
35
- /** Absolute path inside the container where rclone will FUSE-mount. Created if missing. */
36
- mountPoint: string;
37
- /** Absolute path inside the container for the vfs cache. Created if missing. */
38
- cacheDir: string;
39
- /** Full INI text for rclone.conf (one [remote] section, named `skaile-<mountId>`). */
40
- rcloneConfig: string;
41
- /** Remote spec, e.g. `skaile-foo:/Clients/KADK`. */
42
- remote: string;
43
- /** rclone --vfs-cache-mode value. */
44
- vfsCacheMode: "minimal" | "writes" | "full";
45
- /** Per-mount cache size cap. Default: '5G'. */
46
- cacheMaxSize?: string;
47
- /** Per-mount cache age cap. Default: '168h'. */
48
- cacheMaxAge?: string;
49
- /**
50
- * Skip rclone's post-transfer size + checksum verification by appending
51
- * `--ignore-size --ignore-checksum`. Default: false (verification on).
52
- *
53
- * Escape hatch for remotes that mutate uploaded bytes server-side (notably
54
- * SharePoint Online normalising LF→CRLF on text/html), which makes the
55
- * remote object a different size/hash than the local source. rclone reads
56
- * that as `corrupted on transfer`, deletes the upload, and retries forever,
57
- * so the file never durably lands. Enabling this trades integrity
58
- * verification for sync-ability and must only be set by drivers that have
59
- * confirmed the mutation is benign. Off-by-default; wired per-driver, never
60
- * globally.
61
- */
62
- ignoreSizeCheck?: boolean;
63
- /**
64
- * rclone `--vfs-write-back` delay (e.g. '30s', '1m'). Controls how long a
65
- * dirty file sits before rclone starts uploading it. Default:
66
- * {@link DEFAULT_VFS_WRITE_BACK}. Raise it when the agent rewrites files
67
- * faster than they upload, to avoid mid-write "sizes differ" aborts.
68
- */
69
- vfsWriteBack?: string;
70
- /**
71
- * Consecutive upload retries for one object before {@link onUploadStuck}
72
- * fires. Default: {@link DEFAULT_UPLOAD_STUCK_THRESHOLD}.
73
- */
74
- uploadStuckThreshold?: number;
75
- /**
76
- * Optional hook invoked once per object when its upload has failed
77
- * `uploadStuckThreshold` times in a row. spawn() always also logs an
78
- * error-level entry through the `${driverName}+rclone` child logger; this
79
- * hook lets callers surface the stranded file elsewhere (e.g. a sync event).
80
- */
81
- onUploadStuck?: (object: string, tries: number) => void;
82
- /**
83
- * Optional hook invoked when rclone reports an OAuth auth failure (notably
84
- * `invalid_client` / `couldn't fetch token`, the symptom of an expired
85
- * access token that rclone cannot self-refresh). Wired by the mount driver
86
- * to the reactive arm of its token-refresh controller. Fires per matching
87
- * log line; the controller dedupes via its in-flight guard + cooldown.
88
- */
89
- onAuthError?: () => void;
90
- /**
91
- * Parent driver Logger — already tagged
92
- * `{kind:"mount", subkind:<driver>, instance:<mountId>}` by ConnectorManager.
93
- * Used for manager-level events; rclone subprocess events go through the
94
- * derived `child({subkind: \`${driverName}+rclone\`})` logger.
95
- */
96
- log: Logger;
97
- }
98
- /**
99
- * Handle returned by `RcloneProcessManager.spawn()` once the FUSE mountpoint is confirmed.
100
- * @docLink packages/connectors/api-reference#rclone-handle
101
- */
102
- export interface RcloneHandle {
103
- /** OS process id of the rclone subprocess. */
104
- pid: number;
105
- /** Confirmed FUSE mountpoint (echo of input). */
106
- mountPoint: string;
107
- /** Cache directory (echo of input). */
108
- cacheDir: string;
109
- /** The local rc API address rclone is bound to, e.g. '127.0.0.1:54321'. */
110
- rcAddr: string;
111
- }
112
- /**
113
- * Manages rclone FUSE subprocesses for mount drivers. Stateless across instances —
114
- * the internal handle registry is module-scoped so a fresh `RcloneProcessManager`
115
- * can still find handles created by a previous instance.
116
- * @docLink packages/connectors/api-reference#rclone-process-manager
117
- */
118
- export declare class RcloneProcessManager {
119
- private readonly now;
120
- /**
121
- * @param now Injectable clock (ms) used only to timestamp the quarantine dir
122
- * on a poisoned-cache reset, so the move-aside name is deterministic in tests.
123
- */
124
- constructor(now?: () => number);
125
- /**
126
- * Spawn an rclone FUSE mount with one-shot poisoned-cache recovery. Delegates
127
- * to {@link spawnOnce}; if that fails specifically because the persistent VFS
128
- * cache was poisoned (a prior container SIGKILLed mid-write left `vfs`/`vfsMeta`
129
- * referencing missing backing files), quarantine the cache and retry the mount
130
- * exactly once on a clean rebuild from the authoritative remote.
131
- *
132
- * The retry is single-shot and bounded: if the fresh-cache mount also fails the
133
- * cause is connectivity/token (not the cache), so the error propagates without
134
- * a second reset — never a reset/respawn loop. A non-poison failure, or a
135
- * poison failure with nothing to quarantine, propagates immediately.
136
- */
137
- spawn(config: RcloneSpawnConfig): Promise<RcloneHandle>;
138
- /**
139
- * Spawn an rclone FUSE mount. Resolves once the mountpoint is confirmed
140
- * present in `/proc/self/mounts`. Throws on timeout, on early exit, or
141
- * if invariants are violated. A readiness-timeout accompanied by the
142
- * poisoned-cache log signature throws {@link CachePoisonedMountError} so the
143
- * public {@link spawn} can apply its quarantine-and-retry recovery.
144
- */
145
- protected spawnOnce(config: RcloneSpawnConfig): Promise<RcloneHandle>;
146
- /**
147
- * Stop an rclone subprocess. Attempts a flush first, then SIGTERM, then
148
- * SIGKILL + fusermount3 if `graceMs` elapses without the mountpoint
149
- * disappearing.
150
- *
151
- * `graceMs` bounds both the flush stabilization gate and the SIGTERM→SIGKILL
152
- * window — it is *not* a single total wall-clock cap: the flush also waits on
153
- * rclone's `/vfs/stats` drain (its own 60s ceiling) between the two.
154
- */
155
- stop(handle: RcloneHandle, opts?: {
156
- graceMs?: number;
157
- }): Promise<void>;
158
- /**
159
- * Apply a freshly-rendered rclone INI to a running mount by recycling the
160
- * process: flush + stop the current rclone, then re-spawn at the same
161
- * mountpoint/cacheDir with the new config. Returns the new handle.
162
- *
163
- * rclone holds the OAuth token in memory (baked into the config at spawn);
164
- * there is no rc command to swap it on a live `onedrive` backend, so a
165
- * recycle is the reliable way to apply a refreshed token. The vfs cache dir
166
- * is reused, so the remount revalidates rather than re-downloads. During the
167
- * brief unmount window the read-only mount-placeholder barrier underneath is
168
- * exposed (writes fail with EROFS, not EIO) — see ConnectorManager's
169
- * read-only-until-ready guarantee.
170
- */
171
- reconfigure(handle: RcloneHandle, rcloneConfig: string): Promise<RcloneHandle>;
172
- /**
173
- * Force rclone to upload pending writes, then wait until the in-use
174
- * counter reaches zero.
175
- *
176
- * Before issuing the refresh it waits for the vfs cache dir to go quiescent
177
- * (no write for `stabilityThresholdMs`, bounded by `stabilizeTimeoutMs`) so a
178
- * close/hibernate-triggered flush doesn't snapshot a half-written file and
179
- * trigger rclone's mid-write "sizes differ" abort. Pass `stabilize: false`
180
- * to skip the gate.
181
- */
182
- flush(handle: RcloneHandle, opts?: {
183
- stabilize?: boolean;
184
- stabilityThresholdMs?: number;
185
- stabilizeTimeoutMs?: number;
186
- }): Promise<void>;
187
- /**
188
- * Authoritative remote byte size for a mount-relative path, via rclone's
189
- * `operations/stat` rc endpoint. Backs the mount read-path stale-tail gate:
190
- * `operations/stat` hits the backend object directly, so it returns the true
191
- * remote size even when the VFS cache is serving a non-truncated item (and
192
- * `statSync` on the FUSE mount reports the inflated length). Returns `null`
193
- * when the handle is unknown, the object is missing / a directory, or the
194
- * call fails — the caller then trusts the on-disk bytes.
195
- */
196
- statSize(handle: RcloneHandle, relPath: string): Promise<number | null>;
197
- /** Liveness + cache-dir size. */
198
- status(handle: RcloneHandle): Promise<{
199
- alive: boolean;
200
- cacheBytes: number;
201
- }>;
202
- }
203
- /**
204
- * Per-process state threaded through {@link _routeRcloneLogLine} so it can
205
- * detect a sustained upload failure (the same object failing to upload K times
206
- * in a row) and surface it exactly once, instead of letting rclone retry
207
- * silently at INFO level forever.
208
- */
209
- export interface RcloneLogRouteContext {
210
- /** Consecutive retries for one object before {@link onUploadStuck} fires. */
211
- stuckThreshold?: number;
212
- /** Objects already alerted on, to fire once and not on every later retry. */
213
- alertedObjects?: Set<string>;
214
- /** Per-object consecutive `itemNotFound` count; escalates at {@link stuckThreshold}. */
215
- itemNotFoundCounts?: Map<string, number>;
216
- /** Called the first time an object crosses {@link stuckThreshold}. */
217
- onUploadStuck?: (object: string, tries: number) => void;
218
- /** Called when a line matches an OAuth auth-failure pattern. */
219
- onAuthError?: () => void;
220
- }
221
- /**
222
- * Thrown by {@link RcloneProcessManager.spawnOnce} when a mount-readiness
223
- * failure was accompanied by the {@link CACHE_POISON_RE} signature, so
224
- * {@link RcloneProcessManager.spawn} knows the failure is a recoverable
225
- * poisoned cache (quarantine + single retry) rather than a connectivity/token
226
- * fault. Its `message` is the full mount-failure detail (including the stderr
227
- * tail), so surfacing it directly when recovery declines loses no diagnostics.
228
- */
229
- export declare class CachePoisonedMountError extends Error {
230
- constructor(message: string);
231
- }
232
- /**
233
- * @internal
234
- * True when an rclone log line carries the poisoned-VFS-cache signature
235
- * ({@link CACHE_POISON_RE}). Exported for tests; not part of the public API.
236
- */
237
- export declare function _isCachePoisonLine(line: string): boolean;
238
- /**
239
- * Move a poisoned rclone VFS cache aside so the next spawn rebuilds a clean one
240
- * from the authoritative remote. Moves `<cacheDir>/vfs` + `<cacheDir>/vfsMeta`
241
- * (whichever exist) into `<cacheDir>/.corrupt-<ISO>` — a move-aside, never a
242
- * delete, so any (junk) un-uploaded bytes stay recoverable for forensics. The
243
- * quarantine dir is nested inside `cacheDir` (not a sibling) so it lives within
244
- * the per-session cache dir the platform removes wholesale on session close —
245
- * bounding its lifetime to the session — and rclone only reads its own
246
- * `vfs`/`vfsMeta` subdirs, so the dotted sibling is inert to the live mount.
247
- * (A bounded retain-N/reap-after-M GC of repeated resets within one long-lived
248
- * session is a follow-up; session-close cleanup covers the common case.)
249
- *
250
- * Returns the quarantine dir path when anything was moved, else `null` (nothing
251
- * to quarantine — the failure was not a poisoned cache). `nowMs` is injected for
252
- * deterministic test timestamps. Exported for tests; not part of the public API.
253
- */
254
- export declare function quarantineCacheDir(cacheDir: string, nowMs: number): Promise<string | null>;
255
- /**
256
- * @internal
257
- * Route a single rclone log line (JSON or raw) to the appropriate Logger
258
- * call. Exported for tests; not part of the public API. When `ctx` is
259
- * supplied, also tracks consecutive upload failures per object and invokes
260
- * `ctx.onUploadStuck` once the retry count for an object reaches the threshold.
261
- */
262
- export declare function _routeRcloneLogLine(line: string, log: Logger, ctx?: RcloneLogRouteContext): void;
263
- /**
264
- * @internal
265
- * Build the `rclone mount` argv from a spawn config. Extracted from spawn() so
266
- * the flag wiring (notably `--vfs-write-back` and the conditional
267
- * `--ignore-size --ignore-checksum`) is unit-testable without actually
268
- * launching rclone. Exported for tests; not part of the public API.
269
- */
270
- export declare function _buildRcloneArgs(config: RcloneSpawnConfig, io: {
271
- configPath: string;
272
- rcAddr: string;
273
- }): string[];
274
- /**
275
- * @internal
276
- * Split an rclone mount `remote` (`skaile-<id>:/base/path`) plus a
277
- * mount-relative path into the `{fs, remote}` pair rclone's `operations/stat`
278
- * rc command expects: `fs` is the backend root (`skaile-<id>:`) and `remote` is
279
- * the object path within it. Leading/trailing slashes are normalised away so
280
- * the join is stable regardless of how either side is slashed. Exported for
281
- * tests; not part of the public API.
282
- */
283
- export declare function _operationsStatTarget(remote: string, relPath: string): {
284
- fs: string;
285
- remote: string;
286
- };
287
- /**
288
- * Query rclone's `operations/stat` rc endpoint for the authoritative remote
289
- * size of `relPath` under `remote`. Returns the byte size, or `null` when the
290
- * object is missing, is a directory, the call fails, or the size is absent.
291
- *
292
- * Unlike a `statSync` on the FUSE mount, `operations/stat` resolves the object
293
- * against the backend directly, so it is not subject to the VFS cache's
294
- * non-truncated stale tail. Pass `fetchImpl` to test without a live rc server.
295
- */
296
- export declare function fetchAuthoritativeSize(rcAddr: string, remote: string, relPath: string, fetchImpl?: typeof fetch): Promise<number | null>;
297
- /**
298
- * Poll `dir` until its newest file mtime is at least `thresholdMs` in the past
299
- * (no write for that long), or `timeoutMs` elapses. Returns true if it went
300
- * quiescent, false on timeout. An empty/missing dir counts as quiescent.
301
- */
302
- export declare function awaitQuiescent(dir: string, opts: {
303
- thresholdMs: number;
304
- timeoutMs: number;
305
- pollMs: number;
306
- }): Promise<boolean>;
307
- /**
308
- * @internal
309
- * Returns true if a FUSE mount is present at `mountPoint` in the given
310
- * /proc/self/mounts text. The fstype check (field 3, `fuse.*`) is essential:
311
- * the deferred-mount barrier leaves a `tmpfs` mounted at the same path, so a
312
- * path-only match would report the *barrier* as the confirmed mount and mask a
313
- * dead rclone process. Exported for tests; not part of the public API.
314
- */
315
- export declare function _fuseMountPresent(procMountsText: string, mountPoint: string): boolean;
316
- //# sourceMappingURL=rclone-process-manager.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"rclone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AM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,EACf,SAAS,GAAE,OAAO,KAAa,GAC9B,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAgBxB;AAED;;;;GAIG;AACH,wBAAsB,cAAc,CAClC,GAAG,EAAE,MAAM,EACX,IAAI,EAAE;IAAE,WAAW,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GAC/D,OAAO,CAAC,OAAO,CAAC,CAQlB;AA8CD;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,cAAc,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAerF"}
@@ -1,84 +0,0 @@
1
- /**
2
- * Proactive + reactive OAuth token refresh for rclone-backed mounts.
3
- * See `connectors/CLAUDE.md` § Rclone Process Manager → Token refresh.
4
- */
5
- import type { TokenMediator } from "./connector-types.js";
6
- import type { RcloneHandle } from "./rclone-process-manager.js";
7
- /**
8
- * Safety margin between the scheduled refresh and the token's declared expiry.
9
- * Default 5 minutes: long enough that any in-flight read/write at fire time
10
- * still has a usable token through the recycle, short enough that a server
11
- * clock skew of a few seconds does not push the fire-time past expiry. Matches
12
- * the AI-credential and git-mount refresh leads.
13
- */
14
- export declare const PROACTIVE_RCLONE_REFRESH_MARGIN_MS: number;
15
- /** Default cooldown suppressing reactive triggers right after a refresh. */
16
- export declare const DEFAULT_REACTIVE_COOLDOWN_MS: number;
17
- /**
18
- * Minimal slice of `RcloneProcessManager` the refresh controller needs: swap
19
- * the live mount onto a freshly-rendered INI (`reconfigure`), and stop a
20
- * process the controller spawned but can no longer own (`stop`, used to clean
21
- * up when `disconnect()` races a mid-recycle spawn).
22
- */
23
- export interface RcloneReconfigurable {
24
- reconfigure(handle: RcloneHandle, rcloneConfig: string): Promise<RcloneHandle>;
25
- stop(handle: RcloneHandle): Promise<void>;
26
- }
27
- /**
28
- * Caller-supplied dependencies for {@link createRcloneTokenRefresh}.
29
- *
30
- * - `tokenMediator` runs the actual backend mint round-trip.
31
- * - `renderConfig(token)` re-renders the rclone INI for the freshly-minted
32
- * access token (driver-specific: onedrive vs webdav backend shape).
33
- * - `rclone.reconfigure` recycles the process onto the new INI.
34
- * - `handleRef.current` is the live rclone handle; the controller updates it
35
- * in place on every successful recycle so the driver's `disconnect()` stops
36
- * the current process.
37
- * - `now` / `setTimeoutImpl` / `clearTimeoutImpl` are injected for tests.
38
- */
39
- export interface RcloneTokenRefreshDeps {
40
- connectorId: string;
41
- tokenMediator: TokenMediator;
42
- renderConfig: (token: string) => string | Promise<string>;
43
- rclone: RcloneReconfigurable;
44
- handleRef: {
45
- current: RcloneHandle | null;
46
- };
47
- log: (line: string) => void;
48
- now?: () => number;
49
- setTimeoutImpl?: (handler: () => void, ms: number) => {
50
- unref?: () => void;
51
- };
52
- clearTimeoutImpl?: (handle: {
53
- unref?: () => void;
54
- }) => void;
55
- marginMs?: number;
56
- reactiveCooldownMs?: number;
57
- }
58
- export interface RcloneTokenRefreshController {
59
- /**
60
- * Arm the timer for `expiresAtIso - marginMs`. Cancels any prior pending
61
- * fire. `null` / `undefined` / unparseable cancels without re-arming
62
- * (static-credential / standalone semantics). A past fire-time refreshes on
63
- * the next tick.
64
- */
65
- schedule(expiresAtIso: string | null | undefined): void;
66
- /**
67
- * Reactive safety net: invoke when rclone reports an auth failure. Triggers
68
- * an immediate refresh unless one is already in flight or the last refresh
69
- * was within the cooldown window (prevents a stream of failure lines from
70
- * spinning the recycle loop).
71
- */
72
- onAuthError(): void;
73
- /** Cancel any pending fire. Idempotent. */
74
- cancel(): void;
75
- /** Whether a proactive timer is currently armed. Exposed for tests. */
76
- isPending(): boolean;
77
- }
78
- /**
79
- * Build a refresh controller bound to one rclone mount. One controller per
80
- * connect — the driver constructs it after the initial spawn and disposes it
81
- * via `cancel()` in `disconnect()`.
82
- */
83
- export declare function createRcloneTokenRefresh(deps: RcloneTokenRefreshDeps): RcloneTokenRefreshController;
84
- //# sourceMappingURL=rclone-token-refresh.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"rclone-token-refresh.d.ts","sourceRoot":"","sources":["../../../connectors/src/rclone-token-refresh.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAEhE;;;;;;GAMG;AACH,eAAO,MAAM,kCAAkC,QAAgB,CAAC;AAEhE,4EAA4E;AAC5E,eAAO,MAAM,4BAA4B,QAAY,CAAC;AAStD;;;;;GAKG;AACH,MAAM,WAAW,oBAAoB;IACnC,WAAW,CAAC,MAAM,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;IAC/E,IAAI,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC3C;AAED;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,sBAAsB;IACrC,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,aAAa,CAAC;IAC7B,YAAY,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAC1D,MAAM,EAAE,oBAAoB,CAAC;IAC7B,SAAS,EAAE;QAAE,OAAO,EAAE,YAAY,GAAG,IAAI,CAAA;KAAE,CAAC;IAC5C,GAAG,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5B,GAAG,CAAC,EAAE,MAAM,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,IAAI,EAAE,EAAE,EAAE,MAAM,KAAK;QAAE,KAAK,CAAC,EAAE,MAAM,IAAI,CAAA;KAAE,CAAC;IAC7E,gBAAgB,CAAC,EAAE,CAAC,MAAM,EAAE;QAAE,KAAK,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