@integrity-labs/agt-cli 0.15.38 → 0.16.1

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/agt.js CHANGED
@@ -48,7 +48,7 @@ import {
48
48
  success,
49
49
  table,
50
50
  warn
51
- } from "../chunk-XJSQKRFV.js";
51
+ } from "../chunk-ITLXAEXI.js";
52
52
 
53
53
  // src/bin/agt.ts
54
54
  import { join as join10 } from "path";
@@ -2165,8 +2165,8 @@ function preflightAws() {
2165
2165
  if (aws.status !== 0) {
2166
2166
  return "AWS CLI not found. Install: https://aws.amazon.com/cli/";
2167
2167
  }
2168
- const plugin2 = spawnSync("session-manager-plugin", [], { stdio: "ignore" });
2169
- if (plugin2.error) {
2168
+ const plugin = spawnSync("session-manager-plugin", [], { stdio: "ignore" });
2169
+ if (plugin.error) {
2170
2170
  return "session-manager-plugin not found. Install: brew install --cask session-manager-plugin";
2171
2171
  }
2172
2172
  return null;
@@ -3732,7 +3732,7 @@ import { execFileSync, execSync } from "child_process";
3732
3732
  import { existsSync as existsSync5, realpathSync } from "fs";
3733
3733
  import chalk17 from "chalk";
3734
3734
  import ora15 from "ora";
3735
- var cliVersion = true ? "0.15.38" : "dev";
3735
+ var cliVersion = true ? "0.16.1" : "dev";
3736
3736
  async function fetchLatestVersion() {
3737
3737
  const host2 = getHost();
3738
3738
  if (!host2) return null;
@@ -3761,12 +3761,21 @@ function isNewerVersion(local, remote) {
3761
3761
  if (rMin !== lMin) return rMin > lMin;
3762
3762
  return rPat > lPat;
3763
3763
  }
3764
+ function isPidAlive(pid) {
3765
+ if (!Number.isInteger(pid) || pid <= 0) return false;
3766
+ try {
3767
+ process.kill(pid, 0);
3768
+ return true;
3769
+ } catch (err) {
3770
+ return err.code === "EPERM";
3771
+ }
3772
+ }
3764
3773
  function detectActiveSessions() {
3765
3774
  let managerPid = null;
3766
3775
  try {
3767
3776
  const pid = execSync('pgrep -f "agt.*(manage|manager)" 2>/dev/null || true', { encoding: "utf-8" }).trim();
3768
3777
  const ownPid = String(process.pid);
3769
- const pids = pid.split("\n").filter((p) => p && p !== ownPid);
3778
+ const pids = pid.split("\n").map((p) => p.trim()).filter((p) => p && p !== ownPid).filter((p) => isPidAlive(Number(p)));
3770
3779
  managerPid = pids[0] ?? null;
3771
3780
  } catch {
3772
3781
  }
@@ -3954,24 +3963,24 @@ async function checkForUpdateOnStartup() {
3954
3963
  }
3955
3964
  }
3956
3965
 
3957
- // src/commands/plugin.ts
3966
+ // src/commands/integration.ts
3958
3967
  import chalk18 from "chalk";
3959
3968
  import ora16 from "ora";
3960
- async function pluginListCommand() {
3969
+ async function integrationListCommand() {
3961
3970
  const json = isJsonMode();
3962
- const spinner = ora16({ text: "Fetching plugins\u2026", isSilent: json }).start();
3971
+ const spinner = ora16({ text: "Fetching integrations\u2026", isSilent: json }).start();
3963
3972
  try {
3964
3973
  const data = await api.get("/integrations/bindings");
3965
3974
  spinner.stop();
3966
3975
  if (json) {
3967
- jsonOutput({ plugins: data });
3976
+ jsonOutput({ integrations: data });
3968
3977
  return;
3969
3978
  }
3970
3979
  if (!data.length) {
3971
- info("No plugins found for this team.");
3980
+ info("No integrations found for this team.");
3972
3981
  return;
3973
3982
  }
3974
- console.log(chalk18.bold("\nAvailable Plugins:\n"));
3983
+ console.log(chalk18.bold("\nAvailable Integrations:\n"));
3975
3984
  for (const p of data) {
3976
3985
  const statusColor = p.status === "published" ? chalk18.green : p.status === "archived" ? chalk18.gray : chalk18.yellow;
3977
3986
  console.log(
@@ -3984,32 +3993,32 @@ async function pluginListCommand() {
3984
3993
  handleError(err);
3985
3994
  }
3986
3995
  }
3987
- async function pluginShowCommand(slug) {
3996
+ async function integrationShowCommand(slug) {
3988
3997
  const json = isJsonMode();
3989
- const spinner = ora16({ text: "Fetching plugin\u2026", isSilent: json }).start();
3998
+ const spinner = ora16({ text: "Fetching integration\u2026", isSilent: json }).start();
3990
3999
  try {
3991
4000
  const all = await api.get("/integrations/bindings");
3992
- const plugin2 = all.find((p) => p.slug === slug);
3993
- if (!plugin2) {
4001
+ const integration2 = all.find((p) => p.slug === slug);
4002
+ if (!integration2) {
3994
4003
  spinner.stop();
3995
- error(`Plugin "${slug}" not found.`);
4004
+ error(`Integration "${slug}" not found.`);
3996
4005
  process.exitCode = 1;
3997
4006
  return;
3998
4007
  }
3999
- const scopes = await api.get(`/integrations/bindings/${plugin2.id}/scopes`);
4008
+ const scopes = await api.get(`/integrations/bindings/${integration2.id}/scopes`);
4000
4009
  spinner.stop();
4001
4010
  if (json) {
4002
- jsonOutput({ plugin: plugin2, scopes });
4011
+ jsonOutput({ integration: integration2, scopes });
4003
4012
  return;
4004
4013
  }
4005
4014
  console.log(chalk18.bold(`
4006
- ${plugin2.name}`), chalk18.dim(`(${plugin2.slug})`));
4007
- if (plugin2.description) console.log(chalk18.dim(plugin2.description));
4015
+ ${integration2.name}`), chalk18.dim(`(${integration2.slug})`));
4016
+ if (integration2.description) console.log(chalk18.dim(integration2.description));
4008
4017
  console.log();
4009
- console.log(` Status: ${plugin2.status} v${plugin2.version}`);
4010
- console.log(` Category: ${plugin2.category}`);
4011
- console.log(` Toolkits: ${plugin2.required_toolkits.join(", ") || "none"}`);
4012
- console.log(` Skills: ${plugin2.skills?.length ?? 0}`);
4018
+ console.log(` Status: ${integration2.status} v${integration2.version}`);
4019
+ console.log(` Category: ${integration2.category}`);
4020
+ console.log(` Toolkits: ${integration2.required_toolkits.join(", ") || "none"}`);
4021
+ console.log(` Skills: ${integration2.skills?.length ?? 0}`);
4013
4022
  if (scopes.length > 0) {
4014
4023
  console.log(chalk18.bold("\n Permission Scopes:\n"));
4015
4024
  for (const s of scopes) {
@@ -4026,15 +4035,15 @@ ${plugin2.name}`), chalk18.dim(`(${plugin2.slug})`));
4026
4035
  handleError(err);
4027
4036
  }
4028
4037
  }
4029
- async function pluginInstallCommand(slug, options) {
4038
+ async function integrationInstallCommand(slug, options) {
4030
4039
  const json = isJsonMode();
4031
- const spinner = ora16({ text: "Installing plugin\u2026", isSilent: json }).start();
4040
+ const spinner = ora16({ text: "Installing integration\u2026", isSilent: json }).start();
4032
4041
  try {
4033
4042
  const all = await api.get("/integrations/bindings");
4034
- const plugin2 = all.find((p) => p.slug === slug);
4035
- if (!plugin2) {
4043
+ const integration2 = all.find((p) => p.slug === slug);
4044
+ if (!integration2) {
4036
4045
  spinner.stop();
4037
- error(`Plugin "${slug}" not found.`);
4046
+ error(`Integration "${slug}" not found.`);
4038
4047
  process.exitCode = 1;
4039
4048
  return;
4040
4049
  }
@@ -4049,15 +4058,15 @@ async function pluginInstallCommand(slug, options) {
4049
4058
  const scopes = options.scopes?.split(",").map((s) => s.trim()).filter(Boolean) ?? [];
4050
4059
  const result = await api.post("/integrations/bindings/install", {
4051
4060
  agent_id: agent2.agent_id,
4052
- plugin_id: plugin2.id,
4061
+ plugin_id: integration2.id,
4053
4062
  scopes
4054
4063
  });
4055
4064
  spinner.stop();
4056
4065
  if (json) {
4057
- jsonOutput({ agent_plugin: result });
4066
+ jsonOutput({ agent_integration: result });
4058
4067
  return;
4059
4068
  }
4060
- success(`Installed "${plugin2.name}" on agent "${options.agent}"`);
4069
+ success(`Installed "${integration2.name}" on agent "${options.agent}"`);
4061
4070
  if (scopes.length) {
4062
4071
  info(`Granted scopes: ${scopes.join(", ")}`);
4063
4072
  }
@@ -4076,15 +4085,15 @@ async function pluginInstallCommand(slug, options) {
4076
4085
  handleError(err);
4077
4086
  }
4078
4087
  }
4079
- async function pluginUninstallCommand(slug, options) {
4088
+ async function integrationUninstallCommand(slug, options) {
4080
4089
  const json = isJsonMode();
4081
- const spinner = ora16({ text: "Uninstalling plugin\u2026", isSilent: json }).start();
4090
+ const spinner = ora16({ text: "Uninstalling integration\u2026", isSilent: json }).start();
4082
4091
  try {
4083
4092
  const all = await api.get("/integrations/bindings");
4084
- const plugin2 = all.find((p) => p.slug === slug);
4085
- if (!plugin2) {
4093
+ const integration2 = all.find((p) => p.slug === slug);
4094
+ if (!integration2) {
4086
4095
  spinner.stop();
4087
- error(`Plugin "${slug}" not found.`);
4096
+ error(`Integration "${slug}" not found.`);
4088
4097
  process.exitCode = 1;
4089
4098
  return;
4090
4099
  }
@@ -4098,16 +4107,16 @@ async function pluginUninstallCommand(slug, options) {
4098
4107
  }
4099
4108
  await api.post("/integrations/bindings/uninstall", {
4100
4109
  agent_id: agent2.agent_id,
4101
- plugin_id: plugin2.id
4110
+ plugin_id: integration2.id
4102
4111
  });
4103
4112
  spinner.stop();
4104
- success(`Uninstalled "${plugin2.name}" from agent "${options.agent}"`);
4113
+ success(`Uninstalled "${integration2.name}" from agent "${options.agent}"`);
4105
4114
  } catch (err) {
4106
4115
  spinner.stop();
4107
4116
  handleError(err);
4108
4117
  }
4109
4118
  }
4110
- async function pluginRequestsCommand() {
4119
+ async function integrationRequestsCommand() {
4111
4120
  const json = isJsonMode();
4112
4121
  const spinner = ora16({ text: "Fetching scope requests\u2026", isSilent: json }).start();
4113
4122
  try {
@@ -4133,7 +4142,7 @@ async function pluginRequestsCommand() {
4133
4142
  handleError(err);
4134
4143
  }
4135
4144
  }
4136
- async function pluginApproveCommand(requestId, options) {
4145
+ async function integrationApproveCommand(requestId, options) {
4137
4146
  const json = isJsonMode();
4138
4147
  const spinner = ora16({ text: "Approving request\u2026", isSilent: json }).start();
4139
4148
  try {
@@ -4152,7 +4161,7 @@ async function pluginApproveCommand(requestId, options) {
4152
4161
  handleError(err);
4153
4162
  }
4154
4163
  }
4155
- async function pluginDenyCommand(requestId, options) {
4164
+ async function integrationDenyCommand(requestId, options) {
4156
4165
  const json = isJsonMode();
4157
4166
  const spinner = ora16({ text: "Denying request\u2026", isSilent: json }).start();
4158
4167
  try {
@@ -4181,7 +4190,7 @@ function handleError(err) {
4181
4190
  }
4182
4191
 
4183
4192
  // src/bin/agt.ts
4184
- var cliVersion2 = true ? "0.15.38" : "dev";
4193
+ var cliVersion2 = true ? "0.16.1" : "dev";
4185
4194
  var program = new Command();
4186
4195
  program.name("agt").description("Augmented CLI \u2014 agent provisioning and management").version(cliVersion2).option("--json", "Emit machine-readable JSON output (suppress spinners and colors)").option("--skip-update-check", "Skip the automatic update check on startup");
4187
4196
  program.hook("preAction", (thisCommand) => {
@@ -4253,14 +4262,14 @@ acpx.command("exec <agent> <prompt>").description("One-shot execution (no sessio
4253
4262
  acpx.command("list-sessions <agent>").description("List active ACP sessions for an agent").action(acpxListSessionsCommand);
4254
4263
  acpx.command("cancel <agent>").description("Send cooperative cancel to the running ACP session").action(acpxCancelCommand);
4255
4264
  acpx.command("close <agent>").description("Soft-close an ACP session (preserves history)").action(acpxCloseCommand);
4256
- var plugin = program.command("plugin").description("Manage plugins \u2014 install, configure, and control permission scopes");
4257
- plugin.command("list").description("List available plugins for the active team").action(pluginListCommand);
4258
- plugin.command("show <slug>").description("Show plugin details including permission scopes").action(pluginShowCommand);
4259
- plugin.command("install <slug>").description("Install a plugin on an agent").requiredOption("--agent <code-name>", "Agent code name").option("--scopes <scopes>", "Comma-separated scope IDs to grant").action(pluginInstallCommand);
4260
- plugin.command("uninstall <slug>").description("Remove a plugin from an agent").requiredOption("--agent <code-name>", "Agent code name").action(pluginUninstallCommand);
4261
- plugin.command("requests").description("List pending scope approval requests for the team").action(pluginRequestsCommand);
4262
- plugin.command("approve <request-id>").description("Approve a scope request").option("--notes <text>", "Review notes").action(pluginApproveCommand);
4263
- plugin.command("deny <request-id>").description("Deny a scope request").option("--reason <text>", "Denial reason").action(pluginDenyCommand);
4265
+ var integration = program.command("integration").description("Manage integrations \u2014 install, configure, and control permission scopes");
4266
+ integration.command("list").description("List available integrations for the active team").action(integrationListCommand);
4267
+ integration.command("show <slug>").description("Show integration details including permission scopes").action(integrationShowCommand);
4268
+ integration.command("install <slug>").description("Install an integration on an agent").requiredOption("--agent <code-name>", "Agent code name").option("--scopes <scopes>", "Comma-separated scope IDs to grant").action(integrationInstallCommand);
4269
+ integration.command("uninstall <slug>").description("Remove an integration from an agent").requiredOption("--agent <code-name>", "Agent code name").action(integrationUninstallCommand);
4270
+ integration.command("requests").description("List pending scope approval requests for the team").action(integrationRequestsCommand);
4271
+ integration.command("approve <request-id>").description("Approve a scope request").option("--notes <text>", "Review notes").action(integrationApproveCommand);
4272
+ integration.command("deny <request-id>").description("Deny a scope request").option("--reason <text>", "Denial reason").action(integrationDenyCommand);
4264
4273
  program.command("update").description("Check for and install CLI updates").option("--force", "Update even if manager or agent sessions are running").action(updateCommand);
4265
4274
  var skipUpdateCheck = process.argv.includes("--skip-update-check") || process.argv.includes("--json") || process.argv[2] === "update";
4266
4275
  if (!skipUpdateCheck) {