@wairon/cli 5.0.2-dev.14 → 5.0.2-dev.16

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/dist/index.js CHANGED
@@ -148,7 +148,7 @@ var init_domain = __esm({
148
148
  });
149
149
 
150
150
  // src/models/project.ts
151
- var import_zod3, BuiltinTargetConfigSchema, CustomTargetConfigSchema, TargetConfigSchema, NamingRuleConfigSchema, DocumentationRuleConfigSchema, ComplexityRuleConfigSchema, DesignDepthSchema, RulesConfigSchema, PathsConfigSchema, ProjectConfigSchema;
151
+ var import_zod3, BuiltinTargetConfigSchema, CustomTargetConfigSchema, TargetConfigSchema, NamingRuleConfigSchema, DocumentationRuleConfigSchema, ComplexityRuleConfigSchema, DesignDepthSchema, RulesConfigSchema, PathsConfigSchema, ProfileSelectionSubjectSchema, ProjectProfileSelectionSchema, ProjectConfigSchema;
152
152
  var init_project = __esm({
153
153
  "src/models/project.ts"() {
154
154
  "use strict";
@@ -272,6 +272,24 @@ var init_project = __esm({
272
272
  /** Base directory containing SDD specification files, relative to project root */
273
273
  specsDir: import_zod3.z.string().default(".wai/specs")
274
274
  });
275
+ ProfileSelectionSubjectSchema = import_zod3.z.object({
276
+ userId: import_zod3.z.string(),
277
+ kind: import_zod3.z.string(),
278
+ issuer: import_zod3.z.string(),
279
+ externalSubject: import_zod3.z.string().optional(),
280
+ displayName: import_zod3.z.string().optional(),
281
+ email: import_zod3.z.string().optional()
282
+ });
283
+ ProjectProfileSelectionSchema = import_zod3.z.object({
284
+ /** Selected architectural profile ids. The first resolvable one is applied as projectType. */
285
+ profileIds: import_zod3.z.array(import_zod3.z.string()).default([]),
286
+ /** Pack names the governing policy requires for this project. */
287
+ requiredPackNames: import_zod3.z.array(import_zod3.z.string()).default([]),
288
+ /** Pack names applied by default unless explicitly overridden. */
289
+ defaultPackNames: import_zod3.z.array(import_zod3.z.string()).optional(),
290
+ selectedBy: ProfileSelectionSubjectSchema.optional(),
291
+ selectedAt: import_zod3.z.string()
292
+ });
275
293
  ProjectConfigSchema = import_zod3.z.object({
276
294
  /**
277
295
  * Schema version — used to detect incompatible config formats in future
@@ -312,6 +330,13 @@ var init_project = __esm({
312
330
  useGlobalPacks: import_zod3.z.boolean().default(true)
313
331
  }).optional(),
314
332
  paths: PathsConfigSchema.default({}),
333
+ /**
334
+ * The profile/pack selection a hosted policy workflow applied to this project.
335
+ * The RECORD of what was chosen; `projectType` above is what actually governs
336
+ * validation. Modeled so the parse/write round trip preserves it (see
337
+ * ProjectProfileSelectionSchema).
338
+ */
339
+ profileSelection: ProjectProfileSelectionSchema.optional(),
315
340
  /**
316
341
  * Path to a directory containing org/user-level default templates.
317
342
  * Resolved before built-in templates but after project-local templates.
@@ -6662,7 +6687,7 @@ var init_extensions = __esm({
6662
6687
  });
6663
6688
 
6664
6689
  // src/core/rules/types.ts
6665
- var BUILTIN_PROFILES;
6690
+ var BUILTIN_PROFILES, PROJECT_KINDS;
6666
6691
  var init_types = __esm({
6667
6692
  "src/core/rules/types.ts"() {
6668
6693
  "use strict";
@@ -6675,6 +6700,7 @@ var init_types = __esm({
6675
6700
  "realtime-embedded",
6676
6701
  "plc-cyclic"
6677
6702
  ];
6703
+ PROJECT_KINDS = ["fullstack", "system-of-systems", "monorepo"];
6678
6704
  }
6679
6705
  });
6680
6706
 
@@ -7339,11 +7365,15 @@ function projectSubsystemSurface(subsystemId) {
7339
7365
  const interfaces = loadInterfaceSpecs();
7340
7366
  const types = loadTypeSpecs();
7341
7367
  const entries = [];
7368
+ const unprojectable = [];
7342
7369
  for (const pub of target.publicInterfaces ?? []) {
7343
7370
  if (!pub.component) continue;
7344
7371
  const comp = components.find((c) => c.id === pub.component || c.id === `${subsystemId}::${pub.component}`);
7345
7372
  if (!comp) continue;
7346
- if (comp.componentType !== "Portal") continue;
7373
+ if (!CROSS_BOUNDARY_TARGETS.has(comp.componentType)) {
7374
+ unprojectable.push({ component: pub.component, componentType: comp.componentType });
7375
+ continue;
7376
+ }
7347
7377
  const compInterfaces = interfaces.filter((i) => i.component === comp.id && (!pub.interface || i.id === pub.interface || i.id === `${subsystemId}::${pub.interface}`));
7348
7378
  const methods = compInterfaces.flatMap((i) => i.methods);
7349
7379
  entries.push({
@@ -7357,13 +7387,18 @@ function projectSubsystemSurface(subsystemId) {
7357
7387
  component: localName(comp.id),
7358
7388
  methods,
7359
7389
  ...comp.dispatch && comp.dispatch.length ? { dispatch: comp.dispatch } : {},
7360
- // Project the backing Portal's auth + basePath so the codec can emit
7390
+ // Project the backing component's auth + basePath so the codec can emit
7361
7391
  // OpenAPI security + per-portal servers self-contained from the snapshot.
7362
7392
  ...comp.auth && comp.auth.scheme !== "none" ? { auth: comp.auth } : {},
7363
7393
  ...comp.basePath ? { basePath: comp.basePath } : {},
7364
7394
  details: pub.details ?? ""
7365
7395
  });
7366
7396
  }
7397
+ for (const skipped of unprojectable) {
7398
+ console.error(
7399
+ `[surfaces] skipped "${subsystemId}::${skipped.component}": a published ${skipped.componentType} can never serve a cross-boundary caller, so it stays out of every chained child's sibling surface \u2014 publish this surface through a Portal, a Gateway, or an Observer (for events).`
7400
+ );
7401
+ }
7367
7402
  return SurfaceSnapshotSchema.parse({
7368
7403
  projectName: `${system.name}::${subsystemId}`,
7369
7404
  origin: "generated",
@@ -7564,7 +7599,7 @@ function checkChildSurfaceFreshness(rootDir = getProjectRoot()) {
7564
7599
  }
7565
7600
  return issues;
7566
7601
  }
7567
- var fs4, path5, SURFACES_DIRNAME;
7602
+ var fs4, path5, SURFACES_DIRNAME, CROSS_BOUNDARY_TARGETS;
7568
7603
  var init_surfaces = __esm({
7569
7604
  "src/core/surfaces.ts"() {
7570
7605
  "use strict";
@@ -7579,6 +7614,7 @@ var init_surfaces = __esm({
7579
7614
  init_type_analysis();
7580
7615
  init_openapi();
7581
7616
  SURFACES_DIRNAME = "surfaces";
7617
+ CROSS_BOUNDARY_TARGETS = /* @__PURE__ */ new Set(["Portal", "Gateway", "Observer"]);
7582
7618
  }
7583
7619
  });
7584
7620
 
@@ -9884,14 +9920,14 @@ var init_declarative_assertions = __esm({
9884
9920
  });
9885
9921
 
9886
9922
  // src/core/rules/profiles.ts
9887
- var BACKEND_LIKE, FRONTEND_LIKE, PROJECT_KINDS, profilesRule;
9923
+ var BACKEND_LIKE, FRONTEND_LIKE, PROJECT_KINDS2, profilesRule;
9888
9924
  var init_profiles = __esm({
9889
9925
  "src/core/rules/profiles.ts"() {
9890
9926
  "use strict";
9891
9927
  init_types();
9892
9928
  BACKEND_LIKE = /* @__PURE__ */ new Set(["backend", "lowlevel-os", "game-ecs", "realtime-embedded", "plc-cyclic"]);
9893
9929
  FRONTEND_LIKE = /* @__PURE__ */ new Set(["frontend-reactive", "frontend-controller"]);
9894
- PROJECT_KINDS = /* @__PURE__ */ new Set(["fullstack", "system-of-systems", "monorepo"]);
9930
+ PROJECT_KINDS2 = new Set(PROJECT_KINDS);
9895
9931
  profilesRule = {
9896
9932
  name: "architectural-profiles",
9897
9933
  description: "Per-profile stereotype constraints: View/FeatureComponent/RouterComponent only in frontend profiles; Actor/Supervisor forbidden in plc-cyclic (single scan cycle); Actor/Supervisor in frontend profiles warned. Extension packs may register custom profiles (family + forbidden/discouraged stereotype lists); unknown profile names are flagged.",
@@ -9915,7 +9951,7 @@ var init_profiles = __esm({
9915
9951
  );
9916
9952
  }
9917
9953
  }
9918
- if (!registered.has(ctx.projectType) && !PROJECT_KINDS.has(ctx.projectType)) {
9954
+ if (!registered.has(ctx.projectType) && !PROJECT_KINDS2.has(ctx.projectType)) {
9919
9955
  ctx.addIssue(
9920
9956
  "warning",
9921
9957
  "UNKNOWN_PROFILE",
@@ -16236,6 +16272,7 @@ __export(src_exports, {
16236
16272
  OutputTargetSchema: () => OutputTargetSchema,
16237
16273
  PACK_DIR_ENTRIES: () => PACK_DIR_ENTRIES,
16238
16274
  PATTERN_TYPES: () => PATTERN_TYPES,
16275
+ PROJECT_KINDS: () => PROJECT_KINDS,
16239
16276
  PackAssertionSchema: () => PackAssertionSchema,
16240
16277
  PackSkillSchema: () => PackSkillSchema,
16241
16278
  ParallelBranchSchema: () => ParallelBranchSchema,
@@ -16246,8 +16283,10 @@ __export(src_exports, {
16246
16283
  PortalAuthSchemeSchema: () => PortalAuthSchemeSchema,
16247
16284
  PortalTypeSchema: () => PortalTypeSchema,
16248
16285
  ProfileDefSchema: () => ProfileDefSchema,
16286
+ ProfileSelectionSubjectSchema: () => ProfileSelectionSubjectSchema,
16249
16287
  ProjectConfigSchema: () => ProjectConfigSchema,
16250
16288
  ProjectNotInitializedError: () => ProjectNotInitializedError,
16289
+ ProjectProfileSelectionSchema: () => ProjectProfileSelectionSchema,
16251
16290
  PublicInterfaceSchema: () => PublicInterfaceSchema,
16252
16291
  PublicInterfaceTypeSchema: () => PublicInterfaceTypeSchema,
16253
16292
  RegistrySchema: () => RegistrySchema,
@@ -16504,7 +16543,7 @@ function defaultTargetConfig(type) {
16504
16543
  enabled: true
16505
16544
  };
16506
16545
  }
16507
- var WAIRON_VERSION = "5.0.2-dev.14";
16546
+ var WAIRON_VERSION = "5.0.2-dev.16";
16508
16547
  var GITHUB_REPO = "SYW-Apps/Waffle-AIron";
16509
16548
  var ARCHITECT_AGENT_ID = "agent-architect";
16510
16549
  var ARCHITECT_TEMPLATE_ID = "architect";
@@ -17828,6 +17867,7 @@ init_yaml();
17828
17867
  OutputTargetSchema,
17829
17868
  PACK_DIR_ENTRIES,
17830
17869
  PATTERN_TYPES,
17870
+ PROJECT_KINDS,
17831
17871
  PackAssertionSchema,
17832
17872
  PackSkillSchema,
17833
17873
  ParallelBranchSchema,
@@ -17838,8 +17878,10 @@ init_yaml();
17838
17878
  PortalAuthSchemeSchema,
17839
17879
  PortalTypeSchema,
17840
17880
  ProfileDefSchema,
17881
+ ProfileSelectionSubjectSchema,
17841
17882
  ProjectConfigSchema,
17842
17883
  ProjectNotInitializedError,
17884
+ ProjectProfileSelectionSchema,
17843
17885
  PublicInterfaceSchema,
17844
17886
  PublicInterfaceTypeSchema,
17845
17887
  RegistrySchema,