@caupulican/pi-adaptative 0.95.0 → 0.96.0
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/CHANGELOG.md +19 -0
- package/dist/bundled-resources/extensions/tmux-agent-manager/index.d.ts.map +1 -1
- package/dist/bundled-resources/extensions/tmux-agent-manager/index.js +28 -0
- package/dist/bundled-resources/extensions/tmux-agent-manager/index.js.map +1 -1
- package/dist/bundled-resources/extensions/tmux-agent-manager/index.ts +25 -0
- package/dist/bundled-resources/extensions/tps/index.d.ts +3 -0
- package/dist/bundled-resources/extensions/tps/index.d.ts.map +1 -0
- package/dist/bundled-resources/extensions/tps/index.js +44 -0
- package/dist/bundled-resources/extensions/tps/index.js.map +1 -0
- package/dist/bundled-resources/extensions/tps/index.ts +48 -0
- package/dist/core/agent-session-services.d.ts.map +1 -1
- package/dist/core/agent-session-services.js +12 -3
- package/dist/core/agent-session-services.js.map +1 -1
- package/dist/core/compaction-controller.d.ts +3 -0
- package/dist/core/compaction-controller.d.ts.map +1 -1
- package/dist/core/compaction-controller.js +12 -1
- package/dist/core/compaction-controller.js.map +1 -1
- package/dist/core/extension-import-authority.d.ts +3 -1
- package/dist/core/extension-import-authority.d.ts.map +1 -1
- package/dist/core/extension-import-authority.js +15 -0
- package/dist/core/extension-import-authority.js.map +1 -1
- package/dist/core/keybindings.d.ts +2 -2
- package/dist/core/keybindings.d.ts.map +1 -1
- package/dist/core/keybindings.js +2 -2
- package/dist/core/keybindings.js.map +1 -1
- package/dist/core/profile-filter-controller.d.ts.map +1 -1
- package/dist/core/profile-filter-controller.js +5 -2
- package/dist/core/profile-filter-controller.js.map +1 -1
- package/dist/core/provider-prompt-contracts.d.ts +5 -1
- package/dist/core/provider-prompt-contracts.d.ts.map +1 -1
- package/dist/core/provider-prompt-contracts.js +5 -1
- package/dist/core/provider-prompt-contracts.js.map +1 -1
- package/dist/core/resource-loader.d.ts.map +1 -1
- package/dist/core/resource-loader.js +6 -2
- package/dist/core/resource-loader.js.map +1 -1
- package/dist/core/risk-classifier.d.ts.map +1 -1
- package/dist/core/risk-classifier.js +22 -2
- package/dist/core/risk-classifier.js.map +1 -1
- package/dist/core/settings-manager.d.ts +7 -0
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +22 -0
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/system-prompt-builder.d.ts +1 -0
- package/dist/core/system-prompt-builder.d.ts.map +1 -1
- package/dist/core/system-prompt-builder.js +21 -1
- package/dist/core/system-prompt-builder.js.map +1 -1
- package/dist/core/system-prompt.d.ts.map +1 -1
- package/dist/core/system-prompt.js +5 -1
- package/dist/core/system-prompt.js.map +1 -1
- package/dist/core/tools/goal.d.ts.map +1 -1
- package/dist/core/tools/goal.js +6 -16
- package/dist/core/tools/goal.js.map +1 -1
- package/dist/core/tools/orchestration-panel.d.ts +7 -0
- package/dist/core/tools/orchestration-panel.d.ts.map +1 -1
- package/dist/core/tools/orchestration-panel.js +58 -9
- package/dist/core/tools/orchestration-panel.js.map +1 -1
- package/dist/core/tools/task-steps.d.ts.map +1 -1
- package/dist/core/tools/task-steps.js +1 -0
- package/dist/core/tools/task-steps.js.map +1 -1
- package/dist/modes/interactive/components/agents-overlay.d.ts +16 -4
- package/dist/modes/interactive/components/agents-overlay.d.ts.map +1 -1
- package/dist/modes/interactive/components/agents-overlay.js +108 -29
- package/dist/modes/interactive/components/agents-overlay.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +5 -4
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/docs/extensions.md +2 -0
- package/docs/index.md +1 -0
- package/docs/keybindings.md +2 -0
- package/docs/task-steps.md +2 -0
- package/docs/tmux-agent-manager.md +1 -1
- package/docs/work-lifecycle.md +137 -0
- package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
- package/examples/extensions/custom-provider-anthropic/package.json +1 -1
- package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
- package/examples/extensions/sandbox/package-lock.json +2 -2
- package/examples/extensions/sandbox/package.json +1 -1
- package/examples/extensions/with-deps/package-lock.json +2 -2
- package/examples/extensions/with-deps/package.json +1 -1
- package/npm-shrinkwrap.json +12 -12
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"task-steps.js","sourceRoot":"","sources":["../../../src/core/tools/task-steps.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,IAAI,EAAE,MAAM,SAAS,CAAC;AAE5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EAAE,4BAA4B,EAAE,MAAM,uBAAuB,CAAC;AACrE,OAAO,EACN,WAAW,EACX,cAAc,EACd,gBAAgB,EAChB,oBAAoB,EACpB,qBAAqB,EACrB,eAAe,EACf,0BAA0B,EAC1B,oCAAoC,EACpC,cAAc,EACd,6BAA6B,EAC7B,uBAAuB,EACvB,YAAY,EAGZ,cAAc,EAGd,cAAc,GACd,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACN,sBAAsB,EACtB,2BAA2B,EAE3B,gBAAgB,GAChB,MAAM,0BAA0B,CAAC;AAElC,MAAM,YAAY,GAAG,IAAI,CAAC,KAAK,CAAC;IAC/B,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC;IACvB,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC;IAC3B,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC;IACzB,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC;IACvB,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC;CACzB,CAAC,CAAC;AAEH,MAAM,cAAc,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;AAE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a;wBAClC,iBAAiB,EAAE,eAAe;wBAClC,cAAc,EAAE,cAAc,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,SAAS;qBACvC;iBAChC,CAAC;YACH,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBAChB,OAAO,WAAW,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC,CAAC;YACnG,CAAC;QACF,CAAC;KACD,CAAC;AACH,CAAC","sourcesContent":["import { type Static, Type } from \"typebox\";\nimport type { ToolDefinition } from \"../extensions/types.ts\";\nimport { advanceTaskSteps } from \"../pipelines/increment.ts\";\nimport { MAX_PIPELINE_STAGE_ID_LENGTH } from \"../pipelines/types.ts\";\nimport {\n\taddTaskStep,\n\tclearTaskSteps,\n\tcompactTaskSteps,\n\tcreateTaskStepsState,\n\tfindOpenDuplicateStep,\n\tformatTaskSteps,\n\thasUnverifiedCompletedStep,\n\tMAX_TASK_STEP_PIPELINE_RUN_ID_LENGTH,\n\tMAX_TASK_STEPS,\n\tnormalizeTaskStepPipelineLink,\n\tresolveTaskStepSelector,\n\tsetTaskSteps,\n\ttype TaskStep,\n\ttype TaskStepInput,\n\tTaskStepsError,\n\ttype TaskStepsState,\n\ttype TaskStepUpdate,\n\tupdateTaskStep,\n} from \"../tasks/task-state.ts\";\nimport {\n\temptyOrchestrationCall,\n\tOrchestrationPanelComponent,\n\ttype OrchestrationPanelModel,\n\ttaskStepPanelRow,\n} from \"./orchestration-panel.ts\";\n\nconst statusSchema = Type.Union([\n\tType.Literal(\"pending\"),\n\tType.Literal(\"in_progress\"),\n\tType.Literal(\"completed\"),\n\tType.Literal(\"blocked\"),\n\tType.Literal(\"cancelled\"),\n]);\n\nconst prioritySchema = Type.Union([Type.Literal(\"low\"), Type.Literal(\"normal\"), Type.Literal(\"high\")]);\n\nfunction optionalTaskStepFields(requirementIdsDescription: string) {\n\treturn {\n\t\tstatus: Type.Optional(statusSchema),\n\t\tpriority: Type.Optional(prioritySchema),\n\t\towner: Type.Optional(Type.String({ maxLength: 200 })),\n\t\trequirementIds: Type.Optional(\n\t\t\tType.Array(Type.String({ minLength: 1, maxLength: 200 }), {\n\t\t\t\tmaxItems: 32,\n\t\t\t\tdescription: requirementIdsDescription,\n\t\t\t}),\n\t\t),\n\t\tpipelineRunId: Type.Optional(\n\t\t\tType.String({\n\t\t\t\tminLength: 1,\n\t\t\t\tmaxLength: MAX_TASK_STEP_PIPELINE_RUN_ID_LENGTH,\n\t\t\t\tdescription: \"Active pipeline run id this step advances. Supply together with pipelineStageId.\",\n\t\t\t}),\n\t\t),\n\t\tpipelineStageId: Type.Optional(\n\t\t\tType.String({\n\t\t\t\tminLength: 1,\n\t\t\t\tmaxLength: MAX_PIPELINE_STAGE_ID_LENGTH,\n\t\t\t\tdescription: \"Stage id in pipelineRunId this step advances. Supply both ids together.\",\n\t\t\t}),\n\t\t),\n\t\tclearPipelineLink: Type.Optional(\n\t\t\tType.Boolean({\n\t\t\t\tdescription: \"Remove both pipeline ids. Cannot be combined with pipelineRunId/pipelineStageId.\",\n\t\t\t}),\n\t\t),\n\t\tnote: Type.Optional(Type.String({ maxLength: 4_000 })),\n\t\tevidence: Type.Optional(Type.Array(Type.String({ minLength: 1, maxLength: 2_000 }), { maxItems: 32 })),\n\t};\n}\n\nconst stepInputSchema = Type.Object(\n\t{\n\t\tcontent: Type.String({ minLength: 1, maxLength: 2_000, description: \"Imperative task step text.\" }),\n\t\tactiveForm: Type.Optional(\n\t\t\tType.String({ minLength: 1, maxLength: 2_000, description: \"Short present-progress label for active UI.\" }),\n\t\t),\n\t\t...optionalTaskStepFields(\"Goal requirement ids this foreground step advances.\"),\n\t},\n\t{ additionalProperties: false },\n);\n\nconst taskStepsSchema = Type.Object(\n\t{\n\t\taction: Type.Union(\n\t\t\t[\n\t\t\t\tType.Literal(\"set\"),\n\t\t\t\tType.Literal(\"add\"),\n\t\t\t\tType.Literal(\"update\"),\n\t\t\t\tType.Literal(\"list\"),\n\t\t\t\tType.Literal(\"clear\"),\n\t\t\t\tType.Literal(\"compact\"),\n\t\t\t\tType.Literal(\"intake\"),\n\t\t\t\tType.Literal(\"advance\"),\n\t\t\t],\n\t\t\t{ description: \"Checklist action. Use list to read without mutation.\" },\n\t\t),\n\t\tsteps: Type.Optional(\n\t\t\tType.Array(stepInputSchema, {\n\t\t\t\tmaxItems: MAX_TASK_STEPS,\n\t\t\t\tdescription: \"Complete replacement list for set/intake. Intake preserves every supplied item in order.\",\n\t\t\t}),\n\t\t),\n\t\tid: Type.Optional(\n\t\t\tType.String({\n\t\t\t\tdescription: \"For update: current/active, exact step id, unique id prefix, or unique content selector.\",\n\t\t\t}),\n\t\t),\n\t\tcontent: Type.Optional(Type.String({ minLength: 1, maxLength: 2_000 })),\n\t\tactiveForm: Type.Optional(Type.String({ maxLength: 2_000 })),\n\t\t...optionalTaskStepFields(\"Goal requirement ids this foreground step advances; [] clears existing links.\"),\n\t\tclearCompleted: Type.Optional(\n\t\t\tType.Boolean({ description: \"For list: compact completed and cancelled steps before rendering.\" }),\n\t\t),\n\t\tshowCompleted: Type.Optional(Type.Boolean({ description: \"Include completed and cancelled steps in output.\" })),\n\t\tmaxItems: Type.Optional(Type.Integer({ minimum: 1, maximum: MAX_TASK_STEPS })),\n\t},\n\t{ additionalProperties: false },\n);\n\nexport type TaskStepsToolInput = Static<typeof taskStepsSchema>;\nexport type TaskStepsAction = TaskStepsToolInput[\"action\"];\n\nexport interface TaskStepsToolDetails {\n\taction: TaskStepsAction;\n\tapplied: boolean;\n\terror?: string;\n\tstate?: TaskStepsState;\n\tstepCount?: number;\n\topenStepCount?: number;\n\tverificationNudgeNeeded?: boolean;\n\tshowCompleted?: boolean;\n\t/** Set when `add` was a no-op because an open step already carries this content. */\n\tduplicateOfStepId?: string;\n\t/** Step ids silently demoted to pending because another step became active in this call. */\n\tdemotedStepIds?: readonly string[];\n}\n\nexport interface TaskStepsToolDependencies {\n\tgetTaskStepsState: () => TaskStepsState | undefined;\n\tsaveTaskStepsState: (state: TaskStepsState) => void;\n\tgetActivePipelineScope?: () => { runId: string; stageIds: readonly string[] } | undefined;\n\tnow?: () => string;\n}\n\nfunction toTaskStepUpdate(input: TaskStepsToolInput): TaskStepUpdate {\n\treturn {\n\t\tcontent: input.content,\n\t\tactiveForm: input.activeForm,\n\t\tstatus: input.status,\n\t\tpriority: input.priority,\n\t\towner: input.owner,\n\t\trequirementIds: input.requirementIds,\n\t\tpipelineRunId: input.pipelineRunId,\n\t\tpipelineStageId: input.pipelineStageId,\n\t\tclearPipelineLink: input.clearPipelineLink,\n\t\tnote: input.note,\n\t\tevidence: input.evidence,\n\t};\n}\n\nfunction toTaskStepInput(input: TaskStepsToolInput): TaskStepInput {\n\treturn { ...toTaskStepUpdate(input), content: input.content ?? \"\" };\n}\n\nfunction validatePipelineLink(\n\tdeps: TaskStepsToolDependencies,\n\tpipelineRunId: string | undefined,\n\tpipelineStageId: string | undefined,\n\tclearPipelineLink = false,\n): void {\n\tconst { pipelineRunId: runId, pipelineStageId: stageId } = normalizeTaskStepPipelineLink(\n\t\tpipelineRunId,\n\t\tpipelineStageId,\n\t\tclearPipelineLink,\n\t);\n\tif (!runId || !stageId) return;\n\tconst active = deps.getActivePipelineScope?.();\n\tif (!active) throw new TaskStepsError(\"Task step pipeline linkage requires an active pipeline run.\");\n\tif (runId !== active.runId) {\n\t\tthrow new TaskStepsError(`Task step pipelineRunId must match active run '${active.runId}'.`);\n\t}\n\tif (!active.stageIds.includes(stageId)) {\n\t\tthrow new TaskStepsError(`Task step pipelineStageId '${stageId}' is not in active run '${active.runId}'.`);\n\t}\n}\n\nfunction validatePipelineInputs(deps: TaskStepsToolDependencies, inputs: readonly TaskStepInput[]): void {\n\tfor (const input of inputs) {\n\t\tvalidatePipelineLink(deps, input.pipelineRunId, input.pipelineStageId, input.clearPipelineLink);\n\t}\n}\n\nfunction counts(\n\tstate: TaskStepsState,\n): Pick<TaskStepsToolDetails, \"stepCount\" | \"openStepCount\" | \"verificationNudgeNeeded\"> {\n\tconst openStepCount = state.steps.filter(\n\t\t(step) => step.status !== \"completed\" && step.status !== \"cancelled\",\n\t).length;\n\treturn {\n\t\tstepCount: state.steps.length,\n\t\topenStepCount,\n\t\tverificationNudgeNeeded: hasUnverifiedCompletedStep(state),\n\t};\n}\n\n/** Ids (from `resultSteps`, index-aligned with `inputs`) whose status was set explicitly by the caller. */\nfunction explicitStatusStepIds(inputs: readonly TaskStepInput[], resultSteps: readonly TaskStep[]): Set<string> {\n\tconst ids = new Set<string>();\n\tinputs.forEach((stepInput, index) => {\n\t\tif (stepInput.status !== undefined) {\n\t\t\tconst id = resultSteps[index]?.id;\n\t\t\tif (id) ids.add(id);\n\t\t}\n\t});\n\treturn ids;\n}\n\n/**\n * Steps that were in_progress before this call and are pending after, excluding any step whose\n * new status was set explicitly by the caller (an explicit change is not a \"silent\" demotion).\n */\nfunction computeDemotedStepIds(\n\tbefore: TaskStepsState,\n\tafter: TaskStepsState,\n\texcludeIds: ReadonlySet<string>,\n): string[] {\n\tconst beforeActiveIds = new Set(before.steps.filter((step) => step.status === \"in_progress\").map((step) => step.id));\n\treturn after.steps\n\t\t.filter((step) => beforeActiveIds.has(step.id) && step.status === \"pending\" && !excludeIds.has(step.id))\n\t\t.map((step) => step.id);\n}\n\nfunction errorResult(action: TaskStepsAction, error: string, state?: TaskStepsState) {\n\treturn {\n\t\tcontent: [{ type: \"text\" as const, text: `task_steps ${action} failed: ${error}` }],\n\t\tdetails: { action, applied: false, error, state, ...(state ? counts(state) : {}) } satisfies TaskStepsToolDetails,\n\t\tisError: true as const,\n\t};\n}\n\nfunction taskStepsPanelModel(details: TaskStepsToolDetails, expanded: boolean): OrchestrationPanelModel {\n\tconst state = details.state;\n\tif (!state) {\n\t\treturn {\n\t\t\tlabel: \"task steps\",\n\t\t\taction: details.action,\n\t\t\tstatus: details.error ? \"error\" : \"idle\",\n\t\t\temptyText: details.error ?? \"No checklist state.\",\n\t\t};\n\t}\n\tconst active = state.steps.filter((step) => step.status === \"in_progress\");\n\tconst blocked = state.steps.filter((step) => step.status === \"blocked\");\n\tconst pending = state.steps.filter((step) => step.status === \"pending\");\n\tconst completed = state.steps.filter((step) => step.status === \"completed\");\n\tconst cancelled = state.steps.filter((step) => step.status === \"cancelled\");\n\tconst open = [...active, ...blocked, ...pending];\n\tconst terminal = details.showCompleted ? [...completed, ...cancelled] : [];\n\tconst candidates = [...open, ...terminal];\n\tconst limit = expanded ? 24 : 8;\n\tconst rows = candidates.slice(0, limit).map(taskStepPanelRow);\n\tconst archivedDone = state.archive.completed + state.archive.cancelled;\n\tconst done = completed.length + state.archive.completed;\n\tconst summary = [\n\t\tactive.length ? `${active.length} working` : undefined,\n\t\t`${open.length} open`,\n\t\t`${done} done`,\n\t\tblocked.length ? `${blocked.length} blocked` : undefined,\n\t\tarchivedDone ? `${archivedDone} archived` : undefined,\n\t].filter((value): value is string => value !== undefined);\n\tconst notices = [];\n\tif (!details.showCompleted && completed.length + cancelled.length > 0) {\n\t\tnotices.push({\n\t\t\tstatus: \"info\" as const,\n\t\t\ttext: `${completed.length + cancelled.length} finished step${completed.length + cancelled.length === 1 ? \"\" : \"s\"} hidden`,\n\t\t});\n\t}\n\tif (details.duplicateOfStepId) {\n\t\tnotices.push({ status: \"info\" as const, text: \"Duplicate open step ignored.\" });\n\t}\n\tif (details.demotedStepIds?.length) {\n\t\tnotices.push({\n\t\t\tstatus: \"info\" as const,\n\t\t\ttext: `${details.demotedStepIds.length} previous working step${details.demotedStepIds.length === 1 ? \"\" : \"s\"} returned to pending.`,\n\t\t});\n\t}\n\tif (details.verificationNudgeNeeded) {\n\t\tnotices.push({ status: \"warning\" as const, text: \"Completed work still needs attached evidence.\" });\n\t}\n\tconst status = details.error\n\t\t? \"error\"\n\t\t: blocked.length > 0\n\t\t\t? \"warning\"\n\t\t\t: active.length > 0\n\t\t\t\t? \"running\"\n\t\t\t\t: open.length === 0 && state.steps.length > 0\n\t\t\t\t\t? \"success\"\n\t\t\t\t\t: \"idle\";\n\treturn {\n\t\tlabel: \"task steps\",\n\t\taction: details.action,\n\t\tstatus,\n\t\tsummary,\n\t\trows,\n\t\tnotices,\n\t\temptyText: state.steps.length === 0 ? \"No tracked steps.\" : \"All open steps are done.\",\n\t\thiddenRowCount: Math.max(0, candidates.length - rows.length),\n\t};\n}\n\nexport function createTaskStepsToolDefinition(deps: TaskStepsToolDependencies): ToolDefinition {\n\tconst now = deps.now ?? (() => new Date().toISOString());\n\treturn {\n\t\tname: \"task_steps\",\n\t\tlabel: \"Task Steps\",\n\t\tdescription:\n\t\t\t\"Track the session's ordered multi-step checklist with status, notes, and evidence. Use goal for durable outcomes and delegate for workers.\",\n\t\tpromptSnippet: \"Track multi-step session work.\",\n\t\tpromptGuidelines: [\n\t\t\t\"Use for multi-step work; keep one in_progress step.\",\n\t\t\t\"Batch transitions; work the first open step; record evidence/blockers; skip unchanged narration.\",\n\t\t\t\"intake keeps every item; link goal requirementIds.\",\n\t\t\t\"advance completes current, then starts next pending.\",\n\t\t\t\"Attach completed tool_task IDs as evidence; goal completion rejects every open step.\",\n\t\t\t\"Before final, resolve or defer open work. goal owns outcomes; delegate owns workers.\",\n\t\t],\n\t\tparameters: taskStepsSchema,\n\t\texecutionMode: \"sequential\",\n\t\trenderShell: \"self\",\n\t\trenderCall() {\n\t\t\treturn emptyOrchestrationCall();\n\t\t},\n\t\trenderResult(result, { expanded, isPartial }, theme) {\n\t\t\tif (isPartial) return emptyOrchestrationCall();\n\t\t\tconst details = result.details as TaskStepsToolDetails | undefined;\n\t\t\tif (!details) {\n\t\t\t\treturn new OrchestrationPanelComponent(theme, {\n\t\t\t\t\tlabel: \"task steps\",\n\t\t\t\t\tstatus: \"error\",\n\t\t\t\t\temptyText: \"No task-step details were returned.\",\n\t\t\t\t});\n\t\t\t}\n\t\t\tif (!expanded && details.applied) return emptyOrchestrationCall();\n\t\t\treturn new OrchestrationPanelComponent(theme, taskStepsPanelModel(details, expanded), expanded);\n\t\t},\n\t\tasync execute(_toolCallId, input: TaskStepsToolInput) {\n\t\t\tconst timestamp = now();\n\t\t\tconst current = deps.getTaskStepsState();\n\t\t\tconst before = current ?? createTaskStepsState(timestamp);\n\t\t\tlet state = before;\n\t\t\tlet duplicateStepId: string | undefined;\n\t\t\tlet demotedStepIds: readonly string[] = [];\n\t\t\ttry {\n\t\t\t\tswitch (input.action) {\n\t\t\t\t\tcase \"set\":\n\t\t\t\t\tcase \"intake\": {\n\t\t\t\t\t\tconst steps = input.steps;\n\t\t\t\t\t\tif (!steps) {\n\t\t\t\t\t\t\tconst error =\n\t\t\t\t\t\t\t\tinput.action === \"set\" ? \"set requires steps[].\" : \"intake requires a complete steps[] list.\";\n\t\t\t\t\t\t\treturn errorResult(input.action, error, current);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvalidatePipelineInputs(deps, steps);\n\t\t\t\t\t\tstate = setTaskSteps(state, steps, timestamp);\n\t\t\t\t\t\tdemotedStepIds = computeDemotedStepIds(before, state, explicitStatusStepIds(steps, state.steps));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tcase \"add\":\n\t\t\t\t\t\tvalidatePipelineLink(deps, input.pipelineRunId, input.pipelineStageId, input.clearPipelineLink);\n\t\t\t\t\t\tstate = addTaskStep(state, toTaskStepInput(input), timestamp);\n\t\t\t\t\t\tif (state === before) {\n\t\t\t\t\t\t\t// The reducer returned the unchanged state: an open step already carries this\n\t\t\t\t\t\t\t// content, so nothing was created. Name the existing step in the response.\n\t\t\t\t\t\t\tduplicateStepId = findOpenDuplicateStep(before.steps, input.content ?? \"\")?.id;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"update\": {\n\t\t\t\t\t\tif (!input.id?.trim())\n\t\t\t\t\t\t\treturn errorResult(input.action, \"update requires id or a unique selector.\", current);\n\t\t\t\t\t\tconst selected = resolveTaskStepSelector(before.steps, input.id);\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tinput.pipelineRunId !== undefined ||\n\t\t\t\t\t\t\tinput.pipelineStageId !== undefined ||\n\t\t\t\t\t\t\tinput.clearPipelineLink === true\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tconst clearingPipelineLink = input.clearPipelineLink === true;\n\t\t\t\t\t\t\tvalidatePipelineLink(\n\t\t\t\t\t\t\t\tdeps,\n\t\t\t\t\t\t\t\tclearingPipelineLink ? input.pipelineRunId : (input.pipelineRunId ?? selected.pipelineRunId),\n\t\t\t\t\t\t\t\tclearingPipelineLink\n\t\t\t\t\t\t\t\t\t? input.pipelineStageId\n\t\t\t\t\t\t\t\t\t: (input.pipelineStageId ?? selected.pipelineStageId),\n\t\t\t\t\t\t\t\tclearingPipelineLink,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tstate = updateTaskStep(state, input.id, toTaskStepUpdate(input), timestamp);\n\t\t\t\t\t\t// Exclude the explicitly targeted step: its own status change was requested by\n\t\t\t\t\t\t// the caller, so it is never a \"silent\" demotion even if it moved to pending.\n\t\t\t\t\t\tdemotedStepIds = computeDemotedStepIds(before, state, new Set([selected.id]));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tcase \"clear\":\n\t\t\t\t\t\tstate = clearTaskSteps(state, timestamp);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"compact\":\n\t\t\t\t\t\tstate = compactTaskSteps(state, timestamp);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"advance\": {\n\t\t\t\t\t\tconst advanced = advanceTaskSteps(before, timestamp);\n\t\t\t\t\t\tstate = advanced.state;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tcase \"list\":\n\t\t\t\t\t\tif (input.clearCompleted) state = compactTaskSteps(state, timestamp);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tconst isNoopDuplicateAdd = input.action === \"add\" && state === before;\n\t\t\t\tconst mutated = (input.action !== \"list\" || input.clearCompleted === true) && !isNoopDuplicateAdd;\n\t\t\t\tif (mutated) deps.saveTaskStepsState(state);\n\n\t\t\t\tconst stateCounts = counts(state);\n\t\t\t\tconst noticeLines: string[] = [];\n\t\t\t\tif (duplicateStepId) {\n\t\t\t\t\tnoticeLines.push(\n\t\t\t\t\t\t`Duplicate open step ignored; existing ${duplicateStepId} already tracks this content.`,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tif (demotedStepIds.length > 0) {\n\t\t\t\t\tnoticeLines.push(`Demoted to pending because another step became active: ${demotedStepIds.join(\", \")}.`);\n\t\t\t\t}\n\t\t\t\tif (stateCounts.verificationNudgeNeeded) {\n\t\t\t\t\tnoticeLines.push(\n\t\t\t\t\t\t\"Reminder: a completed step has no evidence attached; attach evidence via update before treating it as verified.\",\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tconst notices = noticeLines.length > 0 ? `\\n${noticeLines.join(\"\\n\")}` : \"\";\n\n\t\t\t\tconst headerAction =\n\t\t\t\t\tinput.action === \"list\"\n\t\t\t\t\t\t? \"\"\n\t\t\t\t\t\t: `task_steps ${input.action} ${duplicateStepId ? \"ignored (duplicate)\" : \"recorded\"}.\\n`;\n\t\t\t\treturn {\n\t\t\t\t\tcontent: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttype: \"text\" as const,\n\t\t\t\t\t\t\ttext: `${headerAction}${formatTaskSteps(state, {\n\t\t\t\t\t\t\t\tincludeTerminal: input.showCompleted,\n\t\t\t\t\t\t\t\tmaxItems: input.maxItems,\n\t\t\t\t\t\t\t})}${notices}`,\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t\tdetails: {\n\t\t\t\t\t\taction: input.action,\n\t\t\t\t\t\tapplied: true,\n\t\t\t\t\t\tstate,\n\t\t\t\t\t\t...stateCounts,\n\t\t\t\t\t\tshowCompleted: input.showCompleted,\n\t\t\t\t\t\tduplicateOfStepId: duplicateStepId,\n\t\t\t\t\t\tdemotedStepIds: demotedStepIds.length > 0 ? demotedStepIds : undefined,\n\t\t\t\t\t} satisfies TaskStepsToolDetails,\n\t\t\t\t};\n\t\t\t} catch (error) {\n\t\t\t\treturn errorResult(input.action, error instanceof Error ? error.message : String(error), current);\n\t\t\t}\n\t\t},\n\t};\n}\n"]}
|
|
1
|
+
{"version":3,"file":"task-steps.js","sourceRoot":"","sources":["../../../src/core/tools/task-steps.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,IAAI,EAAE,MAAM,SAAS,CAAC;AAE5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EAAE,4BAA4B,EAAE,MAAM,uBAAuB,CAAC;AACrE,OAAO,EACN,WAAW,EACX,cAAc,EACd,gBAAgB,EAChB,oBAAoB,EACpB,qBAAqB,EACrB,eAAe,EACf,0BAA0B,EAC1B,oCAAoC,EACpC,cAAc,EACd,6BAA6B,EAC7B,uBAAuB,EACvB,YAAY,EAGZ,cAAc,EAGd,cAAc,GACd,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACN,sBAAsB,EACtB,2BAA2B,EAE3B,gBAAgB,GAChB,MAAM,0BAA0B,CAAC;AAElC,MAAM,YAAY,GAAG,IAAI,CAAC,KAAK,CAAC;IAC/B,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC;IACvB,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC;IAC3B,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC;IACzB,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC;IACvB,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC;CACzB,CAAC,CAAC;AAEH,MAAM,cAAc,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,Q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;wBACpB,OAAO,EAAE,IAAI;wBACb,KAAK;wBACL,GAAG,WAAW;wBACd,aAAa,EAAE,KAAK,CAAC,aAAa;wBAClC,iBAAiB,EAAE,eAAe;wBAClC,cAAc,EAAE,cAAc,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,SAAS;qBACvC;iBAChC,CAAC;YACH,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBAChB,OAAO,WAAW,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC,CAAC;YACnG,CAAC;QACF,CAAC;KACD,CAAC;AACH,CAAC","sourcesContent":["import { type Static, Type } from \"typebox\";\nimport type { ToolDefinition } from \"../extensions/types.ts\";\nimport { advanceTaskSteps } from \"../pipelines/increment.ts\";\nimport { MAX_PIPELINE_STAGE_ID_LENGTH } from \"../pipelines/types.ts\";\nimport {\n\taddTaskStep,\n\tclearTaskSteps,\n\tcompactTaskSteps,\n\tcreateTaskStepsState,\n\tfindOpenDuplicateStep,\n\tformatTaskSteps,\n\thasUnverifiedCompletedStep,\n\tMAX_TASK_STEP_PIPELINE_RUN_ID_LENGTH,\n\tMAX_TASK_STEPS,\n\tnormalizeTaskStepPipelineLink,\n\tresolveTaskStepSelector,\n\tsetTaskSteps,\n\ttype TaskStep,\n\ttype TaskStepInput,\n\tTaskStepsError,\n\ttype TaskStepsState,\n\ttype TaskStepUpdate,\n\tupdateTaskStep,\n} from \"../tasks/task-state.ts\";\nimport {\n\temptyOrchestrationCall,\n\tOrchestrationPanelComponent,\n\ttype OrchestrationPanelModel,\n\ttaskStepPanelRow,\n} from \"./orchestration-panel.ts\";\n\nconst statusSchema = Type.Union([\n\tType.Literal(\"pending\"),\n\tType.Literal(\"in_progress\"),\n\tType.Literal(\"completed\"),\n\tType.Literal(\"blocked\"),\n\tType.Literal(\"cancelled\"),\n]);\n\nconst prioritySchema = Type.Union([Type.Literal(\"low\"), Type.Literal(\"normal\"), Type.Literal(\"high\")]);\n\nfunction optionalTaskStepFields(requirementIdsDescription: string) {\n\treturn {\n\t\tstatus: Type.Optional(statusSchema),\n\t\tpriority: Type.Optional(prioritySchema),\n\t\towner: Type.Optional(Type.String({ maxLength: 200 })),\n\t\trequirementIds: Type.Optional(\n\t\t\tType.Array(Type.String({ minLength: 1, maxLength: 200 }), {\n\t\t\t\tmaxItems: 32,\n\t\t\t\tdescription: requirementIdsDescription,\n\t\t\t}),\n\t\t),\n\t\tpipelineRunId: Type.Optional(\n\t\t\tType.String({\n\t\t\t\tminLength: 1,\n\t\t\t\tmaxLength: MAX_TASK_STEP_PIPELINE_RUN_ID_LENGTH,\n\t\t\t\tdescription: \"Active pipeline run id this step advances. Supply together with pipelineStageId.\",\n\t\t\t}),\n\t\t),\n\t\tpipelineStageId: Type.Optional(\n\t\t\tType.String({\n\t\t\t\tminLength: 1,\n\t\t\t\tmaxLength: MAX_PIPELINE_STAGE_ID_LENGTH,\n\t\t\t\tdescription: \"Stage id in pipelineRunId this step advances. Supply both ids together.\",\n\t\t\t}),\n\t\t),\n\t\tclearPipelineLink: Type.Optional(\n\t\t\tType.Boolean({\n\t\t\t\tdescription: \"Remove both pipeline ids. Cannot be combined with pipelineRunId/pipelineStageId.\",\n\t\t\t}),\n\t\t),\n\t\tnote: Type.Optional(Type.String({ maxLength: 4_000 })),\n\t\tevidence: Type.Optional(Type.Array(Type.String({ minLength: 1, maxLength: 2_000 }), { maxItems: 32 })),\n\t};\n}\n\nconst stepInputSchema = Type.Object(\n\t{\n\t\tcontent: Type.String({ minLength: 1, maxLength: 2_000, description: \"Imperative task step text.\" }),\n\t\tactiveForm: Type.Optional(\n\t\t\tType.String({ minLength: 1, maxLength: 2_000, description: \"Short present-progress label for active UI.\" }),\n\t\t),\n\t\t...optionalTaskStepFields(\"Goal requirement ids this foreground step advances.\"),\n\t},\n\t{ additionalProperties: false },\n);\n\nconst taskStepsSchema = Type.Object(\n\t{\n\t\taction: Type.Union(\n\t\t\t[\n\t\t\t\tType.Literal(\"set\"),\n\t\t\t\tType.Literal(\"add\"),\n\t\t\t\tType.Literal(\"update\"),\n\t\t\t\tType.Literal(\"list\"),\n\t\t\t\tType.Literal(\"clear\"),\n\t\t\t\tType.Literal(\"compact\"),\n\t\t\t\tType.Literal(\"intake\"),\n\t\t\t\tType.Literal(\"advance\"),\n\t\t\t],\n\t\t\t{ description: \"Checklist action. Use list to read without mutation.\" },\n\t\t),\n\t\tsteps: Type.Optional(\n\t\t\tType.Array(stepInputSchema, {\n\t\t\t\tmaxItems: MAX_TASK_STEPS,\n\t\t\t\tdescription: \"Complete replacement list for set/intake. Intake preserves every supplied item in order.\",\n\t\t\t}),\n\t\t),\n\t\tid: Type.Optional(\n\t\t\tType.String({\n\t\t\t\tdescription: \"For update: current/active, exact step id, unique id prefix, or unique content selector.\",\n\t\t\t}),\n\t\t),\n\t\tcontent: Type.Optional(Type.String({ minLength: 1, maxLength: 2_000 })),\n\t\tactiveForm: Type.Optional(Type.String({ maxLength: 2_000 })),\n\t\t...optionalTaskStepFields(\"Goal requirement ids this foreground step advances; [] clears existing links.\"),\n\t\tclearCompleted: Type.Optional(\n\t\t\tType.Boolean({ description: \"For list: compact completed and cancelled steps before rendering.\" }),\n\t\t),\n\t\tshowCompleted: Type.Optional(Type.Boolean({ description: \"Include completed and cancelled steps in output.\" })),\n\t\tmaxItems: Type.Optional(Type.Integer({ minimum: 1, maximum: MAX_TASK_STEPS })),\n\t},\n\t{ additionalProperties: false },\n);\n\nexport type TaskStepsToolInput = Static<typeof taskStepsSchema>;\nexport type TaskStepsAction = TaskStepsToolInput[\"action\"];\n\nexport interface TaskStepsToolDetails {\n\taction: TaskStepsAction;\n\tapplied: boolean;\n\terror?: string;\n\tstate?: TaskStepsState;\n\tstepCount?: number;\n\topenStepCount?: number;\n\tverificationNudgeNeeded?: boolean;\n\tshowCompleted?: boolean;\n\t/** Set when `add` was a no-op because an open step already carries this content. */\n\tduplicateOfStepId?: string;\n\t/** Step ids silently demoted to pending because another step became active in this call. */\n\tdemotedStepIds?: readonly string[];\n}\n\nexport interface TaskStepsToolDependencies {\n\tgetTaskStepsState: () => TaskStepsState | undefined;\n\tsaveTaskStepsState: (state: TaskStepsState) => void;\n\tgetActivePipelineScope?: () => { runId: string; stageIds: readonly string[] } | undefined;\n\tnow?: () => string;\n}\n\nfunction toTaskStepUpdate(input: TaskStepsToolInput): TaskStepUpdate {\n\treturn {\n\t\tcontent: input.content,\n\t\tactiveForm: input.activeForm,\n\t\tstatus: input.status,\n\t\tpriority: input.priority,\n\t\towner: input.owner,\n\t\trequirementIds: input.requirementIds,\n\t\tpipelineRunId: input.pipelineRunId,\n\t\tpipelineStageId: input.pipelineStageId,\n\t\tclearPipelineLink: input.clearPipelineLink,\n\t\tnote: input.note,\n\t\tevidence: input.evidence,\n\t};\n}\n\nfunction toTaskStepInput(input: TaskStepsToolInput): TaskStepInput {\n\treturn { ...toTaskStepUpdate(input), content: input.content ?? \"\" };\n}\n\nfunction validatePipelineLink(\n\tdeps: TaskStepsToolDependencies,\n\tpipelineRunId: string | undefined,\n\tpipelineStageId: string | undefined,\n\tclearPipelineLink = false,\n): void {\n\tconst { pipelineRunId: runId, pipelineStageId: stageId } = normalizeTaskStepPipelineLink(\n\t\tpipelineRunId,\n\t\tpipelineStageId,\n\t\tclearPipelineLink,\n\t);\n\tif (!runId || !stageId) return;\n\tconst active = deps.getActivePipelineScope?.();\n\tif (!active) throw new TaskStepsError(\"Task step pipeline linkage requires an active pipeline run.\");\n\tif (runId !== active.runId) {\n\t\tthrow new TaskStepsError(`Task step pipelineRunId must match active run '${active.runId}'.`);\n\t}\n\tif (!active.stageIds.includes(stageId)) {\n\t\tthrow new TaskStepsError(`Task step pipelineStageId '${stageId}' is not in active run '${active.runId}'.`);\n\t}\n}\n\nfunction validatePipelineInputs(deps: TaskStepsToolDependencies, inputs: readonly TaskStepInput[]): void {\n\tfor (const input of inputs) {\n\t\tvalidatePipelineLink(deps, input.pipelineRunId, input.pipelineStageId, input.clearPipelineLink);\n\t}\n}\n\nfunction counts(\n\tstate: TaskStepsState,\n): Pick<TaskStepsToolDetails, \"stepCount\" | \"openStepCount\" | \"verificationNudgeNeeded\"> {\n\tconst openStepCount = state.steps.filter(\n\t\t(step) => step.status !== \"completed\" && step.status !== \"cancelled\",\n\t).length;\n\treturn {\n\t\tstepCount: state.steps.length,\n\t\topenStepCount,\n\t\tverificationNudgeNeeded: hasUnverifiedCompletedStep(state),\n\t};\n}\n\n/** Ids (from `resultSteps`, index-aligned with `inputs`) whose status was set explicitly by the caller. */\nfunction explicitStatusStepIds(inputs: readonly TaskStepInput[], resultSteps: readonly TaskStep[]): Set<string> {\n\tconst ids = new Set<string>();\n\tinputs.forEach((stepInput, index) => {\n\t\tif (stepInput.status !== undefined) {\n\t\t\tconst id = resultSteps[index]?.id;\n\t\t\tif (id) ids.add(id);\n\t\t}\n\t});\n\treturn ids;\n}\n\n/**\n * Steps that were in_progress before this call and are pending after, excluding any step whose\n * new status was set explicitly by the caller (an explicit change is not a \"silent\" demotion).\n */\nfunction computeDemotedStepIds(\n\tbefore: TaskStepsState,\n\tafter: TaskStepsState,\n\texcludeIds: ReadonlySet<string>,\n): string[] {\n\tconst beforeActiveIds = new Set(before.steps.filter((step) => step.status === \"in_progress\").map((step) => step.id));\n\treturn after.steps\n\t\t.filter((step) => beforeActiveIds.has(step.id) && step.status === \"pending\" && !excludeIds.has(step.id))\n\t\t.map((step) => step.id);\n}\n\nfunction errorResult(action: TaskStepsAction, error: string, state?: TaskStepsState) {\n\treturn {\n\t\tcontent: [{ type: \"text\" as const, text: `task_steps ${action} failed: ${error}` }],\n\t\tdetails: { action, applied: false, error, state, ...(state ? counts(state) : {}) } satisfies TaskStepsToolDetails,\n\t\tisError: true as const,\n\t};\n}\n\nfunction taskStepsPanelModel(details: TaskStepsToolDetails, expanded: boolean): OrchestrationPanelModel {\n\tconst state = details.state;\n\tif (!state) {\n\t\treturn {\n\t\t\tlabel: \"task steps\",\n\t\t\taction: details.action,\n\t\t\tstatus: details.error ? \"error\" : \"idle\",\n\t\t\temptyText: details.error ?? \"No checklist state.\",\n\t\t};\n\t}\n\tconst active = state.steps.filter((step) => step.status === \"in_progress\");\n\tconst blocked = state.steps.filter((step) => step.status === \"blocked\");\n\tconst pending = state.steps.filter((step) => step.status === \"pending\");\n\tconst completed = state.steps.filter((step) => step.status === \"completed\");\n\tconst cancelled = state.steps.filter((step) => step.status === \"cancelled\");\n\tconst open = [...active, ...blocked, ...pending];\n\tconst terminal = details.showCompleted ? [...completed, ...cancelled] : [];\n\tconst candidates = [...open, ...terminal];\n\tconst limit = expanded ? 24 : 8;\n\tconst rows = candidates.slice(0, limit).map(taskStepPanelRow);\n\tconst archivedDone = state.archive.completed + state.archive.cancelled;\n\tconst done = completed.length + state.archive.completed;\n\tconst summary = [\n\t\tactive.length ? `${active.length} working` : undefined,\n\t\t`${open.length} open`,\n\t\t`${done} done`,\n\t\tblocked.length ? `${blocked.length} blocked` : undefined,\n\t\tarchivedDone ? `${archivedDone} archived` : undefined,\n\t].filter((value): value is string => value !== undefined);\n\tconst notices = [];\n\tif (!details.showCompleted && completed.length + cancelled.length > 0) {\n\t\tnotices.push({\n\t\t\tstatus: \"info\" as const,\n\t\t\ttext: `${completed.length + cancelled.length} finished step${completed.length + cancelled.length === 1 ? \"\" : \"s\"} hidden`,\n\t\t});\n\t}\n\tif (details.duplicateOfStepId) {\n\t\tnotices.push({ status: \"info\" as const, text: \"Duplicate open step ignored.\" });\n\t}\n\tif (details.demotedStepIds?.length) {\n\t\tnotices.push({\n\t\t\tstatus: \"info\" as const,\n\t\t\ttext: `${details.demotedStepIds.length} previous working step${details.demotedStepIds.length === 1 ? \"\" : \"s\"} returned to pending.`,\n\t\t});\n\t}\n\tif (details.verificationNudgeNeeded) {\n\t\tnotices.push({ status: \"warning\" as const, text: \"Completed work still needs attached evidence.\" });\n\t}\n\tconst status = details.error\n\t\t? \"error\"\n\t\t: blocked.length > 0\n\t\t\t? \"warning\"\n\t\t\t: active.length > 0\n\t\t\t\t? \"running\"\n\t\t\t\t: open.length === 0 && state.steps.length > 0\n\t\t\t\t\t? \"success\"\n\t\t\t\t\t: \"idle\";\n\treturn {\n\t\tlabel: \"task steps\",\n\t\taction: details.action,\n\t\tstatus,\n\t\tsummary,\n\t\trows,\n\t\tnotices,\n\t\temptyText: state.steps.length === 0 ? \"No tracked steps.\" : \"All open steps are done.\",\n\t\thiddenRowCount: Math.max(0, candidates.length - rows.length),\n\t};\n}\n\nexport function createTaskStepsToolDefinition(deps: TaskStepsToolDependencies): ToolDefinition {\n\tconst now = deps.now ?? (() => new Date().toISOString());\n\treturn {\n\t\tname: \"task_steps\",\n\t\tlabel: \"Task Steps\",\n\t\tdescription:\n\t\t\t\"Track the session's ordered multi-step checklist with status, notes, and evidence. Use goal for durable outcomes and delegate for workers.\",\n\t\tpromptSnippet: \"Track multi-step session work.\",\n\t\tpromptGuidelines: [\n\t\t\t\"Use for multi-step work; keep one in_progress step.\",\n\t\t\t\"For project changes, establish Plan/Route before first mutation and link steps to the goal contract; task_steps owns execution detail, never a second outcome state.\",\n\t\t\t\"Batch transitions; work the first open step; record evidence/blockers; skip unchanged narration.\",\n\t\t\t\"intake keeps every item; link goal requirementIds.\",\n\t\t\t\"advance completes current, then starts next pending.\",\n\t\t\t\"Attach completed tool_task IDs as evidence; goal completion rejects every open step.\",\n\t\t\t\"Before final, resolve or defer open work. goal owns outcomes; delegate owns workers.\",\n\t\t],\n\t\tparameters: taskStepsSchema,\n\t\texecutionMode: \"sequential\",\n\t\trenderShell: \"self\",\n\t\trenderCall() {\n\t\t\treturn emptyOrchestrationCall();\n\t\t},\n\t\trenderResult(result, { expanded, isPartial }, theme) {\n\t\t\tif (isPartial) return emptyOrchestrationCall();\n\t\t\tconst details = result.details as TaskStepsToolDetails | undefined;\n\t\t\tif (!details) {\n\t\t\t\treturn new OrchestrationPanelComponent(theme, {\n\t\t\t\t\tlabel: \"task steps\",\n\t\t\t\t\tstatus: \"error\",\n\t\t\t\t\temptyText: \"No task-step details were returned.\",\n\t\t\t\t});\n\t\t\t}\n\t\t\tif (!expanded && details.applied) return emptyOrchestrationCall();\n\t\t\treturn new OrchestrationPanelComponent(theme, taskStepsPanelModel(details, expanded), expanded);\n\t\t},\n\t\tasync execute(_toolCallId, input: TaskStepsToolInput) {\n\t\t\tconst timestamp = now();\n\t\t\tconst current = deps.getTaskStepsState();\n\t\t\tconst before = current ?? createTaskStepsState(timestamp);\n\t\t\tlet state = before;\n\t\t\tlet duplicateStepId: string | undefined;\n\t\t\tlet demotedStepIds: readonly string[] = [];\n\t\t\ttry {\n\t\t\t\tswitch (input.action) {\n\t\t\t\t\tcase \"set\":\n\t\t\t\t\tcase \"intake\": {\n\t\t\t\t\t\tconst steps = input.steps;\n\t\t\t\t\t\tif (!steps) {\n\t\t\t\t\t\t\tconst error =\n\t\t\t\t\t\t\t\tinput.action === \"set\" ? \"set requires steps[].\" : \"intake requires a complete steps[] list.\";\n\t\t\t\t\t\t\treturn errorResult(input.action, error, current);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvalidatePipelineInputs(deps, steps);\n\t\t\t\t\t\tstate = setTaskSteps(state, steps, timestamp);\n\t\t\t\t\t\tdemotedStepIds = computeDemotedStepIds(before, state, explicitStatusStepIds(steps, state.steps));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tcase \"add\":\n\t\t\t\t\t\tvalidatePipelineLink(deps, input.pipelineRunId, input.pipelineStageId, input.clearPipelineLink);\n\t\t\t\t\t\tstate = addTaskStep(state, toTaskStepInput(input), timestamp);\n\t\t\t\t\t\tif (state === before) {\n\t\t\t\t\t\t\t// The reducer returned the unchanged state: an open step already carries this\n\t\t\t\t\t\t\t// content, so nothing was created. Name the existing step in the response.\n\t\t\t\t\t\t\tduplicateStepId = findOpenDuplicateStep(before.steps, input.content ?? \"\")?.id;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"update\": {\n\t\t\t\t\t\tif (!input.id?.trim())\n\t\t\t\t\t\t\treturn errorResult(input.action, \"update requires id or a unique selector.\", current);\n\t\t\t\t\t\tconst selected = resolveTaskStepSelector(before.steps, input.id);\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tinput.pipelineRunId !== undefined ||\n\t\t\t\t\t\t\tinput.pipelineStageId !== undefined ||\n\t\t\t\t\t\t\tinput.clearPipelineLink === true\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tconst clearingPipelineLink = input.clearPipelineLink === true;\n\t\t\t\t\t\t\tvalidatePipelineLink(\n\t\t\t\t\t\t\t\tdeps,\n\t\t\t\t\t\t\t\tclearingPipelineLink ? input.pipelineRunId : (input.pipelineRunId ?? selected.pipelineRunId),\n\t\t\t\t\t\t\t\tclearingPipelineLink\n\t\t\t\t\t\t\t\t\t? input.pipelineStageId\n\t\t\t\t\t\t\t\t\t: (input.pipelineStageId ?? selected.pipelineStageId),\n\t\t\t\t\t\t\t\tclearingPipelineLink,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tstate = updateTaskStep(state, input.id, toTaskStepUpdate(input), timestamp);\n\t\t\t\t\t\t// Exclude the explicitly targeted step: its own status change was requested by\n\t\t\t\t\t\t// the caller, so it is never a \"silent\" demotion even if it moved to pending.\n\t\t\t\t\t\tdemotedStepIds = computeDemotedStepIds(before, state, new Set([selected.id]));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tcase \"clear\":\n\t\t\t\t\t\tstate = clearTaskSteps(state, timestamp);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"compact\":\n\t\t\t\t\t\tstate = compactTaskSteps(state, timestamp);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"advance\": {\n\t\t\t\t\t\tconst advanced = advanceTaskSteps(before, timestamp);\n\t\t\t\t\t\tstate = advanced.state;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tcase \"list\":\n\t\t\t\t\t\tif (input.clearCompleted) state = compactTaskSteps(state, timestamp);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tconst isNoopDuplicateAdd = input.action === \"add\" && state === before;\n\t\t\t\tconst mutated = (input.action !== \"list\" || input.clearCompleted === true) && !isNoopDuplicateAdd;\n\t\t\t\tif (mutated) deps.saveTaskStepsState(state);\n\n\t\t\t\tconst stateCounts = counts(state);\n\t\t\t\tconst noticeLines: string[] = [];\n\t\t\t\tif (duplicateStepId) {\n\t\t\t\t\tnoticeLines.push(\n\t\t\t\t\t\t`Duplicate open step ignored; existing ${duplicateStepId} already tracks this content.`,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tif (demotedStepIds.length > 0) {\n\t\t\t\t\tnoticeLines.push(`Demoted to pending because another step became active: ${demotedStepIds.join(\", \")}.`);\n\t\t\t\t}\n\t\t\t\tif (stateCounts.verificationNudgeNeeded) {\n\t\t\t\t\tnoticeLines.push(\n\t\t\t\t\t\t\"Reminder: a completed step has no evidence attached; attach evidence via update before treating it as verified.\",\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tconst notices = noticeLines.length > 0 ? `\\n${noticeLines.join(\"\\n\")}` : \"\";\n\n\t\t\t\tconst headerAction =\n\t\t\t\t\tinput.action === \"list\"\n\t\t\t\t\t\t? \"\"\n\t\t\t\t\t\t: `task_steps ${input.action} ${duplicateStepId ? \"ignored (duplicate)\" : \"recorded\"}.\\n`;\n\t\t\t\treturn {\n\t\t\t\t\tcontent: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttype: \"text\" as const,\n\t\t\t\t\t\t\ttext: `${headerAction}${formatTaskSteps(state, {\n\t\t\t\t\t\t\t\tincludeTerminal: input.showCompleted,\n\t\t\t\t\t\t\t\tmaxItems: input.maxItems,\n\t\t\t\t\t\t\t})}${notices}`,\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t\tdetails: {\n\t\t\t\t\t\taction: input.action,\n\t\t\t\t\t\tapplied: true,\n\t\t\t\t\t\tstate,\n\t\t\t\t\t\t...stateCounts,\n\t\t\t\t\t\tshowCompleted: input.showCompleted,\n\t\t\t\t\t\tduplicateOfStepId: duplicateStepId,\n\t\t\t\t\t\tdemotedStepIds: demotedStepIds.length > 0 ? demotedStepIds : undefined,\n\t\t\t\t\t} satisfies TaskStepsToolDetails,\n\t\t\t\t};\n\t\t\t} catch (error) {\n\t\t\t\treturn errorResult(input.action, error instanceof Error ? error.message : String(error), current);\n\t\t\t}\n\t\t},\n\t};\n}\n"]}
|
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
import { type Component } from "@caupulican/pi-tui";
|
|
2
2
|
import type { LaneRecord } from "../../../core/autonomy/lane-tracker.ts";
|
|
3
|
+
import type { GoalState } from "../../../core/goals/goal-state.ts";
|
|
3
4
|
import type { KeybindingsManager } from "../../../core/keybindings.ts";
|
|
5
|
+
import type { TaskStepsState } from "../../../core/tasks/task-state.ts";
|
|
4
6
|
import { type OrchestrationPanelModel } from "../../../core/tools/orchestration-panel.ts";
|
|
5
7
|
import { type ActivityLaneItem } from "./activity-lane.ts";
|
|
6
8
|
/**
|
|
7
|
-
* On-demand
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* that opens it closes it, so it behaves as a peek.
|
|
9
|
+
* On-demand work inspector behind the compact activity lane. One canonical snapshot
|
|
10
|
+
* exposes goal, requirements, plan, workers, and background tools without duplicating
|
|
11
|
+
* lifecycle state. The viewport is scrollable; the same key that opens it closes it.
|
|
11
12
|
*/
|
|
12
13
|
export interface AgentsOverlaySnapshot {
|
|
14
|
+
goalState?: GoalState;
|
|
15
|
+
taskState?: TaskStepsState;
|
|
13
16
|
laneRecords: readonly LaneRecord[];
|
|
14
17
|
items: readonly ActivityLaneItem[];
|
|
15
18
|
}
|
|
@@ -20,14 +23,21 @@ export interface AgentsOverlayOptions {
|
|
|
20
23
|
onClose: () => void;
|
|
21
24
|
/** Injectable clock for tests. */
|
|
22
25
|
now?: () => number;
|
|
26
|
+
/** Terminal row budget used by the scrollable inspector. */
|
|
27
|
+
viewportRows?: () => number;
|
|
23
28
|
}
|
|
24
29
|
export declare function formatElapsed(ms: number): string;
|
|
25
30
|
export declare function buildAgentsPanelModel(snapshot: AgentsOverlaySnapshot, nowMs: number): OrchestrationPanelModel;
|
|
31
|
+
/** Complete, bounded projection for the interactive work inspector. */
|
|
32
|
+
export declare function buildWorkPanelModel(snapshot: AgentsOverlaySnapshot, nowMs: number): OrchestrationPanelModel;
|
|
26
33
|
export declare class AgentsOverlay implements Component {
|
|
27
34
|
private readonly options;
|
|
28
35
|
private mounted;
|
|
29
36
|
private elapsedRedrawEnabled;
|
|
30
37
|
private elapsedRedrawTimer;
|
|
38
|
+
private scrollTop;
|
|
39
|
+
private lastPageRows;
|
|
40
|
+
private lastMaxScroll;
|
|
31
41
|
constructor(options: AgentsOverlayOptions);
|
|
32
42
|
mount(): void;
|
|
33
43
|
private scheduleElapsedRedraw;
|
|
@@ -35,6 +45,8 @@ export declare class AgentsOverlay implements Component {
|
|
|
35
45
|
handleInput(data: string): void;
|
|
36
46
|
render(width: number): string[];
|
|
37
47
|
invalidate(): void;
|
|
48
|
+
private scrollBy;
|
|
49
|
+
private scrollTo;
|
|
38
50
|
dispose(): void;
|
|
39
51
|
}
|
|
40
52
|
//# sourceMappingURL=agents-overlay.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agents-overlay.d.ts","sourceRoot":"","sources":["../../../../src/modes/interactive/components/agents-overlay.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAmB,MAAM,oBAAoB,CAAC;AACrE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wCAAwC,CAAC;AACzE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,
|
|
1
|
+
{"version":3,"file":"agents-overlay.d.ts","sourceRoot":"","sources":["../../../../src/modes/interactive/components/agents-overlay.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAmB,MAAM,oBAAoB,CAAC;AACrE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wCAAwC,CAAC;AACzE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mCAAmC,CAAC;AACnE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,EAGN,KAAK,uBAAuB,EAI5B,MAAM,4CAA4C,CAAC;AAEpD,OAAO,EAAE,KAAK,gBAAgB,EAAgC,MAAM,oBAAoB,CAAC;AAGzF;;;;GAIG;AAEH,MAAM,WAAW,qBAAqB;IACrC,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,SAAS,CAAC,EAAE,cAAc,CAAC;IAC3B,WAAW,EAAE,SAAS,UAAU,EAAE,CAAC;IACnC,KAAK,EAAE,SAAS,gBAAgB,EAAE,CAAC;CACnC;AAED,MAAM,WAAW,oBAAoB;IACpC,WAAW,EAAE,kBAAkB,CAAC;IAChC,QAAQ,EAAE,MAAM,qBAAqB,CAAC;IACtC,aAAa,EAAE,MAAM,IAAI,CAAC;IAC1B,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,kCAAkC;IAClC,GAAG,CAAC,EAAE,MAAM,MAAM,CAAC;IACnB,4DAA4D;IAC5D,YAAY,CAAC,EAAE,MAAM,MAAM,CAAC;CAC5B;AAMD,wBAAgB,aAAa,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAOhD;AAuFD,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,qBAAqB,EAAE,KAAK,EAAE,MAAM,GAAG,uBAAuB,CAW7G;AAED,uEAAuE;AACvE,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,qBAAqB,EAAE,KAAK,EAAE,MAAM,GAAG,uBAAuB,CAkC3G;AAED,qBAAa,aAAc,YAAW,SAAS;IAC9C,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAuB;IAC/C,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,oBAAoB,CAAS;IACrC,OAAO,CAAC,kBAAkB,CAA4C;IACtE,OAAO,CAAC,SAAS,CAAK;IACtB,OAAO,CAAC,YAAY,CAAK;IACzB,OAAO,CAAC,aAAa,CAAK;IAE1B,YAAY,OAAO,EAAE,oBAAoB,EAExC;IAED,KAAK,IAAI,IAAI,CAIZ;IAED,OAAO,CAAC,qBAAqB;IAW7B,OAAO,CAAC,uBAAuB;IAU/B,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAe9B;IAED,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CA2B9B;IAED,UAAU,IAAI,IAAI,CAAG;IAErB,OAAO,CAAC,QAAQ;IAIhB,OAAO,CAAC,QAAQ;IAKhB,OAAO,IAAI,IAAI,CAGd;CACD"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { truncateToWidth } from "@caupulican/pi-tui";
|
|
2
|
-
import { renderOrchestrationPanelLines, } from "../../../core/tools/orchestration-panel.js";
|
|
2
|
+
import { goalEvidencePanelRow, goalRequirementPanelRow, renderOrchestrationPanelLines, taskStepPanelRow, } from "../../../core/tools/orchestration-panel.js";
|
|
3
3
|
import { theme } from "../theme/theme.js";
|
|
4
4
|
import { isBackgroundToolActivityItem } from "./activity-lane.js";
|
|
5
5
|
import { formatKeyText } from "./keybinding-hints.js";
|
|
@@ -32,14 +32,26 @@ function workerRow(record, nowMs) {
|
|
|
32
32
|
const meta = [
|
|
33
33
|
record.type === "tmux-worker" ? "tmux" : "agent",
|
|
34
34
|
record.profileId,
|
|
35
|
+
record.modelRef,
|
|
36
|
+
record.thinkingLevel,
|
|
35
37
|
workerElapsed(record, nowMs),
|
|
36
38
|
record.costUsd !== undefined ? `$${record.costUsd.toFixed(2)}` : undefined,
|
|
37
39
|
].filter((value) => value !== undefined && value !== "");
|
|
40
|
+
const details = [
|
|
41
|
+
`lane: ${record.laneId}`,
|
|
42
|
+
record.goalId ? `goal: ${record.goalId}` : undefined,
|
|
43
|
+
record.reasonCode ? `reason: ${record.reasonCode}` : undefined,
|
|
44
|
+
record.worktreeLaneKey ? `worktree: ${record.worktreeLaneKey}` : undefined,
|
|
45
|
+
record.evidenceEntryId ? `evidence: ${record.evidenceEntryId}` : undefined,
|
|
46
|
+
record.startedAt ? `started: ${record.startedAt}` : undefined,
|
|
47
|
+
record.completedAt ? `completed: ${record.completedAt}` : undefined,
|
|
48
|
+
].filter((value) => value !== undefined);
|
|
38
49
|
return {
|
|
39
50
|
status: record.status,
|
|
40
51
|
label: record.label ?? record.laneId,
|
|
41
52
|
section: "Workers",
|
|
42
53
|
meta,
|
|
54
|
+
details,
|
|
43
55
|
};
|
|
44
56
|
}
|
|
45
57
|
function backgroundToolRow(item) {
|
|
@@ -51,42 +63,88 @@ function backgroundToolRow(item) {
|
|
|
51
63
|
};
|
|
52
64
|
}
|
|
53
65
|
const ACTIVE_WORKER_STATUSES = new Set(["queued", "running"]);
|
|
54
|
-
|
|
66
|
+
const ACTIVE_BACKGROUND_TOOL_STATUSES = new Set(["active", "waiting"]);
|
|
67
|
+
function projectWorkActivity(snapshot, nowMs) {
|
|
55
68
|
const workers = snapshot.laneRecords.filter((record) => record.type === "worker" || record.type === "tmux-worker");
|
|
56
69
|
const activeWorkers = workers.filter((record) => ACTIVE_WORKER_STATUSES.has(record.status));
|
|
57
70
|
const finishedWorkers = workers
|
|
58
71
|
.filter((record) => !ACTIVE_WORKER_STATUSES.has(record.status))
|
|
59
72
|
.sort((a, b) => (b.completedAt ?? "").localeCompare(a.completedAt ?? ""))
|
|
60
73
|
.slice(0, MAX_FINISHED_WORKERS);
|
|
61
|
-
const backgroundTools = snapshot.items.filter((item) => isBackgroundToolActivityItem(item) && (item.status
|
|
62
|
-
const rows = [
|
|
63
|
-
...activeWorkers.map((record) => workerRow(record, nowMs)),
|
|
64
|
-
...finishedWorkers.map((record) => workerRow(record, nowMs)),
|
|
65
|
-
...backgroundTools.map(backgroundToolRow),
|
|
66
|
-
];
|
|
67
|
-
const shown = rows.slice(0, MAX_ROWS);
|
|
74
|
+
const backgroundTools = snapshot.items.filter((item) => isBackgroundToolActivityItem(item) && ACTIVE_BACKGROUND_TOOL_STATUSES.has(item.status));
|
|
68
75
|
const running = activeWorkers.filter((record) => record.status === "running").length;
|
|
69
76
|
const queued = activeWorkers.length - running;
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
+
return {
|
|
78
|
+
workers,
|
|
79
|
+
activeWorkers,
|
|
80
|
+
rows: [
|
|
81
|
+
...activeWorkers.map((record) => workerRow(record, nowMs)),
|
|
82
|
+
...finishedWorkers.map((record) => workerRow(record, nowMs)),
|
|
83
|
+
...backgroundTools.map(backgroundToolRow),
|
|
84
|
+
],
|
|
85
|
+
summary: [
|
|
86
|
+
running > 0 ? `${running} running` : undefined,
|
|
87
|
+
queued > 0 ? `${queued} queued` : undefined,
|
|
88
|
+
backgroundTools.length > 0
|
|
89
|
+
? `${backgroundTools.length} background tool${backgroundTools.length === 1 ? "" : "s"}`
|
|
90
|
+
: undefined,
|
|
91
|
+
].filter((value) => value !== undefined),
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
export function buildAgentsPanelModel(snapshot, nowMs) {
|
|
95
|
+
const activity = projectWorkActivity(snapshot, nowMs);
|
|
96
|
+
const shown = activity.rows.slice(0, MAX_ROWS);
|
|
77
97
|
return {
|
|
78
98
|
label: "Agents",
|
|
79
|
-
status: workers.some((record) => record.status === "failed") ? "error" : "info",
|
|
80
|
-
summary,
|
|
99
|
+
status: activity.workers.some((record) => record.status === "failed") ? "error" : "info",
|
|
100
|
+
summary: activity.summary,
|
|
81
101
|
rows: shown,
|
|
82
|
-
hiddenRowCount: rows.length - shown.length,
|
|
102
|
+
hiddenRowCount: activity.rows.length - shown.length,
|
|
83
103
|
emptyText: "No agents or background work right now",
|
|
84
104
|
};
|
|
85
105
|
}
|
|
106
|
+
/** Complete, bounded projection for the interactive work inspector. */
|
|
107
|
+
export function buildWorkPanelModel(snapshot, nowMs) {
|
|
108
|
+
const goal = snapshot.goalState;
|
|
109
|
+
const task = snapshot.taskState;
|
|
110
|
+
const activity = projectWorkActivity(snapshot, nowMs);
|
|
111
|
+
const satisfied = goal?.requirements.filter((requirement) => requirement.status === "satisfied").length ?? 0;
|
|
112
|
+
const rows = [
|
|
113
|
+
...(goal?.requirements.map(goalRequirementPanelRow) ?? []),
|
|
114
|
+
...(goal?.evidence.map(goalEvidencePanelRow) ?? []),
|
|
115
|
+
...(task?.steps.map((step) => ({ ...taskStepPanelRow(step), section: "Plan" })) ?? []),
|
|
116
|
+
...activity.rows,
|
|
117
|
+
];
|
|
118
|
+
const summary = [
|
|
119
|
+
goal ? `goal ${goal.status.replace("_", " ")}` : undefined,
|
|
120
|
+
goal ? `${satisfied}/${goal.requirements.length} requirements` : undefined,
|
|
121
|
+
task ? `${task.steps.length + task.archive.completed + task.archive.cancelled} plan steps` : undefined,
|
|
122
|
+
...activity.summary,
|
|
123
|
+
].filter((value) => value !== undefined);
|
|
124
|
+
return {
|
|
125
|
+
label: "Work",
|
|
126
|
+
status: goal?.status === "blocked" ||
|
|
127
|
+
goal?.status === "paused" ||
|
|
128
|
+
activity.workers.some((record) => record.status === "failed")
|
|
129
|
+
? "warning"
|
|
130
|
+
: activity.activeWorkers.length > 0 || task?.steps.some((step) => step.status === "in_progress")
|
|
131
|
+
? "running"
|
|
132
|
+
: "info",
|
|
133
|
+
summary,
|
|
134
|
+
description: goal?.userGoal,
|
|
135
|
+
wrapRows: true,
|
|
136
|
+
rows,
|
|
137
|
+
notices: goal?.blockedReason ? [{ status: "warning", text: goal.blockedReason }] : [],
|
|
138
|
+
emptyText: "No goal, plan, agents, or background work right now",
|
|
139
|
+
};
|
|
140
|
+
}
|
|
86
141
|
export class AgentsOverlay {
|
|
87
142
|
constructor(options) {
|
|
88
143
|
this.mounted = false;
|
|
89
144
|
this.elapsedRedrawEnabled = false;
|
|
145
|
+
this.scrollTop = 0;
|
|
146
|
+
this.lastPageRows = 1;
|
|
147
|
+
this.lastMaxScroll = 0;
|
|
90
148
|
this.options = options;
|
|
91
149
|
}
|
|
92
150
|
mount() {
|
|
@@ -122,7 +180,20 @@ export class AgentsOverlay {
|
|
|
122
180
|
this.options.keybindings.matches(data, "app.agents.open")) {
|
|
123
181
|
this.dispose();
|
|
124
182
|
this.options.onClose();
|
|
183
|
+
return;
|
|
125
184
|
}
|
|
185
|
+
if (this.options.keybindings.matches(data, "app.transcript.top"))
|
|
186
|
+
this.scrollTo(0);
|
|
187
|
+
else if (this.options.keybindings.matches(data, "app.transcript.bottom"))
|
|
188
|
+
this.scrollTo(this.lastMaxScroll);
|
|
189
|
+
else if (this.options.keybindings.matches(data, "app.transcript.scrollUp"))
|
|
190
|
+
this.scrollBy(-1);
|
|
191
|
+
else if (this.options.keybindings.matches(data, "app.transcript.scrollDown"))
|
|
192
|
+
this.scrollBy(1);
|
|
193
|
+
else if (this.options.keybindings.matches(data, "app.transcript.pageUp"))
|
|
194
|
+
this.scrollBy(-this.lastPageRows);
|
|
195
|
+
else if (this.options.keybindings.matches(data, "app.transcript.pageDown"))
|
|
196
|
+
this.scrollBy(this.lastPageRows);
|
|
126
197
|
}
|
|
127
198
|
render(width) {
|
|
128
199
|
const nowMs = this.options.now?.() ?? Date.now();
|
|
@@ -131,20 +202,28 @@ export class AgentsOverlay {
|
|
|
131
202
|
record.status === "running" &&
|
|
132
203
|
record.startedAt !== undefined &&
|
|
133
204
|
!Number.isNaN(Date.parse(record.startedAt))));
|
|
134
|
-
const model =
|
|
205
|
+
const model = buildWorkPanelModel(snapshot, nowMs);
|
|
135
206
|
const surface = (text) => theme.bg("customMessageBg", truncateToWidth(text, width, "", true));
|
|
136
|
-
const
|
|
137
|
-
capitalize: true,
|
|
138
|
-
});
|
|
207
|
+
const key = (action) => formatKeyText(this.options.keybindings.getKeys(action).join("/"), { capitalize: true });
|
|
139
208
|
const body = renderOrchestrationPanelLines(theme, model, Math.max(1, width - 2), true);
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
209
|
+
const viewportRows = Math.max(6, this.options.viewportRows?.() ?? 24);
|
|
210
|
+
const pageRows = Math.max(3, viewportRows - 2);
|
|
211
|
+
this.lastPageRows = pageRows;
|
|
212
|
+
this.lastMaxScroll = Math.max(0, body.length - pageRows);
|
|
213
|
+
this.scrollTop = Math.min(this.scrollTop, this.lastMaxScroll);
|
|
214
|
+
const visible = body.slice(this.scrollTop, this.scrollTop + pageRows);
|
|
215
|
+
const position = this.lastMaxScroll > 0 ? ` · ${this.scrollTop + 1}-${this.scrollTop + visible.length}/${body.length}` : "";
|
|
216
|
+
const footer = ` ${key("app.transcript.scrollUp")}/${key("app.transcript.scrollDown")} scroll · ${key("app.transcript.pageUp")}/${key("app.transcript.pageDown")} page · ${key("app.transcript.top")}/${key("app.transcript.bottom")} jump · ${key("app.agents.close")} close${position}`;
|
|
217
|
+
return [surface(""), ...visible.map((line) => surface(` ${line}`)), surface(theme.fg("muted", footer))];
|
|
146
218
|
}
|
|
147
219
|
invalidate() { }
|
|
220
|
+
scrollBy(delta) {
|
|
221
|
+
this.scrollTo(this.scrollTop + delta);
|
|
222
|
+
}
|
|
223
|
+
scrollTo(next) {
|
|
224
|
+
this.scrollTop = Math.max(0, Math.min(this.lastMaxScroll, next));
|
|
225
|
+
this.options.requestRender();
|
|
226
|
+
}
|
|
148
227
|
dispose() {
|
|
149
228
|
this.mounted = false;
|
|
150
229
|
this.setElapsedRedrawEnabled(false);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"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AC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE;YAC9F,UAAU,EAAE,IAAI;SAChB,CAAC,CAAC;QACH,MAAM,IAAI,GAAG,6BAA6B,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;QACvF,OAAO;YACN,OAAO,CAAC,EAAE,CAAC;YACX,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC;YAC1C,OAAO,CAAC,EAAE,CAAC;YACX,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,IAAI,QAAQ,QAAQ,CAAC,CAAC;SAChD,CAAC;IACH,CAAC;IAED,UAAU,KAAU,CAAC;IAErB,OAAO;QACN,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;QACrB,IAAI,CAAC,uBAAuB,CAAC,KAAK,CAAC,CAAC;IACrC,CAAC;CACD","sourcesContent":["import { type Component, truncateToWidth } from \"@caupulican/pi-tui\";\nimport type { LaneRecord } from \"../../../core/autonomy/lane-tracker.ts\";\nimport type { KeybindingsManager } from \"../../../core/keybindings.ts\";\nimport {\n\ttype OrchestrationPanelModel,\n\ttype OrchestrationPanelRow,\n\trenderOrchestrationPanelLines,\n} from \"../../../core/tools/orchestration-panel.ts\";\nimport { theme } from \"../theme/theme.ts\";\nimport { type ActivityLaneItem, isBackgroundToolActivityItem } from \"./activity-lane.ts\";\nimport { formatKeyText } from \"./keybinding-hints.ts\";\n\n/**\n * On-demand detail view behind the statusline's aggregated concurrency counts:\n * the statusline shows \"2 agent · 3 bash\", this overlay names each worker and\n * background tool with status, elapsed time, and cost. Read-only; the same key\n * that opens it closes it, so it behaves as a peek.\n */\n\nexport interface AgentsOverlaySnapshot {\n\tlaneRecords: readonly LaneRecord[];\n\titems: readonly ActivityLaneItem[];\n}\n\nexport interface AgentsOverlayOptions {\n\tkeybindings: KeybindingsManager;\n\tsnapshot: () => AgentsOverlaySnapshot;\n\trequestRender: () => void;\n\tonClose: () => void;\n\t/** Injectable clock for tests. */\n\tnow?: () => number;\n}\n\nconst MAX_ROWS = 12;\nconst MAX_FINISHED_WORKERS = 4;\nconst ELAPSED_REDRAW_INTERVAL_MS = 1_000;\n\nexport function formatElapsed(ms: number): string {\n\tif (!Number.isFinite(ms) || ms < 0) return \"\";\n\tconst totalSeconds = Math.floor(ms / 1000);\n\tif (totalSeconds < 60) return `${totalSeconds}s`;\n\tconst minutes = Math.floor(totalSeconds / 60);\n\tif (minutes < 60) return `${minutes}m${String(totalSeconds % 60).padStart(2, \"0\")}s`;\n\treturn `${Math.floor(minutes / 60)}h${String(minutes % 60).padStart(2, \"0\")}m`;\n}\n\nfunction workerElapsed(record: LaneRecord, nowMs: number): string {\n\tif (!record.startedAt) return \"\";\n\tconst started = Date.parse(record.startedAt);\n\tif (Number.isNaN(started)) return \"\";\n\tconst end = record.completedAt ? Date.parse(record.completedAt) : nowMs;\n\tif (Number.isNaN(end)) return \"\";\n\treturn formatElapsed(end - started);\n}\n\nfunction workerRow(record: LaneRecord, nowMs: number): OrchestrationPanelRow {\n\tconst meta = [\n\t\trecord.type === \"tmux-worker\" ? \"tmux\" : \"agent\",\n\t\trecord.profileId,\n\t\tworkerElapsed(record, nowMs),\n\t\trecord.costUsd !== undefined ? `$${record.costUsd.toFixed(2)}` : undefined,\n\t].filter((value): value is string => value !== undefined && value !== \"\");\n\treturn {\n\t\tstatus: record.status,\n\t\tlabel: record.label ?? record.laneId,\n\t\tsection: \"Workers\",\n\t\tmeta,\n\t};\n}\n\nfunction backgroundToolRow(item: ActivityLaneItem): OrchestrationPanelRow {\n\treturn {\n\t\tstatus: item.status === \"waiting\" ? \"queued\" : \"running\",\n\t\tlabel: item.label,\n\t\tsection: \"Background tools\",\n\t\tmeta: item.tag ? [item.tag] : [],\n\t};\n}\n\nconst ACTIVE_WORKER_STATUSES = new Set<LaneRecord[\"status\"]>([\"queued\", \"running\"]);\n\nexport function buildAgentsPanelModel(snapshot: AgentsOverlaySnapshot, nowMs: number): OrchestrationPanelModel {\n\tconst workers = snapshot.laneRecords.filter((record) => record.type === \"worker\" || record.type === \"tmux-worker\");\n\tconst activeWorkers = workers.filter((record) => ACTIVE_WORKER_STATUSES.has(record.status));\n\tconst finishedWorkers = workers\n\t\t.filter((record) => !ACTIVE_WORKER_STATUSES.has(record.status))\n\t\t.sort((a, b) => (b.completedAt ?? \"\").localeCompare(a.completedAt ?? \"\"))\n\t\t.slice(0, MAX_FINISHED_WORKERS);\n\tconst backgroundTools = snapshot.items.filter(\n\t\t(item) => isBackgroundToolActivityItem(item) && (item.status === \"active\" || item.status === \"waiting\"),\n\t);\n\n\tconst rows: OrchestrationPanelRow[] = [\n\t\t...activeWorkers.map((record) => workerRow(record, nowMs)),\n\t\t...finishedWorkers.map((record) => workerRow(record, nowMs)),\n\t\t...backgroundTools.map(backgroundToolRow),\n\t];\n\tconst shown = rows.slice(0, MAX_ROWS);\n\n\tconst running = activeWorkers.filter((record) => record.status === \"running\").length;\n\tconst queued = activeWorkers.length - running;\n\tconst summary = [\n\t\trunning > 0 ? `${running} running` : undefined,\n\t\tqueued > 0 ? `${queued} queued` : undefined,\n\t\tbackgroundTools.length > 0\n\t\t\t? `${backgroundTools.length} background tool${backgroundTools.length === 1 ? \"\" : \"s\"}`\n\t\t\t: undefined,\n\t].filter((value): value is string => value !== undefined);\n\n\treturn {\n\t\tlabel: \"Agents\",\n\t\tstatus: workers.some((record) => record.status === \"failed\") ? \"error\" : \"info\",\n\t\tsummary,\n\t\trows: shown,\n\t\thiddenRowCount: rows.length - shown.length,\n\t\temptyText: \"No agents or background work right now\",\n\t};\n}\n\nexport class AgentsOverlay implements Component {\n\tprivate readonly options: AgentsOverlayOptions;\n\tprivate mounted = false;\n\tprivate elapsedRedrawEnabled = false;\n\tprivate elapsedRedrawTimer: ReturnType<typeof setTimeout> | undefined;\n\n\tconstructor(options: AgentsOverlayOptions) {\n\t\tthis.options = options;\n\t}\n\n\tmount(): void {\n\t\tif (this.mounted) return;\n\t\tthis.mounted = true;\n\t\tthis.scheduleElapsedRedraw();\n\t}\n\n\tprivate scheduleElapsedRedraw(): void {\n\t\tif (!this.mounted || !this.elapsedRedrawEnabled || this.elapsedRedrawTimer) return;\n\t\tthis.elapsedRedrawTimer = setTimeout(() => {\n\t\t\tthis.elapsedRedrawTimer = undefined;\n\t\t\tif (!this.mounted || !this.elapsedRedrawEnabled) return;\n\t\t\tthis.options.requestRender();\n\t\t\tthis.scheduleElapsedRedraw();\n\t\t}, ELAPSED_REDRAW_INTERVAL_MS);\n\t\tthis.elapsedRedrawTimer.unref?.();\n\t}\n\n\tprivate setElapsedRedrawEnabled(enabled: boolean): void {\n\t\tthis.elapsedRedrawEnabled = enabled;\n\t\tif (!enabled) {\n\t\t\tif (this.elapsedRedrawTimer) clearTimeout(this.elapsedRedrawTimer);\n\t\t\tthis.elapsedRedrawTimer = undefined;\n\t\t\treturn;\n\t\t}\n\t\tthis.scheduleElapsedRedraw();\n\t}\n\n\thandleInput(data: string): void {\n\t\tif (\n\t\t\tthis.options.keybindings.matches(data, \"app.agents.close\") ||\n\t\t\tthis.options.keybindings.matches(data, \"app.agents.open\")\n\t\t) {\n\t\t\tthis.dispose();\n\t\t\tthis.options.onClose();\n\t\t}\n\t}\n\n\trender(width: number): string[] {\n\t\tconst nowMs = this.options.now?.() ?? Date.now();\n\t\tconst snapshot = this.options.snapshot();\n\t\tthis.setElapsedRedrawEnabled(\n\t\t\tsnapshot.laneRecords.some(\n\t\t\t\t(record) =>\n\t\t\t\t\t(record.type === \"worker\" || record.type === \"tmux-worker\") &&\n\t\t\t\t\trecord.status === \"running\" &&\n\t\t\t\t\trecord.startedAt !== undefined &&\n\t\t\t\t\t!Number.isNaN(Date.parse(record.startedAt)),\n\t\t\t),\n\t\t);\n\t\tconst model = buildAgentsPanelModel(snapshot, nowMs);\n\t\tconst surface = (text: string) => theme.bg(\"customMessageBg\", truncateToWidth(text, width, \"\", true));\n\t\tconst closeKey = formatKeyText(this.options.keybindings.getKeys(\"app.agents.close\").join(\"/\"), {\n\t\t\tcapitalize: true,\n\t\t});\n\t\tconst body = renderOrchestrationPanelLines(theme, model, Math.max(1, width - 2), true);\n\t\treturn [\n\t\t\tsurface(\"\"),\n\t\t\t...body.map((line) => surface(` ${line}`)),\n\t\t\tsurface(\"\"),\n\t\t\tsurface(theme.fg(\"muted\", ` ${closeKey} close`)),\n\t\t];\n\t}\n\n\tinvalidate(): void {}\n\n\tdispose(): void {\n\t\tthis.mounted = false;\n\t\tthis.setElapsedRedrawEnabled(false);\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"agents-overlay.js","sourceRoot":"","sources":["../../../../src/modes/interactive/components/agents-overlay.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAKrE,OAAO,EACN,oBAAoB,EACpB,uBAAuB,EAGvB,6BAA6B,EAC7B,gBAAgB,GAChB,MAAM,4CAA4C,CAAC;AACpD,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAyB,4BAA4B,EAAE,MAAM,oBAAoB,CAAC;AACzF,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AA0BtD,MAAM,QAAQ,GAAG,EAAE,CAAC;AACpB,MAAM,oBAAoB,GAAG,CAAC,CAAC;AAC/B,MAAM,0BAA0B,GAAG,KAAK,CAAC;AAEzC,MAAM,UAAU,aAAa,CAAC,EAAU;IACvC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,CAAC;QAAE,OAAO,EAAE,CAAC;IAC9C,MAAM,YAAY,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,GAAG,IAAI,CAAC,CAAC;IAC3C,IAAI,YAAY,GAAG,EAAE;QAAE,OAAO,GAA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AC,EAAE,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;IACzG,CAAC;IAED,UAAU,KAAU,CAAC;IAEb,QAAQ,CAAC,KAAa;QAC7B,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC,CAAC;IACvC,CAAC;IAEO,QAAQ,CAAC,IAAY;QAC5B,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,aAAa,EAAE,IAAI,CAAC,CAAC,CAAC;QACjE,IAAI,CAAC,OAAO,CAAC,aAAa,EAAE,CAAC;IAC9B,CAAC;IAED,OAAO;QACN,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;QACrB,IAAI,CAAC,uBAAuB,CAAC,KAAK,CAAC,CAAC;IACrC,CAAC;CACD","sourcesContent":["import { type Component, truncateToWidth } from \"@caupulican/pi-tui\";\nimport type { LaneRecord } from \"../../../core/autonomy/lane-tracker.ts\";\nimport type { GoalState } from \"../../../core/goals/goal-state.ts\";\nimport type { KeybindingsManager } from \"../../../core/keybindings.ts\";\nimport type { TaskStepsState } from \"../../../core/tasks/task-state.ts\";\nimport {\n\tgoalEvidencePanelRow,\n\tgoalRequirementPanelRow,\n\ttype OrchestrationPanelModel,\n\ttype OrchestrationPanelRow,\n\trenderOrchestrationPanelLines,\n\ttaskStepPanelRow,\n} from \"../../../core/tools/orchestration-panel.ts\";\nimport { theme } from \"../theme/theme.ts\";\nimport { type ActivityLaneItem, isBackgroundToolActivityItem } from \"./activity-lane.ts\";\nimport { formatKeyText } from \"./keybinding-hints.ts\";\n\n/**\n * On-demand work inspector behind the compact activity lane. One canonical snapshot\n * exposes goal, requirements, plan, workers, and background tools without duplicating\n * lifecycle state. The viewport is scrollable; the same key that opens it closes it.\n */\n\nexport interface AgentsOverlaySnapshot {\n\tgoalState?: GoalState;\n\ttaskState?: TaskStepsState;\n\tlaneRecords: readonly LaneRecord[];\n\titems: readonly ActivityLaneItem[];\n}\n\nexport interface AgentsOverlayOptions {\n\tkeybindings: KeybindingsManager;\n\tsnapshot: () => AgentsOverlaySnapshot;\n\trequestRender: () => void;\n\tonClose: () => void;\n\t/** Injectable clock for tests. */\n\tnow?: () => number;\n\t/** Terminal row budget used by the scrollable inspector. */\n\tviewportRows?: () => number;\n}\n\nconst MAX_ROWS = 12;\nconst MAX_FINISHED_WORKERS = 4;\nconst ELAPSED_REDRAW_INTERVAL_MS = 1_000;\n\nexport function formatElapsed(ms: number): string {\n\tif (!Number.isFinite(ms) || ms < 0) return \"\";\n\tconst totalSeconds = Math.floor(ms / 1000);\n\tif (totalSeconds < 60) return `${totalSeconds}s`;\n\tconst minutes = Math.floor(totalSeconds / 60);\n\tif (minutes < 60) return `${minutes}m${String(totalSeconds % 60).padStart(2, \"0\")}s`;\n\treturn `${Math.floor(minutes / 60)}h${String(minutes % 60).padStart(2, \"0\")}m`;\n}\n\nfunction workerElapsed(record: LaneRecord, nowMs: number): string {\n\tif (!record.startedAt) return \"\";\n\tconst started = Date.parse(record.startedAt);\n\tif (Number.isNaN(started)) return \"\";\n\tconst end = record.completedAt ? Date.parse(record.completedAt) : nowMs;\n\tif (Number.isNaN(end)) return \"\";\n\treturn formatElapsed(end - started);\n}\n\nfunction workerRow(record: LaneRecord, nowMs: number): OrchestrationPanelRow {\n\tconst meta = [\n\t\trecord.type === \"tmux-worker\" ? \"tmux\" : \"agent\",\n\t\trecord.profileId,\n\t\trecord.modelRef,\n\t\trecord.thinkingLevel,\n\t\tworkerElapsed(record, nowMs),\n\t\trecord.costUsd !== undefined ? `$${record.costUsd.toFixed(2)}` : undefined,\n\t].filter((value): value is string => value !== undefined && value !== \"\");\n\tconst details = [\n\t\t`lane: ${record.laneId}`,\n\t\trecord.goalId ? `goal: ${record.goalId}` : undefined,\n\t\trecord.reasonCode ? `reason: ${record.reasonCode}` : undefined,\n\t\trecord.worktreeLaneKey ? `worktree: ${record.worktreeLaneKey}` : undefined,\n\t\trecord.evidenceEntryId ? `evidence: ${record.evidenceEntryId}` : undefined,\n\t\trecord.startedAt ? `started: ${record.startedAt}` : undefined,\n\t\trecord.completedAt ? `completed: ${record.completedAt}` : undefined,\n\t].filter((value): value is string => value !== undefined);\n\treturn {\n\t\tstatus: record.status,\n\t\tlabel: record.label ?? record.laneId,\n\t\tsection: \"Workers\",\n\t\tmeta,\n\t\tdetails,\n\t};\n}\n\nfunction backgroundToolRow(item: ActivityLaneItem): OrchestrationPanelRow {\n\treturn {\n\t\tstatus: item.status === \"waiting\" ? \"queued\" : \"running\",\n\t\tlabel: item.label,\n\t\tsection: \"Background tools\",\n\t\tmeta: item.tag ? [item.tag] : [],\n\t};\n}\n\nconst ACTIVE_WORKER_STATUSES = new Set<LaneRecord[\"status\"]>([\"queued\", \"running\"]);\nconst ACTIVE_BACKGROUND_TOOL_STATUSES = new Set<ActivityLaneItem[\"status\"]>([\"active\", \"waiting\"]);\n\ninterface WorkActivityProjection {\n\tworkers: LaneRecord[];\n\tactiveWorkers: LaneRecord[];\n\trows: OrchestrationPanelRow[];\n\tsummary: string[];\n}\n\nfunction projectWorkActivity(snapshot: AgentsOverlaySnapshot, nowMs: number): WorkActivityProjection {\n\tconst workers = snapshot.laneRecords.filter((record) => record.type === \"worker\" || record.type === \"tmux-worker\");\n\tconst activeWorkers = workers.filter((record) => ACTIVE_WORKER_STATUSES.has(record.status));\n\tconst finishedWorkers = workers\n\t\t.filter((record) => !ACTIVE_WORKER_STATUSES.has(record.status))\n\t\t.sort((a, b) => (b.completedAt ?? \"\").localeCompare(a.completedAt ?? \"\"))\n\t\t.slice(0, MAX_FINISHED_WORKERS);\n\tconst backgroundTools = snapshot.items.filter(\n\t\t(item) => isBackgroundToolActivityItem(item) && ACTIVE_BACKGROUND_TOOL_STATUSES.has(item.status),\n\t);\n\tconst running = activeWorkers.filter((record) => record.status === \"running\").length;\n\tconst queued = activeWorkers.length - running;\n\treturn {\n\t\tworkers,\n\t\tactiveWorkers,\n\t\trows: [\n\t\t\t...activeWorkers.map((record) => workerRow(record, nowMs)),\n\t\t\t...finishedWorkers.map((record) => workerRow(record, nowMs)),\n\t\t\t...backgroundTools.map(backgroundToolRow),\n\t\t],\n\t\tsummary: [\n\t\t\trunning > 0 ? `${running} running` : undefined,\n\t\t\tqueued > 0 ? `${queued} queued` : undefined,\n\t\t\tbackgroundTools.length > 0\n\t\t\t\t? `${backgroundTools.length} background tool${backgroundTools.length === 1 ? \"\" : \"s\"}`\n\t\t\t\t: undefined,\n\t\t].filter((value): value is string => value !== undefined),\n\t};\n}\n\nexport function buildAgentsPanelModel(snapshot: AgentsOverlaySnapshot, nowMs: number): OrchestrationPanelModel {\n\tconst activity = projectWorkActivity(snapshot, nowMs);\n\tconst shown = activity.rows.slice(0, MAX_ROWS);\n\treturn {\n\t\tlabel: \"Agents\",\n\t\tstatus: activity.workers.some((record) => record.status === \"failed\") ? \"error\" : \"info\",\n\t\tsummary: activity.summary,\n\t\trows: shown,\n\t\thiddenRowCount: activity.rows.length - shown.length,\n\t\temptyText: \"No agents or background work right now\",\n\t};\n}\n\n/** Complete, bounded projection for the interactive work inspector. */\nexport function buildWorkPanelModel(snapshot: AgentsOverlaySnapshot, nowMs: number): OrchestrationPanelModel {\n\tconst goal = snapshot.goalState;\n\tconst task = snapshot.taskState;\n\tconst activity = projectWorkActivity(snapshot, nowMs);\n\tconst satisfied = goal?.requirements.filter((requirement) => requirement.status === \"satisfied\").length ?? 0;\n\tconst rows: OrchestrationPanelRow[] = [\n\t\t...(goal?.requirements.map(goalRequirementPanelRow) ?? []),\n\t\t...(goal?.evidence.map(goalEvidencePanelRow) ?? []),\n\t\t...(task?.steps.map((step) => ({ ...taskStepPanelRow(step), section: \"Plan\" })) ?? []),\n\t\t...activity.rows,\n\t];\n\tconst summary = [\n\t\tgoal ? `goal ${goal.status.replace(\"_\", \" \")}` : undefined,\n\t\tgoal ? `${satisfied}/${goal.requirements.length} requirements` : undefined,\n\t\ttask ? `${task.steps.length + task.archive.completed + task.archive.cancelled} plan steps` : undefined,\n\t\t...activity.summary,\n\t].filter((value): value is string => value !== undefined);\n\treturn {\n\t\tlabel: \"Work\",\n\t\tstatus:\n\t\t\tgoal?.status === \"blocked\" ||\n\t\t\tgoal?.status === \"paused\" ||\n\t\t\tactivity.workers.some((record) => record.status === \"failed\")\n\t\t\t\t? \"warning\"\n\t\t\t\t: activity.activeWorkers.length > 0 || task?.steps.some((step) => step.status === \"in_progress\")\n\t\t\t\t\t? \"running\"\n\t\t\t\t\t: \"info\",\n\t\tsummary,\n\t\tdescription: goal?.userGoal,\n\t\twrapRows: true,\n\t\trows,\n\t\tnotices: goal?.blockedReason ? [{ status: \"warning\", text: goal.blockedReason }] : [],\n\t\temptyText: \"No goal, plan, agents, or background work right now\",\n\t};\n}\n\nexport class AgentsOverlay implements Component {\n\tprivate readonly options: AgentsOverlayOptions;\n\tprivate mounted = false;\n\tprivate elapsedRedrawEnabled = false;\n\tprivate elapsedRedrawTimer: ReturnType<typeof setTimeout> | undefined;\n\tprivate scrollTop = 0;\n\tprivate lastPageRows = 1;\n\tprivate lastMaxScroll = 0;\n\n\tconstructor(options: AgentsOverlayOptions) {\n\t\tthis.options = options;\n\t}\n\n\tmount(): void {\n\t\tif (this.mounted) return;\n\t\tthis.mounted = true;\n\t\tthis.scheduleElapsedRedraw();\n\t}\n\n\tprivate scheduleElapsedRedraw(): void {\n\t\tif (!this.mounted || !this.elapsedRedrawEnabled || this.elapsedRedrawTimer) return;\n\t\tthis.elapsedRedrawTimer = setTimeout(() => {\n\t\t\tthis.elapsedRedrawTimer = undefined;\n\t\t\tif (!this.mounted || !this.elapsedRedrawEnabled) return;\n\t\t\tthis.options.requestRender();\n\t\t\tthis.scheduleElapsedRedraw();\n\t\t}, ELAPSED_REDRAW_INTERVAL_MS);\n\t\tthis.elapsedRedrawTimer.unref?.();\n\t}\n\n\tprivate setElapsedRedrawEnabled(enabled: boolean): void {\n\t\tthis.elapsedRedrawEnabled = enabled;\n\t\tif (!enabled) {\n\t\t\tif (this.elapsedRedrawTimer) clearTimeout(this.elapsedRedrawTimer);\n\t\t\tthis.elapsedRedrawTimer = undefined;\n\t\t\treturn;\n\t\t}\n\t\tthis.scheduleElapsedRedraw();\n\t}\n\n\thandleInput(data: string): void {\n\t\tif (\n\t\t\tthis.options.keybindings.matches(data, \"app.agents.close\") ||\n\t\t\tthis.options.keybindings.matches(data, \"app.agents.open\")\n\t\t) {\n\t\t\tthis.dispose();\n\t\t\tthis.options.onClose();\n\t\t\treturn;\n\t\t}\n\t\tif (this.options.keybindings.matches(data, \"app.transcript.top\")) this.scrollTo(0);\n\t\telse if (this.options.keybindings.matches(data, \"app.transcript.bottom\")) this.scrollTo(this.lastMaxScroll);\n\t\telse if (this.options.keybindings.matches(data, \"app.transcript.scrollUp\")) this.scrollBy(-1);\n\t\telse if (this.options.keybindings.matches(data, \"app.transcript.scrollDown\")) this.scrollBy(1);\n\t\telse if (this.options.keybindings.matches(data, \"app.transcript.pageUp\")) this.scrollBy(-this.lastPageRows);\n\t\telse if (this.options.keybindings.matches(data, \"app.transcript.pageDown\")) this.scrollBy(this.lastPageRows);\n\t}\n\n\trender(width: number): string[] {\n\t\tconst nowMs = this.options.now?.() ?? Date.now();\n\t\tconst snapshot = this.options.snapshot();\n\t\tthis.setElapsedRedrawEnabled(\n\t\t\tsnapshot.laneRecords.some(\n\t\t\t\t(record) =>\n\t\t\t\t\t(record.type === \"worker\" || record.type === \"tmux-worker\") &&\n\t\t\t\t\trecord.status === \"running\" &&\n\t\t\t\t\trecord.startedAt !== undefined &&\n\t\t\t\t\t!Number.isNaN(Date.parse(record.startedAt)),\n\t\t\t),\n\t\t);\n\t\tconst model = buildWorkPanelModel(snapshot, nowMs);\n\t\tconst surface = (text: string) => theme.bg(\"customMessageBg\", truncateToWidth(text, width, \"\", true));\n\t\tconst key = (action: Parameters<KeybindingsManager[\"getKeys\"]>[0]) =>\n\t\t\tformatKeyText(this.options.keybindings.getKeys(action).join(\"/\"), { capitalize: true });\n\t\tconst body = renderOrchestrationPanelLines(theme, model, Math.max(1, width - 2), true);\n\t\tconst viewportRows = Math.max(6, this.options.viewportRows?.() ?? 24);\n\t\tconst pageRows = Math.max(3, viewportRows - 2);\n\t\tthis.lastPageRows = pageRows;\n\t\tthis.lastMaxScroll = Math.max(0, body.length - pageRows);\n\t\tthis.scrollTop = Math.min(this.scrollTop, this.lastMaxScroll);\n\t\tconst visible = body.slice(this.scrollTop, this.scrollTop + pageRows);\n\t\tconst position =\n\t\t\tthis.lastMaxScroll > 0 ? ` · ${this.scrollTop + 1}-${this.scrollTop + visible.length}/${body.length}` : \"\";\n\t\tconst footer = ` ${key(\"app.transcript.scrollUp\")}/${key(\"app.transcript.scrollDown\")} scroll · ${key(\"app.transcript.pageUp\")}/${key(\"app.transcript.pageDown\")} page · ${key(\"app.transcript.top\")}/${key(\"app.transcript.bottom\")} jump · ${key(\"app.agents.close\")} close${position}`;\n\t\treturn [surface(\"\"), ...visible.map((line) => surface(` ${line}`)), surface(theme.fg(\"muted\", footer))];\n\t}\n\n\tinvalidate(): void {}\n\n\tprivate scrollBy(delta: number): void {\n\t\tthis.scrollTo(this.scrollTop + delta);\n\t}\n\n\tprivate scrollTo(next: number): void {\n\t\tthis.scrollTop = Math.max(0, Math.min(this.lastMaxScroll, next));\n\t\tthis.options.requestRender();\n\t}\n\n\tdispose(): void {\n\t\tthis.mounted = false;\n\t\tthis.setElapsedRedrawEnabled(false);\n\t}\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interactive-mode.d.ts","sourceRoot":"","sources":["../../../src/modes/interactive/interactive-mode.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,KAAK,EAAkB,cAAc,EAAoB,MAAM,gCAAgC,CAAC;AAEvG,OAAO,KAAK,EAAE,gBAAgB,EAAE,YAAY,EAAkB,MAAM,mBAAmB,CAAC;AAExF,O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;OAGG;YACW,+BAA+B;IAqB7C,OAAO,CAAC,mBAAmB;IAY3B,OAAO,CAAC,sBAAsB;IA6B9B,OAAO,CAAC,mBAAmB;IAwB3B,OAAO,CAAC,kBAAkB;IAW1B,OAAO,CAAC,iBAAiB;IAQzB,OAAO,CAAC,iBAAiB;IAazB,OAAO,CAAC,wBAAwB;YA2ClB,iBAAiB;IAoB/B,OAAO,CAAC,iBAAiB;YAmBX,yBAAyB;IAcvC,OAAO,CAAC,oBAAoB;IAS5B,OAAO,CAAC,kBAAkB;IAS1B,OAAO,CAAC,sBAAsB;IAU9B,OAAO,CAAC,sBAAsB;IAQ9B;;OAEG;IACH,OAAO,CAAC,gBAAgB;IAIxB;;OAEG;IACH,OAAO,CAAC,mBAAmB;IAI3B,OAAO,CAAC,oBAAoB;YAYd,kBAAkB;IAyBhC,OAAO,CAAC,wBAAwB;IA4BhC,OAAO,CAAC,6BAA6B;IAerC;;;;;OAKG;IACH,OAAO,CAAC,mBAAmB;YAUb,yBAAyB;YAWzB,0BAA0B;IAaxC,OAAO,CAAC,kBAAkB;IAQ1B,OAAO,CAAC,iBAAiB;IAIzB,OAAO,CAAC,oBAAoB;IAI5B,OAAO,CAAC,qBAAqB;IAI7B,OAAO,CAAC,iBAAiB;IAuBzB,OAAO,CAAC,oBAAoB;IAW5B,IAAI,IAAI,IAAI,CA2BX;CACD"}
|
|
@@ -433,7 +433,7 @@ export class InteractiveMode {
|
|
|
433
433
|
hint("app.model.select", "to select model"),
|
|
434
434
|
hint("app.tools.expand", "to expand tools"),
|
|
435
435
|
hint("app.history.load", "to load session history"),
|
|
436
|
-
hint("app.agents.open", "to
|
|
436
|
+
hint("app.agents.open", "to inspect goal, plan, and agents"),
|
|
437
437
|
hint("app.transcript.open", "to view transcript"),
|
|
438
438
|
hint("app.thinking.toggle", "to expand thinking"),
|
|
439
439
|
hint("app.editor.external", "for external editor"),
|
|
@@ -1503,16 +1503,17 @@ export class InteractiveMode {
|
|
|
1503
1503
|
const overlay = new AgentsOverlay({
|
|
1504
1504
|
keybindings: this.keybindings,
|
|
1505
1505
|
snapshot: () => ({
|
|
1506
|
-
|
|
1506
|
+
...this.activityLaneSnapshot(),
|
|
1507
1507
|
items: this.activityLane?.getItems() ?? [],
|
|
1508
1508
|
}),
|
|
1509
1509
|
requestRender: () => this.ui.requestRender(),
|
|
1510
1510
|
onClose: () => this.closeAgentsOverlay(overlay),
|
|
1511
|
+
viewportRows: () => this.ui.terminal.rows,
|
|
1511
1512
|
});
|
|
1512
1513
|
this.agentsOverlay = overlay;
|
|
1513
1514
|
this.agentsOverlayHandle = this.ui.showOverlay(overlay, {
|
|
1514
|
-
width: "
|
|
1515
|
-
maxHeight: "
|
|
1515
|
+
width: "90%",
|
|
1516
|
+
maxHeight: "100%",
|
|
1516
1517
|
onRemove: () => this.handleAgentsOverlayRemoved(overlay),
|
|
1517
1518
|
});
|
|
1518
1519
|
overlay.mount();
|