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
4 changes: 4 additions & 0 deletions BENCHMARKS.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,10 @@ Re-measured at 0.9.0, after the completeness work widened eleven signatures and
description named the 64 KiB return-path cap. The four numbers moved together and the note
records the run: [aside-mcp-attach-260918.md](evidence/aside-mcp-attach-260918.md).

These are 0.9.0 figures and have not been re-measured since. The `desktop` namespace later added
twelve catalog rows (46 in all) and named itself in the resident description, which the suite
checks against the README; the definition total, schema and description sum above predate it.

## Where codemode loses

- **Single small grep.** Roughly a tie on time and **larger** on bytes: 43,948 against
Expand Down
6 changes: 3 additions & 3 deletions README.ko.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ PCRE2를 포함한 15.2.0으로 확인됐습니다. 바이너리는 `runtime/nat

그래서 에이전트의 실제 선택지는 bash로 부르는 POSIX `grep`과 `find`였고, 위 수치를 ripgrep이
아니라 그쪽에 대고 재는 이유도 그것입니다. ripgrep은 베이스라인이 아니라 천장입니다. 이 패키지는
그 엔진을 도구 하나 뒤의 게스트 액션 34개로 표면에 올립니다.
그 엔진을 도구 하나 뒤의 게스트 액션 46개로 표면에 올립니다.

ripgrep을 직접 부를 때와는 비슷합니다. `search.*`가 바로 그 바이너리를 부르니까요. 더 빠른 검색
엔진이 아니라, Aside가 이미 담아둔 엔진을 닿게 만들고 결과를 모델 앞에서 거르는 겁니다.
Expand Down Expand Up @@ -188,7 +188,7 @@ Aside는 2.0초에 그 서버를 껐고 복원은 3.6초에 다시 켰습니다.
CLI는 Aside의 도구 목록 캐시를 손으로 쓰지 않습니다. 그렇게 만든 캐시는 도구 정의가 바뀌는
순간 조용히 낡습니다.

이제 에이전트는 `mcp__aside-codemode__execute_code`를 바로 호출합니다. **2,034바이트**짜리 도구
이제 에이전트는 `mcp__aside-codemode__execute_code`를 바로 호출합니다. **2,043바이트**짜리 도구
설명은 모든 MCP 세션의 문맥에 항상 들어갑니다. CLI의 3,808바이트짜리 계정 블록보다 상주 문맥이
작다는 점도 MCP를 주 경로로 삼은 이유입니다.

Expand Down Expand Up @@ -411,7 +411,7 @@ TODO, all, every, each, across, repository, project라는 말은 검색 결과
`search.content`, `search.files`, `search.count` 가운데 하나를 한 번 부르고, 같은 코드 본문에서
결과를 거른 뒤 적중한 파일만 읽습니다.

**상주 문맥 비용, 실측값.** MCP 경로는 **2,034바이트**짜리 도구 설명을 모든 MCP 세션에 계속 둡니다.
**상주 문맥 비용, 실측값.** MCP 경로는 **2,043바이트**짜리 도구 설명을 모든 MCP 세션에 계속 둡니다.
CLI 경로는 **3,808바이트**짜리 계정 `AGENTS.md` 블록을 계속 두고, **8,973바이트**짜리 사용자 스킬은
필요할 때만 읽습니다. 상주 문맥이 더 작은 MCP가 주 경로에 유리합니다. MCP를 붙이지 못하거나 bash
카드를 선호할 때는 지원되는 CLI 경로를 씁니다. 이 비용은 작업을 묶어 줄인 왕복 횟수와 별개입니다.
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ in bash is using an undocumented implementation detail, not a provided tool.

So an agent's real options were POSIX `grep` and `find` through bash, which is why the numbers
above are measured against those and not against ripgrep. Ripgrep is the ceiling, not the
baseline. This package puts that engine on the surface as 34 guest actions behind one tool.
baseline. This package puts that engine on the surface as 46 guest actions behind one tool.

Against ripgrep called directly the two are level, because `search.*` shells out to that same
binary. This is not a faster search engine. It is the engine Aside already shipped, reachable,
Expand Down Expand Up @@ -202,7 +202,7 @@ entry still points at an older installation. Anything but `activated` comes with
step. The CLI never writes Aside's inventory cache by hand; doing so would go stale when
the tool definition changes.

The agent then calls `mcp__aside-codemode__execute_code` directly. Its **2,034-byte** tool
The agent then calls `mcp__aside-codemode__execute_code` directly. Its **2,043-byte** tool
description is always resident in every MCP session. That is less resident context than the CLI
route's 3,808-byte account block, one reason MCP is the first-class route.

Expand Down Expand Up @@ -437,7 +437,7 @@ Do not replace code mode with a native `read_file` loop, a bash `find`/`grep` pi
repeated grep calls. Make one `search.content`, `search.files` or `search.count` call, filter
the result, and read only the hits in the same body.

**Resident context cost, measured.** The MCP route keeps its **2,034-byte** tool description
**Resident context cost, measured.** The MCP route keeps its **2,043-byte** tool description
resident in every MCP session. The CLI route keeps the **3,808-byte** account `AGENTS.md` block
resident and loads the **8,973-byte** user skill only on demand. The smaller always-resident
footprint favours MCP as the first-class route. The CLI route remains supported where MCP does
Expand Down
3 changes: 2 additions & 1 deletion src/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import { loadConfig } from './config.js';
import { makeRootGuard } from './paths.js';
import { resolveCwd } from './host/cwd.js';
import { createDetailedRgResolver, getAsideBundledRgPath } from './rg.js';
import { createHostGlobals } from './host/globals.js';
import { createHostGlobals, closeSharedDesktop } from './host/globals.js';
import { runCode } from './sandbox.js';
import { requireInteger, fitEnvelope } from './execution-output.js';
import { resolveBrowserContext, parseCliArgv, parseExecutionArgv, validateAccount, validateHost, routingReport } from './browser-context.js';
Expand Down Expand Up @@ -471,6 +471,7 @@ try {
timeoutMs = Math.min(requested, config.maxTimeoutMs);
} catch (e) { fail(e.message); }
const out = await runCode(code, { timeoutMs, globals, maxResultBytes: config.maxResultBytes });
await closeSharedDesktop().catch(() => {});
if (browserContext) {
out.browserContext = routingReport(browserContext);
}
Expand Down
9 changes: 9 additions & 0 deletions src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ const DEFAULTS = {
// ~30s internal screenshot timeout; the host deadline is derived as inner + slack.
browseCaps: { enabled: true, timeoutMs: 25000, maxTabs: 8, concurrency: 4 },
browseContext: null,
// Off by default: driving native macOS apps is a bigger blast radius than reading files.
desktop: { enabled: false, packageDir: null, disclaimLauncher: null, idleMs: 120000 },
excludeGlobs: DEFAULT_EXCLUDES,
};

Expand Down Expand Up @@ -131,6 +133,13 @@ export function loadConfig(argv = process.argv.slice(2), env = process.env) {
if ('maxTabs' in obj.browseCaps) cfg.browseCaps.maxTabs = requireInteger('browseCaps.maxTabs', obj.browseCaps.maxTabs);
if ('concurrency' in obj.browseCaps) cfg.browseCaps.concurrency = requireInteger('browseCaps.concurrency', obj.browseCaps.concurrency);
}
if (obj.desktop && typeof obj.desktop === 'object') {
cfg.desktop = { ...(cfg.desktop || {}) };
if ('enabled' in obj.desktop) cfg.desktop.enabled = obj.desktop.enabled === true;
if ('packageDir' in obj.desktop) cfg.desktop.packageDir = obj.desktop.packageDir === null ? null : String(obj.desktop.packageDir);
if ('disclaimLauncher' in obj.desktop) cfg.desktop.disclaimLauncher = obj.desktop.disclaimLauncher === null ? null : String(obj.desktop.disclaimLauncher);
if ('idleMs' in obj.desktop) cfg.desktop.idleMs = requireInteger('desktop.idleMs', obj.desktop.idleMs);
}
if (obj.browseContext && typeof obj.browseContext === 'object') {
if (!cfg.browseContext) cfg.browseContext = {};
if ('account' in obj.browseContext) {
Expand Down
2 changes: 1 addition & 1 deletion src/execution-worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ function syncRpc(name, args) {
if (message.error) throw Object.assign(new Error(message.error.error), message.error);
return message.value;
}
const injected = { search: {}, fs: {}, actions: {}, browse: {}, report: {}, api: {}, recipes: {} };
const injected = { search: {}, fs: {}, actions: {}, browse: {}, report: {}, api: {}, desktop: {}, recipes: {} };
for (const name of manifest) {
const [root, method] = name.split('.');
if (method) injected[root][method] = (...args) => root === 'actions' ? syncRpc(name, args) : rpc(name, args);
Expand Down
1 change: 1 addition & 0 deletions src/guest-guidance.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const NAMESPACE_CALLS = {
search: ['search.content({ path, query })', 'search.content'],
browse: ['browse.exec({ urls })', 'browse.exec'],
api: ['api.batch(requests)', 'api.batch'],
desktop: ['desktop.get_app_state({ app })', 'desktop.get_app_state'],
report: ['report.build(options)', 'report.build'],
recipes: ['recipes.run(name, input)', 'recipes.run'],
read_file: ['read_file({ path })', 'read_file'],
Expand Down
2 changes: 2 additions & 0 deletions src/host/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import {
checkBrowseArgs,
} from './browse/actions-schema.js';
import { validateRecipeRun } from './browse/watch.js';
import { DESKTOP_ACTIONS } from './desktop/desktop-actions.js';
import { parseApplyPatch } from './patch.js';

// The guest manifest exposes these same functions twice: once as globals and once through
Expand Down Expand Up @@ -54,6 +55,7 @@ const REGISTRY = [
...REPORT_ACTIONS,
...API_ACTIONS,
...RECIPE_ACTIONS,
...DESKTOP_ACTIONS,
{
path: 'read_file',
description: 'Read a file using the Aside read_file shape. offset/limit are 1-indexed lines.',
Expand Down
20 changes: 20 additions & 0 deletions src/host/desktop/desktop-actions.js

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

Loading
Loading