agentplane 0.3.16 → 0.3.17
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/dist/.build-manifest.json +159 -54
- package/dist/backends/task-backend/redmine/backend-runtime.d.ts +4 -146
- package/dist/backends/task-backend/redmine/backend-runtime.d.ts.map +1 -1
- package/dist/backends/task-backend/redmine/backend-runtime.js +4 -258
- package/dist/backends/task-backend/redmine/mapping.js +1 -1
- package/dist/backends/task-backend/redmine/runtime-context.d.ts +98 -0
- package/dist/backends/task-backend/redmine/runtime-context.d.ts.map +1 -0
- package/dist/backends/task-backend/redmine/runtime-context.js +57 -0
- package/dist/backends/task-backend/redmine/runtime-methods.d.ts +33 -0
- package/dist/backends/task-backend/redmine/runtime-methods.d.ts.map +1 -0
- package/dist/backends/task-backend/redmine/runtime-methods.js +86 -0
- package/dist/backends/task-backend/redmine/runtime-operations.d.ts +19 -0
- package/dist/backends/task-backend/redmine/runtime-operations.d.ts.map +1 -0
- package/dist/backends/task-backend/redmine/runtime-operations.js +83 -0
- package/dist/backends/task-backend/redmine/runtime-state.d.ts +10 -0
- package/dist/backends/task-backend/redmine/runtime-state.d.ts.map +1 -0
- package/dist/backends/task-backend/redmine/runtime-state.js +45 -0
- package/dist/backends/task-backend/shared/constants.d.ts +1 -1
- package/dist/backends/task-backend/shared/constants.d.ts.map +1 -1
- package/dist/backends/task-backend/shared/constants.js +1 -1
- package/dist/backends/task-index.d.ts +0 -4
- package/dist/backends/task-index.d.ts.map +1 -1
- package/dist/backends/task-index.js +0 -33
- package/dist/cli/exit-codes.d.ts.map +1 -1
- package/dist/cli/exit-codes.js +1 -0
- package/dist/cli/http.d.ts.map +1 -1
- package/dist/cli/http.js +34 -15
- package/dist/cli/run-cli/command-loaders.d.ts +1 -5
- package/dist/cli/run-cli/command-loaders.d.ts.map +1 -1
- package/dist/cli/spec/errors.d.ts +5 -0
- package/dist/cli/spec/errors.d.ts.map +1 -1
- package/dist/cli/spec/errors.js +14 -1
- package/dist/cli/spec/parse.d.ts.map +1 -1
- package/dist/cli/spec/parse.js +8 -1
- package/dist/commands/branch/work-start.d.ts.map +1 -1
- package/dist/commands/branch/work-start.direct.d.ts +13 -0
- package/dist/commands/branch/work-start.direct.d.ts.map +1 -0
- package/dist/commands/branch/work-start.direct.js +75 -0
- package/dist/commands/branch/work-start.git.d.ts +3 -0
- package/dist/commands/branch/work-start.git.d.ts.map +1 -0
- package/dist/commands/branch/work-start.git.js +19 -0
- package/dist/commands/branch/work-start.hook-shim.d.ts +2 -0
- package/dist/commands/branch/work-start.hook-shim.d.ts.map +1 -0
- package/dist/commands/branch/work-start.hook-shim.js +38 -0
- package/dist/commands/branch/work-start.js +6 -235
- package/dist/commands/branch/work-start.materialize.d.ts +16 -0
- package/dist/commands/branch/work-start.materialize.d.ts.map +1 -0
- package/dist/commands/branch/work-start.materialize.js +110 -0
- package/dist/commands/doctor/fixes.d.ts +0 -5
- package/dist/commands/doctor/fixes.d.ts.map +1 -1
- package/dist/commands/doctor/fixes.js +0 -70
- package/dist/commands/doctor/workflow.d.ts.map +1 -1
- package/dist/commands/doctor/workflow.js +2 -23
- package/dist/commands/doctor.run.d.ts.map +1 -1
- package/dist/commands/doctor.run.js +1 -3
- package/dist/commands/hooks/index.d.ts +4 -20
- package/dist/commands/hooks/index.d.ts.map +1 -1
- package/dist/commands/hooks/index.js +4 -432
- package/dist/commands/hooks/install.d.ts +11 -0
- package/dist/commands/hooks/install.d.ts.map +1 -0
- package/dist/commands/hooks/install.js +136 -0
- package/dist/commands/hooks/run.commit-msg.d.ts +3 -0
- package/dist/commands/hooks/run.commit-msg.d.ts.map +1 -0
- package/dist/commands/hooks/run.commit-msg.js +67 -0
- package/dist/commands/hooks/run.d.ts +9 -0
- package/dist/commands/hooks/run.d.ts.map +1 -0
- package/dist/commands/hooks/run.js +45 -0
- package/dist/commands/hooks/run.post-merge.d.ts +3 -0
- package/dist/commands/hooks/run.post-merge.d.ts.map +1 -0
- package/dist/commands/hooks/run.post-merge.js +44 -0
- package/dist/commands/hooks/run.pre-commit.d.ts +3 -0
- package/dist/commands/hooks/run.pre-commit.d.ts.map +1 -0
- package/dist/commands/hooks/run.pre-commit.js +48 -0
- package/dist/commands/hooks/run.pre-push.d.ts +6 -0
- package/dist/commands/hooks/run.pre-push.d.ts.map +1 -0
- package/dist/commands/hooks/run.pre-push.js +88 -0
- package/dist/commands/hooks/shared.d.ts +7 -0
- package/dist/commands/hooks/shared.d.ts.map +1 -0
- package/dist/commands/hooks/shared.js +41 -0
- package/dist/commands/recipes/impl/index.d.ts.map +1 -1
- package/dist/commands/recipes/impl/index.js +13 -3
- package/dist/commands/task/hosted-close-pr.command.d.ts +2 -7
- package/dist/commands/task/hosted-close-pr.command.d.ts.map +1 -1
- package/dist/commands/task/hosted-close-pr.command.js +9 -373
- package/dist/commands/task/hosted-close-pr.execute.d.ts +3 -0
- package/dist/commands/task/hosted-close-pr.execute.d.ts.map +1 -0
- package/dist/commands/task/hosted-close-pr.execute.js +135 -0
- package/dist/commands/task/hosted-close-pr.postcheck.d.ts +3 -0
- package/dist/commands/task/hosted-close-pr.postcheck.d.ts.map +1 -0
- package/dist/commands/task/hosted-close-pr.postcheck.js +13 -0
- package/dist/commands/task/hosted-close-pr.precheck.d.ts +4 -0
- package/dist/commands/task/hosted-close-pr.precheck.d.ts.map +1 -0
- package/dist/commands/task/hosted-close-pr.precheck.js +288 -0
- package/dist/commands/task/hosted-close-pr.report.d.ts +4 -0
- package/dist/commands/task/hosted-close-pr.report.d.ts.map +1 -0
- package/dist/commands/task/hosted-close-pr.report.js +42 -0
- package/dist/commands/task/hosted-close-pr.types.d.ts +75 -0
- package/dist/commands/task/hosted-close-pr.types.d.ts.map +1 -0
- package/dist/commands/task/hosted-close-pr.types.js +1 -0
- package/dist/commands/upgrade/materialize.d.ts.map +1 -1
- package/dist/commands/upgrade/materialize.js +0 -7
- package/dist/commands/upgrade/source.d.ts +0 -1
- package/dist/commands/upgrade/source.d.ts.map +1 -1
- package/dist/commands/upgrade/source.js +1 -9
- package/dist/runner/context/base-prompts.d.ts.map +1 -1
- package/dist/runner/context/base-prompts.js +4 -0
- package/dist/runner/context/project-skill-prompt-blocks.d.ts +5 -0
- package/dist/runner/context/project-skill-prompt-blocks.d.ts.map +1 -0
- package/dist/runner/context/project-skill-prompt-blocks.js +57 -0
- package/dist/runner/process-supervision/run.d.ts.map +1 -1
- package/dist/runner/process-supervision/run.js +61 -59
- package/dist/shared/errors.d.ts +4 -1
- package/dist/shared/errors.d.ts.map +1 -1
- package/dist/shared/errors.js +6 -0
- package/dist/shared/workflow-artifacts.d.ts.map +1 -1
- package/dist/shared/workflow-artifacts.js +1 -8
- package/dist/workflow-runtime/file-ops.d.ts.map +1 -1
- package/dist/workflow-runtime/file-ops.js +1 -20
- package/dist/workflow-runtime/paths.d.ts.map +1 -1
- package/dist/workflow-runtime/paths.js +0 -1
- package/dist/workflow-runtime/types.d.ts +0 -1
- package/dist/workflow-runtime/types.d.ts.map +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { chmod, mkdir, writeFile } from "node:fs/promises";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { fileExists } from "../../cli/fs-utils.js";
|
|
4
|
+
const HOOK_SHIM_MARKER = "agentplane-hook-shim";
|
|
5
|
+
function repoLocalHookShimText() {
|
|
6
|
+
return [
|
|
7
|
+
"#!/usr/bin/env sh",
|
|
8
|
+
`# ${HOOK_SHIM_MARKER} (do not edit)`,
|
|
9
|
+
"set -e",
|
|
10
|
+
'SCRIPT_DIR="$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)"',
|
|
11
|
+
'REPO_ROOT="$(dirname "$(dirname "$SCRIPT_DIR")")"',
|
|
12
|
+
'LOCAL_BIN="$REPO_ROOT/packages/agentplane/bin/agentplane.js"',
|
|
13
|
+
'if command -v node >/dev/null 2>&1 && [ -f "$LOCAL_BIN" ]; then',
|
|
14
|
+
' exec node "$LOCAL_BIN" "$@"',
|
|
15
|
+
"fi",
|
|
16
|
+
'ENV_BIN="${AGENTPLANE_HOOK_RUNNER:-}"',
|
|
17
|
+
'if [ -n "$ENV_BIN" ] && command -v node >/dev/null 2>&1 && [ -f "$ENV_BIN" ]; then',
|
|
18
|
+
' exec node "$ENV_BIN" "$@"',
|
|
19
|
+
"fi",
|
|
20
|
+
"if command -v agentplane >/dev/null 2>&1; then",
|
|
21
|
+
' exec agentplane "$@"',
|
|
22
|
+
"fi",
|
|
23
|
+
"if command -v npx >/dev/null 2>&1; then",
|
|
24
|
+
' exec npx --yes agentplane "$@"',
|
|
25
|
+
"fi",
|
|
26
|
+
'echo "agentplane shim: runner not found (need env runner, repo-local source, agentplane in PATH, or node+npx)." >&2',
|
|
27
|
+
" exit 127",
|
|
28
|
+
"",
|
|
29
|
+
].join("\n");
|
|
30
|
+
}
|
|
31
|
+
export async function materializeHookShimForWorktree(worktreePath) {
|
|
32
|
+
const shimPath = path.join(worktreePath, ".agentplane", "bin", "agentplane");
|
|
33
|
+
if (await fileExists(shimPath))
|
|
34
|
+
return;
|
|
35
|
+
await mkdir(path.dirname(shimPath), { recursive: true });
|
|
36
|
+
await writeFile(shimPath, repoLocalHookShimText(), "utf8");
|
|
37
|
+
await chmod(shimPath, 0o755);
|
|
38
|
+
}
|
|
@@ -1,249 +1,20 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { mkdir } from "node:fs/promises";
|
|
2
2
|
import path from "node:path";
|
|
3
|
-
import { resolveBaseBranch } from "@agentplaneorg/core";
|
|
4
|
-
import { LocalBackend } from "../../backends/task-backend.js";
|
|
5
3
|
import { mapBackendError } from "../../cli/error-map.js";
|
|
6
4
|
import { fileExists } from "../../cli/fs-utils.js";
|
|
7
5
|
import { exitCodeForError } from "../../cli/exit-codes.js";
|
|
8
6
|
import { createCliEmitter } from "../../cli/output.js";
|
|
9
7
|
import { CliError } from "../../shared/errors.js";
|
|
10
8
|
import { execFileAsync, gitEnv } from "../shared/git.js";
|
|
11
|
-
import {
|
|
12
|
-
import { gitBranchExists, gitBranchUpstream, gitCurrentBranch } from "../shared/git-ops.js";
|
|
9
|
+
import { gitBranchExists, gitCurrentBranch } from "../shared/git-ops.js";
|
|
13
10
|
import { isPathWithin } from "../shared/path.js";
|
|
14
|
-
import { resolveRuntimeSourceInfo } from "../../runtime/shared/runtime-source.js";
|
|
15
11
|
import { loadBackendTask, loadCommandContext, } from "../shared/task-backend.js";
|
|
16
|
-
function isPresentString(value) {
|
|
17
|
-
return value !== null;
|
|
18
|
-
}
|
|
19
12
|
import { ensurePlanApprovedIfRequired } from "../task/shared.js";
|
|
20
13
|
import { validateWorkAgent, validateWorkSlug } from "./internal/work-validate.js";
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
`# ${HOOK_SHIM_MARKER} (do not edit)`,
|
|
26
|
-
"set -e",
|
|
27
|
-
'SCRIPT_DIR="$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)"',
|
|
28
|
-
'REPO_ROOT="$(dirname "$(dirname "$SCRIPT_DIR")")"',
|
|
29
|
-
'LOCAL_BIN="$REPO_ROOT/packages/agentplane/bin/agentplane.js"',
|
|
30
|
-
'if command -v node >/dev/null 2>&1 && [ -f "$LOCAL_BIN" ]; then',
|
|
31
|
-
' exec node "$LOCAL_BIN" "$@"',
|
|
32
|
-
"fi",
|
|
33
|
-
'ENV_BIN="${AGENTPLANE_HOOK_RUNNER:-}"',
|
|
34
|
-
'if [ -n "$ENV_BIN" ] && command -v node >/dev/null 2>&1 && [ -f "$ENV_BIN" ]; then',
|
|
35
|
-
' exec node "$ENV_BIN" "$@"',
|
|
36
|
-
"fi",
|
|
37
|
-
"if command -v agentplane >/dev/null 2>&1; then",
|
|
38
|
-
' exec agentplane "$@"',
|
|
39
|
-
"fi",
|
|
40
|
-
"if command -v npx >/dev/null 2>&1; then",
|
|
41
|
-
' exec npx --yes agentplane "$@"',
|
|
42
|
-
"fi",
|
|
43
|
-
'echo "agentplane shim: runner not found (need env runner, repo-local source, agentplane in PATH, or node+npx)." >&2',
|
|
44
|
-
" exit 127",
|
|
45
|
-
"",
|
|
46
|
-
].join("\n");
|
|
47
|
-
}
|
|
48
|
-
function directWorkLockPath(agentplaneDir) {
|
|
49
|
-
// Intentionally under cache/ so it stays out of git by default.
|
|
50
|
-
return path.join(agentplaneDir, "cache", "direct-work.json");
|
|
51
|
-
}
|
|
52
|
-
async function readDirectWorkLock(agentplaneDir) {
|
|
53
|
-
try {
|
|
54
|
-
const text = await readFile(directWorkLockPath(agentplaneDir), "utf8");
|
|
55
|
-
const parsed = JSON.parse(text);
|
|
56
|
-
if (!parsed || typeof parsed !== "object")
|
|
57
|
-
return null;
|
|
58
|
-
if (typeof parsed.task_id !== "string" ||
|
|
59
|
-
typeof parsed.agent !== "string" ||
|
|
60
|
-
typeof parsed.slug !== "string" ||
|
|
61
|
-
typeof parsed.branch !== "string" ||
|
|
62
|
-
typeof parsed.started_at !== "string") {
|
|
63
|
-
return null;
|
|
64
|
-
}
|
|
65
|
-
return parsed;
|
|
66
|
-
}
|
|
67
|
-
catch {
|
|
68
|
-
return null;
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
async function writeDirectWorkLock(agentplaneDir, lock) {
|
|
72
|
-
const dir = path.dirname(directWorkLockPath(agentplaneDir));
|
|
73
|
-
await mkdir(dir, { recursive: true });
|
|
74
|
-
await writeFile(directWorkLockPath(agentplaneDir), JSON.stringify(lock, null, 2) + "\n", "utf8");
|
|
75
|
-
}
|
|
76
|
-
async function materializeLocalBackendReadmesForWorktree(opts) {
|
|
77
|
-
if (!(opts.backend instanceof LocalBackend))
|
|
78
|
-
return;
|
|
79
|
-
const sourceRoot = path.resolve(opts.backend.root);
|
|
80
|
-
if (!isPathWithin(opts.repoRoot, sourceRoot))
|
|
81
|
-
return;
|
|
82
|
-
const relativeRoot = path.relative(opts.repoRoot, sourceRoot);
|
|
83
|
-
const targetRoot = path.join(opts.worktreePath, relativeRoot);
|
|
84
|
-
const entries = await readdir(sourceRoot, { withFileTypes: true }).catch(() => []);
|
|
85
|
-
for (const entry of entries) {
|
|
86
|
-
if (!entry.isDirectory())
|
|
87
|
-
continue;
|
|
88
|
-
const sourceTaskRoot = path.join(sourceRoot, entry.name);
|
|
89
|
-
const sourceReadme = path.join(sourceRoot, entry.name, "README.md");
|
|
90
|
-
if (!(await fileExists(sourceReadme)))
|
|
91
|
-
continue;
|
|
92
|
-
const targetReadme = path.join(targetRoot, entry.name, "README.md");
|
|
93
|
-
await mkdir(path.dirname(targetReadme), { recursive: true });
|
|
94
|
-
await copyFile(sourceReadme, targetReadme);
|
|
95
|
-
if (entry.name !== opts.taskId)
|
|
96
|
-
continue;
|
|
97
|
-
// Hand off ownership of the active task README to the task worktree so
|
|
98
|
-
// later merges cannot collide with a stale untracked copy on the base checkout.
|
|
99
|
-
await rm(sourceReadme, { force: true });
|
|
100
|
-
const remainingEntries = await readdir(sourceTaskRoot).catch(() => []);
|
|
101
|
-
if (remainingEntries.length === 0) {
|
|
102
|
-
await rm(sourceTaskRoot, { recursive: true, force: true });
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
async function materializeRepoLocalDistForWorktree(opts) {
|
|
107
|
-
const runtimeSource = resolveRuntimeSourceInfo({ cwd: process.cwd() });
|
|
108
|
-
const sourceRoots = [
|
|
109
|
-
...new Set([
|
|
110
|
-
path.resolve(opts.repoRoot),
|
|
111
|
-
path.resolve(process.cwd()),
|
|
112
|
-
runtimeSource.agentplane.packageRoot
|
|
113
|
-
? path.resolve(runtimeSource.agentplane.packageRoot, "..", "..")
|
|
114
|
-
: null,
|
|
115
|
-
].filter((value) => isPresentString(value))),
|
|
116
|
-
];
|
|
117
|
-
const copyTargets = [
|
|
118
|
-
["packages/core/dist", "packages/core/dist"],
|
|
119
|
-
["packages/agentplane/dist", "packages/agentplane/dist"],
|
|
120
|
-
["packages/agentplane/bin", "packages/agentplane/bin"],
|
|
121
|
-
];
|
|
122
|
-
for (const [sourceRelativePath, targetRelativePath] of copyTargets) {
|
|
123
|
-
let sourcePath = "";
|
|
124
|
-
for (const sourceRoot of sourceRoots) {
|
|
125
|
-
const candidate = path.join(sourceRoot, sourceRelativePath);
|
|
126
|
-
if (await fileExists(candidate)) {
|
|
127
|
-
sourcePath = candidate;
|
|
128
|
-
break;
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
if (!sourcePath)
|
|
132
|
-
continue;
|
|
133
|
-
const targetPath = path.join(opts.worktreePath, targetRelativePath);
|
|
134
|
-
if (await fileExists(targetPath))
|
|
135
|
-
continue;
|
|
136
|
-
await mkdir(path.dirname(targetPath), { recursive: true });
|
|
137
|
-
await cp(sourcePath, targetPath, { recursive: true });
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
async function linkDirectoryIntoWorktree(opts) {
|
|
141
|
-
let sourcePath = "";
|
|
142
|
-
for (const sourceRoot of opts.sourceRoots) {
|
|
143
|
-
const candidate = path.join(sourceRoot, opts.relativePath);
|
|
144
|
-
if (await fileExists(candidate)) {
|
|
145
|
-
sourcePath = candidate;
|
|
146
|
-
break;
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
if (!sourcePath)
|
|
150
|
-
return false;
|
|
151
|
-
const targetPath = path.join(opts.worktreePath, opts.relativePath);
|
|
152
|
-
if (await fileExists(targetPath))
|
|
153
|
-
return false;
|
|
154
|
-
await mkdir(path.dirname(targetPath), { recursive: true });
|
|
155
|
-
await symlink(sourcePath, targetPath, process.platform === "win32" ? "junction" : "dir");
|
|
156
|
-
return true;
|
|
157
|
-
}
|
|
158
|
-
async function materializeRepoLocalInstallLayoutForWorktree(opts) {
|
|
159
|
-
const runtimeSource = resolveRuntimeSourceInfo({ cwd: process.cwd() });
|
|
160
|
-
const sourceRoots = [
|
|
161
|
-
...new Set([
|
|
162
|
-
path.resolve(opts.repoRoot),
|
|
163
|
-
path.resolve(process.cwd()),
|
|
164
|
-
runtimeSource.agentplane.packageRoot
|
|
165
|
-
? path.resolve(runtimeSource.agentplane.packageRoot, "..", "..")
|
|
166
|
-
: null,
|
|
167
|
-
].filter((value) => isPresentString(value))),
|
|
168
|
-
];
|
|
169
|
-
const linkTargets = [
|
|
170
|
-
"node_modules",
|
|
171
|
-
path.join("packages", "core", "node_modules"),
|
|
172
|
-
path.join("packages", "agentplane", "node_modules"),
|
|
173
|
-
"agentplane-recipes",
|
|
174
|
-
];
|
|
175
|
-
for (const relativePath of linkTargets) {
|
|
176
|
-
await linkDirectoryIntoWorktree({
|
|
177
|
-
sourceRoots,
|
|
178
|
-
worktreePath: opts.worktreePath,
|
|
179
|
-
relativePath,
|
|
180
|
-
});
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
async function materializeHookShimForWorktree(worktreePath) {
|
|
184
|
-
const shimPath = path.join(worktreePath, ".agentplane", "bin", "agentplane");
|
|
185
|
-
if (await fileExists(shimPath))
|
|
186
|
-
return;
|
|
187
|
-
await mkdir(path.dirname(shimPath), { recursive: true });
|
|
188
|
-
await writeFile(shimPath, repoLocalHookShimText(), "utf8");
|
|
189
|
-
await chmod(shimPath, 0o755);
|
|
190
|
-
}
|
|
191
|
-
async function ensureGitClean(gitRoot) {
|
|
192
|
-
const { stdout } = await execFileAsync("git", ["status", "--porcelain"], {
|
|
193
|
-
cwd: gitRoot,
|
|
194
|
-
env: gitEnv(),
|
|
195
|
-
});
|
|
196
|
-
const lines = stdout
|
|
197
|
-
.split("\n")
|
|
198
|
-
.map((line) => line.trimEnd())
|
|
199
|
-
.filter((line) => line.trim().length > 0);
|
|
200
|
-
if (lines.length === 0)
|
|
201
|
-
return;
|
|
202
|
-
// Allow task workflow artifacts to be dirty. In direct mode we want a single-stream
|
|
203
|
-
// workflow without task branches, but we still expect task docs to change.
|
|
204
|
-
const allowedPrefixes = [
|
|
205
|
-
".agentplane/tasks/",
|
|
206
|
-
".agentplane/tasks.json",
|
|
207
|
-
".agentplane/cache/",
|
|
208
|
-
".agentplane/.upgrade/",
|
|
209
|
-
".agentplane/upgrade/",
|
|
210
|
-
];
|
|
211
|
-
const isAllowed = (p) => allowedPrefixes.some((prefix) => p.startsWith(prefix));
|
|
212
|
-
const dirty = lines
|
|
213
|
-
.map((line) => {
|
|
214
|
-
// Format: XY <path> (we only need the path-ish tail).
|
|
215
|
-
const rest = line.slice(2).trim();
|
|
216
|
-
if (!rest)
|
|
217
|
-
return "";
|
|
218
|
-
// Rename/copy format: "old -> new"
|
|
219
|
-
const arrow = rest.lastIndexOf(" -> ");
|
|
220
|
-
if (arrow === -1)
|
|
221
|
-
return rest;
|
|
222
|
-
return rest.slice(arrow + 4).trim();
|
|
223
|
-
})
|
|
224
|
-
.filter((p) => p.length > 0 && !isAllowed(p));
|
|
225
|
-
if (dirty.length === 0)
|
|
226
|
-
return;
|
|
227
|
-
throw new CliError({
|
|
228
|
-
exitCode: exitCodeForError("E_GIT"),
|
|
229
|
-
code: "E_GIT",
|
|
230
|
-
message: "Working tree has non-task changes. In workflow_mode=direct, agentplane runs tasks in a single stream on the current branch; commit/stash your changes before starting a different task.",
|
|
231
|
-
});
|
|
232
|
-
}
|
|
233
|
-
async function ensureCurrentBaseBranch(gitRoot, baseBranch) {
|
|
234
|
-
const upstreamBranch = await gitBranchUpstream(gitRoot, baseBranch);
|
|
235
|
-
if (!upstreamBranch)
|
|
236
|
-
return;
|
|
237
|
-
const { behind } = await gitAheadBehind(gitRoot, upstreamBranch, baseBranch);
|
|
238
|
-
if (behind === 0)
|
|
239
|
-
return;
|
|
240
|
-
throw new CliError({
|
|
241
|
-
exitCode: exitCodeForError("E_GIT"),
|
|
242
|
-
code: "E_GIT",
|
|
243
|
-
message: `Base branch ${baseBranch} is behind its upstream ${upstreamBranch} by ${behind} commit(s). ` +
|
|
244
|
-
"Refresh the base branch before `agentplane work start` to avoid DIRTY hosted PRs.",
|
|
245
|
-
});
|
|
246
|
-
}
|
|
14
|
+
import { directWorkLockPath, ensureGitClean, readDirectWorkLock, writeDirectWorkLock, } from "./work-start.direct.js";
|
|
15
|
+
import { ensureCurrentBaseBranch, resolveBaseBranch } from "./work-start.git.js";
|
|
16
|
+
import { materializeHookShimForWorktree } from "./work-start.hook-shim.js";
|
|
17
|
+
import { materializeLocalBackendReadmesForWorktree, materializeRepoLocalDistForWorktree, materializeRepoLocalInstallLayoutForWorktree, } from "./work-start.materialize.js";
|
|
247
18
|
export async function cmdWorkStart(opts) {
|
|
248
19
|
try {
|
|
249
20
|
const output = createCliEmitter();
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { CommandContext } from "../shared/task-backend.js";
|
|
2
|
+
export declare function materializeLocalBackendReadmesForWorktree(opts: {
|
|
3
|
+
backend: CommandContext["taskBackend"];
|
|
4
|
+
repoRoot: string;
|
|
5
|
+
worktreePath: string;
|
|
6
|
+
taskId: string;
|
|
7
|
+
}): Promise<void>;
|
|
8
|
+
export declare function materializeRepoLocalDistForWorktree(opts: {
|
|
9
|
+
repoRoot: string;
|
|
10
|
+
worktreePath: string;
|
|
11
|
+
}): Promise<void>;
|
|
12
|
+
export declare function materializeRepoLocalInstallLayoutForWorktree(opts: {
|
|
13
|
+
repoRoot: string;
|
|
14
|
+
worktreePath: string;
|
|
15
|
+
}): Promise<void>;
|
|
16
|
+
//# sourceMappingURL=work-start.materialize.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"work-start.materialize.d.ts","sourceRoot":"","sources":["../../../src/commands/branch/work-start.materialize.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAOhE,wBAAsB,yCAAyC,CAAC,IAAI,EAAE;IACpE,OAAO,EAAE,cAAc,CAAC,aAAa,CAAC,CAAC;IACvC,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;CAChB,GAAG,OAAO,CAAC,IAAI,CAAC,CA+BhB;AAED,wBAAsB,mCAAmC,CAAC,IAAI,EAAE;IAC9D,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;CACtB,GAAG,OAAO,CAAC,IAAI,CAAC,CAyBhB;AAyBD,wBAAsB,4CAA4C,CAAC,IAAI,EAAE;IACvE,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;CACtB,GAAG,OAAO,CAAC,IAAI,CAAC,CAehB"}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { copyFile, cp, mkdir, readdir, rm, symlink } from "node:fs/promises";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { LocalBackend } from "../../backends/task-backend.js";
|
|
4
|
+
import { fileExists } from "../../cli/fs-utils.js";
|
|
5
|
+
import { resolveRuntimeSourceInfo } from "../../runtime/shared/runtime-source.js";
|
|
6
|
+
import { isPathWithin } from "../shared/path.js";
|
|
7
|
+
function isPresentString(value) {
|
|
8
|
+
return value !== null;
|
|
9
|
+
}
|
|
10
|
+
export async function materializeLocalBackendReadmesForWorktree(opts) {
|
|
11
|
+
if (!(opts.backend instanceof LocalBackend))
|
|
12
|
+
return;
|
|
13
|
+
const sourceRoot = path.resolve(opts.backend.root);
|
|
14
|
+
if (!isPathWithin(opts.repoRoot, sourceRoot))
|
|
15
|
+
return;
|
|
16
|
+
const relativeRoot = path.relative(opts.repoRoot, sourceRoot);
|
|
17
|
+
const targetRoot = path.join(opts.worktreePath, relativeRoot);
|
|
18
|
+
const entries = await readdir(sourceRoot, { withFileTypes: true }).catch(() => []);
|
|
19
|
+
for (const entry of entries) {
|
|
20
|
+
if (!entry.isDirectory())
|
|
21
|
+
continue;
|
|
22
|
+
const sourceTaskRoot = path.join(sourceRoot, entry.name);
|
|
23
|
+
const sourceReadme = path.join(sourceRoot, entry.name, "README.md");
|
|
24
|
+
if (!(await fileExists(sourceReadme)))
|
|
25
|
+
continue;
|
|
26
|
+
const targetReadme = path.join(targetRoot, entry.name, "README.md");
|
|
27
|
+
await mkdir(path.dirname(targetReadme), { recursive: true });
|
|
28
|
+
await copyFile(sourceReadme, targetReadme);
|
|
29
|
+
if (entry.name !== opts.taskId)
|
|
30
|
+
continue;
|
|
31
|
+
// Hand off ownership of the active task README to the task worktree so
|
|
32
|
+
// later merges cannot collide with a stale untracked copy on the base checkout.
|
|
33
|
+
await rm(sourceReadme, { force: true });
|
|
34
|
+
const remainingEntries = await readdir(sourceTaskRoot).catch(() => []);
|
|
35
|
+
if (remainingEntries.length === 0) {
|
|
36
|
+
await rm(sourceTaskRoot, { recursive: true, force: true });
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
export async function materializeRepoLocalDistForWorktree(opts) {
|
|
41
|
+
const sourceRoots = resolveRuntimeSourceRoots(opts.repoRoot);
|
|
42
|
+
const copyTargets = [
|
|
43
|
+
["packages/core/dist", "packages/core/dist"],
|
|
44
|
+
["packages/agentplane/dist", "packages/agentplane/dist"],
|
|
45
|
+
["packages/agentplane/bin", "packages/agentplane/bin"],
|
|
46
|
+
];
|
|
47
|
+
for (const [sourceRelativePath, targetRelativePath] of copyTargets) {
|
|
48
|
+
let sourcePath = "";
|
|
49
|
+
for (const sourceRoot of sourceRoots) {
|
|
50
|
+
const candidate = path.join(sourceRoot, sourceRelativePath);
|
|
51
|
+
if (await fileExists(candidate)) {
|
|
52
|
+
sourcePath = candidate;
|
|
53
|
+
break;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
if (!sourcePath)
|
|
57
|
+
continue;
|
|
58
|
+
const targetPath = path.join(opts.worktreePath, targetRelativePath);
|
|
59
|
+
if (await fileExists(targetPath))
|
|
60
|
+
continue;
|
|
61
|
+
await mkdir(path.dirname(targetPath), { recursive: true });
|
|
62
|
+
await cp(sourcePath, targetPath, { recursive: true });
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
async function linkDirectoryIntoWorktree(opts) {
|
|
66
|
+
let sourcePath = "";
|
|
67
|
+
for (const sourceRoot of opts.sourceRoots) {
|
|
68
|
+
const candidate = path.join(sourceRoot, opts.relativePath);
|
|
69
|
+
if (await fileExists(candidate)) {
|
|
70
|
+
sourcePath = candidate;
|
|
71
|
+
break;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
if (!sourcePath)
|
|
75
|
+
return false;
|
|
76
|
+
const targetPath = path.join(opts.worktreePath, opts.relativePath);
|
|
77
|
+
if (await fileExists(targetPath))
|
|
78
|
+
return false;
|
|
79
|
+
await mkdir(path.dirname(targetPath), { recursive: true });
|
|
80
|
+
await symlink(sourcePath, targetPath, process.platform === "win32" ? "junction" : "dir");
|
|
81
|
+
return true;
|
|
82
|
+
}
|
|
83
|
+
export async function materializeRepoLocalInstallLayoutForWorktree(opts) {
|
|
84
|
+
const sourceRoots = resolveRuntimeSourceRoots(opts.repoRoot);
|
|
85
|
+
const linkTargets = [
|
|
86
|
+
"node_modules",
|
|
87
|
+
path.join("packages", "core", "node_modules"),
|
|
88
|
+
path.join("packages", "agentplane", "node_modules"),
|
|
89
|
+
"agentplane-recipes",
|
|
90
|
+
];
|
|
91
|
+
for (const relativePath of linkTargets) {
|
|
92
|
+
await linkDirectoryIntoWorktree({
|
|
93
|
+
sourceRoots,
|
|
94
|
+
worktreePath: opts.worktreePath,
|
|
95
|
+
relativePath,
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
function resolveRuntimeSourceRoots(repoRoot) {
|
|
100
|
+
const runtimeSource = resolveRuntimeSourceInfo({ cwd: process.cwd() });
|
|
101
|
+
return [
|
|
102
|
+
...new Set([
|
|
103
|
+
path.resolve(repoRoot),
|
|
104
|
+
path.resolve(process.cwd()),
|
|
105
|
+
runtimeSource.agentplane.packageRoot
|
|
106
|
+
? path.resolve(runtimeSource.agentplane.packageRoot, "..", "..")
|
|
107
|
+
: null,
|
|
108
|
+
].filter((value) => isPresentString(value))),
|
|
109
|
+
];
|
|
110
|
+
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { CommandContext } from "../shared/task-backend.js";
|
|
2
1
|
export declare function safeFixGitignore(repoRoot: string): Promise<{
|
|
3
2
|
changed: boolean;
|
|
4
3
|
note: string;
|
|
@@ -7,8 +6,4 @@ export declare function safeFixTaskIndex(repoRoot: string): Promise<{
|
|
|
7
6
|
changed: boolean;
|
|
8
7
|
note: string;
|
|
9
8
|
}>;
|
|
10
|
-
export declare function safeFixLegacyUntrackedTaskReadmes(repoRoot: string, ctx?: CommandContext): Promise<{
|
|
11
|
-
changed: boolean;
|
|
12
|
-
note: string;
|
|
13
|
-
}>;
|
|
14
9
|
//# sourceMappingURL=fixes.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fixes.d.ts","sourceRoot":"","sources":["../../../src/commands/doctor/fixes.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"fixes.d.ts","sourceRoot":"","sources":["../../../src/commands/doctor/fixes.ts"],"names":[],"mappings":"AAMA,wBAAsB,gBAAgB,CACpC,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,CAyB7C;AAED,wBAAsB,gBAAgB,CACpC,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,CAQ7C"}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import fs from "node:fs/promises";
|
|
2
2
|
import path from "node:path";
|
|
3
|
-
import { parseTaskReadme } from "@agentplaneorg/core";
|
|
4
3
|
import { RUNTIME_GITIGNORE_LINES } from "../../runtime/shared/runtime-artifacts.js";
|
|
5
|
-
import { GitContext } from "../shared/git-context.js";
|
|
6
4
|
import { loadCommandContext } from "../shared/task-backend.js";
|
|
7
5
|
export async function safeFixGitignore(repoRoot) {
|
|
8
6
|
const gitignorePath = path.join(repoRoot, ".gitignore");
|
|
@@ -40,71 +38,3 @@ export async function safeFixTaskIndex(repoRoot) {
|
|
|
40
38
|
return { changed: false, note: "Skip: could not rebuild tasks index cache." };
|
|
41
39
|
}
|
|
42
40
|
}
|
|
43
|
-
export async function safeFixLegacyUntrackedTaskReadmes(repoRoot, ctx) {
|
|
44
|
-
const commandCtx = ctx ??
|
|
45
|
-
(await loadCommandContext({
|
|
46
|
-
cwd: repoRoot,
|
|
47
|
-
rootOverride: null,
|
|
48
|
-
}));
|
|
49
|
-
const workflowDir = (commandCtx.config.paths.workflow_dir ?? ".agentplane/tasks").replaceAll("\\", "/");
|
|
50
|
-
const git = commandCtx.git ?? new GitContext({ gitRoot: repoRoot });
|
|
51
|
-
let untracked = [];
|
|
52
|
-
try {
|
|
53
|
-
untracked = await git.statusUntrackedPaths();
|
|
54
|
-
}
|
|
55
|
-
catch {
|
|
56
|
-
return { changed: false, note: "Skip: could not inspect untracked task README collisions." };
|
|
57
|
-
}
|
|
58
|
-
const candidates = untracked.filter((relPath) => relPath.startsWith(`${workflowDir}/`) && relPath.endsWith("/README.md"));
|
|
59
|
-
if (candidates.length === 0) {
|
|
60
|
-
return { changed: false, note: "OK: no legacy untracked task README collisions." };
|
|
61
|
-
}
|
|
62
|
-
const removed = [];
|
|
63
|
-
for (const relPath of candidates) {
|
|
64
|
-
const absPath = path.join(repoRoot, relPath);
|
|
65
|
-
let text = "";
|
|
66
|
-
try {
|
|
67
|
-
text = await fs.readFile(absPath, "utf8");
|
|
68
|
-
}
|
|
69
|
-
catch {
|
|
70
|
-
continue;
|
|
71
|
-
}
|
|
72
|
-
let parsed;
|
|
73
|
-
try {
|
|
74
|
-
parsed = parseTaskReadme(text);
|
|
75
|
-
}
|
|
76
|
-
catch {
|
|
77
|
-
continue;
|
|
78
|
-
}
|
|
79
|
-
const taskId = path.basename(path.dirname(absPath));
|
|
80
|
-
const parsedId = typeof parsed.frontmatter.id === "string" && parsed.frontmatter.id.trim().length > 0
|
|
81
|
-
? parsed.frontmatter.id.trim()
|
|
82
|
-
: taskId;
|
|
83
|
-
const status = typeof parsed.frontmatter.status === "string"
|
|
84
|
-
? parsed.frontmatter.status.trim().toUpperCase()
|
|
85
|
-
: "";
|
|
86
|
-
if (parsedId !== taskId || status !== "DONE")
|
|
87
|
-
continue;
|
|
88
|
-
await fs.rm(absPath, { force: true });
|
|
89
|
-
try {
|
|
90
|
-
const remaining = await fs.readdir(path.dirname(absPath));
|
|
91
|
-
if (remaining.length === 0) {
|
|
92
|
-
await fs.rmdir(path.dirname(absPath));
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
catch {
|
|
96
|
-
// Ignore cleanup failures for parent directories; the file removal is the actual fix.
|
|
97
|
-
}
|
|
98
|
-
removed.push(taskId);
|
|
99
|
-
}
|
|
100
|
-
if (removed.length === 0) {
|
|
101
|
-
return {
|
|
102
|
-
changed: false,
|
|
103
|
-
note: "OK: no safe-to-remove legacy untracked DONE task README collisions.",
|
|
104
|
-
};
|
|
105
|
-
}
|
|
106
|
-
return {
|
|
107
|
-
changed: true,
|
|
108
|
-
note: `Fixed: removed legacy untracked DONE task README collisions (${removed.join(", ")}).`,
|
|
109
|
-
};
|
|
110
|
-
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow.d.ts","sourceRoot":"","sources":["../../../src/commands/doctor/workflow.ts"],"names":[],"mappings":"AAWA,wBAAsB,qBAAqB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAU/E;AAED,wBAAsB,eAAe,CACnC,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,
|
|
1
|
+
{"version":3,"file":"workflow.d.ts","sourceRoot":"","sources":["../../../src/commands/doctor/workflow.ts"],"names":[],"mappings":"AAWA,wBAAsB,qBAAqB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAU/E;AAED,wBAAsB,eAAe,CACnC,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,CAqC7C"}
|
|
@@ -14,18 +14,11 @@ export async function checkWorkflowContract(repoRoot) {
|
|
|
14
14
|
export async function safeFixWorkflow(repoRoot) {
|
|
15
15
|
const paths = resolveWorkflowPaths(repoRoot);
|
|
16
16
|
let current = "";
|
|
17
|
-
let sourcePath = paths.workflowPath;
|
|
18
17
|
try {
|
|
19
18
|
current = await fs.readFile(paths.workflowPath, "utf8");
|
|
20
19
|
}
|
|
21
20
|
catch {
|
|
22
|
-
|
|
23
|
-
current = await fs.readFile(paths.legacyWorkflowPath, "utf8");
|
|
24
|
-
sourcePath = paths.legacyWorkflowPath;
|
|
25
|
-
}
|
|
26
|
-
catch {
|
|
27
|
-
return { changed: false, note: "Skip: workflow contract file not found." };
|
|
28
|
-
}
|
|
21
|
+
return { changed: false, note: "Skip: workflow contract file not found." };
|
|
29
22
|
}
|
|
30
23
|
const loaded = await loadConfig(path.join(repoRoot, ".agentplane"));
|
|
31
24
|
const fixed = safeAutofixWorkflowText(current, {
|
|
@@ -44,24 +37,10 @@ export async function safeFixWorkflow(repoRoot) {
|
|
|
44
37
|
};
|
|
45
38
|
}
|
|
46
39
|
if (!fixed.changed) {
|
|
47
|
-
|
|
48
|
-
return { changed: false, note: "OK: workflow contract already normalized." };
|
|
49
|
-
}
|
|
50
|
-
await fs.mkdir(path.dirname(paths.workflowPath), { recursive: true });
|
|
51
|
-
await fs.writeFile(paths.workflowPath, current, "utf8");
|
|
52
|
-
await fs.rm(paths.legacyWorkflowPath, { force: true });
|
|
53
|
-
await fs.mkdir(paths.workflowDir, { recursive: true });
|
|
54
|
-
await fs.copyFile(paths.workflowPath, paths.lastKnownGoodPath);
|
|
55
|
-
return {
|
|
56
|
-
changed: true,
|
|
57
|
-
note: "Fixed: moved legacy WORKFLOW.md into .agentplane and refreshed last-known-good.",
|
|
58
|
-
};
|
|
40
|
+
return { changed: false, note: "OK: workflow contract already normalized." };
|
|
59
41
|
}
|
|
60
42
|
await fs.mkdir(path.dirname(paths.workflowPath), { recursive: true });
|
|
61
43
|
await fs.writeFile(paths.workflowPath, fixed.text, "utf8");
|
|
62
|
-
if (sourcePath === paths.legacyWorkflowPath) {
|
|
63
|
-
await fs.rm(paths.legacyWorkflowPath, { force: true });
|
|
64
|
-
}
|
|
65
44
|
await fs.mkdir(paths.workflowDir, { recursive: true });
|
|
66
45
|
await fs.copyFile(paths.workflowPath, paths.lastKnownGoodPath);
|
|
67
46
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"doctor.run.d.ts","sourceRoot":"","sources":["../../src/commands/doctor.run.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAE1D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"doctor.run.d.ts","sourceRoot":"","sources":["../../src/commands/doctor.run.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAE1D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAiBrD,eAAO,MAAM,SAAS,EAAE,cAAc,CAAC,YAAY,CA+DlD,CAAC"}
|
|
@@ -3,7 +3,7 @@ import { warnMessage, successMessage } from "../cli/output.js";
|
|
|
3
3
|
import { loadCommandContext } from "./shared/task-backend.js";
|
|
4
4
|
import { checkDoneTaskCommitInvariants } from "./doctor/archive.js";
|
|
5
5
|
import { checkBranchPrDoneTaskOpenPrDrift, checkBranchPrShippedTaskDrift, } from "./doctor/branch-pr.js";
|
|
6
|
-
import { safeFixGitignore,
|
|
6
|
+
import { safeFixGitignore, safeFixTaskIndex } from "./doctor/fixes.js";
|
|
7
7
|
import { checkLayering } from "./doctor/layering.js";
|
|
8
8
|
import { checkRuntimeSourceFacts, findingSeverity } from "./doctor/runtime.js";
|
|
9
9
|
import { checkWorkspace } from "./doctor/workspace.js";
|
|
@@ -41,8 +41,6 @@ export const runDoctor = async (ctx, p) => {
|
|
|
41
41
|
if (p.fix) {
|
|
42
42
|
const fix = await safeFixGitignore(repoRoot);
|
|
43
43
|
console.log(successMessage("doctor fix", undefined, fix.note));
|
|
44
|
-
const legacyTaskReadmes = await safeFixLegacyUntrackedTaskReadmes(repoRoot, commandCtx);
|
|
45
|
-
console.log(successMessage("doctor fix", undefined, legacyTaskReadmes.note));
|
|
46
44
|
const idx = await safeFixTaskIndex(repoRoot);
|
|
47
45
|
console.log(successMessage("doctor fix", undefined, idx.note));
|
|
48
46
|
const workflowFix = await safeFixWorkflow(repoRoot);
|
|
@@ -1,21 +1,5 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
|
|
4
|
-
}
|
|
5
|
-
export declare function cmdHooksInstall(opts: {
|
|
6
|
-
cwd: string;
|
|
7
|
-
rootOverride?: string;
|
|
8
|
-
quiet: boolean;
|
|
9
|
-
}): Promise<number>;
|
|
10
|
-
export declare function cmdHooksUninstall(opts: {
|
|
11
|
-
cwd: string;
|
|
12
|
-
rootOverride?: string;
|
|
13
|
-
quiet: boolean;
|
|
14
|
-
}): Promise<number>;
|
|
15
|
-
export declare function cmdHooksRun(opts: {
|
|
16
|
-
cwd: string;
|
|
17
|
-
rootOverride?: string;
|
|
18
|
-
hook: (typeof HOOK_NAMES)[number];
|
|
19
|
-
args: string[];
|
|
20
|
-
}): Promise<number>;
|
|
1
|
+
export { HOOK_NAMES, type HookName } from "./shared.js";
|
|
2
|
+
export { cmdHooksInstall, cmdHooksUninstall } from "./install.js";
|
|
3
|
+
export { cmdHooksRun } from "./run.js";
|
|
4
|
+
export { resolvePrePushHookScriptPath } from "./run.pre-push.js";
|
|
21
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/hooks/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,KAAK,QAAQ,EAAE,MAAM,aAAa,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAClE,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,EAAE,4BAA4B,EAAE,MAAM,mBAAmB,CAAC"}
|