@astrosheep/keiyaku 4.5.5 → 4.5.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.
@@ -1,10 +1,10 @@
1
1
  import type { WorldRoot } from "../world.js";
2
2
  export type { WorldRoot } from "../world.js";
3
3
  import { type BlockedTaskRow, type TaskDetailFacts, type TaskDoctorIssue, type TaskRef, type TaskRow, type TaskTreeNode } from "./board.js";
4
- import { type TaskCompositionResult } from "./compose.js";
4
+ import { type TaskCompositionAlias, type TaskCompositionBodyPreview, type TaskCompositionResult } from "./compose.js";
5
5
  import { TaskAuthorityCorruptionError, type TaskPriority, type TaskState } from "./document.js";
6
6
  import type { TaskId } from "./identity.js";
7
- import { type AddTaskDocumentInput, type AddTaskInput, type TaskBatchResult, type TaskMutationResult, type TaskOutcome, type TaskRefusal, type TaskRetry, type TaskUpdateResult, type TaskView, type UpdateTaskInput } from "./operations.js";
7
+ import { type AddTaskDocumentInput, type AddTaskInput, type TaskBatchResult, type TaskCompositionDiagnostic, type TaskMutationResult, type TaskOutcome, type TaskRefusal, type TaskRetry, type TaskUpdateResult, type TaskView, type UpdateTaskInput } from "./operations.js";
8
8
  import { TASK_RELATION_PREDICATE_FIELDS, type TaskPage, type TaskQueryExpression, type TaskQueryPredicate, type TaskQueryRow, type TaskQuerySort, type TaskRelationPredicateField } from "./query.js";
9
9
  export type TaskDetail = Omit<TaskDetailFacts, "task"> & Readonly<{
10
10
  task: TaskView;
@@ -17,7 +17,7 @@ export type TaskDoctorReport = Readonly<{
17
17
  issues: readonly TaskDoctorIssue[];
18
18
  }>;
19
19
  export type TaskDecompositionTree = TaskOutcome<TaskTreeNode>;
20
- export type { AddTaskDocumentInput, AddTaskInput, BlockedTaskRow, TaskBatchResult, TaskCompositionResult, TaskDoctorIssue, TaskId, TaskMutationResult, TaskOutcome, TaskPriority, TaskRef, TaskRefusal, TaskRetry, TaskRow, TaskState, TaskTreeNode, TaskUpdateResult, TaskView, UpdateTaskInput, TaskPage, TaskQueryExpression, TaskQueryPredicate, TaskQueryRow, TaskQuerySort, TaskRelationPredicateField, };
20
+ export type { AddTaskDocumentInput, AddTaskInput, BlockedTaskRow, TaskBatchResult, TaskCompositionDiagnostic, TaskCompositionAlias, TaskCompositionBodyPreview, TaskCompositionResult, TaskDoctorIssue, TaskId, TaskMutationResult, TaskOutcome, TaskPriority, TaskRef, TaskRefusal, TaskRetry, TaskRow, TaskState, TaskTreeNode, TaskUpdateResult, TaskView, UpdateTaskInput, TaskPage, TaskQueryExpression, TaskQueryPredicate, TaskQueryRow, TaskQuerySort, TaskRelationPredicateField, };
21
21
  export { TaskAuthorityCorruptionError, TASK_RELATION_PREDICATE_FIELDS };
22
22
  declare class TaskHandle {
23
23
  readonly id: TaskId;
@@ -95,6 +95,7 @@ declare class TasksHandle {
95
95
  namespace?: readonly string[];
96
96
  actor?: string;
97
97
  signal?: AbortSignal;
98
+ plan?: boolean;
98
99
  }>): Promise<TaskCompositionResult>;
99
100
  }
100
101
  export type Tasks = TasksHandle;
@@ -1,5 +1,5 @@
1
1
  import { buildTree, createTaskRelations, diagnoseBoard, projectDetailFacts, } from "./board.js";
2
- import { composeTasks } from "./compose.js";
2
+ import { composeTasks, } from "./compose.js";
3
3
  import { TaskAuthorityCorruptionError } from "./document.js";
4
4
  import { addTask, addTaskDocument, batchTasks, blockedTasks, lifecycleTask, listTasks, queryTasks, readyTasks, taskView, updateTask, } from "./operations.js";
5
5
  import { readBoard } from "./store.js";
@@ -149,12 +149,23 @@ class TasksHandle {
149
149
  }
150
150
  compose(input) {
151
151
  const v = record(input, "compose input");
152
- closed(v, ["markdown", "namespace", "actor", "signal"], "compose input");
152
+ closed(v, ["markdown", "namespace", "actor", "signal", "plan"], "compose input");
153
153
  const markdown = text(v.markdown, "markdown");
154
154
  if (markdown === undefined)
155
155
  throw new TypeError("markdown is required");
156
+ if (v.plan !== undefined && typeof v.plan !== "boolean")
157
+ throw new TypeError("plan must be a boolean");
156
158
  const selected = namespace(v.namespace);
157
- return composeTasks(this.world, markdown, signal(v.signal), actor(v.actor), selected);
159
+ const selectedSignal = signal(v.signal);
160
+ const selectedActor = actor(v.actor);
161
+ return composeTasks({
162
+ world: this.world,
163
+ markdown,
164
+ ...(selectedSignal === undefined ? {} : { signal: selectedSignal }),
165
+ ...(selectedActor === undefined ? {} : { actor: selectedActor }),
166
+ ...(selected === undefined ? {} : { defaultNamespace: selected }),
167
+ planOnly: v.plan === true,
168
+ });
158
169
  }
159
170
  }
160
171
  export const Tasks = Object.freeze({
@@ -9,6 +9,11 @@ export type TaskView = Readonly<TaskDocument & {
9
9
  export declare function nukeTask(world: WorldRoot, options?: Readonly<{
10
10
  timeoutMs?: number;
11
11
  }>): Promise<void>;
12
+ export type TaskCompositionDiagnostic = Readonly<{
13
+ line: number;
14
+ reason: string;
15
+ token: string;
16
+ }>;
12
17
  export type TaskRefusal = Readonly<{
13
18
  kind: "task-missing";
14
19
  taskId: TaskId;
@@ -30,7 +35,7 @@ export type TaskRefusal = Readonly<{
30
35
  declaringTask: TaskId;
31
36
  }> | Readonly<{
32
37
  kind: "invalid-composition";
33
- diagnostic: string;
38
+ diagnostics: readonly TaskCompositionDiagnostic[];
34
39
  }>;
35
40
  export type TaskRetry = "busy" | "concurrent-modification";
36
41
  export type TaskOutcome<A> = Readonly<{
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@astrosheep/keiyaku",
3
- "version": "4.5.5",
3
+ "version": "4.5.6",
4
4
  "files": [
5
5
  "build"
6
6
  ],
@@ -64,7 +64,7 @@
64
64
  "dependencies": {
65
65
  "@agentclientprotocol/sdk": "^1.3.0",
66
66
  "@anthropic-ai/claude-agent-sdk": "^0.3.226",
67
- "@astrosheep/square": "0.3.24",
67
+ "@astrosheep/square": "0.3.28",
68
68
  "@earendil-works/pi-coding-agent": "0.80.10",
69
69
  "@opencode-ai/sdk": "1.18.3",
70
70
  "cross-spawn": "^7.0.6",