@integrity-labs/cloud-broker 0.2.1 → 0.4.1
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/index.js +18 -10
- package/package.json +3 -2
package/dist/index.js
CHANGED
|
@@ -20994,7 +20994,7 @@ function makeBrokerError(status, message, detail) {
|
|
|
20994
20994
|
}
|
|
20995
20995
|
var BrokerClient = class {
|
|
20996
20996
|
host;
|
|
20997
|
-
|
|
20997
|
+
agentId;
|
|
20998
20998
|
apiKey;
|
|
20999
20999
|
fetchImpl;
|
|
21000
21000
|
token;
|
|
@@ -21002,7 +21002,7 @@ var BrokerClient = class {
|
|
|
21002
21002
|
exchangeInFlight = null;
|
|
21003
21003
|
constructor(config2) {
|
|
21004
21004
|
this.host = config2.host.replace(/\/+$/, "");
|
|
21005
|
-
this.
|
|
21005
|
+
this.agentId = config2.agentId;
|
|
21006
21006
|
this.apiKey = config2.apiKey;
|
|
21007
21007
|
this.fetchImpl = config2.fetchImpl ?? fetch;
|
|
21008
21008
|
this.token = config2.initialToken ?? "";
|
|
@@ -21019,8 +21019,7 @@ var BrokerClient = class {
|
|
|
21019
21019
|
buildHeaders(token, contentType = "application/json") {
|
|
21020
21020
|
return {
|
|
21021
21021
|
"Content-Type": contentType,
|
|
21022
|
-
Authorization: `Bearer ${token}
|
|
21023
|
-
"X-Team-Slug": this.teamSlug
|
|
21022
|
+
Authorization: `Bearer ${token}`
|
|
21024
21023
|
};
|
|
21025
21024
|
}
|
|
21026
21025
|
async refreshToken() {
|
|
@@ -21089,17 +21088,21 @@ var BrokerClient = class {
|
|
|
21089
21088
|
}
|
|
21090
21089
|
// ────────────────────────── tool-shaped wrappers ──────────────────────────
|
|
21091
21090
|
describeScope(args) {
|
|
21091
|
+
const query = { account_id: args.account_id };
|
|
21092
|
+
if (this.agentId) query.agent_id = this.agentId;
|
|
21092
21093
|
return this.request(
|
|
21093
21094
|
"GET",
|
|
21094
21095
|
"/aws/scope",
|
|
21095
|
-
{ query
|
|
21096
|
+
{ query }
|
|
21096
21097
|
);
|
|
21097
21098
|
}
|
|
21098
21099
|
previewRequest(args) {
|
|
21100
|
+
const body = { ...args };
|
|
21101
|
+
if (this.agentId && body.agent_id === void 0) body.agent_id = this.agentId;
|
|
21099
21102
|
return this.request(
|
|
21100
21103
|
"POST",
|
|
21101
21104
|
"/aws/scope/preview",
|
|
21102
|
-
{ body
|
|
21105
|
+
{ body }
|
|
21103
21106
|
);
|
|
21104
21107
|
}
|
|
21105
21108
|
requestAccess(args) {
|
|
@@ -21159,18 +21162,23 @@ var releaseAccessShape = releaseAccessSchema.shape;
|
|
|
21159
21162
|
|
|
21160
21163
|
// src/index.ts
|
|
21161
21164
|
var AGT_HOST = process.env.AGT_HOST;
|
|
21162
|
-
var
|
|
21165
|
+
var AGT_AGENT_ID = process.env.AGT_AGENT_ID;
|
|
21163
21166
|
var AGT_TOKEN = process.env.AGT_TOKEN ?? "";
|
|
21164
21167
|
var AGT_API_KEY = process.env.AGT_API_KEY ?? "";
|
|
21165
|
-
if (!AGT_HOST || !
|
|
21168
|
+
if (!AGT_HOST || !AGT_AGENT_ID || !AGT_TOKEN && !AGT_API_KEY) {
|
|
21166
21169
|
console.error(
|
|
21167
|
-
"cloud-broker: missing env vars. Need AGT_HOST,
|
|
21170
|
+
"cloud-broker: missing env vars. Need AGT_HOST, AGT_AGENT_ID, and one of AGT_TOKEN or AGT_API_KEY."
|
|
21168
21171
|
);
|
|
21169
21172
|
process.exit(1);
|
|
21170
21173
|
}
|
|
21174
|
+
if (process.env.AGT_TEAM_SLUG) {
|
|
21175
|
+
console.error(
|
|
21176
|
+
"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."
|
|
21177
|
+
);
|
|
21178
|
+
}
|
|
21171
21179
|
var broker = new BrokerClient({
|
|
21172
21180
|
host: AGT_HOST,
|
|
21173
|
-
|
|
21181
|
+
agentId: AGT_AGENT_ID,
|
|
21174
21182
|
initialToken: AGT_TOKEN || void 0,
|
|
21175
21183
|
apiKey: AGT_API_KEY || void 0
|
|
21176
21184
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@integrity-labs/cloud-broker",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.1",
|
|
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": {
|
|
@@ -25,7 +25,8 @@
|
|
|
25
25
|
"dev": "tsx watch src/index.ts",
|
|
26
26
|
"typecheck": "tsc --noEmit",
|
|
27
27
|
"test": "vitest run",
|
|
28
|
-
"clean": "rm -rf dist"
|
|
28
|
+
"clean": "rm -rf dist",
|
|
29
|
+
"publish:templates": "bash cloudformation/publish.sh"
|
|
29
30
|
},
|
|
30
31
|
"dependencies": {
|
|
31
32
|
"@modelcontextprotocol/sdk": "^1.27.1",
|