@synap-core/workspace-templates 0.56.0 → 0.57.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/validate.ts CHANGED
@@ -57,7 +57,7 @@ import type {
57
57
  // eslint-disable-next-line import/extensions -- .ts extension is intentional; see header.
58
58
  import { validateFlowDefinition } from "./validate-flow.ts";
59
59
  // eslint-disable-next-line import/extensions -- .ts extension is intentional; see header.
60
- import { INTENT_LABEL_MAX, START_EXAMPLE_RANGE, START_STARTERS_RANGE, START_VIEWS_MAX, startProfileOf } from "./types.ts";
60
+ import { INTENT_LABEL_MAX, START_EXAMPLE_RANGE, START_STARTERS_RANGE, START_VIEWS_MAX, TEMPLATE_KIND_AS, startProfileOf } from "./types.ts";
61
61
 
62
62
  import {
63
63
  CAPABILITY_INTENTS,
@@ -635,7 +635,7 @@ export const MAX_SESSION_CRITERIA = 12;
635
635
  * (rootDir is `src`). `schema/mirror.tripwire.test.ts` pins the two equal,
636
636
  * and both to the pod's `playbookActivatorSchema`.
637
637
  */
638
- export const TEMPLATE_ACTIVATOR_ON = ["created", "enters_status", "count", "schedule", "manual"] as const;
638
+ export const TEMPLATE_ACTIVATOR_ON = ["created", "enters_status", "count", "schedule", "manual", "run_ended"] as const;
639
639
 
640
640
  /**
641
641
  * Does a stage's goal NAME the move into `value` — the status value or its
@@ -1289,6 +1289,8 @@ function checkKanbanGrouping(
1289
1289
  * - each produced profile DECLARES a lifecycle (in one of those
1290
1290
  * declarations) — a home counts things by lifecycle category, and a kind
1291
1291
  * without one cannot be counted;
1292
+ * - an entry's `as` is `output` (default) or `helper`, and the primary is
1293
+ * never a helper (`intent-primary-helper`);
1292
1294
  * - only a template that OWNS a space declares it (never an overlay or a
1293
1295
  * pack — `ownsNoWorkspace`).
1294
1296
  * The dependency half needs the closure: a profile neither own nor reachable
@@ -1368,6 +1370,15 @@ function checkIntent(
1368
1370
  }
1369
1371
  if (seen.has(slug)) add("intent-duplicate", `${at}.profile`, `"${slug}" is produced twice`);
1370
1372
  seen.add(slug);
1373
+ const as = (entry as { as?: unknown }).as;
1374
+ if (as !== undefined && !(TEMPLATE_KIND_AS as readonly unknown[]).includes(as))
1375
+ add("intent-shape", `${at}.as`, `${at}.as must be one of ${TEMPLATE_KIND_AS.join(", ")} (got ${JSON.stringify(as)})`);
1376
+ if (as === "helper" && slug === primary)
1377
+ add(
1378
+ "intent-primary-helper",
1379
+ `${at}.as`,
1380
+ `"${slug}" is the space's primary output and cannot be a helper — a helper is worked to serve an output, it is not one`
1381
+ );
1371
1382
  const decls = sources.flatMap((t) => (t.profiles ?? []).filter((p) => p.slug === slug));
1372
1383
  if (decls.length === 0) {
1373
1384
  if (!unresolved)