@bivy/bivy 0.15.0-staging.32 → 0.15.0-staging.34

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.
@@ -0,0 +1,42 @@
1
+ // SPDX-License-Identifier: AGPL-3.0-only
2
+ // Copyright (c) 2026 Petter André Sjulstad
3
+ import { withExactCapabilitySurface } from "../../runtime/types.js";
4
+ /**
5
+ * The ONE capability table for Pi, shared by the real `PiRuntime` and the
6
+ * `LazyPiRuntime` facade the registry hands out before the SDK is loaded.
7
+ *
8
+ * This module deliberately imports nothing from the pi SDK so the lazy facade
9
+ * can use it without defeating its purpose. Keeping a single source of truth is
10
+ * a correctness requirement, not tidiness: the daemon reads flags such as
11
+ * `sessionRefIsPath` off whichever runtime object the registry returns — the
12
+ * facade — *before* any session is opened. When the facade's copy of this table
13
+ * drifted from the real one and lost `sessionRefIsPath`, the daemon treated every
14
+ * pi resume ref as an opaque id, stripped the transcript path to its basename,
15
+ * and pi created a brand-new empty session for every message sent to a closed
16
+ * chat (the "sending to a closed session creates a new one" regression).
17
+ */
18
+ export const PI_CAPABILITIES = withExactCapabilitySurface({
19
+ toolInterception: true,
20
+ modelSelection: true,
21
+ packages: true,
22
+ resume: true,
23
+ fork: false,
24
+ // pi resumes by session-file path (under the node's sessions dir), so the
25
+ // daemon applies its path-traversal guard to these refs.
26
+ sessionRefIsPath: true,
27
+ // pi's TUI ships with the node, so the chat<->TUI hand-off is always offered.
28
+ interactiveTui: true,
29
+ usageReporting: true,
30
+ // pi can find a prior on-disk session by cwd + start time, so a `bivy run`
31
+ // terminal with no pinned sessionId can still be continued as a governed chat.
32
+ sessionDiscovery: true,
33
+ // pi transcripts are structured messages that round-trip through the session
34
+ // store, so a pi->pi fork is full fidelity (see exportForFork/importForFork).
35
+ forkTransport: true,
36
+ // pi can also stand up a session from portable {role,text} history, so a fork
37
+ // FROM another agent INTO pi is a true replay, not a seeded summary.
38
+ forkHistoryImport: true,
39
+ // The pi-coding-agent SDK implements both explicitly: prompting mid-turn
40
+ // with no streamingBehavior hint throws, forcing every caller to choose.
41
+ streamingBehaviors: ["steer", "followUp"],
42
+ });
@@ -4,19 +4,8 @@ import { spawnSync } from "node:child_process";
4
4
  import os from "node:os";
5
5
  import path from "node:path";
6
6
  import { defineAgentIntegration } from "../definition.js";
7
- import { withExactCapabilitySurface } from "../../runtime/types.js";
7
+ import { PI_CAPABILITIES } from "./capabilities.js";
8
8
  export const PI_TESTED_VERSION = "0.84.3";
9
- const PI_CAPABILITIES = withExactCapabilitySurface({
10
- toolInterception: true,
11
- modelSelection: true,
12
- packages: true,
13
- resume: true,
14
- fork: false,
15
- interactiveTui: true,
16
- usageReporting: true,
17
- sessionDiscovery: true,
18
- streamingBehaviors: ["steer", "followUp"],
19
- });
20
9
  export function piAgentDir() {
21
10
  return process.env.PI_CODING_AGENT_DIR?.trim() || path.join(os.homedir(), ".pi", "agent");
22
11
  }
@@ -15,7 +15,7 @@ import { toModelInfo as sharedToModelInfo } from "../../runtime/normalize.js";
15
15
  import { provisionPiAuthJson } from "../../runtime/credential-provisioning.js";
16
16
  import { isNativeOAuthProvider } from "../../runtime/oauth/model-oauth-providers.js";
17
17
  import { bivySessionEnv } from "../../runtime/session-env.js";
18
- import { withExactCapabilitySurface } from "../../runtime/types.js";
18
+ import { PI_CAPABILITIES } from "./capabilities.js";
19
19
  import { mapToolCall, mapToolResult } from "../../runtime/tool-call-map.js";
20
20
  import { BackgroundShellTracker, createBackgroundAwareBashOperations } from "./background-shell.js";
21
21
  /**
@@ -406,28 +406,9 @@ export class PiRuntime {
406
406
  options;
407
407
  id = "pi";
408
408
  displayName = "Pi";
409
- capabilities = withExactCapabilitySurface({
410
- toolInterception: true,
411
- modelSelection: true,
412
- packages: true,
413
- resume: true,
414
- fork: false,
415
- // pi resumes by session-file path (under the node's sessions dir), so the
416
- // daemon applies its path-traversal guard to these refs.
417
- sessionRefIsPath: true,
418
- // pi's TUI ships with the node, so the chat<->TUI hand-off is always offered.
419
- interactiveTui: true,
420
- usageReporting: true,
421
- // pi transcripts are structured messages that round-trip through the session
422
- // store, so a pi->pi fork is full fidelity (see exportForFork/importForFork).
423
- forkTransport: true,
424
- // pi can also stand up a session from portable {role,text} history, so a fork
425
- // FROM another agent INTO pi is a true replay, not a seeded summary.
426
- forkHistoryImport: true,
427
- // The pi-coding-agent SDK implements both explicitly: prompting mid-turn
428
- // with no streamingBehavior hint throws, forcing every caller to choose.
429
- streamingBehaviors: ["steer", "followUp"],
430
- });
409
+ // Shared with LazyPiRuntime (the facade the registry actually hands out) —
410
+ // see capabilities.ts for why the two must never drift.
411
+ capabilities = PI_CAPABILITIES;
431
412
  constructor(options) {
432
413
  this.options = options;
433
414
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bivy/bivy",
3
- "version": "0.15.0-staging.32",
3
+ "version": "0.15.0-staging.34",
4
4
  "type": "module",
5
5
  "license": "AGPL-3.0-only",
6
6
  "description": "Run coding agents on machines you own. Open-source, self-hostable agent workspace.",