@drawcall/market 0.1.55 → 0.1.57

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.
@@ -0,0 +1,8 @@
1
+ export declare const PROJECT_INSTALL_LOCK_PATH = ".drawcall/market-install.lock";
2
+ export interface ProjectInstallLockOptions {
3
+ timeoutMs?: number;
4
+ retryDelayMs?: number;
5
+ staleMs?: number;
6
+ }
7
+ export declare function withProjectInstallLock<T>(projectRoot: string, task: () => Promise<T>, options?: ProjectInstallLockOptions): Promise<T>;
8
+ //# sourceMappingURL=install-lock.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"install-lock.d.ts","sourceRoot":"","sources":["../src/install-lock.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,yBAAyB,kCAAkC,CAAA;AAqBxE,MAAM,WAAW,yBAAyB;IACxC,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED,wBAAsB,sBAAsB,CAAC,CAAC,EAC5C,WAAW,EAAE,MAAM,EACnB,IAAI,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,EACtB,OAAO,GAAE,yBAA8B,GACtC,OAAO,CAAC,CAAC,CAAC,CASZ"}
@@ -0,0 +1,209 @@
1
+ import { randomUUID } from 'node:crypto';
2
+ import * as fs from 'node:fs/promises';
3
+ import { hostname } from 'node:os';
4
+ import * as path from 'node:path';
5
+ export const PROJECT_INSTALL_LOCK_PATH = '.drawcall/market-install.lock';
6
+ const OWNER_FILE = 'owner.json';
7
+ const DEFAULT_TIMEOUT_MS = 30_000;
8
+ const DEFAULT_RETRY_DELAY_MS = 50;
9
+ const DEFAULT_STALE_MS = 5 * 60_000;
10
+ export async function withProjectInstallLock(projectRoot, task, options = {}) {
11
+ const lockPath = path.join(projectRoot, PROJECT_INSTALL_LOCK_PATH);
12
+ const owner = await acquireLock(lockPath, options);
13
+ try {
14
+ return await task();
15
+ }
16
+ finally {
17
+ await releaseLock(lockPath, owner);
18
+ }
19
+ }
20
+ async function acquireLock(lockPath, options) {
21
+ const timeoutMs = validDuration(options.timeoutMs, DEFAULT_TIMEOUT_MS, 'timeoutMs');
22
+ const retryDelayMs = validDuration(options.retryDelayMs, DEFAULT_RETRY_DELAY_MS, 'retryDelayMs');
23
+ const staleMs = validDuration(options.staleMs, DEFAULT_STALE_MS, 'staleMs');
24
+ const startedAtMs = Date.now();
25
+ const owner = createOwner();
26
+ await fs.mkdir(path.dirname(lockPath), { recursive: true });
27
+ while (true) {
28
+ if (await tryCreateLock(lockPath, owner))
29
+ return owner;
30
+ const snapshot = await readLockSnapshot(lockPath);
31
+ if (!snapshot)
32
+ continue;
33
+ if (isStale(snapshot, staleMs) && (await quarantineStaleLock(lockPath, snapshot))) {
34
+ continue;
35
+ }
36
+ const elapsedMs = Date.now() - startedAtMs;
37
+ if (elapsedMs >= timeoutMs) {
38
+ throw new Error(lockTimeoutMessage(lockPath, timeoutMs, snapshot.owner));
39
+ }
40
+ await delay(Math.min(retryDelayMs, timeoutMs - elapsedMs));
41
+ }
42
+ }
43
+ async function tryCreateLock(lockPath, owner) {
44
+ // Directory creation is the cross-process compare-and-set: exactly one installer can succeed.
45
+ try {
46
+ await fs.mkdir(lockPath);
47
+ }
48
+ catch (error) {
49
+ if (hasCode(error, 'EEXIST'))
50
+ return false;
51
+ throw error;
52
+ }
53
+ try {
54
+ await fs.writeFile(path.join(lockPath, OWNER_FILE), JSON.stringify(owner, null, 2) + '\n', {
55
+ flag: 'wx',
56
+ });
57
+ }
58
+ catch (error) {
59
+ await fs.rm(lockPath, { recursive: true, force: true });
60
+ throw error;
61
+ }
62
+ return true;
63
+ }
64
+ async function releaseLock(lockPath, owner) {
65
+ const snapshot = await readLockSnapshot(lockPath);
66
+ if (snapshot?.owner?.token !== owner.token) {
67
+ throw new Error(`Lost ownership of Market install lock at ${lockPath}; refusing to release it.`);
68
+ }
69
+ const releasedPath = `${lockPath}.released-${owner.token}`;
70
+ // Cleanup happens at an owner-specific path, so a successor can acquire the canonical path
71
+ // without being vulnerable to this process deleting its lock.
72
+ await fs.rename(lockPath, releasedPath);
73
+ const released = await readLockSnapshot(releasedPath);
74
+ if (released?.owner?.token !== owner.token) {
75
+ await restoreLock(releasedPath, lockPath);
76
+ throw new Error(`Market install lock at ${lockPath} changed while it was being released.`);
77
+ }
78
+ await fs.rm(releasedPath, { recursive: true, force: true });
79
+ }
80
+ async function quarantineStaleLock(lockPath, expected) {
81
+ const stalePath = `${lockPath}.stale-${randomUUID()}`;
82
+ try {
83
+ await fs.rename(lockPath, stalePath);
84
+ }
85
+ catch (error) {
86
+ if (hasCode(error, 'ENOENT'))
87
+ return true;
88
+ throw error;
89
+ }
90
+ const quarantined = await readLockSnapshot(stalePath);
91
+ if (!quarantined)
92
+ return true;
93
+ // Another process may have replaced the stale lock after our read. Inode identity keeps this
94
+ // recovery attempt from deleting that replacement.
95
+ if (quarantined.device !== expected.device ||
96
+ quarantined.inode !== expected.inode ||
97
+ quarantined.modifiedAtMs !== expected.modifiedAtMs ||
98
+ quarantined.owner?.token !== expected.owner?.token) {
99
+ await restoreLock(stalePath, lockPath);
100
+ return false;
101
+ }
102
+ await fs.rm(stalePath, { recursive: true, force: true });
103
+ return true;
104
+ }
105
+ async function restoreLock(from, to) {
106
+ try {
107
+ await fs.rename(from, to);
108
+ }
109
+ catch (error) {
110
+ throw new Error(`Could not restore Market install lock at ${to}.`, { cause: error });
111
+ }
112
+ }
113
+ async function readLockSnapshot(lockPath) {
114
+ let stats;
115
+ try {
116
+ stats = await fs.stat(lockPath);
117
+ }
118
+ catch (error) {
119
+ if (hasCode(error, 'ENOENT'))
120
+ return null;
121
+ throw error;
122
+ }
123
+ return {
124
+ owner: await readOwner(lockPath),
125
+ device: stats.dev,
126
+ inode: stats.ino,
127
+ modifiedAtMs: stats.mtimeMs,
128
+ };
129
+ }
130
+ async function readOwner(lockPath) {
131
+ let value;
132
+ try {
133
+ value = JSON.parse(await fs.readFile(path.join(lockPath, OWNER_FILE), 'utf-8'));
134
+ }
135
+ catch (error) {
136
+ if (hasCode(error, 'ENOENT') || error instanceof SyntaxError)
137
+ return null;
138
+ throw error;
139
+ }
140
+ if (!isRecord(value))
141
+ return null;
142
+ if (typeof value.token !== 'string')
143
+ return null;
144
+ if (typeof value.pid !== 'number' || !Number.isSafeInteger(value.pid) || value.pid <= 0)
145
+ return null;
146
+ if (typeof value.hostname !== 'string')
147
+ return null;
148
+ if (typeof value.createdAtMs !== 'number' || Number.isNaN(new Date(value.createdAtMs).getTime()))
149
+ return null;
150
+ return {
151
+ token: value.token,
152
+ pid: value.pid,
153
+ hostname: value.hostname,
154
+ createdAtMs: value.createdAtMs,
155
+ };
156
+ }
157
+ function isStale(snapshot, staleMs) {
158
+ if (snapshot.owner?.hostname === hostname()) {
159
+ const running = isProcessRunning(snapshot.owner.pid);
160
+ if (running !== null)
161
+ return !running;
162
+ }
163
+ return Date.now() - snapshot.modifiedAtMs >= staleMs;
164
+ }
165
+ function isProcessRunning(pid) {
166
+ try {
167
+ process.kill(pid, 0);
168
+ return true;
169
+ }
170
+ catch (error) {
171
+ if (hasCode(error, 'ESRCH'))
172
+ return false;
173
+ if (hasCode(error, 'EPERM'))
174
+ return true;
175
+ return null;
176
+ }
177
+ }
178
+ function createOwner() {
179
+ return {
180
+ token: randomUUID(),
181
+ pid: process.pid,
182
+ hostname: hostname(),
183
+ createdAtMs: Date.now(),
184
+ };
185
+ }
186
+ function lockTimeoutMessage(lockPath, timeoutMs, owner) {
187
+ const ownerDescription = owner
188
+ ? ` Owner PID ${owner.pid} on ${owner.hostname} acquired it at ${new Date(owner.createdAtMs).toISOString()}.`
189
+ : '';
190
+ return `Timed out after ${timeoutMs}ms waiting for Market install lock at ${lockPath}.${ownerDescription}`;
191
+ }
192
+ function validDuration(value, fallback, name) {
193
+ if (value === undefined)
194
+ return fallback;
195
+ if (!Number.isFinite(value) || value < 0) {
196
+ throw new TypeError(`${name} must be a non-negative finite number.`);
197
+ }
198
+ return value;
199
+ }
200
+ function isRecord(value) {
201
+ return typeof value === 'object' && value !== null && !Array.isArray(value);
202
+ }
203
+ function hasCode(error, code) {
204
+ return error instanceof Error && 'code' in error && error.code === code;
205
+ }
206
+ function delay(ms) {
207
+ return new Promise((resolve) => setTimeout(resolve, ms));
208
+ }
209
+ //# sourceMappingURL=install-lock.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"install-lock.js","sourceRoot":"","sources":["../src/install-lock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,KAAK,EAAE,MAAM,kBAAkB,CAAA;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAClC,OAAO,KAAK,IAAI,MAAM,WAAW,CAAA;AAEjC,MAAM,CAAC,MAAM,yBAAyB,GAAG,+BAA+B,CAAA;AAExE,MAAM,UAAU,GAAG,YAAY,CAAA;AAC/B,MAAM,kBAAkB,GAAG,MAAM,CAAA;AACjC,MAAM,sBAAsB,GAAG,EAAE,CAAA;AACjC,MAAM,gBAAgB,GAAG,CAAC,GAAG,MAAM,CAAA;AAsBnC,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAC1C,WAAmB,EACnB,IAAsB,EACtB,UAAqC,EAAE;IAEvC,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,yBAAyB,CAAC,CAAA;IAClE,MAAM,KAAK,GAAG,MAAM,WAAW,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAA;IAElD,IAAI,CAAC;QACH,OAAO,MAAM,IAAI,EAAE,CAAA;IACrB,CAAC;YAAS,CAAC;QACT,MAAM,WAAW,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAA;IACpC,CAAC;AACH,CAAC;AAED,KAAK,UAAU,WAAW,CACxB,QAAgB,EAChB,OAAkC;IAElC,MAAM,SAAS,GAAG,aAA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F,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,mBAAmB;IACnB,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;IACtC;;;;OAIG;IACH,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;CAC7D;AAED,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;IACb,SAAS,EAAE,MAAM,CAAA;IACjB,IAAI,EAAE,OAAO,CAAA;CACd;AAED,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,MAAM,CAAA;IACf,WAAW,EAAE,MAAM,GAAG,IAAI,CAAA;IAC1B,KAAK,EAAE,MAAM,EAAE,CAAA;CAChB;AAED,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,cAAc,EAAE,CAAA;IACxB,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACvC,gFAAgF;IAChF,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACzC,QAAQ,EAAE,MAAM,EAAE,CAAA;CACnB;AAQD,wBAAsB,OAAO,CAC3B,MAAM,EAAE,YAAY,EACpB,UAAU,EAAE,aAAa,EACzB,IAAI,GAAE,cAAmB,GACxB,OAAO,CAAC,aAAa,CAAC,CA4CxB;AAED,wBAAsB,eAAe,CAAC,GAAG,GAAE,MAAsB,GAAG,OAAO,CAAC,MAAM,CAAC,CAWlF"}
package/dist/install.js CHANGED
@@ -14,6 +14,7 @@ import * as fs from 'fs/promises';
14
14
  import * as path from 'path';
15
15
  import { unzipSync } from 'fflate';
16
16
  import { detectPackageManager, installDependencies } from 'nypm';
17
+ import { withProjectInstallLock } from './install-lock.js';
17
18
  import { readMarketLock, writeMarketLock } from './market-lock.js';
18
19
  import { parsePackageJson } from './package-json.js';
19
20
  export async function install(client, resolution, opts = {}) {
@@ -25,11 +26,13 @@ export async function install(client, resolution, opts = {}) {
25
26
  log,
26
27
  baseUrl: opts.baseUrl,
27
28
  });
28
- await writeInstalledAssetLock(installRoot, download.assets);
29
- const packageJsonUpdate = await updatePackageJson(resolution, installRoot, {
30
- rootRequests: opts.rootRequests ?? [],
31
- installMetadata: metadata,
32
- packageManagerNeeded: download.wrotePackageJson,
29
+ const packageJsonUpdate = await withProjectInstallLock(installRoot, async () => {
30
+ await writeInstalledAssetLock(installRoot, download.assets);
31
+ return updatePackageJson(resolution, installRoot, {
32
+ rootRequests: opts.rootRequests ?? [],
33
+ installMetadata: metadata,
34
+ packageManagerNeeded: download.wrotePackageJson,
35
+ });
33
36
  });
34
37
  if (packageJsonUpdate.packageManagerNeeded) {
35
38
  await runPackageManagerInstall(installRoot, log);
@@ -1 +1 @@
1
- {"version":3,"file":"install.js","sourceRoot":"","sources":["../src/install.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACxC,OAAO,KAAK,EAAE,MAAM,aAAa,CAAA;AACjC,OAAO,KAAK,IAAI,MAAM,MAAM,CAAA;AAC5B,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAA;AAClC,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,MAAM,CAAA;AAGhE,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAClE,OAAO,EAAE,gBAAgB,EAAoB,MAAM,mBAAmB,CAAA;AAsDtE,MAAM,CAAC,KAAK,UAAU,OAAO,CAC3B,MAAoB,EACpB,UAAyB,EACzB,OAAuB,EAAE;IAEzB,MAAM,GAAG,GAAG,IAAI,CAAC,UAAU,IAAI,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAA;IACzC,MAAM,WAA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CAAA;QACX,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC"}
package/dist/skill.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const marketSkill = "---\nname: market\ndescription: Find, preview, install, generate, and publish Drawcall Market assets from a coding agent.\n---\n\n# Drawcall Market\n\nUse the `market` CLI. Keep commands short and read the summary lines.\n\n## Quick Start\n\n```sh\nmarket search \"wooden chair\" --type model --limit 3\nmarket install wooden-chair --cwd \"$PWD\"\nmarket list --cwd \"$PWD\"\nmarket preview wooden-chair --out /tmp/wooden-chair.png\nmarket pack scene.zip --out scene.packed.zip\n```\n\n## Workflow\n\n1. In an existing repo, run `list --cwd \"$PWD\"` first to see installed local assets from `.drawcall/market-lock.json`. Use the listed names with `preview <name>` when you want preview images.\n2. Search first unless the user already gave an exact asset name. `search` requires `--type`; use `model` unless the user names another supported type: `humanoid-model`, `texture`, `humanoid-animation`, `template`, `sound-effect`, `background-music`, `environment`, or `flipbook`.\n3. Use `--limit 1` for lookup, `--limit 3` for choice. Search caps at 5 and prints full descriptions.\n4. `install` takes zero or more exact asset names (optionally `name@range`). With names, it installs those assets; with no names, it installs `assetDependencies` from the nearest `package.json`. It does not search or generate. Find names with `search` first. No `--type` is needed \u2014 asset names are unique. Use `--force` only when the user agrees to overwrite changed local files.\n5. `preview <name>` saves the preview image; no `--type` is needed. Not every type has previews (e.g. `humanoid-animation`, `template`, `sound-effect`, `background-music`); the CLI reports when one is unavailable.\n6. Use `--unapproved` only when the user asks for unapproved/private/admin assets. Do not install unapproved assets without explicit acceptance.\n7. `generate --type <type> \"<prompt>\"` creates and installs a generated asset when that asset type has a generator; it requires login. Currently supported generated types are `sound-effect`, `background-music`, `flipbook`, `humanoid-model`, and `environment` (a fitting HDRI sky + equirectangular background, generated in ~1-2 min). Generation is provider-specific: prompt style, generated files, indexing fields, and install layout are owned by the asset type. If a type does not support generation yet, the CLI reports unsupported generation. Add `--access public` to publish the generated asset publicly, or `--access private` to keep it owner-only; when omitted the server defaults to private if you hold the `market:private` entitlement, else public (`--access private` requires that entitlement). `generate` waits for the asset and installs it \u2014 one command for quick types. For a long one (e.g. `humanoid-model`, >2 min) the call returns after ~2 min with a job id instead of hanging your shell; run `market generate install <jobId>` to continue \u2014 it resumes the SAME job where the last call left off and installs when ready. Just re-run `generate install <jobId>` until it prints \"Generated and installed\" (it exits 0 while still generating, 1 on failure). No type is flagged \"slow\" \u2014 anything that outlasts one wait just continues on the next call.\n8. Use `pack <zip>` to create the same Market asset zip that `upload` sends. `pack` runs offline, infers template packing from a root `package.json`, and accepts `--type` only when you need to override that inference. `upload` runs the shared pack step internally, then publishes: `market upload <name> <zip> \"<description>\" --type <type>`. Declare dependencies with repeatable flags on either command: `--npm name@range`, `--asset name@range`, `--skill label=source`. Template pack/upload also reads root `package.json.assetDependencies`; `--asset` flags are additive and must not conflict. Template pack/upload omits installed dependency files that still match the installed dependency's canonical content (its file hashes are fetched from the server, not stored locally), so edited local files stay in the template; this omit step needs the API, but simple non-template packs stay offline. A skill source is a `skills add` argument: a whole repo (`owner/repo` or a git URL), a single skill via the full URL form `https://github.com/owner/repo/tree/<branch>/<subpath>` (the `tree/<branch>/<subpath>` shorthand needs the full URL, not `owner/repo`), or a local path to a skill directory inside the zip. Example: `market upload my-scene scene.zip \"A scene\" --type model --npm three@^0.178.0 --skill web-design=https://github.com/vercel-labs/agent-skills/tree/main/skills/web-design-guidelines`.\n9. Installed `environment` assets contain `public/environment/<name>.hdr` for Three.js IBL lighting and `public/environment/<name>-background.webp` for the visible equirectangular background. Use `market preview` to fetch the preview image separately.\n10. Installed `flipbook` assets contain `public/flipbook/<name>.ktx2`. Render them with `@drawcall/flipbook`'s `Flipbook` class and Three.js `KTX2Loader` for Basis-compressed files; `market preview` fetches the middle frame from the flipbook.\n\n## Humanoid animations\n\n`humanoid-animation` assets are single-clip GLBs \u2014 one motion per asset (one idle, one walk-forward, one jump, one attack) on a normalized skeleton that retargets onto any humanoid, whatever its role. A behaving character is therefore a *set* of clips, not one asset: from what the character actually does, budget the clips it needs \u2014 an idle, its locomotion (walk/run, often split by direction: fwd/bwd/left/right), and one clip per distinct action and reaction it performs \u2014 then search for each separately.\n\n`humanoid-model` assets share that same normalized skeleton and are authored to a **consistent real-world scale** \u2014 they come in at roughly the same height as each other. So you do **not** need to rescale one humanoid to match another (player vs. enemy vs. NPC); dropped in as-is they already stand at a consistent size. Avoid the trap of measuring one character's height and scaling others to it \u2014 besides being unnecessary, measuring a rigged/animated character's bounding box is unreliable and produces giants (see the `math` skill on `Box3` and skinned meshes). If you ever do need a deliberate size difference (a boss, a child NPC), apply an explicit chosen multiplier, not a measured one.\n\nSearch one motion per query, named by the motion, because results rank by keyword overlap: a query naming several motions at once is dominated by whichever word matches the most assets and buries the others, so real clips look like a gap when they exist. Names describe the motion, not the character \u2014 so search the motion (`\"walk forward\"`, `\"reload\"`, `\"jump\"`), not the role (`\"player run\"`, `\"boss attack\"`). If a motion finds nothing, retry with synonyms (run/jog/sprint, attack/swing/strike).\n\n## Output\n\nCommands print concise, line-oriented summaries:\n\n```text\nResults: 2/8 query=\"wooden chair\" type=model approval=approved\n- wooden-chair@1.0.0 | model | approved | Low-poly wooden chair\nInstalled:\n- wooden-chair@1.0.0 (asset)\n description: Low-poly wooden chair\n files:\n public/model\n \u2514\u2500 wooden-chair.glb\n- three@^0.178.0 (npm)\n- web-design \u2190 https://github.com/vercel-labs/agent-skills/tree/main/skills/web-design-guidelines (skill)\nInstalled assets: 1\n- wooden-chair@1.0.0 (model)\n files:\n public/model\n \u2514\u2500 wooden-chair.glb\nSaved preview for wooden-chair@1.0.0: /tmp/wooden-chair.png\n```\n\nAssets may also declare `skill` dependencies, installed for you via the `skills` CLI (`skills add`) during `install`. Sources are either a GitHub/git ref or a local path to a skill directory shipped inside the asset. This requires `npx` to be available.\n\nInstalled non-template assets are saved to `package.json.assetDependencies`; templates are scaffolds and are not saved as project asset dependencies. Exact installed versions and file paths are recorded in `.drawcall/market-lock.json`; file content hashes now come from the server (`asset.fileManifest`), not the lock.\n\n`list` is offline: it reads `.drawcall/market-lock.json` from the nearest package root and prints exact installed names, versions, types, and installed file paths.\n\nIf search returns no results, try one broader noun phrase. If a command returns `Error: Not logged in...`, ask before running `market login`.\n";
1
+ export declare const marketSkill = "---\nname: market\ndescription: Find, preview, install, generate, and publish Drawcall Market assets from a coding agent.\n---\n\n# Drawcall Market\n\nRun the CLI as `npx @drawcall/market <command>` \u2014 that form works everywhere, including an ephemeral build sandbox where nothing is installed globally (a bare `market` is on your PATH only after a global install, so do not assume it). Keep commands short and read the summary lines.\n\n## Quick Start\n\n```sh\nnpx @drawcall/market search \"wooden chair\" --type model --limit 3\nnpx @drawcall/market install wooden-chair --cwd \"$PWD\"\nnpx @drawcall/market list --cwd \"$PWD\"\nnpx @drawcall/market preview wooden-chair --out /tmp/wooden-chair.png\nnpx @drawcall/market pack scene.zip --out scene.packed.zip\n```\n\n## Workflow\n\n1. In an existing repo, run `npx @drawcall/market list --cwd \"$PWD\"` first to see installed local assets from `.drawcall/market-lock.json`. Use the listed names with `preview <name>` when you want preview images.\n2. Search first unless the user already gave an exact asset name. `search` requires `--type`; use `model` unless the user names another supported type: `humanoid-model`, `texture`, `humanoid-animation`, `template`, `sound-effect`, `background-music`, `environment`, or `flipbook`.\n3. Use `--limit 1` for lookup, `--limit 3` for choice. Search caps at 5 and prints full descriptions.\n4. `install` takes zero or more exact asset names (optionally `name@range`). With names, it installs those assets; with no names, it installs `assetDependencies` from the nearest `package.json`. It does not search or generate. Find names with `search` first. No `--type` is needed \u2014 asset names are unique. Use `--force` only when the user agrees to overwrite changed local files.\n5. `preview <name>` saves the preview image; no `--type` is needed. Not every type has previews (e.g. `humanoid-animation`, `template`, `sound-effect`, `background-music`); the CLI reports when one is unavailable.\n6. Use `--unapproved` only when the user asks for unapproved/private/admin assets. Do not install unapproved assets without explicit acceptance.\n7. `generate --type <type> \"<prompt>\"` creates and installs a generated asset when that asset type has a generator; it requires login. Currently supported generated types are `sound-effect`, `background-music`, `flipbook`, `humanoid-model`, and `environment` (a fitting HDRI sky + equirectangular background, generated in ~1-2 min). Generation is provider-specific: prompt style, generated files, indexing fields, and install layout are owned by the asset type. If a type does not support generation yet, the CLI reports unsupported generation. Add `--access public` to publish the generated asset publicly, or `--access private` to keep it owner-only; when omitted the server defaults to private if you hold the `market:private` entitlement, else public (`--access private` requires that entitlement). `generate` waits for the asset and installs it \u2014 one command for quick types. For a long one (e.g. `humanoid-model`, >2 min) the call returns after ~2 min with a job id instead of hanging your shell; run `npx @drawcall/market generate install <jobId>` to continue \u2014 it resumes the SAME job where the last call left off and installs when ready. Just re-run `generate install <jobId>` until it prints \"Generated and installed\" (it exits 0 while still generating, 1 on failure). No type is flagged \"slow\" \u2014 anything that outlasts one wait just continues on the next call.\n8. Use `pack <zip>` to create the same Market asset zip that `upload` sends. `pack` runs offline, infers template packing from a root `package.json`, and accepts `--type` only when you need to override that inference. `upload` runs the shared pack step internally, then publishes: `npx @drawcall/market upload <name> <zip> \"<description>\" --type <type>`. Declare dependencies with repeatable flags on either command: `--npm name@range`, `--asset name@range`, `--skill label=source`. Template pack/upload also reads root `package.json.assetDependencies`; `--asset` flags are additive and must not conflict. Template pack/upload omits installed dependency files that still match the installed dependency's canonical content (its file hashes are fetched from the server, not stored locally), so edited local files stay in the template; this omit step needs the API, but simple non-template packs stay offline. A skill source is a `skills add` argument: a whole repo (`owner/repo` or a git URL), a single skill via the full URL form `https://github.com/owner/repo/tree/<branch>/<subpath>` (the `tree/<branch>/<subpath>` shorthand needs the full URL, not `owner/repo`), or a local path to a skill directory inside the zip. Example: `npx @drawcall/market upload my-scene scene.zip \"A scene\" --type model --npm three@^0.178.0 --skill web-design=https://github.com/vercel-labs/agent-skills/tree/main/skills/web-design-guidelines`.\n9. Installed `environment` assets contain `public/environment/<name>.hdr` for Three.js IBL lighting and `public/environment/<name>-background.webp` for the visible equirectangular background. Use `npx @drawcall/market preview` to fetch the preview image separately.\n10. Installed `flipbook` assets contain `public/flipbook/<name>.ktx2`. Render them with `@drawcall/flipbook`'s `Flipbook` class and Three.js `KTX2Loader` for Basis-compressed files; `preview` fetches the middle frame from the flipbook.\n\n## Humanoid animations\n\n`humanoid-animation` assets are single-clip GLBs \u2014 one motion per asset (one idle, one walk-forward, one jump, one attack) on a normalized skeleton that retargets onto any humanoid, whatever its role. A behaving character is therefore a *set* of clips, not one asset: from what the character actually does, budget the clips it needs \u2014 an idle, its locomotion (walk/run, often split by direction: fwd/bwd/left/right), and one clip per distinct action and reaction it performs \u2014 then search for each separately.\n\n`humanoid-model` assets share that same normalized skeleton and are authored to a **consistent real-world scale** \u2014 they come in at roughly the same height as each other. So you do **not** need to rescale one humanoid to match another (player vs. enemy vs. NPC); dropped in as-is they already stand at a consistent size. Avoid the trap of measuring one character's height and scaling others to it \u2014 besides being unnecessary, measuring a rigged/animated character's bounding box is unreliable and produces giants (see the `math` skill on `Box3` and skinned meshes). If you ever do need a deliberate size difference (a boss, a child NPC), apply an explicit chosen multiplier, not a measured one.\n\nSearch one motion per query, named by the motion, because results rank by keyword overlap: a query naming several motions at once is dominated by whichever word matches the most assets and buries the others, so real clips look like a gap when they exist. Names describe the motion, not the character \u2014 so search the motion (`\"walk forward\"`, `\"reload\"`, `\"jump\"`), not the role (`\"player run\"`, `\"boss attack\"`). If a motion finds nothing, retry with synonyms (run/jog/sprint, attack/swing/strike).\n\n## Output\n\nCommands print concise, line-oriented summaries:\n\n```text\nResults: 2/8 query=\"wooden chair\" type=model approval=approved\n- wooden-chair@1.0.0 | model | approved | Low-poly wooden chair\nInstalled:\n- wooden-chair@1.0.0 (asset)\n description: Low-poly wooden chair\n files:\n public/model\n \u2514\u2500 wooden-chair.glb\n- three@^0.178.0 (npm)\n- web-design \u2190 https://github.com/vercel-labs/agent-skills/tree/main/skills/web-design-guidelines (skill)\nInstalled assets: 1\n- wooden-chair@1.0.0 (model)\n files:\n public/model\n \u2514\u2500 wooden-chair.glb\nSaved preview for wooden-chair@1.0.0: /tmp/wooden-chair.png\n```\n\nAssets may also declare `skill` dependencies, installed for you via the `skills` CLI (`skills add`) during `install`. Sources are either a GitHub/git ref or a local path to a skill directory shipped inside the asset. This requires `npx` to be available.\n\nInstalled non-template assets are saved to `package.json.assetDependencies`; templates are scaffolds and are not saved as project asset dependencies. Exact installed versions and file paths are recorded in `.drawcall/market-lock.json`; file content hashes now come from the server (`asset.fileManifest`), not the lock.\n\n`list` is offline: it reads `.drawcall/market-lock.json` from the nearest package root and prints exact installed names, versions, types, and installed file paths.\n\nIf search returns no results, try one broader noun phrase. If a command returns `Error: Not logged in...`, ask before running `npx @drawcall/market login`.\n";
2
2
  //# sourceMappingURL=skill.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"skill.d.ts","sourceRoot":"","sources":["../src/skill.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW,+vQAsEvB,CAAA"}
1
+ {"version":3,"file":"skill.d.ts","sourceRoot":"","sources":["../src/skill.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW,mnRAsEvB,CAAA"}
package/dist/skill.js CHANGED
@@ -5,30 +5,30 @@ description: Find, preview, install, generate, and publish Drawcall Market asset
5
5
 
6
6
  # Drawcall Market
7
7
 
8
- Use the \`market\` CLI. Keep commands short and read the summary lines.
8
+ Run the CLI as \`npx @drawcall/market <command>\` — that form works everywhere, including an ephemeral build sandbox where nothing is installed globally (a bare \`market\` is on your PATH only after a global install, so do not assume it). Keep commands short and read the summary lines.
9
9
 
10
10
  ## Quick Start
11
11
 
12
12
  \`\`\`sh
13
- market search "wooden chair" --type model --limit 3
14
- market install wooden-chair --cwd "$PWD"
15
- market list --cwd "$PWD"
16
- market preview wooden-chair --out /tmp/wooden-chair.png
17
- market pack scene.zip --out scene.packed.zip
13
+ npx @drawcall/market search "wooden chair" --type model --limit 3
14
+ npx @drawcall/market install wooden-chair --cwd "$PWD"
15
+ npx @drawcall/market list --cwd "$PWD"
16
+ npx @drawcall/market preview wooden-chair --out /tmp/wooden-chair.png
17
+ npx @drawcall/market pack scene.zip --out scene.packed.zip
18
18
  \`\`\`
19
19
 
20
20
  ## Workflow
21
21
 
22
- 1. In an existing repo, run \`list --cwd "$PWD"\` first to see installed local assets from \`.drawcall/market-lock.json\`. Use the listed names with \`preview <name>\` when you want preview images.
22
+ 1. In an existing repo, run \`npx @drawcall/market list --cwd "$PWD"\` first to see installed local assets from \`.drawcall/market-lock.json\`. Use the listed names with \`preview <name>\` when you want preview images.
23
23
  2. Search first unless the user already gave an exact asset name. \`search\` requires \`--type\`; use \`model\` unless the user names another supported type: \`humanoid-model\`, \`texture\`, \`humanoid-animation\`, \`template\`, \`sound-effect\`, \`background-music\`, \`environment\`, or \`flipbook\`.
24
24
  3. Use \`--limit 1\` for lookup, \`--limit 3\` for choice. Search caps at 5 and prints full descriptions.
25
25
  4. \`install\` takes zero or more exact asset names (optionally \`name@range\`). With names, it installs those assets; with no names, it installs \`assetDependencies\` from the nearest \`package.json\`. It does not search or generate. Find names with \`search\` first. No \`--type\` is needed — asset names are unique. Use \`--force\` only when the user agrees to overwrite changed local files.
26
26
  5. \`preview <name>\` saves the preview image; no \`--type\` is needed. Not every type has previews (e.g. \`humanoid-animation\`, \`template\`, \`sound-effect\`, \`background-music\`); the CLI reports when one is unavailable.
27
27
  6. Use \`--unapproved\` only when the user asks for unapproved/private/admin assets. Do not install unapproved assets without explicit acceptance.
28
- 7. \`generate --type <type> "<prompt>"\` creates and installs a generated asset when that asset type has a generator; it requires login. Currently supported generated types are \`sound-effect\`, \`background-music\`, \`flipbook\`, \`humanoid-model\`, and \`environment\` (a fitting HDRI sky + equirectangular background, generated in ~1-2 min). Generation is provider-specific: prompt style, generated files, indexing fields, and install layout are owned by the asset type. If a type does not support generation yet, the CLI reports unsupported generation. Add \`--access public\` to publish the generated asset publicly, or \`--access private\` to keep it owner-only; when omitted the server defaults to private if you hold the \`market:private\` entitlement, else public (\`--access private\` requires that entitlement). \`generate\` waits for the asset and installs it — one command for quick types. For a long one (e.g. \`humanoid-model\`, >2 min) the call returns after ~2 min with a job id instead of hanging your shell; run \`market generate install <jobId>\` to continue — it resumes the SAME job where the last call left off and installs when ready. Just re-run \`generate install <jobId>\` until it prints "Generated and installed" (it exits 0 while still generating, 1 on failure). No type is flagged "slow" — anything that outlasts one wait just continues on the next call.
29
- 8. Use \`pack <zip>\` to create the same Market asset zip that \`upload\` sends. \`pack\` runs offline, infers template packing from a root \`package.json\`, and accepts \`--type\` only when you need to override that inference. \`upload\` runs the shared pack step internally, then publishes: \`market upload <name> <zip> "<description>" --type <type>\`. Declare dependencies with repeatable flags on either command: \`--npm name@range\`, \`--asset name@range\`, \`--skill label=source\`. Template pack/upload also reads root \`package.json.assetDependencies\`; \`--asset\` flags are additive and must not conflict. Template pack/upload omits installed dependency files that still match the installed dependency's canonical content (its file hashes are fetched from the server, not stored locally), so edited local files stay in the template; this omit step needs the API, but simple non-template packs stay offline. A skill source is a \`skills add\` argument: a whole repo (\`owner/repo\` or a git URL), a single skill via the full URL form \`https://github.com/owner/repo/tree/<branch>/<subpath>\` (the \`tree/<branch>/<subpath>\` shorthand needs the full URL, not \`owner/repo\`), or a local path to a skill directory inside the zip. Example: \`market upload my-scene scene.zip "A scene" --type model --npm three@^0.178.0 --skill web-design=https://github.com/vercel-labs/agent-skills/tree/main/skills/web-design-guidelines\`.
30
- 9. Installed \`environment\` assets contain \`public/environment/<name>.hdr\` for Three.js IBL lighting and \`public/environment/<name>-background.webp\` for the visible equirectangular background. Use \`market preview\` to fetch the preview image separately.
31
- 10. Installed \`flipbook\` assets contain \`public/flipbook/<name>.ktx2\`. Render them with \`@drawcall/flipbook\`'s \`Flipbook\` class and Three.js \`KTX2Loader\` for Basis-compressed files; \`market preview\` fetches the middle frame from the flipbook.
28
+ 7. \`generate --type <type> "<prompt>"\` creates and installs a generated asset when that asset type has a generator; it requires login. Currently supported generated types are \`sound-effect\`, \`background-music\`, \`flipbook\`, \`humanoid-model\`, and \`environment\` (a fitting HDRI sky + equirectangular background, generated in ~1-2 min). Generation is provider-specific: prompt style, generated files, indexing fields, and install layout are owned by the asset type. If a type does not support generation yet, the CLI reports unsupported generation. Add \`--access public\` to publish the generated asset publicly, or \`--access private\` to keep it owner-only; when omitted the server defaults to private if you hold the \`market:private\` entitlement, else public (\`--access private\` requires that entitlement). \`generate\` waits for the asset and installs it — one command for quick types. For a long one (e.g. \`humanoid-model\`, >2 min) the call returns after ~2 min with a job id instead of hanging your shell; run \`npx @drawcall/market generate install <jobId>\` to continue — it resumes the SAME job where the last call left off and installs when ready. Just re-run \`generate install <jobId>\` until it prints "Generated and installed" (it exits 0 while still generating, 1 on failure). No type is flagged "slow" — anything that outlasts one wait just continues on the next call.
29
+ 8. Use \`pack <zip>\` to create the same Market asset zip that \`upload\` sends. \`pack\` runs offline, infers template packing from a root \`package.json\`, and accepts \`--type\` only when you need to override that inference. \`upload\` runs the shared pack step internally, then publishes: \`npx @drawcall/market upload <name> <zip> "<description>" --type <type>\`. Declare dependencies with repeatable flags on either command: \`--npm name@range\`, \`--asset name@range\`, \`--skill label=source\`. Template pack/upload also reads root \`package.json.assetDependencies\`; \`--asset\` flags are additive and must not conflict. Template pack/upload omits installed dependency files that still match the installed dependency's canonical content (its file hashes are fetched from the server, not stored locally), so edited local files stay in the template; this omit step needs the API, but simple non-template packs stay offline. A skill source is a \`skills add\` argument: a whole repo (\`owner/repo\` or a git URL), a single skill via the full URL form \`https://github.com/owner/repo/tree/<branch>/<subpath>\` (the \`tree/<branch>/<subpath>\` shorthand needs the full URL, not \`owner/repo\`), or a local path to a skill directory inside the zip. Example: \`npx @drawcall/market upload my-scene scene.zip "A scene" --type model --npm three@^0.178.0 --skill web-design=https://github.com/vercel-labs/agent-skills/tree/main/skills/web-design-guidelines\`.
30
+ 9. Installed \`environment\` assets contain \`public/environment/<name>.hdr\` for Three.js IBL lighting and \`public/environment/<name>-background.webp\` for the visible equirectangular background. Use \`npx @drawcall/market preview\` to fetch the preview image separately.
31
+ 10. Installed \`flipbook\` assets contain \`public/flipbook/<name>.ktx2\`. Render them with \`@drawcall/flipbook\`'s \`Flipbook\` class and Three.js \`KTX2Loader\` for Basis-compressed files; \`preview\` fetches the middle frame from the flipbook.
32
32
 
33
33
  ## Humanoid animations
34
34
 
@@ -67,6 +67,6 @@ Installed non-template assets are saved to \`package.json.assetDependencies\`; t
67
67
 
68
68
  \`list\` is offline: it reads \`.drawcall/market-lock.json\` from the nearest package root and prints exact installed names, versions, types, and installed file paths.
69
69
 
70
- If search returns no results, try one broader noun phrase. If a command returns \`Error: Not logged in...\`, ask before running \`market login\`.
70
+ If search returns no results, try one broader noun phrase. If a command returns \`Error: Not logged in...\`, ask before running \`npx @drawcall/market login\`.
71
71
  `;
72
72
  //# sourceMappingURL=skill.js.map
package/package.json CHANGED
@@ -1,42 +1,36 @@
1
1
  {
2
2
  "name": "@drawcall/market",
3
- "version": "0.1.55",
3
+ "version": "0.1.57",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/drawcall-ai/market",
7
7
  "directory": "packages/market"
8
8
  },
9
9
  "type": "module",
10
- "types": "src/index.ts",
10
+ "types": "./dist/index.d.ts",
11
11
  "exports": {
12
- ".": "./src/index.ts",
13
- "./install": "./src/install-entry.ts"
12
+ ".": {
13
+ "types": "./dist/index.d.ts",
14
+ "import": "./dist/index.js"
15
+ },
16
+ "./install": {
17
+ "types": "./dist/install-entry.d.ts",
18
+ "import": "./dist/install-entry.js"
19
+ }
14
20
  },
15
21
  "files": [
16
22
  "dist",
17
23
  "src",
18
24
  "skills"
19
25
  ],
20
- "publishConfig": {
21
- "exports": {
22
- ".": {
23
- "types": "./dist/index.d.ts",
24
- "import": "./dist/index.js"
25
- },
26
- "./install": {
27
- "types": "./dist/install-entry.d.ts",
28
- "import": "./dist/install-entry.js"
29
- }
30
- },
31
- "types": "dist/index.d.ts"
32
- },
33
26
  "bin": {
34
27
  "market": "./dist/cli.js"
35
28
  },
36
29
  "scripts": {
37
30
  "build": "tsc",
31
+ "prepack": "npm run build && node scripts/prepare-publish.mjs",
38
32
  "dev": "tsx src/cli.ts",
39
- "test:install-layout": "tsx --test tests/install-layout.test.ts tests/install-command.test.ts tests/list-command.test.ts tests/pack.test.ts",
33
+ "test:install-layout": "tsx --test tests/install-layout.test.ts tests/install-lock.test.ts tests/install-command.test.ts tests/list-command.test.ts tests/pack.test.ts",
40
34
  "typecheck": "tsc --noEmit"
41
35
  },
42
36
  "dependencies": {
@@ -5,7 +5,7 @@ description: Find, preview, install, generate, and publish Drawcall Market asset
5
5
 
6
6
  # Drawcall Market
7
7
 
8
- Use the `npx @drawcall/market` CLI. Keep commands short and read the summary lines.
8
+ Run the CLI as `npx @drawcall/market <command>` — that form works everywhere, including an ephemeral build sandbox where nothing is installed globally (a bare `market` is on your PATH only after a global install, so do not assume it). Keep commands short and read the summary lines.
9
9
 
10
10
  ## Quick Start
11
11
 
@@ -19,20 +19,20 @@ npx @drawcall/market pack scene.zip --out scene.packed.zip
19
19
 
20
20
  ## Workflow
21
21
 
22
- 1. In an existing repo, run `list --cwd "$PWD"` first to see installed local assets from `.drawcall/market-lock.json`. Use the listed names with `preview <name>` when you want preview images.
22
+ 1. In an existing repo, run `npx @drawcall/market list --cwd "$PWD"` first to see installed local assets from `.drawcall/market-lock.json`. Use the listed names with `preview <name>` when you want preview images.
23
23
  2. Search first unless the user already gave an exact asset name. `search` requires `--type`; use `model` unless the user names another supported type: `humanoid-model`, `texture`, `humanoid-animation`, `template`, `sound-effect`, `background-music`, `environment`, or `flipbook`.
24
24
  3. Use `--limit 1` for lookup, `--limit 3` for choice. Search caps at 5 and prints full descriptions.
25
25
  4. `install` takes zero or more exact asset names (optionally `name@range`). With names, it installs those assets; with no names, it installs `assetDependencies` from the nearest `package.json`. It does not search or generate. Find names with `search` first. No `--type` is needed — asset names are unique. Use `--force` only when the user agrees to overwrite changed local files.
26
26
  5. `preview <name>` saves the preview image; no `--type` is needed. Not every type has previews (e.g. `humanoid-animation`, `template`, `sound-effect`, `background-music`); the CLI reports when one is unavailable.
27
27
  6. Use `--unapproved` only when the user asks for unapproved/private/admin assets. Do not install unapproved assets without explicit acceptance.
28
- 7. `generate --type <type> "<prompt>"` creates and installs a generated asset when that asset type has a generator; it requires login. Currently supported generated types are `sound-effect`, `background-music`, `flipbook`, `humanoid-model`, and `environment` (a fitting HDRI sky + equirectangular background, generated in ~1-2 min). Generation is provider-specific: prompt style, generated files, indexing fields, and install layout are owned by the asset type. If a type does not support generation yet, the CLI reports unsupported generation. Add `--access public` to publish the generated asset publicly, or `--access private` to keep it owner-only; when omitted the server defaults to private if you hold the `market:private` entitlement, else public (`--access private` requires that entitlement). `generate` waits for the asset and installs it — one command for quick types. For a long one (e.g. `humanoid-model`, >2 min) the call returns after ~2 min with a job id instead of hanging your shell; run `market generate install <jobId>` to continue — it resumes the SAME job where the last call left off and installs when ready. Just re-run `generate install <jobId>` until it prints "Generated and installed" (it exits 0 while still generating, 1 on failure). No type is flagged "slow" — anything that outlasts one wait just continues on the next call.
29
- 8. Use `pack <zip>` to create the same Market asset zip that `upload` sends. `pack` runs offline, infers template packing from a root `package.json`, and accepts `--type` only when you need to override that inference. `upload` runs the shared pack step internally, then publishes: `market upload <name> <zip> "<description>" --type <type>`. Declare dependencies with repeatable flags on either command: `--npm name@range`, `--asset name@range`, `--skill label=source`. Use `--access public|private` on upload to set visibility (same default rule as generate): a private asset is visible and installable only by you. Template pack/upload also reads root `package.json.assetDependencies`; `--asset` flags are additive and must not conflict. Template pack/upload omits installed dependency files that still match the installed dependency's canonical content (its file hashes are fetched from the server, not stored locally), so edited local files stay in the template; this omit step needs the API, but simple non-template packs stay offline. A skill source is a `skills add` argument: a whole repo (`owner/repo` or a git URL), a single skill via the full URL form `https://github.com/owner/repo/tree/<branch>/<subpath>` (the `tree/<branch>/<subpath>` shorthand needs the full URL, not `owner/repo`), or a local path to a skill directory inside the zip. Example: `market upload my-scene scene.zip "A scene" --type model --npm three@^0.178.0 --skill web-design=https://github.com/vercel-labs/agent-skills/tree/main/skills/web-design-guidelines`.
30
- 9. Installed `environment` assets contain `public/environment/<name>.hdr` for Three.js IBL lighting and `public/environment/<name>-background.webp` for the visible equirectangular background. Use `market preview` to fetch the preview image separately.
31
- 10. Installed `flipbook` assets contain `public/flipbook/<name>.ktx2`. Render them with `@drawcall/flipbook`'s `Flipbook` class and Three.js `KTX2Loader` for Basis-compressed files; `market preview` fetches the middle frame from the flipbook.
28
+ 7. `generate --type <type> "<prompt>"` creates and installs a generated asset when that asset type has a generator; it requires login. Currently supported generated types are `sound-effect`, `background-music`, `flipbook`, `humanoid-model`, and `environment` (a fitting HDRI sky + equirectangular background, generated in ~1-2 min). Generation is provider-specific: prompt style, generated files, indexing fields, and install layout are owned by the asset type. If a type does not support generation yet, the CLI reports unsupported generation. Add `--access public` to publish the generated asset publicly, or `--access private` to keep it owner-only; when omitted the server defaults to private if you hold the `market:private` entitlement, else public (`--access private` requires that entitlement). `generate` waits for the asset and installs it — one command for quick types. For a long one (e.g. `humanoid-model`, >2 min) the call returns after ~2 min with a job id instead of hanging your shell; run `npx @drawcall/market generate install <jobId>` to continue — it resumes the SAME job where the last call left off and installs when ready. Just re-run `generate install <jobId>` until it prints "Generated and installed" (it exits 0 while still generating, 1 on failure). No type is flagged "slow" — anything that outlasts one wait just continues on the next call.
29
+ 8. Use `pack <zip>` to create the same Market asset zip that `upload` sends. `pack` runs offline, infers template packing from a root `package.json`, and accepts `--type` only when you need to override that inference. `upload` runs the shared pack step internally, then publishes: `npx @drawcall/market upload <name> <zip> "<description>" --type <type>`. Declare dependencies with repeatable flags on either command: `--npm name@range`, `--asset name@range`, `--skill label=source`. Template pack/upload also reads root `package.json.assetDependencies`; `--asset` flags are additive and must not conflict. Template pack/upload omits installed dependency files that still match the installed dependency's canonical content (its file hashes are fetched from the server, not stored locally), so edited local files stay in the template; this omit step needs the API, but simple non-template packs stay offline. A skill source is a `skills add` argument: a whole repo (`owner/repo` or a git URL), a single skill via the full URL form `https://github.com/owner/repo/tree/<branch>/<subpath>` (the `tree/<branch>/<subpath>` shorthand needs the full URL, not `owner/repo`), or a local path to a skill directory inside the zip. Example: `npx @drawcall/market upload my-scene scene.zip "A scene" --type model --npm three@^0.178.0 --skill web-design=https://github.com/vercel-labs/agent-skills/tree/main/skills/web-design-guidelines`.
30
+ 9. Installed `environment` assets contain `public/environment/<name>.hdr` for Three.js IBL lighting and `public/environment/<name>-background.webp` for the visible equirectangular background. Use `npx @drawcall/market preview` to fetch the preview image separately.
31
+ 10. Installed `flipbook` assets contain `public/flipbook/<name>.ktx2`. Render them with `@drawcall/flipbook`'s `Flipbook` class and Three.js `KTX2Loader` for Basis-compressed files; `preview` fetches the middle frame from the flipbook.
32
32
 
33
33
  ## Humanoid animations
34
34
 
35
- `humanoid-animation` assets are single-clip GLBs — one motion per asset (one idle, one walk-forward, one jump, one attack) on a normalized skeleton that retargets onto any humanoid, whatever its role. A behaving character is therefore a _set_ of clips, not one asset: from what the character actually does, budget the clips it needs — an idle, its locomotion (walk/run, often split by direction: fwd/bwd/left/right), and one clip per distinct action and reaction it performs — then search for each separately.
35
+ `humanoid-animation` assets are single-clip GLBs — one motion per asset (one idle, one walk-forward, one jump, one attack) on a normalized skeleton that retargets onto any humanoid, whatever its role. A behaving character is therefore a *set* of clips, not one asset: from what the character actually does, budget the clips it needs — an idle, its locomotion (walk/run, often split by direction: fwd/bwd/left/right), and one clip per distinct action and reaction it performs — then search for each separately.
36
36
 
37
37
  `humanoid-model` assets share that same normalized skeleton and are authored to a **consistent real-world scale** — they come in at roughly the same height as each other. So you do **not** need to rescale one humanoid to match another (player vs. enemy vs. NPC); dropped in as-is they already stand at a consistent size. Avoid the trap of measuring one character's height and scaling others to it — besides being unnecessary, measuring a rigged/animated character's bounding box is unreliable and produces giants (see the `math` skill on `Box3` and skinned meshes). If you ever do need a deliberate size difference (a boss, a child NPC), apply an explicit chosen multiplier, not a measured one.
38
38
 
@@ -67,4 +67,4 @@ Installed non-template assets are saved to `package.json.assetDependencies`; tem
67
67
 
68
68
  `list` is offline: it reads `.drawcall/market-lock.json` from the nearest package root and prints exact installed names, versions, types, and installed file paths.
69
69
 
70
- If search returns no results, try one broader noun phrase. If a command returns `Error: Not logged in...`, ask before running `market login`.
70
+ If search returns no results, try one broader noun phrase. If a command returns `Error: Not logged in...`, ask before running `npx @drawcall/market login`.
@@ -0,0 +1,253 @@
1
+ import { randomUUID } from 'node:crypto'
2
+ import * as fs from 'node:fs/promises'
3
+ import { hostname } from 'node:os'
4
+ import * as path from 'node:path'
5
+
6
+ export const PROJECT_INSTALL_LOCK_PATH = '.drawcall/market-install.lock'
7
+
8
+ const OWNER_FILE = 'owner.json'
9
+ const DEFAULT_TIMEOUT_MS = 30_000
10
+ const DEFAULT_RETRY_DELAY_MS = 50
11
+ const DEFAULT_STALE_MS = 5 * 60_000
12
+
13
+ interface LockOwner {
14
+ token: string
15
+ pid: number
16
+ hostname: string
17
+ createdAtMs: number
18
+ }
19
+
20
+ interface LockSnapshot {
21
+ owner: LockOwner | null
22
+ device: number
23
+ inode: number
24
+ modifiedAtMs: number
25
+ }
26
+
27
+ export interface ProjectInstallLockOptions {
28
+ timeoutMs?: number
29
+ retryDelayMs?: number
30
+ staleMs?: number
31
+ }
32
+
33
+ export async function withProjectInstallLock<T>(
34
+ projectRoot: string,
35
+ task: () => Promise<T>,
36
+ options: ProjectInstallLockOptions = {},
37
+ ): Promise<T> {
38
+ const lockPath = path.join(projectRoot, PROJECT_INSTALL_LOCK_PATH)
39
+ const owner = await acquireLock(lockPath, options)
40
+
41
+ try {
42
+ return await task()
43
+ } finally {
44
+ await releaseLock(lockPath, owner)
45
+ }
46
+ }
47
+
48
+ async function acquireLock(
49
+ lockPath: string,
50
+ options: ProjectInstallLockOptions,
51
+ ): Promise<LockOwner> {
52
+ const timeoutMs = validDuration(options.timeoutMs, DEFAULT_TIMEOUT_MS, 'timeoutMs')
53
+ const retryDelayMs = validDuration(options.retryDelayMs, DEFAULT_RETRY_DELAY_MS, 'retryDelayMs')
54
+ const staleMs = validDuration(options.staleMs, DEFAULT_STALE_MS, 'staleMs')
55
+ const startedAtMs = Date.now()
56
+ const owner = createOwner()
57
+
58
+ await fs.mkdir(path.dirname(lockPath), { recursive: true })
59
+
60
+ while (true) {
61
+ if (await tryCreateLock(lockPath, owner)) return owner
62
+
63
+ const snapshot = await readLockSnapshot(lockPath)
64
+ if (!snapshot) continue
65
+
66
+ if (isStale(snapshot, staleMs) && (await quarantineStaleLock(lockPath, snapshot))) {
67
+ continue
68
+ }
69
+
70
+ const elapsedMs = Date.now() - startedAtMs
71
+ if (elapsedMs >= timeoutMs) {
72
+ throw new Error(lockTimeoutMessage(lockPath, timeoutMs, snapshot.owner))
73
+ }
74
+
75
+ await delay(Math.min(retryDelayMs, timeoutMs - elapsedMs))
76
+ }
77
+ }
78
+
79
+ async function tryCreateLock(lockPath: string, owner: LockOwner): Promise<boolean> {
80
+ // Directory creation is the cross-process compare-and-set: exactly one installer can succeed.
81
+ try {
82
+ await fs.mkdir(lockPath)
83
+ } catch (error) {
84
+ if (hasCode(error, 'EEXIST')) return false
85
+ throw error
86
+ }
87
+
88
+ try {
89
+ await fs.writeFile(path.join(lockPath, OWNER_FILE), JSON.stringify(owner, null, 2) + '\n', {
90
+ flag: 'wx',
91
+ })
92
+ } catch (error) {
93
+ await fs.rm(lockPath, { recursive: true, force: true })
94
+ throw error
95
+ }
96
+
97
+ return true
98
+ }
99
+
100
+ async function releaseLock(lockPath: string, owner: LockOwner): Promise<void> {
101
+ const snapshot = await readLockSnapshot(lockPath)
102
+ if (snapshot?.owner?.token !== owner.token) {
103
+ throw new Error(`Lost ownership of Market install lock at ${lockPath}; refusing to release it.`)
104
+ }
105
+
106
+ const releasedPath = `${lockPath}.released-${owner.token}`
107
+ // Cleanup happens at an owner-specific path, so a successor can acquire the canonical path
108
+ // without being vulnerable to this process deleting its lock.
109
+ await fs.rename(lockPath, releasedPath)
110
+
111
+ const released = await readLockSnapshot(releasedPath)
112
+ if (released?.owner?.token !== owner.token) {
113
+ await restoreLock(releasedPath, lockPath)
114
+ throw new Error(`Market install lock at ${lockPath} changed while it was being released.`)
115
+ }
116
+
117
+ await fs.rm(releasedPath, { recursive: true, force: true })
118
+ }
119
+
120
+ async function quarantineStaleLock(lockPath: string, expected: LockSnapshot): Promise<boolean> {
121
+ const stalePath = `${lockPath}.stale-${randomUUID()}`
122
+
123
+ try {
124
+ await fs.rename(lockPath, stalePath)
125
+ } catch (error) {
126
+ if (hasCode(error, 'ENOENT')) return true
127
+ throw error
128
+ }
129
+
130
+ const quarantined = await readLockSnapshot(stalePath)
131
+ if (!quarantined) return true
132
+
133
+ // Another process may have replaced the stale lock after our read. Inode identity keeps this
134
+ // recovery attempt from deleting that replacement.
135
+ if (
136
+ quarantined.device !== expected.device ||
137
+ quarantined.inode !== expected.inode ||
138
+ quarantined.modifiedAtMs !== expected.modifiedAtMs ||
139
+ quarantined.owner?.token !== expected.owner?.token
140
+ ) {
141
+ await restoreLock(stalePath, lockPath)
142
+ return false
143
+ }
144
+
145
+ await fs.rm(stalePath, { recursive: true, force: true })
146
+ return true
147
+ }
148
+
149
+ async function restoreLock(from: string, to: string): Promise<void> {
150
+ try {
151
+ await fs.rename(from, to)
152
+ } catch (error) {
153
+ throw new Error(`Could not restore Market install lock at ${to}.`, { cause: error })
154
+ }
155
+ }
156
+
157
+ async function readLockSnapshot(lockPath: string): Promise<LockSnapshot | null> {
158
+ let stats
159
+ try {
160
+ stats = await fs.stat(lockPath)
161
+ } catch (error) {
162
+ if (hasCode(error, 'ENOENT')) return null
163
+ throw error
164
+ }
165
+
166
+ return {
167
+ owner: await readOwner(lockPath),
168
+ device: stats.dev,
169
+ inode: stats.ino,
170
+ modifiedAtMs: stats.mtimeMs,
171
+ }
172
+ }
173
+
174
+ async function readOwner(lockPath: string): Promise<LockOwner | null> {
175
+ let value: unknown
176
+ try {
177
+ value = JSON.parse(await fs.readFile(path.join(lockPath, OWNER_FILE), 'utf-8'))
178
+ } catch (error) {
179
+ if (hasCode(error, 'ENOENT') || error instanceof SyntaxError) return null
180
+ throw error
181
+ }
182
+
183
+ if (!isRecord(value)) return null
184
+ if (typeof value.token !== 'string') return null
185
+ if (typeof value.pid !== 'number' || !Number.isSafeInteger(value.pid) || value.pid <= 0)
186
+ return null
187
+ if (typeof value.hostname !== 'string') return null
188
+ if (typeof value.createdAtMs !== 'number' || Number.isNaN(new Date(value.createdAtMs).getTime()))
189
+ return null
190
+
191
+ return {
192
+ token: value.token,
193
+ pid: value.pid,
194
+ hostname: value.hostname,
195
+ createdAtMs: value.createdAtMs,
196
+ }
197
+ }
198
+
199
+ function isStale(snapshot: LockSnapshot, staleMs: number): boolean {
200
+ if (snapshot.owner?.hostname === hostname()) {
201
+ const running = isProcessRunning(snapshot.owner.pid)
202
+ if (running !== null) return !running
203
+ }
204
+
205
+ return Date.now() - snapshot.modifiedAtMs >= staleMs
206
+ }
207
+
208
+ function isProcessRunning(pid: number): boolean | null {
209
+ try {
210
+ process.kill(pid, 0)
211
+ return true
212
+ } catch (error) {
213
+ if (hasCode(error, 'ESRCH')) return false
214
+ if (hasCode(error, 'EPERM')) return true
215
+ return null
216
+ }
217
+ }
218
+
219
+ function createOwner(): LockOwner {
220
+ return {
221
+ token: randomUUID(),
222
+ pid: process.pid,
223
+ hostname: hostname(),
224
+ createdAtMs: Date.now(),
225
+ }
226
+ }
227
+
228
+ function lockTimeoutMessage(lockPath: string, timeoutMs: number, owner: LockOwner | null): string {
229
+ const ownerDescription = owner
230
+ ? ` Owner PID ${owner.pid} on ${owner.hostname} acquired it at ${new Date(owner.createdAtMs).toISOString()}.`
231
+ : ''
232
+ return `Timed out after ${timeoutMs}ms waiting for Market install lock at ${lockPath}.${ownerDescription}`
233
+ }
234
+
235
+ function validDuration(value: number | undefined, fallback: number, name: string): number {
236
+ if (value === undefined) return fallback
237
+ if (!Number.isFinite(value) || value < 0) {
238
+ throw new TypeError(`${name} must be a non-negative finite number.`)
239
+ }
240
+ return value
241
+ }
242
+
243
+ function isRecord(value: unknown): value is Record<string, unknown> {
244
+ return typeof value === 'object' && value !== null && !Array.isArray(value)
245
+ }
246
+
247
+ function hasCode(error: unknown, code: string): boolean {
248
+ return error instanceof Error && 'code' in error && error.code === code
249
+ }
250
+
251
+ function delay(ms: number): Promise<void> {
252
+ return new Promise((resolve) => setTimeout(resolve, ms))
253
+ }
package/src/install.ts CHANGED
@@ -17,6 +17,7 @@ import { unzipSync } from 'fflate'
17
17
  import { detectPackageManager, installDependencies } from 'nypm'
18
18
  import type { MarketClient } from './client.js'
19
19
  import type { AssetInstallMetadata } from './contract.js'
20
+ import { withProjectInstallLock } from './install-lock.js'
20
21
  import { readMarketLock, writeMarketLock } from './market-lock.js'
21
22
  import { parsePackageJson, type PackageJson } from './package-json.js'
22
23
  import type { ResolveResult } from './resolve.js'
@@ -86,11 +87,13 @@ export async function install(
86
87
  log,
87
88
  baseUrl: opts.baseUrl,
88
89
  })
89
- await writeInstalledAssetLock(installRoot, download.assets)
90
- const packageJsonUpdate = await updatePackageJson(resolution, installRoot, {
91
- rootRequests: opts.rootRequests ?? [],
92
- installMetadata: metadata,
93
- packageManagerNeeded: download.wrotePackageJson,
90
+ const packageJsonUpdate = await withProjectInstallLock(installRoot, async () => {
91
+ await writeInstalledAssetLock(installRoot, download.assets)
92
+ return updatePackageJson(resolution, installRoot, {
93
+ rootRequests: opts.rootRequests ?? [],
94
+ installMetadata: metadata,
95
+ packageManagerNeeded: download.wrotePackageJson,
96
+ })
94
97
  })
95
98
  if (packageJsonUpdate.packageManagerNeeded) {
96
99
  await runPackageManagerInstall(installRoot, log)
package/src/skill.ts CHANGED
@@ -5,30 +5,30 @@ description: Find, preview, install, generate, and publish Drawcall Market asset
5
5
 
6
6
  # Drawcall Market
7
7
 
8
- Use the \`market\` CLI. Keep commands short and read the summary lines.
8
+ Run the CLI as \`npx @drawcall/market <command>\` — that form works everywhere, including an ephemeral build sandbox where nothing is installed globally (a bare \`market\` is on your PATH only after a global install, so do not assume it). Keep commands short and read the summary lines.
9
9
 
10
10
  ## Quick Start
11
11
 
12
12
  \`\`\`sh
13
- market search "wooden chair" --type model --limit 3
14
- market install wooden-chair --cwd "$PWD"
15
- market list --cwd "$PWD"
16
- market preview wooden-chair --out /tmp/wooden-chair.png
17
- market pack scene.zip --out scene.packed.zip
13
+ npx @drawcall/market search "wooden chair" --type model --limit 3
14
+ npx @drawcall/market install wooden-chair --cwd "$PWD"
15
+ npx @drawcall/market list --cwd "$PWD"
16
+ npx @drawcall/market preview wooden-chair --out /tmp/wooden-chair.png
17
+ npx @drawcall/market pack scene.zip --out scene.packed.zip
18
18
  \`\`\`
19
19
 
20
20
  ## Workflow
21
21
 
22
- 1. In an existing repo, run \`list --cwd "$PWD"\` first to see installed local assets from \`.drawcall/market-lock.json\`. Use the listed names with \`preview <name>\` when you want preview images.
22
+ 1. In an existing repo, run \`npx @drawcall/market list --cwd "$PWD"\` first to see installed local assets from \`.drawcall/market-lock.json\`. Use the listed names with \`preview <name>\` when you want preview images.
23
23
  2. Search first unless the user already gave an exact asset name. \`search\` requires \`--type\`; use \`model\` unless the user names another supported type: \`humanoid-model\`, \`texture\`, \`humanoid-animation\`, \`template\`, \`sound-effect\`, \`background-music\`, \`environment\`, or \`flipbook\`.
24
24
  3. Use \`--limit 1\` for lookup, \`--limit 3\` for choice. Search caps at 5 and prints full descriptions.
25
25
  4. \`install\` takes zero or more exact asset names (optionally \`name@range\`). With names, it installs those assets; with no names, it installs \`assetDependencies\` from the nearest \`package.json\`. It does not search or generate. Find names with \`search\` first. No \`--type\` is needed — asset names are unique. Use \`--force\` only when the user agrees to overwrite changed local files.
26
26
  5. \`preview <name>\` saves the preview image; no \`--type\` is needed. Not every type has previews (e.g. \`humanoid-animation\`, \`template\`, \`sound-effect\`, \`background-music\`); the CLI reports when one is unavailable.
27
27
  6. Use \`--unapproved\` only when the user asks for unapproved/private/admin assets. Do not install unapproved assets without explicit acceptance.
28
- 7. \`generate --type <type> "<prompt>"\` creates and installs a generated asset when that asset type has a generator; it requires login. Currently supported generated types are \`sound-effect\`, \`background-music\`, \`flipbook\`, \`humanoid-model\`, and \`environment\` (a fitting HDRI sky + equirectangular background, generated in ~1-2 min). Generation is provider-specific: prompt style, generated files, indexing fields, and install layout are owned by the asset type. If a type does not support generation yet, the CLI reports unsupported generation. Add \`--access public\` to publish the generated asset publicly, or \`--access private\` to keep it owner-only; when omitted the server defaults to private if you hold the \`market:private\` entitlement, else public (\`--access private\` requires that entitlement). \`generate\` waits for the asset and installs it — one command for quick types. For a long one (e.g. \`humanoid-model\`, >2 min) the call returns after ~2 min with a job id instead of hanging your shell; run \`market generate install <jobId>\` to continue — it resumes the SAME job where the last call left off and installs when ready. Just re-run \`generate install <jobId>\` until it prints "Generated and installed" (it exits 0 while still generating, 1 on failure). No type is flagged "slow" — anything that outlasts one wait just continues on the next call.
29
- 8. Use \`pack <zip>\` to create the same Market asset zip that \`upload\` sends. \`pack\` runs offline, infers template packing from a root \`package.json\`, and accepts \`--type\` only when you need to override that inference. \`upload\` runs the shared pack step internally, then publishes: \`market upload <name> <zip> "<description>" --type <type>\`. Declare dependencies with repeatable flags on either command: \`--npm name@range\`, \`--asset name@range\`, \`--skill label=source\`. Template pack/upload also reads root \`package.json.assetDependencies\`; \`--asset\` flags are additive and must not conflict. Template pack/upload omits installed dependency files that still match the installed dependency's canonical content (its file hashes are fetched from the server, not stored locally), so edited local files stay in the template; this omit step needs the API, but simple non-template packs stay offline. A skill source is a \`skills add\` argument: a whole repo (\`owner/repo\` or a git URL), a single skill via the full URL form \`https://github.com/owner/repo/tree/<branch>/<subpath>\` (the \`tree/<branch>/<subpath>\` shorthand needs the full URL, not \`owner/repo\`), or a local path to a skill directory inside the zip. Example: \`market upload my-scene scene.zip "A scene" --type model --npm three@^0.178.0 --skill web-design=https://github.com/vercel-labs/agent-skills/tree/main/skills/web-design-guidelines\`.
30
- 9. Installed \`environment\` assets contain \`public/environment/<name>.hdr\` for Three.js IBL lighting and \`public/environment/<name>-background.webp\` for the visible equirectangular background. Use \`market preview\` to fetch the preview image separately.
31
- 10. Installed \`flipbook\` assets contain \`public/flipbook/<name>.ktx2\`. Render them with \`@drawcall/flipbook\`'s \`Flipbook\` class and Three.js \`KTX2Loader\` for Basis-compressed files; \`market preview\` fetches the middle frame from the flipbook.
28
+ 7. \`generate --type <type> "<prompt>"\` creates and installs a generated asset when that asset type has a generator; it requires login. Currently supported generated types are \`sound-effect\`, \`background-music\`, \`flipbook\`, \`humanoid-model\`, and \`environment\` (a fitting HDRI sky + equirectangular background, generated in ~1-2 min). Generation is provider-specific: prompt style, generated files, indexing fields, and install layout are owned by the asset type. If a type does not support generation yet, the CLI reports unsupported generation. Add \`--access public\` to publish the generated asset publicly, or \`--access private\` to keep it owner-only; when omitted the server defaults to private if you hold the \`market:private\` entitlement, else public (\`--access private\` requires that entitlement). \`generate\` waits for the asset and installs it — one command for quick types. For a long one (e.g. \`humanoid-model\`, >2 min) the call returns after ~2 min with a job id instead of hanging your shell; run \`npx @drawcall/market generate install <jobId>\` to continue — it resumes the SAME job where the last call left off and installs when ready. Just re-run \`generate install <jobId>\` until it prints "Generated and installed" (it exits 0 while still generating, 1 on failure). No type is flagged "slow" — anything that outlasts one wait just continues on the next call.
29
+ 8. Use \`pack <zip>\` to create the same Market asset zip that \`upload\` sends. \`pack\` runs offline, infers template packing from a root \`package.json\`, and accepts \`--type\` only when you need to override that inference. \`upload\` runs the shared pack step internally, then publishes: \`npx @drawcall/market upload <name> <zip> "<description>" --type <type>\`. Declare dependencies with repeatable flags on either command: \`--npm name@range\`, \`--asset name@range\`, \`--skill label=source\`. Template pack/upload also reads root \`package.json.assetDependencies\`; \`--asset\` flags are additive and must not conflict. Template pack/upload omits installed dependency files that still match the installed dependency's canonical content (its file hashes are fetched from the server, not stored locally), so edited local files stay in the template; this omit step needs the API, but simple non-template packs stay offline. A skill source is a \`skills add\` argument: a whole repo (\`owner/repo\` or a git URL), a single skill via the full URL form \`https://github.com/owner/repo/tree/<branch>/<subpath>\` (the \`tree/<branch>/<subpath>\` shorthand needs the full URL, not \`owner/repo\`), or a local path to a skill directory inside the zip. Example: \`npx @drawcall/market upload my-scene scene.zip "A scene" --type model --npm three@^0.178.0 --skill web-design=https://github.com/vercel-labs/agent-skills/tree/main/skills/web-design-guidelines\`.
30
+ 9. Installed \`environment\` assets contain \`public/environment/<name>.hdr\` for Three.js IBL lighting and \`public/environment/<name>-background.webp\` for the visible equirectangular background. Use \`npx @drawcall/market preview\` to fetch the preview image separately.
31
+ 10. Installed \`flipbook\` assets contain \`public/flipbook/<name>.ktx2\`. Render them with \`@drawcall/flipbook\`'s \`Flipbook\` class and Three.js \`KTX2Loader\` for Basis-compressed files; \`preview\` fetches the middle frame from the flipbook.
32
32
 
33
33
  ## Humanoid animations
34
34
 
@@ -67,5 +67,5 @@ Installed non-template assets are saved to \`package.json.assetDependencies\`; t
67
67
 
68
68
  \`list\` is offline: it reads \`.drawcall/market-lock.json\` from the nearest package root and prints exact installed names, versions, types, and installed file paths.
69
69
 
70
- If search returns no results, try one broader noun phrase. If a command returns \`Error: Not logged in...\`, ask before running \`market login\`.
70
+ If search returns no results, try one broader noun phrase. If a command returns \`Error: Not logged in...\`, ask before running \`npx @drawcall/market login\`.
71
71
  `