@superxd-studio/adptr 0.5.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.
- package/GENERATIVE.md +101 -0
- package/INTERACTIONS.md +51 -0
- package/LICENSE +21 -0
- package/README.md +57 -0
- package/REUSE.md +170 -0
- package/REVIEW.md +68 -0
- package/THIRD-PARTY-NOTICES.md +28 -0
- package/ai-sdk/index.js +96 -0
- package/assets/ibm-plex-mono-cyrillic-400-normal.woff2 +0 -0
- package/assets/ibm-plex-mono-cyrillic-500-normal.woff2 +0 -0
- package/assets/ibm-plex-mono-cyrillic-ext-400-normal.woff2 +0 -0
- package/assets/ibm-plex-mono-cyrillic-ext-500-normal.woff2 +0 -0
- package/assets/ibm-plex-mono-latin-400-normal.woff2 +0 -0
- package/assets/ibm-plex-mono-latin-500-normal.woff2 +0 -0
- package/assets/ibm-plex-mono-latin-ext-400-normal.woff2 +0 -0
- package/assets/ibm-plex-mono-latin-ext-500-normal.woff2 +0 -0
- package/assets/ibm-plex-mono-vietnamese-400-normal.woff2 +0 -0
- package/assets/ibm-plex-mono-vietnamese-500-normal.woff2 +0 -0
- package/assets/instrument-sans-latin-ext-wght-normal.woff2 +0 -0
- package/assets/instrument-sans-latin-wght-normal.woff2 +0 -0
- package/assistant-ui/index.js +139 -0
- package/chunks/callout-DKMHSnjc.js +342 -0
- package/chunks/canvas-BJ15-XxE.js +598 -0
- package/chunks/controller-Cfpg0C7v.js +180 -0
- package/chunks/core-BCqVRLUy.js +312 -0
- package/chunks/text-field-BLtoaZFn.js +41 -0
- package/chunks/types-BGF7r1my.js +115 -0
- package/chunks/ui-9DyNsYXY.js +967 -0
- package/core/index.js +4 -0
- package/custom/index.js +64 -0
- package/examples/ai-sdk-backend/package.json +11 -0
- package/examples/ai-sdk-backend/server.mjs +316 -0
- package/examples/custom-backend/copy.mjs +7 -0
- package/examples/custom-backend/server.mjs +118 -0
- package/examples/generative/specs.json +2094 -0
- package/examples/review-backend/copy.mjs +27 -0
- package/examples/review-backend/package.json +11 -0
- package/examples/review-backend/server.mjs +276 -0
- package/examples/web-ai-sdk/index.html +12 -0
- package/examples/web-ai-sdk/package.json +21 -0
- package/examples/web-ai-sdk/src/copy.ts +1 -0
- package/examples/web-ai-sdk/src/main.tsx +64 -0
- package/examples/web-ai-sdk/tsconfig.json +13 -0
- package/examples/web-generative/index.html +12 -0
- package/examples/web-generative/package.json +23 -0
- package/examples/web-generative/src/copy.ts +42 -0
- package/examples/web-generative/src/main.tsx +74 -0
- package/examples/web-generative/tsconfig.json +14 -0
- package/examples/web-independent/index.html +12 -0
- package/examples/web-independent/package.json +20 -0
- package/examples/web-independent/src/main.tsx +32 -0
- package/examples/web-independent/tsconfig.json +14 -0
- package/examples/web-interactions/index.html +12 -0
- package/examples/web-interactions/package.json +21 -0
- package/examples/web-interactions/src/copy.ts +215 -0
- package/examples/web-interactions/src/examples.tsx +628 -0
- package/examples/web-interactions/src/main.tsx +116 -0
- package/examples/web-interactions/tsconfig.json +14 -0
- package/examples/web-review/index.html +12 -0
- package/examples/web-review/package.json +20 -0
- package/examples/web-review/src/main.tsx +59 -0
- package/examples/web-review/tsconfig.json +14 -0
- package/fonts.css +117 -0
- package/generative/index.js +1560 -0
- package/interactions/index.js +1591 -0
- package/langgraph-review/index.js +36 -0
- package/licenses/ai-sdk.txt +13 -0
- package/licenses/assistant-ui-generative.txt +21 -0
- package/licenses/assistant-ui.txt +23 -0
- package/licenses/ibm-plex-mono.txt +93 -0
- package/licenses/instrument-sans.txt +93 -0
- package/licenses/internationalized-date.txt +201 -0
- package/licenses/langgraph.txt +21 -0
- package/licenses/lucide.txt +43 -0
- package/licenses/react-markdown.txt +21 -0
- package/licenses/remark-gfm.txt +22 -0
- package/licenses/zod.txt +21 -0
- package/package.json +138 -0
- package/review/index.js +31 -0
- package/source/components/avatar.tsx +50 -0
- package/source/components/button.tsx +155 -0
- package/source/components/callout.tsx +65 -0
- package/source/components/canvas/connector.tsx +14 -0
- package/source/components/canvas/copy.ts +34 -0
- package/source/components/canvas/index.tsx +257 -0
- package/source/components/canvas/recorder.ts +36 -0
- package/source/components/date-time-field.tsx +77 -0
- package/source/components/flow-motion.tsx +109 -0
- package/source/components/icons.tsx +275 -0
- package/source/components/responsive-overlay.tsx +91 -0
- package/source/components/scenario-picker/copy.ts +5 -0
- package/source/components/scenario-picker/index.tsx +142 -0
- package/source/components/scroll-area.tsx +59 -0
- package/source/components/search-picker.tsx +127 -0
- package/source/components/segmented-control.tsx +123 -0
- package/source/components/skeleton.tsx +11 -0
- package/source/components/spinner.tsx +19 -0
- package/source/components/superxd-arrow.tsx +22 -0
- package/source/components/switch.tsx +45 -0
- package/source/components/text-field.tsx +81 -0
- package/source/components/thinking.tsx +16 -0
- package/source/components/ui/copy.ts +12 -0
- package/source/components/ui/display.tsx +276 -0
- package/source/components/ui/navigation.tsx +346 -0
- package/source/components/ui/portal-theme.tsx +28 -0
- package/source/components/ui/selection.tsx +336 -0
- package/source/lib/cn.ts +23 -0
- package/source/reusable/ai-sdk/index.ts +114 -0
- package/source/reusable/assistant-ui/index.tsx +266 -0
- package/source/reusable/core/attachments.ts +163 -0
- package/source/reusable/core/index.ts +417 -0
- package/source/reusable/custom/index.ts +90 -0
- package/source/reusable/generative/actions.ts +188 -0
- package/source/reusable/generative/copy.ts +47 -0
- package/source/reusable/generative/data.tsx +126 -0
- package/source/reusable/generative/index.tsx +517 -0
- package/source/reusable/generative/schema.ts +327 -0
- package/source/reusable/generative/timeline.tsx +214 -0
- package/source/reusable/generative/vocabulary.tsx +847 -0
- package/source/reusable/interactions/agent.ts +259 -0
- package/source/reusable/interactions/artifact.ts +236 -0
- package/source/reusable/interactions/context.tsx +38 -0
- package/source/reusable/interactions/copy.ts +117 -0
- package/source/reusable/interactions/feedback.ts +73 -0
- package/source/reusable/interactions/index.ts +11 -0
- package/source/reusable/interactions/presentation.tsx +483 -0
- package/source/reusable/interactions/store.ts +74 -0
- package/source/reusable/interactions/threads.ts +126 -0
- package/source/reusable/interactions/web.tsx +574 -0
- package/source/reusable/langgraph-review/index.ts +73 -0
- package/source/reusable/review/controller.ts +263 -0
- package/source/reusable/review/index.ts +47 -0
- package/source/reusable/review/types.ts +189 -0
- package/source/reusable/ui/index.ts +25 -0
- package/source/reusable/uploads/index.ts +48 -0
- package/source/reusable/web/attachments/copy.ts +23 -0
- package/source/reusable/web/attachments/index.tsx +233 -0
- package/source/reusable/web/copy.ts +22 -0
- package/source/reusable/web/index.tsx +470 -0
- package/source/reusable/web/message/copy.ts +26 -0
- package/source/reusable/web/message/index.tsx +388 -0
- package/source/reusable/web/message/streaming.ts +64 -0
- package/source/reusable/web/message/styles.css +21 -0
- package/source/reusable/web/review/copy.ts +78 -0
- package/source/reusable/web/review/flow.ts +24 -0
- package/source/reusable/web/review/index.tsx +506 -0
- package/source/reusable/web/styles.ts +2 -0
- package/source/styles/library.css +612 -0
- package/source/styles/theme.css +228 -0
- package/styles.css +3 -0
- package/styles.d.ts +1 -0
- package/types/components/avatar.d.ts +14 -0
- package/types/components/button.d.ts +36 -0
- package/types/components/callout.d.ts +19 -0
- package/types/components/canvas/connector.d.ts +2 -0
- package/types/components/canvas/copy.d.ts +34 -0
- package/types/components/canvas/index.d.ts +33 -0
- package/types/components/canvas/recorder.d.ts +10 -0
- package/types/components/date-time-field.d.ts +11 -0
- package/types/components/flow-motion.d.ts +38 -0
- package/types/components/icons.d.ts +138 -0
- package/types/components/responsive-overlay.d.ts +15 -0
- package/types/components/scenario-picker/copy.d.ts +5 -0
- package/types/components/scenario-picker/index.d.ts +14 -0
- package/types/components/scroll-area.d.ts +14 -0
- package/types/components/search-picker.d.ts +27 -0
- package/types/components/segmented-control.d.ts +23 -0
- package/types/components/skeleton.d.ts +4 -0
- package/types/components/spinner.d.ts +4 -0
- package/types/components/superxd-arrow.d.ts +5 -0
- package/types/components/switch.d.ts +8 -0
- package/types/components/text-field.d.ts +19 -0
- package/types/components/thinking.d.ts +8 -0
- package/types/components/ui/copy.d.ts +12 -0
- package/types/components/ui/display.d.ts +50 -0
- package/types/components/ui/navigation.d.ts +63 -0
- package/types/components/ui/portal-theme.d.ts +8 -0
- package/types/components/ui/selection.d.ts +37 -0
- package/types/lib/cn.d.ts +3 -0
- package/types/reusable/ai-sdk/index.d.ts +15 -0
- package/types/reusable/assistant-ui/index.d.ts +12 -0
- package/types/reusable/core/attachments.d.ts +54 -0
- package/types/reusable/core/index.d.ts +107 -0
- package/types/reusable/custom/index.d.ts +14 -0
- package/types/reusable/generative/actions.d.ts +45 -0
- package/types/reusable/generative/copy.d.ts +48 -0
- package/types/reusable/generative/data.d.ts +4 -0
- package/types/reusable/generative/index.d.ts +30 -0
- package/types/reusable/generative/schema.d.ts +303 -0
- package/types/reusable/generative/timeline.d.ts +21 -0
- package/types/reusable/generative/vocabulary.d.ts +34 -0
- package/types/reusable/interactions/agent.d.ts +98 -0
- package/types/reusable/interactions/artifact.d.ts +118 -0
- package/types/reusable/interactions/context.d.ts +130 -0
- package/types/reusable/interactions/copy.d.ts +115 -0
- package/types/reusable/interactions/feedback.d.ts +34 -0
- package/types/reusable/interactions/index.d.ts +10 -0
- package/types/reusable/interactions/presentation.d.ts +97 -0
- package/types/reusable/interactions/store.d.ts +29 -0
- package/types/reusable/interactions/threads.d.ts +38 -0
- package/types/reusable/interactions/web.d.ts +22 -0
- package/types/reusable/langgraph-review/index.d.ts +5 -0
- package/types/reusable/review/controller.d.ts +52 -0
- package/types/reusable/review/index.d.ts +12 -0
- package/types/reusable/review/types.d.ts +61 -0
- package/types/reusable/ui/index.d.ts +19 -0
- package/types/reusable/uploads/index.d.ts +11 -0
- package/types/reusable/web/attachments/copy.d.ts +25 -0
- package/types/reusable/web/attachments/index.d.ts +24 -0
- package/types/reusable/web/copy.d.ts +24 -0
- package/types/reusable/web/index.d.ts +41 -0
- package/types/reusable/web/message/copy.d.ts +27 -0
- package/types/reusable/web/message/index.d.ts +56 -0
- package/types/reusable/web/message/streaming.d.ts +27 -0
- package/types/reusable/web/review/copy.d.ts +72 -0
- package/types/reusable/web/review/flow.d.ts +3 -0
- package/types/reusable/web/review/index.d.ts +38 -0
- package/types/reusable/web/styles.d.ts +2 -0
- package/ui/index.js +4 -0
- package/uploads/index.js +34 -0
- package/web/index.js +931 -0
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { InteractionStore, type JsonValue } from "./store.js";
|
|
3
|
+
export declare const agentStepSchema: z.ZodObject<{
|
|
4
|
+
id: z.ZodString;
|
|
5
|
+
title: z.ZodString;
|
|
6
|
+
tool: z.ZodString;
|
|
7
|
+
input: z.ZodCustom<JsonValue, JsonValue>;
|
|
8
|
+
scope: z.ZodString;
|
|
9
|
+
}, z.core.$strict>;
|
|
10
|
+
export type AgentStep = z.infer<typeof agentStepSchema>;
|
|
11
|
+
export interface AgentRequest {
|
|
12
|
+
requestId: string;
|
|
13
|
+
step: AgentStep;
|
|
14
|
+
approvedUntil: number;
|
|
15
|
+
}
|
|
16
|
+
declare const resultSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
17
|
+
requestId: z.ZodString;
|
|
18
|
+
status: z.ZodLiteral<"completed">;
|
|
19
|
+
output: z.ZodString;
|
|
20
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
21
|
+
requestId: z.ZodString;
|
|
22
|
+
status: z.ZodLiteral<"rejected">;
|
|
23
|
+
reason: z.ZodString;
|
|
24
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
25
|
+
requestId: z.ZodString;
|
|
26
|
+
status: z.ZodLiteral<"unknown">;
|
|
27
|
+
}, z.core.$strict>], "status">;
|
|
28
|
+
export type AgentResult = z.infer<typeof resultSchema>;
|
|
29
|
+
export type AgentReceipt = AgentResult | {
|
|
30
|
+
requestId: string;
|
|
31
|
+
status: "pending" | "not-found";
|
|
32
|
+
};
|
|
33
|
+
export interface AgentAdapter {
|
|
34
|
+
/** Authorise on the server and deduplicate by requestId. Approval is only for this frozen step. */
|
|
35
|
+
execute(request: AgentRequest, signal: AbortSignal, progress: (message: string) => void): Promise<AgentResult>;
|
|
36
|
+
/** Look up the same receipt. not-found must mean definitely not accepted, not eventually invisible. */
|
|
37
|
+
lookup(requestId: string, signal: AbortSignal): Promise<AgentReceipt>;
|
|
38
|
+
}
|
|
39
|
+
export interface AgentSnapshot {
|
|
40
|
+
steps: readonly AgentStep[];
|
|
41
|
+
completed: readonly {
|
|
42
|
+
stepId: string;
|
|
43
|
+
requestId: string;
|
|
44
|
+
output: string;
|
|
45
|
+
}[];
|
|
46
|
+
phase: "ready" | "approval" | "running" | "checking" | "failed" | "uncertain" | "denied" | "expired" | "complete";
|
|
47
|
+
request?: AgentRequest;
|
|
48
|
+
progress?: string;
|
|
49
|
+
reason?: string;
|
|
50
|
+
}
|
|
51
|
+
type AgentEvent = {
|
|
52
|
+
type: "propose";
|
|
53
|
+
request: AgentRequest;
|
|
54
|
+
} | {
|
|
55
|
+
type: "approve";
|
|
56
|
+
} | {
|
|
57
|
+
type: "check";
|
|
58
|
+
} | {
|
|
59
|
+
type: "progress";
|
|
60
|
+
message: string;
|
|
61
|
+
} | {
|
|
62
|
+
type: "settle";
|
|
63
|
+
result: AgentResult;
|
|
64
|
+
} | {
|
|
65
|
+
type: "uncertain";
|
|
66
|
+
} | {
|
|
67
|
+
type: "deny";
|
|
68
|
+
} | {
|
|
69
|
+
type: "expire";
|
|
70
|
+
} | {
|
|
71
|
+
type: "revise";
|
|
72
|
+
steps: readonly AgentStep[];
|
|
73
|
+
};
|
|
74
|
+
export declare function agentReducer(state: AgentSnapshot, event: AgentEvent): AgentSnapshot;
|
|
75
|
+
/** Supervises a finite plan. It never schedules work or invents a tool implementation. */
|
|
76
|
+
export declare class AgentController extends InteractionStore<AgentSnapshot> {
|
|
77
|
+
private adapter;
|
|
78
|
+
private options;
|
|
79
|
+
private expiry?;
|
|
80
|
+
private ttl;
|
|
81
|
+
constructor(adapter: AgentAdapter, steps: readonly AgentStep[], options?: {
|
|
82
|
+
id?: () => string;
|
|
83
|
+
now?: () => number;
|
|
84
|
+
approvalMs?: number;
|
|
85
|
+
});
|
|
86
|
+
private now;
|
|
87
|
+
private send;
|
|
88
|
+
private propose;
|
|
89
|
+
revise(steps: readonly AgentStep[]): boolean;
|
|
90
|
+
next(): boolean;
|
|
91
|
+
approve(): boolean;
|
|
92
|
+
deny(): boolean;
|
|
93
|
+
stop(): boolean;
|
|
94
|
+
renew(): boolean;
|
|
95
|
+
check(): boolean;
|
|
96
|
+
dispose(): void;
|
|
97
|
+
}
|
|
98
|
+
export type { JsonValue };
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { InteractionStore } from "./store.js";
|
|
3
|
+
export declare const artifactSchema: z.ZodObject<{
|
|
4
|
+
id: z.ZodString;
|
|
5
|
+
title: z.ZodString;
|
|
6
|
+
revision: z.ZodString;
|
|
7
|
+
content: z.ZodString;
|
|
8
|
+
canEdit: z.ZodBoolean;
|
|
9
|
+
history: z.ZodArray<z.ZodObject<{
|
|
10
|
+
revision: z.ZodString;
|
|
11
|
+
content: z.ZodString;
|
|
12
|
+
}, z.core.$strict>>;
|
|
13
|
+
}, z.core.$strict>;
|
|
14
|
+
export type ArtifactRecord = z.infer<typeof artifactSchema>;
|
|
15
|
+
export interface ArtifactRequest {
|
|
16
|
+
requestId: string;
|
|
17
|
+
artifactId: string;
|
|
18
|
+
baseRevision: string;
|
|
19
|
+
content: string;
|
|
20
|
+
}
|
|
21
|
+
declare const saveSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
22
|
+
requestId: z.ZodString;
|
|
23
|
+
status: z.ZodLiteral<"saved">;
|
|
24
|
+
record: z.ZodObject<{
|
|
25
|
+
id: z.ZodString;
|
|
26
|
+
title: z.ZodString;
|
|
27
|
+
revision: z.ZodString;
|
|
28
|
+
content: z.ZodString;
|
|
29
|
+
canEdit: z.ZodBoolean;
|
|
30
|
+
history: z.ZodArray<z.ZodObject<{
|
|
31
|
+
revision: z.ZodString;
|
|
32
|
+
content: z.ZodString;
|
|
33
|
+
}, z.core.$strict>>;
|
|
34
|
+
}, z.core.$strict>;
|
|
35
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
36
|
+
requestId: z.ZodString;
|
|
37
|
+
status: z.ZodLiteral<"conflict">;
|
|
38
|
+
record: z.ZodObject<{
|
|
39
|
+
id: z.ZodString;
|
|
40
|
+
title: z.ZodString;
|
|
41
|
+
revision: z.ZodString;
|
|
42
|
+
content: z.ZodString;
|
|
43
|
+
canEdit: z.ZodBoolean;
|
|
44
|
+
history: z.ZodArray<z.ZodObject<{
|
|
45
|
+
revision: z.ZodString;
|
|
46
|
+
content: z.ZodString;
|
|
47
|
+
}, z.core.$strict>>;
|
|
48
|
+
}, z.core.$strict>;
|
|
49
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
50
|
+
requestId: z.ZodString;
|
|
51
|
+
status: z.ZodLiteral<"rejected">;
|
|
52
|
+
reason: z.ZodString;
|
|
53
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
54
|
+
requestId: z.ZodString;
|
|
55
|
+
status: z.ZodLiteral<"unknown">;
|
|
56
|
+
}, z.core.$strict>], "status">;
|
|
57
|
+
export type ArtifactResult = z.infer<typeof saveSchema>;
|
|
58
|
+
export type ArtifactReceipt = ArtifactResult | {
|
|
59
|
+
requestId: string;
|
|
60
|
+
status: "pending" | "not-found";
|
|
61
|
+
};
|
|
62
|
+
export interface ArtifactAdapter {
|
|
63
|
+
load(id: string, signal: AbortSignal): Promise<ArtifactRecord>;
|
|
64
|
+
/** Use compare-and-swap on baseRevision, server permissions and a durable idempotent receipt. */
|
|
65
|
+
save(request: ArtifactRequest, signal: AbortSignal): Promise<ArtifactResult>;
|
|
66
|
+
lookup(requestId: string, signal: AbortSignal): Promise<ArtifactReceipt>;
|
|
67
|
+
}
|
|
68
|
+
export interface ArtifactSnapshot {
|
|
69
|
+
phase: "idle" | "loading" | "load-error" | "viewing" | "editing" | "saving" | "conflict" | "unknown" | "checking";
|
|
70
|
+
record?: ArtifactRecord;
|
|
71
|
+
draft: string;
|
|
72
|
+
latest?: ArtifactRecord;
|
|
73
|
+
request?: ArtifactRequest;
|
|
74
|
+
reason?: string;
|
|
75
|
+
loadId?: string;
|
|
76
|
+
}
|
|
77
|
+
type ArtifactEvent = {
|
|
78
|
+
type: "load";
|
|
79
|
+
id: string;
|
|
80
|
+
} | {
|
|
81
|
+
type: "loaded";
|
|
82
|
+
record: ArtifactRecord;
|
|
83
|
+
} | {
|
|
84
|
+
type: "load-error";
|
|
85
|
+
} | {
|
|
86
|
+
type: "edit";
|
|
87
|
+
content: string;
|
|
88
|
+
} | {
|
|
89
|
+
type: "save";
|
|
90
|
+
request: ArtifactRequest;
|
|
91
|
+
} | {
|
|
92
|
+
type: "settle";
|
|
93
|
+
result: ArtifactResult;
|
|
94
|
+
} | {
|
|
95
|
+
type: "unknown";
|
|
96
|
+
} | {
|
|
97
|
+
type: "check";
|
|
98
|
+
} | {
|
|
99
|
+
type: "not-found";
|
|
100
|
+
} | {
|
|
101
|
+
type: "adopt";
|
|
102
|
+
keepDraft: boolean;
|
|
103
|
+
};
|
|
104
|
+
export declare function artifactReducer(state: ArtifactSnapshot, event: ArtifactEvent): ArtifactSnapshot;
|
|
105
|
+
export declare class ArtifactController extends InteractionStore<ArtifactSnapshot> {
|
|
106
|
+
private adapter;
|
|
107
|
+
private id;
|
|
108
|
+
constructor(adapter: ArtifactAdapter, id?: () => string);
|
|
109
|
+
private send;
|
|
110
|
+
open(id: string): boolean;
|
|
111
|
+
edit(content: string): boolean;
|
|
112
|
+
discard(): boolean;
|
|
113
|
+
save(): boolean;
|
|
114
|
+
private validateResult;
|
|
115
|
+
adoptLatest(keepDraft: boolean): boolean;
|
|
116
|
+
check(): boolean;
|
|
117
|
+
}
|
|
118
|
+
export {};
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
import { interactionCopy } from "./copy.js";
|
|
3
|
+
type Widen<T> = T extends string ? string : T extends (...args: never[]) => unknown ? T : T extends object ? {
|
|
4
|
+
[K in keyof T]: Widen<T[K]>;
|
|
5
|
+
} : T;
|
|
6
|
+
export type InteractionCopy = Widen<typeof interactionCopy>;
|
|
7
|
+
export type InteractionCopyOverrides = {
|
|
8
|
+
[K in keyof InteractionCopy]?: InteractionCopy[K] extends (...args: never[]) => unknown ? InteractionCopy[K] : InteractionCopy[K] extends object ? Partial<InteractionCopy[K]> : InteractionCopy[K];
|
|
9
|
+
};
|
|
10
|
+
/** Scope user-facing copy independently from state identities and server contracts. */
|
|
11
|
+
export declare function InteractionProvider({ copy, children, }: {
|
|
12
|
+
copy?: InteractionCopyOverrides;
|
|
13
|
+
children: ReactNode;
|
|
14
|
+
}): import("react").JSX.Element;
|
|
15
|
+
export declare const useInteractionCopy: () => {
|
|
16
|
+
readonly code: string;
|
|
17
|
+
readonly files: string;
|
|
18
|
+
readonly checks: string;
|
|
19
|
+
readonly passed: string;
|
|
20
|
+
readonly failed: string;
|
|
21
|
+
readonly artifactStates: {
|
|
22
|
+
readonly idle: string;
|
|
23
|
+
readonly loading: string;
|
|
24
|
+
readonly "load-error": string;
|
|
25
|
+
readonly viewing: string;
|
|
26
|
+
readonly editing: string;
|
|
27
|
+
readonly saving: string;
|
|
28
|
+
readonly conflict: string;
|
|
29
|
+
readonly unknown: string;
|
|
30
|
+
readonly checking: string;
|
|
31
|
+
};
|
|
32
|
+
readonly invalid: string;
|
|
33
|
+
readonly explanation: string;
|
|
34
|
+
readonly supplied: string;
|
|
35
|
+
readonly inputs: string;
|
|
36
|
+
readonly output: string;
|
|
37
|
+
readonly tool: string;
|
|
38
|
+
readonly sources: string;
|
|
39
|
+
readonly source: (index: number, title: string) => string;
|
|
40
|
+
readonly unavailable: string;
|
|
41
|
+
readonly noSources: string;
|
|
42
|
+
readonly retrieval: string;
|
|
43
|
+
readonly included: string;
|
|
44
|
+
readonly excluded: string;
|
|
45
|
+
readonly checkClaim: string;
|
|
46
|
+
readonly blocked: string;
|
|
47
|
+
readonly model: string;
|
|
48
|
+
readonly context: string;
|
|
49
|
+
readonly commands: string;
|
|
50
|
+
readonly quote: string;
|
|
51
|
+
readonly reply: string;
|
|
52
|
+
readonly connection: {
|
|
53
|
+
readonly connected: string;
|
|
54
|
+
readonly reconnecting: string;
|
|
55
|
+
readonly disconnected: string;
|
|
56
|
+
};
|
|
57
|
+
readonly disconnected: string;
|
|
58
|
+
readonly reconnect: string;
|
|
59
|
+
readonly trace: string;
|
|
60
|
+
readonly notReported: string;
|
|
61
|
+
readonly agent: string;
|
|
62
|
+
readonly plan: string;
|
|
63
|
+
readonly request: string;
|
|
64
|
+
readonly scope: string;
|
|
65
|
+
readonly allow: string;
|
|
66
|
+
readonly deny: string;
|
|
67
|
+
readonly stop: string;
|
|
68
|
+
readonly check: string;
|
|
69
|
+
readonly renew: string;
|
|
70
|
+
readonly unknown: string;
|
|
71
|
+
readonly approvalHint: string;
|
|
72
|
+
readonly expires: string;
|
|
73
|
+
readonly denied: string;
|
|
74
|
+
readonly complete: string;
|
|
75
|
+
readonly toolStates: {
|
|
76
|
+
readonly pending: string;
|
|
77
|
+
readonly approval: string;
|
|
78
|
+
readonly running: string;
|
|
79
|
+
readonly completed: string;
|
|
80
|
+
readonly rejected: string;
|
|
81
|
+
readonly unknown: string;
|
|
82
|
+
};
|
|
83
|
+
readonly agentStates: {
|
|
84
|
+
readonly ready: string;
|
|
85
|
+
readonly approval: string;
|
|
86
|
+
readonly running: string;
|
|
87
|
+
readonly checking: string;
|
|
88
|
+
readonly failed: string;
|
|
89
|
+
readonly uncertain: string;
|
|
90
|
+
readonly denied: string;
|
|
91
|
+
readonly expired: string;
|
|
92
|
+
readonly complete: string;
|
|
93
|
+
};
|
|
94
|
+
readonly artifact: string;
|
|
95
|
+
readonly edit: string;
|
|
96
|
+
readonly save: string;
|
|
97
|
+
readonly saving: string;
|
|
98
|
+
readonly discard: string;
|
|
99
|
+
readonly revision: string;
|
|
100
|
+
readonly artifactContent: string;
|
|
101
|
+
readonly latest: string;
|
|
102
|
+
readonly localDraft: string;
|
|
103
|
+
readonly conflict: string;
|
|
104
|
+
readonly useLatest: string;
|
|
105
|
+
readonly keepDraft: string;
|
|
106
|
+
readonly loadError: string;
|
|
107
|
+
readonly retry: string;
|
|
108
|
+
readonly idleArtifact: string;
|
|
109
|
+
readonly feedback: string;
|
|
110
|
+
readonly helpful: string;
|
|
111
|
+
readonly unhelpful: string;
|
|
112
|
+
readonly comment: string;
|
|
113
|
+
readonly sendFeedback: string;
|
|
114
|
+
readonly savedFeedback: string;
|
|
115
|
+
readonly failedFeedback: string;
|
|
116
|
+
readonly threads: string;
|
|
117
|
+
readonly refresh: string;
|
|
118
|
+
readonly active: string;
|
|
119
|
+
readonly archived: string;
|
|
120
|
+
readonly archive: string;
|
|
121
|
+
readonly restore: string;
|
|
122
|
+
readonly rename: string;
|
|
123
|
+
readonly title: string;
|
|
124
|
+
readonly saveTitle: string;
|
|
125
|
+
readonly chooseThread: string;
|
|
126
|
+
readonly noThreads: string;
|
|
127
|
+
readonly threadError: string;
|
|
128
|
+
readonly loading: string;
|
|
129
|
+
};
|
|
130
|
+
export {};
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
export declare const interactionCopy: {
|
|
2
|
+
readonly code: "Code";
|
|
3
|
+
readonly files: "Files";
|
|
4
|
+
readonly checks: "Checks";
|
|
5
|
+
readonly passed: "Passed";
|
|
6
|
+
readonly failed: "Failed";
|
|
7
|
+
readonly artifactStates: {
|
|
8
|
+
readonly idle: "Choose an artifact";
|
|
9
|
+
readonly loading: "Loading artifact";
|
|
10
|
+
readonly "load-error": "Artifact unavailable";
|
|
11
|
+
readonly viewing: "Saved version";
|
|
12
|
+
readonly editing: "Draft edited";
|
|
13
|
+
readonly saving: "Saving revision";
|
|
14
|
+
readonly conflict: "Saved version changed";
|
|
15
|
+
readonly unknown: "Save result unknown";
|
|
16
|
+
readonly checking: "Checking save";
|
|
17
|
+
};
|
|
18
|
+
readonly invalid: "This content could not be displayed. Ask for an updated version.";
|
|
19
|
+
readonly explanation: "Progress explanation";
|
|
20
|
+
readonly supplied: "Reported by the host";
|
|
21
|
+
readonly inputs: "Inputs";
|
|
22
|
+
readonly output: "Result";
|
|
23
|
+
readonly tool: "Tool details";
|
|
24
|
+
readonly sources: "Sources";
|
|
25
|
+
readonly source: (index: number, title: string) => string;
|
|
26
|
+
readonly unavailable: "Source unavailable";
|
|
27
|
+
readonly noSources: "No sources were supplied.";
|
|
28
|
+
readonly retrieval: "Context used for this response";
|
|
29
|
+
readonly included: "Included";
|
|
30
|
+
readonly excluded: "Not included";
|
|
31
|
+
readonly checkClaim: "Check this claim";
|
|
32
|
+
readonly blocked: "This action cannot proceed";
|
|
33
|
+
readonly model: "Model";
|
|
34
|
+
readonly context: "Context to include";
|
|
35
|
+
readonly commands: "Commands";
|
|
36
|
+
readonly quote: "Quoted excerpt";
|
|
37
|
+
readonly reply: "Use excerpt in reply";
|
|
38
|
+
readonly connection: {
|
|
39
|
+
readonly connected: "Connected";
|
|
40
|
+
readonly reconnecting: "Reconnecting";
|
|
41
|
+
readonly disconnected: "Disconnected";
|
|
42
|
+
};
|
|
43
|
+
readonly disconnected: "The connection does not tell us whether remote work finished. Check the result before repeating an action.";
|
|
44
|
+
readonly reconnect: "Reconnect";
|
|
45
|
+
readonly trace: "Run measurements";
|
|
46
|
+
readonly notReported: "Not reported";
|
|
47
|
+
readonly agent: "Supervised plan";
|
|
48
|
+
readonly plan: "Proposed steps";
|
|
49
|
+
readonly request: "Review next step";
|
|
50
|
+
readonly scope: "Approval scope";
|
|
51
|
+
readonly allow: "Approve this step";
|
|
52
|
+
readonly deny: "Decline";
|
|
53
|
+
readonly stop: "Stop waiting";
|
|
54
|
+
readonly check: "Check status";
|
|
55
|
+
readonly renew: "Review again";
|
|
56
|
+
readonly unknown: "The result is unknown. Check the original request before running it again.";
|
|
57
|
+
readonly approvalHint: "Approval applies only to the displayed step and inputs. The host still checks your permissions.";
|
|
58
|
+
readonly expires: "Approval expires if you wait too long. Review the step again to continue.";
|
|
59
|
+
readonly denied: "The step was declined. Earlier completed work stays completed.";
|
|
60
|
+
readonly complete: "All steps are complete.";
|
|
61
|
+
readonly toolStates: {
|
|
62
|
+
readonly pending: "Pending";
|
|
63
|
+
readonly approval: "Awaiting approval";
|
|
64
|
+
readonly running: "Running";
|
|
65
|
+
readonly completed: "Complete";
|
|
66
|
+
readonly rejected: "Not applied";
|
|
67
|
+
readonly unknown: "Result unknown";
|
|
68
|
+
};
|
|
69
|
+
readonly agentStates: {
|
|
70
|
+
readonly ready: "Ready to review";
|
|
71
|
+
readonly approval: "Awaiting approval";
|
|
72
|
+
readonly running: "Working";
|
|
73
|
+
readonly checking: "Checking result";
|
|
74
|
+
readonly failed: "Step not applied";
|
|
75
|
+
readonly uncertain: "Result unknown";
|
|
76
|
+
readonly denied: "Declined";
|
|
77
|
+
readonly expired: "Approval expired";
|
|
78
|
+
readonly complete: "Complete";
|
|
79
|
+
};
|
|
80
|
+
readonly artifact: "Artifact";
|
|
81
|
+
readonly edit: "Edit draft";
|
|
82
|
+
readonly save: "Save revision";
|
|
83
|
+
readonly saving: "Saving revision";
|
|
84
|
+
readonly discard: "Discard edits";
|
|
85
|
+
readonly revision: "Revision";
|
|
86
|
+
readonly artifactContent: "Artifact content";
|
|
87
|
+
readonly latest: "Latest saved version";
|
|
88
|
+
readonly localDraft: "Your draft";
|
|
89
|
+
readonly conflict: "The saved version changed. Compare it with your draft before choosing what to keep.";
|
|
90
|
+
readonly useLatest: "Use latest saved version";
|
|
91
|
+
readonly keepDraft: "Keep my draft against the latest version";
|
|
92
|
+
readonly loadError: "Couldn’t load this artifact. Try again; the current work is still here.";
|
|
93
|
+
readonly retry: "Try again";
|
|
94
|
+
readonly idleArtifact: "Choose an artifact to open.";
|
|
95
|
+
readonly feedback: "Response feedback";
|
|
96
|
+
readonly helpful: "Helpful";
|
|
97
|
+
readonly unhelpful: "Needs work";
|
|
98
|
+
readonly comment: "What should change?";
|
|
99
|
+
readonly sendFeedback: "Save feedback";
|
|
100
|
+
readonly savedFeedback: "Feedback saved for this response.";
|
|
101
|
+
readonly failedFeedback: "Feedback is not confirmed. Retry with the same feedback.";
|
|
102
|
+
readonly threads: "Conversation history";
|
|
103
|
+
readonly refresh: "Refresh conversations";
|
|
104
|
+
readonly active: "Active";
|
|
105
|
+
readonly archived: "Archived";
|
|
106
|
+
readonly archive: "Archive conversation";
|
|
107
|
+
readonly restore: "Restore conversation";
|
|
108
|
+
readonly rename: "Rename conversation";
|
|
109
|
+
readonly title: "Conversation title";
|
|
110
|
+
readonly saveTitle: "Save title";
|
|
111
|
+
readonly chooseThread: "Choose a conversation to see its saved context.";
|
|
112
|
+
readonly noThreads: "No conversations in this view.";
|
|
113
|
+
readonly threadError: "Couldn’t complete that request. The current conversation is still here.";
|
|
114
|
+
readonly loading: "Loading";
|
|
115
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { InteractionStore } from "./store.js";
|
|
3
|
+
declare const feedbackSchema: z.ZodObject<{
|
|
4
|
+
requestId: z.ZodString;
|
|
5
|
+
responseId: z.ZodString;
|
|
6
|
+
rating: z.ZodEnum<{
|
|
7
|
+
helpful: "helpful";
|
|
8
|
+
unhelpful: "unhelpful";
|
|
9
|
+
}>;
|
|
10
|
+
comment: z.ZodString;
|
|
11
|
+
}, z.core.$strict>;
|
|
12
|
+
export type FeedbackRequest = z.infer<typeof feedbackSchema>;
|
|
13
|
+
export interface FeedbackAdapter {
|
|
14
|
+
/** Upsert feedback for responseId and deduplicate retries by requestId. Resolve only after storage acknowledges. */
|
|
15
|
+
save(request: FeedbackRequest, signal: AbortSignal): Promise<{
|
|
16
|
+
requestId: string;
|
|
17
|
+
responseId: string;
|
|
18
|
+
}>;
|
|
19
|
+
}
|
|
20
|
+
export interface FeedbackSnapshot {
|
|
21
|
+
responseId: string;
|
|
22
|
+
rating: "helpful" | "unhelpful" | null;
|
|
23
|
+
comment: string;
|
|
24
|
+
phase: "editing" | "saving" | "saved" | "error";
|
|
25
|
+
request?: FeedbackRequest;
|
|
26
|
+
}
|
|
27
|
+
export declare class FeedbackController extends InteractionStore<FeedbackSnapshot> {
|
|
28
|
+
private adapter;
|
|
29
|
+
private id;
|
|
30
|
+
constructor(adapter: FeedbackAdapter, responseId: string, id?: () => string);
|
|
31
|
+
edit(rating: FeedbackSnapshot["rating"], comment?: string): boolean;
|
|
32
|
+
save(): boolean;
|
|
33
|
+
}
|
|
34
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export * from "./agent.js";
|
|
2
|
+
export * from "./artifact.js";
|
|
3
|
+
export * from "./feedback.js";
|
|
4
|
+
export * from "./threads.js";
|
|
5
|
+
export * from "./presentation.js";
|
|
6
|
+
export * from "./web.js";
|
|
7
|
+
export { interactionCopy } from "./copy.js";
|
|
8
|
+
export { jsonSchema } from "./store.js";
|
|
9
|
+
export { InteractionProvider } from "./context.js";
|
|
10
|
+
export type { InteractionCopy, InteractionCopyOverrides } from "./context.js";
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import type { Choice, MenuCommand } from "../ui/index.js";
|
|
4
|
+
import type { interactionCopy as copy } from "./copy.js";
|
|
5
|
+
import { type JsonValue } from "./store.js";
|
|
6
|
+
/** Evidence links may navigate only to explicit HTTP(S) destinations, without embedded credentials. */
|
|
7
|
+
export declare function evidenceUrl(value: unknown): string | undefined;
|
|
8
|
+
declare const sourceSchema: z.ZodObject<{
|
|
9
|
+
id: z.ZodString;
|
|
10
|
+
title: z.ZodString;
|
|
11
|
+
url: z.ZodOptional<z.ZodString>;
|
|
12
|
+
excerpt: z.ZodOptional<z.ZodString>;
|
|
13
|
+
claim: z.ZodOptional<z.ZodString>;
|
|
14
|
+
}, z.core.$strict>;
|
|
15
|
+
export type SourceDocument = z.infer<typeof sourceSchema>;
|
|
16
|
+
export declare function Sources({ sources, label, }: {
|
|
17
|
+
sources: readonly SourceDocument[];
|
|
18
|
+
label?: string;
|
|
19
|
+
}): import("react").JSX.Element;
|
|
20
|
+
export declare function Citation({ source, index }: {
|
|
21
|
+
source: SourceDocument;
|
|
22
|
+
index: number;
|
|
23
|
+
}): import("react").JSX.Element;
|
|
24
|
+
export declare function RetrievalInspection({ documents, }: {
|
|
25
|
+
documents: readonly (SourceDocument & {
|
|
26
|
+
included: boolean;
|
|
27
|
+
})[];
|
|
28
|
+
}): import("react").JSX.Element;
|
|
29
|
+
export declare function Reasoning({ text, status, label, }: {
|
|
30
|
+
text: string;
|
|
31
|
+
status?: "working" | "complete";
|
|
32
|
+
label?: string;
|
|
33
|
+
}): import("react").JSX.Element;
|
|
34
|
+
export type ToolStatus = keyof typeof copy.toolStates;
|
|
35
|
+
export declare function ToolCall({ title, status, input, output, }: {
|
|
36
|
+
title: string;
|
|
37
|
+
status: ToolStatus;
|
|
38
|
+
input: JsonValue;
|
|
39
|
+
output?: string;
|
|
40
|
+
}): import("react").JSX.Element;
|
|
41
|
+
export declare function Confidence({ claim, explanation }: {
|
|
42
|
+
claim: string;
|
|
43
|
+
explanation: string;
|
|
44
|
+
}): import("react").JSX.Element;
|
|
45
|
+
export declare function Guardrail({ reason, alternatives, onChoose, }: {
|
|
46
|
+
reason: string;
|
|
47
|
+
alternatives: readonly {
|
|
48
|
+
id: string;
|
|
49
|
+
label: string;
|
|
50
|
+
}[];
|
|
51
|
+
onChoose: (id: string) => void;
|
|
52
|
+
}): import("react").JSX.Element;
|
|
53
|
+
export declare function ConnectionStatus({ state, onReconnect, }: {
|
|
54
|
+
state: "connected" | "reconnecting" | "disconnected";
|
|
55
|
+
onReconnect?: () => void;
|
|
56
|
+
}): import("react").JSX.Element;
|
|
57
|
+
export declare function ComposerTools({ models, model, onModelChange, contexts, selectedContext, onContextChange, commands, onCommand, }: {
|
|
58
|
+
models: readonly Choice[];
|
|
59
|
+
model: string;
|
|
60
|
+
onModelChange: (id: string) => void;
|
|
61
|
+
contexts?: readonly Choice[];
|
|
62
|
+
selectedContext?: readonly string[];
|
|
63
|
+
onContextChange?: (ids: string[]) => void;
|
|
64
|
+
commands?: readonly MenuCommand[];
|
|
65
|
+
onCommand?: (id: string) => void;
|
|
66
|
+
}): import("react").JSX.Element;
|
|
67
|
+
export interface Quote {
|
|
68
|
+
text: string;
|
|
69
|
+
sourceId: string;
|
|
70
|
+
sourceTitle: string;
|
|
71
|
+
}
|
|
72
|
+
export declare function QuotedExcerpt({ quote, onReply, }: {
|
|
73
|
+
quote: Quote;
|
|
74
|
+
onReply?: (quote: Quote) => void;
|
|
75
|
+
}): import("react").JSX.Element;
|
|
76
|
+
export declare function ExecutionInspector({ code, files, output, tests, }: {
|
|
77
|
+
code?: string;
|
|
78
|
+
files?: readonly string[];
|
|
79
|
+
output?: string;
|
|
80
|
+
tests?: readonly {
|
|
81
|
+
name: string;
|
|
82
|
+
passed: boolean;
|
|
83
|
+
}[];
|
|
84
|
+
}): import("react").JSX.Element;
|
|
85
|
+
export declare function Observability({ measurements, }: {
|
|
86
|
+
measurements: readonly {
|
|
87
|
+
label: string;
|
|
88
|
+
value?: string | number;
|
|
89
|
+
unit?: string;
|
|
90
|
+
}[];
|
|
91
|
+
}): import("react").JSX.Element;
|
|
92
|
+
export declare function AgentStatus({ label, status, children, }: {
|
|
93
|
+
label: string;
|
|
94
|
+
status: string;
|
|
95
|
+
children?: ReactNode;
|
|
96
|
+
}): import("react").JSX.Element;
|
|
97
|
+
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export type JsonValue = string | number | boolean | null | {
|
|
3
|
+
[key: string]: JsonValue;
|
|
4
|
+
} | JsonValue[];
|
|
5
|
+
export declare const jsonSchema: z.ZodCustom<JsonValue, JsonValue>;
|
|
6
|
+
export declare const identity: z.ZodString;
|
|
7
|
+
export declare const shortText: z.ZodString;
|
|
8
|
+
export declare const bodyText: z.ZodString;
|
|
9
|
+
export declare const newIdentity: () => `${string}-${string}-${string}-${string}-${string}`;
|
|
10
|
+
/** Small external store shared by the concrete interaction owners. No execution is hidden here. */
|
|
11
|
+
export declare class InteractionStore<S> {
|
|
12
|
+
protected state: S;
|
|
13
|
+
protected disposed: boolean;
|
|
14
|
+
protected generation: number;
|
|
15
|
+
protected abort?: AbortController;
|
|
16
|
+
private usedIds;
|
|
17
|
+
protected requestIdentity(create?: () => string): string;
|
|
18
|
+
private listeners;
|
|
19
|
+
constructor(initial: S);
|
|
20
|
+
getSnapshot: () => S;
|
|
21
|
+
subscribe: (listener: () => void) => () => boolean;
|
|
22
|
+
protected publish(state: S): void;
|
|
23
|
+
protected request(): {
|
|
24
|
+
token: number;
|
|
25
|
+
signal: AbortSignal;
|
|
26
|
+
};
|
|
27
|
+
protected current(token: number): boolean;
|
|
28
|
+
dispose(): void;
|
|
29
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { InteractionStore } from "./store.js";
|
|
3
|
+
export declare const threadSummarySchema: z.ZodObject<{
|
|
4
|
+
id: z.ZodString;
|
|
5
|
+
title: z.ZodString;
|
|
6
|
+
archived: z.ZodBoolean;
|
|
7
|
+
}, z.core.$strict>;
|
|
8
|
+
export declare const threadDocumentSchema: z.ZodObject<{
|
|
9
|
+
id: z.ZodString;
|
|
10
|
+
title: z.ZodString;
|
|
11
|
+
archived: z.ZodBoolean;
|
|
12
|
+
payload: z.ZodCustom<import("./store.js").JsonValue, import("./store.js").JsonValue>;
|
|
13
|
+
}, z.core.$strict>;
|
|
14
|
+
export type ThreadSummary = z.infer<typeof threadSummarySchema>;
|
|
15
|
+
export type ThreadDocument = z.infer<typeof threadDocumentSchema>;
|
|
16
|
+
export interface ThreadAdapter {
|
|
17
|
+
list(signal: AbortSignal): Promise<readonly ThreadSummary[]>;
|
|
18
|
+
load(id: string, signal: AbortSignal): Promise<ThreadDocument>;
|
|
19
|
+
rename(id: string, title: string, signal: AbortSignal): Promise<ThreadSummary>;
|
|
20
|
+
archive(id: string, archived: boolean, signal: AbortSignal): Promise<ThreadSummary>;
|
|
21
|
+
}
|
|
22
|
+
export interface ThreadSnapshot {
|
|
23
|
+
phase: "idle" | "listing" | "opening" | "mutating" | "ready" | "error";
|
|
24
|
+
items: readonly ThreadSummary[];
|
|
25
|
+
selected?: ThreadDocument;
|
|
26
|
+
pendingId?: string;
|
|
27
|
+
operation?: "list" | "open" | "rename" | "archive";
|
|
28
|
+
}
|
|
29
|
+
export declare class ThreadController extends InteractionStore<ThreadSnapshot> {
|
|
30
|
+
private adapter;
|
|
31
|
+
private canLeave;
|
|
32
|
+
constructor(adapter: ThreadAdapter, canLeave?: () => boolean);
|
|
33
|
+
refresh(): boolean;
|
|
34
|
+
open(id: string): boolean;
|
|
35
|
+
rename(id: string, title: string): boolean;
|
|
36
|
+
archive(id: string, archived: boolean): boolean;
|
|
37
|
+
private mutate;
|
|
38
|
+
}
|