@drawcall/market 0.9.4 → 0.10.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/dist/mcp/agent.d.ts.map +1 -1
- package/dist/mcp/agent.js +2 -13
- package/dist/mcp/agent.js.map +1 -1
- package/dist/mcp/asset.d.ts.map +1 -1
- package/dist/mcp/asset.js +73 -29
- package/dist/mcp/asset.js.map +1 -1
- package/dist/mcp/generation.d.ts.map +1 -1
- package/dist/mcp/generation.js +31 -3
- package/dist/mcp/generation.js.map +1 -1
- package/dist/skill.generated.d.ts +2 -2
- package/dist/skill.generated.d.ts.map +1 -1
- package/dist/skill.generated.js +2 -2
- package/dist/skill.generated.js.map +1 -1
- package/package.json +1 -1
- package/skills/market/SKILL.md +1 -1
- package/src/mcp/agent.ts +3 -19
- package/src/mcp/asset.ts +86 -31
- package/src/mcp/generation.ts +32 -3
- package/src/skill.generated.ts +2 -2
package/dist/mcp/agent.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../src/mcp/agent.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAErD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAEjD,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,eAAe,EAAE,MAAM,EAAE,cAAc,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../src/mcp/agent.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAErD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAEjD,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,eAAe,EAAE,MAAM,EAAE,cAAc,GAAG,IAAI,CAiBxF"}
|
package/dist/mcp/agent.js
CHANGED
|
@@ -1,20 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { agentStatusSchema } from '../schemas.js';
|
|
2
2
|
import { result } from './result.js';
|
|
3
3
|
export function registerAgentTools(server, client) {
|
|
4
|
-
server.registerTool('start_market_agent_run', {
|
|
5
|
-
title: 'Start Market agent run',
|
|
6
|
-
description: 'Start a Market agent run that plans, finds, judges, and generates a coherent set of assets for a goal.',
|
|
7
|
-
inputSchema: agentStartSchema,
|
|
8
|
-
annotations: {
|
|
9
|
-
readOnlyHint: false,
|
|
10
|
-
destructiveHint: false,
|
|
11
|
-
openWorldHint: true,
|
|
12
|
-
idempotentHint: false,
|
|
13
|
-
},
|
|
14
|
-
}, async (input) => result({ run: await client.asset.agent.start(input) }));
|
|
15
4
|
server.registerTool('get_market_agent_run', {
|
|
16
5
|
title: 'Get Market agent run',
|
|
17
|
-
description: 'Get the current state and result of
|
|
6
|
+
description: 'Get the current state and result of an existing Market agent run. MCP cannot start agent runs until the Market API supports explicit output visibility.',
|
|
18
7
|
inputSchema: agentStatusSchema,
|
|
19
8
|
annotations: {
|
|
20
9
|
readOnlyHint: true,
|
package/dist/mcp/agent.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent.js","sourceRoot":"","sources":["../../src/mcp/agent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"agent.js","sourceRoot":"","sources":["../../src/mcp/agent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAA;AAEjD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAGpC,MAAM,UAAU,kBAAkB,CAAC,MAAuB,EAAE,MAAsB;IAChF,MAAM,CAAC,YAAY,CACjB,sBAAsB,EACtB;QACE,KAAK,EAAE,sBAAsB;QAC7B,WAAW,EACT,yJAAyJ;QAC3J,WAAW,EAAE,iBAAiB;QAC9B,WAAW,EAAE;YACX,YAAY,EAAE,IAAI;YAClB,eAAe,EAAE,KAAK;YACtB,aAAa,EAAE,IAAI;YACnB,cAAc,EAAE,IAAI;SACrB;KACF,EACD,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CACzE,CAAA;AACH,CAAC"}
|
package/dist/mcp/asset.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"asset.d.ts","sourceRoot":"","sources":["../../src/mcp/asset.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;
|
|
1
|
+
{"version":3,"file":"asset.d.ts","sourceRoot":"","sources":["../../src/mcp/asset.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAGrD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AA0BjD,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,eAAe,EACvB,MAAM,EAAE,cAAc,EACtB,OAAO,EAAE,OAAO,UAAU,CAAC,KAAK,GAC/B,IAAI,CA4HN"}
|
package/dist/mcp/asset.js
CHANGED
|
@@ -2,20 +2,23 @@ import { z } from 'zod';
|
|
|
2
2
|
import { resolveAsset } from '../refs.js';
|
|
3
3
|
import { assetTypeSchema } from '../schemas.js';
|
|
4
4
|
import { base64, result } from './result.js';
|
|
5
|
+
const includeUnapprovedSchema = z
|
|
6
|
+
.boolean()
|
|
7
|
+
.default(false)
|
|
8
|
+
.describe('Include unapproved assets only when the user explicitly asks to inspect unmoderated content and accepts that it has not passed Market review.');
|
|
5
9
|
const searchMarketSchema = z
|
|
6
10
|
.object({
|
|
7
11
|
query: z.string().min(1).max(200),
|
|
8
12
|
type: assetTypeSchema,
|
|
9
13
|
limit: z.coerce.number().int().min(1).max(5).default(3),
|
|
10
|
-
includeUnapproved:
|
|
14
|
+
includeUnapproved: includeUnapprovedSchema,
|
|
11
15
|
})
|
|
12
16
|
.strict();
|
|
13
17
|
const assetRefSchema = z.string().min(1).describe('Asset name or exact name@version');
|
|
14
18
|
const assetInput = z
|
|
15
19
|
.object({
|
|
16
20
|
asset: assetRefSchema,
|
|
17
|
-
includeUnapproved:
|
|
18
|
-
key: z.string().min(1).max(128).optional(),
|
|
21
|
+
includeUnapproved: includeUnapprovedSchema,
|
|
19
22
|
})
|
|
20
23
|
.strict();
|
|
21
24
|
export function registerAssetTools(server, client, fetcher) {
|
|
@@ -51,22 +54,26 @@ export function registerAssetTools(server, client, fetcher) {
|
|
|
51
54
|
throw new Error('Market search unexpectedly returned an exact asset result');
|
|
52
55
|
}
|
|
53
56
|
return result({
|
|
54
|
-
assets: response.items.map((asset) =>
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
57
|
+
assets: response.items.map((asset) => {
|
|
58
|
+
const previewUrl = safePublicUrl(asset.previewUrl, asset);
|
|
59
|
+
return {
|
|
60
|
+
asset: `${asset.name}@${asset.latestVersion}`,
|
|
61
|
+
name: asset.name,
|
|
62
|
+
version: asset.latestVersion,
|
|
63
|
+
type: asset.type,
|
|
64
|
+
description: asset.description,
|
|
65
|
+
approved: asset.approved,
|
|
66
|
+
access: asset.access,
|
|
67
|
+
hasPreview: Boolean(asset.previewUrl),
|
|
68
|
+
...(previewUrl ? { previewUrl } : {}),
|
|
69
|
+
};
|
|
70
|
+
}),
|
|
64
71
|
total: response.total,
|
|
65
72
|
});
|
|
66
73
|
});
|
|
67
74
|
server.registerTool('get_market_asset', {
|
|
68
75
|
title: 'Get Market asset',
|
|
69
|
-
description: 'Get one exact Drawcall Market asset manifest with its version history, dependencies,
|
|
76
|
+
description: 'Get one exact Drawcall Market asset manifest with its version history, dependencies, and file metadata. Capability-bearing URLs and owner identifiers are never returned.',
|
|
70
77
|
inputSchema: assetInput,
|
|
71
78
|
annotations: {
|
|
72
79
|
readOnlyHint: true,
|
|
@@ -74,15 +81,12 @@ export function registerAssetTools(server, client, fetcher) {
|
|
|
74
81
|
openWorldHint: true,
|
|
75
82
|
idempotentHint: true,
|
|
76
83
|
},
|
|
77
|
-
}, async ({ asset, includeUnapproved
|
|
78
|
-
asset: await resolveAsset(client.asset, asset, {
|
|
79
|
-
includeUnapproved,
|
|
80
|
-
...(key ? { key } : {}),
|
|
81
|
-
}),
|
|
84
|
+
}, async ({ asset, includeUnapproved }) => result({
|
|
85
|
+
asset: mcpAsset(await resolveAsset(client.asset, asset, { includeUnapproved })),
|
|
82
86
|
}));
|
|
83
87
|
server.registerTool('get_market_asset_preview', {
|
|
84
88
|
title: 'Get Market asset preview',
|
|
85
|
-
description: 'Return the preview image for one exact Drawcall Market asset.',
|
|
89
|
+
description: 'Return the preview image for one exact Drawcall Market asset. The server fetches restricted previews without returning their capability-bearing URL.',
|
|
86
90
|
inputSchema: assetInput,
|
|
87
91
|
annotations: {
|
|
88
92
|
readOnlyHint: true,
|
|
@@ -90,20 +94,17 @@ export function registerAssetTools(server, client, fetcher) {
|
|
|
90
94
|
openWorldHint: true,
|
|
91
95
|
idempotentHint: true,
|
|
92
96
|
},
|
|
93
|
-
}, async ({ asset: ref, includeUnapproved
|
|
94
|
-
const asset = await resolveAsset(client.asset, ref, {
|
|
95
|
-
includeUnapproved,
|
|
96
|
-
...(key ? { key } : {}),
|
|
97
|
-
});
|
|
97
|
+
}, async ({ asset: ref, includeUnapproved }) => {
|
|
98
|
+
const asset = await resolveAsset(client.asset, ref, { includeUnapproved });
|
|
98
99
|
if (!asset.previewUrl)
|
|
99
100
|
throw new Error(`Asset "${ref}" has no preview image`);
|
|
100
|
-
const response = await fetcher
|
|
101
|
+
const response = await fetchPreview(fetcher, asset.previewUrl, ref);
|
|
101
102
|
if (!response.ok) {
|
|
102
|
-
throw new Error(`Could not read preview ${
|
|
103
|
+
throw new Error(`Could not read preview for "${ref}": ${response.status}`);
|
|
103
104
|
}
|
|
104
105
|
const mimeType = response.headers.get('content-type')?.split(';', 1)[0];
|
|
105
106
|
if (!mimeType?.startsWith('image/')) {
|
|
106
|
-
throw new Error(`Preview ${
|
|
107
|
+
throw new Error(`Preview for "${ref}" returned ${mimeType ?? 'no media type'}`);
|
|
107
108
|
}
|
|
108
109
|
return {
|
|
109
110
|
content: [
|
|
@@ -115,10 +116,53 @@ export function registerAssetTools(server, client, fetcher) {
|
|
|
115
116
|
],
|
|
116
117
|
structuredContent: {
|
|
117
118
|
asset: `${asset.name}@${asset.version}`,
|
|
118
|
-
url: asset.previewUrl,
|
|
119
119
|
mediaType: mimeType,
|
|
120
120
|
},
|
|
121
121
|
};
|
|
122
122
|
});
|
|
123
123
|
}
|
|
124
|
+
function mcpAsset(asset) {
|
|
125
|
+
const publicAsset = asset.access === 'public' && asset.approved;
|
|
126
|
+
const previewUrl = safePublicUrl(asset.previewUrl, asset);
|
|
127
|
+
const zipUrl = safePublicUrl(asset.zipUrl, asset);
|
|
128
|
+
return {
|
|
129
|
+
name: asset.name,
|
|
130
|
+
type: asset.type,
|
|
131
|
+
version: asset.version,
|
|
132
|
+
description: asset.description,
|
|
133
|
+
approved: asset.approved,
|
|
134
|
+
access: asset.access,
|
|
135
|
+
npmDependencies: asset.npmDependencies,
|
|
136
|
+
assetDependencies: asset.assetDependencies,
|
|
137
|
+
skillDependencies: asset.skillDependencies,
|
|
138
|
+
files: asset.files.map(({ url, ...file }) => {
|
|
139
|
+
const publicUrl = safePublicUrl(url, asset);
|
|
140
|
+
return publicUrl ? { ...file, url: publicUrl } : file;
|
|
141
|
+
}),
|
|
142
|
+
hasPreview: Boolean(asset.previewUrl),
|
|
143
|
+
versions: asset.versions,
|
|
144
|
+
...(previewUrl ? { previewUrl } : {}),
|
|
145
|
+
...(zipUrl ? { zipUrl } : {}),
|
|
146
|
+
...(!publicAsset ? { restrictedUrlsOmitted: true } : {}),
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
async function fetchPreview(fetcher, url, ref) {
|
|
150
|
+
try {
|
|
151
|
+
return await fetcher(url);
|
|
152
|
+
}
|
|
153
|
+
catch {
|
|
154
|
+
throw new Error(`Could not read preview for "${ref}"`);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
function safePublicUrl(url, asset) {
|
|
158
|
+
if (!url || asset.access !== 'public' || !asset.approved)
|
|
159
|
+
return undefined;
|
|
160
|
+
try {
|
|
161
|
+
const parsed = new URL(url);
|
|
162
|
+
return parsed.searchParams.has('key') ? undefined : parsed.href;
|
|
163
|
+
}
|
|
164
|
+
catch {
|
|
165
|
+
return undefined;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
124
168
|
//# sourceMappingURL=asset.js.map
|
package/dist/mcp/asset.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"asset.js","sourceRoot":"","sources":["../../src/mcp/asset.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"asset.js","sourceRoot":"","sources":["../../src/mcp/asset.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAG/C,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAG5C,MAAM,uBAAuB,GAAG,CAAC;KAC9B,OAAO,EAAE;KACT,OAAO,CAAC,KAAK,CAAC;KACd,QAAQ,CACP,+IAA+I,CAChJ,CAAA;AAEH,MAAM,kBAAkB,GAAG,CAAC;KACzB,MAAM,CAAC;IACN,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C,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAA;IACjE,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,SAAS,CAAA;IAClB,CAAC;AACH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generation.d.ts","sourceRoot":"","sources":["../../src/mcp/generation.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"generation.d.ts","sourceRoot":"","sources":["../../src/mcp/generation.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAErD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AA0BjD,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,eAAe,EAAE,MAAM,EAAE,cAAc,GAAG,IAAI,CAuC7F"}
|
package/dist/mcp/generation.js
CHANGED
|
@@ -1,10 +1,32 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
1
2
|
import { assetTypeSchema, generateAssetSchema, generateStatusInputSchema } from '../schemas.js';
|
|
2
3
|
import { result } from './result.js';
|
|
3
|
-
const
|
|
4
|
+
const generationBaseSchema = generateAssetSchema
|
|
5
|
+
.omit({ access: true, type: true })
|
|
6
|
+
.extend({ type: assetTypeSchema });
|
|
7
|
+
const generateMarketAssetSchema = z.discriminatedUnion('access', [
|
|
8
|
+
generationBaseSchema
|
|
9
|
+
.extend({
|
|
10
|
+
access: z
|
|
11
|
+
.literal('public')
|
|
12
|
+
.describe('Publish the generated asset to the public Market after its approval flow.'),
|
|
13
|
+
confirmPublicPublication: z
|
|
14
|
+
.literal(true)
|
|
15
|
+
.describe('Must be true only after the user explicitly approves public publication.'),
|
|
16
|
+
})
|
|
17
|
+
.strict(),
|
|
18
|
+
generationBaseSchema
|
|
19
|
+
.extend({
|
|
20
|
+
access: z
|
|
21
|
+
.literal('private')
|
|
22
|
+
.describe('Keep the generated asset private to the authenticated owner.'),
|
|
23
|
+
})
|
|
24
|
+
.strict(),
|
|
25
|
+
]);
|
|
4
26
|
export function registerGenerationTools(server, client) {
|
|
5
27
|
server.registerTool('generate_market_asset', {
|
|
6
28
|
title: 'Generate Market asset',
|
|
7
|
-
description: '
|
|
29
|
+
description: 'Create one external Drawcall Market asset. Visibility is required; public publication is allowed only after explicit user consent. A slow provider returns a jobId to pass to get_market_asset_generation.',
|
|
8
30
|
inputSchema: generateMarketAssetSchema,
|
|
9
31
|
annotations: {
|
|
10
32
|
readOnlyHint: false,
|
|
@@ -12,7 +34,13 @@ export function registerGenerationTools(server, client) {
|
|
|
12
34
|
openWorldHint: true,
|
|
13
35
|
idempotentHint: false,
|
|
14
36
|
},
|
|
15
|
-
}, async (input) =>
|
|
37
|
+
}, async (input) => {
|
|
38
|
+
if (input.access === 'public') {
|
|
39
|
+
const { confirmPublicPublication: _confirmed, ...generation } = input;
|
|
40
|
+
return result({ generation: await client.asset.generate(generation) });
|
|
41
|
+
}
|
|
42
|
+
return result({ generation: await client.asset.generate(input) });
|
|
43
|
+
});
|
|
16
44
|
server.registerTool('get_market_asset_generation', {
|
|
17
45
|
title: 'Get Market asset generation',
|
|
18
46
|
description: 'Get the current state of a Market asset generation job.',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generation.js","sourceRoot":"","sources":["../../src/mcp/generation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,yBAAyB,EAAE,MAAM,eAAe,CAAA;AAE/F,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAGpC,MAAM,
|
|
1
|
+
{"version":3,"file":"generation.js","sourceRoot":"","sources":["../../src/mcp/generation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,yBAAyB,EAAE,MAAM,eAAe,CAAA;AAE/F,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;A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QACxE,CAAC;QACD,OAAO,MAAM,CAAC,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC,CAAA;IACnE,CAAC,CACF,CAAA;IAED,MAAM,CAAC,YAAY,CACjB,6BAA6B,EAC7B;QACE,KAAK,EAAE,6BAA6B;QACpC,WAAW,EAAE,yDAAyD;QACtE,WAAW,EAAE,yBAAyB,CAAC,MAAM,EAAE;QAC/C,WAAW,EAAE;YACX,YAAY,EAAE,IAAI;YAClB,eAAe,EAAE,KAAK;YACtB,aAAa,EAAE,IAAI;YACnB,cAAc,EAAE,IAAI;SACrB;KACF,EACD,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,MAAM,CAAC,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,CAAC,CAClF,CAAA;AACH,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare const cliMarketSkill = "---\nname: market\ndescription: Find, inspect, generate, and use Drawcall Market assets from a coding agent.\n---\n\n# Drawcall Market\n\n## CLI transport\n\nRun commands as `npx drawcall market <command>`; do not assume a global `market` binary or switch to MCP after a CLI failure. Use `npx drawcall market skill` when these instructions are not already available.\n\nDiscover the current vocabulary and choose an asset:\n\n```sh\nnpx drawcall market types\nnpx drawcall market search \"<query>\" --type <type> --limit 3\nnpx drawcall market preview <name@version> --out /tmp/<name>.png\nnpx drawcall market urls <name@version>\n```\n\n`urls` prints one base URL, file subpaths, and a preview URL without changing the project. Install exact refs together when the project needs local files:\n\n```sh\nnpx drawcall market install <name@range...> --cwd \"$PWD\"\n```\n\nInstall records `assetDependencies` in the nearest `package.json`. `list --cwd \"$PWD\"` reads that inventory without network access. Run `sync --cwd \"$PWD\"` after moving installed files so aliases continue to resolve. Use `--force` only with permission to overwrite changed files.\n\nGenerate and install one asset with:\n\n```sh\nnpx drawcall market generate --type <type> \"<description>\"\n```\n\nIf it returns a continuation, run the printed `generate install <jobId>` command. The Market agent can source a coherent set of assets from a broader goal:\n\n```sh\nnpx drawcall market agent \"<goal>\"\n```\n\nPublish only when asked. `pack <source> --out <zip>` creates a Market archive and `upload <name> <source> \"<description>\" --type <type>` publishes it. Use command help for dependency and visibility options. If authentication is required, ask before running `npx drawcall auth login`.\n\n## Choose assets\n\nSearch one concrete need at a time. Use one result for an exact lookup and up to three when the user should choose. If nothing fits, try one broader noun phrase before generating a replacement.\n\nThe exact `name@version` returned by Market is authoritative. Copy it verbatim. Generated identifiers can legitimately end mid-word at the catalog limit; never expand, normalize, or reconstruct one from its description.\n\nPreview a finalist when appearance determines whether it fits. File, preview, and zip URLs returned by Market are opaque. Capability-bearing private URLs are secrets; never derive a URL from an asset name or preview metadata.\n\n## Generate\n\nGeneration creates one Market asset from a description. The description is provider input, not the eventual asset name. A fast provider may return the asset immediately; a slow provider returns a continuation ID for the matching status operation. Resume that job instead of starting the same generation again.\n\nReference images must be direct fetchable image URLs or image data, never webpage URLs. The current asset-type metadata says which types support references and how many they accept.\n\nA generated humanoid model is one expressive, animation-ready biped: one head, two arms, two legs, open empty hands, and no companions or scene. Describe identity, theme, silhouette, clothing, colors, and materials. Express topology outside the shared skeleton as costume or body-surface design so the result remains riggable.\n\
|
|
2
|
-
export declare const mcpMarketSkill = "---\nname: market\ndescription: Find, inspect, generate, and use Drawcall Market assets from a coding agent.\n---\n\n# Drawcall Market\n\n## MCP transport\n\nMCP tools are the only Market transport in this environment. Do not invoke the CLI, make direct API requests, or switch transports after a failed call.\n\nUse the same conceptual workflow as the Market CLI:\n\n```text\nlist_market_asset_types\nsearch_market\nget_market_asset\nget_market_asset_preview\n```\n\n`search_market` requires an asset type and returns exact `name@version` references. Inspect the exact manifest with `get_market_asset`; request its preview only when visual evidence matters. Remote MCP tools return immutable references and
|
|
1
|
+
export declare const cliMarketSkill = "---\nname: market\ndescription: Find, inspect, generate, and use Drawcall Market assets from a coding agent.\n---\n\n# Drawcall Market\n\n## CLI transport\n\nRun commands as `npx drawcall market <command>`; do not assume a global `market` binary or switch to MCP after a CLI failure. Use `npx drawcall market skill` when these instructions are not already available.\n\nDiscover the current vocabulary and choose an asset:\n\n```sh\nnpx drawcall market types\nnpx drawcall market search \"<query>\" --type <type> --limit 3\nnpx drawcall market preview <name@version> --out /tmp/<name>.png\nnpx drawcall market urls <name@version>\n```\n\n`urls` prints one base URL, file subpaths, and a preview URL without changing the project. Install exact refs together when the project needs local files:\n\n```sh\nnpx drawcall market install <name@range...> --cwd \"$PWD\"\n```\n\nInstall records `assetDependencies` in the nearest `package.json`. `list --cwd \"$PWD\"` reads that inventory without network access. Run `sync --cwd \"$PWD\"` after moving installed files so aliases continue to resolve. Use `--force` only with permission to overwrite changed files.\n\nGenerate and install one asset with:\n\n```sh\nnpx drawcall market generate --type <type> \"<description>\"\n```\n\nIf it returns a continuation, run the printed `generate install <jobId>` command. The Market agent can source a coherent set of assets from a broader goal:\n\n```sh\nnpx drawcall market agent \"<goal>\"\n```\n\nPublish only when asked. `pack <source> --out <zip>` creates a Market archive and `upload <name> <source> \"<description>\" --type <type>` publishes it. Use command help for dependency and visibility options. If authentication is required, ask before running `npx drawcall auth login`.\n\n## Choose assets\n\nSearch one concrete need at a time. Use one result for an exact lookup and up to three when the user should choose. If nothing fits, try one broader noun phrase before generating a replacement.\n\nThe exact `name@version` returned by Market is authoritative. Copy it verbatim. Generated identifiers can legitimately end mid-word at the catalog limit; never expand, normalize, or reconstruct one from its description.\n\nPreview a finalist when appearance determines whether it fits. File, preview, and zip URLs returned by Market are opaque. Capability-bearing private URLs are secrets; never derive a URL from an asset name or preview metadata.\n\n## Generate\n\nGeneration creates one Market asset from a description. The description is provider input, not the eventual asset name. A fast provider may return the asset immediately; a slow provider returns a continuation ID for the matching status operation. Resume that job instead of starting the same generation again.\n\nReference images must be direct fetchable image URLs or image data, never webpage URLs. The current asset-type metadata says which types support references and how many they accept.\n\nA generated humanoid model is one expressive, animation-ready biped: one head, two arms, two legs, open empty hands, and no companions or scene. Describe identity, theme, silhouette, clothing, colors, and materials. Express topology outside the shared skeleton as costume or body-surface design so the result remains riggable.\n\nTreat visibility as a publication decision. Choose public only when the user explicitly approves publication; choose private when the asset should remain owner-only. Private generation requires the account's `market:private` entitlement.\n\n## Failures\n\nAn error means the operation did not happen. Correct invalid inputs, refresh an exact reference after a not-found response, and retry one upstream failure once. Never repeat an unchanged failed generation. Use unapproved assets only when the user explicitly requests and accepts them.\n";
|
|
2
|
+
export declare const mcpMarketSkill = "---\nname: market\ndescription: Find, inspect, generate, and use Drawcall Market assets from a coding agent.\n---\n\n# Drawcall Market\n\n## MCP transport\n\nMCP tools are the only Market transport in this environment. Do not invoke the CLI, make direct API requests, or switch transports after a failed call.\n\nUse the same conceptual workflow as the Market CLI:\n\n```text\nlist_market_asset_types\nsearch_market\nget_market_asset\nget_market_asset_preview\n```\n\n`search_market` requires an asset type and returns exact `name@version` references. Inspect the exact manifest with `get_market_asset`; request its preview only when visual evidence matters. Remote MCP tools return immutable references and public URLs, but keep restricted capability-bearing URLs server-side. They do not install files into the caller's local project.\n\nWhen generation is available, call `generate_market_asset` only after the user chooses public or private visibility. Public generation also requires the user's explicit consent to publish. If it returns a `jobId`, continue with `get_market_asset_generation`. Do not start the same generation again.\n\nMCP cannot start Market agent runs until the Market API supports explicit output visibility. When status access is available, `get_market_agent_run` may resume an existing run by ID.\n\nUse an exact Market reference with `create_design_frame` when the selected asset belongs in Drawcall Design.\n\n## Choose assets\n\nSearch one concrete need at a time. Use one result for an exact lookup and up to three when the user should choose. If nothing fits, try one broader noun phrase before generating a replacement.\n\nThe exact `name@version` returned by Market is authoritative. Copy it verbatim. Generated identifiers can legitimately end mid-word at the catalog limit; never expand, normalize, or reconstruct one from its description.\n\nPreview a finalist when appearance determines whether it fits. File, preview, and zip URLs returned by Market are opaque. Capability-bearing private URLs are secrets; never derive a URL from an asset name or preview metadata.\n\n## Generate\n\nGeneration creates one Market asset from a description. The description is provider input, not the eventual asset name. A fast provider may return the asset immediately; a slow provider returns a continuation ID for the matching status operation. Resume that job instead of starting the same generation again.\n\nReference images must be direct fetchable image URLs or image data, never webpage URLs. The current asset-type metadata says which types support references and how many they accept.\n\nA generated humanoid model is one expressive, animation-ready biped: one head, two arms, two legs, open empty hands, and no companions or scene. Describe identity, theme, silhouette, clothing, colors, and materials. Express topology outside the shared skeleton as costume or body-surface design so the result remains riggable.\n\nTreat visibility as a publication decision. Choose public only when the user explicitly approves publication; choose private when the asset should remain owner-only. Private generation requires the account's `market:private` entitlement.\n\n## Failures\n\nAn error means the operation did not happen. Correct invalid inputs, refresh an exact reference after a not-found response, and retry one upstream failure once. Never repeat an unchanged failed generation. Use unapproved assets only when the user explicitly requests and accepts them.\n";
|
|
3
3
|
//# sourceMappingURL=skill.generated.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skill.generated.d.ts","sourceRoot":"","sources":["../src/skill.generated.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,cAAc,
|
|
1
|
+
{"version":3,"file":"skill.generated.d.ts","sourceRoot":"","sources":["../src/skill.generated.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,cAAc,wvHAC+sH,CAAA;AAC1uH,eAAO,MAAM,cAAc,26GAC+4G,CAAA"}
|
package/dist/skill.generated.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// Generated from skill/SKILL.template.md.
|
|
2
|
-
export const cliMarketSkill = '---\nname: market\ndescription: Find, inspect, generate, and use Drawcall Market assets from a coding agent.\n---\n\n# Drawcall Market\n\n## CLI transport\n\nRun commands as `npx drawcall market <command>`; do not assume a global `market` binary or switch to MCP after a CLI failure. Use `npx drawcall market skill` when these instructions are not already available.\n\nDiscover the current vocabulary and choose an asset:\n\n```sh\nnpx drawcall market types\nnpx drawcall market search "<query>" --type <type> --limit 3\nnpx drawcall market preview <name@version> --out /tmp/<name>.png\nnpx drawcall market urls <name@version>\n```\n\n`urls` prints one base URL, file subpaths, and a preview URL without changing the project. Install exact refs together when the project needs local files:\n\n```sh\nnpx drawcall market install <name@range...> --cwd "$PWD"\n```\n\nInstall records `assetDependencies` in the nearest `package.json`. `list --cwd "$PWD"` reads that inventory without network access. Run `sync --cwd "$PWD"` after moving installed files so aliases continue to resolve. Use `--force` only with permission to overwrite changed files.\n\nGenerate and install one asset with:\n\n```sh\nnpx drawcall market generate --type <type> "<description>"\n```\n\nIf it returns a continuation, run the printed `generate install <jobId>` command. The Market agent can source a coherent set of assets from a broader goal:\n\n```sh\nnpx drawcall market agent "<goal>"\n```\n\nPublish only when asked. `pack <source> --out <zip>` creates a Market archive and `upload <name> <source> "<description>" --type <type>` publishes it. Use command help for dependency and visibility options. If authentication is required, ask before running `npx drawcall auth login`.\n\n## Choose assets\n\nSearch one concrete need at a time. Use one result for an exact lookup and up to three when the user should choose. If nothing fits, try one broader noun phrase before generating a replacement.\n\nThe exact `name@version` returned by Market is authoritative. Copy it verbatim. Generated identifiers can legitimately end mid-word at the catalog limit; never expand, normalize, or reconstruct one from its description.\n\nPreview a finalist when appearance determines whether it fits. File, preview, and zip URLs returned by Market are opaque. Capability-bearing private URLs are secrets; never derive a URL from an asset name or preview metadata.\n\n## Generate\n\nGeneration creates one Market asset from a description. The description is provider input, not the eventual asset name. A fast provider may return the asset immediately; a slow provider returns a continuation ID for the matching status operation. Resume that job instead of starting the same generation again.\n\nReference images must be direct fetchable image URLs or image data, never webpage URLs. The current asset-type metadata says which types support references and how many they accept.\n\nA generated humanoid model is one expressive, animation-ready biped: one head, two arms, two legs, open empty hands, and no companions or scene. Describe identity, theme, silhouette, clothing, colors, and materials. Express topology outside the shared skeleton as costume or body-surface design so the result remains riggable.\n\
|
|
3
|
-
export const mcpMarketSkill = "---\nname: market\ndescription: Find, inspect, generate, and use Drawcall Market assets from a coding agent.\n---\n\n# Drawcall Market\n\n## MCP transport\n\nMCP tools are the only Market transport in this environment. Do not invoke the CLI, make direct API requests, or switch transports after a failed call.\n\nUse the same conceptual workflow as the Market CLI:\n\n```text\nlist_market_asset_types\nsearch_market\nget_market_asset\nget_market_asset_preview\n```\n\n`search_market` requires an asset type and returns exact `name@version` references. Inspect the exact manifest with `get_market_asset`; request its preview only when visual evidence matters. Remote MCP tools return immutable references and
|
|
2
|
+
export const cliMarketSkill = '---\nname: market\ndescription: Find, inspect, generate, and use Drawcall Market assets from a coding agent.\n---\n\n# Drawcall Market\n\n## CLI transport\n\nRun commands as `npx drawcall market <command>`; do not assume a global `market` binary or switch to MCP after a CLI failure. Use `npx drawcall market skill` when these instructions are not already available.\n\nDiscover the current vocabulary and choose an asset:\n\n```sh\nnpx drawcall market types\nnpx drawcall market search "<query>" --type <type> --limit 3\nnpx drawcall market preview <name@version> --out /tmp/<name>.png\nnpx drawcall market urls <name@version>\n```\n\n`urls` prints one base URL, file subpaths, and a preview URL without changing the project. Install exact refs together when the project needs local files:\n\n```sh\nnpx drawcall market install <name@range...> --cwd "$PWD"\n```\n\nInstall records `assetDependencies` in the nearest `package.json`. `list --cwd "$PWD"` reads that inventory without network access. Run `sync --cwd "$PWD"` after moving installed files so aliases continue to resolve. Use `--force` only with permission to overwrite changed files.\n\nGenerate and install one asset with:\n\n```sh\nnpx drawcall market generate --type <type> "<description>"\n```\n\nIf it returns a continuation, run the printed `generate install <jobId>` command. The Market agent can source a coherent set of assets from a broader goal:\n\n```sh\nnpx drawcall market agent "<goal>"\n```\n\nPublish only when asked. `pack <source> --out <zip>` creates a Market archive and `upload <name> <source> "<description>" --type <type>` publishes it. Use command help for dependency and visibility options. If authentication is required, ask before running `npx drawcall auth login`.\n\n## Choose assets\n\nSearch one concrete need at a time. Use one result for an exact lookup and up to three when the user should choose. If nothing fits, try one broader noun phrase before generating a replacement.\n\nThe exact `name@version` returned by Market is authoritative. Copy it verbatim. Generated identifiers can legitimately end mid-word at the catalog limit; never expand, normalize, or reconstruct one from its description.\n\nPreview a finalist when appearance determines whether it fits. File, preview, and zip URLs returned by Market are opaque. Capability-bearing private URLs are secrets; never derive a URL from an asset name or preview metadata.\n\n## Generate\n\nGeneration creates one Market asset from a description. The description is provider input, not the eventual asset name. A fast provider may return the asset immediately; a slow provider returns a continuation ID for the matching status operation. Resume that job instead of starting the same generation again.\n\nReference images must be direct fetchable image URLs or image data, never webpage URLs. The current asset-type metadata says which types support references and how many they accept.\n\nA generated humanoid model is one expressive, animation-ready biped: one head, two arms, two legs, open empty hands, and no companions or scene. Describe identity, theme, silhouette, clothing, colors, and materials. Express topology outside the shared skeleton as costume or body-surface design so the result remains riggable.\n\nTreat visibility as a publication decision. Choose public only when the user explicitly approves publication; choose private when the asset should remain owner-only. Private generation requires the account\'s `market:private` entitlement.\n\n## Failures\n\nAn error means the operation did not happen. Correct invalid inputs, refresh an exact reference after a not-found response, and retry one upstream failure once. Never repeat an unchanged failed generation. Use unapproved assets only when the user explicitly requests and accepts them.\n';
|
|
3
|
+
export const mcpMarketSkill = "---\nname: market\ndescription: Find, inspect, generate, and use Drawcall Market assets from a coding agent.\n---\n\n# Drawcall Market\n\n## MCP transport\n\nMCP tools are the only Market transport in this environment. Do not invoke the CLI, make direct API requests, or switch transports after a failed call.\n\nUse the same conceptual workflow as the Market CLI:\n\n```text\nlist_market_asset_types\nsearch_market\nget_market_asset\nget_market_asset_preview\n```\n\n`search_market` requires an asset type and returns exact `name@version` references. Inspect the exact manifest with `get_market_asset`; request its preview only when visual evidence matters. Remote MCP tools return immutable references and public URLs, but keep restricted capability-bearing URLs server-side. They do not install files into the caller's local project.\n\nWhen generation is available, call `generate_market_asset` only after the user chooses public or private visibility. Public generation also requires the user's explicit consent to publish. If it returns a `jobId`, continue with `get_market_asset_generation`. Do not start the same generation again.\n\nMCP cannot start Market agent runs until the Market API supports explicit output visibility. When status access is available, `get_market_agent_run` may resume an existing run by ID.\n\nUse an exact Market reference with `create_design_frame` when the selected asset belongs in Drawcall Design.\n\n## Choose assets\n\nSearch one concrete need at a time. Use one result for an exact lookup and up to three when the user should choose. If nothing fits, try one broader noun phrase before generating a replacement.\n\nThe exact `name@version` returned by Market is authoritative. Copy it verbatim. Generated identifiers can legitimately end mid-word at the catalog limit; never expand, normalize, or reconstruct one from its description.\n\nPreview a finalist when appearance determines whether it fits. File, preview, and zip URLs returned by Market are opaque. Capability-bearing private URLs are secrets; never derive a URL from an asset name or preview metadata.\n\n## Generate\n\nGeneration creates one Market asset from a description. The description is provider input, not the eventual asset name. A fast provider may return the asset immediately; a slow provider returns a continuation ID for the matching status operation. Resume that job instead of starting the same generation again.\n\nReference images must be direct fetchable image URLs or image data, never webpage URLs. The current asset-type metadata says which types support references and how many they accept.\n\nA generated humanoid model is one expressive, animation-ready biped: one head, two arms, two legs, open empty hands, and no companions or scene. Describe identity, theme, silhouette, clothing, colors, and materials. Express topology outside the shared skeleton as costume or body-surface design so the result remains riggable.\n\nTreat visibility as a publication decision. Choose public only when the user explicitly approves publication; choose private when the asset should remain owner-only. Private generation requires the account's `market:private` entitlement.\n\n## Failures\n\nAn error means the operation did not happen. Correct invalid inputs, refresh an exact reference after a not-found response, and retry one upstream failure once. Never repeat an unchanged failed generation. Use unapproved assets only when the user explicitly requests and accepts them.\n";
|
|
4
4
|
//# sourceMappingURL=skill.generated.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skill.generated.js","sourceRoot":"","sources":["../src/skill.generated.ts"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,MAAM,CAAC,MAAM,cAAc,GACzB,
|
|
1
|
+
{"version":3,"file":"skill.generated.js","sourceRoot":"","sources":["../src/skill.generated.ts"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,MAAM,CAAC,MAAM,cAAc,GACzB,wuHAAwuH,CAAA;AAC1uH,MAAM,CAAC,MAAM,cAAc,GACzB,w6GAAw6G,CAAA"}
|
package/package.json
CHANGED
package/skills/market/SKILL.md
CHANGED
|
@@ -56,7 +56,7 @@ Reference images must be direct fetchable image URLs or image data, never webpag
|
|
|
56
56
|
|
|
57
57
|
A generated humanoid model is one expressive, animation-ready biped: one head, two arms, two legs, open empty hands, and no companions or scene. Describe identity, theme, silhouette, clothing, colors, and materials. Express topology outside the shared skeleton as costume or body-surface design so the result remains riggable.
|
|
58
58
|
|
|
59
|
-
|
|
59
|
+
Treat visibility as a publication decision. Choose public only when the user explicitly approves publication; choose private when the asset should remain owner-only. Private generation requires the account's `market:private` entitlement.
|
|
60
60
|
|
|
61
61
|
## Failures
|
|
62
62
|
|
package/src/mcp/agent.ts
CHANGED
|
@@ -1,31 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { agentStatusSchema } from '../schemas.js'
|
|
2
2
|
import type { MarketV1Client } from '../v1/client.js'
|
|
3
3
|
import { result } from './result.js'
|
|
4
4
|
import type { MarketMcpServer } from './types.js'
|
|
5
5
|
|
|
6
6
|
export function registerAgentTools(server: MarketMcpServer, client: MarketV1Client): void {
|
|
7
|
-
server.registerTool(
|
|
8
|
-
'start_market_agent_run',
|
|
9
|
-
{
|
|
10
|
-
title: 'Start Market agent run',
|
|
11
|
-
description:
|
|
12
|
-
'Start a Market agent run that plans, finds, judges, and generates a coherent set of assets for a goal.',
|
|
13
|
-
inputSchema: agentStartSchema,
|
|
14
|
-
annotations: {
|
|
15
|
-
readOnlyHint: false,
|
|
16
|
-
destructiveHint: false,
|
|
17
|
-
openWorldHint: true,
|
|
18
|
-
idempotentHint: false,
|
|
19
|
-
},
|
|
20
|
-
},
|
|
21
|
-
async (input) => result({ run: await client.asset.agent.start(input) }),
|
|
22
|
-
)
|
|
23
|
-
|
|
24
7
|
server.registerTool(
|
|
25
8
|
'get_market_agent_run',
|
|
26
9
|
{
|
|
27
10
|
title: 'Get Market agent run',
|
|
28
|
-
description:
|
|
11
|
+
description:
|
|
12
|
+
'Get the current state and result of an existing Market agent run. MCP cannot start agent runs until the Market API supports explicit output visibility.',
|
|
29
13
|
inputSchema: agentStatusSchema,
|
|
30
14
|
annotations: {
|
|
31
15
|
readOnlyHint: true,
|
package/src/mcp/asset.ts
CHANGED
|
@@ -2,15 +2,23 @@ import { z } from 'zod'
|
|
|
2
2
|
import { resolveAsset } from '../refs.js'
|
|
3
3
|
import { assetTypeSchema } from '../schemas.js'
|
|
4
4
|
import type { MarketV1Client } from '../v1/client.js'
|
|
5
|
+
import type { AssetRefEntry } from '../v1/index.js'
|
|
5
6
|
import { base64, result } from './result.js'
|
|
6
7
|
import type { MarketMcpServer } from './types.js'
|
|
7
8
|
|
|
9
|
+
const includeUnapprovedSchema = z
|
|
10
|
+
.boolean()
|
|
11
|
+
.default(false)
|
|
12
|
+
.describe(
|
|
13
|
+
'Include unapproved assets only when the user explicitly asks to inspect unmoderated content and accepts that it has not passed Market review.',
|
|
14
|
+
)
|
|
15
|
+
|
|
8
16
|
const searchMarketSchema = z
|
|
9
17
|
.object({
|
|
10
18
|
query: z.string().min(1).max(200),
|
|
11
19
|
type: assetTypeSchema,
|
|
12
20
|
limit: z.coerce.number().int().min(1).max(5).default(3),
|
|
13
|
-
includeUnapproved:
|
|
21
|
+
includeUnapproved: includeUnapprovedSchema,
|
|
14
22
|
})
|
|
15
23
|
.strict()
|
|
16
24
|
|
|
@@ -18,8 +26,7 @@ const assetRefSchema = z.string().min(1).describe('Asset name or exact name@vers
|
|
|
18
26
|
const assetInput = z
|
|
19
27
|
.object({
|
|
20
28
|
asset: assetRefSchema,
|
|
21
|
-
includeUnapproved:
|
|
22
|
-
key: z.string().min(1).max(128).optional(),
|
|
29
|
+
includeUnapproved: includeUnapprovedSchema,
|
|
23
30
|
})
|
|
24
31
|
.strict()
|
|
25
32
|
|
|
@@ -70,16 +77,20 @@ export function registerAssetTools(
|
|
|
70
77
|
throw new Error('Market search unexpectedly returned an exact asset result')
|
|
71
78
|
}
|
|
72
79
|
return result({
|
|
73
|
-
assets: response.items.map((asset) =>
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
80
|
+
assets: response.items.map((asset) => {
|
|
81
|
+
const previewUrl = safePublicUrl(asset.previewUrl, asset)
|
|
82
|
+
return {
|
|
83
|
+
asset: `${asset.name}@${asset.latestVersion}`,
|
|
84
|
+
name: asset.name,
|
|
85
|
+
version: asset.latestVersion,
|
|
86
|
+
type: asset.type,
|
|
87
|
+
description: asset.description,
|
|
88
|
+
approved: asset.approved,
|
|
89
|
+
access: asset.access,
|
|
90
|
+
hasPreview: Boolean(asset.previewUrl),
|
|
91
|
+
...(previewUrl ? { previewUrl } : {}),
|
|
92
|
+
}
|
|
93
|
+
}),
|
|
83
94
|
total: response.total,
|
|
84
95
|
})
|
|
85
96
|
},
|
|
@@ -90,7 +101,7 @@ export function registerAssetTools(
|
|
|
90
101
|
{
|
|
91
102
|
title: 'Get Market asset',
|
|
92
103
|
description:
|
|
93
|
-
'Get one exact Drawcall Market asset manifest with its version history, dependencies,
|
|
104
|
+
'Get one exact Drawcall Market asset manifest with its version history, dependencies, and file metadata. Capability-bearing URLs and owner identifiers are never returned.',
|
|
94
105
|
inputSchema: assetInput,
|
|
95
106
|
annotations: {
|
|
96
107
|
readOnlyHint: true,
|
|
@@ -99,12 +110,9 @@ export function registerAssetTools(
|
|
|
99
110
|
idempotentHint: true,
|
|
100
111
|
},
|
|
101
112
|
},
|
|
102
|
-
async ({ asset, includeUnapproved
|
|
113
|
+
async ({ asset, includeUnapproved }) =>
|
|
103
114
|
result({
|
|
104
|
-
asset: await resolveAsset(client.asset, asset, {
|
|
105
|
-
includeUnapproved,
|
|
106
|
-
...(key ? { key } : {}),
|
|
107
|
-
}),
|
|
115
|
+
asset: mcpAsset(await resolveAsset(client.asset, asset, { includeUnapproved })),
|
|
108
116
|
}),
|
|
109
117
|
)
|
|
110
118
|
|
|
@@ -112,7 +120,8 @@ export function registerAssetTools(
|
|
|
112
120
|
'get_market_asset_preview',
|
|
113
121
|
{
|
|
114
122
|
title: 'Get Market asset preview',
|
|
115
|
-
description:
|
|
123
|
+
description:
|
|
124
|
+
'Return the preview image for one exact Drawcall Market asset. The server fetches restricted previews without returning their capability-bearing URL.',
|
|
116
125
|
inputSchema: assetInput,
|
|
117
126
|
annotations: {
|
|
118
127
|
readOnlyHint: true,
|
|
@@ -121,22 +130,17 @@ export function registerAssetTools(
|
|
|
121
130
|
idempotentHint: true,
|
|
122
131
|
},
|
|
123
132
|
},
|
|
124
|
-
async ({ asset: ref, includeUnapproved
|
|
125
|
-
const asset = await resolveAsset(client.asset, ref, {
|
|
126
|
-
includeUnapproved,
|
|
127
|
-
...(key ? { key } : {}),
|
|
128
|
-
})
|
|
133
|
+
async ({ asset: ref, includeUnapproved }) => {
|
|
134
|
+
const asset = await resolveAsset(client.asset, ref, { includeUnapproved })
|
|
129
135
|
if (!asset.previewUrl) throw new Error(`Asset "${ref}" has no preview image`)
|
|
130
136
|
|
|
131
|
-
const response = await fetcher
|
|
137
|
+
const response = await fetchPreview(fetcher, asset.previewUrl, ref)
|
|
132
138
|
if (!response.ok) {
|
|
133
|
-
throw new Error(
|
|
134
|
-
`Could not read preview ${asset.previewUrl}: ${response.status} ${response.statusText}`,
|
|
135
|
-
)
|
|
139
|
+
throw new Error(`Could not read preview for "${ref}": ${response.status}`)
|
|
136
140
|
}
|
|
137
141
|
const mimeType = response.headers.get('content-type')?.split(';', 1)[0]
|
|
138
142
|
if (!mimeType?.startsWith('image/')) {
|
|
139
|
-
throw new Error(`Preview ${
|
|
143
|
+
throw new Error(`Preview for "${ref}" returned ${mimeType ?? 'no media type'}`)
|
|
140
144
|
}
|
|
141
145
|
|
|
142
146
|
return {
|
|
@@ -149,10 +153,61 @@ export function registerAssetTools(
|
|
|
149
153
|
],
|
|
150
154
|
structuredContent: {
|
|
151
155
|
asset: `${asset.name}@${asset.version}`,
|
|
152
|
-
url: asset.previewUrl,
|
|
153
156
|
mediaType: mimeType,
|
|
154
157
|
},
|
|
155
158
|
}
|
|
156
159
|
},
|
|
157
160
|
)
|
|
158
161
|
}
|
|
162
|
+
|
|
163
|
+
function mcpAsset(asset: AssetRefEntry): Record<string, unknown> {
|
|
164
|
+
const publicAsset = asset.access === 'public' && asset.approved
|
|
165
|
+
const previewUrl = safePublicUrl(asset.previewUrl, asset)
|
|
166
|
+
const zipUrl = safePublicUrl(asset.zipUrl, asset)
|
|
167
|
+
|
|
168
|
+
return {
|
|
169
|
+
name: asset.name,
|
|
170
|
+
type: asset.type,
|
|
171
|
+
version: asset.version,
|
|
172
|
+
description: asset.description,
|
|
173
|
+
approved: asset.approved,
|
|
174
|
+
access: asset.access,
|
|
175
|
+
npmDependencies: asset.npmDependencies,
|
|
176
|
+
assetDependencies: asset.assetDependencies,
|
|
177
|
+
skillDependencies: asset.skillDependencies,
|
|
178
|
+
files: asset.files.map(({ url, ...file }) => {
|
|
179
|
+
const publicUrl = safePublicUrl(url, asset)
|
|
180
|
+
return publicUrl ? { ...file, url: publicUrl } : file
|
|
181
|
+
}),
|
|
182
|
+
hasPreview: Boolean(asset.previewUrl),
|
|
183
|
+
versions: asset.versions,
|
|
184
|
+
...(previewUrl ? { previewUrl } : {}),
|
|
185
|
+
...(zipUrl ? { zipUrl } : {}),
|
|
186
|
+
...(!publicAsset ? { restrictedUrlsOmitted: true } : {}),
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
async function fetchPreview(
|
|
191
|
+
fetcher: typeof globalThis.fetch,
|
|
192
|
+
url: string,
|
|
193
|
+
ref: string,
|
|
194
|
+
): Promise<Response> {
|
|
195
|
+
try {
|
|
196
|
+
return await fetcher(url)
|
|
197
|
+
} catch {
|
|
198
|
+
throw new Error(`Could not read preview for "${ref}"`)
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
function safePublicUrl(
|
|
203
|
+
url: string | null,
|
|
204
|
+
asset: Pick<AssetRefEntry, 'access' | 'approved'>,
|
|
205
|
+
): string | undefined {
|
|
206
|
+
if (!url || asset.access !== 'public' || !asset.approved) return undefined
|
|
207
|
+
try {
|
|
208
|
+
const parsed = new URL(url)
|
|
209
|
+
return parsed.searchParams.has('key') ? undefined : parsed.href
|
|
210
|
+
} catch {
|
|
211
|
+
return undefined
|
|
212
|
+
}
|
|
213
|
+
}
|
package/src/mcp/generation.ts
CHANGED
|
@@ -1,9 +1,32 @@
|
|
|
1
|
+
import { z } from 'zod'
|
|
1
2
|
import { assetTypeSchema, generateAssetSchema, generateStatusInputSchema } from '../schemas.js'
|
|
2
3
|
import type { MarketV1Client } from '../v1/client.js'
|
|
3
4
|
import { result } from './result.js'
|
|
4
5
|
import type { MarketMcpServer } from './types.js'
|
|
5
6
|
|
|
6
|
-
const
|
|
7
|
+
const generationBaseSchema = generateAssetSchema
|
|
8
|
+
.omit({ access: true, type: true })
|
|
9
|
+
.extend({ type: assetTypeSchema })
|
|
10
|
+
|
|
11
|
+
const generateMarketAssetSchema = z.discriminatedUnion('access', [
|
|
12
|
+
generationBaseSchema
|
|
13
|
+
.extend({
|
|
14
|
+
access: z
|
|
15
|
+
.literal('public')
|
|
16
|
+
.describe('Publish the generated asset to the public Market after its approval flow.'),
|
|
17
|
+
confirmPublicPublication: z
|
|
18
|
+
.literal(true)
|
|
19
|
+
.describe('Must be true only after the user explicitly approves public publication.'),
|
|
20
|
+
})
|
|
21
|
+
.strict(),
|
|
22
|
+
generationBaseSchema
|
|
23
|
+
.extend({
|
|
24
|
+
access: z
|
|
25
|
+
.literal('private')
|
|
26
|
+
.describe('Keep the generated asset private to the authenticated owner.'),
|
|
27
|
+
})
|
|
28
|
+
.strict(),
|
|
29
|
+
])
|
|
7
30
|
|
|
8
31
|
export function registerGenerationTools(server: MarketMcpServer, client: MarketV1Client): void {
|
|
9
32
|
server.registerTool(
|
|
@@ -11,7 +34,7 @@ export function registerGenerationTools(server: MarketMcpServer, client: MarketV
|
|
|
11
34
|
{
|
|
12
35
|
title: 'Generate Market asset',
|
|
13
36
|
description:
|
|
14
|
-
'
|
|
37
|
+
'Create one external Drawcall Market asset. Visibility is required; public publication is allowed only after explicit user consent. A slow provider returns a jobId to pass to get_market_asset_generation.',
|
|
15
38
|
inputSchema: generateMarketAssetSchema,
|
|
16
39
|
annotations: {
|
|
17
40
|
readOnlyHint: false,
|
|
@@ -20,7 +43,13 @@ export function registerGenerationTools(server: MarketMcpServer, client: MarketV
|
|
|
20
43
|
idempotentHint: false,
|
|
21
44
|
},
|
|
22
45
|
},
|
|
23
|
-
async (input) =>
|
|
46
|
+
async (input) => {
|
|
47
|
+
if (input.access === 'public') {
|
|
48
|
+
const { confirmPublicPublication: _confirmed, ...generation } = input
|
|
49
|
+
return result({ generation: await client.asset.generate(generation) })
|
|
50
|
+
}
|
|
51
|
+
return result({ generation: await client.asset.generate(input) })
|
|
52
|
+
},
|
|
24
53
|
)
|
|
25
54
|
|
|
26
55
|
server.registerTool(
|
package/src/skill.generated.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Generated from skill/SKILL.template.md.
|
|
2
2
|
export const cliMarketSkill =
|
|
3
|
-
'---\nname: market\ndescription: Find, inspect, generate, and use Drawcall Market assets from a coding agent.\n---\n\n# Drawcall Market\n\n## CLI transport\n\nRun commands as `npx drawcall market <command>`; do not assume a global `market` binary or switch to MCP after a CLI failure. Use `npx drawcall market skill` when these instructions are not already available.\n\nDiscover the current vocabulary and choose an asset:\n\n```sh\nnpx drawcall market types\nnpx drawcall market search "<query>" --type <type> --limit 3\nnpx drawcall market preview <name@version> --out /tmp/<name>.png\nnpx drawcall market urls <name@version>\n```\n\n`urls` prints one base URL, file subpaths, and a preview URL without changing the project. Install exact refs together when the project needs local files:\n\n```sh\nnpx drawcall market install <name@range...> --cwd "$PWD"\n```\n\nInstall records `assetDependencies` in the nearest `package.json`. `list --cwd "$PWD"` reads that inventory without network access. Run `sync --cwd "$PWD"` after moving installed files so aliases continue to resolve. Use `--force` only with permission to overwrite changed files.\n\nGenerate and install one asset with:\n\n```sh\nnpx drawcall market generate --type <type> "<description>"\n```\n\nIf it returns a continuation, run the printed `generate install <jobId>` command. The Market agent can source a coherent set of assets from a broader goal:\n\n```sh\nnpx drawcall market agent "<goal>"\n```\n\nPublish only when asked. `pack <source> --out <zip>` creates a Market archive and `upload <name> <source> "<description>" --type <type>` publishes it. Use command help for dependency and visibility options. If authentication is required, ask before running `npx drawcall auth login`.\n\n## Choose assets\n\nSearch one concrete need at a time. Use one result for an exact lookup and up to three when the user should choose. If nothing fits, try one broader noun phrase before generating a replacement.\n\nThe exact `name@version` returned by Market is authoritative. Copy it verbatim. Generated identifiers can legitimately end mid-word at the catalog limit; never expand, normalize, or reconstruct one from its description.\n\nPreview a finalist when appearance determines whether it fits. File, preview, and zip URLs returned by Market are opaque. Capability-bearing private URLs are secrets; never derive a URL from an asset name or preview metadata.\n\n## Generate\n\nGeneration creates one Market asset from a description. The description is provider input, not the eventual asset name. A fast provider may return the asset immediately; a slow provider returns a continuation ID for the matching status operation. Resume that job instead of starting the same generation again.\n\nReference images must be direct fetchable image URLs or image data, never webpage URLs. The current asset-type metadata says which types support references and how many they accept.\n\nA generated humanoid model is one expressive, animation-ready biped: one head, two arms, two legs, open empty hands, and no companions or scene. Describe identity, theme, silhouette, clothing, colors, and materials. Express topology outside the shared skeleton as costume or body-surface design so the result remains riggable.\n\
|
|
3
|
+
'---\nname: market\ndescription: Find, inspect, generate, and use Drawcall Market assets from a coding agent.\n---\n\n# Drawcall Market\n\n## CLI transport\n\nRun commands as `npx drawcall market <command>`; do not assume a global `market` binary or switch to MCP after a CLI failure. Use `npx drawcall market skill` when these instructions are not already available.\n\nDiscover the current vocabulary and choose an asset:\n\n```sh\nnpx drawcall market types\nnpx drawcall market search "<query>" --type <type> --limit 3\nnpx drawcall market preview <name@version> --out /tmp/<name>.png\nnpx drawcall market urls <name@version>\n```\n\n`urls` prints one base URL, file subpaths, and a preview URL without changing the project. Install exact refs together when the project needs local files:\n\n```sh\nnpx drawcall market install <name@range...> --cwd "$PWD"\n```\n\nInstall records `assetDependencies` in the nearest `package.json`. `list --cwd "$PWD"` reads that inventory without network access. Run `sync --cwd "$PWD"` after moving installed files so aliases continue to resolve. Use `--force` only with permission to overwrite changed files.\n\nGenerate and install one asset with:\n\n```sh\nnpx drawcall market generate --type <type> "<description>"\n```\n\nIf it returns a continuation, run the printed `generate install <jobId>` command. The Market agent can source a coherent set of assets from a broader goal:\n\n```sh\nnpx drawcall market agent "<goal>"\n```\n\nPublish only when asked. `pack <source> --out <zip>` creates a Market archive and `upload <name> <source> "<description>" --type <type>` publishes it. Use command help for dependency and visibility options. If authentication is required, ask before running `npx drawcall auth login`.\n\n## Choose assets\n\nSearch one concrete need at a time. Use one result for an exact lookup and up to three when the user should choose. If nothing fits, try one broader noun phrase before generating a replacement.\n\nThe exact `name@version` returned by Market is authoritative. Copy it verbatim. Generated identifiers can legitimately end mid-word at the catalog limit; never expand, normalize, or reconstruct one from its description.\n\nPreview a finalist when appearance determines whether it fits. File, preview, and zip URLs returned by Market are opaque. Capability-bearing private URLs are secrets; never derive a URL from an asset name or preview metadata.\n\n## Generate\n\nGeneration creates one Market asset from a description. The description is provider input, not the eventual asset name. A fast provider may return the asset immediately; a slow provider returns a continuation ID for the matching status operation. Resume that job instead of starting the same generation again.\n\nReference images must be direct fetchable image URLs or image data, never webpage URLs. The current asset-type metadata says which types support references and how many they accept.\n\nA generated humanoid model is one expressive, animation-ready biped: one head, two arms, two legs, open empty hands, and no companions or scene. Describe identity, theme, silhouette, clothing, colors, and materials. Express topology outside the shared skeleton as costume or body-surface design so the result remains riggable.\n\nTreat visibility as a publication decision. Choose public only when the user explicitly approves publication; choose private when the asset should remain owner-only. Private generation requires the account\'s `market:private` entitlement.\n\n## Failures\n\nAn error means the operation did not happen. Correct invalid inputs, refresh an exact reference after a not-found response, and retry one upstream failure once. Never repeat an unchanged failed generation. Use unapproved assets only when the user explicitly requests and accepts them.\n'
|
|
4
4
|
export const mcpMarketSkill =
|
|
5
|
-
"---\nname: market\ndescription: Find, inspect, generate, and use Drawcall Market assets from a coding agent.\n---\n\n# Drawcall Market\n\n## MCP transport\n\nMCP tools are the only Market transport in this environment. Do not invoke the CLI, make direct API requests, or switch transports after a failed call.\n\nUse the same conceptual workflow as the Market CLI:\n\n```text\nlist_market_asset_types\nsearch_market\nget_market_asset\nget_market_asset_preview\n```\n\n`search_market` requires an asset type and returns exact `name@version` references. Inspect the exact manifest with `get_market_asset`; request its preview only when visual evidence matters. Remote MCP tools return immutable references and
|
|
5
|
+
"---\nname: market\ndescription: Find, inspect, generate, and use Drawcall Market assets from a coding agent.\n---\n\n# Drawcall Market\n\n## MCP transport\n\nMCP tools are the only Market transport in this environment. Do not invoke the CLI, make direct API requests, or switch transports after a failed call.\n\nUse the same conceptual workflow as the Market CLI:\n\n```text\nlist_market_asset_types\nsearch_market\nget_market_asset\nget_market_asset_preview\n```\n\n`search_market` requires an asset type and returns exact `name@version` references. Inspect the exact manifest with `get_market_asset`; request its preview only when visual evidence matters. Remote MCP tools return immutable references and public URLs, but keep restricted capability-bearing URLs server-side. They do not install files into the caller's local project.\n\nWhen generation is available, call `generate_market_asset` only after the user chooses public or private visibility. Public generation also requires the user's explicit consent to publish. If it returns a `jobId`, continue with `get_market_asset_generation`. Do not start the same generation again.\n\nMCP cannot start Market agent runs until the Market API supports explicit output visibility. When status access is available, `get_market_agent_run` may resume an existing run by ID.\n\nUse an exact Market reference with `create_design_frame` when the selected asset belongs in Drawcall Design.\n\n## Choose assets\n\nSearch one concrete need at a time. Use one result for an exact lookup and up to three when the user should choose. If nothing fits, try one broader noun phrase before generating a replacement.\n\nThe exact `name@version` returned by Market is authoritative. Copy it verbatim. Generated identifiers can legitimately end mid-word at the catalog limit; never expand, normalize, or reconstruct one from its description.\n\nPreview a finalist when appearance determines whether it fits. File, preview, and zip URLs returned by Market are opaque. Capability-bearing private URLs are secrets; never derive a URL from an asset name or preview metadata.\n\n## Generate\n\nGeneration creates one Market asset from a description. The description is provider input, not the eventual asset name. A fast provider may return the asset immediately; a slow provider returns a continuation ID for the matching status operation. Resume that job instead of starting the same generation again.\n\nReference images must be direct fetchable image URLs or image data, never webpage URLs. The current asset-type metadata says which types support references and how many they accept.\n\nA generated humanoid model is one expressive, animation-ready biped: one head, two arms, two legs, open empty hands, and no companions or scene. Describe identity, theme, silhouette, clothing, colors, and materials. Express topology outside the shared skeleton as costume or body-surface design so the result remains riggable.\n\nTreat visibility as a publication decision. Choose public only when the user explicitly approves publication; choose private when the asset should remain owner-only. Private generation requires the account's `market:private` entitlement.\n\n## Failures\n\nAn error means the operation did not happen. Correct invalid inputs, refresh an exact reference after a not-found response, and retry one upstream failure once. Never repeat an unchanged failed generation. Use unapproved assets only when the user explicitly requests and accepts them.\n"
|