Skip to main content
This page documents the first experimental SDK/agent vertical slice:
It is read-only. It does not place trades, create paper orders, mutate portfolio state, create theses, start daemons, or expand MCP.

Status

@spfunctions/sdk is published as a stable package:
Use the stable package version.

API

The endpoint returns the current salience-ranked SimpleFunctions world state. The current schema is conservative because the endpoint still includes the SPEC-10 snapshot shape plus legacy aliases for older consumers. Stable fields to expect when present:
  • asOf
  • servedAt
  • op
  • region
  • regime
  • salient
  • childRegions
  • marketCount

CLI

The CLI is the first-class surface. It calls the same world endpoint and requests JSON when --json is present.

SDK

world.read is read-only (sideEffect: "none") but it is a hosted data call with costEffect: "api_cost" and access.anonymousAllowed: false. The SDK therefore requires SF_API_KEY for sf.world.get(). No-key SDK bootstrap is limited to strict manifest inspection such as sf.manifest.get("world.read"). If apiKey is present, the SDK sends it as a bearer token. The SDK does not shell out to the CLI, call an LLM, retry hidden mutations, or perform side effects.

Agent Tool

The agent metadata exposes the canonical tool as world.read. Tool hosts that reject dotted identifiers can use the compatibility name world_read.

Direct Agent Tool Events

The first accepted event stream supported only world.read. The current direct tool once-mode also supports additional read/research tools from the draft contract map.
--ndjson is an alias for --stream-json. Minimum emitted event types:
  • session.init
  • tool.catalog.loaded
  • run.started
  • tool.call.started
  • tool.call.completed or tool.call.failed
  • agent.final
  • run.completed

Trace

Use a local trace file when you need an audit receipt:
The trace entry stores the tool name, empty input, compact output summary, error if any, and duration. It must not store API keys, bearer tokens, venue credentials, or trading secrets.

Contract Map

The draft contract map entry lives at:
The draft now includes the read/research SDK and Agent contract slices plus deferred entries for surfaces that do not yet have safe canonical endpoints.