@north-light/crouter-api 0.3.216 → 0.3.218

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.
@@ -78,6 +78,8 @@ export declare class CrtrClient {
78
78
  * settled result. */
79
79
  restartDaemon(): Promise<DaemonRestartDTO>;
80
80
  createNode(req: CreateNodeRequest): Promise<NodeDetailDTO>;
81
+ /** List canvas nodes with composable row filters. `include: 'activity'` adds
82
+ * latest/canonical reports and pending-human counts in the same response. */
81
83
  listNodes(q?: ListNodesQuery): Promise<NodeSummaryDTO[]>;
82
84
  getNode(id: string): Promise<NodeDetailDTO>;
83
85
  listBashJobs(id: string): Promise<BashJobStatusDTO[]>;
@@ -197,8 +199,9 @@ export declare class CrtrClient {
197
199
  listHumanInbox(): Promise<InboxListDTO>;
198
200
  /** Read one page ticket by its opaque ticket id (pending, resolved, or canceled). */
199
201
  getHumanInboxPage(ticketId: InboxTicketIdDTO): Promise<InboxPageDTO>;
200
- /** All page tickets raised by one node, oldest first (pending, resolved, or canceled). */
201
- getInboxHistory(nodeId: string): Promise<InboxPageHistoryDTO>;
202
+ /** All page tickets, oldest first (pending, resolved, or canceled)
203
+ * home-wide, or narrowed to one raising node when `nodeId` is given. */
204
+ getInboxHistory(nodeId?: string): Promise<InboxPageHistoryDTO>;
202
205
  /** Submit responses for a page ticket. Single-assignment server-side: a competing
203
206
  * resolution races to `ticket_already_resolved`. */
204
207
  respondHumanInboxPage(ticketId: InboxTicketIdDTO, request: RespondInboxPageRequest): Promise<PageTicketResultDTO>;
@@ -92,6 +92,8 @@ export class CrtrClient {
92
92
  createNode(req) {
93
93
  return this.request('POST', routes.nodes(), req);
94
94
  }
95
+ /** List canvas nodes with composable row filters. `include: 'activity'` adds
96
+ * latest/canonical reports and pending-human counts in the same response. */
95
97
  listNodes(q) {
96
98
  return this.request('GET', withQuery(routes.nodes(), q));
97
99
  }
@@ -386,8 +388,12 @@ export class CrtrClient {
386
388
  getHumanInboxPage(ticketId) {
387
389
  return this.request('GET', routes.humanInboxTicket(this.ticketId(ticketId)));
388
390
  }
389
- /** All page tickets raised by one node, oldest first (pending, resolved, or canceled). */
391
+ /** All page tickets, oldest first (pending, resolved, or canceled)
392
+ * home-wide, or narrowed to one raising node when `nodeId` is given. */
390
393
  getInboxHistory(nodeId) {
394
+ if (nodeId === undefined) {
395
+ return this.request('GET', routes.humanInbox() + '/history');
396
+ }
391
397
  if (typeof nodeId !== 'string' || nodeId === '') {
392
398
  throw new TypeError(`invalid node id: ${JSON.stringify(nodeId)}`);
393
399
  }
@@ -147,6 +147,10 @@ export interface SnapshotNodeDTO {
147
147
  lifecycle?: string;
148
148
  status: NodeStatusDTO;
149
149
  cwd: string;
150
+ /** The profile this node runs under; null for a historical no-profile row.
151
+ * Carried here because it is the only field that says WHOSE work a node is —
152
+ * a snapshot consumer grouping nodes by agent has nothing else to key on. */
153
+ profile_id: string | null;
150
154
  parent: NodeIdDTO | null;
151
155
  created: IsoTime;
152
156
  host_kind: string;
@@ -161,6 +165,11 @@ export interface SnapshotNodeDTO {
161
165
  * as a loose object to keep this DTO free of a `core` type import. */
162
166
  hanging: Record<string, unknown> | null;
163
167
  viewed: boolean;
168
+ /** Basename of the node's final report, or null when it never pushed one.
169
+ * Presence — not `status === 'done'` — is what distinguishes finished work
170
+ * from clean parking. */
171
+ final_report: string | null;
172
+ finalized_at: IsoTime | null;
164
173
  }
165
174
  /** `GET /v1/canvas/snapshot` result — the machine-readable browser canvas
166
175
  * roster (`crtr canvas snapshot`). Distinct from the per-node `NodeSnapshotDTO`
@@ -1,4 +1,5 @@
1
1
  import type { Cursor, ExitIntentDTO, IsoTime, LifecycleDTO, ModeDTO, NodeIdDTO, NodeStatusDTO } from './common.js';
2
+ import type { ReportDTO } from './reports.js';
2
3
  /** `GET /v1/nodes/{id}/subject` — the node-config subject substrate gate
3
4
  * predicates evaluate against. Mirrors `NodeConfigSubject`; this narrow
4
5
  * endpoint exists so a CLI process (the `memory read` leaf) can gate-check
@@ -79,8 +80,19 @@ export interface NodeSummaryDTO {
79
80
  window: string | null;
80
81
  tmux_session: string | null;
81
82
  pane: string | null;
83
+ /** Basename of the canonical final report, or null when this node has not finalized. */
82
84
  final_report: string | null;
83
85
  finalized_at: IsoTime | null;
86
+ /** Present only when requested with `include=activity`. */
87
+ activity?: NodeActivityDTO;
88
+ }
89
+ /** Optional per-node activity payload for a list response. Reports are the
90
+ * stored push entries, newest first; `final_report` follows the row's canonical
91
+ * final-report basename rather than merely selecting the newest final-tier file. */
92
+ export interface NodeActivityDTO {
93
+ latest_report: ReportDTO | null;
94
+ final_report: ReportDTO | null;
95
+ pending_human_count: number;
84
96
  }
85
97
  /** The spine + subscription edges of a node (absorbs `managers`/`paths` reads). */
86
98
  export interface NodeEdgesDTO {
@@ -166,15 +178,29 @@ export interface NodeDetailDTO extends NodeSummaryDTO {
166
178
  roadmap_path?: string;
167
179
  goal_path?: string;
168
180
  }
169
- /** `GET /v1/nodes` query filters. */
181
+ /** `GET /v1/nodes` optional payloads. */
182
+ export type NodeListInclude = 'activity';
183
+ /** `GET /v1/nodes` query filters. Filters compose; `parent` selects direct
184
+ * children while `under` selects a whole subtree. */
170
185
  export interface ListNodesQuery {
171
186
  status?: NodeStatusDTO;
187
+ lifecycle?: LifecycleDTO;
172
188
  kind?: string;
173
189
  mode?: ModeDTO;
190
+ /** Exact profile id. */
191
+ profile_id?: string;
192
+ /** Profile-id prefix, for callers that own a namespaced profile family. */
193
+ profile_prefix?: string;
194
+ /** Restrict to direct children of this node. Mutually exclusive with `top_level`. */
195
+ parent?: NodeIdDTO;
196
+ /** Restrict to nodes without a parent. */
197
+ top_level?: boolean;
174
198
  /** Restrict to the subtree under this node. */
175
199
  under?: NodeIdDTO;
176
200
  /** Only nodes with a dangling/hanging manager edge. */
177
201
  hanging?: boolean;
202
+ /** Opt into richer per-node payloads that require filesystem reads. */
203
+ include?: NodeListInclude;
178
204
  }
179
205
  /** `GET /v1/nodes/{id}/snapshot` — the node's reconstructed broker snapshot
180
206
  * (`readNodeSnapshot`): the message log, aggregate stats, and current engine
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@north-light/crouter-api",
3
- "version": "0.3.216",
3
+ "version": "0.3.218",
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/api/index.js",