@hachej/boring-agent 0.1.101 → 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 (35) 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-XTMY3PWI.js → chunk-6WKQ4FC4.js} +69 -11
  5. package/dist/{chunk-XCZBICZS.js → chunk-7QM22DU7.js} +1 -1
  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-T37OVD6L.js → chunk-TW7G33QH.js} +1 -1
  10. package/dist/core/index.d.ts +5 -5
  11. package/dist/core/index.js +1 -1
  12. package/dist/{createHarness-7C2A5UVH.js → createHarness-4Q6DQBRT.js} +2 -2
  13. package/dist/{errors-Ci0dzmcP.d.ts → errors-szpcDUFQ.d.ts} +2 -2
  14. package/dist/{file-search-DmoDnMan.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 +5 -14
  18. package/dist/front/index.js +595 -635
  19. package/dist/{harness-s-kEgJkK.d.ts → harness-erpL2SER.d.ts} +2 -2
  20. package/dist/{lease-D5-CBoPs.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-Bzof4IEy.d.ts → piChatEvent-g1nIBh44.d.ts} +14 -14
  23. package/dist/{piChatSessionService-BU4L5hxM.d.ts → piChatSessionService-DugeRHzb.d.ts} +1 -1
  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 -3
  27. package/dist/server/index.d.ts +19 -16
  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-OwI_m-2p.d.ts → types-BnjMLAd5.d.ts} +13 -5
  34. package/docs/ERROR_CODES.md +1 -0
  35. package/package.json +16 -12
@@ -1,6 +1,7 @@
1
1
  import {
2
2
  DebugDrawer
3
- } from "./chunk-46HJK2ES.js";
3
+ } from "./chunk-4XOW57KJ.js";
4
+ import "./chunk-2BGLZZ7T.js";
4
5
  import "./chunk-YGRQ4Q5P.js";
5
6
  export {
6
7
  DebugDrawer
@@ -0,0 +1,10 @@
1
+ // src/front/lib/index.ts
2
+ import { clsx } from "clsx";
3
+ import { twMerge } from "tailwind-merge";
4
+ function cn(...inputs) {
5
+ return twMerge(clsx(inputs));
6
+ }
7
+
8
+ export {
9
+ cn
10
+ };
@@ -1,3 +1,6 @@
1
+ import {
2
+ cn
3
+ } from "./chunk-2BGLZZ7T.js";
1
4
  import {
2
5
  safeRandomUUID
3
6
  } from "./chunk-YGRQ4Q5P.js";
@@ -53,13 +56,6 @@ async function copyTextToClipboard(text) {
53
56
  }
54
57
  }
55
58
 
56
- // src/front/lib/index.ts
57
- import { clsx } from "clsx";
58
- import { twMerge } from "tailwind-merge";
59
- function cn(...inputs) {
60
- return twMerge(clsx(inputs));
61
- }
62
-
63
59
  // src/front/DebugDrawer.tsx
64
60
  import { Button, IconButton, Tabs, TabsContent, TabsList, TabsTrigger } from "@hachej/boring-ui-kit";
65
61
  import {
@@ -339,7 +335,6 @@ function DebugDrawer({ agentTypeId, apiBaseUrl, fetch, sessionId, messages, requ
339
335
  }
340
336
 
341
337
  export {
342
- cn,
343
338
  copyTextToClipboard,
344
339
  agentResourceUrl,
345
340
  withStorageScope,
@@ -7,7 +7,7 @@ import {
7
7
  readConfiguredDefaultModel,
8
8
  registerConfiguredModelProviders,
9
9
  withPiHarnessDefaults
10
- } from "./chunk-T37OVD6L.js";
10
+ } from "./chunk-TW7G33QH.js";
11
11
  import {
12
12
  AGENT_KNOWLEDGE_FILESYSTEM_ID,
13
13
  AgentDefinitionValidationError,
@@ -29,7 +29,7 @@ import {
29
29
  validateAgentDefinition,
30
30
  validateAgentDeployment,
31
31
  validateTool
32
- } from "./chunk-3OEDBRKY.js";
32
+ } from "./chunk-JNEKOVMJ.js";
33
33
  import {
34
34
  safeCapture
35
35
  } from "./chunk-4IQ4HHBG.js";
@@ -41,12 +41,12 @@ import {
41
41
  AgentGatewayErrorCode,
42
42
  extractToolUiMetadata,
43
43
  sanitizeToolUiMetadata2 as sanitizeToolUiMetadata
44
- } from "./chunk-XCZBICZS.js";
44
+ } from "./chunk-7QM22DU7.js";
45
45
  import {
46
46
  AgentDefinitionErrorCode,
47
47
  AgentDeploymentErrorCode,
48
48
  ErrorCode
49
- } from "./chunk-VXF5DWS6.js";
49
+ } from "./chunk-K25PK5EC.js";
50
50
 
51
51
  // src/server/sandbox/snapshots/deploymentSnapshot.ts
52
52
  var VERCEL_UV_BIN_DIR = "/workspace/.boring-agent/sdk/uv/bin";
@@ -147,6 +147,7 @@ function createServerFileSearch(workspace, sandbox) {
147
147
  // src/server/sandbox/remote-worker/protocol.ts
148
148
  var REMOTE_WORKER_RUNTIME_CWD = "/workspace";
149
149
  var REMOTE_WORKER_PROVIDER = "remote-worker";
150
+ var REMOTE_WORKER_EXCLUSIVE_BINARY_CREATE_CAPABILITY = "exclusive-binary-create";
150
151
  var WORKER_INTERNAL_TOKEN_HEADER = "x-boring-internal-token";
151
152
  var WORKER_WORKSPACE_ID_HEADER = "x-boring-workspace-id";
152
153
  var WORKER_REQUEST_ID_HEADER = "x-boring-request-id";
@@ -314,6 +315,9 @@ var RemoteWorkerClient = class {
314
315
  headers: makeHeaders({ token: this.token, workspaceId: this.workspaceId, requestId: this.requestId })
315
316
  }, this.requestTimeoutMs);
316
317
  if (!response.ok) throw await parseError(response);
318
+ const body2 = await response.json().catch(() => ({}));
319
+ const capabilities2 = Array.isArray(body2.capabilities) ? body2.capabilities.filter((capability) => capability === "exclusive-binary-create") : void 0;
320
+ return { ok: true, ...capabilities2 ? { capabilities: capabilities2 } : {} };
317
321
  }
318
322
  async workspace(op) {
319
323
  const response = await this.fetchWithTimeout(`${this.baseUrl}/internal/workspaces/${encodeWorkspaceId(this.workspaceId)}/fs`, {
@@ -412,6 +416,7 @@ function constantTimeTokenEqual(a, b) {
412
416
  }
413
417
 
414
418
  // src/server/workspace/createRemoteWorkerWorkspace.ts
419
+ var EEXIST_CODE = "EEXIST";
415
420
  function expectContent(result) {
416
421
  if ("content" in result && typeof result.content === "string") return result.content;
417
422
  throw new Error("remote worker returned invalid file content response");
@@ -492,7 +497,7 @@ function createRemoteWatcher(client) {
492
497
  }
493
498
  };
494
499
  }
495
- function createRemoteWorkerWorkspace(client) {
500
+ function createRemoteWorkerWorkspace(client, supportsExclusiveBinaryCreate = false) {
496
501
  let watcher = null;
497
502
  return {
498
503
  root: REMOTE_WORKER_RUNTIME_CWD,
@@ -514,6 +519,18 @@ function createRemoteWorkerWorkspace(client) {
514
519
  async writeBinaryFile(path, data) {
515
520
  await client.workspace({ op: "writeBinaryFile", path, dataBase64: encodeBytesForWorker(data) });
516
521
  },
522
+ ...supportsExclusiveBinaryCreate ? {
523
+ async createBinaryFile(path, data) {
524
+ try {
525
+ await client.workspace({ op: "createBinaryFile", path, dataBase64: encodeBytesForWorker(data) });
526
+ } catch (error) {
527
+ if (error?.code === ErrorCode.enum.REMOTE_WORKER_ALREADY_EXISTS) {
528
+ throw Object.assign(new Error("EEXIST: file already exists"), { code: EEXIST_CODE });
529
+ }
530
+ throw error;
531
+ }
532
+ }
533
+ } : {},
517
534
  async readFileWithStat(path) {
518
535
  const result = await client.workspace({ op: "readFileWithStat", path });
519
536
  if ("content" in result && "stat" in result) return { content: result.content, stat: result.stat };
@@ -562,9 +579,14 @@ function createRemoteWorkerModeAdapter(opts = {}) {
562
579
  requestId: ctx.requestId,
563
580
  fetchImpl: opts.fetchImpl
564
581
  });
565
- const workspace = createRemoteWorkerWorkspace(client);
582
+ const health = await client.health();
583
+ const workspace = createRemoteWorkerWorkspace(
584
+ client,
585
+ health.capabilities?.includes(
586
+ REMOTE_WORKER_EXCLUSIVE_BINARY_CREATE_CAPABILITY
587
+ ) ?? false
588
+ );
566
589
  const sandbox = createRemoteWorkerSandbox(client);
567
- await sandbox.init?.({ workspace, sessionId: ctx.sessionId });
568
590
  return {
569
591
  runtimeContext: { runtimeCwd: REMOTE_WORKER_RUNTIME_CWD },
570
592
  bash: { kind: "remote" },
@@ -4713,6 +4735,7 @@ function toolInputFromCall(part) {
4713
4735
  }
4714
4736
  function assistantParts(message, messageId) {
4715
4737
  const content = message.content;
4738
+ const assistantAborted = message.stopReason === "aborted";
4716
4739
  if (typeof content === "string") return [{ type: "text", id: `${messageId}:text:0`, text: content }];
4717
4740
  if (!Array.isArray(content)) return [];
4718
4741
  return content.flatMap((part, index) => {
@@ -4732,7 +4755,7 @@ function assistantParts(message, messageId) {
4732
4755
  }
4733
4756
  if (part.type === "toolCall") {
4734
4757
  const toolCallId = optionalString(part.id) ?? `${messageId}:tool:${index}`;
4735
- const state = part.state === "output-error" ? "output-error" : part.state === "output-available" ? "output-available" : "input-available";
4758
+ const state = part.state === "output-error" ? "output-error" : part.state === "output-available" ? "output-available" : part.state === "aborted" || assistantAborted ? "aborted" : "input-available";
4736
4759
  return [
4737
4760
  {
4738
4761
  type: "tool-call",
@@ -7587,6 +7610,7 @@ function assertUniqueRuntimeFilesystemBindings(bindings) {
7587
7610
  var MUTATION_CAPABILITY = {
7588
7611
  write: "write",
7589
7612
  writeBinary: "write",
7613
+ createBinary: "write",
7590
7614
  delete: "delete",
7591
7615
  mkdir: "create-child"
7592
7616
  };
@@ -7607,6 +7631,7 @@ function intersectRuntimeFilesystemBinding(host, request) {
7607
7631
  ...request.operations,
7608
7632
  write: guarded(request.operations.write?.bind(request.operations), MUTATION_CAPABILITY.write),
7609
7633
  writeBinary: guarded(request.operations.writeBinary?.bind(request.operations), MUTATION_CAPABILITY.writeBinary),
7634
+ createBinary: guarded(request.operations.createBinary?.bind(request.operations), MUTATION_CAPABILITY.createBinary),
7610
7635
  delete: guarded(request.operations.delete?.bind(request.operations), MUTATION_CAPABILITY.delete),
7611
7636
  mkdir: guarded(request.operations.mkdir?.bind(request.operations), MUTATION_CAPABILITY.mkdir),
7612
7637
  move: request.operations.move ? async (args) => {
@@ -7916,7 +7941,7 @@ async function buildAgentComposition(input) {
7916
7941
  sessionNamespace: configuredNamespace,
7917
7942
  sessionDir: runtimeScope.sessionDir ?? factoryInput.sessionDir
7918
7943
  }) : async (factoryInput) => {
7919
- const { createPiCodingAgentHarness } = await import("./createHarness-7C2A5UVH.js");
7944
+ const { createPiCodingAgentHarness } = await import("./createHarness-4Q6DQBRT.js");
7920
7945
  return createPiCodingAgentHarness({
7921
7946
  ...factoryInput,
7922
7947
  pi,
@@ -12069,7 +12094,7 @@ import { lstat as lstat4, open as open2, opendir, realpath as realpath5, stat as
12069
12094
  import { homedir as homedir2 } from "node:os";
12070
12095
  import { dirname as dirname8, isAbsolute as isAbsolute7, join as join9, parse, relative as relative9, resolve as resolve8, sep as sep8 } from "node:path";
12071
12096
  import { fileURLToPath as fileURLToPath7 } from "node:url";
12072
- import { DefaultPackageManager as DefaultPackageManager2, getAgentDir as getAgentDir2 } from "@mariozechner/pi-coding-agent";
12097
+ import { DefaultPackageManager as DefaultPackageManager2, getAgentDir as getAgentDir2, loadProjectContextFiles } from "@mariozechner/pi-coding-agent";
12073
12098
  var DEFAULT_PI_RESOURCE_DIGEST_LIMITS = Object.freeze({
12074
12099
  maxDepth: 32,
12075
12100
  maxFiles: 1e4,
@@ -12081,11 +12106,13 @@ function createPiResourceDigestInput(input) {
12081
12106
  const piAgentDir = resolvePiPath(input.piAgentDir ?? getAgentDir2(), process.cwd());
12082
12107
  const piUserHome = resolvePiPath(input.piUserHome ?? homedir2(), process.cwd());
12083
12108
  const noSkills = input.noSkills ?? true;
12109
+ const noContextFiles = input.noContextFiles ?? true;
12084
12110
  return {
12085
12111
  piCwd,
12086
12112
  piAgentDir,
12087
12113
  piUserHome,
12088
12114
  noSkills,
12115
+ noContextFiles,
12089
12116
  promptParts: input.resourceSets.flatMap((set) => set.promptParts ?? []),
12090
12117
  additionalSkillPaths: uniqueStrings(input.resourceSets.flatMap((set) => set.additionalSkillPaths ?? [])),
12091
12118
  packages: compactPiPackages(input.resourceSets.flatMap((set) => set.packages ?? [])),
@@ -12099,7 +12126,7 @@ function createPiResourceDigestInput(input) {
12099
12126
  ...input.limits ? { limits: input.limits } : {}
12100
12127
  };
12101
12128
  }
12102
- var FORMAT_VERSION = "boring-pi-resource-digest-v4";
12129
+ var FORMAT_VERSION = "boring-pi-resource-digest-v5";
12103
12130
  var EXCLUDED_DIRECTORIES = /* @__PURE__ */ new Set([".git", "node_modules"]);
12104
12131
  var EXCLUDED_FILES = /* @__PURE__ */ new Set([".boring-signature.json"]);
12105
12132
  async function digestPiResourceInputs(input) {
@@ -12108,6 +12135,7 @@ async function digestPiResourceInputs(input) {
12108
12135
  const piAgentDir = resolvePiPath(input.piAgentDir, process.cwd());
12109
12136
  const piUserHome = resolvePiPath(input.piUserHome, process.cwd());
12110
12137
  const projectSettingsDir = join9(piCwd, ".pi");
12138
+ const noContextFiles = input.noContextFiles ?? true;
12111
12139
  const authorizedRoots = [...new Set(input.authorizedRoots.map((path) => resolvePiPath(path, piCwd)))];
12112
12140
  if (authorizedRoots.length === 0) {
12113
12141
  throw stableError(ErrorCode.enum.CONFIG_INVALID, 400, "Pi resource digest requires at least one independently authorized root");
@@ -12119,8 +12147,28 @@ async function digestPiResourceInputs(input) {
12119
12147
  frameString(hash, "project-settings-dir", projectSettingsDir);
12120
12148
  frameString(hash, "user-agent-dir", piAgentDir);
12121
12149
  frameString(hash, "user-home", piUserHome);
12150
+ frameString(hash, "context-policy", noContextFiles ? "sealed" : "ambient");
12122
12151
  const promptText = (input.promptParts ?? []).map((part) => part?.trim()).filter((part) => Boolean(part)).join("\n\n");
12123
12152
  frameString(hash, "prompt", promptText);
12153
+ if (!noContextFiles) {
12154
+ const contextFiles = loadProjectContextFiles({ cwd: piCwd, agentDir: piAgentDir });
12155
+ for (const contextFile of contextFiles) {
12156
+ const bytes = Buffer.byteLength(contextFile.content);
12157
+ state.nodes += 1;
12158
+ if (state.nodes > state.limits.maxFiles) {
12159
+ throw limitError(`Pi resource tree exceeds maximum node count ${state.limits.maxFiles}`);
12160
+ }
12161
+ if (bytes > state.limits.maxFileBytes) {
12162
+ throw limitError(`Pi context file exceeds maximum bytes ${state.limits.maxFileBytes}: ${contextFile.path}`);
12163
+ }
12164
+ if (state.bytes + bytes > state.limits.maxTotalBytes) {
12165
+ throw limitError(`Pi resource tree exceeds maximum total bytes ${state.limits.maxTotalBytes}`);
12166
+ }
12167
+ frameString(hash, "context-path", contextFile.path);
12168
+ frameString(hash, "context-content", contextFile.content);
12169
+ state.bytes += bytes;
12170
+ }
12171
+ }
12124
12172
  await hashResourceCollection(state, piCwd, "settings", [
12125
12173
  join9(projectSettingsDir, "settings.json"),
12126
12174
  join9(piAgentDir, "settings.json")
@@ -12564,6 +12612,7 @@ async function createStandaloneAgentHostApp(options = {}) {
12564
12612
  return createPiResourceDigestInput({
12565
12613
  piCwd: workspaceRoot,
12566
12614
  noSkills: pi.noSkills,
12615
+ noContextFiles: pi.noContextFiles,
12567
12616
  resourceSets: [{
12568
12617
  promptParts: [
12569
12618
  options.systemPromptAppend,
@@ -13054,6 +13103,14 @@ function createUserFilesystemBinding(workspace, policy, resolvePolicyPath) {
13054
13103
  const stat7 = await workspace.stat(target);
13055
13104
  return { mtimeMs: stat7.kind === "file" ? stat7.mtimeMs : void 0 };
13056
13105
  },
13106
+ ...workspace.createBinaryFile ? {
13107
+ async createBinary({ path, content }) {
13108
+ await requireCapability(path, "write");
13109
+ const target = workspacePath(workspace, path);
13110
+ await workspace.createBinaryFile(target, content);
13111
+ return {};
13112
+ }
13113
+ } : {},
13057
13114
  async delete({ path }) {
13058
13115
  await requireCapability(path, "delete");
13059
13116
  await workspace.unlink(workspacePath(workspace, path));
@@ -13439,6 +13496,7 @@ export {
13439
13496
  resolveWorkspaceRoot,
13440
13497
  REMOTE_WORKER_RUNTIME_CWD,
13441
13498
  REMOTE_WORKER_PROVIDER,
13499
+ REMOTE_WORKER_EXCLUSIVE_BINARY_CREATE_CAPABILITY,
13442
13500
  WORKER_INTERNAL_TOKEN_HEADER,
13443
13501
  WORKER_WORKSPACE_ID_HEADER,
13444
13502
  WORKER_REQUEST_ID_HEADER,
@@ -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) {
@@ -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";
@@ -1,8 +1,8 @@
1
- import { A as AgentHarness, a as AgentReadiness, b as Agent } from '../harness-s-kEgJkK.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-s-kEgJkK.js';
3
- import { S as SessionStore } from '../piChatEvent-Bzof4IEy.js';
4
- import { A as AgentCoreSessionService, a as AgentEffectAdmission } from '../piChatSessionService-BU4L5hxM.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-BU4L5hxM.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-T37OVD6L.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-Bzof4IEy.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 {
@@ -205,4 +205,4 @@ declare class AgentGatewayError extends Error {
205
205
  toJSON(): AgentGatewayErrorDTO;
206
206
  }
207
207
 
208
- 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-Bzof4IEy.js';
2
- import { p as AgentSendInput, j as AgentEvent } from './harness-s-kEgJkK.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-Ci0dzmcP.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-Bzof4IEy.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-Ci0dzmcP.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;
@@ -766,17 +768,6 @@ interface DebugDrawerProps {
766
768
  }
767
769
  declare function DebugDrawer({ agentTypeId, apiBaseUrl, fetch, sessionId, messages, requestHeaders, storageScope, width, onWidthChange }: DebugDrawerProps): react.JSX.Element;
768
770
 
769
- interface OpenArtifactOptions {
770
- filesystem?: string;
771
- }
772
- type OpenArtifactHandler = (path: string, options?: OpenArtifactOptions) => void;
773
- interface ArtifactOpenProviderProps {
774
- onOpenArtifact?: OpenArtifactHandler;
775
- children: ReactNode;
776
- }
777
- declare function ArtifactOpenProvider({ onOpenArtifact, children }: ArtifactOpenProviderProps): react.JSX.Element;
778
- declare function useOpenArtifact(): OpenArtifactHandler | null;
779
-
780
771
  type SelectorTrigger = 'button' | 'slash';
781
772
  declare const ModelSelectTrigger: react.ForwardRefExoticComponent<Omit<Omit<react.DetailedHTMLProps<react.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref">, "value"> & {
782
773
  value: ModelSelection | null;
@@ -964,4 +955,4 @@ declare const ToolContent: ({ className, ...props }: ToolContentProps) => react.
964
955
 
965
956
  declare function cn(...inputs: ClassValue[]): string;
966
957
 
967
- 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, 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, 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 };