@integrity-labs/agt-cli 0.28.1252 → 0.28.1254
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/{api-client-6A36YH3M.js → api-client-EW7NBMWI.js} +3 -3
- package/dist/bin/agt.js +7 -7
- package/dist/{chunk-XTFVVZIR.js → chunk-AZOT5URF.js} +2 -2
- package/dist/{chunk-RUKGOBVA.js → chunk-EWD3K6YD.js} +61 -9
- package/dist/{chunk-RUKGOBVA.js.map → chunk-EWD3K6YD.js.map} +1 -1
- package/dist/{chunk-5ZNYCNMI.js → chunk-FD3GWWVL.js} +3 -3
- package/dist/{chunk-S3DUSCWR.js → chunk-SEXB6LTM.js} +194 -9
- package/dist/chunk-SEXB6LTM.js.map +1 -0
- package/dist/{chunk-4VOQ6D7X.js → chunk-ZDON4IXL.js} +2 -2
- package/dist/{chunk-3HRBU4H6.js → chunk-ZKLOPCWS.js} +20 -9
- package/dist/{chunk-3HRBU4H6.js.map → chunk-ZKLOPCWS.js.map} +1 -1
- package/dist/{claude-code-updater-WSQTK6TQ.js → claude-code-updater-CHEL6LOF.js} +3 -3
- package/dist/{claude-pair-runtime-WWF5BCK3.js → claude-pair-runtime-AGJH54AR.js} +3 -3
- package/dist/lib/manager-worker.js +50 -33
- package/dist/lib/manager-worker.js.map +1 -1
- package/dist/mcp/direct-chat-channel.js +54 -8
- package/dist/mcp/index.js +55 -9
- package/dist/mcp/origami.js +54 -8
- package/dist/mcp/remote-oauth-proxy.js +142 -5
- package/dist/mcp/slack-channel.js +54 -8
- package/dist/mcp/telegram-channel.js +54 -8
- package/dist/{persistent-session-HS33PGZZ.js → persistent-session-HQPQPNPK.js} +4 -4
- package/dist/{responsiveness-probe-32AWSVSL.js → responsiveness-probe-6GNSPLD2.js} +4 -4
- package/dist/{session-auth-dead-2L2NLMMB.js → session-auth-dead-4Z24MU6C.js} +3 -3
- package/package.json +1 -1
- package/dist/chunk-S3DUSCWR.js.map +0 -1
- /package/dist/{api-client-6A36YH3M.js.map → api-client-EW7NBMWI.js.map} +0 -0
- /package/dist/{chunk-XTFVVZIR.js.map → chunk-AZOT5URF.js.map} +0 -0
- /package/dist/{chunk-5ZNYCNMI.js.map → chunk-FD3GWWVL.js.map} +0 -0
- /package/dist/{chunk-4VOQ6D7X.js.map → chunk-ZDON4IXL.js.map} +0 -0
- /package/dist/{claude-code-updater-WSQTK6TQ.js.map → claude-code-updater-CHEL6LOF.js.map} +0 -0
- /package/dist/{claude-pair-runtime-WWF5BCK3.js.map → claude-pair-runtime-AGJH54AR.js.map} +0 -0
- /package/dist/{persistent-session-HS33PGZZ.js.map → persistent-session-HQPQPNPK.js.map} +0 -0
- /package/dist/{responsiveness-probe-32AWSVSL.js.map → responsiveness-probe-6GNSPLD2.js.map} +0 -0
- /package/dist/{session-auth-dead-2L2NLMMB.js.map → session-auth-dead-4Z24MU6C.js.map} +0 -0
|
@@ -42667,7 +42667,12 @@ var REMOTE_MCP_PROXY_ENV = {
|
|
|
42667
42667
|
// Deliberately NOT in REMOTE_MCP_AUTH_ENV_KEYS, for the same reason as
|
|
42668
42668
|
// `argRejects`: it shapes WHICH calls we forward, not what an outbound request
|
|
42669
42669
|
// looks like, so the connectivity probe has nothing to reconstruct from it.
|
|
42670
|
-
toolTiers: "AGT_REMOTE_MCP_TOOL_TIERS"
|
|
42670
|
+
toolTiers: "AGT_REMOTE_MCP_TOOL_TIERS",
|
|
42671
|
+
// ENG-12046: when set, the proxy fetches its bearer from the broker at use
|
|
42672
|
+
// time for THIS integration row (uuid) instead of reading TOKEN_FILE/TOKEN_VAR,
|
|
42673
|
+
// and the token is no longer written to `.env.integrations`. Hygiene, not a
|
|
42674
|
+
// boundary: see core/integrations/remote-mcp-broker-token.ts.
|
|
42675
|
+
integrationId: "AGT_REMOTE_MCP_INTEGRATION_ID"
|
|
42671
42676
|
};
|
|
42672
42677
|
var REMOTE_MCP_AUTH_ENV_KEYS = [
|
|
42673
42678
|
REMOTE_MCP_PROXY_ENV.tokenVar,
|
|
@@ -46509,12 +46514,15 @@ var FLAG_REGISTRY = [
|
|
|
46509
46514
|
// direct-chat MCP to render them: an older agt-cli shows a notice as
|
|
46510
46515
|
// "download failed; ask the user to re-send", which sends users in circles
|
|
46511
46516
|
// (Sherlock, 13 Nov). So the flip-reach modal must count hosts by the CLI
|
|
46512
|
-
// that renders notices.
|
|
46513
|
-
//
|
|
46514
|
-
//
|
|
46515
|
-
//
|
|
46516
|
-
//
|
|
46517
|
-
|
|
46517
|
+
// that renders notices. 0.28.1252 is the first published agt-cli carrying
|
|
46518
|
+
// #7579's MCP change (tag agt-cli-0.28.1252, published from caf64c0b5; the
|
|
46519
|
+
// publish run on #7579's own merge commit 38465ce5f failed). Arm only when
|
|
46520
|
+
// the modal shows 0 stale and 0 unknown hosts. The reach count covers only
|
|
46521
|
+
// active hosts seen in the last 24h (routes/flags.ts), so also confirm no
|
|
46522
|
+
// active host older than 0.28.1252 is offline before arming the stage-wide
|
|
46523
|
+
// flip: one that reconnects later receives the armed flag on its first
|
|
46524
|
+
// heartbeat (CodeRabbit on #7588).
|
|
46525
|
+
since: "0.28.1252"
|
|
46518
46526
|
},
|
|
46519
46527
|
{
|
|
46520
46528
|
key: "platform-held-key-central-probe",
|
|
@@ -46787,7 +46795,7 @@ var FLAG_REGISTRY = [
|
|
|
46787
46795
|
},
|
|
46788
46796
|
{
|
|
46789
46797
|
key: "scheduled-task-nudge-durable",
|
|
46790
|
-
description: 'Deliver the scheduled-task "work this card" nudge over the durable direct-chat notice rail instead of unverified tmux send-keys (ENG-8068, re-landing ENG-7971). When ON, routeScheduledTaskViaKanban enqueues the nudge via POST /host/scheduled-task/notify (kind:notice, push-and-consumed by the in-session MCP with a per-card consume-time revalidation) and closes the card + run on an enqueue failure, retiring the ENG-6351 orphaned-card gap where an unsubmitted keystroke left a scheduled task silently unrun. When OFF (default) the manager
|
|
46798
|
+
description: 'Deliver the scheduled-task "work this card" nudge over the durable direct-chat notice rail instead of unverified tmux send-keys (ENG-8068, re-landing ENG-7971). When ON, routeScheduledTaskViaKanban enqueues the nudge via POST /host/scheduled-task/notify (kind:notice, push-and-consumed by the in-session MCP with a per-card consume-time revalidation) and closes the card + run on an enqueue failure, retiring the ENG-6351 orphaned-card gap where an unsubmitted keystroke left a scheduled task silently unrun. When OFF (default) the manager delivers the nudge by tmux send-keys. ONE EXCEPTION, whatever this flag says (ENG-8006): when send-keys reaches nothing because the session is down or restarting, the nudge is still queued on the durable rail for the next session, and if that enqueue fails the card is closed as failed. So OFF is a partial kill switch: it takes live sessions off the rail, but not firings whose session is down. ENG-7971 was reverted once because the durable rail 500d on a session_id bug (fixed in ENG-8061). During a rail incident, OFF limits the blast radius to down-session firings, and those show up as cards closed failed with "scheduled-task nudge undeliverable". Resolved host-side by the manager via hostFlagStore().getBoolean (the manager evaluates the decision itself, so no spawn-env materialization is needed). Ships dark.',
|
|
46791
46799
|
flagType: "boolean",
|
|
46792
46800
|
// Declared safe value is `false`: the current, reverted-to send-keys delivery. Turning
|
|
46793
46801
|
// it ON activates the durable rail per org/host once operators are confident. `false`
|
|
@@ -47105,6 +47113,32 @@ var FLAG_REGISTRY = [
|
|
|
47105
47113
|
// `sensitive: true`, plus the two gates spelled out in the description.
|
|
47106
47114
|
since: "0.28.1015"
|
|
47107
47115
|
},
|
|
47116
|
+
{
|
|
47117
|
+
key: "remote-mcp-oauth-broker-credentials",
|
|
47118
|
+
description: "Deliver the bearer of every OAuth remote MCP served through remote-oauth-proxy (OAUTH_PROVIDERS entries with an mcpUrl: granola, brand-ninja, kajabi, otter, plaud, datadog-ap1/ap2 today) through the broker credential endpoint at USE time, instead of materializing it into `.env.integrations` (ENG-12046). Mechanically the sibling of `xero-broker-credentials`. ON: POST /host/agent-integrations strips `access_token`, `refresh_token` and `token_expires_at` from those rows and marks them credential_delivery=broker, so `<DEF>_ACCESS_TOKEN` is no longer written to `.env.integrations` and so is no longer in the agent process env (the session wrapper `source`s that file with `set -a`). The claudecode adapter then emits AGT_REMOTE_MCP_INTEGRATION_ID instead of a token file/var, and the proxy fetches the bearer per use from POST /host/agent-integrations/<uuid>/credential with the agent's own host credentials (memory only, fail closed, no fallback). OFF (default): byte-for-byte today's behaviour. THIS IS HYGIENE, NOT A BOUNDARY: an agent that calls the same fetch can still obtain the token. The binding control for broad-scope providers (Datadog mcp_all) remains a read-only provider user; the real boundary is ENG-12047 (host-side proxy). SINCE IS A PLACEHOLDER: `since` (0.29.0) is an unreachable placeholder, not a verified threshold. Before enabling, replace it with the first published agt-cli whose remote-oauth-proxy carries broker mode (bisected from the tarballs), or the reach estimate means nothing. FLIP GATE: an under-`since` host honours the marker (it skips the token write, ENG-8344) but still emits a token-file proxy entry, so its remote OAuth MCPs answer \"no current access token\" for every call: an outage of those integrations, not a leak. Zero hosts carrying these integrations below `since` per hosts.agt_version before flipping, counting NULL as unconverged. agt_version names the bundle on disk, not the running proxy: a session started before the update keeps its pre-broker proxy until it restarts, so also confirm every affected session has respawned. HARD GATE: Do not enable, for any provider, until ENG-12053 is merged AND deployed to every API instance serving the credential route (a merge alone is not enough: an older route ignores on_missing_expiry: 'serve'), and a fetch with it on a no-expiry row is verified not to refresh. Reason: a provider whose refresh response omits expires_in makes oauth-refresh drop token_expires_at, the credential route treats that as \"refresh now\", and the row then refreshes about every 60s; the next poll returns the row to env delivery, but that does NOT respawn the running session, so its proxy keeps refreshing about every 60s until some unrelated restart (provider rate limits, token churn, possible lockouts). None of the in-scope providers (granola, brand-ninja, kajabi, otter, plaud, datadog-ap1, datadog-ap2) is verified on expires_in, and the flag covers all of them at once, so no per-provider exception exists. claude-code agents only: opencode has no broker path and keeps env delivery. See docs/runbooks/remote-mcp-oauth-broker-credentials-rollout.md.",
|
|
47119
|
+
flagType: "boolean",
|
|
47120
|
+
// `false` = today's env delivery. A wrongly-ON flip on an unconverged host is
|
|
47121
|
+
// an outage of the remote OAuth MCPs (see the description), so the ON path is
|
|
47122
|
+
// the one with a reach precondition.
|
|
47123
|
+
defaultValue: false,
|
|
47124
|
+
// Changes how every remote-OAuth MCP on the scope authenticates. A
|
|
47125
|
+
// deliberate, confirmed action (ADR-0022 §4).
|
|
47126
|
+
sensitive: true,
|
|
47127
|
+
// ADR-0120: an org owner/admin must not be able to switch this on for their
|
|
47128
|
+
// own org before its prerequisites (ENG-12053 deployed, hosts and sessions
|
|
47129
|
+
// converged) are met. Nothing in code enforces those gates, and an early
|
|
47130
|
+
// enable is an outage of that org's remote OAuth MCPs (CodeRabbit on #7568).
|
|
47131
|
+
platformAdminOnly: true,
|
|
47132
|
+
// PLACEHOLDER, like `github-broker-credentials` shipped with. Replace with the
|
|
47133
|
+
// first published agt-cli whose remote-oauth-proxy carries broker mode
|
|
47134
|
+
// (grep the bundle for AGT_REMOTE_MCP_INTEGRATION_ID), bisected from the
|
|
47135
|
+
// tarballs as `xero-broker-credentials` did. This version names the bundle on
|
|
47136
|
+
// disk. remote-oauth-proxy.js is not in RESTARTABLE_CHANNEL_FILES, so a
|
|
47137
|
+
// session started before the update keeps its older proxy until it restarts:
|
|
47138
|
+
// a host at this version can still run a pre-broker proxy. Advisory only: it
|
|
47139
|
+
// feeds computeFlagReach, it does not block a flip.
|
|
47140
|
+
since: "0.29.0"
|
|
47141
|
+
},
|
|
47108
47142
|
{
|
|
47109
47143
|
key: "help-kb-auto-grant",
|
|
47110
47144
|
description: "Auto-grant the `augmented-help-kb` integration at ORG scope when an organization is provisioned (ENG-8542), so every agent in that org gets product-doc search without a per-agent operator action. One organization_integrations row reaches every agent in the org: POST /host/agent-integrations merges org -> team -> agent and buildMcpJson's predicate reads that merged set with no scope filter. ON: the two org-provisioning call sites write the row (status=active, created_by=the org owner). OFF (default): they write nothing - byte-for-byte today's behaviour. STAGED ROLLOUT IS THE POINT. ENG-8332 argues against widening distribution of the help KB until two things close, because distributing a corpus with wrong articles \"converts one agent's wrong answer into everyone's\": (1) a live 200 from GET /host/kb/search as the anon role has still never been observed - ENG-7260 was closed on remediation evidence, not on a live call, and the deploy seed log is SERVICE-ROLE evidence that says nothing about the anon grant; (2) the `site-structure` article is unverified against the current IA. Turning this on for ONE org and watching that org's help-kb connectivity-probe verdicts (ENG-8332 added a real mcp_stdio probe that calls search_knowledge_base) is the cheap positive control for (1) - an ENG-7260-class 500 then reports as `down` per agent instead of as silence. Widen only after it comes back healthy. REVOKING IS DELETING THE ROW, not flipping this off: the flag gates GRANTING, so an already-granted org keeps its row when the flag goes off. Evaluated API-side only, per org, inside grantHelpKbToOrg; no host-side envVar and deliberately no sst.config.ts entry (a literal default there would pin it - ENG-8303).",
|
|
@@ -47374,6 +47408,18 @@ var FLAG_REGISTRY = [
|
|
|
47374
47408
|
// honours the filter is unproven, so an org must not switch it on for itself.
|
|
47375
47409
|
platformAdminOnly: true
|
|
47376
47410
|
},
|
|
47411
|
+
{
|
|
47412
|
+
key: "agent-email-inbox",
|
|
47413
|
+
description: "ENG-12021 - lets an owner/admin give one agent its own email address on the platform's agent mail domain, provisioned as a Resend Inbox, which the agent can list, search and read. OFF (default) = the provisioning route refuses and no inbox can be created. This flag is ROLLOUT CONTROL, NOT the revocation: it decides whether an org may provision, and turning it off does NOT take the tools away from an agent that already has an address - `agent_email_inboxes.status` does that, and is what to reach for in an incident. Nor is it the only gate, and the two secrets do NOT gate the same things: AGENT_INBOX_RESEND_API_KEY gates EVERYTHING (unset = provisioning refuses AND every tool call on an existing inbox answers not_configured), while AGENT_INBOX_DOMAIN is read only when MINTING an address - so clearing the domain stops new inboxes and leaves an agent that already has one still reading its mail (NOT replying - this slice ships no send or reply tool at all; that is PR B). Do not reach for either as a kill switch; the status column is the one. A per-org cap refuses provisioning past its limit regardless of this flag. BEFORE ARMING THIS FOR AN ORG, verify cross-inbox thread isolation against a real key: the inbox segment of every Resend path is server-derived from the agent's own row, but thread_id is an AGENT-SUPPLIED argument, and Resend documents no error for a thread that belongs to a different inbox. Their thread response carries no inbox field either, so this cannot be re-checked on our side after the fact - it is a vendor behaviour that has to be measured once (request one inbox's thread id under another inbox and confirm a 404), not an invariant this code can enforce. Platform-admin-only AND sensitive because each inbox is a RECURRING monthly cost with no per-unit billing primitive behind it (ENG-8720) - an org must not be able to switch on a subscription for itself, and the cap is the only thing metering it.",
|
|
47414
|
+
flagType: "boolean",
|
|
47415
|
+
defaultValue: false,
|
|
47416
|
+
sensitive: true,
|
|
47417
|
+
platformAdminOnly: true
|
|
47418
|
+
// Deliberately NO envVar. The reader is the API, server-side, which can call the
|
|
47419
|
+
// flag evaluator directly - so there is no host-side bash hook needing a
|
|
47420
|
+
// materialised value, and declaring one would only create a literal for the
|
|
47421
|
+
// ENG-8303 sst-pin guard to catch.
|
|
47422
|
+
},
|
|
47377
47423
|
{
|
|
47378
47424
|
key: "premium-gateway-inference",
|
|
47379
47425
|
description: "ENG-10865 / ADR-0117 - RESERVED, and INERT until the runtime wiring lands. Turning it ON today mints nothing and delivers nothing: no caller invokes the mint client yet, resolveBindingCredential is unchanged, and a gateway binding still resolves `blocked-gateway` either way. The flag is registered ahead of that wiring on purpose - see below - so an operator must not read it as a working switch. ONCE WIRED, ON will mean the API mints a budgeted key per agent and the host spawns against the gateway, so that a policy whose ACTIVE binding is transport=gateway with credential_owner=platform resolves `applied`; OFF will remain exactly the fleet behaviour before this flag existed. Registered early and kept deliberately SEPARATE from holding AI_GATEWAY_MINT_TOKEN, because possessing the minting credential is not clearance to spend platform money on a customer agent - the ENG-8247 shape. The secret is set in prod BEFORE ADR-0117 is accepted, before metering exists (ENG-10867) and before the premium opt-in is registered (ENG-10868), so presence of the credential must not be the gate. Boolean.",
|
package/dist/mcp/index.js
CHANGED
|
@@ -28763,7 +28763,12 @@ var REMOTE_MCP_PROXY_ENV = {
|
|
|
28763
28763
|
// Deliberately NOT in REMOTE_MCP_AUTH_ENV_KEYS, for the same reason as
|
|
28764
28764
|
// `argRejects`: it shapes WHICH calls we forward, not what an outbound request
|
|
28765
28765
|
// looks like, so the connectivity probe has nothing to reconstruct from it.
|
|
28766
|
-
toolTiers: "AGT_REMOTE_MCP_TOOL_TIERS"
|
|
28766
|
+
toolTiers: "AGT_REMOTE_MCP_TOOL_TIERS",
|
|
28767
|
+
// ENG-12046: when set, the proxy fetches its bearer from the broker at use
|
|
28768
|
+
// time for THIS integration row (uuid) instead of reading TOKEN_FILE/TOKEN_VAR,
|
|
28769
|
+
// and the token is no longer written to `.env.integrations`. Hygiene, not a
|
|
28770
|
+
// boundary: see core/integrations/remote-mcp-broker-token.ts.
|
|
28771
|
+
integrationId: "AGT_REMOTE_MCP_INTEGRATION_ID"
|
|
28767
28772
|
};
|
|
28768
28773
|
var REMOTE_MCP_AUTH_ENV_KEYS = [
|
|
28769
28774
|
REMOTE_MCP_PROXY_ENV.tokenVar,
|
|
@@ -32191,12 +32196,15 @@ var FLAG_REGISTRY = [
|
|
|
32191
32196
|
// direct-chat MCP to render them: an older agt-cli shows a notice as
|
|
32192
32197
|
// "download failed; ask the user to re-send", which sends users in circles
|
|
32193
32198
|
// (Sherlock, 13 Nov). So the flip-reach modal must count hosts by the CLI
|
|
32194
|
-
// that renders notices.
|
|
32195
|
-
//
|
|
32196
|
-
//
|
|
32197
|
-
//
|
|
32198
|
-
//
|
|
32199
|
-
|
|
32199
|
+
// that renders notices. 0.28.1252 is the first published agt-cli carrying
|
|
32200
|
+
// #7579's MCP change (tag agt-cli-0.28.1252, published from caf64c0b5; the
|
|
32201
|
+
// publish run on #7579's own merge commit 38465ce5f failed). Arm only when
|
|
32202
|
+
// the modal shows 0 stale and 0 unknown hosts. The reach count covers only
|
|
32203
|
+
// active hosts seen in the last 24h (routes/flags.ts), so also confirm no
|
|
32204
|
+
// active host older than 0.28.1252 is offline before arming the stage-wide
|
|
32205
|
+
// flip: one that reconnects later receives the armed flag on its first
|
|
32206
|
+
// heartbeat (CodeRabbit on #7588).
|
|
32207
|
+
since: "0.28.1252"
|
|
32200
32208
|
},
|
|
32201
32209
|
{
|
|
32202
32210
|
key: "platform-held-key-central-probe",
|
|
@@ -32469,7 +32477,7 @@ var FLAG_REGISTRY = [
|
|
|
32469
32477
|
},
|
|
32470
32478
|
{
|
|
32471
32479
|
key: "scheduled-task-nudge-durable",
|
|
32472
|
-
description: 'Deliver the scheduled-task "work this card" nudge over the durable direct-chat notice rail instead of unverified tmux send-keys (ENG-8068, re-landing ENG-7971). When ON, routeScheduledTaskViaKanban enqueues the nudge via POST /host/scheduled-task/notify (kind:notice, push-and-consumed by the in-session MCP with a per-card consume-time revalidation) and closes the card + run on an enqueue failure, retiring the ENG-6351 orphaned-card gap where an unsubmitted keystroke left a scheduled task silently unrun. When OFF (default) the manager
|
|
32480
|
+
description: 'Deliver the scheduled-task "work this card" nudge over the durable direct-chat notice rail instead of unverified tmux send-keys (ENG-8068, re-landing ENG-7971). When ON, routeScheduledTaskViaKanban enqueues the nudge via POST /host/scheduled-task/notify (kind:notice, push-and-consumed by the in-session MCP with a per-card consume-time revalidation) and closes the card + run on an enqueue failure, retiring the ENG-6351 orphaned-card gap where an unsubmitted keystroke left a scheduled task silently unrun. When OFF (default) the manager delivers the nudge by tmux send-keys. ONE EXCEPTION, whatever this flag says (ENG-8006): when send-keys reaches nothing because the session is down or restarting, the nudge is still queued on the durable rail for the next session, and if that enqueue fails the card is closed as failed. So OFF is a partial kill switch: it takes live sessions off the rail, but not firings whose session is down. ENG-7971 was reverted once because the durable rail 500d on a session_id bug (fixed in ENG-8061). During a rail incident, OFF limits the blast radius to down-session firings, and those show up as cards closed failed with "scheduled-task nudge undeliverable". Resolved host-side by the manager via hostFlagStore().getBoolean (the manager evaluates the decision itself, so no spawn-env materialization is needed). Ships dark.',
|
|
32473
32481
|
flagType: "boolean",
|
|
32474
32482
|
// Declared safe value is `false`: the current, reverted-to send-keys delivery. Turning
|
|
32475
32483
|
// it ON activates the durable rail per org/host once operators are confident. `false`
|
|
@@ -32787,6 +32795,32 @@ var FLAG_REGISTRY = [
|
|
|
32787
32795
|
// `sensitive: true`, plus the two gates spelled out in the description.
|
|
32788
32796
|
since: "0.28.1015"
|
|
32789
32797
|
},
|
|
32798
|
+
{
|
|
32799
|
+
key: "remote-mcp-oauth-broker-credentials",
|
|
32800
|
+
description: "Deliver the bearer of every OAuth remote MCP served through remote-oauth-proxy (OAUTH_PROVIDERS entries with an mcpUrl: granola, brand-ninja, kajabi, otter, plaud, datadog-ap1/ap2 today) through the broker credential endpoint at USE time, instead of materializing it into `.env.integrations` (ENG-12046). Mechanically the sibling of `xero-broker-credentials`. ON: POST /host/agent-integrations strips `access_token`, `refresh_token` and `token_expires_at` from those rows and marks them credential_delivery=broker, so `<DEF>_ACCESS_TOKEN` is no longer written to `.env.integrations` and so is no longer in the agent process env (the session wrapper `source`s that file with `set -a`). The claudecode adapter then emits AGT_REMOTE_MCP_INTEGRATION_ID instead of a token file/var, and the proxy fetches the bearer per use from POST /host/agent-integrations/<uuid>/credential with the agent's own host credentials (memory only, fail closed, no fallback). OFF (default): byte-for-byte today's behaviour. THIS IS HYGIENE, NOT A BOUNDARY: an agent that calls the same fetch can still obtain the token. The binding control for broad-scope providers (Datadog mcp_all) remains a read-only provider user; the real boundary is ENG-12047 (host-side proxy). SINCE IS A PLACEHOLDER: `since` (0.29.0) is an unreachable placeholder, not a verified threshold. Before enabling, replace it with the first published agt-cli whose remote-oauth-proxy carries broker mode (bisected from the tarballs), or the reach estimate means nothing. FLIP GATE: an under-`since` host honours the marker (it skips the token write, ENG-8344) but still emits a token-file proxy entry, so its remote OAuth MCPs answer \"no current access token\" for every call: an outage of those integrations, not a leak. Zero hosts carrying these integrations below `since` per hosts.agt_version before flipping, counting NULL as unconverged. agt_version names the bundle on disk, not the running proxy: a session started before the update keeps its pre-broker proxy until it restarts, so also confirm every affected session has respawned. HARD GATE: Do not enable, for any provider, until ENG-12053 is merged AND deployed to every API instance serving the credential route (a merge alone is not enough: an older route ignores on_missing_expiry: 'serve'), and a fetch with it on a no-expiry row is verified not to refresh. Reason: a provider whose refresh response omits expires_in makes oauth-refresh drop token_expires_at, the credential route treats that as \"refresh now\", and the row then refreshes about every 60s; the next poll returns the row to env delivery, but that does NOT respawn the running session, so its proxy keeps refreshing about every 60s until some unrelated restart (provider rate limits, token churn, possible lockouts). None of the in-scope providers (granola, brand-ninja, kajabi, otter, plaud, datadog-ap1, datadog-ap2) is verified on expires_in, and the flag covers all of them at once, so no per-provider exception exists. claude-code agents only: opencode has no broker path and keeps env delivery. See docs/runbooks/remote-mcp-oauth-broker-credentials-rollout.md.",
|
|
32801
|
+
flagType: "boolean",
|
|
32802
|
+
// `false` = today's env delivery. A wrongly-ON flip on an unconverged host is
|
|
32803
|
+
// an outage of the remote OAuth MCPs (see the description), so the ON path is
|
|
32804
|
+
// the one with a reach precondition.
|
|
32805
|
+
defaultValue: false,
|
|
32806
|
+
// Changes how every remote-OAuth MCP on the scope authenticates. A
|
|
32807
|
+
// deliberate, confirmed action (ADR-0022 §4).
|
|
32808
|
+
sensitive: true,
|
|
32809
|
+
// ADR-0120: an org owner/admin must not be able to switch this on for their
|
|
32810
|
+
// own org before its prerequisites (ENG-12053 deployed, hosts and sessions
|
|
32811
|
+
// converged) are met. Nothing in code enforces those gates, and an early
|
|
32812
|
+
// enable is an outage of that org's remote OAuth MCPs (CodeRabbit on #7568).
|
|
32813
|
+
platformAdminOnly: true,
|
|
32814
|
+
// PLACEHOLDER, like `github-broker-credentials` shipped with. Replace with the
|
|
32815
|
+
// first published agt-cli whose remote-oauth-proxy carries broker mode
|
|
32816
|
+
// (grep the bundle for AGT_REMOTE_MCP_INTEGRATION_ID), bisected from the
|
|
32817
|
+
// tarballs as `xero-broker-credentials` did. This version names the bundle on
|
|
32818
|
+
// disk. remote-oauth-proxy.js is not in RESTARTABLE_CHANNEL_FILES, so a
|
|
32819
|
+
// session started before the update keeps its older proxy until it restarts:
|
|
32820
|
+
// a host at this version can still run a pre-broker proxy. Advisory only: it
|
|
32821
|
+
// feeds computeFlagReach, it does not block a flip.
|
|
32822
|
+
since: "0.29.0"
|
|
32823
|
+
},
|
|
32790
32824
|
{
|
|
32791
32825
|
key: "help-kb-auto-grant",
|
|
32792
32826
|
description: "Auto-grant the `augmented-help-kb` integration at ORG scope when an organization is provisioned (ENG-8542), so every agent in that org gets product-doc search without a per-agent operator action. One organization_integrations row reaches every agent in the org: POST /host/agent-integrations merges org -> team -> agent and buildMcpJson's predicate reads that merged set with no scope filter. ON: the two org-provisioning call sites write the row (status=active, created_by=the org owner). OFF (default): they write nothing - byte-for-byte today's behaviour. STAGED ROLLOUT IS THE POINT. ENG-8332 argues against widening distribution of the help KB until two things close, because distributing a corpus with wrong articles \"converts one agent's wrong answer into everyone's\": (1) a live 200 from GET /host/kb/search as the anon role has still never been observed - ENG-7260 was closed on remediation evidence, not on a live call, and the deploy seed log is SERVICE-ROLE evidence that says nothing about the anon grant; (2) the `site-structure` article is unverified against the current IA. Turning this on for ONE org and watching that org's help-kb connectivity-probe verdicts (ENG-8332 added a real mcp_stdio probe that calls search_knowledge_base) is the cheap positive control for (1) - an ENG-7260-class 500 then reports as `down` per agent instead of as silence. Widen only after it comes back healthy. REVOKING IS DELETING THE ROW, not flipping this off: the flag gates GRANTING, so an already-granted org keeps its row when the flag goes off. Evaluated API-side only, per org, inside grantHelpKbToOrg; no host-side envVar and deliberately no sst.config.ts entry (a literal default there would pin it - ENG-8303).",
|
|
@@ -33056,6 +33090,18 @@ var FLAG_REGISTRY = [
|
|
|
33056
33090
|
// honours the filter is unproven, so an org must not switch it on for itself.
|
|
33057
33091
|
platformAdminOnly: true
|
|
33058
33092
|
},
|
|
33093
|
+
{
|
|
33094
|
+
key: "agent-email-inbox",
|
|
33095
|
+
description: "ENG-12021 - lets an owner/admin give one agent its own email address on the platform's agent mail domain, provisioned as a Resend Inbox, which the agent can list, search and read. OFF (default) = the provisioning route refuses and no inbox can be created. This flag is ROLLOUT CONTROL, NOT the revocation: it decides whether an org may provision, and turning it off does NOT take the tools away from an agent that already has an address - `agent_email_inboxes.status` does that, and is what to reach for in an incident. Nor is it the only gate, and the two secrets do NOT gate the same things: AGENT_INBOX_RESEND_API_KEY gates EVERYTHING (unset = provisioning refuses AND every tool call on an existing inbox answers not_configured), while AGENT_INBOX_DOMAIN is read only when MINTING an address - so clearing the domain stops new inboxes and leaves an agent that already has one still reading its mail (NOT replying - this slice ships no send or reply tool at all; that is PR B). Do not reach for either as a kill switch; the status column is the one. A per-org cap refuses provisioning past its limit regardless of this flag. BEFORE ARMING THIS FOR AN ORG, verify cross-inbox thread isolation against a real key: the inbox segment of every Resend path is server-derived from the agent's own row, but thread_id is an AGENT-SUPPLIED argument, and Resend documents no error for a thread that belongs to a different inbox. Their thread response carries no inbox field either, so this cannot be re-checked on our side after the fact - it is a vendor behaviour that has to be measured once (request one inbox's thread id under another inbox and confirm a 404), not an invariant this code can enforce. Platform-admin-only AND sensitive because each inbox is a RECURRING monthly cost with no per-unit billing primitive behind it (ENG-8720) - an org must not be able to switch on a subscription for itself, and the cap is the only thing metering it.",
|
|
33096
|
+
flagType: "boolean",
|
|
33097
|
+
defaultValue: false,
|
|
33098
|
+
sensitive: true,
|
|
33099
|
+
platformAdminOnly: true
|
|
33100
|
+
// Deliberately NO envVar. The reader is the API, server-side, which can call the
|
|
33101
|
+
// flag evaluator directly - so there is no host-side bash hook needing a
|
|
33102
|
+
// materialised value, and declaring one would only create a literal for the
|
|
33103
|
+
// ENG-8303 sst-pin guard to catch.
|
|
33104
|
+
},
|
|
33059
33105
|
{
|
|
33060
33106
|
key: "premium-gateway-inference",
|
|
33061
33107
|
description: "ENG-10865 / ADR-0117 - RESERVED, and INERT until the runtime wiring lands. Turning it ON today mints nothing and delivers nothing: no caller invokes the mint client yet, resolveBindingCredential is unchanged, and a gateway binding still resolves `blocked-gateway` either way. The flag is registered ahead of that wiring on purpose - see below - so an operator must not read it as a working switch. ONCE WIRED, ON will mean the API mints a budgeted key per agent and the host spawns against the gateway, so that a policy whose ACTIVE binding is transport=gateway with credential_owner=platform resolves `applied`; OFF will remain exactly the fleet behaviour before this flag existed. Registered early and kept deliberately SEPARATE from holding AI_GATEWAY_MINT_TOKEN, because possessing the minting credential is not clearance to spend platform money on a customer agent - the ENG-8247 shape. The secret is set in prod BEFORE ADR-0117 is accepted, before metering exists (ENG-10867) and before the premium opt-in is registered (ENG-10868), so presence of the credential must not be the gate. Boolean.",
|
|
@@ -49920,7 +49966,7 @@ function registerApprovalTools(server2, deps) {
|
|
|
49920
49966
|
detail: external_exports.record(external_exports.unknown()).optional().describe(
|
|
49921
49967
|
"Optional structured context for the approver (display + audit only; never executed). When the action is sending an email, include email: { to, from, subject } (to: an address or a list of them; from: the mailbox it goes out from) so the approval card shows From / To / Subject. Asking again with a different detail under the same idempotency_key is a different request."
|
|
49922
49968
|
),
|
|
49923
|
-
ttl_seconds: external_exports.number().int().optional().describe("How long the request stays open before it times out (default
|
|
49969
|
+
ttl_seconds: external_exports.number().int().optional().describe("How long the request stays open before it times out, in seconds (default 14400 = 4 hours; clamped to [60, 86400]). Omit it to get the default; do not pass a shorter value unless the action genuinely goes stale sooner."),
|
|
49924
49970
|
kanban_item_id: external_exports.string().uuid().optional().describe(
|
|
49925
49971
|
'The id of YOUR kanban card this approval is about. Pass it whenever the ask belongs to a card: the platform tries to park that card as waiting on this approval, so the approver can Approve/Deny from the card itself and the answer reaches this request. The result says whether the link happened (kanban_link); if it did not, the reason is given and the card is NOT waiting on the approval. Do NOT also park the card as a "human" wait with your own Approve/Deny choices; that creates a second ask the approval never hears, and the request expires.'
|
|
49926
49972
|
)
|
package/dist/mcp/origami.js
CHANGED
|
@@ -42824,7 +42824,12 @@ var REMOTE_MCP_PROXY_ENV = {
|
|
|
42824
42824
|
// Deliberately NOT in REMOTE_MCP_AUTH_ENV_KEYS, for the same reason as
|
|
42825
42825
|
// `argRejects`: it shapes WHICH calls we forward, not what an outbound request
|
|
42826
42826
|
// looks like, so the connectivity probe has nothing to reconstruct from it.
|
|
42827
|
-
toolTiers: "AGT_REMOTE_MCP_TOOL_TIERS"
|
|
42827
|
+
toolTiers: "AGT_REMOTE_MCP_TOOL_TIERS",
|
|
42828
|
+
// ENG-12046: when set, the proxy fetches its bearer from the broker at use
|
|
42829
|
+
// time for THIS integration row (uuid) instead of reading TOKEN_FILE/TOKEN_VAR,
|
|
42830
|
+
// and the token is no longer written to `.env.integrations`. Hygiene, not a
|
|
42831
|
+
// boundary: see core/integrations/remote-mcp-broker-token.ts.
|
|
42832
|
+
integrationId: "AGT_REMOTE_MCP_INTEGRATION_ID"
|
|
42828
42833
|
};
|
|
42829
42834
|
var REMOTE_MCP_AUTH_ENV_KEYS = [
|
|
42830
42835
|
REMOTE_MCP_PROXY_ENV.tokenVar,
|
|
@@ -45993,12 +45998,15 @@ var FLAG_REGISTRY = [
|
|
|
45993
45998
|
// direct-chat MCP to render them: an older agt-cli shows a notice as
|
|
45994
45999
|
// "download failed; ask the user to re-send", which sends users in circles
|
|
45995
46000
|
// (Sherlock, 13 Nov). So the flip-reach modal must count hosts by the CLI
|
|
45996
|
-
// that renders notices.
|
|
45997
|
-
//
|
|
45998
|
-
//
|
|
45999
|
-
//
|
|
46000
|
-
//
|
|
46001
|
-
|
|
46001
|
+
// that renders notices. 0.28.1252 is the first published agt-cli carrying
|
|
46002
|
+
// #7579's MCP change (tag agt-cli-0.28.1252, published from caf64c0b5; the
|
|
46003
|
+
// publish run on #7579's own merge commit 38465ce5f failed). Arm only when
|
|
46004
|
+
// the modal shows 0 stale and 0 unknown hosts. The reach count covers only
|
|
46005
|
+
// active hosts seen in the last 24h (routes/flags.ts), so also confirm no
|
|
46006
|
+
// active host older than 0.28.1252 is offline before arming the stage-wide
|
|
46007
|
+
// flip: one that reconnects later receives the armed flag on its first
|
|
46008
|
+
// heartbeat (CodeRabbit on #7588).
|
|
46009
|
+
since: "0.28.1252"
|
|
46002
46010
|
},
|
|
46003
46011
|
{
|
|
46004
46012
|
key: "platform-held-key-central-probe",
|
|
@@ -46271,7 +46279,7 @@ var FLAG_REGISTRY = [
|
|
|
46271
46279
|
},
|
|
46272
46280
|
{
|
|
46273
46281
|
key: "scheduled-task-nudge-durable",
|
|
46274
|
-
description: 'Deliver the scheduled-task "work this card" nudge over the durable direct-chat notice rail instead of unverified tmux send-keys (ENG-8068, re-landing ENG-7971). When ON, routeScheduledTaskViaKanban enqueues the nudge via POST /host/scheduled-task/notify (kind:notice, push-and-consumed by the in-session MCP with a per-card consume-time revalidation) and closes the card + run on an enqueue failure, retiring the ENG-6351 orphaned-card gap where an unsubmitted keystroke left a scheduled task silently unrun. When OFF (default) the manager
|
|
46282
|
+
description: 'Deliver the scheduled-task "work this card" nudge over the durable direct-chat notice rail instead of unverified tmux send-keys (ENG-8068, re-landing ENG-7971). When ON, routeScheduledTaskViaKanban enqueues the nudge via POST /host/scheduled-task/notify (kind:notice, push-and-consumed by the in-session MCP with a per-card consume-time revalidation) and closes the card + run on an enqueue failure, retiring the ENG-6351 orphaned-card gap where an unsubmitted keystroke left a scheduled task silently unrun. When OFF (default) the manager delivers the nudge by tmux send-keys. ONE EXCEPTION, whatever this flag says (ENG-8006): when send-keys reaches nothing because the session is down or restarting, the nudge is still queued on the durable rail for the next session, and if that enqueue fails the card is closed as failed. So OFF is a partial kill switch: it takes live sessions off the rail, but not firings whose session is down. ENG-7971 was reverted once because the durable rail 500d on a session_id bug (fixed in ENG-8061). During a rail incident, OFF limits the blast radius to down-session firings, and those show up as cards closed failed with "scheduled-task nudge undeliverable". Resolved host-side by the manager via hostFlagStore().getBoolean (the manager evaluates the decision itself, so no spawn-env materialization is needed). Ships dark.',
|
|
46275
46283
|
flagType: "boolean",
|
|
46276
46284
|
// Declared safe value is `false`: the current, reverted-to send-keys delivery. Turning
|
|
46277
46285
|
// it ON activates the durable rail per org/host once operators are confident. `false`
|
|
@@ -46589,6 +46597,32 @@ var FLAG_REGISTRY = [
|
|
|
46589
46597
|
// `sensitive: true`, plus the two gates spelled out in the description.
|
|
46590
46598
|
since: "0.28.1015"
|
|
46591
46599
|
},
|
|
46600
|
+
{
|
|
46601
|
+
key: "remote-mcp-oauth-broker-credentials",
|
|
46602
|
+
description: "Deliver the bearer of every OAuth remote MCP served through remote-oauth-proxy (OAUTH_PROVIDERS entries with an mcpUrl: granola, brand-ninja, kajabi, otter, plaud, datadog-ap1/ap2 today) through the broker credential endpoint at USE time, instead of materializing it into `.env.integrations` (ENG-12046). Mechanically the sibling of `xero-broker-credentials`. ON: POST /host/agent-integrations strips `access_token`, `refresh_token` and `token_expires_at` from those rows and marks them credential_delivery=broker, so `<DEF>_ACCESS_TOKEN` is no longer written to `.env.integrations` and so is no longer in the agent process env (the session wrapper `source`s that file with `set -a`). The claudecode adapter then emits AGT_REMOTE_MCP_INTEGRATION_ID instead of a token file/var, and the proxy fetches the bearer per use from POST /host/agent-integrations/<uuid>/credential with the agent's own host credentials (memory only, fail closed, no fallback). OFF (default): byte-for-byte today's behaviour. THIS IS HYGIENE, NOT A BOUNDARY: an agent that calls the same fetch can still obtain the token. The binding control for broad-scope providers (Datadog mcp_all) remains a read-only provider user; the real boundary is ENG-12047 (host-side proxy). SINCE IS A PLACEHOLDER: `since` (0.29.0) is an unreachable placeholder, not a verified threshold. Before enabling, replace it with the first published agt-cli whose remote-oauth-proxy carries broker mode (bisected from the tarballs), or the reach estimate means nothing. FLIP GATE: an under-`since` host honours the marker (it skips the token write, ENG-8344) but still emits a token-file proxy entry, so its remote OAuth MCPs answer \"no current access token\" for every call: an outage of those integrations, not a leak. Zero hosts carrying these integrations below `since` per hosts.agt_version before flipping, counting NULL as unconverged. agt_version names the bundle on disk, not the running proxy: a session started before the update keeps its pre-broker proxy until it restarts, so also confirm every affected session has respawned. HARD GATE: Do not enable, for any provider, until ENG-12053 is merged AND deployed to every API instance serving the credential route (a merge alone is not enough: an older route ignores on_missing_expiry: 'serve'), and a fetch with it on a no-expiry row is verified not to refresh. Reason: a provider whose refresh response omits expires_in makes oauth-refresh drop token_expires_at, the credential route treats that as \"refresh now\", and the row then refreshes about every 60s; the next poll returns the row to env delivery, but that does NOT respawn the running session, so its proxy keeps refreshing about every 60s until some unrelated restart (provider rate limits, token churn, possible lockouts). None of the in-scope providers (granola, brand-ninja, kajabi, otter, plaud, datadog-ap1, datadog-ap2) is verified on expires_in, and the flag covers all of them at once, so no per-provider exception exists. claude-code agents only: opencode has no broker path and keeps env delivery. See docs/runbooks/remote-mcp-oauth-broker-credentials-rollout.md.",
|
|
46603
|
+
flagType: "boolean",
|
|
46604
|
+
// `false` = today's env delivery. A wrongly-ON flip on an unconverged host is
|
|
46605
|
+
// an outage of the remote OAuth MCPs (see the description), so the ON path is
|
|
46606
|
+
// the one with a reach precondition.
|
|
46607
|
+
defaultValue: false,
|
|
46608
|
+
// Changes how every remote-OAuth MCP on the scope authenticates. A
|
|
46609
|
+
// deliberate, confirmed action (ADR-0022 §4).
|
|
46610
|
+
sensitive: true,
|
|
46611
|
+
// ADR-0120: an org owner/admin must not be able to switch this on for their
|
|
46612
|
+
// own org before its prerequisites (ENG-12053 deployed, hosts and sessions
|
|
46613
|
+
// converged) are met. Nothing in code enforces those gates, and an early
|
|
46614
|
+
// enable is an outage of that org's remote OAuth MCPs (CodeRabbit on #7568).
|
|
46615
|
+
platformAdminOnly: true,
|
|
46616
|
+
// PLACEHOLDER, like `github-broker-credentials` shipped with. Replace with the
|
|
46617
|
+
// first published agt-cli whose remote-oauth-proxy carries broker mode
|
|
46618
|
+
// (grep the bundle for AGT_REMOTE_MCP_INTEGRATION_ID), bisected from the
|
|
46619
|
+
// tarballs as `xero-broker-credentials` did. This version names the bundle on
|
|
46620
|
+
// disk. remote-oauth-proxy.js is not in RESTARTABLE_CHANNEL_FILES, so a
|
|
46621
|
+
// session started before the update keeps its older proxy until it restarts:
|
|
46622
|
+
// a host at this version can still run a pre-broker proxy. Advisory only: it
|
|
46623
|
+
// feeds computeFlagReach, it does not block a flip.
|
|
46624
|
+
since: "0.29.0"
|
|
46625
|
+
},
|
|
46592
46626
|
{
|
|
46593
46627
|
key: "help-kb-auto-grant",
|
|
46594
46628
|
description: "Auto-grant the `augmented-help-kb` integration at ORG scope when an organization is provisioned (ENG-8542), so every agent in that org gets product-doc search without a per-agent operator action. One organization_integrations row reaches every agent in the org: POST /host/agent-integrations merges org -> team -> agent and buildMcpJson's predicate reads that merged set with no scope filter. ON: the two org-provisioning call sites write the row (status=active, created_by=the org owner). OFF (default): they write nothing - byte-for-byte today's behaviour. STAGED ROLLOUT IS THE POINT. ENG-8332 argues against widening distribution of the help KB until two things close, because distributing a corpus with wrong articles \"converts one agent's wrong answer into everyone's\": (1) a live 200 from GET /host/kb/search as the anon role has still never been observed - ENG-7260 was closed on remediation evidence, not on a live call, and the deploy seed log is SERVICE-ROLE evidence that says nothing about the anon grant; (2) the `site-structure` article is unverified against the current IA. Turning this on for ONE org and watching that org's help-kb connectivity-probe verdicts (ENG-8332 added a real mcp_stdio probe that calls search_knowledge_base) is the cheap positive control for (1) - an ENG-7260-class 500 then reports as `down` per agent instead of as silence. Widen only after it comes back healthy. REVOKING IS DELETING THE ROW, not flipping this off: the flag gates GRANTING, so an already-granted org keeps its row when the flag goes off. Evaluated API-side only, per org, inside grantHelpKbToOrg; no host-side envVar and deliberately no sst.config.ts entry (a literal default there would pin it - ENG-8303).",
|
|
@@ -46858,6 +46892,18 @@ var FLAG_REGISTRY = [
|
|
|
46858
46892
|
// honours the filter is unproven, so an org must not switch it on for itself.
|
|
46859
46893
|
platformAdminOnly: true
|
|
46860
46894
|
},
|
|
46895
|
+
{
|
|
46896
|
+
key: "agent-email-inbox",
|
|
46897
|
+
description: "ENG-12021 - lets an owner/admin give one agent its own email address on the platform's agent mail domain, provisioned as a Resend Inbox, which the agent can list, search and read. OFF (default) = the provisioning route refuses and no inbox can be created. This flag is ROLLOUT CONTROL, NOT the revocation: it decides whether an org may provision, and turning it off does NOT take the tools away from an agent that already has an address - `agent_email_inboxes.status` does that, and is what to reach for in an incident. Nor is it the only gate, and the two secrets do NOT gate the same things: AGENT_INBOX_RESEND_API_KEY gates EVERYTHING (unset = provisioning refuses AND every tool call on an existing inbox answers not_configured), while AGENT_INBOX_DOMAIN is read only when MINTING an address - so clearing the domain stops new inboxes and leaves an agent that already has one still reading its mail (NOT replying - this slice ships no send or reply tool at all; that is PR B). Do not reach for either as a kill switch; the status column is the one. A per-org cap refuses provisioning past its limit regardless of this flag. BEFORE ARMING THIS FOR AN ORG, verify cross-inbox thread isolation against a real key: the inbox segment of every Resend path is server-derived from the agent's own row, but thread_id is an AGENT-SUPPLIED argument, and Resend documents no error for a thread that belongs to a different inbox. Their thread response carries no inbox field either, so this cannot be re-checked on our side after the fact - it is a vendor behaviour that has to be measured once (request one inbox's thread id under another inbox and confirm a 404), not an invariant this code can enforce. Platform-admin-only AND sensitive because each inbox is a RECURRING monthly cost with no per-unit billing primitive behind it (ENG-8720) - an org must not be able to switch on a subscription for itself, and the cap is the only thing metering it.",
|
|
46898
|
+
flagType: "boolean",
|
|
46899
|
+
defaultValue: false,
|
|
46900
|
+
sensitive: true,
|
|
46901
|
+
platformAdminOnly: true
|
|
46902
|
+
// Deliberately NO envVar. The reader is the API, server-side, which can call the
|
|
46903
|
+
// flag evaluator directly - so there is no host-side bash hook needing a
|
|
46904
|
+
// materialised value, and declaring one would only create a literal for the
|
|
46905
|
+
// ENG-8303 sst-pin guard to catch.
|
|
46906
|
+
},
|
|
46861
46907
|
{
|
|
46862
46908
|
key: "premium-gateway-inference",
|
|
46863
46909
|
description: "ENG-10865 / ADR-0117 - RESERVED, and INERT until the runtime wiring lands. Turning it ON today mints nothing and delivers nothing: no caller invokes the mint client yet, resolveBindingCredential is unchanged, and a gateway binding still resolves `blocked-gateway` either way. The flag is registered ahead of that wiring on purpose - see below - so an operator must not read it as a working switch. ONCE WIRED, ON will mean the API mints a budgeted key per agent and the host spawns against the gateway, so that a policy whose ACTIVE binding is transport=gateway with credential_owner=platform resolves `applied`; OFF will remain exactly the fleet behaviour before this flag existed. Registered early and kept deliberately SEPARATE from holding AI_GATEWAY_MINT_TOKEN, because possessing the minting credential is not clearance to spend platform money on a customer agent - the ENG-8247 shape. The secret is set in prod BEFORE ADR-0117 is accepted, before metering exists (ENG-10867) and before the premium opt-in is registered (ENG-10868), so presence of the credential must not be the gate. Boolean.",
|
|
@@ -38,7 +38,12 @@ var REMOTE_MCP_PROXY_ENV = {
|
|
|
38
38
|
// Deliberately NOT in REMOTE_MCP_AUTH_ENV_KEYS, for the same reason as
|
|
39
39
|
// `argRejects`: it shapes WHICH calls we forward, not what an outbound request
|
|
40
40
|
// looks like, so the connectivity probe has nothing to reconstruct from it.
|
|
41
|
-
toolTiers: "AGT_REMOTE_MCP_TOOL_TIERS"
|
|
41
|
+
toolTiers: "AGT_REMOTE_MCP_TOOL_TIERS",
|
|
42
|
+
// ENG-12046: when set, the proxy fetches its bearer from the broker at use
|
|
43
|
+
// time for THIS integration row (uuid) instead of reading TOKEN_FILE/TOKEN_VAR,
|
|
44
|
+
// and the token is no longer written to `.env.integrations`. Hygiene, not a
|
|
45
|
+
// boundary: see core/integrations/remote-mcp-broker-token.ts.
|
|
46
|
+
integrationId: "AGT_REMOTE_MCP_INTEGRATION_ID"
|
|
42
47
|
};
|
|
43
48
|
var REMOTE_MCP_AUTH_ENV_KEYS = [
|
|
44
49
|
REMOTE_MCP_PROXY_ENV.tokenVar,
|
|
@@ -82,6 +87,121 @@ function buildForwardHeaders(token, authHeader, extras, readVar) {
|
|
|
82
87
|
return headers;
|
|
83
88
|
}
|
|
84
89
|
|
|
90
|
+
// ../core/dist/integrations/remote-mcp-broker-token.js
|
|
91
|
+
var BROKER_TOKEN_EXPIRY_SKEW_MS = 6e4;
|
|
92
|
+
var BROKER_TOKEN_UNKNOWN_EXPIRY_TTL_MS = 6e4;
|
|
93
|
+
var BROKER_FETCH_TIMEOUT_MS = 15e3;
|
|
94
|
+
function trimTrailingSlashes(host) {
|
|
95
|
+
let end = host.length;
|
|
96
|
+
while (end > 0 && host.charCodeAt(end - 1) === 47)
|
|
97
|
+
end -= 1;
|
|
98
|
+
return host.slice(0, end);
|
|
99
|
+
}
|
|
100
|
+
function brokerCredentialPath(integrationId) {
|
|
101
|
+
return `/host/agent-integrations/${encodeURIComponent(integrationId)}/credential`;
|
|
102
|
+
}
|
|
103
|
+
var BROKER_FORCED_REFRESH_MIN_INTERVAL_MS = 5 * 60 * 1e3;
|
|
104
|
+
function createBrokerTokenSource(config, deps = {}) {
|
|
105
|
+
const fetchImpl = deps.fetchImpl ?? fetch;
|
|
106
|
+
const now = deps.now ?? (() => Date.now());
|
|
107
|
+
const host = trimTrailingSlashes(config.host);
|
|
108
|
+
let cached = null;
|
|
109
|
+
let inFlight = null;
|
|
110
|
+
let refreshNext = false;
|
|
111
|
+
let lastForcedRefreshAt = Number.NEGATIVE_INFINITY;
|
|
112
|
+
let generation = 0;
|
|
113
|
+
const missing = [
|
|
114
|
+
!host ? "AGT_HOST" : null,
|
|
115
|
+
!config.apiKey ? "AGT_API_KEY" : null,
|
|
116
|
+
!config.agentId ? "AGT_AGENT_ID" : null,
|
|
117
|
+
!config.integrationId ? "AGT_REMOTE_MCP_INTEGRATION_ID" : null
|
|
118
|
+
].filter((v) => v !== null);
|
|
119
|
+
async function postJson(path, body, bearer) {
|
|
120
|
+
let res;
|
|
121
|
+
try {
|
|
122
|
+
res = await fetchImpl(host + path, {
|
|
123
|
+
method: "POST",
|
|
124
|
+
headers: { "Content-Type": "application/json", ...bearer ? { Authorization: `Bearer ${bearer}` } : {} },
|
|
125
|
+
body: JSON.stringify(body),
|
|
126
|
+
signal: AbortSignal.timeout(BROKER_FETCH_TIMEOUT_MS)
|
|
127
|
+
});
|
|
128
|
+
} catch (err) {
|
|
129
|
+
return { ok: false, reason: `cannot reach ${path} (${err instanceof Error ? err.message : String(err)})` };
|
|
130
|
+
}
|
|
131
|
+
const text = await res.text().catch(() => "");
|
|
132
|
+
if (!res.ok) {
|
|
133
|
+
let detail = "";
|
|
134
|
+
let needsReauth = false;
|
|
135
|
+
try {
|
|
136
|
+
const parsed = JSON.parse(text);
|
|
137
|
+
if (parsed && typeof parsed.error === "string")
|
|
138
|
+
detail = `: ${parsed.error}`;
|
|
139
|
+
needsReauth = parsed?.needs_reauth === true;
|
|
140
|
+
} catch {
|
|
141
|
+
}
|
|
142
|
+
return { ok: false, reason: `${path} returned HTTP ${res.status}${detail}`, status: res.status, needsReauth };
|
|
143
|
+
}
|
|
144
|
+
try {
|
|
145
|
+
return { ok: true, json: JSON.parse(text) };
|
|
146
|
+
} catch {
|
|
147
|
+
return { ok: false, reason: `${path} returned a non-JSON body` };
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
async function fetchToken() {
|
|
151
|
+
if (missing.length > 0)
|
|
152
|
+
return { ok: false, reason: `${missing.join(", ")} not set in the proxy environment` };
|
|
153
|
+
const startedAt = generation;
|
|
154
|
+
const exchanged = await postJson("/host/exchange", { host_key: config.apiKey, agent_id: config.agentId });
|
|
155
|
+
if (!exchanged.ok)
|
|
156
|
+
return { ok: false, reason: `host key exchange failed - ${exchanged.reason}` };
|
|
157
|
+
const jwt = exchanged.json?.token;
|
|
158
|
+
if (typeof jwt !== "string" || jwt.length === 0)
|
|
159
|
+
return { ok: false, reason: "host key exchange returned no token" };
|
|
160
|
+
const onMissingExpiry = refreshNext ? "refresh" : "serve";
|
|
161
|
+
if (refreshNext) {
|
|
162
|
+
refreshNext = false;
|
|
163
|
+
lastForcedRefreshAt = now();
|
|
164
|
+
}
|
|
165
|
+
const cred = await postJson(brokerCredentialPath(config.integrationId), { agent_id: config.agentId, on_missing_expiry: onMissingExpiry }, jwt);
|
|
166
|
+
if (!cred.ok) {
|
|
167
|
+
const needsReauth = cred.needsReauth === true || cred.status === 400;
|
|
168
|
+
return { ok: false, reason: `credential fetch failed - ${cred.reason}`, ...needsReauth ? { needsReauth: true } : {} };
|
|
169
|
+
}
|
|
170
|
+
const body = cred.json;
|
|
171
|
+
const token = body?.access_token;
|
|
172
|
+
if (typeof token !== "string" || token.length === 0)
|
|
173
|
+
return { ok: false, reason: "credential fetch returned no access_token" };
|
|
174
|
+
const expiresAtMs = typeof body?.expires_at === "string" ? Date.parse(body.expires_at) : NaN;
|
|
175
|
+
const freshUntil = Number.isFinite(expiresAtMs) ? expiresAtMs - BROKER_TOKEN_EXPIRY_SKEW_MS : now() + BROKER_TOKEN_UNKNOWN_EXPIRY_TTL_MS;
|
|
176
|
+
cached = freshUntil > now() && startedAt === generation ? { token, freshUntil } : null;
|
|
177
|
+
return { ok: true, token };
|
|
178
|
+
}
|
|
179
|
+
return {
|
|
180
|
+
async get() {
|
|
181
|
+
if (cached && cached.freshUntil > now())
|
|
182
|
+
return { ok: true, token: cached.token };
|
|
183
|
+
cached = null;
|
|
184
|
+
if (!inFlight) {
|
|
185
|
+
inFlight = fetchToken().finally(() => {
|
|
186
|
+
inFlight = null;
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
return inFlight;
|
|
190
|
+
},
|
|
191
|
+
/**
|
|
192
|
+
* Drop the cached token, e.g. after the remote answered 401 with it. The
|
|
193
|
+
* next fetch also asks for a refresh of a no-expiry row, at most once per
|
|
194
|
+
* BROKER_FORCED_REFRESH_MIN_INTERVAL_MS.
|
|
195
|
+
*/
|
|
196
|
+
invalidate() {
|
|
197
|
+
cached = null;
|
|
198
|
+
generation += 1;
|
|
199
|
+
if (now() - lastForcedRefreshAt >= BROKER_FORCED_REFRESH_MIN_INTERVAL_MS)
|
|
200
|
+
refreshNext = true;
|
|
201
|
+
}
|
|
202
|
+
};
|
|
203
|
+
}
|
|
204
|
+
|
|
85
205
|
// src/remote-oauth-proxy.ts
|
|
86
206
|
var URL_ENV = REMOTE_MCP_PROXY_ENV.url;
|
|
87
207
|
var TOKEN_FILE_ENV = REMOTE_MCP_PROXY_ENV.tokenFile;
|
|
@@ -95,6 +215,18 @@ var remoteUrl = process.env[URL_ENV] ?? "";
|
|
|
95
215
|
var tokenFile = process.env[TOKEN_FILE_ENV] ?? "";
|
|
96
216
|
var tokenVar = process.env[TOKEN_VAR_ENV] ?? "";
|
|
97
217
|
var label = process.env[REMOTE_MCP_PROXY_ENV.label] || tokenVar || "remote-oauth";
|
|
218
|
+
var brokerIntegrationId = process.env[REMOTE_MCP_PROXY_ENV.integrationId] ?? "";
|
|
219
|
+
var brokerToken = brokerIntegrationId ? createBrokerTokenSource({
|
|
220
|
+
host: process.env["AGT_HOST"] ?? "",
|
|
221
|
+
apiKey: process.env["AGT_API_KEY"] ?? "",
|
|
222
|
+
agentId: process.env["AGT_AGENT_ID"] ?? "",
|
|
223
|
+
integrationId: brokerIntegrationId
|
|
224
|
+
}) : null;
|
|
225
|
+
async function resolveCurrentToken() {
|
|
226
|
+
if (brokerToken) return brokerToken.get();
|
|
227
|
+
const token = readCurrentToken(tokenFile, tokenVar);
|
|
228
|
+
return token ? { ok: true, token } : { ok: false, reason: `no token in ${tokenFile} (var ${tokenVar})` };
|
|
229
|
+
}
|
|
98
230
|
var toolAllowlist = parseToolAllowlist(process.env[ALLOWLIST_ENV] ?? "");
|
|
99
231
|
var preEnableToolsets = parsePreEnableToolsets(process.env[PREENABLE_ENV] ?? "");
|
|
100
232
|
var argRejects = parseArgRejects(process.env[ARG_REJECTS_ENV] ?? "");
|
|
@@ -455,6 +587,7 @@ async function postRpc(token, body) {
|
|
|
455
587
|
signal: AbortSignal.timeout(REMOTE_FETCH_TIMEOUT_MS)
|
|
456
588
|
});
|
|
457
589
|
const text = await res.text().catch(() => "");
|
|
590
|
+
if (res.status === 401) brokerToken?.invalidate();
|
|
458
591
|
return { ok: res.ok, status: res.status, ct: res.headers.get("content-type") ?? "", text };
|
|
459
592
|
}
|
|
460
593
|
var unionOnce = null;
|
|
@@ -550,11 +683,13 @@ async function forward(line, id, isNotification, method, params) {
|
|
|
550
683
|
logErr(`refused agent-issued ${ACTIVATION_TOOL} (activation is proxy-managed)`);
|
|
551
684
|
return isNotification ? [] : [jsonRpcError(id, -32601, activationRefusalMessage(label, preEnableToolsets))];
|
|
552
685
|
}
|
|
553
|
-
const
|
|
554
|
-
if (!
|
|
555
|
-
logErr(
|
|
556
|
-
|
|
686
|
+
const resolved = await resolveCurrentToken();
|
|
687
|
+
if (!resolved.ok) {
|
|
688
|
+
logErr(resolved.reason);
|
|
689
|
+
const message = brokerToken ? "needsReauth" in resolved && resolved.needsReauth ? `${label}: the integration's authorisation is no longer valid (${resolved.reason}). Reconnect the integration; retrying will not help.` : `${label}: could not fetch the current access token from Augmented (${resolved.reason}). No stored copy is used; retry shortly.` : `${label}: no current access token available (reconnect the integration)`;
|
|
690
|
+
return isNotification ? [] : [jsonRpcError(id, -32e3, message)];
|
|
557
691
|
}
|
|
692
|
+
const token = resolved.token;
|
|
558
693
|
if (method === "tools/list" && preEnableToolsets.length > 0) {
|
|
559
694
|
const build = await ensureUnionManifest(token);
|
|
560
695
|
let tools = [...unionToolByName.values()];
|
|
@@ -592,6 +727,7 @@ async function forward(line, id, isNotification, method, params) {
|
|
|
592
727
|
logErr(`fetch failed: ${err.message}`);
|
|
593
728
|
return isNotification ? [] : [jsonRpcError(id, -32001, `${label}: transport error contacting MCP server`)];
|
|
594
729
|
}
|
|
730
|
+
if (res.status === 401) brokerToken?.invalidate();
|
|
595
731
|
const ct = res.headers.get("content-type") ?? "";
|
|
596
732
|
let body = "";
|
|
597
733
|
try {
|
|
@@ -624,6 +760,7 @@ async function forward(line, id, isNotification, method, params) {
|
|
|
624
760
|
}
|
|
625
761
|
function isMissingConfig() {
|
|
626
762
|
if (!remoteUrl) return URL_ENV;
|
|
763
|
+
if (brokerToken) return null;
|
|
627
764
|
if (!tokenFile) return TOKEN_FILE_ENV;
|
|
628
765
|
if (!tokenVar) return TOKEN_VAR_ENV;
|
|
629
766
|
return null;
|