@opencode/client 2.1.3 → 2.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.
Files changed (76) hide show
  1. package/dist/chunks/service-timing-6mq2wh8y.js +33 -0
  2. package/dist/chunks/{service-probe-y2etg5bs.js → service-timing-7f0py9js.js} +2 -2
  3. package/dist/chunks/{service-probe-ezt8t3fk.js → service-timing-8we1dz3p.js} +6 -2
  4. package/dist/chunks/{service-probe-8ye1ye6f.js → service-timing-8ye1ye6f.js} +2 -2
  5. package/dist/chunks/{service-probe-6vp15eh6.js → service-timing-ab9bm97w.js} +1 -1
  6. package/dist/chunks/service-timing-b80wmp2t.js +30 -0
  7. package/dist/chunks/{service-probe-61wt4y9h.js → service-timing-cyxwqteg.js} +111 -75
  8. package/dist/chunks/{service-probe-8bbb028w.js → service-timing-gecjxyvt.js} +5 -1
  9. package/dist/chunks/{service-probe-xwk4fryp.js → service-timing-jpd9ebw3.js} +17 -17
  10. package/dist/chunks/{service-probe-nwcpakzx.js → service-timing-js54wxgp.js} +2 -2
  11. package/dist/chunks/{service-probe-v1n69e13.js → service-timing-knyqkv17.js} +8 -2
  12. package/dist/chunks/{service-probe-9j12j8xw.js → service-timing-myz4ngx9.js} +5 -5
  13. package/dist/chunks/{service-probe-5r97ebd4.js → service-timing-rxd7awy0.js} +59 -22
  14. package/dist/chunks/{service-probe-ryy6kscr.js → service-timing-ryy6kscr.js} +1 -1
  15. package/dist/chunks/{service-probe-g22sa7qz.js → service-timing-wcsbjfhx.js} +129 -36
  16. package/dist/contract.js +1 -1
  17. package/dist/effect/api/api.d.ts +104 -14
  18. package/dist/effect/api.d.ts +1 -0
  19. package/dist/effect/client.d.ts +901 -885
  20. package/dist/effect/client.js +12 -12
  21. package/dist/effect/generated/client-error.js +3 -3
  22. package/dist/effect/generated/client.d.ts +515 -503
  23. package/dist/effect/generated/client.js +5 -5
  24. package/dist/effect/generated/index.js +8 -8
  25. package/dist/effect/index.js +12 -12
  26. package/dist/effect/rpc.js +4 -4
  27. package/dist/effect/service.d.ts +1 -1
  28. package/dist/effect/service.js +11 -11
  29. package/dist/mcp.d.ts +44 -0
  30. package/dist/mcp.js +110 -0
  31. package/dist/promise/api.d.ts +1 -0
  32. package/dist/promise/client.d.ts +16 -5
  33. package/dist/promise/client.js +11 -11
  34. package/dist/promise/generated/client-error.js +3 -3
  35. package/dist/promise/generated/client.d.ts +17 -6
  36. package/dist/promise/generated/client.js +4 -4
  37. package/dist/promise/generated/index.js +17 -9
  38. package/dist/promise/generated/types.d.ts +1165 -3509
  39. package/dist/promise/generated/types.js +10 -2
  40. package/dist/promise/index.d.ts +1 -0
  41. package/dist/promise/index.js +21 -13
  42. package/dist/promise/rpc.js +2 -2
  43. package/dist/promise/service.d.ts +2 -2
  44. package/dist/promise/service.js +12 -11
  45. package/dist/pty-handoff.js +4 -1
  46. package/dist/rpc-runtime.js +1 -1
  47. package/dist/service-contender.js +1 -1
  48. package/dist/service-probe.js +3 -3
  49. package/dist/service-timing.js +1 -1
  50. package/dist/service-version.js +1 -1
  51. package/dist/service.js +1 -1
  52. package/dist/shared-events.d.ts +7 -2
  53. package/dist/shared-events.js +1 -1
  54. package/dist/solid/connection.js +1 -1
  55. package/dist/solid/data.d.ts +11 -1
  56. package/dist/solid/data.js +9 -9
  57. package/dist/solid/index.d.ts +1 -0
  58. package/dist/solid/index.js +16 -12
  59. package/dist/solid/pty.js +1 -1
  60. package/dist/solid/retention.d.ts +10 -0
  61. package/dist/solid/retention.js +6 -0
  62. package/dist/solid/usage.js +1 -1
  63. package/package.json +15 -8
  64. package/dist/chunks/service-probe-9p0yrv34.js +0 -30
  65. /package/dist/chunks/{service-probe-6mptkzbc.js → service-timing-6mptkzbc.js} +0 -0
  66. /package/dist/chunks/{service-probe-8s2anffy.js → service-timing-8s2anffy.js} +0 -0
  67. /package/dist/chunks/{service-probe-9rqn6x4v.js → service-timing-9rqn6x4v.js} +0 -0
  68. /package/dist/chunks/{service-probe-gne7h7mq.js → service-timing-gne7h7mq.js} +0 -0
  69. /package/dist/chunks/{service-probe-m2eywc8w.js → service-timing-m2eywc8w.js} +0 -0
  70. /package/dist/chunks/{service-probe-qav6mfdz.js → service-timing-qav6mfdz.js} +0 -0
  71. /package/dist/chunks/{service-probe-sxt88q69.js → service-timing-sxt88q69.js} +0 -0
  72. /package/dist/chunks/{service-probe-ve4aws36.js → service-timing-ve4aws36.js} +0 -0
  73. /package/dist/chunks/{service-probe-vmytr4q8.js → service-timing-vmytr4q8.js} +0 -0
  74. /package/dist/chunks/{service-probe-vyas3vgt.js → service-timing-vyas3vgt.js} +0 -0
  75. /package/dist/chunks/{service-probe-xgnj2w4v.js → service-timing-xgnj2w4v.js} +0 -0
  76. /package/dist/chunks/{service-probe-ydhz1zrh.js → service-timing-ydhz1zrh.js} +0 -0
@@ -1,5 +1,5 @@
1
1
  // src/promise/generated/client-error.ts
2
- class ClientError3 extends Error {
2
+ class ClientError2 extends Error {
3
3
  reason;
4
4
  name = "ClientError";
5
5
  constructor(reason, options) {
@@ -9,4 +9,4 @@ class ClientError3 extends Error {
9
9
  }
10
10
  }
11
11
 
12
- export { ClientError3 };
12
+ export { ClientError2 };
@@ -1,6 +1,9 @@
1
+ import {
2
+ headers2
3
+ } from "./service-timing-8ye1ye6f.js";
1
4
  import {
2
5
  __export
3
- } from "./service-probe-9rqn6x4v.js";
6
+ } from "./service-timing-9rqn6x4v.js";
4
7
 
5
8
  // src/pty-handoff.ts
6
9
  var exports_pty_handoff = {};
@@ -19,7 +22,10 @@ async function prepare2(file, info, timeout) {
19
22
  const { OpenCode } = await import("../promise/index.js");
20
23
  const client = OpenCode.make({
21
24
  baseUrl: info.url,
22
- headers: info.password === undefined ? undefined : { authorization: "Basic " + Buffer.from(`opencode:${info.password}`).toString("base64") }
25
+ headers: headers2({
26
+ url: info.url,
27
+ auth: info.password === undefined ? undefined : { type: "basic", username: "opencode", password: info.password }
28
+ })
23
29
  });
24
30
  const handoff = await client.experimental.persistentPty.handoff({ signal: AbortSignal.timeout(timeout) }).then(parse).catch(async (cause) => {
25
31
  const concurrent = await read(file);
@@ -3,20 +3,20 @@ import {
3
3
  readError2,
4
4
  event2,
5
5
  eventType2
6
- } from "./service-probe-ryy6kscr.js";
6
+ } from "./service-timing-ryy6kscr.js";
7
7
  import {
8
8
  __export
9
- } from "./service-probe-9rqn6x4v.js";
9
+ } from "./service-timing-9rqn6x4v.js";
10
10
 
11
11
  // src/effect/rpc.ts
12
12
  var exports_rpc = {};
13
13
  __export(exports_rpc, {
14
14
  RpcClientRuntime: () => exports_rpc,
15
15
  aborted: () => aborted2,
16
- make: () => make4
16
+ make: () => make6
17
17
  });
18
18
  import { Effect, Stream } from "effect";
19
- function make4(call, subscribe) {
19
+ function make6(call, subscribe) {
20
20
  return (definition) => {
21
21
  const methods = Object.fromEntries(Object.entries(definition.methods).map(([name, method]) => [
22
22
  name,
@@ -59,4 +59,4 @@ function aborted2(signal) {
59
59
  });
60
60
  }
61
61
 
62
- export { make4, aborted2, exports_rpc };
62
+ export { make6, aborted2, exports_rpc };
@@ -1,23 +1,23 @@
1
1
  import {
2
2
  ClientApi2
3
- } from "./service-probe-vmytr4q8.js";
3
+ } from "./service-timing-vmytr4q8.js";
4
4
  import {
5
- ClientError2
6
- } from "./service-probe-y2etg5bs.js";
5
+ ClientError3
6
+ } from "./service-timing-7f0py9js.js";
7
7
  import {
8
8
  __export
9
- } from "./service-probe-9rqn6x4v.js";
9
+ } from "./service-timing-9rqn6x4v.js";
10
10
 
11
11
  // src/effect/generated/client.ts
12
- var exports_client2 = {};
13
- __export(exports_client2, {
14
- make: () => make3
12
+ var exports_client4 = {};
13
+ __export(exports_client4, {
14
+ make: () => make5
15
15
  });
16
16
  import { Effect, Stream, Schema } from "effect";
17
17
  import { Sse } from "effect/encoding";
18
18
  import { HttpClientError } from "effect/http";
19
19
  import { HttpApiClient } from "effect/http-api";
20
- var mapClientError = (error) => HttpClientError.isHttpClientError(error) || Schema.isSchemaError(error) || Sse.Retry.is(error) ? new ClientError2({ cause: error }) : error;
20
+ var mapClientError = (error) => HttpClientError.isHttpClientError(error) || Schema.isSchemaError(error) || Sse.Retry.is(error) ? new ClientError3({ cause: error }) : error;
21
21
  var preserveEffect = () => (effect) => effect;
22
22
  var preserveStream = () => (stream) => stream;
23
23
  var EndpointServerInfo = (raw) => () => preserveEffect()(raw["server.info"]({}).pipe(Effect.mapError(mapClientError)));
@@ -41,10 +41,12 @@ var adaptGroupAgent = (raw) => ({
41
41
  get: EndpointAgentGet(raw)
42
42
  });
43
43
  var EndpointPluginList = (raw) => (input) => preserveEffect()(raw["plugin.list"]({ query: { location: input?.["location"] } }).pipe(Effect.mapError(mapClientError)));
44
+ var EndpointPluginGui = (raw) => (input) => preserveEffect()(raw["plugin.gui"]({ query: { location: input["location"], id: input["id"] } }).pipe(Effect.mapError(mapClientError)));
44
45
  var EndpointPluginCheck = (raw) => (input) => preserveEffect()(raw["plugin.check"]({ query: { location: input?.["location"] }, payload: { target: input?.["target"] } }).pipe(Effect.mapError(mapClientError)));
45
46
  var EndpointPluginUpdate = (raw) => (input) => preserveEffect()(raw["plugin.update"]({ query: { location: input["location"] }, payload: { targets: input["targets"] } }).pipe(Effect.mapError(mapClientError)));
46
47
  var adaptGroupPlugin = (raw) => ({
47
48
  list: EndpointPluginList(raw),
49
+ gui: EndpointPluginGui(raw),
48
50
  check: EndpointPluginCheck(raw),
49
51
  update: EndpointPluginUpdate(raw)
50
52
  });
@@ -263,26 +265,38 @@ var EndpointMessageList = (raw) => (input) => preserveEffect()(raw["session.mess
263
265
  query: { limit: input["limit"], order: input["order"], cursor: input["cursor"], type: input["type"] }
264
266
  }).pipe(Effect.mapError(mapClientError)));
265
267
  var adaptGroupMessage = (raw) => ({ list: EndpointMessageList(raw) });
266
- var EndpointModelList = (raw) => (input) => preserveEffect()(raw["model.list"]({ query: { location: input?.["location"] } }).pipe(Effect.mapError(mapClientError)));
268
+ var EndpointModelList = (raw) => (input) => preserveEffect()(raw["model.list"]({ query: { location: input?.["location"], types: input?.["types"] } }).pipe(Effect.mapError(mapClientError)));
267
269
  var EndpointModelDefault = (raw) => (input) => preserveEffect()(raw["model.default"]({ query: { location: input?.["location"] } }).pipe(Effect.mapError(mapClientError)));
268
270
  var adaptGroupModel = (raw) => ({
269
271
  list: EndpointModelList(raw),
270
272
  default: EndpointModelDefault(raw)
271
273
  });
272
274
  var EndpointGenerateText = (raw) => (input) => preserveEffect()(raw["generate.text"]({ payload: { prompt: input["prompt"], model: input["model"] } }).pipe(Effect.mapError(mapClientError), Effect.map((value) => value.data)));
273
- var adaptGroupGenerate = (raw) => ({ text: EndpointGenerateText(raw) });
275
+ var EndpointGenerateImage = (raw) => (input) => preserveEffect()(raw["generate.image"]({
276
+ payload: {
277
+ model: input["model"],
278
+ prompt: input["prompt"],
279
+ images: input["images"],
280
+ n: input["n"],
281
+ aspect: input["aspect"],
282
+ resolution: input["resolution"]
283
+ }
284
+ }).pipe(Effect.mapError(mapClientError), Effect.map((value) => value.data)));
285
+ var EndpointGenerateDecisions = (raw) => (input) => preserveEffect()(raw["generate.decisions"]({
286
+ payload: { model: input["model"], input: input["input"], questions: input["questions"] }
287
+ }).pipe(Effect.mapError(mapClientError), Effect.map((value) => value.data)));
288
+ var adaptGroupGenerate = (raw) => ({
289
+ text: EndpointGenerateText(raw),
290
+ image: EndpointGenerateImage(raw),
291
+ decisions: EndpointGenerateDecisions(raw)
292
+ });
274
293
  var EndpointVoiceModels = (raw) => () => preserveEffect()(raw["voice.models"]({}).pipe(Effect.mapError(mapClientError), Effect.map((value) => value.data)));
275
294
  var EndpointVoiceSession = (raw) => (input) => preserveEffect()(raw["voice.session"]({
276
295
  payload: { model: input["model"], session: input["session"], transport: input["transport"] }
277
296
  }).pipe(Effect.mapError(mapClientError), Effect.map((value) => value.data)));
278
- var EndpointVoiceInstructions = (raw) => (input) => preserveEffect()(raw["voice.instructions"]({
279
- params: { sessionID: input["sessionID"] },
280
- payload: { instructions: input["instructions"] }
281
- }).pipe(Effect.mapError(mapClientError)));
282
297
  var adaptGroupVoice = (raw) => ({
283
298
  models: EndpointVoiceModels(raw),
284
- session: EndpointVoiceSession(raw),
285
- instructions: EndpointVoiceInstructions(raw)
299
+ session: EndpointVoiceSession(raw)
286
300
  });
287
301
  var EndpointProviderList = (raw) => (input) => preserveEffect()(raw["provider.list"]({ query: { location: input?.["location"] } }).pipe(Effect.mapError(mapClientError)));
288
302
  var EndpointProviderGet = (raw) => (input) => preserveEffect()(raw["provider.get"]({ params: { providerID: input["providerID"] }, query: { location: input["location"] } }).pipe(Effect.mapError(mapClientError)));
@@ -364,13 +378,18 @@ var EndpointMcpRemove = (raw) => (input) => preserveEffect()(raw["mcp.remove"]({
364
378
  var EndpointMcpConnect = (raw) => (input) => preserveEffect()(raw["mcp.connect"]({ params: { server: input["server"] }, query: { location: input["location"] } }).pipe(Effect.mapError(mapClientError)));
365
379
  var EndpointMcpDisconnect = (raw) => (input) => preserveEffect()(raw["mcp.disconnect"]({ params: { server: input["server"] }, query: { location: input["location"] } }).pipe(Effect.mapError(mapClientError)));
366
380
  var EndpointMcpResourceCatalog = (raw) => (input) => preserveEffect()(raw["mcp.resource.catalog"]({ query: { location: input?.["location"] } }).pipe(Effect.mapError(mapClientError)));
381
+ var EndpointMcpClientToken = (raw) => (input) => preserveEffect()(raw["mcp.clientToken"]({
382
+ query: { location: input["location"], name: input["name"] },
383
+ headers: { "x-opencode-ticket": input["x-opencode-ticket"] }
384
+ }).pipe(Effect.mapError(mapClientError)));
367
385
  var adaptGroupMcp = (raw) => ({
368
386
  list: EndpointMcpList(raw),
369
387
  add: EndpointMcpAdd(raw),
370
388
  remove: EndpointMcpRemove(raw),
371
389
  connect: EndpointMcpConnect(raw),
372
390
  disconnect: EndpointMcpDisconnect(raw),
373
- resource: { catalog: EndpointMcpResourceCatalog(raw) }
391
+ resource: { catalog: EndpointMcpResourceCatalog(raw) },
392
+ client: { token: EndpointMcpClientToken(raw) }
374
393
  });
375
394
  var EndpointCredentialList = (raw) => () => preserveEffect()(raw["credential.list"]({}).pipe(Effect.mapError(mapClientError), Effect.map((value) => value.data)));
376
395
  var EndpointCredentialCreate = (raw) => (input) => preserveEffect()(raw["credential.create"]({
@@ -447,7 +466,14 @@ var EndpointFileList = (raw) => (input) => preserveEffect()(raw["fs.list"]({ que
447
466
  var EndpointFileFind = (raw) => (input) => preserveEffect()(raw["fs.find"]({
448
467
  query: { location: input["location"], query: input["query"], type: input["type"], limit: input["limit"] }
449
468
  }).pipe(Effect.mapError(mapClientError)));
450
- var adaptGroupFile = (raw) => ({ list: EndpointFileList(raw), find: EndpointFileFind(raw) });
469
+ var EndpointFileWatch = (raw) => (input) => preserveEffect()(raw["fs.watch"]({ query: { location: input["location"] }, payload: { path: input["path"] } }).pipe(Effect.mapError(mapClientError)));
470
+ var EndpointFileUnwatch = (raw) => (input) => preserveEffect()(raw["fs.unwatch"]({ query: { location: input["location"] }, payload: { path: input["path"] } }).pipe(Effect.mapError(mapClientError)));
471
+ var adaptGroupFile = (raw) => ({
472
+ list: EndpointFileList(raw),
473
+ find: EndpointFileFind(raw),
474
+ watch: EndpointFileWatch(raw),
475
+ unwatch: EndpointFileUnwatch(raw)
476
+ });
451
477
  var EndpointCommandList = (raw) => (input) => preserveEffect()(raw["command.list"]({ query: { location: input?.["location"] } }).pipe(Effect.mapError(mapClientError)));
452
478
  var adaptGroupCommand = (raw) => ({ list: EndpointCommandList(raw) });
453
479
  var EndpointSkillList = (raw) => (input) => preserveEffect()(raw["skill.list"]({ query: { location: input?.["location"] } }).pipe(Effect.mapError(mapClientError)));
@@ -458,7 +484,7 @@ var EndpointRpcCall = (raw) => (input) => preserveEffect()(raw["rpc.call"]({
458
484
  payload: { input: input["input"] }
459
485
  }).pipe(Effect.mapError(mapClientError)));
460
486
  var adaptGroupRpc = (raw) => ({ call: EndpointRpcCall(raw) });
461
- var EndpointEventSubscribe = (raw) => () => preserveStream()(Stream.unwrap(raw["event.subscribe"]({}).pipe(Effect.mapError(mapClientError), Effect.map((stream) => stream.pipe(Stream.mapError(mapClientError))))));
487
+ var EndpointEventSubscribe = (raw) => (input) => preserveStream()(Stream.unwrap(raw["event.subscribe"]({ query: { types: input?.["types"] } }).pipe(Effect.mapError(mapClientError), Effect.map((stream) => stream.pipe(Stream.mapError(mapClientError))))));
462
488
  var adaptGroupEvent = (raw) => ({ subscribe: EndpointEventSubscribe(raw) });
463
489
  var EndpointPtyList = (raw) => (input) => preserveEffect()(raw["pty.list"]({ query: { location: input?.["location"] } }).pipe(Effect.mapError(mapClientError)));
464
490
  var EndpointPtyCreate = (raw) => (input) => preserveEffect()(raw["pty.create"]({
@@ -579,7 +605,13 @@ var EndpointVcsBranchList = (raw) => (input) => preserveEffect()(raw["vcs.branch
579
605
  query: { location: input?.["location"], search: input?.["search"], limit: input?.["limit"] }
580
606
  }).pipe(Effect.mapError(mapClientError)));
581
607
  var EndpointVcsDiff = (raw) => (input) => preserveEffect()(raw["vcs.diff"]({
582
- query: { location: input["location"], mode: input["mode"], base: input["base"], context: input["context"] }
608
+ query: {
609
+ location: input["location"],
610
+ mode: input["mode"],
611
+ base: input["base"],
612
+ context: input["context"],
613
+ untracked: input["untracked"]
614
+ }
583
615
  }).pipe(Effect.mapError(mapClientError)));
584
616
  var adaptGroupVcs = (raw) => ({
585
617
  init: EndpointVcsInit(raw),
@@ -589,9 +621,11 @@ var adaptGroupVcs = (raw) => ({
589
621
  branch: { list: EndpointVcsBranchList(raw) },
590
622
  diff: EndpointVcsDiff(raw)
591
623
  });
624
+ var EndpointDebugHeapDump = (raw) => (input) => preserveEffect()(raw["debug.heapDump"]({ query: { directory: input?.["directory"] } }).pipe(Effect.mapError(mapClientError)));
592
625
  var EndpointDebugLocationList = (raw) => () => preserveEffect()(raw["debug.location"]({}).pipe(Effect.mapError(mapClientError)));
593
626
  var EndpointDebugLocationEvict = (raw) => (input) => preserveEffect()(raw["debug.location.evict"]({ query: { location: input?.["location"] } }).pipe(Effect.mapError(mapClientError)));
594
627
  var adaptGroupDebug = (raw) => ({
628
+ heapDump: EndpointDebugHeapDump(raw),
595
629
  location: { list: EndpointDebugLocationList(raw), evict: EndpointDebugLocationEvict(raw) }
596
630
  });
597
631
  var EndpointMigrationV1Status = (raw) => () => preserveEffect()(raw["migration.v1.status"]({}).pipe(Effect.mapError(mapClientError)));
@@ -605,6 +639,8 @@ var adaptGroupWebsearch = (raw) => ({
605
639
  providers: EndpointWebsearchProviders(raw),
606
640
  query: EndpointWebsearchQuery(raw)
607
641
  });
642
+ var EndpointUsageLimits = (raw) => (input) => preserveEffect()(raw["usage.limits"]({ query: { location: input?.["location"] } }).pipe(Effect.mapError(mapClientError)));
643
+ var adaptGroupUsage = (raw) => ({ limits: EndpointUsageLimits(raw) });
608
644
  var EndpointConfigGet = (raw) => (input) => preserveEffect()(raw["config.get"]({ query: { location: input?.["location"] } }).pipe(Effect.mapError(mapClientError)));
609
645
  var EndpointConfigShells = (raw) => () => preserveEffect()(raw["config.shells"]({}).pipe(Effect.mapError(mapClientError)));
610
646
  var EndpointConfigUpdate = (raw) => (input) => preserveEffect()(raw["config.update"]({ payload: { shell: input["shell"] } }).pipe(Effect.mapError(mapClientError)));
@@ -644,8 +680,9 @@ var adaptClient = (raw) => ({
644
680
  debug: adaptGroupDebug(raw["server.debug"]),
645
681
  migration: adaptGroupMigration(raw["server.migration"]),
646
682
  websearch: adaptGroupWebsearch(raw["server.websearch"]),
683
+ usage: adaptGroupUsage(raw["server.usage"]),
647
684
  config: adaptGroupConfig(raw["server.config"])
648
685
  });
649
- var make3 = (options) => HttpApiClient.make(ClientApi2, options).pipe(Effect.map(adaptClient));
686
+ var make5 = (options) => HttpApiClient.make(ClientApi2, options).pipe(Effect.map(adaptClient));
650
687
 
651
- export { make3, exports_client2 };
688
+ export { make5, exports_client4 };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  __export
3
- } from "./service-probe-9rqn6x4v.js";
3
+ } from "./service-timing-9rqn6x4v.js";
4
4
 
5
5
  // src/rpc-runtime.ts
6
6
  var exports_rpc_runtime = {};
@@ -1,17 +1,17 @@
1
1
  import {
2
- ClientError3
3
- } from "./service-probe-nwcpakzx.js";
2
+ ClientError2
3
+ } from "./service-timing-js54wxgp.js";
4
4
  import {
5
5
  __export
6
- } from "./service-probe-9rqn6x4v.js";
6
+ } from "./service-timing-9rqn6x4v.js";
7
7
 
8
8
  // src/promise/generated/client.ts
9
- var exports_client4 = {};
10
- __export(exports_client4, {
11
- make: () => make6
9
+ var exports_client2 = {};
10
+ __export(exports_client2, {
11
+ make: () => make3
12
12
  });
13
13
  var maxSseEventBytes = 16 * 1024 * 1024;
14
- function make6(options) {
14
+ function make3(options) {
15
15
  const fetch = options.fetch ?? globalThis.fetch;
16
16
  const prepare = (descriptor, requestOptions) => {
17
17
  const baseUrl = new URL(options.baseUrl);
@@ -44,7 +44,7 @@ function make6(options) {
44
44
  const prepared = prepare(descriptor, requestOptions);
45
45
  return await fetch(prepared.url, prepared.init);
46
46
  } catch (cause) {
47
- throw new ClientError3("Transport", { cause });
47
+ throw new ClientError2("Transport", { cause });
48
48
  }
49
49
  };
50
50
  const responseError = async (response, descriptor) => {
@@ -53,7 +53,7 @@ function make6(options) {
53
53
  try {
54
54
  await response.body?.cancel();
55
55
  } catch {}
56
- throw new ClientError3("UnexpectedStatus", { cause: { status: response.status }, detail: String(response.status) });
56
+ throw new ClientError2("UnexpectedStatus", { cause: { status: response.status }, detail: String(response.status) });
57
57
  };
58
58
  const request = async (descriptor, requestOptions) => {
59
59
  const response = await execute(descriptor, requestOptions);
@@ -78,10 +78,10 @@ function make6(options) {
78
78
  try {
79
79
  await response.body?.cancel();
80
80
  } catch {}
81
- throw new ClientError3("UnsupportedContentType", { detail: response.headers.get("content-type") });
81
+ throw new ClientError2("UnsupportedContentType", { detail: response.headers.get("content-type") });
82
82
  }
83
83
  if (response.body === null)
84
- throw new ClientError3("MalformedResponse");
84
+ throw new ClientError2("MalformedResponse");
85
85
  const reader = response.body.getReader();
86
86
  const decoder = new TextDecoder;
87
87
  let buffer = "";
@@ -91,13 +91,13 @@ function make6(options) {
91
91
  try {
92
92
  next = await reader.read();
93
93
  } catch (cause) {
94
- throw new ClientError3("Transport", { cause });
94
+ throw new ClientError2("Transport", { cause });
95
95
  }
96
96
  if (!next.done)
97
97
  requestOptions?.onActivity?.();
98
98
  buffer += decoder.decode(next.value, { stream: !next.done });
99
99
  if (buffer.length > maxSseEventBytes)
100
- throw new ClientError3("SseEventTooLarge");
100
+ throw new ClientError2("SseEventTooLarge");
101
101
  const trailingCarriageReturn = !next.done && buffer.endsWith("\r");
102
102
  if (trailingCarriageReturn)
103
103
  buffer = buffer.slice(0, -1);
@@ -124,7 +124,7 @@ function make6(options) {
124
124
  try {
125
125
  yield JSON.parse(data);
126
126
  } catch (cause) {
127
- throw new ClientError3("MalformedResponse", { cause });
127
+ throw new ClientError2("MalformedResponse", { cause });
128
128
  }
129
129
  }
130
130
  boundary = buffer.indexOf(`
@@ -177,7 +177,7 @@ function make6(options) {
177
177
  path: `/api/agent`,
178
178
  query: { location: input?.["location"] },
179
179
  successStatus: 200,
180
- declaredStatuses: [400, 401, 404],
180
+ declaredStatuses: [400, 401, 404, 503],
181
181
  empty: false
182
182
  }, requestOptions),
183
183
  get: (input, requestOptions) => request({
@@ -198,6 +198,14 @@ function make6(options) {
198
198
  declaredStatuses: [400, 401, 404],
199
199
  empty: false
200
200
  }, requestOptions),
201
+ gui: (input, requestOptions) => request({
202
+ method: "GET",
203
+ path: `/api/plugin/gui`,
204
+ query: { location: input["location"], id: input["id"] },
205
+ successStatus: 200,
206
+ declaredStatuses: [400, 401, 404],
207
+ empty: false
208
+ }, requestOptions),
201
209
  check: (input, requestOptions) => request({
202
210
  method: "POST",
203
211
  path: `/api/plugin/check`,
@@ -627,7 +635,7 @@ function make6(options) {
627
635
  list: (input, requestOptions) => request({
628
636
  method: "GET",
629
637
  path: `/api/model`,
630
- query: { location: input?.["location"] },
638
+ query: { location: input?.["location"], types: input?.["types"] },
631
639
  successStatus: 200,
632
640
  declaredStatuses: [400, 401, 404, 503],
633
641
  empty: false
@@ -644,10 +652,33 @@ function make6(options) {
644
652
  generate: {
645
653
  text: (input, requestOptions) => request({
646
654
  method: "POST",
647
- path: `/api/experimental/generate`,
655
+ path: `/api/experimental/generate/text`,
648
656
  body: { prompt: input["prompt"], model: input["model"] },
649
657
  successStatus: 200,
650
- declaredStatuses: [400, 401, 404, 503],
658
+ declaredStatuses: [400, 401, 404, 422, 502, 503],
659
+ empty: false
660
+ }, requestOptions).then((value) => value.data),
661
+ image: (input, requestOptions) => request({
662
+ method: "POST",
663
+ path: `/api/experimental/generate/image`,
664
+ body: {
665
+ model: input["model"],
666
+ prompt: input["prompt"],
667
+ images: input["images"],
668
+ n: input["n"],
669
+ aspect: input["aspect"],
670
+ resolution: input["resolution"]
671
+ },
672
+ successStatus: 200,
673
+ declaredStatuses: [400, 401, 404, 422, 502, 503],
674
+ empty: false
675
+ }, requestOptions).then((value) => value.data),
676
+ decisions: (input, requestOptions) => request({
677
+ method: "POST",
678
+ path: `/api/experimental/generate/decisions`,
679
+ body: { model: input["model"], input: input["input"], questions: input["questions"] },
680
+ successStatus: 200,
681
+ declaredStatuses: [400, 401, 404, 422, 502, 503],
651
682
  empty: false
652
683
  }, requestOptions).then((value) => value.data)
653
684
  },
@@ -666,15 +697,7 @@ function make6(options) {
666
697
  successStatus: 200,
667
698
  declaredStatuses: [400, 401, 404, 503],
668
699
  empty: false
669
- }, requestOptions).then((value) => value.data),
670
- instructions: (input, requestOptions) => request({
671
- method: "POST",
672
- path: `/api/experimental/voice/session/${encodeURIComponent(input.sessionID)}/instructions`,
673
- body: { instructions: input["instructions"] },
674
- successStatus: 204,
675
- declaredStatuses: [400, 401, 404, 503],
676
- empty: true
677
- }, requestOptions)
700
+ }, requestOptions).then((value) => value.data)
678
701
  },
679
702
  provider: {
680
703
  list: (input, requestOptions) => request({
@@ -857,6 +880,17 @@ function make6(options) {
857
880
  declaredStatuses: [400, 401, 404],
858
881
  empty: false
859
882
  }, requestOptions)
883
+ },
884
+ client: {
885
+ token: (input, requestOptions) => request({
886
+ method: "POST",
887
+ path: `/api/experimental/client-mcp/token`,
888
+ query: { location: input["location"], name: input["name"] },
889
+ headers: { "x-opencode-ticket": input["x-opencode-ticket"] },
890
+ successStatus: 200,
891
+ declaredStatuses: [400, 401, 403, 404],
892
+ empty: false
893
+ }, requestOptions)
860
894
  }
861
895
  },
862
896
  credential: {
@@ -904,7 +938,7 @@ function make6(options) {
904
938
  path: `/api/project`,
905
939
  query: { archived: input?.["archived"] },
906
940
  successStatus: 200,
907
- declaredStatuses: [400, 401, 404],
941
+ declaredStatuses: [400, 401],
908
942
  empty: false
909
943
  }, requestOptions),
910
944
  update: (input, requestOptions) => request({
@@ -963,7 +997,7 @@ function make6(options) {
963
997
  method: "DELETE",
964
998
  path: `/api/permission/saved/${encodeURIComponent(input.id)}`,
965
999
  successStatus: 204,
966
- declaredStatuses: [400, 401, 404],
1000
+ declaredStatuses: [400, 401],
967
1001
  empty: true
968
1002
  }, requestOptions)
969
1003
  },
@@ -1041,6 +1075,24 @@ function make6(options) {
1041
1075
  declaredStatuses: [400, 401, 404],
1042
1076
  empty: false,
1043
1077
  binaryBody: true
1078
+ }, requestOptions),
1079
+ watch: (input, requestOptions) => request({
1080
+ method: "POST",
1081
+ path: `/api/experimental/fs/watch`,
1082
+ query: { location: input["location"] },
1083
+ body: { path: input["path"] },
1084
+ successStatus: 204,
1085
+ declaredStatuses: [400, 401, 404, 503],
1086
+ empty: true
1087
+ }, requestOptions),
1088
+ unwatch: (input, requestOptions) => request({
1089
+ method: "DELETE",
1090
+ path: `/api/experimental/fs/watch`,
1091
+ query: { location: input["location"] },
1092
+ body: { path: input["path"] },
1093
+ successStatus: 204,
1094
+ declaredStatuses: [400, 401, 404],
1095
+ empty: true
1044
1096
  }, requestOptions)
1045
1097
  },
1046
1098
  command: {
@@ -1075,7 +1127,14 @@ function make6(options) {
1075
1127
  }, requestOptions)
1076
1128
  },
1077
1129
  event: {
1078
- subscribe: (requestOptions) => sse({ method: "GET", path: `/api/event`, successStatus: 200, declaredStatuses: [400, 401], empty: false }, requestOptions)
1130
+ subscribe: (input, requestOptions) => sse({
1131
+ method: "GET",
1132
+ path: `/api/event`,
1133
+ query: { types: input?.["types"] },
1134
+ successStatus: 200,
1135
+ declaredStatuses: [400, 401],
1136
+ empty: false
1137
+ }, requestOptions)
1079
1138
  },
1080
1139
  pty: {
1081
1140
  list: (input, requestOptions) => request({
@@ -1221,6 +1280,16 @@ function make6(options) {
1221
1280
  declaredStatuses: [400, 401, 403, 404, 503],
1222
1281
  empty: false
1223
1282
  }, requestOptions).then((value) => value.data)
1283
+ },
1284
+ media: {
1285
+ get: (input, requestOptions) => request({
1286
+ method: "GET",
1287
+ path: `/api/experimental/media/${encodeURIComponent(input.hash)}`,
1288
+ successStatus: 200,
1289
+ declaredStatuses: [400, 401, 404],
1290
+ empty: false,
1291
+ binary: true
1292
+ }, requestOptions)
1224
1293
  }
1225
1294
  },
1226
1295
  shell: {
@@ -1367,13 +1436,27 @@ function make6(options) {
1367
1436
  diff: (input, requestOptions) => request({
1368
1437
  method: "GET",
1369
1438
  path: `/api/vcs/diff`,
1370
- query: { location: input["location"], mode: input["mode"], base: input["base"], context: input["context"] },
1439
+ query: {
1440
+ location: input["location"],
1441
+ mode: input["mode"],
1442
+ base: input["base"],
1443
+ context: input["context"],
1444
+ untracked: input["untracked"]
1445
+ },
1371
1446
  successStatus: 200,
1372
1447
  declaredStatuses: [400, 401, 404, 503],
1373
1448
  empty: false
1374
1449
  }, requestOptions)
1375
1450
  },
1376
1451
  debug: {
1452
+ heapDump: (input, requestOptions) => request({
1453
+ method: "POST",
1454
+ path: `/api/debug/heap-dump`,
1455
+ query: { directory: input?.["directory"] },
1456
+ successStatus: 200,
1457
+ declaredStatuses: [400, 401, 500],
1458
+ empty: false
1459
+ }, requestOptions),
1377
1460
  location: {
1378
1461
  list: (requestOptions) => request({
1379
1462
  method: "GET",
@@ -1422,6 +1505,16 @@ function make6(options) {
1422
1505
  empty: false
1423
1506
  }, requestOptions)
1424
1507
  },
1508
+ usage: {
1509
+ limits: (input, requestOptions) => request({
1510
+ method: "GET",
1511
+ path: `/api/experimental/usage/limits`,
1512
+ query: { location: input?.["location"] },
1513
+ successStatus: 200,
1514
+ declaredStatuses: [400, 401, 404, 503],
1515
+ empty: false
1516
+ }, requestOptions)
1517
+ },
1425
1518
  config: {
1426
1519
  get: (input, requestOptions) => request({
1427
1520
  method: "GET",
@@ -1476,20 +1569,20 @@ async function json(response) {
1476
1569
  try {
1477
1570
  await response.body?.cancel();
1478
1571
  } catch {}
1479
- throw new ClientError3("UnsupportedContentType", { detail: response.headers.get("content-type") });
1572
+ throw new ClientError2("UnsupportedContentType", { detail: response.headers.get("content-type") });
1480
1573
  }
1481
1574
  let text;
1482
1575
  try {
1483
1576
  text = await response.text();
1484
1577
  } catch (cause) {
1485
- throw new ClientError3("Transport", { cause });
1578
+ throw new ClientError2("Transport", { cause });
1486
1579
  }
1487
1580
  if (text === "")
1488
- throw new ClientError3("MalformedResponse");
1581
+ throw new ClientError2("MalformedResponse");
1489
1582
  try {
1490
1583
  return JSON.parse(text);
1491
1584
  } catch (cause) {
1492
- throw new ClientError3("MalformedResponse", { cause });
1585
+ throw new ClientError2("MalformedResponse", { cause });
1493
1586
  }
1494
1587
  }
1495
1588
  function declared(body) {
@@ -1502,4 +1595,4 @@ function isContentType(response, expected) {
1502
1595
  return response.headers.get("content-type")?.split(";", 1)[0]?.trim().toLowerCase() === expected;
1503
1596
  }
1504
1597
 
1505
- export { make6, exports_client4 };
1598
+ export { make3, exports_client2 };
package/dist/contract.js CHANGED
@@ -3,7 +3,7 @@ import {
3
3
  effectOmitEndpoints2,
4
4
  groupNames2,
5
5
  promiseOmitEndpoints2
6
- } from "./chunks/service-probe-vmytr4q8.js";
6
+ } from "./chunks/service-timing-vmytr4q8.js";
7
7
  export {
8
8
  ClientApi2 as ClientApi,
9
9
  effectOmitEndpoints2 as effectOmitEndpoints,