@agimon-ai/po-task 0.0.0-alpha.4 → 0.0.0-alpha.41
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/LICENSE +149 -21
- package/README.md +12 -2
- package/dist/apiContracts.cjs +1 -0
- package/dist/apiContracts.cjs.map +1 -1
- package/dist/apiContracts.mjs +1 -0
- package/dist/apiContracts.mjs.map +1 -1
- package/dist/{delegation-Dsqf7fUM.mjs → delegation-CLcleXHi.mjs} +3 -2
- package/dist/{delegation-Dsqf7fUM.mjs.map → delegation-CLcleXHi.mjs.map} +1 -1
- package/dist/{delegation-frvEXhIz.cjs → delegation-DRp6iZid.cjs} +3 -2
- package/dist/{delegation-frvEXhIz.cjs.map → delegation-DRp6iZid.cjs.map} +1 -1
- package/dist/delegationManager.cjs +1 -1
- package/dist/delegationManager.d.mts +1 -1
- package/dist/delegationManager.mjs +1 -1
- package/dist/extensions/mcp.cjs +29 -27
- package/dist/extensions/mcp.cjs.map +1 -1
- package/dist/extensions/mcp.mjs +29 -27
- package/dist/extensions/mcp.mjs.map +1 -1
- package/dist/extensions/native.mjs +309 -207
- package/dist/extensions/native.mjs.map +1 -1
- package/dist/extensions/server.cjs +351 -122
- package/dist/extensions/server.cjs.map +1 -1
- package/dist/extensions/server.d.mts +2 -2
- package/dist/extensions/server.d.mts.map +1 -1
- package/dist/extensions/server.mjs +350 -121
- package/dist/extensions/server.mjs.map +1 -1
- package/dist/extensions/web.mjs +254 -206
- package/dist/extensions/web.mjs.map +1 -1
- package/dist/{index-DlmXKyhQ.d.mts → index-CdJx5tdI.d.mts} +2 -2
- package/dist/{index-DlmXKyhQ.d.mts.map → index-CdJx5tdI.d.mts.map} +1 -1
- package/dist/{index-B1JPJdpZ.d.mts → index-DrE00rrP.d.mts} +3 -3
- package/dist/{index-B1JPJdpZ.d.mts.map → index-DrE00rrP.d.mts.map} +1 -1
- package/dist/{index-B9QNwUBr.d.mts → index-Dyan0ai0.d.mts} +3 -3
- package/dist/{index-B9QNwUBr.d.mts.map → index-Dyan0ai0.d.mts.map} +1 -1
- package/dist/{index-qQGWsPum.d.mts → index-S77ZvGc-.d.mts} +2 -2
- package/dist/{index-qQGWsPum.d.mts.map → index-S77ZvGc-.d.mts.map} +1 -1
- package/dist/{index-CUWCvh-E.d.mts → index-nx0ueNkm.d.mts} +2 -2
- package/dist/{index-CUWCvh-E.d.mts.map → index-nx0ueNkm.d.mts.map} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.mts +8 -8
- package/dist/index.mjs +1 -1
- package/dist/{logSinkTelemetry-BhbKdn-x.mjs → logSinkTelemetry-3GMazFYa.mjs} +2 -2
- package/dist/logSinkTelemetry-3GMazFYa.mjs.map +1 -0
- package/dist/{logSinkTelemetry-BGb8WQBz.cjs → logSinkTelemetry-DhzIQMsV.cjs} +3 -3
- package/dist/logSinkTelemetry-DhzIQMsV.cjs.map +1 -0
- package/dist/logSinkTelemetry.cjs +1 -1
- package/dist/logSinkTelemetry.d.mts +1 -1
- package/dist/logSinkTelemetry.mjs +1 -1
- package/dist/storeInvariants.d.mts +1 -1
- package/dist/storeReconcile.d.mts +1 -1
- package/dist/storeReducer.d.mts +1 -1
- package/dist/storeTaskGraph.d.mts +1 -1
- package/dist/storeTaskStore.d.mts +1 -1
- package/dist/storeTypes.d.mts +1 -1
- package/dist/{task-4HeGAS8o.d.mts → task--hlnpS7L.d.mts} +2 -2
- package/dist/{task-4HeGAS8o.d.mts.map → task--hlnpS7L.d.mts.map} +1 -1
- package/dist/task-CXF9VULl.cjs.map +1 -1
- package/dist/{task-DJpTteeJ.d.mts → task-DdTKZNtU.d.mts} +3 -1
- package/dist/task-DdTKZNtU.d.mts.map +1 -0
- package/dist/task-giCbpKzV.mjs.map +1 -1
- package/dist/{taskGraph-D0zFHF2p.d.mts → taskGraph-CB8ffMCz.d.mts} +2 -2
- package/dist/{taskGraph-D0zFHF2p.d.mts.map → taskGraph-CB8ffMCz.d.mts.map} +1 -1
- package/dist/toolResponseEnvelope.d.mts +1 -1
- package/dist/toolSchema.d.mts +1 -1
- package/llms.txt +11 -0
- package/package.json +17 -16
- package/src/prompts/codemode-how-to-task/SKILL.md +40 -0
- package/src/types/webTasks.ts +1 -0
- package/dist/logSinkTelemetry-BGb8WQBz.cjs.map +0 -1
- package/dist/logSinkTelemetry-BhbKdn-x.mjs.map +0 -1
- package/dist/task-DJpTteeJ.d.mts.map +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as reconcileOrphanedDelegations, i as ReconcileSelf, n as ERR_ORPHANED_BY_SESSION, r as ReconcileResult, t as ERR_ORPHANED_BY_RESTART } from "./index-
|
|
1
|
+
import { a as reconcileOrphanedDelegations, i as ReconcileSelf, n as ERR_ORPHANED_BY_SESSION, r as ReconcileResult, t as ERR_ORPHANED_BY_RESTART } from "./index-CdJx5tdI.mjs";
|
|
2
2
|
export { ERR_ORPHANED_BY_RESTART, ERR_ORPHANED_BY_SESSION, ReconcileResult, ReconcileSelf, reconcileOrphanedDelegations };
|
package/dist/storeReducer.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as ReducerAction, c as isCommittingOp, i as REF_PATTERN, l as singleItemOutcome, n as MAX_UPSERT_ITEMS, o as applyTaskMutation, r as Op, s as formatUpsertFailure, t as ApplyResult } from "./index-
|
|
1
|
+
import { a as ReducerAction, c as isCommittingOp, i as REF_PATTERN, l as singleItemOutcome, n as MAX_UPSERT_ITEMS, o as applyTaskMutation, r as Op, s as formatUpsertFailure, t as ApplyResult } from "./index-nx0ueNkm.mjs";
|
|
2
2
|
export { ApplyResult, MAX_UPSERT_ITEMS, Op, REF_PATTERN, ReducerAction, applyTaskMutation, formatUpsertFailure, isCommittingOp, singleItemOutcome };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as unresolvedBlockers, i as isTaskListComplete, n as detectCycle, r as isBlocked, t as deriveBlocks } from "./taskGraph-
|
|
1
|
+
import { a as unresolvedBlockers, i as isTaskListComplete, n as detectCycle, r as isBlocked, t as deriveBlocks } from "./taskGraph-CB8ffMCz.mjs";
|
|
2
2
|
export { deriveBlocks, detectCycle, isBlocked, isTaskListComplete, unresolvedBlockers };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as TaskStoreOptions, t as TaskStore } from "./index-
|
|
1
|
+
import { n as TaskStoreOptions, t as TaskStore } from "./index-S77ZvGc-.mjs";
|
|
2
2
|
export { TaskStore, TaskStoreOptions };
|
package/dist/storeTypes.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { _ as UpsertSummary, a as DepToken, c as TaskAction, d as TaskDetails, f as TaskDocument, g as UpsertItemOutcome, h as TaskStatus, i as DelegationState, l as TaskAssignment, m as TaskMutationParams, n as DELETED_STATUS, o as STORE_SCHEMA_VERSION, p as TaskItemMutation, r as DelegationResult, s as Task, t as AssignmentSummary, u as TaskDelegation, v as emptyDocument, y as isDelegationActive } from "./task-
|
|
1
|
+
import { _ as UpsertSummary, a as DepToken, c as TaskAction, d as TaskDetails, f as TaskDocument, g as UpsertItemOutcome, h as TaskStatus, i as DelegationState, l as TaskAssignment, m as TaskMutationParams, n as DELETED_STATUS, o as STORE_SCHEMA_VERSION, p as TaskItemMutation, r as DelegationResult, s as Task, t as AssignmentSummary, u as TaskDelegation, v as emptyDocument, y as isDelegationActive } from "./task-DdTKZNtU.mjs";
|
|
2
2
|
export { AssignmentSummary, DELETED_STATUS, DelegationResult, DelegationState, DepToken, STORE_SCHEMA_VERSION, Task, TaskAction, TaskAssignment, TaskDelegation, TaskDetails, TaskDocument, TaskItemMutation, TaskMutationParams, TaskStatus, UpsertItemOutcome, UpsertSummary, emptyDocument, isDelegationActive };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as TaskAction } from "./task-
|
|
1
|
+
import { c as TaskAction } from "./task-DdTKZNtU.mjs";
|
|
2
2
|
import { Static, Type } from "typebox";
|
|
3
3
|
//#region src/constants/task.d.ts
|
|
4
4
|
declare const COMMAND_NAME = "tasks";
|
|
@@ -123,4 +123,4 @@ type TaskAssignmentParams = Static<typeof TaskAssignmentSchema>;
|
|
|
123
123
|
type TaskParams = Static<typeof TaskParamsSchema>;
|
|
124
124
|
//#endregion
|
|
125
125
|
export { TaskParamsSchema as _, RemoteTaskParamsSchema as a, TASK_CONTEXTS as c, TOOL_NAME as d, TaskAssignmentParams as f, TaskParams as g, TaskItemSchema as h, REMOTE_TASK_ACTIONS as i, TASK_STATUSES as l, TaskItemParams as m, MSG_NO_TASKS as n, TASK_ACTIONS as o, TaskAssignmentSchema as p, MSG_UPSERT_FIELD_MISPLACED as r, TASK_ACTION_FIELDS as s, ERR_REQUIRES_INTERACTIVE as t, TOOL_LABEL as u, taskActionAcceptsField as v, COMMAND_NAME as y };
|
|
126
|
-
//# sourceMappingURL=task
|
|
126
|
+
//# sourceMappingURL=task--hlnpS7L.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"task
|
|
1
|
+
{"version":3,"file":"task--hlnpS7L.d.mts","names":[],"sources":["../src/constants/task.ts","../src/schemas/task.ts"],"mappings":";;;cAAa;;;cCOA;cACA;cACA;cAEA;cACA;cAEA;cACA;;;;;;;;;cAUA;;;;;;;;;iBAUG,uBAAuB,QAAQ,YAAY;;cAK9C;;;;;;cAcA,gBAAc,KAAA;;;;;;;;;;;;;;cA2Dd,sBAAoB,KAAA;;;;;;;;;;;;;;;;cA6BpB,kBAAgB,KAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAiChB;cAEA,wBAAsB,KAAA;;;;;;;;;;;;;;;;;;;KAKvB,iBAAiB,cAAc;KAC/B,uBAAuB,cAAc;KACrC,aAAa,cAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"task-CXF9VULl.cjs","names":[],"sources":["../src/models/task.ts"],"sourcesContent":["/**\n * Domain types for the file-backed task store.\n *\n * The on-disk document is the durable source of truth (unlike rpiv-todo, which\n * replayed state from the transcript). Every field here round-trips through\n * JSON, so nothing may hold non-serializable values.\n */\n\nimport type { InlineAgent } from '@agimon-ai/po-core/delegation';\n\nexport type TaskStatus = 'pending' | 'in_progress' | 'completed' | 'failed' | 'deleted';\n\nexport const DELETED_STATUS: TaskStatus = 'deleted';\n\nexport type TaskAction = 'upsert' | 'list' | 'get' | 'delete' | 'clear' | 'assign' | 'cancel';\n\nexport type DelegationState = 'requested' | 'running' | 'completed' | 'failed' | 'cancelled';\n\n/** Terminal result of a delegated subagent run, copied off the delegation response. */\nexport interface DelegationResult {\n status: string;\n output?: string;\n outputPath?: string;\n sessionFile?: string;\n error?: string;\n durationMs?: number;\n toolCount?: number;\n}\n\n/**\n * Delegation bookkeeping attached to a task that was handed to a subagent.\n *\n * `pid` is the harness process that owns the run: it is the only way to tell an\n * genuinely-running delegation from one orphaned by a harness crash, since the\n * child dies with its parent but the file survives.\n */\nexport interface TaskDelegation {\n requestId: string;\n agent: string;\n state: DelegationState;\n sessionId?: string;\n pid?: number;\n runId?: string;\n model?: string;\n startedAt?: string;\n endedAt?: string;\n result?: DelegationResult;\n}\n\nexport interface Task {\n id: number;\n subject: string;\n description?: string;\n activeForm?: string;\n status: TaskStatus;\n blockedBy?: number[];\n owner?: string;\n metadata?: Record<string, unknown>;\n createdAt?: string;\n updatedAt?: string;\n delegation?: TaskDelegation;\n}\n\nexport const STORE_SCHEMA_VERSION = 1;\n\n/** The complete on-disk document. `rev` increments on every committed write. */\nexport interface TaskDocument {\n version: number;\n rev: number;\n nextId: number;\n tasks: Task[];\n}\n\nexport function emptyDocument(): TaskDocument {\n return { version: STORE_SCHEMA_VERSION, rev: 0, nextId: 1, tasks: [] };\n}\n\n/**\n * A dependency target inside an upsert item: an existing task id, or the `ref`\n * of a task created earlier in the same call.\n *\n * Refs must start with a letter (see `REF_PATTERN`), so a ref is structurally\n * unconfusable with a stringified id and the discrimination is just `typeof`.\n */\nexport type DepToken = number | string;\n\n/**\n * One entry of an `upsert` call. No `id` creates a task; an `id` updates one.\n *\n * `blockedBy` (absolute set) is create-only and `addBlockedBy`/`removeBlockedBy`\n * (additive merge) are update-only, matching the split the two former actions\n * had. A field used against the wrong kind fails that item rather than being\n * silently ignored.\n */\nexport interface TaskItemMutation {\n id?: number;\n ref?: string;\n subject?: string;\n description?: string;\n activeForm?: string;\n status?: TaskStatus;\n blockedBy?: DepToken[];\n addBlockedBy?: DepToken[];\n removeBlockedBy?: DepToken[];\n owner?: string;\n metadata?: Record<string, unknown>;\n}\n\n/**\n * What one upsert item did. `index` is its position in the request array, so a\n * model reading a partial result can tell which entries still need resending.\n *\n * `message` is unprefixed: the `item[N] failed:` framing belongs to the\n * formatter, because the Task Space overlay shows this text on its own.\n */\nexport type UpsertItemOutcome =\n | {\n index: number;\n kind: 'created';\n id: number;\n subject: string;\n status: TaskStatus;\n ref?: string;\n blockedBy?: number[];\n }\n | { index: number; kind: 'updated'; id: number; fromStatus: TaskStatus; toStatus: TaskStatus }\n | { index: number; kind: 'unchanged'; id: number; status: TaskStatus }\n | { index: number; kind: 'failed'; message: string; id?: number; ref?: string };\n\n/** Which tasks an upsert touched, so renderResult names them instead of guessing. */\nexport interface UpsertSummary {\n /** Ids of applied entries, in request order. A failed entry contributes nothing. */\n applied: number[];\n failed: number;\n}\n\n/** One task-to-agent handoff inside a native assignment batch. */\nexport interface TaskAssignment {\n id: number;\n agent: string;\n inlineAgent?: InlineAgent;\n instructions?: string;\n relevantFiles?: string[];\n priorFindings?: string;\n model?: string;\n context?: 'fresh' | 'fork';\n}\n\n/** Which assignment entries started, so renderResult can show one consolidated batch. */\nexport interface AssignmentSummary {\n /** Ids of successful entries, in request order. A failed entry contributes nothing. */\n assigned: number[];\n failed: number;\n}\n\n/**\n * Open-shape input bag the reducer accepts. The index signature lets the\n * runtime pass a TypeBox `Static<typeof TaskParamsSchema>` through without\n * casting each field.\n *\n * Per-task fields live on `tasks[]`, not here: a top-level `subject` or\n * `status` would be ambiguous once one call can carry many tasks.\n */\nexport interface TaskMutationParams {\n [key: string]: unknown;\n tasks?: TaskItemMutation[];\n /** `assign` only: independent task-to-agent handoffs dispatched by one tool call. */\n assignments?: TaskAssignment[];\n /** `list` filter only. To set a status, upsert the task by id. */\n status?: TaskStatus;\n /** `get`, `delete`, and `cancel` only. Assign ids live in `assignments[]`. */\n id?: number;\n includeDeleted?: boolean;\n}\n\n/** Snapshot returned under a tool result's `details` for renderResult. */\nexport interface TaskDetails {\n action: TaskAction;\n params: Record<string, unknown>;\n tasks: Task[];\n nextId: number;\n rev: number;\n error?: string;\n upsert?: UpsertSummary;\n assignment?: AssignmentSummary;\n}\n\n/**\n * A delegation is \"live\" while the owning run may still produce a response.\n *\n * Takes the delegation shape rather than `Task` so the cockpit's `WebTask`,\n * which carries the state as a plain string, answers the question the same way\n * the store does.\n */\nexport function isDelegationActive(task: { delegation?: { state?: string } }): boolean {\n const state = task.delegation?.state;\n return state === 'requested' || state === 'running';\n}\n"],"mappings":";AAYA,MAAa,iBAA6B;
|
|
1
|
+
{"version":3,"file":"task-CXF9VULl.cjs","names":[],"sources":["../src/models/task.ts"],"sourcesContent":["/**\n * Domain types for the file-backed task store.\n *\n * The on-disk document is the durable source of truth (unlike rpiv-todo, which\n * replayed state from the transcript). Every field here round-trips through\n * JSON, so nothing may hold non-serializable values.\n */\n\nimport type { InlineAgent } from '@agimon-ai/po-core/delegation';\n\nexport type TaskStatus = 'pending' | 'in_progress' | 'completed' | 'failed' | 'deleted';\n\nexport const DELETED_STATUS: TaskStatus = 'deleted';\n\nexport type TaskAction = 'upsert' | 'list' | 'get' | 'delete' | 'clear' | 'assign' | 'cancel';\n\nexport type DelegationState = 'requested' | 'running' | 'completed' | 'failed' | 'cancelled';\n\n/** Terminal result of a delegated subagent run, copied off the delegation response. */\nexport interface DelegationResult {\n status: string;\n output?: string;\n outputPath?: string;\n sessionFile?: string;\n error?: string;\n durationMs?: number;\n toolCount?: number;\n}\n\n/**\n * Delegation bookkeeping attached to a task that was handed to a subagent.\n *\n * `pid` is the harness process that owns the run: it is the only way to tell an\n * genuinely-running delegation from one orphaned by a harness crash, since the\n * child dies with its parent but the file survives.\n */\nexport interface TaskDelegation {\n requestId: string;\n agent: string;\n /** The named run identity minted by the delegation provider, not the agent definition. */\n identity?: string;\n state: DelegationState;\n sessionId?: string;\n pid?: number;\n runId?: string;\n model?: string;\n startedAt?: string;\n endedAt?: string;\n result?: DelegationResult;\n}\n\nexport interface Task {\n id: number;\n subject: string;\n description?: string;\n activeForm?: string;\n status: TaskStatus;\n blockedBy?: number[];\n owner?: string;\n metadata?: Record<string, unknown>;\n createdAt?: string;\n updatedAt?: string;\n delegation?: TaskDelegation;\n}\n\nexport const STORE_SCHEMA_VERSION = 1;\n\n/** The complete on-disk document. `rev` increments on every committed write. */\nexport interface TaskDocument {\n version: number;\n rev: number;\n nextId: number;\n tasks: Task[];\n}\n\nexport function emptyDocument(): TaskDocument {\n return { version: STORE_SCHEMA_VERSION, rev: 0, nextId: 1, tasks: [] };\n}\n\n/**\n * A dependency target inside an upsert item: an existing task id, or the `ref`\n * of a task created earlier in the same call.\n *\n * Refs must start with a letter (see `REF_PATTERN`), so a ref is structurally\n * unconfusable with a stringified id and the discrimination is just `typeof`.\n */\nexport type DepToken = number | string;\n\n/**\n * One entry of an `upsert` call. No `id` creates a task; an `id` updates one.\n *\n * `blockedBy` (absolute set) is create-only and `addBlockedBy`/`removeBlockedBy`\n * (additive merge) are update-only, matching the split the two former actions\n * had. A field used against the wrong kind fails that item rather than being\n * silently ignored.\n */\nexport interface TaskItemMutation {\n id?: number;\n ref?: string;\n subject?: string;\n description?: string;\n activeForm?: string;\n status?: TaskStatus;\n blockedBy?: DepToken[];\n addBlockedBy?: DepToken[];\n removeBlockedBy?: DepToken[];\n owner?: string;\n metadata?: Record<string, unknown>;\n}\n\n/**\n * What one upsert item did. `index` is its position in the request array, so a\n * model reading a partial result can tell which entries still need resending.\n *\n * `message` is unprefixed: the `item[N] failed:` framing belongs to the\n * formatter, because the Task Space overlay shows this text on its own.\n */\nexport type UpsertItemOutcome =\n | {\n index: number;\n kind: 'created';\n id: number;\n subject: string;\n status: TaskStatus;\n ref?: string;\n blockedBy?: number[];\n }\n | { index: number; kind: 'updated'; id: number; fromStatus: TaskStatus; toStatus: TaskStatus }\n | { index: number; kind: 'unchanged'; id: number; status: TaskStatus }\n | { index: number; kind: 'failed'; message: string; id?: number; ref?: string };\n\n/** Which tasks an upsert touched, so renderResult names them instead of guessing. */\nexport interface UpsertSummary {\n /** Ids of applied entries, in request order. A failed entry contributes nothing. */\n applied: number[];\n failed: number;\n}\n\n/** One task-to-agent handoff inside a native assignment batch. */\nexport interface TaskAssignment {\n id: number;\n agent: string;\n inlineAgent?: InlineAgent;\n instructions?: string;\n relevantFiles?: string[];\n priorFindings?: string;\n model?: string;\n context?: 'fresh' | 'fork';\n}\n\n/** Which assignment entries started, so renderResult can show one consolidated batch. */\nexport interface AssignmentSummary {\n /** Ids of successful entries, in request order. A failed entry contributes nothing. */\n assigned: number[];\n failed: number;\n}\n\n/**\n * Open-shape input bag the reducer accepts. The index signature lets the\n * runtime pass a TypeBox `Static<typeof TaskParamsSchema>` through without\n * casting each field.\n *\n * Per-task fields live on `tasks[]`, not here: a top-level `subject` or\n * `status` would be ambiguous once one call can carry many tasks.\n */\nexport interface TaskMutationParams {\n [key: string]: unknown;\n tasks?: TaskItemMutation[];\n /** `assign` only: independent task-to-agent handoffs dispatched by one tool call. */\n assignments?: TaskAssignment[];\n /** `list` filter only. To set a status, upsert the task by id. */\n status?: TaskStatus;\n /** `get`, `delete`, and `cancel` only. Assign ids live in `assignments[]`. */\n id?: number;\n includeDeleted?: boolean;\n}\n\n/** Snapshot returned under a tool result's `details` for renderResult. */\nexport interface TaskDetails {\n action: TaskAction;\n params: Record<string, unknown>;\n tasks: Task[];\n nextId: number;\n rev: number;\n error?: string;\n upsert?: UpsertSummary;\n assignment?: AssignmentSummary;\n}\n\n/**\n * A delegation is \"live\" while the owning run may still produce a response.\n *\n * Takes the delegation shape rather than `Task` so the cockpit's `WebTask`,\n * which carries the state as a plain string, answers the question the same way\n * the store does.\n */\nexport function isDelegationActive(task: { delegation?: { state?: string } }): boolean {\n const state = task.delegation?.state;\n return state === 'requested' || state === 'running';\n}\n"],"mappings":";AAYA,MAAa,iBAA6B;AAqD1C,MAAa,uBAAuB;AAUpC,SAAgB,gBAA8B;CAC5C,OAAO;EAAE,SAAA;EAA+B,KAAK;EAAG,QAAQ;EAAG,OAAO,CAAC;CAAE;AACvE;;;;;;;;AAuHA,SAAgB,mBAAmB,MAAoD;CACrF,MAAM,QAAQ,KAAK,YAAY;CAC/B,OAAO,UAAU,eAAe,UAAU;AAC5C"}
|
|
@@ -24,6 +24,8 @@ interface DelegationResult {
|
|
|
24
24
|
interface TaskDelegation {
|
|
25
25
|
requestId: string;
|
|
26
26
|
agent: string;
|
|
27
|
+
/** The named run identity minted by the delegation provider, not the agent definition. */
|
|
28
|
+
identity?: string;
|
|
27
29
|
state: DelegationState;
|
|
28
30
|
sessionId?: string;
|
|
29
31
|
pid?: number;
|
|
@@ -184,4 +186,4 @@ declare function isDelegationActive(task: {
|
|
|
184
186
|
}): boolean;
|
|
185
187
|
//#endregion
|
|
186
188
|
export { UpsertSummary as _, DepToken as a, TaskAction as c, TaskDetails as d, TaskDocument as f, UpsertItemOutcome as g, TaskStatus as h, DelegationState as i, TaskAssignment as l, TaskMutationParams as m, DELETED_STATUS as n, STORE_SCHEMA_VERSION as o, TaskItemMutation as p, DelegationResult as r, Task as s, AssignmentSummary as t, TaskDelegation as u, emptyDocument as v, isDelegationActive as y };
|
|
187
|
-
//# sourceMappingURL=task-
|
|
189
|
+
//# sourceMappingURL=task-DdTKZNtU.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"task-DdTKZNtU.d.mts","names":[],"sources":["../src/models/task.ts"],"mappings":";;KAUY;cAEC,gBAAgB;KAEjB;KAEA;;UAGK;EACf;EACA;EACA;EACA;EACA;EACA;EACA;;;;;;;;;UAUe;EACf;EACA;;EAEA;EACA,OAAO;EACP;EACA;EACA;EACA;EACA;EACA;EACA,SAAS;;UAGM;EACf;EACA;EACA;EACA;EACA,QAAQ;EACR;EACA;EACA,WAAW;EACX;EACA;EACA,aAAa;;cAGF;;UAGI;EACf;EACA;EACA;EACA,OAAO;;iBAGO,iBAAiB;;;;;;;;KAWrB;;;;;;;;;UAUK;EACf;EACA;EACA;EACA;EACA;EACA,SAAS;EACT,YAAY;EACZ,eAAe;EACf,kBAAkB;EAClB;EACA,WAAW;;;;;;;;;KAUD;EAEN;EACA;EACA;EACA;EACA,QAAQ;EACR;EACA;;EAEA;EAAe;EAAiB;EAAY,YAAY;EAAY,UAAU;;EAC9E;EAAe;EAAmB;EAAY,QAAQ;;EACtD;EAAe;EAAgB;EAAiB;EAAa;;;UAGlD;;EAEf;EACA;;;UAIe;EACf;EACA;EACA,cAAc;EACd;EACA;EACA;EACA;EACA;;;UAIe;;EAEf;EACA;;;;;;;;;;UAWe;GACd;EACD,QAAQ;;EAER,cAAc;;EAEd,SAAS;;EAET;EACA;;;UAIe;EACf,QAAQ;EACR,QAAQ;EACR,OAAO;EACP;EACA;EACA;EACA,SAAS;EACT,aAAa;;;;;;;;;iBAUC,mBAAmB;EAAQ;IAAe"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"task-giCbpKzV.mjs","names":[],"sources":["../src/models/task.ts"],"sourcesContent":["/**\n * Domain types for the file-backed task store.\n *\n * The on-disk document is the durable source of truth (unlike rpiv-todo, which\n * replayed state from the transcript). Every field here round-trips through\n * JSON, so nothing may hold non-serializable values.\n */\n\nimport type { InlineAgent } from '@agimon-ai/po-core/delegation';\n\nexport type TaskStatus = 'pending' | 'in_progress' | 'completed' | 'failed' | 'deleted';\n\nexport const DELETED_STATUS: TaskStatus = 'deleted';\n\nexport type TaskAction = 'upsert' | 'list' | 'get' | 'delete' | 'clear' | 'assign' | 'cancel';\n\nexport type DelegationState = 'requested' | 'running' | 'completed' | 'failed' | 'cancelled';\n\n/** Terminal result of a delegated subagent run, copied off the delegation response. */\nexport interface DelegationResult {\n status: string;\n output?: string;\n outputPath?: string;\n sessionFile?: string;\n error?: string;\n durationMs?: number;\n toolCount?: number;\n}\n\n/**\n * Delegation bookkeeping attached to a task that was handed to a subagent.\n *\n * `pid` is the harness process that owns the run: it is the only way to tell an\n * genuinely-running delegation from one orphaned by a harness crash, since the\n * child dies with its parent but the file survives.\n */\nexport interface TaskDelegation {\n requestId: string;\n agent: string;\n state: DelegationState;\n sessionId?: string;\n pid?: number;\n runId?: string;\n model?: string;\n startedAt?: string;\n endedAt?: string;\n result?: DelegationResult;\n}\n\nexport interface Task {\n id: number;\n subject: string;\n description?: string;\n activeForm?: string;\n status: TaskStatus;\n blockedBy?: number[];\n owner?: string;\n metadata?: Record<string, unknown>;\n createdAt?: string;\n updatedAt?: string;\n delegation?: TaskDelegation;\n}\n\nexport const STORE_SCHEMA_VERSION = 1;\n\n/** The complete on-disk document. `rev` increments on every committed write. */\nexport interface TaskDocument {\n version: number;\n rev: number;\n nextId: number;\n tasks: Task[];\n}\n\nexport function emptyDocument(): TaskDocument {\n return { version: STORE_SCHEMA_VERSION, rev: 0, nextId: 1, tasks: [] };\n}\n\n/**\n * A dependency target inside an upsert item: an existing task id, or the `ref`\n * of a task created earlier in the same call.\n *\n * Refs must start with a letter (see `REF_PATTERN`), so a ref is structurally\n * unconfusable with a stringified id and the discrimination is just `typeof`.\n */\nexport type DepToken = number | string;\n\n/**\n * One entry of an `upsert` call. No `id` creates a task; an `id` updates one.\n *\n * `blockedBy` (absolute set) is create-only and `addBlockedBy`/`removeBlockedBy`\n * (additive merge) are update-only, matching the split the two former actions\n * had. A field used against the wrong kind fails that item rather than being\n * silently ignored.\n */\nexport interface TaskItemMutation {\n id?: number;\n ref?: string;\n subject?: string;\n description?: string;\n activeForm?: string;\n status?: TaskStatus;\n blockedBy?: DepToken[];\n addBlockedBy?: DepToken[];\n removeBlockedBy?: DepToken[];\n owner?: string;\n metadata?: Record<string, unknown>;\n}\n\n/**\n * What one upsert item did. `index` is its position in the request array, so a\n * model reading a partial result can tell which entries still need resending.\n *\n * `message` is unprefixed: the `item[N] failed:` framing belongs to the\n * formatter, because the Task Space overlay shows this text on its own.\n */\nexport type UpsertItemOutcome =\n | {\n index: number;\n kind: 'created';\n id: number;\n subject: string;\n status: TaskStatus;\n ref?: string;\n blockedBy?: number[];\n }\n | { index: number; kind: 'updated'; id: number; fromStatus: TaskStatus; toStatus: TaskStatus }\n | { index: number; kind: 'unchanged'; id: number; status: TaskStatus }\n | { index: number; kind: 'failed'; message: string; id?: number; ref?: string };\n\n/** Which tasks an upsert touched, so renderResult names them instead of guessing. */\nexport interface UpsertSummary {\n /** Ids of applied entries, in request order. A failed entry contributes nothing. */\n applied: number[];\n failed: number;\n}\n\n/** One task-to-agent handoff inside a native assignment batch. */\nexport interface TaskAssignment {\n id: number;\n agent: string;\n inlineAgent?: InlineAgent;\n instructions?: string;\n relevantFiles?: string[];\n priorFindings?: string;\n model?: string;\n context?: 'fresh' | 'fork';\n}\n\n/** Which assignment entries started, so renderResult can show one consolidated batch. */\nexport interface AssignmentSummary {\n /** Ids of successful entries, in request order. A failed entry contributes nothing. */\n assigned: number[];\n failed: number;\n}\n\n/**\n * Open-shape input bag the reducer accepts. The index signature lets the\n * runtime pass a TypeBox `Static<typeof TaskParamsSchema>` through without\n * casting each field.\n *\n * Per-task fields live on `tasks[]`, not here: a top-level `subject` or\n * `status` would be ambiguous once one call can carry many tasks.\n */\nexport interface TaskMutationParams {\n [key: string]: unknown;\n tasks?: TaskItemMutation[];\n /** `assign` only: independent task-to-agent handoffs dispatched by one tool call. */\n assignments?: TaskAssignment[];\n /** `list` filter only. To set a status, upsert the task by id. */\n status?: TaskStatus;\n /** `get`, `delete`, and `cancel` only. Assign ids live in `assignments[]`. */\n id?: number;\n includeDeleted?: boolean;\n}\n\n/** Snapshot returned under a tool result's `details` for renderResult. */\nexport interface TaskDetails {\n action: TaskAction;\n params: Record<string, unknown>;\n tasks: Task[];\n nextId: number;\n rev: number;\n error?: string;\n upsert?: UpsertSummary;\n assignment?: AssignmentSummary;\n}\n\n/**\n * A delegation is \"live\" while the owning run may still produce a response.\n *\n * Takes the delegation shape rather than `Task` so the cockpit's `WebTask`,\n * which carries the state as a plain string, answers the question the same way\n * the store does.\n */\nexport function isDelegationActive(task: { delegation?: { state?: string } }): boolean {\n const state = task.delegation?.state;\n return state === 'requested' || state === 'running';\n}\n"],"mappings":";AAYA,MAAa,iBAA6B;
|
|
1
|
+
{"version":3,"file":"task-giCbpKzV.mjs","names":[],"sources":["../src/models/task.ts"],"sourcesContent":["/**\n * Domain types for the file-backed task store.\n *\n * The on-disk document is the durable source of truth (unlike rpiv-todo, which\n * replayed state from the transcript). Every field here round-trips through\n * JSON, so nothing may hold non-serializable values.\n */\n\nimport type { InlineAgent } from '@agimon-ai/po-core/delegation';\n\nexport type TaskStatus = 'pending' | 'in_progress' | 'completed' | 'failed' | 'deleted';\n\nexport const DELETED_STATUS: TaskStatus = 'deleted';\n\nexport type TaskAction = 'upsert' | 'list' | 'get' | 'delete' | 'clear' | 'assign' | 'cancel';\n\nexport type DelegationState = 'requested' | 'running' | 'completed' | 'failed' | 'cancelled';\n\n/** Terminal result of a delegated subagent run, copied off the delegation response. */\nexport interface DelegationResult {\n status: string;\n output?: string;\n outputPath?: string;\n sessionFile?: string;\n error?: string;\n durationMs?: number;\n toolCount?: number;\n}\n\n/**\n * Delegation bookkeeping attached to a task that was handed to a subagent.\n *\n * `pid` is the harness process that owns the run: it is the only way to tell an\n * genuinely-running delegation from one orphaned by a harness crash, since the\n * child dies with its parent but the file survives.\n */\nexport interface TaskDelegation {\n requestId: string;\n agent: string;\n /** The named run identity minted by the delegation provider, not the agent definition. */\n identity?: string;\n state: DelegationState;\n sessionId?: string;\n pid?: number;\n runId?: string;\n model?: string;\n startedAt?: string;\n endedAt?: string;\n result?: DelegationResult;\n}\n\nexport interface Task {\n id: number;\n subject: string;\n description?: string;\n activeForm?: string;\n status: TaskStatus;\n blockedBy?: number[];\n owner?: string;\n metadata?: Record<string, unknown>;\n createdAt?: string;\n updatedAt?: string;\n delegation?: TaskDelegation;\n}\n\nexport const STORE_SCHEMA_VERSION = 1;\n\n/** The complete on-disk document. `rev` increments on every committed write. */\nexport interface TaskDocument {\n version: number;\n rev: number;\n nextId: number;\n tasks: Task[];\n}\n\nexport function emptyDocument(): TaskDocument {\n return { version: STORE_SCHEMA_VERSION, rev: 0, nextId: 1, tasks: [] };\n}\n\n/**\n * A dependency target inside an upsert item: an existing task id, or the `ref`\n * of a task created earlier in the same call.\n *\n * Refs must start with a letter (see `REF_PATTERN`), so a ref is structurally\n * unconfusable with a stringified id and the discrimination is just `typeof`.\n */\nexport type DepToken = number | string;\n\n/**\n * One entry of an `upsert` call. No `id` creates a task; an `id` updates one.\n *\n * `blockedBy` (absolute set) is create-only and `addBlockedBy`/`removeBlockedBy`\n * (additive merge) are update-only, matching the split the two former actions\n * had. A field used against the wrong kind fails that item rather than being\n * silently ignored.\n */\nexport interface TaskItemMutation {\n id?: number;\n ref?: string;\n subject?: string;\n description?: string;\n activeForm?: string;\n status?: TaskStatus;\n blockedBy?: DepToken[];\n addBlockedBy?: DepToken[];\n removeBlockedBy?: DepToken[];\n owner?: string;\n metadata?: Record<string, unknown>;\n}\n\n/**\n * What one upsert item did. `index` is its position in the request array, so a\n * model reading a partial result can tell which entries still need resending.\n *\n * `message` is unprefixed: the `item[N] failed:` framing belongs to the\n * formatter, because the Task Space overlay shows this text on its own.\n */\nexport type UpsertItemOutcome =\n | {\n index: number;\n kind: 'created';\n id: number;\n subject: string;\n status: TaskStatus;\n ref?: string;\n blockedBy?: number[];\n }\n | { index: number; kind: 'updated'; id: number; fromStatus: TaskStatus; toStatus: TaskStatus }\n | { index: number; kind: 'unchanged'; id: number; status: TaskStatus }\n | { index: number; kind: 'failed'; message: string; id?: number; ref?: string };\n\n/** Which tasks an upsert touched, so renderResult names them instead of guessing. */\nexport interface UpsertSummary {\n /** Ids of applied entries, in request order. A failed entry contributes nothing. */\n applied: number[];\n failed: number;\n}\n\n/** One task-to-agent handoff inside a native assignment batch. */\nexport interface TaskAssignment {\n id: number;\n agent: string;\n inlineAgent?: InlineAgent;\n instructions?: string;\n relevantFiles?: string[];\n priorFindings?: string;\n model?: string;\n context?: 'fresh' | 'fork';\n}\n\n/** Which assignment entries started, so renderResult can show one consolidated batch. */\nexport interface AssignmentSummary {\n /** Ids of successful entries, in request order. A failed entry contributes nothing. */\n assigned: number[];\n failed: number;\n}\n\n/**\n * Open-shape input bag the reducer accepts. The index signature lets the\n * runtime pass a TypeBox `Static<typeof TaskParamsSchema>` through without\n * casting each field.\n *\n * Per-task fields live on `tasks[]`, not here: a top-level `subject` or\n * `status` would be ambiguous once one call can carry many tasks.\n */\nexport interface TaskMutationParams {\n [key: string]: unknown;\n tasks?: TaskItemMutation[];\n /** `assign` only: independent task-to-agent handoffs dispatched by one tool call. */\n assignments?: TaskAssignment[];\n /** `list` filter only. To set a status, upsert the task by id. */\n status?: TaskStatus;\n /** `get`, `delete`, and `cancel` only. Assign ids live in `assignments[]`. */\n id?: number;\n includeDeleted?: boolean;\n}\n\n/** Snapshot returned under a tool result's `details` for renderResult. */\nexport interface TaskDetails {\n action: TaskAction;\n params: Record<string, unknown>;\n tasks: Task[];\n nextId: number;\n rev: number;\n error?: string;\n upsert?: UpsertSummary;\n assignment?: AssignmentSummary;\n}\n\n/**\n * A delegation is \"live\" while the owning run may still produce a response.\n *\n * Takes the delegation shape rather than `Task` so the cockpit's `WebTask`,\n * which carries the state as a plain string, answers the question the same way\n * the store does.\n */\nexport function isDelegationActive(task: { delegation?: { state?: string } }): boolean {\n const state = task.delegation?.state;\n return state === 'requested' || state === 'running';\n}\n"],"mappings":";AAYA,MAAa,iBAA6B;AAqD1C,MAAa,uBAAuB;AAUpC,SAAgB,gBAA8B;CAC5C,OAAO;EAAE,SAAA;EAA+B,KAAK;EAAG,QAAQ;EAAG,OAAO,CAAC;CAAE;AACvE;;;;;;;;AAuHA,SAAgB,mBAAmB,MAAoD;CACrF,MAAM,QAAQ,KAAK,YAAY;CAC/B,OAAO,UAAU,eAAe,UAAU;AAC5C"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { s as Task } from "./task-
|
|
1
|
+
import { s as Task } from "./task-DdTKZNtU.mjs";
|
|
2
2
|
//#region src/models/taskGraph.d.ts
|
|
3
3
|
/** True when a non-empty list has no visible work left to finish. */
|
|
4
4
|
declare function isTaskListComplete(taskList: readonly Task[]): boolean;
|
|
@@ -22,4 +22,4 @@ declare function unresolvedBlockers(taskList: readonly Task[], task: Task): numb
|
|
|
22
22
|
declare function isBlocked(taskList: readonly Task[], task: Task): boolean;
|
|
23
23
|
//#endregion
|
|
24
24
|
export { unresolvedBlockers as a, isTaskListComplete as i, detectCycle as n, isBlocked as r, deriveBlocks as t };
|
|
25
|
-
//# sourceMappingURL=taskGraph-
|
|
25
|
+
//# sourceMappingURL=taskGraph-CB8ffMCz.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taskGraph-
|
|
1
|
+
{"version":3,"file":"taskGraph-CB8ffMCz.d.mts","names":[],"sources":["../src/models/taskGraph.ts"],"mappings":";;;iBAMgB,mBAAmB,mBAAmB;;;;;;;iBAWtC,YAAY,mBAAmB,QAAQ,gBAAgB;;iBA+BvD,aAAa,mBAAmB,SAAS;;;;;;;;iBAmBzC,mBAAmB,mBAAmB,QAAQ,MAAM;iBAQpD,UAAU,mBAAmB,QAAQ,MAAM"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as MSG_UPSERT_PARTIAL, c as buildTextResult, d as formatContent, f as formatUpsertFailureText, i as MSG_UPSERT_NONE_APPLIED, l as buildToolResult, n as MSG_ALL_COMPLETE_CLEAR, o as ToolResult, r as MSG_ASSIGN_PARTIAL, s as buildAssignmentResult, t as AssignmentItemResult, u as formatAssignmentResults } from "./index-
|
|
1
|
+
import { a as MSG_UPSERT_PARTIAL, c as buildTextResult, d as formatContent, f as formatUpsertFailureText, i as MSG_UPSERT_NONE_APPLIED, l as buildToolResult, n as MSG_ALL_COMPLETE_CLEAR, o as ToolResult, r as MSG_ASSIGN_PARTIAL, s as buildAssignmentResult, t as AssignmentItemResult, u as formatAssignmentResults } from "./index-DrE00rrP.mjs";
|
|
2
2
|
export { AssignmentItemResult, MSG_ALL_COMPLETE_CLEAR, MSG_ASSIGN_PARTIAL, MSG_UPSERT_NONE_APPLIED, MSG_UPSERT_PARTIAL, ToolResult, buildAssignmentResult, buildTextResult, buildToolResult, formatAssignmentResults, formatContent, formatUpsertFailureText };
|
package/dist/toolSchema.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { _ as TaskParamsSchema, a as RemoteTaskParamsSchema, c as TASK_CONTEXTS, d as TOOL_NAME, f as TaskAssignmentParams, g as TaskParams, h as TaskItemSchema, i as REMOTE_TASK_ACTIONS, l as TASK_STATUSES, m as TaskItemParams, n as MSG_NO_TASKS, o as TASK_ACTIONS, p as TaskAssignmentSchema, r as MSG_UPSERT_FIELD_MISPLACED, s as TASK_ACTION_FIELDS, t as ERR_REQUIRES_INTERACTIVE, u as TOOL_LABEL, v as taskActionAcceptsField, y as COMMAND_NAME } from "./task
|
|
1
|
+
import { _ as TaskParamsSchema, a as RemoteTaskParamsSchema, c as TASK_CONTEXTS, d as TOOL_NAME, f as TaskAssignmentParams, g as TaskParams, h as TaskItemSchema, i as REMOTE_TASK_ACTIONS, l as TASK_STATUSES, m as TaskItemParams, n as MSG_NO_TASKS, o as TASK_ACTIONS, p as TaskAssignmentSchema, r as MSG_UPSERT_FIELD_MISPLACED, s as TASK_ACTION_FIELDS, t as ERR_REQUIRES_INTERACTIVE, u as TOOL_LABEL, v as taskActionAcceptsField, y as COMMAND_NAME } from "./task--hlnpS7L.mjs";
|
|
2
2
|
export { COMMAND_NAME, ERR_REQUIRES_INTERACTIVE, MSG_NO_TASKS, MSG_UPSERT_FIELD_MISPLACED, REMOTE_TASK_ACTIONS, RemoteTaskParamsSchema, TASK_ACTIONS, TASK_ACTION_FIELDS, TASK_CONTEXTS, TASK_STATUSES, TOOL_LABEL, TOOL_NAME, TaskAssignmentParams, TaskAssignmentSchema, TaskItemParams, TaskItemSchema, TaskParams, TaskParamsSchema, taskActionAcceptsField };
|
package/llms.txt
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# @agimon-ai/po-task
|
|
2
|
+
|
|
3
|
+
Package-owned guidance for tracking multi-step work as a persistent task graph
|
|
4
|
+
|
|
5
|
+
## How to use
|
|
6
|
+
|
|
7
|
+
- [Use Task](./src/prompts/codemode-how-to-task/SKILL.md): The tasks namespace in code mode, status flow, batching rules, and handing ready tasks to background subagents.
|
|
8
|
+
|
|
9
|
+
## Resources
|
|
10
|
+
|
|
11
|
+
- [Package README](./README.md): Installation, development commands, behavior, and extension-specific usage.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agimon-ai/po-task",
|
|
3
|
-
"version": "0.0.0-alpha.
|
|
3
|
+
"version": "0.0.0-alpha.41",
|
|
4
4
|
"description": "Persistent, dependency-aware task graphs and subagent delegation for Pi coding sessions.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ai",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"bugs": {
|
|
19
19
|
"url": "https://github.com/AgiFlow/po/issues"
|
|
20
20
|
},
|
|
21
|
-
"license": "
|
|
21
|
+
"license": "BUSL-1.1",
|
|
22
22
|
"author": "Vuong Ngo",
|
|
23
23
|
"repository": {
|
|
24
24
|
"type": "git",
|
|
@@ -27,6 +27,8 @@
|
|
|
27
27
|
},
|
|
28
28
|
"files": [
|
|
29
29
|
"dist",
|
|
30
|
+
"llms.txt",
|
|
31
|
+
"src/prompts",
|
|
30
32
|
"src/types/webTasks.ts",
|
|
31
33
|
"package.json"
|
|
32
34
|
],
|
|
@@ -129,33 +131,32 @@
|
|
|
129
131
|
"registry": "https://registry.npmjs.org/"
|
|
130
132
|
},
|
|
131
133
|
"dependencies": {
|
|
132
|
-
"@agimon-ai/po-core": "0.0.0-alpha.
|
|
133
|
-
"@agimon-ai/po-
|
|
134
|
-
"@agimon-ai/po-
|
|
135
|
-
"@
|
|
136
|
-
"
|
|
137
|
-
"typebox": "1.3.37"
|
|
134
|
+
"@agimon-ai/po-core": "0.0.0-alpha.41",
|
|
135
|
+
"@agimon-ai/po-ui": "0.0.0-alpha.41",
|
|
136
|
+
"@agimon-ai/po-web-components": "0.0.0-alpha.41",
|
|
137
|
+
"@deepseek-ai/cordis": "4.0.5",
|
|
138
|
+
"typebox": "1.4.2"
|
|
138
139
|
},
|
|
139
140
|
"devDependencies": {
|
|
140
|
-
"@agimon-ai/po-build": "0.0.0-alpha.
|
|
141
|
-
"@agimon-ai/po-native-components": "0.0.0-alpha.
|
|
141
|
+
"@agimon-ai/po-build": "0.0.0-alpha.41",
|
|
142
|
+
"@agimon-ai/po-native-components": "0.0.0-alpha.41",
|
|
142
143
|
"@babel/core": "7.29.7",
|
|
143
|
-
"@earendil-works/pi-coding-agent": "1.
|
|
144
|
+
"@earendil-works/pi-coding-agent": "1.3.0",
|
|
144
145
|
"@tanstack/react-store": "0.11.2",
|
|
145
146
|
"@tanstack/store": "0.11.2",
|
|
146
147
|
"@types/node": "26.6.5",
|
|
147
|
-
"@types/react": "~19.
|
|
148
|
+
"@types/react": "~19.3.0",
|
|
148
149
|
"@vitest/coverage-v8": "5.0.4",
|
|
149
|
-
"react": "19.3.
|
|
150
|
-
"react-dom": "19.3.
|
|
151
|
-
"react-native": "0.
|
|
150
|
+
"react": "19.3.1",
|
|
151
|
+
"react-dom": "19.3.1",
|
|
152
|
+
"react-native": "0.88.0",
|
|
152
153
|
"react-native-unistyles": "3.5.3",
|
|
153
154
|
"tsdown": "0.23.1",
|
|
154
155
|
"typescript": "~6.0.3",
|
|
155
156
|
"vitest": "5.0.4"
|
|
156
157
|
},
|
|
157
158
|
"peerDependencies": {
|
|
158
|
-
"@earendil-works/pi-coding-agent": "1.
|
|
159
|
+
"@earendil-works/pi-coding-agent": "1.3.0"
|
|
159
160
|
},
|
|
160
161
|
"peerDependenciesMeta": {
|
|
161
162
|
"@earendil-works/pi-coding-agent": {
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: codemode-how-to-task
|
|
3
|
+
description: 'Keep a plan that survives compaction and delegate parts of it to background subagents. Use for any multi-step plan, todo list, or delegation.'
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Use Task
|
|
7
|
+
|
|
8
|
+
Po Task keeps a task graph on disk, outside the transcript. It survives compaction, holds dependencies, and can hand a task to a background subagent. In code mode it is the `tasks` namespace: call `discover({ namespace: 'tasks' })` for the types, then `exec`.
|
|
9
|
+
|
|
10
|
+
```ts
|
|
11
|
+
const { document } = await tasks.upsert([
|
|
12
|
+
{ ref: 'a', subject: 'Research the store' },
|
|
13
|
+
{ subject: 'Write the reducer', blockedBy: ['a'] },
|
|
14
|
+
]);
|
|
15
|
+
return document.tasks.filter((task) => task.status !== 'deleted');
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
`tasks.snapshot()` reads the graph. `upsert`, `delete`, `clear`, `assign` and `cancel` change it and return `{ message, document }`. Nothing is printed unless the script returns it, so return only what you need.
|
|
19
|
+
|
|
20
|
+
## Tracking work
|
|
21
|
+
|
|
22
|
+
- Batch the whole plan in one `upsert`. Report progress one call at a time: mark a task `in_progress` before you start it and `completed` the moment it lands, never batched at the end of a turn.
|
|
23
|
+
- Keep one task `in_progress` for your own work. Delegated tasks run in parallel and do not count.
|
|
24
|
+
- Status flow is `pending`, `in_progress`, `completed`. `failed` is recoverable. `deleted` is a tombstone. Pass `activeForm` (for example `'writing tests'`) when marking `in_progress`.
|
|
25
|
+
- Never mark a task `completed` while tests fail or the work is partial. Use `failed`, or keep it `in_progress` and add a task for the blocker in the same `upsert`.
|
|
26
|
+
- When every non-deleted task is `completed`, review the list once and call `tasks.clear()`.
|
|
27
|
+
- Subject stays short and imperative. `description` is the durable brief a subagent receives, so keep it separate from `instructions`.
|
|
28
|
+
|
|
29
|
+
## Reading failures
|
|
30
|
+
|
|
31
|
+
`upsert` applies each entry independently. Passing entries commit, and `applied` and `failed` tell you which. Nothing applied throws. Resend only the corrected entries, because resending an applied entry with no `id` creates a duplicate task. A graph holds 15 non-deleted tasks by default: updates still apply when full, but new tasks are refused until space is freed.
|
|
32
|
+
|
|
33
|
+
## Delegating
|
|
34
|
+
|
|
35
|
+
- Apply the session's delegation criteria first, then call `subagent({ action: 'agents' })` and use an exact discovered name. Prefer a general-purpose write-capable agent such as `delegate` or `worker` when no specialist fits. Use a focused `inlineAgent` only for read-only work.
|
|
36
|
+
- Assign through `tasks.assign([...])` even for one task. Put independent ready tasks in one batch. Do not start a direct subagent run for work already on the list.
|
|
37
|
+
- Successful entries keep running when another entry fails. Retry only the failures.
|
|
38
|
+
- Fill `relevantFiles` only with files you read or located, and `priorFindings` only with verified facts in a few lines, not directives. A guessed path costs more than an omitted one.
|
|
39
|
+
- When a delegated task completes and unblocks another, reconsider it promptly. If a child asks for a decision or an assignment fails to start, respond, rescope or retry instead of leaving it pending. The task itself records the delegated lifecycle and result.
|
|
40
|
+
- `tasks.cancel(id)` stops a running delegation. `delete` and `clear` refuse while one is running.
|
package/src/types/webTasks.ts
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"logSinkTelemetry-BGb8WQBz.cjs","names":["createPoTelemetry","TASK_EVENT"],"sources":["../src/services/logSinkTelemetry/index.ts"],"sourcesContent":["import { createPoTelemetry, type PoTelemetry, type PoTelemetryOptions } from '@agimon-ai/po-telemetry';\n\nimport { TASK_EVENT, type TaskErrorAttributes, type TaskFailureReporter } from '../../types/telemetry';\n\nexport {\n TASK_EVENT,\n type TaskErrorAttributes,\n type TaskErrorSink,\n type TaskEventName,\n type TaskEventSink,\n type TaskFailureReporter,\n} from '../../types/telemetry';\n\nconst SERVICE_NAME = 'po-task';\nconst PACKAGE_NAME = '@agimon-ai/po-task';\nconst NOTIFICATION_OPERATION = 'completion_notification';\n\nexport interface TaskErrorReporterOptions {\n cwd?: string;\n workspaceRoot?: string;\n env?: NodeJS.ProcessEnv;\n telemetryFactory?: NonNullable<PoTelemetryOptions['telemetryFactory']>;\n warn?: (message: string) => void;\n}\n\nexport interface TaskErrorReporter {\n recordError(event: string, error: unknown, attributes?: TaskErrorAttributes): Promise<void>;\n recordWarning(event: string, error: unknown, attributes?: TaskErrorAttributes): Promise<void>;\n recordEvent(event: string, attributes?: TaskErrorAttributes): Promise<void>;\n recordNotificationError(error: unknown, taskId: number): Promise<void>;\n flush(): Promise<void>;\n shutdown(): Promise<void>;\n}\n\nexport function createTaskErrorReporter(options: TaskErrorReporterOptions = {}): TaskErrorReporter {\n const telemetry: PoTelemetry = createPoTelemetry({\n serviceName: SERVICE_NAME,\n packageName: PACKAGE_NAME,\n cwd: options.cwd,\n workspaceRoot: options.workspaceRoot,\n env: options.env,\n telemetryFactory: options.telemetryFactory,\n warn: options.warn,\n enableLogs: true,\n enableTraces: true,\n });\n return {\n recordError: (event, error, attributes) => telemetry.recordError(event, error, attributes),\n recordWarning: (event, error, attributes) => telemetry.recordWarning(event, error, attributes),\n recordEvent: (event, attributes) => telemetry.recordEvent(event, attributes),\n recordNotificationError: (error, taskId) =>\n telemetry.recordError(TASK_EVENT.notificationFailed, error, {\n 'task.id': taskId,\n 'task.operation': NOTIFICATION_OPERATION,\n }),\n flush: () => telemetry.flush(),\n shutdown: () => telemetry.shutdown(),\n };\n}\n\nexport function toFailureReporter(reporter: TaskErrorReporter): TaskFailureReporter {\n return {\n error: (event, error, attributes) => void reporter.recordError(event, error, attributes),\n warn: (event, error, attributes) => void reporter.recordWarning(event, error, attributes),\n event: (event, attributes) => void reporter.recordEvent(event, attributes),\n };\n}\n"],"mappings":";;;AAaA,MAAM,eAAe;AACrB,MAAM,eAAe;AACrB,MAAM,yBAAyB;AAmB/B,SAAgB,wBAAwB,UAAoC,CAAC,GAAsB;CACjG,MAAM,aAAA,GAAyBA,wBAAAA,kBAAAA,CAAkB;EAC/C,aAAa;EACb,aAAa;EACb,KAAK,QAAQ;EACb,eAAe,QAAQ;EACvB,KAAK,QAAQ;EACb,kBAAkB,QAAQ;EAC1B,MAAM,QAAQ;EACd,YAAY;EACZ,cAAc;CAChB,CAAC;CACD,OAAO;EACL,cAAc,OAAO,OAAO,eAAe,UAAU,YAAY,OAAO,OAAO,UAAU;EACzF,gBAAgB,OAAO,OAAO,eAAe,UAAU,cAAc,OAAO,OAAO,UAAU;EAC7F,cAAc,OAAO,eAAe,UAAU,YAAY,OAAO,UAAU;EAC3E,0BAA0B,OAAO,WAC/B,UAAU,YAAYC,kBAAAA,WAAW,oBAAoB,OAAO;GAC1D,WAAW;GACX,kBAAkB;EACpB,CAAC;EACH,aAAa,UAAU,MAAM;EAC7B,gBAAgB,UAAU,SAAS;CACrC;AACF;AAEA,SAAgB,kBAAkB,UAAkD;CAClF,OAAO;EACL,QAAQ,OAAO,OAAO,eAAe,KAAK,SAAS,YAAY,OAAO,OAAO,UAAU;EACvF,OAAO,OAAO,OAAO,eAAe,KAAK,SAAS,cAAc,OAAO,OAAO,UAAU;EACxF,QAAQ,OAAO,eAAe,KAAK,SAAS,YAAY,OAAO,UAAU;CAC3E;AACF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"logSinkTelemetry-BhbKdn-x.mjs","names":[],"sources":["../src/services/logSinkTelemetry/index.ts"],"sourcesContent":["import { createPoTelemetry, type PoTelemetry, type PoTelemetryOptions } from '@agimon-ai/po-telemetry';\n\nimport { TASK_EVENT, type TaskErrorAttributes, type TaskFailureReporter } from '../../types/telemetry';\n\nexport {\n TASK_EVENT,\n type TaskErrorAttributes,\n type TaskErrorSink,\n type TaskEventName,\n type TaskEventSink,\n type TaskFailureReporter,\n} from '../../types/telemetry';\n\nconst SERVICE_NAME = 'po-task';\nconst PACKAGE_NAME = '@agimon-ai/po-task';\nconst NOTIFICATION_OPERATION = 'completion_notification';\n\nexport interface TaskErrorReporterOptions {\n cwd?: string;\n workspaceRoot?: string;\n env?: NodeJS.ProcessEnv;\n telemetryFactory?: NonNullable<PoTelemetryOptions['telemetryFactory']>;\n warn?: (message: string) => void;\n}\n\nexport interface TaskErrorReporter {\n recordError(event: string, error: unknown, attributes?: TaskErrorAttributes): Promise<void>;\n recordWarning(event: string, error: unknown, attributes?: TaskErrorAttributes): Promise<void>;\n recordEvent(event: string, attributes?: TaskErrorAttributes): Promise<void>;\n recordNotificationError(error: unknown, taskId: number): Promise<void>;\n flush(): Promise<void>;\n shutdown(): Promise<void>;\n}\n\nexport function createTaskErrorReporter(options: TaskErrorReporterOptions = {}): TaskErrorReporter {\n const telemetry: PoTelemetry = createPoTelemetry({\n serviceName: SERVICE_NAME,\n packageName: PACKAGE_NAME,\n cwd: options.cwd,\n workspaceRoot: options.workspaceRoot,\n env: options.env,\n telemetryFactory: options.telemetryFactory,\n warn: options.warn,\n enableLogs: true,\n enableTraces: true,\n });\n return {\n recordError: (event, error, attributes) => telemetry.recordError(event, error, attributes),\n recordWarning: (event, error, attributes) => telemetry.recordWarning(event, error, attributes),\n recordEvent: (event, attributes) => telemetry.recordEvent(event, attributes),\n recordNotificationError: (error, taskId) =>\n telemetry.recordError(TASK_EVENT.notificationFailed, error, {\n 'task.id': taskId,\n 'task.operation': NOTIFICATION_OPERATION,\n }),\n flush: () => telemetry.flush(),\n shutdown: () => telemetry.shutdown(),\n };\n}\n\nexport function toFailureReporter(reporter: TaskErrorReporter): TaskFailureReporter {\n return {\n error: (event, error, attributes) => void reporter.recordError(event, error, attributes),\n warn: (event, error, attributes) => void reporter.recordWarning(event, error, attributes),\n event: (event, attributes) => void reporter.recordEvent(event, attributes),\n };\n}\n"],"mappings":";;;AAaA,MAAM,eAAe;AACrB,MAAM,eAAe;AACrB,MAAM,yBAAyB;AAmB/B,SAAgB,wBAAwB,UAAoC,CAAC,GAAsB;CACjG,MAAM,YAAyB,kBAAkB;EAC/C,aAAa;EACb,aAAa;EACb,KAAK,QAAQ;EACb,eAAe,QAAQ;EACvB,KAAK,QAAQ;EACb,kBAAkB,QAAQ;EAC1B,MAAM,QAAQ;EACd,YAAY;EACZ,cAAc;CAChB,CAAC;CACD,OAAO;EACL,cAAc,OAAO,OAAO,eAAe,UAAU,YAAY,OAAO,OAAO,UAAU;EACzF,gBAAgB,OAAO,OAAO,eAAe,UAAU,cAAc,OAAO,OAAO,UAAU;EAC7F,cAAc,OAAO,eAAe,UAAU,YAAY,OAAO,UAAU;EAC3E,0BAA0B,OAAO,WAC/B,UAAU,YAAY,WAAW,oBAAoB,OAAO;GAC1D,WAAW;GACX,kBAAkB;EACpB,CAAC;EACH,aAAa,UAAU,MAAM;EAC7B,gBAAgB,UAAU,SAAS;CACrC;AACF;AAEA,SAAgB,kBAAkB,UAAkD;CAClF,OAAO;EACL,QAAQ,OAAO,OAAO,eAAe,KAAK,SAAS,YAAY,OAAO,OAAO,UAAU;EACvF,OAAO,OAAO,OAAO,eAAe,KAAK,SAAS,cAAc,OAAO,OAAO,UAAU;EACxF,QAAQ,OAAO,eAAe,KAAK,SAAS,YAAY,OAAO,UAAU;CAC3E;AACF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"task-DJpTteeJ.d.mts","names":[],"sources":["../src/models/task.ts"],"mappings":";;KAUY;cAEC,gBAAgB;KAEjB;KAEA;;UAGK;EACf;EACA;EACA;EACA;EACA;EACA;EACA;;;;;;;;;UAUe;EACf;EACA;EACA,OAAO;EACP;EACA;EACA;EACA;EACA;EACA;EACA,SAAS;;UAGM;EACf;EACA;EACA;EACA;EACA,QAAQ;EACR;EACA;EACA,WAAW;EACX;EACA;EACA,aAAa;;cAGF;;UAGI;EACf;EACA;EACA;EACA,OAAO;;iBAGO,iBAAiB;;;;;;;;KAWrB;;;;;;;;;UAUK;EACf;EACA;EACA;EACA;EACA;EACA,SAAS;EACT,YAAY;EACZ,eAAe;EACf,kBAAkB;EAClB;EACA,WAAW;;;;;;;;;KAUD;EAEN;EACA;EACA;EACA;EACA,QAAQ;EACR;EACA;;EAEA;EAAe;EAAiB;EAAY,YAAY;EAAY,UAAU;;EAC9E;EAAe;EAAmB;EAAY,QAAQ;;EACtD;EAAe;EAAgB;EAAiB;EAAa;;;UAGlD;;EAEf;EACA;;;UAIe;EACf;EACA;EACA,cAAc;EACd;EACA;EACA;EACA;EACA;;;UAIe;;EAEf;EACA;;;;;;;;;;UAWe;GACd;EACD,QAAQ;;EAER,cAAc;;EAEd,SAAS;;EAET;EACA;;;UAIe;EACf,QAAQ;EACR,QAAQ;EACR,OAAO;EACP;EACA;EACA;EACA,SAAS;EACT,aAAa;;;;;;;;;iBAUC,mBAAmB;EAAQ;IAAe"}
|