Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions packages/sdk/generated/domain-map.json
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,43 @@
],
"array": true
}
},
{
"tool": "upload_design_md",
"class": "Project",
"method": "uploadDesignMd",
"args": {
"projectId": {
"from": "self"
},
"designMdBase64": {
"from": "param"
}
},
"returns": {
"projection": []
}
},
{
"tool": "create_design_system_from_design_md",
"class": "Project",
"method": "createDesignSystemFromDesignMd",
"args": {
"projectId": {
"from": "self"
},
"selectedScreenInstance": {
"from": "param"
},
"deviceType": {
"from": "param",
"optional": true
}
},
"returns": {
"class": "DesignSystem",
"projection": []
}
}
]
}
10 changes: 7 additions & 3 deletions packages/sdk/generated/src/designsystem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@
* AUTO-GENERATED by scripts/generate-sdk.ts
DO NOT EDIT — changes will be overwritten.

Source: tools-manifest.json (sha256:2f1a623ec115...)
domain-map.json (sha256:0ee09d686be6...)
Generated: 2026-06-01T03:47:10.743Z
Source: tools-manifest.json (sha256:d831990b27e9...)
domain-map.json (sha256:715639788724...)
Generated: 2026-06-01T04:11:36.685Z
*/
import { type StitchToolClient } from "../../src/client.js";
import { StitchError } from "../../src/spec/errors.js";
import {
ComponentTokens,
DesignTheme,
File,
ProjectMetadata,
Expand All @@ -29,7 +30,10 @@ import {
PrototypeLinks,
PrototypeState,
PrototypeV2Spec,
Question,
QuestionsAsked,
ScreenMetadata,
SessionEvent,
SessionOutputComponent,
VariantOptions,
SelectedScreenInstance,
Expand Down
6 changes: 3 additions & 3 deletions packages/sdk/generated/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
* AUTO-GENERATED by scripts/generate-sdk.ts
DO NOT EDIT — changes will be overwritten.

Source: tools-manifest.json (sha256:2f1a623ec115...)
domain-map.json (sha256:0ee09d686be6...)
Generated: 2026-06-01T03:47:10.743Z
Source: tools-manifest.json (sha256:d831990b27e9...)
domain-map.json (sha256:715639788724...)
Generated: 2026-06-01T04:11:36.685Z
*/
export { Stitch } from "./stitch.js";
export { Project } from "./project.js";
Expand Down
57 changes: 54 additions & 3 deletions packages/sdk/generated/src/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@
* AUTO-GENERATED by scripts/generate-sdk.ts
DO NOT EDIT — changes will be overwritten.

Source: tools-manifest.json (sha256:2f1a623ec115...)
domain-map.json (sha256:0ee09d686be6...)
Generated: 2026-06-01T03:47:10.743Z
Source: tools-manifest.json (sha256:d831990b27e9...)
domain-map.json (sha256:715639788724...)
Generated: 2026-06-01T04:11:36.685Z
*/
import { type StitchToolClient } from "../../src/client.js";
import { StitchError } from "../../src/spec/errors.js";
import {
ComponentTokens,
DesignTheme,
File,
ProjectMetadata,
Expand All @@ -29,7 +30,10 @@ import {
PrototypeLinks,
PrototypeState,
PrototypeV2Spec,
Question,
QuestionsAsked,
ScreenMetadata,
SessionEvent,
SessionOutputComponent,
VariantOptions,
SelectedScreenInstance,
Expand All @@ -40,6 +44,8 @@ import {
GetScreenResponse,
CreateDesignSystemResponse,
ListDesignSystemsResponse,
UploadDesignMdResponse,
CreateDesignSystemFromDesignMdResponse,
} from "./responses.generated.js";
import { Screen } from "./screen.js";
import { DesignSystem } from "./designsystem.js";
Expand Down Expand Up @@ -187,6 +193,51 @@ export class Project {
}
}

/**
* Uploads DESIGN.md to a Stitch project. Use this tool when the user wants to create a design system from a DESIGN.md file.
* Tool: upload_design_md
*/
async uploadDesignMd(designMdBase64: string): Promise<any> {
try {
const raw = await this.client.callTool<UploadDesignMdResponse>(
"upload_design_md",
{ projectId: this.projectId, designMdBase64 },
);
return raw || "";
} catch (error) {
throw StitchError.fromUnknown(error);
}
}

/**
* Creates a design system for a project, with user uploaded DESIGN.md file, and displays the design system in the UI.
* Tool: create_design_system_from_design_md
*/
async createDesignSystemFromDesignMd(
selectedScreenInstance: SelectedScreenInstance,
deviceType?:
| "DEVICE_TYPE_UNSPECIFIED"
| "MOBILE"
| "DESKTOP"
| "TABLET"
| "AGNOSTIC",
): Promise<DesignSystem> {
try {
const raw =
await this.client.callTool<CreateDesignSystemFromDesignMdResponse>(
"create_design_system_from_design_md",
{ projectId: this.projectId, selectedScreenInstance, deviceType },
);
return this.client.entities.resolve(
DesignSystem,
["projectId", "assetId"],
{ ...raw, projectId: this.projectId },
);
} catch (error) {
throw StitchError.fromUnknown(error);
}
}

/** Create a DesignSystem handle from an existing ID without an API call. */
designSystem(id: string): DesignSystem {
return this.client.entities.resolve(
Expand Down
40 changes: 37 additions & 3 deletions packages/sdk/generated/src/responses.generated.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {
ComponentTokens,
DesignTheme,
File,
ProjectMetadata,
Expand All @@ -19,7 +20,10 @@ import {
PrototypeLinks,
PrototypeState,
PrototypeV2Spec,
Question,
QuestionsAsked,
ScreenMetadata,
SessionEvent,
SessionOutputComponent,
VariantOptions,
SelectedScreenInstance,
Expand All @@ -28,9 +32,9 @@ import {
* AUTO-GENERATED by scripts/generate-sdk.ts
DO NOT EDIT — changes will be overwritten.

Source: tools-manifest.json (sha256:2f1a623ec115...)
domain-map.json (sha256:0ee09d686be6...)
Generated: 2026-06-01T03:47:10.743Z
Source: tools-manifest.json (sha256:d831990b27e9...)
domain-map.json (sha256:715639788724...)
Generated: 2026-06-01T04:11:36.685Z
*/

/** Response message for create_project. */
Expand Down Expand Up @@ -140,6 +144,31 @@ export interface GenerateVariantsResponse {
sessionId?: string;
}

/** Response message for upload_design_md. */
export interface UploadDesignMdResponse {
groupId?: string;
groupName?: string;
height?: number;
hidden?: boolean;
id?: string;
isFavourite?: boolean;
isResized?: boolean;
label?: string;
sourceAsset?: string;
sourceScreen?: string;
textContent?: string;
type?:
| "SCREEN_INSTANCE_TYPE_UNSPECIFIED"
| "SCREEN_INSTANCE"
| "DESIGN_SYSTEM_INSTANCE"
| "GROUP_INSTANCE"
| "TEXT_INSTANCE";
variantScreenInstance?: ScreenInstance;
width?: number;
x?: number;
y?: number;
}

/** Response message for create_design_system. */
export interface CreateDesignSystemResponse {
copiedFrom?: string;
Expand All @@ -148,6 +177,11 @@ export interface CreateDesignSystemResponse {
version?: string;
}

/** Response message for create_design_system_from_design_md. */
export interface CreateDesignSystemFromDesignMdResponse {
assetId?: string;
}

/** Response message for update_design_system. */
export interface UpdateDesignSystemResponse {
copiedFrom?: string;
Expand Down
10 changes: 7 additions & 3 deletions packages/sdk/generated/src/screen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@
* AUTO-GENERATED by scripts/generate-sdk.ts
DO NOT EDIT — changes will be overwritten.

Source: tools-manifest.json (sha256:2f1a623ec115...)
domain-map.json (sha256:0ee09d686be6...)
Generated: 2026-06-01T03:47:10.743Z
Source: tools-manifest.json (sha256:d831990b27e9...)
domain-map.json (sha256:715639788724...)
Generated: 2026-06-01T04:11:36.685Z
*/
import { type StitchToolClient } from "../../src/client.js";
import { StitchError } from "../../src/spec/errors.js";
import {
ComponentTokens,
DesignTheme,
File,
ProjectMetadata,
Expand All @@ -29,7 +30,10 @@ import {
PrototypeLinks,
PrototypeState,
PrototypeV2Spec,
Question,
QuestionsAsked,
ScreenMetadata,
SessionEvent,
SessionOutputComponent,
VariantOptions,
SelectedScreenInstance,
Expand Down
10 changes: 7 additions & 3 deletions packages/sdk/generated/src/stitch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@
* AUTO-GENERATED by scripts/generate-sdk.ts
DO NOT EDIT — changes will be overwritten.

Source: tools-manifest.json (sha256:2f1a623ec115...)
domain-map.json (sha256:0ee09d686be6...)
Generated: 2026-06-01T03:47:10.743Z
Source: tools-manifest.json (sha256:d831990b27e9...)
domain-map.json (sha256:715639788724...)
Generated: 2026-06-01T04:11:36.685Z
*/
import { type StitchToolClient } from "../../src/client.js";
import { StitchError } from "../../src/spec/errors.js";
import {
ComponentTokens,
DesignTheme,
File,
ProjectMetadata,
Expand All @@ -29,7 +30,10 @@ import {
PrototypeLinks,
PrototypeState,
PrototypeV2Spec,
Question,
QuestionsAsked,
ScreenMetadata,
SessionEvent,
SessionOutputComponent,
VariantOptions,
SelectedScreenInstance,
Expand Down
Loading
Loading