@devpad/api 2.4.0 → 2.4.2

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.d.ts CHANGED
@@ -2,7 +2,7 @@ import { G as PostListParams, T as PostsResponse, x as Post, D as PostCreate, Q
2
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-CpUFC2tW.js';
3
3
  import { z } from 'zod';
4
4
  import { c as ApiKey, O as Project, aB as UpsertProject, G as GetConfigResult, a0 as SaveConfigRequest, am as TodoUpdate, H as HistoryAction, M as Milestone, o as Goal, p as Hook, v as HookTrigger, r as HookActionPublic, at as UpsertHook, t as HookDelivery, ai as TaskWithDetails, aE as UpsertTodo, aC as UpsertTag, ab as Task, ae as TaskLink, C as ClaimRequest, m as DoneRequest, a as AdvanceStageRequest, aD as UpsertTaskLink, f as ApplyRequest, e as ApplyOp, aa as TagWithTypedColor, l as Document, S as PushDocRequest, al as ThreadMarker, i as CreateThreadRequest, b as AnnotationThread, T as PushInterfaceReportRequest, y as InterfaceDiffClass, a4 as Signoff, W as RequestCheckpointRequest, k as DecideCheckpointRequest, X as ReviewItem, D as DashboardResponse, K as PipelineRun, L as PipelineStageEvent, B as PipelineGrant, J as PipelinePackage, P as PipelineAnalysisTemplate, F as PipelineOidcTrust } from './types.d-BIJAwHaZ.js';
5
- export { Q as ProjectConfig } from './types.d-BIJAwHaZ.js';
5
+ export { Q as ProjectConfig, Y as ReviewItemKind } from './types.d-BIJAwHaZ.js';
6
6
  import { Result } from '@f0rbit/corpus';
7
7
  export { Result, err, ok } from '@f0rbit/corpus';
8
8
  import { H as HookDeliveryStatus, C as CompletedVia, i as StageEventKind } from './schema.d-CaVQ-Ate.js';
@@ -737,13 +737,30 @@ type ReadyResponse = {
737
737
  items: Task[];
738
738
  next_cursor: string | null;
739
739
  };
740
+ /** `rollups` is keyed by task id — see `packages/core/src/services/graph/rollup.ts`'s `RollupCounts`; a childless task is simply absent. */
741
+ type RollupCounts = {
742
+ direct_done: number;
743
+ direct_total: number;
744
+ subtree_done: number;
745
+ subtree_total: number;
746
+ };
747
+ /** Keyed by task id — see `packages/core/src/services/graph/edge-summary.ts`'s `EdgeSummary`; single source of truth for the outline's row-level ⛓/ready/⚡/stale chips. */
748
+ type EdgeSummary = {
749
+ blocked_count: number;
750
+ ready: boolean;
751
+ hook: boolean;
752
+ stale: boolean;
753
+ };
740
754
  type TreeResponse = {
741
755
  task: Task;
742
756
  descendants: Task[];
757
+ rollups: Partial<Record<string, RollupCounts>>;
758
+ edge_summary: Partial<Record<string, EdgeSummary>>;
743
759
  };
744
760
  type NearResponse = {
745
761
  links: TaskLink[];
746
762
  tasks: Task[];
763
+ rollups: Partial<Record<string, RollupCounts>>;
747
764
  };
748
765
  type ApplyOpResult = {
749
766
  op: ApplyOp["op"];
@@ -1125,8 +1142,10 @@ declare class ApiClient {
1125
1142
  }) => Promise<ApiResult<ReadyResponse>>;
1126
1143
  /** Bounded descendant subtree of a task. */
1127
1144
  tree: (id: string, depth?: number) => Promise<ApiResult<TreeResponse>>;
1128
- /** depth-2 link neighborhood around a task, including backlinks. */
1129
- near: (id: string) => Promise<ApiResult<NearResponse>>;
1145
+ /** Link neighborhood around a task (default depth 2, capped server-side at 3 — the graph lens' 1/2/3 toggle), including backlinks. */
1146
+ near: (id: string, depth?: number) => Promise<ApiResult<NearResponse>>;
1147
+ /** Immediate-parent-first ancestor chain — feeds the outline's zoom breadcrumbs. */
1148
+ ancestors: (id: string) => Promise<ApiResult<Task[]>>;
1130
1149
  /** Atomic claim: sets claimed_by/claimed_at + IN_PROGRESS, guarded on claimed_by IS NULL and base_rev. */
1131
1150
  claim: (id: string, data: ClaimRequest) => Promise<ApiResult<Task>>;
1132
1151
  /**
@@ -1137,6 +1156,15 @@ declare class ApiClient {
1137
1156
  * until phase A3.
1138
1157
  */
1139
1158
  done: (id: string, data: DoneRequest) => Promise<ApiResult<DoneResponse>>;
1159
+ /**
1160
+ * Policy-only reopen (v2.4 B2) — the server (`SqlCompletionEngine.reopen`)
1161
+ * is the sole enforcement point: a task whose `completed_via` isn't
1162
+ * `'policy'` 409s. No request body — the actor comes from the caller's
1163
+ * own auth channel.
1164
+ */
1165
+ reopen: (id: string) => Promise<ApiResult<{
1166
+ reopened: Task;
1167
+ }>>;
1140
1168
  /**
1141
1169
  * SDLC stage transition (v2.4, task A4.5) — gently enforced: a gated
1142
1170
  * hop missing its checkpoint 409s naming what's missing; `override:
@@ -1881,4 +1909,4 @@ declare const tools: Record<string, ToolDefinition>;
1881
1909
  declare const toolNames: string[];
1882
1910
  declare function getTool(name: string): ToolDefinition | undefined;
1883
1911
 
1884
- 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 PublicHook, 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 };
1912
+ export { AccessKey, Account, AddFilterInput, ApiClient, ApiError, type ApiResult, type ApiResultError, type ApplyResponse, type AuthMode, AuthenticationError, type BubbleStep, Category, CategoryCreate, CreateProfileInput, DecideCheckpointRequest, type DoneResponse, type EdgeSummary, Milestone, NetworkError, PlatformSettings, Post, PostContent, PostCreate, PostListParams, PostUpdate, PostsResponse, Profile, ProfileFilter, Project, type PublicHook, type PulseErrorIssue, type PulseErrorsResult, type PulseEventRow, type PulseEventsPage, type PulseLatencyByMinute, type PulseLatencyResult, type PulseLogsResult, type PulseSummary, type PulseSummaryByDay, type RequestHistoryEntry, type RequestOptions, ReviewItem, type RollupCounts, SaveConfigRequest, Signoff, 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
@@ -895,8 +895,12 @@ var ApiClient2 = class {
895
895
  tree: (id, depth) => wrap(
896
896
  () => this.clients.tasks.get(`/tasks/${id}/tree`, depth ? { query: { depth: String(depth) } } : {})
897
897
  ),
898
- /** depth-2 link neighborhood around a task, including backlinks. */
899
- near: (id) => wrap(() => this.clients.tasks.get(`/tasks/${id}/near`)),
898
+ /** Link neighborhood around a task (default depth 2, capped server-side at 3 — the graph lens' 1/2/3 toggle), including backlinks. */
899
+ near: (id, depth) => wrap(
900
+ () => this.clients.tasks.get(`/tasks/${id}/near`, depth ? { query: { depth: String(depth) } } : {})
901
+ ),
902
+ /** Immediate-parent-first ancestor chain — feeds the outline's zoom breadcrumbs. */
903
+ ancestors: (id) => wrap(() => this.clients.tasks.get(`/tasks/${id}/ancestors`)),
900
904
  /** Atomic claim: sets claimed_by/claimed_at + IN_PROGRESS, guarded on claimed_by IS NULL and base_rev. */
901
905
  claim: (id, data) => wrap(() => this.clients.tasks.post(`/tasks/${id}/claim`, { body: data })),
902
906
  /**
@@ -907,6 +911,13 @@ var ApiClient2 = class {
907
911
  * until phase A3.
908
912
  */
909
913
  done: (id, data) => wrap(() => this.clients.tasks.post(`/tasks/${id}/done`, { body: data })),
914
+ /**
915
+ * Policy-only reopen (v2.4 B2) — the server (`SqlCompletionEngine.reopen`)
916
+ * is the sole enforcement point: a task whose `completed_via` isn't
917
+ * `'policy'` 409s. No request body — the actor comes from the caller's
918
+ * own auth channel.
919
+ */
920
+ reopen: (id) => wrap(() => this.clients.tasks.post(`/tasks/${id}/reopen`)),
910
921
  /**
911
922
  * SDLC stage transition (v2.4, task A4.5) — gently enforced: a gated
912
923
  * hop missing its checkpoint 409s naming what's missing; `override:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devpad/api",
3
- "version": "2.4.0",
3
+ "version": "2.4.2",
4
4
  "description": "TypeScript client library for the devpad API - project and task management made simple",
5
5
  "keywords": [
6
6
  "api",
@@ -68,7 +68,7 @@
68
68
  "zod": "^3.22.4"
69
69
  },
70
70
  "devDependencies": {
71
- "@devpad/schema": "^2.4.0",
71
+ "@devpad/schema": "^2.4.2",
72
72
  "@types/node": "^20.11.24",
73
73
  "bun-types": "latest",
74
74
  "tsup": "^8.0.0",