@orangecatai/adgen-canvas 0.0.39 → 0.1.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/dist/dev/chunk-2K6ZAAHB.js +1535 -0
- package/dist/dev/chunk-2K6ZAAHB.js.map +7 -0
- package/dist/dev/{chunk-E7VZGEUJ.js → chunk-2Q5Z4UTF.js} +2 -2
- package/dist/dev/{chunk-E7VZGEUJ.js.map → chunk-2Q5Z4UTF.js.map} +1 -1
- package/dist/dev/{chunk-LIELFD5T.js → chunk-3WIRZ6S7.js} +6 -1
- package/dist/dev/chunk-3WIRZ6S7.js.map +7 -0
- package/dist/dev/{chunk-5XP2WJAQ.js → chunk-7XZBXIDZ.js} +1300 -1252
- package/dist/dev/chunk-7XZBXIDZ.js.map +7 -0
- package/dist/dev/chunk-AKA4GZ3R.js +62 -0
- package/dist/dev/chunk-AKA4GZ3R.js.map +7 -0
- package/dist/dev/chunk-LWUV2KR2.js +27 -0
- package/dist/dev/chunk-LWUV2KR2.js.map +7 -0
- package/dist/dev/chunk-T57LHRZV.js +2167 -0
- package/dist/dev/chunk-T57LHRZV.js.map +7 -0
- package/dist/dev/components/auto-resize/nativeResizeAgent-5XWJJ74W.js +1074 -0
- package/dist/dev/components/auto-resize/nativeResizeAgent-5XWJJ74W.js.map +7 -0
- package/dist/dev/data/{image-PUPXCX7M.js → image-MTDE3WXB.js} +4 -3
- package/dist/dev/index.css +618 -27
- package/dist/dev/index.css.map +3 -3
- package/dist/dev/index.js +6769 -8217
- package/dist/dev/index.js.map +4 -4
- package/dist/dev/locales/{en-VCZQBJ2N.js → en-3S2H3QGO.js} +2 -2
- package/dist/dev/model-capabilities.js +47 -0
- package/dist/dev/model-capabilities.js.map +7 -0
- package/dist/dev/subset-shared.chunk.js +1 -1
- package/dist/dev/subset-worker.chunk.js +1 -1
- package/dist/prod/chunk-6YYSQB5E.js +1 -0
- package/dist/prod/{chunk-CLQPYXMS.js → chunk-PIM2DC2L.js} +3 -3
- package/dist/prod/chunk-POCDVKZK.js +142 -0
- package/dist/prod/chunk-PWBUVPCU.js +1 -0
- package/dist/prod/{chunk-WBFDC4WN.js → chunk-R4DNAEVN.js} +1 -1
- package/dist/prod/chunk-U2I2OXQ7.js +4 -0
- package/dist/prod/chunk-UR7GPHHO.js +1 -0
- package/dist/prod/components/auto-resize/nativeResizeAgent-45UNA3LO.js +5 -0
- package/dist/prod/data/image-U4RMOYQQ.js +1 -0
- package/dist/prod/index.css +1 -1
- package/dist/prod/index.js +67 -298
- package/dist/prod/locales/{en-ZZURI326.js → en-Z3CKUL4S.js} +1 -1
- package/dist/prod/model-capabilities.js +1 -0
- package/dist/prod/subset-shared.chunk.js +1 -1
- package/dist/prod/subset-worker.chunk.js +1 -1
- package/dist/types/common/src/utils.d.ts +4 -1
- package/dist/types/element/src/index.d.ts +3 -0
- package/dist/types/element/src/newElement.d.ts +2 -1
- package/dist/types/element/src/textHtml.d.ts +14 -0
- package/dist/types/element/src/textLayout.d.ts +97 -0
- package/dist/types/element/src/textStyleRanges.d.ts +62 -0
- package/dist/types/element/src/textWrapping.d.ts +27 -0
- package/dist/types/element/src/types.d.ts +35 -0
- package/dist/types/excalidraw/actions/actionFrame.d.ts +1 -0
- package/dist/types/excalidraw/actions/actionLinearEditor.d.ts +1 -0
- package/dist/types/excalidraw/actions/actionProperties.d.ts +50 -0
- package/dist/types/excalidraw/actions/index.d.ts +1 -1
- package/dist/types/excalidraw/actions/types.d.ts +1 -1
- package/dist/types/excalidraw/components/AIChatPanel.d.ts +18 -2
- package/dist/types/excalidraw/components/App.d.ts +6 -0
- package/dist/types/excalidraw/components/FontSizeInput.d.ts +19 -0
- package/dist/types/excalidraw/components/ImageGeneratorPanel.d.ts +946 -45
- package/dist/types/excalidraw/components/VideoGeneratorPanel.d.ts +67 -53
- package/dist/types/excalidraw/components/ai-chat/ActivityTimeline.d.ts +18 -0
- package/dist/types/excalidraw/components/ai-chat/activitySteps.d.ts +106 -0
- package/dist/types/excalidraw/components/ai-chat/agentLoop.d.ts +66 -3
- package/dist/types/excalidraw/components/ai-chat/canvasTools.d.ts +23 -8
- package/dist/types/excalidraw/components/ai-chat/htmlToExcalidraw.d.ts +3 -0
- package/dist/types/excalidraw/components/ai-chat/openRouterStream.d.ts +13 -0
- package/dist/types/excalidraw/components/auto-resize/ResizeActivityCard.d.ts +7 -0
- package/dist/types/excalidraw/components/auto-resize/autoResizeEngine.d.ts +5 -2
- package/dist/types/excalidraw/components/auto-resize/autoResizeStore.d.ts +23 -0
- package/dist/types/excalidraw/components/auto-resize/imageBounds.d.ts +11 -0
- package/dist/types/excalidraw/components/auto-resize/nativeResizeAgent.d.ts +5 -0
- package/dist/types/excalidraw/components/auto-resize/resizeFitting.d.ts +7 -0
- package/dist/types/excalidraw/components/auto-resize/resizeLayout.d.ts +33 -0
- package/dist/types/excalidraw/components/icons.d.ts +6 -0
- package/dist/types/excalidraw/components/template-builder/TemplateBuilderTray.d.ts +1 -0
- package/dist/types/excalidraw/index.d.ts +9 -0
- package/dist/types/excalidraw/modelCapabilities/index.d.ts +17 -0
- package/dist/types/excalidraw/modelCapabilities/registry.image.d.ts +2 -0
- package/dist/types/excalidraw/modelCapabilities/registry.video.d.ts +2 -0
- package/dist/types/excalidraw/modelCapabilities/shared.d.ts +24 -0
- package/dist/types/excalidraw/modelCapabilities/types.d.ts +276 -0
- package/dist/types/excalidraw/modelCapabilities/validate.d.ts +48 -0
- package/dist/types/excalidraw/types.d.ts +4 -4
- package/dist/types/excalidraw/utils/imageApi.d.ts +3 -0
- package/dist/types/excalidraw/utils/referenceBudget.d.ts +12 -23
- package/dist/types/excalidraw/utils/videoApi.d.ts +21 -1
- package/dist/types/excalidraw/wysiwyg/richTextEditable.d.ts +36 -0
- package/dist/types/excalidraw/wysiwyg/textSelectionStyles.d.ts +32 -0
- package/dist/types/excalidraw/wysiwyg/textWysiwyg.d.ts +6 -2
- package/package.json +10 -4
- package/dist/dev/chunk-5XP2WJAQ.js.map +0 -7
- package/dist/dev/chunk-LIELFD5T.js.map +0 -7
- package/dist/prod/chunk-T3ZLBHX4.js +0 -4
- package/dist/prod/data/image-AG3CTRSJ.js +0 -1
- /package/dist/dev/data/{image-PUPXCX7M.js.map → image-MTDE3WXB.js.map} +0 -0
- /package/dist/dev/locales/{en-VCZQBJ2N.js.map → en-3S2H3QGO.js.map} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "./VideoGeneratorPanel.scss";
|
|
2
2
|
import type { ExcalidrawFrameLikeElement, NonDeletedExcalidrawElement } from "@orangecatai/element/types";
|
|
3
3
|
import type { AppClassProperties } from "../types";
|
|
4
|
-
declare const VIDEO_MODEL_CONFIG: {
|
|
4
|
+
export declare const VIDEO_MODEL_CONFIG: {
|
|
5
5
|
readonly "veo 3.1 fast": {
|
|
6
6
|
readonly modelId: "google/veo-3.1-fast";
|
|
7
7
|
readonly supportsFirstFrame: true;
|
|
@@ -12,11 +12,9 @@ declare const VIDEO_MODEL_CONFIG: {
|
|
|
12
12
|
readonly durationValues: readonly [4, 6, 8];
|
|
13
13
|
readonly supportsResolution: true;
|
|
14
14
|
readonly supportedResolutions: readonly ["720p", "1080p", "4K"];
|
|
15
|
-
readonly supportsNegativePrompt: false;
|
|
16
15
|
readonly supportedRatios: readonly ["16:9", "9:16"];
|
|
17
16
|
readonly frameInputMode: "dual-frame";
|
|
18
|
-
readonly supportsInputReferences:
|
|
19
|
-
readonly supportsSeed: true;
|
|
17
|
+
readonly supportsInputReferences: true;
|
|
20
18
|
};
|
|
21
19
|
readonly "veo 3.1 lite": {
|
|
22
20
|
readonly modelId: "google/veo-3.1-lite";
|
|
@@ -28,11 +26,9 @@ declare const VIDEO_MODEL_CONFIG: {
|
|
|
28
26
|
readonly durationValues: readonly [4, 6, 8];
|
|
29
27
|
readonly supportsResolution: true;
|
|
30
28
|
readonly supportedResolutions: readonly ["720p", "1080p"];
|
|
31
|
-
readonly supportsNegativePrompt: false;
|
|
32
29
|
readonly supportedRatios: readonly ["16:9", "9:16"];
|
|
33
30
|
readonly frameInputMode: "dual-frame";
|
|
34
31
|
readonly supportsInputReferences: false;
|
|
35
|
-
readonly supportsSeed: true;
|
|
36
32
|
};
|
|
37
33
|
readonly "kling v3 pro": {
|
|
38
34
|
readonly modelId: "kwaivgi/kling-v3.0-pro";
|
|
@@ -43,12 +39,11 @@ declare const VIDEO_MODEL_CONFIG: {
|
|
|
43
39
|
readonly durationMode: "slider";
|
|
44
40
|
readonly minDuration: 3;
|
|
45
41
|
readonly maxDuration: 15;
|
|
46
|
-
readonly supportsResolution:
|
|
47
|
-
readonly
|
|
42
|
+
readonly supportsResolution: true;
|
|
43
|
+
readonly supportedResolutions: readonly ["1080p", "4K"];
|
|
48
44
|
readonly supportedRatios: readonly ["16:9", "9:16", "1:1"];
|
|
49
45
|
readonly frameInputMode: "dual-frame";
|
|
50
|
-
readonly supportsInputReferences:
|
|
51
|
-
readonly supportsSeed: true;
|
|
46
|
+
readonly supportsInputReferences: true;
|
|
52
47
|
};
|
|
53
48
|
readonly "kling v3 std": {
|
|
54
49
|
readonly modelId: "kwaivgi/kling-v3.0-std";
|
|
@@ -59,82 +54,102 @@ declare const VIDEO_MODEL_CONFIG: {
|
|
|
59
54
|
readonly durationMode: "slider";
|
|
60
55
|
readonly minDuration: 3;
|
|
61
56
|
readonly maxDuration: 15;
|
|
62
|
-
readonly supportsResolution:
|
|
63
|
-
readonly
|
|
57
|
+
readonly supportsResolution: true;
|
|
58
|
+
readonly supportedResolutions: readonly ["720p"];
|
|
64
59
|
readonly supportedRatios: readonly ["16:9", "9:16", "1:1"];
|
|
65
60
|
readonly frameInputMode: "dual-frame";
|
|
66
|
-
readonly supportsInputReferences:
|
|
67
|
-
readonly supportsSeed: true;
|
|
61
|
+
readonly supportsInputReferences: true;
|
|
68
62
|
};
|
|
69
|
-
readonly "seedance 2.0": {
|
|
70
|
-
readonly modelId: "bytedance/seedance-2.0";
|
|
63
|
+
readonly "seedance 2.0 mini": {
|
|
64
|
+
readonly modelId: "bytedance/seedance-2.0-mini";
|
|
71
65
|
readonly supportsFirstFrame: true;
|
|
72
66
|
readonly supportsLastFrame: true;
|
|
73
|
-
readonly audioMode: "
|
|
67
|
+
readonly audioMode: "toggle";
|
|
74
68
|
readonly supportsDuration: true;
|
|
75
69
|
readonly durationMode: "slider";
|
|
76
70
|
readonly minDuration: 4;
|
|
77
71
|
readonly maxDuration: 15;
|
|
78
72
|
readonly supportsResolution: true;
|
|
79
|
-
readonly supportedResolutions: readonly ["480p", "720p"
|
|
80
|
-
readonly
|
|
81
|
-
readonly supportedRatios: readonly ["16:9", "9:16", "1:1", "4:3", "3:4", "21:9", "9:21"];
|
|
73
|
+
readonly supportedResolutions: readonly ["480p", "720p"];
|
|
74
|
+
readonly supportedRatios: readonly ["16:9", "9:16", "1:1", "4:3", "3:4", "21:9"];
|
|
82
75
|
readonly frameInputMode: "dual-frame";
|
|
83
76
|
readonly supportsInputReferences: true;
|
|
84
|
-
readonly supportsSeed: true;
|
|
85
77
|
};
|
|
86
|
-
readonly "seedance 2.
|
|
87
|
-
readonly modelId: "bytedance/seedance-2.
|
|
78
|
+
readonly "seedance 2.5": {
|
|
79
|
+
readonly modelId: "bytedance/seedance-2.5";
|
|
88
80
|
readonly supportsFirstFrame: true;
|
|
89
81
|
readonly supportsLastFrame: true;
|
|
90
|
-
readonly audioMode: "
|
|
82
|
+
readonly audioMode: "toggle";
|
|
91
83
|
readonly supportsDuration: true;
|
|
92
84
|
readonly durationMode: "slider";
|
|
93
85
|
readonly minDuration: 4;
|
|
94
|
-
readonly maxDuration:
|
|
86
|
+
readonly maxDuration: 30;
|
|
95
87
|
readonly supportsResolution: true;
|
|
96
|
-
readonly supportedResolutions: readonly ["480p", "720p"];
|
|
97
|
-
readonly
|
|
98
|
-
readonly supportedRatios: readonly ["16:9", "9:16", "1:1", "4:3", "3:4", "21:9", "9:21"];
|
|
88
|
+
readonly supportedResolutions: readonly ["480p", "720p", "1080p"];
|
|
89
|
+
readonly supportedRatios: readonly ["16:9", "9:16", "1:1", "4:3", "3:4", "21:9"];
|
|
99
90
|
readonly frameInputMode: "dual-frame";
|
|
100
91
|
readonly supportsInputReferences: true;
|
|
101
|
-
readonly supportsSeed: true;
|
|
102
92
|
};
|
|
103
|
-
readonly "
|
|
104
|
-
readonly modelId: "
|
|
93
|
+
readonly "grok imagine video 1.5": {
|
|
94
|
+
readonly modelId: "x-ai/grok-imagine-video-1.5";
|
|
105
95
|
readonly supportsFirstFrame: true;
|
|
106
|
-
readonly supportsLastFrame:
|
|
107
|
-
readonly audioMode: "
|
|
96
|
+
readonly supportsLastFrame: true;
|
|
97
|
+
readonly audioMode: "toggle";
|
|
108
98
|
readonly supportsDuration: true;
|
|
109
99
|
readonly durationMode: "slider";
|
|
110
|
-
readonly minDuration:
|
|
100
|
+
readonly minDuration: 1;
|
|
111
101
|
readonly maxDuration: 15;
|
|
112
102
|
readonly supportsResolution: true;
|
|
113
|
-
readonly supportedResolutions: readonly ["720p", "1080p"];
|
|
114
|
-
readonly
|
|
115
|
-
readonly
|
|
116
|
-
readonly
|
|
117
|
-
readonly supportsInputReferences: false;
|
|
118
|
-
readonly supportsSeed: true;
|
|
103
|
+
readonly supportedResolutions: readonly ["480p", "720p", "1080p"];
|
|
104
|
+
readonly supportedRatios: readonly ["16:9", "9:16", "1:1", "4:3", "3:4", "3:2", "2:3"];
|
|
105
|
+
readonly frameInputMode: "dual-frame";
|
|
106
|
+
readonly supportsInputReferences: true;
|
|
119
107
|
};
|
|
120
|
-
readonly "
|
|
121
|
-
readonly modelId: "
|
|
108
|
+
readonly "wan 3.0 prime": {
|
|
109
|
+
readonly modelId: "alibaba/wan-3.0-prime";
|
|
122
110
|
readonly supportsFirstFrame: true;
|
|
123
|
-
readonly supportsLastFrame:
|
|
124
|
-
readonly audioMode: "
|
|
111
|
+
readonly supportsLastFrame: true;
|
|
112
|
+
readonly audioMode: "toggle";
|
|
125
113
|
readonly supportsDuration: true;
|
|
126
114
|
readonly durationMode: "slider";
|
|
127
|
-
readonly minDuration:
|
|
128
|
-
readonly maxDuration:
|
|
115
|
+
readonly minDuration: 2;
|
|
116
|
+
readonly maxDuration: 30;
|
|
129
117
|
readonly supportsResolution: true;
|
|
130
|
-
readonly supportedResolutions: readonly ["480p", "720p"];
|
|
131
|
-
readonly
|
|
132
|
-
readonly
|
|
133
|
-
readonly
|
|
134
|
-
|
|
135
|
-
|
|
118
|
+
readonly supportedResolutions: readonly ["480p", "720p", "1080p"];
|
|
119
|
+
readonly supportedRatios: readonly ["16:9", "9:16", "1:1", "4:3", "3:4"];
|
|
120
|
+
readonly frameInputMode: "dual-frame";
|
|
121
|
+
readonly supportsInputReferences: true;
|
|
122
|
+
};
|
|
123
|
+
readonly "wan 3.0": {
|
|
124
|
+
readonly modelId: "alibaba/wan-3.0";
|
|
125
|
+
readonly supportsFirstFrame: true;
|
|
126
|
+
readonly supportsLastFrame: true;
|
|
127
|
+
readonly audioMode: "toggle";
|
|
128
|
+
readonly supportsDuration: true;
|
|
129
|
+
readonly durationMode: "slider";
|
|
130
|
+
readonly minDuration: 2;
|
|
131
|
+
readonly maxDuration: 30;
|
|
132
|
+
readonly supportsResolution: true;
|
|
133
|
+
readonly supportedResolutions: readonly ["480p", "720p", "1080p"];
|
|
134
|
+
readonly supportedRatios: readonly ["16:9", "9:16", "1:1", "4:3", "3:4"];
|
|
135
|
+
readonly frameInputMode: "dual-frame";
|
|
136
|
+
readonly supportsInputReferences: true;
|
|
136
137
|
};
|
|
137
138
|
};
|
|
139
|
+
/**
|
|
140
|
+
* Whether we can actually SEND nested reference subjects ("Elements").
|
|
141
|
+
*
|
|
142
|
+
* Kuaishou documents Elements for Kling 3.0, and the capability record says so
|
|
143
|
+
* truthfully. But our requests reach Kling through the host proxy and
|
|
144
|
+
* OpenRouter's video endpoint, and the wire shape for Elements over that path
|
|
145
|
+
* is not something we have a first-party source for. Enabling the picker
|
|
146
|
+
* without it would produce confidently-wrong paid requests.
|
|
147
|
+
*
|
|
148
|
+
* The whole path -- picker, payload, host forwarding -- is implemented behind
|
|
149
|
+
* this flag. Flip it to `true` once the outgoing shape is confirmed, and the
|
|
150
|
+
* Kling reference UI lights up with no further code changes.
|
|
151
|
+
*/
|
|
152
|
+
export declare const ELEMENTS_TRANSPORT_ENABLED = false;
|
|
138
153
|
export type VideoModelName = keyof typeof VIDEO_MODEL_CONFIG;
|
|
139
154
|
export declare const VIDEO_MODEL_NAMES: VideoModelName[];
|
|
140
155
|
export declare const VideoGeneratorPanel: ({ element, app, onBeforeVideoGen, onAfterVideoGen, }: {
|
|
@@ -146,4 +161,3 @@ export declare const VideoGeneratorPanel: ({ element, app, onBeforeVideoGen, onA
|
|
|
146
161
|
}>;
|
|
147
162
|
onAfterVideoGen?: () => void;
|
|
148
163
|
}) => import("react/jsx-runtime").JSX.Element | null;
|
|
149
|
-
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type ActivityStep } from "./activitySteps";
|
|
2
|
+
import "./ActivityTimeline.scss";
|
|
3
|
+
export type ActivityTimelineProps = {
|
|
4
|
+
steps: ActivityStep[];
|
|
5
|
+
/** True while the agent is still working on this turn. */
|
|
6
|
+
isLive?: boolean;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* The agent's work, shown as it happens.
|
|
10
|
+
*
|
|
11
|
+
* Expanded while the turn is live so the user can watch, collapsed to a
|
|
12
|
+
* one-line summary afterwards so a finished transcript stays readable. Both
|
|
13
|
+
* states are reachable by click — nothing here is ever thrown away.
|
|
14
|
+
*/
|
|
15
|
+
export declare function ActivityTimeline({ steps, isLive }: ActivityTimelineProps): import("react/jsx-runtime").JSX.Element | null;
|
|
16
|
+
export declare namespace ActivityTimeline {
|
|
17
|
+
var displayName: string;
|
|
18
|
+
}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent activity steps — the shared vocabulary for showing the user what the
|
|
3
|
+
* agent is actually doing.
|
|
4
|
+
*
|
|
5
|
+
* Before this module the agent loop's rich `AgentUpdate` events were collapsed
|
|
6
|
+
* into a single `statusText` string in AIChatPanel, so every intermediate step
|
|
7
|
+
* was destroyed by the next one and nothing survived the turn. An
|
|
8
|
+
* `ActivityStep[]` lives on the assistant `ChatMessage`, renders inline in the
|
|
9
|
+
* turn (thinking → tool → review rows, in order), and is persisted by the host
|
|
10
|
+
* so the work is still visible after a reload.
|
|
11
|
+
*
|
|
12
|
+
* Everything here is pure — no React, no DOM — so the reducer is unit-testable
|
|
13
|
+
* and the host can carry a structurally identical copy for its own chat.
|
|
14
|
+
*/
|
|
15
|
+
import type { AgentUpdate, ToolAction } from "./agentLoop";
|
|
16
|
+
export type ActivityStepStatus = "running" | "ok" | "error";
|
|
17
|
+
export type ActivityStep = {
|
|
18
|
+
id: string;
|
|
19
|
+
kind: "thinking";
|
|
20
|
+
text: string;
|
|
21
|
+
done: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* `model` — real reasoning tokens streamed back by the provider.
|
|
24
|
+
* `narration` — the agent loop's own status lines, used as the fallback
|
|
25
|
+
* when the model returns no reasoning (many models never do).
|
|
26
|
+
*/
|
|
27
|
+
source: "model" | "narration";
|
|
28
|
+
/** Loop iteration this block belongs to; lets model reasoning replace narration. */
|
|
29
|
+
iteration?: number;
|
|
30
|
+
} | {
|
|
31
|
+
id: string;
|
|
32
|
+
kind: "tool";
|
|
33
|
+
name: string;
|
|
34
|
+
label: string;
|
|
35
|
+
args?: Record<string, unknown>;
|
|
36
|
+
status: ActivityStepStatus;
|
|
37
|
+
/** Live progress text while the tool runs; cleared once it resolves. */
|
|
38
|
+
progress?: string;
|
|
39
|
+
resultSummary?: string;
|
|
40
|
+
} | {
|
|
41
|
+
id: string;
|
|
42
|
+
kind: "handoff";
|
|
43
|
+
from?: string;
|
|
44
|
+
to: string;
|
|
45
|
+
label: string;
|
|
46
|
+
} | {
|
|
47
|
+
id: string;
|
|
48
|
+
kind: "review";
|
|
49
|
+
status: "running" | "approved" | "issues" | "error";
|
|
50
|
+
summary?: string;
|
|
51
|
+
issueCount?: number;
|
|
52
|
+
round?: number;
|
|
53
|
+
} | {
|
|
54
|
+
id: string;
|
|
55
|
+
kind: "status";
|
|
56
|
+
label: string;
|
|
57
|
+
}
|
|
58
|
+
/** Model prose emitted mid-loop, before a tool call — kept out of `content`. */
|
|
59
|
+
| {
|
|
60
|
+
id: string;
|
|
61
|
+
kind: "note";
|
|
62
|
+
text: string;
|
|
63
|
+
};
|
|
64
|
+
/** Mutable bookkeeping the reducer needs across updates within one turn. */
|
|
65
|
+
export type ActivityReducerContext = {
|
|
66
|
+
iteration: number;
|
|
67
|
+
/** True once real model reasoning has arrived for the current iteration. */
|
|
68
|
+
modelReasoningSeen: boolean;
|
|
69
|
+
};
|
|
70
|
+
export declare function createReducerContext(): ActivityReducerContext;
|
|
71
|
+
/** Upper bound on stored thinking text, so a long chain-of-thought cannot bloat the DB row. */
|
|
72
|
+
export declare const MAX_THINKING_CHARS = 8000;
|
|
73
|
+
/**
|
|
74
|
+
* Turn a tool call into something a person can read.
|
|
75
|
+
* Moved here from agentLoop's `formatToolStartMessage` so the timeline can
|
|
76
|
+
* label a persisted step without re-running the loop.
|
|
77
|
+
*/
|
|
78
|
+
export declare function humanizeToolLabel(name: string, args?: Record<string, unknown>): string;
|
|
79
|
+
/**
|
|
80
|
+
* Insert a step, or merge it into the existing step with the same id.
|
|
81
|
+
* The host SSE channel re-sends a step to move it from `running` to `ok`, and
|
|
82
|
+
* the SDK does the same with `tool_start` → `tool_done`, so upsert-by-id is
|
|
83
|
+
* the one write primitive both sides need.
|
|
84
|
+
*/
|
|
85
|
+
export declare function upsertStep(steps: ActivityStep[], step: ActivityStep): ActivityStep[];
|
|
86
|
+
/**
|
|
87
|
+
* Fold one `AgentUpdate` into the step list.
|
|
88
|
+
*
|
|
89
|
+
* Returns a new array (or the same reference when the update changes nothing),
|
|
90
|
+
* and mutates `ctx` — the caller keeps one context per agent run.
|
|
91
|
+
*/
|
|
92
|
+
export declare function applyAgentUpdate(steps: ActivityStep[], update: AgentUpdate, ctx: ActivityReducerContext): ActivityStep[];
|
|
93
|
+
/**
|
|
94
|
+
* Close out a finished (or aborted) turn: anything still spinning became an
|
|
95
|
+
* error the moment the loop stopped, and a half-open thinking block should not
|
|
96
|
+
* shimmer forever after a reload.
|
|
97
|
+
*/
|
|
98
|
+
export declare function finalizeSteps(steps: ActivityStep[]): ActivityStep[];
|
|
99
|
+
/**
|
|
100
|
+
* Render messages persisted before this feature existed. Those rows only kept
|
|
101
|
+
* `{success, statusMessage}` per action — no tool name, no args — so the
|
|
102
|
+
* timeline shows the status line and nothing it cannot honestly reconstruct.
|
|
103
|
+
*/
|
|
104
|
+
export declare function stepsFromLegacyToolActions(actions: ToolAction[] | undefined): ActivityStep[];
|
|
105
|
+
/** Short header text for a collapsed timeline, e.g. "4 steps". */
|
|
106
|
+
export declare function summarizeSteps(steps: ActivityStep[]): string;
|
|
@@ -25,6 +25,13 @@ export type AgentMessage = {
|
|
|
25
25
|
role: "assistant";
|
|
26
26
|
content: string | null;
|
|
27
27
|
tool_calls?: ToolCall[];
|
|
28
|
+
/**
|
|
29
|
+
* Structured reasoning blocks returned by the model on the turn that
|
|
30
|
+
* produced `tool_calls`. OpenRouter requires these to be echoed back
|
|
31
|
+
* unmodified on the next request, or the provider rejects the sequence.
|
|
32
|
+
* Only ever set when the model actually returned them.
|
|
33
|
+
*/
|
|
34
|
+
reasoning_details?: unknown[];
|
|
28
35
|
} | {
|
|
29
36
|
role: "tool";
|
|
30
37
|
tool_call_id: string;
|
|
@@ -39,18 +46,67 @@ export type ToolCall = {
|
|
|
39
46
|
};
|
|
40
47
|
};
|
|
41
48
|
export type ToolAction = {
|
|
49
|
+
/** Tool that ran. Optional: rows persisted before activity steps existed lack it. */
|
|
50
|
+
name?: string;
|
|
51
|
+
/** Parsed arguments the tool was called with, used to label the step. */
|
|
52
|
+
args?: Record<string, unknown>;
|
|
42
53
|
result: {
|
|
43
54
|
success: boolean;
|
|
44
55
|
statusMessage: string;
|
|
45
56
|
};
|
|
46
57
|
};
|
|
47
|
-
|
|
48
|
-
|
|
58
|
+
/**
|
|
59
|
+
* Everything the loop tells the UI about its own progress.
|
|
60
|
+
*
|
|
61
|
+
* Every variant carries `message` so a consumer that only ever read `.message`
|
|
62
|
+
* still works; the extra fields are what let the panel build a real activity
|
|
63
|
+
* timeline (tool names, arguments, outcomes) instead of one overwritten string.
|
|
64
|
+
*/
|
|
65
|
+
export type AgentUpdate =
|
|
66
|
+
/** A new pass through the loop is starting. Resets per-iteration thinking. */
|
|
67
|
+
{
|
|
68
|
+
type: "iteration_start";
|
|
69
|
+
iteration: number;
|
|
70
|
+
message: string;
|
|
71
|
+
}
|
|
72
|
+
/** Loop narration — the fallback shown when the model streams no reasoning. */
|
|
73
|
+
| {
|
|
74
|
+
type: "status";
|
|
75
|
+
message: string;
|
|
76
|
+
}
|
|
77
|
+
/** A chunk of real model reasoning. */
|
|
78
|
+
| {
|
|
79
|
+
type: "reasoning_delta";
|
|
80
|
+
message: string;
|
|
81
|
+
}
|
|
82
|
+
/** Model prose emitted alongside tool calls, before the final answer. */
|
|
83
|
+
| {
|
|
84
|
+
type: "note";
|
|
85
|
+
message: string;
|
|
86
|
+
} | {
|
|
87
|
+
type: "tool_start";
|
|
88
|
+
message: string;
|
|
89
|
+
toolCallId: string;
|
|
90
|
+
name: string;
|
|
91
|
+
args: Record<string, unknown>;
|
|
92
|
+
} | {
|
|
93
|
+
type: "tool_done";
|
|
94
|
+
message: string;
|
|
95
|
+
toolCallId: string;
|
|
96
|
+
name: string;
|
|
97
|
+
args?: Record<string, unknown>;
|
|
98
|
+
success: boolean;
|
|
99
|
+
toolAction: ToolAction;
|
|
100
|
+
} | {
|
|
101
|
+
type: "content_delta";
|
|
102
|
+
message: string;
|
|
103
|
+
} | {
|
|
104
|
+
type: "final";
|
|
49
105
|
message: string;
|
|
50
|
-
toolAction?: ToolAction;
|
|
51
106
|
} | {
|
|
52
107
|
type: "review_start";
|
|
53
108
|
message: string;
|
|
109
|
+
round: number;
|
|
54
110
|
} | {
|
|
55
111
|
type: "review_done";
|
|
56
112
|
message: string;
|
|
@@ -127,5 +183,12 @@ export declare function runAgentLoop(opts: {
|
|
|
127
183
|
* @default 1
|
|
128
184
|
*/
|
|
129
185
|
maxReviewRounds?: number;
|
|
186
|
+
/**
|
|
187
|
+
* When set, asks the provider for reasoning tokens at this effort level and
|
|
188
|
+
* streams them to the UI as `reasoning_delta` updates. Unset means no
|
|
189
|
+
* `reasoning` field is sent at all; the UI then falls back to narrating the
|
|
190
|
+
* loop's own status lines.
|
|
191
|
+
*/
|
|
192
|
+
reasoningEffort?: "low" | "medium" | "high";
|
|
130
193
|
}): Promise<AgentResult>;
|
|
131
194
|
export {};
|
|
@@ -5,7 +5,7 @@ import type { ExcalidrawImperativeAPI, BrandContext } from "../../types";
|
|
|
5
5
|
* does not pass `agentImageModel`. Hosts should pass the prop — this only keeps
|
|
6
6
|
* the SDK usable standalone.
|
|
7
7
|
*/
|
|
8
|
-
export declare const DEFAULT_AGENT_IMAGE_MODEL = "openai/gpt-image-2";
|
|
8
|
+
export declare const DEFAULT_AGENT_IMAGE_MODEL = "openai/gpt-image-2.5-flare";
|
|
9
9
|
/** The only video model the chat agent can drive. */
|
|
10
10
|
export declare const CHAT_VIDEO_MODEL = "google/veo-3.1-fast";
|
|
11
11
|
export declare const VIDEO_TOOLS: ({
|
|
@@ -52,7 +52,7 @@ export declare const VIDEO_TOOLS: ({
|
|
|
52
52
|
};
|
|
53
53
|
duration: {
|
|
54
54
|
type: string;
|
|
55
|
-
enum:
|
|
55
|
+
enum: number[];
|
|
56
56
|
description: string;
|
|
57
57
|
};
|
|
58
58
|
narrative_prompt?: undefined;
|
|
@@ -257,11 +257,11 @@ export declare const CANVAS_TOOLS: readonly [{
|
|
|
257
257
|
};
|
|
258
258
|
readonly width: {
|
|
259
259
|
readonly type: "number";
|
|
260
|
-
readonly description: "
|
|
260
|
+
readonly description: "Exact output width in pixels. For GPT Image 2.5 it must be a multiple of 16 and pass the documented custom-size limits.";
|
|
261
261
|
};
|
|
262
262
|
readonly height: {
|
|
263
263
|
readonly type: "number";
|
|
264
|
-
readonly description: "
|
|
264
|
+
readonly description: "Exact output height in pixels. For GPT Image 2.5 it must be a multiple of 16 and pass the documented custom-size limits.";
|
|
265
265
|
};
|
|
266
266
|
};
|
|
267
267
|
readonly required: readonly ["frameId", "prompt", "x", "y", "width", "height"];
|
|
@@ -312,7 +312,7 @@ export declare const CANVAS_TOOLS: readonly [{
|
|
|
312
312
|
};
|
|
313
313
|
duration: {
|
|
314
314
|
type: string;
|
|
315
|
-
enum:
|
|
315
|
+
enum: number[];
|
|
316
316
|
description: string;
|
|
317
317
|
};
|
|
318
318
|
narrative_prompt?: undefined;
|
|
@@ -505,7 +505,7 @@ export declare const BANNER_TOOLS: readonly [...({
|
|
|
505
505
|
};
|
|
506
506
|
duration: {
|
|
507
507
|
type: string;
|
|
508
|
-
enum:
|
|
508
|
+
enum: number[];
|
|
509
509
|
description: string;
|
|
510
510
|
};
|
|
511
511
|
narrative_prompt?: undefined;
|
|
@@ -604,11 +604,20 @@ export declare const BANNER_TOOLS: readonly [...({
|
|
|
604
604
|
};
|
|
605
605
|
readonly width: {
|
|
606
606
|
readonly type: "number";
|
|
607
|
-
readonly description: "
|
|
607
|
+
readonly description: "Exact output width in pixels. GPT Image 2.5 requires a multiple of 16, no edge above 3840, a 1:3 to 3:1 ratio, and 655,360 to 8,294,400 total pixels.";
|
|
608
608
|
};
|
|
609
609
|
readonly height: {
|
|
610
610
|
readonly type: "number";
|
|
611
|
-
readonly description: "
|
|
611
|
+
readonly description: "Exact output height in pixels. If the requested dimensions are rejected, ask the user to choose one of the valid examples returned by the tool.";
|
|
612
|
+
};
|
|
613
|
+
readonly quality: {
|
|
614
|
+
readonly type: "string";
|
|
615
|
+
readonly enum: readonly ["auto", "low", "medium", "high", "xhigh", "max"];
|
|
616
|
+
readonly description: "GPT Image 2.5 output quality. xhigh is shown to users as Very High.";
|
|
617
|
+
};
|
|
618
|
+
readonly transparentBackground: {
|
|
619
|
+
readonly type: "boolean";
|
|
620
|
+
readonly description: "Generate a transparent PNG background with GPT Image 2.5.";
|
|
612
621
|
};
|
|
613
622
|
readonly referenceImageIndex: {
|
|
614
623
|
readonly type: "number";
|
|
@@ -1124,3 +1133,9 @@ export declare function fitGeneratedImageToFrame(actualW: number, actualH: numbe
|
|
|
1124
1133
|
offsetX: number;
|
|
1125
1134
|
offsetY: number;
|
|
1126
1135
|
};
|
|
1136
|
+
export declare function validateAgentGptImageSize(width: number, height: number): {
|
|
1137
|
+
valid: true;
|
|
1138
|
+
} | {
|
|
1139
|
+
valid: false;
|
|
1140
|
+
error: string;
|
|
1141
|
+
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { TextStyleRange } from "@orangecatai/element/types";
|
|
1
2
|
export type ParsedRectangle = {
|
|
2
3
|
kind: "rectangle";
|
|
3
4
|
x: number;
|
|
@@ -35,6 +36,8 @@ export type ParsedText = {
|
|
|
35
36
|
color: string;
|
|
36
37
|
textAlign: "left" | "center" | "right";
|
|
37
38
|
opacity: number;
|
|
39
|
+
/** per-run overrides picked up from inline markup (<b>, <span style>, …) */
|
|
40
|
+
styleRanges?: readonly TextStyleRange[];
|
|
38
41
|
};
|
|
39
42
|
export type ParsedImage = {
|
|
40
43
|
kind: "image";
|
|
@@ -10,6 +10,19 @@ export type OpenRouterDelta = {
|
|
|
10
10
|
arguments?: string;
|
|
11
11
|
};
|
|
12
12
|
}> | null;
|
|
13
|
+
/**
|
|
14
|
+
* Human-readable reasoning text, when the provider streams one. OpenRouter
|
|
15
|
+
* normalises most providers onto `delta.reasoning`; a few speak
|
|
16
|
+
* `delta.reasoning_content` instead. Many models return neither — callers
|
|
17
|
+
* must tolerate reasoning never arriving.
|
|
18
|
+
*/
|
|
19
|
+
reasoning?: string | null;
|
|
20
|
+
/**
|
|
21
|
+
* Structured reasoning blocks (`delta.reasoning_details`). These must be
|
|
22
|
+
* echoed back unmodified on the assistant message in a tool-calling loop, so
|
|
23
|
+
* they are carried through verbatim rather than parsed.
|
|
24
|
+
*/
|
|
25
|
+
reasoningDetails?: unknown[] | null;
|
|
13
26
|
finishReason: string | null;
|
|
14
27
|
};
|
|
15
28
|
export type ToolCallAccumulator = {
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import "./ResizeActivityCard.scss";
|
|
2
|
+
import type { ResizeActivity } from "./autoResizeStore";
|
|
3
|
+
export declare const ResizeActivityCard: ({ activity, left, top, }: {
|
|
4
|
+
activity: ResizeActivity;
|
|
5
|
+
left: number;
|
|
6
|
+
top: number;
|
|
7
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -30,6 +30,8 @@ type ForegroundEl = {
|
|
|
30
30
|
width: number;
|
|
31
31
|
height: number;
|
|
32
32
|
text: string;
|
|
33
|
+
/** inline markup for per-run styles, when the text carries any */
|
|
34
|
+
contentHtml?: string;
|
|
33
35
|
fontSize: number;
|
|
34
36
|
color: string;
|
|
35
37
|
textAlign: string;
|
|
@@ -85,7 +87,7 @@ export declare function nearestGeminiAspectRatio(w: number, h: number): string;
|
|
|
85
87
|
export declare const GEMINI_RESOLUTION_TABLE: Record<string, Record<string, [number, number]>>;
|
|
86
88
|
/**
|
|
87
89
|
* Resolution levels offered by the Auto Resize panel.
|
|
88
|
-
* Nano Banana (gemini-
|
|
90
|
+
* Nano Banana (gemini-3.1-flash-image) and Nano Banana 2 (gemini-3.1-flash-lite-image)
|
|
89
91
|
* both support 0.5K–4K. 0.5K is the fastest/cheapest tier.
|
|
90
92
|
*/
|
|
91
93
|
export declare const AUTO_RESIZE_RESOLUTIONS: readonly ["0.5K", "1K", "2K", "4K"];
|
|
@@ -184,8 +186,9 @@ export declare function runAutoResize(opts: {
|
|
|
184
186
|
targetDimensions: TargetDimension[];
|
|
185
187
|
app: AppClassProperties;
|
|
186
188
|
autoResizeUrl: string;
|
|
189
|
+
/** Legacy option. Native Auto Resize uses RESIZE_MODEL (Grok 4.6). */
|
|
187
190
|
chatModel?: string;
|
|
188
|
-
/**
|
|
191
|
+
/** Legacy option. Native Auto Resize uses RESIZE_MODEL (Grok 4.6). */
|
|
189
192
|
reviewerModel?: string;
|
|
190
193
|
/** Image model used ONLY to outpaint photographic backgrounds. */
|
|
191
194
|
outpaintModel?: string;
|
|
@@ -5,8 +5,31 @@ export type LoadingFrameInfo = {
|
|
|
5
5
|
width: number;
|
|
6
6
|
height: number;
|
|
7
7
|
};
|
|
8
|
+
export type ResizeStep = {
|
|
9
|
+
id: number;
|
|
10
|
+
kind: "agent" | "tool";
|
|
11
|
+
name: string;
|
|
12
|
+
model?: string;
|
|
13
|
+
status: "running" | "done" | "error";
|
|
14
|
+
startedAt: number;
|
|
15
|
+
finishedAt?: number;
|
|
16
|
+
detail?: string;
|
|
17
|
+
};
|
|
18
|
+
export type ResizeActivity = LoadingFrameInfo & {
|
|
19
|
+
status: "running" | "done" | "error" | "cancelled";
|
|
20
|
+
steps: ResizeStep[];
|
|
21
|
+
cancel?: () => void;
|
|
22
|
+
};
|
|
8
23
|
type Listener = () => void;
|
|
9
24
|
export declare const autoResizeStore: {
|
|
25
|
+
startActivity(frame: LoadingFrameInfo, cancel?: () => void): void;
|
|
26
|
+
startStep(frameId: string, kind: ResizeStep["kind"], name: string, model?: string): number;
|
|
27
|
+
endStep(frameId: string, id: number, status: "done" | "error", detail?: string): void;
|
|
28
|
+
finishActivity(frameId: string, status: ResizeActivity["status"]): void;
|
|
29
|
+
cancelActivity(frameId: string): void;
|
|
30
|
+
dismissActivity(frameId: string): void;
|
|
31
|
+
getActivities(): ResizeActivity[];
|
|
32
|
+
resetActivity(): void;
|
|
10
33
|
setLoadingFrames(frames: LoadingFrameInfo[]): void;
|
|
11
34
|
markComplete(frameId: string): void;
|
|
12
35
|
clear(): void;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ExcalidrawElement } from "@orangecatai/element/types";
|
|
2
|
+
import type { BinaryFiles } from "../../types";
|
|
3
|
+
export type ImageBounds = {
|
|
4
|
+
x: number;
|
|
5
|
+
y: number;
|
|
6
|
+
width: number;
|
|
7
|
+
height: number;
|
|
8
|
+
};
|
|
9
|
+
export declare function alphaBounds(data: Uint8ClampedArray, width: number, height: number): ImageBounds;
|
|
10
|
+
/** Normalized visible bounds after the source crop and flip, before rotation. */
|
|
11
|
+
export declare function measureImageBounds(layers: readonly ExcalidrawElement[], files: BinaryFiles, signal?: AbortSignal): Promise<Record<string, ImageBounds>>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { runAutoResize } from "./autoResizeEngine";
|
|
2
|
+
type Options = Parameters<typeof runAutoResize>[0];
|
|
3
|
+
export declare function parseReview(value: unknown): string[];
|
|
4
|
+
export declare function runNativeAutoResize(opts: Options): Promise<import("./autoResizeEngine").DimensionResult[]>;
|
|
5
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ExcalidrawElement } from "@orangecatai/element/types";
|
|
2
|
+
import type { LayerMetadata } from "./resizeLayout";
|
|
3
|
+
/** Fit actual native fonts; never change originalText or an image's crop. */
|
|
4
|
+
export declare function fitResizeLayers(layers: readonly ExcalidrawElement[], source: readonly ExcalidrawElement[], metadata: LayerMetadata[]): {
|
|
5
|
+
layers: ExcalidrawElement[];
|
|
6
|
+
issues: string[];
|
|
7
|
+
};
|