meridian-core 0.1.0 → 0.1.2

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 (67) hide show
  1. package/README.md +120 -0
  2. package/dist/index.js +1217 -4
  3. package/package.json +10 -11
  4. package/dist/cli.d.ts +0 -14
  5. package/dist/cli.d.ts.map +0 -1
  6. package/dist/cli.js +0 -46
  7. package/dist/cli.js.map +0 -1
  8. package/dist/commands/analyze.d.ts +0 -8
  9. package/dist/commands/analyze.d.ts.map +0 -1
  10. package/dist/commands/analyze.js +0 -78
  11. package/dist/commands/analyze.js.map +0 -1
  12. package/dist/commands/field.d.ts +0 -8
  13. package/dist/commands/field.d.ts.map +0 -1
  14. package/dist/commands/field.js +0 -46
  15. package/dist/commands/field.js.map +0 -1
  16. package/dist/commands/gravity.d.ts +0 -8
  17. package/dist/commands/gravity.d.ts.map +0 -1
  18. package/dist/commands/gravity.js +0 -47
  19. package/dist/commands/gravity.js.map +0 -1
  20. package/dist/commands/trace.d.ts +0 -8
  21. package/dist/commands/trace.d.ts.map +0 -1
  22. package/dist/commands/trace.js +0 -37
  23. package/dist/commands/trace.js.map +0 -1
  24. package/dist/commands/version.d.ts +0 -8
  25. package/dist/commands/version.d.ts.map +0 -1
  26. package/dist/commands/version.js +0 -21
  27. package/dist/commands/version.js.map +0 -1
  28. package/dist/index.d.ts +0 -3
  29. package/dist/index.d.ts.map +0 -1
  30. package/dist/index.js.map +0 -1
  31. package/dist/lib/errors.d.ts +0 -21
  32. package/dist/lib/errors.d.ts.map +0 -1
  33. package/dist/lib/errors.js +0 -37
  34. package/dist/lib/errors.js.map +0 -1
  35. package/dist/lib/input.d.ts +0 -11
  36. package/dist/lib/input.d.ts.map +0 -1
  37. package/dist/lib/input.js +0 -38
  38. package/dist/lib/input.js.map +0 -1
  39. package/dist/lib/manifest.d.ts +0 -10
  40. package/dist/lib/manifest.d.ts.map +0 -1
  41. package/dist/lib/manifest.js +0 -35
  42. package/dist/lib/manifest.js.map +0 -1
  43. package/dist/lib/options.d.ts +0 -26
  44. package/dist/lib/options.d.ts.map +0 -1
  45. package/dist/lib/options.js +0 -44
  46. package/dist/lib/options.js.map +0 -1
  47. package/dist/lib/output.d.ts +0 -32
  48. package/dist/lib/output.d.ts.map +0 -1
  49. package/dist/lib/output.js +0 -156
  50. package/dist/lib/output.js.map +0 -1
  51. package/src/cli.ts +0 -54
  52. package/src/commands/analyze.ts +0 -103
  53. package/src/commands/field.ts +0 -66
  54. package/src/commands/gravity.ts +0 -70
  55. package/src/commands/trace.ts +0 -51
  56. package/src/commands/version.ts +0 -21
  57. package/src/index.ts +0 -7
  58. package/src/lib/errors.ts +0 -42
  59. package/src/lib/input.test.ts +0 -38
  60. package/src/lib/input.ts +0 -43
  61. package/src/lib/manifest.test.ts +0 -60
  62. package/src/lib/manifest.ts +0 -41
  63. package/src/lib/options.test.ts +0 -27
  64. package/src/lib/options.ts +0 -47
  65. package/src/lib/output.ts +0 -180
  66. package/tsconfig.json +0 -10
  67. package/vitest.config.ts +0 -8
package/README.md ADDED
@@ -0,0 +1,120 @@
1
+ # meridian-core
2
+
3
+ **MERIDIAN command-line interface — pre-execution intelligence for Stellar developers, from your terminal.**
4
+
5
+ [![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/armlynobinguar/meridian-core/blob/main/LICENSE)
6
+ [![npm](https://img.shields.io/npm/v/meridian-core?label=meridian-core)](https://www.npmjs.com/package/meridian-core)
7
+
8
+ MERIDIAN simulates a Stellar transaction end-to-end, maps every contract it touches downstream, scores what breaks if something goes wrong, and returns a plain-language GenAI risk brief — all before you submit.
9
+
10
+ Full project docs, architecture, and the REST API live in the [monorepo README](https://github.com/armlynobinguar/meridian-core#readme). This package is the standalone `meridian` / `meridian-core` CLI.
11
+
12
+ ## Install
13
+
14
+ ```bash
15
+ npm install -g meridian-core
16
+ meridian-core --help
17
+ ```
18
+
19
+ ## Requirements
20
+
21
+ - Node.js **>= 20**
22
+ - A Soroban RPC endpoint for the network you're targeting (testnet/mainnet)
23
+ - *(Optional)* An [Anthropic API key](https://console.anthropic.com/) for GenAI-synthesized briefs — falls back to a deterministic brief without one
24
+
25
+ ## Verdict States
26
+
27
+ | Verdict | Meaning |
28
+ |---|---|
29
+ | 🟢 `CLEAR` | Safe to submit |
30
+ | 🟡 `WARN` | Submit with caution — review warnings |
31
+ | 🔴 `ABORT` | Do not submit — critical failure predicted |
32
+
33
+ ## Commands
34
+
35
+ | Command | Description |
36
+ |---|---|
37
+ | `meridian analyze [tx]` | Full pipeline: TRACE + FIELD + GRAVITY + BRIEF *(default command)* |
38
+ | `meridian trace [tx]` | TRACE only — simulate and report the execution path |
39
+ | `meridian field [tx]` | TRACE + FIELD — map the dependency graph touched by the transaction |
40
+ | `meridian gravity [tx]` | TRACE + FIELD + GRAVITY — score the blast radius |
41
+ | `meridian version` | Print CLI and engine version |
42
+ | `meridian --help` / `meridian <command> --help` | Show detailed help |
43
+
44
+ `tx` is the base64-encoded transaction XDR. It can be passed as an argument, via `--file`, or piped over stdin.
45
+
46
+ ## Options
47
+
48
+ | Flag | Applies to | Description |
49
+ |---|---|---|
50
+ | `-n, --network <network>` | all | `mainnet` or `testnet` (default: `testnet`) |
51
+ | `--rpc-url <url>` | all | Override the Soroban RPC endpoint instead of reading it from env |
52
+ | `-f, --file <path>` | all | Read the transaction XDR from a file instead of an argument |
53
+ | `-e, --ecosystem <path>` | `field`, `gravity`, `analyze` | Path to an ecosystem manifest JSON file |
54
+ | `--json` | all | Print raw JSON instead of a formatted report |
55
+ | `--skip-field` | `analyze` | Skip the FIELD dependency-mapping layer |
56
+ | `--skip-gravity` | `analyze` | Skip the GRAVITY blast-radius layer |
57
+ | `--confidence-threshold <n>` | `analyze` | Minimum confidence (0–1) required for a `CLEAR` verdict |
58
+ | `--no-brief` | `analyze` | Skip GenAI BRIEF synthesis (structured layers only) |
59
+ | `--api-key <key>` | `analyze` | Anthropic API key for BRIEF synthesis (else read from env) |
60
+
61
+ ## Examples
62
+
63
+ ```bash
64
+ # Full analysis (default command — "analyze" can be omitted)
65
+ meridian analyze <base64-xdr> --network testnet
66
+
67
+ # Read the XDR from a file
68
+ meridian analyze --file tx.xdr --network mainnet
69
+
70
+ # Pipe it in via stdin
71
+ cat tx.xdr | meridian analyze --network testnet --json
72
+
73
+ # Override the RPC endpoint without setting env vars
74
+ meridian analyze <base64-xdr> --network testnet --rpc-url https://soroban-testnet.stellar.org
75
+
76
+ # Score blast radius against a known ecosystem manifest
77
+ meridian gravity <base64-xdr> --ecosystem manifest.json --network testnet
78
+
79
+ # Fast structured-only analysis (no GenAI call)
80
+ meridian analyze <base64-xdr> --network testnet --no-brief
81
+
82
+ # TRACE only, fastest path
83
+ meridian trace <base64-xdr> --network testnet
84
+
85
+ # Check installed versions
86
+ meridian version
87
+ ```
88
+
89
+ ## Ecosystem Manifest
90
+
91
+ An optional JSON file describing known contracts in your ecosystem, used by `field`, `gravity`, and `analyze` to enrich dependency mapping, blast-radius scoring, and affected-user counts:
92
+
93
+ ```json
94
+ {
95
+ "name": "my-ecosystem",
96
+ "version": "1.0.0",
97
+ "contracts": [
98
+ {
99
+ "name": "token-vault",
100
+ "address": "CABC...XYZ",
101
+ "network": "testnet",
102
+ "dependencies": ["CDEF...UVW"],
103
+ "active_users": 4200,
104
+ "criticality": "HIGH"
105
+ }
106
+ ]
107
+ }
108
+ ```
109
+
110
+ ## Environment Variables
111
+
112
+ | Variable | Required | Description |
113
+ |---|---|---|
114
+ | `STELLAR_RPC_TESTNET` | For testnet use | Soroban RPC endpoint for testnet |
115
+ | `STELLAR_RPC_MAINNET` | For mainnet use | Soroban RPC endpoint for mainnet |
116
+ | `ANTHROPIC_API_KEY` | No | Claude API key for BRIEF synthesis — falls back to a deterministic brief if unset |
117
+
118
+ ## License
119
+
120
+ MIT — see the [monorepo repository](https://github.com/armlynobinguar/meridian-core) for full source and license details.