Integrations

Runtime Adapter Primitives

Shared capability manifests, fixture gateway decisions, JSON helpers, side-effect inference, and runtime run registry.

@isplay/adapter-runtime is not a user-facing framework adapter. It provides shared primitives used by Codex, Claude Code, OpenClaw, and future managed runtime adapters.

Exports

ExportPurpose
AdapterCapabilityManifestDescribes adapter support level and primitive capabilities.
primitive(status, mode, notes, requirements?)Helper for capability records.
supportsNativeReplay(manifest)Returns true only when every primitive is native_full.
unsupportedPrimitive(notes)Convenience for unsupported capabilities.
RuntimeFixtureGatewayInterface that decides allow/block/require/inject for runtime tool calls.
allowAllFixturesFixture gateway that allows all tool calls.
isInjection(decision)Type guard for fixture injection decisions.
RuntimeRunRegistryLazily creates and reuses isplay runs by runtime key.
toJsonValue, objectRecord, textOf, firstStringSafe conversion helpers for loose runtime payloads.
sideEffectFromToolNameName-based side-effect fallback.

Capability Manifest

import { primitive, type AdapterCapabilityManifest } from "@isplay/adapter-runtime";

export const capabilities: AdapterCapabilityManifest = {
  adapterId: "example",
  displayName: "Example Runtime",
  status: "managed_replay",
  primitives: {
    contextInventory: primitive("managed_replay", "observe_only", "Hooks expose context."),
    toolFixtureReplay: primitive("managed_replay", "post_result_replace", "Can add context after tool execution."),
  },
  warnings: ["Built-in tools cannot be replaced before execution."],
};

Support levels: native_full, managed_replay, observability_only, unsupported.

Interception modes: native_replace, proxy_replace, post_result_replace, block_only, observe_only.

Fixture Decisions

type RuntimeFixtureDecision =
  | { action: "allow" }
  | { action: "block"; reason: string }
  | { action: "require_fixture"; reason: string }
  | { action: "inject"; fixture: ToolFixture; output: JsonValue };

Managed adapters call the fixture gateway before or after tool execution depending on runtime hooks. When the action is inject, the adapter can only safely skip side effects if the runtime supports pre-execution replacement.

Runtime Run Registry

const runs = new RuntimeRunRegistry(client);

await runs.capture(
  {
    key: "thread_123",
    framework: "codex",
    metadata: { source: "hook" },
  },
  async (run) => {
    await client.recordEvent("codex.hook.UserPromptSubmit", payload);
  }
);

The registry creates one run per runtime key and runs callbacks inside SDK run context. It can later patch the run to ok, error, or cancelled.

Side-Effect Inference

sideEffectFromToolName() is a heuristic:

Tool name containsClass
read, search, fetch, grepread
write, edit, patch, bashwrite
send, deploy, deleteexternal_mutation
otherwiseunknown

Use it as a fallback only. Production integrations should supply side-effect class explicitly.

On this page