@parlor/agent-ui 0.3.3 → 0.4.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/dist/server/audience.d.ts +8 -1
- package/dist/server/audience.d.ts.map +1 -1
- package/dist/server/audience.js +12 -1
- package/dist/server/audience.js.map +1 -1
- package/dist/server/index.d.ts +1 -1
- package/dist/server/index.d.ts.map +1 -1
- package/dist/server/index.js +1 -1
- package/dist/server/index.js.map +1 -1
- package/package.json +3 -3
|
@@ -1,9 +1,16 @@
|
|
|
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. */
|
|
8
9
|
export declare function userAudience(scope: string, userId: UserId | undefined): string;
|
|
10
|
+
/**
|
|
11
|
+
* The stream every tab and computer of one signed-in user hears, whatever scope each is in:
|
|
12
|
+
* what belongs to the person rather than to a scope, such as their computers. Undefined
|
|
13
|
+
* without a user, where `userAudience` already reaches everyone.
|
|
14
|
+
*/
|
|
15
|
+
export declare function accountAudience(userId: UserId | undefined): string | undefined;
|
|
9
16
|
//# sourceMappingURL=audience.d.ts.map
|
|
@@ -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;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAE9E"}
|
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. */
|
|
@@ -12,4 +15,12 @@ export function userAudience(scope, userId) {
|
|
|
12
15
|
? scope
|
|
13
16
|
: `${scope}\u001f${userId}`;
|
|
14
17
|
}
|
|
18
|
+
/**
|
|
19
|
+
* The stream every tab and computer of one signed-in user hears, whatever scope each is in:
|
|
20
|
+
* what belongs to the person rather than to a scope, such as their computers. Undefined
|
|
21
|
+
* without a user, where `userAudience` already reaches everyone.
|
|
22
|
+
*/
|
|
23
|
+
export function accountAudience(userId) {
|
|
24
|
+
return userId === undefined || userId === DEV_USER_ID ? undefined : `\u001f${userId}`;
|
|
25
|
+
}
|
|
15
26
|
//# sourceMappingURL=audience.js.map
|
|
@@ -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;AAED;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAAC,MAA0B;IACxD,OAAO,MAAM,KAAK,SAAS,IAAI,MAAM,KAAK,WAAW,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC;AACxF,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\n/**\n * The stream every tab and computer of one signed-in user hears, whatever scope each is in:\n * what belongs to the person rather than to a scope, such as their computers. Undefined\n * without a user, where `userAudience` already reaches everyone.\n */\nexport function accountAudience(userId: UserId | undefined): string | undefined {\n return userId === undefined || userId === DEV_USER_ID ? undefined : `\\u001f${userId}`;\n}\n"]}
|
package/dist/server/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { type AgentUi, type AgentUiDependencies, type AgentUiOptions, createAgentUi, DEFAULT_UI_TIMEOUT_MS, type ExternalUiPolicy, webOriginFromEnv, } from "./agent-ui.js";
|
|
2
|
-
export { audienceOf, userAudience } from "./audience.js";
|
|
2
|
+
export { accountAudience, audienceOf, userAudience } from "./audience.js";
|
|
3
3
|
export { type ConfirmationOutcome, type ConfirmationRequest, type ConfirmationThread, DEFAULT_CONFIRM_TIMEOUT_MS, } from "./confirmations.js";
|
|
4
4
|
export { fileManifestSource, type UiManifestInput, type UiManifestSource, } from "./manifest-source.js";
|
|
5
5
|
export { type BrokerOptions, UiBroker, UiFailure, type UiReceipt } from "./broker.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/server/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,mBAAmB,EACxB,KAAK,cAAc,EACnB,aAAa,EACb,qBAAqB,EACrB,KAAK,gBAAgB,EACrB,gBAAgB,GACjB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/server/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,mBAAmB,EACxB,KAAK,cAAc,EACnB,aAAa,EACb,qBAAqB,EACrB,KAAK,gBAAgB,EACrB,gBAAgB,GACjB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC1E,OAAO,EACL,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EACvB,0BAA0B,GAC3B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,kBAAkB,EAClB,KAAK,eAAe,EACpB,KAAK,gBAAgB,GACtB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,KAAK,aAAa,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,aAAa,CAAC;AACtF,OAAO,EACL,eAAe,EACf,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,KAAK,eAAe,EACpB,KAAK,SAAS,GACf,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,KAAK,mBAAmB,EACxB,wBAAwB,EACxB,qBAAqB,GACtB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC9D,OAAO,EACL,KAAK,SAAS,EACd,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACrB,KAAK,aAAa,EAClB,oBAAoB,EACpB,QAAQ,EACR,KAAK,UAAU,EACf,KAAK,iBAAiB,GACvB,MAAM,YAAY,CAAC"}
|
package/dist/server/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { createAgentUi, DEFAULT_UI_TIMEOUT_MS, webOriginFromEnv, } from "./agent-ui.js";
|
|
2
|
-
export { audienceOf, userAudience } from "./audience.js";
|
|
2
|
+
export { accountAudience, audienceOf, userAudience } from "./audience.js";
|
|
3
3
|
export { DEFAULT_CONFIRM_TIMEOUT_MS, } from "./confirmations.js";
|
|
4
4
|
export { fileManifestSource, } from "./manifest-source.js";
|
|
5
5
|
export { UiBroker, UiFailure } from "./broker.js";
|
package/dist/server/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/server/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,aAAa,EACb,qBAAqB,EAErB,gBAAgB,GACjB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/server/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,aAAa,EACb,qBAAqB,EAErB,gBAAgB,GACjB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC1E,OAAO,EAIL,0BAA0B,GAC3B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,kBAAkB,GAGnB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAsB,QAAQ,EAAE,SAAS,EAAkB,MAAM,aAAa,CAAC;AACtF,OAAO,EACL,eAAe,GAKhB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAEL,wBAAwB,EACxB,qBAAqB,GACtB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC9D,OAAO,EAOL,oBAAoB,EACpB,QAAQ,GAGT,MAAM,YAAY,CAAC","sourcesContent":["export {\n type AgentUi,\n type AgentUiDependencies,\n type AgentUiOptions,\n createAgentUi,\n DEFAULT_UI_TIMEOUT_MS,\n type ExternalUiPolicy,\n webOriginFromEnv,\n} from \"./agent-ui.js\";\nexport { accountAudience, audienceOf, userAudience } from \"./audience.js\";\nexport {\n type ConfirmationOutcome,\n type ConfirmationRequest,\n type ConfirmationThread,\n DEFAULT_CONFIRM_TIMEOUT_MS,\n} from \"./confirmations.js\";\nexport {\n fileManifestSource,\n type UiManifestInput,\n type UiManifestSource,\n} from \"./manifest-source.js\";\nexport { type BrokerOptions, UiBroker, UiFailure, type UiReceipt } from \"./broker.js\";\nexport {\n ClientDirectory,\n type ClientTarget,\n type ConnectedClient,\n type PresenceOutcome,\n type Selection,\n} from \"./directory.js\";\nexport {\n type AgentUiRouteOptions,\n MAX_CLIENT_MESSAGE_BYTES,\n registerAgentUiRoutes,\n} from \"./routes.js\";\nexport { parseClientMessage, uiOpInputs } from \"./schemas.js\";\nexport {\n type AgentTool,\n type AgentToolContext,\n type HighlightToolResult,\n type NavigateToolResult,\n type ScreenToolResult,\n type SetToolResult,\n UI_MANIFEST_RESOURCE,\n UI_TOOLS,\n type UiToolName,\n type UnreachableResult,\n} from \"./tools.js\";\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@parlor/agent-ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.1",
|
|
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.1",
|
|
39
|
+
"@parlor/sync": "0.4.1"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@tanstack/react-router": "^1.170.45",
|