@opencode-ai/protocol 0.0.0-next-15625 → 0.0.0-next-15626

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.
@@ -82,6 +82,11 @@ export declare const IntegrationGroup: HttpApiGroup.HttpApiGroup<"server.integra
82
82
  readonly value: Schema.String;
83
83
  }>>, never, never>;
84
84
  }>]>>>, never, never>;
85
+ }>, Schema.Struct<{
86
+ readonly id: Schema.brand<Schema.String, "Integration.MethodID">;
87
+ readonly type: Schema.Literal<"command">;
88
+ readonly label: Schema.String;
89
+ readonly command: Schema.$Array<Schema.String>;
85
90
  }>, Schema.Struct<{
86
91
  readonly type: Schema.Literal<"key">;
87
92
  readonly label: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
@@ -181,6 +186,11 @@ export declare const IntegrationGroup: HttpApiGroup.HttpApiGroup<"server.integra
181
186
  readonly value: Schema.String;
182
187
  }>>, never, never>;
183
188
  }>]>>>, never, never>;
189
+ }>, Schema.Struct<{
190
+ readonly id: Schema.brand<Schema.String, "Integration.MethodID">;
191
+ readonly type: Schema.Literal<"command">;
192
+ readonly label: Schema.String;
193
+ readonly command: Schema.$Array<Schema.String>;
184
194
  }>, Schema.Struct<{
185
195
  readonly type: Schema.Literal<"key">;
186
196
  readonly label: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
@@ -209,7 +219,7 @@ export declare const IntegrationGroup: HttpApiGroup.HttpApiGroup<"server.integra
209
219
  }>>, HttpApiEndpoint.Json<Schema.Struct<{
210
220
  readonly key: Schema.String;
211
221
  readonly label: Schema.optional<Schema.String>;
212
- }>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<HttpApiSchema.NoContent>, HttpApiEndpoint.Json<typeof InvalidRequestError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"integration.connect.oauth", "POST", "/api/integration/:integrationID/connect/oauth", HttpApiEndpoint.StringTree<Schema.Struct<{
222
+ }>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<HttpApiSchema.NoContent>, HttpApiEndpoint.Json<typeof InvalidRequestError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"integration.oauth.connect", "POST", "/api/integration/:integrationID/connect/oauth", HttpApiEndpoint.StringTree<Schema.Struct<{
213
223
  integrationID: Schema.brand<Schema.String, "Integration.ID">;
214
224
  }>>, HttpApiEndpoint.StringTree<Schema.Struct<{
215
225
  readonly location: Schema.optional<Schema.Struct<{
@@ -223,7 +233,8 @@ export declare const IntegrationGroup: HttpApiGroup.HttpApiGroup<"server.integra
223
233
  }>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
224
234
  readonly location: typeof Location.Info;
225
235
  readonly data: typeof Integration.Attempt;
226
- }>>, HttpApiEndpoint.Json<typeof InvalidRequestError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"integration.attempt.status", "GET", "/api/integration/attempt/:attemptID", HttpApiEndpoint.StringTree<Schema.Struct<{
236
+ }>>, HttpApiEndpoint.Json<typeof InvalidRequestError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"integration.oauth.status", "GET", "/api/integration/:integrationID/connect/oauth/:attemptID", HttpApiEndpoint.StringTree<Schema.Struct<{
237
+ integrationID: Schema.brand<Schema.String, "Integration.ID">;
227
238
  attemptID: Schema.brand<Schema.String, "Integration.AttemptID"> & {
228
239
  create: () => string & import("effect/Brand").Brand<"Integration.AttemptID">;
229
240
  };
@@ -260,7 +271,8 @@ export declare const IntegrationGroup: HttpApiGroup.HttpApiGroup<"server.integra
260
271
  readonly expires: Schema.Number;
261
272
  }>;
262
273
  }>]>;
263
- }>>, HttpApiEndpoint.Json<never>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"integration.attempt.complete", "POST", "/api/integration/attempt/:attemptID/complete", HttpApiEndpoint.StringTree<Schema.Struct<{
274
+ }>>, HttpApiEndpoint.Json<never>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"integration.oauth.complete", "POST", "/api/integration/:integrationID/connect/oauth/:attemptID/complete", HttpApiEndpoint.StringTree<Schema.Struct<{
275
+ integrationID: Schema.brand<Schema.String, "Integration.ID">;
264
276
  attemptID: Schema.brand<Schema.String, "Integration.AttemptID"> & {
265
277
  create: () => string & import("effect/Brand").Brand<"Integration.AttemptID">;
266
278
  };
@@ -271,7 +283,78 @@ export declare const IntegrationGroup: HttpApiGroup.HttpApiGroup<"server.integra
271
283
  }>>;
272
284
  }>>, HttpApiEndpoint.Json<Schema.Struct<{
273
285
  readonly code: Schema.optional<Schema.String>;
274
- }>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<HttpApiSchema.NoContent>, HttpApiEndpoint.Json<typeof InvalidRequestError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"integration.attempt.cancel", "DELETE", "/api/integration/attempt/:attemptID", HttpApiEndpoint.StringTree<Schema.Struct<{
286
+ }>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<HttpApiSchema.NoContent>, HttpApiEndpoint.Json<typeof InvalidRequestError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"integration.oauth.cancel", "DELETE", "/api/integration/:integrationID/connect/oauth/:attemptID", HttpApiEndpoint.StringTree<Schema.Struct<{
287
+ integrationID: Schema.brand<Schema.String, "Integration.ID">;
288
+ attemptID: Schema.brand<Schema.String, "Integration.AttemptID"> & {
289
+ create: () => string & import("effect/Brand").Brand<"Integration.AttemptID">;
290
+ };
291
+ }>>, HttpApiEndpoint.StringTree<Schema.Struct<{
292
+ readonly location: Schema.optional<Schema.Struct<{
293
+ readonly directory: Schema.optional<Schema.String>;
294
+ readonly workspace: Schema.optional<Schema.String>;
295
+ }>>;
296
+ }>>, HttpApiEndpoint.Json<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<HttpApiSchema.NoContent>, HttpApiEndpoint.Json<never>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"integration.command.connect", "POST", "/api/integration/:integrationID/connect/command", HttpApiEndpoint.StringTree<Schema.Struct<{
297
+ integrationID: Schema.brand<Schema.String, "Integration.ID">;
298
+ }>>, HttpApiEndpoint.StringTree<Schema.Struct<{
299
+ readonly location: Schema.optional<Schema.Struct<{
300
+ readonly directory: Schema.optional<Schema.String>;
301
+ readonly workspace: Schema.optional<Schema.String>;
302
+ }>>;
303
+ }>>, HttpApiEndpoint.Json<Schema.Struct<{
304
+ readonly methodID: Schema.brand<Schema.String, "Integration.MethodID">;
305
+ readonly label: Schema.optional<Schema.String>;
306
+ }>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
307
+ readonly location: typeof Location.Info;
308
+ readonly data: Schema.Struct<{
309
+ readonly attemptID: Schema.brand<Schema.String, "Integration.AttemptID"> & {
310
+ create: () => string & import("effect/Brand").Brand<"Integration.AttemptID">;
311
+ };
312
+ readonly time: Schema.Struct<{
313
+ readonly created: Schema.Number;
314
+ readonly expires: Schema.Number;
315
+ }>;
316
+ }>;
317
+ }>>, HttpApiEndpoint.Json<typeof InvalidRequestError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"integration.command.status", "GET", "/api/integration/:integrationID/connect/command/:attemptID", HttpApiEndpoint.StringTree<Schema.Struct<{
318
+ integrationID: Schema.brand<Schema.String, "Integration.ID">;
319
+ attemptID: Schema.brand<Schema.String, "Integration.AttemptID"> & {
320
+ create: () => string & import("effect/Brand").Brand<"Integration.AttemptID">;
321
+ };
322
+ }>>, HttpApiEndpoint.StringTree<Schema.Struct<{
323
+ readonly location: Schema.optional<Schema.Struct<{
324
+ readonly directory: Schema.optional<Schema.String>;
325
+ readonly workspace: Schema.optional<Schema.String>;
326
+ }>>;
327
+ }>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
328
+ readonly location: typeof Location.Info;
329
+ readonly data: Schema.Union<readonly [Schema.Struct<{
330
+ readonly status: Schema.Literal<"pending">;
331
+ readonly message: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
332
+ readonly time: Schema.Struct<{
333
+ readonly created: Schema.Number;
334
+ readonly expires: Schema.Number;
335
+ }>;
336
+ }>, Schema.Struct<{
337
+ readonly status: Schema.Literal<"complete">;
338
+ readonly time: Schema.Struct<{
339
+ readonly created: Schema.Number;
340
+ readonly expires: Schema.Number;
341
+ }>;
342
+ }>, Schema.Struct<{
343
+ readonly status: Schema.Literal<"failed">;
344
+ readonly message: Schema.String;
345
+ readonly time: Schema.Struct<{
346
+ readonly created: Schema.Number;
347
+ readonly expires: Schema.Number;
348
+ }>;
349
+ }>, Schema.Struct<{
350
+ readonly status: Schema.Literal<"expired">;
351
+ readonly time: Schema.Struct<{
352
+ readonly created: Schema.Number;
353
+ readonly expires: Schema.Number;
354
+ }>;
355
+ }>]>;
356
+ }>>, HttpApiEndpoint.Json<never>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"integration.command.cancel", "DELETE", "/api/integration/:integrationID/connect/command/:attemptID", HttpApiEndpoint.StringTree<Schema.Struct<{
357
+ integrationID: Schema.brand<Schema.String, "Integration.ID">;
275
358
  attemptID: Schema.brand<Schema.String, "Integration.AttemptID"> & {
276
359
  create: () => string & import("effect/Brand").Brand<"Integration.AttemptID">;
277
360
  };
@@ -43,7 +43,7 @@ export const IntegrationGroup = HttpApiGroup.make("server.integration")
43
43
  summary: "Connect with key",
44
44
  description: "Run a key authentication method and store the resulting credential.",
45
45
  })))
46
- .add(HttpApiEndpoint.post("integration.connect.oauth", "/api/integration/:integrationID/connect/oauth", {
46
+ .add(HttpApiEndpoint.post("integration.oauth.connect", "/api/integration/:integrationID/connect/oauth", {
47
47
  params: { integrationID: Integration.ID },
48
48
  query: LocationQuery,
49
49
  payload: Schema.Struct({
@@ -56,23 +56,23 @@ export const IntegrationGroup = HttpApiGroup.make("server.integration")
56
56
  })
57
57
  .annotateMerge(locationQueryOpenApi)
58
58
  .annotateMerge(OpenApi.annotations({
59
- identifier: "v2.integration.connect.oauth",
59
+ identifier: "v2.integration.oauth.connect",
60
60
  summary: "Begin OAuth connection",
61
61
  description: "Start an OAuth attempt and return the authorization details.",
62
62
  })))
63
- .add(HttpApiEndpoint.get("integration.attempt.status", "/api/integration/attempt/:attemptID", {
64
- params: { attemptID: Integration.AttemptID },
63
+ .add(HttpApiEndpoint.get("integration.oauth.status", "/api/integration/:integrationID/connect/oauth/:attemptID", {
64
+ params: { integrationID: Integration.ID, attemptID: Integration.AttemptID },
65
65
  query: LocationQuery,
66
66
  success: Location.response(Integration.AttemptStatus),
67
67
  })
68
68
  .annotateMerge(locationQueryOpenApi)
69
69
  .annotateMerge(OpenApi.annotations({
70
- identifier: "v2.integration.attempt.status",
70
+ identifier: "v2.integration.oauth.status",
71
71
  summary: "Get OAuth attempt status",
72
72
  description: "Poll the current status of an OAuth attempt.",
73
73
  })))
74
- .add(HttpApiEndpoint.post("integration.attempt.complete", "/api/integration/attempt/:attemptID/complete", {
75
- params: { attemptID: Integration.AttemptID },
74
+ .add(HttpApiEndpoint.post("integration.oauth.complete", "/api/integration/:integrationID/connect/oauth/:attemptID/complete", {
75
+ params: { integrationID: Integration.ID, attemptID: Integration.AttemptID },
76
76
  query: LocationQuery,
77
77
  payload: Schema.Struct({ code: Schema.optional(Schema.String) }),
78
78
  success: HttpApiSchema.NoContent,
@@ -80,19 +80,57 @@ export const IntegrationGroup = HttpApiGroup.make("server.integration")
80
80
  })
81
81
  .annotateMerge(locationQueryOpenApi)
82
82
  .annotateMerge(OpenApi.annotations({
83
- identifier: "v2.integration.attempt.complete",
83
+ identifier: "v2.integration.oauth.complete",
84
84
  summary: "Complete OAuth connection",
85
85
  description: "Complete a code-based OAuth attempt and store the resulting credential.",
86
86
  })))
87
- .add(HttpApiEndpoint.delete("integration.attempt.cancel", "/api/integration/attempt/:attemptID", {
88
- params: { attemptID: Integration.AttemptID },
87
+ .add(HttpApiEndpoint.delete("integration.oauth.cancel", "/api/integration/:integrationID/connect/oauth/:attemptID", {
88
+ params: { integrationID: Integration.ID, attemptID: Integration.AttemptID },
89
89
  query: LocationQuery,
90
90
  success: HttpApiSchema.NoContent,
91
91
  })
92
92
  .annotateMerge(locationQueryOpenApi)
93
93
  .annotateMerge(OpenApi.annotations({
94
- identifier: "v2.integration.attempt.cancel",
94
+ identifier: "v2.integration.oauth.cancel",
95
95
  summary: "Cancel OAuth connection",
96
96
  description: "Cancel an OAuth attempt and release its resources.",
97
+ })))
98
+ .add(HttpApiEndpoint.post("integration.command.connect", "/api/integration/:integrationID/connect/command", {
99
+ params: { integrationID: Integration.ID },
100
+ query: LocationQuery,
101
+ payload: Schema.Struct({
102
+ methodID: Integration.MethodID,
103
+ label: Schema.optional(Schema.String),
104
+ }),
105
+ success: Location.response(Integration.CommandAttempt),
106
+ error: InvalidRequestError,
107
+ })
108
+ .annotateMerge(locationQueryOpenApi)
109
+ .annotateMerge(OpenApi.annotations({
110
+ identifier: "v2.integration.command.connect",
111
+ summary: "Begin command connection",
112
+ description: "Start a command authentication attempt.",
113
+ })))
114
+ .add(HttpApiEndpoint.get("integration.command.status", "/api/integration/:integrationID/connect/command/:attemptID", {
115
+ params: { integrationID: Integration.ID, attemptID: Integration.AttemptID },
116
+ query: LocationQuery,
117
+ success: Location.response(Integration.CommandAttemptStatus),
118
+ })
119
+ .annotateMerge(locationQueryOpenApi)
120
+ .annotateMerge(OpenApi.annotations({
121
+ identifier: "v2.integration.command.status",
122
+ summary: "Get command attempt status",
123
+ description: "Poll the current status and output of a command authentication attempt.",
124
+ })))
125
+ .add(HttpApiEndpoint.delete("integration.command.cancel", "/api/integration/:integrationID/connect/command/:attemptID", {
126
+ params: { integrationID: Integration.ID, attemptID: Integration.AttemptID },
127
+ query: LocationQuery,
128
+ success: HttpApiSchema.NoContent,
129
+ })
130
+ .annotateMerge(locationQueryOpenApi)
131
+ .annotateMerge(OpenApi.annotations({
132
+ identifier: "v2.integration.command.cancel",
133
+ summary: "Cancel command connection",
134
+ description: "Cancel a command authentication attempt and terminate its process.",
97
135
  })))
98
136
  .annotateMerge(OpenApi.annotations({ title: "integration", description: "Integration discovery and authentication routes." }));
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
3
  "name": "@opencode-ai/protocol",
4
- "version": "0.0.0-next-15625",
4
+ "version": "0.0.0-next-15626",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "repository": {
@@ -26,7 +26,7 @@
26
26
  "typecheck": "tsgo --noEmit"
27
27
  },
28
28
  "dependencies": {
29
- "@opencode-ai/schema": "0.0.0-next-15625",
29
+ "@opencode-ai/schema": "0.0.0-next-15626",
30
30
  "effect": "4.0.0-beta.83"
31
31
  },
32
32
  "devDependencies": {