moi-computer 0.7.0 → 0.8.1-next.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 +2 -2
- 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/BottomPanel.tsx +2 -1
- 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/applets/AppletMount.tsx +9 -22
- package/client/features/applets/applet-cache.ts +7 -0
- package/client/features/applets/applet-styles.ts +21 -1
- package/client/features/applets/useApplet.ts +1 -1
- 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 +25 -8
- 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} +24 -9
- 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 +23 -7
- package/client/features/chat/useAppletChatMessage.ts +11 -16
- package/client/features/chat/useChat.ts +3 -7
- package/client/features/dev/ChatStatesPage.tsx +428 -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/home/api.ts +0 -10
- package/client/features/home/workspace-setup/CreateWorkspaceDialog.tsx +21 -64
- package/client/features/home/workspace-setup/ImportWorkspaceDialog.tsx +1 -1
- package/client/features/scratchpad/Scratchpad.tsx +5 -3
- package/client/features/scratchpad/scratch-session.ts +71 -0
- package/client/features/views/ViewBuilderTab.tsx +5 -4
- package/client/features/views/ViewManager.tsx +258 -0
- package/client/features/views/useViewBuilderActions.ts +2 -2
- package/client/features/views/view-residency.ts +77 -0
- package/client/features/widgets/WidgetFrame.tsx +6 -2
- package/client/features/workspace/CustomizePanel.tsx +40 -24
- package/client/features/workspace/WorkspaceLayoutContext.tsx +12 -2
- package/client/features/workspace/WorkspaceScreen.tsx +131 -201
- package/client/features/workspace/WorkspaceSplitLayout.tsx +111 -0
- package/client/features/workspace/WorkspaceTabs.tsx +1 -1
- package/client/features/workspace/api.ts +33 -8
- package/client/features/workspace/useFitsSplitLayout.ts +31 -5
- package/client/index.css +5 -2
- package/client/lib/flags.ts +4 -3
- package/client/runtime/useWorkspaceEvents.ts +18 -1
- package/client/runtime/workspace-theme.ts +29 -10
- package/client/store/ui.ts +5 -1
- package/client/theme.css +96 -6
- package/dist/{chunk-0pcdwjkp.js → chunk-2vaafjp4.js} +1 -1
- package/dist/{chunk-9y2zbzqz.js → chunk-35fq49qa.js} +1 -1
- package/dist/chunk-gny990qx.css +1 -0
- package/dist/chunk-gt7n06ef.js +1 -0
- package/dist/{chunk-rxvx4ta9.js → chunk-kkj86722.js} +75 -75
- package/dist/chunk-n7pga5x3.js +80 -0
- package/dist/chunk-xeyxk7ep.js +10 -0
- package/dist/{chunk-w3tnv51j.js → chunk-xzx7c9hq.js} +1 -1
- package/dist/index.html +1 -1
- package/lib/format.ts +17 -1
- package/lib/themes.ts +123 -51
- package/lib/types.ts +40 -13
- package/lib/workspace-layout.ts +2 -2
- package/package.json +6 -4
- package/server/agent.ts +199 -0
- package/server/api.ts +38 -90
- package/server/bundler/build-applet.ts +7 -4
- package/server/cli.ts +46 -15
- package/server/control.ts +13 -6
- package/server/env-apply.ts +4 -0
- package/server/harness/README.md +28 -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 +518 -187
- package/server/harness/openclaw/adapter.ts +125 -31
- package/server/harness/openclaw/compat.ts +99 -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 +971 -55
- package/server/harness/openclaw/strip.ts +87 -15
- package/server/harness/openclaw/thinking.ts +198 -0
- package/server/harness/types.ts +10 -5
- package/server/layout.ts +5 -2
- package/server/moi-scaffold.ts +1 -1
- package/server/registry.ts +0 -20
- package/server/theme.ts +24 -27
- package/workspace/.claude/skills/moi-workspace/DESIGN.md +100 -53
- package/workspace/.claude/skills/moi-workspace/SKILL.md +10 -12
- package/client/features/dev/PixelPainter.tsx +0 -94
- package/client/features/dev/PlaygroundPage.tsx +0 -69
- package/dist/chunk-175bm057.js +0 -27
- package/dist/chunk-55sh4dty.js +0 -2
- package/dist/chunk-afgbg75t.js +0 -50
- package/dist/chunk-agtetn7n.css +0 -1
- package/dist/chunk-dfs36zgc.js +0 -1
- package/dist/chunk-exj6hr30.js +0 -9
- package/dist/chunk-m11ckkxd.js +0 -51
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
// ../types.ts for the contract and ../README.md for the architecture.
|
|
3
3
|
import type { Harness } from '../types'
|
|
4
4
|
import { findHarnessExecutable, pathHarnessAvailability } from '../executable'
|
|
5
|
+
import { getCodexAuthReadiness, startCodexLogin } from './auth'
|
|
5
6
|
import {
|
|
6
7
|
archiveCodexSession,
|
|
7
8
|
getCodexMcpStatus,
|
|
@@ -59,7 +60,11 @@ export const codexHarness: Harness = {
|
|
|
59
60
|
listModels: ws => getCodexModels(ws.path),
|
|
60
61
|
mcpStatus: ws => getCodexMcpStatus(ws.path),
|
|
61
62
|
discoverWorkspaces: registeredPaths => discoverCodexWorkspaces(registeredPaths),
|
|
62
|
-
availability: async
|
|
63
|
+
availability: async ws => {
|
|
64
|
+
const runtime = await pathHarnessAvailability('codex')
|
|
65
|
+
return runtime.available && ws ? getCodexAuthReadiness(ws.path) : runtime
|
|
66
|
+
},
|
|
67
|
+
startLogin: ws => startCodexLogin(ws.path),
|
|
63
68
|
|
|
64
69
|
onEnvChanged: workspacePath => killCodexWorkspace(workspacePath),
|
|
65
70
|
shutdown: () => killAllCodexClients(),
|
|
@@ -35,10 +35,12 @@ import {
|
|
|
35
35
|
codexServiceTierForFastMode,
|
|
36
36
|
codexItemToNotice,
|
|
37
37
|
codexItemToTurn,
|
|
38
|
-
codexThreadToEvents
|
|
38
|
+
codexThreadToEvents,
|
|
39
|
+
withCodexTurnDuration
|
|
39
40
|
} from './adapter'
|
|
40
41
|
import { type CodexClient, getCodexClient, interruptCodexTurn, readSubagentRecords } from './client'
|
|
41
42
|
import { generateCodexSessionTitle, renameCodexSessionIfUnchanged } from './session-title'
|
|
43
|
+
import { agentStore } from '../../agent'
|
|
42
44
|
import { debug } from '../../debug'
|
|
43
45
|
import { broadcast } from '../../state'
|
|
44
46
|
import { renameSelectedSession } from '../../selected-session'
|
|
@@ -243,30 +245,43 @@ function forwardPreview(
|
|
|
243
245
|
})
|
|
244
246
|
}
|
|
245
247
|
|
|
246
|
-
// Fold
|
|
247
|
-
//
|
|
248
|
-
function
|
|
248
|
+
// Fold native completion metadata into the newest assistant turn so replay and
|
|
249
|
+
// live rendering use the same display shape. Re-emits that turn (upsert-by-id).
|
|
250
|
+
function applyCompletionMeta(rec: SessionRecord, durationMs: number | null | undefined) {
|
|
249
251
|
const last = rec.lastUsage?.last
|
|
250
|
-
if (!last) return
|
|
251
252
|
for (let i = rec.view.turns.length - 1; i >= 0; i--) {
|
|
252
253
|
const t = rec.view.turns[i]
|
|
254
|
+
if (t.role === 'user' && t.origin.kind === 'user-input') return
|
|
253
255
|
if (t.role !== 'assistant') continue
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
...
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
256
|
+
let updated = withCodexTurnDuration(t, durationMs)
|
|
257
|
+
if (last) {
|
|
258
|
+
updated = {
|
|
259
|
+
...updated,
|
|
260
|
+
meta: {
|
|
261
|
+
...updated.meta,
|
|
262
|
+
usage: {
|
|
263
|
+
inputTokens: last.inputTokens,
|
|
264
|
+
outputTokens: last.outputTokens,
|
|
265
|
+
totalTokens: last.totalTokens
|
|
266
|
+
}
|
|
262
267
|
}
|
|
263
268
|
}
|
|
264
269
|
}
|
|
270
|
+
if (updated === t) return
|
|
265
271
|
emitTurnEvent(rec, { kind: 'turn', turn: updated })
|
|
266
272
|
return
|
|
267
273
|
}
|
|
268
274
|
}
|
|
269
275
|
|
|
276
|
+
// A send/turn failure can mean the account was signed out from outside moi —
|
|
277
|
+
// a `codex logout` in a terminal, say — which the cached availability
|
|
278
|
+
// snapshot won't reflect until its TTL expires. Force a fresh probe so the
|
|
279
|
+
// composer's availability banner flips right away instead of the next send
|
|
280
|
+
// failing the same way.
|
|
281
|
+
function refreshAvailability(workspaceId: string, workspacePath: string) {
|
|
282
|
+
void agentStore.refresh({ id: workspaceId, path: workspacePath, type: 'codex' })
|
|
283
|
+
}
|
|
284
|
+
|
|
270
285
|
function handleNotification(rec: SessionRecord, method: string, params: Record<string, unknown>) {
|
|
271
286
|
if (method === '__exit') {
|
|
272
287
|
// The app-server died (crash or env-change restart). Drop the record so
|
|
@@ -325,7 +340,7 @@ function handleNotification(rec: SessionRecord, method: string, params: Record<s
|
|
|
325
340
|
case 'turn/completed': {
|
|
326
341
|
const turn = params.turn as CodexTurn | undefined
|
|
327
342
|
rec.previews.clear()
|
|
328
|
-
|
|
343
|
+
applyCompletionMeta(rec, turn?.durationMs)
|
|
329
344
|
setProcessing(rec, false, null)
|
|
330
345
|
if (rec.refreshSessionsOnTurnComplete) {
|
|
331
346
|
rec.refreshSessionsOnTurnComplete = false
|
|
@@ -337,6 +352,7 @@ function handleNotification(rec: SessionRecord, method: string, params: Record<s
|
|
|
337
352
|
sessionId: rec.sessionId,
|
|
338
353
|
content: turn.error.message
|
|
339
354
|
})
|
|
355
|
+
refreshAvailability(rec.workspaceId, rec.workspacePath)
|
|
340
356
|
}
|
|
341
357
|
// An externally-interrupted turn otherwise ends silently, identical to a
|
|
342
358
|
// clean completion — surface the stop so the client can render it.
|
|
@@ -350,6 +366,7 @@ function handleNotification(rec: SessionRecord, method: string, params: Record<s
|
|
|
350
366
|
const message = err?.message ?? (typeof params.message === 'string' ? params.message : '')
|
|
351
367
|
if (message) {
|
|
352
368
|
broadcast(rec.workspaceId, { kind: 'error', sessionId: rec.sessionId, content: message })
|
|
369
|
+
refreshAvailability(rec.workspaceId, rec.workspacePath)
|
|
353
370
|
}
|
|
354
371
|
// A top-level error without a following turn/completed would otherwise
|
|
355
372
|
// leave the session busy forever — the error is terminal for the turn.
|
|
@@ -642,6 +659,7 @@ export async function sendCodexMessage(input: {
|
|
|
642
659
|
sessionId: input.sessionId,
|
|
643
660
|
content: err instanceof Error ? err.message : 'failed to start codex session'
|
|
644
661
|
})
|
|
662
|
+
refreshAvailability(input.workspaceId, input.workspacePath)
|
|
645
663
|
return
|
|
646
664
|
}
|
|
647
665
|
|
|
@@ -723,6 +741,7 @@ export async function sendCodexMessage(input: {
|
|
|
723
741
|
sessionId: rec.sessionId,
|
|
724
742
|
content: err instanceof Error ? err.message : 'send failed'
|
|
725
743
|
})
|
|
744
|
+
refreshAvailability(rec.workspaceId, rec.workspacePath)
|
|
726
745
|
}
|
|
727
746
|
}
|
|
728
747
|
|