@opencode/server 0.0.0-dev-904 → 0.0.0-dev-918

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 (120) hide show
  1. package/dist/api.js +5 -5
  2. package/dist/auth.js +1 -1
  3. package/dist/chunks/{api-059rbh9c.js → request-site-059rbh9c.js} +1 -1
  4. package/dist/chunks/{api-0e4fm4yw.js → request-site-0e4fm4yw.js} +1 -1
  5. package/dist/chunks/{api-2835150m.js → request-site-2835150m.js} +2 -2
  6. package/dist/chunks/{api-y99wfvnx.js → request-site-2d97cxdz.js} +13 -13
  7. package/dist/chunks/{api-370cpmna.js → request-site-370cpmna.js} +2 -2
  8. package/dist/chunks/{api-39nnfjx1.js → request-site-39nnfjx1.js} +1 -1
  9. package/dist/chunks/{api-50xc6x42.js → request-site-50xc6x42.js} +3 -3
  10. package/dist/chunks/{api-5553qfcy.js → request-site-5553qfcy.js} +3 -3
  11. package/dist/chunks/{api-57m9rtnr.js → request-site-57m9rtnr.js} +2 -2
  12. package/dist/chunks/{api-5afgx201.js → request-site-5afgx201.js} +2 -2
  13. package/dist/chunks/{api-7dtbad8d.js → request-site-5pdfedjd.js} +7 -7
  14. package/dist/chunks/{api-5z5anmwp.js → request-site-5z5anmwp.js} +2 -2
  15. package/dist/chunks/{api-74kxthdf.js → request-site-74kxthdf.js} +1 -1
  16. package/dist/chunks/{api-78rcgzsr.js → request-site-78rcgzsr.js} +1 -1
  17. package/dist/chunks/{api-7b9xm1qg.js → request-site-7b9xm1qg.js} +1 -1
  18. package/dist/chunks/{api-7cd61xtm.js → request-site-7cd61xtm.js} +2 -2
  19. package/dist/chunks/{api-7tewdwsb.js → request-site-7tewdwsb.js} +2 -2
  20. package/dist/chunks/{api-7x1re4zg.js → request-site-7x1re4zg.js} +2 -2
  21. package/dist/chunks/{api-p94f9pb0.js → request-site-8q1gmyrw.js} +8 -5
  22. package/dist/chunks/{api-2j32qzdw.js → request-site-cxarvqyg.js} +7 -7
  23. package/dist/chunks/{api-n321d8vm.js → request-site-djr0jy89.js} +8 -6
  24. package/dist/chunks/{api-f4exzdsf.js → request-site-f4exzdsf.js} +2 -2
  25. package/dist/chunks/{api-4z8yg1dv.js → request-site-fbdv47za.js} +4 -4
  26. package/dist/chunks/{api-k8y9dxyq.js → request-site-fszbw5sk.js} +4 -4
  27. package/dist/chunks/{api-gk0yxcp6.js → request-site-gk0yxcp6.js} +1 -1
  28. package/dist/chunks/{api-gqq6kfhc.js → request-site-gqq6kfhc.js} +1 -1
  29. package/dist/chunks/{api-6sada178.js → request-site-gzcpr2d6.js} +8 -8
  30. package/dist/chunks/request-site-hmwn16zp.js +39 -0
  31. package/dist/chunks/{api-j4at0y5c.js → request-site-j4at0y5c.js} +1 -1
  32. package/dist/chunks/{api-jc2vwkyw.js → request-site-jc2vwkyw.js} +2 -2
  33. package/dist/chunks/{api-w9jcwh65.js → request-site-kqr36gas.js} +7 -7
  34. package/dist/chunks/{api-r2veymj8.js → request-site-qpzkqgwj.js} +4 -4
  35. package/dist/chunks/{api-r5696se6.js → request-site-r5696se6.js} +3 -3
  36. package/dist/chunks/{api-rxyx8sa0.js → request-site-rxyx8sa0.js} +2 -2
  37. package/dist/chunks/{api-n8pb21j2.js → request-site-s347xjnz.js} +35 -35
  38. package/dist/chunks/{api-skcryrty.js → request-site-skcryrty.js} +2 -2
  39. package/dist/chunks/{api-sqxx1p54.js → request-site-sqxx1p54.js} +2 -2
  40. package/dist/chunks/request-site-t32e1bbt.js +32 -0
  41. package/dist/chunks/{api-vtfzy3at.js → request-site-vtfzy3at.js} +2 -2
  42. package/dist/chunks/{api-vvp99hc9.js → request-site-vvp99hc9.js} +1 -1
  43. package/dist/chunks/{api-w83vdpy9.js → request-site-w83vdpy9.js} +2 -2
  44. package/dist/chunks/{api-fvpjvjpp.js → request-site-wecgp61r.js} +7 -7
  45. package/dist/chunks/{api-wqv43pj9.js → request-site-wqv43pj9.js} +2 -2
  46. package/dist/chunks/{api-xbqm7mpj.js → request-site-xbqm7mpj.js} +2 -2
  47. package/dist/chunks/{api-xpg37vzc.js → request-site-xpg37vzc.js} +2 -2
  48. package/dist/chunks/{api-yet0vexm.js → request-site-yet0vexm.js} +1 -1
  49. package/dist/chunks/{api-z9kgby92.js → request-site-z9kgby92.js} +4 -4
  50. package/dist/chunks/{api-zds85vps.js → request-site-zds85vps.js} +1 -1
  51. package/dist/chunks/{api-0pbbhyf6.js → request-site-zgvwy66h.js} +9 -6
  52. package/dist/chunks/{api-zmgfywqd.js → request-site-zmgfywqd.js} +1 -1
  53. package/dist/chunks/{api-zyntahe8.js → request-site-zyntahe8.js} +1 -1
  54. package/dist/content-headers.d.ts +13 -0
  55. package/dist/content-headers.js +12 -0
  56. package/dist/cors.js +1 -1
  57. package/dist/event-feed.js +5 -5
  58. package/dist/fetch.js +56 -54
  59. package/dist/handlers/agent.js +6 -6
  60. package/dist/handlers/artifact.js +3 -3
  61. package/dist/handlers/command.js +6 -6
  62. package/dist/handlers/config.js +6 -6
  63. package/dist/handlers/credential.js +7 -7
  64. package/dist/handlers/debug.js +6 -6
  65. package/dist/handlers/event.js +7 -7
  66. package/dist/handlers/form.js +6 -6
  67. package/dist/handlers/fs.js +7 -6
  68. package/dist/handlers/generate.js +6 -6
  69. package/dist/handlers/integration.js +6 -6
  70. package/dist/handlers/job.js +2 -2
  71. package/dist/handlers/location.js +6 -6
  72. package/dist/handlers/mcp.js +8 -8
  73. package/dist/handlers/media.js +2 -1
  74. package/dist/handlers/message.js +7 -7
  75. package/dist/handlers/migration.js +6 -6
  76. package/dist/handlers/model.js +6 -6
  77. package/dist/handlers/permission.js +6 -6
  78. package/dist/handlers/persistent-pty.js +13 -12
  79. package/dist/handlers/plugin.js +6 -6
  80. package/dist/handlers/project.js +6 -6
  81. package/dist/handlers/provider.js +6 -6
  82. package/dist/handlers/pty-socket.js +1 -1
  83. package/dist/handlers/pty.js +8 -8
  84. package/dist/handlers/reference.js +6 -6
  85. package/dist/handlers/rpc.js +6 -6
  86. package/dist/handlers/schedule.js +2 -2
  87. package/dist/handlers/server.js +9 -9
  88. package/dist/handlers/session-error.js +1 -1
  89. package/dist/handlers/session.js +7 -7
  90. package/dist/handlers/shell.js +6 -6
  91. package/dist/handlers/skill.js +6 -6
  92. package/dist/handlers/usage.js +6 -6
  93. package/dist/handlers/vcs.js +6 -6
  94. package/dist/handlers/voice.js +6 -6
  95. package/dist/handlers/websearch.js +6 -6
  96. package/dist/handlers/worktree.js +6 -6
  97. package/dist/handlers.js +50 -49
  98. package/dist/location.js +2 -2
  99. package/dist/media-uri.js +1 -1
  100. package/dist/middleware/authorization.js +2 -2
  101. package/dist/middleware/form-location.js +3 -3
  102. package/dist/middleware/schema-error.js +1 -1
  103. package/dist/middleware/session-location.js +3 -3
  104. package/dist/pairing.js +3 -3
  105. package/dist/process.js +60 -56
  106. package/dist/request-site.d.ts +11 -0
  107. package/dist/request-site.js +11 -0
  108. package/dist/request-tracing.js +1 -1
  109. package/dist/routes.js +53 -52
  110. package/dist/server-info.js +5 -5
  111. package/dist/service-status.js +1 -1
  112. package/dist/workerd.js +57 -55
  113. package/package.json +8 -8
  114. /package/dist/chunks/{api-9rqn6x4v.js → request-site-9rqn6x4v.js} +0 -0
  115. /package/dist/chunks/{api-bd8755ek.js → request-site-bd8755ek.js} +0 -0
  116. /package/dist/chunks/{api-q187pxxd.js → request-site-q187pxxd.js} +0 -0
  117. /package/dist/chunks/{api-q4bn6dy8.js → request-site-q4bn6dy8.js} +0 -0
  118. /package/dist/chunks/{api-smaf4a18.js → request-site-smaf4a18.js} +0 -0
  119. /package/dist/chunks/{api-xthc02cw.js → request-site-xthc02cw.js} +0 -0
  120. /package/dist/chunks/{api-yc7nft6q.js → request-site-yc7nft6q.js} +0 -0
@@ -2,18 +2,18 @@ import {
2
2
  locationErrors2,
3
3
  response2,
4
4
  requestRef2
5
- } from "./api-gqq6kfhc.js";
5
+ } from "./request-site-gqq6kfhc.js";
6
6
  import {
7
7
  Api2
8
- } from "./api-r5696se6.js";
8
+ } from "./request-site-r5696se6.js";
9
9
  import {
10
10
  CorsConfig2,
11
11
  isAllowedRequestOrigin2
12
- } from "./api-q4bn6dy8.js";
12
+ } from "./request-site-q4bn6dy8.js";
13
13
  import {
14
14
  runPtySocket2,
15
15
  holdLocation2
16
- } from "./api-q187pxxd.js";
16
+ } from "./request-site-q187pxxd.js";
17
17
 
18
18
  // src/handlers/pty.ts
19
19
  import { Pty } from "@opencode/core/pty";
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  LocationMiddleware2
3
- } from "./api-gqq6kfhc.js";
3
+ } from "./request-site-gqq6kfhc.js";
4
4
  import {
5
5
  FormLocationMiddleware2
6
- } from "./api-gk0yxcp6.js";
6
+ } from "./request-site-gk0yxcp6.js";
7
7
  import {
8
8
  SessionLocationMiddleware2
9
- } from "./api-yet0vexm.js";
9
+ } from "./request-site-yet0vexm.js";
10
10
 
11
11
  // src/api.ts
12
12
  import { makeDefaultApi } from "@opencode/protocol/api";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  response2
3
- } from "./api-gqq6kfhc.js";
3
+ } from "./request-site-gqq6kfhc.js";
4
4
  import {
5
5
  Api2
6
- } from "./api-r5696se6.js";
6
+ } from "./request-site-r5696se6.js";
7
7
 
8
8
  // src/handlers/shell.ts
9
9
  import { Shell } from "@opencode/core/shell";
@@ -1,105 +1,105 @@
1
1
  import {
2
2
  GenerateHandler2
3
- } from "./api-wqv43pj9.js";
3
+ } from "./request-site-wqv43pj9.js";
4
4
  import {
5
5
  VoiceHandler2
6
- } from "./api-2835150m.js";
6
+ } from "./request-site-2835150m.js";
7
7
  import {
8
8
  MessageHandler2
9
- } from "./api-5553qfcy.js";
9
+ } from "./request-site-5553qfcy.js";
10
10
  import {
11
11
  ModelHandler2
12
- } from "./api-370cpmna.js";
12
+ } from "./request-site-370cpmna.js";
13
13
  import {
14
14
  ProviderHandler2
15
- } from "./api-vtfzy3at.js";
15
+ } from "./request-site-vtfzy3at.js";
16
16
  import {
17
17
  SessionHandler2
18
- } from "./api-z9kgby92.js";
18
+ } from "./request-site-z9kgby92.js";
19
19
  import {
20
20
  PermissionHandler2
21
- } from "./api-50xc6x42.js";
21
+ } from "./request-site-50xc6x42.js";
22
22
  import {
23
23
  FileSystemHandler2
24
- } from "./api-0pbbhyf6.js";
24
+ } from "./request-site-zgvwy66h.js";
25
25
  import {
26
26
  FormHandler2
27
- } from "./api-7x1re4zg.js";
27
+ } from "./request-site-7x1re4zg.js";
28
28
  import {
29
29
  CommandHandler2
30
- } from "./api-xpg37vzc.js";
30
+ } from "./request-site-xpg37vzc.js";
31
31
  import {
32
32
  SkillHandler2
33
- } from "./api-xbqm7mpj.js";
33
+ } from "./request-site-xbqm7mpj.js";
34
34
  import {
35
35
  RpcHandler2
36
- } from "./api-zyntahe8.js";
36
+ } from "./request-site-zyntahe8.js";
37
37
  import {
38
- layer2
39
- } from "./api-fvpjvjpp.js";
38
+ layer4
39
+ } from "./request-site-wecgp61r.js";
40
40
  import {
41
41
  EventHandler2
42
- } from "./api-k8y9dxyq.js";
42
+ } from "./request-site-fszbw5sk.js";
43
43
  import {
44
44
  AgentHandler2
45
- } from "./api-f4exzdsf.js";
45
+ } from "./request-site-f4exzdsf.js";
46
46
  import {
47
47
  PluginHandler2
48
- } from "./api-sqxx1p54.js";
48
+ } from "./request-site-sqxx1p54.js";
49
49
  import {
50
50
  ServerHandler2
51
- } from "./api-6sada178.js";
51
+ } from "./request-site-gzcpr2d6.js";
52
52
  import {
53
53
  DebugHandler2
54
- } from "./api-jc2vwkyw.js";
54
+ } from "./request-site-jc2vwkyw.js";
55
55
  import {
56
56
  PtyHandler2
57
- } from "./api-r2veymj8.js";
57
+ } from "./request-site-qpzkqgwj.js";
58
58
  import {
59
59
  PersistentPtyHandler2
60
- } from "./api-2j32qzdw.js";
60
+ } from "./request-site-cxarvqyg.js";
61
61
  import {
62
62
  ShellHandler2
63
- } from "./api-rxyx8sa0.js";
63
+ } from "./request-site-rxyx8sa0.js";
64
64
  import {
65
65
  ReferenceHandler2
66
- } from "./api-skcryrty.js";
66
+ } from "./request-site-skcryrty.js";
67
67
  import {
68
68
  LocationHandler2
69
- } from "./api-74kxthdf.js";
69
+ } from "./request-site-74kxthdf.js";
70
70
  import {
71
71
  IntegrationHandler2
72
- } from "./api-5afgx201.js";
72
+ } from "./request-site-5afgx201.js";
73
73
  import {
74
74
  WebSearchHandler2
75
- } from "./api-7cd61xtm.js";
75
+ } from "./request-site-7cd61xtm.js";
76
76
  import {
77
77
  UsageHandler2
78
- } from "./api-5z5anmwp.js";
78
+ } from "./request-site-5z5anmwp.js";
79
79
  import {
80
80
  McpHandler2
81
- } from "./api-4z8yg1dv.js";
81
+ } from "./request-site-fbdv47za.js";
82
82
  import {
83
83
  CredentialHandler2
84
- } from "./api-w83vdpy9.js";
84
+ } from "./request-site-w83vdpy9.js";
85
85
  import {
86
86
  ProjectHandler2
87
- } from "./api-zmgfywqd.js";
87
+ } from "./request-site-zmgfywqd.js";
88
88
  import {
89
89
  WorktreeHandler2
90
- } from "./api-zds85vps.js";
90
+ } from "./request-site-zds85vps.js";
91
91
  import {
92
92
  VcsHandler2
93
- } from "./api-7tewdwsb.js";
93
+ } from "./request-site-7tewdwsb.js";
94
94
  import {
95
95
  MigrationHandler2
96
- } from "./api-vvp99hc9.js";
96
+ } from "./request-site-vvp99hc9.js";
97
97
  import {
98
98
  ConfigHandler2
99
- } from "./api-0e4fm4yw.js";
99
+ } from "./request-site-0e4fm4yw.js";
100
100
 
101
101
  // src/handlers.ts
102
102
  import { Layer } from "effect";
103
- var handlers2 = Layer.mergeAll(ServerHandler2, DebugHandler2, MigrationHandler2, LocationHandler2, AgentHandler2, PluginHandler2, SessionHandler2, MessageHandler2, ModelHandler2, GenerateHandler2, VoiceHandler2, ProviderHandler2, IntegrationHandler2, WebSearchHandler2, UsageHandler2, McpHandler2, CredentialHandler2, ProjectHandler2, FormHandler2, PermissionHandler2, FileSystemHandler2, CommandHandler2, SkillHandler2, RpcHandler2, EventHandler2.pipe(Layer.provide(layer2)), PtyHandler2, PersistentPtyHandler2, ShellHandler2, ReferenceHandler2, WorktreeHandler2, VcsHandler2, ConfigHandler2);
103
+ var handlers2 = Layer.mergeAll(ServerHandler2, DebugHandler2, MigrationHandler2, LocationHandler2, AgentHandler2, PluginHandler2, SessionHandler2, MessageHandler2, ModelHandler2, GenerateHandler2, VoiceHandler2, ProviderHandler2, IntegrationHandler2, WebSearchHandler2, UsageHandler2, McpHandler2, CredentialHandler2, ProjectHandler2, FormHandler2, PermissionHandler2, FileSystemHandler2, CommandHandler2, SkillHandler2, RpcHandler2, EventHandler2.pipe(Layer.provide(layer4)), PtyHandler2, PersistentPtyHandler2, ShellHandler2, ReferenceHandler2, WorktreeHandler2, VcsHandler2, ConfigHandler2);
104
104
 
105
105
  export { handlers2 };
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  response2
3
- } from "./api-gqq6kfhc.js";
3
+ } from "./request-site-gqq6kfhc.js";
4
4
  import {
5
5
  Api2
6
- } from "./api-r5696se6.js";
6
+ } from "./request-site-r5696se6.js";
7
7
 
8
8
  // src/handlers/reference.ts
9
9
  import { Reference } from "@opencode/core/reference";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  response2
3
- } from "./api-gqq6kfhc.js";
3
+ } from "./request-site-gqq6kfhc.js";
4
4
  import {
5
5
  Api2
6
- } from "./api-r5696se6.js";
6
+ } from "./request-site-r5696se6.js";
7
7
 
8
8
  // src/handlers/plugin.ts
9
9
  import { Plugin } from "@opencode/core/plugin";
@@ -0,0 +1,32 @@
1
+ import {
2
+ __export
3
+ } from "./request-site-9rqn6x4v.js";
4
+
5
+ // src/content-headers.ts
6
+ var exports_content_headers = {};
7
+ __export(exports_content_headers, {
8
+ CONTENT_SECURITY_POLICY: () => CONTENT_SECURITY_POLICY2,
9
+ ContentHeaders: () => exports_content_headers,
10
+ disposition: () => disposition2,
11
+ download: () => download2
12
+ });
13
+ import path from "path";
14
+ var CONTENT_SECURITY_POLICY2 = "default-src 'none'; img-src 'self'; media-src 'self'; sandbox";
15
+ var TEXT_TYPE = "text/plain; charset=utf-8";
16
+ function download2(input) {
17
+ return {
18
+ "content-type": /^(text\/html|text\/javascript|application\/(x-)?javascript)\b|[/+]xml\b/i.test(input.mime) ? TEXT_TYPE : input.mime,
19
+ "content-disposition": disposition2(input.path === undefined ? "" : path.basename(input.path)),
20
+ "content-security-policy": CONTENT_SECURITY_POLICY2,
21
+ "x-content-type-options": "nosniff"
22
+ };
23
+ }
24
+ function disposition2(name) {
25
+ if (name === "")
26
+ return "attachment";
27
+ const fallback = name.replace(/[^\x20-\x7e]|["\\%]/g, "_");
28
+ const encoded = encodeURIComponent(name).replace(/['()*]/g, (char) => `%${char.charCodeAt(0).toString(16).toUpperCase()}`);
29
+ return `attachment; filename="${fallback}"; filename*=UTF-8''${encoded}`;
30
+ }
31
+
32
+ export { CONTENT_SECURITY_POLICY2, download2, disposition2, exports_content_headers };
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  awaitPlugins2,
3
3
  response2
4
- } from "./api-gqq6kfhc.js";
4
+ } from "./request-site-gqq6kfhc.js";
5
5
  import {
6
6
  Api2
7
- } from "./api-r5696se6.js";
7
+ } from "./request-site-r5696se6.js";
8
8
 
9
9
  // src/handlers/provider.ts
10
10
  import { Provider } from "@opencode/core/provider";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Api2
3
- } from "./api-r5696se6.js";
3
+ } from "./request-site-r5696se6.js";
4
4
 
5
5
  // src/handlers/migration.ts
6
6
  import { V1Migration } from "@opencode/core/database/v1-migration";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  Api2
3
- } from "./api-r5696se6.js";
3
+ } from "./request-site-r5696se6.js";
4
4
  import {
5
5
  requireConnectable2
6
- } from "./api-5afgx201.js";
6
+ } from "./request-site-5afgx201.js";
7
7
 
8
8
  // src/handlers/credential.ts
9
9
  import { Credential } from "@opencode/core/credential";
@@ -1,17 +1,17 @@
1
1
  import {
2
2
  __export
3
- } from "./api-9rqn6x4v.js";
3
+ } from "./request-site-9rqn6x4v.js";
4
4
 
5
5
  // src/event-feed.ts
6
6
  var exports_event_feed = {};
7
7
  __export(exports_event_feed, {
8
8
  EncodingError: () => EncodingError2,
9
9
  EventFeed: () => exports_event_feed,
10
- Service: () => Service2,
10
+ Service: () => Service4,
11
11
  SubscriberCapacity: () => SubscriberCapacity2,
12
12
  SubscriberOverflowError: () => SubscriberOverflowError2,
13
13
  frame: () => frame2,
14
- layer: () => layer2,
14
+ layer: () => layer4,
15
15
  make: () => make4
16
16
  });
17
17
  import { Bus } from "@opencode/core/bus";
@@ -30,7 +30,7 @@ class EncodingError2 extends Schema.TaggedError()("EventFeed.EncodingError", {
30
30
  }) {
31
31
  }
32
32
 
33
- class Service2 extends Context.Service()("@opencode/server/EventFeed") {
33
+ class Service4 extends Context.Service()("@opencode/server/EventFeed") {
34
34
  }
35
35
  function frame2(event) {
36
36
  return `data: ${JSON.stringify(event)}
@@ -72,13 +72,13 @@ var make4 = Effect.fn("EventFeed.make")(function* (observe, options) {
72
72
  });
73
73
  const unsubscribe = yield* observe(publish);
74
74
  yield* Effect.addFinalizer(() => unsubscribe);
75
- return Service2.of({
75
+ return Service4.of({
76
76
  subscribe: (types) => Effect.acquireRelease(Queue.dropping(capacity).pipe(Effect.tap((queue) => Effect.sync(() => subscribers.set(queue, types?.length ? new Set(types) : undefined)))), (queue) => Effect.sync(() => subscribers.delete(queue)).pipe(Effect.andThen(Queue.shutdown(queue)), Effect.asVoid)).pipe(Effect.map(Stream.fromQueue))
77
77
  });
78
78
  });
79
- var layer2 = Layer.effect(Service2, Effect.gen(function* () {
79
+ var layer4 = Layer.effect(Service4, Effect.gen(function* () {
80
80
  const bus = yield* Bus.Service;
81
81
  return yield* make4(bus.listen);
82
82
  }));
83
83
 
84
- export { SubscriberCapacity2, SubscriberOverflowError2, EncodingError2, Service2, frame2, make4, layer2, exports_event_feed };
84
+ export { SubscriberCapacity2, SubscriberOverflowError2, EncodingError2, Service4, frame2, make4, layer4, exports_event_feed };
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  locationErrors2,
3
3
  awaitPlugins2
4
- } from "./api-gqq6kfhc.js";
4
+ } from "./request-site-gqq6kfhc.js";
5
5
  import {
6
6
  Api2
7
- } from "./api-r5696se6.js";
7
+ } from "./request-site-r5696se6.js";
8
8
 
9
9
  // src/handlers/generate.ts
10
10
  import { Generate } from "@opencode/core/generate";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  response2
3
- } from "./api-gqq6kfhc.js";
3
+ } from "./request-site-gqq6kfhc.js";
4
4
  import {
5
5
  Api2
6
- } from "./api-r5696se6.js";
6
+ } from "./request-site-r5696se6.js";
7
7
 
8
8
  // src/handlers/skill.ts
9
9
  import { Skill } from "@opencode/core/skill";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  response2
3
- } from "./api-gqq6kfhc.js";
3
+ } from "./request-site-gqq6kfhc.js";
4
4
  import {
5
5
  Api2
6
- } from "./api-r5696se6.js";
6
+ } from "./request-site-r5696se6.js";
7
7
 
8
8
  // src/handlers/command.ts
9
9
  import { Command } from "@opencode/core/command";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  locationErrors2,
3
3
  sessionInfo2
4
- } from "./api-gqq6kfhc.js";
4
+ } from "./request-site-gqq6kfhc.js";
5
5
 
6
6
  // src/middleware/session-location.ts
7
7
  import { Instance } from "@opencode/core/instance/service";
@@ -3,16 +3,16 @@ import {
3
3
  missingMessage2,
4
4
  failedMessageDecode2,
5
5
  failedSnapshot2
6
- } from "./api-smaf4a18.js";
6
+ } from "./request-site-smaf4a18.js";
7
7
  import {
8
8
  locationErrors2
9
- } from "./api-gqq6kfhc.js";
9
+ } from "./request-site-gqq6kfhc.js";
10
10
  import {
11
11
  Api2
12
- } from "./api-r5696se6.js";
12
+ } from "./request-site-r5696se6.js";
13
13
  import {
14
14
  wantsMediaRefs2
15
- } from "./api-xthc02cw.js";
15
+ } from "./request-site-xthc02cw.js";
16
16
 
17
17
  // src/handlers/session.ts
18
18
  import { Instance } from "@opencode/core/instance/service";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Api2
3
- } from "./api-r5696se6.js";
3
+ } from "./request-site-r5696se6.js";
4
4
 
5
5
  // src/handlers/worktree.ts
6
6
  import { Git } from "@opencode/core/git";
@@ -1,9 +1,12 @@
1
1
  import {
2
2
  response2
3
- } from "./api-gqq6kfhc.js";
3
+ } from "./request-site-gqq6kfhc.js";
4
4
  import {
5
5
  Api2
6
- } from "./api-r5696se6.js";
6
+ } from "./request-site-r5696se6.js";
7
+ import {
8
+ download2
9
+ } from "./request-site-t32e1bbt.js";
7
10
 
8
11
  // src/handlers/fs.ts
9
12
  import { FileSystem } from "@opencode/core/filesystem";
@@ -21,7 +24,7 @@ var FileSystemHandler2 = HttpApiBuilder.group(Api2, "server.fs", (handlers) => E
21
24
  const path2 = yield* decodeRequestPath(ctx.request.url);
22
25
  const fs = yield* FileSystem.Service;
23
26
  const file = yield* fs.read({ path: path2 }).pipe(Effect.mapError((error) => new FileNotFoundError({ path: error.path, message: `File not found: ${error.path}` })));
24
- return serveFile(ctx.request, file);
27
+ return serveFile(ctx.request, file, download2({ path: path2, mime: file.mime }));
25
28
  })).handle("fs.list", (ctx) => response2(Effect.gen(function* () {
26
29
  const fs = yield* FileSystem.Service;
27
30
  return yield* fs.list(ctx.query).pipe(Effect.mapError((error) => new FileNotFoundError({ path: error.path, message: `Directory not found: ${error.path}` })));
@@ -54,7 +57,7 @@ function decodeRequestPath(url) {
54
57
  catch: () => new FileNotFoundError({ path: raw, message: `File not found: ${raw}` })
55
58
  });
56
59
  }
57
- function serveFile(request, file) {
60
+ function serveFile(request, file, content) {
58
61
  const etag = `W/"${file.size.toString(16)}-${Option.match(file.mtime, {
59
62
  onNone: () => "0",
60
63
  onSome: (mtime) => mtime.getTime().toString(16)
@@ -66,7 +69,7 @@ function serveFile(request, file) {
66
69
  ...lastModified === undefined ? {} : { "last-modified": lastModified }
67
70
  };
68
71
  if (isNotModified(request, etag, lastModified))
69
- return HttpServerResponse.empty({ status: 304, headers: validators });
72
+ return HttpServerResponse.empty({ status: 304, headers: { ...validators, ...content } });
70
73
  const rangeHeader = request.method === "GET" ? request.headers["range"] : undefined;
71
74
  const range = rangeHeader !== undefined && matchesIfRange(request.headers["if-range"], etag, lastModified) ? parseRange(rangeHeader, file.size) : undefined;
72
75
  if (range === "unsatisfiable")
@@ -81,8 +84,8 @@ function serveFile(request, file) {
81
84
  contentLength: length,
82
85
  headers: {
83
86
  ...validators,
87
+ ...content,
84
88
  "accept-ranges": "bytes",
85
- "content-type": file.mime,
86
89
  ...range === undefined ? {} : { "content-range": `bytes ${range.start}-${range.end}/${file.size}` }
87
90
  }
88
91
  });
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Api2
3
- } from "./api-r5696se6.js";
3
+ } from "./request-site-r5696se6.js";
4
4
 
5
5
  // src/handlers/project.ts
6
6
  import { Project } from "@opencode/core/project";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Api2
3
- } from "./api-r5696se6.js";
3
+ } from "./request-site-r5696se6.js";
4
4
 
5
5
  // src/handlers/rpc.ts
6
6
  import { Rpc } from "@opencode/core/rpc";
@@ -0,0 +1,13 @@
1
+ export * as ContentHeaders from "./content-headers";
2
+ export declare const CONTENT_SECURITY_POLICY = "default-src 'none'; img-src 'self'; media-src 'self'; sandbox";
3
+ /** Headers for raw file bytes: always a download, never rendered as a page on the server's origin. */
4
+ export declare function download(input: {
5
+ readonly path?: string;
6
+ readonly mime: string;
7
+ }): {
8
+ "content-type": string;
9
+ "content-disposition": string;
10
+ "content-security-policy": string;
11
+ "x-content-type-options": string;
12
+ };
13
+ export declare function disposition(name: string): string;
@@ -0,0 +1,12 @@
1
+ import {
2
+ CONTENT_SECURITY_POLICY2,
3
+ download2,
4
+ disposition2,
5
+ exports_content_headers
6
+ } from "./chunks/request-site-t32e1bbt.js";
7
+ export {
8
+ CONTENT_SECURITY_POLICY2 as CONTENT_SECURITY_POLICY,
9
+ exports_content_headers as ContentHeaders,
10
+ disposition2 as disposition,
11
+ download2 as download
12
+ };
package/dist/cors.js CHANGED
@@ -2,7 +2,7 @@ import {
2
2
  CorsConfig2,
3
3
  isAllowedCorsOrigin2,
4
4
  isAllowedRequestOrigin2
5
- } from "./chunks/api-q4bn6dy8.js";
5
+ } from "./chunks/request-site-q4bn6dy8.js";
6
6
  export {
7
7
  CorsConfig2 as CorsConfig,
8
8
  isAllowedCorsOrigin2 as isAllowedCorsOrigin,
@@ -2,19 +2,19 @@ import {
2
2
  SubscriberCapacity2,
3
3
  SubscriberOverflowError2,
4
4
  EncodingError2,
5
- Service2,
5
+ Service4,
6
6
  frame2,
7
7
  make4,
8
- layer2,
8
+ layer4,
9
9
  exports_event_feed
10
- } from "./chunks/api-fvpjvjpp.js";
10
+ } from "./chunks/request-site-wecgp61r.js";
11
11
  export {
12
12
  EncodingError2 as EncodingError,
13
13
  exports_event_feed as EventFeed,
14
- Service2 as Service,
14
+ Service4 as Service,
15
15
  SubscriberCapacity2 as SubscriberCapacity,
16
16
  SubscriberOverflowError2 as SubscriberOverflowError,
17
17
  frame2 as frame,
18
- layer2 as layer,
18
+ layer4 as layer,
19
19
  make4 as make
20
20
  };