@receiz/mcp-server
Version:
MCP server for agents building and verifying Receiz proof-native applications through the canonical Receiz SDK rails.
1,235 lines • 54.2 kB
TypeScript
#!/usr/bin/env node
import { type ReceizMcpToolAnnotations } from "./toolAnnotations.js";
export * from "./marketplaceExecutionPolicy.js";
export * from "./marketplaceNonfinancialPolicy.js";
export { createReceizMcpDeviceAiSubject } from "./deviceAiSubject.js";
export { bindReceizMcpDeviceAiSubjectCreation } from "./deviceAiSubjectTool.js";
import type { ReceizV127SubjectRuntimeAdapter } from "@receiz/sdk";
export { bootstrapReceizMcpDeviceRuntime } from "./deviceBootstrap.js";
export { openReceizMcpDeviceRuntime } from "./deviceRuntime.js";
export { runReceizMcpDeviceRelay } from "./deviceRelay.js";
import { callReceizOfflineSealTool, type ReceizMcpLocalCustody } from "./offlineSealing.js";
export { appendReceizOfflineCrystal, openReceizOfflineCrystal, openReceizOfflineCrystalReference, readVerifiedReceizOfflineCrystalSources } from "./offlineCrystal.js";
export type { ReceizMcpLocalCustody } from "./offlineSealing.js";
export { sealReceizSourceBytes, sealUploadedArtifact, sealSuppliedText } from "./offlineSealing.js";
import { RECEIZ_V125_HIGHEST_CASH_OUT_FRAME, type JsonObject } from "@receiz/sdk";
import { createReceizConstitutionalRuntime, type ReceizConstitutionalContext, type ReceizConstitutionalOperation } from "./constitutional.js";
import { createReceizMcpOperations, type ReceizMcpOperationsClient, type ReceizMcpArtifactTransitionAuthorityResolvers } from "./operations.js";
import { type ReceizMcpV124CallOptions } from "./v124Operations.js";
import { type ReceizV125McpProofReferenceResolver } from "./v125Operations.js";
import { type ReceizV125TrustMcpHost } from "./v125TrustOperations.js";
export * from "./constitutional.js";
export * from "./operations.js";
export * from "./globalReconciliationOperations.js";
export * from "./livingSubjectOperations.js";
export * from "./v122Operations.js";
export * from "./v122PlanCustody.js";
export * from "./v123Operations.js";
export * from "./v124Operations.js";
export * from "./v125Operations.js";
export * from "./v125TrustOperations.js";
export * from "./v125TrustHost.js";
import { createReceizV125TrustMcpOperations } from "./v125TrustHost.js";
export type JsonRpcId = string | number | null;
export type JsonRpcRequest = {
jsonrpc: "2.0";
id?: JsonRpcId;
method: string;
params?: unknown;
};
export type JsonRpcResponse = {
jsonrpc: "2.0";
id: JsonRpcId;
result?: unknown;
error?: {
code: number;
message: string;
data?: unknown;
};
};
export type McpTool = {
_meta?: JsonObject;
annotations?: ReceizMcpToolAnnotations;
name: string;
description: string;
inputSchema: JsonObject;
outputSchema?: JsonObject;
};
export type McpResourceTemplate = {
uriTemplate: string;
name: string;
description: string;
mimeType: "application/json";
};
export type McpToolResult = {
content: Array<{
type: "text";
text: string;
}>;
isError?: boolean;
structuredContent?: JsonObject;
_meta?: JsonObject;
};
export type ReceizMcpAuthorityBoundary = {
mcpAuthority: false;
sourceOfTruth: string;
strongerTruth: string[];
weakerToolingLayer: string;
highestCashOutFrame: typeof RECEIZ_V125_HIGHEST_CASH_OUT_FRAME;
};
export declare const RECEIZ_MCP_AUTHORITY_BOUNDARY: ReceizMcpAuthorityBoundary;
type ReceizSdkClientLike = {
baseUrl?: string;
doctor: (options?: JsonObject) => Promise<unknown>;
capabilities: (options?: JsonObject) => Promise<unknown>;
appState: {
publish: (input: unknown, options?: JsonObject) => Promise<unknown>;
resolve: (input: JsonObject) => Promise<unknown>;
byUrl: (url: string) => Promise<unknown>;
byCreator: (receizId: string) => Promise<unknown>;
byNamespace: (namespace: string) => Promise<unknown>;
byId: (id: string) => Promise<unknown>;
};
publicStore: {
publish: (input: JsonObject, options?: JsonObject) => Promise<unknown>;
resolve: (input: JsonObject) => Promise<unknown>;
};
publicProof: {
byUrl: (url: string) => Promise<unknown>;
byId: (id: string) => Promise<unknown>;
byCreator: (receizId: string) => Promise<unknown>;
};
verification: ReceizMcpOperationsClient["verification"];
identity: {
authorizeUrl: (options: JsonObject) => string;
ensureTenantSession: (input: JsonObject) => unknown;
};
profile: ReceizMcpOperationsClient["profile"];
assets: ReceizMcpOperationsClient["assets"];
artifacts: ReceizMcpOperationsClient["artifacts"];
ownership: ReceizMcpOperationsClient["ownership"];
wallet: {
publicLedger: (query?: JsonObject) => Promise<unknown>;
actionLedger: (query?: JsonObject) => Promise<unknown>;
};
sports: {
conformance: () => Promise<unknown>;
resolveCardMemory: (input: unknown) => Promise<unknown>;
resolvePitchDayProof: (input: unknown) => Promise<unknown>;
};
subjects: ReceizMcpOperationsClient["subjects"];
bearer: ReceizMcpOperationsClient["bearer"];
world: ReceizMcpOperationsClient["world"] & {
publicSnapshot: () => Promise<unknown>;
};
proof: {
query: (query: JsonObject) => Promise<unknown>;
};
webhooks: {
verifySignature: (input: JsonObject) => Promise<boolean>;
};
webhookEndpoints: {
list: () => Promise<unknown>;
create: (input: JsonObject) => Promise<unknown>;
update: (endpointId: string, input: JsonObject) => Promise<unknown>;
delete: (endpointId: string) => Promise<unknown>;
rotateSecret: (endpointId: string) => Promise<unknown>;
sendTest: (endpointId: string, input: JsonObject) => Promise<unknown>;
};
sandbox: {
seedStore: (input: JsonObject) => unknown;
checkout: (input: JsonObject) => unknown;
wallet: (input?: JsonObject) => unknown;
};
};
export type ReceizMcpRuntime = {
localCustody?: ReceizMcpLocalCustody;
offlineSealer?: NonNullable<Parameters<typeof callReceizOfflineSealTool>[2]>["sealer"];
subjectRuntime?: ReceizV127SubjectRuntimeAdapter;
client: ReceizSdkClientLike;
baseUrl: string;
applicationId?: string;
accessToken?: string;
resolveV124Material?: ReceizMcpV124CallOptions["resolveMaterial"];
persistV124Material?: ReceizMcpV124CallOptions["persistMaterial"];
resolveV125ProofReference?: ReceizV125McpProofReferenceResolver;
executeV125TrustOperation?: ReceizV125TrustMcpHost;
fetch?: typeof globalThis.fetch;
oidcScopesByRail: Partial<Record<string, readonly string[]>>;
webhookReplayIds: Set<string>;
constitutional: ReturnType<typeof createReceizConstitutionalRuntime>;
operations: ReturnType<typeof createReceizMcpOperations>;
};
export type ReceizV124McpMaterialHost = Readonly<{
resolveMaterial?: NonNullable<ReceizMcpV124CallOptions["resolveMaterial"]>;
persistMaterial?: NonNullable<ReceizMcpV124CallOptions["persistMaterial"]>;
}>;
export type ReceizV125McpProofHost = Readonly<{
resolveProofReference?: ReceizV125McpProofReferenceResolver;
}>;
/**
* Loads the trusted host seam used by the stdio server. The module receives
* exact materials outside model arguments and must export
* `resolveReceizV124Material`; `persistReceizV124Material` is optional.
*/
export declare function loadReceizV124McpMaterialHost(moduleSpecifier?: string | undefined): Promise<ReceizV124McpMaterialHost>;
/**
* Loads the trusted host seam used by the stdio server for v125 lawful-action
* proof objects. The model receives only an opaque reference; the host resolves
* exact sealed bytes after confirmation and beneath artifact verification.
*/
export declare function loadReceizV125McpProofHost(moduleSpecifier?: string | undefined): Promise<ReceizV125McpProofHost>;
/** Host modules supply private custody/mechanics; only the canonical factory dispatches tools. */
export type ReceizV125TrustHostConfiguration = Omit<Parameters<typeof createReceizV125TrustMcpOperations>[0], "client" | "applicationAudience">;
export declare function loadReceizV125McpTrustHost(scope: Pick<Parameters<typeof createReceizV125TrustMcpOperations>[0], "client" | "applicationAudience">, moduleSpecifier?: string | undefined): Promise<ReceizV125TrustMcpHost | undefined>;
export declare const RECEIZ_MCP_RESOURCE_TEMPLATES: McpResourceTemplate[];
export declare const RECEIZ_MCP_TOOLS: McpTool[];
export declare function describeReceizMcpCapabilityParity(): Readonly<{
schema: "receiz.mcp.sdk-ai-capability-parity.v125";
releaseVersion: "128.0.0";
sdkClientCapabilityInventory: Readonly<{
schema: "receiz.sdk.client-capability-inventory.v125";
releaseVersion: typeof import("@receiz/sdk").RECEIZ_RELEASE_VERSION;
operations: readonly string[];
authority: Readonly<{
inventoryIsProofAuthority: false;
mcpIsProofAuthority: false;
strongerTruth: "sealed-receiz-proof-object";
}>;
}>;
sdkPublicFunctionInventory: Readonly<{
schema: "receiz.sdk.public-functions.v1";
releaseVersion: "128.0.0";
digest: "687bdd064b49bf7df1c32eb4ab3c0f1389c80c8bc90d7cfbec32147db1cc73ad";
functions: {
entryPoint: string;
name: string;
signatures: string[];
}[];
authority: {
inventoryIsProofAuthority: boolean;
directMcpExecutionRequiresAdapter: boolean;
sdkRuntimeCustodyMustBePreserved: boolean;
};
}>;
mcpToolInventory: readonly string[];
v125CapabilityInventory: readonly Readonly<{
id: string;
primitive: string;
outcome: string;
sdkExports: readonly string[];
sdkClientMethods: readonly string[];
mcpTools: readonly string[];
aiSkills: readonly string[];
authorityBoundary: string;
}>[];
authority: Readonly<{
inventoryIsProofAuthority: false;
mcpIsProofAuthority: false;
directToolRequiresExplicitAdapter: true;
sameRuntimeCustodyMustNotBeSerialized: true;
strongerTruth: "sealed-receiz-proof-object";
}>;
}>;
/** Host-owned exposure boundary; this never grants proof or signing authority. */
export declare const RECEIZ_PHI_EXECUTION_TOOL_NAMES: readonly string[];
export declare function createReceizMcpRuntime(options?: {
executionProfile?: "phi-only" | "marketplace-phi" | "marketplace-nonfinancial";
localCustody?: ReceizMcpLocalCustody;
offlineSealer?: NonNullable<Parameters<typeof callReceizOfflineSealTool>[2]>["sealer"];
subjectRuntime?: ReceizV127SubjectRuntimeAdapter;
legacyConnectTransport?: "http";
client?: ReceizSdkClientLike;
baseUrl?: string;
applicationId?: string;
accessToken?: string;
resolveV124Material?: ReceizMcpV124CallOptions["resolveMaterial"];
persistV124Material?: ReceizMcpV124CallOptions["persistMaterial"];
resolveV125ProofReference?: ReceizV125McpProofReferenceResolver;
executeV125TrustOperation?: ReceizV125TrustMcpHost;
fetch?: typeof globalThis.fetch;
oidcScopesByRail?: Partial<Record<string, readonly string[]>>;
constitutionalContext?: ReceizConstitutionalContext;
constitutionalExecutor?: (operation: ReceizConstitutionalOperation) => Promise<unknown>;
} & Partial<ReceizMcpArtifactTransitionAuthorityResolvers>): ReceizMcpRuntime;
export declare function callReceizTool(runtime: ReceizMcpRuntime, name: string, args?: unknown): Promise<McpToolResult>;
export declare function handleReceizMcpMessage(message: JsonRpcRequest, runtime?: ReceizMcpRuntime): Promise<JsonRpcResponse | null>;
export declare function parseReceizMcpToolResult(result: McpToolResult): JsonObject;
export declare function isCliEntrypoint(options?: {
argvPath?: string;
moduleUrl?: string;
realpath?: (path: string) => string;
}): boolean;
/** Standard local subject host. Configuration is process-owned, never MCP arguments. */
export declare function loadReceizV127LocalSubjectRuntime(): Promise<Readonly<{
version: "120.0.0";
registryDigest: string;
reducerDigest: string;
exportSnapshot: () => Promise<Readonly<{
schema: "receiz.subject.portable-runtime.v127";
version: "127.0.0";
snapshot: import("@receiz/sdk").ReceizLivingSubjectRuntimeSnapshotV1;
snapshotDigest: string;
sourceArtifacts: import("@receiz/sdk").ReceizV127SubjectRuntimeRecord["sources"];
temporalEvidence: Readonly<{
legacyKaiUnit: "kai-pulse";
historicalKaiAuthority: "not-retroactively-proved";
transitions: NonNullable<import("@receiz/sdk").ReceizV127SubjectRuntimeRecord["temporalTransitions"]>;
}>;
}>>;
importSnapshot: (source: import("@receiz/sdk").ReceizV127SubjectRuntimeSource) => Promise<{
subjectIds: string[];
snapshotDigest: string;
}>;
admitSubject: (source: import("@receiz/sdk").ReceizV127SubjectRuntimeSource) => Promise<Readonly<{
schema: "receiz.subject.v1";
subject: import("@receiz/sdk").ReceizSubjectV1;
exactBytesB64u: string;
artifactDigest: string;
registryDigest: string;
reducerDigest: string;
authority: Readonly<{
artifactIsProofAuthority: true;
modelOutputIsAuthority: false;
indexIsAuthority: false;
}>;
}>>;
subjects: Readonly<{
resolve: (id: string) => Promise<Readonly<{
schema: "receiz.subject.v1";
subject: import("@receiz/sdk").ReceizSubjectV1;
exactBytesB64u: string;
artifactDigest: string;
registryDigest: string;
reducerDigest: string;
authority: Readonly<{
artifactIsProofAuthority: true;
modelOutputIsAuthority: false;
indexIsAuthority: false;
}>;
}>>;
state: (id: string) => Promise<Readonly<{
schema: "receiz.subject.v1";
subjectId: string;
proofObjectId: string;
subjectType: string;
ownerReceizId: string;
identityDigest: string;
genesisDigest: string;
createdAtKai: string;
head: string;
ownershipHead: string;
currentOwnerReceizId: string;
namespaces: import("@receiz/sdk").ReceizSubjectNamespaceBytesV1;
}>>;
verify: (artifact: Readonly<{
schema: "receiz.subject.v1";
subject: import("@receiz/sdk").ReceizSubjectV1;
exactBytesB64u: string;
artifactDigest: string;
registryDigest: string;
reducerDigest: string;
authority: Readonly<{
artifactIsProofAuthority: true;
modelOutputIsAuthority: false;
indexIsAuthority: false;
}>;
}>) => Promise<{
valid: boolean;
sourcePrimitive: "receiz.subject.v1";
}>;
history: (id: string, input?: Readonly<{
afterHead?: string;
limit?: number;
}> | undefined) => Promise<Readonly<{
schema: "receiz.world.event.v1";
eventId: string;
commandId: string;
worldId: string;
kind: string;
actorSubjectId: string;
participantSubjectIds: readonly string[];
payload: Readonly<Record<string, unknown>>;
causalParents: readonly string[];
priorHeads: Readonly<Record<string, string>>;
nextHeads: Readonly<Record<string, string>>;
priorWorldHead: string;
worldHead: string;
mandateDigest?: string;
kai: string;
registryDigest: string;
reducerDigest: string;
}>[]>;
additions: (id: string, input?: Readonly<{
afterHead?: string;
}> | undefined) => Promise<Readonly<{
schema: "receiz.world.event.v1";
eventId: string;
commandId: string;
worldId: string;
kind: string;
actorSubjectId: string;
participantSubjectIds: readonly string[];
payload: Readonly<Record<string, unknown>>;
causalParents: readonly string[];
priorHeads: Readonly<Record<string, string>>;
nextHeads: Readonly<Record<string, string>>;
priorWorldHead: string;
worldHead: string;
mandateDigest?: string;
kai: string;
registryDigest: string;
reducerDigest: string;
}>[]>;
subscribe: (id: string, input?: Readonly<{
afterHead?: string;
}> | undefined) => AsyncGenerator<Readonly<{
schema: "receiz.world.event.v1";
eventId: string;
commandId: string;
worldId: string;
kind: string;
actorSubjectId: string;
participantSubjectIds: readonly string[];
payload: Readonly<Record<string, unknown>>;
causalParents: readonly string[];
priorHeads: Readonly<Record<string, string>>;
nextHeads: Readonly<Record<string, string>>;
priorWorldHead: string;
worldHead: string;
mandateDigest?: string;
kai: string;
registryDigest: string;
reducerDigest: string;
}>, void, unknown>;
brain: Readonly<{
head: (id: string) => Promise<Readonly<{
schema: "receiz.subject.proof_brain.v1";
subjectId: string;
subjectDigest: string;
subjectHead: string;
historyHead: string;
indexRoot: string;
objectMerkleRoot: string;
objectCount: string;
operationCount: string;
maximumKai: string;
priorBrainHead: string | null;
fibonacci: import("@receiz/sdk").ReceizCompositeFibonacciState;
registryDigest: string;
reducerDigest: string;
authority: Readonly<{
brainHeadIsProofAuthority: false;
indexIsProofAuthority: false;
strongerTruth: "sealed-receiz-proof-object";
}>;
}>>;
search: (id: string, input: Readonly<{
query: string;
atHead: string;
limit?: number;
cursor?: string;
visibility?: "public" | "private" | "all";
types?: readonly import("@receiz/sdk").ReceizSubjectProofTextV1["kind"][];
}>) => Promise<Readonly<{
schema: "receiz.subject.proof_reference.v1";
subjectId: string;
subjectHead: string;
proofObjectId: string;
objectDigest: string;
kai: string;
score: number;
matchedTerms: readonly string[];
eventIds: readonly string[];
membership: Readonly<{
objectOrdinal: number;
objectMerkleRoot: string;
indexRoot: string;
}>;
}>[]>;
resolve: (id: string, input: Readonly<{
atHead: string;
references: readonly import("@receiz/sdk").ReceizSubjectProofReferenceV1[];
}>) => Promise<Readonly<{
schema: "receiz.subject.proof_context.v1";
head: import("@receiz/sdk").ReceizSubjectProofBrainHeadV1;
references: readonly import("@receiz/sdk").ReceizSubjectProofReferenceV1[];
primaryObjects: readonly import("@receiz/sdk").ReceizSubjectPrimaryProofObjectV1[];
passages: readonly import("@receiz/sdk").ReceizSubjectProofPassageV1[];
receipt: import("@receiz/sdk").ReceizSubjectProofRetrievalReceiptV1;
}>>;
stream: (id: string, input: Readonly<{
query: string;
atHead: string;
limit?: number;
cursor?: string;
visibility?: "public" | "private" | "all";
types?: readonly import("@receiz/sdk").ReceizSubjectProofTextV1["kind"][];
}>) => AsyncGenerator<import("@receiz/sdk").ReceizSubjectProofBrainStreamEvent, void, unknown>;
append: (id: string, source: import("@receiz/sdk").ReceizV127SubjectRuntimeSource) => Promise<Readonly<{
schema: "receiz.subject.proof_brain.v1";
subjectId: string;
subjectDigest: string;
subjectHead: string;
historyHead: string;
indexRoot: string;
objectMerkleRoot: string;
objectCount: string;
operationCount: string;
maximumKai: string;
priorBrainHead: string | null;
fibonacci: import("@receiz/sdk").ReceizCompositeFibonacciState;
registryDigest: string;
reducerDigest: string;
authority: Readonly<{
brainHeadIsProofAuthority: false;
indexIsProofAuthority: false;
strongerTruth: "sealed-receiz-proof-object";
}>;
}>>;
}>;
twin: Readonly<{
profile: (id: string) => Promise<Readonly<{
subjectId: string;
subjectType: string;
head: string;
selfModel: unknown;
brainHead: Readonly<{
schema: "receiz.subject.proof_brain.v1";
subjectId: string;
subjectDigest: string;
subjectHead: string;
historyHead: string;
indexRoot: string;
objectMerkleRoot: string;
objectCount: string;
operationCount: string;
maximumKai: string;
priorBrainHead: string | null;
fibonacci: import("@receiz/sdk").ReceizCompositeFibonacciState;
registryDigest: string;
reducerDigest: string;
authority: Readonly<{
brainHeadIsProofAuthority: false;
indexIsProofAuthority: false;
strongerTruth: "sealed-receiz-proof-object";
}>;
}>;
}>>;
message: (id: string, input: Omit<import("@receiz/sdk").ReceizSubjectTwinMessageInput, "ownerReceizId">) => Promise<Readonly<{
schema: "receiz.subject.twin_result.v1";
subjectId: string;
subjectHead: string;
spokenResponse: string;
proposedIntent: import("@receiz/sdk").ReceizSubjectIntentV1;
observedFacts: readonly Readonly<{
fact: string;
eventIds: readonly string[];
proofObjectIds: readonly string[];
}>[];
proofDerivedMemories: readonly Readonly<{
memoryId: string;
summary: string;
eventIds: readonly string[];
}>[];
performance: Readonly<Record<string, unknown>> | null;
proofContext: import("@receiz/sdk").ReceizSubjectProofContextV1;
worldEventIds: readonly [];
authority: Readonly<{
modelOutputIsWorldEvent: false;
deterministicAdmissionRequired: true;
}>;
}>>;
stream: (id: string, input: Omit<import("@receiz/sdk").ReceizSubjectTwinMessageInput, "ownerReceizId">) => AsyncGenerator<import("@receiz/sdk").ReceizSubjectTwinStreamEvent, void, unknown>;
streamPerformance: (id: string, input: Omit<import("@receiz/sdk").ReceizSubjectTwinMessageInput, "ownerReceizId">) => AsyncGenerator<import("@receiz/sdk").ReceizSubjectTwinStreamEvent, void, unknown>;
exportMind: (id: string) => Promise<Readonly<{
schema: "receiz.subject.mind.v1";
subjectArtifact: import("@receiz/sdk").ReceizSubjectArtifactV1;
brainHead: import("@receiz/sdk").ReceizSubjectProofBrainHeadV1;
portableWindow: readonly import("@receiz/sdk").ReceizSubjectPrimaryProofObjectV1[];
completeHistory: Readonly<{
objectCount: string;
objectMerkleRoot: string;
indexRoot: string;
contentAddress: string;
primaryObjectsRequiredForReasoning: true;
}>;
publicMemoryIds: readonly string[];
privateMemoryIds: readonly string[];
priorMindHead: string | null;
mindDigest: string;
exactBytesB64u: string;
registryDigest: string;
reducerDigest: string;
}>>;
importMind: (id: string, source: import("@receiz/sdk").ReceizV127SubjectRuntimeSource) => Promise<Readonly<{
ok: false;
code: "RECEIZ_SUBJECT_MIND_FORK_PRESERVED";
writes: 0;
localHead: string;
importedHead: string;
forkDigest: string;
}> | Readonly<{
ok: true;
subjectId: string;
mindDigest: string;
head: string;
}>>;
memorySummary: (id: string) => Promise<Readonly<{
subjectId: string;
head: string;
counts: Readonly<{
[k: string]: number;
}>;
projectionDigest: string;
}>>;
}>;
mandates: Readonly<{
get: (id: string) => Promise<Readonly<{
schema: "receiz.subject.mandate.v1";
mandateId: string;
subjectId: string;
ownerReceizId: string;
policy: import("@receiz/sdk").ReceizSubjectMandatePolicyV1;
mandateDigest: string;
status: "planned" | "active" | "paused" | "revoked" | "expired";
activatedCapabilityDigest: string | null;
activatedAtKai: string | null;
revokedAtKai: string | null;
}>[]>;
plan: (id: string, input: Readonly<{
allowedActions: readonly string[];
allowedWorldRegions: readonly string[];
allowedSubjectIds: readonly string[];
allowedOwnerReceizIds: readonly string[];
conversationPrivacy: "public" | "relationship" | "owner-private";
battleParticipation: boolean;
itemActions: readonly ("use" | "gift" | "trade")[];
maximumItemValueMinor: string;
maximumDailyValueMinor: string;
approvalThresholdMinor: string;
minimumRuntimeIntervalKai: string;
maximumDailyRuns: number;
publicMemory: boolean;
privateMemory: boolean;
expiresAtKai: string;
modelProviderAllowlist: readonly string[];
safetyPolicy: string;
applicationScope: readonly string[];
tenantScope: readonly string[];
}>) => Promise<Readonly<{
schema: "receiz.subject.mandate.v1";
mandateId: string;
subjectId: string;
ownerReceizId: string;
policy: import("@receiz/sdk").ReceizSubjectMandatePolicyV1;
mandateDigest: string;
status: "planned" | "active" | "paused" | "revoked" | "expired";
activatedCapabilityDigest: string | null;
activatedAtKai: string | null;
revokedAtKai: string | null;
}>>;
activate: (id: string, mandateDigest: string) => Promise<Readonly<{
status: "active";
activatedCapabilityDigest: string;
activatedAtKai: string;
schema: "receiz.subject.mandate.v1";
mandateId: string;
subjectId: string;
ownerReceizId: string;
policy: import("@receiz/sdk").ReceizSubjectMandatePolicyV1;
mandateDigest: string;
revokedAtKai: string | null;
}>>;
pause: (id: string) => Promise<Readonly<{
schema: "receiz.subject.mandate.v1";
mandateId: string;
subjectId: string;
ownerReceizId: string;
policy: import("@receiz/sdk").ReceizSubjectMandatePolicyV1;
mandateDigest: string;
status: "planned" | "active" | "paused" | "revoked" | "expired";
activatedCapabilityDigest: string | null;
activatedAtKai: string | null;
revokedAtKai: string | null;
}>[]>;
revoke: (id: string) => Promise<Readonly<{
schema: "receiz.subject.mandate.v1";
mandateId: string;
subjectId: string;
ownerReceizId: string;
policy: import("@receiz/sdk").ReceizSubjectMandatePolicyV1;
mandateDigest: string;
status: "planned" | "active" | "paused" | "revoked" | "expired";
activatedCapabilityDigest: string | null;
activatedAtKai: string | null;
revokedAtKai: string | null;
}>[]>;
explain: (id: string) => Promise<{
temporalCoordinate: Readonly<{
schema: typeof import("@receiz/sdk").RECEIZ_KKS_V1_PROOF_COORDINATE_SCHEMA;
kksVersion: typeof import("@receiz/sdk").RECEIZ_KKS_V1_VERSION;
kaiPulse: string;
kaiUpulse: string;
source: import("@/packages/receiz-sdk/dist/v125KaiAuthority.js").ReceizKksV1CoordinateSource;
kaiSigil: import("@receiz/sdk").ReceizKaiSigilTemporalProofV1;
authority: Readonly<{
temporalAuthority: "kai-pulse-monotonic-frequency-from-genesis";
intrinsicProof: "kaisigil-blake3-poseidon-groth16";
causalOrder: "verified-previous-head-then-strictly-greater-kai-upulse";
chronosRole: "descriptive-projection-only";
createdAtAuthority: false;
networkRequired: false;
}>;
}>;
subjectId: string;
currentKai: string;
mandates: readonly {
executable: boolean;
schema: "receiz.subject.mandate.v1";
mandateId: string;
subjectId: string;
ownerReceizId: string;
policy: import("@receiz/sdk").ReceizSubjectMandatePolicyV1;
mandateDigest: string;
status: "planned" | "active" | "paused" | "revoked" | "expired";
activatedCapabilityDigest: string | null;
activatedAtKai: string | null;
revokedAtKai: string | null;
}[];
}>;
}>;
runtime: Readonly<{
enqueueTick: (input: Readonly<{
subjectId: string;
mandateDigest: string;
expectedHead: string;
worldHead: string;
runAfter: string;
idempotencyKey: string;
}>) => Promise<Readonly<{
jobId: string;
input: import("@receiz/sdk").ReceizSubjectRuntimeTickInput;
status: "queued" | "leased" | "completed" | "failed" | "cancelled" | "stale";
leaseUntilKai: string | null;
attemptCount: number;
eventIds: readonly string[];
failureCode: string | null;
}>>;
status: (id: string) => Promise<Readonly<{
jobId: string;
input: import("@receiz/sdk").ReceizSubjectRuntimeTickInput;
status: "queued" | "leased" | "completed" | "failed" | "cancelled" | "stale";
leaseUntilKai: string | null;
attemptCount: number;
eventIds: readonly string[];
failureCode: string | null;
}>>;
pause: (id: string) => Promise<Readonly<{
subjectId: string;
cancelledJobIds: readonly string[];
writes: number;
}>>;
catchUp: (id: string, input?: Readonly<{
maximumTicks?: number;
throughKai?: string;
worldId?: string;
}> | undefined) => Promise<Readonly<{
subjectId: string;
processed: number;
jobs: readonly Readonly<{
jobId: string;
input: import("@receiz/sdk").ReceizSubjectRuntimeTickInput;
status: "queued" | "leased" | "completed" | "failed" | "cancelled" | "stale";
leaseUntilKai: string | null;
attemptCount: number;
eventIds: readonly string[];
failureCode: string | null;
}>[];
}>>;
}>;
memory: Readonly<{
query: (id: string, input?: Readonly<{
types?: readonly import("@receiz/sdk").ReceizSubjectMemoryEventV1["type"][];
visibility?: "public" | "private" | "all";
afterKai?: string;
limit?: number;
}> | undefined) => Promise<Readonly<{
schema: "receiz.subject.memory_event.v1";
memoryId: string;
subjectId: string;
type: import("@receiz/sdk").ReceizSubjectMemoryType;
summary: string;
eventIds: readonly string[];
proofObjectIds: readonly string[];
visibility: "public" | "private";
head: string;
kai: string;
}>[]>;
project: (id: string, input: Readonly<{
throughHead: string;
}>) => Promise<Readonly<{
schema: "receiz.subject.memory_projection.v1";
subjectId: string;
throughHead: string;
memories: readonly import("@receiz/sdk").ReceizSubjectMemoryEventV1[];
projectionDigest: string;
rebuildable: true;
}>>;
citations: (id: string, memoryId: string) => Promise<Readonly<{
memoryId: string;
eventIds: readonly string[];
proofObjectIds: readonly string[];
}>>;
compact: (id: string, input?: Readonly<{
throughHead?: string;
}> | undefined) => Promise<Readonly<{
schema: "receiz.subject.memory_projection.v1";
subjectId: string;
throughHead: string;
memories: readonly import("@receiz/sdk").ReceizSubjectMemoryEventV1[];
projectionDigest: string;
rebuildable: true;
}>>;
}>;
relationships: Readonly<{
list: (id: string) => Promise<Readonly<{
schema: "receiz.subject.relationship.v1";
relationshipId: string;
subjectIds: readonly [string, string];
status: "proposed" | "active" | "declined" | "blocked";
familiarity: number;
trust: number;
rivalry: number;
affection: number;
mentorship: number;
visibility: "public" | "private";
eventIds: readonly string[];
head: string;
}>[]>;
history: (id: string) => Promise<Readonly<{
schema: "receiz.world.event.v1";
eventId: string;
commandId: string;
worldId: string;
kind: string;
actorSubjectId: string;
participantSubjectIds: readonly string[];
payload: Readonly<Record<string, unknown>>;
causalParents: readonly string[];
priorHeads: Readonly<Record<string, string>>;
nextHeads: Readonly<Record<string, string>>;
priorWorldHead: string;
worldHead: string;
mandateDigest?: string;
kai: string;
registryDigest: string;
reducerDigest: string;
}>[]>;
propose: (input: Readonly<{
subjectId: string;
targetSubjectId: string;
response?: "accept" | "decline";
visibility?: "public" | "private";
worldId?: string;
attemptId: string;
idempotencyKey: string;
}>) => Promise<Readonly<{
schema: "receiz.world.transaction.v1";
transactionId: string;
transactionDigest: string;
worldId: string;
participants: readonly string[];
expectedHeads: Readonly<Record<string, string>>;
commands: readonly import("@receiz/sdk").ReceizWorldCommandV1[];
registryDigest: string;
reducerDigest: string;
}>>;
respond: (input: Omit<Readonly<{
subjectId: string;
targetSubjectId: string;
response?: "accept" | "decline";
visibility?: "public" | "private";
worldId?: string;
attemptId: string;
idempotencyKey: string;
}> & Readonly<{
response: "accept" | "decline";
authority: import("@receiz/sdk").ReceizWorldAuthorityV1 | import("@receiz/sdk").ReceizWorldTransactionAuthorityV1;
}>, "authority">) => Promise<Readonly<{
ok: false;
schema: "receiz.world.zero-write-failure.v1";
code: string;
message: string;
commandId: string | null;
attemptId: string | null;
writes: 0;
currentHeads: Readonly<Record<string, string>>;
worldHead: string;
registryDigest: string;
reducerDigest: string;
}> | Readonly<{
ok: true;
receipt: import("@receiz/sdk").ReceizWorldReceiptV1;
events: readonly import("@receiz/sdk").ReceizWorldEventV1[];
}>>;
}>;
inventory: Readonly<{
list: (id: string) => Promise<Readonly<{
schema: "receiz.subject.inventory.v1";
subjectId: string;
head: string;
items: readonly import("@receiz/sdk").ReceizSubjectInventoryItemV1[];
}>>;
use: (input: Omit<Readonly<{
subjectId: string;
itemId: string;
worldId?: string;
attemptId: string;
idempotencyKey: string;
authority: import("@receiz/sdk").ReceizWorldAuthorityV1;
}>, "authority">) => Promise<Readonly<{
ok: false;
schema: "receiz.world.zero-write-failure.v1";
code: string;
message: string;
commandId: string | null;
attemptId: string | null;
writes: 0;
currentHeads: Readonly<Record<string, string>>;
worldHead: string;
registryDigest: string;
reducerDigest: string;
}> | Readonly<{
ok: true;
receipt: import("@receiz/sdk").ReceizWorldReceiptV1;
events: readonly import("@receiz/sdk").ReceizWorldEventV1[];
}>>;
}>;
trades: Readonly<{
preview: (input: Readonly<{
fromSubjectId: string;
toSubjectId: string;
itemId: string;
worldId?: string;
attemptId: string;
idempotencyKey: string;
mandateDigest?: string;
}>) => Promise<Readonly<{
transaction: Readonly<{
schema: "receiz.world.transaction.v1";
transactionId: string;
transactionDigest: string;
worldId: string;
participants: readonly string[];
expectedHeads: Readonly<Record<string, string>>;
commands: readonly import("@receiz/sdk").ReceizWorldCommandV1[];
registryDigest: string;
reducerDigest: string;
}>;
item: Readonly<{
itemId: string;
proofObjectId: string;
ownerSubjectId: string;
quantity: string;
valueMinor: string;
namespaceBytes: string;
}>;
requiresOwnerApproval: boolean;
exactOwnershipHeads: Readonly<Record<string, string>>;
previewDigest: string;
}>>;
execute: (preview: Readonly<{
transaction: Readonly<{
schema: "receiz.world.transaction.v1";
transactionId: string;
transactionDigest: string;
worldId: string;
participants: readonly string[];
expectedHeads: Readonly<Record<string, string>>;
commands: readonly import("@receiz/sdk").ReceizWorldCommandV1[];
registryDigest: string;
reducerDigest: string;
}>;
item: Readonly<{
itemId: string;
proofObjectId: string;
ownerSubjectId: string;
quantity: string;
valueMinor: string;
namespaceBytes: string;
}>;
requiresOwnerApproval: boolean;
exactOwnershipHeads: Readonly<Record<string, string>>;
previewDigest: string;
}>) => Promise<Readonly<{
ok: false;
schema: "receiz.world.zero-write-failure.v1";
code: string;
message: string;
commandId: string | null;
attemptId: string | null;
writes: 0;
currentHeads: Readonly<Record<string, string>>;
worldHead: string;
registryDigest: string;
reducerDigest: string;
}> | Readonly<{
ok: true;
receipt: import("@receiz/sdk").ReceizWorldReceiptV1;
events: readonly import("@receiz/sdk").ReceizWorldEventV1[];
}>>;
}>;
}>;
world: Readonly<{
head: (id: string) => Promise<string>;
planCommand: (input: Readonly<{
worldId: string;
actorSubjectId: string;
kind: string;
targetIds?: readonly string[];
payload: Readonly<Record<string, unknown>>;
expectedHeads: Readonly<Record<string, string>>;
expectedWorldHead: string;
attemptId: string;
idempotencyKey: string;
mandateDigest?: string;
}>) => Promise<Readonly<{
schema: "receiz.world.command_plan.v1";
planId: string;
planDigest: string;
command: import("@receiz/sdk").ReceizWorldCommandV1;
priorHeads: Readonly<Record<string, string>>;
worldHead: string;
registryDigest: string;
reducerDigest: string;
writesOnFailure: 0;
}>>;
validateCommand: (input: Readonly<{
schema: "receiz.world.command_plan.v1";
planId: string;
planDigest: string;
command: import("@receiz/sdk").ReceizWorldCommandV1;
priorHeads: Readonly<Record<string, string>>;
worldHead: string;
registryDigest: string;
reducerDigest: string;
writesOnFailure: 0;
}>) => Promise<{
temporalCoordinate: Readonly<{
schema: typeof import("@receiz/sdk").RECEIZ_KKS_V1_PROOF_COORDINATE_SCHEMA;
kksVersion: typeof import("@receiz/sdk").RECEIZ_KKS_V1_VERSION;
kaiPulse: string;
kaiUpulse: string;
source: import("@/packages/receiz-sdk/dist/v125KaiAuthority.js").ReceizKksV1CoordinateSource;
kaiSigil: import("@receiz/sdk").ReceizKaiSigilTemporalProofV1;
authority: Readonly<{
temporalAuthority: "kai-pulse-monotonic-frequency-from-genesis";
intrinsicProof: "kaisigil-blake3-poseidon-groth16";
causalOrder: "verified-previous-head-then-strictly-greater-kai-upulse";
chronosRole: "descriptive-projection-only";
createdAtAuthority: false;
networkRequired: false;
}>;
}>;
ok: false;
schema: "receiz.world.zero-write-failure.v1";
code: string;
message: string;
commandId: string | null;
attemptId: string | null;
writes: 0;
currentHeads: Readonly<Record<string, string>>;
worldHead: string;
registryDigest: string;
reducerDigest: string;
} | {
temporalCoordinate: Readonly<{
schema: typeof import("@receiz/sdk").RECEIZ_KKS_V1_PROOF_COORDINATE_SCHEMA;
kksVersion: typeof import("@receiz/sdk").RECEIZ_KKS_V1_VERSION;
kaiPulse: string;
kaiUpulse: string;
source: import("@/packages/receiz-sdk/dist/v125KaiAuthority.js").ReceizKksV1CoordinateSource;
kaiSigil: import("@receiz/sdk").ReceizKaiSigilTemporalProofV1;
authority: Readonly<{
temporalAuthority: "kai-pulse-monotonic-frequency-from-genesis";
intrinsicProof: "kaisigil-blake3-poseidon-groth16";
causalOrder: "verified-previous-head-then-strictly-greater-kai-upulse";
chronosRole: "descriptive-projection-only";
createdAtAuthority: false;
networkRequired: false;
}>;
}>;
ok: true;
planId: string;
planDigest: string;
currentHeads: Readonly<Record<string, string>>;
worldHead: string;
writes: 0;
registryDigest: string;
reducerDigest: string;
}>;
executeCommand: (input: Readonly<{
schema: "receiz.world.command_plan.v1";
planId: string;
planDigest: string;
command: import("@receiz/sdk").ReceizWorldCommandV1;
priorHeads: Readonly<Record<string, string>>;
worldHead: string;
registryDigest: string;
reducerDigest: string;
writesOnFailure: 0;
}>) => Promise<Readonly<{
ok: false;
schema: "receiz.world.zero-write-failure.v1";
code: string;
message: string;
commandId: string | null;
attemptId: string | null;
writes: 0;
currentHeads: Readonly<Record<string, string>>;
worldHead: string;
registryDigest: string;
reducerDigest: string;
}> | Readonly<{
ok: true;
receipt: import("@receiz/sdk").ReceizWorldReceiptV1;
events: readonly import("@receiz/sdk").ReceizWorldEventV1[];
}>>;
planTransaction: (input: Readonly<{
participants: readonly string[];
expectedHeads: Readonly<Record<string, string>>;
commands: readonly import("@receiz/sdk").ReceizWorldCommandV1[];
}>) => Promise<Readonly<{
schema: "receiz.world.transaction.v1";
transactionId: string;
transactionDigest: string;
worldId: string;
participants: readonly string[];
expectedHeads: Readonly<Record<string, string>>;
commands: readonly import("@receiz/sdk").ReceizWorldCommandV1[];
registryDigest: string;
reducerDigest: string;
}>>;
executeTransaction: (input: Readonly<{
schema: "receiz.world.transaction.v1";
transactionId: string;
transactionDigest: string;
worldId: string;
participants: readonly string[];
expectedHeads: Readonly<Record<string, string>>;
commands: readonly import("@receiz/sdk").ReceizWorldCommandV1[];
registryDigest: string;
reducerDigest: string;
}>) => Promise<Readonly<{
ok: false;
schema: "receiz.world.zero-write-failure.v1";
code: string;
message: string;
commandId: string | null;
attemptId: string | null;
writes: 0;
currentHeads: Readonly<Record<string, string>>;
worldHead: string;
registryDigest: string;
reducerDigest: string;
}> | Readonly<{
ok: true;
receipt: import("@receiz/sdk").ReceizWorldReceiptV1;
events: readonly import("@receiz/sdk").ReceizWorldEventV1[];
}>>;
receipt: (id: string) => Promise<Readonly<{
schema: "receiz.world.receipt.v1";
receiptId: string;
commandId: string;
attemptId: string;
eventIds: readonly string[];
actorSubjectId: string;
mandateDigest?: string;
priorHeads: Readonly<Record<string, string>>;
nextHeads: Readonly<Record<string, string>>;
worldHead: string;
reducerDigest: string;
registryDigest: string;
kai: string;
}>>;
replay: (input: Readonly<{
worldId: string;
throughHead?: string;
}>) => Promise<Readonly<{
schema: "receiz.world.checkpoint.v1";
worldId: string;
throughHead: string;
events: readonly Readonly<{
schema: "receiz.world.event.v1";
eventId: string;
commandId: string;
worldId: string;
kind: string;
actorSubjectId: string;
participantSubjectIds: readonly string[];
payload: Readonly<Record<string, unknown>>;
causalParents: readonly string[];
priorHeads: Readonly<Record<string, string>>;
nextHeads: Readonly<Record<string, string>>;
priorWorldHead: string;
worldHead: string;
mandateDigest?: string;
kai: string;
registryDigest: string;
reducerDigest: string;
}>[];
subjectHeads: Readonly<Record<string, string>>;
checkpointDigest: string;
registryDigest: string;
reducerDigest: string;
}>>;
additions: (input: Readonly<{
worldId: string;
afterHead?: string;
types?: readonly string[];
}>) => Promise<Readonly<{
schema: "receiz.world.event.v1";
eventId: string;
commandId: string;
worldId: string;
kind: string;
actorSubjectId: string;
participantSubjectIds: readonly string[];
payload: Readonly<Record<string, unknown>>;
causalParents: readonly string[];
priorHeads: Readonly<Record<string, string>>;
nextHeads: Readonly<Record<string, string>>;
priorWorldHead: string;
worldHead: string;
mandateDigest?: string;
kai: string;
registryDigest: string;
reducerDigest: string;
}>[]>;
subscribe: (input: Readonly<{
worldId: string;
afterHead?: string;
types?: readonly string[];
}>) => AsyncGenerator<Readonly<{
schema: "receiz.world.event.v1";
eventId: string;
commandId: string;
worldId: string;
kind: string;
actorSubjectId: string;
participantSubjectIds: readonly string[];
payload: Readonly<Record<string, unknown>>;
causalParents: readonly string[];
priorHeads: Readonly<Record<string, string>>;
nextHeads: Readonly<Record<string, string>>;
priorWorldHead: string;
worldHead: string;
mandateDigest?: string;
kai: string;
registryDigest: string;
reducerDigest: string;
}>, void, unknown>;
}>;
}> | undefined>;
//# sourceMappingURL=index.d.ts.map