{"_id":"@arcanemachine/pi-consult","name":"@arcanemachine/pi-consult","dist-tags":{"latest":"0.2.0"},"versions":{"0.2.0":{"name":"@arcanemachine/pi-consult","version":"0.2.0","description":"Run user-driven, isolated, text-only multi-model consultation workflows in Pi","type":"module","keywords":["pi","pi-coding-agent","pi-extension","pi-package","consultation","multi-model","workflow"],"pi":{"extensions":["./src/index.ts"],"image":"https://raw.githubusercontent.com/arcanemachine/pi-consult/main/logo.jpg"},"scripts":{"build":"tsc --noEmit","typecheck":"tsc --noEmit","test":"vitest run --root .","format":"prettier --write \"src/**/*.ts\" \"tests/**/*.ts\" package.json README.md AGENTS.md CHANGELOG.md LICENSE.md","format:check":"prettier --check \"src/**/*.ts\" \"tests/**/*.ts\" package.json README.md AGENTS.md CHANGELOG.md LICENSE.md","prepublishOnly":"npm run format:check && npm run typecheck && npm run test && npm run build"},"author":{"name":"Nicholas Moen"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/arcanemachine/pi-consult.git"},"homepage":"https://github.com/arcanemachine/pi-consult#readme","bugs":{"url":"https://github.com/arcanemachine/pi-consult/issues"},"engines":{"node":">=22.19.0"},"publishConfig":{"access":"public"},"peerDependencies":{"@earendil-works/pi-coding-agent":"*"},"peerDependenciesMeta":{"@earendil-works/pi-coding-agent":{"optional":true}},"devDependencies":{"@earendil-works/pi-coding-agent":"0.84.1","@types/node":"^25.3.3","prettier":"^3.8.3","typescript":"^5.9.3","vitest":"^4.1.6"},"gitHead":"3f1a3a28a2b7dd258e72eb1f6decedce933234b5","_id":"@arcanemachine/pi-consult@0.2.0","_nodeVersion":"24.16.0","_npmVersion":"11.13.0","dist":{"integrity":"sha512-VyqD9Qb8kJjM5aIsIr6zsA11rEW0Z39yHlGUUEhXmCYk3G+jjhmUvciYPbSE5GuCVMGM89arRYt+Q6wida3ltA==","shasum":"696d91830a8e018986845ebc6ad302388c2f01c0","tarball":"https://registry.npmjs.org/@arcanemachine/pi-consult/-/pi-consult-0.2.0.tgz","fileCount":9,"unpackedSize":116283,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQChmn/JmeeV5E/9kspXNMh3+y/dV9KllwAE6o8qjTfsfwIgMP5W3n85KJaVvhNVfEiUN1wr71Qbl5CuE+OXUGdGzt8="}]},"_npmUser":{"name":"arcanemachine","email":"arcanemachine@gmail.com"},"directories":{},"maintainers":[{"name":"arcanemachine","email":"arcanemachine@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/pi-consult_0.2.0_1788765769783_0.4911694189210696"},"_hasShrinkwrap":false}},"time":{"created":"2026-09-07T07:22:49.590Z","0.2.0":"2026-09-07T07:22:49.943Z","modified":"2026-09-07T07:22:50.174Z"},"maintainers":[{"name":"arcanemachine","email":"arcanemachine@gmail.com"}],"description":"Run user-driven, isolated, text-only multi-model consultation workflows in Pi","homepage":"https://github.com/arcanemachine/pi-consult#readme","keywords":["pi","pi-coding-agent","pi-extension","pi-package","consultation","multi-model","workflow"],"repository":{"type":"git","url":"git+https://github.com/arcanemachine/pi-consult.git"},"author":{"name":"Nicholas Moen"},"bugs":{"url":"https://github.com/arcanemachine/pi-consult/issues"},"license":"MIT","readme":"# pi-consult\n\n<p align=\"center\"><img src=\"https://raw.githubusercontent.com/arcanemachine/pi-consult/main/logo.jpg\" alt=\"pi-consult consultation workflow logo\" width=\"250\" /></p>\n\nA [Pi](https://pi.dev) extension for user-initiated, configurable multi-stage consultations with one or more models.\n\n> Like this extension? See [my other Pi extensions](https://github.com/arcanemachine/pi-projects).\n\n## Requirements\n\n- Pi 0.84.1 or later\n- Node.js 22.19.0 or later for package development\n- Authenticated model providers configured through Pi\n\n## Installation\n\nInstall from npm:\n\n```bash\npi install npm:@arcanemachine/pi-consult\n```\n\nOr install directly from GitHub:\n\n```bash\npi install git:github.com/arcanemachine/pi-consult\n```\n\nFor local development:\n\n```bash\npi -e ./src/index.ts\n```\n\n## Quick start\n\nAdd a `pi-consult` namespace to global `~/.pi/agent/settings.json` or trusted project `<project>/.pi/settings.json`:\n\n```json\n{\n  \"pi-consult\": {\n    \"models\": {\n      \"smart\": { \"model\": \"provider/model-id\" },\n      \"lateral\": { \"model\": \"another-provider/another-model\" }\n    },\n    \"workflows\": {\n      \"review\": {\n        \"description\": \"Get two independent reviews\",\n        \"context\": true,\n        \"stages\": [\n          {\n            \"prompt\": \"Review the request independently and identify risks.\",\n            \"consultants\": [\"smart\", \"lateral\"]\n          },\n          {\n            \"prompt\": \"Synthesize the preceding reviews into one recommendation.\",\n            \"consultants\": [\"smart\"]\n          }\n        ]\n      }\n    }\n  }\n}\n```\n\nConsultations are explicitly user-driven. Run the command:\n\n```text\n/consult review --context What should I reconsider?\n```\n\nA successful consultation displays its result and then resumes the active Pi turn with that result in context. Failed consultations display an error without resuming the turn. The prompt is optional; a workflow can run with no ad hoc prompt when its configured instructions and optional context provide enough subject matter.\n\nA lateral-thinking workflow can deliberately separate familiar assumptions from unconventional alternatives before a consultant synthesizes the result:\n\n```json\n{\n  \"workflows\": {\n    \"lateral-thinking\": {\n      \"stages\": [\n        {\n          \"prompt\": \"Defamiliarize the request. Separate hard constraints from assumptions and restate the problem without assuming the current approach is correct.\",\n          \"consultants\": [\"smart\"]\n        },\n        {\n          \"prompt\": \"Think laterally. Use inversion, analogy, constraint removal, changes of scale, and surprising reframings. For every alternative, state which assumption it breaks and which hard constraints it preserves.\",\n          \"consultants\": [\n            \"smart\",\n            {\n              \"alias\": \"lateral\",\n              \"prompt\": \"Prefer surprising but practical alternatives that could break a habitual cycle of thought.\"\n            }\n          ]\n        },\n        {\n          \"prompt\": \"Compare the alternatives against the hard constraints. Preserve the strongest non-obvious idea rather than averaging everything into the familiar approach. Recommend one direction and a quick way to falsify it.\",\n          \"consultants\": [\"smart\"]\n        }\n      ]\n    }\n  }\n}\n```\n\n## Configuration\n\nThe external configuration has exactly two keys: `models` and `workflows`.\n\nThe extension applies conservative bounds: configuration files and settings fragments are limited to 512 KB, with at most 100 model aliases, 100 workflows, 20 stages per workflow, and 20 consultants per stage. Ad hoc prompts are limited to 8,000 characters; serialized conversation context and stage handoffs to 24,000 characters each; each consultant response to 12,000 characters; and the final displayed result to 48,000 characters. Validation diagnostics are capped at 100 entries and 20,000 characters. Bounds are reported in structured details when they affect a consultation.\n\n- A model alias maps to a `provider/model-id` selection. Pi resolves the model and its authentication; credentials do not belong in this configuration.\n- A workflow contains sequential `stages`.\n- Consultants in one stage run concurrently.\n- A consultant is an alias string or `{ \"alias\": \"...\", \"prompt\": \"...\" }`.\n- Every successful stage's labeled outputs are passed to every consultant in the next stage.\n- A stage failure stops downstream stages. There are no automatic retries or hidden distillation calls.\n- Configure a final one-consultant stage when you want one explicit synthesis response. A multi-consultant final stage returns every response.\n\n### Configuration sources\n\nThe package-owned file `~/.pi/agent/pi-consult.json`, when present, is authoritative and contains the `models` and `workflows` object directly (without a `pi-consult` wrapper). It is not merged with `settings.json`.\n\nIf that file exists while a `pi-consult` namespace is also present in global settings or trusted project settings, the configuration is rejected as ambiguous. A malformed standalone file is an error and never silently falls back to settings.\n\nWithout the standalone file, Pi settings are merged in the normal order: global settings first, then trusted project settings. Untrusted project settings are ignored.\n\n### Conversation context\n\nSet `context: true` on a workflow or use the `--context` command flag to include the active compaction-aware conversation. The extension serializes that conversation as reference material. It does not copy Pi's system prompt, tool definitions, loaded skills, or AGENTS files into consultant requests.\n\nConsultants are permanently text-only. They cannot call tools, spawn child agents, inspect files, or modify the parent session.\n\n## Command\n\n```text\n/consult <workflow> [--context] [prompt]\n```\n\nThe command is the sole consultation entry point; models cannot invoke it as a tool. It displays a visible versioned consultation result and resumes the active parent turn only after a successful consultation. Configuration and operational failures are displayed and notified without triggering another turn. Workflow names and `--context` have autocomplete support.\n\nThe command returns labeled final outputs, bounded diagnostics, and aggregated nested model usage in its visible result.\n\n## Development\n\n```bash\nnpm run format:check\nnpm run typecheck\nnpm run test\nnpm run build\nnpm pack --dry-run\n```\n\nVerify user-facing behavior against a running isolated Pi session before release.\n\n## License\n\nMIT\n","readmeFilename":"README.md","_rev":"1-a3fd13e6c81c3b52b12837218224f26c"}