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.
- package/client/assets/hermes.png +0 -0
- package/client/components/shared/IconGhost.tsx +15 -18
- package/client/components/ui/button.tsx +2 -2
- package/client/components/ui/hover-card.tsx +1 -1
- package/client/components/ui/popover.tsx +3 -1
- package/client/features/chat/ChatEmptyState.tsx +25 -7
- package/client/features/chat/ChatPanel.tsx +70 -28
- package/client/features/chat/ChatPopup.tsx +3 -2
- package/client/features/chat/ChatPromptBubbles.tsx +1 -1
- package/client/features/chat/MarkdownContent.tsx +1 -1
- package/client/features/chat/attachment-staging.ts +153 -0
- package/client/features/chat/chat-send.ts +55 -0
- package/client/features/chat/chat-store.ts +32 -8
- package/client/features/chat/composer/ChatComposer.tsx +190 -77
- package/client/features/chat/{ModelPicker.tsx → composer/ModelPicker.tsx} +29 -25
- package/client/features/chat/composer/banners/ComposerBanner.tsx +1 -1
- package/client/features/chat/composer/banners/WorkspaceAgentAvailabilityBanner.tsx +4 -13
- package/client/features/chat/{model-order.ts → composer/model-order.ts} +16 -0
- package/client/features/chat/composer/useWorkspaceComposerState.tsx +9 -4
- package/client/features/chat/tool-group/format/claude.ts +48 -0
- package/client/features/chat/tool-group/format/codex.ts +126 -0
- package/client/features/chat/tool-group/format/hermes.ts +68 -0
- package/client/features/chat/tool-group/format/index.ts +34 -0
- package/client/features/chat/tool-group/format/mcp.ts +64 -0
- package/client/features/chat/tool-group/format/openclaw.ts +116 -0
- package/client/features/chat/tool-group/format/shared.ts +49 -0
- package/client/features/chat/useChat.ts +5 -10
- package/client/features/dev/ChatStatesPage.tsx +40 -2
- package/client/features/drawings/DrawingLayer.tsx +49 -0
- package/client/features/drawings/DrawingToolbar.tsx +95 -0
- package/client/features/drawings/annotation-availability.ts +10 -0
- package/client/features/drawings/capture-element.ts +45 -0
- package/client/features/drawings/useChatAnnotation.ts +222 -0
- package/client/features/drawings/useDrawingLayer.ts +758 -0
- package/client/features/drawings/useViewBuilderSketch.ts +151 -0
- package/client/features/home/workspace-presentation.tsx +6 -2
- package/client/features/home/workspace-setup/WorkspaceAgentStep.tsx +12 -6
- package/client/features/scratchpad/ScratchpadControls.tsx +19 -5
- package/client/features/views/ViewBuilder.tsx +224 -0
- package/client/features/views/api.ts +1 -0
- package/client/features/views/useViewBuilderActions.ts +24 -3
- package/client/features/views/useViewBuilderDrafts.ts +66 -0
- package/client/features/widgets/Widgets.tsx +23 -39
- package/client/features/workspace/CustomizePanel.tsx +1 -1
- package/client/features/workspace/WorkspaceScreen.tsx +157 -57
- package/client/features/workspace/WorkspaceTabs.tsx +3 -3
- package/client/features/workspace/useFitsSplitLayout.ts +14 -8
- package/client/index.css +8 -0
- package/client/store/ui.ts +19 -0
- package/client/theme.css +33 -8
- package/dist/chunk-3becmq75.js +81 -0
- package/dist/{chunk-kkj86722.js → chunk-6w6j9g4b.js} +78 -78
- package/dist/{chunk-xeyxk7ep.js → chunk-8ew39cvq.js} +4 -4
- package/dist/chunk-c8gtrjwp.js +1 -0
- package/dist/{chunk-2vaafjp4.js → chunk-pp62fnxh.js} +1 -1
- package/dist/{chunk-35fq49qa.js → chunk-sxc24vfp.js} +1 -1
- package/dist/{chunk-xzx7c9hq.js → chunk-v964b5g7.js} +1 -1
- package/dist/chunk-zx33ts9d.css +1 -0
- package/dist/hermes-pznd63x9.png +0 -0
- package/dist/index.html +1 -1
- package/lib/format.ts +21 -7
- package/lib/themes.ts +8 -8
- package/lib/types.ts +8 -1
- package/lib/workspace-types.ts +2 -1
- package/package.json +6 -4
- package/server/api.ts +21 -2
- package/server/bundler/build-applet.ts +35 -44
- package/server/cli-env.ts +2 -2
- package/server/cli.ts +227 -56
- package/server/constants.ts +8 -0
- package/server/control-client.ts +124 -0
- package/server/control.ts +2 -2
- package/server/harness/README.md +74 -23
- package/server/harness/acp/adapter.ts +220 -0
- package/server/harness/acp/archived.ts +88 -0
- package/server/harness/acp/client.ts +328 -0
- package/server/harness/acp/discovery.ts +130 -0
- package/server/harness/acp/run-durations.ts +68 -0
- package/server/harness/acp/session.ts +788 -0
- package/server/harness/acp/wire.ts +132 -0
- package/server/harness/executable.ts +15 -1
- package/server/harness/hermes/NOTES.md +815 -0
- package/server/harness/hermes/discovery.ts +155 -0
- package/server/harness/hermes/index.ts +155 -0
- package/server/harness/hermes/models.ts +79 -0
- package/server/harness/openclaw/NOTES.md +196 -94
- package/server/harness/openclaw/adapter.ts +28 -55
- package/server/harness/openclaw/compat.ts +4 -8
- package/server/harness/openclaw/session.ts +257 -238
- package/server/harness/openclaw/strip.ts +10 -34
- package/server/harness/openclaw/thinking.ts +5 -53
- package/server/harness/registry.ts +3 -1
- package/server/service.ts +2 -2
- package/server/view-builders.ts +4 -2
- package/server/workspace-import.ts +30 -1
- package/workspace/.claude/skills/moi-workspace/SKILL.md +6 -6
- package/client/features/chat/tool-group/format.ts +0 -359
- package/client/features/views/ViewBuilderTab.tsx +0 -152
- package/dist/chunk-gny990qx.css +0 -1
- package/dist/chunk-gt7n06ef.js +0 -1
- package/dist/chunk-n7pga5x3.js +0 -80
- /package/workspace/.claude/skills/moi-workspace/{DESIGN.md → references/DESIGN.md} +0 -0
- /package/workspace/.claude/skills/moi-workspace/{SCRATCHPAD.md → references/SCRATCHPAD.md} +0 -0
|
@@ -5,22 +5,20 @@ import { stripMoiContext } from '@/lib/moi-context'
|
|
|
5
5
|
// The gateway prepends AI-facing envelopes to every user message before storing
|
|
6
6
|
// it: a leading timestamp (`[Fri 2026-04-24 18:12 GMT+2] `), sentinel JSON
|
|
7
7
|
// blocks like `Sender (untrusted metadata):`, delivery hints for the `message`
|
|
8
|
-
// tool, chat-window context blocks
|
|
9
|
-
//
|
|
10
|
-
// bubbles.
|
|
8
|
+
// tool, and chat-window context blocks. These are useful for the model but must
|
|
9
|
+
// never surface in chat bubbles.
|
|
11
10
|
//
|
|
12
11
|
// Canonical source: `src/auto-reply/reply/strip-inbound-meta.ts` in the
|
|
13
12
|
// `openclaw` npm package (bundled as `dist/strip-inbound-meta-*.js`; hint
|
|
14
13
|
// strings in `dist/message-tool-delivery-hints-*.js`). Not re-exported on a
|
|
15
|
-
// stable subpath, so we mirror it here.
|
|
16
|
-
// files and keep this in sync. Last synced against 2026.7.1 (also compared to
|
|
17
|
-
// the 2026.6.33 copy — identical except the chat-window block pass, which is
|
|
18
|
-
// 2026.7.x-only but harmless on 6.x rows).
|
|
14
|
+
// stable subpath, so we mirror it here.
|
|
19
15
|
//
|
|
20
|
-
//
|
|
21
|
-
//
|
|
22
|
-
//
|
|
23
|
-
//
|
|
16
|
+
// You don't have to diff it by hand on a bump: `strip-parity.test.ts` loads the
|
|
17
|
+
// real implementation out of the pinned bundle and asserts this mirror agrees
|
|
18
|
+
// with it case for case. If that test starts failing after `bun install`,
|
|
19
|
+
// upstream moved and this file needs to follow. (It also compares clean against
|
|
20
|
+
// the 2026.6.33 copy — identical except the chat-window block pass, which is
|
|
21
|
+
// 2026.7.x-only but harmless on 6.x rows.)
|
|
24
22
|
|
|
25
23
|
const LEADING_TIMESTAMP_PREFIX_RE = /^\[[A-Za-z]{3} \d{4}-\d{2}-\d{2} \d{2}:\d{2}[^\]]*\] */
|
|
26
24
|
|
|
@@ -30,10 +28,7 @@ const INBOUND_META_SENTINELS = [
|
|
|
30
28
|
'Conversation info (untrusted metadata):',
|
|
31
29
|
'Sender (untrusted metadata):',
|
|
32
30
|
'Thread starter (untrusted, for context):',
|
|
33
|
-
// 2026.6.x+ wording, and the ≤2026.5.x one it replaced — old transcripts
|
|
34
|
-
// replay through `sessions.get`, so both must keep stripping.
|
|
35
31
|
'Reply target of current user message (untrusted, for context):',
|
|
36
|
-
'Replied message (untrusted, for context):',
|
|
37
32
|
'Forwarded message context (untrusted metadata):',
|
|
38
33
|
CHAT_HISTORY_SENTINEL
|
|
39
34
|
]
|
|
@@ -175,25 +170,6 @@ export function stripInboundMetadata(text: string): string {
|
|
|
175
170
|
.replace(LEADING_TIMESTAMP_PREFIX_RE, '')
|
|
176
171
|
}
|
|
177
172
|
|
|
178
|
-
// Removes a leading `[Bootstrap pending]` header plus every following
|
|
179
|
-
// non-empty line up to the first blank line. Upstream produced a fixed 6-line
|
|
180
|
-
// preamble on ≤2026.4.x (see `buildFullBootstrapPromptLines`), but we key off
|
|
181
|
-
// structure rather than exact text so minor wording changes don't leak through.
|
|
182
|
-
export function stripBootstrapPreamble(text: string): string {
|
|
183
|
-
if (!text || !text.startsWith('[Bootstrap pending]')) return text
|
|
184
|
-
const lines = text.split('\n')
|
|
185
|
-
let i = 0
|
|
186
|
-
while (i < lines.length && lines[i] !== '') i += 1
|
|
187
|
-
while (i < lines.length && lines[i] === '') i += 1
|
|
188
|
-
return lines.slice(i).join('\n')
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
// moi-side (not part of the upstream mirror above): the spawn tool wraps a
|
|
192
|
-
// subagent's first user message as
|
|
193
|
-
// "[Subagent Context] <paragraph>\n\n[Subagent Task]\n\n<task>\n\nBegin. …"
|
|
194
|
-
// — surface the task itself in titles/previews/transcripts. Truncated
|
|
195
|
-
// previews/derived titles can cut before the task marker; fall back to a
|
|
196
|
-
// plain label rather than leaking the envelope.
|
|
197
173
|
export function stripSubagentEnvelope(text: string): string {
|
|
198
174
|
if (!text.startsWith('[Subagent Context]')) return text
|
|
199
175
|
const taskAt = text.indexOf('[Subagent Task]')
|
|
@@ -204,5 +180,5 @@ export function stripSubagentEnvelope(text: string): string {
|
|
|
204
180
|
}
|
|
205
181
|
|
|
206
182
|
export function stripUserMessageMetadata(text: string): string {
|
|
207
|
-
return stripSubagentEnvelope(stripMoiContext(stripInboundMetadata(
|
|
183
|
+
return stripSubagentEnvelope(stripMoiContext(stripInboundMetadata(text)))
|
|
208
184
|
}
|
|
@@ -95,60 +95,12 @@ export function recordOpenClawThinkingProfiles(rows: OpenClawThinkingRow[]): voi
|
|
|
95
95
|
for (const row of rows) recordOpenClawThinkingProfile(row)
|
|
96
96
|
}
|
|
97
97
|
|
|
98
|
-
//
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
// Providers that are agent RUNTIMES rather than model catalogs. A session
|
|
105
|
-
// configured with `agentRuntime: { id: 'claude-cli' }` reports the runtime here,
|
|
106
|
-
// so `anthropic/claude-opus-5` (the catalog ref, and what the picker sends)
|
|
107
|
-
// and `claude-cli/claude-opus-5` (what the row reports back) name one model.
|
|
108
|
-
const OPENCLAW_RUNTIME_PROVIDERS = new Set(['claude-cli'])
|
|
109
|
-
|
|
110
|
-
function openClawModelProvider(ref: string): string {
|
|
111
|
-
const slash = ref.lastIndexOf('/')
|
|
112
|
-
return slash === -1 ? '' : ref.slice(0, slash)
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
// Do two refs name the same model? Used by the applied-model cache, which
|
|
116
|
-
// compares the picker's catalog ref against the ref the wire reports. Only a
|
|
117
|
-
// runtime alias collapses the provider — `ollama/kimi-k3:cloud` and
|
|
118
|
-
// `openai/kimi-k3:cloud` are genuinely different models and stay unequal, so a
|
|
119
|
-
// switch between them still patches.
|
|
120
|
-
export function openClawModelRefsEquivalent(a: string, b: string): boolean {
|
|
121
|
-
if (a === b) return true
|
|
122
|
-
if (openClawModelId(a) !== openClawModelId(b)) return false
|
|
123
|
-
const [pa, pb] = [openClawModelProvider(a), openClawModelProvider(b)]
|
|
124
|
-
return OPENCLAW_RUNTIME_PROVIDERS.has(pa) || OPENCLAW_RUNTIME_PROVIDERS.has(pb)
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
// A model served by a CLI backend reports the RUNTIME as its provider, not the
|
|
128
|
-
// catalog one. A session started on `anthropic/claude-opus-5` (its
|
|
129
|
-
// `models.list` ref, and what `sessions.patch {model}` takes) comes back on the
|
|
130
|
-
// wire as `claude-cli/claude-opus-5` — verified live on 2026.7.2-beta.7, where
|
|
131
|
-
// every model configured with `agentRuntime: { id: 'claude-cli' }` does this.
|
|
132
|
-
// Keying only on the exact ref drops those menus on the floor and the picker
|
|
133
|
-
// falls back to the four-level intersection, costing Opus 5 `minimal`,
|
|
134
|
-
// `adaptive`, `xhigh` and `max`.
|
|
135
|
-
//
|
|
136
|
-
// So a miss retries on the bare model id — but only when exactly one recorded
|
|
137
|
-
// provider carries it. `kimi-k3:cloud` genuinely exists under both `ollama` and
|
|
138
|
-
// `openai` with different menus, and guessing between them would offer a level
|
|
139
|
-
// the gateway rejects, which is the failure this module exists to prevent.
|
|
98
|
+
// A model's menu, or null when no session row has reported one yet (the picker
|
|
99
|
+
// then falls back to OPENCLAW_FALLBACK_THINKING_LEVELS). Keyed by the exact
|
|
100
|
+
// `provider/model` ref: `sessions.list` echoes back the provider of the ref
|
|
101
|
+
// that was patched, so what the picker sends is what the rows come back under.
|
|
140
102
|
export function openClawThinkingProfile(modelRef: string): OpenClawThinkingProfile | null {
|
|
141
|
-
|
|
142
|
-
if (exact) return exact
|
|
143
|
-
|
|
144
|
-
const id = openClawModelId(modelRef)
|
|
145
|
-
let match: OpenClawThinkingProfile | null = null
|
|
146
|
-
for (const [ref, profile] of profiles) {
|
|
147
|
-
if (openClawModelId(ref) !== id) continue
|
|
148
|
-
if (match) return null
|
|
149
|
-
match = profile
|
|
150
|
-
}
|
|
151
|
-
return match
|
|
103
|
+
return profiles.get(modelRef) ?? null
|
|
152
104
|
}
|
|
153
105
|
|
|
154
106
|
export function hasOpenClawThinkingProfiles(): boolean {
|
|
@@ -6,6 +6,7 @@ import type { WorkspaceEntry, WorkspaceType } from '@/lib/types'
|
|
|
6
6
|
|
|
7
7
|
import { claudeCodeHarness } from './claude-code'
|
|
8
8
|
import { codexHarness } from './codex'
|
|
9
|
+
import { hermesHarness } from './hermes'
|
|
9
10
|
import { openclawHarness } from './openclaw'
|
|
10
11
|
import type { Harness } from './types'
|
|
11
12
|
|
|
@@ -14,7 +15,8 @@ export type { Harness, HarnessCapabilities, SendMessageInput } from './types'
|
|
|
14
15
|
const harnesses = {
|
|
15
16
|
'claude-code': claudeCodeHarness,
|
|
16
17
|
openclaw: openclawHarness,
|
|
17
|
-
codex: codexHarness
|
|
18
|
+
codex: codexHarness,
|
|
19
|
+
hermes: hermesHarness
|
|
18
20
|
} satisfies Partial<Record<WorkspaceType, Harness>>
|
|
19
21
|
|
|
20
22
|
// An untyped registry entry is a Claude Code workspace (pre-typing legacy).
|
package/server/service.ts
CHANGED
|
@@ -21,7 +21,7 @@ import { copyFile, mkdir, readFile, rm, stat, truncate, writeFile } from 'node:f
|
|
|
21
21
|
import { homedir, userInfo } from 'node:os'
|
|
22
22
|
import { dirname, join } from 'node:path'
|
|
23
23
|
|
|
24
|
-
import {
|
|
24
|
+
import { CONTROL_URL } from './constants'
|
|
25
25
|
import { DATA_DIR } from './data-dir'
|
|
26
26
|
import { mergeSearchPaths } from './harness/shell-path'
|
|
27
27
|
import { PACKAGE_ROOT } from './version'
|
|
@@ -357,7 +357,7 @@ export function queryServerInfo(timeoutMs = 1500): Promise<ServerInfo | null> {
|
|
|
357
357
|
}
|
|
358
358
|
let ws: WebSocket
|
|
359
359
|
try {
|
|
360
|
-
ws = new WebSocket(
|
|
360
|
+
ws = new WebSocket(CONTROL_URL)
|
|
361
361
|
} catch {
|
|
362
362
|
settle(null)
|
|
363
363
|
return
|
package/server/view-builders.ts
CHANGED
|
@@ -145,10 +145,12 @@ export async function beginViewBuilder(
|
|
|
145
145
|
workspaceId: string,
|
|
146
146
|
workspacePath: string,
|
|
147
147
|
builderId: string,
|
|
148
|
-
requirements: string
|
|
148
|
+
requirements: string,
|
|
149
|
+
hasSketch = false
|
|
149
150
|
): Promise<ViewBuilder> {
|
|
150
151
|
const text = requirements.trim()
|
|
151
|
-
if (!text
|
|
152
|
+
if (!text && !hasSketch)
|
|
153
|
+
throw new ViewBuilderError('View requirements or a sketch are required', 400)
|
|
152
154
|
const builder = await mutateBuilders(workspacePath, builders => {
|
|
153
155
|
const [current, index] = findBuilder(builders, builderId)
|
|
154
156
|
if (current.status !== 'draft') {
|
|
@@ -2,6 +2,8 @@ import { resolve } from 'node:path'
|
|
|
2
2
|
|
|
3
3
|
import type { WorkspaceType } from '@/lib/types'
|
|
4
4
|
|
|
5
|
+
import { discoverHermesProfiles } from './harness/hermes/discovery'
|
|
6
|
+
import type { HermesProfile } from './harness/hermes/discovery'
|
|
5
7
|
import { discoverOpenClawAgents } from './harness/openclaw/discovery'
|
|
6
8
|
import type { OpenClawAgent } from './harness/openclaw/discovery'
|
|
7
9
|
|
|
@@ -13,6 +15,7 @@ export type WorkspaceImportMetadata = {
|
|
|
13
15
|
}
|
|
14
16
|
|
|
15
17
|
type DiscoverOpenClawAgents = () => Promise<OpenClawAgent[]>
|
|
18
|
+
type DiscoverHermesProfiles = () => Promise<HermesProfile[]>
|
|
16
19
|
|
|
17
20
|
function compareOpenClawAgents(a: OpenClawAgent, b: OpenClawAgent): number {
|
|
18
21
|
if (a.isDefault !== b.isDefault) return a.isDefault ? -1 : 1
|
|
@@ -20,11 +23,37 @@ function compareOpenClawAgents(a: OpenClawAgent, b: OpenClawAgent): number {
|
|
|
20
23
|
return byLastRun || a.agentId.localeCompare(b.agentId)
|
|
21
24
|
}
|
|
22
25
|
|
|
26
|
+
// A Hermes workspace belongs to a profile, so a UI import has to capture the
|
|
27
|
+
// same metadata `moi hermes init` does. Without it the entry has no agentId —
|
|
28
|
+
// every profile renders as a generic "Hermes agent" and the harness falls back
|
|
29
|
+
// to matching by path at spawn time.
|
|
30
|
+
async function resolveHermesImportMetadata(
|
|
31
|
+
path: string,
|
|
32
|
+
discoverProfiles: DiscoverHermesProfiles
|
|
33
|
+
): Promise<WorkspaceImportMetadata> {
|
|
34
|
+
const normalizedPath = resolve(path)
|
|
35
|
+
const profile = (await discoverProfiles()).find(
|
|
36
|
+
candidate => resolve(candidate.path) === normalizedPath
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
if (!profile) {
|
|
40
|
+
throw new Error('No Hermes profile owns this folder')
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
return {
|
|
44
|
+
...(profile.name ? { name: profile.name } : {}),
|
|
45
|
+
agentId: profile.agentId,
|
|
46
|
+
...(profile.isDefault ? { isDefault: true } : {})
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
23
50
|
export async function resolveWorkspaceImportMetadata(
|
|
24
51
|
path: string,
|
|
25
52
|
type: WorkspaceType,
|
|
26
|
-
discoverAgents: DiscoverOpenClawAgents = discoverOpenClawAgents
|
|
53
|
+
discoverAgents: DiscoverOpenClawAgents = discoverOpenClawAgents,
|
|
54
|
+
discoverProfiles: DiscoverHermesProfiles = discoverHermesProfiles
|
|
27
55
|
): Promise<WorkspaceImportMetadata> {
|
|
56
|
+
if (type === 'hermes') return resolveHermesImportMetadata(path, discoverProfiles)
|
|
28
57
|
if (type !== 'openclaw') return {}
|
|
29
58
|
|
|
30
59
|
const normalizedPath = resolve(path)
|
|
@@ -17,7 +17,7 @@ Workspace features/pages:
|
|
|
17
17
|
- "Widgets" - small reusable full-stack components displayed on the widgets page (dashboard). For
|
|
18
18
|
overview, quick info, status or quick actions.
|
|
19
19
|
- "Scratchpad" - a shared low-fi canvas for prototyping, working on ideas together, visualising
|
|
20
|
-
concepts. Read `SCRATCHPAD.md` before building on or modifying it.
|
|
20
|
+
concepts. Read `references/SCRATCHPAD.md` before building on or modifying it.
|
|
21
21
|
- "Views" - full-stack embedded apps for bigger work, consume more space, live in their own tab.
|
|
22
22
|
|
|
23
23
|
User can switch between these, but can access the chat (this conversation and other chats) from
|
|
@@ -139,7 +139,7 @@ For more options, commands, use `moi help`.
|
|
|
139
139
|
|
|
140
140
|
Every applet — a **Widget** or a **View** — is a default-exported React component in
|
|
141
141
|
`.moi/<type>/<name>.tsx`, optionally paired with a `<name>.server.ts`. `moi bundle` compiles each
|
|
142
|
-
into a live module the browser loads (edits hot-reload). Read `DESIGN.md` first.
|
|
142
|
+
into a live module the browser loads (edits hot-reload). Read `references/DESIGN.md` first.
|
|
143
143
|
Write normal React + Tailwind — below is only what's **moi-specific**.
|
|
144
144
|
|
|
145
145
|
## Anatomy
|
|
@@ -329,7 +329,7 @@ export const config = {
|
|
|
329
329
|
Render **content only**: a plain `h-full w-full` region with no card chrome (`rounded-*`,
|
|
330
330
|
`shadow-*`, or outer `border`) — the dashboard owns the shell, spacing, and elevation. It does not
|
|
331
331
|
own the fill, so the widget must set its own opaque background.
|
|
332
|
-
Changing `colSpan`/`rowSpan` needs `moi bundle --force`. See `DESIGN.md`.
|
|
332
|
+
Changing `colSpan`/`rowSpan` needs `moi bundle --force`. See `references/DESIGN.md`.
|
|
333
333
|
|
|
334
334
|
Typical loop: check/`bun install` deps → write the applet → `moi bundle` → run any checks.
|
|
335
335
|
After the final successful bundle and any checks, always make tab focus the final workspace action:
|
|
@@ -392,7 +392,7 @@ export const config = {
|
|
|
392
392
|
```
|
|
393
393
|
|
|
394
394
|
The inverse of a widget: a view **owns its whole page** — its own `h-full w-full` layout, scrolling
|
|
395
|
-
(`overflow-auto`), padding, and chrome. Build it to read like an app screen. See `DESIGN.md`.
|
|
395
|
+
(`overflow-auto`), padding, and chrome. Build it to read like an app screen. See `references/DESIGN.md`.
|
|
396
396
|
|
|
397
397
|
# Keeping this skill current
|
|
398
398
|
|
|
@@ -401,9 +401,9 @@ This skill is installed with moi (via the CLI or the UI) and can fall behind whe
|
|
|
401
401
|
- **You'll know** — `moi` commands warn you when this skill is behind.
|
|
402
402
|
- **To update** — run `moi skill update`. Never mid-task: finish first, or do it at the end.
|
|
403
403
|
- **Re-read after updating** — `moi skill update` rewrites `SKILL.md` and its companion docs
|
|
404
|
-
(`DESIGN.md` and `SCRATCHPAD.md`) on disk, so the copy already in your context is stale. Re-read
|
|
404
|
+
(`references/DESIGN.md` and `references/SCRATCHPAD.md`) on disk, so the copy already in your context is stale. Re-read
|
|
405
405
|
this `SKILL.md` before you rely on it again — don't act on the old version.
|
|
406
406
|
- **Then** — if you updated, mention it.
|
|
407
407
|
|
|
408
408
|
<!-- moi skill version marker — read by `moi skill` to detect drift; do not edit by hand -->
|
|
409
|
-
<moi-skill version="0.
|
|
409
|
+
<moi-skill version="0.12.0" />
|
|
@@ -1,359 +0,0 @@
|
|
|
1
|
-
// Formatting utils for tool rows: turn a raw ToolCall into the display name and
|
|
2
|
-
// one-line brief, and parse the two MCP call shapes. Pure functions, no React.
|
|
3
|
-
import { relative } from 'pathe'
|
|
4
|
-
|
|
5
|
-
import type { ToolCall } from '@/lib/types'
|
|
6
|
-
|
|
7
|
-
export type McpRef = { server: string; tool: string; rest: string }
|
|
8
|
-
|
|
9
|
-
// Detect a `mcporter call <server>.<tool> [args...]` invocation inside a shell
|
|
10
|
-
// command. Accepts any prefix (env VAR=…, `$(which mcporter)`, `npx mcporter`),
|
|
11
|
-
// stops at the first command separator so a chained command doesn't bleed into
|
|
12
|
-
// `rest`. Returns null for non-`call` invocations.
|
|
13
|
-
export function parseMcporterCall(call: ToolCall): McpRef | null {
|
|
14
|
-
const isShell = call.name === 'Bash' || call.name === 'exec'
|
|
15
|
-
if (!isShell) return null
|
|
16
|
-
const input = (call.input as Record<string, unknown>) ?? {}
|
|
17
|
-
const command = typeof input.command === 'string' ? input.command : ''
|
|
18
|
-
if (!command) return null
|
|
19
|
-
const m = command.match(
|
|
20
|
-
/(?:^|\s|\$\()mcporter(?:\)?)\s+call\s+([A-Za-z0-9_-]+)\.([A-Za-z0-9_-]+)((?:\s+(?!&&|\|\||;|\|)\S+)*)/
|
|
21
|
-
)
|
|
22
|
-
if (!m) return null
|
|
23
|
-
return { server: m[1], tool: m[2], rest: (m[3] ?? '').trim() }
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
// Native MCP tool calls arrive as `mcp__<server>__<tool>` (the server is encoded
|
|
27
|
-
// in the name; `caller` is `model` and `mcpServer` is unset). Server tokens use
|
|
28
|
-
// single underscores, so split on the FIRST `__` after the prefix.
|
|
29
|
-
// e.g. `mcp__notion__notion-search` → notion / notion-search.
|
|
30
|
-
export function parseNativeMcp(call: ToolCall): McpRef | null {
|
|
31
|
-
const name = call.name
|
|
32
|
-
if (!name.startsWith('mcp__')) return null
|
|
33
|
-
const rest = name.slice(5)
|
|
34
|
-
const i = rest.indexOf('__')
|
|
35
|
-
if (i <= 0) return null
|
|
36
|
-
return { server: rest.slice(0, i), tool: rest.slice(i + 2), rest: '' }
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
// Codex MCP calls arrive with a real `mcpServer` field and a plain tool name.
|
|
40
|
-
// Two shapes get the server-branded card:
|
|
41
|
-
// - a call against a configured server (`server: "codex_apps"`), where app
|
|
42
|
-
// tools are dotted `<app>.<tool>` (`resume_io.build_resume_with_templates`)
|
|
43
|
-
// — brand by the app, not the host;
|
|
44
|
-
// - anything else brands by the server itself.
|
|
45
|
-
// Codex's own MCP-management pseudo-tools (`server: "codex"`, or the
|
|
46
|
-
// list/read management names on any server) stay plain rows — they're
|
|
47
|
-
// runtime introspection, not a call INTO a server (see CODEX_TOOL_LABELS).
|
|
48
|
-
export function parseCodexMcp(call: ToolCall): McpRef | null {
|
|
49
|
-
if (call.provider !== 'codex' || !call.mcpServer) return null
|
|
50
|
-
if (call.name in CODEX_TOOL_LABELS) return null
|
|
51
|
-
if (call.mcpServer === 'codex') return null
|
|
52
|
-
const dot = call.name.indexOf('.')
|
|
53
|
-
if (dot > 0) return { server: call.name.slice(0, dot), tool: call.name.slice(dot + 1), rest: '' }
|
|
54
|
-
return { server: call.mcpServer, tool: call.name, rest: '' }
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
// Drop the redundant server prefix many MCP tools repeat — the icon + server name
|
|
58
|
-
// already identify it: `notion-search` → `search`, `notion-get-teams` →
|
|
59
|
-
// `get-teams`. Tools that don't repeat the server pass through unchanged.
|
|
60
|
-
export function formatMcpTool(server: string, tool: string): string {
|
|
61
|
-
const lower = tool.toLowerCase()
|
|
62
|
-
const sep = ['-', '_', '.'].find(s => lower.startsWith(server.toLowerCase() + s))
|
|
63
|
-
return sep ? tool.slice(server.length + 1) : tool
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
function getInputValue(input: Record<string, unknown>, key: string): string {
|
|
67
|
-
const value = input[key]
|
|
68
|
-
return typeof value === 'string' ? value : ''
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
// Compact wall-clock duration in whole seconds: under a minute → "3s", longer
|
|
72
|
-
// → "1m 5s". Used on agent-run and subagent duration labels.
|
|
73
|
-
//
|
|
74
|
-
// Never milliseconds. A column of "Thought for 514ms" / "Thought for 784ms"
|
|
75
|
-
// rows reads as jitter — the exact figure is noise at this size, and the
|
|
76
|
-
// varying width makes the list look ragged next to a plain "Thought for 1s".
|
|
77
|
-
// Sub-second durations round UP so a real pause never renders as "0s".
|
|
78
|
-
export function formatDuration(ms: number): string {
|
|
79
|
-
const s = Math.max(1, Math.round(ms / 1000))
|
|
80
|
-
if (s < 60) return `${s}s`
|
|
81
|
-
const m = Math.floor(s / 60)
|
|
82
|
-
const rem = s % 60
|
|
83
|
-
return rem ? `${m}m ${rem}s` : `${m}m`
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
function makeShortenPaths(cwd: string | null) {
|
|
87
|
-
return (s: string) =>
|
|
88
|
-
s.replace(/\/[^\s"']+/g, p => {
|
|
89
|
-
if (!cwd) return p
|
|
90
|
-
const rel = relative(cwd, p)
|
|
91
|
-
return rel.startsWith('..') ? p : rel
|
|
92
|
-
})
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
// Tool name → user-facing label, picked per provider. Adapters send the raw
|
|
96
|
-
// upstream tool name; the UI humanizes it. Unknown names fall through to the raw
|
|
97
|
-
// name so plugin tools still render something.
|
|
98
|
-
const OPENCLAW_TOOL_LABELS: Record<string, string> = {
|
|
99
|
-
read: 'Read file',
|
|
100
|
-
write: 'Write file',
|
|
101
|
-
edit: 'Edit file',
|
|
102
|
-
apply_patch: 'Edit',
|
|
103
|
-
exec: 'Bash',
|
|
104
|
-
// 2026.7.2+ renamed the shell tool `bash` and split filesystem tools out.
|
|
105
|
-
bash: 'Bash',
|
|
106
|
-
ls: 'List files',
|
|
107
|
-
find: 'Find files',
|
|
108
|
-
grep: 'Search',
|
|
109
|
-
process: 'Manage process',
|
|
110
|
-
web_search: 'Web search',
|
|
111
|
-
web_fetch: 'Fetch',
|
|
112
|
-
sessions_list: 'List sessions',
|
|
113
|
-
sessions_history: 'Recall session',
|
|
114
|
-
sessions_yield: 'Yield to session',
|
|
115
|
-
sessions_send: 'Send to session',
|
|
116
|
-
sessions_spawn: 'Spawn session',
|
|
117
|
-
subagents: 'Run sub-agent',
|
|
118
|
-
agents_list: 'List agents',
|
|
119
|
-
session_status: 'Session status',
|
|
120
|
-
image: 'Analyze image',
|
|
121
|
-
image_generate: 'Generate image',
|
|
122
|
-
memory_get: 'Read memory',
|
|
123
|
-
memory_search: 'Search memory',
|
|
124
|
-
update_plan: 'Update plan',
|
|
125
|
-
message: 'Send message',
|
|
126
|
-
browser: 'Browser',
|
|
127
|
-
canvas: 'Canvas',
|
|
128
|
-
cron: 'Cron',
|
|
129
|
-
gateway: 'Gateway',
|
|
130
|
-
code_execution: 'Run Python',
|
|
131
|
-
tts: 'Text-to-speech',
|
|
132
|
-
music_generate: 'Generate music',
|
|
133
|
-
video_generate: 'Generate video',
|
|
134
|
-
x_search: 'Search X'
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
// Claude tool names are mostly already presentable (Read, Bash, …); only a few
|
|
138
|
-
// need spacing/relabelling.
|
|
139
|
-
const CLAUDE_TOOL_LABELS: Record<string, string> = {
|
|
140
|
-
ToolSearch: 'Tool search',
|
|
141
|
-
WebSearch: 'Web search',
|
|
142
|
-
WebFetch: 'Web fetch'
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
// Codex emits semantic items, which the adapter maps to a small fixed set of
|
|
146
|
-
// tool names (plus raw MCP tool names, which fall through unchanged).
|
|
147
|
-
const CODEX_TOOL_LABELS: Record<string, string> = {
|
|
148
|
-
exec: 'Bash',
|
|
149
|
-
apply_patch: 'Edit',
|
|
150
|
-
web_search: 'Web search',
|
|
151
|
-
update_plan: 'Update plan',
|
|
152
|
-
subagent: 'Run sub-agent',
|
|
153
|
-
subagent_activity: 'Sub-agent',
|
|
154
|
-
review: 'Review',
|
|
155
|
-
view_image: 'View image',
|
|
156
|
-
generate_image: 'Generate image',
|
|
157
|
-
// MCP-management introspection (can arrive under any server, incl. the
|
|
158
|
-
// "codex" pseudo-server) — plain rows, never the server-branded card.
|
|
159
|
-
list_mcp_resources: 'List MCP resources',
|
|
160
|
-
list_mcp_resource_templates: 'List MCP templates',
|
|
161
|
-
read_mcp_resource: 'Read MCP resource'
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
// Codex classifies each shell command itself (`commandActions`, one entry per
|
|
165
|
-
// piped command). When every action agrees on a type, use a CC-style semantic
|
|
166
|
-
// label instead of "Bash".
|
|
167
|
-
type CodexCommandAction = { type?: string; name?: string; path?: string; query?: string | null }
|
|
168
|
-
|
|
169
|
-
const CODEX_ACTION_LABELS: Record<string, string> = {
|
|
170
|
-
read: 'Read',
|
|
171
|
-
listFiles: 'List files',
|
|
172
|
-
search: 'Search'
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
function codexExecAction(input: unknown): CodexCommandAction | null {
|
|
176
|
-
const actions = (input as { commandActions?: unknown } | null)?.commandActions
|
|
177
|
-
if (!Array.isArray(actions) || actions.length === 0) return null
|
|
178
|
-
const first = actions[0] as CodexCommandAction
|
|
179
|
-
const type = first?.type
|
|
180
|
-
if (!type || !(type in CODEX_ACTION_LABELS)) return null
|
|
181
|
-
if (actions.some(a => (a as CodexCommandAction)?.type !== type)) return null
|
|
182
|
-
return first
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
// Codex collab tool actions (`input.action` on the `subagent` card). `wait`
|
|
186
|
-
// never reaches the UI — the adapter drops it.
|
|
187
|
-
const CODEX_SUBAGENT_ACTION_LABELS: Record<string, string> = {
|
|
188
|
-
spawn_agent: 'Run sub-agent',
|
|
189
|
-
send_input: 'Message the agent',
|
|
190
|
-
resume_agent: 'Resume the agent',
|
|
191
|
-
close_agent: 'Stopping the agent'
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
export function getToolDisplayName(call: ToolCall): string {
|
|
195
|
-
if (call.provider === 'openclaw') return OPENCLAW_TOOL_LABELS[call.name] ?? call.name
|
|
196
|
-
if (call.provider === 'codex') {
|
|
197
|
-
if (call.name === 'exec') {
|
|
198
|
-
const action = codexExecAction(call.input)
|
|
199
|
-
if (action?.type) return CODEX_ACTION_LABELS[action.type]
|
|
200
|
-
}
|
|
201
|
-
if (call.name === 'subagent') {
|
|
202
|
-
const action = (call.input as { action?: unknown } | null)?.action
|
|
203
|
-
if (typeof action === 'string' && action in CODEX_SUBAGENT_ACTION_LABELS) {
|
|
204
|
-
return CODEX_SUBAGENT_ACTION_LABELS[action]
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
return CODEX_TOOL_LABELS[call.name] ?? call.name
|
|
208
|
-
}
|
|
209
|
-
return CLAUDE_TOOL_LABELS[call.name] ?? call.name
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
// Short tool label from a fully-qualified MCP tool name: `mcp__notion__notion-
|
|
213
|
-
// search` → `notion-search` (drop the `mcp__<server>__` prefix). Plain names
|
|
214
|
-
// pass through.
|
|
215
|
-
function shortToolName(name: string): string {
|
|
216
|
-
if (!name.startsWith('mcp__')) return name
|
|
217
|
-
const parts = name.slice(5).split('__')
|
|
218
|
-
return parts.length >= 2 ? parts.slice(1).join('__') : parts[0]
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
export function formatInputBrief(call: ToolCall, cwd: string | null): string {
|
|
222
|
-
const input = (call.input as Record<string, unknown>) ?? {}
|
|
223
|
-
const shorten = makeShortenPaths(cwd)
|
|
224
|
-
if (call.provider === 'openclaw') return formatOpenClawBrief(call.name, input, shorten)
|
|
225
|
-
if (call.provider === 'codex') return formatCodexBrief(call.name, input, shorten)
|
|
226
|
-
return formatClaudeBrief(call.name, input, shorten)
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
function formatCodexBrief(
|
|
230
|
-
tool: string,
|
|
231
|
-
input: Record<string, unknown>,
|
|
232
|
-
shorten: (s: string) => string
|
|
233
|
-
): string {
|
|
234
|
-
if (tool === 'exec') {
|
|
235
|
-
// Semantic brief when Codex classified the command (label says Read/
|
|
236
|
-
// Search/List files); raw command otherwise.
|
|
237
|
-
const action = codexExecAction(input)
|
|
238
|
-
if (action?.type === 'read') return shorten(action.path || action.name || '')
|
|
239
|
-
if (action?.type === 'search')
|
|
240
|
-
return [action.query && `/${action.query}/`, action.path && shorten(action.path)]
|
|
241
|
-
.filter(Boolean)
|
|
242
|
-
.join(' ')
|
|
243
|
-
if (action?.type === 'listFiles') return action.path ? shorten(action.path) : ''
|
|
244
|
-
return shorten(`$ ${getInputValue(input, 'command')}`)
|
|
245
|
-
}
|
|
246
|
-
if (tool === 'apply_patch') {
|
|
247
|
-
// The adapter sends structured per-file changes: [{ path, kind, diff }].
|
|
248
|
-
const changes = input.changes
|
|
249
|
-
if (Array.isArray(changes)) {
|
|
250
|
-
const paths = changes
|
|
251
|
-
.map(c => (c && typeof c === 'object' ? (c as { path?: unknown }).path : undefined))
|
|
252
|
-
.filter((p): p is string => typeof p === 'string')
|
|
253
|
-
.map(shorten)
|
|
254
|
-
return paths.join(', ')
|
|
255
|
-
}
|
|
256
|
-
return ''
|
|
257
|
-
}
|
|
258
|
-
if (tool === 'web_search') {
|
|
259
|
-
// Multi-query fan-outs carry every query in `queries`; single searches
|
|
260
|
-
// just have `query`.
|
|
261
|
-
const queries = input.queries
|
|
262
|
-
if (Array.isArray(queries) && queries.length > 0) {
|
|
263
|
-
return queries.filter((q): q is string => typeof q === 'string').join(' · ')
|
|
264
|
-
}
|
|
265
|
-
return getInputValue(input, 'query')
|
|
266
|
-
}
|
|
267
|
-
if (tool === 'update_plan') {
|
|
268
|
-
const plan = input.plan
|
|
269
|
-
return typeof plan === 'string' ? plan.split('\n')[0] : ''
|
|
270
|
-
}
|
|
271
|
-
if (tool === 'subagent') {
|
|
272
|
-
// The label already names the action; the brief carries the text being
|
|
273
|
-
// sent (spawn prompt, send_input/resume_agent message). close_agent has
|
|
274
|
-
// none — the label alone reads fine.
|
|
275
|
-
if (getInputValue(input, 'action') === 'close_agent') return ''
|
|
276
|
-
return getInputValue(input, 'prompt')
|
|
277
|
-
}
|
|
278
|
-
if (tool === 'subagent_activity') return getInputValue(input, 'kind')
|
|
279
|
-
if (tool === 'generate_image') return getInputValue(input, 'prompt').split('\n')[0]
|
|
280
|
-
if (tool === 'read_mcp_resource') return getInputValue(input, 'uri')
|
|
281
|
-
if (tool === 'list_mcp_resources' || tool === 'list_mcp_resource_templates')
|
|
282
|
-
return getInputValue(input, 'server')
|
|
283
|
-
return ''
|
|
284
|
-
}
|
|
285
|
-
|
|
286
|
-
function formatClaudeBrief(
|
|
287
|
-
tool: string,
|
|
288
|
-
input: Record<string, unknown>,
|
|
289
|
-
shorten: (s: string) => string
|
|
290
|
-
): string {
|
|
291
|
-
if (tool === 'Bash') return shorten(`$ ${getInputValue(input, 'command')}`)
|
|
292
|
-
if (tool === 'Read' || tool === 'Write' || tool === 'Edit')
|
|
293
|
-
return shorten(getInputValue(input, 'file_path'))
|
|
294
|
-
if (tool === 'Glob') return shorten(getInputValue(input, 'pattern'))
|
|
295
|
-
if (tool === 'Grep')
|
|
296
|
-
return `/${getInputValue(input, 'pattern')}/ ${shorten(getInputValue(input, 'path'))}`
|
|
297
|
-
if (tool === 'WebSearch') return getInputValue(input, 'query')
|
|
298
|
-
if (tool === 'WebFetch') return getInputValue(input, 'url')
|
|
299
|
-
if (tool === 'ToolSearch') {
|
|
300
|
-
const query = getInputValue(input, 'query')
|
|
301
|
-
// `select:a,b,c` loads those tools → list their short names; otherwise it's a
|
|
302
|
-
// free-text discovery query → show it as-is.
|
|
303
|
-
if (query.startsWith('select:')) return query.slice(7).split(',').map(shortToolName).join(', ')
|
|
304
|
-
return query
|
|
305
|
-
}
|
|
306
|
-
return ''
|
|
307
|
-
}
|
|
308
|
-
|
|
309
|
-
function formatOpenClawBrief(
|
|
310
|
-
tool: string,
|
|
311
|
-
input: Record<string, unknown>,
|
|
312
|
-
shorten: (s: string) => string
|
|
313
|
-
): string {
|
|
314
|
-
if (tool === 'read' || tool === 'write' || tool === 'edit')
|
|
315
|
-
return shorten(getInputValue(input, 'path'))
|
|
316
|
-
if (tool === 'apply_patch') {
|
|
317
|
-
const patch = getInputValue(input, 'patch')
|
|
318
|
-
const firstLine = patch.split('\n').find(l => l.startsWith('*** ')) ?? patch.split('\n')[0]
|
|
319
|
-
return shorten(firstLine ?? '')
|
|
320
|
-
}
|
|
321
|
-
if (tool === 'exec' || tool === 'bash') {
|
|
322
|
-
// `command` on 2026.7.1 + the newer `bash` tool; the 2026.7.2 exec sandbox
|
|
323
|
-
// instead carries a `code` script (JS that shells out) — show whichever.
|
|
324
|
-
const command = getInputValue(input, 'command') || getInputValue(input, 'code')
|
|
325
|
-
return command ? shorten(`$ ${command}`) : ''
|
|
326
|
-
}
|
|
327
|
-
if (tool === 'ls' || tool === 'find' || tool === 'grep')
|
|
328
|
-
return shorten(getInputValue(input, 'path') || getInputValue(input, 'pattern'))
|
|
329
|
-
if (tool === 'process') {
|
|
330
|
-
const action = getInputValue(input, 'action')
|
|
331
|
-
const name = getInputValue(input, 'name')
|
|
332
|
-
return [action, name].filter(Boolean).join(' ') || shorten(getInputValue(input, 'command'))
|
|
333
|
-
}
|
|
334
|
-
if (tool === 'web_search' || tool === 'x_search') return getInputValue(input, 'query')
|
|
335
|
-
if (tool === 'web_fetch') return getInputValue(input, 'url')
|
|
336
|
-
if (tool === 'memory_search') return getInputValue(input, 'query')
|
|
337
|
-
if (tool === 'memory_get') return getInputValue(input, 'key') || getInputValue(input, 'name')
|
|
338
|
-
if (tool === 'sessions_history' || tool === 'sessions_send' || tool === 'sessions_yield')
|
|
339
|
-
return getInputValue(input, 'sessionKey') || getInputValue(input, 'agentId')
|
|
340
|
-
if (tool === 'sessions_list' || tool === 'agents_list') return getInputValue(input, 'agentId')
|
|
341
|
-
if (tool === 'subagents' || tool === 'sessions_spawn')
|
|
342
|
-
return getInputValue(input, 'task') || getInputValue(input, 'agentId')
|
|
343
|
-
if (tool === 'image' || tool === 'image_generate')
|
|
344
|
-
return getInputValue(input, 'prompt') || shorten(getInputValue(input, 'path'))
|
|
345
|
-
if (tool === 'message') return getInputValue(input, 'recipient') || getInputValue(input, 'to')
|
|
346
|
-
if (tool === 'update_plan') {
|
|
347
|
-
const plan = input.plan
|
|
348
|
-
if (Array.isArray(plan)) {
|
|
349
|
-
const inProgress = plan.find(
|
|
350
|
-
(p): p is { step: string } =>
|
|
351
|
-
!!p && typeof p === 'object' && (p as { status?: unknown }).status === 'in_progress'
|
|
352
|
-
)
|
|
353
|
-
const step = inProgress?.step ?? (plan[0] as { step?: unknown })?.step
|
|
354
|
-
if (typeof step === 'string') return step
|
|
355
|
-
}
|
|
356
|
-
return ''
|
|
357
|
-
}
|
|
358
|
-
return ''
|
|
359
|
-
}
|