@skillcdn/console 0.5.0 → 0.5.1
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 +68 -11
- package/SKILLCDN.md +3 -3
- package/dist/agent-page.d.ts.map +1 -1
- package/dist/agent-page.js +3 -2
- package/dist/agent-page.js.map +1 -1
- package/dist/api.d.ts +7 -6
- package/dist/api.d.ts.map +1 -1
- package/dist/api.js +6 -5
- package/dist/api.js.map +1 -1
- package/dist/charts.d.ts +103 -0
- package/dist/charts.d.ts.map +1 -0
- package/dist/charts.js +182 -0
- package/dist/charts.js.map +1 -0
- package/dist/cli/cli.d.ts +26 -2
- package/dist/cli/cli.d.ts.map +1 -1
- package/dist/cli/cli.js +1304 -383
- package/dist/cli/cli.js.map +1 -1
- package/dist/cli/command-words.d.ts +20 -0
- package/dist/cli/command-words.d.ts.map +1 -0
- package/dist/cli/command-words.js +51 -0
- package/dist/cli/command-words.js.map +1 -0
- package/dist/cli/credentials.d.ts +54 -5
- package/dist/cli/credentials.d.ts.map +1 -1
- package/dist/cli/credentials.js +126 -20
- package/dist/cli/credentials.js.map +1 -1
- package/dist/cli/directory.d.ts +19 -4
- package/dist/cli/directory.d.ts.map +1 -1
- package/dist/cli/directory.js +16 -8
- package/dist/cli/directory.js.map +1 -1
- package/dist/cli/format.d.ts +65 -8
- package/dist/cli/format.d.ts.map +1 -1
- package/dist/cli/format.js +242 -37
- package/dist/cli/format.js.map +1 -1
- package/dist/cli/help.d.ts +13 -4
- package/dist/cli/help.d.ts.map +1 -1
- package/dist/cli/help.js +92 -54
- package/dist/cli/help.js.map +1 -1
- package/dist/cli/main.js +76 -2
- package/dist/cli/main.js.map +1 -1
- package/dist/cli/pack.d.ts +69 -60
- package/dist/cli/pack.d.ts.map +1 -1
- package/dist/cli/pack.js +241 -270
- package/dist/cli/pack.js.map +1 -1
- package/dist/cli/plugin-check.d.ts +42 -0
- package/dist/cli/plugin-check.d.ts.map +1 -1
- package/dist/cli/plugin-check.js +221 -36
- package/dist/cli/plugin-check.js.map +1 -1
- package/dist/cli/plugin-cli.d.ts +6 -1
- package/dist/cli/plugin-cli.d.ts.map +1 -1
- package/dist/cli/plugin-cli.js +21 -4
- package/dist/cli/plugin-cli.js.map +1 -1
- package/dist/cli/plugin-main.js +1 -0
- package/dist/cli/plugin-main.js.map +1 -1
- package/dist/cli/serve.d.ts +33 -1
- package/dist/cli/serve.d.ts.map +1 -1
- package/dist/cli/serve.js +252 -3
- package/dist/cli/serve.js.map +1 -1
- package/dist/client.d.ts +48 -9
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +72 -80
- package/dist/client.js.map +1 -1
- package/dist/components/agent-page.d.ts +64 -1
- package/dist/components/agent-page.d.ts.map +1 -1
- package/dist/components/agent-page.js +244 -96
- package/dist/components/agent-page.js.map +1 -1
- package/dist/components/charts.d.ts +157 -0
- package/dist/components/charts.d.ts.map +1 -0
- package/dist/components/charts.js +182 -0
- package/dist/components/charts.js.map +1 -0
- package/dist/components/desk-records.d.ts +102 -0
- package/dist/components/desk-records.d.ts.map +1 -0
- package/dist/components/desk-records.js +221 -0
- package/dist/components/desk-records.js.map +1 -0
- package/dist/components/desk.d.ts +85 -0
- package/dist/components/desk.d.ts.map +1 -0
- package/dist/components/desk.js +135 -0
- package/dist/components/desk.js.map +1 -0
- package/dist/components/event-feed.d.ts.map +1 -1
- package/dist/components/event-feed.js +4 -1
- package/dist/components/event-feed.js.map +1 -1
- package/dist/components/home.d.ts.map +1 -1
- package/dist/components/home.js +4 -2
- package/dist/components/home.js.map +1 -1
- package/dist/components/plugin-settings.d.ts.map +1 -1
- package/dist/components/plugin-settings.js +54 -3
- package/dist/components/plugin-settings.js.map +1 -1
- package/dist/components/projects.d.ts.map +1 -1
- package/dist/components/projects.js +27 -7
- package/dist/components/projects.js.map +1 -1
- package/dist/components/rules.d.ts +8 -10
- package/dist/components/rules.d.ts.map +1 -1
- package/dist/components/rules.js +35 -13
- package/dist/components/rules.js.map +1 -1
- package/dist/components/setup.d.ts +9 -3
- package/dist/components/setup.d.ts.map +1 -1
- package/dist/components/setup.js +10 -4
- package/dist/components/setup.js.map +1 -1
- package/dist/console.css +677 -7
- package/dist/console.d.ts +5 -0
- package/dist/console.d.ts.map +1 -1
- package/dist/console.js +14 -8
- package/dist/console.js.map +1 -1
- package/dist/data.d.ts.map +1 -1
- package/dist/data.js +32 -33
- package/dist/data.js.map +1 -1
- package/dist/desk-page.d.ts +38 -0
- package/dist/desk-page.d.ts.map +1 -0
- package/dist/desk-page.js +184 -0
- package/dist/desk-page.js.map +1 -0
- package/dist/desk-records-page.d.ts +18 -0
- package/dist/desk-records-page.d.ts.map +1 -0
- package/dist/desk-records-page.js +130 -0
- package/dist/desk-records-page.js.map +1 -0
- package/dist/desk-records.d.ts +247 -0
- package/dist/desk-records.d.ts.map +1 -0
- package/dist/desk-records.js +543 -0
- package/dist/desk-records.js.map +1 -0
- package/dist/desk.d.ts +122 -0
- package/dist/desk.d.ts.map +1 -0
- package/dist/desk.js +211 -0
- package/dist/desk.js.map +1 -0
- package/dist/feed-stream.d.ts +39 -0
- package/dist/feed-stream.d.ts.map +1 -0
- package/dist/feed-stream.js +117 -0
- package/dist/feed-stream.js.map +1 -0
- package/dist/home-tiles.d.ts +10 -3
- package/dist/home-tiles.d.ts.map +1 -1
- package/dist/home-tiles.js +54 -31
- package/dist/home-tiles.js.map +1 -1
- package/dist/i18n/en.d.ts +180 -5
- package/dist/i18n/en.d.ts.map +1 -1
- package/dist/i18n/en.js +184 -7
- package/dist/i18n/en.js.map +1 -1
- package/dist/i18n/ko.d.ts.map +1 -1
- package/dist/i18n/ko.js +169 -6
- package/dist/i18n/ko.js.map +1 -1
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -1
- package/dist/limits.d.ts +11 -0
- package/dist/limits.d.ts.map +1 -1
- package/dist/limits.js +11 -0
- package/dist/limits.js.map +1 -1
- package/dist/onboarding.d.ts +6 -0
- package/dist/onboarding.d.ts.map +1 -1
- package/dist/onboarding.js +3 -3
- package/dist/onboarding.js.map +1 -1
- package/dist/plugin/context.d.ts +42 -11
- package/dist/plugin/context.d.ts.map +1 -1
- package/dist/plugin/limits.d.ts +2 -0
- package/dist/plugin/limits.d.ts.map +1 -1
- package/dist/plugin/limits.js +2 -0
- package/dist/plugin/limits.js.map +1 -1
- package/dist/plugin/manifest.d.ts +13 -0
- package/dist/plugin/manifest.d.ts.map +1 -1
- package/dist/plugin/manifest.js +30 -3
- package/dist/plugin/manifest.js.map +1 -1
- package/dist/plugin/rest-schemas.d.ts +55 -0
- package/dist/plugin/rest-schemas.d.ts.map +1 -1
- package/dist/plugin/rest-schemas.js +37 -0
- package/dist/plugin/rest-schemas.js.map +1 -1
- package/dist/plugin/sandbox.d.ts.map +1 -1
- package/dist/plugin/sandbox.js +4 -1
- package/dist/plugin/sandbox.js.map +1 -1
- package/dist/plugin/testing.d.ts +6 -2
- package/dist/plugin/testing.d.ts.map +1 -1
- package/dist/plugin/testing.js +52 -10
- package/dist/plugin/testing.js.map +1 -1
- package/dist/plugin.d.ts +1 -1
- package/dist/plugin.d.ts.map +1 -1
- package/dist/plugin.js +1 -1
- package/dist/plugin.js.map +1 -1
- package/dist/records.d.ts +283 -0
- package/dist/records.d.ts.map +1 -0
- package/dist/records.js +543 -0
- package/dist/records.js.map +1 -0
- package/dist/routes.d.ts +3 -1
- package/dist/routes.d.ts.map +1 -1
- package/dist/routes.js +3 -1
- package/dist/routes.js.map +1 -1
- package/dist/rules.d.ts +30 -11
- package/dist/rules.d.ts.map +1 -1
- package/dist/rules.js +98 -45
- package/dist/rules.js.map +1 -1
- package/dist/runner/acp.d.ts +1 -1
- package/dist/runner/acp.d.ts.map +1 -1
- package/dist/runner/acp.js +31 -20
- package/dist/runner/acp.js.map +1 -1
- package/dist/runner/claude.d.ts +1 -1
- package/dist/runner/claude.d.ts.map +1 -1
- package/dist/runner/claude.js +85 -15
- package/dist/runner/claude.js.map +1 -1
- package/dist/runner/codex.d.ts +1 -1
- package/dist/runner/codex.d.ts.map +1 -1
- package/dist/runner/codex.js +19 -16
- package/dist/runner/codex.js.map +1 -1
- package/dist/runner/desk.d.ts +43 -2
- package/dist/runner/desk.d.ts.map +1 -1
- package/dist/runner/desk.js +166 -10
- package/dist/runner/desk.js.map +1 -1
- package/dist/runner/process.d.ts.map +1 -1
- package/dist/runner/process.js +11 -4
- package/dist/runner/process.js.map +1 -1
- package/dist/runner/redact.d.ts +39 -4
- package/dist/runner/redact.d.ts.map +1 -1
- package/dist/runner/redact.js +81 -5
- package/dist/runner/redact.js.map +1 -1
- package/dist/runner/runner.d.ts +15 -1
- package/dist/runner/runner.d.ts.map +1 -1
- package/dist/runner/runner.js +231 -33
- package/dist/runner/runner.js.map +1 -1
- package/dist/runner/task-scheduler.d.ts +20 -0
- package/dist/runner/task-scheduler.d.ts.map +1 -1
- package/dist/runner/task-scheduler.js +34 -4
- package/dist/runner/task-scheduler.js.map +1 -1
- package/dist/runner/types.d.ts +36 -1
- package/dist/runner/types.d.ts.map +1 -1
- package/dist/runner/types.js +17 -0
- package/dist/runner/types.js.map +1 -1
- package/dist/runner.d.ts +6 -6
- package/dist/runner.d.ts.map +1 -1
- package/dist/runner.js +5 -5
- package/dist/runner.js.map +1 -1
- package/dist/schemas.d.ts +509 -5
- package/dist/schemas.d.ts.map +1 -1
- package/dist/schemas.js +76 -16
- package/dist/schemas.js.map +1 -1
- package/dist/services.d.ts +22 -5
- package/dist/services.d.ts.map +1 -1
- package/dist/services.js +35 -15
- package/dist/services.js.map +1 -1
- package/dist/setup-guide.d.ts +3 -1
- package/dist/setup-guide.d.ts.map +1 -1
- package/dist/setup-guide.js +7 -4
- package/dist/setup-guide.js.map +1 -1
- package/dist/vocabulary.d.ts +14 -3
- package/dist/vocabulary.d.ts.map +1 -1
- package/dist/vocabulary.js +13 -3
- package/dist/vocabulary.js.map +1 -1
- package/docs/specs/cli.md +64 -38
- package/docs/specs/plugins.md +27 -20
- package/docs/specs/records.md +113 -0
- package/docs/specs/rest.md +20 -13
- package/docs/specs/runner.md +23 -17
- package/package.json +7 -2
- package/skills/building-a-console/SKILL.md +4 -4
- package/skills/building-a-plugin/SKILL.md +6 -6
- package/skills/deploying-a-console/SKILL.md +4 -4
- package/skills/deploying-a-console/references/resources.md +41 -4
- package/skills/deploying-a-console/references/running-it-again.md +3 -2
- package/skills/keeping-a-desk/SKILL.md +133 -0
- package/skills/keeping-a-desk/collections.md +96 -0
- package/skills/planning-the-board/SKILL.md +14 -18
- package/skills/planning-the-board/references/a-task.md +2 -2
- package/skills/planning-the-board/references/project-rules.md +13 -14
- package/skills/planning-the-board/references/setting-up.md +15 -13
- package/skills/running-an-agent/SKILL.md +10 -9
- package/skills/working-the-board/SKILL.md +62 -44
- package/skills/working-the-board/references/terms.md +9 -5
- package/skills/working-the-board/references/the-pack.md +12 -10
- package/skills/working-the-board/references/the-sentence.md +2 -2
- package/src/agent-page.tsx +3 -1
- package/src/api.ts +77 -2
- package/src/charts.ts +250 -0
- package/src/cli/cli.ts +1698 -476
- package/src/cli/command-words.ts +56 -0
- package/src/cli/credentials.ts +181 -20
- package/src/cli/directory.ts +28 -10
- package/src/cli/format.ts +301 -46
- package/src/cli/help.ts +102 -54
- package/src/cli/main.ts +72 -2
- package/src/cli/pack.ts +333 -372
- package/src/cli/plugin-check.ts +275 -34
- package/src/cli/plugin-cli.ts +28 -4
- package/src/cli/plugin-main.ts +1 -0
- package/src/cli/serve.ts +295 -2
- package/src/client.ts +192 -177
- package/src/components/agent-page.tsx +489 -243
- package/src/components/charts.tsx +680 -0
- package/src/components/desk-records.tsx +724 -0
- package/src/components/desk.tsx +471 -0
- package/src/components/event-feed.tsx +5 -1
- package/src/components/home.tsx +12 -0
- package/src/components/plugin-settings.tsx +171 -12
- package/src/components/projects.tsx +29 -12
- package/src/components/rules.tsx +94 -34
- package/src/components/setup.tsx +18 -3
- package/src/console.tsx +17 -9
- package/src/data.ts +37 -34
- package/src/desk-page.tsx +332 -0
- package/src/desk-records-page.tsx +256 -0
- package/src/desk-records.ts +808 -0
- package/src/desk.ts +329 -0
- package/src/feed-stream.ts +144 -0
- package/src/home-tiles.ts +55 -35
- package/src/i18n/en.ts +196 -9
- package/src/i18n/ko.ts +178 -8
- package/src/index.ts +118 -0
- package/src/limits.ts +11 -0
- package/src/onboarding.ts +12 -4
- package/src/plugin/context.ts +55 -12
- package/src/plugin/limits.ts +2 -0
- package/src/plugin/manifest.ts +38 -2
- package/src/plugin/rest-schemas.ts +41 -0
- package/src/plugin/sandbox.ts +4 -1
- package/src/plugin/testing.ts +63 -12
- package/src/plugin.ts +2 -0
- package/src/records.ts +702 -0
- package/src/routes.ts +3 -1
- package/src/rules.ts +108 -47
- package/src/runner/acp.ts +47 -29
- package/src/runner/claude.ts +113 -23
- package/src/runner/codex.ts +35 -25
- package/src/runner/desk.ts +198 -12
- package/src/runner/process.ts +11 -4
- package/src/runner/redact.ts +92 -6
- package/src/runner/runner.ts +275 -34
- package/src/runner/task-scheduler.ts +36 -4
- package/src/runner/types.ts +47 -1
- package/src/runner.ts +27 -2
- package/src/schemas.ts +83 -15
- package/src/services.ts +49 -14
- package/src/setup-guide.ts +6 -2
- package/src/styles/README.md +11 -1
- package/src/styles/console.css +9 -0
- package/src/styles/pages/desk.css +126 -0
- package/src/styles/pages/documents.css +5 -0
- package/src/styles/parts/bars.css +80 -0
- package/src/styles/parts/chart.css +173 -0
- package/src/styles/parts/figures.css +65 -0
- package/src/styles/parts/legend.css +48 -0
- package/src/styles/parts/series.css +32 -0
- package/src/styles/parts/share.css +25 -0
- package/src/styles/parts/spark.css +23 -0
- package/src/styles/parts/stat.css +69 -0
- package/src/styles/tokens.css +13 -7
- package/src/vocabulary.ts +16 -3
- package/template/desk-web/README.md +8 -0
- package/template/desk-web/index.html +13 -0
- package/template/desk-web/package.json +25 -0
- package/template/desk-web/src/main.tsx +24 -0
- package/template/desk-web/src/page.tsx +51 -0
- package/template/desk-web/tsconfig.json +16 -0
- package/template/desk-web/vite.config.ts +15 -0
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type ReactNode } from "react";
|
|
2
2
|
import { type AgentState, type FileUpload, type RestAgent, type RestAgentRunner, type RestAgentSecret, type RestAgentSession, type RestPerson, type RestSignal, type RestTranscriptEvent } from "../api.js";
|
|
3
|
+
import { type PictureState } from "./pictures.js";
|
|
3
4
|
/** The state of an agent account as a badge: the word, and why and since when where there is room. */
|
|
4
5
|
export declare function AgentStateBadge(props: {
|
|
5
6
|
readonly state: RestAgent["state"];
|
|
@@ -56,6 +57,12 @@ export type TalkItem = {
|
|
|
56
57
|
readonly result: RestTranscriptEvent | undefined;
|
|
57
58
|
readonly permission: RestTranscriptEvent | undefined;
|
|
58
59
|
};
|
|
60
|
+
/**
|
|
61
|
+
* Whose an event is, where a sub-agent made it (ADR-0131): what the call that started the
|
|
62
|
+
* sub-agent called it, an empty name where the runner knew only that call, and nothing for an
|
|
63
|
+
* event of the session's own, which is every event of a runner that does not say.
|
|
64
|
+
*/
|
|
65
|
+
export declare function subagentOf(event: RestTranscriptEvent | undefined): string | undefined;
|
|
59
66
|
/**
|
|
60
67
|
* The events of a session as the things a person reads, in order. A tool's call, what it
|
|
61
68
|
* answered and what was asked before it ran are one thing, joined by the id the product gave
|
|
@@ -135,13 +142,69 @@ export declare const HAND_MS = 1200;
|
|
|
135
142
|
* data, and a name every object has is no word of the pack.
|
|
136
143
|
*/
|
|
137
144
|
export declare function wordOf(words: Readonly<Record<string, string>>, name: string): string;
|
|
145
|
+
/**
|
|
146
|
+
* What every line of a conversation is handed, the same from one render of the view to the
|
|
147
|
+
* next, so that a line is drawn again only when what it shows changed.
|
|
148
|
+
*/
|
|
149
|
+
export interface TalkHands {
|
|
150
|
+
/** Where the bytes of a picture of the session are read. */
|
|
151
|
+
readonly fileHref: (fileId: string) => string;
|
|
152
|
+
/** Where the bytes of a file of a signal are read, where the view was told. */
|
|
153
|
+
readonly signalFileHref: ((number: number, fileId: string) => string) | undefined;
|
|
154
|
+
/** Reads the whole text of an event, where the view can. */
|
|
155
|
+
readonly readWhole: ((n: number) => void) | undefined;
|
|
156
|
+
readonly openPicture: PictureState["open"];
|
|
157
|
+
}
|
|
158
|
+
export interface TalkLineProps {
|
|
159
|
+
readonly one: TalkItem;
|
|
160
|
+
readonly hands: TalkHands;
|
|
161
|
+
/** The account's picture, beside what it said. */
|
|
162
|
+
readonly agent: RestPerson | undefined;
|
|
163
|
+
/** When the turn the line ends began, for a line that ends one. */
|
|
164
|
+
readonly began: string | undefined;
|
|
165
|
+
/** The files that came with what the agent was told, as the account's record names them. */
|
|
166
|
+
readonly files: readonly SignalFile[] | undefined;
|
|
167
|
+
/** The line's text read whole: its own, or its call's for a tool. */
|
|
168
|
+
readonly whole: string | undefined;
|
|
169
|
+
/** A tool's answer read whole. */
|
|
170
|
+
readonly wholeAnswer: string | undefined;
|
|
171
|
+
/** The event of the line whose whole text is being read, by its number. */
|
|
172
|
+
readonly reading: number | undefined;
|
|
173
|
+
/** The day it is: a moment of today is said by its hour alone, so a new day draws the lines again. */
|
|
174
|
+
readonly today: string;
|
|
175
|
+
}
|
|
176
|
+
/** Whether a line would be drawn the same: then it is not drawn again. */
|
|
177
|
+
export declare function sameLine(a: TalkLineProps, b: TalkLineProps): boolean;
|
|
178
|
+
/** When the turn an event ends began, by the event's number: the first thing the agent was sent after the turn before. */
|
|
179
|
+
export declare function turnStarts(events: readonly RestTranscriptEvent[]): ReadonlyMap<number, string>;
|
|
180
|
+
/**
|
|
181
|
+
* What each line of a conversation is given, in order, with the number it is told apart by:
|
|
182
|
+
* its own events, and of everything the view holds only what the line itself shows, so that a
|
|
183
|
+
* line's props say the same until the line would be drawn otherwise.
|
|
184
|
+
*/
|
|
185
|
+
export declare function talkLinesOf(input: {
|
|
186
|
+
readonly items: readonly TalkItem[];
|
|
187
|
+
readonly hands: TalkHands;
|
|
188
|
+
readonly agent: RestPerson | undefined;
|
|
189
|
+
readonly began: ReadonlyMap<number, string>;
|
|
190
|
+
readonly signalFiles: TranscriptViewProps["signalFiles"];
|
|
191
|
+
readonly whole: WholeTexts;
|
|
192
|
+
/** The session the events are of. */
|
|
193
|
+
readonly of: string | undefined;
|
|
194
|
+
/** The event whose whole text is being read, by its number. */
|
|
195
|
+
readonly reading: number | undefined;
|
|
196
|
+
readonly today: string;
|
|
197
|
+
}): readonly (TalkLineProps & {
|
|
198
|
+
readonly key: number;
|
|
199
|
+
})[];
|
|
138
200
|
/**
|
|
139
201
|
* A session as a conversation: what the agent was told at the right, as whoever said it wrote
|
|
140
202
|
* it, with the files that came with it; what the agent said at the left, beside its picture; its
|
|
141
203
|
* thoughts folded; a tool's call and what it answered as one row that opens, the steps of a turn
|
|
142
204
|
* close together; a wake, a status and an error as notes between, and a line where a turn
|
|
143
205
|
* ended, with how long it took. A picture opens large over the page. Everything an agent's
|
|
144
|
-
* product printed is text, never markup.
|
|
206
|
+
* product printed is text, never markup. Each line is drawn once and again only when it
|
|
207
|
+
* changed, however long the session is.
|
|
145
208
|
*/
|
|
146
209
|
export declare function TranscriptView(props: TranscriptViewProps): import("react").JSX.Element;
|
|
147
210
|
export interface TalkWaitingProps {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-page.d.ts","sourceRoot":"","sources":["../../src/components/agent-page.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"agent-page.d.ts","sourceRoot":"","sources":["../../src/components/agent-page.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,SAAS,EAMf,MAAM,OAAO,CAAC;AACf,OAAO,EACL,KAAK,UAAU,EACf,KAAK,UAAU,EAIf,KAAK,SAAS,EACd,KAAK,eAAe,EACpB,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACrB,KAAK,UAAU,EACf,KAAK,UAAU,EACf,KAAK,mBAAmB,EACzB,MAAM,WAAW,CAAC;AAInB,OAAO,EAAY,KAAK,YAAY,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AAC,MAAM,EAAE,MAAM,CAAC,CAAC,GAAG,SAAS,CAAC;CACjE,+BAoBA;AAED,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,OAAO,EAAE,SAAS,eAAe,EAAE,CAAC;IAC7C,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IACpC,yEAAyE;IACzE,QAAQ,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACvD,QAAQ,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CAC3C;AAED,iHAAiH;AACjH,wBAAgB,eAAe,CAAC,KAAK,EAAE,oBAAoB,+BAiE1D"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useEffect, useRef, useState } from "react";
|
|
2
|
+
import { memo, useCallback, useEffect, useMemo, useRef, useState, } from "react";
|
|
3
3
|
import { MAX_FILE_BYTES, MAX_SIGNAL_ATTACHMENTS, MAX_SIGNAL_LENGTH, } from "../api.js";
|
|
4
|
+
import { today } from "../dates.js";
|
|
4
5
|
import { useWords } from "../i18n/index.js";
|
|
5
6
|
import { isPicture } from "./files.js";
|
|
6
7
|
import { Lightbox, PictureThumb, usePicture } from "./pictures.js";
|
|
@@ -38,6 +39,21 @@ export function AgentStateBadge(props) {
|
|
|
38
39
|
}
|
|
39
40
|
/** What a runner says of an event that is said apart from the rest: the tool it names. */
|
|
40
41
|
const TOOL = "tool";
|
|
42
|
+
/** The most characters of a sub-agent's name that a label shows. */
|
|
43
|
+
const MAX_SUBAGENT_LABEL = 40;
|
|
44
|
+
/**
|
|
45
|
+
* Whose an event is, where a sub-agent made it (ADR-0131): what the call that started the
|
|
46
|
+
* sub-agent called it, an empty name where the runner knew only that call, and nothing for an
|
|
47
|
+
* event of the session's own, which is every event of a runner that does not say.
|
|
48
|
+
*/
|
|
49
|
+
export function subagentOf(event) {
|
|
50
|
+
const parent = event?.data.parent;
|
|
51
|
+
if (typeof parent !== "string" || parent.length === 0) {
|
|
52
|
+
return undefined;
|
|
53
|
+
}
|
|
54
|
+
const name = event?.data.subagent;
|
|
55
|
+
return typeof name === "string" ? name.trim().slice(0, MAX_SUBAGENT_LABEL) : "";
|
|
56
|
+
}
|
|
41
57
|
const idOf = (event) => {
|
|
42
58
|
const id = event.data.id;
|
|
43
59
|
return typeof id === "string" && id.length > 0 ? id : undefined;
|
|
@@ -274,17 +290,205 @@ const word = (value) => typeof value === "string" && value.length > 0 ? value :
|
|
|
274
290
|
export function wordOf(words, name) {
|
|
275
291
|
return Object.hasOwn(words, name) ? (words[name] ?? name) : name;
|
|
276
292
|
}
|
|
293
|
+
/** Whether two things of a session are the same events: a thing is made anew each time the events are read through. */
|
|
294
|
+
function sameItem(a, b) {
|
|
295
|
+
if (a.type === "tool" || b.type === "tool") {
|
|
296
|
+
return (a.type === "tool" &&
|
|
297
|
+
b.type === "tool" &&
|
|
298
|
+
a.call === b.call &&
|
|
299
|
+
a.result === b.result &&
|
|
300
|
+
a.permission === b.permission);
|
|
301
|
+
}
|
|
302
|
+
return a.type === b.type && a.event === b.event;
|
|
303
|
+
}
|
|
304
|
+
/** Whether two lists of a signal's files name the same files: the record is read again every few seconds. */
|
|
305
|
+
function sameFiles(a, b) {
|
|
306
|
+
if (a === b) {
|
|
307
|
+
return true;
|
|
308
|
+
}
|
|
309
|
+
return (a !== undefined &&
|
|
310
|
+
b !== undefined &&
|
|
311
|
+
a.length === b.length &&
|
|
312
|
+
a.every((file, index) => {
|
|
313
|
+
const other = b[index];
|
|
314
|
+
return (other !== undefined &&
|
|
315
|
+
file.id === other.id &&
|
|
316
|
+
file.name === other.name &&
|
|
317
|
+
file.size === other.size &&
|
|
318
|
+
file.contentType === other.contentType);
|
|
319
|
+
}));
|
|
320
|
+
}
|
|
321
|
+
/** Whether a line would be drawn the same: then it is not drawn again. */
|
|
322
|
+
export function sameLine(a, b) {
|
|
323
|
+
return (sameItem(a.one, b.one) &&
|
|
324
|
+
a.hands === b.hands &&
|
|
325
|
+
a.agent === b.agent &&
|
|
326
|
+
a.began === b.began &&
|
|
327
|
+
sameFiles(a.files, b.files) &&
|
|
328
|
+
a.whole === b.whole &&
|
|
329
|
+
a.wholeAnswer === b.wholeAnswer &&
|
|
330
|
+
a.reading === b.reading &&
|
|
331
|
+
a.today === b.today);
|
|
332
|
+
}
|
|
333
|
+
/** When the turn an event ends began, by the event's number: the first thing the agent was sent after the turn before. */
|
|
334
|
+
export function turnStarts(events) {
|
|
335
|
+
const starts = new Map();
|
|
336
|
+
let since;
|
|
337
|
+
for (const event of events) {
|
|
338
|
+
if (event.kind === "status" && event.data.turn === "completed") {
|
|
339
|
+
if (since !== undefined) {
|
|
340
|
+
starts.set(event.n, since);
|
|
341
|
+
}
|
|
342
|
+
since = undefined;
|
|
343
|
+
}
|
|
344
|
+
else if ((event.kind === "person" || event.kind === "wake") && since === undefined) {
|
|
345
|
+
since = event.at;
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
return starts;
|
|
349
|
+
}
|
|
350
|
+
/**
|
|
351
|
+
* What each line of a conversation is given, in order, with the number it is told apart by:
|
|
352
|
+
* its own events, and of everything the view holds only what the line itself shows, so that a
|
|
353
|
+
* line's props say the same until the line would be drawn otherwise.
|
|
354
|
+
*/
|
|
355
|
+
export function talkLinesOf(input) {
|
|
356
|
+
const { whole, of, reading } = input;
|
|
357
|
+
return input.items.flatMap((one) => {
|
|
358
|
+
const main = one.type === "tool" ? one.call : one.event;
|
|
359
|
+
const answer = one.type === "tool" ? one.result : undefined;
|
|
360
|
+
const first = one.type === "tool" ? (main ?? one.permission ?? answer) : one.event;
|
|
361
|
+
if (first === undefined) {
|
|
362
|
+
return [];
|
|
363
|
+
}
|
|
364
|
+
const signal = one.type === "told" ? one.event.data.signal : undefined;
|
|
365
|
+
return [
|
|
366
|
+
{
|
|
367
|
+
key: first.n,
|
|
368
|
+
one,
|
|
369
|
+
hands: input.hands,
|
|
370
|
+
// The account's picture stands beside what it said, and nowhere else: what a
|
|
371
|
+
// sub-agent said is a step, with no picture, and is not drawn again for one.
|
|
372
|
+
agent: one.type === "said" && subagentOf(one.event) === undefined ? input.agent : undefined,
|
|
373
|
+
began: one.type === "tool" ? undefined : input.began.get(one.event.n),
|
|
374
|
+
files: typeof signal === "number" ? input.signalFiles?.(signal) : undefined,
|
|
375
|
+
whole: main === undefined ? undefined : wholeOf(whole, of, main.n),
|
|
376
|
+
wholeAnswer: answer === undefined ? undefined : wholeOf(whole, of, answer.n),
|
|
377
|
+
reading: reading !== undefined && (reading === main?.n || reading === answer?.n)
|
|
378
|
+
? reading
|
|
379
|
+
: undefined,
|
|
380
|
+
today: input.today,
|
|
381
|
+
},
|
|
382
|
+
];
|
|
383
|
+
});
|
|
384
|
+
}
|
|
385
|
+
/**
|
|
386
|
+
* One line of a conversation. It is drawn again only when its own events, its own texts read
|
|
387
|
+
* whole or what it is handed changed: a session of thousands of events draws one line for an
|
|
388
|
+
* event that arrives, not all of them.
|
|
389
|
+
*/
|
|
390
|
+
const TalkLine = memo(function TalkLine(props) {
|
|
391
|
+
const all = useWords();
|
|
392
|
+
const words = all.agents.page.live;
|
|
393
|
+
const { one, hands } = props;
|
|
394
|
+
const kinds = words.kinds;
|
|
395
|
+
/** The words of an event, whole where they were read whole, with the way to read the rest. */
|
|
396
|
+
const text = (event, className, read) => {
|
|
397
|
+
const shown = read ?? event.text;
|
|
398
|
+
const readWhole = hands.readWhole;
|
|
399
|
+
return (_jsxs(_Fragment, { children: [shown.length > 0 && _jsx("pre", { className: className, children: shown }), event.whole !== null && read === undefined && (_jsxs("p", { className: "sc-talk-cut", children: [words.cutAt(formatBytes(event.whole)), " ", readWhole !== undefined && (_jsx(Button, { variant: "ghost", size: "sm", disabled: props.reading === event.n, onClick: () => readWhole(event.n), children: words.whole }))] }))] }));
|
|
400
|
+
};
|
|
401
|
+
const pictures = (event) => event === undefined || event.files.length === 0 ? null : (_jsx("ul", { className: "sc-talk-pictures", children: event.files.map((file) => (_jsx("li", { children: _jsx(PictureThumb, { picture: {
|
|
402
|
+
src: hands.fileHref(file.id),
|
|
403
|
+
alt: file.name,
|
|
404
|
+
name: file.name,
|
|
405
|
+
size: file.size,
|
|
406
|
+
}, onOpen: hands.openPicture }) }, file.id))) }));
|
|
407
|
+
const when = (event) => _jsx(Time, { iso: event.at, precision: "clock" });
|
|
408
|
+
if (one.type === "tool") {
|
|
409
|
+
const first = one.call ?? one.permission ?? one.result;
|
|
410
|
+
if (first === undefined) {
|
|
411
|
+
return null;
|
|
412
|
+
}
|
|
413
|
+
const name = word(one.call?.data[TOOL]) ?? word(one.permission?.data[TOOL]);
|
|
414
|
+
const failed = one.result?.data.error === true;
|
|
415
|
+
const answer = word(one.permission?.data.answer);
|
|
416
|
+
const refused = answer !== undefined && answer !== "allowed";
|
|
417
|
+
const line = firstLine(one.call?.text ?? one.permission?.text ?? one.result?.text ?? "");
|
|
418
|
+
// Whose the call is, where a sub-agent made it: read off the line's own events, as
|
|
419
|
+
// everything a line shows is, so that it is drawn again only when they are others.
|
|
420
|
+
const sub = subagentOf(first);
|
|
421
|
+
return (_jsxs("li", { className: cx("sc-talk-item", "sc-talk-step", "sc-talk-tool", (failed || refused) && "sc-talk-tool-failed"), "data-n": first.n, children: [_jsxs("details", { className: "sc-talk-tool-fold", children: [_jsxs("summary", { className: "sc-talk-tool-head", children: [_jsx("code", { className: "sc-talk-tool-name", children: name ?? kinds.tool_call }), _jsx("span", { className: "sc-talk-tool-line", children: line }), sub !== undefined && _jsx(Badge, { children: words.subagent(sub) }), failed && _jsx(Badge, { tone: "danger", children: words.toolFailed }), refused && _jsx(Badge, { tone: "warning", children: words.toolRefused }), one.result === undefined && one.call !== undefined && !refused && (_jsx("span", { className: "sc-muted", children: words.toolRunning })), when(first)] }), _jsxs("div", { className: "sc-talk-tool-body", children: [one.permission !== undefined && (_jsxs("p", { className: "sc-talk-note-line", children: [kinds.permission, answer === undefined ? "" : ` · ${wordOf(words.answers, answer)}`, one.permission.text.length > 0 && ` · ${one.permission.text}`] })), one.call !== undefined && text(one.call, "sc-talk-code", props.whole), one.result !== undefined &&
|
|
422
|
+
text(one.result, "sc-talk-code sc-talk-code-answer", props.wholeAnswer)] })] }), pictures(one.result)] }));
|
|
423
|
+
}
|
|
424
|
+
const { event } = one;
|
|
425
|
+
if (event.sealed !== null) {
|
|
426
|
+
return (_jsxs("li", { className: "sc-talk-item sc-talk-note", "data-n": event.n, children: [_jsx("span", { className: "sc-talk-note-line", children: words.sealed(event.sealed.by === null ? "?" : (event.sealed.by.name ?? event.sealed.by.login), event.sealed.reason) }), when(event)] }));
|
|
427
|
+
}
|
|
428
|
+
if (one.type === "told") {
|
|
429
|
+
const number = typeof event.data.signal === "number" ? event.data.signal : undefined;
|
|
430
|
+
const kind = word(event.data.kind);
|
|
431
|
+
const through = word(event.data.agent);
|
|
432
|
+
const unseen = word(event.data.unseen);
|
|
433
|
+
const others = word(event.data.files);
|
|
434
|
+
const listed = number === undefined
|
|
435
|
+
? undefined
|
|
436
|
+
: props.files?.filter((file) => !isPicture(file.contentType));
|
|
437
|
+
const who = word(event.data.by) ?? words.kinds.person;
|
|
438
|
+
// An interrupt with no words of its own stopped the turn so that what waited is read: a
|
|
439
|
+
// note of who did, and no message.
|
|
440
|
+
if (kind === "interrupt" &&
|
|
441
|
+
event.text.length === 0 &&
|
|
442
|
+
event.files.length === 0 &&
|
|
443
|
+
others === undefined) {
|
|
444
|
+
return (_jsx("li", { className: "sc-talk-item sc-talk-note", "data-n": event.n, children: _jsxs("span", { className: "sc-talk-note-line", children: [words.interrupted(who), when(event)] }) }));
|
|
445
|
+
}
|
|
446
|
+
const signalFileHref = hands.signalFileHref;
|
|
447
|
+
return (_jsxs("li", { className: "sc-talk-item sc-talk-told", "data-n": event.n, children: [_jsxs("div", { className: "sc-talk-bubble", children: [text(event, "sc-talk-text", props.whole), pictures(event), listed !== undefined && listed.length > 0 ? (_jsx("ul", { className: "sc-chosen-files", "aria-label": words.files, children: listed.map((file) => (_jsxs("li", { className: "sc-chosen-file", children: [signalFileHref === undefined || number === undefined ? (_jsx("span", { children: file.name })) : (_jsx("a", { href: signalFileHref(number, file.id), download: file.name, children: file.name })), " ", _jsx("span", { className: "sc-muted", children: formatBytes(file.size) })] }, file.id))) })) : (others !== undefined && (_jsxs("p", { className: "sc-talk-note-line", children: [words.files, ": ", others] }))), unseen !== undefined && (_jsx("p", { className: "sc-talk-note-line sc-talk-unseen", children: words.unseen(unseen) }))] }), _jsxs("div", { className: "sc-talk-meta", children: [_jsx("span", { className: "sc-talk-who", children: who }), through !== undefined && _jsx("span", { children: words.through(through) }), kind !== undefined && kind !== "tell" && (_jsx(Badge, { children: wordOf(words.signalKinds, kind) })), when(event)] }), event.data.unread === true && (_jsx("p", { className: "sc-talk-note-line sc-talk-unread", children: words.unread }))] }));
|
|
448
|
+
}
|
|
449
|
+
if (one.type === "said") {
|
|
450
|
+
const sub = subagentOf(event);
|
|
451
|
+
// What a sub-agent said is a step of the work, and not the agent's word to whoever reads:
|
|
452
|
+
// folded as a thought is, under the sub-agent's name.
|
|
453
|
+
if (sub !== undefined) {
|
|
454
|
+
return (_jsx("li", { className: "sc-talk-item sc-talk-step sc-talk-thought", "data-n": event.n, children: _jsxs("details", { className: "sc-talk-tool-fold", children: [_jsxs("summary", { className: "sc-talk-tool-head", children: [_jsx("span", { className: "sc-talk-kind", children: kinds.assistant }), _jsx("span", { className: "sc-talk-tool-line", children: firstLine(event.text) }), _jsx(Badge, { children: words.subagent(sub) }), when(event)] }), _jsxs("div", { className: "sc-talk-tool-body", children: [text(event, "sc-talk-text", props.whole), pictures(event)] })] }) }));
|
|
455
|
+
}
|
|
456
|
+
return (_jsxs("li", { className: "sc-talk-item sc-talk-said", "data-n": event.n, children: [props.agent !== undefined && _jsx(Avatar, { person: props.agent, size: "sm" }), _jsxs("div", { className: "sc-talk-prose", children: [text(event, "sc-talk-text", props.whole), pictures(event)] }), when(event)] }));
|
|
457
|
+
}
|
|
458
|
+
if (one.type === "thought") {
|
|
459
|
+
const sub = subagentOf(event);
|
|
460
|
+
return (_jsx("li", { className: "sc-talk-item sc-talk-step sc-talk-thought", "data-n": event.n, children: _jsxs("details", { className: "sc-talk-tool-fold", children: [_jsxs("summary", { className: "sc-talk-tool-head", children: [_jsx("span", { className: "sc-talk-kind", children: kinds.thinking }), _jsx("span", { className: "sc-talk-tool-line", children: firstLine(event.text) }), sub !== undefined && _jsx(Badge, { children: words.subagent(sub) }), when(event)] }), _jsx("div", { className: "sc-talk-tool-body", children: text(event, "sc-talk-text", props.whole) })] }) }));
|
|
461
|
+
}
|
|
462
|
+
// Where a turn ended: a line, with how long the agent was at it where the record says when it began.
|
|
463
|
+
if (event.kind === "status" && event.data.turn === "completed") {
|
|
464
|
+
const from = props.began;
|
|
465
|
+
const seconds = from === undefined
|
|
466
|
+
? undefined
|
|
467
|
+
: Math.max(0, Math.round((Date.parse(event.at) - Date.parse(from)) / 1000));
|
|
468
|
+
return (_jsx("li", { className: "sc-talk-item sc-talk-turn", "data-n": event.n, children: _jsxs("span", { className: "sc-talk-note-line", children: [words.turnDone(Number.isFinite(seconds) ? seconds : undefined), when(event)] }) }));
|
|
469
|
+
}
|
|
470
|
+
// A wake, a status, an error, and whatever a newer runner calls otherwise: a note between.
|
|
471
|
+
// What the note's own words say already, how a session ended, is not said twice as a fact.
|
|
472
|
+
// The id of the call that started a sub-agent is for joining, and says nothing to a reader.
|
|
473
|
+
const facts = Object.entries(event.data).filter(([name, fact]) => fact !== null &&
|
|
474
|
+
name !== "signal" &&
|
|
475
|
+
name !== "kind" &&
|
|
476
|
+
name !== "ended" &&
|
|
477
|
+
name !== "parent");
|
|
478
|
+
const lines = event.text.split("\n").filter((line) => line.trim().length > 0);
|
|
479
|
+
return (_jsxs("li", { className: cx("sc-talk-item", "sc-talk-note", event.kind === "error" && "sc-talk-note-error"), "data-n": event.n, children: [_jsxs("span", { className: "sc-talk-note-line", children: [_jsx("span", { className: "sc-talk-kind", children: kinds[event.kind] ?? event.kind }), facts.map(([name, fact]) => (_jsxs("span", { className: "sc-talk-fact", children: [wordOf(words.facts, name), " ", String(fact)] }, name))), lines.length === 1 && _jsx("span", { children: lines[0] }), when(event)] }), lines.length > 1 && text(event, "sc-talk-text sc-talk-text-note", props.whole), pictures(event)] }));
|
|
480
|
+
}, sameLine);
|
|
277
481
|
/**
|
|
278
482
|
* A session as a conversation: what the agent was told at the right, as whoever said it wrote
|
|
279
483
|
* it, with the files that came with it; what the agent said at the left, beside its picture; its
|
|
280
484
|
* thoughts folded; a tool's call and what it answered as one row that opens, the steps of a turn
|
|
281
485
|
* close together; a wake, a status and an error as notes between, and a line where a turn
|
|
282
486
|
* ended, with how long it took. A picture opens large over the page. Everything an agent's
|
|
283
|
-
* product printed is text, never markup.
|
|
487
|
+
* product printed is text, never markup. Each line is drawn once and again only when it
|
|
488
|
+
* changed, however long the session is.
|
|
284
489
|
*/
|
|
285
490
|
export function TranscriptView(props) {
|
|
286
|
-
const
|
|
287
|
-
const words = all.agents.page.live;
|
|
491
|
+
const words = useWords().agents.page.live;
|
|
288
492
|
const shown = usePicture();
|
|
289
493
|
// What was read whole belongs to the session it was read in: the events of another carry the
|
|
290
494
|
// same numbers, and a view that goes on to show them must show none of this.
|
|
@@ -293,26 +497,12 @@ export function TranscriptView(props) {
|
|
|
293
497
|
const of = props.of;
|
|
294
498
|
const showing = useRef(of);
|
|
295
499
|
showing.current = of;
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
const
|
|
301
|
-
|
|
302
|
-
for (const event of props.events) {
|
|
303
|
-
if (event.kind === "status" && event.data.turn === "completed") {
|
|
304
|
-
if (since !== undefined) {
|
|
305
|
-
began.set(event.n, since);
|
|
306
|
-
}
|
|
307
|
-
since = undefined;
|
|
308
|
-
}
|
|
309
|
-
else if ((event.kind === "person" || event.kind === "wake") && since === undefined) {
|
|
310
|
-
since = event.at;
|
|
311
|
-
}
|
|
312
|
-
}
|
|
313
|
-
const kinds = words.kinds;
|
|
314
|
-
const readWhole = (n) => {
|
|
315
|
-
const load = props.onReadWhole;
|
|
500
|
+
// What the view is given may be made anew by whoever renders it; the lines are handed the
|
|
501
|
+
// same hands each time, which reach for what was given last.
|
|
502
|
+
const given = useRef(props);
|
|
503
|
+
given.current = props;
|
|
504
|
+
const readWhole = useCallback((n) => {
|
|
505
|
+
const load = given.current.onReadWhole;
|
|
316
506
|
if (load === undefined) {
|
|
317
507
|
return;
|
|
318
508
|
}
|
|
@@ -326,78 +516,36 @@ export function TranscriptView(props) {
|
|
|
326
516
|
})
|
|
327
517
|
.catch(() => undefined)
|
|
328
518
|
.finally(() => setReading((current) => current !== undefined && current.of === of && current.n === n ? undefined : current));
|
|
329
|
-
};
|
|
330
|
-
|
|
331
|
-
const
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
const
|
|
343
|
-
const
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
}
|
|
360
|
-
if (one.type === "told") {
|
|
361
|
-
const number = typeof event.data.signal === "number" ? event.data.signal : undefined;
|
|
362
|
-
const kind = word(event.data.kind);
|
|
363
|
-
const through = word(event.data.agent);
|
|
364
|
-
const unseen = word(event.data.unseen);
|
|
365
|
-
const others = word(event.data.files);
|
|
366
|
-
const listed = number === undefined
|
|
367
|
-
? undefined
|
|
368
|
-
: props.signalFiles?.(number)?.filter((file) => !isPicture(file.contentType));
|
|
369
|
-
const who = word(event.data.by) ?? words.kinds.person;
|
|
370
|
-
// An interrupt with no words of its own stopped the turn so that what waited is read: a
|
|
371
|
-
// note of who did, and no message.
|
|
372
|
-
if (kind === "interrupt" &&
|
|
373
|
-
event.text.length === 0 &&
|
|
374
|
-
event.files.length === 0 &&
|
|
375
|
-
others === undefined) {
|
|
376
|
-
return (_jsx("li", { className: "sc-talk-item sc-talk-note", "data-n": event.n, children: _jsxs("span", { className: "sc-talk-note-line", children: [words.interrupted(who), when(event)] }) }, event.n));
|
|
377
|
-
}
|
|
378
|
-
return (_jsxs("li", { className: "sc-talk-item sc-talk-told", "data-n": event.n, children: [_jsxs("div", { className: "sc-talk-bubble", children: [text(event, "sc-talk-text"), pictures(event), listed !== undefined && listed.length > 0 ? (_jsx("ul", { className: "sc-chosen-files", "aria-label": words.files, children: listed.map((file) => (_jsxs("li", { className: "sc-chosen-file", children: [props.signalFileHref === undefined || number === undefined ? (_jsx("span", { children: file.name })) : (_jsx("a", { href: props.signalFileHref(number, file.id), download: file.name, children: file.name })), " ", _jsx("span", { className: "sc-muted", children: formatBytes(file.size) })] }, file.id))) })) : (others !== undefined && (_jsxs("p", { className: "sc-talk-note-line", children: [words.files, ": ", others] }))), unseen !== undefined && (_jsx("p", { className: "sc-talk-note-line sc-talk-unseen", children: words.unseen(unseen) }))] }), _jsxs("div", { className: "sc-talk-meta", children: [_jsx("span", { className: "sc-talk-who", children: who }), through !== undefined && _jsx("span", { children: words.through(through) }), kind !== undefined && kind !== "tell" && (_jsx(Badge, { children: wordOf(words.signalKinds, kind) })), when(event)] }), event.data.unread === true && (_jsx("p", { className: "sc-talk-note-line sc-talk-unread", children: words.unread }))] }, event.n));
|
|
379
|
-
}
|
|
380
|
-
if (one.type === "said") {
|
|
381
|
-
return (_jsxs("li", { className: "sc-talk-item sc-talk-said", "data-n": event.n, children: [props.agent !== undefined && _jsx(Avatar, { person: props.agent, size: "sm" }), _jsxs("div", { className: "sc-talk-prose", children: [text(event, "sc-talk-text"), pictures(event)] }), when(event)] }, event.n));
|
|
382
|
-
}
|
|
383
|
-
if (one.type === "thought") {
|
|
384
|
-
return (_jsx("li", { className: "sc-talk-item sc-talk-step sc-talk-thought", "data-n": event.n, children: _jsxs("details", { className: "sc-talk-tool-fold", children: [_jsxs("summary", { className: "sc-talk-tool-head", children: [_jsx("span", { className: "sc-talk-kind", children: kinds.thinking }), _jsx("span", { className: "sc-talk-tool-line", children: firstLine(event.text) }), when(event)] }), _jsx("div", { className: "sc-talk-tool-body", children: text(event, "sc-talk-text") })] }) }, event.n));
|
|
385
|
-
}
|
|
386
|
-
// Where a turn ended: a line, with how long the agent was at it where the record says when it began.
|
|
387
|
-
if (event.kind === "status" && event.data.turn === "completed") {
|
|
388
|
-
const from = began.get(event.n);
|
|
389
|
-
const seconds = from === undefined
|
|
390
|
-
? undefined
|
|
391
|
-
: Math.max(0, Math.round((Date.parse(event.at) - Date.parse(from)) / 1000));
|
|
392
|
-
return (_jsx("li", { className: "sc-talk-item sc-talk-turn", "data-n": event.n, children: _jsxs("span", { className: "sc-talk-note-line", children: [words.turnDone(Number.isFinite(seconds) ? seconds : undefined), when(event)] }) }, event.n));
|
|
393
|
-
}
|
|
394
|
-
// A wake, a status, an error, and whatever a newer runner calls otherwise: a note between.
|
|
395
|
-
// What the note's own words say already, how a session ended, is not said twice as a fact.
|
|
396
|
-
const facts = Object.entries(event.data).filter(([name, fact]) => fact !== null && name !== "signal" && name !== "kind" && name !== "ended");
|
|
397
|
-
const lines = event.text.split("\n").filter((line) => line.trim().length > 0);
|
|
398
|
-
return (_jsxs("li", { className: cx("sc-talk-item", "sc-talk-note", event.kind === "error" && "sc-talk-note-error"), "data-n": event.n, children: [_jsxs("span", { className: "sc-talk-note-line", children: [_jsx("span", { className: "sc-talk-kind", children: kinds[event.kind] ?? event.kind }), facts.map(([name, fact]) => (_jsxs("span", { className: "sc-talk-fact", children: [wordOf(words.facts, name), " ", String(fact)] }, name))), lines.length === 1 && _jsx("span", { children: lines[0] }), when(event)] }), lines.length > 1 && text(event, "sc-talk-text sc-talk-text-note"), pictures(event)] }, event.n));
|
|
399
|
-
};
|
|
400
|
-
return (_jsxs(_Fragment, { children: [_jsxs("ol", { className: "sc-talk", "aria-label": words.transcript, children: [talkOf(props.events).map(item), props.foot] }), _jsx(Lightbox, { picture: shown.shown, onClose: shown.close })] }));
|
|
519
|
+
}, [of]);
|
|
520
|
+
const reads = props.onReadWhole !== undefined;
|
|
521
|
+
const hasSignalFiles = props.signalFileHref !== undefined;
|
|
522
|
+
const openPicture = shown.open;
|
|
523
|
+
const hands = useMemo(() => ({
|
|
524
|
+
fileHref: (fileId) => given.current.fileHref(fileId),
|
|
525
|
+
signalFileHref: hasSignalFiles
|
|
526
|
+
? (number, fileId) => given.current.signalFileHref?.(number, fileId) ?? ""
|
|
527
|
+
: undefined,
|
|
528
|
+
readWhole: reads ? readWhole : undefined,
|
|
529
|
+
openPicture,
|
|
530
|
+
}), [hasSignalFiles, reads, readWhole, openPicture]);
|
|
531
|
+
const events = props.events;
|
|
532
|
+
const items = useMemo(() => talkOf(events), [events]);
|
|
533
|
+
const began = useMemo(() => turnStarts(events), [events]);
|
|
534
|
+
if (events.length === 0) {
|
|
535
|
+
return (_jsxs(_Fragment, { children: [props.empty ?? null, props.foot !== undefined && props.foot !== null && (_jsx("ol", { className: "sc-talk", "aria-label": words.transcript, children: props.foot }))] }));
|
|
536
|
+
}
|
|
537
|
+
const lines = talkLinesOf({
|
|
538
|
+
items,
|
|
539
|
+
hands,
|
|
540
|
+
agent: props.agent,
|
|
541
|
+
began,
|
|
542
|
+
signalFiles: props.signalFiles,
|
|
543
|
+
whole,
|
|
544
|
+
of,
|
|
545
|
+
reading: reading !== undefined && reading.of === of ? reading.n : undefined,
|
|
546
|
+
today: today(),
|
|
547
|
+
});
|
|
548
|
+
return (_jsxs(_Fragment, { children: [_jsxs("ol", { className: "sc-talk", "aria-label": words.transcript, children: [lines.map(({ key, ...line }) => (_jsx(TalkLine, { ...line }, key))), props.foot] }), _jsx(Lightbox, { picture: shown.shown, onClose: shown.close })] }));
|
|
401
549
|
}
|
|
402
550
|
/**
|
|
403
551
|
* What supervisors said and the agent has not taken yet, at the foot of the conversation: each
|