planning
Interfaces
Section titled “Interfaces”AssemblyPolicy
Section titled “AssemblyPolicy”Defined in: packages/sage/src/planning/assembly.ts:52
Policy for assembling an unsigned transaction from one Plan.
Transaction-exclusive Plans reject computeUnitLimit and
priorityFeeMicroLamports because either field adds another instruction.
Example
Section titled “Example”declare const feePayer: Address;const policy: AssemblyPolicy = { feePayer, computeUnitLimit: 400_000 };Properties
Section titled “Properties”commitment?
Section titled “commitment?”readonly optional commitment?: Commitment;Defined in: packages/sage/src/planning/assembly.ts:56
computeUnitLimit?
Section titled “computeUnitLimit?”readonly optional computeUnitLimit?: number;Defined in: packages/sage/src/planning/assembly.ts:54
feePayer
Section titled “feePayer”readonly feePayer: Address;Defined in: packages/sage/src/planning/assembly.ts:53
priorityFeeMicroLamports?
Section titled “priorityFeeMicroLamports?”readonly optional priorityFeeMicroLamports?: bigint;Defined in: packages/sage/src/planning/assembly.ts:55
ConfirmedPlanExecution
Section titled “ConfirmedPlanExecution”Defined in: packages/sage/src/planning/execution.ts:169
A transaction confirmed at the requested commitment.
Example
Section titled “Example”declare const result: ConfirmedPlanExecution;console.log(result.signature, result.slot);Properties
Section titled “Properties”commitment
Section titled “commitment”readonly commitment: Commitment;Defined in: packages/sage/src/planning/execution.ts:173
signature
Section titled “signature”readonly signature: Signature;Defined in: packages/sage/src/planning/execution.ts:171
readonly slot: bigint;Defined in: packages/sage/src/planning/execution.ts:172
status
Section titled “status”readonly status: "confirmed";Defined in: packages/sage/src/planning/execution.ts:170
CreatePlanInput
Section titled “CreatePlanInput”Defined in: packages/sage/src/planning/index.ts:504
Caller-owned fields accepted by the Plan factory.
affected and requiredSigners are intentionally absent because the
factory derives them from writable metas and ordered step signers.
Example
Section titled “Example”declare const step: PlanStep;const input: CreatePlanInput = { kind: 'fleet.move', summary: 'Move the fleet.', steps: [step], preconditions: [],};Properties
Section titled “Properties”readonly kind: string;Defined in: packages/sage/src/planning/index.ts:505
preconditions
Section titled “preconditions”readonly preconditions: readonly PlanPrecondition[];Defined in: packages/sage/src/planning/index.ts:508
readonly steps: readonly PlanStep[];Defined in: packages/sage/src/planning/index.ts:507
summary
Section titled “summary”readonly summary: string;Defined in: packages/sage/src/planning/index.ts:506
CreatePlanSequenceInput
Section titled “CreatePlanSequenceInput”Defined in: packages/sage/src/planning/plan-sequence.ts:111
Exact caller-owned input accepted by createPlanSequence.
Example
Section titled “Example”declare const step: PlanSequenceStep;const input: CreatePlanSequenceInput = { cluster: 'zink-ptr', sequenceId: 'fleet-round-trip', revision: 0, steps: [step],};Properties
Section titled “Properties”cluster
Section titled “cluster”readonly cluster: ClusterIdentity;Defined in: packages/sage/src/planning/plan-sequence.ts:112
revision
Section titled “revision”readonly revision: number;Defined in: packages/sage/src/planning/plan-sequence.ts:114
sequenceId
Section titled “sequenceId”readonly sequenceId: string;Defined in: packages/sage/src/planning/plan-sequence.ts:113
readonly steps: readonly PlanSequenceStep[];Defined in: packages/sage/src/planning/plan-sequence.ts:115
ExecutePlanOptions
Section titled “ExecutePlanOptions”Defined in: packages/sage/src/planning/execution.ts:151
Options for signing, submitting, confirming, and reconciling one Plan.
Example
Section titled “Example”import type { TransactionSigner } from '@solana/kit';
declare const feePayer: TransactionSigner;const options: ExecutePlanOptions = { feePayer };Properties
Section titled “Properties”commitment?
Section titled “commitment?”readonly optional commitment?: Commitment;Defined in: packages/sage/src/planning/execution.ts:156
computeUnitLimit?
Section titled “computeUnitLimit?”readonly optional computeUnitLimit?: number;Defined in: packages/sage/src/planning/execution.ts:154
feePayer
Section titled “feePayer”readonly feePayer: TransactionSigner;Defined in: packages/sage/src/planning/execution.ts:152
pollIntervalMs?
Section titled “pollIntervalMs?”readonly optional pollIntervalMs?: number;Defined in: packages/sage/src/planning/execution.ts:158
priorityFeeMicroLamports?
Section titled “priorityFeeMicroLamports?”readonly optional priorityFeeMicroLamports?: bigint;Defined in: packages/sage/src/planning/execution.ts:155
signers?
Section titled “signers?”readonly optional signers?: readonly TransactionSigner[];Defined in: packages/sage/src/planning/execution.ts:153
timeoutMs?
Section titled “timeoutMs?”readonly optional timeoutMs?: number;Defined in: packages/sage/src/planning/execution.ts:157
ExecutePlanSequenceOptions
Section titled “ExecutePlanSequenceOptions”Defined in: packages/sage/src/planning/plan-sequence-execution.ts:82
Inputs for one fail-closed PlanSequence execution or resume invocation.
The commitment is restricted to rollback-safe confirmed or finalized
evidence. Cancellation is observed only between steps.
Example
Section titled “Example”declare const feePayer: ExecutePlanSequenceOptions['feePayer'];declare const store: PlanSequenceStore;const options: ExecutePlanSequenceOptions = { feePayer, store };Extends
Section titled “Extends”Omit<ExecutePlanOptions,"commitment">
Properties
Section titled “Properties”commitment?
Section titled “commitment?”readonly optional commitment?: "confirmed" | "finalized";Defined in: packages/sage/src/planning/plan-sequence-execution.ts:86
computeUnitLimit?
Section titled “computeUnitLimit?”readonly optional computeUnitLimit?: number;Defined in: packages/sage/src/planning/execution.ts:154
Inherited from
Section titled “Inherited from”ExecutePlanOptions.computeUnitLimit
feePayer
Section titled “feePayer”readonly feePayer: TransactionSigner;Defined in: packages/sage/src/planning/execution.ts:152
Inherited from
Section titled “Inherited from”onBeforeSign?
Section titled “onBeforeSign?”readonly optional onBeforeSign?: (presentation) => Promise<void>;Defined in: packages/sage/src/planning/plan-sequence-execution.ts:89
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
presentation | PlanSequencePresentation |
Returns
Section titled “Returns”Promise<void>
pollIntervalMs?
Section titled “pollIntervalMs?”readonly optional pollIntervalMs?: number;Defined in: packages/sage/src/planning/execution.ts:158
Inherited from
Section titled “Inherited from”ExecutePlanOptions.pollIntervalMs
priorityFeeMicroLamports?
Section titled “priorityFeeMicroLamports?”readonly optional priorityFeeMicroLamports?: bigint;Defined in: packages/sage/src/planning/execution.ts:155
Inherited from
Section titled “Inherited from”ExecutePlanOptions.priorityFeeMicroLamports
signal?
Section titled “signal?”readonly optional signal?: AbortSignal;Defined in: packages/sage/src/planning/plan-sequence-execution.ts:88
signers?
Section titled “signers?”readonly optional signers?: readonly TransactionSigner[];Defined in: packages/sage/src/planning/execution.ts:153
Inherited from
Section titled “Inherited from”readonly store: PlanSequenceStore;Defined in: packages/sage/src/planning/plan-sequence-execution.ts:87
timeoutMs?
Section titled “timeoutMs?”readonly optional timeoutMs?: number;Defined in: packages/sage/src/planning/execution.ts:157
Inherited from
Section titled “Inherited from”Defined in: packages/sage/src/planning/index.ts:476
Inert, inspectable action data built only through planning factories.
Example
Section titled “Example”declare const plan: Plan;console.log(plan.summary);console.log(plan.describe());Properties
Section titled “Properties”[PLAN_BRAND]
Section titled “[PLAN_BRAND]”readonly [PLAN_BRAND]: true;Defined in: packages/sage/src/planning/index.ts:485
affected
Section titled “affected”readonly affected: readonly Address[];Defined in: packages/sage/src/planning/index.ts:481
readonly kind: string;Defined in: packages/sage/src/planning/index.ts:477
preconditions
Section titled “preconditions”readonly preconditions: readonly PlanPrecondition[];Defined in: packages/sage/src/planning/index.ts:480
requiredSigners
Section titled “requiredSigners”readonly requiredSigners: readonly Address[];Defined in: packages/sage/src/planning/index.ts:482
readonly steps: readonly PlanStep[];Defined in: packages/sage/src/planning/index.ts:479
summary
Section titled “summary”readonly summary: string;Defined in: packages/sage/src/planning/index.ts:478
Methods
Section titled “Methods”describe()
Section titled “describe()”describe(): readonly string[];Defined in: packages/sage/src/planning/index.ts:483
Returns
Section titled “Returns”readonly string[]
toJSON()
Section titled “toJSON()”toJSON(): PlanJson;Defined in: packages/sage/src/planning/index.ts:484
Returns
Section titled “Returns”PlanJson
Section titled “PlanJson”Defined in: packages/sage/src/planning/index.ts:439
The current persistent Plan format. Unsupported versions require a fresh Plan.
Example
Section titled “Example”declare const plan: Plan;const wire: PlanJson = plan.toJSON();console.log(wire.v);const restored = planFromJSON(wire);Properties
Section titled “Properties”affected
Section titled “affected”readonly affected: readonly string[];Defined in: packages/sage/src/planning/index.ts:463
readonly kind: string;Defined in: packages/sage/src/planning/index.ts:441
preconditions
Section titled “preconditions”readonly preconditions: readonly ( | RuntimeGuardJson | { address: string; character: string; dataHash?: undefined; describes: string; intent: { authorization: { authority: string; keyIndex: number; profile: string; }; fleet: string; game: string; journey: { departure: string; duration: string; from: { x: string; y: string; }; kind: "subwarp"; to: { x: string; y: string; }; }; profile: string; }; kind: "fleet-arrival"; regionTracker: string;} | { address: string; authority: string; certificate: string; character: string; dataHash?: undefined; describes: string; game: string; keyIndex: number; kind: "fleet-dock-funding"; profile: string; reason: | "unsupported-account-layout" | "unsupported-fleet-state" | "noncanonical-account-encoding" | "stale-definition-sequences" | "stale-starbase-sequence" | "pending-recovery" | "active-stimulants" | "funding-state-unavailable" | "accounts-below-rent-reserve" | "profile-below-storage-ceiling"; starbasePlayer: string; status: "unavailable"; system: string;} | { address: string; authority: string; cargoSequenceId: number; certificate: string; character: string; dataHash?: undefined; describes: string; fleetDataLengthBytes: number; game: string; keyIndex: number; kind: "fleet-dock-funding"; maximumProfileDebit: string; profile: string; rentExemptionThreshold: number; rentLamportsPerByteYear: string; shipSequenceId: number; starbasePlayer: string; starbaseSequenceId: string; status: "available"; system: string;} | { address: string; authority: string; count: number; dataHash?: undefined; describes: string; direction: "load" | "unload"; game: string; keyIndex: number; kind: "fleet-crew-transfer"; profile: string; starbasePlayer: string; system: string; systemSequenceId: string;} | { address: string; authority: string; character: string; configHash: string; dataHash?: undefined; describes: string; expectedSequence: string; focus: number; game: string; keyIndex: number; kind: "scan-detect"; loot: string; pattern: string; patternId: number; policy: string; policyRevision: number; profile: string; profileRevision: number; signal: string; tracker: string;} | { address: string; authority: string; character: string; configHash: string; dataHash?: undefined; describes: string; expectedSequence: string; game: string; keyIndex: number; kind: "scan-completion"; loot: string; operation: | "resolve" | "recover" | "acknowledge" | "abandon" | "expire" | "forfeit-entropy"; policy: string; profile: string; signal: string; status: number; xpBudget: string; xpConfig: string;} | { address: string; dataHash?: undefined; defender: string; defenderProfile: string; describes: string; game: string; instructionKey: string; kind: "fleet-attack"; profile: string;} | { address: string; authority: string; dataHash?: undefined; describes: string; fleetHash: string; game: string; keyIndex: number; kind: "fleet-respawn"; maximumProfileDebit: string; maximumRecoveryFee: string; phase: "complete" | "start"; profile: string; system: string;} | { address: string; dataHash?: undefined; describes: string; game: string; kind: "currency-cache";} | { address: string; dataHash?: undefined; describes: string; game: string; kind: "movement-character"; profile: string; stateHash: string;} | { address: string; dataHash?: undefined; describes: string; game: string; kind: "fleet-docking-policy"; ownership: string; starbasePlayer: string; system: string;} | { address: string; dataHash?: undefined; describes: string; game: string; kind: "starbase-system"; requireCss?: true; starbaseSequenceId: string;} | { address: string; budgetLamports: string; characterLamports: string; characterSize: number; dataHash?: undefined; describes: string; funder: string; game: string; initializationHash: string; kind: "character-registration"; maximumFunderDebit: string; profile: string; profileDataHash: string; xpBudget: string; xpBudgetConfig: string;} | { address: string; dataHash?: undefined; describes: string; game: string; kind: "ship-import-funding"; maximumProfileDebit: string; profile: string; shipId: number; system: string;} | { address: string; asteroid: string; dataHash?: undefined; describes: string; game: string; kind: "fleet-mining"; profile: string;} | { address: string; amount: string; authority: string; configHash: string; dataHash?: undefined; describes: string; game: string; keyIndex: number; kind: "fleet-add-ship"; maximumProfileDebit: string; profile: string; shipId: number; system: string;} | { address: string; authority: string; currencyCache: string; dataHash?: undefined; describes: string; game: string; keyIndex: number; kind: "research-unlock"; level: number; maximumAtlasDebit: string; maximumProfileDebit: string; nodeId: number; profile: string; researchSequenceId: number; starbasePlayer: string; system: string; xpSequenceId: number;} | { address: string; authority: string; dataHash?: undefined; describes: string; kind: "profile-storage-funding"; maximumProfileDebit: string; profile: string;} | { address: string; authority: string; authorityHash: string; character: string; dataHash?: undefined; describes: string; fleet: string; game: string; keyIndex: number; kind: "scan-signal-open"; maximumProfileDebit: string; profile: string;} | { address: string; authority: string; dataHash?: undefined; describes: string; game: string; keyIndex: number; kind: "fleet-create"; label: string; maximumProfileDebit: string; profile: string; system: string;} | { address: string; cargoId: number; dataHash?: undefined; describes: string; factionId: number; floorRaw: string; game: string; kind: "faction-treasury-buy-versioned"; schemaVersion: number;} | { address: string; atlasOutCapPerEpochRaw: string; dataHash?: undefined; describes: string; epochLengthSeconds: string; factionId: number; game: string; kind: "faction-treasury-sell-versioned"; schemaVersion: number;} | { address: string; dataHash?: undefined; describes: string; factionId: number; game: string; kind: "faction-epoch-meter-versioned"; schemaVersion: number;} | { address: string; dataHash?: undefined; describes: string; kind: "system-account-or-absent";} | { address: string; dataHash?: undefined; decimals: number; describes: string; kind: "token-mint";} | { address: string; configHash: string; dataHash?: undefined; describes: string; kind: "recipe-state"; requiredUses: string;} | { address: string; dataHash: string; describes: string; kind: "account-state";} | { address: string; dataHash?: undefined; describes: string; kind: "account-absent";} | { address: string; dataHash?: undefined; describes: string; kind: "token-account-or-absent"; mint: string; owner: string;} | { address: string; dataHash?: undefined; describes: string; kind: "token-account"; minimumBalance: string; mint: string; owner: string;} | { address: string; cargoId: number; configHash: string; dataHash?: undefined; describes: string; kind: "game-cargo-bytes-config";} | { address: string; bump: number; dataHash?: undefined; describes: string; game: string; kind: "cargo-cache";} | { address: string; configHash: string; dataHash?: undefined; describes: string; kind: "game-ship-config"; shipId: number;} | { address: string; dataHash?: undefined; describes: string; kind: "game-account";} | RuntimeWire<LocalMarketOrderGuard>)[];Defined in: packages/sage/src/planning/index.ts:457
requiredSigners
Section titled “requiredSigners”readonly requiredSigners: readonly string[];Defined in: packages/sage/src/planning/index.ts:464
readonly steps: readonly { describes: string; instruction: { accounts?: readonly { address: string; role: AccountRole; }[]; data?: string; programAddress: string; }; semantics?: readonly PlanSemanticFact[]; signers: readonly string[];}[];Defined in: packages/sage/src/planning/index.ts:443
summary
Section titled “summary”readonly summary: string;Defined in: packages/sage/src/planning/index.ts:442
readonly v: 32;Defined in: packages/sage/src/planning/index.ts:440
PlanSequence
Section titled “PlanSequence”Defined in: packages/sage/src/planning/plan-sequence.ts:129
Inert, immutable itinerary with cluster-bound resume identity.
describe() names stable step identities only. Each actual Plan remains
lazy and must be presented separately when fresh authorization is requested.
Example
Section titled “Example”declare const sequence: PlanSequence;console.log(sequence.fingerprint, sequence.describe());Properties
Section titled “Properties”cluster
Section titled “cluster”readonly cluster: ClusterIdentity;Defined in: packages/sage/src/planning/plan-sequence.ts:130
fingerprint
Section titled “fingerprint”readonly fingerprint: PlanSequenceFingerprint;Defined in: packages/sage/src/planning/plan-sequence.ts:134
revision
Section titled “revision”readonly revision: number;Defined in: packages/sage/src/planning/plan-sequence.ts:132
sequenceId
Section titled “sequenceId”readonly sequenceId: string;Defined in: packages/sage/src/planning/plan-sequence.ts:131
readonly steps: readonly PlanSequenceStep[];Defined in: packages/sage/src/planning/plan-sequence.ts:133
Methods
Section titled “Methods”describe()
Section titled “describe()”describe(): readonly string[];Defined in: packages/sage/src/planning/plan-sequence.ts:135
Returns
Section titled “Returns”readonly string[]
PlanSequenceCheckpointV1
Section titled “PlanSequenceCheckpointV1”Defined in: packages/sage/src/planning/plan-sequence-checkpoint.ts:94
Version-one caller-persisted Plan sequence checkpoint.
The value is exact-key, recursively frozen, and JSON-safe. It contains only stable sequence identity, confirmed public evidence, current write-ahead state, and caller-supplied local observation time.
Example
Section titled “Example”declare const sequence: PlanSequence;declare const callerOwnedStore: { save(value: string): Promise<void> };const checkpoint: PlanSequenceCheckpointV1 = createPlanSequenceCheckpoint( sequence, '2026-08-28T12:00:00.000Z',);await callerOwnedStore.save(stringifyPlanSequenceCheckpoint(checkpoint));Properties
Section titled “Properties”attempt?
Section titled “attempt?”readonly optional attempt?: PlanSequenceCheckpointAttemptV1;Defined in: packages/sage/src/planning/plan-sequence-checkpoint.ts:103
cluster
Section titled “cluster”readonly cluster: ClusterIdentity;Defined in: packages/sage/src/planning/plan-sequence-checkpoint.ts:97
confirmed
Section titled “confirmed”readonly confirmed: readonly PlanSequenceConfirmedStepV1[];Defined in: packages/sage/src/planning/plan-sequence-checkpoint.ts:102
fingerprint
Section titled “fingerprint”readonly fingerprint: PlanSequenceFingerprint;Defined in: packages/sage/src/planning/plan-sequence-checkpoint.ts:96
nextStepIndex
Section titled “nextStepIndex”readonly nextStepIndex: number;Defined in: packages/sage/src/planning/plan-sequence-checkpoint.ts:101
observedAt
Section titled “observedAt”readonly observedAt: string;Defined in: packages/sage/src/planning/plan-sequence-checkpoint.ts:104
revision
Section titled “revision”readonly revision: number;Defined in: packages/sage/src/planning/plan-sequence-checkpoint.ts:99
sequenceId
Section titled “sequenceId”readonly sequenceId: string;Defined in: packages/sage/src/planning/plan-sequence-checkpoint.ts:98
stepIds
Section titled “stepIds”readonly stepIds: readonly string[];Defined in: packages/sage/src/planning/plan-sequence-checkpoint.ts:100
readonly v: 1;Defined in: packages/sage/src/planning/plan-sequence-checkpoint.ts:95
PlanSequenceConfirmedStepV1
Section titled “PlanSequenceConfirmedStepV1”Defined in: packages/sage/src/planning/plan-sequence-checkpoint.ts:28
Persisted public confirmation evidence for one completed sequence step.
Slots use canonical unsigned decimal strings so checkpoint values remain directly JSON-serializable without losing integer precision.
Example
Section titled “Example”declare const confirmed: PlanSequenceConfirmedStepV1;console.log(confirmed.stepId, confirmed.slot);Properties
Section titled “Properties”commitment
Section titled “commitment”readonly commitment: "confirmed" | "finalized";Defined in: packages/sage/src/planning/plan-sequence-checkpoint.ts:33
readonly index: number;Defined in: packages/sage/src/planning/plan-sequence-checkpoint.ts:30
signature
Section titled “signature”readonly signature: Signature;Defined in: packages/sage/src/planning/plan-sequence-checkpoint.ts:31
readonly slot: string;Defined in: packages/sage/src/planning/plan-sequence-checkpoint.ts:32
stepId
Section titled “stepId”readonly stepId: string;Defined in: packages/sage/src/planning/plan-sequence-checkpoint.ts:29
PlanSequencePresentation
Section titled “PlanSequencePresentation”Defined in: packages/sage/src/planning/plan-sequence-execution.ts:63
Fresh single-transaction authorization detail presented before signing.
Example
Section titled “Example”declare const presentation: PlanSequencePresentation;console.log(presentation.stepId, presentation.description);Properties
Section titled “Properties”description
Section titled “description”readonly description: readonly string[];Defined in: packages/sage/src/planning/plan-sequence-execution.ts:67
readonly index: number;Defined in: packages/sage/src/planning/plan-sequence-execution.ts:65
readonly plan: Plan;Defined in: packages/sage/src/planning/plan-sequence-execution.ts:66
stepId
Section titled “stepId”readonly stepId: string;Defined in: packages/sage/src/planning/plan-sequence-execution.ts:64
PlanSequenceStep
Section titled “PlanSequenceStep”Defined in: packages/sage/src/planning/plan-sequence.ts:93
One stable lazy step in a Plan sequence.
The callback may close over capability context. It creates no Plan until the caller reaches this step and invokes it with current progress.
Example
Section titled “Example”declare const plan: Plan;const step: PlanSequenceStep = { id: 'undock', prepare: async () => ({ status: 'ready', plan }),};Properties
Section titled “Properties”readonly id: string;Defined in: packages/sage/src/planning/plan-sequence.ts:94
Methods
Section titled “Methods”prepare()
Section titled “prepare()”prepare(context): Promise<PlanSequenceReadiness>;Defined in: packages/sage/src/planning/plan-sequence.ts:95
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
context | PlanSequenceStepContext |
Returns
Section titled “Returns”Promise<PlanSequenceReadiness>
PlanSequenceStore
Section titled “PlanSequenceStore”Defined in: packages/sage/src/planning/plan-sequence-execution.ts:51
Caller-owned durable checkpoint boundary.
Resolution of save() acknowledges that the checkpoint is durable. The SDK
never signs or enters a submission boundary until the required save resolves.
Example
Section titled “Example”const store: PlanSequenceStore = { save: async (checkpoint) => localStorage.setItem('journey', JSON.stringify(checkpoint)),};Methods
Section titled “Methods”save()
Section titled “save()”save(checkpoint): Promise<void>;Defined in: packages/sage/src/planning/plan-sequence-execution.ts:52
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
checkpoint | PlanSequenceCheckpointV1 |
Returns
Section titled “Returns”Promise<void>
PlanStep
Section titled “PlanStep”Defined in: packages/sage/src/planning/index.ts:102
One ordered instruction and its game-language signer requirements.
Example
Section titled “Example”declare const step: PlanStep;console.log(step.describes, step.signers);Properties
Section titled “Properties”describes
Section titled “describes”readonly describes: string;Defined in: packages/sage/src/planning/index.ts:104
instruction
Section titled “instruction”readonly instruction: Instruction<string, readonly AccountMeta<string>[]>;Defined in: packages/sage/src/planning/index.ts:103
semantics?
Section titled “semantics?”readonly optional semantics?: readonly PlanSemanticFact[];Defined in: packages/sage/src/planning/index.ts:105
signers
Section titled “signers”readonly signers: readonly Address[];Defined in: packages/sage/src/planning/index.ts:106
SimulationOptions
Section titled “SimulationOptions”Defined in: packages/sage/src/planning/simulation.ts:35
Optional RPC constraints for one unsigned simulation, not assembly overrides.
The SDK accepts the full u64 range. Kit’s default RPC transport only encodes integers through 9007199254740991; larger floors require a capable custom transport. Never round or lower a required floor merely to encode it.
Example
Section titled “Example”const options: SimulationOptions = { minContextSlot: 53_000_000n };Properties
Section titled “Properties”minContextSlot?
Section titled “minContextSlot?”readonly optional minContextSlot?: bigint;Defined in: packages/sage/src/planning/simulation.ts:37
Inclusive node context floor, from zero through the unsigned 64-bit maximum.
SimulationResult
Section titled “SimulationResult”Defined in: packages/sage/src/planning/simulation.ts:171
Node-provenance result from simulating one unsigned Plan.
Example
Section titled “Example”declare const result: SimulationResult;console.log(result.slot, result.replacementBlockhash.blockhash);Properties
Section titled “Properties”readonly logs: readonly string[];Defined in: packages/sage/src/planning/simulation.ts:174
replacementBlockhash
Section titled “replacementBlockhash”readonly replacementBlockhash: Readonly<{ blockhash: string; lastValidBlockHeight: bigint;}>;Defined in: packages/sage/src/planning/simulation.ts:176
returnData?
Section titled “returnData?”readonly optional returnData?: SimulationReturnData;Defined in: packages/sage/src/planning/simulation.ts:175
readonly slot: bigint;Defined in: packages/sage/src/planning/simulation.ts:172
unitsConsumed
Section titled “unitsConsumed”readonly unitsConsumed: bigint | undefined;Defined in: packages/sage/src/planning/simulation.ts:173
SimulationReturnData
Section titled “SimulationReturnData”Defined in: packages/sage/src/planning/simulation.ts:158
Return data emitted by the last program to set it during simulation.
Example
Section titled “Example”declare const returnData: SimulationReturnData;console.log(returnData.programAddress, returnData.data);Properties
Section titled “Properties”readonly data: string;Defined in: packages/sage/src/planning/simulation.ts:160
programAddress
Section titled “programAddress”readonly programAddress: Address;Defined in: packages/sage/src/planning/simulation.ts:159
Type Aliases
Section titled “Type Aliases”ConfirmedStep
Section titled “ConfirmedStep”type ConfirmedStep = Readonly<{ commitment: "confirmed" | "finalized"; index: number; signature: Signature; slot: bigint; stepId: string;}>;Defined in: packages/sage/src/planning/plan-sequence.ts:37
Public confirmation evidence available to later lazy step preparation.
Example
Section titled “Example”declare const confirmed: ConfirmedStep;console.log(confirmed.stepId, confirmed.signature);PlanExecutionResult
Section titled “PlanExecutionResult”type PlanExecutionResult = | ConfirmedPlanExecution | UnknownPlanExecution;Defined in: packages/sage/src/planning/execution.ts:215
Every non-throwing terminal outcome from executePlan.
Example
Section titled “Example”declare const result: PlanExecutionResult;if (result.status === 'unknown') console.log(result.signature);PlanPrecondition
Section titled “PlanPrecondition”type PlanPrecondition = | FleetDockFundingGuard | LocalMarketOrderGuard | FleetCrewGuard | ScanDetectGuard | ScanCompletionGuard | RuntimeGuard | FleetAttackGuard | FleetArrivalGuard | { address: Address; authority: Address; dataHash?: never; describes: string; fleetHash: string; game: Address; keyIndex: number; kind: "fleet-respawn"; maximumProfileDebit: bigint; maximumRecoveryFee: bigint; phase: "start" | "complete"; profile: Address; system: Address;} | { address: Address; dataHash?: never; describes: string; game: Address; kind: "currency-cache";} | { address: Address; dataHash?: never; describes: string; game: Address; kind: "movement-character"; profile: Address; stateHash: string;} | { address: Address; dataHash?: never; describes: string; game: Address; kind: "fleet-docking-policy"; ownership: Address; starbasePlayer: Address; system: Address;} | { address: Address; dataHash?: never; describes: string; game: Address; kind: "starbase-system"; requireCss?: true; starbaseSequenceId: bigint;} | { address: Address; budgetLamports: bigint; characterLamports: bigint; characterSize: number; dataHash?: never; describes: string; funder: Address; game: Address; initializationHash: string; kind: "character-registration"; maximumFunderDebit: bigint; profile: Address; profileDataHash: string; xpBudget: Address; xpBudgetConfig: Address;} | { address: Address; dataHash?: never; describes: string; game: Address; kind: "ship-import-funding"; maximumProfileDebit: bigint; profile: Address; shipId: number; system: Address;} | { address: Address; asteroid: Address; dataHash?: never; describes: string; game: Address; kind: "fleet-mining"; profile: Address;} | { address: Address; amount: bigint; authority: Address; configHash: string; dataHash?: never; describes: string; game: Address; keyIndex: number; kind: "fleet-add-ship"; maximumProfileDebit: bigint; profile: Address; shipId: number; system: Address;} | { address: Address; authority: Address; currencyCache: Address; dataHash?: never; describes: string; game: Address; keyIndex: number; kind: "research-unlock"; level: number; maximumAtlasDebit: bigint; maximumProfileDebit: bigint; nodeId: number; profile: Address; researchSequenceId: number; starbasePlayer: Address; system: Address; xpSequenceId: number;} | { address: Address; authority: Address; dataHash?: never; describes: string; kind: "profile-storage-funding"; maximumProfileDebit: bigint; profile: Address;} | OpenSignalGuard | { address: Address; authority: Address; dataHash?: never; describes: string; game: Address; keyIndex: number; kind: "fleet-create"; label: string; maximumProfileDebit: bigint; profile: Address; system: Address;} | { address: Address; cargoId: number; dataHash?: never; describes: string; factionId: number; floorRaw: bigint; game: Address; kind: "faction-treasury-buy-versioned"; schemaVersion: number;} | { address: Address; atlasOutCapPerEpochRaw: bigint; dataHash?: never; describes: string; epochLengthSeconds: bigint; factionId: number; game: Address; kind: "faction-treasury-sell-versioned"; schemaVersion: number;} | { address: Address; dataHash?: never; describes: string; factionId: number; game: Address; kind: "faction-epoch-meter-versioned"; schemaVersion: number;} | { address: Address; dataHash?: never; describes: string; kind: "system-account-or-absent";} | { address: Address; dataHash?: never; decimals: number; describes: string; kind: "token-mint";} | { address: Address; configHash: string; dataHash?: never; describes: string; kind: "recipe-state"; requiredUses: bigint;} | { address: Address; dataHash: string; describes: string; kind: "account-state";} | { address: Address; dataHash?: never; describes: string; kind: "account-absent";} | { address: Address; dataHash?: never; describes: string; kind: "token-account-or-absent"; mint: Address; owner: Address;} | { address: Address; dataHash?: never; describes: string; kind: "token-account"; minimumBalance: bigint; mint: Address; owner: Address;} | { address: Address; cargoId: number; configHash: string; dataHash?: never; describes: string; kind: "game-cargo-bytes-config";} | { address: Address; bump: number; dataHash?: never; describes: string; game: Address; kind: "cargo-cache";} | { address: Address; configHash: string; dataHash?: never; describes: string; kind: "game-ship-config"; shipId: number;} | { address: Address; dataHash?: never; describes: string; kind: "game-account";};Defined in: packages/sage/src/planning/index.ts:117
A closure-free account freshness guard recorded at planning time.
Union Members
Section titled “Union Members”FleetDockFundingGuard
LocalMarketOrderGuard
FleetCrewGuard
ScanDetectGuard
ScanCompletionGuard
RuntimeGuard
FleetAttackGuard
FleetArrivalGuard
Type Literal
Section titled “Type Literal”{ address: Address; authority: Address; dataHash?: never; describes: string; fleetHash: string; game: Address; keyIndex: number; kind: "fleet-respawn"; maximumProfileDebit: bigint; maximumRecoveryFee: bigint; phase: "start" | "complete"; profile: Address; system: Address;}address
Section titled “address”readonly address: Address;authority
Section titled “authority”readonly authority: Address;dataHash?
Section titled “dataHash?”readonly optional dataHash?: never;describes
Section titled “describes”readonly describes: string;fleetHash
Section titled “fleetHash”readonly fleetHash: string;readonly game: Address;keyIndex
Section titled “keyIndex”readonly keyIndex: number;readonly kind: "fleet-respawn";Standalone player-initiated recovery with observed ATLAS and Profile funding ceilings.
maximumProfileDebit
Section titled “maximumProfileDebit”readonly maximumProfileDebit: bigint;maximumRecoveryFee
Section titled “maximumRecoveryFee”readonly maximumRecoveryFee: bigint;readonly phase: "start" | "complete";profile
Section titled “profile”readonly profile: Address;system
Section titled “system”readonly system: Address;Type Literal
Section titled “Type Literal”{ address: Address; dataHash?: never; describes: string; game: Address; kind: "currency-cache";}address
Section titled “address”readonly address: Address;dataHash?
Section titled “dataHash?”readonly optional dataHash?: never;describes
Section titled “describes”readonly describes: string;readonly game: Address;readonly kind: "currency-cache";Canonical CurrencyCache identity; shared vault/withdrawal accounting may change.
Type Literal
Section titled “Type Literal”{ address: Address; dataHash?: never; describes: string; game: Address; kind: "movement-character"; profile: Address; stateHash: string;}address
Section titled “address”readonly address: Address;dataHash?
Section titled “dataHash?”readonly optional dataHash?: never;describes
Section titled “describes”readonly describes: string;readonly game: Address;readonly kind: "movement-character";Canonical movement Character; earned XP accrual may change but other state remains bound.
profile
Section titled “profile”readonly profile: Address;stateHash
Section titled “stateHash”readonly stateHash: string;Type Literal
Section titled “Type Literal”{ address: Address; dataHash?: never; describes: string; game: Address; kind: "fleet-docking-policy"; ownership: Address; starbasePlayer: Address; system: Address;}address
Section titled “address”readonly address: Address;dataHash?
Section titled “dataHash?”readonly optional dataHash?: never;describes
Section titled “describes”readonly describes: string;readonly game: Address;readonly kind: "fleet-docking-policy";Docking admission: the canonical Game tracker, System ownership and docking Starbase Player. Execution reads the Starbase owner, generation and Starbase Player faction from fresh account data.
ownership
Section titled “ownership”readonly ownership: Address;starbasePlayer
Section titled “starbasePlayer”readonly starbasePlayer: Address;system
Section titled “system”readonly system: Address;Type Literal
Section titled “Type Literal”{ address: Address; dataHash?: never; describes: string; game: Address; kind: "starbase-system"; requireCss?: true; starbaseSequenceId: bigint;}address
Section titled “address”readonly address: Address;dataHash?
Section titled “dataHash?”readonly optional dataHash?: never;describes
Section titled “describes”readonly describes: string;readonly game: Address;readonly kind: "starbase-system";Canonical System with an active Starbase in the expected generation; unrelated activity may change.
requireCss?
Section titled “requireCss?”readonly optional requireCss?: true;Required by wallet deposits and ship imports; cancellation/withdrawal allow any active Starbase.
starbaseSequenceId
Section titled “starbaseSequenceId”readonly starbaseSequenceId: bigint;Type Literal
Section titled “Type Literal”{ address: Address; budgetLamports: bigint; characterLamports: bigint; characterSize: number; dataHash?: never; describes: string; funder: Address; game: Address; initializationHash: string; kind: "character-registration"; maximumFunderDebit: bigint; profile: Address; profileDataHash: string; xpBudget: Address; xpBudgetConfig: Address;}address
Section titled “address”readonly address: Address;budgetLamports
Section titled “budgetLamports”readonly budgetLamports: bigint;characterLamports
Section titled “characterLamports”readonly characterLamports: bigint;characterSize
Section titled “characterSize”readonly characterSize: number;dataHash?
Section titled “dataHash?”readonly optional dataHash?: never;describes
Section titled “describes”readonly describes: string;funder
Section titled “funder”readonly funder: Address;readonly game: Address;initializationHash
Section titled “initializationHash”readonly initializationHash: string;readonly kind: "character-registration";Exact current-runtime Character and Career XP creation with capped wallet funding.
maximumFunderDebit
Section titled “maximumFunderDebit”readonly maximumFunderDebit: bigint;profile
Section titled “profile”readonly profile: Address;profileDataHash
Section titled “profileDataHash”readonly profileDataHash: string;xpBudget
Section titled “xpBudget”readonly xpBudget: Address;xpBudgetConfig
Section titled “xpBudgetConfig”readonly xpBudgetConfig: Address;Type Literal
Section titled “Type Literal”{ address: Address; dataHash?: never; describes: string; game: Address; kind: "ship-import-funding"; maximumProfileDebit: bigint; profile: Address; shipId: number; system: Address;}address
Section titled “address”readonly address: Address;dataHash?
Section titled “dataHash?”readonly optional dataHash?: never;describes
Section titled “describes”readonly describes: string;readonly game: Address;readonly kind: "ship-import-funding";Fresh Profile reserve and capped storage funding for one imported ship configuration.
maximumProfileDebit
Section titled “maximumProfileDebit”readonly maximumProfileDebit: bigint;profile
Section titled “profile”readonly profile: Address;shipId
Section titled “shipId”readonly shipId: number;system
Section titled “system”readonly system: Address;Type Literal
Section titled “Type Literal”{ address: Address; asteroid: Address; dataHash?: never; describes: string; game: Address; kind: "fleet-mining"; profile: Address;}address
Section titled “address”readonly address: Address;asteroid
Section titled “asteroid”readonly asteroid: Address;dataHash?
Section titled “dataHash?”readonly optional dataHash?: never;describes
Section titled “describes”readonly describes: string;readonly game: Address;readonly kind: "fleet-mining";Fleet identity and active mining target must still match before signing.
profile
Section titled “profile”readonly profile: Address;Type Literal
Section titled “Type Literal”{ address: Address; amount: bigint; authority: Address; configHash: string; dataHash?: never; describes: string; game: Address; keyIndex: number; kind: "fleet-add-ship"; maximumProfileDebit: bigint; profile: Address; shipId: number; system: Address;}address
Section titled “address”readonly address: Address;amount
Section titled “amount”readonly amount: bigint;authority
Section titled “authority”readonly authority: Address;configHash
Section titled “configHash”readonly configHash: string;dataHash?
Section titled “dataHash?”readonly optional dataHash?: never;describes
Section titled “describes”readonly describes: string;readonly game: Address;keyIndex
Section titled “keyIndex”readonly keyIndex: number;readonly kind: "fleet-add-ship";Exact ship assembly intent; eligibility and capped Profile rent funding are rechecked before signing.
maximumProfileDebit
Section titled “maximumProfileDebit”readonly maximumProfileDebit: bigint;profile
Section titled “profile”readonly profile: Address;shipId
Section titled “shipId”readonly shipId: number;system
Section titled “system”readonly system: Address;Type Literal
Section titled “Type Literal”{ address: Address; authority: Address; currencyCache: Address; dataHash?: never; describes: string; game: Address; keyIndex: number; kind: "research-unlock"; level: number; maximumAtlasDebit: bigint; maximumProfileDebit: bigint; nodeId: number; profile: Address; researchSequenceId: number; starbasePlayer: Address; system: Address; xpSequenceId: number;}address
Section titled “address”readonly address: Address;The canonical Character that pays and receives the node.
authority
Section titled “authority”readonly authority: Address;currencyCache
Section titled “currencyCache”readonly currencyCache: Address;dataHash?
Section titled “dataHash?”readonly optional dataHash?: never;describes
Section titled “describes”readonly describes: string;readonly game: Address;keyIndex
Section titled “keyIndex”readonly keyIndex: number;readonly kind: "research-unlock";Exact next level of one research node; eligibility, costs and the ATLAS debit ceiling are rechecked before signing.
readonly level: number;The level the node reaches; the current stored level plus one.
maximumAtlasDebit
Section titled “maximumAtlasDebit”readonly maximumAtlasDebit: bigint;Exact observed ATLAS Floyd debit; execution rejects a higher cost.
maximumProfileDebit
Section titled “maximumProfileDebit”readonly maximumProfileDebit: bigint;Conservative Profile lamport debit for Character and Starbase Player storage; execution rejects a higher debit.
nodeId
Section titled “nodeId”readonly nodeId: number;profile
Section titled “profile”readonly profile: Address;researchSequenceId
Section titled “researchSequenceId”readonly researchSequenceId: number;starbasePlayer
Section titled “starbasePlayer”readonly starbasePlayer: Address;system
Section titled “system”readonly system: Address;xpSequenceId
Section titled “xpSequenceId”readonly xpSequenceId: number;Type Literal
Section titled “Type Literal”{ address: Address; authority: Address; dataHash?: never; describes: string; kind: "profile-storage-funding"; maximumProfileDebit: bigint; profile: Address;}address
Section titled “address”readonly address: Address;The first account the action resizes.
authority
Section titled “authority”readonly authority: Address;dataHash?
Section titled “dataHash?”readonly optional dataHash?: never;describes
Section titled “describes”readonly describes: string;readonly kind: "profile-storage-funding";Account storage one action funds from the Profile vault. Execution rederives what the action resizes from its instruction and fresh accounts, then rechecks the debit ceiling, signing key and Profile balance before signing.
maximumProfileDebit
Section titled “maximumProfileDebit”readonly maximumProfileDebit: bigint;Planned Profile lamport debit; execution rejects a higher debit.
profile
Section titled “profile”readonly profile: Address;OpenSignalGuard
Type Literal
Section titled “Type Literal”{ address: Address; authority: Address; dataHash?: never; describes: string; game: Address; keyIndex: number; kind: "fleet-create"; label: string; maximumProfileDebit: bigint; profile: Address; system: Address;}address
Section titled “address”readonly address: Address;authority
Section titled “authority”readonly authority: Address;dataHash?
Section titled “dataHash?”readonly optional dataHash?: never;describes
Section titled “describes”readonly describes: string;readonly game: Address;keyIndex
Section titled “keyIndex”readonly keyIndex: number;readonly kind: "fleet-create";Exact creation intent; required eligibility is revalidated with a capped Profile debit.
readonly label: string;maximumProfileDebit
Section titled “maximumProfileDebit”readonly maximumProfileDebit: bigint;profile
Section titled “profile”readonly profile: Address;system
Section titled “system”readonly system: Address;Type Literal
Section titled “Type Literal”{ address: Address; cargoId: number; dataHash?: never; describes: string; factionId: number; floorRaw: bigint; game: Address; kind: "faction-treasury-buy-versioned"; schemaVersion: number;}address
Section titled “address”readonly address: Address;cargoId
Section titled “cargoId”readonly cargoId: number;dataHash?
Section titled “dataHash?”readonly optional dataHash?: never;describes
Section titled “describes”readonly describes: string;factionId
Section titled “factionId”readonly factionId: number;floorRaw
Section titled “floorRaw”readonly floorRaw: bigint;readonly game: Address;readonly kind: "faction-treasury-buy-versioned";Canonical Treasury and selected cargo floor; live stock may change.
schemaVersion
Section titled “schemaVersion”readonly schemaVersion: number;Observed account schema byte; not an activity counter.
Type Literal
Section titled “Type Literal”{ address: Address; atlasOutCapPerEpochRaw: bigint; dataHash?: never; describes: string; epochLengthSeconds: bigint; factionId: number; game: Address; kind: "faction-treasury-sell-versioned"; schemaVersion: number;}address
Section titled “address”readonly address: Address;atlasOutCapPerEpochRaw
Section titled “atlasOutCapPerEpochRaw”readonly atlasOutCapPerEpochRaw: bigint;dataHash?
Section titled “dataHash?”readonly optional dataHash?: never;describes
Section titled “describes”readonly describes: string;epochLengthSeconds
Section titled “epochLengthSeconds”readonly epochLengthSeconds: bigint;factionId
Section titled “factionId”readonly factionId: number;readonly game: Address;readonly kind: "faction-treasury-sell-versioned";Canonical Treasury payout rules; vault and epoch activity may change.
schemaVersion
Section titled “schemaVersion”readonly schemaVersion: number;Observed account schema byte; not an activity counter.
Type Literal
Section titled “Type Literal”{ address: Address; dataHash?: never; describes: string; factionId: number; game: Address; kind: "faction-epoch-meter-versioned"; schemaVersion: number;}address
Section titled “address”readonly address: Address;dataHash?
Section titled “dataHash?”readonly optional dataHash?: never;describes
Section titled “describes”readonly describes: string;factionId
Section titled “factionId”readonly factionId: number;readonly game: Address;readonly kind: "faction-epoch-meter-versioned";Canonical aggregate meter; epoch and accrual counters may change.
schemaVersion
Section titled “schemaVersion”readonly schemaVersion: number;Observed account schema byte; not an activity counter.
Type Literal
Section titled “Type Literal”{ address: Address; dataHash?: never; describes: string; kind: "system-account-or-absent";}address
Section titled “address”readonly address: Address;dataHash?
Section titled “dataHash?”readonly optional dataHash?: never;describes
Section titled “describes”readonly describes: string;readonly kind: "system-account-or-absent";Absent wallet or an empty, non-executable System account; native funding may change.
Type Literal
Section titled “Type Literal”{ address: Address; dataHash?: never; decimals: number; describes: string; kind: "token-mint";}address
Section titled “address”readonly address: Address;dataHash?
Section titled “dataHash?”readonly optional dataHash?: never;decimals
Section titled “decimals”readonly decimals: number;describes
Section titled “describes”readonly describes: string;readonly kind: "token-mint";Initialized original Token Mint with unchanged decimals; supply and authorities may change.
Type Literal
Section titled “Type Literal”{ address: Address; configHash: string; dataHash?: never; describes: string; kind: "recipe-state"; requiredUses: bigint;}address
Section titled “address”readonly address: Address;configHash
Section titled “configHash”readonly configHash: string;dataHash?
Section titled “dataHash?”readonly optional dataHash?: never;describes
Section titled “describes”readonly describes: string;readonly kind: "recipe-state";Recipe configuration excluding concurrent usage; starts require remaining uses.
requiredUses
Section titled “requiredUses”readonly requiredUses: bigint;Type Literal
Section titled “Type Literal”{ address: Address; dataHash: string; describes: string; kind: "account-state";}Type Literal
Section titled “Type Literal”{ address: Address; dataHash?: never; describes: string; kind: "account-absent";}Type Literal
Section titled “Type Literal”{ address: Address; dataHash?: never; describes: string; kind: "token-account-or-absent"; mint: Address; owner: Address;}address
Section titled “address”readonly address: Address;dataHash?
Section titled “dataHash?”readonly optional dataHash?: never;describes
Section titled “describes”readonly describes: string;readonly kind: "token-account-or-absent";Tolerates concurrent idempotent creation of a matching original Token account.
readonly mint: Address;readonly owner: Address;Token authority, distinct from the fixed original Token program owner.
Type Literal
Section titled “Type Literal”{ address: Address; dataHash?: never; describes: string; kind: "token-account"; minimumBalance: bigint; mint: Address; owner: Address;}Type Literal
Section titled “Type Literal”{ address: Address; cargoId: number; configHash: string; dataHash?: never; describes: string; kind: "game-cargo-bytes-config";}address
Section titled “address”readonly address: Address;cargoId
Section titled “cargoId”readonly cargoId: number;configHash
Section titled “configHash”readonly configHash: string;dataHash?
Section titled “dataHash?”readonly optional dataHash?: never;describes
Section titled “describes”readonly describes: string;readonly kind: "game-cargo-bytes-config";The selected pinned cargo encoding and cache address remain identical.
Type Literal
Section titled “Type Literal”{ address: Address; bump: number; dataHash?: never; describes: string; game: Address; kind: "cargo-cache";}Type Literal
Section titled “Type Literal”{ address: Address; configHash: string; dataHash?: never; describes: string; kind: "game-ship-config"; shipId: number;}address
Section titled “address”readonly address: Address;configHash
Section titled “configHash”readonly configHash: string;SHA-256 of the owner and complete pinned Ship encoding.
dataHash?
Section titled “dataHash?”readonly optional dataHash?: never;describes
Section titled “describes”readonly describes: string;readonly kind: "game-ship-config";The selected ship configuration remains identical.
shipId
Section titled “shipId”readonly shipId: number;Explicit unsigned 16-bit configuration ID in this Game.
Type Literal
Section titled “Type Literal”{ address: Address; dataHash?: never; describes: string; kind: "game-account";}address
Section titled “address”readonly address: Address;dataHash?
Section titled “dataHash?”readonly optional dataHash?: never;describes
Section titled “describes”readonly describes: string;readonly kind: "game-account";Existing non-executable C4 Game with a valid complete layout; no definition equality check.
Example
Section titled “Example”declare const precondition: PlanPrecondition;console.log(precondition.address, precondition.kind);PlanSemanticFact
Section titled “PlanSemanticFact”type PlanSemanticFact = | { kind: "exclusive"; scope: "transaction";} | { fact: string; kind: "requires"; resource: string;} | { fact: string; kind: "invalidates"; resource: string;} | { from: string; kind: "transition"; resource: string; to: string;};Defined in: packages/sage/src/planning/index.ts:71
One capability-authored opaque fact used to review Plan composition.
The planning core preserves these exact strings without interpreting capability vocabulary or inferring negation conventions.
Union Members
Section titled “Union Members”Type Literal
Section titled “Type Literal”{ kind: "exclusive"; scope: "transaction";}readonly kind: "exclusive";Requires this step to be the only instruction in its transaction.
readonly scope: "transaction";Type Literal
Section titled “Type Literal”{ fact: string; kind: "requires"; resource: string;}Type Literal
Section titled “Type Literal”{ fact: string; kind: "invalidates"; resource: string;}Type Literal
Section titled “Type Literal”{ from: string; kind: "transition"; resource: string; to: string;}Example
Section titled “Example”const fact: PlanSemanticFact = { kind: 'requires', resource: 'fleet:Ravager', fact: 'idle',};PlanSequenceCheckpointAttemptV1
Section titled “PlanSequenceCheckpointAttemptV1”type PlanSequenceCheckpointAttemptV1 = | Readonly<{ index: number; phase: "prepared"; signerMode: "observable" | "opaque"; stepId: string;}> | Readonly<{ index: number; lifetime?: | Readonly<{ contextSlot: string; lastValidBlockHeight: string; }> | null; phase: "signed"; signature: Signature; signerMode: "observable"; stepId: string;}> | Readonly<{ index: number; phase: "invoking"; signerMode: "opaque"; stepId: string;}>;Defined in: packages/sage/src/planning/plan-sequence-checkpoint.ts:49
One durable write-ahead attempt at the checkpoint’s next step.
Observable signers persist signed with their public signature. Opaque
combined sign/send signers persist invoking before entering that boundary.
Protect checkpoint integrity: recovery trusts its RPC-sourced lifetime
metadata. Missing lifetime evidence never establishes expiry.
Example
Section titled “Example”declare const attempt: PlanSequenceCheckpointAttemptV1;console.log(attempt.stepId, attempt.phase);PlanSequenceErrorCode
Section titled “PlanSequenceErrorCode”type PlanSequenceErrorCode = | "SEQUENCE_IDENTITY_MISMATCH" | "SEQUENCE_CHECKPOINT_INVALID" | "SEQUENCE_CONFIRMATION_UNVERIFIABLE" | "SEQUENCE_ATTEMPT_UNRESOLVED" | "SEQUENCE_PREPARATION_FAILED" | "SEQUENCE_PERSISTENCE_FAILED" | "SEQUENCE_PRESENTATION_FAILED";Defined in: packages/sage/src/planning/plan-sequence.ts:181
Sequence-owned failure codes that never carry raw callback diagnostics.
Example
Section titled “Example”const code: PlanSequenceErrorCode = 'SEQUENCE_PREPARATION_FAILED';PlanSequenceFingerprint
Section titled “PlanSequenceFingerprint”type PlanSequenceFingerprint = string & { [PLAN_SEQUENCE_FINGERPRINT_BRAND]: true;};Defined in: packages/sage/src/planning/plan-sequence.ts:25
Stable SHA-256 identity for one cluster-bound ordered Plan sequence.
Type Declaration
Section titled “Type Declaration”[PLAN_SEQUENCE_FINGERPRINT_BRAND]
Section titled “[PLAN_SEQUENCE_FINGERPRINT_BRAND]”readonly [PLAN_SEQUENCE_FINGERPRINT_BRAND]: true;Example
Section titled “Example”declare const fingerprint: PlanSequenceFingerprint;console.log(fingerprint.length); // 64PlanSequencePhase
Section titled “PlanSequencePhase”type PlanSequencePhase = | "preparing" | "prepared" | "signing" | "signed" | "invoking" | "submitted" | "confirmed";Defined in: packages/sage/src/planning/plan-sequence.ts:165
Finite lifecycle phase safe to expose in a sequence result.
Example
Section titled “Example”const phase: PlanSequencePhase = 'preparing';PlanSequenceReadiness
Section titled “PlanSequenceReadiness”type PlanSequenceReadiness = | Readonly<{ plan: Plan; status: "ready";}> | Readonly<{ notBefore?: string; reason: string; status: "waiting";}>;Defined in: packages/sage/src/planning/plan-sequence.ts:71
Exact result of freshly preparing one sequence step.
A waiting timestamp is a canonical UTC ISO-8601 string. It is advisory; the planning core neither interprets it nor polls automatically.
Example
Section titled “Example”declare const readiness: PlanSequenceReadiness;if (readiness.status === 'ready') console.log(readiness.plan.describe());PlanSequenceResult
Section titled “PlanSequenceResult”type PlanSequenceResult<Checkpoint> = | Readonly<{ checkpoint: Checkpoint; index: number; notBefore?: string; phase: "preparing"; reason: string; status: "waiting"; stepId: string;}> | Readonly<{ checkpoint: Checkpoint; index: number; phase: "preparing" | "confirmed"; status: "paused"; stepId: string;}> | Readonly<{ checkpoint: Checkpoint; code: PlanSequenceResultCode; index: number; message: string; phase: "preparing" | "prepared" | "signing"; status: "failed"; stepId: string;}> | Readonly<{ checkpoint: Checkpoint; code: "SEQUENCE_PERSISTENCE_FAILED"; index: number; message: string; phase: "signed"; signature: Signature; status: "failed"; stepId: string;}> | Readonly<{ checkpoint: Checkpoint; code: PlanSequenceResultCode; index: number; message: string; phase: "signed" | "invoking" | "submitted"; signature?: Signature; status: "unknown"; stepId: string;}> | Readonly<{ checkpoint: Checkpoint; index: number; phase: "confirmed"; signature?: Signature; status: "completed"; stepId: string;}>;Defined in: packages/sage/src/planning/plan-sequence.ts:217
Finite safe result envelope for future checkpoint-backed coordination.
The checkpoint codec supplies the generic checkpoint value. Raw errors,
signers and callback values are never fields. Signed checkpoints may retain
RPC-sourced lifetime metadata for recovery during resume.
A boundary pause is preparing before the first step or confirmed after a
completed step. If saving an observable signed attempt fails before
submission, the result remains a signature-bearing failed outcome.
Type Parameters
Section titled “Type Parameters”| Type Parameter | Default type |
|---|---|
Checkpoint | unknown |
Example
Section titled “Example”declare const result: PlanSequenceResult<{ readonly v: 1 }>;if (result.status === 'failed') console.log(result.code, result.message);PlanSequenceResultCode
Section titled “PlanSequenceResultCode”type PlanSequenceResultCode = | PlanSequenceErrorCode | SageSdkErrorCode;Defined in: packages/sage/src/planning/plan-sequence.ts:200
Finite error code carried by a failed or unknown sequence result.
Existing planning and execution errors retain their public SDK code; errors crossing callback or persistence boundaries use a sequence-owned code.
Example
Section titled “Example”const code: PlanSequenceResultCode = 'INVALID_ACTION_INPUT';PlanSequenceStatus
Section titled “PlanSequenceStatus”type PlanSequenceStatus = "waiting" | "paused" | "failed" | "unknown" | "completed";Defined in: packages/sage/src/planning/plan-sequence.ts:155
Every public sequence coordination status.
completed is the only successful terminal status.
Example
Section titled “Example”const status: PlanSequenceStatus = 'waiting';PlanSequenceStepContext
Section titled “PlanSequenceStepContext”type PlanSequenceStepContext = Readonly<{ confirmed: readonly ConfirmedStep[]; index: number; sequenceId: string; stepId: string;}>;Defined in: packages/sage/src/planning/plan-sequence.ts:53
Stable sequence progress supplied to one capability-owned step callback.
Example
Section titled “Example”declare const context: PlanSequenceStepContext;console.log(context.sequenceId, context.stepId, context.confirmed.length);UnknownPlanExecution
Section titled “UnknownPlanExecution”type UnknownPlanExecution = | Readonly<{ lastCheckedBlockHeight: bigint; lastValidBlockHeight: bigint | null; reason: "timeout"; signature: Signature; status: "unknown";}> | Readonly<{ lastCheckedBlockHeight: bigint | null; lastValidBlockHeight: bigint | null; operation: "submission" | "signature-status" | "block-height"; reason: "transport-error"; signature: Signature; status: "unknown";}>;Defined in: packages/sage/src/planning/execution.ts:184
A submitted transaction whose terminal state remains unknown.
Example
Section titled “Example”declare const result: UnknownPlanExecution;console.log(result.signature, result.lastValidBlockHeight);Functions
Section titled “Functions”assemblePlan()
Section titled “assemblePlan()”function assemblePlan( context, plan, policy): Promise<Readonly<{ messageBytes: TransactionMessageBytes; signatures: SignaturesMap;}> & TransactionWithBlockhashLifetime>;Defined in: packages/sage/src/planning/assembly.ts:279
Assembles one Plan into an unsigned blockhash-lifetime transaction.
Assembly validates compute and priority-fee policy before RPC, fetches one latest blockhash, and never signs, simulates, or submits the transaction.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
context | SageContext |
plan | Plan |
policy | AssemblyPolicy |
Returns
Section titled “Returns”Promise<Readonly<{
messageBytes: TransactionMessageBytes;
signatures: SignaturesMap;
}> & TransactionWithBlockhashLifetime>
Example
Section titled “Example”declare const ctx: SageContext;declare const plan: Plan;declare const feePayer: Address;const transaction = await assemblePlan(ctx, plan, { feePayer });combinePlans()
Section titled “combinePlans()”function combinePlans(...plans): Plan;Defined in: packages/sage/src/planning/index.ts:892
Combines one or more Plans with deterministic associative flattening.
Semantic validation is eager. Conflict indices are relative to the flattened
inputs of the combinePlans call that rejects them.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
…plans | readonly Plan[] |
Returns
Section titled “Returns”Example
Section titled “Example”declare const undock: Plan;declare const warp: Plan;const movement = combinePlans(undock, warp);console.log(movement.summary);confirmPlanSequenceCheckpointStep()
Section titled “confirmPlanSequenceCheckpointStep()”function confirmPlanSequenceCheckpointStep( checkpoint, evidence, observedAt): PlanSequenceCheckpointV1;Defined in: packages/sage/src/planning/plan-sequence-checkpoint.ts:746
Appends public confirmation evidence and advances exactly one sequence step.
A step can advance only from its matching durable signed or invoking
attempt. The attempt is cleared in the returned checkpoint.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
checkpoint | PlanSequenceCheckpointV1 |
evidence | ConfirmedStep |
observedAt | string |
Returns
Section titled “Returns”Example
Section titled “Example”declare const checkpoint: PlanSequenceCheckpointV1;declare const confirmed: ConfirmedStep;const advanced = confirmPlanSequenceCheckpointStep( checkpoint, confirmed, '2026-08-28T12:00:00.000Z',);createPlan()
Section titled “createPlan()”function createPlan(input): Plan;Defined in: packages/sage/src/planning/index.ts:682
Creates an inert branded Plan while deriving every aggregate field.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
input | CreatePlanInput |
Returns
Section titled “Returns”Example
Section titled “Example”declare const step: PlanStep;const plan = createPlan({ kind: 'fleet.move', summary: 'Move the fleet.', steps: [step], preconditions: [],});console.log(plan.affected);createPlanSequence()
Section titled “createPlanSequence()”function createPlanSequence(input): Promise<PlanSequence>;Defined in: packages/sage/src/planning/plan-sequence.ts:596
Creates an inert Plan sequence and its canonical cluster-bound fingerprint.
Construction invokes no step callback and performs no context, wallet, signer, or network work. The only asynchronous operation is WebCrypto SHA-256 over the accepted canonical identity bytes.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
input | CreatePlanSequenceInput |
Returns
Section titled “Returns”Promise<PlanSequence>
Example
Section titled “Example”declare const undockPlan: Plan;declare const dockPlan: Plan;const sequence = await createPlanSequence({ cluster: 'zink-ptr', sequenceId: 'fleet-round-trip', revision: 0, steps: [ { id: 'undock', prepare: async () => ({ status: 'ready', plan: undockPlan }), }, { id: 'dock', prepare: async ({ confirmed }) => confirmed.length === 0 ? { status: 'waiting', reason: 'Wait for undock confirmation.', notBefore: '2026-08-28T12:05:00.000Z', } : { status: 'ready', plan: dockPlan }, }, ],});console.table(sequence.describe());createPlanSequenceCheckpoint()
Section titled “createPlanSequenceCheckpoint()”function createPlanSequenceCheckpoint(sequence, observedAt): PlanSequenceCheckpointV1;Defined in: packages/sage/src/planning/plan-sequence-checkpoint.ts:537
Creates an empty checkpoint bound to one exact Plan sequence.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
sequence | PlanSequence |
observedAt | string |
Returns
Section titled “Returns”Example
Section titled “Example”declare const sequence: PlanSequence;const checkpoint = createPlanSequenceCheckpoint( sequence, '2026-08-28T12:00:00.000Z',);console.log(checkpoint.nextStepIndex); // 0executePlan()
Section titled “executePlan()”function executePlan( context, plan,options): Promise<PlanExecutionResult>;Defined in: packages/sage/src/planning/execution.ts:1791
Executes one Plan through local signer matching, freshness re-check, one submission, terminal confirmation, and confirmed-only cache invalidation.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
context | SageContext |
plan | Plan |
options | ExecutePlanOptions |
Returns
Section titled “Returns”Promise<PlanExecutionResult>
Example
Section titled “Example”import type { TransactionSigner } from '@solana/kit';
declare const ctx: SageContext;declare const plan: Plan;declare const feePayer: TransactionSigner;const result = await executePlan(ctx, plan, { feePayer });console.log(result.status, result.signature);executePlanSequence()
Section titled “executePlanSequence()”function executePlanSequence( context, sequence, checkpointSource,options): Promise<SequenceResult>;Defined in: packages/sage/src/planning/plan-sequence-execution.ts:413
Executes or resumes one PlanSequence invocation without polling or retrying.
The checkpoint may be an SDK-created object, caller-owned decoded JSON, or a JSON string. It is strictly parsed against the exact sequence before any RPC, preparation, presentation, or signer work begins. Resume can continue after confirmed success. Confirmed failure or expiry stops with the existing transaction code and unchanged attempt. Expiry assumes a trusted, complete and healthy RPC history index; optional getEpochInfo and getFirstAvailableBlock checks detect stale/pruned evidence, not missing index entries. Insufficient evidence stays SEQUENCE_ATTEMPT_UNRESOLVED.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
context | SageContext |
sequence | PlanSequence |
checkpointSource | unknown |
options | ExecutePlanSequenceOptions |
Returns
Section titled “Returns”Promise<SequenceResult>
Example
Section titled “Example”declare const ctx: SageContext;declare const sequence: PlanSequence;declare const feePayer: ExecutePlanSequenceOptions['feePayer'];let checkpointJson = stringifyPlanSequenceCheckpoint( createPlanSequenceCheckpoint(sequence, '2026-08-28T12:00:00.000Z'),);const store: PlanSequenceStore = { save: async (checkpoint) => { checkpointJson = stringifyPlanSequenceCheckpoint(checkpoint); },};const controller = new AbortController();controller.abort();const paused = await executePlanSequence(ctx, sequence, checkpointJson, { feePayer, signal: controller.signal, store,});checkpointJson = stringifyPlanSequenceCheckpoint(paused.checkpoint);const result = await executePlanSequence(ctx, sequence, checkpointJson, { feePayer, store, onBeforeSign: async ({ plan, description }) => { console.log(plan.summary); console.table(description); },});if (result.status === 'completed') console.log(result.signature);parsePlanSequenceCheckpoint()
Section titled “parsePlanSequenceCheckpoint()”function parsePlanSequenceCheckpoint(sequence, source): PlanSequenceCheckpointV1;Defined in: packages/sage/src/planning/plan-sequence-checkpoint.ts:566
Parses and validates a checkpoint against one exact Plan sequence.
The source may be a JSON string or a caller-owned parsed JSON value.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
sequence | PlanSequence |
source | unknown |
Returns
Section titled “Returns”Example
Section titled “Example”declare const sequence: PlanSequence;declare const storedJson: string;const checkpoint = parsePlanSequenceCheckpoint(sequence, storedJson);console.log(checkpoint.nextStepIndex);planFromJSON()
Section titled “planFromJSON()”function planFromJSON(json): Plan;Defined in: packages/sage/src/planning/index.ts:759
Rehydrates and validates a complete versioned Plan wire value.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
json | unknown |
Returns
Section titled “Returns”Example
Section titled “Example”declare const wire: PlanJson;const plan = planFromJSON(wire);console.log(plan.describe());setPlanSequenceCheckpointAttempt()
Section titled “setPlanSequenceCheckpointAttempt()”function setPlanSequenceCheckpointAttempt( checkpoint, attempt, observedAt): PlanSequenceCheckpointV1;Defined in: packages/sage/src/planning/plan-sequence-checkpoint.ts:678
Replaces the current write-ahead attempt without advancing sequence progress.
The first attempt must be prepared. An observable attempt may then become
signed; an opaque attempt may become invoking.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
checkpoint | PlanSequenceCheckpointV1 |
attempt | PlanSequenceCheckpointAttemptV1 |
observedAt | string |
Returns
Section titled “Returns”Example
Section titled “Example”declare const checkpoint: PlanSequenceCheckpointV1;const prepared = setPlanSequenceCheckpointAttempt( checkpoint, { stepId: checkpoint.stepIds[checkpoint.nextStepIndex]!, index: checkpoint.nextStepIndex, phase: 'prepared', signerMode: 'observable', }, '2026-08-28T12:00:00.000Z',);simulatePlan()
Section titled “simulatePlan()”function simulatePlan( context, plan, policy,options?): Promise<SimulationResult>;Defined in: packages/sage/src/planning/simulation.ts:225
Simulates one Plan without receiving or invoking a signer.
The same assembly policy used for execution produces the unsigned transaction. The node replaces its recent blockhash and verifies no signatures. Optional minContextSlot constrains only this simulation RPC. An unavailable floor rejects once without retry or fallback. The returned slot remains the node’s value; callers may separately enforce a defensive returned-slot check on successful results only. Simulation failures do not expose a context slot. The SDK accepts full-u64 floors, but Kit’s default transport encodes only through 9007199254740991; larger floors need a capable custom transport.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
context | SageContext |
plan | Plan |
policy | AssemblyPolicy |
options? | SimulationOptions |
Returns
Section titled “Returns”Promise<SimulationResult>
Example
Section titled “Example”declare const ctx: SageContext;declare const plan: Plan;declare const feePayer: Address;const result = await simulatePlan(ctx, plan, { feePayer });console.log(result.logs, result.unitsConsumed);const minimum = 53_000_000n;const fresh = await simulatePlan(ctx, plan, { feePayer }, { minContextSlot: minimum });if (fresh.slot < minimum) throw new Error('Simulation returned an older context.');stringifyPlanSequenceCheckpoint()
Section titled “stringifyPlanSequenceCheckpoint()”function stringifyPlanSequenceCheckpoint(checkpoint): string;Defined in: packages/sage/src/planning/plan-sequence-checkpoint.ts:830
Serializes one SDK-created checkpoint to canonical compact JSON.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
checkpoint | PlanSequenceCheckpointV1 |
Returns
Section titled “Returns”string
Example
Section titled “Example”declare const checkpoint: PlanSequenceCheckpointV1;declare const callerOwnedStore: { save(value: string): Promise<void> };const storedJson = stringifyPlanSequenceCheckpoint(checkpoint);await callerOwnedStore.save(storedJson);