@jini-ai/agentic 0.1.1 → 0.3.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/README.md +92 -0
- package/dist/a2ui/agent-to-renderer.d.ts +36 -2
- package/dist/a2ui/agent-to-renderer.d.ts.map +1 -1
- package/dist/a2ui/agent-to-renderer.js +23 -1
- package/dist/a2ui/agent-to-renderer.js.map +1 -1
- package/dist/a2ui/interpreter.d.ts +24 -1
- package/dist/a2ui/interpreter.d.ts.map +1 -1
- package/dist/a2ui/interpreter.js +115 -65
- package/dist/a2ui/interpreter.js.map +1 -1
- package/dist/a2ui/json-pointer.d.ts.map +1 -1
- package/dist/a2ui/json-pointer.js +28 -3
- package/dist/a2ui/json-pointer.js.map +1 -1
- package/dist/a2ui/renderer-to-agent.d.ts +35 -11
- package/dist/a2ui/renderer-to-agent.d.ts.map +1 -1
- package/dist/a2ui/renderer-to-agent.js +15 -2
- package/dist/a2ui/renderer-to-agent.js.map +1 -1
- package/dist/a2ui/resolve.d.ts +1 -1
- package/dist/a2ui/resolve.d.ts.map +1 -1
- package/dist/a2ui/resolve.js +29 -3
- package/dist/a2ui/resolve.js.map +1 -1
- package/dist/a2ui/tree.d.ts +27 -2
- package/dist/a2ui/tree.d.ts.map +1 -1
- package/dist/a2ui/tree.js +48 -9
- package/dist/a2ui/tree.js.map +1 -1
- package/dist/ag-ui.d.ts.map +1 -1
- package/dist/ag-ui.js +30 -1
- package/dist/ag-ui.js.map +1 -1
- package/dist/core/a2ui/agent-to-renderer.d.ts +613 -0
- package/dist/core/a2ui/agent-to-renderer.d.ts.map +1 -0
- package/dist/core/a2ui/agent-to-renderer.js +191 -0
- package/dist/core/a2ui/agent-to-renderer.js.map +1 -0
- package/dist/core/a2ui/catalog.d.ts +73 -0
- package/dist/core/a2ui/catalog.d.ts.map +1 -0
- package/dist/core/a2ui/catalog.js +304 -0
- package/dist/core/a2ui/catalog.js.map +1 -0
- package/dist/core/a2ui/common-types.d.ts +401 -0
- package/dist/core/a2ui/common-types.d.ts.map +1 -0
- package/dist/core/a2ui/common-types.js +130 -0
- package/dist/core/a2ui/common-types.js.map +1 -0
- package/dist/core/a2ui/index.d.ts +16 -0
- package/dist/core/a2ui/index.d.ts.map +1 -0
- package/dist/core/a2ui/index.js +16 -0
- package/dist/core/a2ui/index.js.map +1 -0
- package/dist/core/a2ui/interpreter.d.ts +71 -0
- package/dist/core/a2ui/interpreter.d.ts.map +1 -0
- package/dist/core/a2ui/interpreter.js +341 -0
- package/dist/core/a2ui/interpreter.js.map +1 -0
- package/dist/core/a2ui/json-pointer.d.ts +48 -0
- package/dist/core/a2ui/json-pointer.d.ts.map +1 -0
- package/dist/core/a2ui/json-pointer.js +174 -0
- package/dist/core/a2ui/json-pointer.js.map +1 -0
- package/dist/core/a2ui/renderer-to-agent.d.ts +342 -0
- package/dist/core/a2ui/renderer-to-agent.d.ts.map +1 -0
- package/dist/core/a2ui/renderer-to-agent.js +111 -0
- package/dist/core/a2ui/renderer-to-agent.js.map +1 -0
- package/dist/core/a2ui/resolve.d.ts +28 -0
- package/dist/core/a2ui/resolve.d.ts.map +1 -0
- package/dist/core/a2ui/resolve.js +144 -0
- package/dist/core/a2ui/resolve.js.map +1 -0
- package/dist/core/a2ui/tree.d.ts +66 -0
- package/dist/core/a2ui/tree.d.ts.map +1 -0
- package/dist/core/a2ui/tree.js +74 -0
- package/dist/core/a2ui/tree.js.map +1 -0
- package/dist/core/ag-ui.d.ts +82 -0
- package/dist/core/ag-ui.d.ts.map +1 -0
- package/dist/core/ag-ui.js +85 -0
- package/dist/core/ag-ui.js.map +1 -0
- package/dist/core/capability.d.ts +81 -0
- package/dist/core/capability.d.ts.map +1 -0
- package/dist/core/capability.js +79 -0
- package/dist/core/capability.js.map +1 -0
- package/dist/core/dom/dom-page-driver.d.ts +36 -0
- package/dist/core/dom/dom-page-driver.d.ts.map +1 -0
- package/dist/core/dom/dom-page-driver.js +601 -0
- package/dist/core/dom/dom-page-driver.js.map +1 -0
- package/dist/core/dom/index.d.ts +17 -0
- package/dist/core/dom/index.d.ts.map +1 -0
- package/dist/core/dom/index.js +17 -0
- package/dist/core/dom/index.js.map +1 -0
- package/dist/core/dom/model-context.d.ts +69 -0
- package/dist/core/dom/model-context.d.ts.map +1 -0
- package/dist/core/dom/model-context.js +44 -0
- package/dist/core/dom/model-context.js.map +1 -0
- package/dist/core/element-handles.d.ts +120 -0
- package/dist/core/element-handles.d.ts.map +1 -0
- package/dist/core/element-handles.js +39 -0
- package/dist/core/element-handles.js.map +1 -0
- package/dist/core/gen-ui/encoder.d.ts +50 -0
- package/dist/core/gen-ui/encoder.d.ts.map +1 -0
- package/dist/core/gen-ui/encoder.js +97 -0
- package/dist/core/gen-ui/encoder.js.map +1 -0
- package/dist/core/gen-ui/events.d.ts +59 -0
- package/dist/core/gen-ui/events.d.ts.map +1 -0
- package/dist/core/gen-ui/events.js +15 -0
- package/dist/core/gen-ui/events.js.map +1 -0
- package/dist/core/gen-ui/index.d.ts +18 -0
- package/dist/core/gen-ui/index.d.ts.map +1 -0
- package/dist/core/gen-ui/index.js +17 -0
- package/dist/core/gen-ui/index.js.map +1 -0
- package/dist/core/guards.d.ts +96 -0
- package/dist/core/guards.d.ts.map +1 -0
- package/dist/core/guards.js +186 -0
- package/dist/core/guards.js.map +1 -0
- package/dist/core/handle.d.ts +41 -0
- package/dist/core/handle.d.ts.map +1 -0
- package/dist/core/handle.js +41 -0
- package/dist/core/handle.js.map +1 -0
- package/dist/core/index.d.ts +75 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +74 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/list-handles.d.ts +43 -0
- package/dist/core/list-handles.d.ts.map +1 -0
- package/dist/core/list-handles.js +57 -0
- package/dist/core/list-handles.js.map +1 -0
- package/dist/core/mcp-ui-apps.d.ts +223 -0
- package/dist/core/mcp-ui-apps.d.ts.map +1 -0
- package/dist/core/mcp-ui-apps.js +252 -0
- package/dist/core/mcp-ui-apps.js.map +1 -0
- package/dist/core/page-capabilities.d.ts +14 -0
- package/dist/core/page-capabilities.d.ts.map +1 -0
- package/dist/core/page-capabilities.js +129 -0
- package/dist/core/page-capabilities.js.map +1 -0
- package/dist/core/page-driver.d.ts +120 -0
- package/dist/core/page-driver.d.ts.map +1 -0
- package/dist/core/page-driver.js +2 -0
- package/dist/core/page-driver.js.map +1 -0
- package/dist/core/page-executor.d.ts +94 -0
- package/dist/core/page-executor.d.ts.map +1 -0
- package/dist/core/page-executor.js +320 -0
- package/dist/core/page-executor.js.map +1 -0
- package/dist/core/webmcp.d.ts +202 -0
- package/dist/core/webmcp.d.ts.map +1 -0
- package/dist/core/webmcp.js +173 -0
- package/dist/core/webmcp.js.map +1 -0
- package/dist/dom/dom-page-driver.d.ts +9 -2
- package/dist/dom/dom-page-driver.d.ts.map +1 -1
- package/dist/dom/dom-page-driver.js +84 -40
- package/dist/dom/dom-page-driver.js.map +1 -1
- package/dist/dom/index.d.ts +1 -1
- package/dist/dom/index.d.ts.map +1 -1
- package/dist/dom/index.js +1 -1
- package/dist/dom/index.js.map +1 -1
- package/dist/element-handles.d.ts +22 -1
- package/dist/element-handles.d.ts.map +1 -1
- package/dist/gen-ui/encoder.d.ts +8 -8
- package/dist/gen-ui/encoder.d.ts.map +1 -1
- package/dist/gen-ui/encoder.js +2 -2
- package/dist/gen-ui/encoder.js.map +1 -1
- package/dist/gen-ui/events.d.ts +10 -10
- package/dist/gen-ui/events.d.ts.map +1 -1
- package/dist/gen-ui/index.d.ts +3 -3
- package/dist/gen-ui/index.d.ts.map +1 -1
- package/dist/gen-ui/index.js +2 -2
- package/dist/gen-ui/index.js.map +1 -1
- package/dist/guards.d.ts +8 -3
- package/dist/guards.d.ts.map +1 -1
- package/dist/guards.js +6 -1
- package/dist/guards.js.map +1 -1
- package/dist/index.d.ts +4 -62
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -61
- package/dist/index.js.map +1 -1
- package/dist/mcp-ui-apps.d.ts +19 -0
- package/dist/mcp-ui-apps.d.ts.map +1 -1
- package/dist/mcp-ui-apps.js +50 -5
- package/dist/mcp-ui-apps.js.map +1 -1
- package/dist/page-capabilities.js +6 -6
- package/dist/page-capabilities.js.map +1 -1
- package/dist/page-driver.d.ts +15 -2
- package/dist/page-driver.d.ts.map +1 -1
- package/dist/page-executor.d.ts +11 -4
- package/dist/page-executor.d.ts.map +1 -1
- package/dist/page-executor.js +47 -15
- package/dist/page-executor.js.map +1 -1
- package/package.json +18 -9
package/dist/gen-ui/encoder.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Creates a fresh `
|
|
2
|
+
* Creates a fresh `GenUiEncoder` with its own, empty tool-call correlation map.
|
|
3
3
|
* @complexity `encode` is O(1) per call (one `Map` get/set/delete); memory is O(k) in the number
|
|
4
4
|
* of currently in-flight (not yet resolved) tool calls for the run this instance encodes.
|
|
5
5
|
* @overallScore 100/100
|
|
6
6
|
*/
|
|
7
|
-
export function
|
|
7
|
+
export function createGenUiEncoder() {
|
|
8
8
|
const pendingToolCalls = new Map();
|
|
9
9
|
function baseFields(ctx) {
|
|
10
10
|
const ts = ctx.now ? ctx.now() : Date.now();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"encoder.js","sourceRoot":"","sources":["../../src/gen-ui/encoder.ts"],"names":[],"mappings":"AAkDA;;;;;GAKG;AACH,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"encoder.js","sourceRoot":"","sources":["../../src/gen-ui/encoder.ts"],"names":[],"mappings":"AAkDA;;;;;GAKG;AACH,MAAM,UAAU,kBAAkB;IAChC,MAAM,gBAAgB,GAAG,IAAI,GAAG,EAA2B,CAAC;IAE5D,SAAS,UAAU,CAAC,GAAuB;QACzC,MAAM,EAAE,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,GAA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plan §3a) into this `src/gen-ui/`
|
|
12
12
|
* subdirectory — see `./encoder.ts` for why it is kept apart from the flat `ag-ui.ts`.
|
|
13
13
|
*/
|
|
14
|
-
export type
|
|
15
|
-
export interface
|
|
16
|
-
kind:
|
|
14
|
+
export type GenUiEventKind = 'agent.message' | 'tool_call' | 'state_update' | 'ui.surface_requested' | 'ui.surface_responded' | 'run.lifecycle';
|
|
15
|
+
export interface GenUiEventBase {
|
|
16
|
+
kind: GenUiEventKind;
|
|
17
17
|
runId: string;
|
|
18
18
|
seq?: number;
|
|
19
19
|
ts: number;
|
|
20
20
|
}
|
|
21
|
-
export interface
|
|
21
|
+
export interface GenUiAgentMessageEvent extends GenUiEventBase {
|
|
22
22
|
kind: 'agent.message';
|
|
23
23
|
text: string;
|
|
24
24
|
done?: boolean;
|
|
25
25
|
}
|
|
26
|
-
export interface
|
|
26
|
+
export interface GenUiToolCallEvent extends GenUiEventBase {
|
|
27
27
|
kind: 'tool_call';
|
|
28
28
|
toolName: string;
|
|
29
29
|
args: unknown;
|
|
@@ -31,29 +31,29 @@ export interface AGUIToolCallEvent extends AGUIEventBase {
|
|
|
31
31
|
status?: 'started' | 'completed' | 'failed';
|
|
32
32
|
result?: unknown;
|
|
33
33
|
}
|
|
34
|
-
export interface
|
|
34
|
+
export interface GenUiStateUpdateEvent extends GenUiEventBase {
|
|
35
35
|
kind: 'state_update';
|
|
36
36
|
path: string;
|
|
37
37
|
value: unknown;
|
|
38
38
|
}
|
|
39
|
-
export interface
|
|
39
|
+
export interface GenUiSurfaceRequestedEvent extends GenUiEventBase {
|
|
40
40
|
kind: 'ui.surface_requested';
|
|
41
41
|
surfaceId: string;
|
|
42
42
|
surfaceKind: 'form' | 'choice' | 'confirmation' | 'oauth-prompt';
|
|
43
43
|
payload: unknown;
|
|
44
44
|
}
|
|
45
|
-
export interface
|
|
45
|
+
export interface GenUiSurfaceRespondedEvent extends GenUiEventBase {
|
|
46
46
|
kind: 'ui.surface_responded';
|
|
47
47
|
surfaceId: string;
|
|
48
48
|
value: unknown;
|
|
49
49
|
respondedBy: 'user' | 'agent' | 'auto' | 'cache';
|
|
50
50
|
}
|
|
51
|
-
export interface
|
|
51
|
+
export interface GenUiRunLifecycleEvent extends GenUiEventBase {
|
|
52
52
|
kind: 'run.lifecycle';
|
|
53
53
|
status: 'started' | 'pipeline_stage_started' | 'pipeline_stage_completed' | 'completed' | 'cancelled' | 'failed';
|
|
54
54
|
stageId?: string;
|
|
55
55
|
iteration?: number;
|
|
56
56
|
message?: string;
|
|
57
57
|
}
|
|
58
|
-
export type
|
|
58
|
+
export type GenUiEvent = GenUiAgentMessageEvent | GenUiToolCallEvent | GenUiStateUpdateEvent | GenUiSurfaceRequestedEvent | GenUiSurfaceRespondedEvent | GenUiRunLifecycleEvent;
|
|
59
59
|
//# sourceMappingURL=events.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/gen-ui/events.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/gen-ui/events.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,MAAM,MAAM,cAAc,GACtB,eAAe,GACf,WAAW,GACX,cAAc,GACd,sBAAsB,GACtB,sBAAsB,GACtB,eAAe,CAAC;AAEpB,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,cAAc,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,MAAM,WAAW,sBAAuB,SAAQ,cAAc;IAC5D,IAAI,EAAE,eAAe,CAAC;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED,MAAM,WAAW,kBAAmB,SAAQ,cAAc;IACxD,IAAI,EAAE,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this. See `source-map.md` for how the two came to be confused.
|
|
12
12
|
*
|
|
13
13
|
* Nothing here opens a connection or touches a browser global. Transport (SSE, WebSocket) belongs
|
|
14
|
-
* to a host — `@jini-ai/http`'s run-stream route is the shipped consumer.
|
|
14
|
+
* to a host — `@jini-ai/http-kit`'s run-stream route is the shipped consumer.
|
|
15
15
|
*/
|
|
16
|
-
export {
|
|
17
|
-
export type {
|
|
16
|
+
export { createGenUiEncoder, type GenUiEncodeContext, type GenUiEncoder, } from './encoder.js';
|
|
17
|
+
export type { GenUiAgentMessageEvent, GenUiEvent, GenUiEventBase, GenUiEventKind, GenUiRunLifecycleEvent, GenUiStateUpdateEvent, GenUiSurfaceRequestedEvent, GenUiSurfaceRespondedEvent, GenUiToolCallEvent, } from './events.js';
|
|
18
18
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/gen-ui/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/gen-ui/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,kBAAkB,EAClB,KAAK,kBAAkB,EACvB,KAAK,YAAY,GAClB,MAAM,cAAc,CAAC;AAEtB,YAAY,EACV,sBAAsB,EACtB,UAAU,EACV,cAAc,EACd,cAAc,EACd,sBAAsB,EACtB,qBAAqB,EACrB,0BAA0B,EAC1B,0BAA0B,EAC1B,kBAAkB,GACnB,MAAM,aAAa,CAAC"}
|
package/dist/gen-ui/index.js
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* root, apart from this. See `source-map.md` for how the two came to be confused.
|
|
12
12
|
*
|
|
13
13
|
* Nothing here opens a connection or touches a browser global. Transport (SSE, WebSocket) belongs
|
|
14
|
-
* to a host — `@jini-ai/http`'s run-stream route is the shipped consumer.
|
|
14
|
+
* to a host — `@jini-ai/http-kit`'s run-stream route is the shipped consumer.
|
|
15
15
|
*/
|
|
16
|
-
export {
|
|
16
|
+
export { createGenUiEncoder, } from './encoder.js';
|
|
17
17
|
//# sourceMappingURL=index.js.map
|
package/dist/gen-ui/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/gen-ui/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/gen-ui/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,kBAAkB,GAGnB,MAAM,cAAc,CAAC"}
|
package/dist/guards.d.ts
CHANGED
|
@@ -18,15 +18,20 @@ export interface FieldDescriptor {
|
|
|
18
18
|
readonly name?: string | undefined;
|
|
19
19
|
readonly id?: string | undefined;
|
|
20
20
|
/**
|
|
21
|
-
*
|
|
22
|
-
*
|
|
21
|
+
* **Every** human-visible naming of the field the driver could resolve — `aria-label`,
|
|
22
|
+
* `placeholder`, and the text of each associated `<label>`.
|
|
23
23
|
*
|
|
24
24
|
* Carried because `name`/`id` are the *machine* names, and a form builder or CMS that emits
|
|
25
25
|
* `name="field_47"` leaves the guard nothing to judge while the page still plainly reads
|
|
26
26
|
* "Card number" to the user. A field whose sensitivity is stated only in its label was
|
|
27
27
|
* invisible to every refusal here until this existed.
|
|
28
|
+
*
|
|
29
|
+
* Plural, and required to be exhaustive, because the singular form this replaced took whichever
|
|
30
|
+
* source resolved *first*: a page could then mask a sensitive field behind a benign one —
|
|
31
|
+
* `<label for=f>Card number</label><input id=f name=field_47 placeholder="Enter value">` reached
|
|
32
|
+
* the guard as the single label "Enter value", and its value was reported back in full.
|
|
28
33
|
*/
|
|
29
|
-
readonly
|
|
34
|
+
readonly accessibleLabels?: readonly string[] | undefined;
|
|
30
35
|
readonly readOnly?: boolean | undefined;
|
|
31
36
|
readonly disabled?: boolean | undefined;
|
|
32
37
|
}
|
package/dist/guards.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"guards.d.ts","sourceRoot":"","sources":["../src/guards.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,2FAA2F;AAC3F,MAAM,WAAW,eAAe;IAC9B,wCAAwC;IACxC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACnC,gDAAgD;IAChD,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3C,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACnC,QAAQ,CAAC,EAAE,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACjC
|
|
1
|
+
{"version":3,"file":"guards.d.ts","sourceRoot":"","sources":["../src/guards.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,2FAA2F;AAC3F,MAAM,WAAW,eAAe;IAC9B,wCAAwC;IACxC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACnC,gDAAgD;IAChD,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3C,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACnC,QAAQ,CAAC,EAAE,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACjC;;;;;;;;;;;;;OAaG;IACH,QAAQ,CAAC,gBAAgB,CAAC,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,CAAC;IAC1D,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IACxC,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;CACzC;AAuDD;;;;;;;GAOG;AACH,MAAM,MAAM,gBAAgB,GACxB,aAAa,GACb,qBAAqB,GACrB,iBAAiB,CAAC;AAYtB,MAAM,MAAM,YAAY,GAAG,gBAAgB,GAAG,UAAU,GAAG,WAAW,GAAG,UAAU,CAAC;AAEpF;;;;;;;;;;;GAWG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,eAAe,GAAG,gBAAgB,GAAG,IAAI,CA+BpF;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,eAAe,GAAG,YAAY,GAAG,IAAI,CAQhF;AAiBD,0GAA0G;AAC1G,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,YAAY,GAAG,MAAM,CAElE;AAED,4IAA4I;AAC5I,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,gBAAgB,GAAG,MAAM,CAE1E;AAED,2DAA2D;AAC3D,eAAO,MAAM,sBAAsB,MAAM,CAAC;AAa1C,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;CAC7B;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,EAAE,SAAS,SAAyB,GAAG,eAAe,CAKpG"}
|
package/dist/guards.js
CHANGED
|
@@ -97,7 +97,12 @@ export function findFieldReadRefusal(field) {
|
|
|
97
97
|
|| SUSPICIOUS_NAME.test(squashSeparators(field.id ?? ''))
|
|
98
98
|
// `name`/`id` are the *machine* names; a form builder or CMS that emits `name="field_47"`
|
|
99
99
|
// next to a visible "Card number" label left the guard nothing to judge until this existed.
|
|
100
|
-
|
|
100
|
+
//
|
|
101
|
+
// Each label is squashed and matched on its own rather than as one joined string: squashing
|
|
102
|
+
// deletes the separators, so a join would let two innocuous labels form a trigger word across
|
|
103
|
+
// their boundary ("Address" + "Snapshot" -> "addresssnapshot", which contains "ssn"). This
|
|
104
|
+
// guard is deliberately over-inclusive, but not at the cost of matching text no page wrote.
|
|
105
|
+
|| (field.accessibleLabels ?? []).some((label) => SUSPICIOUS_NAME.test(squashSeparators(label)))) {
|
|
101
106
|
return 'suspicious-name';
|
|
102
107
|
}
|
|
103
108
|
return null;
|
package/dist/guards.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"guards.js","sourceRoot":"","sources":["../src/guards.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;
|
|
1
|
+
{"version":3,"file":"guards.js","sourceRoot":"","sources":["../src/guards.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AA6BH,yDAAyD;AACzD,MAAM,YAAY,GAAG,IAAI,GAAG,CAAC,CAAC,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;AAEtE,wFAAwF;AACxF,MAAM,mBAAmB,GAAG,IAAI,GAAG,CAAC;IAClC,kBAAkB,EAAE,cAAc,EAAE,eAAe;IACnD,WAAW,EAAE,QAAQ,EAAE,cAAc,EAAE,aAAa,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS;CACrF,CAAC,CAAC;AAEH;;;;;;GAMG;AACH,MAAM,eAAe,GACnB,+OAA+O,CAAC;AAElP,yFAAyF;AACzF,uFAAuF;AACvF,2FAA2F;AAC3F,kFAAkF;AAClF,wFAAwF;AACxF,6FAA6F;AAE7F;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,SAAS,gBAAgB,CAAC,KAAa;IACrC,MAAM,WAAW,GAAG,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IAC5C,MAAM,YAAY,GAAG,WAAW,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC;IACzE,OAAO,YAAY,CAAC,OAAO,CAAC,aAAa,EAAE,EAAE,CAAC,CAAC;AACjD,CAAC;AAeD;;;;;;;GAOG;AACH,MAAM,cAAc,GAAG,IAAI,GAAG,CAAC,CAAC,UAAU,EAAE,OAAO,EAA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jF,MAAM,QAAQ,GAAG,GAAG,CAAC,OAAO,CAAC,gBAAgB,EAAE,GAAG,CAAC,CAAC;IACpD,MAAM,SAAS,GAAG,QAAQ,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;IACvD,IAAI,SAAS,CAAC,MAAM,IAAI,SAAS;QAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;IAChF,OAAO,EAAE,IAAI,EAAE,SAAS,CAAC,KAAK,CAAC,CAAC,EAAE,SAAS,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;AAClE,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,65 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* transport: the capability vocabulary, the two shipped manifests, the `data-agent-*` markup
|
|
6
|
-
* convention, and the refusals that must hold everywhere.
|
|
7
|
-
*
|
|
8
|
-
* Framework bindings (`@jini-ai/chat-react`, via `@jini-ai/agentic/dom`'s `createDomPageDriver`, and
|
|
9
|
-
* any Vue/Svelte sibling) import from here and add only the wiring their framework needs.
|
|
10
|
-
* Server-side hosts (an HTTP route table, an MCP stdio server) import the same manifests, so the
|
|
11
|
-
* two can never drift apart.
|
|
12
|
-
*
|
|
13
|
-
* What is deliberately NOT here: how an action reaches a page. That is a transport concern —
|
|
14
|
-
* same-document in a real site like a CMS, `postMessage` when a host embeds an untrusted
|
|
15
|
-
* preview in a sandboxed frame. The verbs are identical either way. Also not here: any product's
|
|
16
|
-
* OWN capabilities (`@jini-ai/chat-core`'s `chat.*` verbs stay in chat-core, which depends on this
|
|
17
|
-
* package for the vocabulary rather than the other way around) — see this package's
|
|
18
|
-
* source-map.md for why the split is real rather than a wholesale relocation.
|
|
2
|
+
* Compatibility root — re-exports `./core` unchanged so existing `from '@jini-ai/agentic'`
|
|
3
|
+
* imports keep resolving. New code should prefer the explicit `@jini-ai/agentic/core` import;
|
|
4
|
+
* see `core/README.md` for why this package is split the way it is.
|
|
19
5
|
*/
|
|
20
|
-
export
|
|
21
|
-
export type { PageDriver, FindElementsFilter } from './page-driver.js';
|
|
22
|
-
export { executePageCapability, projectElementState, DEFAULT_HIGHLIGHT_MS, MAX_HIGHLIGHT_MS, MAX_STATEFUL_ELEMENTS, type FindElementsResult, type PageElementResult, type PageSummary, type PageWriteObservation, } from './page-executor.js';
|
|
23
|
-
export { PAGE_CAPABILITIES } from './page-capabilities.js';
|
|
24
|
-
export { AGENT_ELEMENT_ATTRIBUTE, AGENT_ROLE_ATTRIBUTE, AGENT_LABEL_ATTRIBUTE, AGENT_PAGE_ATTRIBUTE, AGENT_ELEMENT_ROLES, isValidElementHandle, resolveHandleSelector, type AgentElementRole, type AgentElementDescriptor, type AgentElementRawState, type AgentElementState, } from './element-handles.js';
|
|
25
|
-
export { agentHandle, type AgentHandleOptions, type AgentHandleProps } from './handle.js';
|
|
26
|
-
export { findFieldFillRefusal, findFieldReadRefusal, describeFieldRefusal, describeFieldReadRefusal, normalizeAgentLabel, MAX_AGENT_LABEL_LENGTH, type FieldDescriptor, type FieldRefusal, type FieldReadRefusal, type NormalizedLabel, } from './guards.js';
|
|
27
|
-
/**
|
|
28
|
-
* Protocol adapters, named for what they derive from.
|
|
29
|
-
*
|
|
30
|
-
* Each is a ONE-WAY projection out of the neutral core: they import `capability.js`, and nothing
|
|
31
|
-
* imports back. That direction is the whole point — if the core ever imported an adapter, the
|
|
32
|
-
* protocol we happened to build against would leak into the vocabulary and the layer would stop
|
|
33
|
-
* being neutral. None of them opens a connection or touches a browser global; a framework
|
|
34
|
-
* binding owns transport and host access.
|
|
35
|
-
*/
|
|
36
|
-
export { toWebMcpTool, toWebMcpTools, isValidWebMcpToolName, WebMcpConfirmationRequiredError, InvalidWebMcpToolNameError, type WebMcpToolRegistration, type WebMcpToolAnnotations, type WebMcpRegisterToolOptions, type WebMcpUserInteraction, type RequestUserInteraction, type ToWebMcpToolOptions, } from './webmcp.js';
|
|
37
|
-
/**
|
|
38
|
-
* Genuine AG-UI: the {@link CapabilityDef} → AG-UI *frontend tool* projection. Real conformance —
|
|
39
|
-
* it emits the protocol's own `parameters` field name (not `inputSchema`) and its canonical
|
|
40
|
-
* `TOOL_CALL_START`/`TOOL_CALL_ARGS`/`TOOL_CALL_END` event names, all three of which appear in
|
|
41
|
-
* AG-UI's published `EventType` enum.
|
|
42
|
-
*/
|
|
43
|
-
export { toAgUiTool, toAgUiTools, createAgUiToolResult, AG_UI_TOOL_CALL_EVENTS, type AgUiTool, type AgUiToolResultMessage, } from './ag-ui.js';
|
|
44
|
-
/**
|
|
45
|
-
* Jini's **own** run-stream surface protocol, from `./gen-ui/` — six event kinds and the encoder
|
|
46
|
-
* that produces them (folded in 2026-07-26 from the standalone `@jini-ai/agui` package, plan §3a).
|
|
47
|
-
*
|
|
48
|
-
* Renamed from `./agui/` on 2026-07-27, because this is NOT AG-UI. The real Agent-User Interaction
|
|
49
|
-
* Protocol (https://github.com/ag-ui-protocol/ag-ui) carries a 33-member `SCREAMING_SNAKE` event
|
|
50
|
-
* enum — `RUN_STARTED`, `TEXT_MESSAGE_CONTENT`, `STATE_DELTA`, `STEP_STARTED`, `REASONING_*` — and
|
|
51
|
-
* shares **zero** event names with the six dotted-lowercase kinds in `./gen-ui/events.ts`, which
|
|
52
|
-
* are a de-branded port of one product's internal run-event adapter. Carrying the AG-UI name on
|
|
53
|
-
* them asserted a conformance that does not exist.
|
|
54
|
-
*
|
|
55
|
-
* `./ag-ui.ts` above was wrongly folded in with them on 2026-07-26 and moved back out on the 27th:
|
|
56
|
-
* it is the one file here that really does speak AG-UI, so merging it with these six was the exact
|
|
57
|
-
* inversion of the truth.
|
|
58
|
-
*
|
|
59
|
-
* The exported symbols below still carry `Agui`/`AGUI` prefixes: renaming those crosses into
|
|
60
|
-
* `@jini-ai/http` (whose `RUN_STREAM_ROUTE_PATH` is `/api/runs/:runId/agui-stream`) and
|
|
61
|
-
* `@jini-ai/protocol`, so it is deliberately not bundled with this directory move.
|
|
62
|
-
*/
|
|
63
|
-
export { createAguiEncoder, type AguiEncodeContext, type AguiEncoder, type AGUIAgentMessageEvent, type AGUIEvent, type AGUIEventBase, type AGUIEventKind, type AGUIRunLifecycleEvent, type AGUIStateUpdateEvent, type AGUISurfaceRequestedEvent, type AGUISurfaceRespondedEvent, type AGUIToolCallEvent, } from './gen-ui/index.js';
|
|
64
|
-
export { MCP_UI_VIEW_METHODS, MCP_UI_HOST_NOTIFICATIONS, MCP_UI_VIEW_NOTIFICATIONS, MCP_UI_HOST_REQUESTS, MCP_UI_SANDBOX_NOTE, JINI_PAGE_ACTION_METHOD, JSON_RPC_ERROR_CODES, isJsonRpcMessage, isJsonRpcRequest, createJsonRpcRequest, createJsonRpcNotification, createJsonRpcResult, createJsonRpcError, createPageActionRequest, type JsonRpcMessage, type JsonRpcRequest, type JsonRpcNotification, type JsonRpcResponse, type JsonRpcError, } from './mcp-ui-apps.js';
|
|
6
|
+
export * from './core/index.js';
|
|
65
7
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,cAAc,iBAAiB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,64 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* transport: the capability vocabulary, the two shipped manifests, the `data-agent-*` markup
|
|
6
|
-
* convention, and the refusals that must hold everywhere.
|
|
7
|
-
*
|
|
8
|
-
* Framework bindings (`@jini-ai/chat-react`, via `@jini-ai/agentic/dom`'s `createDomPageDriver`, and
|
|
9
|
-
* any Vue/Svelte sibling) import from here and add only the wiring their framework needs.
|
|
10
|
-
* Server-side hosts (an HTTP route table, an MCP stdio server) import the same manifests, so the
|
|
11
|
-
* two can never drift apart.
|
|
12
|
-
*
|
|
13
|
-
* What is deliberately NOT here: how an action reaches a page. That is a transport concern —
|
|
14
|
-
* same-document in a real site like a CMS, `postMessage` when a host embeds an untrusted
|
|
15
|
-
* preview in a sandboxed frame. The verbs are identical either way. Also not here: any product's
|
|
16
|
-
* OWN capabilities (`@jini-ai/chat-core`'s `chat.*` verbs stay in chat-core, which depends on this
|
|
17
|
-
* package for the vocabulary rather than the other way around) — see this package's
|
|
18
|
-
* source-map.md for why the split is real rather than a wholesale relocation.
|
|
2
|
+
* Compatibility root — re-exports `./core` unchanged so existing `from '@jini-ai/agentic'`
|
|
3
|
+
* imports keep resolving. New code should prefer the explicit `@jini-ai/agentic/core` import;
|
|
4
|
+
* see `core/README.md` for why this package is split the way it is.
|
|
19
5
|
*/
|
|
20
|
-
export
|
|
21
|
-
export { executePageCapability, projectElementState, DEFAULT_HIGHLIGHT_MS, MAX_HIGHLIGHT_MS, MAX_STATEFUL_ELEMENTS, } from './page-executor.js';
|
|
22
|
-
export { PAGE_CAPABILITIES } from './page-capabilities.js';
|
|
23
|
-
export { AGENT_ELEMENT_ATTRIBUTE, AGENT_ROLE_ATTRIBUTE, AGENT_LABEL_ATTRIBUTE, AGENT_PAGE_ATTRIBUTE, AGENT_ELEMENT_ROLES, isValidElementHandle, resolveHandleSelector, } from './element-handles.js';
|
|
24
|
-
export { agentHandle } from './handle.js';
|
|
25
|
-
export { findFieldFillRefusal, findFieldReadRefusal, describeFieldRefusal, describeFieldReadRefusal, normalizeAgentLabel, MAX_AGENT_LABEL_LENGTH, } from './guards.js';
|
|
26
|
-
/**
|
|
27
|
-
* Protocol adapters, named for what they derive from.
|
|
28
|
-
*
|
|
29
|
-
* Each is a ONE-WAY projection out of the neutral core: they import `capability.js`, and nothing
|
|
30
|
-
* imports back. That direction is the whole point — if the core ever imported an adapter, the
|
|
31
|
-
* protocol we happened to build against would leak into the vocabulary and the layer would stop
|
|
32
|
-
* being neutral. None of them opens a connection or touches a browser global; a framework
|
|
33
|
-
* binding owns transport and host access.
|
|
34
|
-
*/
|
|
35
|
-
export { toWebMcpTool, toWebMcpTools, isValidWebMcpToolName, WebMcpConfirmationRequiredError, InvalidWebMcpToolNameError, } from './webmcp.js';
|
|
36
|
-
/**
|
|
37
|
-
* Genuine AG-UI: the {@link CapabilityDef} → AG-UI *frontend tool* projection. Real conformance —
|
|
38
|
-
* it emits the protocol's own `parameters` field name (not `inputSchema`) and its canonical
|
|
39
|
-
* `TOOL_CALL_START`/`TOOL_CALL_ARGS`/`TOOL_CALL_END` event names, all three of which appear in
|
|
40
|
-
* AG-UI's published `EventType` enum.
|
|
41
|
-
*/
|
|
42
|
-
export { toAgUiTool, toAgUiTools, createAgUiToolResult, AG_UI_TOOL_CALL_EVENTS, } from './ag-ui.js';
|
|
43
|
-
/**
|
|
44
|
-
* Jini's **own** run-stream surface protocol, from `./gen-ui/` — six event kinds and the encoder
|
|
45
|
-
* that produces them (folded in 2026-07-26 from the standalone `@jini-ai/agui` package, plan §3a).
|
|
46
|
-
*
|
|
47
|
-
* Renamed from `./agui/` on 2026-07-27, because this is NOT AG-UI. The real Agent-User Interaction
|
|
48
|
-
* Protocol (https://github.com/ag-ui-protocol/ag-ui) carries a 33-member `SCREAMING_SNAKE` event
|
|
49
|
-
* enum — `RUN_STARTED`, `TEXT_MESSAGE_CONTENT`, `STATE_DELTA`, `STEP_STARTED`, `REASONING_*` — and
|
|
50
|
-
* shares **zero** event names with the six dotted-lowercase kinds in `./gen-ui/events.ts`, which
|
|
51
|
-
* are a de-branded port of one product's internal run-event adapter. Carrying the AG-UI name on
|
|
52
|
-
* them asserted a conformance that does not exist.
|
|
53
|
-
*
|
|
54
|
-
* `./ag-ui.ts` above was wrongly folded in with them on 2026-07-26 and moved back out on the 27th:
|
|
55
|
-
* it is the one file here that really does speak AG-UI, so merging it with these six was the exact
|
|
56
|
-
* inversion of the truth.
|
|
57
|
-
*
|
|
58
|
-
* The exported symbols below still carry `Agui`/`AGUI` prefixes: renaming those crosses into
|
|
59
|
-
* `@jini-ai/http` (whose `RUN_STREAM_ROUTE_PATH` is `/api/runs/:runId/agui-stream`) and
|
|
60
|
-
* `@jini-ai/protocol`, so it is deliberately not bundled with this directory move.
|
|
61
|
-
*/
|
|
62
|
-
export { createAguiEncoder, } from './gen-ui/index.js';
|
|
63
|
-
export { MCP_UI_VIEW_METHODS, MCP_UI_HOST_NOTIFICATIONS, MCP_UI_VIEW_NOTIFICATIONS, MCP_UI_HOST_REQUESTS, MCP_UI_SANDBOX_NOTE, JINI_PAGE_ACTION_METHOD, JSON_RPC_ERROR_CODES, isJsonRpcMessage, isJsonRpcRequest, createJsonRpcRequest, createJsonRpcNotification, createJsonRpcResult, createJsonRpcError, createPageActionRequest, } from './mcp-ui-apps.js';
|
|
6
|
+
export * from './core/index.js';
|
|
64
7
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,cAAc,iBAAiB,CAAC"}
|
package/dist/mcp-ui-apps.d.ts
CHANGED
|
@@ -171,6 +171,25 @@ export declare const JSON_RPC_ERROR_CODES: {
|
|
|
171
171
|
* for every message shape (request, notification, or response) — a notification legitimately has
|
|
172
172
|
* no `id`, but a message that HAS one must have a valid one.
|
|
173
173
|
*
|
|
174
|
+
* The 2026-07-29 audit found the rest of that check was still far too generous, in three ways, all
|
|
175
|
+
* of them reachable from anything able to post at the frame:
|
|
176
|
+
*
|
|
177
|
+
* - **`params` went unread.** Any string `method` returned `true` immediately, so
|
|
178
|
+
* `{method: 'tools/call', params: 'nope'}` reached dispatch and a handler reading
|
|
179
|
+
* `params.capabilityId` got `undefined` rather than a refusal. §4.2 fixes the type: Array or
|
|
180
|
+
* Object.
|
|
181
|
+
* - **The four shapes were not kept apart.** JSON-RPC 2.0 defines request, notification, success
|
|
182
|
+
* response and error response as distinct, mutually exclusive objects. A message carrying both
|
|
183
|
+
* `method` and `result` passed as a request; one carrying both `result` and `error` passed as a
|
|
184
|
+
* response, which §5 forbids in as many words ("Either the result member or error member MUST be
|
|
185
|
+
* included, but both members MUST NOT be included").
|
|
186
|
+
* - **`error` was accepted as any value at all**, `error: "boom"` included, so a host formatting
|
|
187
|
+
* `error.message` back to a user read a property off a string.
|
|
188
|
+
*
|
|
189
|
+
* A message whose `method` is present but not a string is rejected outright rather than falling
|
|
190
|
+
* through to the response branch — reinterpreting a malformed request as a response is how one
|
|
191
|
+
* bad message becomes two wrong behaviors.
|
|
192
|
+
*
|
|
174
193
|
* @param value - The raw `event.data`.
|
|
175
194
|
* @returns True when the value is a well-formed JSON-RPC message.
|
|
176
195
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-ui-apps.d.ts","sourceRoot":"","sources":["../src/mcp-ui-apps.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AAEH,wHAAwH;AACxH,eAAO,MAAM,mBAAmB;;IAE9B,0IAA0I;;;;;;;;IAQ1I,6GAA6G;;IAE7G,yGAAyG;;;CAGjG,CAAC;AAEX;;;;;GAKG;AACH,eAAO,MAAM,yBAAyB;;;;;;CAM5B,CAAC;AAEX;;;;;GAKG;AACH,eAAO,MAAM,yBAAyB;IACpC,oHAAoH;;IAEpH,2EAA2E;;IAE3E,gMAAgM;;CAExL,CAAC;AAEX;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB;IAC/B;;;;;OAKG;;IAEH,sHAAsH;;IAEtH,iEAAiE;;CAEzD,CAAC;AAEX;;;;GAIG;AACH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,CAAC,GAC7B,cAAc,CAEhB"}
|
package/dist/mcp-ui-apps.js
CHANGED
|
@@ -134,7 +134,22 @@ export const JSON_RPC_ERROR_CODES = {
|
|
|
134
134
|
internalError: -32603,
|
|
135
135
|
};
|
|
136
136
|
function isRecord(value) {
|
|
137
|
-
|
|
137
|
+
// Arrays excluded deliberately: `typeof [] === 'object'`, and an array carrying the right
|
|
138
|
+
// properties would otherwise pass as a message. An array IS meaningful JSON-RPC — it is a
|
|
139
|
+
// *batch* — but this transport does not send or accept batches, so one arriving is either a
|
|
140
|
+
// mistake or a probe, and either way is not the single message every caller here expects.
|
|
141
|
+
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
142
|
+
}
|
|
143
|
+
/** `params`, per §4.2, is "Array or Object" — a primitive there is not an under-specified call, it is a malformed one. */
|
|
144
|
+
function hasValidParams(value) {
|
|
145
|
+
if (!('params' in value))
|
|
146
|
+
return true;
|
|
147
|
+
const params = value['params'];
|
|
148
|
+
return typeof params === 'object' && params !== null;
|
|
149
|
+
}
|
|
150
|
+
/** The §5.1 error object: a Number `code` and a String `message` (plus optional `data`). */
|
|
151
|
+
function isJsonRpcErrorObject(value) {
|
|
152
|
+
return isRecord(value) && typeof value['code'] === 'number' && typeof value['message'] === 'string';
|
|
138
153
|
}
|
|
139
154
|
/**
|
|
140
155
|
* Whether an arbitrary value is a JSON-RPC 2.0 message.
|
|
@@ -153,6 +168,25 @@ function isRecord(value) {
|
|
|
153
168
|
* for every message shape (request, notification, or response) — a notification legitimately has
|
|
154
169
|
* no `id`, but a message that HAS one must have a valid one.
|
|
155
170
|
*
|
|
171
|
+
* The 2026-07-29 audit found the rest of that check was still far too generous, in three ways, all
|
|
172
|
+
* of them reachable from anything able to post at the frame:
|
|
173
|
+
*
|
|
174
|
+
* - **`params` went unread.** Any string `method` returned `true` immediately, so
|
|
175
|
+
* `{method: 'tools/call', params: 'nope'}` reached dispatch and a handler reading
|
|
176
|
+
* `params.capabilityId` got `undefined` rather than a refusal. §4.2 fixes the type: Array or
|
|
177
|
+
* Object.
|
|
178
|
+
* - **The four shapes were not kept apart.** JSON-RPC 2.0 defines request, notification, success
|
|
179
|
+
* response and error response as distinct, mutually exclusive objects. A message carrying both
|
|
180
|
+
* `method` and `result` passed as a request; one carrying both `result` and `error` passed as a
|
|
181
|
+
* response, which §5 forbids in as many words ("Either the result member or error member MUST be
|
|
182
|
+
* included, but both members MUST NOT be included").
|
|
183
|
+
* - **`error` was accepted as any value at all**, `error: "boom"` included, so a host formatting
|
|
184
|
+
* `error.message` back to a user read a property off a string.
|
|
185
|
+
*
|
|
186
|
+
* A message whose `method` is present but not a string is rejected outright rather than falling
|
|
187
|
+
* through to the response branch — reinterpreting a malformed request as a response is how one
|
|
188
|
+
* bad message becomes two wrong behaviors.
|
|
189
|
+
*
|
|
156
190
|
* @param value - The raw `event.data`.
|
|
157
191
|
* @returns True when the value is a well-formed JSON-RPC message.
|
|
158
192
|
*/
|
|
@@ -161,10 +195,21 @@ export function isJsonRpcMessage(value) {
|
|
|
161
195
|
return false;
|
|
162
196
|
if ('id' in value && typeof value['id'] !== 'number' && typeof value['id'] !== 'string')
|
|
163
197
|
return false;
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
return
|
|
167
|
-
|
|
198
|
+
if ('method' in value) {
|
|
199
|
+
// Request or notification: `id` present or not, but never a response's members alongside.
|
|
200
|
+
return typeof value['method'] === 'string'
|
|
201
|
+
&& hasValidParams(value)
|
|
202
|
+
&& !('result' in value)
|
|
203
|
+
&& !('error' in value);
|
|
204
|
+
}
|
|
205
|
+
// Response: correlated by `id`, carrying exactly one of `result` / `error`.
|
|
206
|
+
if (!('id' in value))
|
|
207
|
+
return false;
|
|
208
|
+
const hasResult = 'result' in value;
|
|
209
|
+
const hasError = 'error' in value;
|
|
210
|
+
if (hasResult === hasError)
|
|
211
|
+
return false;
|
|
212
|
+
return hasResult || isJsonRpcErrorObject(value['error']);
|
|
168
213
|
}
|
|
169
214
|
/** Whether a validated message expects a response (as opposed to being a notification). */
|
|
170
215
|
export function isJsonRpcRequest(message) {
|
package/dist/mcp-ui-apps.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-ui-apps.js","sourceRoot":"","sources":["../src/mcp-ui-apps.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AAEH,wHAAwH;AACxH,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,UAAU,EAAE,eAAe;IAC3B,0IAA0I;IAC1I,QAAQ,EAAE,YAAY;IACtB,YAAY,EAAE,gBAAgB;IAC9B,GAAG,EAAE,uBAAuB;IAC5B,QAAQ,EAAE,cAAc;IACxB,WAAW,EAAE,YAAY;IACzB,kBAAkB,EAAE,yBAAyB;IAC7C,kBAAkB,EAAE,yBAAyB;IAC7C,6GAA6G;IAC7G,YAAY,EAAE,kBAAkB;IAChC,yGAAyG;IACzG,aAAa,EAAE,wBAAwB;IACvC,IAAI,EAAE,MAAM;CACJ,CAAC;AAEX;;;;;GAKG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACvC,gBAAgB,EAAE,qCAAqC;IACvD,SAAS,EAAE,6BAA6B;IACxC,UAAU,EAAE,8BAA8B;IAC1C,aAAa,EAAE,iCAAiC;IAChD,kBAAkB,EAAE,uCAAuC;CACnD,CAAC;AAEX;;;;;GAKG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACvC,oHAAoH;IACpH,WAAW,EAAE,8BAA8B;IAC3C,2EAA2E;IAC3E,WAAW,EAAE,+BAA+B;IAC5C,gMAAgM;IAChM,eAAe,EAAE,mCAAmC;CAC5C,CAAC;AAEX;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC;;;;;OAKG;IACH,QAAQ,EAAE,sBAAsB;IAChC,sHAAsH;IACtH,WAAW,EAAE,YAAY;IACzB,iEAAiE;IACjE,YAAY,EAAE,YAA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,EAAE,CAAC,CAAC;AACpF,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** Handle argument shared by every element-addressed verb. */
|
|
2
2
|
const HANDLE_PROPERTY = {
|
|
3
|
-
|
|
3
|
+
handle: {
|
|
4
4
|
type: 'string',
|
|
5
5
|
description: 'The data-agent-element handle of the target, as returned by page.find_elements. Not a CSS selector.',
|
|
6
6
|
},
|
|
@@ -43,7 +43,7 @@ export const PAGE_CAPABILITIES = [
|
|
|
43
43
|
description: 'How long the marker stays, in milliseconds. Defaults to a few seconds; capped by the host.',
|
|
44
44
|
},
|
|
45
45
|
},
|
|
46
|
-
required: ['
|
|
46
|
+
required: ['handle'],
|
|
47
47
|
additionalProperties: false,
|
|
48
48
|
},
|
|
49
49
|
// Transient and self-clearing: it shows the user something rather than changing anything.
|
|
@@ -56,7 +56,7 @@ export const PAGE_CAPABILITIES = [
|
|
|
56
56
|
inputSchema: {
|
|
57
57
|
type: 'object',
|
|
58
58
|
properties: { ...HANDLE_PROPERTY },
|
|
59
|
-
required: ['
|
|
59
|
+
required: ['handle'],
|
|
60
60
|
additionalProperties: false,
|
|
61
61
|
},
|
|
62
62
|
risk: 'read',
|
|
@@ -68,7 +68,7 @@ export const PAGE_CAPABILITIES = [
|
|
|
68
68
|
inputSchema: {
|
|
69
69
|
type: 'object',
|
|
70
70
|
properties: { ...HANDLE_PROPERTY },
|
|
71
|
-
required: ['
|
|
71
|
+
required: ['handle'],
|
|
72
72
|
additionalProperties: false,
|
|
73
73
|
},
|
|
74
74
|
risk: 'write',
|
|
@@ -83,7 +83,7 @@ export const PAGE_CAPABILITIES = [
|
|
|
83
83
|
...HANDLE_PROPERTY,
|
|
84
84
|
text: { type: 'string', description: 'The text to place in the field, replacing what is there.' },
|
|
85
85
|
},
|
|
86
|
-
required: ['
|
|
86
|
+
required: ['handle', 'text'],
|
|
87
87
|
additionalProperties: false,
|
|
88
88
|
},
|
|
89
89
|
risk: 'write',
|
|
@@ -105,7 +105,7 @@ export const PAGE_CAPABILITIES = [
|
|
|
105
105
|
description: 'Whether the option should end up chosen. Defaults to true. Set to false to toggle membership off in a multi-select; refused on a single-select, which cannot be left with its choice removed.',
|
|
106
106
|
},
|
|
107
107
|
},
|
|
108
|
-
required: ['
|
|
108
|
+
required: ['handle', 'option'],
|
|
109
109
|
additionalProperties: false,
|
|
110
110
|
},
|
|
111
111
|
risk: 'write',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page-capabilities.js","sourceRoot":"","sources":["../src/page-capabilities.ts"],"names":[],"mappings":"AAaA,8DAA8D;AAC9D,MAAM,eAAe,GAAG;IACtB,
|
|
1
|
+
{"version":3,"file":"page-capabilities.js","sourceRoot":"","sources":["../src/page-capabilities.ts"],"names":[],"mappings":"AAaA,8DAA8D;AAC9D,MAAM,eAAe,GAAG;IACtB,MAAM,EAAE;QACN,IAAI,EAAE,QAAQ;QACd,WAAW,EACT,qGAAqG;KACxG;CACO,CAAC;AAEX,MAAM,CAAC,MAAM,iBAAiB,GAA6B;IACzD;QACE,EAAE,EAAE,oBAAoB;QACxB,WAAW,EACT,sbAAsb;QACxb,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,IAAI,EAAE;oBACJ,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,yCAAyC;oBACtD,IAAI,EAAE,CAAC,QAAQ,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,CAAC;iBAClF;gBACD,KAAK,EAAE;oBACL,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,yEAAyE;iBACvF;gBACD,SAAS,EAAE;oBACT,IAAI,EAAE,SAAS;oBACf,WAAW,EACT,sRAAsR;iBACzR;aACF;YACD,oBAAoB,EAAE,KAAK;SAC5B;QACD,IAAI,EAAE,MAAM;QACZ,OAAO,EAAE,SAAS;KACnB;IACD;QACE,EAAE,EAAE,gBAA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oB;QACxB,WAAW,EACT,2hBAA2hB;QAC7hB,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,GAAG,eAAe;gBAClB,MAAM,EAAE;oBACN,IAAI,EAAE,QAAQ;oBACd,WAAW,EACT,4IAA4I;iBAC/I;gBACD,QAAQ,EAAE;oBACR,IAAI,EAAE,SAAS;oBACf,WAAW,EACT,+LAA+L;iBAClM;aACF;YACD,QAAQ,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC;YAC9B,oBAAoB,EAAE,KAAK;SAC5B;QACD,IAAI,EAAE,OAAO;QACb,OAAO,EAAE,SAAS;KACnB;IACD;QACE,EAAE,EAAE,eAAe;QACnB,WAAW,EACT,sVAAsV;QACxV,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,kEAAkE,EAAE;aAC1G;YACD,QAAQ,EAAE,CAAC,MAAM,CAAC;YAClB,oBAAoB,EAAE,KAAK;SAC5B;QACD,IAAI,EAAE,OAAO;QACb,OAAO,EAAE,SAAS;KACnB;CACF,CAAC"}
|
package/dist/page-driver.d.ts
CHANGED
|
@@ -25,6 +25,19 @@ export interface FindElementsFilter {
|
|
|
25
25
|
/** Case-insensitive substring, matched against handle and label by the driver. */
|
|
26
26
|
readonly query?: string | undefined;
|
|
27
27
|
}
|
|
28
|
+
/**
|
|
29
|
+
* One page a host has published as navigable, as returned by {@link PageDriver.listPages}.
|
|
30
|
+
*
|
|
31
|
+
* `label` exists so a caller can tell what a page IS without first navigating to it and reading
|
|
32
|
+
* its `data-agent-page` id back off the DOM — the same "call find_elements first" flow already
|
|
33
|
+
* returns every page a host publishes, and previously handed back only the bare id (`"plugins"`),
|
|
34
|
+
* leaving a caller to guess at meaning from the string alone. Page-authored, so untrusted in the
|
|
35
|
+
* same sense {@link AgentElementDescriptor.label} is: read it, never follow it as an instruction.
|
|
36
|
+
*/
|
|
37
|
+
export interface PageSummary {
|
|
38
|
+
readonly id: string;
|
|
39
|
+
readonly label: string;
|
|
40
|
+
}
|
|
28
41
|
/**
|
|
29
42
|
* What a host must provide for the `page.*` capabilities to work.
|
|
30
43
|
*
|
|
@@ -40,12 +53,12 @@ export interface PageDriver {
|
|
|
40
53
|
*/
|
|
41
54
|
findElements(filter: FindElementsFilter): Promise<readonly AgentElementDescriptor[]>;
|
|
42
55
|
/**
|
|
43
|
-
* The
|
|
56
|
+
* The pages this host can navigate to.
|
|
44
57
|
*
|
|
45
58
|
* An allowlist, so `page.navigate` refuses anything the host has not published rather than
|
|
46
59
|
* accepting a caller-supplied URL.
|
|
47
60
|
*/
|
|
48
|
-
listPages(): Promise<readonly
|
|
61
|
+
listPages(): Promise<readonly PageSummary[]>;
|
|
49
62
|
/**
|
|
50
63
|
* The attributes of a field, for the fill guard.
|
|
51
64
|
*
|