@hachej/boring-agent 0.1.17 → 0.1.20

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 (39) hide show
  1. package/dist/{sandbox-handle-store-hK76cTjn.d.ts → agentPluginEvents-zyIvVjsA.d.ts} +28 -32
  2. package/dist/{chunk-F3CE5CNW.js → chunk-B5JECXMG.js} +5 -7
  3. package/dist/front/index.d.ts +23 -7
  4. package/dist/front/index.js +764 -421
  5. package/dist/front/styles.css +61 -0
  6. package/dist/{tool-ui-DSmWuqGe.d.ts → harness-DRrTn_5T.d.ts} +43 -24
  7. package/dist/server/index.d.ts +79 -10
  8. package/dist/server/index.js +251 -60
  9. package/dist/shared/index.d.ts +5 -3
  10. package/dist/shared/index.js +3 -1
  11. package/dist/tool-ui-DIFNGwYd.d.ts +20 -0
  12. package/docs/ACCESSIBILITY.md +55 -0
  13. package/docs/API.md +64 -0
  14. package/docs/CSP.md +40 -0
  15. package/docs/ERROR_CODES.md +54 -0
  16. package/docs/KNOWN_LIMITATIONS.md +100 -0
  17. package/docs/MIGRATION.md +50 -0
  18. package/docs/PERFORMANCE.md +68 -0
  19. package/docs/PLUGINS.md +108 -0
  20. package/docs/README.md +17 -0
  21. package/docs/RISKS-MULTI-TAB.md +46 -0
  22. package/docs/STYLING.md +71 -0
  23. package/docs/UI-SHADCN.md +56 -0
  24. package/docs/VERCEL_COSTS.md +103 -0
  25. package/docs/plans/AGENT_EVAL_FRAMEWORK.md +466 -0
  26. package/docs/plans/agent-package-spec.md +1777 -0
  27. package/docs/plans/harness-followup-capabilities.md +440 -0
  28. package/docs/plans/harness-tool-ui-capabilities.md +144 -0
  29. package/docs/plans/pi-followup-history-projection.md +229 -0
  30. package/docs/plans/pi-tools-migration.md +1061 -0
  31. package/docs/plans/reviews/pi-followup-history-codex-review.md +11 -0
  32. package/docs/plans/reviews/pi-followup-history-gpt-review.md +64 -0
  33. package/docs/plans/reviews/pi-followup-history-opus-review.md +43 -0
  34. package/docs/plans/reviews/pi-followup-history-xai-review.md +43 -0
  35. package/docs/plans/vercel-base-snapshot-template-plan.md +527 -0
  36. package/docs/plans/vercel-persistent-sandbox-adapter.md +553 -0
  37. package/docs/runtime.md +56 -0
  38. package/docs/tools.md +75 -0
  39. package/package.json +4 -3
@@ -234,12 +234,6 @@ interface IsolatedCodeInput {
234
234
  * field; it exists so callers can target a specific provider.
235
235
  */
236
236
  vendorHints?: Record<string, unknown>;
237
- /**
238
- * @deprecated Use `resources` instead. Vercel-specific t-shirt
239
- * sizes; kept for back-compat. Backends MAY map this to their own
240
- * size taxonomy or ignore it. New consumers should use `resources`.
241
- */
242
- vmSize?: 'xxs' | 'xs' | 's' | 'm' | 'l';
243
237
  }
244
238
  interface IsolatedCodeOutput {
245
239
  sandboxId: string;
@@ -248,31 +242,6 @@ interface IsolatedCodeOutput {
248
242
  exitCode: number;
249
243
  }
250
244
 
251
- type JSONSchema = Record<string, unknown>;
252
- interface AgentTool {
253
- name: string;
254
- description: string;
255
- /** Optional one-line prompt entry. Pi-built tools should preserve pi's snippet verbatim. */
256
- promptSnippet?: string;
257
- parameters: JSONSchema;
258
- execute(params: Record<string, unknown>, ctx: ToolExecContext): Promise<ToolResult>;
259
- }
260
- interface ToolExecContext {
261
- abortSignal: AbortSignal;
262
- toolCallId: string;
263
- onUpdate?: (partial: string) => void;
264
- /** Agent chat/session id executing this tool, when known. */
265
- sessionId?: string;
266
- }
267
- interface ToolResult {
268
- content: Array<{
269
- type: 'text';
270
- text: string;
271
- }>;
272
- isError?: boolean;
273
- details?: unknown;
274
- }
275
-
276
245
  interface FileSearch {
277
246
  search(glob: string, limit?: number): Promise<string[]>;
278
247
  }
@@ -291,4 +260,31 @@ interface SandboxHandleStore {
291
260
  list(): Promise<SandboxHandleRecord[]>;
292
261
  }
293
262
 
294
- export type { AgentTool as A, Entry as E, FileSearch as F, IsolatedCodeInput as I, JSONSchema as J, Sandbox as S, ToolExecContext as T, Workspace as W, ExecOptions as a, ExecResult as b, IsolatedCodeOutput as c, SandboxCapability as d, SandboxHandleRecord as e, SandboxHandleStore as f, Stat as g, ToolResult as h };
263
+ /**
264
+ * Browser CustomEvent name dispatched on `window` after the workspace's
265
+ * agent-plugin hot reload subscriber commits a registry change (load,
266
+ * unload, or error).
267
+ *
268
+ * Declared in `@hachej/boring-agent` (not `@hachej/boring-workspace`)
269
+ * so the agent's ChatPanel — which listens for this event to refresh
270
+ * its slash-command palette / banner state — can import it without
271
+ * creating a workspace → agent → workspace cycle. Workspace's
272
+ * `useAgentPluginHotReload` imports the same constant.
273
+ */
274
+ declare const WORKSPACE_AGENT_PLUGINS_RELOADED_EVENT = "boring-ui:agent-plugins-reloaded";
275
+ /**
276
+ * One per plugin that loaded successfully but whose server-side surfaces
277
+ * (Fastify routes / agent tools) still hold pre-reload code. Shared
278
+ * between the agent's /reload HTTP route + the ChatPanel banner so the
279
+ * agent layer has ONE declaration of this wire shape. Mirrors what the
280
+ * workspace's `collectRestartWarnings()` emits (workspace owns the
281
+ * canonical `PluginRestartWarning` type; we redeclare here only because
282
+ * the agent layer must not depend on workspace).
283
+ */
284
+ interface PluginRestartWarning {
285
+ id: string;
286
+ surfaces: string[];
287
+ message: string;
288
+ }
289
+
290
+ export { type Entry as E, type FileSearch as F, type IsolatedCodeInput as I, type PluginRestartWarning as P, type Sandbox as S, type Workspace as W, type ExecOptions as a, type ExecResult as b, type IsolatedCodeOutput as c, type SandboxCapability as d, type SandboxHandleRecord as e, type SandboxHandleStore as f, type Stat as g, WORKSPACE_AGENT_PLUGINS_RELOADED_EVENT as h };
@@ -11,12 +11,6 @@ function extractToolUiMetadata(output) {
11
11
  const details = output.details;
12
12
  if (!isRecord(details)) return void 0;
13
13
  if (isToolUiMetadata(details.ui)) return details.ui;
14
- if (typeof details.uiKind === "string") {
15
- return {
16
- rendererId: details.uiKind,
17
- details
18
- };
19
- }
20
14
  return void 0;
21
15
  }
22
16
 
@@ -30,9 +24,13 @@ var PI_AGENT_RUNTIME_CAPABILITIES = {
30
24
  aiSdkOwnsHistory: false
31
25
  };
32
26
 
27
+ // src/shared/agentPluginEvents.ts
28
+ var WORKSPACE_AGENT_PLUGINS_RELOADED_EVENT = "boring-ui:agent-plugins-reloaded";
29
+
33
30
  export {
34
31
  isToolUiMetadata,
35
32
  extractToolUiMetadata,
36
33
  DEFAULT_AGENT_RUNTIME_CAPABILITIES,
37
- PI_AGENT_RUNTIME_CAPABILITIES
34
+ PI_AGENT_RUNTIME_CAPABILITIES,
35
+ WORKSPACE_AGENT_PLUGINS_RELOADED_EVENT
38
36
  };
@@ -1,10 +1,11 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import * as react from 'react';
3
3
  import { ReactNode, ComponentType, HTMLAttributes, ComponentProps, FormEvent } from 'react';
4
- import { T as ToolUiMetadata, S as SendMessageInput, d as SessionSummary } from '../tool-ui-DSmWuqGe.js';
4
+ import { T as ToolUiMetadata } from '../tool-ui-DIFNGwYd.js';
5
5
  import * as ai from 'ai';
6
6
  import { UIMessage, FileUIPart, ChatStatus } from 'ai';
7
7
  import * as _ai_sdk_react from '@ai-sdk/react';
8
+ import { S as SendMessageInput, e as SessionSummary } from '../harness-DRrTn_5T.js';
8
9
  import { Button, Collapsible, CollapsibleContent, CollapsibleTrigger, InputGroupAddon, InputGroupButton, InputGroupTextarea } from '@hachej/boring-ui-kit';
9
10
  import { Streamdown } from 'streamdown';
10
11
  import { StickToBottom } from 'use-stick-to-bottom';
@@ -22,7 +23,7 @@ interface UploadFileResult {
22
23
  }
23
24
  declare function uploadFile(file: File, opts?: UploadFileOptions): Promise<UploadFileResult>;
24
25
 
25
- type SlashCommandHandler = (args: string, ctx: SlashCommandContext) => string | void;
26
+ type SlashCommandHandler = (args: string, ctx: SlashCommandContext) => string | void | Promise<string | void>;
26
27
  interface SlashCommand {
27
28
  name: string;
28
29
  description: string;
@@ -34,12 +35,19 @@ interface SlashCommandContext {
34
35
  sessionId: string;
35
36
  clearMessages: () => void;
36
37
  resetSession: () => void;
37
- /** Explicit provider-qualified model selection (`provider:id` or `{ provider, id }`). */
38
- setModel: (model: string | {
39
- provider: string;
40
- id: string;
41
- }) => boolean;
42
38
  listCommands: () => SlashCommand[];
39
+ reloadAgentPlugins: () => Promise<string>;
40
+ /**
41
+ * Drives the PluginUpdateStatus banner above the composer. The `/reload`
42
+ * builtin prefers this over the inline-text path: it calls
43
+ * `pluginUpdate.run()` which (1) sets the banner to "running", (2)
44
+ * hits /api/v1/agent/reload, (3) transitions to "success" or "error"
45
+ * with diagnostics. Returns a short string ack for the assistant
46
+ * message bubble.
47
+ */
48
+ pluginUpdate?: {
49
+ run: () => Promise<string>;
50
+ };
43
51
  }
44
52
  interface CommandRegistry {
45
53
  register(cmd: SlashCommand): void;
@@ -161,6 +169,14 @@ interface ChatPanelProps {
161
169
  sessionId: string;
162
170
  toolRenderers?: ToolRendererOverrides;
163
171
  extraCommands?: SlashCommand[];
172
+ /**
173
+ * App-level hot-reload toggle. When `false`, the `/reload` slash
174
+ * command is hidden from the picker and the `/help` listing, and the
175
+ * PluginUpdateStatus banner above the composer never renders.
176
+ * Production apps that don't expose live plugin editing should pass
177
+ * `false`. Defaults to `true`.
178
+ */
179
+ hotReloadEnabled?: boolean;
164
180
  onSessionReset?: () => void | Promise<void>;
165
181
  /**
166
182
  * Render flush, without the outer canvas tint or the inner mx/my rounded