@opencode/server 2.0.19 → 2.0.21

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 (104) hide show
  1. package/dist/api.d.ts +65 -0
  2. package/dist/api.js +5 -5
  3. package/dist/auth.js +1 -1
  4. package/dist/chunks/{cors-7cv7ehbj.js → request-tracing-140y8w7p.js} +2 -2
  5. package/dist/chunks/{cors-kqk7gaza.js → request-tracing-26ta7ngt.js} +2 -2
  6. package/dist/chunks/{cors-bjvbqbss.js → request-tracing-2s2j0nb0.js} +16 -16
  7. package/dist/chunks/{cors-18fs6z6g.js → request-tracing-3atyrqsp.js} +4 -4
  8. package/dist/chunks/{cors-23w8t84j.js → request-tracing-3kzx88w9.js} +1 -1
  9. package/dist/chunks/{cors-11g6bym3.js → request-tracing-5bwq5cz2.js} +2 -2
  10. package/dist/chunks/{cors-frv6gfy7.js → request-tracing-5rwqcaw2.js} +1 -1
  11. package/dist/chunks/{cors-5w24ch67.js → request-tracing-5w24ch67.js} +1 -1
  12. package/dist/chunks/{cors-0ar9gf7q.js → request-tracing-6gkz39ey.js} +3 -3
  13. package/dist/chunks/{cors-0h6q40e6.js → request-tracing-6qwktr1g.js} +1 -1
  14. package/dist/chunks/{cors-sryvrekq.js → request-tracing-7eckj7zq.js} +2 -2
  15. package/dist/chunks/{cors-96sfj8c0.js → request-tracing-96s6m0w3.js} +2 -2
  16. package/dist/chunks/{cors-anm12x33.js → request-tracing-anm12x33.js} +1 -1
  17. package/dist/chunks/{cors-vjmrn89t.js → request-tracing-b1rdg9nf.js} +2 -2
  18. package/dist/chunks/{cors-bkk2wfbz.js → request-tracing-bkk2wfbz.js} +1 -1
  19. package/dist/chunks/{cors-2nzbqq6w.js → request-tracing-bmqkn4ah.js} +1 -1
  20. package/dist/chunks/{cors-scvg88rk.js → request-tracing-bt9tc5rb.js} +1 -1
  21. package/dist/chunks/{cors-kr61w04k.js → request-tracing-byt4hbw9.js} +7 -7
  22. package/dist/chunks/{cors-gj71xwag.js → request-tracing-cs3kpd5s.js} +3 -3
  23. package/dist/chunks/{cors-0658f5hp.js → request-tracing-ctscy0f5.js} +2 -2
  24. package/dist/chunks/request-tracing-e1j0tbav.js +47 -0
  25. package/dist/chunks/{cors-w5qev33e.js → request-tracing-ees77nh9.js} +2 -2
  26. package/dist/chunks/{cors-trr1emsb.js → request-tracing-f8rap8f6.js} +1 -1
  27. package/dist/chunks/{cors-kb2bv51q.js → request-tracing-fpwvrnjd.js} +31 -31
  28. package/dist/chunks/{cors-gtkdacvk.js → request-tracing-gtkdacvk.js} +1 -1
  29. package/dist/chunks/{cors-rn5anws3.js → request-tracing-haswyr8z.js} +2 -2
  30. package/dist/chunks/{cors-j4tb0vx8.js → request-tracing-hp5sxeae.js} +2 -2
  31. package/dist/chunks/{cors-pz0jzgeb.js → request-tracing-hr75rahr.js} +2 -2
  32. package/dist/chunks/{cors-y3nevpad.js → request-tracing-mb9kfqxc.js} +5 -5
  33. package/dist/chunks/{cors-rg7j7cph.js → request-tracing-np19kmxx.js} +2 -2
  34. package/dist/chunks/{cors-zhw07218.js → request-tracing-pme11y2y.js} +2 -2
  35. package/dist/chunks/{cors-39fhjz78.js → request-tracing-qj9kjxn3.js} +1 -1
  36. package/dist/chunks/{cors-5g4dhtjd.js → request-tracing-r2rnm758.js} +3 -3
  37. package/dist/chunks/{cors-5ybpxcad.js → request-tracing-rjpqaa8h.js} +6 -6
  38. package/dist/chunks/{cors-jk9mr6vp.js → request-tracing-rjqbhscq.js} +1 -1
  39. package/dist/chunks/{cors-2abmfsyh.js → request-tracing-s1re0xgr.js} +3 -3
  40. package/dist/chunks/{cors-a7ke583f.js → request-tracing-t88f2hhf.js} +3 -3
  41. package/dist/chunks/{cors-2b206wcs.js → request-tracing-v1emgcvb.js} +2 -2
  42. package/dist/chunks/{cors-t9jkrcq1.js → request-tracing-v305azr7.js} +4 -4
  43. package/dist/chunks/{cors-ar2c062s.js → request-tracing-v573ws0d.js} +3 -3
  44. package/dist/chunks/{cors-rrt24jy6.js → request-tracing-wz0qz28j.js} +2 -2
  45. package/dist/chunks/{cors-9aabh8fh.js → request-tracing-x5ncpjy3.js} +1 -1
  46. package/dist/chunks/{cors-ck9et5sk.js → request-tracing-y6ybxmgz.js} +6 -6
  47. package/dist/chunks/{cors-k9ssaf54.js → request-tracing-zpz5afwq.js} +2 -2
  48. package/dist/cors.js +1 -1
  49. package/dist/event-feed.js +3 -3
  50. package/dist/fetch.js +47 -47
  51. package/dist/handlers/agent.js +6 -6
  52. package/dist/handlers/command.js +6 -6
  53. package/dist/handlers/config.js +6 -6
  54. package/dist/handlers/credential.js +6 -6
  55. package/dist/handlers/debug.js +6 -6
  56. package/dist/handlers/event.js +7 -7
  57. package/dist/handlers/form.js +6 -6
  58. package/dist/handlers/fs.js +6 -6
  59. package/dist/handlers/generate.js +6 -6
  60. package/dist/handlers/integration.js +6 -6
  61. package/dist/handlers/location.js +6 -6
  62. package/dist/handlers/mcp.js +6 -6
  63. package/dist/handlers/message.js +6 -6
  64. package/dist/handlers/migration.js +6 -6
  65. package/dist/handlers/model.js +6 -6
  66. package/dist/handlers/permission.js +6 -6
  67. package/dist/handlers/persistent-pty.js +8 -8
  68. package/dist/handlers/plugin.js +6 -6
  69. package/dist/handlers/project.js +6 -6
  70. package/dist/handlers/provider.js +6 -6
  71. package/dist/handlers/pty-socket.js +1 -1
  72. package/dist/handlers/pty.js +9 -9
  73. package/dist/handlers/reference.js +6 -6
  74. package/dist/handlers/rpc.js +6 -6
  75. package/dist/handlers/server.js +9 -9
  76. package/dist/handlers/session-error.js +1 -1
  77. package/dist/handlers/session.js +6 -6
  78. package/dist/handlers/shell.js +6 -6
  79. package/dist/handlers/skill.js +6 -6
  80. package/dist/handlers/vcs.js +6 -6
  81. package/dist/handlers/websearch.js +6 -6
  82. package/dist/handlers/worktree.js +6 -6
  83. package/dist/handlers.js +43 -43
  84. package/dist/location.js +4 -4
  85. package/dist/middleware/authorization.js +2 -2
  86. package/dist/middleware/form-location.js +3 -3
  87. package/dist/middleware/schema-error.js +1 -1
  88. package/dist/middleware/session-location.js +3 -3
  89. package/dist/pairing.js +3 -3
  90. package/dist/process.js +49 -49
  91. package/dist/pty-environment.js +1 -1
  92. package/dist/request-tracing.js +1 -1
  93. package/dist/routes.js +46 -46
  94. package/dist/server-info.js +3 -3
  95. package/dist/service-status.js +1 -1
  96. package/dist/workerd.js +48 -48
  97. package/package.json +8 -8
  98. package/dist/chunks/cors-439ywa05.js +0 -23
  99. /package/dist/chunks/{cors-9rqn6x4v.js → request-tracing-9rqn6x4v.js} +0 -0
  100. /package/dist/chunks/{cors-hezj1jdf.js → request-tracing-hezj1jdf.js} +0 -0
  101. /package/dist/chunks/{cors-q4bn6dy8.js → request-tracing-q4bn6dy8.js} +0 -0
  102. /package/dist/chunks/{cors-smaf4a18.js → request-tracing-smaf4a18.js} +0 -0
  103. /package/dist/chunks/{cors-t8yzmczr.js → request-tracing-t8yzmczr.js} +0 -0
  104. /package/dist/chunks/{cors-yc7nft6q.js → request-tracing-yc7nft6q.js} +0 -0
package/dist/api.d.ts CHANGED
@@ -1933,6 +1933,11 @@ export declare const Api: import("@opencode/protocol/api").Api<LocationMiddlewar
1933
1933
  readonly type: import("effect/Schema").String;
1934
1934
  readonly message: import("effect/Schema").String;
1935
1935
  readonly status: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").Int>>, import("effect/Schema").optionalKey<import("effect/Schema").Int>, never, never>;
1936
+ readonly response: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").Struct<{
1937
+ readonly body: import("effect/Schema").String;
1938
+ }>>>, import("effect/Schema").optionalKey<import("effect/Schema").Struct<{
1939
+ readonly body: import("effect/Schema").String;
1940
+ }>>, never, never>;
1936
1941
  }>;
1937
1942
  readonly sessionID: import("effect/Schema").brand<import("effect/Schema").String, "SessionID"> & {
1938
1943
  create: () => string & import("effect/Brand").Brand<"SessionID">;
@@ -1951,6 +1956,11 @@ export declare const Api: import("@opencode/protocol/api").Api<LocationMiddlewar
1951
1956
  readonly type: import("effect/Schema").String;
1952
1957
  readonly message: import("effect/Schema").String;
1953
1958
  readonly status: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").Int>>, import("effect/Schema").optionalKey<import("effect/Schema").Int>, never, never>;
1959
+ readonly response: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").Struct<{
1960
+ readonly body: import("effect/Schema").String;
1961
+ }>>>, import("effect/Schema").optionalKey<import("effect/Schema").Struct<{
1962
+ readonly body: import("effect/Schema").String;
1963
+ }>>, never, never>;
1954
1964
  }>;
1955
1965
  readonly sessionID: import("effect/Schema").brand<import("effect/Schema").String, "SessionID"> & {
1956
1966
  create: () => string & import("effect/Brand").Brand<"SessionID">;
@@ -2663,6 +2673,11 @@ export declare const Api: import("@opencode/protocol/api").Api<LocationMiddlewar
2663
2673
  readonly type: import("effect/Schema").String;
2664
2674
  readonly message: import("effect/Schema").String;
2665
2675
  readonly status: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").Int>>, import("effect/Schema").optionalKey<import("effect/Schema").Int>, never, never>;
2676
+ readonly response: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").Struct<{
2677
+ readonly body: import("effect/Schema").String;
2678
+ }>>>, import("effect/Schema").optionalKey<import("effect/Schema").Struct<{
2679
+ readonly body: import("effect/Schema").String;
2680
+ }>>, never, never>;
2666
2681
  }>;
2667
2682
  readonly finish: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").Literals<readonly ["content-filter"]>>>, import("effect/Schema").optionalKey<import("effect/Schema").Literals<readonly ["content-filter"]>>, never, never>;
2668
2683
  readonly rawFinish: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").String>>, import("effect/Schema").optionalKey<import("effect/Schema").String>, never, never>;
@@ -2712,6 +2727,11 @@ export declare const Api: import("@opencode/protocol/api").Api<LocationMiddlewar
2712
2727
  readonly type: import("effect/Schema").String;
2713
2728
  readonly message: import("effect/Schema").String;
2714
2729
  readonly status: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").Int>>, import("effect/Schema").optionalKey<import("effect/Schema").Int>, never, never>;
2730
+ readonly response: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").Struct<{
2731
+ readonly body: import("effect/Schema").String;
2732
+ }>>>, import("effect/Schema").optionalKey<import("effect/Schema").Struct<{
2733
+ readonly body: import("effect/Schema").String;
2734
+ }>>, never, never>;
2715
2735
  }>;
2716
2736
  readonly finish: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").Literals<readonly ["content-filter"]>>>, import("effect/Schema").optionalKey<import("effect/Schema").Literals<readonly ["content-filter"]>>, never, never>;
2717
2737
  readonly rawFinish: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").String>>, import("effect/Schema").optionalKey<import("effect/Schema").String>, never, never>;
@@ -3521,6 +3541,11 @@ export declare const Api: import("@opencode/protocol/api").Api<LocationMiddlewar
3521
3541
  readonly type: import("effect/Schema").String;
3522
3542
  readonly message: import("effect/Schema").String;
3523
3543
  readonly status: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").Int>>, import("effect/Schema").optionalKey<import("effect/Schema").Int>, never, never>;
3544
+ readonly response: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").Struct<{
3545
+ readonly body: import("effect/Schema").String;
3546
+ }>>>, import("effect/Schema").optionalKey<import("effect/Schema").Struct<{
3547
+ readonly body: import("effect/Schema").String;
3548
+ }>>, never, never>;
3524
3549
  }>;
3525
3550
  readonly content: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").NonEmptyArray<import("effect/Schema").Union<readonly [import("effect/Schema").Struct<{
3526
3551
  readonly type: import("effect/Schema").Literal<"text">;
@@ -3564,6 +3589,11 @@ export declare const Api: import("@opencode/protocol/api").Api<LocationMiddlewar
3564
3589
  readonly type: import("effect/Schema").String;
3565
3590
  readonly message: import("effect/Schema").String;
3566
3591
  readonly status: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").Int>>, import("effect/Schema").optionalKey<import("effect/Schema").Int>, never, never>;
3592
+ readonly response: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").Struct<{
3593
+ readonly body: import("effect/Schema").String;
3594
+ }>>>, import("effect/Schema").optionalKey<import("effect/Schema").Struct<{
3595
+ readonly body: import("effect/Schema").String;
3596
+ }>>, never, never>;
3567
3597
  }>;
3568
3598
  readonly content: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").NonEmptyArray<import("effect/Schema").Union<readonly [import("effect/Schema").Struct<{
3569
3599
  readonly type: import("effect/Schema").Literal<"text">;
@@ -3637,6 +3667,11 @@ export declare const Api: import("@opencode/protocol/api").Api<LocationMiddlewar
3637
3667
  readonly type: import("effect/Schema").String;
3638
3668
  readonly message: import("effect/Schema").String;
3639
3669
  readonly status: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").Int>>, import("effect/Schema").optionalKey<import("effect/Schema").Int>, never, never>;
3670
+ readonly response: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").Struct<{
3671
+ readonly body: import("effect/Schema").String;
3672
+ }>>>, import("effect/Schema").optionalKey<import("effect/Schema").Struct<{
3673
+ readonly body: import("effect/Schema").String;
3674
+ }>>, never, never>;
3640
3675
  }>;
3641
3676
  readonly sessionID: import("effect/Schema").brand<import("effect/Schema").String, "SessionID"> & {
3642
3677
  create: () => string & import("effect/Brand").Brand<"SessionID">;
@@ -3661,6 +3696,11 @@ export declare const Api: import("@opencode/protocol/api").Api<LocationMiddlewar
3661
3696
  readonly type: import("effect/Schema").String;
3662
3697
  readonly message: import("effect/Schema").String;
3663
3698
  readonly status: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").Int>>, import("effect/Schema").optionalKey<import("effect/Schema").Int>, never, never>;
3699
+ readonly response: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").Struct<{
3700
+ readonly body: import("effect/Schema").String;
3701
+ }>>>, import("effect/Schema").optionalKey<import("effect/Schema").Struct<{
3702
+ readonly body: import("effect/Schema").String;
3703
+ }>>, never, never>;
3664
3704
  }>;
3665
3705
  readonly sessionID: import("effect/Schema").brand<import("effect/Schema").String, "SessionID"> & {
3666
3706
  create: () => string & import("effect/Brand").Brand<"SessionID">;
@@ -4102,6 +4142,11 @@ export declare const Api: import("@opencode/protocol/api").Api<LocationMiddlewar
4102
4142
  readonly type: import("effect/Schema").String;
4103
4143
  readonly message: import("effect/Schema").String;
4104
4144
  readonly status: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").Int>>, import("effect/Schema").optionalKey<import("effect/Schema").Int>, never, never>;
4145
+ readonly response: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").Struct<{
4146
+ readonly body: import("effect/Schema").String;
4147
+ }>>>, import("effect/Schema").optionalKey<import("effect/Schema").Struct<{
4148
+ readonly body: import("effect/Schema").String;
4149
+ }>>, never, never>;
4105
4150
  }>;
4106
4151
  readonly inputID: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").brand<import("effect/Schema").String, "Session.Message.ID"> & {
4107
4152
  create: () => string & import("effect/Brand").Brand<"Session.Message.ID">;
@@ -4150,6 +4195,11 @@ export declare const Api: import("@opencode/protocol/api").Api<LocationMiddlewar
4150
4195
  readonly type: import("effect/Schema").String;
4151
4196
  readonly message: import("effect/Schema").String;
4152
4197
  readonly status: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").Int>>, import("effect/Schema").optionalKey<import("effect/Schema").Int>, never, never>;
4198
+ readonly response: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").Struct<{
4199
+ readonly body: import("effect/Schema").String;
4200
+ }>>>, import("effect/Schema").optionalKey<import("effect/Schema").Struct<{
4201
+ readonly body: import("effect/Schema").String;
4202
+ }>>, never, never>;
4153
4203
  }>;
4154
4204
  readonly inputID: import("effect/Schema").decodeTo<import("effect/Schema").optional<import("effect/Schema").toType<import("effect/Schema").brand<import("effect/Schema").String, "Session.Message.ID"> & {
4155
4205
  create: () => string & import("effect/Brand").Brand<"Session.Message.ID">;
@@ -7245,6 +7295,9 @@ export declare const Api: import("@opencode/protocol/api").Api<LocationMiddlewar
7245
7295
  readonly type: string;
7246
7296
  readonly message: string;
7247
7297
  readonly status?: number | undefined;
7298
+ readonly response?: {
7299
+ readonly body: string;
7300
+ } | undefined;
7248
7301
  };
7249
7302
  readonly sessionID: string & import("effect/Brand").Brand<"SessionID">;
7250
7303
  };
@@ -7524,6 +7577,9 @@ export declare const Api: import("@opencode/protocol/api").Api<LocationMiddlewar
7524
7577
  readonly type: string;
7525
7578
  readonly message: string;
7526
7579
  readonly status?: number | undefined;
7580
+ readonly response?: {
7581
+ readonly body: string;
7582
+ } | undefined;
7527
7583
  };
7528
7584
  readonly assistantMessageID: string & import("effect/Brand").Brand<"Session.Message.ID">;
7529
7585
  readonly cost?: (number & import("effect/Brand").Brand<"Money.USD">) | undefined;
@@ -7849,6 +7905,9 @@ export declare const Api: import("@opencode/protocol/api").Api<LocationMiddlewar
7849
7905
  readonly type: string;
7850
7906
  readonly message: string;
7851
7907
  readonly status?: number | undefined;
7908
+ readonly response?: {
7909
+ readonly body: string;
7910
+ } | undefined;
7852
7911
  };
7853
7912
  readonly executed: boolean;
7854
7913
  readonly assistantMessageID: string & import("effect/Brand").Brand<"Session.Message.ID">;
@@ -7900,6 +7959,9 @@ export declare const Api: import("@opencode/protocol/api").Api<LocationMiddlewar
7900
7959
  readonly type: string;
7901
7960
  readonly message: string;
7902
7961
  readonly status?: number | undefined;
7962
+ readonly response?: {
7963
+ readonly body: string;
7964
+ } | undefined;
7903
7965
  };
7904
7966
  readonly sessionID: string & import("effect/Brand").Brand<"SessionID">;
7905
7967
  };
@@ -8014,6 +8076,9 @@ export declare const Api: import("@opencode/protocol/api").Api<LocationMiddlewar
8014
8076
  readonly type: string;
8015
8077
  readonly message: string;
8016
8078
  readonly status?: number | undefined;
8079
+ readonly response?: {
8080
+ readonly body: string;
8081
+ } | undefined;
8017
8082
  };
8018
8083
  readonly reason: "auto" | "manual";
8019
8084
  readonly cost?: (number & import("effect/Brand").Brand<"Money.USD">) | undefined;
package/dist/api.js CHANGED
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  Api2
3
- } from "./chunks/cors-ar2c062s.js";
4
- import"./chunks/cors-frv6gfy7.js";
5
- import"./chunks/cors-23w8t84j.js";
6
- import"./chunks/cors-0ar9gf7q.js";
7
- import"./chunks/cors-smaf4a18.js";
3
+ } from "./chunks/request-tracing-v573ws0d.js";
4
+ import"./chunks/request-tracing-5rwqcaw2.js";
5
+ import"./chunks/request-tracing-3kzx88w9.js";
6
+ import"./chunks/request-tracing-6gkz39ey.js";
7
+ import"./chunks/request-tracing-smaf4a18.js";
8
8
  export {
9
9
  Api2 as Api
10
10
  };
package/dist/auth.js CHANGED
@@ -7,7 +7,7 @@ import {
7
7
  verifySession2,
8
8
  sessionCookieName2,
9
9
  exports_auth
10
- } from "./chunks/cors-anm12x33.js";
10
+ } from "./chunks/request-tracing-anm12x33.js";
11
11
  export {
12
12
  Config2 as Config,
13
13
  SESSION_TTL_SECONDS2 as SESSION_TTL_SECONDS,
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  requestRef2
3
- } from "./cors-0ar9gf7q.js";
3
+ } from "./request-tracing-6gkz39ey.js";
4
4
  import {
5
5
  Api2
6
- } from "./cors-ar2c062s.js";
6
+ } from "./request-tracing-v573ws0d.js";
7
7
 
8
8
  // src/handlers/debug.ts
9
9
  import { LocationServiceMap } from "@opencode/core/location-service-map";
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  missingSession2,
3
3
  failedMessageDecode2
4
- } from "./cors-smaf4a18.js";
4
+ } from "./request-tracing-smaf4a18.js";
5
5
  import {
6
6
  Api2
7
- } from "./cors-ar2c062s.js";
7
+ } from "./request-tracing-v573ws0d.js";
8
8
 
9
9
  // src/handlers/message.ts
10
10
  import { SessionMessage } from "@opencode/core/session/message";
@@ -1,39 +1,39 @@
1
1
  import {
2
- layer5
3
- } from "./cors-0ar9gf7q.js";
2
+ layer4
3
+ } from "./request-tracing-6gkz39ey.js";
4
4
  import {
5
5
  formLocationLayer2
6
- } from "./cors-frv6gfy7.js";
6
+ } from "./request-tracing-5rwqcaw2.js";
7
7
  import {
8
8
  sessionLocationLayer2
9
- } from "./cors-23w8t84j.js";
9
+ } from "./request-tracing-3kzx88w9.js";
10
10
  import {
11
11
  Api2
12
- } from "./cors-ar2c062s.js";
12
+ } from "./request-tracing-v573ws0d.js";
13
13
  import {
14
14
  Config2
15
- } from "./cors-anm12x33.js";
15
+ } from "./request-tracing-anm12x33.js";
16
16
  import {
17
17
  CorsConfig2
18
- } from "./cors-q4bn6dy8.js";
18
+ } from "./request-tracing-q4bn6dy8.js";
19
19
  import {
20
- layer4
21
- } from "./cors-t9jkrcq1.js";
20
+ layer5
21
+ } from "./request-tracing-v305azr7.js";
22
22
  import {
23
23
  node3
24
- } from "./cors-kr61w04k.js";
24
+ } from "./request-tracing-byt4hbw9.js";
25
25
  import {
26
26
  node2
27
- } from "./cors-bkk2wfbz.js";
27
+ } from "./request-tracing-bkk2wfbz.js";
28
28
  import {
29
29
  handlers2
30
- } from "./cors-kb2bv51q.js";
30
+ } from "./request-tracing-fpwvrnjd.js";
31
31
  import {
32
32
  authorizationLayer2
33
- } from "./cors-gtkdacvk.js";
33
+ } from "./request-tracing-gtkdacvk.js";
34
34
  import {
35
35
  schemaErrorLayer2
36
- } from "./cors-t8yzmczr.js";
36
+ } from "./request-tracing-t8yzmczr.js";
37
37
 
38
38
  // src/routes.ts
39
39
  import { Database } from "@opencode/core/database/database";
@@ -144,8 +144,8 @@ function makeRoutes(auth, options, serviceURLs, overrides, instances) {
144
144
  })) : build(overrides);
145
145
  return serviceLayer.pipe(Layer.flatMap((context) => {
146
146
  const services = Layer.succeedContext(context);
147
- const requestServices = Layer.merge(Layer.succeedContext(Context.pick(Database.Service, Credential.Service, PermissionSaved.Service, PluginUpdate.Service, Project.Service, WellKnown.Service)(context)), layer4(serviceURLs, Context.get(context, Global.Service).tmp, options.app));
148
- const api = HttpApiBuilder.layer(Api2, { openapiPath: "/openapi.json" }).pipe(Layer.provide(handlers2.pipe(Layer.provide(services), Layer.provide(Layer.succeed(CorsConfig2, options)))), Layer.provide(formLocationLayer2), Layer.provide(sessionLocationLayer2), Layer.provide(layer5), Layer.provide(authorizationLayer2), Layer.provide(schemaErrorLayer2), Layer.provide(auth), HttpRouter.provideRequest(requestServices), Layer.provideMerge(services), Layer.provideMerge(HttpRouter.layer));
147
+ const requestServices = Layer.merge(Layer.succeedContext(Context.pick(Database.Service, Credential.Service, PermissionSaved.Service, PluginUpdate.Service, Project.Service, WellKnown.Service)(context)), layer5(serviceURLs, Context.get(context, Global.Service).tmp, options.app));
148
+ const api = HttpApiBuilder.layer(Api2, { openapiPath: "/openapi.json" }).pipe(Layer.provide(handlers2.pipe(Layer.provide(services), Layer.provide(Layer.succeed(CorsConfig2, options)))), Layer.provide(formLocationLayer2), Layer.provide(sessionLocationLayer2), Layer.provide(layer4), Layer.provide(authorizationLayer2), Layer.provide(schemaErrorLayer2), Layer.provide(auth), HttpRouter.provideRequest(requestServices), Layer.provideMerge(services), Layer.provideMerge(HttpRouter.layer));
149
149
  return Layer.merge(api, V1Migration.layer.pipe(Layer.provide(services)));
150
150
  }));
151
151
  }
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  Api2
3
- } from "./cors-ar2c062s.js";
3
+ } from "./request-tracing-v573ws0d.js";
4
4
  import {
5
- Service4,
5
+ Service3,
6
6
  frame2
7
- } from "./cors-5ybpxcad.js";
7
+ } from "./request-tracing-rjpqaa8h.js";
8
8
 
9
9
  // src/handlers/event.ts
10
10
  import { Event } from "@opencode/schema/event";
@@ -12,7 +12,7 @@ import { Effect, Stream } from "effect";
12
12
  import { HttpServerResponse } from "effect/unstable/http";
13
13
  import { HttpApiBuilder } from "effect/unstable/httpapi";
14
14
  var EventHandler2 = HttpApiBuilder.group(Api2, "server.event", (handlers) => Effect.gen(function* () {
15
- const feed = yield* Service4;
15
+ const feed = yield* Service3;
16
16
  return handlers.handleRaw("event.subscribe", () => Effect.gen(function* () {
17
17
  const connected = {
18
18
  id: Event.ID.create(),
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  sessionInfo2
3
- } from "./cors-0ar9gf7q.js";
3
+ } from "./request-tracing-6gkz39ey.js";
4
4
 
5
5
  // src/middleware/session-location.ts
6
6
  import { Instance } from "@opencode/core/instance/service";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  response2
3
- } from "./cors-0ar9gf7q.js";
3
+ } from "./request-tracing-6gkz39ey.js";
4
4
  import {
5
5
  Api2
6
- } from "./cors-ar2c062s.js";
6
+ } from "./request-tracing-v573ws0d.js";
7
7
 
8
8
  // src/handlers/reference.ts
9
9
  import { Reference } from "@opencode/core/reference";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  sessionInfo2,
3
3
  requestRef2
4
- } from "./cors-0ar9gf7q.js";
4
+ } from "./request-tracing-6gkz39ey.js";
5
5
 
6
6
  // src/middleware/form-location.ts
7
7
  import { Instance } from "@opencode/core/instance/service";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  __export
3
- } from "./cors-9rqn6x4v.js";
3
+ } from "./request-tracing-9rqn6x4v.js";
4
4
 
5
5
  // src/service-status.ts
6
6
  var exports_service_status = {};
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  missingSession2
3
- } from "./cors-smaf4a18.js";
3
+ } from "./request-tracing-smaf4a18.js";
4
4
 
5
5
  // src/location.ts
6
6
  import { Location } from "@opencode/core/location";
@@ -44,7 +44,7 @@ function decode(input) {
44
44
  return input;
45
45
  }
46
46
  }
47
- var layer5 = Layer.effect(LocationMiddleware2, Effect.gen(function* () {
47
+ var layer4 = Layer.effect(LocationMiddleware2, Effect.gen(function* () {
48
48
  const locations = yield* LocationServiceMap.Service;
49
49
  return LocationMiddleware2.of((effect) => Effect.gen(function* () {
50
50
  const request = yield* HttpServerRequest.HttpServerRequest;
@@ -52,4 +52,4 @@ var layer5 = Layer.effect(LocationMiddleware2, Effect.gen(function* () {
52
52
  }));
53
53
  }));
54
54
 
55
- export { LocationMiddleware2, response2, sessionInfo2, requestRef2, layer5 };
55
+ export { LocationMiddleware2, response2, sessionInfo2, requestRef2, layer4 };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Api2
3
- } from "./cors-ar2c062s.js";
3
+ } from "./request-tracing-v573ws0d.js";
4
4
 
5
5
  // src/handlers/config.ts
6
6
  import { Config } from "@opencode/core/config";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  response2
3
- } from "./cors-0ar9gf7q.js";
3
+ } from "./request-tracing-6gkz39ey.js";
4
4
  import {
5
5
  Api2
6
- } from "./cors-ar2c062s.js";
6
+ } from "./request-tracing-v573ws0d.js";
7
7
 
8
8
  // src/handlers/shell.ts
9
9
  import { Shell } from "@opencode/core/shell";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  response2
3
- } from "./cors-0ar9gf7q.js";
3
+ } from "./request-tracing-6gkz39ey.js";
4
4
  import {
5
5
  Api2
6
- } from "./cors-ar2c062s.js";
6
+ } from "./request-tracing-v573ws0d.js";
7
7
 
8
8
  // src/handlers/fs.ts
9
9
  import { FileSystem } from "@opencode/core/filesystem";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  __export
3
- } from "./cors-9rqn6x4v.js";
3
+ } from "./request-tracing-9rqn6x4v.js";
4
4
 
5
5
  // src/auth.ts
6
6
  var exports_auth = {};
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  response2
3
- } from "./cors-0ar9gf7q.js";
3
+ } from "./request-tracing-6gkz39ey.js";
4
4
  import {
5
5
  Api2
6
- } from "./cors-ar2c062s.js";
6
+ } from "./request-tracing-v573ws0d.js";
7
7
 
8
8
  // src/handlers/model.ts
9
9
  import { Model } from "@opencode/core/model";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  __export
3
- } from "./cors-9rqn6x4v.js";
3
+ } from "./request-tracing-9rqn6x4v.js";
4
4
 
5
5
  // src/pty-environment.ts
6
6
  var exports_pty_environment = {};
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Api2
3
- } from "./cors-ar2c062s.js";
3
+ } from "./request-tracing-v573ws0d.js";
4
4
 
5
5
  // src/handlers/migration.ts
6
6
  import { V1Migration } from "@opencode/core/database/v1-migration";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Api2
3
- } from "./cors-ar2c062s.js";
3
+ } from "./request-tracing-v573ws0d.js";
4
4
 
5
5
  // src/handlers/worktree.ts
6
6
  import { Git } from "@opencode/core/git";
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  __export
3
- } from "./cors-9rqn6x4v.js";
3
+ } from "./request-tracing-9rqn6x4v.js";
4
4
 
5
5
  // src/pairing.ts
6
6
  var exports_pairing = {};
7
7
  __export(exports_pairing, {
8
8
  ServerPairing: () => exports_pairing,
9
- Service: () => Service3,
9
+ Service: () => Service4,
10
10
  node: () => node3
11
11
  });
12
12
  import { Cache, Context, Duration, Effect, Layer } from "effect";
@@ -14,12 +14,12 @@ import { makeGlobalNode } from "@opencode/util/effect/app-node";
14
14
  import { randomBytes } from "node:crypto";
15
15
  var TTL = Duration.minutes(5);
16
16
 
17
- class Service3 extends Context.Service()("@opencode/ServerPairing") {
17
+ class Service4 extends Context.Service()("@opencode/ServerPairing") {
18
18
  }
19
19
  var noLookup = () => Effect.die(new Error("ServerPairing cache must be used via set/invalidateWhen, never get"));
20
- var layer = Layer.effect(Service3, Effect.gen(function* () {
20
+ var layer = Layer.effect(Service4, Effect.gen(function* () {
21
21
  const cache = yield* Cache.make({ capacity: 1000, lookup: noLookup, timeToLive: TTL });
22
- return Service3.of({
22
+ return Service4.of({
23
23
  issue: Effect.fn("ServerPairing.issue")(function* () {
24
24
  const code = randomBytes(16).toString("base64url");
25
25
  yield* Cache.set(cache, code, true);
@@ -30,6 +30,6 @@ var layer = Layer.effect(Service3, Effect.gen(function* () {
30
30
  })
31
31
  });
32
32
  }));
33
- var node3 = makeGlobalNode({ service: Service3, layer, deps: [] });
33
+ var node3 = makeGlobalNode({ service: Service4, layer, deps: [] });
34
34
 
35
- export { Service3, node3, exports_pairing };
35
+ export { Service4, node3, exports_pairing };
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  isAllowedCorsOrigin2
3
- } from "./cors-q4bn6dy8.js";
3
+ } from "./request-tracing-q4bn6dy8.js";
4
4
  import {
5
5
  createRoutes2
6
- } from "./cors-bjvbqbss.js";
6
+ } from "./request-tracing-2s2j0nb0.js";
7
7
  import {
8
8
  __export
9
- } from "./cors-9rqn6x4v.js";
9
+ } from "./request-tracing-9rqn6x4v.js";
10
10
 
11
11
  // src/fetch.ts
12
12
  var exports_fetch = {};
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  response2
3
- } from "./cors-0ar9gf7q.js";
3
+ } from "./request-tracing-6gkz39ey.js";
4
4
  import {
5
5
  Api2
6
- } from "./cors-ar2c062s.js";
6
+ } from "./request-tracing-v573ws0d.js";
7
7
 
8
8
  // src/handlers/agent.ts
9
9
  import { Agent } from "@opencode/core/agent";
@@ -0,0 +1,47 @@
1
+ import {
2
+ Api2
3
+ } from "./request-tracing-v573ws0d.js";
4
+
5
+ // src/handlers/credential.ts
6
+ import { Credential } from "@opencode/core/credential";
7
+ import { ConflictError } from "@opencode/protocol/errors";
8
+ import { Effect } from "effect";
9
+ import { HttpApiBuilder, HttpApiSchema } from "effect/unstable/httpapi";
10
+ var CredentialHandler2 = HttpApiBuilder.group(Api2, "server.credential", (handlers) => handlers.handle("credential.list", Effect.fn(function* () {
11
+ const credential = yield* Credential.Service;
12
+ return { data: entries(yield* credential.all()) };
13
+ })).handle("credential.create", Effect.fn(function* (ctx) {
14
+ const credential = yield* Credential.Service;
15
+ if (ctx.payload.id && (yield* credential.get(ctx.payload.id)))
16
+ return yield* new ConflictError({
17
+ resource: ctx.payload.id,
18
+ message: `Credential already exists: ${ctx.payload.id}`
19
+ });
20
+ const created = yield* credential.create(ctx.payload);
21
+ const entry = entries(yield* credential.list(created.integrationID)).find((item) => item.id === created.id);
22
+ return { data: entry ?? { ...created, active: false } };
23
+ })).handle("credential.update", Effect.fn(function* (ctx) {
24
+ const credential = yield* Credential.Service;
25
+ yield* credential.update(ctx.params.credentialID, { label: ctx.payload.label });
26
+ return HttpApiSchema.NoContent.make();
27
+ })).handle("credential.activate", Effect.fn(function* (ctx) {
28
+ const credential = yield* Credential.Service;
29
+ yield* credential.activate(ctx.params.credentialID);
30
+ return HttpApiSchema.NoContent.make();
31
+ })).handle("credential.remove", Effect.fn(function* (ctx) {
32
+ const credential = yield* Credential.Service;
33
+ yield* credential.remove(ctx.params.credentialID);
34
+ return HttpApiSchema.NoContent.make();
35
+ })));
36
+ function entries(credentials) {
37
+ const selected = new Map(credentials.map((item) => [item.integrationID, item.id]));
38
+ return credentials.map((item) => ({
39
+ id: item.id,
40
+ integrationID: item.integrationID,
41
+ label: item.label,
42
+ active: selected.get(item.integrationID) === item.id,
43
+ value: item.value
44
+ }));
45
+ }
46
+
47
+ export { CredentialHandler2 };
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  response2
3
- } from "./cors-0ar9gf7q.js";
3
+ } from "./request-tracing-6gkz39ey.js";
4
4
  import {
5
5
  Api2
6
- } from "./cors-ar2c062s.js";
6
+ } from "./request-tracing-v573ws0d.js";
7
7
 
8
8
  // src/handlers/form.ts
9
9
  import { Form } from "@opencode/core/form";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Api2
3
- } from "./cors-ar2c062s.js";
3
+ } from "./request-tracing-v573ws0d.js";
4
4
 
5
5
  // src/handlers/rpc.ts
6
6
  import { Rpc } from "@opencode/core/rpc";