@phantomcodes/cli 1.6.2 → 1.6.3

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/README.md CHANGED
@@ -31,7 +31,7 @@ It also installs the `phantom-ai` skill, a file that teaches the agent the phant
31
31
  - `phantom setup --restore` puts back each file setup changed, from the copies it kept. A file you edited after setup keeps your edits: restore takes out only Phantom's own lines and keys, and leaves the copy beside the file. Restore also removes the `settings.json.bak` copy that setup makes for Claude Code and Gemini, unless a `.bak` was already there before setup or you changed it since. It exits 1 only when a file could not be undone.
32
32
  - `phantom setup --provider off` takes Phantom out of an agent and keeps the rest of its settings. In JSON settings files (Claude Code, Qwen Code, Gemini CLI and others), setup records each value it replaces and puts it back.
33
33
 
34
- Claude Code's background calls (titles, summaries and its Explore agent) run on the model you chose with `phantom models`, so picking `phantom-1:zdr` covers them too.
34
+ Claude Code's background calls (titles, summaries and its Explore agent) run on the model you chose with `phantom models`, so picking `phantom-1:private` covers them too.
35
35
 
36
36
  ## Let your agent set it up
37
37
 
@@ -111,12 +111,12 @@ Phantom has three models of its own. `phantom models` shows what each can do (ch
111
111
 
112
112
  - `phantom-1` does every job. Chat starts each task on the standard tier and moves hard steps to frontier: a failed try, or an agent that is stuck.
113
113
  - `phantom-1:free` is chat on free models at $0, with no card.
114
- - `phantom-1:zdr` is chat (with images) on providers that keep none of your data.
114
+ - `phantom-1:private` is chat (with images) on providers that keep none of your data and don't train on your prompts. It replaced `phantom-1:zdr`, which now answers 400.
115
115
 
116
116
  At a terminal, `phantom models` asks which one your agents should use. To pick without the menu:
117
117
 
118
118
  ```bash
119
- phantom models use phantom-1:zdr
119
+ phantom models use phantom-1:private
120
120
  ```
121
121
 
122
122
  `phantom claude`, `phantom codex`, `phantom pi` and the next `phantom setup` start on the model you pick. Agents you set up earlier keep their model until you run `phantom setup` again.
@@ -164,7 +164,7 @@ Dates are UTC days, and the default is this month. Without `--workspace` you see
164
164
  | Add credit and check spending | `phantom fund`, `phantom balance`, `phantom spend`, `phantom workspace status` |
165
165
  | Manage the workspace's keys | `phantom keys create`, `phantom keys set`, `phantom keys rotate`, `phantom keys revoke` |
166
166
  | Manage the keys saved on this computer | `phantom keys saved`, `phantom keys save`, `phantom keys rm` |
167
- | Pick phantom-1, phantom-1:free or phantom-1:zdr | `phantom models`, `phantom models use <id>` |
167
+ | Pick phantom-1, phantom-1:free or phantom-1:private | `phantom models`, `phantom models use <id>` |
168
168
  | Pick the model in each tier | `phantom lineup`, `phantom lineup set`, `phantom lineup reset` |
169
169
  | Set rules for `auto` | `phantom route` |
170
170
  | Use the providers that answer soonest | `phantom route set --sort fast` (`--sort default` for cheapest first) |
@@ -40,7 +40,7 @@ export const AGENTS = {
40
40
  const model = hasModel(args) || env.ANTHROPIC_MODEL ? {} : { ANTHROPIC_MODEL: claudeModelName(startModel(env)) };
41
41
  // Claude Code's background calls (titles, summaries, the Explore agent that reads the code) go to its haiku
42
42
  // model. They follow the chosen model, and sit in --settings, which outranks the haiku model an earlier
43
- // `phantom setup` wrote, so a later `phantom models use phantom-1:zdr` covers them. A haiku model the user set in the shell stays theirs.
43
+ // `phantom setup` wrote, so a later `phantom models use phantom-1:private` covers them. A haiku model the user set in the shell stays theirs.
44
44
  const background = env.ANTHROPIC_DEFAULT_HAIKU_MODEL ? {} : { ANTHROPIC_DEFAULT_HAIKU_MODEL: claudeModelName(startModel(env)) };
45
45
  const vars = { ANTHROPIC_BASE_URL: proxy, CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY: '1', ENABLE_TOOL_SEARCH: 'true', ...background };
46
46
  const { ANTHROPIC_AUTH_TOKEN: _auth, ...rest } = withoutPhantomKeys(env);
@@ -191,7 +191,7 @@ export const COMMANDS = [
191
191
  {
192
192
  name: 'models', handler: modelsCommand, keyless: true,
193
193
  group: 'Routing', summary: 'phantom-1, free or zdr: what each can do, and which your agents use',
194
- help: ` models what phantom-1, phantom-1:free and phantom-1:zdr
194
+ help: ` models what phantom-1, phantom-1:free and phantom-1:private
195
195
  can do, and the model behind each job; at a
196
196
  terminal, pick one
197
197
  models use <id> start your agents on it, without the menu`,
@@ -237,7 +237,7 @@ export const COMMANDS = [
237
237
  help: ` verify --model <id> make one small call and check that its signed
238
238
  receipt names the model you asked for (costs a
239
239
  fraction of a cent). For phantom-1, phantom-1:free,
240
- phantom-1:zdr or auto it checks the receipt's
240
+ phantom-1:private or auto it checks the receipt's
241
241
  requested model, since the model that ran varies
242
242
  verify --receipt <receipt> check a receipt you already have`,
243
243
  },
@@ -355,7 +355,7 @@ export function keySavedScreen(name, style = {}) {
355
355
  const MODEL_ABOUT = {
356
356
  'phantom-1': 'every job; chat starts each task on standard and moves hard steps to frontier',
357
357
  'phantom-1:free': `chat on free models at $0, no card; ${FREE_REQUESTS_A_DAY} requests a day, ${FREE_AGENT_REQUESTS_A_DAY} from an agent`,
358
- 'phantom-1:zdr': 'chat on providers that keep none of your data, at their prices',
358
+ 'phantom-1:private': 'chat on providers that keep no data and don\'t train on your prompts, at their prices',
359
359
  };
360
360
  /** A model's few words: {@link MODEL_ABOUT}, or the first sentence the server gives for a model this CLI doesn't know yet. */
361
361
  const modelAbout = (m) => MODEL_ABOUT[m.id] ?? m.description.split('. ')[0];
@@ -1,2 +1,2 @@
1
1
  /** This release of phantom. `npm version` keeps it equal to the version in package.json. */
2
- export declare const VERSION = "1.6.2";
2
+ export declare const VERSION = "1.6.3";
@@ -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.6.2';
2
+ export const VERSION = '1.6.3';
@@ -1,6 +1,6 @@
1
1
  import { type CommandInput } from '../core/helpers.mts';
2
2
  /**
3
- * `phantom models`: phantom-1, phantom-1:free and phantom-1:zdr side by side,
3
+ * `phantom models`: phantom-1, phantom-1:free and phantom-1:private side by side,
4
4
  * with the jobs each can do and the model behind each job. At a terminal you
5
5
  * pick one, and your agents start on it (`./choice.mts`).
6
6
  * `phantom models use <id>` picks without the menu.
@@ -8,7 +8,7 @@ import { isSetUp } from "../setup/apply.mjs";
8
8
  import { saveModel, startModel } from "./choice.mjs";
9
9
  import { getModels } from "./list.mjs";
10
10
  /**
11
- * `phantom models`: phantom-1, phantom-1:free and phantom-1:zdr side by side,
11
+ * `phantom models`: phantom-1, phantom-1:free and phantom-1:private side by side,
12
12
  * with the jobs each can do and the model behind each job. At a terminal you
13
13
  * pick one, and your agents start on it (`./choice.mts`).
14
14
  * `phantom models use <id>` picks without the menu.
@@ -13,7 +13,7 @@ export type ChatModel = {
13
13
  };
14
14
  /** One of Phantom's own models, as `phantom models` shows it. */
15
15
  export type PhantomModel = {
16
- /** The name an agent sends, such as phantom-1:zdr. */
16
+ /** The name an agent sends, such as phantom-1:private. */
17
17
  id: string;
18
18
  /** Display name. */
19
19
  name: string;
@@ -1,5 +1,5 @@
1
1
  import { request } from "../core/request.mjs";
2
- // Phantom's own models (phantom-1, phantom-1:free, phantom-1:zdr) and what
2
+ // Phantom's own models (phantom-1, phantom-1:free, phantom-1:private) and what
3
3
  // each can do, read from the server, so a model Phantom adds or changes shows
4
4
  // up with no new CLI release. `phantom models` shows them.
5
5
  /** Each job a model can do, with its name on screen, in the order the table lists them. */
@@ -28,7 +28,7 @@ export async function getModels(baseUrl, apiKey = '') {
28
28
  const can = JOBS.map(([job]) => job).filter((job) => {
29
29
  if (job === 'chat')
30
30
  return r.models.length > 0;
31
- // phantom-1 names a model for images; phantom-1:zdr sends them to its chat models.
31
+ // phantom-1 names a model for images; phantom-1:private sends them to its chat models.
32
32
  if (job === 'vision')
33
33
  return Boolean(r.jobs.vision) || takesImages.has(r.id);
34
34
  return Boolean(r.jobs[job]);
@@ -72,5 +72,5 @@ export declare function checkReceipt(compact: string, baseUrl?: string, timeoutM
72
72
  export declare function modelsMatch(requested: string, served: string): boolean;
73
73
  /** One small priced call to `model`, then a check of the receipt it returns. */
74
74
  export declare function verifyModel(apiKey: string, model: string, baseUrl?: string, timeoutMs?: number): Promise<VerifyModelResult>;
75
- /** True when `model` is one of Phantom's routers (`phantom-1`, `phantom-1:free`, `phantom-1:zdr`, `auto`), in any case. */
75
+ /** True when `model` is one of Phantom's routers (`phantom-1`, `phantom-1:free`, `phantom-1:private`, `auto`), in any case. */
76
76
  export declare function isPhantomRouter(model: string): boolean;
@@ -88,9 +88,13 @@ export async function verifyModel(apiKey, model, baseUrl, timeoutMs = REQUEST_TI
88
88
  ...(check.reason ? { reason: check.reason } : routerCheck?.reason ? { reason: routerCheck.reason } : {}),
89
89
  };
90
90
  }
91
- /** The ids of Phantom's routers: names that pick a model for each request, so no upstream model ever has them as its own id. */
92
- const PHANTOM_ROUTERS = ['phantom-1', 'phantom-1:free', 'phantom-1:zdr', 'auto'];
93
- /** True when `model` is one of Phantom's routers (`phantom-1`, `phantom-1:free`, `phantom-1:zdr`, `auto`), in any case. */
91
+ /**
92
+ * The ids of Phantom's routers: names that pick a model for each request, so
93
+ * no upstream model ever has them as its own id. `phantom-1:zdr` is retired
94
+ * (renamed `phantom-1:private`), but receipts from before still name it.
95
+ */
96
+ const PHANTOM_ROUTERS = ['phantom-1', 'phantom-1:free', 'phantom-1:private', 'phantom-1:zdr', 'auto'];
97
+ /** True when `model` is one of Phantom's routers (`phantom-1`, `phantom-1:free`, `phantom-1:private`, `auto`), in any case. */
94
98
  export function isPhantomRouter(model) {
95
99
  return PHANTOM_ROUTERS.includes(model.toLowerCase());
96
100
  }
@@ -110,7 +110,7 @@ export function claudePlan(env, opts) {
110
110
  ANTHROPIC_MODEL: claudeModelName(opts.model ?? SETUP_MODEL),
111
111
  // Claude Code's background calls (titles, summaries) and its Explore agent, which reads the
112
112
  // user's code, use the haiku model. It follows the chosen model, so a zero data retention
113
- // choice (phantom-1:zdr) covers them too. Through phantom-1 they run on Standard instead of Claude Haiku.
113
+ // choice (phantom-1:private) covers them too. Through phantom-1 they run on Standard instead of Claude Haiku.
114
114
  ANTHROPIC_DEFAULT_HAIKU_MODEL: claudeModelName(opts.model ?? SETUP_MODEL),
115
115
  };
116
116
  const changes = [[['apiKeyHelper'], `${phantomCommand(opts.onPath ?? onPath)} key show`], ...Object.entries(set).map(([k, v]) => [['env', k], v])];
@@ -135,7 +135,7 @@ export type ProviderResult = {
135
135
  /** Steps to follow by hand, for an agent whose model settings live on its settings screen. */
136
136
  manual?: string[];
137
137
  };
138
- /** A model as Claude Code names it: `phantom-1:zdr` is `claude-code/phantom-1:zdr`, and one that has the prefix keeps one. */
138
+ /** A model as Claude Code names it: `phantom-1:private` is `claude-code/phantom-1:private`, and one that has the prefix keeps one. */
139
139
  export declare function claudeModelName(model: string): string;
140
140
  /** The context window Phantom AI's catalog gives phantom-1. Goose and Aider size requests by it. */
141
141
  export declare const SETUP_CONTEXT_WINDOW = 1000000;
@@ -80,7 +80,7 @@ export function offResult(label, file, text, after, forgetJsonWas = false) {
80
80
  }
81
81
  /** The prefix Claude Code's `/model` picker needs to keep a model: it drops ids without "claude" in them. The server strips it again. */
82
82
  const CLAUDE_CODE_PREFIX = 'claude-code/';
83
- /** A model as Claude Code names it: `phantom-1:zdr` is `claude-code/phantom-1:zdr`, and one that has the prefix keeps one. */
83
+ /** A model as Claude Code names it: `phantom-1:private` is `claude-code/phantom-1:private`, and one that has the prefix keeps one. */
84
84
  export function claudeModelName(model) {
85
85
  return CLAUDE_CODE_PREFIX + (model.startsWith(CLAUDE_CODE_PREFIX) ? model.slice(CLAUDE_CODE_PREFIX.length) : model);
86
86
  }
@@ -62,7 +62,7 @@ export declare function putRoute(apiKey: string, policy: RoutePolicy, baseUrl?:
62
62
  export declare function patchRoute(apiKey: string, fields: Partial<RoutePolicy>, baseUrl?: string): Promise<RouteResult>;
63
63
  /** Removes the key's route policy (DELETE /key/route). */
64
64
  export declare function clearRoute(apiKey: string, baseUrl?: string): Promise<RouteResult>;
65
- /** Which model a request would run on now, and why (POST /key/route/test). Nothing is charged. A route policy picks without calling a model; `phantom-1`, `phantom-1:zdr`, or `auto` on a key with no policy can call the model that picks the tier. `phantom-1:free` never does. */
65
+ /** Which model a request would run on now, and why (POST /key/route/test). Nothing is charged. A route policy picks without calling a model; `phantom-1`, `phantom-1:private`, or `auto` on a key with no policy can call the model that picks the tier. `phantom-1:free` never does. */
66
66
  export declare function testRoute(apiKey: string, opts: {
67
67
  model: string;
68
68
  messages?: unknown;
@@ -37,7 +37,7 @@ export async function patchRoute(apiKey, fields, baseUrl) {
37
37
  export function clearRoute(apiKey, baseUrl) {
38
38
  return request('DELETE', '/key/route', apiKey, undefined, baseUrl);
39
39
  }
40
- /** Which model a request would run on now, and why (POST /key/route/test). Nothing is charged. A route policy picks without calling a model; `phantom-1`, `phantom-1:zdr`, or `auto` on a key with no policy can call the model that picks the tier. `phantom-1:free` never does. */
40
+ /** Which model a request would run on now, and why (POST /key/route/test). Nothing is charged. A route policy picks without calling a model; `phantom-1`, `phantom-1:private`, or `auto` on a key with no policy can call the model that picks the tier. `phantom-1:free` never does. */
41
41
  export function testRoute(apiKey, opts, baseUrl) {
42
42
  return request('POST', '/key/route/test', apiKey, opts, baseUrl);
43
43
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@phantomcodes/cli",
3
- "version": "1.6.2",
3
+ "version": "1.6.3",
4
4
  "description": "Connects Claude Code, Codex, pi and other coding agents to Phantom AI, an OpenAI-compatible API, and manages your keys, credit and spending caps from the terminal.",
5
5
  "keywords": [
6
6
  "phantom",
@@ -85,14 +85,14 @@ phantom route test --table
85
85
 
86
86
  A route policy applies to requests for model `auto`. To change the policy of the key an agent runs with `--key coding`, set `PHANTOM_KEY_NAME=coding`. `phantom route test` costs nothing.
87
87
 
88
- ## Pick phantom-1, phantom-1:free or phantom-1:zdr
88
+ ## Pick phantom-1, phantom-1:free or phantom-1:private
89
89
 
90
90
  ```bash
91
91
  phantom models
92
- phantom models use phantom-1:zdr
92
+ phantom models use phantom-1:private
93
93
  ```
94
94
 
95
- `phantom models` lists Phantom's three models, the jobs each can do and the model behind each job. `phantom-1` does every job, `phantom-1:free` is chat at $0, and `phantom-1:zdr` is chat on providers that keep none of the user's data. `models use` sets the model that `phantom claude`, `phantom codex`, `phantom pi` and the next `phantom setup` start on.
95
+ `phantom models` lists Phantom's three models, the jobs each can do and the model behind each job. `phantom-1` does every job, `phantom-1:free` is chat at $0, and `phantom-1:private` is chat on providers that keep none of the user's data and don't train on their prompts (it replaced `phantom-1:zdr`, which now answers 400). `models use` sets the model that `phantom claude`, `phantom codex`, `phantom pi` and the next `phantom setup` start on.
96
96
 
97
97
  ## Pick the model in each tier
98
98