@open-agent-toolkit/cli 0.1.59 → 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/assets/skills/oat-project-implement/SKILL.md +1 -1
- package/assets/skills/oat-project-implement/references/dispatch-and-dry-run.md +165 -318
- 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/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",
|