Repository navigation
feat: client.agent - build with the pre.dev agent from code (Node + Python, 1.2.0) + tag-triggered release workflow - #2
Merged
Conversation
Mechanical only: ruff 0.16.5 --fix + format (the changed-files gate enforces it on any touched file). `from __future__ import annotations` keeps the rewritten `X | None` annotations valid on Python 3.8/3.9 (setup.py python_requires >=3.8). The two findings ruff cannot fix are handled by hand: the upload file handle is closed by requests (noqa SIM115), and the JSON error-body parse catches ValueError instead of Exception. Unused exception imports dropped (still exported from predev_api/__init__.py). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PwA31qPkrcHj7kogbsmWS4
…am, build next/all, status, stop); 1.2.0
Both SDKs get an `agent` namespace over the new Agent API
(/agent/projects/...):
- Node: createProject, send, stream (async generator), buildNext,
buildAll, status, stop; typed events and results
- Python: create_project, send, stream (iterator), build_next,
build_all, status, stop
stream() parses SSE, skips heartbeats, ends after `done` by default, and
reconnects from the last `cursor` event when the connection drops.
Errors map to the existing typed exceptions ({ error, code } bodies).
Tests mock HTTP (vitest 7, pytest 11). README sections in both packages.
Version 1.2.0 (not published).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PwA31qPkrcHj7kogbsmWS4
Pushing `vX.Y.Z` checks the tag matches package.json, setup.py and __init__.py, runs make check, then publishes predev-api to npm (with provenance, NPM_TOKEN) and PyPI (PYPI_API_TOKEN). Documented under Releasing in the root README. scripts/deploy.sh stays for manual releases. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PwA31qPkrcHj7kogbsmWS4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
An
agentnamespace in both SDKs over the new Agent API (backend: arjunpredev/predev-app#2671).agent.createProject({prompt, mode?, model?, idempotencyKey?})agent.create_project(prompt, mode=, model=, idempotency_key=)POST /agent/projectsagent.send(id, {message, sessionId?, mode?, model?})agent.send(id, message, session_id=, mode=, model=)POST /agent/projects/:id/messagesagent.stream(id, {sessionId?, cursor?, untilDone?, maxReconnects?, signal?})(async generator)agent.stream(id, session_id=, cursor=, until_done=, max_reconnects=)(iterator)GET /agent/projects/:id/events(SSE)agent.buildNext(id, {task?, sessionId?, maxCredits?})agent.build_next(id, task=, session_id=, max_credits=)POST /agent/projects/:id/buildagent.buildAll(id, {maxCredits?})agent.build_all(id, max_credits=)all: trueagent.status(id, {sessionId?})agent.status(id, session_id=)GET /agent/projects/:id/statusagent.stop(id, {sessionId?})agent.stop(id, session_id=)POST /agent/projects/:id/stopstreamparses SSE, skips heartbeats, ends afterdoneby default, and reconnects from the lastcursorevent when the connection drops.{ error, code }bodies →RateLimitError,InsufficientCreditsError, ...).__init__.py. Not published.Release workflow
.github/workflows/release.ymlruns on a pushedv*tag. It checks that the tag matches all three versions, runsmake check, then publishes to npm (--provenance,NPM_TOKEN) and PyPI (PYPI_API_TOKEN). Both secrets need adding to the repo before the first tag. No tag pushed.scripts/deploy.shis unchanged.Note on the python diff
Touching
client.pymakes the changed-files ruff gate apply to the whole file. A separatestyle(python)commit makes it ruff-clean (autofix + format, mechanical). It addsfrom __future__ import annotationsso the rewrittenX | Noneannotations still work on 3.8/3.9 (python_requires >=3.8). Tests pass on 3.9 and on uv's default.Tests
make check: ruff clean on changed files; pytest 35 passed (11 new intests/test_agent.py)predev-api-node:npx vitest run32 passed (7 new insrc/agent.test.ts);npx tsc --noEmitclean🤖 Generated with Claude Code
https://claude.ai/code/session_01PwA31qPkrcHj7kogbsmWS4