@energy8platform/golem 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.
Files changed (64) hide show
  1. package/README.md +14 -0
  2. package/dist/editor.css +3 -4
  3. package/dist/editor.js +108 -61
  4. package/dist/lib/cli.js +101 -70
  5. package/dist/lib/cli.js.map +4 -4
  6. package/dist/lib/e8/agent.d.ts +35 -0
  7. package/dist/lib/e8/host.d.ts +22 -0
  8. package/dist/lib/e8/node.d.ts +66 -0
  9. package/dist/lib/e8/runtime.d.ts +10 -0
  10. package/dist/lib/e8/schema.d.ts +3 -0
  11. package/dist/lib/e8/types.d.ts +80 -0
  12. package/dist/lib/e8-agent.js +6781 -0
  13. package/dist/lib/e8-agent.js.map +7 -0
  14. package/dist/lib/e8-client.js +116 -0
  15. package/dist/lib/e8-host.js +6929 -0
  16. package/dist/lib/e8-host.js.map +7 -0
  17. package/dist/lib/e8-runtime.js +2024 -0
  18. package/dist/lib/e8-runtime.js.map +7 -0
  19. package/dist/lib/e8-schema.js +7 -0
  20. package/dist/lib/e8-schema.js.map +7 -0
  21. package/dist/lib/editor/api.d.ts +1 -0
  22. package/dist/lib/editor/embed.d.ts +9 -0
  23. package/dist/lib/editor/server.d.ts +23 -1
  24. package/dist/lib/editor/store.d.ts +2 -0
  25. package/dist/lib/editor/timeline.d.ts +15 -0
  26. package/dist/lib/editor-entry.d.ts +1 -1
  27. package/dist/lib/editor-entry.js +102 -70
  28. package/dist/lib/editor-entry.js.map +4 -4
  29. package/dist/lib/rig-import-layers.d.ts +2 -0
  30. package/dist/lib/rig-version.d.ts +12 -0
  31. package/dist/lib/tool-schema.d.ts +3 -0
  32. package/dist/lib/tools.d.ts +2 -0
  33. package/dist/lib/tools.js +49 -10
  34. package/dist/lib/tools.js.map +4 -4
  35. package/editor.html +2 -2
  36. package/package.json +38 -3
  37. package/skills/e8-golem/SKILL.md +71 -0
  38. package/skills/golem-symbol-animation/SKILL.md +87 -0
  39. package/skills/golem-symbol-animation/agents/openai.yaml +4 -0
  40. package/skills/golem-symbol-animation/references/facial-controls.md +48 -0
  41. package/skills/golem-symbol-animation/references/game-engine-integration.md +133 -0
  42. package/skills/golem-symbol-animation/references/golem-authoring.md +138 -0
  43. package/skills/golem-symbol-animation/references/interactive-editor.md +17 -0
  44. package/skills/golem-symbol-animation/references/motion-craft.md +113 -0
  45. package/skills/golem-symbol-animation/references/packed-delivery.md +88 -0
  46. package/skills/golem-symbol-animation/references/quantitative-qa.md +106 -0
  47. package/skills/golem-symbol-animation/references/spine-rive-study.md +87 -0
  48. package/skills/golem-symbol-animation/scripts/atlas_parts.py +87 -0
  49. package/skills/golem-symbol-animation/scripts/check_package.py +71 -0
  50. package/skills/golem-symbol-animation/scripts/image_gates.py +143 -0
  51. package/skills/golem-symbol-cutting/SKILL.md +70 -0
  52. package/skills/golem-symbol-cutting/agents/openai.yaml +4 -0
  53. package/skills/golem-symbol-cutting/assets/h1/h1.atlas.png +0 -0
  54. package/skills/golem-symbol-cutting/assets/h1/h1.png +0 -0
  55. package/skills/golem-symbol-cutting/references/cutting-workflow.md +92 -0
  56. package/skills/golem-symbol-cutting/references/facial-layers.md +44 -0
  57. package/skills/golem-symbol-cutting/references/generation-workflow.md +109 -0
  58. package/skills/golem-symbol-cutting/references/golem-handoff.md +62 -0
  59. package/skills/golem-symbol-cutting/references/h1-example.md +46 -0
  60. package/skills/golem-symbol-cutting/references/hybrid-workflow.md +119 -0
  61. package/skills/golem-symbol-cutting/references/registration-and-motion.md +89 -0
  62. package/skills/golem-symbol-cutting/references/spine-rive-construction.md +73 -0
  63. package/skills/golem-symbol-cutting/scripts/atlas_parts.py +87 -0
  64. package/skills/golem-symbol-cutting/scripts/hybrid_parts.py +279 -0
@@ -0,0 +1,35 @@
1
+ import type { AgentTool, AgentWriteFrame, E8Context } from "./types";
2
+ /** String arguments naming a file or directory; `path` itself (rig.json) is resolved from the project root, these from the rig's directory. */
3
+ export declare const PATH_ARGS: readonly ["library", "json", "atlas", "image", "layersDir", "relPrefix", "file", "outDir", "outFile", "output", "saveTo", "framesDir", "src"];
4
+ /** String arguments that are not paths. A string argument in neither list fails tests/e8-agent.test.ts. */
5
+ export declare const TEXT_ARGS: readonly ["animation", "asset", "attachment", "background", "bone", "clip", "color", "driver", "id", "name", "notes", "parent", "preset", "prompt", "prop", "rename", "role", "skin", "slot", "target", "to", "weightBone", "bind", "bones", "from", "frontOf", "groups", "order", "removed", "secondaryBones", "slots"];
6
+ /** Nested arguments whose string values golem reads from disk at call time (resolved from the rig's directory); each value is checked and kept as written. */
7
+ export declare const NESTED_PATH_ARGS: readonly ["debugFillMasks"];
8
+ /** Strings nested inside other arguments that are not paths (or only land in rig.json as data); the test enumerates them. */
9
+ export declare const NESTED_TEXT_ARGS: readonly ["a", "animation", "b", "bone", "control", "from", "id", "label", "name", "prompt", "prop", "requiredAnimations", "sourceImage", "src", "to", "v", "whenSlotVisible"];
10
+ /**
11
+ * `args` with every path made absolute and checked to stay under `root`; throws naming the argument otherwise. Top-level PATH_ARGS are resolved from
12
+ * the rig's directory and checked (an empty one is left as given, STORED ones stay relative); an empty `path` is refused; NESTED_PATH_ARGS (debugFillMasks values) are checked against it and kept as written.
13
+ * NESTED_TEXT_ARGS (e.g. rig_set_meta's reference.src, which golem refuses when absolute or `..`) are data stored in rig.json;
14
+ * a rig.json whose asset srcs point out is refused by checkRigAssets.
15
+ * ponytail: a lexical check (path.resolve), no realpath — a symlink inside the project that points out passes;
16
+ * resolve the nearest existing ancestor with realpath if projects start carrying such links.
17
+ */
18
+ export declare function sandboxArgs(root: string, args: Record<string, unknown>): Record<string, unknown>;
19
+ /** Every registry tool as an e8 agent tool over the project at `root`; `announce` gets one frame per call that changed a rig (NO_STEP tools aside). */
20
+ export declare function rigAgentTools(root: string, announce: (frame: AgentWriteFrame) => void): AgentTool<Record<string, unknown>>[];
21
+ interface AgentHostContext extends E8Context {
22
+ project: {
23
+ root: string;
24
+ };
25
+ tools: {
26
+ register(tool: AgentTool, owner?: string): () => void;
27
+ };
28
+ ideRpc: {
29
+ broadcastAgentWrite(frame: AgentWriteFrame): void;
30
+ };
31
+ }
32
+ export declare const name = "golem-agent";
33
+ export declare const inject: string[];
34
+ export declare function apply(ctx: AgentHostContext): void;
35
+ export {};
@@ -0,0 +1,22 @@
1
+ /** e8/host — the host half of golem's e8 row (an `e8.yml` entry): the rig editor under /golem/ on the IDE's own port. */
2
+ import type { IncomingMessage, ServerResponse } from "node:http";
3
+ import type { E8Context } from "./types";
4
+ /** The slice of @cordisjs/plugin-server's request and response this uses: the raw node objects underneath. */
5
+ interface RawRequest {
6
+ _req: IncomingMessage;
7
+ }
8
+ interface RawResponse {
9
+ _res: ServerResponse;
10
+ }
11
+ interface HostContext extends E8Context {
12
+ project: {
13
+ root: string;
14
+ };
15
+ server: {
16
+ all(path: RegExp, handler: (req: RawRequest, res: RawResponse) => Promise<void>): unknown;
17
+ };
18
+ }
19
+ export declare const name = "golem-editor";
20
+ export declare const inject: string[];
21
+ export declare function apply(ctx: HostContext): void;
22
+ export {};
@@ -0,0 +1,66 @@
1
+ /**
2
+ * e8/node — the `golem` scene node type for e8-engine: a rig.json playing one animation, with expression controls.
3
+ * `rigLoader` (a pixi load parser) turns the loaded JSON into the document plus its textures, so the scenes runtime's
4
+ * loader hands this node a ready rig.
5
+ */
6
+ import { ExtensionType, type Texture } from "pixi.js";
7
+ import { type RigDocument } from "../rig-format";
8
+ import type { NodeType } from "./types";
9
+ export interface GolemProps {
10
+ rig: string;
11
+ animation?: string;
12
+ loop?: boolean;
13
+ speed?: number;
14
+ controls?: Record<string, number>;
15
+ }
16
+ /** What `rigLoader` leaves in the Assets cache for a rig.json: the document, its textures and the URLs they came from. */
17
+ export interface LoadedRig {
18
+ doc: RigDocument;
19
+ textures: Map<string, Texture>;
20
+ sources: string[];
21
+ }
22
+ export interface TickerLike {
23
+ add(fn: (t: {
24
+ deltaMS: number;
25
+ }) => void): unknown;
26
+ remove(fn: (t: {
27
+ deltaMS: number;
28
+ }) => void): unknown;
29
+ }
30
+ export declare const isLoadedRig: (v: unknown) => v is LoadedRig;
31
+ /** An asset `src` (relative to the rig file) as a URL the page loads; a root-relative rig URL gives a root-relative one. */
32
+ export declare function resolveSrc(rigUrl: string, src: string): string;
33
+ /**
34
+ * The pixi load parser: any loader may have read the JSON (pixi's own, Spine's), this one claims it by content.
35
+ * ponytail: textures load under rig-private URLs — two rigs sharing one PNG each load their own copy, and unloading
36
+ * one never touches an image node's; share per URL with a reference count if rigs start sharing many files.
37
+ */
38
+ export declare function createRigLoader(io?: {
39
+ load(url: string): Promise<Texture>;
40
+ unload(urls: string[]): Promise<void>;
41
+ }): {
42
+ extension: {
43
+ type: ExtensionType;
44
+ name: string;
45
+ };
46
+ name: string;
47
+ testParse(asset: unknown): Promise<boolean>;
48
+ parse(asset: unknown, resolved?: {
49
+ src?: string;
50
+ }): Promise<LoadedRig>;
51
+ unload(rig: unknown): Promise<void>;
52
+ };
53
+ export declare const rigLoader: {
54
+ extension: {
55
+ type: ExtensionType;
56
+ name: string;
57
+ };
58
+ name: string;
59
+ testParse(asset: unknown): Promise<boolean>;
60
+ parse(asset: unknown, resolved?: {
61
+ src?: string;
62
+ }): Promise<LoadedRig>;
63
+ unload(rig: unknown): Promise<void>;
64
+ };
65
+ export declare function createGolemNode(ticker: TickerLike): NodeType<GolemProps>;
66
+ export declare const golemNode: NodeType<GolemProps>;
@@ -0,0 +1,10 @@
1
+ import type { E8Context, NodeType } from "./types";
2
+ export { golemNode, rigLoader, createGolemNode, createRigLoader, resolveSrc, isLoadedRig, type GolemProps, type LoadedRig } from "./node";
3
+ interface RuntimeContext extends E8Context {
4
+ nodeTypes: {
5
+ register(type: NodeType<any>): () => void;
6
+ };
7
+ }
8
+ export declare const name = "golem";
9
+ export declare const inject: string[];
10
+ export declare function apply(ctx: RuntimeContext): void;
@@ -0,0 +1,3 @@
1
+ /** e8/schema — the form the e8 IDE draws for the golem row: nothing to configure; the node type carries its own props. */
2
+ import Schema from "schemastery";
3
+ export declare const Config: Schema<Schemastery.ObjectS<{}>, Schemastery.ObjectT<{}>>;
@@ -0,0 +1,80 @@
1
+ /**
2
+ * e8/types — structural copies of the e8-engine shapes golem plugs into. `@energy8engine/*` are private packages, so
3
+ * golem cannot import them; e8-engine's typecheck holds these to the originals (its ide/host/tests/golem-contract.test.ts).
4
+ */
5
+ import type { Container } from "pixi.js";
6
+ import type Schema from "schemastery";
7
+ declare global {
8
+ namespace Schemastery {
9
+ interface Meta<T> {
10
+ /** e8 IDE hint: this string field holds a project-relative asset path with one of these extensions */
11
+ asset?: string[];
12
+ /** e8 IDE hint: this string field names a document of this kind */
13
+ pick?: string;
14
+ }
15
+ }
16
+ }
17
+ /** The slice of a cordis context these plugins use. */
18
+ export interface E8Context {
19
+ effect(execute: () => () => void, label?: string): void;
20
+ }
21
+ /** What a node type reads off the scenes runtime's context. */
22
+ export interface NodeContext {
23
+ reflect: {
24
+ get(name: string, strict?: boolean): unknown;
25
+ };
26
+ }
27
+ export interface AssetLoader {
28
+ get(path: string): unknown;
29
+ }
30
+ export interface NodeType<P> {
31
+ type: string;
32
+ schema: Schema<P>;
33
+ mount(props: P, ctx: NodeContext): Container;
34
+ update?(view: Container, props: P, ctx: NodeContext): void;
35
+ once?(view: Container, props: P, ctx: NodeContext): Promise<void>;
36
+ unmount?(view: Container): void;
37
+ assets?(props: P): string[];
38
+ /** project files a filled-in view also reads besides `assets` (a rig's PNGs); a change to one reloads this node's assets */
39
+ dependsOn?(props: P, ctx: NodeContext): string[];
40
+ accept?: {
41
+ extensions: string[];
42
+ prop: string;
43
+ sibling?: string;
44
+ };
45
+ assetProps?: string[];
46
+ }
47
+ export type AgentContent = {
48
+ type: "text";
49
+ text: string;
50
+ } | {
51
+ type: "image";
52
+ data: string;
53
+ mimeType: string;
54
+ };
55
+ export interface AgentToolContent {
56
+ kind: "agent-content";
57
+ content: AgentContent[];
58
+ }
59
+ export interface AgentInput<A> {
60
+ (value?: any): A;
61
+ toJSON(): unknown;
62
+ /** a ready JSON Schema for the arguments — e8 uses it as is instead of reading a schemastery graph */
63
+ jsonSchema?: Record<string, unknown>;
64
+ }
65
+ export interface AgentTool<A = any> {
66
+ name: string;
67
+ description: string;
68
+ input: AgentInput<A>;
69
+ readOnly?: boolean;
70
+ execute(args: A, call: {
71
+ signal: AbortSignal;
72
+ }): Promise<unknown>;
73
+ }
74
+ /** An accepted agent write — the e8 IDE records it as one undo step under `key`. */
75
+ export interface AgentWriteFrame {
76
+ key: string;
77
+ label: string;
78
+ before: unknown;
79
+ after: unknown;
80
+ }