superbee 0.2.1-pre.1 → 0.2.1-pre.2
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.
- package/README.md +88 -88
- package/dist/publication-bridge.mjs +176 -9
- package/dist/publication.mjs +226 -59
- package/dist/superbee.mjs +336 -149
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,114 +1,114 @@
|
|
|
1
1
|
# superbee
|
|
2
2
|
|
|
3
|
+
Shared, versioned, conflict-safe knowledge for AI coding agents, stored as plain markdown in
|
|
4
|
+
your repo.
|
|
5
|
+
|
|
6
|
+
Superbee is pre-1.0. Commands and formats may change between releases.
|
|
7
|
+
|
|
3
8
|
## What is Superbee?
|
|
4
9
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
- `latest` is the stable channel selected by bare `superbee`, including native Windows support.
|
|
52
|
-
- `next` is the prerelease channel for testing the current release candidate.
|
|
53
|
-
|
|
54
|
-
Install the current prerelease on Windows:
|
|
55
|
-
|
|
56
|
-
```powershell
|
|
10
|
+
Agents forget everything between sessions, overwrite each other's work, and keep what they know
|
|
11
|
+
invisible to the humans they work for. Superbee fixes all three with a **knowledge bundle**: a
|
|
12
|
+
folder of markdown documents, by convention `.superbee/` at your project root, that agents read
|
|
13
|
+
and write through a small command-line tool.
|
|
14
|
+
|
|
15
|
+
- **Context that persists.** Agents write context notes, decisions, plans, and research into the
|
|
16
|
+
bundle. The next session, or a different agent, picks up where the last one left off. An
|
|
17
|
+
optional `SessionStart` hook for Claude Code, Codex, and OpenCode orients every new session
|
|
18
|
+
automatically.
|
|
19
|
+
- **Safe for many writers.** Each write can carry the actor that made it. A writer can name the
|
|
20
|
+
version it last read; if anyone changed the document since, the write fails with a typed
|
|
21
|
+
conflict error instead of silently overwriting their work.
|
|
22
|
+
- **Visible to humans.** The bundle is plain markdown. Open it in any editor, render it on
|
|
23
|
+
GitHub, diff it in git. `superbee ui` serves it locally as cross-linked pages with backlinks and
|
|
24
|
+
a live activity feed. No bundle content leaves your machine until you run `superbee sync`, which
|
|
25
|
+
shares the bundle with teammates through the board: a copy of the bundle kept on its own git
|
|
26
|
+
branch, separate from your code.
|
|
27
|
+
- **Views on demand.** Ask your agent for a dashboard, a timeline, a filtered task queue, or a
|
|
28
|
+
reading view of one dense document. It builds a self-contained HTML page, stores it in the bundle
|
|
29
|
+
as a View, and `superbee ui` hosts it in a sandboxed frame. A View reads the bundle live and can
|
|
30
|
+
change it only through a write you confirm. Views are bundle content, so they travel with `sync`.
|
|
31
|
+
- **Built for agents.** Output is structured and token-lean, and errors carry a small, stable set
|
|
32
|
+
of exit codes. Agents act on responses without parsing prose or flooding their context window.
|
|
33
|
+
- **Yours, and portable.** Bundles follow the Open Knowledge Format (OKF), a convention of
|
|
34
|
+
markdown with frontmatter, so they outlive the tool: hand the folder to someone else, or read it
|
|
35
|
+
with anything that speaks markdown. New bundles are written as OKF v0.2, and existing v0.1
|
|
36
|
+
bundles keep working as they are. Reading and writing the bundle works offline; only sharing
|
|
37
|
+
needs a network. The document schemas, called kinds, live inside the bundle, so it describes
|
|
38
|
+
its own structure.
|
|
39
|
+
|
|
40
|
+
The npm package is one self-contained executable with zero runtime dependencies, plus an Agent
|
|
41
|
+
Skill, an instruction file your agent loads, that teaches it how to use the tool.
|
|
42
|
+
|
|
43
|
+
## Install
|
|
44
|
+
|
|
45
|
+
Requires Node.js 20 or newer on macOS, Linux, or Windows. Native Windows is supported; you do not
|
|
46
|
+
need WSL or Docker.
|
|
47
|
+
|
|
48
|
+
```sh
|
|
49
|
+
npm install -g superbee
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Stable releases publish on npm's `latest` tag and prereleases on `next`. To try the prerelease:
|
|
53
|
+
|
|
54
|
+
```sh
|
|
57
55
|
npm install -g superbee@next
|
|
58
|
-
superbee.cmd setup
|
|
59
56
|
```
|
|
60
57
|
|
|
61
|
-
On
|
|
62
|
-
|
|
58
|
+
On Windows, Superbee keeps its private per-user state, such as the workspace catalog and remote
|
|
59
|
+
credentials, under `%LOCALAPPDATA%\Superbee`. npm installs `superbee.cmd` alongside the `superbee`
|
|
60
|
+
command; if PowerShell's execution policy blocks the `.ps1` wrapper, call `superbee.cmd` instead.
|
|
61
|
+
|
|
62
|
+
Run `superbee version --check` to compare your install with the current stable release.
|
|
63
63
|
|
|
64
|
-
|
|
65
|
-
the Windows shim explicitly). Setup walks the agent through Agent Skill, SessionStart hook, and MCP
|
|
66
|
-
registration. It is read-only: it inspects your configuration and returns one safe next command at
|
|
67
|
-
a time, so the agent performs any actual changes with your approval.
|
|
64
|
+
## First run: let your agent finish setup
|
|
68
65
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
66
|
+
`npm install` gives you the CLI. The integrations (the Agent Skill, the `SessionStart` hook, and
|
|
67
|
+
MCP server registration, where MCP is the Model Context Protocol) are installed by your agent,
|
|
68
|
+
not by hand. Ask it:
|
|
72
69
|
|
|
73
|
-
|
|
74
|
-
`superbee` alongside it, have your agent run `superbee setup` to migrate the exact legacy
|
|
75
|
-
integrations, then remove the old package with `npm uninstall -g @holaxis/aslite`. Existing
|
|
76
|
-
`.agentstate-lite/` bundles and `.agentstate.json` bindings keep working with no migration.
|
|
70
|
+
> Run `superbee setup` and follow its instructions.
|
|
77
71
|
|
|
78
|
-
|
|
72
|
+
Setup itself changes nothing. It inspects your configuration and returns one safe next command at
|
|
73
|
+
a time, and the agent runs each with your approval. Setup knows Claude Code, Codex, and OpenCode,
|
|
74
|
+
plus Claude Desktop for the MCP registration only.
|
|
79
75
|
|
|
80
|
-
|
|
81
|
-
you need, and the Agent Skill included with this package helps the agent translate your
|
|
82
|
-
instructions into CLI commands. For example:
|
|
76
|
+
## Everyday use
|
|
83
77
|
|
|
84
|
-
|
|
78
|
+
You rarely type Superbee commands yourself. You ask your agent, and the Agent Skill translates the
|
|
79
|
+
request into CLI calls:
|
|
80
|
+
|
|
81
|
+
- "Set up a Superbee bundle for this project and track our tasks in it."
|
|
85
82
|
- "Write up what we decided about the auth design as a doc, and link it to the task."
|
|
86
83
|
- "What did the last session leave off on? Check the context notes."
|
|
87
84
|
- "Sync the board so my teammate's agent sees this."
|
|
88
85
|
- "Give me a view of the open tasks grouped by owner."
|
|
89
86
|
|
|
90
|
-
Behind those requests
|
|
91
|
-
|
|
92
|
-
`doc
|
|
93
|
-
`
|
|
94
|
-
|
|
95
|
-
Use `superbee doc field <action> <document-id> <field-name>` to change one field.
|
|
96
|
-
`set` assigns a supported non-collection field; `add` and `remove` change tags or sources;
|
|
97
|
-
`edit` changes a selected source; `replace-all` replaces the complete tags or sources list.
|
|
98
|
-
`edit` and `replace-all` require `--expected-version` from a document read. Source selectors
|
|
99
|
-
use an exact `--id` or a unique `--resource` for an ID-less source. Supply structured values
|
|
100
|
-
through a JSON or YAML `--from-file`. Verification remains `doc verify`.
|
|
87
|
+
Behind those requests the agent uses a small set of commands: `init --dir .superbee` creates the
|
|
88
|
+
bundle, `new` creates a document of a declared kind, `doc write` writes a free-form one,
|
|
89
|
+
`doc update` changes a document, `link add` connects two, `list` and `doc read` query them, and
|
|
90
|
+
`sync` shares the board. `superbee --help` lists the commands, and `superbee <command> --help`
|
|
91
|
+
gives each one's full reference.
|
|
101
92
|
|
|
102
|
-
|
|
103
|
-
human-facing commands directly:
|
|
93
|
+
The two commands meant for you are the ones that show you the knowledge:
|
|
104
94
|
|
|
105
95
|
```sh
|
|
106
|
-
superbee ui --open # the bundle, rendered
|
|
107
|
-
superbee doc open <id> # one
|
|
96
|
+
superbee ui --open # the whole bundle, rendered in your browser
|
|
97
|
+
superbee doc open <id> # one document, by an id from `superbee list`
|
|
108
98
|
```
|
|
109
99
|
|
|
110
|
-
|
|
111
|
-
|
|
100
|
+
## Upgrading from aslite
|
|
101
|
+
|
|
102
|
+
If you installed the earlier `@holaxis/aslite` package or its marketplace plugin: install
|
|
103
|
+
`superbee` alongside it, have your agent run `superbee setup` to migrate the integrations, then
|
|
104
|
+
run `npm uninstall -g @holaxis/aslite`. Existing `.agentstate-lite/` bundles and
|
|
105
|
+
`.agentstate.json` bindings keep working with no migration.
|
|
106
|
+
|
|
107
|
+
## Learn more
|
|
108
|
+
|
|
109
|
+
The [repository](https://github.com/Holaxis-ai/superbee) holds the source, the
|
|
110
|
+
[CLI contract](https://github.com/Holaxis-ai/superbee/blob/main/packages/cli/AXI-CONTRACT.md),
|
|
111
|
+
and the [wire protocol](https://github.com/Holaxis-ai/superbee/blob/main/docs/WIRE-PROTOCOL.md).
|
|
112
112
|
|
|
113
113
|
## License
|
|
114
114
|
|
|
@@ -2869,7 +2869,7 @@ var require_js_yaml2 = __commonJS({
|
|
|
2869
2869
|
});
|
|
2870
2870
|
|
|
2871
2871
|
// ../publication/src/bridge.ts
|
|
2872
|
-
import { createHash as
|
|
2872
|
+
import { createHash as createHash3 } from "node:crypto";
|
|
2873
2873
|
|
|
2874
2874
|
// ../core/src/backend.ts
|
|
2875
2875
|
import path3 from "node:path";
|
|
@@ -4129,8 +4129,161 @@ var nodeFilesystemIdentityPort = Object.freeze({
|
|
|
4129
4129
|
}
|
|
4130
4130
|
});
|
|
4131
4131
|
|
|
4132
|
-
// ../core/src/
|
|
4133
|
-
|
|
4132
|
+
// ../core/src/sha256.ts
|
|
4133
|
+
var K = new Uint32Array([
|
|
4134
|
+
1116352408,
|
|
4135
|
+
1899447441,
|
|
4136
|
+
3049323471,
|
|
4137
|
+
3921009573,
|
|
4138
|
+
961987163,
|
|
4139
|
+
1508970993,
|
|
4140
|
+
2453635748,
|
|
4141
|
+
2870763221,
|
|
4142
|
+
3624381080,
|
|
4143
|
+
310598401,
|
|
4144
|
+
607225278,
|
|
4145
|
+
1426881987,
|
|
4146
|
+
1925078388,
|
|
4147
|
+
2162078206,
|
|
4148
|
+
2614888103,
|
|
4149
|
+
3248222580,
|
|
4150
|
+
3835390401,
|
|
4151
|
+
4022224774,
|
|
4152
|
+
264347078,
|
|
4153
|
+
604807628,
|
|
4154
|
+
770255983,
|
|
4155
|
+
1249150122,
|
|
4156
|
+
1555081692,
|
|
4157
|
+
1996064986,
|
|
4158
|
+
2554220882,
|
|
4159
|
+
2821834349,
|
|
4160
|
+
2952996808,
|
|
4161
|
+
3210313671,
|
|
4162
|
+
3336571891,
|
|
4163
|
+
3584528711,
|
|
4164
|
+
113926993,
|
|
4165
|
+
338241895,
|
|
4166
|
+
666307205,
|
|
4167
|
+
773529912,
|
|
4168
|
+
1294757372,
|
|
4169
|
+
1396182291,
|
|
4170
|
+
1695183700,
|
|
4171
|
+
1986661051,
|
|
4172
|
+
2177026350,
|
|
4173
|
+
2456956037,
|
|
4174
|
+
2730485921,
|
|
4175
|
+
2820302411,
|
|
4176
|
+
3259730800,
|
|
4177
|
+
3345764771,
|
|
4178
|
+
3516065817,
|
|
4179
|
+
3600352804,
|
|
4180
|
+
4094571909,
|
|
4181
|
+
275423344,
|
|
4182
|
+
430227734,
|
|
4183
|
+
506948616,
|
|
4184
|
+
659060556,
|
|
4185
|
+
883997877,
|
|
4186
|
+
958139571,
|
|
4187
|
+
1322822218,
|
|
4188
|
+
1537002063,
|
|
4189
|
+
1747873779,
|
|
4190
|
+
1955562222,
|
|
4191
|
+
2024104815,
|
|
4192
|
+
2227730452,
|
|
4193
|
+
2361852424,
|
|
4194
|
+
2428436474,
|
|
4195
|
+
2756734187,
|
|
4196
|
+
3204031479,
|
|
4197
|
+
3329325298
|
|
4198
|
+
]);
|
|
4199
|
+
var INITIAL_STATE = new Uint32Array([
|
|
4200
|
+
1779033703,
|
|
4201
|
+
3144134277,
|
|
4202
|
+
1013904242,
|
|
4203
|
+
2773480762,
|
|
4204
|
+
1359893119,
|
|
4205
|
+
2600822924,
|
|
4206
|
+
528734635,
|
|
4207
|
+
1541459225
|
|
4208
|
+
]);
|
|
4209
|
+
var encoder = new TextEncoder();
|
|
4210
|
+
function rotr(value, bits) {
|
|
4211
|
+
return value >>> bits | value << 32 - bits;
|
|
4212
|
+
}
|
|
4213
|
+
function compress(h, w, view, offset) {
|
|
4214
|
+
for (let i = 0; i < 16; i++) {
|
|
4215
|
+
w[i] = view.getUint32(offset + i * 4);
|
|
4216
|
+
}
|
|
4217
|
+
for (let i = 16; i < 64; i++) {
|
|
4218
|
+
const w15 = w[i - 15];
|
|
4219
|
+
const w2 = w[i - 2];
|
|
4220
|
+
const s0 = rotr(w15, 7) ^ rotr(w15, 18) ^ w15 >>> 3;
|
|
4221
|
+
const s1 = rotr(w2, 17) ^ rotr(w2, 19) ^ w2 >>> 10;
|
|
4222
|
+
w[i] = w[i - 16] + s0 + w[i - 7] + s1 >>> 0;
|
|
4223
|
+
}
|
|
4224
|
+
let a = h[0];
|
|
4225
|
+
let b = h[1];
|
|
4226
|
+
let c = h[2];
|
|
4227
|
+
let d = h[3];
|
|
4228
|
+
let e = h[4];
|
|
4229
|
+
let f = h[5];
|
|
4230
|
+
let g = h[6];
|
|
4231
|
+
let hh = h[7];
|
|
4232
|
+
for (let i = 0; i < 64; i++) {
|
|
4233
|
+
const S1 = rotr(e, 6) ^ rotr(e, 11) ^ rotr(e, 25);
|
|
4234
|
+
const ch = e & f ^ ~e & g;
|
|
4235
|
+
const t1 = hh + S1 + ch + K[i] + w[i] >>> 0;
|
|
4236
|
+
const S0 = rotr(a, 2) ^ rotr(a, 13) ^ rotr(a, 22);
|
|
4237
|
+
const maj = a & b ^ a & c ^ b & c;
|
|
4238
|
+
const t2 = S0 + maj >>> 0;
|
|
4239
|
+
hh = g;
|
|
4240
|
+
g = f;
|
|
4241
|
+
f = e;
|
|
4242
|
+
e = d + t1 >>> 0;
|
|
4243
|
+
d = c;
|
|
4244
|
+
c = b;
|
|
4245
|
+
b = a;
|
|
4246
|
+
a = t1 + t2 >>> 0;
|
|
4247
|
+
}
|
|
4248
|
+
h[0] = h[0] + a >>> 0;
|
|
4249
|
+
h[1] = h[1] + b >>> 0;
|
|
4250
|
+
h[2] = h[2] + c >>> 0;
|
|
4251
|
+
h[3] = h[3] + d >>> 0;
|
|
4252
|
+
h[4] = h[4] + e >>> 0;
|
|
4253
|
+
h[5] = h[5] + f >>> 0;
|
|
4254
|
+
h[6] = h[6] + g >>> 0;
|
|
4255
|
+
h[7] = h[7] + hh >>> 0;
|
|
4256
|
+
}
|
|
4257
|
+
function sha256HexOfBytes(bytes) {
|
|
4258
|
+
const h = new Uint32Array(INITIAL_STATE);
|
|
4259
|
+
const w = new Uint32Array(64);
|
|
4260
|
+
const length = bytes.byteLength;
|
|
4261
|
+
const view = new DataView(bytes.buffer, bytes.byteOffset, length);
|
|
4262
|
+
const fullBlocks = length >>> 6;
|
|
4263
|
+
for (let block = 0; block < fullBlocks; block++) {
|
|
4264
|
+
compress(h, w, view, block * 64);
|
|
4265
|
+
}
|
|
4266
|
+
const remaining = length - fullBlocks * 64;
|
|
4267
|
+
const tail = new Uint8Array(remaining + 1 + 8 > 64 ? 128 : 64);
|
|
4268
|
+
tail.set(bytes.subarray(fullBlocks * 64));
|
|
4269
|
+
tail[remaining] = 128;
|
|
4270
|
+
const tailView = new DataView(tail.buffer);
|
|
4271
|
+
const bitLengthHigh = Math.floor(length / 536870912);
|
|
4272
|
+
const bitLengthLow = length << 3 >>> 0;
|
|
4273
|
+
tailView.setUint32(tail.length - 8, bitLengthHigh);
|
|
4274
|
+
tailView.setUint32(tail.length - 4, bitLengthLow);
|
|
4275
|
+
for (let offset = 0; offset < tail.length; offset += 64) {
|
|
4276
|
+
compress(h, w, tailView, offset);
|
|
4277
|
+
}
|
|
4278
|
+
let hex = "";
|
|
4279
|
+
for (let i = 0; i < 8; i++) {
|
|
4280
|
+
hex += h[i].toString(16).padStart(8, "0");
|
|
4281
|
+
}
|
|
4282
|
+
return hex;
|
|
4283
|
+
}
|
|
4284
|
+
function sha256HexOfUtf8(input) {
|
|
4285
|
+
return sha256HexOfBytes(encoder.encode(input));
|
|
4286
|
+
}
|
|
4134
4287
|
|
|
4135
4288
|
// ../core/src/version-transport.ts
|
|
4136
4289
|
var VersionConflict = class extends Error {
|
|
@@ -4150,16 +4303,17 @@ var VersionConflict = class extends Error {
|
|
|
4150
4303
|
|
|
4151
4304
|
// ../core/src/versioning.ts
|
|
4152
4305
|
function sha256Hex(input) {
|
|
4153
|
-
return
|
|
4306
|
+
return sha256HexOfUtf8(input);
|
|
4154
4307
|
}
|
|
4155
4308
|
function versionOfBytes(raw) {
|
|
4156
4309
|
return `sha256:${sha256Hex(raw)}`;
|
|
4157
4310
|
}
|
|
4158
4311
|
function blobVersion(bytes) {
|
|
4159
|
-
return `sha256:${
|
|
4312
|
+
return `sha256:${sha256HexOfBytes(bytes)}`;
|
|
4160
4313
|
}
|
|
4161
4314
|
function defaultActor() {
|
|
4162
|
-
|
|
4315
|
+
const env = typeof process !== "undefined" ? process.env : void 0;
|
|
4316
|
+
return env?.USER?.trim() || env?.USERNAME?.trim() || env?.LOGNAME?.trim() || "local";
|
|
4163
4317
|
}
|
|
4164
4318
|
|
|
4165
4319
|
// ../core/src/backend.ts
|
|
@@ -4401,9 +4555,19 @@ var FilesystemBackend = class _FilesystemBackend {
|
|
|
4401
4555
|
}
|
|
4402
4556
|
};
|
|
4403
4557
|
|
|
4404
|
-
// ../core/src/bundle.ts
|
|
4558
|
+
// ../core/src/bundle-ops.ts
|
|
4559
|
+
var defaultBackendFactory;
|
|
4560
|
+
function setDefaultBackendFactory(factory) {
|
|
4561
|
+
defaultBackendFactory = factory;
|
|
4562
|
+
}
|
|
4405
4563
|
function backendFor(bundle) {
|
|
4406
|
-
|
|
4564
|
+
if (bundle.backend) return bundle.backend;
|
|
4565
|
+
if (defaultBackendFactory === void 0) {
|
|
4566
|
+
throw new InvalidInputError(
|
|
4567
|
+
`Bundle '${bundle.root}' has no backend and this runtime installs no default: pass bundle.backend explicitly or register one with setDefaultBackendFactory.`
|
|
4568
|
+
);
|
|
4569
|
+
}
|
|
4570
|
+
return defaultBackendFactory(bundle.root);
|
|
4407
4571
|
}
|
|
4408
4572
|
async function readBundleOkfVersion2(bundle) {
|
|
4409
4573
|
return readBundleOkfVersion(backendFor(bundle));
|
|
@@ -4421,6 +4585,9 @@ async function queryEdges2(bundle, filter = {}) {
|
|
|
4421
4585
|
return queryEdges(backendFor(bundle), filter);
|
|
4422
4586
|
}
|
|
4423
4587
|
|
|
4588
|
+
// ../core/src/bundle.ts
|
|
4589
|
+
setDefaultBackendFactory((root) => new FilesystemBackend(root));
|
|
4590
|
+
|
|
4424
4591
|
// ../core/src/kinds.ts
|
|
4425
4592
|
var CONVENTIONS_PREFIX = "conventions/";
|
|
4426
4593
|
var CONVENTION_TYPE = "Convention";
|
|
@@ -5652,7 +5819,7 @@ var PUBLICATION_BRIDGE_V0 = "v0";
|
|
|
5652
5819
|
// ../publication/src/bridge.ts
|
|
5653
5820
|
var STATIC_LAUNCH_ID = "publication-snapshot";
|
|
5654
5821
|
function digest(bytes) {
|
|
5655
|
-
return `sha256:${
|
|
5822
|
+
return `sha256:${createHash3("sha256").update(bytes).digest("hex")}`;
|
|
5656
5823
|
}
|
|
5657
5824
|
function createPublicationBridge(options) {
|
|
5658
5825
|
if (options.protocol !== PUBLICATION_BRIDGE_V0) {
|