@hachej/boring-agent 0.1.100 → 0.1.103

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 (36) hide show
  1. package/dist/{DebugDrawer-2TO5SE2D.js → DebugDrawer-JNA43SVR.js} +2 -1
  2. package/dist/chunk-2BGLZZ7T.js +10 -0
  3. package/dist/{chunk-46HJK2ES.js → chunk-4XOW57KJ.js} +3 -8
  4. package/dist/{chunk-ZOHN72OS.js → chunk-6WKQ4FC4.js} +127 -138
  5. package/dist/{chunk-LSO2AO6Q.js → chunk-7QM22DU7.js} +1 -3
  6. package/dist/{chunk-3OEDBRKY.js → chunk-JNEKOVMJ.js} +1 -1
  7. package/dist/{chunk-VXF5DWS6.js → chunk-K25PK5EC.js} +1 -0
  8. package/dist/chunk-N6THTH7P.js +110 -0
  9. package/dist/{chunk-GRMDMWBW.js → chunk-TW7G33QH.js} +23 -40
  10. package/dist/core/index.d.ts +5 -5
  11. package/dist/core/index.js +1 -1
  12. package/dist/{createHarness-5TEXLUYX.js → createHarness-4Q6DQBRT.js} +2 -2
  13. package/dist/{errors-cNC4HMpV.d.ts → errors-szpcDUFQ.d.ts} +3 -4
  14. package/dist/{file-search-QxnanNjO.d.ts → file-search-BXdSm-Yq.d.ts} +5 -5
  15. package/dist/front/artifacts.d.ts +34 -0
  16. package/dist/front/artifacts.js +21 -0
  17. package/dist/front/index.d.ts +6 -20
  18. package/dist/front/index.js +604 -710
  19. package/dist/{harness-DS8jLKIx.d.ts → harness-erpL2SER.d.ts} +2 -2
  20. package/dist/{lease-D8WC6pQl.d.ts → lease-K-EZhdL-.d.ts} +3 -3
  21. package/dist/{middleware-Cq_cYHjJ.d.ts → middleware-CaAEXpi5.d.ts} +11 -2
  22. package/dist/{piChatEvent-B3ehh9V0.d.ts → piChatEvent-g1nIBh44.d.ts} +14 -16
  23. package/dist/{piChatSessionService-xnv8rcdh.d.ts → piChatSessionService-DugeRHzb.d.ts} +1 -3
  24. package/dist/{sandbox-KQiEdz4W.d.ts → sandbox-BMhut3kh.d.ts} +6 -1
  25. package/dist/server/agent-host/testing/gatewayConformance.d.ts +6 -6
  26. package/dist/server/agent-host/testing/gatewayConformance.js +3 -4
  27. package/dist/server/index.d.ts +24 -35
  28. package/dist/server/index.js +7 -5
  29. package/dist/server/worker/index.d.ts +3 -2
  30. package/dist/server/worker/index.js +25 -6
  31. package/dist/shared/index.d.ts +29 -29
  32. package/dist/shared/index.js +3 -3
  33. package/dist/{types-BPzq-RwN.d.ts → types-BnjMLAd5.d.ts} +14 -6
  34. package/docs/AGENT_GATEWAY_V0.md +3 -4
  35. package/docs/ERROR_CODES.md +1 -0
  36. package/package.json +16 -12
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  ErrorCode
3
- } from "./chunk-VXF5DWS6.js";
3
+ } from "./chunk-K25PK5EC.js";
4
4
 
5
5
  // src/shared/tool-ui.ts
6
6
  function isRecord(value) {
@@ -47,7 +47,6 @@ var AgentGatewayErrorCode = {
47
47
  AGENT_REQUEST_OUTCOME_UNKNOWN: "AGENT_REQUEST_OUTCOME_UNKNOWN",
48
48
  AGENT_RUNTIME_RESTART_REQUIRED: "AGENT_RUNTIME_RESTART_REQUIRED",
49
49
  AGENT_COMMAND_INVALID_STATE: "AGENT_COMMAND_INVALID_STATE",
50
- AGENT_SESSION_RUNTIME_SCOPE_MISMATCH: "AGENT_SESSION_RUNTIME_SCOPE_MISMATCH",
51
50
  AGENT_SHARED_ENVIRONMENT_UNAVAILABLE: "AGENT_SHARED_ENVIRONMENT_UNAVAILABLE",
52
51
  AGENT_GATEWAY_CLOSED: "AGENT_GATEWAY_CLOSED"
53
52
  };
@@ -64,7 +63,6 @@ var AGENT_GATEWAY_ERROR_CODES = [
64
63
  AgentGatewayErrorCode.AGENT_REQUEST_OUTCOME_UNKNOWN,
65
64
  AgentGatewayErrorCode.AGENT_RUNTIME_RESTART_REQUIRED,
66
65
  AgentGatewayErrorCode.AGENT_COMMAND_INVALID_STATE,
67
- AgentGatewayErrorCode.AGENT_SESSION_RUNTIME_SCOPE_MISMATCH,
68
66
  AgentGatewayErrorCode.AGENT_SHARED_ENVIRONMENT_UNAVAILABLE,
69
67
  AgentGatewayErrorCode.AGENT_GATEWAY_CLOSED
70
68
  ];
@@ -6,7 +6,7 @@ import {
6
6
  AgentDefinitionErrorCode,
7
7
  AgentDeploymentErrorCode,
8
8
  ErrorCode
9
- } from "./chunk-VXF5DWS6.js";
9
+ } from "./chunk-K25PK5EC.js";
10
10
 
11
11
  // src/shared/skill-resource.ts
12
12
  var AGENT_RESOURCES_FILESYSTEM_ID = "agent_resources";
@@ -70,6 +70,7 @@ var ErrorCode = z.enum([
70
70
  "REMOTE_WORKER_INCOMPLETE_CLEANUP",
71
71
  "REMOTE_WORKER_DOCKER_COMMAND_FAILED",
72
72
  "REMOTE_WORKER_PATH_UNSAFE",
73
+ "REMOTE_WORKER_ALREADY_EXISTS",
73
74
  "REMOTE_WORKER_PATH_PRIMITIVE_UNAVAILABLE",
74
75
  "REMOTE_WORKER_QUOTA_EXCEEDED",
75
76
  "REMOTE_WORKER_SECRET_REFERENCE_REJECTED",
@@ -0,0 +1,110 @@
1
+ import {
2
+ cn
3
+ } from "./chunk-2BGLZZ7T.js";
4
+
5
+ // src/front/ArtifactOpenContext.tsx
6
+ import { createContext, useContext } from "react";
7
+ import { jsx } from "react/jsx-runtime";
8
+ var ArtifactOpenContext = createContext(null);
9
+ function ArtifactOpenProvider({ onOpenArtifact, children }) {
10
+ const inheritedOpenArtifact = useContext(ArtifactOpenContext);
11
+ return /* @__PURE__ */ jsx(ArtifactOpenContext.Provider, { value: onOpenArtifact ?? inheritedOpenArtifact, children });
12
+ }
13
+ function useOpenArtifact() {
14
+ return useContext(ArtifactOpenContext);
15
+ }
16
+
17
+ // src/front/primitives/artifact.tsx
18
+ import { Button } from "@hachej/boring-ui-kit";
19
+ import {
20
+ Tooltip,
21
+ TooltipContent,
22
+ TooltipProvider,
23
+ TooltipTrigger
24
+ } from "@hachej/boring-ui-kit";
25
+ import { XIcon } from "lucide-react";
26
+ import { jsx as jsx2, jsxs } from "react/jsx-runtime";
27
+ var Artifact = ({ className, ...props }) => /* @__PURE__ */ jsx2(
28
+ "div",
29
+ {
30
+ className: cn(
31
+ "flex flex-col overflow-hidden rounded-lg border bg-background shadow-sm",
32
+ className
33
+ ),
34
+ ...props
35
+ }
36
+ );
37
+ var ArtifactHeader = ({
38
+ className,
39
+ ...props
40
+ }) => /* @__PURE__ */ jsx2(
41
+ "div",
42
+ {
43
+ className: cn(
44
+ "flex items-center justify-between border-b bg-muted/50 px-4 py-3",
45
+ className
46
+ ),
47
+ ...props
48
+ }
49
+ );
50
+ var ArtifactTitle = ({ className, ...props }) => /* @__PURE__ */ jsx2(
51
+ "p",
52
+ {
53
+ className: cn("font-medium text-foreground text-sm", className),
54
+ ...props
55
+ }
56
+ );
57
+ var ArtifactDescription = ({
58
+ className,
59
+ ...props
60
+ }) => /* @__PURE__ */ jsx2("p", { className: cn("text-muted-foreground text-sm", className), ...props });
61
+ var ArtifactActions = ({
62
+ className,
63
+ ...props
64
+ }) => /* @__PURE__ */ jsx2("div", { className: cn("flex items-center gap-1", className), ...props });
65
+ var ArtifactAction = ({
66
+ tooltip,
67
+ label,
68
+ icon: Icon,
69
+ children,
70
+ className,
71
+ size = "sm",
72
+ variant = "ghost",
73
+ ...props
74
+ }) => {
75
+ const button = /* @__PURE__ */ jsxs(
76
+ Button,
77
+ {
78
+ className: cn(
79
+ "size-8 p-0 text-muted-foreground hover:text-foreground",
80
+ className
81
+ ),
82
+ size,
83
+ type: "button",
84
+ variant,
85
+ ...props,
86
+ children: [
87
+ Icon ? /* @__PURE__ */ jsx2(Icon, { className: "size-4" }) : children,
88
+ /* @__PURE__ */ jsx2("span", { className: "sr-only", children: label || tooltip })
89
+ ]
90
+ }
91
+ );
92
+ if (tooltip) {
93
+ return /* @__PURE__ */ jsx2(TooltipProvider, { children: /* @__PURE__ */ jsxs(Tooltip, { children: [
94
+ /* @__PURE__ */ jsx2(TooltipTrigger, { asChild: true, children: button }),
95
+ /* @__PURE__ */ jsx2(TooltipContent, { children: /* @__PURE__ */ jsx2("p", { children: tooltip }) })
96
+ ] }) });
97
+ }
98
+ return button;
99
+ };
100
+
101
+ export {
102
+ ArtifactOpenProvider,
103
+ useOpenArtifact,
104
+ Artifact,
105
+ ArtifactHeader,
106
+ ArtifactTitle,
107
+ ArtifactDescription,
108
+ ArtifactActions,
109
+ ArtifactAction
110
+ };
@@ -5,7 +5,7 @@ import {
5
5
  } from "./chunk-4IQ4HHBG.js";
6
6
  import {
7
7
  ErrorCode
8
- } from "./chunk-VXF5DWS6.js";
8
+ } from "./chunk-K25PK5EC.js";
9
9
 
10
10
  // src/server/harness/pi-coding-agent/createHarness.ts
11
11
  import { AsyncLocalStorage } from "node:async_hooks";
@@ -603,7 +603,7 @@ var PiSessionStore = class {
603
603
  sessionDir;
604
604
  allowLegacyUnscopedAccess;
605
605
  pathDerivedLegacyAccess;
606
- trustedNativeRuntimeScopeIdentity;
606
+ allowUnscopedNativeAccess;
607
607
  prefixCache = /* @__PURE__ */ new Map();
608
608
  listInFlight = /* @__PURE__ */ new Map();
609
609
  writerTails = /* @__PURE__ */ new Map();
@@ -613,25 +613,25 @@ var PiSessionStore = class {
613
613
  this.sessionDir = options;
614
614
  this.allowLegacyUnscopedAccess = true;
615
615
  this.pathDerivedLegacyAccess = false;
616
- this.trustedNativeRuntimeScopeIdentity = void 0;
616
+ this.allowUnscopedNativeAccess = false;
617
617
  return;
618
618
  }
619
619
  this.allowLegacyUnscopedAccess = true;
620
620
  this.pathDerivedLegacyAccess = options?.sessionDir === void 0 && options?.sessionNamespace === void 0;
621
- this.trustedNativeRuntimeScopeIdentity = options?.trustedNativeRuntimeScopeIdentity?.trim() || void 0;
621
+ this.allowUnscopedNativeAccess = options?.allowUnscopedNativeAccess === true;
622
622
  this.sessionDir = options?.sessionDir ?? (options?.sessionNamespace ? sessionDirForNamespace(options.sessionNamespace, options.sessionRoot) : defaultSessionDir(options?.storageCwd ?? cwd, options?.sessionRoot));
623
623
  }
624
624
  getSessionDir() {
625
625
  return this.sessionDir;
626
626
  }
627
- /** Reads the Host execution pin from authoritative session metadata. */
628
- async readRuntimeScopeIdentity(ctx, sessionId) {
629
- const filepath = await this.resolveSessionFile(sessionId, ctx);
630
- const entries = parseJsonlPrefixEntries2(await readJsonlPrefix2(filepath));
631
- const header = entries.find((entry) => entry.type === "session");
632
- const directNative = isTimestampNamedPiSessionFile(filepath, header?.id ?? sessionId);
633
- if (!this.headerBelongsToCtx(header, ctx, directNative)) throw new Error(`Session not found: ${sessionId}`);
634
- return readHeaderRuntimeScopeIdentity(header);
627
+ async has(ctx, sessionId) {
628
+ try {
629
+ await this.resolveSessionFile(sessionId, ctx);
630
+ return true;
631
+ } catch (error) {
632
+ if (error instanceof Error && error.message === `Session not found: ${sessionId}`) return false;
633
+ throw error;
634
+ }
635
635
  }
636
636
  async list(ctx, options) {
637
637
  const normalizedOptions = normalizeListOptions(options);
@@ -999,7 +999,7 @@ var PiSessionStore = class {
999
999
  if (ctx) await this.assertFileBelongsToCtx(matchedPath, ctx, sessionId);
1000
1000
  return matchedPath;
1001
1001
  }
1002
- if (ctx && (this.pathDerivedLegacyAccess || this.hasTrustedNativeRuntimeCapability(ctx) || await this.nativeFilePin(matchedPath) !== null)) {
1002
+ if (ctx && (this.pathDerivedLegacyAccess || this.allowUnscopedNativeAccess || await this.nativeFilePin(matchedPath) !== null)) {
1003
1003
  await this.assertFileBelongsToCtx(matchedPath, ctx, sessionId);
1004
1004
  return matchedPath;
1005
1005
  }
@@ -1284,22 +1284,16 @@ var PiSessionStore = class {
1284
1284
  }
1285
1285
  /**
1286
1286
  * A bare Pi transcript carries no tenancy, so only a path-derived trusted
1287
- * local store may reach it. Boring-created native transcripts carry an exact
1288
- * persisted tenancy/runtime pin and remain reachable by hosted/namespaced
1289
- * stores without minting a compatibility wrapper.
1287
+ * local store may reach it. Boring-created native transcripts carry exact
1288
+ * persisted tenancy and remain reachable by hosted/namespaced stores without
1289
+ * minting a compatibility wrapper.
1290
1290
  */
1291
1291
  nativeFileBelongsToCtx(header, ctx) {
1292
1292
  const pinned = readHeaderSessionCtx(header);
1293
- if (pinned === null && this.hasTrustedNativeRuntimeCapability(ctx)) return true;
1293
+ if (pinned === null && this.allowUnscopedNativeAccess) return true;
1294
1294
  if (this.pathDerivedLegacyAccess) return this.storedCtxBelongsToCtx(pinned, ctx);
1295
1295
  return pinned !== null && sameSessionCtx(pinned, ctx);
1296
1296
  }
1297
- hasTrustedNativeRuntimeCapability(ctx) {
1298
- const runtimeScopeIdentity = ctx.runtimeScopeIdentity?.trim();
1299
- return Boolean(
1300
- runtimeScopeIdentity && this.trustedNativeRuntimeScopeIdentity && runtimeScopeIdentity === this.trustedNativeRuntimeScopeIdentity
1301
- );
1302
- }
1303
1297
  /** The Boring tenancy pin on a native transcript, or null when unpinned. */
1304
1298
  async nativeFilePin(filepath) {
1305
1299
  try {
@@ -1368,19 +1362,11 @@ function readHeaderSessionCtx(header) {
1368
1362
  if (!raw || typeof raw !== "object") return {};
1369
1363
  return normalizeSessionCtx(raw) ?? {};
1370
1364
  }
1371
- function readHeaderRuntimeScopeIdentity(header) {
1372
- const raw = header?.boringSessionCtx?.runtimeScopeIdentity;
1373
- if (raw === void 0) return void 0;
1374
- if (typeof raw !== "string" || !raw.trim()) throw new Error("Session runtime scope identity is invalid");
1375
- return raw;
1376
- }
1377
1365
  function normalizeSessionCtx(ctx) {
1378
- const runtimeScopeIdentity = typeof ctx?.runtimeScopeIdentity === "string" && ctx.runtimeScopeIdentity.trim() ? ctx.runtimeScopeIdentity : "";
1379
- if (!ctx?.workspaceId && !ctx?.userId && !runtimeScopeIdentity) return void 0;
1366
+ if (!ctx?.workspaceId && !ctx?.userId) return void 0;
1380
1367
  return {
1381
- ...ctx?.workspaceId ? { workspaceId: ctx.workspaceId } : {},
1382
- ...ctx?.userId ? { userId: ctx.userId } : {},
1383
- ...runtimeScopeIdentity ? { runtimeScopeIdentity } : {}
1368
+ ...ctx.workspaceId ? { workspaceId: ctx.workspaceId } : {},
1369
+ ...ctx.userId ? { userId: ctx.userId } : {}
1384
1370
  };
1385
1371
  }
1386
1372
  function sameSessionCtx(a, b) {
@@ -1928,14 +1914,11 @@ function sessionCtxFromRunContext(ctx) {
1928
1914
  return normalizeSessionCtx2(ctx.sessionCtx ?? { workspaceId: ctx.workspaceId }) ?? {};
1929
1915
  }
1930
1916
  function normalizeSessionCtx2(ctx) {
1931
- if (!ctx?.workspaceId && !ctx?.runtimeScopeIdentity) return void 0;
1932
- return {
1933
- ...ctx.workspaceId ? { workspaceId: ctx.workspaceId } : {},
1934
- ...ctx.runtimeScopeIdentity ? { runtimeScopeIdentity: ctx.runtimeScopeIdentity } : {}
1935
- };
1917
+ if (!ctx?.workspaceId) return void 0;
1918
+ return { workspaceId: ctx.workspaceId };
1936
1919
  }
1937
1920
  function sessionCacheKey(sessionId, ctx) {
1938
- return JSON.stringify([sessionId, ctx.workspaceId ?? "", ctx.runtimeScopeIdentity ?? ""]);
1921
+ return JSON.stringify([sessionId, ctx.workspaceId ?? ""]);
1939
1922
  }
1940
1923
  async function applyRequestedSessionOptions(handle, input, options = {}) {
1941
1924
  const requestedModel = resolveRequestedModel(handle.modelRegistry, input, { strict: options.strictModelResolution });
@@ -1,8 +1,8 @@
1
- import { A as AgentHarness, a as AgentReadiness, b as Agent } from '../harness-DS8jLKIx.js';
2
- export { c as AGENT_NOT_IMPLEMENTED_UNTIL_T1, d as AgentActor, e as AgentCoreHarness, f as AgentCoreHarnessFactory, g as AgentCorePromptInput, h as AgentCoreSessionAdapter, i as AgentCoreSessionSnapshot, j as AgentEvent, k as AgentMessageContent, l as AgentMessagePart, m as AgentNotImplementedError, n as AgentReadinessStatus, o as AgentResolveInputResponse, p as AgentSendInput, q as AgentStartReceipt, r as AgentStreamOptions } from '../harness-DS8jLKIx.js';
3
- import { S as SessionStore } from '../piChatEvent-B3ehh9V0.js';
4
- import { A as AgentCoreSessionService, a as AgentEffectAdmission } from '../piChatSessionService-xnv8rcdh.js';
5
- export { b as AGENT_EFFECT_METHODS, c as AgentEffectAdmissionError, P as PiChatEventStreamResult, d as PiChatEventStreamSubscription, e as PiChatEventSubscriber, f as PiChatReplayRangeError, g as PiChatSessionService, h as PiSessionCreateInit, i as PiSessionRequestContext, w as withAgentEffectAdmission } from '../piChatSessionService-xnv8rcdh.js';
1
+ import { A as AgentHarness, a as AgentReadiness, b as Agent } from '../harness-erpL2SER.js';
2
+ export { c as AGENT_NOT_IMPLEMENTED_UNTIL_T1, d as AgentActor, e as AgentCoreHarness, f as AgentCoreHarnessFactory, g as AgentCorePromptInput, h as AgentCoreSessionAdapter, i as AgentCoreSessionSnapshot, j as AgentEvent, k as AgentMessageContent, l as AgentMessagePart, m as AgentNotImplementedError, n as AgentReadinessStatus, o as AgentResolveInputResponse, p as AgentSendInput, q as AgentStartReceipt, r as AgentStreamOptions } from '../harness-erpL2SER.js';
3
+ import { S as SessionStore } from '../piChatEvent-g1nIBh44.js';
4
+ import { A as AgentCoreSessionService, a as AgentEffectAdmission } from '../piChatSessionService-DugeRHzb.js';
5
+ export { b as AGENT_EFFECT_METHODS, c as AgentEffectAdmissionError, P as PiChatEventStreamResult, d as PiChatEventStreamSubscription, e as PiChatEventSubscriber, f as PiChatReplayRangeError, g as PiChatSessionService, h as PiSessionCreateInit, i as PiSessionRequestContext, w as withAgentEffectAdmission } from '../piChatSessionService-DugeRHzb.js';
6
6
  import '@mariozechner/pi-coding-agent';
7
7
  import 'zod';
8
8
 
@@ -4,7 +4,7 @@ import {
4
4
  } from "../chunk-WSQ5QNIY.js";
5
5
  import {
6
6
  ErrorCode
7
- } from "../chunk-VXF5DWS6.js";
7
+ } from "../chunk-K25PK5EC.js";
8
8
 
9
9
  // src/core/piChatSessionService.ts
10
10
  var AgentEffectAdmissionError = class extends Error {
@@ -5,9 +5,9 @@ import {
5
5
  mergePiPackageSources,
6
6
  projectSkillResourceLocations,
7
7
  withPiHarnessDefaults
8
- } from "./chunk-GRMDMWBW.js";
8
+ } from "./chunk-TW7G33QH.js";
9
9
  import "./chunk-4IQ4HHBG.js";
10
- import "./chunk-VXF5DWS6.js";
10
+ import "./chunk-K25PK5EC.js";
11
11
  export {
12
12
  createPiCodingAgentHarness,
13
13
  createResourceSettingsManager,
@@ -1,4 +1,4 @@
1
- import { b as PiChatEvent, o as ChatModelSelection, L as ThinkingLevel, v as ChatAttachmentPayload, Q as QueuedUserMessage, n as PiChatSnapshot } from './piChatEvent-B3ehh9V0.js';
1
+ import { c as PiChatEvent, C as ChatModelSelection, T as ThinkingLevel, l as ChatAttachmentPayload, m as QueuedUserMessage, P as PiChatSnapshot } from './piChatEvent-g1nIBh44.js';
2
2
 
3
3
  /** Placement-independent event envelope. `seq` is the only replay cursor. */
4
4
  interface AgentSessionEvent {
@@ -188,12 +188,11 @@ declare const AgentGatewayErrorCode: {
188
188
  readonly AGENT_REQUEST_OUTCOME_UNKNOWN: "AGENT_REQUEST_OUTCOME_UNKNOWN";
189
189
  readonly AGENT_RUNTIME_RESTART_REQUIRED: "AGENT_RUNTIME_RESTART_REQUIRED";
190
190
  readonly AGENT_COMMAND_INVALID_STATE: "AGENT_COMMAND_INVALID_STATE";
191
- readonly AGENT_SESSION_RUNTIME_SCOPE_MISMATCH: "AGENT_SESSION_RUNTIME_SCOPE_MISMATCH";
192
191
  readonly AGENT_SHARED_ENVIRONMENT_UNAVAILABLE: "AGENT_SHARED_ENVIRONMENT_UNAVAILABLE";
193
192
  readonly AGENT_GATEWAY_CLOSED: "AGENT_GATEWAY_CLOSED";
194
193
  };
195
194
  type AgentGatewayErrorCode = (typeof AgentGatewayErrorCode)[keyof typeof AgentGatewayErrorCode];
196
- declare const AGENT_GATEWAY_ERROR_CODES: readonly ["AGENT_TYPE_UNKNOWN", "AGENT_SESSION_NOT_FOUND", "AGENT_SCOPE_DENIED", "AGENT_SESSION_REPLAY_GAP", "AGENT_SESSION_CURSOR_AHEAD", "AGENT_SESSION_CURSOR_EXPIRED", "AGENT_SESSION_CURSOR_INVALID", "AGENT_REQUEST_CONFLICT", "AGENT_REQUEST_IN_PROGRESS", "AGENT_REQUEST_OUTCOME_UNKNOWN", "AGENT_RUNTIME_RESTART_REQUIRED", "AGENT_COMMAND_INVALID_STATE", "AGENT_SESSION_RUNTIME_SCOPE_MISMATCH", "AGENT_SHARED_ENVIRONMENT_UNAVAILABLE", "AGENT_GATEWAY_CLOSED"];
195
+ declare const AGENT_GATEWAY_ERROR_CODES: readonly ["AGENT_TYPE_UNKNOWN", "AGENT_SESSION_NOT_FOUND", "AGENT_SCOPE_DENIED", "AGENT_SESSION_REPLAY_GAP", "AGENT_SESSION_CURSOR_AHEAD", "AGENT_SESSION_CURSOR_EXPIRED", "AGENT_SESSION_CURSOR_INVALID", "AGENT_REQUEST_CONFLICT", "AGENT_REQUEST_IN_PROGRESS", "AGENT_REQUEST_OUTCOME_UNKNOWN", "AGENT_RUNTIME_RESTART_REQUIRED", "AGENT_COMMAND_INVALID_STATE", "AGENT_SHARED_ENVIRONMENT_UNAVAILABLE", "AGENT_GATEWAY_CLOSED"];
197
196
  interface AgentGatewayErrorDTO {
198
197
  readonly code: AgentGatewayErrorCode;
199
198
  readonly message: string;
@@ -206,4 +205,4 @@ declare class AgentGatewayError extends Error {
206
205
  toJSON(): AgentGatewayErrorDTO;
207
206
  }
208
207
 
209
- export { type AgentSummary as A, type ConnectAgentSessionInput as C, type DeleteAgentSessionInput as D, type IdempotentAgentControl as I, type JsonValue as J, type ListAgentsInput as L, type ReadAgentSessionStateInput as R, type VerifiedAgentScopeClaim as V, type WorkspaceScopeId as W, AgentGatewayErrorCode as a, type AgentGateway as b, type AuthorizedAgentScope as c, type AgentSessionRef as d, type AgentSessionActivity as e, type AgentGatewayErrorDTO as f, type AgentSessionSummary as g, type AgentSessionStateSnapshot as h, type AgentSessionConnection as i, type AgentScopeVerifier as j, AGENT_GATEWAY_ERROR_CODES as k, type AgentFollowUpCommand as l, AgentGatewayError as m, type AgentPromptCommand as n, type AgentSendReceipt as o, type AgentSessionEvent as p, type AgentSessionPage as q, type AuthSubjectId as r, type AuthorizedAgentSessionQuery as s, type CreateAgentSessionInput as t, type IdempotentAgentSend as u, type IdempotentQueueClear as v, type JsonPrimitive as w, type JsonSafe as x, type RenameAgentSessionInput as y };
208
+ export { type AgentGateway as A, type ConnectAgentSessionInput as C, type DeleteAgentSessionInput as D, type IdempotentAgentControl as I, type JsonPrimitive as J, type ListAgentsInput as L, type ReadAgentSessionStateInput as R, type VerifiedAgentScopeClaim as V, type WorkspaceScopeId as W, type AuthorizedAgentScope as a, type AgentSessionRef as b, type AgentSessionActivity as c, type AgentSendReceipt as d, AGENT_GATEWAY_ERROR_CODES as e, type AgentFollowUpCommand as f, AgentGatewayError as g, AgentGatewayErrorCode as h, type AgentGatewayErrorDTO as i, type AgentPromptCommand as j, type AgentScopeVerifier as k, type AgentSessionConnection as l, type AgentSessionEvent as m, type AgentSessionPage as n, type AgentSessionStateSnapshot as o, type AgentSessionSummary as p, type AgentSummary as q, type AuthSubjectId as r, type AuthorizedAgentSessionQuery as s, type CreateAgentSessionInput as t, type IdempotentAgentSend as u, type IdempotentQueueClear as v, type JsonSafe as w, type JsonValue as x, type RenameAgentSessionInput as y };
@@ -1,7 +1,7 @@
1
- import { D as InterruptReceipt, j as StopReceipt } from './piChatEvent-B3ehh9V0.js';
2
- import { p as AgentSendInput, j as AgentEvent } from './harness-DS8jLKIx.js';
3
- import { b as Workspace } from './sandbox-KQiEdz4W.js';
4
- import { d as AgentSessionRef, o as AgentSendReceipt, b as AgentGateway, c as AuthorizedAgentScope } from './errors-cNC4HMpV.js';
1
+ import { k as InterruptReceipt, j as StopReceipt } from './piChatEvent-g1nIBh44.js';
2
+ import { p as AgentSendInput, j as AgentEvent } from './harness-erpL2SER.js';
3
+ import { b as Workspace } from './sandbox-BMhut3kh.js';
4
+ import { b as AgentSessionRef, d as AgentSendReceipt, A as AgentGateway, a as AuthorizedAgentScope } from './errors-szpcDUFQ.js';
5
5
 
6
6
  interface WorkspaceAgentDispatcherContext {
7
7
  workspaceId: string;
@@ -84,4 +84,4 @@ interface FileSearch {
84
84
  search(glob: string, limit?: number): Promise<string[]>;
85
85
  }
86
86
 
87
- export { type AgentSkillResource as A, type FileSearch as F, type LeaseBoundWorkspaceAgent as L, type WorkspaceAgentDirectRunInput as W, type WorkspaceAgentDirectRunCallback as a, type WorkspaceAgentDispatcherContext as b, type WorkspaceAgentDispatcher as c, type WorkspaceAgentGatewayBinding as d, AGENT_KNOWLEDGE_FILESYSTEM_ID as e, AGENT_RESOURCES_FILESYSTEM_ID as f, type WorkspaceAgentDispatch as g, type WorkspaceAgentDispatcherDispatchInput as h, type WorkspaceAgentDispatcherSendInput as i };
87
+ export { AGENT_KNOWLEDGE_FILESYSTEM_ID as A, type FileSearch as F, type LeaseBoundWorkspaceAgent as L, type WorkspaceAgentDirectRunCallback as W, AGENT_RESOURCES_FILESYSTEM_ID as a, type AgentSkillResource as b, type WorkspaceAgentDirectRunInput as c, type WorkspaceAgentDispatch as d, type WorkspaceAgentDispatcher as e, type WorkspaceAgentDispatcherContext as f, type WorkspaceAgentDispatcherDispatchInput as g, type WorkspaceAgentDispatcherSendInput as h, type WorkspaceAgentGatewayBinding as i };
@@ -0,0 +1,34 @@
1
+ import * as react from 'react';
2
+ import { ReactNode, HTMLAttributes, ComponentProps } from 'react';
3
+ import { Button } from '@hachej/boring-ui-kit';
4
+ import { LucideIcon } from 'lucide-react';
5
+
6
+ interface OpenArtifactOptions {
7
+ filesystem?: string;
8
+ }
9
+ type OpenArtifactHandler = (path: string, options?: OpenArtifactOptions) => void;
10
+ interface ArtifactOpenProviderProps {
11
+ onOpenArtifact?: OpenArtifactHandler;
12
+ children: ReactNode;
13
+ }
14
+ declare function ArtifactOpenProvider({ onOpenArtifact, children }: ArtifactOpenProviderProps): react.JSX.Element;
15
+ declare function useOpenArtifact(): OpenArtifactHandler | null;
16
+
17
+ type ArtifactProps = HTMLAttributes<HTMLDivElement>;
18
+ declare const Artifact: ({ className, ...props }: ArtifactProps) => react.JSX.Element;
19
+ type ArtifactHeaderProps = HTMLAttributes<HTMLDivElement>;
20
+ declare const ArtifactHeader: ({ className, ...props }: ArtifactHeaderProps) => react.JSX.Element;
21
+ type ArtifactTitleProps = HTMLAttributes<HTMLParagraphElement>;
22
+ declare const ArtifactTitle: ({ className, ...props }: ArtifactTitleProps) => react.JSX.Element;
23
+ type ArtifactDescriptionProps = HTMLAttributes<HTMLParagraphElement>;
24
+ declare const ArtifactDescription: ({ className, ...props }: ArtifactDescriptionProps) => react.JSX.Element;
25
+ type ArtifactActionsProps = HTMLAttributes<HTMLDivElement>;
26
+ declare const ArtifactActions: ({ className, ...props }: ArtifactActionsProps) => react.JSX.Element;
27
+ type ArtifactActionProps = ComponentProps<typeof Button> & {
28
+ tooltip?: string;
29
+ label?: string;
30
+ icon?: LucideIcon;
31
+ };
32
+ declare const ArtifactAction: ({ tooltip, label, icon: Icon, children, className, size, variant, ...props }: ArtifactActionProps) => react.JSX.Element;
33
+
34
+ export { Artifact, ArtifactAction, ArtifactActions, ArtifactDescription, ArtifactHeader, ArtifactOpenProvider, ArtifactTitle, type OpenArtifactHandler, useOpenArtifact };
@@ -0,0 +1,21 @@
1
+ import {
2
+ Artifact,
3
+ ArtifactAction,
4
+ ArtifactActions,
5
+ ArtifactDescription,
6
+ ArtifactHeader,
7
+ ArtifactOpenProvider,
8
+ ArtifactTitle,
9
+ useOpenArtifact
10
+ } from "../chunk-N6THTH7P.js";
11
+ import "../chunk-2BGLZZ7T.js";
12
+ export {
13
+ Artifact,
14
+ ArtifactAction,
15
+ ArtifactActions,
16
+ ArtifactDescription,
17
+ ArtifactHeader,
18
+ ArtifactOpenProvider,
19
+ ArtifactTitle,
20
+ useOpenArtifact
21
+ };
@@ -1,13 +1,15 @@
1
- import { T as ToolUiMetadata, B as BoringChatPart, a as BoringChatMessage, P as PiChatStatus, Q as QueuedUserMessage, C as ChatError, b as PiChatEvent, c as PromptPayload, d as PromptReceipt, F as FollowUpPayload, e as FollowUpReceipt, f as QueueClearPayload, g as QueueClearReceipt, I as InterruptPayload, h as CommandReceipt, i as StopPayload, j as StopReceipt, k as SessionSummary, E as ErrorCode } from '../piChatEvent-B3ehh9V0.js';
1
+ import { p as ToolUiMetadata, B as BoringChatPart, v as BoringChatMessage, H as PiChatStatus, m as QueuedUserMessage, w as ChatError, c as PiChatEvent, d as PromptPayload, 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, b as SessionSummary, y as ErrorCode } from '../piChatEvent-g1nIBh44.js';
2
2
  import * as react from 'react';
3
3
  import { ComponentProps, HTMLAttributes, FormEvent, ReactNode, ComponentType } from 'react';
4
4
  import { FileUIPart, ChatStatus, UIMessage } from 'ai';
5
- import { A as AgentSummary, a as AgentGatewayErrorCode, J as JsonValue } from '../errors-cNC4HMpV.js';
5
+ import { q as AgentSummary, h as AgentGatewayErrorCode, x as JsonValue } from '../errors-szpcDUFQ.js';
6
+ export { Artifact, ArtifactAction, ArtifactActions, ArtifactDescription, ArtifactHeader, ArtifactOpenProvider, ArtifactTitle, OpenArtifactHandler, useOpenArtifact } from './artifacts.js';
6
7
  import { InputGroupAddon, InputGroupButton, InputGroupTextarea, Button, Collapsible, CollapsibleContent, CollapsibleTrigger } from '@hachej/boring-ui-kit';
7
8
  import { Streamdown } from 'streamdown';
8
9
  import { StickToBottom } from 'use-stick-to-bottom';
9
10
  import { ClassValue } from 'clsx';
10
11
  import 'zod';
12
+ import 'lucide-react';
11
13
 
12
14
  interface UploadFileOptions {
13
15
  apiBaseUrl?: string;
@@ -462,7 +464,6 @@ declare class RemotePiSession {
462
464
  private sessionUrl;
463
465
  private addressedCommandPayload;
464
466
  private dispatchProtocolError;
465
- private dispatchTerminalSessionError;
466
467
  private recordEventType;
467
468
  private recordLargeStateWarning;
468
469
  private clearReconnectTimer;
@@ -696,8 +697,6 @@ interface PiChatPanelProps<TComposerBlocker extends ComposerBlocker = ComposerBl
696
697
  allowPromptDuringInitialHydration?: boolean;
697
698
  workspaceWarmupStatus?: ChatPanelWorkspaceWarmupStatus;
698
699
  onSessionReset?: () => void | Promise<void>;
699
- /** Creates and selects a session when the host controls sessionId. */
700
- onCreateSession?: () => void | Promise<void>;
701
700
  onBeforeSubmit?: (draft: string, context: ChatSubmitContext) => false | void | boolean | Promise<false | void | boolean>;
702
701
  onReloadAgentPlugins?: () => Promise<AgentPluginReloadResult | string>;
703
702
  onCommandResult?: (message: string) => void;
@@ -723,7 +722,7 @@ interface PiChatPanelProps<TComposerBlocker extends ComposerBlocker = ComposerBl
723
722
  * knowing what the code means or what the action does. */
724
723
  renderNoticeAction?: (notice: PiChatRuntimeNotice) => ReactNode;
725
724
  }
726
- declare function PiChatPanel<TComposerBlocker extends ComposerBlocker = ComposerBlocker>({ sessionId, agentTypeId, extraCommands, apiBaseUrl, workspaceId, storageScope, requestHeaders, storage, fetch, className, chrome, debug, showSessions, hotReloadEnabled, suggestions, emptyState, emptyPlacement, composerPlaceholder, initialDraft, autoSubmitInitialDraft, onDraftRestored, onAutoSubmitInitialDraftAccepted, onAutoSubmitInitialDraftSettled, model, defaultModel, availableModels, hideDefaultModelOption, hideComposerSettings, suppressPreSubmitCancelledWarning, thinkingLevel, thinkingControl, serverResourcesEnabled, mentionedFiles, commands, excludeBuiltinCommands, toolRenderers, createRemoteSession, remoteSessionOptions, hydrateMessages, allowPromptDuringInitialHydration, workspaceWarmupStatus, onSessionReset, onCreateSession, onBeforeSubmit, onReloadAgentPlugins, onCommandResult, onComposerWarning, onMentionedFilesConsumed, onPromptSubmitStarted, onData, onOpenArtifact, composerBlockers, onComposerStop, onComposerBlockerAction, onTurnComplete, renderNoticeAction, }: PiChatPanelProps<TComposerBlocker>): react.JSX.Element;
725
+ declare function PiChatPanel<TComposerBlocker extends ComposerBlocker = ComposerBlocker>({ sessionId, agentTypeId, extraCommands, apiBaseUrl, workspaceId, storageScope, requestHeaders, storage, fetch, className, chrome, debug, showSessions, hotReloadEnabled, suggestions, emptyState, emptyPlacement, composerPlaceholder, initialDraft, autoSubmitInitialDraft, onDraftRestored, onAutoSubmitInitialDraftAccepted, onAutoSubmitInitialDraftSettled, model, defaultModel, availableModels, hideDefaultModelOption, hideComposerSettings, suppressPreSubmitCancelledWarning, thinkingLevel, thinkingControl, serverResourcesEnabled, mentionedFiles, commands, excludeBuiltinCommands, toolRenderers, createRemoteSession, remoteSessionOptions, hydrateMessages, allowPromptDuringInitialHydration, workspaceWarmupStatus, onSessionReset, onBeforeSubmit, onReloadAgentPlugins, onCommandResult, onComposerWarning, onMentionedFilesConsumed, onPromptSubmitStarted, onData, onOpenArtifact, composerBlockers, onComposerStop, onComposerBlockerAction, onTurnComplete, renderNoticeAction, }: PiChatPanelProps<TComposerBlocker>): react.JSX.Element;
727
726
 
728
727
  type AddressedAgentOption = Pick<AgentSummary, 'agentTypeId' | 'label' | 'description' | 'pluginIds'>;
729
728
  interface UseAddressedAgentSelectionOptions {
@@ -742,7 +741,6 @@ interface UseAddressedAgentSelectionResult {
742
741
  }
743
742
  declare function useAddressedAgentSelection({ apiBaseUrl, requestHeaders, storageScope, fetch, enabled, }?: UseAddressedAgentSelectionOptions): UseAddressedAgentSelectionResult;
744
743
 
745
- declare const RUNTIME_SCOPE_MISMATCH_MESSAGE = "This chat belongs to a previous runtime configuration and can no longer be changed.";
746
744
  type GatewayResponseErrorCode = AgentGatewayErrorCode | ErrorCode;
747
745
  declare class GatewayResponseError extends Error {
748
746
  readonly status: number;
@@ -756,7 +754,6 @@ declare class GatewayResponseError extends Error {
756
754
  declare function gatewayResponseError(response: Response, fallbackMessage: string, operation?: string): Promise<GatewayResponseError>;
757
755
  declare function gatewayResponseErrorFromBody(status: number, body: unknown, fallbackMessage: string, operation?: string): GatewayResponseError;
758
756
  declare function errorResponseCode(error: unknown): GatewayResponseErrorCode | undefined;
759
- declare function isRuntimeScopeMismatchError(error: unknown): boolean;
760
757
 
761
758
  interface DebugDrawerProps {
762
759
  agentTypeId: string;
@@ -771,17 +768,6 @@ interface DebugDrawerProps {
771
768
  }
772
769
  declare function DebugDrawer({ agentTypeId, apiBaseUrl, fetch, sessionId, messages, requestHeaders, storageScope, width, onWidthChange }: DebugDrawerProps): react.JSX.Element;
773
770
 
774
- interface OpenArtifactOptions {
775
- filesystem?: string;
776
- }
777
- type OpenArtifactHandler = (path: string, options?: OpenArtifactOptions) => void;
778
- interface ArtifactOpenProviderProps {
779
- onOpenArtifact?: OpenArtifactHandler;
780
- children: ReactNode;
781
- }
782
- declare function ArtifactOpenProvider({ onOpenArtifact, children }: ArtifactOpenProviderProps): react.JSX.Element;
783
- declare function useOpenArtifact(): OpenArtifactHandler | null;
784
-
785
771
  type SelectorTrigger = 'button' | 'slash';
786
772
  declare const ModelSelectTrigger: react.ForwardRefExoticComponent<Omit<Omit<react.DetailedHTMLProps<react.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref">, "value"> & {
787
773
  value: ModelSelection | null;
@@ -969,4 +955,4 @@ declare const ToolContent: ({ className, ...props }: ToolContentProps) => react.
969
955
 
970
956
  declare function cn(...inputs: ClassValue[]): string;
971
957
 
972
- export { type AddressedAgentOption, type AgentCommandContribution, type AgentCommandOptions, type AgentPluginReloadResult, ArtifactOpenProvider, type AvailableModel, BoringChatMessage, ChatEmptyState, type ChatEmptyStateProps, type ChatMessageContribution, type ChatMessageContributionProps, ChatMessageContributionProvider, PiChatPanel as ChatPanel, type PiChatPanelProps as ChatPanelProps, type ChatSuggestion, CodeBlock, type CommandRegistry, type ComposerActionContributionProps, type ComposerBlocker, type ComposerBlockerAction, type ComposerContribution, ComposerContributionProvider, type ComposerDraftUpdate, Conversation, ConversationContent, ConversationScrollButton, DebugDrawer, GatewayResponseError, type GatewayResponseErrorCode, type GroupedToolEntry, Message, MessageAction, MessageActions, MessageContent, MessageResponse, ModelPickerMenu, ModelSelect, ModelSelectTrigger, type ModelSelection, type OpenArtifactHandler, type ParsedCommand, PiChatPanel, type PiChatPanelProps, SessionBrowser as PiSessionBrowser, type PiSessionCreateInit, SessionList as PiSessionList, type PiSessionSearchItem, type PiSessionSearchOptions, type PiSessionSearchSortMode, PromptInput, PromptInputFooter, PromptInputSubmit, PromptInputTextarea, RUNTIME_SCOPE_MISMATCH_MESSAGE, Reasoning, ReasoningContent, ReasoningTrigger, type SessionListProps, type SlashCommand, type SlashCommandContext, type ThinkingLevel, ThinkingSelect, Tool, ToolCallGroup, ToolContent, ToolHeader, type ToolPart$1 as ToolPart, type ToolRenderer, type ToolRendererOverrides, type UploadFileOptions, type UploadFileResult, type UseAddressedAgentSelectionOptions, type UseAddressedAgentSelectionResult, type UsePiSessionsOptions, type UsePiSessionsResult, activeSessionStorageKey, builtinCommands, cn, createCommandRegistry, defaultChatSuggestions, defaultToolRenderers, errorResponseCode, gatewayResponseError, gatewayResponseErrorFromBody, getAgentCommands, isRuntimeScopeMismatchError, matchPiSessionSearch, mergeShadcnToolRenderers, mergeToolRenderers, parsePiSessionSearchQuery, parseSlashCommand, readActiveSessionId, resolveToolRenderer, searchPiSessions, uploadFile, useAddressedAgentSelection, useOpenArtifact, usePiSessions, writeActiveSessionId };
958
+ export { type AddressedAgentOption, type AgentCommandContribution, type AgentCommandOptions, type AgentPluginReloadResult, type AvailableModel, BoringChatMessage, ChatEmptyState, type ChatEmptyStateProps, type ChatMessageContribution, type ChatMessageContributionProps, ChatMessageContributionProvider, PiChatPanel as ChatPanel, type PiChatPanelProps as ChatPanelProps, type ChatSuggestion, CodeBlock, type CommandRegistry, type ComposerActionContributionProps, type ComposerBlocker, type ComposerBlockerAction, type ComposerContribution, ComposerContributionProvider, type ComposerDraftUpdate, Conversation, ConversationContent, ConversationScrollButton, DebugDrawer, GatewayResponseError, type GatewayResponseErrorCode, type GroupedToolEntry, Message, MessageAction, MessageActions, MessageContent, MessageResponse, ModelPickerMenu, ModelSelect, ModelSelectTrigger, type ModelSelection, type ParsedCommand, PiChatPanel, type PiChatPanelProps, SessionBrowser as PiSessionBrowser, type PiSessionCreateInit, SessionList as PiSessionList, type PiSessionSearchItem, type PiSessionSearchOptions, type PiSessionSearchSortMode, PromptInput, PromptInputFooter, PromptInputSubmit, PromptInputTextarea, Reasoning, ReasoningContent, ReasoningTrigger, type SessionListProps, type SlashCommand, type SlashCommandContext, type ThinkingLevel, ThinkingSelect, Tool, ToolCallGroup, ToolContent, ToolHeader, type ToolPart$1 as ToolPart, type ToolRenderer, type ToolRendererOverrides, type UploadFileOptions, type UploadFileResult, type UseAddressedAgentSelectionOptions, type UseAddressedAgentSelectionResult, type UsePiSessionsOptions, type UsePiSessionsResult, activeSessionStorageKey, builtinCommands, cn, createCommandRegistry, defaultChatSuggestions, defaultToolRenderers, errorResponseCode, gatewayResponseError, gatewayResponseErrorFromBody, getAgentCommands, matchPiSessionSearch, mergeShadcnToolRenderers, mergeToolRenderers, parsePiSessionSearchQuery, parseSlashCommand, readActiveSessionId, resolveToolRenderer, searchPiSessions, uploadFile, useAddressedAgentSelection, usePiSessions, writeActiveSessionId };