@ultrst-armada/kloks 1.9.0 → 1.10.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.
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "schema": 1,
3
3
  "packageName": "@ultrst-armada/kloks",
4
- "version": "1.9.0",
5
- "sourceCommit": "b6205d2c4f27f354324b4029676d614418fae89d",
4
+ "version": "1.10.0",
5
+ "sourceCommit": "302682bf08b2a4adcb8109f8f4a6a44651b25909",
6
6
  "releaseWorkflow": "npm Release",
7
- "workflowRunId": "40212539594"
7
+ "workflowRunId": "40287961465"
8
8
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ultrst-armada/kloks",
3
- "version": "1.9.0",
3
+ "version": "1.10.0",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public",
@@ -164,7 +164,7 @@
164
164
  "typescript": "^5.7.3",
165
165
  "vitest": "^3.1.0"
166
166
  },
167
- "packageManager": "pnpm@9.15.0",
167
+ "packageManager": "pnpm@10.33.0",
168
168
  "repository": {
169
169
  "type": "git",
170
170
  "url": "git+https://github.com/dinilmusick/Kloks.git"
@@ -297,9 +297,10 @@ var COMMANDS2 = {
297
297
  test: { command: "pnpm", args: ["run", "test", "--if-present"] },
298
298
  build: { command: "pnpm", args: ["run", "build", "--if-present"] },
299
299
  krnl: { command: "pnpm", args: ["exec", "krnl", "validate"] },
300
- frnl: { command: "pnpm", args: ["exec", "frnl", "validate"] }
300
+ frnl: { command: "pnpm", args: ["exec", "frnl", "validate"] },
301
+ "lockfile-check": { command: "pnpm", args: ["install", "--frozen-lockfile", "--ignore-scripts"] }
301
302
  };
302
- var DEFAULT_LAYERS = ["syntax", "lint", "krnl", "frnl"];
303
+ var DEFAULT_LAYERS = ["lockfile-check", "syntax", "lint", "krnl", "frnl"];
303
304
  var commandText = (command, args) => [command, ...args].join(" ");
304
305
  var CodeValidationRuntime = class {
305
306
  constructor(runtime5 = new WebContainerRuntime()) {
@@ -310,9 +311,9 @@ var CodeValidationRuntime = class {
310
311
  if (input.files) await this.runtime.mount(input.files);
311
312
  const diagnostics = [];
312
313
  if (input.install) {
313
- const installed = await this.runtime.runCommand("pnpm", ["install", "--no-frozen-lockfile"], input.cwd, input.env);
314
- diagnostics.push({ layer: "lint", ok: installed.exitCode === 0, exitCode: installed.exitCode, output: installed.output, command: "pnpm install --no-frozen-lockfile" });
315
- if (installed.exitCode !== 0) return { ok: false, diagnostics, failedLayers: ["lint"] };
314
+ const installed = await this.runtime.runCommand("pnpm", ["install", "--frozen-lockfile", "--ignore-scripts"], input.cwd, input.env);
315
+ diagnostics.push({ layer: "lockfile-check", ok: installed.exitCode === 0, exitCode: installed.exitCode, output: installed.output, command: "pnpm install --frozen-lockfile --ignore-scripts" });
316
+ if (installed.exitCode !== 0) return { ok: false, diagnostics, failedLayers: ["lockfile-check"] };
316
317
  }
317
318
  const layers = input.layers?.length ? input.layers : DEFAULT_LAYERS;
318
319
  for (const layer of layers) {
@@ -337,7 +338,7 @@ var runtime2 = new CodeValidationRuntime();
337
338
  var CodeValidationServiceDefinition = createServiceDefinition({
338
339
  id: "kloks.backend.codeValidation",
339
340
  name: "CodeValidationService",
340
- version: "1.0.0",
341
+ version: "1.1.0",
341
342
  operations: { validate: { id: "CodeValidationService.validate", name: "validate", handler: async (input) => runtime2.validate(input) } }
342
343
  });
343
344
  var CodeValidationServiceFacade = {
@@ -144,7 +144,7 @@ declare const DevelopmentServiceFacade: {
144
144
  execute: <TIn = unknown, TOut = unknown>(op: string, input?: TIn) => Promise<TOut>;
145
145
  };
146
146
 
147
- type ValidationLayer = 'syntax' | 'lint' | 'test' | 'build' | 'krnl' | 'frnl' | 'law-l9';
147
+ type ValidationLayer = 'syntax' | 'lint' | 'test' | 'build' | 'krnl' | 'frnl' | 'lockfile-check' | 'law-l9';
148
148
  interface CodeValidationInput {
149
149
  layers?: ValidationLayer[];
150
150
  cwd?: string;
@@ -21,7 +21,7 @@ import {
21
21
  WebContainerServiceFacade,
22
22
  codeDiagnosticsService,
23
23
  resolveDevelopmentCommand
24
- } from "../chunk-SQGBAWZN.js";
24
+ } from "../chunk-OYVHKYJW.js";
25
25
  import "../chunk-TY32TUNI.js";
26
26
  export {
27
27
  AgentHarnessRuntime,
@@ -232,7 +232,7 @@ import {
232
232
  WebContainerServiceFacade,
233
233
  codeDiagnosticsService,
234
234
  resolveDevelopmentCommand
235
- } from "./chunk-SQGBAWZN.js";
235
+ } from "./chunk-OYVHKYJW.js";
236
236
  import "./chunk-TY32TUNI.js";
237
237
 
238
238
  // src/data/BaseDataProvider.ts
@@ -680,6 +680,24 @@ declare const UI_AUTHORING_SCHEMA_VERSION = "1.0.0";
680
680
  declare function suggestUIComponent(fieldType: string): string;
681
681
  declare function buildServiceUISchema(session: UIAuthoringSession): ServiceUISchema;
682
682
 
683
+ type UIComponentPurpose = 'service-ui' | 'general-purpose' | 'application-specific';
684
+ type UIComponentPromotion = 'always' | 'usually' | 'never';
685
+ interface UIComponentArtifact {
686
+ artifactId: string;
687
+ schemaVersion: string;
688
+ purpose: UIComponentPurpose;
689
+ promotion: UIComponentPromotion;
690
+ origin: 'kult' | 'theta' | 'kelt' | 'other';
691
+ context: UIAuthoringContext;
692
+ name: string;
693
+ description: string;
694
+ rootAsset?: AssetRef;
695
+ session: UIAuthoringSession;
696
+ }
697
+ declare function getUIComponentPurpose(context: UIAuthoringContext): UIComponentPurpose;
698
+ declare function getUIComponentPromotion(purpose: UIComponentPurpose): UIComponentPromotion;
699
+ declare function buildUIComponentArtifact(session: UIAuthoringSession): UIComponentArtifact;
700
+
683
701
  declare const KLOKS_CANONICAL_CONTRACT: {
684
702
  package: string;
685
703
  version: string;
@@ -699,4 +717,4 @@ declare const KLOKS_CANONICAL_CONTRACT: {
699
717
  validateCompatibility: (consumerSymbols?: string[]) => CompatibilityCheckResult;
700
718
  };
701
719
 
702
- export { type AssetRef, type AudioBusConfig, AudioBusConfigSchema, type AudioHardwareState, AudioHardwareStateSchema, type BackendOperation, BackendOperationSchema, type CompatibilityCheckResult, type ComponentDescriptor, type ContractDiffResult, type ContractSnapshot, ContractSnapshotSchema, type ExportSymbolEntry, type GraphEntityMetadata, GraphEntityMetadataSchema, KLOKS_CANONICAL_CONTRACT, KLOKS_PUBLIC_SURFACE, type MidiCommandType, MidiCommandTypeSchema, type MidiEventPayload, MidiEventPayloadSchema, type MonacoCreateSessionInput, type MonacoDiagnostic, type MonacoDiagnosticSeverity, type MonacoDocument, type MonacoEditorOptions, type MonacoIdeSession, type MonacoUpdateDocumentInput, type NodeDimensions2D, NodeDimensions2DSchema, type NodeHeaderStyle, NodeHeaderStyleSchema, type NodeScreenRect2D, NodeScreenRect2DSchema, type OperationBinding, type PageDescriptor, type PublicContractDefinition, PublicContractDefinitionSchema, QWNSR_REQUIRED_SURFACE, type SectionDescriptor, type ServiceUISchema, type SocketDirection, SocketDirectionSchema, type SocketGeometryConfig, SocketGeometryConfigSchema, type SocketPosition2D, SocketPosition2DSchema, type SocketStyleConfig, SocketStyleConfigSchema, type UIAuthoringBinding, type UIAuthoringContext, type UIAuthoringCreateInput, type UIAuthoringNode, type UIAuthoringNodeKind, type UIAuthoringOperation, type UIAuthoringSession, type UIAuthoringValidation, type UIRequirementMode, UI_AUTHORING_SCHEMA_VERSION, type WireAnimationConfig, WireAnimationConfigSchema, type WireCurveStyle, WireCurveStyleSchema, type WireEndpoint2D, WireEndpoint2DSchema, type WireVisualConfig, WireVisualConfigSchema, buildServiceUISchema, createKloksSnapshot, diffContractSnapshots, suggestUIComponent, validateConsumerSurfaceCompatibility };
720
+ export { type AssetRef, type AudioBusConfig, AudioBusConfigSchema, type AudioHardwareState, AudioHardwareStateSchema, type BackendOperation, BackendOperationSchema, type CompatibilityCheckResult, type ComponentDescriptor, type ContractDiffResult, type ContractSnapshot, ContractSnapshotSchema, type ExportSymbolEntry, type GraphEntityMetadata, GraphEntityMetadataSchema, KLOKS_CANONICAL_CONTRACT, KLOKS_PUBLIC_SURFACE, type MidiCommandType, MidiCommandTypeSchema, type MidiEventPayload, MidiEventPayloadSchema, type MonacoCreateSessionInput, type MonacoDiagnostic, type MonacoDiagnosticSeverity, type MonacoDocument, type MonacoEditorOptions, type MonacoIdeSession, type MonacoUpdateDocumentInput, type NodeDimensions2D, NodeDimensions2DSchema, type NodeHeaderStyle, NodeHeaderStyleSchema, type NodeScreenRect2D, NodeScreenRect2DSchema, type OperationBinding, type PageDescriptor, type PublicContractDefinition, PublicContractDefinitionSchema, QWNSR_REQUIRED_SURFACE, type SectionDescriptor, type ServiceUISchema, type SocketDirection, SocketDirectionSchema, type SocketGeometryConfig, SocketGeometryConfigSchema, type SocketPosition2D, SocketPosition2DSchema, type SocketStyleConfig, SocketStyleConfigSchema, type UIAuthoringBinding, type UIAuthoringContext, type UIAuthoringCreateInput, type UIAuthoringNode, type UIAuthoringNodeKind, type UIAuthoringOperation, type UIAuthoringSession, type UIAuthoringValidation, type UIComponentArtifact, type UIComponentPromotion, type UIComponentPurpose, type UIRequirementMode, UI_AUTHORING_SCHEMA_VERSION, type WireAnimationConfig, WireAnimationConfigSchema, type WireCurveStyle, WireCurveStyleSchema, type WireEndpoint2D, WireEndpoint2DSchema, type WireVisualConfig, WireVisualConfigSchema, buildServiceUISchema, buildUIComponentArtifact, createKloksSnapshot, diffContractSnapshots, getUIComponentPromotion, getUIComponentPurpose, suggestUIComponent, validateConsumerSurfaceCompatibility };
@@ -439,6 +439,34 @@ function buildServiceUISchema(session) {
439
439
  };
440
440
  }
441
441
 
442
+ // src/uiAuthoringArtifactSchema.ts
443
+ function getUIComponentPurpose(context) {
444
+ if (context === "service") return "service-ui";
445
+ if (context === "general-component") return "general-purpose";
446
+ return "application-specific";
447
+ }
448
+ function getUIComponentPromotion(purpose) {
449
+ if (purpose === "service-ui" || purpose === "general-purpose") return "always";
450
+ return "usually";
451
+ }
452
+ function buildUIComponentArtifact(session) {
453
+ const purpose = getUIComponentPurpose(session.context);
454
+ const origin = session.metadata.origin === "kult" || session.metadata.origin === "theta" || session.metadata.origin === "kelt" ? session.metadata.origin : "other";
455
+ const root = session.nodes.find((node) => node.kind === "component" && !node.parentId)?.assetRef;
456
+ return {
457
+ artifactId: "kloks.ui-artifact." + session.sessionId,
458
+ schemaVersion: "1.0.0",
459
+ purpose,
460
+ promotion: getUIComponentPromotion(purpose),
461
+ origin,
462
+ context: session.context,
463
+ name: session.metadata.name || session.sessionId,
464
+ description: session.metadata.description || "",
465
+ rootAsset: root,
466
+ session
467
+ };
468
+ }
469
+
442
470
  // src/index.ts
443
471
  var KLOKS_CANONICAL_CONTRACT = {
444
472
  package: "@ultrst-armada/kloks",
@@ -471,8 +499,11 @@ export {
471
499
  WireEndpoint2DSchema,
472
500
  WireVisualConfigSchema,
473
501
  buildServiceUISchema,
502
+ buildUIComponentArtifact,
474
503
  createKloksSnapshot,
475
504
  diffContractSnapshots,
505
+ getUIComponentPromotion,
506
+ getUIComponentPurpose,
476
507
  suggestUIComponent,
477
508
  validateConsumerSurfaceCompatibility
478
509
  };
@@ -1757,7 +1757,7 @@ var MonacoIdeServiceFacade = {
1757
1757
  };
1758
1758
 
1759
1759
  // src/client-services/uiAuthoringService.ts
1760
- import { buildServiceUISchema, suggestUIComponent } from "@ultrst-armada/kloks/contracts";
1760
+ import { buildServiceUISchema, buildUIComponentArtifact, suggestUIComponent } from "@ultrst-armada/kloks/contracts";
1761
1761
  var activeUIAuthoringService;
1762
1762
  var UIAuthoringServiceDefinition = createServiceDefinition({
1763
1763
  id: "kloks.service.uiAuthoring",
@@ -1837,6 +1837,11 @@ var UIAuthoringServiceDefinition = createServiceDefinition({
1837
1837
  name: "serialize",
1838
1838
  handler: async (input, ctx) => JSON.stringify(getSession(activeUIAuthoringService, input.sessionId), null, 2)
1839
1839
  },
1840
+ generateArtifact: {
1841
+ id: "UIAuthoringService.generateArtifact",
1842
+ name: "generateArtifact",
1843
+ handler: async (input, ctx) => buildUIComponentArtifact(getSession(activeUIAuthoringService, input.sessionId))
1844
+ },
1840
1845
  generateServiceUI: {
1841
1846
  id: "UIAuthoringService.generateServiceUI",
1842
1847
  name: "generateServiceUI",
@@ -1868,6 +1873,15 @@ function validateSession(session) {
1868
1873
  const errors = [];
1869
1874
  const warnings = [];
1870
1875
  if (!session.nodes.some((node) => node.kind === "page")) errors.push("At least one page is required.");
1876
+ const ids = /* @__PURE__ */ new Set();
1877
+ for (const node of session.nodes) {
1878
+ if (ids.has(node.id)) errors.push(`Duplicate authoring node id: ${node.id}`);
1879
+ ids.add(node.id);
1880
+ if (node.parentId && !session.nodes.some((parent) => parent.id === node.parentId)) errors.push(`Missing parent for node: ${node.id}`);
1881
+ if (node.kind === "page" && node.parentId) errors.push(`Page cannot have a parent: ${node.id}`);
1882
+ if (node.kind === "section" && node.parentId && !session.nodes.some((parent) => parent.id === node.parentId && parent.kind === "page")) errors.push(`Section parent must be a page: ${node.id}`);
1883
+ if (node.kind === "component" && node.parentId && !session.nodes.some((parent) => parent.id === node.parentId && parent.kind === "section")) errors.push(`Component parent must be a section: ${node.id}`);
1884
+ }
1871
1885
  if (session.nodes.some((node) => node.kind === "component" && !node.assetRef)) errors.push("Every component node requires a FLOKS asset reference.");
1872
1886
  if (session.context === "service" && !session.metadata.serviceId) errors.push("Service authoring requires metadata.serviceId.");
1873
1887
  for (const binding of session.bindings) {
@@ -22,15 +22,6 @@ import {
22
22
  WireTypeRegistry,
23
23
  initializeDefaultGraphRules
24
24
  } from "./chunk-TZOL3RN7.js";
25
- import {
26
- LifecycleCycleError,
27
- LifecycleGraph,
28
- SKIPO_STATE,
29
- SkipoStateEngine,
30
- useLifecycleScope,
31
- useSkipoBind,
32
- useSkipoState
33
- } from "./chunk-EW4ACSZB.js";
34
25
  import {
35
26
  CommandApi,
36
27
  GhostStore,
@@ -58,6 +49,15 @@ import {
58
49
  import {
59
50
  CompatibilityMatrix
60
51
  } from "./chunk-ISFNY7EZ.js";
52
+ import {
53
+ LifecycleCycleError,
54
+ LifecycleGraph,
55
+ SKIPO_STATE,
56
+ SkipoStateEngine,
57
+ useLifecycleScope,
58
+ useSkipoBind,
59
+ useSkipoState
60
+ } from "./chunk-EW4ACSZB.js";
61
61
 
62
62
  // ../../node_modules/.pnpm/@ultrst-armada+krnl@1.0.3/node_modules/@ultrst-armada/krnl/packages/core/dist/index.js
63
63
  var ServiceStateStore = class {