@volter-ai-dev/supercode-ui 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +116 -0
- package/components.mjs +963 -0
- package/composer.mjs +168 -0
- package/controller.d.ts +53 -0
- package/controller.mjs +262 -0
- package/conversation.mjs +375 -0
- package/core.mjs +349 -0
- package/embed.mjs +972 -0
- package/index.d.ts +313 -0
- package/index.mjs +3 -0
- package/logo.mjs +114 -0
- package/messenger.mjs +947 -0
- package/package.json +106 -0
- package/sessions.mjs +196 -0
- package/styles.css +154 -0
package/README.md
ADDED
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
# `@volter-ai-dev/supercode-ui`
|
|
2
|
+
|
|
3
|
+
`supercode-ui` is the composable default interface for Supercode's glue workflows: inspect a
|
|
4
|
+
native coding-agent session, continue it safely, switch harnesses, answer requests, hand it to a
|
|
5
|
+
terminal, and export it back without hiding fidelity or residue.
|
|
6
|
+
|
|
7
|
+
It is deliberately separate from both the headless `supercode-client` and any embedding shell.
|
|
8
|
+
The package does not inject iframes, open sockets, read native session files, persist credentials,
|
|
9
|
+
or assume Lucarne. A host supplies bounded public state and receives typed intents. This lets a
|
|
10
|
+
browser widget, editor panel, desktop app, or ordinary page share one capability-honest UI.
|
|
11
|
+
|
|
12
|
+
## Storybook is the component contract
|
|
13
|
+
|
|
14
|
+
The package's complete development, documentation, and acceptance surface lives in Storybook:
|
|
15
|
+
|
|
16
|
+
```sh
|
|
17
|
+
npm run storybook --prefix sdk/ui
|
|
18
|
+
npm run build:storybook --prefix sdk/ui
|
|
19
|
+
npm run test:storybook --prefix sdk/ui
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Stories import the same built public artifacts that consumers install. They cover every canonical
|
|
23
|
+
harness identity, loading phase, transcript primitive, native request, tool lifecycle, long plan,
|
|
24
|
+
session inventory, composer/continuation state, receipt, narrow messenger layout, and modular
|
|
25
|
+
override seam. Chromium interaction and axe accessibility tests run every story in both light and
|
|
26
|
+
dark consumer themes. The static Storybook build is part of the repository SDK gate.
|
|
27
|
+
|
|
28
|
+
The older browser fixture remains a low-level embed smoke test; it is not a parallel design system.
|
|
29
|
+
New component behavior and hard-to-reach states belong in Storybook first.
|
|
30
|
+
|
|
31
|
+
## Use the whole messenger
|
|
32
|
+
|
|
33
|
+
```js
|
|
34
|
+
import { mountSupercodeMessenger } from '@volter-ai-dev/supercode-ui/embed';
|
|
35
|
+
import '@volter-ai-dev/supercode-ui/styles.css';
|
|
36
|
+
|
|
37
|
+
const mounted = mountSupercodeMessenger(document.querySelector('#agent'), {
|
|
38
|
+
state: initialState,
|
|
39
|
+
onIntent(intent) {
|
|
40
|
+
host.send(intent);
|
|
41
|
+
},
|
|
42
|
+
onClose() {
|
|
43
|
+
panel.close();
|
|
44
|
+
},
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
host.onState((state) => mounted.update(state));
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Take only the parts you need
|
|
51
|
+
|
|
52
|
+
```js
|
|
53
|
+
import {
|
|
54
|
+
Conversation,
|
|
55
|
+
SessionList,
|
|
56
|
+
} from '@volter-ai-dev/supercode-ui/preact';
|
|
57
|
+
import { HarnessLogo } from '@volter-ai-dev/supercode-ui/preact/logo';
|
|
58
|
+
import { groupConversation } from '@volter-ai-dev/supercode-ui/core';
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
The public components are `SupercodeMessenger`, `Conversation`, `TranscriptEntry`,
|
|
62
|
+
`ActivityGroup`, `RequestCard`, `SessionList`, `SessionRow`, `Composer`, `ContinuationBar`,
|
|
63
|
+
`LoadingStatus`, `TaskPlan`, `SessionDetails`, and `HarnessLogo`. Pure state readers, selectors,
|
|
64
|
+
formatters, and intent constructors live at `supercode-ui/core` and have no DOM or Preact imports.
|
|
65
|
+
For genuine partial delivery, the `preact/logo`, `preact/conversation`, `preact/sessions`,
|
|
66
|
+
`preact/composer`, and `preact/messenger` subpaths are independently tree-shaken artifacts; taking
|
|
67
|
+
the logo does not pull in Markdown, the messenger, or session-list code.
|
|
68
|
+
|
|
69
|
+
## Bind directly to the headless controller
|
|
70
|
+
|
|
71
|
+
Trusted desktop, editor, and Node hosts can avoid rewriting ordinary snapshot and action glue:
|
|
72
|
+
|
|
73
|
+
```js
|
|
74
|
+
import { createControllerBinding } from '@volter-ai-dev/supercode-ui/controller';
|
|
75
|
+
|
|
76
|
+
const binding = createControllerBinding(controller, {
|
|
77
|
+
onDraft: saveDraft,
|
|
78
|
+
onAcknowledge: clearAttention,
|
|
79
|
+
onArtifact: materializeArtifactInTrustedHost,
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
binding.subscribe((state) => mounted.update(state));
|
|
83
|
+
mounted.update(binding.getState());
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
The binding maps only standard controller operations. Host-owned pagination, durable attention,
|
|
87
|
+
drafts, artifact materialization, and future reduction receipts remain explicit callbacks. A
|
|
88
|
+
browser should receive projected state from a trusted host rather than instantiate a local
|
|
89
|
+
controller or gain filesystem authority.
|
|
90
|
+
|
|
91
|
+
## Modularity contract
|
|
92
|
+
|
|
93
|
+
- Every component accepts data and callbacks. No component reaches into a global controller.
|
|
94
|
+
- The complete messenger accepts `slots` for high-level replacement and `components` for row-level
|
|
95
|
+
replacement. Replacements receive the same typed, capability-filtered props as defaults.
|
|
96
|
+
- Stable `scui-*` classes and `data-*` attributes support additive styling; CSS custom properties
|
|
97
|
+
are the supported theme API.
|
|
98
|
+
- `styles.css` contains both neutral tokens and default component rules. Teams may load it whole,
|
|
99
|
+
override tokens, or omit it and style the stable markup themselves.
|
|
100
|
+
- Component state is local presentation state only (navigation, disclosure, search, drafts and
|
|
101
|
+
scroll position). Machine/session truth always arrives through `state`.
|
|
102
|
+
- Unknown harness marks are a contract error. `HarnessLogo` renders nothing and calls
|
|
103
|
+
`onMissingLogo`; it never invents initials that disguise an unsupported harness.
|
|
104
|
+
- Expensive transcript details are mounted only when disclosed. The host remains responsible for
|
|
105
|
+
bounding and paging transcript/session state.
|
|
106
|
+
|
|
107
|
+
## Host boundary
|
|
108
|
+
|
|
109
|
+
`SupercodeUiState` is a transport-safe view model, not a duplicate controller. A trusted host maps
|
|
110
|
+
`SupercodeController` snapshots and persisted inventory into it, then handles `SupercodeUiIntent`.
|
|
111
|
+
The browser cannot supply locators, credentials, policy, environment variables, or arbitrary
|
|
112
|
+
materialization paths. Session keys and target harnesses must be revalidated by the host.
|
|
113
|
+
|
|
114
|
+
An embedding product such as Vibewaiting should therefore be small: Lucarne owns its iframe and
|
|
115
|
+
launcher lifecycle, Supercode owns this UI and the controller semantics, and Vibewaiting only
|
|
116
|
+
bridges state/intents plus host-specific theme and persistence policy.
|