feat: add the stacflow SDK and move flow_ui into a pub workspace - #45
Open
divyanshub024 wants to merge 4 commits into
Open
divyanshub024 wants to merge 4 commits into
divyanshub024 wants to merge 4 commits into
Conversation
flow_ui moves unchanged to packages/flow_ui; the repo root becomes the pub workspace with melos scripts, and stacflow lives beside it as packages/stacflow so the two version in lockstep. The SDK re-exports flow_ui and adds Gemini, OpenAI and Claude adapters behind one transport seam, a client-side tool loop with read, write and destructive permissions, and the wire contract under contracts/ with its codegen. Provider call ids ride inside the tc_ tool-call ids, so tools land without a contract change.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
There are 3 total unresolved issues (including 2 from previous reviews).
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit d7baba2. Configure here.
…he local-mode launch The first release is stacflow without a gateway, so the contract folder becomes the SDK's own spec: the REST spec, the cloud-only error codes, the ui_payload event, the A2UI stub, the contracts lock and the mirror script into stacflow-cloud go. The stacflow docs-site pages come back with the site work later; the README carries the platform entries a host needs in the meantime.
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.

Summary
Turns the repo into a Dart pub workspace and adds the StacFlow SDK beside flow_ui.
packages/flow_uiis the published package, moved as-is. Every file underlib/is a pure rename; no widget changes.packages/stacflowis the SDK:StacFlowChat, the controller, andStacFlowChatView, the ready-made screen on flow_ui. Gemini, OpenAI and Claude adapters run natively with the developer's own key behind oneTurnTransportseam, with streaming, stop, retry, regenerate, edit and resend, image attachments, copy, feedback and a model selector. The key is a private field set on exactly one header and never appears in URLs, logs or errors.Toolwithread,writeanddestructivepermissions, a confirmation card for gated calls,runToolLoop(dispatch, approval, timeouts, abort, continuation segments, a rounds cap), and the tool card in the thread withtoolBodyBuilderfor custom result bodies. Calls and results replay to the model in later turns on all three providers; Claude thinking blocks and Gemini signatures replay within a turn. Provider call ids ride inside thetc_ids, socontracts/is unchanged by tools.contracts/holds the wire contract (SSE events, error codes) withtool/contracts_gen.dartgeneratingpackages/stacflow/lib/src/generatedand CI failing on drift.set_themetool, andCLAUDE.md/AGENTS.mdfor the workspace conventions.pubspec.yamlcarries the melos scripts;playgroundandpackages/stacflowdepend onflow_ui: ^0.4.0.Releases stay per package:
flow_ui-v*andstacflow-v*tags. stacflow keepspublish_to: noneuntil the 0.1.0 tag; the version bump is a follow-up.Screenshots
Nothing in flow_ui renders differently; every
lib/file is a pure move. The SDK's view composes existing flow_ui components (thread, composer, tool and confirmation cards).How this was verified
dart run melos run analyzeclean in all five members;dart format --set-exit-if-changed .clean.packages/stacflow/tool/smoke.dart) against Claude withTOOLS=true, includingTOOL_PERMISSION=destructiveandDECLINE=true.set_themetool).Checklist
dart run melos run analyzeis cleandart run melos run formatapplieddependencies:inpackages/flow_ui/pubspec.yamlis flutter.dev-published, forces no configuration on hosts that never use the feature, and is argued in this PR (none added)packages/stacflow, enforced by the CI greppackages/flow_ui/lib/flow_ui.dartand documented indocs/and the README table (no new flow_ui API; stacflow's API is exported fromlib/stacflow.dartand documented in its README; the docs site pages come later)packages/flow_ui/CHANGELOG.mdupdated for user-facing changes, with breaking changes called out (no flow_ui changes in this PR; the stacflow CHANGELOG carries 0.1.0)feat:,fix:,refactor:,docs:,chore:)Note
Medium Risk
Large repo and release-process change affects every contributor; the new stacflow package adds provider HTTP and API-key handling on the critical path even though flow_ui itself is only moved.
Overview
Restructures the repository into a Dart pub workspace (melos scripts at the root) and moves the published
flow_uipackage topackages/flow_ui/at 0.4.0, with the root README trimmed to a workspace index.flow_ui’slib/is described as a pure relocation—no component API changes in this PR.Adds
packages/stacflow, the StacFlow SDK on top of flow_ui:StacFlowChat/StacFlowChatView, Gemini/OpenAI/Anthropic providers behind a shared transport, streaming chat UX, and a client tool loop (permissions, confirmations, replay).contracts/plustool/contracts_gen.dartdefine the SSE wire protocol and generatepackages/stacflow/lib/src/generated; CI enforces flow_ui ↛ stacflow and generated-code drift.CI and releases switch to
dart run melos run analyze|test, build all three Flutter apps (including the new stacflow example), and per-package tags (flow_ui-v*,stacflow-v*) for pub publish. Examples now take API keys via--dart-define/ gitignored env files instead of committed stubs.Reviewed by Cursor Bugbot for commit 3550809. Bugbot is set up for automated code reviews on this repo. Configure here.