Commit b3a226f
feat(thenable): wasm-path thenable-resolution primitives (Closes #205)
The wasm/Node backend cannot await a host Thenable, so a
languageClientSendRequest result was unconsumable by a wasm guest
(blocking the #103 rsr-certifier pilot data path). The #199
function-value ABI now makes the host→guest re-entry expressible, so
the minimal #103 design sketch is finally buildable.
- stdlib/Vscode.affine: `thenableThen(t, on_settle: fn(Unit) -> Int)
-> Disposable / Async` and `thenableResultJson(t) -> String`.
- packages/affine-vscode/mod.js: thenableThen wraps the guest closure
via the PR-5c closure-pointer marshalling (wrapHandler) and stores
the settled value keyed by the Thenable handle; thenableResultJson
returns it JSON-encoded via the established reg(string) convention
used by every other `-> String` extern. Per-process __thenableResults
map. Rejection path stored as { __error }.
Verified: Vscode.affine typechecks; dune test --force 253/253, zero
regression; mod.js node --check clean; a consumer using both primitives
typechecks and lowers (`thenableThen(t, ((u) => 0))`).
Unblocks the rsr-certifier pilot (PR-5d-B): sendRequest rsr/getCompliance
→ thenableThen/thenableResultJson → status-bar/diagnostics/webview.
Closes #205
Refs #103, #199
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 9f8a6ed commit b3a226f
2 files changed
Lines changed: 47 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| 36 | + | |
| 37 | + | |
36 | 38 | | |
37 | 39 | | |
38 | 40 | | |
| |||
333 | 335 | | |
334 | 336 | | |
335 | 337 | | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
336 | 366 | | |
337 | 367 | | |
338 | 368 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
305 | 305 | | |
306 | 306 | | |
307 | 307 | | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
0 commit comments