@reaatech/prompt-version-control 0.1.0
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/CHANGELOG.md +11 -0
- package/LICENSE +21 -0
- package/README.md +168 -0
- package/dist/index.d.ts +47 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +109 -0
- package/dist/index.js.map +1 -0
- package/package.json +61 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# @reaatech/prompt-version-control
|
|
2
|
+
|
|
3
|
+
## 0.1.0
|
|
4
|
+
|
|
5
|
+
### Initial release
|
|
6
|
+
|
|
7
|
+
- Typed `PromptVersionControlClient` covering prompts, versions, tags, evaluations, deployments, and metrics
|
|
8
|
+
- Automatic retry with exponential backoff and jitter on 5xx and network errors
|
|
9
|
+
- `AbortController`-based request timeouts (default 30s)
|
|
10
|
+
- Optional in-memory LRU cache with TTL
|
|
11
|
+
- `zod` is a required peer dependency — install it alongside this package
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 prompt-version-control contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
# @reaatech/prompt-version-control
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/@reaatech/prompt-version-control)
|
|
4
|
+
[](https://github.com/reaatech/prompt-version-control/blob/main/LICENSE)
|
|
5
|
+
[](https://github.com/reaatech/prompt-version-control/actions/workflows/ci.yml)
|
|
6
|
+
|
|
7
|
+
> **Status:** Pre-1.0 — APIs may change in minor versions. Pin to a specific version in production.
|
|
8
|
+
|
|
9
|
+
TypeScript client SDK for the Prompt Version Control API. Provides a typed, authenticated client with built-in retry logic, configurable timeouts, and optional in-memory caching.
|
|
10
|
+
|
|
11
|
+
## Installation
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npm install @reaatech/prompt-version-control
|
|
15
|
+
# or
|
|
16
|
+
pnpm add @reaatech/prompt-version-control
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Feature Overview
|
|
20
|
+
|
|
21
|
+
- **Typed API client** — full TypeScript types for all responses
|
|
22
|
+
- **Automatic retry** — exponential backoff with jitter on 5xx errors and network failures
|
|
23
|
+
- **Configurable timeouts** — `AbortController`-based request timeout (default 30s)
|
|
24
|
+
- **In-memory cache** — optional LRU cache with TTL and max-entries eviction
|
|
25
|
+
- **Zero-config defaults** — `baseUrl` defaults to `http://localhost:3000`
|
|
26
|
+
- **4xx passthrough** — client errors are thrown immediately without retry
|
|
27
|
+
|
|
28
|
+
## Quick Start
|
|
29
|
+
|
|
30
|
+
```typescript
|
|
31
|
+
import { PromptVersionControlClient } from "@reaatech/prompt-version-control";
|
|
32
|
+
|
|
33
|
+
const client = new PromptVersionControlClient({
|
|
34
|
+
baseUrl: "http://localhost:3000",
|
|
35
|
+
apiKey: "pvc_your-api-key",
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
// Get a prompt by ID
|
|
39
|
+
const prompt = await client.getPrompt("prompt-abc123");
|
|
40
|
+
console.log(prompt.name, prompt.template);
|
|
41
|
+
|
|
42
|
+
// List all prompts
|
|
43
|
+
const { data } = await client.listPrompts();
|
|
44
|
+
|
|
45
|
+
// Get the production version of a prompt
|
|
46
|
+
const prod = await client.getProduction("prompt-abc123");
|
|
47
|
+
console.log(prod.number, prod.content);
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## API Reference
|
|
51
|
+
|
|
52
|
+
### `PromptVersionControlClient` (class)
|
|
53
|
+
|
|
54
|
+
Also exported as `PVCClient` (shorthand alias).
|
|
55
|
+
|
|
56
|
+
```typescript
|
|
57
|
+
import { PromptVersionControlClient } from "@reaatech/prompt-version-control";
|
|
58
|
+
// or
|
|
59
|
+
import { PVCClient } from "@reaatech/prompt-version-control";
|
|
60
|
+
|
|
61
|
+
const client = new PVCClient({ apiKey: "pvc_...", baseUrl: "..." });
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
#### Constructor
|
|
65
|
+
|
|
66
|
+
```typescript
|
|
67
|
+
new PromptVersionControlClient(options: PVCClientOptions)
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### `PVCClientOptions`
|
|
71
|
+
|
|
72
|
+
| Property | Type | Default | Description |
|
|
73
|
+
|----------|------|---------|-------------|
|
|
74
|
+
| `apiKey` | `string` | (required) | API key for Bearer authentication |
|
|
75
|
+
| `baseUrl` | `string` | `"http://localhost:3000"` | API server base URL |
|
|
76
|
+
| `retries` | `number` | `3` | Max retry attempts on 5xx / network errors |
|
|
77
|
+
| `retryDelay` | `number` | `1000` | Base delay in ms for exponential backoff |
|
|
78
|
+
| `timeoutMs` | `number` | `30000` | Per-request timeout in ms |
|
|
79
|
+
| `cache` | `boolean` | `false` | Enable in-memory response caching |
|
|
80
|
+
| `cacheTtl` | `number` | `60000` | Cache TTL in ms |
|
|
81
|
+
| `cacheMaxEntries` | `number` | `1000` | Max entries before FIFO eviction |
|
|
82
|
+
|
|
83
|
+
### Instance Methods
|
|
84
|
+
|
|
85
|
+
| Method | Parameters | Returns | Description |
|
|
86
|
+
|--------|------------|---------|-------------|
|
|
87
|
+
| `getPrompt` | `id: string` | `Promise<{ id, name, template }>` | Retrieve a prompt by ID |
|
|
88
|
+
| `listPrompts` | — | `Promise<{ data: Array<{ id, name }> }>` | List all prompts |
|
|
89
|
+
| `getProduction` | `promptId: string` | `Promise<{ id, number, content, template, variables, metadata }>` | Get the production-tagged version of a prompt |
|
|
90
|
+
|
|
91
|
+
## Usage Patterns
|
|
92
|
+
|
|
93
|
+
### Retry with Backoff
|
|
94
|
+
|
|
95
|
+
```typescript
|
|
96
|
+
const client = new PromptVersionControlClient({
|
|
97
|
+
apiKey: "pvc_...",
|
|
98
|
+
retries: 5, // up to 5 retries
|
|
99
|
+
retryDelay: 500, // 500ms base → 500, 1000, 2000, 4000, 8000ms
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
// Transient network errors and 5xx are automatically retried
|
|
103
|
+
// 4xx errors are thrown immediately
|
|
104
|
+
const prompt = await client.getPrompt("prompt-id");
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
### Caching
|
|
108
|
+
|
|
109
|
+
```typescript
|
|
110
|
+
const client = new PromptVersionControlClient({
|
|
111
|
+
apiKey: "pvc_...",
|
|
112
|
+
cache: true,
|
|
113
|
+
cacheTtl: 120_000, // cache entries for 2 minutes
|
|
114
|
+
cacheMaxEntries: 500, // evict oldest when > 500 entries
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
// First call hits the API
|
|
118
|
+
const prod1 = await client.getProduction("my-prompt");
|
|
119
|
+
|
|
120
|
+
// Subsequent calls within TTL return cached result
|
|
121
|
+
const prod2 = await client.getProduction("my-prompt");
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
### Custom Timeout
|
|
125
|
+
|
|
126
|
+
```typescript
|
|
127
|
+
const client = new PromptVersionControlClient({
|
|
128
|
+
apiKey: "pvc_...",
|
|
129
|
+
timeoutMs: 5000, // fail fast — 5 second timeout
|
|
130
|
+
});
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
### Using the Alias
|
|
134
|
+
|
|
135
|
+
```typescript
|
|
136
|
+
import { PVCClient } from "@reaatech/prompt-version-control";
|
|
137
|
+
|
|
138
|
+
const client = new PVCClient({ apiKey: "pvc_..." });
|
|
139
|
+
const prompt = await client.getPrompt("prompt-id");
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
## Error Handling
|
|
143
|
+
|
|
144
|
+
The SDK uses raw `fetch` under the hood. On failure:
|
|
145
|
+
|
|
146
|
+
- **5xx and network errors** — retried with exponential backoff + jitter, up to `retries` attempts
|
|
147
|
+
- **4xx errors** — thrown immediately as `Error` with the response status and body
|
|
148
|
+
- **Timeout** — thrown as `Error` with message `"Request timed out"`
|
|
149
|
+
|
|
150
|
+
```typescript
|
|
151
|
+
try {
|
|
152
|
+
const prompt = await client.getPrompt("nonexistent-id");
|
|
153
|
+
} catch (err) {
|
|
154
|
+
// err.message will contain the HTTP status and response body
|
|
155
|
+
console.error(err.message);
|
|
156
|
+
}
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
## Related Packages
|
|
160
|
+
|
|
161
|
+
- [`@reaatech/prompt-version-control-shared`](https://www.npmjs.com/package/@reaatech/prompt-version-control-shared) — Shared types and utilities
|
|
162
|
+
- [`@reaatech/prompt-version-control-server`](https://www.npmjs.com/package/@reaatech/prompt-version-control-server) — API server this client talks to
|
|
163
|
+
- [`@reaatech/prompt-version-control-cli`](https://www.npmjs.com/package/@reaatech/prompt-version-control-cli) — CLI tool (uses this SDK)
|
|
164
|
+
- [`@reaatech/prompt-version-control-mcp`](https://www.npmjs.com/package/@reaatech/prompt-version-control-mcp) — MCP server (uses this SDK)
|
|
165
|
+
|
|
166
|
+
## License
|
|
167
|
+
|
|
168
|
+
[MIT](https://github.com/reaatech/prompt-version-control/blob/main/LICENSE)
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
export interface PVCClientOptions {
|
|
2
|
+
apiKey: string;
|
|
3
|
+
baseUrl?: string;
|
|
4
|
+
retries?: number;
|
|
5
|
+
retryDelay?: number;
|
|
6
|
+
timeoutMs?: number;
|
|
7
|
+
cache?: boolean;
|
|
8
|
+
cacheTtl?: number;
|
|
9
|
+
cacheMaxEntries?: number;
|
|
10
|
+
}
|
|
11
|
+
export declare class PromptVersionControlClient {
|
|
12
|
+
private apiKey;
|
|
13
|
+
private baseUrl;
|
|
14
|
+
private retries;
|
|
15
|
+
private retryDelay;
|
|
16
|
+
private timeoutMs;
|
|
17
|
+
private cache;
|
|
18
|
+
private cacheEnabled;
|
|
19
|
+
private cacheTtl;
|
|
20
|
+
private cacheMaxEntries;
|
|
21
|
+
constructor(options: PVCClientOptions);
|
|
22
|
+
private cacheKey;
|
|
23
|
+
private getCached;
|
|
24
|
+
private setCached;
|
|
25
|
+
private fetchWithRetry;
|
|
26
|
+
getPrompt(id: string): Promise<{
|
|
27
|
+
id: string;
|
|
28
|
+
name: string;
|
|
29
|
+
template: string;
|
|
30
|
+
}>;
|
|
31
|
+
listPrompts(): Promise<{
|
|
32
|
+
data: Array<{
|
|
33
|
+
id: string;
|
|
34
|
+
name: string;
|
|
35
|
+
}>;
|
|
36
|
+
}>;
|
|
37
|
+
getProduction(promptId: string): Promise<{
|
|
38
|
+
id: string;
|
|
39
|
+
number: number;
|
|
40
|
+
content: string;
|
|
41
|
+
template: string;
|
|
42
|
+
variables: Record<string, unknown>;
|
|
43
|
+
metadata: Record<string, unknown> | null;
|
|
44
|
+
}>;
|
|
45
|
+
}
|
|
46
|
+
export { PromptVersionControlClient as PVCClient };
|
|
47
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAiBD,qBAAa,0BAA0B;IACrC,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,SAAS,CAAS;IAC1B,OAAO,CAAC,KAAK,CAAmC;IAChD,OAAO,CAAC,YAAY,CAAU;IAC9B,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,eAAe,CAAS;gBAEpB,OAAO,EAAE,gBAAgB;IAYrC,OAAO,CAAC,QAAQ;IAIhB,OAAO,CAAC,SAAS;IAWjB,OAAO,CAAC,SAAS;YAaH,cAAc;IA2CtB,SAAS,CAAC,EAAE,EAAE,MAAM;YACS,MAAM;cAAQ,MAAM;kBAAY,MAAM;;IAKnE,WAAW;cACoB,KAAK,CAAC;YAAE,EAAE,EAAE,MAAM,CAAC;YAAC,IAAI,EAAE,MAAM,CAAA;SAAE,CAAC;;IAGlE,aAAa,CAAC,QAAQ,EAAE,MAAM;YAE5B,MAAM;gBACF,MAAM;iBACL,MAAM;kBACL,MAAM;mBACL,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;kBACxB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;;CAG7C;AAED,OAAO,EAAE,0BAA0B,IAAI,SAAS,EAAE,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { sleep } from '@reaatech/prompt-version-control-shared';
|
|
2
|
+
class HttpError extends Error {
|
|
3
|
+
status;
|
|
4
|
+
constructor(status, message) {
|
|
5
|
+
super(message);
|
|
6
|
+
this.status = status;
|
|
7
|
+
this.name = 'HttpError';
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
export class PromptVersionControlClient {
|
|
11
|
+
apiKey;
|
|
12
|
+
baseUrl;
|
|
13
|
+
retries;
|
|
14
|
+
retryDelay;
|
|
15
|
+
timeoutMs;
|
|
16
|
+
cache;
|
|
17
|
+
cacheEnabled;
|
|
18
|
+
cacheTtl;
|
|
19
|
+
cacheMaxEntries;
|
|
20
|
+
constructor(options) {
|
|
21
|
+
this.apiKey = options.apiKey;
|
|
22
|
+
this.baseUrl = options.baseUrl ?? 'http://localhost:3000';
|
|
23
|
+
this.retries = options.retries ?? 3;
|
|
24
|
+
this.retryDelay = options.retryDelay ?? 1000;
|
|
25
|
+
this.timeoutMs = options.timeoutMs ?? 30_000;
|
|
26
|
+
this.cacheEnabled = options.cache ?? false;
|
|
27
|
+
this.cacheTtl = options.cacheTtl ?? 60_000;
|
|
28
|
+
this.cacheMaxEntries = options.cacheMaxEntries ?? 1000;
|
|
29
|
+
this.cache = new Map();
|
|
30
|
+
}
|
|
31
|
+
cacheKey(path) {
|
|
32
|
+
return `${this.baseUrl}${path}`;
|
|
33
|
+
}
|
|
34
|
+
getCached(path) {
|
|
35
|
+
if (!this.cacheEnabled)
|
|
36
|
+
return undefined;
|
|
37
|
+
const key = this.cacheKey(path);
|
|
38
|
+
const entry = this.cache.get(key);
|
|
39
|
+
if (entry && entry.expiresAt > Date.now()) {
|
|
40
|
+
return entry.data;
|
|
41
|
+
}
|
|
42
|
+
if (entry)
|
|
43
|
+
this.cache.delete(key);
|
|
44
|
+
return undefined;
|
|
45
|
+
}
|
|
46
|
+
setCached(path, data) {
|
|
47
|
+
if (!this.cacheEnabled)
|
|
48
|
+
return;
|
|
49
|
+
if (this.cache.size >= this.cacheMaxEntries) {
|
|
50
|
+
// Simple FIFO eviction — drop the oldest entry.
|
|
51
|
+
const oldestKey = this.cache.keys().next().value;
|
|
52
|
+
if (oldestKey !== undefined)
|
|
53
|
+
this.cache.delete(oldestKey);
|
|
54
|
+
}
|
|
55
|
+
this.cache.set(this.cacheKey(path), {
|
|
56
|
+
data,
|
|
57
|
+
expiresAt: Date.now() + this.cacheTtl,
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
async fetchWithRetry(path, init) {
|
|
61
|
+
const cached = this.getCached(path);
|
|
62
|
+
if (cached !== undefined)
|
|
63
|
+
return cached;
|
|
64
|
+
let lastError;
|
|
65
|
+
for (let attempt = 0; attempt < this.retries; attempt++) {
|
|
66
|
+
try {
|
|
67
|
+
const res = await fetch(`${this.baseUrl}${path}`, {
|
|
68
|
+
...init,
|
|
69
|
+
headers: {
|
|
70
|
+
Authorization: `Bearer ${this.apiKey}`,
|
|
71
|
+
'Content-Type': 'application/json',
|
|
72
|
+
...init?.headers,
|
|
73
|
+
},
|
|
74
|
+
signal: AbortSignal.timeout(this.timeoutMs),
|
|
75
|
+
});
|
|
76
|
+
if (!res.ok) {
|
|
77
|
+
const body = (await res.json().catch(() => ({})));
|
|
78
|
+
throw new HttpError(res.status, body.error?.message || `HTTP ${res.status}`);
|
|
79
|
+
}
|
|
80
|
+
const data = (await res.json());
|
|
81
|
+
this.setCached(path, data);
|
|
82
|
+
return data;
|
|
83
|
+
}
|
|
84
|
+
catch (err) {
|
|
85
|
+
lastError = err;
|
|
86
|
+
// Only retry on network errors and 5xx; client errors will not become
|
|
87
|
+
// success on retry, and rate limits should be respected by the caller.
|
|
88
|
+
const retriable = !(err instanceof HttpError) || (err.status >= 500 && err.status < 600);
|
|
89
|
+
if (!retriable)
|
|
90
|
+
throw err;
|
|
91
|
+
if (attempt < this.retries - 1) {
|
|
92
|
+
await sleep(this.retryDelay * (attempt + 1));
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
throw lastError;
|
|
97
|
+
}
|
|
98
|
+
async getPrompt(id) {
|
|
99
|
+
return this.fetchWithRetry(`/api/v1/prompts/${id}`);
|
|
100
|
+
}
|
|
101
|
+
async listPrompts() {
|
|
102
|
+
return this.fetchWithRetry('/api/v1/prompts');
|
|
103
|
+
}
|
|
104
|
+
async getProduction(promptId) {
|
|
105
|
+
return this.fetchWithRetry(`/api/v1/prompts/${promptId}/production`);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
export { PromptVersionControlClient as PVCClient };
|
|
109
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,yCAAyC,CAAC;AAkBhE,MAAM,SAAU,SAAQ,KAAK;IAElB;IADT,YACS,MAAc,EACrB,OAAe;QAEf,KAAK,CAAC,OAAO,CAAC,CAAC;QAHR,WAAM,GAAN,MAAM,CAAQ;QAIrB,IAAI,CAAC,IAAI,GAAG,WAAW,CAAC;IAC1B,CAAC;CACF;AAED,MAAM,OAAO,0BAA0B;IAC7B,MAAM,CAAS;IACf,OAAO,CAAS;IAChB,OAAO,CAAS;IAChB,UAAU,CAAS;IACnB,SAAS,CAAS;IAClB,KAAK,CAAmC;IACxC,YAAY,CAAU;IACtB,QAAQ,CAAS;IACjB,eAAe,CAAS;IAEhC,YAAY,OAAyB;QACnC,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;QAC7B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,IAAI,uBAAuB,CAAC;QAC1D,IAAI,CAAC,OAAO,GA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
|
1
|
+
{
|
|
2
|
+
"name": "@reaatech/prompt-version-control",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Prompt Version Control TypeScript SDK",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": "Rick Somers <rick@reaatech.com> (https://reaatech.com)",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "https://github.com/reaatech/prompt-version-control.git",
|
|
10
|
+
"directory": "packages/sdk"
|
|
11
|
+
},
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/reaatech/prompt-version-control/issues"
|
|
14
|
+
},
|
|
15
|
+
"homepage": "https://github.com/reaatech/prompt-version-control/tree/main/packages/sdk#readme",
|
|
16
|
+
"keywords": [
|
|
17
|
+
"prompt",
|
|
18
|
+
"version-control",
|
|
19
|
+
"sdk",
|
|
20
|
+
"typescript"
|
|
21
|
+
],
|
|
22
|
+
"type": "module",
|
|
23
|
+
"sideEffects": false,
|
|
24
|
+
"engines": {
|
|
25
|
+
"node": ">=22"
|
|
26
|
+
},
|
|
27
|
+
"main": "./dist/index.js",
|
|
28
|
+
"types": "./dist/index.d.ts",
|
|
29
|
+
"exports": {
|
|
30
|
+
".": {
|
|
31
|
+
"types": "./dist/index.d.ts",
|
|
32
|
+
"import": "./dist/index.js"
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
"files": [
|
|
36
|
+
"dist",
|
|
37
|
+
"CHANGELOG.md"
|
|
38
|
+
],
|
|
39
|
+
"publishConfig": {
|
|
40
|
+
"access": "public"
|
|
41
|
+
},
|
|
42
|
+
"dependencies": {
|
|
43
|
+
"@reaatech/prompt-version-control-shared": "0.1.0"
|
|
44
|
+
},
|
|
45
|
+
"peerDependencies": {
|
|
46
|
+
"zod": "^3.23.0"
|
|
47
|
+
},
|
|
48
|
+
"devDependencies": {
|
|
49
|
+
"@types/node": "^25.8.0",
|
|
50
|
+
"typescript": "^5.8.3",
|
|
51
|
+
"vitest": "^3.1.1",
|
|
52
|
+
"zod": "^3.23.0"
|
|
53
|
+
},
|
|
54
|
+
"scripts": {
|
|
55
|
+
"build": "tsc",
|
|
56
|
+
"dev": "tsc --watch",
|
|
57
|
+
"test": "vitest run",
|
|
58
|
+
"test:coverage": "vitest run --coverage",
|
|
59
|
+
"clean": "rm -rf dist coverage .turbo *.tsbuildinfo"
|
|
60
|
+
}
|
|
61
|
+
}
|