@open-agent-toolkit/cli 0.1.60 → 0.1.62
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 +14 -0
- package/assets/docs/cli-utilities/config-and-local-state.md +20 -0
- package/assets/docs/cli-utilities/tool-packs.md +19 -0
- package/assets/public-package-versions.json +4 -4
- package/dist/app/tool-bundle-update-guard.d.ts +31 -0
- package/dist/app/tool-bundle-update-guard.d.ts.map +1 -0
- package/dist/app/tool-bundle-update-guard.js +134 -0
- package/dist/app/update-notifier.d.ts +28 -0
- package/dist/app/update-notifier.d.ts.map +1 -0
- package/dist/app/update-notifier.js +250 -0
- package/dist/commands/config/index.d.ts.map +1 -1
- package/dist/commands/config/index.js +42 -5
- package/dist/config/oat-config.d.ts +1 -0
- package/dist/config/oat-config.d.ts.map +1 -1
- package/dist/config/oat-config.js +3 -0
- package/dist/config/resolve.d.ts.map +1 -1
- package/dist/config/resolve.js +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +46 -2
- package/dist/providers/codex/codec/shared.d.ts +2 -2
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -40,6 +40,20 @@ Additional useful entry points:
|
|
|
40
40
|
- `oat repo archive sync`
|
|
41
41
|
- `oat doctor`
|
|
42
42
|
|
|
43
|
+
## Update Notifications
|
|
44
|
+
|
|
45
|
+
On ordinary interactive command runs, OAT may print a passive notice when npm's stable `latest` CLI version is newer than the installed version. The cache normally limits checks to once every 24 hours and same-version notices to once every 72 hours; overlapping CLI processes can each perform a check or print a notice.
|
|
46
|
+
|
|
47
|
+
`oat init`, `oat tools install`, and `oat tools update` are different because they copy tools bundled with the running CLI. Before an eligible interactive mutation, a known newer CLI triggers a warning that the current CLI can only install its own bundled tool versions and that the available CLI may bundle newer versions. OAT then offers, defaulting to no, to run `npm install --global @open-agent-toolkit/cli@<validated-version>` for the exact validated stable version. Acceptance updates the CLI package, stops before changing tools, and asks you to rerun the original command. Declining or aborting continues with the current bundle after a warning. An installer failure stops the tool mutation and reports the command you can retry.
|
|
48
|
+
|
|
49
|
+
This warning does not mean tools installed from the current bundle are incompatible with the current CLI; it only identifies that a newer CLI release may include newer bundled tool versions. Dry-run, JSON, non-interactive, CI, test, source-development, and ephemeral package-runner invocations do not prompt or install. Ordinary eligible commands remain passive.
|
|
50
|
+
|
|
51
|
+
Set `NO_UPDATE_NOTIFIER` to a truthy value (for example, `1`, `true`, `yes`, or `on`) to suppress checks for one process; empty, `0`, and `false` do not suppress them. Or persist the user-level preference:
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
oat config set updateNotifications false --user
|
|
55
|
+
```
|
|
56
|
+
|
|
43
57
|
## Inspection Commands
|
|
44
58
|
|
|
45
59
|
Use these commands when you want structured runtime/project state out of the CLI:
|
|
@@ -113,6 +113,26 @@ Use `oat config` for repo runtime config inspection and supported key mutation.
|
|
|
113
113
|
|
|
114
114
|
Use `oat config dump --json` when you need the whole resolved config in one machine-readable response rather than a single key or a human-oriented list view.
|
|
115
115
|
|
|
116
|
+
### Update notifications
|
|
117
|
+
|
|
118
|
+
OAT can passively report when npm's stable `latest` CLI version is newer during an ordinary interactive command run. The cache normally limits checks to once every 24 hours and same-version notices to once every 72 hours; overlapping CLI processes can each perform a check or print a notice. Ordinary eligible commands only show update guidance and do not prompt.
|
|
119
|
+
|
|
120
|
+
Before eligible interactive `oat init`, `oat tools install`, or `oat tools update` mutations, a known newer stable CLI receives special handling. These commands copy tool versions bundled with the running CLI, so OAT warns that the older CLI can only install its own bundle and that the available CLI may contain newer bundled tools. The default-no prompt offers to install the exact validated version with:
|
|
121
|
+
|
|
122
|
+
```bash
|
|
123
|
+
npm install --global @open-agent-toolkit/cli@<validated-version>
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
If accepted, OAT updates the CLI package, stops before changing tools, and asks you to rerun the original command under the new CLI. If declined or the prompt is aborted, OAT warns and continues with the current bundle. If npm fails, the requested tool mutation does not run and the error includes a command to retry. The warning describes possible bundle freshness; it does not claim that tools installed by the current CLI are incompatible with that CLI.
|
|
127
|
+
|
|
128
|
+
Checks, notices, and the update offer are skipped for JSON, non-interactive, CI, test, source-development, and ephemeral package-runner invocations. Guarded dry-run commands also skip the prompt and installer. Set `NO_UPDATE_NOTIFIER` to a truthy value (for example, `1`, `true`, `yes`, or `on`) to suppress checks for one process; empty, `0`, and `false` do not suppress them. Or disable checks persistently in user config:
|
|
129
|
+
|
|
130
|
+
```bash
|
|
131
|
+
oat config set updateNotifications false --user
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
The preference defaults to `true`; run the same command with `true` to re-enable it. Cached check and notice timestamps live in `~/.oat/update-check.json`, separate from the user-authored preference in `~/.oat/config.json`.
|
|
135
|
+
|
|
116
136
|
Dispatch policy keys are part of this surface, but provider-specific generation
|
|
117
137
|
still belongs to provider commands. Use `oat config describe
|
|
118
138
|
workflow.dispatchPolicy.policy` to inspect capped managed, managed uncapped,
|
|
@@ -49,6 +49,25 @@ skills can use the utility engine directly.
|
|
|
49
49
|
|
|
50
50
|
The `oat tools` command group provides a unified interface for managing installed tools (skills and agents) across scopes.
|
|
51
51
|
|
|
52
|
+
### CLI updates before bundled-tool mutations
|
|
53
|
+
|
|
54
|
+
Tool packs ship inside the OAT CLI package. An older CLI can therefore install or update only the tool versions in its own bundle, while a newer stable CLI release may contain newer bundled versions. This is a bundle-freshness warning, not a claim that tools installed by the current CLI are immediately incompatible with it.
|
|
55
|
+
|
|
56
|
+
Before an eligible interactive `oat init`, `oat tools install` (including pack subcommands), or `oat tools update` mutation, OAT checks the cached stable CLI availability. If a newer version is known, it explains the bundle difference and offers, with a default answer of no, to install that exact validated version:
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
npm install --global @open-agent-toolkit/cli@<validated-version>
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
- Accepting updates the CLI package only, stops before changing bundled tools, and asks you to rerun the original command under the new CLI.
|
|
63
|
+
- Declining or aborting warns that the current bundle may be older, then continues the requested command.
|
|
64
|
+
- If npm fails, OAT does not run the tool mutation and reports how to retry the CLI installation.
|
|
65
|
+
- Dry-run, JSON, non-interactive, opted-out, CI, test, source-development, and ephemeral package-runner invocations do not prompt or install.
|
|
66
|
+
|
|
67
|
+
Set `NO_UPDATE_NOTIFIER` to a truthy value (for example, `1`, `true`, `yes`, or `on`) to suppress checks for one process; empty, `0`, and `false` do not suppress them.
|
|
68
|
+
|
|
69
|
+
Other eligible commands keep the passive update notice and never launch the installer.
|
|
70
|
+
|
|
52
71
|
## Install vs. initialize
|
|
53
72
|
|
|
54
73
|
The `project-management` pack has two lifecycle steps:
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { Command } from 'commander';
|
|
2
|
+
import type { UpdateNotifierOptions } from './update-notifier.js';
|
|
3
|
+
export interface RerunCommandDisplay {
|
|
4
|
+
shell: 'POSIX shell' | 'PowerShell';
|
|
5
|
+
command: string;
|
|
6
|
+
}
|
|
7
|
+
export interface ToolBundleUpdateGuardOptions extends UpdateNotifierOptions {
|
|
8
|
+
commandPath: string;
|
|
9
|
+
dryRun: boolean;
|
|
10
|
+
rerunCommand: RerunCommandDisplay;
|
|
11
|
+
}
|
|
12
|
+
interface InstallerOptions {
|
|
13
|
+
shell: false;
|
|
14
|
+
stdio: 'inherit';
|
|
15
|
+
}
|
|
16
|
+
export interface ToolBundleUpdateGuardDependencies {
|
|
17
|
+
resolveUpdateAvailability: (options: UpdateNotifierOptions) => Promise<string | null>;
|
|
18
|
+
confirmAction: (message: string, context: {
|
|
19
|
+
interactive: boolean;
|
|
20
|
+
}) => Promise<boolean>;
|
|
21
|
+
installCli: (file: string, args: string[], options: InstallerOptions) => Promise<void>;
|
|
22
|
+
platform: NodeJS.Platform;
|
|
23
|
+
nodeExecutable: string;
|
|
24
|
+
fileExists: (path: string) => boolean;
|
|
25
|
+
}
|
|
26
|
+
export declare function formatCommandPath(command: Command): string;
|
|
27
|
+
export declare function formatRerunCommand(argv: string[], platform?: NodeJS.Platform): RerunCommandDisplay;
|
|
28
|
+
export declare function isBundledToolMutationCommand(command: Command): boolean;
|
|
29
|
+
export declare function guardBundledToolMutation(options: ToolBundleUpdateGuardOptions, overrides?: Partial<ToolBundleUpdateGuardDependencies>): Promise<boolean>;
|
|
30
|
+
export {};
|
|
31
|
+
//# sourceMappingURL=tool-bundle-update-guard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool-bundle-update-guard.d.ts","sourceRoot":"","sources":["../../src/app/tool-bundle-update-guard.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAI/D,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,aAAa,GAAG,YAAY,CAAC;IACpC,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,4BAA6B,SAAQ,qBAAqB;IACzE,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,OAAO,CAAC;IAChB,YAAY,EAAE,mBAAmB,CAAC;CACnC;AAED,UAAU,gBAAgB;IACxB,KAAK,EAAE,KAAK,CAAC;IACb,KAAK,EAAE,SAAS,CAAC;CAClB;AAED,MAAM,WAAW,iCAAiC;IAChD,yBAAyB,EAAE,CACzB,OAAO,EAAE,qBAAqB,KAC3B,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IAC5B,aAAa,EAAE,CACb,OAAO,EAAE,MAAM,EACf,OAAO,EAAE;QAAE,WAAW,EAAE,OAAO,CAAA;KAAE,KAC9B,OAAO,CAAC,OAAO,CAAC,CAAC;IACtB,UAAU,EAAE,CACV,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EAAE,EACd,OAAO,EAAE,gBAAgB,KACtB,OAAO,CAAC,IAAI,CAAC,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC,QAAQ,CAAC;IAC1B,cAAc,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC;CACvC;AA6CD,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,CAE1D;AAgBD,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,MAAM,EAAE,EACd,QAAQ,GAAE,MAAM,CAAC,QAA2B,GAC3C,mBAAmB,CAOrB;AAED,wBAAgB,4BAA4B,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAMtE;AA0CD,wBAAsB,wBAAwB,CAC5C,OAAO,EAAE,4BAA4B,EACrC,SAAS,GAAE,OAAO,CAAC,iCAAiC,CAAM,GACzD,OAAO,CAAC,OAAO,CAAC,CAsElB"}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { spawn } from 'node:child_process';
|
|
2
|
+
import { existsSync } from 'node:fs';
|
|
3
|
+
import { win32 } from 'node:path';
|
|
4
|
+
import { resolveUpdateAvailability } from './update-notifier.js';
|
|
5
|
+
import { confirmAction } from '../commands/shared/shared.prompts.js';
|
|
6
|
+
import { CliError } from '../errors/index.js';
|
|
7
|
+
const CLI_PACKAGE = '@open-agent-toolkit/cli';
|
|
8
|
+
function installCli(file, args, options) {
|
|
9
|
+
return new Promise((resolve, reject) => {
|
|
10
|
+
const child = spawn(file, args, options);
|
|
11
|
+
child.once('error', reject);
|
|
12
|
+
child.once('close', (code, signal) => {
|
|
13
|
+
if (code === 0) {
|
|
14
|
+
resolve();
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
reject(new Error(signal
|
|
18
|
+
? `${file} exited after signal ${signal}`
|
|
19
|
+
: `${file} exited with code ${code ?? 'unknown'}`));
|
|
20
|
+
});
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
const DEFAULT_DEPENDENCIES = {
|
|
24
|
+
resolveUpdateAvailability,
|
|
25
|
+
confirmAction,
|
|
26
|
+
installCli,
|
|
27
|
+
platform: process.platform,
|
|
28
|
+
nodeExecutable: process.execPath,
|
|
29
|
+
fileExists: existsSync,
|
|
30
|
+
};
|
|
31
|
+
function getCommandPath(command) {
|
|
32
|
+
const path = [];
|
|
33
|
+
let current = command;
|
|
34
|
+
while (current) {
|
|
35
|
+
path.unshift(current.name());
|
|
36
|
+
current = current.parent;
|
|
37
|
+
}
|
|
38
|
+
return path;
|
|
39
|
+
}
|
|
40
|
+
export function formatCommandPath(command) {
|
|
41
|
+
return getCommandPath(command).join(' ');
|
|
42
|
+
}
|
|
43
|
+
function quotePosixArgument(argument) {
|
|
44
|
+
if (/^[a-zA-Z0-9_@+=:,./-]+$/.test(argument)) {
|
|
45
|
+
return argument;
|
|
46
|
+
}
|
|
47
|
+
return `'${argument.replaceAll("'", `'"'"'`)}'`;
|
|
48
|
+
}
|
|
49
|
+
function quotePowerShellArgument(argument) {
|
|
50
|
+
if (/^[a-zA-Z0-9_:,./-]+$/.test(argument)) {
|
|
51
|
+
return argument;
|
|
52
|
+
}
|
|
53
|
+
return `'${argument.replaceAll("'", "''")}'`;
|
|
54
|
+
}
|
|
55
|
+
export function formatRerunCommand(argv, platform = process.platform) {
|
|
56
|
+
const windows = platform === 'win32';
|
|
57
|
+
const quoteArgument = windows ? quotePowerShellArgument : quotePosixArgument;
|
|
58
|
+
return {
|
|
59
|
+
shell: windows ? 'PowerShell' : 'POSIX shell',
|
|
60
|
+
command: ['oat', ...argv.slice(2)].map(quoteArgument).join(' '),
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
export function isBundledToolMutationCommand(command) {
|
|
64
|
+
const [, ...path] = getCommandPath(command);
|
|
65
|
+
if (path[0] === 'init') {
|
|
66
|
+
return true;
|
|
67
|
+
}
|
|
68
|
+
return path[0] === 'tools' && (path[1] === 'install' || path[1] === 'update');
|
|
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
|
+
export async function guardBundledToolMutation(options, overrides = {}) {
|
|
90
|
+
if (options.dryRun) {
|
|
91
|
+
return false;
|
|
92
|
+
}
|
|
93
|
+
const dependencies = { ...DEFAULT_DEPENDENCIES, ...overrides };
|
|
94
|
+
const availableVersion = await dependencies.resolveUpdateAvailability(options);
|
|
95
|
+
if (!availableVersion) {
|
|
96
|
+
return false;
|
|
97
|
+
}
|
|
98
|
+
options.logger.warn(`OAT CLI ${availableVersion} is available. ${options.commandPath} copies tools ` +
|
|
99
|
+
`bundled with the currently running CLI ${options.currentVersion}, which ` +
|
|
100
|
+
'can only install its own bundled tool versions. The available CLI may ' +
|
|
101
|
+
'bundle newer tool versions.');
|
|
102
|
+
const installCommand = `npm install --global ${CLI_PACKAGE}@${availableVersion}`;
|
|
103
|
+
let accepted = false;
|
|
104
|
+
try {
|
|
105
|
+
accepted = await dependencies.confirmAction(`Update the OAT CLI to ${availableVersion} before running ${options.commandPath}?`, { interactive: options.interactive });
|
|
106
|
+
}
|
|
107
|
+
catch {
|
|
108
|
+
options.logger.warn('Could not open the OAT CLI update prompt. Skipping the automatic CLI ' +
|
|
109
|
+
`update. To update manually, run: ${installCommand}`);
|
|
110
|
+
}
|
|
111
|
+
if (!accepted) {
|
|
112
|
+
options.logger.warn(`Continuing ${options.commandPath} with the current CLI's bundle. Its tool ` +
|
|
113
|
+
'versions may be older than those bundled with the available CLI.');
|
|
114
|
+
return false;
|
|
115
|
+
}
|
|
116
|
+
const invocation = resolveInstallerInvocation(options, dependencies, `${CLI_PACKAGE}@${availableVersion}`);
|
|
117
|
+
if (!invocation) {
|
|
118
|
+
throw new CliError('Could not locate npm-cli.js for a shell-free Windows update. ' +
|
|
119
|
+
`No tools were changed. Run this command manually: ${installCommand}`, 2);
|
|
120
|
+
}
|
|
121
|
+
try {
|
|
122
|
+
await dependencies.installCli(invocation.file, invocation.args, {
|
|
123
|
+
shell: false,
|
|
124
|
+
stdio: 'inherit',
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
catch {
|
|
128
|
+
throw new CliError(`Failed to update the OAT CLI to ${availableVersion}. ` +
|
|
129
|
+
`No tools were changed. Fix the npm installation issue and run: ${installCommand}`, 2);
|
|
130
|
+
}
|
|
131
|
+
options.logger.info(`Updated the OAT CLI to ${availableVersion}. To let the new CLI install ` +
|
|
132
|
+
`its bundled tools, rerun in ${options.rerunCommand.shell}:\n${options.rerunCommand.command}`);
|
|
133
|
+
return true;
|
|
134
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { type UserConfig } from '../config/oat-config.js';
|
|
2
|
+
import type { CliLogger } from '../ui/logger.js';
|
|
3
|
+
export interface UpdateCheckCache {
|
|
4
|
+
checkedAt?: string;
|
|
5
|
+
latestVersion?: string;
|
|
6
|
+
lastNotifiedAt?: string;
|
|
7
|
+
lastNotifiedVersion?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface UpdateNotifierOptions {
|
|
10
|
+
currentVersion: string;
|
|
11
|
+
home: string;
|
|
12
|
+
interactive: boolean;
|
|
13
|
+
json: boolean;
|
|
14
|
+
argv: string[];
|
|
15
|
+
env: NodeJS.ProcessEnv;
|
|
16
|
+
logger: CliLogger;
|
|
17
|
+
}
|
|
18
|
+
export interface UpdateNotifierDependencies {
|
|
19
|
+
now: () => Date;
|
|
20
|
+
readFile: (path: string) => Promise<string>;
|
|
21
|
+
atomicWriteJson: (path: string, data: unknown) => Promise<void>;
|
|
22
|
+
readUserConfig: (userConfigDir: string) => Promise<UserConfig>;
|
|
23
|
+
fetch: (input: string | URL | Request, init?: RequestInit) => Promise<Response>;
|
|
24
|
+
createTimeoutSignal: (timeoutMs: number) => AbortSignal;
|
|
25
|
+
}
|
|
26
|
+
export declare function resolveUpdateAvailability(options: UpdateNotifierOptions, overrides?: Partial<UpdateNotifierDependencies>): Promise<string | null>;
|
|
27
|
+
export declare function maybeNotifyAboutUpdate(options: UpdateNotifierOptions, overrides?: Partial<UpdateNotifierDependencies>): Promise<void>;
|
|
28
|
+
//# sourceMappingURL=update-notifier.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update-notifier.d.ts","sourceRoot":"","sources":["../../src/app/update-notifier.ts"],"names":[],"mappings":"AAGA,OAAO,EAAkB,KAAK,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAErE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAa5C,MAAM,WAAW,gBAAgB;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED,MAAM,WAAW,qBAAqB;IACpC,cAAc,EAAE,MAAM,CAAC;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,OAAO,CAAC;IACrB,IAAI,EAAE,OAAO,CAAC;IACd,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,GAAG,EAAE,MAAM,CAAC,UAAU,CAAC;IACvB,MAAM,EAAE,SAAS,CAAC;CACnB;AAED,MAAM,WAAW,0BAA0B;IACzC,GAAG,EAAE,MAAM,IAAI,CAAC;IAChB,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IAC5C,eAAe,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAChE,cAAc,EAAE,CAAC,aAAa,EAAE,MAAM,KAAK,OAAO,CAAC,UAAU,CAAC,CAAC;IAC/D,KAAK,EAAE,CACL,KAAK,EAAE,MAAM,GAAG,GAAG,GAAG,OAAO,EAC7B,IAAI,CAAC,EAAE,WAAW,KACf,OAAO,CAAC,QAAQ,CAAC,CAAC;IACvB,mBAAmB,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,WAAW,CAAC;CACzD;AAkRD,wBAAsB,yBAAyB,CAC7C,OAAO,EAAE,qBAAqB,EAC9B,SAAS,GAAE,OAAO,CAAC,0BAA0B,CAAM,GAClD,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAWxB;AAED,wBAAsB,sBAAsB,CAC1C,OAAO,EAAE,qBAAqB,EAC9B,SAAS,GAAE,OAAO,CAAC,0BAA0B,CAAM,GAClD,OAAO,CAAC,IAAI,CAAC,CA8Bf"}
|
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
import { readFile as readFileDefault } from 'node:fs/promises';
|
|
2
|
+
import { join } from 'node:path';
|
|
3
|
+
import { readUserConfig } from '../config/oat-config.js';
|
|
4
|
+
import { atomicWriteJson } from '../fs/io.js';
|
|
5
|
+
const CHECK_TTL_MS = 24 * 60 * 60 * 1000;
|
|
6
|
+
const NOTICE_TTL_MS = 72 * 60 * 60 * 1000;
|
|
7
|
+
const REGISTRY_TIMEOUT_MS = 1500;
|
|
8
|
+
const REGISTRY_URL = 'https://registry.npmjs.org/@open-agent-toolkit%2fcli/latest';
|
|
9
|
+
const STABLE_VERSION_PATTERN = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)$/;
|
|
10
|
+
const UTC_TIMESTAMP_PATTERN = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d{3})?Z$/;
|
|
11
|
+
const DEFAULT_DEPENDENCIES = {
|
|
12
|
+
now: () => new Date(),
|
|
13
|
+
readFile: (path) => readFileDefault(path, 'utf8'),
|
|
14
|
+
atomicWriteJson,
|
|
15
|
+
readUserConfig,
|
|
16
|
+
fetch: (input, init) => globalThis.fetch(input, init),
|
|
17
|
+
createTimeoutSignal: (timeoutMs) => AbortSignal.timeout(timeoutMs),
|
|
18
|
+
};
|
|
19
|
+
function parseStableVersion(value) {
|
|
20
|
+
if (typeof value !== 'string') {
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
const match = STABLE_VERSION_PATTERN.exec(value);
|
|
24
|
+
if (!match) {
|
|
25
|
+
return null;
|
|
26
|
+
}
|
|
27
|
+
const version = match.slice(1).map(Number);
|
|
28
|
+
if (version.length !== 3 ||
|
|
29
|
+
version.some((part) => !Number.isSafeInteger(part))) {
|
|
30
|
+
return null;
|
|
31
|
+
}
|
|
32
|
+
return version;
|
|
33
|
+
}
|
|
34
|
+
function compareVersions(left, right) {
|
|
35
|
+
for (let index = 0; index < left.length; index += 1) {
|
|
36
|
+
const difference = left[index] - right[index];
|
|
37
|
+
if (difference !== 0) {
|
|
38
|
+
return difference;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
return 0;
|
|
42
|
+
}
|
|
43
|
+
function isUtcTimestamp(value) {
|
|
44
|
+
return (typeof value === 'string' &&
|
|
45
|
+
UTC_TIMESTAMP_PATTERN.test(value) &&
|
|
46
|
+
Number.isFinite(Date.parse(value)));
|
|
47
|
+
}
|
|
48
|
+
function normalizeCache(value) {
|
|
49
|
+
if (typeof value !== 'object' || value === null || Array.isArray(value)) {
|
|
50
|
+
return {};
|
|
51
|
+
}
|
|
52
|
+
const raw = value;
|
|
53
|
+
const cache = {};
|
|
54
|
+
if (isUtcTimestamp(raw.checkedAt)) {
|
|
55
|
+
cache.checkedAt = raw.checkedAt;
|
|
56
|
+
}
|
|
57
|
+
if (parseStableVersion(raw.latestVersion)) {
|
|
58
|
+
cache.latestVersion = raw.latestVersion;
|
|
59
|
+
}
|
|
60
|
+
if (isUtcTimestamp(raw.lastNotifiedAt)) {
|
|
61
|
+
cache.lastNotifiedAt = raw.lastNotifiedAt;
|
|
62
|
+
}
|
|
63
|
+
if (parseStableVersion(raw.lastNotifiedVersion)) {
|
|
64
|
+
cache.lastNotifiedVersion = raw.lastNotifiedVersion;
|
|
65
|
+
}
|
|
66
|
+
return cache;
|
|
67
|
+
}
|
|
68
|
+
async function readUpdateCache(path, dependencies) {
|
|
69
|
+
try {
|
|
70
|
+
return normalizeCache(JSON.parse(await dependencies.readFile(path)));
|
|
71
|
+
}
|
|
72
|
+
catch {
|
|
73
|
+
return {};
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
function isTruthyEnvironmentValue(value) {
|
|
77
|
+
if (value === undefined) {
|
|
78
|
+
return false;
|
|
79
|
+
}
|
|
80
|
+
const normalized = value.trim().toLowerCase();
|
|
81
|
+
return normalized !== '' && normalized !== '0' && normalized !== 'false';
|
|
82
|
+
}
|
|
83
|
+
function isSourceDevelopment(argv) {
|
|
84
|
+
return argv
|
|
85
|
+
.slice(0, 2)
|
|
86
|
+
.some((argument) => /\.(?:[cm]?ts|tsx)$/.test(argument));
|
|
87
|
+
}
|
|
88
|
+
function isEphemeralRunner(argv, env) {
|
|
89
|
+
if (env.npm_command?.trim().toLowerCase() === 'exec' ||
|
|
90
|
+
env.npm_lifecycle_event?.trim().toLowerCase() === 'npx' ||
|
|
91
|
+
/(?:^|[/\\])(?:npx(?:-cli)?|pnpx|bunx)(?:\.[cm]?js|\.cmd)?$/.test(env.npm_execpath ?? '')) {
|
|
92
|
+
return true;
|
|
93
|
+
}
|
|
94
|
+
const invocation = argv.slice(0, 2).join('/');
|
|
95
|
+
return (/(?:^|[/\\])(?:npx|pnpx|bunx)(?:\.cmd)?(?:$|[/\\])/.test(invocation) ||
|
|
96
|
+
/[/\\](?:_npx|dlx)[/\\]/.test(invocation));
|
|
97
|
+
}
|
|
98
|
+
function isStaticallyEligible(options) {
|
|
99
|
+
if (!options.interactive || options.json) {
|
|
100
|
+
return false;
|
|
101
|
+
}
|
|
102
|
+
if (isTruthyEnvironmentValue(options.env.CI) ||
|
|
103
|
+
options.env.NODE_ENV?.trim().toLowerCase() === 'test' ||
|
|
104
|
+
isTruthyEnvironmentValue(options.env.VITEST) ||
|
|
105
|
+
isTruthyEnvironmentValue(options.env.VITEST_WORKER_ID) ||
|
|
106
|
+
isTruthyEnvironmentValue(options.env.JEST_WORKER_ID)) {
|
|
107
|
+
return false;
|
|
108
|
+
}
|
|
109
|
+
if (isTruthyEnvironmentValue(options.env.NO_UPDATE_NOTIFIER)) {
|
|
110
|
+
return false;
|
|
111
|
+
}
|
|
112
|
+
return (!isSourceDevelopment(options.argv) &&
|
|
113
|
+
!isEphemeralRunner(options.argv, options.env));
|
|
114
|
+
}
|
|
115
|
+
function isTtlFresh(timestamp, nowMs, ttlMs) {
|
|
116
|
+
if (timestamp === undefined) {
|
|
117
|
+
return false;
|
|
118
|
+
}
|
|
119
|
+
const ageMs = nowMs - Date.parse(timestamp);
|
|
120
|
+
return ageMs >= 0 && ageMs < ttlMs;
|
|
121
|
+
}
|
|
122
|
+
async function fetchLatestVersion(dependencies) {
|
|
123
|
+
try {
|
|
124
|
+
const response = await dependencies.fetch(REGISTRY_URL, {
|
|
125
|
+
headers: { accept: 'application/json' },
|
|
126
|
+
signal: dependencies.createTimeoutSignal(REGISTRY_TIMEOUT_MS),
|
|
127
|
+
});
|
|
128
|
+
if (!response.ok) {
|
|
129
|
+
return null;
|
|
130
|
+
}
|
|
131
|
+
const metadata = (await response.json());
|
|
132
|
+
if (typeof metadata !== 'object' ||
|
|
133
|
+
metadata === null ||
|
|
134
|
+
Array.isArray(metadata)) {
|
|
135
|
+
return null;
|
|
136
|
+
}
|
|
137
|
+
const version = metadata.version;
|
|
138
|
+
return parseStableVersion(version) ? version : null;
|
|
139
|
+
}
|
|
140
|
+
catch {
|
|
141
|
+
return null;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
function shouldNotify(cache, latestVersion, nowMs) {
|
|
145
|
+
return (cache.lastNotifiedVersion !== latestVersion ||
|
|
146
|
+
!isTtlFresh(cache.lastNotifiedAt, nowMs, NOTICE_TTL_MS));
|
|
147
|
+
}
|
|
148
|
+
function formatNotice(currentVersion, latestVersion) {
|
|
149
|
+
return (`Update available: ${currentVersion} → ${latestVersion}\n` +
|
|
150
|
+
'Run: npm install -g @open-agent-toolkit/cli@latest');
|
|
151
|
+
}
|
|
152
|
+
async function resolveUpdateAvailabilityState(options, overrides) {
|
|
153
|
+
if (!isStaticallyEligible(options)) {
|
|
154
|
+
return null;
|
|
155
|
+
}
|
|
156
|
+
const currentVersion = parseStableVersion(options.currentVersion);
|
|
157
|
+
if (!currentVersion) {
|
|
158
|
+
return null;
|
|
159
|
+
}
|
|
160
|
+
const dependencies = {
|
|
161
|
+
...DEFAULT_DEPENDENCIES,
|
|
162
|
+
...overrides,
|
|
163
|
+
};
|
|
164
|
+
const userConfigDir = join(options.home, '.oat');
|
|
165
|
+
const userConfig = await dependencies.readUserConfig(userConfigDir);
|
|
166
|
+
if (userConfig.updateNotifications === false) {
|
|
167
|
+
return null;
|
|
168
|
+
}
|
|
169
|
+
const cachePath = join(userConfigDir, 'update-check.json');
|
|
170
|
+
let cache = await readUpdateCache(cachePath, dependencies);
|
|
171
|
+
const now = dependencies.now();
|
|
172
|
+
const nowMs = now.getTime();
|
|
173
|
+
const nowTimestamp = now.toISOString();
|
|
174
|
+
let cacheChanged = false;
|
|
175
|
+
if (!isTtlFresh(cache.checkedAt, nowMs, CHECK_TTL_MS)) {
|
|
176
|
+
const latestVersion = await fetchLatestVersion(dependencies);
|
|
177
|
+
cache = {
|
|
178
|
+
...cache,
|
|
179
|
+
checkedAt: nowTimestamp,
|
|
180
|
+
...(latestVersion ? { latestVersion } : {}),
|
|
181
|
+
};
|
|
182
|
+
cacheChanged = true;
|
|
183
|
+
}
|
|
184
|
+
const latestVersion = cache.latestVersion;
|
|
185
|
+
const parsedLatestVersion = parseStableVersion(latestVersion);
|
|
186
|
+
return {
|
|
187
|
+
cache,
|
|
188
|
+
cacheChanged,
|
|
189
|
+
cachePath,
|
|
190
|
+
dependencies,
|
|
191
|
+
latestVersion: latestVersion &&
|
|
192
|
+
parsedLatestVersion &&
|
|
193
|
+
compareVersions(parsedLatestVersion, currentVersion) > 0
|
|
194
|
+
? latestVersion
|
|
195
|
+
: null,
|
|
196
|
+
nowMs,
|
|
197
|
+
nowTimestamp,
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
async function persistUpdateCache(state) {
|
|
201
|
+
if (!state.cacheChanged) {
|
|
202
|
+
return;
|
|
203
|
+
}
|
|
204
|
+
try {
|
|
205
|
+
await state.dependencies.atomicWriteJson(state.cachePath, state.cache);
|
|
206
|
+
}
|
|
207
|
+
catch {
|
|
208
|
+
// Cache persistence is best-effort and must not affect the command.
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
export async function resolveUpdateAvailability(options, overrides = {}) {
|
|
212
|
+
try {
|
|
213
|
+
const state = await resolveUpdateAvailabilityState(options, overrides);
|
|
214
|
+
if (!state) {
|
|
215
|
+
return null;
|
|
216
|
+
}
|
|
217
|
+
await persistUpdateCache(state);
|
|
218
|
+
return state.latestVersion;
|
|
219
|
+
}
|
|
220
|
+
catch {
|
|
221
|
+
return null;
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
export async function maybeNotifyAboutUpdate(options, overrides = {}) {
|
|
225
|
+
try {
|
|
226
|
+
const state = await resolveUpdateAvailabilityState(options, overrides);
|
|
227
|
+
if (!state) {
|
|
228
|
+
return;
|
|
229
|
+
}
|
|
230
|
+
if (state.latestVersion &&
|
|
231
|
+
shouldNotify(state.cache, state.latestVersion, state.nowMs)) {
|
|
232
|
+
try {
|
|
233
|
+
options.logger.warn(formatNotice(options.currentVersion, state.latestVersion));
|
|
234
|
+
state.cache = {
|
|
235
|
+
...state.cache,
|
|
236
|
+
lastNotifiedAt: state.nowTimestamp,
|
|
237
|
+
lastNotifiedVersion: state.latestVersion,
|
|
238
|
+
};
|
|
239
|
+
state.cacheChanged = true;
|
|
240
|
+
}
|
|
241
|
+
catch {
|
|
242
|
+
// Notification output is best-effort and must not affect the command.
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
await persistUpdateCache(state);
|
|
246
|
+
}
|
|
247
|
+
catch {
|
|
248
|
+
// The notifier never changes command state, even on unexpected failures.
|
|
249
|
+
}
|
|
250
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/config/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,mBAAmB,EAAE,KAAK,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEhF,OAAO,EAEL,KAAK,aAAa,EACnB,MAAM,iCAAiC,CAAC;AAezC,OAAO,EAGL,KAAK,SAAS,EACd,KAAK,cAAc,EAGnB,KAAK,UAAU,EAehB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAEL,KAAK,cAAc,EAEpB,MAAM,iBAAiB,CAAC;AAGzB,OAAO,EAGL,KAAK,8BAA8B,EACnC,KAAK,yBAAyB,EAC/B,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EACL,mCAAmC,EACnC,0BAA0B,EAC3B,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/config/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,mBAAmB,EAAE,KAAK,cAAc,EAAE,MAAM,s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EAChB,GAAG,EAAE,MAAM,CAAC,UAAU,KACnB,OAAO,CAAC,MAAM,CAAC,CAAC;IACrB,sBAAsB,EAAE,CACtB,QAAQ,EAAE,MAAM,EAChB,aAAa,EAAE,MAAM,EACrB,GAAG,EAAE,MAAM,CAAC,UAAU,KACnB,OAAO,CAAC,cAAc,CAAC,CAAC;IAC7B,iBAAiB,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAAC;IACzC,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IAC5C,aAAa,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,aAAa,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IACzE,kBAAkB,EAAE,CAClB,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,yBAAyB,KAC/B,OAAO,CAAC,8BAA8B,CAAC,CAAC;IAC7C,mCAAmC,EAAE,OAAO,mCAAmC,CAAC;IAChF,0BAA0B,EAAE,OAAO,0BAA0B,CAAC;IAC9D,UAAU,EAAE,MAAM,CAAC,UAAU,CAAC;CAC/B;AAg5DD,wBAAgB,mBAAmB,CACjC,SAAS,GAAE,OAAO,CAAC,yBAAyB,CAAM,GACjD,OAAO,CAsKT"}
|
|
@@ -47,6 +47,7 @@ const KEY_ORDER = [
|
|
|
47
47
|
'tools.research',
|
|
48
48
|
'tools.utility',
|
|
49
49
|
'tools.workflows',
|
|
50
|
+
'updateNotifications',
|
|
50
51
|
'workflow.hillCheckpointDefault',
|
|
51
52
|
'workflow.archiveOnComplete',
|
|
52
53
|
'workflow.createPrOnComplete',
|
|
@@ -351,6 +352,17 @@ const CONFIG_CATALOG = [
|
|
|
351
352
|
owningCommand: 'oat config set activeIdea <value> --user',
|
|
352
353
|
description: 'User-level active idea fallback used when no repo-local active idea is set. Writable via `oat config set activeIdea <value> --user`.',
|
|
353
354
|
},
|
|
355
|
+
{
|
|
356
|
+
key: 'updateNotifications',
|
|
357
|
+
group: 'User (~/.oat/config.json)',
|
|
358
|
+
file: '~/.oat/config.json',
|
|
359
|
+
scope: 'user',
|
|
360
|
+
type: 'boolean',
|
|
361
|
+
defaultValue: 'true',
|
|
362
|
+
mutability: 'read/write',
|
|
363
|
+
owningCommand: 'oat config set updateNotifications false --user',
|
|
364
|
+
description: 'Whether interactive CLI commands may check for and display stable update notifications.',
|
|
365
|
+
},
|
|
354
366
|
{
|
|
355
367
|
key: 'workflow.hillCheckpointDefault',
|
|
356
368
|
group: 'Workflow Preferences (3-layer: local > shared > user)',
|
|
@@ -673,6 +685,12 @@ function validateSurfaceForKey(key, surface) {
|
|
|
673
685
|
if (surface === 'auto') {
|
|
674
686
|
return;
|
|
675
687
|
}
|
|
688
|
+
if (key === 'updateNotifications') {
|
|
689
|
+
if (surface !== 'user') {
|
|
690
|
+
throw new Error(`Cannot set 'updateNotifications' at '${surface}' scope. updateNotifications can only be set at user scope (~/.oat/config.json).`);
|
|
691
|
+
}
|
|
692
|
+
return;
|
|
693
|
+
}
|
|
676
694
|
if (isStructuralKey(key)) {
|
|
677
695
|
if (surface !== 'shared') {
|
|
678
696
|
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).`);
|
|
@@ -704,18 +722,24 @@ function validateSurfaceForKey(key, surface) {
|
|
|
704
722
|
// Workflow keys accept any non-auto surface.
|
|
705
723
|
}
|
|
706
724
|
function defaultSurfaceForKey(key) {
|
|
725
|
+
if (key === 'updateNotifications') {
|
|
726
|
+
return 'user';
|
|
727
|
+
}
|
|
707
728
|
if (isWorkflowKey(key) || isStateKey(key)) {
|
|
708
729
|
return 'local';
|
|
709
730
|
}
|
|
710
731
|
return 'shared';
|
|
711
732
|
}
|
|
733
|
+
function parseBooleanValue(key, rawValue) {
|
|
734
|
+
const normalized = rawValue.trim().toLowerCase();
|
|
735
|
+
if (normalized !== 'true' && normalized !== 'false') {
|
|
736
|
+
throw new Error(`Invalid value for ${key}: expected 'true' or 'false', got '${rawValue}'`);
|
|
737
|
+
}
|
|
738
|
+
return normalized === 'true';
|
|
739
|
+
}
|
|
712
740
|
function parseWorkflowValue(key, rawValue) {
|
|
713
741
|
if (WORKFLOW_BOOLEAN_KEYS.has(key)) {
|
|
714
|
-
|
|
715
|
-
if (normalized !== 'true' && normalized !== 'false') {
|
|
716
|
-
throw new Error(`Invalid value for ${key}: expected 'true' or 'false', got '${rawValue}'`);
|
|
717
|
-
}
|
|
718
|
-
return normalized === 'true';
|
|
742
|
+
return parseBooleanValue(key, rawValue);
|
|
719
743
|
}
|
|
720
744
|
if (key === 'workflow.postImplementSequence') {
|
|
721
745
|
const normalized = rawValue.trim();
|
|
@@ -1051,6 +1075,19 @@ async function setConfigValue(repoRoot, userConfigDir, key, rawValue, surface, d
|
|
|
1051
1075
|
source: 'local',
|
|
1052
1076
|
};
|
|
1053
1077
|
}
|
|
1078
|
+
if (key === 'updateNotifications') {
|
|
1079
|
+
const nextValue = parseBooleanValue(key, rawValue);
|
|
1080
|
+
const userConfig = await dependencies.readUserConfig(userConfigDir);
|
|
1081
|
+
await dependencies.writeUserConfig(userConfigDir, {
|
|
1082
|
+
...userConfig,
|
|
1083
|
+
updateNotifications: nextValue,
|
|
1084
|
+
});
|
|
1085
|
+
return {
|
|
1086
|
+
key,
|
|
1087
|
+
value: String(nextValue),
|
|
1088
|
+
source: 'user',
|
|
1089
|
+
};
|
|
1090
|
+
}
|
|
1054
1091
|
const config = await dependencies.readOatConfig(repoRoot);
|
|
1055
1092
|
if (key.startsWith('documentation.')) {
|
|
1056
1093
|
const doc = { ...config.documentation };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oat-config.d.ts","sourceRoot":"","sources":["../../src/config/oat-config.ts"],"names":[],"mappings":"AAOA,OAAO,EAEL,KAAK,6BAA6B,EACnC,MAAM,mBAAmB,CAAC;AAG3B,OAAO,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alizeUserConfig(parsed) {
|
|
|
702
702
|
if (knownStrays) {
|
|
703
703
|
next.knownStrays = knownStrays;
|
|
704
704
|
}
|
|
705
|
+
if (typeof parsed.updateNotifications === 'boolean') {
|
|
706
|
+
next.updateNotifications = parsed.updateNotifications;
|
|
707
|
+
}
|
|
705
708
|
const workflow = normalizeWorkflowConfig(parsed.workflow);
|
|
706
709
|
if (workflow) {
|
|
707
710
|
next.workflow = workflow;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve.d.ts","sourceRoot":"","sources":["../../src/config/resolve.ts"],"names":[],"mappings":"AACA,OAAO,EAML,KAAK,UAAU,EACf,KAAK,UAAU,EACf,KAAK,SAAS,EACd,KAAK,cAAc,EACnB,KAAK,UAAU,EAChB,MAAM,cAAc,CAAC;AAEtB,MAAM,MAAM,oBAAoB,GAC5B,QAAQ,GACR,OAAO,GACP,MAAM,GACN,KAAK,GACL,SAAS,CAAC;AAEd,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,OAAO,CAAC;IACf,MAAM,EAAE,oBAAoB,CAAC;CAC9B;AAED,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,SAAS,CAAC;IAClB,KAAK,EAAE,cAAc,CAAC;IACtB,IAAI,EAAE,UAAU,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;CAC5C;AAED,MAAM,WAAW,kCAAkC;IACjD,aAAa,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,SAAS,CAAC,CAAC;IACxD,kBAAkB,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,cAAc,CAAC,CAAC;IAClE,cAAc,EAAE,CAAC,aAAa,EAAE,MAAM,KAAK,OAAO,CAAC,UAAU,CAAC,CAAC;CAChE;
|
|
1
|
+
{"version":3,"file":"resolve.d.ts","sourceRoot":"","sources":["../../src/config/resolve.ts"],"names":[],"mappings":"AACA,OAAO,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AAM,WAAW,sBAAsB;IACrC,MAAM,EAAE,UAAU,CAAC;IACnB,MAAM,EAAE,gBAAgB,CAAC;IACzB,oBAAoB,EAAE,OAAO,CAAC;IAC9B,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,wBAAgB,sBAAsB,CACpC,SAAS,EAAE,cAAc,GACxB,MAAM,CAAC,MAAM,EAAE,sBAAsB,CAAC,CAoDxC"}
|
package/dist/config/resolve.js
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
export declare function normalizeArgv(argv: string[]): string[];
|
|
3
|
-
export declare function main(argv?: string[]): Promise<void>;
|
|
3
|
+
export declare function main(argv?: string[], platform?: NodeJS.Platform): Promise<void>;
|
|
4
4
|
export declare function isEntrypoint(argv?: string[], entrypointUrl?: string): boolean;
|
|
5
5
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAuBA,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAatD;AAED,wBAAsB,IAAI,CACxB,IAAI,GAAE,MAAM,EAAiB,EAC7B,QAAQ,GAAE,MAAM,CAAC,QAA2B,GAC3C,OAAO,CAAC,IAAI,CAAC,CA0Cf;AAED,wBAAgB,YAAY,CAC1B,IAAI,GAAE,MAAM,EAAiB,EAC7B,aAAa,GAAE,MAAwB,GACtC,OAAO,CAaT"}
|
package/dist/index.js
CHANGED
|
@@ -2,10 +2,16 @@
|
|
|
2
2
|
import { realpathSync } from 'node:fs';
|
|
3
3
|
import { resolve } from 'node:path';
|
|
4
4
|
import { fileURLToPath, pathToFileURL } from 'node:url';
|
|
5
|
+
import { buildCommandContext } from './app/command-context.js';
|
|
6
|
+
import { formatCommandPath, formatRerunCommand, guardBundledToolMutation, isBundledToolMutationCommand, } from './app/tool-bundle-update-guard.js';
|
|
7
|
+
import { maybeNotifyAboutUpdate } from './app/update-notifier.js';
|
|
8
|
+
import { OAT_VERSION } from './shared/oat-version.js';
|
|
5
9
|
import { createProgram } from './app/create-program.js';
|
|
6
10
|
import { registerCommands } from './commands/index.js';
|
|
7
11
|
import { CliError } from './errors/index.js';
|
|
8
12
|
import { createLogger } from './ui/index.js';
|
|
13
|
+
class CliUpdateInstalledSignal extends Error {
|
|
14
|
+
}
|
|
9
15
|
export function normalizeArgv(argv) {
|
|
10
16
|
// `pnpm run <script> -- ...` passes a literal `--` into argv.
|
|
11
17
|
// Strip that sentinel so Commander can parse subcommand options normally.
|
|
@@ -19,10 +25,48 @@ export function normalizeArgv(argv) {
|
|
|
19
25
|
}
|
|
20
26
|
return argv;
|
|
21
27
|
}
|
|
22
|
-
export async function main(argv = process.argv) {
|
|
28
|
+
export async function main(argv = process.argv, platform = process.platform) {
|
|
23
29
|
const program = createProgram();
|
|
24
30
|
registerCommands(program);
|
|
25
|
-
|
|
31
|
+
const normalizedArgv = normalizeArgv(argv);
|
|
32
|
+
program.hook('preAction', async (_command, actionCommand) => {
|
|
33
|
+
const context = buildCommandContext(actionCommand.optsWithGlobals());
|
|
34
|
+
const notifierOptions = {
|
|
35
|
+
currentVersion: OAT_VERSION,
|
|
36
|
+
home: context.home,
|
|
37
|
+
interactive: context.interactive,
|
|
38
|
+
json: context.json,
|
|
39
|
+
argv: normalizedArgv,
|
|
40
|
+
env: process.env,
|
|
41
|
+
logger: context.logger,
|
|
42
|
+
};
|
|
43
|
+
if (isBundledToolMutationCommand(actionCommand)) {
|
|
44
|
+
const cliUpdated = await guardBundledToolMutation({
|
|
45
|
+
...notifierOptions,
|
|
46
|
+
commandPath: formatCommandPath(actionCommand),
|
|
47
|
+
dryRun: context.dryRun,
|
|
48
|
+
rerunCommand: formatRerunCommand(normalizedArgv, platform),
|
|
49
|
+
});
|
|
50
|
+
if (cliUpdated) {
|
|
51
|
+
throw new CliUpdateInstalledSignal();
|
|
52
|
+
}
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
try {
|
|
56
|
+
await maybeNotifyAboutUpdate(notifierOptions);
|
|
57
|
+
}
|
|
58
|
+
catch {
|
|
59
|
+
// Update notifications are best-effort and never affect command dispatch.
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
try {
|
|
63
|
+
await program.parseAsync(normalizedArgv);
|
|
64
|
+
}
|
|
65
|
+
catch (error) {
|
|
66
|
+
if (!(error instanceof CliUpdateInstalledSignal)) {
|
|
67
|
+
throw error;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
26
70
|
}
|
|
27
71
|
export function isEntrypoint(argv = process.argv, entrypointUrl = import.meta.url) {
|
|
28
72
|
if (!argv[1]) {
|
|
@@ -4,10 +4,10 @@ export declare const OAT_MANAGED_ROLE_OWNER_PREFIX = "# oat-owner: ";
|
|
|
4
4
|
export type CodexRoleOwner = 'supported-catalogue' | 'user-config' | 'project-config';
|
|
5
5
|
export declare const SUPPORTED_CODEX_ROLE_TARGETS: readonly ({
|
|
6
6
|
model: string;
|
|
7
|
-
effort: "high" | "
|
|
7
|
+
effort: "high" | "low" | "medium" | "xhigh";
|
|
8
8
|
} | {
|
|
9
9
|
model: string;
|
|
10
|
-
effort: "high" | "
|
|
10
|
+
effort: "high" | "low" | "medium" | "xhigh";
|
|
11
11
|
} | {
|
|
12
12
|
model: string;
|
|
13
13
|
effort: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@open-agent-toolkit/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.62",
|
|
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.1.
|
|
37
|
+
"@open-agent-toolkit/control-plane": "0.1.62"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@types/node": "^22.10.0",
|