Add dor identify: cmux-inspired JSON identity dump#210
Open
nedtwigg wants to merge 3 commits into
Open
Conversation
Composes over the existing surface.list control method (no new host plumbing): the caller surface is matched locally against DORMOUSE_SURFACE_ID, focused comes from the list, and the control endpoint paths are read from the terminal's injected env. Supports --id-format per the handle-model invariant; caller/focused/path fields are null when unresolvable. Also fixes scripts/spec-lint.mjs on Windows (pre-existing): fileURLToPath for ROOT instead of URL.pathname, and POSIX-form repo-relative spec paths so the index-completeness check matches the markdown. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
`find` on an undefined DORMOUSE_SURFACE_ID already misses every surface, so the guard ternary duplicated what `?? null` provides; now symmetric with the adjacent focused lookup. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
dor identify: cmux-inspired JSON identity dumpdor identify: cmux-inspired JSON identity dump
Deploying mouseterm with
|
| Latest commit: |
b87cf8b
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://2e23a2ed.mouseterm.pages.dev |
| Branch Preview URL: | https://dor-identify.mouseterm.pages.dev |
dormouse-bot
approved these changes
Jul 5, 2026
- New public PTY env: DORMOUSE_HOST (vscode | standalone) injected by each host, and DORMOUSE_HOST_WORKSPACE (VS Code only: the window's .code-workspace file, else its first workspace folder). - `dor identify` now emits host / host_workspace and no longer echoes the control socket path: the CLI is the public API and the socket is private host plumbing (there is no socket API to advertise). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
dormouse-bot
approved these changes
Jul 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a
dor identifycommand: a JSON dump of where the invoking terminal sits within Dormouse and which app is hosting it.{ caller: { is_browser_surface: false, pane_ref: pane:1, surface_ref: surface:1, surface_type: terminal, window_ref: window:1, workspace_ref: workspace:1 }, cli_js_path: /path/to/dor-cli/dist/dor.js, focused: { ... }, host: vscode, host_workspace: /path/to/project, node_path: /path/to/node }Design decisions
surface.list, which already carries ids, refs, focus, and workspace/window refs; the caller is matched locally againstDORMOUSE_SURFACE_ID.--id-format refs|uuids|bothper the handle-model invariant.DORMOUSE_HOST(vscode|standalone) injected by each host, andDORMOUSE_HOST_WORKSPACE(VS Code only: the owning window''s.code-workspacefile when loaded, else its first workspace folder).DORMOUSE_CONTROL_SOCKETis set.callerisnullwhen the invoking surface is not visible (e.g. minimized to a Door); env-derived fields arenullwhen the variable is absent (e.g. an older host).Also fixes
scripts/spec-lint.mjson Windows (pre-existing):URL.pathnameproducedC:\C:\...roots, and backslash joins broke the index-completeness comparison against forward-slash paths in the markdown.Testing
--id-format both, no-env, invisible caller); help snapshots regenerated — all 68dortests pass.pnpm lint:specspasses (now also on Windows); vscode-ext build andcargo checkpass.🤖 Generated with Claude Code