feat(platform): restore ./platform export (0.70.1)#352
Merged
Conversation
…face-shrink The src/platform/ clients (PlatformAuthClient cross-site SSO, PlatformHubClient /v1/hub integrations) were still present but un-exported after the subpath collapse; 5 product agents import them. Re-add the export + tsup entry. 0.70.1.
drewstone
added a commit
that referenced
this pull request
Jun 22, 2026
…on verb, cost rides through (+ docs freshness fix) (#355) * feat(delegate): generic delegate() over supervise() + delegate MCP tool Add delegate(intent, opts) — the one generic delegation verb, a thin front door over supervise(). It hands the INTENT to a default authoring supervisor (router-brained, harness null, systemPrompt = supervisorInstructions()) which AUTHORS and spawns whatever worker the intent needs over the conserved-budget pool. No hardcoded coder/researcher profile; the supervisor writes its own. Returns supervise()'s SupervisedResult unchanged, so spentTotal (iterations, tokens, usd, ms) rides straight back — the cost channel delegate_code lacks. Add the delegate MCP tool (createDelegateHandler) as the agent-facing generic replacement for delegate_code/delegate_research: it routes to delegate(), takes the supervisor substrate (router/backend/deliverable) injected at server construction (like coderDelegate), and returns the delivered output WITH its spentTotal synchronously. Purely additive — delegate_code/delegate_research/composeProductionAgentProfile/ detachedSessionDelegate/coderProfile are all untouched. Reuses supervise(), the authoring skill, the conserved-budget pool, DeliverableSpec; no hand-rolled driver, spawn loop, or equal-k. Exports: delegate/DelegateOptions/defaultDelegateBudget from runtime barrel (/loops, next to supervise); the delegate tool + types from the mcp barrel. Regenerated docs/api/ for the new symbols. * fix(delegate): no-winner carries real spentTotal + docs freshness (version pin + platform entryPoint) The no-winner variant of SupervisedResult lacked a spentTotal field even though real conserved compute is spent before a run fails — so a failed delegation reported its cost as absent (and the delegate MCP tool fabricated a zero). Add spentTotal as a required field on the no-winner variant and compute it off the same journal the winner path reads (spentFromJournal), DRY'd into one noWinner() builder over the two no-winner exit points. The delegate MCP tool now returns the real result.spentTotal on no-winner; the fabricated zeroSpend constant is removed. This is delegate()'s whole point: the cost rides back on BOTH paths. Docs freshness gate (pnpm docs:check) was red on main from #352: the canonical-api version pin read 0.70.0 while package.json is 0.70.1, and the restored ./platform export had no typedoc entryPoint. Bump the pin to 0.70.1, register src/platform/index.ts in typedoc.json, regenerate docs/api/ (adds platform.md + the new delegate symbols). Add examples/delegate/e2e-delegate-real.ts: a router-brained supervisor authors + spawns a worker (no hardcoded coder profile), the worker does real filesystem work, the deliverable gate reads disk, and result.spentTotal carries the real conserved cost on both winner and no-winner paths.
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.
0.70.0's surface-shrink (#347) dropped the ./platform export while the code stayed in src/platform/, breaking 5 product agents that import PlatformAuthClient (cross-site SSO) + PlatformHubClient (/v1/hub integrations). Re-adds the export + tsup entry, bumps to 0.70.1. Gates green: build, typecheck, lint, verify:package, test.