superbee 0.1.3 → 0.1.4
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 +13 -0
- package/SKILL.md +4 -2
- package/dist/publication/bridge-entry.d.ts +5 -0
- package/dist/publication/bridge.d.ts +9 -0
- package/dist/publication/canonical-json.d.ts +3 -0
- package/dist/publication/capture.d.ts +4 -0
- package/dist/publication/errors.d.ts +22 -0
- package/dist/publication/generated/publication-snapshot-v1.d.ts +125 -0
- package/dist/publication/index.d.ts +7 -0
- package/dist/publication/schema/publication-snapshot-v1.schema.json +146 -0
- package/dist/publication/schema.d.ts +3 -0
- package/dist/publication/snapshot-backend.d.ts +33 -0
- package/dist/publication/types.d.ts +44 -0
- package/dist/publication-bridge.mjs +6165 -0
- package/dist/publication.mjs +44039 -0
- package/dist/superbee.mjs +2856 -1202
- package/package.json +16 -6
- package/references/views/about.html +30 -13
- package/references/views/pulse.html +69 -43
- package/references/views/roadmap.html +48 -33
package/README.md
CHANGED
|
@@ -20,6 +20,13 @@ know invisible to the humans they work for. Superbee fixes all three:
|
|
|
20
20
|
pages with derived backlinks, a live activity feed, and launchable bundle Views. `superbee
|
|
21
21
|
sync` shares the bundle with teammates on a dedicated `board` branch — pulling their changes
|
|
22
22
|
and pushing yours without touching your code.
|
|
23
|
+
- **Views on demand.** Ask your agent to create whatever representation you need and Superbee will
|
|
24
|
+
create it: a self-contained HTML View, registered in the bundle as a typed document, that
|
|
25
|
+
`superbee ui` launches in a sandboxed iframe. A reading surface for one dense document, a board, a
|
|
26
|
+
timeline, a filtered queue, a chart, a dashboard — the shape follows the question rather than a
|
|
27
|
+
fixed set of built-in screens, and a view worth keeping stays. A data View reads live bundle
|
|
28
|
+
content through a narrow read-only bridge and refreshes as documents change. Views are bundle
|
|
29
|
+
content, so they travel with `sync` and open the same way for a teammate's agent.
|
|
23
30
|
- **Agent-native by design.** The CLI follows the AXI principles for agent-facing tools:
|
|
24
31
|
structured, token-lean output; result counts and truncation with explicit escape hatches;
|
|
25
32
|
idempotent mutations; structured errors with a small, stable exit-code taxonomy. Agents get
|
|
@@ -35,6 +42,11 @@ Agent Skill that teaches agents how to use it.
|
|
|
35
42
|
|
|
36
43
|
## Install Steps
|
|
37
44
|
|
|
45
|
+
**Requirements: Node.js 20 or newer on macOS, Linux, or Windows.** On Windows, Superbee keeps
|
|
46
|
+
per-user operational state under `%LOCALAPPDATA%\Superbee` and uses Windows-native containment and
|
|
47
|
+
path-identity checks instead of relying on synthesized POSIX mode bits. Native Windows behavior and
|
|
48
|
+
the globally installed `superbee.cmd` entrypoint are covered by the required CI contract.
|
|
49
|
+
|
|
38
50
|
1. Install the CLI globally:
|
|
39
51
|
|
|
40
52
|
```sh
|
|
@@ -62,6 +74,7 @@ instructions into CLI commands. For example:
|
|
|
62
74
|
- "Write up what we decided about the auth design as a doc, and link it to the task."
|
|
63
75
|
- "What did the last session leave off on? Check the context notes."
|
|
64
76
|
- "Sync the board so my teammate's agent sees this."
|
|
77
|
+
- "Give me a view of the open tasks grouped by owner."
|
|
65
78
|
|
|
66
79
|
Behind those requests, the agent drives a small, predictable CLI: `init` creates a bundle in a
|
|
67
80
|
conventional `.superbee/` folder (discovered automatically, the way git finds `.git`); `new`,
|
package/SKILL.md
CHANGED
|
@@ -83,8 +83,10 @@ When the tone fits, a single 🐝 may mark a successful Superbee outcome.
|
|
|
83
83
|
## Host setup
|
|
84
84
|
|
|
85
85
|
Persistent integrations require `npm install -g superbee` followed by `superbee setup`.
|
|
86
|
-
Setup is
|
|
87
|
-
|
|
86
|
+
Setup is an agent-driven read-only conductor: the calling agent selects its exact host, executes
|
|
87
|
+
the returned argv action, reports what it is doing, requests approval only when the action says
|
|
88
|
+
`approval.required: true`, restarts after Skill, Hook, or MCP changes, and reruns setup to verify.
|
|
89
|
+
Do not ask the user to copy or run a setup command unless execution is unavailable. A catalog entry
|
|
88
90
|
preserves a workspace for explicit selection; it never makes that workspace the current project.
|
|
89
91
|
If home or SessionStart reports `skill_update`, run its exact scope-specific command, restart the
|
|
90
92
|
host, and continue; Superbee never rewrites an installed Skill automatically.
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { createPublicationBridge, type CreatePublicationBridgeOptionsV1 } from "./bridge.js";
|
|
2
|
+
export { PublicationError, isPublicationError } from "./errors.js";
|
|
3
|
+
export type { PublicationErrorCodeV1, PublicationErrorOptions } from "./errors.js";
|
|
4
|
+
export { PUBLICATION_BRIDGE_V0, type PublicationBridgeAdmissionV1, type PublicationBridgeOutcomeV1, type PublicationBridgeV1, type PublicationObjectRefV1, type PublicationSnapshotHandleV1, type PublicationSnapshotV1, } from "./types.js";
|
|
5
|
+
//# sourceMappingURL=bridge-entry.d.ts.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { PUBLICATION_BRIDGE_V0, type PublicationBridgeAdmissionV1, type PublicationBridgeV1, type PublicationSnapshotHandleV1 } from "./types.js";
|
|
2
|
+
export interface CreatePublicationBridgeOptionsV1 {
|
|
3
|
+
protocol: typeof PUBLICATION_BRIDGE_V0;
|
|
4
|
+
snapshot: PublicationSnapshotHandleV1;
|
|
5
|
+
admittedView: PublicationBridgeAdmissionV1;
|
|
6
|
+
}
|
|
7
|
+
/** Create the canonical read-only View bridge over one immutable publication snapshot. */
|
|
8
|
+
export declare function createPublicationBridge(options: CreatePublicationBridgeOptionsV1): PublicationBridgeV1;
|
|
9
|
+
//# sourceMappingURL=bridge.d.ts.map
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type CapturePublicationSnapshotOptionsV1, type PublicationSnapshotHandleV1 } from "./types.js";
|
|
2
|
+
/** Capture one coherent immutable filesystem publication snapshot. */
|
|
3
|
+
export declare function capturePublicationSnapshot(options: CapturePublicationSnapshotOptionsV1): Promise<PublicationSnapshotHandleV1>;
|
|
4
|
+
//# sourceMappingURL=capture.d.ts.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export type PublicationErrorCodeV1 = "SOURCE_NOT_FOUND" | "UNSUPPORTED_SOURCE" | "SOURCE_CHANGED" | "LIMIT_EXCEEDED" | "INVALID_BUNDLE" | "INVALID_OBJECT_IDENTITY" | "OBJECT_MISSING" | "OBJECT_VERSION_MISMATCH" | "MALFORMED_DOCUMENT" | "DUPLICATE_DOCUMENT_ID" | "UNSERIALIZABLE_VALUE" | "RENDER_FAILED" | "INVALID_VIEW_REGISTRATION" | "VIEW_ENTRY_MISSING" | "VIEW_ENTRY_VERSION_MISMATCH" | "CAPABILITY_UNAVAILABLE" | "INVALID_SNAPSHOT" | "OBJECT_DIGEST_MISMATCH" | "INVALID_BRIDGE_ADMISSION" | "HANDLE_CLOSED" | "IO_ERROR" | "INTERNAL_ERROR";
|
|
2
|
+
export interface PublicationErrorOptions {
|
|
3
|
+
retryable?: boolean;
|
|
4
|
+
subject?: string;
|
|
5
|
+
expected?: unknown;
|
|
6
|
+
actual?: unknown;
|
|
7
|
+
details?: Record<string, unknown>;
|
|
8
|
+
cause?: unknown;
|
|
9
|
+
}
|
|
10
|
+
/** Stable error boundary for every `superbee/publication` operation. */
|
|
11
|
+
export declare class PublicationError extends Error {
|
|
12
|
+
readonly code: PublicationErrorCodeV1;
|
|
13
|
+
readonly retryable: boolean;
|
|
14
|
+
readonly subject?: string;
|
|
15
|
+
readonly expected?: unknown;
|
|
16
|
+
readonly actual?: unknown;
|
|
17
|
+
readonly details?: Record<string, unknown>;
|
|
18
|
+
readonly cause?: unknown;
|
|
19
|
+
constructor(code: PublicationErrorCodeV1, message: string, options?: PublicationErrorOptions);
|
|
20
|
+
}
|
|
21
|
+
export declare function isPublicationError(value: unknown): value is PublicationError;
|
|
22
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This interface was referenced by `PublicationSnapshotV1`'s JSON-Schema
|
|
3
|
+
* via the `definition` "sha256".
|
|
4
|
+
*/
|
|
5
|
+
export type Sha256 = string;
|
|
6
|
+
/**
|
|
7
|
+
* This interface was referenced by `PublicationSnapshotV1`'s JSON-Schema
|
|
8
|
+
* via the `definition` "jsonValue".
|
|
9
|
+
*/
|
|
10
|
+
export type JsonValue = null | boolean | number | string | JsonValue[] | {
|
|
11
|
+
[k: string]: JsonValue;
|
|
12
|
+
};
|
|
13
|
+
export interface PublicationSnapshotV1 {
|
|
14
|
+
schema: "https://getsuperbee.com/schemas/publication-snapshot/v1";
|
|
15
|
+
schemaVersion: 1;
|
|
16
|
+
snapshotDigest: Sha256;
|
|
17
|
+
source: {
|
|
18
|
+
okfEdition: string;
|
|
19
|
+
rootDocumentVersion: string | null;
|
|
20
|
+
[k: string]: unknown;
|
|
21
|
+
};
|
|
22
|
+
semantics: {
|
|
23
|
+
rendererProfile: string;
|
|
24
|
+
viewBridgeProtocol: "v0";
|
|
25
|
+
[k: string]: unknown;
|
|
26
|
+
};
|
|
27
|
+
capabilities: string[];
|
|
28
|
+
documents: Document[];
|
|
29
|
+
reserved: Reserved[];
|
|
30
|
+
blobs: Blob[];
|
|
31
|
+
relationships: Relationship[];
|
|
32
|
+
views: View[];
|
|
33
|
+
warnings: Warning[];
|
|
34
|
+
[k: string]: unknown;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* This interface was referenced by `PublicationSnapshotV1`'s JSON-Schema
|
|
38
|
+
* via the `definition` "document".
|
|
39
|
+
*/
|
|
40
|
+
export interface Document {
|
|
41
|
+
id: string;
|
|
42
|
+
version: string;
|
|
43
|
+
frontmatter: {
|
|
44
|
+
[k: string]: JsonValue;
|
|
45
|
+
};
|
|
46
|
+
body: string;
|
|
47
|
+
source: ObjectRef;
|
|
48
|
+
rendered: {
|
|
49
|
+
html: ObjectRef;
|
|
50
|
+
bounded: boolean;
|
|
51
|
+
[k: string]: unknown;
|
|
52
|
+
};
|
|
53
|
+
[k: string]: unknown;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* This interface was referenced by `PublicationSnapshotV1`'s JSON-Schema
|
|
57
|
+
* via the `definition` "objectRef".
|
|
58
|
+
*/
|
|
59
|
+
export interface ObjectRef {
|
|
60
|
+
digest: Sha256;
|
|
61
|
+
size: number;
|
|
62
|
+
mediaType: string;
|
|
63
|
+
representation: "exact" | "canonical";
|
|
64
|
+
[k: string]: unknown;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* This interface was referenced by `PublicationSnapshotV1`'s JSON-Schema
|
|
68
|
+
* via the `definition` "reserved".
|
|
69
|
+
*/
|
|
70
|
+
export interface Reserved {
|
|
71
|
+
dir: string;
|
|
72
|
+
name: "index.md" | "log.md";
|
|
73
|
+
version: string;
|
|
74
|
+
object: ObjectRef;
|
|
75
|
+
[k: string]: unknown;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* This interface was referenced by `PublicationSnapshotV1`'s JSON-Schema
|
|
79
|
+
* via the `definition` "blob".
|
|
80
|
+
*/
|
|
81
|
+
export interface Blob {
|
|
82
|
+
key: string;
|
|
83
|
+
version: string;
|
|
84
|
+
contentType: string;
|
|
85
|
+
object: ObjectRef;
|
|
86
|
+
[k: string]: unknown;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* This interface was referenced by `PublicationSnapshotV1`'s JSON-Schema
|
|
90
|
+
* via the `definition` "relationship".
|
|
91
|
+
*/
|
|
92
|
+
export interface Relationship {
|
|
93
|
+
from: string;
|
|
94
|
+
to: string;
|
|
95
|
+
text: string;
|
|
96
|
+
href: string;
|
|
97
|
+
[k: string]: unknown;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* This interface was referenced by `PublicationSnapshotV1`'s JSON-Schema
|
|
101
|
+
* via the `definition` "view".
|
|
102
|
+
*/
|
|
103
|
+
export interface View {
|
|
104
|
+
id: string;
|
|
105
|
+
registrationVersion: string;
|
|
106
|
+
title: string;
|
|
107
|
+
description?: string;
|
|
108
|
+
presentation?: "workspace" | "inline" | "adaptive";
|
|
109
|
+
access: "none" | "bundle-read" | "bundle-propose";
|
|
110
|
+
entry: string;
|
|
111
|
+
entryVersion: string;
|
|
112
|
+
entryObject: ObjectRef;
|
|
113
|
+
[k: string]: unknown;
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* This interface was referenced by `PublicationSnapshotV1`'s JSON-Schema
|
|
117
|
+
* via the `definition` "warning".
|
|
118
|
+
*/
|
|
119
|
+
export interface Warning {
|
|
120
|
+
code: string;
|
|
121
|
+
message: string;
|
|
122
|
+
subject?: string;
|
|
123
|
+
[k: string]: unknown;
|
|
124
|
+
}
|
|
125
|
+
//# sourceMappingURL=publication-snapshot-v1.d.ts.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { capturePublicationSnapshot } from "./capture.js";
|
|
2
|
+
export { createPublicationBridge, type CreatePublicationBridgeOptionsV1 } from "./bridge.js";
|
|
3
|
+
export { PublicationError, isPublicationError } from "./errors.js";
|
|
4
|
+
export type { PublicationErrorCodeV1, PublicationErrorOptions } from "./errors.js";
|
|
5
|
+
export { PUBLICATION_SNAPSHOT_SCHEMA_V1 } from "./schema.js";
|
|
6
|
+
export { PUBLICATION_BRIDGE_V0, PUBLICATION_SNAPSHOT_V1, type CapturePublicationSnapshotOptionsV1, type PublicationBridgeAdmissionV1, type PublicationBridgeOutcomeV1, type PublicationBridgeV1, type PublicationJsonValue, type PublicationObjectRefV1, type PublicationSnapshotHandleV1, type PublicationSnapshotV1, } from "./types.js";
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://getsuperbee.com/schemas/publication-snapshot/v1",
|
|
4
|
+
"title": "PublicationSnapshotV1",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": true,
|
|
7
|
+
"required": ["schema", "schemaVersion", "snapshotDigest", "source", "semantics", "capabilities", "documents", "reserved", "blobs", "relationships", "views", "warnings"],
|
|
8
|
+
"properties": {
|
|
9
|
+
"schema": { "const": "https://getsuperbee.com/schemas/publication-snapshot/v1" },
|
|
10
|
+
"schemaVersion": { "const": 1 },
|
|
11
|
+
"snapshotDigest": { "$ref": "#/$defs/sha256" },
|
|
12
|
+
"source": {
|
|
13
|
+
"type": "object",
|
|
14
|
+
"additionalProperties": true,
|
|
15
|
+
"required": ["okfEdition", "rootDocumentVersion"],
|
|
16
|
+
"properties": {
|
|
17
|
+
"okfEdition": { "type": "string", "minLength": 1 },
|
|
18
|
+
"rootDocumentVersion": { "oneOf": [{ "type": "string" }, { "type": "null" }] }
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"semantics": {
|
|
22
|
+
"type": "object",
|
|
23
|
+
"additionalProperties": true,
|
|
24
|
+
"required": ["rendererProfile", "viewBridgeProtocol"],
|
|
25
|
+
"properties": {
|
|
26
|
+
"rendererProfile": { "type": "string", "minLength": 1 },
|
|
27
|
+
"viewBridgeProtocol": { "const": "v0" }
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
"capabilities": {
|
|
31
|
+
"type": "array",
|
|
32
|
+
"uniqueItems": true,
|
|
33
|
+
"items": { "type": "string", "minLength": 1 }
|
|
34
|
+
},
|
|
35
|
+
"documents": { "type": "array", "items": { "$ref": "#/$defs/document" } },
|
|
36
|
+
"reserved": { "type": "array", "items": { "$ref": "#/$defs/reserved" } },
|
|
37
|
+
"blobs": { "type": "array", "items": { "$ref": "#/$defs/blob" } },
|
|
38
|
+
"relationships": { "type": "array", "items": { "$ref": "#/$defs/relationship" } },
|
|
39
|
+
"views": { "type": "array", "items": { "$ref": "#/$defs/view" } },
|
|
40
|
+
"warnings": { "type": "array", "items": { "$ref": "#/$defs/warning" } }
|
|
41
|
+
},
|
|
42
|
+
"$defs": {
|
|
43
|
+
"sha256": { "type": "string", "pattern": "^sha256:[0-9a-f]{64}$" },
|
|
44
|
+
"jsonValue": {
|
|
45
|
+
"oneOf": [
|
|
46
|
+
{ "type": "null" },
|
|
47
|
+
{ "type": "boolean" },
|
|
48
|
+
{ "type": "number" },
|
|
49
|
+
{ "type": "string" },
|
|
50
|
+
{ "type": "array", "items": { "$ref": "#/$defs/jsonValue" } },
|
|
51
|
+
{ "type": "object", "additionalProperties": { "$ref": "#/$defs/jsonValue" } }
|
|
52
|
+
]
|
|
53
|
+
},
|
|
54
|
+
"objectRef": {
|
|
55
|
+
"type": "object",
|
|
56
|
+
"additionalProperties": true,
|
|
57
|
+
"required": ["digest", "size", "mediaType", "representation"],
|
|
58
|
+
"properties": {
|
|
59
|
+
"digest": { "$ref": "#/$defs/sha256" },
|
|
60
|
+
"size": { "type": "integer", "minimum": 0 },
|
|
61
|
+
"mediaType": { "type": "string", "minLength": 1 },
|
|
62
|
+
"representation": { "enum": ["exact", "canonical"] }
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
"document": {
|
|
66
|
+
"type": "object",
|
|
67
|
+
"additionalProperties": true,
|
|
68
|
+
"required": ["id", "version", "frontmatter", "body", "source", "rendered"],
|
|
69
|
+
"properties": {
|
|
70
|
+
"id": { "type": "string", "minLength": 1 },
|
|
71
|
+
"version": { "type": "string", "minLength": 1 },
|
|
72
|
+
"frontmatter": { "type": "object", "additionalProperties": { "$ref": "#/$defs/jsonValue" } },
|
|
73
|
+
"body": { "type": "string" },
|
|
74
|
+
"source": { "$ref": "#/$defs/objectRef" },
|
|
75
|
+
"rendered": {
|
|
76
|
+
"type": "object",
|
|
77
|
+
"additionalProperties": true,
|
|
78
|
+
"required": ["html", "bounded"],
|
|
79
|
+
"properties": {
|
|
80
|
+
"html": { "$ref": "#/$defs/objectRef" },
|
|
81
|
+
"bounded": { "type": "boolean" }
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
"reserved": {
|
|
87
|
+
"type": "object",
|
|
88
|
+
"additionalProperties": true,
|
|
89
|
+
"required": ["dir", "name", "version", "object"],
|
|
90
|
+
"properties": {
|
|
91
|
+
"dir": { "type": "string" },
|
|
92
|
+
"name": { "enum": ["index.md", "log.md"] },
|
|
93
|
+
"version": { "type": "string", "minLength": 1 },
|
|
94
|
+
"object": { "$ref": "#/$defs/objectRef" }
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
"blob": {
|
|
98
|
+
"type": "object",
|
|
99
|
+
"additionalProperties": true,
|
|
100
|
+
"required": ["key", "version", "contentType", "object"],
|
|
101
|
+
"properties": {
|
|
102
|
+
"key": { "type": "string", "minLength": 1 },
|
|
103
|
+
"version": { "type": "string", "minLength": 1 },
|
|
104
|
+
"contentType": { "type": "string", "minLength": 1 },
|
|
105
|
+
"object": { "$ref": "#/$defs/objectRef" }
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
"relationship": {
|
|
109
|
+
"type": "object",
|
|
110
|
+
"additionalProperties": true,
|
|
111
|
+
"required": ["from", "to", "text", "href"],
|
|
112
|
+
"properties": {
|
|
113
|
+
"from": { "type": "string", "minLength": 1 },
|
|
114
|
+
"to": { "type": "string", "minLength": 1 },
|
|
115
|
+
"text": { "type": "string" },
|
|
116
|
+
"href": { "type": "string" }
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
"view": {
|
|
120
|
+
"type": "object",
|
|
121
|
+
"additionalProperties": true,
|
|
122
|
+
"required": ["id", "registrationVersion", "title", "access", "entry", "entryVersion", "entryObject"],
|
|
123
|
+
"properties": {
|
|
124
|
+
"id": { "type": "string", "minLength": 1 },
|
|
125
|
+
"registrationVersion": { "type": "string", "minLength": 1 },
|
|
126
|
+
"title": { "type": "string", "minLength": 1 },
|
|
127
|
+
"description": { "type": "string" },
|
|
128
|
+
"presentation": { "enum": ["workspace", "inline", "adaptive"] },
|
|
129
|
+
"access": { "enum": ["none", "bundle-read", "bundle-propose"] },
|
|
130
|
+
"entry": { "type": "string", "minLength": 1 },
|
|
131
|
+
"entryVersion": { "type": "string", "minLength": 1 },
|
|
132
|
+
"entryObject": { "$ref": "#/$defs/objectRef" }
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
"warning": {
|
|
136
|
+
"type": "object",
|
|
137
|
+
"additionalProperties": true,
|
|
138
|
+
"required": ["code", "message"],
|
|
139
|
+
"properties": {
|
|
140
|
+
"code": { "type": "string", "minLength": 1 },
|
|
141
|
+
"message": { "type": "string", "minLength": 1 },
|
|
142
|
+
"subject": { "type": "string" }
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { BlobKey, ConceptId, DeleteOptions, HeadResult, OkfDocument, QueryFilter, ReadBlobResult, ReadResult, ReservedFilename, ReservedReadResult, StorageBackend, Version, VersionInfo, WriteOptions } from "@superbee/core";
|
|
2
|
+
import type { PublicationSnapshotHandleV1 } from "./types.js";
|
|
3
|
+
/** Read-only adapter used only to reuse the canonical core and View bridge semantics. */
|
|
4
|
+
export declare class PublicationSnapshotBackend implements StorageBackend {
|
|
5
|
+
private readonly snapshot;
|
|
6
|
+
private readonly documents;
|
|
7
|
+
private readonly reserved;
|
|
8
|
+
private readonly blobs;
|
|
9
|
+
constructor(snapshot: PublicationSnapshotHandleV1);
|
|
10
|
+
read(id: ConceptId): Promise<ReadResult>;
|
|
11
|
+
readMany(ids: ConceptId[]): Promise<ReadResult[]>;
|
|
12
|
+
write(_id: ConceptId, _doc: OkfDocument, _options?: WriteOptions): Promise<Version>;
|
|
13
|
+
delete(_id: ConceptId, _options?: DeleteOptions): Promise<boolean>;
|
|
14
|
+
exists(id: ConceptId): Promise<boolean>;
|
|
15
|
+
list(prefix?: string): Promise<ConceptId[]>;
|
|
16
|
+
versions(id: ConceptId): Promise<VersionInfo[]>;
|
|
17
|
+
queryHeads(filter?: QueryFilter): Promise<HeadResult[]>;
|
|
18
|
+
readReserved(dir: string, name: ReservedFilename): Promise<ReservedReadResult | null>;
|
|
19
|
+
writeReserved(_dir: string, _name: ReservedFilename, _content: string, _options?: WriteOptions): Promise<Version>;
|
|
20
|
+
readBlob(key: BlobKey): Promise<ReadBlobResult | null>;
|
|
21
|
+
writeBlob(_key: BlobKey, _bytes: Uint8Array, _contentType?: string, _options?: WriteOptions): Promise<Version>;
|
|
22
|
+
existsBlob(key: BlobKey): Promise<boolean>;
|
|
23
|
+
listBlobs(prefix?: string): Promise<BlobKey[]>;
|
|
24
|
+
deleteBlob(_key: BlobKey, _options?: DeleteOptions): Promise<boolean>;
|
|
25
|
+
capabilities(): {
|
|
26
|
+
history: boolean;
|
|
27
|
+
enforced_cas: boolean;
|
|
28
|
+
blobs: boolean;
|
|
29
|
+
projections: boolean;
|
|
30
|
+
backlinks: boolean;
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=snapshot-backend.d.ts.map
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { JsonValue, ObjectRef, PublicationSnapshotV1 as GeneratedPublicationSnapshotV1 } from "./generated/publication-snapshot-v1.js";
|
|
2
|
+
type DeepReadonly<T> = T extends (...args: never[]) => unknown ? T : T extends readonly (infer Item)[] ? readonly DeepReadonly<Item>[] : T extends object ? {
|
|
3
|
+
readonly [Key in keyof T]: DeepReadonly<T[Key]>;
|
|
4
|
+
} : T;
|
|
5
|
+
export declare const PUBLICATION_SNAPSHOT_V1: "https://getsuperbee.com/schemas/publication-snapshot/v1";
|
|
6
|
+
export declare const PUBLICATION_BRIDGE_V0: "v0";
|
|
7
|
+
export type PublicationJsonValue = DeepReadonly<JsonValue>;
|
|
8
|
+
export type PublicationObjectRefV1 = DeepReadonly<ObjectRef>;
|
|
9
|
+
export type PublicationSnapshotV1 = DeepReadonly<GeneratedPublicationSnapshotV1>;
|
|
10
|
+
export interface CapturePublicationSnapshotOptionsV1 {
|
|
11
|
+
schema: typeof PUBLICATION_SNAPSHOT_V1;
|
|
12
|
+
source: {
|
|
13
|
+
kind: "filesystem";
|
|
14
|
+
root: string;
|
|
15
|
+
};
|
|
16
|
+
maxAttempts?: 1 | 2 | 3;
|
|
17
|
+
limits?: {
|
|
18
|
+
maxObjects?: number;
|
|
19
|
+
maxObjectBytes?: number;
|
|
20
|
+
maxTotalBytes?: number;
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
export interface PublicationSnapshotHandleV1 {
|
|
24
|
+
readonly manifest: PublicationSnapshotV1;
|
|
25
|
+
readObject(ref: PublicationObjectRefV1): Promise<Uint8Array>;
|
|
26
|
+
serializeManifest(): Uint8Array;
|
|
27
|
+
close(): Promise<void>;
|
|
28
|
+
}
|
|
29
|
+
export interface PublicationBridgeAdmissionV1 {
|
|
30
|
+
id: string;
|
|
31
|
+
entry: string;
|
|
32
|
+
access: "none" | "bundle-read";
|
|
33
|
+
entryDigest: `sha256:${string}`;
|
|
34
|
+
}
|
|
35
|
+
export interface PublicationBridgeOutcomeV1 {
|
|
36
|
+
reply: Record<string, unknown> | null;
|
|
37
|
+
subscribed?: boolean;
|
|
38
|
+
openViewId?: string;
|
|
39
|
+
}
|
|
40
|
+
export interface PublicationBridgeV1 {
|
|
41
|
+
handle(rawRequest: unknown): Promise<PublicationBridgeOutcomeV1>;
|
|
42
|
+
}
|
|
43
|
+
export {};
|
|
44
|
+
//# sourceMappingURL=types.d.ts.map
|