@drawcall/design 0.2.12 → 0.3.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/README.md CHANGED
@@ -32,4 +32,4 @@ npx @drawcall/design -p r6z2n9k4x8m1qc frame create oak-chair \
32
32
  --type market --asset oak-chair@1.2.3
33
33
  ```
34
34
 
35
- GLTS frames accept only `.glts` files. `index.glts` is optional: an absent entry renders an empty frame. Image and Market files are available through the same filesystem but are read-only. Read `npx @drawcall/design skill` (or MCP `get_skill`) before creating or changing a GLTS asset.
35
+ GLTS frames accept only `.glts` files. An absent `index.glts` still renders an intentionally empty frame. For authored scenes, work top-down: write `index.glts`, reference planned child assets, then implement those children progressively. A missing imported `.glts` path renders a labeled glowing placeholder without creating a stored file; writing the real file replaces it on revalidation. Image and Market files are available through the same filesystem but are read-only. Read `npx @drawcall/design skill` (or MCP `get_skill`) before creating or changing a GLTS asset.
package/dist/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  export * as v1 from "./v1/index.js";
2
2
  export { designSkill } from "./skill.generated.js";
3
+ export { frameCreationCapabilities, type FrameCreationCapability, type FrameCreationCapabilityId, type FrameCreationInput, } from "./v1/capabilities.js";
3
4
  export { parseFrameSize } from "./target.js";
4
- export { acknowledgesInspection, inspectionCommandSchema, inspectionFrameMessageSchema, inspectionMessageTypes, projectSyncUrl, type InspectionAppliedMessage, type InspectionCommand, type InspectionFrameMessage, } from "./protocol.js";
5
- export type { BinaryFile, CreateFrame, CreateGltsFrame, CreateImageFrame, CreateMarketFrame, DesignFile, FileList, FileMutation, Frame, GltsFrame, ImageFrame, MarketFrame, Project, Screenshot, TextFile, User, } from "./v1/schemas.js";
5
+ export { acknowledgesInspection, inspectionCommandSchema, inspectionFrameMessageSchema, inspectionMessageTypes, projectSyncMaps, projectSyncUrl, type InspectionAppliedMessage, type InspectionCommand, type InspectionFrameMessage, } from "./protocol.js";
6
+ export type { BinaryFile, CreateFrame, CreateProjectFromBrief, CreateGltsFrame, CreateImageFrame, CreateMarketFrame, DesignFile, FileList, FileMutation, Frame, GltsFrame, ImageFrame, MarketFrame, Project, ProjectDerivationStatus, Screenshot, TextFile, User, } from "./v1/schemas.js";
package/dist/index.js CHANGED
@@ -1,4 +1,5 @@
1
1
  export * as v1 from "./v1/index.js";
2
2
  export { designSkill } from "./skill.generated.js";
3
+ export { frameCreationCapabilities, } from "./v1/capabilities.js";
3
4
  export { parseFrameSize } from "./target.js";
4
- export { acknowledgesInspection, inspectionCommandSchema, inspectionFrameMessageSchema, inspectionMessageTypes, projectSyncUrl, } from "./protocol.js";
5
+ export { acknowledgesInspection, inspectionCommandSchema, inspectionFrameMessageSchema, inspectionMessageTypes, projectSyncMaps, projectSyncUrl, } from "./protocol.js";
@@ -1,4 +1,8 @@
1
1
  import { z } from "zod";
2
+ export declare const projectSyncMaps: {
3
+ readonly filesystemRevision: "filesystem-revision";
4
+ readonly frameRecords: "frame-records";
5
+ };
2
6
  export declare const inspectionMessageTypes: {
3
7
  readonly applied: "drawcall:inspection:applied";
4
8
  readonly exit: "drawcall:inspection:exit";
package/dist/protocol.js CHANGED
@@ -1,4 +1,8 @@
1
1
  import { z } from "zod";
2
+ export const projectSyncMaps = {
3
+ filesystemRevision: "filesystem-revision",
4
+ frameRecords: "frame-records",
5
+ };
2
6
  export const inspectionMessageTypes = {
3
7
  applied: "drawcall:inspection:applied",
4
8
  exit: "drawcall:inspection:exit",
@@ -1 +1 @@
1
- export declare const designSkill = "---\nname: drawcall-design\ndescription: Create, modify, inspect, and screenshot 3D assets and reference frames in Drawcall Design. Use for Drawcall Design projects, frames, the project filesystem, GLTS assets, or Drawcall Market frames. Do not use for full games or applications.\n---\n\n# Drawcall Design\n\nUse the Drawcall Design MCP tools when available. Otherwise use `npx @drawcall/design`. Design is a remote, current-state canvas: inspect the project and its frames before changing them. Use immutable IDs for every project and frame target; names are only labels.\n\n## Project filesystem\n\nA project is a hosted filesystem at `https://<project-id>.design.drawcallcontent.com/`. Each frame owns one top-level folder, `/<frame-id>/`. The CLI selects the project with `-p <project-id>`; its file paths are exactly the absolute paths inside that project, for example `/f7k3m9q2x8vd/index.glts`.\n\nCreate frames with an explicit type. GLTS frames require `--size`; image and Market frames derive their canvas size. A Market frame requires an exact public asset reference, `name@version`.\n\nRead a file before editing it. Use a narrow edit for one known change and write a complete file when replacing it. Only GLTS frame files may be created or deleted. Image and Market frame files are read-only.\n\n## GLTS assets\n\nA GLTS frame contains only `.glts` files. `index.glts` is its optional root asset; without it the frame renders empty. Every `.glts` file is a trusted TypeScript ESM module that default-exports a no-argument class derived from `THREE.Object3D`. Avoid top-level side effects because reload evaluates the module again. Implement `dispose()` when the asset exclusively owns disposable resources.\n\n```ts\nimport * as THREE from \"three\";\nimport Wheel from \"./parts/wheel.glts\";\n\nexport default class Racecar extends THREE.Group {\n constructor() {\n super();\n this.add(new Wheel());\n }\n}\n```\n\nUse relative `.glts` imports within a frame. Use a project-absolute path to import a GLTS asset from another frame:\n\n```ts\nimport Chassis from \"/other-frame-id/index.glts\";\n```\n\nFor a non-GLTS file from an image or Market frame, preserve the project filesystem URL through `import.meta.url`:\n\n```ts\nconst modelUrl = new URL(\"/market-frame-id/models/car.glb\", import.meta.url);\n```\n\nGLTS supports static `.glts`, `three`, Three addons, and bare npm imports. It does not support local helper `.ts` modules, dynamic imports, cyclic GLTS graphs, or cross-asset inheritance. Keep the asset self-contained and compose with nested GLTS assets.\n\nThe viewer uses the first camera found by depth-first traversal. If none exists, it autofits the asset. Put an authored camera in the scene only when its framing is intentional. Double-clicking a frame enters orbit from that resolved view; deselecting restores it.\n\nAfter every meaningful visual change, take and inspect a screenshot. Iterate until the asset, camera, composition, and requested frame size are right.\n";
1
+ export declare const designSkill = "---\nname: drawcall-design\ndescription: Create, modify, inspect, and screenshot 3D assets and reference frames in Drawcall Design. Use for Drawcall Design projects, frames, the project filesystem, GLTS assets, or Drawcall Market frames. Do not use for full games or applications.\n---\n\n# Drawcall Design\n\nUse the Drawcall Design MCP tools when available. Otherwise use `npx @drawcall/design`. Design is a remote, current-state canvas: inspect the project and its frames before changing them. Use immutable IDs for every project and frame target; names are only labels.\n\n## Project filesystem\n\nA project is a hosted filesystem at `https://<project-id>.design.drawcallcontent.com/`. Each frame owns one top-level folder, `/<frame-id>/`. The CLI selects the project with `-p <project-id>`; its file paths are exactly the absolute paths inside that project, for example `/f7k3m9q2x8vd/index.glts`.\n\nCreate frames with an explicit type. GLTS frames require `--size`; image and Market frames derive their canvas size. A Market frame requires an exact public asset reference, `name@version`.\n\nRead a file before editing it. Use a narrow edit for one known change and write a complete file when replacing it. Only GLTS frame files may be created or deleted. Image and Market frame files are read-only.\n\n## GLTS assets\n\nA GLTS frame contains only `.glts` files. `index.glts` is its optional root asset; without it the frame renders empty. Every `.glts` file is a trusted TypeScript ESM module that default-exports a no-argument class derived from `THREE.Object3D`. Avoid top-level side effects because reload evaluates the module again. Implement `dispose()` when the asset exclusively owns disposable resources.\n\nAuthor GLTS scenes top-down: create the root entry scene first, reference the child `.glts` assets it will compose, then implement those children progressively. A missing `.glts` import renders as a glowing marker labeled with its filename until the real file is written, so the completed parts of the scene remain visible. Treat the marker and its console warning as a temporary missing-dependency diagnostic, not as authored content.\n\n```ts\nimport * as THREE from \"three\";\nimport Wheel from \"./parts/wheel.glts\";\n\nexport default class Racecar extends THREE.Group {\n constructor() {\n super();\n this.add(new Wheel());\n }\n}\n```\n\nUse relative `.glts` imports within a frame. Use a project-absolute path to import a GLTS asset from another frame:\n\n```ts\nimport Chassis from \"/other-frame-id/index.glts\";\n```\n\nFor a non-GLTS file from an image or Market frame, preserve the project filesystem URL through `import.meta.url`:\n\n```ts\nconst modelUrl = new URL(\"/market-frame-id/models/car.glb\", import.meta.url);\n```\n\nGLTS supports static `.glts`, `three`, Three addons, and bare npm imports. It does not support local helper `.ts` modules, dynamic imports, cyclic GLTS graphs, or cross-asset inheritance. Keep the asset self-contained and compose with nested GLTS assets.\n\nThe viewer uses the first camera found by depth-first traversal. If none exists, it autofits the asset. Put an authored camera in the scene only when its framing is intentional. Double-clicking a frame enters orbit from that resolved view; deselecting restores it.\n\nAfter every meaningful visual change, take and inspect a screenshot. Iterate until the asset, camera, composition, and requested frame size are right.\n";
@@ -1,2 +1,2 @@
1
1
  // Generated from skills/drawcall-design/SKILL.md.
2
- export const designSkill = '---\nname: drawcall-design\ndescription: Create, modify, inspect, and screenshot 3D assets and reference frames in Drawcall Design. Use for Drawcall Design projects, frames, the project filesystem, GLTS assets, or Drawcall Market frames. Do not use for full games or applications.\n---\n\n# Drawcall Design\n\nUse the Drawcall Design MCP tools when available. Otherwise use `npx @drawcall/design`. Design is a remote, current-state canvas: inspect the project and its frames before changing them. Use immutable IDs for every project and frame target; names are only labels.\n\n## Project filesystem\n\nA project is a hosted filesystem at `https://<project-id>.design.drawcallcontent.com/`. Each frame owns one top-level folder, `/<frame-id>/`. The CLI selects the project with `-p <project-id>`; its file paths are exactly the absolute paths inside that project, for example `/f7k3m9q2x8vd/index.glts`.\n\nCreate frames with an explicit type. GLTS frames require `--size`; image and Market frames derive their canvas size. A Market frame requires an exact public asset reference, `name@version`.\n\nRead a file before editing it. Use a narrow edit for one known change and write a complete file when replacing it. Only GLTS frame files may be created or deleted. Image and Market frame files are read-only.\n\n## GLTS assets\n\nA GLTS frame contains only `.glts` files. `index.glts` is its optional root asset; without it the frame renders empty. Every `.glts` file is a trusted TypeScript ESM module that default-exports a no-argument class derived from `THREE.Object3D`. Avoid top-level side effects because reload evaluates the module again. Implement `dispose()` when the asset exclusively owns disposable resources.\n\n```ts\nimport * as THREE from "three";\nimport Wheel from "./parts/wheel.glts";\n\nexport default class Racecar extends THREE.Group {\n constructor() {\n super();\n this.add(new Wheel());\n }\n}\n```\n\nUse relative `.glts` imports within a frame. Use a project-absolute path to import a GLTS asset from another frame:\n\n```ts\nimport Chassis from "/other-frame-id/index.glts";\n```\n\nFor a non-GLTS file from an image or Market frame, preserve the project filesystem URL through `import.meta.url`:\n\n```ts\nconst modelUrl = new URL("/market-frame-id/models/car.glb", import.meta.url);\n```\n\nGLTS supports static `.glts`, `three`, Three addons, and bare npm imports. It does not support local helper `.ts` modules, dynamic imports, cyclic GLTS graphs, or cross-asset inheritance. Keep the asset self-contained and compose with nested GLTS assets.\n\nThe viewer uses the first camera found by depth-first traversal. If none exists, it autofits the asset. Put an authored camera in the scene only when its framing is intentional. Double-clicking a frame enters orbit from that resolved view; deselecting restores it.\n\nAfter every meaningful visual change, take and inspect a screenshot. Iterate until the asset, camera, composition, and requested frame size are right.\n';
2
+ export const designSkill = '---\nname: drawcall-design\ndescription: Create, modify, inspect, and screenshot 3D assets and reference frames in Drawcall Design. Use for Drawcall Design projects, frames, the project filesystem, GLTS assets, or Drawcall Market frames. Do not use for full games or applications.\n---\n\n# Drawcall Design\n\nUse the Drawcall Design MCP tools when available. Otherwise use `npx @drawcall/design`. Design is a remote, current-state canvas: inspect the project and its frames before changing them. Use immutable IDs for every project and frame target; names are only labels.\n\n## Project filesystem\n\nA project is a hosted filesystem at `https://<project-id>.design.drawcallcontent.com/`. Each frame owns one top-level folder, `/<frame-id>/`. The CLI selects the project with `-p <project-id>`; its file paths are exactly the absolute paths inside that project, for example `/f7k3m9q2x8vd/index.glts`.\n\nCreate frames with an explicit type. GLTS frames require `--size`; image and Market frames derive their canvas size. A Market frame requires an exact public asset reference, `name@version`.\n\nRead a file before editing it. Use a narrow edit for one known change and write a complete file when replacing it. Only GLTS frame files may be created or deleted. Image and Market frame files are read-only.\n\n## GLTS assets\n\nA GLTS frame contains only `.glts` files. `index.glts` is its optional root asset; without it the frame renders empty. Every `.glts` file is a trusted TypeScript ESM module that default-exports a no-argument class derived from `THREE.Object3D`. Avoid top-level side effects because reload evaluates the module again. Implement `dispose()` when the asset exclusively owns disposable resources.\n\nAuthor GLTS scenes top-down: create the root entry scene first, reference the child `.glts` assets it will compose, then implement those children progressively. A missing `.glts` import renders as a glowing marker labeled with its filename until the real file is written, so the completed parts of the scene remain visible. Treat the marker and its console warning as a temporary missing-dependency diagnostic, not as authored content.\n\n```ts\nimport * as THREE from "three";\nimport Wheel from "./parts/wheel.glts";\n\nexport default class Racecar extends THREE.Group {\n constructor() {\n super();\n this.add(new Wheel());\n }\n}\n```\n\nUse relative `.glts` imports within a frame. Use a project-absolute path to import a GLTS asset from another frame:\n\n```ts\nimport Chassis from "/other-frame-id/index.glts";\n```\n\nFor a non-GLTS file from an image or Market frame, preserve the project filesystem URL through `import.meta.url`:\n\n```ts\nconst modelUrl = new URL("/market-frame-id/models/car.glb", import.meta.url);\n```\n\nGLTS supports static `.glts`, `three`, Three addons, and bare npm imports. It does not support local helper `.ts` modules, dynamic imports, cyclic GLTS graphs, or cross-asset inheritance. Keep the asset self-contained and compose with nested GLTS assets.\n\nThe viewer uses the first camera found by depth-first traversal. If none exists, it autofits the asset. Put an authored camera in the scene only when its framing is intentional. Double-clicking a frame enters orbit from that resolved view; deselecting restores it.\n\nAfter every meaningful visual change, take and inspect a screenshot. Iterate until the asset, camera, composition, and requested frame size are right.\n';
@@ -0,0 +1,10 @@
1
+ export type FrameCreationCapabilityId = "add-image" | "create-glts" | "search-assets";
2
+ export type FrameCreationInput = "asset" | "height" | "image" | "name" | "width";
3
+ export interface FrameCreationCapability {
4
+ id: FrameCreationCapabilityId;
5
+ frameType: "glts" | "image" | "market";
6
+ label: string;
7
+ description: string;
8
+ inputs: readonly FrameCreationInput[];
9
+ }
10
+ export declare const frameCreationCapabilities: readonly FrameCreationCapability[];
@@ -0,0 +1,23 @@
1
+ export const frameCreationCapabilities = [
2
+ {
3
+ id: "add-image",
4
+ frameType: "image",
5
+ label: "Add image",
6
+ description: "Upload a PNG, JPEG, or WebP image",
7
+ inputs: ["image"],
8
+ },
9
+ {
10
+ id: "create-glts",
11
+ frameType: "glts",
12
+ label: "Create GLTS frame",
13
+ description: "Create an empty programmable 3D frame",
14
+ inputs: ["name", "width", "height"],
15
+ },
16
+ {
17
+ id: "search-assets",
18
+ frameType: "market",
19
+ label: "Search assets",
20
+ description: "Find an approved public Drawcall Market asset",
21
+ inputs: ["asset"],
22
+ },
23
+ ];
@@ -12,6 +12,15 @@ export declare const contract: {
12
12
  list: import("@orpc/contract").ContractProcedureBuilderWithOutput<import("@orpc/contract").Schema<unknown, unknown>, z.ZodArray<z.ZodObject<{
13
13
  id: z.ZodString;
14
14
  name: z.ZodString;
15
+ sourceBrief: z.ZodNullable<z.ZodString>;
16
+ title: z.ZodNullable<z.ZodString>;
17
+ summary: z.ZodNullable<z.ZodString>;
18
+ derivationStatus: z.ZodEnum<{
19
+ not_requested: "not_requested";
20
+ pending: "pending";
21
+ failed: "failed";
22
+ complete: "complete";
23
+ }>;
15
24
  createdAt: z.ZodString;
16
25
  updatedAt: z.ZodString;
17
26
  }, z.core.$strip>>, Record<never, never>, Record<never, never>>;
@@ -20,6 +29,50 @@ export declare const contract: {
20
29
  }, z.core.$strip>, z.ZodObject<{
21
30
  id: z.ZodString;
22
31
  name: z.ZodString;
32
+ sourceBrief: z.ZodNullable<z.ZodString>;
33
+ title: z.ZodNullable<z.ZodString>;
34
+ summary: z.ZodNullable<z.ZodString>;
35
+ derivationStatus: z.ZodEnum<{
36
+ not_requested: "not_requested";
37
+ pending: "pending";
38
+ failed: "failed";
39
+ complete: "complete";
40
+ }>;
41
+ createdAt: z.ZodString;
42
+ updatedAt: z.ZodString;
43
+ }, z.core.$strip>, Record<never, never>, Record<never, never>>;
44
+ createFromBrief: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
45
+ brief: z.ZodString;
46
+ requestId: z.ZodString;
47
+ }, z.core.$strip>, z.ZodObject<{
48
+ id: z.ZodString;
49
+ name: z.ZodString;
50
+ sourceBrief: z.ZodNullable<z.ZodString>;
51
+ title: z.ZodNullable<z.ZodString>;
52
+ summary: z.ZodNullable<z.ZodString>;
53
+ derivationStatus: z.ZodEnum<{
54
+ not_requested: "not_requested";
55
+ pending: "pending";
56
+ failed: "failed";
57
+ complete: "complete";
58
+ }>;
59
+ createdAt: z.ZodString;
60
+ updatedAt: z.ZodString;
61
+ }, z.core.$strip>, Record<never, never>, Record<never, never>>;
62
+ retryDerivation: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
63
+ project: z.ZodString;
64
+ }, z.core.$strip>, z.ZodObject<{
65
+ id: z.ZodString;
66
+ name: z.ZodString;
67
+ sourceBrief: z.ZodNullable<z.ZodString>;
68
+ title: z.ZodNullable<z.ZodString>;
69
+ summary: z.ZodNullable<z.ZodString>;
70
+ derivationStatus: z.ZodEnum<{
71
+ not_requested: "not_requested";
72
+ pending: "pending";
73
+ failed: "failed";
74
+ complete: "complete";
75
+ }>;
23
76
  createdAt: z.ZodString;
24
77
  updatedAt: z.ZodString;
25
78
  }, z.core.$strip>, Record<never, never>, Record<never, never>>;
@@ -1,6 +1,6 @@
1
1
  import { oc } from "@orpc/contract";
2
2
  import { z } from "zod";
3
- import { createFrameSchema, designIdSchema, fileListSchema, fileMutationSchema, fileSchema, fileTextSchema, frameNameSchema, frameSchema, projectDirectoryPathSchema, projectNameSchema, projectPathSchema, projectSchema, screenshotSchema, userSchema, } from "./schemas.js";
3
+ import { createFrameSchema, createProjectFromBriefSchema, designIdSchema, fileListSchema, fileMutationSchema, fileSchema, fileTextSchema, frameNameSchema, frameSchema, projectDirectoryPathSchema, projectNameSchema, projectPathSchema, projectSchema, screenshotSchema, userSchema, } from "./schemas.js";
4
4
  const projectInputSchema = z.object({ project: designIdSchema });
5
5
  const frameInputSchema = projectInputSchema.extend({ frame: designIdSchema });
6
6
  const fileInputSchema = projectInputSchema.extend({ path: projectPathSchema });
@@ -17,6 +17,17 @@ export const contract = {
17
17
  .route({ method: "POST", path: "/projects" })
18
18
  .input(z.object({ name: projectNameSchema }))
19
19
  .output(projectSchema),
20
+ createFromBrief: oc
21
+ .route({ method: "POST", path: "/projects/from-brief" })
22
+ .input(createProjectFromBriefSchema)
23
+ .output(projectSchema),
24
+ retryDerivation: oc
25
+ .route({
26
+ method: "POST",
27
+ path: "/projects/{project}/derivation",
28
+ })
29
+ .input(projectInputSchema)
30
+ .output(projectSchema),
20
31
  delete: oc
21
32
  .route({ method: "DELETE", path: "/projects/{project}" })
22
33
  .input(projectInputSchema)
@@ -1,3 +1,4 @@
1
1
  export { contract, type V1Contract } from "./contract.js";
2
+ export { frameCreationCapabilities, type FrameCreationCapability, type FrameCreationCapabilityId, type FrameCreationInput, } from "./capabilities.js";
2
3
  export { createClient, DEFAULT_BASE_URL, type DesignV1Client, type DesignV1ClientOptions, } from "./client.js";
3
4
  export * from "./schemas.js";
package/dist/v1/index.js CHANGED
@@ -1,3 +1,4 @@
1
1
  export { contract } from "./contract.js";
2
+ export { frameCreationCapabilities, } from "./capabilities.js";
2
3
  export { createClient, DEFAULT_BASE_URL, } from "./client.js";
3
4
  export * from "./schemas.js";
@@ -3,6 +3,14 @@ export declare const MAX_FRAME_DIMENSION = 4096;
3
3
  export declare const MAX_FILE_LENGTH = 512000;
4
4
  export declare const designIdSchema: z.ZodString;
5
5
  export declare const projectNameSchema: z.ZodString;
6
+ export declare const projectBriefSchema: z.ZodString;
7
+ export declare const projectSummarySchema: z.ZodString;
8
+ export declare const projectDerivationStatusSchema: z.ZodEnum<{
9
+ not_requested: "not_requested";
10
+ pending: "pending";
11
+ failed: "failed";
12
+ complete: "complete";
13
+ }>;
6
14
  export declare const frameNameSchema: z.ZodString;
7
15
  export declare const frameSizeSchema: z.ZodNumber;
8
16
  export declare const framePositionSchema: z.ZodNumber;
@@ -25,9 +33,22 @@ export declare const userSchema: z.ZodObject<{
25
33
  export declare const projectSchema: z.ZodObject<{
26
34
  id: z.ZodString;
27
35
  name: z.ZodString;
36
+ sourceBrief: z.ZodNullable<z.ZodString>;
37
+ title: z.ZodNullable<z.ZodString>;
38
+ summary: z.ZodNullable<z.ZodString>;
39
+ derivationStatus: z.ZodEnum<{
40
+ not_requested: "not_requested";
41
+ pending: "pending";
42
+ failed: "failed";
43
+ complete: "complete";
44
+ }>;
28
45
  createdAt: z.ZodString;
29
46
  updatedAt: z.ZodString;
30
47
  }, z.core.$strip>;
48
+ export declare const createProjectFromBriefSchema: z.ZodObject<{
49
+ brief: z.ZodString;
50
+ requestId: z.ZodString;
51
+ }, z.core.$strip>;
31
52
  export declare const gltsFrameSchema: z.ZodObject<{
32
53
  id: z.ZodString;
33
54
  projectId: z.ZodString;
@@ -193,6 +214,8 @@ export declare const screenshotSchema: z.ZodObject<{
193
214
  }, z.core.$strip>;
194
215
  export type User = z.infer<typeof userSchema>;
195
216
  export type Project = z.infer<typeof projectSchema>;
217
+ export type CreateProjectFromBrief = z.infer<typeof createProjectFromBriefSchema>;
218
+ export type ProjectDerivationStatus = z.infer<typeof projectDerivationStatusSchema>;
196
219
  export type GltsFrame = z.infer<typeof gltsFrameSchema>;
197
220
  export type ImageFrame = z.infer<typeof imageFrameSchema>;
198
221
  export type MarketFrame = z.infer<typeof marketFrameSchema>;
@@ -10,6 +10,17 @@ export const projectNameSchema = z
10
10
  .min(1)
11
11
  .max(80)
12
12
  .refine((name) => !name.includes("/"), "Project names cannot contain /");
13
+ export const projectBriefSchema = z
14
+ .string()
15
+ .max(4_000)
16
+ .refine((brief) => brief.trim().length > 0, "Project briefs cannot be empty");
17
+ export const projectSummarySchema = z.string().trim().min(1).max(280);
18
+ export const projectDerivationStatusSchema = z.enum([
19
+ "not_requested",
20
+ "pending",
21
+ "failed",
22
+ "complete",
23
+ ]);
13
24
  export const frameNameSchema = z
14
25
  .string()
15
26
  .trim()
@@ -54,9 +65,17 @@ export const userSchema = z.object({
54
65
  export const projectSchema = z.object({
55
66
  id: designIdSchema,
56
67
  name: projectNameSchema,
68
+ sourceBrief: projectBriefSchema.nullable(),
69
+ title: projectNameSchema.nullable(),
70
+ summary: projectSummarySchema.nullable(),
71
+ derivationStatus: projectDerivationStatusSchema,
57
72
  createdAt: z.string().datetime(),
58
73
  updatedAt: z.string().datetime(),
59
74
  });
75
+ export const createProjectFromBriefSchema = z.object({
76
+ brief: projectBriefSchema,
77
+ requestId: z.string().uuid(),
78
+ });
60
79
  const frameBaseSchema = z.object({
61
80
  id: designIdSchema,
62
81
  projectId: designIdSchema,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@drawcall/design",
3
- "version": "0.2.12",
3
+ "version": "0.3.0",
4
4
  "description": "Typed API and remote CLI for Drawcall Design",
5
5
  "repository": {
6
6
  "type": "git",
@@ -19,6 +19,8 @@ Read a file before editing it. Use a narrow edit for one known change and write
19
19
 
20
20
  A GLTS frame contains only `.glts` files. `index.glts` is its optional root asset; without it the frame renders empty. Every `.glts` file is a trusted TypeScript ESM module that default-exports a no-argument class derived from `THREE.Object3D`. Avoid top-level side effects because reload evaluates the module again. Implement `dispose()` when the asset exclusively owns disposable resources.
21
21
 
22
+ Author GLTS scenes top-down: create the root entry scene first, reference the child `.glts` assets it will compose, then implement those children progressively. A missing `.glts` import renders as a glowing marker labeled with its filename until the real file is written, so the completed parts of the scene remain visible. Treat the marker and its console warning as a temporary missing-dependency diagnostic, not as authored content.
23
+
22
24
  ```ts
23
25
  import * as THREE from "three";
24
26
  import Wheel from "./parts/wheel.glts";