agentpmo-cli 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/index.d.ts +2 -0
- package/dist/index.js +213 -0
- package/dist/index.js.map +1 -0
- package/package.json +44 -0
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
// src/index.ts
|
|
4
|
+
import { Command as Command5 } from "commander";
|
|
5
|
+
|
|
6
|
+
// src/commands/register.ts
|
|
7
|
+
import { Command } from "commander";
|
|
8
|
+
|
|
9
|
+
// src/lib/api.ts
|
|
10
|
+
async function apiCall(baseUrl, path, options = {}) {
|
|
11
|
+
const { method = "GET", apiKey, body } = options;
|
|
12
|
+
const url = `${baseUrl}${path}`;
|
|
13
|
+
const headers = {
|
|
14
|
+
"Content-Type": "application/json"
|
|
15
|
+
};
|
|
16
|
+
if (apiKey) {
|
|
17
|
+
headers["Authorization"] = `Bearer ${apiKey}`;
|
|
18
|
+
}
|
|
19
|
+
const res = await fetch(url, {
|
|
20
|
+
method,
|
|
21
|
+
headers,
|
|
22
|
+
body: body ? JSON.stringify(body) : void 0
|
|
23
|
+
});
|
|
24
|
+
const json = await res.json();
|
|
25
|
+
if (!res.ok || !json.success) {
|
|
26
|
+
throw new Error(json.error || `HTTP ${res.status}`);
|
|
27
|
+
}
|
|
28
|
+
return json;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// src/commands/register.ts
|
|
32
|
+
function getGlobalOpts(cmd) {
|
|
33
|
+
const root = cmd.parent;
|
|
34
|
+
return {
|
|
35
|
+
apiKey: root.opts().apiKey || process.env.AGENTPMO_API_KEY,
|
|
36
|
+
apiUrl: root.opts().apiUrl || process.env.AGENTPMO_API_URL || "http://localhost:3000/api"
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
var registerCommand = new Command("register").description("Register a new AI agent").requiredOption("-n, --name <name>", "Agent name").requiredOption("-i, --id <id>", "Agent external ID (slug)").option("-d, --description <desc>", "Agent description").option("-m, --model <model>", "Model name (e.g. gpt-4o, claude-sonnet-4)").option("-p, --provider <provider>", "Model provider (e.g. openai, anthropic)").option("-e, --environment <env>", "Environment (production, staging, development)").action(async function(options) {
|
|
40
|
+
const { apiKey, apiUrl } = getGlobalOpts(this);
|
|
41
|
+
if (!apiKey) {
|
|
42
|
+
console.error("Error: --api-key or AGENTPMO_API_KEY is required");
|
|
43
|
+
process.exit(1);
|
|
44
|
+
}
|
|
45
|
+
try {
|
|
46
|
+
const result = await apiCall(apiUrl, "/agents", {
|
|
47
|
+
method: "POST",
|
|
48
|
+
apiKey,
|
|
49
|
+
body: {
|
|
50
|
+
externalId: options.id,
|
|
51
|
+
name: options.name,
|
|
52
|
+
description: options.description,
|
|
53
|
+
modelName: options.model,
|
|
54
|
+
modelProvider: options.provider,
|
|
55
|
+
environment: options.environment
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
const agent = result.data;
|
|
59
|
+
console.log(`\u2713 Agent registered successfully`);
|
|
60
|
+
console.log(` ID: ${agent.id}`);
|
|
61
|
+
console.log(` Name: ${agent.name}`);
|
|
62
|
+
console.log(` Slug: ${agent.externalId}`);
|
|
63
|
+
console.log(` Status: ${agent.status}`);
|
|
64
|
+
} catch (err) {
|
|
65
|
+
console.error(`Error: ${err instanceof Error ? err.message : err}`);
|
|
66
|
+
process.exit(1);
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
// src/commands/heartbeat.ts
|
|
71
|
+
import { Command as Command2 } from "commander";
|
|
72
|
+
function getGlobalOpts2(cmd) {
|
|
73
|
+
const root = cmd.parent;
|
|
74
|
+
return {
|
|
75
|
+
apiKey: root.opts().apiKey || process.env.AGENTPMO_API_KEY,
|
|
76
|
+
apiUrl: root.opts().apiUrl || process.env.AGENTPMO_API_URL || "http://localhost:3000/api"
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
var heartbeatCommand = new Command2("heartbeat").description("Send a heartbeat for an agent").requiredOption("-a, --agent-id <id>", "Agent UUID").action(async function(options) {
|
|
80
|
+
const { apiKey, apiUrl } = getGlobalOpts2(this);
|
|
81
|
+
if (!apiKey) {
|
|
82
|
+
console.error("Error: --api-key or AGENTPMO_API_KEY is required");
|
|
83
|
+
process.exit(1);
|
|
84
|
+
}
|
|
85
|
+
try {
|
|
86
|
+
const result = await apiCall(apiUrl, `/agents/${options.agentId}/heartbeat`, {
|
|
87
|
+
method: "POST",
|
|
88
|
+
apiKey
|
|
89
|
+
});
|
|
90
|
+
const data = result.data;
|
|
91
|
+
console.log(`\u2713 Heartbeat sent`);
|
|
92
|
+
console.log(` Agent: ${data.id}`);
|
|
93
|
+
console.log(` Timestamp: ${data.lastHeartbeat}`);
|
|
94
|
+
} catch (err) {
|
|
95
|
+
console.error(`Error: ${err instanceof Error ? err.message : err}`);
|
|
96
|
+
process.exit(1);
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
// src/commands/report.ts
|
|
101
|
+
import { Command as Command3 } from "commander";
|
|
102
|
+
function getGlobalOpts3(cmd) {
|
|
103
|
+
const root = cmd.parent;
|
|
104
|
+
return {
|
|
105
|
+
apiKey: root.opts().apiKey || process.env.AGENTPMO_API_KEY,
|
|
106
|
+
apiUrl: root.opts().apiUrl || process.env.AGENTPMO_API_URL || "http://localhost:3000/api"
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
var reportCommand = new Command3("report").description("Generate a report").option("-f, --format <format>", "Output format: json, table", "table").action(async function(options) {
|
|
110
|
+
const { apiKey, apiUrl } = getGlobalOpts3(this);
|
|
111
|
+
if (!apiKey) {
|
|
112
|
+
console.error("Error: --api-key or AGENTPMO_API_KEY is required");
|
|
113
|
+
process.exit(1);
|
|
114
|
+
}
|
|
115
|
+
try {
|
|
116
|
+
const agentsResult = await apiCall(apiUrl, "/agents", { apiKey });
|
|
117
|
+
const agents = agentsResult.data;
|
|
118
|
+
if (options.format === "json") {
|
|
119
|
+
console.log(JSON.stringify({ agents, total: agents.length }, null, 2));
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
const total = agents.length;
|
|
123
|
+
const active = agents.filter((a) => a.status === "active").length;
|
|
124
|
+
const stale = agents.filter((a) => {
|
|
125
|
+
if (!a.lastHeartbeat) return true;
|
|
126
|
+
const diff = Date.now() - new Date(a.lastHeartbeat).getTime();
|
|
127
|
+
return diff > 24 * 60 * 60 * 1e3;
|
|
128
|
+
}).length;
|
|
129
|
+
console.log("\u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557");
|
|
130
|
+
console.log("\u2551 AgentPMO Executive Report \u2551");
|
|
131
|
+
console.log("\u2560\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2563");
|
|
132
|
+
console.log(`\u2551 Total Agents: ${String(total).padStart(12)} \u2551`);
|
|
133
|
+
console.log(`\u2551 Active: ${String(active).padStart(12)} \u2551`);
|
|
134
|
+
console.log(`\u2551 Stale (>24h): ${String(stale).padStart(12)} \u2551`);
|
|
135
|
+
console.log("\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D");
|
|
136
|
+
if (stale > 0) {
|
|
137
|
+
console.log("\n\u26A0 Agents missing heartbeat (>24h):");
|
|
138
|
+
agents.filter((a) => {
|
|
139
|
+
if (!a.lastHeartbeat) return true;
|
|
140
|
+
const diff = Date.now() - new Date(a.lastHeartbeat).getTime();
|
|
141
|
+
return diff > 24 * 60 * 60 * 1e3;
|
|
142
|
+
}).forEach((a) => {
|
|
143
|
+
console.log(` - ${a.name} (${a.externalId})`);
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
} catch (err) {
|
|
147
|
+
console.error(`Error: ${err instanceof Error ? err.message : err}`);
|
|
148
|
+
process.exit(1);
|
|
149
|
+
}
|
|
150
|
+
});
|
|
151
|
+
|
|
152
|
+
// src/commands/list.ts
|
|
153
|
+
import { Command as Command4 } from "commander";
|
|
154
|
+
function getGlobalOpts4(cmd) {
|
|
155
|
+
const root = cmd.parent;
|
|
156
|
+
return {
|
|
157
|
+
apiKey: root.opts().apiKey || process.env.AGENTPMO_API_KEY,
|
|
158
|
+
apiUrl: root.opts().apiUrl || process.env.AGENTPMO_API_URL || "http://localhost:3000/api"
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
var listCommand = new Command4("list").description("List registered agents").option("-s, --status <status>", "Filter by status").option("-f, --format <format>", "Output format: table, json", "table").action(async function(options) {
|
|
162
|
+
const { apiKey, apiUrl } = getGlobalOpts4(this);
|
|
163
|
+
if (!apiKey) {
|
|
164
|
+
console.error("Error: --api-key or AGENTPMO_API_KEY is required");
|
|
165
|
+
process.exit(1);
|
|
166
|
+
}
|
|
167
|
+
try {
|
|
168
|
+
const query = options.status ? `?status=${options.status}` : "";
|
|
169
|
+
const result = await apiCall(apiUrl, `/agents${query}`, { apiKey });
|
|
170
|
+
const agents = result.data;
|
|
171
|
+
if (options.format === "json") {
|
|
172
|
+
console.log(JSON.stringify(agents, null, 2));
|
|
173
|
+
return;
|
|
174
|
+
}
|
|
175
|
+
if (agents.length === 0) {
|
|
176
|
+
console.log("No agents found.");
|
|
177
|
+
return;
|
|
178
|
+
}
|
|
179
|
+
const header = ["NAME", "ID", "STATUS", "PROVIDER", "MODEL", "ENVIRONMENT", "LAST HEARTBEAT"];
|
|
180
|
+
const rows = agents.map((a) => [
|
|
181
|
+
String(a.name || ""),
|
|
182
|
+
String(a.externalId || ""),
|
|
183
|
+
String(a.status || ""),
|
|
184
|
+
String(a.modelProvider || "\u2014"),
|
|
185
|
+
String(a.modelName || "\u2014"),
|
|
186
|
+
String(a.environment || "\u2014"),
|
|
187
|
+
a.lastHeartbeat ? new Date(a.lastHeartbeat).toLocaleString() : "Never"
|
|
188
|
+
]);
|
|
189
|
+
const widths = header.map(
|
|
190
|
+
(h, i) => Math.max(h.length, ...rows.map((r) => r[i].length))
|
|
191
|
+
);
|
|
192
|
+
const sep = widths.map((w) => "\u2500".repeat(w + 2)).join("\u253C");
|
|
193
|
+
const formatRow = (row) => row.map((cell, i) => ` ${cell.padEnd(widths[i])} `).join("\u2502");
|
|
194
|
+
console.log(formatRow(header));
|
|
195
|
+
console.log(sep);
|
|
196
|
+
rows.forEach((row) => console.log(formatRow(row)));
|
|
197
|
+
console.log(`
|
|
198
|
+
${agents.length} agent(s) total`);
|
|
199
|
+
} catch (err) {
|
|
200
|
+
console.error(`Error: ${err instanceof Error ? err.message : err}`);
|
|
201
|
+
process.exit(1);
|
|
202
|
+
}
|
|
203
|
+
});
|
|
204
|
+
|
|
205
|
+
// src/index.ts
|
|
206
|
+
var program = new Command5();
|
|
207
|
+
program.name("agentpmo").description("AgentPMO CLI \u2014 manage and monitor AI agents").version("0.1.0").option("--api-key <key>", "API key for authentication (or set AGENTPMO_API_KEY)").option("--api-url <url>", "API base URL (or set AGENTPMO_API_URL)", "http://localhost:3000/api");
|
|
208
|
+
program.addCommand(registerCommand);
|
|
209
|
+
program.addCommand(heartbeatCommand);
|
|
210
|
+
program.addCommand(reportCommand);
|
|
211
|
+
program.addCommand(listCommand);
|
|
212
|
+
program.parse();
|
|
213
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/commands/register.ts","../src/lib/api.ts","../src/commands/heartbeat.ts","../src/commands/report.ts","../src/commands/list.ts"],"sourcesContent":["import { Command } from \"commander\";\nimport { registerCommand } from \"./commands/register.js\";\nimport { heartbeatCommand } from \"./commands/heartbeat.js\";\nimport { reportCommand } from \"./commands/report.js\";\nimport { listCommand } from \"./commands/list.js\";\n\nconst program = new Command();\n\nprogram\n .name(\"agentpmo\")\n .description(\"AgentPMO CLI — manage and monitor AI agents\")\n .version(\"0.1.0\")\n .option(\"--api-key <key>\", \"API key for authentication (or set AGENTPMO_API_KEY)\")\n .option(\"--api-url <url>\", \"API base URL (or set AGENTPMO_API_URL)\", \"http://localhost:3000/api\");\n\nprogram.addCommand(registerCommand);\nprogram.addCommand(heartbeatCommand);\nprogram.addCommand(reportCommand);\nprogram.addCommand(listCommand);\n\nprogram.parse();\n","import { Command } from \"commander\";\nimport { apiCall } from \"../lib/api.js\";\n\nfunction getGlobalOpts(cmd: Command) {\n const root = cmd.parent!;\n return {\n apiKey: root.opts().apiKey || process.env.AGENTPMO_API_KEY,\n apiUrl: root.opts().apiUrl || process.env.AGENTPMO_API_URL || \"http://localhost:3000/api\",\n };\n}\n\nexport const registerCommand = new Command(\"register\")\n .description(\"Register a new AI agent\")\n .requiredOption(\"-n, --name <name>\", \"Agent name\")\n .requiredOption(\"-i, --id <id>\", \"Agent external ID (slug)\")\n .option(\"-d, --description <desc>\", \"Agent description\")\n .option(\"-m, --model <model>\", \"Model name (e.g. gpt-4o, claude-sonnet-4)\")\n .option(\"-p, --provider <provider>\", \"Model provider (e.g. openai, anthropic)\")\n .option(\"-e, --environment <env>\", \"Environment (production, staging, development)\")\n .action(async function (this: Command, options) {\n const { apiKey, apiUrl } = getGlobalOpts(this);\n if (!apiKey) {\n console.error(\"Error: --api-key or AGENTPMO_API_KEY is required\");\n process.exit(1);\n }\n\n try {\n const result = await apiCall(apiUrl, \"/agents\", {\n method: \"POST\",\n apiKey,\n body: {\n externalId: options.id,\n name: options.name,\n description: options.description,\n modelName: options.model,\n modelProvider: options.provider,\n environment: options.environment,\n },\n });\n\n const agent = result.data as Record<string, unknown>;\n console.log(`✓ Agent registered successfully`);\n console.log(` ID: ${agent.id}`);\n console.log(` Name: ${agent.name}`);\n console.log(` Slug: ${agent.externalId}`);\n console.log(` Status: ${agent.status}`);\n } catch (err) {\n console.error(`Error: ${err instanceof Error ? err.message : err}`);\n process.exit(1);\n }\n });\n","export interface ApiResponse<T = unknown> {\n success: boolean;\n data?: T;\n error?: string;\n}\n\nexport async function apiCall<T = unknown>(\n baseUrl: string,\n path: string,\n options: {\n method?: string;\n apiKey?: string;\n body?: unknown;\n } = {}\n): Promise<ApiResponse<T>> {\n const { method = \"GET\", apiKey, body } = options;\n const url = `${baseUrl}${path}`;\n\n const headers: Record<string, string> = {\n \"Content-Type\": \"application/json\",\n };\n if (apiKey) {\n headers[\"Authorization\"] = `Bearer ${apiKey}`;\n }\n\n const res = await fetch(url, {\n method,\n headers,\n body: body ? JSON.stringify(body) : undefined,\n });\n\n const json = await res.json() as ApiResponse<T>;\n\n if (!res.ok || !json.success) {\n throw new Error(json.error || `HTTP ${res.status}`);\n }\n\n return json;\n}\n","import { Command } from \"commander\";\nimport { apiCall } from \"../lib/api.js\";\n\nfunction getGlobalOpts(cmd: Command) {\n const root = cmd.parent!;\n return {\n apiKey: root.opts().apiKey || process.env.AGENTPMO_API_KEY,\n apiUrl: root.opts().apiUrl || process.env.AGENTPMO_API_URL || \"http://localhost:3000/api\",\n };\n}\n\nexport const heartbeatCommand = new Command(\"heartbeat\")\n .description(\"Send a heartbeat for an agent\")\n .requiredOption(\"-a, --agent-id <id>\", \"Agent UUID\")\n .action(async function (this: Command, options) {\n const { apiKey, apiUrl } = getGlobalOpts(this);\n if (!apiKey) {\n console.error(\"Error: --api-key or AGENTPMO_API_KEY is required\");\n process.exit(1);\n }\n\n try {\n const result = await apiCall(apiUrl, `/agents/${options.agentId}/heartbeat`, {\n method: \"POST\",\n apiKey,\n });\n\n const data = result.data as Record<string, unknown>;\n console.log(`✓ Heartbeat sent`);\n console.log(` Agent: ${data.id}`);\n console.log(` Timestamp: ${data.lastHeartbeat}`);\n } catch (err) {\n console.error(`Error: ${err instanceof Error ? err.message : err}`);\n process.exit(1);\n }\n });\n","import { Command } from \"commander\";\nimport { apiCall } from \"../lib/api.js\";\n\nfunction getGlobalOpts(cmd: Command) {\n const root = cmd.parent!;\n return {\n apiKey: root.opts().apiKey || process.env.AGENTPMO_API_KEY,\n apiUrl: root.opts().apiUrl || process.env.AGENTPMO_API_URL || \"http://localhost:3000/api\",\n };\n}\n\nexport const reportCommand = new Command(\"report\")\n .description(\"Generate a report\")\n .option(\"-f, --format <format>\", \"Output format: json, table\", \"table\")\n .action(async function (this: Command, options) {\n const { apiKey, apiUrl } = getGlobalOpts(this);\n if (!apiKey) {\n console.error(\"Error: --api-key or AGENTPMO_API_KEY is required\");\n process.exit(1);\n }\n\n try {\n // Fetch agents\n const agentsResult = await apiCall(apiUrl, \"/agents\", { apiKey });\n const agents = agentsResult.data as Record<string, unknown>[];\n\n if (options.format === \"json\") {\n console.log(JSON.stringify({ agents, total: agents.length }, null, 2));\n return;\n }\n\n // Summary report\n const total = agents.length;\n const active = agents.filter((a) => a.status === \"active\").length;\n const stale = agents.filter((a) => {\n if (!a.lastHeartbeat) return true;\n const diff = Date.now() - new Date(a.lastHeartbeat as string).getTime();\n return diff > 24 * 60 * 60 * 1000;\n }).length;\n\n console.log(\"╔══════════════════════════════════╗\");\n console.log(\"║ AgentPMO Executive Report ║\");\n console.log(\"╠══════════════════════════════════╣\");\n console.log(`║ Total Agents: ${String(total).padStart(12)} ║`);\n console.log(`║ Active: ${String(active).padStart(12)} ║`);\n console.log(`║ Stale (>24h): ${String(stale).padStart(12)} ║`);\n console.log(\"╚══════════════════════════════════╝\");\n\n if (stale > 0) {\n console.log(\"\\n⚠ Agents missing heartbeat (>24h):\");\n agents\n .filter((a) => {\n if (!a.lastHeartbeat) return true;\n const diff = Date.now() - new Date(a.lastHeartbeat as string).getTime();\n return diff > 24 * 60 * 60 * 1000;\n })\n .forEach((a) => {\n console.log(` - ${a.name} (${a.externalId})`);\n });\n }\n } catch (err) {\n console.error(`Error: ${err instanceof Error ? err.message : err}`);\n process.exit(1);\n }\n });\n","import { Command } from \"commander\";\nimport { apiCall } from \"../lib/api.js\";\n\nfunction getGlobalOpts(cmd: Command) {\n const root = cmd.parent!;\n return {\n apiKey: root.opts().apiKey || process.env.AGENTPMO_API_KEY,\n apiUrl: root.opts().apiUrl || process.env.AGENTPMO_API_URL || \"http://localhost:3000/api\",\n };\n}\n\nexport const listCommand = new Command(\"list\")\n .description(\"List registered agents\")\n .option(\"-s, --status <status>\", \"Filter by status\")\n .option(\"-f, --format <format>\", \"Output format: table, json\", \"table\")\n .action(async function (this: Command, options) {\n const { apiKey, apiUrl } = getGlobalOpts(this);\n if (!apiKey) {\n console.error(\"Error: --api-key or AGENTPMO_API_KEY is required\");\n process.exit(1);\n }\n\n try {\n const query = options.status ? `?status=${options.status}` : \"\";\n const result = await apiCall(apiUrl, `/agents${query}`, { apiKey });\n const agents = result.data as Record<string, unknown>[];\n\n if (options.format === \"json\") {\n console.log(JSON.stringify(agents, null, 2));\n return;\n }\n\n if (agents.length === 0) {\n console.log(\"No agents found.\");\n return;\n }\n\n // Table format\n const header = [\"NAME\", \"ID\", \"STATUS\", \"PROVIDER\", \"MODEL\", \"ENVIRONMENT\", \"LAST HEARTBEAT\"];\n const rows = agents.map((a) => [\n String(a.name || \"\"),\n String(a.externalId || \"\"),\n String(a.status || \"\"),\n String(a.modelProvider || \"—\"),\n String(a.modelName || \"—\"),\n String(a.environment || \"—\"),\n a.lastHeartbeat ? new Date(a.lastHeartbeat as string).toLocaleString() : \"Never\",\n ]);\n\n // Calculate column widths\n const widths = header.map((h, i) =>\n Math.max(h.length, ...rows.map((r) => r[i].length))\n );\n\n const sep = widths.map((w) => \"─\".repeat(w + 2)).join(\"┼\");\n const formatRow = (row: string[]) =>\n row.map((cell, i) => ` ${cell.padEnd(widths[i])} `).join(\"│\");\n\n console.log(formatRow(header));\n console.log(sep);\n rows.forEach((row) => console.log(formatRow(row)));\n console.log(`\\n${agents.length} agent(s) total`);\n } catch (err) {\n console.error(`Error: ${err instanceof Error ? err.message : err}`);\n process.exit(1);\n }\n });\n"],"mappings":";;;AAAA,SAAS,WAAAA,gBAAe;;;ACAxB,SAAS,eAAe;;;ACMxB,eAAsB,QACpB,SACA,MACA,UAII,CAAC,GACoB;AACzB,QAAM,EAAE,SAAS,OAAO,QAAQ,KAAK,IAAI;AACzC,QAAM,MAAM,GAAG,OAAO,GAAG,IAAI;AAE7B,QAAM,UAAkC;AAAA,IACtC,gBAAgB;AAAA,EAClB;AACA,MAAI,QAAQ;AACV,YAAQ,eAAe,IAAI,UAAU,MAAM;AAAA,EAC7C;AAEA,QAAM,MAAM,MAAM,MAAM,KAAK;AAAA,IAC3B;AAAA,IACA;AAAA,IACA,MAAM,OAAO,KAAK,UAAU,IAAI,IAAI;AAAA,EACtC,CAAC;AAED,QAAM,OAAO,MAAM,IAAI,KAAK;AAE5B,MAAI,CAAC,IAAI,MAAM,CAAC,KAAK,SAAS;AAC5B,UAAM,IAAI,MAAM,KAAK,SAAS,QAAQ,IAAI,MAAM,EAAE;AAAA,EACpD;AAEA,SAAO;AACT;;;ADnCA,SAAS,cAAc,KAAc;AACnC,QAAM,OAAO,IAAI;AACjB,SAAO;AAAA,IACL,QAAQ,KAAK,KAAK,EAAE,UAAU,QAAQ,IAAI;AAAA,IAC1C,QAAQ,KAAK,KAAK,EAAE,UAAU,QAAQ,IAAI,oBAAoB;AAAA,EAChE;AACF;AAEO,IAAM,kBAAkB,IAAI,QAAQ,UAAU,EAClD,YAAY,yBAAyB,EACrC,eAAe,qBAAqB,YAAY,EAChD,eAAe,iBAAiB,0BAA0B,EAC1D,OAAO,4BAA4B,mBAAmB,EACtD,OAAO,uBAAuB,2CAA2C,EACzE,OAAO,6BAA6B,yCAAyC,EAC7E,OAAO,2BAA2B,gDAAgD,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AQ,GAAG,KAAK,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,MAAM,CAAC;AAAA,IACpD;AAEA,UAAM,MAAM,OAAO,IAAI,CAAC,MAAM,SAAI,OAAO,IAAI,CAAC,CAAC,EAAE,KAAK,QAAG;AACzD,UAAM,YAAY,CAAC,QACjB,IAAI,IAAI,CAAC,MAAM,MAAM,IAAI,KAAK,OAAO,OAAO,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,QAAG;AAE9D,YAAQ,IAAI,UAAU,MAAM,CAAC;AAC7B,YAAQ,IAAI,GAAG;AACf,SAAK,QAAQ,CAAC,QAAQ,QAAQ,IAAI,UAAU,GAAG,CAAC,CAAC;AACjD,YAAQ,IAAI;AAAA,EAAK,OAAO,MAAM,iBAAiB;AAAA,EACjD,SAAS,KAAK;AACZ,YAAQ,MAAM,UAAU,eAAe,QAAQ,IAAI,UAAU,GAAG,EAAE;AAClE,YAAQ,KAAK,CAAC;AAAA,EAChB;AACF,CAAC;;;AL5DH,IAAM,UAAU,IAAIE,SAAQ;AAE5B,QACG,KAAK,UAAU,EACf,YAAY,kDAA6C,EACzD,QAAQ,OAAO,EACf,OAAO,mBAAmB,sDAAsD,EAChF,OAAO,mBAAmB,0CAA0C,2BAA2B;AAElG,QAAQ,WAAW,eAAe;AAClC,QAAQ,WAAW,gBAAgB;AACnC,QAAQ,WAAW,aAAa;AAChC,QAAQ,WAAW,WAAW;AAE9B,QAAQ,MAAM;","names":["Command","Command","getGlobalOpts","Command","Command","getGlobalOpts","Command","Command","getGlobalOpts","Command","Command"]}
|
package/package.json
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "agentpmo-cli",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "CLI for AgentPMO — register, monitor, and govern AI agents",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"agentpmo": "./dist/index.js"
|
|
8
|
+
},
|
|
9
|
+
"files": [
|
|
10
|
+
"dist"
|
|
11
|
+
],
|
|
12
|
+
"scripts": {
|
|
13
|
+
"build": "tsup",
|
|
14
|
+
"dev": "tsup --watch",
|
|
15
|
+
"typecheck": "tsc --noEmit",
|
|
16
|
+
"lint": "eslint .",
|
|
17
|
+
"clean": "rm -rf dist .turbo",
|
|
18
|
+
"prepublishOnly": "pnpm build"
|
|
19
|
+
},
|
|
20
|
+
"keywords": [
|
|
21
|
+
"ai",
|
|
22
|
+
"agents",
|
|
23
|
+
"governance",
|
|
24
|
+
"compliance",
|
|
25
|
+
"eu-ai-act",
|
|
26
|
+
"cli"
|
|
27
|
+
],
|
|
28
|
+
"author": "AgentPMO",
|
|
29
|
+
"license": "MIT",
|
|
30
|
+
"repository": {
|
|
31
|
+
"type": "git",
|
|
32
|
+
"url": "https://github.com/Leclezio69/agentpmo",
|
|
33
|
+
"directory": "packages/cli"
|
|
34
|
+
},
|
|
35
|
+
"homepage": "https://getagentpmo.com",
|
|
36
|
+
"dependencies": {
|
|
37
|
+
"commander": "^13.1.0"
|
|
38
|
+
},
|
|
39
|
+
"devDependencies": {
|
|
40
|
+
"@agentpmo/shared": "workspace:*",
|
|
41
|
+
"tsup": "^8.4.0",
|
|
42
|
+
"typescript": "^5.8.0"
|
|
43
|
+
}
|
|
44
|
+
}
|