@integrity-labs/cloud-broker 0.4.5 → 0.4.6

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.
Files changed (2) hide show
  1. package/dist/index.js +2 -19
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -20996,7 +20996,6 @@ var BrokerClient = class {
20996
20996
  host;
20997
20997
  agentId;
20998
20998
  runId;
20999
- defaultSourceContext;
21000
20999
  apiKey;
21001
21000
  fetchImpl;
21002
21001
  token;
@@ -21006,7 +21005,6 @@ var BrokerClient = class {
21006
21005
  this.host = config2.host.replace(/\/+$/, "");
21007
21006
  this.agentId = config2.agentId;
21008
21007
  this.runId = config2.runId;
21009
- this.defaultSourceContext = config2.defaultSourceContext;
21010
21008
  this.apiKey = config2.apiKey;
21011
21009
  this.fetchImpl = config2.fetchImpl ?? fetch;
21012
21010
  this.token = config2.initialToken ?? "";
@@ -21122,13 +21120,7 @@ var BrokerClient = class {
21122
21120
  if (!runId) {
21123
21121
  throw makeBrokerError(400, "BrokerClient.requestAccess requires run_id (pass it in args, or set runId on BrokerClientConfig)");
21124
21122
  }
21125
- const sourceContext = args.source_context ?? this.defaultSourceContext;
21126
- const body = {
21127
- ...args,
21128
- agent_id: agentId,
21129
- run_id: runId,
21130
- source_context: sourceContext
21131
- };
21123
+ const body = { ...args, agent_id: agentId, run_id: runId };
21132
21124
  return this.request("POST", "/aws/grants", { body });
21133
21125
  }
21134
21126
  pollGrant(args) {
@@ -21222,14 +21214,6 @@ if (process.env.AGT_TEAM_SLUG) {
21222
21214
  "cloud-broker: AGT_TEAM_SLUG is set but no longer required (the API derives team from agent_id). Safe to remove from .mcp.json env block."
21223
21215
  );
21224
21216
  }
21225
- var AGT_INBOUND_CHANNEL_TYPE = process.env.AGT_INBOUND_CHANNEL_TYPE ?? "";
21226
- var AGT_INBOUND_CHANNEL_ID = process.env.AGT_INBOUND_CHANNEL_ID ?? "";
21227
- var AGT_INBOUND_CHANNEL_THREAD_TS = process.env.AGT_INBOUND_CHANNEL_THREAD_TS ?? "";
21228
- var defaultSourceContext = AGT_INBOUND_CHANNEL_TYPE && AGT_INBOUND_CHANNEL_ID ? {
21229
- channel_type: AGT_INBOUND_CHANNEL_TYPE,
21230
- channel_id: AGT_INBOUND_CHANNEL_ID,
21231
- thread_ts: AGT_INBOUND_CHANNEL_THREAD_TS || void 0
21232
- } : void 0;
21233
21217
  var broker = new BrokerClient({
21234
21218
  host: AGT_HOST,
21235
21219
  agentId: AGT_AGENT_ID,
@@ -21237,7 +21221,6 @@ var broker = new BrokerClient({
21237
21221
  // Empty string is treated as absent — the broker client only fills runId
21238
21222
  // on requestAccess if a non-empty value is provided.
21239
21223
  runId: AGT_RUN_ID || void 0,
21240
- defaultSourceContext,
21241
21224
  initialToken: AGT_TOKEN || void 0,
21242
21225
  apiKey: AGT_API_KEY || void 0
21243
21226
  });
@@ -21280,7 +21263,7 @@ server.tool(
21280
21263
  );
21281
21264
  server.tool(
21282
21265
  "request_access",
21283
- `Request scoped, TTL-bounded AWS credentials for the current task. agent_id and run_id are optional \u2014 the broker fills them from the host MCP env (AGT_AGENT_ID / AGT_RUN_ID). source_context is also optional \u2014 the broker fills channel_type/channel_id/thread_ts from AGT_INBOUND_CHANNEL_* env when the host runtime exposes them, so the resolution notification can tell you to thread the answer back to the original conversation. Pass source_context explicitly only when you know it differs from the inbound message you are currently handling (rare). Returns { grant_id, status, secret_ref?, expires_at?, denial_reason?, notification_status?, notification_failure_reason? }. status="active" means credentials are ready, use them now. status="denied" means the request was rejected (denial_reason explains). status="pending" means approval is still outstanding \u2014 DO NOT poll. The broker pushes the resolution to you via direct-chat the moment a human approves or denies, so save the grant_id, return control, and resume when the inbound message arrives. The notification body will include the source channel/thread to reply in \u2014 complete the user's task there, not in direct-chat. Only check notification_status if you need to flag a setup issue to the user: "sent" means a human was paged; "failed" or "not_attempted" means no human was paged (typically channel_not_found because the approval-bot is not a member of the configured channel) \u2014 quote grant_id + notification_failure_reason and recommend manual escalation. poll_grant exists as an escape hatch for explicit re-checks but the autonomous flow does not need it.`,
21266
+ 'Request scoped, TTL-bounded AWS credentials for the current task. agent_id and run_id are optional \u2014 the broker fills them from the host MCP env (AGT_AGENT_ID / AGT_RUN_ID). source_context is optional but you SHOULD pass it whenever the request was triggered by an inbound channel message: extract { channel_type, channel_id, thread_ts? } from the `<channel>` tag in the conversation that triggered this. Slack: channel_type="slack", channel_id=tag\'s `channel`, thread_ts=tag\'s `thread_ts`. Telegram: channel_type="telegram", channel_id=tag\'s `chat_id`. Direct-chat: channel_type="direct-chat", channel_id=tag\'s `session_id`. Without source_context the resolution notification dead-ends in your direct-chat instead of threading back to the original conversation. Returns { grant_id, status, secret_ref?, expires_at?, denial_reason?, notification_status?, notification_failure_reason? }. status="active" means credentials are ready, use them now. status="denied" means the request was rejected (denial_reason explains). status="pending" means approval is still outstanding \u2014 DO NOT poll. The broker pushes the resolution to you via direct-chat the moment a human approves or denies, so save the grant_id, return control, and resume when the inbound message arrives. The notification body will include an "Original conversation:" line naming the channel/thread to reply in \u2014 complete the user\'s task there, not in direct-chat. Only check notification_status if you need to flag a setup issue to the user: "sent" means a human was paged; "failed" or "not_attempted" means no human was paged (typically channel_not_found because the approval-bot is not a member of the configured channel) \u2014 quote grant_id + notification_failure_reason and recommend manual escalation. poll_grant exists as an escape hatch for explicit re-checks but the autonomous flow does not need it.',
21284
21267
  requestAccessShape,
21285
21268
  async (args) => {
21286
21269
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@integrity-labs/cloud-broker",
3
- "version": "0.4.5",
3
+ "version": "0.4.6",
4
4
  "description": "Cloud Access Broker — MCP server that mints scoped, TTL-bounded cloud credentials per agent task. v1 ships AWS support (request_access, poll_grant, release_access, describe_scope, preview_request — STS AssumeRole under the hood); GCP, Azure, and Cloudflare land alongside in the same package as the broker grows.",
5
5
  "type": "module",
6
6
  "bin": {