@40rty/ams-cli 0.5.2 → 0.5.3

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.
@@ -23,7 +23,7 @@ export async function dev() {
23
23
  if ((await readConfigIfPresent()) === null) await init();
24
24
  const config = await readConfig();
25
25
 
26
- const files = [config.catalog, config.manifests];
26
+ const files = [config.catalog, ...(Array.isArray(config.manifests) ? config.manifests : [config.manifests])];
27
27
  if (config.bundle !== undefined) files.push(path.dirname(config.bundle.entry));
28
28
  if (config.bundle !== undefined && typeof config.bundle.css === 'string') files.push(config.bundle.css);
29
29
  if (typeof config.seedLayout === 'string') files.push(config.seedLayout);
package/bin/lib/build.mjs CHANGED
@@ -182,14 +182,23 @@ function bundleAssets(outputs) {
182
182
  return assets;
183
183
  }
184
184
 
185
- export async function loadManifests(dir) {
186
- const root = path.resolve(cwd, dir);
185
+ /**
186
+ * The manifests a release carries, as `catalogs/<rel>.md`. `dirs` is one folder
187
+ * or several, in priority order: the brand's own first, then a kit it declares
188
+ * types from (`node_modules/@40rty/ams-ui/dist/conversation/manifests`). The
189
+ * first folder that has a file wins it — the same layering a brand in the
190
+ * platform's repository gets from `layerCatalogsFileAccess`.
191
+ */
192
+ export async function loadManifests(dirs) {
187
193
  const out = {};
188
- for (const entry of await readdir(root, { recursive: true, withFileTypes: true })) {
189
- if (!entry.isFile() || !entry.name.endsWith('.md')) continue;
190
- const abs = path.join(entry.parentPath, entry.name);
191
- const rel = path.relative(root, abs).split(path.sep).join('/');
192
- out[`catalogs/${rel}`] = await readFile(abs, 'utf8');
194
+ for (const dir of (Array.isArray(dirs) ? dirs : [dirs])) {
195
+ const root = path.resolve(cwd, dir);
196
+ for (const entry of await readdir(root, { recursive: true, withFileTypes: true })) {
197
+ if (!entry.isFile() || !entry.name.endsWith('.md')) continue;
198
+ const abs = path.join(entry.parentPath, entry.name);
199
+ const key = `catalogs/${path.relative(root, abs).split(path.sep).join('/')}`;
200
+ if (!(key in out)) out[key] = await readFile(abs, 'utf8');
201
+ }
193
202
  }
194
203
  return out;
195
204
  }
@@ -44,9 +44,12 @@ export async function readConfig() {
44
44
  // Slugs are per deployment too: `FORTY_SPACE` names this repo's space on the one `FORTY_API_URL` points at.
45
45
  const space = fromEnv('FORTY_SPACE');
46
46
  if (space !== undefined) config.spaceSlug = space;
47
- for (const key of ['apiUrl', 'spaceSlug', 'sourceId', 'label', 'catalog', 'manifests']) {
47
+ for (const key of ['apiUrl', 'spaceSlug', 'sourceId', 'label', 'catalog']) {
48
48
  if (typeof config[key] !== 'string' || config[key] === '') fail(`${CONFIG_FILE} is missing "${key}"`);
49
49
  }
50
+ // One manifests folder, or several in priority order (the brand's own first).
51
+ const manifests = Array.isArray(config.manifests) ? config.manifests : [config.manifests];
52
+ if (manifests.length === 0 || manifests.some((dir) => typeof dir !== 'string' || dir === '')) fail(`${CONFIG_FILE} is missing "manifests"`);
50
53
  return config;
51
54
  }
52
55
 
package/dist/wire.js CHANGED
@@ -387,6 +387,14 @@ var CartAddSignalPayloadSchema = z10.object({
387
387
  quantity: z10.number().optional(),
388
388
  selections: z10.record(z10.string()).optional(),
389
389
  optimisticLine: z10.unknown().optional(),
390
+ /**
391
+ * The agent turn whose canvas element the add came from — stamped by the sdk
392
+ * session hooks for a producer inside a turn (`turn-attributed-session.ts`),
393
+ * absent for one outside any (the agent's own add, the header cart, WebMCP).
394
+ * Carried for the same reason as `origin`: the handler that emits the outcome
395
+ * sees only this payload.
396
+ */
397
+ turnId: z10.string().min(1).optional(),
390
398
  /**
391
399
  * Whether a LANDED add announces itself by opening the cart drawer on the
392
400
  * changed line. Absent means yes, which is every existing producer's
package/package.json CHANGED
@@ -15,7 +15,7 @@
15
15
  "peerDependencies": {
16
16
  "zod": "^3.25.0"
17
17
  },
18
- "version": "0.5.2",
18
+ "version": "0.5.3",
19
19
  "homepage": "https://docs.40rty.ai",
20
20
  "license": "UNLICENSED",
21
21
  "engines": {