@integrity-labs/agt-cli 0.28.990 → 0.28.992
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 +5 -5
- package/dist/{chunk-TGCA3LTI.js → chunk-C72SNMP6.js} +26 -5
- package/dist/chunk-C72SNMP6.js.map +1 -0
- package/dist/{chunk-6KYXH6ZZ.js → chunk-NF7LESJA.js} +73 -6
- package/dist/chunk-NF7LESJA.js.map +1 -0
- package/dist/{chunk-P7B5IRH5.js → chunk-PNQCXCEY.js} +19 -8
- package/dist/chunk-PNQCXCEY.js.map +1 -0
- package/dist/{claude-pair-runtime-GQM26I3M.js → claude-pair-runtime-EVAYZI57.js} +2 -2
- package/dist/lib/manager-worker.js +33 -15
- package/dist/lib/manager-worker.js.map +1 -1
- package/dist/mcp/direct-chat-channel.js +15 -1
- package/dist/mcp/index.js +15 -1
- package/dist/mcp/origami.js +15 -1
- package/dist/mcp/remote-oauth-proxy.js +120 -29
- package/dist/mcp/slack-channel.js +15 -1
- package/dist/mcp/telegram-channel.js +15 -1
- package/dist/{persistent-session-PYYD53GZ.js → persistent-session-HBUVJYYR.js} +5 -3
- package/dist/{responsiveness-probe-JENZOOKG.js → responsiveness-probe-AIBA25OP.js} +3 -3
- package/dist/{session-auth-dead-BGXRQB27.js → session-auth-dead-XTMVOHUX.js} +2 -2
- package/package.json +1 -1
- package/dist/chunk-6KYXH6ZZ.js.map +0 -1
- package/dist/chunk-P7B5IRH5.js.map +0 -1
- package/dist/chunk-TGCA3LTI.js.map +0 -1
- /package/dist/{claude-pair-runtime-GQM26I3M.js.map → claude-pair-runtime-EVAYZI57.js.map} +0 -0
- /package/dist/{persistent-session-PYYD53GZ.js.map → persistent-session-HBUVJYYR.js.map} +0 -0
- /package/dist/{responsiveness-probe-JENZOOKG.js.map → responsiveness-probe-AIBA25OP.js.map} +0 -0
- /package/dist/{session-auth-dead-BGXRQB27.js.map → session-auth-dead-XTMVOHUX.js.map} +0 -0
|
@@ -2,11 +2,13 @@ import {
|
|
|
2
2
|
INTEGRATION_REGISTRY,
|
|
3
3
|
OAUTH_PROVIDERS,
|
|
4
4
|
PLATFORM_STORAGE_RULE,
|
|
5
|
+
REMOTE_MCP_PROXY_ENV,
|
|
5
6
|
SECRET_PATTERNS,
|
|
6
7
|
claudeModelAlias,
|
|
7
8
|
containerMemoryForAgentClass,
|
|
8
9
|
encodeClaudeProjectPath,
|
|
9
10
|
getOrCreateDailySession,
|
|
11
|
+
isAutoTier,
|
|
10
12
|
isClaudeFastMode,
|
|
11
13
|
isDefaultRemoteMcpConnection,
|
|
12
14
|
isDeprecatedFramework,
|
|
@@ -20,7 +22,7 @@ import {
|
|
|
20
22
|
rotateDailySession,
|
|
21
23
|
sessionFileExists,
|
|
22
24
|
todayLocalIso
|
|
23
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-C72SNMP6.js";
|
|
24
26
|
import {
|
|
25
27
|
classifyUnanswerablePane,
|
|
26
28
|
findUsageLimitResetHint,
|
|
@@ -1017,7 +1019,19 @@ function extractHeaderVarName(value) {
|
|
|
1017
1019
|
const m = /^\$\{([A-Za-z_][A-Za-z0-9_]*)\}$/.exec(value.trim());
|
|
1018
1020
|
return m ? m[1] : null;
|
|
1019
1021
|
}
|
|
1020
|
-
function
|
|
1022
|
+
function hasGatedTool(tiers) {
|
|
1023
|
+
if (!tiers)
|
|
1024
|
+
return false;
|
|
1025
|
+
if (Object.keys(tiers).length === 0)
|
|
1026
|
+
return true;
|
|
1027
|
+
return Object.values(tiers).some((tier) => !isAutoTier(tier));
|
|
1028
|
+
}
|
|
1029
|
+
function toolTiersEnv(tiers) {
|
|
1030
|
+
if (!tiers)
|
|
1031
|
+
return {};
|
|
1032
|
+
return { [REMOTE_MCP_PROXY_ENV.toolTiers]: JSON.stringify(tiers) };
|
|
1033
|
+
}
|
|
1034
|
+
function buildLiveHeaderRemoteMcpProxyEntry(definitionId, dbSpec, paths, connectionKey, toolTiers) {
|
|
1021
1035
|
const spec = dbSpec ?? INTEGRATION_REGISTRY.find((d) => d.id === definitionId)?.remoteMcp;
|
|
1022
1036
|
if (!spec?.liveHeaderRefresh)
|
|
1023
1037
|
return null;
|
|
@@ -1041,11 +1055,15 @@ function buildLiveHeaderRemoteMcpProxyEntry(definitionId, dbSpec, paths, connect
|
|
|
1041
1055
|
AGT_REMOTE_MCP_TOKEN_VAR: credentialEnvVar(definitionId, spec.auth.credential_ref, connectionKey),
|
|
1042
1056
|
AGT_REMOTE_MCP_AUTH_HEADER: spec.auth.header_name,
|
|
1043
1057
|
AGT_REMOTE_MCP_LABEL: remoteMcpConnectionLabel(definitionId, connectionKey),
|
|
1044
|
-
...extraPairs.length > 0 ? { AGT_REMOTE_MCP_EXTRA_HEADERS: extraPairs.join(",") } : {}
|
|
1058
|
+
...extraPairs.length > 0 ? { AGT_REMOTE_MCP_EXTRA_HEADERS: extraPairs.join(",") } : {},
|
|
1059
|
+
// ENG-10614: the catalogued HITL floors. anchor-browser reaches the proxy
|
|
1060
|
+
// via this branch, so this is where its one gated tool
|
|
1061
|
+
// (`anchor_network_requests`, write_high_risk) starts being enforced.
|
|
1062
|
+
...toolTiersEnv(toolTiers)
|
|
1045
1063
|
}
|
|
1046
1064
|
};
|
|
1047
1065
|
}
|
|
1048
|
-
function buildOAuthRemoteMcpProxyEntry(definitionId, paths, connectionKey) {
|
|
1066
|
+
function buildOAuthRemoteMcpProxyEntry(definitionId, paths, connectionKey, toolTiers) {
|
|
1049
1067
|
const def = INTEGRATION_REGISTRY.find((d) => d.id === definitionId);
|
|
1050
1068
|
if (def?.remoteMcp)
|
|
1051
1069
|
return null;
|
|
@@ -1073,7 +1091,50 @@ function buildOAuthRemoteMcpProxyEntry(definitionId, paths, connectionKey) {
|
|
|
1073
1091
|
// might have picked. Omitted when the provider declares none, leaving the
|
|
1074
1092
|
// proxy's argument checking entirely off.
|
|
1075
1093
|
...provider.argRejects && provider.argRejects.length > 0 ? { AGT_REMOTE_MCP_ARG_REJECTS: JSON.stringify(provider.argRejects) } : {},
|
|
1076
|
-
...provider.preEnableToolsets && provider.preEnableToolsets.length > 0 ? { AGT_REMOTE_MCP_PREENABLE_TOOLSETS: provider.preEnableToolsets.join(",") } : {}
|
|
1094
|
+
...provider.preEnableToolsets && provider.preEnableToolsets.length > 0 ? { AGT_REMOTE_MCP_PREENABLE_TOOLSETS: provider.preEnableToolsets.join(",") } : {},
|
|
1095
|
+
// ENG-10614: catalogued HITL floors, orthogonal to the allowlist above.
|
|
1096
|
+
// The allowlist answers "may this agent see the tool at all"; this answers
|
|
1097
|
+
// "may it run without a human". A tool can be allowlisted and still gated.
|
|
1098
|
+
...toolTiersEnv(toolTiers)
|
|
1099
|
+
}
|
|
1100
|
+
};
|
|
1101
|
+
}
|
|
1102
|
+
function buildApiKeyRemoteMcpProxyEntry(definitionId, dbSpec, paths, connectionKey, toolTiers) {
|
|
1103
|
+
if (!hasGatedTool(toolTiers))
|
|
1104
|
+
return null;
|
|
1105
|
+
const spec = dbSpec ?? INTEGRATION_REGISTRY.find((d) => d.id === definitionId)?.remoteMcp;
|
|
1106
|
+
if (!spec)
|
|
1107
|
+
return null;
|
|
1108
|
+
if (spec.liveHeaderRefresh)
|
|
1109
|
+
return null;
|
|
1110
|
+
if (!spec.auth?.credential_ref)
|
|
1111
|
+
return null;
|
|
1112
|
+
assertSafeRemoteMcpUrl(spec.url, definitionId);
|
|
1113
|
+
const tokenVar = credentialEnvVar(definitionId, spec.auth.credential_ref, connectionKey);
|
|
1114
|
+
const scheme = spec.auth.scheme ?? "bearer";
|
|
1115
|
+
if (scheme !== "bearer" && scheme !== "header")
|
|
1116
|
+
return null;
|
|
1117
|
+
if (scheme === "header" && !spec.auth.header_name)
|
|
1118
|
+
return null;
|
|
1119
|
+
const extraPairs = [];
|
|
1120
|
+
for (const [header, value] of Object.entries(spec.headers ?? {})) {
|
|
1121
|
+
const varName = extractHeaderVarName(value);
|
|
1122
|
+
if (!varName) {
|
|
1123
|
+
throw new Error(`remoteMcp for '${definitionId}' declares a literal header '${header}' and also has a gated tool, which the tier-gating proxy cannot render (extra headers must be '\${VAR}' references). Give the header a '\${VAR}' value, or the integration would have to run un-gated.`);
|
|
1124
|
+
}
|
|
1125
|
+
extraPairs.push(`${header}:${remoteMcpConnectionScopedEnvVar(definitionId, varName, connectionKey)}`);
|
|
1126
|
+
}
|
|
1127
|
+
return {
|
|
1128
|
+
command: "node",
|
|
1129
|
+
args: [paths.proxyPath],
|
|
1130
|
+
env: {
|
|
1131
|
+
AGT_REMOTE_MCP_URL: spec.url,
|
|
1132
|
+
AGT_REMOTE_MCP_TOKEN_FILE: paths.tokenFile,
|
|
1133
|
+
AGT_REMOTE_MCP_TOKEN_VAR: tokenVar,
|
|
1134
|
+
AGT_REMOTE_MCP_LABEL: remoteMcpConnectionLabel(definitionId, connectionKey),
|
|
1135
|
+
...scheme === "header" && spec.auth.header_name ? { AGT_REMOTE_MCP_AUTH_HEADER: spec.auth.header_name } : {},
|
|
1136
|
+
...extraPairs.length > 0 ? { AGT_REMOTE_MCP_EXTRA_HEADERS: extraPairs.join(",") } : {},
|
|
1137
|
+
...toolTiersEnv(toolTiers)
|
|
1077
1138
|
}
|
|
1078
1139
|
};
|
|
1079
1140
|
}
|
|
@@ -3781,6 +3842,7 @@ var CLAUDE_PER_AGENT_DIRS = [
|
|
|
3781
3842
|
// per-session profiling reports
|
|
3782
3843
|
"bridge-spawn"
|
|
3783
3844
|
];
|
|
3845
|
+
var CLAUDE_MANAGED_SETTINGS_DIR = process.platform === "darwin" ? "/Library/Application Support/ClaudeCode" : "/etc/claude-code";
|
|
3784
3846
|
var CLAUDE_NULLED_FILES = ["history.jsonl"];
|
|
3785
3847
|
var CLAUDE_HOST_WIDE = [
|
|
3786
3848
|
// Account and auth: one login per host, refreshed in place.
|
|
@@ -3861,10 +3923,13 @@ function buildDockerRunCommand(args) {
|
|
|
3861
3923
|
const claudeProjects = join7(claudeHome, "projects");
|
|
3862
3924
|
const transcriptMask = join7(claudeProjects, `${TRANSCRIPT_MASK_DIR_PREFIX}${agentId}`);
|
|
3863
3925
|
const ownTranscripts = join7(claudeProjects, encodeClaudeProjectPath(projectDir));
|
|
3926
|
+
const managedSettingsDir = CLAUDE_MANAGED_SETTINGS_DIR;
|
|
3864
3927
|
const mounts = [
|
|
3865
3928
|
`-v ${q(`${agentDir2}:${agentDir2}`)}`,
|
|
3866
3929
|
`-v ${q(`${agentIdDir}:${agentIdDir}`)}`,
|
|
3867
3930
|
`-v ${q(`${mcpDir}:${mcpDir}:ro`)}`,
|
|
3931
|
+
// ENG-10806: see the block above - without this, inbound is silently dead.
|
|
3932
|
+
`-v ${q(`${managedSettingsDir}:${managedSettingsDir}:ro`)}`,
|
|
3868
3933
|
`-v ${q(`${claudeHome}:${claudeHome}`)}`,
|
|
3869
3934
|
`-v ${q(`${transcriptMask}:${claudeProjects}`)}`,
|
|
3870
3935
|
`-v ${q(`${ownTranscripts}:${ownTranscripts}`)}`,
|
|
@@ -5461,6 +5526,7 @@ export {
|
|
|
5461
5526
|
buildRemoteMcpEntry,
|
|
5462
5527
|
buildLiveHeaderRemoteMcpProxyEntry,
|
|
5463
5528
|
buildOAuthRemoteMcpProxyEntry,
|
|
5529
|
+
buildApiKeyRemoteMcpProxyEntry,
|
|
5464
5530
|
buildNativeMcpEntry,
|
|
5465
5531
|
shellQuote,
|
|
5466
5532
|
CHANNEL_SECRET_ENV_KEYS,
|
|
@@ -5526,6 +5592,7 @@ export {
|
|
|
5526
5592
|
restartEgressSidecar,
|
|
5527
5593
|
TRANSCRIPT_MASK_DIR_PREFIX,
|
|
5528
5594
|
CLAUDE_PER_AGENT_DIRS,
|
|
5595
|
+
CLAUDE_MANAGED_SETTINGS_DIR,
|
|
5529
5596
|
CLAUDE_NULLED_FILES,
|
|
5530
5597
|
CLAUDE_HOST_WIDE,
|
|
5531
5598
|
claudeStateDirFor,
|
|
@@ -5575,4 +5642,4 @@ export {
|
|
|
5575
5642
|
stopAllSessionsAndWait,
|
|
5576
5643
|
getProjectDir
|
|
5577
5644
|
};
|
|
5578
|
-
//# sourceMappingURL=chunk-
|
|
5645
|
+
//# sourceMappingURL=chunk-NF7LESJA.js.map
|