@goldenlustre/agent-studio 1.0.5 → 1.0.6

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 (54) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-path-routes-manifest.json +4 -4
  3. package/.next/build-manifest.json +2 -2
  4. package/.next/prerender-manifest.json +3 -3
  5. package/.next/required-server-files.js +1 -1
  6. package/.next/required-server-files.json +1 -1
  7. package/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  8. package/.next/server/app/_global-error.html +1 -1
  9. package/.next/server/app/_global-error.rsc +1 -1
  10. package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  11. package/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  12. package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  13. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  14. package/.next/server/app/_not-found.html +1 -1
  15. package/.next/server/app/_not-found.rsc +2 -2
  16. package/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
  17. package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +2 -2
  18. package/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  19. package/.next/server/app/api/app-update/route.js +1 -1
  20. package/.next/server/app/dashboard/page_client-reference-manifest.js +1 -1
  21. package/.next/server/app/dashboard.html +1 -1
  22. package/.next/server/app/dashboard.rsc +2 -2
  23. package/.next/server/app/dashboard.segments/_full.segment.rsc +2 -2
  24. package/.next/server/app/dashboard.segments/_tree.segment.rsc +1 -1
  25. package/.next/server/app/dashboard.segments/dashboard/__PAGE__.segment.rsc +2 -2
  26. package/.next/server/app/index.html +1 -1
  27. package/.next/server/app/index.rsc +4 -4
  28. package/.next/server/app/index.segments/__PAGE__.segment.rsc +4 -4
  29. package/.next/server/app/index.segments/_full.segment.rsc +4 -4
  30. package/.next/server/app/index.segments/_tree.segment.rsc +1 -1
  31. package/.next/server/app/login/page_client-reference-manifest.js +1 -1
  32. package/.next/server/app/login.html +1 -1
  33. package/.next/server/app/login.rsc +2 -2
  34. package/.next/server/app/login.segments/_full.segment.rsc +2 -2
  35. package/.next/server/app/login.segments/_tree.segment.rsc +1 -1
  36. package/.next/server/app/login.segments/login/__PAGE__.segment.rsc +2 -2
  37. package/.next/server/app/page.js +2 -2
  38. package/.next/server/app/page_client-reference-manifest.js +1 -1
  39. package/.next/server/app-paths-manifest.json +4 -4
  40. package/.next/server/middleware-build-manifest.js +1 -1
  41. package/.next/server/pages/404.html +1 -1
  42. package/.next/server/pages/500.html +1 -1
  43. package/.next/server/server-reference-manifest.json +1 -1
  44. package/.next/static/chunks/app/{layout-f49cc2ba36663b02.js → layout-31492c79f85fd8f6.js} +1 -1
  45. package/.next/static/chunks/app/{page-969593a89c9ee01f.js → page-bed96c6018122870.js} +2 -2
  46. package/.next/trace +41 -39
  47. package/.next/trace-build +1 -1
  48. package/bin/agent-studio.js +5 -1
  49. package/bin/browser-url.js +40 -0
  50. package/bin/browser-url.test.mjs +44 -0
  51. package/bin/pi-web.js +5 -1
  52. package/package.json +2 -2
  53. /package/.next/static/{KSO1GhDgU3GuF7sgfz1tN → -lW9cYwIUJAmYf8e9jgoS}/_buildManifest.js +0 -0
  54. /package/.next/static/{KSO1GhDgU3GuF7sgfz1tN → -lW9cYwIUJAmYf8e9jgoS}/_ssgManifest.js +0 -0
package/.next/trace-build CHANGED
@@ -1 +1 @@
1
- [{"name":"run-webpack","duration":65089888,"timestamp":190223941897,"id":14,"parentId":1,"tags":{},"startTime":1789547702791,"traceId":"32dfe4e4005e962a"},{"name":"run-typescript","duration":30360690,"timestamp":190289039773,"id":8510,"parentId":1,"tags":{},"startTime":1789547767889,"traceId":"32dfe4e4005e962a"},{"name":"static-check","duration":4866452,"timestamp":190319422034,"id":8513,"parentId":1,"tags":{},"startTime":1789547798271,"traceId":"32dfe4e4005e962a"},{"name":"static-generation","duration":11859811,"timestamp":190324850162,"id":8641,"parentId":1,"tags":{},"startTime":1789547803699,"traceId":"32dfe4e4005e962a"},{"name":"collect-build-traces","duration":120922537,"timestamp":190324294134,"id":8638,"parentId":1,"tags":{},"startTime":1789547803143,"traceId":"32dfe4e4005e962a"},{"name":"telemetry-flush","duration":86,"timestamp":190445225395,"id":8650,"parentId":1,"tags":{},"startTime":1789547924074,"traceId":"32dfe4e4005e962a"},{"name":"next-build","duration":221474982,"timestamp":190223750518,"id":1,"tags":{"buildMode":"default","version":"16.3.1","bundler":"webpack","has-custom-webpack-config":"false","use-build-worker":"true"},"startTime":1789547702599,"traceId":"32dfe4e4005e962a"}]
1
+ [{"name":"run-webpack","duration":65018578,"timestamp":190699472758,"id":14,"parentId":1,"tags":{},"startTime":1789548178322,"traceId":"81cbf31ad746bf67"},{"name":"run-typescript","duration":30170357,"timestamp":190764498160,"id":8510,"parentId":1,"tags":{},"startTime":1789548243347,"traceId":"81cbf31ad746bf67"},{"name":"static-check","duration":4939007,"timestamp":190794693838,"id":8513,"parentId":1,"tags":{},"startTime":1789548273543,"traceId":"81cbf31ad746bf67"},{"name":"static-generation","duration":11735570,"timestamp":190800161532,"id":8641,"parentId":1,"tags":{},"startTime":1789548279010,"traceId":"81cbf31ad746bf67"},{"name":"collect-build-traces","duration":77405971,"timestamp":190799638121,"id":8638,"parentId":1,"tags":{},"startTime":1789548278487,"traceId":"81cbf31ad746bf67"},{"name":"telemetry-flush","duration":87,"timestamp":190877050463,"id":8650,"parentId":1,"tags":{},"startTime":1789548355899,"traceId":"81cbf31ad746bf67"},{"name":"next-build","duration":177770980,"timestamp":190699279583,"id":1,"tags":{"buildMode":"default","version":"16.3.1","bundler":"webpack","has-custom-webpack-config":"false","use-build-worker":"true"},"startTime":1789548178129,"traceId":"81cbf31ad746bf67"}]
@@ -19,6 +19,8 @@ const fs = require("fs");
19
19
  const { getHelpText, parseLaunchOptions } = require("./agent-studio-options");
20
20
  // eslint-disable-next-line @typescript-eslint/no-require-imports
21
21
  const { wireChildProcessLifecycle } = require("./process-lifecycle");
22
+ // eslint-disable-next-line @typescript-eslint/no-require-imports
23
+ const { browserUrl } = require("./browser-url");
22
24
 
23
25
  let launchOptions;
24
26
  try {
@@ -89,7 +91,9 @@ const child = spawn(process.execPath, [nextBin, ...nextArgs], {
89
91
  wireChildProcessLifecycle(child);
90
92
 
91
93
  let browserOpened = false;
92
- const url = `http://${hostname}:${port}`;
94
+ // A wildcard bind (`-H 0.0.0.0`) answers on loopback too, but browsers refuse
95
+ // to navigate to the wildcard address itself, so open the loopback URL.
96
+ const url = browserUrl(hostname, port);
93
97
 
94
98
  child.stdout.on("data", (chunk) => {
95
99
  const text = chunk.toString();
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+
3
+ /**
4
+ * Hostnames a server may bind to but a browser refuses to navigate to.
5
+ *
6
+ * `0.0.0.0` and `::` are "any interface" wildcards: the OS answers on every
7
+ * address including loopback, so `curl`/`Invoke-WebRequest` succeed, but
8
+ * Chrome/Edge reject the navigation itself (ERR_ADDRESS_INVALID) and show
9
+ * "This page couldn't load". `pi-web -H 0.0.0.0` used to auto-open exactly
10
+ * that URL.
11
+ */
12
+ const WILDCARD_HOSTNAMES = new Set([
13
+ "",
14
+ "0.0.0.0",
15
+ "::",
16
+ "[::]",
17
+ "0:0:0:0:0:0:0:0",
18
+ "[0:0:0:0:0:0:0:0]",
19
+ ]);
20
+
21
+ /** True when the hostname is an "any interface" bind rather than a destination. */
22
+ function isWildcardHostname(hostname) {
23
+ return WILDCARD_HOSTNAMES.has(String(hostname ?? "").trim());
24
+ }
25
+
26
+ /**
27
+ * Build the URL a local browser should open for a server bound to `hostname`.
28
+ *
29
+ * A wildcard bind is reachable over loopback, so the browser is pointed at
30
+ * 127.0.0.1 instead of the wildcard. IPv6 literals are bracketed as URLs
31
+ * require. Anything else (a hostname, a LAN address) is used verbatim.
32
+ */
33
+ function browserUrl(hostname, port) {
34
+ const raw = String(hostname ?? "").trim();
35
+ const host = isWildcardHostname(raw) ? "127.0.0.1" : raw;
36
+ const formatted = host.includes(":") && !host.startsWith("[") ? `[${host}]` : host;
37
+ return `http://${formatted}:${port}`;
38
+ }
39
+
40
+ module.exports = { browserUrl, isWildcardHostname, WILDCARD_HOSTNAMES };
@@ -0,0 +1,44 @@
1
+ import assert from "node:assert/strict";
2
+ import test from "node:test";
3
+ import { createRequire } from "node:module";
4
+
5
+ const require = createRequire(import.meta.url);
6
+ const { browserUrl, isWildcardHostname } = require("./browser-url.js");
7
+
8
+ // Regression: `pi-web -H 0.0.0.0` auto-opened http://0.0.0.0:<port>, which
9
+ // Chrome/Edge refuse to navigate to, so the first thing a user saw was
10
+ // "This page couldn't load" even though the server was healthy.
11
+ test("wildcard binds open the browser on loopback", () => {
12
+ assert.equal(browserUrl("0.0.0.0", 30141), "http://127.0.0.1:30141");
13
+ assert.equal(browserUrl("::", 30141), "http://127.0.0.1:30141");
14
+ assert.equal(browserUrl("[::]", 30141), "http://127.0.0.1:30141");
15
+ assert.equal(browserUrl("0:0:0:0:0:0:0:0", 30141), "http://127.0.0.1:30141");
16
+ assert.equal(browserUrl("", 8080), "http://127.0.0.1:8080");
17
+ });
18
+
19
+ test("concrete hosts are preserved", () => {
20
+ assert.equal(browserUrl("127.0.0.1", 30141), "http://127.0.0.1:30141");
21
+ assert.equal(browserUrl("localhost", 30141), "http://localhost:30141");
22
+ assert.equal(browserUrl("10.10.0.200", 30141), "http://10.10.0.200:30141");
23
+ assert.equal(browserUrl("pi.example.com", 443), "http://pi.example.com:443");
24
+ });
25
+
26
+ test("IPv6 literals are bracketed and never treated as wildcards", () => {
27
+ assert.equal(browserUrl("::1", 30141), "http://[::1]:30141");
28
+ assert.equal(browserUrl("[::1]", 30141), "http://[::1]:30141");
29
+ assert.equal(browserUrl("fe80::1", 30141), "http://[fe80::1]:30141");
30
+ });
31
+
32
+ test("isWildcardHostname only matches any-interface binds", () => {
33
+ for (const value of ["0.0.0.0", "::", "[::]", "", " "]) {
34
+ assert.equal(isWildcardHostname(value), true, `${JSON.stringify(value)} is a wildcard`);
35
+ }
36
+ for (const value of ["127.0.0.1", "::1", "localhost", "10.0.0.5"]) {
37
+ assert.equal(isWildcardHostname(value), false, `${value} is a destination`);
38
+ }
39
+ });
40
+
41
+ test("undefined-ish input degrades to loopback instead of crashing", () => {
42
+ assert.equal(browserUrl(undefined, 30141), "http://127.0.0.1:30141");
43
+ assert.equal(browserUrl(null, 30141), "http://127.0.0.1:30141");
44
+ });
package/bin/pi-web.js CHANGED
@@ -19,6 +19,8 @@ const fs = require("fs");
19
19
  const { getHelpText, parseLaunchOptions } = require("./pi-web-options");
20
20
  // eslint-disable-next-line @typescript-eslint/no-require-imports
21
21
  const { wireChildProcessLifecycle } = require("./process-lifecycle");
22
+ // eslint-disable-next-line @typescript-eslint/no-require-imports
23
+ const { browserUrl } = require("./browser-url");
22
24
 
23
25
  let launchOptions;
24
26
  try {
@@ -89,7 +91,9 @@ const child = spawn(process.execPath, [nextBin, ...nextArgs], {
89
91
  wireChildProcessLifecycle(child);
90
92
 
91
93
  let browserOpened = false;
92
- const url = `http://${hostname}:${port}`;
94
+ // A wildcard bind (`-H 0.0.0.0`) answers on loopback too, but browsers refuse
95
+ // to navigate to the wildcard address itself, so open the loopback URL.
96
+ const url = browserUrl(hostname, port);
93
97
 
94
98
  child.stdout.on("data", (chunk) => {
95
99
  const text = chunk.toString();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@goldenlustre/agent-studio",
3
- "version": "1.0.5",
3
+ "version": "1.0.6",
4
4
  "description": "AgentStudio - AI Agent Development Environment",
5
5
  "homepage": "https://github.com/agegr/agent-studio#readme",
6
6
  "repository": {
@@ -38,7 +38,7 @@
38
38
  "lint": "eslint .",
39
39
  "test:terminal": "node e2e/terminal.mjs",
40
40
  "test:e2e": "node e2e/run.mjs",
41
- "test": "node --experimental-strip-types --test \"app/**/*.test.mjs\" \"components/**/*.test.mjs\" \"hooks/**/*.test.mjs\" \"lib/**/*.test.mjs\" \"public/**/*.test.mjs\"",
41
+ "test": "node --experimental-strip-types --test \"app/**/*.test.mjs\" \"components/**/*.test.mjs\" \"hooks/**/*.test.mjs\" \"lib/**/*.test.mjs\" \"public/**/*.test.mjs\" \"bin/**/*.test.mjs\"",
42
42
  "release": "npm version patch --no-git-tag-version && npm run build && npm publish --access public",
43
43
  "postbuild": "node scripts/postbuild-fix-paths.js"
44
44
  },