{"_id":"@bromum/kaon-harness","name":"@bromum/kaon-harness","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@bromum/kaon-harness","version":"0.1.0","description":"Native thread-based orchestration for DeepSeek Harness","type":"module","engines":{"node":"^22.19.0 || >=24.0.0"},"exports":{".":"./dist/index.js","./client":"./dist/client.js"},"dsh":{"bundle":{"patch":"./cordis.patch.yml"},"client":{"platform":"web","inject":["@deepseek-ai/dsh-client-ui-tool","@deepseek-ai/dsh-client-ui-session","@deepseek-ai/dsh-client-ui-conversation","@deepseek-ai/dsh-client-ui-model-selection","@deepseek-ai/dsh-api-gateway"],"external":["@deepseek-ai/dsh-api-gateway","@deepseek-ai/dsh-client-ui-primitives"]}},"scripts":{"build":"tsc -p tsconfig.build.json && node build-client.mjs","typecheck":"tsc --noEmit && tsc -p tsconfig.client.json","test":"tsx --test test/*.test.ts","test:web":"npm run build && node --test test/client.test.mjs","test:packed":"npm run build && node test/packed-smoke.mjs","test:profile":"npm run build && node test/web-profile-smoke.mjs","test:launcher":"npm run build && node test/web-profile-smoke.mjs --launcher","package:release":"mkdir -p releases && npm pack --pack-destination releases","dev":"node dist/launcher.js","prepack":"npm run build","prepublishOnly":"npm run typecheck && npm test"},"peerDependencies":{"@deepseek-ai/cordis":"4.0.2","@deepseek-ai/dsh-agent":"0.1.3-alpha.2","@deepseek-ai/dsh-agent-presets":"0.1.3-alpha.2","@deepseek-ai/dsh-api-gateway":"0.1.3-alpha.2","@deepseek-ai/dsh-client-connection":"0.1.3-alpha.2","@deepseek-ai/dsh-commands":"0.1.3-alpha.2","@deepseek-ai/dsh-fs":"0.1.3-alpha.2","@deepseek-ai/dsh-llm":"0.1.3-alpha.2","@deepseek-ai/dsh-sandbox-policy":"0.1.3-alpha.2","@deepseek-ai/dsh-session":"0.1.3-alpha.2","@deepseek-ai/dsh-storage":"0.1.3-alpha.2","@deepseek-ai/dsh-storage-domain":"0.1.3-alpha.2","@deepseek-ai/dsh-subagent":"0.1.3-alpha.2","@deepseek-ai/dsh-subprocess":"0.1.3-alpha.2","@deepseek-ai/dsh-system-prompt":"0.1.3-alpha.2","@deepseek-ai/dsh-tool-bash":"0.1.3-alpha.2","@deepseek-ai/dsh-tool-fs":"0.1.3-alpha.2","@deepseek-ai/dsh-tool-fs-search":"0.1.3-alpha.2","@deepseek-ai/dsh-tools":"0.1.3-alpha.2","@deepseek-ai/dsh-typert-protocol":"0.1.3-alpha.2","@deepseek-ai/dsh-typert-registry":"0.1.3-alpha.2","@deepseek-ai/dsh-user-approval":"0.1.3-alpha.2"},"dependencies":{"@deepseek-ai/schemastery":"3.18.2","zod":"^4.3.6"},"devDependencies":{"@deepseek-ai/cordis-plugin-loader":"1.0.3","@deepseek-ai/dsh-agent-loop":"0.1.3-alpha.2","@deepseek-ai/dsh-client-ui-conversation":"0.1.3-alpha.2","@deepseek-ai/dsh-client-ui-model-selection":"0.1.3-alpha.2","@deepseek-ai/dsh-client-ui-renderer":"0.1.3-alpha.2","@deepseek-ai/dsh-client-ui-session":"0.1.3-alpha.2","@deepseek-ai/dsh-client-ui-slots":"0.1.3-alpha.2","@deepseek-ai/dsh-client-ui-tool":"0.1.3-alpha.2","@deepseek-ai/dsh-fs-local":"0.1.3-alpha.2","@deepseek-ai/dsh-session-persistence":"0.1.3-alpha.2","@deepseek-ai/dsh-session-persistence-jsonl":"0.1.3-alpha.2","@deepseek-ai/dsh-session-projection":"0.1.3-alpha.2","@deepseek-ai/dsh-storage-json":"0.1.3-alpha.2","@deepseek-ai/dsh-subprocess-local":"0.1.3-alpha.2","@playwright/test":"1.63.0","@types/node":"^24.12.0","@types/react":"18.3.31","@types/react-dom":"18.3.7","esbuild":"0.25.12","react":"18.3.1","react-dom":"18.3.1","tsx":"^4.20.0","typescript":"^6.0.3","@deepseek-ai/dsh":"0.1.3-alpha.2","@deepseek-ai/dsh-app-boot":"0.1.3-alpha.2"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"repository":{"type":"git","url":"git+https://github.com/kaon-agent/kaon.git","directory":"packages/kaon-harness"},"bugs":{"url":"https://github.com/kaon-agent/kaon/issues"},"_id":"@bromum/kaon-harness@0.1.0","homepage":"https://github.com/kaon-agent/kaon#readme","_integrity":"sha512-7+gKPuE7u9fGua6kwnFnGOIm2jxcxmXPLWqbqNKk6in4SplbVxG/lVShW46toxBs0+96ZPSeTKl1XQFVtS2QkQ==","_resolved":"/Users/agoryainov/projects/kaon/packages/kaon-harness/releases/bromum-kaon-harness-0.1.0.tgz","_from":"file:releases/bromum-kaon-harness-0.1.0.tgz","_nodeVersion":"24.14.1","_npmVersion":"11.15.0","dist":{"integrity":"sha512-7+gKPuE7u9fGua6kwnFnGOIm2jxcxmXPLWqbqNKk6in4SplbVxG/lVShW46toxBs0+96ZPSeTKl1XQFVtS2QkQ==","shasum":"f685dd7dd8a2b2e3fd8218ae57ab86a1243be275","tarball":"https://registry.npmjs.org/@bromum/kaon-harness/-/kaon-harness-0.1.0.tgz","fileCount":44,"unpackedSize":763433,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIFTLMAGR8jliNQ4bmAUWF218JZJXgEWOVF2CSmBPsFmMAiAGZPsetVs4IwT2OZwZieKcMSLMP7mYPQGxg9yXIE8BhA=="}]},"_npmUser":{"name":"bromum","email":"rich.feynman.f@gmail.com"},"directories":{},"maintainers":[{"name":"bromum","email":"rich.feynman.f@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/kaon-harness_0.1.0_1788963992443_0.38053802912201484"},"_hasShrinkwrap":false}},"time":{"created":"2026-09-09T14:26:31.633Z","0.1.0":"2026-09-09T14:26:32.583Z","modified":"2026-09-09T14:26:32.839Z"},"maintainers":[{"name":"bromum","email":"rich.feynman.f@gmail.com"}],"description":"Native thread-based orchestration for DeepSeek Harness","homepage":"https://github.com/kaon-agent/kaon#readme","repository":{"type":"git","url":"git+https://github.com/kaon-agent/kaon.git","directory":"packages/kaon-harness"},"bugs":{"url":"https://github.com/kaon-agent/kaon/issues"},"readme":"# Kaon for DeepSeek Harness\n\nA separate native implementation of Kaon's named workstreams. It does not load pi or change the pi package in this repository. Each action runs in a fresh Harness agent; selected file evidence and up to five deltas supply continuity.\n\nThis package is an unreleased migration preview, pinned to Harness `0.1.3-alpha.2` and Cordis `4.0.2`. It is not a completed parity release. Report issues in [kaon-agent/kaon](https://github.com/kaon-agent/kaon/issues).\n\n## Install into DeepSeek Harness\n\nWith DeepSeek Harness installed, stop its server and run from your Harness Git checkout:\n\n```sh\npnpm dsh plugin --profile web add @bromum/kaon-harness\n```\n\nStart Harness normally with `pnpm dsh --profile web`. If you use an installed `dsh` command, omit `pnpm`. Connect your model provider in Harness and use **Subagent types** to choose worker models. Kaon activates for top-level sessions in this profile.\n\nKaon uses Harness's existing runtime and native modules. Installation needs no build-script approvals, native rebuilds, or installer script. To update, run `pnpm dsh plugin --profile web update @bromum/kaon-harness`, then restart Harness.\n\nNo Kaon source checkout or frontend build is needed. Kaon is a standard `dsh.bundle`: its patch loads the host plugin, and its `dsh.client` declaration loads the browser plugin. The UI changes and Muse output-budget fix are included in that bundle. See Harness's [packaging guide](https://deepseek-harness.github.io/deepseek-harness/en/develop/basic/publish).\n\nTo uninstall: `dsh plugin --profile web remove @bromum/kaon-harness`, then restart Harness. Sessions and Kaon history remain on disk. Stop running work before installing, upgrading, or removing the plugin. This preview targets Harness `0.1.3-alpha.2`; other versions need compatibility testing.\n\nTo build an archive for sharing, run `npm run package:release` in this directory. It writes the prebuilt tarball to `releases/` without publishing anything or including credentials, sessions, or installed dependencies.\n\n## Run from this checkout\n\nUsing Node 22.19+ or Node 24+, run from this directory:\n\n```sh\nnpm ci\nnpm run build\nnpm run dev\n```\n\nThe development launcher opens Harness with Kaon in a dedicated `kaon` profile. Harness is a development dependency; the published plugin relies on the user's existing Harness installation. Use `npm run dev -- --no-open` to print the URL instead. Stop the server with Ctrl+C. Rebuild after source changes and restart.\n\n## Develop and verify\n\nUse Node 22.19+ or Node 24+. Run these commands from this directory:\n\n```sh\nnpm ci\nnpm run typecheck\nnpm test\nnpx --no-install playwright install chromium\nnpm run test:web\nnpm run test:packed\nnpm run test:profile\nnpm run test:launcher\n```\n\nHarness's JSONL persistence backend needs native dependencies. If you installed with `--ignore-scripts`, run `npm rebuild fs-ext koffi` before the native tests. A compiler toolchain may be required.\n\nThe tests use a scripted LLM adapter and real Harness loops, filesystem tools, JSON storage, and JSONL sessions. They do not need model credentials. `test:web` runs the built card in Chromium. `test:packed` installs a tarball in a temporary project, loads it through Cordis Loader, executes a native action, reads its durable transcript, and unloads it.\n\n`test:profile` requires `pnpm` on PATH. It installs the tarball through the real CLI, boots the standard web profile, runs a native parent/child action, and checks the browser integration. `test:launcher` installs Harness separately alongside the plugin tarball and runs the same browser checks through the development launcher, including profile initialization, repeat startup configuration, and graceful shutdown. Set `KAON_TEST_LAUNCH_NODE=/absolute/path/to/another/node` when running `npm run test:launcher` to verify startup from a different Node version, including native storage and Ctrl+C shutdown. Installation tests use temporary homes and the public npm registry without inherited provider credentials. Browser profile tests disable telemetry only in their isolated test environments.\n\n## How it works\n\nIn the standard web profile, the orchestrator receives `dispatch` and `msg`. Its execution guard rejects other tools even if another plugin adds scope-owned tool schemas.\n\nUse `msg({threads: [\"research\", \"implementation\"], message: \"Use the revised requirements.\"})` to send the same update to one or more active or queued workers. The result reports `sent`, `queued`, or `failed` for each distinct thread. Duplicate names receive the message only once; a failed recipient does not block delivery to the others. Workers reply with `msg({message})`; their recipient is fixed to their own orchestrator. Messages reach the next model step without restarting the action or changing its pinned model. Completed actions require a follow-up `dispatch`.\n\nEach worker completion immediately sends its final answer to the orchestrator as a message, even while other workers continue. Dispatch releases the orchestrator when a message arrives and returns only an acknowledgement. The orchestrator can act on the first result without waiting for the whole batch. The orchestrator receives explicit messages and final answers, without an automatic tool trace or reasoning feed. The user can still inspect native worker activity in the UI.\n\nMuse Spark 1.3 on Vercel AI Gateway defaults to a 65,536-token output budget for orchestrator and worker requests. Its catalog advertises a million-token output limit; reserving nearly the entire context window can cause HTTP 400 errors when code-heavy input exceeds the adapter's token estimate. Explicit request limits and provider-configured defaults take precedence. This budget limits each response, not the model's input context window.\n\nWorkers receive `msg` and native `glob` and `grep` for discovery, plus `read`, `write`, and `edit`. Plan mode keeps `glob`, `grep`, and `read` without mutation or shell tools. Search uses Harness's bundled ripgrep through its subprocess service, not a shell. Search results do not replace the file read required before editing.\n\nWorker cards appear only inside their **dispatch** message, showing each worker's task, current tool calls, elapsed time, and queued, working, retention, or terminal state. There is no duplicate Threads panel above the composer. Click a worker's name to open its live native conversation: the same Harness message, reasoning, tool, and detail views used by the orchestrator. Native navigation returns you to the parent. Child sessions are one-shot and read-only, not reusable threads. Dispatch results retain their action, outcome, remembered files, and child links.\n\nActivity uses Harness's reconnecting stream API, with one shared subscription per visible parent session. Disconnection labels the last received state; reconnect and browser reload fetch a fresh snapshot. Recent completed activity is restored from the journal after a host restart. Background dispatch cards can also fetch their durable results after leaving the live buffer. Native child histories remain available; opening them does not restart workers. Interrupted work is marked failed rather than resumed.\n\n## Commands\n\nCommands act on the exact session receiving them:\n\n- `/kaon-list`: show thread summaries and remembered-file paths, without dumping native transcripts.\n- `/kaon-run {\"thread\":\"investigation\",\"action\":\"Read the relevant files\"}`: run a direct action through the same scheduler as dispatch.\n- `/kaon-cancel investigation`: cancel and drain a thread. Omit the name to cancel all this session's threads.\n- `/kaon-delete investigation`: drain and remove its Kaon journal record. Native child transcripts remain available for audit.\n- `/kaon-plan on` or `/kaon-plan off`: drain older work and persist Kaon's planning setting. On permits `read`, `glob`, `grep`, and `msg`, plus the separate retention-only tool. Harness's ordinary plan mode is not this enforced setting.\n- `/kaon-model {\"provider\":\"deepseek\",\"model\":\"deepseek-chat\"}`: choose the child route; use a provider/model configured in Harness. Without arguments, show settings. By default, children inherit the parent's route and reasoning selection.\n\nThe bundle defaults to ten concurrent actions across all sessions. Equal session/thread keys serialize, including cleanup and durable commit. Shell execution is off by default. Setting `shell: true` in the bundle configuration requires Harness shell, sandbox-policy, and approval services; children cannot escalate approvals. The worker guard rejects Bash's `run_in_background` mode. This is not an OS-level guarantee against a shell command spawning a daemon. The `run_code` transport and recursive delegation are excluded.\n\n## Persistence and limits\n\nThe `kaon` storage domain owns thread records, sequence numbers, file evidence, native-event snapshots, and session settings. Interrupted records become failed summaries on reopen; the runtime does not retry their actions. Actual workspace changes are not rolled back by cancellation or plugin unload.\n\nRetained versions guard native `read`/`write`/`edit` workflows. Mutated files remain retained even if a later tool wrapper reports failure. An external editor's races and shell writes are outside those guards. Native search reads the local filesystem directly; it requires the session working directory and filesystem provider to refer to the same workspace, bypasses custom filesystem-provider read restrictions, and does not confine reads to that workspace. A storage root must have a single active Kaon owner; this scheduler is not a cross-process lock.\n\nDeleting a thread does not erase its results from the parent transcript or its native child histories. There is no automatic pi-history import.\n\nRemaining parity work includes dedicated direct-action/delete controls, Keenable integration, and the complete cancellation/conflict matrix in the migration document. The profile smoke covers two live workers, current tool calls, pending-page reload, connection loss/reconnect, native live child navigation, completed history, and narrow layout. It does not establish live-provider compatibility or cover every control interaction.\n","readmeFilename":"README.md","_rev":"1-09268bf1e84f4cb1e7528fae13b5ac24"}