@bivy/bivy 0.4.0-staging.52 → 0.4.0-staging.53

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.
@@ -56,6 +56,21 @@ const FALLBACK_MODELS = [
56
56
  { provider: "anthropic", id: "claude-sonnet-5", name: "Claude Sonnet 5", reasoning: true },
57
57
  { provider: "anthropic", id: "claude-haiku-4-5-20251001", name: "Claude Haiku 4.5", reasoning: true },
58
58
  ];
59
+ /**
60
+ * Appended to the Claude Code system prompt so the agent DISCOVERS the outbound
61
+ * attachment capability. `bivy attach` is just a shell command — without this the
62
+ * agent has no way to know it exists and, when asked to "send a file", concludes
63
+ * it can't (it looks for a tool, finds none). BIVY_SESSION_ID is injected into the
64
+ * subprocess env (see spawnQuery), so the bare command resolves the session. Keep
65
+ * this short: it rides on every turn's system prompt.
66
+ */
67
+ export const BIVY_ATTACH_SYSTEM_PROMPT = "Sending files and images to the user: the person you're talking to is in a chat UI. They cannot see files you only " +
68
+ "write to disk, and the chat cannot load remote image URLs or workspace file paths. " +
69
+ "To show them a file or image — a report, screenshot, chart, or a file they asked for — run " +
70
+ '`bivy attach <path> [--caption "short note"]` in your shell. ' +
71
+ "An image renders inline in the chat; any other file shows as a downloadable chip. The path must be inside the session " +
72
+ "workspace. Do NOT use markdown image syntax like ![](path) to show a local file or a URL — it will not render; always " +
73
+ "use `bivy attach`. Prefer this over pasting large file contents or describing where a file lives on disk.";
59
74
  export function claudeRuntimeFromEnv() {
60
75
  return {
61
76
  defaultModel: process.env.BIVY_CLAUDE_MODEL?.trim() || undefined,
@@ -688,6 +703,10 @@ class ClaudeSession {
688
703
  permissionMode,
689
704
  canUseTool,
690
705
  env,
706
+ // Keep the default Claude Code prompt, appending the note that teaches the
707
+ // agent how to send a file to the user (`bivy attach`) — otherwise the
708
+ // capability is undiscoverable and "send me X as an attachment" fails.
709
+ systemPrompt: { type: "preset", preset: "claude_code", append: BIVY_ATTACH_SYSTEM_PROMPT },
691
710
  };
692
711
  if (resumeId)
693
712
  options.resume = resumeId;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bivy/bivy",
3
- "version": "0.4.0-staging.52",
3
+ "version": "0.4.0-staging.53",
4
4
  "type": "module",
5
5
  "license": "FSL-1.1-ALv2",
6
6
  "description": "Run coding agents on machines you own. Source-available, self-hostable agent workspace.",