Skip to content

Feat/agents sdk#222

Open
manapard wants to merge 2 commits intocallstackincubator:mainfrom
manapard:feat/agents-sdk
Open

Feat/agents sdk#222
manapard wants to merge 2 commits intocallstackincubator:mainfrom
manapard:feat/agents-sdk

Conversation

@manapard
Copy link
Copy Markdown

@manapard manapard commented Apr 9, 2026

Description

This PR expands Rozenite for Agents from a CLI-only workflow into a reusable SDK and shared agent platform, while also shipping a new SQLite plugin and improving web support/docs.

What’s included

Agent SDK and agent platform refactor

  • adds the first public @rozenite/agent-sdk package for programmatic Rozenite agent workflows
  • exposes:
    • createAgentClient()
    • client.withSession(...)
    • client.openSession()
    • client.attachSession()
    • session.domains.* and session.tools.*
    • low-level HTTP transport via @rozenite/agent-sdk/transport
  • refactors the existing rozenite agent CLI to use the SDK internally
  • moves reusable agent logic out of the CLI into shared packages and middleware-backed HTTP routes
  • keeps support for:
    • static + runtime domain discovery
    • domain/tool resolution
    • optional auto-pagination for paged tools

Typed agent tool contracts

  • adds shared typed tool contract/descriptor helpers in @rozenite/agent-shared
  • updates @rozenite/agent-bridge so tool handler args/results can be inferred from typed contracts
  • adds plugin ./sdk entrypoints for typed tool descriptors, including @rozenite/storage-plugin/sdk
  • updates the build pipeline to emit clean per-target SDK declaration bundles

@manapard manapard marked this pull request as ready for review April 9, 2026 12:13
Comment thread packages/agent-sdk/src/types.ts Outdated
Comment thread packages/agent-sdk/package.json Outdated
@V3RON
Copy link
Copy Markdown
Contributor

V3RON commented Apr 10, 2026

1. High: packages/agent-sdk/src/pagination.ts:88-100,128-129
   maxItems is not enforced on the first page.
   The helper seeds merged.items with all of initial.items before any truncation logic runs, and only trims subsequent pages. If the first response already exceeds maxItems, the SDK returns too many items.
   Validation:
   packages/middleware/src/agent/runtime/pagination/paginate.ts:81-89 and packages/network-activity-plugin/src/react-native/agent/state.ts:199-205 show paged tools may legitimately return up to the requested page limit on page 1, so the SDK must enforce its own client-side cap consistently.
   Test gap:
   packages/agent-sdk/src/__tests__/pagination.test.ts:50-77 only covers truncation after fetching page 2, not an oversized first page.
   
2. Medium: packages/agent-sdk/src/pagination.ts:117-124
   hasMore can become incorrect when maxItems truncates the merged result.
   After truncating, the code unconditionally sets merged.page.hasMore = true. If the last fetched page actually had hasMore: false and no nextCursor, the SDK returns pagination metadata that implies another page exists when it does not.
   Validation:
   The shared pagination contract in packages/middleware/src/agent/runtime/pagination/types.ts:9-20 and implementation in packages/middleware/src/agent/runtime/pagination/paginate.ts:69-89 show hasMore and nextCursor are coupled server facts. Fabricating hasMore: true client-side can produce an impossible state.
   Test gap:
   No test covers truncation on a terminal page.

@manapard manapard force-pushed the feat/agents-sdk branch 2 times, most recently from 063eed6 to 28102b6 Compare April 16, 2026 09:39
Comment thread packages/cli/skills/rozenite-agent-sdk/agents/openai.yaml Outdated
Comment thread packages/cli/skills/rozenite-agent-sdk/SKILL.md Outdated
Comment thread packages/cli/skills/rozenite-agent-sdk/SKILL.md Outdated
Comment thread packages/cli/skills/rozenite-agent-sdk/SKILL.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants