@supacloud/compiler 0.46.4 → 0.46.6

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/cli.js CHANGED
@@ -15080,7 +15080,7 @@ function decodeMetadata(input) {
15080
15080
  return invalid();
15081
15081
  const events = envelope["events"].map((entry) => {
15082
15082
  const event = record4(entry);
15083
- if (Object.keys(event).some((key) => !["kind", "operation", "stage", "phase", "requestId", "durationMs", "attempt", "traceId"].includes(key)) || event["kind"] !== "route" && event["kind"] !== "command" && event["kind"] !== "job" || event["phase"] !== "started" && event["phase"] !== "succeeded" && event["phase"] !== "failed" || !metadataText(event["operation"], 512) || !metadataText(event["stage"], 256) || "requestId" in event && !requestIdentifier(event["requestId"]) || "traceId" in event && !requestIdentifier(event["traceId"]) || "attempt" in event && (typeof event["attempt"] !== "number" || !Number.isInteger(event["attempt"]) || event["attempt"] < 1 || event["attempt"] > 1e6) || "durationMs" in event && (typeof event["durationMs"] !== "number" || !Number.isFinite(event["durationMs"]) || event["durationMs"] < 0 || event["durationMs"] > Number.MAX_SAFE_INTEGER))
15083
+ if (Object.keys(event).some((key) => !metadataFields.includes(key)) || event["kind"] !== "route" && event["kind"] !== "command" && event["kind"] !== "job" || event["phase"] !== "started" && event["phase"] !== "succeeded" && event["phase"] !== "failed" || !metadataText(event["operation"], 512) || !metadataText(event["stage"], 256) || "requestId" in event && !requestIdentifier(event["requestId"]) || "traceId" in event && !requestIdentifier(event["traceId"]) || "attempt" in event && (typeof event["attempt"] !== "number" || !Number.isInteger(event["attempt"]) || event["attempt"] < 1 || event["attempt"] > 1e6) || "durationMs" in event && (typeof event["durationMs"] !== "number" || !Number.isFinite(event["durationMs"]) || event["durationMs"] < 0 || event["durationMs"] > Number.MAX_SAFE_INTEGER))
15084
15084
  return invalid();
15085
15085
  return {
15086
15086
  kind: event["kind"],
@@ -15097,6 +15097,40 @@ function decodeMetadata(input) {
15097
15097
  return invalid();
15098
15098
  return events;
15099
15099
  }
15100
+ function executionLogEnvelope(entries) {
15101
+ if (!entries.length || entries.length > EXECUTION_CONTEXT_LIMITS.inputEvents)
15102
+ return invalid();
15103
+ const events = entries.map((entry) => {
15104
+ const log = record4(entry);
15105
+ const http = log["event"] === "review-http-execution" && log["component"] === "review-http";
15106
+ const worker = log["event"] === "review-worker-execution" && log["component"] === "review-attachment-worker";
15107
+ if (!http && !worker || http && (log["kind"] !== "route" && log["kind"] !== "command" || ("workerId" in log)) || worker && log["kind"] !== "job" || "workerId" in log && !requestIdentifier(log["workerId"]) || Object.keys(log).some((key) => !metadataFields.includes(key) && !["event", "component", "timestamp", "workerId"].includes(key)) || typeof log["timestamp"] !== "string" || log["timestamp"].length > 32 || !Number.isFinite(Date.parse(log["timestamp"])) || new Date(log["timestamp"]).toISOString() !== log["timestamp"])
15108
+ return invalid();
15109
+ return Object.fromEntries(Object.entries(log).filter(([key]) => metadataFields.includes(key)));
15110
+ });
15111
+ return { version: 1, events: decodeMetadata({ version: 1, events }) };
15112
+ }
15113
+ function parseExecutionFile(content) {
15114
+ let value;
15115
+ try {
15116
+ value = JSON.parse(content);
15117
+ } catch {
15118
+ const lines = content.split(/\r?\n/).filter((line) => line.trim().length > 0);
15119
+ if (!lines.length || lines.length > EXECUTION_CONTEXT_LIMITS.inputEvents)
15120
+ return invalid();
15121
+ let entries;
15122
+ try {
15123
+ entries = lines.map((line) => JSON.parse(line));
15124
+ } catch {
15125
+ return invalid();
15126
+ }
15127
+ return executionLogEnvelope(entries);
15128
+ }
15129
+ if (value !== null && typeof value === "object" && !Array.isArray(value) && "event" in value) {
15130
+ return executionLogEnvelope([value]);
15131
+ }
15132
+ return value;
15133
+ }
15100
15134
  async function readExecutionMetadata(path) {
15101
15135
  try {
15102
15136
  const file = await open(path, constants.O_RDONLY | constants.O_NONBLOCK);
@@ -15114,11 +15148,7 @@ async function readExecutionMetadata(path) {
15114
15148
  }
15115
15149
  if (offset > EXECUTION_CONTEXT_LIMITS.inputBytes)
15116
15150
  return invalid();
15117
- try {
15118
- return JSON.parse(buffer.subarray(0, offset).toString("utf8"));
15119
- } catch {
15120
- return invalid();
15121
- }
15151
+ return parseExecutionFile(buffer.subarray(0, offset).toString("utf8"));
15122
15152
  } finally {
15123
15153
  await file.close();
15124
15154
  }
@@ -15280,7 +15310,7 @@ function correlateSnapshot(snapshot, subject, events, requestId) {
15280
15310
  }
15281
15311
  return pack;
15282
15312
  }
15283
- var EXECUTION_CONTEXT_LIMITS, ExecutionContextError;
15313
+ var EXECUTION_CONTEXT_LIMITS, ExecutionContextError, metadataFields;
15284
15314
  var init_execution_context = __esm(() => {
15285
15315
  init_execution_snapshot();
15286
15316
  EXECUTION_CONTEXT_LIMITS = Object.freeze({
@@ -15304,6 +15334,7 @@ var init_execution_context = __esm(() => {
15304
15334
  this.name = "ExecutionContextError";
15305
15335
  }
15306
15336
  };
15337
+ metadataFields = ["kind", "operation", "stage", "phase", "requestId", "durationMs", "attempt", "traceId"];
15307
15338
  });
15308
15339
 
15309
15340
  // node_modules/@supacloud/delivery/src/application-development.ts
@@ -24386,7 +24417,7 @@ import { resolve as resolve18 } from "node:path";
24386
24417
  var MIGRATION_APP_VERSION = "0.27.1";
24387
24418
 
24388
24419
  // src/migration-elysia-version.ts
24389
- var MIGRATION_ELYSIA_VERSION = "0.31.1";
24420
+ var MIGRATION_ELYSIA_VERSION = "0.33.1";
24390
24421
 
24391
24422
  // src/migration-policy.ts
24392
24423
  var cachedCompilerVersion;
@@ -25871,7 +25902,7 @@ Options:
25871
25902
  --check graphql-schema: compare the remote schema without changing the snapshot
25872
25903
  --debounce <ms> Debounce source changes in dev mode (default: 100)
25873
25904
  --json Print machine-readable output for compile/check/graph/explain/context/doctor/migration-assess/plan/build-delivery/openapi-export/openapi-diff
25874
- --events <file> Read bounded execution metadata for context (requires --request-id and --json)
25905
+ --events <file> Read a metadata JSON envelope or starter execution JSON lines (requires --request-id and --json)
25875
25906
  --request-id <id> Select one opaque request ID from --events; context remains read-only
25876
25907
  --delivery-manifest <file> Correlate context using an immutable build, not current source
25877
25908
  --delivery-target <name> Target in --delivery-manifest (requires execution metadata)
package/dist/index.js CHANGED
@@ -17102,7 +17102,7 @@ function decodeMetadata(input) {
17102
17102
  return invalid();
17103
17103
  const events = envelope["events"].map((entry) => {
17104
17104
  const event = record4(entry);
17105
- if (Object.keys(event).some((key) => !["kind", "operation", "stage", "phase", "requestId", "durationMs", "attempt", "traceId"].includes(key)) || event["kind"] !== "route" && event["kind"] !== "command" && event["kind"] !== "job" || event["phase"] !== "started" && event["phase"] !== "succeeded" && event["phase"] !== "failed" || !metadataText(event["operation"], 512) || !metadataText(event["stage"], 256) || "requestId" in event && !requestIdentifier(event["requestId"]) || "traceId" in event && !requestIdentifier(event["traceId"]) || "attempt" in event && (typeof event["attempt"] !== "number" || !Number.isInteger(event["attempt"]) || event["attempt"] < 1 || event["attempt"] > 1e6) || "durationMs" in event && (typeof event["durationMs"] !== "number" || !Number.isFinite(event["durationMs"]) || event["durationMs"] < 0 || event["durationMs"] > Number.MAX_SAFE_INTEGER))
17105
+ if (Object.keys(event).some((key) => !metadataFields.includes(key)) || event["kind"] !== "route" && event["kind"] !== "command" && event["kind"] !== "job" || event["phase"] !== "started" && event["phase"] !== "succeeded" && event["phase"] !== "failed" || !metadataText(event["operation"], 512) || !metadataText(event["stage"], 256) || "requestId" in event && !requestIdentifier(event["requestId"]) || "traceId" in event && !requestIdentifier(event["traceId"]) || "attempt" in event && (typeof event["attempt"] !== "number" || !Number.isInteger(event["attempt"]) || event["attempt"] < 1 || event["attempt"] > 1e6) || "durationMs" in event && (typeof event["durationMs"] !== "number" || !Number.isFinite(event["durationMs"]) || event["durationMs"] < 0 || event["durationMs"] > Number.MAX_SAFE_INTEGER))
17106
17106
  return invalid();
17107
17107
  return {
17108
17108
  kind: event["kind"],
@@ -17119,6 +17119,40 @@ function decodeMetadata(input) {
17119
17119
  return invalid();
17120
17120
  return events;
17121
17121
  }
17122
+ function executionLogEnvelope(entries) {
17123
+ if (!entries.length || entries.length > EXECUTION_CONTEXT_LIMITS.inputEvents)
17124
+ return invalid();
17125
+ const events = entries.map((entry) => {
17126
+ const log = record4(entry);
17127
+ const http = log["event"] === "review-http-execution" && log["component"] === "review-http";
17128
+ const worker = log["event"] === "review-worker-execution" && log["component"] === "review-attachment-worker";
17129
+ if (!http && !worker || http && (log["kind"] !== "route" && log["kind"] !== "command" || ("workerId" in log)) || worker && log["kind"] !== "job" || "workerId" in log && !requestIdentifier(log["workerId"]) || Object.keys(log).some((key) => !metadataFields.includes(key) && !["event", "component", "timestamp", "workerId"].includes(key)) || typeof log["timestamp"] !== "string" || log["timestamp"].length > 32 || !Number.isFinite(Date.parse(log["timestamp"])) || new Date(log["timestamp"]).toISOString() !== log["timestamp"])
17130
+ return invalid();
17131
+ return Object.fromEntries(Object.entries(log).filter(([key]) => metadataFields.includes(key)));
17132
+ });
17133
+ return { version: 1, events: decodeMetadata({ version: 1, events }) };
17134
+ }
17135
+ function parseExecutionFile(content) {
17136
+ let value;
17137
+ try {
17138
+ value = JSON.parse(content);
17139
+ } catch {
17140
+ const lines = content.split(/\r?\n/).filter((line) => line.trim().length > 0);
17141
+ if (!lines.length || lines.length > EXECUTION_CONTEXT_LIMITS.inputEvents)
17142
+ return invalid();
17143
+ let entries;
17144
+ try {
17145
+ entries = lines.map((line) => JSON.parse(line));
17146
+ } catch {
17147
+ return invalid();
17148
+ }
17149
+ return executionLogEnvelope(entries);
17150
+ }
17151
+ if (value !== null && typeof value === "object" && !Array.isArray(value) && "event" in value) {
17152
+ return executionLogEnvelope([value]);
17153
+ }
17154
+ return value;
17155
+ }
17122
17156
  async function readExecutionMetadata(path) {
17123
17157
  try {
17124
17158
  const file = await open2(path, constants2.O_RDONLY | constants2.O_NONBLOCK);
@@ -17136,11 +17170,7 @@ async function readExecutionMetadata(path) {
17136
17170
  }
17137
17171
  if (offset > EXECUTION_CONTEXT_LIMITS.inputBytes)
17138
17172
  return invalid();
17139
- try {
17140
- return JSON.parse(buffer.subarray(0, offset).toString("utf8"));
17141
- } catch {
17142
- return invalid();
17143
- }
17173
+ return parseExecutionFile(buffer.subarray(0, offset).toString("utf8"));
17144
17174
  } finally {
17145
17175
  await file.close();
17146
17176
  }
@@ -17302,7 +17332,7 @@ function correlateSnapshot(snapshot, subject, events, requestId) {
17302
17332
  }
17303
17333
  return pack;
17304
17334
  }
17305
- var EXECUTION_CONTEXT_LIMITS, ExecutionContextError;
17335
+ var EXECUTION_CONTEXT_LIMITS, ExecutionContextError, metadataFields;
17306
17336
  var init_execution_context = __esm(() => {
17307
17337
  init_execution_snapshot();
17308
17338
  EXECUTION_CONTEXT_LIMITS = Object.freeze({
@@ -17326,6 +17356,7 @@ var init_execution_context = __esm(() => {
17326
17356
  this.name = "ExecutionContextError";
17327
17357
  }
17328
17358
  };
17359
+ metadataFields = ["kind", "operation", "stage", "phase", "requestId", "durationMs", "attempt", "traceId"];
17329
17360
  });
17330
17361
 
17331
17362
  // src/delivery-artifact.ts
@@ -24068,7 +24099,7 @@ import { resolve as resolve17 } from "node:path";
24068
24099
  var MIGRATION_APP_VERSION = "0.27.1";
24069
24100
 
24070
24101
  // src/migration-elysia-version.ts
24071
- var MIGRATION_ELYSIA_VERSION = "0.31.1";
24102
+ var MIGRATION_ELYSIA_VERSION = "0.33.1";
24072
24103
 
24073
24104
  // src/migration-policy.ts
24074
24105
  var cachedCompilerVersion;
@@ -1 +1 @@
1
- export declare const MIGRATION_ELYSIA_VERSION = "0.31.1";
1
+ export declare const MIGRATION_ELYSIA_VERSION = "0.33.1";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@supacloud/compiler",
3
- "version": "0.46.4",
3
+ "version": "0.46.6",
4
4
  "description": "Static compiler for @supacloud/app metadata: builds the application graph from AST, validates it, and generates reflection-free factory code",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -57,8 +57,8 @@
57
57
  "directory": "packages/compiler"
58
58
  },
59
59
  "dependencies": {
60
- "@supacloud/db": "0.17.1",
61
- "@supacloud/delivery": "0.18.1",
60
+ "@supacloud/db": "0.18.0",
61
+ "@supacloud/delivery": "0.19.0",
62
62
  "typebox": "1.3.37",
63
63
  "@graphql-codegen/core": "^6.2.2",
64
64
  "@graphql-codegen/typed-document-node": "^7.2.0",
@@ -68,7 +68,7 @@
68
68
  "graphql": "^16"
69
69
  },
70
70
  "overrides": {
71
- "@supacloud/contracts": "0.10.0",
71
+ "@supacloud/contracts": "0.11.1",
72
72
  "@graphql-tools/utils": "^12.0.4",
73
73
  "@whatwg-node/promise-helpers": "2.0.0"
74
74
  },