@codexhost/cli-darwin-x64 0.18.0-beta.4 → 0.18.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 (48) hide show
  1. package/README.md +1 -1
  2. package/app/codexhost-distribution.json +1 -1
  3. package/app/console-server.mjs +98 -55
  4. package/app/console-web.js +276 -188
  5. package/app/desktop-controller.mjs +283 -113
  6. package/app/host-runtime.mjs +2129 -1529
  7. package/app/plugins/antigravity/plugin.mjs +787 -303
  8. package/app/plugins/claude-code/plugin.mjs +85 -45
  9. package/app/plugins/codebuddy/plugin.mjs +99 -59
  10. package/app/plugins/codex-usage/plugin.mjs +85 -45
  11. package/app/plugins/copilot/plugin.mjs +90 -50
  12. package/app/plugins/cursor-cli/plugin.mjs +113 -73
  13. package/app/plugins/deepseek-harness/plugin.mjs +116 -76
  14. package/app/plugins/devin/plugin.mjs +90 -50
  15. package/app/plugins/grok/plugin.mjs +96 -56
  16. package/app/plugins/hermes/plugin.mjs +77 -37
  17. package/app/plugins/kimi-code/plugin.mjs +94 -54
  18. package/app/plugins/kiro-cli/plugin.mjs +90 -50
  19. package/app/plugins/omp/plugin.mjs +81 -41
  20. package/app/plugins/opencode/plugin.mjs +78 -38
  21. package/app/plugins/pi/plugin.mjs +94 -54
  22. package/app/plugins/qoder/plugin.mjs +106 -66
  23. package/app/plugins/qoder-cn/plugin.mjs +106 -66
  24. package/app/plugins/qwen-code/plugin.mjs +101 -61
  25. package/app/plugins/workbuddy/plugin.mjs +99 -59
  26. package/app/plugins/zcode/plugin.mjs +82 -42
  27. package/app/renderer-extension.js +435 -361
  28. package/app/web/assets/{index-D1dOzBMI.js → index-C0aXz2jD.js} +63 -63
  29. package/app/web/codex-agent.png +0 -0
  30. package/app/web/codexhost-settings.js +229 -175
  31. package/app/web/index.html +1 -1
  32. package/app/web/plugins/deepseek-ai__dsh-api-remotes/client.js +1 -1
  33. package/app/web/plugins/deepseek-ai__dsh-api-session-controller/client.js +61 -61
  34. package/app/web/plugins/deepseek-ai__dsh-client-ui-chat/client.js +8 -8
  35. package/app/web/plugins/deepseek-ai__dsh-client-ui-codexhost/client.js +2 -2
  36. package/app/web/plugins/deepseek-ai__dsh-client-ui-conversation/client.js +12 -12
  37. package/app/web/plugins/deepseek-ai__dsh-client-ui-permission-presets/client.js +1 -1
  38. package/app/web/plugins/deepseek-ai__dsh-client-ui-settings/client.js +1 -1
  39. package/app/web/plugins/deepseek-ai__dsh-client-ui-settings-general/client.js +3 -3
  40. package/app/web/plugins/deepseek-ai__dsh-client-ui-theme/client.js +1 -1
  41. package/app/web/plugins/deepseek-ai__dsh-client-ui-tool/client.js +18 -18
  42. package/app/web/plugins/deepseek-ai__dsh-client-ui-workspace/client.js +8 -8
  43. package/app/web/sw.js +41 -6
  44. package/app/web-modules/server.mjs +2079 -1201
  45. package/bin/codexhost +0 -0
  46. package/libexec/codexhost-shim +0 -0
  47. package/libexec/codexhost-updater +0 -0
  48. package/package.json +1 -1
package/app/web/sw.js CHANGED
@@ -145,6 +145,46 @@ function offlineResponse() {
145
145
  );
146
146
  }
147
147
 
148
+ async function pushRequest(method, args) {
149
+ const response = await fetch(new URL(`api/${method}`, self.registration.scope).href, {
150
+ method: "POST",
151
+ credentials: "same-origin",
152
+ headers: { "content-type": "application/json" },
153
+ body: JSON.stringify({
154
+ type: "client-request",
155
+ rpcId: crypto.randomUUID(),
156
+ method,
157
+ payload: { args },
158
+ }),
159
+ });
160
+ if (!response.ok) throw new Error(`HTTP ${String(response.status)}`);
161
+ const envelope = await response.json();
162
+ if (!envelope.result.ok) throw new Error(envelope.result.error.message);
163
+ return envelope.result.value;
164
+ }
165
+
166
+ self.addEventListener("pushsubscriptionchange", (event) => {
167
+ event.waitUntil(
168
+ (async () => {
169
+ let applicationServerKey = event.oldSubscription?.options?.applicationServerKey;
170
+ if (!applicationServerKey) {
171
+ const { publicKey } = await pushRequest("codexhost/pushConfig", {});
172
+ const padding = "=".repeat((4 - (publicKey.length % 4)) % 4);
173
+ const raw = atob((publicKey + padding).replace(/-/gu, "+").replace(/_/gu, "/"));
174
+ applicationServerKey = Uint8Array.from(raw, (character) => character.charCodeAt(0));
175
+ }
176
+ const subscription = await self.registration.pushManager.subscribe({
177
+ userVisibleOnly: true,
178
+ applicationServerKey,
179
+ });
180
+ await pushRequest("codexhost/pushSubscribe", {
181
+ subscription: subscription.toJSON(),
182
+ userAgent: navigator.userAgent,
183
+ });
184
+ })(),
185
+ );
186
+ });
187
+
148
188
  self.addEventListener("push", (event) => {
149
189
  let message = {};
150
190
  try {
@@ -154,12 +194,7 @@ self.addEventListener("push", (event) => {
154
194
  }
155
195
  event.waitUntil(
156
196
  (async () => {
157
- // Skip the notification when the user is already looking at CodexHost.
158
- const windows = await self.clients.matchAll({ type: "window", includeUncontrolled: true });
159
- const visible = windows.some(
160
- (client) => client.visibilityState === "visible" && client.focused,
161
- );
162
- if (visible && message.kind === "turn") return;
197
+ // Web Push requires a visible notification even while the app is in the foreground.
163
198
  await self.registration.showNotification(message.title || "CodexHost", {
164
199
  body: message.body || "",
165
200
  tag: message.tag || undefined,