@hachej/boring-agent 0.1.5 → 0.1.7

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.
@@ -43,6 +43,25 @@ interface AgentHarness {
43
43
  * `sendMessage`). Optional so non-pi harnesses can opt out cleanly.
44
44
  */
45
45
  getSystemPrompt?: (sessionId: string) => string | undefined;
46
+ /**
47
+ * Queue a follow-up message for delivery after the current streaming turn.
48
+ * When called while a `sendMessage` stream is active, the harness keeps
49
+ * the HTTP stream open after `agent_end` and processes the follow-up as a
50
+ * second turn in the same response — no extra round-trip needed.
51
+ * A `data-followup-consumed` chunk is emitted before the follow-up turn so
52
+ * the client can clear its pending-message bubble immediately.
53
+ */
54
+ followUp?(sessionId: string, text: string, attachments?: MessageAttachment[]): void;
55
+ /**
56
+ * Discard any queued follow-up for this session (called by the Stop button).
57
+ */
58
+ clearFollowUp?(sessionId: string): void;
59
+ }
60
+ interface MessageAttachment {
61
+ filename?: string;
62
+ mediaType?: string;
63
+ /** data: URL (base64) or remote URL */
64
+ url: string;
46
65
  }
47
66
  interface SendMessageInput {
48
67
  sessionId: string;
@@ -52,6 +71,7 @@ interface SendMessageInput {
52
71
  provider: string;
53
72
  id: string;
54
73
  };
74
+ attachments?: MessageAttachment[];
55
75
  }
56
76
  interface RunContext {
57
77
  abortSignal: AbortSignal;
@@ -1,7 +1,14 @@
1
1
  interface Workspace {
2
2
  readonly root: string;
3
3
  readFile(relPath: string): Promise<string>;
4
+ /** Optional binary read operation for media/document previews. */
5
+ readBinaryFile?(relPath: string): Promise<Uint8Array>;
4
6
  writeFile(relPath: string, data: string): Promise<void>;
7
+ /**
8
+ * Optional binary write operation for user-uploaded assets. Shared callers use
9
+ * Uint8Array so browser-safe workspace contracts do not depend on Node-only types.
10
+ */
11
+ writeBinaryFile?(relPath: string, data: Uint8Array): Promise<void>;
5
12
  /**
6
13
  * Optional optimized read+metadata operation. Remote workspaces should
7
14
  * implement this as one round trip when possible.
@@ -15,6 +22,8 @@ interface Workspace {
15
22
  * implement this as one round trip when possible.
16
23
  */
17
24
  writeFileWithStat?(relPath: string, data: string): Promise<Stat>;
25
+ /** Optional optimized binary write+metadata operation. */
26
+ writeBinaryFileWithStat?(relPath: string, data: Uint8Array): Promise<Stat>;
18
27
  unlink(relPath: string): Promise<void>;
19
28
  readdir(relPath: string): Promise<Entry[]>;
20
29
  stat(relPath: string): Promise<Stat>;
@@ -1,4 +1,4 @@
1
- import { S as Sandbox, f as SandboxHandleStore, e as SandboxHandleRecord, W as Workspace, F as FileSearch, A as AgentTool } from '../sandbox-handle-store-OPdvRwie.js';
1
+ import { S as Sandbox, f as SandboxHandleStore, e as SandboxHandleRecord, W as Workspace, F as FileSearch, A as AgentTool } from '../sandbox-handle-store-DCNEJJ6b.js';
2
2
  import { Sandbox as Sandbox$1 } from '@vercel/sandbox';
3
3
  import { FastifyInstance, FastifyRequest, FastifyPluginAsync } from 'fastify';
4
4
  import { PackageSource } from '@mariozechner/pi-coding-agent';
@@ -289,6 +289,11 @@ interface RegisterAgentRoutesOptions {
289
289
  workspaceRoot?: string;
290
290
  sessionId?: string;
291
291
  templatePath?: string;
292
+ getTemplatePath?: (ctx: {
293
+ workspaceId: string;
294
+ workspaceRoot: string;
295
+ request?: FastifyRequest;
296
+ }) => string | undefined | Promise<string | undefined>;
292
297
  mode?: RuntimeModeId;
293
298
  version?: string;
294
299
  extraTools?: AgentTool[];