@hachej/boring-agent 0.1.74 → 0.1.76
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.
- package/dist/{chunk-AQVEZYLH.js → chunk-FRFCVP3X.js} +52 -13
- package/dist/{chunk-XZKU7FBV.js → chunk-M4AY4VBI.js} +1 -0
- package/dist/{chunk-FDGWCMJD.js → chunk-OABGJVSA.js} +3 -2
- package/dist/{chunk-4LXA7OOV.js → chunk-PMREGRGD.js} +1 -1
- package/dist/{chunk-WSQ5QNIY.js → chunk-ZUEITFIJ.js} +12 -1
- package/dist/core/index.d.ts +3 -3
- package/dist/core/index.js +8 -4
- package/dist/{createHarness-B3MYGFVB.js → createHarness-HQ3RHXTF.js} +2 -2
- package/dist/front/index.d.ts +2 -2
- package/dist/front/index.js +2 -2
- package/dist/{harness-Dwxh6USt.d.ts → harness-BrX6CdMT.d.ts} +10 -2
- package/dist/{piChatCommand-CSepU1NX.d.ts → piChatCommand-5UO2F_gv.d.ts} +1 -1
- package/dist/server/index.d.ts +5 -3
- package/dist/server/index.js +556 -279
- package/dist/{session-DKMQNtNG.d.ts → session-DTV7L5dc.d.ts} +13 -13
- package/dist/shared/index.d.ts +23 -23
- package/dist/shared/index.js +7 -3
- package/docs/ERROR_CODES.md +1 -0
- package/docs/runtime.md +12 -0
- package/package.json +2 -2
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
|
+
AgentFilesystemRequiredError,
|
|
2
3
|
AgentNotImplementedError,
|
|
3
4
|
sessionStreamPath
|
|
4
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-ZUEITFIJ.js";
|
|
5
6
|
import {
|
|
6
7
|
extractToolUiMetadata,
|
|
7
8
|
sanitizeToolUiMetadata2 as sanitizeToolUiMetadata
|
|
8
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-PMREGRGD.js";
|
|
9
10
|
import {
|
|
10
11
|
createLogger
|
|
11
12
|
} from "./chunk-AJZHR626.js";
|
|
12
13
|
import {
|
|
13
14
|
ErrorCode
|
|
14
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-M4AY4VBI.js";
|
|
15
16
|
|
|
16
17
|
// src/server/pi-chat/metering.ts
|
|
17
18
|
var meteringLogger = createLogger("pi-chat-metering");
|
|
@@ -1627,6 +1628,7 @@ var HarnessPiChatService = class {
|
|
|
1627
1628
|
workdir;
|
|
1628
1629
|
workspace;
|
|
1629
1630
|
eventStore;
|
|
1631
|
+
allowAttachments;
|
|
1630
1632
|
channels = /* @__PURE__ */ new Map();
|
|
1631
1633
|
// Single-flight guard so concurrent cold callers (e.g. two browser tabs each
|
|
1632
1634
|
// opening /events while the session is still being created) converge on one
|
|
@@ -1644,6 +1646,7 @@ var HarnessPiChatService = class {
|
|
|
1644
1646
|
this.workdir = options.workdir;
|
|
1645
1647
|
this.workspace = options.workspace;
|
|
1646
1648
|
this.eventStore = options.eventStore;
|
|
1649
|
+
this.allowAttachments = options.allowAttachments !== false;
|
|
1647
1650
|
this.metering = options.metering ? new PiChatMeteringCoordinator(options.metering, options.meteringLogger) : void 0;
|
|
1648
1651
|
}
|
|
1649
1652
|
/** Test/diagnostic hook: resolves once queued metering sink calls settle. */
|
|
@@ -1722,6 +1725,7 @@ var HarnessPiChatService = class {
|
|
|
1722
1725
|
return { type: "ok", unsubscribe: result.unsubscribe, closed: channel.closed };
|
|
1723
1726
|
}
|
|
1724
1727
|
async prompt(ctx, sessionId, payload) {
|
|
1728
|
+
this.assertAttachmentsAllowed(payload);
|
|
1725
1729
|
const sessionKey = this.sessionKey(ctx, sessionId);
|
|
1726
1730
|
const adapter = await this.getAdapter(ctx, sessionId, payload);
|
|
1727
1731
|
const channel = await this.ensureChannel(ctx, sessionId, adapter);
|
|
@@ -1762,6 +1766,10 @@ var HarnessPiChatService = class {
|
|
|
1762
1766
|
}
|
|
1763
1767
|
return { accepted: true, cursor: receiptCursor, clientNonce: payload.clientNonce };
|
|
1764
1768
|
}
|
|
1769
|
+
assertAttachmentsAllowed(payload) {
|
|
1770
|
+
if (this.allowAttachments || !payload.attachments || payload.attachments.length === 0) return;
|
|
1771
|
+
throw new AgentFilesystemRequiredError();
|
|
1772
|
+
}
|
|
1765
1773
|
async followUp(ctx, sessionId, payload) {
|
|
1766
1774
|
const sessionKey = this.sessionKey(ctx, sessionId);
|
|
1767
1775
|
const adapter = await this.getAdapter(ctx, sessionId, payload.message);
|
|
@@ -2160,13 +2168,13 @@ function promptCancelledError() {
|
|
|
2160
2168
|
});
|
|
2161
2169
|
}
|
|
2162
2170
|
function deferred() {
|
|
2163
|
-
let
|
|
2171
|
+
let resolve2;
|
|
2164
2172
|
let reject;
|
|
2165
2173
|
const promise = new Promise((nextResolve, nextReject) => {
|
|
2166
|
-
|
|
2174
|
+
resolve2 = nextResolve;
|
|
2167
2175
|
reject = nextReject;
|
|
2168
2176
|
});
|
|
2169
|
-
return { promise, resolve, reject };
|
|
2177
|
+
return { promise, resolve: resolve2, reject };
|
|
2170
2178
|
}
|
|
2171
2179
|
function normalizeSessionAccessError(error, sessionId) {
|
|
2172
2180
|
if (error?.code === ErrorCode.enum.SESSION_NOT_FOUND || isPlainSessionNotFound(error, sessionId)) {
|
|
@@ -2307,6 +2315,29 @@ function sessionCacheKey(sessionId, ctx) {
|
|
|
2307
2315
|
return JSON.stringify([sessionId, ctx.workspaceId ?? "", ctx.userId ?? ""]);
|
|
2308
2316
|
}
|
|
2309
2317
|
|
|
2318
|
+
// src/server/runtime/pureRuntime.ts
|
|
2319
|
+
import { chmod, mkdir, mkdtemp } from "fs/promises";
|
|
2320
|
+
import { tmpdir } from "os";
|
|
2321
|
+
import { join, resolve } from "path";
|
|
2322
|
+
var PURE_RUNTIME_CWD_NAME = ".runtime-none";
|
|
2323
|
+
var defaultPureRuntimeCwd;
|
|
2324
|
+
async function createPureRuntimeCwd(sessionRoot) {
|
|
2325
|
+
const explicitRoot = sessionRoot?.trim();
|
|
2326
|
+
if (!explicitRoot) {
|
|
2327
|
+
defaultPureRuntimeCwd ??= createDefaultPureRuntimeCwd();
|
|
2328
|
+
return defaultPureRuntimeCwd;
|
|
2329
|
+
}
|
|
2330
|
+
const cwd = join(resolve(explicitRoot), PURE_RUNTIME_CWD_NAME);
|
|
2331
|
+
await mkdir(cwd, { recursive: true, mode: 448 });
|
|
2332
|
+
await chmod(cwd, 448);
|
|
2333
|
+
return cwd;
|
|
2334
|
+
}
|
|
2335
|
+
async function createDefaultPureRuntimeCwd() {
|
|
2336
|
+
const cwd = await mkdtemp(join(tmpdir(), "boring-agent-pure-"));
|
|
2337
|
+
await chmod(cwd, 448);
|
|
2338
|
+
return cwd;
|
|
2339
|
+
}
|
|
2340
|
+
|
|
2310
2341
|
// src/server/createAgent.ts
|
|
2311
2342
|
var DEFAULT_WORKDIR = "";
|
|
2312
2343
|
var DEFAULT_LIVE_BUFFER_SIZE = 1e3;
|
|
@@ -2363,6 +2394,7 @@ function createAgentRuntimeBridge(config, options = {}) {
|
|
|
2363
2394
|
}
|
|
2364
2395
|
}
|
|
2365
2396
|
async function start(input) {
|
|
2397
|
+
assertFilesystemAttachmentsAllowed(config, input);
|
|
2366
2398
|
const runtime = await getRuntime();
|
|
2367
2399
|
const { sessionId, sessionKey, ctx } = await ensureSession(input, runtime);
|
|
2368
2400
|
startedSessions.set(sessionKey, { sessionId, ctx });
|
|
@@ -2453,11 +2485,13 @@ function createRuntimeLoader(config, options) {
|
|
|
2453
2485
|
};
|
|
2454
2486
|
}
|
|
2455
2487
|
async function createRuntime(config, options) {
|
|
2456
|
-
const harnessFactory = config.harnessFactory ?? (await import("./createHarness-
|
|
2488
|
+
const harnessFactory = config.harnessFactory ?? (await import("./createHarness-HQ3RHXTF.js")).createPiCodingAgentHarness;
|
|
2489
|
+
const pureRuntimeCwd = config.runtime === "none" ? await createPureRuntimeCwd(config.sessionStorageRoot) : void 0;
|
|
2457
2490
|
const harnessInput = {
|
|
2458
2491
|
tools: config.tools ?? [],
|
|
2459
|
-
cwd: config.workdir ?? DEFAULT_WORKDIR,
|
|
2460
|
-
runtimeCwd: options.harness?.runtimeCwd ?? options.service?.workdir ?? config.workdir,
|
|
2492
|
+
cwd: pureRuntimeCwd ?? config.workdir ?? DEFAULT_WORKDIR,
|
|
2493
|
+
runtimeCwd: pureRuntimeCwd ?? options.harness?.runtimeCwd ?? options.service?.workdir ?? config.workdir,
|
|
2494
|
+
sessionStorageCwd: pureRuntimeCwd ? DEFAULT_WORKDIR : void 0,
|
|
2461
2495
|
systemPromptAppend: config.systemPromptAppend,
|
|
2462
2496
|
systemPromptDynamic: config.systemPromptDynamic,
|
|
2463
2497
|
sessionRoot: config.sessionStorageRoot,
|
|
@@ -2471,13 +2505,18 @@ async function createRuntime(config, options) {
|
|
|
2471
2505
|
service: new HarnessPiChatService({
|
|
2472
2506
|
harness,
|
|
2473
2507
|
sessionStore,
|
|
2474
|
-
workdir: options.service?.workdir ?? config.workdir ?? DEFAULT_WORKDIR,
|
|
2508
|
+
workdir: pureRuntimeCwd ?? options.service?.workdir ?? config.workdir ?? DEFAULT_WORKDIR,
|
|
2475
2509
|
workspace: options.service?.workspace,
|
|
2476
2510
|
eventStore: options.service?.eventStore,
|
|
2511
|
+
allowAttachments: config.runtime !== "none",
|
|
2477
2512
|
metering: config.metering
|
|
2478
2513
|
})
|
|
2479
2514
|
};
|
|
2480
2515
|
}
|
|
2516
|
+
function assertFilesystemAttachmentsAllowed(config, input) {
|
|
2517
|
+
if (config.runtime !== "none" || !input.attachments || input.attachments.length === 0) return;
|
|
2518
|
+
throw new AgentFilesystemRequiredError();
|
|
2519
|
+
}
|
|
2481
2520
|
function createReadiness(config) {
|
|
2482
2521
|
const requirements = [...config.readinessRequirements ?? []];
|
|
2483
2522
|
return {
|
|
@@ -2602,8 +2641,8 @@ async function acquireSessionLock(locks, sessionId) {
|
|
|
2602
2641
|
const previous = locks.get(sessionId) ?? Promise.resolve();
|
|
2603
2642
|
let release;
|
|
2604
2643
|
const current = previous.catch(() => {
|
|
2605
|
-
}).then(() => new Promise((
|
|
2606
|
-
release =
|
|
2644
|
+
}).then(() => new Promise((resolve2) => {
|
|
2645
|
+
release = resolve2;
|
|
2607
2646
|
}));
|
|
2608
2647
|
locks.set(sessionId, current);
|
|
2609
2648
|
await previous.catch(() => {
|
|
@@ -2735,7 +2774,7 @@ function createLiveIterator(state, startIndex) {
|
|
|
2735
2774
|
async next() {
|
|
2736
2775
|
if (queued.length > 0) return { value: queued.shift(), done: false };
|
|
2737
2776
|
if (!active || state.closed) return { value: void 0, done: true };
|
|
2738
|
-
return new Promise((
|
|
2777
|
+
return new Promise((resolve2) => waiters.push(resolve2));
|
|
2739
2778
|
},
|
|
2740
2779
|
async return() {
|
|
2741
2780
|
active = false;
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
} from "./chunk-AJZHR626.js";
|
|
8
8
|
import {
|
|
9
9
|
ErrorCode
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-M4AY4VBI.js";
|
|
11
11
|
|
|
12
12
|
// src/server/harness/pi-coding-agent/createHarness.ts
|
|
13
13
|
import { AsyncLocalStorage } from "async_hooks";
|
|
@@ -341,6 +341,7 @@ function sessionBaseDir(explicitRoot) {
|
|
|
341
341
|
return configured ? resolve(configured) : join(homedir(), ".pi", "agent", "sessions");
|
|
342
342
|
}
|
|
343
343
|
function defaultSessionDir(cwd, explicitRoot) {
|
|
344
|
+
if (explicitRoot && cwd.trim().length === 0) return sessionBaseDir(explicitRoot);
|
|
344
345
|
const safePath = `--${cwd.replace(/^[/\\]/, "").replace(/[/\\:]/g, "-")}--`;
|
|
345
346
|
return join(sessionBaseDir(explicitRoot), safePath);
|
|
346
347
|
}
|
|
@@ -1505,7 +1506,7 @@ function createPiCodingAgentHarness(opts) {
|
|
|
1505
1506
|
sessionNamespace: opts.sessionNamespace,
|
|
1506
1507
|
sessionRoot: opts.sessionRoot,
|
|
1507
1508
|
sessionDir: opts.sessionDir,
|
|
1508
|
-
storageCwd: opts.cwd
|
|
1509
|
+
storageCwd: opts.sessionStorageCwd ?? opts.cwd
|
|
1509
1510
|
});
|
|
1510
1511
|
const piSessions = /* @__PURE__ */ new Map();
|
|
1511
1512
|
const runContextStorage = new AsyncLocalStorage();
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// src/shared/events.ts
|
|
2
2
|
var AGENT_NOT_IMPLEMENTED_UNTIL_T1 = "ERR_NOT_IMPLEMENTED_UNTIL_T1";
|
|
3
|
+
var AGENT_NO_FILESYSTEM_FOR_ATTACHMENTS = "ERR_NO_FILESYSTEM_FOR_ATTACHMENTS";
|
|
3
4
|
function sessionStreamPath(sessionId) {
|
|
4
5
|
return `sessions/${sessionId}`;
|
|
5
6
|
}
|
|
@@ -10,9 +11,19 @@ var AgentNotImplementedError = class extends Error {
|
|
|
10
11
|
this.name = "AgentNotImplementedError";
|
|
11
12
|
}
|
|
12
13
|
};
|
|
14
|
+
var AgentFilesystemRequiredError = class extends Error {
|
|
15
|
+
code = AGENT_NO_FILESYSTEM_FOR_ATTACHMENTS;
|
|
16
|
+
statusCode = 400;
|
|
17
|
+
constructor(message = "Attachments require a filesystem-backed agent runtime.") {
|
|
18
|
+
super(message);
|
|
19
|
+
this.name = "AgentFilesystemRequiredError";
|
|
20
|
+
}
|
|
21
|
+
};
|
|
13
22
|
|
|
14
23
|
export {
|
|
15
24
|
AGENT_NOT_IMPLEMENTED_UNTIL_T1,
|
|
25
|
+
AGENT_NO_FILESYSTEM_FOR_ATTACHMENTS,
|
|
16
26
|
sessionStreamPath,
|
|
17
|
-
AgentNotImplementedError
|
|
27
|
+
AgentNotImplementedError,
|
|
28
|
+
AgentFilesystemRequiredError
|
|
18
29
|
};
|
package/dist/core/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { a as AGENT_NOT_IMPLEMENTED_UNTIL_T1,
|
|
3
|
-
import '../session-
|
|
1
|
+
import { w as AgentConfig, c as Agent } from '../harness-BrX6CdMT.js';
|
|
2
|
+
export { a as AGENT_NOT_IMPLEMENTED_UNTIL_T1, b as AGENT_NO_FILESYSTEM_FOR_ATTACHMENTS, d as AgentActor, e as AgentCoreHarness, f as AgentCoreHarnessFactory, g as AgentCorePromptInput, h as AgentCoreSessionAdapter, i as AgentCoreSessionSnapshot, j as AgentEvent, k as AgentFilesystemRequiredError, m as AgentMessageContent, n as AgentMessagePart, o as AgentNotImplementedError, p as AgentReadiness, q as AgentReadinessStatus, r as AgentResolveInputResponse, s as AgentRuntimeAdapter, t as AgentSendInput, u as AgentStartReceipt, v as AgentStreamOptions } from '../harness-BrX6CdMT.js';
|
|
3
|
+
import '../session-DTV7L5dc.js';
|
|
4
4
|
import 'zod';
|
|
5
5
|
import '@mariozechner/pi-coding-agent';
|
|
6
6
|
|
package/dist/core/index.js
CHANGED
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createAgent
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-FRFCVP3X.js";
|
|
4
4
|
import {
|
|
5
5
|
AGENT_NOT_IMPLEMENTED_UNTIL_T1,
|
|
6
|
+
AGENT_NO_FILESYSTEM_FOR_ATTACHMENTS,
|
|
7
|
+
AgentFilesystemRequiredError,
|
|
6
8
|
AgentNotImplementedError
|
|
7
|
-
} from "../chunk-
|
|
8
|
-
import "../chunk-
|
|
9
|
+
} from "../chunk-ZUEITFIJ.js";
|
|
10
|
+
import "../chunk-PMREGRGD.js";
|
|
9
11
|
import "../chunk-AJZHR626.js";
|
|
10
|
-
import "../chunk-
|
|
12
|
+
import "../chunk-M4AY4VBI.js";
|
|
11
13
|
export {
|
|
12
14
|
AGENT_NOT_IMPLEMENTED_UNTIL_T1,
|
|
15
|
+
AGENT_NO_FILESYSTEM_FOR_ATTACHMENTS,
|
|
16
|
+
AgentFilesystemRequiredError,
|
|
13
17
|
AgentNotImplementedError,
|
|
14
18
|
createAgent
|
|
15
19
|
};
|
|
@@ -4,10 +4,10 @@ import {
|
|
|
4
4
|
deriveSourcePlugin,
|
|
5
5
|
mergePiPackageSources,
|
|
6
6
|
withPiHarnessDefaults
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-OABGJVSA.js";
|
|
8
8
|
import "./chunk-AQBXNPMD.js";
|
|
9
9
|
import "./chunk-AJZHR626.js";
|
|
10
|
-
import "./chunk-
|
|
10
|
+
import "./chunk-M4AY4VBI.js";
|
|
11
11
|
export {
|
|
12
12
|
createPiCodingAgentHarness,
|
|
13
13
|
createResourceSettingsManager,
|
package/dist/front/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { ComponentProps, HTMLAttributes, FormEvent, ReactNode, ComponentType } from 'react';
|
|
3
3
|
import { FileUIPart, ChatStatus, UIMessage } from 'ai';
|
|
4
|
-
import { T as ToolUiMetadata, B as BoringChatPart, e as BoringChatMessage, k as PiChatStatus, Q as QueuedUserMessage, C as ChatError, P as PiChatEvent, n as SessionSummary } from '../session-
|
|
5
|
-
import { P as PromptPayload, c as PromptReceipt, F as FollowUpPayload, a as FollowUpReceipt, Q as QueueClearPayload, d as QueueClearReceipt, I as InterruptPayload, C as CommandReceipt, S as StopPayload, e as StopReceipt } from '../piChatCommand-
|
|
4
|
+
import { T as ToolUiMetadata, B as BoringChatPart, e as BoringChatMessage, k as PiChatStatus, Q as QueuedUserMessage, C as ChatError, P as PiChatEvent, n as SessionSummary } from '../session-DTV7L5dc.js';
|
|
5
|
+
import { P as PromptPayload, c as PromptReceipt, F as FollowUpPayload, a as FollowUpReceipt, Q as QueueClearPayload, d as QueueClearReceipt, I as InterruptPayload, C as CommandReceipt, S as StopPayload, e as StopReceipt } from '../piChatCommand-5UO2F_gv.js';
|
|
6
6
|
import { InputGroupAddon, InputGroupButton, InputGroupTextarea, Button, Collapsible, CollapsibleContent, CollapsibleTrigger } from '@hachej/boring-ui-kit';
|
|
7
7
|
import { Streamdown } from 'streamdown';
|
|
8
8
|
import { StickToBottom } from 'use-stick-to-bottom';
|
package/dist/front/index.js
CHANGED
|
@@ -12,10 +12,10 @@ import {
|
|
|
12
12
|
StopReceiptSchema,
|
|
13
13
|
extractToolUiMetadata,
|
|
14
14
|
sanitizeToolUiMetadata
|
|
15
|
-
} from "../chunk-
|
|
15
|
+
} from "../chunk-PMREGRGD.js";
|
|
16
16
|
import {
|
|
17
17
|
ErrorCode
|
|
18
|
-
} from "../chunk-
|
|
18
|
+
} from "../chunk-M4AY4VBI.js";
|
|
19
19
|
import {
|
|
20
20
|
DebugDrawer,
|
|
21
21
|
cn,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { S as SessionCtx, P as PiChatEvent, a as SessionStore } from './session-
|
|
1
|
+
import { S as SessionCtx, P as PiChatEvent, a as SessionStore } from './session-DTV7L5dc.js';
|
|
2
2
|
import { AgentSessionEvent, PromptOptions } from '@mariozechner/pi-coding-agent';
|
|
3
3
|
|
|
4
4
|
interface TelemetrySink {
|
|
@@ -47,6 +47,7 @@ interface ToolResult {
|
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
declare const AGENT_NOT_IMPLEMENTED_UNTIL_T1: "ERR_NOT_IMPLEMENTED_UNTIL_T1";
|
|
50
|
+
declare const AGENT_NO_FILESYSTEM_FOR_ATTACHMENTS: "ERR_NO_FILESYSTEM_FOR_ATTACHMENTS";
|
|
50
51
|
interface MessageAttachment {
|
|
51
52
|
filename?: string;
|
|
52
53
|
mediaType?: string;
|
|
@@ -140,6 +141,11 @@ declare class AgentNotImplementedError extends Error {
|
|
|
140
141
|
readonly code: "ERR_NOT_IMPLEMENTED_UNTIL_T1";
|
|
141
142
|
constructor(message?: string);
|
|
142
143
|
}
|
|
144
|
+
declare class AgentFilesystemRequiredError extends Error {
|
|
145
|
+
readonly code: "ERR_NO_FILESYSTEM_FOR_ATTACHMENTS";
|
|
146
|
+
readonly statusCode = 400;
|
|
147
|
+
constructor(message?: string);
|
|
148
|
+
}
|
|
143
149
|
|
|
144
150
|
interface AgentHarnessFactoryInput {
|
|
145
151
|
tools: AgentTool[];
|
|
@@ -147,6 +153,8 @@ interface AgentHarnessFactoryInput {
|
|
|
147
153
|
cwd: string;
|
|
148
154
|
/** Agent-visible cwd used by Pi/system prompt/session metadata. */
|
|
149
155
|
runtimeCwd?: string;
|
|
156
|
+
/** Optional cwd used only to derive the default transcript storage directory. */
|
|
157
|
+
sessionStorageCwd?: string;
|
|
150
158
|
systemPromptAppend?: string;
|
|
151
159
|
sessionNamespace?: string;
|
|
152
160
|
sessionRoot?: string;
|
|
@@ -262,4 +270,4 @@ interface RunContext {
|
|
|
262
270
|
allowPromptDispatch?: boolean;
|
|
263
271
|
}
|
|
264
272
|
|
|
265
|
-
export { type AgentTool as A,
|
|
273
|
+
export { type AgentTool as A, noopTelemetry as B, safeCapture as C, sessionStreamPath as D, type ToolReadinessRequirement as E, type AgentHarnessFactory as F, type AgentHarnessFactoryInput as G, type JSONSchema as J, type MessageAttachment as M, type RunContext as R, type SendMessageInput as S, type TelemetryEvent as T, AGENT_NOT_IMPLEMENTED_UNTIL_T1 as a, AGENT_NO_FILESYSTEM_FOR_ATTACHMENTS as b, type Agent as c, type AgentActor as d, type AgentCoreHarness as e, type AgentCoreHarnessFactory as f, type AgentCorePromptInput as g, type AgentCoreSessionAdapter as h, type AgentCoreSessionSnapshot as i, type AgentEvent as j, AgentFilesystemRequiredError as k, type AgentHarness as l, type AgentMessageContent as m, type AgentMessagePart as n, AgentNotImplementedError as o, type AgentReadiness as p, type AgentReadinessStatus as q, type AgentResolveInputResponse as r, type AgentRuntimeAdapter as s, type AgentSendInput as t, type AgentStartReceipt as u, type AgentStreamOptions as v, type AgentConfig as w, type TelemetrySink as x, type ToolExecContext as y, type ToolResult as z };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { C as ChatSubmitPayload } from './chatSubmitPayload-DwOHyiqR.js';
|
|
2
|
-
import { Q as QueuedUserMessage } from './session-
|
|
2
|
+
import { Q as QueuedUserMessage } from './session-DTV7L5dc.js';
|
|
3
3
|
|
|
4
4
|
type PromptPayload = ChatSubmitPayload;
|
|
5
5
|
interface FollowUpPayload {
|
package/dist/server/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { j as WorkspaceRuntimeContext, S as Sandbox, f as SandboxHandleStore, e as SandboxHandleRecord, W as Workspace, F as FileSearch, g as Stat, E as Entry, b as ExecResult, k as WorkspaceChangeEvent, a as ExecOptions, P as PluginRestartWarning } from '../agentPluginEvents-CqLTEdG2.js';
|
|
2
2
|
import { Sandbox as Sandbox$1 } from '@vercel/sandbox';
|
|
3
|
-
import {
|
|
4
|
-
export {
|
|
3
|
+
import { x as TelemetrySink, E as ToolReadinessRequirement, j as AgentEvent, c as Agent, d as AgentActor, A as AgentTool, F as AgentHarnessFactory } from '../harness-BrX6CdMT.js';
|
|
4
|
+
export { w as AgentConfig, G as AgentHarnessFactoryInput } from '../harness-BrX6CdMT.js';
|
|
5
5
|
import { FastifyInstance, FastifyRequest, FastifyPluginAsync } from 'fastify';
|
|
6
6
|
export { createAgent } from '../core/index.js';
|
|
7
|
-
import { S as SessionCtx, f as ErrorCode } from '../session-
|
|
7
|
+
import { S as SessionCtx, f as ErrorCode } from '../session-DTV7L5dc.js';
|
|
8
8
|
import { IncomingMessage, ServerResponse } from 'node:http';
|
|
9
9
|
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
10
10
|
import { PackageSource, ExtensionFactory, SettingsManager } from '@mariozechner/pi-coding-agent';
|
|
@@ -1138,6 +1138,8 @@ interface CreateAgentAppOptions {
|
|
|
1138
1138
|
}) => Promise<void>;
|
|
1139
1139
|
/** Optional explicit file-backed session directory. Mostly for tests/hosts. */
|
|
1140
1140
|
sessionDir?: string;
|
|
1141
|
+
/** Optional explicit root for file-backed session directories. */
|
|
1142
|
+
sessionRoot?: string;
|
|
1141
1143
|
/**
|
|
1142
1144
|
* Enable user/global Pi extension auto-discovery from .pi/ and ~/.pi.
|
|
1143
1145
|
* App/internal plugins should be passed through extraTools/pi instead.
|