@hachej/boring-agent 0.1.104 → 0.1.107

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 (34) hide show
  1. package/dist/{chunk-K25PK5EC.js → chunk-3JFPS2O6.js} +1 -0
  2. package/dist/{chunk-JNEKOVMJ.js → chunk-6OANSUEI.js} +1 -1
  3. package/dist/{chunk-4IQ4HHBG.js → chunk-7XAOVFSN.js} +7 -0
  4. package/dist/{chunk-I7KFNGB4.js → chunk-GS4ADE34.js} +877 -349
  5. package/dist/{chunk-BTYOMR7W.js → chunk-KDXIXVF6.js} +5179 -3668
  6. package/dist/{chunk-6DRHERVK.js → chunk-MVKXLMH3.js} +44 -2
  7. package/dist/chunk-YTUZFKB3.js +78 -0
  8. package/dist/core/index.d.ts +5 -5
  9. package/dist/core/index.js +2 -2
  10. package/dist/{createHarness-POZ4AXCZ.js → createHarness-AHWSC36D.js} +3 -3
  11. package/dist/{errors-DH7C01Pm.d.ts → errors-CEU4iujR.d.ts} +59 -4
  12. package/dist/{file-search-qcD5zItr.d.ts → file-search-BGUHnW9o.d.ts} +3 -3
  13. package/dist/front/index.d.ts +43 -7
  14. package/dist/front/index.js +1505 -729
  15. package/dist/front/styles.css +109 -15
  16. package/dist/{harness-Dcd08yKr.d.ts → harness-Ct0e4RWc.d.ts} +6 -3
  17. package/dist/{lease-DffrPrQn.d.ts → lease-nASWv2tU.d.ts} +1 -1
  18. package/dist/{piChatEvent-iNSXiFQq.d.ts → piChatEvent-BUWIzw5l.d.ts} +67 -36
  19. package/dist/{piChatSessionService-DQSQ_kWZ.d.ts → piChatSessionService-nvroRAVk.d.ts} +13 -11
  20. package/dist/server/agent-host/testing/gatewayConformance.d.ts +6 -5
  21. package/dist/server/agent-host/testing/gatewayConformance.js +57 -8
  22. package/dist/server/index.d.ts +207 -243
  23. package/dist/server/index.js +15 -9
  24. package/dist/server/worker/index.js +7 -7
  25. package/dist/shared/index.d.ts +34 -28
  26. package/dist/shared/index.js +8 -8
  27. package/dist/{types-B1xDlBSo.d.ts → types-B7-PN5jV.d.ts} +75 -23
  28. package/docs/AGENT_GATEWAY_V0.md +40 -2
  29. package/docs/ERROR_CODES.md +2 -1
  30. package/docs/README.md +1 -0
  31. package/docs/SESSION_IDENTITY.md +91 -0
  32. package/docs/tools.md +4 -0
  33. package/package.json +11 -10
  34. package/dist/chunk-WSQ5QNIY.js +0 -18
@@ -1,22 +1,23 @@
1
- import { P as ProvisionWorkspaceRuntimeOptions, W as WorkspaceProvisioningResult, a as PiPackageSource, R as RuntimeModeAdapter, b as RuntimeModeId, B as BuiltinRuntimeModeId, c as AgentRuntimeHostOperations, d as RuntimeBashStrategy, e as RuntimeFilesystemStrategy, M as ModeContext, f as WorkspaceProvisioningAdapter, g as AgentInstructionFileRef, C as ConfiguredAgentHostAgentSpec, h as AgentHostAgentSpec, i as RuntimeBundle, j as PiHarnessOptions, k as AgentMeteringSink, l as RuntimeFilesystemBinding, m as CreatedAgentHost, n as MeteringErrorLogger, o as ReadyStatusTracker, p as CreateAgentHostOptions, q as CompiledAgentHostAgentSpec, r as AgentRequestLedger, s as AgentEffectAdmission, t as AuthorizedEnvironmentIntent, u as AgentHostEnvironmentScope, v as ResolvedAgentRuntimeScope, w as AgentRequestKey, x as AgentRequestLedgerPrepareResult, y as AgentRequestFailure, z as AgentRequestLedgerRecord, D as AgentFleetCompiler, E as AgentRequestTarget, F as RuntimeFilesystemAccessDecision } from '../types-B1xDlBSo.js';
2
- export { A as AgentGatewayEffect, G as AgentHostDescription, H as AgentHostDirectProjectionOptions, I as AgentHostDispatcherRunInput, J as AgentHostEnvironmentLease, K as AgentHostHandle, L as LegacyDefaultAgentHostSpec, N as MeteringReleaseInput, O as MeteringReleaseReason, Q as MeteringReservationResult, S as MeteringReserveInput, T as MeteringRunKind, U as MeteringRunScope, V as MeteringRunStatus, X as MeteringSettleInput, Y as MeteringUsage, Z as MeteringUsageInput, _ as PI_PACKAGE_RESOURCE_FILTERS, $ as PiExtensionFactory, a0 as PluginSkillSource, a1 as ResolvedEnvironmentScope, a2 as RuntimeFilesystemBindingOperations, a3 as RuntimeNodePackageSpec, a4 as RuntimeProvisioningContribution, a5 as RuntimePythonSpec, a6 as RuntimeTemplateContribution, a7 as WorkspaceProvisioningExecResult, a8 as compactPiPackages, a9 as mergePiPackageSources, aa as normalizeMeteringUsage, ab as piPackageSourceKey } from '../types-B1xDlBSo.js';
1
+ import { P as ProvisionWorkspaceRuntimeOptions, W as WorkspaceProvisioningResult, a as PiPackageSource, R as RuntimeModeAdapter, b as RuntimeModeId, B as BuiltinRuntimeModeId, c as AgentRuntimeHostOperations, d as RuntimeBashStrategy, e as RuntimeFilesystemStrategy, M as ModeContext, f as WorkspaceProvisioningAdapter, g as AgentInstructionSource, C as ConfiguredAgentHostAgentSpec, h as AgentInstructionFileRef, i as AgentHostAgentSpec, j as RuntimeBundle, k as PiHarnessOptions, l as AgentMeteringSink, m as RuntimeFilesystemBinding, n as CreatedAgentHost, o as ResolvedPiHarnessOptions, p as ReadyStatusTracker, q as CreateAgentHostOptions, r as CompiledAgentHostAgentSpec, s as AgentRequestLedger, t as AgentEffectAdmission, u as AuthorizedEnvironmentIntent, v as AgentHostEnvironmentScope, w as ResolvedAgentRuntimeScope, x as AgentRequestKey, y as AgentRequestLedgerPrepareResult, z as AgentRequestFailure, D as AgentRequestLedgerRecord, E as AgentFleetCompiler, F as AgentRequestTarget, G as RuntimeFilesystemAccessDecision } from '../types-B7-PN5jV.js';
2
+ export { A as AgentGatewayEffect, H as AgentHostDescription, I as AgentHostDirectProjectionOptions, J as AgentHostDispatcherRunInput, K as AgentHostEnvironmentLease, L as AgentHostHandle, N as DEFAULT_AGENT_TYPE_ID, O as MeteringErrorLogger, Q as MeteringReleaseInput, S as MeteringReleaseReason, T as MeteringReservationResult, U as MeteringReserveInput, V as MeteringRunKind, X as MeteringRunScope, Y as MeteringRunStatus, Z as MeteringSettleInput, _ as MeteringUsage, $ as MeteringUsageInput, a0 as PI_PACKAGE_RESOURCE_FILTERS, a1 as PiExtensionFactory, a2 as PluginSkillSource, a3 as ResolvedEnvironmentScope, a4 as RuntimeFilesystemBindingOperations, a5 as RuntimeNodePackageSpec, a6 as RuntimeProvisioningContribution, a7 as RuntimePythonSpec, a8 as RuntimeTemplateContribution, a9 as WorkspaceProvisioningExecResult, aa as compactPiPackages, ab as mergePiPackageSources, ac as normalizeMeteringUsage, ad as piPackageSourceKey } from '../types-B7-PN5jV.js';
3
3
  import { d as ExecOptions, a as ExecResult, W as WorkspaceChangeEvent, b as Workspace, c as Sandbox } from '../sandbox-BMhut3kh.js';
4
4
  export { h as RuntimeFilesystemCapability } from '../sandbox-BMhut3kh.js';
5
5
  import { b as RemoteWorkerHealthResponse, R as RemoteWorkerWorkspaceOp, a as RemoteWorkerWorkspaceResult, c as RemoteWorkerExecRequest } from '../middleware-CaAEXpi5.js';
6
6
  export { d as REMOTE_WORKER_EXCLUSIVE_BINARY_CREATE_CAPABILITY, e as REMOTE_WORKER_PROVIDER, f as REMOTE_WORKER_RUNTIME_CWD, g as RemoteWorkerErrorPayload, h as RemoteWorkerExecResponse, i as RemoteWorkerFsEventEnvelope, W as WORKER_INTERNAL_TOKEN_HEADER, j as WORKER_REQUEST_ID_HEADER, k as WORKER_WORKSPACE_ID_HEADER, l as createAgentAuthMiddleware } from '../middleware-CaAEXpi5.js';
7
7
  import { SandboxProviderV1, WorkspaceSandboxPairV1 } from '@hachej/boring-sandbox/shared';
8
8
  import { BwrapSandboxProviderOptions } from '@hachej/boring-sandbox/providers/bwrap';
9
- import { F as SandboxHandleStore, k as CompiledAgentBundle, a as Sha256Digest, i as AgentDeployment, M as ShareEntryStore, y as ProviderId, c as CredentialFieldId, B as ResolvedCredentialMaterialV1, d as AuthorizedWorkspaceCredentialScopeV1, V as VerifiedWorkspaceCredentialAuthorityV1, X as WorkspaceCredentialAuthorityVerifierV1, n as CredentialConsumerBindingRegistryV1, z as ProviderRegistryV1, Y as WorkspaceCredentialResolverV1, P as ProviderCredentialRefV1, R as ResolvedCredentialLeaseV1 } from '../lease-DffrPrQn.js';
10
- import { y as ErrorCode, n as SessionCtx, c as PiChatEvent, S as SessionStore, a as SessionListOptions, b as SessionSummary, P as PiChatSnapshot, d as PromptPayload, e as PromptReceipt, F as FollowUpPayload, f as FollowUpReceipt, Q as QueueClearPayload, g as QueueClearReceipt, I as InterruptPayload, i as StopPayload, j as StopReceipt } from '../piChatEvent-iNSXiFQq.js';
11
- import { x as JsonValue, A as AgentGateway, a as AuthorizedAgentScope, b as AgentSessionRef, c as AgentSessionActivity, V as VerifiedAgentScopeClaim, i as AgentGatewayErrorDTO, p as AgentSessionSummary, o as AgentSessionStateSnapshot, l as AgentSessionConnection } from '../errors-DH7C01Pm.js';
12
- import { d as AgentActor, j as AgentEvent, v as TelemetrySink, s as AgentTool, D as AgentHarnessFactory, A as AgentHarness } from '../harness-Dcd08yKr.js';
13
- export { u as AgentConfig, E as AgentHarnessFactoryInput } from '../harness-Dcd08yKr.js';
9
+ import { F as SandboxHandleStore, k as CompiledAgentBundle, a as Sha256Digest, i as AgentDeployment, M as ShareEntryStore, y as ProviderId, c as CredentialFieldId, B as ResolvedCredentialMaterialV1, d as AuthorizedWorkspaceCredentialScopeV1, V as VerifiedWorkspaceCredentialAuthorityV1, X as WorkspaceCredentialAuthorityVerifierV1, n as CredentialConsumerBindingRegistryV1, z as ProviderRegistryV1, Y as WorkspaceCredentialResolverV1, P as ProviderCredentialRefV1, R as ResolvedCredentialLeaseV1 } from '../lease-nASWv2tU.js';
10
+ import { z as ErrorCode, o as SessionCtx, a as SessionListOptions, b as SessionSummary, c as PiChatSnapshot, d as PiChatEvent, e as PromptReceipt, F as FollowUpPayload, f as FollowUpReceipt, Q as QueueClearPayload, g as QueueClearReceipt, I as InterruptPayload, h as CommandReceipt, i as StopPayload, j as StopReceipt, S as SessionStore } from '../piChatEvent-BUWIzw5l.js';
11
+ import { B as JsonValue, A as AgentGateway, a as AuthorizedAgentScope, b as AgentSessionRef, c as AgentSessionActivity, V as VerifiedAgentScopeClaim, g as AgentAccessOperation, f as AgentAccessDecision, k as AgentGatewayErrorDTO, r as AgentSessionSummary, q as AgentSessionStateSnapshot, n as AgentSessionConnection } from '../errors-CEU4iujR.js';
12
+ export { F as ResolveAgentAccess, G as ResolveAgentAccessInput } from '../errors-CEU4iujR.js';
13
+ import { d as AgentActor, j as AgentEvent, w as TelemetrySink, s as AgentTool, D as AgentHarnessFactory, A as AgentHarness } from '../harness-Ct0e4RWc.js';
14
+ export { u as AgentConfig, E as AgentHarnessFactoryInput } from '../harness-Ct0e4RWc.js';
14
15
  import { IncomingMessage, ServerResponse } from 'node:http';
15
16
  import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
16
17
  import { FastifyRequest, FastifyInstance, FastifyPluginCallback } from 'fastify';
17
- import { i as PiSessionRequestContext, g as PiChatSessionService, h as PiSessionCreateInit, e as PiChatEventSubscriber, P as PiChatEventStreamResult } from '../piChatSessionService-DQSQ_kWZ.js';
18
- import { c as WorkspaceAgentDirectRunInput, W as WorkspaceAgentDirectRunCallback, f as WorkspaceAgentDispatcherContext, e as WorkspaceAgentDispatcher, i as WorkspaceAgentGatewayBinding } from '../file-search-qcD5zItr.js';
19
- export { L as LeaseBoundWorkspaceAgent } from '../file-search-qcD5zItr.js';
18
+ import { i as PiSessionRequestContext, j as AgentPromptPayload, k as PiChatAttachmentResult } from '../piChatSessionService-nvroRAVk.js';
19
+ import { c as WorkspaceAgentDirectRunInput, W as WorkspaceAgentDirectRunCallback, f as WorkspaceAgentDispatcherContext, e as WorkspaceAgentDispatcher, i as WorkspaceAgentGatewayBinding } from '../file-search-BGUHnW9o.js';
20
+ export { L as LeaseBoundWorkspaceAgent } from '../file-search-BGUHnW9o.js';
20
21
  import { SettingsManager } from '@mariozechner/pi-coding-agent';
21
22
  import '@hachej/boring-bash/agent';
22
23
  import '@hachej/boring-sandbox/providers/node-workspace';
@@ -204,7 +205,7 @@ declare function createBlaxelSandboxModeAdapter(options: {
204
205
  }): RuntimeModeAdapter;
205
206
 
206
207
  interface ProviderRuntimeModeAdapterOptions {
207
- id: BuiltinRuntimeModeId;
208
+ id: RuntimeModeId;
208
209
  provider: SandboxProviderV1;
209
210
  runtimeHost: AgentRuntimeHostOperations;
210
211
  workspaceFsCapability: 'strong' | 'best-effort';
@@ -226,7 +227,7 @@ interface SandboxRuntimeModeOptions {
226
227
  }
227
228
  /** Built-in runtime layout root without exposing provider package constants to consumers. */
228
229
  declare function resolveBuiltinRuntimeLayoutRoot(mode: BuiltinRuntimeModeId, workspaceRoot: string): string;
229
- declare function createSandboxRuntimeModeAdapter(mode: BuiltinRuntimeModeId, options?: SandboxRuntimeModeOptions): RuntimeModeAdapter;
230
+ declare function createSandboxRuntimeModeAdapter(mode: RuntimeModeId, options?: SandboxRuntimeModeOptions): RuntimeModeAdapter;
230
231
 
231
232
  type AgentDirectoryCompilerErrorCode = 'AGENT_DIRECTORY_NOT_FOUND' | 'AGENT_DIRECTORY_NOT_DIRECTORY' | 'AGENT_MANIFEST_NOT_FOUND' | 'AGENT_MANIFEST_NOT_FILE' | 'AGENT_MANIFEST_INVALID_UTF8' | 'AGENT_MANIFEST_INVALID_JSON' | 'AGENT_MANIFEST_MISSING_BORING_AGENT' | 'AGENT_ASSET_NOT_FOUND' | 'AGENT_ASSET_NOT_FILE' | 'AGENT_ASSET_INVALID_UTF8' | 'AGENT_PATH_SYMLINK_ESCAPE' | 'AGENT_PATH_CHANGED_DURING_READ' | 'AGENT_DIRECTORY_IO_FAILED';
232
233
  type AgentDirectoryCompilerPublicErrorCode = Extract<ErrorCode, 'CONFIG_INVALID' | 'PATH_NOT_FOUND' | 'PATH_SYMLINK_ESCAPE'>;
@@ -299,10 +300,11 @@ interface TrustedAgentInstructionAppendix {
299
300
  interface TrustedAuthoredAgentPolicy {
300
301
  readonly fallbackLabel?: string;
301
302
  /**
302
- * Workspace-relative authored instruction sources for this agent, supplied
303
- * by the trusted composer that actually knows where they live.
303
+ * Authored instruction sources for this agent as host absolute paths,
304
+ * supplied by the trusted composer that actually knows where they live.
305
+ * Addressing them against a served workspace root is a per-request concern.
304
306
  */
305
- readonly instructionFiles?: readonly AgentInstructionFileRef[];
307
+ readonly instructionSources?: readonly AgentInstructionSource[];
306
308
  readonly instructionAppendices?: readonly TrustedAgentInstructionAppendix[];
307
309
  readonly plugins?: readonly {
308
310
  readonly name: string;
@@ -366,22 +368,6 @@ interface DiscoveredAgentPackageDescriptor {
366
368
  interface LoadConfiguredAgentFleetOptions {
367
369
  /** Plugin-manager scan descriptors injected by the workspace/CLI boot layer. */
368
370
  readonly discoveredPackages: readonly DiscoveredAgentPackageDescriptor[];
369
- /**
370
- * Root of the workspace the `user` filesystem serves, or `null` when the
371
- * host resolves a DIFFERENT root per request (core, the CLI hub) and so has
372
- * no single one at fleet-composition time.
373
- *
374
- * Required, because published `instructionFiles` are addressed relative to
375
- * it and only the caller knows it. It is NOT derivable from the discovered
376
- * package roots: a fleet can be composed from packages that live outside
377
- * the workspace root, and guessing produced well-formed paths that
378
- * resolved to nothing.
379
- *
380
- * `null` is not a soft option — it makes the host structurally unable to
381
- * publish a ref it cannot guarantee, which is the honest answer for
382
- * per-workspace roots.
383
- */
384
- readonly workspaceRoot: string | null;
385
371
  /** Path to `.agents/factory/fleet.yaml`. */
386
372
  readonly fleetConfigPath: string;
387
373
  /** Path to `.agents/factory/policy.yaml` (read for `models.seats` tiers). */
@@ -394,7 +380,7 @@ interface LoadConfiguredAgentFleetOptions {
394
380
  /** Overridable for tests; defaults to `process.env`. */
395
381
  readonly env?: NodeJS.ProcessEnv;
396
382
  }
397
- type FleetLoaderDiagnosticCode = Extract<ErrorCode, 'AGENT_FLEET_SEAT_PERSONA_INVALID' | 'AGENT_FLEET_SEAT_SKILL_DIGEST_MISMATCH' | 'AGENT_DEFINITION_ID_CONFLICT' | 'AGENT_DEFINITION_UNSEATED' | 'AGENT_FLEET_SEAT_INSTRUCTIONS_PATH_UNPUBLISHABLE'>;
383
+ type FleetLoaderDiagnosticCode = Extract<ErrorCode, 'AGENT_FLEET_SEAT_PERSONA_INVALID' | 'AGENT_FLEET_SEAT_SKILL_DIGEST_MISMATCH' | 'AGENT_DEFINITION_ID_CONFLICT' | 'AGENT_DEFINITION_UNSEATED'>;
398
384
  interface FleetLoaderDiagnostic {
399
385
  readonly seat?: string;
400
386
  readonly agentTypeId: string;
@@ -422,55 +408,68 @@ declare class FleetConfigError extends Error {
422
408
  * descriptors, `.agents/factory/policy.yaml` `models.seats` tiers, and the
423
409
  * priority-ordered `models.tiers` candidates declared in fleet.yaml.
424
410
  *
425
- * Fails closed per seat: a persona that fails materialization, digest
426
- * verification, or spec composition is excluded with a stable diagnostic —
427
- * the remaining valid seats still compose. Whole-fleet config errors (an
428
- * unreadable/malformed fleet.yaml or policy.yaml) throw `FleetConfigError`,
429
- * since there is no seat set to fail closed against.
411
+ * Fails startup when any configured seat cannot materialize or verify. Only
412
+ * genuinely unseated discovered packages remain nonfatal diagnostics. Whole-
413
+ * fleet config errors (including unreadable/malformed fleet or policy YAML)
414
+ * throw `FleetConfigError`.
430
415
  */
431
416
  declare function loadConfiguredAgentFleet(options: LoadConfiguredAgentFleetOptions): Promise<LoadConfiguredAgentFleetResult>;
432
417
 
433
- declare const LEGACY_DEFAULT_AGENT_FLEET: readonly AgentHostAgentSpec[];
418
+ type InstructionRefWithholdingCode = Extract<ErrorCode, 'AGENT_FLEET_SEAT_INSTRUCTIONS_PATH_UNPUBLISHABLE'>;
419
+ interface WithheldInstructionRef {
420
+ readonly code: InstructionRefWithholdingCode;
421
+ /** Host absolute path of the authored source that could not be addressed. */
422
+ readonly absolutePath: string;
423
+ readonly message: string;
424
+ }
425
+ interface ResolvedInstructionFileRefs {
426
+ readonly refs: readonly AgentInstructionFileRef[];
427
+ readonly withheld: readonly WithheldInstructionRef[];
428
+ }
429
+ /**
430
+ * Addresses authored instruction sources against the workspace root a SINGLE
431
+ * request is served from, which is the only moment a multi-workspace host
432
+ * (the CLI hub, core) knows one — composition time sees a fleet shared by
433
+ * every workspace (gh-1189).
434
+ *
435
+ * Publication is deterministic and fails closed: a ref is emitted only when
436
+ * the source canonically resolves inside the served root AND composes a path
437
+ * the client-side openable-resource guard accepts. Anything else is withheld
438
+ * with the stable `AGENT_FLEET_SEAT_INSTRUCTIONS_PATH_UNPUBLISHABLE` code, so
439
+ * the invariant from #1176 holds: a rendered link always resolves.
440
+ *
441
+ * Canonicalization (not lexical containment) on BOTH sides is the point:
442
+ * dotfile managers make a symlinked `.agents` ordinary, and a lexical check
443
+ * would call `~/project/.agents -> ~/dotfiles/agents` "inside the workspace"
444
+ * and publish a link the `user` filesystem cannot open.
445
+ */
446
+ declare function resolveAgentInstructionFileRefs(input: {
447
+ readonly sources: readonly AgentInstructionSource[] | undefined;
448
+ /** Root the `user` filesystem serves for THIS request, when the host resolved one. */
449
+ readonly workspaceRoot: string | null | undefined;
450
+ }): Promise<ResolvedInstructionFileRefs>;
451
+
452
+ /**
453
+ * A real, regular Agent used by hosts that do not opt into authored fleet
454
+ * discovery. Platform host adapters preserve the established `default` ID's
455
+ * plugin, skill, and transcript behavior without a separate pseudo-Agent type.
456
+ */
457
+ declare const DEFAULT_AGENT_FLEET: readonly AgentHostAgentSpec[];
434
458
  interface ResolveDefaultAgentFleetOptions {
435
- /**
436
- * Repository root used to resolve `.agents/{factory,skills}` when
437
- * `BORING_AGENT_FLEET=1` composes the fleet. Defaults to `process.cwd()`.
438
- */
459
+ /** Repository root used to resolve `.agents/{factory,skills}`. Defaults to `process.cwd()`. */
439
460
  readonly repositoryRoot?: string;
440
461
  /** Asset-manager scan results supplied by the workspace/CLI boot layer. */
441
462
  readonly discoveredPackages?: readonly DiscoveredAgentPackageDescriptor[];
442
- /**
443
- * Root of the workspace the `user` filesystem serves, or `null` when the
444
- * host resolves one per request. Explicit rather than defaulted, because it
445
- * is a DIFFERENT root from `repositoryRoot` in every multi-workspace host —
446
- * the two only coincide in the single-root dogfood/playground case.
447
- * Personas outside it are not published as openable instruction refs (see
448
- * `loadConfiguredAgentFleet`): a well-formed path the workbench cannot open
449
- * is worse than no link.
450
- */
451
- readonly workspaceRoot: string | null;
452
463
  /** Overridable for tests; defaults to `process.env`. */
453
464
  readonly env?: NodeJS.ProcessEnv;
454
465
  }
455
466
  /**
456
- * `BORING_AGENT_FLEET=1` composes the config-driven production fleet
457
- * from boot-injected plugin scan descriptors plus `.agents/factory` under `repositoryRoot`
458
- * alongside the default agent; flag absent preserves the legacy
459
- * single-default-agent boot byte-identically. Shared by
460
- * `createWorkspaceAgentServer`, `createCoreWorkspaceAgentServer`, and the CLI
461
- * hub — one composition path for every production/CLI entry point.
467
+ * Resolves one deployment-static fleet for Core, Workspace, and CLI hosts.
462
468
  *
463
- * Fails closed at two levels:
464
- * - Per seat: `loadConfiguredAgentFleet` excludes an individual invalid
465
- * persona/skill with a stable diagnostic; the remaining seats still boot
466
- * (see its own docstring).
467
- * - Whole fleet: a missing/malformed `fleet.yaml` or `policy.yaml` would
468
- * otherwise throw `FleetConfigError` out of the boot path. That throw is
469
- * preserved for direct/programmatic callers of `loadConfiguredAgentFleet`
470
- * (e.g. the playground, tests), but this boot-seam wrapper catches it and
471
- * degrades to the legacy default-agent-only fleet plus a logged
472
- * diagnostic — a container with the flag on and no `.agents/` tree must
473
- * still boot.
469
+ * The built-in default is a regular configured Agent. When authored fleet
470
+ * discovery is enabled it remains available alongside discovered seats so old
471
+ * `default` session references stay routable. Invalid enabled fleet
472
+ * composition fails boot; it never degrades to a pseudo-Agent.
474
473
  */
475
474
  declare function resolveDefaultAgentFleet(options: ResolveDefaultAgentFleetOptions): Promise<readonly AgentHostAgentSpec[]>;
476
475
 
@@ -832,6 +831,12 @@ interface CreateStandaloneAgentHostAppOptions {
832
831
  }) => Promise<void>;
833
832
  sessionDir?: string;
834
833
  sessionRoot?: string;
834
+ /**
835
+ * Durable request ledger file. Host application state, not workspace content:
836
+ * point it at host-owned storage. Defaults per
837
+ * {@link resolveRequestLedgerPath}.
838
+ */
839
+ requestLedgerPath?: string;
835
840
  externalPlugins?: boolean;
836
841
  beforeReload?: () => void | {
837
842
  readonly diagnostics?: ReadonlyArray<{
@@ -882,173 +887,6 @@ interface AgentHostEnvironmentHttpProjectionOptions {
882
887
  */
883
888
  declare function registerAgentHostEnvironmentRoutes(app: FastifyInstance, options: AgentHostEnvironmentHttpProjectionOptions): Promise<void>;
884
889
 
885
- interface EventStreamReadResult {
886
- events: Array<{
887
- data: unknown;
888
- offset: string;
889
- }>;
890
- nextOffset: string;
891
- upToDate: boolean;
892
- closed: boolean;
893
- }
894
- interface EventStreamMeta {
895
- nextOffset: string;
896
- closed: boolean;
897
- }
898
- interface EventStreamStore {
899
- createStream(path: string): Promise<void>;
900
- appendEvent(path: string, event: unknown): Promise<string>;
901
- appendEventOnce(path: string, key: string, event: unknown): Promise<string>;
902
- appendAgentEvent(sessionId: string, chunk: PiChatEvent, opts?: {
903
- idempotencyKey?: string;
904
- streamPath?: string;
905
- }): Promise<string>;
906
- readEvents(path: string, opts?: {
907
- offset?: string;
908
- limit?: number;
909
- }): Promise<EventStreamReadResult>;
910
- closeStream(path: string): Promise<void>;
911
- getStreamMeta(path: string): Promise<EventStreamMeta | null>;
912
- subscribe(path: string, listener: () => void): () => void;
913
- }
914
-
915
- interface HarnessPiChatServiceOptions {
916
- harness: AgentHarness;
917
- sessionStore: SessionStore;
918
- workdir: string;
919
- workspace?: Workspace;
920
- eventStore?: EventStreamStore;
921
- /**
922
- * Optional host billing sink. When set, accepted prompts/follow-ups reserve
923
- * before execution (a rejecting sink blocks the request), native assistant
924
- * usage is recorded per message, and every run settles or releases from
925
- * native terminal lifecycle.
926
- */
927
- metering?: AgentMeteringSink;
928
- /** Host-owned process-lifetime projection of live session activity. */
929
- onEvent?: (sessionId: string, event: PiChatEvent) => void;
930
- /** Receives non-fatal metering pipeline failures (default: console.warn). */
931
- meteringLogger?: MeteringErrorLogger;
932
- /** Canonical HTTP projection for lazily loaded persisted attachment bytes. */
933
- attachmentUrl?: (input: {
934
- readonly sessionId: string;
935
- readonly messageId: string;
936
- readonly index: number;
937
- readonly data?: string;
938
- readonly mediaType?: string;
939
- readonly filename?: string;
940
- }) => string;
941
- }
942
- declare class HarnessPiChatService implements PiChatSessionService {
943
- private readonly harness;
944
- private readonly sessionStore;
945
- private readonly workdir;
946
- private readonly workspace?;
947
- private readonly eventStore?;
948
- private readonly onEvent?;
949
- private readonly attachmentUrl?;
950
- private readonly channels;
951
- private readonly channelCreations;
952
- private readonly sessionGenerations;
953
- private readonly messageMetadata;
954
- private readonly activePromptRuns;
955
- private readonly syntheticPromptFailures;
956
- private readonly activeSyntheticPromptErrors;
957
- private readonly liveAttachments;
958
- private readonly lifecycle;
959
- private readonly metering?;
960
- private disposePromise?;
961
- constructor(options: HarnessPiChatServiceOptions);
962
- /** Test/diagnostic hook: resolves once queued metering sink calls settle. */
963
- flushMetering(): Promise<void>;
964
- dispose(): Promise<void>;
965
- private disposeService;
966
- listSessions(ctx: PiSessionRequestContext, options?: SessionListOptions): Promise<SessionSummary[]>;
967
- createSession(ctx: PiSessionRequestContext, init?: PiSessionCreateInit): Promise<SessionSummary>;
968
- deleteSession(ctx: PiSessionRequestContext, sessionId: string): Promise<void>;
969
- private deleteSessionBeforeDispose;
970
- readAttachment(ctx: PiSessionRequestContext, sessionId: string, messageId: string, index: number): Promise<{
971
- readonly data: Uint8Array;
972
- readonly mediaType: string;
973
- readonly filename?: string;
974
- }>;
975
- readState(ctx: PiSessionRequestContext, sessionId: string): Promise<PiChatSnapshot>;
976
- private readStateBeforeDispose;
977
- /**
978
- * The persisted transcript can lag the live adapter: transcript writes are
979
- * asynchronous, and some harnesses never persist transcripts at all. A
980
- * persisted refresh whose seq fences the live replay buffer while its
981
- * messages are missing would permanently hide those turns from a hydrating
982
- * client (it starts "caught up" at that seq with an empty timeline), so
983
- * refresh from persisted state only when it carries at least as much
984
- * rendered history as the live adapter.
985
- */
986
- private persistedStateDropsLiveMessages;
987
- private canRefreshFromPersistedState;
988
- private harnessMayHaveLiveSession;
989
- private attachmentUrlFor;
990
- private readPersistedState;
991
- subscribe(ctx: PiSessionRequestContext, sessionId: string, cursor: number, subscriber: PiChatEventSubscriber): Promise<PiChatEventStreamResult>;
992
- private subscribeBeforeDispose;
993
- prompt(ctx: PiSessionRequestContext, sessionId: string, payload: PromptPayload): Promise<PromptReceipt>;
994
- private promptBeforeDispose;
995
- followUp(ctx: PiSessionRequestContext, sessionId: string, payload: FollowUpPayload): Promise<FollowUpReceipt>;
996
- private followUpBeforeDispose;
997
- clearQueue(ctx: PiSessionRequestContext, sessionId: string, payload: QueueClearPayload): Promise<QueueClearReceipt>;
998
- private clearQueueBeforeDispose;
999
- interrupt(ctx: PiSessionRequestContext, sessionId: string, _payload: InterruptPayload): Promise<{
1000
- accepted: true;
1001
- cursor: number;
1002
- }>;
1003
- private interruptBeforeDispose;
1004
- stop(ctx: PiSessionRequestContext, sessionId: string, _payload: StopPayload): Promise<StopReceipt>;
1005
- private stopBeforeDispose;
1006
- private clearAllFollowUps;
1007
- private nextFollowUpForInterrupt;
1008
- private autoPostInterruptedFollowUp;
1009
- private runPrompt;
1010
- private trackActiveRun;
1011
- private clearAutoPostedFollowUpForFallback;
1012
- private canClearAutoPostedFollowUpForFallback;
1013
- private enrichSyntheticPromptFailures;
1014
- private publishAutoPostedFollowUpRunError;
1015
- private publishChannelEvents;
1016
- private publishChannelEventSync;
1017
- private publishPromptRunError;
1018
- private runAndDrainPublishQueue;
1019
- private drainPublishQueue;
1020
- private getAdapter;
1021
- private getChannel;
1022
- private ensureChannel;
1023
- /** Coalesce concurrent cold callers so only one adapter subscription wins. */
1024
- private createChannelOnce;
1025
- private generationOf;
1026
- private assertSessionIncarnation;
1027
- private buildChannel;
1028
- /** Cheap cold-snapshot seq lookup (no buffer hydration) — see {@link hydrateDurableReplayBuffer} for the live-channel path. */
1029
- private readDurableLatestPiChatSeq;
1030
- /**
1031
- * On cold channel construction, rehydrate a fresh {@link PiChatReplayBuffer}
1032
- * from the durable event store (when present) so resuming clients replay
1033
- * genuinely — not merely resume seq counting from a high-water-mark with an
1034
- * empty buffer, which forces every behind-the-tip cursor into
1035
- * `PI_CHAT_REPLAY_GAP`. Reads at most the buffer's own retention window
1036
- * (`DEFAULT_REPLAY_BUFFER_MAX_EVENTS`) worth of trailing entries — older
1037
- * history is already outside what the in-memory buffer would retain even
1038
- * across a live process, so this preserves prior semantics for very long
1039
- * streams while fixing the common "just restarted" resume case.
1040
- */
1041
- private hydrateDurableReplayBuffer;
1042
- /**
1043
- * Validate the persisted session identity and instantiate its lazily-created
1044
- * Pi adapter under the same full cache key. This is intentionally a narrow
1045
- * trusted-host seam rather than another browser route.
1046
- */
1047
- ensurePiSessionBound(ctx: PiSessionRequestContext, sessionId: string): Promise<void>;
1048
- private assertCanAccessSession;
1049
- private sessionKey;
1050
- }
1051
-
1052
890
  interface EnvironmentProvisioningSnapshot {
1053
891
  readonly changed: boolean;
1054
892
  readonly env: Readonly<Record<string, string>>;
@@ -1063,13 +901,64 @@ interface EnvironmentLease {
1063
901
  retire(): Promise<void>;
1064
902
  }
1065
903
 
904
+ /** Workspace-scoped addressing. Pi-native identities remain adapter-private. */
905
+ interface HarnessSessionAddress {
906
+ readonly workspaceScopeId: string;
907
+ readonly ref: AgentSessionRef;
908
+ }
909
+ interface HarnessAgentScope {
910
+ readonly workspaceScopeId: string;
911
+ readonly agentTypeId: string;
912
+ }
913
+ /** Attribution only: authSubjectId is never session-storage ownership. */
914
+ interface HarnessRequestContext {
915
+ readonly requestId: string;
916
+ readonly authSubjectId: string;
917
+ }
918
+ type HarnessWatchResult = {
919
+ readonly type: 'ok';
920
+ unsubscribe(): void;
921
+ readonly closed?: Promise<void>;
922
+ } | {
923
+ readonly type: 'replay_gap' | 'cursor_ahead';
924
+ readonly latestSeq: number;
925
+ readonly minReplaySeq: number;
926
+ };
927
+ /**
928
+ * Private D29 runtime seam. The Gateway ledger is the sole idempotency
929
+ * authority; callers may retry only after ledger admission.
930
+ */
931
+ interface AgentHarnessBackend {
932
+ listSessions(scope: HarnessAgentScope, ctx: HarnessRequestContext, options?: SessionListOptions): Promise<SessionSummary[]>;
933
+ createSession(scope: HarnessAgentScope, ctx: HarnessRequestContext, init?: {
934
+ title?: string;
935
+ }): Promise<SessionSummary>;
936
+ readSnapshot(address: HarnessSessionAddress, ctx: HarnessRequestContext): Promise<PiChatSnapshot>;
937
+ watchEvents(address: HarnessSessionAddress, ctx: HarnessRequestContext, cursor: number, subscriber: (event: PiChatEvent) => void): Promise<HarnessWatchResult>;
938
+ submitPrompt(address: HarnessSessionAddress, ctx: HarnessRequestContext, payload: AgentPromptPayload): Promise<PromptReceipt>;
939
+ submitFollowUp(address: HarnessSessionAddress, ctx: HarnessRequestContext, payload: FollowUpPayload): Promise<FollowUpReceipt>;
940
+ clearQueue(address: HarnessSessionAddress, ctx: HarnessRequestContext, payload: QueueClearPayload): Promise<QueueClearReceipt>;
941
+ interrupt(address: HarnessSessionAddress, ctx: HarnessRequestContext, payload: InterruptPayload): Promise<CommandReceipt>;
942
+ stop(address: HarnessSessionAddress, ctx: HarnessRequestContext, payload: StopPayload): Promise<StopReceipt>;
943
+ renameSession(address: HarnessSessionAddress, ctx: HarnessRequestContext, title: string): Promise<SessionSummary>;
944
+ deleteSession(address: HarnessSessionAddress, ctx: HarnessRequestContext): Promise<void>;
945
+ readAttachment(address: HarnessSessionAddress, ctx: HarnessRequestContext, messageId: string, index: number): Promise<PiChatAttachmentResult>;
946
+ close(): Promise<void>;
947
+ }
948
+
1066
949
  interface BuiltAgentComposition {
1067
950
  readonly harness: AgentHarness;
1068
951
  readonly sessionStore: SessionStore;
1069
- readonly service: HarnessPiChatService;
952
+ readonly backend: AgentHarnessBackend;
1070
953
  readonly tools: readonly AgentTool[];
954
+ readonly pi: ResolvedPiHarnessOptions;
1071
955
  readonly runtimeBundle: RuntimeBundle;
1072
956
  readonly readyTracker: ReadyStatusTracker;
957
+ readonly getFilesystemBindings?: (ctx: {
958
+ sessionId?: string;
959
+ userId?: string;
960
+ requestId?: string;
961
+ }) => Promise<readonly RuntimeFilesystemBinding[]>;
1073
962
  dispose(): Promise<void>;
1074
963
  }
1075
964
 
@@ -1106,10 +995,13 @@ interface AgentHostRuntime {
1106
995
  readonly effectAdmission: AgentEffectAdmission;
1107
996
  readonly activity: AgentSessionActivityIndex;
1108
997
  readonly shutdownGraceMs: number;
1109
- listSessionSummaries(agentTypeId: string, scope: AuthorizedAgentScope, claim: VerifiedAgentScopeClaim): Promise<readonly SessionSummary[]>;
998
+ listSessionSummaries(agentTypeId: string, scope: AuthorizedAgentScope, claim: VerifiedAgentScopeClaim, options?: SessionListOptions): Promise<readonly SessionSummary[]>;
999
+ setSessionArchived?(agentTypeId: string, scope: AuthorizedAgentScope, claim: VerifiedAgentScopeClaim, sessionId: string, archived: boolean): Promise<SessionSummary>;
1110
1000
  isDraining(): boolean;
1111
1001
  assertOpen(): void;
1112
1002
  verify(scope: AuthorizedAgentScope): Promise<VerifiedAgentScopeClaim>;
1003
+ resolveAgentAccess?(agentTypeId: string, scope: AuthorizedAgentScope, claim: VerifiedAgentScopeClaim, operation: AgentAccessOperation): Promise<AgentAccessDecision>;
1004
+ assertAgentAccess?(agentTypeId: string, scope: AuthorizedAgentScope, claim: VerifiedAgentScopeClaim, operation: AgentAccessOperation): Promise<void>;
1113
1005
  resolveEnvironmentScope(scope: AuthorizedAgentScope, claim: VerifiedAgentScopeClaim, intent: AuthorizedEnvironmentIntent): Promise<AgentHostEnvironmentScope>;
1114
1006
  acquireEnvironment(scope: AuthorizedAgentScope, claim: VerifiedAgentScopeClaim, intent: AuthorizedEnvironmentIntent): Promise<EnvironmentLease>;
1115
1007
  acquireResolvedEnvironment(workspaceScopeId: string, environment: AgentHostEnvironmentScope): Promise<EnvironmentLease>;
@@ -1143,6 +1035,65 @@ declare class SqliteAgentRequestLedger implements AgentRequestLedger {
1143
1035
  private transition;
1144
1036
  }
1145
1037
 
1038
+ /**
1039
+ * Compatibility location a host falls back to when it has neither an explicit
1040
+ * ledger path nor a host-owned session root.
1041
+ *
1042
+ * Hosts historically disagreed on this tail, so it is the *only* part of the
1043
+ * chain that is parameterized. Everything before it is identical for every
1044
+ * host and is owned solely by {@link resolveRequestLedgerPath}.
1045
+ */
1046
+ type LegacyRequestLedgerLocation =
1047
+ /** `<workspaceRoot>/.boring/agent-request-ledger.sqlite` (standalone + workspace hosts). */
1048
+ {
1049
+ readonly layout: 'workspace-boring-dir';
1050
+ readonly workspaceRoot: string;
1051
+ }
1052
+ /** `<workspaceRoot>/.agent-request-ledger.sqlite` (core workspace host). */
1053
+ | {
1054
+ readonly layout: 'workspace-host-file';
1055
+ readonly workspaceRoot: string;
1056
+ };
1057
+ interface ResolveRequestLedgerPathInput {
1058
+ /** Explicit host-configured ledger file. Wins over every fallback. */
1059
+ readonly requestLedgerPath?: string;
1060
+ /** Host-owned session root supplied by the caller, if any. */
1061
+ readonly sessionRoot?: string;
1062
+ /**
1063
+ * Also accept `BORING_AGENT_SESSION_ROOT` as a host-owned root when the
1064
+ * caller supplied no `sessionRoot`. Hosts that already fold that env var
1065
+ * into their own session-root chain omit this.
1066
+ */
1067
+ readonly acceptSessionRootEnv?: boolean;
1068
+ /**
1069
+ * Last-resort compatibility location. Omit for hosts that must fail closed
1070
+ * instead of inventing an in-workspace ledger; they get `undefined`.
1071
+ */
1072
+ readonly legacy?: LegacyRequestLedgerLocation;
1073
+ }
1074
+ /**
1075
+ * Resolve the durable request ledger file for an agent host.
1076
+ *
1077
+ * **Ledger cutover note:** adopting BORING_AGENT_SESSION_ROOT (or an
1078
+ * explicit requestLedgerPath) after running with the legacy in-workspace
1079
+ * location RELOCATES the sqlite ledger. Effect-idempotency keys recorded
1080
+ * at the legacy path are stranded there; retries that span the upgrade
1081
+ * may be re-admitted once against the new ledger. Copy or drain the
1082
+ * legacy file as part of the cutover if exactly-once effects must
1083
+ * survive it.
1084
+ *
1085
+ * The request ledger is host application state, not workspace content, so the
1086
+ * chain prefers host-owned storage: explicit option, then the caller's
1087
+ * `sessionRoot` (optionally `BORING_AGENT_SESSION_ROOT`), and only then the
1088
+ * host's legacy in-workspace location.
1089
+ *
1090
+ * This is the sole owner of that chain: no host may re-encode any part of it.
1091
+ */
1092
+ declare function resolveRequestLedgerPath(input: ResolveRequestLedgerPathInput & {
1093
+ readonly legacy: LegacyRequestLedgerLocation;
1094
+ }): string;
1095
+ declare function resolveRequestLedgerPath(input: ResolveRequestLedgerPathInput): string | undefined;
1096
+
1146
1097
  declare const AgentFleetCompilationErrorCode: {
1147
1098
  readonly AGENT_FLEET_PLUGIN_UNKNOWN: "AGENT_FLEET_PLUGIN_UNKNOWN";
1148
1099
  readonly AGENT_FLEET_CONFIG_BINDING_UNKNOWN: "AGENT_FLEET_CONFIG_BINDING_UNKNOWN";
@@ -1175,7 +1126,7 @@ declare function createValidatingAgentFleetCompiler(options: CreateValidatingAge
1175
1126
 
1176
1127
  declare class EmbeddedAgentGateway implements AgentGateway {
1177
1128
  private readonly runtime;
1178
- private readonly cursorSecret;
1129
+ private readonly sessionInventoryPager;
1179
1130
  private readonly connections;
1180
1131
  private readonly writerTails;
1181
1132
  private readonly knownSessions;
@@ -1210,6 +1161,14 @@ declare class EmbeddedAgentGateway implements AgentGateway {
1210
1161
  setActivityForTesting(workspaceScopeId: string, ref: AgentSessionRef, activity: AgentSessionActivity): void;
1211
1162
  private assertOpen;
1212
1163
  private verify;
1164
+ private resolveAgentAccess;
1165
+ private throwForAgentAccessDecision;
1166
+ private assertAgentAccess;
1167
+ authorizeAgentAccess(input: {
1168
+ readonly scope: AuthorizedAgentScope;
1169
+ readonly agentTypeId: string;
1170
+ readonly operation: AgentAccessOperation;
1171
+ }): Promise<void>;
1213
1172
  listAgents(input: {
1214
1173
  readonly scope: AuthorizedAgentScope;
1215
1174
  }): Promise<{
@@ -1222,15 +1181,22 @@ declare class EmbeddedAgentGateway implements AgentGateway {
1222
1181
  label: string;
1223
1182
  }[]>;
1224
1183
  listSessions(input: Parameters<AgentGateway['listSessions']>[0]): Promise<{
1225
- nextCursor?: string | undefined;
1226
1184
  sessions: AgentSessionSummary[];
1185
+ nextCursor?: string;
1227
1186
  }>;
1228
1187
  createSession(input: Parameters<AgentGateway['createSession']>[0]): Promise<AgentSessionRef>;
1229
1188
  readSessionState(input: Parameters<AgentGateway['readSessionState']>[0]): Promise<AgentSessionStateSnapshot>;
1230
1189
  connectSession(input: Parameters<AgentGateway['connectSession']>[0]): Promise<AgentSessionConnection>;
1231
1190
  private send;
1232
1191
  renameSession(input: Parameters<AgentGateway['renameSession']>[0]): Promise<AgentSessionSummary>;
1192
+ /**
1193
+ * Visibility only. This never reaches the delete path: the session
1194
+ * repository records the flag beside the transcript and hands back the same
1195
+ * summary, so `archived: false` restores the row untouched.
1196
+ */
1197
+ setSessionArchived(input: Parameters<AgentGateway['setSessionArchived']>[0]): Promise<AgentSessionSummary>;
1233
1198
  deleteSession(input: Parameters<AgentGateway['deleteSession']>[0]): Promise<void>;
1199
+ private authorizedEvents;
1234
1200
  close(): Promise<void>;
1235
1201
  private bindingForSession;
1236
1202
  private loadSummary;
@@ -1242,8 +1208,6 @@ declare class EmbeddedAgentGateway implements AgentGateway {
1242
1208
  private promptAdmission;
1243
1209
  private queueClearAdmission;
1244
1210
  private withWriter;
1245
- private encodeCursor;
1246
- private decodeCursor;
1247
1211
  }
1248
1212
 
1249
1213
  /** Process-lifetime Level-B ledger with the exact published state machine. */
@@ -1477,4 +1441,4 @@ declare function createInMemoryCredentialBackendV1(entries: readonly InMemoryCre
1477
1441
 
1478
1442
  declare function withResolvedCredential<T>(resolver: WorkspaceCredentialResolverV1, workspace: AuthorizedWorkspaceCredentialScopeV1, ref: ProviderCredentialRefV1, fn: (lease: ResolvedCredentialLeaseV1) => T | Promise<T>): Promise<T>;
1479
1443
 
1480
- export { AgentDirectoryCompilerError, type AgentDirectoryCompilerErrorCode, type AgentDirectoryCompilerPublicErrorCode, AgentEffectAdmission, AgentFleetCompilationError, AgentFleetCompilationErrorCode, AgentFleetCompiler, type AgentFleetPluginBindingContract, AgentHarnessFactory, AgentHostAgentSpec, type AgentHostEnvironmentHttpProjectionOptions, AgentHostEnvironmentScope, AgentInstructionFileRef, AgentMeteringSink, AgentRequestKey, AgentRequestLedger, AgentRequestLedgerPrepareResult, AgentRequestLedgerRecord, AgentRuntimeHostOperations, AuthoredAgentMaterializationError, type AuthoredAgentMaterializationErrorCode, type AuthoredAgentSourceV1, AuthorizedAgentScope, AuthorizedEnvironmentIntent, type AuthorizedSessionRunDetails, BuiltinRuntimeModeId, CompiledAgentHostAgentSpec, ConfiguredAgentHostAgentSpec, CreateAgentHostOptions, type CreateConfiguredAgentHostAgentSpecInput, type CreateStandaloneAgentHostAppOptions, type CreateValidatingAgentFleetCompilerOptions, CreatedAgentHost, type CredentialStoreBackendV1, DEFAULT_PI_RESOURCE_DIGEST_LIMITS, DEFAULT_READONLY_WORKSPACE_PATHS, type DeploymentSnapshotProvider, type DeploymentSnapshotRecipe, type DeploymentSnapshotResult, type DeploymentSnapshotStatus, type DiscoveredAgentPackageDescriptor, EmbeddedAgentGateway, type FakeAuthorityVerifierGrantV1, FleetConfigError, type FleetConfigErrorCode, type FleetLoaderDiagnostic, type FleetLoaderDiagnosticCode, type FleetSeatBinding, type FleetSkillBinding, type HostSideCredentialResolverOptionsV1, InMemoryAgentRequestLedger, type InMemoryCredentialBackendEntryV1, LEGACY_DEFAULT_AGENT_FLEET, type LoadConfiguredAgentFleetOptions, type LoadConfiguredAgentFleetResult, MANAGED_AGENT_MCP_DELIVERY_RULE, MANAGED_AGENT_MCP_ORIGIN_SURFACE, type ManagedAgentArtifact, type ManagedAgentArtifactCandidate, type ManagedAgentArtifactRef, type ManagedAgentBoundRunnerWorkspace, type ManagedAgentCollectArtifactsInput, type ManagedAgentDelegateInput, type ManagedAgentDelegateProgress, type ManagedAgentDelegateRequestContext, type ManagedAgentDelegateResult, type ManagedAgentDelegateRunInput, type ManagedAgentDelegateRunner, type ManagedAgentDelegateStatus, type ManagedAgentDelegateStatusResult, ManagedAgentMcpDelegateController, type ManagedAgentMcpDelegateOptions, ManagedAgentMcpError, type ManagedAgentMcpHttpHandlerOptions, type ManagedAgentMcpServerOptions, type ManagedAgentSafeError, type ManagedAgentWorkspaceResolutionInput, type MaterializeAgentDirectoryInput, MeteringErrorLogger, ModeContext, type ModelTierCandidate, PiHarnessOptions, PiPackageSource, type PiResourceDigestInput, type PiResourceDigestLimits, type PiResourceSet, type ProvisionRuntimeWorkspaceOptions, ProvisionWorkspaceRuntimeOptions, type ProvisioningArtifactRequest, RUNTIME_FILESYSTEM_BINDING_DUPLICATE_CODE, RUNTIME_READONLY_FILESYSTEM_POLICY_INVALID_CODE, RemoteWorkerClient, RemoteWorkerClientError, type RemoteWorkerClientOptions, RemoteWorkerExecRequest, type RemoteWorkerModeAdapterOptions, RemoteWorkerWorkspaceOp, RemoteWorkerWorkspaceResult, type ResolveDefaultAgentFleetOptions, type ResolvedAgent, type ResolvedAgentDigestInput, ResolvedAgentRuntimeScope, RuntimeBundle, type RuntimeEnvContribution, type RuntimeEnvContributionContext, RuntimeFilesystemAccessDecision, RuntimeFilesystemBinding, RuntimeFilesystemBindingConfigurationError, RuntimeModeAdapter, RuntimeModeId, type RuntimeReadonlyFilesystemPolicy, RuntimeReadonlyFilesystemPolicyError, type RuntimeWorkspaceProvisioningResult, type SandboxRuntimeModeOptions, type ShareEntryMcpResourceOptions, type SkillMetadataFrontmatter, SqliteAgentRequestLedger, TrustedAgentCompositionError, type TrustedAgentInstructionAppendix, type TrustedAuthoredAgentPolicy, UV_SETUP_COMMANDS, VerifiedAgentScopeClaim, type WorkspaceAgentDispatcherBinding, type WorkspaceAgentDispatcherResolveOptions, type WorkspaceAgentDispatcherResolver, WorkspaceProvisioningAdapter, WorkspaceProvisioningResult, applyCspHeaders, autoDetectMode, buildDeploymentSnapshotRecipe, compileAgentDirectory, compilePersonaPackageDirectory, constantTimeTokenEqual, createAgentHost, createBlaxelSandboxModeAdapter, createBoundWorkspaceAgentDispatcher, createConfiguredAgentHostAgentSpec, createDirectModeAdapter, createEnvironmentProvisioningFingerprint, createFakeAuthorityVerifierV1, createHostSideCredentialResolverV1, createInMemoryCredentialBackendV1, createLocalModeAdapter, createManagedAgentMcpDelegateController, createManagedAgentMcpHttpHandler, createManagedAgentMcpServer, createPiResourceDigestFence, createPiResourceDigestInput, createPluginDiagnosticsTool, createProviderRuntimeModeAdapter, createRemoteWorkerModeAdapter, createRemoteWorkerSandbox, createRemoteWorkerWorkspace, createResolvedAgentDigest, createResolvedRuntimeScopeIdentity, createResourceSettingsManager, createSandboxRuntimeModeAdapter, createStandaloneAgentHostApp, createUserFilesystemBinding, createValidatingAgentFleetCompiler, createVercelSandboxModeAdapter, decodeBytesFromWorker, deepLinkRoutes, digestPiResourceInputs, encodeBytesForWorker, hasBwrap, loadConfiguredAgentFleet, materializeAgentDirectory, mergeRuntimeFilesystemBindings, normalizeRuntimeReadonlyFilesystemPolicy, parseSkillMetadataFrontmatter, prepareDeploymentSnapshot, projectAuthorizedSessionRunDetails, provisionRuntimeWorkspace, provisionWorkspaceRuntime, registerAgentHostEnvironmentRoutes, registerShareEntryResources, resolveAgentDeployment, resolveBuiltinRuntimeLayoutRoot, resolveDefaultAgentFleet, resolveMode, resolveRuntimeReadonlyFilesystemAccess, resolveWorkspaceRoot, sandboxRuntimeHostOperations, shareResourceUri, withResolvedCredential, withRuntimeEnvContributions };
1444
+ export { AgentAccessDecision, AgentAccessOperation, AgentDirectoryCompilerError, type AgentDirectoryCompilerErrorCode, type AgentDirectoryCompilerPublicErrorCode, AgentEffectAdmission, AgentFleetCompilationError, AgentFleetCompilationErrorCode, AgentFleetCompiler, type AgentFleetPluginBindingContract, AgentHarnessFactory, AgentHostAgentSpec, type AgentHostEnvironmentHttpProjectionOptions, AgentHostEnvironmentScope, AgentInstructionFileRef, AgentInstructionSource, AgentMeteringSink, AgentRequestKey, AgentRequestLedger, AgentRequestLedgerPrepareResult, AgentRequestLedgerRecord, AgentRuntimeHostOperations, AuthoredAgentMaterializationError, type AuthoredAgentMaterializationErrorCode, type AuthoredAgentSourceV1, AuthorizedAgentScope, AuthorizedEnvironmentIntent, type AuthorizedSessionRunDetails, BuiltinRuntimeModeId, CompiledAgentHostAgentSpec, ConfiguredAgentHostAgentSpec, CreateAgentHostOptions, type CreateConfiguredAgentHostAgentSpecInput, type CreateStandaloneAgentHostAppOptions, type CreateValidatingAgentFleetCompilerOptions, CreatedAgentHost, type CredentialStoreBackendV1, DEFAULT_AGENT_FLEET, DEFAULT_PI_RESOURCE_DIGEST_LIMITS, DEFAULT_READONLY_WORKSPACE_PATHS, type DeploymentSnapshotProvider, type DeploymentSnapshotRecipe, type DeploymentSnapshotResult, type DeploymentSnapshotStatus, type DiscoveredAgentPackageDescriptor, EmbeddedAgentGateway, type FakeAuthorityVerifierGrantV1, FleetConfigError, type FleetConfigErrorCode, type FleetLoaderDiagnostic, type FleetLoaderDiagnosticCode, type FleetSeatBinding, type FleetSkillBinding, type HostSideCredentialResolverOptionsV1, InMemoryAgentRequestLedger, type InMemoryCredentialBackendEntryV1, type LegacyRequestLedgerLocation, type LoadConfiguredAgentFleetOptions, type LoadConfiguredAgentFleetResult, MANAGED_AGENT_MCP_DELIVERY_RULE, MANAGED_AGENT_MCP_ORIGIN_SURFACE, type ManagedAgentArtifact, type ManagedAgentArtifactCandidate, type ManagedAgentArtifactRef, type ManagedAgentBoundRunnerWorkspace, type ManagedAgentCollectArtifactsInput, type ManagedAgentDelegateInput, type ManagedAgentDelegateProgress, type ManagedAgentDelegateRequestContext, type ManagedAgentDelegateResult, type ManagedAgentDelegateRunInput, type ManagedAgentDelegateRunner, type ManagedAgentDelegateStatus, type ManagedAgentDelegateStatusResult, ManagedAgentMcpDelegateController, type ManagedAgentMcpDelegateOptions, ManagedAgentMcpError, type ManagedAgentMcpHttpHandlerOptions, type ManagedAgentMcpServerOptions, type ManagedAgentSafeError, type ManagedAgentWorkspaceResolutionInput, type MaterializeAgentDirectoryInput, ModeContext, type ModelTierCandidate, PiHarnessOptions, PiPackageSource, type PiResourceDigestInput, type PiResourceDigestLimits, type PiResourceSet, type ProvisionRuntimeWorkspaceOptions, ProvisionWorkspaceRuntimeOptions, type ProvisioningArtifactRequest, RUNTIME_FILESYSTEM_BINDING_DUPLICATE_CODE, RUNTIME_READONLY_FILESYSTEM_POLICY_INVALID_CODE, RemoteWorkerClient, RemoteWorkerClientError, type RemoteWorkerClientOptions, RemoteWorkerExecRequest, type RemoteWorkerModeAdapterOptions, RemoteWorkerWorkspaceOp, RemoteWorkerWorkspaceResult, type ResolveDefaultAgentFleetOptions, type ResolveRequestLedgerPathInput, type ResolvedAgent, type ResolvedAgentDigestInput, ResolvedAgentRuntimeScope, type ResolvedInstructionFileRefs, RuntimeBundle, type RuntimeEnvContribution, type RuntimeEnvContributionContext, RuntimeFilesystemAccessDecision, RuntimeFilesystemBinding, RuntimeFilesystemBindingConfigurationError, RuntimeModeAdapter, RuntimeModeId, type RuntimeReadonlyFilesystemPolicy, RuntimeReadonlyFilesystemPolicyError, type RuntimeWorkspaceProvisioningResult, type SandboxRuntimeModeOptions, type ShareEntryMcpResourceOptions, type SkillMetadataFrontmatter, SqliteAgentRequestLedger, TrustedAgentCompositionError, type TrustedAgentInstructionAppendix, type TrustedAuthoredAgentPolicy, UV_SETUP_COMMANDS, VerifiedAgentScopeClaim, type WithheldInstructionRef, type WorkspaceAgentDispatcherBinding, type WorkspaceAgentDispatcherResolveOptions, type WorkspaceAgentDispatcherResolver, WorkspaceProvisioningAdapter, WorkspaceProvisioningResult, applyCspHeaders, autoDetectMode, buildDeploymentSnapshotRecipe, compileAgentDirectory, compilePersonaPackageDirectory, constantTimeTokenEqual, createAgentHost, createBlaxelSandboxModeAdapter, createBoundWorkspaceAgentDispatcher, createConfiguredAgentHostAgentSpec, createDirectModeAdapter, createEnvironmentProvisioningFingerprint, createFakeAuthorityVerifierV1, createHostSideCredentialResolverV1, createInMemoryCredentialBackendV1, createLocalModeAdapter, createManagedAgentMcpDelegateController, createManagedAgentMcpHttpHandler, createManagedAgentMcpServer, createPiResourceDigestFence, createPiResourceDigestInput, createPluginDiagnosticsTool, createProviderRuntimeModeAdapter, createRemoteWorkerModeAdapter, createRemoteWorkerSandbox, createRemoteWorkerWorkspace, createResolvedAgentDigest, createResolvedRuntimeScopeIdentity, createResourceSettingsManager, createSandboxRuntimeModeAdapter, createStandaloneAgentHostApp, createUserFilesystemBinding, createValidatingAgentFleetCompiler, createVercelSandboxModeAdapter, decodeBytesFromWorker, deepLinkRoutes, digestPiResourceInputs, encodeBytesForWorker, hasBwrap, loadConfiguredAgentFleet, materializeAgentDirectory, mergeRuntimeFilesystemBindings, normalizeRuntimeReadonlyFilesystemPolicy, parseSkillMetadataFrontmatter, prepareDeploymentSnapshot, projectAuthorizedSessionRunDetails, provisionRuntimeWorkspace, provisionWorkspaceRuntime, registerAgentHostEnvironmentRoutes, registerShareEntryResources, resolveAgentDeployment, resolveAgentInstructionFileRefs, resolveBuiltinRuntimeLayoutRoot, resolveDefaultAgentFleet, resolveMode, resolveRequestLedgerPath, resolveRuntimeReadonlyFilesystemAccess, resolveWorkspaceRoot, sandboxRuntimeHostOperations, shareResourceUri, withResolvedCredential, withRuntimeEnvContributions };