Skip to content

feat(platform): restore ./platform export (0.70.1)#352

Merged
drewstone merged 1 commit into
mainfrom
chore/restore-platform-export
Jun 21, 2026
Merged

feat(platform): restore ./platform export (0.70.1)#352
drewstone merged 1 commit into
mainfrom
chore/restore-platform-export

Conversation

@drewstone

Copy link
Copy Markdown
Contributor

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.

…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 drewstone merged commit 0444d17 into main Jun 21, 2026
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.
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.

1 participant