@overcy/hive 0.0.0-stage → 0.2.0

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.
Files changed (133) hide show
  1. package/README.md +213 -2
  2. package/dist/api.d.ts +31 -0
  3. package/dist/api.js +83 -0
  4. package/dist/atomic.d.ts +1 -0
  5. package/dist/atomic.js +24 -0
  6. package/dist/binding.d.ts +5 -0
  7. package/dist/binding.js +16 -0
  8. package/dist/bootstrap/deps.d.ts +3 -0
  9. package/dist/bootstrap/deps.js +35 -0
  10. package/dist/bootstrap/doctor.d.ts +29 -0
  11. package/dist/bootstrap/doctor.js +80 -0
  12. package/dist/bootstrap/engine.d.ts +29 -0
  13. package/dist/bootstrap/engine.js +160 -0
  14. package/dist/bootstrap/forwarder.d.ts +11 -0
  15. package/dist/bootstrap/forwarder.js +30 -0
  16. package/dist/bootstrap/identity.d.ts +7 -0
  17. package/dist/bootstrap/identity.js +52 -0
  18. package/dist/bootstrap/index.d.ts +36 -0
  19. package/dist/bootstrap/index.js +40 -0
  20. package/dist/bootstrap/kit.d.ts +9 -0
  21. package/dist/bootstrap/kit.js +56 -0
  22. package/dist/bootstrap/manifest.d.ts +73 -0
  23. package/dist/bootstrap/manifest.js +309 -0
  24. package/dist/bootstrap/model-access.d.ts +43 -0
  25. package/dist/bootstrap/model-access.js +74 -0
  26. package/dist/bootstrap/pin.d.ts +2 -0
  27. package/dist/bootstrap/pin.js +16 -0
  28. package/dist/bootstrap/plan.d.ts +49 -0
  29. package/dist/bootstrap/plan.js +69 -0
  30. package/dist/bootstrap/prompt.d.ts +3 -0
  31. package/dist/bootstrap/prompt.js +35 -0
  32. package/dist/bootstrap/registry.d.ts +85 -0
  33. package/dist/bootstrap/registry.js +38 -0
  34. package/dist/bootstrap/secrets.d.ts +11 -0
  35. package/dist/bootstrap/secrets.js +105 -0
  36. package/dist/bootstrap/steps/agents.d.ts +9 -0
  37. package/dist/bootstrap/steps/agents.js +75 -0
  38. package/dist/bootstrap/steps/auth.d.ts +8 -0
  39. package/dist/bootstrap/steps/auth.js +138 -0
  40. package/dist/bootstrap/steps/cron.d.ts +7 -0
  41. package/dist/bootstrap/steps/cron.js +74 -0
  42. package/dist/bootstrap/steps/drift.d.ts +5 -0
  43. package/dist/bootstrap/steps/drift.js +67 -0
  44. package/dist/bootstrap/steps/env.d.ts +6 -0
  45. package/dist/bootstrap/steps/env.js +108 -0
  46. package/dist/bootstrap/steps/files.d.ts +7 -0
  47. package/dist/bootstrap/steps/files.js +28 -0
  48. package/dist/bootstrap/steps/lanes.d.ts +14 -0
  49. package/dist/bootstrap/steps/lanes.js +153 -0
  50. package/dist/bootstrap/steps/model-access.d.ts +10 -0
  51. package/dist/bootstrap/steps/model-access.js +122 -0
  52. package/dist/bootstrap/steps/preflight.d.ts +3 -0
  53. package/dist/bootstrap/steps/preflight.js +49 -0
  54. package/dist/bootstrap/steps/reporter.d.ts +12 -0
  55. package/dist/bootstrap/steps/reporter.js +155 -0
  56. package/dist/bootstrap/system.d.ts +5 -0
  57. package/dist/bootstrap/system.js +69 -0
  58. package/dist/bootstrap/types.d.ts +157 -0
  59. package/dist/bootstrap/types.js +14 -0
  60. package/dist/cli.d.ts +2 -0
  61. package/dist/cli.js +23 -0
  62. package/dist/collect.d.ts +28 -0
  63. package/dist/collect.js +63 -0
  64. package/dist/commands/connect.d.ts +33 -0
  65. package/dist/commands/connect.js +306 -0
  66. package/dist/commands/doctor.d.ts +7 -0
  67. package/dist/commands/doctor.js +13 -0
  68. package/dist/commands/login.d.ts +3 -0
  69. package/dist/commands/login.js +118 -0
  70. package/dist/commands/logout.d.ts +2 -0
  71. package/dist/commands/logout.js +37 -0
  72. package/dist/commands/node-add.d.ts +7 -0
  73. package/dist/commands/node-add.js +56 -0
  74. package/dist/commands/node.d.ts +19 -0
  75. package/dist/commands/node.js +43 -0
  76. package/dist/commands/prEvents.d.ts +7 -0
  77. package/dist/commands/prEvents.js +32 -0
  78. package/dist/commands/setup.d.ts +15 -0
  79. package/dist/commands/setup.js +35 -0
  80. package/dist/commands/status.d.ts +18 -0
  81. package/dist/commands/status.js +71 -0
  82. package/dist/commands/threads.d.ts +6 -0
  83. package/dist/commands/threads.js +36 -0
  84. package/dist/config.d.ts +71 -0
  85. package/dist/config.js +121 -0
  86. package/dist/context.d.ts +26 -0
  87. package/dist/context.js +31 -0
  88. package/dist/crypto.d.ts +7 -0
  89. package/dist/crypto.js +50 -0
  90. package/dist/machine.d.ts +66 -0
  91. package/dist/machine.js +103 -0
  92. package/dist/node/cli.d.ts +25 -0
  93. package/dist/node/cli.js +130 -0
  94. package/dist/node/engine.d.ts +47 -0
  95. package/dist/node/engine.js +463 -0
  96. package/dist/node/ingress.d.ts +102 -0
  97. package/dist/node/ingress.js +473 -0
  98. package/dist/node/layout.d.ts +56 -0
  99. package/dist/node/layout.js +55 -0
  100. package/dist/node/leave.d.ts +8 -0
  101. package/dist/node/leave.js +32 -0
  102. package/dist/node/lock.d.ts +19 -0
  103. package/dist/node/lock.js +99 -0
  104. package/dist/node/modelAccess.d.ts +2 -0
  105. package/dist/node/modelAccess.js +44 -0
  106. package/dist/node/repair.d.ts +28 -0
  107. package/dist/node/repair.js +78 -0
  108. package/dist/node/services.d.ts +58 -0
  109. package/dist/node/services.js +171 -0
  110. package/dist/node/state.d.ts +127 -0
  111. package/dist/node/state.js +95 -0
  112. package/dist/node/steps.d.ts +74 -0
  113. package/dist/node/steps.js +158 -0
  114. package/dist/node/supervisor.d.ts +22 -0
  115. package/dist/node/supervisor.js +95 -0
  116. package/dist/node/tick.d.ts +47 -0
  117. package/dist/node/tick.js +278 -0
  118. package/dist/node/toolchain.d.ts +50 -0
  119. package/dist/node/toolchain.js +230 -0
  120. package/dist/nodeContract.d.ts +101 -0
  121. package/dist/nodeContract.js +192 -0
  122. package/dist/package.d.ts +3 -0
  123. package/dist/package.js +5 -0
  124. package/dist/prEvents.d.ts +109 -0
  125. package/dist/prEvents.js +374 -0
  126. package/dist/run.d.ts +19 -0
  127. package/dist/run.js +487 -0
  128. package/dist/specs/device-client.json +920 -0
  129. package/dist/threads.d.ts +88 -0
  130. package/dist/threads.js +268 -0
  131. package/dist/version.d.ts +1 -0
  132. package/dist/version.js +1 -0
  133. package/package.json +35 -4
@@ -0,0 +1,192 @@
1
+ // Parsers for the two node documents in packages/status-schema/node/v1: hive-node-desired/v1 (Hive writes, the node reads)
2
+ // and hive-node-report/v1 (the node writes). Both reject unknown fields, as the JSON Schemas do. The CLI has no JSON
3
+ // Schema engine, so these are written by hand and test/nodeContract.test.ts runs them over the schema package's fixtures.
4
+ export const MODEL_METHODS = ['direct', 'byok', 'own_proxy', 'hive_credits', 'overcy_pool'];
5
+ export const STEP_IDS = ['host', 'identity', 'desired', 'cli', 'toolchain', 'engine', 'ingress', 'model-access', 'relay'];
6
+ export const STEP_STATUSES = ['ok', 'repaired', 'needs', 'failed', 'blocked', 'running'];
7
+ export const INGRESS_KINDS = ['none', 'dev_tls', 'cloudflare_tunnel'];
8
+ export const DESIRED_SCHEMA = 'hive-node-desired/v1';
9
+ export const REPORT_SCHEMA = 'hive-node-report/v1';
10
+ export class ContractError extends Error {
11
+ constructor(path, message) {
12
+ super(`${path || '/'} ${message}`);
13
+ this.name = 'ContractError';
14
+ }
15
+ }
16
+ const SECRET_NAME = /^[a-z][a-z0-9._-]{0,63}$/;
17
+ const VERSION = /^[0-9A-Za-z][0-9A-Za-z._+-]{0,63}$/;
18
+ const ROLE = /^[a-z][a-z0-9-]{0,31}$/;
19
+ const TIMESTAMP = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d{1,9})?(Z|[+-]\d{2}:\d{2})$/;
20
+ function object(value, path, allowed, required = []) {
21
+ if (typeof value !== 'object' || value === null || Array.isArray(value))
22
+ throw new ContractError(path, 'must be an object');
23
+ const record = value;
24
+ for (const key of Object.keys(record)) {
25
+ if (!allowed.includes(key))
26
+ throw new ContractError(`${path}/${key}`, 'is not allowed');
27
+ }
28
+ for (const key of required) {
29
+ if (!(key in record))
30
+ throw new ContractError(path, `needs ${key}`);
31
+ }
32
+ return record;
33
+ }
34
+ function integer(value, path, min, max = Number.MAX_SAFE_INTEGER) {
35
+ if (typeof value !== 'number' || !Number.isInteger(value) || value < min || value > max)
36
+ throw new ContractError(path, `must be a whole number from ${min} to ${max}`);
37
+ return value;
38
+ }
39
+ function number(value, path, min = -Infinity) {
40
+ if (typeof value !== 'number' || !Number.isFinite(value) || value < min)
41
+ throw new ContractError(path, 'must be a number');
42
+ return value;
43
+ }
44
+ function boolean(value, path) {
45
+ if (typeof value !== 'boolean')
46
+ throw new ContractError(path, 'must be true or false');
47
+ return value;
48
+ }
49
+ function text(value, path, pattern, max = 500) {
50
+ if (typeof value !== 'string' || value.length > max || (pattern !== undefined && !pattern.test(value))) {
51
+ throw new ContractError(path, pattern === undefined ? `must be a string of at most ${max} characters` : 'has the wrong format');
52
+ }
53
+ return value;
54
+ }
55
+ function oneOf(value, path, allowed) {
56
+ if (typeof value !== 'string' || !allowed.includes(value))
57
+ throw new ContractError(path, `must be one of ${allowed.join(', ')}`);
58
+ return value;
59
+ }
60
+ function timestamp(value, path) {
61
+ const stamp = text(value, path, TIMESTAMP, 40);
62
+ if (Number.isNaN(Date.parse(stamp)))
63
+ throw new ContractError(path, 'must be an RFC 3339 date-time');
64
+ return stamp;
65
+ }
66
+ function secretRef(value, path) {
67
+ const ref = object(value, path, ['name', 'version'], ['name', 'version']);
68
+ return { name: text(ref.name, `${path}/name`, SECRET_NAME, 64), version: integer(ref.version, `${path}/version`, 1) };
69
+ }
70
+ function copy(source, target, fields, path) {
71
+ for (const [key, parse] of Object.entries(fields)) {
72
+ if (key in source)
73
+ target[key] = parse(source[key], `${path}/${key}`);
74
+ }
75
+ return target;
76
+ }
77
+ export function parseDesired(input) {
78
+ const root = object(input, '', ['schema', 'revision', 'paused', 'removed', 'role', 'slots', 'versions', 'model_access', 'ingress', 'actions'], ['schema', 'revision']);
79
+ if (root.schema !== DESIRED_SCHEMA)
80
+ throw new ContractError('/schema', `must be ${DESIRED_SCHEMA}`);
81
+ const out = { schema: DESIRED_SCHEMA, revision: integer(root.revision, '/revision', 0) };
82
+ copy(root, out, {
83
+ paused: boolean,
84
+ removed: boolean,
85
+ role: (v, p) => text(v, p, ROLE, 32),
86
+ slots: (v, p) => integer(v, p, 0, 1024),
87
+ versions: (v, p) => {
88
+ const versions = object(v, p, ['cli', 'engine', 'channel', 'toolchain']);
89
+ const parsed = {};
90
+ copy(versions, parsed, {
91
+ cli: (x, q) => text(x, q, VERSION, 64),
92
+ engine: (x, q) => text(x, q, VERSION, 64),
93
+ channel: (x, q) => oneOf(x, q, ['stable', 'dev']),
94
+ toolchain: (x, q) => {
95
+ const tools = object(x, q, ['gh', 'claude', 'codex']);
96
+ return copy(tools, {}, { gh: (y, r) => text(y, r, VERSION, 64), claude: (y, r) => text(y, r, VERSION, 64), codex: (y, r) => text(y, r, VERSION, 64) }, q);
97
+ },
98
+ }, p);
99
+ return parsed;
100
+ },
101
+ model_access: (v, p) => {
102
+ const access = object(v, p, ['method', 'secret'], ['method']);
103
+ const parsed = { method: oneOf(access.method, `${p}/method`, MODEL_METHODS) };
104
+ if ('secret' in access)
105
+ parsed.secret = secretRef(access.secret, `${p}/secret`);
106
+ return parsed;
107
+ },
108
+ ingress: (v, p) => {
109
+ const ingress = object(v, p, ['kind', 'stream_origin', 'secret'], ['kind']);
110
+ const parsed = { kind: oneOf(ingress.kind, `${p}/kind`, INGRESS_KINDS) };
111
+ if ('stream_origin' in ingress)
112
+ parsed.stream_origin = text(ingress.stream_origin, `${p}/stream_origin`, /^https:\/\//, 200);
113
+ if ('secret' in ingress)
114
+ parsed.secret = secretRef(ingress.secret, `${p}/secret`);
115
+ return parsed;
116
+ },
117
+ actions: (v, p) => {
118
+ const actions = object(v, p, ['rerun_setup', 'restart_engine']);
119
+ return copy(actions, {}, { rerun_setup: (x, q) => integer(x, q, 0), restart_engine: (x, q) => integer(x, q, 0) }, p);
120
+ },
121
+ }, '');
122
+ return out;
123
+ }
124
+ function parseStep(value, path) {
125
+ const step = object(value, path, ['id', 'status', 'detail', 'fix', 'at'], ['id', 'status', 'at']);
126
+ const out = { id: oneOf(step.id, `${path}/id`, STEP_IDS), status: oneOf(step.status, `${path}/status`, STEP_STATUSES), at: timestamp(step.at, `${path}/at`) };
127
+ if ('detail' in step)
128
+ out.detail = text(step.detail, `${path}/detail`);
129
+ if ('fix' in step)
130
+ out.fix = oneOf(step.fix, `${path}/fix`, ['hive_button', 'rerun_install', 'human']);
131
+ return out;
132
+ }
133
+ function parseTransition(value, path) {
134
+ const t = object(value, path, ['step', 'from', 'to', 'detail', 'at'], ['step', 'to', 'at']);
135
+ const out = { step: oneOf(t.step, `${path}/step`, STEP_IDS), to: oneOf(t.to, `${path}/to`, STEP_STATUSES), at: timestamp(t.at, `${path}/at`) };
136
+ if ('from' in t)
137
+ out.from = t.from === null ? null : oneOf(t.from, `${path}/from`, STEP_STATUSES);
138
+ if ('detail' in t)
139
+ out.detail = text(t.detail, `${path}/detail`);
140
+ return out;
141
+ }
142
+ function list(value, path, max, parse) {
143
+ if (!Array.isArray(value) || value.length > max)
144
+ throw new ContractError(path, `must be a list of at most ${max}`);
145
+ return value.map((item, index) => parse(item, `${path}/${index}`));
146
+ }
147
+ export function parseReport(input) {
148
+ const root = object(input, '', ['schema', 'sent_at', 'applied_revision', 'generations', 'host', 'versions', 'model_access', 'steps', 'vitals', 'transitions'], ['schema', 'sent_at', 'applied_revision', 'generations', 'steps']);
149
+ if (root.schema !== REPORT_SCHEMA)
150
+ throw new ContractError('/schema', `must be ${REPORT_SCHEMA}`);
151
+ const generations = object(root.generations, '/generations', ['rerun_setup', 'restart_engine'], ['rerun_setup', 'restart_engine']);
152
+ const out = {
153
+ schema: REPORT_SCHEMA,
154
+ sent_at: timestamp(root.sent_at, '/sent_at'),
155
+ applied_revision: integer(root.applied_revision, '/applied_revision', 0),
156
+ generations: { rerun_setup: integer(generations.rerun_setup, '/generations/rerun_setup', 0), restart_engine: integer(generations.restart_engine, '/generations/restart_engine', 0) },
157
+ steps: list(root.steps, '/steps', 16, parseStep),
158
+ };
159
+ copy(root, out, {
160
+ host: (v, p) => copy(object(v, p, ['os', 'arch', 'init', 'cpus', 'ram_gb', 'disk_free_gb', 'clock_skew_seconds']), {}, {
161
+ os: (x, q) => text(x, q, undefined, 64),
162
+ arch: (x, q) => oneOf(x, q, ['x64', 'arm64']),
163
+ init: (x, q) => oneOf(x, q, ['systemd', 'foreground']),
164
+ cpus: (x, q) => integer(x, q, 1, 4096),
165
+ ram_gb: (x, q) => integer(x, q, 0, 65535),
166
+ disk_free_gb: (x, q) => integer(x, q, 0),
167
+ clock_skew_seconds: (x, q) => number(x, q),
168
+ }, p),
169
+ versions: (v, p) => copy(object(v, p, ['cli', 'engine', 'node', 'gh', 'claude', 'codex']), {}, {
170
+ cli: (x, q) => text(x, q, VERSION, 64),
171
+ engine: (x, q) => text(x, q, VERSION, 64),
172
+ node: (x, q) => text(x, q, VERSION, 64),
173
+ gh: (x, q) => text(x, q, VERSION, 64),
174
+ claude: (x, q) => text(x, q, VERSION, 64),
175
+ codex: (x, q) => text(x, q, VERSION, 64),
176
+ }, p),
177
+ model_access: (v, p) => ({ method: oneOf(object(v, p, ['method'], ['method']).method, `${p}/method`, MODEL_METHODS) }),
178
+ vitals: (v, p) => copy(object(v, p, ['load', 'disk_used_percent', 'engine_uptime_seconds', 'threads_relayed']), {}, {
179
+ load: (x, q) => {
180
+ const load = list(x, q, 3, (item, itemPath) => number(item, itemPath, 0));
181
+ if (load.length !== 3)
182
+ throw new ContractError(q, 'must have three values');
183
+ return load;
184
+ },
185
+ disk_used_percent: (x, q) => integer(x, q, 0, 100),
186
+ engine_uptime_seconds: (x, q) => integer(x, q, 0),
187
+ threads_relayed: (x, q) => integer(x, q, 0),
188
+ }, p),
189
+ transitions: (v, p) => list(v, p, 50, parseTransition),
190
+ }, '');
191
+ return out;
192
+ }
@@ -0,0 +1,3 @@
1
+ export declare const PACKAGE_NAME: string;
2
+ export declare const PACKAGE_VERSION: string;
3
+ export declare const NPX: string;
@@ -0,0 +1,5 @@
1
+ import { readFileSync } from 'node:fs';
2
+ const manifest = JSON.parse(readFileSync(new URL('../package.json', import.meta.url), 'utf8'));
3
+ export const PACKAGE_NAME = manifest.name;
4
+ export const PACKAGE_VERSION = manifest.version;
5
+ export const NPX = `npx -y ${PACKAGE_NAME}@${PACKAGE_VERSION}`;
@@ -0,0 +1,109 @@
1
+ import type { Api } from './api.ts';
2
+ import type { KeyFile, NodeFile, Store } from './config.ts';
3
+ import type { Io } from './context.ts';
4
+ export declare const PR_EVENTS_PATH = "/api/v0/hivecode/pr-events";
5
+ export declare const LEDGER_FILE = "pr-events.json";
6
+ export declare const LOCK_FILE = "pr-events.lock";
7
+ export declare const PAGE_LIMIT = 50;
8
+ export declare const MAX_SENDS = 20;
9
+ export declare const MAX_FAILS_IN_A_ROW = 3;
10
+ export declare const MAX_RETRIES = 200;
11
+ export declare const GIVE_UP_ATTEMPTS = 10;
12
+ export declare const GIVE_UP_AFTER_MS: number;
13
+ export declare const FIRST_RUN_MAX_AGE_MS: number;
14
+ /** A T3 Code thread id as the local server knows it, such as `mcp:launch:<hex>`. It never starts with `-`. */
15
+ export declare const NATIVE_ID: RegExp;
16
+ /** A failed send waits this long after its last attempt before it is checked and sent again, so one that lands late is seen. */
17
+ export declare const RESEND_AFTER_MS: number;
18
+ export declare const MAX_CLAIMS = 5000;
19
+ export type Limits = {
20
+ passMs: number;
21
+ sendMs: number;
22
+ minSendMs: number;
23
+ };
24
+ export declare const LIMITS: Limits;
25
+ export type PrEvent = {
26
+ id: number;
27
+ repo: string;
28
+ number: number;
29
+ head_sha: string;
30
+ kind: string;
31
+ reason: string | null;
32
+ occurred_at: string;
33
+ threads: string[];
34
+ };
35
+ /**
36
+ * A send that has not been confirmed. It is saved before the send starts and removed when the send succeeds, so a
37
+ * send cut short by a timeout or a crash is checked against the local T3 Code messages before it is sent again.
38
+ */
39
+ export type Retry = {
40
+ event_id: number;
41
+ thread: string;
42
+ native: string;
43
+ message: string;
44
+ count: number;
45
+ first_at: string;
46
+ last_at?: string;
47
+ };
48
+ /** A T3 Code message accounted for: this node's confirmed send, or the message a retry was matched to. */
49
+ export type Claim = {
50
+ native: string;
51
+ id: string;
52
+ at: string;
53
+ };
54
+ /**
55
+ * `delivered` holds, for events above `cursor`, the threads that were sent each one or are in `retries`. A failed
56
+ * thread no longer holds the cursor. Events from over an hour before `started_at`, the first pull here, are skipped.
57
+ */
58
+ export type Ledger = {
59
+ cursor: number;
60
+ started_at: string;
61
+ delivered: Record<string, string[]>;
62
+ retries: Retry[];
63
+ claimed: Claim[];
64
+ };
65
+ /** How messages reach T3 Code threads. `send` takes the native id and is cut short only by its own timeout. */
66
+ export type Sent = {
67
+ messageId: string | null;
68
+ delivery: string | null;
69
+ };
70
+ export type Transport = {
71
+ send: (nativeId: string, message: string, timeoutMs: number) => Promise<Sent>;
72
+ };
73
+ export type PrEventDeps = {
74
+ env: NodeJS.ProcessEnv;
75
+ store: Store;
76
+ api: Api;
77
+ io: Io;
78
+ now: () => Date;
79
+ transport?: Transport;
80
+ limits?: Limits;
81
+ };
82
+ export type PullResult = {
83
+ events: number;
84
+ sent: number;
85
+ failed: number;
86
+ cursor: number;
87
+ retries: number;
88
+ skipped?: 'locked';
89
+ };
90
+ export declare function prEventsEnabled(env: NodeJS.ProcessEnv): boolean;
91
+ export declare function messageFor(event: PrEvent): string;
92
+ /**
93
+ * One bounded pass, under a lock. Retries go first: a retry is done if its message is already in the thread, waits
94
+ * while the thread is busy, and is sent again only to a settled thread without it. Then new events are pulled after
95
+ * the cursor and sent to each listed thread on this node. A pending retry is saved before every send and removed after
96
+ * it succeeds. The cursor moves past an event once each of its threads was sent it, is in `retries`, or is not on this
97
+ * node. The pass stops before a send that would run past its deadline, on shutdown, after MAX_SENDS sends, or after
98
+ * MAX_FAILS_IN_A_ROW failures, and then holds the cursor before the event it stopped in.
99
+ */
100
+ export declare function pullPrEvents(deps: PrEventDeps, node: NodeFile, key: KeyFile, options?: {
101
+ dryRun?: boolean;
102
+ signal?: AbortSignal;
103
+ }): Promise<PullResult>;
104
+ /**
105
+ * Sends through the `t3 thread send` CLI that ships with T3 Code. Each call signs in to the running server with the
106
+ * server's own local auth and revokes that session after, so no token passes through this process. A busy thread gets
107
+ * the message queued as its next turn and is never steered or interrupted.
108
+ */
109
+ export declare function t3Transport(env: NodeJS.ProcessEnv): Transport;