moi-computer 0.8.1-next.0 → 0.9.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.
Files changed (103) hide show
  1. package/client/assets/hermes.png +0 -0
  2. package/client/components/shared/IconGhost.tsx +15 -18
  3. package/client/components/ui/button.tsx +2 -2
  4. package/client/components/ui/hover-card.tsx +1 -1
  5. package/client/components/ui/popover.tsx +3 -1
  6. package/client/features/chat/ChatEmptyState.tsx +25 -7
  7. package/client/features/chat/ChatPanel.tsx +70 -28
  8. package/client/features/chat/ChatPopup.tsx +3 -2
  9. package/client/features/chat/ChatPromptBubbles.tsx +1 -1
  10. package/client/features/chat/MarkdownContent.tsx +1 -1
  11. package/client/features/chat/attachment-staging.ts +153 -0
  12. package/client/features/chat/chat-send.ts +55 -0
  13. package/client/features/chat/chat-store.ts +32 -8
  14. package/client/features/chat/composer/ChatComposer.tsx +190 -77
  15. package/client/features/chat/{ModelPicker.tsx → composer/ModelPicker.tsx} +29 -25
  16. package/client/features/chat/composer/banners/ComposerBanner.tsx +1 -1
  17. package/client/features/chat/composer/banners/WorkspaceAgentAvailabilityBanner.tsx +4 -13
  18. package/client/features/chat/{model-order.ts → composer/model-order.ts} +16 -0
  19. package/client/features/chat/composer/useWorkspaceComposerState.tsx +9 -4
  20. package/client/features/chat/tool-group/format/claude.ts +48 -0
  21. package/client/features/chat/tool-group/format/codex.ts +126 -0
  22. package/client/features/chat/tool-group/format/hermes.ts +68 -0
  23. package/client/features/chat/tool-group/format/index.ts +34 -0
  24. package/client/features/chat/tool-group/format/mcp.ts +64 -0
  25. package/client/features/chat/tool-group/format/openclaw.ts +116 -0
  26. package/client/features/chat/tool-group/format/shared.ts +49 -0
  27. package/client/features/chat/useChat.ts +5 -10
  28. package/client/features/dev/ChatStatesPage.tsx +40 -2
  29. package/client/features/drawings/DrawingLayer.tsx +49 -0
  30. package/client/features/drawings/DrawingToolbar.tsx +95 -0
  31. package/client/features/drawings/annotation-availability.ts +10 -0
  32. package/client/features/drawings/capture-element.ts +45 -0
  33. package/client/features/drawings/useChatAnnotation.ts +222 -0
  34. package/client/features/drawings/useDrawingLayer.ts +758 -0
  35. package/client/features/drawings/useViewBuilderSketch.ts +151 -0
  36. package/client/features/home/workspace-presentation.tsx +6 -2
  37. package/client/features/home/workspace-setup/WorkspaceAgentStep.tsx +12 -6
  38. package/client/features/scratchpad/ScratchpadControls.tsx +19 -5
  39. package/client/features/views/ViewBuilder.tsx +224 -0
  40. package/client/features/views/api.ts +1 -0
  41. package/client/features/views/useViewBuilderActions.ts +24 -3
  42. package/client/features/views/useViewBuilderDrafts.ts +66 -0
  43. package/client/features/widgets/Widgets.tsx +23 -39
  44. package/client/features/workspace/CustomizePanel.tsx +1 -1
  45. package/client/features/workspace/WorkspaceScreen.tsx +157 -57
  46. package/client/features/workspace/WorkspaceTabs.tsx +3 -3
  47. package/client/features/workspace/useFitsSplitLayout.ts +14 -8
  48. package/client/index.css +8 -0
  49. package/client/store/ui.ts +19 -0
  50. package/client/theme.css +33 -8
  51. package/dist/chunk-3becmq75.js +81 -0
  52. package/dist/{chunk-kkj86722.js → chunk-6w6j9g4b.js} +78 -78
  53. package/dist/{chunk-xeyxk7ep.js → chunk-8ew39cvq.js} +4 -4
  54. package/dist/chunk-c8gtrjwp.js +1 -0
  55. package/dist/{chunk-2vaafjp4.js → chunk-pp62fnxh.js} +1 -1
  56. package/dist/{chunk-35fq49qa.js → chunk-sxc24vfp.js} +1 -1
  57. package/dist/{chunk-xzx7c9hq.js → chunk-v964b5g7.js} +1 -1
  58. package/dist/chunk-zx33ts9d.css +1 -0
  59. package/dist/hermes-pznd63x9.png +0 -0
  60. package/dist/index.html +1 -1
  61. package/lib/format.ts +21 -7
  62. package/lib/themes.ts +8 -8
  63. package/lib/types.ts +8 -1
  64. package/lib/workspace-types.ts +2 -1
  65. package/package.json +6 -4
  66. package/server/api.ts +21 -2
  67. package/server/bundler/build-applet.ts +35 -44
  68. package/server/cli-env.ts +2 -2
  69. package/server/cli.ts +227 -56
  70. package/server/constants.ts +8 -0
  71. package/server/control-client.ts +124 -0
  72. package/server/control.ts +2 -2
  73. package/server/harness/README.md +74 -23
  74. package/server/harness/acp/adapter.ts +220 -0
  75. package/server/harness/acp/archived.ts +88 -0
  76. package/server/harness/acp/client.ts +328 -0
  77. package/server/harness/acp/discovery.ts +130 -0
  78. package/server/harness/acp/run-durations.ts +68 -0
  79. package/server/harness/acp/session.ts +788 -0
  80. package/server/harness/acp/wire.ts +132 -0
  81. package/server/harness/executable.ts +15 -1
  82. package/server/harness/hermes/NOTES.md +815 -0
  83. package/server/harness/hermes/discovery.ts +155 -0
  84. package/server/harness/hermes/index.ts +155 -0
  85. package/server/harness/hermes/models.ts +79 -0
  86. package/server/harness/openclaw/NOTES.md +196 -94
  87. package/server/harness/openclaw/adapter.ts +28 -55
  88. package/server/harness/openclaw/compat.ts +4 -8
  89. package/server/harness/openclaw/session.ts +257 -238
  90. package/server/harness/openclaw/strip.ts +10 -34
  91. package/server/harness/openclaw/thinking.ts +5 -53
  92. package/server/harness/registry.ts +3 -1
  93. package/server/service.ts +2 -2
  94. package/server/view-builders.ts +4 -2
  95. package/server/workspace-import.ts +30 -1
  96. package/workspace/.claude/skills/moi-workspace/SKILL.md +6 -6
  97. package/client/features/chat/tool-group/format.ts +0 -359
  98. package/client/features/views/ViewBuilderTab.tsx +0 -152
  99. package/dist/chunk-gny990qx.css +0 -1
  100. package/dist/chunk-gt7n06ef.js +0 -1
  101. package/dist/chunk-n7pga5x3.js +0 -80
  102. /package/workspace/.claude/skills/moi-workspace/{DESIGN.md → references/DESIGN.md} +0 -0
  103. /package/workspace/.claude/skills/moi-workspace/{SCRATCHPAD.md → references/SCRATCHPAD.md} +0 -0
@@ -0,0 +1,132 @@
1
+ // ACP (Agent Client Protocol) wire types — layer 1 for every ACP-speaking
2
+ // backend. The shapes come from the official `@agentclientprotocol/sdk`, whose
3
+ // types are generated from the protocol's JSON Schema, so this file only
4
+ // re-exports them under moi's naming and adds the few things the spec does not
5
+ // (yet) cover.
6
+ //
7
+ // The SDK is a **types-only, dev-only** dependency: `dist/schema/types.gen.js`
8
+ // contains no runtime code, and importing values instead (`AGENT_METHODS`,
9
+ // `ClientSideConnection`, …) would pull in zod as a real dependency for the
10
+ // sake of a handful of string constants. Method names below were verified
11
+ // against the SDK's `AGENT_METHODS` / `CLIENT_METHODS` at 1.3.0.
12
+ //
13
+ // ⚠️ Version skew: the shipped agent (Hermes 0.20.0) implements an OLDER
14
+ // revision of ACP than the SDK describes — it pins Python
15
+ // `agent-client-protocol==0.9.0`, which still has a first-class *model*
16
+ // concept. The spec dropped `session/set_model` and `models.availableModels`
17
+ // after `@zed-industries/agent-client-protocol@0.4.5` and replaced them with
18
+ // `session/set_config_option`. Everything under "pre-1.0 additions" below is
19
+ // that gap; delete it once agents move to config options. See
20
+ // ../hermes/NOTES.md §12.
21
+ //
22
+ // Nothing in this folder is Hermes-specific.
23
+
24
+ import type {
25
+ AgentCapabilities,
26
+ ContentBlock,
27
+ ContentChunk,
28
+ InitializeResponse,
29
+ ListSessionsResponse,
30
+ NewSessionResponse,
31
+ PermissionOption,
32
+ PromptResponse,
33
+ RequestPermissionRequest,
34
+ SessionInfo as AcpSessionInfoRow,
35
+ SessionModeState,
36
+ SessionNotification,
37
+ SessionUpdate,
38
+ StopReason,
39
+ ToolCall,
40
+ ToolCallContent,
41
+ ToolCallLocation,
42
+ ToolCallStatus,
43
+ ToolCallUpdate,
44
+ ToolKind,
45
+ Usage
46
+ } from '@agentclientprotocol/sdk'
47
+
48
+ export type {
49
+ AgentCapabilities,
50
+ ContentBlock,
51
+ ContentChunk,
52
+ InitializeResponse,
53
+ ListSessionsResponse,
54
+ PermissionOption,
55
+ PromptResponse,
56
+ RequestPermissionRequest,
57
+ SessionModeState,
58
+ SessionNotification,
59
+ SessionUpdate,
60
+ StopReason,
61
+ ToolCall,
62
+ ToolCallContent,
63
+ ToolCallLocation,
64
+ ToolCallStatus,
65
+ ToolCallUpdate,
66
+ ToolKind,
67
+ Usage
68
+ }
69
+
70
+ // `session/list` rows. Aliased because moi has its own `SessionInfo` in
71
+ // lib/types.ts and the two are different things (this one is the wire row).
72
+ export type AcpSessionListEntry = AcpSessionInfoRow
73
+
74
+ // The prompt request's content blocks. `ContentBlock` is the full union
75
+ // (text | image | audio | resource_link | resource); moi only ever sends the
76
+ // first two, and narrowing here keeps the send path honest.
77
+ export type AcpPromptBlock =
78
+ | { type: 'text'; text: string }
79
+ | { type: 'image'; mimeType: string; data: string }
80
+
81
+ // ---------------------------------------------------------------------------
82
+ // pre-1.0 additions — see the version-skew note in the file header
83
+ // ---------------------------------------------------------------------------
84
+
85
+ // Model selection, as it existed before the spec replaced it with session
86
+ // config options. Hermes returns this inline on `session/new` and answers
87
+ // `session/set_model`.
88
+ export type AcpModelInfo = {
89
+ modelId: string
90
+ name?: string
91
+ description?: string
92
+ }
93
+
94
+ export type AcpModelState = {
95
+ availableModels?: AcpModelInfo[]
96
+ currentModelId?: string
97
+ }
98
+
99
+ // `NewSessionResponse` plus the dropped `models` field.
100
+ export type AcpNewSessionResult = NewSessionResponse & { models?: AcpModelState | null }
101
+
102
+ // ---------------------------------------------------------------------------
103
+ // helpers
104
+ // ---------------------------------------------------------------------------
105
+
106
+ export function isTextBlock(
107
+ block: ContentBlock | undefined
108
+ ): block is ContentBlock & { type: 'text'; text: string } {
109
+ return !!block && block.type === 'text' && typeof (block as { text?: unknown }).text === 'string'
110
+ }
111
+
112
+ // The text of a chunk update, or '' for a non-text block (moi renders images
113
+ // from its own upload store, not from the echo).
114
+ export function chunkText(update: SessionUpdate): string {
115
+ const content = (update as Partial<ContentChunk>).content
116
+ return isTextBlock(content) ? content.text : ''
117
+ }
118
+
119
+ // Flatten a tool call's content array into displayable text. `diff` entries
120
+ // render as their new text — the tool card shows the path separately.
121
+ export function toolContentToText(content: ToolCallContent[] | null | undefined): string {
122
+ if (!content?.length) return ''
123
+ const out: string[] = []
124
+ for (const entry of content) {
125
+ if (entry.type === 'content' && isTextBlock(entry.content)) {
126
+ out.push(entry.content.text)
127
+ } else if (entry.type === 'diff' && typeof entry.newText === 'string') {
128
+ out.push(entry.newText)
129
+ }
130
+ }
131
+ return out.join('\n')
132
+ }
@@ -4,7 +4,7 @@ import type { HarnessAvailability, WorkspaceType } from '@/lib/types'
4
4
 
5
5
  import { cachedLoginShellPath, loginShellPath, mergeSearchPaths } from './shell-path'
6
6
 
7
- type PathWorkspaceType = Extract<WorkspaceType, 'claude-code' | 'codex'>
7
+ type PathWorkspaceType = Extract<WorkspaceType, 'claude-code' | 'codex' | 'hermes'>
8
8
 
9
9
  type ExecutableConfig = {
10
10
  command: string
@@ -31,6 +31,20 @@ const executableConfig: Record<PathWorkspaceType, ExecutableConfig> = {
31
31
  ],
32
32
  unavailableReason:
33
33
  'Run curl -fsSL https://chatgpt.com/codex/install.sh | sh in your terminal to install Codex'
34
+ },
35
+ hermes: {
36
+ command: 'hermes',
37
+ // The installer symlinks `hermes` into ~/.local/bin (per-user) or
38
+ // /usr/local/bin (root), neither of which is guaranteed to be on a GUI
39
+ // app's PATH; the venv entry point is the last resort.
40
+ fallbackPaths: [
41
+ `${process.env.HOME ?? ''}/.local/bin/hermes`,
42
+ '/usr/local/bin/hermes',
43
+ `${process.env.HOME ?? ''}/.hermes/hermes-agent/venv/bin/hermes`,
44
+ '/usr/local/lib/hermes-agent/venv/bin/hermes'
45
+ ],
46
+ unavailableReason:
47
+ 'Run curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash in your terminal to install Hermes'
34
48
  }
35
49
  }
36
50