@postmcp/types 0.1.0 → 0.1.3
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/README.md +70 -0
- package/package.json +10 -1
package/README.md
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# @postmcp/types
|
|
2
|
+
|
|
3
|
+
> **PostMCP Shared Types** - Unified TypeScript definitions and interfaces for the PostMCP ecosystem.
|
|
4
|
+
|
|
5
|
+
[](https://opensource.org/licenses/MIT)
|
|
6
|
+
[](https://www.typescriptlang.org/)
|
|
7
|
+
[](https://www.npmjs.com/package/@postmcp/types)
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## Overview
|
|
12
|
+
|
|
13
|
+
`@postmcp/types` contains shared type definitions, interfaces, and enums used across all PostMCP packages (`@postmcp/core`, `@postmcp/cli`, `@postmcp/presets`, and `@postmcp/studio`).
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## Installation
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
npm install -D @postmcp/types
|
|
21
|
+
# or
|
|
22
|
+
pnpm add -D @postmcp/types
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## Core Types Exported
|
|
28
|
+
|
|
29
|
+
### 1. AST & Operation Definitions
|
|
30
|
+
* `NormalizedAST`: The parsed OpenAPI representation containing title, version, servers, and operations.
|
|
31
|
+
* `ToolDefinition`: Standardized MCP tool definition with JSON Schema input parameters.
|
|
32
|
+
* `RiskTier`: `'READ_ONLY' | 'MUTATION' | 'CRITICAL'`.
|
|
33
|
+
|
|
34
|
+
### 2. Token Diet & Optimization
|
|
35
|
+
* `TokenDietOptions`: Configuration for null stripping, metadata pruning, field masking, and Markdown table conversion.
|
|
36
|
+
* `TokenMetrics`: Token estimate before and after optimization with percentage saved.
|
|
37
|
+
|
|
38
|
+
### 3. Macro Pipelines
|
|
39
|
+
* `MacroDefinition`: Composite multi-step tool definition.
|
|
40
|
+
* `MacroStep`: Individual execution step in a macro workflow.
|
|
41
|
+
|
|
42
|
+
### 4. Configuration & CLI
|
|
43
|
+
* `PostMCPConfig`: Structure of `postmcp.config.json` workspace files.
|
|
44
|
+
* `RunCommandOptions`: Options for `postmcp run`.
|
|
45
|
+
* `StudioCommandOptions`: Options for `postmcp studio`.
|
|
46
|
+
* `GenerateCommandOptions`: Options for `postmcp generate`.
|
|
47
|
+
* `ExportCommandOptions`: Options for `postmcp export`.
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
## Usage Example
|
|
52
|
+
|
|
53
|
+
```typescript
|
|
54
|
+
import type { NormalizedAST, RiskTier, TokenDietOptions } from '@postmcp/types';
|
|
55
|
+
|
|
56
|
+
function analyzeSafety(tier: RiskTier): boolean {
|
|
57
|
+
return tier === 'READ_ONLY';
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
const options: TokenDietOptions = {
|
|
61
|
+
enableTable: true,
|
|
62
|
+
stripNulls: true,
|
|
63
|
+
};
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
## License
|
|
69
|
+
|
|
70
|
+
MIT (c) [PostMCP Contributors](https://github.com/BraveRam/postmcp/blob/main/LICENSE)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@postmcp/types",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "Unified TypeScript types and interfaces for the PostMCP ecosystem",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -24,6 +24,15 @@
|
|
|
24
24
|
"tsup": "^8.4.0",
|
|
25
25
|
"typescript": "^5.7.3"
|
|
26
26
|
},
|
|
27
|
+
"keywords": [
|
|
28
|
+
"mcp",
|
|
29
|
+
"model-context-protocol",
|
|
30
|
+
"postmcp",
|
|
31
|
+
"typescript-types",
|
|
32
|
+
"type-definitions",
|
|
33
|
+
"openapi",
|
|
34
|
+
"interfaces"
|
|
35
|
+
],
|
|
27
36
|
"scripts": {
|
|
28
37
|
"build": "tsup",
|
|
29
38
|
"dev": "tsup --watch",
|