carrick 0.3.160 → 0.3.162

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 (79) hide show
  1. package/dist/contract.d.ts +8 -0
  2. package/dist/contract.js.map +1 -1
  3. package/dist/facts/store.d.ts +12 -0
  4. package/dist/facts/store.js +15 -0
  5. package/dist/facts/store.js.map +1 -1
  6. package/dist/held/daemon.d.ts +8 -0
  7. package/dist/held/daemon.js.map +1 -1
  8. package/dist/held/early.d.ts +3 -1
  9. package/dist/held/early.js +76 -6
  10. package/dist/held/early.js.map +1 -1
  11. package/dist/held/message-rows.d.ts +3 -0
  12. package/dist/held/message-rows.js +41 -0
  13. package/dist/held/message-rows.js.map +1 -0
  14. package/dist/held/place.d.ts +11 -2
  15. package/dist/held/place.js +4 -1
  16. package/dist/held/place.js.map +1 -1
  17. package/dist/held/runtime.d.ts +1 -1
  18. package/dist/held/runtime.js +47 -17
  19. package/dist/held/runtime.js.map +1 -1
  20. package/dist/held/shadow.d.ts +2 -0
  21. package/dist/held/shadow.js.map +1 -1
  22. package/dist/hook/confirm.js +40 -21
  23. package/dist/hook/confirm.js.map +1 -1
  24. package/dist/init/codex.d.ts +1 -1
  25. package/dist/init/codex.js +8 -4
  26. package/dist/init/codex.js.map +1 -1
  27. package/dist/init/doctor.d.ts +10 -13
  28. package/dist/init/doctor.js +26 -92
  29. package/dist/init/doctor.js.map +1 -1
  30. package/dist/init/launcher.d.ts +35 -0
  31. package/dist/init/launcher.js +85 -0
  32. package/dist/init/launcher.js.map +1 -0
  33. package/dist/init/outdated.d.ts +3 -4
  34. package/dist/init/outdated.js +19 -8
  35. package/dist/init/outdated.js.map +1 -1
  36. package/dist/init/remove.js +4 -0
  37. package/dist/init/remove.js.map +1 -1
  38. package/dist/init/repo-copies.d.ts +1 -1
  39. package/dist/init/repo-copies.js +13 -4
  40. package/dist/init/repo-copies.js.map +1 -1
  41. package/dist/init/run.js +17 -26
  42. package/dist/init/run.js.map +1 -1
  43. package/dist/init/self-update.js +7 -4
  44. package/dist/init/self-update.js.map +1 -1
  45. package/dist/init/settings.d.ts +0 -34
  46. package/dist/init/settings.js +11 -45
  47. package/dist/init/settings.js.map +1 -1
  48. package/dist/render.d.ts +6 -0
  49. package/dist/render.js +27 -7
  50. package/dist/render.js.map +1 -1
  51. package/package.json +6 -6
  52. package/plugin/.claude-plugin/plugin.json +1 -1
  53. package/plugin/hooks/carrick-hook.sh +122 -0
  54. package/plugin/hooks/hooks.json +8 -8
  55. package/sidecar/dist/src/capture/anchors.d.ts +2 -2
  56. package/sidecar/dist/src/capture/anchors.js +25 -10
  57. package/sidecar/dist/src/capture/api.d.ts +10 -0
  58. package/sidecar/dist/src/capture/check-classify.d.ts +11 -4
  59. package/sidecar/dist/src/capture/check-classify.js +65 -25
  60. package/sidecar/dist/src/capture/check-fields.d.ts +2 -1
  61. package/sidecar/dist/src/capture/check-fields.js +10 -2
  62. package/sidecar/dist/src/capture/check-probe.d.ts +77 -25
  63. package/sidecar/dist/src/capture/check-probe.js +100 -37
  64. package/sidecar/dist/src/capture/index.d.ts +3 -2
  65. package/sidecar/dist/src/capture/index.js +14 -2
  66. package/sidecar/dist/src/capture/reply-status.d.ts +86 -0
  67. package/sidecar/dist/src/capture/reply-status.js +255 -0
  68. package/sidecar/dist/src/capture/site-node.d.ts +34 -0
  69. package/sidecar/dist/src/capture/site-node.js +258 -0
  70. package/sidecar/dist/src/engine-stamp.json +1 -1
  71. package/sidecar/dist/src/held-shadow.d.ts +23 -2
  72. package/sidecar/dist/src/held-shadow.js +42 -8
  73. package/sidecar/dist/src/stated-params.d.ts +3 -2
  74. package/sidecar/dist/src/type-inferrer.d.ts +15 -55
  75. package/sidecar/dist/src/type-inferrer.js +83 -213
  76. package/sidecar/dist/src/types.d.ts +10 -0
  77. package/sidecar/dist/src/validators.d.ts +150 -28
  78. package/sidecar/dist/src/validators.js +15 -1
  79. package/templates/carrick-hook.sh +122 -0
@@ -91,12 +91,26 @@ export declare const InferRequestItemSchema: z.ZodObject<{
91
91
  span_start: number;
92
92
  span_end: number;
93
93
  }>>;
94
+ handler_lines: z.ZodOptional<z.ZodObject<{
95
+ start_line: z.ZodNumber;
96
+ end_line: z.ZodNumber;
97
+ }, "strict", z.ZodTypeAny, {
98
+ start_line: number;
99
+ end_line: number;
100
+ }, {
101
+ start_line: number;
102
+ end_line: number;
103
+ }>>;
94
104
  }, "strip", z.ZodTypeAny, {
95
- infer_kind: "request_body" | "call_result" | "function_return" | "expression" | "variable" | "response_body" | "signature_return" | "function_param" | "receiver_type" | "request_config";
105
+ infer_kind: "function_return" | "request_body" | "call_result" | "variable" | "expression" | "response_body" | "signature_return" | "function_param" | "receiver_type" | "request_config";
96
106
  file_path: string;
97
107
  line_number: number;
98
108
  member?: string | undefined;
99
109
  param_name?: string | undefined;
110
+ handler_lines?: {
111
+ start_line: number;
112
+ end_line: number;
113
+ } | undefined;
100
114
  alias?: string | undefined;
101
115
  result?: {
102
116
  whole: true;
@@ -116,11 +130,15 @@ export declare const InferRequestItemSchema: z.ZodObject<{
116
130
  span_end: number;
117
131
  } | undefined;
118
132
  }, {
119
- infer_kind: "request_body" | "call_result" | "function_return" | "expression" | "variable" | "response_body" | "signature_return" | "function_param" | "receiver_type" | "request_config";
133
+ infer_kind: "function_return" | "request_body" | "call_result" | "variable" | "expression" | "response_body" | "signature_return" | "function_param" | "receiver_type" | "request_config";
120
134
  file_path: string;
121
135
  line_number: number;
122
136
  member?: string | undefined;
123
137
  param_name?: string | undefined;
138
+ handler_lines?: {
139
+ start_line: number;
140
+ end_line: number;
141
+ } | undefined;
124
142
  alias?: string | undefined;
125
143
  result?: {
126
144
  whole: true;
@@ -429,13 +447,27 @@ export declare const CaptureV2RequestSchema: z.ZodObject<{
429
447
  parse: string;
430
448
  }>]>>;
431
449
  infer_kind: z.ZodOptional<z.ZodEnum<["function_return", "expression", "call_result", "variable", "response_body", "request_body", "signature_return", "function_param", "receiver_type", "request_config"]>>;
450
+ handler_lines: z.ZodOptional<z.ZodObject<{
451
+ start_line: z.ZodNumber;
452
+ end_line: z.ZodNumber;
453
+ }, "strict", z.ZodTypeAny, {
454
+ start_line: number;
455
+ end_line: number;
456
+ }, {
457
+ start_line: number;
458
+ end_line: number;
459
+ }>>;
432
460
  }, "strip", z.ZodTypeAny, {
433
461
  kind: "infer";
434
462
  alias: string;
435
463
  source_file: string;
436
464
  anchor_origin: "llm-symbol" | "deterministic-infer" | "anchor-backfill" | "manifest-placeholder";
437
465
  param_name?: string | undefined;
438
- infer_kind?: "request_body" | "call_result" | "function_return" | "expression" | "variable" | "response_body" | "signature_return" | "function_param" | "receiver_type" | "request_config" | undefined;
466
+ handler_lines?: {
467
+ start_line: number;
468
+ end_line: number;
469
+ } | undefined;
470
+ infer_kind?: "function_return" | "request_body" | "call_result" | "variable" | "expression" | "response_body" | "signature_return" | "function_param" | "receiver_type" | "request_config" | undefined;
439
471
  result?: {
440
472
  whole: true;
441
473
  } | {
@@ -454,7 +486,11 @@ export declare const CaptureV2RequestSchema: z.ZodObject<{
454
486
  source_file: string;
455
487
  anchor_origin: "llm-symbol" | "deterministic-infer" | "anchor-backfill" | "manifest-placeholder";
456
488
  param_name?: string | undefined;
457
- infer_kind?: "request_body" | "call_result" | "function_return" | "expression" | "variable" | "response_body" | "signature_return" | "function_param" | "receiver_type" | "request_config" | undefined;
489
+ handler_lines?: {
490
+ start_line: number;
491
+ end_line: number;
492
+ } | undefined;
493
+ infer_kind?: "function_return" | "request_body" | "call_result" | "variable" | "expression" | "response_body" | "signature_return" | "function_param" | "receiver_type" | "request_config" | undefined;
458
494
  result?: {
459
495
  whole: true;
460
496
  } | {
@@ -488,7 +524,7 @@ export declare const CaptureV2RequestSchema: z.ZodObject<{
488
524
  }>, "many">>;
489
525
  raw_text_read: z.ZodOptional<z.ZodLiteral<true>>;
490
526
  absent_body_tolerated: z.ZodOptional<z.ZodLiteral<true>>;
491
- unread_cause: z.ZodOptional<z.ZodEnum<["not_located", "site_unreadable"]>>;
527
+ unread_cause: z.ZodOptional<z.ZodString>;
492
528
  }, "strip", z.ZodTypeAny, {
493
529
  kind: "literal";
494
530
  alias: string;
@@ -497,7 +533,7 @@ export declare const CaptureV2RequestSchema: z.ZodObject<{
497
533
  raw_text_read?: true | undefined;
498
534
  absent_body_tolerated?: true | undefined;
499
535
  source_file?: string | undefined;
500
- unread_cause?: "not_located" | "site_unreadable" | undefined;
536
+ unread_cause?: string | undefined;
501
537
  printed_names?: {
502
538
  name: string;
503
539
  file: string;
@@ -511,7 +547,7 @@ export declare const CaptureV2RequestSchema: z.ZodObject<{
511
547
  raw_text_read?: true | undefined;
512
548
  absent_body_tolerated?: true | undefined;
513
549
  source_file?: string | undefined;
514
- unread_cause?: "not_located" | "site_unreadable" | undefined;
550
+ unread_cause?: string | undefined;
515
551
  printed_names?: {
516
552
  name: string;
517
553
  file: string;
@@ -545,7 +581,11 @@ export declare const CaptureV2RequestSchema: z.ZodObject<{
545
581
  source_file: string;
546
582
  anchor_origin: "llm-symbol" | "deterministic-infer" | "anchor-backfill" | "manifest-placeholder";
547
583
  param_name?: string | undefined;
548
- infer_kind?: "request_body" | "call_result" | "function_return" | "expression" | "variable" | "response_body" | "signature_return" | "function_param" | "receiver_type" | "request_config" | undefined;
584
+ handler_lines?: {
585
+ start_line: number;
586
+ end_line: number;
587
+ } | undefined;
588
+ infer_kind?: "function_return" | "request_body" | "call_result" | "variable" | "expression" | "response_body" | "signature_return" | "function_param" | "receiver_type" | "request_config" | undefined;
549
589
  result?: {
550
590
  whole: true;
551
591
  } | {
@@ -566,7 +606,7 @@ export declare const CaptureV2RequestSchema: z.ZodObject<{
566
606
  raw_text_read?: true | undefined;
567
607
  absent_body_tolerated?: true | undefined;
568
608
  source_file?: string | undefined;
569
- unread_cause?: "not_located" | "site_unreadable" | undefined;
609
+ unread_cause?: string | undefined;
570
610
  printed_names?: {
571
611
  name: string;
572
612
  file: string;
@@ -604,7 +644,11 @@ export declare const CaptureV2RequestSchema: z.ZodObject<{
604
644
  source_file: string;
605
645
  anchor_origin: "llm-symbol" | "deterministic-infer" | "anchor-backfill" | "manifest-placeholder";
606
646
  param_name?: string | undefined;
607
- infer_kind?: "request_body" | "call_result" | "function_return" | "expression" | "variable" | "response_body" | "signature_return" | "function_param" | "receiver_type" | "request_config" | undefined;
647
+ handler_lines?: {
648
+ start_line: number;
649
+ end_line: number;
650
+ } | undefined;
651
+ infer_kind?: "function_return" | "request_body" | "call_result" | "variable" | "expression" | "response_body" | "signature_return" | "function_param" | "receiver_type" | "request_config" | undefined;
608
652
  result?: {
609
653
  whole: true;
610
654
  } | {
@@ -625,7 +669,7 @@ export declare const CaptureV2RequestSchema: z.ZodObject<{
625
669
  raw_text_read?: true | undefined;
626
670
  absent_body_tolerated?: true | undefined;
627
671
  source_file?: string | undefined;
628
- unread_cause?: "not_located" | "site_unreadable" | undefined;
672
+ unread_cause?: string | undefined;
629
673
  printed_names?: {
630
674
  name: string;
631
675
  file: string;
@@ -917,12 +961,26 @@ export declare const InferRequestSchema: z.ZodObject<{
917
961
  span_start: number;
918
962
  span_end: number;
919
963
  }>>;
964
+ handler_lines: z.ZodOptional<z.ZodObject<{
965
+ start_line: z.ZodNumber;
966
+ end_line: z.ZodNumber;
967
+ }, "strict", z.ZodTypeAny, {
968
+ start_line: number;
969
+ end_line: number;
970
+ }, {
971
+ start_line: number;
972
+ end_line: number;
973
+ }>>;
920
974
  }, "strip", z.ZodTypeAny, {
921
- infer_kind: "request_body" | "call_result" | "function_return" | "expression" | "variable" | "response_body" | "signature_return" | "function_param" | "receiver_type" | "request_config";
975
+ infer_kind: "function_return" | "request_body" | "call_result" | "variable" | "expression" | "response_body" | "signature_return" | "function_param" | "receiver_type" | "request_config";
922
976
  file_path: string;
923
977
  line_number: number;
924
978
  member?: string | undefined;
925
979
  param_name?: string | undefined;
980
+ handler_lines?: {
981
+ start_line: number;
982
+ end_line: number;
983
+ } | undefined;
926
984
  alias?: string | undefined;
927
985
  result?: {
928
986
  whole: true;
@@ -942,11 +1000,15 @@ export declare const InferRequestSchema: z.ZodObject<{
942
1000
  span_end: number;
943
1001
  } | undefined;
944
1002
  }, {
945
- infer_kind: "request_body" | "call_result" | "function_return" | "expression" | "variable" | "response_body" | "signature_return" | "function_param" | "receiver_type" | "request_config";
1003
+ infer_kind: "function_return" | "request_body" | "call_result" | "variable" | "expression" | "response_body" | "signature_return" | "function_param" | "receiver_type" | "request_config";
946
1004
  file_path: string;
947
1005
  line_number: number;
948
1006
  member?: string | undefined;
949
1007
  param_name?: string | undefined;
1008
+ handler_lines?: {
1009
+ start_line: number;
1010
+ end_line: number;
1011
+ } | undefined;
950
1012
  alias?: string | undefined;
951
1013
  result?: {
952
1014
  whole: true;
@@ -1047,11 +1109,15 @@ export declare const InferRequestSchema: z.ZodObject<{
1047
1109
  request_id: string;
1048
1110
  action: "infer";
1049
1111
  requests: {
1050
- infer_kind: "request_body" | "call_result" | "function_return" | "expression" | "variable" | "response_body" | "signature_return" | "function_param" | "receiver_type" | "request_config";
1112
+ infer_kind: "function_return" | "request_body" | "call_result" | "variable" | "expression" | "response_body" | "signature_return" | "function_param" | "receiver_type" | "request_config";
1051
1113
  file_path: string;
1052
1114
  line_number: number;
1053
1115
  member?: string | undefined;
1054
1116
  param_name?: string | undefined;
1117
+ handler_lines?: {
1118
+ start_line: number;
1119
+ end_line: number;
1120
+ } | undefined;
1055
1121
  alias?: string | undefined;
1056
1122
  result?: {
1057
1123
  whole: true;
@@ -1098,11 +1164,15 @@ export declare const InferRequestSchema: z.ZodObject<{
1098
1164
  request_id: string;
1099
1165
  action: "infer";
1100
1166
  requests: {
1101
- infer_kind: "request_body" | "call_result" | "function_return" | "expression" | "variable" | "response_body" | "signature_return" | "function_param" | "receiver_type" | "request_config";
1167
+ infer_kind: "function_return" | "request_body" | "call_result" | "variable" | "expression" | "response_body" | "signature_return" | "function_param" | "receiver_type" | "request_config";
1102
1168
  file_path: string;
1103
1169
  line_number: number;
1104
1170
  member?: string | undefined;
1105
1171
  param_name?: string | undefined;
1172
+ handler_lines?: {
1173
+ start_line: number;
1174
+ end_line: number;
1175
+ } | undefined;
1106
1176
  alias?: string | undefined;
1107
1177
  result?: {
1108
1178
  whole: true;
@@ -4768,13 +4838,27 @@ export declare const SidecarRequestSchema: z.ZodDiscriminatedUnion<"action", [z.
4768
4838
  parse: string;
4769
4839
  }>]>>;
4770
4840
  infer_kind: z.ZodOptional<z.ZodEnum<["function_return", "expression", "call_result", "variable", "response_body", "request_body", "signature_return", "function_param", "receiver_type", "request_config"]>>;
4841
+ handler_lines: z.ZodOptional<z.ZodObject<{
4842
+ start_line: z.ZodNumber;
4843
+ end_line: z.ZodNumber;
4844
+ }, "strict", z.ZodTypeAny, {
4845
+ start_line: number;
4846
+ end_line: number;
4847
+ }, {
4848
+ start_line: number;
4849
+ end_line: number;
4850
+ }>>;
4771
4851
  }, "strip", z.ZodTypeAny, {
4772
4852
  kind: "infer";
4773
4853
  alias: string;
4774
4854
  source_file: string;
4775
4855
  anchor_origin: "llm-symbol" | "deterministic-infer" | "anchor-backfill" | "manifest-placeholder";
4776
4856
  param_name?: string | undefined;
4777
- infer_kind?: "request_body" | "call_result" | "function_return" | "expression" | "variable" | "response_body" | "signature_return" | "function_param" | "receiver_type" | "request_config" | undefined;
4857
+ handler_lines?: {
4858
+ start_line: number;
4859
+ end_line: number;
4860
+ } | undefined;
4861
+ infer_kind?: "function_return" | "request_body" | "call_result" | "variable" | "expression" | "response_body" | "signature_return" | "function_param" | "receiver_type" | "request_config" | undefined;
4778
4862
  result?: {
4779
4863
  whole: true;
4780
4864
  } | {
@@ -4793,7 +4877,11 @@ export declare const SidecarRequestSchema: z.ZodDiscriminatedUnion<"action", [z.
4793
4877
  source_file: string;
4794
4878
  anchor_origin: "llm-symbol" | "deterministic-infer" | "anchor-backfill" | "manifest-placeholder";
4795
4879
  param_name?: string | undefined;
4796
- infer_kind?: "request_body" | "call_result" | "function_return" | "expression" | "variable" | "response_body" | "signature_return" | "function_param" | "receiver_type" | "request_config" | undefined;
4880
+ handler_lines?: {
4881
+ start_line: number;
4882
+ end_line: number;
4883
+ } | undefined;
4884
+ infer_kind?: "function_return" | "request_body" | "call_result" | "variable" | "expression" | "response_body" | "signature_return" | "function_param" | "receiver_type" | "request_config" | undefined;
4797
4885
  result?: {
4798
4886
  whole: true;
4799
4887
  } | {
@@ -4827,7 +4915,7 @@ export declare const SidecarRequestSchema: z.ZodDiscriminatedUnion<"action", [z.
4827
4915
  }>, "many">>;
4828
4916
  raw_text_read: z.ZodOptional<z.ZodLiteral<true>>;
4829
4917
  absent_body_tolerated: z.ZodOptional<z.ZodLiteral<true>>;
4830
- unread_cause: z.ZodOptional<z.ZodEnum<["not_located", "site_unreadable"]>>;
4918
+ unread_cause: z.ZodOptional<z.ZodString>;
4831
4919
  }, "strip", z.ZodTypeAny, {
4832
4920
  kind: "literal";
4833
4921
  alias: string;
@@ -4836,7 +4924,7 @@ export declare const SidecarRequestSchema: z.ZodDiscriminatedUnion<"action", [z.
4836
4924
  raw_text_read?: true | undefined;
4837
4925
  absent_body_tolerated?: true | undefined;
4838
4926
  source_file?: string | undefined;
4839
- unread_cause?: "not_located" | "site_unreadable" | undefined;
4927
+ unread_cause?: string | undefined;
4840
4928
  printed_names?: {
4841
4929
  name: string;
4842
4930
  file: string;
@@ -4850,7 +4938,7 @@ export declare const SidecarRequestSchema: z.ZodDiscriminatedUnion<"action", [z.
4850
4938
  raw_text_read?: true | undefined;
4851
4939
  absent_body_tolerated?: true | undefined;
4852
4940
  source_file?: string | undefined;
4853
- unread_cause?: "not_located" | "site_unreadable" | undefined;
4941
+ unread_cause?: string | undefined;
4854
4942
  printed_names?: {
4855
4943
  name: string;
4856
4944
  file: string;
@@ -4884,7 +4972,11 @@ export declare const SidecarRequestSchema: z.ZodDiscriminatedUnion<"action", [z.
4884
4972
  source_file: string;
4885
4973
  anchor_origin: "llm-symbol" | "deterministic-infer" | "anchor-backfill" | "manifest-placeholder";
4886
4974
  param_name?: string | undefined;
4887
- infer_kind?: "request_body" | "call_result" | "function_return" | "expression" | "variable" | "response_body" | "signature_return" | "function_param" | "receiver_type" | "request_config" | undefined;
4975
+ handler_lines?: {
4976
+ start_line: number;
4977
+ end_line: number;
4978
+ } | undefined;
4979
+ infer_kind?: "function_return" | "request_body" | "call_result" | "variable" | "expression" | "response_body" | "signature_return" | "function_param" | "receiver_type" | "request_config" | undefined;
4888
4980
  result?: {
4889
4981
  whole: true;
4890
4982
  } | {
@@ -4905,7 +4997,7 @@ export declare const SidecarRequestSchema: z.ZodDiscriminatedUnion<"action", [z.
4905
4997
  raw_text_read?: true | undefined;
4906
4998
  absent_body_tolerated?: true | undefined;
4907
4999
  source_file?: string | undefined;
4908
- unread_cause?: "not_located" | "site_unreadable" | undefined;
5000
+ unread_cause?: string | undefined;
4909
5001
  printed_names?: {
4910
5002
  name: string;
4911
5003
  file: string;
@@ -4943,7 +5035,11 @@ export declare const SidecarRequestSchema: z.ZodDiscriminatedUnion<"action", [z.
4943
5035
  source_file: string;
4944
5036
  anchor_origin: "llm-symbol" | "deterministic-infer" | "anchor-backfill" | "manifest-placeholder";
4945
5037
  param_name?: string | undefined;
4946
- infer_kind?: "request_body" | "call_result" | "function_return" | "expression" | "variable" | "response_body" | "signature_return" | "function_param" | "receiver_type" | "request_config" | undefined;
5038
+ handler_lines?: {
5039
+ start_line: number;
5040
+ end_line: number;
5041
+ } | undefined;
5042
+ infer_kind?: "function_return" | "request_body" | "call_result" | "variable" | "expression" | "response_body" | "signature_return" | "function_param" | "receiver_type" | "request_config" | undefined;
4947
5043
  result?: {
4948
5044
  whole: true;
4949
5045
  } | {
@@ -4964,7 +5060,7 @@ export declare const SidecarRequestSchema: z.ZodDiscriminatedUnion<"action", [z.
4964
5060
  raw_text_read?: true | undefined;
4965
5061
  absent_body_tolerated?: true | undefined;
4966
5062
  source_file?: string | undefined;
4967
- unread_cause?: "not_located" | "site_unreadable" | undefined;
5063
+ unread_cause?: string | undefined;
4968
5064
  printed_names?: {
4969
5065
  name: string;
4970
5066
  file: string;
@@ -5242,12 +5338,26 @@ export declare const SidecarRequestSchema: z.ZodDiscriminatedUnion<"action", [z.
5242
5338
  span_start: number;
5243
5339
  span_end: number;
5244
5340
  }>>;
5341
+ handler_lines: z.ZodOptional<z.ZodObject<{
5342
+ start_line: z.ZodNumber;
5343
+ end_line: z.ZodNumber;
5344
+ }, "strict", z.ZodTypeAny, {
5345
+ start_line: number;
5346
+ end_line: number;
5347
+ }, {
5348
+ start_line: number;
5349
+ end_line: number;
5350
+ }>>;
5245
5351
  }, "strip", z.ZodTypeAny, {
5246
- infer_kind: "request_body" | "call_result" | "function_return" | "expression" | "variable" | "response_body" | "signature_return" | "function_param" | "receiver_type" | "request_config";
5352
+ infer_kind: "function_return" | "request_body" | "call_result" | "variable" | "expression" | "response_body" | "signature_return" | "function_param" | "receiver_type" | "request_config";
5247
5353
  file_path: string;
5248
5354
  line_number: number;
5249
5355
  member?: string | undefined;
5250
5356
  param_name?: string | undefined;
5357
+ handler_lines?: {
5358
+ start_line: number;
5359
+ end_line: number;
5360
+ } | undefined;
5251
5361
  alias?: string | undefined;
5252
5362
  result?: {
5253
5363
  whole: true;
@@ -5267,11 +5377,15 @@ export declare const SidecarRequestSchema: z.ZodDiscriminatedUnion<"action", [z.
5267
5377
  span_end: number;
5268
5378
  } | undefined;
5269
5379
  }, {
5270
- infer_kind: "request_body" | "call_result" | "function_return" | "expression" | "variable" | "response_body" | "signature_return" | "function_param" | "receiver_type" | "request_config";
5380
+ infer_kind: "function_return" | "request_body" | "call_result" | "variable" | "expression" | "response_body" | "signature_return" | "function_param" | "receiver_type" | "request_config";
5271
5381
  file_path: string;
5272
5382
  line_number: number;
5273
5383
  member?: string | undefined;
5274
5384
  param_name?: string | undefined;
5385
+ handler_lines?: {
5386
+ start_line: number;
5387
+ end_line: number;
5388
+ } | undefined;
5275
5389
  alias?: string | undefined;
5276
5390
  result?: {
5277
5391
  whole: true;
@@ -5372,11 +5486,15 @@ export declare const SidecarRequestSchema: z.ZodDiscriminatedUnion<"action", [z.
5372
5486
  request_id: string;
5373
5487
  action: "infer";
5374
5488
  requests: {
5375
- infer_kind: "request_body" | "call_result" | "function_return" | "expression" | "variable" | "response_body" | "signature_return" | "function_param" | "receiver_type" | "request_config";
5489
+ infer_kind: "function_return" | "request_body" | "call_result" | "variable" | "expression" | "response_body" | "signature_return" | "function_param" | "receiver_type" | "request_config";
5376
5490
  file_path: string;
5377
5491
  line_number: number;
5378
5492
  member?: string | undefined;
5379
5493
  param_name?: string | undefined;
5494
+ handler_lines?: {
5495
+ start_line: number;
5496
+ end_line: number;
5497
+ } | undefined;
5380
5498
  alias?: string | undefined;
5381
5499
  result?: {
5382
5500
  whole: true;
@@ -5423,11 +5541,15 @@ export declare const SidecarRequestSchema: z.ZodDiscriminatedUnion<"action", [z.
5423
5541
  request_id: string;
5424
5542
  action: "infer";
5425
5543
  requests: {
5426
- infer_kind: "request_body" | "call_result" | "function_return" | "expression" | "variable" | "response_body" | "signature_return" | "function_param" | "receiver_type" | "request_config";
5544
+ infer_kind: "function_return" | "request_body" | "call_result" | "variable" | "expression" | "response_body" | "signature_return" | "function_param" | "receiver_type" | "request_config";
5427
5545
  file_path: string;
5428
5546
  line_number: number;
5429
5547
  member?: string | undefined;
5430
5548
  param_name?: string | undefined;
5549
+ handler_lines?: {
5550
+ start_line: number;
5551
+ end_line: number;
5552
+ } | undefined;
5431
5553
  alias?: string | undefined;
5432
5554
  result?: {
5433
5555
  whole: true;
@@ -64,6 +64,13 @@ const PinnedDependencySnapshotSchema = z.record(z.string());
64
64
  // ============================================================================
65
65
  // Symbol Request Schema
66
66
  // ============================================================================
67
+ /** The lines of the handler a route request is for (stale-position T2). */
68
+ const HandlerLinesSchema = z
69
+ .object({
70
+ start_line: z.number().int().positive(),
71
+ end_line: z.number().int().positive(),
72
+ })
73
+ .strict();
67
74
  export const SymbolRequestSchema = z.object({
68
75
  symbol_name: z.string().min(1, 'Symbol name cannot be empty'),
69
76
  source_file: z.string().min(1, 'Source file cannot be empty'),
@@ -117,6 +124,8 @@ export const InferRequestItemSchema = z.object({
117
124
  })
118
125
  .strict()
119
126
  .optional(),
127
+ // The handler's lines: a node found by text or line outside them is refused.
128
+ handler_lines: HandlerLinesSchema.optional(),
120
129
  });
121
130
  /**
122
131
  * Per-item locator validation for infer requests.
@@ -214,6 +223,7 @@ const CaptureAnchorRequestSchema = z.discriminatedUnion('kind', [
214
223
  unwrap: z.enum(['awaited', 'none']).optional(),
215
224
  result: ResultLabelSchema.optional(),
216
225
  infer_kind: InferKindSchema.optional(),
226
+ handler_lines: HandlerLinesSchema.optional(),
217
227
  }),
218
228
  z.object({
219
229
  kind: z.literal('literal'),
@@ -230,7 +240,11 @@ const CaptureAnchorRequestSchema = z.discriminatedUnion('kind', [
230
240
  .optional(),
231
241
  raw_text_read: z.literal(true).optional(),
232
242
  absent_body_tolerated: z.literal(true).optional(),
233
- unread_cause: z.enum(['not_located', 'site_unreadable']).optional(),
243
+ // Any word; the capture refuses one that is not a key of
244
+ // `capture/type-reasons.json`, the one list of reasons. This file is
245
+ // vendored alone by the cloud (see `validators-compiles-alone.test.ts`),
246
+ // so it cannot import that list.
247
+ unread_cause: z.string().min(1).optional(),
234
248
  }),
235
249
  ]);
236
250
  export const CaptureV2RequestSchema = BaseRequestSchema.extend({
@@ -0,0 +1,122 @@
1
+ #!/bin/sh
2
+ # Carrick's agent-hook launcher (carrick#4759). Written by `carrick init`, beside
3
+ # the settings file that calls it; init rewrites it, so do not edit it.
4
+ #
5
+ # carrick-hook.sh hook <event> [...] run `carrick hook <event>`
6
+ # carrick-hook.sh --where print the carrick it would run
7
+ #
8
+ # A hook entry that calls a bare `carrick` fails with `command not found` when
9
+ # the default Node changes, because a global install lives under the Node that
10
+ # installed it. This looks for the install the way a shell would not:
11
+ #
12
+ # 1. `carrick` on PATH.
13
+ # 2. The places a global install lands under nvm, fnm, volta, asdf, mise and
14
+ # the npm global prefix, and this project's node_modules/.bin. The newest
15
+ # Node's install wins. It is started with its own bin directory first on
16
+ # PATH, so `#!/usr/bin/env node` picks the Node it was installed under.
17
+ # 3. Nothing found: print one line at session start, nothing for any other
18
+ # event, and exit 0, so the agent is never blocked.
19
+ #
20
+ # File tests only: no `which`, no `npm`, no subprocess. It runs before every
21
+ # edit, and the lookup is skipped whenever `carrick` is on PATH.
22
+
23
+ if command -v carrick >/dev/null 2>&1; then
24
+ if [ "${1-}" = "--where" ]; then
25
+ command -v carrick
26
+ exit 0
27
+ fi
28
+ exec carrick "$@"
29
+ fi
30
+
31
+ # Whether dotted version $1 is newer than $2, compared as numbers (v9 < v24).
32
+ ver_gt() {
33
+ a=$1
34
+ b=$2
35
+ i=0
36
+ while [ "$i" -lt 3 ]; do
37
+ x=${a%%.*}
38
+ y=${b%%.*}
39
+ case $x in '' | *[!0-9]*) x=0 ;; esac
40
+ case $y in '' | *[!0-9]*) y=0 ;; esac
41
+ [ "$x" -gt "$y" ] && return 0
42
+ [ "$x" -lt "$y" ] && return 1
43
+ case $a in *.*) a=${a#*.} ;; *) a=0 ;; esac
44
+ case $b in *.*) b=${b#*.} ;; *) b=0 ;; esac
45
+ i=$((i + 1))
46
+ done
47
+ return 1
48
+ }
49
+
50
+ best=''
51
+ best_ver=''
52
+
53
+ # One candidate binary under a version label. The newest label wins.
54
+ consider() {
55
+ [ -f "$1" ] && [ -x "$1" ] || return 0
56
+ if [ -z "$best" ] || ver_gt "$2" "$best_ver"; then
57
+ best=$1
58
+ best_ver=$2
59
+ fi
60
+ }
61
+
62
+ # Every <root>/<version>/<between>/carrick.
63
+ versioned() {
64
+ for bin in "$1"/*/"$2"/carrick; do
65
+ v=${bin#"$1"/}
66
+ v=${v%%/*}
67
+ consider "$bin" "${v#v}"
68
+ done
69
+ }
70
+
71
+ home=${HOME-}
72
+
73
+ versioned "${NVM_DIR:-$home/.nvm}/versions/node" bin
74
+ versioned "${FNM_DIR:-$home/.local/share/fnm}/node-versions" installation/bin
75
+ versioned "${XDG_DATA_HOME:-$home/.local/share}/fnm/node-versions" installation/bin
76
+ versioned "$home/Library/Application Support/fnm/node-versions" installation/bin
77
+ versioned "${ASDF_DATA_DIR:-$home/.asdf}/installs/nodejs" bin
78
+ versioned "${MISE_DATA_DIR:-$home/.local/share/mise}/installs/node" bin
79
+
80
+ # Not versioned by directory: a global bin directory of its own. Ranked below
81
+ # any versioned install, in the order written.
82
+ consider "${VOLTA_HOME:-$home/.volta}/bin/carrick" 0.0.2
83
+ consider "${CLAUDE_PROJECT_DIR:-$PWD}/node_modules/.bin/carrick" 0.0.1
84
+
85
+ npmrc_prefix=''
86
+ if [ -f "$home/.npmrc" ]; then
87
+ while IFS= read -r line || [ -n "$line" ]; do
88
+ case $line in
89
+ prefix=*)
90
+ npmrc_prefix=${line#prefix=}
91
+ case $npmrc_prefix in "~"*) npmrc_prefix=$home${npmrc_prefix#"~"} ;; esac
92
+ ;;
93
+ esac
94
+ done <"$home/.npmrc"
95
+ fi
96
+ for prefix in "${npm_config_prefix-}" "${NPM_CONFIG_PREFIX-}" "$npmrc_prefix" "$home/.npm-global" /usr/local /opt/homebrew "$home/.local"; do
97
+ [ -n "$prefix" ] && consider "$prefix/bin/carrick" 0.0.0
98
+ done
99
+
100
+ if [ "${1-}" = "--where" ]; then
101
+ [ -n "$best" ] && printf '%s\n' "$best"
102
+ exit 0
103
+ fi
104
+
105
+ if [ -n "$best" ]; then
106
+ PATH="${best%/*}:$PATH"
107
+ export PATH
108
+ exec "$best" "$@"
109
+ fi
110
+
111
+ # Not found. Only the session start speaks; Claude Code takes the line as
112
+ # printed, Codex takes it as the JSON its parser reads (the rule
113
+ # `runByCodex` in src/hook/session-start.ts uses: no CLAUDE_PROJECT_DIR).
114
+ if [ "${1-}" = "hook" ] && [ "${2-}" = "session-start" ]; then
115
+ message='Carrick is not installed in this shell; agent hooks are off. Run `npm install -g carrick`, or switch to the Node version where it is installed.'
116
+ if [ -n "${CLAUDE_PROJECT_DIR-}" ]; then
117
+ printf '%s\n' "$message"
118
+ else
119
+ printf '{"hookSpecificOutput":{"hookEventName":"SessionStart","additionalContext":"%s"}}\n' "$message"
120
+ fi
121
+ fi
122
+ exit 0