moi-computer 0.13.1-next.0 → 0.13.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/api/app-config.ts +12 -2
- package/client/api/http.ts +11 -1
- package/client/app/app-router.tsx +3 -2
- package/client/app/routes/home-route.tsx +1 -1
- package/client/app/routes/workspace-registration.tsx +68 -0
- package/client/app/routes/workspace-route.tsx +37 -13
- package/client/app/shell/sidebar-layout.tsx +10 -5
- package/client/components/shared/workspace-icon.tsx +8 -17
- package/client/features/account/account-test-utils.tsx +18 -4
- package/client/features/account/api.ts +10 -8
- package/client/features/account/profile-actions.ts +5 -7
- package/client/features/app-settings/avatar-upload.tsx +62 -0
- package/client/features/app-settings/profile-settings.tsx +10 -0
- package/client/features/app-settings/settings-page.tsx +2 -1
- package/client/features/applets/api.ts +6 -6
- package/client/features/applets/applet-cache.ts +6 -5
- package/client/features/applets/applet-log.ts +2 -1
- package/client/features/applets/applet-runtime.ts +2 -1
- package/client/features/applets/use-applet.ts +73 -18
- package/client/features/applets/widget-shell.tsx +4 -2
- package/client/features/chat/applet-chat-intents.ts +5 -13
- package/client/features/chat/chat-popup.tsx +8 -4
- package/client/features/chat/chat-send.ts +2 -2
- package/client/features/chat/composer/model-order.ts +4 -4
- package/client/features/chat/composer/model-picker.tsx +12 -10
- package/client/features/chat/composer/use-workspace-composer-state.tsx +1 -1
- package/client/features/chat/sessions/api.ts +11 -28
- package/client/features/chat/sessions/use-selected-session.ts +18 -100
- package/client/features/chat/use-chat.ts +8 -12
- package/client/features/collab/applet-api.ts +1 -1
- package/client/features/collab/components/cursors.tsx +6 -1
- package/client/features/collab/components/presence-avatars.tsx +1 -1
- package/client/features/collab/components/presence-frame.tsx +1 -1
- package/client/features/collab/components/presence-group.tsx +1 -1
- package/client/features/collab/components/presence-helpers.ts +2 -2
- package/client/features/collab/components/user-avatar-group.tsx +1 -1
- package/client/features/collab/components/user-avatar.tsx +1 -1
- package/client/features/collab/components/user.tsx +1 -1
- package/client/features/collab/index.ts +3 -3
- package/client/features/collab/members/api.ts +17 -0
- package/client/features/collab/members/hooks.ts +97 -0
- package/client/features/collab/members/store.ts +148 -0
- package/client/features/{workspace-members → collab/members}/types.ts +7 -5
- package/client/features/collab/{client.ts → presence/client.ts} +4 -5
- package/client/features/collab/{hooks.tsx → presence/hooks.tsx} +1 -1
- package/client/features/collab/{provider.tsx → presence/provider.tsx} +1 -12
- package/client/features/collab/{users.ts → presence/users.ts} +19 -21
- package/client/features/collab/proxy-user.ts +1 -3
- package/client/features/collab/sharing/agent-invite.tsx +30 -0
- package/client/features/collab/sharing/workspace-members.tsx +269 -0
- package/client/features/collab/sharing/workspace-sharing-menu.tsx +179 -0
- package/client/features/collab/testing/component-fixtures.tsx +3 -3
- package/client/features/collab/testing/fake-engine.ts +2 -2
- package/client/features/dev/chat-states-page.tsx +3 -1
- package/client/features/dev/collab/collab-playground.tsx +2 -2
- package/client/features/dev/dev-index-page.tsx +0 -6
- package/client/features/dev/dev-routes.tsx +0 -2
- package/client/features/dev/harness-debug-page.tsx +7 -7
- package/client/features/dev/workspace-setup-mocks.ts +1 -2
- package/client/features/dev/workspace-setup-preview.tsx +6 -4
- package/client/features/harness/api.ts +13 -10
- package/client/features/harness/harness-login-panel.tsx +9 -5
- package/client/features/harness/harness-presentation.ts +4 -4
- package/client/features/harness/harness-selector.tsx +13 -13
- package/client/features/harness/use-harness-login.ts +5 -5
- package/client/features/home/api.ts +38 -2
- package/client/features/home/home-page.tsx +43 -13
- package/client/features/home/shared-workspaces.tsx +70 -0
- package/client/features/home/workspace-invitations.tsx +101 -0
- package/client/features/identity/host-api.ts +5 -4
- package/client/features/identity/store.ts +1 -7
- package/client/features/onboarding/agent-setup-step.tsx +8 -8
- package/client/features/onboarding/onboarding-page.tsx +3 -2
- package/client/features/onboarding/workspace-setup-step.tsx +1 -1
- package/client/features/overview/api.ts +3 -5
- package/client/features/overview/default/registry.tsx +1 -1
- package/client/features/overview/default/views-widget.tsx +2 -2
- package/client/features/overview/hidden-panel.tsx +7 -5
- package/client/features/overview/overview.tsx +18 -16
- package/client/features/overview/workspace-name.tsx +2 -2
- package/client/features/scratchpad/scratchpad.tsx +9 -7
- package/client/features/scratchpad/use-scratchpad-snapshot.tsx +13 -5
- package/client/features/views/api.ts +34 -16
- package/client/features/views/use-view-actions.ts +10 -20
- package/client/features/views/view-manager.tsx +1 -1
- package/client/features/views/view-submission.ts +2 -21
- package/client/features/workspace/add/api.ts +5 -4
- package/client/features/workspace/add/create-workspace-dialog.tsx +12 -9
- package/client/features/workspace/add/import-workspace-dialog.tsx +7 -7
- package/client/features/workspace/add/use-workspace-import.ts +10 -10
- package/client/features/workspace/add/workspace-agent-options.ts +21 -20
- package/client/features/workspace/add/workspace-agent-selector.tsx +11 -11
- package/client/features/workspace/api.ts +60 -13
- package/client/features/workspace/harness-transition.ts +7 -13
- package/client/features/workspace/remote.ts +25 -0
- package/client/features/workspace/settings/api.ts +7 -12
- package/client/features/workspace/settings/connectors-settings.tsx +3 -3
- package/client/features/workspace/settings/general-settings.tsx +8 -8
- package/client/features/workspace/setup/workspace-login-state.tsx +4 -4
- package/client/features/workspace/setup/workspace-recovery-states.tsx +43 -14
- package/client/features/workspace/setup/workspace-setup.tsx +6 -6
- package/client/features/workspace/tab-resolution.ts +2 -2
- package/client/features/workspace/use-workspace-navigation.ts +7 -4
- package/client/features/workspace/workspace-content.tsx +32 -26
- package/client/features/workspace/workspace-frame.tsx +13 -26
- package/client/features/workspace/workspace-layout-context.tsx +45 -12
- package/client/features/workspace/workspace-menu.tsx +2 -2
- package/client/features/workspace/workspace-pane.tsx +22 -0
- package/client/features/workspace/workspace-pending-screen.tsx +1 -1
- package/client/features/workspace/workspace-preferences.ts +34 -0
- package/client/features/workspace/workspace-presentation.tsx +12 -16
- package/client/features/workspace/workspace-screen.tsx +2 -2
- package/client/features/workspace/workspace-state.ts +2 -1
- package/client/features/workspace/workspace-tabs.tsx +1 -1
- package/client/features/workspace/workspace-test-utils.ts +23 -0
- package/client/runtime/use-workspace-events.ts +14 -0
- package/client/runtime/workspace-events.ts +9 -9
- package/client/store/ui.ts +29 -9
- package/dist/chunk-44khk4sp.js +2 -0
- package/dist/chunk-ba6mz56s.js +72 -0
- package/dist/chunk-ec5ennpv.js +1 -0
- package/dist/chunk-ectsnw81.js +2 -0
- package/dist/chunk-en7w5ypg.js +1 -0
- package/dist/chunk-f695wcx5.js +5 -0
- package/dist/chunk-kffcah9w.css +1 -0
- package/dist/{chunk-kdgk4dac.js → chunk-n0fawy9x.js} +1 -1
- package/dist/chunk-pdt9hxfw.js +2 -0
- package/dist/chunk-rmd0ctfx.js +546 -0
- package/dist/chunk-zv22wv0g.js +1 -0
- package/dist/index.html +1 -1
- package/lib/harness-instructions.ts +4 -4
- package/lib/harness-types.ts +13 -0
- package/lib/types.ts +34 -50
- package/lib/workspace-config.ts +48 -0
- package/lib/workspace-layout.ts +2 -4
- package/package.json +4 -2
- package/server/README.md +29 -27
- package/server/api/harnesses.ts +5 -5
- package/server/api/index.ts +170 -68
- package/server/app-config.ts +2 -7
- package/server/applets/declarations.ts +6 -7
- package/server/applets/index.ts +15 -9
- package/server/applets/views.ts +2 -17
- package/server/applets/widgets.ts +3 -2
- package/server/cli/commands/config.ts +8 -20
- package/server/cli/commands/hermes.ts +2 -2
- package/server/cli/commands/init.ts +96 -64
- package/server/cli/commands/openclaw.ts +2 -2
- package/server/cli/commands/refresh.ts +10 -1
- package/server/cli/commands/remote.ts +228 -0
- package/server/cli/commands/skill.ts +4 -4
- package/server/cli/commands/tabs.ts +5 -12
- package/server/cli/control.ts +35 -4
- package/server/cli/index.ts +10 -6
- package/server/cli/remote-command.ts +77 -0
- package/server/cli/remote-control.ts +70 -0
- package/server/cli/remote-operations.ts +244 -0
- package/server/collab/config.ts +4 -8
- package/server/collab/manager.ts +5 -2
- package/server/collab/skill/index.ts +4 -50
- package/server/control.ts +38 -11
- package/server/harness/acp/session.ts +4 -4
- package/server/harness/auth.ts +26 -31
- package/server/harness/claude-code/index.ts +1 -1
- package/server/harness/codex/discovery.ts +1 -1
- package/server/harness/codex/session.ts +1 -1
- package/server/harness/detect.ts +14 -19
- package/server/harness/executable.ts +10 -10
- package/server/harness/hermes/NOTES.md +2 -2
- package/server/harness/hermes/index.ts +1 -1
- package/server/harness/install.ts +11 -11
- package/server/harness/openclaw/index.ts +1 -1
- package/server/harness/registry.ts +7 -6
- package/server/harness/types.ts +4 -4
- package/server/onboarding/jobs.ts +1 -1
- package/server/operations/commands.ts +46 -0
- package/server/operations/files.ts +148 -0
- package/server/operations/server.ts +206 -0
- package/server/remote/agent.ts +103 -0
- package/server/remote/client.ts +665 -0
- package/server/remote/workspace.ts +34 -0
- package/server/scratchpad/document.ts +32 -12
- package/server/scratchpad/executor.ts +16 -7
- package/server/sessions/config.ts +8 -5
- package/server/sessions/pending-views.ts +16 -0
- package/server/sessions/view-sessions.ts +10 -12
- package/server/skills/locations.ts +4 -4
- package/server/skills/template.ts +3 -2
- package/server/skills/update.ts +12 -12
- package/server/skills/version.ts +7 -7
- package/server/skills/workspace.ts +13 -13
- package/server/web.ts +12 -10
- package/server/workspace-state/file.ts +2 -0
- package/server/workspace-state/index.ts +0 -4
- package/server/workspaces/api.ts +28 -0
- package/server/workspaces/change-harness.ts +15 -26
- package/server/workspaces/import.ts +4 -4
- package/server/workspaces/init.ts +15 -13
- package/server/workspaces/layout.ts +60 -66
- package/server/workspaces/registry.ts +43 -18
- package/server/workspaces/scaffold.ts +1 -0
- package/server/workspaces/shared.ts +74 -0
- package/server/workspaces/tabs.ts +6 -12
- package/skill/SKILL.md +24 -4
- package/client/api/app-ui-keys.ts +0 -6
- package/client/features/chat/sessions/browser-tab-state.ts +0 -43
- package/client/features/collab/workspace-users-menu.tsx +0 -190
- package/client/features/dev/cloud-avatar-upload.tsx +0 -58
- package/client/features/dev/cloud-page.tsx +0 -363
- package/client/features/workspace/browser-tab-state.ts +0 -51
- package/client/features/workspace/layout-save.ts +0 -13
- package/client/features/workspace-members/api.ts +0 -20
- package/client/features/workspace-members/hooks.ts +0 -127
- package/client/features/workspace-members/keys.ts +0 -6
- package/client/features/workspace-members/store.ts +0 -123
- package/dist/chunk-00s35r33.js +0 -546
- package/dist/chunk-7rz6g7g7.js +0 -1
- package/dist/chunk-af2jyddf.js +0 -2
- package/dist/chunk-cekekc3f.css +0 -1
- package/dist/chunk-ep5vh16c.js +0 -75
- package/dist/chunk-s5s1vzdw.js +0 -2
- package/dist/chunk-svxhxfeq.js +0 -2
- package/dist/chunk-t0r0bds1.js +0 -1
- package/dist/chunk-vp2qzc0d.js +0 -1
- package/dist/chunk-wz5qv1bn.js +0 -2
- package/lib/workspace-types.ts +0 -13
- package/server/workspace-state/legacy-migration.ts +0 -79
- /package/client/features/collab/{presence-publisher.ts → presence/presence-publisher.ts} +0 -0
- /package/client/features/collab/{presence-target.ts → presence/presence-target.ts} +0 -0
- /package/client/features/collab/{store.ts → presence/store.ts} +0 -0
package/server/control.ts
CHANGED
|
@@ -27,7 +27,11 @@ import { assembleTabRows, assertNavigableTab } from './workspaces/tabs'
|
|
|
27
27
|
import { applyThemeUpdate } from './workspaces/theme'
|
|
28
28
|
import { handleBundle } from './applets/widgets'
|
|
29
29
|
import { getWorkspaceViews, handleBundleViews } from './applets/views'
|
|
30
|
-
import {
|
|
30
|
+
import {
|
|
31
|
+
completeRemoteViewBuilds,
|
|
32
|
+
updatePendingView,
|
|
33
|
+
PendingViewError
|
|
34
|
+
} from './sessions/pending-views'
|
|
31
35
|
import { createViewFromSession, ViewStartupError } from './sessions/view-sessions'
|
|
32
36
|
import {
|
|
33
37
|
getWorkspaceConfig,
|
|
@@ -138,7 +142,13 @@ export const control = Bun.serve({
|
|
|
138
142
|
}[] = []
|
|
139
143
|
await serializeWorkspaceBundle(workspacePath, async () => {
|
|
140
144
|
if (only?.segment !== 'views') {
|
|
141
|
-
for (const r of await handleBundle(
|
|
145
|
+
for (const r of await handleBundle(
|
|
146
|
+
publishEvent,
|
|
147
|
+
match.id,
|
|
148
|
+
workspacePath,
|
|
149
|
+
force,
|
|
150
|
+
only?.id
|
|
151
|
+
)) {
|
|
142
152
|
if (!only?.id || r.name === only.id) {
|
|
143
153
|
results.push({ kind: 'widget', name: r.name, status: r.status, error: r.error })
|
|
144
154
|
}
|
|
@@ -319,11 +329,8 @@ export const control = Bun.serve({
|
|
|
319
329
|
if (data.type === 'tabs') {
|
|
320
330
|
const match = await resolveWorkspace(ws, data.path)
|
|
321
331
|
if (!match) return
|
|
322
|
-
const
|
|
323
|
-
|
|
324
|
-
getWorkspaceViews(match)
|
|
325
|
-
])
|
|
326
|
-
ws.send(JSON.stringify({ ok: true, tabs: assembleTabRows(views, layout.tabs.active) }))
|
|
332
|
+
const views = await getWorkspaceViews(match)
|
|
333
|
+
ws.send(JSON.stringify({ ok: true, tabs: assembleTabRows(views) }))
|
|
327
334
|
return
|
|
328
335
|
}
|
|
329
336
|
|
|
@@ -336,7 +343,9 @@ export const control = Bun.serve({
|
|
|
336
343
|
if (!href.startsWith('moi:/') || href.startsWith('moi:/files/'))
|
|
337
344
|
throw new Error('Navigation needs a workspace page address')
|
|
338
345
|
const tab = href.slice(5).split('?', 1)[0]
|
|
339
|
-
|
|
346
|
+
// A linked folder's views live on the owner; the browser checks the tab itself.
|
|
347
|
+
if (isWorkspaceTabId(tab) && !match.remote)
|
|
348
|
+
assertNavigableTab(tab, await getWorkspaceViews(match))
|
|
340
349
|
await navigationRelay.navigate(match.id, href)
|
|
341
350
|
ws.send(JSON.stringify({ ok: true, href }))
|
|
342
351
|
} catch (error) {
|
|
@@ -349,24 +358,42 @@ export const control = Bun.serve({
|
|
|
349
358
|
return
|
|
350
359
|
}
|
|
351
360
|
|
|
361
|
+
// Sent by the CLI after a build on a remote workspace's owner.
|
|
362
|
+
if (data.type === 'views:reconcile') {
|
|
363
|
+
const match = await resolveWorkspace(ws, data.path)
|
|
364
|
+
if (!match) return
|
|
365
|
+
await completeRemoteViewBuilds(match)
|
|
366
|
+
ws.send(JSON.stringify({ ok: true }))
|
|
367
|
+
return
|
|
368
|
+
}
|
|
369
|
+
|
|
352
370
|
// Tell every connected applet to re-import its module (cache-bust) and
|
|
353
371
|
// re-run its data fetches. No rebuild, no page reload — `useApplet`
|
|
354
372
|
// handles `applets:refresh` like `*:updated` (invalidate + reload).
|
|
355
373
|
// `only` narrows to one kind or applet; default is both kinds.
|
|
356
374
|
// `widget:refresh` is the pre-filter message name older CLIs send.
|
|
357
375
|
if (data.type === 'applets:refresh' || data.type === 'widget:refresh') {
|
|
376
|
+
const match = data.path ? await resolveWorkspace(ws, data.path) : undefined
|
|
377
|
+
if (data.path && !match) return
|
|
378
|
+
const scope = match ? { workspaceId: match.id } : {}
|
|
358
379
|
const only = typeof data.only === 'string' ? parseAppletSelector(data.only) : undefined
|
|
359
380
|
if (data.only && !only) {
|
|
360
381
|
ws.send(JSON.stringify({ error: `Invalid applet selector "${data.only}"` }))
|
|
361
382
|
return
|
|
362
383
|
}
|
|
384
|
+
// No `workspaceId`: `moi refresh` names no workspace, so every open one reloads.
|
|
363
385
|
if (only?.id) {
|
|
364
386
|
publishEvent({
|
|
365
387
|
type: only.segment === 'widgets' ? 'widget:updated' : 'view:updated',
|
|
388
|
+
...scope,
|
|
366
389
|
name: only.id
|
|
367
390
|
})
|
|
368
391
|
} else {
|
|
369
|
-
publishEvent({
|
|
392
|
+
publishEvent({
|
|
393
|
+
type: 'applets:refresh',
|
|
394
|
+
...scope,
|
|
395
|
+
...(data.only ? { only: data.only } : {})
|
|
396
|
+
})
|
|
370
397
|
}
|
|
371
398
|
ws.send(JSON.stringify({ ok: true }))
|
|
372
399
|
return
|
|
@@ -437,7 +464,7 @@ export const control = Bun.serve({
|
|
|
437
464
|
}
|
|
438
465
|
|
|
439
466
|
await saveLayout({ ...layout, theme: result.theme }, workspacePath)
|
|
440
|
-
publishEvent({ type: 'theme:updated' })
|
|
467
|
+
publishEvent({ type: 'theme:updated', workspaceId: match.id })
|
|
441
468
|
ws.send(JSON.stringify({ ok: true, ...result.applied }))
|
|
442
469
|
return
|
|
443
470
|
}
|
|
@@ -480,7 +507,7 @@ export const control = Bun.serve({
|
|
|
480
507
|
}
|
|
481
508
|
|
|
482
509
|
await setWorkspaceConfig(workspacePath, patch)
|
|
483
|
-
publishEvent({ type: 'workspace:updated' })
|
|
510
|
+
publishEvent({ type: 'workspace:updated', workspaceId: match.id })
|
|
484
511
|
ws.send(
|
|
485
512
|
JSON.stringify({
|
|
486
513
|
ok: true,
|
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
} from '../../sessions/attachment-message'
|
|
27
27
|
import { type MoiContext, appendMoiContext, renderMoiContext } from '@/lib/moi-context'
|
|
28
28
|
import { type Part, applyEvent, emptyViewState } from '@/lib/format'
|
|
29
|
-
import type { Model, SessionActivity, StreamEvent, ViewState,
|
|
29
|
+
import type { Model, SessionActivity, StreamEvent, ViewState, HarnessType } from '@/lib/types'
|
|
30
30
|
|
|
31
31
|
import {
|
|
32
32
|
type AcpProviderId,
|
|
@@ -62,7 +62,7 @@ export type AcpSpawnContext = {
|
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
export type AcpProviderConfig = {
|
|
65
|
-
id:
|
|
65
|
+
id: HarnessType
|
|
66
66
|
provider: AcpProviderId
|
|
67
67
|
spawn: (ctx: AcpSpawnContext) => Promise<AcpSpawnSpec>
|
|
68
68
|
// Session mode that disables approval prompts, matching moi's
|
|
@@ -363,9 +363,9 @@ function handleNotification(
|
|
|
363
363
|
// Force a fresh probe so the composer's banner flips right away.
|
|
364
364
|
function refreshAvailability(
|
|
365
365
|
rec: Pick<SessionRecord, 'workspaceId' | 'workspacePath'>,
|
|
366
|
-
id:
|
|
366
|
+
id: HarnessType
|
|
367
367
|
) {
|
|
368
|
-
void harnessStore.refresh({ id: rec.workspaceId, path: rec.workspacePath,
|
|
368
|
+
void harnessStore.refresh({ id: rec.workspaceId, path: rec.workspacePath, harness: id })
|
|
369
369
|
}
|
|
370
370
|
|
|
371
371
|
function createRecord(input: {
|
package/server/harness/auth.ts
CHANGED
|
@@ -1,12 +1,7 @@
|
|
|
1
1
|
import { pathHarnessAvailability } from './executable'
|
|
2
2
|
// Login is global per harness. Workspace readiness is checked independently
|
|
3
3
|
// using each workspace’s environment.
|
|
4
|
-
import type {
|
|
5
|
-
HarnessLoginState,
|
|
6
|
-
HarnessAvailability,
|
|
7
|
-
HarnessLogin,
|
|
8
|
-
WorkspaceType
|
|
9
|
-
} from '@/lib/types'
|
|
4
|
+
import type { HarnessLoginState, HarnessAvailability, HarnessLogin, HarnessType } from '@/lib/types'
|
|
10
5
|
|
|
11
6
|
import { publishEvent } from '../events'
|
|
12
7
|
import { harnessFor } from './registry'
|
|
@@ -19,7 +14,7 @@ export type HarnessUpdatedEvent = {
|
|
|
19
14
|
}
|
|
20
15
|
|
|
21
16
|
// Readiness can target a harness account or an individual workspace.
|
|
22
|
-
type HarnessTarget =
|
|
17
|
+
type HarnessTarget = HarnessType | HarnessWorkspace
|
|
23
18
|
|
|
24
19
|
function entryKey(context: HarnessTarget): string {
|
|
25
20
|
return typeof context === 'string' ? `default:${context}` : `workspace:${context.id}`
|
|
@@ -27,9 +22,9 @@ function entryKey(context: HarnessTarget): string {
|
|
|
27
22
|
|
|
28
23
|
export type HarnessStoreOptions = {
|
|
29
24
|
probe: (ws: HarnessTarget) => Promise<HarnessAvailability>
|
|
30
|
-
startLogin: (
|
|
25
|
+
startLogin: (harness: HarnessType) => Promise<HarnessLoginAttempt>
|
|
31
26
|
publish: (event: HarnessUpdatedEvent) => void
|
|
32
|
-
onAuthChanged?: (
|
|
27
|
+
onAuthChanged?: (harness: HarnessType, availability: HarnessAvailability) => Promise<void>
|
|
33
28
|
availabilityTtlMs?: number
|
|
34
29
|
loginPollMs?: number
|
|
35
30
|
loginDeadlineMs?: number
|
|
@@ -124,14 +119,14 @@ export function createHarnessStore(options: HarnessStoreOptions) {
|
|
|
124
119
|
return value
|
|
125
120
|
}
|
|
126
121
|
|
|
127
|
-
function getLogin(context:
|
|
122
|
+
function getLogin(context: HarnessType): HarnessLoginState | undefined {
|
|
128
123
|
return entries.get(entryKey(context))?.login?.state
|
|
129
124
|
}
|
|
130
125
|
|
|
131
126
|
// Re-probe until the login lands or the deadline passes. One loop per
|
|
132
127
|
// ceremony; a replaced or completed ceremony stops its loop.
|
|
133
128
|
function watch(
|
|
134
|
-
|
|
129
|
+
harness: HarnessType,
|
|
135
130
|
login: LoginCeremony,
|
|
136
131
|
initialAvailability: HarnessAvailability
|
|
137
132
|
) {
|
|
@@ -144,12 +139,12 @@ export function createHarnessStore(options: HarnessStoreOptions) {
|
|
|
144
139
|
clearTimeout(timer)
|
|
145
140
|
}
|
|
146
141
|
const tick = async () => {
|
|
147
|
-
const value = await probeFresh(
|
|
142
|
+
const value = await probeFresh(harness)
|
|
148
143
|
if (stopped) return
|
|
149
|
-
const entry = entryFor(
|
|
144
|
+
const entry = entryFor(harness)
|
|
150
145
|
if (value.status === 'available' && (!login.attempt?.completed || login.completed)) {
|
|
151
146
|
entry.login = undefined
|
|
152
|
-
await publish(
|
|
147
|
+
await publish(harness, value)
|
|
153
148
|
return
|
|
154
149
|
}
|
|
155
150
|
if (Date.now() >= deadline) {
|
|
@@ -157,12 +152,12 @@ export function createHarnessStore(options: HarnessStoreOptions) {
|
|
|
157
152
|
// startLogin replaces it.
|
|
158
153
|
stopLogin(login)
|
|
159
154
|
login.state = { state: 'failed', reason: 'Sign-in did not complete. Try again' }
|
|
160
|
-
await publish(
|
|
155
|
+
await publish(harness, value)
|
|
161
156
|
return
|
|
162
157
|
}
|
|
163
158
|
if (!sameAvailability(value, publishedAvailability)) {
|
|
164
159
|
publishedAvailability = value
|
|
165
|
-
await publish(
|
|
160
|
+
await publish(harness, value)
|
|
166
161
|
}
|
|
167
162
|
timer = setTimeout(tick, pollMs)
|
|
168
163
|
timer.unref?.()
|
|
@@ -172,8 +167,8 @@ export function createHarnessStore(options: HarnessStoreOptions) {
|
|
|
172
167
|
timer.unref?.()
|
|
173
168
|
}
|
|
174
169
|
|
|
175
|
-
async function startLogin(
|
|
176
|
-
const entry = entryFor(
|
|
170
|
+
async function startLogin(harness: HarnessType): Promise<HarnessLogin> {
|
|
171
|
+
const entry = entryFor(harness)
|
|
177
172
|
// Concurrent starts share the provider call; active attempts reuse their instructions.
|
|
178
173
|
const current = entry.login
|
|
179
174
|
if (current?.starting) return current.starting
|
|
@@ -183,7 +178,7 @@ export function createHarnessStore(options: HarnessStoreOptions) {
|
|
|
183
178
|
}
|
|
184
179
|
|
|
185
180
|
if (current) stopLogin(current)
|
|
186
|
-
const starting = options.startLogin(
|
|
181
|
+
const starting = options.startLogin(harness).then(attempt => {
|
|
187
182
|
const { completed, cancel: _cancel, submitCode: _submitCode, ...instructions } = attempt
|
|
188
183
|
login.attempt = attempt
|
|
189
184
|
if (entry.login !== login) {
|
|
@@ -197,7 +192,7 @@ export function createHarnessStore(options: HarnessStoreOptions) {
|
|
|
197
192
|
if (entry.login !== login) return
|
|
198
193
|
stopLogin(login)
|
|
199
194
|
login.state = { state: 'failed', reason: 'Sign-in failed or expired. Try again' }
|
|
200
|
-
void refresh(
|
|
195
|
+
void refresh(harness)
|
|
201
196
|
}
|
|
202
197
|
)
|
|
203
198
|
return instructions
|
|
@@ -213,8 +208,8 @@ export function createHarnessStore(options: HarnessStoreOptions) {
|
|
|
213
208
|
status: 'login-required',
|
|
214
209
|
reason: 'Waiting for sign-in'
|
|
215
210
|
}
|
|
216
|
-
await publish(
|
|
217
|
-
if (login.state.state === 'pending') watch(
|
|
211
|
+
await publish(harness, availability)
|
|
212
|
+
if (login.state.state === 'pending') watch(harness, login, availability)
|
|
218
213
|
return result
|
|
219
214
|
} catch (err) {
|
|
220
215
|
if (entry.login === login) entry.login = undefined
|
|
@@ -239,16 +234,16 @@ export function createHarnessStore(options: HarnessStoreOptions) {
|
|
|
239
234
|
.catch(() => {})
|
|
240
235
|
}
|
|
241
236
|
|
|
242
|
-
function activeLogin(
|
|
243
|
-
const login = entryFor(
|
|
237
|
+
function activeLogin(harness: HarnessType, id: string) {
|
|
238
|
+
const login = entryFor(harness).login
|
|
244
239
|
if (!login || login.state.state !== 'pending' || login.state.id !== id) {
|
|
245
240
|
throw new Error('This sign-in attempt has ended. Start again')
|
|
246
241
|
}
|
|
247
242
|
return login
|
|
248
243
|
}
|
|
249
244
|
|
|
250
|
-
async function submitCode(
|
|
251
|
-
const login = activeLogin(
|
|
245
|
+
async function submitCode(harness: HarnessType, id: string, code: string) {
|
|
246
|
+
const login = activeLogin(harness, id)
|
|
252
247
|
if (!login.attempt?.submitCode) throw new Error('This sign-in does not accept a code')
|
|
253
248
|
await login.attempt.submitCode(code)
|
|
254
249
|
}
|
|
@@ -284,17 +279,17 @@ export const harnessStore = createHarnessStore({
|
|
|
284
279
|
if (runtime && runtime.status !== 'available') return runtime
|
|
285
280
|
return harness.authStatus()
|
|
286
281
|
},
|
|
287
|
-
startLogin:
|
|
288
|
-
const start = harnessFor(
|
|
282
|
+
startLogin: harness => {
|
|
283
|
+
const start = harnessFor(harness).startLogin
|
|
289
284
|
if (!start) throw new Error('This agent requires terminal sign-in')
|
|
290
285
|
return start()
|
|
291
286
|
},
|
|
292
287
|
publish: publishEvent,
|
|
293
|
-
onAuthChanged: async (
|
|
288
|
+
onAuthChanged: async (harness, availability) => {
|
|
294
289
|
publishEvent({
|
|
295
290
|
type: 'harness-status:changed',
|
|
296
|
-
harness:
|
|
297
|
-
status: { availability, login: harnessStore.getLogin(
|
|
291
|
+
harness: harness,
|
|
292
|
+
status: { availability, login: harnessStore.getLogin(harness) }
|
|
298
293
|
})
|
|
299
294
|
}
|
|
300
295
|
})
|
|
@@ -69,7 +69,7 @@ async function discoverWorkspaces(
|
|
|
69
69
|
const worktree = await Promise.all(candidates.map(isLinkedGitWorktree))
|
|
70
70
|
return candidates
|
|
71
71
|
.filter((_, i) => !worktree[i])
|
|
72
|
-
.map(path => ({ path,
|
|
72
|
+
.map(path => ({ path, harness: 'claude-code' as const }))
|
|
73
73
|
} catch {
|
|
74
74
|
return []
|
|
75
75
|
}
|
|
@@ -462,7 +462,7 @@ function applyCompletionMeta(
|
|
|
462
462
|
|
|
463
463
|
// A failed send may reflect an external logout. Refresh the cached banner now.
|
|
464
464
|
function refreshAvailability(workspaceId: string, workspacePath: string) {
|
|
465
|
-
void harnessStore.refresh({ id: workspaceId, path: workspacePath,
|
|
465
|
+
void harnessStore.refresh({ id: workspaceId, path: workspacePath, harness: 'codex' })
|
|
466
466
|
}
|
|
467
467
|
|
|
468
468
|
function handleNotification(rec: SessionRecord, method: string, params: Record<string, unknown>) {
|
package/server/harness/detect.ts
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
import { existsSync } from 'node:fs'
|
|
12
12
|
import { join, resolve } from 'node:path'
|
|
13
13
|
|
|
14
|
-
import type {
|
|
14
|
+
import type { HarnessType } from '@/lib/types'
|
|
15
15
|
|
|
16
16
|
import { discoverCodexWorkspaces } from './codex/discovery'
|
|
17
17
|
import { type HermesProfile, discoverHermesProfiles } from './hermes/discovery'
|
|
@@ -19,21 +19,16 @@ import { type OpenClawAgent, discoverOpenClawAgents } from './openclaw/discovery
|
|
|
19
19
|
|
|
20
20
|
// Harness names accepted by `--harness`, in the order they are listed to the
|
|
21
21
|
// user. Detection order is separate (see detectHarness).
|
|
22
|
-
export const HARNESS_TYPES: readonly
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
'hermes',
|
|
26
|
-
'openclaw'
|
|
27
|
-
]
|
|
28
|
-
|
|
29
|
-
export const harnessLabel: Record<WorkspaceType, string> = {
|
|
22
|
+
export const HARNESS_TYPES: readonly HarnessType[] = ['claude-code', 'codex', 'hermes', 'openclaw']
|
|
23
|
+
|
|
24
|
+
export const harnessLabel: Record<HarnessType, string> = {
|
|
30
25
|
'claude-code': 'Claude Code',
|
|
31
26
|
codex: 'Codex',
|
|
32
27
|
hermes: 'Hermes',
|
|
33
28
|
openclaw: 'OpenClaw'
|
|
34
29
|
}
|
|
35
30
|
|
|
36
|
-
export function isHarnessName(value: string): value is
|
|
31
|
+
export function isHarnessName(value: string): value is HarnessType {
|
|
37
32
|
return (HARNESS_TYPES as readonly string[]).includes(value)
|
|
38
33
|
}
|
|
39
34
|
|
|
@@ -48,7 +43,7 @@ export type DetectedAgent = {
|
|
|
48
43
|
}
|
|
49
44
|
|
|
50
45
|
export type HarnessDetection = {
|
|
51
|
-
|
|
46
|
+
harness: HarnessType
|
|
52
47
|
agent?: DetectedAgent
|
|
53
48
|
// What gave it away, as a noun phrase for the CLI's "Detected …" line.
|
|
54
49
|
reason: string
|
|
@@ -91,7 +86,7 @@ async function safely<T>(fn: () => Promise<T>, fallback: T): Promise<T> {
|
|
|
91
86
|
|
|
92
87
|
function detectionForProfile(profile: HermesProfile): HarnessDetection {
|
|
93
88
|
return {
|
|
94
|
-
|
|
89
|
+
harness: 'hermes',
|
|
95
90
|
agent: {
|
|
96
91
|
agentId: profile.agentId,
|
|
97
92
|
...(profile.name ? { name: profile.name } : {}),
|
|
@@ -103,7 +98,7 @@ function detectionForProfile(profile: HermesProfile): HarnessDetection {
|
|
|
103
98
|
|
|
104
99
|
function detectionForAgent(agent: OpenClawAgent): HarnessDetection {
|
|
105
100
|
return {
|
|
106
|
-
|
|
101
|
+
harness: 'openclaw',
|
|
107
102
|
agent: {
|
|
108
103
|
agentId: agent.agentId,
|
|
109
104
|
...(agent.name ? { name: agent.name } : {}),
|
|
@@ -128,7 +123,7 @@ export async function detectHarness(
|
|
|
128
123
|
if (agent) return detectionForAgent(agent)
|
|
129
124
|
|
|
130
125
|
if ((await safely(src.codexWorkspaces, [])).includes(path)) {
|
|
131
|
-
return {
|
|
126
|
+
return { harness: 'codex', reason: 'Codex session history here' }
|
|
132
127
|
}
|
|
133
128
|
|
|
134
129
|
// Session history first, then the config directory: history means the CLI
|
|
@@ -136,10 +131,10 @@ export async function detectHarness(
|
|
|
136
131
|
// the history scan drops linked git worktrees, so a worktree is recognized
|
|
137
132
|
// by its `.claude/` directory or not at all.
|
|
138
133
|
if ((await safely(src.claudeCodeWorkspaces, [])).includes(path)) {
|
|
139
|
-
return {
|
|
134
|
+
return { harness: 'claude-code', reason: 'Claude Code session history here' }
|
|
140
135
|
}
|
|
141
136
|
if (src.hasClaudeConfigDir(path)) {
|
|
142
|
-
return {
|
|
137
|
+
return { harness: 'claude-code', reason: 'a .claude/ directory here' }
|
|
143
138
|
}
|
|
144
139
|
|
|
145
140
|
return null
|
|
@@ -150,18 +145,18 @@ export async function detectHarness(
|
|
|
150
145
|
// would have found. Null for the directory-only harnesses, and for a provider
|
|
151
146
|
// that cannot confirm the path (gateway down, profile removed).
|
|
152
147
|
export async function agentBindingFor(
|
|
153
|
-
|
|
148
|
+
harness: HarnessType,
|
|
154
149
|
workspacePath: string,
|
|
155
150
|
sources: Partial<DetectionSources> = {}
|
|
156
151
|
): Promise<DetectedAgent | null> {
|
|
157
152
|
const src = { ...defaultSources, ...sources }
|
|
158
153
|
const path = resolve(workspacePath)
|
|
159
154
|
|
|
160
|
-
if (
|
|
155
|
+
if (harness === 'hermes') {
|
|
161
156
|
const profile = (await safely(src.hermesProfiles, [])).find(p => p.path === path)
|
|
162
157
|
return profile ? (detectionForProfile(profile).agent ?? null) : null
|
|
163
158
|
}
|
|
164
|
-
if (
|
|
159
|
+
if (harness === 'openclaw') {
|
|
165
160
|
const agent = (await safely(src.openclawAgents, [])).find(a => a.path === path)
|
|
166
161
|
return agent ? (detectionForAgent(agent).agent ?? null) : null
|
|
167
162
|
}
|
|
@@ -3,7 +3,7 @@ import { homedir } from 'node:os'
|
|
|
3
3
|
import { delimiter, join, resolve } from 'node:path'
|
|
4
4
|
|
|
5
5
|
import { harnessInstructionMessage } from '@/lib/harness-instructions'
|
|
6
|
-
import type { HarnessAvailability, HarnessInstallations,
|
|
6
|
+
import type { HarnessAvailability, HarnessInstallations, HarnessType } from '@/lib/types'
|
|
7
7
|
|
|
8
8
|
import { cachedLoginShellPath, loginShellPath, mergeSearchPaths } from './shell-path'
|
|
9
9
|
|
|
@@ -17,7 +17,7 @@ type ExecutableConfig = {
|
|
|
17
17
|
fallbackPaths?: readonly string[]
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
const executableConfig: Record<
|
|
20
|
+
const executableConfig: Record<HarnessType, ExecutableConfig> = {
|
|
21
21
|
'claude-code': {
|
|
22
22
|
command: 'claude',
|
|
23
23
|
fallbackPaths: [
|
|
@@ -76,8 +76,8 @@ export function firstExecutable(paths: readonly string[]): string | null {
|
|
|
76
76
|
|
|
77
77
|
// `path` is a test seam: when given, only that PATH is searched — no
|
|
78
78
|
// login-shell merge, no bundle fallbacks.
|
|
79
|
-
export function findHarnessExecutable(
|
|
80
|
-
const config = executableConfig[
|
|
79
|
+
export function findHarnessExecutable(harness: HarnessType, path?: string): string | null {
|
|
80
|
+
const config = executableConfig[harness]
|
|
81
81
|
// bun run adds our dependency commands to PATH; those are not user installs.
|
|
82
82
|
const searchPath = (path ?? mergeSearchPaths(cachedLoginShellPath(), process.env.PATH))
|
|
83
83
|
.split(delimiter)
|
|
@@ -89,25 +89,25 @@ export function findHarnessExecutable(type: WorkspaceType, path?: string): strin
|
|
|
89
89
|
: (executable ?? firstExecutable(config.fallbackPaths ?? []))
|
|
90
90
|
}
|
|
91
91
|
|
|
92
|
-
export function requireHarnessExecutable(
|
|
93
|
-
const executable = findHarnessExecutable(
|
|
94
|
-
if (!executable) throw new Error(executableConfig[
|
|
92
|
+
export function requireHarnessExecutable(harness: HarnessType, path?: string): string {
|
|
93
|
+
const executable = findHarnessExecutable(harness, path)
|
|
94
|
+
if (!executable) throw new Error(executableConfig[harness].unavailableReason)
|
|
95
95
|
return executable
|
|
96
96
|
}
|
|
97
97
|
|
|
98
98
|
export async function pathHarnessAvailability(
|
|
99
|
-
|
|
99
|
+
harness: HarnessType,
|
|
100
100
|
path?: string
|
|
101
101
|
): Promise<HarnessAvailability> {
|
|
102
102
|
// Availability is asked per request (and long after startup), but await the
|
|
103
103
|
// probe anyway so the very first request can't report a false negative.
|
|
104
104
|
if (path === undefined) await loginShellPath()
|
|
105
|
-
return findHarnessExecutable(
|
|
105
|
+
return findHarnessExecutable(harness, path)
|
|
106
106
|
? { status: 'available' }
|
|
107
107
|
: {
|
|
108
108
|
status: 'unavailable',
|
|
109
109
|
code: 'not-installed',
|
|
110
|
-
reason: executableConfig[
|
|
110
|
+
reason: executableConfig[harness].unavailableReason
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
113
|
|
|
@@ -578,10 +578,10 @@ server/harness/hermes/
|
|
|
578
578
|
```
|
|
579
579
|
|
|
580
580
|
Touch points outside the folder are small and already enumerated by the Codex
|
|
581
|
-
precedent: `lib/types.ts` (`
|
|
581
|
+
precedent: `lib/types.ts` (`HarnessType` union), `lib/harness-types.ts`
|
|
582
582
|
(ordering), `lib/format.ts` (`provider` union), `server/harness/registry.ts`,
|
|
583
583
|
`server/harness/executable.ts` (PATH lookup), `server/api/index.ts`
|
|
584
|
-
(`
|
|
584
|
+
(`CREATABLE_HARNESSES`), and a handful of client files that branch on provider
|
|
585
585
|
(`client/features/chat/messages/tool-group/format/index.ts`,
|
|
586
586
|
`client/features/workspace/setup/workspace-login-state.tsx`,
|
|
587
587
|
`client/features/dev/harness-debug-page.tsx`).
|
|
@@ -120,7 +120,7 @@ export const hermesHarness: Harness = {
|
|
|
120
120
|
const profiles = await discoverHermesProfiles()
|
|
121
121
|
return profiles
|
|
122
122
|
.filter(p => !registeredPaths.has(p.path))
|
|
123
|
-
.map((p): DiscoveredWorkspaceCandidate => ({ path: p.path,
|
|
123
|
+
.map((p): DiscoveredWorkspaceCandidate => ({ path: p.path, harness: 'hermes' }))
|
|
124
124
|
},
|
|
125
125
|
|
|
126
126
|
availability: async (ws): Promise<HarnessAvailability> => {
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import { HARNESS_INSTRUCTIONS } from '@/lib/harness-instructions'
|
|
2
2
|
import { getAppConfig } from '../app-config'
|
|
3
|
-
import type {
|
|
3
|
+
import type { HarnessType } from '@/lib/types'
|
|
4
4
|
import { detectInstalledHarnesses } from './executable'
|
|
5
5
|
|
|
6
|
-
const installations = new Map<
|
|
6
|
+
const installations = new Map<HarnessType, Promise<void>>()
|
|
7
7
|
|
|
8
|
-
export function installHarness(
|
|
8
|
+
export function installHarness(harness: HarnessType): Promise<void> {
|
|
9
9
|
const config = getAppConfig()
|
|
10
10
|
if (config.environment !== 'local' || config.demo || config.agentLauncher) {
|
|
11
11
|
throw new Error('Agents can only be installed in local Moi')
|
|
12
12
|
}
|
|
13
|
-
if (
|
|
13
|
+
if (harness !== 'claude-code' && harness !== 'codex') {
|
|
14
14
|
throw new Error('This agent requires manual installation')
|
|
15
15
|
}
|
|
16
|
-
const pending = installations.get(
|
|
16
|
+
const pending = installations.get(harness)
|
|
17
17
|
if (pending) return pending
|
|
18
18
|
const installation = (async () => {
|
|
19
|
-
if ((await detectInstalledHarnesses())[
|
|
19
|
+
if ((await detectInstalledHarnesses())[harness]) return
|
|
20
20
|
const url =
|
|
21
|
-
|
|
21
|
+
harness === 'claude-code' ? 'https://claude.ai/install' : 'https://chatgpt.com/codex/install'
|
|
22
22
|
const command =
|
|
23
23
|
process.platform === 'win32'
|
|
24
24
|
? [
|
|
@@ -30,7 +30,7 @@ export function installHarness(type: WorkspaceType): Promise<void> {
|
|
|
30
30
|
'-Command',
|
|
31
31
|
`$ErrorActionPreference = 'Stop'; irm ${url}.ps1 | iex`
|
|
32
32
|
]
|
|
33
|
-
: ['bash', '-o', 'pipefail', '-c', HARNESS_INSTRUCTIONS[
|
|
33
|
+
: ['bash', '-o', 'pipefail', '-c', HARNESS_INSTRUCTIONS[harness].command]
|
|
34
34
|
const child = Bun.spawn(command, {
|
|
35
35
|
stdin: 'ignore',
|
|
36
36
|
stdout: 'inherit',
|
|
@@ -40,10 +40,10 @@ export function installHarness(type: WorkspaceType): Promise<void> {
|
|
|
40
40
|
if ((await child.exited) !== 0) {
|
|
41
41
|
throw new Error('Installation failed or timed out. Try again.')
|
|
42
42
|
}
|
|
43
|
-
if (!(await detectInstalledHarnesses())[
|
|
43
|
+
if (!(await detectInstalledHarnesses())[harness]) {
|
|
44
44
|
throw new Error('The installer finished, but the agent could not be found. Restart Moi.')
|
|
45
45
|
}
|
|
46
|
-
})().finally(() => installations.delete(
|
|
47
|
-
installations.set(
|
|
46
|
+
})().finally(() => installations.delete(harness))
|
|
47
|
+
installations.set(harness, installation)
|
|
48
48
|
return installation
|
|
49
49
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
//
|
|
1
|
+
// HarnessType → Harness lookup. This is the single import surface for the
|
|
2
2
|
// rest of the server: web.ts/api/index.ts/etc. dispatch through harnessFor()
|
|
3
3
|
// instead of branching on workspace.type (documented exceptions: cli.ts
|
|
4
4
|
// provisioning and tests import harness internals directly).
|
|
5
|
-
import type { WorkspaceEntry,
|
|
5
|
+
import type { WorkspaceEntry, HarnessType } from '@/lib/types'
|
|
6
6
|
|
|
7
7
|
import { claudeCodeHarness } from './claude-code'
|
|
8
8
|
import { codexHarness } from './codex'
|
|
@@ -17,13 +17,14 @@ const harnesses = {
|
|
|
17
17
|
openclaw: openclawHarness,
|
|
18
18
|
codex: codexHarness,
|
|
19
19
|
hermes: hermesHarness
|
|
20
|
-
} satisfies Partial<Record<
|
|
20
|
+
} satisfies Partial<Record<HarnessType, Harness>>
|
|
21
21
|
|
|
22
22
|
// An untyped registry entry is a Claude Code workspace (pre-typing legacy).
|
|
23
|
-
export function harnessFor(ws: Pick<WorkspaceEntry, '
|
|
24
|
-
const
|
|
23
|
+
export function harnessFor(ws: Pick<WorkspaceEntry, 'harness'> | HarnessType | undefined): Harness {
|
|
24
|
+
const harness = typeof ws === 'string' ? ws : ws?.harness
|
|
25
25
|
return (
|
|
26
|
-
(
|
|
26
|
+
(harness && harness in harnesses && harnesses[harness as keyof typeof harnesses]) ||
|
|
27
|
+
claudeCodeHarness
|
|
27
28
|
)
|
|
28
29
|
}
|
|
29
30
|
|
package/server/harness/types.ts
CHANGED
|
@@ -16,7 +16,7 @@ import type {
|
|
|
16
16
|
SessionSummary,
|
|
17
17
|
StreamEvent,
|
|
18
18
|
WorkspaceEntry,
|
|
19
|
-
|
|
19
|
+
HarnessType
|
|
20
20
|
} from '@/lib/types'
|
|
21
21
|
|
|
22
22
|
// The superset of what any backend needs to accept a user message; harnesses
|
|
@@ -78,10 +78,10 @@ export type WorkspaceActivityPreview = {
|
|
|
78
78
|
|
|
79
79
|
export type DiscoveredWorkspaceCandidate = {
|
|
80
80
|
path: string
|
|
81
|
-
|
|
81
|
+
harness: HarnessType
|
|
82
82
|
}
|
|
83
83
|
|
|
84
|
-
export type HarnessWorkspace = Pick<WorkspaceEntry, 'id' | 'path' | '
|
|
84
|
+
export type HarnessWorkspace = Pick<WorkspaceEntry, 'id' | 'path' | 'harness' | 'agentId'>
|
|
85
85
|
|
|
86
86
|
export type ActionModel = 'fast' | 'normal' | 'smart'
|
|
87
87
|
|
|
@@ -100,7 +100,7 @@ export type HarnessActionInput<TResult = unknown, TProgress = never> = {
|
|
|
100
100
|
)
|
|
101
101
|
|
|
102
102
|
export type Harness = {
|
|
103
|
-
id:
|
|
103
|
+
id: HarnessType
|
|
104
104
|
capabilities: HarnessCapabilities
|
|
105
105
|
|
|
106
106
|
// Ephemeral read/search action without a workspace or visible chat.
|