# crafting/actions
Documentation: next (source: develop).

Install the preview: `pnpm add @aephia/atlas-kit@next`. These docs follow develop and may include changes not yet published to npm.

Markdown source of https://develop.atlas-kit-docs.pages.dev/reference/crafting/actions/ — see https://develop.atlas-kit-docs.pages.dev/ai/ for the full machine-readable surface.

## Interfaces

<a id="plancancelcraftingprocessoptions"></a>

### PlanCancelCraftingProcessOptions

Defined in: [packages/sage/src/crafting/actions/index.ts:138](https://github.com/Aephia/atlas-kit/blob/develop/packages/sage/src/crafting/actions/index.ts#L138)

Inputs for cancelling one unfinished Crafting Process.

`atUnixSeconds` is an explicit non-negative Unix timestamp used only for the
deterministic local lifecycle check. Final inventory capacity, permissions,
input and crew returns, and account closure remain chain-authoritative.

#### Example

```ts
declare const authorization: PlanAuthorization;
const options: PlanCancelCraftingProcessOptions = {
  authorization,
  atUnixSeconds: 1_700_001_000n,
};
```

#### Properties

<a id="atunixseconds"></a>

##### atUnixSeconds

```ts
readonly atUnixSeconds: bigint;
```

Defined in: [packages/sage/src/crafting/actions/index.ts:140](https://github.com/Aephia/atlas-kit/blob/develop/packages/sage/src/crafting/actions/index.ts#L140)

<a id="authorization"></a>

##### authorization

```ts
readonly authorization: PlanAuthorization;
```

Defined in: [packages/sage/src/crafting/actions/index.ts:139](https://github.com/Aephia/atlas-kit/blob/develop/packages/sage/src/crafting/actions/index.ts#L139)

***

<a id="plancompletecraftingprocessoptions"></a>

### PlanCompleteCraftingProcessOptions

Defined in: [packages/sage/src/crafting/actions/index.ts:116](https://github.com/Aephia/atlas-kit/blob/develop/packages/sage/src/crafting/actions/index.ts#L116)

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.

#### Example

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

#### Properties

<a id="atunixseconds-1"></a>

##### atUnixSeconds

```ts
readonly atUnixSeconds: bigint;
```

Defined in: [packages/sage/src/crafting/actions/index.ts:118](https://github.com/Aephia/atlas-kit/blob/develop/packages/sage/src/crafting/actions/index.ts#L118)

<a id="authorization-1"></a>

##### authorization

```ts
readonly authorization: PlanAuthorization;
```

Defined in: [packages/sage/src/crafting/actions/index.ts:117](https://github.com/Aephia/atlas-kit/blob/develop/packages/sage/src/crafting/actions/index.ts#L117)

***

<a id="planstartcraftingprocessoptions"></a>

### PlanStartCraftingProcessOptions

Defined in: [packages/sage/src/crafting/actions/index.ts:91](https://github.com/Aephia/atlas-kit/blob/develop/packages/sage/src/crafting/actions/index.ts#L91)

Inputs for starting one exact Crafting Process.

`quantity` is a positive raw unsigned-u64 integer. `numCrew` is the exact
unsigned-u32 crew count committed by the instruction. `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.

#### Example

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

#### Properties

<a id="authorization-2"></a>

##### authorization

```ts
readonly authorization: PlanAuthorization;
```

Defined in: [packages/sage/src/crafting/actions/index.ts:92](https://github.com/Aephia/atlas-kit/blob/develop/packages/sage/src/crafting/actions/index.ts#L92)

<a id="craftinghab"></a>

##### craftingHab?

```ts
readonly optional craftingHab?: CraftingHabSnapshot;
```

Defined in: [packages/sage/src/crafting/actions/index.ts:96](https://github.com/Aephia/atlas-kit/blob/develop/packages/sage/src/crafting/actions/index.ts#L96)

<a id="craftingprocess"></a>

##### craftingProcess

```ts
readonly craftingProcess: Address;
```

Defined in: [packages/sage/src/crafting/actions/index.ts:93](https://github.com/Aephia/atlas-kit/blob/develop/packages/sage/src/crafting/actions/index.ts#L93)

<a id="numcrew"></a>

##### numCrew

```ts
readonly numCrew: number;
```

Defined in: [packages/sage/src/crafting/actions/index.ts:95](https://github.com/Aephia/atlas-kit/blob/develop/packages/sage/src/crafting/actions/index.ts#L95)

<a id="quantity"></a>

##### quantity

```ts
readonly quantity: bigint;
```

Defined in: [packages/sage/src/crafting/actions/index.ts:94](https://github.com/Aephia/atlas-kit/blob/develop/packages/sage/src/crafting/actions/index.ts#L94)

## Functions

<a id="plancancelcraftingprocess"></a>

### planCancelCraftingProcess()

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

Defined in: [packages/sage/src/crafting/actions/index.ts:1364](https://github.com/Aephia/atlas-kit/blob/develop/packages/sage/src/crafting/actions/index.ts#L1364)

Plans cancellation of one unfinished Crafting Process without signing or writes.

The planner resolves and validates the Process account graph, requires Profile
ownership, and rejects completed or destroyed-Starbase Process snapshots.
Final inventory capacity, permissions, returned inputs and crew, and account
closure remain chain-authoritative.

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `ctx` | [`SageContext`](/reference/#sagecontext) |
| `process` | [`CraftingProcessSnapshot`](/reference/crafting/#craftingprocesssnapshot) |
| `input` | [`PlanCancelCraftingProcessOptions`](/reference/crafting/actions/#plancancelcraftingprocessoptions) |

#### Returns

`Promise`\<[`Plan`](/reference/planning/#plan)\>

#### Example

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

***

<a id="plancompletecraftingprocess"></a>

### planCompleteCraftingProcess()

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

Defined in: [packages/sage/src/crafting/actions/index.ts:1053](https://github.com/Aephia/atlas-kit/blob/develop/packages/sage/src/crafting/actions/index.ts#L1053)

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.

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `ctx` | [`SageContext`](/reference/#sagecontext) |
| `process` | [`CraftingProcessSnapshot`](/reference/crafting/#craftingprocesssnapshot) |
| `input` | [`PlanCompleteCraftingProcessOptions`](/reference/crafting/actions/#plancompletecraftingprocessoptions) |

#### Returns

`Promise`\<[`Plan`](/reference/planning/#plan)\>

#### Example

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

***

<a id="planstartcraftingprocess"></a>

### planStartCraftingProcess()

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

Defined in: [packages/sage/src/crafting/actions/index.ts:615](https://github.com/Aephia/atlas-kit/blob/develop/packages/sage/src/crafting/actions/index.ts#L615)

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

The planner validates the loaded Recipe and Starbase Player, optional Hab,
known ingredient balances, available crew, and exact whole-account state. It
returns one inert Plan whose two required signer roles are bound only during
execution.

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `ctx` | [`SageContext`](/reference/#sagecontext) |
| `recipe` | [`RecipeSnapshot`](/reference/crafting/#recipesnapshot) |
| `player` | `StarbasePlayerSnapshot` |
| `input` | [`PlanStartCraftingProcessOptions`](/reference/crafting/actions/#planstartcraftingprocessoptions) |

#### Returns

`Promise`\<[`Plan`](/reference/planning/#plan)\>

#### Example

```ts
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());
```

## References

<a id="planauthorization"></a>

### PlanAuthorization

Re-exports [PlanAuthorization](/reference/cargo/actions/#planauthorization)
