@palmyr/cli 1.0.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 (47) hide show
  1. package/README.md +731 -0
  2. package/dist/admin-auth.d.ts +1 -0
  3. package/dist/admin-auth.js +52 -0
  4. package/dist/admin-auth.js.map +1 -0
  5. package/dist/app.d.ts +182 -0
  6. package/dist/app.js +218 -0
  7. package/dist/app.js.map +1 -0
  8. package/dist/cli.d.ts +2 -0
  9. package/dist/cli.js +3495 -0
  10. package/dist/cli.js.map +1 -0
  11. package/dist/compute-ssh.d.ts +246 -0
  12. package/dist/compute-ssh.js +577 -0
  13. package/dist/compute-ssh.js.map +1 -0
  14. package/dist/config.d.ts +46 -0
  15. package/dist/config.js +183 -0
  16. package/dist/config.js.map +1 -0
  17. package/dist/credential-store.d.ts +4 -0
  18. package/dist/credential-store.js +180 -0
  19. package/dist/credential-store.js.map +1 -0
  20. package/dist/mascot-data.d.ts +1 -0
  21. package/dist/mascot-data.js +14 -0
  22. package/dist/mascot-data.js.map +1 -0
  23. package/dist/pay.d.ts +60 -0
  24. package/dist/pay.js +483 -0
  25. package/dist/pay.js.map +1 -0
  26. package/dist/sdk.d.ts +259 -0
  27. package/dist/sdk.js +944 -0
  28. package/dist/sdk.js.map +1 -0
  29. package/dist/social-queue.d.ts +125 -0
  30. package/dist/social-queue.js +340 -0
  31. package/dist/social-queue.js.map +1 -0
  32. package/dist/social-vault.d.ts +118 -0
  33. package/dist/social-vault.js +268 -0
  34. package/dist/social-vault.js.map +1 -0
  35. package/dist/social-worker.d.ts +43 -0
  36. package/dist/social-worker.js +155 -0
  37. package/dist/social-worker.js.map +1 -0
  38. package/dist/totp.d.ts +2 -0
  39. package/dist/totp.js +46 -0
  40. package/dist/totp.js.map +1 -0
  41. package/dist/ui.d.ts +77 -0
  42. package/dist/ui.js +441 -0
  43. package/dist/ui.js.map +1 -0
  44. package/dist/vault.d.ts +65 -0
  45. package/dist/vault.js +455 -0
  46. package/dist/vault.js.map +1 -0
  47. package/package.json +75 -0
package/dist/sdk.d.ts ADDED
@@ -0,0 +1,259 @@
1
+ /**
2
+ * Palmyr SDK — programmatic access to all Palmyr services.
3
+ */
4
+ export declare class Palmyr {
5
+ api: string;
6
+ token?: string;
7
+ passphrase?: string;
8
+ private autoPay;
9
+ constructor(apiUrl?: string, autoPay?: boolean, token?: string, passphrase?: string);
10
+ private request;
11
+ phoneSearch(country: string, limit?: number): Promise<any>;
12
+ phoneBuy(country: string, areaCode?: string): Promise<any>;
13
+ phoneSms(phoneId: string, to: string, body: string): Promise<any>;
14
+ phoneCall(phoneId: string, to: string, tts?: string): Promise<any>;
15
+ emailCreate(name: string, walletAddress?: string, domain?: string): Promise<any>;
16
+ emailListInboxes(): Promise<any>;
17
+ emailDomainStatus(domain: string): Promise<any>;
18
+ emailRegisterDomain(domain: string): Promise<any>;
19
+ emailRead(inboxId: string): Promise<any>;
20
+ emailSend(inboxId: string, to: string, subject: string, body: string): Promise<any>;
21
+ emailThreads(inboxId: string): Promise<any>;
22
+ computePlans(opts?: {
23
+ location?: string;
24
+ }): Promise<any>;
25
+ computeLocations(): Promise<any>;
26
+ /**
27
+ * Deploy a Hetzner Cloud server.
28
+ *
29
+ * `install` controls what cloud-init bootstraps on the server. When set
30
+ * (string or array), it overrides the legacy `installOpenClaw` boolean.
31
+ * Pass `[]` for a vanilla Ubuntu box (cloud-init skipped, password auth
32
+ * stays enabled). Discoverable via `GET /compute/install-recipes`.
33
+ *
34
+ * `location` picks a Hetzner datacenter slug (fsn1, nbg1, hel1, ash, hil,
35
+ * sin). The server validates type-vs-location compatibility pre-payment so
36
+ * cax11+ash fails as 400 with `Try one of: fsn1` instead of 422 after
37
+ * x402 settles. Discoverable via `GET /compute/locations`.
38
+ */
39
+ computeDeploy(name: string, serverType: string, opts?: {
40
+ sshPublicKey?: string;
41
+ sshKeyIds?: number[];
42
+ installOpenClaw?: boolean;
43
+ install?: string | string[];
44
+ location?: string;
45
+ }): Promise<any>;
46
+ /**
47
+ * Rename a deployed server. Metadata-only; doesn't reboot. Local server
48
+ * cache is updated by the CLI wrapper after a successful API call.
49
+ */
50
+ computeRename(serverId: string, newName: string): Promise<any>;
51
+ computeInstallRecipes(): Promise<any>;
52
+ computeList(): Promise<any>;
53
+ computeDelete(serverId: string): Promise<any>;
54
+ /**
55
+ * Inject your SSH public key into a freshly-deployed VPS, remove the
56
+ * platform's temporary key, and lock the root password. After this call,
57
+ * only your key can SSH into the box.
58
+ */
59
+ computeSetupSsh(serverId: string, publicKey: string): Promise<any>;
60
+ computeSshKeyAdd(name: string, publicKey: string): Promise<any>;
61
+ computeSshKeyList(): Promise<any>;
62
+ computeSshKeyDelete(id: number | string): Promise<any>;
63
+ computeGet(serverId: string): Promise<any>;
64
+ /**
65
+ * Run a single command on a freshly-deployed server via the platform's
66
+ * SSH key. Pre-handoff only — once `compute setup-ssh` has run we no
67
+ * longer have access. `command` and `args` are POSIX-quoted server-side
68
+ * so they pass through as distinct argv elements on the remote shell.
69
+ */
70
+ computeExec(serverId: string, command: string, args?: string[], opts?: {
71
+ timeoutSec?: number;
72
+ }): Promise<any>;
73
+ computeAction(serverId: string, action: string, opts?: {
74
+ image?: string;
75
+ }): Promise<any>;
76
+ domainCheck(domain: string): Promise<any>;
77
+ domainList(): Promise<any>;
78
+ domainPricing(domain: string): Promise<any>;
79
+ domainBuy(domain: string): Promise<any>;
80
+ domainDns(domain: string): Promise<any>;
81
+ domainTransferOwnership(domain: string, newOwner: string): Promise<any>;
82
+ walletCreate(label?: string, chains?: string[], mode?: 'unmanaged' | 'managed'): Promise<any>;
83
+ walletImport(mnemonic: string, label?: string, mode?: 'unmanaged' | 'managed'): Promise<any>;
84
+ walletList(): Promise<any>;
85
+ walletGet(walletId: string): Promise<any>;
86
+ walletDelete(walletId: string): Promise<any>;
87
+ walletAddresses(walletId: string): Promise<any>;
88
+ walletDerive(walletId: string, chain: string): Promise<any>;
89
+ /** Sign a transaction. Auth resolved from API key or session secret. */
90
+ walletSign(walletId: string, chain: string, transaction: string): Promise<any>;
91
+ walletSignMessage(walletId: string, chain: string, message: string): Promise<any>;
92
+ walletSignTyped(walletId: string, chain: string, typedData: string): Promise<any>;
93
+ walletPolicy(walletId: string, policy: {
94
+ per_tx_usdc?: number;
95
+ daily_usdc?: number;
96
+ allowed_chains?: string[];
97
+ }): Promise<any>;
98
+ walletGetPolicy(walletId: string): Promise<any>;
99
+ walletSpending(walletId: string): Promise<any>;
100
+ walletApiKey(walletId: string, name: string, sessionSecret: string, policyIds?: string[], expiresAt?: string): Promise<any>;
101
+ walletRevokeApiKey(walletId: string, keyId: string): Promise<any>;
102
+ walletConfig(walletId: string, sessionSecret: string): Promise<any>;
103
+ walletRequestApproval(walletId: string, action: string, params: Record<string, any>): Promise<any>;
104
+ socialTwitterLogin(accountId: string, login: string, password: string, totpSeed?: string, cookies?: {
105
+ auth_token?: string;
106
+ ct0?: string;
107
+ }, proxySessionId?: string): Promise<any>;
108
+ socialTwitterRegister(username: string, password: string, opts?: {
109
+ login?: string;
110
+ email?: string;
111
+ email_password?: string;
112
+ totp_seed?: string;
113
+ auth_token?: string;
114
+ ct0?: string;
115
+ country?: string;
116
+ }): Promise<any>;
117
+ socialTwitterUnregister(accountId: string): Promise<any>;
118
+ socialTwitterListRegistered(): Promise<any>;
119
+ socialScheduledPost(accountId: string, text: string, postAt: string, communityId?: string): Promise<any>;
120
+ socialScheduledThread(accountId: string, texts: string[], postAt: string, communityId?: string): Promise<any>;
121
+ socialScheduledMedia(accountId: string, text: string, media: Array<{
122
+ image_base64?: string;
123
+ image_url?: string;
124
+ video_base64?: string;
125
+ video_url?: string;
126
+ }>, postAt: string, communityId?: string): Promise<any>;
127
+ socialScheduledList(filter?: {
128
+ accountId?: string;
129
+ status?: 'pending' | 'in_progress' | 'completed' | 'failed' | 'cancelled';
130
+ from?: string;
131
+ to?: string;
132
+ limit?: number;
133
+ }): Promise<any>;
134
+ socialScheduledCancel(id: string): Promise<any>;
135
+ socialTwitterPost(accountId: string, cookies: any[], text: string, proxySessionId?: string, communityId?: string): Promise<any>;
136
+ socialTwitterPostThread(accountId: string, cookies: any[], texts: string[], proxySessionId?: string, communityId?: string): Promise<any>;
137
+ socialTwitterPostWithMedia(accountId: string, cookies: any[], text: string, media: Array<{
138
+ image_base64?: string;
139
+ image_url?: string;
140
+ video_base64?: string;
141
+ video_url?: string;
142
+ }>, proxySessionId?: string, communityId?: string): Promise<any>;
143
+ socialTwitterListMyTweets(accountId: string, cookies: any[], limit?: number, proxySessionId?: string): Promise<any>;
144
+ socialTwitterReply(accountId: string, cookies: any[], tweetUrl: string, text: string, proxySessionId?: string): Promise<any>;
145
+ socialTwitterLike(accountId: string, cookies: any[], tweetUrl: string, proxySessionId?: string): Promise<any>;
146
+ socialTwitterRetweet(accountId: string, cookies: any[], tweetUrl: string, proxySessionId?: string): Promise<any>;
147
+ socialTwitterFollow(accountId: string, cookies: any[], targetUser: string, proxySessionId?: string): Promise<any>;
148
+ socialTwitterUnfollow(accountId: string, cookies: any[], targetUser: string, proxySessionId?: string): Promise<any>;
149
+ socialTwitterDelete(accountId: string, cookies: any[], tweetUrl: string, proxySessionId?: string): Promise<any>;
150
+ socialTwitterProfile(accountId: string, cookies: any[], patch: {
151
+ bio?: string;
152
+ display_name?: string;
153
+ location?: string;
154
+ website?: string;
155
+ }, proxySessionId?: string): Promise<any>;
156
+ socialTwitterAvatar(accountId: string, cookies: any[], image: {
157
+ image_base64?: string;
158
+ image_url?: string;
159
+ }, proxySessionId?: string): Promise<any>;
160
+ socialTwitterBanner(accountId: string, cookies: any[], image: {
161
+ image_base64?: string;
162
+ image_url?: string;
163
+ }, proxySessionId?: string): Promise<any>;
164
+ socialTwitterUsername(accountId: string, cookies: any[], newUsername: string, password: string, proxySessionId?: string): Promise<any>;
165
+ socialTwitterBuy(country?: string, ageCategory?: string): Promise<any>;
166
+ /**
167
+ * Log a TikTok account in. Two paths:
168
+ * - Cookie injection: pass `sessionid` (+ optional `tt_csrf_token`, `tt_webid_v2`).
169
+ * - Form login: pass `login` + `password` — server uses CapSolver
170
+ * to handle any captcha and harvests the cookies.
171
+ * Either path returns the full cookie jar for the caller to cache locally.
172
+ */
173
+ socialTiktokLogin(accountId: string, opts: {
174
+ sessionid?: string;
175
+ ttCsrfToken?: string;
176
+ ttWebidV2?: string;
177
+ extraCookies?: Array<{
178
+ name: string;
179
+ value: string;
180
+ domain?: string;
181
+ path?: string;
182
+ }>;
183
+ login?: string;
184
+ password?: string;
185
+ email?: string;
186
+ emailPassword?: string;
187
+ proxySessionId?: string;
188
+ country?: string;
189
+ }): Promise<any>;
190
+ socialTiktokPost(accountId: string, cookies: any[], caption: string, media: {
191
+ video_base64?: string;
192
+ video_url?: string;
193
+ }, opts?: {
194
+ privacy?: 0 | 1 | 2;
195
+ allow_comments?: boolean;
196
+ allow_duet?: boolean;
197
+ allow_stitch?: boolean;
198
+ }, proxySessionId?: string, country?: string): Promise<any>;
199
+ socialTiktokFollow(accountId: string, cookies: any[], targetUser: string, proxySessionId?: string, country?: string): Promise<any>;
200
+ socialTiktokLike(accountId: string, cookies: any[], videoUrl: string, proxySessionId?: string, country?: string): Promise<any>;
201
+ socialTiktokDelete(accountId: string, cookies: any[], videoUrl: string, proxySessionId?: string, country?: string): Promise<any>;
202
+ socialTiktokProfile(accountId: string, cookies: any[], patch: {
203
+ bio?: string;
204
+ display_name?: string;
205
+ }, proxySessionId?: string, country?: string): Promise<any>;
206
+ socialTiktokAvatar(accountId: string, cookies: any[], image: {
207
+ image_base64?: string;
208
+ image_url?: string;
209
+ }, proxySessionId?: string, country?: string): Promise<any>;
210
+ pricing(): Promise<any>;
211
+ health(): Promise<any>;
212
+ /**
213
+ * Generate an i402 plan from a natural-language intent.
214
+ * Returns the plan body (from the 402 response) or a clarification request.
215
+ * Auto-pays the $0.10 orchestration fee unless autoPay is disabled.
216
+ */
217
+ chat(intent: string, options: {
218
+ budgetUsdc: number;
219
+ quality?: 'fast' | 'cheap' | 'best';
220
+ params?: Record<string, unknown>;
221
+ constraints?: {
222
+ excludeCapabilities?: string[];
223
+ excludeProviders?: string[];
224
+ requireProviders?: string[];
225
+ };
226
+ sessionId?: string;
227
+ deadlineSeconds?: number;
228
+ approve?: boolean;
229
+ autoApproveUnderUsdc?: number;
230
+ }): Promise<any>;
231
+ /**
232
+ * Client-side executor for an i402 plan.
233
+ *
234
+ * i402 v0.1 is agent-side-execution-only: the server returns a plan and stops;
235
+ * this function iterates the plan's steps in topological order, signs a real
236
+ * x402 payment for each step (via paidRequest), calls the endpoint, resolves
237
+ * $STEPS.sN.output.field references into later-step inputs locally, and yields
238
+ * events to the caller so a CLI or agent framework can render progress.
239
+ *
240
+ * Every step's x402 payment is a real on-chain transaction signed by this
241
+ * client's wallet — no server-side escrow, no custodial proxy.
242
+ *
243
+ * Usage:
244
+ * const plan = await ao.chat("launch a brand", { budgetUsdc: 60 })
245
+ * for await (const event of ao.chatExecute(plan)) {
246
+ * console.log(event.type, event)
247
+ * }
248
+ */
249
+ chatExecute(plan: any, options?: {
250
+ stopOnFailure?: boolean;
251
+ }): AsyncGenerator<any, void, undefined>;
252
+ chatGetSession(sessionId: string): Promise<any>;
253
+ chatCancel(sessionId: string): Promise<any>;
254
+ chatListSessions(): Promise<any>;
255
+ chatListCapabilities(): Promise<any>;
256
+ chatListProviders(capability?: string): Promise<any>;
257
+ private requestWithHeaders;
258
+ }
259
+ export default Palmyr;