@north-light/api 0.0.0 → 0.3.415
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/LICENSE +18 -0
- package/README.md +66 -2
- package/dist/api/__tests__/deadline.test.d.ts +1 -0
- package/dist/api/__tests__/deadline.test.js +46 -0
- package/dist/api/__tests__/error-codes.test.d.ts +1 -0
- package/dist/api/__tests__/error-codes.test.js +79 -0
- package/dist/api/__tests__/integration/client.test.d.ts +1 -0
- package/dist/api/__tests__/integration/client.test.js +276 -0
- package/dist/api/client.d.ts +521 -0
- package/dist/api/client.js +1388 -0
- package/dist/api/command-manifest/index.d.ts +3 -0
- package/dist/api/command-manifest/index.js +3 -0
- package/dist/api/command-manifest/manifest.d.ts +51 -0
- package/dist/api/command-manifest/manifest.js +332 -0
- package/dist/api/command-manifest/result.d.ts +25 -0
- package/dist/api/command-manifest/result.js +97 -0
- package/dist/api/command-manifest/schema.d.ts +28 -0
- package/dist/api/command-manifest/schema.js +856 -0
- package/dist/api/dto/analytics.d.ts +184 -0
- package/dist/api/dto/analytics.js +3 -0
- package/dist/api/dto/attach.d.ts +22 -0
- package/dist/api/dto/attach.js +13 -0
- package/dist/api/dto/bash-jobs.d.ts +24 -0
- package/dist/api/dto/bash-jobs.js +9 -0
- package/dist/api/dto/bash.d.ts +17 -0
- package/dist/api/dto/bash.js +1 -0
- package/dist/api/dto/broker-ops.d.ts +187 -0
- package/dist/api/dto/broker-ops.js +6 -0
- package/dist/api/dto/broker-signals.d.ts +25 -0
- package/dist/api/dto/broker-signals.js +1 -0
- package/dist/api/dto/broker.d.ts +86 -0
- package/dist/api/dto/broker.js +20 -0
- package/dist/api/dto/canvas.d.ts +359 -0
- package/dist/api/dto/canvas.js +2 -0
- package/dist/api/dto/chat-inventory.d.ts +56 -0
- package/dist/api/dto/chat-inventory.js +11 -0
- package/dist/api/dto/common.d.ts +29 -0
- package/dist/api/dto/common.js +15 -0
- package/dist/api/dto/config.d.ts +46 -0
- package/dist/api/dto/config.js +3 -0
- package/dist/api/dto/crons.d.ts +164 -0
- package/dist/api/dto/crons.js +10 -0
- package/dist/api/dto/custom-objects.d.ts +66 -0
- package/dist/api/dto/custom-objects.js +1 -0
- package/dist/api/dto/delivery.d.ts +71 -0
- package/dist/api/dto/delivery.js +7 -0
- package/dist/api/dto/docs.d.ts +135 -0
- package/dist/api/dto/docs.js +8 -0
- package/dist/api/dto/files.d.ts +21 -0
- package/dist/api/dto/files.js +1 -0
- package/dist/api/dto/focus.d.ts +24 -0
- package/dist/api/dto/focus.js +10 -0
- package/dist/api/dto/grants.d.ts +28 -0
- package/dist/api/dto/grants.js +1 -0
- package/dist/api/dto/health.d.ts +116 -0
- package/dist/api/dto/health.js +2 -0
- package/dist/api/dto/human-requests.d.ts +113 -0
- package/dist/api/dto/human-requests.js +4 -0
- package/dist/api/dto/human.d.ts +28 -0
- package/dist/api/dto/human.js +4 -0
- package/dist/api/dto/inbox.d.ts +273 -0
- package/dist/api/dto/inbox.js +4 -0
- package/dist/api/dto/lifecycle.d.ts +88 -0
- package/dist/api/dto/lifecycle.js +3 -0
- package/dist/api/dto/limits.d.ts +29 -0
- package/dist/api/dto/limits.js +2 -0
- package/dist/api/dto/mail.d.ts +44 -0
- package/dist/api/dto/mail.js +1 -0
- package/dist/api/dto/messages.d.ts +104 -0
- package/dist/api/dto/messages.js +2 -0
- package/dist/api/dto/model-config.d.ts +25 -0
- package/dist/api/dto/model-config.js +1 -0
- package/dist/api/dto/modelauth.d.ts +132 -0
- package/dist/api/dto/modelauth.js +4 -0
- package/dist/api/dto/node-events.d.ts +65 -0
- package/dist/api/dto/node-events.js +4 -0
- package/dist/api/dto/node-outcomes.d.ts +88 -0
- package/dist/api/dto/node-outcomes.js +2 -0
- package/dist/api/dto/node-records.d.ts +35 -0
- package/dist/api/dto/node-records.js +5 -0
- package/dist/api/dto/nodes.d.ts +371 -0
- package/dist/api/dto/nodes.js +3 -0
- package/dist/api/dto/objects.d.ts +172 -0
- package/dist/api/dto/objects.js +5 -0
- package/dist/api/dto/profiles.d.ts +117 -0
- package/dist/api/dto/profiles.js +4 -0
- package/dist/api/dto/recovery.d.ts +104 -0
- package/dist/api/dto/recovery.js +1 -0
- package/dist/api/dto/reports.d.ts +95 -0
- package/dist/api/dto/reports.js +2 -0
- package/dist/api/dto/review-comments.d.ts +146 -0
- package/dist/api/dto/review-comments.js +5 -0
- package/dist/api/dto/reviews.d.ts +113 -0
- package/dist/api/dto/reviews.js +5 -0
- package/dist/api/dto/run-events.d.ts +295 -0
- package/dist/api/dto/run-events.js +6 -0
- package/dist/api/dto/structured-requests.d.ts +64 -0
- package/dist/api/dto/structured-requests.js +5 -0
- package/dist/api/dto/subscriptions.d.ts +14 -0
- package/dist/api/dto/subscriptions.js +2 -0
- package/dist/api/dto/usage.d.ts +27 -0
- package/dist/api/dto/usage.js +1 -0
- package/dist/api/dto/worktree.d.ts +55 -0
- package/dist/api/dto/worktree.js +6 -0
- package/dist/api/error-codes.d.ts +259 -0
- package/dist/api/error-codes.js +56 -0
- package/dist/api/errors.d.ts +47 -0
- package/dist/api/errors.js +66 -0
- package/dist/api/index.d.ts +49 -0
- package/dist/api/index.js +46 -0
- package/dist/api/long-poll.d.ts +59 -0
- package/dist/api/long-poll.js +67 -0
- package/dist/api/node-transport.d.ts +18 -0
- package/dist/api/node-transport.js +105 -0
- package/dist/api/plugin-manifest-schema.d.ts +233 -0
- package/dist/api/plugin-manifest-schema.js +23 -0
- package/dist/api/routes.d.ts +164 -0
- package/dist/api/routes.js +197 -0
- package/dist/api/runtime-version.d.ts +31 -0
- package/dist/api/runtime-version.js +50 -0
- package/dist/core/asset-root.d.ts +7 -0
- package/dist/core/asset-root.js +18 -0
- package/dist/core/canvas/boot-id.d.ts +6 -0
- package/dist/core/canvas/boot-id.js +26 -0
- package/dist/core/canvas/paths.d.ts +72 -0
- package/dist/core/canvas/paths.js +163 -0
- package/dist/core/canvas/pid.d.ts +391 -0
- package/dist/core/canvas/pid.js +948 -0
- package/dist/core/command-plugins/bundle.d.ts +149 -0
- package/dist/core/command-plugins/bundle.js +588 -0
- package/dist/core/command-plugins/endpoint.d.ts +24 -0
- package/dist/core/command-plugins/endpoint.js +51 -0
- package/dist/core/config.d.ts +233 -0
- package/dist/core/config.js +1120 -0
- package/dist/core/env-name.d.ts +6 -0
- package/dist/core/env-name.js +9 -0
- package/dist/core/errors.d.ts +38 -0
- package/dist/core/errors.js +90 -0
- package/dist/core/events/emit.d.ts +6 -0
- package/dist/core/events/emit.js +42 -0
- package/dist/core/events/envelope.d.ts +2 -0
- package/dist/core/events/envelope.js +84 -0
- package/dist/core/events/errors.d.ts +4 -0
- package/dist/core/events/errors.js +69 -0
- package/dist/core/events/operation-id.d.ts +4 -0
- package/dist/core/events/operation-id.js +24 -0
- package/dist/core/events/serialize.d.ts +4 -0
- package/dist/core/events/serialize.js +199 -0
- package/dist/core/events/source.d.ts +16 -0
- package/dist/core/events/source.js +31 -0
- package/dist/core/events/types.d.ts +68 -0
- package/dist/core/events/types.js +11 -0
- package/dist/core/exclusive-lock.d.ts +34 -0
- package/dist/core/exclusive-lock.js +197 -0
- package/dist/core/fs-utils.d.ts +44 -0
- package/dist/core/fs-utils.js +208 -0
- package/dist/core/help.d.ts +309 -0
- package/dist/core/help.js +406 -0
- package/dist/core/human/page-catalog.d.ts +57 -0
- package/dist/core/human/page-catalog.js +172 -0
- package/dist/core/installed-plugins.d.ts +2 -0
- package/dist/core/installed-plugins.js +79 -0
- package/dist/core/io.d.ts +122 -0
- package/dist/core/io.js +373 -0
- package/dist/core/keybindings/attach-control.d.ts +49 -0
- package/dist/core/keybindings/attach-control.js +42 -0
- package/dist/core/keybindings/catalog.d.ts +18 -0
- package/dist/core/keybindings/catalog.js +257 -0
- package/dist/core/keybindings/types.d.ts +42 -0
- package/dist/core/keybindings/types.js +1 -0
- package/dist/core/layout.d.ts +36 -0
- package/dist/core/layout.js +112 -0
- package/dist/core/locked-file.d.ts +27 -0
- package/dist/core/locked-file.js +118 -0
- package/dist/core/log.d.ts +9 -0
- package/dist/core/log.js +89 -0
- package/dist/core/manifest.d.ts +5 -0
- package/dist/core/manifest.js +15 -0
- package/dist/core/plugin-env.d.ts +8 -0
- package/dist/core/plugin-env.js +31 -0
- package/dist/core/plugin-extensions.d.ts +29 -0
- package/dist/core/plugin-extensions.js +191 -0
- package/dist/core/plugin-swap-lock.d.ts +9 -0
- package/dist/core/plugin-swap-lock.js +31 -0
- package/dist/core/preview-result-path.d.ts +4 -0
- package/dist/core/preview-result-path.js +26 -0
- package/dist/core/profiles/env-store.d.ts +22 -0
- package/dist/core/profiles/env-store.js +163 -0
- package/dist/core/profiles/fuzzy-match.d.ts +19 -0
- package/dist/core/profiles/fuzzy-match.js +92 -0
- package/dist/core/profiles/manifest.d.ts +120 -0
- package/dist/core/profiles/manifest.js +529 -0
- package/dist/core/rate-limit-scope.d.ts +25 -0
- package/dist/core/rate-limit-scope.js +64 -0
- package/dist/core/render.d.ts +12 -0
- package/dist/core/render.js +138 -0
- package/dist/core/resolver.d.ts +14 -0
- package/dist/core/resolver.js +111 -0
- package/dist/core/runtime/branded-host.d.ts +55 -0
- package/dist/core/runtime/branded-host.js +485 -0
- package/dist/core/runtime/broker/daemon-ops.d.ts +65 -0
- package/dist/core/runtime/broker/daemon-ops.js +177 -0
- package/dist/core/runtime/broker/signal-stream.d.ts +30 -0
- package/dist/core/runtime/broker/signal-stream.js +149 -0
- package/dist/core/scope.d.ts +32 -0
- package/dist/core/scope.js +184 -0
- package/dist/core/scoped-state/db.d.ts +17 -0
- package/dist/core/scoped-state/db.js +247 -0
- package/dist/core/scoped-state/migrate.d.ts +8 -0
- package/dist/core/scoped-state/migrate.js +187 -0
- package/dist/core/scoped-state/paths.d.ts +9 -0
- package/dist/core/scoped-state/paths.js +27 -0
- package/dist/core/scoped-state/profiles.d.ts +27 -0
- package/dist/core/scoped-state/profiles.js +93 -0
- package/dist/core/scoped-state/providers.d.ts +24 -0
- package/dist/core/scoped-state/providers.js +19 -0
- package/dist/core/scoped-state/schema.d.ts +6 -0
- package/dist/core/scoped-state/schema.js +43 -0
- package/dist/core/scoped-state/settings.d.ts +28 -0
- package/dist/core/scoped-state/settings.js +83 -0
- package/dist/core/spaces/open-beneath.d.ts +71 -0
- package/dist/core/spaces/open-beneath.js +581 -0
- package/dist/core/sqlite-statements.d.ts +4 -0
- package/dist/core/sqlite-statements.js +17 -0
- package/dist/core/subscription-state.d.ts +121 -0
- package/dist/core/subscription-state.js +287 -0
- package/dist/core/user-settings.d.ts +377 -0
- package/dist/core/user-settings.js +458 -0
- package/dist/daemon/broker-signals/bus.d.ts +30 -0
- package/dist/daemon/broker-signals/bus.js +87 -0
- package/dist/daemon/manage.d.ts +176 -0
- package/dist/daemon/manage.js +664 -0
- package/dist/daemon/pidfile.d.ts +8 -0
- package/dist/daemon/pidfile.js +37 -0
- package/dist/daemon/startup-policy.d.ts +1 -0
- package/dist/daemon/startup-policy.js +1 -0
- package/dist/native/linux.d.ts +29 -0
- package/dist/native/linux.js +20 -0
- package/dist/shared/env.d.ts +116 -0
- package/dist/shared/env.js +271 -0
- package/dist/shared/generated-context.d.ts +83 -0
- package/dist/shared/generated-context.js +235 -0
- package/dist/shared/inbox-entry-body.d.ts +22 -0
- package/dist/shared/inbox-entry-body.js +116 -0
- package/dist/shared/predicates.d.ts +2 -0
- package/dist/shared/predicates.js +4 -0
- package/dist/shared/working-activity.d.ts +9 -0
- package/dist/shared/working-activity.js +27 -0
- package/dist/types.d.ts +562 -0
- package/dist/types.js +186 -0
- package/package.json +46 -5
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import type { NodeStatusDTO } from './common.js';
|
|
2
|
+
/** Ephemeral daemon lifecycle phase reported by health and status. */
|
|
3
|
+
export type StartupPhaseDTO = 'initializing' | 'blocked' | 'prepared' | 'recovering' | 'ready';
|
|
4
|
+
/** `GET /healthz` — substrate readiness probe. Versions are informational, never
|
|
5
|
+
* a gate. Used by the provisioning ladder. */
|
|
6
|
+
export interface HealthDTO {
|
|
7
|
+
ok: boolean;
|
|
8
|
+
daemon_up: boolean;
|
|
9
|
+
store_accessible: boolean;
|
|
10
|
+
brokers_reconciled: boolean;
|
|
11
|
+
/** Present while corpus migration or normal daemon startup is incomplete. */
|
|
12
|
+
startup_blocked?: string;
|
|
13
|
+
/** Always present; only `ready` admits normal daemon work. */
|
|
14
|
+
startup_phase: StartupPhaseDTO;
|
|
15
|
+
}
|
|
16
|
+
/** `GET /v1/status` — daemon status snapshot. Backs `crtr sys daemon status`
|
|
17
|
+
* state and the `crtr canvas dashboard` header. `runtime_version` is also
|
|
18
|
+
* checked by Core's minimum-runtime capability gate. */
|
|
19
|
+
export interface StatusDTO {
|
|
20
|
+
daemon_pid: number;
|
|
21
|
+
tick_interval_ms: number;
|
|
22
|
+
/** Node counts keyed by status. */
|
|
23
|
+
node_counts: Partial<Record<NodeStatusDTO, number>>;
|
|
24
|
+
/** Nodes genuinely mid-turn: their busy marker exists and their recorded pid is alive. Unlike `node_counts.active`, this excludes live-but-waiting, parked, or blocked engines. */
|
|
25
|
+
busy_node_count: number;
|
|
26
|
+
/** Bound listener addresses. `tcp` is null when the TCP listener is off. */
|
|
27
|
+
listeners: {
|
|
28
|
+
socket_path: string;
|
|
29
|
+
tcp: string | null;
|
|
30
|
+
};
|
|
31
|
+
runtime_version: string;
|
|
32
|
+
api_version: string;
|
|
33
|
+
/** Always present; only `ready` admits normal daemon work. */
|
|
34
|
+
startup_phase: StartupPhaseDTO;
|
|
35
|
+
}
|
|
36
|
+
/** `GET /v1/due` — whether this runtime has work in flight or due, and when its
|
|
37
|
+
* next timed work is. `busy` is true while a non-spare node is mid-turn with a
|
|
38
|
+
* live pid, a cron or bash job is running, or any timed lane has work due now.
|
|
39
|
+
* `next_due_at` (ISO) is the earliest time any timed lane owes work, null when
|
|
40
|
+
* none. A sandbox may sleep only while `busy` is false and must wake by
|
|
41
|
+
* `next_due_at`. */
|
|
42
|
+
export interface DueDTO {
|
|
43
|
+
busy: boolean;
|
|
44
|
+
next_due_at: string | null;
|
|
45
|
+
}
|
|
46
|
+
/** `POST /v1/daemon/restart` — the ack for a daemon-owned handover.
|
|
47
|
+
*
|
|
48
|
+
* The daemon answers BEFORE it tears anything down: the caller is normally a
|
|
49
|
+
* node's own bash tool, whose broker this handover will kill, so the ack must
|
|
50
|
+
* be a settled tool result in that node's transcript before the SIGTERM lands.
|
|
51
|
+
* `accepted` is therefore a promise about the future, not a completed action —
|
|
52
|
+
* the successor daemon is spawned after `grace_ms`, and every node the
|
|
53
|
+
* teardown interrupts is resumed by it. */
|
|
54
|
+
export interface MigrateStateRequest {
|
|
55
|
+
dry_run?: boolean;
|
|
56
|
+
}
|
|
57
|
+
/** `crtr sys migrate`: the canvas import (004-canvas-documents) plan or result. */
|
|
58
|
+
export interface MigrateStateDTO {
|
|
59
|
+
/** Loose-key moves/imports (paths and names only). */
|
|
60
|
+
loose_keys?: string[];
|
|
61
|
+
/** Every store root the import found, with its owner and document count. */
|
|
62
|
+
stores: {
|
|
63
|
+
root: string;
|
|
64
|
+
owner: Record<string, unknown>;
|
|
65
|
+
docs: number;
|
|
66
|
+
skipped?: string;
|
|
67
|
+
}[];
|
|
68
|
+
/** `documents.<kind>`, `documents.owner.<type>`, `revisions`, `documents.rewritten`, `owners`, … */
|
|
69
|
+
counts: Record<string, number>;
|
|
70
|
+
rewrites: {
|
|
71
|
+
path: string;
|
|
72
|
+
from: string;
|
|
73
|
+
to: string;
|
|
74
|
+
}[];
|
|
75
|
+
dropped_fields: {
|
|
76
|
+
path: string;
|
|
77
|
+
field: string;
|
|
78
|
+
}[];
|
|
79
|
+
skipped: {
|
|
80
|
+
path: string;
|
|
81
|
+
reason: string;
|
|
82
|
+
}[];
|
|
83
|
+
/** Each clash or unreadable source the import resolved itself, one line each. */
|
|
84
|
+
resolutions: {
|
|
85
|
+
kind: string;
|
|
86
|
+
message: string;
|
|
87
|
+
paths: string[];
|
|
88
|
+
}[];
|
|
89
|
+
blockers: {
|
|
90
|
+
kind: string;
|
|
91
|
+
message: string;
|
|
92
|
+
paths: string[];
|
|
93
|
+
}[];
|
|
94
|
+
dryRun: boolean;
|
|
95
|
+
/** True while the import has not been written. */
|
|
96
|
+
pending: boolean;
|
|
97
|
+
resumed: boolean;
|
|
98
|
+
resume_error?: string;
|
|
99
|
+
}
|
|
100
|
+
/** `POST /v1/daemon/admit` — opens normal daemon work after preparation. */
|
|
101
|
+
export interface DaemonAdmitDTO {
|
|
102
|
+
/** True only for the request that began admission. */
|
|
103
|
+
admitted: boolean;
|
|
104
|
+
/** True when another request had already begun or completed admission. */
|
|
105
|
+
already_admitted: boolean;
|
|
106
|
+
startup_phase: StartupPhaseDTO;
|
|
107
|
+
}
|
|
108
|
+
export interface DaemonRestartDTO {
|
|
109
|
+
accepted: boolean;
|
|
110
|
+
/** The daemon that took the request and is about to hand over. */
|
|
111
|
+
predecessor_pid: number;
|
|
112
|
+
/** Its epoch id — the successor mints a new one. */
|
|
113
|
+
predecessor_epoch: string;
|
|
114
|
+
/** How long the daemon waits after answering before teardown begins. */
|
|
115
|
+
grace_ms: number;
|
|
116
|
+
}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import type { IsoTime } from './common.js';
|
|
2
|
+
import type { InboxPageDTO, PageResponsesDTO, TicketSourceDTO } from './inbox.js';
|
|
3
|
+
/** Daemon-minted request identity. Inbox presentation has a separate opaque ticket id. */
|
|
4
|
+
export type HumanRequestIdDTO = string;
|
|
5
|
+
/** The complete authored page text, inline — never a path. */
|
|
6
|
+
export interface HumanRequestPageDTO {
|
|
7
|
+
dialect: 'jsx' | 'html';
|
|
8
|
+
source: string;
|
|
9
|
+
}
|
|
10
|
+
export interface HumanRequestDeliveryDTO {
|
|
11
|
+
placement: 'inline' | 'panel';
|
|
12
|
+
inbox: boolean;
|
|
13
|
+
reply: boolean;
|
|
14
|
+
}
|
|
15
|
+
/** Frozen at creation: the action name and its opaque payload. An omitted
|
|
16
|
+
* `payload` is frozen as JSON null, so the completion document always carries it. */
|
|
17
|
+
export interface HumanRequestActionDTO {
|
|
18
|
+
name: string;
|
|
19
|
+
payload?: unknown;
|
|
20
|
+
}
|
|
21
|
+
export interface CreateHumanRequestRequest {
|
|
22
|
+
page: HumanRequestPageDTO;
|
|
23
|
+
delivery?: HumanRequestDeliveryDTO;
|
|
24
|
+
source?: TicketSourceDTO;
|
|
25
|
+
/** The one node that receives the terminal result. Required for reply-bearing pages. */
|
|
26
|
+
requester_node_id?: string | null;
|
|
27
|
+
creator_cwd: string;
|
|
28
|
+
action?: HumanRequestActionDTO;
|
|
29
|
+
}
|
|
30
|
+
export type HumanRequestState = 'pending' | 'answered' | 'dismissed' | 'canceled';
|
|
31
|
+
export type HumanRequestDeliveryState = 'none' | 'pending' | 'running' | 'accepted' | 'permanent_failed';
|
|
32
|
+
export interface CreateHumanRequestDTO {
|
|
33
|
+
request_id: HumanRequestIdDTO;
|
|
34
|
+
/** Daemon-owned directory where the request's rendered page is projected. */
|
|
35
|
+
request_dir: string;
|
|
36
|
+
state: 'pending';
|
|
37
|
+
/** Omitted entirely when the request carries no action binding. */
|
|
38
|
+
action?: {
|
|
39
|
+
name: string;
|
|
40
|
+
};
|
|
41
|
+
delivery_state: HumanRequestDeliveryState;
|
|
42
|
+
}
|
|
43
|
+
export interface HumanRequestDeliveryFailureDTO {
|
|
44
|
+
kind: 'exit' | 'signal' | 'timeout' | 'spawn_error' | 'grant_refused';
|
|
45
|
+
exit_code?: number;
|
|
46
|
+
signal?: string;
|
|
47
|
+
message?: string;
|
|
48
|
+
/** A bounded tail, not full output. */
|
|
49
|
+
stderr?: string;
|
|
50
|
+
}
|
|
51
|
+
export interface HumanRequestDeliveryDetailDTO {
|
|
52
|
+
state: HumanRequestDeliveryState;
|
|
53
|
+
/** Attempts started. */
|
|
54
|
+
attempt: number;
|
|
55
|
+
/** Present only while pending after a retryable failure. */
|
|
56
|
+
next_attempt_at?: IsoTime;
|
|
57
|
+
accepted_at?: IsoTime;
|
|
58
|
+
permanent_failed_at?: IsoTime;
|
|
59
|
+
last_failure?: HumanRequestDeliveryFailureDTO;
|
|
60
|
+
}
|
|
61
|
+
export interface HumanRequestDTO {
|
|
62
|
+
request_id: HumanRequestIdDTO;
|
|
63
|
+
/** Opaque inbox identity for inbox-only routes. */
|
|
64
|
+
inbox_ticket_id: string;
|
|
65
|
+
/** Daemon-owned directory where the request's rendered page is projected. */
|
|
66
|
+
request_dir: string;
|
|
67
|
+
kind: 'page' | 'review';
|
|
68
|
+
state: HumanRequestState;
|
|
69
|
+
title: string;
|
|
70
|
+
subtitle?: string;
|
|
71
|
+
source: TicketSourceDTO;
|
|
72
|
+
emitted_at: IsoTime;
|
|
73
|
+
/** Present unless pending. */
|
|
74
|
+
settled_at?: IsoTime;
|
|
75
|
+
/** Present only when `state` is `answered`. */
|
|
76
|
+
responses?: PageResponsesDTO;
|
|
77
|
+
reason?: string;
|
|
78
|
+
actor?: string;
|
|
79
|
+
/** `action` and `delivery` are both omitted when no action is bound. */
|
|
80
|
+
action?: {
|
|
81
|
+
name: string;
|
|
82
|
+
payload: unknown;
|
|
83
|
+
};
|
|
84
|
+
delivery?: HumanRequestDeliveryDetailDTO;
|
|
85
|
+
/** Present exactly when this request is a page. */
|
|
86
|
+
page?: InboxPageDTO;
|
|
87
|
+
}
|
|
88
|
+
export interface ReplaceHumanRequestRequest {
|
|
89
|
+
page: HumanRequestPageDTO;
|
|
90
|
+
delivery?: HumanRequestDeliveryDTO;
|
|
91
|
+
}
|
|
92
|
+
export interface RespondHumanRequestRequest {
|
|
93
|
+
responses: PageResponsesDTO;
|
|
94
|
+
actor?: string;
|
|
95
|
+
}
|
|
96
|
+
export interface SettleHumanRequestRequest {
|
|
97
|
+
reason?: string;
|
|
98
|
+
actor?: string;
|
|
99
|
+
}
|
|
100
|
+
/** One product page component registered by config or an enabled plugin. */
|
|
101
|
+
export interface PageComponentDTO {
|
|
102
|
+
kind: string;
|
|
103
|
+
description?: string;
|
|
104
|
+
useWhen?: string;
|
|
105
|
+
doc?: string;
|
|
106
|
+
/** A display-only product slot contributes no page response. */
|
|
107
|
+
display?: boolean;
|
|
108
|
+
}
|
|
109
|
+
/** `GET /v1/human/components` — the product page components the runtime's
|
|
110
|
+
* config and enabled plugins register, merged in precedence order. */
|
|
111
|
+
export interface PageComponentListDTO {
|
|
112
|
+
components: PageComponentDTO[];
|
|
113
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/** One anchored review comment, mirroring crouter's canonical review result. */
|
|
2
|
+
export interface FeedbackCommentDTO {
|
|
3
|
+
id: string;
|
|
4
|
+
line: number;
|
|
5
|
+
endLine: number;
|
|
6
|
+
quote?: string;
|
|
7
|
+
colStart?: number;
|
|
8
|
+
colEnd?: number;
|
|
9
|
+
lineText: string;
|
|
10
|
+
comment: string;
|
|
11
|
+
createdAt: string;
|
|
12
|
+
}
|
|
13
|
+
/** Immutable daemon-projected review approval result. */
|
|
14
|
+
export interface FeedbackResultDTO {
|
|
15
|
+
file: string;
|
|
16
|
+
submitted: true;
|
|
17
|
+
approved: true;
|
|
18
|
+
comments: FeedbackCommentDTO[];
|
|
19
|
+
submittedAt: string;
|
|
20
|
+
savedAt: string;
|
|
21
|
+
reviewId: string;
|
|
22
|
+
changed: boolean;
|
|
23
|
+
baselineSha256: string;
|
|
24
|
+
approvedSha256: string;
|
|
25
|
+
companionNodeId: string;
|
|
26
|
+
commentsTotal: number;
|
|
27
|
+
commentsUnresolved: number;
|
|
28
|
+
}
|
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
import type { IsoTime } from './common.js';
|
|
2
|
+
/** Opaque, stable, URL-safe ticket id: lowercase SHA-256 hex. */
|
|
3
|
+
export type InboxTicketIdDTO = string;
|
|
4
|
+
export interface TicketSourceDTO {
|
|
5
|
+
sessionName?: string;
|
|
6
|
+
askedBy?: string;
|
|
7
|
+
blockedSince?: IsoTime;
|
|
8
|
+
emittedAt?: IsoTime;
|
|
9
|
+
profileName?: string;
|
|
10
|
+
nodeId?: string;
|
|
11
|
+
}
|
|
12
|
+
export interface ReviewTicketSummaryDTO {
|
|
13
|
+
/** Request identity for direct request/review routes. */
|
|
14
|
+
request_id: string;
|
|
15
|
+
/** Daemon-owned projection directory. */
|
|
16
|
+
request_dir: string;
|
|
17
|
+
ticket_id: InboxTicketIdDTO;
|
|
18
|
+
kind: 'review';
|
|
19
|
+
title: string;
|
|
20
|
+
subtitle: string;
|
|
21
|
+
blocked_since: IsoTime;
|
|
22
|
+
source: TicketSourceDTO;
|
|
23
|
+
}
|
|
24
|
+
/** One question's recommended option, flat on the wire like every other summary field. */
|
|
25
|
+
export interface RecommendedOptionDTO {
|
|
26
|
+
slot_id: string;
|
|
27
|
+
option_id: string;
|
|
28
|
+
label: string;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* What one keypress on an inbox row publishes. `responses` is a complete final response
|
|
32
|
+
* map this daemon already accepts for the ticket, so a client publishes it untouched
|
|
33
|
+
* rather than assembling one from the summary.
|
|
34
|
+
*/
|
|
35
|
+
export interface PageFastActionDTO {
|
|
36
|
+
kind: 'answer' | 'acknowledge';
|
|
37
|
+
responses: PageResponsesDTO;
|
|
38
|
+
}
|
|
39
|
+
export interface PageTicketSummaryDTO {
|
|
40
|
+
/** Request identity for direct request routes. */
|
|
41
|
+
request_id: string;
|
|
42
|
+
/** Daemon-owned projection directory. */
|
|
43
|
+
request_dir: string;
|
|
44
|
+
ticket_id: InboxTicketIdDTO;
|
|
45
|
+
kind: 'page';
|
|
46
|
+
title: string;
|
|
47
|
+
subtitle?: string;
|
|
48
|
+
placement: 'inline' | 'panel';
|
|
49
|
+
dialect: 'jsx' | 'html';
|
|
50
|
+
inbox: boolean;
|
|
51
|
+
steps: number;
|
|
52
|
+
emitted_at: IsoTime;
|
|
53
|
+
source: TicketSourceDTO;
|
|
54
|
+
slot_kinds: string[];
|
|
55
|
+
/** The ticket is waiting on the person: it asks something, or an agent bridge is parked on its reply. Not a writability gate — any pending, non-passive ticket accepts a response. */
|
|
56
|
+
awaits_response: boolean;
|
|
57
|
+
/** Omitted when no question recommends an option. */
|
|
58
|
+
recommended_options?: RecommendedOptionDTO[];
|
|
59
|
+
/** Present only on a pending ticket that a row can settle without opening it. */
|
|
60
|
+
fast_action?: PageFastActionDTO;
|
|
61
|
+
state: 'pending' | 'resolved' | 'canceled' | 'passive';
|
|
62
|
+
/** Present only on resolved history entries; the stored one-line answer digest. */
|
|
63
|
+
answer_digest?: string;
|
|
64
|
+
}
|
|
65
|
+
export type InboxTicketSummaryDTO = PageTicketSummaryDTO | ReviewTicketSummaryDTO;
|
|
66
|
+
export interface InboxListDTO {
|
|
67
|
+
tickets: InboxTicketSummaryDTO[];
|
|
68
|
+
}
|
|
69
|
+
export interface PageSlotDTO {
|
|
70
|
+
id?: string;
|
|
71
|
+
kind: string;
|
|
72
|
+
step: number;
|
|
73
|
+
config: Record<string, unknown>;
|
|
74
|
+
unvalidated?: true;
|
|
75
|
+
display?: true;
|
|
76
|
+
}
|
|
77
|
+
/** The nested protocol object is deliberately camelCase on the wire. */
|
|
78
|
+
export interface PageManifestDTO {
|
|
79
|
+
schema: 'crtr.page/v2';
|
|
80
|
+
dialect: 'jsx' | 'html';
|
|
81
|
+
title: string;
|
|
82
|
+
subtitle?: string;
|
|
83
|
+
delivery: {
|
|
84
|
+
placement: 'inline' | 'panel';
|
|
85
|
+
inbox: boolean;
|
|
86
|
+
reply: boolean;
|
|
87
|
+
};
|
|
88
|
+
document: 'page.tsx' | 'page.html';
|
|
89
|
+
steps: number;
|
|
90
|
+
slots: PageSlotDTO[];
|
|
91
|
+
source?: TicketSourceDTO;
|
|
92
|
+
}
|
|
93
|
+
/** Answer-annotation anchors: option on UserQuestion, row on UserTable.
|
|
94
|
+
* Feedback on other page content — including the question text — is a
|
|
95
|
+
* ticket-level feedback comment, never a response anchor. */
|
|
96
|
+
export interface PageCommentAnchorDTO {
|
|
97
|
+
kind: 'option' | 'row';
|
|
98
|
+
optionId?: string;
|
|
99
|
+
rowId?: string;
|
|
100
|
+
}
|
|
101
|
+
export interface PageCommentDTO {
|
|
102
|
+
id: string;
|
|
103
|
+
anchor: PageCommentAnchorDTO;
|
|
104
|
+
text: string;
|
|
105
|
+
}
|
|
106
|
+
export interface PageOptionsResponseDTO {
|
|
107
|
+
selectedOptionIds: string[];
|
|
108
|
+
comments: PageCommentDTO[];
|
|
109
|
+
freetext?: string;
|
|
110
|
+
}
|
|
111
|
+
export interface PageTextResponseDTO {
|
|
112
|
+
text: string;
|
|
113
|
+
edited: boolean;
|
|
114
|
+
}
|
|
115
|
+
export interface PageTableResponseDTO {
|
|
116
|
+
selectedRowIds: string[];
|
|
117
|
+
selectedColumnIds: string[];
|
|
118
|
+
comments: PageCommentDTO[];
|
|
119
|
+
}
|
|
120
|
+
export interface PageCardsResponseDTO {
|
|
121
|
+
selectedCardIds: string[];
|
|
122
|
+
}
|
|
123
|
+
export type SlotResponseDTO = PageOptionsResponseDTO | PageTextResponseDTO | PageTableResponseDTO | PageCardsResponseDTO | Record<string, unknown>;
|
|
124
|
+
export type PageResponsesDTO = Record<string, SlotResponseDTO>;
|
|
125
|
+
export interface InboxPageDTO {
|
|
126
|
+
ticket_id: InboxTicketIdDTO;
|
|
127
|
+
kind: 'page';
|
|
128
|
+
state: 'pending' | 'resolved' | 'canceled' | 'passive';
|
|
129
|
+
/** Opaque SQL-selected immutable presentation revision. */
|
|
130
|
+
revision: string;
|
|
131
|
+
page: PageManifestDTO;
|
|
132
|
+
/** JSX is compiled for the host; HTML is the authored document verbatim. */
|
|
133
|
+
document: string;
|
|
134
|
+
/** Authored JSX or HTML, distinct from the compiled JSX host document. */
|
|
135
|
+
source_document: string;
|
|
136
|
+
document_media_type: 'text/jsx' | 'text/html';
|
|
137
|
+
progress: {
|
|
138
|
+
responses: PageResponsesDTO;
|
|
139
|
+
} | null;
|
|
140
|
+
/** Canonical stored terminal result, or null while the ticket remains open. */
|
|
141
|
+
result: PageTicketResultDTO | CanceledTicketResultDTO | null;
|
|
142
|
+
/** Ticket-attached feedback comments and the companion conversation they
|
|
143
|
+
* deliver to. Comments are immutable once sent — open until the companion
|
|
144
|
+
* resolves them. */
|
|
145
|
+
feedback: PageFeedbackDTO;
|
|
146
|
+
}
|
|
147
|
+
export interface PageFeedbackCommentDTO {
|
|
148
|
+
id: string;
|
|
149
|
+
/** The highlighted text the note is about; for a chart, its title. */
|
|
150
|
+
quote: string;
|
|
151
|
+
/** Surrounding text that locates the quote on the page. */
|
|
152
|
+
context?: string;
|
|
153
|
+
note: string;
|
|
154
|
+
/** Open until the companion has dealt with it; resolution is terminal. */
|
|
155
|
+
status: 'open' | 'resolved';
|
|
156
|
+
created_at: IsoTime;
|
|
157
|
+
resolved_at?: IsoTime;
|
|
158
|
+
}
|
|
159
|
+
export interface PageFeedbackDTO {
|
|
160
|
+
/** The ticket-bound companion conversation comments deliver to; null until
|
|
161
|
+
* the first comment realizes it. */
|
|
162
|
+
companion_node_id: string | null;
|
|
163
|
+
/** How many comments remain open. Zero once feedback exists is the ticket's
|
|
164
|
+
* authoritative signal that the companion has dealt with all of it. */
|
|
165
|
+
open_count: number;
|
|
166
|
+
comments: PageFeedbackCommentDTO[];
|
|
167
|
+
}
|
|
168
|
+
/** `POST /v1/human/inbox/:ticket_id/feedback-comments` body. */
|
|
169
|
+
export interface CreatePageFeedbackCommentRequest {
|
|
170
|
+
quote: string;
|
|
171
|
+
context?: string;
|
|
172
|
+
note: string;
|
|
173
|
+
}
|
|
174
|
+
export interface PageFeedbackDeliveryDTO {
|
|
175
|
+
target_node_id: string;
|
|
176
|
+
status: 'delivered' | 'failed';
|
|
177
|
+
via?: 'engine' | 'inbox';
|
|
178
|
+
woke: boolean;
|
|
179
|
+
reason?: 'capacity_frozen';
|
|
180
|
+
error?: string;
|
|
181
|
+
}
|
|
182
|
+
/** Create result: the new comment, the ticket's full feedback state after it,
|
|
183
|
+
* and the delivery outcome in the companion conversation. */
|
|
184
|
+
export interface PageFeedbackMutationDTO {
|
|
185
|
+
comment: PageFeedbackCommentDTO;
|
|
186
|
+
feedback: PageFeedbackDTO;
|
|
187
|
+
delivery: PageFeedbackDeliveryDTO;
|
|
188
|
+
}
|
|
189
|
+
/** `POST .../feedback-comments/:comment_id/resolve` request. Resolution is
|
|
190
|
+
* companion-only: `node_id` names the calling node and must equal the
|
|
191
|
+
* ticket's bound companion. */
|
|
192
|
+
export interface ResolvePageFeedbackCommentRequest {
|
|
193
|
+
node_id: string;
|
|
194
|
+
}
|
|
195
|
+
/** `POST .../feedback-comments/:comment_id/resolve` result. Resolution appends
|
|
196
|
+
* no chat turn; the companion's own conversational report covers it. */
|
|
197
|
+
export interface PageFeedbackResolutionDTO {
|
|
198
|
+
comment: PageFeedbackCommentDTO;
|
|
199
|
+
feedback: PageFeedbackDTO;
|
|
200
|
+
}
|
|
201
|
+
export interface InboxPageHistoryDTO {
|
|
202
|
+
tickets: PageTicketSummaryDTO[];
|
|
203
|
+
}
|
|
204
|
+
export interface RespondInboxPageRequest {
|
|
205
|
+
responses: PageResponsesDTO;
|
|
206
|
+
}
|
|
207
|
+
export interface InboxPageProgressDTO {
|
|
208
|
+
responses: PageResponsesDTO;
|
|
209
|
+
}
|
|
210
|
+
export interface PageTicketResultDTO {
|
|
211
|
+
schema: 'crtr.page-response/v1';
|
|
212
|
+
kind: 'page';
|
|
213
|
+
responses: PageResponsesDTO;
|
|
214
|
+
summary: string;
|
|
215
|
+
completedAt: IsoTime;
|
|
216
|
+
}
|
|
217
|
+
export interface PageAnswerGroupDTO {
|
|
218
|
+
group: 'option' | 'card' | 'row' | 'column';
|
|
219
|
+
mode: 'single' | 'multi';
|
|
220
|
+
total: number;
|
|
221
|
+
picked: {
|
|
222
|
+
id: string;
|
|
223
|
+
label: string;
|
|
224
|
+
}[];
|
|
225
|
+
}
|
|
226
|
+
export interface PageAnswerCommentDTO {
|
|
227
|
+
/** Legacy stored responses may still carry the retired `whole` anchor. */
|
|
228
|
+
anchor: PageCommentAnchorDTO | {
|
|
229
|
+
kind: 'whole';
|
|
230
|
+
};
|
|
231
|
+
anchorLabel: string;
|
|
232
|
+
text: string;
|
|
233
|
+
}
|
|
234
|
+
export interface PageAnswerSlotDTO {
|
|
235
|
+
id: string;
|
|
236
|
+
kind: string;
|
|
237
|
+
label?: string;
|
|
238
|
+
state: 'answered' | 'unanswered';
|
|
239
|
+
blank: boolean;
|
|
240
|
+
groups: PageAnswerGroupDTO[];
|
|
241
|
+
freetext?: string;
|
|
242
|
+
text?: {
|
|
243
|
+
value: string;
|
|
244
|
+
edited: boolean;
|
|
245
|
+
singleLine?: boolean;
|
|
246
|
+
};
|
|
247
|
+
comments: PageAnswerCommentDTO[];
|
|
248
|
+
raw?: Record<string, unknown>;
|
|
249
|
+
}
|
|
250
|
+
/** The camelCase protocol object shipped only by GET .../response. */
|
|
251
|
+
export interface PageAnswerDTO {
|
|
252
|
+
title: string;
|
|
253
|
+
subtitle?: string;
|
|
254
|
+
completedAt: IsoTime;
|
|
255
|
+
kind: 'answer' | 'acknowledgement';
|
|
256
|
+
digest: string;
|
|
257
|
+
slots: PageAnswerSlotDTO[];
|
|
258
|
+
}
|
|
259
|
+
export interface InboxPageResponseDTO extends PageTicketResultDTO {
|
|
260
|
+
answer: PageAnswerDTO;
|
|
261
|
+
}
|
|
262
|
+
/** `POST /v1/human/inbox/:ticket_id/cancel` body. */
|
|
263
|
+
export interface CancelInboxTicketRequest {
|
|
264
|
+
reason?: string;
|
|
265
|
+
}
|
|
266
|
+
/** `POST /v1/human/inbox/:ticket_id/cancel` result. */
|
|
267
|
+
export interface CanceledTicketResultDTO {
|
|
268
|
+
schema: 'humanloop.cancel/v1';
|
|
269
|
+
kind: 'canceled';
|
|
270
|
+
canceledAt: IsoTime;
|
|
271
|
+
reason?: string;
|
|
272
|
+
actor?: string;
|
|
273
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import type { NodeIdDTO, NodeStatusDTO } from './common.js';
|
|
2
|
+
/** `POST /v1/nodes/{id}/revive` body. */
|
|
3
|
+
export interface ReviveRequest {
|
|
4
|
+
/** Resume the saved conversation (true) vs a fresh launch (false). */
|
|
5
|
+
resume?: boolean;
|
|
6
|
+
/** Clear the finalization latch before reviving (the `--reopen` gate). The
|
|
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. */
|
|
10
|
+
reopen?: boolean;
|
|
11
|
+
/** Wake provenance: the cron whose run drove this revive (`CRTR_CRON_ID`,
|
|
12
|
+
* set by the daemon in every cron run's environment and forwarded by the
|
|
13
|
+
* CLI). With `resume:false` and a still-live cron row, crtrd injects the
|
|
14
|
+
* `<crtr-wake>` block so the revived node learns a CLOCK woke it, not a
|
|
15
|
+
* message. Prose only — an unknown id is ignored, never an error. */
|
|
16
|
+
cron_id?: string;
|
|
17
|
+
}
|
|
18
|
+
/** Result of a revive. `revived` is false on the idempotent double-revive no-op. */
|
|
19
|
+
export interface ReviveResultDTO {
|
|
20
|
+
node_id: NodeIdDTO;
|
|
21
|
+
revived: boolean;
|
|
22
|
+
resumed: boolean;
|
|
23
|
+
status: NodeStatusDTO;
|
|
24
|
+
/** What the call did: `launched` started a broker, `already-live` found one
|
|
25
|
+
* already running, `frozen` found no free broker slot and left the row
|
|
26
|
+
* waiting for one. */
|
|
27
|
+
outcome: 'launched' | 'already-live' | 'frozen';
|
|
28
|
+
}
|
|
29
|
+
/** `POST /v1/nodes/{id}/relaunch-root` result. A null id means the target
|
|
30
|
+
* was not a relaunchable live root, or its replacement failed to launch. */
|
|
31
|
+
export interface RelaunchRootResultDTO {
|
|
32
|
+
newNodeId: NodeIdDTO | null;
|
|
33
|
+
}
|
|
34
|
+
/** `POST /v1/nodes/revive-all` result. Node ids relaunched, any that failed to
|
|
35
|
+
* revive with the reason, and any the broker cap turned away (the reader
|
|
36
|
+
* reports all three). */
|
|
37
|
+
export interface ReviveAllResultDTO {
|
|
38
|
+
revived: NodeIdDTO[];
|
|
39
|
+
failed: {
|
|
40
|
+
node_id: NodeIdDTO;
|
|
41
|
+
error: string;
|
|
42
|
+
}[];
|
|
43
|
+
/** Frozen for capacity, not failed: the daemon relaunches these as slots free. */
|
|
44
|
+
frozen: NodeIdDTO[];
|
|
45
|
+
}
|
|
46
|
+
/** `POST /v1/nodes/{id}/close` body. The cascade set is computed server-side
|
|
47
|
+
* from edges; the flag only opts out of cascading descendants. */
|
|
48
|
+
export interface CloseRequest {
|
|
49
|
+
cascade?: boolean;
|
|
50
|
+
/** PID of the shell that invoked this close. The daemon excludes this process
|
|
51
|
+
* and its descendants from broker teardown so a node can close itself. */
|
|
52
|
+
caller_pid?: number;
|
|
53
|
+
/** Root close disposition: `true` finalizes the root to `done` (the browse `x`
|
|
54
|
+
* "finish" semantics); default/`false` cancels it. The cascade set (computed
|
|
55
|
+
* server-side) is torn down either way. */
|
|
56
|
+
finish?: boolean;
|
|
57
|
+
}
|
|
58
|
+
/** Result of a close. */
|
|
59
|
+
export interface CloseResultDTO {
|
|
60
|
+
/** The closed node — the cascade root. */
|
|
61
|
+
root: NodeIdDTO;
|
|
62
|
+
/** Every node torn down (root + cascaded descendants), leaves-first. */
|
|
63
|
+
closed: NodeIdDTO[];
|
|
64
|
+
/** Descendants left alive because an out-of-subtree manager still subscribes. */
|
|
65
|
+
spared: NodeIdDTO[];
|
|
66
|
+
}
|
|
67
|
+
/** `POST /v1/nodes/{id}/promote` body. */
|
|
68
|
+
export interface PromoteRequest {
|
|
69
|
+
/** Specialize as this kind of orchestrator; defaults to the node's current kind. */
|
|
70
|
+
kind?: string;
|
|
71
|
+
/** Also flip lifecycle→resident (interactable). */
|
|
72
|
+
resident?: boolean;
|
|
73
|
+
/** Durably change the model tier (ultra|strong). */
|
|
74
|
+
model?: string;
|
|
75
|
+
}
|
|
76
|
+
/** `POST /v1/nodes/{id}/yield` body. */
|
|
77
|
+
export interface YieldRequest {
|
|
78
|
+
note?: string;
|
|
79
|
+
promote?: boolean;
|
|
80
|
+
/** Respecialize the kind as the node refreshes. */
|
|
81
|
+
kind?: string;
|
|
82
|
+
/** Durably raise the model tier (ultra|strong) for the fresh revive. */
|
|
83
|
+
model?: string;
|
|
84
|
+
}
|
|
85
|
+
/** `POST /v1/nodes/{id}/wait` body. */
|
|
86
|
+
export interface WaitRequest {
|
|
87
|
+
controller: NodeIdDTO;
|
|
88
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/** One app's effective caps. A null cap means the app has none of its own. */
|
|
2
|
+
export interface AppLimitsDTO {
|
|
3
|
+
app: string;
|
|
4
|
+
memory_bytes: number | null;
|
|
5
|
+
disk_bytes: number | null;
|
|
6
|
+
memory_source: 'default' | 'override';
|
|
7
|
+
disk_source: 'default' | 'override';
|
|
8
|
+
/** Bytes the app's project quota counts now, or null when disk quota is off. */
|
|
9
|
+
disk_used_bytes: number | null;
|
|
10
|
+
}
|
|
11
|
+
export interface LimitsDTO {
|
|
12
|
+
/** False when this host cannot enforce the limit; `reason` says why. Caps are still recorded. */
|
|
13
|
+
memory_enforced: boolean;
|
|
14
|
+
memory_reason: string | null;
|
|
15
|
+
disk_enforced: boolean;
|
|
16
|
+
disk_reason: string | null;
|
|
17
|
+
apps: AppLimitsDTO[];
|
|
18
|
+
}
|
|
19
|
+
/** `PUT /v1/limits/apps/{app}`: omitted fields stay as they were. A value is a byte count or `unlimited`. */
|
|
20
|
+
export interface SetAppLimitsRequest {
|
|
21
|
+
memory_bytes?: number | 'unlimited';
|
|
22
|
+
disk_bytes?: number | 'unlimited';
|
|
23
|
+
}
|
|
24
|
+
export interface AppLimitsChangeDTO {
|
|
25
|
+
app: string;
|
|
26
|
+
/** True when the launcher wrote the new caps to the running host; false when the host has no launcher. */
|
|
27
|
+
applied: boolean;
|
|
28
|
+
limits: AppLimitsDTO;
|
|
29
|
+
}
|