Salambo
Browse documentation
Extension referenceHosted Pi compatibility profile

Hosted Pi compatibility profile

The versioned Pi 0.83 extension surface targeted by Salambo's hosted runtime.

View Markdown

This page describes the canonical pi-0.83-hosted-v1 target contract. It is the shared source for Depot validation, CLI diagnostics, sandbox behavior, and public compatibility documentation.

This profile is the authoritative hosted extension contract. The acceptance suite verifies its server-safe APIs, lifecycle hooks, TypeScript build path, multiple-extension composition, cancellation, and durable follow-up behavior.

Status meanings

StatusMeaning
SupportedBehavior matches upstream Pi.
Hosted semanticsThe capability is available through a documented server-safe behavior.
Local onlyThe capability belongs to the interactive Pi client and is accepted only for local use.
UnsupportedDeployment must reject the capability with a stable diagnostic.

Extension API

CapabilityStatusHosted behaviorOwner
onHosted semanticsRegisters lifecycle handlers on the session-scoped extension host.SAL-377
registerToolHosted semanticsRegisters a sandbox-owned tool that the worker invokes through the authenticated sidecar boundary.SAL-377
registerCommandLocal onlySlash commands require an interactive Pi command surface that hosted entry points do not expose.Profile
registerShortcutLocal onlyKeyboard shortcuts belong to the interactive terminal client.Profile
registerFlagLocal onlyCLI flags belong to a local Pi process and are not part of a deployed agent version.Profile
getFlagLocal onlyHosted deployments do not expose local Pi CLI flags.Profile
registerMessageRendererLocal onlyTerminal message rendering does not affect API, Slack, or Teams output.Profile
registerEntryRendererLocal onlySession-entry rendering belongs to the interactive terminal client.Profile
sendMessageHosted semanticsPersists non-triggering custom messages through the worker action protocol. Live custom-message steer and follow-up remain unavailable in pi-agent-core.SAL-380
sendUserMessageHosted semanticsQueues a user message through the worker-owned session action protocol.SAL-380
appendEntryHosted semanticsAppends a JSON-safe custom session entry through worker-owned persistence.SAL-380
setSessionNameHosted semanticsUpdates the durable hosted session name through a worker action.SAL-380
getSessionNameHosted semanticsReads the current durable hosted session name from the session projection.SAL-380
setLabelUnsupportedEntry labels remain disabled until Salambo exposes session-tree navigation.Profile
execHosted semanticsRuns commands inside the customer sandbox with platform cancellation and filesystem policy.SAL-377
getActiveToolsHosted semanticsReads the active tool set for the current hosted session.SAL-377
getAllToolsHosted semanticsReads built-in and extension tool metadata without exposing worker internals.SAL-377
setActiveToolsHosted semanticsChanges and persists the active tool set through the worker-owned session state.SAL-380
getCommandsLocal onlyHosted entry points do not expose the interactive Pi command catalogue.Profile
setModelHosted semanticsSelects an allowed deployment model and persists it for durable follow-up turns.SAL-382
getThinkingLevelHosted semanticsReads the current hosted-session thinking level.SAL-382
setThinkingLevelHosted semanticsSelects a supported thinking level and persists it for durable follow-up turns.SAL-382
registerProviderHosted semanticsRegisters declarative provider metadata; executable provider code cannot cross into the worker.SAL-382
unregisterProviderHosted semanticsRemoves a session-scoped declarative provider registration.SAL-382
eventsHosted semanticsProvides a session-scoped event bus with deterministic registration order.SAL-377

Lifecycle events

CapabilityStatusHosted behaviorOwner
project_trustLocal onlyDeployment approval is the hosted trust decision; extensions do not prompt at session start.Profile
resources_discoverHosted semanticsAdds artifact-contained skill and prompt paths; themes remain inactive without a TUI.SAL-379
session_startHosted semanticsRuns after a hosted session starts, resumes, reloads, or forks.SAL-379
session_info_changedHosted semanticsRuns after durable hosted session metadata changes.SAL-380
session_before_switchLocal onlyHosted entry points do not expose arbitrary session-file switching.Profile
session_before_forkLocal onlyHosted entry points do not expose interactive session forking.Profile
session_before_compactHosted semanticsCan cancel or customize compaction before the worker commits the result.SAL-379
session_compactHosted semanticsRuns after a hosted compaction result is committed.SAL-379
session_shutdownHosted semanticsRuns during bounded sidecar shutdown and sandbox cleanup.SAL-379
session_before_treeUnsupportedSession-tree navigation is not part of the hosted product.Profile
session_treeUnsupportedSession-tree navigation is not part of the hosted product.Profile
contextHosted semanticsTransforms the JSON-safe model context before a provider turn.SAL-377
before_provider_requestHosted semanticsTransforms the provider request body before the trusted provider client sends it.SAL-382
before_provider_headersHosted semanticsTransforms allowed provider headers without exposing sealed credentials.SAL-382
after_provider_responseHosted semanticsObserves sanitized provider response metadata after a request.SAL-382
before_agent_startHosted semanticsCan add context and adjust model or tools before the agent starts.SAL-377
agent_startHosted semanticsRuns when the hosted agent loop starts.SAL-379
agent_endHosted semanticsRuns when the hosted agent loop ends.SAL-379
agent_settledHosted semanticsRuns after the agent and queued messages settle.SAL-379
turn_startHosted semanticsRuns when a hosted model turn starts.SAL-379
turn_endHosted semanticsRuns when a hosted model turn ends.SAL-379
message_startHosted semanticsRuns when a streamed message starts.SAL-379
message_updateHosted semanticsRuns for streamed message updates with bounded transport payloads.SAL-381
message_endHosted semanticsRuns when a streamed message completes.SAL-381
tool_execution_startHosted semanticsRuns before a tool executes.SAL-379
tool_execution_updateHosted semanticsRuns for bounded tool progress updates.SAL-381
tool_execution_endHosted semanticsRuns after a tool completes or fails.SAL-379
model_selectHosted semanticsRuns after the hosted session selects a model.SAL-379
thinking_level_selectHosted semanticsRuns after the hosted session selects a thinking level.SAL-379
tool_callHosted semanticsCan block or rewrite a tool call before sandbox execution.SAL-377
tool_resultHosted semanticsCan transform a JSON-safe tool result before it returns to the model.SAL-377
user_bashLocal onlyThis event represents a command entered by a person in the local Pi terminal.Profile
inputHosted semanticsCan transform or handle input received from an authenticated hosted entry point.SAL-379

Extension context

CapabilityStatusHosted behaviorOwner
uiHosted semanticsExposes the non-interactive UI profile defined below; hasUI remains false.SAL-377
modeHosted semanticsAlways reports json in the hosted runtime.SAL-377
hasUIHosted semanticsAlways reports false in the hosted runtime.SAL-377
cwdSupportedPoints to the customer workspace inside the sandbox.Profile
sessionManagerHosted semanticsProvides a read-only hosted session projection without storage authority.SAL-378
modelRegistryHosted semanticsExposes allowed model metadata without provider credentials or mutation authority.SAL-378
modelHosted semanticsExposes the selected model metadata without provider credentials.SAL-378
scopedModelsHosted semanticsExposes the deployment model allowlist as a read-only snapshot.SAL-378
thinkingLevelHosted semanticsExposes the current hosted-session thinking level.SAL-378
isIdleHosted semanticsReflects the worker-owned session state.SAL-378
isProjectTrustedHosted semanticsReturns true only after deployment admission approves the immutable artifact.SAL-375
signalHosted semanticsCarries run cancellation into sandbox extension handlers and tools.SAL-377
abortHosted semanticsRequests cancellation through the worker instead of terminating trusted processes.SAL-380
hasPendingMessagesHosted semanticsReads worker-owned steering and follow-up queue state.SAL-378
shutdownHosted semanticsRequests bounded session shutdown through the worker.SAL-380
getContextUsageHosted semanticsReturns the sanitized usage estimate for the current hosted model context.SAL-378
compactHosted semanticsRequests durable compaction through the worker-owned lifecycle.SAL-380
getSystemPromptHosted semanticsReturns the effective prompt after hosted context projection.SAL-378

Command-only context

CapabilityStatusHosted behaviorOwner
getSystemPromptOptionsLocal onlyCommand-only prompt construction is not exposed by hosted entry points.Profile
waitForIdleLocal onlyHosted message queues replace interactive command coordination.Profile
newSessionLocal onlySession creation is controlled by Salambo entry points and APIs.Profile
forkLocal onlyInteractive session forking is not exposed by hosted entry points.Profile
navigateTreeUnsupportedSession-tree navigation is not part of the hosted product.Profile
switchSessionLocal onlyHosted entry points address conversations instead of session files.Profile
reloadLocal onlyA new immutable deployment version replaces local extension reload.Profile

UI context

CapabilityStatusHosted behaviorOwner
selectLocal onlyRequires an interactive client dialog.Profile
confirmLocal onlyRequires an interactive client dialog.Profile
inputLocal onlyRequires an interactive client dialog.Profile
notifyHosted semanticsEmits a sanitized run notification instead of drawing terminal UI.SAL-377
onTerminalInputLocal onlyRequires raw terminal input.Profile
setStatusHosted semanticsEmits a bounded run-status projection instead of updating a terminal footer.SAL-377
setWorkingMessageLocal onlyControls the interactive terminal loader.Profile
setWorkingVisibleLocal onlyControls the interactive terminal loader.Profile
setWorkingIndicatorLocal onlyControls the interactive terminal loader.Profile
setHiddenThinkingLabelLocal onlyControls interactive terminal rendering.Profile
setWidgetLocal onlyRenders an interactive terminal widget.Profile
setFooterLocal onlyRenders an interactive terminal footer.Profile
setHeaderLocal onlyRenders an interactive terminal header.Profile
setTitleLocal onlyControls the terminal window title.Profile
customLocal onlyRenders a custom interactive terminal component.Profile
pasteToEditorLocal onlyRequires the interactive terminal editor.Profile
setEditorTextLocal onlyRequires the interactive terminal editor.Profile
getEditorTextLocal onlyRequires the interactive terminal editor.Profile
editorLocal onlyRequires the interactive terminal editor.Profile
addAutocompleteProviderLocal onlyExtends the interactive terminal editor.Profile
setEditorComponentLocal onlyReplaces the interactive terminal editor.Profile
getEditorComponentLocal onlyReads the interactive terminal editor.Profile
themeLocal onlyExposes the interactive terminal theme.Profile
getAllThemesLocal onlyLists interactive terminal themes.Profile
getThemeLocal onlyReads an interactive terminal theme.Profile
setThemeLocal onlyChanges the interactive terminal theme.Profile
getToolsExpandedLocal onlyReads interactive terminal tool-output state.Profile
setToolsExpandedLocal onlyChanges interactive terminal tool-output state.Profile

Tool definition

CapabilityStatusHosted behaviorOwner
nameSupportedPreserved as the model-facing tool identifier.Profile
labelSupportedPreserved as human-readable tool metadata.Profile
descriptionSupportedPreserved in the model tool definition.Profile
promptSnippetHosted semanticsAdded to the hosted system prompt when the tool is active.SAL-377
promptGuidelinesHosted semanticsAdded to the hosted system prompt when the tool is active.SAL-377
parametersSupportedPreserves the upstream TypeBox schema.Profile
constrainedSamplingHosted semanticsForwarded only when the selected provider supports constrained sampling.SAL-377
renderShellLocal onlyControls interactive terminal rendering.Profile
prepareArgumentsHosted semanticsRuns in the sandbox before parameter validation.SAL-377
executionModeHosted semanticsControls Pi harness scheduling for parallel or sequential tool calls.SAL-377
executeHosted semanticsRuns inside the sandbox with cancellation and progress propagation.SAL-377
renderCallLocal onlyRenders a tool call in the interactive terminal.Profile
renderResultLocal onlyRenders a tool result in the interactive terminal.Profile

Package forms

CapabilityStatusHosted behaviorOwner
typescriptEntrypointHosted semanticsDepot transpiles TypeScript without applying a Salambo-specific semantic typecheck.SAL-375
javascriptEntrypointSupportedES module JavaScript entrypoints are preserved in the deployment artifact.Profile
fileEntrypointSupportedA file declared in pi.extensions becomes one extension entrypoint.Profile
directoryEntrypointHosted semanticsDepot applies upstream Pi directory discovery rules.SAL-375
globEntrypointHosted semanticsDepot expands upstream Pi glob rules in deterministic lexical order.SAL-375
multipleEntrypointsHosted semanticsDepot preserves declared order and stable ordering inside expanded globs.SAL-375
manifestDeclaredResourcesHosted semanticsDepot reads extensions, skills, prompts, and themes from the package.json pi manifest.SAL-375
conventionalResourcesHosted semanticsDepot applies upstream discovery rules when the package has no explicit pi manifest.SAL-375
resourceFiltersHosted semanticsDepot applies upstream include, exclude, force-include, and force-exclude resource filters.SAL-375
skillsSupportedPackage skill directories are copied into the immutable artifact.Profile
promptsSupportedPackage prompt directories are copied into the immutable artifact.Profile
themesLocal onlyThemes only affect the interactive Pi terminal.Profile
relativeAssetsHosted semanticsDepot preserves package-relative layout so import.meta.url resources continue to resolve.SAL-375
npmDependenciesHosted semanticsDepot resolves declared dependencies and records the exact graph in build provenance.SAL-375
bundledDependenciesHosted semanticsDepot preserves bundled package dependencies inside the immutable artifact.SAL-375
nestedPackageResourcesHosted semanticsDepot can include explicitly declared resources from bundled package dependencies.SAL-375
lockfilesHosted semanticsDepot honors a supported source lockfile and records generated resolution when no lockfile exists.SAL-375
dynamicImportsHosted semanticsArtifact-local dynamic imports are allowed when Depot can resolve and package their targets.SAL-375
remoteDynamicImportsUnsupportedRuntime downloads and remote module imports violate immutable artifact provenance.Profile
nativeModulesUnsupportedThe first profile does not run native add-ons or package lifecycle builds.Profile
lifecycleScriptsUnsupportedDepot installs third-party dependencies with lifecycle scripts disabled.Profile
commonJsEntrypointUnsupportedThe first profile accepts Pi-compatible ES module entrypoints only.Profile

Host package set

These exact packages form the Pi 0.83 profile. Extensions must not bring a second incompatible Pi runtime.

PackageVersionStatusHosted behavior
@earendil-works/pi-coding-agent0.83.0Hosted semanticsProvides the official extension API, helpers, and built-in tool definitions.
@earendil-works/pi-agent-core0.83.0SupportedProvides the official Pi agent types and message contracts.
@earendil-works/pi-ai0.83.0SupportedProvides the official Pi model and provider types.
@earendil-works/pi-tui0.83.0Hosted semanticsImports resolve for package compatibility, but TUI rendering capabilities remain local-only.
@sinclair/typebox0.34.52Hosted semanticsProvides the legacy schema import used by compatible published Pi extensions.
typebox1.3.7SupportedProvides the schema package used by Pi 0.83 tool definitions.

Build boundary

Depot owns dependency resolution, transpilation, compatibility analysis, and immutable artifact assembly. It does not execute the extension factory or package lifecycle scripts. It preserves package-relative assets and records the resolved dependency graph. Only the sandbox sidecar executes the extension factory, once per hosted session.

Salambo does not add a stricter TypeScript semantic gate. An extension can use its own compiler and type-check policy. Depot only requires code that can be deterministically assembled for the pinned hosted runtime.

Stable diagnostics

CodeSeverityMeaningNext action
hosted_pi_profile_version_unsupportederrorThe deployment requests a hosted Pi profile version that this runtime does not support.Select a profile version supported by the target environment.
hosted_pi_version_incompatibleerrorThe extension package declares a Pi version range that does not include the profile version.Use a compatible extension release or update its declared Pi peer range.
hosted_pi_capability_local_onlywarningThe extension uses a Pi capability that only works in an interactive local client.Guard the local behavior with ctx.hasUI or remove it from the hosted entrypoint.
hosted_pi_capability_unsupportederrorThe extension uses a Pi capability that this hosted profile does not support.Remove the capability or select a future profile that supports it.
hosted_pi_entrypoint_invaliderrorA declared extension entrypoint is missing, escapes the package root, or has an unsupported format.Declare a package-local TypeScript or ES module entrypoint.
hosted_pi_resource_unsupportederrorThe package declares a resource type that the hosted profile does not support.Remove the resource from the hosted package manifest.
hosted_pi_native_module_unsupportederrorThe package requires a native module that the hosted profile cannot build or load.Use a JavaScript or WebAssembly alternative.
hosted_pi_dynamic_import_unsupportederrorA dynamic import cannot be resolved into the immutable deployment artifact.Use an artifact-local import target that Depot can resolve.
hosted_pi_lifecycle_script_disablederrorThe package requires an install lifecycle script, but hosted builds disable lifecycle scripts.Publish prebuilt portable assets or remove the lifecycle dependency.
hosted_pi_dependency_resolution_failederrorDepot could not resolve a deterministic dependency graph for the extension package.Repair the package manifest or lockfile and deploy again.

Legacy Salambo hook migration

Legacy hookOfficial Pi replacementRule
before_provider_payloadbefore_provider_requestThis Salambo-only hook is not part of the official Pi profile and must migrate to before_provider_request.
model_updatemodel_selectThis Salambo-only hook is not part of the official Pi profile and must migrate to model_select.
thinking_level_updatethinking_level_selectThis Salambo-only hook is not part of the official Pi profile and must migrate to thinking_level_select.