Files
callstack__agent-device/docs/node-client-result-types.md
devin-ai-integration[bot] 0a8ea3a57b refactor: consolidate architecture ownership and client results (#1210)
* refactor: consolidate architecture ownership and client results

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix: keep selector parse chunk grouping current

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix: update moved architecture breadcrumbs

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix: enforce moved selector architecture

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix: keep selector guarantee ownership current

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* docs: update selector ownership references

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

---------

Co-authored-by: Michał Pierzchała <thymikee@gmail.com>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-07-11 09:40:24 +02:00

1.4 KiB

Node client result types

The 0.20 minor line intentionally narrows public TypeScript return types when a command has an accurate, closed daemon result contract. Runtime payloads are unchanged. This is source-compatible for callers that only read real response fields, but TypeScript code that indexed arbitrary keys from the former Record<string, unknown> result must switch to the declared fields or explicitly narrow an external payload at its own trust boundary.

The closed-result batch covers:

  • command.doctor
  • capture.diff (kind: 'snapshot')
  • replay.run
  • replay.test
  • recording.record
  • recording.trace

Their canonical result types live in src/contracts, feed CommandResultMap, and have matching MCP output schemas.

The remaining broad methods are deliberate:

  • command.alert and command.reactNative spread platform/interaction-specific data.
  • The interaction family (click through find) needs one public response projection reconciled with settle/evidence and fast-path additions before its existing runtime contracts are safe as public return types.
  • Observability (perf, logs, events, network, audio) is action- and backend-dependent.
  • settings.update spreads backend-specific setting data.

Those methods remain CommandRequestResult until their producers expose accurate closed public contracts. Do not narrow them with casts, compatibility aliases, or invented partial shapes.