@ricsam/r5d-worker 0.0.136 → 0.0.138
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/README.md +4 -94
- package/dist/cjs/package.json +1 -1
- package/dist/mjs/main.mjs +46 -7537
- package/dist/mjs/package.json +1 -1
- package/dist/mjs/personal/action-scheduler.mjs +31 -0
- package/dist/mjs/personal/client.mjs +215 -0
- package/dist/mjs/personal/runtime.mjs +328 -0
- package/dist/mjs/personal/tcp.mjs +217 -0
- package/dist/mjs/runtime/adapter.mjs +42 -0
- package/dist/mjs/runtime/client.mjs +95 -0
- package/dist/mjs/runtime/daemon.mjs +131 -0
- package/dist/mjs/runtime/executor.mjs +436 -0
- package/dist/mjs/runtime/index.mjs +15 -0
- package/dist/mjs/runtime/protocol.mjs +139 -0
- package/dist/mjs/runtime/pty-host.mjs +156 -0
- package/dist/mjs/runtime/pty.mjs +127 -0
- package/dist/mjs/runtime/releases/artifacts.mjs +201 -0
- package/dist/mjs/runtime/releases/grants.mjs +93 -0
- package/dist/mjs/runtime/releases/main.mjs +101 -0
- package/dist/mjs/runtime/releases/manager.mjs +541 -0
- package/dist/mjs/runtime/releases/process.mjs +88 -0
- package/dist/mjs/runtime/releases/retirement.mjs +18 -0
- package/dist/mjs/runtime/releases/rpc-client.mjs +184 -0
- package/dist/mjs/runtime/releases/rpc-main.mjs +213 -0
- package/dist/mjs/runtime/releases/rpc-protocol.mjs +103 -0
- package/dist/mjs/runtime/storage.mjs +156 -0
- package/dist/mjs/runtime/workspace/artifacts.mjs +121 -0
- package/dist/mjs/runtime/workspace/authority.mjs +1355 -0
- package/dist/mjs/runtime/workspace/contracts.mjs +60 -0
- package/dist/mjs/runtime/workspace/file-write.mjs +23 -0
- package/dist/mjs/runtime/workspace/files.mjs +308 -0
- package/dist/mjs/runtime/workspace/http-body.mjs +45 -0
- package/dist/mjs/runtime/workspace/storage-client.mjs +59 -0
- package/dist/mjs/runtime/workspace/storage-wire.mjs +53 -0
- package/dist/types/main.d.ts +0 -1167
- package/dist/types/personal/action-scheduler.d.ts +23 -0
- package/dist/types/personal/client.d.ts +14 -0
- package/dist/types/personal/runtime.d.ts +121 -0
- package/dist/types/personal/tcp.d.ts +14 -0
- package/dist/types/runtime/client.d.ts +17 -0
- package/dist/types/runtime/daemon.d.ts +8 -0
- package/dist/types/runtime/executor.d.ts +35 -0
- package/dist/types/runtime/index.d.ts +5 -0
- package/dist/types/runtime/protocol.d.ts +544 -0
- package/dist/types/runtime/pty.d.ts +30 -0
- package/dist/types/runtime/releases/artifacts.d.ts +51 -0
- package/dist/types/runtime/releases/grants.d.ts +16 -0
- package/dist/types/runtime/releases/manager.d.ts +145 -0
- package/dist/types/runtime/releases/process.d.ts +14 -0
- package/dist/types/runtime/releases/retirement.d.ts +15 -0
- package/dist/types/runtime/releases/rpc-client.d.ts +52 -0
- package/dist/types/runtime/releases/rpc-main.d.ts +10 -0
- package/dist/types/runtime/releases/rpc-protocol.d.ts +1139 -0
- package/dist/types/runtime/storage.d.ts +21 -0
- package/dist/types/runtime/test-harness.d.ts +53 -0
- package/dist/types/runtime/workspace/artifacts.d.ts +30 -0
- package/dist/types/runtime/workspace/authority.d.ts +338 -0
- package/dist/types/runtime/workspace/contracts.d.ts +86 -0
- package/dist/types/runtime/workspace/file-write.d.ts +14 -0
- package/dist/types/runtime/workspace/files.d.ts +21 -0
- package/dist/types/runtime/workspace/http-body.d.ts +9 -0
- package/dist/types/runtime/workspace/storage-client.d.ts +23 -0
- package/dist/types/runtime/workspace/storage-wire.d.ts +138 -0
- package/package.json +8 -6
- package/dist/cjs/atomic-rename.cjs +0 -303
- package/dist/cjs/browser-upload.cjs +0 -73
- package/dist/cjs/cli-update.cjs +0 -108
- package/dist/cjs/command-launcher.cjs +0 -423
- package/dist/cjs/control-command-policy.cjs +0 -177
- package/dist/cjs/git-blob-hash.cjs +0 -41
- package/dist/cjs/git-identity.cjs +0 -39
- package/dist/cjs/git-process-environment.cjs +0 -133
- package/dist/cjs/inline-output.cjs +0 -62
- package/dist/cjs/main.cjs +0 -7511
- package/dist/cjs/managed-paths.cjs +0 -215
- package/dist/cjs/plan-lint.cjs +0 -165
- package/dist/cjs/plan-parser.cjs +0 -127
- package/dist/cjs/plan-paths.cjs +0 -53
- package/dist/cjs/port-forward-client.cjs +0 -206
- package/dist/cjs/process-tree.cjs +0 -117
- package/dist/cjs/project-checkout-garbage.cjs +0 -219
- package/dist/cjs/project-mirror-fetch-policy.cjs +0 -82
- package/dist/cjs/project-mirror-refs-token.cjs +0 -85
- package/dist/cjs/project-workspace-state.cjs +0 -972
- package/dist/cjs/project-worktrees.cjs +0 -1713
- package/dist/cjs/pty-output-coalescer.cjs +0 -87
- package/dist/cjs/recovery-journal-protocol.cjs +0 -56
- package/dist/cjs/recovery-journal-runtime.cjs +0 -133
- package/dist/cjs/recovery-journal-thread.cjs +0 -9
- package/dist/cjs/recovery-journal.cjs +0 -742
- package/dist/cjs/recovery-output-window.cjs +0 -77
- package/dist/cjs/recovery-protocol.cjs +0 -31
- package/dist/cjs/recovery-store.cjs +0 -252
- package/dist/cjs/registry-auth.cjs +0 -310
- package/dist/cjs/repository-transition-policy.cjs +0 -49
- package/dist/cjs/runtime-version.cjs +0 -88
- package/dist/cjs/session-file-mutations.cjs +0 -61
- package/dist/cjs/supervisor.cjs +0 -147
- package/dist/cjs/three-way-merge.cjs +0 -346
- package/dist/cjs/working-tree-mirror.cjs +0 -1872
- package/dist/cjs/workspace-automatic-sync-policy.cjs +0 -79
- package/dist/cjs/workspace-branch-incarnation-policy.cjs +0 -37
- package/dist/cjs/workspace-command-sync-policy.cjs +0 -112
- package/dist/cjs/workspace-command-targets.cjs +0 -63
- package/dist/cjs/workspace-filesystem-executor-thread.cjs +0 -36
- package/dist/cjs/workspace-filesystem-executor.cjs +0 -327
- package/dist/cjs/workspace-filesystem-job-types.cjs +0 -144
- package/dist/cjs/workspace-filesystem-jobs.cjs +0 -59
- package/dist/cjs/workspace-git-sync.cjs +0 -3450
- package/dist/cjs/workspace-hydration-ledger.cjs +0 -66
- package/dist/cjs/workspace-hydration-merge.cjs +0 -433
- package/dist/cjs/workspace-hydration-recovery-state.cjs +0 -53
- package/dist/cjs/workspace-incident-state.cjs +0 -37
- package/dist/cjs/workspace-merge-projection.cjs +0 -467
- package/dist/cjs/workspace-mount-boundary.cjs +0 -71
- package/dist/cjs/workspace-mount-hold-fence.cjs +0 -120
- package/dist/cjs/workspace-mutation-gate.cjs +0 -127
- package/dist/cjs/workspace-path-move.cjs +0 -195
- package/dist/cjs/workspace-preserve-only-policy.cjs +0 -36
- package/dist/cjs/workspace-project-config-policy.cjs +0 -53
- package/dist/cjs/workspace-projection-ledger.cjs +0 -81
- package/dist/cjs/workspace-publication-evidence.cjs +0 -46
- package/dist/cjs/workspace-sync-coalescer.cjs +0 -58
- package/dist/mjs/atomic-rename.mjs +0 -261
- package/dist/mjs/browser-upload.mjs +0 -42
- package/dist/mjs/command-launcher.mjs +0 -393
- package/dist/mjs/control-command-policy.mjs +0 -146
- package/dist/mjs/git-blob-hash.mjs +0 -16
- package/dist/mjs/git-identity.mjs +0 -15
- package/dist/mjs/git-process-environment.mjs +0 -105
- package/dist/mjs/inline-output.mjs +0 -37
- package/dist/mjs/managed-paths.mjs +0 -174
- package/dist/mjs/plan-lint.mjs +0 -129
- package/dist/mjs/plan-parser.mjs +0 -94
- package/dist/mjs/plan-paths.mjs +0 -25
- package/dist/mjs/port-forward-client.mjs +0 -172
- package/dist/mjs/project-checkout-garbage.mjs +0 -178
- package/dist/mjs/project-mirror-fetch-policy.mjs +0 -56
- package/dist/mjs/project-mirror-refs-token.mjs +0 -53
- package/dist/mjs/project-workspace-state.mjs +0 -937
- package/dist/mjs/project-worktrees.mjs +0 -1657
- package/dist/mjs/pty-output-coalescer.mjs +0 -61
- package/dist/mjs/recovery-journal-protocol.mjs +0 -30
- package/dist/mjs/recovery-journal-runtime.mjs +0 -112
- package/dist/mjs/recovery-journal-thread.mjs +0 -8
- package/dist/mjs/recovery-journal.mjs +0 -694
- package/dist/mjs/recovery-output-window.mjs +0 -53
- package/dist/mjs/recovery-protocol.mjs +0 -6
- package/dist/mjs/recovery-store.mjs +0 -217
- package/dist/mjs/registry-auth.mjs +0 -269
- package/dist/mjs/repository-transition-policy.mjs +0 -22
- package/dist/mjs/runtime-version.mjs +0 -54
- package/dist/mjs/session-file-mutations.mjs +0 -37
- package/dist/mjs/supervisor.mjs +0 -114
- package/dist/mjs/three-way-merge.mjs +0 -318
- package/dist/mjs/working-tree-mirror.mjs +0 -1817
- package/dist/mjs/workspace-automatic-sync-policy.mjs +0 -48
- package/dist/mjs/workspace-branch-incarnation-policy.mjs +0 -13
- package/dist/mjs/workspace-command-sync-policy.mjs +0 -84
- package/dist/mjs/workspace-command-targets.mjs +0 -37
- package/dist/mjs/workspace-filesystem-executor-thread.mjs +0 -38
- package/dist/mjs/workspace-filesystem-executor.mjs +0 -287
- package/dist/mjs/workspace-filesystem-job-types.mjs +0 -116
- package/dist/mjs/workspace-filesystem-jobs.mjs +0 -55
- package/dist/mjs/workspace-git-sync.mjs +0 -3407
- package/dist/mjs/workspace-hydration-ledger.mjs +0 -42
- package/dist/mjs/workspace-hydration-merge.mjs +0 -399
- package/dist/mjs/workspace-hydration-recovery-state.mjs +0 -29
- package/dist/mjs/workspace-incident-state.mjs +0 -12
- package/dist/mjs/workspace-merge-projection.mjs +0 -433
- package/dist/mjs/workspace-mount-boundary.mjs +0 -37
- package/dist/mjs/workspace-mount-hold-fence.mjs +0 -95
- package/dist/mjs/workspace-mutation-gate.mjs +0 -103
- package/dist/mjs/workspace-path-move.mjs +0 -160
- package/dist/mjs/workspace-preserve-only-policy.mjs +0 -11
- package/dist/mjs/workspace-project-config-policy.mjs +0 -27
- package/dist/mjs/workspace-projection-ledger.mjs +0 -57
- package/dist/mjs/workspace-publication-evidence.mjs +0 -21
- package/dist/mjs/workspace-sync-coalescer.mjs +0 -34
- package/dist/types/atomic-rename.d.ts +0 -78
- package/dist/types/browser-upload.d.ts +0 -7
- package/dist/types/command-launcher.d.ts +0 -104
- package/dist/types/control-command-policy.d.ts +0 -53
- package/dist/types/git-blob-hash.d.ts +0 -10
- package/dist/types/git-identity.d.ts +0 -9
- package/dist/types/git-process-environment.d.ts +0 -9
- package/dist/types/inline-output.d.ts +0 -3
- package/dist/types/managed-paths.d.ts +0 -19
- package/dist/types/plan-lint.d.ts +0 -16
- package/dist/types/plan-parser.d.ts +0 -38
- package/dist/types/plan-paths.d.ts +0 -36
- package/dist/types/port-forward-client.d.ts +0 -8
- package/dist/types/project-checkout-garbage.d.ts +0 -86
- package/dist/types/project-mirror-fetch-policy.d.ts +0 -84
- package/dist/types/project-mirror-refs-token.d.ts +0 -53
- package/dist/types/project-workspace-state.d.ts +0 -188
- package/dist/types/project-worktrees.d.ts +0 -397
- package/dist/types/pty-output-coalescer.d.ts +0 -20
- package/dist/types/recovery-journal-protocol.d.ts +0 -35
- package/dist/types/recovery-journal-runtime.d.ts +0 -12
- package/dist/types/recovery-journal-thread.d.ts +0 -1
- package/dist/types/recovery-journal.d.ts +0 -248
- package/dist/types/recovery-output-window.d.ts +0 -19
- package/dist/types/recovery-protocol.d.ts +0 -59
- package/dist/types/recovery-store.d.ts +0 -52
- package/dist/types/registry-auth.d.ts +0 -47
- package/dist/types/repository-transition-policy.d.ts +0 -26
- package/dist/types/runtime-version.d.ts +0 -1
- package/dist/types/session-file-mutations.d.ts +0 -22
- package/dist/types/supervisor-daemonized-fixture.d.ts +0 -1
- package/dist/types/supervisor-launcher-cleanup-fixture.d.ts +0 -1
- package/dist/types/supervisor-signal-fixture.d.ts +0 -1
- package/dist/types/supervisor.d.ts +0 -23
- package/dist/types/three-way-merge.d.ts +0 -77
- package/dist/types/working-tree-mirror.d.ts +0 -424
- package/dist/types/workspace-automatic-sync-policy.d.ts +0 -57
- package/dist/types/workspace-branch-incarnation-policy.d.ts +0 -14
- package/dist/types/workspace-command-sync-policy.d.ts +0 -57
- package/dist/types/workspace-command-targets.d.ts +0 -37
- package/dist/types/workspace-filesystem-executor-thread.d.ts +0 -1
- package/dist/types/workspace-filesystem-executor.d.ts +0 -123
- package/dist/types/workspace-filesystem-job-types.d.ts +0 -288
- package/dist/types/workspace-filesystem-jobs.d.ts +0 -7
- package/dist/types/workspace-git-sync.d.ts +0 -495
- package/dist/types/workspace-hydration-ledger.d.ts +0 -43
- package/dist/types/workspace-hydration-merge.d.ts +0 -95
- package/dist/types/workspace-hydration-recovery-state.d.ts +0 -10
- package/dist/types/workspace-incident-state.d.ts +0 -19
- package/dist/types/workspace-merge-projection.d.ts +0 -60
- package/dist/types/workspace-mount-boundary.d.ts +0 -10
- package/dist/types/workspace-mount-hold-fence.d.ts +0 -42
- package/dist/types/workspace-mutation-gate.d.ts +0 -42
- package/dist/types/workspace-path-move.d.ts +0 -21
- package/dist/types/workspace-preserve-only-policy.d.ts +0 -15
- package/dist/types/workspace-project-config-policy.d.ts +0 -48
- package/dist/types/workspace-projection-ledger.d.ts +0 -59
- package/dist/types/workspace-publication-evidence.d.ts +0 -17
- package/dist/types/workspace-sync-coalescer.d.ts +0 -28
- /package/dist/types/{credential-authority-lock-fixture.d.ts → runtime/adapter.d.ts} +0 -0
- /package/dist/types/{recovery-journal-stall-fixture.d.ts → runtime/releases/main.d.ts} +0 -0
|
@@ -0,0 +1,544 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const EXECUTOR_CAPABILITY = "host-executor-v1";
|
|
3
|
+
export declare const MAX_FRAME_BYTES: number;
|
|
4
|
+
export declare const Lane: z.ZodEnum<{
|
|
5
|
+
general: "general";
|
|
6
|
+
utility: "utility";
|
|
7
|
+
control: "control";
|
|
8
|
+
}>;
|
|
9
|
+
export declare const ShellPayload: z.ZodObject<{
|
|
10
|
+
argv: z.ZodArray<z.ZodString>;
|
|
11
|
+
cwd: z.ZodString;
|
|
12
|
+
env: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
13
|
+
lane: z.ZodDefault<z.ZodEnum<{
|
|
14
|
+
general: "general";
|
|
15
|
+
utility: "utility";
|
|
16
|
+
control: "control";
|
|
17
|
+
}>>;
|
|
18
|
+
interactive: z.ZodDefault<z.ZodBoolean>;
|
|
19
|
+
pty: z.ZodOptional<z.ZodObject<{
|
|
20
|
+
cols: z.ZodNumber;
|
|
21
|
+
rows: z.ZodNumber;
|
|
22
|
+
}, z.core.$strict>>;
|
|
23
|
+
credentials: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
24
|
+
id: z.ZodString;
|
|
25
|
+
generation: z.ZodNumber;
|
|
26
|
+
}, z.core.$strict>>>;
|
|
27
|
+
timeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
28
|
+
}, z.core.$strict>;
|
|
29
|
+
export type ShellPayload = z.input<typeof ShellPayload>;
|
|
30
|
+
export declare const RunIdentity: z.ZodObject<{
|
|
31
|
+
operationId: z.ZodString;
|
|
32
|
+
userId: z.ZodString;
|
|
33
|
+
sessionId: z.ZodOptional<z.ZodString>;
|
|
34
|
+
fence: z.ZodObject<{
|
|
35
|
+
installationId: z.ZodString;
|
|
36
|
+
resourceType: z.ZodString;
|
|
37
|
+
resourceId: z.ZodString;
|
|
38
|
+
ownerId: z.ZodString;
|
|
39
|
+
epoch: z.ZodNumber;
|
|
40
|
+
}, z.core.$strict>;
|
|
41
|
+
}, z.core.$strict>;
|
|
42
|
+
export type RunIdentity = z.infer<typeof RunIdentity>;
|
|
43
|
+
export declare const Principal: z.ZodObject<{
|
|
44
|
+
id: z.ZodString;
|
|
45
|
+
tokenHash: z.ZodString;
|
|
46
|
+
role: z.ZodEnum<{
|
|
47
|
+
controller: "controller";
|
|
48
|
+
adapter: "adapter";
|
|
49
|
+
}>;
|
|
50
|
+
ownerId: z.ZodString;
|
|
51
|
+
userIds: z.ZodArray<z.ZodString>;
|
|
52
|
+
cwdRoots: z.ZodArray<z.ZodString>;
|
|
53
|
+
lanes: z.ZodArray<z.ZodEnum<{
|
|
54
|
+
general: "general";
|
|
55
|
+
utility: "utility";
|
|
56
|
+
control: "control";
|
|
57
|
+
}>>;
|
|
58
|
+
credentialIds: z.ZodArray<z.ZodString>;
|
|
59
|
+
}, z.core.$strict>;
|
|
60
|
+
/** Only an authenticated controller may install this immutable generation grant. */
|
|
61
|
+
export declare const AdapterGrant: z.ZodObject<{
|
|
62
|
+
installationId: z.ZodString;
|
|
63
|
+
workerId: z.ZodString;
|
|
64
|
+
principal: z.ZodObject<{
|
|
65
|
+
id: z.ZodString;
|
|
66
|
+
tokenHash: z.ZodString;
|
|
67
|
+
ownerId: z.ZodString;
|
|
68
|
+
userIds: z.ZodArray<z.ZodString>;
|
|
69
|
+
cwdRoots: z.ZodArray<z.ZodString>;
|
|
70
|
+
lanes: z.ZodArray<z.ZodEnum<{
|
|
71
|
+
general: "general";
|
|
72
|
+
utility: "utility";
|
|
73
|
+
control: "control";
|
|
74
|
+
}>>;
|
|
75
|
+
credentialIds: z.ZodArray<z.ZodString>;
|
|
76
|
+
role: z.ZodLiteral<"adapter">;
|
|
77
|
+
}, z.core.$strict>;
|
|
78
|
+
hello: z.ZodObject<{
|
|
79
|
+
installationId: z.ZodString;
|
|
80
|
+
instanceId: z.ZodString;
|
|
81
|
+
releaseId: z.ZodString;
|
|
82
|
+
role: z.ZodEnum<{
|
|
83
|
+
web: "web";
|
|
84
|
+
scheduler: "scheduler";
|
|
85
|
+
runner: "runner";
|
|
86
|
+
gateway: "gateway";
|
|
87
|
+
"worker-adapter": "worker-adapter";
|
|
88
|
+
"browser-adapter": "browser-adapter";
|
|
89
|
+
executor: "executor";
|
|
90
|
+
keeper: "keeper";
|
|
91
|
+
storage: "storage";
|
|
92
|
+
}>;
|
|
93
|
+
protocol: z.ZodObject<{
|
|
94
|
+
min: z.ZodNumber;
|
|
95
|
+
max: z.ZodNumber;
|
|
96
|
+
}, z.core.$strict>;
|
|
97
|
+
capabilities: z.ZodArray<z.ZodString>;
|
|
98
|
+
}, z.core.$strict>;
|
|
99
|
+
artifactDigest: z.ZodString;
|
|
100
|
+
}, z.core.$strict>;
|
|
101
|
+
export type AdapterGrant = z.infer<typeof AdapterGrant>;
|
|
102
|
+
export type AdapterRegistration = {
|
|
103
|
+
principalId: string;
|
|
104
|
+
ownerId: string;
|
|
105
|
+
releaseId: string;
|
|
106
|
+
artifactDigest: string;
|
|
107
|
+
grantDigest: string;
|
|
108
|
+
state: "registered" | "retired";
|
|
109
|
+
};
|
|
110
|
+
export declare const ExecutorCommand: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
111
|
+
method: z.ZodLiteral<"adapter.register">;
|
|
112
|
+
grant: z.ZodObject<{
|
|
113
|
+
installationId: z.ZodString;
|
|
114
|
+
workerId: z.ZodString;
|
|
115
|
+
principal: z.ZodObject<{
|
|
116
|
+
id: z.ZodString;
|
|
117
|
+
tokenHash: z.ZodString;
|
|
118
|
+
ownerId: z.ZodString;
|
|
119
|
+
userIds: z.ZodArray<z.ZodString>;
|
|
120
|
+
cwdRoots: z.ZodArray<z.ZodString>;
|
|
121
|
+
lanes: z.ZodArray<z.ZodEnum<{
|
|
122
|
+
general: "general";
|
|
123
|
+
utility: "utility";
|
|
124
|
+
control: "control";
|
|
125
|
+
}>>;
|
|
126
|
+
credentialIds: z.ZodArray<z.ZodString>;
|
|
127
|
+
role: z.ZodLiteral<"adapter">;
|
|
128
|
+
}, z.core.$strict>;
|
|
129
|
+
hello: z.ZodObject<{
|
|
130
|
+
installationId: z.ZodString;
|
|
131
|
+
instanceId: z.ZodString;
|
|
132
|
+
releaseId: z.ZodString;
|
|
133
|
+
role: z.ZodEnum<{
|
|
134
|
+
web: "web";
|
|
135
|
+
scheduler: "scheduler";
|
|
136
|
+
runner: "runner";
|
|
137
|
+
gateway: "gateway";
|
|
138
|
+
"worker-adapter": "worker-adapter";
|
|
139
|
+
"browser-adapter": "browser-adapter";
|
|
140
|
+
executor: "executor";
|
|
141
|
+
keeper: "keeper";
|
|
142
|
+
storage: "storage";
|
|
143
|
+
}>;
|
|
144
|
+
protocol: z.ZodObject<{
|
|
145
|
+
min: z.ZodNumber;
|
|
146
|
+
max: z.ZodNumber;
|
|
147
|
+
}, z.core.$strict>;
|
|
148
|
+
capabilities: z.ZodArray<z.ZodString>;
|
|
149
|
+
}, z.core.$strict>;
|
|
150
|
+
artifactDigest: z.ZodString;
|
|
151
|
+
}, z.core.$strict>;
|
|
152
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
153
|
+
method: z.ZodLiteral<"adapter.retire">;
|
|
154
|
+
principalId: z.ZodString;
|
|
155
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
156
|
+
method: z.ZodLiteral<"status">;
|
|
157
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
158
|
+
method: z.ZodLiteral<"authority">;
|
|
159
|
+
fence: z.ZodObject<{
|
|
160
|
+
installationId: z.ZodString;
|
|
161
|
+
resourceType: z.ZodString;
|
|
162
|
+
resourceId: z.ZodString;
|
|
163
|
+
ownerId: z.ZodString;
|
|
164
|
+
epoch: z.ZodNumber;
|
|
165
|
+
}, z.core.$strict>;
|
|
166
|
+
validUntil: z.ZodNumber;
|
|
167
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
168
|
+
method: z.ZodLiteral<"start">;
|
|
169
|
+
operation: z.ZodObject<{
|
|
170
|
+
protocol: z.ZodLiteral<1>;
|
|
171
|
+
installationId: z.ZodString;
|
|
172
|
+
operationId: z.ZodString;
|
|
173
|
+
userId: z.ZodString;
|
|
174
|
+
sessionId: z.ZodOptional<z.ZodString>;
|
|
175
|
+
kind: z.ZodString;
|
|
176
|
+
fence: z.ZodObject<{
|
|
177
|
+
installationId: z.ZodString;
|
|
178
|
+
resourceType: z.ZodString;
|
|
179
|
+
resourceId: z.ZodString;
|
|
180
|
+
ownerId: z.ZodString;
|
|
181
|
+
epoch: z.ZodNumber;
|
|
182
|
+
}, z.core.$strict>;
|
|
183
|
+
payload: z.ZodUnknown;
|
|
184
|
+
}, z.core.$strict>;
|
|
185
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
186
|
+
method: z.ZodLiteral<"poll">;
|
|
187
|
+
run: z.ZodObject<{
|
|
188
|
+
operationId: z.ZodString;
|
|
189
|
+
userId: z.ZodString;
|
|
190
|
+
sessionId: z.ZodOptional<z.ZodString>;
|
|
191
|
+
fence: z.ZodObject<{
|
|
192
|
+
installationId: z.ZodString;
|
|
193
|
+
resourceType: z.ZodString;
|
|
194
|
+
resourceId: z.ZodString;
|
|
195
|
+
ownerId: z.ZodString;
|
|
196
|
+
epoch: z.ZodNumber;
|
|
197
|
+
}, z.core.$strict>;
|
|
198
|
+
}, z.core.$strict>;
|
|
199
|
+
stdoutOffset: z.ZodDefault<z.ZodNumber>;
|
|
200
|
+
stderrOffset: z.ZodDefault<z.ZodNumber>;
|
|
201
|
+
maxBytes: z.ZodDefault<z.ZodNumber>;
|
|
202
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
203
|
+
method: z.ZodLiteral<"write">;
|
|
204
|
+
run: z.ZodObject<{
|
|
205
|
+
operationId: z.ZodString;
|
|
206
|
+
userId: z.ZodString;
|
|
207
|
+
sessionId: z.ZodOptional<z.ZodString>;
|
|
208
|
+
fence: z.ZodObject<{
|
|
209
|
+
installationId: z.ZodString;
|
|
210
|
+
resourceType: z.ZodString;
|
|
211
|
+
resourceId: z.ZodString;
|
|
212
|
+
ownerId: z.ZodString;
|
|
213
|
+
epoch: z.ZodNumber;
|
|
214
|
+
}, z.core.$strict>;
|
|
215
|
+
}, z.core.$strict>;
|
|
216
|
+
actionId: z.ZodString;
|
|
217
|
+
data: z.ZodString;
|
|
218
|
+
eof: z.ZodDefault<z.ZodBoolean>;
|
|
219
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
220
|
+
method: z.ZodLiteral<"resize">;
|
|
221
|
+
run: z.ZodObject<{
|
|
222
|
+
operationId: z.ZodString;
|
|
223
|
+
userId: z.ZodString;
|
|
224
|
+
sessionId: z.ZodOptional<z.ZodString>;
|
|
225
|
+
fence: z.ZodObject<{
|
|
226
|
+
installationId: z.ZodString;
|
|
227
|
+
resourceType: z.ZodString;
|
|
228
|
+
resourceId: z.ZodString;
|
|
229
|
+
ownerId: z.ZodString;
|
|
230
|
+
epoch: z.ZodNumber;
|
|
231
|
+
}, z.core.$strict>;
|
|
232
|
+
}, z.core.$strict>;
|
|
233
|
+
actionId: z.ZodString;
|
|
234
|
+
cols: z.ZodNumber;
|
|
235
|
+
rows: z.ZodNumber;
|
|
236
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
237
|
+
method: z.ZodLiteral<"cancel">;
|
|
238
|
+
run: z.ZodObject<{
|
|
239
|
+
operationId: z.ZodString;
|
|
240
|
+
userId: z.ZodString;
|
|
241
|
+
sessionId: z.ZodOptional<z.ZodString>;
|
|
242
|
+
fence: z.ZodObject<{
|
|
243
|
+
installationId: z.ZodString;
|
|
244
|
+
resourceType: z.ZodString;
|
|
245
|
+
resourceId: z.ZodString;
|
|
246
|
+
ownerId: z.ZodString;
|
|
247
|
+
epoch: z.ZodNumber;
|
|
248
|
+
}, z.core.$strict>;
|
|
249
|
+
}, z.core.$strict>;
|
|
250
|
+
actionId: z.ZodString;
|
|
251
|
+
}, z.core.$strict>], "method">;
|
|
252
|
+
export type ExecutorCommand = z.input<typeof ExecutorCommand>;
|
|
253
|
+
export declare const ExecutorRequest: z.ZodObject<{
|
|
254
|
+
protocol: z.ZodLiteral<1>;
|
|
255
|
+
requestId: z.ZodString;
|
|
256
|
+
auth: z.ZodObject<{
|
|
257
|
+
principalId: z.ZodString;
|
|
258
|
+
token: z.ZodString;
|
|
259
|
+
}, z.core.$strict>;
|
|
260
|
+
hello: z.ZodObject<{
|
|
261
|
+
installationId: z.ZodString;
|
|
262
|
+
instanceId: z.ZodString;
|
|
263
|
+
releaseId: z.ZodString;
|
|
264
|
+
role: z.ZodEnum<{
|
|
265
|
+
web: "web";
|
|
266
|
+
scheduler: "scheduler";
|
|
267
|
+
runner: "runner";
|
|
268
|
+
gateway: "gateway";
|
|
269
|
+
"worker-adapter": "worker-adapter";
|
|
270
|
+
"browser-adapter": "browser-adapter";
|
|
271
|
+
executor: "executor";
|
|
272
|
+
keeper: "keeper";
|
|
273
|
+
storage: "storage";
|
|
274
|
+
}>;
|
|
275
|
+
protocol: z.ZodObject<{
|
|
276
|
+
min: z.ZodNumber;
|
|
277
|
+
max: z.ZodNumber;
|
|
278
|
+
}, z.core.$strict>;
|
|
279
|
+
capabilities: z.ZodArray<z.ZodString>;
|
|
280
|
+
}, z.core.$strict>;
|
|
281
|
+
command: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
282
|
+
method: z.ZodLiteral<"adapter.register">;
|
|
283
|
+
grant: z.ZodObject<{
|
|
284
|
+
installationId: z.ZodString;
|
|
285
|
+
workerId: z.ZodString;
|
|
286
|
+
principal: z.ZodObject<{
|
|
287
|
+
id: z.ZodString;
|
|
288
|
+
tokenHash: z.ZodString;
|
|
289
|
+
ownerId: z.ZodString;
|
|
290
|
+
userIds: z.ZodArray<z.ZodString>;
|
|
291
|
+
cwdRoots: z.ZodArray<z.ZodString>;
|
|
292
|
+
lanes: z.ZodArray<z.ZodEnum<{
|
|
293
|
+
general: "general";
|
|
294
|
+
utility: "utility";
|
|
295
|
+
control: "control";
|
|
296
|
+
}>>;
|
|
297
|
+
credentialIds: z.ZodArray<z.ZodString>;
|
|
298
|
+
role: z.ZodLiteral<"adapter">;
|
|
299
|
+
}, z.core.$strict>;
|
|
300
|
+
hello: z.ZodObject<{
|
|
301
|
+
installationId: z.ZodString;
|
|
302
|
+
instanceId: z.ZodString;
|
|
303
|
+
releaseId: z.ZodString;
|
|
304
|
+
role: z.ZodEnum<{
|
|
305
|
+
web: "web";
|
|
306
|
+
scheduler: "scheduler";
|
|
307
|
+
runner: "runner";
|
|
308
|
+
gateway: "gateway";
|
|
309
|
+
"worker-adapter": "worker-adapter";
|
|
310
|
+
"browser-adapter": "browser-adapter";
|
|
311
|
+
executor: "executor";
|
|
312
|
+
keeper: "keeper";
|
|
313
|
+
storage: "storage";
|
|
314
|
+
}>;
|
|
315
|
+
protocol: z.ZodObject<{
|
|
316
|
+
min: z.ZodNumber;
|
|
317
|
+
max: z.ZodNumber;
|
|
318
|
+
}, z.core.$strict>;
|
|
319
|
+
capabilities: z.ZodArray<z.ZodString>;
|
|
320
|
+
}, z.core.$strict>;
|
|
321
|
+
artifactDigest: z.ZodString;
|
|
322
|
+
}, z.core.$strict>;
|
|
323
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
324
|
+
method: z.ZodLiteral<"adapter.retire">;
|
|
325
|
+
principalId: z.ZodString;
|
|
326
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
327
|
+
method: z.ZodLiteral<"status">;
|
|
328
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
329
|
+
method: z.ZodLiteral<"authority">;
|
|
330
|
+
fence: z.ZodObject<{
|
|
331
|
+
installationId: z.ZodString;
|
|
332
|
+
resourceType: z.ZodString;
|
|
333
|
+
resourceId: z.ZodString;
|
|
334
|
+
ownerId: z.ZodString;
|
|
335
|
+
epoch: z.ZodNumber;
|
|
336
|
+
}, z.core.$strict>;
|
|
337
|
+
validUntil: z.ZodNumber;
|
|
338
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
339
|
+
method: z.ZodLiteral<"start">;
|
|
340
|
+
operation: z.ZodObject<{
|
|
341
|
+
protocol: z.ZodLiteral<1>;
|
|
342
|
+
installationId: z.ZodString;
|
|
343
|
+
operationId: z.ZodString;
|
|
344
|
+
userId: z.ZodString;
|
|
345
|
+
sessionId: z.ZodOptional<z.ZodString>;
|
|
346
|
+
kind: z.ZodString;
|
|
347
|
+
fence: z.ZodObject<{
|
|
348
|
+
installationId: z.ZodString;
|
|
349
|
+
resourceType: z.ZodString;
|
|
350
|
+
resourceId: z.ZodString;
|
|
351
|
+
ownerId: z.ZodString;
|
|
352
|
+
epoch: z.ZodNumber;
|
|
353
|
+
}, z.core.$strict>;
|
|
354
|
+
payload: z.ZodUnknown;
|
|
355
|
+
}, z.core.$strict>;
|
|
356
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
357
|
+
method: z.ZodLiteral<"poll">;
|
|
358
|
+
run: z.ZodObject<{
|
|
359
|
+
operationId: z.ZodString;
|
|
360
|
+
userId: z.ZodString;
|
|
361
|
+
sessionId: z.ZodOptional<z.ZodString>;
|
|
362
|
+
fence: z.ZodObject<{
|
|
363
|
+
installationId: z.ZodString;
|
|
364
|
+
resourceType: z.ZodString;
|
|
365
|
+
resourceId: z.ZodString;
|
|
366
|
+
ownerId: z.ZodString;
|
|
367
|
+
epoch: z.ZodNumber;
|
|
368
|
+
}, z.core.$strict>;
|
|
369
|
+
}, z.core.$strict>;
|
|
370
|
+
stdoutOffset: z.ZodDefault<z.ZodNumber>;
|
|
371
|
+
stderrOffset: z.ZodDefault<z.ZodNumber>;
|
|
372
|
+
maxBytes: z.ZodDefault<z.ZodNumber>;
|
|
373
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
374
|
+
method: z.ZodLiteral<"write">;
|
|
375
|
+
run: z.ZodObject<{
|
|
376
|
+
operationId: z.ZodString;
|
|
377
|
+
userId: z.ZodString;
|
|
378
|
+
sessionId: z.ZodOptional<z.ZodString>;
|
|
379
|
+
fence: z.ZodObject<{
|
|
380
|
+
installationId: z.ZodString;
|
|
381
|
+
resourceType: z.ZodString;
|
|
382
|
+
resourceId: z.ZodString;
|
|
383
|
+
ownerId: z.ZodString;
|
|
384
|
+
epoch: z.ZodNumber;
|
|
385
|
+
}, z.core.$strict>;
|
|
386
|
+
}, z.core.$strict>;
|
|
387
|
+
actionId: z.ZodString;
|
|
388
|
+
data: z.ZodString;
|
|
389
|
+
eof: z.ZodDefault<z.ZodBoolean>;
|
|
390
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
391
|
+
method: z.ZodLiteral<"resize">;
|
|
392
|
+
run: z.ZodObject<{
|
|
393
|
+
operationId: z.ZodString;
|
|
394
|
+
userId: z.ZodString;
|
|
395
|
+
sessionId: z.ZodOptional<z.ZodString>;
|
|
396
|
+
fence: z.ZodObject<{
|
|
397
|
+
installationId: z.ZodString;
|
|
398
|
+
resourceType: z.ZodString;
|
|
399
|
+
resourceId: z.ZodString;
|
|
400
|
+
ownerId: z.ZodString;
|
|
401
|
+
epoch: z.ZodNumber;
|
|
402
|
+
}, z.core.$strict>;
|
|
403
|
+
}, z.core.$strict>;
|
|
404
|
+
actionId: z.ZodString;
|
|
405
|
+
cols: z.ZodNumber;
|
|
406
|
+
rows: z.ZodNumber;
|
|
407
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
408
|
+
method: z.ZodLiteral<"cancel">;
|
|
409
|
+
run: z.ZodObject<{
|
|
410
|
+
operationId: z.ZodString;
|
|
411
|
+
userId: z.ZodString;
|
|
412
|
+
sessionId: z.ZodOptional<z.ZodString>;
|
|
413
|
+
fence: z.ZodObject<{
|
|
414
|
+
installationId: z.ZodString;
|
|
415
|
+
resourceType: z.ZodString;
|
|
416
|
+
resourceId: z.ZodString;
|
|
417
|
+
ownerId: z.ZodString;
|
|
418
|
+
epoch: z.ZodNumber;
|
|
419
|
+
}, z.core.$strict>;
|
|
420
|
+
}, z.core.$strict>;
|
|
421
|
+
actionId: z.ZodString;
|
|
422
|
+
}, z.core.$strict>], "method">;
|
|
423
|
+
}, z.core.$strict>;
|
|
424
|
+
export declare const ExecutorCredential: z.ZodObject<{
|
|
425
|
+
id: z.ZodString;
|
|
426
|
+
installationId: z.ZodString;
|
|
427
|
+
userId: z.ZodString;
|
|
428
|
+
generation: z.ZodNumber;
|
|
429
|
+
env: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
430
|
+
files: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
431
|
+
}, z.core.$strict>;
|
|
432
|
+
export declare const ExecutorConfig: z.ZodObject<{
|
|
433
|
+
installationId: z.ZodString;
|
|
434
|
+
workerId: z.ZodString;
|
|
435
|
+
instanceId: z.ZodString;
|
|
436
|
+
releaseId: z.ZodString;
|
|
437
|
+
stateDir: z.ZodString;
|
|
438
|
+
productCredentialDirectory: z.ZodOptional<z.ZodString>;
|
|
439
|
+
capacity: z.ZodObject<{
|
|
440
|
+
general: z.ZodNumber;
|
|
441
|
+
utility: z.ZodNumber;
|
|
442
|
+
control: z.ZodNumber;
|
|
443
|
+
}, z.core.$strict>;
|
|
444
|
+
maxLeaseMs: z.ZodDefault<z.ZodNumber>;
|
|
445
|
+
maxRunMs: z.ZodDefault<z.ZodNumber>;
|
|
446
|
+
maxLogBytes: z.ZodDefault<z.ZodNumber>;
|
|
447
|
+
principals: z.ZodArray<z.ZodObject<{
|
|
448
|
+
id: z.ZodString;
|
|
449
|
+
tokenHash: z.ZodString;
|
|
450
|
+
role: z.ZodEnum<{
|
|
451
|
+
controller: "controller";
|
|
452
|
+
adapter: "adapter";
|
|
453
|
+
}>;
|
|
454
|
+
ownerId: z.ZodString;
|
|
455
|
+
userIds: z.ZodArray<z.ZodString>;
|
|
456
|
+
cwdRoots: z.ZodArray<z.ZodString>;
|
|
457
|
+
lanes: z.ZodArray<z.ZodEnum<{
|
|
458
|
+
general: "general";
|
|
459
|
+
utility: "utility";
|
|
460
|
+
control: "control";
|
|
461
|
+
}>>;
|
|
462
|
+
credentialIds: z.ZodArray<z.ZodString>;
|
|
463
|
+
}, z.core.$strict>>;
|
|
464
|
+
credentials: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
465
|
+
id: z.ZodString;
|
|
466
|
+
installationId: z.ZodString;
|
|
467
|
+
userId: z.ZodString;
|
|
468
|
+
generation: z.ZodNumber;
|
|
469
|
+
env: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
470
|
+
files: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
471
|
+
}, z.core.$strict>>>;
|
|
472
|
+
}, z.core.$strict>;
|
|
473
|
+
export type ExecutorConfig = z.input<typeof ExecutorConfig>;
|
|
474
|
+
export type ResolvedConfig = z.output<typeof ExecutorConfig>;
|
|
475
|
+
export type Principal = ResolvedConfig["principals"][number];
|
|
476
|
+
export declare const AdapterConfig: z.ZodObject<{
|
|
477
|
+
socketPath: z.ZodString;
|
|
478
|
+
principalId: z.ZodString;
|
|
479
|
+
token: z.ZodString;
|
|
480
|
+
hello: z.ZodObject<{
|
|
481
|
+
installationId: z.ZodString;
|
|
482
|
+
instanceId: z.ZodString;
|
|
483
|
+
releaseId: z.ZodString;
|
|
484
|
+
role: z.ZodEnum<{
|
|
485
|
+
web: "web";
|
|
486
|
+
scheduler: "scheduler";
|
|
487
|
+
runner: "runner";
|
|
488
|
+
gateway: "gateway";
|
|
489
|
+
"worker-adapter": "worker-adapter";
|
|
490
|
+
"browser-adapter": "browser-adapter";
|
|
491
|
+
executor: "executor";
|
|
492
|
+
keeper: "keeper";
|
|
493
|
+
storage: "storage";
|
|
494
|
+
}>;
|
|
495
|
+
protocol: z.ZodObject<{
|
|
496
|
+
min: z.ZodNumber;
|
|
497
|
+
max: z.ZodNumber;
|
|
498
|
+
}, z.core.$strict>;
|
|
499
|
+
capabilities: z.ZodArray<z.ZodString>;
|
|
500
|
+
}, z.core.$strict>;
|
|
501
|
+
timeoutMs: z.ZodDefault<z.ZodNumber>;
|
|
502
|
+
}, z.core.$strict>;
|
|
503
|
+
export type AdapterConfig = z.input<typeof AdapterConfig>;
|
|
504
|
+
export type RunReceipt = {
|
|
505
|
+
operationId: string;
|
|
506
|
+
userId: string;
|
|
507
|
+
sessionId: string | null;
|
|
508
|
+
payloadHash: string;
|
|
509
|
+
state: "accepted" | "running" | "completed" | "cancelled" | "unknown";
|
|
510
|
+
pid: number | null;
|
|
511
|
+
pty: boolean;
|
|
512
|
+
lane: z.infer<typeof Lane>;
|
|
513
|
+
stdoutBytes: number;
|
|
514
|
+
stderrBytes: number;
|
|
515
|
+
stdinClosed: boolean;
|
|
516
|
+
exitCode: number | null;
|
|
517
|
+
signal: string | null;
|
|
518
|
+
reason: string | null;
|
|
519
|
+
};
|
|
520
|
+
export type ActionReceipt = {
|
|
521
|
+
actionId: string;
|
|
522
|
+
state: "accepted" | "completed" | "unknown";
|
|
523
|
+
};
|
|
524
|
+
export type PollResult = {
|
|
525
|
+
receipt: RunReceipt;
|
|
526
|
+
stdout: {
|
|
527
|
+
base64: string;
|
|
528
|
+
nextOffset: number;
|
|
529
|
+
};
|
|
530
|
+
stderr: {
|
|
531
|
+
base64: string;
|
|
532
|
+
nextOffset: number;
|
|
533
|
+
};
|
|
534
|
+
};
|
|
535
|
+
export declare class ExecutorError extends Error {
|
|
536
|
+
readonly code: string;
|
|
537
|
+
/** Authenticated start rejection only: stale_fence may retry same ID; capacity_busy must not auto-retry. */
|
|
538
|
+
readonly rejectedBeforeAdmission: boolean;
|
|
539
|
+
constructor(code: string, message?: string,
|
|
540
|
+
/** Authenticated start rejection only: stale_fence may retry same ID; capacity_busy must not auto-retry. */
|
|
541
|
+
rejectedBeforeAdmission?: boolean);
|
|
542
|
+
}
|
|
543
|
+
export declare function isStartNonAdmissionCode(code: unknown): code is "stale_fence" | "capacity_busy";
|
|
544
|
+
export declare function isDefiniteStartRejection(error: unknown): error is ExecutorError;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export declare function preflightNativePty(): void;
|
|
2
|
+
/** Node native FD keeper is a daemon child; replacing adapters cannot signal it. */
|
|
3
|
+
export declare class PtySession {
|
|
4
|
+
pid: number;
|
|
5
|
+
private sequence;
|
|
6
|
+
private readonly pending;
|
|
7
|
+
private readonly child;
|
|
8
|
+
private onDataCallback?;
|
|
9
|
+
private onExitCallback?;
|
|
10
|
+
private readonly buffered;
|
|
11
|
+
private exit?;
|
|
12
|
+
readonly ready: Promise<void>;
|
|
13
|
+
constructor(input: {
|
|
14
|
+
argv: string[];
|
|
15
|
+
cwd: string;
|
|
16
|
+
env: Record<string, string>;
|
|
17
|
+
cols: number;
|
|
18
|
+
rows: number;
|
|
19
|
+
});
|
|
20
|
+
private deliverExit;
|
|
21
|
+
onData(callback: (data: Buffer) => void): void;
|
|
22
|
+
onExit(callback: (event: {
|
|
23
|
+
exitCode: number;
|
|
24
|
+
signal: number;
|
|
25
|
+
}) => void): void;
|
|
26
|
+
private request;
|
|
27
|
+
write(data: string): Promise<void>;
|
|
28
|
+
resize(cols: number, rows: number): Promise<void>;
|
|
29
|
+
kill(signal?: string): void;
|
|
30
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const AdapterManifest: z.ZodObject<{
|
|
3
|
+
version: z.ZodLiteral<1>;
|
|
4
|
+
installationId: z.ZodString;
|
|
5
|
+
workerId: z.ZodString;
|
|
6
|
+
hello: z.ZodObject<{
|
|
7
|
+
installationId: z.ZodString;
|
|
8
|
+
instanceId: z.ZodString;
|
|
9
|
+
releaseId: z.ZodString;
|
|
10
|
+
role: z.ZodEnum<{
|
|
11
|
+
web: "web";
|
|
12
|
+
scheduler: "scheduler";
|
|
13
|
+
runner: "runner";
|
|
14
|
+
gateway: "gateway";
|
|
15
|
+
"worker-adapter": "worker-adapter";
|
|
16
|
+
"browser-adapter": "browser-adapter";
|
|
17
|
+
executor: "executor";
|
|
18
|
+
keeper: "keeper";
|
|
19
|
+
storage: "storage";
|
|
20
|
+
}>;
|
|
21
|
+
protocol: z.ZodObject<{
|
|
22
|
+
min: z.ZodNumber;
|
|
23
|
+
max: z.ZodNumber;
|
|
24
|
+
}, z.core.$strict>;
|
|
25
|
+
capabilities: z.ZodArray<z.ZodString>;
|
|
26
|
+
}, z.core.$strict>;
|
|
27
|
+
entrypoint: z.ZodString;
|
|
28
|
+
files: z.ZodArray<z.ZodObject<{
|
|
29
|
+
path: z.ZodString;
|
|
30
|
+
sha256: z.ZodString;
|
|
31
|
+
size: z.ZodNumber;
|
|
32
|
+
executable: z.ZodBoolean;
|
|
33
|
+
}, z.core.$strict>>;
|
|
34
|
+
}, z.core.$strict>;
|
|
35
|
+
export type AdapterManifest = z.infer<typeof AdapterManifest>;
|
|
36
|
+
export declare const bytesHash: (bytes: Uint8Array) => string;
|
|
37
|
+
export declare function within(root: string, path: string): boolean;
|
|
38
|
+
/** Check every ancestor, not just a leaf. World-writable sticky /tmp is allowed, symlink ancestors are not. */
|
|
39
|
+
export declare function canonicalDirectory(path: string): string;
|
|
40
|
+
export declare function outsideWorkspaces(path: string, workspaceRoots: string[]): void;
|
|
41
|
+
/** No network, package manager, archive extraction, shell commands or in-place overwrite. */
|
|
42
|
+
export declare class ImmutableAdapterArtifacts {
|
|
43
|
+
readonly root: string;
|
|
44
|
+
private readonly installationId;
|
|
45
|
+
private readonly workerId;
|
|
46
|
+
private readonly workspaceRoots;
|
|
47
|
+
constructor(root: string, installationId: string, workerId: string, workspaceRoots: string[]);
|
|
48
|
+
private approved;
|
|
49
|
+
stage(source: string, input: AdapterManifest, approvalDigest: string): string;
|
|
50
|
+
verify(input: AdapterManifest, approvalDigest: string): string;
|
|
51
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { Database } from "bun:sqlite";
|
|
2
|
+
import { type RuntimeHello } from "@ricsam/r5d-api/runtime-protocol";
|
|
3
|
+
import { AdapterGrant, type AdapterRegistration, type Principal, type ResolvedConfig } from "../protocol";
|
|
4
|
+
export declare const digest: (value: unknown) => string;
|
|
5
|
+
/** Keeper-owned registry. Durable tombstones prevent token/owner/release rebinding after retirement. */
|
|
6
|
+
export declare class AdapterGrantRegistry {
|
|
7
|
+
private readonly db;
|
|
8
|
+
private readonly config;
|
|
9
|
+
constructor(db: Database, config: ResolvedConfig);
|
|
10
|
+
private rows;
|
|
11
|
+
find(id: string): AdapterGrant | undefined;
|
|
12
|
+
hasOwner(owner: string): boolean;
|
|
13
|
+
list(): AdapterRegistration[];
|
|
14
|
+
register(controller: Principal, input: AdapterGrant, keeperHello: RuntimeHello): AdapterRegistration;
|
|
15
|
+
retire(controller: Principal, id: string, authoritativeOwner?: string): AdapterRegistration;
|
|
16
|
+
}
|