@waitroom-io/cli 0.0.4 → 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 +331 -10
- package/package.json +2 -2
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(),
|
|
@@ -4122,11 +4163,13 @@ var createRoomSchema = external_exports.object({
|
|
|
4122
4163
|
name: external_exports.string().min(1).max(200),
|
|
4123
4164
|
slug: external_exports.string().min(1).max(100).regex(/^[a-z0-9-]+$/, "Slug must be lowercase alphanumeric with hyphens").optional(),
|
|
4124
4165
|
description: external_exports.string().max(2e3).optional(),
|
|
4166
|
+
agent_instructions: external_exports.string().max(5e3).optional(),
|
|
4125
4167
|
policies: roomPoliciesSchema.partial().optional()
|
|
4126
4168
|
});
|
|
4127
4169
|
var updateRoomSchema = external_exports.object({
|
|
4128
4170
|
name: external_exports.string().min(1).max(200).optional(),
|
|
4129
|
-
description: external_exports.string().max(2e3).nullable().optional()
|
|
4171
|
+
description: external_exports.string().max(2e3).nullable().optional(),
|
|
4172
|
+
agent_instructions: external_exports.string().max(5e3).nullable().optional()
|
|
4130
4173
|
}).refine((obj) => Object.keys(obj).length > 0, "At least one field must be provided");
|
|
4131
4174
|
var updatePoliciesSchema = external_exports.object({
|
|
4132
4175
|
policies: roomPoliciesSchema
|
|
@@ -4157,7 +4200,10 @@ var claimAgentSchema = external_exports.object({
|
|
|
4157
4200
|
var createWatcherSchema = external_exports.object({
|
|
4158
4201
|
event_types: external_exports.array(external_exports.string().min(1)).min(1),
|
|
4159
4202
|
filter: external_exports.record(external_exports.unknown()).optional(),
|
|
4160
|
-
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()
|
|
4161
4207
|
});
|
|
4162
4208
|
var paginationSchema = external_exports.object({
|
|
4163
4209
|
cursor: external_exports.string().optional(),
|
|
@@ -4170,11 +4216,15 @@ var checkInFiltersSchema = external_exports.object({
|
|
|
4170
4216
|
CheckInStatus.REJECTED,
|
|
4171
4217
|
CheckInStatus.MODIFIED,
|
|
4172
4218
|
CheckInStatus.EXPIRED,
|
|
4173
|
-
CheckInStatus.WITHDRAWN
|
|
4219
|
+
CheckInStatus.WITHDRAWN,
|
|
4220
|
+
CheckInStatus.IN_PROGRESS,
|
|
4221
|
+
CheckInStatus.SUBMITTED
|
|
4174
4222
|
]).optional(),
|
|
4175
4223
|
risk_level: riskLevelSchema.optional(),
|
|
4176
4224
|
urgency: urgencySchema.optional(),
|
|
4177
|
-
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()
|
|
4178
4228
|
});
|
|
4179
4229
|
var POLL_INITIAL_INTERVAL_MS = 2e3;
|
|
4180
4230
|
var POLL_MAX_INTERVAL_MS = 3e4;
|
|
@@ -4227,6 +4277,9 @@ var CheckInsResource = class {
|
|
|
4227
4277
|
async getStatus(id) {
|
|
4228
4278
|
return this.http.request("GET", `/check-ins/${id}/status`);
|
|
4229
4279
|
}
|
|
4280
|
+
async getWithThread(id) {
|
|
4281
|
+
return this.http.request("GET", `/check-ins/${id}`);
|
|
4282
|
+
}
|
|
4230
4283
|
async approve(id, input) {
|
|
4231
4284
|
return this.http.request("POST", `/check-ins/${id}/approve`, input ?? {});
|
|
4232
4285
|
}
|
|
@@ -4239,9 +4292,41 @@ var CheckInsResource = class {
|
|
|
4239
4292
|
async withdraw(id) {
|
|
4240
4293
|
return this.http.request("DELETE", `/check-ins/${id}`);
|
|
4241
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
|
+
}
|
|
4242
4305
|
async listPending(roomId) {
|
|
4243
4306
|
return this.http.request("GET", `/rooms/${roomId}/pending`);
|
|
4244
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
|
+
}
|
|
4245
4330
|
async checkInAndWait(roomId, input, options) {
|
|
4246
4331
|
const checkIn = await this.create(roomId, input);
|
|
4247
4332
|
if (checkIn.status !== "pending") {
|
|
@@ -4286,6 +4371,19 @@ var RoomsResource = class {
|
|
|
4286
4371
|
async getAudit(roomId) {
|
|
4287
4372
|
return this.http.request("GET", `/rooms/${roomId}/audit`);
|
|
4288
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
|
+
}
|
|
4289
4387
|
async getPending(roomId, filters) {
|
|
4290
4388
|
const params = new URLSearchParams();
|
|
4291
4389
|
if (filters) {
|
|
@@ -4312,6 +4410,12 @@ var WatchersResource = class {
|
|
|
4312
4410
|
async create(roomId, input) {
|
|
4313
4411
|
return this.http.request("POST", `/rooms/${roomId}/watch`, input);
|
|
4314
4412
|
}
|
|
4413
|
+
async createEphemeral(roomId, input) {
|
|
4414
|
+
return this.http.request("POST", `/rooms/${roomId}/watch`, {
|
|
4415
|
+
...input,
|
|
4416
|
+
ephemeral: true
|
|
4417
|
+
});
|
|
4418
|
+
}
|
|
4315
4419
|
async remove(watcherId) {
|
|
4316
4420
|
return this.http.request("DELETE", `/watchers/${watcherId}`);
|
|
4317
4421
|
}
|
|
@@ -5078,7 +5182,21 @@ var CheckInStatus2 = {
|
|
|
5078
5182
|
REJECTED: "rejected",
|
|
5079
5183
|
MODIFIED: "modified",
|
|
5080
5184
|
EXPIRED: "expired",
|
|
5081
|
-
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"
|
|
5082
5200
|
};
|
|
5083
5201
|
var TimeoutAction2 = {
|
|
5084
5202
|
AUTO_APPROVE: "auto_approve",
|
|
@@ -9160,6 +9278,33 @@ var modifyCheckInSchema2 = external_exports2.object({
|
|
|
9160
9278
|
reason: external_exports2.string().min(1).max(2e3),
|
|
9161
9279
|
modifications: external_exports2.record(external_exports2.unknown()).refine(jsonSizeCheck2, "Modifications exceeds 10KB limit")
|
|
9162
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
|
+
});
|
|
9163
9308
|
var policyConditionSchema2 = external_exports2.object({
|
|
9164
9309
|
risk_level: external_exports2.array(riskLevelSchema2).optional(),
|
|
9165
9310
|
action_type: external_exports2.array(external_exports2.string()).optional(),
|
|
@@ -9186,11 +9331,13 @@ var createRoomSchema2 = external_exports2.object({
|
|
|
9186
9331
|
name: external_exports2.string().min(1).max(200),
|
|
9187
9332
|
slug: external_exports2.string().min(1).max(100).regex(/^[a-z0-9-]+$/, "Slug must be lowercase alphanumeric with hyphens").optional(),
|
|
9188
9333
|
description: external_exports2.string().max(2e3).optional(),
|
|
9334
|
+
agent_instructions: external_exports2.string().max(5e3).optional(),
|
|
9189
9335
|
policies: roomPoliciesSchema2.partial().optional()
|
|
9190
9336
|
});
|
|
9191
9337
|
var updateRoomSchema2 = external_exports2.object({
|
|
9192
9338
|
name: external_exports2.string().min(1).max(200).optional(),
|
|
9193
|
-
description: external_exports2.string().max(2e3).nullable().optional()
|
|
9339
|
+
description: external_exports2.string().max(2e3).nullable().optional(),
|
|
9340
|
+
agent_instructions: external_exports2.string().max(5e3).nullable().optional()
|
|
9194
9341
|
}).refine((obj) => Object.keys(obj).length > 0, "At least one field must be provided");
|
|
9195
9342
|
var updatePoliciesSchema2 = external_exports2.object({
|
|
9196
9343
|
policies: roomPoliciesSchema2
|
|
@@ -9221,7 +9368,10 @@ var claimAgentSchema2 = external_exports2.object({
|
|
|
9221
9368
|
var createWatcherSchema2 = external_exports2.object({
|
|
9222
9369
|
event_types: external_exports2.array(external_exports2.string().min(1)).min(1),
|
|
9223
9370
|
filter: external_exports2.record(external_exports2.unknown()).optional(),
|
|
9224
|
-
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()
|
|
9225
9375
|
});
|
|
9226
9376
|
var paginationSchema2 = external_exports2.object({
|
|
9227
9377
|
cursor: external_exports2.string().optional(),
|
|
@@ -9234,11 +9384,15 @@ var checkInFiltersSchema2 = external_exports2.object({
|
|
|
9234
9384
|
CheckInStatus2.REJECTED,
|
|
9235
9385
|
CheckInStatus2.MODIFIED,
|
|
9236
9386
|
CheckInStatus2.EXPIRED,
|
|
9237
|
-
CheckInStatus2.WITHDRAWN
|
|
9387
|
+
CheckInStatus2.WITHDRAWN,
|
|
9388
|
+
CheckInStatus2.IN_PROGRESS,
|
|
9389
|
+
CheckInStatus2.SUBMITTED
|
|
9238
9390
|
]).optional(),
|
|
9239
9391
|
risk_level: riskLevelSchema2.optional(),
|
|
9240
9392
|
urgency: urgencySchema2.optional(),
|
|
9241
|
-
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()
|
|
9242
9396
|
});
|
|
9243
9397
|
|
|
9244
9398
|
// ../../packages/shared/dist/constants/index.js
|
|
@@ -9412,6 +9566,173 @@ function checkinCommand() {
|
|
|
9412
9566
|
handleError(err, globalOpts);
|
|
9413
9567
|
}
|
|
9414
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
|
+
});
|
|
9415
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) {
|
|
9416
9737
|
const globalOpts = getGlobalOpts(this);
|
|
9417
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": {
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"@waitroom-io/sdk": "workspace:*",
|
|
37
37
|
"@waitroom-io/shared": "workspace:*",
|
|
38
38
|
"@types/node": "^22.10.7",
|
|
39
|
-
"@waitroom/tsconfig": "workspace:*",
|
|
39
|
+
"@waitroom-io/tsconfig": "workspace:*",
|
|
40
40
|
"tsup": "^8.0.0",
|
|
41
41
|
"tsx": "^4.19.2",
|
|
42
42
|
"typescript": "^5.7.3",
|