moi-computer 0.11.1-next.0 → 0.11.1-next.2
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/client/AGENTS.md +2 -2
- package/client/components/ui/button.tsx +1 -53
- package/client/components/ui/collapsible.tsx +1 -15
- package/client/components/ui/dialog.tsx +1 -58
- package/client/components/ui/dropdown-menu.tsx +1 -254
- package/client/components/ui/hover-card.tsx +1 -44
- package/client/components/ui/input.tsx +1 -21
- package/client/components/ui/popover.tsx +1 -88
- package/client/components/ui/resizable.tsx +1 -40
- package/client/components/ui/skeleton.tsx +1 -13
- package/client/components/ui/slider.tsx +1 -70
- package/client/components/ui/spinner.tsx +1 -18
- package/client/components/ui/switch.tsx +1 -23
- package/client/components/ui/tabs.tsx +1 -0
- package/client/components/ui/textarea.tsx +1 -18
- package/client/components/ui/tooltip.tsx +1 -51
- package/client/features/chat/ChatPanel.tsx +6 -6
- package/client/features/chat/ChatPopup.tsx +3 -4
- package/client/features/chat/TurnView.tsx +5 -4
- package/client/features/chat/api.ts +5 -14
- package/client/features/chat/chat-frames.ts +9 -7
- package/client/features/chat/chat-send.ts +13 -2
- package/client/features/chat/chat-store.ts +1 -3
- package/client/features/chat/composer/ChatComposer.tsx +5 -1
- package/client/features/chat/composer/ModelPicker.tsx +44 -44
- package/client/features/chat/composer/banners/ErrorBanner.tsx +20 -12
- package/client/features/chat/composer/model-order.ts +15 -0
- package/client/features/chat/composer/useWorkspaceComposerState.tsx +15 -7
- package/client/features/chat/group-turns.ts +12 -0
- package/client/features/chat/interleave-notices.ts +7 -11
- package/client/features/chat/session-view.ts +53 -0
- package/client/features/chat/tool-group/ToolCallGroup.tsx +1 -4
- package/client/features/chat/tool-group/format/codex.ts +4 -1
- package/client/features/chat/useChat.ts +10 -9
- package/client/features/dev/ChatStatesPage.tsx +3 -1
- package/client/features/dev/DevIndexPage.tsx +5 -0
- package/client/features/dev/DevRoutes.tsx +2 -0
- package/client/features/dev/HarnessDebugPage.tsx +1 -1
- package/client/features/dev/UiComponentPreviews.tsx +834 -0
- package/client/features/dev/UiComponentsPage.tsx +60 -0
- package/client/features/home/WorkspacePreview.tsx +1 -1
- package/client/features/home/workspace-setup/DemoDialog.tsx +3 -2
- package/client/features/home/workspace-setup/ImportWorkspaceDialog.tsx +5 -8
- package/client/features/home/workspace-setup/WorkspaceDialogContent.tsx +7 -20
- package/client/features/settings/SettingsLayout.tsx +1 -1
- package/client/features/settings/WorkspaceSettings.tsx +4 -1
- package/client/features/views/ViewManager.tsx +14 -9
- package/client/features/widgets/WidgetFrame.tsx +1 -1
- package/client/features/widgets/Widgets.tsx +1 -3
- package/client/features/workspace/WorkspaceScreen.tsx +5 -1
- package/client/features/workspace/WorkspaceSplitLayout.tsx +6 -1
- package/client/features/workspace/api.ts +2 -4
- package/client/index.css +22 -29
- package/dist/chunk-245wt82v.css +1 -0
- package/dist/{chunk-tny85yt2.js → chunk-4s15axjs.js} +2 -2
- package/dist/{chunk-c9pjqx9m.js → chunk-53a7pxcz.js} +1 -1
- package/dist/{chunk-104m57qw.js → chunk-87thzbtw.js} +2 -2
- package/dist/chunk-a6jad1a6.js +1 -0
- package/dist/chunk-dghwstd2.js +9 -0
- package/dist/chunk-eg120aca.js +1 -0
- package/dist/{chunk-v7wr1df4.js → chunk-j3wvxjr7.js} +1 -1
- package/dist/chunk-j7hh2ab4.js +70 -0
- package/dist/chunk-w482ew2c.js +546 -0
- package/dist/chunk-y8eyahwx.js +1 -0
- package/dist/index.html +1 -1
- package/lib/format.ts +55 -6
- package/lib/themes.ts +6 -6
- package/lib/types.ts +10 -9
- package/package.json +12 -5
- package/registry.json +643 -0
- package/server/agent.ts +1 -1
- package/server/api.ts +26 -30
- package/server/applets.ts +30 -29
- package/server/bundler/applet-css.ts +7 -107
- package/server/bundler/build-applet.ts +5 -1
- package/server/bundler/build-worker.ts +178 -0
- package/server/cli-ui-components.ts +28 -33
- package/server/cli.ts +6 -11
- package/server/data-dir.ts +1 -1
- package/server/harness/README.md +41 -48
- package/server/harness/acp/NOTES.md +426 -0
- package/server/harness/acp/discovery.ts +27 -30
- package/server/harness/acp/model-state.ts +57 -0
- package/server/harness/acp/session.ts +18 -6
- package/server/harness/claude-code/NOTES.md +47 -12
- package/server/harness/claude-code/cli.ts +40 -0
- package/server/harness/claude-code/index.ts +11 -5
- package/server/harness/claude-code/models.ts +72 -19
- package/server/harness/claude-code/session.ts +408 -299
- package/server/harness/codex/NOTES.md +222 -350
- package/server/harness/codex/adapter.ts +94 -45
- package/server/harness/codex/auth.ts +1 -3
- package/server/harness/codex/client.ts +169 -249
- package/server/harness/codex/discovery.ts +9 -17
- package/server/harness/codex/index.ts +2 -1
- package/server/harness/codex/pagination.ts +24 -0
- package/server/harness/codex/permissions.ts +31 -7
- package/server/harness/codex/probe.ts +10 -13
- package/server/harness/codex/session.ts +549 -136
- package/server/harness/codex/transport.ts +184 -0
- package/server/harness/debug.ts +1 -1
- package/server/harness/hermes/NOTES.md +18 -0
- package/server/harness/hermes/discovery.ts +20 -0
- package/server/harness/hermes/index.ts +9 -0
- package/server/harness/hermes/models.ts +28 -8
- package/server/harness/types.ts +4 -2
- package/server/moi-scaffold.ts +1 -1
- package/server/preview.ts +3 -1
- package/server/registry.ts +63 -41
- package/server/tldraw-package.d.ts +4 -0
- package/server/ui-components.ts +101 -434
- package/server/view-builders.ts +2 -1
- package/server/web.ts +12 -5
- package/server/workspace-env.ts +3 -2
- package/tsconfig.json +0 -1
- package/ui-components/accordion.tsx +71 -0
- package/ui-components/alert-dialog.tsx +165 -0
- package/ui-components/alert.tsx +68 -0
- package/ui-components/attachment.tsx +195 -0
- package/ui-components/avatar.tsx +90 -0
- package/ui-components/badge.tsx +49 -0
- package/ui-components/button-group.tsx +78 -0
- package/ui-components/button.tsx +55 -0
- package/ui-components/calendar.tsx +180 -0
- package/ui-components/card.tsx +84 -0
- package/ui-components/carousel.tsx +235 -0
- package/ui-components/chart.tsx +338 -0
- package/ui-components/checkbox.tsx +28 -0
- package/ui-components/collapsible.tsx +15 -0
- package/ui-components/combobox.tsx +267 -0
- package/ui-components/context-menu.tsx +244 -0
- package/ui-components/dialog.tsx +138 -0
- package/ui-components/docs/accordion.md +463 -0
- package/ui-components/docs/alert-dialog.md +481 -0
- package/ui-components/docs/alert.md +301 -0
- package/ui-components/docs/attachment.md +689 -0
- package/ui-components/docs/avatar.md +495 -0
- package/ui-components/docs/badge.md +258 -0
- package/ui-components/docs/button-group.md +879 -0
- package/ui-components/docs/button.md +26 -0
- package/ui-components/docs/calendar.md +862 -0
- package/ui-components/docs/card.md +265 -0
- package/ui-components/docs/carousel.md +627 -0
- package/ui-components/docs/chart.md +1256 -0
- package/ui-components/docs/checkbox.md +477 -0
- package/ui-components/docs/collapsible.md +446 -0
- package/ui-components/docs/combobox.md +1003 -0
- package/ui-components/docs/context-menu.md +860 -0
- package/ui-components/docs/data-table.md +1580 -0
- package/ui-components/docs/date-picker.md +614 -0
- package/ui-components/docs/dialog.md +414 -0
- package/ui-components/docs/drawer.md +51 -0
- package/ui-components/docs/dropdown-menu.md +1000 -0
- package/ui-components/docs/field.md +1192 -0
- package/ui-components/docs/hover-card.md +275 -0
- package/ui-components/docs/input-group.md +866 -0
- package/ui-components/docs/input.md +456 -0
- package/ui-components/docs/label.md +295 -0
- package/ui-components/docs/pagination.md +416 -0
- package/ui-components/docs/popover.md +348 -0
- package/ui-components/docs/progress.md +214 -0
- package/ui-components/docs/radio-group.md +389 -0
- package/ui-components/docs/resizable.md +265 -0
- package/ui-components/docs/select.md +616 -0
- package/ui-components/docs/separator.md +216 -0
- package/ui-components/docs/skeleton.md +205 -0
- package/ui-components/docs/slider.md +226 -0
- package/ui-components/docs/spinner.md +332 -0
- package/ui-components/docs/switch.md +236 -0
- package/ui-components/docs/table.md +551 -0
- package/ui-components/docs/tabs.md +379 -0
- package/ui-components/docs/textarea.md +187 -0
- package/ui-components/docs/toggle-group.md +370 -0
- package/ui-components/docs/toggle.md +91 -0
- package/ui-components/docs/tooltip.md +290 -0
- package/ui-components/drawer.tsx +213 -0
- package/ui-components/dropdown-menu.tsx +263 -0
- package/ui-components/field.tsx +224 -0
- package/ui-components/hover-card.tsx +46 -0
- package/ui-components/input-group.tsx +146 -0
- package/ui-components/input.tsx +20 -0
- package/ui-components/label.tsx +17 -0
- package/ui-components/pagination.tsx +124 -0
- package/ui-components/popover.tsx +81 -0
- package/ui-components/progress.tsx +63 -0
- package/ui-components/radio-group.tsx +38 -0
- package/ui-components/resizable.tsx +40 -0
- package/ui-components/scoped-portal.tsx +31 -0
- package/ui-components/select.tsx +195 -0
- package/ui-components/separator.tsx +18 -0
- package/ui-components/skeleton.tsx +15 -0
- package/ui-components/slider.tsx +75 -0
- package/ui-components/spinner.tsx +20 -0
- package/ui-components/switch.tsx +27 -0
- package/ui-components/table.tsx +86 -0
- package/ui-components/tabs.tsx +75 -0
- package/ui-components/textarea.tsx +17 -0
- package/ui-components/toggle-group.tsx +85 -0
- package/ui-components/toggle.tsx +42 -0
- package/ui-components/tooltip.tsx +61 -0
- package/ui-components/utils.ts +8 -0
- package/workspace/.claude/skills/moi-workspace/SKILL.md +11 -20
- package/workspace/.claude/skills/moi-workspace/references/DESIGN.md +4 -3
- package/workspace/.claude/skills/moi-workspace/references/UI-COMPONENTS.md +67 -203
- package/dist/chunk-59zf0m6n.js +0 -1
- package/dist/chunk-bj3akjs2.js +0 -1
- package/dist/chunk-j2w2vak4.js +0 -546
- package/dist/chunk-k2r9c95m.js +0 -10
- package/dist/chunk-kmbxhgwv.js +0 -1
- package/dist/chunk-p1yqa71k.js +0 -83
- package/dist/chunk-r5xrenjy.css +0 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// CLI face of `moi ui-components` (see server/ui-components.ts for the
|
|
2
|
-
// engine and docs/
|
|
2
|
+
// engine and docs/ui-components.md for the spec). Three verbs:
|
|
3
3
|
//
|
|
4
4
|
// moi ui-components → the curated catalog + installed state
|
|
5
|
-
// moi ui-components add <name…> →
|
|
6
|
-
// moi ui-components docs <name…> →
|
|
5
|
+
// moi ui-components add <name…> → copy registry components to .moi/ui/
|
|
6
|
+
// moi ui-components docs <name…> → component docs as markdown, on stdout
|
|
7
7
|
//
|
|
8
8
|
// The command is deliberately not smart: add never rebuilds and never edits
|
|
9
9
|
// existing files, and installs dependencies only when asked to (--install) —
|
|
@@ -17,15 +17,16 @@ import pc from './cli-pc'
|
|
|
17
17
|
import { resolveCwdWorkspace } from './cli-env'
|
|
18
18
|
import { MOI_PACKAGE_JSON } from './moi-scaffold'
|
|
19
19
|
import {
|
|
20
|
+
type LoadedUiComponents,
|
|
20
21
|
UI_COMPONENTS,
|
|
21
22
|
UI_COMPONENT_NAMES,
|
|
22
|
-
|
|
23
|
-
|
|
23
|
+
loadUiComponentDocs,
|
|
24
|
+
loadUiComponents,
|
|
24
25
|
partitionUiWrites,
|
|
25
26
|
planUiWrites,
|
|
26
27
|
resolveUiComponentRequest,
|
|
27
28
|
suggestUiComponents,
|
|
28
|
-
|
|
29
|
+
uiComponentFiles
|
|
29
30
|
} from './ui-components'
|
|
30
31
|
|
|
31
32
|
function uiDirFor(workspacePath: string): string {
|
|
@@ -37,7 +38,7 @@ function exitUnknownNames(unknown: string[]): never {
|
|
|
37
38
|
const hints = suggestUiComponents(name)
|
|
38
39
|
console.error(
|
|
39
40
|
pc.red('✗') +
|
|
40
|
-
` "${name}" is not in the
|
|
41
|
+
` "${name}" is not in the component catalog.` +
|
|
41
42
|
(hints.length ? pc.dim(` Did you mean: ${hints.join(', ')}?`) : '')
|
|
42
43
|
)
|
|
43
44
|
}
|
|
@@ -48,7 +49,7 @@ function exitUnknownNames(unknown: string[]): never {
|
|
|
48
49
|
const add = defineCommand({
|
|
49
50
|
meta: {
|
|
50
51
|
name: 'add',
|
|
51
|
-
description: '
|
|
52
|
+
description: 'Add components from the local registry to .moi/ui/'
|
|
52
53
|
},
|
|
53
54
|
args: {
|
|
54
55
|
name: {
|
|
@@ -74,35 +75,34 @@ const add = defineCommand({
|
|
|
74
75
|
const entry = await resolveCwdWorkspace()
|
|
75
76
|
const uiDir = uiDirFor(entry.path)
|
|
76
77
|
|
|
77
|
-
let
|
|
78
|
+
let loaded: LoadedUiComponents
|
|
78
79
|
try {
|
|
79
|
-
|
|
80
|
+
loaded = await loadUiComponents(request.entries)
|
|
80
81
|
} catch (err) {
|
|
81
82
|
console.error(
|
|
82
83
|
'\n' +
|
|
83
84
|
pc.red('✗') +
|
|
84
|
-
' Could not
|
|
85
|
-
'The command needs network access; offline use is not supported.\n' +
|
|
85
|
+
' Could not load the requested components from the local registry.\n' +
|
|
86
86
|
pc.dim(` ${(err as Error).message}\n`)
|
|
87
87
|
)
|
|
88
88
|
process.exit(1)
|
|
89
89
|
}
|
|
90
90
|
|
|
91
91
|
const plans = planUiWrites({
|
|
92
|
-
files:
|
|
93
|
-
|
|
92
|
+
files: loaded.files,
|
|
93
|
+
requestedFiles: request.entries.flatMap(uiComponentFiles),
|
|
94
94
|
uiDir,
|
|
95
95
|
exists: existsSync
|
|
96
96
|
})
|
|
97
97
|
|
|
98
98
|
// Hand-customized components are never silently overwritten: without
|
|
99
99
|
// --force a requested file that already exists is skipped and reported, so
|
|
100
|
-
// a bulk add still installs everything new. Only when
|
|
101
|
-
//
|
|
102
|
-
// (utils,
|
|
100
|
+
// a bulk add still installs everything new. Only when nothing needs to be
|
|
101
|
+
// written does the add fail. Existing support files
|
|
102
|
+
// (utils, scoped-portal, registry deps that rode along) are kept as-is
|
|
103
103
|
// either way, even under --force.
|
|
104
104
|
const partition = partitionUiWrites(plans, args.force)
|
|
105
|
-
if (partition.
|
|
105
|
+
if (partition.write.length === 0) {
|
|
106
106
|
console.error(
|
|
107
107
|
'\n' +
|
|
108
108
|
pc.red('✗') +
|
|
@@ -118,10 +118,7 @@ const add = defineCommand({
|
|
|
118
118
|
await mkdir(uiDir, { recursive: true })
|
|
119
119
|
const written: string[] = []
|
|
120
120
|
for (const plan of partition.write) {
|
|
121
|
-
|
|
122
|
-
? await transformUiComponentSource(plan.name, plan.content)
|
|
123
|
-
: plan.content
|
|
124
|
-
await Bun.write(plan.path, content)
|
|
121
|
+
await Bun.write(plan.path, plan.content)
|
|
125
122
|
written.push(plan.name)
|
|
126
123
|
}
|
|
127
124
|
const kept = partition.keepSupport.map(plan => plan.name)
|
|
@@ -131,7 +128,7 @@ const add = defineCommand({
|
|
|
131
128
|
// registry specifiers may be versioned (`recharts@3.8.0`), so compare by
|
|
132
129
|
// package name.
|
|
133
130
|
const baseline = new Set(Object.keys(MOI_PACKAGE_JSON.dependencies))
|
|
134
|
-
const deps = [...new Set(
|
|
131
|
+
const deps = [...new Set(loaded.dependencies)]
|
|
135
132
|
.filter(spec => !baseline.has(spec.replace(/@[^@/]+$/, '')))
|
|
136
133
|
.sort()
|
|
137
134
|
|
|
@@ -200,7 +197,7 @@ const add = defineCommand({
|
|
|
200
197
|
const docs = defineCommand({
|
|
201
198
|
meta: {
|
|
202
199
|
name: 'docs',
|
|
203
|
-
description: 'Print
|
|
200
|
+
description: 'Print component docs as markdown'
|
|
204
201
|
},
|
|
205
202
|
args: {
|
|
206
203
|
name: {
|
|
@@ -213,18 +210,16 @@ const docs = defineCommand({
|
|
|
213
210
|
const request = resolveUiComponentRequest(args._)
|
|
214
211
|
if (request.unknown.length > 0) exitUnknownNames(request.unknown)
|
|
215
212
|
|
|
213
|
+
console.log(
|
|
214
|
+
'> Import components relatively from `../ui/<name>` and use `@tabler/icons-react` for icons.\n'
|
|
215
|
+
)
|
|
216
216
|
for (const name of request.entries) {
|
|
217
|
-
const slug = UI_COMPONENTS[name].docsSlug ?? name
|
|
218
|
-
const url = `${UI_DOCS_BASE}/${slug}.md`
|
|
219
217
|
try {
|
|
220
|
-
const
|
|
221
|
-
if (!res.ok) throw new Error(`HTTP ${res.status}`)
|
|
218
|
+
const markdown = await loadUiComponentDocs(name)
|
|
222
219
|
if (request.entries.length > 1) console.log(`\n---\n# ${name}\n`)
|
|
223
|
-
console.log(
|
|
220
|
+
console.log(markdown)
|
|
224
221
|
} catch (err) {
|
|
225
|
-
console.error(
|
|
226
|
-
pc.red('✗') + ` Could not fetch docs for "${name}" (${url}): ${(err as Error).message}`
|
|
227
|
-
)
|
|
222
|
+
console.error(pc.red('✗') + ` Could not load docs for "${name}": ${(err as Error).message}`)
|
|
228
223
|
process.exitCode = 1
|
|
229
224
|
}
|
|
230
225
|
}
|
|
@@ -240,7 +235,7 @@ function renderCatalog(uiDir: string, query?: string): void {
|
|
|
240
235
|
if (needle && !name.includes(needle) && !entry.description.toLowerCase().includes(needle)) {
|
|
241
236
|
continue
|
|
242
237
|
}
|
|
243
|
-
const installed =
|
|
238
|
+
const installed = uiComponentFiles(name).every(file => existsSync(join(uiDir, file)))
|
|
244
239
|
rows.push(
|
|
245
240
|
' ' +
|
|
246
241
|
(installed ? pc.green('✓ ') : ' ') +
|
package/server/cli.ts
CHANGED
|
@@ -790,7 +790,7 @@ const refresh = defineCommand({
|
|
|
790
790
|
}
|
|
791
791
|
})
|
|
792
792
|
|
|
793
|
-
function
|
|
793
|
+
function swatchHexToRgb(hex: string): [number, number, number] {
|
|
794
794
|
const value = Number.parseInt(hex.slice(1), 16)
|
|
795
795
|
return [(value >> 16) & 0xff, (value >> 8) & 0xff, value & 0xff]
|
|
796
796
|
}
|
|
@@ -799,8 +799,8 @@ function hexToRgb(hex: string): [number, number, number] {
|
|
|
799
799
|
// Falls back to blank spaces when stdout is not a TTY, keeping piped output clean.
|
|
800
800
|
function swatch(bg?: string, fg?: string): string {
|
|
801
801
|
if (!process.stdout.isTTY || !bg) return ' '
|
|
802
|
-
const [br, bgg, bb] =
|
|
803
|
-
const [fr, fgg, fb] =
|
|
802
|
+
const [br, bgg, bb] = swatchHexToRgb(bg)
|
|
803
|
+
const [fr, fgg, fb] = swatchHexToRgb(fg ?? '#000000')
|
|
804
804
|
return `\x1b[48;2;${br};${bgg};${bb}m\x1b[38;2;${fr};${fgg};${fb}m Aa \x1b[0m`
|
|
805
805
|
}
|
|
806
806
|
|
|
@@ -2946,17 +2946,12 @@ const version = defineCommand({
|
|
|
2946
2946
|
}
|
|
2947
2947
|
})
|
|
2948
2948
|
|
|
2949
|
-
// A static shell over ./cli-ui-components
|
|
2950
|
-
//
|
|
2951
|
-
// is inlined here (duplicating the real command's) because it is all the root
|
|
2952
|
-
// help needs: both citty's usage renderer and printMainHelp read only
|
|
2953
|
-
// `meta.description`, so a lazily-resolved subcommand would be imported by
|
|
2954
|
-
// every `moi --help`. Keeping the shell static defers the module to the point
|
|
2955
|
-
// where a subcommand actually runs.
|
|
2949
|
+
// A static shell over ./cli-ui-components. The meta is inlined here because it
|
|
2950
|
+
// is all the root help needs; the registry loader stays lazy until used.
|
|
2956
2951
|
const uiComponents = defineCommand({
|
|
2957
2952
|
meta: {
|
|
2958
2953
|
name: 'ui-components',
|
|
2959
|
-
description: '
|
|
2954
|
+
description: 'UI components for applets'
|
|
2960
2955
|
},
|
|
2961
2956
|
subCommands: () => import('./cli-ui-components').then(m => m.uiComponentsSubCommands),
|
|
2962
2957
|
async run({ rawArgs }) {
|
package/server/data-dir.ts
CHANGED
|
@@ -6,4 +6,4 @@
|
|
|
6
6
|
// spawned CLI would otherwise read the developer's real data dir.
|
|
7
7
|
import envPaths from 'env-paths'
|
|
8
8
|
|
|
9
|
-
export const DATA_DIR = process.env.MOI_DATA_DIR || envPaths('moi', { suffix:
|
|
9
|
+
export const DATA_DIR = process.env.MOI_DATA_DIR || envPaths('moi', { suffix: '' }).data
|
package/server/harness/README.md
CHANGED
|
@@ -57,8 +57,7 @@ Socket-protocol notes the layers rely on (all defined in `lib/types.ts`):
|
|
|
57
57
|
lifecycle signal — never derived by counting sends vs results. The snapshot
|
|
58
58
|
(sent on connect and re-broadcast periodically) is authoritative: the client
|
|
59
59
|
rebuilds its whole activity map from it, so a lost terminal frame self-heals.
|
|
60
|
-
`requires-action`
|
|
61
|
-
yet — the client shows no loader for it.
|
|
60
|
+
`requires-action` suppresses the loader.
|
|
62
61
|
- **`preview`** — live token frames, cumulative text, never persisted;
|
|
63
62
|
cleared when the turn with matching `meta.apiMessageId` lands.
|
|
64
63
|
|
|
@@ -75,9 +74,9 @@ server/harness/
|
|
|
75
74
|
hand-written wire types it consumes
|
|
76
75
|
session.ts live per-thread state machine (send/interrupt/turn
|
|
77
76
|
accounting/preview forwarding)
|
|
78
|
-
<transport>.ts
|
|
79
|
-
codex/
|
|
80
|
-
|
|
77
|
+
<transport>.ts connection management: codex/client.ts owns processes and
|
|
78
|
+
codex/transport.ts frames stdio; openclaw/gateway.ts owns
|
|
79
|
+
the gateway connection (CC uses the Agent SDK)
|
|
81
80
|
discovery.ts / models.ts / sessions.ts / mcp.ts as needed
|
|
82
81
|
NOTES.md the backend's wire protocol, empirically verified
|
|
83
82
|
*.test.ts tests live next to the code they cover
|
|
@@ -140,7 +139,9 @@ app-server protocol without moi).
|
|
|
140
139
|
**Claude Code — shipped, primary harness.** Full chat integration: long-lived
|
|
141
140
|
streaming-input sessions with mid-turn message queueing, resume after idle
|
|
142
141
|
eviction/restart, interrupt, per-thread model + effort picker (backed by
|
|
143
|
-
`supportedModels()
|
|
142
|
+
`supportedModels()`, cached per CLI version so an in-place `claude` update
|
|
143
|
+
shows up without a server restart — `claude-code/NOTES.md` "Runtime
|
|
144
|
+
executable"), opt-in live token streaming, image/file attachments,
|
|
144
145
|
subagent lanes, MCP status probe, and session list/history replay from the
|
|
145
146
|
SDK's `.jsonl` files, with per-turn token usage folded into the final
|
|
146
147
|
assistant turn. The Agent SDK remains the transport, while every query is
|
|
@@ -153,8 +154,9 @@ permission chain — settings rules, the `auto` mode classifier, and
|
|
|
153
154
|
that reaches a prompt without passing through `PreToolUse`. This is strictly
|
|
154
155
|
more access than the CLI default — the classifier's safety verdicts no longer
|
|
155
156
|
apply — and is an interim policy until UI approvals land. Known gaps: no
|
|
156
|
-
interactive approval flow yet, and
|
|
157
|
-
teardown-and-resume because the SDK has no live setter for them.
|
|
157
|
+
interactive approval flow yet, and streaming changes require a
|
|
158
|
+
teardown-and-resume because the SDK has no live setter for them. Model, effort,
|
|
159
|
+
and fast-mode changes apply live before the next message.
|
|
158
160
|
|
|
159
161
|
**OpenClaw — shipped.** Chat over the local gateway's WebSocket JSON-RPC
|
|
160
162
|
(wire protocol 4 — the 2026.7.x and 2026.6.x lines; protocol-3 gateways are
|
|
@@ -189,29 +191,19 @@ tool calls left unsettled at turn end are closed (Hermes never completes file
|
|
|
189
191
|
read/write calls live), and a completing `tool_call_update` carries no title, so
|
|
190
192
|
the established name is kept. See `hermes/NOTES.md`.
|
|
191
193
|
|
|
192
|
-
**Codex — shipped, experimental.**
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
MCP
|
|
204
|
-
|
|
205
|
-
reports a missing `codex` executable (PATH + login-shell PATH lookup, with a
|
|
206
|
-
Codex Desktop app-bundle fallback — `executable.ts`) to setup flows and the
|
|
207
|
-
workspace composer. Sessions use `workspace-write` with network disabled by
|
|
208
|
-
default and `approvalPolicy: on-request`; server→client approval requests are
|
|
209
|
-
accepted by moi at the transport — an interim default-approve policy until UI
|
|
210
|
-
approvals land (`codex/permissions.ts`). The same policy is reapplied on
|
|
211
|
-
thread start, resume, and every turn. Known gaps: no interactive approval flow
|
|
212
|
-
yet. Per-turn application context tells Codex to request escalated localhost
|
|
213
|
-
access before control-server commands. Images ride inline as data URLs only
|
|
214
|
-
(no `localImage` path mode).
|
|
194
|
+
**Codex — shipped, experimental.** One `codex app-server` per workspace supplies
|
|
195
|
+
chat, model/session catalogs, history, steering, and interruption. The harness
|
|
196
|
+
maps items into shared display events, including subagent transcripts, reasoning
|
|
197
|
+
previews, usage, and hook/MCP failure notices.
|
|
198
|
+
Model, effort, and fast-mode choices apply on the next new turn; the sent model
|
|
199
|
+
matches the picker even when Codex config names an unavailable model.
|
|
200
|
+
|
|
201
|
+
Workspace env is fixed at process spawn. Executable lookup prefers PATH over
|
|
202
|
+
the desktop bundle; config and credentials remain owned by Codex. Sessions use
|
|
203
|
+
workspace-write access with network disabled, and moi automatically accepts
|
|
204
|
+
supported permission requests. Command-approval UI, native question forms, and
|
|
205
|
+
MCP elicitation are not implemented. See [Codex harness notes](codex/NOTES.md)
|
|
206
|
+
for module ownership, ordering rules, runtime diagnostics, and boundaries.
|
|
215
207
|
|
|
216
208
|
Workspace availability also checks provider authentication when a workspace is
|
|
217
209
|
given. Claude Code is probed with `claude auth status` under the effective
|
|
@@ -247,17 +239,18 @@ doubles as the evaluation rubric for new harnesses.
|
|
|
247
239
|
`session_state_changed` when the CLI emits it; Codex: `turn/started` /
|
|
248
240
|
`turn/completed`; OpenClaw: `agent` lifecycle phases). Flip to `running`
|
|
249
241
|
optimistically on send; a session with live background tasks (CC
|
|
250
|
-
`
|
|
242
|
+
`background_tasks_changed` snapshots, with task events as an older-CLI
|
|
243
|
+
fallback) must not be idle-evicted.
|
|
251
244
|
|
|
252
245
|
### Per-request configuration
|
|
253
246
|
|
|
254
247
|
- **List supported models**, including per-model metadata such as supported
|
|
255
248
|
effort levels (drives the picker).
|
|
256
249
|
- **Set model** — ideally live mid-session.
|
|
257
|
-
- **Set reasoning effort** — CC
|
|
258
|
-
|
|
259
|
-
- **Thinking/reasoning display mode** (Codex
|
|
260
|
-
|
|
250
|
+
- **Set reasoning effort** — CC applies `applyFlagSettings({ effortLevel })`
|
|
251
|
+
before the next message; Codex takes it per turn.
|
|
252
|
+
- **Thinking/reasoning display mode** (Codex requests `summary: 'detailed'`
|
|
253
|
+
so visible summaries do not depend on CLI defaults).
|
|
261
254
|
- **Token streaming opt-in** (CC: `includePartialMessages`, construct-time;
|
|
262
255
|
Codex: always streams, moi gates forwarding).
|
|
263
256
|
- **Permissions / tool policy** — allowed tools, permission mode; backends
|
|
@@ -304,36 +297,36 @@ doubles as the evaluation rubric for new harnesses.
|
|
|
304
297
|
|
|
305
298
|
## Capability comparison
|
|
306
299
|
|
|
307
|
-
Legend: ✅ supported · ⚠️ partial/workaround · ❌ missing.
|
|
300
|
+
Legend: ✅ supported · ⚠️ partial/workaround · ❌ missing. The Codex column
|
|
301
|
+
describes what moi exposes, not every RPC available in the upstream protocol.
|
|
308
302
|
|
|
309
303
|
| Feature | Claude Agent SDK | OpenClaw gateway | Codex app-server | Hermes (ACP) |
|
|
310
304
|
| ------------------------ | --------------------------------------------------- | ------------------------- | ------------------------------------- | ------------------------------------ |
|
|
311
305
|
| Long-lived session | ✅ subprocess per session | ✅ gateway-side | ✅ server-side, N threads/process | ✅ process per workspace, N sessions |
|
|
312
306
|
| Queue/steer mid-turn | ⚠️ queued next turn | ⚠️ | ✅ `turn/steer` into live turn | ⚠️ queued (ACP has no steer) |
|
|
313
|
-
| Resume | ✅ | ✅ | ✅
|
|
307
|
+
| Resume | ✅ | ✅ | ✅ `thread/resume` | ✅ `session/load` (+ fork) |
|
|
314
308
|
| Interrupt | ✅ `interrupt()` | ✅ | ✅ `turn/interrupt` | ✅ `session/cancel` → `cancelled` |
|
|
315
309
|
| List models | ✅ `supportedModels()` | ✅ `models.list` | ✅ `model/list` | ✅ inline on `session/new` |
|
|
316
310
|
| Live model switch | ✅ `setModel()` | ✅ `sessions.patch` | ✅ per-turn override | ⚠️ drops session MCP servers |
|
|
317
|
-
| Live effort switch |
|
|
311
|
+
| Live effort switch | ✅ `applyFlagSettings` | ✅ `thinkingLevel` patch | ✅ per-turn | ❌ no effort concept in ACP |
|
|
318
312
|
| Token deltas | ✅ opt-in | ✅ `chat` frames | ✅ `item/*/delta` | ✅ always on, thinking + text |
|
|
319
|
-
| Images in input | ✅ base64 blocks | ⚠️ materialize to path | ✅ data
|
|
313
|
+
| Images in input | ✅ base64 blocks | ⚠️ materialize to path | ✅ inline data URLs | ✅ base64 blocks |
|
|
320
314
|
| Interactive approvals | ⚠️ (we bypass) | ✅ | ✅ server→client requests (we bypass) | ✅ real, with diffs (we bypass) |
|
|
321
315
|
| Session list/history API | ✅ `listSessions()` + jsonl | ✅ `sessions.get` | ✅ `thread/list`/`read` | ✅ `session/list` (cwd + cursor) |
|
|
322
316
|
| Home card preview | ✅ session file scan | ✅ cached first message | ⚠️ live app-server only | ⚠️ live process only |
|
|
323
317
|
| MCP status | ✅ `mcpServerStatus()` | n/a | ✅ `mcpServerStatus/list` | ⚠️ per-session config, no status RPC |
|
|
324
|
-
| Usage reporting | ⚠️ cost/duration on `result` (adapter drops tokens) | ✅ tokens + cost per turn | ✅
|
|
325
|
-
| Structured output | ❌ | ❌ |
|
|
318
|
+
| Usage reporting | ⚠️ cost/duration on `result` (adapter drops tokens) | ✅ tokens + cost per turn | ✅ per-turn tokens and duration | ✅ tokens per turn |
|
|
319
|
+
| Structured output | ❌ | ❌ | ⚠️ title generation only | ❌ |
|
|
326
320
|
|
|
327
321
|
## Design lessons so far
|
|
328
322
|
|
|
329
|
-
-
|
|
330
|
-
|
|
323
|
+
- Claude Code settings are either live-settable (`setModel`, effort/fast mode
|
|
324
|
+
via `applyFlagSettings`) or construct-time (streaming).
|
|
331
325
|
Encode that distinction per-setting in the adapter interface instead of
|
|
332
326
|
hardcoding the drain-then-rebuild machinery.
|
|
333
|
-
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
support both.
|
|
327
|
+
- Chat harnesses keep connections open (CC subprocess, OpenClaw gateway,
|
|
328
|
+
Codex app-server). Separate one-shot work, such as Codex title generation,
|
|
329
|
+
can use a short-lived process without changing chat session ownership.
|
|
337
330
|
- Event vocabularies differ in kind, not just names: CC emits raw
|
|
338
331
|
tool_use/tool_result pairs; Codex emits semantic items (a patch, a command)
|
|
339
332
|
with their own lifecycle. The adapter layer is where that converges on
|