@cueloop/client 0.1.0-alpha.7 → 0.1.0-alpha.70
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/native/build-pty.sh +51 -0
- package/native/build.sh +82 -0
- package/native/darwin-arm64/libcuelooppty.dylib +0 -0
- package/native/darwin-arm64/libcueloopvt.dylib +0 -0
- package/native/src/pty.zig +193 -0
- package/native/src/shim.zig +114 -0
- package/package.json +39 -32
- package/src/App.appearance.test.tsx +53 -0
- package/src/App.autoclose.test.tsx +76 -50
- package/src/App.diff.test.tsx +156 -42
- package/src/App.export.test.tsx +58 -40
- package/src/App.plan-review.test.tsx +363 -0
- package/src/App.prototype-markdown.test.tsx +92 -0
- package/src/App.prototype.test.tsx +176 -0
- package/src/App.readonly.test.tsx +128 -67
- package/src/App.rendering.test.tsx +61 -35
- package/src/App.submit-confirm.test.tsx +191 -0
- package/src/App.test.tsx +310 -114
- package/src/App.toast.test.tsx +89 -0
- package/src/App.tsx +1039 -799
- package/src/App.walk.test.tsx +298 -0
- package/src/App.workbench.test.tsx +461 -0
- package/src/__snapshots__/view-plan.regression.test.ts.snap +100 -0
- package/src/annotation-palette.ts +61 -0
- package/src/app-key-state.ts +61 -0
- package/src/app-screens.tsx +432 -0
- package/src/app-view-model.ts +159 -0
- package/src/attribution.test.ts +31 -0
- package/src/attribution.ts +42 -0
- package/src/clipboard.test.ts +23 -0
- package/src/clipboard.ts +33 -0
- package/src/components/AnnotatableFileView.stories.tsx +42 -0
- package/src/components/AnnotatableFileView.test.tsx +102 -0
- package/src/components/AnnotatableFileView.tsx +126 -0
- package/src/components/AnnotationCards.stories.tsx +87 -0
- package/src/components/AnnotationCards.tsx +303 -0
- package/src/components/AppHeader.stories.tsx +50 -0
- package/src/components/AppHeader.tsx +83 -0
- package/src/components/AppShell.stories.tsx +89 -0
- package/src/components/AppShell.tsx +286 -0
- package/src/components/AppShell.zoom.test.tsx +94 -0
- package/src/components/BareWorkbenchFileView.stories.tsx +27 -0
- package/src/components/BareWorkbenchFileView.tsx +64 -0
- package/src/components/Breadcrumb.stories.tsx +19 -0
- package/src/components/Breadcrumb.tsx +45 -0
- package/src/components/ChangesColumn.stories.tsx +39 -0
- package/src/components/ChangesColumn.tsx +171 -0
- package/src/components/CodeBlock.stories.tsx +42 -0
- package/src/components/CodeBlock.tsx +84 -0
- package/src/components/CompletionOverlay.stories.tsx +23 -0
- package/src/components/CompletionOverlay.tsx +60 -0
- package/src/components/ConfirmCard.stories.tsx +35 -0
- package/src/components/ConfirmCard.tsx +128 -0
- package/src/components/ConfirmDialog.stories.tsx +21 -0
- package/src/components/ConfirmDialog.tsx +66 -0
- package/src/components/DiffContentView.scroll.test.tsx +121 -0
- package/src/components/DiffContentView.split.test.tsx +140 -0
- package/src/components/DiffContentView.stories.tsx +80 -0
- package/src/components/DiffContentView.syntax.test.tsx +82 -0
- package/src/components/DiffContentView.tsx +859 -0
- package/src/components/DiscussionMarkerRail.stories.tsx +54 -0
- package/src/components/DiscussionMarkerRail.tsx +181 -0
- package/src/components/EditorGrid.stories.tsx +59 -0
- package/src/components/EditorGrid.tabs.test.tsx +118 -0
- package/src/components/EditorGrid.tsx +368 -0
- package/src/components/EditorGrid.zoom.test.tsx +68 -0
- package/src/components/FileContentsView.stories.tsx +16 -0
- package/src/components/FileContentsView.test.tsx +29 -0
- package/src/components/FileContentsView.tsx +98 -0
- package/src/components/KeybindsDialog.stories.tsx +31 -0
- package/src/components/KeybindsDialog.tsx +103 -0
- package/src/components/MenuBar.stories.tsx +28 -0
- package/src/components/MenuBar.tsx +44 -0
- package/src/components/OverlayScrollbar.stories.tsx +33 -0
- package/src/components/OverlayScrollbar.test.tsx +139 -0
- package/src/components/OverlayScrollbar.tsx +129 -0
- package/src/components/PaneGrid.stories.tsx +84 -0
- package/src/components/PaneGrid.tsx +128 -0
- package/src/components/PanelColumn.stories.tsx +25 -0
- package/src/components/PanelColumn.tsx +95 -0
- package/src/components/ProjectTreeView.stories.tsx +25 -0
- package/src/components/ProjectTreeView.test.tsx +32 -0
- package/src/components/ProjectTreeView.tsx +83 -0
- package/src/components/PromptDialog.stories.tsx +36 -0
- package/src/components/PromptDialog.tsx +87 -0
- package/src/components/PrototypeContentView.stories.tsx +19 -0
- package/src/components/PrototypeContentView.tsx +446 -0
- package/src/components/RootOverlay.stories.tsx +44 -0
- package/src/components/RootOverlay.tsx +35 -0
- package/src/components/ScrollArea.stories.tsx +20 -0
- package/src/components/ScrollArea.tsx +44 -0
- package/src/components/SettingsDialog.stories.tsx +117 -0
- package/src/components/SettingsDialog.tsx +195 -0
- package/src/components/SettingsRows.stories.tsx +18 -0
- package/src/components/SettingsRows.tsx +112 -0
- package/src/components/ShellHeader.stories.tsx +50 -0
- package/src/components/ShellHeader.tsx +137 -0
- package/src/components/ThreadFooter.stories.tsx +30 -0
- package/src/components/ThreadFooter.test.tsx +31 -0
- package/src/components/ThreadFooter.tsx +54 -0
- package/src/components/ThreadTree.stories.tsx +46 -0
- package/src/components/ThreadTree.tsx +219 -0
- package/src/components/ThreadView.selection.test.tsx +812 -0
- package/src/components/ThreadView.slash.test.tsx +158 -0
- package/src/components/ThreadView.stories.tsx +26 -0
- package/src/components/ThreadView.tsx +330 -0
- package/src/components/ThreadsSidebar.stories.tsx +36 -0
- package/src/components/ThreadsSidebar.tsx +71 -0
- package/src/components/Toast.stories.tsx +12 -0
- package/src/components/Toast.tsx +45 -0
- package/src/components/Tooltip.stories.tsx +26 -0
- package/src/components/Tooltip.tsx +72 -0
- package/src/components/TreePane.stories.tsx +106 -0
- package/src/components/TreePane.tsx +157 -0
- package/src/components/WalkWizard.stories.tsx +100 -0
- package/src/components/WalkWizard.tsx +152 -0
- package/src/components/WelcomePlayground.stories.tsx +12 -0
- package/src/components/WelcomePlayground.test.tsx +47 -0
- package/src/components/WelcomePlayground.tsx +140 -0
- package/src/components/__snapshots__/stories.test.tsx.snap +1845 -0
- package/src/components/agent-launcher.stories.tsx +26 -0
- package/src/components/agent-launcher.test.tsx +50 -0
- package/src/components/agent-launcher.tsx +149 -0
- package/src/components/diff-content-view-layout.test.ts +198 -0
- package/src/components/diff-content-view-layout.ts +84 -0
- package/src/components/editor-grid.test.ts +86 -0
- package/src/components/editor-grid.ts +138 -0
- package/src/components/fade-title.test.ts +49 -0
- package/src/components/fade-title.ts +61 -0
- package/src/components/file-tree.test.ts +60 -0
- package/src/components/file-tree.ts +112 -0
- package/src/components/pages/Workspace.stories.tsx +181 -0
- package/src/components/primitives/Button.stories.tsx +32 -0
- package/src/components/primitives/Button.tsx +52 -0
- package/src/components/primitives/Card.stories.tsx +25 -0
- package/src/components/primitives/Card.tsx +60 -0
- package/src/components/primitives/Dialog.stories.tsx +24 -0
- package/src/components/primitives/Dialog.tsx +66 -0
- package/src/components/primitives/IconButton.stories.tsx +36 -0
- package/src/components/primitives/IconButton.tsx +62 -0
- package/src/components/primitives/StatusBar.stories.tsx +11 -0
- package/src/components/primitives/StatusBar.tsx +23 -0
- package/src/components/primitives/Tabs.stories.tsx +29 -0
- package/src/components/primitives/Tabs.tsx +102 -0
- package/src/components/primitives/Toolbar.stories.tsx +17 -0
- package/src/components/primitives/Toolbar.tsx +14 -0
- package/src/components/primitives/Tree.stories.tsx +124 -0
- package/src/components/primitives/Tree.tsx +96 -0
- package/src/components/primitives/frame.test.ts +12 -0
- package/src/components/primitives/frame.ts +14 -0
- package/src/components/primitives/icons.ts +61 -0
- package/src/components/primitives/tree-model.test.ts +99 -0
- package/src/components/primitives/tree-model.ts +137 -0
- package/src/components/quick-actions-editor.stories.tsx +54 -0
- package/src/components/quick-actions-editor.test.tsx +49 -0
- package/src/components/quick-actions-editor.tsx +150 -0
- package/src/components/session-tree.test.ts +134 -0
- package/src/components/session-tree.ts +108 -0
- package/src/components/stories-app.tsx +184 -0
- package/src/components/stories.test.tsx +66 -0
- package/src/components/story-fixtures.ts +102 -0
- package/src/components/story-tree.test.ts +100 -0
- package/src/components/story.ts +142 -0
- package/src/components/syntax-highlight.ts +110 -0
- package/src/components/terminal-pane.test.tsx +40 -0
- package/src/components/terminal-pane.ts +199 -0
- package/src/components/theme-context.stories.tsx +46 -0
- package/src/components/theme-context.tsx +37 -0
- package/src/components/truncate-text.ts +7 -0
- package/src/config.test.ts +461 -31
- package/src/config.ts +389 -57
- package/src/diff-fold.test.ts +78 -0
- package/src/diff-fold.ts +126 -0
- package/src/diff-hunk-curate.test.ts +315 -0
- package/src/diff-hunk-curate.ts +153 -0
- package/src/diff-intraline.test.ts +165 -0
- package/src/diff-intraline.ts +146 -0
- package/src/diff-syntax.test.ts +112 -0
- package/src/diff-syntax.ts +179 -0
- package/src/discussions.ts +79 -0
- package/src/editor.test.ts +149 -0
- package/src/editor.ts +139 -9
- package/src/ghostty-terminal.test.ts +85 -0
- package/src/ghostty-terminal.ts +199 -0
- package/src/herdr.test.ts +9 -34
- package/src/herdr.ts +25 -21
- package/src/index.ts +11 -0
- package/src/integrations.test.ts +41 -0
- package/src/integrations.ts +32 -0
- package/src/intent-dispatch.test.ts +698 -0
- package/src/intent-dispatch.ts +700 -0
- package/src/key-bindings.test.ts +156 -0
- package/src/key-bindings.ts +465 -0
- package/src/keymap.test.ts +611 -0
- package/src/keymap.ts +410 -0
- package/src/kitty-image.test.ts +66 -0
- package/src/kitty-image.ts +138 -0
- package/src/mark-runs.ts +120 -0
- package/src/prototype-browser.test.ts +56 -0
- package/src/prototype-browser.ts +307 -0
- package/src/prototype-pixels.tsx +35 -0
- package/src/pty.test.ts +81 -0
- package/src/pty.ts +245 -0
- package/src/ready-signal.test.ts +85 -0
- package/src/ready-signal.ts +52 -0
- package/src/run.ts +30 -9
- package/src/serve.test.ts +24 -12
- package/src/serve.ts +20 -9
- package/src/share.ts +215 -0
- package/src/skills.test.ts +74 -0
- package/src/skills.ts +68 -0
- package/src/slash-palette.test.ts +54 -0
- package/src/slash-palette.ts +104 -0
- package/src/split-diff.test.ts +110 -0
- package/src/split-diff.ts +149 -0
- package/src/test-support.test.ts +264 -0
- package/src/test-support.ts +355 -0
- package/src/theme-presets.test.ts +51 -0
- package/src/theme-presets.ts +214 -0
- package/src/theme.ts +84 -19
- package/src/thread-chords.test.ts +170 -0
- package/src/thread-chords.ts +169 -0
- package/src/thread-controller.curate.test.ts +438 -0
- package/src/thread-controller.live-diff.test.ts +199 -0
- package/src/thread-controller.share.test.ts +472 -0
- package/src/thread-controller.tree.test.ts +255 -0
- package/src/thread-controller.ts +1509 -0
- package/src/thread-selection.test.ts +210 -0
- package/src/thread-selection.ts +243 -0
- package/src/tree-view.test.ts +128 -0
- package/src/tree-view.ts +148 -0
- package/src/use-annotation-surface.tsx +851 -0
- package/src/use-changes-workbench.ts +151 -0
- package/src/use-frame-measure.ts +38 -0
- package/src/use-settings-dialog.tsx +274 -0
- package/src/use-terminal-virtualizer.ts +233 -0
- package/src/version.ts +5 -0
- package/src/view-diff.test.ts +66 -9
- package/src/view-diff.ts +231 -23
- package/src/view-plan.regression.test.ts +60 -0
- package/src/view-plan.test.ts +406 -0
- package/src/view-plan.ts +570 -0
- package/src/walk.test.ts +121 -0
- package/src/walk.ts +74 -0
- package/src/syntax.test.ts +0 -41
- package/src/syntax.ts +0 -88
- package/src/view.test.ts +0 -157
- package/src/view.ts +0 -312
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
// The welcome page as a live annotation playground: the onboarding copy renders through the same
|
|
2
|
+
// diff sheet a file uses, so selecting text and typing leaves a comment with the identical gesture a
|
|
3
|
+
// real review uses. The notes are ephemeral - there is no file or thread behind onboarding copy, so
|
|
4
|
+
// they live only in this component's state and are never stored or re-anchored. The copy teaches the
|
|
5
|
+
// two first gestures: select-and-type to comment, and "/" for the quick actions and skills.
|
|
6
|
+
|
|
7
|
+
import React, { useMemo, useState } from "react";
|
|
8
|
+
import {
|
|
9
|
+
makeAnchor,
|
|
10
|
+
newAnnotationId,
|
|
11
|
+
SCHEMA_VERSION,
|
|
12
|
+
type Annotation,
|
|
13
|
+
type Thread,
|
|
14
|
+
} from "@cueloop/schema";
|
|
15
|
+
import type { Theme } from "../theme";
|
|
16
|
+
import type { QuickAction } from "../config";
|
|
17
|
+
import { DiffContentView } from "./DiffContentView";
|
|
18
|
+
import { diffRowBlocks, fileContentsRows, marksByRows } from "../view-diff";
|
|
19
|
+
|
|
20
|
+
export interface WelcomePlaygroundProps {
|
|
21
|
+
version: string;
|
|
22
|
+
quickActions: QuickAction[];
|
|
23
|
+
/** Reports whether the playground composer is open, so the shell suspends its inbox keys while typing. */
|
|
24
|
+
onComposingChange?: (composing: boolean) => void;
|
|
25
|
+
theme?: Theme;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const DOCS_URL = "https://cueloop.dev/docs/";
|
|
29
|
+
|
|
30
|
+
/** The playground copy: a heading, the two guided prompts, a line to practice on, and the links. */
|
|
31
|
+
function welcomeCopy(version: string): string {
|
|
32
|
+
return [
|
|
33
|
+
"Getting started",
|
|
34
|
+
"Comment on agent-authored work.",
|
|
35
|
+
"",
|
|
36
|
+
"This page is a playground. Nothing you write here is saved.",
|
|
37
|
+
"",
|
|
38
|
+
"Select the line below and start typing to leave your first comment:",
|
|
39
|
+
"",
|
|
40
|
+
" The quick brown fox jumps over the lazy dog.",
|
|
41
|
+
"",
|
|
42
|
+
'While composing, type "/" to see the quick actions and skills.',
|
|
43
|
+
"",
|
|
44
|
+
"Start",
|
|
45
|
+
" - select a thread",
|
|
46
|
+
" - inspect files and changes",
|
|
47
|
+
"",
|
|
48
|
+
"Learn",
|
|
49
|
+
` - docs ${DOCS_URL}`,
|
|
50
|
+
"",
|
|
51
|
+
"Version",
|
|
52
|
+
` - cueloop v${version}`,
|
|
53
|
+
].join("\n");
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/** An ephemeral thread that holds nothing but the playground's notes, so the surface groups
|
|
57
|
+
* discussions exactly as a real review does without any of it reaching the daemon. */
|
|
58
|
+
function playgroundThread(annotations: Annotation[]): Thread {
|
|
59
|
+
return {
|
|
60
|
+
schemaVersion: SCHEMA_VERSION,
|
|
61
|
+
id: "welcome",
|
|
62
|
+
workspace: { repoRoot: "", branch: "main" },
|
|
63
|
+
artifact: { type: "plan", content: "", meta: {} },
|
|
64
|
+
revisions: [],
|
|
65
|
+
annotations,
|
|
66
|
+
verdict: null,
|
|
67
|
+
status: "pending",
|
|
68
|
+
createdAt: "1970-01-01T00:00:00.000Z",
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export function WelcomePlayground(props: WelcomePlaygroundProps): React.ReactNode {
|
|
73
|
+
const [annotations, setAnnotations] = useState<Annotation[]>([]);
|
|
74
|
+
const rows = useMemo(
|
|
75
|
+
() => fileContentsRows("welcome", welcomeCopy(props.version)),
|
|
76
|
+
[props.version],
|
|
77
|
+
);
|
|
78
|
+
const session = playgroundThread(annotations);
|
|
79
|
+
|
|
80
|
+
return (
|
|
81
|
+
<DiffContentView
|
|
82
|
+
rows={rows}
|
|
83
|
+
session={session}
|
|
84
|
+
marks={marksByRows(annotations, rows)}
|
|
85
|
+
quickActions={props.quickActions}
|
|
86
|
+
observer={false}
|
|
87
|
+
commentsEnabled
|
|
88
|
+
fileView
|
|
89
|
+
onComposingChange={props.onComposingChange}
|
|
90
|
+
onAnnotate={(span, body) =>
|
|
91
|
+
setAnnotations((current) => [
|
|
92
|
+
...current,
|
|
93
|
+
{
|
|
94
|
+
id: newAnnotationId(),
|
|
95
|
+
kind: "comment",
|
|
96
|
+
anchor: makeAnchor(
|
|
97
|
+
diffRowBlocks(rows),
|
|
98
|
+
span.start.blockIndex,
|
|
99
|
+
span.start.char,
|
|
100
|
+
span.end.char,
|
|
101
|
+
span.end.blockIndex,
|
|
102
|
+
),
|
|
103
|
+
target: { kind: "welcome" },
|
|
104
|
+
body,
|
|
105
|
+
createdAt: new Date().toISOString(),
|
|
106
|
+
},
|
|
107
|
+
])
|
|
108
|
+
}
|
|
109
|
+
onReply={(rootAnnotationId, body) =>
|
|
110
|
+
setAnnotations((current) => {
|
|
111
|
+
const root = current.find((annotation) => annotation.id === rootAnnotationId);
|
|
112
|
+
|
|
113
|
+
if (!root) return current;
|
|
114
|
+
|
|
115
|
+
return [
|
|
116
|
+
...current,
|
|
117
|
+
{
|
|
118
|
+
id: newAnnotationId(),
|
|
119
|
+
kind: "comment",
|
|
120
|
+
anchor: root.anchor,
|
|
121
|
+
target: { kind: "welcome" },
|
|
122
|
+
body,
|
|
123
|
+
replyTo: rootAnnotationId,
|
|
124
|
+
createdAt: new Date().toISOString(),
|
|
125
|
+
},
|
|
126
|
+
];
|
|
127
|
+
})
|
|
128
|
+
}
|
|
129
|
+
onUpdateAnnotation={(id, body) =>
|
|
130
|
+
setAnnotations((current) =>
|
|
131
|
+
current.map((annotation) =>
|
|
132
|
+
annotation.id === id ? { ...annotation, body } : annotation,
|
|
133
|
+
),
|
|
134
|
+
)
|
|
135
|
+
}
|
|
136
|
+
onExit={() => {}}
|
|
137
|
+
theme={props.theme}
|
|
138
|
+
/>
|
|
139
|
+
);
|
|
140
|
+
}
|