carrick 0.3.127 → 0.3.129
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/package.json +6 -6
- package/plugin/.claude-plugin/plugin.json +1 -1
- package/sidecar/dist/src/capture/anchors.js +5 -1
- package/sidecar/dist/src/capture/check-classify.d.ts +8 -1
- package/sidecar/dist/src/capture/check-classify.js +21 -1
- package/sidecar/dist/src/capture/check-probe.d.ts +7 -7
- package/sidecar/dist/src/capture/check-probe.js +13 -14
- package/sidecar/dist/src/capture/check.js +5 -5
- package/sidecar/dist/src/index.js +43 -4
- package/sidecar/dist/src/library-claims.d.ts +63 -3
- package/sidecar/dist/src/library-claims.js +380 -39
- package/sidecar/dist/src/retype.js +36 -0
- package/sidecar/dist/src/server-labels.d.ts +29 -0
- package/sidecar/dist/src/server-labels.js +45 -0
- package/sidecar/dist/src/stated-params.d.ts +138 -0
- package/sidecar/dist/src/stated-params.js +547 -0
- package/sidecar/dist/src/type-inferrer.d.ts +89 -1
- package/sidecar/dist/src/type-inferrer.js +429 -17
- package/sidecar/dist/src/types.d.ts +76 -3
- package/sidecar/dist/src/unwidened.d.ts +11 -2
- package/sidecar/dist/src/unwidened.js +50 -3
- package/sidecar/dist/src/validators.d.ts +228 -59
- package/sidecar/dist/src/validators.js +45 -2
|
@@ -256,6 +256,8 @@ export const InferRequestSchema = BaseRequestSchema.extend({
|
|
|
256
256
|
source_file: z.string().min(1),
|
|
257
257
|
}))
|
|
258
258
|
.optional(),
|
|
259
|
+
// Declared below with the library claims; read lazily (carrick#2674).
|
|
260
|
+
server_claims: z.lazy(() => ServerClaimsSchema).optional(),
|
|
259
261
|
});
|
|
260
262
|
export const HealthRequestSchema = BaseRequestSchema.extend({
|
|
261
263
|
action: z.literal('health'),
|
|
@@ -364,7 +366,15 @@ const ClaimSlotSchema = z
|
|
|
364
366
|
key: z.string().min(1).optional(),
|
|
365
367
|
})
|
|
366
368
|
.strict();
|
|
367
|
-
const BoundNameSchema = z.object({ bound: z.enum(['maker', 'scope']) }).strict();
|
|
369
|
+
const BoundNameSchema = z.object({ bound: z.enum(['maker', 'scope', 'key']) }).strict();
|
|
370
|
+
/** Procedure routers (#2474 R6a): where a router member takes its procedures, and how nested keys join. */
|
|
371
|
+
const CollectsSchema = z
|
|
372
|
+
.object({
|
|
373
|
+
arg: z.number().int().nonnegative(),
|
|
374
|
+
key: z.string().min(1).optional(),
|
|
375
|
+
join: z.string().min(1),
|
|
376
|
+
})
|
|
377
|
+
.strict();
|
|
368
378
|
/**
|
|
369
379
|
* Label structure v2 (carrick#2434). The schema takes the shape only: which
|
|
370
380
|
* method word, side or export a field names is the verifier's per-check
|
|
@@ -391,6 +401,7 @@ const RequestAtSchema = z
|
|
|
391
401
|
path: z.array(z.string().min(1)).optional(),
|
|
392
402
|
url: z.array(z.string().min(1)).optional(),
|
|
393
403
|
method: z.array(z.string().min(1)).optional(),
|
|
404
|
+
body: z.array(z.string().min(1)).optional(),
|
|
394
405
|
})
|
|
395
406
|
.strict();
|
|
396
407
|
const ClaimOnSchema = z.enum(['export', 'instance', 'both']);
|
|
@@ -426,7 +437,8 @@ const LibraryClaimSchema = z.discriminatedUnion('kind', [
|
|
|
426
437
|
.object({
|
|
427
438
|
kind: z.literal('scope'),
|
|
428
439
|
member: z.string().min(1),
|
|
429
|
-
name
|
|
440
|
+
// Exactly one of `name` and `collects`: the verifier's verdict (#2474 R6a).
|
|
441
|
+
name: ClaimSlotSchema.optional(),
|
|
430
442
|
path: MemberPathSchema.optional(),
|
|
431
443
|
on: ClaimOnSchema.optional(),
|
|
432
444
|
of: z.string().min(1).optional(),
|
|
@@ -436,6 +448,7 @@ const LibraryClaimSchema = z.discriminatedUnion('kind', [
|
|
|
436
448
|
runs: ClaimSlotSchema.optional(),
|
|
437
449
|
yields: YieldsSchema.optional(),
|
|
438
450
|
mounts: ClaimSlotSchema.optional(),
|
|
451
|
+
collects: CollectsSchema.optional(),
|
|
439
452
|
})
|
|
440
453
|
.strict(),
|
|
441
454
|
z
|
|
@@ -494,6 +507,36 @@ const LibraryCheckSchema = z
|
|
|
494
507
|
claim: LibraryClaimSchema,
|
|
495
508
|
})
|
|
496
509
|
.strict();
|
|
510
|
+
/**
|
|
511
|
+
* The server-framework claims an `infer` request reads handler parameters
|
|
512
|
+
* through (carrick#2674). Each check is read on its own by
|
|
513
|
+
* `settledServerChecks`: a refused one is dropped, never the request.
|
|
514
|
+
*/
|
|
515
|
+
const ServerClaimsSchema = z
|
|
516
|
+
.object({
|
|
517
|
+
from_dir: z.string().min(1),
|
|
518
|
+
scan_root: z.string().min(1).optional(),
|
|
519
|
+
checks: z.array(z.unknown()),
|
|
520
|
+
type_packages: z.record(z.string().min(1), z.array(z.string().min(1))).optional(),
|
|
521
|
+
})
|
|
522
|
+
.strict();
|
|
523
|
+
/**
|
|
524
|
+
* The checks of an `infer` request's server claims the library-check schema
|
|
525
|
+
* takes, and how many it refused (carrick#2674). A refused claim reads
|
|
526
|
+
* nothing; the others still do.
|
|
527
|
+
*/
|
|
528
|
+
export function settledServerChecks(checks) {
|
|
529
|
+
const settled = [];
|
|
530
|
+
let refused = 0;
|
|
531
|
+
for (const check of checks) {
|
|
532
|
+
const parsed = LibraryCheckSchema.safeParse(check);
|
|
533
|
+
if (parsed.success)
|
|
534
|
+
settled.push(parsed.data);
|
|
535
|
+
else
|
|
536
|
+
refused += 1;
|
|
537
|
+
}
|
|
538
|
+
return { checks: settled, refused };
|
|
539
|
+
}
|
|
497
540
|
export const VerifyLibraryClaimsRequestSchema = BaseRequestSchema.extend({
|
|
498
541
|
action: z.literal('verify_library_claims'),
|
|
499
542
|
from_dir: z.string().min(1),
|