@amistio/cli 0.1.54 → 0.1.55

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 (2) hide show
  1. package/dist/index.js +14 -1
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -3622,6 +3622,7 @@ function createDurableResultFinalizationEntry(input, now = (/* @__PURE__ */ new
3622
3622
  });
3623
3623
  }
3624
3624
  function createImplementationFinalizationEntry(input, now = (/* @__PURE__ */ new Date()).toISOString()) {
3625
+ const telemetry = normalizeImplementationFinalizationTelemetry(input.telemetry);
3625
3626
  return implementationFinalizationEntrySchema.parse({
3626
3627
  schemaVersion: 1,
3627
3628
  kind: "implementationFinalization",
@@ -3635,7 +3636,7 @@ function createImplementationFinalizationEntry(input, now = (/* @__PURE__ */ new
3635
3636
  attempt: input.attempt,
3636
3637
  idempotencyKey: input.idempotencyKey,
3637
3638
  finalStatus: input.finalStatus,
3638
- telemetry: input.telemetry,
3639
+ telemetry,
3639
3640
  retryCount: 0,
3640
3641
  createdAt: now,
3641
3642
  updatedAt: now
@@ -3830,6 +3831,18 @@ function implementationFinalizationEntryKey(entry) {
3830
3831
  const hash = createHash2("sha256").update([entry.accountId, entry.projectId, entry.repositoryLinkId, entry.runnerId, entry.workItemId, String(entry.attempt), entry.idempotencyKey].join("\0")).digest("hex").slice(0, 32);
3831
3832
  return `implementation-finalization-${hash}`;
3832
3833
  }
3834
+ function normalizeImplementationFinalizationTelemetry(telemetry) {
3835
+ const { repositoryLockId, ...rest } = telemetry;
3836
+ const boundedRepositoryLockId = boundTelemetryIdentifier(repositoryLockId, 200);
3837
+ return { ...rest, ...boundedRepositoryLockId ? { repositoryLockId: boundedRepositoryLockId } : {} };
3838
+ }
3839
+ function boundTelemetryIdentifier(value, maxLength) {
3840
+ const trimmed = value?.trim();
3841
+ if (!trimmed) return void 0;
3842
+ if (trimmed.length <= maxLength) return trimmed;
3843
+ const hash = createHash2("sha256").update(trimmed).digest("hex").slice(0, 32);
3844
+ return `sha256:${hash}:length:${trimmed.length}`;
3845
+ }
3833
3846
  function truncateLocalError(error) {
3834
3847
  const trimmed = error.trim();
3835
3848
  return trimmed.length > 600 ? `${trimmed.slice(0, 600)}...` : trimmed;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@amistio/cli",
3
- "version": "0.1.54",
3
+ "version": "0.1.55",
4
4
  "type": "module",
5
5
  "repository": {
6
6
  "type": "git",