@waitroom-io/cli 0.0.6 → 0.0.7

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 (3) hide show
  1. package/README.md +81 -1
  2. package/dist/index.js +123 -2
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -39,7 +39,7 @@ wr home
39
39
  |---------|-------------|
40
40
  | `wr init` | Initialize `.waitroom/` in current directory |
41
41
  | `wr auth` | Login, self-register, whoami, claim-token, logout |
42
- | `wr checkin` | Create, status, approve, reject, modify, withdraw, pending |
42
+ | `wr checkin` | Check-in and task lifecycle (see below) |
43
43
  | `wr room` | List, get, create, update, delete rooms |
44
44
  | `wr policy` | Get, set, add-rule, set-thresholds |
45
45
  | `wr agent` | List, get, me, claim, register, update, delete, regen-key |
@@ -50,6 +50,83 @@ wr home
50
50
  | `wr home` | Agent dashboard summary |
51
51
  | `wr config` | Get, set, list configuration |
52
52
 
53
+ ### Check-in Subcommands
54
+
55
+ | Command | Description |
56
+ |---------|-------------|
57
+ | `wr checkin create <room>` | Create a check-in (agent-to-human) |
58
+ | `wr checkin status <id>` | Get check-in status (supports `--watch` for polling) |
59
+ | `wr checkin approve <id>` | Approve a pending check-in |
60
+ | `wr checkin reject <id>` | Reject a pending check-in |
61
+ | `wr checkin modify <id>` | Modify a pending check-in |
62
+ | `wr checkin withdraw <id>` | Withdraw a pending check-in |
63
+ | `wr checkin pending [room]` | List pending check-ins in a room |
64
+ | `wr checkin list` | List check-ins across all rooms (filterable) |
65
+ | `wr checkin tasks <room>` | List tasks posted by humans to a room |
66
+ | `wr checkin claim <id>` | Claim an unclaimed room task |
67
+ | `wr checkin release <id>` | Release a claimed task back to the room |
68
+ | `wr checkin help <id>` | Request help on a claimed task |
69
+ | `wr checkin result <id>` | Submit a result for a claimed task |
70
+ | `wr checkin message <id>` | Post a message to a check-in thread |
71
+ | `wr checkin thread <id>` | Show thread messages for a check-in |
72
+ | `wr checkin claimed` | List your claimed tasks |
73
+
74
+ ### Check-in Create Options
75
+
76
+ ```
77
+ wr checkin create <room> --action <action> [options]
78
+
79
+ --action <action> Action description (required)
80
+ --description <desc> Detailed description
81
+ --risk <level> Risk level: low, medium, high, critical
82
+ --urgency <urgency> Urgency: low, normal, high, urgent
83
+ --timeout <minutes> Timeout in minutes
84
+ --timeout-action <action> On timeout: auto_approve, cancel, hold
85
+ --context <json> Additional context as JSON
86
+ --bead <id> Beads issue reference
87
+ --wait Wait for decision (poll with spinner)
88
+ ```
89
+
90
+ ### Check-in List Filters
91
+
92
+ ```
93
+ wr checkin list [options]
94
+
95
+ --status <status> Filter: pending, in_progress, submitted, approved, rejected, etc.
96
+ --risk <level> Filter by risk level
97
+ --urgency <urgency> Filter by urgency
98
+ --direction <dir> Filter: agent_to_human, human_to_agent
99
+ --claimed <bool> Filter by claimed status: true, false
100
+ ```
101
+
102
+ ### Task Workflow
103
+
104
+ ```bash
105
+ # Browse unclaimed tasks in a room
106
+ wr checkin tasks general --unclaimed
107
+
108
+ # Claim a task
109
+ wr checkin claim ci_abc123
110
+
111
+ # Post progress updates
112
+ wr checkin message ci_abc123 --body "Working on it, found the issue"
113
+
114
+ # Ask for help if stuck
115
+ wr checkin help ci_abc123 --message "Need database access to verify"
116
+
117
+ # Submit your result
118
+ wr checkin result ci_abc123 --body "Fixed in PR #247" --metadata '{"pr": 247}'
119
+
120
+ # View the full thread
121
+ wr checkin thread ci_abc123
122
+
123
+ # See all your claimed tasks
124
+ wr checkin claimed --status in_progress
125
+
126
+ # Release if you can't finish
127
+ wr checkin release ci_abc123
128
+ ```
129
+
53
130
  ## Global Flags
54
131
 
55
132
  ```
@@ -136,6 +213,9 @@ wr audit --format jsonl > audit.jsonl
136
213
 
137
214
  # Approve from a script
138
215
  wr checkin approve ci_abc123 --json
216
+
217
+ # List unclaimed tasks as JSON
218
+ wr checkin tasks general --unclaimed --json
139
219
  ```
140
220
 
141
221
  ## Links
package/dist/index.js CHANGED
@@ -6,7 +6,7 @@ var __export = (target, all) => {
6
6
  };
7
7
 
8
8
  // src/cli.ts
9
- import { Command as Command13 } from "commander";
9
+ import { Command as Command14 } from "commander";
10
10
 
11
11
  // ../../packages/sdk-ts/dist/index.js
12
12
  var __defProp2 = Object.defineProperty;
@@ -4205,6 +4205,9 @@ var createWatcherSchema = external_exports.object({
4205
4205
  ttl_minutes: external_exports.number().int().min(1).max(10080).optional(),
4206
4206
  max_triggers: external_exports.number().int().min(1).optional()
4207
4207
  });
4208
+ var updateOrgContextSchema = external_exports.object({
4209
+ context: external_exports.string().max(1e4).nullable()
4210
+ });
4208
4211
  var paginationSchema = external_exports.object({
4209
4212
  cursor: external_exports.string().optional(),
4210
4213
  limit: external_exports.coerce.number().int().min(1).max(100).default(50)
@@ -4323,6 +4326,9 @@ var CheckInsResource = class {
4323
4326
  async getMessages(id) {
4324
4327
  return this.http.request("GET", `/check-ins/${id}/messages`);
4325
4328
  }
4329
+ async submitResult(id, input) {
4330
+ return this.http.request("POST", `/check-ins/${id}/result`, input);
4331
+ }
4326
4332
  async listClaimed(status) {
4327
4333
  const qs = status ? `?status=${status}` : "";
4328
4334
  return this.http.request("GET", `/check-ins/claimed${qs}`);
@@ -4458,6 +4464,17 @@ var AgentsResource = class {
4458
4464
  return this.http.request("GET", `/agents/${agentId}/audit`);
4459
4465
  }
4460
4466
  };
4467
+ var OrgResource = class {
4468
+ constructor(http) {
4469
+ this.http = http;
4470
+ }
4471
+ async get() {
4472
+ return this.http.request("GET", "/org");
4473
+ }
4474
+ async updateContext(context) {
4475
+ return this.http.request("PATCH", "/org", { context });
4476
+ }
4477
+ };
4461
4478
  var AuditResource = class {
4462
4479
  constructor(http) {
4463
4480
  this.http = http;
@@ -4480,6 +4497,7 @@ var WaitroomClient = class {
4480
4497
  signals;
4481
4498
  watchers;
4482
4499
  agents;
4500
+ org;
4483
4501
  audit;
4484
4502
  constructor(options) {
4485
4503
  this.http = new HttpClient(options);
@@ -4488,6 +4506,7 @@ var WaitroomClient = class {
4488
4506
  this.signals = new SignalsResource(this.http);
4489
4507
  this.watchers = new WatchersResource(this.http);
4490
4508
  this.agents = new AgentsResource(this.http);
4509
+ this.org = new OrgResource(this.http);
4491
4510
  this.audit = new AuditResource(this.http);
4492
4511
  }
4493
4512
  async home() {
@@ -9373,6 +9392,9 @@ var createWatcherSchema2 = external_exports2.object({
9373
9392
  ttl_minutes: external_exports2.number().int().min(1).max(10080).optional(),
9374
9393
  max_triggers: external_exports2.number().int().min(1).optional()
9375
9394
  });
9395
+ var updateOrgContextSchema2 = external_exports2.object({
9396
+ context: external_exports2.string().max(1e4).nullable()
9397
+ });
9376
9398
  var paginationSchema2 = external_exports2.object({
9377
9399
  cursor: external_exports2.string().optional(),
9378
9400
  limit: external_exports2.coerce.number().int().min(1).max(100).default(50)
@@ -9617,6 +9639,27 @@ function checkinCommand() {
9617
9639
  handleError(err, globalOpts);
9618
9640
  }
9619
9641
  });
9642
+ cmd.command("result").description("Submit a result for a claimed task").argument("<id>", "Check-in ID").requiredOption("--body <text>", "Result content (supports markdown)").option("--metadata <json>", "Additional metadata as JSON").action(async function(id, opts) {
9643
+ const globalOpts = getGlobalOpts(this);
9644
+ try {
9645
+ const client = createClient(globalOpts);
9646
+ const metadata = opts.metadata ? JSON.parse(opts.metadata) : void 0;
9647
+ const message = await withSpinner(
9648
+ "Submitting result...",
9649
+ () => client.checkIns.submitResult(id, {
9650
+ body: opts.body,
9651
+ metadata
9652
+ })
9653
+ );
9654
+ const fmt = detectFormat(globalOpts.json ? "json" : globalOpts.format);
9655
+ if (fmt === "table") {
9656
+ success(`Result submitted for ${id}`);
9657
+ }
9658
+ output(message, { format: fmt, quiet: globalOpts.quiet });
9659
+ } catch (err) {
9660
+ handleError(err, globalOpts);
9661
+ }
9662
+ });
9620
9663
  cmd.command("message").description("Post a message to a check-in thread").argument("<id>", "Check-in ID").requiredOption("--body <text>", "Message content").option("--type <type>", "Message type: comment, result, question", "comment").option("--metadata <json>", "Additional metadata as JSON").action(async function(id, opts) {
9621
9664
  const globalOpts = getGlobalOpts(this);
9622
9665
  try {
@@ -10384,6 +10427,83 @@ function auditCommand() {
10384
10427
  return cmd;
10385
10428
  }
10386
10429
 
10430
+ // src/commands/org.ts
10431
+ import { Command as Command13 } from "commander";
10432
+ import { readFileSync } from "fs";
10433
+ function orgCommand() {
10434
+ const cmd = new Command13("org").description("Organization management commands");
10435
+ const context = cmd.command("context").description("Manage organization context");
10436
+ context.command("get").description("Print current organization context").action(async function() {
10437
+ const globalOpts = getGlobalOpts(this);
10438
+ try {
10439
+ const client = createClient(globalOpts);
10440
+ const org = await client.org.get();
10441
+ const fmt = detectFormat(globalOpts.json ? "json" : globalOpts.format);
10442
+ if (fmt === "table") {
10443
+ if (org.context) {
10444
+ console.log(org.context);
10445
+ } else {
10446
+ console.log("No organization context set.");
10447
+ }
10448
+ } else {
10449
+ output({ context: org.context }, { format: fmt, quiet: globalOpts.quiet });
10450
+ }
10451
+ } catch (err) {
10452
+ handleError(err, globalOpts);
10453
+ }
10454
+ });
10455
+ context.command("set").description("Set organization context from a file or inline").option("--file <path>", "Read context from a file").argument("[text]", "Inline context text").action(async function(text, opts) {
10456
+ const globalOpts = getGlobalOpts(this);
10457
+ try {
10458
+ let content;
10459
+ if (opts.file) {
10460
+ content = readFileSync(opts.file, "utf-8");
10461
+ } else if (text) {
10462
+ content = text;
10463
+ } else {
10464
+ console.error("Provide context text as an argument or use --file <path>");
10465
+ process.exit(1);
10466
+ }
10467
+ if (content.length > 1e4) {
10468
+ console.error(`Context too long: ${content.length} characters (max 10,000)`);
10469
+ process.exit(1);
10470
+ }
10471
+ const client = createClient(globalOpts);
10472
+ const org = await withSpinner(
10473
+ "Saving organization context...",
10474
+ () => client.org.updateContext(content)
10475
+ );
10476
+ const fmt = detectFormat(globalOpts.json ? "json" : globalOpts.format);
10477
+ if (fmt === "table") {
10478
+ success(`Organization context updated (${content.length} characters)`);
10479
+ } else {
10480
+ output({ context: org.context }, { format: fmt, quiet: globalOpts.quiet });
10481
+ }
10482
+ } catch (err) {
10483
+ handleError(err, globalOpts);
10484
+ }
10485
+ });
10486
+ context.command("clear").description("Clear organization context").action(async function() {
10487
+ const globalOpts = getGlobalOpts(this);
10488
+ try {
10489
+ const client = createClient(globalOpts);
10490
+ await withSpinner(
10491
+ "Clearing organization context...",
10492
+ () => client.org.updateContext(null)
10493
+ );
10494
+ const fmt = detectFormat(globalOpts.json ? "json" : globalOpts.format);
10495
+ if (fmt === "table") {
10496
+ success("Organization context cleared");
10497
+ } else {
10498
+ output({ context: null }, { format: fmt, quiet: globalOpts.quiet });
10499
+ }
10500
+ } catch (err) {
10501
+ handleError(err, globalOpts);
10502
+ }
10503
+ });
10504
+ return cmd;
10505
+ }
10506
+
10387
10507
  // src/cli.ts
10388
10508
  function getGlobalOpts(cmd) {
10389
10509
  const root = cmd.optsWithGlobals();
@@ -10399,7 +10519,7 @@ function getGlobalOpts(cmd) {
10399
10519
  };
10400
10520
  }
10401
10521
  function createProgram() {
10402
- const program = new Command13();
10522
+ const program = new Command14();
10403
10523
  program.name("wr").description("Waitroom CLI \u2014 coordination layer between AI agents and humans").version("0.0.1").option("-j, --json", "Output as JSON").option("-f, --format <format>", "Output format: table, json, compact, jsonl").option("-p, --profile <name>", "Credential profile to use").option("--api-url <url>", "API base URL").option("--api-key <key>", "API key (overrides stored credentials)").option("--no-color", "Disable color output").option("-v, --verbose", "Verbose output").option("-q, --quiet", "Suppress non-essential output");
10404
10524
  program.addCommand(initCommand());
10405
10525
  program.addCommand(authCommand());
@@ -10413,6 +10533,7 @@ function createProgram() {
10413
10533
  program.addCommand(signalCommand());
10414
10534
  program.addCommand(watchCommand());
10415
10535
  program.addCommand(auditCommand());
10536
+ program.addCommand(orgCommand());
10416
10537
  return program;
10417
10538
  }
10418
10539
  async function run(argv) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@waitroom-io/cli",
3
- "version": "0.0.6",
3
+ "version": "0.0.7",
4
4
  "description": "Waitroom CLI — coordination layer between AI agents and humans",
5
5
  "type": "module",
6
6
  "bin": {