@north-light/crouter-api 0.3.157 → 0.3.158

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
@@ -1,5 +1,5 @@
1
1
  import type { DaemonRestartDTO, HealthDTO, StatusDTO } from './dto/health.js';
2
- import type { ArtifactListDTO, ArtifactsQuery, ContextListDTO, CreateNodeRequest, ListNodesQuery, NodeDetailDTO, NodeSnapshotDTO, NodeSummaryDTO, TranscriptDTO, TranscriptQuery } from './dto/nodes.js';
2
+ import type { ArtifactListDTO, ArtifactsQuery, ContextListDTO, CreateNodeRequest, ListNodesQuery, NodeDetailDTO, NodeSessionDTO, NodeSnapshotDTO, NodeSummaryDTO, TranscriptDTO, TranscriptQuery } from './dto/nodes.js';
3
3
  import type { InterruptResultDTO, MessageResultDTO, SendMessageRequest } from './dto/messages.js';
4
4
  import type { PushReportRequest, PushReportResultDTO, ReportDTO, ReportsQuery } from './dto/reports.js';
5
5
  import type { CloseRequest, CloseResultDTO, PromoteRequest, RelaunchRootResultDTO, ReviveRequest, ReviveResultDTO, WaitRequest, YieldRequest } from './dto/lifecycle.js';
@@ -125,6 +125,9 @@ export declare class CrtrClient {
125
125
  getReports(id: string, q?: ReportsQuery): Promise<ReportDTO[]>;
126
126
  getTranscript(id: string, q?: TranscriptQuery): Promise<TranscriptDTO>;
127
127
  getSnapshot(id: string): Promise<NodeSnapshotDTO>;
128
+ /** The node's conversation exactly as it ran — raw `.jsonl` bytes plus the
129
+ * assembled system prompt. For exports; `getSnapshot` is for renderers. */
130
+ getSession(id: string): Promise<NodeSessionDTO>;
128
131
  getArtifacts(id: string, q?: ArtifactsQuery): Promise<ArtifactListDTO>;
129
132
  getContext(id: string): Promise<ContextListDTO>;
130
133
  /** Read an absolute host path as UTF-8 (capped, `truncated` when clipped) for
package/dist/client.js CHANGED
@@ -219,6 +219,11 @@ export class CrtrClient {
219
219
  getSnapshot(id) {
220
220
  return this.request('GET', routes.nodeSnapshot(this.nodePath(id)));
221
221
  }
222
+ /** The node's conversation exactly as it ran — raw `.jsonl` bytes plus the
223
+ * assembled system prompt. For exports; `getSnapshot` is for renderers. */
224
+ getSession(id) {
225
+ return this.request('GET', routes.nodeSession(this.nodePath(id)));
226
+ }
222
227
  getArtifacts(id, q) {
223
228
  return this.request('GET', withQuery(routes.nodeArtifacts(this.nodePath(id)), q));
224
229
  }
@@ -31,7 +31,7 @@ export interface BrokerWelcomeFrame<M = unknown> {
31
31
  }
32
32
  /**
33
33
  * The broker-control frames a relay consumer reads: `welcome` (catch-up snapshot)
34
- * and `error`. The broker interleaves others (display_*, control_changed, ack, …)
34
+ * and `error`. The broker interleaves others (display_*, ack, …)
35
35
  * under non-colliding `type` discriminants; a relay mapper drops those through its
36
36
  * `default` arm untyped, so they are not enumerated here.
37
37
  */
@@ -145,6 +145,21 @@ export interface NodeSnapshotDTO {
145
145
  }[];
146
146
  captured_at: IsoTime;
147
147
  }
148
+ /** `GET /v1/nodes/{id}/session` — the node's conversation exactly as it ran:
149
+ * the raw session `.jsonl` bytes plus the assembled system prompt. Unlike
150
+ * `NodeSnapshotDTO` nothing is reconstructed or flattened, so every
151
+ * session-tree entry, cycle, branch, and custom message role survives. This is
152
+ * what an export/download wants; `/snapshot` is what a renderer wants. */
153
+ export interface NodeSessionDTO {
154
+ node_id: NodeIdDTO;
155
+ /** Absolute path (inside the node's host) of the file the bytes came from. */
156
+ session_file: string;
157
+ /** Verbatim `.jsonl` contents. */
158
+ session_jsonl: string;
159
+ /** Assembled system prompt as last captured, or `null` if never written. */
160
+ system_prompt: string | null;
161
+ captured_at: IsoTime;
162
+ }
148
163
  /** `GET /v1/nodes/{id}/transcript` query. */
149
164
  export interface TranscriptQuery {
150
165
  limit?: number;
package/dist/routes.d.ts CHANGED
@@ -9,6 +9,7 @@ export declare const routes: {
9
9
  readonly reviveAll: () => string;
10
10
  readonly node: (id: string) => string;
11
11
  readonly nodeSnapshot: (id: string) => string;
12
+ readonly nodeSession: (id: string) => string;
12
13
  readonly nodeTranscript: (id: string) => string;
13
14
  readonly nodeContext: (id: string) => string;
14
15
  readonly nodeArtifacts: (id: string) => string;
package/dist/routes.js CHANGED
@@ -25,6 +25,7 @@ export const routes = {
25
25
  node: (id) => `${V}/nodes/${id}`,
26
26
  // Node reads
27
27
  nodeSnapshot: (id) => `${V}/nodes/${id}/snapshot`,
28
+ nodeSession: (id) => `${V}/nodes/${id}/session`,
28
29
  nodeTranscript: (id) => `${V}/nodes/${id}/transcript`,
29
30
  nodeContext: (id) => `${V}/nodes/${id}/context`,
30
31
  nodeArtifacts: (id) => `${V}/nodes/${id}/artifacts`,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@north-light/crouter-api",
3
- "version": "0.3.157",
3
+ "version": "0.3.158",
4
4
  "description": "Typed crtrd /v1 API contract — DTOs, route builders, the error contract, and the CrtrClient. Zero runtime dependencies.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",