taskplane 0.28.4 → 0.28.5
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 +765 -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 +429 -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,117 +1,117 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Naming contract helpers for team-scale collision resistance.
|
|
3
|
-
*
|
|
4
|
-
* Provides deterministic, human-readable identifiers for lane session IDs,
|
|
5
|
-
* worktree directories, git branches, and merge artifacts. All naming
|
|
6
|
-
* components are sanitized for safe use in filesystem paths, git refs,
|
|
7
|
-
* and tmux-compatible session IDs.
|
|
8
|
-
*
|
|
9
|
-
* @module orch/naming
|
|
10
|
-
*/
|
|
11
|
-
import { basename, resolve } from "path";
|
|
12
|
-
import { userInfo } from "os";
|
|
13
|
-
|
|
14
|
-
import type { OrchestratorConfig } from "./types.ts";
|
|
15
|
-
|
|
16
|
-
// ── Sanitization ─────────────────────────────────────────────────────
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Sanitize a raw string into a safe naming component.
|
|
20
|
-
*
|
|
21
|
-
* Rules:
|
|
22
|
-
* - Lowercase
|
|
23
|
-
* - Replace non-alphanumeric characters (except hyphens) with hyphens
|
|
24
|
-
* - Collapse consecutive hyphens
|
|
25
|
-
* - Trim leading/trailing hyphens
|
|
26
|
-
* - Truncate to `maxLen` characters
|
|
27
|
-
*
|
|
28
|
-
* Safe for use in: lane session IDs, git branch refs, filesystem paths.
|
|
29
|
-
*
|
|
30
|
-
* @param raw - Raw input string
|
|
31
|
-
* @param maxLen - Maximum length (default: 16)
|
|
32
|
-
* @returns Sanitized string, or empty string if input sanitizes to nothing
|
|
33
|
-
*/
|
|
34
|
-
export function sanitizeNameComponent(raw: string, maxLen: number = 16): string {
|
|
35
|
-
return raw
|
|
36
|
-
.toLowerCase()
|
|
37
|
-
.replace(/[^a-z0-9-]/g, "-")
|
|
38
|
-
.replace(/-+/g, "-")
|
|
39
|
-
.replace(/^-+|-+$/g, "")
|
|
40
|
-
.slice(0, maxLen);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
// ── Operator ID ──────────────────────────────────────────────────────
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* Resolve the operator identifier from available sources.
|
|
47
|
-
*
|
|
48
|
-
* Resolution order (first non-empty wins):
|
|
49
|
-
* 1. `TASKPLANE_OPERATOR_ID` environment variable
|
|
50
|
-
* 2. `operator_id` field in OrchestratorConfig
|
|
51
|
-
* 3. Current OS username via `os.userInfo().username`
|
|
52
|
-
* 4. Fallback: `"op"`
|
|
53
|
-
*
|
|
54
|
-
* The resolved value is sanitized and truncated to 12 characters.
|
|
55
|
-
*
|
|
56
|
-
* @param config - Orchestrator configuration (may contain operator_id)
|
|
57
|
-
* @param env - Environment variables (defaults to process.env)
|
|
58
|
-
* @returns Sanitized operator identifier (never empty)
|
|
59
|
-
*/
|
|
60
|
-
export function resolveOperatorId(
|
|
61
|
-
config: OrchestratorConfig,
|
|
62
|
-
env: Record<string, string | undefined> = process.env,
|
|
63
|
-
): string {
|
|
64
|
-
const FALLBACK = "op";
|
|
65
|
-
const MAX_LEN = 12;
|
|
66
|
-
|
|
67
|
-
// 1. Environment variable
|
|
68
|
-
const envValue = env.TASKPLANE_OPERATOR_ID;
|
|
69
|
-
if (envValue && envValue.trim()) {
|
|
70
|
-
const sanitized = sanitizeNameComponent(envValue.trim(), MAX_LEN);
|
|
71
|
-
if (sanitized) return sanitized;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
// 2. Config field
|
|
75
|
-
const configValue = config.orchestrator.operator_id;
|
|
76
|
-
if (configValue && configValue.trim()) {
|
|
77
|
-
const sanitized = sanitizeNameComponent(configValue.trim(), MAX_LEN);
|
|
78
|
-
if (sanitized) return sanitized;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
// 3. OS username
|
|
82
|
-
try {
|
|
83
|
-
const username = userInfo().username;
|
|
84
|
-
if (username && username.trim()) {
|
|
85
|
-
const sanitized = sanitizeNameComponent(username.trim(), MAX_LEN);
|
|
86
|
-
if (sanitized) return sanitized;
|
|
87
|
-
}
|
|
88
|
-
} catch {
|
|
89
|
-
// userInfo() can throw on some platforms
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
// 4. Fallback
|
|
93
|
-
return FALLBACK;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
// ── Repo Slug ────────────────────────────────────────────────────────
|
|
97
|
-
|
|
98
|
-
/**
|
|
99
|
-
* Derive a repo slug from the repository root directory name.
|
|
100
|
-
*
|
|
101
|
-
* Provides cross-repo disambiguation when multiple repos share the
|
|
102
|
-
* same machine. Used in lane session IDs and worktree paths where
|
|
103
|
-
* names must be globally unique on the machine.
|
|
104
|
-
*
|
|
105
|
-
* @param repoRoot - Absolute path to the repository root
|
|
106
|
-
* @returns Sanitized repo slug (never empty; falls back to "repo")
|
|
107
|
-
*/
|
|
108
|
-
export function resolveRepoSlug(repoRoot: string): string {
|
|
109
|
-
const FALLBACK = "repo";
|
|
110
|
-
const MAX_LEN = 16;
|
|
111
|
-
|
|
112
|
-
const dirName = basename(resolve(repoRoot));
|
|
113
|
-
if (!dirName) return FALLBACK;
|
|
114
|
-
|
|
115
|
-
const sanitized = sanitizeNameComponent(dirName, MAX_LEN);
|
|
116
|
-
return sanitized || FALLBACK;
|
|
117
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* Naming contract helpers for team-scale collision resistance.
|
|
3
|
+
*
|
|
4
|
+
* Provides deterministic, human-readable identifiers for lane session IDs,
|
|
5
|
+
* worktree directories, git branches, and merge artifacts. All naming
|
|
6
|
+
* components are sanitized for safe use in filesystem paths, git refs,
|
|
7
|
+
* and tmux-compatible session IDs.
|
|
8
|
+
*
|
|
9
|
+
* @module orch/naming
|
|
10
|
+
*/
|
|
11
|
+
import { basename, resolve } from "path";
|
|
12
|
+
import { userInfo } from "os";
|
|
13
|
+
|
|
14
|
+
import type { OrchestratorConfig } from "./types.ts";
|
|
15
|
+
|
|
16
|
+
// ── Sanitization ─────────────────────────────────────────────────────
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Sanitize a raw string into a safe naming component.
|
|
20
|
+
*
|
|
21
|
+
* Rules:
|
|
22
|
+
* - Lowercase
|
|
23
|
+
* - Replace non-alphanumeric characters (except hyphens) with hyphens
|
|
24
|
+
* - Collapse consecutive hyphens
|
|
25
|
+
* - Trim leading/trailing hyphens
|
|
26
|
+
* - Truncate to `maxLen` characters
|
|
27
|
+
*
|
|
28
|
+
* Safe for use in: lane session IDs, git branch refs, filesystem paths.
|
|
29
|
+
*
|
|
30
|
+
* @param raw - Raw input string
|
|
31
|
+
* @param maxLen - Maximum length (default: 16)
|
|
32
|
+
* @returns Sanitized string, or empty string if input sanitizes to nothing
|
|
33
|
+
*/
|
|
34
|
+
export function sanitizeNameComponent(raw: string, maxLen: number = 16): string {
|
|
35
|
+
return raw
|
|
36
|
+
.toLowerCase()
|
|
37
|
+
.replace(/[^a-z0-9-]/g, "-")
|
|
38
|
+
.replace(/-+/g, "-")
|
|
39
|
+
.replace(/^-+|-+$/g, "")
|
|
40
|
+
.slice(0, maxLen);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// ── Operator ID ──────────────────────────────────────────────────────
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Resolve the operator identifier from available sources.
|
|
47
|
+
*
|
|
48
|
+
* Resolution order (first non-empty wins):
|
|
49
|
+
* 1. `TASKPLANE_OPERATOR_ID` environment variable
|
|
50
|
+
* 2. `operator_id` field in OrchestratorConfig
|
|
51
|
+
* 3. Current OS username via `os.userInfo().username`
|
|
52
|
+
* 4. Fallback: `"op"`
|
|
53
|
+
*
|
|
54
|
+
* The resolved value is sanitized and truncated to 12 characters.
|
|
55
|
+
*
|
|
56
|
+
* @param config - Orchestrator configuration (may contain operator_id)
|
|
57
|
+
* @param env - Environment variables (defaults to process.env)
|
|
58
|
+
* @returns Sanitized operator identifier (never empty)
|
|
59
|
+
*/
|
|
60
|
+
export function resolveOperatorId(
|
|
61
|
+
config: OrchestratorConfig,
|
|
62
|
+
env: Record<string, string | undefined> = process.env,
|
|
63
|
+
): string {
|
|
64
|
+
const FALLBACK = "op";
|
|
65
|
+
const MAX_LEN = 12;
|
|
66
|
+
|
|
67
|
+
// 1. Environment variable
|
|
68
|
+
const envValue = env.TASKPLANE_OPERATOR_ID;
|
|
69
|
+
if (envValue && envValue.trim()) {
|
|
70
|
+
const sanitized = sanitizeNameComponent(envValue.trim(), MAX_LEN);
|
|
71
|
+
if (sanitized) return sanitized;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// 2. Config field
|
|
75
|
+
const configValue = config.orchestrator.operator_id;
|
|
76
|
+
if (configValue && configValue.trim()) {
|
|
77
|
+
const sanitized = sanitizeNameComponent(configValue.trim(), MAX_LEN);
|
|
78
|
+
if (sanitized) return sanitized;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
// 3. OS username
|
|
82
|
+
try {
|
|
83
|
+
const username = userInfo().username;
|
|
84
|
+
if (username && username.trim()) {
|
|
85
|
+
const sanitized = sanitizeNameComponent(username.trim(), MAX_LEN);
|
|
86
|
+
if (sanitized) return sanitized;
|
|
87
|
+
}
|
|
88
|
+
} catch {
|
|
89
|
+
// userInfo() can throw on some platforms
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
// 4. Fallback
|
|
93
|
+
return FALLBACK;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
// ── Repo Slug ────────────────────────────────────────────────────────
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Derive a repo slug from the repository root directory name.
|
|
100
|
+
*
|
|
101
|
+
* Provides cross-repo disambiguation when multiple repos share the
|
|
102
|
+
* same machine. Used in lane session IDs and worktree paths where
|
|
103
|
+
* names must be globally unique on the machine.
|
|
104
|
+
*
|
|
105
|
+
* @param repoRoot - Absolute path to the repository root
|
|
106
|
+
* @returns Sanitized repo slug (never empty; falls back to "repo")
|
|
107
|
+
*/
|
|
108
|
+
export function resolveRepoSlug(repoRoot: string): string {
|
|
109
|
+
const FALLBACK = "repo";
|
|
110
|
+
const MAX_LEN = 16;
|
|
111
|
+
|
|
112
|
+
const dirName = basename(resolve(repoRoot));
|
|
113
|
+
if (!dirName) return FALLBACK;
|
|
114
|
+
|
|
115
|
+
const sanitized = sanitizeNameComponent(dirName, MAX_LEN);
|
|
116
|
+
return sanitized || FALLBACK;
|
|
117
|
+
}
|