Cloud|

@k2b/cloud

Cloud resource picker

Choose a permission-filtered Cloud resource through Universal Search and keep its stable reference.

openCloudResourcePicker@k2b/cloud/browser/resource-picker

Backend-required resource selection through the authenticated Universal Search catalog.

Real search providers and permissions required

The picker discovers live applications through the authenticated Universal Search route. The catalog shows its public contract without inventing resources or implying that a selection is authorized without the owning provider.

TSX

Copy
import { openCloudResourcePicker } from "@k2b/cloud/browser/resource-picker";
const selected = await openCloudResourcePicker({
title: "Add Cloud reference",
excludeRefs: currentReferences,
requireReader: true,
});
if (selected) {
await saveReference(selected.ref, selected.title);
}

The Cloud resource picker lets a user choose one permission-filtered Universal Search result and returns the result with its stable CloudResourceRef. The application decides what the selection means and how to persist it.

Use the Cloud resource picker

Use the picker when a browser interaction needs a reference to a resource owned by any searchable Cloud application. Use requireReader when the consumer must later resolve the selected ref through its canonical reader. Use initialAppId to start within one application and excludeRefs to prevent duplicate selections.

Do not use it for application-local exhaustive browsing or as an authorization check. The owning search provider authorizes every result, and the consuming service must still authorize later reads or mutations.

Import

ts
import { openCloudResourcePicker } from "@k2b/cloud/browser/resource-picker";

Selection ownership

The picker owns its dialog, search input, app filter, tags, loading and error states, and result selection. It returns the selected search item or undefined when the dialog closes without a selection.

Store selected.ref as the durable identity. Treat the returned title, preview, metadata, and links as presentation data that may change.

Available options are:

  • title and placeholder for task-specific copy;
  • initialAppId to preselect one searchable application;
  • excludeRefs to hide resources already selected;
  • requireReader to show only Types with a canonical reader.

Accessibility

The dialog provides its title as its accessible name, moves focus into the search interaction, and supports closing with Escape. Search results and app filtering are keyboard operable. Use a task-specific title when the surrounding workflow needs more context than “Choose Cloud resource.”

Runtime

Call the picker from browser code. It uses the authenticated /api/search route and discovers the current application catalog from the running Cloud installation. Search providers remain responsible for permission-filtering every result. requireReader filters capabilities; it does not grant access or replace authorization.

Example

ts
const selected = await openCloudResourcePicker({
  title: "Add Cloud reference",
  excludeRefs: currentReferences,
  requireReader: true,
});

if (selected) {
  await saveReference(selected.ref, selected.title);
}

See Universal Search for provider registration, resource refs, tags, readers, and authorization.

Connect a coding agent

The Cloud skill provides compact working instructions. MCP supplies exact current documentation when details matter.

CLI command
bunx skills add https://docs.example.com

This command installs the working instructions published by this website in the selected coding agent.

For exact, current details, also connect the MCP server through one of the agent tabs.

Installation uses the open-source Vercel Skills CLI.

The skill and MCP complement each other: the skill describes workflows, while MCP supplies current documentation.