@vibecook/ice 0.6.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-ELCBCTKY.js → chunk-55QCOE74.js} +2 -2
- package/dist/{chunk-BFT7YWS2.js → chunk-5OU3OWDH.js} +3 -3
- package/dist/{chunk-JLXETATP.js → chunk-LATXYFMO.js} +339 -42
- package/dist/chunk-LATXYFMO.js.map +1 -0
- package/dist/devtools.js +1 -1
- package/dist/dom.js +2 -2
- package/dist/ground.js +1 -1
- package/dist/index.js +3 -1
- package/dist/r3f.js +3 -3
- package/dist/react.js +3 -3
- package/dist/types/packages/core/src/behavior/define-behavior.d.ts +2 -1
- package/dist/types/packages/core/src/behavior/runtime.d.ts +16 -2
- package/dist/types/packages/core/src/behavior/types.d.ts +47 -1
- package/dist/types/packages/core/src/engine/guests.d.ts +5 -2
- package/dist/types/packages/core/src/facade/create-canvas-engine.d.ts +10 -0
- package/dist/types/packages/core/src/index.d.ts +4 -3
- package/package.json +1 -1
- package/dist/chunk-JLXETATP.js.map +0 -1
- /package/dist/{chunk-ELCBCTKY.js.map → chunk-55QCOE74.js.map} +0 -0
- /package/dist/{chunk-BFT7YWS2.js.map → chunk-5OU3OWDH.js.map} +0 -0
package/dist/devtools.js
CHANGED
package/dist/dom.js
CHANGED
|
@@ -19,8 +19,8 @@ import {
|
|
|
19
19
|
startRafLoop,
|
|
20
20
|
wheelCede,
|
|
21
21
|
wireMeasurement
|
|
22
|
-
} from "./chunk-
|
|
23
|
-
import "./chunk-
|
|
22
|
+
} from "./chunk-55QCOE74.js";
|
|
23
|
+
import "./chunk-LATXYFMO.js";
|
|
24
24
|
import "./chunk-OR5FNVUE.js";
|
|
25
25
|
export {
|
|
26
26
|
CLAIM_OWNS_ESCAPE,
|
package/dist/ground.js
CHANGED
package/dist/index.js
CHANGED
|
@@ -228,6 +228,7 @@ import {
|
|
|
228
228
|
defineTickSystem,
|
|
229
229
|
defineTool,
|
|
230
230
|
defineWidget,
|
|
231
|
+
describeBehavior,
|
|
231
232
|
devGuardsEnabled,
|
|
232
233
|
distPointToBox,
|
|
233
234
|
docBehaviorVersion,
|
|
@@ -279,7 +280,7 @@ import {
|
|
|
279
280
|
widgetSpawnInits,
|
|
280
281
|
widgets,
|
|
281
282
|
writeRuntimeResource
|
|
282
|
-
} from "./chunk-
|
|
283
|
+
} from "./chunk-LATXYFMO.js";
|
|
283
284
|
import "./chunk-OR5FNVUE.js";
|
|
284
285
|
export {
|
|
285
286
|
Accepts,
|
|
@@ -511,6 +512,7 @@ export {
|
|
|
511
512
|
defineTickSystem,
|
|
512
513
|
defineTool,
|
|
513
514
|
defineWidget,
|
|
515
|
+
describeBehavior,
|
|
514
516
|
devGuardsEnabled,
|
|
515
517
|
distPointToBox,
|
|
516
518
|
docBehaviorVersion,
|
package/dist/r3f.js
CHANGED
|
@@ -2,8 +2,8 @@ import {
|
|
|
2
2
|
EngineProvider,
|
|
3
3
|
hasPreviewSnapshot,
|
|
4
4
|
setPreviewSnapshot
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-5OU3OWDH.js";
|
|
6
|
+
import "./chunk-55QCOE74.js";
|
|
7
7
|
import {
|
|
8
8
|
Active,
|
|
9
9
|
Camera,
|
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
navFlightActive,
|
|
27
27
|
pickTopAt,
|
|
28
28
|
widgets
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-LATXYFMO.js";
|
|
30
30
|
import {
|
|
31
31
|
compositeCameraFrustum,
|
|
32
32
|
computeIslandPhase,
|
package/dist/react.js
CHANGED
|
@@ -25,9 +25,9 @@ import {
|
|
|
25
25
|
useWidgetProps,
|
|
26
26
|
useWorld,
|
|
27
27
|
useWorldComponent
|
|
28
|
-
} from "./chunk-
|
|
29
|
-
import "./chunk-
|
|
30
|
-
import "./chunk-
|
|
28
|
+
} from "./chunk-5OU3OWDH.js";
|
|
29
|
+
import "./chunk-55QCOE74.js";
|
|
30
|
+
import "./chunk-LATXYFMO.js";
|
|
31
31
|
import "./chunk-OR5FNVUE.js";
|
|
32
32
|
export {
|
|
33
33
|
EngineProvider,
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* depends on import order is a check that reports differently on a good day.
|
|
16
16
|
*/
|
|
17
17
|
import type { Component } from "@vibecook/strata-ecs";
|
|
18
|
-
import { type AnyBehaviorDef, type BehaviorHandle, type BehaviorRead, type BehaviorSchema, type BehaviorSpec, type BehaviorStore, type DataOf } from "./types";
|
|
18
|
+
import { type AnyBehaviorDef, type BehaviorDescription, type BehaviorHandle, type BehaviorRead, type BehaviorSchema, type BehaviorSpec, type BehaviorStore, type DataOf } from "./types";
|
|
19
19
|
/**
|
|
20
20
|
* The generated component's name. Prefixed so a behavior can never collide
|
|
21
21
|
* with `defineWidget`'s `<type>:<group>` components — and, because this string
|
|
@@ -46,6 +46,7 @@ export declare function classifyRead(r: BehaviorRead): {
|
|
|
46
46
|
} | undefined;
|
|
47
47
|
/** The read component a `reads:` entry contributes, if it contributes one. */
|
|
48
48
|
export declare function readComponentOf(r: BehaviorRead): Component | undefined;
|
|
49
|
+
export declare function describeBehavior(behavior: AnyBehaviorDef): BehaviorDescription;
|
|
49
50
|
export declare function defineBehavior<const S extends BehaviorStore, const Sch extends BehaviorSchema = BehaviorSchema>(name: string, spec: BehaviorSpec<S, Sch>): BehaviorHandle<DataOf<Sch>>;
|
|
50
51
|
/**
|
|
51
52
|
* TEST-ONLY registry wipe (mirrors `__resetPrefabsForTests`; deliberately NOT
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Component, Entity, World } from "@vibecook/strata-ecs";
|
|
2
|
-
import type { GuestRegistry } from "../engine/guests";
|
|
2
|
+
import type { GuestLedgerRecord, GuestRegistry } from "../engine/guests";
|
|
3
3
|
import type { PhaseGroup } from "../engine/pipeline";
|
|
4
4
|
import type { LiveWriter } from "../guards/live-writer";
|
|
5
5
|
import { type BehaviorMeta } from "./migrate";
|
|
@@ -72,10 +72,24 @@ export interface BehaviorStatus {
|
|
|
72
72
|
readonly failed: number;
|
|
73
73
|
readonly ticking: number;
|
|
74
74
|
readonly suspended: boolean;
|
|
75
|
+
/**
|
|
76
|
+
* The EPHEMERAL singleton was quarantined this generation (I17): its facet
|
|
77
|
+
* is withdrawn and stays withdrawn until a fresh registration. Without this
|
|
78
|
+
* field a quarantined singleton is indistinguishable from a dormant one —
|
|
79
|
+
* withdrawal makes the instance depart, so `failed` reads 0. Always false
|
|
80
|
+
* for durable/runtime behaviors (their quarantine stays visible in `failed`).
|
|
81
|
+
*/
|
|
82
|
+
readonly quarantined: boolean;
|
|
83
|
+
}
|
|
84
|
+
export interface BehaviorRegistrationOptions {
|
|
85
|
+
/** Stable host policy key. Explicitly ordered registrations run before unkeyed registrations. */
|
|
86
|
+
readonly orderKey?: string;
|
|
87
|
+
/** Prior breaker state, normally persisted by a host across engine generations. */
|
|
88
|
+
readonly ledger?: GuestLedgerRecord;
|
|
75
89
|
}
|
|
76
90
|
export interface BehaviorRuntime {
|
|
77
91
|
/** Compile + install a behavior. Returns an uninstaller. */
|
|
78
|
-
register(b: AnyBehaviorDef): () => void;
|
|
92
|
+
register(b: AnyBehaviorDef, options?: BehaviorRegistrationOptions): () => void;
|
|
79
93
|
registered(): readonly AnyBehaviorDef[];
|
|
80
94
|
/** Runtime/ephemeral attach from OUTSIDE a hook (the facade surface). */
|
|
81
95
|
attach(e: Entity, b: AnyBehaviorDef, data?: Record<string, unknown>): void;
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import type { Component, Entity, Relation, Resource, Tag } from "@vibecook/strata-ecs";
|
|
17
17
|
import type { GuardedTx } from "../guards/guarded-tx";
|
|
18
|
-
import type { BooleanSpec, EntityKeySpec, EnumSpec, JsonSpec, NumberSpec, PropSpec, StringSpec } from "../widget/props";
|
|
18
|
+
import type { BooleanSpec, EntityKeySpec, EnumSpec, JsonShape, JsonSpec, NumberSpec, PropSpec, StringSpec } from "../widget/props";
|
|
19
19
|
export type BehaviorStore = "durable" | "runtime" | "ephemeral";
|
|
20
20
|
/**
|
|
21
21
|
* The CURATED phase set (design-009 §4.4, BF-D8) — a deliberate subset of the
|
|
@@ -31,6 +31,52 @@ export declare const BEHAVIOR_PHASES: Readonly<Record<BehaviorStore, readonly Be
|
|
|
31
31
|
export declare const BEHAVIOR_DEFAULT_PHASE: Readonly<Record<BehaviorStore, BehaviorPhase>>;
|
|
32
32
|
/** A behavior's declared data: the SAME `p.*` DSL `defineWidget` uses. */
|
|
33
33
|
export type BehaviorSchema = Readonly<Record<string, PropSpec>>;
|
|
34
|
+
export type BehaviorHookName = "init" | "update" | "changed" | "tick" | "dispose";
|
|
35
|
+
export type BehaviorPropDescription = {
|
|
36
|
+
readonly kind: "string";
|
|
37
|
+
readonly default?: string;
|
|
38
|
+
} | {
|
|
39
|
+
readonly kind: "number";
|
|
40
|
+
readonly default?: number;
|
|
41
|
+
readonly min?: number;
|
|
42
|
+
readonly max?: number;
|
|
43
|
+
} | {
|
|
44
|
+
readonly kind: "boolean";
|
|
45
|
+
readonly default?: boolean;
|
|
46
|
+
} | {
|
|
47
|
+
readonly kind: "enum";
|
|
48
|
+
readonly options: readonly string[];
|
|
49
|
+
readonly default?: string;
|
|
50
|
+
} | {
|
|
51
|
+
readonly kind: "json";
|
|
52
|
+
readonly inner: JsonShape;
|
|
53
|
+
readonly default?: string;
|
|
54
|
+
} | {
|
|
55
|
+
readonly kind: "entityKey";
|
|
56
|
+
readonly default?: string;
|
|
57
|
+
};
|
|
58
|
+
export interface BehaviorReadDescription {
|
|
59
|
+
readonly kind: "behavior" | "component" | "tag" | "relation" | "resource";
|
|
60
|
+
readonly name: string;
|
|
61
|
+
}
|
|
62
|
+
export interface BehaviorDescription {
|
|
63
|
+
readonly id: string;
|
|
64
|
+
readonly store: BehaviorStore;
|
|
65
|
+
readonly derived: boolean;
|
|
66
|
+
readonly deriveDuringGesture: boolean;
|
|
67
|
+
readonly version: number;
|
|
68
|
+
readonly phase: BehaviorPhase;
|
|
69
|
+
readonly budgetMs?: number;
|
|
70
|
+
readonly tickWhile: "all" | "visible";
|
|
71
|
+
readonly schema: readonly {
|
|
72
|
+
readonly name: string;
|
|
73
|
+
readonly spec: BehaviorPropDescription;
|
|
74
|
+
}[];
|
|
75
|
+
readonly reads: readonly BehaviorReadDescription[];
|
|
76
|
+
readonly writes: readonly string[];
|
|
77
|
+
readonly migrationFrom: readonly number[];
|
|
78
|
+
readonly hooks: readonly BehaviorHookName[];
|
|
79
|
+
}
|
|
34
80
|
type ValueOfSpec<S extends PropSpec> = S extends NumberSpec ? number : S extends BooleanSpec ? boolean : S extends EnumSpec ? string : S extends JsonSpec ? unknown : S extends StringSpec | EntityKeySpec ? string : never;
|
|
35
81
|
/**
|
|
36
82
|
* The hook-facing data view. `p.json` fields arrive PARSED (the cell is a
|
|
@@ -79,8 +79,11 @@ export interface GuestSpec {
|
|
|
79
79
|
/** Per-invocation budget request; the effective budget is
|
|
80
80
|
* `min(budgetMs, seamCapMs)` — no single guest may claim the whole seam. */
|
|
81
81
|
readonly budgetMs?: number;
|
|
82
|
-
/** RESERVED.
|
|
83
|
-
*
|
|
82
|
+
/** RESERVED. Hosted guests run in the publish slot only — and that is now the
|
|
83
|
+
* settled shape, not a v1 placeholder: M13 reached pipeline cadence through
|
|
84
|
+
* `addDriven` (behaviors run as pipeline systems and CHARGE this breaker)
|
|
85
|
+
* instead of widening this field. A wider value would mean a second way to
|
|
86
|
+
* put foreign code in the tick that `addDriven` already provides. */
|
|
84
87
|
readonly phase?: "publish";
|
|
85
88
|
/** Seed prior breaker state (host-persisted across engine generations). */
|
|
86
89
|
readonly ledger?: GuestLedgerRecord;
|
|
@@ -51,6 +51,16 @@ export interface CanvasEngineOpts {
|
|
|
51
51
|
* what makes "a plugin declared it" and "this engine runs it" separable.
|
|
52
52
|
*/
|
|
53
53
|
readonly behaviors?: readonly AnyBehaviorDef[];
|
|
54
|
+
/** Generic guest breaker routing for hosts that use the published facade. */
|
|
55
|
+
readonly onGuestFault?: (id: string, error: unknown) => void;
|
|
56
|
+
readonly onGuestNotice?: (message: string) => void;
|
|
57
|
+
/** Behavior-specific routing preserves hook and entity provenance. The two
|
|
58
|
+
* pairs are COMPLEMENTARY, not alternatives: a fault that also strikes the
|
|
59
|
+
* breaker (a thenable hook; throws spanning instances) reaches BOTH the
|
|
60
|
+
* behavior route and the guest route — pass both, or the guest half of
|
|
61
|
+
* those events still lands on the console default. */
|
|
62
|
+
readonly onBehaviorFault?: (behavior: string, hook: string, entity: Entity | undefined, error: unknown) => void;
|
|
63
|
+
readonly onBehaviorLog?: (behavior: string, message: string, rest: readonly unknown[]) => void;
|
|
54
64
|
readonly budgets?: {
|
|
55
65
|
readonly keepMounted?: number;
|
|
56
66
|
readonly fboBytes?: number;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* scene systems · doc kit · publish step · engine facade · reflector registry.
|
|
4
4
|
* Import wall: strata-ecs + @ice/kernel ONLY — never react/dom/three (enforced).
|
|
5
5
|
*/
|
|
6
|
-
export declare const CORE_VERSION = "0.
|
|
6
|
+
export declare const CORE_VERSION = "0.7.0";
|
|
7
7
|
export { defineSchemaOnce, hmrInvalidateOnSchemaChange } from "./boot/hmr";
|
|
8
8
|
export { All, Any, Not, Related, createWorld, defineQuery, defineSystem, defineTickSystem, enumOf, field, Local, } from "@vibecook/strata-ecs";
|
|
9
9
|
export type { Batch, Component, Condition, Entity, OrderPlace, Pipeline, Query, Relation, Resource, System, SystemCtx, Tag, TickSystem, World, } from "@vibecook/strata-ecs";
|
|
@@ -16,8 +16,9 @@ export { createReflectorRegistry, type ReflectorDef, type ReflectorObserve, type
|
|
|
16
16
|
export { createEngine, type Engine, type EngineOpts, type FrameTelemetry, type PublishHook, type SystemRunRecord, } from "./engine/engine";
|
|
17
17
|
export { createFrameControl, SETTLE_CAP, type FrameControl } from "./engine/frame-control";
|
|
18
18
|
export { createGuestRegistry, GUEST_BUDGET, type GuestFactory, type GuestFrame, type GuestGeneration, type GuestInstance, type GuestLedgerRecord, type GuestRegistry, type GuestRegistryOpts, type GuestRun, type GuestSpec, type GuestStatus, } from "./engine/guests";
|
|
19
|
-
export { behaviors, defineBehavior } from "./behavior/define-behavior";
|
|
20
|
-
export
|
|
19
|
+
export { behaviors, defineBehavior, describeBehavior } from "./behavior/define-behavior";
|
|
20
|
+
export type { BehaviorRegistrationOptions } from "./behavior/runtime";
|
|
21
|
+
export { BEHAVIOR_DEFAULT_PHASE, BEHAVIOR_PHASES, type AnyBehaviorAttachSpec, type AnyBehaviorDef, type BehaviorAttachSpec, type BehaviorChanges, type BehaviorCtxBase, type BehaviorCtxFor, type BehaviorDescription, type BehaviorFrame, type BehaviorHandle, type BehaviorHookName, type BehaviorHooks, type BehaviorPhase, type BehaviorPropDescription, type BehaviorQuery, type BehaviorQuerySpec, type BehaviorRead, type BehaviorReadDescription, type BehaviorSchema, type BehaviorSpec, type BehaviorStore, type BehaviorTx, type BehaviorWorld, type DataOf, type DurableBehaviorCtx, type EphemeralBehaviorCtx, type PeerFacet, type RuntimeBehaviorCtx, } from "./behavior/types";
|
|
21
22
|
export { compileBehavior, isDurableEligible, type CompiledBehavior } from "./behavior/compile";
|
|
22
23
|
export { behaviorMarkerKey, classifyBehaviorVersion, docBehaviorVersion, stampBehaviorMarker, BEHAVIOR_MARKER_PREFIX, type BehaviorMeta, type BehaviorVerdict, } from "./behavior/migrate";
|
|
23
24
|
export { createBehaviorHarness, type BehaviorHarness, type BehaviorHarnessOpts, type HarnessCommit, } from "./behavior/harness";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vibecook/ice",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "ICE — infinite canvas engine. Figma-grade infinite-canvas UX as a framework: defineWidget turns React/R3F components into canvas citizens — selectable, movable, resizable, wired into node graphs, CRDT-synced, undoable per gesture.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "James Yong <me@jamesyong42.com>",
|