glimmervoid 0.30.0 → 0.31.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 (66) hide show
  1. package/README.md +1 -1
  2. package/dist/bin/glimmervoid.js +140 -57
  3. package/dist/chunks/{adapters-Dho1VSY5.js → adapters-ClA_GbtA.js} +1 -1
  4. package/dist/chunks/{adapters-zPDx1Xox.js → adapters-gn7ulNO4.js} +32 -12
  5. package/dist/chunks/agent-api-cli-DAA7Jx8N.js +135 -0
  6. package/dist/chunks/{agent-api-core-Dz0r21y9.js → agent-api-core-hVcT26JW.js} +10 -1
  7. package/dist/chunks/{agent-setup-cli-B5Atxr3F.js → agent-setup-cli-CiJSDWSo.js} +11 -28
  8. package/dist/chunks/backoff-DjVpfHk7.js +14 -0
  9. package/dist/chunks/child-process-safe-BKPZ-5qQ.js +2 -0
  10. package/dist/chunks/coerce-NSst8oRP.js +32 -0
  11. package/dist/chunks/{contracts-DGkKNh9W.js → config-W1Sv-iPK.js} +358 -1682
  12. package/dist/chunks/{config-store-mm7MgzoL.js → config-store-BCy4FHNG.js} +583 -327
  13. package/dist/chunks/config-store-DbBp7LJZ.js +2 -0
  14. package/dist/chunks/contracts-3LkrilQX.js +2078 -0
  15. package/dist/chunks/{grok-DuU8xVLZ.js → grok-CXKeSt2z.js} +24 -20
  16. package/dist/chunks/{hook-relay-core-BHfYFnYV.js → hook-relay-core-DA_bz2KA.js} +10 -5
  17. package/dist/chunks/{hook-tools-pSJia7ks.js → hook-tools-UX2fmt81.js} +3 -5
  18. package/dist/chunks/{ingest-editor-core-BuI1gMF_.js → ingest-editor-core-vR6Wv6bP.js} +24 -13
  19. package/dist/chunks/json-core-dfa_7Fak.js +23 -0
  20. package/dist/chunks/json-file-oEH9vt-0.js +352 -0
  21. package/dist/chunks/knowledge-graph-cli-D2tt5hPn.js +1354 -0
  22. package/dist/chunks/{loopback-post-C7C22eYi.js → loopback-post-DepQfdcM.js} +40 -26
  23. package/dist/chunks/{main-CuIZQPhZ.js → main-DyTCWIu2.js} +28498 -21129
  24. package/dist/chunks/{node-pty-preflight-CK1knGIR.js → node-pty-preflight-C8QIlrtU.js} +4 -6
  25. package/dist/chunks/{pair-cli-w-gCAF-1.js → pair-cli-BbCBfd6l.js} +4 -3
  26. package/dist/chunks/paths-CeJl2Vcg.js +55 -0
  27. package/dist/chunks/{remote-config-C2ytQwrs.js → remote-config-DKIH_VxM.js} +36 -40
  28. package/dist/chunks/{rtk-hook-core-Bl6gYHPN.js → rtk-hook-core-BmEz2aq9.js} +3 -5
  29. package/dist/chunks/{rtk-resolver-CLo-gZzw.js → rtk-resolver-BGDzw5XK.js} +2 -2
  30. package/dist/chunks/rtk-resolver-D4Nke1Fr.js +2 -0
  31. package/dist/chunks/{runtime-paths-Ci_ksSkj.js → runtime-paths-BPoxENmK.js} +2 -6
  32. package/dist/chunks/runtime-paths-DU5jBEEO.js +2 -0
  33. package/dist/chunks/{sandbox-deps-Dd5-kZnf.js → sandbox-deps-BPKE-ylr.js} +16 -13
  34. package/dist/chunks/sandbox-proxy-core-hnQgKR0T.js +27 -0
  35. package/dist/chunks/{session-Cez8aIWg.js → session-fc4pFbon.js} +8 -2
  36. package/dist/chunks/text-DoirglWV.js +21 -0
  37. package/dist/chunks/timer-deps-u2DAQLok.js +15 -0
  38. package/dist/chunks/{visions-cli-BXQFIBCX.js → visions-cli-CT5rjiwf.js} +1 -1
  39. package/dist/chunks/{visions-setup-CvVnOe1r.js → visions-setup-BmOkI-QE.js} +20 -357
  40. package/dist/client/assets/index-C6KD8lgZ.css +1 -0
  41. package/dist/client/assets/index-CThQEAEy.js +249 -0
  42. package/dist/client/fonts/CommitMono-OFL.txt +92 -0
  43. package/dist/client/fonts/commit-mono-400-italic.woff2 +0 -0
  44. package/dist/client/fonts/commit-mono-400-regular.woff2 +0 -0
  45. package/dist/client/fonts/commit-mono-700-italic.woff2 +0 -0
  46. package/dist/client/fonts/commit-mono-700-regular.woff2 +0 -0
  47. package/dist/client/index.html +7 -24
  48. package/dist/client/octicons-LICENSE.txt +21 -0
  49. package/dist/scripts/postinstall-path-check.js +1 -1
  50. package/dist/server/index.js +3 -3
  51. package/dist/session/command-hook-relay.js +1 -1
  52. package/dist/session/hook-relay.js +3 -3
  53. package/dist/session/hook-tool-relay.js +2 -2
  54. package/dist/session/sandbox-open-launcher.js +79 -0
  55. package/dist/session/statusline-relay.js +8 -18
  56. package/dist/session/visions-relay.js +20 -11
  57. package/package.json +4 -1
  58. package/dist/chunks/agent-api-cli-D0MmtEdz.js +0 -71
  59. package/dist/chunks/child-process-safe-DvQjXsgz.js +0 -2
  60. package/dist/chunks/config-store-CC8T3okC.js +0 -2
  61. package/dist/chunks/ingest-core-DWI1Mbu4.js +0 -342
  62. package/dist/chunks/rtk-resolver-CMQAidlI.js +0 -2
  63. package/dist/chunks/runtime-paths-JLrZ3wyi.js +0 -2
  64. package/dist/client/assets/index-B1MFijjb.css +0 -1
  65. package/dist/client/assets/index-CU1iPPdn.js +0 -249
  66. package/dist/chunks/{child-process-safe-DRGsp0TE.js → child-process-safe-Ch-Zgxqs.js} +1 -1
@@ -1,14 +1,34 @@
1
- import "./hook-relay-core-BHfYFnYV.js";
1
+ import { a as isLoopbackHostname } from "./hook-relay-core-DA_bz2KA.js";
2
+ import { n as decideSandboxProxy } from "./sandbox-proxy-core-hnQgKR0T.js";
2
3
  import http from "node:http";
3
4
  //#region session/loopback-post.ts
4
5
  var POST_TIMEOUT_MS = 1500;
5
- var LOOPBACK_HOSTS = /* @__PURE__ */ new Set([
6
- "127.0.0.1",
7
- "::1",
8
- "[::1]",
9
- "localhost"
10
- ]);
11
- function postToLoopback(url, body) {
6
+ function refusal(reason) {
7
+ return {
8
+ reason,
9
+ responseBody: null
10
+ };
11
+ }
12
+ function directRoute(target) {
13
+ return {
14
+ hostname: target.hostname,
15
+ port: target.port,
16
+ path: `${target.pathname}${target.search}`
17
+ };
18
+ }
19
+ function sandboxProxyRoute(sandboxProxy, target) {
20
+ const proxyHeaders = sandboxProxy.authorization ? { "proxy-authorization": sandboxProxy.authorization } : {};
21
+ return {
22
+ hostname: sandboxProxy.hostname,
23
+ port: sandboxProxy.port,
24
+ path: target.href,
25
+ headers: {
26
+ ...proxyHeaders,
27
+ host: target.host
28
+ }
29
+ };
30
+ }
31
+ function sendPost(route, body) {
12
32
  return new Promise((resolve) => {
13
33
  let settled = false;
14
34
  const done = (reason, responseBody = null) => {
@@ -19,28 +39,12 @@ function postToLoopback(url, body) {
19
39
  responseBody
20
40
  });
21
41
  };
22
- let target;
23
- try {
24
- target = new URL(url);
25
- } catch {
26
- done("bad-url");
27
- return;
28
- }
29
- if (target.protocol !== "http:") {
30
- done("not-http");
31
- return;
32
- }
33
- if (!LOOPBACK_HOSTS.has(target.hostname)) {
34
- done("not-loopback");
35
- return;
36
- }
37
42
  try {
38
43
  const request = http.request({
39
- hostname: target.hostname,
40
- port: target.port,
41
- path: `${target.pathname}${target.search}`,
44
+ ...route,
42
45
  method: "POST",
43
46
  headers: {
47
+ ...route.headers,
44
48
  "content-type": "application/json",
45
49
  "content-length": Buffer.byteLength(body)
46
50
  }
@@ -72,6 +76,16 @@ function postToLoopback(url, body) {
72
76
  }
73
77
  });
74
78
  }
79
+ async function postToLoopback(url, body, env = process.env) {
80
+ if (!URL.canParse(url)) return refusal("bad-url");
81
+ const target = new URL(url);
82
+ if (target.protocol !== "http:") return refusal("not-http");
83
+ if (!isLoopbackHostname(target.hostname)) return refusal("not-loopback");
84
+ if (env["GLIMMERVOID_HOOK_VIA_SANDBOX_PROXY"] !== "1") return sendPost(directRoute(target), body);
85
+ const sandboxProxy = decideSandboxProxy(env);
86
+ if (!sandboxProxy) return refusal("sandbox-proxy-missing");
87
+ return sendPost(sandboxProxyRoute(sandboxProxy, target), body);
88
+ }
75
89
  async function postPayload(url, body) {
76
90
  return (await postToLoopback(url, body)).responseBody;
77
91
  }