@meistrari/agent-sdk 0.1.2 → 0.2.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 +31 -2
- package/dist/index.cjs +497 -8
- package/dist/index.d.cts +50 -11
- package/dist/index.d.mts +50 -11
- package/dist/index.d.ts +50 -11
- package/dist/index.mjs +494 -9
- package/package.json +3 -2
package/dist/index.d.mts
CHANGED
|
@@ -14,15 +14,6 @@ declare class APIKeyAuthStrategy implements AuthStrategy {
|
|
|
14
14
|
getHeaders(): Headers;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
declare const sessionStatusSchema: z.ZodEnum<{
|
|
18
|
-
pending: "pending";
|
|
19
|
-
running: "running";
|
|
20
|
-
completed: "completed";
|
|
21
|
-
failed: "failed";
|
|
22
|
-
waiting_messages: "waiting_messages";
|
|
23
|
-
cancelled: "cancelled";
|
|
24
|
-
}>;
|
|
25
|
-
type SessionStatus = z.infer<typeof sessionStatusSchema>;
|
|
26
17
|
declare const agentInputSchema: z.ZodObject<{
|
|
27
18
|
vaultRef: z.ZodString;
|
|
28
19
|
filename: z.ZodString;
|
|
@@ -50,6 +41,49 @@ declare const executeAgentResponseSchema: z.ZodObject<{
|
|
|
50
41
|
error: z.ZodOptional<z.ZodString>;
|
|
51
42
|
}, z.core.$strip>;
|
|
52
43
|
type ExecuteAgentResponse = z.infer<typeof executeAgentResponseSchema>;
|
|
44
|
+
declare const updateAgentModelRequestSchema: z.ZodObject<{
|
|
45
|
+
repository: z.ZodString;
|
|
46
|
+
model: z.ZodEnum<{
|
|
47
|
+
[x: string]: string;
|
|
48
|
+
}>;
|
|
49
|
+
commitMessage: z.ZodOptional<z.ZodString>;
|
|
50
|
+
}, z.core.$strict>;
|
|
51
|
+
type UpdateAgentModelRequest = z.infer<typeof updateAgentModelRequestSchema>;
|
|
52
|
+
declare const updateAgentModelResponseSchema: z.ZodObject<{
|
|
53
|
+
success: z.ZodBoolean;
|
|
54
|
+
organizationName: z.ZodOptional<z.ZodString>;
|
|
55
|
+
repository: z.ZodOptional<z.ZodString>;
|
|
56
|
+
branch: z.ZodOptional<z.ZodString>;
|
|
57
|
+
commitHash: z.ZodOptional<z.ZodString>;
|
|
58
|
+
model: z.ZodOptional<z.ZodEnum<{
|
|
59
|
+
[x: string]: string;
|
|
60
|
+
}>>;
|
|
61
|
+
providerTemplate: z.ZodOptional<z.ZodString>;
|
|
62
|
+
templateSynced: z.ZodOptional<z.ZodBoolean>;
|
|
63
|
+
files: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
64
|
+
deletedFiles: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
65
|
+
error: z.ZodOptional<z.ZodString>;
|
|
66
|
+
}, z.core.$strip>;
|
|
67
|
+
type UpdateAgentModelResponse = z.infer<typeof updateAgentModelResponseSchema>;
|
|
68
|
+
|
|
69
|
+
declare const sessionStatusSchema: z.ZodEnum<{
|
|
70
|
+
pending: "pending";
|
|
71
|
+
running: "running";
|
|
72
|
+
completed: "completed";
|
|
73
|
+
failed: "failed";
|
|
74
|
+
waiting_messages: "waiting_messages";
|
|
75
|
+
cancelled: "cancelled";
|
|
76
|
+
}>;
|
|
77
|
+
type SessionStatus = z.infer<typeof sessionStatusSchema>;
|
|
78
|
+
declare const sessionTimelineIdSchema: z.ZodString;
|
|
79
|
+
declare const sessionTimelineResponseSchema: z.ZodObject<{
|
|
80
|
+
sessionId: z.ZodString;
|
|
81
|
+
status: z.ZodString;
|
|
82
|
+
metrics: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
83
|
+
prompt: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
84
|
+
spans: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
85
|
+
}, z.core.$strip>;
|
|
86
|
+
type SessionTimelineResponse = z.infer<typeof sessionTimelineResponseSchema>;
|
|
53
87
|
declare const sessionStreamEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
54
88
|
kind: z.ZodLiteral<"status">;
|
|
55
89
|
sessionId: z.ZodString;
|
|
@@ -124,6 +158,9 @@ interface StreamSessionOptions {
|
|
|
124
158
|
cursor?: number;
|
|
125
159
|
signal?: AbortSignal;
|
|
126
160
|
}
|
|
161
|
+
interface FetchTimelineOptions {
|
|
162
|
+
signal?: AbortSignal;
|
|
163
|
+
}
|
|
127
164
|
type ResolveReferenceAs = 'bytes' | 'stream' | 'json';
|
|
128
165
|
interface ResolveReferenceOptions {
|
|
129
166
|
as?: ResolveReferenceAs;
|
|
@@ -132,6 +169,8 @@ interface ResolveReferenceOptions {
|
|
|
132
169
|
|
|
133
170
|
declare function agentClient(config: AgentClientConfig): {
|
|
134
171
|
executeAgent: (input: ExecuteAgentRequest) => Promise<ExecuteAgentResponse>;
|
|
172
|
+
updateAgentModel: (input: UpdateAgentModelRequest) => Promise<UpdateAgentModelResponse>;
|
|
173
|
+
fetchTimeline: (sessionId: string, options?: FetchTimelineOptions) => Promise<SessionTimelineResponse>;
|
|
135
174
|
streamSession: (sessionId: string, options?: StreamSessionOptions) => Promise<AsyncIterable<SessionStreamEvent>>;
|
|
136
175
|
resolveReference: {
|
|
137
176
|
(reference: string, options?: {
|
|
@@ -161,5 +200,5 @@ declare class FetchError extends Error {
|
|
|
161
200
|
|
|
162
201
|
declare function parseSessionStream(stream: ReadableStream<Uint8Array>): AsyncIterable<SessionStreamEvent>;
|
|
163
202
|
|
|
164
|
-
export { APIKeyAuthStrategy, DataTokenAuthStrategy, FetchError, agentClient, agentInputSchema, executeAgentRequestSchema, executeAgentResponseSchema, parseSessionStream, sessionStatusSchema, sessionStreamEventSchema };
|
|
165
|
-
export type { AgentClient, AgentClientConfig, AgentInput, AuthStrategy, ExecuteAgentRequest, ExecuteAgentResponse, ResolveReferenceAs, ResolveReferenceOptions, SessionStatus, SessionStreamEvent, StreamSessionOptions };
|
|
203
|
+
export { APIKeyAuthStrategy, DataTokenAuthStrategy, FetchError, agentClient, agentInputSchema, executeAgentRequestSchema, executeAgentResponseSchema, parseSessionStream, sessionStatusSchema, sessionStreamEventSchema, sessionTimelineIdSchema, sessionTimelineResponseSchema, updateAgentModelRequestSchema, updateAgentModelResponseSchema };
|
|
204
|
+
export type { AgentClient, AgentClientConfig, AgentInput, AuthStrategy, ExecuteAgentRequest, ExecuteAgentResponse, FetchTimelineOptions, ResolveReferenceAs, ResolveReferenceOptions, SessionStatus, SessionStreamEvent, SessionTimelineResponse, StreamSessionOptions, UpdateAgentModelRequest, UpdateAgentModelResponse };
|
package/dist/index.d.ts
CHANGED
|
@@ -14,15 +14,6 @@ declare class APIKeyAuthStrategy implements AuthStrategy {
|
|
|
14
14
|
getHeaders(): Headers;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
declare const sessionStatusSchema: z.ZodEnum<{
|
|
18
|
-
pending: "pending";
|
|
19
|
-
running: "running";
|
|
20
|
-
completed: "completed";
|
|
21
|
-
failed: "failed";
|
|
22
|
-
waiting_messages: "waiting_messages";
|
|
23
|
-
cancelled: "cancelled";
|
|
24
|
-
}>;
|
|
25
|
-
type SessionStatus = z.infer<typeof sessionStatusSchema>;
|
|
26
17
|
declare const agentInputSchema: z.ZodObject<{
|
|
27
18
|
vaultRef: z.ZodString;
|
|
28
19
|
filename: z.ZodString;
|
|
@@ -50,6 +41,49 @@ declare const executeAgentResponseSchema: z.ZodObject<{
|
|
|
50
41
|
error: z.ZodOptional<z.ZodString>;
|
|
51
42
|
}, z.core.$strip>;
|
|
52
43
|
type ExecuteAgentResponse = z.infer<typeof executeAgentResponseSchema>;
|
|
44
|
+
declare const updateAgentModelRequestSchema: z.ZodObject<{
|
|
45
|
+
repository: z.ZodString;
|
|
46
|
+
model: z.ZodEnum<{
|
|
47
|
+
[x: string]: string;
|
|
48
|
+
}>;
|
|
49
|
+
commitMessage: z.ZodOptional<z.ZodString>;
|
|
50
|
+
}, z.core.$strict>;
|
|
51
|
+
type UpdateAgentModelRequest = z.infer<typeof updateAgentModelRequestSchema>;
|
|
52
|
+
declare const updateAgentModelResponseSchema: z.ZodObject<{
|
|
53
|
+
success: z.ZodBoolean;
|
|
54
|
+
organizationName: z.ZodOptional<z.ZodString>;
|
|
55
|
+
repository: z.ZodOptional<z.ZodString>;
|
|
56
|
+
branch: z.ZodOptional<z.ZodString>;
|
|
57
|
+
commitHash: z.ZodOptional<z.ZodString>;
|
|
58
|
+
model: z.ZodOptional<z.ZodEnum<{
|
|
59
|
+
[x: string]: string;
|
|
60
|
+
}>>;
|
|
61
|
+
providerTemplate: z.ZodOptional<z.ZodString>;
|
|
62
|
+
templateSynced: z.ZodOptional<z.ZodBoolean>;
|
|
63
|
+
files: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
64
|
+
deletedFiles: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
65
|
+
error: z.ZodOptional<z.ZodString>;
|
|
66
|
+
}, z.core.$strip>;
|
|
67
|
+
type UpdateAgentModelResponse = z.infer<typeof updateAgentModelResponseSchema>;
|
|
68
|
+
|
|
69
|
+
declare const sessionStatusSchema: z.ZodEnum<{
|
|
70
|
+
pending: "pending";
|
|
71
|
+
running: "running";
|
|
72
|
+
completed: "completed";
|
|
73
|
+
failed: "failed";
|
|
74
|
+
waiting_messages: "waiting_messages";
|
|
75
|
+
cancelled: "cancelled";
|
|
76
|
+
}>;
|
|
77
|
+
type SessionStatus = z.infer<typeof sessionStatusSchema>;
|
|
78
|
+
declare const sessionTimelineIdSchema: z.ZodString;
|
|
79
|
+
declare const sessionTimelineResponseSchema: z.ZodObject<{
|
|
80
|
+
sessionId: z.ZodString;
|
|
81
|
+
status: z.ZodString;
|
|
82
|
+
metrics: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
83
|
+
prompt: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
84
|
+
spans: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
85
|
+
}, z.core.$strip>;
|
|
86
|
+
type SessionTimelineResponse = z.infer<typeof sessionTimelineResponseSchema>;
|
|
53
87
|
declare const sessionStreamEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
54
88
|
kind: z.ZodLiteral<"status">;
|
|
55
89
|
sessionId: z.ZodString;
|
|
@@ -124,6 +158,9 @@ interface StreamSessionOptions {
|
|
|
124
158
|
cursor?: number;
|
|
125
159
|
signal?: AbortSignal;
|
|
126
160
|
}
|
|
161
|
+
interface FetchTimelineOptions {
|
|
162
|
+
signal?: AbortSignal;
|
|
163
|
+
}
|
|
127
164
|
type ResolveReferenceAs = 'bytes' | 'stream' | 'json';
|
|
128
165
|
interface ResolveReferenceOptions {
|
|
129
166
|
as?: ResolveReferenceAs;
|
|
@@ -132,6 +169,8 @@ interface ResolveReferenceOptions {
|
|
|
132
169
|
|
|
133
170
|
declare function agentClient(config: AgentClientConfig): {
|
|
134
171
|
executeAgent: (input: ExecuteAgentRequest) => Promise<ExecuteAgentResponse>;
|
|
172
|
+
updateAgentModel: (input: UpdateAgentModelRequest) => Promise<UpdateAgentModelResponse>;
|
|
173
|
+
fetchTimeline: (sessionId: string, options?: FetchTimelineOptions) => Promise<SessionTimelineResponse>;
|
|
135
174
|
streamSession: (sessionId: string, options?: StreamSessionOptions) => Promise<AsyncIterable<SessionStreamEvent>>;
|
|
136
175
|
resolveReference: {
|
|
137
176
|
(reference: string, options?: {
|
|
@@ -161,5 +200,5 @@ declare class FetchError extends Error {
|
|
|
161
200
|
|
|
162
201
|
declare function parseSessionStream(stream: ReadableStream<Uint8Array>): AsyncIterable<SessionStreamEvent>;
|
|
163
202
|
|
|
164
|
-
export { APIKeyAuthStrategy, DataTokenAuthStrategy, FetchError, agentClient, agentInputSchema, executeAgentRequestSchema, executeAgentResponseSchema, parseSessionStream, sessionStatusSchema, sessionStreamEventSchema };
|
|
165
|
-
export type { AgentClient, AgentClientConfig, AgentInput, AuthStrategy, ExecuteAgentRequest, ExecuteAgentResponse, ResolveReferenceAs, ResolveReferenceOptions, SessionStatus, SessionStreamEvent, StreamSessionOptions };
|
|
203
|
+
export { APIKeyAuthStrategy, DataTokenAuthStrategy, FetchError, agentClient, agentInputSchema, executeAgentRequestSchema, executeAgentResponseSchema, parseSessionStream, sessionStatusSchema, sessionStreamEventSchema, sessionTimelineIdSchema, sessionTimelineResponseSchema, updateAgentModelRequestSchema, updateAgentModelResponseSchema };
|
|
204
|
+
export type { AgentClient, AgentClientConfig, AgentInput, AuthStrategy, ExecuteAgentRequest, ExecuteAgentResponse, FetchTimelineOptions, ResolveReferenceAs, ResolveReferenceOptions, SessionStatus, SessionStreamEvent, SessionTimelineResponse, StreamSessionOptions, UpdateAgentModelRequest, UpdateAgentModelResponse };
|