taskplane 0.28.4 → 0.28.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -21
- package/README.md +215 -215
- package/bin/gitignore-patterns.mjs +79 -79
- package/bin/rpc-wrapper.mjs +1086 -1086
- package/bin/taskplane.mjs +3254 -3254
- package/dashboard/public/app.js +2573 -2573
- package/dashboard/public/index.html +139 -139
- package/dashboard/public/style.css +1882 -1882
- package/dashboard/public/taskplane-word-color.svg +18 -18
- package/dashboard/public/taskplane-word-white.svg +18 -18
- package/dashboard/server.cjs +1666 -1666
- package/extensions/reviewer-extension.ts +119 -119
- package/extensions/task-orchestrator.ts +28 -28
- package/extensions/taskplane/abort.ts +502 -502
- package/extensions/taskplane/agent-bridge-extension.ts +838 -765
- package/extensions/taskplane/agent-host.ts +833 -745
- package/extensions/taskplane/cleanup.ts +747 -747
- package/extensions/taskplane/config-loader.ts +1328 -1322
- package/extensions/taskplane/config-schema.ts +692 -682
- package/extensions/taskplane/config.ts +73 -73
- package/extensions/taskplane/context-window.ts +66 -66
- package/extensions/taskplane/diagnostic-reports.ts +463 -463
- package/extensions/taskplane/diagnostics.ts +385 -385
- package/extensions/taskplane/engine-worker-entry.mjs +34 -34
- package/extensions/taskplane/engine-worker.ts +381 -381
- package/extensions/taskplane/engine.ts +4539 -4527
- package/extensions/taskplane/execution.ts +2733 -2708
- package/extensions/taskplane/extension.ts +30 -9
- package/extensions/taskplane/formatting.ts +773 -773
- package/extensions/taskplane/git.ts +90 -90
- package/extensions/taskplane/index.ts +28 -28
- package/extensions/taskplane/lane-runner.ts +1383 -1360
- package/extensions/taskplane/mailbox.ts +689 -689
- package/extensions/taskplane/merge.ts +3135 -3135
- package/extensions/taskplane/messages.ts +985 -985
- package/extensions/taskplane/migrations.ts +278 -278
- package/extensions/taskplane/naming.ts +117 -117
- package/extensions/taskplane/path-resolver.ts +237 -237
- package/extensions/taskplane/persistence.ts +2087 -2087
- package/extensions/taskplane/process-registry.ts +416 -416
- package/extensions/taskplane/quality-gate.ts +1033 -1033
- package/extensions/taskplane/resume.ts +2879 -2878
- package/extensions/taskplane/sessions.ts +57 -57
- package/extensions/taskplane/settings-loader.ts +136 -136
- package/extensions/taskplane/settings-tui.ts +1867 -1867
- package/extensions/taskplane/sidecar-telemetry.ts +252 -252
- package/extensions/taskplane/supervisor-primer.md +1694 -1694
- package/extensions/taskplane/supervisor.ts +4341 -4341
- package/extensions/taskplane/task-executor-core.ts +550 -550
- package/extensions/taskplane/tmux-compat.ts +37 -37
- package/extensions/taskplane/types.ts +4297 -4278
- package/extensions/taskplane/verification.ts +542 -542
- package/extensions/taskplane/waves.ts +1548 -1548
- package/extensions/taskplane/workspace.ts +705 -705
- package/extensions/taskplane/worktree.ts +2604 -2505
- package/package.json +57 -57
- package/skills/create-taskplane-task/SKILL.md +465 -465
- package/skills/create-taskplane-task/references/prompt-template.md +285 -285
- package/templates/agents/local/supervisor.md +33 -33
- package/templates/agents/local/task-merger.md +27 -27
- package/templates/agents/local/task-reviewer.md +30 -30
- package/templates/agents/local/task-worker.md +34 -34
- package/templates/agents/supervisor-routing.md +92 -92
- package/templates/agents/supervisor.md +168 -168
- package/templates/agents/task-merger.md +214 -214
- package/templates/agents/task-reviewer.md +192 -192
- package/templates/agents/task-worker.md +505 -429
- package/templates/tasks/EXAMPLE-001-hello-world/PROMPT.md +98 -98
- package/templates/tasks/EXAMPLE-001-hello-world/STATUS.md +73 -73
- package/templates/tasks/EXAMPLE-002-parallel-smoke/PROMPT.md +97 -97
- package/templates/tasks/EXAMPLE-002-parallel-smoke/STATUS.md +73 -73
|
@@ -1,73 +1,73 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Config loading — thin wrappers over the unified loader.
|
|
3
|
-
*
|
|
4
|
-
* These functions preserve the existing snake_case return shapes
|
|
5
|
-
* (`OrchestratorConfig`, `TaskRunnerConfig` from types.ts) so all
|
|
6
|
-
* downstream consumers remain unchanged during the JSON migration.
|
|
7
|
-
*
|
|
8
|
-
* The unified loader (`loadProjectConfig`) handles JSON-first loading
|
|
9
|
-
* with YAML fallback and defaults merging.
|
|
10
|
-
*
|
|
11
|
-
* @module orch/config
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
import { loadProjectConfig, toOrchestratorConfig, toTaskRunnerConfig, hasConfigFiles } from "./config-loader.ts";
|
|
15
|
-
export { hasConfigFiles, resolveConfigRoot } from "./config-loader.ts";
|
|
16
|
-
import type { OrchestratorConfig, TaskRunnerConfig } from "./types.ts";
|
|
17
|
-
import type { SupervisorConfig } from "./supervisor.ts";
|
|
18
|
-
import { DEFAULT_SUPERVISOR_CONFIG } from "./supervisor.ts";
|
|
19
|
-
|
|
20
|
-
// ── Config Loading ───────────────────────────────────────────────────
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Load orchestrator config.
|
|
24
|
-
*
|
|
25
|
-
* Reads `.pi/taskplane-config.json` first; falls back to
|
|
26
|
-
* `.pi/task-orchestrator.yaml` + `.pi/task-runner.yaml`; then defaults.
|
|
27
|
-
*
|
|
28
|
-
* In workspace mode, `pointerConfigRoot` (from the resolved pointer file)
|
|
29
|
-
* is inserted into the config resolution chain between cwd-local and
|
|
30
|
-
* TASKPLANE_WORKSPACE_ROOT. See `resolveConfigRoot()` in config-loader.ts.
|
|
31
|
-
*
|
|
32
|
-
* Returns the legacy `OrchestratorConfig` (snake_case) shape.
|
|
33
|
-
*/
|
|
34
|
-
export function loadOrchestratorConfig(cwd: string, pointerConfigRoot?: string): OrchestratorConfig {
|
|
35
|
-
const unified = loadProjectConfig(cwd, pointerConfigRoot);
|
|
36
|
-
return toOrchestratorConfig(unified);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* Load task-runner config (orchestrator subset: task_areas + reference_docs).
|
|
41
|
-
*
|
|
42
|
-
* Reads `.pi/taskplane-config.json` first; falls back to
|
|
43
|
-
* `.pi/task-runner.yaml`; then defaults.
|
|
44
|
-
*
|
|
45
|
-
* In workspace mode, `pointerConfigRoot` (from the resolved pointer file)
|
|
46
|
-
* is inserted into the config resolution chain between cwd-local and
|
|
47
|
-
* TASKPLANE_WORKSPACE_ROOT. See `resolveConfigRoot()` in config-loader.ts.
|
|
48
|
-
*
|
|
49
|
-
* Returns the legacy `TaskRunnerConfig` (snake_case) shape.
|
|
50
|
-
*/
|
|
51
|
-
export function loadTaskRunnerConfig(cwd: string, pointerConfigRoot?: string): TaskRunnerConfig {
|
|
52
|
-
const unified = loadProjectConfig(cwd, pointerConfigRoot);
|
|
53
|
-
return toTaskRunnerConfig(unified);
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
/**
|
|
57
|
-
* Load supervisor config from unified project config.
|
|
58
|
-
*
|
|
59
|
-
* Extracts the `orchestrator.supervisor` section from the unified config.
|
|
60
|
-
* Falls back to defaults if the section is missing (backward compatibility
|
|
61
|
-
* with configs created before TP-041).
|
|
62
|
-
*
|
|
63
|
-
* @since TP-041
|
|
64
|
-
*/
|
|
65
|
-
export function loadSupervisorConfig(cwd: string, pointerConfigRoot?: string): SupervisorConfig {
|
|
66
|
-
const unified = loadProjectConfig(cwd, pointerConfigRoot);
|
|
67
|
-
const section = unified.orchestrator.supervisor;
|
|
68
|
-
if (!section) return { ...DEFAULT_SUPERVISOR_CONFIG };
|
|
69
|
-
return {
|
|
70
|
-
model: section.model ?? DEFAULT_SUPERVISOR_CONFIG.model,
|
|
71
|
-
autonomy: section.autonomy ?? DEFAULT_SUPERVISOR_CONFIG.autonomy,
|
|
72
|
-
};
|
|
73
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* Config loading — thin wrappers over the unified loader.
|
|
3
|
+
*
|
|
4
|
+
* These functions preserve the existing snake_case return shapes
|
|
5
|
+
* (`OrchestratorConfig`, `TaskRunnerConfig` from types.ts) so all
|
|
6
|
+
* downstream consumers remain unchanged during the JSON migration.
|
|
7
|
+
*
|
|
8
|
+
* The unified loader (`loadProjectConfig`) handles JSON-first loading
|
|
9
|
+
* with YAML fallback and defaults merging.
|
|
10
|
+
*
|
|
11
|
+
* @module orch/config
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
import { loadProjectConfig, toOrchestratorConfig, toTaskRunnerConfig, hasConfigFiles } from "./config-loader.ts";
|
|
15
|
+
export { hasConfigFiles, resolveConfigRoot } from "./config-loader.ts";
|
|
16
|
+
import type { OrchestratorConfig, TaskRunnerConfig } from "./types.ts";
|
|
17
|
+
import type { SupervisorConfig } from "./supervisor.ts";
|
|
18
|
+
import { DEFAULT_SUPERVISOR_CONFIG } from "./supervisor.ts";
|
|
19
|
+
|
|
20
|
+
// ── Config Loading ───────────────────────────────────────────────────
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Load orchestrator config.
|
|
24
|
+
*
|
|
25
|
+
* Reads `.pi/taskplane-config.json` first; falls back to
|
|
26
|
+
* `.pi/task-orchestrator.yaml` + `.pi/task-runner.yaml`; then defaults.
|
|
27
|
+
*
|
|
28
|
+
* In workspace mode, `pointerConfigRoot` (from the resolved pointer file)
|
|
29
|
+
* is inserted into the config resolution chain between cwd-local and
|
|
30
|
+
* TASKPLANE_WORKSPACE_ROOT. See `resolveConfigRoot()` in config-loader.ts.
|
|
31
|
+
*
|
|
32
|
+
* Returns the legacy `OrchestratorConfig` (snake_case) shape.
|
|
33
|
+
*/
|
|
34
|
+
export function loadOrchestratorConfig(cwd: string, pointerConfigRoot?: string): OrchestratorConfig {
|
|
35
|
+
const unified = loadProjectConfig(cwd, pointerConfigRoot);
|
|
36
|
+
return toOrchestratorConfig(unified);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Load task-runner config (orchestrator subset: task_areas + reference_docs).
|
|
41
|
+
*
|
|
42
|
+
* Reads `.pi/taskplane-config.json` first; falls back to
|
|
43
|
+
* `.pi/task-runner.yaml`; then defaults.
|
|
44
|
+
*
|
|
45
|
+
* In workspace mode, `pointerConfigRoot` (from the resolved pointer file)
|
|
46
|
+
* is inserted into the config resolution chain between cwd-local and
|
|
47
|
+
* TASKPLANE_WORKSPACE_ROOT. See `resolveConfigRoot()` in config-loader.ts.
|
|
48
|
+
*
|
|
49
|
+
* Returns the legacy `TaskRunnerConfig` (snake_case) shape.
|
|
50
|
+
*/
|
|
51
|
+
export function loadTaskRunnerConfig(cwd: string, pointerConfigRoot?: string): TaskRunnerConfig {
|
|
52
|
+
const unified = loadProjectConfig(cwd, pointerConfigRoot);
|
|
53
|
+
return toTaskRunnerConfig(unified);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Load supervisor config from unified project config.
|
|
58
|
+
*
|
|
59
|
+
* Extracts the `orchestrator.supervisor` section from the unified config.
|
|
60
|
+
* Falls back to defaults if the section is missing (backward compatibility
|
|
61
|
+
* with configs created before TP-041).
|
|
62
|
+
*
|
|
63
|
+
* @since TP-041
|
|
64
|
+
*/
|
|
65
|
+
export function loadSupervisorConfig(cwd: string, pointerConfigRoot?: string): SupervisorConfig {
|
|
66
|
+
const unified = loadProjectConfig(cwd, pointerConfigRoot);
|
|
67
|
+
const section = unified.orchestrator.supervisor;
|
|
68
|
+
if (!section) return { ...DEFAULT_SUPERVISOR_CONFIG };
|
|
69
|
+
return {
|
|
70
|
+
model: section.model ?? DEFAULT_SUPERVISOR_CONFIG.model,
|
|
71
|
+
autonomy: section.autonomy ?? DEFAULT_SUPERVISOR_CONFIG.autonomy,
|
|
72
|
+
};
|
|
73
|
+
}
|
|
@@ -1,66 +1,66 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Context Window Resolution Utilities
|
|
3
|
-
*
|
|
4
|
-
* Canonical home for context window resolution logic used when spawning workers.
|
|
5
|
-
*
|
|
6
|
-
* The original `resolveContextWindow(config: TaskConfig, ctx: ExtensionContext)` signature
|
|
7
|
-
* has been adapted to accept only the fields it actually uses, avoiding a dependency
|
|
8
|
-
* on the task-runner-internal `TaskConfig` type. Behavior is identical.
|
|
9
|
-
*
|
|
10
|
-
* @since TP-161
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
import type { ExtensionContext } from "@mariozechner/pi-coding-agent";
|
|
14
|
-
|
|
15
|
-
// ── Context Window Constants ──────────────────────────────────────────
|
|
16
|
-
|
|
17
|
-
/** Default fallback context window when neither config nor model provides a value. */
|
|
18
|
-
export const FALLBACK_CONTEXT_WINDOW: number = 200_000;
|
|
19
|
-
|
|
20
|
-
// ── Context Window Resolution ─────────────────────────────────────────
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Resolve the effective context window size for worker spawning.
|
|
24
|
-
*
|
|
25
|
-
* Resolution order (first non-zero value wins):
|
|
26
|
-
* 1. Explicit user config (configuredWindow > 0)
|
|
27
|
-
* 2. Auto-detect from pi model registry (ctx.model.contextWindow)
|
|
28
|
-
* 3. Fallback to 200K tokens
|
|
29
|
-
*
|
|
30
|
-
* A configuredWindow of 0 (or undefined) signals "auto-detect" — the default
|
|
31
|
-
* when no explicit value is configured. This allows pi's model registry to
|
|
32
|
-
* provide the real context window for the active model.
|
|
33
|
-
*
|
|
34
|
-
* @param configuredWindow - The `worker_context_window` from config (0 = auto-detect)
|
|
35
|
-
* @param ctx - The pi ExtensionContext for model registry auto-detection, or null
|
|
36
|
-
* @returns Object with `contextWindow` (resolved size) and `source` (diagnostic label)
|
|
37
|
-
*
|
|
38
|
-
* @example
|
|
39
|
-
* // With explicit config
|
|
40
|
-
* resolveContextWindow(500_000, ctx) // → { contextWindow: 500000, source: "explicit config" }
|
|
41
|
-
*
|
|
42
|
-
* // With auto-detect (config = 0)
|
|
43
|
-
* resolveContextWindow(0, ctx) // → { contextWindow: 200000, source: "auto-detected from anthropic/claude-opus-4-6" }
|
|
44
|
-
*
|
|
45
|
-
* // With fallback (no config, no model)
|
|
46
|
-
* resolveContextWindow(undefined, null) // → { contextWindow: 200000, source: "fallback 200000" }
|
|
47
|
-
*/
|
|
48
|
-
export function resolveContextWindow(
|
|
49
|
-
configuredWindow: number | undefined,
|
|
50
|
-
ctx: ExtensionContext | null,
|
|
51
|
-
): { contextWindow: number; source: string } {
|
|
52
|
-
// 1. Explicit user config — non-zero means the user set it deliberately
|
|
53
|
-
if (configuredWindow && configuredWindow > 0) {
|
|
54
|
-
return { contextWindow: configuredWindow, source: "explicit config" };
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
// 2. Auto-detect from pi model registry
|
|
58
|
-
const modelWindow = ctx?.model?.contextWindow;
|
|
59
|
-
if (modelWindow && modelWindow > 0) {
|
|
60
|
-
const modelId = ctx?.model ? `${ctx.model.provider}/${ctx.model.id}` : "unknown";
|
|
61
|
-
return { contextWindow: modelWindow, source: `auto-detected from ${modelId}` };
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
// 3. Fallback
|
|
65
|
-
return { contextWindow: FALLBACK_CONTEXT_WINDOW, source: `fallback ${FALLBACK_CONTEXT_WINDOW}` };
|
|
66
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* Context Window Resolution Utilities
|
|
3
|
+
*
|
|
4
|
+
* Canonical home for context window resolution logic used when spawning workers.
|
|
5
|
+
*
|
|
6
|
+
* The original `resolveContextWindow(config: TaskConfig, ctx: ExtensionContext)` signature
|
|
7
|
+
* has been adapted to accept only the fields it actually uses, avoiding a dependency
|
|
8
|
+
* on the task-runner-internal `TaskConfig` type. Behavior is identical.
|
|
9
|
+
*
|
|
10
|
+
* @since TP-161
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import type { ExtensionContext } from "@mariozechner/pi-coding-agent";
|
|
14
|
+
|
|
15
|
+
// ── Context Window Constants ──────────────────────────────────────────
|
|
16
|
+
|
|
17
|
+
/** Default fallback context window when neither config nor model provides a value. */
|
|
18
|
+
export const FALLBACK_CONTEXT_WINDOW: number = 200_000;
|
|
19
|
+
|
|
20
|
+
// ── Context Window Resolution ─────────────────────────────────────────
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Resolve the effective context window size for worker spawning.
|
|
24
|
+
*
|
|
25
|
+
* Resolution order (first non-zero value wins):
|
|
26
|
+
* 1. Explicit user config (configuredWindow > 0)
|
|
27
|
+
* 2. Auto-detect from pi model registry (ctx.model.contextWindow)
|
|
28
|
+
* 3. Fallback to 200K tokens
|
|
29
|
+
*
|
|
30
|
+
* A configuredWindow of 0 (or undefined) signals "auto-detect" — the default
|
|
31
|
+
* when no explicit value is configured. This allows pi's model registry to
|
|
32
|
+
* provide the real context window for the active model.
|
|
33
|
+
*
|
|
34
|
+
* @param configuredWindow - The `worker_context_window` from config (0 = auto-detect)
|
|
35
|
+
* @param ctx - The pi ExtensionContext for model registry auto-detection, or null
|
|
36
|
+
* @returns Object with `contextWindow` (resolved size) and `source` (diagnostic label)
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* // With explicit config
|
|
40
|
+
* resolveContextWindow(500_000, ctx) // → { contextWindow: 500000, source: "explicit config" }
|
|
41
|
+
*
|
|
42
|
+
* // With auto-detect (config = 0)
|
|
43
|
+
* resolveContextWindow(0, ctx) // → { contextWindow: 200000, source: "auto-detected from anthropic/claude-opus-4-6" }
|
|
44
|
+
*
|
|
45
|
+
* // With fallback (no config, no model)
|
|
46
|
+
* resolveContextWindow(undefined, null) // → { contextWindow: 200000, source: "fallback 200000" }
|
|
47
|
+
*/
|
|
48
|
+
export function resolveContextWindow(
|
|
49
|
+
configuredWindow: number | undefined,
|
|
50
|
+
ctx: ExtensionContext | null,
|
|
51
|
+
): { contextWindow: number; source: string } {
|
|
52
|
+
// 1. Explicit user config — non-zero means the user set it deliberately
|
|
53
|
+
if (configuredWindow && configuredWindow > 0) {
|
|
54
|
+
return { contextWindow: configuredWindow, source: "explicit config" };
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// 2. Auto-detect from pi model registry
|
|
58
|
+
const modelWindow = ctx?.model?.contextWindow;
|
|
59
|
+
if (modelWindow && modelWindow > 0) {
|
|
60
|
+
const modelId = ctx?.model ? `${ctx.model.provider}/${ctx.model.id}` : "unknown";
|
|
61
|
+
return { contextWindow: modelWindow, source: `auto-detected from ${modelId}` };
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// 3. Fallback
|
|
65
|
+
return { contextWindow: FALLBACK_CONTEXT_WINDOW, source: `fallback ${FALLBACK_CONTEXT_WINDOW}` };
|
|
66
|
+
}
|