@drawcall/design 0.5.2 → 0.5.4
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/cli.js +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/protocol.d.ts +25 -0
- package/dist/protocol.js +21 -0
- package/dist/skill.generated.d.ts +2 -1
- package/dist/skill.generated.js +3 -2
- package/dist/v1/contract.js +4 -2
- package/dist/v1/schemas.d.ts +1 -0
- package/dist/v1/schemas.js +9 -6
- package/package.json +1 -1
- package/skills/drawcall-design/SKILL.md +24 -6
package/dist/cli.js
CHANGED
|
@@ -4,7 +4,7 @@ import { Command, Option } from "commander";
|
|
|
4
4
|
import { clearConfig, getConfigPath, saveConfig } from "./config.js";
|
|
5
5
|
import { getCliClient } from "./cli-client.js";
|
|
6
6
|
import { readImageInput } from "./image.js";
|
|
7
|
-
import {
|
|
7
|
+
import { cliDesignSkill } from "./skill.generated.js";
|
|
8
8
|
import { parseFrameSize } from "./target.js";
|
|
9
9
|
import { createClient, DEFAULT_BASE_URL } from "./v1/client.js";
|
|
10
10
|
import { designIdSchema, marketAssetSchema } from "./v1/schemas.js";
|
|
@@ -20,7 +20,7 @@ program
|
|
|
20
20
|
.command("skill")
|
|
21
21
|
.description("Print the Drawcall Design skill")
|
|
22
22
|
.action(() => {
|
|
23
|
-
process.stdout.write(
|
|
23
|
+
process.stdout.write(cliDesignSkill);
|
|
24
24
|
});
|
|
25
25
|
program
|
|
26
26
|
.command("login")
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export * as v1 from "./v1/index.js";
|
|
2
|
-
export {
|
|
2
|
+
export { cliDesignSkill, mcpDesignSkill } from "./skill.generated.js";
|
|
3
3
|
export { frameCreationCapabilities, type FrameCreationCapability, type FrameCreationCapabilityId, type FrameCreationInput, } from "./v1/capabilities.js";
|
|
4
4
|
export { cameraPoseSchema, IMAGE_GENERATION_MODEL, IMAGE_GENERATION_PROVIDER, } from "./v1/schemas.js";
|
|
5
5
|
export { parseFrameSize } from "./target.js";
|
|
6
6
|
export { projectFrameLayoutSchema, projectFrameRecordSchema, projectGltsFrameRecordSchema, projectImageFrameRecordSchema, projectMarketFileSchema, projectMarketFrameRecordSchema, projectPresenceClientMessageSchema, projectPresenceServerMessageSchema, projectStateSchema, type ProjectFrameLayout, type ProjectFrameRecord, type ProjectGltsFrameRecord, type ProjectImageFrameRecord, type ProjectMarketFile, type ProjectMarketFrameRecord, type ProjectPresenceClientMessage, type ProjectPresenceServerMessage, type ProjectState, } from "./project-state.js";
|
|
7
|
-
export { acknowledgesInspection, cameraCaptureCommandSchema, cameraCaptureResultSchema, cameraMessageTypes, gltsExportCancelCommandSchema, gltsExportCancelledResultSchema, gltsExportCommandSchema, gltsExportFrameMessageSchema, gltsExportMessageTypes, gltsExportParentMessageSchema, gltsExportResultSchema, gltsRuntimeExportFormatSchema, inspectionCommandSchema, inspectionFrameMessageSchema, inspectionMessageTypes, projectSyncUrl, sourceFileChangeSchema, sourceFileMessageTypes, sourceFileReloadResultSchema, sourceFilesChangedMessageSchema, type GltsExportCancelCommand, type GltsExportCancelledResult, type GltsExportCommand, type GltsExportFrameMessage, type GltsExportParentMessage, type GltsExportResult, type GltsRuntimeExportFormat, type CameraCaptureCommand, type CameraCaptureFailure, type CameraCaptureResult, type InspectionAppliedMessage, type InspectionCommand, type InspectionFrameMessage, type SourceFileChange, type SourceFileReloadResult, type SourceFilesChangedMessage, } from "./protocol.js";
|
|
7
|
+
export { acknowledgesInspection, cameraCaptureCommandSchema, cameraCaptureResultSchema, cameraMessageTypes, gltsExportCancelCommandSchema, gltsExportCancelledResultSchema, gltsExportCommandSchema, gltsExportFrameMessageSchema, gltsExportMessageTypes, gltsExportParentMessageSchema, gltsExportResultSchema, gltsRuntimeExportFormatSchema, immersiveCommandSchema, immersiveFrameMessageSchema, immersiveMessageTypes, immersiveModeSchema, inspectionCommandSchema, inspectionFrameMessageSchema, inspectionMessageTypes, projectSyncUrl, sourceFileChangeSchema, sourceFileMessageTypes, sourceFileReloadResultSchema, sourceFilesChangedMessageSchema, type GltsExportCancelCommand, type GltsExportCancelledResult, type GltsExportCommand, type GltsExportFrameMessage, type GltsExportParentMessage, type GltsExportResult, type GltsRuntimeExportFormat, type CameraCaptureCommand, type CameraCaptureFailure, type CameraCaptureResult, type InspectionAppliedMessage, type InspectionCommand, type InspectionFrameMessage, type ImmersiveCommand, type ImmersiveFrameMessage, type ImmersiveMode, type SourceFileChange, type SourceFileReloadResult, type SourceFilesChangedMessage, } from "./protocol.js";
|
|
8
8
|
export type { BinaryFile, CameraPose, CreateFrame, CreateProjectFromBrief, CreateGltsFrame, CreateImageFrame, CreateMarketFrame, GenerateImageFrame, DesignFile, FileList, FileMutation, FrameExport, Frame, GltsFrame, GltsFrameExport, ImageFrame, ImageFrameExport, ImageGenerationOperation, ImageGenerationProvenance, ImageGenerationResult, MarketFrame, MarketFrameExport, Project, ProjectDerivationStatus, Screenshot, TextFile, User, } from "./v1/schemas.js";
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export * as v1 from "./v1/index.js";
|
|
2
|
-
export {
|
|
2
|
+
export { cliDesignSkill, mcpDesignSkill } from "./skill.generated.js";
|
|
3
3
|
export { frameCreationCapabilities, } from "./v1/capabilities.js";
|
|
4
4
|
export { cameraPoseSchema, IMAGE_GENERATION_MODEL, IMAGE_GENERATION_PROVIDER, } from "./v1/schemas.js";
|
|
5
5
|
export { parseFrameSize } from "./target.js";
|
|
6
6
|
export { projectFrameLayoutSchema, projectFrameRecordSchema, projectGltsFrameRecordSchema, projectImageFrameRecordSchema, projectMarketFileSchema, projectMarketFrameRecordSchema, projectPresenceClientMessageSchema, projectPresenceServerMessageSchema, projectStateSchema, } from "./project-state.js";
|
|
7
|
-
export { acknowledgesInspection, cameraCaptureCommandSchema, cameraCaptureResultSchema, cameraMessageTypes, gltsExportCancelCommandSchema, gltsExportCancelledResultSchema, gltsExportCommandSchema, gltsExportFrameMessageSchema, gltsExportMessageTypes, gltsExportParentMessageSchema, gltsExportResultSchema, gltsRuntimeExportFormatSchema, inspectionCommandSchema, inspectionFrameMessageSchema, inspectionMessageTypes, projectSyncUrl, sourceFileChangeSchema, sourceFileMessageTypes, sourceFileReloadResultSchema, sourceFilesChangedMessageSchema, } from "./protocol.js";
|
|
7
|
+
export { acknowledgesInspection, cameraCaptureCommandSchema, cameraCaptureResultSchema, cameraMessageTypes, gltsExportCancelCommandSchema, gltsExportCancelledResultSchema, gltsExportCommandSchema, gltsExportFrameMessageSchema, gltsExportMessageTypes, gltsExportParentMessageSchema, gltsExportResultSchema, gltsRuntimeExportFormatSchema, immersiveCommandSchema, immersiveFrameMessageSchema, immersiveMessageTypes, immersiveModeSchema, inspectionCommandSchema, inspectionFrameMessageSchema, inspectionMessageTypes, projectSyncUrl, sourceFileChangeSchema, sourceFileMessageTypes, sourceFileReloadResultSchema, sourceFilesChangedMessageSchema, } from "./protocol.js";
|
package/dist/protocol.d.ts
CHANGED
|
@@ -7,6 +7,28 @@ export declare const inspectionMessageTypes: {
|
|
|
7
7
|
readonly ready: "drawcall:inspection:ready";
|
|
8
8
|
readonly set: "drawcall:inspection:set";
|
|
9
9
|
};
|
|
10
|
+
export declare const immersiveMessageTypes: {
|
|
11
|
+
readonly enter: "drawcall:immersive:enter";
|
|
12
|
+
readonly error: "drawcall:immersive:error";
|
|
13
|
+
readonly exit: "drawcall:immersive:exit";
|
|
14
|
+
};
|
|
15
|
+
export declare const immersiveModeSchema: z.ZodEnum<{
|
|
16
|
+
ar: "ar";
|
|
17
|
+
vr: "vr";
|
|
18
|
+
}>;
|
|
19
|
+
export declare const immersiveCommandSchema: z.ZodObject<{
|
|
20
|
+
type: z.ZodLiteral<"drawcall:immersive:enter">;
|
|
21
|
+
mode: z.ZodEnum<{
|
|
22
|
+
ar: "ar";
|
|
23
|
+
vr: "vr";
|
|
24
|
+
}>;
|
|
25
|
+
}, z.core.$strict>;
|
|
26
|
+
export declare const immersiveFrameMessageSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
27
|
+
type: z.ZodLiteral<"drawcall:immersive:exit">;
|
|
28
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
29
|
+
type: z.ZodLiteral<"drawcall:immersive:error">;
|
|
30
|
+
message: z.ZodString;
|
|
31
|
+
}, z.core.$strict>], "type">;
|
|
10
32
|
export declare const gltsExportMessageTypes: {
|
|
11
33
|
readonly cancel: "drawcall:export:cancel";
|
|
12
34
|
readonly cancelled: "drawcall:export:cancelled";
|
|
@@ -171,6 +193,9 @@ export declare const inspectionFrameMessageSchema: z.ZodDiscriminatedUnion<[z.Zo
|
|
|
171
193
|
type: z.ZodLiteral<"drawcall:inspection:exit">;
|
|
172
194
|
}, z.core.$strict>], "type">;
|
|
173
195
|
export type InspectionCommand = z.infer<typeof inspectionCommandSchema>;
|
|
196
|
+
export type ImmersiveMode = z.infer<typeof immersiveModeSchema>;
|
|
197
|
+
export type ImmersiveCommand = z.infer<typeof immersiveCommandSchema>;
|
|
198
|
+
export type ImmersiveFrameMessage = z.infer<typeof immersiveFrameMessageSchema>;
|
|
174
199
|
export type CameraCaptureCommand = z.infer<typeof cameraCaptureCommandSchema>;
|
|
175
200
|
export type CameraCaptureResult = z.infer<typeof cameraCaptureResultSchema>;
|
|
176
201
|
export type SourceFileChange = z.infer<typeof sourceFileChangeSchema>;
|
package/dist/protocol.js
CHANGED
|
@@ -8,6 +8,27 @@ export const inspectionMessageTypes = {
|
|
|
8
8
|
ready: "drawcall:inspection:ready",
|
|
9
9
|
set: "drawcall:inspection:set",
|
|
10
10
|
};
|
|
11
|
+
export const immersiveMessageTypes = {
|
|
12
|
+
enter: "drawcall:immersive:enter",
|
|
13
|
+
error: "drawcall:immersive:error",
|
|
14
|
+
exit: "drawcall:immersive:exit",
|
|
15
|
+
};
|
|
16
|
+
export const immersiveModeSchema = z.enum(["ar", "vr"]);
|
|
17
|
+
export const immersiveCommandSchema = z
|
|
18
|
+
.object({
|
|
19
|
+
type: z.literal(immersiveMessageTypes.enter),
|
|
20
|
+
mode: immersiveModeSchema,
|
|
21
|
+
})
|
|
22
|
+
.strict();
|
|
23
|
+
export const immersiveFrameMessageSchema = z.discriminatedUnion("type", [
|
|
24
|
+
z.object({ type: z.literal(immersiveMessageTypes.exit) }).strict(),
|
|
25
|
+
z
|
|
26
|
+
.object({
|
|
27
|
+
type: z.literal(immersiveMessageTypes.error),
|
|
28
|
+
message: z.string().min(1),
|
|
29
|
+
})
|
|
30
|
+
.strict(),
|
|
31
|
+
]);
|
|
11
32
|
export const gltsExportMessageTypes = {
|
|
12
33
|
cancel: "drawcall:export:cancel",
|
|
13
34
|
cancelled: "drawcall:export:cancelled",
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export declare const
|
|
1
|
+
export declare const mcpDesignSkill = "---\nname: drawcall-design\ndescription: Create, modify, inspect, compose, and reuse 3D GLTS assets and optional image or Market references in Drawcall Design. Use whenever the user names Drawcall Design or one of its projects, canvases, frames, filesystems, or GLTS assets. Do not use for full games, applications, or unrelated image generation.\n---\n\n# Drawcall Design\n\n## MCP transport\n\nMCP tools are the only Drawcall transport in this environment. Do not invoke a CLI or shell, make direct HTTP requests, or search the web for another transport. A failed MCP call does not make MCP unavailable.\n\nUse `generate_image` only when the user asks for a 2D image or reference. A 3D object, scene, or reusable asset is GLTS work, even when the user calls its canvas container a frame.\n\nTool arguments are JSON objects. File tools identify their target with `project` and a project-absolute `path`; they do not accept a separate `frame` argument. Call `list_files` and pass one of its returned paths unchanged.\n\n```json\n[\n {\n \"tool\": \"list_projects\",\n \"arguments\": {}\n },\n {\n \"tool\": \"list_frames\",\n \"arguments\": {\n \"project\": \"r6z2n9k4x8m1qc\"\n }\n },\n {\n \"tool\": \"list_files\",\n \"arguments\": {\n \"project\": \"r6z2n9k4x8m1qc\"\n }\n },\n {\n \"tool\": \"read_file\",\n \"arguments\": {\n \"project\": \"r6z2n9k4x8m1qc\",\n \"path\": \"/a4z8m2q7v9kcde/index.glts\"\n }\n },\n {\n \"tool\": \"edit_file\",\n \"arguments\": {\n \"project\": \"r6z2n9k4x8m1qc\",\n \"path\": \"/a4z8m2q7v9kcde/index.glts\",\n \"oldText\": \"color: 0xffffff\",\n \"newText\": \"color: 0x000000\"\n }\n }\n]\n```\n\nDesign 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 directory, `/<frame-id>`. Files use project-absolute paths that include that directory, for example `/a4z8m2q7v9kcde/index.glts`.\n\nCreate frames with an explicit type. Choose the type from the requested artifact, not from the word \"frame\": use GLTS for a 3D object or scene, especially one another frame will reuse. Use image only for a supplied 2D image URL and Market only for an exact public asset reference, `name@version`. GLTS frames require a viewport size; image and Market frames derive their canvas size.\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## Failures\n\nAn error means the requested operation did not happen. Follow its next action without switching transport. Correct invalid arguments from the documented shape. Refresh projects, frames, or files after a not-found or conflict error, then reuse the exact returned IDs and paths. Retry an upstream or internal failure once; if it repeats, report the failed operation and error. Never repeat an unchanged failed operation.\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. When a reusable 3D asset belongs in another frame, keep it in its own GLTS frame and import its root by project-absolute path from the consuming frame. Instantiate that import as often as needed instead of copying its source:\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\nTreat authoritative source or structured state as sufficient when it directly and completely determines the requested property. Do not take a screenshot merely to reconfirm that evidence. Take one only when the result depends on rendering or visual relationships the source cannot establish, such as layout, overlap, clipping, camera framing, lighting, or runtime-generated appearance, or when the user explicitly asks. Then inspect it against the request and iterate until the evidence supports completion.\n";
|
|
2
|
+
export declare const cliDesignSkill = "---\nname: drawcall-design\ndescription: Create, modify, inspect, compose, and reuse 3D GLTS assets and optional image or Market references in Drawcall Design. Use whenever the user names Drawcall Design or one of its projects, canvases, frames, filesystems, or GLTS assets. Do not use for full games, applications, or unrelated image generation.\n---\n\n# Drawcall Design\n\n## CLI transport\n\nThe CLI is the only Drawcall transport in this environment. Do not search for MCP tools or make direct HTTP requests. A failed CLI command does not justify switching transport.\n\nCLI calls are shell command strings. Select the project with `-p <project-id>`. File commands take project-absolute paths that include the frame ID.\n\n```sh\nnpx @drawcall/design project list\nnpx @drawcall/design -p r6z2n9k4x8m1qc frame list\nnpx @drawcall/design -p r6z2n9k4x8m1qc ls\nnpx @drawcall/design -p r6z2n9k4x8m1qc read /a4z8m2q7v9kcde/index.glts\nnpx @drawcall/design -p r6z2n9k4x8m1qc edit /a4z8m2q7v9kcde/index.glts 'color: 0xffffff' 'color: 0x000000'\n```\n\nDesign 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 directory, `/<frame-id>`. Files use project-absolute paths that include that directory, for example `/a4z8m2q7v9kcde/index.glts`.\n\nCreate frames with an explicit type. Choose the type from the requested artifact, not from the word \"frame\": use GLTS for a 3D object or scene, especially one another frame will reuse. Use image only for a supplied 2D image URL and Market only for an exact public asset reference, `name@version`. GLTS frames require a viewport size; image and Market frames derive their canvas size.\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## Failures\n\nAn error means the requested operation did not happen. Follow its next action without switching transport. Correct invalid arguments from the documented shape. Refresh projects, frames, or files after a not-found or conflict error, then reuse the exact returned IDs and paths. Retry an upstream or internal failure once; if it repeats, report the failed operation and error. Never repeat an unchanged failed operation.\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. When a reusable 3D asset belongs in another frame, keep it in its own GLTS frame and import its root by project-absolute path from the consuming frame. Instantiate that import as often as needed instead of copying its source:\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\nTreat authoritative source or structured state as sufficient when it directly and completely determines the requested property. Do not take a screenshot merely to reconfirm that evidence. Take one only when the result depends on rendering or visual relationships the source cannot establish, such as layout, overlap, clipping, camera framing, lighting, or runtime-generated appearance, or when the user explicitly asks. Then inspect it against the request and iterate until the evidence supports completion.\n";
|
package/dist/skill.generated.js
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
// Generated from
|
|
2
|
-
export const
|
|
1
|
+
// Generated from skill/SKILL.template.md.
|
|
2
|
+
export const mcpDesignSkill = '---\nname: drawcall-design\ndescription: Create, modify, inspect, compose, and reuse 3D GLTS assets and optional image or Market references in Drawcall Design. Use whenever the user names Drawcall Design or one of its projects, canvases, frames, filesystems, or GLTS assets. Do not use for full games, applications, or unrelated image generation.\n---\n\n# Drawcall Design\n\n## MCP transport\n\nMCP tools are the only Drawcall transport in this environment. Do not invoke a CLI or shell, make direct HTTP requests, or search the web for another transport. A failed MCP call does not make MCP unavailable.\n\nUse `generate_image` only when the user asks for a 2D image or reference. A 3D object, scene, or reusable asset is GLTS work, even when the user calls its canvas container a frame.\n\nTool arguments are JSON objects. File tools identify their target with `project` and a project-absolute `path`; they do not accept a separate `frame` argument. Call `list_files` and pass one of its returned paths unchanged.\n\n```json\n[\n {\n "tool": "list_projects",\n "arguments": {}\n },\n {\n "tool": "list_frames",\n "arguments": {\n "project": "r6z2n9k4x8m1qc"\n }\n },\n {\n "tool": "list_files",\n "arguments": {\n "project": "r6z2n9k4x8m1qc"\n }\n },\n {\n "tool": "read_file",\n "arguments": {\n "project": "r6z2n9k4x8m1qc",\n "path": "/a4z8m2q7v9kcde/index.glts"\n }\n },\n {\n "tool": "edit_file",\n "arguments": {\n "project": "r6z2n9k4x8m1qc",\n "path": "/a4z8m2q7v9kcde/index.glts",\n "oldText": "color: 0xffffff",\n "newText": "color: 0x000000"\n }\n }\n]\n```\n\nDesign 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 directory, `/<frame-id>`. Files use project-absolute paths that include that directory, for example `/a4z8m2q7v9kcde/index.glts`.\n\nCreate frames with an explicit type. Choose the type from the requested artifact, not from the word "frame": use GLTS for a 3D object or scene, especially one another frame will reuse. Use image only for a supplied 2D image URL and Market only for an exact public asset reference, `name@version`. GLTS frames require a viewport size; image and Market frames derive their canvas size.\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## Failures\n\nAn error means the requested operation did not happen. Follow its next action without switching transport. Correct invalid arguments from the documented shape. Refresh projects, frames, or files after a not-found or conflict error, then reuse the exact returned IDs and paths. Retry an upstream or internal failure once; if it repeats, report the failed operation and error. Never repeat an unchanged failed operation.\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. When a reusable 3D asset belongs in another frame, keep it in its own GLTS frame and import its root by project-absolute path from the consuming frame. Instantiate that import as often as needed instead of copying its source:\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\nTreat authoritative source or structured state as sufficient when it directly and completely determines the requested property. Do not take a screenshot merely to reconfirm that evidence. Take one only when the result depends on rendering or visual relationships the source cannot establish, such as layout, overlap, clipping, camera framing, lighting, or runtime-generated appearance, or when the user explicitly asks. Then inspect it against the request and iterate until the evidence supports completion.\n';
|
|
3
|
+
export const cliDesignSkill = '---\nname: drawcall-design\ndescription: Create, modify, inspect, compose, and reuse 3D GLTS assets and optional image or Market references in Drawcall Design. Use whenever the user names Drawcall Design or one of its projects, canvases, frames, filesystems, or GLTS assets. Do not use for full games, applications, or unrelated image generation.\n---\n\n# Drawcall Design\n\n## CLI transport\n\nThe CLI is the only Drawcall transport in this environment. Do not search for MCP tools or make direct HTTP requests. A failed CLI command does not justify switching transport.\n\nCLI calls are shell command strings. Select the project with `-p <project-id>`. File commands take project-absolute paths that include the frame ID.\n\n```sh\nnpx @drawcall/design project list\nnpx @drawcall/design -p r6z2n9k4x8m1qc frame list\nnpx @drawcall/design -p r6z2n9k4x8m1qc ls\nnpx @drawcall/design -p r6z2n9k4x8m1qc read /a4z8m2q7v9kcde/index.glts\nnpx @drawcall/design -p r6z2n9k4x8m1qc edit /a4z8m2q7v9kcde/index.glts \'color: 0xffffff\' \'color: 0x000000\'\n```\n\nDesign 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 directory, `/<frame-id>`. Files use project-absolute paths that include that directory, for example `/a4z8m2q7v9kcde/index.glts`.\n\nCreate frames with an explicit type. Choose the type from the requested artifact, not from the word "frame": use GLTS for a 3D object or scene, especially one another frame will reuse. Use image only for a supplied 2D image URL and Market only for an exact public asset reference, `name@version`. GLTS frames require a viewport size; image and Market frames derive their canvas size.\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## Failures\n\nAn error means the requested operation did not happen. Follow its next action without switching transport. Correct invalid arguments from the documented shape. Refresh projects, frames, or files after a not-found or conflict error, then reuse the exact returned IDs and paths. Retry an upstream or internal failure once; if it repeats, report the failed operation and error. Never repeat an unchanged failed operation.\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. When a reusable 3D asset belongs in another frame, keep it in its own GLTS frame and import its root by project-absolute path from the consuming frame. Instantiate that import as often as needed instead of copying its source:\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\nTreat authoritative source or structured state as sufficient when it directly and completely determines the requested property. Do not take a screenshot merely to reconfirm that evidence. Take one only when the result depends on rendering or visual relationships the source cannot establish, such as layout, overlap, clipping, camera framing, lighting, or runtime-generated appearance, or when the user explicitly asks. Then inspect it against the request and iterate until the evidence supports completion.\n';
|
package/dist/v1/contract.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { oc } from "@orpc/contract";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
import { projectFrameLayoutSchema } from "../project-state.js";
|
|
4
|
-
import { cameraPoseSchema, createFrameSchema, createProjectFromBriefSchema, designIdSchema, fileListSchema, fileMutationSchema, fileSchema, fileTextSchema, frameExportSchema, frameNameSchema, frameSchema, generateImageFrameSchema, projectDirectoryPathSchema,
|
|
4
|
+
import { cameraPoseSchema, createFrameSchema, createProjectFromBriefSchema, designIdSchema, fileListSchema, fileMutationSchema, fileSchema, fileTextSchema, frameExportSchema, frameNameSchema, frameSchema, generateImageFrameSchema, projectDirectoryPathSchema, projectFilePathSchema, projectNameSchema, projectSchema, screenshotSchema, userSchema, } from "./schemas.js";
|
|
5
5
|
const projectInputSchema = z.object({ project: designIdSchema });
|
|
6
6
|
const frameInputSchema = projectInputSchema.extend({ frame: designIdSchema });
|
|
7
|
-
const fileInputSchema = projectInputSchema.extend({
|
|
7
|
+
const fileInputSchema = projectInputSchema.extend({
|
|
8
|
+
path: projectFilePathSchema,
|
|
9
|
+
});
|
|
8
10
|
const deletedSchema = z.object({ id: designIdSchema });
|
|
9
11
|
export const contract = {
|
|
10
12
|
user: {
|
package/dist/v1/schemas.d.ts
CHANGED
|
@@ -35,6 +35,7 @@ export declare const imageUrlSchema: z.ZodString;
|
|
|
35
35
|
export declare const projectPathSchema: z.ZodString;
|
|
36
36
|
/** A project directory path. `/` denotes the project root. */
|
|
37
37
|
export declare const projectDirectoryPathSchema: z.ZodUnion<readonly [z.ZodLiteral<"/">, z.ZodString]>;
|
|
38
|
+
export declare const projectFilePathSchema: z.ZodString;
|
|
38
39
|
export declare const fileTextSchema: z.ZodString;
|
|
39
40
|
export declare const marketAssetNameSchema: z.ZodString;
|
|
40
41
|
export declare const marketAssetVersionSchema: z.ZodString;
|
package/dist/v1/schemas.js
CHANGED
|
@@ -5,7 +5,7 @@ export const MAX_IMAGE_GENERATION_PROMPT_LENGTH = 2_048;
|
|
|
5
5
|
export const MAX_IMAGE_GENERATION_REFERENCES = 4;
|
|
6
6
|
export const designIdSchema = z
|
|
7
7
|
.string()
|
|
8
|
-
.regex(/^[a-z0-9]{14}$/, "IDs are 14 lowercase alphanumeric characters");
|
|
8
|
+
.regex(/^[a-z0-9]{14}$/, "IDs are exactly 14 lowercase alphanumeric characters; use an ID returned by a list operation");
|
|
9
9
|
export const projectNameSchema = z
|
|
10
10
|
.string()
|
|
11
11
|
.trim()
|
|
@@ -66,8 +66,11 @@ export const projectPathSchema = z.string().max(1_024).refine(isProjectPath, {
|
|
|
66
66
|
export const projectDirectoryPathSchema = z
|
|
67
67
|
.union([z.literal("/"), projectPathSchema])
|
|
68
68
|
.refine((path) => path === "/" || !path.endsWith("/"), {
|
|
69
|
-
message: "Directory paths cannot end with
|
|
69
|
+
message: "Directory paths cannot end with /. Use /<frame-id> or omit the path to list the entire project",
|
|
70
70
|
});
|
|
71
|
+
export const projectFilePathSchema = projectPathSchema
|
|
72
|
+
.regex(/^\/[a-z0-9]{14}\/.+/, "Project file paths must include a frame ID and filename, for example /a4z8m2q7v9kcde/index.glts")
|
|
73
|
+
.describe("Project-absolute file path including the frame ID, for example /a4z8m2q7v9kcde/index.glts");
|
|
71
74
|
export const fileTextSchema = z.string().max(MAX_FILE_LENGTH);
|
|
72
75
|
export const marketAssetNameSchema = z
|
|
73
76
|
.string()
|
|
@@ -148,7 +151,7 @@ export const imageGenerationProvenanceSchema = z.discriminatedUnion("provider",
|
|
|
148
151
|
]);
|
|
149
152
|
export const imageFrameSchema = frameBaseSchema.extend({
|
|
150
153
|
type: z.literal("image"),
|
|
151
|
-
file:
|
|
154
|
+
file: projectFilePathSchema,
|
|
152
155
|
provenance: imageGenerationProvenanceSchema.optional(),
|
|
153
156
|
});
|
|
154
157
|
export const marketFrameSchema = frameBaseSchema.extend({
|
|
@@ -273,17 +276,17 @@ export const generateImageFrameSchema = z
|
|
|
273
276
|
}
|
|
274
277
|
});
|
|
275
278
|
export const fileListSchema = z.object({
|
|
276
|
-
paths: z.array(
|
|
279
|
+
paths: z.array(projectFilePathSchema),
|
|
277
280
|
});
|
|
278
281
|
export const textFileSchema = z.object({
|
|
279
282
|
type: z.literal("text"),
|
|
280
|
-
path:
|
|
283
|
+
path: projectFilePathSchema,
|
|
281
284
|
text: z.string(),
|
|
282
285
|
mediaType: z.literal("text/plain"),
|
|
283
286
|
});
|
|
284
287
|
export const binaryFileSchema = z.object({
|
|
285
288
|
type: z.literal("binary"),
|
|
286
|
-
path:
|
|
289
|
+
path: projectFilePathSchema,
|
|
287
290
|
url: httpUrlSchema,
|
|
288
291
|
mediaType: z.string().min(1),
|
|
289
292
|
});
|
package/package.json
CHANGED
|
@@ -1,20 +1,38 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: drawcall-design
|
|
3
|
-
description: Create, modify, inspect, and
|
|
3
|
+
description: Create, modify, inspect, compose, and reuse 3D GLTS assets and optional image or Market references in Drawcall Design. Use whenever the user names Drawcall Design or one of its projects, canvases, frames, filesystems, or GLTS assets. Do not use for full games, applications, or unrelated image generation.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Drawcall Design
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
## CLI transport
|
|
9
|
+
|
|
10
|
+
The CLI is the only Drawcall transport in this environment. Do not search for MCP tools or make direct HTTP requests. A failed CLI command does not justify switching transport.
|
|
11
|
+
|
|
12
|
+
CLI calls are shell command strings. Select the project with `-p <project-id>`. File commands take project-absolute paths that include the frame ID.
|
|
13
|
+
|
|
14
|
+
```sh
|
|
15
|
+
npx @drawcall/design project list
|
|
16
|
+
npx @drawcall/design -p r6z2n9k4x8m1qc frame list
|
|
17
|
+
npx @drawcall/design -p r6z2n9k4x8m1qc ls
|
|
18
|
+
npx @drawcall/design -p r6z2n9k4x8m1qc read /a4z8m2q7v9kcde/index.glts
|
|
19
|
+
npx @drawcall/design -p r6z2n9k4x8m1qc edit /a4z8m2q7v9kcde/index.glts 'color: 0xffffff' 'color: 0x000000'
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
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.
|
|
9
23
|
|
|
10
24
|
## Project filesystem
|
|
11
25
|
|
|
12
|
-
A project is a hosted filesystem at `https://<project-id>.design.drawcallcontent.com/`. Each frame owns one top-level
|
|
26
|
+
A project is a hosted filesystem at `https://<project-id>.design.drawcallcontent.com/`. Each frame owns one top-level directory, `/<frame-id>`. Files use project-absolute paths that include that directory, for example `/a4z8m2q7v9kcde/index.glts`.
|
|
13
27
|
|
|
14
|
-
Create frames with an explicit type. GLTS
|
|
28
|
+
Create frames with an explicit type. Choose the type from the requested artifact, not from the word "frame": use GLTS for a 3D object or scene, especially one another frame will reuse. Use image only for a supplied 2D image URL and Market only for an exact public asset reference, `name@version`. GLTS frames require a viewport size; image and Market frames derive their canvas size.
|
|
15
29
|
|
|
16
30
|
Read 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.
|
|
17
31
|
|
|
32
|
+
## Failures
|
|
33
|
+
|
|
34
|
+
An error means the requested operation did not happen. Follow its next action without switching transport. Correct invalid arguments from the documented shape. Refresh projects, frames, or files after a not-found or conflict error, then reuse the exact returned IDs and paths. Retry an upstream or internal failure once; if it repeats, report the failed operation and error. Never repeat an unchanged failed operation.
|
|
35
|
+
|
|
18
36
|
## GLTS assets
|
|
19
37
|
|
|
20
38
|
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.
|
|
@@ -33,7 +51,7 @@ export default class Racecar extends THREE.Group {
|
|
|
33
51
|
}
|
|
34
52
|
```
|
|
35
53
|
|
|
36
|
-
Use relative `.glts` imports within a frame.
|
|
54
|
+
Use relative `.glts` imports within a frame. When a reusable 3D asset belongs in another frame, keep it in its own GLTS frame and import its root by project-absolute path from the consuming frame. Instantiate that import as often as needed instead of copying its source:
|
|
37
55
|
|
|
38
56
|
```ts
|
|
39
57
|
import Chassis from "/other-frame-id/index.glts";
|
|
@@ -49,4 +67,4 @@ GLTS supports static `.glts`, `three`, Three addons, and bare npm imports. It do
|
|
|
49
67
|
|
|
50
68
|
The 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.
|
|
51
69
|
|
|
52
|
-
|
|
70
|
+
Treat authoritative source or structured state as sufficient when it directly and completely determines the requested property. Do not take a screenshot merely to reconfirm that evidence. Take one only when the result depends on rendering or visual relationships the source cannot establish, such as layout, overlap, clipping, camera framing, lighting, or runtime-generated appearance, or when the user explicitly asks. Then inspect it against the request and iterate until the evidence supports completion.
|