@hediet/linkrpc-cli 0.0.3-next.20260925.2 → 0.0.3-next.20260925.3

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.
@@ -6026,17 +6026,34 @@ function resolveTopologyTarget(context) {
6026
6026
  if (candidates.length !== 1) throw new Error("Select exactly one canonical hubrpc.topology interface");
6027
6027
  const listing = candidates[0];
6028
6028
  const canonical = topologyInterface.toSchema();
6029
- if (listing.schema.id !== canonical.id || computeInterfaceHash({
6029
+ if (listing.schema.id !== canonical.id || computeInterfaceHash(listing.schema) !== listing.schema.hash || computeInterfaceHash(normalizePrimitiveTypeUnions({
6030
6030
  ...canonical,
6031
6031
  methods: listing.schema.methods,
6032
6032
  components: listing.schema.components
6033
- }) !== canonical.hash) throw new Error("Selected hubrpc.topology schema does not match the canonical inspection contract");
6033
+ })) !== computeInterfaceHash(normalizePrimitiveTypeUnions(canonical))) throw new Error("Selected hubrpc.topology schema does not match the canonical inspection contract");
6034
6034
  return {
6035
6035
  serviceId: listing.serviceId,
6036
6036
  hash: listing.schema.hash,
6037
6037
  isDefault: listing.isDefault === true
6038
6038
  };
6039
6039
  }
6040
+ function normalizePrimitiveTypeUnions(schema) {
6041
+ const visit = (value) => {
6042
+ if (Array.isArray(value)) return value.map(visit);
6043
+ if (value === null || typeof value !== "object") return value;
6044
+ const record = value;
6045
+ const types = record.type;
6046
+ if (Object.keys(record).length === 1 && Array.isArray(types) && types.length > 0 && types.every((type) => [
6047
+ "string",
6048
+ "number",
6049
+ "integer",
6050
+ "boolean",
6051
+ "null"
6052
+ ].includes(type))) return { anyOf: types.map((type) => ({ type })) };
6053
+ return Object.fromEntries(Object.entries(record).map(([key, child]) => [key, visit(child)]));
6054
+ };
6055
+ return visit(schema);
6056
+ }
6040
6057
  function topologyTimeout(options) {
6041
6058
  const timeout = Number(options.timeoutMs ?? 5e3);
6042
6059
  if (!Number.isSafeInteger(timeout) || timeout < 1) throw new Error("--timeout-ms must be a positive integer");
@@ -7199,7 +7216,7 @@ Batch options:
7199
7216
  process.once("SIGINT", onSignal);
7200
7217
  process.once("SIGTERM", onSignal);
7201
7218
  try {
7202
- const { runApprovalUi } = await import("./runApprovalUi-C4yIUu8Y.js");
7219
+ const { runApprovalUi } = await import("./runApprovalUi-Dmme5115.js");
7203
7220
  await runApprovalUi({
7204
7221
  client,
7205
7222
  signal: stop.signal
@@ -7214,7 +7231,7 @@ Batch options:
7214
7231
  registerViewCommands(program, (action) => withChannel(endpoint, getPrincipalSpec(), action));
7215
7232
  program.command("ui").description("Launch the terminal UI (form-based browser of services + methods).").action(async () => {
7216
7233
  const acquired = await acquireConnection(endpoint);
7217
- const { runUi } = await import("./runUi-Dp2P3aNN.js");
7234
+ const { runUi } = await import("./runUi-iTwO1iUN.js");
7218
7235
  try {
7219
7236
  await runUi({
7220
7237
  endpoint: acquired.ep,
@@ -7647,4 +7664,4 @@ function safeJson(value) {
7647
7664
  //#endregion
7648
7665
  export { formatCommandLegend as a, safeTerminalText as c, interfaceTarget as d, matchesTarget as f, dispatchHostKey as i, resolveViewTarget as l, approvalDetailLines as m, views as n, hostCommands as o, targetId as p, ViewFrame as r, matchesKey as s, runCli as t, formatCondition as u };
7649
7666
 
7650
- //# sourceMappingURL=cli-CY5WVWEQ.js.map
7667
+ //# sourceMappingURL=cli-DA7el6WB.js.map