@mikeargento/bitgraph-mcp 0.1.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.
Files changed (48) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +25 -0
  3. package/dist/__tests__/encoding.test.d.ts +2 -0
  4. package/dist/__tests__/encoding.test.d.ts.map +1 -0
  5. package/dist/__tests__/encoding.test.js +51 -0
  6. package/dist/__tests__/encoding.test.js.map +1 -0
  7. package/dist/__tests__/format.test.d.ts +2 -0
  8. package/dist/__tests__/format.test.d.ts.map +1 -0
  9. package/dist/__tests__/format.test.js +59 -0
  10. package/dist/__tests__/format.test.js.map +1 -0
  11. package/dist/__tests__/tools.test.d.ts +2 -0
  12. package/dist/__tests__/tools.test.d.ts.map +1 -0
  13. package/dist/__tests__/tools.test.js +304 -0
  14. package/dist/__tests__/tools.test.js.map +1 -0
  15. package/dist/api.d.ts +54 -0
  16. package/dist/api.d.ts.map +1 -0
  17. package/dist/api.js +144 -0
  18. package/dist/api.js.map +1 -0
  19. package/dist/encoding.d.ts +19 -0
  20. package/dist/encoding.d.ts.map +1 -0
  21. package/dist/encoding.js +64 -0
  22. package/dist/encoding.js.map +1 -0
  23. package/dist/format.d.ts +44 -0
  24. package/dist/format.d.ts.map +1 -0
  25. package/dist/format.js +164 -0
  26. package/dist/format.js.map +1 -0
  27. package/dist/index.d.ts +3 -0
  28. package/dist/index.d.ts.map +1 -0
  29. package/dist/index.js +25 -0
  30. package/dist/index.js.map +1 -0
  31. package/dist/server.d.ts +11 -0
  32. package/dist/server.d.ts.map +1 -0
  33. package/dist/server.js +375 -0
  34. package/dist/server.js.map +1 -0
  35. package/dist/types.d.ts +88 -0
  36. package/dist/types.d.ts.map +1 -0
  37. package/dist/types.js +3 -0
  38. package/dist/types.js.map +1 -0
  39. package/package.json +47 -0
  40. package/src/__tests__/encoding.test.ts +64 -0
  41. package/src/__tests__/format.test.ts +69 -0
  42. package/src/__tests__/tools.test.ts +334 -0
  43. package/src/api.ts +211 -0
  44. package/src/encoding.ts +72 -0
  45. package/src/format.ts +201 -0
  46. package/src/index.ts +30 -0
  47. package/src/server.ts +463 -0
  48. package/src/types.ts +74 -0
package/src/types.ts ADDED
@@ -0,0 +1,74 @@
1
+ // Copyright (c) 2024-2026 Mike Argento. Licensed under the MIT License. See LICENSE.
2
+
3
+ /**
4
+ * @mikeargento/bitgraph-mcp: wire types.
5
+ *
6
+ * Minimal views of the bitgraph/1 schema and the bitgraph.ing API responses.
7
+ * The canonical, fully documented schema lives in @mikeargento/bitgraph-verify.
8
+ * Fields not needed for display are kept as unknown; proofs are passed through
9
+ * verbatim when the caller asks for JSON.
10
+ */
11
+
12
+ export interface ProofCommit {
13
+ counter?: string;
14
+ epochId?: string;
15
+ time?: number;
16
+ slotCounter?: string;
17
+ [k: string]: unknown;
18
+ }
19
+
20
+ export interface BitGraphProof {
21
+ version?: string;
22
+ artifact?: { hashAlg?: string; digestB64?: string };
23
+ commit?: ProofCommit;
24
+ signer?: { publicKeyB64?: string; signatureB64?: string };
25
+ environment?: {
26
+ enforcement?: string;
27
+ measurement?: string;
28
+ attestation?: { format?: string; reportB64?: string };
29
+ };
30
+ attribution?: { name?: string; title?: string; message?: string };
31
+ proofHash?: string;
32
+ [k: string]: unknown;
33
+ }
34
+
35
+ /** POST /api/proofs/batch response. Keyed by the digest exactly as sent (URL-safe). */
36
+ export interface BatchCheckResponse {
37
+ results: Record<string, { proofs: Array<{ proof: BitGraphProof }> }>;
38
+ }
39
+
40
+ export interface AnchorView {
41
+ counter?: string;
42
+ attrName?: string;
43
+ blockNumber?: number | null;
44
+ blockHash?: string | null;
45
+ etherscanUrl?: string | null;
46
+ blockTime?: string | null;
47
+ }
48
+
49
+ export interface PositionView {
50
+ counter: string | null;
51
+ epoch: string | null;
52
+ lowerTime: string | null;
53
+ upperTime: string | null;
54
+ }
55
+
56
+ /**
57
+ * GET /api/proofs/digest/{digest} response.
58
+ * causalWindow naming note: anchorBefore is the EARLIER Ethereum block (the
59
+ * proof was BitGraphed after it, the lower time bound); anchorAfter is the
60
+ * LATER block (the upper bound). Present time as "between lower and upper".
61
+ */
62
+ export interface ProofDetailResponse {
63
+ proofs: Array<{ proof: BitGraphProof }>;
64
+ positions?: PositionView[];
65
+ causalWindow?: { anchorBefore: AnchorView | null; anchorAfter: AnchorView | null } | null;
66
+ anchorBlock?: AnchorView | null;
67
+ }
68
+
69
+ /** GET /api/search response. */
70
+ export interface SearchResponse {
71
+ found: boolean;
72
+ digest?: string;
73
+ counter?: string | null;
74
+ }