moi-computer 0.1.4 → 0.3.0-next.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +26 -52
- package/client/api/workspaces.ts +3 -5
- package/client/components/Scratchpad.tsx +169 -9
- package/client/components/layout/SidebarLayout.tsx +1 -12
- package/client/components/settings/SettingsPages.tsx +8 -60
- package/client/components/tool-group/fixtures.ts +60 -66
- package/client/hooks/useEnvVars.ts +20 -0
- package/client/hooks/useMeiEvents.ts +2 -0
- package/dist/chunk-07qf2tv1.css +1 -0
- package/dist/chunk-c3zjp9ez.js +672 -0
- package/dist/index.html +1 -1
- package/lib/scratchpad-skew.ts +64 -0
- package/lib/types.ts +5 -7
- package/package.json +3 -3
- package/server/api.ts +53 -54
- package/server/cc-session.ts +1 -1
- package/server/cli-colors.ts +6 -3
- package/server/cli-env.ts +237 -0
- package/server/cli-pc.ts +20 -0
- package/server/cli.ts +182 -3
- package/server/control.ts +11 -0
- package/server/data-dir.ts +9 -0
- package/server/env-apply.ts +16 -0
- package/server/functions-worker.ts +2 -0
- package/server/functions.ts +101 -3
- package/server/registry.ts +1 -2
- package/server/required-env.ts +19 -0
- package/server/scratchpad-assets.ts +223 -0
- package/server/scratchpad-executor.ts +88 -23
- package/server/scratchpad.ts +110 -20
- package/server/status.ts +54 -3
- package/server/thread-config.ts +2 -3
- package/server/vendor.ts +15 -8
- package/server/workspace-env.ts +69 -80
- package/workspace/.claude/skills/moi-workspace/SCRATCHPAD.md +5 -3
- package/workspace/.claude/skills/moi-workspace/SKILL.md +40 -6
- package/dist/chunk-kc6e9nd4.css +0 -1
- package/dist/chunk-yf3p7qg7.js +0 -673
- /package/client/{CLAUDE.md → AGENTS.md} +0 -0
- /package/server/{CLAUDE.md → AGENTS.md} +0 -0
|
@@ -1,31 +1,26 @@
|
|
|
1
|
-
// Test fixtures for <ToolCallGroup>.
|
|
2
|
-
//
|
|
3
|
-
//
|
|
1
|
+
// Test fixtures for <ToolCallGroup>. Shaped exactly like real tool calls from a
|
|
2
|
+
// Claude Code session (states, providers, MCP naming, output truncation), but
|
|
3
|
+
// all data — paths, Notion pages, GitHub profile, repo names — is synthetic.
|
|
4
4
|
//
|
|
5
|
-
//
|
|
6
|
-
//
|
|
7
|
-
//
|
|
8
|
-
//
|
|
9
|
-
//
|
|
5
|
+
// Note the adapter (lib/claude-adapter.ts `blockOutputText`) caps each result at
|
|
6
|
+
// 4000 chars at ingest, so `notionSearch` below ends mid-JSON on purpose — that
|
|
7
|
+
// is what a capped result looks like in the stream. `toolSearch` output is the
|
|
8
|
+
// tool-name-per-line form a real ToolSearch result reduces to (the adapter keeps
|
|
9
|
+
// only `text` blocks and a ToolSearch result is all `tool_reference` blocks, so
|
|
10
|
+
// the live stream shows it empty; a real ToolSearch card would render these).
|
|
10
11
|
//
|
|
11
|
-
// `FIXTURE_CWD` is
|
|
12
|
-
// file paths render shortened (relative), exactly like the live chat.
|
|
12
|
+
// `FIXTURE_CWD` is the fixture workspace's working directory — pass it to the
|
|
13
|
+
// group so file paths render shortened (relative), exactly like the live chat.
|
|
13
14
|
//
|
|
14
15
|
// The lists are `Part[]` (reasoning + tool-call), so a run reads as a mixed
|
|
15
|
-
// timeline.
|
|
16
|
-
// ("lilmd-demo", session c3d7caba) — see their definitions below.
|
|
16
|
+
// timeline.
|
|
17
17
|
import type { Part, ToolCall } from '@/lib/types'
|
|
18
18
|
|
|
19
|
-
export const FIXTURE_CWD = '/Users/
|
|
19
|
+
export const FIXTURE_CWD = '/Users/kim/git/confetti'
|
|
20
20
|
|
|
21
|
-
// `select:`-style tool discovery.
|
|
22
|
-
// adapter's `blockOutputText()` keeps only `text` blocks and a ToolSearch result
|
|
23
|
-
// is all `tool_reference` blocks. The `output` below is reconstructed from the
|
|
24
|
-
// raw session JSONL — the names of the tools this call loaded into context, one
|
|
25
|
-
// per line (the data the adapter currently drops; a real ToolSearch card would
|
|
26
|
-
// render these).
|
|
21
|
+
// `select:`-style tool discovery.
|
|
27
22
|
const toolSearch: ToolCall = {
|
|
28
|
-
toolCallId: '
|
|
23
|
+
toolCallId: 'toolu_fixture_tool_search',
|
|
29
24
|
name: 'ToolSearch',
|
|
30
25
|
caller: 'model',
|
|
31
26
|
provider: 'claude-code',
|
|
@@ -42,7 +37,7 @@ const toolSearch: ToolCall = {
|
|
|
42
37
|
// `caller` is still `model`, and `mcpServer` is absent. The current chat renders
|
|
43
38
|
// these via the generic card (the MCP card only matches `mcporter call …` Bash).
|
|
44
39
|
const notionSearch: ToolCall = {
|
|
45
|
-
toolCallId: '
|
|
40
|
+
toolCallId: 'toolu_fixture_notion_search',
|
|
46
41
|
name: 'mcp__notion__notion-search',
|
|
47
42
|
caller: 'model',
|
|
48
43
|
provider: 'claude-code',
|
|
@@ -53,37 +48,37 @@ const notionSearch: ToolCall = {
|
|
|
53
48
|
page_size: 25
|
|
54
49
|
},
|
|
55
50
|
output:
|
|
56
|
-
'{"results":[{"id":"
|
|
51
|
+
'{"results":[{"id":"3f1c9a72-0d62-4511-9dc9-5b7f38409a22","title":"Reading List","url":"https://app.notion.com/p/3f1c9a720d6245119dc95b7f38409a22?pvs=1","type":"page","highlight":"Reading List","timestamp":"2024-10-17T13:51:00.000Z"},{"id":"8b2d17aa-6741-4993-88bc-5adf2dabb8da","title":"To-Do","url":"https://app.notion.com/p/8b2d17aa6741499388bc5adf2dabb8da?pvs=1","type":"page","highlight":"canvas-confetti performance notes and particle pooling","timestamp":"2026-06-15T13:14:00.000Z"},{"id":"244536fd-e65b-433f-92bf-aa95efa91f35","title":"Plans & Notes","url":"https://app.notion.com/p/244536fde65b433f92bfaa95efa91f35?pvs=1","type":"database","highlight":"Plans & Notes","timestamp":"2024-02-06T10:02:00.000Z"},{"id":"5a668c31-b678-4035-b58e-d33e3ce86f5e","title":"Animation Research","url":"https://app.notion.com/p/5a668c31b6784035b58ed33e3ce86f5e?pvs=1","type":"page","highlight":"spring easings vs. bezier — generate N particle bursts in parallel and compare frame budgets","timestamp":"2025-11-03T08:07:00.000Z"},{"id":"41c28e19-b678-40df-ade3-dd8cec63de64","title":"Roadmap","url":"https://app.notion.com/p/41c28e19b67840dfade3dd8cec63de64?pvs=1","type":"database","highlight":"Roadmap","timestamp":"2026-06-09T08:00:00.000Z"},{"id":"6d9e2f44-b678-423e-9795-01de5d5f6734","title":"Meeting notes","url":"https://app.notion.com/p/6d9e2f44b678423e979501de5d5f6734?pvs=1","type":"database","highlight":"Meeting notes","timestamp":"2025-11-06T15:22:00.000Z"},{"id":"7fa31c55-b678-401d-948f-c47118e21516","title":"illustrations","url":"https://app.notion.com/p/7fa31c55b678401d948fc47118e21516?pvs=1","type":"page","highlight":"illustrations","timestamp":"2026-06-09T18:01:00.000Z"},{"id":"92e4b5c8-8d50-4938-8808-716a4e89dba6","title":"Weekly Update: March 4","url":"https://app.notion.com/p/92e4b5c88d5049388808716a4e89dba6?pvs=1","type":"page","highlight":"add backlog project for migrating v1 users","timestamp":"2022-07-30T18:34:00.000Z"},{"id":"1c778a02-b678-407b-9340-e1e830e38c50","title":"demo site","url":"https://app.notion.com/p/1c778a02b678407b9340e1e830e38c50?pvs=1","type":"page","highlight":"Interactive playground (CodeSandbox style)","timestamp":"2026-06-15T08:15:00.000Z"},{"id":"e3558d21-b678-406b-9a90-efaac9d864cf","title":"Feature Requests","url":"https://app.notion.com/p/e3558d21b678406b9a90efaac9d864cf?pvs=1","type":"database","highlight":"Feature Requests","timestamp":"2026-03-09T13:03:00.000Z"},{"id":"a91f4c6e-ce16-4002-bcb1-ead4923b9963","title":"Beta feedback","url":"https://app.notion.com/p/a91f4c6ece164002bcb1ead4923b9963?pvs=1","type":"database","highlight":"Beta feedback","timestamp":"2026-04-22T11:56:00.000Z"},{"id":"b0537e88-b678-40f3-8f04-cc7fef16e055","title":"confetti-v2","url":"https://app.notion.com/p/b0537e88b67840f38f04cc7fef16e055?pvs=1","type":"page","highlight":"WebGL renderer spike — offscreen canvas + worker, fall back to 2d context","timestamp":"2026-04-21T09:42:00.000Z"},{"id":"c6b19d34-b678-4145-9023-ffb37c04037d","title":"Physics Notes","url":"https://app.notion.com/p/c6b19d34b67841459023ffb37c04037d?pvs=1","type":"page","highlight":"Physics Notes","timestamp":"2026-04-21T13:07:00.000Z"},{"id":"d84a6f10-b678-41ea-845c-d7cc7c2ad2c4","title":"Docs Outline","url":"https://app.notion.com/p/d84a6f10b67841ea845cd7cc7c2ad2c4?pvs=1","type":"page","highlight":"📘 Getting started — full walkthrough (install, first burst, presets)","timestamp":"2026-06-09T08:44:00.000Z"},{"id":"f2c07b45-b678-402c-a8e7-d897826cf96d","title":"old","url":"https://app.notion.com/p/f2c07b45b678402ca8e7d897826cf96d?pvs=1","type":"page","highlight":"Notes:","timestamp":"2026-03-06T16:31:00.000Z"},{"id":"09d6e2a7-9908-4d54-be46-a974ac5019da","title":"Weekly Update: Jan 28","url":"https://app.notion.com/p/09d6e2a799084d54be46a974ac5019da'
|
|
57
52
|
}
|
|
58
53
|
|
|
59
54
|
const notionFetchOpenSource: ToolCall = {
|
|
60
|
-
toolCallId: '
|
|
55
|
+
toolCallId: 'toolu_fixture_notion_fetch_oss',
|
|
61
56
|
name: 'mcp__notion__notion-fetch',
|
|
62
57
|
caller: 'model',
|
|
63
58
|
provider: 'claude-code',
|
|
64
59
|
state: 'success',
|
|
65
60
|
input: {
|
|
66
|
-
id: '
|
|
61
|
+
id: '55e1c208-1f0f-47cd-9422-bd7dbc54d536'
|
|
67
62
|
},
|
|
68
63
|
output:
|
|
69
|
-
'{"metadata":{"type":"page"},"title":"🛥 Open-Source","url":"https://app.notion.com/p/
|
|
64
|
+
'{"metadata":{"type":"page"},"title":"🛥 Open-Source","url":"https://app.notion.com/p/55e1c2081f0f47cd9422bd7dbc54d536","text":"Here is the result of \\"view\\" for the Page with URL https://app.notion.com/p/55e1c2081f0f47cd9422bd7dbc54d536 as of 2026-05-29T13:08:56.275Z:\\n<page url=\\"https://app.notion.com/p/55e1c2081f0f47cd9422bd7dbc54d536\\" icon=\\"🛥\\">\\n<ancestor-path></ancestor-path>\\n<properties>\\n{\\"title\\":\\"Open-Source\\"}\\n</properties>\\n<content>\\n<page url=\\"https://app.notion.com/p/71a2b39c6438406fac456aeef33a046d\\">tinyrouter</page>\\n<page url=\\"https://app.notion.com/p/83b4c5de45af40c28a19f635332f9c4c\\">confetti</page>\\n<page url=\\"https://app.notion.com/p/95c6d7f0210d42e0888168401a40345e\\">mdnav</page>\\n<page url=\\"https://app.notion.com/p/07d8e912111a4df295726341c22decbc\\">pixelpad</page>\\n<page url=\\"https://app.notion.com/p/19e0fb3405c743628f0c0b864b4182ee\\">`use-sparkle`</page>\\n<page url=\\"https://app.notion.com/p/2bf21c561e5d4e888f6cdb86e5adcb9d\\">use-hotkey</page>\\n<empty-block/>\\n<empty-block/>\\n</content>\\n</page>"}'
|
|
70
65
|
}
|
|
71
66
|
|
|
72
|
-
const
|
|
73
|
-
toolCallId: '
|
|
67
|
+
const notionFetchConfetti: ToolCall = {
|
|
68
|
+
toolCallId: 'toolu_fixture_notion_fetch_confetti',
|
|
74
69
|
name: 'mcp__notion__notion-fetch',
|
|
75
70
|
caller: 'model',
|
|
76
71
|
provider: 'claude-code',
|
|
77
72
|
state: 'success',
|
|
78
73
|
input: {
|
|
79
|
-
id: '
|
|
74
|
+
id: '83b4c5de-45af-40c2-8a19-f635332f9c4c'
|
|
80
75
|
},
|
|
81
76
|
output:
|
|
82
|
-
'{"metadata":{"type":"page"},"title":"
|
|
77
|
+
'{"metadata":{"type":"page"},"title":"confetti","url":"https://app.notion.com/p/83b4c5de45af40c28a19f635332f9c4c","text":"Here is the result of \\"view\\" for the Page with URL https://app.notion.com/p/83b4c5de45af40c28a19f635332f9c4c as of 2024-04-19T10:05:10.098Z:\\n<page url=\\"https://app.notion.com/p/83b4c5de45af40c28a19f635332f9c4c\\">\\n<ancestor-path>\\n<parent-page url=\\"https://app.notion.com/p/55e1c2081f0f47cd9422bd7dbc54d536\\" title=\\"Open-Source\\"/>\\n</ancestor-path>\\n<properties>\\n{\\"title\\":\\"confetti\\"}\\n</properties>\\n<content>\\n- [x] Split the physics step from the render step\\n- [x] Basic React API\\n\\t- [x] Controlled/uncontrolled\\n\\t- [x] SSR: ok! No canvas until mount\\n\\t- [x] Detach on unmount\\n\\t- [x] `asChild` prop\\n\\t- [x] Block elements and `tagName`\\n\\t- [x] Fire on `click`\\n\\t- [x] Pass particle options\\n\\t- [x] asChild types\\n\\t- [x] Reduced-motion fallback\\n- [x] Pause bursts when the tab is hidden (VisibilityObserver)\\n- [x] Default burst has no trail. Needs a wrapper that disables the selector via `:has` — but then how do block elements animate? And `asChild` breaks.\\n- [x] Dark/light theme, none, auto, accent color\\n- [x] Demo: light/dark theme\\n- [x] `useIsomorphicLayoutEffect`\\n- [x] Particle pooling (no per-frame allocs)\\n- [x] Build and package\\n- [x] Publish a canary and dogfood it on the demo site\\n- [x] Fallback for Safari + Firefox: pre-rendered sprite sheet, three layers offset by primes 3, 5, 7 — loop four frames\\n- [x] data-active\\n- [x] pixelRatio for the fallback\\n- [x] How should styles load? Ship them separately.\\n- [x] Simple README\\n- [x] Get the easing curve right\\n- [ ] Use inline style in SSR\\n<empty-block/>\\n```javascript\\n// Default confetti: uncontrolled, light theme, fires on click, creates an\\n// inline <span> wrapper, no trail, does not follow the pointer\\n\\n/**\\n * Elements \\n */\\n<Confetti>Party!</Confetti> // <span>Party!</span>\\n<Confetti className=\\"custom\\">Party!</Confetti>\\n\\n// block elements \\n<Confetti block><img /></Confetti> // <div><img /></div>\\n<Confetti tagName=\\"div\\"><img /></Confetti> // alias\\n\\n// advanced\\n<Confetti asChild><button aria-label=\\"celebrate\\" /></Confetti>\\n\\n/**\\n * Controlled/uncontrolled component \\n */\\n\\n<Confetti /> // fires on click, uncontrolled\\n<Confetti fireOn=\\"click\\" />\\n<Confetti fireOn=\\"hover\\" />\\n<Confetti defaultActive={false} onChange={(value) => change} />\\n\\n// when `active` is provided, it becomes controlled and\\n// `fireOn` and `defaultActive` have no effect \\n<Confetti active={true}>Always bursting</Confetti> // controlled\\n<Confetti active={value} onClick={() => setValue()}</Confetti> // controlled\\n\\n/** \\n * Theming \\n */\\n\\n<Confetti /> // default theme is `light`\\n<Confetti theme=\\"dark\\" />\\n<Confetti theme=\\"auto\\" /> // system-defined\\n<Confetti theme=\\"dark\\" accentColor=\\"red\\" /> // use `colord` here\\n\\n/**\\n * Particle options\\n */\\n<Confetti count={120} gravity={0.8} spread={60}>Boom</Confetti>\\n<Confetti preset=\\"fireworks\\">Boom</Confetti>\\n\\n/** \\n * Styling \\n */\\n\\nimport { Confetti } from \\"confetti\\"\\n\\nimport { Confetti } from \\"confetti/unstyled\\"\\nimport \\"confetti/styles.css\\"\\n```\\n<empty-block/>\\n<empty-block/>\\n<page url=\\"https://app.notion.com/p/3dc43e781e5d4e888f6cdb86e5adcb00\\">Confetti: website</page>\\n</content>\\n</page>"}'
|
|
83
78
|
}
|
|
84
79
|
|
|
85
80
|
const bash: ToolCall = {
|
|
86
|
-
toolCallId: '
|
|
81
|
+
toolCallId: 'toolu_fixture_bash_pwd',
|
|
87
82
|
name: 'Bash',
|
|
88
83
|
caller: 'model',
|
|
89
84
|
provider: 'claude-code',
|
|
@@ -94,11 +89,10 @@ const bash: ToolCall = {
|
|
|
94
89
|
description: 'Show current directory and git info'
|
|
95
90
|
},
|
|
96
91
|
output:
|
|
97
|
-
'/Users/
|
|
92
|
+
'/Users/kim/git/confetti\n---\ntotal 232\ndrwxr-xr-x 19 kim staff 608 Jun 9 19:41 .\ndrwxr-xr-x 52 kim staff 1664 Jun 15 10:32 ..\ndrwx------ 3 kim staff 96 Nov 17 2025 .claude\ndrwxr-xr-x 15 kim staff 480 May 23 09:30 .git\n-rw-r--r-- 1 kim staff 294 May 23 08:52 .gitignore\ndrwxr-xr-x@ 3 kim staff 96 Jun 9 19:41 .moi\n-rw-r--r-- 1 kim staff 95 Nov 13 2025 .prettierrc\n-rw-r--r-- 1 kim staff 73126 May 23 09:29 bun.lock\ndrwxr-xr-x@ 8 kim staff 256 May 23 09:31 esm\n-rw-r--r-- 1 kim staff 1210 Nov 13 2025 LICENSE\ndrwxr-xr-x 160 kim staff 5120 May 23 09:30 node_modules\n-rw-r--r-- 1 kim staff 2072 May 23 08:52 package.json\n-rw-r--r--@ 1 kim staff 4600 May 5 21:49 README.md\ndrwxr-xr-x 16 kim staff 512 May 5 21:49 src\n-rw-r--r-- 1 kim staff 605 Nov 13 2025 tsconfig.json\n-rw-r--r-- 1 kim staff 233 Nov 13 2025 tsconfig.node.json\n-rw-r--r-- 1 kim staff 1582 May 23 08:52 vite.config.ts\ndrwxr-xr-x 11 kim staff 352 May 5 21:49 web\n--- git ---\ntrue\norigin\tgit@github.com:acme/confetti.git (fetch)\norigin\tgit@github.com:acme/confetti.git (push)'
|
|
98
93
|
}
|
|
99
94
|
|
|
100
|
-
//
|
|
101
|
-
// recorded thread included a Read, but the group spec calls for one.
|
|
95
|
+
// Matches a real Claude Read result (cat -n style body).
|
|
102
96
|
const readFile: ToolCall = {
|
|
103
97
|
toolCallId: 'toolu_fixture_read_readme',
|
|
104
98
|
name: 'Read',
|
|
@@ -106,36 +100,36 @@ const readFile: ToolCall = {
|
|
|
106
100
|
provider: 'claude-code',
|
|
107
101
|
state: 'success',
|
|
108
102
|
input: {
|
|
109
|
-
file_path: '/Users/
|
|
103
|
+
file_path: '/Users/kim/git/confetti/docs/open-source/README.md'
|
|
110
104
|
},
|
|
111
105
|
output:
|
|
112
|
-
' 1\t# 🛥 Open-Source\n 2\t\n 3\tWorking notes, specs, and ideas for my open-source projects.\n 4\t\n 5\t| Project | What it is |\n 6\t|---------|------------|\n 7\t|
|
|
106
|
+
' 1\t# 🛥 Open-Source\n 2\t\n 3\tWorking notes, specs, and ideas for my open-source projects.\n 4\t\n 5\t| Project | What it is |\n 6\t|---------|------------|\n 7\t| tinyrouter | Minimalist hooks-based router for React |\n 8\t| confetti | <Confetti> burst effect for React |\n'
|
|
113
107
|
}
|
|
114
108
|
|
|
115
|
-
// A native GitHub MCP call
|
|
116
|
-
//
|
|
109
|
+
// A native GitHub MCP call. Renders via the same native-MCP path as notion:
|
|
110
|
+
// github logo + "Github" + `get_me`.
|
|
117
111
|
const githubCall: ToolCall = {
|
|
118
|
-
toolCallId: '
|
|
112
|
+
toolCallId: 'toolu_fixture_github_get_me',
|
|
119
113
|
name: 'mcp__github__get_me',
|
|
120
114
|
caller: 'model',
|
|
121
115
|
provider: 'claude-code',
|
|
122
116
|
state: 'success',
|
|
123
117
|
input: {},
|
|
124
118
|
output:
|
|
125
|
-
'{"login":"
|
|
119
|
+
'{"login":"octocat","id":583231,"profile_url":"https://github.com/octocat","avatar_url":"https://avatars.githubusercontent.com/u/583231?v=4","details":{"name":"The Octocat","blog":"https://github.blog","location":"San Francisco","hireable":true,"twitter_username":"github","public_repos":8,"public_gists":8,"followers":700,"following":9,"created_at":"2011-01-25T18:44:36Z","updated_at":"2026-06-13T09:04:50Z"}}'
|
|
126
120
|
}
|
|
127
121
|
|
|
128
|
-
// A reasoning ("Thinking") step
|
|
129
|
-
//
|
|
122
|
+
// A reasoning ("Thinking") step. It's a Part, not a ToolCall, which is why the
|
|
123
|
+
// lists are `Part[]`.
|
|
130
124
|
const thinking: Part = {
|
|
131
125
|
type: 'reasoning',
|
|
132
126
|
text: 'The user is greeting me casually with "Hey bro". This is a friendly greeting and they\'re not asking me to do anything specific yet. I should respond in a friendly, casual way and let them know I\'m ready to help with whatever they need.'
|
|
133
127
|
}
|
|
134
128
|
|
|
135
|
-
// A Skill launch
|
|
136
|
-
//
|
|
129
|
+
// A Skill launch. `name: 'Skill'` + a `skill` sidecar; renders as a
|
|
130
|
+
// "Loading Skill" timeline row.
|
|
137
131
|
const skillCall: ToolCall = {
|
|
138
|
-
toolCallId: '
|
|
132
|
+
toolCallId: 'toolu_fixture_skill_widgets',
|
|
139
133
|
name: 'Skill',
|
|
140
134
|
caller: 'model',
|
|
141
135
|
provider: 'claude-code',
|
|
@@ -158,7 +152,7 @@ export const multipleToolCalls: Part[] = [
|
|
|
158
152
|
{ type: 'tool-call', call: notionFetchOpenSource },
|
|
159
153
|
{ type: 'tool-call', call: readFile },
|
|
160
154
|
{ type: 'tool-call', call: bash },
|
|
161
|
-
{ type: 'tool-call', call:
|
|
155
|
+
{ type: 'tool-call', call: notionFetchConfetti },
|
|
162
156
|
{ type: 'tool-call', call: githubCall }
|
|
163
157
|
]
|
|
164
158
|
|
|
@@ -188,43 +182,43 @@ export const liveToolCalls: Part[] = [
|
|
|
188
182
|
}
|
|
189
183
|
]
|
|
190
184
|
|
|
191
|
-
// A *streaming* subagent (caller='subagent', name='Agent'),
|
|
192
|
-
//
|
|
185
|
+
// A *streaming* subagent (caller='subagent', name='Agent'), shaped like a live
|
|
186
|
+
// Explore subagent run. The `subagent` record fills in incrementally from
|
|
193
187
|
// `task_*` events (lib/claude-adapter.ts): `progress[]` accumulates one "latest
|
|
194
188
|
// action" line per tool use (the last is what the collapsed card shows live),
|
|
195
189
|
// alongside `status`, `usage`, and a growing `transcript`. None of it is
|
|
196
190
|
// persisted — a finished/replayed Agent call has none of this, only a live one
|
|
197
|
-
// does. Here it's mid-run (status 'running')
|
|
198
|
-
//
|
|
191
|
+
// does. Here it's mid-run (status 'running'); the transcript is a trimmed
|
|
192
|
+
// version of the work so far.
|
|
199
193
|
const subagentCall: ToolCall = {
|
|
200
|
-
toolCallId: '
|
|
194
|
+
toolCallId: 'toolu_fixture_subagent',
|
|
201
195
|
name: 'Agent',
|
|
202
196
|
caller: 'subagent',
|
|
203
197
|
provider: 'claude-code',
|
|
204
198
|
state: 'running',
|
|
205
199
|
input: {
|
|
206
|
-
description: 'Explore
|
|
200
|
+
description: 'Explore mdnav-demo repo structure and purpose',
|
|
207
201
|
subagent_type: 'Explore',
|
|
208
202
|
prompt:
|
|
209
|
-
'Explore the
|
|
203
|
+
'Explore the mdnav-demo repository to understand what it is. Look at the repo structure, what mdnav is, example markdown, and the purpose. Give a comprehensive overview citing specific files.'
|
|
210
204
|
},
|
|
211
205
|
// Still streaming — no final result yet.
|
|
212
206
|
output: '',
|
|
213
207
|
subagent: {
|
|
214
|
-
taskId: '
|
|
215
|
-
description: 'Explore
|
|
208
|
+
taskId: 'task_explore_mdnav',
|
|
209
|
+
description: 'Explore mdnav-demo repo structure and purpose',
|
|
216
210
|
status: 'running',
|
|
217
211
|
usage: { totalTokens: 18407, toolUses: 8, durationMs: 10725 },
|
|
218
|
-
//
|
|
212
|
+
// Each entry is the "latest action" at that step.
|
|
219
213
|
progress: [
|
|
220
|
-
'Reading ~/git/
|
|
214
|
+
'Reading ~/git/mdnav-demo',
|
|
221
215
|
'Reading README.md',
|
|
222
216
|
'Reading package.json',
|
|
223
217
|
'Reading CLAUDE.md',
|
|
224
|
-
'Running ls -la /Users/
|
|
218
|
+
'Running ls -la /Users/kim/git/mdnav-demo/',
|
|
225
219
|
'Finding **/*.md',
|
|
226
220
|
'Finding **/*.{js,ts,jsx,tsx}',
|
|
227
|
-
'Running head -100 /Users/
|
|
221
|
+
'Running head -100 /Users/kim/git/mdnav-demo/moby-dick.md'
|
|
228
222
|
],
|
|
229
223
|
transcript: [
|
|
230
224
|
{
|
|
@@ -234,7 +228,7 @@ const subagentCall: ToolCall = {
|
|
|
234
228
|
parts: [
|
|
235
229
|
{
|
|
236
230
|
type: 'reasoning',
|
|
237
|
-
text: 'Let me map the repo: list the markdown files, read the README, then see what the
|
|
231
|
+
text: 'Let me map the repo: list the markdown files, read the README, then see what the mdnav binary does.'
|
|
238
232
|
},
|
|
239
233
|
{
|
|
240
234
|
type: 'tool-call',
|
|
@@ -246,7 +240,7 @@ const subagentCall: ToolCall = {
|
|
|
246
240
|
state: 'success',
|
|
247
241
|
input: { pattern: '**/*.md' },
|
|
248
242
|
output:
|
|
249
|
-
'README.md\ndocs/
|
|
243
|
+
'README.md\ndocs/moby-dick.md\ndocs/sections/01-introduction.md\ndocs/sections/02-findings.md'
|
|
250
244
|
}
|
|
251
245
|
},
|
|
252
246
|
{
|
|
@@ -257,9 +251,9 @@ const subagentCall: ToolCall = {
|
|
|
257
251
|
caller: 'model',
|
|
258
252
|
provider: 'claude-code',
|
|
259
253
|
state: 'success',
|
|
260
|
-
input: { command: '
|
|
254
|
+
input: { command: 'mdnav --help' },
|
|
261
255
|
output:
|
|
262
|
-
'
|
|
256
|
+
'mdnav — navigate large markdown\n\nUSAGE: mdnav <file> <command>\n\nCOMMANDS:\n toc print the table of contents\n read read a section (fuzzy/regex/path selector)\n search full-text search'
|
|
263
257
|
}
|
|
264
258
|
}
|
|
265
259
|
]
|
|
@@ -271,7 +265,7 @@ const subagentCall: ToolCall = {
|
|
|
271
265
|
parts: [
|
|
272
266
|
{
|
|
273
267
|
type: 'text',
|
|
274
|
-
text: '## Comprehensive Overview of
|
|
268
|
+
text: '## Comprehensive Overview of mdnav-demo\n\n**mdnav-demo** showcases **mdnav**, a CLI for large markdown documents, using the full text of Moby-Dick as a large-document fixture.'
|
|
275
269
|
}
|
|
276
270
|
]
|
|
277
271
|
}
|
|
@@ -283,13 +277,13 @@ const subagentCall: ToolCall = {
|
|
|
283
277
|
// `output`, and the toolUses count shown in place of the latest-action line.
|
|
284
278
|
const subagentDoneCall: ToolCall = {
|
|
285
279
|
...subagentCall,
|
|
286
|
-
toolCallId: '
|
|
280
|
+
toolCallId: 'toolu_fixture_subagent_done',
|
|
287
281
|
state: 'success',
|
|
288
282
|
output:
|
|
289
|
-
'
|
|
283
|
+
'mdnav-demo showcases **mdnav**, a CLI for navigating large markdown documents. The repo is a demo harness: a single `moby-dick.md` fixture plus a thin CLI (`toc`/`read`/`search`) that fuzzy-selects sections. README and CLAUDE.md frame it as a worked example, not a library.',
|
|
290
284
|
subagent: {
|
|
291
285
|
...subagentCall.subagent!,
|
|
292
|
-
taskId: '
|
|
286
|
+
taskId: 'task_explore_mdnav_done',
|
|
293
287
|
status: 'completed'
|
|
294
288
|
}
|
|
295
289
|
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { useQueryClient } from '@tanstack/react-query'
|
|
2
|
+
|
|
3
|
+
import { useUpdateEnv, useWorkspaceEnv, workspaceKeys } from '@/client/api/workspaces'
|
|
4
|
+
|
|
5
|
+
import { useMeiEvent } from './useMeiEvents'
|
|
6
|
+
|
|
7
|
+
// Workspace env state in one hook: the masked env view (query), the patch
|
|
8
|
+
// mutation, and live tracking — anything that changes the env outside this
|
|
9
|
+
// client (the `moi env` CLI, another tab) makes the server broadcast
|
|
10
|
+
// `env:updated`, which invalidates the query so consumers stay fresh without
|
|
11
|
+
// wiring the subscription themselves.
|
|
12
|
+
export function useEnvVars(workspaceId: string) {
|
|
13
|
+
const qc = useQueryClient()
|
|
14
|
+
useMeiEvent(e => {
|
|
15
|
+
if (e.type === 'env:updated' && e.workspaceId === workspaceId) {
|
|
16
|
+
qc.invalidateQueries({ queryKey: workspaceKeys.env(workspaceId) })
|
|
17
|
+
}
|
|
18
|
+
})
|
|
19
|
+
return { env: useWorkspaceEnv(workspaceId), update: useUpdateEnv(workspaceId) }
|
|
20
|
+
}
|
|
@@ -10,6 +10,8 @@ export type MeiEvent =
|
|
|
10
10
|
| { type: 'view-layout:updated'; views: ViewInfo[] }
|
|
11
11
|
| { type: 'theme:updated' }
|
|
12
12
|
| { type: 'workspace:updated' }
|
|
13
|
+
// A workspace's env changed outside the UI — refetch the env view.
|
|
14
|
+
| { type: 'env:updated'; workspaceId: string }
|
|
13
15
|
// The Scratchpad canvas for `workspaceId` was saved — open tabs reload from
|
|
14
16
|
// disk. `origin` is the tab that wrote it, so that tab can skip its own echo.
|
|
15
17
|
| { type: 'scratchpad:updated'; workspaceId: string; origin?: string }
|