moi-computer 0.8.0 → 0.9.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/client/api/workspace-keys.ts +1 -2
- package/client/app/AppRouter.tsx +10 -3
- package/client/app/routes/HomeRoute.tsx +1 -1
- package/client/app/shell/SidebarLayout.tsx +2 -14
- package/client/components/shared/Composer.tsx +20 -7
- package/client/components/shared/PanelHeader.tsx +8 -1
- package/client/components/ui/button.tsx +3 -3
- package/client/components/ui/dialog.tsx +1 -1
- package/client/components/ui/dropdown-menu.tsx +2 -2
- package/client/components/ui/hover-card.tsx +1 -1
- package/client/components/ui/popover.tsx +1 -1
- package/client/components/ui/resizable.tsx +40 -0
- package/client/features/chat/ChatEmptyState.tsx +9 -11
- package/client/features/chat/ChatPanel.tsx +76 -48
- package/client/features/chat/ChatPopup.tsx +16 -2
- package/client/features/chat/ChatPromptBubbles.tsx +6 -8
- package/client/features/chat/ChatSelector.tsx +24 -7
- package/client/features/chat/MarkdownContent.tsx +1 -1
- package/client/features/chat/ModelPicker.tsx +5 -4
- package/client/features/chat/TurnView.tsx +108 -13
- package/client/features/chat/api.ts +1 -18
- package/client/features/chat/chat-send.ts +2 -2
- package/client/features/chat/{ChatComposer.tsx → composer/ChatComposer.tsx} +6 -5
- package/client/features/chat/composer/banners/ChatErrorBanner.tsx +28 -0
- package/client/features/chat/composer/banners/ComposerBanner.tsx +30 -0
- package/client/features/chat/composer/banners/WorkspaceAgentAvailabilityBanner.tsx +91 -0
- package/client/features/{workspace → chat/composer/banners}/WorkspaceSkillUpdateBanner.tsx +9 -7
- package/client/features/chat/composer/useWorkspaceComposerState.tsx +74 -0
- package/client/features/{workspace → chat/composer}/useWorkspaceSkillUpdates.ts +1 -1
- package/client/features/chat/group-turns.ts +46 -28
- package/client/features/chat/interleave-notices.ts +84 -0
- package/client/features/chat/model-order.ts +9 -3
- package/client/features/chat/tool-group/TimelineRow.tsx +23 -11
- package/client/features/chat/tool-group/ToolCallGroup.tsx +38 -3
- package/client/features/chat/tool-group/format.ts +51 -10
- package/client/features/chat/useAppletChatMessage.ts +11 -16
- package/client/features/chat/useChat.ts +3 -7
- package/client/features/dev/ChatStatesPage.tsx +466 -0
- package/client/features/dev/DevIndexPage.tsx +52 -0
- package/client/features/dev/DevRoutes.tsx +6 -3
- package/client/features/dev/HarnessDebugPage.tsx +3 -3
- package/client/features/dev/chat-states-fixtures.ts +744 -0
- package/client/features/scratchpad/Scratchpad.tsx +4 -0
- package/client/features/scratchpad/scratch-session.ts +71 -0
- package/client/features/views/ViewBuilderTab.tsx +5 -4
- package/client/features/views/useViewBuilderActions.ts +2 -2
- package/client/features/workspace/WorkspaceLayoutContext.tsx +4 -2
- package/client/features/workspace/WorkspaceScreen.tsx +128 -146
- package/client/features/workspace/WorkspaceSplitLayout.tsx +111 -0
- package/client/features/workspace/api.ts +33 -8
- package/client/features/workspace/useFitsSplitLayout.ts +31 -5
- package/client/index.css +1 -1
- package/client/lib/flags.ts +4 -3
- package/client/runtime/useWorkspaceEvents.ts +18 -1
- package/client/store/ui.ts +5 -1
- package/dist/{chunk-0pcdwjkp.js → chunk-2vaafjp4.js} +1 -1
- package/dist/{chunk-9y2zbzqz.js → chunk-35fq49qa.js} +1 -1
- package/dist/{chunk-h9h8f176.js → chunk-3b3rkjet.js} +1 -1
- package/dist/chunk-gt7n06ef.js +1 -0
- package/dist/{chunk-r5ce5cdg.js → chunk-kkj86722.js} +75 -75
- package/dist/chunk-ty1sqbmn.js +80 -0
- package/dist/chunk-xeyxk7ep.js +10 -0
- package/dist/chunk-yz6wd5vc.css +1 -0
- package/dist/index.html +1 -1
- package/lib/format.ts +37 -7
- package/lib/themes.ts +2 -2
- package/lib/types.ts +38 -8
- package/lib/workspace-layout.ts +2 -2
- package/package.json +6 -4
- package/server/agent.ts +199 -0
- package/server/api.ts +36 -17
- package/server/bundler/build-applet.ts +35 -44
- package/server/cli-env.ts +2 -2
- package/server/cli.ts +39 -53
- package/server/constants.ts +8 -0
- package/server/control-client.ts +124 -0
- package/server/control.ts +2 -2
- package/server/env-apply.ts +4 -0
- package/server/harness/README.md +32 -12
- package/server/harness/claude-code/auth.ts +54 -0
- package/server/harness/claude-code/index.ts +6 -1
- package/server/harness/codex/adapter.ts +9 -1
- package/server/harness/codex/auth.ts +50 -0
- package/server/harness/codex/index.ts +6 -1
- package/server/harness/codex/session.ts +33 -14
- package/server/harness/openclaw/NOTES.md +619 -186
- package/server/harness/openclaw/adapter.ts +121 -54
- package/server/harness/openclaw/compat.ts +95 -0
- package/server/harness/openclaw/cron-view.ts +78 -0
- package/server/harness/openclaw/discovery.ts +145 -52
- package/server/harness/openclaw/gateway.ts +224 -36
- package/server/harness/openclaw/index.ts +56 -21
- package/server/harness/openclaw/session.ts +1002 -67
- package/server/harness/openclaw/strip.ts +71 -23
- package/server/harness/openclaw/thinking.ts +150 -0
- package/server/harness/types.ts +10 -5
- package/server/layout.ts +5 -2
- package/server/service.ts +2 -2
- package/workspace/.claude/skills/moi-workspace/SKILL.md +6 -6
- package/workspace/.claude/skills/moi-workspace/{DESIGN.md → references/DESIGN.md} +19 -9
- package/client/features/dev/PixelPainter.tsx +0 -94
- package/client/features/dev/PlaygroundPage.tsx +0 -69
- package/dist/chunk-0k7brsms.js +0 -9
- package/dist/chunk-dfs36zgc.js +0 -1
- package/dist/chunk-dtwxpxbg.js +0 -51
- package/dist/chunk-ga7t9qsk.js +0 -2
- package/dist/chunk-tey2nq7c.js +0 -31
- package/dist/chunk-z73xpsa0.js +0 -50
- package/dist/chunk-zzgredta.css +0 -1
- /package/workspace/.claude/skills/moi-workspace/{SCRATCHPAD.md → references/SCRATCHPAD.md} +0 -0
|
@@ -1,30 +1,36 @@
|
|
|
1
1
|
// OpenClaw as a Harness. Thin wiring over this folder's modules — see
|
|
2
2
|
// ../types.ts for the contract and ../README.md for the architecture.
|
|
3
3
|
import type { DiscoveredWorkspaceCandidate, Harness } from '../types'
|
|
4
|
+
import { OPENCLAW_WIRE_SCOPE, getOpenClawGatewayStatus } from './gateway'
|
|
4
5
|
import { toSessionInfo, toStreamEvents } from './adapter'
|
|
6
|
+
import { cronRunsToStreamEvents, openClawCronJobIdFromKey } from './cron-view'
|
|
5
7
|
import {
|
|
8
|
+
archiveOpenClawSession,
|
|
6
9
|
discoverOpenClawAgents,
|
|
10
|
+
getOpenClawCronRuns,
|
|
7
11
|
getOpenClawModels,
|
|
8
12
|
getOpenClawSessionMessages,
|
|
9
13
|
getOpenClawSessions,
|
|
10
|
-
getOpenClawWorkspacePreview
|
|
14
|
+
getOpenClawWorkspacePreview,
|
|
15
|
+
resolveOpenClawSessionKey
|
|
11
16
|
} from './discovery'
|
|
12
17
|
import {
|
|
13
18
|
abortOpenClawRun,
|
|
14
19
|
ensureOpenClawSessionLive,
|
|
15
20
|
getLiveOpenClawEvents,
|
|
16
21
|
getOpenClawActiveSessions,
|
|
22
|
+
killAllOpenClawSessions,
|
|
17
23
|
sendOpenClawMessage
|
|
18
24
|
} from './session'
|
|
19
25
|
|
|
20
26
|
export const openclawHarness: Harness = {
|
|
21
27
|
id: 'openclaw',
|
|
22
28
|
capabilities: {
|
|
23
|
-
supportsStreaming:
|
|
29
|
+
supportsStreaming: true, // `chat` delta frames → StreamPreview
|
|
24
30
|
imagesInline: 'path-note',
|
|
25
|
-
liveModelSwitch:
|
|
26
|
-
liveEffortSwitch:
|
|
27
|
-
nativeUserEcho: true //
|
|
31
|
+
liveModelSwitch: true, // sessions.patch { model } before each send
|
|
32
|
+
liveEffortSwitch: true, // sessions.patch { thinkingLevel }
|
|
33
|
+
nativeUserEcho: true // echo matched by `<runId>:user` idempotency key, text fallback
|
|
28
34
|
},
|
|
29
35
|
|
|
30
36
|
sendMessage: async input => {
|
|
@@ -34,6 +40,11 @@ export const openclawHarness: Harness = {
|
|
|
34
40
|
return sendOpenClawMessage({ ...input, agentId: input.agentId })
|
|
35
41
|
},
|
|
36
42
|
interrupt: (workspaceId, sessionId) => abortOpenClawRun({ workspaceId, sessionId }),
|
|
43
|
+
// `sessions.patch { archived: true }`. 2026.6.x gateways reject the field
|
|
44
|
+
// (their patch schema predates it and validates with
|
|
45
|
+
// `additionalProperties: false`) — the RPC error propagates and the API
|
|
46
|
+
// layer reports the archive as failed.
|
|
47
|
+
archiveSession: (ws, sessionId) => archiveOpenClawSession(sessionId, ws.path, ws.agentId),
|
|
37
48
|
activeSessions: () => getOpenClawActiveSessions(),
|
|
38
49
|
|
|
39
50
|
listSessions: async ws => {
|
|
@@ -45,24 +56,34 @@ export const openclawHarness: Harness = {
|
|
|
45
56
|
// Prefer the live view if we already hold one — keeps REST + WS in
|
|
46
57
|
// agreement for any reload that lands while a run is active. The first cold
|
|
47
58
|
// call also primes the live subscription so subsequent WS frames upsert
|
|
48
|
-
// into the same view; the static transcript is the last resort.
|
|
59
|
+
// into the same view; the static transcript is the last resort. A session
|
|
60
|
+
// that still comes back empty may be an isolated cron bucket — its per-run
|
|
61
|
+
// transcripts are orphaned by the gateway's post-run session reset (see
|
|
62
|
+
// cron-view.ts), so fall back to synthesizing turns from `cron.runs`.
|
|
49
63
|
sessionEvents: async (ws, sessionId) => {
|
|
50
|
-
const
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
64
|
+
const events = await (async () => {
|
|
65
|
+
const live = getLiveOpenClawEvents(ws.id, sessionId)
|
|
66
|
+
if (live) return live
|
|
67
|
+
if (ws.agentId) {
|
|
68
|
+
try {
|
|
69
|
+
return await ensureOpenClawSessionLive({
|
|
70
|
+
workspaceId: ws.id,
|
|
71
|
+
workspacePath: ws.path,
|
|
72
|
+
agentId: ws.agentId,
|
|
73
|
+
sessionId
|
|
74
|
+
})
|
|
75
|
+
} catch {
|
|
76
|
+
// fall through to static path
|
|
77
|
+
}
|
|
62
78
|
}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
79
|
+
const preview = await getOpenClawSessionMessages(sessionId, ws.path, ws.agentId)
|
|
80
|
+
return toStreamEvents(preview)
|
|
81
|
+
})()
|
|
82
|
+
if (events.length > 0) return events
|
|
83
|
+
const key = await resolveOpenClawSessionKey(sessionId, ws.path, ws.agentId)
|
|
84
|
+
const jobId = key ? openClawCronJobIdFromKey(key) : null
|
|
85
|
+
if (!jobId) return events
|
|
86
|
+
return cronRunsToStreamEvents(await getOpenClawCronRuns(jobId))
|
|
66
87
|
},
|
|
67
88
|
listModels: () => getOpenClawModels(),
|
|
68
89
|
|
|
@@ -78,11 +99,25 @@ export const openclawHarness: Harness = {
|
|
|
78
99
|
)
|
|
79
100
|
},
|
|
80
101
|
|
|
102
|
+
// Server shutdown: tear down every live session (unsubscribe + stop ingest).
|
|
103
|
+
// The shared gateway client is left running — process exit drops it. Invoked
|
|
104
|
+
// from web.ts's SIGTERM/SIGINT handler via allHarnesses().shutdown().
|
|
105
|
+
shutdown: () => killAllOpenClawSessions(),
|
|
81
106
|
skillsDir: workspaceRoot => `${workspaceRoot}/skills`,
|
|
82
107
|
|
|
108
|
+
// One process-global gateway connection → one shared wire-tap scope.
|
|
109
|
+
wireScope: () => OPENCLAW_WIRE_SCOPE,
|
|
110
|
+
|
|
83
111
|
statusLines: () => {
|
|
84
112
|
const active = getOpenClawActiveSessions()
|
|
113
|
+
const status = getOpenClawGatewayStatus()
|
|
114
|
+
const gateway = status.connected
|
|
115
|
+
? `gateway connected · protocol ${status.info?.protocol ?? '?'} · server ${status.info?.serverVersion ?? '?'}`
|
|
116
|
+
: status.failure
|
|
117
|
+
? `gateway ${status.failure.kind}: ${status.failure.message}`
|
|
118
|
+
: 'gateway not connected yet'
|
|
85
119
|
return [
|
|
120
|
+
gateway,
|
|
86
121
|
`live OpenClaw runs ${active.length}`,
|
|
87
122
|
...active.map(r => ` ▶ busy ws=${r.workspaceId} session=${r.sessionId}`)
|
|
88
123
|
]
|