@burtson-labs/bandit-types 1.0.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.
- package/README.md +66 -0
- package/dist/index.d.mts +173 -0
- package/dist/index.d.ts +173 -0
- package/dist/index.js +18 -0
- package/dist/index.mjs +0 -0
- package/package.json +44 -0
package/README.md
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
<a href="https://burtson.ai">
|
|
2
|
+
<picture>
|
|
3
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://cdn.burtson.ai/logos/burtson-labs-logo-alt.png" />
|
|
4
|
+
<source media="(prefers-color-scheme: light)" srcset="https://cdn.burtson.ai/logos/burtson-labs-logo.png" />
|
|
5
|
+
<img src="https://cdn.burtson.ai/logos/burtson-labs-logo.png" alt="Burtson Labs Logo" width="120" />
|
|
6
|
+
</picture>
|
|
7
|
+
</a>
|
|
8
|
+
|
|
9
|
+
# @burtson-labs/bandit-types
|
|
10
|
+
|
|
11
|
+
TypeScript type definitions for the Bandit gateway contract and stored configuration interfaces. Install this package when you need to build against the Bandit API contract — implementing a custom gateway, writing server-side integrations, or typing responses — without pulling in the full React engine.
|
|
12
|
+
|
|
13
|
+
[](./LICENSE)
|
|
14
|
+
|
|
15
|
+
## Install
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
npm install --save-dev @burtson-labs/bandit-types
|
|
19
|
+
# or for runtime use
|
|
20
|
+
npm install @burtson-labs/bandit-types
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Gateway contract types
|
|
24
|
+
|
|
25
|
+
Use these when implementing a custom gateway that the engine will call:
|
|
26
|
+
|
|
27
|
+
```ts
|
|
28
|
+
import type {
|
|
29
|
+
GatewayChatRequest,
|
|
30
|
+
GatewayChatResponse,
|
|
31
|
+
GatewayGenerateRequest,
|
|
32
|
+
GatewayGenerateResponse,
|
|
33
|
+
GatewayHealthResponse,
|
|
34
|
+
GatewayMessage,
|
|
35
|
+
GatewayTool,
|
|
36
|
+
GatewayToolCall,
|
|
37
|
+
GatewayModel,
|
|
38
|
+
GatewayModelsResponse,
|
|
39
|
+
GatewayMemoryRecord,
|
|
40
|
+
GatewayMemoryResponse,
|
|
41
|
+
} from '@burtson-labs/bandit-types';
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Configuration types
|
|
45
|
+
|
|
46
|
+
Use these when reading or writing Bandit stored configuration records:
|
|
47
|
+
|
|
48
|
+
```ts
|
|
49
|
+
import type {
|
|
50
|
+
StoredBrandingConfig,
|
|
51
|
+
StoredModelConfig,
|
|
52
|
+
StoredBanditConfigRecord,
|
|
53
|
+
} from '@burtson-labs/bandit-types';
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## No runtime dependencies
|
|
57
|
+
|
|
58
|
+
This package is type-only. It has zero runtime dependencies and zero peer dependencies. It compiles to empty JS with full `.d.ts` output.
|
|
59
|
+
|
|
60
|
+
## Part of the Bandit ecosystem
|
|
61
|
+
|
|
62
|
+
- [`@burtson-labs/bandit-engine`](https://www.npmjs.com/package/@burtson-labs/bandit-engine) — React chat components and AI provider SDK
|
|
63
|
+
- [`@burtson-labs/bandit-cli`](https://banditailabs.com/npm-package) — Quickstart scaffolding CLI
|
|
64
|
+
- [`@burtson-labs/bandit-themes`](https://banditailabs.com/npm-package) — MUI theme pack
|
|
65
|
+
|
|
66
|
+
Full docs: [banditailabs.com/npm-package](https://banditailabs.com/npm-package)
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
interface GatewayMessageContent {
|
|
2
|
+
type: 'text' | 'image_url';
|
|
3
|
+
text?: string;
|
|
4
|
+
image_url?: {
|
|
5
|
+
url: string;
|
|
6
|
+
detail?: 'low' | 'high' | 'auto';
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
interface GatewayMessage {
|
|
10
|
+
role: 'system' | 'user' | 'assistant';
|
|
11
|
+
content: string | GatewayMessageContent[];
|
|
12
|
+
name?: string;
|
|
13
|
+
images?: string[];
|
|
14
|
+
}
|
|
15
|
+
interface GatewayTool {
|
|
16
|
+
type: 'function';
|
|
17
|
+
function: {
|
|
18
|
+
name: string;
|
|
19
|
+
description?: string;
|
|
20
|
+
parameters?: {
|
|
21
|
+
type: string;
|
|
22
|
+
properties?: Record<string, unknown>;
|
|
23
|
+
required?: string[];
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
interface GatewayChatRequest {
|
|
28
|
+
model: string;
|
|
29
|
+
messages: GatewayMessage[];
|
|
30
|
+
stream?: boolean;
|
|
31
|
+
temperature?: number;
|
|
32
|
+
max_tokens?: number;
|
|
33
|
+
top_p?: number;
|
|
34
|
+
frequency_penalty?: number;
|
|
35
|
+
presence_penalty?: number;
|
|
36
|
+
provider?: 'openai' | 'azure-openai' | 'anthropic' | 'ollama' | 'xai' | 'bandit' | 'playground';
|
|
37
|
+
stop?: string | string[];
|
|
38
|
+
images?: string[];
|
|
39
|
+
tools?: GatewayTool[];
|
|
40
|
+
}
|
|
41
|
+
interface GatewayToolCall {
|
|
42
|
+
id?: string;
|
|
43
|
+
type?: 'function';
|
|
44
|
+
function: {
|
|
45
|
+
name: string;
|
|
46
|
+
arguments: string | Record<string, unknown>;
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
interface GatewayChatResponse {
|
|
50
|
+
id: string;
|
|
51
|
+
object: string;
|
|
52
|
+
created: number;
|
|
53
|
+
model: string;
|
|
54
|
+
choices: {
|
|
55
|
+
index: number;
|
|
56
|
+
delta?: {
|
|
57
|
+
role?: string;
|
|
58
|
+
content?: string;
|
|
59
|
+
tool_calls?: GatewayToolCall[];
|
|
60
|
+
};
|
|
61
|
+
message?: {
|
|
62
|
+
role: string;
|
|
63
|
+
content: string;
|
|
64
|
+
tool_calls?: GatewayToolCall[];
|
|
65
|
+
};
|
|
66
|
+
finish_reason?: string | null;
|
|
67
|
+
}[];
|
|
68
|
+
usage?: {
|
|
69
|
+
prompt_tokens: number;
|
|
70
|
+
completion_tokens: number;
|
|
71
|
+
total_tokens: number;
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
interface GatewayGenerateRequest {
|
|
75
|
+
model: string;
|
|
76
|
+
prompt: string;
|
|
77
|
+
stream?: boolean;
|
|
78
|
+
temperature?: number;
|
|
79
|
+
max_tokens?: number;
|
|
80
|
+
provider?: 'openai' | 'azure-openai' | 'anthropic' | 'ollama' | 'xai' | 'bandit' | 'playground';
|
|
81
|
+
stop?: string | string[];
|
|
82
|
+
}
|
|
83
|
+
interface GatewayGenerateResponse {
|
|
84
|
+
model: string;
|
|
85
|
+
created_at: string;
|
|
86
|
+
response: string;
|
|
87
|
+
done: boolean;
|
|
88
|
+
context?: number[];
|
|
89
|
+
total_duration?: number;
|
|
90
|
+
load_duration?: number;
|
|
91
|
+
prompt_eval_count?: number;
|
|
92
|
+
prompt_eval_duration?: number;
|
|
93
|
+
eval_count?: number;
|
|
94
|
+
eval_duration?: number;
|
|
95
|
+
}
|
|
96
|
+
interface GatewayModel {
|
|
97
|
+
id: string;
|
|
98
|
+
name: string;
|
|
99
|
+
provider: string;
|
|
100
|
+
created: number;
|
|
101
|
+
modified_at: string;
|
|
102
|
+
size: number;
|
|
103
|
+
digest: string;
|
|
104
|
+
details?: {
|
|
105
|
+
format: string;
|
|
106
|
+
family: string;
|
|
107
|
+
families: string[];
|
|
108
|
+
parameter_size: string;
|
|
109
|
+
quantization_level: string;
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
interface GatewayModelsResponse {
|
|
113
|
+
models: GatewayModel[];
|
|
114
|
+
}
|
|
115
|
+
interface GatewayHealthResponse {
|
|
116
|
+
status: 'healthy' | 'unhealthy';
|
|
117
|
+
version: string;
|
|
118
|
+
providers: {
|
|
119
|
+
name: string;
|
|
120
|
+
status: 'available' | 'unavailable';
|
|
121
|
+
models_count: number;
|
|
122
|
+
}[];
|
|
123
|
+
uptime: number;
|
|
124
|
+
}
|
|
125
|
+
interface GatewayMemoryRecord {
|
|
126
|
+
id: string;
|
|
127
|
+
type: string;
|
|
128
|
+
content: string;
|
|
129
|
+
createdAt: string;
|
|
130
|
+
updatedAt: string;
|
|
131
|
+
metadata?: Record<string, unknown>;
|
|
132
|
+
}
|
|
133
|
+
interface GatewayMemoryResponse {
|
|
134
|
+
records: GatewayMemoryRecord[];
|
|
135
|
+
total: number;
|
|
136
|
+
nextCursor?: string | null;
|
|
137
|
+
}
|
|
138
|
+
interface GatewayContract {
|
|
139
|
+
chat(request: GatewayChatRequest): Promise<GatewayChatResponse>;
|
|
140
|
+
generate(request: GatewayGenerateRequest): Promise<GatewayGenerateResponse>;
|
|
141
|
+
health(): Promise<GatewayHealthResponse>;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
interface StoredBrandingConfig {
|
|
145
|
+
brandingText?: string;
|
|
146
|
+
logoBase64?: string | null;
|
|
147
|
+
theme?: string;
|
|
148
|
+
hasTransparentLogo?: boolean;
|
|
149
|
+
userSaved?: boolean;
|
|
150
|
+
[key: string]: unknown;
|
|
151
|
+
}
|
|
152
|
+
interface StoredModelConfig {
|
|
153
|
+
name?: string;
|
|
154
|
+
tagline?: string;
|
|
155
|
+
systemPrompt?: string;
|
|
156
|
+
selectedModel?: string;
|
|
157
|
+
avatarBase64?: string | null;
|
|
158
|
+
[key: string]: unknown;
|
|
159
|
+
}
|
|
160
|
+
interface StoredBanditConfigRecord {
|
|
161
|
+
id: string;
|
|
162
|
+
branding?: StoredBrandingConfig;
|
|
163
|
+
model?: StoredModelConfig;
|
|
164
|
+
name?: string;
|
|
165
|
+
tagline?: string;
|
|
166
|
+
systemPrompt?: string;
|
|
167
|
+
selectedModel?: string;
|
|
168
|
+
avatarBase64?: string;
|
|
169
|
+
commands?: unknown;
|
|
170
|
+
[key: string]: unknown;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
export type { GatewayChatRequest, GatewayChatResponse, GatewayContract, GatewayGenerateRequest, GatewayGenerateResponse, GatewayHealthResponse, GatewayMemoryRecord, GatewayMemoryResponse, GatewayMessage, GatewayMessageContent, GatewayModel, GatewayModelsResponse, GatewayTool, GatewayToolCall, StoredBanditConfigRecord, StoredBrandingConfig, StoredModelConfig };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
interface GatewayMessageContent {
|
|
2
|
+
type: 'text' | 'image_url';
|
|
3
|
+
text?: string;
|
|
4
|
+
image_url?: {
|
|
5
|
+
url: string;
|
|
6
|
+
detail?: 'low' | 'high' | 'auto';
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
interface GatewayMessage {
|
|
10
|
+
role: 'system' | 'user' | 'assistant';
|
|
11
|
+
content: string | GatewayMessageContent[];
|
|
12
|
+
name?: string;
|
|
13
|
+
images?: string[];
|
|
14
|
+
}
|
|
15
|
+
interface GatewayTool {
|
|
16
|
+
type: 'function';
|
|
17
|
+
function: {
|
|
18
|
+
name: string;
|
|
19
|
+
description?: string;
|
|
20
|
+
parameters?: {
|
|
21
|
+
type: string;
|
|
22
|
+
properties?: Record<string, unknown>;
|
|
23
|
+
required?: string[];
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
interface GatewayChatRequest {
|
|
28
|
+
model: string;
|
|
29
|
+
messages: GatewayMessage[];
|
|
30
|
+
stream?: boolean;
|
|
31
|
+
temperature?: number;
|
|
32
|
+
max_tokens?: number;
|
|
33
|
+
top_p?: number;
|
|
34
|
+
frequency_penalty?: number;
|
|
35
|
+
presence_penalty?: number;
|
|
36
|
+
provider?: 'openai' | 'azure-openai' | 'anthropic' | 'ollama' | 'xai' | 'bandit' | 'playground';
|
|
37
|
+
stop?: string | string[];
|
|
38
|
+
images?: string[];
|
|
39
|
+
tools?: GatewayTool[];
|
|
40
|
+
}
|
|
41
|
+
interface GatewayToolCall {
|
|
42
|
+
id?: string;
|
|
43
|
+
type?: 'function';
|
|
44
|
+
function: {
|
|
45
|
+
name: string;
|
|
46
|
+
arguments: string | Record<string, unknown>;
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
interface GatewayChatResponse {
|
|
50
|
+
id: string;
|
|
51
|
+
object: string;
|
|
52
|
+
created: number;
|
|
53
|
+
model: string;
|
|
54
|
+
choices: {
|
|
55
|
+
index: number;
|
|
56
|
+
delta?: {
|
|
57
|
+
role?: string;
|
|
58
|
+
content?: string;
|
|
59
|
+
tool_calls?: GatewayToolCall[];
|
|
60
|
+
};
|
|
61
|
+
message?: {
|
|
62
|
+
role: string;
|
|
63
|
+
content: string;
|
|
64
|
+
tool_calls?: GatewayToolCall[];
|
|
65
|
+
};
|
|
66
|
+
finish_reason?: string | null;
|
|
67
|
+
}[];
|
|
68
|
+
usage?: {
|
|
69
|
+
prompt_tokens: number;
|
|
70
|
+
completion_tokens: number;
|
|
71
|
+
total_tokens: number;
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
interface GatewayGenerateRequest {
|
|
75
|
+
model: string;
|
|
76
|
+
prompt: string;
|
|
77
|
+
stream?: boolean;
|
|
78
|
+
temperature?: number;
|
|
79
|
+
max_tokens?: number;
|
|
80
|
+
provider?: 'openai' | 'azure-openai' | 'anthropic' | 'ollama' | 'xai' | 'bandit' | 'playground';
|
|
81
|
+
stop?: string | string[];
|
|
82
|
+
}
|
|
83
|
+
interface GatewayGenerateResponse {
|
|
84
|
+
model: string;
|
|
85
|
+
created_at: string;
|
|
86
|
+
response: string;
|
|
87
|
+
done: boolean;
|
|
88
|
+
context?: number[];
|
|
89
|
+
total_duration?: number;
|
|
90
|
+
load_duration?: number;
|
|
91
|
+
prompt_eval_count?: number;
|
|
92
|
+
prompt_eval_duration?: number;
|
|
93
|
+
eval_count?: number;
|
|
94
|
+
eval_duration?: number;
|
|
95
|
+
}
|
|
96
|
+
interface GatewayModel {
|
|
97
|
+
id: string;
|
|
98
|
+
name: string;
|
|
99
|
+
provider: string;
|
|
100
|
+
created: number;
|
|
101
|
+
modified_at: string;
|
|
102
|
+
size: number;
|
|
103
|
+
digest: string;
|
|
104
|
+
details?: {
|
|
105
|
+
format: string;
|
|
106
|
+
family: string;
|
|
107
|
+
families: string[];
|
|
108
|
+
parameter_size: string;
|
|
109
|
+
quantization_level: string;
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
interface GatewayModelsResponse {
|
|
113
|
+
models: GatewayModel[];
|
|
114
|
+
}
|
|
115
|
+
interface GatewayHealthResponse {
|
|
116
|
+
status: 'healthy' | 'unhealthy';
|
|
117
|
+
version: string;
|
|
118
|
+
providers: {
|
|
119
|
+
name: string;
|
|
120
|
+
status: 'available' | 'unavailable';
|
|
121
|
+
models_count: number;
|
|
122
|
+
}[];
|
|
123
|
+
uptime: number;
|
|
124
|
+
}
|
|
125
|
+
interface GatewayMemoryRecord {
|
|
126
|
+
id: string;
|
|
127
|
+
type: string;
|
|
128
|
+
content: string;
|
|
129
|
+
createdAt: string;
|
|
130
|
+
updatedAt: string;
|
|
131
|
+
metadata?: Record<string, unknown>;
|
|
132
|
+
}
|
|
133
|
+
interface GatewayMemoryResponse {
|
|
134
|
+
records: GatewayMemoryRecord[];
|
|
135
|
+
total: number;
|
|
136
|
+
nextCursor?: string | null;
|
|
137
|
+
}
|
|
138
|
+
interface GatewayContract {
|
|
139
|
+
chat(request: GatewayChatRequest): Promise<GatewayChatResponse>;
|
|
140
|
+
generate(request: GatewayGenerateRequest): Promise<GatewayGenerateResponse>;
|
|
141
|
+
health(): Promise<GatewayHealthResponse>;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
interface StoredBrandingConfig {
|
|
145
|
+
brandingText?: string;
|
|
146
|
+
logoBase64?: string | null;
|
|
147
|
+
theme?: string;
|
|
148
|
+
hasTransparentLogo?: boolean;
|
|
149
|
+
userSaved?: boolean;
|
|
150
|
+
[key: string]: unknown;
|
|
151
|
+
}
|
|
152
|
+
interface StoredModelConfig {
|
|
153
|
+
name?: string;
|
|
154
|
+
tagline?: string;
|
|
155
|
+
systemPrompt?: string;
|
|
156
|
+
selectedModel?: string;
|
|
157
|
+
avatarBase64?: string | null;
|
|
158
|
+
[key: string]: unknown;
|
|
159
|
+
}
|
|
160
|
+
interface StoredBanditConfigRecord {
|
|
161
|
+
id: string;
|
|
162
|
+
branding?: StoredBrandingConfig;
|
|
163
|
+
model?: StoredModelConfig;
|
|
164
|
+
name?: string;
|
|
165
|
+
tagline?: string;
|
|
166
|
+
systemPrompt?: string;
|
|
167
|
+
selectedModel?: string;
|
|
168
|
+
avatarBase64?: string;
|
|
169
|
+
commands?: unknown;
|
|
170
|
+
[key: string]: unknown;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
export type { GatewayChatRequest, GatewayChatResponse, GatewayContract, GatewayGenerateRequest, GatewayGenerateResponse, GatewayHealthResponse, GatewayMemoryRecord, GatewayMemoryResponse, GatewayMessage, GatewayMessageContent, GatewayModel, GatewayModelsResponse, GatewayTool, GatewayToolCall, StoredBanditConfigRecord, StoredBrandingConfig, StoredModelConfig };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __copyProps = (to, from, except, desc) => {
|
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
+
for (let key of __getOwnPropNames(from))
|
|
9
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
+
|
|
16
|
+
// src/index.ts
|
|
17
|
+
var index_exports = {};
|
|
18
|
+
module.exports = __toCommonJS(index_exports);
|
package/dist/index.mjs
ADDED
|
File without changes
|
package/package.json
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@burtson-labs/bandit-types",
|
|
3
|
+
"version": "1.0.1",
|
|
4
|
+
"license": "BUSL-1.1",
|
|
5
|
+
"description": "Type definitions for Bandit gateway contracts and configuration — install without the full engine",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"module": "dist/index.mjs",
|
|
8
|
+
"types": "dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"import": "./dist/index.mjs",
|
|
13
|
+
"require": "./dist/index.js"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"dist",
|
|
18
|
+
"LICENSE",
|
|
19
|
+
"README.md"
|
|
20
|
+
],
|
|
21
|
+
"repository": {
|
|
22
|
+
"type": "git",
|
|
23
|
+
"url": "https://github.com/Burtson-Labs/bandit-engine.git"
|
|
24
|
+
},
|
|
25
|
+
"homepage": "https://banditailabs.com/npm-package",
|
|
26
|
+
"author": "Burtson Labs LLC <team@banditai.ai>",
|
|
27
|
+
"keywords": [
|
|
28
|
+
"bandit",
|
|
29
|
+
"types",
|
|
30
|
+
"typescript",
|
|
31
|
+
"gateway",
|
|
32
|
+
"ai"
|
|
33
|
+
],
|
|
34
|
+
"scripts": {
|
|
35
|
+
"build": "tsup",
|
|
36
|
+
"dev": "tsup --watch",
|
|
37
|
+
"protect": "node scripts/add-license-headers.js",
|
|
38
|
+
"validate-protection": "node scripts/validate-protection.js"
|
|
39
|
+
},
|
|
40
|
+
"devDependencies": {
|
|
41
|
+
"tsup": "^8.5.0",
|
|
42
|
+
"typescript": "5.5.4"
|
|
43
|
+
}
|
|
44
|
+
}
|