flowviant 0.6.0 → 0.6.1

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.
@@ -127,7 +127,13 @@ export function runTurn({ prompt, resume, system, cwd, mcpConfig, label, onSpawn
127
127
  const args = [];
128
128
  if (resume) args.push('--continue');
129
129
  args.push('-p', prompt, '--mcp-config', mcpConfig, '--append-system-prompt', system, ...PERM);
130
- const child = spawn('claude', args, { cwd, stdio: ['ignore', 'pipe', 'pipe'] });
130
+ // Force the user's Claude Code subscription never the API. A key exported in
131
+ // the shell would otherwise silently bill every poll-mode turn as raw API
132
+ // usage (same invariant live mode enforces on its SDK session env).
133
+ const env = { ...process.env };
134
+ delete env.ANTHROPIC_API_KEY;
135
+ delete env.ANTHROPIC_AUTH_TOKEN;
136
+ const child = spawn('claude', args, { cwd, env, stdio: ['ignore', 'pipe', 'pipe'] });
131
137
  onSpawn?.(child);
132
138
  let out = '';
133
139
  const pfx = label ? `${label} ` : '';
@@ -4,7 +4,7 @@ import { readFileSync } from 'node:fs';
4
4
  import { join } from 'node:path';
5
5
  import { homedir } from 'node:os';
6
6
 
7
- export const VERSION = '0.6.0';
7
+ export const VERSION = '0.6.1';
8
8
 
9
9
  // Credential stored by `flowviant login` (device auth) — the no-token,
10
10
  // no-env-var path. An explicit --fleet flag or FLOWVIANT_FLEET env still wins.
package/bin/lib/live.mjs CHANGED
@@ -51,7 +51,21 @@ async function registerLiveTarget(intentId, kind, url) {
51
51
  }
52
52
  }
53
53
 
54
- const SAFE_TOOLS = ['Edit', 'Write', 'Read', 'Grep', 'Glob', 'Bash', 'mcp__flowviant'];
54
+ // Safe mode's curated toolset. Bash is scoped to the specific CLIs the agent
55
+ // needs (git/gh/npm/bun) — NOT bare `Bash`, which would auto-approve arbitrary
56
+ // shell (rm -rf, curl|sh, reading ~/.ssh) and defeat the point of safe mode.
57
+ const SAFE_TOOLS = [
58
+ 'Edit',
59
+ 'Write',
60
+ 'Read',
61
+ 'Grep',
62
+ 'Glob',
63
+ 'Bash(git:*)',
64
+ 'Bash(gh:*)',
65
+ 'Bash(npm:*)',
66
+ 'Bash(bun:*)',
67
+ 'mcp__flowviant',
68
+ ];
55
69
 
56
70
  // Appended to Claude Code's preset. The reliable copy of the contract also
57
71
  // rides in the seed message below, so this degrades gracefully if the preset
@@ -99,6 +113,9 @@ async function mcpCall(mcpUrl, token, name, args) {
99
113
  Authorization: `Bearer ${token}`,
100
114
  'Content-Type': 'application/json',
101
115
  Accept: 'application/json',
116
+ // Required: Node's default UA trips Cloudflare Bot Fight Mode (403) —
117
+ // without this every live MCP call fails against api.flowviant.com.
118
+ 'User-Agent': USER_AGENT,
102
119
  },
103
120
  body: JSON.stringify({
104
121
  jsonrpc: '2.0',
@@ -241,7 +258,11 @@ export async function runLiveTask({ mcpUrl, token, cwd, baseRef, isAlive }) {
241
258
  ...(SAFE ? { allowedTools: SAFE_TOOLS } : {}),
242
259
  systemPrompt: { type: 'preset', preset: 'claude_code', append: SYSTEM_LIVE },
243
260
  mcpServers: {
244
- flowviant: { type: 'http', url: mcpUrl, headers: { Authorization: `Bearer ${token}` } },
261
+ flowviant: {
262
+ type: 'http',
263
+ url: mcpUrl,
264
+ headers: { Authorization: `Bearer ${token}`, 'User-Agent': USER_AGENT },
265
+ },
245
266
  },
246
267
  },
247
268
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flowviant",
3
- "version": "0.6.0",
3
+ "version": "0.6.1",
4
4
  "description": "Run your own Claude Code as headless build agents for Flowviant — on your own credentials. Claims dispatched work, opens PRs, captures review evidence, and routes questions back to you.",
5
5
  "type": "module",
6
6
  "bin": {