Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@ updates:
update-types:
- minor
- patch
# packages/code-mode depends on the typescript JS API (transpileModule,
# ScriptTarget, …) at runtime; the 6.0+ native compiler removed those
# exports, so the package stays pinned to 5.9. The workspace root already
# compiles on 7.x, so ignoring >=6 only affects that runtime pin.
# Retained from when an in-house Code Mode transpiler used the typescript
# JS API (transpileModule, ScriptTarget, …) at runtime and had to stay on
# 5.9, since the 6.0+ native compiler removed those exports. That
# transpiler is gone — @ai-sdk/code-mode owns transpilation now, and no
# workspace pins typescript — so this ignore no longer has a subject.
# Dropping it is a dependency-policy call, not this refactor's to make.
ignore:
- dependency-name: 'typescript'
versions:
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/windows-sandbox-w0.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,6 @@ jobs:
run: npm run build --workspace @maka/core
- name: Build storage workspace
run: npm run build --workspace @maka/storage
- name: Build code-mode workspace
run: npm run build --workspace @maka/code-mode
- name: Build runtime workspace
run: npm run build --workspace @maka/runtime
- name: Run real filesystem-worker operations through the broker
Expand Down
2 changes: 1 addition & 1 deletion apps/desktop/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"build:preload": "esbuild src/preload/preload.ts --bundle --platform=node --format=cjs --outfile=dist/preload/preload.cjs --external:electron",
"build:overlay": "node ../../scripts/build-cursor-overlay.mjs",
"build:renderer": "vite build && node ../../scripts/check-third-party-notices.mjs",
"build:workspace-deps": "npm --workspace @maka/code-mode run build && npm --workspace @maka/core run build && npm --workspace @maka/storage run build && npm --workspace @maka/mcp run build && npm --workspace @maka/runtime run build && npm --workspace @maka/runtime-host run build && npm --workspace @maka/computer-use run build && npm --workspace @maka/ui run build",
"build:workspace-deps": "npm --workspace @maka/core run build && npm --workspace @maka/storage run build && npm --workspace @maka/mcp run build && npm --workspace @maka/runtime run build && npm --workspace @maka/runtime-host run build && npm --workspace @maka/computer-use run build && npm --workspace @maka/ui run build",
"package:macos-arm64": "electron-builder --config electron-builder.config.mjs --mac --arm64 --publish never",
"package:windows-x64": "electron-builder --config electron-builder.config.mjs --win --x64 --publish never",
"typecheck": "tsc -p tsconfig.preload.json --noEmit && tsc -p tsconfig.main.json --noEmit && tsc -p tsconfig.renderer.json --noEmit && tsc -p tsconfig.storybook.json --noEmit",
Expand Down
148 changes: 50 additions & 98 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
"packageManager": "npm@11.19.0",
"type": "module",
"workspaces": [
"packages/code-mode",
"packages/core",
"packages/storage",
"packages/mcp",
Expand All @@ -33,8 +32,8 @@
"dev": "npm --workspace @maka/desktop run dev:hmr --",
"dev:full": "npm run build && npm --workspace @maka/desktop run start",
"cli:dev": "node packages/cli/dist/dev-cli.js",
"build": "npm --workspace @maka/code-mode run build && npm --workspace @maka/core run build && npm --workspace @maka/storage run build && npm --workspace @maka/mcp run build && npm --workspace @maka/runtime run build && npm --workspace @maka/runtime-host run build && npm --workspace @maka/computer-use run build && npm --workspace @maka/eval run build && npm --workspace maka-agent run build && npm --workspace @maka/ui run build && npm --workspace @maka/desktop run build",
"build:test": "npm run clean && npm --workspace @maka/code-mode run build && npm --workspace @maka/core run build && npm --workspace @maka/storage run build && npm --workspace @maka/mcp run build && npm --workspace @maka/runtime run build && npm --workspace @maka/runtime-host run build && npm --workspace @maka/computer-use run build && npm --workspace @maka/eval run build && npm --workspace maka-agent run build && npm --workspace @maka/ui run build && npm --workspace @maka/desktop run build:test",
"build": "npm --workspace @maka/core run build && npm --workspace @maka/storage run build && npm --workspace @maka/mcp run build && npm --workspace @maka/runtime run build && npm --workspace @maka/runtime-host run build && npm --workspace @maka/computer-use run build && npm --workspace @maka/eval run build && npm --workspace maka-agent run build && npm --workspace @maka/ui run build && npm --workspace @maka/desktop run build",
"build:test": "npm run clean && npm --workspace @maka/core run build && npm --workspace @maka/storage run build && npm --workspace @maka/mcp run build && npm --workspace @maka/runtime run build && npm --workspace @maka/runtime-host run build && npm --workspace @maka/computer-use run build && npm --workspace @maka/eval run build && npm --workspace maka-agent run build && npm --workspace @maka/ui run build && npm --workspace @maka/desktop run build:test",
"clean": "node scripts/clean-build.mjs",
"rebuild": "npm run clean && npm run build",
"check:stale": "node scripts/check-stale-dist.mjs",
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"clean": "node ../../scripts/clean-paths.mjs dist tsconfig.tsbuildinfo",
"build": "tsc -p tsconfig.json && node scripts/chmod-bin.mjs",
"typecheck": "tsc -p tsconfig.json --noEmit",
"pretest": "npm --workspace @maka/code-mode run build && npm --workspace @maka/core run build && npm --workspace @maka/storage run build && npm --workspace @maka/mcp run build && npm --workspace @maka/runtime run build && npm --workspace @maka/runtime-host run build && npm --workspace @maka/eval run build",
"pretest": "npm --workspace @maka/core run build && npm --workspace @maka/storage run build && npm --workspace @maka/mcp run build && npm --workspace @maka/runtime run build && npm --workspace @maka/runtime-host run build && npm --workspace @maka/eval run build",
"test": "npm run clean && npm run build && npm run test:dist",
"test:dist": "node --test \"dist/**/*.test.js\""
},
Expand Down
24 changes: 0 additions & 24 deletions packages/code-mode/package.json

This file was deleted.

9 changes: 0 additions & 9 deletions packages/code-mode/tsconfig.json

This file was deleted.

1 change: 1 addition & 0 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"./permission-profile": "./dist/permission-profile.js",
"./windows-path": "./dist/windows-path.js",
"./sandbox-boundary": "./dist/sandbox-boundary.js",
"./serialized-byte-length": "./dist/serialized-byte-length.js",
"./permission-profile-compiler": "./dist/permission-profile-compiler.js",
"./user-question": "./dist/user-question.js",
"./connections": "./dist/connections.js",
Expand Down
65 changes: 65 additions & 0 deletions packages/core/src/__tests__/serialized-byte-length.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
import assert from 'node:assert/strict';
import test from 'node:test';
import { serializedByteLength } from '../serialized-byte-length.js';

test('counts the bounded JSON representation used at the tool boundary', () => {
let inspectedPastLimit = false;
const trailing = Object.defineProperty({}, 'value', {
enumerable: true,
get: () => {
inspectedPastLimit = true;
throw new Error('must not inspect values after the byte limit');
},
});

assert.equal(serializedByteLength('\0'.repeat(10)), 62);
assert.equal(serializedByteLength(['x'.repeat(128), trailing], 32), 33);
assert.equal(inspectedPastLimit, false);
});

test('agrees with JSON.stringify on the payloads validation bounds', () => {
const payloads: unknown[] = [
{ fileSystem: { entries: [{ path: '/tmp/工作区', scope: 'subtree', access: 'write' }] } },
{ network: { enabled: true } },
{ kind: 'managed', profile: { roots: [] }, revision: 3 },
// Every two-byte escape, so dropping one from the escape set and falling
// back to \\uXXXX shows up as a byte-count disagreement.
{ text: 'tab\tnewline\nreturn\rbackspace\bformfeed\fquote"backslash\\ emoji😀 lone\ud800' },
[],
{},
];

for (const payload of payloads) {
assert.equal(
serializedByteLength(payload),
new TextEncoder().encode(JSON.stringify(payload)).byteLength,
JSON.stringify(payload),
);
}
});

test('pins the deliberate departure from JSON.stringify at the top level', () => {
// `JSON.stringify(undefined)` is unrepresentable, but an absent result is not
// an oversized one: four bytes conservatively bounds what callers publish in
// its place. Reporting infinity here would read downstream as "result too
// large".
assert.equal(serializedByteLength(undefined), 4);
assert.equal(serializedByteLength(null), 4);
});

test('reports values JSON cannot represent as unrepresentable', () => {
const circular: Record<string, unknown> = {};
circular.self = circular;

for (const value of [
() => 'x',
Symbol('unserializable'),
1n,
circular,
{ toJSON: () => 'x' },
new Date(0),
new (class Instance {})(),
]) {
assert.equal(serializedByteLength(value), Number.POSITIVE_INFINITY, String(value?.toString()));
}
});
Loading
Loading