@integrity-labs/cloud-broker 0.7.10 → 0.7.11

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 +31 -1
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -21380,6 +21380,16 @@ var BrokerClient = class {
21380
21380
  { query: this.agentId ? { agent_id: this.agentId } : void 0 }
21381
21381
  );
21382
21382
  }
21383
+ supabaseRest(args) {
21384
+ return this.request(
21385
+ "POST",
21386
+ `/supabase/grants/${encodeURIComponent(args.grant_id)}/rest`,
21387
+ {
21388
+ query: this.agentId ? { agent_id: this.agentId } : void 0,
21389
+ body: { method: args.method, path: args.path, ...args.body !== void 0 ? { body: args.body } : {} }
21390
+ }
21391
+ );
21392
+ }
21383
21393
  };
21384
21394
 
21385
21395
  // src/inventory.ts
@@ -21613,6 +21623,12 @@ var supabaseQuerySchema = external_exports.object({
21613
21623
  var supabaseDescribeSchema = external_exports.object({
21614
21624
  grant_id: external_exports.string().uuid("grant_id must be a UUID")
21615
21625
  });
21626
+ var supabaseRestSchema = external_exports.object({
21627
+ grant_id: external_exports.string().uuid("grant_id must be a UUID"),
21628
+ method: external_exports.enum(["GET", "HEAD", "POST", "PATCH", "PUT", "DELETE"]).describe("HTTP method. Writes require a non-read-only grant."),
21629
+ path: external_exports.string().min(1, "path is required").describe('PostgREST-relative path, e.g. "orders?select=*&limit=10". Do NOT include /rest/v1/.'),
21630
+ body: external_exports.unknown().optional().describe("JSON body for POST/PATCH/PUT.")
21631
+ });
21616
21632
  var supabaseDescribeScopeShape = supabaseDescribeScopeSchema.shape;
21617
21633
  var supabasePreviewRequestShape = supabasePreviewRequestSchema.shape;
21618
21634
  var supabaseRequestAccessShape = supabaseRequestAccessSchema.shape;
@@ -21623,11 +21639,12 @@ var supabaseCheckApprovalChannelShape = supabaseCheckApprovalChannelSchema.shape
21623
21639
  var supabaseListProjectsShape = supabaseListProjectsSchema.shape;
21624
21640
  var supabaseQueryShape = supabaseQuerySchema.shape;
21625
21641
  var supabaseDescribeShape = supabaseDescribeSchema.shape;
21642
+ var supabaseRestShape = supabaseRestSchema.shape;
21626
21643
 
21627
21644
  // package.json
21628
21645
  var package_default = {
21629
21646
  name: "@integrity-labs/cloud-broker",
21630
- version: "0.7.10",
21647
+ version: "0.7.11",
21631
21648
  description: "Cloud Access Broker \u2014 MCP server that mints scoped, TTL-bounded cloud credentials per agent task. Ships AWS support (aws_request_access, aws_poll_grant, aws_release_access, aws_describe_scope, aws_preview_request, aws_get_credentials \u2014 STS AssumeRole under the hood); GCP, Azure, and Cloudflare land alongside in the same package as the broker grows.",
21632
21649
  type: "module",
21633
21650
  bin: {
@@ -22131,6 +22148,19 @@ server.tool(
22131
22148
  }
22132
22149
  }
22133
22150
  );
22151
+ server.tool(
22152
+ "supabase_rest",
22153
+ 'Call a Supabase project\'s REST (PostgREST) API for an ACTIVE grant - the primary way to read AND write your app data. You do NOT hold a key; the broker injects the project api_key and runs the call server-side under your grant\'s scope. Args: { grant_id, method (GET/HEAD/POST/PATCH/PUT/DELETE), path, body? }. `path` is PostgREST-relative - e.g. "orders?select=*&limit=10", "orders?id=eq.7" - do NOT include /rest/v1/ or the host. Filtering/ordering/pagination use PostgREST query syntax. For writes, pass the row(s) as `body` (POST=insert, PATCH=update with a filter in path, DELETE=delete with a filter in path). Returns on success { grant_id, ok: true, status, body } where body is the PostgREST JSON (rows for reads, the affected rows for writes). On a denial returns { ok: false, error_code, error }: READ_ONLY (your grant is read-only - writes rejected), SCOPE_DENIED (table not in your grant\'s allowed tables, or rpc/ blocked), BAD_REQUEST (bad method/path), REST_NOT_CONFIGURED (no api_key enrolled - tell the user to ask their operator), GRANT_NOT_ACTIVE / GRANT_EXPIRED / GRANT_RELEASED, or EXECUTION_ERROR. A 4xx from PostgREST itself comes back as { ok:false, status, body } with the upstream error in body. Call supabase_describe first to see your allowed tables and whether REST is available. rpc/ calls are not permitted. Use supabase_query for raw SQL / system tables instead.' + NO_DIRECT_SUPABASE_HTTP_BLOCK,
22154
+ supabaseRestShape,
22155
+ async (args) => {
22156
+ try {
22157
+ const result = await broker.supabaseRest(args);
22158
+ return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
22159
+ } catch (err) {
22160
+ return { content: [{ type: "text", text: formatBrokerError(err) }], isError: true };
22161
+ }
22162
+ }
22163
+ );
22134
22164
  var transport = new StdioServerTransport();
22135
22165
  await server.connect(transport);
22136
22166
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@integrity-labs/cloud-broker",
3
- "version": "0.7.10",
3
+ "version": "0.7.11",
4
4
  "description": "Cloud Access Broker — MCP server that mints scoped, TTL-bounded cloud credentials per agent task. Ships AWS support (aws_request_access, aws_poll_grant, aws_release_access, aws_describe_scope, aws_preview_request, aws_get_credentials — 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": {