@burdenoff/fe-libs 2026.1007.6 → 2026.1008.2

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 (39) hide show
  1. package/dist/shared/assistant/attachmentCommit.d.ts +175 -0
  2. package/dist/shared/assistant/attachmentCommit.d.ts.map +1 -0
  3. package/dist/shared/assistant/attachmentCommit.js +638 -0
  4. package/dist/shared/assistant/attachments.d.ts +39 -19
  5. package/dist/shared/assistant/attachments.d.ts.map +1 -1
  6. package/dist/shared/assistant/history/historyEngine.js +280 -280
  7. package/dist/shared/assistant/i18nManifest.d.ts +14 -2
  8. package/dist/shared/assistant/i18nManifest.d.ts.map +1 -1
  9. package/dist/shared/assistant/i18nManifest.js +17 -3
  10. package/dist/shared/assistant/index.d.ts +3 -0
  11. package/dist/shared/assistant/index.d.ts.map +1 -1
  12. package/dist/shared/assistant/ui/AssistantChatArea.d.ts.map +1 -1
  13. package/dist/shared/assistant/ui/AssistantChatArea.js +1390 -1371
  14. package/dist/shared/assistant/ui/composer/AssistantAttachmentChips.d.ts +8 -5
  15. package/dist/shared/assistant/ui/composer/AssistantAttachmentChips.d.ts.map +1 -1
  16. package/dist/shared/assistant/ui/composer/AssistantAttachmentChips.js +26 -9
  17. package/dist/shared/assistant/ui/composer/AssistantComposer.d.ts +3 -2
  18. package/dist/shared/assistant/ui/composer/AssistantComposer.d.ts.map +1 -1
  19. package/dist/shared/assistant/ui/composer/AssistantComposer.js +214 -125
  20. package/dist/shared/assistant/ui/voice/AssistantVoiceSession.d.ts +10 -0
  21. package/dist/shared/assistant/ui/voice/AssistantVoiceSession.d.ts.map +1 -1
  22. package/dist/shared/assistant/ui/voice/AssistantVoiceSession.js +124 -116
  23. package/dist/shared/assistant/useAssistantAttachments.d.ts +20 -2
  24. package/dist/shared/assistant/useAssistantAttachments.d.ts.map +1 -1
  25. package/dist/shared/assistant/useAssistantAttachments.js +146 -202
  26. package/dist/shared/assistant/useAttachmentCommitter.d.ts +17 -0
  27. package/dist/shared/assistant/useAttachmentCommitter.d.ts.map +1 -0
  28. package/dist/shared/assistant/useAttachmentCommitter.js +41 -0
  29. package/dist/shared/assistant/voiceCommit.d.ts +36 -0
  30. package/dist/shared/assistant/voiceCommit.d.ts.map +1 -0
  31. package/dist/shared/assistant/voiceCommit.js +24 -0
  32. package/dist/shared-assistant.js +161 -158
  33. package/dist/storage/filesPort.d.ts +120 -0
  34. package/dist/storage/filesPort.d.ts.map +1 -0
  35. package/dist/storage/filesPort.js +269 -0
  36. package/dist/storage/index.d.ts +2 -0
  37. package/dist/storage/index.d.ts.map +1 -1
  38. package/dist/storage/index.js +9 -8
  39. package/package.json +1 -1
@@ -0,0 +1,120 @@
1
+ import { ApolloClient } from '@apollo/client';
2
+ import { FilesRetryKind } from './retryPolicy';
3
+ /** The quota a `completeUpload` is metered against. */
4
+ export declare const FILES_STORAGE_QUOTA_NAME = "platform.files.storage_bytes";
5
+ /** The step a {@link FilesPortError} came from. */
6
+ export type FilesPortOperation = 'ensureFolder' | 'initiate' | 'put' | 'complete' | 'getSession' | 'listSessions' | 'abort' | 'getDownloadUrl' | 'deleteFile' | 'getStorageQuota';
7
+ /**
8
+ * A failed port call. `message` is the server's own reason when there is one (never a
9
+ * generic sentence that blames the wrong culprit); `source` is the raw in-band error
10
+ * for classification.
11
+ */
12
+ export declare class FilesPortError extends Error {
13
+ readonly operation: FilesPortOperation;
14
+ /** The raw in-band Apollo error (or `{ statusCode }` for a failed PUT). */
15
+ readonly source: unknown;
16
+ /** HTTP status of a failed PUT; undefined for every GraphQL operation. */
17
+ readonly httpStatus?: number | undefined;
18
+ constructor(operation: FilesPortOperation, message: string,
19
+ /** The raw in-band Apollo error (or `{ statusCode }` for a failed PUT). */
20
+ source: unknown,
21
+ /** HTTP status of a failed PUT; undefined for every GraphQL operation. */
22
+ httpStatus?: number | undefined);
23
+ /** Cold start / transient blip / null (an answer, not an outage). */
24
+ get retryKind(): FilesRetryKind | null;
25
+ }
26
+ /** Thrown by {@link FilesPort.put} when its signal aborts the transfer. */
27
+ export declare class FilesPortAbortError extends Error {
28
+ constructor();
29
+ }
30
+ export interface FilesFolder {
31
+ id: string;
32
+ path: string | null;
33
+ }
34
+ export interface InitiateUploadParams {
35
+ fileName: string;
36
+ fileSize: number;
37
+ mimeType: string;
38
+ extension: string;
39
+ /** Omit to stage bytes with no folder; `completeUpload` may then carry the folder. */
40
+ folderId?: string | null;
41
+ }
42
+ export interface InitiatedUpload {
43
+ sessionId: string;
44
+ /** Null for a MULTIPART session (files over 5 MiB): this port cannot upload those. */
45
+ uploadUrl: string | null;
46
+ uploadType: string | null;
47
+ }
48
+ export interface CompleteUploadParams {
49
+ sessionId: string;
50
+ fileSize: number;
51
+ folderId?: string | null;
52
+ }
53
+ export interface CompletedUpload {
54
+ fileId: string;
55
+ name: string | null;
56
+ folderId: string | null;
57
+ /** Present when the server selected it; callers fall back to {@link FilesPort.getDownloadUrl}. */
58
+ downloadUrl: string | null;
59
+ }
60
+ export interface UploadSessionInfo {
61
+ id: string;
62
+ /** 'IN_PROGRESS' | 'FINALIZED' | 'ABORTED' | 'EXPIRED' ... as the server spells it. */
63
+ status: string;
64
+ fileId: string | null;
65
+ }
66
+ export interface PutParams {
67
+ url: string;
68
+ blob: Blob;
69
+ mimeType: string;
70
+ /** 0..1 of the transfer. */
71
+ onProgress?: (fraction: number) => void;
72
+ signal?: AbortSignal;
73
+ }
74
+ export type StorageQuotaState =
75
+ /** The lookup was not possible or not conclusive: callers must carry on and let the real call decide. */
76
+ {
77
+ state: 'unknown';
78
+ }
79
+ /**
80
+ * `checkWorkspaceQuota` found no active assignment (and no test entitlement) for the storage
81
+ * quota: `completeUpload` is refused with QUOTA_NOT_PROVISIONED.
82
+ */
83
+ | {
84
+ state: 'not-provisioned';
85
+ }
86
+ /**
87
+ * Provisioned. `remainingBytes` is the capacity left BEFORE this commit (`limitLeft`), or null
88
+ * when unlimited. An exhausted quota is `ok` with 0 left: the commit's own size comparison
89
+ * then refuses with QUOTA_EXCEEDED.
90
+ */
91
+ | {
92
+ state: 'ok';
93
+ remainingBytes: number | null;
94
+ };
95
+ export interface FilesPort {
96
+ ensureFolder(path: string): Promise<FilesFolder>;
97
+ initiate(params: InitiateUploadParams): Promise<InitiatedUpload>;
98
+ put(params: PutParams): Promise<void>;
99
+ complete(params: CompleteUploadParams): Promise<CompletedUpload>;
100
+ /** Null when the server has no such session (or it is not the caller's). */
101
+ getSession(sessionId: string): Promise<UploadSessionInfo | null>;
102
+ /** The caller's recent sessions: the reconcile fallback when `getSession` is unavailable. */
103
+ listSessions(): Promise<UploadSessionInfo[]>;
104
+ abort(sessionId: string): Promise<boolean>;
105
+ getDownloadUrl(fileId: string): Promise<string | null>;
106
+ /** Hard delete (row, object, usage decrement). */
107
+ deleteFile(fileId: string): Promise<boolean>;
108
+ /** Optional: a read-only look at the storage quota so a doomed commit can fail before it creates anything. */
109
+ getStorageQuota?(): Promise<StorageQuotaState>;
110
+ }
111
+ /** The Apollo surface the adapter needs: narrow, so it is trivial to fake. */
112
+ export type FilesPortClient = Pick<ApolloClient, 'mutate' | 'query'>;
113
+ export interface ApolloFilesPortOptions {
114
+ /** Current workspace id, for the quota read. Without it `getStorageQuota` is omitted. */
115
+ getWorkspaceId?: () => string;
116
+ /** Test seam: the XHR constructor (defaults to the global). */
117
+ xhr?: () => XMLHttpRequest;
118
+ }
119
+ export declare function createApolloFilesPort(client: FilesPortClient, options?: ApolloFilesPortOptions): FilesPort;
120
+ //# sourceMappingURL=filesPort.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"filesPort.d.ts","sourceRoot":"","sources":["../../src/storage/filesPort.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAExD,OAAO,EAA2C,KAAK,cAAc,EAAE,MAAM,eAAe,CAAC;AAiH7F,uDAAuD;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4E;IAC5E,UAAU,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAAC;IACjE,6FAA6F;IAC7F,YAAY,IAAI,OAAO,CAAC,iBAAiB,EAAE,CAAC,CAAC;IAC7C,KAAK,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAC3C,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IACvD,kDAAkD;IAClD,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAC7C,8GAA8G;IAC9G,eAAe,CAAC,IAAI,OAAO,CAAC,iBAAiB,CAAC,CAAC;CAChD;AAID,8EAA8E;AAC9E,MAAM,MAAM,eAAe,GAAG,IAAI,CAAC,YAAY,EAAE,QAAQ,GAAG,OAAO,CAAC,CAAC;AAErE,MAAM,WAAW,sBAAsB;IACrC,yFAAyF;IACzF,cAAc,CAAC,EAAE,MAAM,MAAM,CAAC;IAC9B,+DAA+D;IAC/D,GAAG,CAAC,EAAE,MAAM,cAAc,CAAC;CAC5B;AAgDD,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,eAAe,EACvB,OAAO,GAAE,sBAA2B,GACnC,SAAS,CA+KX"}
@@ -0,0 +1,269 @@
1
+ import { classifyFilesError as e, extractErrorMessage as t } from "./retryPolicy.js";
2
+ import { FILES_AFTER_SAVE_REFETCH as n } from "./uploadBlob.js";
3
+ import { gql as r } from "@apollo/client";
4
+ //#region src/storage/filesPort.ts
5
+ var i = r`
6
+ mutation SaveToFiles_EnsureFolderByPath($path: String!) {
7
+ ensureFolderByPath(path: $path) {
8
+ id
9
+ name
10
+ path
11
+ }
12
+ }
13
+ `, a = r`
14
+ mutation SaveToFiles_InitiateUpload($input: InitiateUploadInput!) {
15
+ initiateUpload(input: $input) {
16
+ session {
17
+ id
18
+ status
19
+ fileId
20
+ uploadType
21
+ }
22
+ uploadUrl
23
+ }
24
+ }
25
+ `, o = r`
26
+ mutation SaveToFiles_CompleteUpload($input: CompleteUploadInput!) {
27
+ completeUpload(input: $input) {
28
+ fileId
29
+ file {
30
+ id
31
+ name
32
+ folderId
33
+ downloadUrl
34
+ }
35
+ session {
36
+ id
37
+ status
38
+ fileId
39
+ }
40
+ }
41
+ }
42
+ `, s = r`
43
+ query SaveToFiles_GetUploadSession($id: ID!) {
44
+ getUploadSession(sessionId: $id) {
45
+ id
46
+ status
47
+ fileId
48
+ }
49
+ }
50
+ `, c = r`
51
+ query SaveToFiles_GetMyUploadSessions {
52
+ getMyUploadSessions(pagination: { limit: 100 }) {
53
+ total
54
+ sessions {
55
+ id
56
+ status
57
+ fileId
58
+ }
59
+ }
60
+ }
61
+ `, l = r`
62
+ mutation SaveToFiles_AbortUpload($id: ID!) {
63
+ abortUpload(sessionId: $id)
64
+ }
65
+ `, u = r`
66
+ mutation SaveToFiles_PermanentlyDeleteFile($id: ID!) {
67
+ permanentlyDeleteFile(id: $id)
68
+ }
69
+ `, d = r`
70
+ query AssistantAttachmentUrl($id: ID!) {
71
+ getFileDownloadUrl(id: $id)
72
+ }
73
+ `, f = r`
74
+ query SaveToFiles_CheckWorkspaceQuota($workspaceId: ID!, $quotaName: String!, $amount: Float) {
75
+ checkWorkspaceQuota(workspaceId: $workspaceId, quotaName: $quotaName, amount: $amount) {
76
+ allowed
77
+ assignmentId
78
+ limitLeft
79
+ noLimit
80
+ }
81
+ }
82
+ `, p = "platform.files.storage_bytes", m = class extends Error {
83
+ operation;
84
+ source;
85
+ httpStatus;
86
+ constructor(e, t, n, r) {
87
+ super(t), this.operation = e, this.source = n, this.httpStatus = r, this.name = "FilesPortError";
88
+ }
89
+ get retryKind() {
90
+ return e(this.source);
91
+ }
92
+ }, h = class extends Error {
93
+ constructor() {
94
+ super("Upload PUT aborted"), this.name = "AbortError";
95
+ }
96
+ };
97
+ function g(e, n, r) {
98
+ if (n.error) throw new m(e, t(n.error) ?? r, n.error);
99
+ }
100
+ function _(e) {
101
+ if (typeof e == "number" && Number.isFinite(e)) return e;
102
+ if (typeof e == "string" && e.trim() !== "") {
103
+ let t = Number(e);
104
+ return Number.isFinite(t) ? t : null;
105
+ }
106
+ return null;
107
+ }
108
+ function v(e) {
109
+ if (typeof e != "object" || !e) return { state: "unknown" };
110
+ let { allowed: t, assignmentId: n, limitLeft: r, noLimit: i } = e;
111
+ if (i === !0) return {
112
+ state: "ok",
113
+ remainingBytes: null
114
+ };
115
+ if (n === null) return { state: "not-provisioned" };
116
+ if (typeof n != "string" || typeof t != "boolean") return { state: "unknown" };
117
+ let a = _(r);
118
+ return a === null ? { state: "unknown" } : {
119
+ state: "ok",
120
+ remainingBytes: Math.max(0, a)
121
+ };
122
+ }
123
+ function y(e, t = {}) {
124
+ let r = {
125
+ async ensureFolder(t) {
126
+ let n = await e.mutate({
127
+ mutation: i,
128
+ variables: { path: t }
129
+ });
130
+ g("ensureFolder", n, `Could not resolve folder for path: ${t}`);
131
+ let r = n.data?.ensureFolderByPath;
132
+ if (!r?.id) throw new m("ensureFolder", `Could not resolve folder for path: ${t}`, void 0);
133
+ return {
134
+ id: r.id,
135
+ path: r.path ?? null
136
+ };
137
+ },
138
+ async initiate(t) {
139
+ let n = await e.mutate({
140
+ mutation: a,
141
+ variables: { input: {
142
+ fileName: t.fileName,
143
+ fileSize: String(t.fileSize),
144
+ mimeType: t.mimeType,
145
+ extension: t.extension,
146
+ ...t.folderId ? { folderId: t.folderId } : {}
147
+ } }
148
+ });
149
+ g("initiate", n, "initiateUpload did not return a session");
150
+ let r = n.data?.initiateUpload;
151
+ if (!r?.session?.id) throw new m("initiate", "initiateUpload did not return a session", void 0);
152
+ return {
153
+ sessionId: r.session.id,
154
+ uploadUrl: r.uploadUrl ?? null,
155
+ uploadType: r.session.uploadType ?? null
156
+ };
157
+ },
158
+ put(e) {
159
+ return b(e, t.xhr ?? (() => new XMLHttpRequest()));
160
+ },
161
+ async complete(t) {
162
+ let r = await e.mutate({
163
+ mutation: o,
164
+ variables: { input: {
165
+ sessionId: t.sessionId,
166
+ fileSize: String(t.fileSize),
167
+ ...t.folderId ? { folderId: t.folderId } : {}
168
+ } },
169
+ refetchQueries: n
170
+ });
171
+ g("complete", r, "completeUpload did not return a file");
172
+ let i = r.data?.completeUpload, a = i?.file?.id ?? i?.fileId ?? i?.session?.fileId ?? null;
173
+ if (!a) throw new m("complete", "completeUpload did not return a file", void 0);
174
+ return {
175
+ fileId: a,
176
+ name: i?.file?.name ?? null,
177
+ folderId: i?.file?.folderId ?? null,
178
+ downloadUrl: i?.file?.downloadUrl ?? null
179
+ };
180
+ },
181
+ async getSession(t) {
182
+ let n = await e.query({
183
+ query: s,
184
+ variables: { id: t },
185
+ fetchPolicy: "no-cache"
186
+ });
187
+ g("getSession", n, "getUploadSession failed");
188
+ let r = n.data?.getUploadSession;
189
+ return r ? {
190
+ id: r.id,
191
+ status: r.status,
192
+ fileId: r.fileId ?? null
193
+ } : null;
194
+ },
195
+ async listSessions() {
196
+ let t = await e.query({
197
+ query: c,
198
+ fetchPolicy: "no-cache"
199
+ });
200
+ return g("listSessions", t, "getMyUploadSessions failed"), (t.data?.getMyUploadSessions?.sessions ?? []).map((e) => ({
201
+ id: e.id,
202
+ status: e.status,
203
+ fileId: e.fileId ?? null
204
+ }));
205
+ },
206
+ async abort(t) {
207
+ let n = await e.mutate({
208
+ mutation: l,
209
+ variables: { id: t }
210
+ });
211
+ return g("abort", n, "abortUpload failed"), n.data?.abortUpload === !0;
212
+ },
213
+ async getDownloadUrl(t) {
214
+ let n = await e.query({
215
+ query: d,
216
+ variables: { id: t },
217
+ fetchPolicy: "no-cache"
218
+ });
219
+ return g("getDownloadUrl", n, "getFileDownloadUrl failed"), n.data?.getFileDownloadUrl ?? null;
220
+ },
221
+ async deleteFile(t) {
222
+ let r = await e.mutate({
223
+ mutation: u,
224
+ variables: { id: t },
225
+ refetchQueries: n
226
+ });
227
+ return g("deleteFile", r, "permanentlyDeleteFile failed"), r.data?.permanentlyDeleteFile === !0;
228
+ }
229
+ }, h = t.getWorkspaceId;
230
+ return h && (r.getStorageQuota = async () => {
231
+ let t = h();
232
+ if (!t) return { state: "unknown" };
233
+ try {
234
+ let n = await e.query({
235
+ query: f,
236
+ variables: {
237
+ workspaceId: t,
238
+ quotaName: p,
239
+ amount: 0
240
+ },
241
+ fetchPolicy: "no-cache"
242
+ });
243
+ return n.error ? { state: "unknown" } : v(n.data?.checkWorkspaceQuota);
244
+ } catch {
245
+ return { state: "unknown" };
246
+ }
247
+ }), r;
248
+ }
249
+ function b(e, t) {
250
+ let { url: n, blob: r, mimeType: i, onProgress: a, signal: o } = e;
251
+ return new Promise((e, s) => {
252
+ if (o?.aborted) {
253
+ s(new h());
254
+ return;
255
+ }
256
+ let c = t(), l = () => c.abort(), u = () => o?.removeEventListener("abort", l);
257
+ o?.addEventListener("abort", l, { once: !0 }), c.upload.addEventListener("progress", (e) => {
258
+ e.lengthComputable && e.total > 0 && a?.(e.loaded / e.total);
259
+ }), c.addEventListener("load", () => {
260
+ u(), c.status >= 200 && c.status < 300 ? (a?.(1), e()) : s(new m("put", `Upload PUT failed with status ${c.status}`, { statusCode: c.status }, c.status));
261
+ }), c.addEventListener("error", () => {
262
+ u(), s(new m("put", "Upload PUT network error", { networkError: /* @__PURE__ */ Error("PUT") }));
263
+ }), c.addEventListener("abort", () => {
264
+ u(), s(new h());
265
+ }), c.open("PUT", n), c.setRequestHeader("Content-Type", i), c.send(r);
266
+ });
267
+ }
268
+ //#endregion
269
+ export { p as FILES_STORAGE_QUOTA_NAME, h as FilesPortAbortError, m as FilesPortError, y as createApolloFilesPort };
@@ -10,4 +10,6 @@ export type { UploadBlobParams, UploadedFile, SaveToFilesStep, SaveToFilesRetryN
10
10
  export { classifyFilesError, decideFilesRetry, runWithFilesRetry, COLD_START_MAX_ATTEMPTS, COLD_START_RETRY_DELAYS_MS, COLD_START_RETRY_BUDGET_MS, } from './retryPolicy';
11
11
  export type { FilesRetryKind, FilesRetryDecision, FilesRetryNotice, FilesRetryContext, } from './retryPolicy';
12
12
  export { warmFilesService, useFilesServiceWarmup, FILES_WARMUP_COOLDOWN_MS, } from './warmFilesService';
13
+ export { createApolloFilesPort, FilesPortError, FilesPortAbortError, FILES_STORAGE_QUOTA_NAME, } from './filesPort';
14
+ export type { FilesPort, FilesPortClient, FilesPortOperation, ApolloFilesPortOptions, FilesFolder, InitiateUploadParams, InitiatedUpload, CompleteUploadParams, CompletedUpload, UploadSessionInfo, PutParams, StorageQuotaState, } from './filesPort';
13
15
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/storage/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,YAAY,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,YAAY,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,YAAY,EAAE,SAAS,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AACxE,OAAO,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AAC3E,YAAY,EACV,gBAAgB,EAChB,YAAY,EACZ,eAAe,EACf,sBAAsB,GACvB,MAAM,cAAc,CAAC;AAItB,OAAO,EACL,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB,EACjB,uBAAuB,EACvB,0BAA0B,EAC1B,0BAA0B,GAC3B,MAAM,eAAe,CAAC;AACvB,YAAY,EACV,cAAc,EACd,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB,GAClB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,gBAAgB,EAChB,qBAAqB,EACrB,wBAAwB,GACzB,MAAM,oBAAoB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/storage/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,YAAY,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,YAAY,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,YAAY,EAAE,SAAS,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AACxE,OAAO,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AAC3E,YAAY,EACV,gBAAgB,EAChB,YAAY,EACZ,eAAe,EACf,sBAAsB,GACvB,MAAM,cAAc,CAAC;AAItB,OAAO,EACL,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB,EACjB,uBAAuB,EACvB,0BAA0B,EAC1B,0BAA0B,GAC3B,MAAM,eAAe,CAAC;AACvB,YAAY,EACV,cAAc,EACd,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB,GAClB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,gBAAgB,EAChB,qBAAqB,EACrB,wBAAwB,GACzB,MAAM,oBAAoB,CAAC;AAI5B,OAAO,EACL,qBAAqB,EACrB,cAAc,EACd,mBAAmB,EACnB,wBAAwB,GACzB,MAAM,aAAa,CAAC;AACrB,YAAY,EACV,SAAS,EACT,eAAe,EACf,kBAAkB,EAClB,sBAAsB,EACtB,WAAW,EACX,oBAAoB,EACpB,eAAe,EACf,oBAAoB,EACpB,eAAe,EACf,iBAAiB,EACjB,SAAS,EACT,iBAAiB,GAClB,MAAM,aAAa,CAAC"}
@@ -1,8 +1,9 @@
1
- import { StorageFolderPicker as e } from "./StorageFolderPicker.js";
2
- import { COLD_START_MAX_ATTEMPTS as t, COLD_START_RETRY_BUDGET_MS as n, COLD_START_RETRY_DELAYS_MS as r, classifyFilesError as i, decideFilesRetry as a, runWithFilesRetry as o } from "./retryPolicy.js";
3
- import { FILES_AFTER_SAVE_REFETCH as s, uploadBlobToFiles as c } from "./uploadBlob.js";
4
- import { useSaveToFiles as l } from "./useSaveToFiles.js";
5
- import { SaveToFilesDialog as u } from "./SaveToFilesDialog.js";
6
- import { SaveToFilesButton as d } from "./SaveToFilesButton.js";
7
- import { FILES_WARMUP_COOLDOWN_MS as f, useFilesServiceWarmup as p, warmFilesService as m } from "./warmFilesService.js";
8
- export { t as COLD_START_MAX_ATTEMPTS, n as COLD_START_RETRY_BUDGET_MS, r as COLD_START_RETRY_DELAYS_MS, s as FILES_AFTER_SAVE_REFETCH, f as FILES_WARMUP_COOLDOWN_MS, d as SaveToFilesButton, u as SaveToFilesDialog, e as StorageFolderPicker, i as classifyFilesError, a as decideFilesRetry, o as runWithFilesRetry, c as uploadBlobToFiles, p as useFilesServiceWarmup, l as useSaveToFiles, m as warmFilesService };
1
+ import { COLD_START_MAX_ATTEMPTS as e, COLD_START_RETRY_BUDGET_MS as t, COLD_START_RETRY_DELAYS_MS as n, classifyFilesError as r, decideFilesRetry as i, runWithFilesRetry as a } from "./retryPolicy.js";
2
+ import { FILES_AFTER_SAVE_REFETCH as o, uploadBlobToFiles as s } from "./uploadBlob.js";
3
+ import { FILES_STORAGE_QUOTA_NAME as c, FilesPortAbortError as l, FilesPortError as u, createApolloFilesPort as d } from "./filesPort.js";
4
+ import { StorageFolderPicker as f } from "./StorageFolderPicker.js";
5
+ import { useSaveToFiles as p } from "./useSaveToFiles.js";
6
+ import { SaveToFilesDialog as m } from "./SaveToFilesDialog.js";
7
+ import { SaveToFilesButton as h } from "./SaveToFilesButton.js";
8
+ import { FILES_WARMUP_COOLDOWN_MS as g, useFilesServiceWarmup as _, warmFilesService as v } from "./warmFilesService.js";
9
+ export { e as COLD_START_MAX_ATTEMPTS, t as COLD_START_RETRY_BUDGET_MS, n as COLD_START_RETRY_DELAYS_MS, o as FILES_AFTER_SAVE_REFETCH, c as FILES_STORAGE_QUOTA_NAME, g as FILES_WARMUP_COOLDOWN_MS, l as FilesPortAbortError, u as FilesPortError, h as SaveToFilesButton, m as SaveToFilesDialog, f as StorageFolderPicker, r as classifyFilesError, d as createApolloFilesPort, i as decideFilesRetry, a as runWithFilesRetry, s as uploadBlobToFiles, _ as useFilesServiceWarmup, p as useSaveToFiles, v as warmFilesService };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@burdenoff/fe-libs",
3
- "version": "2026.1007.6",
3
+ "version": "2026.1008.2",
4
4
  "description": "Burdenoff frontend primitives and domain libraries",
5
5
  "type": "module",
6
6
  "bin": {