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.
Files changed (71) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +215 -215
  3. package/bin/gitignore-patterns.mjs +79 -79
  4. package/bin/rpc-wrapper.mjs +1086 -1086
  5. package/bin/taskplane.mjs +3254 -3254
  6. package/dashboard/public/app.js +2573 -2573
  7. package/dashboard/public/index.html +139 -139
  8. package/dashboard/public/style.css +1882 -1882
  9. package/dashboard/public/taskplane-word-color.svg +18 -18
  10. package/dashboard/public/taskplane-word-white.svg +18 -18
  11. package/dashboard/server.cjs +1666 -1666
  12. package/extensions/reviewer-extension.ts +119 -119
  13. package/extensions/task-orchestrator.ts +28 -28
  14. package/extensions/taskplane/abort.ts +502 -502
  15. package/extensions/taskplane/agent-bridge-extension.ts +838 -765
  16. package/extensions/taskplane/agent-host.ts +833 -745
  17. package/extensions/taskplane/cleanup.ts +747 -747
  18. package/extensions/taskplane/config-loader.ts +1328 -1322
  19. package/extensions/taskplane/config-schema.ts +692 -682
  20. package/extensions/taskplane/config.ts +73 -73
  21. package/extensions/taskplane/context-window.ts +66 -66
  22. package/extensions/taskplane/diagnostic-reports.ts +463 -463
  23. package/extensions/taskplane/diagnostics.ts +385 -385
  24. package/extensions/taskplane/engine-worker-entry.mjs +34 -34
  25. package/extensions/taskplane/engine-worker.ts +381 -381
  26. package/extensions/taskplane/engine.ts +4539 -4527
  27. package/extensions/taskplane/execution.ts +2733 -2708
  28. package/extensions/taskplane/extension.ts +30 -9
  29. package/extensions/taskplane/formatting.ts +773 -773
  30. package/extensions/taskplane/git.ts +90 -90
  31. package/extensions/taskplane/index.ts +28 -28
  32. package/extensions/taskplane/lane-runner.ts +1383 -1360
  33. package/extensions/taskplane/mailbox.ts +689 -689
  34. package/extensions/taskplane/merge.ts +3135 -3135
  35. package/extensions/taskplane/messages.ts +985 -985
  36. package/extensions/taskplane/migrations.ts +278 -278
  37. package/extensions/taskplane/naming.ts +117 -117
  38. package/extensions/taskplane/path-resolver.ts +237 -237
  39. package/extensions/taskplane/persistence.ts +2087 -2087
  40. package/extensions/taskplane/process-registry.ts +416 -416
  41. package/extensions/taskplane/quality-gate.ts +1033 -1033
  42. package/extensions/taskplane/resume.ts +2879 -2878
  43. package/extensions/taskplane/sessions.ts +57 -57
  44. package/extensions/taskplane/settings-loader.ts +136 -136
  45. package/extensions/taskplane/settings-tui.ts +1867 -1867
  46. package/extensions/taskplane/sidecar-telemetry.ts +252 -252
  47. package/extensions/taskplane/supervisor-primer.md +1694 -1694
  48. package/extensions/taskplane/supervisor.ts +4341 -4341
  49. package/extensions/taskplane/task-executor-core.ts +550 -550
  50. package/extensions/taskplane/tmux-compat.ts +37 -37
  51. package/extensions/taskplane/types.ts +4297 -4278
  52. package/extensions/taskplane/verification.ts +542 -542
  53. package/extensions/taskplane/waves.ts +1548 -1548
  54. package/extensions/taskplane/workspace.ts +705 -705
  55. package/extensions/taskplane/worktree.ts +2604 -2505
  56. package/package.json +57 -57
  57. package/skills/create-taskplane-task/SKILL.md +465 -465
  58. package/skills/create-taskplane-task/references/prompt-template.md +285 -285
  59. package/templates/agents/local/supervisor.md +33 -33
  60. package/templates/agents/local/task-merger.md +27 -27
  61. package/templates/agents/local/task-reviewer.md +30 -30
  62. package/templates/agents/local/task-worker.md +34 -34
  63. package/templates/agents/supervisor-routing.md +92 -92
  64. package/templates/agents/supervisor.md +168 -168
  65. package/templates/agents/task-merger.md +214 -214
  66. package/templates/agents/task-reviewer.md +192 -192
  67. package/templates/agents/task-worker.md +505 -429
  68. package/templates/tasks/EXAMPLE-001-hello-world/PROMPT.md +98 -98
  69. package/templates/tasks/EXAMPLE-001-hello-world/STATUS.md +73 -73
  70. package/templates/tasks/EXAMPLE-002-parallel-smoke/PROMPT.md +97 -97
  71. 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
+ }