@drawcall/design 0.8.1 → 0.9.1
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 +25 -12
- package/dist/browser.d.ts +2 -1
- package/dist/browser.js +1 -0
- package/dist/cli-client.js +6 -2
- package/dist/command/context.d.ts +750 -0
- package/dist/command/context.js +17 -0
- package/dist/command/filesystem.d.ts +2 -0
- package/dist/command/filesystem.js +80 -0
- package/dist/command/frame.d.ts +2 -0
- package/dist/command/frame.js +127 -0
- package/dist/command/image.d.ts +2 -0
- package/dist/command/image.js +69 -0
- package/dist/command/project.d.ts +2 -0
- package/dist/command/project.js +39 -0
- package/dist/command.js +6 -248
- package/dist/frame-image.d.ts +1 -0
- package/dist/frame-image.js +6 -0
- package/dist/image.d.ts +2 -1
- package/dist/image.js +2 -4
- package/dist/mcp/frame.js +17 -14
- package/dist/mcp/skill.js +1 -1
- package/dist/project-state.d.ts +33 -69
- package/dist/skill.generated.d.ts +2 -2
- package/dist/skill.generated.js +2 -2
- package/dist/v1/contract.d.ts +92 -151
- package/dist/v1/contract.js +3 -3
- package/dist/v1/schemas.d.ts +102 -88
- package/dist/v1/schemas.js +88 -97
- package/package.json +1 -1
- package/skills/drawcall-design/SKILL.md +17 -9
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @drawcall/design
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Typed Drawcall Design contracts, clients, and remote CLI.
|
|
4
4
|
|
|
5
5
|
```ts
|
|
6
6
|
import { v1 } from "@drawcall/design";
|
|
@@ -10,26 +10,35 @@ const projects = await design.project.list();
|
|
|
10
10
|
```
|
|
11
11
|
|
|
12
12
|
Projects and frames have immutable 14-character lowercase IDs. A project is a hosted filesystem at `https://<project-id>.design.drawcallcontent.com/`; every frame owns `/<frame-id>/` within it.
|
|
13
|
+
The current rendered image for any GLTS, image, or Market frame is available at
|
|
14
|
+
`https://<project-id>.design.drawcallcontent.com/<frame-id>.webp`.
|
|
13
15
|
|
|
14
16
|
```sh
|
|
15
|
-
npx
|
|
16
|
-
npx
|
|
17
|
+
npx drawcall auth login
|
|
18
|
+
npx drawcall design project create showroom
|
|
17
19
|
# `project list` prints: <project-id> <name>
|
|
18
20
|
|
|
19
|
-
npx
|
|
21
|
+
npx drawcall design -p r6z2n9k4x8m1qc frame create racecar \
|
|
20
22
|
--type glts --size 800x800
|
|
21
23
|
# `frame create` prints its frame ID and /<frame-id>/ path.
|
|
22
24
|
|
|
23
|
-
npx
|
|
25
|
+
npx drawcall design -p r6z2n9k4x8m1qc write /a4z8m2q7v9kcde/index.glts \
|
|
24
26
|
'export default class Racecar extends THREE.Group {}'
|
|
25
|
-
npx
|
|
26
|
-
npx
|
|
27
|
-
npx
|
|
27
|
+
npx drawcall design -p r6z2n9k4x8m1qc ls /
|
|
28
|
+
npx drawcall design -p r6z2n9k4x8m1qc read /a4z8m2q7v9kcde/index.glts
|
|
29
|
+
npx drawcall design -p r6z2n9k4x8m1qc frame screenshot a4z8m2q7v9kcde
|
|
28
30
|
|
|
29
|
-
npx
|
|
31
|
+
npx drawcall design -p r6z2n9k4x8m1qc frame create reference \
|
|
30
32
|
--type image --image ./reference.png
|
|
31
|
-
npx
|
|
33
|
+
npx drawcall design -p r6z2n9k4x8m1qc frame create oak-chair \
|
|
32
34
|
--type market --asset oak-chair@1.2.3
|
|
35
|
+
|
|
36
|
+
npx drawcall design -p r6z2n9k4x8m1qc frame generate-image product-shot \
|
|
37
|
+
--prompt "A clean product photograph" \
|
|
38
|
+
--reference https://r6z2n9k4x8m1qc.design.drawcallcontent.com/a4z8m2q7v9kcde.webp
|
|
39
|
+
npx drawcall design -p r6z2n9k4x8m1qc frame edit-image b4z8m2q7v9kcdf \
|
|
40
|
+
--prompt "Use warmer light" --replace \
|
|
41
|
+
--reference ./lighting.webp
|
|
33
42
|
```
|
|
34
43
|
|
|
35
44
|
Design credentials are managed by `@drawcall/auth` and shared with other Drawcall CLIs. Existing
|
|
@@ -49,13 +58,17 @@ The MCP tools can be mounted into a server owned by another package:
|
|
|
49
58
|
import { registerDesignTools, v1 } from "@drawcall/design";
|
|
50
59
|
import { McpServer } from "@modelcontextprotocol/server";
|
|
51
60
|
|
|
52
|
-
const
|
|
61
|
+
const options = { authToken: process.env.DRAWCALL_AUTH_TOKEN };
|
|
62
|
+
const client = v1.createClient(options);
|
|
53
63
|
const server = new McpServer({ name: "mcp.drawcall.ai", version: "1.0.0" });
|
|
54
64
|
|
|
55
65
|
registerDesignTools(server, client);
|
|
56
66
|
```
|
|
57
67
|
|
|
68
|
+
Image generation accepts public HTTP(S) reference URLs. Use a frame's canonical
|
|
69
|
+
WebP URL to reference a GLTS, image, or Market frame.
|
|
70
|
+
|
|
58
71
|
The host owns the server identity, authentication, and transport. The MCP SDK
|
|
59
72
|
is an optional peer dependency and is required only when mounting these tools.
|
|
60
73
|
|
|
61
|
-
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
|
|
74
|
+
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_design_instructions`) before creating or changing a GLTS asset.
|
package/dist/browser.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export * as v1 from "./v1/index.js";
|
|
2
|
+
export { frameImageUrl } from "./frame-image.js";
|
|
2
3
|
export { registerDesignTools, type DesignMcpOptions, type DesignMcpServer, type DesignMcpToolResult, } from "./mcp/index.js";
|
|
3
4
|
export { cliDesignSkill, mcpDesignSkill } from "./skill.generated.js";
|
|
4
5
|
export { frameCreationCapabilities, type FrameCreationCapability, type FrameCreationCapabilityId, type FrameCreationInput, } from "./v1/capabilities.js";
|
|
@@ -6,4 +7,4 @@ export { cameraPoseSchema, IMAGE_GENERATION_MODEL, IMAGE_GENERATION_PROVIDER, }
|
|
|
6
7
|
export { parseFrameSize } from "./target.js";
|
|
7
8
|
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";
|
|
8
9
|
export { cameraCaptureCommandSchema, cameraCaptureResultSchema, cameraMessageTypes, cameraSetCommandSchema, gltsExportCancelCommandSchema, gltsExportCancelledResultSchema, gltsExportCommandSchema, gltsExportFrameMessageSchema, gltsExportMessageTypes, gltsExportParentMessageSchema, gltsExportResultSchema, gltsRuntimeExportFormatSchema, immersiveCommandSchema, immersiveFrameMessageSchema, immersiveMessageTypes, immersiveModeSchema, inspectionCommandSchema, inspectionFrameMessageSchema, inspectionMessageTypes, posterMessageTypes, posterPagePath, posterPageUrl, posterRenderCommandSchema, posterRenderResultSchema, projectSyncUrl, sourceFileChangeSchema, sourceFileMessageTypes, sourceFileReloadResultSchema, sourceFilesChangedMessageSchema, type GltsExportCancelCommand, type GltsExportCancelledResult, type GltsExportCommand, type GltsExportFrameMessage, type GltsExportParentMessage, type GltsExportResult, type GltsRuntimeExportFormat, type CameraCaptureCommand, type CameraSetCommand, type CameraCaptureFailure, type CameraCaptureResult, type InspectionAppliedMessage, type InspectionCommand, type InspectionFrameMessage, type PosterRenderCommand, type PosterRenderResult, type ImmersiveCommand, type ImmersiveFrameMessage, type ImmersiveMode, type SourceFileChange, type SourceFileReloadResult, type SourceFilesChangedMessage, } from "./protocol.js";
|
|
9
|
-
export type { BinaryFile, CameraPose, CreateFrame, CreateProjectFromBrief, CreateGltsFrame, CreateImageFrame, CreateMarketFrame,
|
|
10
|
+
export type { BinaryFile, CameraPose, CreateFrame, CreateProjectFromBrief, CreateGltsFrame, CreateImageFrame, CreateMarketFrame, GenerateImage, GenerateImageUrl, DesignFile, FileList, FileMutation, FrameExport, Frame, GltsFrame, GltsFrameExport, ImageFrame, ImageFrameExport, ImageGenerationOperation, ImageGenerationProvenance, ImageGenerationResult, ImageInput, ImageInputProvenance, MarketFrame, MarketFrameExport, Project, ProjectDerivationStatus, Screenshot, TextFile, User, } from "./v1/schemas.js";
|
package/dist/browser.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export * as v1 from "./v1/index.js";
|
|
2
|
+
export { frameImageUrl } from "./frame-image.js";
|
|
2
3
|
export { registerDesignTools, } from "./mcp/index.js";
|
|
3
4
|
export { cliDesignSkill, mcpDesignSkill } from "./skill.generated.js";
|
|
4
5
|
export { frameCreationCapabilities, } from "./v1/capabilities.js";
|
package/dist/cli-client.js
CHANGED
|
@@ -3,11 +3,15 @@ import { loadConfig } from "./config.js";
|
|
|
3
3
|
import { createClient, DEFAULT_BASE_URL, } from "./v1/client.js";
|
|
4
4
|
export class NotLoggedInError extends Error {
|
|
5
5
|
constructor() {
|
|
6
|
-
super("Not logged in. Run `npx
|
|
6
|
+
super("Not logged in. Run `npx drawcall auth login` first.");
|
|
7
7
|
this.name = "NotLoggedInError";
|
|
8
8
|
}
|
|
9
9
|
}
|
|
10
10
|
export async function getCliClient(baseUrlOverride) {
|
|
11
|
+
const options = await clientOptions(baseUrlOverride);
|
|
12
|
+
return createClient(options);
|
|
13
|
+
}
|
|
14
|
+
async function clientOptions(baseUrlOverride) {
|
|
11
15
|
const authToken = await getAuthToken();
|
|
12
16
|
const config = await loadConfig();
|
|
13
17
|
if (!authToken)
|
|
@@ -16,5 +20,5 @@ export async function getCliClient(baseUrlOverride) {
|
|
|
16
20
|
process.env.DESIGN_API_URL ??
|
|
17
21
|
config?.baseUrl ??
|
|
18
22
|
DEFAULT_BASE_URL;
|
|
19
|
-
return
|
|
23
|
+
return { baseUrl, authToken };
|
|
20
24
|
}
|