@north-light/crouter-api 0.3.231 → 0.3.232
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/api/client.d.ts +3 -1
- package/dist/api/client.js +4 -0
- package/dist/api/dto/canvas.d.ts +10 -0
- package/dist/api/dto/common.d.ts +1 -1
- package/dist/api/dto/health.d.ts +2 -1
- package/dist/api/dto/lifecycle.d.ts +3 -4
- package/dist/api/dto/messages.d.ts +5 -4
- package/dist/api/dto/nodes.d.ts +2 -0
- package/dist/api/dto/profiles.d.ts +5 -0
- package/dist/api/routes.d.ts +1 -0
- package/dist/api/routes.js +1 -0
- package/dist/shared/generated-context.d.ts +7 -0
- package/dist/shared/generated-context.js +11 -0
- package/package.json +1 -1
package/dist/api/client.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ import type { FocusDTO, RegisterFocusRequest, SetFocusPaneRequest } from './dto/
|
|
|
9
9
|
import { type ArmCronRequest, type CancelCronQuery, type CronDTO, type CronRunDTO, type CronScopeQuery, type CronShowDTO, type ListCronsQuery, type PokeCronsResult } from './dto/crons.js';
|
|
10
10
|
import type { NodeConfigPatch } from './dto/config.js';
|
|
11
11
|
import type { AttachEnsureRequest, AttachEnsureResultDTO } from './dto/attach.js';
|
|
12
|
-
import type { DeleteProfileRequest, DeleteProfileResultDTO, EnsureProfileRequest, ProfileDTO } from './dto/profiles.js';
|
|
12
|
+
import type { DeleteProfileRequest, DeleteProfileResultDTO, EnsureProfileRequest, ProfileDTO, UpdateProfileMetadataRequest } from './dto/profiles.js';
|
|
13
13
|
import type { FilePeekDTO } from './dto/files.js';
|
|
14
14
|
import type { MemoryDocRefDTO } from './dto/memory.js';
|
|
15
15
|
import type { ChatInventoryDTO, ProspectiveChatInventoryDTO, ProspectiveChatInventoryQuery } from './dto/chat-inventory.js';
|
|
@@ -174,6 +174,8 @@ export declare class CrtrClient {
|
|
|
174
174
|
ensureProfile(name: string, req?: EnsureProfileRequest): Promise<ProfileDTO>;
|
|
175
175
|
listProfiles(): Promise<ProfileDTO[]>;
|
|
176
176
|
getProfile(name: string): Promise<ProfileDTO>;
|
|
177
|
+
/** Merge and remove entries in a profile's metadata map. */
|
|
178
|
+
updateProfileMetadata(name: string, req: UpdateProfileMetadataRequest): Promise<ProfileDTO>;
|
|
177
179
|
/** Force-delete or detach one profile by exact id or unique name. */
|
|
178
180
|
deleteProfile(name: string, req: DeleteProfileRequest): Promise<DeleteProfileResultDTO>;
|
|
179
181
|
listModelAuth(): Promise<ModelAuthListDTO>;
|
package/dist/api/client.js
CHANGED
|
@@ -309,6 +309,10 @@ export class CrtrClient {
|
|
|
309
309
|
getProfile(name) {
|
|
310
310
|
return this.request('GET', routes.profile(name));
|
|
311
311
|
}
|
|
312
|
+
/** Merge and remove entries in a profile's metadata map. */
|
|
313
|
+
updateProfileMetadata(name, req) {
|
|
314
|
+
return this.request('PATCH', routes.profileMetadata(name), req);
|
|
315
|
+
}
|
|
312
316
|
/** Force-delete or detach one profile by exact id or unique name. */
|
|
313
317
|
deleteProfile(name, req) {
|
|
314
318
|
return this.request('DELETE', routes.profile(name), req);
|
package/dist/api/dto/canvas.d.ts
CHANGED
|
@@ -19,6 +19,8 @@ export interface AttentionItemDTO {
|
|
|
19
19
|
cwd: string;
|
|
20
20
|
/** Number of open tickets on this node. */
|
|
21
21
|
count: number;
|
|
22
|
+
/** Open ticket titles for this node, newest first — one per counted ticket. */
|
|
23
|
+
subjects: string[];
|
|
22
24
|
}
|
|
23
25
|
/** `GET /v1/canvas/attention` result. */
|
|
24
26
|
export interface AttentionDTO {
|
|
@@ -142,6 +144,10 @@ export interface HistoryReadResultDTO {
|
|
|
142
144
|
export interface SnapshotNodeDTO {
|
|
143
145
|
node_id: NodeIdDTO;
|
|
144
146
|
name: string;
|
|
147
|
+
/** Caller-supplied node title, kept separate from the enriched full label. */
|
|
148
|
+
title: string;
|
|
149
|
+
/** Caller-supplied node brief, or null when absent. */
|
|
150
|
+
description: string | null;
|
|
145
151
|
kind: string;
|
|
146
152
|
mode: string;
|
|
147
153
|
lifecycle?: string;
|
|
@@ -161,6 +167,10 @@ export interface SnapshotNodeDTO {
|
|
|
161
167
|
last_activity?: IsoTime;
|
|
162
168
|
ctx_tokens?: number;
|
|
163
169
|
streaming: boolean;
|
|
170
|
+
/** Number of active background bash jobs, reported only for a live broker. */
|
|
171
|
+
jobs_active: number;
|
|
172
|
+
/** Controller node this node is durably waiting for, or null. */
|
|
173
|
+
waiting_for: string | null;
|
|
164
174
|
/** The node's active fault projection (structurally a `Fault`), or null. Kept
|
|
165
175
|
* as a loose object to keep this DTO free of a `core` type import. */
|
|
166
176
|
hanging: Record<string, unknown> | null;
|
package/dist/api/dto/common.d.ts
CHANGED
|
@@ -18,7 +18,7 @@ export type LifecycleDTO = 'terminal' | 'resident';
|
|
|
18
18
|
/** Execution mode of a node (mirrors the runtime `Mode` union). */
|
|
19
19
|
export type ModeDTO = 'base' | 'orchestrator';
|
|
20
20
|
/** Why a node last stopped (mirrors the runtime `ExitIntent` union). */
|
|
21
|
-
export type ExitIntentDTO = 'done' | 'refresh' | 'idle-release' | null;
|
|
21
|
+
export type ExitIntentDTO = 'done' | 'refresh' | 'idle-release' | 'parked' | null;
|
|
22
22
|
/** Inbox urgency tier for a delivered message (mirrors feed/inbox `InboxTier`). */
|
|
23
23
|
export type InboxTierDTO = 'critical' | 'urgent' | 'normal' | 'deferred';
|
|
24
24
|
/** Whether a node id is a safe single filesystem path segment. Re-declared here
|
package/dist/api/dto/health.d.ts
CHANGED
|
@@ -8,7 +8,8 @@ export interface HealthDTO {
|
|
|
8
8
|
brokers_reconciled: boolean;
|
|
9
9
|
}
|
|
10
10
|
/** `GET /v1/status` — daemon status snapshot. Backs `crtr sys daemon status`
|
|
11
|
-
* state and the `crtr canvas dashboard` header.
|
|
11
|
+
* state and the `crtr canvas dashboard` header. `runtime_version` is also
|
|
12
|
+
* checked by Core's minimum-runtime capability gate. */
|
|
12
13
|
export interface StatusDTO {
|
|
13
14
|
daemon_pid: number;
|
|
14
15
|
tick_interval_ms: number;
|
|
@@ -4,10 +4,9 @@ export interface ReviveRequest {
|
|
|
4
4
|
/** Resume the saved conversation (true) vs a fresh launch (false). */
|
|
5
5
|
resume?: boolean;
|
|
6
6
|
/** Clear the finalization latch before reviving (the `--reopen` gate). The
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* (`not_finalized`). */
|
|
7
|
+
* revive doorway accepts it only for a finalized node (`not_finalized`
|
|
8
|
+
* otherwise); without it, a finalized node is rejected (`node_finalized`).
|
|
9
|
+
* Message delivery has its own wider reopen behavior. */
|
|
11
10
|
reopen?: boolean;
|
|
12
11
|
/** Wake provenance: the cron whose run drove this revive (`CRTR_CRON_ID`,
|
|
13
12
|
* set by the daemon in every cron run's environment and forwarded by the
|
|
@@ -19,8 +19,9 @@ export interface SendMessageRequest {
|
|
|
19
19
|
from?: NodeIdDTO | null;
|
|
20
20
|
/** Revive with no inbox entry (`--fresh` → `reviveNode({ resume: false })`). */
|
|
21
21
|
fresh?: boolean;
|
|
22
|
-
/**
|
|
23
|
-
*
|
|
22
|
+
/** Before delivery, make the target resident and clear its finalization latch
|
|
23
|
+
* when present (`--reopen`). Accepted for both durable and interactive
|
|
24
|
+
* delivery; `--fresh` retains its separate finalized-only gate. */
|
|
24
25
|
reopen?: boolean;
|
|
25
26
|
/** Hidden ambient context upserted onto the target's sidecar as a
|
|
26
27
|
* `situational` card, never visible chat (`--situational-context`).
|
|
@@ -42,8 +43,8 @@ export interface SendMessageRequest {
|
|
|
42
43
|
* on its one serialized frame loop — the same ordering a tmux viewer gets)
|
|
43
44
|
* instead of the durable inbox; a dormant or mid-revive target falls back to
|
|
44
45
|
* the durable inbox + revive (watcher delivers post-boot). Plain immediate
|
|
45
|
-
* body only — rejected with fresh/
|
|
46
|
-
*
|
|
46
|
+
* body only — rejected with fresh/situational_context/output_schema or tier
|
|
47
|
+
* 'deferred'. Runtime cards and reopen ARE accepted: a
|
|
47
48
|
* card-bearing send is an ordinary human send that happens to carry context,
|
|
48
49
|
* and the live deliver frame places the cards ahead of the body in one turn.
|
|
49
50
|
* Absent → durable inbox (unchanged). */
|
package/dist/api/dto/nodes.d.ts
CHANGED
|
@@ -33,6 +33,8 @@ export interface CreateNodeRequest {
|
|
|
33
33
|
pin_cwd?: string;
|
|
34
34
|
/** Display name (tmux window + resume picker). Defaults to the kind. */
|
|
35
35
|
name?: string;
|
|
36
|
+
/** Caller-supplied short description, preserved against automatic naming. */
|
|
37
|
+
description?: string;
|
|
36
38
|
parent?: NodeIdDTO | null;
|
|
37
39
|
root?: boolean;
|
|
38
40
|
/** Lifecycle of an independent root. Defaults to `resident`; use `terminal`
|
|
@@ -23,6 +23,11 @@ export interface EnsureProfileRequest {
|
|
|
23
23
|
* launched under the profile as `CRTR_PROFILE_META_<KEY>` env. */
|
|
24
24
|
metadata?: Record<string, string>;
|
|
25
25
|
}
|
|
26
|
+
/** `PATCH /v1/profiles/{name}/metadata` body. Merges `set` and removes `unset`. */
|
|
27
|
+
export interface UpdateProfileMetadataRequest {
|
|
28
|
+
set?: Record<string, string>;
|
|
29
|
+
unset?: string[];
|
|
30
|
+
}
|
|
26
31
|
/** `DELETE /v1/profiles/{name}` body. Destructive deletion is never implicit. */
|
|
27
32
|
export interface DeleteProfileRequest {
|
|
28
33
|
force: boolean;
|
package/dist/api/routes.d.ts
CHANGED
|
@@ -93,6 +93,7 @@ export declare const routes: {
|
|
|
93
93
|
readonly humanRequestCancel: (requestId: string) => string;
|
|
94
94
|
readonly profiles: () => string;
|
|
95
95
|
readonly profile: (name: string) => string;
|
|
96
|
+
readonly profileMetadata: (name: string) => string;
|
|
96
97
|
readonly modelAuths: () => string;
|
|
97
98
|
readonly modelAuth: (provider: string) => string;
|
|
98
99
|
readonly filePeek: () => string;
|
package/dist/api/routes.js
CHANGED
|
@@ -124,6 +124,7 @@ export const routes = {
|
|
|
124
124
|
// Profiles (deletion is daemon-owned because it crosses canvas state)
|
|
125
125
|
profiles: () => `${V}/profiles`,
|
|
126
126
|
profile: (name) => `${V}/profiles/${name}`,
|
|
127
|
+
profileMetadata: (name) => `${V}/profiles/${name}/metadata`,
|
|
127
128
|
// Model auth
|
|
128
129
|
modelAuths: () => `${V}/model-auth`,
|
|
129
130
|
modelAuth: (provider) => `${V}/model-auth/${provider}`,
|
|
@@ -8,6 +8,13 @@ export declare const CONTEXT_NUDGE_CUSTOM_TYPE = "crtr-context-nudge";
|
|
|
8
8
|
export declare const REVIEW_BOUNDARY_CUSTOM_TYPE = "crtr-review-boundary";
|
|
9
9
|
/** Generic completion mandate issued by the terminal-node stop guard. */
|
|
10
10
|
export declare const STALL_REPROMPT: string;
|
|
11
|
+
/** The daemon's parking mandate: the last turn of a conversation the unattended
|
|
12
|
+
* clock is concluding. Delivered live, wrapped in a `park` runtime card. It
|
|
13
|
+
* shares a CONTRACT with `node yield`'s pre-invocation guide (roadmap current,
|
|
14
|
+
* short and shrinking; context dir for in-progress material; memory only for
|
|
15
|
+
* gated permanent lessons) but not a string: yield is read by an agent choosing
|
|
16
|
+
* to refresh, this by an agent being told to conclude. */
|
|
17
|
+
export declare const PARK_SUMMARY_PROMPT: string;
|
|
11
18
|
/** Static recovery prompts shared by the broker producer and display classifier. */
|
|
12
19
|
export declare const AUTH_FAULT_RECOVERY_BODY = "Provider credentials were just updated (a new login landed). Your previous turn stopped on a provider authentication failure. Continue from where you left off and retry the work that failed.";
|
|
13
20
|
export declare const CONNECTION_FAULT_RECOVERY_BODY = "The network connection is back online. Your previous turn stopped on a connection error (the network was down). Continue from where you left off and retry the work that failed.";
|
|
@@ -13,6 +13,17 @@ export const REVIEW_BOUNDARY_CUSTOM_TYPE = 'crtr-review-boundary';
|
|
|
13
13
|
/** Generic completion mandate issued by the terminal-node stop guard. */
|
|
14
14
|
export const STALL_REPROMPT = "You've stopped but you're not waiting on anyone and haven't finished. " +
|
|
15
15
|
"Pipe the result to `crtr push final` through a single-quoted heredoc if the work is done, or use `crtr human send` if you are blocked or need the user.";
|
|
16
|
+
/** The daemon's parking mandate: the last turn of a conversation the unattended
|
|
17
|
+
* clock is concluding. Delivered live, wrapped in a `park` runtime card. It
|
|
18
|
+
* shares a CONTRACT with `node yield`'s pre-invocation guide (roadmap current,
|
|
19
|
+
* short and shrinking; context dir for in-progress material; memory only for
|
|
20
|
+
* gated permanent lessons) but not a string: yield is read by an agent choosing
|
|
21
|
+
* to refresh, this by an agent being told to conclude. */
|
|
22
|
+
export const PARK_SUMMARY_PROMPT = 'This conversation has been idle with nothing waiting on it, so it is being concluded. This is your last turn — do these four things now, then stop.\n\n'
|
|
23
|
+
+ '1. Bring your roadmap current. It lives at `$CRTR_CONTEXT_DIR/roadmap.md`, and it is the document a fresh cycle reads to know where things stand: what was done, what is still open, and what someone picking this up needs. Write one now if you never had one. Keep it short and shrinking — strategy and present state only, deleting completed items rather than marking them done.\n\n'
|
|
24
|
+
+ '2. Save anything else worth keeping. In-progress task material — what has happened, identifiers, in-flight state — goes to one or more files in your context directory. A permanent lesson worth remembering indefinitely goes to node memory (`crtr memory write -h`), gated deliberately: transcript state does not belong in memory.\n\n'
|
|
25
|
+
+ '3. Push one regular report to your subscribers summarizing where things stand: `crtr push update`. NOT `crtr push final` — this concludes the conversation, it does not finish a mandate.\n\n'
|
|
26
|
+
+ '4. Stop. A later message reopens you on a fresh context window grounded in your goal and that roadmap, so what you leave behind now is what you get back.';
|
|
16
27
|
/** Static recovery prompts shared by the broker producer and display classifier. */
|
|
17
28
|
export const AUTH_FAULT_RECOVERY_BODY = 'Provider credentials were just updated (a new login landed). Your previous turn stopped on a provider authentication failure. Continue from where you left off and retry the work that failed.';
|
|
18
29
|
export const CONNECTION_FAULT_RECOVERY_BODY = 'The network connection is back online. Your previous turn stopped on a connection error (the network was down). Continue from where you left off and retry the work that failed.';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@north-light/crouter-api",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.232",
|
|
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",
|