@openagentpack/cli 0.3.0-beta-fb9e73b-20260721 → 0.3.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
|
@@ -360,6 +360,8 @@ import {
|
|
|
360
360
|
getDeploymentDetailsForContext,
|
|
361
361
|
getDeploymentRuntimeProviderForContext,
|
|
362
362
|
listDeploymentsForContext,
|
|
363
|
+
listRemoteDeploymentsForContext,
|
|
364
|
+
pauseDeploymentForContext,
|
|
363
365
|
runDeploymentForContext,
|
|
364
366
|
UserError as UserError3
|
|
365
367
|
} from "@openagentpack/sdk";
|
|
@@ -388,9 +390,56 @@ function printTableFooter() {
|
|
|
388
390
|
console.log();
|
|
389
391
|
}
|
|
390
392
|
|
|
393
|
+
// src/utils/pagination.ts
|
|
394
|
+
async function fetchAllPages(fetchPage, all) {
|
|
395
|
+
const first = await fetchPage();
|
|
396
|
+
const items = [...first.items];
|
|
397
|
+
let hasMore = first.hasMore;
|
|
398
|
+
let nextPage = first.nextPage;
|
|
399
|
+
while (all && nextPage) {
|
|
400
|
+
const next = await fetchPage(nextPage);
|
|
401
|
+
items.push(...next.items);
|
|
402
|
+
hasMore = next.hasMore;
|
|
403
|
+
nextPage = next.nextPage;
|
|
404
|
+
}
|
|
405
|
+
return { items, hasMore, nextPage };
|
|
406
|
+
}
|
|
407
|
+
|
|
391
408
|
// src/commands/deployment.ts
|
|
392
409
|
async function deploymentListCommand(options) {
|
|
393
410
|
const ctx = await buildCliRuntime(options.file);
|
|
411
|
+
if (options.remote) {
|
|
412
|
+
if (!options.provider) throw new UserError3("Remote deployment listing requires --provider.");
|
|
413
|
+
if (options.provider === "claude" && options.status && options.includeArchived) {
|
|
414
|
+
throw new UserError3("Claude remote deployment listing cannot combine --status with --include-archived.");
|
|
415
|
+
}
|
|
416
|
+
const { items, hasMore } = await fetchAllPages(async (page) => {
|
|
417
|
+
const result = await listRemoteDeploymentsForContext(ctx, options.provider, {
|
|
418
|
+
status: options.status,
|
|
419
|
+
include_archived: options.includeArchived,
|
|
420
|
+
agent_id: options.agentId,
|
|
421
|
+
limit: options.limit,
|
|
422
|
+
page
|
|
423
|
+
});
|
|
424
|
+
return { items: result.deployments, hasMore: result.has_more, nextPage: result.next_page };
|
|
425
|
+
}, options.all);
|
|
426
|
+
if (items.length === 0) {
|
|
427
|
+
log.info("No remote deployments found.");
|
|
428
|
+
return;
|
|
429
|
+
}
|
|
430
|
+
printTableTitle("Remote Deployments", items.length);
|
|
431
|
+
printTableHeader(["Name".padEnd(24), "ID".padEnd(28), "Status".padEnd(10), "Schedule"], 82);
|
|
432
|
+
for (const item of items) {
|
|
433
|
+
const raw = item.attributes ?? {};
|
|
434
|
+
const name = String(raw.name ?? "").slice(0, 22).padEnd(24);
|
|
435
|
+
const id = String(item.id ?? "").slice(0, 26).padEnd(28);
|
|
436
|
+
const schedule = item.schedule?.expression ?? "manual";
|
|
437
|
+
printTableRow([chalk5.bold(name), id, item.status.padEnd(10), schedule]);
|
|
438
|
+
}
|
|
439
|
+
printTableFooter();
|
|
440
|
+
if (hasMore) log.info("More deployments available. Use --all to fetch all.");
|
|
441
|
+
return;
|
|
442
|
+
}
|
|
394
443
|
const rows = listDeploymentsForContext(ctx, options.provider);
|
|
395
444
|
if (rows.length === 0) {
|
|
396
445
|
log.info("No deployments in state. Run `agents apply` first.");
|
|
@@ -411,6 +460,12 @@ async function deploymentListCommand(options) {
|
|
|
411
460
|
}
|
|
412
461
|
printTableFooter();
|
|
413
462
|
}
|
|
463
|
+
async function deploymentPauseCommand(name, options, paused = true) {
|
|
464
|
+
const ctx = await buildCliRuntime(options.file);
|
|
465
|
+
const info = await pauseDeploymentForContext(ctx, name, paused, options.provider);
|
|
466
|
+
log.success(`Deployment '${name}' ${paused ? "paused" : "unpaused"}.`);
|
|
467
|
+
console.log(` Status: ${info.status}`);
|
|
468
|
+
}
|
|
414
469
|
async function deploymentGetCommand(name, options) {
|
|
415
470
|
const ctx = await buildCliRuntime(options.file);
|
|
416
471
|
const { bindings, provider, info } = await getDeploymentDetailsForContext(ctx, name, void 0, options.provider);
|
|
@@ -1262,23 +1317,6 @@ import {
|
|
|
1262
1317
|
} from "@openagentpack/sdk";
|
|
1263
1318
|
import { sanitizeSessionEvent, sanitizeSessionEvents } from "@openagentpack/sdk/session-events";
|
|
1264
1319
|
import chalk9 from "chalk";
|
|
1265
|
-
|
|
1266
|
-
// src/utils/pagination.ts
|
|
1267
|
-
async function fetchAllPages(fetchPage, all) {
|
|
1268
|
-
const first = await fetchPage();
|
|
1269
|
-
const items = [...first.items];
|
|
1270
|
-
let hasMore = first.hasMore;
|
|
1271
|
-
let nextPage = first.nextPage;
|
|
1272
|
-
while (all && nextPage) {
|
|
1273
|
-
const next = await fetchPage(nextPage);
|
|
1274
|
-
items.push(...next.items);
|
|
1275
|
-
hasMore = next.hasMore;
|
|
1276
|
-
nextPage = next.nextPage;
|
|
1277
|
-
}
|
|
1278
|
-
return { items, hasMore, nextPage };
|
|
1279
|
-
}
|
|
1280
|
-
|
|
1281
|
-
// src/commands/session.ts
|
|
1282
1320
|
function formatTimestamp(iso) {
|
|
1283
1321
|
const d = new Date(iso);
|
|
1284
1322
|
if (Number.isNaN(d.getTime())) return iso;
|
|
@@ -1976,9 +2014,11 @@ sessionCmd.command("run <prompt-or-agent> [prompt]").description("Create a sessi
|
|
|
1976
2014
|
sessionCmd.command("send <session-id> <message>").description("Send a message to an existing session and wait for the response").addOption(configFileOption()).addOption(providerOption("Target provider")).option("--json", "Output events as JSONL").addOption(new Option2("--stream", "Stream events over SSE instead of polling").conflicts("noStream")).addOption(new Option2("--no-stream", "Use polling (deprecated; polling is now the default)").hideHelp()).action(withResolvedConfigFile(sessionSendCommand));
|
|
1977
2015
|
sessionCmd.command("events <session-id>").description("List event history for a session").addOption(configFileOption()).addOption(providerOption("Target provider")).addOption(new Option2("--limit <count>", "Maximum number of events to fetch").argParser(parsePositiveInteger)).option("--all", "Fetch all pages by following the cursor").option("--json", "Output as JSON").action(withResolvedConfigFile(sessionEventsCommand));
|
|
1978
2016
|
var deploymentCmd = program.command("deployment").description("Manage agent deployments (scheduled / triggered runs)");
|
|
1979
|
-
deploymentCmd.command("list").description("List deployments tracked in state").addOption(configFileOption()).addOption(providerOption("Filter by provider")).action(withResolvedConfigFile(deploymentListCommand));
|
|
2017
|
+
deploymentCmd.command("list").description("List deployments tracked in state").addOption(configFileOption()).addOption(providerOption("Filter by provider")).option("--remote", "List deployments from the provider API").addOption(new Option2("--status <status>", "Filter remote deployments by status").choices(["active", "paused"])).option("--include-archived", "Include archived remote deployments").option("--agent-id <id>", "Filter remote deployments by agent ID").option("--limit <count>", "Maximum remote deployments per page", parsePositiveInteger).option("--all", "Fetch all remote pages").action(withResolvedConfigFile(deploymentListCommand));
|
|
1980
2018
|
deploymentCmd.command("get <name>").description("Show a deployment's status and resolved bindings").addOption(configFileOption()).addOption(providerOption("Target provider")).action(withResolvedConfigFile(deploymentGetCommand));
|
|
1981
|
-
deploymentCmd.command("
|
|
2019
|
+
deploymentCmd.command("pause <name>").description("Pause a native deployment's scheduled runs").addOption(configFileOption()).addOption(providerOption("Target provider")).action(withResolvedConfigFile((name, options) => deploymentPauseCommand(name, options, true)));
|
|
2020
|
+
deploymentCmd.command("unpause <name>").description("Resume a paused native deployment").addOption(configFileOption()).addOption(providerOption("Target provider")).action(withResolvedConfigFile((name, options) => deploymentPauseCommand(name, options, false)));
|
|
2021
|
+
deploymentCmd.command("run <name>").description("Trigger a deployment run (native on Qoder/Claude, emulated on Bailian/Ark)").addOption(configFileOption()).addOption(providerOption("Target provider")).action(withResolvedConfigFile(deploymentRunCommand));
|
|
1982
2022
|
var memoryStoreCmd = program.command("memory-store").description("Manage persistent memory stores");
|
|
1983
2023
|
memoryStoreCmd.command("create <name>").addOption(configFileOption()).addOption(providerOption("Target provider")).option("--description <description>").action(withResolvedConfigFile(memoryStoreCreateCommand));
|
|
1984
2024
|
memoryStoreCmd.command("list").addOption(configFileOption()).addOption(providerOption("Target provider")).option("--limit <n>", "Page size", parsePositiveInteger).option("--cursor <cursor>").option("--include-archived").action(withResolvedConfigFile(memoryStoreListCommand));
|
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.0
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Open Agent Pack — Declaratively manage AI agent infrastructure",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"keywords": [
|
|
@@ -49,12 +49,12 @@
|
|
|
49
49
|
"typecheck": "tsc --noEmit"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
|
-
"@openagentpack/playground": "0.3.0
|
|
52
|
+
"@openagentpack/playground": "0.3.0",
|
|
53
53
|
"@types/bun": "^1.3.14",
|
|
54
54
|
"typescript": "^6.0.3"
|
|
55
55
|
},
|
|
56
56
|
"dependencies": {
|
|
57
|
-
"@openagentpack/sdk": "0.3.0
|
|
57
|
+
"@openagentpack/sdk": "0.3.0",
|
|
58
58
|
"@clack/prompts": "^1.5.1",
|
|
59
59
|
"chalk": "^5.6.2",
|
|
60
60
|
"commander": "^14.0.3",
|