@north-light/api 0.3.577 → 0.3.579
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/contract.d.ts +1 -1
- package/dist/api/contract.js +1 -1
- package/dist/api/dto/run-events.d.ts +10 -4
- package/dist/shared/env.d.ts +5 -0
- package/dist/shared/env.js +7 -0
- package/package.json +1 -1
package/dist/api/contract.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** The contract level this build serves and requires. Written by `scripts/contract.mjs release`; never edit by hand. */
|
|
2
|
-
export declare const CONTRACT_LEVEL = "1.
|
|
2
|
+
export declare const CONTRACT_LEVEL = "1.40";
|
|
3
3
|
/** Request header naming the one contract level the caller needs, e.g. `1.3`. Optional: absent means no check. */
|
|
4
4
|
export declare const REQUIRED_CONTRACT_HEADER = "Crouter-Required-Contract";
|
|
5
5
|
/** Response header listing the contract levels the server serves, comma-separated, one per major, e.g. `1.3`. */
|
package/dist/api/contract.js
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
//
|
|
13
13
|
// PURITY (spec §3.1): Node built-ins + `src/api/*` only.
|
|
14
14
|
/** The contract level this build serves and requires. Written by `scripts/contract.mjs release`; never edit by hand. */
|
|
15
|
-
export const CONTRACT_LEVEL = '1.
|
|
15
|
+
export const CONTRACT_LEVEL = '1.40';
|
|
16
16
|
/** Request header naming the one contract level the caller needs, e.g. `1.3`. Optional: absent means no check. */
|
|
17
17
|
export const REQUIRED_CONTRACT_HEADER = 'Crouter-Required-Contract';
|
|
18
18
|
/** Response header listing the contract levels the server serves, comma-separated, one per major, e.g. `1.3`. */
|
|
@@ -32,10 +32,13 @@ export type RunActivityDTO = {
|
|
|
32
32
|
};
|
|
33
33
|
};
|
|
34
34
|
/** Why a turn ended in error: `content_refused` when the vendor refused the
|
|
35
|
-
* model call on safety grounds, `
|
|
35
|
+
* model call on safety grounds, `rate_limited` when every model route is
|
|
36
|
+
* rate-limited for longer than a turn waits, `model_error` for any other failed call. */
|
|
36
37
|
export interface TurnErrorDTO {
|
|
37
|
-
code: 'content_refused' | 'model_error';
|
|
38
|
+
code: 'content_refused' | 'model_error' | 'rate_limited';
|
|
38
39
|
message: string;
|
|
40
|
+
/** ISO time the rate limit is expected to lift; present only when `code` is `rate_limited`. */
|
|
41
|
+
retry_at?: string;
|
|
39
42
|
}
|
|
40
43
|
/** The broker's stop reason for one assistant message, unchanged. */
|
|
41
44
|
export type AssistantStopReasonDTO = 'stop' | 'toolUse' | 'length' | 'error' | 'aborted';
|
|
@@ -111,7 +114,10 @@ export interface NodeMessageAcceptedEvent extends RunEventBaseDTO {
|
|
|
111
114
|
}
|
|
112
115
|
export interface NodeTurnStartedEvent extends RunEventBaseDTO {
|
|
113
116
|
type: 'node.turn.started';
|
|
114
|
-
/**
|
|
117
|
+
/**
|
|
118
|
+
* `message_ids`: the accepted `run.message` messages this turn delivers (empty for the prompt, an answer, or a child's report).
|
|
119
|
+
* A turn can emit more than one `node.turn.started`: each time a steered `run.message` joins the open turn at the agent's next step, another one arrives with that message's `message_ids` and its own `entry_id`. A single `node.turn.completed` ends the turn and carries every joined id.
|
|
120
|
+
*/
|
|
115
121
|
input: {
|
|
116
122
|
text: string;
|
|
117
123
|
message_ids: string[];
|
|
@@ -156,7 +162,7 @@ export interface NodeToolCallCompletedEvent extends RunEventBaseDTO, Redactable
|
|
|
156
162
|
}
|
|
157
163
|
export interface NodeTurnCompletedEvent extends RunEventBaseDTO {
|
|
158
164
|
type: 'node.turn.completed';
|
|
159
|
-
/**
|
|
165
|
+
/** Every `input.message_ids` of the turn's `node.turn.started` events, in order (more than one when messages joined the turn). */
|
|
160
166
|
message_ids: string[];
|
|
161
167
|
/** The run's `run.get` status when the turn ended. */
|
|
162
168
|
run_status: Exclude<RunStatusDTO, 'settled'>;
|
package/dist/shared/env.d.ts
CHANGED
|
@@ -11,6 +11,11 @@ export declare function launchSnapshotFile(dir: string): string | undefined;
|
|
|
11
11
|
export declare function sandboxCliNodeId(): string | undefined;
|
|
12
12
|
/** A Linux app command uses its mounted launch snapshot, not host user stores. */
|
|
13
13
|
export declare function isSandboxedNode(): boolean;
|
|
14
|
+
/** True when this CLI reaches `/v1` through its broker's CLI relay to a remote control plane: the broker exports `CRTR_API_URL` (an
|
|
15
|
+
* http(s) URL, the fleet launcher's) and `CRTR_API_SOCKET` (the relay it serves). It chooses only where this process gets provider command
|
|
16
|
+
* descriptions (`GET /v1/providers/tools` through that relay); the relay's node token stays the authority. It is not `isSandboxedNode()`,
|
|
17
|
+
* which gates owner-only commands and launch-snapshot reads on a Linux launcher mount. */
|
|
18
|
+
export declare function providerProjectionOverBrokerRelay(): boolean;
|
|
14
19
|
/** The app that owns the current node, supplied in its broker launch identity. */
|
|
15
20
|
export declare function envGrantee(): string | undefined;
|
|
16
21
|
/** Set to '1' by `nodeEnv` for an app-started run's brokers, which admit inbox
|
package/dist/shared/env.js
CHANGED
|
@@ -64,6 +64,13 @@ export function sandboxCliNodeId() {
|
|
|
64
64
|
export function isSandboxedNode() {
|
|
65
65
|
return sandboxCliNodeId() !== undefined;
|
|
66
66
|
}
|
|
67
|
+
/** True when this CLI reaches `/v1` through its broker's CLI relay to a remote control plane: the broker exports `CRTR_API_URL` (an
|
|
68
|
+
* http(s) URL, the fleet launcher's) and `CRTR_API_SOCKET` (the relay it serves). It chooses only where this process gets provider command
|
|
69
|
+
* descriptions (`GET /v1/providers/tools` through that relay); the relay's node token stays the authority. It is not `isSandboxedNode()`,
|
|
70
|
+
* which gates owner-only commands and launch-snapshot reads on a Linux launcher mount. */
|
|
71
|
+
export function providerProjectionOverBrokerRelay() {
|
|
72
|
+
return /^https?:\/\//.test(process.env['CRTR_API_URL'] ?? '') && (process.env['CRTR_API_SOCKET'] ?? '') !== '';
|
|
73
|
+
}
|
|
67
74
|
/** The app that owns the current node, supplied in its broker launch identity. */
|
|
68
75
|
export function envGrantee() {
|
|
69
76
|
return process.env['CRTR_GRANTEE'];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@north-light/api",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.579",
|
|
4
4
|
"description": "Typed crtrd /v1 API contract — DTOs, route builders, the error contract, the CrtrClient, and the command-plugin manifest format. Zero runtime dependencies.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/api/index.js",
|