@phantomcodes/cli 1.3.2 → 1.3.4

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.
@@ -50,7 +50,7 @@ export const COMMANDS = [
50
50
  {
51
51
  name: 'fund', handler: fundDispatch, keyless: true,
52
52
  group: 'Money', summary: 'add credit by card or crypto',
53
- help: ` fund --amount <USD> [--card | --coin usdc|usdt|sol|usdc-base] [--no-browser]
53
+ help: ` fund --amount <USD> [--card | --coin usdc|usdc-base] [--no-browser]
54
54
  fund your workspace balance with card (plus Stripe's fee) or crypto`,
55
55
  },
56
56
  {
@@ -1,2 +1,2 @@
1
1
  /** This release of phantom. `npm version` keeps it equal to the version in package.json. */
2
- export const VERSION = '1.3.2';
2
+ export const VERSION = '1.3.4';
@@ -151,22 +151,3 @@ export function forgetKeyAs(env, target) {
151
151
  else
152
152
  removeNamedKey(env, target);
153
153
  }
154
- /**
155
- * True when PHANTOM_API_KEY holds the same key as the login. `phantom setup`'s
156
- * shell block sets it that way, so a rotate or burn must update the login too.
157
- */
158
- export function envIsLogin(env) {
159
- return Boolean(env.PHANTOM_API_KEY) && existsSync(keyPath(env)) && readSecret(env, keyPath(env)).trim() === env.PHANTOM_API_KEY?.trim();
160
- }
161
- /** After a rotate, put the new key where the old one was saved. */
162
- export function replaceSavedKey(env, src, key) {
163
- if (src.from === 'named') {
164
- saveNamedKey(env, src.name, key, { replace: true });
165
- return src.name;
166
- }
167
- if (src.from === 'login' || (src.from === 'env' && envIsLogin(env))) {
168
- writeKeyFile(env, keyPath(env), key);
169
- return 'login';
170
- }
171
- return null;
172
- }
@@ -71,7 +71,7 @@ export function claudePlan(env, opts) {
71
71
  const changes = [];
72
72
  if (ours) {
73
73
  changes.push([['apiKeyHelper'], undefined]);
74
- const mine = ['ANTHROPIC_BASE_URL', 'ENABLE_TOOL_SEARCH', 'ANTHROPIC_MODEL', 'CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY', ...(vars.ANTHROPIC_API_KEY === '' ? ['ANTHROPIC_API_KEY'] : [])];
74
+ const mine = ['ANTHROPIC_BASE_URL', 'ENABLE_TOOL_SEARCH', 'ANTHROPIC_MODEL', 'ANTHROPIC_DEFAULT_HAIKU_MODEL', 'CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY', ...(vars.ANTHROPIC_API_KEY === '' ? ['ANTHROPIC_API_KEY'] : [])];
75
75
  if (Object.keys(vars).every((k) => mine.includes(k)))
76
76
  changes.push([['env'], undefined]);
77
77
  else
@@ -97,6 +97,9 @@ export function claudePlan(env, opts) {
97
97
  CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY: '1',
98
98
  // phantom-1 unless a model is named, as Codex gets: it runs free until there is credit.
99
99
  ANTHROPIC_MODEL: opts.model ?? 'claude-code/phantom-1',
100
+ // Claude Code's background calls (titles, summaries) and its Explore agent use the
101
+ // haiku model. Through phantom-1 they run on Standard instead of Claude Haiku.
102
+ ANTHROPIC_DEFAULT_HAIKU_MODEL: 'claude-code/phantom-1',
100
103
  };
101
104
  const changes = [[['apiKeyHelper'], `${phantomCommand(opts.onPath ?? onPath)} key show`], ...Object.entries(set).map(([k, v]) => [['env', k], v])];
102
105
  // A token outranks apiKeyHelper, and would send a non-Phantom key.
@@ -417,7 +417,7 @@ export async function workspaceCommand(input) {
417
417
  if (flags.pay)
418
418
  die('--pay has been removed. Use --card or --coin.');
419
419
  if (flags.coin === true)
420
- die(`--coin needs usdc, usdt, sol or usdc-base. ${FUND_EXAMPLE}`);
420
+ die(`--coin needs usdc or usdc-base. ${FUND_EXAMPLE}`);
421
421
  let amount = dollarsFlag(flags);
422
422
  let method = flags.card ? 'card' : flags.coin;
423
423
  // At a terminal, whatever is missing is asked for: first how much, then how to pay.
@@ -436,9 +436,7 @@ export async function workspaceCommand(input) {
436
436
  hint: "on Stripe's page, plus Stripe's card fee",
437
437
  value: 'card',
438
438
  },
439
- { label: 'USDC', hint: 'from a Solana wallet', value: 'usdc' },
440
- { label: 'USDT', hint: 'from a Solana wallet', value: 'usdt' },
441
- { label: 'SOL', hint: 'from a Solana wallet', value: 'sol' },
439
+ { label: 'USDC', hint: 'from a Solana wallet, to Stripe', value: 'usdc' },
442
440
  ])) ?? undefined;
443
441
  if (!method)
444
442
  return leaveFund(input);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@phantomcodes/cli",
3
- "version": "1.3.2",
3
+ "version": "1.3.4",
4
4
  "description": "AI inference for your coding agents. Route models, control spending, and fund your workspace.",
5
5
  "keywords": [
6
6
  "phantom",
@@ -43,8 +43,7 @@
43
43
  },
44
44
  "dependencies": {
45
45
  "jsonc-parser": "^3.3.1",
46
- "smol-toml": "^1.9.0",
47
- "zod": "^4.5.4"
46
+ "smol-toml": "^1.9.0"
48
47
  },
49
48
  "scripts": {
50
49
  "build": "tsc -p .",
@@ -70,7 +70,7 @@ phantom fund --amount 10 --coin usdc
70
70
  phantom workspace payment --id <payment-id>
71
71
  ```
72
72
 
73
- Card checkout opens the payment URL in your browser. Crypto funding (`--coin usdc|usdt|sol`)
73
+ Card checkout opens the payment URL in your browser. Crypto funding (`--coin usdc` on Solana, `--coin usdc-base` on Base)
74
74
  provides a Solana pay URL. Credit is available once confirmed. Check pending payments with
75
75
  `phantom workspace payment --id <id>`. Check balance anytime with `phantom balance`.
76
76