@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 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`.