@agentuity/core 2.0.9 → 2.0.11
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/agents.d.ts +170 -0
- package/dist/services/coder/agents.d.ts.map +1 -0
- package/dist/services/coder/agents.js +77 -0
- package/dist/services/coder/agents.js.map +1 -0
- package/dist/services/coder/api-reference.d.ts.map +1 -1
- package/dist/services/coder/api-reference.js +393 -41
- package/dist/services/coder/api-reference.js.map +1 -1
- package/dist/services/coder/client.d.ts +44 -2
- package/dist/services/coder/client.d.ts.map +1 -1
- package/dist/services/coder/client.js +89 -3
- package/dist/services/coder/client.js.map +1 -1
- package/dist/services/coder/close-codes.d.ts +76 -0
- package/dist/services/coder/close-codes.d.ts.map +1 -0
- package/dist/services/coder/close-codes.js +77 -0
- package/dist/services/coder/close-codes.js.map +1 -0
- package/dist/services/coder/discover.d.ts +1 -1
- package/dist/services/coder/discover.js +2 -2
- package/dist/services/coder/discover.js.map +1 -1
- package/dist/services/coder/index.d.ts +9 -2
- package/dist/services/coder/index.d.ts.map +1 -1
- package/dist/services/coder/index.js +6 -1
- package/dist/services/coder/index.js.map +1 -1
- package/dist/services/coder/protocol.d.ts +1855 -0
- package/dist/services/coder/protocol.d.ts.map +1 -0
- package/dist/services/coder/protocol.js +976 -0
- package/dist/services/coder/protocol.js.map +1 -0
- package/dist/services/coder/sessions.d.ts +9 -0
- package/dist/services/coder/sessions.d.ts.map +1 -1
- package/dist/services/coder/sessions.js +30 -6
- package/dist/services/coder/sessions.js.map +1 -1
- package/dist/services/coder/sse.d.ts +255 -0
- package/dist/services/coder/sse.d.ts.map +1 -0
- package/dist/services/coder/sse.js +676 -0
- package/dist/services/coder/sse.js.map +1 -0
- package/dist/services/coder/types.d.ts +1013 -0
- package/dist/services/coder/types.d.ts.map +1 -1
- package/dist/services/coder/types.js +215 -1
- package/dist/services/coder/types.js.map +1 -1
- package/dist/services/coder/websocket.d.ts +346 -0
- package/dist/services/coder/websocket.d.ts.map +1 -0
- package/dist/services/coder/websocket.js +791 -0
- package/dist/services/coder/websocket.js.map +1 -0
- package/dist/services/oauth/types.d.ts +10 -0
- package/dist/services/oauth/types.d.ts.map +1 -1
- package/dist/services/oauth/types.js +3 -0
- package/dist/services/oauth/types.js.map +1 -1
- package/dist/services/project/deploy.d.ts +1 -1
- package/dist/services/sandbox/run.d.ts +2 -2
- package/dist/services/sandbox/types.d.ts +2 -2
- package/package.json +2 -2
- package/src/services/coder/agents.ts +148 -0
- package/src/services/coder/api-reference.ts +411 -45
- package/src/services/coder/client.ts +133 -2
- package/src/services/coder/close-codes.ts +83 -0
- package/src/services/coder/discover.ts +2 -2
- package/src/services/coder/index.ts +29 -1
- package/src/services/coder/protocol.ts +1200 -0
- package/src/services/coder/sessions.ts +40 -10
- package/src/services/coder/sse.ts +796 -0
- package/src/services/coder/types.ts +249 -1
- package/src/services/coder/websocket.ts +943 -0
- package/src/services/oauth/types.ts +3 -0
|
@@ -1,19 +1,92 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { z } from 'zod/v4';
|
|
2
2
|
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
3
|
+
CoderCreateCustomAgentRequestSchema,
|
|
4
|
+
CoderCreateSessionRequestSchema,
|
|
5
|
+
CoderCustomAgentListResponseSchema,
|
|
6
|
+
CoderCustomAgentVersionListResponseSchema,
|
|
7
|
+
CoderListUsersResponseSchema,
|
|
8
|
+
CoderLoopStateResponseSchema,
|
|
9
|
+
CoderSessionEventSchema,
|
|
10
|
+
CoderSessionListItemSchema,
|
|
11
|
+
CoderSessionParticipantsSchema,
|
|
12
|
+
CoderSessionSchema,
|
|
13
|
+
CoderUpdateCustomAgentRequestSchema,
|
|
14
|
+
CoderUpdateSessionRequestSchema,
|
|
15
|
+
} from './types.ts';
|
|
16
|
+
import { CoderCreateSessionParamsSchema, CoderLifecycleResponseSchema } from './sessions.ts';
|
|
10
17
|
import type { Service } from '../api-reference.ts';
|
|
11
18
|
|
|
19
|
+
// Docs-only wire schemas: the REST reference documents raw hub payloads,
|
|
20
|
+
// while the public Coder client continues to use the schemas from ./types.ts.
|
|
21
|
+
const CoderHubSessionListWireSchema = z.object({
|
|
22
|
+
sessions: z
|
|
23
|
+
.object({
|
|
24
|
+
websocket: z
|
|
25
|
+
.array(CoderSessionListItemSchema)
|
|
26
|
+
.describe('Websocket-backed sessions returned by the hub'),
|
|
27
|
+
sandbox: z
|
|
28
|
+
.array(z.unknown())
|
|
29
|
+
.describe('Non-websocket session entries returned by the hub'),
|
|
30
|
+
})
|
|
31
|
+
.describe('Sessions grouped by transport'),
|
|
32
|
+
total: z.number().describe('Total sessions matching the query'),
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
const CoderSessionReplayWireSchema = z.object({
|
|
36
|
+
sessionId: z.string().describe('Session identifier for replay payload'),
|
|
37
|
+
entriesSource: z
|
|
38
|
+
.enum(['durable_stream', 'session_entries', 'event_history', 'none'])
|
|
39
|
+
.describe('Source used to reconstruct replay entries'),
|
|
40
|
+
sourceCounts: z
|
|
41
|
+
.object({
|
|
42
|
+
durableStream: z.number().describe('Replay entries loaded from durable stream storage'),
|
|
43
|
+
sessionEntries: z.number().describe('Replay entries loaded from session entry storage'),
|
|
44
|
+
eventHistory: z.number().describe('Replay entries synthesized from event history'),
|
|
45
|
+
})
|
|
46
|
+
.optional()
|
|
47
|
+
.describe('Counts of replay entries by source'),
|
|
48
|
+
entries: z.array(z.unknown()).describe('Replay conversation entries for the session'),
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
const CoderSessionEventHistoryWireSchema = z.object({
|
|
52
|
+
sessionId: z.string().describe('Session identifier for event history payload'),
|
|
53
|
+
events: z.array(CoderSessionEventSchema).describe('Event history items for the session'),
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
const CoderCreateSessionResponseWireSchema = z
|
|
57
|
+
.object({
|
|
58
|
+
sessionId: z.string().describe('Created session identifier'),
|
|
59
|
+
sandboxId: z.string().nullable().optional().describe('Associated sandbox identifier'),
|
|
60
|
+
status: z.string().describe('Initial session status'),
|
|
61
|
+
mode: z.string().optional().describe('Session mode'),
|
|
62
|
+
visibility: z.string().optional().describe('Session visibility'),
|
|
63
|
+
})
|
|
64
|
+
.passthrough();
|
|
65
|
+
|
|
66
|
+
const CoderUpdateSessionRequestWireSchema = CoderUpdateSessionRequestSchema.pick({
|
|
67
|
+
label: true,
|
|
68
|
+
agent: true,
|
|
69
|
+
visibility: true,
|
|
70
|
+
tags: true,
|
|
71
|
+
skills: true,
|
|
72
|
+
}).describe('Request body for updating public session metadata over REST');
|
|
73
|
+
|
|
74
|
+
const CoderUpdateSessionResponseWireSchema = z
|
|
75
|
+
.object({
|
|
76
|
+
sessionId: z.string().describe('Updated session identifier'),
|
|
77
|
+
label: z.string().optional().describe('Updated label'),
|
|
78
|
+
visibility: z.string().optional().describe('Updated visibility'),
|
|
79
|
+
tags: z.array(z.string()).optional().describe('Updated tags'),
|
|
80
|
+
skills: z.array(z.unknown()).optional().describe('Updated skills'),
|
|
81
|
+
defaultAgent: z.string().nullable().optional().describe('Updated default agent'),
|
|
82
|
+
})
|
|
83
|
+
.passthrough();
|
|
84
|
+
|
|
12
85
|
const service: Service = {
|
|
13
86
|
name: 'Coder',
|
|
14
87
|
slug: 'coder',
|
|
15
88
|
description:
|
|
16
|
-
'Manage Coder
|
|
89
|
+
'Manage Coder sessions, custom agents, session data, loop state, and known users through the HTTP API',
|
|
17
90
|
hasPublicEndpoints: false,
|
|
18
91
|
endpoints: [
|
|
19
92
|
{
|
|
@@ -22,13 +95,13 @@ const service: Service = {
|
|
|
22
95
|
sectionTitle: 'Discovery',
|
|
23
96
|
method: 'GET',
|
|
24
97
|
path: '/coder',
|
|
25
|
-
description: 'Discovers the org-specific Coder
|
|
98
|
+
description: 'Discovers the org-specific Coder base URL.',
|
|
26
99
|
pathParams: [],
|
|
27
100
|
queryParams: [
|
|
28
101
|
{ name: 'orgId', type: 'string', description: 'Organization ID', required: false },
|
|
29
102
|
],
|
|
30
103
|
requestBody: null,
|
|
31
|
-
responseDescription: 'Returns the discovered Coder
|
|
104
|
+
responseDescription: 'Returns the discovered Coder URL.',
|
|
32
105
|
statuses: [
|
|
33
106
|
{ code: 200, description: 'Coder URL discovered' },
|
|
34
107
|
{ code: 401, description: 'Unauthorized — invalid or missing API key' },
|
|
@@ -51,8 +124,9 @@ const service: Service = {
|
|
|
51
124
|
fields: { schema: CoderCreateSessionRequestSchema },
|
|
52
125
|
},
|
|
53
126
|
responseDescription: 'Returns the created session.',
|
|
127
|
+
responseFields: { schema: CoderCreateSessionResponseWireSchema, stripRequired: true },
|
|
54
128
|
statuses: [
|
|
55
|
-
{ code:
|
|
129
|
+
{ code: 201, description: 'Session created' },
|
|
56
130
|
{ code: 401, description: 'Unauthorized — invalid or missing API key' },
|
|
57
131
|
],
|
|
58
132
|
examplePath: '/hub/session',
|
|
@@ -80,13 +154,127 @@ const service: Service = {
|
|
|
80
154
|
],
|
|
81
155
|
requestBody: null,
|
|
82
156
|
responseDescription: 'Returns a session list.',
|
|
83
|
-
responseFields: { schema:
|
|
157
|
+
responseFields: { schema: CoderHubSessionListWireSchema, stripRequired: true },
|
|
84
158
|
statuses: [
|
|
85
159
|
{ code: 200, description: 'Sessions returned' },
|
|
86
160
|
{ code: 401, description: 'Unauthorized — invalid or missing API key' },
|
|
87
161
|
],
|
|
88
162
|
examplePath: '/hub/sessions?limit=20&offset=0',
|
|
89
163
|
},
|
|
164
|
+
{
|
|
165
|
+
id: 'get-session',
|
|
166
|
+
title: 'Get Session',
|
|
167
|
+
sectionTitle: 'Sessions',
|
|
168
|
+
method: 'GET',
|
|
169
|
+
path: '/hub/session/{sessionId}',
|
|
170
|
+
description: 'Retrieve a single coder session by ID.',
|
|
171
|
+
pathParams: [
|
|
172
|
+
{ name: 'sessionId', type: 'string', description: 'Session ID', required: true },
|
|
173
|
+
],
|
|
174
|
+
queryParams: [
|
|
175
|
+
{ name: 'orgId', type: 'string', description: 'Organization ID', required: false },
|
|
176
|
+
],
|
|
177
|
+
requestBody: null,
|
|
178
|
+
responseDescription: 'Returns the full session object.',
|
|
179
|
+
responseFields: { schema: CoderSessionSchema, stripRequired: true },
|
|
180
|
+
statuses: [
|
|
181
|
+
{ code: 200, description: 'Session returned' },
|
|
182
|
+
{ code: 404, description: 'Session not found' },
|
|
183
|
+
],
|
|
184
|
+
examplePath: '/hub/session/sess_123',
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
id: 'update-session',
|
|
188
|
+
title: 'Update Session',
|
|
189
|
+
sectionTitle: 'Sessions',
|
|
190
|
+
method: 'PATCH',
|
|
191
|
+
path: '/hub/session/{sessionId}',
|
|
192
|
+
description: 'Update an existing session.',
|
|
193
|
+
pathParams: [
|
|
194
|
+
{ name: 'sessionId', type: 'string', description: 'Session ID', required: true },
|
|
195
|
+
],
|
|
196
|
+
queryParams: [
|
|
197
|
+
{ name: 'orgId', type: 'string', description: 'Organization ID', required: false },
|
|
198
|
+
],
|
|
199
|
+
requestBody: {
|
|
200
|
+
description: 'Session update payload.',
|
|
201
|
+
fields: { schema: CoderUpdateSessionRequestWireSchema },
|
|
202
|
+
},
|
|
203
|
+
responseDescription: 'Returns the updated session fields.',
|
|
204
|
+
responseFields: { schema: CoderUpdateSessionResponseWireSchema, stripRequired: true },
|
|
205
|
+
statuses: [
|
|
206
|
+
{ code: 200, description: 'Session updated' },
|
|
207
|
+
{ code: 404, description: 'Session not found' },
|
|
208
|
+
],
|
|
209
|
+
examplePath: '/hub/session/sess_123',
|
|
210
|
+
exampleBody: { label: 'Updated Session', tags: ['auth', 'phase-2'] },
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
id: 'archive-session',
|
|
214
|
+
title: 'Archive Session',
|
|
215
|
+
sectionTitle: 'Sessions',
|
|
216
|
+
method: 'POST',
|
|
217
|
+
path: '/hub/session/{sessionId}/archive',
|
|
218
|
+
description: 'Archives an existing session.',
|
|
219
|
+
pathParams: [
|
|
220
|
+
{ name: 'sessionId', type: 'string', description: 'Session ID', required: true },
|
|
221
|
+
],
|
|
222
|
+
queryParams: [
|
|
223
|
+
{ name: 'orgId', type: 'string', description: 'Organization ID', required: false },
|
|
224
|
+
],
|
|
225
|
+
requestBody: null,
|
|
226
|
+
responseDescription: 'Returns the session identifier and optional updated status.',
|
|
227
|
+
responseFields: { schema: CoderLifecycleResponseSchema, stripRequired: true },
|
|
228
|
+
statuses: [
|
|
229
|
+
{ code: 200, description: 'Lifecycle action applied' },
|
|
230
|
+
{ code: 404, description: 'Session not found' },
|
|
231
|
+
],
|
|
232
|
+
examplePath: '/hub/session/sess_123/archive',
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
id: 'resume-session',
|
|
236
|
+
title: 'Resume Session',
|
|
237
|
+
sectionTitle: 'Sessions',
|
|
238
|
+
method: 'POST',
|
|
239
|
+
path: '/hub/session/{sessionId}/resume',
|
|
240
|
+
description: 'Resumes a paused session.',
|
|
241
|
+
pathParams: [
|
|
242
|
+
{ name: 'sessionId', type: 'string', description: 'Session ID', required: true },
|
|
243
|
+
],
|
|
244
|
+
queryParams: [
|
|
245
|
+
{ name: 'orgId', type: 'string', description: 'Organization ID', required: false },
|
|
246
|
+
],
|
|
247
|
+
requestBody: null,
|
|
248
|
+
responseDescription: 'Returns the session identifier and optional updated status.',
|
|
249
|
+
responseFields: { schema: CoderLifecycleResponseSchema, stripRequired: true },
|
|
250
|
+
statuses: [
|
|
251
|
+
{ code: 200, description: 'Session resume initiated' },
|
|
252
|
+
{ code: 404, description: 'Session not found' },
|
|
253
|
+
],
|
|
254
|
+
examplePath: '/hub/session/sess_123/resume',
|
|
255
|
+
},
|
|
256
|
+
{
|
|
257
|
+
id: 'delete-session',
|
|
258
|
+
title: 'Delete Session',
|
|
259
|
+
sectionTitle: 'Sessions',
|
|
260
|
+
method: 'DELETE',
|
|
261
|
+
path: '/hub/session/{sessionId}',
|
|
262
|
+
description: 'Permanently deletes a session.',
|
|
263
|
+
pathParams: [
|
|
264
|
+
{ name: 'sessionId', type: 'string', description: 'Session ID', required: true },
|
|
265
|
+
],
|
|
266
|
+
queryParams: [
|
|
267
|
+
{ name: 'orgId', type: 'string', description: 'Organization ID', required: false },
|
|
268
|
+
],
|
|
269
|
+
requestBody: null,
|
|
270
|
+
responseDescription: 'Returns the deleted session identifier and status.',
|
|
271
|
+
responseFields: { schema: CoderLifecycleResponseSchema, stripRequired: true },
|
|
272
|
+
statuses: [
|
|
273
|
+
{ code: 200, description: 'Session deleted' },
|
|
274
|
+
{ code: 404, description: 'Session not found' },
|
|
275
|
+
],
|
|
276
|
+
examplePath: '/hub/session/sess_123',
|
|
277
|
+
},
|
|
90
278
|
{
|
|
91
279
|
id: 'get-loop-state',
|
|
92
280
|
title: 'Get Loop State',
|
|
@@ -125,7 +313,7 @@ const service: Service = {
|
|
|
125
313
|
],
|
|
126
314
|
requestBody: null,
|
|
127
315
|
responseDescription: 'Returns known users.',
|
|
128
|
-
responseFields: { schema:
|
|
316
|
+
responseFields: { schema: CoderListUsersResponseSchema, stripRequired: true },
|
|
129
317
|
statuses: [
|
|
130
318
|
{ code: 200, description: 'Users returned' },
|
|
131
319
|
{ code: 401, description: 'Unauthorized — invalid or missing API key' },
|
|
@@ -133,73 +321,251 @@ const service: Service = {
|
|
|
133
321
|
examplePath: '/hub/users?search=jane',
|
|
134
322
|
},
|
|
135
323
|
{
|
|
136
|
-
id: 'session-
|
|
137
|
-
title: 'Session
|
|
324
|
+
id: 'get-session-replay',
|
|
325
|
+
title: 'Get Session Replay',
|
|
138
326
|
sectionTitle: 'Session Data',
|
|
139
327
|
method: 'GET',
|
|
140
|
-
path: '/hub/session/{sessionId}/
|
|
141
|
-
description: 'Retrieve replay
|
|
328
|
+
path: '/hub/session/{sessionId}/replay',
|
|
329
|
+
description: 'Retrieve replay data for a session.',
|
|
142
330
|
pathParams: [
|
|
143
331
|
{ name: 'sessionId', type: 'string', description: 'Session ID', required: true },
|
|
144
332
|
],
|
|
145
333
|
queryParams: [
|
|
146
|
-
{ name: 'limit', type: 'number', description: 'Maximum records', required: false },
|
|
147
|
-
{ name: 'offset', type: 'number', description: 'Pagination offset', required: false },
|
|
148
334
|
{ name: 'orgId', type: 'string', description: 'Organization ID', required: false },
|
|
149
335
|
],
|
|
150
336
|
requestBody: null,
|
|
151
|
-
responseDescription: 'Returns
|
|
152
|
-
responseFields: { schema:
|
|
337
|
+
responseDescription: 'Returns replay data for the session.',
|
|
338
|
+
responseFields: { schema: CoderSessionReplayWireSchema, stripRequired: true },
|
|
153
339
|
statuses: [
|
|
154
|
-
{ code: 200, description: '
|
|
340
|
+
{ code: 200, description: 'Replay returned' },
|
|
155
341
|
{ code: 404, description: 'Session not found' },
|
|
156
342
|
],
|
|
157
343
|
examplePath: '/hub/session/sess_123/replay',
|
|
158
344
|
},
|
|
159
345
|
{
|
|
160
|
-
id: 'session-
|
|
161
|
-
title: 'Session
|
|
162
|
-
sectionTitle: '
|
|
163
|
-
method: '
|
|
164
|
-
path: '/hub/session/{sessionId}/
|
|
165
|
-
description: '
|
|
346
|
+
id: 'list-session-participants',
|
|
347
|
+
title: 'List Session Participants',
|
|
348
|
+
sectionTitle: 'Session Data',
|
|
349
|
+
method: 'GET',
|
|
350
|
+
path: '/hub/session/{sessionId}/participants',
|
|
351
|
+
description: 'Retrieve participants for a session.',
|
|
166
352
|
pathParams: [
|
|
167
353
|
{ name: 'sessionId', type: 'string', description: 'Session ID', required: true },
|
|
168
354
|
],
|
|
169
355
|
queryParams: [
|
|
356
|
+
{ name: 'limit', type: 'number', description: 'Maximum records', required: false },
|
|
357
|
+
{
|
|
358
|
+
name: 'includeDisconnected',
|
|
359
|
+
type: 'boolean',
|
|
360
|
+
description: 'Include disconnected participants',
|
|
361
|
+
required: false,
|
|
362
|
+
},
|
|
170
363
|
{ name: 'orgId', type: 'string', description: 'Organization ID', required: false },
|
|
171
364
|
],
|
|
172
365
|
requestBody: null,
|
|
173
|
-
responseDescription: 'Returns
|
|
174
|
-
responseFields: { schema:
|
|
366
|
+
responseDescription: 'Returns participants for the session.',
|
|
367
|
+
responseFields: { schema: CoderSessionParticipantsSchema, stripRequired: true },
|
|
175
368
|
statuses: [
|
|
176
|
-
{ code: 200, description: '
|
|
369
|
+
{ code: 200, description: 'Participants returned' },
|
|
177
370
|
{ code: 404, description: 'Session not found' },
|
|
178
371
|
],
|
|
179
|
-
examplePath: '/hub/session/sess_123/
|
|
372
|
+
examplePath: '/hub/session/sess_123/participants?limit=200&includeDisconnected=true',
|
|
180
373
|
},
|
|
181
374
|
{
|
|
182
|
-
id: '
|
|
183
|
-
title: 'List
|
|
184
|
-
sectionTitle: '
|
|
375
|
+
id: 'list-session-event-history',
|
|
376
|
+
title: 'List Session Event History',
|
|
377
|
+
sectionTitle: 'Session Data',
|
|
378
|
+
method: 'GET',
|
|
379
|
+
path: '/hub/session/{sessionId}/events/history',
|
|
380
|
+
description: 'Retrieve historical events for a session.',
|
|
381
|
+
pathParams: [
|
|
382
|
+
{ name: 'sessionId', type: 'string', description: 'Session ID', required: true },
|
|
383
|
+
],
|
|
384
|
+
queryParams: [
|
|
385
|
+
{ name: 'limit', type: 'number', description: 'Maximum records', required: false },
|
|
386
|
+
{
|
|
387
|
+
name: 'beforeId',
|
|
388
|
+
type: 'number',
|
|
389
|
+
description: 'Return events before the given event identifier',
|
|
390
|
+
required: false,
|
|
391
|
+
},
|
|
392
|
+
{ name: 'orgId', type: 'string', description: 'Organization ID', required: false },
|
|
393
|
+
],
|
|
394
|
+
requestBody: null,
|
|
395
|
+
responseDescription: 'Returns session event history.',
|
|
396
|
+
responseFields: { schema: CoderSessionEventHistoryWireSchema, stripRequired: true },
|
|
397
|
+
statuses: [
|
|
398
|
+
{ code: 200, description: 'Event history returned' },
|
|
399
|
+
{ code: 404, description: 'Session not found' },
|
|
400
|
+
],
|
|
401
|
+
examplePath: '/hub/session/sess_123/events/history?limit=50&beforeId=1234',
|
|
402
|
+
},
|
|
403
|
+
{
|
|
404
|
+
id: 'list-custom-agents',
|
|
405
|
+
title: 'List Custom Agents',
|
|
406
|
+
sectionTitle: 'Agents',
|
|
185
407
|
method: 'GET',
|
|
186
|
-
path: '/hub/
|
|
187
|
-
description: 'Lists
|
|
408
|
+
path: '/hub/agents',
|
|
409
|
+
description: 'Lists custom agents visible to the caller.',
|
|
188
410
|
pathParams: [],
|
|
189
411
|
queryParams: [
|
|
190
|
-
{
|
|
191
|
-
|
|
192
|
-
|
|
412
|
+
{
|
|
413
|
+
name: 'includeArchived',
|
|
414
|
+
type: 'boolean',
|
|
415
|
+
description: 'Include archived custom agents',
|
|
416
|
+
required: false,
|
|
417
|
+
},
|
|
193
418
|
{ name: 'orgId', type: 'string', description: 'Organization ID', required: false },
|
|
194
419
|
],
|
|
195
420
|
requestBody: null,
|
|
196
|
-
responseDescription: 'Returns
|
|
197
|
-
responseFields: { schema:
|
|
421
|
+
responseDescription: 'Returns custom agents visible to the caller.',
|
|
422
|
+
responseFields: { schema: CoderCustomAgentListResponseSchema, stripRequired: true },
|
|
198
423
|
statuses: [
|
|
199
|
-
{ code: 200, description: '
|
|
424
|
+
{ code: 200, description: 'Custom agents returned' },
|
|
200
425
|
{ code: 401, description: 'Unauthorized — invalid or missing API key' },
|
|
201
426
|
],
|
|
202
|
-
examplePath: '/hub/
|
|
427
|
+
examplePath: '/hub/agents?includeArchived=true',
|
|
428
|
+
},
|
|
429
|
+
{
|
|
430
|
+
id: 'create-custom-agent',
|
|
431
|
+
title: 'Create Custom Agent',
|
|
432
|
+
sectionTitle: 'Agents',
|
|
433
|
+
method: 'POST',
|
|
434
|
+
path: '/hub/agents',
|
|
435
|
+
description: 'Creates a new custom-agent draft.',
|
|
436
|
+
pathParams: [],
|
|
437
|
+
queryParams: [
|
|
438
|
+
{ name: 'orgId', type: 'string', description: 'Organization ID', required: false },
|
|
439
|
+
],
|
|
440
|
+
requestBody: {
|
|
441
|
+
description: 'Custom-agent creation payload.',
|
|
442
|
+
fields: { schema: CoderCreateCustomAgentRequestSchema },
|
|
443
|
+
},
|
|
444
|
+
responseDescription: 'Returns the created custom agent.',
|
|
445
|
+
statuses: [
|
|
446
|
+
{ code: 201, description: 'Custom agent created' },
|
|
447
|
+
{ code: 401, description: 'Unauthorized — invalid or missing API key' },
|
|
448
|
+
],
|
|
449
|
+
examplePath: '/hub/agents',
|
|
450
|
+
exampleBody: {
|
|
451
|
+
slug: 'code-review',
|
|
452
|
+
displayName: 'Code Review',
|
|
453
|
+
instructions: 'Focus on correctness, regressions, and missing tests.',
|
|
454
|
+
piTools: ['read', 'grep', 'ls'],
|
|
455
|
+
hubToolNames: ['session_todo_list', 'session_todo_update'],
|
|
456
|
+
},
|
|
457
|
+
},
|
|
458
|
+
{
|
|
459
|
+
id: 'get-custom-agent',
|
|
460
|
+
title: 'Get Custom Agent',
|
|
461
|
+
sectionTitle: 'Agents',
|
|
462
|
+
method: 'GET',
|
|
463
|
+
path: '/hub/agents/{agentIdOrSlug}',
|
|
464
|
+
description: 'Fetches a custom agent by id or slug.',
|
|
465
|
+
pathParams: [
|
|
466
|
+
{
|
|
467
|
+
name: 'agentIdOrSlug',
|
|
468
|
+
type: 'string',
|
|
469
|
+
description: 'Custom agent id or slug',
|
|
470
|
+
required: true,
|
|
471
|
+
},
|
|
472
|
+
],
|
|
473
|
+
queryParams: [
|
|
474
|
+
{ name: 'orgId', type: 'string', description: 'Organization ID', required: false },
|
|
475
|
+
],
|
|
476
|
+
requestBody: null,
|
|
477
|
+
responseDescription: 'Returns the requested custom agent.',
|
|
478
|
+
statuses: [
|
|
479
|
+
{ code: 200, description: 'Custom agent returned' },
|
|
480
|
+
{ code: 404, description: 'Custom agent not found' },
|
|
481
|
+
],
|
|
482
|
+
examplePath: '/hub/agents/code-review',
|
|
483
|
+
},
|
|
484
|
+
{
|
|
485
|
+
id: 'update-custom-agent',
|
|
486
|
+
title: 'Update Custom Agent',
|
|
487
|
+
sectionTitle: 'Agents',
|
|
488
|
+
method: 'PATCH',
|
|
489
|
+
path: '/hub/agents/{agentIdOrSlug}',
|
|
490
|
+
description: 'Updates an owned custom-agent draft.',
|
|
491
|
+
pathParams: [
|
|
492
|
+
{
|
|
493
|
+
name: 'agentIdOrSlug',
|
|
494
|
+
type: 'string',
|
|
495
|
+
description: 'Custom agent id or slug',
|
|
496
|
+
required: true,
|
|
497
|
+
},
|
|
498
|
+
],
|
|
499
|
+
queryParams: [
|
|
500
|
+
{ name: 'orgId', type: 'string', description: 'Organization ID', required: false },
|
|
501
|
+
],
|
|
502
|
+
requestBody: {
|
|
503
|
+
description: 'Custom-agent update payload.',
|
|
504
|
+
fields: { schema: CoderUpdateCustomAgentRequestSchema },
|
|
505
|
+
},
|
|
506
|
+
responseDescription: 'Returns the updated custom agent.',
|
|
507
|
+
statuses: [
|
|
508
|
+
{ code: 200, description: 'Custom agent updated' },
|
|
509
|
+
{ code: 404, description: 'Custom agent not found' },
|
|
510
|
+
],
|
|
511
|
+
examplePath: '/hub/agents/code-review',
|
|
512
|
+
exampleBody: { displayName: 'Code Review Draft' },
|
|
513
|
+
},
|
|
514
|
+
{
|
|
515
|
+
id: 'custom-agent-lifecycle',
|
|
516
|
+
title: 'Custom Agent Lifecycle Endpoints',
|
|
517
|
+
sectionTitle: 'Agents',
|
|
518
|
+
method: 'POST',
|
|
519
|
+
path: '/hub/agents/{agentIdOrSlug}/(publish|archive)',
|
|
520
|
+
description: 'Publishes or archives an owned custom agent.',
|
|
521
|
+
pathParams: [
|
|
522
|
+
{
|
|
523
|
+
name: 'agentIdOrSlug',
|
|
524
|
+
type: 'string',
|
|
525
|
+
description: 'Custom agent id or slug',
|
|
526
|
+
required: true,
|
|
527
|
+
},
|
|
528
|
+
],
|
|
529
|
+
queryParams: [
|
|
530
|
+
{ name: 'orgId', type: 'string', description: 'Organization ID', required: false },
|
|
531
|
+
],
|
|
532
|
+
requestBody: null,
|
|
533
|
+
responseDescription: 'Returns the updated custom agent.',
|
|
534
|
+
statuses: [
|
|
535
|
+
{ code: 200, description: 'Lifecycle action applied' },
|
|
536
|
+
{ code: 404, description: 'Custom agent not found' },
|
|
537
|
+
],
|
|
538
|
+
examplePath: '/hub/agents/code-review/publish',
|
|
539
|
+
},
|
|
540
|
+
{
|
|
541
|
+
id: 'list-custom-agent-versions',
|
|
542
|
+
title: 'List Custom Agent Versions',
|
|
543
|
+
sectionTitle: 'Agents',
|
|
544
|
+
method: 'GET',
|
|
545
|
+
path: '/hub/agents/{agentIdOrSlug}/versions',
|
|
546
|
+
description: 'Lists immutable published versions for a custom agent.',
|
|
547
|
+
pathParams: [
|
|
548
|
+
{
|
|
549
|
+
name: 'agentIdOrSlug',
|
|
550
|
+
type: 'string',
|
|
551
|
+
description: 'Custom agent id or slug',
|
|
552
|
+
required: true,
|
|
553
|
+
},
|
|
554
|
+
],
|
|
555
|
+
queryParams: [
|
|
556
|
+
{ name: 'orgId', type: 'string', description: 'Organization ID', required: false },
|
|
557
|
+
],
|
|
558
|
+
requestBody: null,
|
|
559
|
+
responseDescription: 'Returns published versions for the custom agent.',
|
|
560
|
+
responseFields: {
|
|
561
|
+
schema: CoderCustomAgentVersionListResponseSchema,
|
|
562
|
+
stripRequired: true,
|
|
563
|
+
},
|
|
564
|
+
statuses: [
|
|
565
|
+
{ code: 200, description: 'Custom agent versions returned' },
|
|
566
|
+
{ code: 404, description: 'Custom agent not found' },
|
|
567
|
+
],
|
|
568
|
+
examplePath: '/hub/agents/code-review/versions',
|
|
203
569
|
},
|
|
204
570
|
],
|
|
205
571
|
};
|