@sapiom/tools 0.1.2 → 0.2.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 (55) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/README.md +2 -1
  3. package/dist/cjs/client.d.ts +8 -0
  4. package/dist/cjs/client.d.ts.map +1 -1
  5. package/dist/cjs/client.js +41 -0
  6. package/dist/cjs/client.js.map +1 -1
  7. package/dist/cjs/file-storage/errors.d.ts +16 -0
  8. package/dist/cjs/file-storage/errors.d.ts.map +1 -0
  9. package/dist/cjs/file-storage/errors.js +36 -0
  10. package/dist/cjs/file-storage/errors.js.map +1 -0
  11. package/dist/cjs/file-storage/index.d.ts +116 -0
  12. package/dist/cjs/file-storage/index.d.ts.map +1 -0
  13. package/dist/cjs/file-storage/index.js +136 -0
  14. package/dist/cjs/file-storage/index.js.map +1 -0
  15. package/dist/cjs/index.d.ts +4 -2
  16. package/dist/cjs/index.d.ts.map +1 -1
  17. package/dist/cjs/index.js +6 -3
  18. package/dist/cjs/index.js.map +1 -1
  19. package/dist/cjs/repositories/index.d.ts +13 -15
  20. package/dist/cjs/repositories/index.d.ts.map +1 -1
  21. package/dist/cjs/repositories/index.js +18 -30
  22. package/dist/cjs/repositories/index.js.map +1 -1
  23. package/dist/cjs/stub/index.d.ts +19 -0
  24. package/dist/cjs/stub/index.d.ts.map +1 -0
  25. package/dist/cjs/stub/index.js +187 -0
  26. package/dist/cjs/stub/index.js.map +1 -0
  27. package/dist/esm/client.d.ts +8 -0
  28. package/dist/esm/client.d.ts.map +1 -1
  29. package/dist/esm/client.js +8 -0
  30. package/dist/esm/client.js.map +1 -1
  31. package/dist/esm/file-storage/errors.d.ts +16 -0
  32. package/dist/esm/file-storage/errors.d.ts.map +1 -0
  33. package/dist/esm/file-storage/errors.js +31 -0
  34. package/dist/esm/file-storage/errors.js.map +1 -0
  35. package/dist/esm/file-storage/index.d.ts +116 -0
  36. package/dist/esm/file-storage/index.d.ts.map +1 -0
  37. package/dist/esm/file-storage/index.js +129 -0
  38. package/dist/esm/file-storage/index.js.map +1 -0
  39. package/dist/esm/index.d.ts +4 -2
  40. package/dist/esm/index.d.ts.map +1 -1
  41. package/dist/esm/index.js +4 -2
  42. package/dist/esm/index.js.map +1 -1
  43. package/dist/esm/repositories/index.d.ts +13 -15
  44. package/dist/esm/repositories/index.d.ts.map +1 -1
  45. package/dist/esm/repositories/index.js +18 -30
  46. package/dist/esm/repositories/index.js.map +1 -1
  47. package/dist/esm/stub/index.d.ts +19 -0
  48. package/dist/esm/stub/index.d.ts.map +1 -0
  49. package/dist/esm/stub/index.js +184 -0
  50. package/dist/esm/stub/index.js.map +1 -0
  51. package/dist/tsconfig.cjs.tsbuildinfo +1 -1
  52. package/dist/tsconfig.esm.tsbuildinfo +1 -1
  53. package/package.json +12 -2
  54. package/src/file-storage/README.md +61 -0
  55. package/src/repositories/README.md +2 -2
package/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # @sapiom/tools
2
2
 
3
+ ## 0.2.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 7f6859e: Add the `fileStorage` capability — tenant-scoped object storage on presigned GCS URLs. Exposes `upload`, `getDownloadUrl`, `list`, `setVisibility`, and `delete` via `createClient().fileStorage`, the ambient `fileStorage` namespace, or the `@sapiom/tools/file-storage` subpath. Non-2xx responses throw `FileStorageHttpError`. Byte transfer stays client-side (presigned URLs); the capability owns only the control plane.
8
+
9
+ ## 0.1.3
10
+
11
+ ### Patch Changes
12
+
13
+ - 2126d96: `repositories.pushFromSandbox` now always publishes the agent's work — it
14
+ commits any pending changes and pushes the current commit, so your work reaches
15
+ the repo whether the agent left changes uncommitted, already committed them, or
16
+ both. (Previously it skipped the push when there were no uncommitted changes.)
17
+ The result now includes `branch` alongside `pushed` and `sha`.
18
+
3
19
  ## 0.1.2
4
20
 
5
21
  ### Patch Changes
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @sapiom/tools
2
2
 
3
- A typed TypeScript client for Sapiom capabilities — sandboxes, git repositories, and coding agents — authenticated to your tenant.
3
+ A typed TypeScript client for Sapiom capabilities — sandboxes, git repositories, coding agents, and file storage — authenticated to your tenant.
4
4
 
5
5
  These are the same capabilities your Sapiom agents call as tools; this package makes them callable directly from your own code.
6
6
 
@@ -70,6 +70,7 @@ Each capability is a namespace, importable from the barrel or its own subpath (e
70
70
  | `sandboxes` | Isolated, ephemeral compute | [src/sandboxes](./src/sandboxes/README.md) |
71
71
  | `repositories` | Private, in-network git repos | [src/repositories](./src/repositories/README.md) |
72
72
  | `agent` | Coding agents (LLM execution) | [src/agent](./src/agent/README.md) |
73
+ | `fileStorage` | Tenant-scoped object storage (presigned GCS) | [src/file-storage](./src/file-storage/README.md) |
73
74
 
74
75
  ## Composing capabilities
75
76
 
@@ -19,6 +19,7 @@ import { Sandbox } from "./sandboxes/index.js";
19
19
  import type { SandboxCreateOptions } from "./sandboxes/index.js";
20
20
  import { Repository } from "./repositories/index.js";
21
21
  import type { CodingRunSpec, CodingRunResult, RunHandle } from "./agent/index.js";
22
+ import type { UploadInput, UploadResponse, DownloadUrlResponse, ListOptions, ListResponse, FileMetadata } from "./file-storage/index.js";
22
23
  export interface Sapiom {
23
24
  readonly sandboxes: {
24
25
  create(opts: SandboxCreateOptions): Promise<Sandbox>;
@@ -40,6 +41,13 @@ export interface Sapiom {
40
41
  launch(spec: CodingRunSpec): Promise<RunHandle>;
41
42
  };
42
43
  };
44
+ readonly fileStorage: {
45
+ upload(input: UploadInput): Promise<UploadResponse>;
46
+ getDownloadUrl(fileId: string): Promise<DownloadUrlResponse>;
47
+ list(opts?: ListOptions): Promise<ListResponse>;
48
+ delete(fileId: string): Promise<void>;
49
+ setVisibility(fileId: string, visibility: "private" | "public"): Promise<FileMetadata>;
50
+ };
43
51
  /**
44
52
  * Derive a client that attributes its calls to a different agent/trace. For the
45
53
  * router case (one process acting for many agents); step-authoring code doesn't
@@ -1 +1 @@
1
- {"version":3,"file":"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 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
2
35
  Object.defineProperty(exports, "__esModule", { value: true });
3
36
  exports.createClient = createClient;
4
37
  exports.createClientFromEnv = createClientFromEnv;
@@ -22,6 +55,7 @@ const index_js_1 = require("./_client/index.js");
22
55
  const index_js_2 = require("./sandboxes/index.js");
23
56
  const index_js_3 = require("./repositories/index.js");
24
57
  const index_js_4 = require("./agent/index.js");
58
+ const fileStorage = __importStar(require("./file-storage/index.js"));
25
59
  /** Bind every capability namespace to a transport. `withAttribution` rebinds to a derived one. */
26
60
  function bind(transport) {
27
61
  return {
@@ -42,6 +76,13 @@ function bind(transport) {
42
76
  launch: (spec) => (0, index_js_4.launch)(spec, transport),
43
77
  },
44
78
  },
79
+ fileStorage: {
80
+ upload: (input) => fileStorage.upload(input, transport),
81
+ getDownloadUrl: (fileId) => fileStorage.getDownloadUrl(fileId, transport),
82
+ list: (opts) => fileStorage.list(opts, transport),
83
+ delete: (fileId) => fileStorage.delete(fileId, transport),
84
+ setVisibility: (fileId, visibility) => fileStorage.setVisibility(fileId, visibility, transport),
85
+ },
45
86
  withAttribution: (attribution) => bind(transport.withAttribution(attribution)),
46
87
  };
47
88
  }
@@ -1 +1 @@
1
- {"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/client.ts"],"names":[],"mappings":";;AAuFA,oCAEC;AAWD,kDAEC;AAtGD;;;;;;;;;;;;;;;GAeG;AACH,iDAK4B;AAC5B,mDAA+C;AAE/C,sDAAqD;AACrD,+CAA4E;AAqC5E,kGAAkG;AAClG,SAAS,IAAI,CAAC,SAAoB;IAChC,OAAO;QACL,SAAS,EAAE;YACT,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,kBAAO,CAAC,MAAM,CAAC,IAAI,EAAE,SAAS,CAAC;YACjD,MAAM,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,CAAC,kBAAO,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,EAAE,SAAS,CAAC;SAC9D;QACD,YAAY,EAAE;YACZ,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,qBAAU,CAAC,MAAM,CAAC,IAAI,EAAE,SAAS,CAAC;YACpD,GAAG,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,qBAAU,CAAC,GAAG,CAAC,IAAI,EAAE,SAAS,CAAC;YAC9C,IAAI,EAAE,GAAG,EAAE,CAAC,qBAAU,CAAC,IAAI,CAAC,SAAS,CAAC;YACtC,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,qBAAU,CAAC,MAAM,CAAC,IAAI,EAAE,SAAS,CAAC;YACpD,MAAM,EAAE,CAAC,IAAI,EAAE,QAAQ,EAAE,EAAE,CAAC,qBAAU,CAAC,MAAM,CAAC,IAAI,EAAE,QAAQ,EAAE,SAAS,CAAC;SACzE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AE,EAAE,CAC/B,IAAI,CAAC,SAAS,CAAC,eAAe,CAAC,WAAW,CAAC,CAAC;KAC/C,CAAC;AACJ,CAAC;AAED,SAAgB,YAAY,CAAC,MAAwB;IACnD,OAAO,IAAI,CAAC,IAAI,oBAAS,CAAC,MAAM,CAAC,CAAC,CAAC;AACrC,CAAC;AAED;;;;;;;;GAQG;AACH,SAAgB,mBAAmB;IACjC,OAAO,IAAI,CAAC,IAAI,oBAAS,CAAC,EAAE,WAAW,EAAE,IAAA,6BAAkB,GAAE,EAAE,CAAC,CAAC,CAAC;AACpE,CAAC"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Error thrown by the file-storage capability when the gateway returns a non-2xx
3
+ * response. Exposes `status` (HTTP status code) and `body` (parsed JSON body, or
4
+ * raw text when the body isn't JSON) for programmatic inspection.
5
+ */
6
+ export declare class FileStorageHttpError extends Error {
7
+ readonly status: number;
8
+ readonly body: unknown;
9
+ constructor(message: string, status: number, body: unknown);
10
+ }
11
+ /**
12
+ * Return the response when 2xx, otherwise throw a {@link FileStorageHttpError}.
13
+ * Parses the error body as JSON when possible; falls back to raw text.
14
+ */
15
+ export declare function ensureOk(response: Response, errorPrefix: string): Promise<Response>;
16
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/file-storage/errors.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,qBAAa,oBAAqB,SAAQ,KAAK;IAC7C,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;gBAEX,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO;CAM3D;AAED;;;GAGG;AACH,wBAAsB,QAAQ,CAC5B,QAAQ,EAAE,QAAQ,EAClB,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,QAAQ,CAAC,CAcnB"}
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FileStorageHttpError = void 0;
4
+ exports.ensureOk = ensureOk;
5
+ /**
6
+ * Error thrown by the file-storage capability when the gateway returns a non-2xx
7
+ * response. Exposes `status` (HTTP status code) and `body` (parsed JSON body, or
8
+ * raw text when the body isn't JSON) for programmatic inspection.
9
+ */
10
+ class FileStorageHttpError extends Error {
11
+ constructor(message, status, body) {
12
+ super(message);
13
+ this.name = "FileStorageHttpError";
14
+ this.status = status;
15
+ this.body = body;
16
+ }
17
+ }
18
+ exports.FileStorageHttpError = FileStorageHttpError;
19
+ /**
20
+ * Return the response when 2xx, otherwise throw a {@link FileStorageHttpError}.
21
+ * Parses the error body as JSON when possible; falls back to raw text.
22
+ */
23
+ async function ensureOk(response, errorPrefix) {
24
+ if (response.ok)
25
+ return response;
26
+ let body;
27
+ const text = await response.text().catch(() => "");
28
+ try {
29
+ body = JSON.parse(text);
30
+ }
31
+ catch {
32
+ body = text;
33
+ }
34
+ throw new FileStorageHttpError(`${errorPrefix}: ${response.status} ${text}`, response.status, body);
35
+ }
36
+ //# sourceMappingURL=errors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.js","sourceRoot":"","sources":["../../../src/file-storage/errors.ts"],"names":[],"mappings":";;;AAqBA,4BAiBC;AAtCD;;;;GAIG;AACH,MAAa,oBAAqB,SAAQ,KAAK;IAI7C,YAAY,OAAe,EAAE,MAAc,EAAE,IAAa;QACxD,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,sBAAsB,CAAC;QACnC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;CACF;AAVD,oDAUC;AAED;;;GAGG;AACI,KAAK,UAAU,QAAQ,CAC5B,QAAkB,EAClB,WAAmB;IAEnB,IAAI,QAAQ,CAAC,EAAE;QAAE,OAAO,QAAQ,CAAC;IACjC,IAAI,IAAa,CAAC;IAClB,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC;IACnD,IAAI,CAAC;QACH,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;IAAC,MAAM,CAAC;QACP,IAAI,GAAG,IAAI,CAAC;IACd,CAAC;IACD,MAAM,IAAI,oBAAoB,CAC5B,GAAG,WAAW,KAAK,QAAQ,CAAC,MAAM,IAAI,IAAI,EAAE,EAC5C,QAAQ,CAAC,MAAM,EACf,IAAI,CACL,CAAC;AACJ,CAAC"}
@@ -0,0 +1,116 @@
1
+ /**
2
+ * `fileStorage` capability — tenant-scoped object storage on presigned GCS URLs.
3
+ *
4
+ * The control plane only: `upload` hands back a presigned URL you PUT the bytes to
5
+ * yourself (so you own streaming / progress / resumable uploads), and
6
+ * `getDownloadUrl` hands back a presigned URL you GET. `list`, `setVisibility`, and
7
+ * `delete` round out the lifecycle.
8
+ *
9
+ * import { fileStorage } from "@sapiom/tools"; // ambient auth
10
+ * const { uploadUrl, requiredHeaders } = await fileStorage.upload({
11
+ * contentType: "image/png",
12
+ * fileName: "photo.png",
13
+ * });
14
+ * await fetch(uploadUrl, { method: "PUT", headers: requiredHeaders, body: bytes });
15
+ *
16
+ * Or via an explicit client: `createClient({ apiKey }).fileStorage.upload(...)`.
17
+ *
18
+ * Wire fields are snake_case; this module maps them to the camelCase SDK surface.
19
+ * Byte counts are int64 — the gateway serializes them as strings (precision-safe),
20
+ * so `expectedFileSize` / `actualFileSize` on returned metadata are `string | null`.
21
+ */
22
+ import { Transport } from "../_client/index.js";
23
+ import { FileStorageHttpError } from "./errors.js";
24
+ export { FileStorageHttpError };
25
+ export interface UploadInput {
26
+ /** MIME content type of the file (e.g. "image/png", "application/pdf"). */
27
+ contentType: string;
28
+ /** Original file name for display purposes. */
29
+ fileName?: string;
30
+ /**
31
+ * File visibility.
32
+ * - "private" — download requires authentication (default).
33
+ * - "public" — download URL is unauthenticated.
34
+ */
35
+ visibility?: "private" | "public";
36
+ /** Expected file size in bytes. Used to pre-allocate storage. */
37
+ expectedFileSize?: number;
38
+ }
39
+ export interface UploadResponse {
40
+ /** Unique file identifier. Use this in subsequent calls. */
41
+ fileId: string;
42
+ /** GCS presigned upload URL. PUT the file bytes here directly. Expires at `expiresAt`. */
43
+ uploadUrl: string;
44
+ /** ISO-8601 timestamp when the upload URL expires. */
45
+ expiresAt: string;
46
+ /** Headers that must be sent when PUTting bytes to `uploadUrl` (e.g. Content-Type). */
47
+ requiredHeaders: Record<string, string>;
48
+ }
49
+ export interface DownloadUrlResponse {
50
+ /** Presigned GCS download URL. Expires at `expiresAt`. */
51
+ downloadUrl: string;
52
+ /** ISO-8601 timestamp when the download URL expires. */
53
+ expiresAt: string;
54
+ }
55
+ export interface FileMetadata {
56
+ /** Unique file identifier. */
57
+ fileId: string;
58
+ /** Original file name, if provided at upload time. */
59
+ fileName?: string;
60
+ /** MIME content type. */
61
+ contentType: string;
62
+ /** File visibility ("private" or "public"). */
63
+ visibility: "private" | "public";
64
+ /** Upload lifecycle status (e.g. "pending_upload", "uploaded", "deleted"). */
65
+ status: string;
66
+ /**
67
+ * Expected (client-declared) size in bytes — a string (int64, precision-safe),
68
+ * `null` when not declared.
69
+ */
70
+ expectedFileSize?: string | null;
71
+ /** Actual size in bytes after upload (string; `null` until the verify sweep records it). */
72
+ actualFileSize?: string | null;
73
+ /** ISO-8601 timestamp when the record was created. */
74
+ createdAt: string;
75
+ /** ISO-8601 timestamp when the bytes were uploaded. */
76
+ uploadedAt?: string;
77
+ /** ISO-8601 timestamp when the file was soft-deleted. */
78
+ deletedAt?: string;
79
+ /** Number of times a download URL was generated for this file. */
80
+ downloadRequestCount: number;
81
+ }
82
+ export interface ListOptions {
83
+ /** Maximum number of files to return. */
84
+ limit?: number;
85
+ /** Number of files to skip (pagination). */
86
+ offset?: number;
87
+ }
88
+ export interface ListResponse {
89
+ /** Files on the current page. */
90
+ files: FileMetadata[];
91
+ /** Page size used. */
92
+ limit: number;
93
+ /** Offset used. */
94
+ offset: number;
95
+ /** Whether more files exist beyond this page. */
96
+ hasMore: boolean;
97
+ }
98
+ /**
99
+ * Initiate an upload. Returns a presigned GCS URL; PUT the bytes to `uploadUrl`
100
+ * with `requiredHeaders` yourself (this capability owns only the control plane).
101
+ */
102
+ export declare function upload(input: UploadInput, transport?: Transport, baseUrl?: string): Promise<UploadResponse>;
103
+ /** Generate a presigned download URL for a file. */
104
+ export declare function getDownloadUrl(fileId: string, transport?: Transport, baseUrl?: string): Promise<DownloadUrlResponse>;
105
+ /** List files owned by the authenticated tenant. */
106
+ export declare function list(opts?: ListOptions, transport?: Transport, baseUrl?: string): Promise<ListResponse>;
107
+ /** Update a file's visibility. */
108
+ export declare function setVisibility(fileId: string, visibility: "private" | "public", transport?: Transport, baseUrl?: string): Promise<FileMetadata>;
109
+ /**
110
+ * Delete a file. Idempotent on the gateway (deleting an already-deleted file is a
111
+ * no-op success). Exported as `delete`:
112
+ * `import { fileStorage } from "@sapiom/tools"; await fileStorage.delete(id)`.
113
+ */
114
+ declare function deleteFile(fileId: string, transport?: Transport, baseUrl?: string): Promise<void>;
115
+ export { deleteFile as delete };
116
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/file-storage/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,EAAE,SAAS,EAAoB,MAAM,qBAAqB,CAAC;AAClE,OAAO,EAAY,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAE7D,OAAO,EAAE,oBAAoB,EAAE,CAAC;AAShC,MAAM,WAAW,WAAW;IAC1B,2EAA2E;IAC3E,WAAW,EAAE,MAAM,CAAC;IACpB,+CAA+C;IAC/C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;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3B,iCAAiC;IACjC,KAAK,EAAE,YAAY,EAAE,CAAC;IACtB,sBAAsB;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,mBAAmB;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,iDAAiD;IACjD,OAAO,EAAE,OAAO,CAAC;CAClB;AA4DD;;;GAGG;AACH,wBAAsB,MAAM,CAC1B,KAAK,EAAE,WAAW,EAClB,SAAS,GAAE,SAA8B,EACzC,OAAO,SAAmB,GACzB,OAAO,CAAC,cAAc,CAAC,CAuBzB;AAED,oDAAoD;AACpD,wBAAsB,cAAc,CAClC,MAAM,EAAE,MAAM,EACd,SAAS,GAAE,SAA8B,EACzC,OAAO,SAAmB,GACzB,OAAO,CAAC,mBAAmB,CAAC,CAO9B;AAED,oDAAoD;AACpD,wBAAsB,IAAI,CACxB,IAAI,CAAC,EAAE,WAAW,EAClB,SAAS,GAAE,SAA8B,EACzC,OAAO,SAAmB,GACzB,OAAO,CAAC,YAAY,CAAC,CAmBvB;AAED,kCAAkC;AAClC,wBAAsB,aAAa,CACjC,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,SAAS,GAAG,QAAQ,EAChC,SAAS,GAAE,SAA8B,EACzC,OAAO,SAAmB,GACzB,OAAO,CAAC,YAAY,CAAC,CAWvB;AAED;;;;GAIG;AACH,iBAAe,UAAU,CACvB,MAAM,EAAE,MAAM,EACd,SAAS,GAAE,SAA8B,EACzC,OAAO,SAAmB,GACzB,OAAO,CAAC,IAAI,CAAC,CAoBf;AAED,OAAO,EAAE,UAAU,IAAI,MAAM,EAAE,CAAC"}
@@ -0,0 +1,136 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FileStorageHttpError = void 0;
4
+ exports.upload = upload;
5
+ exports.getDownloadUrl = getDownloadUrl;
6
+ exports.list = list;
7
+ exports.setVisibility = setVisibility;
8
+ exports.delete = deleteFile;
9
+ /**
10
+ * `fileStorage` capability — tenant-scoped object storage on presigned GCS URLs.
11
+ *
12
+ * The control plane only: `upload` hands back a presigned URL you PUT the bytes to
13
+ * yourself (so you own streaming / progress / resumable uploads), and
14
+ * `getDownloadUrl` hands back a presigned URL you GET. `list`, `setVisibility`, and
15
+ * `delete` round out the lifecycle.
16
+ *
17
+ * import { fileStorage } from "@sapiom/tools"; // ambient auth
18
+ * const { uploadUrl, requiredHeaders } = await fileStorage.upload({
19
+ * contentType: "image/png",
20
+ * fileName: "photo.png",
21
+ * });
22
+ * await fetch(uploadUrl, { method: "PUT", headers: requiredHeaders, body: bytes });
23
+ *
24
+ * Or via an explicit client: `createClient({ apiKey }).fileStorage.upload(...)`.
25
+ *
26
+ * Wire fields are snake_case; this module maps them to the camelCase SDK surface.
27
+ * Byte counts are int64 — the gateway serializes them as strings (precision-safe),
28
+ * so `expectedFileSize` / `actualFileSize` on returned metadata are `string | null`.
29
+ */
30
+ const index_js_1 = require("../_client/index.js");
31
+ const errors_js_1 = require("./errors.js");
32
+ Object.defineProperty(exports, "FileStorageHttpError", { enumerable: true, get: function () { return errors_js_1.FileStorageHttpError; } });
33
+ /** Object storage service. Host routing is an internal detail — override via SAPIOM_FILE_STORAGE_URL. */
34
+ const DEFAULT_BASE_URL = process.env.SAPIOM_FILE_STORAGE_URL ||
35
+ "https://file-storage.services.sapiom.ai";
36
+ function mapFileMetadata(raw) {
37
+ return {
38
+ fileId: raw.file_id,
39
+ ...(raw.file_name !== undefined && { fileName: raw.file_name }),
40
+ contentType: raw.content_type,
41
+ visibility: raw.visibility,
42
+ status: raw.status,
43
+ ...(raw.expected_file_size !== undefined && {
44
+ expectedFileSize: raw.expected_file_size,
45
+ }),
46
+ ...(raw.actual_file_size !== undefined && {
47
+ actualFileSize: raw.actual_file_size,
48
+ }),
49
+ createdAt: raw.created_at,
50
+ ...(raw.uploaded_at !== undefined && { uploadedAt: raw.uploaded_at }),
51
+ ...(raw.deleted_at !== undefined && { deletedAt: raw.deleted_at }),
52
+ downloadRequestCount: raw.download_request_count,
53
+ };
54
+ }
55
+ // ----- capability operations -----
56
+ /**
57
+ * Initiate an upload. Returns a presigned GCS URL; PUT the bytes to `uploadUrl`
58
+ * with `requiredHeaders` yourself (this capability owns only the control plane).
59
+ */
60
+ async function upload(input, transport = (0, index_js_1.defaultTransport)(), baseUrl = DEFAULT_BASE_URL) {
61
+ const body = { content_type: input.contentType };
62
+ if (input.fileName !== undefined)
63
+ body.file_name = input.fileName;
64
+ if (input.visibility !== undefined)
65
+ body.visibility = input.visibility;
66
+ if (input.expectedFileSize !== undefined) {
67
+ body.expected_file_size = input.expectedFileSize;
68
+ }
69
+ const res = await (0, errors_js_1.ensureOk)(await transport.fetch(`${baseUrl}/upload`, {
70
+ method: "POST",
71
+ headers: { "content-type": "application/json" },
72
+ body: JSON.stringify(body),
73
+ }), "Failed to initiate file upload");
74
+ const raw = (await res.json());
75
+ return {
76
+ fileId: raw.file_id,
77
+ uploadUrl: raw.upload_url,
78
+ expiresAt: raw.expires_at,
79
+ requiredHeaders: raw.required_headers,
80
+ };
81
+ }
82
+ /** Generate a presigned download URL for a file. */
83
+ async function getDownloadUrl(fileId, transport = (0, index_js_1.defaultTransport)(), baseUrl = DEFAULT_BASE_URL) {
84
+ const res = await (0, errors_js_1.ensureOk)(await transport.fetch(`${baseUrl}/download/${encodeURIComponent(fileId)}`), `Failed to get download URL for file '${fileId}'`);
85
+ const raw = (await res.json());
86
+ return { downloadUrl: raw.download_url, expiresAt: raw.expires_at };
87
+ }
88
+ /** List files owned by the authenticated tenant. */
89
+ async function list(opts, transport = (0, index_js_1.defaultTransport)(), baseUrl = DEFAULT_BASE_URL) {
90
+ const url = new URL(`${baseUrl}/files`);
91
+ if (opts?.limit !== undefined) {
92
+ url.searchParams.set("limit", String(opts.limit));
93
+ }
94
+ if (opts?.offset !== undefined) {
95
+ url.searchParams.set("offset", String(opts.offset));
96
+ }
97
+ const res = await (0, errors_js_1.ensureOk)(await transport.fetch(url.toString()), "Failed to list files");
98
+ const raw = (await res.json());
99
+ return {
100
+ files: raw.files.map(mapFileMetadata),
101
+ limit: raw.limit,
102
+ offset: raw.offset,
103
+ hasMore: raw.has_more,
104
+ };
105
+ }
106
+ /** Update a file's visibility. */
107
+ async function setVisibility(fileId, visibility, transport = (0, index_js_1.defaultTransport)(), baseUrl = DEFAULT_BASE_URL) {
108
+ const res = await (0, errors_js_1.ensureOk)(await transport.fetch(`${baseUrl}/${encodeURIComponent(fileId)}`, {
109
+ method: "PATCH",
110
+ headers: { "content-type": "application/json" },
111
+ body: JSON.stringify({ visibility }),
112
+ }), `Failed to set visibility for file '${fileId}'`);
113
+ const raw = (await res.json());
114
+ return mapFileMetadata(raw);
115
+ }
116
+ /**
117
+ * Delete a file. Idempotent on the gateway (deleting an already-deleted file is a
118
+ * no-op success). Exported as `delete`:
119
+ * `import { fileStorage } from "@sapiom/tools"; await fileStorage.delete(id)`.
120
+ */
121
+ async function deleteFile(fileId, transport = (0, index_js_1.defaultTransport)(), baseUrl = DEFAULT_BASE_URL) {
122
+ const res = await transport.fetch(`${baseUrl}/${encodeURIComponent(fileId)}`, { method: "DELETE" });
123
+ if (!res.ok) {
124
+ const text = await res.text().catch(() => "");
125
+ let parsed;
126
+ try {
127
+ parsed = JSON.parse(text);
128
+ }
129
+ catch {
130
+ parsed = text;
131
+ }
132
+ throw new errors_js_1.FileStorageHttpError(`Failed to delete file '${fileId}': ${res.status} ${text}`, res.status, parsed);
133
+ }
134
+ // 204 No Content — nothing to parse.
135
+ }
136
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/file-storage/index.ts"],"names":[],"mappings":";;;AA8KA,wBA2BC;AAGD,wCAWC;AAGD,oBAuBC;AAGD,sCAgBC;AAiCsB,4BAAM;AArS7B;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,kDAAkE;AAClE,2CAA6D;AAEpD,qGAFU,gCAAoB,OAEV;AAE7B,yGAAyG;AACzG,MAAM,gBAAgB,GACpB,OAAO,CAAC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CAAC,EAAE,UAAU,EAAE,CAAC;KACrC,CAAC,EACF,sCAAsC,MAAM,GAAG,CAChD,CAAC;IACF,MAAM,GAAG,GAAG,CAAC,MAAM,GAAG,CAAC,IAAI,EAAE,CAAwB,CAAC;IACtD,OAAO,eAAe,CAAC,GAAG,CAAC,CAAC;AAC9B,CAAC;AAED;;;;GAIG;AACH,KAAK,UAAU,UAAU,CACvB,MAAc,EACd,YAAuB,IAAA,2BAAgB,GAAE,EACzC,OAAO,GAAG,gBAAgB;IAE1B,MAAM,GAAG,GAAG,MAAM,SAAS,CAAC,KAAK,CAC/B,GAAG,OAAO,IAAI,kBAAkB,CAAC,MAAM,CAAC,EAAE,EAC1C,EAAE,MAAM,EAAE,QAAQ,EAAE,CACrB,CAAC;IACF,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC;QACZ,MAAM,IAAI,GAAG,MAAM,GAAG,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC;QAC9C,IAAI,MAAe,CAAC;QACpB,IAAI,CAAC;YACH,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAC5B,CAAC;QAAC,MAAM,CAAC;YACP,MAAM,GAAG,IAAI,CAAC;QAChB,CAAC;QACD,MAAM,IAAI,gCAAoB,CAC5B,0BAA0B,MAAM,MAAM,GAAG,CAAC,MAAM,IAAI,IAAI,EAAE,EAC1D,GAAG,CAAC,MAAM,EACV,MAAM,CACP,CAAC;IACJ,CAAC;IACD,qCAAqC;AACvC,CAAC"}
@@ -2,8 +2,8 @@
2
2
  * `@sapiom/tools` — the typed Sapiom capability client.
3
3
  *
4
4
  * The same catalog your agents call over MCP, callable from code. Capabilities are
5
- * namespaces (`sandboxes`, `repositories`, `agent`, … ), importable from the barrel
6
- * or a subpath:
5
+ * namespaces (`sandboxes`, `repositories`, `agent`, `fileStorage`, … ), importable
6
+ * from the barrel or a subpath:
7
7
  *
8
8
  * import { sandboxes } from "@sapiom/tools";
9
9
  * import { sandboxes } from "@sapiom/tools/sandboxes";
@@ -21,4 +21,6 @@ export * as repositories from "./repositories/index.js";
21
21
  export { Repository } from "./repositories/index.js";
22
22
  export * as agent from "./agent/index.js";
23
23
  export { CODING_RESULT_SIGNAL } from "./agent/index.js";
24
+ export * as fileStorage from "./file-storage/index.js";
25
+ export { FileStorageHttpError } from "./file-storage/index.js";
24
26
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAChE,YAAY,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAC1C,YAAY,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAIvE,YAAY,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAEpD,OAAO,KAAK,SAAS,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAE/C,OAAO,KAAK,YAAY,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAErD,OAAO,KAAK,KAAK,MAAM,kBAAkB,CAAC;AAE1C,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAChE,YAAY,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAC1C,YAAY,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAIvE,YAAY,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAEpD,OAAO,KAAK,SAAS,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAE/C,OAAO,KAAK,YAAY,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAErD,OAAO,KAAK,KAAK,MAAM,kBAAkB,CAAC;AAE1C,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAExD,OAAO,KAAK,WAAW,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC"}
package/dist/cjs/index.js CHANGED
@@ -33,13 +33,13 @@ var __importStar = (this && this.__importStar) || (function () {
33
33
  };
34
34
  })();
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.CODING_RESULT_SIGNAL = exports.agent = exports.Repository = exports.repositories = exports.Sandbox = exports.sandboxes = exports.createClientFromEnv = exports.createClient = void 0;
36
+ exports.FileStorageHttpError = exports.fileStorage = exports.CODING_RESULT_SIGNAL = exports.agent = exports.Repository = exports.repositories = exports.Sandbox = exports.sandboxes = exports.createClientFromEnv = exports.createClient = void 0;
37
37
  /**
38
38
  * `@sapiom/tools` — the typed Sapiom capability client.
39
39
  *
40
40
  * The same catalog your agents call over MCP, callable from code. Capabilities are
41
- * namespaces (`sandboxes`, `repositories`, `agent`, … ), importable from the barrel
42
- * or a subpath:
41
+ * namespaces (`sandboxes`, `repositories`, `agent`, `fileStorage`, … ), importable
42
+ * from the barrel or a subpath:
43
43
  *
44
44
  * import { sandboxes } from "@sapiom/tools";
45
45
  * import { sandboxes } from "@sapiom/tools/sandboxes";
@@ -60,4 +60,7 @@ exports.agent = __importStar(require("./agent/index.js"));
60
60
  // Surfaced top-level for the static `pause: { signal }` decl on a workflow step.
61
61
  var index_js_3 = require("./agent/index.js");
62
62
  Object.defineProperty(exports, "CODING_RESULT_SIGNAL", { enumerable: true, get: function () { return index_js_3.CODING_RESULT_SIGNAL; } });
63
+ exports.fileStorage = __importStar(require("./file-storage/index.js"));
64
+ var index_js_4 = require("./file-storage/index.js");
65
+ Object.defineProperty(exports, "FileStorageHttpError", { enumerable: true, get: function () { return index_js_4.FileStorageHttpError; } });
63
66
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;GAYG;AACH,yCAAgE;AAAvD,yGAAA,YAAY,OAAA;AAAE,gHAAA,mBAAmB,OAAA;AAQ1C,kEAAkD;AAClD,iDAA+C;AAAtC,mGAAA,OAAO,OAAA;AAEhB,wEAAwD;AACxD,oDAAqD;AAA5C,sGAAA,UAAU,OAAA;AAEnB,0DAA0C;AAC1C,iFAAiF;AACjF,6CAAwD;AAA/C,gHAAA,oBAAoB,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;GAYG;AACH,yCAAgE;AAAvD,yGAAA,YAAY,OAAA;AAAE,gHAAA,mBAAmB,OAAA;AAQ1C,kEAAkD;AAClD,iDAA+C;AAAtC,mGAAA,OAAO,OAAA;AAEhB,wEAAwD;AACxD,oDAAqD;AAA5C,sGAAA,UAAU,OAAA;AAEnB,0DAA0C;AAC1C,iFAAiF;AACjF,6CAAwD;AAA/C,gHAAA,oBAAoB,OAAA;AAE7B,uEAAuD;AACvD,oDAA+D;AAAtD,gHAAA,oBAAoB,OAAA"}
@@ -1,27 +1,21 @@
1
1
  /**
2
2
  * `repositories` capability — in-network git repos: create, get, list, delete, and
3
- * the first cross-capability mesh method, `repo.pushFromSandbox(sandbox)`.
3
+ * `repo.pushFromSandbox(sandbox)` to commit + push a sandbox checkout.
4
4
  *
5
5
  * import { repositories } from "@sapiom/tools";
6
6
  * const repo = await repositories.create("my-app");
7
7
  * // … an agent or your code writes files in a sandbox checkout of the repo …
8
8
  * await repo.pushFromSandbox(box, { message: "build: page" });
9
- *
10
- * `pushFromSandbox` is the deterministic counterpart to a fuzzy agent step: it
11
- * composes the `sandboxes` capability (calls `sandbox.exec`) to commit + push the
12
- * repo's working tree. It references the `Sandbox` TYPE only — no module cycle.
13
- *
14
- * Note: `cloneUrl` is the unauthenticated origin. The gateway authenticates clones
15
- * via basic-auth (the `auth` block returned by create); inside an agent run the
16
- * `gitRepository` auto-clone wires that credential into the in-sandbox origin, so
17
- * `pushFromSandbox` doesn't need it.
18
9
  */
19
10
  import { Transport } from "../_client/index.js";
20
11
  import type { Sandbox } from "../sandboxes/index.js";
21
12
  export interface PushResult {
22
- /** False when there was nothing to commit. */
13
+ /** True once your work has been pushed to the repo. */
23
14
  pushed: boolean;
15
+ /** The pushed commit SHA, when available. */
24
16
  sha: string | null;
17
+ /** The branch it was pushed to, when available. */
18
+ branch?: string | null;
25
19
  }
26
20
  /** A connected in-network repository. */
27
21
  export declare class Repository {
@@ -41,13 +35,17 @@ export declare class Repository {
41
35
  /** Delete this repository. */
42
36
  delete(): Promise<void>;
43
37
  /**
44
- * Deterministically stage + commit + push this repo's working tree FROM a
45
- * sandbox checkout (no LLM). Assumes the repo is checked out at the canonical
46
- * `/workspace/<slug>` with an authenticated `origin` (which the agent's
47
- * `gitRepository` auto-clone sets up). No-op when there's nothing to commit.
38
+ * Commit and push this repo's working tree from a sandbox checkout. Commits any
39
+ * pending changes and pushes the current commit, so the agent's work is
40
+ * published whether it left changes uncommitted, already committed them, or
41
+ * both. Returns `{ pushed, sha, branch }`; throws if the push fails.
42
+ *
43
+ * `workingDirectory` defaults to the repo's checkout at `/workspace/<slug>`
44
+ * (where a coding agent run with `gitRepository: repo` clones it).
48
45
  */
49
46
  pushFromSandbox(sandbox: Sandbox, opts?: {
50
47
  message?: string;
48
+ workingDirectory?: string;
51
49
  }): Promise<PushResult>;
52
50
  }
53
51
  export declare function create(slug: string): Promise<Repository>;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/repositories/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,EAAE,SAAS,EAAoB,MAAM,qBAAqB,CAAC;AAClE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AA6BrD,MAAM,WAAW,UAAU;IACzB,8CAA8C;IAC9C,MAAM,EAAE,OAAO,CAAC;IAChB,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;CACpB;AAED,yCAAyC;AACzC,qBAAa,UAAU;IACrB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,8DAA8D;IAC9D,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAExB,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAY;IACtC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;IAEjC,OAAO;WAYM,MAAM,CACjB,IAAI,EAAE,MAAM,EACZ,SAAS,GAAE,SAA8B,EACzC,OAAO,SAAmB,GACzB,OAAO,CAAC,UAAU,CAAC;WAgBT,GAAG,CACd,IAAI,EAAE,MAAM,EACZ,SAAS,GAAE,SAA8B,EACzC,OAAO,SAAmB,GACzB,OAAO,CAAC,UAAU,CAAC;WAOT,IAAI,CACf,SAAS,GAAE,SAA8B,EACzC,OAAO,SAAmB,GACzB,OAAO,CAAC,UAAU,EAAE,CAAC;WAOX,MAAM,CACjB,IAAI,EAAE,MAAM,EACZ,SAAS,GAAE,SAA8B,EACzC,OAAO,SAAmB,GACzB,OAAO,CAAC,IAAI,CAAC;IAQhB,qFAAqF;IACrF,MAAM,CAAC,MAAM,CACX,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,EAChB,SAAS,GAAE,SAA8B,EACzC,OAAO,SAAmB,GACzB,UAAU;IAQb,8BA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