@warmhub/sdk-ts 0.79.0 → 0.80.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.
@@ -6772,10 +6772,13 @@ function hasAnyTokens(s) {
6772
6772
  // ../rules/src/preflight-commit.ts
6773
6773
  function preflightCommitDiagnostics(operations, options) {
6774
6774
  const errors = [];
6775
- rejectCommitTokenSyntax(operations, errors);
6776
- illegalOpSequences(operations, errors, options?.checkAddAdd ?? true);
6775
+ rejectCommitTokenSyntax(operations, errors, options);
6776
+ illegalOpSequences(operations, errors, options?.checkAddAdd ?? true, options);
6777
6777
  return errors;
6778
6778
  }
6779
+ function sourceOperationIndex(filteredIndex, options) {
6780
+ return options?.sourceOperationIndexes?.[filteredIndex] ?? filteredIndex;
6781
+ }
6779
6782
  function getOpName(op) {
6780
6783
  return op.name;
6781
6784
  }
@@ -6789,7 +6792,7 @@ function tokenStringFields(op) {
6789
6792
  }
6790
6793
  return fields;
6791
6794
  }
6792
- function rejectCommitTokenSyntax(operations, errors) {
6795
+ function rejectCommitTokenSyntax(operations, errors, options) {
6793
6796
  for (let i = 0; i < operations.length; i++) {
6794
6797
  const op = operations[i];
6795
6798
  if (!op) continue;
@@ -6797,7 +6800,7 @@ function rejectCommitTokenSyntax(operations, errors) {
6797
6800
  if (field && hasAnyTokens(field)) {
6798
6801
  errors.push({
6799
6802
  code: "COMMIT_TOKEN_SYNTAX_REMOVED",
6800
- operationIndex: i,
6803
+ operationIndex: sourceOperationIndex(i, options),
6801
6804
  message: COMMIT_TOKEN_SYNTAX_REMOVED_MESSAGE
6802
6805
  });
6803
6806
  break;
@@ -6805,7 +6808,7 @@ function rejectCommitTokenSyntax(operations, errors) {
6805
6808
  }
6806
6809
  }
6807
6810
  }
6808
- function illegalOpSequences(operations, errors, checkAddAdd) {
6811
+ function illegalOpSequences(operations, errors, checkAddAdd, options) {
6809
6812
  const opHistory = /* @__PURE__ */ new Map();
6810
6813
  for (let i = 0; i < operations.length; i++) {
6811
6814
  const op = operations[i];
@@ -6816,7 +6819,10 @@ function illegalOpSequences(operations, errors, checkAddAdd) {
6816
6819
  const kind = inferOperationKind({ ...op, name });
6817
6820
  const qualName = kind === "shape" ? `shape:${name}` : `thing:${name}`;
6818
6821
  const history = opHistory.get(qualName) ?? [];
6819
- history.push({ operation: op.operation, index: i });
6822
+ history.push({
6823
+ operation: op.operation,
6824
+ index: sourceOperationIndex(i, options)
6825
+ });
6820
6826
  opHistory.set(qualName, history);
6821
6827
  }
6822
6828
  for (const [qualName, history] of opHistory) {
@@ -8557,7 +8563,7 @@ var SDK_DEVELOPMENT_VERSION = "0.0.0-development";
8557
8563
  function sdkVersionIsDevelopment(version) {
8558
8564
  return version === SDK_DEVELOPMENT_VERSION;
8559
8565
  }
8560
- var SDK_VERSION = "0.79.0" ;
8566
+ var SDK_VERSION = "0.80.0" ;
8561
8567
 
8562
8568
  // src/component-cli.ts
8563
8569
  var SUPPORTED_METHODS = /* @__PURE__ */ new Set([
@@ -9218,19 +9224,38 @@ var OperationBuilder = class {
9218
9224
  message: diagnostic.message
9219
9225
  });
9220
9226
  }
9221
- const preflightOps = this.ops.filter((op) => op.operation !== "retract").map((op) => {
9227
+ const preflightEntries = this.ops.flatMap((op, operationIndex) => {
9228
+ if (op.operation === "retract") {
9229
+ return [];
9230
+ }
9222
9231
  if (op.operation === "add") {
9223
- return toPreflightOp(op, normalizeAddKind(op));
9232
+ return [
9233
+ {
9234
+ op: toPreflightOp(op, normalizeAddKind(op)),
9235
+ operationIndex
9236
+ }
9237
+ ];
9224
9238
  }
9225
9239
  const target = op.name ?? op.wref;
9226
- return toPreflightOp(
9227
- op,
9228
- target ? normalizeReviseKind(op, target) : "thing"
9229
- );
9230
- });
9231
- const diagnostics = preflightCommitDiagnostics2(preflightOps, {
9232
- checkAddAdd: false
9240
+ return [
9241
+ {
9242
+ op: toPreflightOp(
9243
+ op,
9244
+ target ? normalizeReviseKind(op, target) : "thing"
9245
+ ),
9246
+ operationIndex
9247
+ }
9248
+ ];
9233
9249
  });
9250
+ const diagnostics = preflightCommitDiagnostics2(
9251
+ preflightEntries.map(({ op }) => op),
9252
+ {
9253
+ checkAddAdd: false,
9254
+ sourceOperationIndexes: preflightEntries.map(
9255
+ ({ operationIndex }) => operationIndex
9256
+ )
9257
+ }
9258
+ );
9234
9259
  for (const diagnostic of diagnostics) {
9235
9260
  errors.push({
9236
9261
  code: diagnostic.code,
@@ -9256,7 +9281,7 @@ var OperationBuilder = class {
9256
9281
  * @param params.message Optional commit message.
9257
9282
  * @param params.committer Optional wref identifying the actor on whose behalf the write is made.
9258
9283
  * @param params.chunkSize Maximum operations per stream append.
9259
- * @param params.streamId Advanced continuation hook for caller-managed streams.
9284
+ * @param params.streamId Caller-managed stream identity for observability and diagnostic correlation.
9260
9285
  * @param params.returnRepoSeq Return the writer's own repository-sequence acknowledgement.
9261
9286
  * @param params.retry Retry policy for transient first-chunk failures, or `false` to disable automatic retry.
9262
9287
  */
@@ -10180,7 +10205,7 @@ var WarmHubClient = class _WarmHubClient {
10180
10205
  * @param opts.componentRef Attribute writes to an installed component, identified by its `Org/Name` ref, when the caller is allowed to claim it.
10181
10206
  * @param opts.chunkSize Maximum operations per stream append. Values are clamped by the SDK.
10182
10207
  * @param opts.skipExisting Return `noop` for add operations whose target already exists.
10183
- * @param opts.streamId Advanced continuation hook for caller-managed streams.
10208
+ * @param opts.streamId Caller-managed stream identity for observability and diagnostic correlation.
10184
10209
  * @param opts.returnRepoSeq Return the sequence allocated to the writer's
10185
10210
  * own commit acknowledgement. This does not disclose a reader-facing
10186
10211
  * repository head. Multi-chunk submissions return the last sequence
@@ -12955,5 +12980,5 @@ re2js/build/index.js:
12955
12980
  */
12956
12981
 
12957
12982
  export { AllStreamOperationsFailedError, CLI_INSTALL_REPO_HEADER, CLI_SIGNATURE_HEADER, CLI_TIMESTAMP_HEADER, CONTENT_FIELD_LIMIT_ERROR, CliCallVerificationError, DEFAULT_API_URL, DEFAULT_STREAM_CHUNK_SIZE, MAX_CONTENT_FIELD_BYTES, MAX_STREAM_APPEND_OPERATION_COUNT2 as MAX_STREAM_APPEND_OPERATION_COUNT, OperationBuilder, PartialStreamSubmissionError, SDK_VERSION, WarmHubClient, WarmHubError, connectionErrorMessage, contentFieldLimitError, countStreamAppendResultStatuses, isConnectionError, isRetryable, isWarmHubError, normalizeWref, resolveFunctionLogMode, sanitizeErrorMessage, sdkVersionIsBelowMinimum, streamAppendResultStatus, submitOperationsViaStream, toWarmHubError, validateAgainstShape, verifyCliCall };
12958
- //# sourceMappingURL=chunk-NREDPYF7.js.map
12959
- //# sourceMappingURL=chunk-NREDPYF7.js.map
12983
+ //# sourceMappingURL=chunk-OVJASB3M.js.map
12984
+ //# sourceMappingURL=chunk-OVJASB3M.js.map