@agentuity/core 2.0.7 → 2.0.9
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/dist/services/coder/api-reference.d.ts +4 -0
- package/dist/services/coder/api-reference.d.ts.map +1 -0
- package/dist/services/coder/api-reference.js +199 -0
- package/dist/services/coder/api-reference.js.map +1 -0
- package/dist/services/coder/client.d.ts +128 -0
- package/dist/services/coder/client.d.ts.map +1 -0
- package/dist/services/coder/client.js +265 -0
- package/dist/services/coder/client.js.map +1 -0
- package/dist/services/coder/discover.d.ts +13 -0
- package/dist/services/coder/discover.d.ts.map +1 -0
- package/dist/services/coder/discover.js +18 -0
- package/dist/services/coder/discover.js.map +1 -0
- package/dist/services/coder/github.d.ts +13 -0
- package/dist/services/coder/github.d.ts.map +1 -0
- package/dist/services/coder/github.js +15 -0
- package/dist/services/coder/github.js.map +1 -0
- package/dist/services/coder/index.d.ts +19 -0
- package/dist/services/coder/index.d.ts.map +1 -0
- package/dist/services/coder/index.js +13 -0
- package/dist/services/coder/index.js.map +1 -0
- package/dist/services/coder/loop-state.d.ts +10 -0
- package/dist/services/coder/loop-state.d.ts.map +1 -0
- package/dist/services/coder/loop-state.js +13 -0
- package/dist/services/coder/loop-state.js.map +1 -0
- package/dist/services/coder/session-data.d.ts +28 -0
- package/dist/services/coder/session-data.d.ts.map +1 -0
- package/dist/services/coder/session-data.js +28 -0
- package/dist/services/coder/session-data.js.map +1 -0
- package/dist/services/coder/sessions.d.ts +155 -0
- package/dist/services/coder/sessions.d.ts.map +1 -0
- package/dist/services/coder/sessions.js +125 -0
- package/dist/services/coder/sessions.js.map +1 -0
- package/dist/services/coder/skills.d.ts +17 -0
- package/dist/services/coder/skills.d.ts.map +1 -0
- package/dist/services/coder/skills.js +43 -0
- package/dist/services/coder/skills.js.map +1 -0
- package/dist/services/coder/types.d.ts +1066 -0
- package/dist/services/coder/types.d.ts.map +1 -0
- package/dist/services/coder/types.js +573 -0
- package/dist/services/coder/types.js.map +1 -0
- package/dist/services/coder/users.d.ts +12 -0
- package/dist/services/coder/users.d.ts.map +1 -0
- package/dist/services/coder/users.js +35 -0
- package/dist/services/coder/users.js.map +1 -0
- package/dist/services/coder/util.d.ts +82 -0
- package/dist/services/coder/util.d.ts.map +1 -0
- package/dist/services/coder/util.js +60 -0
- package/dist/services/coder/util.js.map +1 -0
- package/dist/services/coder/workspaces.d.ts +13 -0
- package/dist/services/coder/workspaces.d.ts.map +1 -0
- package/dist/services/coder/workspaces.js +37 -0
- package/dist/services/coder/workspaces.js.map +1 -0
- package/dist/services/index.d.ts +1 -0
- package/dist/services/index.d.ts.map +1 -1
- package/dist/services/index.js +1 -0
- package/dist/services/index.js.map +1 -1
- package/dist/services/oauth/types.d.ts +1 -0
- package/dist/services/oauth/types.d.ts.map +1 -1
- package/dist/services/oauth/types.js +1 -0
- package/dist/services/oauth/types.js.map +1 -1
- package/dist/services/project/deploy.d.ts +1 -1
- package/dist/services/queue/service.d.ts +28 -0
- package/dist/services/queue/service.d.ts.map +1 -1
- package/dist/services/queue/service.js +54 -9
- package/dist/services/queue/service.js.map +1 -1
- package/dist/services/sandbox/cli-list.d.ts +1 -1
- package/dist/services/sandbox/client.d.ts +10 -4
- package/dist/services/sandbox/client.d.ts.map +1 -1
- package/dist/services/sandbox/client.js +2 -2
- package/dist/services/sandbox/client.js.map +1 -1
- package/dist/services/sandbox/create.d.ts +2 -2
- package/dist/services/sandbox/execute.d.ts +2 -2
- package/dist/services/sandbox/execution.d.ts +4 -4
- package/dist/services/sandbox/files.d.ts +10 -2
- package/dist/services/sandbox/files.d.ts.map +1 -1
- package/dist/services/sandbox/files.js +14 -0
- package/dist/services/sandbox/files.js.map +1 -1
- package/dist/services/sandbox/get.d.ts +2 -2
- package/dist/services/sandbox/list.d.ts +4 -4
- package/dist/services/sandbox/run.d.ts +1 -1
- package/dist/services/sandbox/types.d.ts +18 -10
- package/dist/services/sandbox/types.d.ts.map +1 -1
- package/dist/services/sandbox/types.js +4 -4
- package/dist/services/sandbox/types.js.map +1 -1
- package/dist/services/session/events.d.ts +2 -2
- package/dist/services/workflow/types.d.ts +8 -8
- package/package.json +2 -2
- package/src/services/coder/api-reference.ts +207 -0
- package/src/services/coder/client.ts +378 -0
- package/src/services/coder/discover.ts +23 -0
- package/src/services/coder/github.ts +33 -0
- package/src/services/coder/index.ts +72 -0
- package/src/services/coder/loop-state.ts +19 -0
- package/src/services/coder/session-data.ts +63 -0
- package/src/services/coder/sessions.ts +237 -0
- package/src/services/coder/skills.ts +102 -0
- package/src/services/coder/types.ts +670 -0
- package/src/services/coder/users.ts +59 -0
- package/src/services/coder/util.ts +87 -0
- package/src/services/coder/workspaces.ts +77 -0
- package/src/services/index.ts +1 -0
- package/src/services/oauth/types.ts +1 -0
- package/src/services/queue/service.ts +56 -13
- package/src/services/sandbox/client.ts +10 -8
- package/src/services/sandbox/files.ts +28 -2
- package/src/services/sandbox/types.ts +8 -6
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
import { z } from 'zod/v4';
|
|
2
|
+
import { type APIClient } from '../api.ts';
|
|
3
|
+
import {
|
|
4
|
+
CoderCreateSessionRequestSchema,
|
|
5
|
+
CoderListSessionsParamsSchema,
|
|
6
|
+
CoderSessionListResponseSchema,
|
|
7
|
+
CoderSessionListItemSchema,
|
|
8
|
+
CoderSessionSchema,
|
|
9
|
+
CoderUpdateSessionRequestSchema,
|
|
10
|
+
type CoderCreateSessionRequest,
|
|
11
|
+
type CoderListSessionsParams,
|
|
12
|
+
type CoderSession,
|
|
13
|
+
type CoderSessionListResponse,
|
|
14
|
+
type CoderUpdateSessionRequest,
|
|
15
|
+
} from './types.ts';
|
|
16
|
+
|
|
17
|
+
const CoderHubSessionListResponseSchema = z.object({
|
|
18
|
+
sessions: z.object({
|
|
19
|
+
websocket: z.array(CoderSessionListItemSchema),
|
|
20
|
+
sandbox: z.array(z.unknown()),
|
|
21
|
+
}),
|
|
22
|
+
total: z.number(),
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
const CoderLifecycleResponseSchema = z
|
|
26
|
+
.object({
|
|
27
|
+
sessionId: z.string().describe('Session identifier'),
|
|
28
|
+
status: z.string().optional().describe('New session status'),
|
|
29
|
+
})
|
|
30
|
+
.passthrough();
|
|
31
|
+
|
|
32
|
+
export const CoderSessionIdParamsSchema = z
|
|
33
|
+
.object({
|
|
34
|
+
sessionId: z.string().describe('Coder session identifier'),
|
|
35
|
+
orgId: z.string().optional().describe('Optional org id for CLI auth context'),
|
|
36
|
+
})
|
|
37
|
+
.describe('Common parameters for single-session operations');
|
|
38
|
+
export type CoderSessionIdParams = z.infer<typeof CoderSessionIdParamsSchema>;
|
|
39
|
+
|
|
40
|
+
export const CoderCreateSessionParamsSchema = z
|
|
41
|
+
.object({
|
|
42
|
+
body: CoderCreateSessionRequestSchema.describe('Create-session request body'),
|
|
43
|
+
orgId: z.string().optional().describe('Optional org id for CLI auth context'),
|
|
44
|
+
})
|
|
45
|
+
.describe('Parameters for creating a coder session');
|
|
46
|
+
export type CoderCreateSessionParams = z.infer<typeof CoderCreateSessionParamsSchema>;
|
|
47
|
+
|
|
48
|
+
export const CoderGetSessionParamsSchema = CoderSessionIdParamsSchema.describe(
|
|
49
|
+
'Parameters for retrieving a coder session'
|
|
50
|
+
);
|
|
51
|
+
export type CoderGetSessionParams = z.infer<typeof CoderGetSessionParamsSchema>;
|
|
52
|
+
|
|
53
|
+
export const CoderUpdateSessionParamsSchema = z
|
|
54
|
+
.object({
|
|
55
|
+
sessionId: z.string().describe('Coder session identifier to update'),
|
|
56
|
+
body: CoderUpdateSessionRequestSchema.describe('Update-session request body'),
|
|
57
|
+
orgId: z.string().optional().describe('Optional org id for CLI auth context'),
|
|
58
|
+
})
|
|
59
|
+
.describe('Parameters for updating a coder session');
|
|
60
|
+
export type CoderUpdateSessionParams = z.infer<typeof CoderUpdateSessionParamsSchema>;
|
|
61
|
+
|
|
62
|
+
export const CoderListSessionsParamsWithOrgSchema = CoderListSessionsParamsSchema.describe(
|
|
63
|
+
'Parameters for listing coder sessions'
|
|
64
|
+
);
|
|
65
|
+
export type CoderListSessionsParamsWithOrg = z.infer<typeof CoderListSessionsParamsWithOrgSchema>;
|
|
66
|
+
|
|
67
|
+
export const CoderListConnectableSessionsParamsSchema = z
|
|
68
|
+
.object({
|
|
69
|
+
search: z.string().optional().describe('Search query for connectable sessions'),
|
|
70
|
+
limit: z.number().int().optional().describe('Maximum number of sessions to return'),
|
|
71
|
+
offset: z.number().int().optional().describe('Number of sessions to skip for pagination'),
|
|
72
|
+
orgId: z.string().optional().describe('Optional org id for CLI auth context'),
|
|
73
|
+
})
|
|
74
|
+
.describe('Parameters for listing connectable coder sessions');
|
|
75
|
+
export type CoderListConnectableSessionsParams = z.infer<
|
|
76
|
+
typeof CoderListConnectableSessionsParamsSchema
|
|
77
|
+
>;
|
|
78
|
+
|
|
79
|
+
function normalizeSessionList(
|
|
80
|
+
payload:
|
|
81
|
+
| z.infer<typeof CoderSessionListResponseSchema>
|
|
82
|
+
| z.infer<typeof CoderSessionListItemSchema>[]
|
|
83
|
+
): CoderSessionListResponse {
|
|
84
|
+
if (Array.isArray(payload)) {
|
|
85
|
+
return {
|
|
86
|
+
sessions: payload,
|
|
87
|
+
total: payload.length,
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
return CoderSessionListResponseSchema.parse(payload);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
function buildListQuery(
|
|
95
|
+
params?: CoderListSessionsParams | CoderListConnectableSessionsParams
|
|
96
|
+
): string {
|
|
97
|
+
const query = new URLSearchParams();
|
|
98
|
+
if (params?.search) {
|
|
99
|
+
query.set('search', params.search);
|
|
100
|
+
}
|
|
101
|
+
if (params && 'includeArchived' in params && params.includeArchived !== undefined) {
|
|
102
|
+
query.set('includeArchived', String(params.includeArchived));
|
|
103
|
+
}
|
|
104
|
+
if (params?.limit !== undefined) {
|
|
105
|
+
query.set('limit', String(params.limit));
|
|
106
|
+
}
|
|
107
|
+
if (params?.offset !== undefined) {
|
|
108
|
+
query.set('offset', String(params.offset));
|
|
109
|
+
}
|
|
110
|
+
const queryString = query.toString();
|
|
111
|
+
return queryString ? `?${queryString}` : '';
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
const CoderCreateSessionResponseSchema = z
|
|
115
|
+
.object({
|
|
116
|
+
sessionId: z.string().describe('Created session identifier'),
|
|
117
|
+
sandboxId: z.string().nullable().optional().describe('Associated sandbox identifier'),
|
|
118
|
+
status: z.string().describe('Initial session status'),
|
|
119
|
+
mode: z.string().optional().describe('Session mode'),
|
|
120
|
+
visibility: z.string().optional().describe('Session visibility'),
|
|
121
|
+
})
|
|
122
|
+
.passthrough();
|
|
123
|
+
|
|
124
|
+
export interface CoderCreateSessionResponse {
|
|
125
|
+
sessionId: string;
|
|
126
|
+
sandboxId?: string | null;
|
|
127
|
+
status: string;
|
|
128
|
+
mode?: string;
|
|
129
|
+
visibility?: string;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
export async function coderCreateSession(
|
|
133
|
+
client: APIClient,
|
|
134
|
+
params: CoderCreateSessionParams
|
|
135
|
+
): Promise<CoderCreateSessionResponse> {
|
|
136
|
+
return client.post<CoderCreateSessionResponse, CoderCreateSessionRequest>(
|
|
137
|
+
'/hub/session',
|
|
138
|
+
params.body,
|
|
139
|
+
CoderCreateSessionResponseSchema,
|
|
140
|
+
CoderCreateSessionRequestSchema
|
|
141
|
+
);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
export async function coderGetSession(
|
|
145
|
+
client: APIClient,
|
|
146
|
+
params: CoderGetSessionParams
|
|
147
|
+
): Promise<CoderSession> {
|
|
148
|
+
const path = `/hub/session/${encodeURIComponent(params.sessionId)}`;
|
|
149
|
+
return client.get<CoderSession>(path, CoderSessionSchema);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
const CoderUpdateSessionResponseSchema = z
|
|
153
|
+
.object({
|
|
154
|
+
sessionId: z.string().describe('Updated session identifier'),
|
|
155
|
+
label: z.string().optional().describe('Updated label'),
|
|
156
|
+
visibility: z.string().optional().describe('Updated visibility'),
|
|
157
|
+
tags: z.array(z.string()).optional().describe('Updated tags'),
|
|
158
|
+
skills: z.array(z.unknown()).optional().describe('Updated skills'),
|
|
159
|
+
defaultAgent: z.string().nullable().optional().describe('Updated default agent'),
|
|
160
|
+
})
|
|
161
|
+
.passthrough();
|
|
162
|
+
|
|
163
|
+
export interface CoderUpdateSessionResponse {
|
|
164
|
+
sessionId: string;
|
|
165
|
+
label?: string;
|
|
166
|
+
visibility?: string;
|
|
167
|
+
tags?: string[];
|
|
168
|
+
skills?: unknown[];
|
|
169
|
+
defaultAgent?: string | null;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
export async function coderUpdateSession(
|
|
173
|
+
client: APIClient,
|
|
174
|
+
params: CoderUpdateSessionParams
|
|
175
|
+
): Promise<CoderUpdateSessionResponse> {
|
|
176
|
+
const path = `/hub/session/${encodeURIComponent(params.sessionId)}`;
|
|
177
|
+
|
|
178
|
+
return client.patch<CoderUpdateSessionResponse, CoderUpdateSessionRequest>(
|
|
179
|
+
path,
|
|
180
|
+
params.body,
|
|
181
|
+
CoderUpdateSessionResponseSchema,
|
|
182
|
+
CoderUpdateSessionRequestSchema
|
|
183
|
+
);
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
export async function coderListSessions(
|
|
187
|
+
client: APIClient,
|
|
188
|
+
params?: CoderListSessionsParamsWithOrg
|
|
189
|
+
): Promise<CoderSessionListResponse> {
|
|
190
|
+
const path = `/hub/sessions${buildListQuery(params)}`;
|
|
191
|
+
const raw = await client.get<z.infer<typeof CoderHubSessionListResponseSchema>>(
|
|
192
|
+
path,
|
|
193
|
+
CoderHubSessionListResponseSchema
|
|
194
|
+
);
|
|
195
|
+
|
|
196
|
+
return normalizeSessionList({
|
|
197
|
+
sessions: raw.sessions.websocket,
|
|
198
|
+
total: raw.total,
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
export async function coderDeleteSession(
|
|
203
|
+
client: APIClient,
|
|
204
|
+
params: CoderSessionIdParams
|
|
205
|
+
): Promise<void> {
|
|
206
|
+
const path = `/hub/session/${encodeURIComponent(params.sessionId)}`;
|
|
207
|
+
await client.delete(path);
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
export interface CoderLifecycleResponse {
|
|
211
|
+
sessionId: string;
|
|
212
|
+
status?: string;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
export async function coderArchiveSession(
|
|
216
|
+
client: APIClient,
|
|
217
|
+
params: CoderSessionIdParams
|
|
218
|
+
): Promise<CoderLifecycleResponse> {
|
|
219
|
+
const path = `/hub/session/${encodeURIComponent(params.sessionId)}/archive`;
|
|
220
|
+
return client.post<CoderLifecycleResponse>(path, undefined, CoderLifecycleResponseSchema);
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
export async function coderListConnectableSessions(
|
|
224
|
+
client: APIClient,
|
|
225
|
+
params?: CoderListConnectableSessionsParams
|
|
226
|
+
): Promise<CoderSessionListResponse> {
|
|
227
|
+
const path = `/hub/sessions/connectable${buildListQuery(params)}`;
|
|
228
|
+
const raw = await client.get<z.infer<typeof CoderHubSessionListResponseSchema>>(
|
|
229
|
+
path,
|
|
230
|
+
CoderHubSessionListResponseSchema
|
|
231
|
+
);
|
|
232
|
+
|
|
233
|
+
return normalizeSessionList({
|
|
234
|
+
sessions: raw.sessions.websocket,
|
|
235
|
+
total: raw.total,
|
|
236
|
+
});
|
|
237
|
+
}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { z } from 'zod/v4';
|
|
2
|
+
import { type APIClient } from '../api.ts';
|
|
3
|
+
import {
|
|
4
|
+
CoderCreateSkillBucketRequestSchema,
|
|
5
|
+
CoderSavedSkillListResponseSchema,
|
|
6
|
+
CoderSavedSkillSchema,
|
|
7
|
+
CoderSaveSkillRequestSchema,
|
|
8
|
+
CoderSkillBucketListResponseSchema,
|
|
9
|
+
CoderSkillBucketSchema,
|
|
10
|
+
type CoderCreateSkillBucketRequest,
|
|
11
|
+
type CoderSavedSkill,
|
|
12
|
+
type CoderSavedSkillListResponse,
|
|
13
|
+
type CoderSaveSkillRequest,
|
|
14
|
+
type CoderSkillBucket,
|
|
15
|
+
type CoderSkillBucketListResponse,
|
|
16
|
+
} from './types.ts';
|
|
17
|
+
|
|
18
|
+
const SaveSkillResponseSchema = z
|
|
19
|
+
.object({
|
|
20
|
+
skill: CoderSavedSkillSchema.describe('Saved skill payload returned by coder hub'),
|
|
21
|
+
})
|
|
22
|
+
.passthrough()
|
|
23
|
+
.describe('Wrapped save-skill response from coder hub');
|
|
24
|
+
|
|
25
|
+
const CreateSkillBucketResponseSchema = z
|
|
26
|
+
.object({
|
|
27
|
+
bucket: CoderSkillBucketSchema.describe('Created skill bucket payload returned by coder hub'),
|
|
28
|
+
})
|
|
29
|
+
.passthrough()
|
|
30
|
+
.describe('Wrapped create-skill-bucket response from coder hub');
|
|
31
|
+
|
|
32
|
+
const OkResponseSchema = z
|
|
33
|
+
.object({
|
|
34
|
+
ok: z.boolean().describe('Operation success indicator'),
|
|
35
|
+
})
|
|
36
|
+
.passthrough()
|
|
37
|
+
.describe('Generic ok response from coder hub');
|
|
38
|
+
|
|
39
|
+
export async function coderListSavedSkills(
|
|
40
|
+
client: APIClient
|
|
41
|
+
): Promise<CoderSavedSkillListResponse> {
|
|
42
|
+
return client.get<CoderSavedSkillListResponse>(
|
|
43
|
+
'/hub/skills/library',
|
|
44
|
+
CoderSavedSkillListResponseSchema
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export async function coderSaveSkill(
|
|
49
|
+
client: APIClient,
|
|
50
|
+
params: { body: CoderSaveSkillRequest }
|
|
51
|
+
): Promise<CoderSavedSkill> {
|
|
52
|
+
const resp = await client.post<z.infer<typeof SaveSkillResponseSchema>, CoderSaveSkillRequest>(
|
|
53
|
+
'/hub/skills/library',
|
|
54
|
+
params.body,
|
|
55
|
+
SaveSkillResponseSchema,
|
|
56
|
+
CoderSaveSkillRequestSchema
|
|
57
|
+
);
|
|
58
|
+
|
|
59
|
+
return resp.skill;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export async function coderDeleteSavedSkill(
|
|
63
|
+
client: APIClient,
|
|
64
|
+
params: { skillId: string }
|
|
65
|
+
): Promise<void> {
|
|
66
|
+
const path = `/hub/skills/library/${encodeURIComponent(params.skillId)}`;
|
|
67
|
+
await client.delete(path, OkResponseSchema);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export async function coderListSkillBuckets(
|
|
71
|
+
client: APIClient
|
|
72
|
+
): Promise<CoderSkillBucketListResponse> {
|
|
73
|
+
return client.get<CoderSkillBucketListResponse>(
|
|
74
|
+
'/hub/skills/buckets',
|
|
75
|
+
CoderSkillBucketListResponseSchema
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export async function coderCreateSkillBucket(
|
|
80
|
+
client: APIClient,
|
|
81
|
+
params: { body: CoderCreateSkillBucketRequest }
|
|
82
|
+
): Promise<CoderSkillBucket> {
|
|
83
|
+
const resp = await client.post<
|
|
84
|
+
z.infer<typeof CreateSkillBucketResponseSchema>,
|
|
85
|
+
CoderCreateSkillBucketRequest
|
|
86
|
+
>(
|
|
87
|
+
'/hub/skills/buckets',
|
|
88
|
+
params.body,
|
|
89
|
+
CreateSkillBucketResponseSchema,
|
|
90
|
+
CoderCreateSkillBucketRequestSchema
|
|
91
|
+
);
|
|
92
|
+
|
|
93
|
+
return resp.bucket;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export async function coderDeleteSkillBucket(
|
|
97
|
+
client: APIClient,
|
|
98
|
+
params: { bucketId: string }
|
|
99
|
+
): Promise<void> {
|
|
100
|
+
const path = `/hub/skills/buckets/${encodeURIComponent(params.bucketId)}`;
|
|
101
|
+
await client.delete(path, OkResponseSchema);
|
|
102
|
+
}
|