Artifacts

codemode-gatewaysourcetypescript
Path: codemode-gateway/src/providers/artifacts.tsRelative: src/providers/artifacts.tsSubproject: codemode-gatewayCategory: codemode-gateway
Lines: 36Bytes: 992Imports: 1Exports: 1

Content Preview

  1. import type { Env } from "../types";
  2. /**
  3. * Artifacts namespace tools — R2 bucket for binary artifacts.
  4. *
  5. * Provides `list` for key discovery. Delete is intentionally NOT exposed
  6. * (never-delete policy). HTTP `GET /artifacts/<key>` is handled in `src/index.ts`.
  7. */
  8. /**
  9. * `artifacts.list({ prefix? })` → keys in the ARTIFACTS bucket.
  10. * Returns an array of key strings. Pagination-aware (walks all pages).
  11. */
  12. async function artifactsList(
  13. args: { prefix?: string },
  14. env: Env
  15. ): Promise<str