Skip to content

Open-source Grok Bot alternative for named AI teammates. Local-first desktop, web, and mobile clients with per-bot tools, instructions, and memory. Independent fork of T3 Code.

711 B
Raw Blame
import * as DynamoDB from "@distilled.cloud/aws/dynamodb";
import * as Layer from "effect/Layer";
import * as Output from "../../Output.ts";
import { makeTableIamHttpBinding } from "./BindingHttp.ts";
import { ExecuteStatement } from "./ExecuteStatement.ts";

export const ExecuteStatementHttp = Layer.effect(
  ExecuteStatement,
  makeTableIamHttpBinding({
    tag: "AWS.DynamoDB.ExecuteStatement",
    operation: DynamoDB.executeStatement,
    actions: [
      "dynamodb:PartiQLDelete",
      "dynamodb:PartiQLInsert",
      "dynamodb:PartiQLSelect",
      "dynamodb:PartiQLUpdate",
    ],
    resources: (table) => [
      table.tableArn,
      Output.interpolate`${table.tableArn}/index/*`,
    ],
  }),
);