hyperterse 2.1.0 → 2.2.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 (2) hide show
  1. package/README.md +183 -71
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,3 +1,4 @@
1
+ <!-- Start of - Dont change this block -->
1
2
  <div align="center">
2
3
  <picture>
3
4
  <img alt="Hyperterse - connect your data to your agents." src="docs/assets/og.png" />
@@ -22,21 +23,28 @@
22
23
 
23
24
  ---
24
25
 
25
- Hyperterse turns tool configs into callable tools, with:
26
+ <!-- End of - Dont change this block -->
26
27
 
27
- - filesystem-based tool discovery,
28
- - pluggable adapters (Postgres, MySQL, MongoDB, Redis),
29
- - optional scripts for transforms and handlers,
30
- - MCP runtime exposure over Streamable HTTP.
28
+ Hyperterse is a **tool-first MCP framework** for building AI-ready backend surfaces from declarative config.
31
29
 
32
- ## What Hyperterse is
30
+ You define tools and adapters in the filesystem, and Hyperterse handles compile-time validation, script bundling, runtime execution, auth, caching, and observability.
33
31
 
34
- - **Tool-first MCP framework**: each tool config compiles into a tool.
35
- - **Declarative runtime**: root config + adapter files + tool files.
36
- - **Extensible execution pipeline**: auth -> input transform -> execute -> output transform.
37
- - **Embedded scripting**: script hooks run in a sandboxed runtime; bundled at compile time.
32
+ ## What Hyperterse is for
38
33
 
39
- ## Quick start
34
+ - Exposing database queries and custom logic as MCP tools
35
+ - Running a production MCP server over Streamable HTTP
36
+ - Keeping tool definitions declarative while still supporting TypeScript handlers/transforms
37
+
38
+ ## Core capabilities
39
+
40
+ - **Filesystem discovery**: each `app/tools/*/config.terse` becomes one project tool.
41
+ - **Execution models**: DB-backed tools (`use` + `statement`) or script-backed tools (`handler`).
42
+ - **Database adapters**: PostgreSQL, MySQL, MongoDB, Redis.
43
+ - **Per-tool auth**: built-in `allow_all` and `api_key`, plus custom plugins.
44
+ - **In-memory caching**: global defaults + per-tool overrides.
45
+ - **Observability**: OpenTelemetry tracing/metrics + structured logging.
46
+
47
+ ## Quick Start
40
48
 
41
49
  ### Install
42
50
 
@@ -50,66 +58,153 @@ curl -fsSL https://hyperterse.com/install | bash
50
58
  hyperterse init
51
59
  ```
52
60
 
53
- This scaffolds:
61
+ Generated starter structure:
54
62
 
55
- - `.hyperterse`
56
- - `app/adapters/my-database.terse`
57
- - `app/tools/hello-world/config.terse`
58
- - `app/tools/hello-world/user-data-mapper.ts`
63
+ ```text
64
+ .
65
+ ├── .hyperterse
66
+ ├── .agent/
67
+ │ └── skills/
68
+ │ └── hyperterse-docs/
69
+ │ └── SKILL.md
70
+ └── app/
71
+ └── tools/
72
+ └── hello-world/
73
+ ├── config.terse
74
+ └── handler.ts
75
+ ```
59
76
 
60
- ### Run
77
+ ### Start
61
78
 
62
79
  ```bash
63
80
  hyperterse start
64
81
  ```
65
82
 
66
- With hot reload:
83
+ With live reload:
67
84
 
68
85
  ```bash
69
86
  hyperterse start --watch
70
87
  ```
71
88
 
72
- ### Test
89
+ ### Verify health
73
90
 
74
91
  ```bash
75
92
  curl http://localhost:8080/heartbeat
76
93
  ```
77
94
 
95
+ Expected response:
96
+
97
+ ```json
98
+ { "success": true }
99
+ ```
100
+
101
+ ### 5) List MCP entry tools
102
+
78
103
  ```bash
79
- curl -X POST http://localhost:8080/mcp \
104
+ curl -s -X POST http://localhost:8080/mcp \
80
105
  -H "Content-Type: application/json" \
81
106
  -d '{
82
107
  "jsonrpc": "2.0",
83
108
  "method": "tools/list",
84
109
  "id": 1
85
- }'
110
+ }' | jq
111
+ ```
112
+
113
+ By design, Hyperterse exposes two transport-layer tools:
114
+
115
+ - `search` - discover project tools by natural language
116
+ - `execute` - execute a project tool by name
117
+
118
+ ### 6) Discover project tools
119
+
120
+ ```bash
121
+ curl -s -X POST http://localhost:8080/mcp \
122
+ -H "Content-Type: application/json" \
123
+ -d '{
124
+ "jsonrpc": "2.0",
125
+ "method": "tools/call",
126
+ "params": {
127
+ "name": "search",
128
+ "arguments": {
129
+ "query": "hello world greeting"
130
+ }
131
+ },
132
+ "id": 2
133
+ }' | jq
134
+ ```
135
+
136
+ Search hits include `name`, `description`, `relevance_score`, and `inputs`.
137
+
138
+ ### Execute a project tool
139
+
140
+ ```bash
141
+ curl -s -X POST http://localhost:8080/mcp \
142
+ -H "Content-Type: application/json" \
143
+ -d '{
144
+ "jsonrpc": "2.0",
145
+ "method": "tools/call",
146
+ "params": {
147
+ "name": "execute",
148
+ "arguments": {
149
+ "tool": "hello-world",
150
+ "inputs": { "name": "Hyperterse" }
151
+ }
152
+ },
153
+ "id": 3
154
+ }' | jq
86
155
  ```
87
156
 
88
- ## Project structure
157
+ ### Validate and build
158
+
159
+ ```bash
160
+ hyperterse validate
161
+ hyperterse build -o dist
162
+ hyperterse serve dist/
163
+ ```
164
+
165
+ ## Configuration model
166
+
167
+ ### Project layout
89
168
 
90
169
  ```text
91
170
  my-project/
92
- .hyperterse
93
- app/
94
- adapters/
95
- main-db.terse
96
- tools/
97
- get-user/
98
- config.terse
99
- input.ts
100
- output.ts
101
- get-weather/
102
- config.terse
103
- handler.ts
171
+ ├── .hyperterse
172
+ ├── app/
173
+ │ ├── adapters/
174
+ │ │ └── primary-db.terse
175
+ │ └── tools/
176
+ │ ├── get-user/
177
+ │ │ ├── config.terse
178
+ │ │ ├── input.ts
179
+ │ │ └── output.ts
180
+ │ └── get-weather/
181
+ │ ├── config.terse
182
+ │ └── handler.ts
183
+ └── package.json
184
+ ```
185
+
186
+ ### Root config (`.hyperterse`)
187
+
188
+ ```yaml
189
+ name: my-service
190
+ server:
191
+ port: 8080
192
+ log_level: 3
193
+ tools:
194
+ search:
195
+ limit: 10
196
+ cache:
197
+ enabled: true
198
+ ttl: 60
104
199
  ```
105
200
 
106
- ## Tool examples
201
+ ## Tool Examples
107
202
 
108
203
  ### DB-backed tool
109
204
 
110
205
  ```yaml
111
- description: "Get user by id"
112
- use: main-db
206
+ description: "Get user by ID"
207
+ use: primary-db
113
208
  statement: |
114
209
  SELECT id, name, email
115
210
  FROM users
@@ -117,60 +212,77 @@ statement: |
117
212
  inputs:
118
213
  user_id:
119
214
  type: int
215
+ auth:
216
+ plugin: api_key
217
+ policy:
218
+ value: "{{ env.API_KEY }}"
120
219
  ```
121
220
 
122
221
  ### Script-backed tool
123
222
 
124
223
  ```yaml
125
- description: "Get weather"
126
- handler: "./weather-handler.ts"
224
+ description: "Get weather by city"
225
+ handler: "./handler.ts"
226
+ inputs:
227
+ city:
228
+ type: string
229
+ auth:
230
+ plugin: allow_all
127
231
  ```
128
232
 
129
- ## CLI commands
233
+ Supported input types:
130
234
 
131
- - `start` - run runtime from config
132
- - `serve` - run from a compiled artifact
133
- - `build` - produce a deployable artifact
134
- - `validate` - validate config and tool scripts
135
- - `init` - scaffold starter project
136
- - `upgrade` - upgrade installed binary
137
- - `completion` - shell completion helper
235
+ - `string`
236
+ - `int`
237
+ - `float`
238
+ - `boolean`
239
+ - `datetime`
138
240
 
139
- ## Build and deploy
241
+ Each tool must define exactly one execution mode:
140
242
 
141
- ```bash
142
- hyperterse validate
143
- hyperterse build -o dist
144
- hyperterse serve dist/
145
- ```
243
+ - `use` (adapter-backed), or
244
+ - `handler` (script-backed)
146
245
 
147
- The `dist/` output includes everything needed to run in production.
246
+ ## Runtime model
148
247
 
149
- ## Configuration highlights
248
+ All tool interaction happens through MCP Streamable HTTP at `/mcp` (JSON-RPC 2.0).
150
249
 
151
- - root config: `.hyperterse`
152
- - adapter files: `app/adapters/*.terse`
153
- - tool files: `app/tools/*/config.terse`
250
+ Execution pipeline:
154
251
 
155
- Supported primitive types:
252
+ 1. Tool resolution
253
+ 2. Authentication
254
+ 3. Input transform (optional)
255
+ 4. Execution (DB or handler)
256
+ 5. Output transform (optional)
257
+ 6. Response serialization
156
258
 
157
- - `string`
158
- - `int`
159
- - `float`
160
- - `boolean`
161
- - `datetime`
259
+ ## Security notes
260
+
261
+ - Use `{{ env.VAR_NAME }}` for secrets and connection strings.
262
+ - `{{ inputs.field }}` statement substitution is textual; enforce strict input schemas and safe query patterns.
263
+ - Configure tool-level auth explicitly for production use.
162
264
 
163
- ## Security note
265
+ ## Documentation map
164
266
 
165
- Hyperterse validates typed inputs, but statement placeholder substitution (`{{ inputs.x }}`) is raw string replacement. Use strict tool input constraints and safe query patterns for production.
267
+ - [Documentation index (`llms.txt`)](https://docs.hyperterse.com/llms.txt)
268
+ - [Introduction](https://docs.hyperterse.com/introduction)
269
+ - [Quickstart](https://docs.hyperterse.com/quickstart)
270
+ - [Project structure](https://docs.hyperterse.com/concepts/project-structure)
271
+ - [Tools](https://docs.hyperterse.com/concepts/tools)
272
+ - [Adapters](https://docs.hyperterse.com/concepts/adapters)
273
+ - [Scripts](https://docs.hyperterse.com/concepts/scripts)
274
+ - [MCP transport](https://docs.hyperterse.com/runtime/mcp-transport)
275
+ - [Execution pipeline](https://docs.hyperterse.com/runtime/execution-pipeline)
276
+ - [CLI reference](https://docs.hyperterse.com/reference/cli)
277
+ - [Configuration schemas](https://docs.hyperterse.com/reference/configuration-schemas)
166
278
 
167
279
  ## Contributing
168
280
 
169
- 1. Fork the repo
170
- 2. Create a feature branch
171
- 3. Add or update tests
172
- 4. Run validation/lint/test locally
173
- 5. Open a PR
281
+ 1. Fork the repo.
282
+ 2. Create a feature branch.
283
+ 3. Add or update tests.
284
+ 4. Run validation locally.
285
+ 5. Open a PR.
174
286
 
175
287
  See `CONTRIBUTING.md` and `CODE_OF_CONDUCT.md`.
176
288
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hyperterse",
3
- "version": "2.1.0",
3
+ "version": "2.2.1",
4
4
  "description": "A declarative interface to connect your database to your AI agents",
5
5
  "author": "Samrith Shankar <samrith@outlook.com>",
6
6
  "license": "Apache-2.0",