@serviceme/devtools-cli 0.4.2 → 0.4.3
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/bridgeServer.js +1 -1
- package/dist/cli.js +18 -69
- package/package.json +3 -3
package/dist/bridgeServer.js
CHANGED
|
@@ -213,7 +213,7 @@ function normalizeServicemeError(error, fallbackCode = "internal_error") {
|
|
|
213
213
|
}
|
|
214
214
|
|
|
215
215
|
// src/version.ts
|
|
216
|
-
var SERVICEME_CLI_VERSION = "0.4.
|
|
216
|
+
var SERVICEME_CLI_VERSION = "0.4.3";
|
|
217
217
|
|
|
218
218
|
// src/bridge/handlers/AuthBridgeHandlers.ts
|
|
219
219
|
var import_auth2 = require("@serviceme/devtools-core/auth");
|
package/dist/cli.js
CHANGED
|
@@ -777,7 +777,7 @@ var readline = __toESM(require("readline"));
|
|
|
777
777
|
|
|
778
778
|
// src/version.ts
|
|
779
779
|
var SERVICEME_CLI_NAME = "serviceme";
|
|
780
|
-
var SERVICEME_CLI_VERSION = "0.4.
|
|
780
|
+
var SERVICEME_CLI_VERSION = "0.4.3";
|
|
781
781
|
|
|
782
782
|
// src/bridge/handlers/AuthBridgeHandlers.ts
|
|
783
783
|
var import_auth3 = require("@serviceme/devtools-core/auth");
|
|
@@ -2264,26 +2264,17 @@ async function runScheduleCommand(parsed) {
|
|
|
2264
2264
|
function requireWorkspace(parsed) {
|
|
2265
2265
|
const wp = getStringFlag(parsed, "workspacePath");
|
|
2266
2266
|
if (!wp) {
|
|
2267
|
-
throw createServicemeError(
|
|
2268
|
-
"invalid_params",
|
|
2269
|
-
"Missing required flag: --workspacePath"
|
|
2270
|
-
);
|
|
2267
|
+
throw createServicemeError("invalid_params", "Missing required flag: --workspacePath");
|
|
2271
2268
|
}
|
|
2272
2269
|
if (!fs3.existsSync(wp)) {
|
|
2273
|
-
throw createServicemeError(
|
|
2274
|
-
"workspace_not_found",
|
|
2275
|
-
`Workspace path does not exist: ${wp}`
|
|
2276
|
-
);
|
|
2270
|
+
throw createServicemeError("workspace_not_found", `Workspace path does not exist: ${wp}`);
|
|
2277
2271
|
}
|
|
2278
2272
|
return wp;
|
|
2279
2273
|
}
|
|
2280
2274
|
function requireId(parsed) {
|
|
2281
2275
|
const id = getStringFlag(parsed, "id");
|
|
2282
2276
|
if (!id) {
|
|
2283
|
-
throw createServicemeError(
|
|
2284
|
-
"invalid_params",
|
|
2285
|
-
"Missing required flag: --id <task-id>"
|
|
2286
|
-
);
|
|
2277
|
+
throw createServicemeError("invalid_params", "Missing required flag: --id <task-id>");
|
|
2287
2278
|
}
|
|
2288
2279
|
return id;
|
|
2289
2280
|
}
|
|
@@ -2304,10 +2295,7 @@ function parsePayload(parsed, taskType) {
|
|
|
2304
2295
|
try {
|
|
2305
2296
|
return JSON.parse(payloadJson);
|
|
2306
2297
|
} catch {
|
|
2307
|
-
throw createServicemeError(
|
|
2308
|
-
"invalid_payload",
|
|
2309
|
-
"Invalid --payload-json: must be valid JSON"
|
|
2310
|
-
);
|
|
2298
|
+
throw createServicemeError("invalid_payload", "Invalid --payload-json: must be valid JSON");
|
|
2311
2299
|
}
|
|
2312
2300
|
}
|
|
2313
2301
|
switch (taskType) {
|
|
@@ -2356,10 +2344,7 @@ function parsePayload(parsed, taskType) {
|
|
|
2356
2344
|
};
|
|
2357
2345
|
}
|
|
2358
2346
|
default:
|
|
2359
|
-
throw createServicemeError(
|
|
2360
|
-
"invalid_payload",
|
|
2361
|
-
`Unknown task type: ${taskType}`
|
|
2362
|
-
);
|
|
2347
|
+
throw createServicemeError("invalid_payload", `Unknown task type: ${taskType}`);
|
|
2363
2348
|
}
|
|
2364
2349
|
}
|
|
2365
2350
|
function parseScheduleType(schedule) {
|
|
@@ -2369,9 +2354,7 @@ function parseScheduleType(schedule) {
|
|
|
2369
2354
|
function validateSchedule(schedule) {
|
|
2370
2355
|
const scheduleType = parseScheduleType(schedule);
|
|
2371
2356
|
if (scheduleType === "interval") {
|
|
2372
|
-
const match = /^every\s+(\d+)\s*(s|sec|m|min|h|hr|d|day)s?$/i.exec(
|
|
2373
|
-
schedule
|
|
2374
|
-
);
|
|
2357
|
+
const match = /^every\s+(\d+)\s*(s|sec|m|min|h|hr|d|day)s?$/i.exec(schedule);
|
|
2375
2358
|
if (!match) {
|
|
2376
2359
|
throw createServicemeError(
|
|
2377
2360
|
"invalid_schedule",
|
|
@@ -2402,11 +2385,7 @@ function filterFields(obj, fields) {
|
|
|
2402
2385
|
async function handleCreate(parsed) {
|
|
2403
2386
|
const wp = requireWorkspace(parsed);
|
|
2404
2387
|
const name = getStringFlag(parsed, "name");
|
|
2405
|
-
if (!name)
|
|
2406
|
-
throw createServicemeError(
|
|
2407
|
-
"invalid_params",
|
|
2408
|
-
"Missing required flag: --name"
|
|
2409
|
-
);
|
|
2388
|
+
if (!name) throw createServicemeError("invalid_params", "Missing required flag: --name");
|
|
2410
2389
|
const typeStr = getStringFlag(parsed, "type");
|
|
2411
2390
|
if (!typeStr)
|
|
2412
2391
|
throw createServicemeError(
|
|
@@ -2421,11 +2400,7 @@ async function handleCreate(parsed) {
|
|
|
2421
2400
|
);
|
|
2422
2401
|
}
|
|
2423
2402
|
const schedule = getStringFlag(parsed, "schedule");
|
|
2424
|
-
if (!schedule)
|
|
2425
|
-
throw createServicemeError(
|
|
2426
|
-
"invalid_params",
|
|
2427
|
-
"Missing required flag: --schedule"
|
|
2428
|
-
);
|
|
2403
|
+
if (!schedule) throw createServicemeError("invalid_params", "Missing required flag: --schedule");
|
|
2429
2404
|
validateSchedule(schedule);
|
|
2430
2405
|
const payload = parsePayload(parsed, taskType);
|
|
2431
2406
|
const description = getStringFlag(parsed, "description");
|
|
@@ -2491,16 +2466,10 @@ function handleGet(parsed) {
|
|
|
2491
2466
|
const mgr = new import_devtools_core11.TaskConfigManager();
|
|
2492
2467
|
const task = mgr.getTask(id);
|
|
2493
2468
|
if (!task) {
|
|
2494
|
-
throw createServicemeError(
|
|
2495
|
-
"task_not_found",
|
|
2496
|
-
`Task '${id}' does not exist in this workspace`
|
|
2497
|
-
);
|
|
2469
|
+
throw createServicemeError("task_not_found", `Task '${id}' does not exist in this workspace`);
|
|
2498
2470
|
}
|
|
2499
2471
|
const fields = getStringFlag(parsed, "fields");
|
|
2500
|
-
const result = filterFields(
|
|
2501
|
-
task,
|
|
2502
|
-
fields
|
|
2503
|
-
);
|
|
2472
|
+
const result = filterFields(task, fields);
|
|
2504
2473
|
writeSuccess({ task: result });
|
|
2505
2474
|
}
|
|
2506
2475
|
async function handleEdit(parsed) {
|
|
@@ -2509,10 +2478,7 @@ async function handleEdit(parsed) {
|
|
|
2509
2478
|
const mgr = new import_devtools_core11.TaskConfigManager();
|
|
2510
2479
|
const existing = mgr.getTask(id);
|
|
2511
2480
|
if (!existing) {
|
|
2512
|
-
throw createServicemeError(
|
|
2513
|
-
"task_not_found",
|
|
2514
|
-
`Task '${id}' does not exist in this workspace`
|
|
2515
|
-
);
|
|
2481
|
+
throw createServicemeError("task_not_found", `Task '${id}' does not exist in this workspace`);
|
|
2516
2482
|
}
|
|
2517
2483
|
const input = {};
|
|
2518
2484
|
const name = getStringFlag(parsed, "name");
|
|
@@ -2534,10 +2500,7 @@ async function handleEdit(parsed) {
|
|
|
2534
2500
|
try {
|
|
2535
2501
|
input.payload = JSON.parse(payloadJson);
|
|
2536
2502
|
} catch {
|
|
2537
|
-
throw createServicemeError(
|
|
2538
|
-
"invalid_payload",
|
|
2539
|
-
"Invalid --payload-json: must be valid JSON"
|
|
2540
|
-
);
|
|
2503
|
+
throw createServicemeError("invalid_payload", "Invalid --payload-json: must be valid JSON");
|
|
2541
2504
|
}
|
|
2542
2505
|
}
|
|
2543
2506
|
if (getBooleanFlag(parsed, "dry-run")) {
|
|
@@ -2560,10 +2523,7 @@ function handleDelete(parsed) {
|
|
|
2560
2523
|
const mgr = new import_devtools_core11.TaskConfigManager();
|
|
2561
2524
|
const existing = mgr.getTask(id);
|
|
2562
2525
|
if (!existing) {
|
|
2563
|
-
throw createServicemeError(
|
|
2564
|
-
"task_not_found",
|
|
2565
|
-
`Task '${id}' does not exist in this workspace`
|
|
2566
|
-
);
|
|
2526
|
+
throw createServicemeError("task_not_found", `Task '${id}' does not exist in this workspace`);
|
|
2567
2527
|
}
|
|
2568
2528
|
if (getBooleanFlag(parsed, "dry-run")) {
|
|
2569
2529
|
writeSuccess({ action: "delete", task: existing });
|
|
@@ -2577,19 +2537,13 @@ function handleToggle(parsed) {
|
|
|
2577
2537
|
const id = requireId(parsed);
|
|
2578
2538
|
const enabledStr = getStringFlag(parsed, "enabled");
|
|
2579
2539
|
if (enabledStr === void 0) {
|
|
2580
|
-
throw createServicemeError(
|
|
2581
|
-
"invalid_params",
|
|
2582
|
-
"Missing required flag: --enabled <true|false>"
|
|
2583
|
-
);
|
|
2540
|
+
throw createServicemeError("invalid_params", "Missing required flag: --enabled <true|false>");
|
|
2584
2541
|
}
|
|
2585
2542
|
const enabled = enabledStr !== "false";
|
|
2586
2543
|
const mgr = new import_devtools_core11.TaskConfigManager();
|
|
2587
2544
|
const existing = mgr.getTask(id);
|
|
2588
2545
|
if (!existing) {
|
|
2589
|
-
throw createServicemeError(
|
|
2590
|
-
"task_not_found",
|
|
2591
|
-
`Task '${id}' does not exist in this workspace`
|
|
2592
|
-
);
|
|
2546
|
+
throw createServicemeError("task_not_found", `Task '${id}' does not exist in this workspace`);
|
|
2593
2547
|
}
|
|
2594
2548
|
const task = mgr.toggleTask(id, enabled);
|
|
2595
2549
|
writeSuccess({ task });
|
|
@@ -2600,10 +2554,7 @@ async function handleTrigger(parsed) {
|
|
|
2600
2554
|
const mgr = new import_devtools_core11.TaskConfigManager();
|
|
2601
2555
|
const task = mgr.getTask(id);
|
|
2602
2556
|
if (!task) {
|
|
2603
|
-
throw createServicemeError(
|
|
2604
|
-
"task_not_found",
|
|
2605
|
-
`Task '${id}' does not exist in this workspace`
|
|
2606
|
-
);
|
|
2557
|
+
throw createServicemeError("task_not_found", `Task '${id}' does not exist in this workspace`);
|
|
2607
2558
|
}
|
|
2608
2559
|
const startedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
2609
2560
|
const executionPayload = (0, import_devtools_core11.resolveTaskExecutionPayload)(
|
|
@@ -2635,9 +2586,7 @@ function handleLogs(parsed) {
|
|
|
2635
2586
|
const fields = getStringFlag(parsed, "fields");
|
|
2636
2587
|
const logMgr = new import_devtools_core11.TaskLogManager();
|
|
2637
2588
|
const { logs, total } = logMgr.getLogs({ taskId, limit });
|
|
2638
|
-
const result = logs.map(
|
|
2639
|
-
(l) => filterFields(l, fields)
|
|
2640
|
-
);
|
|
2589
|
+
const result = logs.map((l) => filterFields(l, fields));
|
|
2641
2590
|
writeSuccess({ logs: result, total });
|
|
2642
2591
|
}
|
|
2643
2592
|
function writeDescribe(action) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@serviceme/devtools-cli",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.3",
|
|
4
4
|
"description": "Unified SERVICEME CLI for automation, project scaffolding, and bridge-based tooling.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
6
6
|
"repository": {
|
|
@@ -39,8 +39,8 @@
|
|
|
39
39
|
"registry": "https://registry.npmjs.org/"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@serviceme/devtools-core": "0.4.
|
|
43
|
-
"@serviceme/devtools-protocol": "0.4.
|
|
42
|
+
"@serviceme/devtools-core": "0.4.3",
|
|
43
|
+
"@serviceme/devtools-protocol": "0.4.3"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@types/node": "^24",
|