@ujexdev/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 (2) hide show
  1. package/dist/index.js +14 -8
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -36,7 +36,7 @@ const HELP = `ujex <command>
36
36
 
37
37
  init <agentId> <deviceKey> save credentials to ~/.config/ujex/config.json
38
38
  whoami print agentId and scopes
39
- send <to> <subject> <body> [--require-human] [--approval-ttl=N]
39
+ send <to> <subject> <body> --session=ID [--require-human] [--approval-ttl=N]
40
40
  send a Postbox email
41
41
  ask <prompt> ask the human for approval
42
42
  search <query> search Recall/Memory
@@ -52,8 +52,8 @@ const HELP = `ujex <command>
52
52
 
53
53
  tools register <agentId> <name> <kind> <url> [--auth-token=<t>] [--connection-id=<id>]
54
54
  tools list
55
- tools invoke <name> [--args=<json>] [--timeout-ms=N]
56
- tools cred <name> escape hatch decrypt auth token
55
+ tools invoke <name> --session=ID [--args=<json>] [--timeout-ms=N] [--approval-id=ID]
56
+ tools cred <name> deprecated; credentials stay server-side
57
57
  tools connection-register <agentId> <provider> [--scopes=a,b] [--access-token=<t>] [--refresh-token=<t>]
58
58
  tools connections [agentId]
59
59
  tools revoke-connection <agentId> <connectionId>
@@ -235,14 +235,16 @@ async function main() {
235
235
  }
236
236
  case 'send': {
237
237
  const [to, subject, ...body] = args;
238
- if (!to || !subject)
239
- throw new Error('usage: ujex send <to> <subject> <body>');
238
+ const sessionId = flagValue(args, '--session=');
239
+ if (!to || !subject || !sessionId)
240
+ throw new Error('usage: ujex send <to> <subject> <body> --session=ID');
240
241
  const ttlRaw = flagValue(args, '--approval-ttl=');
241
242
  const approvalTtlSec = ttlRaw ? Number(ttlRaw) : undefined;
242
243
  const r = await ap.postbox.send({
243
244
  to: [to],
244
245
  subject,
245
246
  body: withoutFlags(body).join(' '),
247
+ sessionId,
246
248
  requireHuman: hasFlag(args, '--require-human'),
247
249
  approvalTtlSec,
248
250
  });
@@ -368,12 +370,16 @@ async function main() {
368
370
  }
369
371
  else if (sub === 'invoke') {
370
372
  const [name] = rest;
371
- if (!name)
372
- throw new Error('usage: ujex tools invoke <name> [--args=<json>] [--timeout-ms=N]');
373
+ const sessionId = flagValue(rest, '--session=');
374
+ if (!name || !sessionId)
375
+ throw new Error('usage: ujex tools invoke <name> --session=ID [--args=<json>] [--timeout-ms=N] [--approval-id=ID]');
373
376
  const toolArgs = parseJSONFlag(rest, '--args=');
374
377
  const tmRaw = flagValue(rest, '--timeout-ms=');
375
378
  const timeoutMs = tmRaw ? Number(tmRaw) : undefined;
376
- const r = await ap.tools.invoke({ name, args: toolArgs, timeoutMs });
379
+ const approvalId = flagValue(rest, '--approval-id=');
380
+ const r = await ap.tools.invoke({
381
+ name, args: toolArgs, timeoutMs, sessionId, approvalId,
382
+ });
377
383
  console.log(JSON.stringify(r, null, 2));
378
384
  }
379
385
  else if (sub === 'cred') {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ujexdev/cli",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "Command-line client for Ujex Postbox, approvals, Recall/Memory, Gateway, tools, and audit exports.",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Ujex <hello@ujex.dev>",
@@ -31,7 +31,7 @@
31
31
  },
32
32
  "dependencies": {
33
33
  "@ujexdev/audit-chain": "^0.2.0",
34
- "@ujexdev/client": "^0.1.0",
34
+ "@ujexdev/client": ">=0.1.0 <0.3.0",
35
35
  "firebase": "^12.13.0"
36
36
  },
37
37
  "devDependencies": {