@imgly/codesign-mcp 0.1.7 → 0.1.8

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.
Files changed (104) hide show
  1. package/assets/docs/api/index.d.ts +9 -3
  2. package/assets/docs/guide/SKILL.md +2 -2
  3. package/assets/docs/guide/api/node/classes/creativeengine.md +13 -13
  4. package/assets/docs/guide/edit-image/transform/scale.md +1 -3
  5. package/assets/docs/guide/filters-and-effects/duotone.md +1 -1
  6. package/assets/docs/guide/get-started/bun.md +0 -2
  7. package/assets/docs/guide/get-started/deno.md +0 -1
  8. package/assets/docs/guide/get-started/vanilla.md +0 -2
  9. package/assets/docs/guide/import-media/default-assets.md +20 -24
  10. package/assets/docs/guide/plugins/print-ready-pdf.md +0 -2
  11. package/assets/docs/guide/serve-assets.md +80 -23
  12. package/assets/docs/handbook/SKILL.md +6 -7
  13. package/dist/assets/inline.generated.js +12 -12
  14. package/dist/assets/inline.generated.js.map +1 -1
  15. package/dist/cli/http.d.ts.map +1 -1
  16. package/dist/cli/http.js +17 -3
  17. package/dist/cli/http.js.map +1 -1
  18. package/dist/cli/stdio.d.ts.map +1 -1
  19. package/dist/cli/stdio.js +44 -15
  20. package/dist/cli/stdio.js.map +1 -1
  21. package/dist/cli/trial-license.generated.d.ts +1 -1
  22. package/dist/cli/trial-license.generated.js +1 -1
  23. package/dist/cli/trial-license.generated.js.map +1 -1
  24. package/dist/config.d.ts +6 -0
  25. package/dist/config.d.ts.map +1 -1
  26. package/dist/config.js +8 -0
  27. package/dist/config.js.map +1 -1
  28. package/dist/diagnostics/bundle.d.ts +3 -0
  29. package/dist/diagnostics/bundle.d.ts.map +1 -1
  30. package/dist/diagnostics/bundle.js +25 -22
  31. package/dist/diagnostics/bundle.js.map +1 -1
  32. package/dist/diagnostics/prompt.d.ts +3 -0
  33. package/dist/diagnostics/prompt.d.ts.map +1 -0
  34. package/dist/diagnostics/prompt.js +21 -0
  35. package/dist/diagnostics/prompt.js.map +1 -0
  36. package/dist/diagnostics/router.d.ts +12 -0
  37. package/dist/diagnostics/router.d.ts.map +1 -0
  38. package/dist/diagnostics/router.js +64 -0
  39. package/dist/diagnostics/router.js.map +1 -0
  40. package/dist/diagnostics/spa-assets.generated.d.ts +2 -0
  41. package/dist/diagnostics/spa-assets.generated.d.ts.map +1 -0
  42. package/dist/diagnostics/spa-assets.generated.js +1231 -0
  43. package/dist/diagnostics/spa-assets.generated.js.map +1 -0
  44. package/dist/diagnostics/status.d.ts +38 -0
  45. package/dist/diagnostics/status.d.ts.map +1 -0
  46. package/dist/diagnostics/status.js +53 -0
  47. package/dist/diagnostics/status.js.map +1 -0
  48. package/dist/diagnostics/summary.d.ts +48 -0
  49. package/dist/diagnostics/summary.d.ts.map +1 -0
  50. package/dist/diagnostics/summary.js +116 -0
  51. package/dist/diagnostics/summary.js.map +1 -0
  52. package/dist/diagnostics/tool.d.ts +16 -0
  53. package/dist/diagnostics/tool.d.ts.map +1 -0
  54. package/dist/diagnostics/tool.js +90 -0
  55. package/dist/diagnostics/tool.js.map +1 -0
  56. package/dist/engine/asset-sources.d.ts +8 -0
  57. package/dist/engine/asset-sources.d.ts.map +1 -1
  58. package/dist/engine/asset-sources.js +9 -2
  59. package/dist/engine/asset-sources.js.map +1 -1
  60. package/dist/engine/uri-resolver.js.map +1 -1
  61. package/dist/server.d.ts +25 -0
  62. package/dist/server.d.ts.map +1 -1
  63. package/dist/server.js +24 -4
  64. package/dist/server.js.map +1 -1
  65. package/dist/tools/engine.d.ts +79 -14
  66. package/dist/tools/engine.d.ts.map +1 -1
  67. package/dist/tools/engine.js +119 -20
  68. package/dist/tools/engine.js.map +1 -1
  69. package/dist/tools/export.d.ts.map +1 -1
  70. package/dist/tools/export.js +34 -4
  71. package/dist/tools/export.js.map +1 -1
  72. package/dist/tools/index.js +2 -2
  73. package/dist/tools/index.js.map +1 -1
  74. package/dist/tools/load.d.ts.map +1 -1
  75. package/dist/tools/load.js +26 -19
  76. package/dist/tools/load.js.map +1 -1
  77. package/dist/tools/preview.d.ts.map +1 -1
  78. package/dist/tools/preview.js +60 -40
  79. package/dist/tools/preview.js.map +1 -1
  80. package/dist/tools/{open-editor.d.ts → view.d.ts} +3 -3
  81. package/dist/tools/view.d.ts.map +1 -0
  82. package/dist/tools/{open-editor.js → view.js} +20 -18
  83. package/dist/tools/view.js.map +1 -0
  84. package/dist/viewer/listener.d.ts +2 -0
  85. package/dist/viewer/listener.d.ts.map +1 -1
  86. package/dist/viewer/listener.js +2 -0
  87. package/dist/viewer/listener.js.map +1 -1
  88. package/dist/viewer/presigned-r2-url-builder.d.ts +1 -1
  89. package/dist/viewer/presigned-r2-url-builder.js +1 -1
  90. package/dist/viewer/presigned-r2-url-builder.js.map +1 -1
  91. package/dist/viewer/router.d.ts.map +1 -1
  92. package/dist/viewer/router.js +8 -17
  93. package/dist/viewer/router.js.map +1 -1
  94. package/dist/viewer/session-mount.js.map +1 -1
  95. package/dist/viewer/spa-assets.generated.d.ts.map +1 -1
  96. package/dist/viewer/spa-assets.generated.js +750 -869
  97. package/dist/viewer/spa-assets.generated.js.map +1 -1
  98. package/dist/viewer/url-builder.d.ts +4 -3
  99. package/dist/viewer/url-builder.d.ts.map +1 -1
  100. package/dist/viewer/url-builder.js +4 -4
  101. package/dist/viewer/url-builder.js.map +1 -1
  102. package/package.json +6 -5
  103. package/dist/tools/open-editor.d.ts.map +0 -1
  104. package/dist/tools/open-editor.js.map +0 -1
@@ -6884,16 +6884,20 @@ declare class CreativeEngine {
6884
6884
  * - `'ly.img.filter.duotone'` - Color effects of various kinds
6885
6885
  *
6886
6886
  * These assets are parsed at \{\{base_url\}\}/<id>/content.json, where
6887
- * `base_url` defaults to the IMG.LY CDN.
6887
+ * `base_url` defaults to the engine's configured baseURL. For `@cesdk/node`
6888
+ * that is the local package (`file://<pkg>/assets/`), which does not bundle
6889
+ * these sources, so pass a `baseURL` to load them.
6888
6890
  * Each source is created via `addLocalSource` and populated with the parsed assets. To modify the available
6889
6891
  * assets, you may either exclude certain IDs via `excludeAssetSourceIds` or alter the sources after creation.
6890
6892
  *
6893
+ * @deprecated This method uses legacy v4 asset source IDs and will be removed in a future version.
6894
+ * Please migrate to v5 asset sources using engine.asset.addLocalAssetSourceFromJSONURI().
6891
6895
  * @category Asset Sources
6892
6896
  * @param options - Configuration options for loading default asset sources.
6893
6897
  * @returns A promise that resolves when all asset sources are loaded.
6894
6898
  */
6895
6899
  addDefaultAssetSources({ baseURL, excludeAssetSourceIds }?: {
6896
- /** The source of the asset definitions, must be absolute. Defaults to IMG.LY CDN. */
6900
+ /** The source of the asset definitions, must be absolute. Defaults to the engine's configured baseURL. */
6897
6901
  baseURL?: string;
6898
6902
  /** A list of IDs, that will be ignored during load. */
6899
6903
  excludeAssetSourceIds?: DefaultAssetSourceId[];
@@ -6911,12 +6915,14 @@ declare class CreativeEngine {
6911
6915
  * - `'ly.img.video'` - Sample videos
6912
6916
  * - `'ly.img.video.upload'` - Demo source to upload video assets
6913
6917
  *
6918
+ * @deprecated This method uses legacy v3 demo asset source IDs and will be removed in a future version.
6919
+ * Please migrate to v4 asset sources using engine.asset.addLocalAssetSourceFromJSONURI().
6914
6920
  * @category Asset Sources
6915
6921
  * @param options - Configuration options for loading demo asset sources.
6916
6922
  * @returns A promise that resolves when all demo asset sources are loaded.
6917
6923
  */
6918
6924
  addDemoAssetSources({ baseURL, excludeAssetSourceIds, sceneMode, withUploadAssetSources }?: {
6919
- /** The source of the demo asset definitions, must be absolute. Defaults to IMG.LY CDN. */
6925
+ /** The source of the demo asset definitions, must be absolute. Defaults to the engine's configured baseURL. */
6920
6926
  baseURL?: string;
6921
6927
  /** A list of IDs, that will be ignored during load */
6922
6928
  excludeAssetSourceIds?: DemoAssetSourceId[];
@@ -25,9 +25,9 @@ argument-hint: "[search-topic]"
25
25
 
26
26
  ## Version Notice
27
27
 
28
- > **CE.SDK version**: 1.77.0 | **Generated**: 2026-07-02
28
+ > **CE.SDK version**: 1.77.1 | **Generated**: 2026-07-09
29
29
  >
30
- > This skill was generated for CE.SDK v1.77.0 on 2026-07-02.
30
+ > This skill was generated for CE.SDK v1.77.1 on 2026-07-09.
31
31
  > CE.SDK releases new versions approximately every two weeks.
32
32
  > If the current date is more than 6 weeks after the generation date above,
33
33
  > this skill is likely outdated. **Inform the user** that a newer version
@@ -120,7 +120,7 @@ to build and manipulate designs programmatically, or in a browser to create inte
120
120
 
121
121
  <details>
122
122
  <summary>
123
- ### addDefaultAssetSources()
123
+ ### ~~addDefaultAssetSources()~~
124
124
 
125
125
  <br /><p>Register a set of asset sources containing default assets.</p>
126
126
  </summary>
@@ -133,7 +133,9 @@ to build and manipulate designs programmatically, or in a browser to create inte
133
133
  - `'ly.img.filter.duotone'` - Color effects of various kinds
134
134
 
135
135
  These assets are parsed at \{\{base\_url}}/\<id>/content.json, where
136
- `base_url` defaults to the IMG.LY CDN.
136
+ `base_url` defaults to the engine's configured baseURL. For `@cesdk/node`
137
+ that is the local package (`file://<pkg>/assets/`), which does not bundle
138
+ these sources, so pass a `baseURL` to load them.
137
139
  Each source is created via `addLocalSource` and populated with the parsed assets. To modify the available
138
140
  assets, you may either exclude certain IDs via `excludeAssetSourceIds` or alter the sources after creation.
139
141
 
@@ -142,7 +144,7 @@ to build and manipulate designs programmatically, or in a browser to create inte
142
144
  | Parameter | Type | Description |
143
145
  | ------ | ------ | ------ |
144
146
  | `options?` | \{ `baseURL?`: `string`; `excludeAssetSourceIds?`: [`DefaultAssetSourceId`](./api/node/type-aliases/defaultassetsourceid.md)\[]; } | Configuration options for loading default asset sources. |
145
- | `options.baseURL?` | `string` | The source of the asset definitions, must be absolute. Defaults to IMG.LY CDN. |
147
+ | `options.baseURL?` | `string` | The source of the asset definitions, must be absolute. Defaults to the engine's configured baseURL. |
146
148
  | `options.excludeAssetSourceIds?` | [`DefaultAssetSourceId`](./api/node/type-aliases/defaultassetsourceid.md)\[] | A list of IDs, that will be ignored during load. |
147
149
 
148
150
  #### Returns
@@ -151,18 +153,17 @@ to build and manipulate designs programmatically, or in a browser to create inte
151
153
 
152
154
  A promise that resolves when all asset sources are loaded.
153
155
 
154
- #### Signature
156
+ #### Deprecated
155
157
 
156
- ```typescript
157
- addDefaultAssetSources(options?: object): Promise<void>
158
- ```
158
+ This method uses legacy v4 asset source IDs and will be removed in a future version.
159
+ Please migrate to v5 asset sources using engine.asset.addLocalAssetSourceFromJSONURI().
159
160
 
160
161
  ***
161
162
  </details>
162
163
 
163
164
  <details>
164
165
  <summary>
165
- ### addDemoAssetSources()
166
+ ### ~~addDemoAssetSources()~~
166
167
 
167
168
  <br /><p>Register a set of demo asset sources containing example assets.</p>
168
169
  </summary>
@@ -183,7 +184,7 @@ to build and manipulate designs programmatically, or in a browser to create inte
183
184
  | Parameter | Type | Description |
184
185
  | ------ | ------ | ------ |
185
186
  | `options?` | \{ `baseURL?`: `string`; `excludeAssetSourceIds?`: [`DemoAssetSourceId`](./api/node/type-aliases/demoassetsourceid.md)\[]; `sceneMode?`: `"Design"` | `"Video"`; `withUploadAssetSources?`: `boolean`; } | Configuration options for loading demo asset sources. |
186
- | `options.baseURL?` | `string` | The source of the demo asset definitions, must be absolute. Defaults to IMG.LY CDN. |
187
+ | `options.baseURL?` | `string` | The source of the demo asset definitions, must be absolute. Defaults to the engine's configured baseURL. |
187
188
  | `options.excludeAssetSourceIds?` | [`DemoAssetSourceId`](./api/node/type-aliases/demoassetsourceid.md)\[] | A list of IDs, that will be ignored during load |
188
189
  | `options.sceneMode?` | `"Design"` | `"Video"` | If 'Video' video specific demo asset sources will be loaded as well (default 'Design') |
189
190
  | `options.withUploadAssetSources?` | `boolean` | If 'true' asset sources for uploads are added (default false) |
@@ -194,11 +195,10 @@ to build and manipulate designs programmatically, or in a browser to create inte
194
195
 
195
196
  A promise that resolves when all demo asset sources are loaded.
196
197
 
197
- #### Signature
198
+ #### Deprecated
198
199
 
199
- ```typescript
200
- addDemoAssetSources(options?: object): Promise<void>
201
- ```
200
+ This method uses legacy v3 demo asset source IDs and will be removed in a future version.
201
+ Please migrate to v4 asset sources using engine.asset.addLocalAssetSourceFromJSONURI().
202
202
  </details>
203
203
 
204
204
  ## Other
@@ -45,7 +45,6 @@ A value of `2.0`, for example, makes the block twice as large.
45
45
  2. Add credentials to `.env`:
46
46
  ```bash
47
47
  LICENSE_KEY="<your_license_key>"
48
- CESDK_BASE_URL="https://cdn.img.ly/packages/imgly/cesdk-node/1.60.0/assets"
49
48
  ```
50
49
 
51
50
  ````
@@ -59,8 +58,7 @@ A value of `2.0`, for example, makes the block twice as large.
59
58
 
60
59
  async function run() {
61
60
  const engine = await CreativeEngine.init({
62
- license: process.env.LICENSE_KEY,
63
- baseURL: process.env.CESDK_BASE_URL
61
+ license: process.env.LICENSE_KEY
64
62
  });
65
63
 
66
64
  try {
@@ -45,7 +45,7 @@ async function main(): Promise<void> {
45
45
 
46
46
  try {
47
47
  // Load the filter asset source to access duotone presets
48
- const defaultAssetsUrl = `https://cdn.img.ly/packages/imgly/cesdk-node/${CreativeEngine.version}/assets/v4/`;
48
+ const defaultAssetsUrl = engine.getBaseURL();
49
49
  let hasAssetSources = false;
50
50
  try {
51
51
  await engine.asset.addLocalAssetSourceFromJSONURI(
@@ -81,7 +81,6 @@ const { MimeType } = CreativeEngine as any;
81
81
  // Configuration for the engine
82
82
  const config = {
83
83
  // license: 'YOUR_CESDK_LICENSE_KEY', // Replace with your CE.SDK license key
84
- baseURL: `https://cdn.img.ly/packages/imgly/cesdk-node/${CreativeEngine.version}/assets`,
85
84
  };
86
85
 
87
86
  // Initialize CE.SDK Engine
@@ -141,7 +140,6 @@ const { MimeType } = CreativeEngine as any;
141
140
  // Configuration for the engine
142
141
  const config = {
143
142
  // license: 'YOUR_CESDK_LICENSE_KEY', // Replace with your CE.SDK license key
144
- baseURL: `https://cdn.img.ly/packages/imgly/cesdk-node/${CreativeEngine.version}/assets`,
145
143
  };
146
144
 
147
145
  // Initialize CE.SDK Engine
@@ -68,7 +68,6 @@ const { MimeType } = CreativeEngine as any;
68
68
  // CE.SDK configuration
69
69
  const config = {
70
70
  // license: 'YOUR_CESDK_LICENSE_KEY', // Enter your CE.SDK license key
71
- baseURL: `https://cdn.img.ly/packages/imgly/cesdk-node/${CreativeEngine.version}/assets`,
72
71
  };
73
72
 
74
73
  try {
@@ -89,7 +89,6 @@ import CreativeEngine from '@cesdk/node';
89
89
  // Configuration for the engine
90
90
  const config = {
91
91
  // license: 'YOUR_CESDK_LICENSE_KEY', // Replace with your CE.SDK license key
92
- baseURL: `https://cdn.img.ly/packages/imgly/cesdk-node/${CreativeEngine.version}/assets`,
93
92
  };
94
93
 
95
94
  try {
@@ -139,7 +138,6 @@ const { MimeType } = CreativeEngine;
139
138
  // Configuration for the engine
140
139
  const config = {
141
140
  // license: 'YOUR_CESDK_LICENSE_KEY', // Replace with your CE.SDK license key
142
- baseURL: `https://cdn.img.ly/packages/imgly/cesdk-node/${CreativeEngine.version}/assets`,
143
141
  };
144
142
 
145
143
  // Initialize CE.SDK Engine
@@ -25,11 +25,9 @@ async function main(): Promise<void> {
25
25
  });
26
26
 
27
27
  try {
28
- // Versioned CDN URLs using the SDK package (recommended)
29
- // For production, self-host these assets - see the Serve Assets guide
30
- const PACKAGE_BASE = `https://cdn.img.ly/packages/imgly/cesdk-node/${CreativeEngine.version}/assets`;
31
- const DEFAULT_ASSETS_URL = `${PACKAGE_BASE}/v4/`;
32
- const DEMO_ASSETS_URL = `${PACKAGE_BASE}/demo/v3/`;
28
+ // Resolve asset sources from the engine's self-hosted baseURL.
29
+ const DEFAULT_ASSETS_URL = engine.getBaseURL();
30
+ const DEMO_ASSETS_URL = engine.getBaseURL();
33
31
 
34
32
  // Load default asset sources (core editor components)
35
33
  await engine.asset.addLocalAssetSourceFromJSONURI(
@@ -152,7 +150,7 @@ async function main(): Promise<void> {
152
150
  main().catch(console.error);
153
151
  ```
154
152
 
155
- Load all asset sources from IMG.LY's CDN to populate your CE.SDK engine with shapes, stickers, filters, effects, fonts, images, and other media for server-side rendering.
153
+ Register CE.SDK's default asset sources from your self-hosted asset library to populate the engine with shapes, stickers, filters, effects, fonts, images, and other media for server-side rendering.
156
154
 
157
155
  > **Reading time:** 5 minutes
158
156
  >
@@ -164,21 +162,21 @@ Load all asset sources from IMG.LY's CDN to populate your CE.SDK engine with sha
164
162
  >
165
163
  > - [Open in StackBlitz](https://stackblitz.com/github/imgly/cesdk-web-examples/tree/v$UBQ_VERSION$/guides-import-media-default-assets-server-js)
166
164
 
167
- CE.SDK provides built-in asset sources for shapes, stickers, filters, effects, fonts, and sample media. This guide demonstrates loading all available asset sources from IMG.LY's CDN and applying them to create a scene with a star shape, a sticker, and an image, then exporting to PNG.
165
+ CE.SDK provides built-in asset sources for shapes, stickers, filters, effects, fonts, and sample media. This guide demonstrates registering all available asset sources from your self-hosted asset library and applying them to create a scene with a star shape, a sticker, and an image, then exporting to PNG.
168
166
 
169
- > **Production Deployment:** The IMG.LY CDN is for development and prototyping only. For production, download and self-host assets from your own server. See the [Serve Assets](./serve-assets.md) guide for instructions.
167
+ > **Offline-first:** `@cesdk/node` is offline-first and resolves assets from the local package or a location you host it does not fetch the content library from the IMG.LY CDN. Download the asset library once and extract it, then point `baseURL` at it. See the [Serve Assets](./serve-assets.md) guide for instructions.
170
168
 
171
169
  ## What Are Default and Demo Assets?
172
170
 
173
- IMG.LY provides two categories of asset sources hosted on the IMG.LY CDN for development and prototyping:
171
+ CE.SDK ships two categories of asset sources you self-host and register with the engine:
174
172
 
175
173
  **Default Assets** are core editor components:
176
174
 
177
175
  | Source ID | Description |
178
176
  |-----------|-------------|
179
177
  | `ly.img.sticker` | Emojis, emoticons, decorations |
180
- | `ly.img.vectorpath` | Shapes: stars, arrows, polygons |
181
- | `ly.img.colors.defaultPalette` | Default color palette |
178
+ | `ly.img.vector.shape` | Shapes: stars, arrows, polygons |
179
+ | `ly.img.color.palette` | Default color palette |
182
180
  | `ly.img.filter.lut` | LUT-based color filters |
183
181
  | `ly.img.filter.duotone` | Duotone color effects |
184
182
  | `ly.img.effect` | Visual effects |
@@ -201,12 +199,12 @@ IMG.LY provides two categories of asset sources hosted on the IMG.LY CDN for dev
201
199
 
202
200
  ## Loading Assets from URL
203
201
 
204
- Use `addLocalAssetSourceFromJSONURI()` to load an asset source directly from a JSON URL:
202
+ Use `addLocalAssetSourceFromJSONURI()` to register an asset source from its `content.json`. `@cesdk/node` is offline-first: it resolves assets relative to the engine's `baseURL` (your self-hosted assets), so no IMG.LY CDN is used at runtime.
205
203
 
206
204
  ```typescript
207
- const baseURL = `https://cdn.img.ly/packages/imgly/cesdk-node/${CreativeEngine.version}/assets/v4/`;
205
+ const baseURL = engine.getBaseURL();
208
206
  await engine.asset.addLocalAssetSourceFromJSONURI(
209
- `${baseURL}ly.img.vectorpath/content.json`
207
+ `${baseURL}ly.img.vector.shape/content.json`
210
208
  );
211
209
  ```
212
210
 
@@ -221,16 +219,14 @@ const engine = await CreativeEngine.init({
221
219
  });
222
220
  ```
223
221
 
224
- ## Versioned CDN URLs
222
+ ## Point at Your Self-Hosted Assets
225
223
 
226
- Use the SDK version to construct versioned CDN URLs. This ensures assets are compatible with your SDK version. For production deployments, see the [Serve Assets](./serve-assets.md) guide to self-host assets.
224
+ `@cesdk/node` resolves asset sources relative to the engine's `baseURL`. Self-host the asset library (extract `imgly-assets.zip`) and set `baseURL` on init — there is no IMG.LY CDN in the production path. See the [Serve Assets](./serve-assets.md) guide for the download and setup steps.
227
225
 
228
- ```typescript highlight-cdn-urls
229
- // Versioned CDN URLs using the SDK package (recommended)
230
- // For production, self-host these assets - see the Serve Assets guide
231
- const PACKAGE_BASE = `https://cdn.img.ly/packages/imgly/cesdk-node/${CreativeEngine.version}/assets`;
232
- const DEFAULT_ASSETS_URL = `${PACKAGE_BASE}/v4/`;
233
- const DEMO_ASSETS_URL = `${PACKAGE_BASE}/demo/v3/`;
226
+ ```typescript highlight-asset-urls
227
+ // Resolve asset sources from the engine's self-hosted baseURL.
228
+ const DEFAULT_ASSETS_URL = engine.getBaseURL();
229
+ const DEMO_ASSETS_URL = engine.getBaseURL();
234
230
  ```
235
231
 
236
232
  ## Loading Default Asset Sources
@@ -282,11 +278,11 @@ engine.dispose();
282
278
  Use the `matcher` option to load only specific assets from a source:
283
279
 
284
280
  ```typescript
285
- const baseURL = `https://cdn.img.ly/packages/imgly/cesdk-node/${CreativeEngine.version}/assets/v4/`;
281
+ const baseURL = engine.getBaseURL();
286
282
 
287
283
  // Load only star and arrow shapes
288
284
  await engine.asset.addLocalAssetSourceFromJSONURI(
289
- `${baseURL}ly.img.vectorpath/content.json`,
285
+ `${baseURL}ly.img.vector.shape/content.json`,
290
286
  { matcher: ['*star*', '*arrow*'] }
291
287
  );
292
288
 
@@ -200,7 +200,6 @@ async function convertToPrintReady() {
200
200
  // Initialize CE.SDK Engine
201
201
  const engine = await CreativeEngine.init({
202
202
  license: 'YOUR_CESDK_LICENSE_KEY',
203
- baseURL: `https://cdn.img.ly/packages/imgly/cesdk-node/${CreativeEngine.version}/assets`,
204
203
  });
205
204
 
206
205
  // Load scene from file
@@ -328,7 +327,6 @@ import { readdirSync } from 'fs';
328
327
  async function batchConvert() {
329
328
  const engine = await CreativeEngine.init({
330
329
  license: 'YOUR_CESDK_LICENSE_KEY',
331
- baseURL: `https://cdn.img.ly/packages/imgly/cesdk-node/${CreativeEngine.version}/assets`,
332
330
  });
333
331
 
334
332
  // Find all .scene files
@@ -4,35 +4,40 @@
4
4
 
5
5
  ---
6
6
 
7
- Configure CE.SDK to load engine assets from your own servers or local filesystem for server-side deployments.
7
+ Configure CE.SDK to load engine assets from your own servers or local
8
+ filesystem for server-side deployments.
8
9
 
9
- The `@cesdk/node` package bundles the core WASM engine files directly. No additional setup is required to initialize the engine and use its APIs.
10
+ The `@cesdk/node` package bundles the core WASM engine files, font fallback files, and the emoji font directly. No additional setup is required to initialize the engine, render text with full Unicode and emoji coverage, and use its APIs offline.
10
11
 
11
- For rendering-only workflows (loading existing scenes and exporting to PDF, PNG, or video), the engine loads scene-referenced assets directly from their embedded URLs. You only need to configure asset paths if you want to self-host font fallback files or emoji assets.
12
+ `@cesdk/node` is offline-first: the default `baseURL` resolves to the package's own `assets/` directory (`file://<pkg>/assets/`), so the engine boots without reaching the IMG.LY CDN. You only need to configure assets when you register content asset sources (stickers, shapes, typefaces, filters, and so on) or want to serve the bundled core and font assets from your own location.
12
13
 
13
- [Download Assets (v$UBQ\_VERSION$)](https://cdn.img.ly/packages/imgly/cesdk-node/$UBQ_VERSION$/imgly-assets.zip)
14
+ For rendering-only workflows (loading existing scenes and exporting to PDF, PNG, or video), the engine loads scene-referenced assets directly from their embedded URLs. You only need to configure asset paths if you want to serve those assets from your own server or CDN instead of the copies bundled in the package.
14
15
 
15
16
  ## Understanding Asset Categories
16
17
 
17
18
  The `imgly-assets.zip` contains directories organized by function:
18
19
 
19
- | Directory | Contents | Bundled in npm? | When Needed |
20
- | ------------------------------- | ------------------------------- | --------------- | ----------------------------------- |
21
- | `core/` | WASM engine files | **Yes** | Always (bundled) |
22
- | `i18n/` | Translations | **Yes** | Always (bundled) |
23
- | `emoji/` | Emoji assets | No | If rendering emojis |
24
- | `fonts/` | System fonts | No | If using system fonts |
20
+ | Directory | Contents | Bundled in npm? | When Needed |
21
+ | ----------- | --------------------------------------------------------------- | --------------- | ---------------------------- |
22
+ | `core/` | WASM engine files | **Yes** | Always (bundled) |
23
+ | `i18n/` | Translations | **Yes** | Always (bundled) |
24
+ | `emoji/` | Emoji assets | **Yes** | If rendering emojis |
25
+ | `fonts/` | System fonts | **Yes** | If using system fonts |
26
+ | `ly.img.*/` | Content asset sources (stickers, shapes, typefaces, filters, …) | No | If registering asset sources |
25
27
 
26
- > **Note:** Asset source directories (`ly.img.sticker/`, `ly.img.filter/`, etc.) are only used in browser builds. The server package does not use asset source plugins.
28
+ > **Note:** The `ly.img.*` content sources are usable server-side, but they are not
29
+ > bundled in the npm package. To use them, self-host them from the archive and
30
+ > register each with the engine API. The `@cesdk/cesdk-js/plugins` asset-source
31
+ > plugins are editor-only and are not used with `@cesdk/node`.
27
32
 
28
33
  ## Engine-Level Assets
29
34
 
30
- The engine uses additional assets for font fallback (Unicode character coverage) and emoji rendering. By default, these are loaded from `https://cdn.img.ly/assets/v7`. When you configure the `basePath` setting for your engine, font fallback files and the emoji font are automatically loaded from that location:
35
+ The engine uses additional assets for font fallback (Unicode character coverage) and emoji rendering. By default, these load from the `assets/` directory bundled inside the `@cesdk/node` package, so they work offline without reaching the IMG.LY CDN. When you set `baseURL` for your engine, font fallback files and the emoji font are loaded from that location instead:
31
36
 
32
- - **Font fallback files** — Used when text contains characters not covered by the selected font. Located at `{basePath}/fonts/font-{index}.ttf`.
33
- - **Emoji font** — The default emoji font (NotoColorEmoji.ttf). Located at `{basePath}/emoji/NotoColorEmoji.ttf`.
37
+ - **Font fallback files** — Used when text contains characters not covered by the selected font. Located at `{baseURL}/fonts/font-{index}.ttf`.
38
+ - **Emoji font** — The default emoji font (NotoColorEmoji.ttf). Located at `{baseURL}/emoji/NotoColorEmoji.ttf`.
34
39
 
35
- The `fonts/` and `emoji/` directories are already included in the `imgly-assets.zip` download. When you set up self-hosted assets and configure `basePath`, ensure these directories are present at your `basePath` location.
40
+ The `fonts/` and `emoji/` directories ship inside the package and are also included in the `imgly-assets.zip` download. When you self-host and point `baseURL` at your own location, ensure these directories are present there.
36
41
 
37
42
  ## Self-Hosting Assets
38
43
 
@@ -47,7 +52,9 @@ import { pathToFileURL } from 'url';
47
52
 
48
53
  const engine = await CreativeEngine.init({
49
54
  license: 'YOUR_CESDK_LICENSE_KEY',
50
- baseURL: pathToFileURL(path.resolve(`./cesdk-assets/${CreativeEngine.version}`)).href + '/'
55
+ baseURL:
56
+ pathToFileURL(path.resolve(`./cesdk-assets/${CreativeEngine.version}`))
57
+ .href + '/'
51
58
  });
52
59
 
53
60
  // Use the engine for processing
@@ -72,6 +79,52 @@ const engine = await CreativeEngine.init({
72
79
  });
73
80
  ```
74
81
 
82
+ ## Register Asset Sources
83
+
84
+ To use the default content sources (stickers, shapes, typefaces, filters, and so on) server-side, extract the archive, point `baseURL` at it, and register each source you need directly through the engine API. This is the same asset API used in the browser; the `@cesdk/cesdk-js/plugins` asset-source plugins are editor-only and are not used with `@cesdk/node`.
85
+
86
+ [Download Assets (v$UBQ\_VERSION$)](https://cdn.img.ly/packages/imgly/cesdk-node/$UBQ_VERSION$/imgly-assets.zip)
87
+
88
+ Or download and extract it from the command line:
89
+
90
+ ```bash
91
+ # Download and extract the content assets for your SDK version
92
+ curl -O https://cdn.img.ly/packages/imgly/cesdk-node/$UBQ_VERSION$/imgly-assets.zip
93
+ mkdir -p cesdk-assets/$UBQ_VERSION$
94
+ unzip imgly-assets.zip -d cesdk-assets/$UBQ_VERSION$/
95
+ rm imgly-assets.zip
96
+ ```
97
+
98
+ `engine.getBaseURL()` returns the configured base, so you can point each source at its `content.json` relative to it:
99
+
100
+ ```javascript
101
+ import CreativeEngine from '@cesdk/node';
102
+ import path from 'path';
103
+ import { pathToFileURL } from 'url';
104
+
105
+ const engine = await CreativeEngine.init({
106
+ license: 'YOUR_CESDK_LICENSE_KEY',
107
+ baseURL:
108
+ pathToFileURL(path.resolve(`./cesdk-assets/${CreativeEngine.version}`))
109
+ .href + '/'
110
+ });
111
+
112
+ const baseURL = engine.getBaseURL();
113
+
114
+ for (const sourceId of [
115
+ 'ly.img.sticker',
116
+ 'ly.img.vector.shape',
117
+ 'ly.img.typeface',
118
+ 'ly.img.filter'
119
+ ]) {
120
+ await engine.asset.addLocalAssetSourceFromJSONURI(
121
+ `${baseURL}${sourceId}/content.json`
122
+ );
123
+ }
124
+ ```
125
+
126
+ Point `baseURL` at a `file://` path for local hosting or at your own CDN. For the full list of source IDs and matcher filtering, see the [Default Assets](./import-media/default-assets.md) guide.
127
+
75
128
  ## Troubleshooting
76
129
 
77
130
  ### File URL Formatting
@@ -82,16 +135,20 @@ When using `file://` URLs:
82
135
  - URLs must end with a trailing slash for directories
83
136
  - Always use `pathToFileURL()` from the `url` module instead of string concatenation
84
137
 
85
- > **Caution:** **License validation requires network access**: The engine validates your license key against `api.img.ly` during initialization. Ensure your server environment allows outbound HTTPS connections to this endpoint.
138
+ > **Caution:** **License validation requires network access**: The engine validates your
139
+ > license key against `api.img.ly` during initialization. Ensure your server
140
+ > environment allows outbound HTTPS connections to this endpoint.
86
141
 
87
142
  ## API Reference
88
143
 
89
- | Method/Config | Purpose |
90
- |--------------|---------|
91
- | `CreativeEngine.init(config)` | Initialize engine with configuration |
92
- | `engine.editor.setSettingString('basePath', url)` | Set base path for resolving relative paths and loading font/emoji assets |
93
- | `CreativeEngine.version` | Get current SDK version string |
94
- | `pathToFileURL(path)` | Convert filesystem path to `file://` URL (Node.js `url` module) |
144
+ | Method/Config | Purpose |
145
+ | ------------------------------------------------------------------- | ----------------------------------------------------------------------- |
146
+ | `CreativeEngine.init(config)` | Initialize engine with configuration |
147
+ | `config.baseURL` | Base path for engine and content assets (defaults to the local package) |
148
+ | `engine.getBaseURL()` | Return the configured base URL |
149
+ | `engine.asset.addLocalAssetSourceFromJSONURI(contentURI, options?)` | Register a content asset source from its `content.json` |
150
+ | `CreativeEngine.version` | Get current SDK version string |
151
+ | `pathToFileURL(path)` | Convert filesystem path to `file://` URL (Node.js `url` module) |
95
152
 
96
153
 
97
154
 
@@ -66,11 +66,11 @@ Return: the FIRST content part is `text` containing JSON `{ revision, parent }`.
66
66
 
67
67
  **Dirty-on-throw:** if your `code` throws, the engine slot is marked dirty. The next `edit` pays one engine reload (regardless of `parent`). Don't catch and swallow errors that should propagate — let them throw so the safety contract kicks in.
68
68
 
69
- ### `preview({ blockId, revision?, format?, width?, height? })`
69
+ ### `preview({ blockId, revision, format?, width?, height? })`
70
70
 
71
- Render a block (almost always a page) to an inline image so you can see the result. `blockId` is REQUIRED — preview the page you're working on, not the scene root.
71
+ Render a block (almost always a page) to an inline image so you can see the result. `blockId` and `revision` are BOTH REQUIRED — preview the page you're working on (not the scene root), and pass the `revision` it belongs to.
72
72
 
73
- - Optional `revision`: load that revision into the engine before rendering. Without it, renders the engine's current state (almost always what you want directly after `edit`).
73
+ - `revision` is loaded before rendering, so `blockId` always resolves against the right scene never against a different design another agent may have loaded on a shared server. Pass the `revision` you got back from `edit` (or one from `list` / `history`).
74
74
  - Defaults: `format="webp"`, `width=512`. Width/height clamped at 1800 px.
75
75
 
76
76
  ### `export({ target, format, revision, blockId })`
@@ -119,13 +119,12 @@ Workspace tools. `list` returns every design's `{ rootRevision, title, latestLea
119
119
 
120
120
  ⚠ Past code (from `inspect`) reveals the **pattern** of an edit — which APIs were called, what kind of block was targeted — **not block ids**. Block ids are session-scoped: id `127` in a past edit is not the same block in your engine session. Use past code as a discovery template (e.g. `getChildren(page).find(b => engine.block.getType(b) === '...')`); never replay literal numeric ids.
121
121
 
122
- ### `open_editor({ revision?, pin? })`
122
+ ### `view({ revision, pin? })`
123
123
 
124
- Returns a URL the human can open to view the design in CE.SDK.
124
+ Returns a URL the human can open to view the design in CE.SDK. `revision` is required.
125
125
 
126
126
  - **`revision`** → the design's **stable URL**. The viewer keeps it live, re-rendering as you `edit` — so print it **once**, don't paste a fresh URL every turn.
127
- - **`revision` + `pin: true`** → a frozen permalink to that exact revision, for pointing at one specific state (e.g. comparing two revisions side by side). `pin` has no effect without `revision`.
128
- - **no arguments** → the workspace landing page (mini-studio).
127
+ - **`revision` + `pin: true`** → a frozen permalink to that exact revision, for pointing at one specific state (e.g. comparing two revisions side by side).
129
128
 
130
129
  The viewer is **read-only** — the human's edits there are local and discarded on your next `edit`. They look, you write.
131
130