@hachej/boring-agent 0.1.90 → 0.1.92

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 (37) hide show
  1. package/dist/{chunk-4PKGVPJA.js → chunk-2GBHYJVC.js} +27 -5
  2. package/dist/{chunk-BEFJNMKQ.js → chunk-CJ2BW2W2.js} +23 -8
  3. package/dist/{chunk-F7ZS27HE.js → chunk-IWBC6SF7.js} +93 -19
  4. package/dist/chunk-NITBKFG6.js +1246 -0
  5. package/dist/{chunk-JEDRQAR5.js → chunk-OFQ7J6SI.js} +8 -2
  6. package/dist/{chunk-5CYVBVP3.js → chunk-V3ZD3T3G.js} +4785 -2153
  7. package/dist/core/index.d.ts +5 -5
  8. package/dist/core/index.js +2 -2
  9. package/dist/{createHarness-UCCGMVQJ.js → createHarness-PMYRKDE4.js} +2 -2
  10. package/dist/errors-C38f6pol.d.ts +200 -0
  11. package/dist/front/index.d.ts +20 -4
  12. package/dist/front/index.js +172 -44
  13. package/dist/{harness-Rbkdpvse.d.ts → harness-Cc48o6uS.d.ts} +2 -2
  14. package/dist/{workspaceAgentDispatcher-50Uzuxhs.d.ts → lease-BqeCLGPL.d.ts} +266 -57
  15. package/dist/{protocol-CDA4bcP9.d.ts → middleware-CzW8n7B7.d.ts} +20 -2
  16. package/dist/piChatEvent-BsMp3MSo.d.ts +368 -0
  17. package/dist/{piChatSessionService-DDKPOj4x.d.ts → piChatSessionService-BrPqKrpY.d.ts} +5 -1
  18. package/dist/{sandbox-OEG_l9GE.d.ts → sandbox-DAD8cWQR.d.ts} +14 -1
  19. package/dist/server/agent-host/testing/gatewayConformance.d.ts +41 -0
  20. package/dist/server/agent-host/testing/gatewayConformance.js +465 -0
  21. package/dist/server/index.d.ts +451 -528
  22. package/dist/server/index.js +43 -9
  23. package/dist/server/worker/index.d.ts +2 -2
  24. package/dist/server/worker/index.js +7 -7
  25. package/dist/shared/index.d.ts +115 -41
  26. package/dist/shared/index.js +65 -282
  27. package/dist/types-uQozUhGt.d.ts +759 -0
  28. package/docs/ACCESSIBILITY.md +4 -5
  29. package/docs/API.md +3 -0
  30. package/docs/AUTHORING.md +68 -0
  31. package/docs/ERROR_CODES.md +27 -6
  32. package/docs/README.md +1 -0
  33. package/docs/runtime.md +3 -3
  34. package/package.json +22 -13
  35. package/dist/chunk-CFQQXJKK.js +0 -385
  36. package/dist/chunk-DGRKMMXO.js +0 -8
  37. package/dist/piChatEvent-CHgln6yx.d.ts +0 -367
@@ -1,10 +1,59 @@
1
+ import { D as InterruptReceipt, j as StopReceipt, p as AgentDefinitionErrorCode, q as AgentDeploymentErrorCode } from './piChatEvent-BsMp3MSo.js';
2
+ import { p as AgentSendInput, j as AgentEvent } from './harness-Cc48o6uS.js';
3
+ import { b as AgentSessionRef, n as AgentSendReceipt, A as AgentGateway, a as AuthorizedAgentScope } from './errors-C38f6pol.js';
1
4
  import { z } from 'zod';
2
- import { p as AgentDefinitionErrorCode, q as AgentDeploymentErrorCode, D as InterruptReceipt, j as StopReceipt } from './piChatEvent-CHgln6yx.js';
3
- import { W as Workspace } from './sandbox-OEG_l9GE.js';
4
- import { p as AgentSendInput, j as AgentEvent } from './harness-Rbkdpvse.js';
5
+ import { b as Workspace } from './sandbox-DAD8cWQR.js';
5
6
 
6
- interface FileSearch {
7
- search(glob: string, limit?: number): Promise<string[]>;
7
+ interface WorkspaceAgentDispatcherContext {
8
+ workspaceId: string;
9
+ userId: string;
10
+ }
11
+ type WorkspaceAgentDispatcherSendInput = Omit<AgentSendInput, 'ctx'>;
12
+ interface WorkspaceAgentDispatcherDispatchInput extends WorkspaceAgentDispatcherSendInput {
13
+ /** Durable caller-owned idempotency key. */
14
+ requestId: string;
15
+ /** Defaults to requestId. */
16
+ clientNonce?: string;
17
+ /** Defaults to prompt; follow-up requires a non-negative clientSeq. */
18
+ kind?: 'prompt' | 'followup';
19
+ clientSeq?: number;
20
+ }
21
+ interface WorkspaceAgentDispatch {
22
+ ref: AgentSessionRef;
23
+ receipt: AgentSendReceipt;
24
+ events: AsyncIterable<AgentEvent>;
25
+ }
26
+ /** Addressed gateway binding minted by the trusted composition root. */
27
+ interface WorkspaceAgentGatewayBinding {
28
+ gateway: AgentGateway;
29
+ scope: AuthorizedAgentScope;
30
+ agentTypeId: string;
31
+ }
32
+ /**
33
+ * Compatibility-facing delegation surface. New durable callers use dispatch so
34
+ * the addressed ref and accepted Gateway receipt can be persisted before they
35
+ * consume events. send remains for callers that only need the legacy stream.
36
+ */
37
+ interface WorkspaceAgentDispatcher {
38
+ /** Optional only for source compatibility with pre-Gateway injected resolvers. */
39
+ dispatch?(input: WorkspaceAgentDispatcherDispatchInput): Promise<WorkspaceAgentDispatch>;
40
+ send(input: WorkspaceAgentDispatcherSendInput): AsyncIterable<AgentEvent>;
41
+ interrupt(sessionId: string): Promise<InterruptReceipt>;
42
+ stop(sessionId: string): Promise<StopReceipt>;
43
+ }
44
+
45
+ interface SandboxHandleRecord {
46
+ workspaceId: string;
47
+ sandboxId: string;
48
+ snapshotId?: string;
49
+ createdAt: string;
50
+ lastUsedAt: string;
51
+ }
52
+ interface SandboxHandleStore {
53
+ get(workspaceId: string): Promise<SandboxHandleRecord | null>;
54
+ put(record: SandboxHandleRecord): Promise<void>;
55
+ delete(workspaceId: string): Promise<void>;
56
+ list(): Promise<SandboxHandleRecord[]>;
8
57
  }
9
58
 
10
59
  type Sha256Digest = `sha256:${string}`;
@@ -33,11 +82,8 @@ interface AgentDefinition {
33
82
  definitionId: string;
34
83
  version: string;
35
84
  label?: string;
85
+ description?: string;
36
86
  instructionsRef: string;
37
- capabilityRequirements?: string[];
38
- toolRefs?: string[];
39
- skillRefs?: string[];
40
- mcpServerRefs?: string[];
41
87
  }
42
88
  interface AgentDefinitionReference {
43
89
  definitionId: string;
@@ -80,6 +126,50 @@ declare function createAgentDefinitionDigest(input: {
80
126
  }): Promise<Sha256Digest>;
81
127
  declare function createAgentDeploymentDigest(deployment: AgentDeployment): Promise<Sha256Digest>;
82
128
 
129
+ /**
130
+ * Browser CustomEvent name dispatched on `window` after the workspace's
131
+ * agent-plugin hot reload subscriber commits a registry change (load,
132
+ * unload, or error).
133
+ *
134
+ * Declared in `@hachej/boring-agent` (not `@hachej/boring-workspace`)
135
+ * so the agent's ChatPanel — which listens for this event to refresh
136
+ * its slash-command palette / banner state — can import it without
137
+ * creating a workspace → agent → workspace cycle. Workspace's
138
+ * `useAgentPluginHotReload` imports the same constant.
139
+ */
140
+ declare const WORKSPACE_AGENT_PLUGINS_RELOADED_EVENT = "boring-ui:agent-plugins-reloaded";
141
+ /**
142
+ * One per plugin that loaded successfully but whose server-side surfaces
143
+ * (Fastify routes / agent tools) still hold pre-reload code. Shared
144
+ * between the agent's /reload HTTP route + the ChatPanel banner so the
145
+ * agent layer has ONE declaration of this wire shape. Mirrors what the
146
+ * workspace's `collectRestartWarnings()` emits (workspace owns the
147
+ * canonical `PluginRestartWarning` type; we redeclare here only because
148
+ * the agent layer must not depend on workspace).
149
+ */
150
+ interface PluginRestartWarning {
151
+ id: string;
152
+ surfaces: string[];
153
+ message: string;
154
+ }
155
+ /**
156
+ * Browser CustomEvent name dispatched on `window` when a `showNotification`
157
+ * UI command arrives from the server (e.g. from a plugin slash command that
158
+ * calls `notify()`). `PiChatPanel` listens for this to show the
159
+ * `CommandRunStatus` banner above the composer.
160
+ */
161
+ declare const WORKSPACE_COMMAND_NOTIFY_EVENT = "boring-ui:command-notify";
162
+ /**
163
+ * Payload carried by `WORKSPACE_COMMAND_NOTIFY_EVENT`. Maps directly to
164
+ * what `uiCommandDispatcher` extracts from the `showNotification` command.
165
+ */
166
+ interface CommandNotifyPayload {
167
+ message: string;
168
+ tone: 'success' | 'error' | 'info' | 'warn';
169
+ /** Name of the command that triggered the notification (without leading slash). */
170
+ command?: string;
171
+ }
172
+
83
173
  declare const OpaqueShareLocatorIdSchema: z.ZodEffects<z.ZodString, string, string>;
84
174
  interface ShareEntryProvenance {
85
175
  producerPrincipalRef: string;
@@ -243,58 +333,177 @@ type ShareEntryResolution = {
243
333
  declare function resolveShareEntry(store: ShareEntryStore, id: string, workspace: Workspace): Promise<ShareEntryResolution>;
244
334
 
245
335
  /**
246
- * Browser CustomEvent name dispatched on `window` after the workspace's
247
- * agent-plugin hot reload subscriber commits a registry change (load,
248
- * unload, or error).
249
- *
250
- * Declared in `@hachej/boring-agent` (not `@hachej/boring-workspace`)
251
- * so the agent's ChatPanel — which listens for this event to refresh
252
- * its slash-command palette / banner state — can import it without
253
- * creating a workspace → agent → workspace cycle. Workspace's
254
- * `useAgentPluginHotReload` imports the same constant.
255
- */
256
- declare const WORKSPACE_AGENT_PLUGINS_RELOADED_EVENT = "boring-ui:agent-plugins-reloaded";
257
- /**
258
- * One per plugin that loaded successfully but whose server-side surfaces
259
- * (Fastify routes / agent tools) still hold pre-reload code. Shared
260
- * between the agent's /reload HTTP route + the ChatPanel banner so the
261
- * agent layer has ONE declaration of this wire shape. Mirrors what the
262
- * workspace's `collectRestartWarnings()` emits (workspace owns the
263
- * canonical `PluginRestartWarning` type; we redeclare here only because
264
- * the agent layer must not depend on workspace).
336
+ * Opaque, in-process Core capability. The brand symbol and constructor are not
337
+ * exported; Core records issued object identity in a private WeakMap.
265
338
  */
266
- interface PluginRestartWarning {
267
- id: string;
268
- surfaces: string[];
269
- message: string;
339
+ declare const authorizedWorkspaceCredentialScopeBrand: unique symbol;
340
+ interface AuthorizedWorkspaceCredentialScopeV1 {
341
+ readonly contractVersion: "boring.authorized-workspace-credential-scope.v1";
342
+ readonly [authorizedWorkspaceCredentialScopeBrand]: true;
270
343
  }
271
- /**
272
- * Browser CustomEvent name dispatched on `window` when a `showNotification`
273
- * UI command arrives from the server (e.g. from a plugin slash command that
274
- * calls `notify()`). `PiChatPanel` listens for this to show the
275
- * `CommandRunStatus` banner above the composer.
276
- */
277
- declare const WORKSPACE_COMMAND_NOTIFY_EVENT = "boring-ui:command-notify";
278
- /**
279
- * Payload carried by `WORKSPACE_COMMAND_NOTIFY_EVENT`. Maps directly to
280
- * what `uiCommandDispatcher` extracts from the `showNotification` command.
281
- */
282
- interface CommandNotifyPayload {
283
- message: string;
284
- tone: 'success' | 'error' | 'info' | 'warn';
285
- /** Name of the command that triggered the notification (without leading slash). */
286
- command?: string;
344
+ type VerifiedWorkspaceCredentialPrincipalV1 = Readonly<{
345
+ kind: "user";
346
+ userId: string;
347
+ membershipRole: "owner" | "editor" | "viewer";
348
+ }> | Readonly<{
349
+ kind: "system";
350
+ principalId: string;
351
+ workspaceGrantId: string;
352
+ }>;
353
+ interface VerifiedWorkspaceCredentialAuthorityV1 {
354
+ readonly workspaceId: string;
355
+ readonly appId: string;
356
+ readonly principal: VerifiedWorkspaceCredentialPrincipalV1;
357
+ readonly authorizationReceiptId: string;
358
+ readonly expiresAt: string;
359
+ }
360
+ /** Core-owned verifier; a TypeScript cast or copied object is never authority. */
361
+ interface WorkspaceCredentialAuthorityVerifierV1 {
362
+ readonly contractVersion: "boring.workspace-credential-authority-verifier.v1";
363
+ verifyCurrent(scope: AuthorizedWorkspaceCredentialScopeV1): Promise<VerifiedWorkspaceCredentialAuthorityV1>;
287
364
  }
288
365
 
289
- interface WorkspaceAgentDispatcherContext {
290
- workspaceId: string;
291
- userId: string;
366
+ type ProviderId = string & {
367
+ readonly __providerId: unique symbol;
368
+ };
369
+ type CredentialFieldId = string & {
370
+ readonly __credentialFieldId: unique symbol;
371
+ };
372
+ type CredentialConsumerBindingId = string & {
373
+ readonly __credentialConsumerBindingId: unique symbol;
374
+ };
375
+ type ProviderCategoryV1 = "llm" | "search" | "transcription" | "mcp" | "other";
376
+ interface CredentialFieldDefinitionV1 {
377
+ readonly id: CredentialFieldId;
378
+ readonly label: string;
379
+ readonly required: boolean;
380
+ readonly sensitivity: "secret" | "public";
381
+ readonly minBytes?: number;
382
+ readonly maxBytes: number;
292
383
  }
293
- type WorkspaceAgentDispatcherSendInput = Omit<AgentSendInput, 'ctx'>;
294
- interface WorkspaceAgentDispatcher {
295
- send(input: WorkspaceAgentDispatcherSendInput): AsyncIterable<AgentEvent>;
296
- interrupt(sessionId: string): Promise<InterruptReceipt>;
297
- stop(sessionId: string): Promise<StopReceipt>;
384
+ interface ExternalManagedAccountReferenceDefinitionV1 {
385
+ readonly label: string;
386
+ readonly maxBytes: number;
387
+ readonly persistence: "server-only-metadata";
388
+ }
389
+ type ProviderCredentialDefinitionV1 = Readonly<{
390
+ type: "api-key";
391
+ fields: readonly CredentialFieldDefinitionV1[];
392
+ }> | Readonly<{
393
+ type: "oauth2-authorization-code";
394
+ tokenCustody: "local-vault";
395
+ clientRegistrationRef: string;
396
+ authorizationEndpoint: `https://${string}`;
397
+ tokenEndpoint: `https://${string}`;
398
+ revocationEndpoint?: `https://${string}`;
399
+ scopes: readonly string[];
400
+ usePkce: true;
401
+ refreshTokenField: CredentialFieldDefinitionV1;
402
+ resolvedAccessTokenField: CredentialFieldDefinitionV1;
403
+ accessTokenPersistence: "memory-only";
404
+ }> | Readonly<{
405
+ type: "oauth2-authorization-code";
406
+ tokenCustody: "external-managed";
407
+ custodianAdapterId: string;
408
+ connectUrlOrigins: readonly `https://${string}`[];
409
+ scopes: readonly string[];
410
+ accountReference: ExternalManagedAccountReferenceDefinitionV1;
411
+ delivery: "host-session-adapter-only";
412
+ }> | Readonly<{
413
+ type: "none";
414
+ }>;
415
+ interface ProviderDefinitionV1 {
416
+ readonly contractVersion: "boring.provider.v1";
417
+ readonly id: ProviderId;
418
+ readonly displayName: string;
419
+ readonly category: ProviderCategoryV1;
420
+ readonly credential: ProviderCredentialDefinitionV1;
421
+ readonly consumerBindingIds: readonly CredentialConsumerBindingId[];
422
+ readonly sandboxEgressOrigins: readonly `https://${string}`[];
423
+ readonly mcp?: Readonly<{
424
+ transport: "streamable-http";
425
+ endpoint?: `https://${string}`;
426
+ toolkitId?: string;
427
+ allowedTools: readonly string[];
428
+ deniedTools: readonly string[];
429
+ }>;
430
+ }
431
+ interface ProviderRegistryV1 {
432
+ readonly contractVersion: "boring.provider-registry.v1";
433
+ list(): readonly ProviderDefinitionV1[];
434
+ require(providerId: ProviderId): ProviderDefinitionV1;
435
+ }
436
+ declare function createProviderRegistryV1(defs: readonly ProviderDefinitionV1[]): ProviderRegistryV1;
437
+
438
+ type CredentialConsumerKindV1 = "model-provider" | "first-party-tool" | "plugin-server" | "mcp-server" | "tenant-custom-tool";
439
+ type CredentialDeliveryV1 = "host-only" | "sandbox-pipe" | "sandbox-tmpfs";
440
+ /** Immutable authority registered by the host beside the tool/provider catalog. */
441
+ interface CredentialConsumerBindingV1 {
442
+ readonly contractVersion: "boring.credential-consumer-binding.v1";
443
+ readonly id: CredentialConsumerBindingId;
444
+ readonly providerId: ProviderId;
445
+ readonly consumer: Readonly<{
446
+ id: string;
447
+ kind: CredentialConsumerKindV1;
448
+ trust: "trusted" | "untrusted";
449
+ }>;
450
+ readonly purpose: string;
451
+ readonly allowedFieldIds: readonly CredentialFieldId[];
452
+ readonly delivery: CredentialDeliveryV1;
453
+ readonly sandbox?: Readonly<{
454
+ credentialChannel: "fd-3" | "tmpfs-v1";
455
+ egressOrigins: readonly `https://${string}`[];
456
+ }>;
457
+ }
458
+ interface CredentialConsumerBindingRegistryV1 {
459
+ readonly contractVersion: "boring.credential-consumer-bindings.v1";
460
+ require(bindingId: CredentialConsumerBindingId): CredentialConsumerBindingV1;
461
+ }
462
+ declare function createCredentialConsumerBindingRegistryV1(bindings: readonly CredentialConsumerBindingV1[], providerRegistry: ProviderRegistryV1): CredentialConsumerBindingRegistryV1;
463
+
464
+ declare const PROVIDER_CREDENTIAL_REF_VERSION: "boring.provider-credential-ref.v1";
465
+ /** Constructed by a trusted factory from a registered binding. */
466
+ interface ProviderCredentialRefV1 {
467
+ readonly contractVersion: typeof PROVIDER_CREDENTIAL_REF_VERSION;
468
+ readonly providerId: ProviderId;
469
+ readonly executionId: string;
470
+ readonly bindingId: CredentialConsumerBindingId;
471
+ }
472
+ interface ProviderCredentialRefFactoryV1 {
473
+ readonly contractVersion: "boring.provider-credential-ref-factory.v1";
474
+ create(input: Readonly<{
475
+ providerId: ProviderId;
476
+ executionId: string;
477
+ bindingId: CredentialConsumerBindingId;
478
+ }>): ProviderCredentialRefV1;
479
+ }
480
+ declare function createProviderCredentialRefFactoryV1(bindingRegistry: CredentialConsumerBindingRegistryV1): ProviderCredentialRefFactoryV1;
481
+
482
+ type ResolvedCredentialMaterialV1 = Readonly<{
483
+ kind: "field-set";
484
+ fields: ReadonlyMap<CredentialFieldId, Uint8Array>;
485
+ }> | Readonly<{
486
+ kind: "external-managed-account";
487
+ custodianAdapterId: string;
488
+ opaqueAccountReference: Uint8Array;
489
+ }> | Readonly<{
490
+ kind: "none";
491
+ }>;
492
+ interface ResolvedCredentialLeaseV1 {
493
+ readonly contractVersion: "boring.resolved-credential.v1";
494
+ readonly workspaceId: string;
495
+ readonly providerId: ProviderId;
496
+ readonly credentialVersion: number;
497
+ readonly executionId: string;
498
+ /** Server implementation may use a Node byte array; shared stays Uint8Array. */
499
+ readonly material: ResolvedCredentialMaterialV1;
500
+ readonly expiresAt: string;
501
+ /** Idempotent best-effort overwrite and reference release. */
502
+ dispose(): void;
503
+ }
504
+ interface WorkspaceCredentialResolverV1 {
505
+ readonly contractVersion: "boring.workspace-credential-resolver.v1";
506
+ resolve(workspace: AuthorizedWorkspaceCredentialScopeV1, ref: ProviderCredentialRefV1): Promise<ResolvedCredentialLeaseV1>;
298
507
  }
299
508
 
300
- export { type AgentDeployment as A, createAgentAssetDigest as B, type CompiledAgentBundle as C, createAgentDefinitionDigest as D, createAgentDeploymentDigest as E, type FileSearch as F, resolveShareEntry as G, validateAgentDefinition as H, InMemoryShareEntryStore as I, validateAgentDeployment as J, OpaqueRefSchema as O, type PluginRestartWarning as P, type Sha256Digest as S, type WorkspaceAgentDispatcherContext as W, type ShareEntryStore as a, type WorkspaceAgentDispatcher as b, SchemaValidationError as c, type AgentSchemaIssue as d, type AgentSchemaValidationResult as e, type AgentDefinition as f, type AgentDefinitionDigestAsset as g, type AgentDefinitionReference as h, AgentDefinitionValidationError as i, AgentDeploymentValidationError as j, type CommandNotifyPayload as k, type CompiledAgentDefinition as l, type CreateShareEntryInput as m, OpaqueShareLocatorIdSchema as n, Sha256DigestSchema as o, ShareEntryErrorCode as p, type ShareEntryProvenance as q, ShareEntryProvenanceSchema as r, type ShareEntryResolution as s, type ShareEntryTombstone as t, type ShareEntryV1 as u, ShareEntryV1Schema as v, ShareEntryValidationError as w, WORKSPACE_AGENT_PLUGINS_RELOADED_EVENT as x, WORKSPACE_COMMAND_NOTIFY_EVENT as y, type WorkspaceAgentDispatcherSendInput as z };
509
+ export { ShareEntryValidationError as $, type AgentDeployment as A, type CredentialDeliveryV1 as B, type CompiledAgentBundle as C, type CredentialFieldDefinitionV1 as D, type ExternalManagedAccountReferenceDefinitionV1 as E, OpaqueShareLocatorIdSchema as F, PROVIDER_CREDENTIAL_REF_VERSION as G, type ProviderCategoryV1 as H, InMemoryShareEntryStore as I, type ProviderCredentialDefinitionV1 as J, type ProviderCredentialRefFactoryV1 as K, type ProviderDefinitionV1 as L, type SandboxHandleRecord as M, Sha256DigestSchema as N, OpaqueRefSchema as O, type PluginRestartWarning as P, ShareEntryErrorCode as Q, type ResolvedCredentialMaterialV1 as R, type SandboxHandleStore as S, type ShareEntryProvenance as T, ShareEntryProvenanceSchema as U, type VerifiedWorkspaceCredentialAuthorityV1 as V, type WorkspaceAgentDispatcherContext as W, type ShareEntryResolution as X, type ShareEntryTombstone as Y, type ShareEntryV1 as Z, ShareEntryV1Schema as _, type Sha256Digest as a, type VerifiedWorkspaceCredentialPrincipalV1 as a0, WORKSPACE_AGENT_PLUGINS_RELOADED_EVENT as a1, WORKSPACE_COMMAND_NOTIFY_EVENT as a2, type WorkspaceAgentDispatch as a3, type WorkspaceAgentDispatcherDispatchInput as a4, type WorkspaceAgentDispatcherSendInput as a5, type WorkspaceAgentGatewayBinding as a6, createAgentAssetDigest as a7, createAgentDefinitionDigest as a8, createAgentDeploymentDigest as a9, createCredentialConsumerBindingRegistryV1 as aa, createProviderCredentialRefFactoryV1 as ab, createProviderRegistryV1 as ac, resolveShareEntry as ad, validateAgentDefinition as ae, validateAgentDeployment as af, type ShareEntryStore as b, type WorkspaceAgentDispatcher as c, type ProviderId as d, type CredentialFieldId as e, type AuthorizedWorkspaceCredentialScopeV1 as f, type WorkspaceCredentialAuthorityVerifierV1 as g, type CredentialConsumerBindingRegistryV1 as h, type ProviderRegistryV1 as i, type WorkspaceCredentialResolverV1 as j, type ProviderCredentialRefV1 as k, type ResolvedCredentialLeaseV1 as l, SchemaValidationError as m, type AgentSchemaIssue as n, type AgentSchemaValidationResult as o, type CredentialConsumerBindingId as p, type AgentDefinition as q, type AgentDefinitionDigestAsset as r, type AgentDefinitionReference as s, AgentDefinitionValidationError as t, AgentDeploymentValidationError as u, type CommandNotifyPayload as v, type CompiledAgentDefinition as w, type CreateShareEntryInput as x, type CredentialConsumerBindingV1 as y, type CredentialConsumerKindV1 as z };
@@ -1,4 +1,5 @@
1
- import { d as Stat, e as Entry, b as ExecResult, c as WorkspaceChangeEvent } from './sandbox-OEG_l9GE.js';
1
+ import { d as Stat, e as Entry, a as ExecResult, W as WorkspaceChangeEvent } from './sandbox-DAD8cWQR.js';
2
+ import { FastifyRequest, FastifyReply } from 'fastify';
2
3
 
3
4
  declare const REMOTE_WORKER_RUNTIME_CWD = "/workspace";
4
5
  declare const REMOTE_WORKER_PROVIDER = "remote-worker";
@@ -85,4 +86,21 @@ interface RemoteWorkerFsEventEnvelope {
85
86
  event: WorkspaceChangeEvent;
86
87
  }
87
88
 
88
- export { type RemoteWorkerWorkspaceOp as R, WORKER_INTERNAL_TOKEN_HEADER as W, type RemoteWorkerWorkspaceResult as a, type RemoteWorkerExecRequest as b, REMOTE_WORKER_PROVIDER as c, REMOTE_WORKER_RUNTIME_CWD as d, type RemoteWorkerErrorPayload as e, type RemoteWorkerExecResponse as f, type RemoteWorkerFsEventEnvelope as g, WORKER_REQUEST_ID_HEADER as h, WORKER_WORKSPACE_ID_HEADER as i };
89
+ interface WorkspaceContext {
90
+ workspaceId: string;
91
+ authenticated: boolean;
92
+ }
93
+ interface AuthMiddlewareOptions {
94
+ authToken?: string;
95
+ workspaceId?: string;
96
+ publicPaths?: string[];
97
+ onDevModeWarning?: (message: string) => void;
98
+ }
99
+ declare module 'fastify' {
100
+ interface FastifyRequest {
101
+ workspaceContext: WorkspaceContext;
102
+ }
103
+ }
104
+ declare function createAuthMiddleware(opts?: AuthMiddlewareOptions): (request: FastifyRequest, reply: FastifyReply) => Promise<void>;
105
+
106
+ export { type RemoteWorkerWorkspaceOp as R, WORKER_INTERNAL_TOKEN_HEADER as W, type RemoteWorkerWorkspaceResult as a, type RemoteWorkerExecRequest as b, REMOTE_WORKER_PROVIDER as c, REMOTE_WORKER_RUNTIME_CWD as d, type RemoteWorkerErrorPayload as e, type RemoteWorkerExecResponse as f, type RemoteWorkerFsEventEnvelope as g, WORKER_REQUEST_ID_HEADER as h, WORKER_WORKSPACE_ID_HEADER as i, createAuthMiddleware as j };