@devpad/cli 2.3.3 → 2.3.4
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 +131 -14
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -15824,7 +15824,7 @@ var require_emoji_regex = __commonJS(function(exports, module) {
|
|
|
15824
15824
|
};
|
|
15825
15825
|
});
|
|
15826
15826
|
|
|
15827
|
-
// ../api/dist/chunk-
|
|
15827
|
+
// ../api/dist/chunk-XHTCNYWS.js
|
|
15828
15828
|
init_drizzle_orm();
|
|
15829
15829
|
init_sqlite_core();
|
|
15830
15830
|
init_zod();
|
|
@@ -16019,6 +16019,35 @@ var apply_log = sqliteTable("apply_log", {
|
|
|
16019
16019
|
response: text("response", { mode: "json" }).notNull(),
|
|
16020
16020
|
created_at: text("created_at").notNull().default(sql`(CURRENT_TIMESTAMP)`)
|
|
16021
16021
|
});
|
|
16022
|
+
var TASK_EVENT_KINDS = [
|
|
16023
|
+
"task.created",
|
|
16024
|
+
"task.updated",
|
|
16025
|
+
"task.completed",
|
|
16026
|
+
"task.reopened",
|
|
16027
|
+
"task.claimed",
|
|
16028
|
+
"edge.created",
|
|
16029
|
+
"edge.removed",
|
|
16030
|
+
"node.children_all_done",
|
|
16031
|
+
"policy.fired",
|
|
16032
|
+
"node.completion_stale"
|
|
16033
|
+
];
|
|
16034
|
+
var TASK_EVENT_ACTORS = ["user", "api", "policy", "github"];
|
|
16035
|
+
var TASK_EVENT_DISPATCH_STATUSES = ["pending", "dispatched"];
|
|
16036
|
+
var task_event = sqliteTable("task_event", {
|
|
16037
|
+
id: integer("id").primaryKey({ autoIncrement: true }),
|
|
16038
|
+
event_id: text("event_id").notNull().unique().$defaultFn(() => `evt_${crypto.randomUUID()}`),
|
|
16039
|
+
kind: text("kind", { enum: TASK_EVENT_KINDS }).notNull(),
|
|
16040
|
+
subject_id: text("subject_id").notNull(),
|
|
16041
|
+
project_id: text("project_id"),
|
|
16042
|
+
actor: text("actor", { enum: TASK_EVENT_ACTORS }).notNull(),
|
|
16043
|
+
payload: text("payload", { mode: "json" }).notNull(),
|
|
16044
|
+
occurred_at: text("occurred_at").notNull().default(sql`(CURRENT_TIMESTAMP)`),
|
|
16045
|
+
dispatch_status: text("dispatch_status", { enum: TASK_EVENT_DISPATCH_STATUSES }).notNull().default("pending"),
|
|
16046
|
+
dispatched_at: text("dispatched_at")
|
|
16047
|
+
}, (table3) => [
|
|
16048
|
+
index("task_event_subject_id_idx").on(table3.subject_id),
|
|
16049
|
+
index("task_event_dispatch_status_idx").on(table3.dispatch_status)
|
|
16050
|
+
]);
|
|
16022
16051
|
var checklist = sqliteTable("checklist", {
|
|
16023
16052
|
...entity2("checklist"),
|
|
16024
16053
|
task_id: text("task_id").notNull().references(() => task.id),
|
|
@@ -16209,6 +16238,9 @@ var task_link_relations = relations(task_link, ({ one }) => ({
|
|
|
16209
16238
|
var task_rollup_relations = relations(task_rollup, ({ one }) => ({
|
|
16210
16239
|
task: one(task, { fields: [task_rollup.task_id], references: [task.id] })
|
|
16211
16240
|
}));
|
|
16241
|
+
var task_event_relations = relations(task_event, ({ one }) => ({
|
|
16242
|
+
subject: one(task, { fields: [task_event.subject_id], references: [task.id] })
|
|
16243
|
+
}));
|
|
16212
16244
|
var checklist_relations = relations(checklist, ({ one, many }) => ({
|
|
16213
16245
|
task: one(task, { fields: [checklist.task_id], references: [task.id] }),
|
|
16214
16246
|
items: many(checklist_item)
|
|
@@ -16569,6 +16601,20 @@ var apply_request = exports_external.object({
|
|
|
16569
16601
|
ops: exports_external.array(apply_op).min(1)
|
|
16570
16602
|
});
|
|
16571
16603
|
var claim_request = exports_external.object({ actor: exports_external.string().min(1), base_rev: exports_external.number().int() });
|
|
16604
|
+
var done_request = exports_external.object({ base_rev: exports_external.number().int() });
|
|
16605
|
+
var task_event_actor = exports_external.enum(TASK_EVENT_ACTORS);
|
|
16606
|
+
var task_event_payload = exports_external.discriminatedUnion("kind", [
|
|
16607
|
+
exports_external.object({ kind: exports_external.literal("task.created"), title: exports_external.string() }),
|
|
16608
|
+
exports_external.object({ kind: exports_external.literal("task.updated"), fields: exports_external.array(exports_external.string()) }),
|
|
16609
|
+
exports_external.object({ kind: exports_external.literal("task.completed"), via: exports_external.enum(COMPLETED_VIA_VALUES) }),
|
|
16610
|
+
exports_external.object({ kind: exports_external.literal("task.reopened"), via: exports_external.enum(COMPLETED_VIA_VALUES) }),
|
|
16611
|
+
exports_external.object({ kind: exports_external.literal("task.claimed"), actor: exports_external.string() }),
|
|
16612
|
+
exports_external.object({ kind: exports_external.literal("edge.created"), link_kind: task_link_kind, dst_id: exports_external.string().nullable() }),
|
|
16613
|
+
exports_external.object({ kind: exports_external.literal("edge.removed"), link_kind: task_link_kind, dst_id: exports_external.string().nullable() }),
|
|
16614
|
+
exports_external.object({ kind: exports_external.literal("node.children_all_done") }),
|
|
16615
|
+
exports_external.object({ kind: exports_external.literal("policy.fired"), policy: exports_external.enum(COMPLETION_POLICIES) }),
|
|
16616
|
+
exports_external.object({ kind: exports_external.literal("node.completion_stale"), child_id: exports_external.string() })
|
|
16617
|
+
]);
|
|
16572
16618
|
|
|
16573
16619
|
// ../api/dist/chunk-5L3AUVMM.js
|
|
16574
16620
|
init_dist();
|
|
@@ -17355,6 +17401,7 @@ var ApiClient2 = class {
|
|
|
17355
17401
|
tree: (id2, depth) => wrap(() => this.clients.tasks.get(`/tasks/${id2}/tree`, depth ? { query: { depth: String(depth) } } : {})),
|
|
17356
17402
|
near: (id2) => wrap(() => this.clients.tasks.get(`/tasks/${id2}/near`)),
|
|
17357
17403
|
claim: (id2, data) => wrap(() => this.clients.tasks.post(`/tasks/${id2}/claim`, { body: data })),
|
|
17404
|
+
done: (id2, data) => wrap(() => this.clients.tasks.post(`/tasks/${id2}/done`, { body: data })),
|
|
17358
17405
|
link: (data) => wrap(() => this.clients.tasks.post("/tasks/link", { body: data })),
|
|
17359
17406
|
unlink: (link_id) => wrap(() => this.clients.tasks.delete(`/tasks/link/${link_id}`)),
|
|
17360
17407
|
apply: (data) => wrap(() => this.clients.tasks.post("/tasks/apply", { body: data }))
|
|
@@ -18077,6 +18124,15 @@ var tools = {
|
|
|
18077
18124
|
}),
|
|
18078
18125
|
execute: async (client, input) => unwrap2(await client.tasks.claim(input.id, { actor: input.actor, base_rev: input.base_rev }))
|
|
18079
18126
|
}),
|
|
18127
|
+
devpad_tasks_done: define_tool({
|
|
18128
|
+
name: "devpad_tasks_done",
|
|
18129
|
+
description: "Complete a task through the single completion entrypoint (CompletionEngine). Returns { completed, bubbled, hooks_fired } — bubbled is the ordered chain of ancestors an auto_children cascade also completed. 409 on stale base_rev or if already completed.",
|
|
18130
|
+
inputSchema: exports_external.object({
|
|
18131
|
+
id: exports_external.string().describe("Task ID"),
|
|
18132
|
+
base_rev: exports_external.number().int().describe("Expected current rev — optimistic concurrency guard")
|
|
18133
|
+
}),
|
|
18134
|
+
execute: async (client, input) => unwrap2(await client.tasks.done(input.id, { base_rev: input.base_rev }))
|
|
18135
|
+
}),
|
|
18080
18136
|
devpad_tasks_link: define_tool({
|
|
18081
18137
|
name: "devpad_tasks_link",
|
|
18082
18138
|
description: "Create a typed edge between two tasks (blocks | relates_to | references | discovered_from | tracks_metric)",
|
|
@@ -19753,6 +19809,7 @@ var ApiClient22 = class {
|
|
|
19753
19809
|
tree: (id2, depth) => wrap2(() => this.clients.tasks.get(`/tasks/${id2}/tree`, depth ? { query: { depth: String(depth) } } : {})),
|
|
19754
19810
|
near: (id2) => wrap2(() => this.clients.tasks.get(`/tasks/${id2}/near`)),
|
|
19755
19811
|
claim: (id2, data) => wrap2(() => this.clients.tasks.post(`/tasks/${id2}/claim`, { body: data })),
|
|
19812
|
+
done: (id2, data) => wrap2(() => this.clients.tasks.post(`/tasks/${id2}/done`, { body: data })),
|
|
19756
19813
|
link: (data) => wrap2(() => this.clients.tasks.post("/tasks/link", { body: data })),
|
|
19757
19814
|
unlink: (link_id) => wrap2(() => this.clients.tasks.delete(`/tasks/link/${link_id}`)),
|
|
19758
19815
|
apply: (data) => wrap2(() => this.clients.tasks.post("/tasks/apply", { body: data }))
|
|
@@ -20475,6 +20532,15 @@ var tools2 = {
|
|
|
20475
20532
|
}),
|
|
20476
20533
|
execute: async (client, input) => unwrap3(await client.tasks.claim(input.id, { actor: input.actor, base_rev: input.base_rev }))
|
|
20477
20534
|
}),
|
|
20535
|
+
devpad_tasks_done: define_tool2({
|
|
20536
|
+
name: "devpad_tasks_done",
|
|
20537
|
+
description: "Complete a task through the single completion entrypoint (CompletionEngine). Returns { completed, bubbled, hooks_fired } — bubbled is the ordered chain of ancestors an auto_children cascade also completed. 409 on stale base_rev or if already completed.",
|
|
20538
|
+
inputSchema: exports_external.object({
|
|
20539
|
+
id: exports_external.string().describe("Task ID"),
|
|
20540
|
+
base_rev: exports_external.number().int().describe("Expected current rev — optimistic concurrency guard")
|
|
20541
|
+
}),
|
|
20542
|
+
execute: async (client, input) => unwrap3(await client.tasks.done(input.id, { base_rev: input.base_rev }))
|
|
20543
|
+
}),
|
|
20478
20544
|
devpad_tasks_link: define_tool2({
|
|
20479
20545
|
name: "devpad_tasks_link",
|
|
20480
20546
|
description: "Create a typed edge between two tasks (blocks | relates_to | references | discovered_from | tracks_metric)",
|
|
@@ -24300,6 +24366,35 @@ var apply_log2 = sqliteTable("apply_log", {
|
|
|
24300
24366
|
response: text("response", { mode: "json" }).notNull(),
|
|
24301
24367
|
created_at: text("created_at").notNull().default(sql`(CURRENT_TIMESTAMP)`)
|
|
24302
24368
|
});
|
|
24369
|
+
var TASK_EVENT_KINDS2 = [
|
|
24370
|
+
"task.created",
|
|
24371
|
+
"task.updated",
|
|
24372
|
+
"task.completed",
|
|
24373
|
+
"task.reopened",
|
|
24374
|
+
"task.claimed",
|
|
24375
|
+
"edge.created",
|
|
24376
|
+
"edge.removed",
|
|
24377
|
+
"node.children_all_done",
|
|
24378
|
+
"policy.fired",
|
|
24379
|
+
"node.completion_stale"
|
|
24380
|
+
];
|
|
24381
|
+
var TASK_EVENT_ACTORS2 = ["user", "api", "policy", "github"];
|
|
24382
|
+
var TASK_EVENT_DISPATCH_STATUSES2 = ["pending", "dispatched"];
|
|
24383
|
+
var task_event2 = sqliteTable("task_event", {
|
|
24384
|
+
id: integer("id").primaryKey({ autoIncrement: true }),
|
|
24385
|
+
event_id: text("event_id").notNull().unique().$defaultFn(() => `evt_${crypto.randomUUID()}`),
|
|
24386
|
+
kind: text("kind", { enum: TASK_EVENT_KINDS2 }).notNull(),
|
|
24387
|
+
subject_id: text("subject_id").notNull(),
|
|
24388
|
+
project_id: text("project_id"),
|
|
24389
|
+
actor: text("actor", { enum: TASK_EVENT_ACTORS2 }).notNull(),
|
|
24390
|
+
payload: text("payload", { mode: "json" }).notNull(),
|
|
24391
|
+
occurred_at: text("occurred_at").notNull().default(sql`(CURRENT_TIMESTAMP)`),
|
|
24392
|
+
dispatch_status: text("dispatch_status", { enum: TASK_EVENT_DISPATCH_STATUSES2 }).notNull().default("pending"),
|
|
24393
|
+
dispatched_at: text("dispatched_at")
|
|
24394
|
+
}, (table3) => [
|
|
24395
|
+
index("task_event_subject_id_idx").on(table3.subject_id),
|
|
24396
|
+
index("task_event_dispatch_status_idx").on(table3.dispatch_status)
|
|
24397
|
+
]);
|
|
24303
24398
|
var checklist2 = sqliteTable("checklist", {
|
|
24304
24399
|
...entity3("checklist"),
|
|
24305
24400
|
task_id: text("task_id").notNull().references(() => task2.id),
|
|
@@ -24490,6 +24585,9 @@ var task_link_relations2 = relations(task_link2, ({ one }) => ({
|
|
|
24490
24585
|
var task_rollup_relations2 = relations(task_rollup2, ({ one }) => ({
|
|
24491
24586
|
task: one(task2, { fields: [task_rollup2.task_id], references: [task2.id] })
|
|
24492
24587
|
}));
|
|
24588
|
+
var task_event_relations2 = relations(task_event2, ({ one }) => ({
|
|
24589
|
+
subject: one(task2, { fields: [task_event2.subject_id], references: [task2.id] })
|
|
24590
|
+
}));
|
|
24493
24591
|
var checklist_relations2 = relations(checklist2, ({ one, many }) => ({
|
|
24494
24592
|
task: one(task2, { fields: [checklist2.task_id], references: [task2.id] }),
|
|
24495
24593
|
items: many(checklist_item2)
|
|
@@ -24852,6 +24950,20 @@ var apply_request2 = exports_external.object({
|
|
|
24852
24950
|
ops: exports_external.array(apply_op2).min(1)
|
|
24853
24951
|
});
|
|
24854
24952
|
var claim_request2 = exports_external.object({ actor: exports_external.string().min(1), base_rev: exports_external.number().int() });
|
|
24953
|
+
var done_request2 = exports_external.object({ base_rev: exports_external.number().int() });
|
|
24954
|
+
var task_event_actor2 = exports_external.enum(TASK_EVENT_ACTORS2);
|
|
24955
|
+
var task_event_payload2 = exports_external.discriminatedUnion("kind", [
|
|
24956
|
+
exports_external.object({ kind: exports_external.literal("task.created"), title: exports_external.string() }),
|
|
24957
|
+
exports_external.object({ kind: exports_external.literal("task.updated"), fields: exports_external.array(exports_external.string()) }),
|
|
24958
|
+
exports_external.object({ kind: exports_external.literal("task.completed"), via: exports_external.enum(COMPLETED_VIA_VALUES2) }),
|
|
24959
|
+
exports_external.object({ kind: exports_external.literal("task.reopened"), via: exports_external.enum(COMPLETED_VIA_VALUES2) }),
|
|
24960
|
+
exports_external.object({ kind: exports_external.literal("task.claimed"), actor: exports_external.string() }),
|
|
24961
|
+
exports_external.object({ kind: exports_external.literal("edge.created"), link_kind: task_link_kind2, dst_id: exports_external.string().nullable() }),
|
|
24962
|
+
exports_external.object({ kind: exports_external.literal("edge.removed"), link_kind: task_link_kind2, dst_id: exports_external.string().nullable() }),
|
|
24963
|
+
exports_external.object({ kind: exports_external.literal("node.children_all_done") }),
|
|
24964
|
+
exports_external.object({ kind: exports_external.literal("policy.fired"), policy: exports_external.enum(COMPLETION_POLICIES2) }),
|
|
24965
|
+
exports_external.object({ kind: exports_external.literal("node.completion_stale"), child_id: exports_external.string() })
|
|
24966
|
+
]);
|
|
24855
24967
|
|
|
24856
24968
|
// src/graph-commands.ts
|
|
24857
24969
|
async function print_json(data) {
|
|
@@ -24980,7 +25092,7 @@ async function resolve_owner_id2(client) {
|
|
|
24980
25092
|
// src/task-response.ts
|
|
24981
25093
|
init_zod();
|
|
24982
25094
|
var task_mutation_response = exports_external.object({
|
|
24983
|
-
task: exports_external.object({ id: exports_external.string(), title: exports_external.string() }).passthrough()
|
|
25095
|
+
task: exports_external.object({ id: exports_external.string(), title: exports_external.string(), rev: exports_external.number().int().optional() }).passthrough()
|
|
24984
25096
|
}).passthrough();
|
|
24985
25097
|
function parse_task_response(data) {
|
|
24986
25098
|
const parsed = task_mutation_response.safeParse(data);
|
|
@@ -25211,23 +25323,28 @@ tasks.command("update <id>").description("Update a task (partial \u2014 only pro
|
|
|
25211
25323
|
handleError(error);
|
|
25212
25324
|
}
|
|
25213
25325
|
});
|
|
25214
|
-
tasks.command("done <id>").description("Mark a task as done").action(async (id3) => {
|
|
25326
|
+
tasks.command("done <id>").description("Mark a task as done through the completion engine (bubbles an auto_children cascade up the tree)").option("--json", "Print the raw { completed, bubbled, hooks_fired } response as JSON instead of a summary").action(async (id3, options) => {
|
|
25215
25327
|
const spinner = make_spinner2("Marking task as done...").start();
|
|
25216
25328
|
try {
|
|
25217
|
-
const
|
|
25218
|
-
|
|
25329
|
+
const get_tool = getTool("devpad_tasks_get");
|
|
25330
|
+
const done_tool = getTool("devpad_tasks_done");
|
|
25331
|
+
if (!get_tool || !done_tool)
|
|
25219
25332
|
throw new Error("Tool not found");
|
|
25220
25333
|
const client = getApiClient();
|
|
25221
|
-
const
|
|
25222
|
-
|
|
25223
|
-
|
|
25224
|
-
|
|
25225
|
-
|
|
25226
|
-
|
|
25227
|
-
|
|
25228
|
-
|
|
25334
|
+
const current = parse_task_response(await get_tool.execute(client, { id: id3 }));
|
|
25335
|
+
if (current.task.rev === undefined)
|
|
25336
|
+
throw new Error("Task response is missing rev");
|
|
25337
|
+
const result = await done_tool.execute(client, { id: id3, base_rev: current.task.rev });
|
|
25338
|
+
if (options.json) {
|
|
25339
|
+
spinner.stop();
|
|
25340
|
+
console.log(JSON.stringify(result, null, 2));
|
|
25341
|
+
return;
|
|
25342
|
+
}
|
|
25343
|
+
const bubbled = Array.isArray(result.bubbled) ? result.bubbled : [];
|
|
25344
|
+
const bubbled_note = bubbled.length > 0 ? ` (+${String(bubbled.length)} bubbled: ${bubbled.map((b) => b.task.title).join(", ")})` : "";
|
|
25345
|
+
spinner.succeed(`Task "${current.task.title}" marked as done${bubbled_note}`);
|
|
25229
25346
|
} catch (error) {
|
|
25230
|
-
spinner.fail("Failed to
|
|
25347
|
+
spinner.fail("Failed to mark task as done");
|
|
25231
25348
|
handleError(error);
|
|
25232
25349
|
}
|
|
25233
25350
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@devpad/cli",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.4",
|
|
4
4
|
"description": "Command line interface for devpad project management",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cli",
|
|
@@ -50,10 +50,10 @@
|
|
|
50
50
|
"mime": "^3.0.0"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
|
-
"@devpad/api": "^2.3.
|
|
54
|
-
"@devpad/pipeline-fakes": "^2.3.
|
|
55
|
-
"@devpad/pipeline-templates": "^2.3.
|
|
56
|
-
"@devpad/schema": "^2.3.
|
|
53
|
+
"@devpad/api": "^2.3.4",
|
|
54
|
+
"@devpad/pipeline-fakes": "^2.3.4",
|
|
55
|
+
"@devpad/pipeline-templates": "^2.3.4",
|
|
56
|
+
"@devpad/schema": "^2.3.4",
|
|
57
57
|
"@types/node": "^20.11.24",
|
|
58
58
|
"bun-types": "latest",
|
|
59
59
|
"chalk": "^5.3.0",
|