@agent-receipts/schema 0.2.11 → 0.3.1

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/dist/index.d.ts CHANGED
@@ -2,7 +2,7 @@ import { z } from 'zod';
2
2
 
3
3
  declare const ReceiptStatus: z.ZodEnum<["pending", "completed", "failed", "timeout"]>;
4
4
  type ReceiptStatus = z.infer<typeof ReceiptStatus>;
5
- declare const ReceiptType: z.ZodEnum<["action", "verification", "judgment", "arbitration"]>;
5
+ declare const ReceiptType: z.ZodEnum<["action", "verification", "judgment", "arbitration", "memory"]>;
6
6
  type ReceiptType = z.infer<typeof ReceiptType>;
7
7
  declare const Environment: z.ZodEnum<["development", "production", "staging", "test"]>;
8
8
  type Environment = z.infer<typeof Environment>;
@@ -17,7 +17,7 @@ type ErrorCode = z.infer<typeof ErrorCode>;
17
17
  declare const SignablePayload: z.ZodObject<{
18
18
  receipt_id: z.ZodString;
19
19
  chain_id: z.ZodString;
20
- receipt_type: z.ZodEnum<["action", "verification", "judgment", "arbitration"]>;
20
+ receipt_type: z.ZodEnum<["action", "verification", "judgment", "arbitration", "memory"]>;
21
21
  agent_id: z.ZodString;
22
22
  org_id: z.ZodString;
23
23
  action: z.ZodString;
@@ -32,7 +32,7 @@ declare const SignablePayload: z.ZodObject<{
32
32
  action: string;
33
33
  receipt_id: string;
34
34
  chain_id: string;
35
- receipt_type: "action" | "verification" | "judgment" | "arbitration";
35
+ receipt_type: "action" | "verification" | "judgment" | "arbitration" | "memory";
36
36
  agent_id: string;
37
37
  org_id: string;
38
38
  input_hash: string;
@@ -45,7 +45,7 @@ declare const SignablePayload: z.ZodObject<{
45
45
  action: string;
46
46
  receipt_id: string;
47
47
  chain_id: string;
48
- receipt_type: "action" | "verification" | "judgment" | "arbitration";
48
+ receipt_type: "action" | "verification" | "judgment" | "arbitration" | "memory";
49
49
  agent_id: string;
50
50
  org_id: string;
51
51
  input_hash: string;
@@ -62,7 +62,7 @@ declare const ActionReceipt: z.ZodObject<{
62
62
  receipt_id: z.ZodString;
63
63
  parent_receipt_id: z.ZodNullable<z.ZodString>;
64
64
  chain_id: z.ZodString;
65
- receipt_type: z.ZodEnum<["action", "verification", "judgment", "arbitration"]>;
65
+ receipt_type: z.ZodEnum<["action", "verification", "judgment", "arbitration", "memory"]>;
66
66
  agent_id: z.ZodString;
67
67
  org_id: z.ZodString;
68
68
  action: z.ZodString;
@@ -93,7 +93,7 @@ declare const ActionReceipt: z.ZodObject<{
93
93
  action: string;
94
94
  receipt_id: string;
95
95
  chain_id: string;
96
- receipt_type: "action" | "verification" | "judgment" | "arbitration";
96
+ receipt_type: "action" | "verification" | "judgment" | "arbitration" | "memory";
97
97
  agent_id: string;
98
98
  org_id: string;
99
99
  input_hash: string;
@@ -123,7 +123,7 @@ declare const ActionReceipt: z.ZodObject<{
123
123
  action: string;
124
124
  receipt_id: string;
125
125
  chain_id: string;
126
- receipt_type: "action" | "verification" | "judgment" | "arbitration";
126
+ receipt_type: "action" | "verification" | "judgment" | "arbitration" | "memory";
127
127
  agent_id: string;
128
128
  org_id: string;
129
129
  input_hash: string;
@@ -429,7 +429,7 @@ declare const CreateReceiptInput: z.ZodObject<{
429
429
  agent_id: z.ZodString;
430
430
  action: z.ZodString;
431
431
  input_hash: z.ZodString;
432
- receipt_type: z.ZodDefault<z.ZodEnum<["action", "verification", "judgment", "arbitration"]>>;
432
+ receipt_type: z.ZodDefault<z.ZodEnum<["action", "verification", "judgment", "arbitration", "memory"]>>;
433
433
  status: z.ZodDefault<z.ZodEnum<["pending", "completed", "failed", "timeout"]>>;
434
434
  environment: z.ZodDefault<z.ZodEnum<["development", "production", "staging", "test"]>>;
435
435
  parent_receipt_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -448,7 +448,7 @@ declare const CreateReceiptInput: z.ZodObject<{
448
448
  }, "strip", z.ZodTypeAny, {
449
449
  status: "pending" | "completed" | "failed" | "timeout";
450
450
  action: string;
451
- receipt_type: "action" | "verification" | "judgment" | "arbitration";
451
+ receipt_type: "action" | "verification" | "judgment" | "arbitration" | "memory";
452
452
  agent_id: string;
453
453
  input_hash: string;
454
454
  environment: "development" | "production" | "staging" | "test";
@@ -470,7 +470,7 @@ declare const CreateReceiptInput: z.ZodObject<{
470
470
  agent_id: string;
471
471
  input_hash: string;
472
472
  status?: "pending" | "completed" | "failed" | "timeout" | undefined;
473
- receipt_type?: "action" | "verification" | "judgment" | "arbitration" | undefined;
473
+ receipt_type?: "action" | "verification" | "judgment" | "arbitration" | "memory" | undefined;
474
474
  output_hash?: string | null | undefined;
475
475
  environment?: "development" | "production" | "staging" | "test" | undefined;
476
476
  parent_receipt_id?: string | null | undefined;
@@ -540,7 +540,7 @@ declare const VerifyResponse: z.ZodObject<{
540
540
  receipt: z.ZodObject<{
541
541
  receipt_id: z.ZodString;
542
542
  chain_id: z.ZodString;
543
- receipt_type: z.ZodEnum<["action", "verification", "judgment", "arbitration"]>;
543
+ receipt_type: z.ZodEnum<["action", "verification", "judgment", "arbitration", "memory"]>;
544
544
  agent_id: z.ZodString;
545
545
  action: z.ZodString;
546
546
  status: z.ZodEnum<["pending", "completed", "failed", "timeout"]>;
@@ -556,7 +556,7 @@ declare const VerifyResponse: z.ZodObject<{
556
556
  action: string;
557
557
  receipt_id: string;
558
558
  chain_id: string;
559
- receipt_type: "action" | "verification" | "judgment" | "arbitration";
559
+ receipt_type: "action" | "verification" | "judgment" | "arbitration" | "memory";
560
560
  agent_id: string;
561
561
  input_hash: string;
562
562
  output_hash: string | null;
@@ -570,7 +570,7 @@ declare const VerifyResponse: z.ZodObject<{
570
570
  action: string;
571
571
  receipt_id: string;
572
572
  chain_id: string;
573
- receipt_type: "action" | "verification" | "judgment" | "arbitration";
573
+ receipt_type: "action" | "verification" | "judgment" | "arbitration" | "memory";
574
574
  agent_id: string;
575
575
  input_hash: string;
576
576
  output_hash: string | null;
@@ -590,7 +590,7 @@ declare const VerifyResponse: z.ZodObject<{
590
590
  action: string;
591
591
  receipt_id: string;
592
592
  chain_id: string;
593
- receipt_type: "action" | "verification" | "judgment" | "arbitration";
593
+ receipt_type: "action" | "verification" | "judgment" | "arbitration" | "memory";
594
594
  agent_id: string;
595
595
  input_hash: string;
596
596
  output_hash: string | null;
@@ -610,7 +610,7 @@ declare const VerifyResponse: z.ZodObject<{
610
610
  action: string;
611
611
  receipt_id: string;
612
612
  chain_id: string;
613
- receipt_type: "action" | "verification" | "judgment" | "arbitration";
613
+ receipt_type: "action" | "verification" | "judgment" | "arbitration" | "memory";
614
614
  agent_id: string;
615
615
  input_hash: string;
616
616
  output_hash: string | null;
@@ -635,7 +635,7 @@ declare const ListReceiptsQuery: z.ZodObject<{
635
635
  action: z.ZodOptional<z.ZodString>;
636
636
  status: z.ZodOptional<z.ZodEnum<["pending", "completed", "failed", "timeout"]>>;
637
637
  environment: z.ZodOptional<z.ZodEnum<["development", "production", "staging", "test"]>>;
638
- receipt_type: z.ZodOptional<z.ZodEnum<["action", "verification", "judgment", "arbitration"]>>;
638
+ receipt_type: z.ZodOptional<z.ZodEnum<["action", "verification", "judgment", "arbitration", "memory"]>>;
639
639
  chain_id: z.ZodOptional<z.ZodString>;
640
640
  tag: z.ZodOptional<z.ZodString>;
641
641
  from: z.ZodOptional<z.ZodString>;
@@ -648,7 +648,7 @@ declare const ListReceiptsQuery: z.ZodObject<{
648
648
  status?: "pending" | "completed" | "failed" | "timeout" | undefined;
649
649
  action?: string | undefined;
650
650
  chain_id?: string | undefined;
651
- receipt_type?: "action" | "verification" | "judgment" | "arbitration" | undefined;
651
+ receipt_type?: "action" | "verification" | "judgment" | "arbitration" | "memory" | undefined;
652
652
  agent_id?: string | undefined;
653
653
  environment?: "development" | "production" | "staging" | "test" | undefined;
654
654
  tag?: string | undefined;
@@ -659,7 +659,7 @@ declare const ListReceiptsQuery: z.ZodObject<{
659
659
  status?: "pending" | "completed" | "failed" | "timeout" | undefined;
660
660
  action?: string | undefined;
661
661
  chain_id?: string | undefined;
662
- receipt_type?: "action" | "verification" | "judgment" | "arbitration" | undefined;
662
+ receipt_type?: "action" | "verification" | "judgment" | "arbitration" | "memory" | undefined;
663
663
  agent_id?: string | undefined;
664
664
  environment?: "development" | "production" | "staging" | "test" | undefined;
665
665
  page?: number | undefined;
@@ -727,6 +727,199 @@ declare const ErrorResponse: z.ZodObject<{
727
727
  }>;
728
728
  type ErrorResponse = z.infer<typeof ErrorResponse>;
729
729
 
730
+ declare const EntityType: z.ZodEnum<["person", "project", "organization", "preference", "fact", "context", "tool", "custom"]>;
731
+ type EntityType = z.infer<typeof EntityType>;
732
+ declare const MemoryOperation: z.ZodEnum<["observe", "create", "merge", "forget", "forget_entity", "recall", "update"]>;
733
+ type MemoryOperation = z.infer<typeof MemoryOperation>;
734
+ declare const MemoryScope: z.ZodEnum<["agent", "user", "team", "global"]>;
735
+ type MemoryScope = z.infer<typeof MemoryScope>;
736
+ declare const ConfidenceLevel: z.ZodEnum<["certain", "high", "medium", "low", "deprecated"]>;
737
+ type ConfidenceLevel = z.infer<typeof ConfidenceLevel>;
738
+ declare const Observation: z.ZodObject<{
739
+ observation_id: z.ZodString;
740
+ entity_id: z.ZodString;
741
+ content: z.ZodString;
742
+ confidence: z.ZodDefault<z.ZodEnum<["certain", "high", "medium", "low", "deprecated"]>>;
743
+ source_receipt_id: z.ZodString;
744
+ source_agent_id: z.ZodString;
745
+ source_context: z.ZodNullable<z.ZodString>;
746
+ observed_at: z.ZodString;
747
+ forgotten_at: z.ZodNullable<z.ZodString>;
748
+ forgotten_by: z.ZodNullable<z.ZodString>;
749
+ superseded_by: z.ZodNullable<z.ZodString>;
750
+ expires_at: z.ZodDefault<z.ZodNullable<z.ZodString>>;
751
+ tags: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
752
+ metadata: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
753
+ }, "strip", z.ZodTypeAny, {
754
+ tags: string[];
755
+ confidence: "certain" | "high" | "medium" | "low" | "deprecated";
756
+ metadata: Record<string, unknown>;
757
+ observation_id: string;
758
+ entity_id: string;
759
+ content: string;
760
+ source_receipt_id: string;
761
+ source_agent_id: string;
762
+ source_context: string | null;
763
+ observed_at: string;
764
+ forgotten_at: string | null;
765
+ forgotten_by: string | null;
766
+ superseded_by: string | null;
767
+ expires_at: string | null;
768
+ }, {
769
+ observation_id: string;
770
+ entity_id: string;
771
+ content: string;
772
+ source_receipt_id: string;
773
+ source_agent_id: string;
774
+ source_context: string | null;
775
+ observed_at: string;
776
+ forgotten_at: string | null;
777
+ forgotten_by: string | null;
778
+ superseded_by: string | null;
779
+ tags?: string[] | undefined;
780
+ confidence?: "certain" | "high" | "medium" | "low" | "deprecated" | undefined;
781
+ metadata?: Record<string, unknown> | undefined;
782
+ expires_at?: string | null | undefined;
783
+ }>;
784
+ type Observation = z.infer<typeof Observation>;
785
+ declare const Relationship: z.ZodObject<{
786
+ relationship_id: z.ZodString;
787
+ from_entity_id: z.ZodString;
788
+ to_entity_id: z.ZodString;
789
+ relationship_type: z.ZodString;
790
+ strength: z.ZodDefault<z.ZodEnum<["certain", "high", "medium", "low", "deprecated"]>>;
791
+ source_receipt_id: z.ZodString;
792
+ created_at: z.ZodString;
793
+ forgotten_at: z.ZodNullable<z.ZodString>;
794
+ metadata: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
795
+ }, "strip", z.ZodTypeAny, {
796
+ metadata: Record<string, unknown>;
797
+ source_receipt_id: string;
798
+ forgotten_at: string | null;
799
+ relationship_id: string;
800
+ from_entity_id: string;
801
+ to_entity_id: string;
802
+ relationship_type: string;
803
+ strength: "certain" | "high" | "medium" | "low" | "deprecated";
804
+ created_at: string;
805
+ }, {
806
+ source_receipt_id: string;
807
+ forgotten_at: string | null;
808
+ relationship_id: string;
809
+ from_entity_id: string;
810
+ to_entity_id: string;
811
+ relationship_type: string;
812
+ created_at: string;
813
+ metadata?: Record<string, unknown> | undefined;
814
+ strength?: "certain" | "high" | "medium" | "low" | "deprecated" | undefined;
815
+ }>;
816
+ type Relationship = z.infer<typeof Relationship>;
817
+ declare const Entity: z.ZodObject<{
818
+ entity_id: z.ZodString;
819
+ entity_type: z.ZodEnum<["person", "project", "organization", "preference", "fact", "context", "tool", "custom"]>;
820
+ name: z.ZodString;
821
+ aliases: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
822
+ scope: z.ZodDefault<z.ZodEnum<["agent", "user", "team", "global"]>>;
823
+ created_at: z.ZodString;
824
+ created_by_agent: z.ZodString;
825
+ created_by_receipt: z.ZodString;
826
+ forgotten_at: z.ZodNullable<z.ZodString>;
827
+ merged_into: z.ZodNullable<z.ZodString>;
828
+ attributes: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
829
+ metadata: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
830
+ }, "strip", z.ZodTypeAny, {
831
+ metadata: Record<string, unknown>;
832
+ name: string;
833
+ entity_id: string;
834
+ forgotten_at: string | null;
835
+ created_at: string;
836
+ entity_type: "custom" | "person" | "project" | "organization" | "preference" | "fact" | "context" | "tool";
837
+ aliases: string[];
838
+ scope: "agent" | "user" | "team" | "global";
839
+ created_by_agent: string;
840
+ created_by_receipt: string;
841
+ merged_into: string | null;
842
+ attributes: Record<string, unknown>;
843
+ }, {
844
+ name: string;
845
+ entity_id: string;
846
+ forgotten_at: string | null;
847
+ created_at: string;
848
+ entity_type: "custom" | "person" | "project" | "organization" | "preference" | "fact" | "context" | "tool";
849
+ created_by_agent: string;
850
+ created_by_receipt: string;
851
+ merged_into: string | null;
852
+ metadata?: Record<string, unknown> | undefined;
853
+ aliases?: string[] | undefined;
854
+ scope?: "agent" | "user" | "team" | "global" | undefined;
855
+ attributes?: Record<string, unknown> | undefined;
856
+ }>;
857
+ type Entity = z.infer<typeof Entity>;
858
+ declare const MemoryReceiptPayload: z.ZodObject<{
859
+ memory_operation: z.ZodEnum<["observe", "create", "merge", "forget", "forget_entity", "recall", "update"]>;
860
+ entity_id: z.ZodNullable<z.ZodString>;
861
+ observation_id: z.ZodNullable<z.ZodString>;
862
+ relationship_id: z.ZodNullable<z.ZodString>;
863
+ scope: z.ZodEnum<["agent", "user", "team", "global"]>;
864
+ query: z.ZodNullable<z.ZodString>;
865
+ results_count: z.ZodNullable<z.ZodNumber>;
866
+ confidence: z.ZodNullable<z.ZodEnum<["certain", "high", "medium", "low", "deprecated"]>>;
867
+ }, "strip", z.ZodTypeAny, {
868
+ confidence: "certain" | "high" | "medium" | "low" | "deprecated" | null;
869
+ observation_id: string | null;
870
+ entity_id: string | null;
871
+ relationship_id: string | null;
872
+ scope: "agent" | "user" | "team" | "global";
873
+ memory_operation: "create" | "observe" | "merge" | "forget" | "forget_entity" | "recall" | "update";
874
+ query: string | null;
875
+ results_count: number | null;
876
+ }, {
877
+ confidence: "certain" | "high" | "medium" | "low" | "deprecated" | null;
878
+ observation_id: string | null;
879
+ entity_id: string | null;
880
+ relationship_id: string | null;
881
+ scope: "agent" | "user" | "team" | "global";
882
+ memory_operation: "create" | "observe" | "merge" | "forget" | "forget_entity" | "recall" | "update";
883
+ query: string | null;
884
+ results_count: number | null;
885
+ }>;
886
+ type MemoryReceiptPayload = z.infer<typeof MemoryReceiptPayload>;
887
+ declare const MemoryQuery: z.ZodObject<{
888
+ query: z.ZodOptional<z.ZodString>;
889
+ entity_type: z.ZodOptional<z.ZodEnum<["person", "project", "organization", "preference", "fact", "context", "tool", "custom"]>>;
890
+ entity_id: z.ZodOptional<z.ZodString>;
891
+ scope: z.ZodOptional<z.ZodEnum<["agent", "user", "team", "global"]>>;
892
+ agent_id: z.ZodOptional<z.ZodString>;
893
+ confidence_min: z.ZodOptional<z.ZodEnum<["certain", "high", "medium", "low", "deprecated"]>>;
894
+ include_forgotten: z.ZodDefault<z.ZodBoolean>;
895
+ tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
896
+ limit: z.ZodDefault<z.ZodNumber>;
897
+ page: z.ZodDefault<z.ZodNumber>;
898
+ }, "strip", z.ZodTypeAny, {
899
+ page: number;
900
+ limit: number;
901
+ include_forgotten: boolean;
902
+ agent_id?: string | undefined;
903
+ tags?: string[] | undefined;
904
+ entity_id?: string | undefined;
905
+ entity_type?: "custom" | "person" | "project" | "organization" | "preference" | "fact" | "context" | "tool" | undefined;
906
+ scope?: "agent" | "user" | "team" | "global" | undefined;
907
+ query?: string | undefined;
908
+ confidence_min?: "certain" | "high" | "medium" | "low" | "deprecated" | undefined;
909
+ }, {
910
+ agent_id?: string | undefined;
911
+ tags?: string[] | undefined;
912
+ page?: number | undefined;
913
+ limit?: number | undefined;
914
+ entity_id?: string | undefined;
915
+ entity_type?: "custom" | "person" | "project" | "organization" | "preference" | "fact" | "context" | "tool" | undefined;
916
+ scope?: "agent" | "user" | "team" | "global" | undefined;
917
+ query?: string | undefined;
918
+ confidence_min?: "certain" | "high" | "medium" | "low" | "deprecated" | undefined;
919
+ include_forgotten?: boolean | undefined;
920
+ }>;
921
+ type MemoryQuery = z.infer<typeof MemoryQuery>;
922
+
730
923
  /**
731
924
  * Validate data against a Zod schema.
732
925
  * Returns { success: true, data } or { success: false, error: ErrorResponse }
@@ -747,4 +940,4 @@ declare function formatZodError(error: z.ZodError): string;
747
940
  */
748
941
  declare function createErrorResponse(code: string, message: string, status: number): ErrorResponse;
749
942
 
750
- export { ActionReceipt, CompleteReceiptInput, ConstraintDefinition, ConstraintDefinitions, ConstraintResult, CreateReceiptInput, CriterionResult, Environment, Environment as EnvironmentType, ErrorCode, ErrorCode as ErrorCodeType, ErrorResponse, JudgmentResult, ListReceiptsQuery, PaginationMeta, ReceiptStatus, ReceiptStatus as ReceiptStatusType, ReceiptType, ReceiptType as ReceiptTypeType, Rubric, RubricCriterion, SignablePayload, SingleConstraintResult, VerifyResponse, createErrorResponse, formatZodError, validate };
943
+ export { ActionReceipt, CompleteReceiptInput, ConfidenceLevel, ConstraintDefinition, ConstraintDefinitions, ConstraintResult, CreateReceiptInput, CriterionResult, Entity, EntityType, Environment, Environment as EnvironmentType, ErrorCode, ErrorCode as ErrorCodeType, ErrorResponse, JudgmentResult, ListReceiptsQuery, MemoryOperation, MemoryQuery, MemoryReceiptPayload, MemoryScope, Observation, PaginationMeta, ReceiptStatus, ReceiptStatus as ReceiptStatusType, ReceiptType, ReceiptType as ReceiptTypeType, Relationship, Rubric, RubricCriterion, SignablePayload, SingleConstraintResult, VerifyResponse, createErrorResponse, formatZodError, validate };
package/dist/index.js CHANGED
@@ -22,19 +22,28 @@ var index_exports = {};
22
22
  __export(index_exports, {
23
23
  ActionReceipt: () => ActionReceipt,
24
24
  CompleteReceiptInput: () => CompleteReceiptInput,
25
+ ConfidenceLevel: () => ConfidenceLevel,
25
26
  ConstraintDefinition: () => ConstraintDefinition,
26
27
  ConstraintDefinitions: () => ConstraintDefinitions,
27
28
  ConstraintResult: () => ConstraintResult,
28
29
  CreateReceiptInput: () => CreateReceiptInput,
29
30
  CriterionResult: () => CriterionResult,
31
+ Entity: () => Entity,
32
+ EntityType: () => EntityType,
30
33
  Environment: () => Environment,
31
34
  ErrorCode: () => ErrorCode,
32
35
  ErrorResponse: () => ErrorResponse,
33
36
  JudgmentResult: () => JudgmentResult,
34
37
  ListReceiptsQuery: () => ListReceiptsQuery,
38
+ MemoryOperation: () => MemoryOperation,
39
+ MemoryQuery: () => MemoryQuery,
40
+ MemoryReceiptPayload: () => MemoryReceiptPayload,
41
+ MemoryScope: () => MemoryScope,
42
+ Observation: () => Observation,
35
43
  PaginationMeta: () => PaginationMeta,
36
44
  ReceiptStatus: () => ReceiptStatus,
37
45
  ReceiptType: () => ReceiptType,
46
+ Relationship: () => Relationship,
38
47
  Rubric: () => Rubric,
39
48
  RubricCriterion: () => RubricCriterion,
40
49
  SignablePayload: () => SignablePayload,
@@ -49,7 +58,7 @@ module.exports = __toCommonJS(index_exports);
49
58
  // src/enums.ts
50
59
  var import_zod = require("zod");
51
60
  var ReceiptStatus = import_zod.z.enum(["pending", "completed", "failed", "timeout"]);
52
- var ReceiptType = import_zod.z.enum(["action", "verification", "judgment", "arbitration"]);
61
+ var ReceiptType = import_zod.z.enum(["action", "verification", "judgment", "arbitration", "memory"]);
53
62
  var Environment = import_zod.z.enum(["development", "production", "staging", "test"]);
54
63
  var ErrorCode = import_zod.z.enum([
55
64
  "UNAUTHORIZED",
@@ -270,6 +279,104 @@ var ErrorResponse = import_zod5.z.object({
270
279
  })
271
280
  });
272
281
 
282
+ // src/memory.ts
283
+ var import_zod6 = require("zod");
284
+ var EntityType = import_zod6.z.enum([
285
+ "person",
286
+ "project",
287
+ "organization",
288
+ "preference",
289
+ "fact",
290
+ "context",
291
+ "tool",
292
+ "custom"
293
+ ]);
294
+ var MemoryOperation = import_zod6.z.enum([
295
+ "observe",
296
+ "create",
297
+ "merge",
298
+ "forget",
299
+ "forget_entity",
300
+ "recall",
301
+ "update"
302
+ ]);
303
+ var MemoryScope = import_zod6.z.enum([
304
+ "agent",
305
+ "user",
306
+ "team",
307
+ "global"
308
+ ]);
309
+ var ConfidenceLevel = import_zod6.z.enum([
310
+ "certain",
311
+ "high",
312
+ "medium",
313
+ "low",
314
+ "deprecated"
315
+ ]);
316
+ var Observation = import_zod6.z.object({
317
+ observation_id: import_zod6.z.string(),
318
+ entity_id: import_zod6.z.string(),
319
+ content: import_zod6.z.string(),
320
+ confidence: ConfidenceLevel.default("medium"),
321
+ source_receipt_id: import_zod6.z.string(),
322
+ source_agent_id: import_zod6.z.string(),
323
+ source_context: import_zod6.z.string().nullable(),
324
+ observed_at: import_zod6.z.string().datetime(),
325
+ forgotten_at: import_zod6.z.string().datetime().nullable(),
326
+ forgotten_by: import_zod6.z.string().nullable(),
327
+ superseded_by: import_zod6.z.string().nullable(),
328
+ expires_at: import_zod6.z.string().datetime().nullable().default(null),
329
+ tags: import_zod6.z.array(import_zod6.z.string()).default([]),
330
+ metadata: import_zod6.z.record(import_zod6.z.unknown()).default({})
331
+ });
332
+ var Relationship = import_zod6.z.object({
333
+ relationship_id: import_zod6.z.string(),
334
+ from_entity_id: import_zod6.z.string(),
335
+ to_entity_id: import_zod6.z.string(),
336
+ relationship_type: import_zod6.z.string(),
337
+ strength: ConfidenceLevel.default("medium"),
338
+ source_receipt_id: import_zod6.z.string(),
339
+ created_at: import_zod6.z.string().datetime(),
340
+ forgotten_at: import_zod6.z.string().datetime().nullable(),
341
+ metadata: import_zod6.z.record(import_zod6.z.unknown()).default({})
342
+ });
343
+ var Entity = import_zod6.z.object({
344
+ entity_id: import_zod6.z.string(),
345
+ entity_type: EntityType,
346
+ name: import_zod6.z.string(),
347
+ aliases: import_zod6.z.array(import_zod6.z.string()).default([]),
348
+ scope: MemoryScope.default("agent"),
349
+ created_at: import_zod6.z.string().datetime(),
350
+ created_by_agent: import_zod6.z.string(),
351
+ created_by_receipt: import_zod6.z.string(),
352
+ forgotten_at: import_zod6.z.string().datetime().nullable(),
353
+ merged_into: import_zod6.z.string().nullable(),
354
+ attributes: import_zod6.z.record(import_zod6.z.unknown()).default({}),
355
+ metadata: import_zod6.z.record(import_zod6.z.unknown()).default({})
356
+ });
357
+ var MemoryReceiptPayload = import_zod6.z.object({
358
+ memory_operation: MemoryOperation,
359
+ entity_id: import_zod6.z.string().nullable(),
360
+ observation_id: import_zod6.z.string().nullable(),
361
+ relationship_id: import_zod6.z.string().nullable(),
362
+ scope: MemoryScope,
363
+ query: import_zod6.z.string().nullable(),
364
+ results_count: import_zod6.z.number().int().nullable(),
365
+ confidence: ConfidenceLevel.nullable()
366
+ });
367
+ var MemoryQuery = import_zod6.z.object({
368
+ query: import_zod6.z.string().optional(),
369
+ entity_type: EntityType.optional(),
370
+ entity_id: import_zod6.z.string().optional(),
371
+ scope: MemoryScope.optional(),
372
+ agent_id: import_zod6.z.string().optional(),
373
+ confidence_min: ConfidenceLevel.optional(),
374
+ include_forgotten: import_zod6.z.boolean().default(false),
375
+ tags: import_zod6.z.array(import_zod6.z.string()).optional(),
376
+ limit: import_zod6.z.number().int().min(1).max(100).default(20),
377
+ page: import_zod6.z.number().int().min(1).default(1)
378
+ });
379
+
273
380
  // src/validation.ts
274
381
  function validate(schema, data) {
275
382
  const result = schema.safeParse(data);
@@ -304,19 +411,28 @@ function createErrorResponse(code, message, status) {
304
411
  0 && (module.exports = {
305
412
  ActionReceipt,
306
413
  CompleteReceiptInput,
414
+ ConfidenceLevel,
307
415
  ConstraintDefinition,
308
416
  ConstraintDefinitions,
309
417
  ConstraintResult,
310
418
  CreateReceiptInput,
311
419
  CriterionResult,
420
+ Entity,
421
+ EntityType,
312
422
  Environment,
313
423
  ErrorCode,
314
424
  ErrorResponse,
315
425
  JudgmentResult,
316
426
  ListReceiptsQuery,
427
+ MemoryOperation,
428
+ MemoryQuery,
429
+ MemoryReceiptPayload,
430
+ MemoryScope,
431
+ Observation,
317
432
  PaginationMeta,
318
433
  ReceiptStatus,
319
434
  ReceiptType,
435
+ Relationship,
320
436
  Rubric,
321
437
  RubricCriterion,
322
438
  SignablePayload,
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts","../src/enums.ts","../src/receipt.ts","../src/constraints.ts","../src/rubric.ts","../src/api.ts","../src/validation.ts"],"sourcesContent":["// Enums\nexport { ReceiptStatus, ReceiptType, Environment, ErrorCode } from './enums'\n\n// Receipt schemas + types\nexport { SignablePayload, ActionReceipt } from './receipt'\n\n// Constraint schemas + types\nexport {\n ConstraintDefinition,\n SingleConstraintResult,\n ConstraintResult,\n ConstraintDefinitions,\n} from './constraints'\n\n// Rubric schemas + types\nexport {\n RubricCriterion,\n Rubric,\n CriterionResult,\n JudgmentResult,\n} from './rubric'\n\n// API schemas + types\nexport {\n CreateReceiptInput,\n CompleteReceiptInput,\n VerifyResponse,\n ListReceiptsQuery,\n PaginationMeta,\n ErrorResponse,\n} from './api'\n\n// Validation utilities\nexport { validate, formatZodError, createErrorResponse } from './validation'\n\n// Re-export types explicitly for consumers who import types only\nexport type {\n ReceiptStatus as ReceiptStatusType,\n ReceiptType as ReceiptTypeType,\n Environment as EnvironmentType,\n ErrorCode as ErrorCodeType,\n} from './enums'\n","import { z } from 'zod'\n\nexport const ReceiptStatus = z.enum(['pending', 'completed', 'failed', 'timeout'])\nexport type ReceiptStatus = z.infer<typeof ReceiptStatus>\n\nexport const ReceiptType = z.enum(['action', 'verification', 'judgment', 'arbitration'])\nexport type ReceiptType = z.infer<typeof ReceiptType>\n\nexport const Environment = z.enum(['development', 'production', 'staging', 'test'])\nexport type Environment = z.infer<typeof Environment>\n\nexport const ErrorCode = z.enum([\n 'UNAUTHORIZED',\n 'KEY_REVOKED',\n 'FORBIDDEN',\n 'RECEIPT_NOT_FOUND',\n 'CHAIN_NOT_FOUND',\n 'AGENT_NOT_FOUND',\n 'RECEIPT_NOT_PENDING',\n 'RECEIPT_IMMUTABLE',\n 'RATE_LIMIT_EXCEEDED',\n 'VALIDATION_ERROR',\n 'INTERNAL_ERROR',\n])\nexport type ErrorCode = z.infer<typeof ErrorCode>\n","import { z } from 'zod'\nimport { ReceiptStatus, ReceiptType, Environment } from './enums'\n\n/**\n * The 12 fields that are cryptographically signed.\n * These fields are extracted from a receipt and serialized as canonical JSON\n * before signing with Ed25519.\n */\nexport const SignablePayload = z.object({\n receipt_id: z.string(),\n chain_id: z.string(),\n receipt_type: ReceiptType,\n agent_id: z.string(),\n org_id: z.string(),\n action: z.string(),\n input_hash: z.string(),\n output_hash: z.string().nullable(),\n status: ReceiptStatus,\n timestamp: z.string().datetime(),\n completed_at: z.string().datetime().nullable(),\n environment: Environment,\n})\nexport type SignablePayload = z.infer<typeof SignablePayload>\n\n/**\n * The complete receipt object as returned by the API.\n */\nexport const ActionReceipt = z.object({\n // Identity\n receipt_id: z.string(),\n parent_receipt_id: z.string().nullable(),\n chain_id: z.string(),\n\n // Type\n receipt_type: ReceiptType,\n\n // Who\n agent_id: z.string(),\n org_id: z.string(),\n\n // What\n action: z.string(),\n input_hash: z.string(),\n output_hash: z.string().nullable(),\n output_summary: z.string().nullable(),\n\n // How (all nullable — may not be known at creation)\n model: z.string().nullable(),\n tokens_in: z.number().int().nonnegative().nullable(),\n tokens_out: z.number().int().nonnegative().nullable(),\n cost_usd: z.number().nonnegative().nullable(),\n latency_ms: z.number().int().nonnegative().nullable(),\n tool_calls: z.array(z.string()).nullable(),\n\n // When\n timestamp: z.string().datetime(),\n completed_at: z.string().datetime().nullable(),\n\n // Status\n status: ReceiptStatus,\n error: z.record(z.unknown()).nullable(),\n\n // Context\n environment: Environment,\n tags: z.array(z.string()).nullable(),\n\n // Verification (Tier 2 — Phase 6)\n constraints: z.record(z.unknown()).nullable(),\n constraint_result: z.record(z.unknown()).nullable(),\n\n // Trust\n signature: z.string(),\n verify_url: z.string().url(),\n\n // Optional\n callback_verified: z.boolean().nullable(),\n confidence: z.number().min(0).max(1).nullable(),\n metadata: z.record(z.unknown()),\n})\nexport type ActionReceipt = z.infer<typeof ActionReceipt>\n","import { z } from 'zod'\n\n/**\n * A single constraint definition that specifies a rule to evaluate.\n */\nexport const ConstraintDefinition = z.object({\n type: z.string().min(1),\n value: z.unknown(),\n message: z.string().optional(),\n})\nexport type ConstraintDefinition = z.infer<typeof ConstraintDefinition>\n\n/**\n * Result of evaluating a single constraint.\n */\nexport const SingleConstraintResult = z.object({\n type: z.string(),\n passed: z.boolean(),\n expected: z.unknown(),\n actual: z.unknown(),\n message: z.string().optional(),\n})\nexport type SingleConstraintResult = z.infer<typeof SingleConstraintResult>\n\n/**\n * Aggregate result of evaluating all constraints on a receipt.\n */\nexport const ConstraintResult = z.object({\n passed: z.boolean(),\n results: z.array(SingleConstraintResult),\n evaluated_at: z.string().datetime(),\n})\nexport type ConstraintResult = z.infer<typeof ConstraintResult>\n\n/**\n * Array of constraint definitions.\n */\nexport const ConstraintDefinitions = z.array(ConstraintDefinition)\nexport type ConstraintDefinitions = z.infer<typeof ConstraintDefinitions>\n","import { z } from 'zod'\n\nexport const RubricCriterion = z.object({\n name: z.string().min(1),\n description: z.string().min(1),\n weight: z.number().min(0).max(1),\n passing_threshold: z.number().min(0).max(1).optional(),\n examples: z.object({\n good: z.array(z.string()).optional(),\n bad: z.array(z.string()).optional(),\n }).optional(),\n})\nexport type RubricCriterion = z.infer<typeof RubricCriterion>\n\nexport const Rubric = z.object({\n version: z.string().default('1.0'),\n criteria: z.array(RubricCriterion).min(1),\n passing_threshold: z.number().min(0).max(1).default(0.7),\n require_all: z.boolean().default(false),\n})\nexport type Rubric = z.infer<typeof Rubric>\n\nexport const CriterionResult = z.object({\n criterion: z.string(),\n score: z.number().min(0).max(1),\n passed: z.boolean(),\n reasoning: z.string(),\n})\nexport type CriterionResult = z.infer<typeof CriterionResult>\n\nexport const JudgmentResult = z.object({\n verdict: z.enum(['pass', 'fail', 'partial']),\n score: z.number().min(0).max(1),\n criteria_results: z.array(CriterionResult),\n overall_reasoning: z.string(),\n rubric_version: z.string(),\n})\nexport type JudgmentResult = z.infer<typeof JudgmentResult>\n","import { z } from 'zod'\nimport { ReceiptStatus, ReceiptType, Environment, ErrorCode } from './enums'\n\n/**\n * What the client sends to POST /api/v1/receipts.\n */\nexport const CreateReceiptInput = z.object({\n // Required\n agent_id: z.string().min(1),\n action: z.string().min(1),\n input_hash: z.string().min(1),\n\n // Optional with defaults\n receipt_type: ReceiptType.default('action'),\n status: ReceiptStatus.default('pending'),\n environment: Environment.default('production'),\n\n // Optional\n parent_receipt_id: z.string().nullable().optional(),\n output_hash: z.string().nullable().optional(),\n output_summary: z.string().nullable().optional(),\n model: z.string().nullable().optional(),\n tokens_in: z.number().int().nonnegative().nullable().optional(),\n tokens_out: z.number().int().nonnegative().nullable().optional(),\n cost_usd: z.number().nonnegative().nullable().optional(),\n latency_ms: z.number().int().nonnegative().nullable().optional(),\n tool_calls: z.array(z.string()).nullable().optional(),\n tags: z.array(z.string()).nullable().optional(),\n confidence: z.number().min(0).max(1).nullable().optional(),\n callback_verified: z.boolean().nullable().optional(),\n metadata: z.record(z.unknown()).optional(),\n})\nexport type CreateReceiptInput = z.infer<typeof CreateReceiptInput>\n\n/**\n * What the client sends to PATCH /api/v1/receipts/:id/complete.\n */\nexport const CompleteReceiptInput = z.object({\n // Required — must transition from pending\n status: z.enum(['completed', 'failed', 'timeout']),\n\n // Execution results (all optional — set what you know)\n output_hash: z.string().nullable().optional(),\n output_summary: z.string().nullable().optional(),\n model: z.string().nullable().optional(),\n tokens_in: z.number().int().nonnegative().nullable().optional(),\n tokens_out: z.number().int().nonnegative().nullable().optional(),\n cost_usd: z.number().nonnegative().nullable().optional(),\n latency_ms: z.number().int().nonnegative().nullable().optional(),\n tool_calls: z.array(z.string()).nullable().optional(),\n confidence: z.number().min(0).max(1).nullable().optional(),\n callback_verified: z.boolean().nullable().optional(),\n error: z.record(z.unknown()).nullable().optional(),\n})\nexport type CompleteReceiptInput = z.infer<typeof CompleteReceiptInput>\n\n/**\n * What GET /api/v1/verify/:id returns.\n * Note: Does NOT include org_id, metadata, tags, or output_summary (org-private).\n */\nexport const VerifyResponse = z.object({\n verified: z.boolean(),\n receipt: z.object({\n receipt_id: z.string(),\n chain_id: z.string(),\n receipt_type: ReceiptType,\n agent_id: z.string(),\n action: z.string(),\n status: ReceiptStatus,\n input_hash: z.string(),\n output_hash: z.string().nullable(),\n signature: z.string(),\n timestamp: z.string().datetime(),\n completed_at: z.string().datetime().nullable(),\n environment: Environment,\n latency_ms: z.number().int().nonnegative().nullable(),\n }),\n signature_valid: z.boolean(),\n chain_length: z.number().int().nonnegative(),\n public_key_url: z.string().url(),\n})\nexport type VerifyResponse = z.infer<typeof VerifyResponse>\n\n/**\n * Query parameters for GET /api/v1/receipts.\n */\nexport const ListReceiptsQuery = z.object({\n page: z.coerce.number().int().positive().default(1),\n limit: z.coerce.number().int().positive().max(100).default(50),\n agent_id: z.string().optional(),\n action: z.string().optional(),\n status: ReceiptStatus.optional(),\n environment: Environment.optional(),\n receipt_type: ReceiptType.optional(),\n chain_id: z.string().optional(),\n tag: z.string().optional(),\n from: z.string().datetime().optional(),\n to: z.string().datetime().optional(),\n sort: z.string().regex(/^(created_at|completed_at|latency_ms|cost_usd):(asc|desc)$/).default('created_at:desc'),\n})\nexport type ListReceiptsQuery = z.infer<typeof ListReceiptsQuery>\n\n/**\n * Pagination metadata included in list responses.\n */\nexport const PaginationMeta = z.object({\n page: z.number().int().positive(),\n limit: z.number().int().positive(),\n total: z.number().int().nonnegative(),\n total_pages: z.number().int().nonnegative(),\n has_next: z.boolean(),\n has_prev: z.boolean(),\n})\nexport type PaginationMeta = z.infer<typeof PaginationMeta>\n\n/**\n * Standard error response format.\n */\nexport const ErrorResponse = z.object({\n error: z.object({\n code: ErrorCode,\n message: z.string(),\n status: z.number().int(),\n }),\n})\nexport type ErrorResponse = z.infer<typeof ErrorResponse>\n","import { z } from 'zod'\nimport type { ErrorResponse } from './api'\n\n/**\n * Validate data against a Zod schema.\n * Returns { success: true, data } or { success: false, error: ErrorResponse }\n */\nexport function validate<T extends z.ZodSchema>(\n schema: T,\n data: unknown\n): { success: true; data: z.infer<T> } | { success: false; error: ErrorResponse } {\n const result = schema.safeParse(data)\n if (result.success) {\n return { success: true, data: result.data }\n }\n return {\n success: false,\n error: createErrorResponse(\n 'VALIDATION_ERROR',\n formatZodError(result.error),\n 400\n ),\n }\n}\n\n/**\n * Format Zod errors into a human-readable message.\n */\nexport function formatZodError(error: z.ZodError): string {\n return error.issues\n .map((issue) => {\n const path = issue.path.length > 0 ? `${issue.path.join('.')}: ` : ''\n return `${path}${issue.message}`\n })\n .join('; ')\n}\n\n/**\n * Create a standard error response object.\n */\nexport function createErrorResponse(\n code: string,\n message: string,\n status: number\n): ErrorResponse {\n return {\n error: {\n code: code as ErrorResponse['error']['code'],\n message,\n status,\n },\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,iBAAkB;AAEX,IAAM,gBAAgB,a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ACA,SACA,QACe;AACf,SAAO;AAAA,IACL,OAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AACF;","names":["import_zod","import_zod","import_zod","import_zod"]}
1
+ {"version":3,"sources":["../src/index.ts","../src/enums.ts","../src/receipt.ts","../src/constraints.ts","../src/rubric.ts","../src/api.ts","../src/memory.ts","../src/validation.ts"],"sourcesContent":["// Enums\nexport { ReceiptStatus, ReceiptType, Environment, ErrorCode } from './enums'\n\n// Receipt schemas + types\nexport { SignablePayload, ActionReceipt } from './receipt'\n\n// Constraint schemas + types\nexport {\n ConstraintDefinition,\n SingleConstraintResult,\n ConstraintResult,\n ConstraintDefinitions,\n} from './constraints'\n\n// Rubric schemas + types\nexport {\n RubricCriterion,\n Rubric,\n CriterionResult,\n JudgmentResult,\n} from './rubric'\n\n// API schemas + types\nexport {\n CreateReceiptInput,\n CompleteReceiptInput,\n VerifyResponse,\n ListReceiptsQuery,\n PaginationMeta,\n ErrorResponse,\n} from './api'\n\n// Memory schemas + types\nexport {\n EntityType,\n MemoryOperation,\n MemoryScope,\n ConfidenceLevel,\n Observation,\n Relationship,\n Entity,\n MemoryReceiptPayload,\n MemoryQuery,\n} from './memory'\n\n// Validation utilities\nexport { validate, formatZodError, createErrorResponse } from './validation'\n\n// Re-export types explicitly for consumers who import types only\nexport type {\n ReceiptStatus as ReceiptStatusType,\n ReceiptType as ReceiptTypeType,\n Environment as EnvironmentType,\n ErrorCode as ErrorCodeType,\n} from './enums'\n","import { z } from 'zod'\n\nexport const ReceiptStatus = z.enum(['pending', 'completed', 'failed', 'timeout'])\nexport type ReceiptStatus = z.infer<typeof ReceiptStatus>\n\nexport const ReceiptType = z.enum(['action', 'verification', 'judgment', 'arbitration', 'memory'])\nexport type ReceiptType = z.infer<typeof ReceiptType>\n\nexport const Environment = z.enum(['development', 'production', 'staging', 'test'])\nexport type Environment = z.infer<typeof Environment>\n\nexport const ErrorCode = z.enum([\n 'UNAUTHORIZED',\n 'KEY_REVOKED',\n 'FORBIDDEN',\n 'RECEIPT_NOT_FOUND',\n 'CHAIN_NOT_FOUND',\n 'AGENT_NOT_FOUND',\n 'RECEIPT_NOT_PENDING',\n 'RECEIPT_IMMUTABLE',\n 'RATE_LIMIT_EXCEEDED',\n 'VALIDATION_ERROR',\n 'INTERNAL_ERROR',\n])\nexport type ErrorCode = z.infer<typeof ErrorCode>\n","import { z } from 'zod'\nimport { ReceiptStatus, ReceiptType, Environment } from './enums'\n\n/**\n * The 12 fields that are cryptographically signed.\n * These fields are extracted from a receipt and serialized as canonical JSON\n * before signing with Ed25519.\n */\nexport const SignablePayload = z.object({\n receipt_id: z.string(),\n chain_id: z.string(),\n receipt_type: ReceiptType,\n agent_id: z.string(),\n org_id: z.string(),\n action: z.string(),\n input_hash: z.string(),\n output_hash: z.string().nullable(),\n status: ReceiptStatus,\n timestamp: z.string().datetime(),\n completed_at: z.string().datetime().nullable(),\n environment: Environment,\n})\nexport type SignablePayload = z.infer<typeof SignablePayload>\n\n/**\n * The complete receipt object as returned by the API.\n */\nexport const ActionReceipt = z.object({\n // Identity\n receipt_id: z.string(),\n parent_receipt_id: z.string().nullable(),\n chain_id: z.string(),\n\n // Type\n receipt_type: ReceiptType,\n\n // Who\n agent_id: z.string(),\n org_id: z.string(),\n\n // What\n action: z.string(),\n input_hash: z.string(),\n output_hash: z.string().nullable(),\n output_summary: z.string().nullable(),\n\n // How (all nullable — may not be known at creation)\n model: z.string().nullable(),\n tokens_in: z.number().int().nonnegative().nullable(),\n tokens_out: z.number().int().nonnegative().nullable(),\n cost_usd: z.number().nonnegative().nullable(),\n latency_ms: z.number().int().nonnegative().nullable(),\n tool_calls: z.array(z.string()).nullable(),\n\n // When\n timestamp: z.string().datetime(),\n completed_at: z.string().datetime().nullable(),\n\n // Status\n status: ReceiptStatus,\n error: z.record(z.unknown()).nullable(),\n\n // Context\n environment: Environment,\n tags: z.array(z.string()).nullable(),\n\n // Verification (Tier 2 — Phase 6)\n constraints: z.record(z.unknown()).nullable(),\n constraint_result: z.record(z.unknown()).nullable(),\n\n // Trust\n signature: z.string(),\n verify_url: z.string().url(),\n\n // Optional\n callback_verified: z.boolean().nullable(),\n confidence: z.number().min(0).max(1).nullable(),\n metadata: z.record(z.unknown()),\n})\nexport type ActionReceipt = z.infer<typeof ActionReceipt>\n","import { z } from 'zod'\n\n/**\n * A single constraint definition that specifies a rule to evaluate.\n */\nexport const ConstraintDefinition = z.object({\n type: z.string().min(1),\n value: z.unknown(),\n message: z.string().optional(),\n})\nexport type ConstraintDefinition = z.infer<typeof ConstraintDefinition>\n\n/**\n * Result of evaluating a single constraint.\n */\nexport const SingleConstraintResult = z.object({\n type: z.string(),\n passed: z.boolean(),\n expected: z.unknown(),\n actual: z.unknown(),\n message: z.string().optional(),\n})\nexport type SingleConstraintResult = z.infer<typeof SingleConstraintResult>\n\n/**\n * Aggregate result of evaluating all constraints on a receipt.\n */\nexport const ConstraintResult = z.object({\n passed: z.boolean(),\n results: z.array(SingleConstraintResult),\n evaluated_at: z.string().datetime(),\n})\nexport type ConstraintResult = z.infer<typeof ConstraintResult>\n\n/**\n * Array of constraint definitions.\n */\nexport const ConstraintDefinitions = z.array(ConstraintDefinition)\nexport type ConstraintDefinitions = z.infer<typeof ConstraintDefinitions>\n","import { z } from 'zod'\n\nexport const RubricCriterion = z.object({\n name: z.string().min(1),\n description: z.string().min(1),\n weight: z.number().min(0).max(1),\n passing_threshold: z.number().min(0).max(1).optional(),\n examples: z.object({\n good: z.array(z.string()).optional(),\n bad: z.array(z.string()).optional(),\n }).optional(),\n})\nexport type RubricCriterion = z.infer<typeof RubricCriterion>\n\nexport const Rubric = z.object({\n version: z.string().default('1.0'),\n criteria: z.array(RubricCriterion).min(1),\n passing_threshold: z.number().min(0).max(1).default(0.7),\n require_all: z.boolean().default(false),\n})\nexport type Rubric = z.infer<typeof Rubric>\n\nexport const CriterionResult = z.object({\n criterion: z.string(),\n score: z.number().min(0).max(1),\n passed: z.boolean(),\n reasoning: z.string(),\n})\nexport type CriterionResult = z.infer<typeof CriterionResult>\n\nexport const JudgmentResult = z.object({\n verdict: z.enum(['pass', 'fail', 'partial']),\n score: z.number().min(0).max(1),\n criteria_results: z.array(CriterionResult),\n overall_reasoning: z.string(),\n rubric_version: z.string(),\n})\nexport type JudgmentResult = z.infer<typeof JudgmentResult>\n","import { z } from 'zod'\nimport { ReceiptStatus, ReceiptType, Environment, ErrorCode } from './enums'\n\n/**\n * What the client sends to POST /api/v1/receipts.\n */\nexport const CreateReceiptInput = z.object({\n // Required\n agent_id: z.string().min(1),\n action: z.string().min(1),\n input_hash: z.string().min(1),\n\n // Optional with defaults\n receipt_type: ReceiptType.default('action'),\n status: ReceiptStatus.default('pending'),\n environment: Environment.default('production'),\n\n // Optional\n parent_receipt_id: z.string().nullable().optional(),\n output_hash: z.string().nullable().optional(),\n output_summary: z.string().nullable().optional(),\n model: z.string().nullable().optional(),\n tokens_in: z.number().int().nonnegative().nullable().optional(),\n tokens_out: z.number().int().nonnegative().nullable().optional(),\n cost_usd: z.number().nonnegative().nullable().optional(),\n latency_ms: z.number().int().nonnegative().nullable().optional(),\n tool_calls: z.array(z.string()).nullable().optional(),\n tags: z.array(z.string()).nullable().optional(),\n confidence: z.number().min(0).max(1).nullable().optional(),\n callback_verified: z.boolean().nullable().optional(),\n metadata: z.record(z.unknown()).optional(),\n})\nexport type CreateReceiptInput = z.infer<typeof CreateReceiptInput>\n\n/**\n * What the client sends to PATCH /api/v1/receipts/:id/complete.\n */\nexport const CompleteReceiptInput = z.object({\n // Required — must transition from pending\n status: z.enum(['completed', 'failed', 'timeout']),\n\n // Execution results (all optional — set what you know)\n output_hash: z.string().nullable().optional(),\n output_summary: z.string().nullable().optional(),\n model: z.string().nullable().optional(),\n tokens_in: z.number().int().nonnegative().nullable().optional(),\n tokens_out: z.number().int().nonnegative().nullable().optional(),\n cost_usd: z.number().nonnegative().nullable().optional(),\n latency_ms: z.number().int().nonnegative().nullable().optional(),\n tool_calls: z.array(z.string()).nullable().optional(),\n confidence: z.number().min(0).max(1).nullable().optional(),\n callback_verified: z.boolean().nullable().optional(),\n error: z.record(z.unknown()).nullable().optional(),\n})\nexport type CompleteReceiptInput = z.infer<typeof CompleteReceiptInput>\n\n/**\n * What GET /api/v1/verify/:id returns.\n * Note: Does NOT include org_id, metadata, tags, or output_summary (org-private).\n */\nexport const VerifyResponse = z.object({\n verified: z.boolean(),\n receipt: z.object({\n receipt_id: z.string(),\n chain_id: z.string(),\n receipt_type: ReceiptType,\n agent_id: z.string(),\n action: z.string(),\n status: ReceiptStatus,\n input_hash: z.string(),\n output_hash: z.string().nullable(),\n signature: z.string(),\n timestamp: z.string().datetime(),\n completed_at: z.string().datetime().nullable(),\n environment: Environment,\n latency_ms: z.number().int().nonnegative().nullable(),\n }),\n signature_valid: z.boolean(),\n chain_length: z.number().int().nonnegative(),\n public_key_url: z.string().url(),\n})\nexport type VerifyResponse = z.infer<typeof VerifyResponse>\n\n/**\n * Query parameters for GET /api/v1/receipts.\n */\nexport const ListReceiptsQuery = z.object({\n page: z.coerce.number().int().positive().default(1),\n limit: z.coerce.number().int().positive().max(100).default(50),\n agent_id: z.string().optional(),\n action: z.string().optional(),\n status: ReceiptStatus.optional(),\n environment: Environment.optional(),\n receipt_type: ReceiptType.optional(),\n chain_id: z.string().optional(),\n tag: z.string().optional(),\n from: z.string().datetime().optional(),\n to: z.string().datetime().optional(),\n sort: z.string().regex(/^(created_at|completed_at|latency_ms|cost_usd):(asc|desc)$/).default('created_at:desc'),\n})\nexport type ListReceiptsQuery = z.infer<typeof ListReceiptsQuery>\n\n/**\n * Pagination metadata included in list responses.\n */\nexport const PaginationMeta = z.object({\n page: z.number().int().positive(),\n limit: z.number().int().positive(),\n total: z.number().int().nonnegative(),\n total_pages: z.number().int().nonnegative(),\n has_next: z.boolean(),\n has_prev: z.boolean(),\n})\nexport type PaginationMeta = z.infer<typeof PaginationMeta>\n\n/**\n * Standard error response format.\n */\nexport const ErrorResponse = z.object({\n error: z.object({\n code: ErrorCode,\n message: z.string(),\n status: z.number().int(),\n }),\n})\nexport type ErrorResponse = z.infer<typeof ErrorResponse>\n","import { z } from 'zod'\n\n// --- Enums ---\n\nexport const EntityType = z.enum([\n 'person',\n 'project',\n 'organization',\n 'preference',\n 'fact',\n 'context',\n 'tool',\n 'custom',\n])\nexport type EntityType = z.infer<typeof EntityType>\n\nexport const MemoryOperation = z.enum([\n 'observe',\n 'create',\n 'merge',\n 'forget',\n 'forget_entity',\n 'recall',\n 'update',\n])\nexport type MemoryOperation = z.infer<typeof MemoryOperation>\n\nexport const MemoryScope = z.enum([\n 'agent',\n 'user',\n 'team',\n 'global',\n])\nexport type MemoryScope = z.infer<typeof MemoryScope>\n\nexport const ConfidenceLevel = z.enum([\n 'certain',\n 'high',\n 'medium',\n 'low',\n 'deprecated',\n])\nexport type ConfidenceLevel = z.infer<typeof ConfidenceLevel>\n\n// --- Core Types ---\n\nexport const Observation = z.object({\n observation_id: z.string(),\n entity_id: z.string(),\n content: z.string(),\n confidence: ConfidenceLevel.default('medium'),\n source_receipt_id: z.string(),\n source_agent_id: z.string(),\n source_context: z.string().nullable(),\n observed_at: z.string().datetime(),\n forgotten_at: z.string().datetime().nullable(),\n forgotten_by: z.string().nullable(),\n superseded_by: z.string().nullable(),\n expires_at: z.string().datetime().nullable().default(null),\n tags: z.array(z.string()).default([]),\n metadata: z.record(z.unknown()).default({}),\n})\nexport type Observation = z.infer<typeof Observation>\n\nexport const Relationship = z.object({\n relationship_id: z.string(),\n from_entity_id: z.string(),\n to_entity_id: z.string(),\n relationship_type: z.string(),\n strength: ConfidenceLevel.default('medium'),\n source_receipt_id: z.string(),\n created_at: z.string().datetime(),\n forgotten_at: z.string().datetime().nullable(),\n metadata: z.record(z.unknown()).default({}),\n})\nexport type Relationship = z.infer<typeof Relationship>\n\nexport const Entity = z.object({\n entity_id: z.string(),\n entity_type: EntityType,\n name: z.string(),\n aliases: z.array(z.string()).default([]),\n scope: MemoryScope.default('agent'),\n created_at: z.string().datetime(),\n created_by_agent: z.string(),\n created_by_receipt: z.string(),\n forgotten_at: z.string().datetime().nullable(),\n merged_into: z.string().nullable(),\n attributes: z.record(z.unknown()).default({}),\n metadata: z.record(z.unknown()).default({}),\n})\nexport type Entity = z.infer<typeof Entity>\n\n// --- Memory Receipt Extension ---\n\nexport const MemoryReceiptPayload = z.object({\n memory_operation: MemoryOperation,\n entity_id: z.string().nullable(),\n observation_id: z.string().nullable(),\n relationship_id: z.string().nullable(),\n scope: MemoryScope,\n query: z.string().nullable(),\n results_count: z.number().int().nullable(),\n confidence: ConfidenceLevel.nullable(),\n})\nexport type MemoryReceiptPayload = z.infer<typeof MemoryReceiptPayload>\n\n// --- Query Types ---\n\nexport const MemoryQuery = z.object({\n query: z.string().optional(),\n entity_type: EntityType.optional(),\n entity_id: z.string().optional(),\n scope: MemoryScope.optional(),\n agent_id: z.string().optional(),\n confidence_min: ConfidenceLevel.optional(),\n include_forgotten: z.boolean().default(false),\n tags: z.array(z.string()).optional(),\n limit: z.number().int().min(1).max(100).default(20),\n page: z.number().int().min(1).default(1),\n})\nexport type MemoryQuery = z.infer<typeof MemoryQuery>\n","import { z } from 'zod'\nimport type { ErrorResponse } from './api'\n\n/**\n * Validate data against a Zod schema.\n * Returns { success: true, data } or { success: false, error: ErrorResponse }\n */\nexport function validate<T extends z.ZodSchema>(\n schema: T,\n data: unknown\n): { success: true; data: z.infer<T> } | { success: false; error: ErrorResponse } {\n const result = schema.safeParse(data)\n if (result.success) {\n return { success: true, data: result.data }\n }\n return {\n success: false,\n error: createErrorResponse(\n 'VALIDATION_ERROR',\n formatZodError(result.error),\n 400\n ),\n }\n}\n\n/**\n * Format Zod errors into a human-readable message.\n */\nexport function formatZodError(error: z.ZodError): string {\n return error.issues\n .map((issue) => {\n const path = issue.path.length > 0 ? `${issue.path.join('.')}: ` : ''\n return `${path}${issue.message}`\n })\n .join('; ')\n}\n\n/**\n * Create a standard error response object.\n */\nexport function createErrorResponse(\n code: string,\n message: string,\n status: number\n): ErrorResponse {\n return {\n error: {\n code: code as ErrorResponse['error']['code'],\n message,\n status,\n },\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,iBAAkB;AAEX,IAAM,gBAAgB,aAAE,KAAK,CAAC,WAAW,aAAa,UAAU,SAAS,CAAC;AAG1E,IAAM,cAAc,aAAE,KAAK,CAAC,UAAU,gBAAgB,YAAY,eAAe,QAAQ,CAAC;AAG1F,IAAM,cAAc,aAAE,KAAK,CAAC,eAAe,cAAc,WAAW,MAAM,CAAC;AAG3E,IAAM,YAAY,aAAE,KAAK;AAAA,EAC9B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;;;ACvBD,IAAAA,cAAkB;AAQX,IAAM,kBAAkB,cAAE,OAAO;AAAA,EACtC,YAAY,cAAE,OAAO;AAAA,EACrB,UAAU,cAAE,OAAO;AAAA,EACnB,cAAc;AAAA,EACd,UAAU,cAAE,OAAO;AAAA,EACnB,QAAQ,cAAE,OAAO;AAAA,EACjB,QAAQ,cAAE,OAAO;AAAA,EACjB,YAAY,cAAE,OAAO;AAAA,EACrB,aAAa,cAAE,OAAO,EAAE,SAAS;AAAA,EACjC,QAAQ;AAAA,EACR,WAAW,cAAE,OAAO,EAAE,SAAS;AAAA,EAC/B,cAAc,cAAE,OAAO,EAAE,SAAS,EAAE,SAAS;AAAA,EAC7C,aAAa;AACf,CAAC;AAMM,IAAM,gBAAgB,cAAE,OAAO;AAAA;AAAA,EAEpC,YAAY,cAAE,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