@integrity-labs/agt-cli 0.28.150 → 0.28.152
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 +3 -3
- package/dist/{chunk-LCKA5XPX.js → chunk-2K6DIZXU.js} +54 -10
- package/dist/chunk-2K6DIZXU.js.map +1 -0
- package/dist/lib/manager-worker.js +9 -4
- package/dist/lib/manager-worker.js.map +1 -1
- package/dist/mcp/remote-oauth-proxy.js +168 -0
- package/dist/mcp/slack-channel.js +52 -3
- package/package.json +2 -2
- package/dist/chunk-LCKA5XPX.js.map +0 -1
package/dist/bin/agt.js
CHANGED
|
@@ -37,7 +37,7 @@ import {
|
|
|
37
37
|
success,
|
|
38
38
|
table,
|
|
39
39
|
warn
|
|
40
|
-
} from "../chunk-
|
|
40
|
+
} from "../chunk-2K6DIZXU.js";
|
|
41
41
|
import {
|
|
42
42
|
CHANNEL_REGISTRY,
|
|
43
43
|
DEPLOYMENT_TEMPLATES,
|
|
@@ -4777,7 +4777,7 @@ import { execFileSync, execSync } from "child_process";
|
|
|
4777
4777
|
import { existsSync as existsSync10, realpathSync as realpathSync2 } from "fs";
|
|
4778
4778
|
import chalk18 from "chalk";
|
|
4779
4779
|
import ora16 from "ora";
|
|
4780
|
-
var cliVersion = true ? "0.28.
|
|
4780
|
+
var cliVersion = true ? "0.28.152" : "dev";
|
|
4781
4781
|
async function fetchLatestVersion() {
|
|
4782
4782
|
const host2 = getHost();
|
|
4783
4783
|
if (!host2) return null;
|
|
@@ -5791,7 +5791,7 @@ function handleError(err) {
|
|
|
5791
5791
|
}
|
|
5792
5792
|
|
|
5793
5793
|
// src/bin/agt.ts
|
|
5794
|
-
var cliVersion2 = true ? "0.28.
|
|
5794
|
+
var cliVersion2 = true ? "0.28.152" : "dev";
|
|
5795
5795
|
var program = new Command();
|
|
5796
5796
|
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");
|
|
5797
5797
|
program.hook("preAction", async (thisCommand, actionCommand) => {
|
|
@@ -3988,6 +3988,24 @@ function buildRemoteMcpEntry(definitionId) {
|
|
|
3988
3988
|
function buildHostBrokeredRemoteMcpEntry(url) {
|
|
3989
3989
|
return { type: "http", url };
|
|
3990
3990
|
}
|
|
3991
|
+
function buildOAuthRemoteMcpProxyEntry(definitionId, paths) {
|
|
3992
|
+
const def = INTEGRATION_REGISTRY.find((d) => d.id === definitionId);
|
|
3993
|
+
if (def?.remoteMcp)
|
|
3994
|
+
return null;
|
|
3995
|
+
const provider = OAUTH_PROVIDERS[definitionId];
|
|
3996
|
+
if (!provider?.mcpUrl)
|
|
3997
|
+
return null;
|
|
3998
|
+
return {
|
|
3999
|
+
command: "node",
|
|
4000
|
+
args: [paths.proxyPath],
|
|
4001
|
+
env: {
|
|
4002
|
+
AGT_REMOTE_MCP_URL: provider.mcpUrl,
|
|
4003
|
+
AGT_REMOTE_MCP_TOKEN_FILE: paths.tokenFile,
|
|
4004
|
+
AGT_REMOTE_MCP_TOKEN_VAR: envVarForToken(definitionId),
|
|
4005
|
+
AGT_REMOTE_MCP_LABEL: definitionId
|
|
4006
|
+
}
|
|
4007
|
+
};
|
|
4008
|
+
}
|
|
3991
4009
|
|
|
3992
4010
|
// ../../packages/core/dist/provisioning/native-mcp.js
|
|
3993
4011
|
function buildNativeMcpEntry(spec, ctx) {
|
|
@@ -5923,7 +5941,16 @@ function buildMcpJson(input) {
|
|
|
5923
5941
|
if (postizIntegration) {
|
|
5924
5942
|
mcpServers["postiz"] = buildPostizMcpEntry(postizIntegration);
|
|
5925
5943
|
}
|
|
5944
|
+
const remoteOAuthProxyPaths = {
|
|
5945
|
+
proxyPath: join4(getHomeDir3(), ".augmented", "_mcp", "remote-oauth-proxy.js"),
|
|
5946
|
+
tokenFile: join4(getProjectDir(input.agent.code_name), ".env.integrations")
|
|
5947
|
+
};
|
|
5926
5948
|
for (const integration of input.integrations ?? []) {
|
|
5949
|
+
const proxyEntry = buildOAuthRemoteMcpProxyEntry(integration.definition_id, remoteOAuthProxyPaths);
|
|
5950
|
+
if (proxyEntry) {
|
|
5951
|
+
mcpServers[integration.definition_id] = proxyEntry;
|
|
5952
|
+
continue;
|
|
5953
|
+
}
|
|
5927
5954
|
const entry = buildRemoteMcpEntry(integration.definition_id);
|
|
5928
5955
|
if (entry) {
|
|
5929
5956
|
mcpServers[integration.definition_id] = entry;
|
|
@@ -7007,7 +7034,16 @@ ${sections}`
|
|
|
7007
7034
|
if (postizIntegration) {
|
|
7008
7035
|
this.writeMcpServer(codeName, "postiz", buildPostizMcpEntry(postizIntegration));
|
|
7009
7036
|
}
|
|
7037
|
+
const remoteOAuthProxyPaths = {
|
|
7038
|
+
proxyPath: join4(getHomeDir3(), ".augmented", "_mcp", "remote-oauth-proxy.js"),
|
|
7039
|
+
tokenFile: join4(getProjectDir(codeName), ".env.integrations")
|
|
7040
|
+
};
|
|
7010
7041
|
for (const integration of integrations) {
|
|
7042
|
+
const proxyEntry = buildOAuthRemoteMcpProxyEntry(integration.definition_id, remoteOAuthProxyPaths);
|
|
7043
|
+
if (proxyEntry) {
|
|
7044
|
+
this.writeMcpServer(codeName, integration.definition_id, proxyEntry);
|
|
7045
|
+
continue;
|
|
7046
|
+
}
|
|
7011
7047
|
const entry = buildRemoteMcpEntry(integration.definition_id);
|
|
7012
7048
|
if (entry) {
|
|
7013
7049
|
this.writeMcpServer(codeName, integration.definition_id, entry);
|
|
@@ -7814,7 +7850,7 @@ function requireHost() {
|
|
|
7814
7850
|
}
|
|
7815
7851
|
|
|
7816
7852
|
// src/lib/api-client.ts
|
|
7817
|
-
var agtCliVersion = true ? "0.28.
|
|
7853
|
+
var agtCliVersion = true ? "0.28.152" : "dev";
|
|
7818
7854
|
var lastConfigHash = null;
|
|
7819
7855
|
function setConfigHash(hash) {
|
|
7820
7856
|
lastConfigHash = hash && hash.length > 0 ? hash : null;
|
|
@@ -8266,14 +8302,15 @@ function readMcpHttpServerConfig(projectDir, serverKey, env) {
|
|
|
8266
8302
|
const raw = readFileSync8(join8(projectDir, ".mcp.json"), "utf-8");
|
|
8267
8303
|
const servers = JSON.parse(raw).mcpServers ?? {};
|
|
8268
8304
|
const entry = servers[serverKey];
|
|
8269
|
-
if (entry
|
|
8270
|
-
|
|
8271
|
-
|
|
8272
|
-
|
|
8273
|
-
|
|
8274
|
-
|
|
8275
|
-
|
|
8276
|
-
|
|
8305
|
+
if (!entry) return null;
|
|
8306
|
+
const unresolved = /* @__PURE__ */ new Set();
|
|
8307
|
+
const sub = (value) => {
|
|
8308
|
+
if (!env) return value;
|
|
8309
|
+
const r = expandTemplateVars(value, env);
|
|
8310
|
+
for (const name of r.unresolved) unresolved.add(name);
|
|
8311
|
+
return r.value;
|
|
8312
|
+
};
|
|
8313
|
+
if (typeof entry.url === "string" && (entry.type === "http" || entry.type === void 0)) {
|
|
8277
8314
|
const url = sub(entry.url);
|
|
8278
8315
|
let headers;
|
|
8279
8316
|
if (entry.headers) {
|
|
@@ -8282,6 +8319,13 @@ function readMcpHttpServerConfig(projectDir, serverKey, env) {
|
|
|
8282
8319
|
}
|
|
8283
8320
|
return { url, ...headers ? { headers } : {}, unresolved: [...unresolved] };
|
|
8284
8321
|
}
|
|
8322
|
+
const proxyUrl = entry.env?.["AGT_REMOTE_MCP_URL"];
|
|
8323
|
+
const tokenVar = entry.env?.["AGT_REMOTE_MCP_TOKEN_VAR"];
|
|
8324
|
+
if (entry.command && typeof proxyUrl === "string" && typeof tokenVar === "string") {
|
|
8325
|
+
const url = sub(proxyUrl);
|
|
8326
|
+
const bearer = sub(`\${${tokenVar}}`);
|
|
8327
|
+
return { url, headers: { Authorization: `Bearer ${bearer}` }, unresolved: [...unresolved] };
|
|
8328
|
+
}
|
|
8285
8329
|
return null;
|
|
8286
8330
|
} catch {
|
|
8287
8331
|
return null;
|
|
@@ -9111,4 +9155,4 @@ export {
|
|
|
9111
9155
|
managerInstallSystemUnitCommand,
|
|
9112
9156
|
managerUninstallSystemUnitCommand
|
|
9113
9157
|
};
|
|
9114
|
-
//# sourceMappingURL=chunk-
|
|
9158
|
+
//# sourceMappingURL=chunk-2K6DIZXU.js.map
|