@vibefield/rosetta-protocol 0.1.2 → 0.1.3

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 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 { ArtifactListRequest } from "./generated/ArtifactListRequest.js";
10
+ import type { ArtifactPage } from "./generated/ArtifactPage.js";
9
11
  import type { BoostResponse } from "./generated/BoostResponse.js";
10
12
  import type { ContributionResponse } from "./generated/ContributionResponse.js";
11
13
  import type { CommandResponse } from "./generated/CommandResponse.js";
@@ -190,7 +192,11 @@ export declare class RosettaClient {
190
192
  * supplies identities and an index, never a path; the daemon resolves the
191
193
  * exact path already stored on that timeline row. */
192
194
  /** Direct image URLs let the browser share compressed and decoded resources.
193
- * Recipes are finite, versioned and enforced by the daemon. */
195
+ * Recipes are finite, versioned and enforced by the daemon. Every address is
196
+ * a WebP the daemon encoded: a legacy bundle names its own members, and a
197
+ * recorded original (any image member without a WebP bundle) is drawn only
198
+ * through `?image=<variant>&v=1`, `full` included. Its plain URL returns the
199
+ * recorded bytes for opening or saving, never for display. */
194
200
  imageAssetUrl(asset: AssetRef, variant: ImageVariant): string;
195
201
  imageFileTargetUrl(sessionId: string, timelineId: string, targetIndex: number, variant: ImageVariant): string;
196
202
  readFileTarget(sessionId: string, timelineId: string, targetIndex: number, signal?: AbortSignal): Promise<Uint8Array>;
@@ -201,6 +207,9 @@ export declare class RosettaClient {
201
207
  readAsset(asset: AssetRef, signal?: AbortSignal): Promise<Uint8Array>;
202
208
  /** Read one exact plan document selected from timeline_meta. */
203
209
  readPlan(sessionId: string, source: TimelineMetaPlanSource, signal?: AbortSignal): Promise<Uint8Array>;
210
+ artifacts(request: ArtifactListRequest, signal?: AbortSignal): Promise<ArtifactPage>;
211
+ /** Exact captured bytes, authorized through the publication's session. */
212
+ readArtifact(sessionId: string, publicationId: string, signal?: AbortSignal): Promise<Uint8Array>;
204
213
  search(request: SearchRequest, signal?: AbortSignal): Promise<SearchResponse>;
205
214
  heatmap(projectId: string, options?: {
206
215
  sinceMs?: number;
package/dist/client.js CHANGED
@@ -291,16 +291,23 @@ export class RosettaClient {
291
291
  * supplies identities and an index, never a path; the daemon resolves the
292
292
  * exact path already stored on that timeline row. */
293
293
  /** Direct image URLs let the browser share compressed and decoded resources.
294
- * Recipes are finite, versioned and enforced by the daemon. */
294
+ * Recipes are finite, versioned and enforced by the daemon. Every address is
295
+ * a WebP the daemon encoded: a legacy bundle names its own members, and a
296
+ * recorded original (any image member without a WebP bundle) is drawn only
297
+ * through `?image=<variant>&v=1`, `full` included. Its plain URL returns the
298
+ * recorded bytes for opening or saving, never for display. */
295
299
  imageAssetUrl(asset, variant) {
296
300
  const base = new URL(`${this.baseUrl}/`);
297
- const rendition = variant === "full" ? asset : asset.image_variants?.[variant];
301
+ const variants = asset.image_variants;
302
+ const bundled = asset.media_type === "image/webp" && variants != null && Object.keys(variants).length > 0;
303
+ const member = !bundled ? undefined : variant === "full" ? asset : variants?.[variant];
304
+ const rendition = member?.media_type === "image/webp" ? member : undefined;
298
305
  const url = new URL((rendition ?? asset).url, base);
299
306
  if (url.origin !== base.origin || !["http:", "https:"].includes(url.protocol)) {
300
307
  throw new Error("the stored image has an unsupported address");
301
308
  }
302
- // Older projection fixtures have no rendition set. The versioned daemon
303
- // route can prepare a legacy member without modifying its immutable URL.
309
+ // A recorded original, or a bundle missing this rendition: the versioned
310
+ // daemon route encodes it from the member without changing its URL.
304
311
  if (!rendition) {
305
312
  url.searchParams.set("image", variant);
306
313
  url.searchParams.set("v", "1");
@@ -343,6 +350,14 @@ export class RosettaClient {
343
350
  const response = await this.response(path, withSignal(signal));
344
351
  return new Uint8Array(await response.arrayBuffer());
345
352
  }
353
+ artifacts(request, signal) {
354
+ return this.request(`/api/artifacts${queryString({ ...request })}`, withSignal(signal));
355
+ }
356
+ /** Exact captured bytes, authorized through the publication's session. */
357
+ async readArtifact(sessionId, publicationId, signal) {
358
+ const response = await this.response(`/api/sessions/${encodeURIComponent(sessionId)}/artifacts/${encodeURIComponent(publicationId)}/content`, withSignal(signal));
359
+ return new Uint8Array(await response.arrayBuffer());
360
+ }
346
361
  // @atlas step search-query.client
347
362
  search(request, signal) {
348
363
  return this.request(`/api/search${queryString({
@@ -0,0 +1,6 @@
1
+ /**
2
+ * What a runtime's still-`Pending` sessions wait for on this process's cold
3
+ * attempt — the only promise a client may make about when one opens. It
4
+ * names no order, position or time.
5
+ */
6
+ export type AdmissionCourse = "per_tree" | "at_runtime_close" | "at_publication";
@@ -0,0 +1,2 @@
1
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
2
+ export {};
@@ -0,0 +1,15 @@
1
+ import type { AssetRef } from "./AssetRef.js";
2
+ import type { HtmlArtifactAvailability } from "./HtmlArtifactAvailability.js";
3
+ import type { HtmlArtifactPublication } from "./HtmlArtifactPublication.js";
4
+ export type ArtifactEntry = {
5
+ publication: HtmlArtifactPublication;
6
+ availability: HtmlArtifactAvailability;
7
+ captured_at: number | null;
8
+ recovered_from: string | null;
9
+ asset: AssetRef | null;
10
+ agent: string;
11
+ session_title: string | null;
12
+ project_id: string | null;
13
+ project_name: string | null;
14
+ presentations: number;
15
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,11 @@
1
+ export type ArtifactListRequest = {
2
+ q: string | null;
3
+ agent: string | null;
4
+ project: string | null;
5
+ /**
6
+ * Omitted: latest presentation of each artifact. Set: its full history.
7
+ */
8
+ artifact_id: string | null;
9
+ cursor: string | null;
10
+ limit: number | null;
11
+ };
@@ -0,0 +1,2 @@
1
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
2
+ export {};
@@ -0,0 +1,9 @@
1
+ import type { ArtifactEntry } from "./ArtifactEntry.js";
2
+ export type ArtifactPage = {
3
+ entries: Array<ArtifactEntry>;
4
+ next_cursor: string | null;
5
+ /**
6
+ * False while the library may still grow during initial ingestion.
7
+ */
8
+ canonical_ready: boolean;
9
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export type HtmlArtifactAvailability = "captured" | "not_captured" | "missing" | "too_large" | "unsupported" | "changed_during_read";
@@ -0,0 +1,2 @@
1
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
2
+ export {};
@@ -0,0 +1,23 @@
1
+ export type HtmlArtifactPublication = {
2
+ /**
3
+ * One presentation/publication, stable across normalization and replay.
4
+ */
5
+ id: string;
6
+ /**
7
+ * Native artifact identity within a runtime, otherwise session + locator.
8
+ */
9
+ artifact_id: string;
10
+ session_id: string;
11
+ timeline_id: string;
12
+ title: string;
13
+ filename: string;
14
+ path: string | null;
15
+ url: string | null;
16
+ native_id: string | null;
17
+ version: string | null;
18
+ published_at: number | null;
19
+ /**
20
+ * Raw-record coordinate for the separately ledgered file observation.
21
+ */
22
+ source_offset: number;
23
+ };
@@ -0,0 +1,2 @@
1
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
2
+ export {};
@@ -1,3 +1,4 @@
1
+ import type { AdmissionCourse } from "./AdmissionCourse.js";
1
2
  import type { BackfillState } from "./BackfillState.js";
2
3
  /**
3
4
  * Cold-start progress for one runtime. Denominators come from discovery's
@@ -47,4 +48,11 @@ export type RuntimeBackfill = {
47
48
  * Transcript records parsed so far.
48
49
  */
49
50
  records: number;
51
+ /**
52
+ * When this runtime's `Pending` sessions open on the current cold
53
+ * attempt (2026-11-03), kept after it goes live. Null from a daemon that
54
+ * predates it and for serve paths without a cold attempt (warm start,
55
+ * disk-progressive): a client then falls back to what it can infer.
56
+ */
57
+ admission_course?: AdmissionCourse | null;
50
58
  };
@@ -1,5 +1,13 @@
1
1
  import type { AssetRef } from "./AssetRef.js";
2
+ import type { HtmlArtifactAvailability } from "./HtmlArtifactAvailability.js";
2
3
  export type TimelineMetaArtifactSource = {
4
+ "type": "html_publication";
5
+ publication_id: string;
6
+ timeline_id: string;
7
+ filename: string;
8
+ availability: HtmlArtifactAvailability;
9
+ url: string | null;
10
+ } | {
3
11
  "type": "timeline_file";
4
12
  timeline_id: string;
5
13
  target_index: number;
package/dist/index.d.ts CHANGED
@@ -6,12 +6,18 @@ export type * from "./generated/IngestionControlRequest.js";
6
6
  export type * from "./generated/IngestionConflict.js";
7
7
  export type * from "./generated/ApiError.js";
8
8
  export type * from "./generated/AssetRef.js";
9
+ export type * from "./generated/ArtifactEntry.js";
10
+ export type * from "./generated/ArtifactListRequest.js";
11
+ export type * from "./generated/ArtifactPage.js";
12
+ export type * from "./generated/HtmlArtifactPublication.js";
13
+ export type * from "./generated/HtmlArtifactAvailability.js";
9
14
  export type * from "./generated/CanonicalText.js";
10
15
  export type * from "./generated/CommandResponse.js";
11
16
  export type * from "./generated/AttachmentKind.js";
12
17
  export type * from "./generated/AttachmentRef.js";
13
18
  export type * from "./generated/AttachmentSource.js";
14
19
  export type * from "./generated/AttachmentUnavailableReason.js";
20
+ export type * from "./generated/AdmissionCourse.js";
15
21
  export type * from "./generated/BackfillState.js";
16
22
  export type * from "./generated/BoostRequest.js";
17
23
  export type * from "./generated/BoostResponse.js";
@@ -1,2 +1,2 @@
1
1
  // Shared wire version; checked against Rust in the wire tests.
2
- export const PROTOCOL_VERSION = 27;
2
+ export const PROTOCOL_VERSION = 29;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vibefield/rosetta-protocol",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",