@devpad/api 2.3.1 → 2.3.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/{chunk-DIX4XVUQ.js → chunk-ZPDYJASJ.js} +108 -7
- package/dist/index.d.ts +54 -5
- package/dist/index.js +92 -2
- package/dist/schema/blog.d.ts +570 -0
- package/dist/schema/index.d.ts +2 -2
- package/dist/schema/index.js +17 -1
- package/dist/schema/media.d.ts +2 -2
- package/dist/{schema.d-BeVFWenc.d.ts → schema.d-D3xGKqB8.d.ts} +565 -1
- package/dist/types.d-8FWQKyCL.d.ts +2293 -0
- package/dist/{types.d-ELBwaLBA.d.ts → types.d-BZOIiHoO.d.ts} +31 -31
- package/package.json +2 -2
- package/dist/types.d-DUtDEHYM.d.ts +0 -1045
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
// ../schema/dist/validation.js
|
|
2
|
-
import { z } from "zod";
|
|
3
|
-
|
|
4
1
|
// ../schema/dist/database/schema.js
|
|
5
2
|
import { relations, sql } from "drizzle-orm";
|
|
6
|
-
import { int, integer, primaryKey, sqliteTable, text, unique } from "drizzle-orm/sqlite-core";
|
|
3
|
+
import { index, int, integer, primaryKey, sqliteTable, text, unique } from "drizzle-orm/sqlite-core";
|
|
7
4
|
var timestamps = () => ({
|
|
8
5
|
created_at: text("created_at").notNull().default(sql`(CURRENT_TIMESTAMP)`),
|
|
9
6
|
updated_at: text("updated_at").notNull().default(sql`(CURRENT_TIMESTAMP)`)
|
|
@@ -145,6 +142,12 @@ var goal = sqliteTable("goal", {
|
|
|
145
142
|
target_time: text("target_time"),
|
|
146
143
|
finished_at: text("finished_at")
|
|
147
144
|
});
|
|
145
|
+
var GRAPH_DEPTH_CAP = 8;
|
|
146
|
+
var GRAPH_CHILDREN_CAP = 100;
|
|
147
|
+
var TASK_KINDS = ["task", "phase", "approval"];
|
|
148
|
+
var COMPLETION_POLICIES = ["manual", "auto_children"];
|
|
149
|
+
var COMPLETED_VIA_VALUES = ["user", "api", "policy"];
|
|
150
|
+
var TASK_LINK_KINDS = ["blocks", "relates_to", "references", "discovered_from", "tracks_metric"];
|
|
148
151
|
var task = sqliteTable("task", {
|
|
149
152
|
...owned_entity("task"),
|
|
150
153
|
title: text("title").notNull(),
|
|
@@ -157,7 +160,43 @@ var task = sqliteTable("task", {
|
|
|
157
160
|
end_time: text("end_time"),
|
|
158
161
|
summary: text("summary"),
|
|
159
162
|
codebase_task_id: text("codebase_task_id").references(() => codebase_tasks.id),
|
|
160
|
-
priority: text("priority", { enum: ["LOW", "MEDIUM", "HIGH"] }).notNull().default("LOW")
|
|
163
|
+
priority: text("priority", { enum: ["LOW", "MEDIUM", "HIGH"] }).notNull().default("LOW"),
|
|
164
|
+
// graph columns (v2.4) — self-FK omitted deliberately (mirrors
|
|
165
|
+
// checklist_item.parent_id): guarded writes in the graph service own
|
|
166
|
+
// the invariant, not a DB-level FK constraint.
|
|
167
|
+
parent_id: text("parent_id"),
|
|
168
|
+
rank: text("rank").notNull().default(""),
|
|
169
|
+
rev: integer("rev").notNull().default(0),
|
|
170
|
+
kind: text("kind", { enum: TASK_KINDS }).notNull().default("task"),
|
|
171
|
+
completion_policy: text("completion_policy", { enum: COMPLETION_POLICIES }).notNull().default("manual"),
|
|
172
|
+
completed_via: text("completed_via", { enum: COMPLETED_VIA_VALUES }),
|
|
173
|
+
claimed_by: text("claimed_by"),
|
|
174
|
+
claimed_at: text("claimed_at")
|
|
175
|
+
}, (table) => [index("task_parent_id_idx").on(table.parent_id)]);
|
|
176
|
+
var task_link = sqliteTable("task_link", {
|
|
177
|
+
...entity("link"),
|
|
178
|
+
src_id: text("src_id").notNull().references(() => task.id),
|
|
179
|
+
dst_id: text("dst_id").references(() => task.id),
|
|
180
|
+
kind: text("kind", { enum: TASK_LINK_KINDS }).notNull(),
|
|
181
|
+
ref: text("ref", { mode: "json" }),
|
|
182
|
+
note: text("note")
|
|
183
|
+
}, (table) => [
|
|
184
|
+
unique("task_link_unique").on(table.src_id, table.dst_id, table.kind),
|
|
185
|
+
index("task_link_src_id_idx").on(table.src_id),
|
|
186
|
+
index("task_link_dst_id_idx").on(table.dst_id)
|
|
187
|
+
]);
|
|
188
|
+
var task_rollup = sqliteTable("task_rollup", {
|
|
189
|
+
task_id: text("task_id").primaryKey().references(() => task.id),
|
|
190
|
+
direct_done: integer("direct_done").notNull().default(0),
|
|
191
|
+
direct_total: integer("direct_total").notNull().default(0),
|
|
192
|
+
subtree_done: integer("subtree_done").notNull().default(0),
|
|
193
|
+
subtree_total: integer("subtree_total").notNull().default(0)
|
|
194
|
+
});
|
|
195
|
+
var apply_log = sqliteTable("apply_log", {
|
|
196
|
+
idempotency_key: text("idempotency_key").primaryKey(),
|
|
197
|
+
owner_id: text("owner_id").notNull().references(() => user.id),
|
|
198
|
+
response: text("response", { mode: "json" }).notNull(),
|
|
199
|
+
created_at: text("created_at").notNull().default(sql`(CURRENT_TIMESTAMP)`)
|
|
161
200
|
});
|
|
162
201
|
var checklist = sqliteTable("checklist", {
|
|
163
202
|
...entity("checklist"),
|
|
@@ -342,7 +381,17 @@ var task_relations = relations(task, ({ one, many }) => ({
|
|
|
342
381
|
owner: one(user, { fields: [task.owner_id], references: [user.id] }),
|
|
343
382
|
goal: one(goal, { fields: [task.goal_id], references: [goal.id] }),
|
|
344
383
|
codebase_task: one(codebase_tasks, { fields: [task.codebase_task_id], references: [codebase_tasks.id] }),
|
|
345
|
-
checklists: many(checklist)
|
|
384
|
+
checklists: many(checklist),
|
|
385
|
+
outgoing_links: many(task_link, { relationName: "task_link_src" }),
|
|
386
|
+
incoming_links: many(task_link, { relationName: "task_link_dst" }),
|
|
387
|
+
rollup: one(task_rollup, { fields: [task.id], references: [task_rollup.task_id] })
|
|
388
|
+
}));
|
|
389
|
+
var task_link_relations = relations(task_link, ({ one }) => ({
|
|
390
|
+
src: one(task, { fields: [task_link.src_id], references: [task.id], relationName: "task_link_src" }),
|
|
391
|
+
dst: one(task, { fields: [task_link.dst_id], references: [task.id], relationName: "task_link_dst" })
|
|
392
|
+
}));
|
|
393
|
+
var task_rollup_relations = relations(task_rollup, ({ one }) => ({
|
|
394
|
+
task: one(task, { fields: [task_rollup.task_id], references: [task.id] })
|
|
346
395
|
}));
|
|
347
396
|
var checklist_relations = relations(checklist, ({ one, many }) => ({
|
|
348
397
|
task: one(task, { fields: [checklist.task_id], references: [task.id] }),
|
|
@@ -387,6 +436,7 @@ var pipeline_oidc_trust_relations = relations(pipeline_oidc_trust, ({ one }) =>
|
|
|
387
436
|
}));
|
|
388
437
|
|
|
389
438
|
// ../schema/dist/validation.js
|
|
439
|
+
import { z } from "zod";
|
|
390
440
|
var upsert_project = z.object({
|
|
391
441
|
id: z.string().optional().nullable(),
|
|
392
442
|
project_id: z.string(),
|
|
@@ -440,6 +490,13 @@ var upsert_todo = z.object({
|
|
|
440
490
|
owner_id: z.string(),
|
|
441
491
|
project_id: z.string().optional().nullable(),
|
|
442
492
|
goal_id: z.string().optional().nullable(),
|
|
493
|
+
// v2.4 graph fields. `completed_via` is deliberately absent — it's
|
|
494
|
+
// engine-owned (CompletionEngine, phase A2) and must never be settable
|
|
495
|
+
// from client input.
|
|
496
|
+
parent_id: z.string().optional().nullable(),
|
|
497
|
+
rank: z.string().optional(),
|
|
498
|
+
kind: z.union([z.literal("task"), z.literal("phase"), z.literal("approval")]).optional(),
|
|
499
|
+
completion_policy: z.union([z.literal("manual"), z.literal("auto_children")]).optional(),
|
|
443
500
|
force: z.boolean().optional().describe("Override protection on user-modified entities")
|
|
444
501
|
});
|
|
445
502
|
var update_action = z.union([
|
|
@@ -666,8 +723,46 @@ var dashboard_response = z.object({
|
|
|
666
723
|
approval_turnaround_p50_ms: z.number().nonnegative().nullable(),
|
|
667
724
|
rollback_rate: z.number().min(0).max(1).nullable()
|
|
668
725
|
});
|
|
726
|
+
var external_ref = z.discriminatedUnion("type", [
|
|
727
|
+
z.object({ type: z.literal("pr"), url: z.string().min(1) }),
|
|
728
|
+
z.object({ type: z.literal("commit"), sha: z.string().min(1) }),
|
|
729
|
+
z.object({ type: z.literal("file"), path: z.string().min(1) }),
|
|
730
|
+
z.object({ type: z.literal("doc"), doc_id: z.string().min(1) }),
|
|
731
|
+
z.object({ type: z.literal("metric"), name: z.string().min(1) }),
|
|
732
|
+
z.object({ type: z.literal("pipeline_run"), run_id: z.string().min(1) })
|
|
733
|
+
]);
|
|
734
|
+
var task_link_kind = z.enum(TASK_LINK_KINDS);
|
|
735
|
+
var upsert_task_link = z.object({
|
|
736
|
+
id: z.string().optional().nullable(),
|
|
737
|
+
src_id: z.string(),
|
|
738
|
+
dst_id: z.string().nullable().optional(),
|
|
739
|
+
kind: task_link_kind,
|
|
740
|
+
ref: external_ref.nullable().optional(),
|
|
741
|
+
note: z.string().nullable().optional()
|
|
742
|
+
});
|
|
743
|
+
var apply_op = z.discriminatedUnion("op", [
|
|
744
|
+
z.object({
|
|
745
|
+
op: z.literal("create"),
|
|
746
|
+
handle: z.string().optional().describe("Temp handle (e.g. '$0') other ops in this batch may reference"),
|
|
747
|
+
data: upsert_todo
|
|
748
|
+
}),
|
|
749
|
+
z.object({ op: z.literal("update"), id: z.string(), base_rev: z.number().int(), data: upsert_todo.partial() }),
|
|
750
|
+
z.object({ op: z.literal("reparent"), id: z.string(), parent_id: z.string().nullable(), base_rev: z.number().int() }),
|
|
751
|
+
z.object({ op: z.literal("link"), link: upsert_task_link }),
|
|
752
|
+
z.object({ op: z.literal("unlink"), id: z.string() }),
|
|
753
|
+
z.object({ op: z.literal("claim"), id: z.string(), actor: z.string(), base_rev: z.number().int() }),
|
|
754
|
+
z.object({ op: z.literal("complete"), id: z.string(), base_rev: z.number().int() })
|
|
755
|
+
]);
|
|
756
|
+
var apply_request = z.object({
|
|
757
|
+
idempotency_key: z.string().min(1),
|
|
758
|
+
base_revs: z.record(z.string(), z.number().int()).optional(),
|
|
759
|
+
ops: z.array(apply_op).min(1)
|
|
760
|
+
});
|
|
761
|
+
var claim_request = z.object({ actor: z.string().min(1), base_rev: z.number().int() });
|
|
669
762
|
|
|
670
763
|
export {
|
|
764
|
+
GRAPH_DEPTH_CAP,
|
|
765
|
+
GRAPH_CHILDREN_CAP,
|
|
671
766
|
RUN_STATUSES,
|
|
672
767
|
STAGE_EVENT_KINDS,
|
|
673
768
|
upsert_project,
|
|
@@ -702,5 +797,11 @@ export {
|
|
|
702
797
|
upsert_pipeline_oidc_trust,
|
|
703
798
|
webhook_event_body,
|
|
704
799
|
dashboard_window_query,
|
|
705
|
-
dashboard_response
|
|
800
|
+
dashboard_response,
|
|
801
|
+
external_ref,
|
|
802
|
+
task_link_kind,
|
|
803
|
+
upsert_task_link,
|
|
804
|
+
apply_op,
|
|
805
|
+
apply_request,
|
|
806
|
+
claim_request
|
|
706
807
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { G as PostListParams, T as PostsResponse, x as Post, D as PostCreate, Q as PostUpdate, Z as VersionInfo, y as PostContent, C as Category, k as CategoryCreate, A as AccessKey } from './types.d-BhWQru2j.js';
|
|
2
|
-
import { ai as Profile, u as CreateProfileInput, aw as UpdateProfileInput, aj as ProfileFilter, c as AddFilterInput, aq as Timeline, A as Account, ae as PlatformSettings } from './types.d-
|
|
2
|
+
import { ai as Profile, u as CreateProfileInput, aw as UpdateProfileInput, aj as ProfileFilter, c as AddFilterInput, aq as Timeline, A as Account, ae as PlatformSettings } from './types.d-BZOIiHoO.js';
|
|
3
3
|
import { z } from 'zod';
|
|
4
|
-
import { a as ApiKey,
|
|
5
|
-
export {
|
|
4
|
+
import { a as ApiKey, p as Project, a4 as UpsertProject, G as GetConfigResult, S as SaveConfigRequest, Q as TodoUpdate, H as HistoryAction, M as Milestone, h as Goal, O as TaskWithDetails, a7 as UpsertTodo, a5 as UpsertTag, B as Task, F as TaskLink, C as ClaimRequest, a6 as UpsertTaskLink, d as ApplyRequest, c as ApplyOp, z as TagWithTypedColor, D as DashboardResponse, n as PipelineRun, o as PipelineStageEvent, k as PipelineGrant, m as PipelinePackage, P as PipelineAnalysisTemplate, l as PipelineOidcTrust } from './types.d-8FWQKyCL.js';
|
|
5
|
+
export { q as ProjectConfig } from './types.d-8FWQKyCL.js';
|
|
6
6
|
import { Result } from '@f0rbit/corpus';
|
|
7
7
|
export { Result, err, ok } from '@f0rbit/corpus';
|
|
8
|
-
import { S as StageEventKind } from './schema.d-
|
|
8
|
+
import { S as StageEventKind } from './schema.d-D3xGKqB8.js';
|
|
9
9
|
import 'drizzle-orm';
|
|
10
10
|
import './media.d-R87HGuRp.js';
|
|
11
11
|
import 'drizzle-orm/sqlite-core';
|
|
@@ -678,6 +678,27 @@ type ApiResultError = {
|
|
|
678
678
|
type ApiResult<T> = Result<T, ApiResultError>;
|
|
679
679
|
declare function wrap<T>(fn: () => Promise<T>): Promise<ApiResult<T>>;
|
|
680
680
|
|
|
681
|
+
type ReadyResponse = {
|
|
682
|
+
items: Task[];
|
|
683
|
+
next_cursor: string | null;
|
|
684
|
+
};
|
|
685
|
+
type TreeResponse = {
|
|
686
|
+
task: Task;
|
|
687
|
+
descendants: Task[];
|
|
688
|
+
};
|
|
689
|
+
type NearResponse = {
|
|
690
|
+
links: TaskLink[];
|
|
691
|
+
tasks: Task[];
|
|
692
|
+
};
|
|
693
|
+
type ApplyOpResult = {
|
|
694
|
+
op: ApplyOp["op"];
|
|
695
|
+
id: string;
|
|
696
|
+
};
|
|
697
|
+
type ApplyResponse = {
|
|
698
|
+
idempotency_key: string;
|
|
699
|
+
results: ApplyOpResult[];
|
|
700
|
+
};
|
|
701
|
+
|
|
681
702
|
type TagWithCount = {
|
|
682
703
|
tag: string;
|
|
683
704
|
count: number;
|
|
@@ -1016,6 +1037,34 @@ declare class ApiClient {
|
|
|
1016
1037
|
*/
|
|
1017
1038
|
get: (task_id: string) => Promise<ApiResult<HistoryAction[]>>;
|
|
1018
1039
|
};
|
|
1040
|
+
/**
|
|
1041
|
+
* Ready-to-work tasks: not completed, not blocked by an incomplete
|
|
1042
|
+
* `blocks` edge, no incomplete children, start_time null-or-passed.
|
|
1043
|
+
*/
|
|
1044
|
+
ready: (filters?: {
|
|
1045
|
+
project_id?: string;
|
|
1046
|
+
limit?: number;
|
|
1047
|
+
cursor?: string;
|
|
1048
|
+
}) => Promise<ApiResult<ReadyResponse>>;
|
|
1049
|
+
/** Bounded descendant subtree of a task. */
|
|
1050
|
+
tree: (id: string, depth?: number) => Promise<ApiResult<TreeResponse>>;
|
|
1051
|
+
/** depth-2 link neighborhood around a task, including backlinks. */
|
|
1052
|
+
near: (id: string) => Promise<ApiResult<NearResponse>>;
|
|
1053
|
+
/** Atomic claim: sets claimed_by/claimed_at + IN_PROGRESS, guarded on claimed_by IS NULL and base_rev. */
|
|
1054
|
+
claim: (id: string, data: ClaimRequest) => Promise<ApiResult<Task>>;
|
|
1055
|
+
/** Create a typed edge between two tasks (or a task and an external ref). */
|
|
1056
|
+
link: (data: UpsertTaskLink) => Promise<ApiResult<TaskLink>>;
|
|
1057
|
+
/** Remove a typed edge by its own id. */
|
|
1058
|
+
unlink: (link_id: string) => Promise<ApiResult<{
|
|
1059
|
+
success: boolean;
|
|
1060
|
+
}>>;
|
|
1061
|
+
/**
|
|
1062
|
+
* Batch apply — create/update/reparent/link/unlink/claim/complete in one
|
|
1063
|
+
* atomic call, with `$0`/`$1`… temp handles for subtree creation.
|
|
1064
|
+
* Replaying the same `idempotency_key` returns the stored response
|
|
1065
|
+
* verbatim rather than re-executing.
|
|
1066
|
+
*/
|
|
1067
|
+
apply: (data: ApplyRequest) => Promise<ApiResult<ApplyResponse>>;
|
|
1019
1068
|
};
|
|
1020
1069
|
/**
|
|
1021
1070
|
* Tags namespace with Result-wrapped operations
|
|
@@ -1669,4 +1718,4 @@ declare const tools: Record<string, ToolDefinition>;
|
|
|
1669
1718
|
declare const toolNames: string[];
|
|
1670
1719
|
declare function getTool(name: string): ToolDefinition | undefined;
|
|
1671
1720
|
|
|
1672
|
-
export { AccessKey, Account, AddFilterInput, ApiClient, ApiError, type ApiResult, type ApiResultError, type AuthMode, AuthenticationError, Category, CategoryCreate, CreateProfileInput, NetworkError, PlatformSettings, Post, PostContent, PostCreate, PostListParams, PostUpdate, PostsResponse, Profile, ProfileFilter, Project, type PulseErrorIssue, type PulseErrorsResult, type PulseEventRow, type PulseEventsPage, type PulseLatencyByMinute, type PulseLatencyResult, type PulseLogsResult, type PulseSummary, type PulseSummaryByDay, type RequestHistoryEntry, type RequestOptions, SaveConfigRequest, TaskWithDetails, Timeline, type ToolDefinition, UpdateProfileInput, UpsertProject, UpsertTag, UpsertTodo, ValidationError, VersionInfo, ApiClient as default, getTool, getUserFriendlyErrorMessage, parseZodErrors, pulseSummaryHasData, toolNames, tools, wrap };
|
|
1721
|
+
export { AccessKey, Account, AddFilterInput, ApiClient, ApiError, type ApiResult, type ApiResultError, type AuthMode, AuthenticationError, Category, CategoryCreate, CreateProfileInput, NetworkError, PlatformSettings, Post, PostContent, PostCreate, PostListParams, PostUpdate, PostsResponse, Profile, ProfileFilter, Project, type PulseErrorIssue, type PulseErrorsResult, type PulseEventRow, type PulseEventsPage, type PulseLatencyByMinute, type PulseLatencyResult, type PulseLogsResult, type PulseSummary, type PulseSummaryByDay, type RequestHistoryEntry, type RequestOptions, SaveConfigRequest, Task, TaskWithDetails, Timeline, type ToolDefinition, UpdateProfileInput, UpsertProject, UpsertTag, UpsertTodo, ValidationError, VersionInfo, ApiClient as default, getTool, getUserFriendlyErrorMessage, parseZodErrors, pulseSummaryHasData, toolNames, tools, wrap };
|
package/dist/index.js
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
RUN_STATUSES,
|
|
3
3
|
STAGE_EVENT_KINDS,
|
|
4
|
+
apply_request,
|
|
4
5
|
save_config_request,
|
|
5
6
|
save_tags_request,
|
|
6
7
|
upsert_goal,
|
|
7
8
|
upsert_milestone,
|
|
8
9
|
upsert_project,
|
|
10
|
+
upsert_task_link,
|
|
9
11
|
upsert_todo
|
|
10
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-ZPDYJASJ.js";
|
|
11
13
|
import {
|
|
12
14
|
CategoryCreateSchema,
|
|
13
15
|
PostCreateSchema,
|
|
@@ -858,7 +860,37 @@ var ApiClient2 = class {
|
|
|
858
860
|
* Get task history by task ID
|
|
859
861
|
*/
|
|
860
862
|
get: (task_id) => wrap(() => this.clients.tasks.get(`/tasks/history/${task_id}`))
|
|
861
|
-
}
|
|
863
|
+
},
|
|
864
|
+
/**
|
|
865
|
+
* Ready-to-work tasks: not completed, not blocked by an incomplete
|
|
866
|
+
* `blocks` edge, no incomplete children, start_time null-or-passed.
|
|
867
|
+
*/
|
|
868
|
+
ready: (filters) => wrap(() => {
|
|
869
|
+
const query = {};
|
|
870
|
+
if (filters?.project_id) query.project = filters.project_id;
|
|
871
|
+
if (filters?.limit) query.limit = String(filters.limit);
|
|
872
|
+
if (filters?.cursor) query.cursor = filters.cursor;
|
|
873
|
+
return this.clients.tasks.get("/tasks/ready", Object.keys(query).length > 0 ? { query } : {});
|
|
874
|
+
}),
|
|
875
|
+
/** Bounded descendant subtree of a task. */
|
|
876
|
+
tree: (id, depth) => wrap(
|
|
877
|
+
() => this.clients.tasks.get(`/tasks/${id}/tree`, depth ? { query: { depth: String(depth) } } : {})
|
|
878
|
+
),
|
|
879
|
+
/** depth-2 link neighborhood around a task, including backlinks. */
|
|
880
|
+
near: (id) => wrap(() => this.clients.tasks.get(`/tasks/${id}/near`)),
|
|
881
|
+
/** Atomic claim: sets claimed_by/claimed_at + IN_PROGRESS, guarded on claimed_by IS NULL and base_rev. */
|
|
882
|
+
claim: (id, data) => wrap(() => this.clients.tasks.post(`/tasks/${id}/claim`, { body: data })),
|
|
883
|
+
/** Create a typed edge between two tasks (or a task and an external ref). */
|
|
884
|
+
link: (data) => wrap(() => this.clients.tasks.post("/tasks/link", { body: data })),
|
|
885
|
+
/** Remove a typed edge by its own id. */
|
|
886
|
+
unlink: (link_id) => wrap(() => this.clients.tasks.delete(`/tasks/link/${link_id}`)),
|
|
887
|
+
/**
|
|
888
|
+
* Batch apply — create/update/reparent/link/unlink/claim/complete in one
|
|
889
|
+
* atomic call, with `$0`/`$1`… temp handles for subtree creation.
|
|
890
|
+
* Replaying the same `idempotency_key` returns the stored response
|
|
891
|
+
* verbatim rather than re-executing.
|
|
892
|
+
*/
|
|
893
|
+
apply: (data) => wrap(() => this.clients.tasks.post("/tasks/apply", { body: data }))
|
|
862
894
|
};
|
|
863
895
|
/**
|
|
864
896
|
* Tags namespace with Result-wrapped operations
|
|
@@ -1848,6 +1880,64 @@ var tools = {
|
|
|
1848
1880
|
}),
|
|
1849
1881
|
execute: async (client, input) => unwrap(await client.tasks.history.get(input.task_id))
|
|
1850
1882
|
}),
|
|
1883
|
+
// Graph operations (v2.4)
|
|
1884
|
+
devpad_tasks_ready: define_tool({
|
|
1885
|
+
name: "devpad_tasks_ready",
|
|
1886
|
+
description: "List tasks ready to work: not completed, not blocked by an incomplete 'blocks' edge, no incomplete children, start_time null-or-passed",
|
|
1887
|
+
inputSchema: z2.object({
|
|
1888
|
+
project_id: z2.string().optional().describe("Filter by project ID"),
|
|
1889
|
+
limit: z2.number().int().positive().optional().describe("Page size (default 20, max 100)"),
|
|
1890
|
+
cursor: z2.string().optional().describe("Pagination cursor from a previous page's next_cursor")
|
|
1891
|
+
}),
|
|
1892
|
+
execute: async (client, input) => unwrap(await client.tasks.ready(input))
|
|
1893
|
+
}),
|
|
1894
|
+
devpad_tasks_tree: define_tool({
|
|
1895
|
+
name: "devpad_tasks_tree",
|
|
1896
|
+
description: "Get a task and its bounded descendant subtree",
|
|
1897
|
+
inputSchema: z2.object({
|
|
1898
|
+
id: z2.string().describe("Task ID"),
|
|
1899
|
+
depth: z2.number().int().positive().optional().describe("Max hops down (default/cap: GRAPH_DEPTH_CAP)")
|
|
1900
|
+
}),
|
|
1901
|
+
execute: async (client, input) => unwrap(await client.tasks.tree(input.id, input.depth))
|
|
1902
|
+
}),
|
|
1903
|
+
devpad_tasks_near: define_tool({
|
|
1904
|
+
name: "devpad_tasks_near",
|
|
1905
|
+
description: "Get the depth-2 link neighborhood around a task, including backlinks",
|
|
1906
|
+
inputSchema: z2.object({
|
|
1907
|
+
id: z2.string().describe("Task ID")
|
|
1908
|
+
}),
|
|
1909
|
+
execute: async (client, input) => unwrap(await client.tasks.near(input.id))
|
|
1910
|
+
}),
|
|
1911
|
+
devpad_tasks_claim: define_tool({
|
|
1912
|
+
name: "devpad_tasks_claim",
|
|
1913
|
+
description: "Atomically claim a task for an agent (sets claimed_by + IN_PROGRESS); 409 if already claimed or stale base_rev",
|
|
1914
|
+
inputSchema: z2.object({
|
|
1915
|
+
id: z2.string().describe("Task ID"),
|
|
1916
|
+
actor: z2.string().describe("Identifier for the claiming agent"),
|
|
1917
|
+
base_rev: z2.number().int().describe("Expected current rev \u2014 optimistic concurrency guard")
|
|
1918
|
+
}),
|
|
1919
|
+
execute: async (client, input) => unwrap(await client.tasks.claim(input.id, { actor: input.actor, base_rev: input.base_rev }))
|
|
1920
|
+
}),
|
|
1921
|
+
devpad_tasks_link: define_tool({
|
|
1922
|
+
name: "devpad_tasks_link",
|
|
1923
|
+
description: "Create a typed edge between two tasks (blocks | relates_to | references | discovered_from | tracks_metric)",
|
|
1924
|
+
inputSchema: upsert_task_link,
|
|
1925
|
+
execute: async (client, input) => unwrap(await client.tasks.link(input))
|
|
1926
|
+
}),
|
|
1927
|
+
devpad_tasks_unlink: define_tool({
|
|
1928
|
+
name: "devpad_tasks_unlink",
|
|
1929
|
+
description: "Remove a typed edge by its own id",
|
|
1930
|
+
inputSchema: z2.object({
|
|
1931
|
+
id: z2.string().describe("task_link ID")
|
|
1932
|
+
}),
|
|
1933
|
+
execute: async (client, input) => unwrap(await client.tasks.unlink(input.id))
|
|
1934
|
+
}),
|
|
1935
|
+
devpad_tasks_apply: define_tool({
|
|
1936
|
+
name: "devpad_tasks_apply",
|
|
1937
|
+
description: "Batch apply create/update/reparent/link/unlink/claim/complete ops atomically, with $0/$1\u2026 temp handles for subtree creation. Replaying the same idempotency_key returns the prior response verbatim.",
|
|
1938
|
+
inputSchema: apply_request,
|
|
1939
|
+
execute: async (client, input) => unwrap(await client.tasks.apply(input))
|
|
1940
|
+
}),
|
|
1851
1941
|
// User operations
|
|
1852
1942
|
devpad_user_me: define_tool({
|
|
1853
1943
|
name: "devpad_user_me",
|