@riddledc/riddle-proof 0.7.170 → 0.7.171

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.
@@ -357,11 +357,19 @@ function resolveJsonPath(root, path) {
357
357
  }
358
358
  let current = root;
359
359
  for (const segment of segments) {
360
- if (typeof segment === "number") {
361
- if (!Array.isArray(current) || segment < 0 || segment >= current.length) return { exists: false };
362
- current = current[segment];
360
+ if (Array.isArray(current)) {
361
+ if (segment === "length") {
362
+ current = current.length;
363
+ continue;
364
+ }
365
+ const index = typeof segment === "number" ? segment : /^\d+$/.test(segment) ? Number(segment) : -1;
366
+ if (index < 0 || index >= current.length) return { exists: false };
367
+ current = current[index];
363
368
  continue;
364
369
  }
370
+ if (typeof segment === "number") {
371
+ return { exists: false };
372
+ }
365
373
  if (!isRecord(current) || !hasOwn(current, segment)) return { exists: false };
366
374
  current = current[segment];
367
375
  }
@@ -7179,11 +7187,17 @@ function resolveJsonProbePath(root, path) {
7179
7187
  }
7180
7188
  let current = root;
7181
7189
  for (const segment of segments) {
7182
- if (typeof segment === "number") {
7183
- if (!Array.isArray(current) || segment < 0 || segment >= current.length) return { exists: false };
7184
- current = current[segment];
7190
+ if (Array.isArray(current)) {
7191
+ if (segment === "length") {
7192
+ current = current.length;
7193
+ continue;
7194
+ }
7195
+ const index = typeof segment === "number" ? segment : (/^\d+$/.test(segment) ? Number(segment) : -1);
7196
+ if (index < 0 || index >= current.length) return { exists: false };
7197
+ current = current[index];
7185
7198
  continue;
7186
7199
  }
7200
+ if (typeof segment === "number") return { exists: false };
7187
7201
  if (!current || typeof current !== "object" || Array.isArray(current) || !Object.hasOwn(current, segment)) {
7188
7202
  return { exists: false };
7189
7203
  }
package/dist/cli.cjs CHANGED
@@ -7314,11 +7314,19 @@ function resolveJsonPath(root, path7) {
7314
7314
  }
7315
7315
  let current = root;
7316
7316
  for (const segment of segments) {
7317
- if (typeof segment === "number") {
7318
- if (!Array.isArray(current) || segment < 0 || segment >= current.length) return { exists: false };
7319
- current = current[segment];
7317
+ if (Array.isArray(current)) {
7318
+ if (segment === "length") {
7319
+ current = current.length;
7320
+ continue;
7321
+ }
7322
+ const index = typeof segment === "number" ? segment : /^\d+$/.test(segment) ? Number(segment) : -1;
7323
+ if (index < 0 || index >= current.length) return { exists: false };
7324
+ current = current[index];
7320
7325
  continue;
7321
7326
  }
7327
+ if (typeof segment === "number") {
7328
+ return { exists: false };
7329
+ }
7322
7330
  if (!isRecord(current) || !hasOwn(current, segment)) return { exists: false };
7323
7331
  current = current[segment];
7324
7332
  }
@@ -14120,11 +14128,17 @@ function resolveJsonProbePath(root, path) {
14120
14128
  }
14121
14129
  let current = root;
14122
14130
  for (const segment of segments) {
14123
- if (typeof segment === "number") {
14124
- if (!Array.isArray(current) || segment < 0 || segment >= current.length) return { exists: false };
14125
- current = current[segment];
14131
+ if (Array.isArray(current)) {
14132
+ if (segment === "length") {
14133
+ current = current.length;
14134
+ continue;
14135
+ }
14136
+ const index = typeof segment === "number" ? segment : (/^\d+$/.test(segment) ? Number(segment) : -1);
14137
+ if (index < 0 || index >= current.length) return { exists: false };
14138
+ current = current[index];
14126
14139
  continue;
14127
14140
  }
14141
+ if (typeof segment === "number") return { exists: false };
14128
14142
  if (!current || typeof current !== "object" || Array.isArray(current) || !Object.hasOwn(current, segment)) {
14129
14143
  return { exists: false };
14130
14144
  }
package/dist/cli.js CHANGED
@@ -13,7 +13,7 @@ import {
13
13
  profileStatusExitCode,
14
14
  resolveRiddleProofProfileTargetUrl,
15
15
  resolveRiddleProofProfileTimeoutSec
16
- } from "./chunk-7ZY6ONH4.js";
16
+ } from "./chunk-KBLWL6MZ.js";
17
17
  import {
18
18
  createRiddleApiClient,
19
19
  isTerminalRiddleJobStatus,
package/dist/index.cjs CHANGED
@@ -9090,11 +9090,19 @@ function resolveJsonPath(root, path6) {
9090
9090
  }
9091
9091
  let current = root;
9092
9092
  for (const segment of segments) {
9093
- if (typeof segment === "number") {
9094
- if (!Array.isArray(current) || segment < 0 || segment >= current.length) return { exists: false };
9095
- current = current[segment];
9093
+ if (Array.isArray(current)) {
9094
+ if (segment === "length") {
9095
+ current = current.length;
9096
+ continue;
9097
+ }
9098
+ const index = typeof segment === "number" ? segment : /^\d+$/.test(segment) ? Number(segment) : -1;
9099
+ if (index < 0 || index >= current.length) return { exists: false };
9100
+ current = current[index];
9096
9101
  continue;
9097
9102
  }
9103
+ if (typeof segment === "number") {
9104
+ return { exists: false };
9105
+ }
9098
9106
  if (!isRecord2(current) || !hasOwn(current, segment)) return { exists: false };
9099
9107
  current = current[segment];
9100
9108
  }
@@ -15912,11 +15920,17 @@ function resolveJsonProbePath(root, path) {
15912
15920
  }
15913
15921
  let current = root;
15914
15922
  for (const segment of segments) {
15915
- if (typeof segment === "number") {
15916
- if (!Array.isArray(current) || segment < 0 || segment >= current.length) return { exists: false };
15917
- current = current[segment];
15923
+ if (Array.isArray(current)) {
15924
+ if (segment === "length") {
15925
+ current = current.length;
15926
+ continue;
15927
+ }
15928
+ const index = typeof segment === "number" ? segment : (/^\d+$/.test(segment) ? Number(segment) : -1);
15929
+ if (index < 0 || index >= current.length) return { exists: false };
15930
+ current = current[index];
15918
15931
  continue;
15919
15932
  }
15933
+ if (typeof segment === "number") return { exists: false };
15920
15934
  if (!current || typeof current !== "object" || Array.isArray(current) || !Object.hasOwn(current, segment)) {
15921
15935
  return { exists: false };
15922
15936
  }
package/dist/index.js CHANGED
@@ -62,7 +62,7 @@ import {
62
62
  resolveRiddleProofProfileTimeoutSec,
63
63
  slugifyRiddleProofProfileName,
64
64
  summarizeRiddleProofProfileResult
65
- } from "./chunk-7ZY6ONH4.js";
65
+ } from "./chunk-KBLWL6MZ.js";
66
66
  import {
67
67
  DEFAULT_RIDDLE_API_BASE_URL,
68
68
  DEFAULT_RIDDLE_API_KEY_FILE,
package/dist/profile.cjs CHANGED
@@ -404,11 +404,19 @@ function resolveJsonPath(root, path) {
404
404
  }
405
405
  let current = root;
406
406
  for (const segment of segments) {
407
- if (typeof segment === "number") {
408
- if (!Array.isArray(current) || segment < 0 || segment >= current.length) return { exists: false };
409
- current = current[segment];
407
+ if (Array.isArray(current)) {
408
+ if (segment === "length") {
409
+ current = current.length;
410
+ continue;
411
+ }
412
+ const index = typeof segment === "number" ? segment : /^\d+$/.test(segment) ? Number(segment) : -1;
413
+ if (index < 0 || index >= current.length) return { exists: false };
414
+ current = current[index];
410
415
  continue;
411
416
  }
417
+ if (typeof segment === "number") {
418
+ return { exists: false };
419
+ }
412
420
  if (!isRecord(current) || !hasOwn(current, segment)) return { exists: false };
413
421
  current = current[segment];
414
422
  }
@@ -7226,11 +7234,17 @@ function resolveJsonProbePath(root, path) {
7226
7234
  }
7227
7235
  let current = root;
7228
7236
  for (const segment of segments) {
7229
- if (typeof segment === "number") {
7230
- if (!Array.isArray(current) || segment < 0 || segment >= current.length) return { exists: false };
7231
- current = current[segment];
7237
+ if (Array.isArray(current)) {
7238
+ if (segment === "length") {
7239
+ current = current.length;
7240
+ continue;
7241
+ }
7242
+ const index = typeof segment === "number" ? segment : (/^\d+$/.test(segment) ? Number(segment) : -1);
7243
+ if (index < 0 || index >= current.length) return { exists: false };
7244
+ current = current[index];
7232
7245
  continue;
7233
7246
  }
7247
+ if (typeof segment === "number") return { exists: false };
7234
7248
  if (!current || typeof current !== "object" || Array.isArray(current) || !Object.hasOwn(current, segment)) {
7235
7249
  return { exists: false };
7236
7250
  }
package/dist/profile.js CHANGED
@@ -23,7 +23,7 @@ import {
23
23
  resolveRiddleProofProfileTimeoutSec,
24
24
  slugifyRiddleProofProfileName,
25
25
  summarizeRiddleProofProfileResult
26
- } from "./chunk-7ZY6ONH4.js";
26
+ } from "./chunk-KBLWL6MZ.js";
27
27
  export {
28
28
  RIDDLE_PROOF_PROFILE_CHECK_TYPES,
29
29
  RIDDLE_PROOF_PROFILE_EVIDENCE_VERSION,
@@ -292,7 +292,7 @@ declare function executeWorkflow(params: WorkflowParams, pluginConfig: any, reso
292
292
  blocking?: boolean;
293
293
  details?: Record<string, unknown>;
294
294
  ok: boolean;
295
- action: "setup" | "recon" | "author" | "implement" | "verify" | "ship" | "run";
295
+ action: "author" | "recon" | "ship" | "implement" | "verify" | "setup" | "run";
296
296
  state_path: string;
297
297
  stage: any;
298
298
  summary: string;
@@ -382,7 +382,7 @@ declare function executeWorkflow(params: WorkflowParams, pluginConfig: any, reso
382
382
  continueWithStage?: WorkflowStage | null;
383
383
  blocking?: boolean;
384
384
  details?: Record<string, unknown>;
385
- action: "setup" | "recon" | "author" | "implement" | "verify" | "ship" | "run";
385
+ action: "author" | "recon" | "ship" | "implement" | "verify" | "setup" | "run";
386
386
  state_path: string;
387
387
  stage: any;
388
388
  checkpoint: string;
@@ -659,7 +659,7 @@ declare function executeWorkflow(params: WorkflowParams, pluginConfig: any, reso
659
659
  error?: undefined;
660
660
  } | {
661
661
  ok: boolean;
662
- action: "setup" | "recon" | "author" | "implement" | "verify" | "ship" | "run";
662
+ action: "author" | "recon" | "ship" | "implement" | "verify" | "setup" | "run";
663
663
  state_path: string;
664
664
  stage: any;
665
665
  summary: string;
@@ -292,7 +292,7 @@ declare function executeWorkflow(params: WorkflowParams, pluginConfig: any, reso
292
292
  blocking?: boolean;
293
293
  details?: Record<string, unknown>;
294
294
  ok: boolean;
295
- action: "setup" | "recon" | "author" | "implement" | "verify" | "ship" | "run";
295
+ action: "author" | "recon" | "ship" | "implement" | "verify" | "setup" | "run";
296
296
  state_path: string;
297
297
  stage: any;
298
298
  summary: string;
@@ -382,7 +382,7 @@ declare function executeWorkflow(params: WorkflowParams, pluginConfig: any, reso
382
382
  continueWithStage?: WorkflowStage | null;
383
383
  blocking?: boolean;
384
384
  details?: Record<string, unknown>;
385
- action: "setup" | "recon" | "author" | "implement" | "verify" | "ship" | "run";
385
+ action: "author" | "recon" | "ship" | "implement" | "verify" | "setup" | "run";
386
386
  state_path: string;
387
387
  stage: any;
388
388
  checkpoint: string;
@@ -659,7 +659,7 @@ declare function executeWorkflow(params: WorkflowParams, pluginConfig: any, reso
659
659
  error?: undefined;
660
660
  } | {
661
661
  ok: boolean;
662
- action: "setup" | "recon" | "author" | "implement" | "verify" | "ship" | "run";
662
+ action: "author" | "recon" | "ship" | "implement" | "verify" | "setup" | "run";
663
663
  state_path: string;
664
664
  stage: any;
665
665
  summary: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riddledc/riddle-proof",
3
- "version": "0.7.170",
3
+ "version": "0.7.171",
4
4
  "description": "Reusable Riddle Proof contracts and helpers for evidence-backed agent changes.",
5
5
  "license": "MIT",
6
6
  "author": "RiddleDC",