@nanobpm/nano-workforce 0.85.2 → 0.86.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.
- package/CHANGELOG.md +14 -0
- package/app/agentic/vocab/README.md +37 -0
- package/app/agentic/vocab/crew-vocab.test.ts +86 -0
- package/app/agentic/vocab/crew-vocab.ts +147 -0
- package/app/agentic/vocab/demand-report.test.ts +97 -0
- package/app/agentic/vocab/demand-report.ts +155 -0
- package/app/agentic/vocab/enrol.test.ts +49 -0
- package/app/agentic/vocab/enrol.ts +74 -0
- package/app/agentic/vocab/publish.test.ts +20 -0
- package/app/agentic/vocab/publish.ts +38 -0
- package/openapi.yaml +350 -0
- package/operations/enrolAgenticWorker.test.ts +89 -0
- package/operations/enrolAgenticWorker.ts +91 -0
- package/operations/getAgenticRegistry.test.ts +53 -0
- package/operations/getAgenticRegistry.ts +25 -0
- package/operations/getAgenticVocab.test.ts +48 -0
- package/operations/getAgenticVocab.ts +20 -0
- package/package.json +1 -1
- package/pages/board/board.css +119 -0
- package/pages/board/embed.html +30 -0
- package/pages/board/mount.js +131 -0
- package/pages/board/standalone.html +37 -0
- package/pages/board.page.json +51 -0
- package/pages/cockpit/embed.html +1 -0
- package/pages/cockpit/mount.js +14 -5
- package/pages/cockpit/standalone.html +15 -5
- package/pages/cockpit.page.json +2 -1
- package/pages/epic-detail.page.json +2 -1
- package/pages/epic.page.json +2 -1
- package/pages/feature.page.json +2 -1
- package/pages/home.page.json +4 -0
- package/pages/lineage.page.json +2 -1
- package/pages/overview.page.json +2 -1
- package/pages/tasks.page.json +4 -0
- package/test/cockpit-embed-endpoints.test.ts +73 -0
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
// Regression guard for issue #279: the cockpit renders empty when viewed through the Studio console
|
|
2
|
+
// App-View because its default supply/transcript endpoints were ABSOLUTE (leading-slash) paths.
|
|
3
|
+
//
|
|
4
|
+
// Studio frames the app in an iframe whose document base is the app-view path
|
|
5
|
+
// (`/console/app-view/<AppName>/`) but whose ORIGIN is the console (`:8080`). A leading-slash fetch
|
|
6
|
+
// therefore resolves against the console origin root — `:8080/app/api/agentic/supply` → 404 — instead
|
|
7
|
+
// of the app-view base that actually serves the API. The console does NOT inject
|
|
8
|
+
// `window.__NANO_APP_VIEW__`, so `mount.js` falls back to its default; the default must be
|
|
9
|
+
// BASE-RELATIVE (no leading slash) so the browser resolves it against `document.baseURI` and it lands
|
|
10
|
+
// on the app-view base standalone AND embedded alike. This test pins that resolution behaviour so the
|
|
11
|
+
// absolute-path regression can't return.
|
|
12
|
+
import { test } from "node:test";
|
|
13
|
+
import { assert, assertEquals } from "#test-assert";
|
|
14
|
+
import { readFileSync } from "node:fs";
|
|
15
|
+
|
|
16
|
+
const ROOT = decodeURIComponent(new URL("../", import.meta.url).pathname);
|
|
17
|
+
const MOUNT_JS = readFileSync(`${ROOT}pages/cockpit/mount.js`, "utf8");
|
|
18
|
+
const EMBED_HTML = readFileSync(`${ROOT}pages/cockpit/embed.html`, "utf8");
|
|
19
|
+
|
|
20
|
+
// Pull the string default out of `const <name> = opts.<name> ?? "<default>";` in mount.js.
|
|
21
|
+
function defaultEndpoint(name: string): string {
|
|
22
|
+
const m = MOUNT_JS.match(new RegExp(`opts\\.${name}\\s*\\?\\?\\s*"([^"]*)"`));
|
|
23
|
+
assert(m, `mount.js must default opts.${name} to a string literal`);
|
|
24
|
+
return m![1];
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// The two surfaces mount.js serves, per the issue's URL table:
|
|
28
|
+
const APP_VIEW_BASE = "http://studio-host:8080/console/app-view/Workforce/"; // Studio iframe base
|
|
29
|
+
const STANDALONE_BASE = "http://127.0.0.1:3000/"; // standalone shell served at the app root
|
|
30
|
+
|
|
31
|
+
for (const name of ["reportUrl", "transcriptsUrl"] as const) {
|
|
32
|
+
test(`#279: mount.js default ${name} is base-relative (no leading slash)`, () => {
|
|
33
|
+
const def = defaultEndpoint(name);
|
|
34
|
+
assert(
|
|
35
|
+
!def.startsWith("/"),
|
|
36
|
+
`default ${name} "${def}" must not start with "/": a leading-slash path resolves against the ` +
|
|
37
|
+
`iframe ORIGIN (console :8080), not the app-view base, so every fetch 404s through Studio (#279)`,
|
|
38
|
+
);
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
test(`#279: default ${name} resolves onto the app-view base inside the Studio iframe`, () => {
|
|
42
|
+
const def = defaultEndpoint(name);
|
|
43
|
+
// The bug: the default resolved to the console origin root (dropping /console/app-view/Workforce/).
|
|
44
|
+
// The fix: it must resolve UNDER the app-view base so it hits the endpoint the console proxies.
|
|
45
|
+
assertEquals(
|
|
46
|
+
new URL(def, APP_VIEW_BASE).href,
|
|
47
|
+
`http://studio-host:8080/console/app-view/Workforce/${def}`,
|
|
48
|
+
`default ${name} must resolve under the app-view base, not the console origin root (#279)`,
|
|
49
|
+
);
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
test(`#279: default ${name} still resolves to the origin root standalone`, () => {
|
|
53
|
+
const def = defaultEndpoint(name);
|
|
54
|
+
assertEquals(
|
|
55
|
+
new URL(def, STANDALONE_BASE).href,
|
|
56
|
+
`http://127.0.0.1:3000/${def}`,
|
|
57
|
+
`default ${name} must keep working for the standalone shell at the app root`,
|
|
58
|
+
);
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
test("#279: embed.html forwards BOTH reportUrl and transcriptsUrl from the injected config", () => {
|
|
63
|
+
// embed.html previously forwarded only reportUrl, so even if the console injected endpoint config
|
|
64
|
+
// the transcripts panel kept its (formerly absolute) default. Both must be forwarded.
|
|
65
|
+
assert(
|
|
66
|
+
/transcriptsUrl:\s*cfg\.transcriptsUrl/.test(EMBED_HTML),
|
|
67
|
+
"embed.html must forward transcriptsUrl: cfg.transcriptsUrl so the injected config reaches the past-sessions panel (#279)",
|
|
68
|
+
);
|
|
69
|
+
assert(
|
|
70
|
+
/reportUrl:\s*cfg\.reportUrl/.test(EMBED_HTML),
|
|
71
|
+
"embed.html must forward reportUrl: cfg.reportUrl",
|
|
72
|
+
);
|
|
73
|
+
});
|