@north-light/api 0.3.570 → 0.3.572
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
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.37";
|
|
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.37';
|
|
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`. */
|
|
@@ -27,6 +27,9 @@ export interface BrokerExecutionRequest {
|
|
|
27
27
|
export interface BrokerSettleRequest extends BrokerExecutionRequest {
|
|
28
28
|
stopReason: string;
|
|
29
29
|
pushedFinal: boolean;
|
|
30
|
+
/** Set only by the broker once it has recorded the settled turn's fatal provider fault and armed no retry or model fallback:
|
|
31
|
+
* the daemon may then idle a resident Blaxel broker. A settle without it never idles on an error. */
|
|
32
|
+
faultSettled?: boolean;
|
|
30
33
|
}
|
|
31
34
|
/** `POST /v1/nodes/{id}/broker/telemetry` body. Tokens are cumulative within
|
|
32
35
|
* the broker's current Pi session; null context/activity values preserve the
|
|
@@ -48,6 +48,13 @@ export interface ExecutionExitDiagnosticDTO {
|
|
|
48
48
|
routes: string[];
|
|
49
49
|
};
|
|
50
50
|
}
|
|
51
|
+
/** The diagnostic the daemon itself writes when a launch fails before the broker reports; it never crosses `/v1` as a request. */
|
|
52
|
+
export interface ExecutionLaunchFailureDiagnostic {
|
|
53
|
+
schema: 'crtr.execution-exit-diagnostic/v1';
|
|
54
|
+
launch_failure: {
|
|
55
|
+
message: string;
|
|
56
|
+
};
|
|
57
|
+
}
|
|
51
58
|
export interface BrokerTurnResultDTO {
|
|
52
59
|
applied: boolean;
|
|
53
60
|
fault_link: FaultLink | null;
|
package/dist/api/errors.d.ts
CHANGED
|
@@ -43,5 +43,8 @@ export { APIError as ApiError };
|
|
|
43
43
|
/** A local API transport failure has stable status/code identity, independent
|
|
44
44
|
* of message prose. */
|
|
45
45
|
export declare function isDaemonTransportApiError(error: unknown): error is APIError;
|
|
46
|
+
/** The daemon refused the caller's node token. A teardown revokes the broker's token before its process stops, so a broker
|
|
47
|
+
* that sees this on a poll is being shut down, not hitting a corrupt state. */
|
|
48
|
+
export declare function isTokenRevokedApiError(error: unknown): error is APIError;
|
|
46
49
|
/** Type guard for an `ErrorBody`-shaped parsed payload. */
|
|
47
50
|
export declare function isErrorBody(value: unknown): value is ErrorBody;
|
package/dist/api/errors.js
CHANGED
|
@@ -54,6 +54,11 @@ export function isDaemonTransportApiError(error) {
|
|
|
54
54
|
|| error.code === 'daemon_request_interrupted')) || (error.status === 504 && (error.code === 'request_timeout' || error.code === 'deadline_exceeded'))
|
|
55
55
|
|| (error.status >= 500 && error.code === 'daemon_health_unavailable');
|
|
56
56
|
}
|
|
57
|
+
/** The daemon refused the caller's node token. A teardown revokes the broker's token before its process stops, so a broker
|
|
58
|
+
* that sees this on a poll is being shut down, not hitting a corrupt state. */
|
|
59
|
+
export function isTokenRevokedApiError(error) {
|
|
60
|
+
return error instanceof APIError && error.status === 401;
|
|
61
|
+
}
|
|
57
62
|
/** Type guard for an `ErrorBody`-shaped parsed payload. */
|
|
58
63
|
export function isErrorBody(value) {
|
|
59
64
|
if (typeof value !== 'object' || value === null)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@north-light/api",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.572",
|
|
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",
|