@piagent/platform 1.16.0 → 1.16.1
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/README.md +1 -1
- package/README.vi.md +1 -1
- package/docs/command-reference-vietnamese.md +2 -2
- package/docs/distribution-standard.md +6 -6
- package/docs/languages.json +2 -2
- package/docs/operator-manual-vietnamese.md +7 -7
- package/docs/publishing-for-teams.md +2 -1
- package/docs/release-install-policy.md +2 -2
- package/docs/team-onboarding.md +2 -2
- package/docs-site/architecture.html +1 -1
- package/docs-site/benchmark.html +1 -1
- package/docs-site/commands.html +1 -1
- package/docs-site/content/en/index.html +4 -4
- package/docs-site/content/en/whats-new.html +11 -0
- package/docs-site/content/index.html +4 -4
- package/docs-site/content/whats-new.html +11 -0
- package/docs-site/context-engine.html +1 -1
- package/docs-site/ecosystem.html +1 -1
- package/docs-site/en/architecture.html +1 -1
- package/docs-site/en/benchmark.html +1 -1
- package/docs-site/en/commands.html +1 -1
- package/docs-site/en/context-engine.html +1 -1
- package/docs-site/en/ecosystem.html +1 -1
- package/docs-site/en/index.html +5 -5
- package/docs-site/en/mcp-approval.html +1 -1
- package/docs-site/en/mcp-auth.html +1 -1
- package/docs-site/en/mcp-servers.html +1 -1
- package/docs-site/en/mcp.html +1 -1
- package/docs-site/en/permissions.html +1 -1
- package/docs-site/en/profiles.html +1 -1
- package/docs-site/en/quickstart.html +1 -1
- package/docs-site/en/runtime.html +1 -1
- package/docs-site/en/scope.html +1 -1
- package/docs-site/en/security.html +1 -1
- package/docs-site/en/team.html +1 -1
- package/docs-site/en/whats-new.html +12 -1
- package/docs-site/en/windows.html +1 -1
- package/docs-site/en/workflows.html +1 -1
- package/docs-site/index.html +5 -5
- package/docs-site/mcp-approval.html +1 -1
- package/docs-site/mcp-auth.html +1 -1
- package/docs-site/mcp-servers.html +1 -1
- package/docs-site/mcp.html +1 -1
- package/docs-site/permissions.html +1 -1
- package/docs-site/profiles.html +1 -1
- package/docs-site/quickstart.html +1 -1
- package/docs-site/runtime.html +1 -1
- package/docs-site/scope.html +1 -1
- package/docs-site/security.html +1 -1
- package/docs-site/team.html +1 -1
- package/docs-site/whats-new.html +12 -1
- package/docs-site/windows.html +1 -1
- package/docs-site/workflows.html +1 -1
- package/evals/private-holdout-v1/public-exposure.v2.json +1 -1
- package/package.json +1 -1
- package/packages/piagent-core/extensions/update-check.js +2 -2
- package/packages/piagent-core/package.json +1 -1
- package/packages/piagent-webui/dist/client/assets/{MarkdownMessage-FBwt5TJv.js → MarkdownMessage-sL0LOqY0.js} +1 -1
- package/packages/piagent-webui/dist/client/assets/index-Bs8l37SR.js +228 -0
- package/packages/piagent-webui/dist/client/index.html +1 -1
- package/packages/piagent-webui/gateway/update-center.ts +3 -2
- package/packages/piagent-webui/server/loopback-server.ts +1 -0
- package/packages/piagent-webui/server/session-auth.ts +13 -2
- package/packages/piagent-webui/dist/client/assets/index-Bj9Tlouu.js +0 -228
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
<meta name="csp-nonce" content="__PIAGENT_CSP_NONCE__" />
|
|
8
8
|
<meta name="piagent-webui-mode" content="__PIAGENT_WEBUI_MODE__" />
|
|
9
9
|
<title>Piagent WebUI</title>
|
|
10
|
-
<script type="module" crossorigin src="/assets/index-
|
|
10
|
+
<script type="module" crossorigin src="/assets/index-Bs8l37SR.js"></script>
|
|
11
11
|
<link rel="stylesheet" crossorigin href="/assets/index-Z91z6SlN.css">
|
|
12
12
|
</head>
|
|
13
13
|
<body>
|
|
@@ -10,13 +10,14 @@ import { compareReleaseVersions, releaseVersion, writeUpdateCache } from "../../
|
|
|
10
10
|
// past the version the newest Piagent pins (its peer dependency): that is the
|
|
11
11
|
// host its managed runtime is qualified on. A newer Pi is shown as untested.
|
|
12
12
|
//
|
|
13
|
-
// The registry is asked in the background, at most every
|
|
13
|
+
// The registry is asked in the background, at most every hour unless the
|
|
14
14
|
// member asks now; the dashboard reads the cached answer. Everything read from
|
|
15
15
|
// outside (registry answers, the cache and job files any local process could
|
|
16
16
|
// write) is accepted only as release versions and known codes.
|
|
17
17
|
const PLATFORM = "@piagent/platform";
|
|
18
18
|
const HOST = "@earendil-works/pi-coding-agent";
|
|
19
|
-
|
|
19
|
+
// Releases ship several times a day; members should hear within the hour.
|
|
20
|
+
export const CHECK_EVERY_MS = 60 * 60 * 1000;
|
|
20
21
|
const FORCED_CHECK_GAP_MS = 30_000;
|
|
21
22
|
const PROBE_TIMEOUT_MS = 20_000;
|
|
22
23
|
const MAX_FILE_BYTES = 4096;
|
|
@@ -448,6 +448,7 @@ export async function startLoopbackServer(options: {
|
|
|
448
448
|
});
|
|
449
449
|
const address = server.address();
|
|
450
450
|
if (!address || typeof address === "string" || address.address !== "127.0.0.1") { server.close(); throw new Error("loopback-bind-failed"); }
|
|
451
|
+
auth.bindPort(address.port);
|
|
451
452
|
origin = `http://127.0.0.1:${address.port}`;
|
|
452
453
|
return {
|
|
453
454
|
origin,
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { createHmac, randomBytes, randomUUID, timingSafeEqual } from "node:crypto";
|
|
2
2
|
import type { IncomingMessage } from "node:http";
|
|
3
3
|
|
|
4
|
+
// Cookies are scoped by host, not by port: every Piagent server on 127.0.0.1
|
|
5
|
+
// (the Gateway, a company service, an older launch) shares one cookie jar.
|
|
6
|
+
// The name carries the port once bound, so one server's launch no longer
|
|
7
|
+
// replaces the session of another server's open tab.
|
|
4
8
|
const SESSION_COOKIE = "piagent_webui_session";
|
|
5
9
|
|
|
6
10
|
function secret(): string { return randomBytes(32).toString("base64url"); }
|
|
@@ -23,6 +27,7 @@ export class SessionAuthority {
|
|
|
23
27
|
readonly #bootstrapTtlMs: number;
|
|
24
28
|
readonly #sessionTtlMs: number;
|
|
25
29
|
readonly #cookieSigningKey = randomBytes(32);
|
|
30
|
+
#cookieName = SESSION_COOKIE;
|
|
26
31
|
#bootstraps = new Map<string, number>();
|
|
27
32
|
#sessions = new Map<string, BrowserSession>();
|
|
28
33
|
|
|
@@ -33,6 +38,12 @@ export class SessionAuthority {
|
|
|
33
38
|
}
|
|
34
39
|
|
|
35
40
|
get bootstrapCapability(): string { return this.#initialBootstrap; }
|
|
41
|
+
get cookieName(): string { return this.#cookieName; }
|
|
42
|
+
|
|
43
|
+
bindPort(port: number): void {
|
|
44
|
+
if (!Number.isInteger(port) || port < 1 || port > 65_535) throw new Error("invalid-session-port");
|
|
45
|
+
this.#cookieName = `${SESSION_COOKIE}_${port}`;
|
|
46
|
+
}
|
|
36
47
|
|
|
37
48
|
issueBootstrapCapability(now = Date.now()): string {
|
|
38
49
|
for (const [value, createdAt] of this.#bootstraps) {
|
|
@@ -54,7 +65,7 @@ export class SessionAuthority {
|
|
|
54
65
|
}
|
|
55
66
|
|
|
56
67
|
authenticate(request: IncomingMessage, now = Date.now()): BrowserSession | null {
|
|
57
|
-
const value = cookie(request,
|
|
68
|
+
const value = cookie(request, this.#cookieName);
|
|
58
69
|
if (!value) return null;
|
|
59
70
|
const separator = value.lastIndexOf(".");
|
|
60
71
|
if (separator < 1) return null;
|
|
@@ -77,7 +88,7 @@ export class SessionAuthority {
|
|
|
77
88
|
cookieHeader(session: BrowserSession): string {
|
|
78
89
|
const seconds = Math.max(1, Math.floor((session.expiresAt - Date.now()) / 1000));
|
|
79
90
|
const token = `${session.id}.${this.#cookieSignature(session.id)}`;
|
|
80
|
-
return `${
|
|
91
|
+
return `${this.#cookieName}=${token}; HttpOnly; SameSite=Strict; Path=/; Max-Age=${seconds}`;
|
|
81
92
|
}
|
|
82
93
|
|
|
83
94
|
#cookieSignature(id: string): string {
|