Secret List
SecretList: stored secrets, like API keys, as rows with their name, a SecretFingerprint (•••• abcd), a configured or missing StatusPill, created, updated and last-used dates, and Replace and Delete. The data type has no value field. Loading, empty and error come through DataState. With selectable, each row gets a checkbox (disabled with a reason per secret) and an optional tri-state select all. Agents can replace and delete by id (delete waits for a person), and select by name or id.
Example
- OpenAI API keyConfiguredSummaries and searchHidden value ending in x7QaUpdated · Created · Last used
- Stripe webhook secretConfiguredHidden value ending in 9f2cUpdated · Created · Never used
- GitHub tokenMissingOpens pull requests
- OpenAI API keyFoundFrom ~/.config/toolsHidden value ending in x7Qa
- GitHub tokenFoundFrom the system keychainHidden value ending in 9f2c
- Stripe live keyFoundHidden value ending in 41ddLive payment keys stay on this device.
Installation
Usage
A settings page of stored secrets: rows with a mask and the server's fingerprint, never a value; Replace opens your FormDialog with a sensitive Input, and Delete asks first. Each action shows only with its callback, so selectable with neither is a chooser, like keys to upload.
API reference
SecretList
| Prop | Type | Default |
|---|---|---|
aria-labelrequiredNames the list for screen readers and agents, like "API keys". | string | – |
secrets | readonly StoredSecret[] | – |
statusThe list's load state, for DataState. `success` by default. | DataStatus | – |
error | unknown | – |
onRetry | () => unknown | – |
selectableGives each secret a checkbox; agents `select(nameOrId, checked)` and `selectAll(checked)`. | boolean | – |
selectedThe selected ids, to control the selection. | readonly string[] | – |
defaultSelected | readonly string[] | – |
onSelectedChangeThe new selected ids; `details.cancel()` keeps the old ones, and an agent's step then fails with why. | (ids: string[], details: ChangeDetails<SecretListSelectionChangeReason>) => void | – |
textrequired | SecretListText<never> | SecretListReplaceText | SecretListDeleteText | – |
labels | Partial<SecretListLabels> | – |
localeThe locale of the relative dates; the page's by default. | string | – |
className | string | – |
onReplaceAsks to replace or set a secret's value, like opening a dialog with a sensitive Input. | undefined | (id: string) => unknown | – |
onDeleteDeletes a secret after the confirmation; a returned Promise keeps it pending. | undefined | (id: string) => unknown | – |
Other exports
secretListsecretListLabelstype SecretListItemtype SecretListOptionstype SecretListSelectionChangeReasontype SecretListStatetype SecretListUnselectabletype SecretListActiontype SecretListDeleteTexttype SecretListLabelstype SecretListPropstype SecretListReplaceTexttype SecretListTexttype SecretTexttype StoredSecretAccessibility
- The mask is hidden from screen readers, which hear the fingerprint instead (Hidden value ending in a1b2, overridable).
- Each row's Replace and Delete are named for the secret, and Delete opens an alert dialog before anything is removed.
- The status is a pill with a dot and its word, so it doesn't rest on colour alone.
Agent actions
Agents read the secrets as the list's items and call replace(id) and delete(id); delete opens the confirmation, whose button needs a person. With selectable, they call select(nameOrId, checked) and selectAll(checked) and read the selected names; an unknown name, a disabled secret or a list that isn't selectable fails the step with why. An unknown id fails replace and delete with why, and so does a list without onReplace or onDelete.
Runs agent.snapshot() from @ui-sdk/react/agent on the live preview above.