@open-agent-toolkit/cli 0.3.8 → 0.3.10
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/README.md +3 -3
- package/assets/agents/oat-codebase-mapper.md +3 -2
- package/assets/agents/oat-reviewer.md +5 -13
- package/assets/agents/skeptical-evaluator.md +6 -2
- package/assets/bundle-metadata.json +1 -1
- package/assets/config/dispatch-matrix-recommendation.json +6 -6
- package/assets/docs/cli-utilities/backlog-lifecycle.md +3 -2
- package/assets/docs/cli-utilities/bootstrap.md +5 -2
- package/assets/docs/cli-utilities/config-and-local-state.md +13 -6
- package/assets/docs/cli-utilities/configuration.md +22 -17
- package/assets/docs/cli-utilities/tool-packs.md +60 -10
- package/assets/docs/cli-utilities/workflow-gates.md +1 -1
- package/assets/docs/contributing/code.md +9 -5
- package/assets/docs/contributing/updating-model-guidance.md +34 -6
- package/assets/docs/contributing/verifying-cursor-pins.md +38 -9
- package/assets/docs/provider-sync/commands.md +11 -8
- package/assets/docs/provider-sync/instruction-sync.md +241 -39
- package/assets/docs/provider-sync/providers.md +4 -4
- package/assets/docs/provider-sync/scope-and-surface.md +1 -1
- package/assets/docs/reference/cli-reference.md +2 -0
- package/assets/docs/reference/oat-directory-structure.md +12 -11
- package/assets/docs/reference/troubleshooting.md +19 -4
- package/assets/docs/workflows/projects/dispatch-ceiling.md +21 -14
- package/assets/docs/workflows/projects/implementation-execution.md +26 -9
- package/assets/docs/workflows/projects/lifecycle.md +4 -6
- package/assets/public-package-versions.json +4 -4
- package/assets/skills/oat-agent-instructions-analyze/SKILL.md +4 -4
- package/assets/skills/oat-agent-instructions-analyze/references/analysis-artifact-template.md +5 -5
- package/assets/skills/oat-agent-instructions-analyze/references/docs/rules-files.md +14 -11
- package/assets/skills/oat-agent-instructions-analyze/references/quality-checklist.md +2 -2
- package/assets/skills/oat-agent-instructions-analyze/scripts/resolve-instruction-files.sh +4 -3
- package/assets/skills/oat-agent-instructions-apply/SKILL.md +3 -3
- package/assets/skills/oat-agent-instructions-apply/references/docs/rules-files.md +14 -11
- package/assets/skills/oat-dispatch-subagents/SKILL.md +1 -1
- package/assets/skills/oat-dispatch-subagents/references/provider-cursor.md +5 -2
- package/assets/skills/oat-doctor/SKILL.md +17 -13
- package/assets/skills/oat-project-implement/SKILL.md +2 -2
- package/assets/skills/oat-project-implement/references/completion-and-closeout.md +33 -11
- package/assets/skills/oat-project-implement/references/dispatch-and-dry-run.md +1 -1
- package/assets/skills/oat-project-implement/references/phase-execution.md +109 -8
- package/assets/skills/oat-project-lite/SKILL.md +23 -1
- package/assets/skills/oat-project-next/SKILL.md +3 -3
- package/assets/skills/oat-project-plan-writing/SKILL.md +3 -3
- package/assets/skills/oat-project-progress/SKILL.md +2 -2
- package/assets/skills/subagent-orchestration/SKILL.md +1 -1
- package/assets/skills/subagent-orchestration/references/evidence-and-refresh.md +20 -8
- package/assets/skills/subagent-orchestration/references/provider-claude.md +25 -12
- package/assets/skills/subagent-orchestration/references/provider-codex.md +27 -18
- package/assets/skills/subagent-orchestration/references/provider-cursor.md +40 -10
- package/assets/templates/docs-app-mkdocs/docs/contributing.md +1 -3
- package/assets/templates/pjm-agents.md +7 -3
- package/assets/templates/state.md +2 -2
- package/dist/commands/backlog/archive.d.ts +10 -2
- package/dist/commands/backlog/archive.d.ts.map +1 -1
- package/dist/commands/backlog/archive.js +22 -6
- package/dist/commands/backlog/index.d.ts.map +1 -1
- package/dist/commands/backlog/index.js +5 -1
- package/dist/commands/backlog/rewrite-references.d.ts +41 -0
- package/dist/commands/backlog/rewrite-references.d.ts.map +1 -0
- package/dist/commands/backlog/rewrite-references.js +516 -0
- package/dist/commands/config/index.d.ts +1 -0
- package/dist/commands/config/index.d.ts.map +1 -1
- package/dist/commands/config/index.js +69 -34
- package/dist/commands/init/index.d.ts +6 -0
- package/dist/commands/init/index.d.ts.map +1 -1
- package/dist/commands/init/index.js +27 -4
- package/dist/commands/init/tools/index.d.ts +18 -1
- package/dist/commands/init/tools/index.d.ts.map +1 -1
- package/dist/commands/init/tools/index.js +84 -17
- package/dist/commands/init/tools/project-guidance.d.ts +19 -4
- package/dist/commands/init/tools/project-guidance.d.ts.map +1 -1
- package/dist/commands/init/tools/project-guidance.js +58 -15
- package/dist/commands/init/tools/workflows/index.d.ts.map +1 -1
- package/dist/commands/init/tools/workflows/index.js +5 -1
- package/dist/commands/instructions/instructions.types.d.ts +105 -4
- package/dist/commands/instructions/instructions.types.d.ts.map +1 -1
- package/dist/commands/instructions/instructions.types.js +4 -5
- package/dist/commands/instructions/instructions.utils.d.ts +161 -6
- package/dist/commands/instructions/instructions.utils.d.ts.map +1 -1
- package/dist/commands/instructions/instructions.utils.js +650 -12
- package/dist/commands/instructions/sync/sync.d.ts.map +1 -1
- package/dist/commands/instructions/sync/sync.js +256 -18
- package/dist/commands/instructions/validate/validate.d.ts.map +1 -1
- package/dist/commands/instructions/validate/validate.js +36 -8
- package/dist/commands/pjm/index.d.ts.map +1 -1
- package/dist/commands/pjm/index.js +19 -4
- package/dist/commands/pjm/init.d.ts +3 -0
- package/dist/commands/pjm/init.d.ts.map +1 -1
- package/dist/commands/pjm/init.js +23 -5
- package/dist/commands/shared/agents-md.d.ts +26 -5
- package/dist/commands/shared/agents-md.d.ts.map +1 -1
- package/dist/commands/shared/agents-md.js +182 -3
- package/dist/commands/tools/guidance/index.d.ts +15 -0
- package/dist/commands/tools/guidance/index.d.ts.map +1 -0
- package/dist/commands/tools/guidance/index.js +81 -0
- package/dist/commands/tools/index.d.ts.map +1 -1
- package/dist/commands/tools/index.js +2 -0
- package/dist/config/oat-config.d.ts +49 -3
- package/dist/config/oat-config.d.ts.map +1 -1
- package/dist/config/oat-config.js +107 -14
- package/dist/config/resolve.d.ts.map +1 -1
- package/dist/config/resolve.js +12 -2
- package/dist/providers/claude/dispatch-envelope.d.ts.map +1 -1
- package/dist/providers/claude/dispatch-envelope.js +1 -0
- package/dist/providers/claude/targets.d.ts +1 -0
- package/dist/providers/claude/targets.d.ts.map +1 -1
- package/dist/providers/claude/targets.js +3 -1
- package/dist/providers/codex/codec/shared.d.ts +3 -0
- package/dist/providers/codex/codec/shared.d.ts.map +1 -1
- package/dist/providers/codex/codec/shared.js +4 -0
- package/dist/providers/cursor/codec/catalog.d.ts +2 -2
- package/dist/providers/cursor/codec/catalog.d.ts.map +1 -1
- package/dist/providers/cursor/codec/catalog.js +45 -0
- package/dist/providers/cursor/codec/mapping-validation.d.ts +4 -0
- package/dist/providers/cursor/codec/mapping-validation.d.ts.map +1 -0
- package/dist/providers/cursor/codec/mapping-validation.js +25 -0
- package/dist/providers/cursor/codec/materialize.d.ts.map +1 -1
- package/dist/providers/cursor/codec/materialize.js +2 -11
- package/dist/providers/cursor/codec/sync-extension.d.ts.map +1 -1
- package/dist/providers/cursor/codec/sync-extension.js +2 -11
- package/package.json +2 -2
|
@@ -12,7 +12,7 @@ import { normalizeDispatchMatrix, validateDispatchRouteTarget, walkDispatchMatri
|
|
|
12
12
|
import { formatDispatchNotices, terminalReviewerNoticesForMatrix, } from '../../config/dispatch-notices.js';
|
|
13
13
|
import { dispatchPolicyModeDescription, dispatchPolicyPolicyDescription, managedDispatchPolicyValueList, } from '../../config/dispatch-policy-options.js';
|
|
14
14
|
import { parseJsonConfig } from '../../config/json.js';
|
|
15
|
-
import { VALID_DISPATCH_POLICY_MODES, VALID_MANAGED_DISPATCH_POLICIES, MAX_GATE_TIMEOUT_MS, MIN_GATE_TIMEOUT_MS, isValidGateTimeoutMs, normalizeWorkflowPostImplementSequence, readOatConfig, readOatConfigForDefaultScopeRepair, readOatConfigForDocumentationExcludesRepair, readOatConfigForInstructionPointerExcludesRepair, readOatConfigWithWarnings, readOatLocalConfig, readUserConfig, writeOatConfig, writeOatLocalConfig, writeUserConfig, VALID_POST_IMPLEMENT_LEGACY_SEQUENCES, } from '../../config/oat-config.js';
|
|
15
|
+
import { DEFAULT_INSTRUCTION_SYNC_STRATEGY, INSTRUCTION_SYNC_STRATEGIES, VALID_DISPATCH_POLICY_MODES, VALID_MANAGED_DISPATCH_POLICIES, MAX_GATE_TIMEOUT_MS, MIN_GATE_TIMEOUT_MS, isValidGateTimeoutMs, normalizeWorkflowPostImplementSequence, readOatConfig, readOatConfigForDefaultScopeRepair, readOatConfigForDocumentationExcludesRepair, readOatConfigForInstructionPointerExcludesRepair, readOatConfigForInstructionSyncStrategyRepair, readOatConfigWithWarnings, readOatLocalConfig, readUserConfig, writeOatConfig, writeOatLocalConfig, writeUserConfig, VALID_POST_IMPLEMENT_LEGACY_SEQUENCES, } from '../../config/oat-config.js';
|
|
16
16
|
import { getOwnKey, setOwnKey } from '../../config/own-keys.js';
|
|
17
17
|
import { resolveEffectiveConfig, resolveEnvOverride, } from '../../config/resolve.js';
|
|
18
18
|
import { resolveAssetsRoot } from '../../fs/assets.js';
|
|
@@ -71,13 +71,14 @@ const KEY_ORDER = [
|
|
|
71
71
|
'documentation.tooling',
|
|
72
72
|
'documentation.config',
|
|
73
73
|
'documentation.excludes',
|
|
74
|
-
'documentation.instructionPointerExcludes',
|
|
75
74
|
'documentation.requireForProjectCompletion',
|
|
76
75
|
'explainers.defaults.style',
|
|
77
76
|
'explainers.defaults.palette',
|
|
78
77
|
'explainers.defaults.visualProfile',
|
|
79
78
|
'explainers.defaults.themeBundlePath',
|
|
80
79
|
'git.defaultBranch',
|
|
80
|
+
'instructions.claude.shims',
|
|
81
|
+
'instructions.claude.excludes',
|
|
81
82
|
'projects.root',
|
|
82
83
|
'projects.defaultScope',
|
|
83
84
|
...PJM_REMOTE_CONFIG_KEYS,
|
|
@@ -200,6 +201,28 @@ const CONFIG_CATALOG = [
|
|
|
200
201
|
owningCommand: 'oat config set git.defaultBranch <value>',
|
|
201
202
|
description: 'Default branch used by lifecycle PR flows when base branch auto-detection is unavailable.',
|
|
202
203
|
},
|
|
204
|
+
{
|
|
205
|
+
key: 'instructions.claude.shims',
|
|
206
|
+
group: 'Shared Repo (.oat/config.json)',
|
|
207
|
+
file: '.oat/config.json',
|
|
208
|
+
scope: 'shared repo',
|
|
209
|
+
type: 'enum',
|
|
210
|
+
defaultValue: DEFAULT_INSTRUCTION_SYNC_STRATEGY,
|
|
211
|
+
mutability: 'read/write',
|
|
212
|
+
owningCommand: `oat config set instructions.claude.shims <${INSTRUCTION_SYNC_STRATEGIES.join('|')}>`,
|
|
213
|
+
description: 'How `oat instructions sync` keeps a CLAUDE.md beside each AGENTS.md, and what `oat instructions validate` checks. The `--strategy` flag overrides it for one run.',
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
key: 'instructions.claude.excludes',
|
|
217
|
+
group: 'Shared Repo (.oat/config.json)',
|
|
218
|
+
file: '.oat/config.json',
|
|
219
|
+
scope: 'shared repo',
|
|
220
|
+
type: 'string[]',
|
|
221
|
+
defaultValue: 'unset',
|
|
222
|
+
mutability: 'read/write',
|
|
223
|
+
owningCommand: 'oat config set instructions.claude.excludes <path[,path...]>',
|
|
224
|
+
description: 'Comma-separated repository-relative directories that `oat instructions sync` and `oat instructions validate` must not treat as pointer sites, additive to the documentation content root they already skip. Absolute paths and paths escaping the repository are rejected; an empty value clears the key.',
|
|
225
|
+
},
|
|
203
226
|
{
|
|
204
227
|
key: 'autoReviewAtCheckpoints',
|
|
205
228
|
group: 'Shared Repo (.oat/config.json)',
|
|
@@ -256,17 +279,6 @@ const CONFIG_CATALOG = [
|
|
|
256
279
|
owningCommand: 'oat config set documentation.excludes <glob[,glob...]>',
|
|
257
280
|
description: 'Comma-separated globs, relative to the docs directory, excluded from `oat docs generate-index`. Repeated `--exclude` flags extend this list; an empty value clears the key.',
|
|
258
281
|
},
|
|
259
|
-
{
|
|
260
|
-
key: 'documentation.instructionPointerExcludes',
|
|
261
|
-
group: 'Shared Repo (.oat/config.json)',
|
|
262
|
-
file: '.oat/config.json',
|
|
263
|
-
scope: 'shared repo',
|
|
264
|
-
type: 'string[]',
|
|
265
|
-
defaultValue: 'unset',
|
|
266
|
-
mutability: 'read/write',
|
|
267
|
-
owningCommand: 'oat config set documentation.instructionPointerExcludes <path[,path...]>',
|
|
268
|
-
description: 'Comma-separated repository-relative directories that `oat instructions sync` and `oat instructions validate` must not treat as pointer sites, additive to the documentation content root they already skip. Absolute paths and paths escaping the repository are rejected; an empty value clears the key.',
|
|
269
|
-
},
|
|
270
282
|
{
|
|
271
283
|
key: 'documentation.requireForProjectCompletion',
|
|
272
284
|
group: 'Shared Repo (.oat/config.json)',
|
|
@@ -891,6 +903,7 @@ const DEFAULT_DEPENDENCIES = {
|
|
|
891
903
|
readOatConfigForDefaultScopeRepair,
|
|
892
904
|
readOatConfigForDocumentationExcludesRepair,
|
|
893
905
|
readOatConfigForInstructionPointerExcludesRepair,
|
|
906
|
+
readOatConfigForInstructionSyncStrategyRepair,
|
|
894
907
|
readOatConfigWithWarnings,
|
|
895
908
|
writeOatConfig,
|
|
896
909
|
readOatLocalConfig,
|
|
@@ -966,7 +979,7 @@ function normalizeSharedRoot(value) {
|
|
|
966
979
|
* as "clear the key" rather than as an error.
|
|
967
980
|
*/
|
|
968
981
|
/**
|
|
969
|
-
* Parse `
|
|
982
|
+
* Parse `instructions.claude.excludes` from one comma-separated
|
|
970
983
|
* value into the shape the loader and the consumer already agree on.
|
|
971
984
|
*
|
|
972
985
|
* Every entry goes through `normalizeExcludedPaths`, the same function
|
|
@@ -994,7 +1007,7 @@ function parseInstructionPointerExcludes(rawValue) {
|
|
|
994
1007
|
.filter((value) => value.length > 0)) {
|
|
995
1008
|
const [normalizedEntry] = normalizeExcludedPaths([entry]);
|
|
996
1009
|
if (normalizedEntry === undefined || WINDOWS_DRIVE_PATH_RE.test(entry)) {
|
|
997
|
-
throw new Error(`Invalid
|
|
1010
|
+
throw new Error(`Invalid instructions.claude.excludes entry ${JSON.stringify(entry)}: entries must be repository-relative paths inside the repository. Absolute paths and paths escaping the repository cannot exclude anything.`);
|
|
998
1011
|
}
|
|
999
1012
|
if (!normalized.includes(normalizedEntry)) {
|
|
1000
1013
|
normalized.push(normalizedEntry);
|
|
@@ -1037,6 +1050,7 @@ function parseExplainerValue(key, rawValue, surface) {
|
|
|
1037
1050
|
}
|
|
1038
1051
|
const WORKFLOW_ENUM_VALUES = {
|
|
1039
1052
|
'projects.defaultScope': PROJECT_SCOPES,
|
|
1053
|
+
'instructions.claude.shims': INSTRUCTION_SYNC_STRATEGIES,
|
|
1040
1054
|
'workflow.hillCheckpointDefault': ['every', 'final'],
|
|
1041
1055
|
'workflow.postImplementSequence': ['wait', 'summary', 'pr', 'docs-pr'],
|
|
1042
1056
|
'workflow.reviewExecutionModel': ['subagent', 'inline', 'fresh-session'],
|
|
@@ -1094,6 +1108,7 @@ function isStructuralKey(key) {
|
|
|
1094
1108
|
key === 'worktrees.root' ||
|
|
1095
1109
|
key === 'git.defaultBranch' ||
|
|
1096
1110
|
key.startsWith('documentation.') ||
|
|
1111
|
+
key.startsWith('instructions.') ||
|
|
1097
1112
|
key.startsWith('archive.') ||
|
|
1098
1113
|
key.startsWith('tools.'));
|
|
1099
1114
|
}
|
|
@@ -1126,7 +1141,7 @@ function validateSurfaceForKey(key, surface) {
|
|
|
1126
1141
|
}
|
|
1127
1142
|
if (isStructuralKey(key)) {
|
|
1128
1143
|
if (surface !== 'shared') {
|
|
1129
|
-
throw new Error(`Cannot set structural key '${key}' at '${surface}' scope. Structural keys (projects.root, worktrees.root, git.*, documentation.*, archive.*, tools.*) can only be set at shared scope (.oat/config.json).`);
|
|
1144
|
+
throw new Error(`Cannot set structural key '${key}' at '${surface}' scope. Structural keys (projects.root, worktrees.root, git.*, documentation.*, instructions.*, archive.*, tools.*) can only be set at shared scope (.oat/config.json).`);
|
|
1130
1145
|
}
|
|
1131
1146
|
return;
|
|
1132
1147
|
}
|
|
@@ -1844,9 +1859,37 @@ async function setConfigValue(repoRoot, userConfigDir, key, rawValue, surface, d
|
|
|
1844
1859
|
// would reject the very value the operator is trying to replace.
|
|
1845
1860
|
const config = key === 'documentation.excludes'
|
|
1846
1861
|
? await dependencies.readOatConfigForDocumentationExcludesRepair(repoRoot)
|
|
1847
|
-
: key === '
|
|
1862
|
+
: key === 'instructions.claude.excludes'
|
|
1848
1863
|
? await dependencies.readOatConfigForInstructionPointerExcludesRepair(repoRoot)
|
|
1849
|
-
:
|
|
1864
|
+
: key === 'instructions.claude.shims'
|
|
1865
|
+
? await dependencies.readOatConfigForInstructionSyncStrategyRepair(repoRoot)
|
|
1866
|
+
: await dependencies.readOatConfig(repoRoot);
|
|
1867
|
+
if (key.startsWith('instructions.claude.')) {
|
|
1868
|
+
const claude = { ...config.instructions?.claude };
|
|
1869
|
+
if (key === 'instructions.claude.excludes') {
|
|
1870
|
+
const excludes = parseInstructionPointerExcludes(rawValue);
|
|
1871
|
+
if (excludes.length === 0) {
|
|
1872
|
+
delete claude.excludes;
|
|
1873
|
+
}
|
|
1874
|
+
else {
|
|
1875
|
+
claude.excludes = excludes;
|
|
1876
|
+
}
|
|
1877
|
+
}
|
|
1878
|
+
else {
|
|
1879
|
+
claude.shims = parseWorkflowValue(key, rawValue);
|
|
1880
|
+
}
|
|
1881
|
+
await dependencies.writeOatConfig(repoRoot, {
|
|
1882
|
+
...config,
|
|
1883
|
+
instructions: { ...config.instructions, claude },
|
|
1884
|
+
});
|
|
1885
|
+
return {
|
|
1886
|
+
key,
|
|
1887
|
+
value: key === 'instructions.claude.excludes'
|
|
1888
|
+
? (claude.excludes ?? null)
|
|
1889
|
+
: (claude.shims ?? null),
|
|
1890
|
+
source: 'shared',
|
|
1891
|
+
};
|
|
1892
|
+
}
|
|
1850
1893
|
if (key.startsWith('documentation.')) {
|
|
1851
1894
|
const doc = { ...config.documentation };
|
|
1852
1895
|
if (key === 'documentation.root') {
|
|
@@ -1869,15 +1912,6 @@ async function setConfigValue(repoRoot, userConfigDir, key, rawValue, surface, d
|
|
|
1869
1912
|
doc.excludes = excludes;
|
|
1870
1913
|
}
|
|
1871
1914
|
}
|
|
1872
|
-
else if (key === 'documentation.instructionPointerExcludes') {
|
|
1873
|
-
const excludes = parseInstructionPointerExcludes(rawValue);
|
|
1874
|
-
if (excludes.length === 0) {
|
|
1875
|
-
delete doc.instructionPointerExcludes;
|
|
1876
|
-
}
|
|
1877
|
-
else {
|
|
1878
|
-
doc.instructionPointerExcludes = excludes;
|
|
1879
|
-
}
|
|
1880
|
-
}
|
|
1881
1915
|
else if (key === 'documentation.requireForProjectCompletion') {
|
|
1882
1916
|
doc.requireForProjectCompletion =
|
|
1883
1917
|
rawValue.trim().toLowerCase() === 'true';
|
|
@@ -1890,9 +1924,7 @@ async function setConfigValue(repoRoot, userConfigDir, key, rawValue, surface, d
|
|
|
1890
1924
|
? String(doc.requireForProjectCompletion ?? false)
|
|
1891
1925
|
: key === 'documentation.excludes'
|
|
1892
1926
|
? (doc.excludes ?? null)
|
|
1893
|
-
: key
|
|
1894
|
-
? (doc.instructionPointerExcludes ?? null)
|
|
1895
|
-
: (doc[key.replace('documentation.', '')] ?? null);
|
|
1927
|
+
: (doc[key.replace('documentation.', '')] ?? null);
|
|
1896
1928
|
return {
|
|
1897
1929
|
key,
|
|
1898
1930
|
value: resultValue,
|
|
@@ -2095,6 +2127,7 @@ function configPathForKey(key) {
|
|
|
2095
2127
|
}
|
|
2096
2128
|
if (key.startsWith('explainers.') ||
|
|
2097
2129
|
key.startsWith('documentation.') ||
|
|
2130
|
+
key.startsWith('instructions.') ||
|
|
2098
2131
|
key.startsWith('archive.') ||
|
|
2099
2132
|
isPjmRemoteConfigKey(key)) {
|
|
2100
2133
|
return key.split('.');
|
|
@@ -2289,11 +2322,13 @@ async function removeFromSurface(repoRoot, userConfigDir, key, effectiveSurface,
|
|
|
2289
2322
|
}
|
|
2290
2323
|
const sharedConfig = key === 'documentation.excludes'
|
|
2291
2324
|
? await dependencies.readOatConfigForDocumentationExcludesRepair(repoRoot)
|
|
2292
|
-
: key === '
|
|
2325
|
+
: key === 'instructions.claude.excludes'
|
|
2293
2326
|
? await dependencies.readOatConfigForInstructionPointerExcludesRepair(repoRoot)
|
|
2294
|
-
: key === '
|
|
2295
|
-
? await dependencies.
|
|
2296
|
-
:
|
|
2327
|
+
: key === 'instructions.claude.shims'
|
|
2328
|
+
? await dependencies.readOatConfigForInstructionSyncStrategyRepair(repoRoot)
|
|
2329
|
+
: key === 'projects.defaultScope'
|
|
2330
|
+
? await dependencies.readOatConfigForDefaultScopeRepair(repoRoot)
|
|
2331
|
+
: await dependencies.readOatConfig(repoRoot);
|
|
2297
2332
|
const { next, removed } = removeConfigPath(sharedConfig, path);
|
|
2298
2333
|
if (removed) {
|
|
2299
2334
|
await dependencies.writeOatConfig(repoRoot, next);
|
|
@@ -13,6 +13,7 @@ import type { ConcreteScope } from '../../shared/types.js';
|
|
|
13
13
|
import { Command } from 'commander';
|
|
14
14
|
import { type DetectedDocs, type DetectDocsDependencies } from './detect-docs.js';
|
|
15
15
|
import { type ToolPack } from './tools/index.js';
|
|
16
|
+
import { type AgentsGuidancePlan } from './tools/project-guidance.js';
|
|
16
17
|
export interface InitStrayCandidate {
|
|
17
18
|
provider: string;
|
|
18
19
|
report: DriftReport;
|
|
@@ -76,6 +77,11 @@ interface InitDependencies {
|
|
|
76
77
|
runGuidedSetup: (context: CommandContext, dependencies: InitDependencies, explicitProjectGuidance?: boolean) => Promise<void>;
|
|
77
78
|
runToolPacks: (context: CommandContext, explicitProjectGuidance?: boolean) => Promise<ToolPack[]>;
|
|
78
79
|
runProviderSync: (projectRoot: string) => Promise<void>;
|
|
80
|
+
/**
|
|
81
|
+
* Applies accepted OAT tools guidance for the already-installed packs when
|
|
82
|
+
* `--project-guidance` is given and guided setup does not run.
|
|
83
|
+
*/
|
|
84
|
+
applyProjectGuidance: (context: CommandContext, projectRoot: string | null) => Promise<AgentsGuidancePlan>;
|
|
79
85
|
}
|
|
80
86
|
export declare function createInitCommand(overrides?: Partial<InitDependencies>): Command;
|
|
81
87
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/init/index.ts"],"names":[],"mappings":"AAIA,O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e,EAAE,CAAC,CAAC,SAAS,MAAM,EAChC,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,YAAY,CAAC,CAAC,CAAC,EAAE,EAC1B,GAAG,EAAE,aAAa,KACf,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;IACvB,2BAA2B,EAAE,CAC3B,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,kBAAkB,EACzB,QAAQ,EAAE,QAAQ,EAClB,WAAW,EAAE,sBAAsB,EACnC,cAAc,EAAE,MAAM,EACtB,OAAO,CAAC,EAAE;QAAE,gBAAgB,CAAC,EAAE,OAAO,CAAA;KAAE,KACrC,OAAO,CAAC,QAAQ,CAAC,CAAC;IACvB,cAAc,EAAE,CACd,OAAO,EAAE,cAAc,EACvB,YAAY,EAAE,gBAAgB,EAC9B,uBAAuB,CAAC,EAAE,OAAO,KAC9B,OAAO,CAAC,IAAI,CAAC,CAAC;IACnB,YAAY,EAAE,CACZ,OAAO,EAAE,cAAc,EACvB,uBAAuB,CAAC,EAAE,OAAO,KAC9B,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;IACzB,eAAe,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACxD;;;OAGG;IACH,oBAAoB,EAAE,CACpB,OAAO,EAAE,cAAc,EACvB,WAAW,EAAE,MAAM,GAAG,IAAI,KACvB,OAAO,CAAC,kBAAkB,CAAC,CAAC;CAClC;AA0jCD,wBAAgB,iBAAiB,CAC/B,SAAS,GAAE,OAAO,CAAC,gBAAgB,CAAM,GACxC,OAAO,CA8BT"}
|
|
@@ -28,8 +28,8 @@ import { getActiveAdapters, getConfigAwareAdapters, getProviderRegistrations, re
|
|
|
28
28
|
import { getAdoptionSources } from '../../providers/shared/adapter.utils.js';
|
|
29
29
|
import { Command } from 'commander';
|
|
30
30
|
import { detectExistingDocs, } from './detect-docs.js';
|
|
31
|
-
import { createInitToolsCommand, runInitToolsWithDefaults, } from './tools/index.js';
|
|
32
|
-
import { commandProjectGuidanceChoice, withProjectGuidanceOptions, } from './tools/project-guidance.js';
|
|
31
|
+
import { applyProjectGuidanceForInstalledPacks, createInitToolsCommand, runInitToolsWithDefaults, } from './tools/index.js';
|
|
32
|
+
import { commandProjectGuidanceChoice, isProjectGuidanceIncomplete, reportableProjectGuidance, reportProjectGuidancePlan, withProjectGuidanceOptions, } from './tools/project-guidance.js';
|
|
33
33
|
const ADOPT_REMEDIATION = 'Run "oat init" interactively to adopt stray entries.';
|
|
34
34
|
const HOOK_PROMPT = 'Install optional pre-commit hook for drift warnings?';
|
|
35
35
|
const HOOK_CONFIGURE_PROMPT = (hooksPath) => `Configure Git hooks to use ${hooksPath} before installing the OAT hook?`;
|
|
@@ -171,6 +171,7 @@ function createDependencies() {
|
|
|
171
171
|
applyNativeSkillDisposition,
|
|
172
172
|
runGuidedSetup: runGuidedSetupImpl,
|
|
173
173
|
runToolPacks: runInitToolsWithDefaults,
|
|
174
|
+
applyProjectGuidance: (context, projectRoot) => applyProjectGuidanceForInstalledPacks(context, projectRoot, true),
|
|
174
175
|
async runProviderSync(projectRoot) {
|
|
175
176
|
execSync('oat sync --scope project', {
|
|
176
177
|
cwd: projectRoot,
|
|
@@ -695,6 +696,15 @@ async function runInitCommand(context, dependencies, hookFlag, setupFlag, explic
|
|
|
695
696
|
});
|
|
696
697
|
}
|
|
697
698
|
const hookInstalled = await maybeHandleHook(context, dependencies, projectRoot, hookFlag);
|
|
699
|
+
const freshInit = projectRoot !== null && !oatDirExistedBefore;
|
|
700
|
+
const setupMayRun = !!setupFlag || (context.interactive && freshInit);
|
|
701
|
+
// Guided setup owns guidance when it runs. Otherwise an explicit
|
|
702
|
+
// --project-guidance is applied directly for the installed packs, so the
|
|
703
|
+
// flag is never silently dropped (--no-project-guidance needs no write).
|
|
704
|
+
let directGuidance = null;
|
|
705
|
+
if (explicitProjectGuidance === true && !setupMayRun) {
|
|
706
|
+
directGuidance = await dependencies.applyProjectGuidance(context, projectRoot);
|
|
707
|
+
}
|
|
698
708
|
if (context.json) {
|
|
699
709
|
const payload = {
|
|
700
710
|
scope: context.scope,
|
|
@@ -704,12 +714,14 @@ async function runInitCommand(context, dependencies, hookFlag, setupFlag, explic
|
|
|
704
714
|
hookInstalled,
|
|
705
715
|
scopes: scopeSummaries,
|
|
706
716
|
manifestVersionRestamps,
|
|
717
|
+
...(directGuidance
|
|
718
|
+
? { projectGuidance: reportableProjectGuidance(directGuidance) }
|
|
719
|
+
: {}),
|
|
707
720
|
};
|
|
708
721
|
context.logger.json(payload);
|
|
709
722
|
}
|
|
710
723
|
process.exitCode = 0;
|
|
711
|
-
|
|
712
|
-
if (setupFlag || (context.interactive && freshInit)) {
|
|
724
|
+
if (setupMayRun) {
|
|
713
725
|
let shouldRunSetup = !!setupFlag;
|
|
714
726
|
if (!shouldRunSetup && freshInit) {
|
|
715
727
|
shouldRunSetup = await dependencies.confirmAction('Would you like to run guided setup?', { interactive: context.interactive });
|
|
@@ -722,6 +734,17 @@ async function runInitCommand(context, dependencies, hookFlag, setupFlag, explic
|
|
|
722
734
|
await dependencies.runGuidedSetup(context, dependencies, explicitProjectGuidance);
|
|
723
735
|
}
|
|
724
736
|
}
|
|
737
|
+
else if (explicitProjectGuidance === true) {
|
|
738
|
+
directGuidance = await dependencies.applyProjectGuidance(context, projectRoot);
|
|
739
|
+
}
|
|
740
|
+
}
|
|
741
|
+
if (directGuidance) {
|
|
742
|
+
if (!context.json) {
|
|
743
|
+
reportProjectGuidancePlan(context.logger, directGuidance);
|
|
744
|
+
}
|
|
745
|
+
if (isProjectGuidanceIncomplete(directGuidance)) {
|
|
746
|
+
process.exitCode = 1;
|
|
747
|
+
}
|
|
725
748
|
}
|
|
726
749
|
}
|
|
727
750
|
export function createInitCommand(overrides = {}) {
|
|
@@ -13,7 +13,7 @@ import { type InstallBrainstormOptions, type InstallBrainstormResult } from './b
|
|
|
13
13
|
import { type InstallCoreOptions, type InstallCoreResult } from './core/install-core.js';
|
|
14
14
|
import { type InstallDocsOptions, type InstallDocsResult } from './docs/install-docs.js';
|
|
15
15
|
import { type InstallIdeasOptions, type InstallIdeasResult } from './ideas/install-ideas.js';
|
|
16
|
-
import { type PlanProjectGuidanceInput, planProjectGuidance } from './project-guidance.js';
|
|
16
|
+
import { type AgentsGuidancePlan, type PlanProjectGuidanceInput, planProjectGuidance, type ProjectGuidancePack } from './project-guidance.js';
|
|
17
17
|
import { type InstallProjectManagementOptions, type InstallProjectManagementResult } from './project-management/install-project-management.js';
|
|
18
18
|
import { type InstallResearchOptions, type InstallResearchResult } from './research/install-research.js';
|
|
19
19
|
import { type InstallUtilityOptions, type InstallUtilityResult } from './utility/install-utility.js';
|
|
@@ -78,6 +78,23 @@ interface PackScopeChange {
|
|
|
78
78
|
export declare function formatReconcileSummary(adds: PackScopeChange[], removes: PackScopeChange[]): string;
|
|
79
79
|
export declare function consumeInitToolsRunMetadata(): InitToolsRunMetadata | null;
|
|
80
80
|
export declare function wasInstallSyncHandled(command: Command): boolean;
|
|
81
|
+
export interface RealizedGuidanceState {
|
|
82
|
+
packs: ProjectGuidancePack[];
|
|
83
|
+
/** Project skills that belong to no OAT pack, by name. */
|
|
84
|
+
otherProjectSkills: string[];
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Reads the realized pack placement (and unrelated project skills) the OAT
|
|
88
|
+
* tools block describes. Read-only: it inventories and scans installed state
|
|
89
|
+
* and never installs, upgrades, or writes.
|
|
90
|
+
*/
|
|
91
|
+
export declare function loadRealizedGuidanceState(context: CommandContext, projectRoot: string | null, overrides?: Partial<InitToolsDependencies>): Promise<RealizedGuidanceState>;
|
|
92
|
+
/**
|
|
93
|
+
* Plans and applies the OAT tools guidance block for the packs already
|
|
94
|
+
* installed, without installing or upgrading anything. `oat init` uses it to
|
|
95
|
+
* honor `--project-guidance` when guided setup does not run.
|
|
96
|
+
*/
|
|
97
|
+
export declare function applyProjectGuidanceForInstalledPacks(context: CommandContext, projectRoot: string | null, explicitChoice: boolean, overrides?: Partial<InitToolsDependencies>): Promise<AgentsGuidancePlan>;
|
|
81
98
|
export { buildToolPacksSectionBody } from './project-guidance.js';
|
|
82
99
|
export declare function runInitTools(context: CommandContext, dependencies: InitToolsDependencies, explicitProjectGuidance?: boolean): Promise<ToolPack[]>;
|
|
83
100
|
export declare function runInitToolsWithDefaults(context: CommandContext, explicitProjectGuidance?: boolean): Promise<ToolPack[]>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/commands/init/tools/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,aAAa,EAEnB,MAAM,sBAAsB,CAAC;AAI9B,OAAO,EACL,KAAK,uBAAuB,EAC5B,KAAK,mBAAmB,EAIzB,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EAEL,KAAK,iBAAiB,EACtB,KAAK,aAAa,EAClB,KAAK,YAAY,EAGlB,MAAM,iCAAiC,CAAC;AAEzC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAWvE,OAAO,EAEL,KAAK,kBAAkB,EACvB,KAAK,aAAa,EACnB,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAEL,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACzB,MAAM,uCAAuC,CAAC;AAgB/C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAC1E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EACL,KAAK,SAAS,EAIf,MAAM,oBAAoB,CAAC;AAQ5B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,OAAO,EAEL,KAAK,wBAAwB,EAC7B,KAAK,uBAAuB,EAC7B,MAAM,iCAAiC,CAAC;AAEzC,OAAO,EAEL,KAAK,kB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AAC;AAE/D,wBAAsB,YAAY,CAChC,OAAO,EAAE,cAAc,EACvB,YAAY,EAAE,qBAAqB,EACnC,uBAAuB,CAAC,EAAE,OAAO,GAChC,OAAO,CAAC,QAAQ,EAAE,CAAC,CA6oBrB;AAED,wBAAsB,wBAAwB,CAC5C,OAAO,EAAE,cAAc,EACvB,uBAAuB,CAAC,EAAE,OAAO,GAChC,OAAO,CAAC,QAAQ,EAAE,CAAC,CAMrB;AA8VD,wBAAgB,sBAAsB,CACpC,SAAS,GAAE,OAAO,CAAC,qBAAqB,CAAM,GAC7C,OAAO,CAsHT"}
|
|
@@ -532,7 +532,11 @@ async function applyProjectGuidance(plan, dependencies) {
|
|
|
532
532
|
}
|
|
533
533
|
return {
|
|
534
534
|
...plan,
|
|
535
|
-
action: sectionResult.action === 'created'
|
|
535
|
+
action: sectionResult.action === 'created'
|
|
536
|
+
? 'create'
|
|
537
|
+
: sectionResult.action === 'appended'
|
|
538
|
+
? 'appended'
|
|
539
|
+
: 'no-change',
|
|
536
540
|
reason: `Accepted project guidance ${sectionResult.action}. Capability placement and PJM adoption were unchanged.`,
|
|
537
541
|
};
|
|
538
542
|
}
|
|
@@ -544,6 +548,50 @@ async function applyProjectGuidance(plan, dependencies) {
|
|
|
544
548
|
};
|
|
545
549
|
}
|
|
546
550
|
}
|
|
551
|
+
async function realizedGuidanceState(context, repoRoot, assetsRoot, dependencies) {
|
|
552
|
+
const userRoot = dependencies.resolveScopeRoot('user', context.cwd, context.home);
|
|
553
|
+
const finalPackStates = await loadInstalledPackStates(repoRoot, userRoot, assetsRoot, dependencies);
|
|
554
|
+
const packs = ALL_TOOL_PACKS.flatMap((pack) => {
|
|
555
|
+
const scope = finalPackStates[pack].location;
|
|
556
|
+
return scope === 'not-installed'
|
|
557
|
+
? []
|
|
558
|
+
: [{ pack, scope }];
|
|
559
|
+
});
|
|
560
|
+
return {
|
|
561
|
+
packs,
|
|
562
|
+
otherProjectSkills: await otherProjectSkillNames(repoRoot, assetsRoot, dependencies),
|
|
563
|
+
};
|
|
564
|
+
}
|
|
565
|
+
/**
|
|
566
|
+
* Project skills whose names belong to no bundled pack. Pack membership, not
|
|
567
|
+
* directory existence, decides what is "other".
|
|
568
|
+
*/
|
|
569
|
+
async function otherProjectSkillNames(repoRoot, assetsRoot, dependencies) {
|
|
570
|
+
if (!repoRoot)
|
|
571
|
+
return [];
|
|
572
|
+
const projectTools = await dependencies.scanTools({
|
|
573
|
+
scope: 'project',
|
|
574
|
+
scopeRoot: repoRoot,
|
|
575
|
+
assetsRoot,
|
|
576
|
+
});
|
|
577
|
+
return projectTools
|
|
578
|
+
.filter(({ type, pack }) => type === 'skill' && pack === 'custom')
|
|
579
|
+
.map(({ name }) => name)
|
|
580
|
+
.sort();
|
|
581
|
+
}
|
|
582
|
+
/**
|
|
583
|
+
* Reads the realized pack placement (and unrelated project skills) the OAT
|
|
584
|
+
* tools block describes. Read-only: it inventories and scans installed state
|
|
585
|
+
* and never installs, upgrades, or writes.
|
|
586
|
+
*/
|
|
587
|
+
export async function loadRealizedGuidanceState(context, projectRoot, overrides = {}) {
|
|
588
|
+
const dependencies = {
|
|
589
|
+
...DEFAULT_DEPENDENCIES,
|
|
590
|
+
...overrides,
|
|
591
|
+
};
|
|
592
|
+
const assetsRoot = await dependencies.resolveAssetsRoot();
|
|
593
|
+
return realizedGuidanceState(context, projectRoot, assetsRoot, dependencies);
|
|
594
|
+
}
|
|
547
595
|
async function planAndApplyProjectGuidanceAfterInstall(context, assetsRoot, installedProjectRoot, explicitChoice, dependencies) {
|
|
548
596
|
const initialPlan = await dependencies.planProjectGuidance({
|
|
549
597
|
repoRoot: installedProjectRoot,
|
|
@@ -557,17 +605,22 @@ async function planAndApplyProjectGuidanceAfterInstall(context, assetsRoot, inst
|
|
|
557
605
|
try {
|
|
558
606
|
const repoRoot = installedProjectRoot ??
|
|
559
607
|
(await dependencies.resolveProjectRoot(context.cwd));
|
|
560
|
-
const
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
return
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
608
|
+
const realized = await realizedGuidanceState(context, repoRoot, assetsRoot, dependencies);
|
|
609
|
+
if (realized.packs.length === 0) {
|
|
610
|
+
// An empty block would be a stale placeholder that turns the first real
|
|
611
|
+
// pack install into a manual patch, so write nothing.
|
|
612
|
+
return {
|
|
613
|
+
...initialPlan,
|
|
614
|
+
repoRoot,
|
|
615
|
+
target: join(repoRoot, 'AGENTS.md'),
|
|
616
|
+
action: 'skipped',
|
|
617
|
+
reason: 'No OAT tool pack is installed, so there is no OAT tools guidance to write; AGENTS.md was left unchanged. Run `oat tools install <pack> --project-guidance` or `oat init --setup --project-guidance` to install packs with guidance.',
|
|
618
|
+
};
|
|
619
|
+
}
|
|
568
620
|
const completePlan = await dependencies.planProjectGuidance({
|
|
569
621
|
repoRoot,
|
|
570
|
-
packs:
|
|
622
|
+
packs: realized.packs,
|
|
623
|
+
otherProjectSkills: realized.otherProjectSkills,
|
|
571
624
|
explicitChoice: true,
|
|
572
625
|
interactive: false,
|
|
573
626
|
confirmAction: dependencies.confirmAction,
|
|
@@ -582,6 +635,19 @@ async function planAndApplyProjectGuidanceAfterInstall(context, assetsRoot, inst
|
|
|
582
635
|
};
|
|
583
636
|
}
|
|
584
637
|
}
|
|
638
|
+
/**
|
|
639
|
+
* Plans and applies the OAT tools guidance block for the packs already
|
|
640
|
+
* installed, without installing or upgrading anything. `oat init` uses it to
|
|
641
|
+
* honor `--project-guidance` when guided setup does not run.
|
|
642
|
+
*/
|
|
643
|
+
export async function applyProjectGuidanceForInstalledPacks(context, projectRoot, explicitChoice, overrides = {}) {
|
|
644
|
+
const dependencies = {
|
|
645
|
+
...DEFAULT_DEPENDENCIES,
|
|
646
|
+
...overrides,
|
|
647
|
+
};
|
|
648
|
+
const assetsRoot = await dependencies.resolveAssetsRoot();
|
|
649
|
+
return planAndApplyProjectGuidanceAfterInstall(context, assetsRoot, projectRoot, explicitChoice, dependencies);
|
|
650
|
+
}
|
|
585
651
|
function initProviderVisibility(syncScopes) {
|
|
586
652
|
if (syncScopes.length === 0)
|
|
587
653
|
return null;
|
|
@@ -1022,6 +1088,7 @@ export async function runInitTools(context, dependencies, explicitProjectGuidanc
|
|
|
1022
1088
|
const plannedGuidance = await dependencies.planProjectGuidance({
|
|
1023
1089
|
repoRoot: projectRoot,
|
|
1024
1090
|
packs: realizedPacks,
|
|
1091
|
+
otherProjectSkills: await otherProjectSkillNames(projectRoot, assetsRoot, dependencies),
|
|
1025
1092
|
explicitChoice: explicitProjectGuidance,
|
|
1026
1093
|
interactive: context.interactive,
|
|
1027
1094
|
confirmAction: dependencies.confirmAction,
|
|
@@ -1171,9 +1238,9 @@ function createReconciledPackCommand(pack, dependencies) {
|
|
|
1171
1238
|
};
|
|
1172
1239
|
const base = new Command(pack).description(descriptions[pack]);
|
|
1173
1240
|
const scopedCommand = pack === 'core' ? base : withScopeOption(base);
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1241
|
+
// Every pack command acts on --project-guidance: the OAT tools block
|
|
1242
|
+
// describes every installed pack, so any pack install can plan it.
|
|
1243
|
+
const packCommand = withProjectGuidanceOptions(scopedCommand);
|
|
1177
1244
|
return packCommand
|
|
1178
1245
|
.allowUnknownOption(false)
|
|
1179
1246
|
.action(async (_options, command) => {
|
|
@@ -1182,9 +1249,7 @@ function createReconciledPackCommand(pack, dependencies) {
|
|
|
1182
1249
|
let selection = null;
|
|
1183
1250
|
let providerContexts = [];
|
|
1184
1251
|
try {
|
|
1185
|
-
const explicitProjectGuidance =
|
|
1186
|
-
? commandProjectGuidanceChoice(command)
|
|
1187
|
-
: undefined;
|
|
1252
|
+
const explicitProjectGuidance = commandProjectGuidanceChoice(command);
|
|
1188
1253
|
const assetsRoot = await dependencies.resolveAssetsRoot();
|
|
1189
1254
|
const explicitScope = command.getOptionValueSourceWithGlobals('scope') === 'cli';
|
|
1190
1255
|
const requestedScope = context.scope === 'project' || context.scope === 'user'
|
|
@@ -1270,7 +1335,9 @@ function createReconciledPackCommand(pack, dependencies) {
|
|
|
1270
1335
|
const providerVisibility = initProviderVisibility(results
|
|
1271
1336
|
.filter(({ plan }) => plan.operations.length > 0)
|
|
1272
1337
|
.map(({ request }) => request.scope));
|
|
1273
|
-
|
|
1338
|
+
// `workflows` offers guidance on every run (prompting when
|
|
1339
|
+
// interactive); other packs plan it only when the flag is given.
|
|
1340
|
+
const projectGuidance = pack === 'workflows' || explicitProjectGuidance !== undefined
|
|
1274
1341
|
? await planAndApplyProjectGuidanceAfterInstall(context, assetsRoot, requests.find(({ scope }) => scope === 'project')?.scopeRoot ??
|
|
1275
1342
|
null, explicitProjectGuidance, dependencies)
|
|
1276
1343
|
: null;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type AgentsMdManualPatch } from '../../shared/agents-md.js';
|
|
2
2
|
import type { PromptContext } from '../../shared/shared.prompts.js';
|
|
3
3
|
import type { PackName } from '../../tools/shared/types.js';
|
|
4
4
|
import type { Command } from 'commander';
|
|
@@ -12,7 +12,7 @@ export type ProjectGuidanceChoice = {
|
|
|
12
12
|
choice: 'not-requested';
|
|
13
13
|
source: 'non-interactive-default';
|
|
14
14
|
};
|
|
15
|
-
export type AgentsGuidanceAction = 'declined' | 'not-requested' | 'create' | 'no-change' | 'manual-required' | 'blocked';
|
|
15
|
+
export type AgentsGuidanceAction = 'declined' | 'not-requested' | 'create' | 'appended' | 'skipped' | 'no-change' | 'manual-required' | 'blocked';
|
|
16
16
|
export interface ProjectGuidancePack {
|
|
17
17
|
pack: PackName;
|
|
18
18
|
scope: 'project' | 'user' | 'both';
|
|
@@ -28,7 +28,14 @@ export interface AgentsGuidancePlan {
|
|
|
28
28
|
choice: ProjectGuidanceChoice;
|
|
29
29
|
manualPatch?: AgentsMdManualPatch;
|
|
30
30
|
}
|
|
31
|
-
export interface
|
|
31
|
+
export interface ToolPacksSectionOptions {
|
|
32
|
+
/**
|
|
33
|
+
* Project skills that belong to no OAT pack. They are described separately
|
|
34
|
+
* and never named as pack skills.
|
|
35
|
+
*/
|
|
36
|
+
otherProjectSkills?: readonly string[];
|
|
37
|
+
}
|
|
38
|
+
export interface PlanProjectGuidanceInput extends ToolPacksSectionOptions {
|
|
32
39
|
repoRoot: string | null;
|
|
33
40
|
packs: readonly ProjectGuidancePack[];
|
|
34
41
|
explicitChoice?: boolean;
|
|
@@ -41,7 +48,15 @@ export declare function reportableProjectGuidance(plan: AgentsGuidancePlan): {
|
|
|
41
48
|
reason: string;
|
|
42
49
|
manualPatch?: AgentsMdManualPatch | undefined;
|
|
43
50
|
};
|
|
44
|
-
export declare function
|
|
51
|
+
export declare function isProjectGuidanceIncomplete(plan: AgentsGuidancePlan): boolean;
|
|
52
|
+
/** Prints one guidance plan in the human form every guidance surface uses. */
|
|
53
|
+
export declare function reportProjectGuidancePlan(logger: {
|
|
54
|
+
info: (message: string) => void;
|
|
55
|
+
warn: (message: string) => void;
|
|
56
|
+
}, plan: AgentsGuidancePlan): void;
|
|
57
|
+
export declare function buildToolPacksSectionBody(packs: readonly ProjectGuidancePack[], options?: ToolPacksSectionOptions): string;
|
|
58
|
+
/** The complete managed `OAT tools` block, markers included. */
|
|
59
|
+
export declare function renderToolPacksManagedBlock(packs: readonly ProjectGuidancePack[], options?: ToolPacksSectionOptions): string;
|
|
45
60
|
export declare function parseProjectGuidanceFlags(args: readonly string[]): boolean | undefined;
|
|
46
61
|
export declare function commandProjectGuidanceChoice(command: Command): boolean | undefined;
|
|
47
62
|
export declare function withProjectGuidanceOptions<TCommand extends Command>(command: TCommand): TCommand;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project-guidance.d.ts","sourceRoot":"","sources":["../../../../src/commands/init/tools/project-guidance.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"project-guidance.d.ts","sourceRoot":"","sources":["../../../../src/commands/init/tools/project-guidance.ts"],"names":[],"mappings":"A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