@parlor/agent-ui 0.3.2 → 0.4.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.
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { type Principal, type UserId } from "@parlor/core";
|
|
2
2
|
/**
|
|
3
3
|
* Whose screens a request may see and drive: its scope and, once signed in, its user.
|
|
4
|
-
* Without auth, or as the dev user, it is the scope itself.
|
|
4
|
+
* Without auth, or as the dev user, it is the scope itself. A key has its own, which no
|
|
5
|
+
* screen joins.
|
|
5
6
|
*/
|
|
6
7
|
export declare function audienceOf(scope: string, principal: Principal | undefined): string;
|
|
7
8
|
/** `audienceOf` for a known user: the sync stream only that user's tabs and computers hear. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"audience.d.ts","sourceRoot":"","sources":["../../src/server/audience.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,KAAK,SAAS,EAAE,KAAK,MAAM,EAAU,MAAM,cAAc,CAAC;AAEhF
|
|
1
|
+
{"version":3,"file":"audience.d.ts","sourceRoot":"","sources":["../../src/server/audience.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,KAAK,SAAS,EAAE,KAAK,MAAM,EAAU,MAAM,cAAc,CAAC;AAEhF;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,GAAG,SAAS,GAAG,MAAM,CAGlF;AAED,+FAA+F;AAC/F,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAI9E"}
|
package/dist/server/audience.js
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import { DEV_USER_ID, userOf } from "@parlor/core";
|
|
2
2
|
/**
|
|
3
3
|
* Whose screens a request may see and drive: its scope and, once signed in, its user.
|
|
4
|
-
* Without auth, or as the dev user, it is the scope itself.
|
|
4
|
+
* Without auth, or as the dev user, it is the scope itself. A key has its own, which no
|
|
5
|
+
* screen joins.
|
|
5
6
|
*/
|
|
6
7
|
export function audienceOf(scope, principal) {
|
|
8
|
+
if (principal?.kind === "key")
|
|
9
|
+
return `${scope}\u001fkey:${principal.keyId}`;
|
|
7
10
|
return userAudience(scope, userOf(principal));
|
|
8
11
|
}
|
|
9
12
|
/** `audienceOf` for a known user: the sync stream only that user's tabs and computers hear. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"audience.js","sourceRoot":"","sources":["../../src/server/audience.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAA+B,MAAM,EAAE,MAAM,cAAc,CAAC;AAEhF
|
|
1
|
+
{"version":3,"file":"audience.js","sourceRoot":"","sources":["../../src/server/audience.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAA+B,MAAM,EAAE,MAAM,cAAc,CAAC;AAEhF;;;;GAIG;AACH,MAAM,UAAU,UAAU,CAAC,KAAa,EAAE,SAAgC;IACxE,IAAI,SAAS,EAAE,IAAI,KAAK,KAAK;QAAE,OAAO,GAAG,KAAK,aAAa,SAAS,CAAC,KAAK,EAAE,CAAC;IAC7E,OAAO,YAAY,CAAC,KAAK,EAAE,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC;AAChD,CAAC;AAED,+FAA+F;AAC/F,MAAM,UAAU,YAAY,CAAC,KAAa,EAAE,MAA0B;IACpE,OAAO,MAAM,KAAK,SAAS,IAAI,MAAM,KAAK,WAAW;QACnD,CAAC,CAAC,KAAK;QACP,CAAC,CAAC,GAAG,KAAK,SAAS,MAAM,EAAE,CAAC;AAChC,CAAC","sourcesContent":["import { DEV_USER_ID, type Principal, type UserId, userOf } from \"@parlor/core\";\n\n/**\n * Whose screens a request may see and drive: its scope and, once signed in, its user.\n * Without auth, or as the dev user, it is the scope itself. A key has its own, which no\n * screen joins.\n */\nexport function audienceOf(scope: string, principal: Principal | undefined): string {\n if (principal?.kind === \"key\") return `${scope}\\u001fkey:${principal.keyId}`;\n return userAudience(scope, userOf(principal));\n}\n\n/** `audienceOf` for a known user: the sync stream only that user's tabs and computers hear. */\nexport function userAudience(scope: string, userId: UserId | undefined): string {\n return userId === undefined || userId === DEV_USER_ID\n ? scope\n : `${scope}\\u001f${userId}`;\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@parlor/agent-ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"homepage": "https://cychien.github.io/parlor",
|
|
5
5
|
"bugs": "https://github.com/cychien/parlor/issues",
|
|
6
6
|
"license": "MIT",
|
|
@@ -35,8 +35,8 @@
|
|
|
35
35
|
"@standard-schema/spec": "^1.1.0",
|
|
36
36
|
"h3": "^2.0.1",
|
|
37
37
|
"zod": "^4.6.5",
|
|
38
|
-
"@parlor/core": "0.
|
|
39
|
-
"@parlor/sync": "0.
|
|
38
|
+
"@parlor/core": "0.4.0",
|
|
39
|
+
"@parlor/sync": "0.4.0"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@tanstack/react-router": "^1.170.45",
|