@anhlp/alp 0.0.1-beta.3 → 0.0.1-beta.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.
Files changed (175) hide show
  1. package/README.md +14 -410
  2. package/bin/alp.js +5 -0
  3. package/lib/launcher.js +136 -0
  4. package/package.json +19 -104
  5. package/dist/THIRD-PARTY-NOTICES.txt +0 -626
  6. package/dist/acp.js +0 -19903
  7. package/dist/alpd.js +0 -42558
  8. package/docs/modular-monorepo.md +0 -210
  9. package/packages/cli/README.md +0 -7
  10. package/packages/cli/dist/THIRD-PARTY-NOTICES.txt +0 -626
  11. package/packages/cli/dist/acp/agent.d.ts +0 -37
  12. package/packages/cli/dist/acp/agent.js +0 -489
  13. package/packages/cli/dist/acp/main.d.ts +0 -4
  14. package/packages/cli/dist/acp/main.js +0 -23
  15. package/packages/cli/dist/acp.js +0 -19903
  16. package/packages/cli/dist/alpd.js +0 -42558
  17. package/packages/cli/dist/backup.d.ts +0 -4
  18. package/packages/cli/dist/backup.js +0 -146
  19. package/packages/cli/dist/build-manifest.json +0 -142
  20. package/packages/cli/dist/cli.d.ts +0 -2
  21. package/packages/cli/dist/cli.js +0 -28
  22. package/packages/cli/dist/daemon.d.ts +0 -35
  23. package/packages/cli/dist/daemon.js +0 -126
  24. package/packages/cli/dist/index.d.ts +0 -1
  25. package/packages/cli/dist/index.js +0 -5
  26. package/packages/cli/dist/interfaces.d.ts +0 -16
  27. package/packages/cli/dist/interfaces.js +0 -96
  28. package/packages/cli/dist/library.d.ts +0 -140
  29. package/packages/cli/dist/library.js +0 -319
  30. package/packages/cli/dist/paths.d.ts +0 -3
  31. package/packages/cli/dist/paths.js +0 -18
  32. package/packages/cli/dist/projects.d.ts +0 -9
  33. package/packages/cli/dist/projects.js +0 -159
  34. package/packages/cli/dist/sessions.d.ts +0 -41
  35. package/packages/cli/dist/sessions.js +0 -447
  36. package/packages/cli/dist/tasks.d.ts +0 -29
  37. package/packages/cli/dist/tasks.js +0 -345
  38. package/packages/cli/dist/usage.d.ts +0 -3
  39. package/packages/cli/dist/usage.js +0 -72
  40. package/packages/client/README.md +0 -24
  41. package/packages/client/dist/acp-probe.d.ts +0 -44
  42. package/packages/client/dist/acp-probe.js +0 -37
  43. package/packages/client/dist/antigravity-probe.d.ts +0 -34
  44. package/packages/client/dist/antigravity-probe.js +0 -95
  45. package/packages/client/dist/command.d.ts +0 -5
  46. package/packages/client/dist/command.js +0 -33
  47. package/packages/client/dist/doctor.d.ts +0 -13
  48. package/packages/client/dist/doctor.js +0 -587
  49. package/packages/client/dist/index.d.ts +0 -116
  50. package/packages/client/dist/index.js +0 -500
  51. package/packages/client/dist/ipc.d.ts +0 -42
  52. package/packages/client/dist/ipc.js +0 -69
  53. package/packages/client/dist/library-test.d.ts +0 -94
  54. package/packages/client/dist/library-test.js +0 -37
  55. package/packages/client/dist/mcp-probe.d.ts +0 -24
  56. package/packages/client/dist/mcp-probe.js +0 -147
  57. package/packages/client/dist/portable.d.ts +0 -18
  58. package/packages/client/dist/portable.js +0 -27
  59. package/packages/client/dist/prompt.d.ts +0 -32
  60. package/packages/client/dist/prompt.js +0 -59
  61. package/packages/client/dist/render.d.ts +0 -6
  62. package/packages/client/dist/render.js +0 -120
  63. package/packages/client/dist/rpc/client.d.ts +0 -82
  64. package/packages/client/dist/rpc/client.js +0 -292
  65. package/packages/client/dist/rpc/errors.d.ts +0 -42
  66. package/packages/client/dist/rpc/errors.js +0 -34
  67. package/packages/client/dist/rpc/framing.d.ts +0 -21
  68. package/packages/client/dist/rpc/framing.js +0 -57
  69. package/packages/client/dist/rpc/handshake.d.ts +0 -19
  70. package/packages/client/dist/rpc/handshake.js +0 -8
  71. package/packages/client/dist/rpc/reconnect.d.ts +0 -97
  72. package/packages/client/dist/rpc/reconnect.js +0 -227
  73. package/packages/client/dist/rpc/timers.d.ts +0 -11
  74. package/packages/client/dist/rpc/timers.js +0 -11
  75. package/packages/client/dist/service.d.ts +0 -50
  76. package/packages/client/dist/service.js +0 -143
  77. package/packages/client/dist/setup.d.ts +0 -2
  78. package/packages/client/dist/setup.js +0 -146
  79. package/packages/client/dist/supervise.d.ts +0 -12
  80. package/packages/client/dist/supervise.js +0 -87
  81. package/packages/client/dist/websocket.d.ts +0 -51
  82. package/packages/client/dist/websocket.js +0 -190
  83. package/packages/core/README.md +0 -7
  84. package/packages/core/dist/adapter.d.ts +0 -20
  85. package/packages/core/dist/adapter.js +0 -30
  86. package/packages/core/dist/atomic.d.ts +0 -2
  87. package/packages/core/dist/atomic.js +0 -28
  88. package/packages/core/dist/backup.d.ts +0 -27
  89. package/packages/core/dist/backup.js +0 -582
  90. package/packages/core/dist/beads.d.ts +0 -65
  91. package/packages/core/dist/beads.js +0 -213
  92. package/packages/core/dist/delegation.d.ts +0 -2
  93. package/packages/core/dist/delegation.js +0 -32
  94. package/packages/core/dist/errors.d.ts +0 -4
  95. package/packages/core/dist/errors.js +0 -11
  96. package/packages/core/dist/formulas.d.ts +0 -25
  97. package/packages/core/dist/formulas.js +0 -201
  98. package/packages/core/dist/hook-run.d.ts +0 -44
  99. package/packages/core/dist/hook-run.js +0 -60
  100. package/packages/core/dist/hooks.d.ts +0 -35
  101. package/packages/core/dist/hooks.js +0 -30
  102. package/packages/core/dist/index.d.ts +0 -30
  103. package/packages/core/dist/index.js +0 -63
  104. package/packages/core/dist/init.d.ts +0 -30
  105. package/packages/core/dist/init.js +0 -89
  106. package/packages/core/dist/library-edit.d.ts +0 -93
  107. package/packages/core/dist/library-edit.js +0 -368
  108. package/packages/core/dist/library.d.ts +0 -28
  109. package/packages/core/dist/library.js +0 -108
  110. package/packages/core/dist/log.d.ts +0 -37
  111. package/packages/core/dist/log.js +0 -156
  112. package/packages/core/dist/migrations.d.ts +0 -9
  113. package/packages/core/dist/migrations.js +0 -95
  114. package/packages/core/dist/models.d.ts +0 -11
  115. package/packages/core/dist/models.js +0 -44
  116. package/packages/core/dist/permissions.d.ts +0 -14
  117. package/packages/core/dist/permissions.js +0 -229
  118. package/packages/core/dist/profiles.d.ts +0 -27
  119. package/packages/core/dist/profiles.js +0 -122
  120. package/packages/core/dist/promptsafe.d.ts +0 -1
  121. package/packages/core/dist/promptsafe.js +0 -13
  122. package/packages/core/dist/providers.d.ts +0 -90
  123. package/packages/core/dist/providers.js +0 -101
  124. package/packages/core/dist/resolver.d.ts +0 -41
  125. package/packages/core/dist/resolver.js +0 -240
  126. package/packages/core/dist/safe-path.d.ts +0 -2
  127. package/packages/core/dist/safe-path.js +0 -24
  128. package/packages/core/dist/shell.d.ts +0 -16
  129. package/packages/core/dist/shell.js +0 -22
  130. package/packages/core/dist/state-schema.d.ts +0 -9
  131. package/packages/core/dist/state-schema.js +0 -54
  132. package/packages/core/dist/task-rows.d.ts +0 -47
  133. package/packages/core/dist/task-rows.js +0 -45
  134. package/packages/core/dist/tasks.d.ts +0 -128
  135. package/packages/core/dist/tasks.js +0 -835
  136. package/packages/core/dist/teams.d.ts +0 -80
  137. package/packages/core/dist/teams.js +0 -159
  138. package/packages/core/dist/template-path.d.ts +0 -2
  139. package/packages/core/dist/template-path.js +0 -10
  140. package/packages/core/dist/trust.d.ts +0 -8
  141. package/packages/core/dist/trust.js +0 -47
  142. package/packages/core/dist/types.d.ts +0 -51
  143. package/packages/core/dist/upgrade.d.ts +0 -10
  144. package/packages/core/dist/upgrade.js +0 -200
  145. package/packages/core/dist/user-settings.d.ts +0 -6
  146. package/packages/core/dist/user-settings.js +0 -72
  147. package/packages/core/dist/validation.d.ts +0 -17
  148. package/packages/core/dist/validation.js +0 -295
  149. package/packages/core/dist/verify.d.ts +0 -15
  150. package/packages/core/dist/verify.js +0 -123
  151. package/packages/core/dist/workflow.d.ts +0 -45
  152. package/packages/core/dist/workflow.js +0 -33
  153. package/templates/ALP.md +0 -52
  154. package/templates/agents/lead/AGENT.md +0 -90
  155. package/templates/agents/main/AGENT.md +0 -150
  156. package/templates/agents/oracle/AGENT.md +0 -44
  157. package/templates/agents/peer/AGENT.md +0 -55
  158. package/templates/agents/reviewer/AGENT.md +0 -80
  159. package/templates/agents/supervisor/AGENT.md +0 -72
  160. package/templates/providers/antigravity.json +0 -6
  161. package/templates/providers/opencode.json +0 -7
  162. package/templates/role-skills.json +0 -8
  163. package/templates/skills/bug-loop/SKILL.md +0 -44
  164. package/templates/skills/bug-loop/references/test-proof.md +0 -25
  165. package/templates/skills/goal-griller/SKILL.md +0 -49
  166. package/templates/skills/prompt-leverage/SKILL.md +0 -37
  167. package/templates/skills/prompt-leverage/references/brief-template.md +0 -27
  168. package/templates/skills/sequence-execution-plan/SKILL.md +0 -42
  169. package/templates/skills/sequence-execution-plan/references/plan-template.md +0 -22
  170. package/templates/skills/smart-commits/SKILL.md +0 -40
  171. package/templates/skills/xia/SKILL.md +0 -42
  172. package/templates/teams/cafe/HOUSE_RULES.md +0 -1
  173. package/templates/teams/cafe/team.json +0 -15
  174. package/templates/teams/pho/HOUSE_RULES.md +0 -1
  175. package/templates/teams/pho/team.json +0 -14
@@ -1,22 +0,0 @@
1
- // packages/core/src/shell.js
2
- import { execFile, spawn } from "node:child_process";
3
- function spawnShell(command, options) {
4
- if (process.platform !== "win32") return spawn("/bin/sh", ["-c", command], { ...options, detached: true });
5
- return spawn(process.env.ComSpec ?? "cmd.exe", ["/d", "/s", "/c", `"${command}"`], { ...options, windowsHide: true, windowsVerbatimArguments: true });
6
- }
7
- function signalShell(child, name) {
8
- if (process.platform === "win32") {
9
- if (name === "SIGTERM") execFile("taskkill.exe", ["/PID", String(child.pid), "/T", "/F"], { windowsHide: true }, () => {
10
- });
11
- return;
12
- }
13
- try {
14
- process.kill(-child.pid, name);
15
- } catch {
16
- child.kill(name);
17
- }
18
- }
19
- export {
20
- signalShell,
21
- spawnShell
22
- };
@@ -1,9 +0,0 @@
1
- export const STATE_SCHEMA: number;
2
- export const OLDEST_STATE_SCHEMA: number;
3
- export function stateDir(home: string): string;
4
- export function schemaFile(home: string): string;
5
- export function migrationFile(home: string): string;
6
- export type StateSchemaInfo = { schema: number; fresh: boolean; marked: boolean; by?: string };
7
- export function readStateSchema(home: string): Promise<StateSchemaInfo>;
8
- export function assertStateSupported(info: StateSchemaInfo, home: string): StateSchemaInfo;
9
- export function writeStateSchema(home: string, schema: number, by?: string): Promise<void>;
@@ -1,54 +0,0 @@
1
- // packages/core/src/state-schema.js
2
- import { readdir, readFile, mkdir } from "node:fs/promises";
3
- import path from "node:path";
4
- import { AlpError } from "./errors.js";
5
- import { writeAtomic } from "./atomic.js";
6
- var STATE_SCHEMA = 2;
7
- var OLDEST_STATE_SCHEMA = 1;
8
- var stateDir = (home) => path.join(home, "state");
9
- var schemaFile = (home) => path.join(stateDir(home), "schema.json");
10
- var migrationFile = (home) => path.join(stateDir(home), "migration.json");
11
- var DATA = ["sessions", "timeline", "receipts"];
12
- async function readStateSchema(home) {
13
- let text;
14
- try {
15
- text = await readFile(schemaFile(home), "utf8");
16
- } catch (error) {
17
- if (error?.code !== "ENOENT") throw error;
18
- for (const name of DATA) {
19
- const entries = await readdir(path.join(stateDir(home), name)).catch((error2) => {
20
- if (error2?.code === "ENOENT") return [];
21
- throw error2;
22
- });
23
- if (entries.some((entry) => !entry.endsWith(".tmp"))) return { schema: 1, fresh: false, marked: false };
24
- }
25
- return { schema: STATE_SCHEMA, fresh: true, marked: false };
26
- }
27
- let marker;
28
- try {
29
- marker = JSON.parse(text);
30
- } catch {
31
- }
32
- if (!marker || !Number.isSafeInteger(marker.schema) || marker.schema < 1) {
33
- throw new AlpError("STATE_SCHEMA_UNREADABLE", `${schemaFile(home)} does not name a state schema; ALP does not open state whose format it cannot tell. Restore a backup, or put back the file`);
34
- }
35
- return { schema: marker.schema, fresh: false, marked: true, ...typeof marker.by === "string" ? { by: marker.by } : {} };
36
- }
37
- function assertStateSupported(info, home) {
38
- if (info.schema <= STATE_SCHEMA) return info;
39
- throw new AlpError("STATE_SCHEMA_TOO_NEW", `${stateDir(home)} holds state schema ${info.schema}${info.by ? `, written by ${info.by}` : ""}; this ALP knows schema ${STATE_SCHEMA} at most and leaves it untouched. Run that ALP version or a newer one, or replace it with a backup made for this version: alp restore FILE --replace-newer (docs/alp/data-recovery.md)`);
40
- }
41
- async function writeStateSchema(home, schema, by) {
42
- await mkdir(stateDir(home), { recursive: true, mode: 448 });
43
- await writeAtomic(schemaFile(home), JSON.stringify({ schema, by, at: (/* @__PURE__ */ new Date()).toISOString() }) + "\n");
44
- }
45
- export {
46
- OLDEST_STATE_SCHEMA,
47
- STATE_SCHEMA,
48
- assertStateSupported,
49
- migrationFile,
50
- readStateSchema,
51
- schemaFile,
52
- stateDir,
53
- writeStateSchema
54
- };
@@ -1,47 +0,0 @@
1
- /**
2
- * A project's tasks as task screens show them (ALPD §22): readiness, what blocks or waits,
3
- * approvals for the user, handoffs and progress. Used by the Paseo Tasks panel and the web app.
4
- * @param {string} projectRoot
5
- */
6
- export function taskRows(projectRoot: string): Promise<{
7
- tasks: {
8
- createdAt: string;
9
- updatedAt: string;
10
- progress?: {
11
- done: number;
12
- total: number;
13
- } | undefined;
14
- paths?: string[] | undefined;
15
- labels?: string[] | undefined;
16
- description?: string | undefined;
17
- closed?: {
18
- at: string;
19
- summary?: string | undefined;
20
- reason: import("./tasks.js").CloseReason;
21
- } | undefined;
22
- handoff?: {
23
- agent?: string | undefined;
24
- outcome: string;
25
- summary: string;
26
- } | undefined;
27
- approvals?: {
28
- gate: string;
29
- note: string;
30
- }[] | undefined;
31
- waits?: string[] | undefined;
32
- blockedBy?: string[] | undefined;
33
- ready: boolean;
34
- assignee?: string | undefined;
35
- parent?: string | undefined;
36
- id: string;
37
- title: string;
38
- type: import("./tasks.js").TaskType;
39
- priority: number;
40
- status: import("./tasks.js").TaskStatus;
41
- rev: number;
42
- }[];
43
- unreadable: {
44
- file: string;
45
- error: string;
46
- }[];
47
- }>;
@@ -1,45 +0,0 @@
1
- // packages/core/src/task-rows.js
2
- import { gatesOf, loadTasks, readyTasks, summarize } from "./tasks.js";
3
- async function taskRows(projectRoot) {
4
- const { tasks, errors } = await loadTasks(projectRoot);
5
- const ready = new Set(readyTasks(tasks).map((task) => task.id));
6
- const children = /* @__PURE__ */ new Map();
7
- for (const task of tasks) {
8
- if (!task.parent) continue;
9
- const count = children.get(task.parent) ?? { done: 0, total: 0 };
10
- count.total += 1;
11
- if (task.status === "closed") count.done += 1;
12
- children.set(task.parent, count);
13
- }
14
- const rows = tasks.map((task) => {
15
- const row = summarize(task, tasks);
16
- const approvals = task.status === "closed" ? [] : task.gates.filter((gate) => gate.kind === "human" && !gate.resolved).map((gate) => ({ gate: gate.id, note: gate.note ?? "" }));
17
- const waits = task.status === "closed" ? [] : gatesOf(task, tasks);
18
- return {
19
- id: task.id,
20
- title: task.title,
21
- type: task.type,
22
- priority: task.priority,
23
- status: task.status,
24
- rev: task.rev,
25
- ...task.parent ? { parent: task.parent } : {},
26
- ...task.assignee ? { assignee: task.assignee.agent } : {},
27
- ready: ready.has(task.id),
28
- ...row.blockedBy ? { blockedBy: row.blockedBy } : {},
29
- ...waits.length ? { waits } : {},
30
- ...approvals.length ? { approvals } : {},
31
- ...task.handoff ? { handoff: { outcome: String(task.handoff.outcome), summary: String(task.handoff.summary ?? ""), ...typeof task.handoff.agent === "string" ? { agent: task.handoff.agent } : {} } } : {},
32
- ...task.closed ? { closed: { reason: task.closed.reason, ...task.closed.summary ? { summary: task.closed.summary } : {}, at: task.closed.at } } : {},
33
- ...task.description ? { description: task.description.slice(0, 4e3) } : {},
34
- ...task.labels.length ? { labels: task.labels } : {},
35
- ...task.paths.length ? { paths: task.paths } : {},
36
- ...children.has(task.id) ? { progress: children.get(task.id) } : {},
37
- createdAt: task.createdAt,
38
- updatedAt: task.updatedAt
39
- };
40
- });
41
- return { tasks: rows, unreadable: errors };
42
- }
43
- export {
44
- taskRows
45
- };
@@ -1,128 +0,0 @@
1
- export type TaskType = 'task' | 'bug' | 'feature' | 'chore' | 'epic';
2
- export type TaskStatus = 'open' | 'in_progress' | 'review' | 'closed';
3
- export type CloseReason = 'done' | 'wontfix' | 'duplicate' | 'superseded';
4
-
5
- export type TaskLogEntry = { at: string; by: string; event: string; [detail: string]: unknown };
6
-
7
- export type Task = {
8
- id: string;
9
- rev: number;
10
- title: string;
11
- description: string;
12
- type: TaskType;
13
- priority: number;
14
- status: TaskStatus;
15
- labels: string[];
16
- paths: string[];
17
- parent: string | null;
18
- blockedBy: string[];
19
- discoveredFrom: string | null;
20
- related: string[];
21
- gates: TaskGate[];
22
- assignee: { agent: string; session?: string; assignment?: string; pid?: number; pidStartedAt?: number; epoch?: string; since: string } | null;
23
- handoff: Record<string, unknown> | null;
24
- /** The last run of the project's verify commands for this task. */
25
- verified: TaskVerification | null;
26
- createdBy: string;
27
- createdAt: string;
28
- updatedAt: string;
29
- closed: { at: string; by: string; reason: CloseReason; summary?: string; unverified?: string } | null;
30
- log: TaskLogEntry[];
31
- compacted?: { at: string; by: string; chars: number };
32
- /** Where an imported task came from. */
33
- external?: { system: string; id: string };
34
- /** The formula step a task was poured from. */
35
- step?: { formula: string; id: string; human?: boolean };
36
- /** The formula an epic was poured from. */
37
- formula?: { name: string; version?: number; vars: Record<string, string> };
38
- };
39
-
40
- export type GateKind = 'human' | 'timer' | 'gh:pr' | 'gh:run';
41
- export type TaskGate = {
42
- id: string;
43
- kind: GateKind;
44
- note?: string;
45
- until?: string;
46
- repo?: string;
47
- ref?: string;
48
- at: string;
49
- by: string;
50
- resolved?: { at: string; by: string; note?: string };
51
- };
52
-
53
- export type TaskInput = {
54
- title?: string;
55
- description?: string;
56
- type?: TaskType;
57
- priority?: number | string;
58
- labels?: string[];
59
- paths?: string[];
60
- parent?: string | null;
61
- blockedBy?: string[];
62
- related?: string[];
63
- discoveredFrom?: string | null;
64
- };
65
-
66
- export type TaskLinks = { blockedBy?: string[]; related?: string[]; parent?: string };
67
- export type TaskSummary = Pick<Task, 'id' | 'title' | 'type' | 'priority' | 'status'> & { labels?: string[]; parent?: string; blockedBy?: string[]; gates?: string[]; assignee?: string; verified?: 'passed' | 'failed' | 'skipped' };
68
- type WriteOptions = { ifRev?: number };
69
-
70
- export const TASKS_DIR: string;
71
- export const TASK_TYPES: TaskType[];
72
- export const TASK_STATUSES: TaskStatus[];
73
- export const CLOSE_REASONS: CloseReason[];
74
- export const GATE_KINDS: GateKind[];
75
- export const MAX_GATES: number;
76
- export const TITLE_CHARS: number;
77
- export const DESCRIPTION_CHARS: number;
78
- export const NOTE_CHARS: number;
79
- export const MAX_LABELS: number;
80
- export const MAX_PATHS: number;
81
- export const MAX_LINKS: number;
82
-
83
- export function isTaskId(id: unknown): id is string;
84
- export function tasksDir(projectRoot: string): string;
85
- export function loadTasks(projectRoot: string): Promise<{ tasks: Task[]; errors: Array<{ file: string; error: string }> }>;
86
- export function getTask(projectRoot: string, id: string): Promise<Task>;
87
- export function blockersOf(task: Task, tasks: Task[]): string[];
88
- export function readyTasks(tasks: Task[]): Task[];
89
- export function childrenOf(id: string, tasks: Task[]): Task[];
90
- export function summarize(task: Task, tasks: Task[]): TaskSummary;
91
- export function listTasks(tasks: Task[], filter?: { status?: TaskStatus; label?: string; parent?: string; all?: boolean }): Task[];
92
- export function createTask(projectRoot: string, input: TaskInput & { title: string }, by: string): Promise<Task>;
93
- export function updateTask(projectRoot: string, id: string, input: TaskInput & { note?: string }, by: string, options?: WriteOptions): Promise<Task>;
94
- export function linkTask(projectRoot: string, id: string, change: { add?: TaskLinks; remove?: TaskLinks }, by: string, options?: WriteOptions): Promise<Task>;
95
- export function startTask(projectRoot: string, id: string, assignee: { agent: string; session?: string; assignment?: string; pid?: number; pidStartedAt?: number; epoch?: string }, by: string, options?: WriteOptions): Promise<Task>;
96
- export function closeTask(projectRoot: string, id: string, close: { reason?: CloseReason; summary?: string; unverified?: string }, by: string, options?: WriteOptions): Promise<Task>;
97
- export function verificationFailed(task: Task): boolean;
98
- export function recordVerification(projectRoot: string, id: string, verification: { passed: boolean; where?: string; commands?: Array<{ step: string; command: string; exitCode: number; ms: number; output?: string; timedOut?: boolean }>; skipped?: string }, by: string): Promise<Task>;
99
- export function reopenTask(projectRoot: string, id: string, reopen: { note?: string }, by: string, options?: WriteOptions): Promise<Task>;
100
- export function submitTask(projectRoot: string, id: string, submit: { assignment: string; handoff: { outcome: string; summary: string } & Record<string, unknown>; agent: string }, by: string): Promise<Task>;
101
- export function releaseOrphans(projectRoot: string, isOrphan: (assignee: { agent: string; assignment: string; pid?: number; pidStartedAt?: number; epoch?: string }) => boolean, describe: (assignee: { agent: string; assignment: string }) => Promise<string | undefined>, by: string): Promise<Task[]>;
102
- export function orphanedEntry(task: Task): { at: string; by: string; event: 'orphaned'; agent: string; assignment: string; note?: string } | undefined;
103
- export function retakeTask(projectRoot: string, id: string, assignee: { assignment: string; pid?: number; pidStartedAt?: number; epoch?: string }, by: string): Promise<Task>;
104
- export function releaseTask(projectRoot: string, id: string, release: { assignment: string; handoff?: ({ outcome: string; summary: string } & Record<string, unknown>) | null; agent: string; reason: string }, by: string): Promise<Task>;
105
- export function taskDigest(tasks: Task[], errors?: Array<{ file: string; error: string }>): string;
106
- export function startRefusal(task: Task, tasks: Task[]): string | undefined;
107
- export function gateOpen(gate: TaskGate, now?: number): boolean;
108
- export function describeGate(gate: TaskGate): string;
109
- export function gatesOf(task: Task, tasks: Task[]): string[];
110
- export function addGate(projectRoot: string, id: string, gate: { kind: GateKind; note?: string; until?: string; ref?: string | number }, by: string): Promise<Task>;
111
- export function resolveGate(projectRoot: string, id: string, gateId: string, resolve: { by: string; note?: string; remove?: boolean; ifRev?: number }): Promise<Task>;
112
- export function checkGates(projectRoot: string, gh: (args: string[], options: { cwd: string }) => Promise<string>): Promise<{ cleared: Array<{ task: string; gate: string; detail: string }>; pending: Array<{ task: string; gate: string; detail: string }>; errors: Array<{ task: string; gate: string; error: string }> }>;
113
- export function compactTasks(projectRoot: string, options: { days?: number; dryRun?: boolean }, by: string): Promise<Array<{ id: string; before: number; after: number }>>;
114
- export type TaskBatch = {
115
- tasks: Task[];
116
- errors: Array<{ file: string; error: string }>;
117
- add(input: TaskInput & { title: string }, by: string, options?: { id?: string; createdAt?: string; event?: string; details?: Record<string, unknown>; extra?: Partial<Task> & Record<string, unknown> }): Task;
118
- touch(task: Task, by?: string, event?: string, details?: Record<string, unknown>): void;
119
- link(task: Task, kind: 'blockedBy' | 'parent' | 'discoveredFrom' | 'related', other: string): string | undefined;
120
- };
121
- export function batch<T>(projectRoot: string, work: (batch: TaskBatch) => T | Promise<T>, options?: { dryRun?: boolean }): Promise<T>;
122
-
123
- export type TaskVerification = { at: string; by: string; passed: boolean; where?: string; commands: Array<{ step: string; command: string; exitCode: number; ms: number; output?: string; timedOut?: boolean }>; skipped?: string };
124
-
125
- export type EpicReport = { id: string; title: string; status: TaskStatus; tasks: number; closed: number; durationMs: number; reworked: number; verification: { passed: number; failed: number; skipped: number; none: number }; unverified: string[]; lines: string[]; text: string };
126
- export function epicReport(id: string, tasks: Task[]): EpicReport;
127
- export function landedParents(tasks: Task[]): Array<{ task: Task; children: number }>;
128
- export function withTaskLock<T>(projectRoot: string, work: () => Promise<T>): Promise<T>;