@alexrockshouts/miri-sdk 1.0.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/README.md +75 -0
- package/dist/generated/api.d.ts +1696 -0
- package/dist/generated/api.js +2669 -0
- package/dist/generated/base.d.ts +42 -0
- package/dist/generated/base.js +44 -0
- package/dist/generated/common.d.ts +34 -0
- package/dist/generated/common.js +110 -0
- package/dist/generated/configuration.d.ts +98 -0
- package/dist/generated/configuration.js +94 -0
- package/dist/generated/index.d.ts +13 -0
- package/dist/generated/index.js +15 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/miri-sdk.d.ts +302 -0
- package/dist/miri-sdk.js +336 -0
- package/package.json +31 -0
package/README.md
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
# Miri TypeScript SDK
|
|
2
|
+
|
|
3
|
+
This is the official TypeScript SDK for the Miri Autonomous Agent.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @miri/sdk
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
import { Api } from "@miri/sdk";
|
|
15
|
+
|
|
16
|
+
const api = new Api({
|
|
17
|
+
baseURL: "http://localhost:8080",
|
|
18
|
+
headers: {
|
|
19
|
+
"X-Server-Key": "your-secret-key"
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
// Example: Send a prompt
|
|
24
|
+
api.api.v1PromptCreate({
|
|
25
|
+
prompt: "Hello, Miri!"
|
|
26
|
+
}).then(response => {
|
|
27
|
+
console.log(response.data.response);
|
|
28
|
+
});
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Authentication
|
|
32
|
+
Miri uses two types of authentication:
|
|
33
|
+
1. **Server Key Authentication**: Standard API endpoints (`/api/v1/*`) require the `X-Server-Key` header.
|
|
34
|
+
2. **Basic Authentication**: Administrative endpoints (`/api/admin/v1/*`) require HTTP Basic Auth.
|
|
35
|
+
|
|
36
|
+
Default admin credentials:
|
|
37
|
+
- **Username**: `admin`
|
|
38
|
+
- **Password**: `admin-password`
|
|
39
|
+
|
|
40
|
+
### Example: Administrative Access
|
|
41
|
+
```typescript
|
|
42
|
+
import { Api } from "@miri/sdk";
|
|
43
|
+
|
|
44
|
+
const api = new Api({
|
|
45
|
+
baseURL: "http://localhost:8080",
|
|
46
|
+
// Standard auth
|
|
47
|
+
headers: {
|
|
48
|
+
"X-Server-Key": "your-secret-key"
|
|
49
|
+
},
|
|
50
|
+
// Admin auth (Basic)
|
|
51
|
+
auth: {
|
|
52
|
+
username: "admin",
|
|
53
|
+
password: "admin-password"
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
// Get configuration
|
|
58
|
+
api.api.adminV1ConfigList().then(response => {
|
|
59
|
+
console.log(response.data);
|
|
60
|
+
});
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## Features
|
|
64
|
+
|
|
65
|
+
- Full support for standard and administrative API endpoints.
|
|
66
|
+
- Axios-based HTTP client.
|
|
67
|
+
- Complete TypeScript type definitions.
|
|
68
|
+
|
|
69
|
+
## Publishing to NPM
|
|
70
|
+
|
|
71
|
+
To publish a new version of this SDK:
|
|
72
|
+
|
|
73
|
+
1. Update the version in `package.json`.
|
|
74
|
+
2. Login to NPM: `npm login`.
|
|
75
|
+
3. Publish: `npm publish --access public`.
|