@40rty/ams-cli 0.5.2 → 0.5.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/commands/dev.mjs +1 -1
- package/bin/lib/build.mjs +16 -7
- package/bin/lib/context.mjs +4 -1
- package/dist/wire.js +8 -0
- package/package.json +1 -1
package/bin/commands/dev.mjs
CHANGED
|
@@ -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
|
-
|
|
186
|
-
|
|
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
|
|
189
|
-
|
|
190
|
-
const
|
|
191
|
-
|
|
192
|
-
|
|
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
|
}
|
package/bin/lib/context.mjs
CHANGED
|
@@ -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'
|
|
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
|