@opengsd/gsd-core 1.5.0-rc.4 → 1.5.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/.claude-plugin/plugin.json +1 -1
- package/LICENSE +1 -1
- package/agents/gsd-executor.md +22 -0
- package/agents/gsd-phase-researcher.md +1 -1
- package/agents/gsd-planner.md +4 -0
- package/agents/gsd-project-researcher.md +1 -1
- package/agents/gsd-verifier.md +45 -13
- package/bin/install.js +56 -100
- package/commands/gsd/autonomous.md +1 -1
- package/commands/gsd/execute-phase.md +1 -1
- package/commands/gsd/plan-phase.md +1 -1
- package/gemini-extension.json +1 -1
- package/gsd-core/bin/gsd-tools.cjs +85 -53
- package/gsd-core/bin/lib/agent-command-router.cjs +2 -2
- package/gsd-core/bin/lib/agent-install-check.cjs +143 -0
- package/gsd-core/bin/lib/audit-command-router.cjs +4 -4
- package/gsd-core/bin/lib/capability-activation.cjs +37 -10
- package/gsd-core/bin/lib/capability-registry.cjs +2 -0
- package/gsd-core/bin/lib/capability-state.cjs +80 -30
- package/gsd-core/bin/lib/capability-writer.cjs +5 -4
- package/gsd-core/bin/lib/check-command-router.cjs +50 -51
- package/gsd-core/bin/lib/commands.cjs +20 -2
- package/gsd-core/bin/lib/config-loader.cjs +3 -4
- package/gsd-core/bin/lib/config-schema.cjs +1 -1
- package/gsd-core/bin/lib/config-types.cjs +2 -1
- package/gsd-core/bin/lib/config.cjs +5 -2
- package/gsd-core/bin/lib/decisions.cjs +19 -1
- package/gsd-core/bin/lib/docs.cjs +14 -2
- package/gsd-core/bin/lib/frontmatter.cjs +2 -2
- package/gsd-core/bin/lib/gap-checker.cjs +5 -2
- package/gsd-core/bin/lib/git-base-branch.cjs +27 -1
- package/gsd-core/bin/lib/graphify-command-router.cjs +6 -8
- package/gsd-core/bin/lib/graphify.cjs +7 -31
- package/gsd-core/bin/lib/gsd2-import.cjs +2 -2
- package/gsd-core/bin/lib/init.cjs +30 -4
- package/gsd-core/bin/lib/intel-command-router.cjs +6 -3
- package/gsd-core/bin/lib/intel.cjs +28 -34
- package/gsd-core/bin/lib/io.cjs +2 -4
- package/gsd-core/bin/lib/learnings.cjs +2 -2
- package/gsd-core/bin/lib/loop-resolver.cjs +45 -167
- package/gsd-core/bin/lib/milestone.cjs +13 -5
- package/gsd-core/bin/lib/model-resolver.cjs +3 -4
- package/gsd-core/bin/lib/phase-id.cjs +3 -5
- package/gsd-core/bin/lib/phase-locator.cjs +3 -6
- package/gsd-core/bin/lib/phase.cjs +59 -13
- package/gsd-core/bin/lib/probe-core.cjs +40 -11
- package/gsd-core/bin/lib/profile-output.cjs +5 -2
- package/gsd-core/bin/lib/prohibition-enforcement.cjs +660 -0
- package/gsd-core/bin/lib/roadmap-command-router.cjs +2 -2
- package/gsd-core/bin/lib/roadmap-parser.cjs +28 -25
- package/gsd-core/bin/lib/roadmap.cjs +9 -4
- package/gsd-core/bin/lib/runtime-artifact-conversion.cjs +4 -1
- package/gsd-core/bin/lib/runtime-hooks-surface.cjs +24 -3
- package/gsd-core/bin/lib/state.cjs +75 -17
- package/gsd-core/bin/lib/task-command-router.cjs +2 -2
- package/gsd-core/bin/lib/teams-status.cjs +74 -0
- package/gsd-core/bin/lib/template.cjs +11 -2
- package/gsd-core/bin/lib/uat.cjs +64 -2
- package/gsd-core/bin/lib/verification.cjs +8 -5
- package/gsd-core/bin/lib/verify.cjs +311 -4
- package/gsd-core/bin/lib/workstream-inventory.cjs +2 -2
- package/gsd-core/bin/lib/workstream.cjs +8 -2
- package/gsd-core/bin/lib/worktree-safety.cjs +44 -3
- package/gsd-core/bin/shared/config-schema.manifest.json +2 -0
- package/gsd-core/references/planner-antipatterns.md +46 -0
- package/gsd-core/references/planning-config.md +5 -1
- package/gsd-core/references/prohibition-probe.md +80 -2
- package/gsd-core/references/worktree-branch-check.md +11 -5
- package/gsd-core/templates/verification-report.md +16 -3
- package/gsd-core/workflows/docs-update.md +23 -31
- package/gsd-core/workflows/execute-phase/steps/worktree-recovery-policy.md +9 -0
- package/gsd-core/workflows/execute-phase.md +7 -2
- package/gsd-core/workflows/map-codebase.md +8 -10
- package/gsd-core/workflows/plan-phase.md +6 -0
- package/gsd-core/workflows/quick.md +26 -2
- package/gsd-core/workflows/settings-advanced.md +5 -5
- package/gsd-core/workflows/settings-integrations.md +5 -5
- package/gsd-core/workflows/spec-phase.md +30 -2
- package/gsd-core/workflows/verify-phase.md +22 -7
- package/hooks/dist/gsd-worktree-path-guard.js +34 -18
- package/hooks/gsd-worktree-path-guard.js +34 -18
- package/package.json +3 -3
- package/scripts/ci-prepare-test-scope.cjs +56 -14
- package/scripts/diff-touches-shipped-paths.cjs +5 -11
- package/scripts/gen-capability-registry.cjs +27 -1
- package/scripts/lint-allow-test-rule-refs.allowlist.json +0 -2
- package/scripts/research-profiles.cjs +2 -2
- package/scripts/run-tests.cjs +1 -0
- package/gsd-core/bin/lib/core.cjs +0 -345
|
@@ -1,345 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Core — Shared utilities, constants, and internal helpers
|
|
4
|
-
*
|
|
5
|
-
* ADR-457 build-at-publish: the hand-written bin/lib/core.cjs collapsed
|
|
6
|
-
* to a TypeScript source of truth. Behaviour is preserved byte-for-behaviour
|
|
7
|
-
* from the prior hand-written .cjs; only strict types are added.
|
|
8
|
-
*/
|
|
9
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
10
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
11
|
-
};
|
|
12
|
-
const node_fs_1 = __importDefault(require("node:fs"));
|
|
13
|
-
const node_path_1 = __importDefault(require("node:path"));
|
|
14
|
-
const shell_command_projection_cjs_1 = require("./shell-command-projection.cjs");
|
|
15
|
-
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
16
|
-
const ioModule = require("./io.cjs");
|
|
17
|
-
const { output, error, ERROR_REASON, setJsonErrorMode, getJsonErrorMode, GSD_TEMP_DIR, reapStaleTempFiles } = ioModule;
|
|
18
|
-
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
19
|
-
const phaseIdModule = require("./phase-id.cjs");
|
|
20
|
-
const { escapeRegex, normalizePhaseName, getMilestoneFromPhaseId, getPhaseDirFromPhaseId, phaseMarkdownRegexSource, phaseMarkdownRegexSourceExact, comparePhaseNum, extractPhaseToken, phaseTokenMatches } = phaseIdModule;
|
|
21
|
-
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
22
|
-
const roadmapParserModule = require("./roadmap-parser.cjs");
|
|
23
|
-
const { stripShippedMilestones, extractCurrentMilestone, replaceInCurrentMilestone, getRoadmapPhaseInternal, getMilestoneInfo, getMilestonePhaseFilter } = roadmapParserModule;
|
|
24
|
-
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
25
|
-
const modelProfiles = require("./model-profiles.cjs");
|
|
26
|
-
const { MODEL_PROFILES, VALID_PHASE_TYPES: _VALID_PHASE_TYPES } = modelProfiles;
|
|
27
|
-
const model_catalog_cjs_1 = require("./model-catalog.cjs");
|
|
28
|
-
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
29
|
-
const worktreeSafety = require("./worktree-safety.cjs");
|
|
30
|
-
const { resolveWorktreeContext, parseWorktreePorcelain: parseWorktreePorcelainPolicy, planWorktreePrune, executeWorktreePrunePlan, inspectWorktreeHealth, } = worktreeSafety;
|
|
31
|
-
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
32
|
-
const planningWorkspace = require("./planning-workspace.cjs");
|
|
33
|
-
// Compatibility shim: new imports should use planning-workspace.cjs directly.
|
|
34
|
-
const { planningDir, planningRoot, planningPaths, withPlanningLock, getActiveWorkstream, setActiveWorkstream, } = planningWorkspace;
|
|
35
|
-
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
36
|
-
const coreUtilsModule = require("./core-utils.cjs");
|
|
37
|
-
const { toPosixPath, detectSubRepos, extractOneLinerFromBody, pathExistsInternal, generateSlugInternal, filterPlanFiles, filterSummaryFiles, getPhaseFileStats, readSubdirectories, timeAgo, } = coreUtilsModule;
|
|
38
|
-
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
39
|
-
const phaseLocatorModule = require("./phase-locator.cjs");
|
|
40
|
-
const { searchPhaseInDir, findPhaseInternal, getArchivedPhaseDirs } = phaseLocatorModule;
|
|
41
|
-
const project_root_cjs_1 = require("./project-root.cjs");
|
|
42
|
-
const runtime_homes_cjs_1 = require("./runtime-homes.cjs");
|
|
43
|
-
// ─── Config Loader Module (extracted from core, ADR-857 phase 2e / #885) ─────
|
|
44
|
-
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
45
|
-
const configLoaderModule = require("./config-loader.cjs");
|
|
46
|
-
const { loadConfig, isGitIgnored, CONFIG_DEFAULTS, _warnUnknownProfileOverrides, _resetRuntimeWarningCacheForTests, RUNTIME_OVERRIDE_TIERS, } = configLoaderModule;
|
|
47
|
-
// ─── Model Resolver Module (extracted from core, ADR-857 phase 2f / #888) ────
|
|
48
|
-
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
49
|
-
const modelResolverModule = require("./model-resolver.cjs");
|
|
50
|
-
const { resolveTierEntry, resolveModelPolicy, resolveModelInternal, VALID_GRANULARITIES, resolveGranularityInternal, assertValidGranularityOverride, resolveModelForTier, VALID_EFFORTS, EFFORT_SET, nextEffort, resolveEffortInternal, resolveFastModeInternal, resolveEffortForTier, _resetModelPolicyWarningCacheForTests, } = modelResolverModule;
|
|
51
|
-
// ─── Path helpers ────────────────────────────────────────────────────────────
|
|
52
|
-
// toPosixPath and detectSubRepos moved to core-utils.cjs (ADR-857 phase 2c / #877).
|
|
53
|
-
// The destructured bindings above (from coreUtilsModule) make them available to
|
|
54
|
-
// core-internal callers; core.cjs re-exports toPosixPath and detectSubRepos for back-compat.
|
|
55
|
-
// findProjectRoot is now re-exported from the generated CJS module above.
|
|
56
|
-
// loadConfig, isGitIgnored, CONFIG_DEFAULTS, and related helpers moved to
|
|
57
|
-
// config-loader.cjs (ADR-857 phase 2e / #885). The destructured bindings above
|
|
58
|
-
// (from configLoaderModule) make them available to core-internal callers;
|
|
59
|
-
// core.cjs re-exports loadConfig and isGitIgnored for back-compat.
|
|
60
|
-
// ─── Common path helpers ──────────────────────────────────────────────────────
|
|
61
|
-
/**
|
|
62
|
-
* Resolve the main worktree root when running inside a git worktree.
|
|
63
|
-
* In a linked worktree, .planning/ lives in the main worktree, not in the linked one.
|
|
64
|
-
* Returns the main worktree path, or cwd if not in a worktree.
|
|
65
|
-
*/
|
|
66
|
-
function resolveWorktreeRoot(cwd) {
|
|
67
|
-
const context = resolveWorktreeContext(cwd, {
|
|
68
|
-
existsSync: node_fs_1.default.existsSync,
|
|
69
|
-
});
|
|
70
|
-
return context.effectiveRoot;
|
|
71
|
-
}
|
|
72
|
-
/**
|
|
73
|
-
* Parse `git worktree list --porcelain` output into an array of
|
|
74
|
-
* { path, branch } objects. Entries with a detached HEAD (no branch line)
|
|
75
|
-
* are skipped because we cannot safely reason about their merge status.
|
|
76
|
-
*
|
|
77
|
-
* @param porcelain - raw output from git worktree list --porcelain
|
|
78
|
-
* @returns {{ path: string, branch: string }[]}
|
|
79
|
-
*/
|
|
80
|
-
function parseWorktreePorcelain(porcelain) {
|
|
81
|
-
return parseWorktreePorcelainPolicy(porcelain);
|
|
82
|
-
}
|
|
83
|
-
/**
|
|
84
|
-
* Clear stale worktree metadata references via `git worktree prune`.
|
|
85
|
-
*
|
|
86
|
-
* Destructive linked-worktree removal is disabled by default for safety.
|
|
87
|
-
*
|
|
88
|
-
* @param repoRoot - absolute path to the main (or any) worktree of
|
|
89
|
-
* the repository; used as `cwd` for git commands.
|
|
90
|
-
* @returns list of worktree paths that were removed (always empty)
|
|
91
|
-
*/
|
|
92
|
-
function pruneOrphanedWorktrees(repoRoot) {
|
|
93
|
-
try {
|
|
94
|
-
const plan = planWorktreePrune(repoRoot, { allowDestructive: false }, { parseWorktreePorcelain });
|
|
95
|
-
const pruneResult = executeWorktreePrunePlan(plan);
|
|
96
|
-
if (pruneResult && pruneResult.timedOut) {
|
|
97
|
-
process.stderr.write('[gsd-tools] WARNING: worktree health check degraded' +
|
|
98
|
-
' — git worktree prune timed out after 10s.' +
|
|
99
|
-
' Orphaned worktree metadata may remain until the next successful run.\n');
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
catch { /* never crash the caller */ }
|
|
103
|
-
return [];
|
|
104
|
-
}
|
|
105
|
-
// ─── Planning workspace (pathing + active workstream + lock) moved to planning-workspace.cjs ───
|
|
106
|
-
// ─── Phase utilities (pure helpers re-exported from phase-id.cjs) ─────────────
|
|
107
|
-
// escapeRegex, normalizePhaseName, getMilestoneFromPhaseId, getPhaseDirFromPhaseId,
|
|
108
|
-
// phaseMarkdownRegexSource, phaseMarkdownRegexSourceExact, comparePhaseNum,
|
|
109
|
-
// extractPhaseToken, phaseTokenMatches
|
|
110
|
-
// — all imported via `phaseIdModule` above; internal callers use the destructured bindings.
|
|
111
|
-
// extractCanonicalPlanId moved to core-utils.cjs (ADR-857 phase 2c / #877).
|
|
112
|
-
// It is consumed exclusively by phase-locator.cjs, which imports it from
|
|
113
|
-
// core-utils.cjs directly. It is NOT destructured in core.cts and is NOT
|
|
114
|
-
// in core.cjs's public export = block (it was never public).
|
|
115
|
-
// searchPhaseInDir, findPhaseInternal, getArchivedPhaseDirs moved to phase-locator.cjs
|
|
116
|
-
// (ADR-857 phase 2d / #881). The destructured bindings above (from phaseLocatorModule)
|
|
117
|
-
// make them available to core-internal callers; core.cjs re-exports findPhaseInternal,
|
|
118
|
-
// getArchivedPhaseDirs, and searchPhaseInDir for back-compat.
|
|
119
|
-
// ─── Roadmap milestone scoping (re-exported from roadmap-parser.cjs) ──────────
|
|
120
|
-
// stripShippedMilestones, extractCurrentMilestone, replaceInCurrentMilestone,
|
|
121
|
-
// getRoadmapPhaseInternal, getMilestoneInfo, getMilestonePhaseFilter
|
|
122
|
-
// — all imported via `roadmapParserModule` above; internal callers use the destructured bindings.
|
|
123
|
-
// ─── Agent installation validation (#1371) ───────────────────────────────────
|
|
124
|
-
/**
|
|
125
|
-
* Resolve the agents directory for the given runtime.
|
|
126
|
-
*
|
|
127
|
-
* Priority:
|
|
128
|
-
* 1. GSD_AGENTS_DIR env var (explicit override, any runtime)
|
|
129
|
-
* 2. For claude runtime: __dirname-relative path (agents/ sibling of gsd-core/)
|
|
130
|
-
* This is correct for both repo runs and real installs (the runtime config dir's
|
|
131
|
-
* agents/ folder) because gsd-tools.cjs lives inside gsd-core/bin/ in both cases.
|
|
132
|
-
* 3. For non-claude runtimes: getGlobalConfigDir(runtime)/agents
|
|
133
|
-
*
|
|
134
|
-
* @param runtime - the active runtime name; defaults to GSD_RUNTIME env, then 'claude'
|
|
135
|
-
*/
|
|
136
|
-
function getAgentsDir(runtime) {
|
|
137
|
-
if (process.env['GSD_AGENTS_DIR']) {
|
|
138
|
-
return process.env['GSD_AGENTS_DIR'];
|
|
139
|
-
}
|
|
140
|
-
const resolved = runtime ?? (process.env['GSD_RUNTIME'] || 'claude');
|
|
141
|
-
if (resolved === 'claude') {
|
|
142
|
-
return node_path_1.default.join(__dirname, '..', '..', '..', 'agents');
|
|
143
|
-
}
|
|
144
|
-
return node_path_1.default.join((0, runtime_homes_cjs_1.getGlobalConfigDir)(resolved), 'agents');
|
|
145
|
-
}
|
|
146
|
-
/**
|
|
147
|
-
* Check which GSD agents are installed on disk.
|
|
148
|
-
*
|
|
149
|
-
* @param runtime - the active runtime name; defaults to GSD_RUNTIME env, then 'claude'
|
|
150
|
-
*/
|
|
151
|
-
function checkAgentsInstalled(runtime) {
|
|
152
|
-
const resolvedRuntime = runtime ?? (process.env['GSD_RUNTIME'] || 'claude');
|
|
153
|
-
const agentsDir = getAgentsDir(resolvedRuntime);
|
|
154
|
-
const expectedAgents = Object.keys(MODEL_PROFILES);
|
|
155
|
-
const installed = [];
|
|
156
|
-
const missing = [];
|
|
157
|
-
if (!node_fs_1.default.existsSync(agentsDir)) {
|
|
158
|
-
return {
|
|
159
|
-
agents_installed: false,
|
|
160
|
-
missing_agents: expectedAgents,
|
|
161
|
-
installed_agents: [],
|
|
162
|
-
incomplete_agents: [],
|
|
163
|
-
agents_dir: agentsDir,
|
|
164
|
-
agent_runtime: resolvedRuntime,
|
|
165
|
-
};
|
|
166
|
-
}
|
|
167
|
-
for (const agent of expectedAgents) {
|
|
168
|
-
const agentFile = node_path_1.default.join(agentsDir, `${agent}.md`);
|
|
169
|
-
const agentFileCopilot = node_path_1.default.join(agentsDir, `${agent}.agent.md`);
|
|
170
|
-
const agentFileCodex = node_path_1.default.join(agentsDir, `${agent}.toml`);
|
|
171
|
-
const agentFileKimiYaml = node_path_1.default.join(agentsDir, 'subagents', `${agent}.yaml`);
|
|
172
|
-
const agentFileKimiPrompt = node_path_1.default.join(agentsDir, 'subagents', `${agent}.md`);
|
|
173
|
-
const kimiAgentInstalled = resolvedRuntime === 'kimi' &&
|
|
174
|
-
node_fs_1.default.existsSync(agentFileKimiYaml) &&
|
|
175
|
-
node_fs_1.default.existsSync(agentFileKimiPrompt);
|
|
176
|
-
if (node_fs_1.default.existsSync(agentFile) ||
|
|
177
|
-
node_fs_1.default.existsSync(agentFileCopilot) ||
|
|
178
|
-
node_fs_1.default.existsSync(agentFileCodex) ||
|
|
179
|
-
kimiAgentInstalled) {
|
|
180
|
-
installed.push(agent);
|
|
181
|
-
}
|
|
182
|
-
else {
|
|
183
|
-
missing.push(agent);
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
// ── Manifest-backed completeness check ──────────────────────────────────────
|
|
187
|
-
// If a gsd-file-manifest.json exists alongside the agents dir (parent dir),
|
|
188
|
-
// verify that every manifest-tracked file for each expected agent is present
|
|
189
|
-
// on disk. Missing manifest-tracked files indicate an incomplete install even
|
|
190
|
-
// when the plain presence check above passed (e.g. .md present, .toml absent).
|
|
191
|
-
// If no manifest is found the check is a no-op (graceful for claude/bundled).
|
|
192
|
-
const incomplete = [];
|
|
193
|
-
const manifestPath = node_path_1.default.join(node_path_1.default.dirname(agentsDir), 'gsd-file-manifest.json');
|
|
194
|
-
let manifestFiles = {};
|
|
195
|
-
try {
|
|
196
|
-
const raw = node_fs_1.default.readFileSync(manifestPath, 'utf8');
|
|
197
|
-
const parsed = JSON.parse(raw);
|
|
198
|
-
if (parsed !== null &&
|
|
199
|
-
typeof parsed === 'object' &&
|
|
200
|
-
'files' in parsed &&
|
|
201
|
-
typeof parsed['files'] === 'object' &&
|
|
202
|
-
parsed['files'] !== null) {
|
|
203
|
-
manifestFiles = parsed['files'];
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
catch {
|
|
207
|
-
// No manifest or unreadable — completeness check is skipped
|
|
208
|
-
}
|
|
209
|
-
if (Object.keys(manifestFiles).length > 0) {
|
|
210
|
-
for (const agent of expectedAgents) {
|
|
211
|
-
// Find all manifest keys that belong to this agent:
|
|
212
|
-
// key must be "agents/<agentName>.<ext>" with no further path segments.
|
|
213
|
-
const agentPrefix = `agents/${agent}.`;
|
|
214
|
-
const agentManifestKeys = Object.keys(manifestFiles).filter(key => {
|
|
215
|
-
if (!key.startsWith(agentPrefix))
|
|
216
|
-
return false;
|
|
217
|
-
const rest = key.slice(agentPrefix.length);
|
|
218
|
-
// rest must be a bare extension (no slashes, non-empty)
|
|
219
|
-
return rest.length > 0 && !rest.includes('/');
|
|
220
|
-
});
|
|
221
|
-
if (agentManifestKeys.length === 0) {
|
|
222
|
-
// Agent not tracked in manifest — skip completeness check for this agent
|
|
223
|
-
continue;
|
|
224
|
-
}
|
|
225
|
-
const allPresent = agentManifestKeys.every(key => {
|
|
226
|
-
const basename = key.slice('agents/'.length);
|
|
227
|
-
return node_fs_1.default.existsSync(node_path_1.default.join(agentsDir, basename));
|
|
228
|
-
});
|
|
229
|
-
if (!allPresent) {
|
|
230
|
-
incomplete.push(agent);
|
|
231
|
-
}
|
|
232
|
-
}
|
|
233
|
-
}
|
|
234
|
-
return {
|
|
235
|
-
agents_installed: installed.length > 0 && missing.length === 0 && incomplete.length === 0,
|
|
236
|
-
missing_agents: missing,
|
|
237
|
-
installed_agents: installed,
|
|
238
|
-
incomplete_agents: incomplete,
|
|
239
|
-
agents_dir: agentsDir,
|
|
240
|
-
agent_runtime: resolvedRuntime,
|
|
241
|
-
};
|
|
242
|
-
}
|
|
243
|
-
/**
|
|
244
|
-
* Detect whether `cwd` sits inside a git worktree, and if so, return the
|
|
245
|
-
* absolute path of the worktree root.
|
|
246
|
-
*/
|
|
247
|
-
function gitWorktreeInfoInternal(cwd) {
|
|
248
|
-
try {
|
|
249
|
-
const insideResult = (0, shell_command_projection_cjs_1.execGit)(['rev-parse', '--is-inside-work-tree'], { cwd, timeout: 5000 });
|
|
250
|
-
if (insideResult.exitCode !== 0) {
|
|
251
|
-
return { inside: false, worktreeRoot: null };
|
|
252
|
-
}
|
|
253
|
-
const insideStdout = String(insideResult.stdout || '').trim();
|
|
254
|
-
if (insideStdout !== 'true') {
|
|
255
|
-
return { inside: false, worktreeRoot: null };
|
|
256
|
-
}
|
|
257
|
-
const rootResult = (0, shell_command_projection_cjs_1.execGit)(['rev-parse', '--show-toplevel'], { cwd, timeout: 5000 });
|
|
258
|
-
if (rootResult.exitCode !== 0) {
|
|
259
|
-
return { inside: true, worktreeRoot: null };
|
|
260
|
-
}
|
|
261
|
-
const root = String(rootResult.stdout || '').trim();
|
|
262
|
-
return { inside: true, worktreeRoot: root || null };
|
|
263
|
-
}
|
|
264
|
-
catch {
|
|
265
|
-
return { inside: false, worktreeRoot: null };
|
|
266
|
-
}
|
|
267
|
-
}
|
|
268
|
-
module.exports = {
|
|
269
|
-
output,
|
|
270
|
-
error,
|
|
271
|
-
ERROR_REASON,
|
|
272
|
-
setJsonErrorMode,
|
|
273
|
-
getJsonErrorMode,
|
|
274
|
-
loadConfig,
|
|
275
|
-
isGitIgnored,
|
|
276
|
-
escapeRegex,
|
|
277
|
-
normalizePhaseName,
|
|
278
|
-
getMilestoneFromPhaseId,
|
|
279
|
-
getPhaseDirFromPhaseId,
|
|
280
|
-
phaseMarkdownRegexSource,
|
|
281
|
-
phaseMarkdownRegexSourceExact,
|
|
282
|
-
comparePhaseNum,
|
|
283
|
-
searchPhaseInDir,
|
|
284
|
-
extractPhaseToken,
|
|
285
|
-
phaseTokenMatches,
|
|
286
|
-
findPhaseInternal,
|
|
287
|
-
getArchivedPhaseDirs,
|
|
288
|
-
getRoadmapPhaseInternal,
|
|
289
|
-
resolveModelInternal,
|
|
290
|
-
resolveModelForTier,
|
|
291
|
-
resolveGranularityInternal,
|
|
292
|
-
VALID_GRANULARITIES,
|
|
293
|
-
assertValidGranularityOverride,
|
|
294
|
-
resolveEffortInternal,
|
|
295
|
-
resolveFastModeInternal,
|
|
296
|
-
resolveEffortForTier,
|
|
297
|
-
VALID_EFFORTS,
|
|
298
|
-
EFFORT_SET,
|
|
299
|
-
nextEffort,
|
|
300
|
-
RUNTIME_PROFILE_MAP: model_catalog_cjs_1.RUNTIME_PROFILE_MAP,
|
|
301
|
-
RUNTIMES_WITH_REASONING_EFFORT: model_catalog_cjs_1.RUNTIMES_WITH_REASONING_EFFORT,
|
|
302
|
-
RUNTIMES_WITH_FAST_MODE: model_catalog_cjs_1.RUNTIMES_WITH_FAST_MODE,
|
|
303
|
-
KNOWN_RUNTIMES: model_catalog_cjs_1.KNOWN_RUNTIMES,
|
|
304
|
-
RUNTIME_OVERRIDE_TIERS,
|
|
305
|
-
resolveTierEntry,
|
|
306
|
-
resolveModelPolicy,
|
|
307
|
-
KNOWN_PROVIDERS: model_catalog_cjs_1.KNOWN_PROVIDERS,
|
|
308
|
-
_resetRuntimeWarningCacheForTests: () => {
|
|
309
|
-
_resetRuntimeWarningCacheForTests();
|
|
310
|
-
_resetModelPolicyWarningCacheForTests();
|
|
311
|
-
},
|
|
312
|
-
pathExistsInternal,
|
|
313
|
-
gitWorktreeInfoInternal,
|
|
314
|
-
generateSlugInternal,
|
|
315
|
-
getMilestoneInfo,
|
|
316
|
-
getMilestonePhaseFilter,
|
|
317
|
-
stripShippedMilestones,
|
|
318
|
-
extractCurrentMilestone,
|
|
319
|
-
replaceInCurrentMilestone,
|
|
320
|
-
toPosixPath,
|
|
321
|
-
extractOneLinerFromBody,
|
|
322
|
-
resolveWorktreeRoot,
|
|
323
|
-
// Deprecated re-exports — prefer direct import from planning-workspace.cjs
|
|
324
|
-
withPlanningLock,
|
|
325
|
-
findProjectRoot: project_root_cjs_1.findProjectRoot,
|
|
326
|
-
detectSubRepos,
|
|
327
|
-
reapStaleTempFiles,
|
|
328
|
-
GSD_TEMP_DIR,
|
|
329
|
-
MODEL_ALIAS_MAP: model_catalog_cjs_1.MODEL_ALIAS_MAP,
|
|
330
|
-
CONFIG_DEFAULTS,
|
|
331
|
-
planningDir,
|
|
332
|
-
planningRoot,
|
|
333
|
-
planningPaths,
|
|
334
|
-
getActiveWorkstream,
|
|
335
|
-
setActiveWorkstream,
|
|
336
|
-
filterPlanFiles,
|
|
337
|
-
filterSummaryFiles,
|
|
338
|
-
getPhaseFileStats,
|
|
339
|
-
readSubdirectories,
|
|
340
|
-
getAgentsDir,
|
|
341
|
-
checkAgentsInstalled,
|
|
342
|
-
timeAgo,
|
|
343
|
-
pruneOrphanedWorktrees,
|
|
344
|
-
inspectWorktreeHealth,
|
|
345
|
-
};
|