refactor: update GitHub Actions workflow and enhance TypeScript SDK#86
Conversation
- Renamed workflow job from `detect-and-release` to `detect-release` for clarity. - Introduced separate jobs for publishing Python and TypeScript SDKs, utilizing a reusable workflow. - Updated the `create-release` job to depend on the new publishing jobs. - Enhanced TypeScript SDK with improved error handling, timeout management, and structured response handling. - Added optional `timeoutSeconds` parameter to REST and WebSocket clients for better control over request durations. - Updated peer dependencies in `package.json` to include `better-sqlite3` as optional. - Refactored environment detection logic in the client to handle undefined values more gracefully.
|
Caution Review failedThe pull request is closed. WalkthroughThis PR refactors the GitHub Actions release workflow to use reusable job patterns for SDK publishing, introduces dedicated workflows for Python and TypeScript SDK releases, updates the TypeScript SDK client with config-driven initialization supporting local agent discovery and WebSocket streaming, restructures request/response types, and adds comprehensive documentation for publishing and SDK implementation. Changes
Sequence Diagram(s)sequenceDiagram
participant User as Developer
participant Workflow as create-release.yml
participant Detector as detect-release Job
participant PythonPub as python-release.yml
participant TypeScriptPub as typescript-release.yml
participant ReleaseJob as Create GitHub Release Job
User->>Workflow: Push tag
Workflow->>Detector: Run detect-release
Detector->>Detector: Determine latest_tag, version, should_release
Detector-->>Workflow: Output (latest_tag, version, should_release)
par Python & TypeScript Publishing
Workflow->>PythonPub: Call reusable-sdk-release.yml<br/>(sdk: python, tag, version)
PythonPub->>PythonPub: Verify version match<br/>Check PyPI existence<br/>Publish if needed
Workflow->>TypeScriptPub: Call reusable-sdk-release.yml<br/>(sdk: typescript, tag, version)
TypeScriptPub->>TypeScriptPub: Verify version match<br/>Check npm existence<br/>Publish if needed
end
PythonPub-->>ReleaseJob: Complete
TypeScriptPub-->>ReleaseJob: Complete
ReleaseJob->>ReleaseJob: Create GitHub Release<br/>with standardized notes<br/>& CHANGELOG.md
ReleaseJob-->>Workflow: Release created
sequenceDiagram
participant App as Application
participant Client as RunAgentClient
participant Config as Config Resolver
participant Registry as RunAgentRegistry
participant REST as RestClient
participant WS as WebSocketClient
participant Server as RunAgent Server
App->>Client: new RunAgentClient(config)
Client->>Config: Resolve local vs remote<br/>from config + env
alt Local Mode
Config->>Registry: Initialize registry<br/>(lazy load)
Registry->>Registry: Query ~/.runagent/runagent_local.db
else Remote Mode
Config->>Config: Use environment endpoints
end
Config-->>Client: Connection details
App->>Client: run(agentId, entrypointTag, input)
Client->>Client: ensureInitialized()
Client->>REST: runAgent(agentId, entrypointTag, options)
rect rgba(100, 200, 100, 0.3)
note right of REST: POST /agents/{id}/run<br/>requestData: entrypoint_tag,<br/>input_args, input_kwargs,<br/>timeout_seconds
end
REST->>Server: HTTP POST request
Server-->>REST: ApiResponse
REST-->>Client: Result
Client-->>App: Response
App->>Client: runStream(agentId, entrypointTag, input)
rect rgba(100, 150, 200, 0.3)
note right of WS: WebSocket upgrade<br/>to /agents/{id}/run-stream<br/>with Bearer token (remote)
end
Client->>WS: Create WebSocket connection
WS->>Server: Upgrade to ws://
loop Stream messages
Server-->>WS: streamMessage<br/>(type: data|stream_completed|error)
WS->>WS: parseStreamMessage()<br/>deserializeStreamPayload()
WS-->>App: Yield payload
end
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Areas requiring extra attention:
Possibly related PRs
Poem
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (15)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
detect-and-releasetodetect-releasefor clarity.create-releasejob to depend on the new publishing jobs.timeoutSecondsparameter to REST and WebSocket clients for better control over request durations.package.jsonto includebetter-sqlite3as optional.Summary by CodeRabbit
New Features
Documentation
Chores