Commit 8b0718d
committed
feat(sdk): expose Managed Agents operation-level APIs
Command hosts could only reach Managed Agents through the declarative
project workflows, so per-resource reads, cursor pagination, raw session
events and deployment actions had no public entry point.
- Add internal/core/managed-api-runtime.ts: cursor-preserving reads for
agents, agent versions, environments, vaults, skills (list/get/versions/
download) and files, plus session update/archive/raw-event-send and
deployment get/run/pause/unpause with run history.
- Resolve the target provider from ManagedApiTarget and fail fast with a
UserError when several providers are configured or the adapter lacks the
operation; publish per-operation capability metadata (supported/auth/
reason) so hosts can explain unsupported surfaces (model catalog, Thread
resources, MCP OAuth) without probing the API.
- Extend ProviderAdapter with the matching optional methods and implement
them on the Bailian adapter; keep the raw wire payload on `attributes`
for agent/environment/vault/skill/file DTOs.
- Support `types` and `created_at[*]` filters on event listing plus
status/created-at filters on session listing, with client-side type
filtering where the server has no support.
- Resume streamSessionEvents from `after_id` on providers without native
stream cursors by replaying paginated history and polling, de-duping by
event id and stopping on terminal session status.
- Carry `session_thread_id` through the Bailian event mapper and the event
sanitizer so child-agent threads stay attributable.
- Document the new public layers and add a minor changeset.
Tests: packages/sdk/tests/unit/bailian-managed-api.test.ts (new) and
core-session-runtime.test.ts (client-side type filter, after-id replay).1 parent 982704f commit 8b0718d
20 files changed
Lines changed: 1330 additions & 29 deletions
File tree
- .changeset
- packages/sdk
- docs
- src
- internal
- core
- providers
- bailian
- types
- tests
- unit
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
25 | 32 | | |
26 | 33 | | |
27 | 34 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
82 | | - | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
83 | 144 | | |
84 | 145 | | |
85 | 146 | | |
| |||
198 | 259 | | |
199 | 260 | | |
200 | 261 | | |
201 | | - | |
202 | | - | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
203 | 269 | | |
204 | 270 | | |
205 | 271 | | |
| |||
0 commit comments