Skip to content
Next — unreleased

Defined in: packages/sage/src/crafting/actions/index.ts:140

Inputs for cancelling one Crafting Process.

Cancellation has no timing rule, so it takes no timestamp. Final inventory capacity, permissions, input and crew returns, and account closure remain chain-authoritative.

declare const authorization: PlanAuthorization;
const options: PlanCancelCraftingProcessOptions = { authorization };

readonly authorization: PlanAuthorization;

Defined in: packages/sage/src/crafting/actions/index.ts:141


Defined in: packages/sage/src/crafting/actions/index.ts:123

Inputs for completing one Crafting Process.

atUnixSeconds is an explicit non-negative Unix timestamp used only for the deterministic local lifecycle check. Final permission, freshness, output capacity, XP, and account closure remain chain-authoritative.

declare const authorization: PlanAuthorization;
const options: PlanCompleteCraftingProcessOptions = {
authorization,
atUnixSeconds: 1_700_004_000n,
};

readonly atUnixSeconds: bigint;

Defined in: packages/sage/src/crafting/actions/index.ts:125

readonly authorization: PlanAuthorization;

Defined in: packages/sage/src/crafting/actions/index.ts:124


Defined in: packages/sage/src/crafting/actions/index.ts:98

Inputs for starting one exact Crafting Process.

quantity is a positive raw unsigned-u64 integer. numCrew is the exact crew count requested by the instruction, at least 1 and within unsigned u32. With a Crafting Hab the job reserves numCrew scaled by the Hab’s crew-count modifier, rounded up, from the Starbase Player’s available crew. craftingProcess is the address of a new caller-created signer; planning retains only its address. Supply craftingHab when the Recipe requires or should use Hab production. Recipe inputs are always taken from the Starbase Player’s Starbase cargo, with or without a Hab; the Hab contributes production and modifiers only.

declare const authorization: PlanAuthorization;
declare const craftingProcess: Address;
const options: PlanStartCraftingProcessOptions = {
authorization,
craftingProcess,
quantity: 2n,
numCrew: 6,
};

readonly authorization: PlanAuthorization;

Defined in: packages/sage/src/crafting/actions/index.ts:99

readonly optional craftingHab?: CraftingHabSnapshot;

Defined in: packages/sage/src/crafting/actions/index.ts:103

readonly craftingProcess: Address;

Defined in: packages/sage/src/crafting/actions/index.ts:100

readonly numCrew: number;

Defined in: packages/sage/src/crafting/actions/index.ts:102

readonly quantity: bigint;

Defined in: packages/sage/src/crafting/actions/index.ts:101

function planCancelCraftingProcess(
ctx,
process,
input): Promise<Plan>;

Defined in: packages/sage/src/crafting/actions/index.ts:1125

Plans cancellation of one Crafting Process without signing or writes.

The planner resolves and validates the Process account graph, requires Profile ownership, and rejects a Process whose Starbase was destroyed. Cancellation has no timing rule: a finished Process can still be cancelled, which returns its inputs and crew instead of producing outputs. A Process Hab is passed by its stored address in whatever state it is in, or even if it no longer exists. Final inventory capacity, permissions, returned inputs and crew, and account closure remain chain-authoritative.

ParameterType
ctxSageContext
processCraftingProcessSnapshot
inputPlanCancelCraftingProcessOptions

Promise<Plan>

declare const ctx: SageContext;
declare const process: CraftingProcessSnapshot;
declare const options: PlanCancelCraftingProcessOptions;
const plan = await planCancelCraftingProcess(ctx, process, options);
console.log(plan.describe());

function planCompleteCraftingProcess(
ctx,
process,
input): Promise<Plan>;

Defined in: packages/sage/src/crafting/actions/index.ts:1022

Plans completion of one Crafting Process without signing, simulation, or writes.

The planner resolves and validates the Process account graph, requires Profile ownership, and checks the translated lifecycle at the caller-provided Unix timestamp. Output capacity, permissions, XP, closure, and final execution freshness remain chain-authoritative.

ParameterType
ctxSageContext
processCraftingProcessSnapshot
inputPlanCompleteCraftingProcessOptions

Promise<Plan>

declare const ctx: SageContext;
declare const process: CraftingProcessSnapshot;
declare const options: PlanCompleteCraftingProcessOptions;
const plan = await planCompleteCraftingProcess(ctx, process, options);
console.log(plan.describe());

function planStartCraftingProcess(
ctx,
recipe,
player,
input): Promise<Plan>;

Defined in: packages/sage/src/crafting/actions/index.ts:541

Plans one Crafting Process start without signing, simulation, or writes.

The planner validates the loaded Recipe and Starbase Player, optional Hab, known ingredient balances, the crew the job reserves, the Hab job limit including the Character’s research concurrency bonus, and exact whole-account state. The ATLAS fee and any crew-roster bonuses remain chain-authoritative. It returns one inert Plan whose two required signer roles are bound only during execution.

Each start consumes exactly one Recipe use, whatever its quantity, and needs the Recipe’s fresh usageCountRaw to be below usageLimitRaw. A stored limit of 0n is therefore never usable. Cancelling or destroying a process returns its use. See docs/evidence/crafting-zero-usage-limit.md.

ParameterType
ctxSageContext
recipeRecipeSnapshot
playerStarbasePlayerSnapshot
inputPlanStartCraftingProcessOptions

Promise<Plan>

declare const ctx: SageContext;
declare const recipe: RecipeSnapshot;
declare const player: StarbasePlayerSnapshot;
declare const options: PlanStartCraftingProcessOptions;
const plan = await planStartCraftingProcess(ctx, recipe, player, options);
console.log(plan.describe());

Re-exports PlanAuthorization