superbee 0.4.3-pre.11 → 0.4.3-pre.14
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/SKILL.md +1 -1
- package/dist/superbee.mjs +15746 -8335
- package/package.json +1 -1
- package/references/author-an-integration.md +192 -0
- package/references/integrations/rest-json-authoring/README.md +24 -0
- package/references/integrations/rest-json-authoring/fixture/fixture.json +2466 -0
- package/references/integrations/rest-json-authoring/recipe/connectors/tickets.md +42 -0
- package/references/integrations/rest-json-authoring/recipe/conventions/ticket.md +15 -0
- package/references/integrations/rest-json-authoring/recipe/recipe.md +13 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "superbee",
|
|
3
|
-
"version": "0.4.3-pre.
|
|
3
|
+
"version": "0.4.3-pre.14",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Agent-facing Superbee CLI for reading and writing local OKF knowledge bundles: context notes, docs, cross-links, and live bundle Views.",
|
|
6
6
|
"keywords": [
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
# Author and test an integration
|
|
2
|
+
|
|
3
|
+
A recipe carries definitions. Its Connector names a provider, permitted hosts, a source profile,
|
|
4
|
+
record identities and mappings into the recipe's Kinds. Installing it does not create a connection,
|
|
5
|
+
read a credential, fetch a provider or schedule a run.
|
|
6
|
+
|
|
7
|
+
Authoring and recorded tests need only the public CLI and core packages. No Holaxis account or
|
|
8
|
+
private repository is required. Local `source bind` / `source run` use explicit private consent;
|
|
9
|
+
managed execution remains separate. Recorded tests never enable live execution.
|
|
10
|
+
|
|
11
|
+
## Validate a recipe without executing it
|
|
12
|
+
|
|
13
|
+
```sh
|
|
14
|
+
superbee recipe validate ./my-recipe --json
|
|
15
|
+
superbee recipe validate ./my-recipe --readme --json
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
The validator uses core's recipe parser, Kind and Connector mapping checks, profile validation and
|
|
19
|
+
pin digest. It reports all Connector refusals with file locations and JSON pointers. Source summaries
|
|
20
|
+
name the available profile class, hosts, method, path and ownable fields. `--readme` includes a template
|
|
21
|
+
for the maintainer, compatibility, permissions, resource scope, support and test evidence; it does not
|
|
22
|
+
invent an official support commitment or managed admission.
|
|
23
|
+
|
|
24
|
+
Validation reads the selected recipe directory and inert accepted plugin metadata. It never imports a module named by the recipe,
|
|
25
|
+
discovers a bundle, writes a document or makes a provider request. Unknown profiles are explicit
|
|
26
|
+
`PROFILE_NOT_AVAILABLE` refusals, not successful compatibility claims. Core supplies `rest-json`; `github-issues` requires explicit registration of the independently installed GitHub plugin. Registered plugin spec checks are deferred to source test/bind/run; validation never imports its module.
|
|
27
|
+
An explicitly selected test double does not establish compatibility for an unavailable profile.
|
|
28
|
+
|
|
29
|
+
The complete package is checked for core's secret-shaped text, including README files; `.env` and
|
|
30
|
+
`.env.*` containers are refused without opening them. Output names the offending location, never the
|
|
31
|
+
secret value. This is a packaging tripwire, not a guarantee that arbitrary secrets can be recognized.
|
|
32
|
+
Keep real credentials outside the recipe. Dot-prefixed entries are refused before traversal or
|
|
33
|
+
opening, matching recipe acquisition. Symlinks, special files, malformed UTF-8 and inputs
|
|
34
|
+
beyond the documented bounds are refused. Bounds are 512 directory entries, nesting depth 12,
|
|
35
|
+
2 MiB per file and 8 MiB total. Select the recipe subdirectory rather than an entire repository.
|
|
36
|
+
|
|
37
|
+
## Replay recorded source responses
|
|
38
|
+
|
|
39
|
+
The distributed `references/integrations/rest-json-authoring/` example includes a recipe and a
|
|
40
|
+
passing recorded fixture for every required scenario. Copy that directory somewhere outside the
|
|
41
|
+
source checkout and run the two commands in its README. It needs no `--profile` executable module.
|
|
42
|
+
|
|
43
|
+
```sh
|
|
44
|
+
superbee source test ./my-recipe --fixture ./fixtures/my-source --json
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
The fixture directory contains `fixture.json`. The selected Connector and source must belong to the
|
|
48
|
+
recipe. Core's public source harness runs every scenario through the same observation engine,
|
|
49
|
+
mapping, record-overlay, conflict rules and in-memory storage that library consumers use. The CLI
|
|
50
|
+
does not have its own observer or mapper, and it opens no live transport.
|
|
51
|
+
|
|
52
|
+
The version-1 JSON shape is:
|
|
53
|
+
|
|
54
|
+
```json
|
|
55
|
+
{
|
|
56
|
+
"version": 1,
|
|
57
|
+
"connector": "connectors/example",
|
|
58
|
+
"source": "items",
|
|
59
|
+
"feed": "source-feeds/example",
|
|
60
|
+
"documents": [],
|
|
61
|
+
"scenarios": [
|
|
62
|
+
{
|
|
63
|
+
"name": "errors.server",
|
|
64
|
+
"runs": [{"exchanges": [{"request": {"url": "https://api.example.org/items"}, "response": {"status": 503}}]}],
|
|
65
|
+
"expect": [{
|
|
66
|
+
"receipt": {"outcome": "provider_unavailable", "reason": null, "pages": 0, "held": 0, "pending": 0, "pass": {}, "changes": {}},
|
|
67
|
+
"cursor": null,
|
|
68
|
+
"requests": [],
|
|
69
|
+
"changes": [],
|
|
70
|
+
"findings": []
|
|
71
|
+
}]
|
|
72
|
+
}
|
|
73
|
+
]
|
|
74
|
+
}
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
This illustrates the shape, **not passing expected values**. Populate `documents` with the Source
|
|
78
|
+
Feed, its necessary conventions and any existing target documents; recipe conventions are already
|
|
79
|
+
included and cannot be shadowed. Supply the real expected receipt fields, requests, cursor, changes
|
|
80
|
+
and findings for every run. A recipe's definitions-only directory and recorded fixtures remain
|
|
81
|
+
separate. Expected values are compared exactly; missing expectation keys, changed receipts, unused
|
|
82
|
+
recorded exchanges, unscripted requests and failed core invariants fail the command.
|
|
83
|
+
|
|
84
|
+
Each exchange records the method and URL expected by the public harness and a response (`status`,
|
|
85
|
+
optional headers and body), `{ "fail": true }`, or `{ "hang": true }`. Runs may specify `mode`, `at`,
|
|
86
|
+
`edits` and a bounded engine `budget`. Fixture records can include hostile URLs and other attack
|
|
87
|
+
strings to test refusal. The report never echoes provider payloads, profile exception text or actual
|
|
88
|
+
and expected field values. Echoed scenario names must not contain secret-shaped text; invalid
|
|
89
|
+
presentation metadata is refused without printing its value even when attack payloads are allowed.
|
|
90
|
+
|
|
91
|
+
The report lists required and missing scenarios. Cover authentication/rate/server/malformed errors,
|
|
92
|
+
incomplete pages, cursor resume and hostile cursors, complete-observation disappearance, owned-field
|
|
93
|
+
conflicts, unmapped and null values, missing identity, redirects and undeclared hosts. A subset may
|
|
94
|
+
be useful during development, but missing required scenarios always makes the final command fail.
|
|
95
|
+
Scenarios are bounded to 64, with at most 16 runs per scenario and 512 exchanges per run.
|
|
96
|
+
|
|
97
|
+
## Explicitly test local profile code
|
|
98
|
+
|
|
99
|
+
```sh
|
|
100
|
+
superbee source test ./my-recipe --fixture ./fixtures/my-source --profile ./profile.mjs --json
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
`--profile` deliberately imports local JavaScript. Its default export (or named `profile`) must be a
|
|
104
|
+
public `SourceProfile` with the same id as the declaration. The fixture may supply `spec`; otherwise
|
|
105
|
+
the profile receives the parsed Connector source. A scenario can override its spec to exercise
|
|
106
|
+
refusal cases. Core's `SourceProfile`, `runSourceScenario`, `runSourceFixture` and conformance tools
|
|
107
|
+
are also available directly from `@superbee/core/source-engine` and `/source-harness` in `node:test`.
|
|
108
|
+
|
|
109
|
+
**Run only code you trust.** A local extension runs in this Node process with its ordinary authority;
|
|
110
|
+
this is not a sandbox, and using a recorded transport does not prevent arbitrary code from using
|
|
111
|
+
ambient APIs. The static egress check and independent admission review lower that risk; they do not
|
|
112
|
+
provide isolation. Neither a fixture nor a recipe can implicitly select a module for the CLI to
|
|
113
|
+
execute. Validation and installation never import one.
|
|
114
|
+
|
|
115
|
+
The public [superbee-plugins repository](https://github.com/Holaxis-ai/superbee-plugins) owns the
|
|
116
|
+
[GitHub integration](https://github.com/Holaxis-ai/superbee-plugins/tree/main/integrations/github),
|
|
117
|
+
[Work Item recipes](https://github.com/Holaxis-ai/superbee-plugins/tree/main/recipes) and
|
|
118
|
+
[GitHub/Linear examples](https://github.com/Holaxis-ai/superbee-plugins/tree/main/examples). Its synthetic fixtures
|
|
119
|
+
qualify mapping and observation behavior; live provider access and managed catalog admission remain
|
|
120
|
+
separate evidence.
|
|
121
|
+
|
|
122
|
+
## Register the GitHub integration from a source checkout
|
|
123
|
+
|
|
124
|
+
The GitHub integration is distributed through the public Git repository; no integration npm
|
|
125
|
+
publication is required. Follow the repository README's
|
|
126
|
+
[install from source](https://github.com/Holaxis-ai/superbee-plugins#install-the-github-integration-from-source)
|
|
127
|
+
steps: select and review a full 40-character Git commit, check it out detached, install development
|
|
128
|
+
tools and the exact compatible public Core version, then build. Review code before running its
|
|
129
|
+
installation or build commands. Core and the Superbee CLI retain their normal npm distribution
|
|
130
|
+
channels; this source checkout supplies the integration code.
|
|
131
|
+
|
|
132
|
+
With that built checkout at `./superbee-plugins`, select its integration directory explicitly:
|
|
133
|
+
|
|
134
|
+
```sh
|
|
135
|
+
superbee source plugin register ./superbee-plugins/integrations/github --json
|
|
136
|
+
superbee source plugin register ./superbee-plugins/integrations/github --accept <digest-from-preview> --json
|
|
137
|
+
superbee source plugin list --json
|
|
138
|
+
superbee recipe add github:source-feeds --dir ./bundle
|
|
139
|
+
superbee recipe add github:work-items --dir ./bundle
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
Registration copies a bounded manifest, standalone module and inert recipe bytes into private
|
|
143
|
+
immutable generations. Preview, acceptance, listing, removal and recipe installation never import
|
|
144
|
+
plugin code. Acceptance trusts those local bytes as reviewed code executing with ambient process
|
|
145
|
+
authority. A package name and digest do not authenticate publisher origin or provide a sandbox.
|
|
146
|
+
A full Git commit identifies the selected source; it does not authenticate the publisher or make
|
|
147
|
+
that code safe. Superbee does not acquire or build integrations. Registration grants no feed binding
|
|
148
|
+
or credentials. Use the checkout's `recipes/source-feeds` and `recipes/work-items` folders for
|
|
149
|
+
`recipe validate` and its recorded fixtures for `source test`, following the repository examples.
|
|
150
|
+
|
|
151
|
+
Updates require reviewing another full Git commit, checking it out and rebuilding with the README's
|
|
152
|
+
compatible Core setup, then a new accepted registration and explicit feed rebind.
|
|
153
|
+
Rebinding changed consent resets observations and accepted tuples for reacquisition. Remove future
|
|
154
|
+
availability with `superbee source plugin remove github`; already selected runs may finish their
|
|
155
|
+
selected generation. Existing bundle content and retained generations are preserved.
|
|
156
|
+
|
|
157
|
+
## Bind and run a local Source Feed
|
|
158
|
+
|
|
159
|
+
After installing a recipe and creating its Source Feed in a local or Git bundle, preview consent:
|
|
160
|
+
|
|
161
|
+
```sh
|
|
162
|
+
superbee source bind source-feeds/github --anonymous --dir ./bundle --json
|
|
163
|
+
superbee source bind source-feeds/github --anonymous --accept <digest-from-preview> --dir ./bundle --json
|
|
164
|
+
superbee source run source-feeds/github --dir ./bundle --json
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
Binding previews make no provider request and read no credential. Acceptance pins the physical
|
|
168
|
+
bundle, feed, declaration/provider rules, resource, Kind/overlay policy, profile/version and accepted implementation identity
|
|
169
|
+
and budgets in private user state. A changed pin refuses before module import, factory/spec execution, network or credential reads;
|
|
170
|
+
preview and accept again. Copying or moving a bundle requires a new binding. `--complete` requests
|
|
171
|
+
a complete pass; an interrupted pass never claims completeness.
|
|
172
|
+
|
|
173
|
+
Anonymous public GitHub reads use the same read-path/resource guard and never discover credentials.
|
|
174
|
+
For an explicitly authorized credentialed run, replace `--anonymous` with `--credential-env NAME`;
|
|
175
|
+
the binding stores only that variable name. Supply the token separately through the process
|
|
176
|
+
environment. Never put token values in arguments, recipes, fixtures or documents. GitHub token and
|
|
177
|
+
GitHub App installation-token declarations are supported; no login, token exchange or credential
|
|
178
|
+
discovery is performed. A 401/403 is a normal credential-refused result.
|
|
179
|
+
|
|
180
|
+
Run admits built-ins and explicitly registered plugins and uses bounded DNS-pinned HTTPS. It updates existing documents
|
|
181
|
+
linked by `sources` and existing overlay Signals; it does not create mirrored Work Items. A document
|
|
182
|
+
linked after a prior observation can adopt cached last-observed values on its next run, including a
|
|
183
|
+
304. A held invalid provider value needs a fresh observation; it is not retained as a retry queue.
|
|
184
|
+
Private observation/accepted state persists with one lock and atomic envelope. A crash after a
|
|
185
|
+
bundle write can replay through the same conflict rules; no exactly-once cross-store transaction
|
|
186
|
+
is claimed. Corrupt private state refuses without reset. Summaries omit records, cursor, raw
|
|
187
|
+
provider errors and credential values. Neither bind nor run synchronizes or publishes a bundle.
|
|
188
|
+
|
|
189
|
+
Run receipts include fixed machine reason codes where available, never provider error text.
|
|
190
|
+
A terminal unsuccessful run exits nonzero after its receipt: credential refusal 4, not found 6,
|
|
191
|
+
guard/content/size refusal 2, and provider/runtime failure 1. Observed and deferred exit 0;
|
|
192
|
+
deferred retains retry metadata for continuation and does not claim a complete observation.
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Recorded REST integration authoring
|
|
2
|
+
|
|
3
|
+
This example uses a synthetic ticket board, not a live provider or a credential.
|
|
4
|
+
|
|
5
|
+
From a copy of this directory, using a CLI release that includes integration authoring:
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
superbee recipe validate ./recipe --readme --json
|
|
9
|
+
superbee source test ./recipe --fixture ./fixture --json
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
No checkout, account, environment variable or private source is required. The recorded fixture
|
|
13
|
+
exercises all required source scenarios, including hostile provider URLs. Expected values are
|
|
14
|
+
committed independently of the CLI run. Change one expected receipt or remove a required scenario:
|
|
15
|
+
the second command exits nonzero. Neither command writes to the recipe or a real bundle.
|
|
16
|
+
|
|
17
|
+
The Source Feed and Signal fixture conventions are the public source-feeds recipe definitions;
|
|
18
|
+
the Ticket example and recorded scenario corpus reuse the source engine's synthetic ticket board.
|
|
19
|
+
This tests the shipped declarative rest-json profile. It does not qualify a real provider, enable
|
|
20
|
+
local live execution, grant credentials or establish managed admission.
|
|
21
|
+
|
|
22
|
+
See `references/author-an-integration.md` in the CLI package (source:
|
|
23
|
+
`examples/references/author-an-integration.md`) for the fixture format and explicit local-code
|
|
24
|
+
execution boundary.
|