pi-multica-doctor0.1.6
Multica workspace health, one command
Untested on omp
This is a pi package. No one has reported whether it works on omp yet. If you try it, add your result below.
Reports 0
No reports yet.
Readme
pi-multica-doctor
Multica workspace health, one command.
What this is
pi-multica-doctor is a TypeScript Pi package that reports read-only Multica workspace diagnostics as JSON. Run it as the /multica-doctor-check slash command, let an agent call the multica_doctor_check tool, or run the bundled CLI from a shell or script.
It surfaces problems and hints. It never repairs anything, never mutates Multica state, and never writes to your vault. Two probes really run today, auth_context and feedback_jsonl; the other three check names are reserved and report pass without checking, which the report states explicitly.
Features
- Read-only diagnostics with a stable JSON report:
checks,pass,fail_count,failures, and a per-checkresultsarray. auth_contextprobe: reports whetherMULTICA_TOKENis set and whether a stale.multica/daemon_task_context.jsonis left in the working directory. Presence only — the token value is never read or printed.feedback_jsonlprobe: parses every nonblank line of the.jsonlfiles directly in the vault'sfeedback-eventsdirectory and reports invalid lines as a boundedfile:linelist plus one short excerpt.resultslists one entry per check inchecksorder with its ownstatusanddetail, so a passing report still shows which probes really ran.- Three entry points: a Pi slash command, a Pi tool for agents, and a CLI that prints the report to stdout and exits
0on pass or1on fail. cli_syntax,registry_tables, andstuck_runsare not implemented yet. They reportpasswithout checking and say so in theirdetail, so nothing hides behind a green report.- No network calls and no secret handling beyond token presence checks.
Install
Install the published npm package into your user Pi settings:
pi install npm:pi-multica-doctor
Install into the current project instead:
pi install npm:pi-multica-doctor -l
The package also ships two CLI bins that point at the same entry script, pi-multica-doctor and multica-doctor-check, so the checks can run without Pi. Node >=22.18.0 is required, and the installed bins currently hit a Node TypeScript limit described under Usage → CLI.
Quick start
With the package installed in Pi, run the slash command:
/multica-doctor-check
From a source checkout, load the extension without installing it and run the same command:
npm install
pi -e .
The CLI prints the same report. Run it from a source checkout:
node ./bin/multica-doctor-check.js
Set OBSIDIAN_VAULT_ROOT when the checkout is not the vault root.
Usage
Pi slash command
/multica-doctor-check
The command prints the JSON report and, when Pi has a UI, notifies it with the pass/fail summary.
Pi tool
Agents can call multica_doctor_check directly. The tool takes no parameters and returns JSON like:
{
"checks": [
"auth_context",
"cli_syntax",
"registry_tables",
"feedback_jsonl",
"stuck_runs"
],
"pass": true,
"fail_count": 0,
"failures": [],
"results": [
{
"check": "auth_context",
"status": "pass",
"detail": "daemon_task_context.json: absent; MULTICA_TOKEN: present"
},
{
"check": "cli_syntax",
"status": "pass",
"detail": "cli_syntax probe is not implemented yet; it reports pass without checking"
},
{
"check": "registry_tables",
"status": "pass",
"detail": "registry_tables probe is not implemented yet; it reports pass without checking"
},
{
"check": "feedback_jsonl",
"status": "pass",
"detail": "All 1 feedback-events JSONL file(s) have valid JSON lines"
},
{
"check": "stuck_runs",
"status": "pass",
"detail": "stuck_runs probe is not implemented yet; it reports pass without checking"
}
]
}
auth_contextchecks thatMULTICA_TOKENis nonempty and that.multica/daemon_task_context.jsonis absent from the current working directory. It does not validate the token with Multica.feedback_jsonlparses each nonblank line of the.jsonlfiles directly in the vault'sfeedback-eventsdirectory. The probe looks for that directory underOBSIDIAN_VAULT_ROOTwhen the variable is set, and under the current working directory when it is unset, soOBSIDIAN_VAULT_ROOTtakes precedence and there is no fallback to the working directory when the configured directory is missing. The directory is resolved from theFEEDBACK_EVENTS_RELATIVEconstant insrc/probes/feedback_jsonl.ts, and a failuredetailnames the relative path that was searched. Each line is parsed on its own, so a pretty-printed JSON object spread over several lines is reported as invalid. A missing or unreadable directory, an unreadable file, or an invalid JSON line fails the probe; an existing directory with no.jsonlfiles passes.cli_syntax,registry_tables, andstuck_runsare not implemented yet. They reportpasswithout checking CLI syntax, registry tables, or stuck runs, and theirdetailsays so.
CLI
node ./bin/multica-doctor-check.js
The CLI writes the JSON report to stdout whether the checks pass or fail. It exits with status 0 when pass is true and 1 when pass is false. On failure, see fail_count and failures in the report. On any run, results shows which probes really ran. A startup error may exit without a report. Set OBSIDIAN_VAULT_ROOT if the checkout isn't the vault root.
The installed package exposes the same entry script as the bins pi-multica-doctor and multica-doctor-check, so npx pi-multica-doctor and npx multica-doctor-check are the installed forms. Node does not strip TypeScript types from files under node_modules, so those forms currently exit with ERR_UNSUPPORTED_NODE_MODULES_TYPE_STRIPPING; run node ./bin/multica-doctor-check.js from a source checkout instead.
Package contents
| Path | Purpose |
|---|---|
bin/multica-doctor-check.js |
CLI entry point behind both bins and the Pi multica-doctor-check command |
extensions/index.ts |
Pi extension entry: registers the /multica-doctor-check command and the multica_doctor_check tool |
src/multica_doctor_check.ts |
Check runner and the JSON report contract (CHECK_NAMES, results) |
src/probes/auth_context.ts |
auth_context probe |
src/probes/feedback_jsonl.ts |
feedback_jsonl probe and feedback-events directory discovery |
README.md, LICENSE, CHANGELOG.md |
Shipped package docs |
Those are the paths listed in files in package.json; tests/ and the GitHub workflows stay in the repository and are not part of the npm tarball.
Development
npm install
npm run ci
pi -e .
npm run ci runs npm run check: tsc --noEmit, node --test tests/*.test.mjs, and npm pack --dry-run. Run npm pack --dry-run yourself whenever you add, remove, or rename a shipped file. CI runs the same command on Ubuntu, Windows, and macOS. See CONTRIBUTING.md.
Release
Publishing uses npm Trusted Publishing by GitHub OIDC (id-token: write in .github/workflows/publish.yml). No NPM_TOKEN is stored in repository secrets, and none should be added.
Pushes and merges to main run CI only. A release is prepared in a pull request and then started explicitly:
- The
versionbump inpackage.jsonand the matchingCHANGELOG.mdentry ride in the same pull request. The workflows read the version frompackage.jsononmain. - After that pull request merges, an owner dispatches
.github/workflows/auto-release.ymlonmainwithrelease_authorizedset totrue. It skips when the version matches the lastv*tag or the tag already exists; otherwise it creates and pushesv<version>, opens the GitHub release, and triggerspublish.ymlfor that tag. publish.ymlchecks out the ref, runsnpm ciandnpm run ci, skips a version that npm already has, and runsnpm publish --access public.
publish.yml also runs on a v*.*.* tag push, on a published GitHub release, on a manual dispatch with an optional ref, and when the workflow file itself changes on main. Ordinary maintenance verification must not publish: do not tag or dispatch these workflows unless a release is authorized.
Docs
CHANGELOG.md— released versions and notable changesCONTRIBUTING.md— development setup, local Pi testing, and the pull request checklistSECURITY.md— supported versions and vulnerability reportingCODE_OF_CONDUCT.md— community expectations
This README is the entry point on both GitHub and npm; the package keeps no separate docs/ directory.
Security
Pi packages can execute code with your local user permissions. Review extensions before installing third-party packages.
This package is read-only: it checks whether MULTICA_TOKEN is set without reading its value, looks for a stale .multica/daemon_task_context.json, and parses feedback JSONL files. It performs no network calls and writes nothing.
Only the latest published version receives security fixes. To report a vulnerability, see SECURITY.md.
Links
- npm: https://www.npmjs.com/package/pi-multica-doctor
- GitHub: https://github.com/eiei114/pi-multica-doctor
- Issues: https://github.com/eiei114/pi-multica-doctor/issues
License
MIT — see LICENSE.