@epam/ai-dial-chat-hooks 1.1.0-dev.322 → 1.1.0-dev.331
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/conversation/conversation-transfer/progress.d.ts +60 -0
- package/conversation/conversation-transfer/progress.d.ts.map +1 -0
- package/conversation/conversation-transfer/queue.d.ts +28 -5
- package/conversation/conversation-transfer/queue.d.ts.map +1 -1
- package/conversation/conversation-transfer/types.d.ts +2 -12
- package/conversation/conversation-transfer/types.d.ts.map +1 -1
- package/conversation/useConversationExport/useConversationExport.d.ts +26 -5
- package/conversation/useConversationExport/useConversationExport.d.ts.map +1 -1
- package/conversation/useConversationImport/useConversationImport.d.ts +3 -1
- package/conversation/useConversationImport/useConversationImport.d.ts.map +1 -1
- package/conversation/useConversationStream/useConversationStream.d.ts +2 -0
- package/conversation/useConversationStream/useConversationStream.d.ts.map +1 -1
- package/index.js +2563 -2403
- package/package.json +14 -14
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { ConversationTransferProgress, ConversationTransferProgressUnits } from '@epam/ai-dial-chat-shared';
|
|
2
|
+
/**
|
|
3
|
+
* The three stages every transfer job moves through. `Transfer` is the only
|
|
4
|
+
* one whose work is subdivided, because its unit count is discovered rather
|
|
5
|
+
* than known at enqueue time.
|
|
6
|
+
*/
|
|
7
|
+
export declare enum ConversationTransferPhase {
|
|
8
|
+
/** Fetching the conversation, listing conversations, or parsing the import file. */
|
|
9
|
+
Prepare = "prepare",
|
|
10
|
+
/** Downloading or uploading the discovered units. */
|
|
11
|
+
Transfer = "transfer",
|
|
12
|
+
/** Serializing, building the archive, or saving the conversations. */
|
|
13
|
+
Finalize = "finalize"
|
|
14
|
+
}
|
|
15
|
+
/** Which weight table a job uses. */
|
|
16
|
+
export declare enum ConversationTransferKind {
|
|
17
|
+
ExportSingle = "exportSingle",
|
|
18
|
+
ExportSingleWithAttachments = "exportSingleWithAttachments",
|
|
19
|
+
ExportAll = "exportAll",
|
|
20
|
+
Import = "import"
|
|
21
|
+
}
|
|
22
|
+
/** Share of a job's 100 percentage points that each phase is worth. */
|
|
23
|
+
interface PhaseWeights {
|
|
24
|
+
[ConversationTransferPhase.Prepare]: number;
|
|
25
|
+
[ConversationTransferPhase.Transfer]: number;
|
|
26
|
+
[ConversationTransferPhase.Finalize]: number;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Per-kind phase weights, each summing to 100. Fixed rather than derived from
|
|
30
|
+
* the unit count so that discovering how many attachments a job has subdivides
|
|
31
|
+
* work still to do instead of moving the indicator backwards.
|
|
32
|
+
*/
|
|
33
|
+
export declare const TRANSFER_PHASE_WEIGHTS: Record<ConversationTransferKind, PhaseWeights>;
|
|
34
|
+
/** Percentage a fully settled job reports. */
|
|
35
|
+
export declare const TRANSFER_PROGRESS_COMPLETE = 100;
|
|
36
|
+
/** Arguments for {@link computeTransferPercent}. */
|
|
37
|
+
export interface ComputeTransferPercentParams {
|
|
38
|
+
/** Which weight table applies. */
|
|
39
|
+
kind: ConversationTransferKind;
|
|
40
|
+
/** The phase currently advancing. */
|
|
41
|
+
phase: ConversationTransferPhase;
|
|
42
|
+
/**
|
|
43
|
+
* Units settled within `phase`. Omit (or pass `total: 0`) for a phase whose
|
|
44
|
+
* work is not subdivided; its whole weight is then credited at once.
|
|
45
|
+
*/
|
|
46
|
+
completed?: number;
|
|
47
|
+
/** Units `phase` will settle in total. */
|
|
48
|
+
total?: number;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Returns the job's completion as an integer 0–100: every earlier phase's
|
|
52
|
+
* weight in full, plus `phase`'s weight scaled by `completed / total`. A phase
|
|
53
|
+
* with no units to settle is credited in full, so a conversation with no
|
|
54
|
+
* attachments never stalls at the start of the transfer phase.
|
|
55
|
+
*/
|
|
56
|
+
export declare const computeTransferPercent: ({ kind, phase, completed, total, }: ComputeTransferPercentParams) => number;
|
|
57
|
+
/** Builds the progress patch for a phase, carrying its unit readout when the phase has units. */
|
|
58
|
+
export declare const buildTransferProgress: (params: ComputeTransferPercentParams, units?: ConversationTransferProgressUnits) => ConversationTransferProgress;
|
|
59
|
+
export {};
|
|
60
|
+
//# sourceMappingURL=progress.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"progress.d.ts","sourceRoot":"","sources":["../../../src/conversation/conversation-transfer/progress.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,4BAA4B,EAC5B,iCAAiC,EAClC,MAAM,2BAA2B,CAAC;AAEnC;;;;GAIG;AACH,oBAAY,yBAAyB;IACnC,oFAAoF;IACpF,OAAO,YAAY;IACnB,qDAAqD;IACrD,QAAQ,aAAa;IACrB,sEAAsE;IACtE,QAAQ,aAAa;CACtB;AAED,qCAAqC;AACrC,oBAAY,wBAAwB;IAClC,YAAY,iBAAiB;IAC7B,2BAA2B,gCAAgC;IAC3D,SAAS,cAAc;IACvB,MAAM,WAAW;CAClB;AAED,uEAAuE;AACvE,UAAU,YAAY;IACpB,CAAC,yBAAyB,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC5C,CAAC,yBAAyB,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC7C,CAAC,yBAAyB,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;CAC9C;AAED;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,EAAE,MAAM,CACzC,wBAAwB,EACxB,YAAY,CAsBb,CAAC;AAEF,8CAA8C;AAC9C,eAAO,MAAM,0BAA0B,MAAM,CAAC;AAkB9C,oDAAoD;AACpD,MAAM,WAAW,4BAA4B;IAC3C,kCAAkC;IAClC,IAAI,EAAE,wBAAwB,CAAC;IAC/B,qCAAqC;IACrC,KAAK,EAAE,yBAAyB,CAAC;IACjC;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,0CAA0C;IAC1C,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,GAAI,oCAKpC,4BAA4B,KAAG,MAOjC,CAAC;AAEF,iGAAiG;AACjG,eAAO,MAAM,qBAAqB,GAChC,QAAQ,4BAA4B,EACpC,QAAQ,iCAAiC,KACxC,4BAGD,CAAC"}
|
|
@@ -1,12 +1,35 @@
|
|
|
1
|
-
import { ConversationTransferJob, ConversationTransferSubject } from '@epam/ai-dial-chat-shared';
|
|
1
|
+
import { ConversationTransferErrorCode, ConversationTransferJob, ConversationTransferProgress, ConversationTransferSubject, ConversationTransferWarningCode } from '@epam/ai-dial-chat-shared';
|
|
2
2
|
/** Shared job-queue primitive underlying both `useConversationExport` and `useConversationImport`. */
|
|
3
3
|
export interface ConversationTransferQueue {
|
|
4
4
|
/** Queued jobs, most recently added last. */
|
|
5
5
|
jobs: ConversationTransferJob[];
|
|
6
|
-
/** Adds a new `InProgress` job for `subject` and returns its id. */
|
|
7
|
-
addJob: (subject: ConversationTransferSubject) => string;
|
|
6
|
+
/** Adds a new `InProgress` job for `subject`, named `fileName`, at 0% and returns its id. */
|
|
7
|
+
addJob: (subject: ConversationTransferSubject, fileName: string) => string;
|
|
8
8
|
/** Merges `patch` into the job identified by `jobId`. */
|
|
9
9
|
updateJob: (jobId: string, patch: Partial<ConversationTransferJob>) => void;
|
|
10
|
+
/**
|
|
11
|
+
* Advances the job's progress. A write whose `percent` is lower than the
|
|
12
|
+
* stored value is discarded, so out-of-order completions from concurrent
|
|
13
|
+
* transfers cannot move the indicator backwards, and a write to a job that
|
|
14
|
+
* has already settled is ignored, so an aborted run unwinding in the
|
|
15
|
+
* background cannot advance a canceled or failed row.
|
|
16
|
+
*/
|
|
17
|
+
setJobProgress: (jobId: string, progress: ConversationTransferProgress) => void;
|
|
18
|
+
/** Marks the job `Success` at 100%. */
|
|
19
|
+
succeedJob: (jobId: string) => void;
|
|
20
|
+
/**
|
|
21
|
+
* Marks the job `Warning` at 100%, recording what was incomplete. The file
|
|
22
|
+
* was still delivered, so this settles the job exactly as `succeedJob` does
|
|
23
|
+
* apart from the status and the attached code.
|
|
24
|
+
*/
|
|
25
|
+
warnJob: (jobId: string, warningCode: ConversationTransferWarningCode) => void;
|
|
26
|
+
/** Marks the job `Failed`, recording why. Progress freezes where it stopped. */
|
|
27
|
+
failJob: (jobId: string, errorCode: ConversationTransferErrorCode) => void;
|
|
28
|
+
/**
|
|
29
|
+
* Aborts the job's in-flight request(s) and marks it `Canceled`, keeping the
|
|
30
|
+
* row so the user has a record of what they stopped. The job stays retryable.
|
|
31
|
+
*/
|
|
32
|
+
cancelJob: (jobId: string) => void;
|
|
10
33
|
/** Aborts the job's in-flight request (if any) and removes it from `jobs`. */
|
|
11
34
|
dismissJob: (jobId: string) => void;
|
|
12
35
|
/** Re-invokes the job's registered run function under a fresh `AbortController`. */
|
|
@@ -22,8 +45,8 @@ export interface ConversationTransferQueue {
|
|
|
22
45
|
}
|
|
23
46
|
/**
|
|
24
47
|
* Owns the export/import job queue: job list state, per-job
|
|
25
|
-
* `AbortController` tracking, retry-function
|
|
26
|
-
* unmount cleanup. Shared by `useConversationExport` and
|
|
48
|
+
* `AbortController` tracking, monotonic progress, retry-function
|
|
49
|
+
* registration, and unmount cleanup. Shared by `useConversationExport` and
|
|
27
50
|
* `useConversationImport` so both hooks have identical cancellation,
|
|
28
51
|
* retry, and dismissal semantics.
|
|
29
52
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"queue.d.ts","sourceRoot":"","sources":["../../../src/conversation/conversation-transfer/queue.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"queue.d.ts","sourceRoot":"","sources":["../../../src/conversation/conversation-transfer/queue.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,6BAA6B,EAClC,KAAK,uBAAuB,EAE5B,KAAK,4BAA4B,EACjC,KAAK,2BAA2B,EAChC,KAAK,+BAA+B,EAErC,MAAM,2BAA2B,CAAC;AAInC,sGAAsG;AACtG,MAAM,WAAW,yBAAyB;IAC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Code } from '@epam/ai-dial-chat-shared';
|
|
1
2
|
/** Whether an export includes the conversation's attachments. */
|
|
2
3
|
export declare enum ConversationExportMode {
|
|
3
4
|
WithAttachments = "withAttachments",
|
|
@@ -9,14 +10,6 @@ export declare enum ExportFileNameKind {
|
|
|
9
10
|
SingleConversationWithAttachments = "chat_with_attachments",
|
|
10
11
|
AllConversationsHistory = "chat_conversations_history"
|
|
11
12
|
}
|
|
12
|
-
/** Library-owned reason a transfer job failed. */
|
|
13
|
-
export declare enum ConversationTransferErrorCode {
|
|
14
|
-
Unauthorized = "unauthorized",
|
|
15
|
-
NotFound = "notFound",
|
|
16
|
-
UnsupportedFormat = "unsupportedFormat",
|
|
17
|
-
MissingBucket = "missingBucket",
|
|
18
|
-
Unknown = "unknown"
|
|
19
|
-
}
|
|
20
13
|
/** Structured, translation-free error report for a transfer job. */
|
|
21
14
|
export interface ConversationTransferErrorEvent {
|
|
22
15
|
jobId: string;
|
|
@@ -26,10 +19,7 @@ export interface ConversationTransferErrorEvent {
|
|
|
26
19
|
/** Resolved trace id for the failing request, when the host's `resolveErrorTraceId` supplies one. */
|
|
27
20
|
traceId?: string;
|
|
28
21
|
}
|
|
29
|
-
|
|
30
|
-
export declare enum ConversationTransferWarningCode {
|
|
31
|
-
AttachmentSkipped = "attachmentSkipped"
|
|
32
|
-
}
|
|
22
|
+
export { ConversationTransferWarningCode };
|
|
33
23
|
/** Structured, translation-free warning report for a transfer job. */
|
|
34
24
|
export interface ConversationTransferWarningEvent {
|
|
35
25
|
jobId: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/conversation/conversation-transfer/types.ts"],"names":[],"mappings":"AAAA,iEAAiE;AACjE,oBAAY,sBAAsB;IAChC,eAAe,oBAAoB;IACnC,kBAAkB,uBAAuB;CAC1C;AAED,8EAA8E;AAC9E,oBAAY,kBAAkB;IAC5B,kBAAkB,sBAAsB;IACxC,iCAAiC,0BAA0B;IAC3D,uBAAuB,+BAA+B;CACvD;AAED,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/conversation/conversation-transfer/types.ts"],"names":[],"mappings":"AAAA,iEAAiE;AACjE,oBAAY,sBAAsB;IAChC,eAAe,oBAAoB;IACnC,kBAAkB,uBAAuB;CAC1C;AAED,OAAO,EACL,+BAA+B,EAC/B,KAAK,6BAA6B,EACnC,MAAM,2BAA2B,CAAC;AAEnC,8EAA8E;AAC9E,oBAAY,kBAAkB;IAC5B,kBAAkB,sBAAsB;IACxC,iCAAiC,0BAA0B;IAC3D,uBAAuB,+BAA+B;CACvD;AAED,oEAAoE;AACpE,MAAM,WAAW,8BAA8B;IAC7C,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,6BAA6B,CAAC;IACpC,oEAAoE;IACpE,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,qGAAqG;IACrG,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAQD,OAAO,EAAE,+BAA+B,EAAE,CAAC;AAE3C,sEAAsE;AACtE,MAAM,WAAW,gCAAgC;IAC/C,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,+BAA+B,CAAC;IACtC,0EAA0E;IAC1E,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;CAClB;AAED,sEAAsE;AACtE,MAAM,WAAW,gCAAgC;IAC/C,KAAK,EAAE,MAAM,CAAC;IACd,uDAAuD;IACvD,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;CACnB"}
|
|
@@ -1,6 +1,18 @@
|
|
|
1
1
|
import { ConversationsApi, FilesApi } from '@epam/ai-dial-chat-api-client';
|
|
2
2
|
import { ConversationTransferJob } from '@epam/ai-dial-chat-shared';
|
|
3
3
|
import { ConversationExportMode, ConversationTransferErrorEvent, ConversationTransferSuccessEvent, ConversationTransferWarningEvent } from '../conversation-transfer/types';
|
|
4
|
+
/**
|
|
5
|
+
* Default ceiling on the summed byte length of an export's attachments.
|
|
6
|
+
*
|
|
7
|
+
* The bound is on *input* bytes even though what it protects is peak heap:
|
|
8
|
+
* the archive pipeline holds roughly three copies at once — every attachment
|
|
9
|
+
* in memory, `zipSync`'s output buffer (already-compressed media barely
|
|
10
|
+
* shrinks), and the copy `buildDialArchive` makes before handing it to `Blob`.
|
|
11
|
+
* 512 MiB of input therefore peaks near 1.5 GiB, which fits a 64-bit desktop
|
|
12
|
+
* tab. Sizing this against the ~2 GiB single-`ArrayBuffer` ceiling would be
|
|
13
|
+
* the wrong bound — that limits one buffer, not the three held together.
|
|
14
|
+
*/
|
|
15
|
+
export declare const DEFAULT_MAX_ARCHIVE_BYTES: number;
|
|
4
16
|
interface ExportErrorClassification {
|
|
5
17
|
isUnauthorized?: boolean;
|
|
6
18
|
isNotFound?: boolean;
|
|
@@ -17,6 +29,12 @@ export interface UseConversationExportParams {
|
|
|
17
29
|
classifyTransferError?: (error: unknown) => ExportErrorClassification;
|
|
18
30
|
/** Resolves a trace id for a failing request, for display in an error notification. */
|
|
19
31
|
resolveErrorTraceId?: (error: unknown) => Promise<string | undefined>;
|
|
32
|
+
/**
|
|
33
|
+
* Ceiling on the summed byte length of an export's attachments; a larger
|
|
34
|
+
* export fails with `FileTooLarge` instead of being zipped. Defaults to
|
|
35
|
+
* {@link DEFAULT_MAX_ARCHIVE_BYTES}.
|
|
36
|
+
*/
|
|
37
|
+
maxArchiveBytes?: number;
|
|
20
38
|
/** Called when a job completes successfully. */
|
|
21
39
|
onSuccess?: (event: ConversationTransferSuccessEvent) => void;
|
|
22
40
|
/** Called when a job succeeds but had to skip something (e.g. an unreachable attachment). */
|
|
@@ -32,9 +50,11 @@ export interface UseConversationExportResult {
|
|
|
32
50
|
exportSingle: (conversationId: string, title: string, mode: ConversationExportMode) => Promise<void>;
|
|
33
51
|
/** Enqueues an export-all job and starts it immediately. */
|
|
34
52
|
exportAll: () => Promise<void>;
|
|
53
|
+
/** Aborts a job's underlying requests and marks it canceled, keeping it in `jobs`. */
|
|
54
|
+
cancelJob: (jobId: string) => void;
|
|
35
55
|
/** Removes a job from the queue. If still in progress, aborts its underlying requests. */
|
|
36
56
|
dismissJob: (jobId: string) => void;
|
|
37
|
-
/** Re-attempts a failed job in place (same job id, same parameters). */
|
|
57
|
+
/** Re-attempts a failed or canceled job in place (same job id, same parameters). */
|
|
38
58
|
retryJob: (jobId: string) => void;
|
|
39
59
|
/** Aborts all in-progress jobs and clears the entire queue. */
|
|
40
60
|
dismissAll: () => void;
|
|
@@ -42,10 +62,11 @@ export interface UseConversationExportResult {
|
|
|
42
62
|
/**
|
|
43
63
|
* Owns the export job queue: fetches conversation data through the injected
|
|
44
64
|
* generated-client operations, builds the JSON v5 / ZIP output via the pure
|
|
45
|
-
* export utils, reports
|
|
46
|
-
* each job's lifecycle (in progress /
|
|
47
|
-
* multiple exports can run
|
|
65
|
+
* export utils, reports determinate per-job progress and structured
|
|
66
|
+
* success/warning/error events, and tracks each job's lifecycle (in progress /
|
|
67
|
+
* success / failed / canceled) independently so multiple exports can run
|
|
68
|
+
* concurrently.
|
|
48
69
|
*/
|
|
49
|
-
export declare const useConversationExport: ({ conversationsApi, filesApi, normalizeConversationPath, classifyTransferError, resolveErrorTraceId, onSuccess, onWarning, onError, }: UseConversationExportParams) => UseConversationExportResult;
|
|
70
|
+
export declare const useConversationExport: ({ conversationsApi, filesApi, normalizeConversationPath, classifyTransferError, resolveErrorTraceId, maxArchiveBytes, onSuccess, onWarning, onError, }: UseConversationExportParams) => UseConversationExportResult;
|
|
50
71
|
export {};
|
|
51
72
|
//# sourceMappingURL=useConversationExport.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useConversationExport.d.ts","sourceRoot":"","sources":["../../../src/conversation/useConversationExport/useConversationExport.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,gBAAgB,EAChB,QAAQ,EACT,MAAM,+BAA+B,CAAC;AACvC,OAAO,
|
|
1
|
+
{"version":3,"file":"useConversationExport.d.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CAAC,KAAK,EAAE,8BAA8B,KAAK,IAAI,CAAC;CAC3D;AAED,qDAAqD;AACrD,MAAM,WAAW,2BAA2B;IAC1C,4FAA4F;IAC5F,IAAI,EAAE,uBAAuB,EAAE,CAAC;IAChC,2EAA2E;IAC3E,YAAY,EAAE,CACZ,cAAc,EAAE,MAAM,EACtB,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,sBAAsB,KACzB,OAAO,CAAC,IAAI,CAAC,CAAC;IACnB,4DAA4D;IAC5D,SAAS,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/B,sFAAsF;IACtF,SAAS,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,0FAA0F;IAC1F,UAAU,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACpC,oFAAoF;IACpF,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,+DAA+D;IAC/D,UAAU,EAAE,MAAM,IAAI,CAAC;CACxB;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,qBAAqB,GAAI,wJAUnC,2BAA2B,KAAG,2BAkbhC,CAAC"}
|
|
@@ -30,9 +30,11 @@ export interface UseConversationImportResult {
|
|
|
30
30
|
jobs: ConversationTransferJob[];
|
|
31
31
|
/** Parses the given file and starts importing it as a new job. */
|
|
32
32
|
importConversations: (file: File) => Promise<void>;
|
|
33
|
+
/** Aborts a job's underlying requests and marks it canceled, keeping it in `jobs`. */
|
|
34
|
+
cancelJob: (jobId: string) => void;
|
|
33
35
|
/** Removes a job from the queue. If still in progress, aborts its underlying requests. */
|
|
34
36
|
dismissJob: (jobId: string) => void;
|
|
35
|
-
/** Re-attempts a failed job in place (same job id, reusing the already-parsed file). */
|
|
37
|
+
/** Re-attempts a failed or canceled job in place (same job id, reusing the already-parsed file). */
|
|
36
38
|
retryJob: (jobId: string) => void;
|
|
37
39
|
/** Aborts all in-progress jobs and clears the entire queue. */
|
|
38
40
|
dismissAll: () => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useConversationImport.d.ts","sourceRoot":"","sources":["../../../src/conversation/useConversationImport/useConversationImport.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,gBAAgB,EAChB,QAAQ,EACT,MAAM,+BAA+B,CAAC;AACvC,OAAO,
|
|
1
|
+
{"version":3,"file":"useConversationImport.d.ts","sourceRoot":"","sources":["../../../src/conversation/useConversationImport/useConversationImport.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,gBAAgB,EAChB,QAAQ,EACT,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAEL,KAAK,uBAAuB,EAK7B,MAAM,2BAA2B,CAAC;AAuBnC,OAAO,EACL,KAAK,8BAA8B,EACnC,KAAK,gCAAgC,EAErC,KAAK,gCAAgC,EACtC,MAAM,gCAAgC,CAAC;AAgExC,oDAAoD;AACpD,MAAM,WAAW,2BAA2B;IAC1C,2FAA2F;IAC3F,gBAAgB,EAAE,IAAI,CAAC,gBAAgB,EAAE,kBAAkB,CAAC,CAAC;IAC7D,oFAAoF;IACpF,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,WAAW,GAAG,YAAY,CAAC,CAAC;IACrD,uGAAuG;IACvG,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,iFAAiF;IACjF,UAAU,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IACxC,+FAA+F;IAC/F,qBAAqB,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK;QAAE,cAAc,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC;IACzE,uFAAuF;IACvF,mBAAmB,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IACtE,wFAAwF;IACxF,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,gCAAgC,KAAK,IAAI,CAAC;IAC9D,gEAAgE;IAChE,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,gCAAgC,KAAK,IAAI,CAAC;IAC9D,4EAA4E;IAC5E,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,8BAA8B,KAAK,IAAI,CAAC;CAC3D;AA8GD,qDAAqD;AACrD,MAAM,WAAW,2BAA2B;IAC1C,4FAA4F;IAC5F,IAAI,EAAE,uBAAuB,EAAE,CAAC;IAChC,kEAAkE;IAClE,mBAAmB,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACnD,sFAAsF;IACtF,SAAS,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,0FAA0F;IAC1F,UAAU,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACpC,oGAAoG;IACpG,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,+DAA+D;IAC/D,UAAU,EAAE,MAAM,IAAI,CAAC;CACxB;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,qBAAqB,GAAI,gIAUnC,2BAA2B,KAAG,2BA6ShC,CAAC"}
|
|
@@ -37,6 +37,8 @@ export interface ConversationGenerationLifecycle {
|
|
|
37
37
|
export interface ConversationStreamChannel {
|
|
38
38
|
channelId: string | null;
|
|
39
39
|
ensureConnected: () => void;
|
|
40
|
+
/** Resolves with a channel id, waiting for an in-flight subscribe if one isn't established yet, so a completion sent immediately after mount can still carry it. */
|
|
41
|
+
waitForChannel: (timeoutMs?: number) => Promise<string | null>;
|
|
40
42
|
}
|
|
41
43
|
/** Optional host-owned overlay generation-lifecycle notifications. Each method is independently optional. */
|
|
42
44
|
export interface ConversationStreamOverlayNotifier {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useConversationStream.d.ts","sourceRoot":"","sources":["../../../src/conversation/useConversationStream/useConversationStream.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AAC1E,OAAO,EACL,KAAK,YAAY,EAEjB,KAAK,oBAAoB,EACzB,KAAK,WAAW,EACjB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,KAAK,QAAQ,EACb,KAAK,gBAAgB,EACrB,KAAK,cAAc,EAKpB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"useConversationStream.d.ts","sourceRoot":"","sources":["../../../src/conversation/useConversationStream/useConversationStream.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AAC1E,OAAO,EACL,KAAK,YAAY,EAEjB,KAAK,oBAAoB,EACzB,KAAK,WAAW,EACjB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,KAAK,QAAQ,EACb,KAAK,gBAAgB,EACrB,KAAK,cAAc,EAKpB,MAAM,OAAO,CAAC;AAsBf,gFAAgF;AAChF,MAAM,WAAW,uBAAuB;IACtC,OAAO,EAAE,CAAC,KAAK,EAAE,WAAW,KAAK,IAAI,CAAC;IACtC,UAAU,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACvC,OAAO,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IAChC,MAAM,EAAE,WAAW,CAAC;CACrB;AAED;;;;GAIG;AACH,MAAM,WAAW,2BAA2B;IAC1C,6GAA6G;IAC7G,gBAAgB,CACd,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,GAAG,SAAS,EAC3B,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,uBAAuB,EAChC,aAAa,CAAC,EAAE,oBAAoB,EACpC,YAAY,CAAC,EAAE,MAAM,EACrB,IAAI,CAAC,EAAE,yBAAyB,EAChC,YAAY,CAAC,EAAE,MAAM,EACrB,eAAe,CAAC,EAAE,MAAM,GACvB,IAAI,CAAC;IACR,sDAAsD;IACtD,cAAc,CAAC,MA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