@githolon/dsl 0.101.6 → 0.102.1

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.
Files changed (120) hide show
  1. package/dart/CHANGELOG.md +13 -0
  2. package/dart/lib/nomos_client.dart +3 -52
  3. package/dart/lib/src/dev_cloud.dart +5 -0
  4. package/dart/lib/src/home.dart +10 -15
  5. package/dart/lib/src/nms_conformance_runtime.dart +12 -0
  6. package/dart/lib/src/nms_generated_runtime.dart +29 -0
  7. package/dart/lib/src/nms_test_environment.dart +8 -0
  8. package/dart/lib/src/node_runner_transport.dart +56 -18
  9. package/dart/lib/src/provider.dart +5 -1
  10. package/dart/lib/src/record_origin.dart +55 -0
  11. package/dart/lib/src/runner/node-entry.mjs +9105 -0
  12. package/dart/lib/src/runner/offline-install.mjs +4729 -0
  13. package/dart/lib/src/session_bound.dart +23 -10
  14. package/dart/lib/src/source_trust.dart +51 -0
  15. package/dart/lib/src/test_harness.dart +490 -58
  16. package/dart/lib/src/webview_bridge.dart +167 -58
  17. package/dart/lib/src/workspace_name.dart +7 -1
  18. package/dart/pubspec.lock +3 -3
  19. package/dart/pubspec.yaml +4 -2
  20. package/dart/test/acquire_session_credentials_test.dart +34 -17
  21. package/dart/test/acquire_session_test.dart +109 -24
  22. package/dart/test/adv_realm_interference_test.dart +227 -99
  23. package/dart/test/bundle_version_pairing_test.dart +1 -1
  24. package/dart/test/cloud_bound_topology_test.dart +1 -1
  25. package/dart/test/cluster_attested_test.dart +52 -35
  26. package/dart/test/cluster_births_test.dart +5 -2
  27. package/dart/test/cluster_device_keyed_acceptance_test.dart +5 -2
  28. package/dart/test/cluster_local_autosync_test.dart +5 -2
  29. package/dart/test/cluster_scale_test.dart +5 -2
  30. package/dart/test/compat_test.dart +1 -1
  31. package/dart/test/dlq_session_surface_test.dart +2 -1
  32. package/dart/test/errors_test.dart +1 -1
  33. package/dart/test/first_app_gauntlet_test.dart +78 -51
  34. package/dart/test/four_layer_nested_topology_test.dart +1 -1
  35. package/dart/test/harness_phase_timeout_test.dart +1 -1
  36. package/dart/test/home_parity_test.dart +9 -5
  37. package/dart/test/local_sync_inert_test.dart +22 -14
  38. package/dart/test/node_runner_transport_test.dart +9 -5
  39. package/dart/test/null_slot_test.dart +1 -1
  40. package/dart/test/parent_signer_recovery_test.dart +5 -2
  41. package/dart/test/schema_validation_test.dart +1 -1
  42. package/dart/test/sealing_client_test.dart +2 -1
  43. package/dart/test/session_bound_test.dart +92 -119
  44. package/dart/test/stale_bundle_test.dart +1 -1
  45. package/dart/test/test_harness_test.dart +77 -22
  46. package/dart/test/vo_read_typing_test.dart +32 -14
  47. package/dart/test/watch_after_offer_stall_test.dart +2 -1
  48. package/dart/test/webview_bridge_test.dart +17 -4
  49. package/dart/test/wire_test.dart +1 -1
  50. package/dart_types/CHANGELOG.md +8 -0
  51. package/dart_types/lib/nomos_types.dart +7 -6
  52. package/dart_types/lib/src/activity.dart +23 -13
  53. package/dart_types/lib/src/foreign_ref.dart +61 -112
  54. package/dart_types/lib/src/invitation.dart +96 -0
  55. package/dart_types/lib/src/nomos_ref.dart +97 -59
  56. package/dart_types/pubspec.yaml +1 -1
  57. package/dart_types/test/surfaced_test.dart +125 -19
  58. package/package.json +7 -3
  59. package/runtime/generated-application-host.js +8851 -0
  60. package/src/activity.ts +2 -2
  61. package/src/aggregate.ts +24 -1
  62. package/src/application_composition.ts +282 -0
  63. package/src/application_topology.ts +151 -0
  64. package/src/attested_core.ts +2 -2
  65. package/src/authoring_context.ts +9 -0
  66. package/src/birth_meter_ensure.ts +1 -1
  67. package/src/births.ts +53 -5
  68. package/src/build_package.ts +79 -71
  69. package/src/business_birth.ts +93 -10
  70. package/src/clear_directive.ts +3 -1
  71. package/src/codegen_dart.ts +369 -420
  72. package/src/codegen_dart_application.ts +1508 -0
  73. package/src/codegen_dart_client.ts +156 -95
  74. package/src/codegen_dart_scenario.ts +299 -0
  75. package/src/codegen_openapi.ts +8 -3
  76. package/src/codegen_proof.ts +1113 -1137
  77. package/src/codegen_provider_dart.ts +12 -1
  78. package/src/codegen_ts.ts +1176 -496
  79. package/src/compat_package_main.ts +22 -10
  80. package/src/compile_package_main.ts +1536 -337
  81. package/src/contract.ts +10 -4
  82. package/src/dart_barrel_guard.ts +5 -1
  83. package/src/describe_model.ts +13 -5
  84. package/src/directive.ts +244 -5
  85. package/src/engine_entry.ts +56 -13
  86. package/src/engine_javascript.ts +31 -0
  87. package/src/evolve_preview.ts +3 -12
  88. package/src/framework/application_home.ts +24 -10
  89. package/src/framework/capability.ts +15 -1
  90. package/src/framework/domain_lifecycle.ts +8 -0
  91. package/src/framework/framework_aggregates.ts +2 -2
  92. package/src/framework/genesis.ts +11 -1
  93. package/src/framework/home.ts +178 -75
  94. package/src/framework/impure_capability.ts +24 -7
  95. package/src/framework/relations.ts +13 -5
  96. package/src/framework/workspaces.ts +13 -12
  97. package/src/generated_client_names.ts +42 -3
  98. package/src/idof_lint.ts +65 -13
  99. package/src/index.ts +46 -12
  100. package/src/intent.ts +587 -0
  101. package/src/law_check.ts +64 -16
  102. package/src/precondition.ts +16 -4
  103. package/src/read_projection_namespace.ts +2 -7
  104. package/src/recipient.ts +33 -0
  105. package/src/relation_schema.ts +93 -0
  106. package/src/secondary_ensure.ts +11 -2
  107. package/src/shape_compat.ts +11 -1
  108. package/src/usd.ts +30 -8
  109. package/src/usd_layers.ts +447 -246
  110. package/src/usd_state.ts +1 -1
  111. package/src/value_object.ts +49 -13
  112. package/src/wire_encode.ts +124 -26
  113. package/src/workspace_sharing.ts +269 -0
  114. package/src/zod_introspection.ts +84 -0
  115. package/dart/example/nomos_secure_key_store.dart +0 -82
  116. package/dart/example/nomos_webview_transport.dart +0 -63
  117. package/dart/lib/nomos_headless.dart +0 -50
  118. package/dart/lib/testing.dart +0 -14
  119. package/dart/test/co2_product_gauntlet_test.dart +0 -244
  120. package/src/framework/identity.ts +0 -537
@@ -3,7 +3,7 @@
3
3
  // wasm32-wasip1 artifact. If a file isn't this / hosting this / authoring for this / proving this — it's gone.
4
4
 
5
5
  /**
6
- * `githolon compat <target> [--config …] [--json]` — THE CI GATE (task #31, the compat superpower).
6
+ * `githolon compat <target> [--config …] [--domain …] [--json]` — THE CI GATE (task #31, the compat superpower).
7
7
  *
8
8
  * Compares the CURRENT build's structural interface (`build/<name>.interface.json`, the client's
9
9
  * REQUIREMENT) against a TARGET's installed law (the workspace OFFER), PER MEMBER, via the #72
@@ -96,7 +96,7 @@ function loadFileOffer(arg: string): { offer: InterfaceMap; source: string } {
96
96
  return { offer, source: file };
97
97
  }
98
98
 
99
- /** Read a LIVE workspace's on-ledger offer via connect() (`@githolon/client`). */
99
+ /** Read a LIVE workspace's on-ledger offer through the compiler-private runtime bundled with the DSL. */
100
100
  /**
101
101
  * Parse a live compat target URL into its cloud BASE and workspace. The base is everything BEFORE
102
102
  * `/v2/workspaces/` — NOT just the origin — so a gateway mounted under a PATH PREFIX
@@ -121,14 +121,18 @@ async function loadLiveOffer(url: string, workspaceFlag?: string): Promise<{ off
121
121
  if (!/^https?:\/\//.test(url)) fail(`could not parse the live target URL: ${url}`);
122
122
  const { cloud, workspace } = parseLiveTarget(url, workspaceFlag);
123
123
  if (!workspace) fail(`live target needs a workspace — use https://host/v2/workspaces/<ws> or add --workspace <ws>`);
124
- let connect: (opts: { cloud: string; workspace: string }) => Promise<{ interfaceOffer(): Promise<InterfaceMap | null> }>;
124
+ let read: (cloud: string, workspace: string) => Promise<Record<string, unknown> | null>;
125
125
  try {
126
- ({ connect } = (await import("@githolon/client")) as unknown as { connect: typeof connect });
126
+ const dynamicImport = Function("specifier", "return import(specifier)") as (specifier: string) => Promise<unknown>;
127
+ const runtime = await dynamicImport(new URL("../runtime/generated-application-host.js", import.meta.url).href) as {
128
+ nomosInternalReadWorkspaceInterface?: typeof read;
129
+ };
130
+ if (typeof runtime.nomosInternalReadWorkspaceInterface !== "function") throw new Error("operator reader absent");
131
+ read = runtime.nomosInternalReadWorkspaceInterface;
127
132
  } catch {
128
- fail(`live target needs @githolon/client installed (it is a dependency of githolon)`);
133
+ fail(`live target inspection is missing from this @githolon/dsl installation; reinstall the current release`);
129
134
  }
130
- const holon = await connect({ cloud, workspace });
131
- const offer = await holon.interfaceOffer();
135
+ const offer = await read(cloud, workspace) as InterfaceMap | null;
132
136
  if (offer === null) fail(`workspace '${workspace}' exposes no on-ledger structural interface (pre-#72e law)`);
133
137
  return { offer, source: `${cloud}/v2/workspaces/${workspace}` };
134
138
  }
@@ -151,13 +155,21 @@ async function main(): Promise<void> {
151
155
  const asJson = argv.includes("--json");
152
156
  const configArg = flagVal("--config") ?? "nomos.package.mjs";
153
157
  const workspaceFlag = flagVal("--workspace");
158
+ const domainFlag = flagVal("--domain");
154
159
  // The positional target = the first non-flag arg that isn't a flag VALUE.
155
- const flagsWithVals = new Set(["--config", "--workspace"]);
160
+ const flagsWithVals = new Set(["--config", "--workspace", "--domain"]);
156
161
  const target = argv.find((a, i) => !a.startsWith("--") && !(i > 0 && flagsWithVals.has(argv[i - 1]!)));
157
- if (!target) fail(`usage: githolon compat <workspace-url | deploy.json | interface.json | dir> [--config <cfg>] [--workspace <ws>] [--json]`);
162
+ if (!target) fail(`usage: githolon compat <workspace-url | deploy.json | interface.json | dir> [--config <cfg>] [--workspace <ws>] [--domain <name,...>] [--json]`);
158
163
 
159
164
  const { name, dir } = await loadPackageName(configArg);
160
- const current = loadCurrentInterface(dir, name);
165
+ const allCurrent = loadCurrentInterface(dir, name);
166
+ const requestedDomains = domainFlag?.split(",").map((domain) => domain.trim()).filter(Boolean) ?? [];
167
+ for (const domain of requestedDomains) {
168
+ if (allCurrent[domain] === undefined) fail(`current package '${name}' has no domain '${domain}'`);
169
+ }
170
+ const current = requestedDomains.length === 0
171
+ ? allCurrent
172
+ : Object.fromEntries(requestedDomains.map((domain) => [domain, allCurrent[domain]!]));
161
173
 
162
174
  const { offer, source } = /^https?:\/\//.test(target)
163
175
  ? await loadLiveOffer(target, workspaceFlag)