@zyro-sec/session-ui 0.0.0-stage → 1.0.4
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/AGENTS.md +25 -0
- package/bunfig.toml +2 -0
- package/component-tests/basic-tool.fixture.tsx +46 -0
- package/component-tests/basic-tool.spec.ts +63 -0
- package/component-tests/file-media.fixture.tsx +39 -0
- package/component-tests/file-media.spec.ts +13 -0
- package/component-tests/file-tool.spec.ts +62 -0
- package/component-tests/file-viewer.fixture.tsx +109 -0
- package/component-tests/file-viewer.spec.ts +134 -0
- package/component-tests/file.spec.ts +33 -0
- package/component-tests/line-comment-v2.spec.ts +15 -0
- package/component-tests/markdown-code-wrap.spec.ts +94 -0
- package/component-tests/markdown-readiness.spec.ts +95 -0
- package/component-tests/markdown.fixture.tsx +104 -0
- package/component-tests/markdown.spec.ts +1564 -0
- package/component-tests/mermaid-preview.spec.ts +43 -0
- package/component-tests/patch-group.spec.ts +79 -0
- package/component-tests/read-group.spec.ts +72 -0
- package/component-tests/read-image.fixture.tsx +66 -0
- package/component-tests/read-image.spec.ts +154 -0
- package/component-tests/session-compaction.spec.ts +254 -0
- package/component-tests/session-lifecycle.spec.ts +190 -0
- package/component-tests/session-message-projection.spec.ts +639 -0
- package/component-tests/session-notice-projection.spec.ts +20 -0
- package/component-tests/session-review-comments.spec.ts +179 -0
- package/component-tests/session-shell.spec.ts +93 -0
- package/component-tests/session-timeline-mobile.spec.ts +201 -0
- package/component-tests/session-timeline-notices.spec.ts +38 -0
- package/component-tests/session-timeline-reasoning.spec.ts +107 -0
- package/component-tests/session-timeline.spec.ts +157 -0
- package/component-tests/session-tool-projection.spec.ts +323 -0
- package/component-tests/text-lifecycle.fixture.tsx +26 -0
- package/component-tests/text-lifecycle.spec.ts +42 -0
- package/component-tests/timeline-subagent-rows.spec.ts +33 -0
- package/component-tests/tool-disclosure.spec.ts +48 -0
- package/component-tests/tool-group-sticky.spec.ts +37 -0
- package/component-tests/tool-group.spec.ts +290 -0
- package/component-tests/tool-status-title.fixture.tsx +22 -0
- package/component-tests/tool-status-title.spec.ts +30 -0
- package/component-tests/user-message-quotes.spec.ts +111 -0
- package/package.json +91 -4
- package/playwright.components.config.ts +4 -0
- package/playwright.local.config.ts +2 -0
- package/src/actions.ts +54 -0
- package/src/components/apply-patch-file.ts +122 -0
- package/src/components/basic-tool.css +487 -0
- package/src/components/basic-tool.tsx +258 -0
- package/src/components/copy-machine.ts +78 -0
- package/src/components/copy.ts +85 -0
- package/src/components/diagram-preview.tsx +28 -0
- package/src/components/disclosure-machine.ts +188 -0
- package/src/components/disclosure.ts +129 -0
- package/src/components/dock-prompt.stories.tsx +73 -0
- package/src/components/dock-prompt.tsx +29 -0
- package/src/components/file-comment-selection.tsx +146 -0
- package/src/components/file-media-machine.ts +165 -0
- package/src/components/file-media.stories.tsx +112 -0
- package/src/components/file-media.tsx +323 -0
- package/src/components/file-search.tsx +73 -0
- package/src/components/file.css +59 -0
- package/src/components/file.tsx +1300 -0
- package/src/components/image-preview.tsx +35 -0
- package/src/components/line-comment-annotations.tsx +580 -0
- package/src/components/line-comment-machine.ts +262 -0
- package/src/components/line-comment-styles.ts +293 -0
- package/src/components/line-comment.stories.tsx +152 -0
- package/src/components/line-comment.tsx +448 -0
- package/src/components/link-segments.ts +20 -0
- package/src/components/linked-text.tsx +21 -0
- package/src/components/markdown-cache-machine.ts +257 -0
- package/src/components/markdown-cache.tsx +556 -0
- package/src/components/markdown-clipboard.ts +101 -0
- package/src/components/markdown-code-machine.ts +200 -0
- package/src/components/markdown-code-state.ts +22 -0
- package/src/components/markdown-fragment-links.ts +74 -0
- package/src/components/markdown-github.svg +3 -0
- package/src/components/markdown-globe.svg +5 -0
- package/src/components/markdown-image-machine.ts +170 -0
- package/src/components/markdown-image.ts +156 -0
- package/src/components/markdown-inline-code-kind.ts +39 -0
- package/src/components/markdown-mermaid.ts +18 -0
- package/src/components/markdown-phase-machine.ts +102 -0
- package/src/components/markdown-projection.ts +13 -0
- package/src/components/markdown-session-links.ts +183 -0
- package/src/components/markdown-solid.test.tsx +92 -0
- package/src/components/markdown-solid.tsx +113 -0
- package/src/components/markdown-stream.ts +95 -0
- package/src/components/markdown-worker-machine.ts +516 -0
- package/src/components/markdown-worker-protocol.ts +73 -0
- package/src/components/markdown-worker.ts +250 -0
- package/src/components/markdown.css +672 -0
- package/src/components/markdown.stories.tsx +199 -0
- package/src/components/markdown.tsx +1612 -0
- package/src/components/markdown.worker.ts +188 -0
- package/src/components/message-file.ts +102 -0
- package/src/components/message-nav.css +134 -0
- package/src/components/message-nav.tsx +159 -0
- package/src/components/message-part.css +2109 -0
- package/src/components/message-part.tsx +3 -0
- package/src/components/question-prompt-experimental.css +576 -0
- package/src/components/question-prompt.css +527 -0
- package/src/components/quote-highlight.css +59 -0
- package/src/components/review-focus-driver.ts +142 -0
- package/src/components/review-focus-machine.ts +95 -0
- package/src/components/session-compaction.css +270 -0
- package/src/components/session-diff.ts +358 -0
- package/src/components/session-error.tsx +41 -0
- package/src/components/session-retry.tsx +92 -0
- package/src/components/session-review-machine.ts +241 -0
- package/src/components/session-review.css +264 -0
- package/src/components/session-review.stories.tsx +232 -0
- package/src/components/session-review.tsx +733 -0
- package/src/components/session-turn.css +282 -0
- package/src/components/shell-submessage.css +24 -0
- package/src/components/timeline-separator.tsx +69 -0
- package/src/components/tool-count-label.css +57 -0
- package/src/components/tool-count-label.tsx +76 -0
- package/src/components/tool-count-summary.css +102 -0
- package/src/components/tool-count-summary.stories.tsx +99 -0
- package/src/components/tool-count-summary.tsx +44 -0
- package/src/components/tool-error-card.css +178 -0
- package/src/components/tool-error-card.stories.tsx +113 -0
- package/src/components/tool-error-card.tsx +202 -0
- package/src/components/tool-status-title-machine.ts +128 -0
- package/src/components/tool-status-title.css +89 -0
- package/src/components/tool-status-title.tsx +163 -0
- package/src/context/data.tsx +107 -0
- package/src/context/index.ts +1 -0
- package/src/context/markdown.tsx +129 -0
- package/src/context/sources.tsx +34 -0
- package/src/document.ts +8 -0
- package/src/file-presentation.ts +34 -0
- package/src/message/action-machine.ts +72 -0
- package/src/message/agent-label.ts +3 -0
- package/src/message/attachment-card.css +119 -0
- package/src/message/attachment-card.tsx +40 -0
- package/src/message/attachment-media-machine.ts +213 -0
- package/src/message/comment-card.tsx +155 -0
- package/src/message/compaction-entrance-machine.ts +93 -0
- package/src/message/current-message.tsx +157 -0
- package/src/message/current-tool-state.ts +161 -0
- package/src/message/message-content.tsx +1391 -0
- package/src/message/paced-text-machine.ts +73 -0
- package/src/message/prompt-message.stories.tsx +149 -0
- package/src/message/relative-time.ts +45 -0
- package/src/message/user-message-quote-parts.ts +16 -0
- package/src/message/user-message-quotes.stories.tsx +797 -0
- package/src/message/user-message-quotes.tsx +135 -0
- package/src/pierre/comment-hover-machine.ts +53 -0
- package/src/pierre/comment-hover.ts +131 -0
- package/src/pierre/comment-selection-machine.ts +257 -0
- package/src/pierre/commented-lines.ts +106 -0
- package/src/pierre/diff-selection.ts +91 -0
- package/src/pierre/file-find-machine.ts +323 -0
- package/src/pierre/file-find.ts +537 -0
- package/src/pierre/file-runtime.ts +42 -0
- package/src/pierre/file-selection.ts +140 -0
- package/src/pierre/index.ts +344 -0
- package/src/pierre/media.ts +140 -0
- package/src/pierre/render-machine.ts +381 -0
- package/src/pierre/selection-bridge.ts +82 -0
- package/src/pierre/selection-machine.ts +198 -0
- package/src/pierre/virtualizer.ts +114 -0
- package/src/pierre/worker.ts +46 -0
- package/src/sources/experiment.ts +59 -0
- package/src/sources/site-icon.tsx +53 -0
- package/src/sources/sources-chip.tsx +57 -0
- package/src/sources/sources-expand-machine.ts +101 -0
- package/src/sources/sources-panel.tsx +249 -0
- package/src/sources/sources-title.tsx +21 -0
- package/src/sources/sources.css +266 -0
- package/src/sources/sources.ts +141 -0
- package/src/storybook/current-session-fixtures.ts +1492 -0
- package/src/storybook/current-session-scenarios.ts +76 -0
- package/src/storybook/current-session-story.tsx +154 -0
- package/src/storybook/index.ts +43 -0
- package/src/styles/index.css +19 -0
- package/src/timeline/__snapshots__/group-labels.test.ts.snap +110 -0
- package/src/timeline/__snapshots__/placement.test.ts.snap +1041 -0
- package/src/timeline/code-blocks.stories.tsx +105 -0
- package/src/timeline/commentary.stories.tsx +70 -0
- package/src/timeline/commentary.ts +38 -0
- package/src/timeline/detail.ts +111 -0
- package/src/timeline/error-card.stories.tsx +134 -0
- package/src/timeline/error-spacing.stories.tsx +71 -0
- package/src/timeline/facts.ts +493 -0
- package/src/timeline/file-changes.stories.tsx +436 -0
- package/src/timeline/group-label-fixtures.ts +97 -0
- package/src/timeline/mermaid.stories.tsx +131 -0
- package/src/timeline/place.ts +280 -0
- package/src/timeline/placement-fixtures.ts +365 -0
- package/src/timeline/placement-reactivity.ts +133 -0
- package/src/timeline/projection.ts +1261 -0
- package/src/timeline/research-and-agents.stories.tsx +461 -0
- package/src/timeline/session-timeline-row.tsx +1675 -0
- package/src/timeline/session-timeline.tsx +68 -0
- package/src/timeline/steer-arrival-machine.ts +134 -0
- package/src/timeline/terminal-work.stories.tsx +464 -0
- package/src/timeline/timeline-row.stories.tsx +1069 -0
- package/src/timeline/timeline-row.ts +238 -0
- package/src/timeline/turn-phase-machine.ts +112 -0
- package/src/timeline/user-message-fold.stories.tsx +194 -0
- package/src/timeline/user-runs.ts +87 -0
- package/src/timeline-next/__snapshots__/placement.test.ts.snap +990 -0
- package/src/timeline-next/compaction.tsx +236 -0
- package/src/timeline-next/errors.ts +101 -0
- package/src/timeline-next/event-row.tsx +168 -0
- package/src/timeline-next/events.ts +103 -0
- package/src/timeline-next/index.ts +10 -0
- package/src/timeline-next/nested-rail.ts +125 -0
- package/src/timeline-next/projection.ts +1028 -0
- package/src/timeline-next/row.tsx +1728 -0
- package/src/timeline-next/rules.ts +89 -0
- package/src/timeline-next/separator.tsx +73 -0
- package/src/timeline-next/spacing.ts +127 -0
- package/src/timeline-next/status-line.tsx +41 -0
- package/src/timeline-next/status.ts +33 -0
- package/src/timeline-next/stories/compare-renderer.stories.tsx +190 -0
- package/src/timeline-next/stories/compare-sessions/.gitignore +3 -0
- package/src/timeline-next/stories/compare.stories.tsx +486 -0
- package/src/timeline-next/stories/playground.stories.tsx +297 -0
- package/src/timeline-next/stories/session-replay.ts +1156 -0
- package/src/timeline-next/stories/session-timeline.tsx +50 -0
- package/src/timeline-next/stories/subagent-status.stories.tsx +132 -0
- package/src/timeline-next/timeline-next.css +649 -0
- package/src/timeline-next/tools/__snapshots__/activity-label.test.ts.snap +39 -0
- package/src/timeline-next/tools/activity-label.ts +166 -0
- package/src/timeline-next/tools/assistant-content.tsx +84 -0
- package/src/timeline-next/tools/context-group.tsx +619 -0
- package/src/timeline-next/tools/error-card.tsx +147 -0
- package/src/timeline-next/tools/explore.tsx +119 -0
- package/src/timeline-next/tools/file-group.tsx +128 -0
- package/src/timeline-next/tools/patch.tsx +174 -0
- package/src/timeline-next/tools/shell.tsx +186 -0
- package/src/timeline-next/tools/thought.tsx +87 -0
- package/src/timeline-next/tools/tool-display.tsx +119 -0
- package/src/tools/ansi.ts +8 -0
- package/src/tools/context-group-label.ts +123 -0
- package/src/tools/file-runs.ts +35 -0
- package/src/tools/project-path.ts +18 -0
- package/src/tools/read-group.stories.tsx +159 -0
- package/src/tools/run-machine.ts +185 -0
- package/src/tools/shell-output-machine.ts +233 -0
- package/src/tools/shell-output.ts +91 -0
- package/src/tools/subagent-row-variants.stories.tsx +129 -0
- package/src/tools/tool-group.stories.tsx +345 -0
- package/src/tools/tool-renderer.tsx +2876 -0
- package/src/v2/components/line-comment-annotations-v2.tsx +215 -0
- package/src/v2/components/session-file-panel-v2.tsx +149 -0
- package/src/v2/components/session-progress-indicator-v2.css +5 -0
- package/src/v2/components/session-progress-indicator-v2.stories.tsx +86 -0
- package/src/v2/components/session-progress-indicator-v2.tsx +16 -0
- package/src/v2/components/session-review-empty-changes-v2.tsx +17 -0
- package/src/v2/components/session-review-empty-no-git-v2.tsx +28 -0
- package/src/v2/components/session-review-file-preview-v2-virtualize.ts +5 -0
- package/src/v2/components/session-review-file-preview-v2.tsx +266 -0
- package/src/v2/components/session-review-v2.css +653 -0
- package/src/v2/components/session-review-v2.tsx +422 -0
- package/src/v2/components/sidebar-presence-machine.ts +69 -0
- package/tsconfig.json +20 -0
- package/README.md +0 -3
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import type { JsonValue, SessionMessageAssistant, SessionMessageAssistantTool } from "@zyro-sec/client/promise"
|
|
2
|
+
import type { SessionDocument } from "../document"
|
|
3
|
+
import { CURRENT_SESSION_ID, STORY_MODEL, STORY_TIME, thinkingDocument } from "./current-session-fixtures"
|
|
4
|
+
|
|
5
|
+
export function storyTool(
|
|
6
|
+
id: string,
|
|
7
|
+
name: string,
|
|
8
|
+
status: "streaming" | "running" | "completed" | "error",
|
|
9
|
+
input: Record<string, JsonValue>,
|
|
10
|
+
options: { metadata?: Record<string, JsonValue>; output?: string; error?: string; raw?: string } = {},
|
|
11
|
+
): SessionMessageAssistantTool {
|
|
12
|
+
const state =
|
|
13
|
+
status === "streaming"
|
|
14
|
+
? { status, input: options.raw ?? JSON.stringify(input) }
|
|
15
|
+
: status === "running"
|
|
16
|
+
? { status, input, metadata: { ...options.metadata, ...(options.output ? { output: options.output } : {}) } }
|
|
17
|
+
: status === "error"
|
|
18
|
+
? {
|
|
19
|
+
status,
|
|
20
|
+
input,
|
|
21
|
+
error: { type: "ToolExecutionError", message: options.error ?? `${name} failed visibly` },
|
|
22
|
+
metadata: options.metadata,
|
|
23
|
+
}
|
|
24
|
+
: {
|
|
25
|
+
status,
|
|
26
|
+
input,
|
|
27
|
+
content: [{ type: "text" as const, text: options.output ?? "Complete" }] as [
|
|
28
|
+
{ type: "text"; text: string },
|
|
29
|
+
],
|
|
30
|
+
metadata: options.metadata,
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
return {
|
|
34
|
+
type: "tool",
|
|
35
|
+
id,
|
|
36
|
+
name,
|
|
37
|
+
state,
|
|
38
|
+
time: {
|
|
39
|
+
created: STORY_TIME,
|
|
40
|
+
...(status === "streaming" ? {} : { ran: STORY_TIME + 100 }),
|
|
41
|
+
...(status === "completed" || status === "error" ? { completed: STORY_TIME + 200 } : {}),
|
|
42
|
+
},
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export function storyDocument(content: SessionMessageAssistant["content"], busy = false): SessionDocument {
|
|
47
|
+
return {
|
|
48
|
+
sessionID: CURRENT_SESSION_ID,
|
|
49
|
+
messages: [
|
|
50
|
+
...thinkingDocument.messages,
|
|
51
|
+
{
|
|
52
|
+
id: "msg_tool_projection_assistant",
|
|
53
|
+
type: "assistant",
|
|
54
|
+
agent: "build",
|
|
55
|
+
model: STORY_MODEL,
|
|
56
|
+
content,
|
|
57
|
+
time: { created: STORY_TIME, ...(busy ? {} : { completed: STORY_TIME + 300 }) },
|
|
58
|
+
},
|
|
59
|
+
],
|
|
60
|
+
status: { type: busy ? "busy" : "idle" },
|
|
61
|
+
diffs: [],
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export function storyPatchFile(file: string, status: "modified" | "added" = "modified") {
|
|
66
|
+
return {
|
|
67
|
+
file,
|
|
68
|
+
status,
|
|
69
|
+
patch:
|
|
70
|
+
status === "added"
|
|
71
|
+
? "@@ -0,0 +1 @@\n+export const after = true"
|
|
72
|
+
: "@@ -1 +1 @@\n-export const before = true\n+export const after = true",
|
|
73
|
+
additions: 1,
|
|
74
|
+
deletions: status === "added" ? 0 : 1,
|
|
75
|
+
}
|
|
76
|
+
}
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import type { SessionDocument } from "../document"
|
|
2
|
+
import { File } from "../components/file"
|
|
3
|
+
import { DataProvider, type ReadMediaUrlFn, type TurnDiffSource } from "../context/data"
|
|
4
|
+
import type { SessionUserActions } from "../message/current-message"
|
|
5
|
+
import type { SessionUserPresentation } from "../timeline/session-timeline"
|
|
6
|
+
import { SessionTimeline } from "../timeline/session-timeline"
|
|
7
|
+
import { FileComponentProvider } from "@zyro-sec/ui/context/file"
|
|
8
|
+
import { Button } from "@zyro-sec/ui/button"
|
|
9
|
+
import { Show, createMemo, createSignal, type JSX } from "solid-js"
|
|
10
|
+
import { CURRENT_SESSION_ID, STORY_TIME } from "./current-session-fixtures"
|
|
11
|
+
|
|
12
|
+
export function CurrentSessionProviders(props: {
|
|
13
|
+
document: SessionDocument
|
|
14
|
+
readMedia?: ReadMediaUrlFn
|
|
15
|
+
turnDiff?: TurnDiffSource
|
|
16
|
+
children: JSX.Element
|
|
17
|
+
}) {
|
|
18
|
+
return (
|
|
19
|
+
<DataProvider
|
|
20
|
+
directory="C:/workspaces/opencode"
|
|
21
|
+
sessionID={props.document.sessionID}
|
|
22
|
+
readMedia={props.readMedia}
|
|
23
|
+
data={{
|
|
24
|
+
agent: [
|
|
25
|
+
{ name: "build", color: "blue" },
|
|
26
|
+
{ name: "review", color: "purple" },
|
|
27
|
+
{ name: "test", color: "green" },
|
|
28
|
+
],
|
|
29
|
+
provider: {
|
|
30
|
+
all: new Map<string, { models: Record<string, { name: string }> }>([
|
|
31
|
+
[
|
|
32
|
+
"anthropic",
|
|
33
|
+
{
|
|
34
|
+
models: {
|
|
35
|
+
"claude-sonnet-4": { name: "Claude Sonnet 4" },
|
|
36
|
+
"claude-opus-5-5": { name: "Claude Opus 5.5" },
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
],
|
|
40
|
+
[
|
|
41
|
+
"company-gateway",
|
|
42
|
+
{
|
|
43
|
+
models: {
|
|
44
|
+
"fast-nano": { name: "GPT-5.4 nano" },
|
|
45
|
+
"long-context": { name: "Company Gateway Extra Long Context Model for Narrow Timeline Layouts" },
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
],
|
|
49
|
+
]),
|
|
50
|
+
connected: ["anthropic", "company-gateway"],
|
|
51
|
+
default: { anthropic: "claude-sonnet-4" },
|
|
52
|
+
},
|
|
53
|
+
session: [
|
|
54
|
+
{
|
|
55
|
+
id: CURRENT_SESSION_ID,
|
|
56
|
+
title: "Current Session UI",
|
|
57
|
+
time: { created: STORY_TIME, updated: STORY_TIME + 300_000 },
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
id: "session_child_review",
|
|
61
|
+
parentID: CURRENT_SESSION_ID,
|
|
62
|
+
title: "Review current Session fixtures",
|
|
63
|
+
time: { created: STORY_TIME + 71_000, updated: STORY_TIME + 72_000 },
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
id: "session_child_tests",
|
|
67
|
+
parentID: CURRENT_SESSION_ID,
|
|
68
|
+
title: "Check the Storybook scenarios",
|
|
69
|
+
time: { created: STORY_TIME + 73_000, updated: STORY_TIME + 74_000 },
|
|
70
|
+
},
|
|
71
|
+
],
|
|
72
|
+
session_status: {
|
|
73
|
+
[CURRENT_SESSION_ID]: props.document.status,
|
|
74
|
+
session_child_review: { type: "idle" },
|
|
75
|
+
session_child_tests: { type: "busy" },
|
|
76
|
+
},
|
|
77
|
+
session_diff: { [CURRENT_SESSION_ID]: props.document.diffs },
|
|
78
|
+
}}
|
|
79
|
+
turnDiff={props.turnDiff ?? { state: () => ({ status: "ready", diffs: props.document.diffs }), load: () => {} }}
|
|
80
|
+
>
|
|
81
|
+
<FileComponentProvider component={File}>{props.children}</FileComponentProvider>
|
|
82
|
+
</DataProvider>
|
|
83
|
+
)
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export function CurrentSessionTimelineStory(props: {
|
|
87
|
+
title: string
|
|
88
|
+
description: string
|
|
89
|
+
document: SessionDocument
|
|
90
|
+
presentation?: Record<string, SessionUserPresentation | undefined>
|
|
91
|
+
width?: string
|
|
92
|
+
shellToolDefaultOpen?: boolean
|
|
93
|
+
editToolDefaultOpen?: boolean
|
|
94
|
+
turnDiffs?: boolean
|
|
95
|
+
turnDiff?: TurnDiffSource
|
|
96
|
+
readMedia?: ReadMediaUrlFn
|
|
97
|
+
}) {
|
|
98
|
+
// Inline story documents rebuild their messages on every prop read, and the timeline projection keys text by identity.
|
|
99
|
+
const document = createMemo(() => props.document)
|
|
100
|
+
const [revision, setRevision] = createSignal(1)
|
|
101
|
+
const [activity, setActivity] = createSignal("No local action")
|
|
102
|
+
|
|
103
|
+
const actions = {
|
|
104
|
+
openAttachment: (file) => {
|
|
105
|
+
setActivity(`Opened ${file.name ?? file.mime}`)
|
|
106
|
+
},
|
|
107
|
+
revert: (input) => {
|
|
108
|
+
setActivity(`Reverted to ${input.messageID}`)
|
|
109
|
+
},
|
|
110
|
+
fork: (input) => {
|
|
111
|
+
setActivity(`Forked from ${input.messageID}`)
|
|
112
|
+
},
|
|
113
|
+
} satisfies SessionUserActions
|
|
114
|
+
|
|
115
|
+
const reset = () => {
|
|
116
|
+
setActivity("No local action")
|
|
117
|
+
setRevision((value) => value + 1)
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
return (
|
|
121
|
+
<section class="mx-auto flex w-full flex-col gap-4 p-6" style={{ "max-width": props.width ?? "840px" }}>
|
|
122
|
+
<header class="flex items-start justify-between gap-4 border-b border-border-weak-base pb-3">
|
|
123
|
+
<div class="min-w-0">
|
|
124
|
+
<h1 class="text-16-medium text-text-strong">{props.title}</h1>
|
|
125
|
+
<p class="mt-1 text-13-regular text-text-weak">{props.description}</p>
|
|
126
|
+
</div>
|
|
127
|
+
<Button size="small" variant="neutral" onClick={reset}>
|
|
128
|
+
Reset
|
|
129
|
+
</Button>
|
|
130
|
+
</header>
|
|
131
|
+
<div class="min-h-24 overflow-hidden rounded-lg border border-border-weak-base bg-background-base py-4">
|
|
132
|
+
<Show when={revision()} keyed>
|
|
133
|
+
{(revision) => (
|
|
134
|
+
<div data-story-revision={revision}>
|
|
135
|
+
<CurrentSessionProviders document={document()} readMedia={props.readMedia} turnDiff={props.turnDiff}>
|
|
136
|
+
<SessionTimeline
|
|
137
|
+
document={document()}
|
|
138
|
+
presentation={props.presentation}
|
|
139
|
+
actions={actions}
|
|
140
|
+
shellToolDefaultOpen={props.shellToolDefaultOpen}
|
|
141
|
+
editToolDefaultOpen={props.editToolDefaultOpen}
|
|
142
|
+
turnDiffs={props.turnDiffs}
|
|
143
|
+
// Stories show the timeline as local and dev builds do.
|
|
144
|
+
inlineQuotes
|
|
145
|
+
/>
|
|
146
|
+
</CurrentSessionProviders>
|
|
147
|
+
</div>
|
|
148
|
+
)}
|
|
149
|
+
</Show>
|
|
150
|
+
</div>
|
|
151
|
+
<output class="text-12-regular text-text-weak">Story action: {activity()}</output>
|
|
152
|
+
</section>
|
|
153
|
+
)
|
|
154
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export {
|
|
2
|
+
CURRENT_SESSION_ID,
|
|
3
|
+
STORY_MODEL,
|
|
4
|
+
STORY_TIME,
|
|
5
|
+
activePermissionRequest,
|
|
6
|
+
activeQuestionRequest,
|
|
7
|
+
attachmentsAndCommentsDocument,
|
|
8
|
+
attachmentsAndCommentsPresentation,
|
|
9
|
+
compactionCancelledDocument,
|
|
10
|
+
compactionDocument,
|
|
11
|
+
compactionFailedDocument,
|
|
12
|
+
compactionRunningDocument,
|
|
13
|
+
editThenTestDocument,
|
|
14
|
+
emptySessionDocument,
|
|
15
|
+
fileChangeLoadingDocument,
|
|
16
|
+
fileChangeRunningDocument,
|
|
17
|
+
inspectAndExplainDocument,
|
|
18
|
+
largeCompletedDocument,
|
|
19
|
+
multiFilePatchDocument,
|
|
20
|
+
pendingAndQueuedDocument,
|
|
21
|
+
permissionPendingDocument,
|
|
22
|
+
questionPendingDocument,
|
|
23
|
+
queuedPrompts,
|
|
24
|
+
recoveryDocument,
|
|
25
|
+
requestHistoryDocument,
|
|
26
|
+
retryDocument,
|
|
27
|
+
revertDocument,
|
|
28
|
+
reviewDiffs,
|
|
29
|
+
loadedResourcesDocument,
|
|
30
|
+
standaloneShellCompletedDocument,
|
|
31
|
+
standaloneShellRunningDocument,
|
|
32
|
+
streamingDocument,
|
|
33
|
+
subagentDocument,
|
|
34
|
+
subagentReport,
|
|
35
|
+
terminalFailedDocument,
|
|
36
|
+
terminalPassedDocument,
|
|
37
|
+
terminalRunningDocument,
|
|
38
|
+
thinkingDocument,
|
|
39
|
+
webResearchDocument,
|
|
40
|
+
writeFileDocument,
|
|
41
|
+
} from "./current-session-fixtures"
|
|
42
|
+
|
|
43
|
+
export { CurrentSessionProviders, CurrentSessionTimelineStory } from "./current-session-story"
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
@layer theme, base, components, utilities;
|
|
2
|
+
|
|
3
|
+
@import "../components/basic-tool.css" layer(components);
|
|
4
|
+
@import "../components/file.css" layer(components);
|
|
5
|
+
@import "../components/markdown.css" layer(components);
|
|
6
|
+
@import "../components/message-part.css" layer(components);
|
|
7
|
+
@import "../components/message-nav.css" layer(components);
|
|
8
|
+
@import "../components/question-prompt.css" layer(components);
|
|
9
|
+
@import "../components/question-prompt-experimental.css" layer(components);
|
|
10
|
+
@import "../components/quote-highlight.css" layer(components);
|
|
11
|
+
@import "../components/session-review.css" layer(components);
|
|
12
|
+
@import "../components/session-compaction.css" layer(components);
|
|
13
|
+
@import "../components/session-turn.css" layer(components);
|
|
14
|
+
@import "../components/shell-submessage.css" layer(components);
|
|
15
|
+
@import "../components/tool-count-label.css" layer(components);
|
|
16
|
+
@import "../components/tool-count-summary.css" layer(components);
|
|
17
|
+
@import "../components/tool-error-card.css" layer(components);
|
|
18
|
+
@import "../timeline-next/timeline-next.css" layer(components);
|
|
19
|
+
@import "../components/tool-status-title.css" layer(components);
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
// Bun Snapshot v1, https://bun.sh/docs/test/snapshots
|
|
2
|
+
|
|
3
|
+
exports[`group labels the current timeline names a group by the tools it used 1`] = `
|
|
4
|
+
{
|
|
5
|
+
"background outcomes only": {
|
|
6
|
+
"after": "",
|
|
7
|
+
"before": "Updates",
|
|
8
|
+
"between": "",
|
|
9
|
+
"count": undefined,
|
|
10
|
+
"text": "Updates",
|
|
11
|
+
"title": "",
|
|
12
|
+
},
|
|
13
|
+
"edits": {
|
|
14
|
+
"after": "",
|
|
15
|
+
"before": "Used",
|
|
16
|
+
"between": "",
|
|
17
|
+
"count": 4,
|
|
18
|
+
"text": "Used 4 Edit, Write, Patch, Read",
|
|
19
|
+
"title": "Edit, Write, Patch, Read",
|
|
20
|
+
},
|
|
21
|
+
"empty": {
|
|
22
|
+
"after": "",
|
|
23
|
+
"before": "Updates",
|
|
24
|
+
"between": "",
|
|
25
|
+
"count": undefined,
|
|
26
|
+
"text": "Updates",
|
|
27
|
+
"title": "",
|
|
28
|
+
},
|
|
29
|
+
"failed calls": {
|
|
30
|
+
"after": "",
|
|
31
|
+
"before": "Used",
|
|
32
|
+
"between": "",
|
|
33
|
+
"count": 3,
|
|
34
|
+
"text": "Used 3 Read, Shell, Edit",
|
|
35
|
+
"title": "Read, Shell, Edit",
|
|
36
|
+
},
|
|
37
|
+
"mixed tools": {
|
|
38
|
+
"after": "",
|
|
39
|
+
"before": "Used",
|
|
40
|
+
"between": "",
|
|
41
|
+
"count": 6,
|
|
42
|
+
"text": "Used 6 Questions, Browser, custom_tool, Shell, Read",
|
|
43
|
+
"title": "Questions, Browser, custom_tool, Shell, Read",
|
|
44
|
+
},
|
|
45
|
+
"one edit": {
|
|
46
|
+
"after": "",
|
|
47
|
+
"before": "Used",
|
|
48
|
+
"between": "",
|
|
49
|
+
"count": 1,
|
|
50
|
+
"text": "Used 1 Edit",
|
|
51
|
+
"title": "Edit",
|
|
52
|
+
},
|
|
53
|
+
"reads and searches": {
|
|
54
|
+
"after": "",
|
|
55
|
+
"before": "Used",
|
|
56
|
+
"between": "",
|
|
57
|
+
"count": 7,
|
|
58
|
+
"text": "Used 7 Read, Grep, Glob, Webfetch, Web Search",
|
|
59
|
+
"title": "Read, Grep, Glob, Webfetch, Web Search",
|
|
60
|
+
},
|
|
61
|
+
"shells with background outcomes": {
|
|
62
|
+
"after": "",
|
|
63
|
+
"before": "Used",
|
|
64
|
+
"between": "",
|
|
65
|
+
"count": 3,
|
|
66
|
+
"text": "Used 3 Shell",
|
|
67
|
+
"title": "Shell",
|
|
68
|
+
},
|
|
69
|
+
"skills": {
|
|
70
|
+
"after": "",
|
|
71
|
+
"before": "Used",
|
|
72
|
+
"between": "",
|
|
73
|
+
"count": 2,
|
|
74
|
+
"text": "Used 2 Skill",
|
|
75
|
+
"title": "Skill",
|
|
76
|
+
},
|
|
77
|
+
"still running": {
|
|
78
|
+
"after": "",
|
|
79
|
+
"before": "Used",
|
|
80
|
+
"between": "",
|
|
81
|
+
"count": 2,
|
|
82
|
+
"text": "Used 2 Read, Shell",
|
|
83
|
+
"title": "Read, Shell",
|
|
84
|
+
},
|
|
85
|
+
"thoughts": {
|
|
86
|
+
"after": "",
|
|
87
|
+
"before": "Used",
|
|
88
|
+
"between": "",
|
|
89
|
+
"count": 2,
|
|
90
|
+
"text": "Used 2 Thoughts",
|
|
91
|
+
"title": "Thoughts",
|
|
92
|
+
},
|
|
93
|
+
"thoughts and tools": {
|
|
94
|
+
"after": "",
|
|
95
|
+
"before": "Used",
|
|
96
|
+
"between": "",
|
|
97
|
+
"count": 1,
|
|
98
|
+
"text": "Used 1 Read",
|
|
99
|
+
"title": "Read",
|
|
100
|
+
},
|
|
101
|
+
"v1 tool names": {
|
|
102
|
+
"after": "",
|
|
103
|
+
"before": "Used",
|
|
104
|
+
"between": "",
|
|
105
|
+
"count": 3,
|
|
106
|
+
"text": "Used 3 bash, task, apply_patch",
|
|
107
|
+
"title": "bash, task, apply_patch",
|
|
108
|
+
},
|
|
109
|
+
}
|
|
110
|
+
`;
|