@kavachos/client 0.0.2
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/LICENSE +21 -0
- package/dist/index.d.ts +192 -0
- package/dist/index.js +243 -0
- package/package.json +34 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 KavachOS
|
|
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/dist/index.d.ts
ADDED
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
interface Permission {
|
|
2
|
+
resource: string;
|
|
3
|
+
actions: string[];
|
|
4
|
+
constraints?: PermissionConstraints;
|
|
5
|
+
}
|
|
6
|
+
interface PermissionConstraints {
|
|
7
|
+
maxCallsPerHour?: number;
|
|
8
|
+
allowedArgPatterns?: string[];
|
|
9
|
+
requireApproval?: boolean;
|
|
10
|
+
timeWindow?: {
|
|
11
|
+
start: string;
|
|
12
|
+
end: string;
|
|
13
|
+
};
|
|
14
|
+
ipAllowlist?: string[];
|
|
15
|
+
}
|
|
16
|
+
interface Agent {
|
|
17
|
+
id: string;
|
|
18
|
+
ownerId: string;
|
|
19
|
+
name: string;
|
|
20
|
+
type: "autonomous" | "delegated" | "service";
|
|
21
|
+
token: string;
|
|
22
|
+
permissions: Permission[];
|
|
23
|
+
status: "active" | "revoked" | "expired";
|
|
24
|
+
expiresAt: string | null;
|
|
25
|
+
createdAt: string;
|
|
26
|
+
updatedAt: string;
|
|
27
|
+
}
|
|
28
|
+
interface CreateAgentInput {
|
|
29
|
+
ownerId: string;
|
|
30
|
+
name: string;
|
|
31
|
+
type: "autonomous" | "delegated" | "service";
|
|
32
|
+
permissions: Permission[];
|
|
33
|
+
expiresAt?: string;
|
|
34
|
+
metadata?: Record<string, unknown>;
|
|
35
|
+
}
|
|
36
|
+
interface UpdateAgentInput {
|
|
37
|
+
name?: string;
|
|
38
|
+
permissions?: Permission[];
|
|
39
|
+
expiresAt?: string;
|
|
40
|
+
metadata?: Record<string, unknown>;
|
|
41
|
+
}
|
|
42
|
+
interface AgentFilters {
|
|
43
|
+
userId?: string;
|
|
44
|
+
status?: "active" | "revoked" | "expired";
|
|
45
|
+
type?: "autonomous" | "delegated" | "service";
|
|
46
|
+
}
|
|
47
|
+
interface AuthorizeByTokenInput {
|
|
48
|
+
action: string;
|
|
49
|
+
resource: string;
|
|
50
|
+
arguments?: Record<string, unknown>;
|
|
51
|
+
}
|
|
52
|
+
interface AuthorizeResult {
|
|
53
|
+
allowed: boolean;
|
|
54
|
+
reason?: string;
|
|
55
|
+
auditId: string;
|
|
56
|
+
}
|
|
57
|
+
interface DelegateInput {
|
|
58
|
+
fromAgent: string;
|
|
59
|
+
toAgent: string;
|
|
60
|
+
permissions: Permission[];
|
|
61
|
+
expiresAt: string;
|
|
62
|
+
maxDepth?: number;
|
|
63
|
+
}
|
|
64
|
+
interface DelegationChain {
|
|
65
|
+
id: string;
|
|
66
|
+
fromAgent: string;
|
|
67
|
+
toAgent: string;
|
|
68
|
+
permissions: Permission[];
|
|
69
|
+
expiresAt: string;
|
|
70
|
+
depth: number;
|
|
71
|
+
createdAt: string;
|
|
72
|
+
}
|
|
73
|
+
interface AuditEntry {
|
|
74
|
+
id: string;
|
|
75
|
+
agentId: string;
|
|
76
|
+
userId: string;
|
|
77
|
+
action: string;
|
|
78
|
+
resource: string;
|
|
79
|
+
parameters: Record<string, unknown>;
|
|
80
|
+
result: "allowed" | "denied" | "rate_limited";
|
|
81
|
+
reason?: string;
|
|
82
|
+
durationMs: number;
|
|
83
|
+
tokensCost?: number;
|
|
84
|
+
timestamp: string;
|
|
85
|
+
}
|
|
86
|
+
interface AuditFilters {
|
|
87
|
+
agentId?: string;
|
|
88
|
+
userId?: string;
|
|
89
|
+
since?: string;
|
|
90
|
+
until?: string;
|
|
91
|
+
actions?: string[];
|
|
92
|
+
result?: "allowed" | "denied" | "rate_limited";
|
|
93
|
+
limit?: number;
|
|
94
|
+
offset?: number;
|
|
95
|
+
}
|
|
96
|
+
interface PaginatedAuditLogs {
|
|
97
|
+
entries: AuditEntry[];
|
|
98
|
+
total?: number;
|
|
99
|
+
}
|
|
100
|
+
interface ExportOptions {
|
|
101
|
+
format: "json" | "csv";
|
|
102
|
+
since?: string;
|
|
103
|
+
until?: string;
|
|
104
|
+
}
|
|
105
|
+
interface RegisterMcpServerInput {
|
|
106
|
+
name: string;
|
|
107
|
+
endpoint: string;
|
|
108
|
+
tools: string[];
|
|
109
|
+
authRequired?: boolean;
|
|
110
|
+
rateLimit?: {
|
|
111
|
+
rpm: number;
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
interface McpServer {
|
|
115
|
+
id: string;
|
|
116
|
+
name: string;
|
|
117
|
+
endpoint: string;
|
|
118
|
+
tools: string[];
|
|
119
|
+
authRequired: boolean;
|
|
120
|
+
createdAt: string;
|
|
121
|
+
}
|
|
122
|
+
interface KavachError {
|
|
123
|
+
code: string;
|
|
124
|
+
message: string;
|
|
125
|
+
details?: Record<string, unknown>;
|
|
126
|
+
}
|
|
127
|
+
interface KavachApiErrorBody {
|
|
128
|
+
error: {
|
|
129
|
+
code: string;
|
|
130
|
+
message: string;
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
type KavachResult<T> = {
|
|
134
|
+
success: true;
|
|
135
|
+
data: T;
|
|
136
|
+
} | {
|
|
137
|
+
success: false;
|
|
138
|
+
error: KavachError;
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
interface KavachClientOptions {
|
|
142
|
+
baseUrl: string;
|
|
143
|
+
/** Bearer token sent as `Authorization: Bearer <token>` on every request. */
|
|
144
|
+
token?: string;
|
|
145
|
+
/** Additional headers merged into every request. */
|
|
146
|
+
headers?: Record<string, string>;
|
|
147
|
+
}
|
|
148
|
+
interface AuthorizeRequest {
|
|
149
|
+
action: string;
|
|
150
|
+
resource: string;
|
|
151
|
+
arguments?: Record<string, unknown>;
|
|
152
|
+
}
|
|
153
|
+
interface KavachClient {
|
|
154
|
+
agents: {
|
|
155
|
+
create: (input: CreateAgentInput) => Promise<Agent>;
|
|
156
|
+
list: (filters?: AgentFilters) => Promise<Agent[]>;
|
|
157
|
+
get: (id: string) => Promise<Agent | null>;
|
|
158
|
+
update: (id: string, input: UpdateAgentInput) => Promise<Agent>;
|
|
159
|
+
revoke: (id: string) => Promise<void>;
|
|
160
|
+
rotate: (id: string) => Promise<Agent>;
|
|
161
|
+
};
|
|
162
|
+
/** Authorize an action by agent ID. Calls POST /agents/:id/authorize. */
|
|
163
|
+
authorize: (agentId: string, request: AuthorizeRequest) => Promise<AuthorizeResult>;
|
|
164
|
+
/** Authorize an action using the agent's bearer token. Calls POST /authorize. */
|
|
165
|
+
authorizeByToken: (token: string, request: AuthorizeByTokenInput) => Promise<AuthorizeResult>;
|
|
166
|
+
delegations: {
|
|
167
|
+
create: (input: DelegateInput) => Promise<DelegationChain>;
|
|
168
|
+
list: (agentId: string) => Promise<DelegationChain[]>;
|
|
169
|
+
revoke: (id: string) => Promise<void>;
|
|
170
|
+
getEffectivePermissions: (agentId: string) => Promise<Permission[]>;
|
|
171
|
+
};
|
|
172
|
+
audit: {
|
|
173
|
+
query: (filters?: AuditFilters) => Promise<AuditEntry[]>;
|
|
174
|
+
export: (options: ExportOptions) => Promise<string>;
|
|
175
|
+
};
|
|
176
|
+
mcp: {
|
|
177
|
+
register: (input: RegisterMcpServerInput) => Promise<McpServer>;
|
|
178
|
+
list: () => Promise<McpServer[]>;
|
|
179
|
+
get: (id: string) => Promise<McpServer | null>;
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
declare function createKavachClient(options: KavachClientOptions): KavachClient;
|
|
183
|
+
|
|
184
|
+
declare class KavachApiError extends Error {
|
|
185
|
+
readonly code: string;
|
|
186
|
+
readonly status: number;
|
|
187
|
+
readonly details?: Record<string, unknown>;
|
|
188
|
+
constructor(error: KavachError, status: number);
|
|
189
|
+
toKavachError(): KavachError;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
export { type Agent, type AgentFilters, type AuditEntry, type AuditFilters, type AuthorizeByTokenInput, type AuthorizeRequest, type AuthorizeResult, type CreateAgentInput, type DelegateInput, type DelegationChain, type ExportOptions, KavachApiError, type KavachApiErrorBody, type KavachClient, type KavachClientOptions, type KavachError, type KavachResult, type McpServer, type PaginatedAuditLogs, type Permission, type PermissionConstraints, type RegisterMcpServerInput, type UpdateAgentInput, createKavachClient };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
// src/error.ts
|
|
2
|
+
var KavachApiError = class extends Error {
|
|
3
|
+
code;
|
|
4
|
+
status;
|
|
5
|
+
details;
|
|
6
|
+
constructor(error, status) {
|
|
7
|
+
super(error.message);
|
|
8
|
+
this.name = "KavachApiError";
|
|
9
|
+
this.code = error.code;
|
|
10
|
+
this.status = status;
|
|
11
|
+
this.details = error.details;
|
|
12
|
+
}
|
|
13
|
+
toKavachError() {
|
|
14
|
+
return {
|
|
15
|
+
code: this.code,
|
|
16
|
+
message: this.message,
|
|
17
|
+
details: this.details
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
// src/client.ts
|
|
23
|
+
function buildQuery(params) {
|
|
24
|
+
const parts = [];
|
|
25
|
+
for (const [key, value] of Object.entries(params)) {
|
|
26
|
+
if (value === void 0) continue;
|
|
27
|
+
if (Array.isArray(value)) {
|
|
28
|
+
if (value.length > 0) {
|
|
29
|
+
parts.push(`${key}=${encodeURIComponent(value.join(","))}`);
|
|
30
|
+
}
|
|
31
|
+
} else {
|
|
32
|
+
parts.push(`${key}=${encodeURIComponent(String(value))}`);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
return parts.length > 0 ? `?${parts.join("&")}` : "";
|
|
36
|
+
}
|
|
37
|
+
function createKavachClient(options) {
|
|
38
|
+
const base = options.baseUrl.replace(/\/$/, "");
|
|
39
|
+
function buildHeaders(overrides) {
|
|
40
|
+
const headers = {
|
|
41
|
+
"Content-Type": "application/json",
|
|
42
|
+
...options.headers
|
|
43
|
+
};
|
|
44
|
+
if (options.token) {
|
|
45
|
+
headers.Authorization = `Bearer ${options.token}`;
|
|
46
|
+
}
|
|
47
|
+
if (overrides) {
|
|
48
|
+
Object.assign(headers, overrides);
|
|
49
|
+
}
|
|
50
|
+
return headers;
|
|
51
|
+
}
|
|
52
|
+
async function doFetch(path, init = {}) {
|
|
53
|
+
const { extraHeaders, ...fetchInit } = init;
|
|
54
|
+
const headers = buildHeaders(extraHeaders);
|
|
55
|
+
let response;
|
|
56
|
+
try {
|
|
57
|
+
response = await fetch(`${base}${path}`, { ...fetchInit, headers });
|
|
58
|
+
} catch (err) {
|
|
59
|
+
const message = err instanceof Error ? err.message : "Network request failed";
|
|
60
|
+
throw new KavachApiError({ code: "NETWORK_ERROR", message }, 0);
|
|
61
|
+
}
|
|
62
|
+
if (response.status === 204) {
|
|
63
|
+
return void 0;
|
|
64
|
+
}
|
|
65
|
+
let body;
|
|
66
|
+
let parseOk = true;
|
|
67
|
+
try {
|
|
68
|
+
body = await response.json();
|
|
69
|
+
} catch {
|
|
70
|
+
parseOk = false;
|
|
71
|
+
}
|
|
72
|
+
if (!response.ok) {
|
|
73
|
+
if (parseOk && body !== null && typeof body === "object") {
|
|
74
|
+
const errBody = body;
|
|
75
|
+
const inner = typeof errBody.error === "object" && errBody.error !== null ? errBody.error : errBody;
|
|
76
|
+
const code = typeof inner.code === "string" ? inner.code : "API_ERROR";
|
|
77
|
+
const message = typeof inner.message === "string" ? inner.message : `HTTP ${response.status}`;
|
|
78
|
+
throw new KavachApiError({ code, message }, response.status);
|
|
79
|
+
}
|
|
80
|
+
throw new KavachApiError(
|
|
81
|
+
{ code: "API_ERROR", message: `HTTP ${response.status}` },
|
|
82
|
+
response.status
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
return body;
|
|
86
|
+
}
|
|
87
|
+
async function fetchJson(path, init) {
|
|
88
|
+
return doFetch(path, init);
|
|
89
|
+
}
|
|
90
|
+
async function fetchNullable(path, init) {
|
|
91
|
+
try {
|
|
92
|
+
return await fetchJson(path, init);
|
|
93
|
+
} catch (err) {
|
|
94
|
+
if (err instanceof KavachApiError && err.status === 404) {
|
|
95
|
+
return null;
|
|
96
|
+
}
|
|
97
|
+
throw err;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
async function fetchRaw(path, init) {
|
|
101
|
+
const headers = buildHeaders();
|
|
102
|
+
let response;
|
|
103
|
+
try {
|
|
104
|
+
response = await fetch(`${base}${path}`, { ...init, headers });
|
|
105
|
+
} catch (err) {
|
|
106
|
+
const message = err instanceof Error ? err.message : "Network request failed";
|
|
107
|
+
throw new KavachApiError({ code: "NETWORK_ERROR", message }, 0);
|
|
108
|
+
}
|
|
109
|
+
if (!response.ok) {
|
|
110
|
+
let body;
|
|
111
|
+
try {
|
|
112
|
+
body = await response.json();
|
|
113
|
+
} catch {
|
|
114
|
+
throw new KavachApiError(
|
|
115
|
+
{ code: "API_ERROR", message: `HTTP ${response.status}` },
|
|
116
|
+
response.status
|
|
117
|
+
);
|
|
118
|
+
}
|
|
119
|
+
const errBody = body;
|
|
120
|
+
const inner = typeof errBody.error === "object" && errBody.error !== null ? errBody.error : errBody;
|
|
121
|
+
const code = typeof inner.code === "string" ? inner.code : "API_ERROR";
|
|
122
|
+
const message = typeof inner.message === "string" ? inner.message : `HTTP ${response.status}`;
|
|
123
|
+
throw new KavachApiError({ code, message }, response.status);
|
|
124
|
+
}
|
|
125
|
+
return response.text();
|
|
126
|
+
}
|
|
127
|
+
return {
|
|
128
|
+
// ── Agents ─────────────────────────────────────────────────────────────
|
|
129
|
+
agents: {
|
|
130
|
+
create(input) {
|
|
131
|
+
return fetchJson("/agents", {
|
|
132
|
+
method: "POST",
|
|
133
|
+
body: JSON.stringify(input)
|
|
134
|
+
});
|
|
135
|
+
},
|
|
136
|
+
list(filters) {
|
|
137
|
+
const qs = filters ? buildQuery({
|
|
138
|
+
userId: filters.userId,
|
|
139
|
+
status: filters.status,
|
|
140
|
+
type: filters.type
|
|
141
|
+
}) : "";
|
|
142
|
+
return fetchJson(`/agents${qs}`);
|
|
143
|
+
},
|
|
144
|
+
get(id) {
|
|
145
|
+
return fetchNullable(`/agents/${encodeURIComponent(id)}`);
|
|
146
|
+
},
|
|
147
|
+
update(id, input) {
|
|
148
|
+
return fetchJson(`/agents/${encodeURIComponent(id)}`, {
|
|
149
|
+
method: "PATCH",
|
|
150
|
+
body: JSON.stringify(input)
|
|
151
|
+
});
|
|
152
|
+
},
|
|
153
|
+
async revoke(id) {
|
|
154
|
+
await fetchJson(`/agents/${encodeURIComponent(id)}`, {
|
|
155
|
+
method: "DELETE"
|
|
156
|
+
});
|
|
157
|
+
},
|
|
158
|
+
rotate(id) {
|
|
159
|
+
return fetchJson(`/agents/${encodeURIComponent(id)}/rotate`, {
|
|
160
|
+
method: "POST"
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
},
|
|
164
|
+
// ── Authorization ───────────────────────────────────────────────────────
|
|
165
|
+
authorize(agentId, request) {
|
|
166
|
+
return fetchJson(`/agents/${encodeURIComponent(agentId)}/authorize`, {
|
|
167
|
+
method: "POST",
|
|
168
|
+
body: JSON.stringify(request)
|
|
169
|
+
});
|
|
170
|
+
},
|
|
171
|
+
authorizeByToken(token, request) {
|
|
172
|
+
return fetchJson("/authorize", {
|
|
173
|
+
method: "POST",
|
|
174
|
+
body: JSON.stringify(request),
|
|
175
|
+
// override the client-level token with the agent-specific token
|
|
176
|
+
extraHeaders: { Authorization: `Bearer ${token}` }
|
|
177
|
+
});
|
|
178
|
+
},
|
|
179
|
+
// ── Delegations ─────────────────────────────────────────────────────────
|
|
180
|
+
delegations: {
|
|
181
|
+
create(input) {
|
|
182
|
+
return fetchJson("/delegations", {
|
|
183
|
+
method: "POST",
|
|
184
|
+
body: JSON.stringify(input)
|
|
185
|
+
});
|
|
186
|
+
},
|
|
187
|
+
list(agentId) {
|
|
188
|
+
return fetchJson(`/delegations/${encodeURIComponent(agentId)}`);
|
|
189
|
+
},
|
|
190
|
+
async revoke(id) {
|
|
191
|
+
await fetchJson(`/delegations/${encodeURIComponent(id)}`, {
|
|
192
|
+
method: "DELETE"
|
|
193
|
+
});
|
|
194
|
+
},
|
|
195
|
+
getEffectivePermissions(agentId) {
|
|
196
|
+
return fetchJson(`/delegations/${encodeURIComponent(agentId)}/permissions`);
|
|
197
|
+
}
|
|
198
|
+
},
|
|
199
|
+
// ── Audit ───────────────────────────────────────────────────────────────
|
|
200
|
+
audit: {
|
|
201
|
+
query(filters) {
|
|
202
|
+
const qs = filters ? buildQuery({
|
|
203
|
+
agentId: filters.agentId,
|
|
204
|
+
userId: filters.userId,
|
|
205
|
+
since: filters.since,
|
|
206
|
+
until: filters.until,
|
|
207
|
+
actions: filters.actions,
|
|
208
|
+
result: filters.result,
|
|
209
|
+
limit: filters.limit,
|
|
210
|
+
offset: filters.offset
|
|
211
|
+
}) : "";
|
|
212
|
+
return fetchJson(`/audit${qs}`);
|
|
213
|
+
},
|
|
214
|
+
export(options2) {
|
|
215
|
+
const qs = buildQuery({
|
|
216
|
+
format: options2.format,
|
|
217
|
+
since: options2.since,
|
|
218
|
+
until: options2.until
|
|
219
|
+
});
|
|
220
|
+
return fetchRaw(`/audit/export${qs}`);
|
|
221
|
+
}
|
|
222
|
+
},
|
|
223
|
+
// ── MCP servers ─────────────────────────────────────────────────────────
|
|
224
|
+
mcp: {
|
|
225
|
+
register(input) {
|
|
226
|
+
return fetchJson("/mcp/servers", {
|
|
227
|
+
method: "POST",
|
|
228
|
+
body: JSON.stringify(input)
|
|
229
|
+
});
|
|
230
|
+
},
|
|
231
|
+
list() {
|
|
232
|
+
return fetchJson("/mcp/servers");
|
|
233
|
+
},
|
|
234
|
+
get(id) {
|
|
235
|
+
return fetchNullable(`/mcp/servers/${encodeURIComponent(id)}`);
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
};
|
|
239
|
+
}
|
|
240
|
+
export {
|
|
241
|
+
KavachApiError,
|
|
242
|
+
createKavachClient
|
|
243
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@kavachos/client",
|
|
3
|
+
"version": "0.0.2",
|
|
4
|
+
"description": "TypeScript client for the KavachOS REST API",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": "KavachOS <hello@kavachos.com>",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "https://github.com/kavachos/kavachos.git",
|
|
10
|
+
"directory": "packages/client"
|
|
11
|
+
},
|
|
12
|
+
"type": "module",
|
|
13
|
+
"main": "dist/index.js",
|
|
14
|
+
"types": "dist/index.d.ts",
|
|
15
|
+
"exports": {
|
|
16
|
+
".": {
|
|
17
|
+
"types": "./dist/index.d.ts",
|
|
18
|
+
"import": "./dist/index.js"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"files": [
|
|
22
|
+
"dist"
|
|
23
|
+
],
|
|
24
|
+
"devDependencies": {
|
|
25
|
+
"tsup": "^8.4.0",
|
|
26
|
+
"typescript": "^5.8.0",
|
|
27
|
+
"vitest": "^3.0.0"
|
|
28
|
+
},
|
|
29
|
+
"scripts": {
|
|
30
|
+
"build": "tsup",
|
|
31
|
+
"typecheck": "tsc --noEmit",
|
|
32
|
+
"test": "vitest run"
|
|
33
|
+
}
|
|
34
|
+
}
|