moi-computer 0.1.0 → 0.1.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/README.md CHANGED
@@ -45,7 +45,7 @@ moi init [dir] --web # also start the server and open the browser
45
45
  Start the web server:
46
46
 
47
47
  ```sh
48
- moi start # http://localhost:3000
48
+ moi start # http://localhost:13337
49
49
  moi start --port=4000 # custom port
50
50
  ```
51
51
 
@@ -63,7 +63,7 @@ moi openclaw init # install moi skills into an OpenClaw agent workspace
63
63
 
64
64
  ```sh
65
65
  bun install
66
- bun run dev # watch-and-restart dev server on port 3000
66
+ bun run dev # watch-and-restart dev server on port 13337
67
67
  ```
68
68
 
69
69
  `bun run dev` starts a supervisor that hot-reloads the frontend in place and
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "moi-computer",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "Local AI workspace powered by the Claude Agent SDK, Bun, React, and Tailwind. Requires Bun.",
5
5
  "license": "Elastic-2.0",
6
6
  "type": "module",
@@ -56,6 +56,7 @@
56
56
  },
57
57
  "dependencies": {
58
58
  "@anthropic-ai/claude-agent-sdk": "^0.3.197",
59
+ "@anthropic-ai/sdk": "^0.109.1",
59
60
  "@base-ui/react": "^1.2.0",
60
61
  "@dnd-kit/core": "^6.3.1",
61
62
  "@tabler/icons-react": "^3.44.0",
package/server/CLAUDE.md CHANGED
@@ -1,4 +1,4 @@
1
- Bun server on port 3000. Serves the client at `/`, upgrades `/ws` to WebSocket.
1
+ Bun server on port 13337. Serves the client at `/`, upgrades `/ws` to WebSocket.
2
2
 
3
3
  - `web.ts` owns the Bun fullstack surface only: the SPA HTML shell (dev bundler + HMR / prebuilt `dist/`), the two WebSocket channels (`/ws` chat, `/api/workspaces/ws` live events), and graceful shutdown. Every HTTP API request is delegated to the Hono app via `fetch`.
4
4
  - `api.ts` is the Hono REST API (all `/api/*` routes). `withWorkspace` middleware resolves `:id` → workspace (404 if missing) and stashes it on the context, so handlers read `c.get('ws')`. Its catch-all serves the prebuilt client from `dist/` in prod via Hono's `serveStatic` (cached, traversal-safe).
@@ -10,6 +10,8 @@ import { basename, dirname, join, relative, sep } from 'path'
10
10
 
11
11
  import type { ViewConfig, WidgetConfig } from '@/lib/types'
12
12
 
13
+ import { prebuilt } from './static'
14
+
13
15
  // An **applet** is any custom UI unit embedded in a workspace; `widget` and
14
16
  // `view` are its kinds (more may follow). All compile through this pipeline —
15
17
  // `kind` only diverges at the edges: which `config` schema is parsed, the
@@ -519,6 +521,15 @@ export async function buildApplet(
519
521
  target: 'browser',
520
522
  sourcemap: 'inline',
521
523
  external: EXTERNAL_MODULES,
524
+ // Pin the JSX runtime to match the React build the vendor route serves
525
+ // (server/vendor.ts keys off the same `prebuilt` flag): production emits
526
+ // `jsx`/`jsxs` (react/jsx-runtime), development emits `jsxDEV`
527
+ // (react/jsx-dev-runtime). Without this, Bun defaults to `jsxDEV` (the
528
+ // widget `root` dir has no tsconfig to say otherwise), which crashes in a
529
+ // prebuilt/global install where the production React has `jsxDEV === undefined`.
530
+ define: {
531
+ 'process.env.NODE_ENV': JSON.stringify(prebuilt ? 'production' : 'development')
532
+ },
522
533
  // The bundle is a directory: a fixed `index.js` entry (the client
523
534
  // dynamic-imports it) plus content-hashed `chunk-*.js` for any dynamic
524
535
  // imports. Assets are emitted by the runtime plugin, not here. `[ext]` is
package/server/cli.ts CHANGED
@@ -308,7 +308,7 @@ const start = defineCommand({
308
308
  args: {
309
309
  port: {
310
310
  type: 'string',
311
- description: 'HTTP port to listen on (default: 3000)'
311
+ description: 'HTTP port to listen on (default: 13337)'
312
312
  }
313
313
  },
314
314
  async run({ args }) {
@@ -1,3 +1,3 @@
1
- export const PORT = Number(process.env.PORT) || 3000
1
+ export const PORT = Number(process.env.PORT) || 13337
2
2
  // M=13, E=5, I=9 -> 13059
3
3
  export const CONTROL_PORT = 13059