@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,23 @@
|
|
|
1
|
+
export type PersonalQueuedAction = {
|
|
2
|
+
id: string;
|
|
3
|
+
requestHash: string;
|
|
4
|
+
request: {
|
|
5
|
+
kind?: string;
|
|
6
|
+
sessionId?: string;
|
|
7
|
+
command?: {
|
|
8
|
+
method?: string;
|
|
9
|
+
streamId?: string;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
/** Native receipts own effects. This only admits bounded independent transport
|
|
14
|
+
* lanes; mutations keep their original global order and each TCP stream is serial. */
|
|
15
|
+
export declare class PersonalActionScheduler {
|
|
16
|
+
private readonly execute;
|
|
17
|
+
private readonly failed;
|
|
18
|
+
private readonly limit;
|
|
19
|
+
private readonly active;
|
|
20
|
+
constructor(execute: (action: PersonalQueuedAction) => Promise<void>, failed: (error: unknown) => void, limit?: number);
|
|
21
|
+
accept(actions: PersonalQueuedAction[]): void;
|
|
22
|
+
drain(): Promise<void>;
|
|
23
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export type PersonalWorkerOptions = {
|
|
2
|
+
label: string;
|
|
3
|
+
baseUrl: string;
|
|
4
|
+
credential: string;
|
|
5
|
+
root: string;
|
|
6
|
+
cliEntrypoint?: string;
|
|
7
|
+
};
|
|
8
|
+
export declare function parsePersonalWorkerOptions(args: string[], environment?: Record<string, string | undefined>): PersonalWorkerOptions;
|
|
9
|
+
/** HTTP reconnects never replace the local source/PTY keeper. */
|
|
10
|
+
export declare function startPersonalWorker(options: PersonalWorkerOptions, version: string): Promise<{
|
|
11
|
+
resourceId: string;
|
|
12
|
+
root: string;
|
|
13
|
+
close(): Promise<void>;
|
|
14
|
+
}>;
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { WorkspaceAuthority } from "../runtime/workspace/authority";
|
|
3
|
+
import { type StorageTransport } from "../runtime/workspace/storage-client";
|
|
4
|
+
export declare const PersonalWorkerGrant: z.ZodObject<{
|
|
5
|
+
installationId: z.ZodString;
|
|
6
|
+
userId: z.ZodString;
|
|
7
|
+
resourceId: z.ZodString;
|
|
8
|
+
instanceId: z.ZodString;
|
|
9
|
+
label: z.ZodOptional<z.ZodString>;
|
|
10
|
+
workerFence: z.ZodObject<{
|
|
11
|
+
installationId: z.ZodString;
|
|
12
|
+
resourceType: z.ZodString;
|
|
13
|
+
resourceId: z.ZodString;
|
|
14
|
+
ownerId: z.ZodString;
|
|
15
|
+
epoch: z.ZodNumber;
|
|
16
|
+
}, z.core.$strict>;
|
|
17
|
+
workerHello: z.ZodObject<{
|
|
18
|
+
installationId: z.ZodString;
|
|
19
|
+
instanceId: z.ZodString;
|
|
20
|
+
releaseId: z.ZodString;
|
|
21
|
+
role: z.ZodEnum<{
|
|
22
|
+
web: "web";
|
|
23
|
+
scheduler: "scheduler";
|
|
24
|
+
runner: "runner";
|
|
25
|
+
gateway: "gateway";
|
|
26
|
+
"worker-adapter": "worker-adapter";
|
|
27
|
+
"browser-adapter": "browser-adapter";
|
|
28
|
+
executor: "executor";
|
|
29
|
+
keeper: "keeper";
|
|
30
|
+
storage: "storage";
|
|
31
|
+
}>;
|
|
32
|
+
protocol: z.ZodObject<{
|
|
33
|
+
min: z.ZodNumber;
|
|
34
|
+
max: z.ZodNumber;
|
|
35
|
+
}, z.core.$strict>;
|
|
36
|
+
capabilities: z.ZodArray<z.ZodString>;
|
|
37
|
+
}, z.core.$strict>;
|
|
38
|
+
leaseExpiresAt: z.ZodCoercedNumber<unknown>;
|
|
39
|
+
}, z.core.$loose>;
|
|
40
|
+
export declare const PersonalWorkspaceRequest: z.ZodObject<{
|
|
41
|
+
protocol: z.ZodLiteral<1>;
|
|
42
|
+
userId: z.ZodString;
|
|
43
|
+
sessionId: z.ZodString;
|
|
44
|
+
workbench: z.ZodObject<{
|
|
45
|
+
id: z.ZodString;
|
|
46
|
+
repositoryId: z.ZodString;
|
|
47
|
+
branch: z.ZodString;
|
|
48
|
+
sessionId: z.ZodString;
|
|
49
|
+
sharedSessionId: z.ZodOptional<z.ZodString>;
|
|
50
|
+
}, z.core.$strict>;
|
|
51
|
+
sourceWorkbench: z.ZodOptional<z.ZodObject<{
|
|
52
|
+
id: z.ZodString;
|
|
53
|
+
repositoryId: z.ZodString;
|
|
54
|
+
branch: z.ZodString;
|
|
55
|
+
sessionId: z.ZodString;
|
|
56
|
+
sharedSessionId: z.ZodOptional<z.ZodString>;
|
|
57
|
+
}, z.core.$strict>>;
|
|
58
|
+
sharedWorkbenches: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
59
|
+
id: z.ZodString;
|
|
60
|
+
repositoryId: z.ZodString;
|
|
61
|
+
branch: z.ZodString;
|
|
62
|
+
sessionId: z.ZodString;
|
|
63
|
+
sharedSessionId: z.ZodOptional<z.ZodString>;
|
|
64
|
+
}, z.core.$strict>>>;
|
|
65
|
+
kind: z.ZodEnum<{
|
|
66
|
+
inspect: "inspect";
|
|
67
|
+
terminal: "terminal";
|
|
68
|
+
product: "product";
|
|
69
|
+
agent: "agent";
|
|
70
|
+
tcp: "tcp";
|
|
71
|
+
}>;
|
|
72
|
+
command: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
73
|
+
credentials: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
74
|
+
id: z.ZodString;
|
|
75
|
+
installationId: z.ZodString;
|
|
76
|
+
userId: z.ZodString;
|
|
77
|
+
generation: z.ZodNumber;
|
|
78
|
+
env: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
79
|
+
files: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
80
|
+
}, z.core.$strict>>>;
|
|
81
|
+
}, z.core.$strict>;
|
|
82
|
+
export type PersonalWorkerRuntime = Awaited<ReturnType<typeof openPersonalWorkerRuntime>>;
|
|
83
|
+
/** The host owns this keeper independently of every replaceable remote web/gateway generation. */
|
|
84
|
+
export declare function openPersonalWorkerRuntime(options: {
|
|
85
|
+
root: string;
|
|
86
|
+
grant: z.infer<typeof PersonalWorkerGrant>;
|
|
87
|
+
storage: (sessionId: string) => StorageTransport;
|
|
88
|
+
cliEntrypoint?: string;
|
|
89
|
+
}): Promise<{
|
|
90
|
+
grant: {
|
|
91
|
+
[x: string]: unknown;
|
|
92
|
+
installationId: string;
|
|
93
|
+
userId: string;
|
|
94
|
+
resourceId: string;
|
|
95
|
+
instanceId: string;
|
|
96
|
+
workerFence: {
|
|
97
|
+
installationId: string;
|
|
98
|
+
resourceType: string;
|
|
99
|
+
resourceId: string;
|
|
100
|
+
ownerId: string;
|
|
101
|
+
epoch: number;
|
|
102
|
+
};
|
|
103
|
+
workerHello: {
|
|
104
|
+
installationId: string;
|
|
105
|
+
instanceId: string;
|
|
106
|
+
releaseId: string;
|
|
107
|
+
role: "web" | "scheduler" | "runner" | "gateway" | "worker-adapter" | "browser-adapter" | "executor" | "keeper" | "storage";
|
|
108
|
+
protocol: {
|
|
109
|
+
min: number;
|
|
110
|
+
max: number;
|
|
111
|
+
};
|
|
112
|
+
capabilities: string[];
|
|
113
|
+
};
|
|
114
|
+
leaseExpiresAt: number;
|
|
115
|
+
label?: string | undefined;
|
|
116
|
+
};
|
|
117
|
+
renew: (value: unknown) => Promise<void>;
|
|
118
|
+
dispatch: (raw: unknown) => Promise<any>;
|
|
119
|
+
authority: WorkspaceAuthority;
|
|
120
|
+
close(): Promise<void>;
|
|
121
|
+
}>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare class PersonalTcpError extends Error {
|
|
2
|
+
readonly code: string;
|
|
3
|
+
constructor(code: string);
|
|
4
|
+
}
|
|
5
|
+
/** The local worker owns sockets; replaceable web processes relay immutable bytes only. */
|
|
6
|
+
export declare class PersonalTcpManager {
|
|
7
|
+
private readonly authorizeConnect?;
|
|
8
|
+
private readonly db;
|
|
9
|
+
private readonly sockets;
|
|
10
|
+
constructor(directory: string, authorizeConnect?: ((sessionId: string, port: number) => Promise<void>) | undefined);
|
|
11
|
+
private stream;
|
|
12
|
+
dispatch(sessionId: string, raw: unknown): Promise<Record<string, unknown>>;
|
|
13
|
+
close(): Promise<void>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { OperationEnvelope, OwnershipFence } from "@ricsam/r5d-api/runtime-protocol";
|
|
2
|
+
import { AdapterConfig, type ActionReceipt, type AdapterGrant, type AdapterRegistration, type ExecutorCommand, type PollResult, type RunIdentity, type RunReceipt } from "./protocol";
|
|
3
|
+
/** Stateless one-request connections: disconnect/timeout never implies the operation did not happen. */
|
|
4
|
+
export declare class HostExecutorClient {
|
|
5
|
+
readonly config: ReturnType<typeof AdapterConfig.parse>;
|
|
6
|
+
constructor(config: AdapterConfig);
|
|
7
|
+
request<T = unknown>(command: ExecutorCommand): Promise<T>;
|
|
8
|
+
status(): Promise<unknown>;
|
|
9
|
+
registerAdapter(grant: AdapterGrant): Promise<AdapterRegistration>;
|
|
10
|
+
retireAdapter(principalId: string): Promise<AdapterRegistration>;
|
|
11
|
+
setAuthority(fence: OwnershipFence, validUntil: number): Promise<unknown>;
|
|
12
|
+
start(operation: OperationEnvelope): Promise<RunReceipt>;
|
|
13
|
+
poll(run: RunIdentity, stdoutOffset?: number, stderrOffset?: number, maxBytes?: number): Promise<PollResult>;
|
|
14
|
+
write(run: RunIdentity, actionId: string, data: string, eof?: boolean): Promise<ActionReceipt>;
|
|
15
|
+
resize(run: RunIdentity, actionId: string, cols: number, rows: number): Promise<ActionReceipt>;
|
|
16
|
+
cancel(run: RunIdentity, actionId: string): Promise<ActionReceipt>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { HostExecutor } from "./executor";
|
|
2
|
+
import { type ExecutorConfig as Config } from "./protocol";
|
|
3
|
+
/** Start only from an independently supervised daemon entrypoint, never an adapter. */
|
|
4
|
+
export declare function startHostExecutor(input: Config): Promise<{
|
|
5
|
+
executor: HostExecutor;
|
|
6
|
+
socketPath: string;
|
|
7
|
+
close(): Promise<void>;
|
|
8
|
+
}>;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { type RuntimeHello } from "@ricsam/r5d-api/runtime-protocol";
|
|
2
|
+
import { ExecutorConfig, type ResolvedConfig } from "./protocol";
|
|
3
|
+
import { ExecutorStore } from "./storage";
|
|
4
|
+
type PtyModule = typeof import("node-pty");
|
|
5
|
+
export declare const tokenHash: (token: string) => string;
|
|
6
|
+
/** Resource owner, never instantiated in a replaceable adapter. No legacy worker singleton imports. */
|
|
7
|
+
export declare class HostExecutor {
|
|
8
|
+
private readonly nativePty?;
|
|
9
|
+
readonly config: ResolvedConfig;
|
|
10
|
+
readonly store: ExecutorStore;
|
|
11
|
+
private readonly adapters;
|
|
12
|
+
readonly hello: RuntimeHello;
|
|
13
|
+
private readonly active;
|
|
14
|
+
private readonly leaseTimer;
|
|
15
|
+
private closing;
|
|
16
|
+
private poisoned;
|
|
17
|
+
private serial;
|
|
18
|
+
constructor(config: ExecutorConfig, nativePty?: PtyModule | undefined);
|
|
19
|
+
/** Authority is synchronous and authenticated; never queue lease renewal behind a blocked OS write.
|
|
20
|
+
* Resource commands retain one ordered admission/action boundary. Commands already admitted may
|
|
21
|
+
* complete after promotion; queued commands and yielded admission hashes must recheck the fence.
|
|
22
|
+
*/
|
|
23
|
+
handle(input: unknown): Promise<unknown>;
|
|
24
|
+
private authenticate;
|
|
25
|
+
private authority;
|
|
26
|
+
private workerFence;
|
|
27
|
+
private authorize;
|
|
28
|
+
private authorizeAdmission;
|
|
29
|
+
private receipt;
|
|
30
|
+
private dispatch;
|
|
31
|
+
private output;
|
|
32
|
+
private finish;
|
|
33
|
+
close(): Promise<void>;
|
|
34
|
+
}
|
|
35
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { startHostExecutor } from "./daemon";
|
|
2
|
+
export { HostExecutorClient } from "./client";
|
|
3
|
+
export { tokenHash } from "./executor";
|
|
4
|
+
export { AdapterConfig, ExecutorConfig, ExecutorCommand, ExecutorError, EXECUTOR_CAPABILITY, ShellPayload } from "./protocol";
|
|
5
|
+
export type { ActionReceipt, PollResult, RunIdentity, RunReceipt } from "./protocol";
|