@kortix/sdk 0.14.8 → 0.14.9
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/README.md +123 -123
- package/dist/core/client/kortix.d.ts +123 -2
- package/dist/core/client/kortix.d.ts.map +1 -1
- package/dist/core/client/project-core.d.ts.map +1 -1
- package/dist/core/client/project-operations-admin.d.ts +52 -0
- package/dist/core/client/project-operations-admin.d.ts.map +1 -1
- package/dist/core/client/project-operations-review.d.ts +79 -0
- package/dist/core/client/project-operations-review.d.ts.map +1 -1
- package/dist/core/client/project-operations-review.js +79 -0
- package/dist/core/client/project-operations-review.js.map +1 -1
- package/dist/core/client/project-operations-workspace.d.ts +52 -0
- package/dist/core/client/project-operations-workspace.d.ts.map +1 -1
- package/dist/core/client/project-operations.d.ts +112 -4
- package/dist/core/client/project-operations.d.ts.map +1 -1
- package/dist/core/client/project-operations.js +22 -2
- package/dist/core/client/project-operations.js.map +1 -1
- package/dist/core/client/project-platform-security.d.ts +29 -0
- package/dist/core/client/project-platform-security.d.ts.map +1 -1
- package/dist/core/client/project-platform-security.js +27 -0
- package/dist/core/client/project-platform-security.js.map +1 -1
- package/dist/core/client/project-platform-settings.d.ts +2 -0
- package/dist/core/client/project-platform-settings.d.ts.map +1 -1
- package/dist/core/files/image-cache.d.ts +56 -0
- package/dist/core/files/image-cache.d.ts.map +1 -0
- package/dist/core/files/image-cache.js +130 -0
- package/dist/core/files/image-cache.js.map +1 -0
- package/dist/core/http/response-error.d.ts.map +1 -1
- package/dist/core/http/response-error.js +2 -0
- package/dist/core/http/response-error.js.map +1 -1
- package/dist/core/rest/platform-client/host-boundary.d.ts +21 -15
- package/dist/core/rest/platform-client/host-boundary.d.ts.map +1 -1
- package/dist/core/rest/platform-client/host-boundary.js +10 -4
- package/dist/core/rest/platform-client/host-boundary.js.map +1 -1
- package/dist/core/rest/projects-client/agent-config.d.ts +4 -0
- package/dist/core/rest/projects-client/agent-config.d.ts.map +1 -1
- package/dist/core/rest/projects-client/agent-config.js.map +1 -1
- package/dist/core/rest/projects-client/agent-scope.d.ts +8 -0
- package/dist/core/rest/projects-client/agent-scope.d.ts.map +1 -1
- package/dist/core/rest/projects-client/agent-scope.js.map +1 -1
- package/dist/core/rest/projects-client/apps.d.ts +1 -1
- package/dist/core/rest/projects-client/apps.d.ts.map +1 -1
- package/dist/core/rest/projects-client/artifacts.d.ts +139 -0
- package/dist/core/rest/projects-client/artifacts.d.ts.map +1 -0
- package/dist/core/rest/projects-client/artifacts.js +72 -0
- package/dist/core/rest/projects-client/artifacts.js.map +1 -0
- package/dist/core/rest/projects-client/change-request-recovery.d.ts +30 -0
- package/dist/core/rest/projects-client/change-request-recovery.d.ts.map +1 -0
- package/dist/core/rest/projects-client/change-request-recovery.js +121 -0
- package/dist/core/rest/projects-client/change-request-recovery.js.map +1 -0
- package/dist/core/rest/projects-client/change-requests.d.ts +5 -0
- package/dist/core/rest/projects-client/change-requests.d.ts.map +1 -1
- package/dist/core/rest/projects-client/change-requests.js.map +1 -1
- package/dist/core/rest/projects-client/channels.d.ts +212 -2
- package/dist/core/rest/projects-client/channels.d.ts.map +1 -1
- package/dist/core/rest/projects-client/channels.js +111 -8
- package/dist/core/rest/projects-client/channels.js.map +1 -1
- package/dist/core/rest/projects-client/connectors.d.ts +259 -7
- package/dist/core/rest/projects-client/connectors.d.ts.map +1 -1
- package/dist/core/rest/projects-client/connectors.js +84 -4
- package/dist/core/rest/projects-client/connectors.js.map +1 -1
- package/dist/core/rest/projects-client/gateway.d.ts +23 -0
- package/dist/core/rest/projects-client/gateway.d.ts.map +1 -1
- package/dist/core/rest/projects-client/gateway.js.map +1 -1
- package/dist/core/rest/projects-client/iam-actions.d.ts +4 -0
- package/dist/core/rest/projects-client/iam-actions.d.ts.map +1 -1
- package/dist/core/rest/projects-client/iam-actions.js +4 -0
- package/dist/core/rest/projects-client/iam-actions.js.map +1 -1
- package/dist/core/rest/projects-client/index.d.ts +5 -0
- package/dist/core/rest/projects-client/index.d.ts.map +1 -1
- package/dist/core/rest/projects-client/index.js +5 -0
- package/dist/core/rest/projects-client/index.js.map +1 -1
- package/dist/core/rest/projects-client/memory.d.ts +236 -0
- package/dist/core/rest/projects-client/memory.d.ts.map +1 -0
- package/dist/core/rest/projects-client/memory.js +92 -0
- package/dist/core/rest/projects-client/memory.js.map +1 -0
- package/dist/core/rest/projects-client/projects.d.ts +21 -6
- package/dist/core/rest/projects-client/projects.d.ts.map +1 -1
- package/dist/core/rest/projects-client/projects.js +4 -4
- package/dist/core/rest/projects-client/projects.js.map +1 -1
- package/dist/core/rest/projects-client/review-items.d.ts.map +1 -1
- package/dist/core/rest/projects-client/review-items.js +40 -2
- package/dist/core/rest/projects-client/review-items.js.map +1 -1
- package/dist/core/rest/projects-client/session-groups.d.ts +48 -0
- package/dist/core/rest/projects-client/session-groups.d.ts.map +1 -0
- package/dist/core/rest/projects-client/session-groups.js +50 -0
- package/dist/core/rest/projects-client/session-groups.js.map +1 -0
- package/dist/core/rest/projects-client/sessions.d.ts +32 -0
- package/dist/core/rest/projects-client/sessions.d.ts.map +1 -1
- package/dist/core/rest/projects-client/sessions.js +10 -0
- package/dist/core/rest/projects-client/sessions.js.map +1 -1
- package/dist/core/rest/projects-client/setup-links.d.ts +5 -0
- package/dist/core/rest/projects-client/setup-links.d.ts.map +1 -1
- package/dist/core/rest/projects-client/setup-links.js.map +1 -1
- package/dist/core/rest/projects-client/spaces.d.ts +263 -0
- package/dist/core/rest/projects-client/spaces.d.ts.map +1 -0
- package/dist/core/rest/projects-client/spaces.js +165 -0
- package/dist/core/rest/projects-client/spaces.js.map +1 -0
- package/dist/core/rest/projects-client/triggers.d.ts +79 -32
- package/dist/core/rest/projects-client/triggers.d.ts.map +1 -1
- package/dist/core/rest/projects-client/triggers.js +1 -1
- package/dist/core/rest/projects-client/triggers.js.map +1 -1
- package/dist/core/session-log/turns/blocks.d.ts +2 -2
- package/dist/core/session-log/turns/blocks.d.ts.map +1 -1
- package/dist/core/session-log/turns/blocks.js +13 -5
- package/dist/core/session-log/turns/blocks.js.map +1 -1
- package/dist/core/session-log/turns/v1-parts.d.ts.map +1 -1
- package/dist/core/session-log/turns/v1-parts.js +18 -4
- package/dist/core/session-log/turns/v1-parts.js.map +1 -1
- package/dist/core/session-log/types.d.ts +13 -3
- package/dist/core/session-log/types.d.ts.map +1 -1
- package/dist/core/session-log/v1.d.ts +4 -1
- package/dist/core/session-log/v1.d.ts.map +1 -1
- package/dist/core/session-log/v1.js +2 -0
- package/dist/core/session-log/v1.js.map +1 -1
- package/dist/core/turns/parts.js +1 -1
- package/dist/core/turns/parts.js.map +1 -1
- package/dist/core/turns/safe-url.d.ts +3 -0
- package/dist/core/turns/safe-url.d.ts.map +1 -0
- package/dist/core/turns/safe-url.js +13 -0
- package/dist/core/turns/safe-url.js.map +1 -0
- package/dist/core/turns/segments/group-steps.d.ts.map +1 -1
- package/dist/core/turns/segments/group-steps.js +7 -6
- package/dist/core/turns/segments/group-steps.js.map +1 -1
- package/dist/core/turns/segments/narration.d.ts.map +1 -1
- package/dist/core/turns/segments/narration.js +35 -18
- package/dist/core/turns/segments/narration.js.map +1 -1
- package/dist/core/turns/segments/session-activity-groups.d.ts +14 -4
- package/dist/core/turns/segments/session-activity-groups.d.ts.map +1 -1
- package/dist/core/turns/segments/session-activity-groups.js +47 -7
- package/dist/core/turns/segments/session-activity-groups.js.map +1 -1
- package/dist/core/turns/segments/work-split.d.ts +1 -1
- package/dist/core/turns/segments/work-split.d.ts.map +1 -1
- package/dist/core/turns/segments/work-split.js +3 -6
- package/dist/core/turns/segments/work-split.js.map +1 -1
- package/dist/core/turns/tools/image-gen-view.d.ts +162 -0
- package/dist/core/turns/tools/image-gen-view.d.ts.map +1 -0
- package/dist/core/turns/tools/image-gen-view.js +402 -0
- package/dist/core/turns/tools/image-gen-view.js.map +1 -0
- package/dist/core/turns/tools/index.d.ts +2 -1
- package/dist/core/turns/tools/index.d.ts.map +1 -1
- package/dist/core/turns/tools/index.js +2 -1
- package/dist/core/turns/tools/index.js.map +1 -1
- package/dist/core/turns/tools/tool-meta.d.ts.map +1 -1
- package/dist/core/turns/tools/tool-meta.js +8 -0
- package/dist/core/turns/tools/tool-meta.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/kortix.esm.min.js +41 -39
- package/dist/kortix.global.js +41 -39
- package/dist/react/index.d.ts +4 -0
- package/dist/react/index.d.ts.map +1 -1
- package/dist/react/index.js +5 -0
- package/dist/react/index.js.map +1 -1
- package/dist/react/query-keys.d.ts +55 -1
- package/dist/react/query-keys.d.ts.map +1 -1
- package/dist/react/query-keys.js +62 -2
- package/dist/react/query-keys.js.map +1 -1
- package/dist/react/session-cache-write.d.ts +8 -0
- package/dist/react/session-cache-write.d.ts.map +1 -1
- package/dist/react/session-cache-write.js +50 -1
- package/dist/react/session-cache-write.js.map +1 -1
- package/dist/react/use-artifacts.d.ts +49 -0
- package/dist/react/use-artifacts.d.ts.map +1 -0
- package/dist/react/use-artifacts.js +120 -0
- package/dist/react/use-artifacts.js.map +1 -0
- package/dist/react/use-feature-flag.d.ts +1 -1
- package/dist/react/use-feature-flag.d.ts.map +1 -1
- package/dist/react/use-feature-flag.js +4 -1
- package/dist/react/use-feature-flag.js.map +1 -1
- package/dist/react/use-project-apps.d.ts.map +1 -1
- package/dist/react/use-project-apps.js +8 -5
- package/dist/react/use-project-apps.js.map +1 -1
- package/dist/react/use-project-memory.d.ts +41 -0
- package/dist/react/use-project-memory.d.ts.map +1 -0
- package/dist/react/use-project-memory.js +126 -0
- package/dist/react/use-project-memory.js.map +1 -0
- package/dist/react/use-project-sessions.d.ts +26 -7
- package/dist/react/use-project-sessions.d.ts.map +1 -1
- package/dist/react/use-project-sessions.js +57 -21
- package/dist/react/use-project-sessions.js.map +1 -1
- package/dist/react/use-project-spaces.d.ts +74 -0
- package/dist/react/use-project-spaces.d.ts.map +1 -0
- package/dist/react/use-project-spaces.js +196 -0
- package/dist/react/use-project-spaces.js.map +1 -0
- package/dist/react/use-session-groups.d.ts +41 -0
- package/dist/react/use-session-groups.d.ts.map +1 -0
- package/dist/react/use-session-groups.js +140 -0
- package/dist/react/use-session-groups.js.map +1 -0
- package/dist/workspace-search/client.d.ts.map +1 -1
- package/dist/workspace-search/client.js +4 -10
- package/dist/workspace-search/client.js.map +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What an `image_gen` card draws, from the call alone: pure data, no
|
|
3
|
+
* framework, so the web card (`@kortix/ui`) and the mobile card read one
|
|
4
|
+
* mapping.
|
|
5
|
+
*
|
|
6
|
+
* One call asks for one to four images (`prompts`; a Phase 1 call has one
|
|
7
|
+
* `prompt`) and returns `{"action", "model", "provider", "images": [{"path",
|
|
8
|
+
* "size", "prompt"}], "failed": [{"prompt", "error"}]}`; a path ends in
|
|
9
|
+
* `.png`, `.jpg` or `.webp`. Older calls returned one image as
|
|
10
|
+
* `{"path", …}`, a Replicate URL, or a bare path. A gateway refusal, of the
|
|
11
|
+
* whole call or of one prompt, reads `Image generation failed (<status>):
|
|
12
|
+
* <message> <suggestion> [Retry after N s.] [[provider:<id>]] [<code>]`; the
|
|
13
|
+
* code is the last bracketed token, present only when the gateway sent one;
|
|
14
|
+
* `[provider:<id>]` right before it names the provider that failed (the
|
|
15
|
+
* gateway's public id: `openai-codex` is ChatGPT), present only when the
|
|
16
|
+
* gateway named one (kortixd `image_gen.ts`, `refusal`).
|
|
17
|
+
*/
|
|
18
|
+
import type { SessionLogSegment } from '../../session-log/turns/blocks.js';
|
|
19
|
+
import type { SessionLogBlock, ToolCallBlock } from '../../session-log/types.js';
|
|
20
|
+
export type ImageGenPhase = 'generating' | 'ready' | 'failed' | 'stopped';
|
|
21
|
+
export interface ImageGenView {
|
|
22
|
+
/**
|
|
23
|
+
* The call: `generating` while it runs, `ready` once it returned (each of
|
|
24
|
+
* `images` says how its prompt went), `failed` when the whole call failed
|
|
25
|
+
* (`error`), `stopped` when the turn stopped it.
|
|
26
|
+
*/
|
|
27
|
+
phase: ImageGenPhase;
|
|
28
|
+
action: 'generate' | 'edit';
|
|
29
|
+
/** The prompts the call asked for; a Phase 1 call's one `prompt`. */
|
|
30
|
+
prompts: string[];
|
|
31
|
+
/**
|
|
32
|
+
* `"<w> / <h>"`: the ratio the call asked for (`aspect_ratio`, else a legacy
|
|
33
|
+
* `size`, else `1 / 1`), the same in every phase. A layout of several
|
|
34
|
+
* images sizes its rectangle from it, so nothing moves when they land.
|
|
35
|
+
*/
|
|
36
|
+
aspectRatio: string;
|
|
37
|
+
/** The call's start (epoch ms), so the elapsed time survives a reload. */
|
|
38
|
+
startedAt: number | null;
|
|
39
|
+
/** The model that made the images (`codex/gpt-image-2`, `google/gemini-2.5-flash-image`); null until the call completed, or when the output names none. */
|
|
40
|
+
model: string | null;
|
|
41
|
+
/** The provider that answered, as the tool output names it; null until the call completed, or when the output names none. */
|
|
42
|
+
provider: string | null;
|
|
43
|
+
/**
|
|
44
|
+
* One frame per image: one per prompt while the call runs (one while its
|
|
45
|
+
* arguments stream), then each image it made and each prompt that failed,
|
|
46
|
+
* in prompt order. Empty when the call `failed` or `stopped` as a whole.
|
|
47
|
+
*/
|
|
48
|
+
images: {
|
|
49
|
+
prompt: string;
|
|
50
|
+
/** `generating`, `ready` (the image is in) or `failed` (this prompt failed; see `error`). */
|
|
51
|
+
phase: ImageGenPhase;
|
|
52
|
+
/**
|
|
53
|
+
* `"<w> / <h>"`: the delivered size once the image came, else the
|
|
54
|
+
* requested `aspect_ratio` (`16:9` is `16 / 9`), else a legacy requested
|
|
55
|
+
* `size`; `auto` or neither is `1 / 1`.
|
|
56
|
+
*/
|
|
57
|
+
aspectRatio: string;
|
|
58
|
+
/** A sandbox file. */
|
|
59
|
+
imagePath: string | null;
|
|
60
|
+
/** Legacy outputs only (no `path`), and only an http(s) URL. */
|
|
61
|
+
directUrl: string | null;
|
|
62
|
+
/** The lowercase hex sha256 of the saved file's bytes, when the output names it (R38). */
|
|
63
|
+
sha256?: string;
|
|
64
|
+
error: ImageGenView['error'];
|
|
65
|
+
}[];
|
|
66
|
+
/** A failure: of the whole call on the view, of one prompt on an image. */
|
|
67
|
+
error: {
|
|
68
|
+
message: string;
|
|
69
|
+
suggestion?: string;
|
|
70
|
+
/** The gateway's stable code (`provider_not_connected`, `image_rate_limited`, …). */
|
|
71
|
+
code?: string;
|
|
72
|
+
/**
|
|
73
|
+
* The provider that failed, by the gateway's public id (`openai-codex` is
|
|
74
|
+
* ChatGPT; `openai`, `google`, `xai`, `openrouter`, …): the
|
|
75
|
+
* `[provider:<id>]` token. A text from before the token existed with a
|
|
76
|
+
* `provider_not_connected` or `provider_reauth_required` code is
|
|
77
|
+
* `openai-codex` when it names ChatGPT or Codex (those texts no longer
|
|
78
|
+
* change), else absent.
|
|
79
|
+
*/
|
|
80
|
+
provider?: string;
|
|
81
|
+
/** Seconds until the image limit resets (`retry-after`). */
|
|
82
|
+
retryAfterSeconds?: number;
|
|
83
|
+
/**
|
|
84
|
+
* True only for a trailing `[image_model_unavailable]`,
|
|
85
|
+
* `[provider_not_connected]` or `[provider_reauth_required]` code: a
|
|
86
|
+
* model connection in the project's settings fixes the call.
|
|
87
|
+
*/
|
|
88
|
+
connectModel: boolean;
|
|
89
|
+
} | null;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* `live`: whether the turn that owns the call still runs, when the host knows
|
|
93
|
+
* it (the transcript does). A call still open on a turn that ended was stopped:
|
|
94
|
+
* the transcript hands a call the closure rule closed back as open
|
|
95
|
+
* (`sessionLogOpenCall`), so its own status cannot say so.
|
|
96
|
+
*/
|
|
97
|
+
export declare function imageGenView(call: ToolCallBlock, live?: boolean): ImageGenView;
|
|
98
|
+
/** The retry wait in the largest whole unit a person reads: `{ value: 2, unit: 'hour' }`. */
|
|
99
|
+
export declare function imageGenRetryDelay(seconds: number): {
|
|
100
|
+
value: number;
|
|
101
|
+
unit: 'second' | 'minute' | 'hour';
|
|
102
|
+
};
|
|
103
|
+
/** `0:42`, `2:05`. */
|
|
104
|
+
export declare function formatImageGenElapsed(ms: number): string;
|
|
105
|
+
/** The images the turn's `image_gen` calls already drew, as paths without the `/workspace/` prefix. */
|
|
106
|
+
export declare function imagePathsShownByImageGen(blocks: readonly SessionLogBlock[]): Set<string>;
|
|
107
|
+
/** The sha256 of every image the turn's `image_gen` calls drew, when their output names it. */
|
|
108
|
+
export declare function imageDigestsShownByImageGen(blocks: readonly SessionLogBlock[]): Set<string>;
|
|
109
|
+
/**
|
|
110
|
+
* The sha256 the `show` call's output gives the file at `path` (its single
|
|
111
|
+
* `entry` or one of its `items`), matched with or without the `/workspace/`
|
|
112
|
+
* prefix; undefined when the output names none (an older kortixd, a file over
|
|
113
|
+
* the size bound, a non-image).
|
|
114
|
+
*/
|
|
115
|
+
export declare function showItemDigest(call: ToolCallBlock, path: string | undefined): string | undefined;
|
|
116
|
+
/**
|
|
117
|
+
* The `show` items an `image_gen` card of the same turn did not draw already:
|
|
118
|
+
* the same path, or the same bytes (`sha256`) at another path.
|
|
119
|
+
*/
|
|
120
|
+
export declare function withoutImageGenDuplicates<T extends {
|
|
121
|
+
path?: string;
|
|
122
|
+
sha256?: string;
|
|
123
|
+
}>(items: T[], paths: ReadonlySet<string>, digests?: ReadonlySet<string>): T[];
|
|
124
|
+
/**
|
|
125
|
+
* True when `call` is a `show` / `show_user` and every file it names is an
|
|
126
|
+
* image the turn's `image_gen` already drew: the host renders nothing for it.
|
|
127
|
+
*/
|
|
128
|
+
export declare function showDrawnByImageGen(call: ToolCallBlock, paths: ReadonlySet<string>, digests?: ReadonlySet<string>): boolean;
|
|
129
|
+
/** One slot of an image grid: the frame, the index of its call in the run, and whether it is that call's first. */
|
|
130
|
+
export interface ImageGenGridTile {
|
|
131
|
+
image: ImageGenView['images'][number];
|
|
132
|
+
call: number;
|
|
133
|
+
first: boolean;
|
|
134
|
+
}
|
|
135
|
+
export interface ImageGenGrid {
|
|
136
|
+
tiles: ImageGenGridTile[];
|
|
137
|
+
/**
|
|
138
|
+
* How many tiles each row holds, top to bottom: up to four is one bento;
|
|
139
|
+
* five and more are rows of three, or of four when that divides evenly, and
|
|
140
|
+
* one or two rows of two for the rest (5 = 3+2, 6 = 3+3, 7 = 3+2+2, 8 = 4+4).
|
|
141
|
+
*/
|
|
142
|
+
rows: number[];
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* The one grid of a run of `image_gen` calls (`sessionLogImageGenRuns`), tiles
|
|
146
|
+
* in call order. A call that failed or stopped as a whole keeps one slot per
|
|
147
|
+
* prompt, each showing its failure, so nothing after it moves.
|
|
148
|
+
*/
|
|
149
|
+
export declare function imageGenGrid(views: readonly ImageGenView[]): ImageGenGrid;
|
|
150
|
+
/**
|
|
151
|
+
* The runs of `image_gen` cards of one turn that draw as ONE grid (R38): two
|
|
152
|
+
* or more `image_gen` calls standing alone with no other visible deliverable
|
|
153
|
+
* between them (a `show` the cards already drew does not count; bursts and
|
|
154
|
+
* text do not either, since the settled turn hoists the deliverables
|
|
155
|
+
* together). Each member's block id maps to its run; the host draws the grid
|
|
156
|
+
* at `run[0]` and nothing for the others, live and settled alike.
|
|
157
|
+
*/
|
|
158
|
+
export declare function sessionLogImageGenRuns(segments: ReadonlyArray<SessionLogSegment>, drawn: {
|
|
159
|
+
paths: ReadonlySet<string>;
|
|
160
|
+
digests: ReadonlySet<string>;
|
|
161
|
+
}): Map<string, ToolCallBlock[]>;
|
|
162
|
+
//# sourceMappingURL=image-gen-view.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"image-gen-view.d.ts","sourceRoot":"","sources":["../../../../src/core/turns/tools/image-gen-view.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACxE,OAAO,KAAK,EAAE,eAAe,E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AC;IACtC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,OAAO,CAAC;CAChB;AAED,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,gBAAgB,EAAE,CAAC;IAC1B;;;;OAIG;IACH,IAAI,EAAE,MAAM,EAAE,CAAC;CAChB;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,SAAS,YAAY,EAAE,GAAG,YAAY,CAezE;AAID;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CACpC,QAAQ,EAAE,aAAa,CAAC,iBAAiB,CAAC,EAC1C,KAAK,EAAE;IAAE,KAAK,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAAC,OAAO,EAAE,WAAW,CAAC,MAAM,CAAC,CAAA;CAAE,GAClE,GAAG,CAAC,MAAM,EAAE,aAAa,EAAE,CAAC,CAc9B"}
|
|
@@ -0,0 +1,402 @@
|
|
|
1
|
+
import { shouldShowToolPart } from '../parts.js';
|
|
2
|
+
import { safeHttpUrl } from '../safe-url.js';
|
|
3
|
+
import { isNoGroupActivityTool } from '../segments/session-activity-groups.js';
|
|
4
|
+
import { normalizeName } from './tool-meta.js';
|
|
5
|
+
const SQUARE = '1 / 1';
|
|
6
|
+
const CONNECT_CODES = new Set(['image_model_unavailable', 'provider_not_connected', 'provider_reauth_required']);
|
|
7
|
+
const TRAILING_CODE = /\[([a-z][a-z0-9_]*)\]$/;
|
|
8
|
+
/** The trailing `[provider:<id>]` token, found without a regex (CodeQL js/polynomial-redos). */
|
|
9
|
+
function trailingProvider(text) {
|
|
10
|
+
if (!text.endsWith(']'))
|
|
11
|
+
return null;
|
|
12
|
+
const index = text.lastIndexOf('[provider:');
|
|
13
|
+
if (index < 0)
|
|
14
|
+
return null;
|
|
15
|
+
const id = text.slice(index + '[provider:'.length, -1);
|
|
16
|
+
return id && !/[\]\s]/.test(id) ? { index, id } : null;
|
|
17
|
+
}
|
|
18
|
+
/** Before the provider token: only ChatGPT's own texts named ChatGPT or Codex for these codes. */
|
|
19
|
+
const LEGACY_CHATGPT_CODES = new Set(['provider_not_connected', 'provider_reauth_required']);
|
|
20
|
+
const NAMES_CHATGPT = /\b(ChatGPT|Codex)\b/;
|
|
21
|
+
const TRAILING_RETRY = /Retry after (\d+) s\.$/;
|
|
22
|
+
const REFUSAL_PREFIX = /^Image generation failed \(\d+\):\s*/;
|
|
23
|
+
/**
|
|
24
|
+
* The exact texts a stop leaves on the call: pi's tool loop when the turn's
|
|
25
|
+
* signal aborted (`Operation aborted`), the tool's own fetch abort in Bun
|
|
26
|
+
* (`The operation was aborted.`), pi's close of a call that never returned
|
|
27
|
+
* (`No result provided`, also `synthetic`). A timeout ("The operation timed
|
|
28
|
+
* out.") or an upstream error is a failure, not a stop.
|
|
29
|
+
*/
|
|
30
|
+
const STOPPED_TEXTS = new Set(['Operation aborted', 'The operation was aborted.', 'No result provided']);
|
|
31
|
+
const IMAGE_EXT = /\.(png|jpe?g|gif|webp|svg|bmp|ico)$/i;
|
|
32
|
+
const SHA256 = /^[0-9a-f]{64}$/;
|
|
33
|
+
/** A lowercase hex sha256, else undefined. */
|
|
34
|
+
function digest(value) {
|
|
35
|
+
return typeof value === 'string' && SHA256.test(value) ? value : undefined;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* A one-image output → a sandbox path and/or a URL. Every older `image_gen`
|
|
39
|
+
* (the kortixd tool and the retired Replicate tool) returned JSON; a bare,
|
|
40
|
+
* possibly quoted image path is read too.
|
|
41
|
+
*/
|
|
42
|
+
function imageOutput(text) {
|
|
43
|
+
try {
|
|
44
|
+
const parsed = JSON.parse(text);
|
|
45
|
+
if (parsed && typeof parsed === 'object') {
|
|
46
|
+
const p = parsed.path || parsed.image_path || parsed.output_path || null;
|
|
47
|
+
const url = parsed.replicate_url || parsed.url || parsed.image_url || null;
|
|
48
|
+
return { imagePath: p ? String(p).trim() : null, directUrl: url ? String(url).trim() : null };
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
catch {
|
|
52
|
+
// not JSON
|
|
53
|
+
}
|
|
54
|
+
const bare = stripQuotes(text).trim();
|
|
55
|
+
if (IMAGE_EXT.test(bare) && !/\s/.test(bare)) {
|
|
56
|
+
return { imagePath: bare.startsWith('workspace/') ? `/${bare}` : bare, directUrl: null };
|
|
57
|
+
}
|
|
58
|
+
return { imagePath: null, directUrl: null };
|
|
59
|
+
}
|
|
60
|
+
function gcd(a, b) {
|
|
61
|
+
return b ? gcd(b, a % b) : a;
|
|
62
|
+
}
|
|
63
|
+
/** `'1536x1024'` or `'3:2'` → `'3 / 2'`; anything else (`auto`) → null. */
|
|
64
|
+
function sizeAspect(size) {
|
|
65
|
+
const m = typeof size === 'string' ? /^(\d+)[x:](\d+)$/.exec(size.trim()) : null;
|
|
66
|
+
if (!m)
|
|
67
|
+
return null;
|
|
68
|
+
const w = Number(m[1]);
|
|
69
|
+
const h = Number(m[2]);
|
|
70
|
+
if (!w || !h)
|
|
71
|
+
return null;
|
|
72
|
+
const d = gcd(w, h);
|
|
73
|
+
return `${w / d} / ${h / d}`;
|
|
74
|
+
}
|
|
75
|
+
function resultText(call) {
|
|
76
|
+
return (call.result?.content ?? [])
|
|
77
|
+
.flatMap((c) => (c.type === 'text' ? [c.text] : []))
|
|
78
|
+
.join('')
|
|
79
|
+
.trim();
|
|
80
|
+
}
|
|
81
|
+
function inputOf(call) {
|
|
82
|
+
const input = call.input;
|
|
83
|
+
if (typeof input === 'object' && input !== null && !Array.isArray(input))
|
|
84
|
+
return input;
|
|
85
|
+
if (typeof input === 'string') {
|
|
86
|
+
try {
|
|
87
|
+
const parsed = JSON.parse(input);
|
|
88
|
+
if (typeof parsed === 'object' && parsed !== null)
|
|
89
|
+
return parsed;
|
|
90
|
+
}
|
|
91
|
+
catch {
|
|
92
|
+
// a partial argument stream: the card shows it once it parses
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
return {};
|
|
96
|
+
}
|
|
97
|
+
/** `text` without its leading and trailing quotes and backticks, in linear time. */
|
|
98
|
+
function stripQuotes(text) {
|
|
99
|
+
const quote = (c) => c === '"' || c === "'" || c === '`';
|
|
100
|
+
let start = 0;
|
|
101
|
+
let end = text.length;
|
|
102
|
+
while (start < end && quote(text[start]))
|
|
103
|
+
start++;
|
|
104
|
+
while (end > start && quote(text[end - 1]))
|
|
105
|
+
end--;
|
|
106
|
+
return text.slice(start, end);
|
|
107
|
+
}
|
|
108
|
+
function failure(text) {
|
|
109
|
+
let rest = text.trim();
|
|
110
|
+
const code = TRAILING_CODE.exec(rest);
|
|
111
|
+
// Each trailing pattern is anchored at the end with no leading `\s*`, and the
|
|
112
|
+
// whitespace is trimmed here: a leading `\s*` backtracks quadratically on long runs.
|
|
113
|
+
if (code)
|
|
114
|
+
rest = rest.slice(0, code.index).trimEnd();
|
|
115
|
+
const named = code ? trailingProvider(rest) : null;
|
|
116
|
+
if (named)
|
|
117
|
+
rest = rest.slice(0, named.index).trimEnd();
|
|
118
|
+
const retry = TRAILING_RETRY.exec(rest);
|
|
119
|
+
if (retry)
|
|
120
|
+
rest = rest.slice(0, retry.index).trimEnd();
|
|
121
|
+
rest = rest.replace(REFUSAL_PREFIX, '').trim();
|
|
122
|
+
const provider = named
|
|
123
|
+
? named.id
|
|
124
|
+
: code && LEGACY_CHATGPT_CODES.has(code[1]) && NAMES_CHATGPT.test(rest)
|
|
125
|
+
? 'openai-codex'
|
|
126
|
+
: undefined;
|
|
127
|
+
const error = {
|
|
128
|
+
message: rest,
|
|
129
|
+
connectModel: !!code && CONNECT_CODES.has(code[1]),
|
|
130
|
+
...(code && { code: code[1] }),
|
|
131
|
+
...(provider && { provider }),
|
|
132
|
+
...(retry && { retryAfterSeconds: Number(retry[1]) }),
|
|
133
|
+
};
|
|
134
|
+
// The tool joins the gateway's message and suggestion with a space: split after the first sentence.
|
|
135
|
+
const cut = rest.search(/(?<=[.!?])\s+/);
|
|
136
|
+
if (cut < 0)
|
|
137
|
+
return error;
|
|
138
|
+
return { ...error, message: rest.slice(0, cut), suggestion: rest.slice(cut).trim() };
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* `live`: whether the turn that owns the call still runs, when the host knows
|
|
142
|
+
* it (the transcript does). A call still open on a turn that ended was stopped:
|
|
143
|
+
* the transcript hands a call the closure rule closed back as open
|
|
144
|
+
* (`sessionLogOpenCall`), so its own status cannot say so.
|
|
145
|
+
*/
|
|
146
|
+
export function imageGenView(call, live) {
|
|
147
|
+
const input = inputOf(call);
|
|
148
|
+
const started = call.started_at ? Date.parse(call.started_at) : NaN;
|
|
149
|
+
const prompts = Array.isArray(input.prompts)
|
|
150
|
+
? input.prompts.filter((prompt) => typeof prompt === 'string')
|
|
151
|
+
: typeof input.prompt === 'string'
|
|
152
|
+
? [input.prompt]
|
|
153
|
+
: [];
|
|
154
|
+
const requested = sizeAspect(input.aspect_ratio) ?? sizeAspect(input.size) ?? SQUARE;
|
|
155
|
+
const frame = (prompt, phase) => ({
|
|
156
|
+
prompt,
|
|
157
|
+
phase,
|
|
158
|
+
aspectRatio: requested,
|
|
159
|
+
imagePath: null,
|
|
160
|
+
directUrl: null,
|
|
161
|
+
error: null,
|
|
162
|
+
});
|
|
163
|
+
const view = {
|
|
164
|
+
phase: 'generating',
|
|
165
|
+
action: input.action === 'edit' ? 'edit' : 'generate',
|
|
166
|
+
prompts,
|
|
167
|
+
aspectRatio: requested,
|
|
168
|
+
startedAt: Number.isFinite(started) ? started : null,
|
|
169
|
+
model: null,
|
|
170
|
+
provider: null,
|
|
171
|
+
images: (prompts.length ? prompts : ['']).map((prompt) => frame(prompt, 'generating')),
|
|
172
|
+
error: null,
|
|
173
|
+
};
|
|
174
|
+
if (call.status === 'error') {
|
|
175
|
+
const text = call.result?.error?.message || resultText(call);
|
|
176
|
+
const stopped = call.result?.error?.code === 'interrupted' || call.result?.synthetic || STOPPED_TEXTS.has(text.trim());
|
|
177
|
+
if (stopped)
|
|
178
|
+
return { ...view, phase: 'stopped', images: [] };
|
|
179
|
+
return { ...view, phase: 'failed', images: [], error: failure(text) };
|
|
180
|
+
}
|
|
181
|
+
if (call.status !== 'complete')
|
|
182
|
+
return live === false ? { ...view, phase: 'stopped', images: [] } : view;
|
|
183
|
+
const text = resultText(call);
|
|
184
|
+
let output = {};
|
|
185
|
+
try {
|
|
186
|
+
const parsed = JSON.parse(text);
|
|
187
|
+
if (parsed && typeof parsed === 'object')
|
|
188
|
+
output = parsed;
|
|
189
|
+
}
|
|
190
|
+
catch {
|
|
191
|
+
// a legacy text output carries no size, model or provider
|
|
192
|
+
}
|
|
193
|
+
const named = (value) => (typeof value === 'string' && value.trim() ? value.trim() : null);
|
|
194
|
+
const failedCard = { ...view, phase: 'failed', images: [], error: failure(text) };
|
|
195
|
+
const done = { ...view, phase: 'ready', model: named(output.model), provider: named(output.provider) };
|
|
196
|
+
if (Array.isArray(output.images) || Array.isArray(output.failed)) {
|
|
197
|
+
const entries = [];
|
|
198
|
+
for (const image of Array.isArray(output.images) ? output.images : []) {
|
|
199
|
+
// S6: a batch image is a sandbox path, never a URL.
|
|
200
|
+
const path = named(image?.path);
|
|
201
|
+
const sha256 = digest(image?.sha256);
|
|
202
|
+
if (path)
|
|
203
|
+
entries.push({ ...frame(String(image.prompt ?? ''), 'ready'), aspectRatio: sizeAspect(image.size) ?? requested, imagePath: path, ...(sha256 && { sha256 }) });
|
|
204
|
+
}
|
|
205
|
+
for (const miss of Array.isArray(output.failed) ? output.failed : []) {
|
|
206
|
+
entries.push({ ...frame(String(miss?.prompt ?? ''), 'failed'), error: failure(String(miss?.error ?? '')) });
|
|
207
|
+
}
|
|
208
|
+
// In the order the call asked: a frame keeps its place from generating to done.
|
|
209
|
+
const asked = prompts.flatMap((prompt) => {
|
|
210
|
+
const at = entries.findIndex((entry) => entry.prompt === prompt);
|
|
211
|
+
return at < 0 ? [] : entries.splice(at, 1);
|
|
212
|
+
});
|
|
213
|
+
const images = [...asked, ...entries];
|
|
214
|
+
return images.length ? { ...done, images } : failedCard;
|
|
215
|
+
}
|
|
216
|
+
const { imagePath, directUrl } = imageOutput(text);
|
|
217
|
+
// S6: a path means a sandbox file. A URL beside it is never loaded.
|
|
218
|
+
const remote = imagePath ? null : directUrl ? safeHttpUrl(directUrl) : null;
|
|
219
|
+
if (!imagePath && !remote)
|
|
220
|
+
return failedCard;
|
|
221
|
+
return {
|
|
222
|
+
...done,
|
|
223
|
+
images: [{ ...frame(prompts[0] ?? '', 'ready'), aspectRatio: sizeAspect(output.size) ?? requested, imagePath, directUrl: remote }],
|
|
224
|
+
};
|
|
225
|
+
}
|
|
226
|
+
/** The retry wait in the largest whole unit a person reads: `{ value: 2, unit: 'hour' }`. */
|
|
227
|
+
export function imageGenRetryDelay(seconds) {
|
|
228
|
+
if (seconds < 90)
|
|
229
|
+
return { value: Math.max(1, Math.ceil(seconds)), unit: 'second' };
|
|
230
|
+
if (seconds < 90 * 60)
|
|
231
|
+
return { value: Math.ceil(seconds / 60), unit: 'minute' };
|
|
232
|
+
return { value: Math.ceil(seconds / 3600), unit: 'hour' };
|
|
233
|
+
}
|
|
234
|
+
/** `0:42`, `2:05`. */
|
|
235
|
+
export function formatImageGenElapsed(ms) {
|
|
236
|
+
const s = Math.max(0, Math.floor(ms / 1000));
|
|
237
|
+
return `${Math.floor(s / 60)}:${String(s % 60).padStart(2, '0')}`;
|
|
238
|
+
}
|
|
239
|
+
/** One key per sandbox file, with or without the `/workspace/` prefix. */
|
|
240
|
+
function imageGenPathKey(path) {
|
|
241
|
+
return path.trim().replace(/^\/?workspace\//, '');
|
|
242
|
+
}
|
|
243
|
+
/** The images the turn's `image_gen` calls already drew, as paths without the `/workspace/` prefix. */
|
|
244
|
+
export function imagePathsShownByImageGen(blocks) {
|
|
245
|
+
const paths = new Set();
|
|
246
|
+
for (const block of blocks) {
|
|
247
|
+
if (block.type !== 'tool_call' || !/^image[-_]gen$/.test(block.name))
|
|
248
|
+
continue;
|
|
249
|
+
for (const image of imageGenView(block).images)
|
|
250
|
+
if (image.imagePath)
|
|
251
|
+
paths.add(imageGenPathKey(image.imagePath));
|
|
252
|
+
}
|
|
253
|
+
return paths;
|
|
254
|
+
}
|
|
255
|
+
/** The sha256 of every image the turn's `image_gen` calls drew, when their output names it. */
|
|
256
|
+
export function imageDigestsShownByImageGen(blocks) {
|
|
257
|
+
const digests = new Set();
|
|
258
|
+
for (const block of blocks) {
|
|
259
|
+
if (block.type !== 'tool_call' || !/^image[-_]gen$/.test(block.name))
|
|
260
|
+
continue;
|
|
261
|
+
for (const image of imageGenView(block).images)
|
|
262
|
+
if (image.sha256)
|
|
263
|
+
digests.add(image.sha256);
|
|
264
|
+
}
|
|
265
|
+
return digests;
|
|
266
|
+
}
|
|
267
|
+
const showDigests = new WeakMap();
|
|
268
|
+
/**
|
|
269
|
+
* The sha256 the `show` call's output gives the file at `path` (its single
|
|
270
|
+
* `entry` or one of its `items`), matched with or without the `/workspace/`
|
|
271
|
+
* prefix; undefined when the output names none (an older kortixd, a file over
|
|
272
|
+
* the size bound, a non-image).
|
|
273
|
+
*/
|
|
274
|
+
export function showItemDigest(call, path) {
|
|
275
|
+
if (!path)
|
|
276
|
+
return undefined;
|
|
277
|
+
let byPath = showDigests.get(call);
|
|
278
|
+
if (!byPath) {
|
|
279
|
+
byPath = new Map();
|
|
280
|
+
let output = null;
|
|
281
|
+
try {
|
|
282
|
+
output = JSON.parse(resultText(call));
|
|
283
|
+
}
|
|
284
|
+
catch {
|
|
285
|
+
// no output yet, or not JSON
|
|
286
|
+
}
|
|
287
|
+
const entries = output && typeof output === 'object' ? [output.entry, ...(Array.isArray(output.items) ? output.items : [])] : [];
|
|
288
|
+
for (const entry of entries) {
|
|
289
|
+
const sha256 = digest(entry?.sha256);
|
|
290
|
+
if (sha256 && typeof entry.path === 'string')
|
|
291
|
+
byPath.set(imageGenPathKey(entry.path), sha256);
|
|
292
|
+
}
|
|
293
|
+
showDigests.set(call, byPath);
|
|
294
|
+
}
|
|
295
|
+
return byPath.get(imageGenPathKey(path));
|
|
296
|
+
}
|
|
297
|
+
/**
|
|
298
|
+
* The `show` items an `image_gen` card of the same turn did not draw already:
|
|
299
|
+
* the same path, or the same bytes (`sha256`) at another path.
|
|
300
|
+
*/
|
|
301
|
+
export function withoutImageGenDuplicates(items, paths, digests = NO_DIGESTS) {
|
|
302
|
+
if (!paths.size && !digests.size)
|
|
303
|
+
return items;
|
|
304
|
+
return items.filter((item) => !(item.path && paths.has(imageGenPathKey(item.path))) && !(item.sha256 && digests.has(item.sha256)));
|
|
305
|
+
}
|
|
306
|
+
const NO_DIGESTS = new Set();
|
|
307
|
+
const SHOW_TOOLS = new Set(['show', 'show_user']);
|
|
308
|
+
/**
|
|
309
|
+
* True when `call` is a `show` / `show_user` and every file it names is an
|
|
310
|
+
* image the turn's `image_gen` already drew: the host renders nothing for it.
|
|
311
|
+
*/
|
|
312
|
+
export function showDrawnByImageGen(call, paths, digests = NO_DIGESTS) {
|
|
313
|
+
if ((!paths.size && !digests.size) || !SHOW_TOOLS.has(normalizeName(call.name)))
|
|
314
|
+
return false;
|
|
315
|
+
const input = inputOf(call);
|
|
316
|
+
let items = input.items;
|
|
317
|
+
if (typeof items === 'string') {
|
|
318
|
+
try {
|
|
319
|
+
items = JSON.parse(items);
|
|
320
|
+
}
|
|
321
|
+
catch {
|
|
322
|
+
items = null;
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
const list = Array.isArray(items) && items.length
|
|
326
|
+
? items
|
|
327
|
+
: typeof input.path === 'string' && input.path
|
|
328
|
+
? [{ path: input.path }]
|
|
329
|
+
: [];
|
|
330
|
+
const withDigests = list.map((item) => ({ ...item, sha256: showItemDigest(call, item.path) }));
|
|
331
|
+
return list.length > 0 && withoutImageGenDuplicates(withDigests, paths, digests).length === 0;
|
|
332
|
+
}
|
|
333
|
+
/**
|
|
334
|
+
* The rows of a grid of `count` images (R38): up to four is one bento (1, 2
|
|
335
|
+
* side by side, 3 = one large + two stacked, 4 = 2×2); more are rows of those
|
|
336
|
+
* patterns, in order: rows of three, or of four when that divides evenly, and
|
|
337
|
+
* one or two rows of two for the rest (5 = 3+2, 7 = 3+2+2, 8 = 4+4).
|
|
338
|
+
*/
|
|
339
|
+
function imageGenGridRows(count) {
|
|
340
|
+
if (count <= 0)
|
|
341
|
+
return [];
|
|
342
|
+
if (count <= 4)
|
|
343
|
+
return [count];
|
|
344
|
+
const rows = (size, n) => Array.from({ length: n }, () => size);
|
|
345
|
+
if (count % 3 === 0)
|
|
346
|
+
return rows(3, count / 3);
|
|
347
|
+
if (count % 4 === 0)
|
|
348
|
+
return rows(4, count / 4);
|
|
349
|
+
if (count % 3 === 2)
|
|
350
|
+
return [...rows(3, (count - 2) / 3), 2];
|
|
351
|
+
return [...rows(3, (count - 4) / 3), 2, 2];
|
|
352
|
+
}
|
|
353
|
+
/**
|
|
354
|
+
* The one grid of a run of `image_gen` calls (`sessionLogImageGenRuns`), tiles
|
|
355
|
+
* in call order. A call that failed or stopped as a whole keeps one slot per
|
|
356
|
+
* prompt, each showing its failure, so nothing after it moves.
|
|
357
|
+
*/
|
|
358
|
+
export function imageGenGrid(views) {
|
|
359
|
+
const tiles = views.flatMap((view, call) => {
|
|
360
|
+
const images = view.images.length
|
|
361
|
+
? view.images
|
|
362
|
+
: (view.prompts.length ? view.prompts : ['']).map((prompt) => ({
|
|
363
|
+
prompt,
|
|
364
|
+
phase: view.phase === 'stopped' ? 'stopped' : 'failed',
|
|
365
|
+
aspectRatio: view.aspectRatio,
|
|
366
|
+
imagePath: null,
|
|
367
|
+
directUrl: null,
|
|
368
|
+
error: view.phase === 'stopped' ? null : view.error,
|
|
369
|
+
}));
|
|
370
|
+
return images.map((image, i) => ({ image, call, first: i === 0 }));
|
|
371
|
+
});
|
|
372
|
+
return { tiles, rows: imageGenGridRows(tiles.length) };
|
|
373
|
+
}
|
|
374
|
+
const IMAGE_GEN = /^image[-_]gen$/;
|
|
375
|
+
/**
|
|
376
|
+
* The runs of `image_gen` cards of one turn that draw as ONE grid (R38): two
|
|
377
|
+
* or more `image_gen` calls standing alone with no other visible deliverable
|
|
378
|
+
* between them (a `show` the cards already drew does not count; bursts and
|
|
379
|
+
* text do not either, since the settled turn hoists the deliverables
|
|
380
|
+
* together). Each member's block id maps to its run; the host draws the grid
|
|
381
|
+
* at `run[0]` and nothing for the others, live and settled alike.
|
|
382
|
+
*/
|
|
383
|
+
export function sessionLogImageGenRuns(segments, drawn) {
|
|
384
|
+
const runs = new Map();
|
|
385
|
+
let run = [];
|
|
386
|
+
const close = () => {
|
|
387
|
+
if (run.length > 1)
|
|
388
|
+
for (const block of run)
|
|
389
|
+
runs.set(block.id, run);
|
|
390
|
+
run = [];
|
|
391
|
+
};
|
|
392
|
+
const visible = (block) => shouldShowToolPart(block) && !showDrawnByImageGen(block, drawn.paths, drawn.digests);
|
|
393
|
+
for (const segment of segments) {
|
|
394
|
+
if (segment.kind === 'standalone' && IMAGE_GEN.test(segment.block.name))
|
|
395
|
+
run.push(segment.block);
|
|
396
|
+
else if (segment.kind === 'show-group' ? segment.blocks.some(visible) : segment.kind === 'standalone' && isNoGroupActivityTool(segment.block.name) && visible(segment.block))
|
|
397
|
+
close();
|
|
398
|
+
}
|
|
399
|
+
close();
|
|
400
|
+
return runs;
|
|
401
|
+
}
|
|
402
|
+
//# sourceMappingURL=image-gen-view.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"image-gen-view.js","sourceRoot":"","sources":["../../../../src/core/turns/tools/image-gen-view.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAC;AAC5E,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AA6E5C,MAAM,MAAM,GAAG,OAAO,CAAC;AACvB,MAAM,aAAa,GAAG,IAAI,GAAG,CAAC,CAAC,yBAAyB,EAAE,wBAAwB,EAAE,0B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,EAAE,CAAC;IACxL,CAAC;IACD,KAAK,EAAE,CAAC;IACR,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -3,10 +3,11 @@
|
|
|
3
3
|
* and what its output says. Primary-arg extraction, file verbs, search-query
|
|
4
4
|
* humanizing, patch verbs, success/partial/failed outcomes, and parsers for
|
|
5
5
|
* web search, scrape, skill, memory, read, question, presentation and worker
|
|
6
|
-
* output. Pure data → data, no framework.
|
|
6
|
+
* output, and the `image_gen` card's state. Pure data → data, no framework.
|
|
7
7
|
*/
|
|
8
8
|
export * from './agent-helpers.js';
|
|
9
9
|
export * from './file-verb.js';
|
|
10
|
+
export * from './image-gen-view.js';
|
|
10
11
|
export * from './memory-helpers.js';
|
|
11
12
|
export * from './patch-summary.js';
|
|
12
13
|
export * from './presentation-helpers.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/turns/tools/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC;AACrC,cAAc,eAAe,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/turns/tools/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC;AACrC,cAAc,eAAe,CAAC"}
|
|
@@ -3,10 +3,11 @@
|
|
|
3
3
|
* and what its output says. Primary-arg extraction, file verbs, search-query
|
|
4
4
|
* humanizing, patch verbs, success/partial/failed outcomes, and parsers for
|
|
5
5
|
* web search, scrape, skill, memory, read, question, presentation and worker
|
|
6
|
-
* output. Pure data → data, no framework.
|
|
6
|
+
* output, and the `image_gen` card's state. Pure data → data, no framework.
|
|
7
7
|
*/
|
|
8
8
|
export * from './agent-helpers.js';
|
|
9
9
|
export * from './file-verb.js';
|
|
10
|
+
export * from './image-gen-view.js';
|
|
10
11
|
export * from './memory-helpers.js';
|
|
11
12
|
export * from './patch-summary.js';
|
|
12
13
|
export * from './presentation-helpers.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/core/turns/tools/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC;AACrC,cAAc,eAAe,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/core/turns/tools/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC;AACrC,cAAc,eAAe,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-meta.d.ts","sourceRoot":"","sources":["../../../../src/core/turns/tools/tool-meta.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAIrD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAM7D,mEAAmE;AACnE,eAAO,MAAM,aAAa,aAA4C,CAAC;AAEvE,iEAAiE;AACjE,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAElD;AAED,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAEvD;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,QAAQ,EAAE,GAAG;IACrD,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;CACd,CAWA;AAiBD;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,QAAQ,GAAG,aAAa,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"tool-meta.d.ts","sourceRoot":"","sources":["../../../../src/core/turns/tools/tool-meta.ts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