@vibest/cli 0.0.1 → 0.0.2-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/LICENSE +21 -0
  2. package/bin/vibest.cjs +45 -0
  3. package/harnesses/agy/.agents/plugins/vibest/hook.sh +48 -0
  4. package/harnesses/agy/.agents/plugins/vibest/hooks.json +38 -0
  5. package/harnesses/agy/.agents/plugins/vibest/plugin.json +5 -0
  6. package/harnesses/agy/.agents/plugins/vibest/skills/delegate/SKILL.md +66 -0
  7. package/harnesses/agy/.agents/plugins/vibest/skills/pipeline/SKILL.md +57 -0
  8. package/harnesses/agy/index.js +1405 -0
  9. package/harnesses/claude/.claude-plugin/plugin.json +10 -0
  10. package/harnesses/claude/LICENSE +21 -0
  11. package/harnesses/claude/README.md +107 -0
  12. package/harnesses/claude/hooks/hooks.json +4 -0
  13. package/harnesses/claude/hooks/register.mjs +6215 -0
  14. package/harnesses/claude/skills/delegate/SKILL.md +66 -0
  15. package/harnesses/claude/skills/pipeline/SKILL.md +57 -0
  16. package/harnesses/cursor/.cursor-plugin/plugin.json +5 -0
  17. package/harnesses/cursor/hooks/hooks.json +39 -0
  18. package/harnesses/cursor/hooks/vibest.sh +35 -0
  19. package/harnesses/cursor/index.js +1340 -0
  20. package/harnesses/cursor/skills/delegate/SKILL.md +66 -0
  21. package/harnesses/cursor/skills/pipeline/SKILL.md +57 -0
  22. package/harnesses/pi/extension.mjs +18600 -0
  23. package/harnesses/pi/presentation.mjs +10235 -0
  24. package/harnesses/pi/skills/delegate/SKILL.md +66 -0
  25. package/harnesses/pi/skills/pipeline/SKILL.md +57 -0
  26. package/herdr-plugin/README.md +57 -0
  27. package/herdr-plugin/bin/vibest.sh +11 -0
  28. package/herdr-plugin/herdr-plugin.toml +88 -0
  29. package/package.json +49 -27
  30. package/CHANGELOG.md +0 -9
  31. package/src/cli.ts +0 -25
  32. package/src/server.ts +0 -39
  33. package/tsconfig.json +0 -12
  34. package/tsdown.config.ts +0 -6
  35. package/turbo.json +0 -9
@@ -0,0 +1,10 @@
1
+ {
2
+ "name": "vibest",
3
+ "description": "VIBEST for Claude Code: execution-end reports, prompt reports and the tool guard for VIBEST sessions, and the entry session inbox that delivers VIBEST messages as prompts, all over HTTP to vibestd",
4
+ "author": {
5
+ "name": "vibest-dev"
6
+ },
7
+ "repository": "https://github.com/vibest-dev/vibest",
8
+ "license": "MIT",
9
+ "version": "0.0.2-beta.1"
10
+ }
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 iamdin
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,107 @@
1
+ # @vibest/claude: the vibest Claude Code plugin
2
+
3
+ One ordinary Claude Code plugin, one hooks module. Every call to vibest is an HTTP request from `$.http.fetch` to
4
+ vibestd's unix socket `<VIBEST_HOME>/vibest-http.sock`; the plugin runs no `vibest` process.
5
+
6
+ - `turn.complete` posts each main-loop execution end to `/hooks/claude/execution-end` with its `reason`, the answer and the
7
+ current Claude session id. vibest maps the reason: `answer` is the result as it is; `aborted` is an interrupted
8
+ (failed) result when the person pressed Esc, and nothing when `vibest interrupt` (or remove, archive) stopped the
9
+ execution; `refusal` and `error` are failed results. A subagent's loop (`agentId` set) reports nothing. For the
10
+ entry session vibestd records only the conversation id.
11
+ - `prompt.submit` posts a worker's prompt with its `origin.kind` to `/hooks/claude/prompt`; vibest keeps only what
12
+ the person submitted (`composer`, or `bridge` for Remote Control).
13
+ - `tool.call` posts each tool call, a subagent's included, to `/hooks/claude/guard` and returns `{ deny }` when vibest
14
+ refuses it. It tries for 2 s, then again after 100, 300 and 900 ms; when nothing answers, the call is refused.
15
+ - The **inbox**: from `session.start`, a session asks `/inbox/take` every second while it is idle (after `session.start`
16
+ and `turn.complete`, never while an execution runs). A batch comes with its execution id,
17
+ the two-line form (`Message from @General · <title> (<id>)` then the first line; a notice is `Message from Vibest`, a user send is `Message from You`) and its full text. The line is submitted with
18
+ `$.prompt.submit` from the AbovePrompt `ui.render` hook, one batch per draw, and this module's own `prompt.submit`
19
+ hook attaches the full text as context. This module's own `prompt.submit` hook reports the batch's execution as accepted
20
+ (`PromptSubmit` with `origin: "vibest"` and the execution id) before the prompt goes on; a
21
+ `drop` puts the batch back at the front of the queue. The submit has to come from inside a hook's call stack: a
22
+ submit from a clock callback would skip this module's own `prompt.submit` hook as re-entry. The render hook awaits
23
+ the submit before it returns: Claude Code reads the call against the hooks still running when it arrives, and under
24
+ load a hook that returned at once had often settled first, so its own `prompt.submit` hook was skipped the same way
25
+ and the line went out without its full text. Full texts wait for `prompt.submit` for at most the last 100 lines. When the submitted text already ends with the full content, that content is not attached again. Using the AbovePrompt render hook as a place to submit from is undocumented; E2E covers it.
26
+
27
+ Reports (execution end, prompt) retry in the background after 1, 2, 4, 8, 15 and 30 s while vibestd does not take them.
28
+ A failed report never blocks or continues a stopped execution. Five failed polls in a row put "vibestd unreachable" on the
29
+ status line. `Session.Ready` goes with Claude Code's own pid, read as the `$PPID` of a command the module runs, since
30
+ a restart signals that process. A failed hook is skipped unless its handler answers, so outside vibest every listener
31
+ answers with a pass. The tool arguments sent to the guard are the `tool.call` input without its reserved keys
32
+ (`tool`, `tool_use_id`, `consent`, `agentId`).
33
+
34
+ Every request carries the session headers from `@vibest/protocol` `sessionHeaders`: protocol, `VIBEST_SESSION_ID`,
35
+ `VIBEST_PROJECT_ID`, the current Claude session id, `VIBEST_HARNESS`, the cwd, `VIBEST_RUNTIME` and the
36
+ plugin version. Paths carry no version; the only one is `PROTOCOL` in the `vibest-protocol` header. vibestd refuses a
37
+ request with an unknown session (404), a missing or wrong project id (403) or another protocol (409). A 409 body holds
38
+ vibestd's protocol and version, a message and the command to run (`action`); the plugin puts them on the status line
39
+ until a request goes through again, and the guard still refuses each tool call, giving them as the reason.
40
+
41
+ It ships inside `@vibest/cli` and is loaded only into the Claude sessions vibest starts (see Use).
42
+
43
+ ## Build
44
+
45
+ This package is private: the plugin is published as part of `@vibest/cli`, whose build writes it to
46
+ `packages/cli/harnesses/claude` (`scripts/build-harnesses.ts`).
47
+
48
+ bun scripts/build.ts <outdir> # the complete plugin directory in <outdir>
49
+ bun run build # the generated files in place, for the tests
50
+
51
+ The plugin directory holds exactly:
52
+
53
+ - `.claude-plugin/plugin.json`, generated: `src/manifest.json` with `version` set from this `package.json`.
54
+ - `hooks/hooks.json`: `"modules": ["./register.mjs"]` only. No command-hook map and no shell wrapper.
55
+ - `hooks/register.mjs`, generated: a single ES module with no imports. It bundles `src/plugin.ts` with the header
56
+ helper it imports from `@vibest/protocol`; the build inlines the package version as `VIBEST_PLUGIN_VERSION`. Prebuilt JS is a delivery choice; Claude Code can also load TypeScript hooks modules.
57
+ - `README.md` and `LICENSE`.
58
+
59
+ `$.plugin` has no version, so the build inlines it. Bun writes each module's path relative to the working directory
60
+ into the bundle, so the build pins the working directory and the bytes do not vary.
61
+
62
+ The generated files are ignored by Git.
63
+
64
+ ## Use
65
+
66
+ The launch side (arguments, models, resume, subscription reading) is the `claude` harness definition, added by the
67
+ builtin plugin `harness-claude` in `packages/plugin-harnesses`; this package is only what runs inside Claude.
68
+
69
+ Nothing to install. vibest starts each Claude session (and a Claude entry session) with
70
+ `claude --plugin-dir <@vibest/cli>/harnesses/claude`, which loads the plugin for that session only. vibest writes
71
+ nothing into `~/.claude`. Plain `claude` sessions never load it, and in a Claude process without
72
+ `VIBEST_SESSION_ID` every listener returns `next` and sends nothing.
73
+
74
+ **Mods are not sandboxed.** The module is code that Claude Code runs in its own process with your permissions. What it
75
+ does is narrow: POST to the fixed vibestd socket and submit the inbox line as a prompt. Its `tool.call` listener only
76
+ refuses; it registers no `tool.check` approval and changes no permission or policy setting. A module that does not
77
+ load guards nothing: vibest's `--settings` only grants the project folder, so the guard rules hold only while this
78
+ module runs.
79
+
80
+ **`/clear`.** Claude Code 2.1.316 changes `$.session.id()` on `/clear`, fires `session.end` for the old id and no new
81
+ `session.start`; the poll timer keeps running. The plugin therefore has no `session.end` handler and sends the
82
+ current id on every request, and vibestd records the new id on the next request.
83
+
84
+ **Loading gate.** Claude Code statically analyzes a hooks module before loading it: `register` stays a top-level
85
+ `function` declaration and each hook passes `$` only to the top-level `nativeHost`. Hooks modules must be enabled for
86
+ non-builtin plugins (in 2.1.309 the rollout flag `tengu_plugin_hooks_modules` and accepted workspace trust); the plugin
87
+ does not read or change either. The AbovePrompt drain needs an interactive UI: under `claude -p` nothing is delivered.
88
+
89
+ ## API source
90
+
91
+ `src/plugin.ts` imports types from `claude-code`. Those declarations are not in this repository. `bun scripts/prepare-claude-types.ts`,
92
+ which `pnpm run typecheck` runs before the plugin project (`tsconfig.plugin.json`), writes an ignored cache at
93
+ `packages/integration/claude/.cache/claude-code.d.ts`. A cold cache needs network access to GitHub.
94
+ It reuses that file only when its SHA-256 is `e51e637fbbebb2a6a49c4bdc3860a251c2ca2295884822dff0f4c3e3ec802163`, including a copy placed there by hand for offline use. Otherwise it fetches
95
+ `https://raw.githubusercontent.com/anthropics/claude-code/2eff7a8d21c80be48904f62ebdea36d945d7b504/mods/types/claude-code.d.ts` and keeps the result only when that checksum matches.
96
+ The pin is anthropics/claude-code `2eff7a8d21c80be48904f62ebdea36d945d7b504`, `mods/types/claude-code.d.ts`. The file's own
97
+ "Written by Claude Code 2.1.277" header is stale and does not date that pin. Upstream marks the file all rights reserved
98
+ under Anthropic's commercial terms. This repository does not assert permission to redistribute it, and a missing or
99
+ unverified cache fails typecheck instead of skipping the plugin project. The cache was not produced by running Claude or `/plugin-types`.
100
+
101
+ The listeners are `session.start`, `ui.render` (AbovePrompt), `turn.complete`, `prompt.submit` and `tool.call`. Native
102
+ calls stay in `register` or the top-level `nativeHost`: `$.http.fetch`, `$.session.cwd`, `$.session.id`, `$.env.get`,
103
+ `$.prompt.submit`, `$.clock.every`, `$.clock.after`, `$.ui.invalidate`, `$.ui.status`.
104
+
105
+ Hooks modules are early access and may change between releases. `claude plugin validate` and `claude plugin test` have
106
+ not been run on this revision. The E2E check I4 loads it with `--plugin-dir` into a real Claude: the guard refuses and the
107
+ execution end reports.
@@ -0,0 +1,4 @@
1
+ {
2
+ "description": "VIBEST: execution-end reports and the tool guard for VIBEST sessions; the entry session inbox module",
3
+ "modules": ["./register.mjs"]
4
+ }