@kivel.io/cli 0.6.1 → 0.8.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.
- package/CHANGELOG.md +22 -0
- package/README.md +13 -0
- package/dist/agent-commands.js +67 -0
- package/dist/commands.d.ts +1 -1
- package/dist/commands.js +13 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# @kivel.io/cli
|
|
2
2
|
|
|
3
|
+
## 0.8.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 7290344: Add test wallets, x402 paywalls and mock checkouts with approval-aware payments, ledgers and test outcome controls.
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [7290344]
|
|
12
|
+
- @kivel.io/sdk@0.8.0
|
|
13
|
+
|
|
14
|
+
## 0.7.0
|
|
15
|
+
|
|
16
|
+
### Minor Changes
|
|
17
|
+
|
|
18
|
+
- 7cbd3fc: Add workspace credential storage, password generation and approved reveals.
|
|
19
|
+
|
|
20
|
+
### Patch Changes
|
|
21
|
+
|
|
22
|
+
- Updated dependencies [7cbd3fc]
|
|
23
|
+
- @kivel.io/sdk@0.7.0
|
|
24
|
+
|
|
3
25
|
## 0.6.1
|
|
4
26
|
|
|
5
27
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -82,3 +82,16 @@ kivel oauth delete <id>
|
|
|
82
82
|
Use `oauth list` to list workspace providers. Configure your OAuth client with the
|
|
83
83
|
returned discovery URL and S256 PKCE. See the [OAuth guide](https://kivel.io/docs/mock-oauth/)
|
|
84
84
|
for headless approval, refresh tokens and failure scenarios. This service is for tests only.
|
|
85
|
+
|
|
86
|
+
## Workspace vault
|
|
87
|
+
|
|
88
|
+
Pipe `{ "name": "Example", "url": "example.com", "username": "agent@example.com" }`
|
|
89
|
+
to `kivel credential save` to generate and save a password. Include `password`
|
|
90
|
+
to store an existing value. List with `kivel credential list`, or inspect
|
|
91
|
+
metadata with `kivel credential inspect <id>`.
|
|
92
|
+
|
|
93
|
+
`kivel credential reveal <id>` returns an approval link by default. After the
|
|
94
|
+
human approves, repeat with `--approval-id <id>`. An approval permits one reveal.
|
|
95
|
+
Use `kivel password generate --length 24` to generate without storing.
|
|
96
|
+
Write keys are required for saves and reveals. Agent access settings stay with
|
|
97
|
+
the signed-in workspace owner or admin.
|
package/dist/agent-commands.js
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
export function needsInput(args) {
|
|
2
2
|
return (['run', 'upload'].includes(args[0] ?? '') ||
|
|
3
|
+
(['test-wallet', 'test-paywall', 'test-checkout'].includes(args[0] ?? '') &&
|
|
4
|
+
['create', 'update', 'pay', 'top-up', 'complete', 'confirm'].includes(args[1] ?? '')) ||
|
|
3
5
|
(args[0] === 'api' && !['GET', 'HEAD', 'OPTIONS', 'DELETE'].includes(args[1] ?? '')) ||
|
|
4
6
|
(args[0] === 'agent' && args[1] === 'token') ||
|
|
5
7
|
(args[0] === 'memory' && args[1] === 'set') ||
|
|
6
8
|
(args[0] === 'authenticator' && args[1] === 'add') ||
|
|
9
|
+
(args[0] === 'credential' && ['save', 'update'].includes(args[1] ?? '')) ||
|
|
7
10
|
(args[0] === 'approval' && args[1] === 'ask') ||
|
|
8
11
|
(args[0] === 'monitor' && args[1] === 'create') ||
|
|
9
12
|
(args[0] === 'email' && ['draft-create', 'draft-submit'].includes(args[1] ?? '')) ||
|
|
@@ -55,6 +58,10 @@ export async function agentCommand(client, args, input) {
|
|
|
55
58
|
allowed.add('--cursor');
|
|
56
59
|
allowed.add('--limit');
|
|
57
60
|
}
|
|
61
|
+
if (group === 'credential' && action === 'reveal')
|
|
62
|
+
allowed.add('--approval-id');
|
|
63
|
+
if (group === 'password' && action === 'generate')
|
|
64
|
+
allowed.add('--length');
|
|
58
65
|
if (group === 'agent' && ['login', 'trial'].includes(action ?? ''))
|
|
59
66
|
allowed.add('--client');
|
|
60
67
|
if (group === 'agent' && action === 'trial')
|
|
@@ -115,6 +122,8 @@ export async function agentCommand(client, args, input) {
|
|
|
115
122
|
const idempotencyKey = take('--idempotency-key');
|
|
116
123
|
const emailSettings = { activeDays: number('--active-days'), localPart: take('--local-part') };
|
|
117
124
|
const threadPage = { cursor: take('--cursor'), limit: number('--limit') };
|
|
125
|
+
const approvalId = take('--approval-id');
|
|
126
|
+
const passwordLength = number('--length');
|
|
118
127
|
if (flags.size)
|
|
119
128
|
throw new Error(`Unknown option: ${flags.keys().next().value}`);
|
|
120
129
|
const exact = (count) => {
|
|
@@ -170,6 +179,64 @@ export async function agentCommand(client, args, input) {
|
|
|
170
179
|
return client.agents();
|
|
171
180
|
}
|
|
172
181
|
}
|
|
182
|
+
if (['test-wallet', 'test-paywall', 'test-checkout'].includes(group ?? '')) {
|
|
183
|
+
const kind = group === 'test-wallet'
|
|
184
|
+
? 'wallets'
|
|
185
|
+
: group === 'test-paywall'
|
|
186
|
+
? 'paywalls'
|
|
187
|
+
: 'checkouts';
|
|
188
|
+
if (action === 'create') {
|
|
189
|
+
exact(0);
|
|
190
|
+
const input = json();
|
|
191
|
+
return kind === 'wallets'
|
|
192
|
+
? client.createTestWallet(input)
|
|
193
|
+
: kind === 'paywalls'
|
|
194
|
+
? client.createTestPaywall(input)
|
|
195
|
+
: client.createTestCheckout(input);
|
|
196
|
+
}
|
|
197
|
+
if (action === 'list') {
|
|
198
|
+
exact(0);
|
|
199
|
+
return client.testPayments(kind);
|
|
200
|
+
}
|
|
201
|
+
if (action === 'inspect' || action === 'balance')
|
|
202
|
+
return client.testPayment(kind, id());
|
|
203
|
+
if (action === 'update')
|
|
204
|
+
return client.updateTestPayment(kind, id(), json());
|
|
205
|
+
if (action === 'delete')
|
|
206
|
+
return client.deleteTestPayment(kind, id());
|
|
207
|
+
if (group === 'test-wallet' && action === 'pay')
|
|
208
|
+
return client.walletPay(id(), json());
|
|
209
|
+
if (group === 'test-wallet' && action === 'top-up')
|
|
210
|
+
return client.topUpTestWallet(id(), json().amount);
|
|
211
|
+
if (group === 'test-wallet' && action === 'transactions')
|
|
212
|
+
return client.listWalletTransactions(id());
|
|
213
|
+
if (group === 'test-checkout' && action === 'complete')
|
|
214
|
+
return client.completeTestCheckout(id(), json());
|
|
215
|
+
if (group === 'test-checkout' && action === 'confirm')
|
|
216
|
+
return client.confirmTestCheckout(id(), json().confirmationToken);
|
|
217
|
+
}
|
|
218
|
+
if (group === 'credential') {
|
|
219
|
+
if (action === 'save') {
|
|
220
|
+
exact(0);
|
|
221
|
+
return client.saveCredential(json());
|
|
222
|
+
}
|
|
223
|
+
if (action === 'list') {
|
|
224
|
+
exact(0);
|
|
225
|
+
return client.credentials();
|
|
226
|
+
}
|
|
227
|
+
if (action === 'inspect')
|
|
228
|
+
return client.credential(id());
|
|
229
|
+
if (action === 'update')
|
|
230
|
+
return client.updateCredential(id(), json());
|
|
231
|
+
if (action === 'delete')
|
|
232
|
+
return client.deleteCredential(id());
|
|
233
|
+
if (action === 'reveal')
|
|
234
|
+
return client.revealCredential(id(), approvalId);
|
|
235
|
+
}
|
|
236
|
+
if (group === 'password' && action === 'generate') {
|
|
237
|
+
exact(0);
|
|
238
|
+
return client.generatePassword(passwordLength);
|
|
239
|
+
}
|
|
173
240
|
if (group === 'authenticator') {
|
|
174
241
|
if (action === 'add') {
|
|
175
242
|
exact(0);
|
package/dist/commands.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { needsInput } from './agent-commands.js';
|
|
2
2
|
import type { Kivel } from '@kivel.io/sdk';
|
|
3
|
-
export declare const help = "kivel tools | usage | resources\nkivel --version\nkivel plans | activity\nkivel agent login <name> [--client <client>]\nkivel agent token < login.json\nkivel agent trial <name> [--human-email <email>] [--client <client>]\nkivel agent list\nkivel authenticator add < authenticator.json\nkivel authenticator list|code|delete [id]\nkivel authenticator rename <id> <name>\nkivel email attachment|download-attachment <inbox-id> <message-id> <attachment-id>\nkivel email create [--active-days <1-7>] [--local-part <paid-address>]\nkivel email list\nkivel email clear <id>\nkivel email forward <id> [--token <token>] < forwarding.json\nkivel email send <id> --idempotency-key <unique-key> < message.json\nkivel event wait [--timeout-seconds <1-30>] < sources.json\nkivel email threads [inbox-id] [--cursor <cursor>] [--limit <n>]\nkivel email thread <inbox-id> <thread-id>\nkivel email drafts|rules <inbox-id>\nkivel email draft-create <inbox-id> < content.json\nkivel email draft-inspect|draft-delete <draft-id>\nkivel email draft-submit <draft-id> [< settings.json]\nkivel email messages|wait <id> [--token <token>] [--after <id>] [--timeout-seconds <n>]\nkivel memory set <namespace> <key> [--ttl-seconds <n>] < value.json\nkivel memory get|delete <namespace> <key>\nkivel memory list <namespace> [--prefix <prefix>]\nkivel monitor create < monitor.json\nkivel monitor list|inspect|pause|resume|delete [id]\nkivel monitor ping|fail <ping-token>\nkivel monitor accept-dns <id>\nkivel job create [--ttl-seconds <n>] < job.json\nkivel job list|inspect|cancel [id]\nkivel status-page create|update [id] < page.json\nkivel smtp create [--ttl-seconds <n>]\nkivel smtp rotate <id>\nkivel phone available [US-area-code]\nkivel phone create <E.164-number> --idempotency-key <unique-key>\nkivel phone list|release|messages|wait [id] [--after <id>] [--timeout-seconds <n>]\nkivel approval ask < question.json\nkivel approval list|pending|inspect|wait [id] [--timeout-seconds <n>]\nkivel inbox requests|wait|deliveries <id> [--token <token>]\nkivel inbox response|forward <id> [--token <token>] < settings.json\nkivel oauth create [--ttl-seconds <n>] < provider.json\nkivel oauth update <id> < provider.json\nkivel oauth list|inspect|calls|renew|delete [id]\nkivel mock create|update [id] < config.json\nkivel mock calls|reset <id> [--token <token>]\nkivel mcp-server create < config.json\nkivel inbox|email|mock|mcp-server|file inspect|delete|renew <id> [--token <token>]\nkivel inbox|mock|mcp-server|file sharing <id> --visibility private|public [--token <token>]\nkivel describe <tool-id>\nkivel run <tool-id> [--file <filename>] [--options '{\"action\":\"minify\"}'] < input.txt\nkivel inbox create [--visibility private|public]\nkivel listen <inbox-id> [--token <inspection-token>] [--forward http://localhost:3000] [--all]\nkivel api <GET|HEAD|OPTIONS|POST|PUT|PATCH|DELETE> /api/path-or-/mock/path [--token <resource-token>] < body.json\nkivel upload <filename> [--visibility private|public] [--max-downloads 1] < file.bin\nkivel download <file-id> [--access-token token] > file.bin\n\nSet KIVEL_URL and KIVEL_API_KEY. Commands output JSON; downloads output binary; help is plain text. Mutations are never retried. Authenticators are only for accounts your human asked you to create or operate. Attachment downloads output untrusted binary files; attachment links expire in two minutes.\nCreation also accepts --ttl-seconds <n> and --persistent. Webhook receiving is public by default; inspection always needs workspace credentials or the inspection token. Use inbox create --visibility private only when senders can add X-Access-Token. Other resources default to private.";
|
|
3
|
+
export declare const help = "kivel tools | usage | resources\nkivel --version\nkivel plans | activity\nkivel agent login <name> [--client <client>]\nkivel agent token < login.json\nkivel agent trial <name> [--human-email <email>] [--client <client>]\nkivel agent list\nkivel authenticator add < authenticator.json\nkivel authenticator list|code|delete [id]\nkivel authenticator rename <id> <name>\nkivel email attachment|download-attachment <inbox-id> <message-id> <attachment-id>\nkivel email create [--active-days <1-7>] [--local-part <paid-address>]\nkivel email list\nkivel email clear <id>\nkivel email forward <id> [--token <token>] < forwarding.json\nkivel email send <id> --idempotency-key <unique-key> < message.json\nkivel event wait [--timeout-seconds <1-30>] < sources.json\nkivel test-wallet create|list|inspect|update|delete [id]\nkivel test-wallet balance|transactions <id>\nkivel test-wallet pay|top-up <id> < test-payment.json\nkivel test-paywall create|list|inspect|update|delete [id]\nkivel test-checkout create|list|inspect|update|delete [id]\nkivel test-checkout complete|confirm <id> < test-checkout.json\nTest payments use fake units only. Create/update read JSON from stdin. Agent keys cannot set wallet limits; only a human owner/admin can. Resume approval with the same payment idempotencyKey.\nkivel credential save < credential.json\nkivel credential list\nkivel credential inspect|delete <id>\nkivel credential update <id> < changes.json\nkivel credential reveal <id> [--approval-id <id>]\nkivel password generate [--length <n>]\nkivel email threads [inbox-id] [--cursor <cursor>] [--limit <n>]\nkivel email thread <inbox-id> <thread-id>\nkivel email drafts|rules <inbox-id>\nkivel email draft-create <inbox-id> < content.json\nkivel email draft-inspect|draft-delete <draft-id>\nkivel email draft-submit <draft-id> [< settings.json]\nkivel email messages|wait <id> [--token <token>] [--after <id>] [--timeout-seconds <n>]\nkivel memory set <namespace> <key> [--ttl-seconds <n>] < value.json\nkivel memory get|delete <namespace> <key>\nkivel memory list <namespace> [--prefix <prefix>]\nkivel monitor create < monitor.json\nkivel monitor list|inspect|pause|resume|delete [id]\nkivel monitor ping|fail <ping-token>\nkivel monitor accept-dns <id>\nkivel job create [--ttl-seconds <n>] < job.json\nkivel job list|inspect|cancel [id]\nkivel status-page create|update [id] < page.json\nkivel smtp create [--ttl-seconds <n>]\nkivel smtp rotate <id>\nkivel phone available [US-area-code]\nkivel phone create <E.164-number> --idempotency-key <unique-key>\nkivel phone list|release|messages|wait [id] [--after <id>] [--timeout-seconds <n>]\nkivel approval ask < question.json\nkivel approval list|pending|inspect|wait [id] [--timeout-seconds <n>]\nkivel inbox requests|wait|deliveries <id> [--token <token>]\nkivel inbox response|forward <id> [--token <token>] < settings.json\nkivel oauth create [--ttl-seconds <n>] < provider.json\nkivel oauth update <id> < provider.json\nkivel oauth list|inspect|calls|renew|delete [id]\nkivel mock create|update [id] < config.json\nkivel mock calls|reset <id> [--token <token>]\nkivel mcp-server create < config.json\nkivel inbox|email|mock|mcp-server|file inspect|delete|renew <id> [--token <token>]\nkivel inbox|mock|mcp-server|file sharing <id> --visibility private|public [--token <token>]\nkivel describe <tool-id>\nkivel run <tool-id> [--file <filename>] [--options '{\"action\":\"minify\"}'] < input.txt\nkivel inbox create [--visibility private|public]\nkivel listen <inbox-id> [--token <inspection-token>] [--forward http://localhost:3000] [--all]\nkivel api <GET|HEAD|OPTIONS|POST|PUT|PATCH|DELETE> /api/path-or-/mock/path [--token <resource-token>] < body.json\nkivel upload <filename> [--visibility private|public] [--max-downloads 1] < file.bin\nkivel download <file-id> [--access-token token] > file.bin\n\nSet KIVEL_URL and KIVEL_API_KEY. Commands output JSON; downloads output binary; help is plain text. Mutations are never retried. Authenticators are only for accounts your human asked you to create or operate. Attachment downloads output untrusted binary files; attachment links expire in two minutes.\nCreation also accepts --ttl-seconds <n> and --persistent. Webhook receiving is public by default; inspection always needs workspace credentials or the inspection token. Use inbox create --visibility private only when senders can add X-Access-Token. Other resources default to private.";
|
|
4
4
|
export declare function command(client: Kivel, args: string[], input?: Uint8Array): Promise<unknown>;
|
package/dist/commands.js
CHANGED
|
@@ -18,6 +18,19 @@ kivel email clear <id>
|
|
|
18
18
|
kivel email forward <id> [--token <token>] < forwarding.json
|
|
19
19
|
kivel email send <id> --idempotency-key <unique-key> < message.json
|
|
20
20
|
kivel event wait [--timeout-seconds <1-30>] < sources.json
|
|
21
|
+
kivel test-wallet create|list|inspect|update|delete [id]
|
|
22
|
+
kivel test-wallet balance|transactions <id>
|
|
23
|
+
kivel test-wallet pay|top-up <id> < test-payment.json
|
|
24
|
+
kivel test-paywall create|list|inspect|update|delete [id]
|
|
25
|
+
kivel test-checkout create|list|inspect|update|delete [id]
|
|
26
|
+
kivel test-checkout complete|confirm <id> < test-checkout.json
|
|
27
|
+
Test payments use fake units only. Create/update read JSON from stdin. Agent keys cannot set wallet limits; only a human owner/admin can. Resume approval with the same payment idempotencyKey.
|
|
28
|
+
kivel credential save < credential.json
|
|
29
|
+
kivel credential list
|
|
30
|
+
kivel credential inspect|delete <id>
|
|
31
|
+
kivel credential update <id> < changes.json
|
|
32
|
+
kivel credential reveal <id> [--approval-id <id>]
|
|
33
|
+
kivel password generate [--length <n>]
|
|
21
34
|
kivel email threads [inbox-id] [--cursor <cursor>] [--limit <n>]
|
|
22
35
|
kivel email thread <inbox-id> <thread-id>
|
|
23
36
|
kivel email drafts|rules <inbox-id>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kivel.io/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"bin": {
|
|
6
6
|
"kivel": "./bin/kivel.mjs"
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"CHANGELOG.md"
|
|
19
19
|
],
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@kivel.io/sdk": "0.
|
|
21
|
+
"@kivel.io/sdk": "0.8.0"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
24
|
"@types/node": "^26.6.5",
|