@ph0ny/cli 0.1.0 → 0.2.0

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.
Files changed (76) hide show
  1. package/README.md +93 -20
  2. package/SKILL.md +73 -0
  3. package/bin/phony.js +3 -1
  4. package/dist/commands/account.d.ts +9 -0
  5. package/dist/commands/account.d.ts.map +1 -0
  6. package/dist/commands/account.js +48 -0
  7. package/dist/commands/account.js.map +1 -0
  8. package/dist/commands/agents.d.ts +1 -0
  9. package/dist/commands/agents.d.ts.map +1 -1
  10. package/dist/commands/agents.js +48 -29
  11. package/dist/commands/agents.js.map +1 -1
  12. package/dist/commands/call.d.ts +10 -8
  13. package/dist/commands/call.d.ts.map +1 -1
  14. package/dist/commands/call.js +87 -31
  15. package/dist/commands/call.js.map +1 -1
  16. package/dist/commands/contacts.d.ts.map +1 -1
  17. package/dist/commands/contacts.js +5 -1
  18. package/dist/commands/contacts.js.map +1 -1
  19. package/dist/commands/observability.d.ts.map +1 -1
  20. package/dist/commands/observability.js +2 -10
  21. package/dist/commands/observability.js.map +1 -1
  22. package/dist/commands/raw.d.ts.map +1 -1
  23. package/dist/commands/raw.js +1 -0
  24. package/dist/commands/raw.js.map +1 -1
  25. package/dist/commands/synthesize.d.ts +3 -0
  26. package/dist/commands/synthesize.d.ts.map +1 -0
  27. package/dist/commands/synthesize.js +71 -0
  28. package/dist/commands/synthesize.js.map +1 -0
  29. package/dist/commands/transcribe.d.ts +3 -0
  30. package/dist/commands/transcribe.d.ts.map +1 -0
  31. package/dist/commands/transcribe.js +47 -0
  32. package/dist/commands/transcribe.js.map +1 -0
  33. package/dist/commands/translate-job.d.ts +6 -0
  34. package/dist/commands/translate-job.d.ts.map +1 -0
  35. package/dist/commands/translate-job.js +73 -0
  36. package/dist/commands/translate-job.js.map +1 -0
  37. package/dist/commands/translate-options.d.ts +42 -0
  38. package/dist/commands/translate-options.d.ts.map +1 -0
  39. package/dist/commands/translate-options.js +147 -0
  40. package/dist/commands/translate-options.js.map +1 -0
  41. package/dist/commands/translate.d.ts +3 -0
  42. package/dist/commands/translate.d.ts.map +1 -0
  43. package/dist/commands/translate.js +77 -0
  44. package/dist/commands/translate.js.map +1 -0
  45. package/dist/commands/video.d.ts +13 -0
  46. package/dist/commands/video.d.ts.map +1 -0
  47. package/dist/commands/video.js +83 -0
  48. package/dist/commands/video.js.map +1 -0
  49. package/dist/commands/voices.d.ts.map +1 -1
  50. package/dist/commands/voices.js +27 -43
  51. package/dist/commands/voices.js.map +1 -1
  52. package/dist/index.d.ts +10 -4
  53. package/dist/index.d.ts.map +1 -1
  54. package/dist/index.js +70 -54
  55. package/dist/index.js.map +1 -1
  56. package/dist/lib/agent-payload.d.ts +27 -12
  57. package/dist/lib/agent-payload.d.ts.map +1 -1
  58. package/dist/lib/agent-payload.js +33 -20
  59. package/dist/lib/agent-payload.js.map +1 -1
  60. package/dist/lib/call-payload.d.ts +6 -0
  61. package/dist/lib/call-payload.d.ts.map +1 -1
  62. package/dist/lib/call-payload.js +14 -0
  63. package/dist/lib/call-payload.js.map +1 -1
  64. package/dist/lib/call-trace.d.ts +14 -0
  65. package/dist/lib/call-trace.d.ts.map +1 -0
  66. package/dist/lib/call-trace.js +30 -0
  67. package/dist/lib/call-trace.js.map +1 -0
  68. package/dist/lib/errors.d.ts +7 -4
  69. package/dist/lib/errors.d.ts.map +1 -1
  70. package/dist/lib/errors.js +11 -10
  71. package/dist/lib/errors.js.map +1 -1
  72. package/package.json +13 -11
  73. package/dist/commands/campaign.d.ts +0 -11
  74. package/dist/commands/campaign.d.ts.map +0 -1
  75. package/dist/commands/campaign.js +0 -26
  76. package/dist/commands/campaign.js.map +0 -1
package/README.md CHANGED
@@ -1,14 +1,26 @@
1
1
  # @ph0ny/cli
2
2
 
3
- Command-line interface for the [Phony](https://api.ph0ny.com) Voice API — manage agents, knowledge, voices, tools, tests, API keys, provider keys, tasks, contacts, products, domains, observability, and outbound calls.
3
+ Command-line interface for the [ph0ny](https://api.ph0ny.com) Voice API — transcribe, translate and synthesize speech, and manage agents, knowledge, voices, tools, tests, API keys, provider keys, tasks, contacts, products, domains, observability, outbound calls, and video translation. Installs as `phony` and `ph0ny`.
4
4
 
5
- Built to be driven by autonomous LLM agents: every read/list command supports `--json` (machine-readable, no colors), there are no interactive prompts, and secrets are never accepted on the command line.
5
+ Built to be driven by autonomous LLM agents: every command supports `--json` (machine-readable, no colors), there are no interactive prompts, and secrets are never accepted on the command line. [SKILL.md](./SKILL.md) is the agent's guide; [Use ph0ny from an agent](../../docs-site/guide/agents-cli.md) is the same contract for people.
6
+
7
+ ## Speech in one command
8
+
9
+ ```bash
10
+ export PHONY_API_KEY=plabs_...
11
+ phony transcribe meeting.wav --json # text, segments, language, duration
12
+ phony translate meeting.wav --to es --json # meeting.es.wav plus the translated text
13
+ phony synthesize "Your table is booked for seven." --json # speech.mp3
14
+ phony call start --to +14155550123 --goal "Confirm the booking for Friday" \
15
+ --dry-run --consent-recorded --json # every outbound gate, nothing dialed
16
+ ```
6
17
 
7
18
  ## Install
8
19
 
9
20
  ```bash
10
21
  pnpm add -g @ph0ny/cli
11
22
  # or run via the workspace
23
+ ph0ny --help
12
24
  node ./bin/phony.js --help
13
25
  ```
14
26
 
@@ -47,7 +59,11 @@ API keys must use the `plabs_` prefix. **Secrets are never passed via flags**
47
59
  ## Command tree
48
60
 
49
61
  ```
50
- phony
62
+ ph0ny
63
+ ├── transcribe <file|url> [--language <code>] [--diarize] [--timestamps none|segment|word]
64
+ ├── translate <file|url> --to <lang> [--from auto] [--transcript srt|vtt|txt|none]
65
+ │ [--voice neutral|speakers|clone|<voiceId>] [--out <path.wav>]
66
+ ├── synthesize <text|-> [--voice <voiceId>] [--format mp3|wav|ogg] [--out <path>]
51
67
  ├── auth
52
68
  │ └── status Verify the key authenticates; show tier + profile
53
69
  ├── keys
@@ -56,9 +72,10 @@ phony
56
72
  ├── agents
57
73
  │ ├── list [--limit <n>]
58
74
  │ ├── get <id>
59
- │ ├── create --file <json> OR --name/--system-prompt/--voice/--llm
60
- │ ├── update <id> --file <json> OR --name/--system-prompt/--voice/--llm
75
+ │ ├── create --file <json> OR --name --language --first-message --kind ...
76
+ │ ├── update <id> --file <json> OR the same flags
61
77
  │ ├── delete <id>
78
+ │ ├── chat <id> --message <text> [--conversation <id>] [--timeout <seconds>]
62
79
  │ └── test <id> Run a self-play test (tests/run-selfplay)
63
80
  ├── knowledge
64
81
  │ ├── list|get|create|delete
@@ -67,10 +84,16 @@ phony
67
84
  │ ├── search <collectionId> --file <json> OR --query <text>
68
85
  │ └── delete-document <collectionId> <documentId>
69
86
  ├── voices
70
- │ ├── list|get
71
- │ ├── clone --name <n> --audio-file <path...>
72
- │ ├── synthesize <voiceId> --text <text>
87
+ │ ├── list [--provider <name>] [--limit 1-200]
88
+ │ ├── get <id>
89
+ │ ├── clone --name <n> --audio-file <path...> --consent "<your statement>"
73
90
  │ └── delete <id>
91
+ ├── video
92
+ │ └── translate <file|url> --to <lang> [--from auto] [--captions burn|srt|vtt|none]
93
+ │ [--caption-style plain|viral|karaoke]
94
+ │ [--audio original|dub] [--voice neutral|clone|<voiceId>]
95
+ │ [--speaker-voice speaker_0=<id>] [--lipsync] [--speakers auto|N]
96
+ │ [--cover-captions] [--caption-position bottom|top] [--out <path>]
74
97
  ├── providers
75
98
  │ ├── list
76
99
  │ ├── set <provider> --key-env <ENV_VAR>
@@ -87,7 +110,7 @@ phony
87
110
  │ ├── runs --agent <id>
88
111
  │ └── generate --agent <id>
89
112
  ├── call
90
- │ ├── start --agent --to --from --goal --consent-recorded
113
+ │ ├── start --to --goal --consent-recorded [--agent] [--from]
91
114
  │ │ [--success-schema <file.json>] [--ivr-hints <text>] [--dry-run]
92
115
  │ ├── get <id>
93
116
  │ ├── list [--limit <n>]
@@ -98,11 +121,59 @@ phony
98
121
  ├── products Manage agent product catalogs
99
122
  ├── domains Manage custom agent domains
100
123
  ├── observability List sessions and fetch trace/root-cause JSON
101
- ├── raw <method> <path> Authenticated /v1 escape hatch
102
- └── campaign Not yet available upstream (exits 2)
124
+ ├── credits This period's credits (GET /v1/usage)
125
+ ├── pricing The price list (GET /v1/pricing)
126
+ ├── phone-numbers
127
+ │ └── list Your numbers, the --from of call start
128
+ └── raw <method> <path> Authenticated /v1 escape hatch
129
+ ```
130
+
131
+ Every command accepts `--json` for 2-space, color-free output you can pipe into `jq`.
132
+
133
+ ## Video translation
134
+
135
+ ```bash
136
+ # English captions burned over the original audio (default); writes interview.en.mp4 (--captions srt|vtt writes a caption file instead)
137
+ ph0ny video translate interview.mp4 --to en
138
+
139
+ # Short, speech-paced captions with the original audio; karaoke highlights each active word
140
+ ph0ny video translate interview.mp4 --to en --caption-style viral
141
+ ph0ny video translate interview.mp4 --to en --caption-style karaoke
142
+
143
+ # A post on X or YouTube: fetched locally with yt-dlp, then uploaded
144
+ ph0ny video translate https://x.com/<user>/status/<id> --to en --cover-captions
145
+
146
+ # English dub, a neutral voice per speaker, captions burned in
147
+ ph0ny video translate interview.mp4 --to en --audio dub
148
+
149
+ # Dub only, without the original soundtrack (default original-audio level is 0.15)
150
+ ph0ny video translate interview.mp4 --to en --audio dub --original-volume 0
151
+
152
+ # Retain room tone/music but remove source speech beneath the dub
153
+ ph0ny video translate interview.mp4 --to en --audio dub --original-audio background
154
+
155
+ # A consented speaker gets a temporary clone; other speakers use stock voices
156
+ ph0ny video translate interview.mp4 --to en --audio dub --voice speakers --speaker-consents ./consents.json
157
+
158
+ # Captions only, as a sidecar file
159
+ ph0ny video translate interview.mp4 --to es --captions vtt
103
160
  ```
104
161
 
105
- Every read/list command accepts `--json` for 2-space, color-free output you can pipe into `jq`.
162
+ `consents.json` is an object keyed by diarized labels. For example: `{"speaker_0":{"speaker_name":"Interview guest","attested_by":"Producer","method":"verbal","obtained_on":"2026-10-08","scope":"Private translated interview dub with a temporary voice clone"}}`. A clone requires at least 10 seconds of isolated speech. Each job stores the attestation; temporary clones are removed after the job unless `retain_clone: true` is set for that speaker. The output marks the translation as AI-dubbed.
163
+
164
+ `--cover-captions` hides captions already burned into the source under a solid band. Existing saved clones still require account ownership and their original consent record (`ph0ny voices clone --consent "..."`, then `--voice clone --speaker-voice speaker_0=<your clone id>`). `--original-audio full|background|none` controls the source bed under a dub; background uses a CPU separator and fails clearly if unavailable. Page URLs need [yt-dlp](https://github.com/yt-dlp/yt-dlp) on the PATH; direct media URLs are fetched by the API.
165
+
166
+ ## Speech translation
167
+
168
+ `phony translate` accepts an audio file, a video file, a direct media URL, or a page URL that yt-dlp can fetch. It writes a 48 kHz stereo WAV and, when requested, a transcript sidecar. The default transcript is `none`.
169
+
170
+ ```bash
171
+ phony translate interview.mp3 --to en
172
+ phony translate interview.mp4 --to es --transcript srt --out interview.es.wav
173
+ phony translate interview.mp4 --to en --original-audio background --original-volume 0.15
174
+ ```
175
+
176
+ With `--json` it prints `{ text, source_language, target_language, files, job }`. `phony translate` and `phony video translate` share the Language, Speech, Original track, Text, Picture, and Output help groups. Speech translation uses the same voices, per-speaker consent, source-bed mix, and job polling as video translation. `ph0ny video translate --audio original|dub` still selects the soundtrack for a video output.
106
177
 
107
178
  ## Outbound calls + consent
108
179
 
@@ -112,18 +183,18 @@ Every read/list command accepts `--json` for 2-space, color-free output you can
112
183
  phony call start \
113
184
  --agent agent_123 \
114
185
  --to +14155550123 \
115
- --from +14155550199 \
186
+ --from +14155550123 \
116
187
  --goal "Book a table for two at 7pm Friday" \
117
188
  --success-schema ./schema.json \
118
189
  --ivr-hints "press 1, reservations" \
119
190
  --consent-recorded
120
191
 
121
192
  phony call watch <callId> --interval 5 --timeout 600
193
+ phony call trace <callId> # measured turn stages; missing clocks say Unmeasured
194
+ phony call trace <conversationId> --json # same observations, with per-turn offsets in ms
122
195
  ```
123
196
 
124
- Use `--dry-run` to validate the full configuration (auth, agent kind, from-number ownership, Twilio config) without placing a real call.
125
-
126
- Campaigns are not built upstream (see `docs/OUTBOUND-CAMPAIGNS-SPEC.md`, Phase 1). To run many calls, loop `phony call start` per target.
197
+ Use `--dry-run` to validate the full configuration (auth, agent kind, from-number ownership, destination, Twilio config) without placing a real call. A dry run may omit `--agent`: it uses your first active `personal_assistant` agent. Any call may omit `--from` when the account has exactly one active number. `--json` reports both as `agentId` and `fromNumber`. To run many calls, loop `phony call start` per target. A finished call's transcript is at `.call.transcript` in `phony call get <id> --json`.
127
198
 
128
199
  ## Developer portal/API coverage
129
200
 
@@ -131,7 +202,7 @@ The CLI intentionally targets the API-key `/v1` surface that autonomous agents c
131
202
 
132
203
  - Agents, tools, tests, conversations, tasks, contacts, products, and domains.
133
204
  - Knowledge collections/documents/search/ingest.
134
- - Voices and TTS synthesis, including local audio-file voice cloning.
205
+ - Speech: `transcribe`, `translate`, `synthesize`; voices, including local audio-file voice cloning.
135
206
  - API keys and BYOK provider keys. Provider secret values are read from env vars via `--key-env`, never argv.
136
207
  - Runtime observability sessions, call traces, and root-cause JSON.
137
208
  - `raw <method> <path>` for newly shipped `/v1` endpoints before a typed command exists.
@@ -144,12 +215,14 @@ Browser-session developer portal routes such as OAuth integration start/revoke c
144
215
  |------|---------|
145
216
  | `0` | Success. For `call watch`, the call reached `completed`. |
146
217
  | `1` | Runtime failure — API error, network error, not found, or `call watch` ending in `failed`. |
147
- | `2` | Usage / compliance error — bad arguments, missing required flag, missing `--consent-recorded`, or an unbuilt feature (`campaign`). |
218
+ | `2` | Usage / compliance error — bad arguments, missing required flag, no API key, or missing `--consent-recorded`. Retrying the same command will not succeed. |
219
+
220
+ `phony --help` prints these codes; every other `--help` ends with a one-line summary of them.
148
221
 
149
222
  ## Agent ergonomics
150
223
 
151
- - `--json` on every read/list command; output is the raw API shape.
224
+ - `--json` on every command; output is the raw API shape, plus a few named fields where a command does more than one call (`translate`, `synthesize`, `call start`'s `agentId` and `fromNumber`).
152
225
  - No interactive prompts — the CLI never blocks on a TTY.
153
226
  - No secrets in argv — keys come from the environment or the config file only.
154
- - Errors are a single line (or `{ "error": { code, message, status? } }` in `--json`); no stack traces reach stdout/stderr.
227
+ - A failure prints one line, its cause, on stderr; with `--json` stdout also carries `{ "error": { code, message, status? } }`. No stack traces.
155
228
  - `call watch` exits `0`/`1` on the terminal call status so a supervising agent can branch without parsing output.
package/SKILL.md ADDED
@@ -0,0 +1,73 @@
1
+ ---
2
+ name: phony
3
+ description: Transcribe, translate or synthesize speech, chat with a voice agent, or dry-run an outbound phone call through the ph0ny Voice API with the `phony` CLI. Use when a task needs speech-to-text, spoken translation, text-to-speech, or a ph0ny voice agent, and PHONY_API_KEY is set.
4
+ ---
5
+
6
+ # phony
7
+
8
+ `phony` is the ph0ny Voice API from a shell. Each task below is one command. Pass `--json` and read stdout as one JSON document.
9
+
10
+ ## Before the first command
11
+
12
+ - `PHONY_API_KEY` must hold a key starting with `plabs_`. Never put the key on the command line.
13
+ - `PHONY_BASE_URL` points at another API (default `https://api.ph0ny.com`).
14
+ - `phony auth status --json` proves the key works: `{"authenticated": true, ...}`.
15
+ - In a sandbox with an egress allowlist, allow `api.ph0ny.com` and `*.r2.cloudflarestorage.com`: translate and synthesize download their audio from the second.
16
+
17
+ ## Tasks
18
+
19
+ Transcribe a file or a public URL:
20
+
21
+ ```bash
22
+ phony transcribe meeting.wav --json
23
+ ```
24
+
25
+ Read `.text`. `.segments`, `.words`, `.language` (for example `eng`) and `.duration` (seconds) are also there. Add `--language en` when you know it, `--diarize` for speaker labels (without `--json`, one `Speaker N: ...` line per turn).
26
+
27
+ Translate speech into another language:
28
+
29
+ ```bash
30
+ phony translate meeting.wav --to es --json
31
+ ```
32
+
33
+ Read `.text` (the translated words) and `.files` (the dubbed WAV written next to you, `meeting.es.wav` by default). The job runs on the server; the command waits for it. `--transcript srt|vtt|txt` also writes timed text.
34
+
35
+ Synthesize speech:
36
+
37
+ ```bash
38
+ phony synthesize "Your table is booked for seven." --json
39
+ ```
40
+
41
+ Writes `speech.mp3`; read `.file`. `--voice <id>` picks a voice (`phony voices list --json`), `--out` names the file, `--format wav` changes the format, `-` instead of the text reads stdin.
42
+
43
+ Dry-run an outbound call (dials nobody):
44
+
45
+ ```bash
46
+ phony call start --to "$TO" --goal "Confirm the booking for Friday" --dry-run --consent-recorded --json
47
+ ```
48
+
49
+ `$TO` is the E.164 number the user asked to call. `.dryRun` is `true` and `.dryRunReport.gatesPassed` lists every gate the call cleared. Without `--agent` the dry run uses the account's first active `personal_assistant` agent; without `--from`, the account's only active number. Both are in `.agentId` and `.fromNumber`. Pass `--consent-recorded` only when the user asked for this call. A real call (no `--dry-run`) must name `--agent`; once it ends, `phony call get <callId> --json` has the transcript at `.call.transcript`.
50
+
51
+ Chat with an agent:
52
+
53
+ ```bash
54
+ phony agents chat <agentId> --message "What can you do?" --json
55
+ ```
56
+
57
+ Read `.message`; pass `.conversationId` back with `--conversation` to continue. For a slow model, `--timeout <seconds>` waits longer for the reply.
58
+
59
+ ## When a command fails
60
+
61
+ The exit code says what to do, and stderr holds one line with the cause. With `--json`, stdout holds `{"error": {"code", "message", "status"}}`.
62
+
63
+ | Exit | Meaning | Do |
64
+ |---|---|---|
65
+ | 0 | Success | Use stdout. |
66
+ | 1 | The API, the network or the job failed | Read the cause. Retry only a network or 5xx failure. |
67
+ | 2 | Usage: bad arguments, no key, missing consent | Fix the command; the same command will fail again. |
68
+
69
+ `OUTBOUND_DISABLED` from a dry run means the destination is not admitted for this account. Report it to the user; do not try other numbers.
70
+
71
+ ## More
72
+
73
+ `phony --help` and `phony <command> --help` list every command and option. `phony raw <METHOD> <path> --body-file <json>` reaches any `/v1` route the CLI does not wrap yet.
package/bin/phony.js CHANGED
@@ -1,2 +1,4 @@
1
1
  #!/usr/bin/env node
2
- import '../dist/index.js'
2
+ import { main } from '../dist/index.js'
3
+
4
+ main()
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Account reads: `phony credits` (GET /v1/usage), `phony pricing` (GET /v1/pricing)
3
+ * and `phony phone-numbers list` (GET /v1/phone-numbers).
4
+ */
5
+ import { Command } from 'commander';
6
+ export declare function createCreditsCommand(): Command;
7
+ export declare function createPricingCommand(): Command;
8
+ export declare function createPhoneNumbersCommand(): Command;
9
+ //# sourceMappingURL=account.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"account.d.ts","sourceRoot":"","sources":["../../src/commands/account.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAOnC,wBAAgB,oBAAoB,IAAI,OAAO,CAU9C;AAED,wBAAgB,oBAAoB,IAAI,OAAO,CAW9C;AAED,wBAAgB,yBAAyB,IAAI,OAAO,CAYnD"}
@@ -0,0 +1,48 @@
1
+ /**
2
+ * Account reads: `phony credits` (GET /v1/usage), `phony pricing` (GET /v1/pricing)
3
+ * and `phony phone-numbers list` (GET /v1/phone-numbers).
4
+ */
5
+ import { Command } from 'commander';
6
+ import { createCliClient } from '../lib/client.js';
7
+ import { run } from '../lib/errors.js';
8
+ import { printJson, printKeyValue, printTable } from '../lib/output.js';
9
+ export function createCreditsCommand() {
10
+ return new Command('credits')
11
+ .description('Show this period\'s credits; --json prints GET /v1/usage, remaining at .credits.remaining')
12
+ .option('--json', 'Output as JSON')
13
+ .action(run(async (options) => {
14
+ const usage = await createCliClient().voice.getUsage();
15
+ if (options.json)
16
+ return printJson(usage);
17
+ const { remaining, used, limit } = usage.credits;
18
+ printKeyValue({ Tier: usage.tier, Remaining: remaining, Used: used, Limit: limit, 'Period end': usage.period.end });
19
+ }));
20
+ }
21
+ export function createPricingCommand() {
22
+ return new Command('pricing')
23
+ .description('Show the price list; --json prints GET /v1/pricing (plans, usdPerCredit, tts[], stt[])')
24
+ .option('--json', 'Output as JSON')
25
+ .action(run(async (options) => {
26
+ const pricing = await createCliClient().request('GET', '/pricing');
27
+ if (options.json)
28
+ return printJson(pricing);
29
+ printTable(['Provider', 'Model', 'Credits', 'Per', 'USD'], [...pricing.tts, ...pricing.stt].map((m) => [
30
+ m.provider, m.model, m.creditsPerUnit, `${m.per} ${m.unit}`, m.usdPerUnit ?? '—',
31
+ ]));
32
+ }));
33
+ }
34
+ export function createPhoneNumbersCommand() {
35
+ const cmd = new Command('phone-numbers').description('Phone numbers on your account (the --from of phony call start)');
36
+ cmd
37
+ .command('list')
38
+ .description('List your numbers; --json prints {data: [{e164, status, agentId, ...}]}')
39
+ .option('--json', 'Output as JSON')
40
+ .action(run(async (options) => {
41
+ const numbers = await createCliClient().voice.phoneNumbers.list();
42
+ if (options.json)
43
+ return printJson({ data: numbers });
44
+ printTable(['Number', 'Status', 'Agent'], numbers.map((n) => [n.e164, n.status, n.agentId ?? '—']));
45
+ }));
46
+ return cmd;
47
+ }
48
+ //# sourceMappingURL=account.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"account.js","sourceRoot":"","sources":["../../src/commands/account.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAClD,OAAO,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAA;AACtC,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAIvE,MAAM,UAAU,oBAAoB;IAClC,OAAO,IAAI,OAAO,CAAC,SAAS,CAAC;SAC1B,WAAW,CAAC,2FAA2F,CAAC;SACxG,MAAM,CAAC,QAAQ,EAAE,gBAAgB,CAAC;SAClC,MAAM,CAAC,GAAG,CAAC,KAAK,EAAE,OAA2B,EAAE,EAAE;QAChD,MAAM,KAAK,GAAG,MAAM,eAAe,EAAE,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAA;QACtD,IAAI,OAAO,CAAC,IAAI;YAAE,OAAO,SAAS,CAAC,KAAK,CAAC,CAAA;QACzC,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,KAAK,CAAC,OAAO,CAAA;QAChD,aAAa,CAAC,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,SAAS,EAAE,SAA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AC,KAAK,EAAE,OAA2B,EAAE,EAAE;QAChD,MAAM,OAAO,GAAG,MAAM,eAAe,EAAE,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,EAAE,CAAA;QACjE,IAAI,OAAO,CAAC,IAAI;YAAE,OAAO,SAAS,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,CAAA;QACrD,UAAU,CAAC,CAAC,QAAQ,EAAE,QAAQ,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,IAAI,GAAG,CAAC,CAAC,CAAC,CAAA;IACrG,CAAC,CAAC,CAAC,CAAA;IACL,OAAO,GAAG,CAAA;AACZ,CAAC"}
@@ -7,6 +7,7 @@
7
7
  * create -> agents.create POST /v1/agents
8
8
  * update -> agents.update PUT /v1/agents/:id
9
9
  * delete -> agents.delete DELETE /v1/agents/:id
10
+ * chat -> agents.chat POST /v1/agents/:id/chat
10
11
  * test -> tests.runSelfPlay POST /v1/agents/:id/tests/run-selfplay
11
12
  */
12
13
  import { Command } from 'commander';
@@ -1 +1 @@
1
- {"version":3,"file":"agents.d.ts","sourceRoot":"","sources":["../../src/commands/agents.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AA0BnC,wBAAgB,mBAAmB,IAAI,OAAO,CA2I7C"}
1
+ {"version":3,"file":"agents.d.ts","sourceRoot":"","sources":["../../src/commands/agents.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,OAAO,EAAU,MAAM,WAAW,CAAA;AAgC3C,wBAAgB,mBAAmB,IAAI,OAAO,CA0J7C"}
@@ -7,22 +7,35 @@
7
7
  * create -> agents.create POST /v1/agents
8
8
  * update -> agents.update PUT /v1/agents/:id
9
9
  * delete -> agents.delete DELETE /v1/agents/:id
10
+ * chat -> agents.chat POST /v1/agents/:id/chat
10
11
  * test -> tests.runSelfPlay POST /v1/agents/:id/tests/run-selfplay
11
12
  */
12
- import { Command } from 'commander';
13
+ import { Command, Option } from 'commander';
14
+ import { AGENT_CHAT_TIMEOUT_MS } from '@ph0ny/sdk';
13
15
  import { createCliClient } from '../lib/client.js';
16
+ import { parsePositiveInt } from '../lib/command-utils.js';
14
17
  import { run } from '../lib/errors.js';
15
18
  import { printJson, printKeyValue, printTable, spinner, success } from '../lib/output.js';
16
19
  import { readJsonObjectFile } from '../lib/json-file.js';
17
- import { buildCreateAgentBody, buildUpdateAgentBody } from '../lib/agent-payload.js';
18
- function collectAgentFlags(options) {
19
- return {
20
- file: options.file ? readJsonObjectFile(options.file, '--file') : undefined,
21
- name: options.name,
22
- systemPrompt: options.systemPrompt,
23
- voice: options.voice,
24
- llm: options.llm,
25
- };
20
+ import { CREATE_AGENT_KEYS, buildCreateAgentBody, buildUpdateAgentBody } from '../lib/agent-payload.js';
21
+ function collectAgentFlags({ file, ...flags }) {
22
+ return { ...flags, file: file ? readJsonObjectFile(file, '--file') : undefined };
23
+ }
24
+ /** The fields an agent sets on create or update, as flags; --file takes the rest. */
25
+ function addAgentFieldOptions(command, fileHelp) {
26
+ return command
27
+ .option('--file <json>', fileHelp)
28
+ .option('--name <name>', 'Agent name')
29
+ .option('--system-prompt <text>', 'System prompt (systemPrompt)')
30
+ .option('--first-message <text>', 'What the agent says first (firstMessage)')
31
+ .option('--language <code>', 'Language it speaks, e.g. es (default en)')
32
+ .addOption(new Option('--kind <kind>', 'agentKind; personal_assistant places outbound calls').choices(['inbound', 'personal_assistant', 'outbound']))
33
+ .option('--voice <voiceId>', 'Voice ID (phony voices list)')
34
+ .option('--tts-provider <name>', 'ttsProvider, e.g. cartesia (default)')
35
+ .option('--tts-model <id>', 'ttsModel')
36
+ .option('--llm <provider>', 'llmProvider (default openai); a speech-to-speech vendor such as xai needs --llm-model')
37
+ .option('--llm-model <id>', 'llmModel; hosted speech-to-speech models: phony raw GET "/audio/models?type=s2s"')
38
+ .option('--json', 'Output as JSON: the agent, its id at .id');
26
39
  }
27
40
  export function createAgentsCommand() {
28
41
  const cmd = new Command('agents').description('Manage agents');
@@ -64,15 +77,7 @@ export function createAgentsCommand() {
64
77
  Language: agent.language,
65
78
  });
66
79
  }));
67
- cmd
68
- .command('create')
69
- .description('Create an agent')
70
- .option('--file <json>', 'Path to a JSON file with the full agent body')
71
- .option('--name <name>', 'Agent name')
72
- .option('--system-prompt <text>', 'System prompt')
73
- .option('--voice <voiceId>', 'Voice ID')
74
- .option('--llm <provider>', 'LLM provider')
75
- .option('--json', 'Output as JSON')
80
+ addAgentFieldOptions(cmd.command('create').description('Create an agent from flags, or from --file (not both)'), `JSON body instead of flags. Keys (schema: CreateAgentInput at /openapi.json): ${CREATE_AGENT_KEYS.join(', ')}`)
76
81
  .action(run(async (options) => {
77
82
  const client = createCliClient();
78
83
  const body = buildCreateAgentBody(collectAgentFlags(options));
@@ -83,16 +88,7 @@ export function createAgentsCommand() {
83
88
  }
84
89
  success(`Created agent ${agent.id} (${agent.name})`);
85
90
  }));
86
- cmd
87
- .command('update')
88
- .description('Update an agent')
89
- .argument('<id>', 'Agent ID')
90
- .option('--file <json>', 'Path to a JSON file with the update body')
91
- .option('--name <name>', 'Agent name')
92
- .option('--system-prompt <text>', 'System prompt')
93
- .option('--voice <voiceId>', 'Voice ID')
94
- .option('--llm <provider>', 'LLM provider')
95
- .option('--json', 'Output as JSON')
91
+ addAgentFieldOptions(cmd.command('update').description('Update an agent from flags, or from --file (not both)').argument('<id>', 'Agent ID'), 'JSON update body instead of flags')
96
92
  .action(run(async (id, options) => {
97
93
  const client = createCliClient();
98
94
  const body = buildUpdateAgentBody(collectAgentFlags(options));
@@ -117,6 +113,29 @@ export function createAgentsCommand() {
117
113
  }
118
114
  success(`Deleted agent ${id}`);
119
115
  }));
116
+ cmd
117
+ .command('chat')
118
+ .description('Send the agent a text message and print its reply')
119
+ .argument('<id>', 'Agent ID')
120
+ .requiredOption('--message <text>', 'What to say to the agent')
121
+ .option('--conversation <id>', 'Continue this conversation (the reply carries its conversationId)')
122
+ .option('--timeout <seconds>', `Seconds to wait for the reply (default ${AGENT_CHAT_TIMEOUT_MS / 1000})`)
123
+ .option('--json', 'Output as JSON')
124
+ .action(run(async (id, options) => {
125
+ const timeoutSeconds = parsePositiveInt(options.timeout, '--timeout');
126
+ const client = createCliClient();
127
+ const spin = spinner('Waiting for the agent...', Boolean(options.json));
128
+ spin.start();
129
+ const reply = await client.voice.agents.chat(id, {
130
+ message: options.message,
131
+ ...(options.conversation ? { conversationId: options.conversation } : {}),
132
+ }, { timeout: timeoutSeconds && timeoutSeconds * 1000 }).finally(() => spin.stop());
133
+ if (options.json) {
134
+ printJson(reply);
135
+ return;
136
+ }
137
+ process.stdout.write(`${reply.message.trim()}\n`);
138
+ }));
120
139
  cmd
121
140
  .command('test')
122
141
  .description('Run a self-play test against the agent')
@@ -1 +1 @@
1
- {"version":3,"file":"agents.js","sourceRoot":"","sources":["../../src/commands/agents.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAEnC,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAClD,OAAO,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAA;AACtC,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AACzF,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAA;AACxD,OAAO,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAA;AAUpF,SAAS,iBAAiB,CAAC,OAAmB;IAC5C,OAAO;QACL,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,kBAAkB,CAAC,OAAO,CAAC,IAAI,EAAE,Q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,MAAM,EAAE,UAAU,CAAC;SAC5B,MAAM,CAAC,gBAAgB,EAAE,8CAA8C,CAAC;SACxE,MAAM,CAAC,qBAAqB,EAAE,8BAA8B,CAAC;SAC7D,MAAM,CAAC,QAAQ,EAAE,gBAAgB,CAAC;SAClC,MAAM,CACL,GAAG,CAAC,KAAK,EAAE,EAAU,EAAE,OAAmE,EAAE,EAAE;QAC5F,MAAM,MAAM,GAAG,eAAe,EAAE,CAAA;QAChC,MAAM,IAAI,GAAG,OAAO,CAAC,sBAAsB,EAAE,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAA;QACnE,IAAI,CAAC,KAAK,EAAE,CAAA;QACZ,MAAM,OAAO,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,WAAW,CAAC,EAAE,EAAE;YACvD,QAAQ,EAAE,OAAO,CAAC,MAAM;YACxB,YAAY,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS;SAC3F,CAAC,CAAA;QACF,IAAI,CAAC,IAAI,EAAE,CAAA;QACX,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC;YACjB,SAAS,CAAC,OAAO,CAAC,CAAA;YAClB,OAAM;QACR,CAAC;QACD,OAAO,CAAC,2BAA2B,OAAO,CAAC,EAAE,GAAG,CAAC,CAAA;QACjD,aAAa,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC,CAAA;IAC3C,CAAC,CAAC,CACH,CAAA;IAEH,OAAO,GAAG,CAAA;AACZ,CAAC"}
@@ -1,16 +1,18 @@
1
1
  /**
2
- * `phony call …` — outbound call origination + monitoring.
3
- *
4
- * The API has no SDK wrapper for outbound, so these go through the raw request
5
- * helper against the outbound routes:
6
- * start -> POST /v1/outbound/start -> { callSid, callId, status } | dry-run report
7
- * get -> GET /v1/outbound/:id -> { call }
8
- * list -> GET /v1/outbound -> { calls }
9
- * watch -> poll GET /v1/outbound/:id to a terminal status
2
+ * `phony call …` — outbound call origination + monitoring, through the SDK's
3
+ * outbound client:
4
+ * start -> outbound.start POST /v1/outbound/start -> { callSid, callId, status } | dry-run report
5
+ * get -> outbound.get GET /v1/outbound/:id
6
+ * list -> outbound.list GET /v1/outbound
7
+ * watch -> poll outbound.get to a terminal status
10
8
  *
11
9
  * `call start` enforces the consent gate before constructing any request: a
12
10
  * call cannot be placed without --consent-recorded (maps userConsentRecorded:
13
11
  * true). Missing consent exits 2 (usage), never 1.
12
+ *
13
+ * A dry run dials nobody, so it may omit --agent: the CLI uses the first
14
+ * active personal_assistant agent. Any call may omit --from when the account
15
+ * has exactly one active number. --json reports both as agentId and fromNumber.
14
16
  */
15
17
  import { Command } from 'commander';
16
18
  export declare function createCallCommand(): Command;
@@ -1 +1 @@
1
- {"version":3,"file":"call.d.ts","sourceRoot":"","sources":["../../src/commands/call.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AA8BnC,wBAAgB,iBAAiB,IAAI,OAAO,CAyJ3C"}
1
+ {"version":3,"file":"call.d.ts","sourceRoot":"","sources":["../../src/commands/call.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAenC,wBAAgB,iBAAiB,IAAI,OAAO,CAoL3C"}