carrick 0.3.97 → 0.3.99

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 (58) hide show
  1. package/bin/carrick.mjs +19 -14
  2. package/dist/auth/run.d.ts +1 -1
  3. package/dist/auth/run.js +1 -1
  4. package/dist/contract.d.ts +15 -0
  5. package/dist/contract.js.map +1 -1
  6. package/dist/global-install.js +6 -5
  7. package/dist/global-install.js.map +1 -1
  8. package/dist/hook/reuse.d.ts +8 -3
  9. package/dist/hook/reuse.js +15 -3
  10. package/dist/hook/reuse.js.map +1 -1
  11. package/dist/init/connect.js +1 -1
  12. package/dist/init/connect.js.map +1 -1
  13. package/dist/init/doctor.js +5 -2
  14. package/dist/init/doctor.js.map +1 -1
  15. package/dist/init/hosted.d.ts +18 -1
  16. package/dist/init/hosted.js +84 -16
  17. package/dist/init/hosted.js.map +1 -1
  18. package/dist/init/install-id.d.ts +2 -2
  19. package/dist/init/install-id.js +3 -3
  20. package/dist/init/install-id.js.map +1 -1
  21. package/dist/init/mcp.d.ts +2 -2
  22. package/dist/init/mcp.js +2 -2
  23. package/dist/init/mcp.js.map +1 -1
  24. package/dist/init/outdated.d.ts +1 -1
  25. package/dist/init/outdated.js +1 -1
  26. package/dist/init/outdated.js.map +1 -1
  27. package/dist/init/output.d.ts +18 -1
  28. package/dist/init/output.js +40 -1
  29. package/dist/init/output.js.map +1 -1
  30. package/dist/init/remove.d.ts +71 -2
  31. package/dist/init/remove.js +474 -145
  32. package/dist/init/remove.js.map +1 -1
  33. package/dist/init/repo-copies.d.ts +16 -4
  34. package/dist/init/repo-copies.js +20 -6
  35. package/dist/init/repo-copies.js.map +1 -1
  36. package/dist/init/run.d.ts +12 -16
  37. package/dist/init/run.js +25 -42
  38. package/dist/init/run.js.map +1 -1
  39. package/dist/update.js +1 -0
  40. package/dist/update.js.map +1 -1
  41. package/package.json +6 -6
  42. package/plugin/.claude-plugin/plugin.json +1 -1
  43. package/sidecar/dist/src/bundler.d.ts +2 -0
  44. package/sidecar/dist/src/bundler.js +115 -39
  45. package/sidecar/dist/src/capture/index.d.ts +1 -0
  46. package/sidecar/dist/src/capture/index.js +91 -10
  47. package/sidecar/dist/src/capture/project-references.d.ts +67 -0
  48. package/sidecar/dist/src/capture/project-references.js +157 -0
  49. package/sidecar/dist/src/client-semantics.d.ts +36 -0
  50. package/sidecar/dist/src/client-semantics.js +1008 -0
  51. package/sidecar/dist/src/index.js +110 -10
  52. package/sidecar/dist/src/module-format.d.ts +32 -0
  53. package/sidecar/dist/src/module-format.js +102 -0
  54. package/sidecar/dist/src/project-loader.d.ts +24 -0
  55. package/sidecar/dist/src/project-loader.js +53 -5
  56. package/sidecar/dist/src/types.d.ts +86 -4
  57. package/sidecar/dist/src/validators.d.ts +463 -0
  58. package/sidecar/dist/src/validators.js +50 -0
@@ -1201,6 +1201,238 @@ export declare const RetypeCheckRequestSchema: z.ZodObject<{
1201
1201
  }[];
1202
1202
  budget_ms?: number | undefined;
1203
1203
  }>;
1204
+ export declare const VerifyClientSemanticsRequestSchema: z.ZodObject<{
1205
+ request_id: z.ZodString;
1206
+ } & {
1207
+ action: z.ZodLiteral<"verify_client_semantics">;
1208
+ from_dir: z.ZodString;
1209
+ checks: z.ZodArray<z.ZodObject<{
1210
+ claim_id: z.ZodString;
1211
+ package: z.ZodString;
1212
+ export: z.ZodString;
1213
+ receiver: z.ZodString;
1214
+ claim: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
1215
+ kind: z.ZodLiteral<"factory">;
1216
+ member: z.ZodString;
1217
+ base_url_key: z.ZodString;
1218
+ }, "strip", z.ZodTypeAny, {
1219
+ kind: "factory";
1220
+ member: string;
1221
+ base_url_key: string;
1222
+ }, {
1223
+ kind: "factory";
1224
+ member: string;
1225
+ base_url_key: string;
1226
+ }>, z.ZodObject<{
1227
+ kind: z.ZodLiteral<"verb">;
1228
+ member: z.ZodString;
1229
+ method: z.ZodString;
1230
+ }, "strip", z.ZodTypeAny, {
1231
+ kind: "verb";
1232
+ member: string;
1233
+ method: string;
1234
+ }, {
1235
+ kind: "verb";
1236
+ member: string;
1237
+ method: string;
1238
+ }>, z.ZodObject<{
1239
+ kind: z.ZodLiteral<"verb_body">;
1240
+ member: z.ZodString;
1241
+ args: z.ZodEnum<["path_body", "path_options"]>;
1242
+ body_key: z.ZodOptional<z.ZodString>;
1243
+ }, "strip", z.ZodTypeAny, {
1244
+ kind: "verb_body";
1245
+ member: string;
1246
+ args: "path_body" | "path_options";
1247
+ body_key?: string | undefined;
1248
+ }, {
1249
+ kind: "verb_body";
1250
+ member: string;
1251
+ args: "path_body" | "path_options";
1252
+ body_key?: string | undefined;
1253
+ }>, z.ZodObject<{
1254
+ kind: z.ZodLiteral<"request">;
1255
+ member: z.ZodNullable<z.ZodString>;
1256
+ args: z.ZodEnum<["config", "path_options"]>;
1257
+ url_key: z.ZodOptional<z.ZodString>;
1258
+ method_key: z.ZodString;
1259
+ }, "strip", z.ZodTypeAny, {
1260
+ kind: "request";
1261
+ member: string | null;
1262
+ args: "path_options" | "config";
1263
+ method_key: string;
1264
+ url_key?: string | undefined;
1265
+ }, {
1266
+ kind: "request";
1267
+ member: string | null;
1268
+ args: "path_options" | "config";
1269
+ method_key: string;
1270
+ url_key?: string | undefined;
1271
+ }>, z.ZodObject<{
1272
+ kind: z.ZodLiteral<"request_body">;
1273
+ member: z.ZodNullable<z.ZodString>;
1274
+ args: z.ZodEnum<["config", "path_options"]>;
1275
+ url_key: z.ZodOptional<z.ZodString>;
1276
+ method_key: z.ZodString;
1277
+ body_key: z.ZodString;
1278
+ }, "strip", z.ZodTypeAny, {
1279
+ kind: "request_body";
1280
+ member: string | null;
1281
+ args: "path_options" | "config";
1282
+ body_key: string;
1283
+ method_key: string;
1284
+ url_key?: string | undefined;
1285
+ }, {
1286
+ kind: "request_body";
1287
+ member: string | null;
1288
+ args: "path_options" | "config";
1289
+ body_key: string;
1290
+ method_key: string;
1291
+ url_key?: string | undefined;
1292
+ }>]>;
1293
+ }, "strip", z.ZodTypeAny, {
1294
+ export: string;
1295
+ claim: {
1296
+ kind: "factory";
1297
+ member: string;
1298
+ base_url_key: string;
1299
+ } | {
1300
+ kind: "verb";
1301
+ member: string;
1302
+ method: string;
1303
+ } | {
1304
+ kind: "verb_body";
1305
+ member: string;
1306
+ args: "path_body" | "path_options";
1307
+ body_key?: string | undefined;
1308
+ } | {
1309
+ kind: "request";
1310
+ member: string | null;
1311
+ args: "path_options" | "config";
1312
+ method_key: string;
1313
+ url_key?: string | undefined;
1314
+ } | {
1315
+ kind: "request_body";
1316
+ member: string | null;
1317
+ args: "path_options" | "config";
1318
+ body_key: string;
1319
+ method_key: string;
1320
+ url_key?: string | undefined;
1321
+ };
1322
+ claim_id: string;
1323
+ package: string;
1324
+ receiver: string;
1325
+ }, {
1326
+ export: string;
1327
+ claim: {
1328
+ kind: "factory";
1329
+ member: string;
1330
+ base_url_key: string;
1331
+ } | {
1332
+ kind: "verb";
1333
+ member: string;
1334
+ method: string;
1335
+ } | {
1336
+ kind: "verb_body";
1337
+ member: string;
1338
+ args: "path_body" | "path_options";
1339
+ body_key?: string | undefined;
1340
+ } | {
1341
+ kind: "request";
1342
+ member: string | null;
1343
+ args: "path_options" | "config";
1344
+ method_key: string;
1345
+ url_key?: string | undefined;
1346
+ } | {
1347
+ kind: "request_body";
1348
+ member: string | null;
1349
+ args: "path_options" | "config";
1350
+ body_key: string;
1351
+ method_key: string;
1352
+ url_key?: string | undefined;
1353
+ };
1354
+ claim_id: string;
1355
+ package: string;
1356
+ receiver: string;
1357
+ }>, "many">;
1358
+ budget_ms: z.ZodOptional<z.ZodNumber>;
1359
+ }, "strip", z.ZodTypeAny, {
1360
+ request_id: string;
1361
+ action: "verify_client_semantics";
1362
+ checks: {
1363
+ export: string;
1364
+ claim: {
1365
+ kind: "factory";
1366
+ member: string;
1367
+ base_url_key: string;
1368
+ } | {
1369
+ kind: "verb";
1370
+ member: string;
1371
+ method: string;
1372
+ } | {
1373
+ kind: "verb_body";
1374
+ member: string;
1375
+ args: "path_body" | "path_options";
1376
+ body_key?: string | undefined;
1377
+ } | {
1378
+ kind: "request";
1379
+ member: string | null;
1380
+ args: "path_options" | "config";
1381
+ method_key: string;
1382
+ url_key?: string | undefined;
1383
+ } | {
1384
+ kind: "request_body";
1385
+ member: string | null;
1386
+ args: "path_options" | "config";
1387
+ body_key: string;
1388
+ method_key: string;
1389
+ url_key?: string | undefined;
1390
+ };
1391
+ claim_id: string;
1392
+ package: string;
1393
+ receiver: string;
1394
+ }[];
1395
+ from_dir: string;
1396
+ budget_ms?: number | undefined;
1397
+ }, {
1398
+ request_id: string;
1399
+ action: "verify_client_semantics";
1400
+ checks: {
1401
+ export: string;
1402
+ claim: {
1403
+ kind: "factory";
1404
+ member: string;
1405
+ base_url_key: string;
1406
+ } | {
1407
+ kind: "verb";
1408
+ member: string;
1409
+ method: string;
1410
+ } | {
1411
+ kind: "verb_body";
1412
+ member: string;
1413
+ args: "path_body" | "path_options";
1414
+ body_key?: string | undefined;
1415
+ } | {
1416
+ kind: "request";
1417
+ member: string | null;
1418
+ args: "path_options" | "config";
1419
+ method_key: string;
1420
+ url_key?: string | undefined;
1421
+ } | {
1422
+ kind: "request_body";
1423
+ member: string | null;
1424
+ args: "path_options" | "config";
1425
+ body_key: string;
1426
+ method_key: string;
1427
+ url_key?: string | undefined;
1428
+ };
1429
+ claim_id: string;
1430
+ package: string;
1431
+ receiver: string;
1432
+ }[];
1433
+ from_dir: string;
1434
+ budget_ms?: number | undefined;
1435
+ }>;
1204
1436
  /**
1205
1437
  * The main sidecar request schema - a discriminated union on the 'action' field
1206
1438
  */
@@ -2312,6 +2544,237 @@ export declare const SidecarRequestSchema: z.ZodDiscriminatedUnion<"action", [z.
2312
2544
  budget_ms?: number | undefined;
2313
2545
  }>, z.ZodObject<{
2314
2546
  request_id: z.ZodString;
2547
+ } & {
2548
+ action: z.ZodLiteral<"verify_client_semantics">;
2549
+ from_dir: z.ZodString;
2550
+ checks: z.ZodArray<z.ZodObject<{
2551
+ claim_id: z.ZodString;
2552
+ package: z.ZodString;
2553
+ export: z.ZodString;
2554
+ receiver: z.ZodString;
2555
+ claim: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
2556
+ kind: z.ZodLiteral<"factory">;
2557
+ member: z.ZodString;
2558
+ base_url_key: z.ZodString;
2559
+ }, "strip", z.ZodTypeAny, {
2560
+ kind: "factory";
2561
+ member: string;
2562
+ base_url_key: string;
2563
+ }, {
2564
+ kind: "factory";
2565
+ member: string;
2566
+ base_url_key: string;
2567
+ }>, z.ZodObject<{
2568
+ kind: z.ZodLiteral<"verb">;
2569
+ member: z.ZodString;
2570
+ method: z.ZodString;
2571
+ }, "strip", z.ZodTypeAny, {
2572
+ kind: "verb";
2573
+ member: string;
2574
+ method: string;
2575
+ }, {
2576
+ kind: "verb";
2577
+ member: string;
2578
+ method: string;
2579
+ }>, z.ZodObject<{
2580
+ kind: z.ZodLiteral<"verb_body">;
2581
+ member: z.ZodString;
2582
+ args: z.ZodEnum<["path_body", "path_options"]>;
2583
+ body_key: z.ZodOptional<z.ZodString>;
2584
+ }, "strip", z.ZodTypeAny, {
2585
+ kind: "verb_body";
2586
+ member: string;
2587
+ args: "path_body" | "path_options";
2588
+ body_key?: string | undefined;
2589
+ }, {
2590
+ kind: "verb_body";
2591
+ member: string;
2592
+ args: "path_body" | "path_options";
2593
+ body_key?: string | undefined;
2594
+ }>, z.ZodObject<{
2595
+ kind: z.ZodLiteral<"request">;
2596
+ member: z.ZodNullable<z.ZodString>;
2597
+ args: z.ZodEnum<["config", "path_options"]>;
2598
+ url_key: z.ZodOptional<z.ZodString>;
2599
+ method_key: z.ZodString;
2600
+ }, "strip", z.ZodTypeAny, {
2601
+ kind: "request";
2602
+ member: string | null;
2603
+ args: "path_options" | "config";
2604
+ method_key: string;
2605
+ url_key?: string | undefined;
2606
+ }, {
2607
+ kind: "request";
2608
+ member: string | null;
2609
+ args: "path_options" | "config";
2610
+ method_key: string;
2611
+ url_key?: string | undefined;
2612
+ }>, z.ZodObject<{
2613
+ kind: z.ZodLiteral<"request_body">;
2614
+ member: z.ZodNullable<z.ZodString>;
2615
+ args: z.ZodEnum<["config", "path_options"]>;
2616
+ url_key: z.ZodOptional<z.ZodString>;
2617
+ method_key: z.ZodString;
2618
+ body_key: z.ZodString;
2619
+ }, "strip", z.ZodTypeAny, {
2620
+ kind: "request_body";
2621
+ member: string | null;
2622
+ args: "path_options" | "config";
2623
+ body_key: string;
2624
+ method_key: string;
2625
+ url_key?: string | undefined;
2626
+ }, {
2627
+ kind: "request_body";
2628
+ member: string | null;
2629
+ args: "path_options" | "config";
2630
+ body_key: string;
2631
+ method_key: string;
2632
+ url_key?: string | undefined;
2633
+ }>]>;
2634
+ }, "strip", z.ZodTypeAny, {
2635
+ export: string;
2636
+ claim: {
2637
+ kind: "factory";
2638
+ member: string;
2639
+ base_url_key: string;
2640
+ } | {
2641
+ kind: "verb";
2642
+ member: string;
2643
+ method: string;
2644
+ } | {
2645
+ kind: "verb_body";
2646
+ member: string;
2647
+ args: "path_body" | "path_options";
2648
+ body_key?: string | undefined;
2649
+ } | {
2650
+ kind: "request";
2651
+ member: string | null;
2652
+ args: "path_options" | "config";
2653
+ method_key: string;
2654
+ url_key?: string | undefined;
2655
+ } | {
2656
+ kind: "request_body";
2657
+ member: string | null;
2658
+ args: "path_options" | "config";
2659
+ body_key: string;
2660
+ method_key: string;
2661
+ url_key?: string | undefined;
2662
+ };
2663
+ claim_id: string;
2664
+ package: string;
2665
+ receiver: string;
2666
+ }, {
2667
+ export: string;
2668
+ claim: {
2669
+ kind: "factory";
2670
+ member: string;
2671
+ base_url_key: string;
2672
+ } | {
2673
+ kind: "verb";
2674
+ member: string;
2675
+ method: string;
2676
+ } | {
2677
+ kind: "verb_body";
2678
+ member: string;
2679
+ args: "path_body" | "path_options";
2680
+ body_key?: string | undefined;
2681
+ } | {
2682
+ kind: "request";
2683
+ member: string | null;
2684
+ args: "path_options" | "config";
2685
+ method_key: string;
2686
+ url_key?: string | undefined;
2687
+ } | {
2688
+ kind: "request_body";
2689
+ member: string | null;
2690
+ args: "path_options" | "config";
2691
+ body_key: string;
2692
+ method_key: string;
2693
+ url_key?: string | undefined;
2694
+ };
2695
+ claim_id: string;
2696
+ package: string;
2697
+ receiver: string;
2698
+ }>, "many">;
2699
+ budget_ms: z.ZodOptional<z.ZodNumber>;
2700
+ }, "strip", z.ZodTypeAny, {
2701
+ request_id: string;
2702
+ action: "verify_client_semantics";
2703
+ checks: {
2704
+ export: string;
2705
+ claim: {
2706
+ kind: "factory";
2707
+ member: string;
2708
+ base_url_key: string;
2709
+ } | {
2710
+ kind: "verb";
2711
+ member: string;
2712
+ method: string;
2713
+ } | {
2714
+ kind: "verb_body";
2715
+ member: string;
2716
+ args: "path_body" | "path_options";
2717
+ body_key?: string | undefined;
2718
+ } | {
2719
+ kind: "request";
2720
+ member: string | null;
2721
+ args: "path_options" | "config";
2722
+ method_key: string;
2723
+ url_key?: string | undefined;
2724
+ } | {
2725
+ kind: "request_body";
2726
+ member: string | null;
2727
+ args: "path_options" | "config";
2728
+ body_key: string;
2729
+ method_key: string;
2730
+ url_key?: string | undefined;
2731
+ };
2732
+ claim_id: string;
2733
+ package: string;
2734
+ receiver: string;
2735
+ }[];
2736
+ from_dir: string;
2737
+ budget_ms?: number | undefined;
2738
+ }, {
2739
+ request_id: string;
2740
+ action: "verify_client_semantics";
2741
+ checks: {
2742
+ export: string;
2743
+ claim: {
2744
+ kind: "factory";
2745
+ member: string;
2746
+ base_url_key: string;
2747
+ } | {
2748
+ kind: "verb";
2749
+ member: string;
2750
+ method: string;
2751
+ } | {
2752
+ kind: "verb_body";
2753
+ member: string;
2754
+ args: "path_body" | "path_options";
2755
+ body_key?: string | undefined;
2756
+ } | {
2757
+ kind: "request";
2758
+ member: string | null;
2759
+ args: "path_options" | "config";
2760
+ method_key: string;
2761
+ url_key?: string | undefined;
2762
+ } | {
2763
+ kind: "request_body";
2764
+ member: string | null;
2765
+ args: "path_options" | "config";
2766
+ body_key: string;
2767
+ method_key: string;
2768
+ url_key?: string | undefined;
2769
+ };
2770
+ claim_id: string;
2771
+ package: string;
2772
+ receiver: string;
2773
+ }[];
2774
+ from_dir: string;
2775
+ budget_ms?: number | undefined;
2776
+ }>, z.ZodObject<{
2777
+ request_id: z.ZodString;
2315
2778
  } & {
2316
2779
  action: z.ZodLiteral<"health">;
2317
2780
  }, "strip", z.ZodTypeAny, {
@@ -300,6 +300,55 @@ export const RetypeCheckRequestSchema = BaseRequestSchema.extend({
300
300
  items: z.array(RetypeItemSchema).min(1, 'At least one item is required'),
301
301
  budget_ms: z.number().int().nonnegative().optional(),
302
302
  });
303
+ /** One library-semantics claim, as the scanner derives it (carrick#1564). */
304
+ const SemanticsClaimSchema = z.discriminatedUnion('kind', [
305
+ z.object({
306
+ kind: z.literal('factory'),
307
+ member: z.string().min(1),
308
+ base_url_key: z.string().min(1),
309
+ }),
310
+ z.object({
311
+ kind: z.literal('verb'),
312
+ member: z.string().min(1),
313
+ method: z.string().min(1),
314
+ }),
315
+ z.object({
316
+ kind: z.literal('verb_body'),
317
+ member: z.string().min(1),
318
+ args: z.enum(['path_body', 'path_options']),
319
+ body_key: z.string().min(1).optional(),
320
+ }),
321
+ z.object({
322
+ kind: z.literal('request'),
323
+ member: z.string().min(1).nullable(),
324
+ args: z.enum(['config', 'path_options']),
325
+ url_key: z.string().min(1).optional(),
326
+ method_key: z.string().min(1),
327
+ }),
328
+ z.object({
329
+ kind: z.literal('request_body'),
330
+ member: z.string().min(1).nullable(),
331
+ args: z.enum(['config', 'path_options']),
332
+ url_key: z.string().min(1).optional(),
333
+ method_key: z.string().min(1),
334
+ body_key: z.string().min(1),
335
+ }),
336
+ ]);
337
+ const SemanticsCheckSchema = z.object({
338
+ claim_id: z.string().min(1),
339
+ package: z.string().min(1),
340
+ export: z.string().min(1),
341
+ // Any other receiver answers `unchecked` (`receiver_invalid`) on its own
342
+ // rather than failing the batch.
343
+ receiver: z.string().min(1),
344
+ claim: SemanticsClaimSchema,
345
+ });
346
+ export const VerifyClientSemanticsRequestSchema = BaseRequestSchema.extend({
347
+ action: z.literal('verify_client_semantics'),
348
+ from_dir: z.string().min(1),
349
+ checks: z.array(SemanticsCheckSchema),
350
+ budget_ms: z.number().int().nonnegative().optional(),
351
+ });
303
352
  // ============================================================================
304
353
  // Discriminated Union Schema
305
354
  // ============================================================================
@@ -317,6 +366,7 @@ export const SidecarRequestSchema = z.discriminatedUnion('action', [
317
366
  CheckCompatibilityRequestSchema,
318
367
  ResolveDefinitionsRequestSchema,
319
368
  RetypeCheckRequestSchema,
369
+ VerifyClientSemanticsRequestSchema,
320
370
  HealthRequestSchema,
321
371
  ShutdownRequestSchema,
322
372
  ]);