@hachej/boring-agent 0.1.111 → 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 (156) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +262 -51
  3. package/dist/agents.d.ts +75 -0
  4. package/dist/agents.js +91 -0
  5. package/dist/approval.d.ts +71 -0
  6. package/dist/approval.js +126 -0
  7. package/dist/artifacts.d.ts +53 -0
  8. package/dist/artifacts.js +129 -0
  9. package/dist/ask-user.d.ts +40 -0
  10. package/dist/ask-user.js +134 -0
  11. package/dist/attachment.d.ts +5 -0
  12. package/dist/attachment.js +4 -0
  13. package/dist/browser-task.d.ts +32 -0
  14. package/dist/browser-task.js +119 -0
  15. package/dist/chat-transport.d.ts +80 -0
  16. package/dist/chat-transport.js +306 -0
  17. package/dist/contracts.d.ts +40 -0
  18. package/dist/contracts.js +1 -0
  19. package/dist/conversations.d.ts +136 -0
  20. package/dist/conversations.js +366 -0
  21. package/dist/definitions.d.ts +37 -0
  22. package/dist/definitions.js +99 -0
  23. package/dist/delivery-input.d.ts +35 -0
  24. package/dist/delivery-input.js +56 -0
  25. package/dist/delivery.d.ts +33 -0
  26. package/dist/delivery.js +154 -0
  27. package/dist/durable-wait.d.ts +23 -0
  28. package/dist/durable-wait.js +79 -0
  29. package/dist/file-convert.d.ts +46 -0
  30. package/dist/file-convert.js +159 -0
  31. package/dist/file-guard.d.ts +50 -0
  32. package/dist/file-guard.js +171 -0
  33. package/dist/file-types.d.ts +17 -0
  34. package/dist/file-types.js +95 -0
  35. package/dist/gateway-provider.d.ts +24 -0
  36. package/dist/gateway-provider.js +42 -0
  37. package/dist/git.d.ts +34 -0
  38. package/dist/git.js +79 -0
  39. package/dist/harness-pool.d.ts +38 -0
  40. package/dist/harness-pool.js +134 -0
  41. package/dist/index.d.ts +4 -0
  42. package/dist/index.js +1 -0
  43. package/dist/json-schema-tool.d.ts +25 -0
  44. package/dist/json-schema-tool.js +19 -0
  45. package/dist/memory/optchat-core.d.ts +118 -0
  46. package/dist/memory/optchat-core.js +317 -0
  47. package/dist/memory/optchat.d.ts +156 -0
  48. package/dist/memory/optchat.js +432 -0
  49. package/dist/mentions.d.ts +56 -0
  50. package/dist/mentions.js +140 -0
  51. package/dist/metering.d.ts +183 -0
  52. package/dist/metering.js +443 -0
  53. package/dist/model-gateway.d.ts +86 -0
  54. package/dist/model-gateway.js +241 -0
  55. package/dist/native-version.d.ts +9 -0
  56. package/dist/native-version.js +7 -0
  57. package/dist/native.d.ts +4 -0
  58. package/dist/native.js +1 -0
  59. package/dist/presentation.d.ts +17 -0
  60. package/dist/presentation.js +39 -0
  61. package/dist/projection-format.d.ts +68 -0
  62. package/dist/projection-format.js +118 -0
  63. package/dist/projection-window.d.ts +9 -0
  64. package/dist/projection-window.js +93 -0
  65. package/dist/projection.d.ts +22 -0
  66. package/dist/projection.js +153 -0
  67. package/dist/question-response.d.ts +20 -0
  68. package/dist/question-response.js +75 -0
  69. package/dist/questions.d.ts +74 -0
  70. package/dist/questions.js +199 -0
  71. package/dist/self-evolving.d.ts +55 -0
  72. package/dist/self-evolving.js +239 -0
  73. package/dist/skills.d.ts +15 -0
  74. package/dist/skills.js +51 -0
  75. package/dist/tool-evidence.d.ts +14 -0
  76. package/dist/tool-evidence.js +54 -0
  77. package/dist/validation.d.ts +38 -0
  78. package/dist/validation.js +68 -0
  79. package/dist/workspaces.d.ts +107 -0
  80. package/dist/workspaces.js +212 -0
  81. package/package.json +145 -150
  82. package/dist/DebugDrawer-JNA43SVR.js +0 -8
  83. package/dist/admin-DORVQfLn.d.ts +0 -340
  84. package/dist/chunk-2BGLZZ7T.js +0 -10
  85. package/dist/chunk-42D6KAQV.js +0 -2882
  86. package/dist/chunk-4XOW57KJ.js +0 -343
  87. package/dist/chunk-72KT6VWV.js +0 -1338
  88. package/dist/chunk-7XAOVFSN.js +0 -28
  89. package/dist/chunk-KJIEMSQP.js +0 -198
  90. package/dist/chunk-KN72XWP7.js +0 -394
  91. package/dist/chunk-N6THTH7P.js +0 -110
  92. package/dist/chunk-V3H5A3BR.js +0 -22501
  93. package/dist/chunk-YGRQ4Q5P.js +0 -20
  94. package/dist/chunk-YTUZFKB3.js +0 -78
  95. package/dist/core/index.d.ts +0 -28
  96. package/dist/core/index.js +0 -617
  97. package/dist/createHarness-DOLOHA62.js +0 -18
  98. package/dist/eval/index.d.ts +0 -247
  99. package/dist/eval/index.js +0 -541
  100. package/dist/file-search-BUgMSKZE.d.ts +0 -289
  101. package/dist/front/artifacts.d.ts +0 -34
  102. package/dist/front/artifacts.js +0 -21
  103. package/dist/front/index.d.ts +0 -1082
  104. package/dist/front/index.js +0 -12912
  105. package/dist/front/styles.css +0 -5380
  106. package/dist/harness-qHlMJhZo.d.ts +0 -276
  107. package/dist/middleware-CaAEXpi5.d.ts +0 -115
  108. package/dist/piChatEvent-DpE0lIb9.d.ts +0 -450
  109. package/dist/piChatSessionService-CBct-hmz.d.ts +0 -86
  110. package/dist/sandbox-BMhut3kh.d.ts +0 -317
  111. package/dist/server/agent-host/testing/compositionRouteProof.d.ts +0 -8
  112. package/dist/server/agent-host/testing/compositionRouteProof.js +0 -78
  113. package/dist/server/agent-host/testing/gatewayConformance.d.ts +0 -43
  114. package/dist/server/agent-host/testing/gatewayConformance.js +0 -605
  115. package/dist/server/index.d.ts +0 -2278
  116. package/dist/server/index.js +0 -274
  117. package/dist/server/pi-session-readability.d.ts +0 -12
  118. package/dist/server/pi-session-readability.js +0 -23
  119. package/dist/server/worker/index.d.ts +0 -68
  120. package/dist/server/worker/index.js +0 -377
  121. package/dist/share-entry-CxS6UJ_L.d.ts +0 -330
  122. package/dist/shared/index.d.ts +0 -2111
  123. package/dist/shared/index.js +0 -262
  124. package/dist/types-DcWoQMn8.d.ts +0 -1377
  125. package/docs/ACCESSIBILITY.md +0 -52
  126. package/docs/AGENT_GATEWAY_V0.md +0 -212
  127. package/docs/AGENT_PACKAGES.md +0 -90
  128. package/docs/API.md +0 -123
  129. package/docs/AUTHORING.md +0 -68
  130. package/docs/CSP.md +0 -41
  131. package/docs/ERROR_CODES.md +0 -229
  132. package/docs/KNOWN_LIMITATIONS.md +0 -100
  133. package/docs/MIGRATION.md +0 -50
  134. package/docs/PERFORMANCE.md +0 -68
  135. package/docs/PLUGINS.md +0 -138
  136. package/docs/README.md +0 -98
  137. package/docs/RISKS-MULTI-TAB.md +0 -46
  138. package/docs/SESSION_IDENTITY.md +0 -91
  139. package/docs/STYLING.md +0 -73
  140. package/docs/UI-SHADCN.md +0 -56
  141. package/docs/VERCEL_COSTS.md +0 -103
  142. package/docs/plans/archive/AGENT_EVAL_FRAMEWORK.md +0 -466
  143. package/docs/plans/archive/agent-package-spec.md +0 -1777
  144. package/docs/plans/archive/harness-followup-capabilities.md +0 -440
  145. package/docs/plans/archive/harness-tool-ui-capabilities.md +0 -144
  146. package/docs/plans/archive/pi-followup-history-projection.md +0 -229
  147. package/docs/plans/archive/pi-tools-migration.md +0 -1061
  148. package/docs/plans/archive/reviews/pi-followup-history-codex-review.md +0 -11
  149. package/docs/plans/archive/reviews/pi-followup-history-gpt-review.md +0 -64
  150. package/docs/plans/archive/reviews/pi-followup-history-opus-review.md +0 -43
  151. package/docs/plans/archive/reviews/pi-followup-history-xai-review.md +0 -43
  152. package/docs/plans/archive/vercel-base-snapshot-template-plan.md +0 -527
  153. package/docs/plans/archive/vercel-persistent-sandbox-adapter.md +0 -553
  154. package/docs/runtime-provisioning.md +0 -157
  155. package/docs/runtime.md +0 -296
  156. package/docs/tools.md +0 -102
@@ -1,276 +0,0 @@
1
- import { k as SessionCtx, d as PiChatEvent, S as SessionStore } from './piChatEvent-DpE0lIb9.js';
2
- import { AgentSessionEvent, PromptOptions } from '@mariozechner/pi-coding-agent';
3
-
4
- interface TelemetrySink {
5
- capture(event: TelemetryEvent): void | Promise<void>;
6
- flush?(): void | Promise<void>;
7
- }
8
- interface TelemetryEvent {
9
- name: string;
10
- distinctId?: string;
11
- properties?: Record<string, unknown>;
12
- }
13
- declare const noopTelemetry: TelemetrySink;
14
- declare function safeCapture(telemetry: TelemetrySink, event: TelemetryEvent): void;
15
-
16
- type JSONSchema = Record<string, unknown>;
17
- type ToolReadinessRequirement = 'workspace-fs' | 'sandbox-exec' | 'ui-bridge' | 'runtime-dependencies' | `runtime:${string}`;
18
- interface AgentTool {
19
- name: string;
20
- description: string;
21
- /** Optional one-line prompt entry. Pi-built tools should preserve pi's snippet verbatim. */
22
- promptSnippet?: string;
23
- readinessRequirements?: ToolReadinessRequirement[];
24
- parameters: JSONSchema;
25
- execute(params: Record<string, unknown>, ctx: ToolExecContext): Promise<ToolResult>;
26
- }
27
- interface ToolExecContext {
28
- abortSignal: AbortSignal;
29
- toolCallId: string;
30
- onUpdate?: (partial: string) => void;
31
- /** Agent chat/session id executing this tool, when known. */
32
- sessionId?: string;
33
- /** Authenticated human user executing this tool, when known. */
34
- userId?: string;
35
- userEmail?: string;
36
- userEmailVerified?: boolean;
37
- workspaceId?: string;
38
- requestId?: string;
39
- }
40
- interface ToolResult {
41
- content: Array<{
42
- type: 'text';
43
- text: string;
44
- }>;
45
- isError?: boolean;
46
- details?: unknown;
47
- }
48
-
49
- declare const AGENT_NOT_IMPLEMENTED_UNTIL_T1: "ERR_NOT_IMPLEMENTED_UNTIL_T1";
50
- interface MessageAttachment {
51
- filename?: string;
52
- mediaType?: string;
53
- /** data: URL or remote URL */
54
- url: string;
55
- }
56
- interface AgentActor {
57
- id?: string;
58
- name?: string;
59
- }
60
- interface AgentMessagePart {
61
- type: string;
62
- text?: string;
63
- [key: string]: unknown;
64
- }
65
- type AgentMessageContent = string | AgentMessagePart[];
66
- interface AgentSendInput {
67
- sessionId?: string;
68
- content?: AgentMessageContent;
69
- /** @deprecated Use content. Present for the P1 SendMessageInput rename window. */
70
- message?: string;
71
- attachments?: MessageAttachment[];
72
- actor?: AgentActor;
73
- ctx?: SessionCtx;
74
- originSurface?: string;
75
- thinkingLevel?: 'off' | 'low' | 'medium' | 'high';
76
- model?: {
77
- provider: string;
78
- id: string;
79
- };
80
- }
81
- interface AgentStartReceipt {
82
- sessionId: string;
83
- startIndex: number;
84
- }
85
- interface AgentStreamOptions {
86
- startIndex: number;
87
- ctx?: SessionCtx;
88
- }
89
- interface AgentEvent {
90
- v: 1;
91
- eventIndex: number;
92
- timestamp: number;
93
- sessionId: string;
94
- chunk: PiChatEvent;
95
- }
96
- interface SessionStreamIdentity {
97
- readonly workspaceScopeId: string;
98
- readonly sessionId: string;
99
- }
100
- interface AgentResolveInputResponse {
101
- approved?: boolean;
102
- content?: string;
103
- value?: unknown;
104
- }
105
- interface AgentRuntimeAdapter {
106
- readonly id: string;
107
- dispose?(): void | Promise<void>;
108
- }
109
- interface AgentReadinessStatus {
110
- key: string;
111
- ready: boolean;
112
- state?: 'not-started' | 'preparing' | 'ready' | 'failed';
113
- errorCode?: string;
114
- causeCode?: string;
115
- retryable?: boolean;
116
- workspaceId?: string;
117
- message?: string;
118
- }
119
- interface AgentReadiness {
120
- requirements: string[];
121
- status(): Promise<AgentReadinessStatus[]>;
122
- }
123
- interface AgentConfig {
124
- harnessFactory?: AgentCoreHarnessFactory;
125
- runtime: AgentRuntimeAdapter;
126
- tools?: AgentTool[];
127
- readiness?: AgentReadiness;
128
- readinessRequirements?: string[];
129
- sessions?: SessionStore;
130
- systemPromptAppend?: string;
131
- systemPromptDynamic?: () => string | undefined | Promise<string | undefined>;
132
- telemetry?: TelemetrySink;
133
- metering?: unknown;
134
- sessionStorageRoot?: string;
135
- workdir?: string;
136
- }
137
- interface Agent {
138
- start(input: AgentSendInput): Promise<AgentStartReceipt>;
139
- stream(sessionId: string, options: AgentStreamOptions): AsyncIterable<AgentEvent>;
140
- send(input: AgentSendInput): AsyncIterable<AgentEvent>;
141
- resolveInput(sessionId: string, requestId: string, response: AgentResolveInputResponse): Promise<never>;
142
- interrupt(sessionId: string, ctx?: SessionCtx): Promise<unknown>;
143
- stop(sessionId: string, ctx?: SessionCtx): Promise<unknown>;
144
- sessions: SessionStore;
145
- readiness: AgentReadiness;
146
- dispose(): Promise<void>;
147
- }
148
- declare class AgentNotImplementedError extends Error {
149
- readonly code: "ERR_NOT_IMPLEMENTED_UNTIL_T1";
150
- constructor(message?: string);
151
- }
152
-
153
- interface AgentHarnessFactoryInput {
154
- tools: AgentTool[];
155
- /** Host/storage cwd used for harness-owned filesystem resources. */
156
- cwd: string;
157
- /** Agent-visible cwd used by Pi/system prompt/session metadata. */
158
- runtimeCwd?: string;
159
- systemPromptAppend?: string;
160
- sessionNamespace?: string;
161
- sessionRoot?: string;
162
- sessionDir?: string;
163
- /**
164
- * Optional dynamic system-prompt source. Harness calls it whenever it
165
- * builds or rebuilds a session prompt and appends the returned string.
166
- * Workspace plugin layer wires this so live-reloaded plugins can contribute
167
- * prompt context without a workspace-injected harness extension.
168
- */
169
- systemPromptDynamic?: () => string | undefined | Promise<string | undefined>;
170
- /** Host-provided telemetry sink. Optional and best-effort; harnesses may ignore it. */
171
- telemetry?: TelemetrySink;
172
- }
173
- type AgentHarnessFactory = (input: AgentHarnessFactoryInput) => AgentHarness | Promise<AgentHarness>;
174
- interface AgentCoreSessionSnapshot {
175
- state: unknown;
176
- messages: readonly unknown[];
177
- isStreaming: boolean;
178
- isRetrying: boolean;
179
- retryAttempt: number;
180
- pendingMessageCount: number;
181
- steeringMessages: readonly string[];
182
- followUpMessages: readonly string[];
183
- followUpMode: 'all' | 'one-at-a-time';
184
- sessionId: string;
185
- sessionName?: string;
186
- }
187
- type AgentCorePromptInput = string | {
188
- text: string;
189
- options?: PromptOptions;
190
- };
191
- interface AgentCoreSessionAdapter {
192
- readSnapshot(): AgentCoreSessionSnapshot;
193
- subscribe(listener: (event: AgentSessionEvent) => void): () => void;
194
- prompt(input: AgentCorePromptInput): Promise<void>;
195
- followUp(text: string, options?: never): Promise<void>;
196
- clearFollowUp(options?: never): void;
197
- abort(): Promise<void>;
198
- abortRetry?: () => void;
199
- continueQueuedFollowUp?: () => Promise<void>;
200
- }
201
- type AgentCoreHarness = AgentHarness & {
202
- getPiSessionAdapter(input: AgentSendInput, ctx: RunContext): Promise<AgentCoreSessionAdapter>;
203
- hasPiSession?: (sessionId: string, ctx?: {
204
- workspaceId?: string;
205
- userId?: string;
206
- }) => boolean;
207
- };
208
- type AgentCoreHarnessFactory = (input: AgentHarnessFactoryInput) => AgentCoreHarness | Promise<AgentCoreHarness>;
209
- interface AgentHarness {
210
- readonly id: string;
211
- readonly placement: 'server' | 'browser';
212
- /** Session lifecycle; may delegate to an underlying runtime (e.g. pi's JSONL). */
213
- sessions: SessionStore;
214
- /**
215
- * Resolved system prompt currently in effect for `sessionId`. Returns
216
- * `undefined` when the underlying runtime hasn't yet instantiated a
217
- * session (typical pre-first-turn state — pi creates lazily on the first
218
- * prompt). Optional so non-pi harnesses can opt out cleanly.
219
- */
220
- getSystemPrompt?: (sessionId: string) => string | undefined;
221
- /** Reload native agent resources/extensions for an existing session. */
222
- reloadSession?: (sessionId: string) => Promise<boolean>;
223
- /**
224
- * Resource (skill/extension) load diagnostics for an existing session.
225
- * Returns `[]` when the session has no live agent session yet. Lets the
226
- * /reload route and the `plugin_diagnostics` tool surface silent
227
- * skill/extension load failures back to the UI and the agent.
228
- */
229
- getResourceDiagnostics?: (sessionId: string) => Array<{
230
- source: string;
231
- message: string;
232
- path?: string;
233
- }>;
234
- /** List slash commands registered in the agent runtime for a given session. */
235
- getSlashCommands?: (sessionId: string, ctx: RunContext) => ReadonlyArray<AgentSlashCommandSummary> | Promise<ReadonlyArray<AgentSlashCommandSummary>>;
236
- /**
237
- * Execute a named slash command registered via `pi.registerCommand` in a
238
- * plugin extension. Calls the handler in-process; the handler may dispatch
239
- * UI commands (openPanel, notify) through the workspace bridge. Throws if
240
- * the command is not found or the handler throws.
241
- */
242
- executeSlashCommand?: (sessionId: string, name: string, args: string, ctx: RunContext) => Promise<void>;
243
- }
244
- interface AgentSlashCommandSummary {
245
- name: string;
246
- description?: string;
247
- source: 'extension' | 'prompt' | 'skill';
248
- /**
249
- * Name of the originating plugin/package, when derivable from Pi's
250
- * sourceInfo (e.g. a `.pi/extensions/<name>` runtime plugin, or an
251
- * `npm:`/`git/` package). Surfaced as a tag in the slash-command picker.
252
- * Absent for built-in/top-level commands with no package origin.
253
- */
254
- sourcePlugin?: string;
255
- }
256
-
257
- /** @deprecated Use AgentSendInput.content. Kept so existing shared consumers compile during the P1 rename. */
258
- type SendMessageInput = AgentSendInput & {
259
- sessionId: string;
260
- message: string;
261
- };
262
- interface RunContext {
263
- abortSignal: AbortSignal;
264
- workdir: string;
265
- workspaceId?: string;
266
- requestId?: string;
267
- userId?: string;
268
- userEmail?: string;
269
- userEmailVerified?: boolean;
270
- /** Canonical storage/live identity for commands and prompts sharing one Pi handle. */
271
- sessionCtx?: SessionCtx;
272
- /** When false, slash-command fallback through native model prompt must fail closed. */
273
- allowPromptDispatch?: boolean;
274
- }
275
-
276
- export { type AgentHarness as A, safeCapture as B, type ToolReadinessRequirement as C, type AgentHarnessFactory as D, type AgentHarnessFactoryInput as E, type JSONSchema as J, type MessageAttachment as M, type RunContext as R, type SendMessageInput as S, type TelemetryEvent as T, type AgentReadiness as a, type Agent as b, AGENT_NOT_IMPLEMENTED_UNTIL_T1 as c, type AgentActor as d, type AgentCoreHarness as e, type AgentCoreHarnessFactory as f, type AgentCorePromptInput as g, type AgentCoreSessionAdapter as h, type AgentCoreSessionSnapshot as i, type AgentEvent as j, type AgentMessageContent as k, type AgentMessagePart as l, AgentNotImplementedError as m, type AgentReadinessStatus as n, type AgentResolveInputResponse as o, type AgentSendInput as p, type AgentStartReceipt as q, type AgentStreamOptions as r, type AgentTool as s, type AgentRuntimeAdapter as t, type AgentConfig as u, type SessionStreamIdentity as v, type TelemetrySink as w, type ToolExecContext as x, type ToolResult as y, noopTelemetry as z };
@@ -1,115 +0,0 @@
1
- import { S as Stat, E as Entry, a as ExecResult, W as WorkspaceChangeEvent } from './sandbox-BMhut3kh.js';
2
- import { FastifyRequest, FastifyReply } from 'fastify';
3
-
4
- declare const REMOTE_WORKER_RUNTIME_CWD = "/workspace";
5
- declare const REMOTE_WORKER_PROVIDER = "remote-worker";
6
- declare const REMOTE_WORKER_EXCLUSIVE_BINARY_CREATE_CAPABILITY = "exclusive-binary-create";
7
- interface RemoteWorkerHealthResponse {
8
- ok: true;
9
- capabilities?: Array<typeof REMOTE_WORKER_EXCLUSIVE_BINARY_CREATE_CAPABILITY>;
10
- }
11
- declare const WORKER_INTERNAL_TOKEN_HEADER = "x-boring-internal-token";
12
- declare const WORKER_WORKSPACE_ID_HEADER = "x-boring-workspace-id";
13
- declare const WORKER_REQUEST_ID_HEADER = "x-boring-request-id";
14
- type RemoteWorkerWorkspaceOp = {
15
- op: 'readFile';
16
- path: string;
17
- } | {
18
- op: 'readBinaryFile';
19
- path: string;
20
- } | {
21
- op: 'writeFile';
22
- path: string;
23
- data: string;
24
- } | {
25
- op: 'writeBinaryFile';
26
- path: string;
27
- dataBase64: string;
28
- } | {
29
- op: 'createBinaryFile';
30
- path: string;
31
- dataBase64: string;
32
- } | {
33
- op: 'readFileWithStat';
34
- path: string;
35
- } | {
36
- op: 'writeFileWithStat';
37
- path: string;
38
- data: string;
39
- } | {
40
- op: 'writeBinaryFileWithStat';
41
- path: string;
42
- dataBase64: string;
43
- } | {
44
- op: 'unlink';
45
- path: string;
46
- } | {
47
- op: 'readdir';
48
- path: string;
49
- } | {
50
- op: 'stat';
51
- path: string;
52
- } | {
53
- op: 'mkdir';
54
- path: string;
55
- recursive?: boolean;
56
- } | {
57
- op: 'rename';
58
- from: string;
59
- to: string;
60
- };
61
- type RemoteWorkerWorkspaceResult = {
62
- content: string;
63
- } | {
64
- dataBase64: string;
65
- } | {
66
- stat: Stat;
67
- } | {
68
- content: string;
69
- stat: Stat;
70
- } | {
71
- entries: Entry[];
72
- } | {
73
- ok: true;
74
- };
75
- interface RemoteWorkerExecRequest {
76
- cmd: string;
77
- cwd?: string;
78
- env?: Record<string, string>;
79
- timeoutMs?: number;
80
- maxOutputBytes?: number;
81
- }
82
- interface RemoteWorkerExecResponse extends Omit<ExecResult, 'stdout' | 'stderr'> {
83
- stdoutBase64: string;
84
- stderrBase64: string;
85
- }
86
- interface RemoteWorkerErrorPayload {
87
- error: {
88
- code: string;
89
- message: string;
90
- statusCode?: number;
91
- details?: unknown;
92
- };
93
- }
94
- interface RemoteWorkerFsEventEnvelope {
95
- event: WorkspaceChangeEvent;
96
- }
97
-
98
- interface WorkspaceContext {
99
- workspaceId: string;
100
- authenticated: boolean;
101
- }
102
- interface AuthMiddlewareOptions {
103
- authToken?: string;
104
- workspaceId?: string;
105
- publicPaths?: string[];
106
- onDevModeWarning?: (message: string) => void;
107
- }
108
- declare module 'fastify' {
109
- interface FastifyRequest {
110
- workspaceContext: WorkspaceContext;
111
- }
112
- }
113
- declare function createAuthMiddleware(opts?: AuthMiddlewareOptions): (request: FastifyRequest, reply: FastifyReply) => Promise<void>;
114
-
115
- export { type RemoteWorkerWorkspaceOp as R, WORKER_INTERNAL_TOKEN_HEADER as W, type RemoteWorkerWorkspaceResult as a, type RemoteWorkerHealthResponse as b, type RemoteWorkerExecRequest as c, REMOTE_WORKER_EXCLUSIVE_BINARY_CREATE_CAPABILITY as d, REMOTE_WORKER_PROVIDER as e, REMOTE_WORKER_RUNTIME_CWD as f, type RemoteWorkerErrorPayload as g, type RemoteWorkerExecResponse as h, type RemoteWorkerFsEventEnvelope as i, WORKER_REQUEST_ID_HEADER as j, WORKER_WORKSPACE_ID_HEADER as k, createAuthMiddleware as l };