oui-spec 0.4.1 → 0.6.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 +41 -8
- package/dist/{chunk-DCVVTP3V.cjs → chunk-5UUJ3F7C.cjs} +53 -16
- package/dist/chunk-5UUJ3F7C.cjs.map +1 -0
- package/dist/{chunk-GDB56ZQZ.cjs → chunk-AFNWLRKV.cjs} +126 -15
- package/dist/chunk-AFNWLRKV.cjs.map +1 -0
- package/dist/chunk-B2EFZMGY.js +159 -0
- package/dist/chunk-B2EFZMGY.js.map +1 -0
- package/dist/chunk-LDECTDPU.cjs +169 -0
- package/dist/chunk-LDECTDPU.cjs.map +1 -0
- package/dist/{chunk-F3WKIRAU.js → chunk-R3SGP2UY.js} +53 -16
- package/dist/chunk-R3SGP2UY.js.map +1 -0
- package/dist/{chunk-UQLG55ST.js → chunk-VQETSIY5.js} +124 -13
- package/dist/chunk-VQETSIY5.js.map +1 -0
- package/dist/core/index.cjs +7 -7
- package/dist/core/index.d.cts +5 -5
- package/dist/core/index.d.ts +5 -5
- package/dist/core/index.js +3 -3
- package/dist/index.cjs +40 -8
- package/dist/index.d.cts +4 -3
- package/dist/index.d.ts +4 -3
- package/dist/index.js +3 -3
- package/dist/react/index.d.cts +3 -3
- package/dist/react/index.d.ts +3 -3
- package/dist/spec/index.cjs +34 -2
- package/dist/spec/index.d.cts +22 -272
- package/dist/spec/index.d.ts +22 -272
- package/dist/spec/index.js +1 -1
- package/dist/{surface-runtime-BzIKgL_I.d.cts → surface-runtime-CSZ9UtBO.d.cts} +23 -2
- package/dist/{surface-runtime-DeByfbKg.d.ts → surface-runtime-D5nINY4b.d.ts} +23 -2
- package/dist/transport/index.cjs +2 -2
- package/dist/transport/index.d.cts +3 -3
- package/dist/transport/index.d.ts +3 -3
- package/dist/transport/index.js +1 -1
- package/dist/types-CmJb1BQ8.d.cts +403 -0
- package/dist/types-CmJb1BQ8.d.ts +403 -0
- package/dist/{websocket-YfWILdZ4.d.cts → websocket-Ce3tDSsJ.d.ts} +26 -7
- package/dist/{websocket-c5tIUWY5.d.ts → websocket-Ds2Rh_jL.d.cts} +26 -7
- package/package.json +4 -3
- package/spec/OUI-SPEC-v0.1.md +63 -7
- package/spec/approval-vectors.json +88 -0
- package/dist/chunk-BMCL2K74.js +0 -12
- package/dist/chunk-BMCL2K74.js.map +0 -1
- package/dist/chunk-DCVVTP3V.cjs.map +0 -1
- package/dist/chunk-F3WKIRAU.js.map +0 -1
- package/dist/chunk-GDB56ZQZ.cjs.map +0 -1
- package/dist/chunk-UQLG55ST.js.map +0 -1
- package/dist/chunk-ZKM4XWAB.cjs +0 -14
- package/dist/chunk-ZKM4XWAB.cjs.map +0 -1
package/dist/core/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { createOUI, createSurfaceRuntime, defineSurface } from '../chunk-
|
|
2
|
-
export { OUI_PROTOCOL_EVENTS } from '../chunk-
|
|
3
|
-
import '../chunk-
|
|
1
|
+
export { createOUI, createSurfaceRuntime, defineSurface } from '../chunk-VQETSIY5.js';
|
|
2
|
+
export { OUI_PROTOCOL_EVENTS } from '../chunk-B2EFZMGY.js';
|
|
3
|
+
import '../chunk-R3SGP2UY.js';
|
|
4
4
|
//# sourceMappingURL=index.js.map
|
|
5
5
|
//# sourceMappingURL=index.js.map
|
package/dist/index.cjs
CHANGED
|
@@ -1,28 +1,60 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunkAFNWLRKV_cjs = require('./chunk-AFNWLRKV.cjs');
|
|
4
|
+
var chunkLDECTDPU_cjs = require('./chunk-LDECTDPU.cjs');
|
|
5
5
|
var chunkF3SKRAGU_cjs = require('./chunk-F3SKRAGU.cjs');
|
|
6
6
|
var chunkROGKEMLL_cjs = require('./chunk-ROGKEMLL.cjs');
|
|
7
|
-
var
|
|
7
|
+
var chunk5UUJ3F7C_cjs = require('./chunk-5UUJ3F7C.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
Object.defineProperty(exports, "createOUI", {
|
|
12
12
|
enumerable: true,
|
|
13
|
-
get: function () { return
|
|
13
|
+
get: function () { return chunkAFNWLRKV_cjs.createOUI; }
|
|
14
14
|
});
|
|
15
15
|
Object.defineProperty(exports, "createSurfaceRuntime", {
|
|
16
16
|
enumerable: true,
|
|
17
|
-
get: function () { return
|
|
17
|
+
get: function () { return chunkAFNWLRKV_cjs.createSurfaceRuntime; }
|
|
18
18
|
});
|
|
19
19
|
Object.defineProperty(exports, "defineSurface", {
|
|
20
20
|
enumerable: true,
|
|
21
|
-
get: function () { return
|
|
21
|
+
get: function () { return chunkAFNWLRKV_cjs.defineSurface; }
|
|
22
|
+
});
|
|
23
|
+
Object.defineProperty(exports, "ARGS_HASH_PATTERN", {
|
|
24
|
+
enumerable: true,
|
|
25
|
+
get: function () { return chunkLDECTDPU_cjs.ARGS_HASH_PATTERN; }
|
|
26
|
+
});
|
|
27
|
+
Object.defineProperty(exports, "OUI_EFFECT_ACCESS", {
|
|
28
|
+
enumerable: true,
|
|
29
|
+
get: function () { return chunkLDECTDPU_cjs.OUI_EFFECT_ACCESS; }
|
|
30
|
+
});
|
|
31
|
+
Object.defineProperty(exports, "OUI_EFFECT_KINDS", {
|
|
32
|
+
enumerable: true,
|
|
33
|
+
get: function () { return chunkLDECTDPU_cjs.OUI_EFFECT_KINDS; }
|
|
22
34
|
});
|
|
23
35
|
Object.defineProperty(exports, "OUI_PROTOCOL_EVENTS", {
|
|
24
36
|
enumerable: true,
|
|
25
|
-
get: function () { return
|
|
37
|
+
get: function () { return chunkLDECTDPU_cjs.OUI_PROTOCOL_EVENTS; }
|
|
38
|
+
});
|
|
39
|
+
Object.defineProperty(exports, "argsHash", {
|
|
40
|
+
enumerable: true,
|
|
41
|
+
get: function () { return chunkLDECTDPU_cjs.argsHash; }
|
|
42
|
+
});
|
|
43
|
+
Object.defineProperty(exports, "canonicalJson", {
|
|
44
|
+
enumerable: true,
|
|
45
|
+
get: function () { return chunkLDECTDPU_cjs.canonicalJson; }
|
|
46
|
+
});
|
|
47
|
+
Object.defineProperty(exports, "effectAccess", {
|
|
48
|
+
enumerable: true,
|
|
49
|
+
get: function () { return chunkLDECTDPU_cjs.effectAccess; }
|
|
50
|
+
});
|
|
51
|
+
Object.defineProperty(exports, "requiresApproval", {
|
|
52
|
+
enumerable: true,
|
|
53
|
+
get: function () { return chunkLDECTDPU_cjs.requiresApproval; }
|
|
54
|
+
});
|
|
55
|
+
Object.defineProperty(exports, "surfacesHash", {
|
|
56
|
+
enumerable: true,
|
|
57
|
+
get: function () { return chunkLDECTDPU_cjs.surfacesHash; }
|
|
26
58
|
});
|
|
27
59
|
Object.defineProperty(exports, "SurfaceRuntimeProvider", {
|
|
28
60
|
enumerable: true,
|
|
@@ -50,7 +82,7 @@ Object.defineProperty(exports, "createDirectTransportPair", {
|
|
|
50
82
|
});
|
|
51
83
|
Object.defineProperty(exports, "createWebSocketTransport", {
|
|
52
84
|
enumerable: true,
|
|
53
|
-
get: function () { return
|
|
85
|
+
get: function () { return chunk5UUJ3F7C_cjs.createWebSocketTransport; }
|
|
54
86
|
});
|
|
55
87
|
//# sourceMappingURL=index.cjs.map
|
|
56
88
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.d.cts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
export { JSONSchema, OUIAction, OUIActionPolling, OUIActionRequest, OUIActionResult, OUIActivation, OUIObservation, OUIObservationSnapshot, OUIObservationUpdate, OUIProtocolEvent, OUISurface, OUISurfaceDeregistration, OUISurfaceRegistration, OUISurfaceSnapshot, OUI_PROTOCOL_EVENTS } from './
|
|
2
|
-
export {
|
|
1
|
+
export { A as ARGS_HASH_PATTERN, J as JSONSchema, O as OUIAction, a as OUIActionApproval, b as OUIActionPolling, c as OUIActionRequest, d as OUIActionResult, e as OUIActivation, f as OUIApprovalGrant, g as OUIEffectKind, h as OUIObservation, i as OUIObservationSnapshot, j as OUIObservationUpdate, k as OUIProtocolEvent, l as OUIResultDelivery, m as OUISurface, n as OUISurfaceDeregistration, o as OUISurfaceRegistration, p as OUISurfaceSnapshot, q as OUI_EFFECT_ACCESS, r as OUI_EFFECT_KINDS, s as OUI_PROTOCOL_EVENTS, t as argsHash, u as canonicalJson, v as effectAccess, w as requiresApproval } from './types-CmJb1BQ8.cjs';
|
|
2
|
+
export { surfacesHash } from './spec/index.cjs';
|
|
3
|
+
export { A as ActionDefinition, a as ActionHandlerResult, b as ActionPollingConfig, D as DefinedSurface, M as MountedSurface, O as OUIBranded, c as ObservationDefinition, S as SettleOptions, d as SurfaceDefinition, e as SurfaceRuntime, f as SurfaceRuntimeOptions, g as createSurfaceRuntime, h as defineSurface } from './surface-runtime-CSZ9UtBO.cjs';
|
|
3
4
|
export { DuplicateIds, OUIConfig, OUIConfigError, OUIInstance, OwnedTransport, ValidateSurfaceIds, createOUI } from './core/index.cjs';
|
|
4
5
|
export { SurfaceRuntimeProvider, SurfaceRuntimeProviderProps, UseSurfaceOptions, UseSurfaceResult, useObservation, useSurface, useSurfaceHold, useSurfaceRuntime } from './react/index.cjs';
|
|
5
|
-
export { O as
|
|
6
|
+
export { O as OUIAcknowledgment, a as OUIActionHandler, b as OUIObservationHandler, c as OUIResultHandler, d as OUITransport, e as OUITransportConfig, S as SocketLike, f as createWebSocketTransport } from './websocket-Ds2Rh_jL.cjs';
|
|
6
7
|
export { createDirectTransportPair } from './transport/index.cjs';
|
|
7
8
|
import 'react';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
export { JSONSchema, OUIAction, OUIActionPolling, OUIActionRequest, OUIActionResult, OUIActivation, OUIObservation, OUIObservationSnapshot, OUIObservationUpdate, OUIProtocolEvent, OUISurface, OUISurfaceDeregistration, OUISurfaceRegistration, OUISurfaceSnapshot, OUI_PROTOCOL_EVENTS } from './
|
|
2
|
-
export {
|
|
1
|
+
export { A as ARGS_HASH_PATTERN, J as JSONSchema, O as OUIAction, a as OUIActionApproval, b as OUIActionPolling, c as OUIActionRequest, d as OUIActionResult, e as OUIActivation, f as OUIApprovalGrant, g as OUIEffectKind, h as OUIObservation, i as OUIObservationSnapshot, j as OUIObservationUpdate, k as OUIProtocolEvent, l as OUIResultDelivery, m as OUISurface, n as OUISurfaceDeregistration, o as OUISurfaceRegistration, p as OUISurfaceSnapshot, q as OUI_EFFECT_ACCESS, r as OUI_EFFECT_KINDS, s as OUI_PROTOCOL_EVENTS, t as argsHash, u as canonicalJson, v as effectAccess, w as requiresApproval } from './types-CmJb1BQ8.js';
|
|
2
|
+
export { surfacesHash } from './spec/index.js';
|
|
3
|
+
export { A as ActionDefinition, a as ActionHandlerResult, b as ActionPollingConfig, D as DefinedSurface, M as MountedSurface, O as OUIBranded, c as ObservationDefinition, S as SettleOptions, d as SurfaceDefinition, e as SurfaceRuntime, f as SurfaceRuntimeOptions, g as createSurfaceRuntime, h as defineSurface } from './surface-runtime-D5nINY4b.js';
|
|
3
4
|
export { DuplicateIds, OUIConfig, OUIConfigError, OUIInstance, OwnedTransport, ValidateSurfaceIds, createOUI } from './core/index.js';
|
|
4
5
|
export { SurfaceRuntimeProvider, SurfaceRuntimeProviderProps, UseSurfaceOptions, UseSurfaceResult, useObservation, useSurface, useSurfaceHold, useSurfaceRuntime } from './react/index.js';
|
|
5
|
-
export { O as
|
|
6
|
+
export { O as OUIAcknowledgment, a as OUIActionHandler, b as OUIObservationHandler, c as OUIResultHandler, d as OUITransport, e as OUITransportConfig, S as SocketLike, f as createWebSocketTransport } from './websocket-Ce3tDSsJ.js';
|
|
6
7
|
export { createDirectTransportPair } from './transport/index.js';
|
|
7
8
|
import 'react';
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { createOUI, createSurfaceRuntime, defineSurface } from './chunk-
|
|
2
|
-
export { OUI_PROTOCOL_EVENTS } from './chunk-
|
|
1
|
+
export { createOUI, createSurfaceRuntime, defineSurface } from './chunk-VQETSIY5.js';
|
|
2
|
+
export { ARGS_HASH_PATTERN, OUI_EFFECT_ACCESS, OUI_EFFECT_KINDS, OUI_PROTOCOL_EVENTS, argsHash, canonicalJson, effectAccess, requiresApproval, surfacesHash } from './chunk-B2EFZMGY.js';
|
|
3
3
|
export { SurfaceRuntimeProvider, useObservation, useSurface, useSurfaceHold, useSurfaceRuntime } from './chunk-NYCJZQSP.js';
|
|
4
4
|
export { createDirectTransportPair } from './chunk-IIZ6HL2L.js';
|
|
5
|
-
export { createWebSocketTransport } from './chunk-
|
|
5
|
+
export { createWebSocketTransport } from './chunk-R3SGP2UY.js';
|
|
6
6
|
//# sourceMappingURL=index.js.map
|
|
7
7
|
//# sourceMappingURL=index.js.map
|
package/dist/react/index.d.cts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
|
-
import { OUIActionResult } from '../
|
|
4
|
-
import { e as SurfaceRuntime, D as DefinedSurface } from '../surface-runtime-
|
|
5
|
-
import '../websocket-
|
|
3
|
+
import { d as OUIActionResult } from '../types-CmJb1BQ8.cjs';
|
|
4
|
+
import { e as SurfaceRuntime, D as DefinedSurface } from '../surface-runtime-CSZ9UtBO.cjs';
|
|
5
|
+
import '../websocket-Ds2Rh_jL.cjs';
|
|
6
6
|
|
|
7
7
|
interface SurfaceRuntimeProviderProps {
|
|
8
8
|
runtime: SurfaceRuntime;
|
package/dist/react/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
|
-
import { OUIActionResult } from '../
|
|
4
|
-
import { e as SurfaceRuntime, D as DefinedSurface } from '../surface-runtime-
|
|
5
|
-
import '../websocket-
|
|
3
|
+
import { d as OUIActionResult } from '../types-CmJb1BQ8.js';
|
|
4
|
+
import { e as SurfaceRuntime, D as DefinedSurface } from '../surface-runtime-D5nINY4b.js';
|
|
5
|
+
import '../websocket-Ce3tDSsJ.js';
|
|
6
6
|
|
|
7
7
|
interface SurfaceRuntimeProviderProps {
|
|
8
8
|
runtime: SurfaceRuntime;
|
package/dist/spec/index.cjs
CHANGED
|
@@ -1,12 +1,44 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkLDECTDPU_cjs = require('../chunk-LDECTDPU.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
+
Object.defineProperty(exports, "ARGS_HASH_PATTERN", {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: function () { return chunkLDECTDPU_cjs.ARGS_HASH_PATTERN; }
|
|
10
|
+
});
|
|
11
|
+
Object.defineProperty(exports, "OUI_EFFECT_ACCESS", {
|
|
12
|
+
enumerable: true,
|
|
13
|
+
get: function () { return chunkLDECTDPU_cjs.OUI_EFFECT_ACCESS; }
|
|
14
|
+
});
|
|
15
|
+
Object.defineProperty(exports, "OUI_EFFECT_KINDS", {
|
|
16
|
+
enumerable: true,
|
|
17
|
+
get: function () { return chunkLDECTDPU_cjs.OUI_EFFECT_KINDS; }
|
|
18
|
+
});
|
|
7
19
|
Object.defineProperty(exports, "OUI_PROTOCOL_EVENTS", {
|
|
8
20
|
enumerable: true,
|
|
9
|
-
get: function () { return
|
|
21
|
+
get: function () { return chunkLDECTDPU_cjs.OUI_PROTOCOL_EVENTS; }
|
|
22
|
+
});
|
|
23
|
+
Object.defineProperty(exports, "argsHash", {
|
|
24
|
+
enumerable: true,
|
|
25
|
+
get: function () { return chunkLDECTDPU_cjs.argsHash; }
|
|
26
|
+
});
|
|
27
|
+
Object.defineProperty(exports, "canonicalJson", {
|
|
28
|
+
enumerable: true,
|
|
29
|
+
get: function () { return chunkLDECTDPU_cjs.canonicalJson; }
|
|
30
|
+
});
|
|
31
|
+
Object.defineProperty(exports, "effectAccess", {
|
|
32
|
+
enumerable: true,
|
|
33
|
+
get: function () { return chunkLDECTDPU_cjs.effectAccess; }
|
|
34
|
+
});
|
|
35
|
+
Object.defineProperty(exports, "requiresApproval", {
|
|
36
|
+
enumerable: true,
|
|
37
|
+
get: function () { return chunkLDECTDPU_cjs.requiresApproval; }
|
|
38
|
+
});
|
|
39
|
+
Object.defineProperty(exports, "surfacesHash", {
|
|
40
|
+
enumerable: true,
|
|
41
|
+
get: function () { return chunkLDECTDPU_cjs.surfacesHash; }
|
|
10
42
|
});
|
|
11
43
|
//# sourceMappingURL=index.cjs.map
|
|
12
44
|
//# sourceMappingURL=index.cjs.map
|
package/dist/spec/index.d.cts
CHANGED
|
@@ -1,277 +1,27 @@
|
|
|
1
|
+
import { m as OUISurface } from '../types-CmJb1BQ8.cjs';
|
|
2
|
+
export { A as ARGS_HASH_PATTERN, J as JSONSchema, O as OUIAction, a as OUIActionApproval, b as OUIActionPolling, c as OUIActionRequest, d as OUIActionResult, e as OUIActivation, f as OUIApprovalGrant, g as OUIEffectKind, h as OUIObservation, i as OUIObservationSnapshot, j as OUIObservationUpdate, k as OUIProtocolEvent, l as OUIResultDelivery, n as OUISurfaceDeregistration, o as OUISurfaceRegistration, p as OUISurfaceSnapshot, q as OUI_EFFECT_ACCESS, r as OUI_EFFECT_KINDS, s as OUI_PROTOCOL_EVENTS, t as argsHash, u as canonicalJson, v as effectAccess, w as requiresApproval } from '../types-CmJb1BQ8.cjs';
|
|
3
|
+
|
|
1
4
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
* The machine-readable contract for agent-controllable user interfaces.
|
|
5
|
-
* Any UI application that implements this interface can be controlled by
|
|
6
|
-
* any OUI-compatible agent runtime.
|
|
7
|
-
*/
|
|
8
|
-
/** JSON Schema type (subset used by OUI) */
|
|
9
|
-
type JSONSchema = {
|
|
10
|
-
type?: string | string[];
|
|
11
|
-
properties?: Record<string, JSONSchema>;
|
|
12
|
-
items?: JSONSchema;
|
|
13
|
-
required?: string[];
|
|
14
|
-
enum?: (string | number | boolean)[];
|
|
15
|
-
description?: string;
|
|
16
|
-
default?: unknown;
|
|
17
|
-
oneOf?: JSONSchema[];
|
|
18
|
-
anyOf?: JSONSchema[];
|
|
19
|
-
allOf?: JSONSchema[];
|
|
20
|
-
const?: unknown;
|
|
21
|
-
minimum?: number;
|
|
22
|
-
maximum?: number;
|
|
23
|
-
minLength?: number;
|
|
24
|
-
maxLength?: number;
|
|
25
|
-
pattern?: string;
|
|
26
|
-
format?: string;
|
|
27
|
-
additionalProperties?: boolean | JSONSchema;
|
|
28
|
-
};
|
|
29
|
-
/**
|
|
30
|
-
* A Surface is a controllable boundary within an application.
|
|
31
|
-
* It declares what an agent can do (actions), what it can observe (state),
|
|
32
|
-
* and when it's available (activation conditions).
|
|
5
|
+
* The identity of a set of surfaces, for an answer that need not repeat them
|
|
6
|
+
* (§7.3.4).
|
|
33
7
|
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
/** Human-readable name */
|
|
41
|
-
name: string;
|
|
42
|
-
/** Description of what this surface does — included in agent context */
|
|
43
|
-
description: string;
|
|
44
|
-
/** Version of this surface's contract (semver) */
|
|
45
|
-
version?: string;
|
|
46
|
-
/** Actions the agent can invoke on this surface */
|
|
47
|
-
actions: OUIAction[];
|
|
48
|
-
/** Observable state the agent can read */
|
|
49
|
-
observations?: OUIObservation[];
|
|
50
|
-
/** When this surface is active/available */
|
|
51
|
-
activation?: OUIActivation;
|
|
52
|
-
/** Additional metadata for agent context */
|
|
53
|
-
metadata?: Record<string, unknown>;
|
|
54
|
-
}
|
|
55
|
-
/**
|
|
56
|
-
* Declarative polling configuration for async actions.
|
|
57
|
-
* The OUI runtime in the browser manages the polling lifecycle automatically
|
|
58
|
-
* after the action handler returns its dispatch result.
|
|
59
|
-
*/
|
|
60
|
-
interface OUIActionPolling {
|
|
61
|
-
/** How often to check (milliseconds) */
|
|
62
|
-
intervalMs: number;
|
|
63
|
-
/** Max poll attempts before giving up (optional) */
|
|
64
|
-
maxAttempts?: number;
|
|
65
|
-
/** Max total duration before giving up in ms (alternative to maxAttempts) */
|
|
66
|
-
maxDurationMs?: number;
|
|
67
|
-
/**
|
|
68
|
-
* Subscribe to a realtime event instead of polling.
|
|
69
|
-
* If provided, the runtime listens for this event instead of using setInterval.
|
|
70
|
-
* More efficient when realtime infrastructure exists.
|
|
71
|
-
*/
|
|
72
|
-
subscribe?: {
|
|
73
|
-
/** Event name to listen for */
|
|
74
|
-
event: string;
|
|
75
|
-
/**
|
|
76
|
-
* Filter to match the event. Values prefixed with '$dispatchResult.'
|
|
77
|
-
* are resolved from the handler's return value.
|
|
78
|
-
* Example: { jobId: '$dispatchResult.jobId' }
|
|
79
|
-
*/
|
|
80
|
-
filter?: Record<string, unknown>;
|
|
81
|
-
};
|
|
82
|
-
}
|
|
83
|
-
/**
|
|
84
|
-
* An Action is a single operation an agent can perform on a surface.
|
|
85
|
-
* Each action becomes a "tool" that the LLM can call.
|
|
8
|
+
* A client's surfaces are what an agent may do; every result used to carry
|
|
9
|
+
* them all, so each answer weighed what the page's whole manifest weighs —
|
|
10
|
+
* on a studio page with a hundred and fifty actions, about 265 KB for a click.
|
|
11
|
+
* A relay that caps a frame then drops whole answers, and the agent hears
|
|
12
|
+
* nothing. With this hash the agent runtime says which surfaces it holds
|
|
13
|
+
* (`knownSurfaces`), and the client sends its surfaces only when they differ.
|
|
86
14
|
*
|
|
87
|
-
* The
|
|
88
|
-
*
|
|
15
|
+
* The hash is of the surfaces' canonical JSON (object keys sorted), so it does
|
|
16
|
+
* not depend on the order a manifest's fields were written in, and is the
|
|
17
|
+
* same wherever it is computed. It is a 64-bit FNV-1a over the JSON's UTF-16
|
|
18
|
+
* code units, kept as two 32-bit halves: not a security measure — the agent
|
|
19
|
+
* runtime is told the surfaces by the same client that hashes them — but
|
|
20
|
+
* collision-resistant enough that two different capability sets of one page
|
|
21
|
+
* never share one.
|
|
89
22
|
*/
|
|
90
|
-
interface OUIAction {
|
|
91
|
-
/** Unique action identifier (becomes the tool name) */
|
|
92
|
-
id: string;
|
|
93
|
-
/** Human-readable description — this is what the LLM reads to decide when to use it */
|
|
94
|
-
description: string;
|
|
95
|
-
/** JSON Schema for the action's input parameters */
|
|
96
|
-
input: JSONSchema;
|
|
97
|
-
/** JSON Schema for the action's return value (optional — agent still gets the result) */
|
|
98
|
-
output?: JSONSchema;
|
|
99
|
-
/** If true, the agent runtime should confirm with the user before executing */
|
|
100
|
-
confirm?: boolean;
|
|
101
|
-
/** If true, the action is async — returns immediately with a job/tracking ID */
|
|
102
|
-
async?: boolean;
|
|
103
|
-
/** Declarative polling configuration — runtime manages the polling lifecycle after dispatch */
|
|
104
|
-
polling?: OUIActionPolling;
|
|
105
|
-
/** Human-readable hint about when this action is appropriate to use */
|
|
106
|
-
usage?: string;
|
|
107
|
-
/**
|
|
108
|
-
* Preconditions that should be met before this action is called.
|
|
109
|
-
* Expressed as a description (for the LLM) not as executable logic.
|
|
110
|
-
*/
|
|
111
|
-
preconditions?: string;
|
|
112
|
-
/** Estimated duration hint (e.g., "instant", "2-5s", "30-120s") */
|
|
113
|
-
estimatedDuration?: string;
|
|
114
|
-
/** Tags for categorization */
|
|
115
|
-
tags?: string[];
|
|
116
|
-
}
|
|
117
|
-
/**
|
|
118
|
-
* An Observation is a piece of application state that the agent can read.
|
|
119
|
-
* Observations are pushed to the agent in real-time as the app state changes,
|
|
120
|
-
* giving it situational awareness without needing screenshots.
|
|
121
|
-
*/
|
|
122
|
-
interface OUIObservation {
|
|
123
|
-
/** Unique identifier for this observation */
|
|
124
|
-
id: string;
|
|
125
|
-
/** Description of what this observation represents */
|
|
126
|
-
description: string;
|
|
127
|
-
/** JSON Schema for the observation's value */
|
|
128
|
-
schema: JSONSchema;
|
|
129
|
-
/** How frequently this observation updates */
|
|
130
|
-
updateFrequency?: "realtime" | "on-change" | "polling";
|
|
131
|
-
}
|
|
132
|
-
/**
|
|
133
|
-
* Activation conditions — when a surface is available to the agent.
|
|
134
|
-
* A surface might only be active on a specific page, when certain
|
|
135
|
-
* entities are loaded, or under specific application states.
|
|
136
|
-
*/
|
|
137
|
-
interface OUIActivation {
|
|
138
|
-
/** URL path(s) where this surface is active */
|
|
139
|
-
routes?: string | string[];
|
|
140
|
-
/** Entity type/ID that must be present for this surface to activate */
|
|
141
|
-
entity?: {
|
|
142
|
-
type: string;
|
|
143
|
-
id?: string;
|
|
144
|
-
};
|
|
145
|
-
/** Custom predicate description (for documentation, not execution) */
|
|
146
|
-
condition?: string;
|
|
147
|
-
}
|
|
148
|
-
/**
|
|
149
|
-
* A request from the agent runtime to execute an action on a surface.
|
|
150
|
-
*/
|
|
151
|
-
interface OUIActionRequest {
|
|
152
|
-
/** Unique request ID for correlation */
|
|
153
|
-
requestId: string;
|
|
154
|
-
/** Which surface this request targets */
|
|
155
|
-
surfaceId: string;
|
|
156
|
-
/** Which action to invoke */
|
|
157
|
-
actionId: string;
|
|
158
|
-
/** The action's input parameters (validated against the action's input schema) */
|
|
159
|
-
params: Record<string, unknown>;
|
|
160
|
-
/** Timestamp of the request */
|
|
161
|
-
timestamp: number;
|
|
162
|
-
}
|
|
163
|
-
/**
|
|
164
|
-
* The result of an action execution, returned from the surface to the agent.
|
|
165
|
-
*/
|
|
166
|
-
interface OUIActionResult {
|
|
167
|
-
/** Correlates to the request */
|
|
168
|
-
requestId: string;
|
|
169
|
-
/** Whether the action succeeded */
|
|
170
|
-
success: boolean;
|
|
171
|
-
/** The action's return data (if successful) */
|
|
172
|
-
data?: unknown;
|
|
173
|
-
/** Error information (if failed) */
|
|
174
|
-
error?: {
|
|
175
|
-
code: string;
|
|
176
|
-
message: string;
|
|
177
|
-
details?: unknown;
|
|
178
|
-
};
|
|
179
|
-
/** Progress indicator for interim polling results (0-100) */
|
|
180
|
-
progress?: number;
|
|
181
|
-
/** Whether this is an interim update (polling still in progress) or final */
|
|
182
|
-
interim?: boolean;
|
|
183
|
-
/** Duration of execution in milliseconds */
|
|
184
|
-
durationMs?: number;
|
|
185
|
-
/** Timestamp of the result */
|
|
186
|
-
timestamp: number;
|
|
187
|
-
/**
|
|
188
|
-
* The surfaces active on the client once the action's effects settled.
|
|
189
|
-
*
|
|
190
|
-
* An action can change what the agent is able to do next: navigating
|
|
191
|
-
* unmounts one page's surfaces and mounts another's. Without this, the agent
|
|
192
|
-
* would act on the capability set it had before the action, which is the
|
|
193
|
-
* set the action just replaced.
|
|
194
|
-
*/
|
|
195
|
-
surfaces?: OUISurface[];
|
|
196
|
-
/** Latest observation values per surface once the action's effects settled. */
|
|
197
|
-
observations?: OUIObservationSnapshot;
|
|
198
|
-
/**
|
|
199
|
-
* False when the client's deadline passed before its UI settled, so
|
|
200
|
-
* `surfaces` and `observations` may still be changing. Absent or true
|
|
201
|
-
* otherwise.
|
|
202
|
-
*/
|
|
203
|
-
settled?: boolean;
|
|
204
|
-
}
|
|
205
|
-
/** Latest observation values, keyed by surface id and then observation id. */
|
|
206
|
-
type OUIObservationSnapshot = Record<string, Record<string, unknown>>;
|
|
207
|
-
/**
|
|
208
|
-
* What a client can do right now: the surfaces it has mounted and their latest
|
|
209
|
-
* observation values. A client sends this to its agent runtime (for example,
|
|
210
|
-
* with each turn), and returns it on every action result.
|
|
211
|
-
*/
|
|
212
|
-
interface OUISurfaceSnapshot {
|
|
213
|
-
surfaces: OUISurface[];
|
|
214
|
-
observations: OUIObservationSnapshot;
|
|
215
|
-
}
|
|
216
|
-
/**
|
|
217
|
-
* An observation update pushed from the surface to the agent.
|
|
218
|
-
*/
|
|
219
|
-
interface OUIObservationUpdate {
|
|
220
|
-
/** Which surface this observation belongs to */
|
|
221
|
-
surfaceId: string;
|
|
222
|
-
/** Which observation updated */
|
|
223
|
-
observationId: string;
|
|
224
|
-
/** The new value */
|
|
225
|
-
value: unknown;
|
|
226
|
-
/** Timestamp of the update */
|
|
227
|
-
timestamp: number;
|
|
228
|
-
}
|
|
229
|
-
/**
|
|
230
|
-
* Surface registration event — sent when a surface becomes active.
|
|
231
|
-
*/
|
|
232
|
-
interface OUISurfaceRegistration {
|
|
233
|
-
/** The full surface manifest */
|
|
234
|
-
surface: OUISurface;
|
|
235
|
-
/** Timestamp of registration */
|
|
236
|
-
timestamp: number;
|
|
237
|
-
}
|
|
238
|
-
/**
|
|
239
|
-
* Surface deregistration event — sent when a surface becomes inactive.
|
|
240
|
-
*/
|
|
241
|
-
interface OUISurfaceDeregistration {
|
|
242
|
-
/** Which surface is being deregistered */
|
|
243
|
-
surfaceId: string;
|
|
244
|
-
/** Timestamp */
|
|
245
|
-
timestamp: number;
|
|
246
|
-
}
|
|
247
|
-
/**
|
|
248
|
-
* All protocol events exchanged between agent runtime and surfaces.
|
|
249
|
-
*/
|
|
250
|
-
type OUIProtocolEvent = {
|
|
251
|
-
type: "surface:register";
|
|
252
|
-
payload: OUISurfaceRegistration;
|
|
253
|
-
} | {
|
|
254
|
-
type: "surface:deregister";
|
|
255
|
-
payload: OUISurfaceDeregistration;
|
|
256
|
-
} | {
|
|
257
|
-
type: "action:request";
|
|
258
|
-
payload: OUIActionRequest;
|
|
259
|
-
} | {
|
|
260
|
-
type: "action:result";
|
|
261
|
-
payload: OUIActionResult;
|
|
262
|
-
} | {
|
|
263
|
-
type: "observation:update";
|
|
264
|
-
payload: OUIObservationUpdate;
|
|
265
|
-
};
|
|
266
|
-
/**
|
|
267
|
-
* Protocol event type strings (for type guards and routing).
|
|
268
|
-
*/
|
|
269
|
-
declare const OUI_PROTOCOL_EVENTS: {
|
|
270
|
-
readonly SURFACE_REGISTER: "surface:register";
|
|
271
|
-
readonly SURFACE_DEREGISTER: "surface:deregister";
|
|
272
|
-
readonly ACTION_REQUEST: "action:request";
|
|
273
|
-
readonly ACTION_RESULT: "action:result";
|
|
274
|
-
readonly OBSERVATION_UPDATE: "observation:update";
|
|
275
|
-
};
|
|
276
23
|
|
|
277
|
-
|
|
24
|
+
/** `surfaces`' hash, as a result's `surfacesHash` and a request's `knownSurfaces` carry it. */
|
|
25
|
+
declare function surfacesHash(surfaces: readonly OUISurface[]): string;
|
|
26
|
+
|
|
27
|
+
export { OUISurface, surfacesHash };
|