@vibefield/rosetta-protocol 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/dist/client.d.ts +12 -0
- package/dist/client.js +17 -0
- package/dist/generated/ArtifactExportRequest.d.ts +20 -0
- package/dist/generated/ArtifactExportRequest.js +1 -0
- package/dist/generated/ArtifactExportResponse.d.ts +33 -0
- package/dist/generated/ArtifactExportResponse.js +1 -0
- package/dist/generated/ErrorCode.d.ts +1 -1
- package/dist/generated/ExportEnvironment.d.ts +22 -0
- package/dist/generated/ExportEnvironment.js +2 -0
- package/dist/generated/ExportMethod.d.ts +4 -0
- package/dist/generated/ExportMethod.js +2 -0
- package/dist/generated/ExportShell.d.ts +4 -0
- package/dist/generated/ExportShell.js +2 -0
- package/dist/generated/ExportedObject.d.ts +16 -0
- package/dist/generated/ExportedObject.js +2 -0
- package/dist/generated/ExportedShell.d.ts +17 -0
- package/dist/generated/ExportedShell.js +2 -0
- package/dist/generated/HtmlArtifactPublication.d.ts +13 -0
- package/dist/generated/Mutation.d.ts +4 -1
- package/dist/generated/ServerFrame.d.ts +8 -0
- package/dist/generated/StatusResponse.d.ts +8 -0
- package/dist/index.d.ts +7 -0
- package/dist/protocol-version.mjs +1 -1
- package/package.json +1 -1
package/dist/client.d.ts
CHANGED
|
@@ -6,6 +6,8 @@ import type { IngestionControlRequest } from "./generated/IngestionControlReques
|
|
|
6
6
|
import type { ApiError } from "./generated/ApiError.js";
|
|
7
7
|
import type { ImageVariant } from "./generated/ImageVariant.js";
|
|
8
8
|
import type { AssetRef } from "./generated/AssetRef.js";
|
|
9
|
+
import type { ArtifactExportRequest } from "./generated/ArtifactExportRequest.js";
|
|
10
|
+
import type { ArtifactExportResponse } from "./generated/ArtifactExportResponse.js";
|
|
9
11
|
import type { ArtifactListRequest } from "./generated/ArtifactListRequest.js";
|
|
10
12
|
import type { ArtifactPage } from "./generated/ArtifactPage.js";
|
|
11
13
|
import type { BoostResponse } from "./generated/BoostResponse.js";
|
|
@@ -210,6 +212,16 @@ export declare class RosettaClient {
|
|
|
210
212
|
artifacts(request: ArtifactListRequest, signal?: AbortSignal): Promise<ArtifactPage>;
|
|
211
213
|
/** Exact captured bytes, authorized through the publication's session. */
|
|
212
214
|
readArtifact(sessionId: string, publicationId: string, signal?: AbortSignal): Promise<Uint8Array>;
|
|
215
|
+
/**
|
|
216
|
+
* Place one captured page by its digest as `index.html` in the directory
|
|
217
|
+
* `request.into`, below the daemon's `--export-root` (RO-32): a hard link
|
|
218
|
+
* from rosetta's asset store when both share a volume, else a verified
|
|
219
|
+
* copy. `shell: "room"` writes the room's shell around the page instead.
|
|
220
|
+
* Bearer only. The same page already there answers the same; a different
|
|
221
|
+
* file there is `export_conflict`. Every answer carries the room's
|
|
222
|
+
* `environment` (hosts per CSP directive, theme variables).
|
|
223
|
+
*/
|
|
224
|
+
exportArtifact(sessionId: string, publicationId: string, request: ArtifactExportRequest, signal?: AbortSignal): Promise<ArtifactExportResponse>;
|
|
213
225
|
search(request: SearchRequest, signal?: AbortSignal): Promise<SearchResponse>;
|
|
214
226
|
heatmap(projectId: string, options?: {
|
|
215
227
|
sinceMs?: number;
|
package/dist/client.js
CHANGED
|
@@ -358,6 +358,23 @@ export class RosettaClient {
|
|
|
358
358
|
const response = await this.response(`/api/sessions/${encodeURIComponent(sessionId)}/artifacts/${encodeURIComponent(publicationId)}/content`, withSignal(signal));
|
|
359
359
|
return new Uint8Array(await response.arrayBuffer());
|
|
360
360
|
}
|
|
361
|
+
/**
|
|
362
|
+
* Place one captured page by its digest as `index.html` in the directory
|
|
363
|
+
* `request.into`, below the daemon's `--export-root` (RO-32): a hard link
|
|
364
|
+
* from rosetta's asset store when both share a volume, else a verified
|
|
365
|
+
* copy. `shell: "room"` writes the room's shell around the page instead.
|
|
366
|
+
* Bearer only. The same page already there answers the same; a different
|
|
367
|
+
* file there is `export_conflict`. Every answer carries the room's
|
|
368
|
+
* `environment` (hosts per CSP directive, theme variables).
|
|
369
|
+
*/
|
|
370
|
+
exportArtifact(sessionId, publicationId, request, signal) {
|
|
371
|
+
return this.request(`/api/sessions/${encodeURIComponent(sessionId)}/artifacts/${encodeURIComponent(publicationId)}/export`, {
|
|
372
|
+
method: "POST",
|
|
373
|
+
...withSignal(signal),
|
|
374
|
+
headers: { "content-type": "application/json" },
|
|
375
|
+
body: JSON.stringify(request),
|
|
376
|
+
});
|
|
377
|
+
}
|
|
361
378
|
// @atlas step search-query.client
|
|
362
379
|
search(request, signal) {
|
|
363
380
|
return this.request(`/api/search${queryString({
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { ExportShell } from "./ExportShell.js";
|
|
2
|
+
/**
|
|
3
|
+
* `POST /api/sessions/{id}/artifacts/{publication_id}/export` (RO-32,
|
|
4
|
+
* protocol 30, by digest since 2026-11-06): place one captured page, its own
|
|
5
|
+
* bytes, as `index.html` in a directory a host serves from an origin of its
|
|
6
|
+
* own. Bearer only; a session grant never reaches it.
|
|
7
|
+
*/
|
|
8
|
+
export type ArtifactExportRequest = {
|
|
9
|
+
/**
|
|
10
|
+
* The directory, absolute, strictly below the daemon's `--export-root`.
|
|
11
|
+
* No component below the root may be a symbolic link. It is created
|
|
12
|
+
* (0700) when absent, and the page lands at `<into>/index.html`.
|
|
13
|
+
*/
|
|
14
|
+
into: string;
|
|
15
|
+
/**
|
|
16
|
+
* Absent: the page's own bytes, linked or copied. `room`: the room's
|
|
17
|
+
* shell written around the page instead.
|
|
18
|
+
*/
|
|
19
|
+
shell?: ExportShell;
|
|
20
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { ExportEnvironment } from "./ExportEnvironment.js";
|
|
2
|
+
import type { ExportMethod } from "./ExportMethod.js";
|
|
3
|
+
import type { ExportedObject } from "./ExportedObject.js";
|
|
4
|
+
import type { ExportedShell } from "./ExportedShell.js";
|
|
5
|
+
/**
|
|
6
|
+
* The export door's answer. The same page already at the same path answers
|
|
7
|
+
* the same and writes nothing.
|
|
8
|
+
*/
|
|
9
|
+
export type ArtifactExportResponse = {
|
|
10
|
+
/**
|
|
11
|
+
* The file at `<into>/<page.path>`.
|
|
12
|
+
*/
|
|
13
|
+
page: ExportedObject;
|
|
14
|
+
/**
|
|
15
|
+
* The publication's other files, each beside the page. Empty until
|
|
16
|
+
* rosetta keeps a multi-file publish's members (RO-34b).
|
|
17
|
+
*/
|
|
18
|
+
members: Array<ExportedObject>;
|
|
19
|
+
/**
|
|
20
|
+
* When rosetta observed the captured file (Unix ms); null for a page
|
|
21
|
+
* recorded inline in its publication.
|
|
22
|
+
*/
|
|
23
|
+
captured_at: number | null;
|
|
24
|
+
method: ExportMethod;
|
|
25
|
+
/**
|
|
26
|
+
* The room's environment for a captured page, whatever `shell` asked.
|
|
27
|
+
*/
|
|
28
|
+
environment: ExportEnvironment;
|
|
29
|
+
/**
|
|
30
|
+
* The shell written around the page; absent for the page's own bytes.
|
|
31
|
+
*/
|
|
32
|
+
shell?: ExportedShell;
|
|
33
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export type ErrorCode = "incompatible_protocol" | "not_found" | "bad_request" | "not_ready" | "cursor_expired" | "index_changed" | "revision_conflict" | "idempotency_conflict" | "invalid_transition" | "publication_in_progress" | "control_capacity" | "shutting_down" | "internal";
|
|
1
|
+
export type ErrorCode = "incompatible_protocol" | "not_found" | "bad_request" | "not_ready" | "cursor_expired" | "index_changed" | "revision_conflict" | "idempotency_conflict" | "invalid_transition" | "publication_in_progress" | "control_capacity" | "shutting_down" | "export_conflict" | "internal";
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The room's environment for a captured page, as data: the public hosts it
|
|
3
|
+
* admits beside the page's own origin and the theme variables a page's
|
|
4
|
+
* author wrote against (`rosetta_core::html_artifacts::SHELL_HOSTS` and
|
|
5
|
+
* `SHELL_VARIABLES`). A serving host builds its own policy and theme from
|
|
6
|
+
* them without holding a platform's list or wrapping the page.
|
|
7
|
+
*/
|
|
8
|
+
export type ExportEnvironment = {
|
|
9
|
+
/**
|
|
10
|
+
* Per Content-Security-Policy directive (`script-src`, `style-src`,
|
|
11
|
+
* `font-src`), the `https` hosts the room admits.
|
|
12
|
+
*/
|
|
13
|
+
hosts: {
|
|
14
|
+
[key in string]: Array<string>;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Per CSS custom property (`--color-text-primary`, …), its light value.
|
|
18
|
+
*/
|
|
19
|
+
variables: {
|
|
20
|
+
[key in string]: string;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One file an export placed, named by its path inside `into`.
|
|
3
|
+
*/
|
|
4
|
+
export type ExportedObject = {
|
|
5
|
+
/**
|
|
6
|
+
* Relative to `into`: `index.html` for the page.
|
|
7
|
+
*/
|
|
8
|
+
path: string;
|
|
9
|
+
/**
|
|
10
|
+
* The BLAKE3 digest of the file's bytes, lowercase hex. A page placed
|
|
11
|
+
* as itself carries the capture's own digest, the library's
|
|
12
|
+
* `asset.digest`.
|
|
13
|
+
*/
|
|
14
|
+
blake3: string;
|
|
15
|
+
bytes: number;
|
|
16
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The shell an export wrote around its page (`shell: "room"`).
|
|
3
|
+
*/
|
|
4
|
+
export type ExportedShell = {
|
|
5
|
+
/**
|
|
6
|
+
* `rosetta_core::html_artifacts::SHELL_VERSION`.
|
|
7
|
+
*/
|
|
8
|
+
version: string;
|
|
9
|
+
/**
|
|
10
|
+
* The capture the shell wraps: the library's `asset.digest`.
|
|
11
|
+
*/
|
|
12
|
+
source_blake3: string;
|
|
13
|
+
/**
|
|
14
|
+
* The public hosts the shell's own policy admits, each once.
|
|
15
|
+
*/
|
|
16
|
+
hosts: Array<string>;
|
|
17
|
+
};
|
|
@@ -20,4 +20,17 @@ export type HtmlArtifactPublication = {
|
|
|
20
20
|
* Raw-record coordinate for the separately ledgered file observation.
|
|
21
21
|
*/
|
|
22
22
|
source_offset: number;
|
|
23
|
+
/**
|
|
24
|
+
* The publish request's own description, as the agent wrote it, bounded
|
|
25
|
+
* by [`HTML_DESCRIPTION_MAX_BYTES`] (RO-33, schema 30). Null when the
|
|
26
|
+
* request carried none, or when the source records no request at all.
|
|
27
|
+
*/
|
|
28
|
+
description: string | null;
|
|
29
|
+
/**
|
|
30
|
+
* How many members of the publish request's `files` map the library did
|
|
31
|
+
* not keep beside this page (RO-34a, schema 30). Zero when the request
|
|
32
|
+
* named none; null when the source records no request (a delivery link,
|
|
33
|
+
* another agent's presentation), which means unknown.
|
|
34
|
+
*/
|
|
35
|
+
dropped_files: number | null;
|
|
23
36
|
};
|
|
@@ -44,6 +44,14 @@ export type ServerFrame = {
|
|
|
44
44
|
runtimes: Array<RuntimeRow>;
|
|
45
45
|
projects: Array<ProjectRow>;
|
|
46
46
|
sessions: Array<SessionRow>;
|
|
47
|
+
/**
|
|
48
|
+
* The artifact library revision the mirror last read (RO-35), so a
|
|
49
|
+
* subscriber that connects late or is resynced (an overflowed queue
|
|
50
|
+
* drops its events, `artifacts_changed` among them) learns where the
|
|
51
|
+
* library stands. Null before the mirror's first read; daemons
|
|
52
|
+
* before protocol 30 omit it.
|
|
53
|
+
*/
|
|
54
|
+
artifacts_revision?: number | null;
|
|
47
55
|
} | {
|
|
48
56
|
"frame": "mutation";
|
|
49
57
|
stamp: Stamp | null;
|
|
@@ -14,4 +14,12 @@ export type StatusResponse = {
|
|
|
14
14
|
* ingest loop (tests, static serving).
|
|
15
15
|
*/
|
|
16
16
|
daemon: DaemonStatus | null;
|
|
17
|
+
/**
|
|
18
|
+
* The artifact library's revision (RO-35): the value `GET /api/artifacts`
|
|
19
|
+
* cursors bind and `/ws/meta`'s `artifacts_changed` announces, so a
|
|
20
|
+
* client that connects later knows where the library stands. Null while
|
|
21
|
+
* the projection is unpublished or unreadable; daemons before protocol
|
|
22
|
+
* 30 omit it.
|
|
23
|
+
*/
|
|
24
|
+
artifacts_revision?: number | null;
|
|
17
25
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -7,6 +7,13 @@ export type * from "./generated/IngestionConflict.js";
|
|
|
7
7
|
export type * from "./generated/ApiError.js";
|
|
8
8
|
export type * from "./generated/AssetRef.js";
|
|
9
9
|
export type * from "./generated/ArtifactEntry.js";
|
|
10
|
+
export type * from "./generated/ArtifactExportRequest.js";
|
|
11
|
+
export type * from "./generated/ArtifactExportResponse.js";
|
|
12
|
+
export type * from "./generated/ExportEnvironment.js";
|
|
13
|
+
export type * from "./generated/ExportMethod.js";
|
|
14
|
+
export type * from "./generated/ExportShell.js";
|
|
15
|
+
export type * from "./generated/ExportedObject.js";
|
|
16
|
+
export type * from "./generated/ExportedShell.js";
|
|
10
17
|
export type * from "./generated/ArtifactListRequest.js";
|
|
11
18
|
export type * from "./generated/ArtifactPage.js";
|
|
12
19
|
export type * from "./generated/HtmlArtifactPublication.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Shared wire version; checked against Rust in the wire tests.
|
|
2
|
-
export const PROTOCOL_VERSION =
|
|
2
|
+
export const PROTOCOL_VERSION = 30;
|