Skip to content

feat(agent-kit): add @tigrisdata/agent-kit composition library#85

Merged
designcode merged 11 commits intomainfrom
feat/ai-composition-library
Apr 18, 2026
Merged

feat(agent-kit): add @tigrisdata/agent-kit composition library#85
designcode merged 11 commits intomainfrom
feat/ai-composition-library

Conversation

@designcode
Copy link
Copy Markdown
Collaborator

@designcode designcode commented Apr 16, 2026

Summary

  • Adds @tigrisdata/agent-kit — a composition library that bridges @tigrisdata/storage and @tigrisdata/iam into higher-level workflows for AI agent use cases
  • Sandboxes: createSandbox(baseBucket, count, options?) / teardownSandbox(sandbox) — snapshot + fork N times + scoped credentials per fork
  • Workspaces: createWorkspace(name, options?) / teardownWorkspace(workspace) — bucket + TTL + scoped credentials in one call
  • Checkpoints: checkpoint(bucket) / restore(bucket, snapshotId) / listCheckpoints(bucket) — snapshot-based state management
  • Coordination: setupCoordination(bucket, options) / teardownCoordination(bucket) — event-driven multi-agent pipelines via bucket notifications
  • 10 integration tests covering all workflows
  • Zero framework coupling — pure async TypeScript functions

Test plan

  • npm run build — all packages build cleanly
  • npm run lint — no lint errors
  • npm run format:check — all files formatted
  • npm test — 206 tests passing across all packages (114 storage + 10 agent-kit + 38 keyv-tigris + 44 react)
  • Review API surface and function signatures
  • Review README usage examples

🤖 Generated with Claude Code


Note

Low Risk
Low risk: this PR only updates documentation and does not change runtime code or APIs.

Overview
Updates the root README.md to include @tigrisdata/agent-kit in the monorepo’s package list, briefly describing it as an AI-agent workflow composition library.

Reviewed by Cursor Bugbot for commit 88e6170. Bugbot is set up for automated code reviews on this repo. Configure here.

@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented Apr 16, 2026

Greptile Summary

This PR introduces @tigrisdata/ai, a new composition library that wraps @tigrisdata/storage and @tigrisdata/iam into higher-level workflows (sandboxes, workspaces, checkpoints, coordination) for AI agent use cases. The package structure, config layer, coordination module, and tests are solid, but three resource-management issues in workspace.ts, sandbox.ts, and checkpoint.ts need attention before merge:

  • workspace.ts: A setBucketTtl failure is silently swallowed — the function returns success with no indication TTL was never applied. Callers expecting data auto-expiry will be silently misconfigured.
  • workspace.ts / sandbox.ts: createAccessKey errors are not checked; credentials are silently omitted from the returned object with no error signal.
  • sandbox.ts: When fork creation fails mid-loop, already-created fork buckets and IAM keys are abandoned without cleanup, leaking resources.

Confidence Score: 4/5

Do not merge until the three P1 error-handling gaps are fixed — they silently leak resources and return incorrect data to callers.

Three P1 findings: TTL failure swallowed, credential failure swallowed (in both workspace and sandbox), and orphaned fork buckets on partial failure. The rest of the package is well-structured.

packages/ai/src/workspace.ts and packages/ai/src/sandbox.ts require the most attention; packages/ai/src/checkpoint.ts has one smaller P1 fix needed.

Important Files Changed

Filename Overview
packages/ai/src/sandbox.ts New file: createSandbox has two issues — partial fork failures leak already-created buckets/keys, and credential creation errors are silently swallowed.
packages/ai/src/workspace.ts New file: TTL configuration failure is silently swallowed (success returned without TTL), and credential creation failure is silently dropped with no error signal.
packages/ai/src/checkpoint.ts New file: listCheckpoints maps missing snapshot versions to empty string, which will cause silent failures if passed to restore(); otherwise correct.
packages/ai/src/coordination.ts New file: clean thin wrapper around setBucketNotifications with proper error handling; no issues found.
packages/ai/test/integration.test.ts New file: 10 integration tests covering all four workflows; uses skipIf guard for missing credentials and cleans up resources in afterEach.

Reviews (1): Last reviewed commit: "refactor(ai): promote primary args to po..." | Re-trigger Greptile

Comment thread packages/agent-kit/src/workspace.ts
Comment thread packages/agent-kit/src/workspace.ts
Comment thread packages/agent-kit/src/sandbox.ts
Comment thread packages/agent-kit/src/checkpoint.ts Outdated
Comment thread packages/agent-kit/src/workspace.ts
@designcode designcode changed the title feat(ai): add @tigrisdata/ai composition library feat(agent-kit): add @tigrisdata/agent-kit composition library Apr 16, 2026
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

There are 3 total unresolved issues (including 1 from previous review).

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit afb645c. Configure here.

Comment thread packages/agent-kit/src/workspace.ts
Comment thread package-lock.json Outdated
designcode and others added 11 commits April 17, 2026 11:03
Composed workflows for AI agents on Tigris — sandboxes, workspaces,
checkpoints, and coordination. Composes @tigrisdata/storage and
@tigrisdata/iam into higher-level operations mapped to documented
AI use cases.

- createSandbox / teardownSandbox — snapshot, fork N times, scoped credentials
- createWorkspace / teardownWorkspace — bucket + TTL + credentials
- checkpoint / restore / listCheckpoints — snapshot-based state management
- setupCoordination / teardownCoordination — bucket notification pipelines

Assisted-by: Claude Opus 4.6 via Claude Code
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Workspace: basic, TTL, snapshots, scoped credentials
- Checkpoint: create, list, restore with data verification
- Sandbox: multi-fork, scoped credentials, isolation, teardown
- Coordination: setup and teardown notifications
- Fix teardownCoordination to use empty config for clearing
- Move tests to test/ directory outside src/

Assisted-by: Claude Opus 4.6 via Claude Code
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Assisted-by: Claude Opus 4.6 via Claude Code
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Assisted-by: Claude Opus 4.6 via Claude Code
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- createSandbox(baseBucket, count, options?)
- createWorkspace(name, options?)
- setupCoordination(bucket, options)
- teardownCoordination(bucket, options?)

Consistent with underlying SDK conventions where the primary subject
is a positional parameter and optional config stays in the options object.

Updates tests, README examples, and API reference table.

Assisted-by: Claude Opus 4.6 via Claude Code
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Better reflects the package purpose — a toolkit for building with
agents, not an AI inference library.

Assisted-by: Claude Opus 4.6 via Claude Code
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Reframe descriptions to be explicit about storage isolation,
copy-on-write forks, and bucket notifications.

Assisted-by: Claude Opus 4.6 via Claude Code
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Fix TTL failure early return skipping credential creation in
  createWorkspace — continues to Step 3 regardless of TTL outcome
- Filter out snapshots with no version in listCheckpoints instead
  of producing empty snapshotId placeholders
- Add test for TTL + credentials combo to cover the early return bug
- Clean up stale packages/ai lockfile entry from rename

Assisted-by: Claude Opus 4.6 via Claude Code
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The previous lockfile was missing cross-platform optional deps
(esbuild, lightningcss) causing npm ci to fail in Linux CI.

Assisted-by: Claude Opus 4.6 via Claude Code
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@designcode designcode force-pushed the feat/ai-composition-library branch from 796a526 to 88e6170 Compare April 18, 2026 06:22
@designcode designcode merged commit 52aaa46 into main Apr 18, 2026
2 checks passed
@designcode designcode deleted the feat/ai-composition-library branch April 18, 2026 06:32
@github-actions
Copy link
Copy Markdown

🎉 This PR is included in version 0.1.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions
Copy link
Copy Markdown

🎉 This PR is included in version 3.2.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants