@drawcall/design 0.2.12 → 0.2.13

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/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",
@@ -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.2.13",
4
4
  "description": "Typed API and remote CLI for Drawcall Design",
5
5
  "repository": {
6
6
  "type": "git",