@open-agent-toolkit/cli 0.2.8 → 0.2.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/assets/docs/cli-utilities/tool-packs.md +2 -0
- package/assets/public-package-versions.json +4 -4
- package/dist/app/global-cli-installer.d.ts +16 -0
- package/dist/app/global-cli-installer.d.ts.map +1 -0
- package/dist/app/global-cli-installer.js +111 -0
- package/dist/app/tool-bundle-update-guard.d.ts.map +1 -1
- package/dist/app/tool-bundle-update-guard.js +10 -22
- package/dist/app/update-notifier.d.ts.map +1 -1
- package/dist/app/update-notifier.js +4 -3
- package/dist/commands/init/tools/index.d.ts.map +1 -1
- package/dist/commands/init/tools/index.js +9 -0
- package/dist/commands/init/tools/project-management/agents-guidance.d.ts +3 -0
- package/dist/commands/init/tools/project-management/agents-guidance.d.ts.map +1 -0
- package/dist/commands/init/tools/project-management/agents-guidance.js +17 -0
- package/dist/commands/init/tools/project-management/index.d.ts.map +1 -1
- package/dist/commands/init/tools/project-management/index.js +23 -1
- package/package.json +2 -2
|
@@ -188,6 +188,8 @@ Key behavior:
|
|
|
188
188
|
- Non-interactive installs (including `--scope project`, `--scope user`, and the default pack set) are strictly additive and never remove a pack from a scope. Removal is interactive-only
|
|
189
189
|
- Tracks installed vs bundled skill versions and reports outdated skills
|
|
190
190
|
- Records installed pack state in shared repo config as `tools.<pack>: true` so other OAT workflows can detect installed capabilities without relying on filesystem heuristics
|
|
191
|
+
- Refreshes the managed `OAT tools` section in the repository-root `AGENTS.md`.
|
|
192
|
+
- Installing the `project-management` pack—through either the aggregate picker or `oat tools install project-management`—also upserts a managed `OAT project-management` section. It points agents to `.oat/repo/AGENTS.md` for active PJM and durable-reference routing, summarizes when to consult it, and gives decision-specific guidance for reviewing and creating durable records without hand-editing the generated index.
|
|
191
193
|
- Interactive runs can prompt to update selected outdated skills
|
|
192
194
|
- Successful installs report the final scope chosen for each pack, including `project + user` when a pack is installed in both, and auto-sync only the scopes actually changed by the install so untouched scopes are never re-synced or pruned
|
|
193
195
|
- Install-triggered auto-sync limits removal planning to the canonical entries from the pack that was just installed, so stale manifest drift in unrelated packs does not delete other provider views
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export type GlobalCliPackageManager = 'npm' | 'pnpm' | 'yarn' | 'bun';
|
|
2
|
+
export interface GlobalCliInstallerOptions {
|
|
3
|
+
argv: string[];
|
|
4
|
+
env: NodeJS.ProcessEnv;
|
|
5
|
+
platform: NodeJS.Platform;
|
|
6
|
+
nodeExecutable: string;
|
|
7
|
+
fileExists: (path: string) => boolean;
|
|
8
|
+
}
|
|
9
|
+
export interface GlobalCliInstallerInvocation {
|
|
10
|
+
file: string;
|
|
11
|
+
args: string[];
|
|
12
|
+
}
|
|
13
|
+
export declare function detectGlobalCliPackageManager(argv: string[], env: NodeJS.ProcessEnv): GlobalCliPackageManager;
|
|
14
|
+
export declare function formatGlobalCliInstallCommand(packageSpec: string, argv: string[], env: NodeJS.ProcessEnv): string;
|
|
15
|
+
export declare function resolveGlobalCliInstallerInvocation(packageSpec: string, options: GlobalCliInstallerOptions): GlobalCliInstallerInvocation | null;
|
|
16
|
+
//# sourceMappingURL=global-cli-installer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"global-cli-installer.d.ts","sourceRoot":"","sources":["../../src/app/global-cli-installer.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,uBAAuB,GAAG,KAAK,GAAG,MAAM,GAAG,MAAM,GAAG,KAAK,CAAC;AAEtE,MAAM,WAAW,yBAAyB;IACxC,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,GAAG,EAAE,MAAM,CAAC,UAAU,CAAC;IACvB,QAAQ,EAAE,MAAM,CAAC,QAAQ,CAAC;IAC1B,cAAc,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC;CACvC;AAED,MAAM,WAAW,4BAA4B;IAC3C,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,EAAE,CAAC;CAChB;AAqCD,wBAAgB,6BAA6B,CAC3C,IAAI,EAAE,MAAM,EAAE,EACd,GAAG,EAAE,MAAM,CAAC,UAAU,GACrB,uBAAuB,CAyBzB;AA0ED,wBAAgB,6BAA6B,CAC3C,WAAW,EAAE,MAAM,EACnB,IAAI,EAAE,MAAM,EAAE,EACd,GAAG,EAAE,MAAM,CAAC,UAAU,GACrB,MAAM,CAYR;AAED,wBAAgB,mCAAmC,CACjD,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,yBAAyB,GACjC,4BAA4B,GAAG,IAAI,CAUrC"}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { win32 } from 'node:path';
|
|
2
|
+
function normalizePathForDetection(path) {
|
|
3
|
+
return path.replaceAll('\\', '/').toLowerCase().replace(/\/+$/, '');
|
|
4
|
+
}
|
|
5
|
+
function isUnderNormalizedPath(normalizedCandidate, normalizedHome) {
|
|
6
|
+
return (normalizedCandidate === normalizedHome ||
|
|
7
|
+
normalizedCandidate.startsWith(`${normalizedHome}/`));
|
|
8
|
+
}
|
|
9
|
+
function detectFromPath(normalizedPath) {
|
|
10
|
+
if (normalizedPath.includes('/pnpm/') || normalizedPath.includes('/.pnpm/')) {
|
|
11
|
+
return 'pnpm';
|
|
12
|
+
}
|
|
13
|
+
if (normalizedPath.includes('/.bun/') ||
|
|
14
|
+
normalizedPath.includes('/bun/install/')) {
|
|
15
|
+
return 'bun';
|
|
16
|
+
}
|
|
17
|
+
if (normalizedPath.includes('/.yarn/') ||
|
|
18
|
+
normalizedPath.includes('/yarn/global/')) {
|
|
19
|
+
return 'yarn';
|
|
20
|
+
}
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
export function detectGlobalCliPackageManager(argv, env) {
|
|
24
|
+
const candidates = argv.slice(0, 2).filter(Boolean);
|
|
25
|
+
for (const candidate of candidates) {
|
|
26
|
+
const detected = detectFromPath(normalizePathForDetection(candidate));
|
|
27
|
+
if (detected) {
|
|
28
|
+
return detected;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
const pnpmHome = env.PNPM_HOME?.trim();
|
|
32
|
+
if (pnpmHome) {
|
|
33
|
+
const normalizedHome = normalizePathForDetection(pnpmHome);
|
|
34
|
+
for (const candidate of candidates) {
|
|
35
|
+
if (isUnderNormalizedPath(normalizePathForDetection(candidate), normalizedHome)) {
|
|
36
|
+
return 'pnpm';
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
return 'npm';
|
|
41
|
+
}
|
|
42
|
+
function installArgsForManager(manager, packageSpec) {
|
|
43
|
+
switch (manager) {
|
|
44
|
+
case 'npm':
|
|
45
|
+
return ['install', '--global', packageSpec];
|
|
46
|
+
case 'pnpm':
|
|
47
|
+
return ['add', '-g', packageSpec];
|
|
48
|
+
case 'yarn':
|
|
49
|
+
return ['global', 'add', packageSpec];
|
|
50
|
+
case 'bun':
|
|
51
|
+
return ['install', '-g', packageSpec];
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
function executableForManager(manager) {
|
|
55
|
+
return manager;
|
|
56
|
+
}
|
|
57
|
+
function resolveWindowsManagerInvocation(manager, packageSpec, options) {
|
|
58
|
+
if (manager === 'npm') {
|
|
59
|
+
return resolveNpmWindowsInvocation(packageSpec, options);
|
|
60
|
+
}
|
|
61
|
+
const comspec = options.env.ComSpec?.trim() || 'cmd.exe';
|
|
62
|
+
return {
|
|
63
|
+
file: comspec,
|
|
64
|
+
args: [
|
|
65
|
+
'/d',
|
|
66
|
+
'/s',
|
|
67
|
+
'/c',
|
|
68
|
+
manager,
|
|
69
|
+
...installArgsForManager(manager, packageSpec),
|
|
70
|
+
],
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
function resolveNpmWindowsInvocation(packageSpec, options) {
|
|
74
|
+
const npmArgs = installArgsForManager('npm', packageSpec);
|
|
75
|
+
const environmentPath = options.env.npm_execpath?.trim();
|
|
76
|
+
const standardPath = win32.join(win32.dirname(options.nodeExecutable), 'node_modules', 'npm', 'bin', 'npm-cli.js');
|
|
77
|
+
const npmCliPath = [environmentPath, standardPath].find((candidate) => candidate !== undefined &&
|
|
78
|
+
win32.isAbsolute(candidate) &&
|
|
79
|
+
win32.basename(candidate).toLowerCase() === 'npm-cli.js' &&
|
|
80
|
+
options.fileExists(candidate));
|
|
81
|
+
if (!npmCliPath) {
|
|
82
|
+
return null;
|
|
83
|
+
}
|
|
84
|
+
return {
|
|
85
|
+
file: options.nodeExecutable,
|
|
86
|
+
args: [npmCliPath, ...npmArgs],
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
export function formatGlobalCliInstallCommand(packageSpec, argv, env) {
|
|
90
|
+
const manager = detectGlobalCliPackageManager(argv, env);
|
|
91
|
+
switch (manager) {
|
|
92
|
+
case 'npm':
|
|
93
|
+
return `npm install --global ${packageSpec}`;
|
|
94
|
+
case 'pnpm':
|
|
95
|
+
return `pnpm add -g ${packageSpec}`;
|
|
96
|
+
case 'yarn':
|
|
97
|
+
return `yarn global add ${packageSpec}`;
|
|
98
|
+
case 'bun':
|
|
99
|
+
return `bun install -g ${packageSpec}`;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
export function resolveGlobalCliInstallerInvocation(packageSpec, options) {
|
|
103
|
+
const manager = detectGlobalCliPackageManager(options.argv, options.env);
|
|
104
|
+
if (options.platform === 'win32') {
|
|
105
|
+
return resolveWindowsManagerInvocation(manager, packageSpec, options);
|
|
106
|
+
}
|
|
107
|
+
return {
|
|
108
|
+
file: executableForManager(manager),
|
|
109
|
+
args: installArgsForManager(manager, packageSpec),
|
|
110
|
+
};
|
|
111
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-bundle-update-guard.d.ts","sourceRoot":"","sources":["../../src/app/tool-bundle-update-guard.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"tool-bundle-update-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4BAA4B,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAMtE;AAED,wBAAsB,wBAAwB,CAC5C,OAAO,EAAE,4BAA4B,EACrC,SAAS,GAAE,OAAO,CAAC,iCAAiC,CAAM,GACzD,OAAO,CAAC,OAAO,CAAC,CA6ElB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { spawn } from 'node:child_process';
|
|
2
2
|
import { existsSync } from 'node:fs';
|
|
3
|
-
import {
|
|
3
|
+
import { formatGlobalCliInstallCommand, resolveGlobalCliInstallerInvocation, } from './global-cli-installer.js';
|
|
4
4
|
import { resolveUpdateAvailability } from './update-notifier.js';
|
|
5
5
|
import { confirmAction } from '../commands/shared/shared.prompts.js';
|
|
6
6
|
import { CliError } from '../errors/index.js';
|
|
@@ -67,25 +67,6 @@ export function isBundledToolMutationCommand(command) {
|
|
|
67
67
|
}
|
|
68
68
|
return path[0] === 'tools' && (path[1] === 'install' || path[1] === 'update');
|
|
69
69
|
}
|
|
70
|
-
function resolveInstallerInvocation(options, dependencies, packageVersion) {
|
|
71
|
-
const npmArgs = ['install', '--global', packageVersion];
|
|
72
|
-
if (dependencies.platform !== 'win32') {
|
|
73
|
-
return { file: 'npm', args: npmArgs };
|
|
74
|
-
}
|
|
75
|
-
const environmentPath = options.env.npm_execpath?.trim();
|
|
76
|
-
const standardPath = win32.join(win32.dirname(dependencies.nodeExecutable), 'node_modules', 'npm', 'bin', 'npm-cli.js');
|
|
77
|
-
const npmCliPath = [environmentPath, standardPath].find((candidate) => candidate !== undefined &&
|
|
78
|
-
win32.isAbsolute(candidate) &&
|
|
79
|
-
win32.basename(candidate).toLowerCase() === 'npm-cli.js' &&
|
|
80
|
-
dependencies.fileExists(candidate));
|
|
81
|
-
if (!npmCliPath) {
|
|
82
|
-
return null;
|
|
83
|
-
}
|
|
84
|
-
return {
|
|
85
|
-
file: dependencies.nodeExecutable,
|
|
86
|
-
args: [npmCliPath, ...npmArgs],
|
|
87
|
-
};
|
|
88
|
-
}
|
|
89
70
|
export async function guardBundledToolMutation(options, overrides = {}) {
|
|
90
71
|
if (options.dryRun) {
|
|
91
72
|
return false;
|
|
@@ -99,7 +80,8 @@ export async function guardBundledToolMutation(options, overrides = {}) {
|
|
|
99
80
|
`bundled with the currently running CLI ${options.currentVersion}, which ` +
|
|
100
81
|
'can only install its own bundled tool versions. The available CLI may ' +
|
|
101
82
|
'bundle newer tool versions.');
|
|
102
|
-
const
|
|
83
|
+
const packageSpec = `${CLI_PACKAGE}@${availableVersion}`;
|
|
84
|
+
const installCommand = formatGlobalCliInstallCommand(packageSpec, options.argv, options.env);
|
|
103
85
|
let accepted = false;
|
|
104
86
|
try {
|
|
105
87
|
accepted = await dependencies.confirmAction(`Update the OAT CLI to ${availableVersion} before running ${options.commandPath}?`, { interactive: options.interactive });
|
|
@@ -113,7 +95,13 @@ export async function guardBundledToolMutation(options, overrides = {}) {
|
|
|
113
95
|
'versions may be older than those bundled with the available CLI.');
|
|
114
96
|
return false;
|
|
115
97
|
}
|
|
116
|
-
const invocation =
|
|
98
|
+
const invocation = resolveGlobalCliInstallerInvocation(packageSpec, {
|
|
99
|
+
argv: options.argv,
|
|
100
|
+
env: options.env,
|
|
101
|
+
platform: dependencies.platform,
|
|
102
|
+
nodeExecutable: dependencies.nodeExecutable,
|
|
103
|
+
fileExists: dependencies.fileExists,
|
|
104
|
+
});
|
|
117
105
|
if (!invocation) {
|
|
118
106
|
throw new CliError('Could not locate npm-cli.js for a shell-free Windows update. ' +
|
|
119
107
|
`No tools were changed. Run this command manually: ${installCommand}`, 2);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update-notifier.d.ts","sourceRoot":"","sources":["../../src/app/update-notifier.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"update-notifier.d.ts","sourceRoot":"","sources":["../../src/app/update-notifier.ts"],"names":[],"mappings":"AAIA,OAAO,EAAkB,KAAK,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAErE,OA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AAC,0BAA0B,CAAM,GAClD,OAAO,CAAC,IAAI,CAAC,CAmCf"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { readFile as readFileDefault } from 'node:fs/promises';
|
|
2
2
|
import { join } from 'node:path';
|
|
3
|
+
import { formatGlobalCliInstallCommand } from './global-cli-installer.js';
|
|
3
4
|
import { readUserConfig } from '../config/oat-config.js';
|
|
4
5
|
import { atomicWriteJson } from '../fs/io.js';
|
|
5
6
|
const CHECK_TTL_MS = 24 * 60 * 60 * 1000;
|
|
@@ -145,9 +146,9 @@ function shouldNotify(cache, latestVersion, nowMs) {
|
|
|
145
146
|
return (cache.lastNotifiedVersion !== latestVersion ||
|
|
146
147
|
!isTtlFresh(cache.lastNotifiedAt, nowMs, NOTICE_TTL_MS));
|
|
147
148
|
}
|
|
148
|
-
function formatNotice(currentVersion, latestVersion) {
|
|
149
|
+
function formatNotice(currentVersion, latestVersion, argv, env) {
|
|
149
150
|
return (`Update available: ${currentVersion} → ${latestVersion}\n` +
|
|
150
|
-
|
|
151
|
+
`Run: ${formatGlobalCliInstallCommand('@open-agent-toolkit/cli@latest', argv, env)}`);
|
|
151
152
|
}
|
|
152
153
|
async function resolveUpdateAvailabilityState(options, overrides) {
|
|
153
154
|
if (!isStaticallyEligible(options)) {
|
|
@@ -230,7 +231,7 @@ export async function maybeNotifyAboutUpdate(options, overrides = {}) {
|
|
|
230
231
|
if (state.latestVersion &&
|
|
231
232
|
shouldNotify(state.cache, state.latestVersion, state.nowMs)) {
|
|
232
233
|
try {
|
|
233
|
-
options.logger.warn(formatNotice(options.currentVersion, state.latestVersion));
|
|
234
|
+
options.logger.warn(formatNotice(options.currentVersion, state.latestVersion, options.argv, options.env));
|
|
234
235
|
state.cache = {
|
|
235
236
|
...state.cache,
|
|
236
237
|
lastNotifiedAt: state.nowTimestamp,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/commands/init/tools/index.ts"],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5E;AAUD,UAAU,oBAAoB;IAC5B,cAAc,EAAE,aAAa,EAAE,CAAC;CACjC;AAwKD,UAAU,eAAe;IACvB,IAAI,EAAE,QAAQ,CAAC;IACf,KAAK,EAAE,aAAa,CAAC;CACtB;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,eAAe,EAAE,EACvB,OAAO,EAAE,eAAe,EAAE,GACzB,MAAM,CASR;AA4GD,wBAAgB,2BAA2B,IAAI,oBAAoB,GAAG,IAAI,CAIzE;AA4UD,UAAU,aAAa;IACrB,IAAI,EAAE,QAAQ,CAAC;IACf,KAAK,EAAE,iBAAiB,CAAC;CAC1B;AAED,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,aAAa,EAAE,GAAG,MAAM,CA8CxE;AAED,wBAAsB,YAAY,CAChC,OAAO,EAAE,cAAc,EACvB,YAAY,EAAE,qBAAqB,GAClC,OAAO,CAAC,QAAQ,EAAE,CAAC,CA6erB;AAED,wBAAsB,wBAAwB,CAC5C,OAAO,EAAE,cAAc,GACtB,OAAO,CAAC,QAAQ,EAAE,CAAC,CAErB;AAED,wBAAgB,sBAAsB,CACpC,SAAS,GAAE,OAAO,CAAC,qBAAqB,CAAM,GAC7C,OAAO,CA4BT"}
|
|
@@ -23,6 +23,7 @@ import { createInitToolsIdeasCommand } from './ideas/index.js';
|
|
|
23
23
|
import { installIdeas as defaultInstallIdeas, } from './ideas/install-ideas.js';
|
|
24
24
|
import { buildPackInstallStateMap, } from './install-state.js';
|
|
25
25
|
import { createInitToolsProjectManagementCommand } from './project-management/index.js';
|
|
26
|
+
import { buildProjectManagementAgentsSectionBody, PROJECT_MANAGEMENT_AGENTS_SECTION_KEY, } from './project-management/agents-guidance.js';
|
|
26
27
|
import { installProjectManagement as defaultInstallProjectManagement, } from './project-management/install-project-management.js';
|
|
27
28
|
import { createInitToolsResearchCommand } from './research/index.js';
|
|
28
29
|
import { installResearch as defaultInstallResearch, } from './research/install-research.js';
|
|
@@ -863,11 +864,19 @@ export async function runInitTools(context, dependencies) {
|
|
|
863
864
|
}));
|
|
864
865
|
const sectionBody = buildToolPacksSectionBody(packScopeInfo);
|
|
865
866
|
const sectionResult = await dependencies.upsertAgentsMdSection(projectRoot, 'tools', sectionBody);
|
|
867
|
+
const projectManagementSectionResult = selectedPacks.includes('project-management')
|
|
868
|
+
? await dependencies.upsertAgentsMdSection(projectRoot, PROJECT_MANAGEMENT_AGENTS_SECTION_KEY, buildProjectManagementAgentsSectionBody())
|
|
869
|
+
: null;
|
|
866
870
|
// Migrate: remove legacy <!-- OAT workflows --> section if present
|
|
867
871
|
await dependencies.removeAgentsMdSection(projectRoot, 'workflows');
|
|
868
872
|
if (!context.json && sectionResult.action !== 'no-change') {
|
|
869
873
|
context.logger.info(`AGENTS.md tool packs section ${sectionResult.action}.`);
|
|
870
874
|
}
|
|
875
|
+
if (!context.json &&
|
|
876
|
+
projectManagementSectionResult !== null &&
|
|
877
|
+
projectManagementSectionResult.action !== 'no-change') {
|
|
878
|
+
context.logger.info(`AGENTS.md project-management section ${projectManagementSectionResult.action}.`);
|
|
879
|
+
}
|
|
871
880
|
const config = await dependencies.readOatConfig(projectRoot);
|
|
872
881
|
const tools = buildInstalledToolsConfig(selectedPacks, initialPackStates, config.tools);
|
|
873
882
|
await dependencies.writeOatConfig(projectRoot, { ...config, tools });
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agents-guidance.d.ts","sourceRoot":"","sources":["../../../../../src/commands/init/tools/project-management/agents-guidance.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,qCAAqC,uBAAuB,CAAC;AAE1E,wBAAgB,uCAAuC,IAAI,MAAM,CAehE"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export const PROJECT_MANAGEMENT_AGENTS_SECTION_KEY = 'project-management';
|
|
2
|
+
export function buildProjectManagementAgentsSectionBody() {
|
|
3
|
+
return [
|
|
4
|
+
'### Project Management',
|
|
5
|
+
'',
|
|
6
|
+
'- Repository planning and durable context live under `.oat/repo/`.',
|
|
7
|
+
'- Consult it when prioritizing or planning work, checking the backlog, starting or closing tracked work, or looking for established repository context.',
|
|
8
|
+
'- Start with `.oat/repo/AGENTS.md`; it routes to `pjm/` for active state and `reference/` for durable records.',
|
|
9
|
+
'- If the surface is missing, initialize it with `oat pjm init`.',
|
|
10
|
+
'',
|
|
11
|
+
'### Decision Records',
|
|
12
|
+
'',
|
|
13
|
+
'- Before finalizing a durable repository decision, review `.oat/repo/reference/decisions/index.md` and any relevant records.',
|
|
14
|
+
'- When the user asks to record a durable decision or confirms a proposed capture, use `oat-pjm-decision`; use `oat decision new` for the CLI path.',
|
|
15
|
+
'- Do not hand-edit the generated decision index; run `oat decision regenerate-index` after record changes.',
|
|
16
|
+
].join('\n');
|
|
17
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/commands/init/tools/project-management/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,aAAa,EACnB,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/commands/init/tools/project-management/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,aAAa,EACnB,MAAM,sBAAsB,CAAC;AAY9B,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAMpC,OAAO,EAEL,KAAK,+BAA+B,EACpC,KAAK,8BAA8B,EACpC,MAAM,8BAA8B,CAAC;AAMtC,UAAU,sCAAsC;IAC9C,mBAAmB,EAAE,CAAC,OAAO,EAAE,aAAa,KAAK,cAAc,CAAC;IAChE,kBAAkB,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IACrD,iBAAiB,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAAC;IACzC,wBAAwB,EAAE,CACxB,OAAO,EAAE,+BAA+B,KACrC,OAAO,CAAC,8BAA8B,CAAC,CAAC;CAC9C;AASD,wBAAgB,uCAAuC,CACrD,SAAS,GAAE,OAAO,CAAC,sCAAsC,CAAM,GAC9D,OAAO,CAsHT"}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { buildCommandContext, } from '../../../../app/command-context.js';
|
|
2
|
+
import { upsertAgentsMdSection, } from '../../../shared/agents-md.js';
|
|
2
3
|
import { readGlobalOptions } from '../../../shared/shared.utils.js';
|
|
3
4
|
import { canonicalPathsForPack, setInstalledCanonicalPaths, } from '../../../tools/shared/install-sync-context.js';
|
|
4
5
|
import { resolveAssetsRoot } from '../../../../fs/assets.js';
|
|
5
6
|
import { resolveProjectRoot } from '../../../../fs/paths.js';
|
|
6
7
|
import { Command } from 'commander';
|
|
8
|
+
import { buildProjectManagementAgentsSectionBody, PROJECT_MANAGEMENT_AGENTS_SECTION_KEY, } from './agents-guidance.js';
|
|
7
9
|
import { installProjectManagement as defaultInstallProjectManagement, } from './install-project-management.js';
|
|
8
10
|
const DEFAULT_DEPENDENCIES = {
|
|
9
11
|
buildCommandContext,
|
|
@@ -49,6 +51,17 @@ export function createInitToolsProjectManagementCommand(overrides = {}) {
|
|
|
49
51
|
targetRoot,
|
|
50
52
|
force: options.force,
|
|
51
53
|
});
|
|
54
|
+
didInstall = true;
|
|
55
|
+
let agentsGuidanceAction;
|
|
56
|
+
let agentsGuidanceWarning;
|
|
57
|
+
try {
|
|
58
|
+
const agentsGuidanceResult = await upsertAgentsMdSection(targetRoot, PROJECT_MANAGEMENT_AGENTS_SECTION_KEY, buildProjectManagementAgentsSectionBody());
|
|
59
|
+
agentsGuidanceAction = agentsGuidanceResult.action;
|
|
60
|
+
}
|
|
61
|
+
catch (error) {
|
|
62
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
63
|
+
agentsGuidanceWarning = `Could not update AGENTS.md project-management guidance: ${message}`;
|
|
64
|
+
}
|
|
52
65
|
if (context.json) {
|
|
53
66
|
context.logger.json({
|
|
54
67
|
status: 'ok',
|
|
@@ -56,6 +69,9 @@ export function createInitToolsProjectManagementCommand(overrides = {}) {
|
|
|
56
69
|
targetRoot,
|
|
57
70
|
assetsRoot,
|
|
58
71
|
result,
|
|
72
|
+
...(agentsGuidanceWarning === undefined
|
|
73
|
+
? {}
|
|
74
|
+
: { warnings: [agentsGuidanceWarning] }),
|
|
59
75
|
});
|
|
60
76
|
}
|
|
61
77
|
else {
|
|
@@ -63,9 +79,15 @@ export function createInitToolsProjectManagementCommand(overrides = {}) {
|
|
|
63
79
|
context.logger.info(`Target root: ${targetRoot}`);
|
|
64
80
|
context.logger.info(`Skills: copied=${result.copiedSkills.length}, updated=${result.updatedSkills.length}, skipped=${result.skippedSkills.length}`);
|
|
65
81
|
context.logger.info(`Templates: copied=${result.copiedTemplates.length}, updated=${result.updatedTemplates.length}, skipped=${result.skippedTemplates.length}`);
|
|
82
|
+
if (agentsGuidanceAction !== undefined &&
|
|
83
|
+
agentsGuidanceAction !== 'no-change') {
|
|
84
|
+
context.logger.info(`AGENTS.md project-management section ${agentsGuidanceAction}.`);
|
|
85
|
+
}
|
|
86
|
+
if (agentsGuidanceWarning !== undefined) {
|
|
87
|
+
context.logger.warn(agentsGuidanceWarning);
|
|
88
|
+
}
|
|
66
89
|
context.logger.info('Run: oat sync --scope project');
|
|
67
90
|
}
|
|
68
|
-
didInstall = true;
|
|
69
91
|
process.exitCode = 0;
|
|
70
92
|
}
|
|
71
93
|
catch (error) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@open-agent-toolkit/cli",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.10",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Open Agent Toolkit CLI",
|
|
6
6
|
"homepage": "https://github.com/voxmedia/open-agent-toolkit/tree/main/packages/cli",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"ora": "^9.0.0",
|
|
35
35
|
"yaml": "2.8.2",
|
|
36
36
|
"zod": "^3.25.76",
|
|
37
|
-
"@open-agent-toolkit/control-plane": "0.2.
|
|
37
|
+
"@open-agent-toolkit/control-plane": "0.2.10"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@types/node": "^22.10.0",
|