Dashboard › opencode › Distillation
8bc54c4c-2545-408f-aa04-b06006ca9e10["lore_tm_v1_tcAG0LwxTMI3DRX0Xeib3dxlH0lQbxQTl8ENvwUJ3bE","lore_tm_v1_Qm4ulxbfTZx6U8_ZldEmcvD1bB1pRWK2E8OzBXKJtFA","lore_tm_v1_c9e3cO7-EdRmLJbLaRzJYpoMW4HUV0QJKaKjIviq6yw","lore_tm_v1_2_Vpqn7hR6s1B5Q668q4BW-ubHzz8isPL5UW7Fq_d8M","lore_tm_v1_AFu7UlWrR0dW3LOplO6TGl3dikyNCuFONXk-0QVXqog","lore_tm_v1_C_S5KYq-lRyGJ-z6aVInQj4JiEcUOiNcnbb3ifRuTfg","lore_tm_v1_rbE_-JieyO4huCTjtLeCPgQPHc_oOCf1vvGPulBtLRI","lore_tm_v1_OX6njhQAJRN-dlBTAKzw0OVVz8SD5NZE1j2mNoW9eSw","lore_tm_v1_Qx4Rx2gmH2KC4Zs7CQJWF1ZrO3JVLY4k7CY3eaYHdM0"]
packages/core/src/permission.ts lines 221–252: Permission.assert evaluates input, returns BlockedError for "deny" with rules, permission, resources, and reason; returns immediately for "allow"; otherwise creates a pending request inside Effect.uninterruptibleMask, restores interruptibility only around Deferred.await(item.deferred), tunnels Permission.DeclinedError through Effect.die(error), and removes the request from pending in Effect.ensuring.packages/core/src/permission.ts lines 254–274: Permission.reply is uninterruptible, returns NotFoundError when input.requestID is absent, publishes Permission.Event.Replied, and on "reject" fails the deferred with CorrectedError({ feedback: input.message }) when a message exists or DeclinedError() otherwise, then deletes that pending request and processes other pending requests from the same session.pty_spawn, pty_write, and pty_kill; verified pty_spawn uses "shell" permission; checked invalid spawn inputs, explicit shell denial, symlink-based external-directory denial, cross-session PTY isolation, paging, output-flood and byte bounds, in-flight deletion, deleted-owner admission, and concurrent per-owner reservation limits. Visible fixture paths included /tmp/opencode/does-not-exist, /tmp/opencode/does-not-exist.sock, and /tmp/opencode/pty-project./tmp/opencode/pty-smoke-tsconfig.json configures allowImportingTsExtensions: true, module: "Preserve", moduleResolution: "Bundler", noEmit: true, target: "ESNext", and maps @opencode/plugin to /tmp/opencode/pty-plugin-stub.ts./tmp/opencode/pty-tsconfig.json typechecks /home/byk/.local/share/opencode-v2-pilot/config/opencode/plugins/pty.ts with strict: true, skipLibCheck: true, allowImportingTsExtensions: true, noEmit: true, module: "Preserve", moduleResolution: "Bundler", target: "ESNext", libs ESNext, DOM, and DOM.Iterable, and types bun and node./tmp/opencode/pty-tsconfig.json maps @opencode/plugin to /home/byk/Code/opencode-v2-pilot/packages/plugin/src/promise/index.ts, @opencode/plugin/* to /home/byk/Code/opencode-v2-pilot/packages/plugin/src/promise/*.ts, effect to /home/byk/Code/opencode-v2-pilot/node_modules/.bun/effect@4.0.0-rc.112/node_modules/effect/dist/index.d.ts, and effect/* to the corresponding dist/*.d.ts./tmp/opencode/pty-tsconfig.json uses type roots /home/byk/.local/share/opencode-v2-pilot/config/opencode/node_modules/@types and /home/byk/Code/opencode-v2-pilot/node_modules/.bun/@types+node@24.12.2/node_modules/@types.tsgo/typecheck-related matches. Displayed scripts included: packages/sdk → tsgo -b; services/updates and services/files → tsgo --noEmit; packages/plugin-browser → tsgo --noEmit -p tsconfig.test.json; packages/latex, packages/util, and packages/httpapi-codegen → tsgo --noEmit; packages/http-recorder → tsgo --noEmit && tsgo -p test/tsconfig.json --noEmit; packages/client → tsgo --noEmit; packages/enterprise, packages/desktop, packages/app, packages/tui, packages/simulation, packages/session-ui, and packages/server → tsgo -b; packages/ui and packages/cli → tsgo --noEmit; packages/core → tsgo -b tsconfig.json tsconfig.tests.json; packages/app also has typecheck:e2e → tsgo -p e2e/tsconfig.json.packages/console/support, packages/console/function, packages/console/core, packages/theme, packages/stats/server, packages/stats/core, packages/schema, packages/protocol, packages/plugin, packages/merman, packages/codemode, packages/console/app, and packages/stats/app → tsgo --noEmit; packages/ai → tsgo --noEmit && tsgo --noEmit -p tsconfig.types.json. Root package.json pins oxlint-tsgolint to 0.21.0.No files found; the displayed results did not identify their queries. A separate command returned no output.packages/core/test/persistent-pty-daemon.test.ts contains 5 live daemon-transport tests: 1. rediscovery after same-protocol registration rotation for requestIfRunning({ op: "list" }) and start-required request({ op: "create" }, true); 2. rediscovery while acquiring a subscription; 3. retry of a start-required request when connection fails before dispatch; 4. no replay of a dispatched mutating request whose response is lost; 5. rejection of an incompatible daemon without replacement or termination.packages/core/test/persistent-pty-daemon.test.ts change credentials and instance IDs from old-token/old-instance to new-token/new-instance, and then to newest-token/newest-instance; the list request still returns { type: "terminals", terminals: [] }, and the create operation is dispatched exactly once.daemon.subscribe(1, { cursor: 0, attachmentID: "attachment", role: "observer", onEvent: () => {}, onEnd: () => {} }); the fixture returns an "attached" observer response with generation 1, offsets 0, truncated: false, and empty replay_base64; assertions require terminal ID 1 and exactly 1 subscription before attachment.detach().first.sock, closes that listener after discovery, registers second.sock, then calls daemon.request({ op: "create" }, true) and verifies exactly 1 create dispatch."create" and before returning a response. daemon.request({ op: "create" }, true) must fail with error.kind === "response" while the create count remains exactly 1, proving the mutating request is not replayed after dispatch.service.json with protocol 6 while the client protocol is 7, using a live sleep 30 fixture process. Both requestIfRunning({ op: "list" }) and start-required request({ op: "create" }, true) fail with { kind: "protocol", message: "opencode-pty protocol mismatch: daemon=6, client=7", pid }; the existing process remains alive and is neither replaced nor killed.packages/core/test/persistent-pty-daemon.test.ts use temporary directories prefixed opencode-pty-test-, Unix socket request framing with a 4-byte big-endian payload length, JSON envelopes containing token and request, and registration files at service.json containing instance_id, pid, protocol 7, socket, and token.packages/core/test/persistent-pty-daemon.test.ts uses pid: null, title "test", foreground_process: null, group_id: "test", command ["test"], cwd "/tmp", dimensions 80×24, lifecycle status "running", and output offsets output_head: 0 and output_tail: 0.