-
Notifications
You must be signed in to change notification settings - Fork 10
fix(release): make astrid-sys cargo-publishable (unblocks v0.7.0 workspace publish) #49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,5 @@ | ||
| wit-staging/ | ||
| # wit-staging/ is committed: build.rs regenerates it from the | ||
| # `unicity-astrid/wit` submodule on workspace builds, but the | ||
| # committed copy ships with the published crate so `cargo install` | ||
| # works without the submodule on the consumer's machine. | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
73 changes: 73 additions & 0 deletions
73
astrid-sys/wit-staging/deps/astrid-approval/approval@1.0.0.wit
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,73 @@ | ||
| /// Human-in-the-loop approval for sensitive actions. | ||
| /// | ||
| /// Checks the AllowanceStore first (instant path for pre-approved | ||
| /// patterns), then publishes an ApprovalRequired IPC event and blocks | ||
| /// until the frontend user responds or the request times out (60s). | ||
| /// | ||
| /// Note: a capsule-to-capsule `astrid-bus:approval@1.0.0` package | ||
| /// exists in `interfaces/` for approval-event schemas on the IPC bus. | ||
| /// This host interface and that bus contract are distinct concerns; | ||
| /// the namespace split keeps them from colliding. | ||
| /// | ||
| /// Frozen per the ABI evolution discipline (RFC: host_abi). Shape changes | ||
| /// ship as a new file at a new version path; never edit this file. | ||
|
|
||
| package astrid:approval@1.0.0; | ||
|
|
||
| interface host { | ||
| /// Typed error returned from approval operations. | ||
| variant error-code { | ||
| /// Action or resource string failed sanitization (control | ||
| /// chars, exceeded max length, NUL bytes). | ||
| invalid-input, | ||
| /// User did not respond within 60s. | ||
| timeout, | ||
| /// AllowanceStore is temporarily unavailable. | ||
| store-unavailable, | ||
| /// Unspecific host error; detail is best-effort. | ||
| unknown(string), | ||
| } | ||
|
|
||
| /// Approval request from a capsule to the host. | ||
| /// | ||
| /// The capsule declares the action and resource. The kernel | ||
| /// classifies risk and manages approval policy — the capsule sees | ||
| /// only approved/denied. | ||
| record approval-request { | ||
| /// The action being requested (e.g. "git push"). Sanitized: | ||
| /// control chars stripped, max 256 chars. | ||
| action: string, | ||
| /// Full resource description (e.g. "git push origin main"). | ||
| /// Sanitized: max 1024 chars. | ||
| target-resource: string, | ||
| } | ||
|
|
||
| /// Decision returned by the user (or by the AllowanceStore for a | ||
| /// pre-approved pattern). | ||
| enum approval-decision { | ||
| /// Denied — capsule must not proceed. | ||
| denied, | ||
| /// Approved once. | ||
| approved, | ||
| /// Approved for the current session. | ||
| approved-session, | ||
| /// Approved permanently (stored in the AllowanceStore). | ||
| approved-always, | ||
| /// Auto-approved via an existing allowance pattern. | ||
| allowance, | ||
| } | ||
|
|
||
| /// Approval response from the host. Carries the specific decision | ||
| /// (not just approved/denied) so capsule UI can communicate WHY | ||
| /// (e.g. "stored as always-approve") for transparency. | ||
| record approval-response { | ||
| /// The specific decision class. | ||
| decision: approval-decision, | ||
| } | ||
|
|
||
| /// Request human approval for a sensitive action. | ||
| /// | ||
| /// Audit: every approval call recorded — request, response, and | ||
| /// resolution path (AllowanceStore hit vs user prompt). | ||
| request-approval: func(request: approval-request) -> result<approval-response, error-code>; | ||
| } |
78 changes: 78 additions & 0 deletions
78
astrid-sys/wit-staging/deps/astrid-elicit/elicit@1.0.0.wit
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,78 @@ | ||
| /// Interactive user input collection during lifecycle hooks. | ||
| /// | ||
| /// Only callable during `astrid-install` or `astrid-upgrade` lifecycle | ||
| /// phases. Blocks the WASM thread until the frontend (TUI/CLI) collects | ||
| /// user input and publishes a response, or the request times out (120s). | ||
| /// | ||
| /// Note: a capsule-to-capsule `astrid-bus:elicit@1.0.0` package exists | ||
| /// in `interfaces/` for elicit-event schemas on the IPC bus. This host | ||
| /// interface and that bus contract are distinct concerns; the namespace | ||
| /// split keeps them from colliding. | ||
| /// | ||
| /// Frozen per the ABI evolution discipline (RFC: host_abi). Shape changes | ||
| /// ship as a new file at a new version path; never edit this file. | ||
|
|
||
| package astrid:elicit@1.0.0; | ||
|
|
||
| interface host { | ||
| /// Typed error returned from elicit operations. | ||
| variant error-code { | ||
| /// Called outside an install/upgrade lifecycle phase. | ||
| not-in-lifecycle, | ||
| /// User did not respond within 120s. | ||
| timeout, | ||
| /// User cancelled (closed prompt, sent CTRL-C, etc.). | ||
| cancelled, | ||
| /// Input failed validation (e.g. select value not in options). | ||
| invalid-input, | ||
| /// SecretStore (keychain + KV fallback) is unavailable. | ||
| store-unavailable, | ||
| /// Unspecific host error; detail is best-effort. | ||
| unknown(string), | ||
| } | ||
|
|
||
| /// Type of input being elicited. | ||
| enum elicit-type { | ||
| /// Plain text input. | ||
| text, | ||
| /// Secret (stored in SecretStore, never returned in plaintext). | ||
| secret, | ||
| /// Single selection from `options`. | ||
| %select, | ||
| /// Multiple selections from `options` (returned as JSON array). | ||
| array, | ||
| } | ||
|
|
||
| /// Request for user input during capsule lifecycle. | ||
| record elicit-request { | ||
| /// Input type. | ||
| kind: elicit-type, | ||
| /// Key for storing the collected value. | ||
| key: string, | ||
| /// Human-readable prompt description. | ||
| description: string, | ||
| /// Options for select-type inputs. | ||
| options: option<list<string>>, | ||
| /// Default value. | ||
| default-value: option<string>, | ||
| } | ||
|
|
||
| /// Response from an elicit call. | ||
| variant elicit-response { | ||
| /// Single text/select value. | ||
| value(string), | ||
| /// Multiple values (from `array` type). | ||
| values(list<string>), | ||
| /// Secret stored in SecretStore; value not returned. | ||
| secret-stored, | ||
| } | ||
|
|
||
| /// Prompt the user for input. | ||
| /// Audit: every elicit call recorded. | ||
| elicit: func(request: elicit-request) -> result<elicit-response, error-code>; | ||
|
|
||
| /// Check whether a secret key has been stored for this capsule. | ||
| /// Uses the SecretStore abstraction (OS keychain with KV fallback). | ||
| /// Audit: not recorded (read-only). | ||
| has-secret: func(key: string) -> result<bool, error-code>; | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.