22 lines
893 B
TypeScript
22 lines
893 B
TypeScript
import type { Binding } from "../capability-model/types.js";
|
|||
|
|
|
||
|
|
/** Nominal library identity. Backends implement primitives; target names carry no
|
||
|
|
* built-in semantics in the graph planner. The JS backend is installed by the
|
||
|
|
* current toolchain, alongside the authoritative server executor. */
|
||
|
|
export const javascriptTarget = "target:org.quixos.execution.javascript@1";
|
||
|
|
export interface NativeExecutionBackend {
|
||
|
|
readonly target: string;
|
||
|
|
readonly supports: (binding: Exclude<Binding, { kind: "interface" }>) => boolean;
|
||
|
|
}
|
||
|
|
export const standardNativeBackends: readonly NativeExecutionBackend[] = [
|
||
|
|
{ target: "server", supports: () => true },
|
||
|
|
{
|
||
|
|
target: javascriptTarget,
|
||
|
|
supports: (binding) =>
|
||
|
|
binding.kind === "state" ||
|
||
|
|
binding.kind === "edge" ||
|
||
|
|
binding.kind === "journal" ||
|
||
|
|
(binding.kind === "subscription" && binding.primitive === "status"),
|
||
|
|
},
|
||
|
|
];
|