@integrity-labs/agt-cli 0.19.2 → 0.19.3
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 +7 -3
- package/dist/bin/agt.js.map +1 -1
- package/dist/{chunk-BEIZXSG4.js → chunk-CZGII2KB.js} +159 -7
- package/dist/chunk-CZGII2KB.js.map +1 -0
- package/dist/lib/manager-worker.js +354 -165
- package/dist/lib/manager-worker.js.map +1 -1
- package/dist/{manager-supervisor-PU5YK5QE.js → manager-supervisor-P63HG5MR.js} +193 -3
- package/dist/manager-supervisor-P63HG5MR.js.map +1 -0
- package/package.json +1 -1
- package/dist/chunk-BEIZXSG4.js.map +0 -1
- package/dist/manager-supervisor-PU5YK5QE.js.map +0 -1
|
@@ -450,6 +450,28 @@ var INTEGRATION_REGISTRY = [
|
|
|
450
450
|
docs_url: "https://docs.granola.ai/docs/api/mcp",
|
|
451
451
|
beta: true
|
|
452
452
|
},
|
|
453
|
+
{
|
|
454
|
+
id: "postiz",
|
|
455
|
+
name: "Postiz",
|
|
456
|
+
category: "social",
|
|
457
|
+
description: "Open-source social-media scheduling and publishing \u2014 schedule posts, list connected platforms, and upload media. Self-hosted-aware (defaults to Postiz Cloud at https://api.postiz.com).",
|
|
458
|
+
// Postiz also supports OAuth2 ('pos_'-prefixed tokens) but the public docs
|
|
459
|
+
// for the authorize/token URL shape are sparse — wired API-key-first; the
|
|
460
|
+
// OAuth path lands as a follow-up once we've confirmed the flow against
|
|
461
|
+
// a live instance.
|
|
462
|
+
supported_auth_types: ["api_key"],
|
|
463
|
+
capabilities: [
|
|
464
|
+
{ id: "postiz:list", name: "List Posts & Platforms", description: "List connected social platforms (GET /integrations) and previously scheduled posts", access: "read" },
|
|
465
|
+
{ id: "postiz:publish", name: "Publish Posts", description: "Create and schedule posts across the connected platforms (POST /posts)", access: "write" },
|
|
466
|
+
{ id: "postiz:upload", name: "Upload Media", description: "Upload images and video for use in posts (POST /upload)", access: "write" }
|
|
467
|
+
],
|
|
468
|
+
docs_url: "https://docs.postiz.com/public-api/introduction",
|
|
469
|
+
// Beta until we've verified the npx-based community MCP server
|
|
470
|
+
// (antoniolg/postiz-mcp) end-to-end against a real Postiz instance.
|
|
471
|
+
// The 30-req/hr public API rate limit also wants real-world
|
|
472
|
+
// validation before we drop the beta flag.
|
|
473
|
+
beta: true
|
|
474
|
+
},
|
|
453
475
|
{
|
|
454
476
|
id: "qmd",
|
|
455
477
|
name: "QMD Memory Search",
|
|
@@ -3828,6 +3850,25 @@ Your job:
|
|
|
3828
3850
|
Do NOT post intermediate progress updates unless the work spans 5+ minutes \u2014 keep noise low. The parent already sent a single-line acknowledgement before dispatching you.
|
|
3829
3851
|
`;
|
|
3830
3852
|
}
|
|
3853
|
+
function buildPostizMcpEntry(integration) {
|
|
3854
|
+
const rawBaseUrl = integration.config["base_url"];
|
|
3855
|
+
const postizBaseUrl = typeof rawBaseUrl === "string" ? rawBaseUrl.trim() : "";
|
|
3856
|
+
const env2 = {
|
|
3857
|
+
// Raw key, no `Bearer` prefix — Postiz's Authorization header takes
|
|
3858
|
+
// the API key verbatim. The MCP server handles framing.
|
|
3859
|
+
POSTIZ_API_KEY: "${POSTIZ_API_KEY}",
|
|
3860
|
+
PATH: process.env["PATH"] ?? "",
|
|
3861
|
+
HOME: process.env["HOME"] ?? ""
|
|
3862
|
+
};
|
|
3863
|
+
if (postizBaseUrl.length > 0) {
|
|
3864
|
+
env2["POSTIZ_BASE_URL"] = "${POSTIZ_BASE_URL}";
|
|
3865
|
+
}
|
|
3866
|
+
return {
|
|
3867
|
+
command: "npx",
|
|
3868
|
+
args: ["-y", "@antoniolg/postiz-mcp"],
|
|
3869
|
+
env: env2
|
|
3870
|
+
};
|
|
3871
|
+
}
|
|
3831
3872
|
function buildMcpJson(input) {
|
|
3832
3873
|
const mcpServers = {};
|
|
3833
3874
|
const localMcpPath = join4(getHomeDir3(), ".augmented", "_mcp", "index.js");
|
|
@@ -3874,6 +3915,10 @@ function buildMcpJson(input) {
|
|
|
3874
3915
|
}
|
|
3875
3916
|
};
|
|
3876
3917
|
}
|
|
3918
|
+
const postizIntegration = input.integrations?.find((i) => i.definition_id === "postiz");
|
|
3919
|
+
if (postizIntegration) {
|
|
3920
|
+
mcpServers["postiz"] = buildPostizMcpEntry(postizIntegration);
|
|
3921
|
+
}
|
|
3877
3922
|
for (const integration of input.integrations ?? []) {
|
|
3878
3923
|
const entry = buildRemoteMcpEntry(integration.definition_id);
|
|
3879
3924
|
if (entry) {
|
|
@@ -4088,8 +4133,13 @@ ${sections}`
|
|
|
4088
4133
|
for (const p of profiles) {
|
|
4089
4134
|
if (!p.api_key)
|
|
4090
4135
|
continue;
|
|
4091
|
-
const
|
|
4092
|
-
envLines.push(`${
|
|
4136
|
+
const providerEnvPrefix = p.provider.toUpperCase().replace(/[^A-Z0-9]/g, "_");
|
|
4137
|
+
envLines.push(`${providerEnvPrefix}_API_KEY=${p.api_key}`);
|
|
4138
|
+
const rawBaseUrl = p.metadata["base_url"];
|
|
4139
|
+
const baseUrl = typeof rawBaseUrl === "string" ? rawBaseUrl.trim() : "";
|
|
4140
|
+
if (baseUrl.length > 0) {
|
|
4141
|
+
envLines.push(`${providerEnvPrefix}_BASE_URL=${baseUrl}`);
|
|
4142
|
+
}
|
|
4093
4143
|
}
|
|
4094
4144
|
if (envLines.length > 1) {
|
|
4095
4145
|
const envPath = join4(agentDir, ".env");
|
|
@@ -4391,6 +4441,10 @@ ${sections}`
|
|
|
4391
4441
|
}
|
|
4392
4442
|
});
|
|
4393
4443
|
}
|
|
4444
|
+
const postizIntegration = integrations.find((i) => i.definition_id === "postiz");
|
|
4445
|
+
if (postizIntegration) {
|
|
4446
|
+
this.writeMcpServer(codeName, "postiz", buildPostizMcpEntry(postizIntegration));
|
|
4447
|
+
}
|
|
4394
4448
|
for (const integration of integrations) {
|
|
4395
4449
|
const entry = buildRemoteMcpEntry(integration.definition_id);
|
|
4396
4450
|
if (entry) {
|
|
@@ -7427,7 +7481,7 @@ import { spawn as spawn3 } from "child_process";
|
|
|
7427
7481
|
// src/lib/watchdog.ts
|
|
7428
7482
|
import { readFileSync as readFileSync6, writeFileSync as writeFileSync6, unlinkSync as unlinkSync3, existsSync as existsSync6, mkdirSync as mkdirSync6, openSync, closeSync, chmodSync as chmodSync5 } from "fs";
|
|
7429
7483
|
import { join as join7 } from "path";
|
|
7430
|
-
import { spawn as spawn2 } from "child_process";
|
|
7484
|
+
import { spawn as spawn2, execFileSync } from "child_process";
|
|
7431
7485
|
var DEFAULT_CONFIG_DIR = join7(process.env["HOME"] ?? "/tmp", ".augmented");
|
|
7432
7486
|
function getManagerPaths(configDir) {
|
|
7433
7487
|
return {
|
|
@@ -7468,6 +7522,21 @@ function isProcessAlive2(pid) {
|
|
|
7468
7522
|
return false;
|
|
7469
7523
|
}
|
|
7470
7524
|
}
|
|
7525
|
+
function findOtherManagerPids(pgrepImpl = defaultPgrep, selfPid = process.pid) {
|
|
7526
|
+
let out;
|
|
7527
|
+
try {
|
|
7528
|
+
out = pgrepImpl();
|
|
7529
|
+
} catch {
|
|
7530
|
+
return [];
|
|
7531
|
+
}
|
|
7532
|
+
return out.split("\n").map((line) => parseInt(line.trim(), 10)).filter((pid) => !isNaN(pid) && pid !== selfPid);
|
|
7533
|
+
}
|
|
7534
|
+
function defaultPgrep() {
|
|
7535
|
+
return execFileSync("pgrep", ["-f", "agt manager start"], {
|
|
7536
|
+
encoding: "utf-8",
|
|
7537
|
+
stdio: ["ignore", "pipe", "ignore"]
|
|
7538
|
+
});
|
|
7539
|
+
}
|
|
7471
7540
|
function readStateFile(configDir) {
|
|
7472
7541
|
try {
|
|
7473
7542
|
const raw = readFileSync6(getManagerPaths(configDir).stateFile, "utf-8");
|
|
@@ -7492,6 +7561,13 @@ function startWatchdog(opts) {
|
|
|
7492
7561
|
removePidFile(configDir);
|
|
7493
7562
|
removeStateFile(configDir);
|
|
7494
7563
|
}
|
|
7564
|
+
const others = findOtherManagerPids();
|
|
7565
|
+
if (others.length > 0) {
|
|
7566
|
+
const pidList = others.join(", ");
|
|
7567
|
+
throw new Error(
|
|
7568
|
+
`Manager already running (PID ${pidList}). Use \`agt manager stop\` first.`
|
|
7569
|
+
);
|
|
7570
|
+
}
|
|
7495
7571
|
if (opts.detached) {
|
|
7496
7572
|
ensureDir2(configDir);
|
|
7497
7573
|
const { logFile } = getManagerPaths(configDir);
|
|
@@ -7854,7 +7930,7 @@ function resolveStableAgtBin(rawPath) {
|
|
|
7854
7930
|
}
|
|
7855
7931
|
async function managerInstallCommand(opts = {}) {
|
|
7856
7932
|
const json = isJsonMode();
|
|
7857
|
-
const { installSupervisor, supervisorStatus } = await import("./manager-supervisor-
|
|
7933
|
+
const { installSupervisor, supervisorStatus } = await import("./manager-supervisor-P63HG5MR.js");
|
|
7858
7934
|
const intervalSec = parseInt(opts.interval ?? "10", 10);
|
|
7859
7935
|
if (isNaN(intervalSec) || intervalSec < 5) {
|
|
7860
7936
|
const msg = "Interval must be at least 5 seconds.";
|
|
@@ -7918,7 +7994,7 @@ async function managerInstallCommand(opts = {}) {
|
|
|
7918
7994
|
}
|
|
7919
7995
|
async function managerUninstallCommand() {
|
|
7920
7996
|
const json = isJsonMode();
|
|
7921
|
-
const { uninstallSupervisor } = await import("./manager-supervisor-
|
|
7997
|
+
const { uninstallSupervisor } = await import("./manager-supervisor-P63HG5MR.js");
|
|
7922
7998
|
const result = await uninstallSupervisor();
|
|
7923
7999
|
if (!result.ok) {
|
|
7924
8000
|
if (json) jsonOutput({ ok: false, error: result.error });
|
|
@@ -7932,6 +8008,80 @@ async function managerUninstallCommand() {
|
|
|
7932
8008
|
info(result.details);
|
|
7933
8009
|
}
|
|
7934
8010
|
}
|
|
8011
|
+
async function managerInstallSystemUnitCommand(opts = {}) {
|
|
8012
|
+
const json = isJsonMode();
|
|
8013
|
+
const { installSystemUnit, systemUnitStatus } = await import("./manager-supervisor-P63HG5MR.js");
|
|
8014
|
+
const intervalSec = parseInt(opts.interval ?? "10", 10);
|
|
8015
|
+
if (isNaN(intervalSec) || intervalSec < 5) {
|
|
8016
|
+
const msg = "Interval must be at least 5 seconds.";
|
|
8017
|
+
if (json) jsonOutput({ ok: false, error: msg });
|
|
8018
|
+
else error(msg);
|
|
8019
|
+
process.exitCode = 1;
|
|
8020
|
+
return;
|
|
8021
|
+
}
|
|
8022
|
+
const user = opts.user ?? "root";
|
|
8023
|
+
const configDir = opts.configDir ?? (user === "root" ? "/root/.augmented" : join8("/home", user, ".augmented"));
|
|
8024
|
+
const rawAgtBin = process.argv[1];
|
|
8025
|
+
if (!rawAgtBin) {
|
|
8026
|
+
const msg = "Could not resolve the agt binary path from argv. Re-run via the installed `agt` command.";
|
|
8027
|
+
if (json) jsonOutput({ ok: false, error: msg });
|
|
8028
|
+
else error(msg);
|
|
8029
|
+
process.exitCode = 1;
|
|
8030
|
+
return;
|
|
8031
|
+
}
|
|
8032
|
+
const agtBin = resolveStableAgtBin(rawAgtBin);
|
|
8033
|
+
if (process.platform !== "linux") {
|
|
8034
|
+
const msg = `install-system-unit is Linux-only (current platform: ${process.platform}). For local dev on macOS use \`agt manager install\`.`;
|
|
8035
|
+
if (json) jsonOutput({ ok: false, error: msg });
|
|
8036
|
+
else error(msg);
|
|
8037
|
+
process.exitCode = 1;
|
|
8038
|
+
return;
|
|
8039
|
+
}
|
|
8040
|
+
const env2 = {
|
|
8041
|
+
AGT_HOST: getHost(),
|
|
8042
|
+
HOME: user === "root" ? "/root" : `/home/${user}`,
|
|
8043
|
+
USER: user
|
|
8044
|
+
};
|
|
8045
|
+
const apiKey = getApiKey();
|
|
8046
|
+
if (apiKey) env2.AGT_API_KEY = apiKey;
|
|
8047
|
+
for (const k of ["AGT_TEAM", "PATH", "CLAUDE_PATH"]) {
|
|
8048
|
+
const v = process.env[k];
|
|
8049
|
+
if (v != null) env2[k] = v;
|
|
8050
|
+
}
|
|
8051
|
+
const result = await installSystemUnit({ agtBin, intervalSec, configDir, env: env2, user });
|
|
8052
|
+
if (!result.ok) {
|
|
8053
|
+
if (json) jsonOutput({ ok: false, error: result.error });
|
|
8054
|
+
else error(result.error);
|
|
8055
|
+
process.exitCode = 1;
|
|
8056
|
+
return;
|
|
8057
|
+
}
|
|
8058
|
+
const status = systemUnitStatus();
|
|
8059
|
+
if (json) {
|
|
8060
|
+
jsonOutput({ ok: true, status, details: result.details });
|
|
8061
|
+
return;
|
|
8062
|
+
}
|
|
8063
|
+
success("System unit installed.");
|
|
8064
|
+
info(result.details);
|
|
8065
|
+
if (status.kind === "installed" && status.pid != null) {
|
|
8066
|
+
info(`Manager running under systemd \u2014 PID ${status.pid}.`);
|
|
8067
|
+
}
|
|
8068
|
+
}
|
|
8069
|
+
async function managerUninstallSystemUnitCommand() {
|
|
8070
|
+
const json = isJsonMode();
|
|
8071
|
+
const { uninstallSystemUnit } = await import("./manager-supervisor-P63HG5MR.js");
|
|
8072
|
+
const result = await uninstallSystemUnit();
|
|
8073
|
+
if (!result.ok) {
|
|
8074
|
+
if (json) jsonOutput({ ok: false, error: result.error });
|
|
8075
|
+
else error(result.error);
|
|
8076
|
+
process.exitCode = 1;
|
|
8077
|
+
return;
|
|
8078
|
+
}
|
|
8079
|
+
if (json) jsonOutput({ ok: true, details: result.details });
|
|
8080
|
+
else {
|
|
8081
|
+
success("System unit uninstalled.");
|
|
8082
|
+
info(result.details);
|
|
8083
|
+
}
|
|
8084
|
+
}
|
|
7935
8085
|
|
|
7936
8086
|
export {
|
|
7937
8087
|
wrapScheduledTaskPrompt,
|
|
@@ -7996,6 +8146,8 @@ export {
|
|
|
7996
8146
|
managerStopCommand,
|
|
7997
8147
|
managerStatusCommand,
|
|
7998
8148
|
managerInstallCommand,
|
|
7999
|
-
managerUninstallCommand
|
|
8149
|
+
managerUninstallCommand,
|
|
8150
|
+
managerInstallSystemUnitCommand,
|
|
8151
|
+
managerUninstallSystemUnitCommand
|
|
8000
8152
|
};
|
|
8001
|
-
//# sourceMappingURL=chunk-
|
|
8153
|
+
//# sourceMappingURL=chunk-CZGII2KB.js.map
|