Skip to content

feat(sdk): add capabilities.enumerate for sys enumerate-capabilities#16

Merged
joshuajbouw merged 1 commit into
feat/process-persistent-sdkfrom
feat/sys-enumerate-sdk
Jun 7, 2026
Merged

feat(sdk): add capabilities.enumerate for sys enumerate-capabilities#16
joshuajbouw merged 1 commit into
feat/process-persistent-sdkfrom
feat/sys-enumerate-sdk

Conversation

@joshuajbouw

Copy link
Copy Markdown
Contributor

What

Adds capabilities.enumerate() to @unicity-astrid/sdk — the ergonomic wrapper for astrid:sys/host.enumerate-capabilities (astrid-runtime/wit#13, merged), mirroring the Rust SDK capabilities::enumerate.

It is the infallible list dual of capabilities.check: returns the calling capsule's own held capability names — the categories declared in its [capabilities] manifest block (host_process, net_connect, fs_read, …), not the scoped arguments within them. Argument-free, returns string[] with no error path (an empty array is the valid "no capabilities" answer).

Hand-adds the ambient enumerateCapabilities(): string[] host declaration in wit-imports.d.ts and bumps the contracts submodule to the merged 9742f80 so astrid-build's CANONICAL_WIT_DIR (contracts/host) declares the import for downstream componentization. The astrid:contracts events bundle is unchanged.

Stacking

Stacked on feat/process-persistent-sdk (#14) — base is that branch, so the diff shows only the enumerate delta. Rebase onto main and retarget once #14 lands.

Verify

tsc -b typecheck green; capabilities.enumerate is exported via export * as capabilities.

Wraps astrid:sys/host.enumerate-capabilities (astrid-runtime/wit#13) as the
infallible list dual of capabilities.check: returns the calling capsule's own
held capability names — the categories declared in its [capabilities] manifest
block (host_process, net_connect, fs_read, …), not the scoped arguments within
them. Argument-free, returns string[] with no error path (an empty array is the
valid no-capabilities answer). Hand-adds the ambient host type in
wit-imports.d.ts and bumps the contracts submodule so astrid-build's host WIT
declares the import. The astrid:contracts events bundle is unchanged.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces the capabilities.enumerate function to the SDK, allowing a capsule to list its own held capability names by calling enumerateCapabilities from the host. The contracts submodule has been bumped and the CHANGELOG updated accordingly. The reviewer suggested caching the result of enumerate() to avoid redundant guest-host boundary crossings, as a capsule's capabilities are static and do not change during its lifetime.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread packages/astrid-sdk/src/capabilities.ts
@joshuajbouw
joshuajbouw merged commit e43f4d3 into feat/process-persistent-sdk Jun 7, 2026
@joshuajbouw
joshuajbouw deleted the feat/sys-enumerate-sdk branch June 7, 2026 00:53
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