Skip to content
Beskid Platform specification

Beskid

Jump to a Beskid service

Beskid

Jump to a Beskid service

Contracts and edge cases

Platform spec article

Contracts and edge cases

Spec standingStandard

Owner
Piotr Mikstacki
Submitter
Piotr Mikstacki

Testable rules for pckgClient, registry auth, CLI mutations, and Packages view commands.

SettingTypeDefaultRule
beskid.pckg.baseUrlstringhttp://localhost:5000Must be absolute HTTP(S) URL without trailing slash normalization issues
beskid.pckg.apiKeystring (secret)emptyStored via SecretStorage; must not sync to global settings
IDRule
A-01When beskid.pckg.apiKey is set, createPckgFetch must send Authorization: Bearer <token> on every registry request.
A-02Auth scheme must match pckg ApiKeyAuthentication (Bearer).
A-03On HTTP 401/403, panel must show actionable error (“Configure API key in Beskid: Package Registry API Key”).
A-04Missing API key on private registry must not throw unhandled exceptions; tree shows error node.
A-05Command beskid.packages.configureApiKey must prompt for a key and persist it via SecretStorage (beskid.pckg.apiKey secret id).
A-06Registry connection state must be read from LSP beskid.pckg.getConnectionStatus first; the client passes authConfigured (boolean only). API keys must not be stored or logged by the language server.
A-07After storing an API key, beskid.packages.configureApiKey must call LSP beskid.pckg.validateConnection with the key in command args (one-shot); secrets remain in VS Code SecretStorage.
CommandArguments (JSON object)Response
beskid.pckg.getConnectionStatus{ workspaceUri?: string, authConfigured: boolean }{ baseUrl, registryName?, workspaceDefaultRegistryUrl?, workspaceDefaultRegistryName?, authConfigured, validation: { status, message? }, connected }
beskid.pckg.setRegistry{ baseUrl: string, registryName?: string }none
beskid.pckg.validateConnection{ baseUrl?: string, workspaceUri?: string, apiKey?: string }{ ok, error?, validation: { status, message? } }apiKey is never echoed or logged

status is unknown, ok, or error. connected is true when validation is ok and auth requirements are satisfied (authConfigured when the registry returns 401/403 without a key).

IDRule
S-01Must call GET /api/search with query params q (required) and limit (default 20, max 50).
S-02Must return typed PackageSearchResponse[] (array of hits).
S-03Must cache responses ~30 seconds per (registryBaseUrl, q, limit).
S-04Must debounce user input ≥300ms before network.
IDRule
D-01Must call GET /api/packages/{name} where {name} is URL-encoded package id.
D-02Must map versions[], dependencies[], readme, health, latestVersion from response.
D-03Yanked versions (isYanked: true) must render with warning in tree.
IDRule
L-01ThisProject children must come only from beskid.getProjectDependencies for focusedProjectUri.
L-02Each row must show name, effective version (locked.resolvedVersion or declared descriptor), source, registry.
L-03Tooltip should include materializedRoot when present in locked entries.
L-04Context menu: Open manifest, Open materialized folder, Copy name@version.
CommandRule
beskid.packages.fetchMust run beskid fetch with cwd = focused project directory via shared CLI runner
beskid.packages.lockMust run beskid lock likewise
beskid.packages.addDependencyMust prompt for name and version; apply via CLI subcommand when available, else structured Project.proj dependency entry + refreshWorkspace
beskid.packages.refreshMust clear pckgClient caches and refresh tree
beskid.packages.configureApiKeyMust prompt, store registry API key in SecretStorage, validate via beskid.pckg.validateConnection, then refresh; subsequent search/details must use Bearer auth
beskid.packages.openRegistryUriMust open browser URL from buildRegistryPackageUrl
beskid.packages.openManifestMust open focused Project.proj for a local dependency row
beskid.packages.openMaterializedFolderMust reveal materialized package path when materializedPath is present
beskid.packages.copyDependencyLabelMust copy name@version label for local dependency rows
ScenarioExpected behavior
Offline / DNS failureRegistry section error node; retry action
Empty search queryNo network; show inline “Enter a search term”
No Project.lockThisProject shows declared only; badge “not locked” on rows
Focus clearedThisProject shows select-project message
Concurrent fetch + searchStatus bar shows dominant phase; both complete independently