@waitroom-io/cli 0.0.5 → 0.0.6
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/dist/index.js +325 -8
- package/package.json +13 -12
package/dist/index.js
CHANGED
|
@@ -32,7 +32,21 @@ var CheckInStatus = {
|
|
|
32
32
|
REJECTED: "rejected",
|
|
33
33
|
MODIFIED: "modified",
|
|
34
34
|
EXPIRED: "expired",
|
|
35
|
-
WITHDRAWN: "withdrawn"
|
|
35
|
+
WITHDRAWN: "withdrawn",
|
|
36
|
+
IN_PROGRESS: "in_progress",
|
|
37
|
+
SUBMITTED: "submitted"
|
|
38
|
+
};
|
|
39
|
+
var CheckInDirection = {
|
|
40
|
+
AGENT_TO_HUMAN: "agent_to_human",
|
|
41
|
+
HUMAN_TO_AGENT: "human_to_agent"
|
|
42
|
+
};
|
|
43
|
+
var MessageType = {
|
|
44
|
+
COMMENT: "comment",
|
|
45
|
+
STATUS_CHANGE: "status_change",
|
|
46
|
+
RESULT: "result",
|
|
47
|
+
QUESTION: "question",
|
|
48
|
+
ESCALATION: "escalation",
|
|
49
|
+
DECISION: "decision"
|
|
36
50
|
};
|
|
37
51
|
var TimeoutAction = {
|
|
38
52
|
AUTO_APPROVE: "auto_approve",
|
|
@@ -4096,6 +4110,33 @@ var modifyCheckInSchema = external_exports.object({
|
|
|
4096
4110
|
reason: external_exports.string().min(1).max(2e3),
|
|
4097
4111
|
modifications: external_exports.record(external_exports.unknown()).refine(jsonSizeCheck, "Modifications exceeds 10KB limit")
|
|
4098
4112
|
});
|
|
4113
|
+
var postTaskSchema = external_exports.object({
|
|
4114
|
+
action: external_exports.string().min(1).max(500),
|
|
4115
|
+
description: external_exports.string().max(5e3).optional(),
|
|
4116
|
+
risk_level: riskLevelSchema.default(RiskLevel.MEDIUM),
|
|
4117
|
+
urgency: urgencySchema.default(Urgency.NORMAL),
|
|
4118
|
+
context: external_exports.record(external_exports.unknown()).default({}).refine(jsonSizeCheck, "Context exceeds 10KB limit"),
|
|
4119
|
+
timeout_minutes: external_exports.number().int().min(1).max(10080).optional(),
|
|
4120
|
+
timeout_action: timeoutActionSchema.optional()
|
|
4121
|
+
});
|
|
4122
|
+
var attachmentSchema = external_exports.object({
|
|
4123
|
+
type: external_exports.enum(["image", "file", "url"]),
|
|
4124
|
+
url: external_exports.string().url(),
|
|
4125
|
+
name: external_exports.string().max(500).optional(),
|
|
4126
|
+
size: external_exports.number().int().min(0).optional(),
|
|
4127
|
+
mime_type: external_exports.string().max(200).optional()
|
|
4128
|
+
});
|
|
4129
|
+
var postCheckInMessageSchema = external_exports.object({
|
|
4130
|
+
body: external_exports.string().max(1e4).optional(),
|
|
4131
|
+
message_type: external_exports.enum([
|
|
4132
|
+
MessageType.COMMENT,
|
|
4133
|
+
MessageType.RESULT,
|
|
4134
|
+
MessageType.QUESTION,
|
|
4135
|
+
MessageType.ESCALATION
|
|
4136
|
+
]).default(MessageType.COMMENT),
|
|
4137
|
+
metadata: external_exports.record(external_exports.unknown()).default({}).refine(jsonSizeCheck, "Metadata exceeds 10KB limit"),
|
|
4138
|
+
attachments: external_exports.array(attachmentSchema).max(10).default([])
|
|
4139
|
+
});
|
|
4099
4140
|
var policyConditionSchema = external_exports.object({
|
|
4100
4141
|
risk_level: external_exports.array(riskLevelSchema).optional(),
|
|
4101
4142
|
action_type: external_exports.array(external_exports.string()).optional(),
|
|
@@ -4159,7 +4200,10 @@ var claimAgentSchema = external_exports.object({
|
|
|
4159
4200
|
var createWatcherSchema = external_exports.object({
|
|
4160
4201
|
event_types: external_exports.array(external_exports.string().min(1)).min(1),
|
|
4161
4202
|
filter: external_exports.record(external_exports.unknown()).optional(),
|
|
4162
|
-
webhook_url: external_exports.string().url().optional()
|
|
4203
|
+
webhook_url: external_exports.string().url().optional(),
|
|
4204
|
+
ephemeral: external_exports.boolean().default(false),
|
|
4205
|
+
ttl_minutes: external_exports.number().int().min(1).max(10080).optional(),
|
|
4206
|
+
max_triggers: external_exports.number().int().min(1).optional()
|
|
4163
4207
|
});
|
|
4164
4208
|
var paginationSchema = external_exports.object({
|
|
4165
4209
|
cursor: external_exports.string().optional(),
|
|
@@ -4172,11 +4216,15 @@ var checkInFiltersSchema = external_exports.object({
|
|
|
4172
4216
|
CheckInStatus.REJECTED,
|
|
4173
4217
|
CheckInStatus.MODIFIED,
|
|
4174
4218
|
CheckInStatus.EXPIRED,
|
|
4175
|
-
CheckInStatus.WITHDRAWN
|
|
4219
|
+
CheckInStatus.WITHDRAWN,
|
|
4220
|
+
CheckInStatus.IN_PROGRESS,
|
|
4221
|
+
CheckInStatus.SUBMITTED
|
|
4176
4222
|
]).optional(),
|
|
4177
4223
|
risk_level: riskLevelSchema.optional(),
|
|
4178
4224
|
urgency: urgencySchema.optional(),
|
|
4179
|
-
agent_id: external_exports.string().optional()
|
|
4225
|
+
agent_id: external_exports.string().optional(),
|
|
4226
|
+
direction: external_exports.enum([CheckInDirection.AGENT_TO_HUMAN, CheckInDirection.HUMAN_TO_AGENT]).optional(),
|
|
4227
|
+
claimed: external_exports.enum(["true", "false"]).optional()
|
|
4180
4228
|
});
|
|
4181
4229
|
var POLL_INITIAL_INTERVAL_MS = 2e3;
|
|
4182
4230
|
var POLL_MAX_INTERVAL_MS = 3e4;
|
|
@@ -4229,6 +4277,9 @@ var CheckInsResource = class {
|
|
|
4229
4277
|
async getStatus(id) {
|
|
4230
4278
|
return this.http.request("GET", `/check-ins/${id}/status`);
|
|
4231
4279
|
}
|
|
4280
|
+
async getWithThread(id) {
|
|
4281
|
+
return this.http.request("GET", `/check-ins/${id}`);
|
|
4282
|
+
}
|
|
4232
4283
|
async approve(id, input) {
|
|
4233
4284
|
return this.http.request("POST", `/check-ins/${id}/approve`, input ?? {});
|
|
4234
4285
|
}
|
|
@@ -4241,9 +4292,41 @@ var CheckInsResource = class {
|
|
|
4241
4292
|
async withdraw(id) {
|
|
4242
4293
|
return this.http.request("DELETE", `/check-ins/${id}`);
|
|
4243
4294
|
}
|
|
4295
|
+
async list(filters) {
|
|
4296
|
+
const params = new URLSearchParams();
|
|
4297
|
+
if (filters?.status) params.set("status", filters.status);
|
|
4298
|
+
if (filters?.risk_level) params.set("risk_level", filters.risk_level);
|
|
4299
|
+
if (filters?.urgency) params.set("urgency", filters.urgency);
|
|
4300
|
+
if (filters?.direction) params.set("direction", filters.direction);
|
|
4301
|
+
if (filters?.claimed) params.set("claimed", filters.claimed);
|
|
4302
|
+
const qs = params.toString() ? `?${params.toString()}` : "";
|
|
4303
|
+
return this.http.request("GET", `/check-ins${qs}`);
|
|
4304
|
+
}
|
|
4244
4305
|
async listPending(roomId) {
|
|
4245
4306
|
return this.http.request("GET", `/rooms/${roomId}/pending`);
|
|
4246
4307
|
}
|
|
4308
|
+
async claim(id) {
|
|
4309
|
+
return this.http.request("POST", `/check-ins/${id}/claim`);
|
|
4310
|
+
}
|
|
4311
|
+
async release(id) {
|
|
4312
|
+
return this.http.request("POST", `/check-ins/${id}/release`);
|
|
4313
|
+
}
|
|
4314
|
+
async requestHelp(id, body) {
|
|
4315
|
+
return this.http.request("POST", `/check-ins/${id}/help`, body ? { body } : {});
|
|
4316
|
+
}
|
|
4317
|
+
async join(id) {
|
|
4318
|
+
return this.http.request("POST", `/check-ins/${id}/join`);
|
|
4319
|
+
}
|
|
4320
|
+
async postMessage(id, input) {
|
|
4321
|
+
return this.http.request("POST", `/check-ins/${id}/messages`, input);
|
|
4322
|
+
}
|
|
4323
|
+
async getMessages(id) {
|
|
4324
|
+
return this.http.request("GET", `/check-ins/${id}/messages`);
|
|
4325
|
+
}
|
|
4326
|
+
async listClaimed(status) {
|
|
4327
|
+
const qs = status ? `?status=${status}` : "";
|
|
4328
|
+
return this.http.request("GET", `/check-ins/claimed${qs}`);
|
|
4329
|
+
}
|
|
4247
4330
|
async checkInAndWait(roomId, input, options) {
|
|
4248
4331
|
const checkIn = await this.create(roomId, input);
|
|
4249
4332
|
if (checkIn.status !== "pending") {
|
|
@@ -4288,6 +4371,19 @@ var RoomsResource = class {
|
|
|
4288
4371
|
async getAudit(roomId) {
|
|
4289
4372
|
return this.http.request("GET", `/rooms/${roomId}/audit`);
|
|
4290
4373
|
}
|
|
4374
|
+
async postTask(roomId, input) {
|
|
4375
|
+
return this.http.request("POST", `/rooms/${roomId}/tasks`, input);
|
|
4376
|
+
}
|
|
4377
|
+
async listTasks(roomId, filters) {
|
|
4378
|
+
const params = new URLSearchParams();
|
|
4379
|
+
if (filters) {
|
|
4380
|
+
for (const [k, v] of Object.entries(filters)) {
|
|
4381
|
+
if (v) params.set(k, v);
|
|
4382
|
+
}
|
|
4383
|
+
}
|
|
4384
|
+
const qs = params.toString();
|
|
4385
|
+
return this.http.request("GET", `/rooms/${roomId}/tasks${qs ? `?${qs}` : ""}`);
|
|
4386
|
+
}
|
|
4291
4387
|
async getPending(roomId, filters) {
|
|
4292
4388
|
const params = new URLSearchParams();
|
|
4293
4389
|
if (filters) {
|
|
@@ -4314,6 +4410,12 @@ var WatchersResource = class {
|
|
|
4314
4410
|
async create(roomId, input) {
|
|
4315
4411
|
return this.http.request("POST", `/rooms/${roomId}/watch`, input);
|
|
4316
4412
|
}
|
|
4413
|
+
async createEphemeral(roomId, input) {
|
|
4414
|
+
return this.http.request("POST", `/rooms/${roomId}/watch`, {
|
|
4415
|
+
...input,
|
|
4416
|
+
ephemeral: true
|
|
4417
|
+
});
|
|
4418
|
+
}
|
|
4317
4419
|
async remove(watcherId) {
|
|
4318
4420
|
return this.http.request("DELETE", `/watchers/${watcherId}`);
|
|
4319
4421
|
}
|
|
@@ -5080,7 +5182,21 @@ var CheckInStatus2 = {
|
|
|
5080
5182
|
REJECTED: "rejected",
|
|
5081
5183
|
MODIFIED: "modified",
|
|
5082
5184
|
EXPIRED: "expired",
|
|
5083
|
-
WITHDRAWN: "withdrawn"
|
|
5185
|
+
WITHDRAWN: "withdrawn",
|
|
5186
|
+
IN_PROGRESS: "in_progress",
|
|
5187
|
+
SUBMITTED: "submitted"
|
|
5188
|
+
};
|
|
5189
|
+
var CheckInDirection2 = {
|
|
5190
|
+
AGENT_TO_HUMAN: "agent_to_human",
|
|
5191
|
+
HUMAN_TO_AGENT: "human_to_agent"
|
|
5192
|
+
};
|
|
5193
|
+
var MessageType2 = {
|
|
5194
|
+
COMMENT: "comment",
|
|
5195
|
+
STATUS_CHANGE: "status_change",
|
|
5196
|
+
RESULT: "result",
|
|
5197
|
+
QUESTION: "question",
|
|
5198
|
+
ESCALATION: "escalation",
|
|
5199
|
+
DECISION: "decision"
|
|
5084
5200
|
};
|
|
5085
5201
|
var TimeoutAction2 = {
|
|
5086
5202
|
AUTO_APPROVE: "auto_approve",
|
|
@@ -9162,6 +9278,33 @@ var modifyCheckInSchema2 = external_exports2.object({
|
|
|
9162
9278
|
reason: external_exports2.string().min(1).max(2e3),
|
|
9163
9279
|
modifications: external_exports2.record(external_exports2.unknown()).refine(jsonSizeCheck2, "Modifications exceeds 10KB limit")
|
|
9164
9280
|
});
|
|
9281
|
+
var postTaskSchema2 = external_exports2.object({
|
|
9282
|
+
action: external_exports2.string().min(1).max(500),
|
|
9283
|
+
description: external_exports2.string().max(5e3).optional(),
|
|
9284
|
+
risk_level: riskLevelSchema2.default(RiskLevel2.MEDIUM),
|
|
9285
|
+
urgency: urgencySchema2.default(Urgency2.NORMAL),
|
|
9286
|
+
context: external_exports2.record(external_exports2.unknown()).default({}).refine(jsonSizeCheck2, "Context exceeds 10KB limit"),
|
|
9287
|
+
timeout_minutes: external_exports2.number().int().min(1).max(10080).optional(),
|
|
9288
|
+
timeout_action: timeoutActionSchema2.optional()
|
|
9289
|
+
});
|
|
9290
|
+
var attachmentSchema2 = external_exports2.object({
|
|
9291
|
+
type: external_exports2.enum(["image", "file", "url"]),
|
|
9292
|
+
url: external_exports2.string().url(),
|
|
9293
|
+
name: external_exports2.string().max(500).optional(),
|
|
9294
|
+
size: external_exports2.number().int().min(0).optional(),
|
|
9295
|
+
mime_type: external_exports2.string().max(200).optional()
|
|
9296
|
+
});
|
|
9297
|
+
var postCheckInMessageSchema2 = external_exports2.object({
|
|
9298
|
+
body: external_exports2.string().max(1e4).optional(),
|
|
9299
|
+
message_type: external_exports2.enum([
|
|
9300
|
+
MessageType2.COMMENT,
|
|
9301
|
+
MessageType2.RESULT,
|
|
9302
|
+
MessageType2.QUESTION,
|
|
9303
|
+
MessageType2.ESCALATION
|
|
9304
|
+
]).default(MessageType2.COMMENT),
|
|
9305
|
+
metadata: external_exports2.record(external_exports2.unknown()).default({}).refine(jsonSizeCheck2, "Metadata exceeds 10KB limit"),
|
|
9306
|
+
attachments: external_exports2.array(attachmentSchema2).max(10).default([])
|
|
9307
|
+
});
|
|
9165
9308
|
var policyConditionSchema2 = external_exports2.object({
|
|
9166
9309
|
risk_level: external_exports2.array(riskLevelSchema2).optional(),
|
|
9167
9310
|
action_type: external_exports2.array(external_exports2.string()).optional(),
|
|
@@ -9225,7 +9368,10 @@ var claimAgentSchema2 = external_exports2.object({
|
|
|
9225
9368
|
var createWatcherSchema2 = external_exports2.object({
|
|
9226
9369
|
event_types: external_exports2.array(external_exports2.string().min(1)).min(1),
|
|
9227
9370
|
filter: external_exports2.record(external_exports2.unknown()).optional(),
|
|
9228
|
-
webhook_url: external_exports2.string().url().optional()
|
|
9371
|
+
webhook_url: external_exports2.string().url().optional(),
|
|
9372
|
+
ephemeral: external_exports2.boolean().default(false),
|
|
9373
|
+
ttl_minutes: external_exports2.number().int().min(1).max(10080).optional(),
|
|
9374
|
+
max_triggers: external_exports2.number().int().min(1).optional()
|
|
9229
9375
|
});
|
|
9230
9376
|
var paginationSchema2 = external_exports2.object({
|
|
9231
9377
|
cursor: external_exports2.string().optional(),
|
|
@@ -9238,11 +9384,15 @@ var checkInFiltersSchema2 = external_exports2.object({
|
|
|
9238
9384
|
CheckInStatus2.REJECTED,
|
|
9239
9385
|
CheckInStatus2.MODIFIED,
|
|
9240
9386
|
CheckInStatus2.EXPIRED,
|
|
9241
|
-
CheckInStatus2.WITHDRAWN
|
|
9387
|
+
CheckInStatus2.WITHDRAWN,
|
|
9388
|
+
CheckInStatus2.IN_PROGRESS,
|
|
9389
|
+
CheckInStatus2.SUBMITTED
|
|
9242
9390
|
]).optional(),
|
|
9243
9391
|
risk_level: riskLevelSchema2.optional(),
|
|
9244
9392
|
urgency: urgencySchema2.optional(),
|
|
9245
|
-
agent_id: external_exports2.string().optional()
|
|
9393
|
+
agent_id: external_exports2.string().optional(),
|
|
9394
|
+
direction: external_exports2.enum([CheckInDirection2.AGENT_TO_HUMAN, CheckInDirection2.HUMAN_TO_AGENT]).optional(),
|
|
9395
|
+
claimed: external_exports2.enum(["true", "false"]).optional()
|
|
9246
9396
|
});
|
|
9247
9397
|
|
|
9248
9398
|
// ../../packages/shared/dist/constants/index.js
|
|
@@ -9416,6 +9566,173 @@ function checkinCommand() {
|
|
|
9416
9566
|
handleError(err, globalOpts);
|
|
9417
9567
|
}
|
|
9418
9568
|
});
|
|
9569
|
+
cmd.command("claim").description("Claim an unclaimed room task").argument("<id>", "Check-in ID").action(async function(id) {
|
|
9570
|
+
const globalOpts = getGlobalOpts(this);
|
|
9571
|
+
try {
|
|
9572
|
+
const client = createClient(globalOpts);
|
|
9573
|
+
const checkIn = await withSpinner(
|
|
9574
|
+
"Claiming...",
|
|
9575
|
+
() => client.checkIns.claim(id)
|
|
9576
|
+
);
|
|
9577
|
+
const fmt = detectFormat(globalOpts.json ? "json" : globalOpts.format);
|
|
9578
|
+
if (fmt === "table") {
|
|
9579
|
+
success(`Task ${id} claimed`);
|
|
9580
|
+
}
|
|
9581
|
+
output(checkIn, { format: fmt, quiet: globalOpts.quiet });
|
|
9582
|
+
} catch (err) {
|
|
9583
|
+
handleError(err, globalOpts);
|
|
9584
|
+
}
|
|
9585
|
+
});
|
|
9586
|
+
cmd.command("release").description("Release a claimed task back to the room").argument("<id>", "Check-in ID").action(async function(id) {
|
|
9587
|
+
const globalOpts = getGlobalOpts(this);
|
|
9588
|
+
try {
|
|
9589
|
+
const client = createClient(globalOpts);
|
|
9590
|
+
const checkIn = await withSpinner(
|
|
9591
|
+
"Releasing...",
|
|
9592
|
+
() => client.checkIns.release(id)
|
|
9593
|
+
);
|
|
9594
|
+
const fmt = detectFormat(globalOpts.json ? "json" : globalOpts.format);
|
|
9595
|
+
if (fmt === "table") {
|
|
9596
|
+
success(`Task ${id} released`);
|
|
9597
|
+
}
|
|
9598
|
+
output(checkIn, { format: fmt, quiet: globalOpts.quiet });
|
|
9599
|
+
} catch (err) {
|
|
9600
|
+
handleError(err, globalOpts);
|
|
9601
|
+
}
|
|
9602
|
+
});
|
|
9603
|
+
cmd.command("help").description("Request help on a claimed task").argument("<id>", "Check-in ID").option("--message <msg>", "Description of what help is needed").action(async function(id, opts) {
|
|
9604
|
+
const globalOpts = getGlobalOpts(this);
|
|
9605
|
+
try {
|
|
9606
|
+
const client = createClient(globalOpts);
|
|
9607
|
+
const checkIn = await withSpinner(
|
|
9608
|
+
"Requesting help...",
|
|
9609
|
+
() => client.checkIns.requestHelp(id, opts.message)
|
|
9610
|
+
);
|
|
9611
|
+
const fmt = detectFormat(globalOpts.json ? "json" : globalOpts.format);
|
|
9612
|
+
if (fmt === "table") {
|
|
9613
|
+
success(`Help requested for ${id}`);
|
|
9614
|
+
}
|
|
9615
|
+
output(checkIn, { format: fmt, quiet: globalOpts.quiet });
|
|
9616
|
+
} catch (err) {
|
|
9617
|
+
handleError(err, globalOpts);
|
|
9618
|
+
}
|
|
9619
|
+
});
|
|
9620
|
+
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
|
+
const globalOpts = getGlobalOpts(this);
|
|
9622
|
+
try {
|
|
9623
|
+
const client = createClient(globalOpts);
|
|
9624
|
+
const metadata = opts.metadata ? JSON.parse(opts.metadata) : void 0;
|
|
9625
|
+
const message = await withSpinner(
|
|
9626
|
+
"Posting message...",
|
|
9627
|
+
() => client.checkIns.postMessage(id, {
|
|
9628
|
+
body: opts.body,
|
|
9629
|
+
message_type: opts.type,
|
|
9630
|
+
metadata
|
|
9631
|
+
})
|
|
9632
|
+
);
|
|
9633
|
+
const fmt = detectFormat(globalOpts.json ? "json" : globalOpts.format);
|
|
9634
|
+
if (fmt === "table") {
|
|
9635
|
+
success(`Message posted to ${id}`);
|
|
9636
|
+
}
|
|
9637
|
+
output(message, { format: fmt, quiet: globalOpts.quiet });
|
|
9638
|
+
} catch (err) {
|
|
9639
|
+
handleError(err, globalOpts);
|
|
9640
|
+
}
|
|
9641
|
+
});
|
|
9642
|
+
cmd.command("thread").description("Show thread messages for a check-in").argument("<id>", "Check-in ID").action(async function(id) {
|
|
9643
|
+
const globalOpts = getGlobalOpts(this);
|
|
9644
|
+
try {
|
|
9645
|
+
const client = createClient(globalOpts);
|
|
9646
|
+
const messages = await client.checkIns.getMessages(id);
|
|
9647
|
+
const fmt = detectFormat(globalOpts.json ? "json" : globalOpts.format);
|
|
9648
|
+
output(messages, {
|
|
9649
|
+
format: fmt,
|
|
9650
|
+
quiet: globalOpts.quiet,
|
|
9651
|
+
columns: [
|
|
9652
|
+
{ key: "id", header: "ID" },
|
|
9653
|
+
{ key: "sender_type", header: "Sender" },
|
|
9654
|
+
{ key: "message_type", header: "Type" },
|
|
9655
|
+
{ key: "body", header: "Body" },
|
|
9656
|
+
{ key: "created_at", header: "Time" }
|
|
9657
|
+
]
|
|
9658
|
+
});
|
|
9659
|
+
} catch (err) {
|
|
9660
|
+
handleError(err, globalOpts);
|
|
9661
|
+
}
|
|
9662
|
+
});
|
|
9663
|
+
cmd.command("claimed").description("List your claimed tasks").option("--status <status>", "Filter by status: in_progress, submitted").action(async function(opts) {
|
|
9664
|
+
const globalOpts = getGlobalOpts(this);
|
|
9665
|
+
try {
|
|
9666
|
+
const client = createClient(globalOpts);
|
|
9667
|
+
const checkIns = await client.checkIns.listClaimed(opts.status);
|
|
9668
|
+
const fmt = detectFormat(globalOpts.json ? "json" : globalOpts.format);
|
|
9669
|
+
output(checkIns, {
|
|
9670
|
+
format: fmt,
|
|
9671
|
+
quiet: globalOpts.quiet,
|
|
9672
|
+
columns: [
|
|
9673
|
+
{ key: "id", header: "ID" },
|
|
9674
|
+
{ key: "action", header: "Action" },
|
|
9675
|
+
{ key: "risk_level", header: "Risk", formatter: (v) => formatRisk(String(v)) },
|
|
9676
|
+
{ key: "status", header: "Status", formatter: (v) => formatStatus(String(v)) },
|
|
9677
|
+
{ key: "created_at", header: "Created" }
|
|
9678
|
+
]
|
|
9679
|
+
});
|
|
9680
|
+
} catch (err) {
|
|
9681
|
+
handleError(err, globalOpts);
|
|
9682
|
+
}
|
|
9683
|
+
});
|
|
9684
|
+
cmd.command("tasks").description("List room tasks posted by humans").argument("<room>", "Room slug or ID").option("--unclaimed", "Show only unclaimed tasks").action(async function(room, opts) {
|
|
9685
|
+
const globalOpts = getGlobalOpts(this);
|
|
9686
|
+
try {
|
|
9687
|
+
const client = createClient(globalOpts);
|
|
9688
|
+
const claimed = opts.unclaimed ? "false" : void 0;
|
|
9689
|
+
const tasks = await client.rooms.listTasks(room, claimed ? { claimed } : void 0);
|
|
9690
|
+
const fmt = detectFormat(globalOpts.json ? "json" : globalOpts.format);
|
|
9691
|
+
output(tasks, {
|
|
9692
|
+
format: fmt,
|
|
9693
|
+
quiet: globalOpts.quiet,
|
|
9694
|
+
columns: [
|
|
9695
|
+
{ key: "id", header: "ID" },
|
|
9696
|
+
{ key: "action", header: "Action" },
|
|
9697
|
+
{ key: "risk_level", header: "Risk", formatter: (v) => formatRisk(String(v)) },
|
|
9698
|
+
{ key: "status", header: "Status", formatter: (v) => formatStatus(String(v)) },
|
|
9699
|
+
{ key: "claimed_by", header: "Claimed By" },
|
|
9700
|
+
{ key: "created_at", header: "Created" }
|
|
9701
|
+
]
|
|
9702
|
+
});
|
|
9703
|
+
} catch (err) {
|
|
9704
|
+
handleError(err, globalOpts);
|
|
9705
|
+
}
|
|
9706
|
+
});
|
|
9707
|
+
cmd.command("list").description("List check-ins across all rooms").option("--status <status>", "Filter by status (pending, in_progress, submitted, approved, rejected, etc.)").option("--risk <level>", "Filter by risk level").option("--urgency <urgency>", "Filter by urgency").option("--direction <dir>", "Filter by direction: agent_to_human, human_to_agent").option("--claimed <bool>", "Filter by claimed status: true, false").action(async function(opts) {
|
|
9708
|
+
const globalOpts = getGlobalOpts(this);
|
|
9709
|
+
try {
|
|
9710
|
+
const client = createClient(globalOpts);
|
|
9711
|
+
const filters = {};
|
|
9712
|
+
if (opts.status) filters.status = opts.status;
|
|
9713
|
+
if (opts.risk) filters.risk_level = opts.risk;
|
|
9714
|
+
if (opts.urgency) filters.urgency = opts.urgency;
|
|
9715
|
+
if (opts.direction) filters.direction = opts.direction;
|
|
9716
|
+
if (opts.claimed) filters.claimed = opts.claimed;
|
|
9717
|
+
const checkIns = await client.checkIns.list(filters);
|
|
9718
|
+
const fmt = detectFormat(globalOpts.json ? "json" : globalOpts.format);
|
|
9719
|
+
output(checkIns, {
|
|
9720
|
+
format: fmt,
|
|
9721
|
+
quiet: globalOpts.quiet,
|
|
9722
|
+
columns: [
|
|
9723
|
+
{ key: "id", header: "ID" },
|
|
9724
|
+
{ key: "action", header: "Action" },
|
|
9725
|
+
{ key: "direction", header: "Direction" },
|
|
9726
|
+
{ key: "risk_level", header: "Risk", formatter: (v) => formatRisk(String(v)) },
|
|
9727
|
+
{ key: "status", header: "Status", formatter: (v) => formatStatus(String(v)) },
|
|
9728
|
+
{ key: "agent_id", header: "Agent" },
|
|
9729
|
+
{ key: "created_at", header: "Created" }
|
|
9730
|
+
]
|
|
9731
|
+
});
|
|
9732
|
+
} catch (err) {
|
|
9733
|
+
handleError(err, globalOpts);
|
|
9734
|
+
}
|
|
9735
|
+
});
|
|
9419
9736
|
cmd.command("pending").description("List pending check-ins in a room").argument("[room]", "Room slug or ID").option("--risk <level>", "Filter by risk level").option("--agent <id>", "Filter by agent ID").action(async function(room, opts) {
|
|
9420
9737
|
const globalOpts = getGlobalOpts(this);
|
|
9421
9738
|
try {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@waitroom-io/cli",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.6",
|
|
4
4
|
"description": "Waitroom CLI — coordination layer between AI agents and humans",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -10,6 +10,13 @@
|
|
|
10
10
|
"files": [
|
|
11
11
|
"dist"
|
|
12
12
|
],
|
|
13
|
+
"scripts": {
|
|
14
|
+
"build": "tsup",
|
|
15
|
+
"typecheck": "tsc --noEmit",
|
|
16
|
+
"test": "vitest run",
|
|
17
|
+
"clean": "rm -rf dist",
|
|
18
|
+
"prepublishOnly": "pnpm build"
|
|
19
|
+
},
|
|
13
20
|
"keywords": [
|
|
14
21
|
"waitroom",
|
|
15
22
|
"cli",
|
|
@@ -26,19 +33,13 @@
|
|
|
26
33
|
"eventsource": "^3.0.0"
|
|
27
34
|
},
|
|
28
35
|
"devDependencies": {
|
|
36
|
+
"@waitroom-io/sdk": "workspace:*",
|
|
37
|
+
"@waitroom-io/shared": "workspace:*",
|
|
29
38
|
"@types/node": "^22.10.7",
|
|
39
|
+
"@waitroom-io/tsconfig": "workspace:*",
|
|
30
40
|
"tsup": "^8.0.0",
|
|
31
41
|
"tsx": "^4.19.2",
|
|
32
42
|
"typescript": "^5.7.3",
|
|
33
|
-
"vitest": "^2.1.8"
|
|
34
|
-
"@waitroom-io/sdk": "0.0.5",
|
|
35
|
-
"@waitroom-io/tsconfig": "0.0.0",
|
|
36
|
-
"@waitroom-io/shared": "0.0.1"
|
|
37
|
-
},
|
|
38
|
-
"scripts": {
|
|
39
|
-
"build": "tsup",
|
|
40
|
-
"typecheck": "tsc --noEmit",
|
|
41
|
-
"test": "vitest run",
|
|
42
|
-
"clean": "rm -rf dist"
|
|
43
|
+
"vitest": "^2.1.8"
|
|
43
44
|
}
|
|
44
|
-
}
|
|
45
|
+
}
|