@openagentpack/cli 0.0.2-beta.0 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/bin/agents.js
CHANGED
|
@@ -568,11 +568,11 @@ agents.state.json
|
|
|
568
568
|
`;
|
|
569
569
|
function buildTemplate(opts) {
|
|
570
570
|
const providers = {
|
|
571
|
-
claude: ` claude:
|
|
572
|
-
api_key: \${ANTHROPIC_API_KEY}`,
|
|
573
571
|
bailian: ` bailian:
|
|
574
572
|
api_key: \${DASHSCOPE_API_KEY}
|
|
575
573
|
workspace_id: \${BAILIAN_WORKSPACE_ID}`,
|
|
574
|
+
claude: ` claude:
|
|
575
|
+
api_key: \${ANTHROPIC_API_KEY}`,
|
|
576
576
|
qoder: ` qoder:
|
|
577
577
|
api_key: \${QODER_PAT}
|
|
578
578
|
gateway: "https://api.qoder.com/api/v1/cloud"`,
|
|
@@ -581,24 +581,25 @@ function buildTemplate(opts) {
|
|
|
581
581
|
};
|
|
582
582
|
let providerBlock;
|
|
583
583
|
if (opts.provider === "all") {
|
|
584
|
-
providerBlock = `${providers.
|
|
585
|
-
${providers.
|
|
584
|
+
providerBlock = `${providers.bailian}
|
|
585
|
+
${providers.claude}
|
|
586
586
|
${providers.qoder}
|
|
587
587
|
${providers.ark}`;
|
|
588
588
|
} else {
|
|
589
589
|
providerBlock = providers[opts.provider];
|
|
590
590
|
}
|
|
591
591
|
const singleModel = {
|
|
592
|
+
bailian: ` model: qwen3.7-max`,
|
|
592
593
|
claude: ` model: claude-sonnet-4-6`,
|
|
593
|
-
bailian: ` model: qwen3.7-plus`,
|
|
594
594
|
qoder: ` model: ultimate`,
|
|
595
595
|
ark: ` model: doubao-seed-2-1-pro-260628`
|
|
596
596
|
};
|
|
597
597
|
const modelBlock = opts.provider === "all" ? ` model:
|
|
598
|
+
bailian: qwen3.7-max
|
|
598
599
|
claude: claude-sonnet-4-6
|
|
599
|
-
bailian: qwen3.7-plus
|
|
600
600
|
qoder: ultimate
|
|
601
601
|
ark: doubao-seed-2-1-pro-260628` : singleModel[opts.provider];
|
|
602
|
+
const toolBlock = opts.provider === "bailian" ? "[bash, read, glob, grep]" : "[read, glob, grep, web_search, web_fetch]";
|
|
602
603
|
return `version: "1"
|
|
603
604
|
|
|
604
605
|
providers:
|
|
@@ -622,7 +623,7 @@ ${modelBlock}
|
|
|
622
623
|
You are a helpful assistant.
|
|
623
624
|
environment: dev
|
|
624
625
|
tools:
|
|
625
|
-
builtin:
|
|
626
|
+
builtin: ${toolBlock}
|
|
626
627
|
`;
|
|
627
628
|
}
|
|
628
629
|
async function initCommand() {
|
|
@@ -637,8 +638,8 @@ async function initCommand() {
|
|
|
637
638
|
provider: () => p4.select({
|
|
638
639
|
message: "Which provider(s) do you want to use?",
|
|
639
640
|
options: [
|
|
640
|
-
{ value: "claude", label: "Claude" },
|
|
641
641
|
{ value: "bailian", label: "Bailian (\u963F\u91CC\u4E91\u767E\u70BC)" },
|
|
642
|
+
{ value: "claude", label: "Claude" },
|
|
642
643
|
{ value: "qoder", label: "Qoder" },
|
|
643
644
|
{ value: "ark", label: "Ark\uFF08\u706B\u5C71\u65B9\u821F\uFF09" },
|
|
644
645
|
{ value: "all", label: "All providers" }
|
|
@@ -982,11 +983,12 @@ import { existsSync as existsSync2, readFileSync } from "fs";
|
|
|
982
983
|
import { createRequire } from "module";
|
|
983
984
|
import { dirname as dirname2, resolve as resolve2 } from "path";
|
|
984
985
|
import { fileURLToPath } from "url";
|
|
986
|
+
import { AGENTS_CONFIG_PROVIDERS } from "@openagentpack/sdk";
|
|
985
987
|
var CLI_PKG = "@openagentpack/cli";
|
|
986
988
|
var PLAYGROUND_PKG = "@openagentpack/playground";
|
|
987
989
|
var DEFAULT_PORT = 4848;
|
|
988
990
|
var PLAYGROUND_URL_RE = /running at http:\/\/localhost:(\d+)/;
|
|
989
|
-
var SUPPORTED_PLAYGROUND_PROVIDERS =
|
|
991
|
+
var SUPPORTED_PLAYGROUND_PROVIDERS = new Set(AGENTS_CONFIG_PROVIDERS);
|
|
990
992
|
function cliVersion() {
|
|
991
993
|
const here = dirname2(fileURLToPath(import.meta.url));
|
|
992
994
|
const candidates = [
|
|
@@ -1087,10 +1089,14 @@ async function playgroundCommand(options) {
|
|
|
1087
1089
|
throw new Error(`Invalid --port '${options.port}'`);
|
|
1088
1090
|
}
|
|
1089
1091
|
if (options.provider && !SUPPORTED_PLAYGROUND_PROVIDERS.has(options.provider)) {
|
|
1090
|
-
|
|
1092
|
+
const supported = [...SUPPORTED_PLAYGROUND_PROVIDERS].join(", ");
|
|
1093
|
+
throw new Error(`Playground supports providers: ${supported}; received '${options.provider}'.`);
|
|
1091
1094
|
}
|
|
1092
1095
|
const env = { ...process.env, PORT: String(port) };
|
|
1093
|
-
if (options.provider)
|
|
1096
|
+
if (options.provider) {
|
|
1097
|
+
env.AGENTS_PROVIDER = options.provider;
|
|
1098
|
+
env.AGENTS_CLI_PROVIDER = options.provider;
|
|
1099
|
+
}
|
|
1094
1100
|
const { cmd, args } = resolveLauncher(cliVersion());
|
|
1095
1101
|
if (cmd === "npx") log.info(`Fetching ${PLAYGROUND_PKG} (first run may take a moment)...`);
|
|
1096
1102
|
const child = spawn(cmd, args, { env, stdio: ["inherit", "pipe", "inherit"] });
|
|
@@ -1790,7 +1796,7 @@ var program = new Command2().name("agents").version(readCliVersion()).descriptio
|
|
|
1790
1796
|
});
|
|
1791
1797
|
});
|
|
1792
1798
|
program.command("init").description("Create a new agents.yaml template").action(initCommand);
|
|
1793
|
-
program.command("playground").description("Launch the local web UI (fetches @openagentpack/playground on demand) and open it in a browser").option("--port <n>", "Port to serve on (default 4848)").addOption(
|
|
1799
|
+
program.command("playground").description("Launch the local web UI (fetches @openagentpack/playground on demand) and open it in a browser").option("--port <n>", "Port to serve on (default 4848)").addOption(providerOption("Provider the UI targets")).option("--no-open", "Do not open a browser automatically").action(playgroundCommand);
|
|
1794
1800
|
program.command("validate").description("Validate the configuration file (offline)").addOption(configFileOption()).action(withResolvedConfigFile(validateCommand));
|
|
1795
1801
|
program.command("plan").description("Show what changes would be applied").addOption(configFileOption()).addOption(providerOption("Target provider", { allowAll: true, defaultValue: "all" })).option("--refresh <value>", "Refresh state from remote before planning (true/false)", parseBooleanOption, true).option("--refresh-only", "Refresh state and show drift without planning remote mutations").option("--json", "Output as JSON").action(withResolvedConfigFile(planCommand));
|
|
1796
1802
|
program.command("apply").description("Apply the planned changes to create/update/delete resources").addOption(configFileOption()).option("-y, --yes", "Skip confirmation prompt").option("--refresh <value>", "Refresh state from remote before planning (true/false)", parseBooleanOption, true).option("--refresh-only", "Refresh state without mutating remote resources").option(
|
package/dist/src/program.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openagentpack/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.1.0",
|
|
4
4
|
"description": "Open Agent Pack — Declaratively manage AI agent infrastructure",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"keywords": [
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"url": "https://github.com/modelstudioai/OpenAgentPack/issues"
|
|
21
21
|
},
|
|
22
22
|
"engines": {
|
|
23
|
-
"node": ">=
|
|
23
|
+
"node": ">=22"
|
|
24
24
|
},
|
|
25
25
|
"type": "module",
|
|
26
26
|
"main": "./dist/src/program.js",
|
|
@@ -49,12 +49,12 @@
|
|
|
49
49
|
"typecheck": "tsc --noEmit"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
|
-
"@openagentpack/playground": "0.
|
|
52
|
+
"@openagentpack/playground": "0.1.0",
|
|
53
53
|
"@types/bun": "^1.3.14",
|
|
54
54
|
"typescript": "^6.0.3"
|
|
55
55
|
},
|
|
56
56
|
"dependencies": {
|
|
57
|
-
"@openagentpack/sdk": "0.
|
|
57
|
+
"@openagentpack/sdk": "0.1.0",
|
|
58
58
|
"@clack/prompts": "^1.5.1",
|
|
59
59
|
"chalk": "^5.6.2",
|
|
60
60
|
"commander": "^14.0.3",
|