@otto-code/protocol 0.7.6 → 0.8.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/agent-attention-notification.js +1 -1
- package/dist/agent-labels.js +4 -4
- package/dist/agent-personalities.d.ts +2 -2
- package/dist/agent-personalities.js +17 -17
- package/dist/agent-teams.d.ts +4 -4
- package/dist/agent-teams.js +5 -5
- package/dist/agent-types.d.ts +10 -10
- package/dist/agent-types.js +1 -1
- package/dist/artifacts/rpc-schemas.js +4 -4
- package/dist/artifacts/types.js +3 -3
- package/dist/browser-automation/rpc-schemas.js +1 -1
- package/dist/daemon-endpoints.d.ts +1 -1
- package/dist/default-personalities.js +11 -11
- package/dist/effort.d.ts +1 -1
- package/dist/effort.js +2 -2
- package/dist/forge-manifest.d.ts +3 -3
- package/dist/generated/validation/ws-outbound.aot.js +25211 -20528
- package/dist/git-hosting.js +3 -3
- package/dist/git-remote.js +1 -1
- package/dist/judge-verdict.d.ts +1 -1
- package/dist/judge-verdict.js +2 -2
- package/dist/messages.d.ts +2698 -63
- package/dist/messages.js +630 -175
- package/dist/model-tiers.d.ts +3 -3
- package/dist/model-tiers.js +4 -4
- package/dist/observed-subagent-title.d.ts +2 -2
- package/dist/observed-subagent-title.js +4 -4
- package/dist/orchestration.d.ts +3 -3
- package/dist/orchestration.js +32 -32
- package/dist/otto-config-schema.js +1 -1
- package/dist/provider-config.d.ts +92 -3
- package/dist/provider-config.js +58 -6
- package/dist/provider-manifest.d.ts +9 -1
- package/dist/provider-manifest.js +22 -2
- package/dist/schedule/rpc-schemas.d.ts +4 -4
- package/dist/schedule/rpc-schemas.js +1 -1
- package/dist/schedule/types.d.ts +1 -1
- package/dist/schedule/types.js +3 -3
- package/dist/tool-call-display.d.ts +1 -1
- package/dist/tool-call-display.js +3 -3
- package/dist/tool-name-normalization.d.ts +2 -2
- package/dist/tool-name-normalization.js +2 -2
- package/dist/validation/ws-outbound-schema-metadata.d.ts +526 -8
- package/dist/widgets/bridge.d.ts +5 -5
- package/dist/widgets/bridge.js +5 -5
- package/dist/widgets/document.d.ts +1 -1
- package/dist/widgets/document.js +4 -4
- package/dist/widgets/icons.d.ts +1 -1
- package/dist/widgets/icons.js +1 -1
- package/dist/widgets/theme.d.ts +2 -2
- package/dist/widgets/theme.js +2 -2
- package/dist/widgets/types.d.ts +5 -5
- package/dist/widgets/types.js +5 -5
- package/package.json +1 -1
package/dist/widgets/bridge.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
/**
|
|
3
|
-
* The widget message bridge
|
|
3
|
+
* The widget message bridge - the contract between a widget guest (WebView /
|
|
4
4
|
* iframe / Electron <webview>) and its host renderer.
|
|
5
5
|
*
|
|
6
6
|
* Three transports carry the same two message shapes:
|
|
7
|
-
* native
|
|
8
|
-
* web
|
|
9
|
-
* electron
|
|
7
|
+
* native - `window.ReactNativeWebView.postMessage` + `onMessage`
|
|
8
|
+
* web - a `MessageChannel` port transferred in at load
|
|
9
|
+
* electron - a preload's `ipcRenderer.sendToHost` + the `ipc-message` event
|
|
10
10
|
*
|
|
11
11
|
* The schema lives here, once, so a transport cannot quietly drift. Everything
|
|
12
12
|
* arriving from a guest is untrusted model-generated content: parse, never
|
|
@@ -50,7 +50,7 @@ export type WidgetGuestMessage = z.infer<typeof WidgetGuestMessageSchema>;
|
|
|
50
50
|
/**
|
|
51
51
|
* Parse a raw guest frame. Accepts the JSON string the native and Electron
|
|
52
52
|
* transports deliver as well as an already-structured object (web's
|
|
53
|
-
* MessageChannel). Returns null for anything unrecognized
|
|
53
|
+
* MessageChannel). Returns null for anything unrecognized - including frames
|
|
54
54
|
* for a different widget, which the caller filters by id.
|
|
55
55
|
*/
|
|
56
56
|
export declare function parseWidgetGuestMessage(raw: unknown): WidgetGuestMessage | null;
|
package/dist/widgets/bridge.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
/**
|
|
3
|
-
* The widget message bridge
|
|
3
|
+
* The widget message bridge - the contract between a widget guest (WebView /
|
|
4
4
|
* iframe / Electron <webview>) and its host renderer.
|
|
5
5
|
*
|
|
6
6
|
* Three transports carry the same two message shapes:
|
|
7
|
-
* native
|
|
8
|
-
* web
|
|
9
|
-
* electron
|
|
7
|
+
* native - `window.ReactNativeWebView.postMessage` + `onMessage`
|
|
8
|
+
* web - a `MessageChannel` port transferred in at load
|
|
9
|
+
* electron - a preload's `ipcRenderer.sendToHost` + the `ipc-message` event
|
|
10
10
|
*
|
|
11
11
|
* The schema lives here, once, so a transport cannot quietly drift. Everything
|
|
12
12
|
* arriving from a guest is untrusted model-generated content: parse, never
|
|
@@ -59,7 +59,7 @@ export const WidgetGuestMessageSchema = z.discriminatedUnion("type", [
|
|
|
59
59
|
/**
|
|
60
60
|
* Parse a raw guest frame. Accepts the JSON string the native and Electron
|
|
61
61
|
* transports deliver as well as an already-structured object (web's
|
|
62
|
-
* MessageChannel). Returns null for anything unrecognized
|
|
62
|
+
* MessageChannel). Returns null for anything unrecognized - including frames
|
|
63
63
|
* for a different widget, which the caller filters by id.
|
|
64
64
|
*/
|
|
65
65
|
export function parseWidgetGuestMessage(raw) {
|
|
@@ -9,7 +9,7 @@ export interface BuildWidgetDocumentInput {
|
|
|
9
9
|
/**
|
|
10
10
|
* Wrap a sanitized fragment into the full guest document.
|
|
11
11
|
*
|
|
12
|
-
* The fragment is inserted verbatim
|
|
12
|
+
* The fragment is inserted verbatim - it was already sanitized daemon-side
|
|
13
13
|
* (`packages/server/src/server/widget/widget-fragment.ts`) and the CSP plus the
|
|
14
14
|
* per-platform sandbox are what actually contain it. Re-parsing it here would
|
|
15
15
|
* add a second, weaker sanitizer that only ever disagrees with the first.
|
package/dist/widgets/document.js
CHANGED
|
@@ -6,7 +6,7 @@ import { buildWidgetThemeVariables } from "./theme.js";
|
|
|
6
6
|
*
|
|
7
7
|
* Shared by all three renderers (native WebView, web iframe, Electron
|
|
8
8
|
* <webview>) so the CSP, the host stylesheet and the bridge bootstrap cannot
|
|
9
|
-
* drift apart per platform
|
|
9
|
+
* drift apart per platform - a widget that works in one has to work in all of
|
|
10
10
|
* them.
|
|
11
11
|
*/
|
|
12
12
|
/**
|
|
@@ -25,7 +25,7 @@ import { buildWidgetThemeVariables } from "./theme.js";
|
|
|
25
25
|
* a hostile file or page, and an outbound URL is a payload.
|
|
26
26
|
*
|
|
27
27
|
* The fragment therefore gets inline script/style and data: assets, and nothing
|
|
28
|
-
* else. Charts are hand-rolled SVG
|
|
28
|
+
* else. Charts are hand-rolled SVG - the contract document says so plainly, and
|
|
29
29
|
* a blocked resource surfaces as a visible error rather than a blank box.
|
|
30
30
|
*/
|
|
31
31
|
const WIDGET_CSP = "default-src 'none'; script-src 'unsafe-inline'; style-src 'unsafe-inline'; " +
|
|
@@ -114,7 +114,7 @@ function buildBootstrap(widgetId) {
|
|
|
114
114
|
return true;
|
|
115
115
|
}
|
|
116
116
|
// Web: the MessagePort the host transferred in. Validating on port identity
|
|
117
|
-
// is the point
|
|
117
|
+
// is the point - this iframe has no allow-same-origin, so its origin is
|
|
118
118
|
// "null" and event.origin can prove nothing.
|
|
119
119
|
if (port) {
|
|
120
120
|
port.postMessage(payload);
|
|
@@ -215,7 +215,7 @@ function buildBootstrap(widgetId) {
|
|
|
215
215
|
/**
|
|
216
216
|
* Wrap a sanitized fragment into the full guest document.
|
|
217
217
|
*
|
|
218
|
-
* The fragment is inserted verbatim
|
|
218
|
+
* The fragment is inserted verbatim - it was already sanitized daemon-side
|
|
219
219
|
* (`packages/server/src/server/widget/widget-fragment.ts`) and the CSP plus the
|
|
220
220
|
* per-platform sandbox are what actually contain it. Re-parsing it here would
|
|
221
221
|
* add a second, weaker sanitizer that only ever disagrees with the first.
|
package/dist/widgets/icons.d.ts
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* So the set is curated instead: ~40 glyphs covering what widgets actually
|
|
11
11
|
* reach for, drawn in Tabler's outline language (24px box, 2px stroke, round
|
|
12
12
|
* caps) and applied as a CSS mask so each one inherits `currentColor`. A name
|
|
13
|
-
* outside the set renders nothing rather than a broken box
|
|
13
|
+
* outside the set renders nothing rather than a broken box - and the contract
|
|
14
14
|
* document lists exactly what exists, so the model never guesses.
|
|
15
15
|
*/
|
|
16
16
|
/** Every icon name a widget may use. The contract document renders this list. */
|
package/dist/widgets/icons.js
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* So the set is curated instead: ~40 glyphs covering what widgets actually
|
|
11
11
|
* reach for, drawn in Tabler's outline language (24px box, 2px stroke, round
|
|
12
12
|
* caps) and applied as a CSS mask so each one inherits `currentColor`. A name
|
|
13
|
-
* outside the set renders nothing rather than a broken box
|
|
13
|
+
* outside the set renders nothing rather than a broken box - and the contract
|
|
14
14
|
* document lists exactly what exists, so the model never guesses.
|
|
15
15
|
*/
|
|
16
16
|
const ICON_PATHS = {
|
package/dist/widgets/theme.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* The CSS custom properties a widget fragment is written against, and the
|
|
3
3
|
* mapping from Otto's semantic theme tokens onto them.
|
|
4
4
|
*
|
|
5
|
-
* The HOST assembles the guest document, not the daemon
|
|
5
|
+
* The HOST assembles the guest document, not the daemon - because only the
|
|
6
6
|
* client knows which theme is live, and a theme switch has to re-skin an
|
|
7
7
|
* already-rendered widget without a daemon round trip. The variable NAMES are
|
|
8
8
|
* frozen here so the contract document, the fixtures, and every renderer agree.
|
|
@@ -21,7 +21,7 @@ export interface WidgetThemeInput {
|
|
|
21
21
|
accent: string;
|
|
22
22
|
danger: string;
|
|
23
23
|
success: string;
|
|
24
|
-
/** Optional
|
|
24
|
+
/** Optional - themes without a warning token fall back to a fixed amber. */
|
|
25
25
|
warning?: string;
|
|
26
26
|
fontSans: string;
|
|
27
27
|
fontMono: string;
|
package/dist/widgets/theme.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* The CSS custom properties a widget fragment is written against, and the
|
|
3
3
|
* mapping from Otto's semantic theme tokens onto them.
|
|
4
4
|
*
|
|
5
|
-
* The HOST assembles the guest document, not the daemon
|
|
5
|
+
* The HOST assembles the guest document, not the daemon - because only the
|
|
6
6
|
* client knows which theme is live, and a theme switch has to re-skin an
|
|
7
7
|
* already-rendered widget without a daemon round trip. The variable NAMES are
|
|
8
8
|
* frozen here so the contract document, the fixtures, and every renderer agree.
|
|
@@ -68,7 +68,7 @@ function roleText(color, input) {
|
|
|
68
68
|
function roleTint(color, input) {
|
|
69
69
|
return mix(color, input.surface0, input.isDark ? 0.22 : 0.12);
|
|
70
70
|
}
|
|
71
|
-
/** SVG palette. Fixed hues rather than theme tokens
|
|
71
|
+
/** SVG palette. Fixed hues rather than theme tokens - a chart needs categorical
|
|
72
72
|
* separation that survives every theme, and the two dark/light rows keep each
|
|
73
73
|
* hue legible on whichever surface it lands on. */
|
|
74
74
|
const SVG_PALETTE_LIGHT = {
|
package/dist/widgets/types.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
/**
|
|
3
|
-
* Inline widgets
|
|
3
|
+
* Inline widgets - an agent emits a tool call carrying a fragment of HTML or
|
|
4
4
|
* SVG, and Otto renders it inline in the transcript at that call's position.
|
|
5
5
|
*
|
|
6
6
|
* Widgets are NOT artifacts. An artifact is a file-backed document the user
|
|
7
7
|
* keeps (see `../artifacts/types.ts`); a widget is a thought the model had in
|
|
8
8
|
* the middle of a sentence. It has no file, no versioning, and no lifetime
|
|
9
|
-
* beyond its transcript position
|
|
9
|
+
* beyond its transcript position - the tool-call input IS the content, so a
|
|
10
10
|
* re-opened chat re-renders its widgets from the stored timeline for free.
|
|
11
11
|
*
|
|
12
12
|
* See `docs/widgets.md`.
|
|
@@ -22,7 +22,7 @@ export declare const WIDGET_CONTRACT_TOOL_NAME = "widget_contract";
|
|
|
22
22
|
* (messages.ts) is a `z.discriminatedUnion`, so a client that predates widgets
|
|
23
23
|
* would reject an unknown discriminator and fail to parse the ENTIRE timeline
|
|
24
24
|
* message, not just the widget. `metadata` is `z.record(z.string(), z.unknown())`
|
|
25
|
-
*
|
|
25
|
+
* - an old client carries this through untouched and renders the tool call's
|
|
26
26
|
* `plain_text` detail as an ordinary row. That is the protocol contract doing
|
|
27
27
|
* its job.
|
|
28
28
|
*/
|
|
@@ -35,7 +35,7 @@ export declare const WIDGET_METADATA_KEY = "ottoWidget";
|
|
|
35
35
|
export declare const WIDGET_PAYLOAD_VERSION = 1;
|
|
36
36
|
/**
|
|
37
37
|
* How the fragment is interpreted. Auto-detected from the code itself (a
|
|
38
|
-
* fragment starting with `<svg` is SVG), never asked of the model
|
|
38
|
+
* fragment starting with `<svg` is SVG), never asked of the model - one less
|
|
39
39
|
* thing for it to get wrong.
|
|
40
40
|
*/
|
|
41
41
|
export declare const WIDGET_MODES: readonly ["html", "svg"];
|
|
@@ -68,7 +68,7 @@ export type WidgetPayload = z.infer<typeof WidgetPayloadSchema>;
|
|
|
68
68
|
* Read a widget payload out of a tool call's metadata bag.
|
|
69
69
|
*
|
|
70
70
|
* Returns null for anything that is not a widget of a version this build
|
|
71
|
-
* understands
|
|
71
|
+
* understands - the caller renders the ordinary tool-call row instead. Never
|
|
72
72
|
* throws: metadata is `unknown` by contract and may come from a newer daemon.
|
|
73
73
|
*/
|
|
74
74
|
export declare function readWidgetPayload(metadata: Record<string, unknown> | undefined): WidgetPayload | null;
|
package/dist/widgets/types.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
/**
|
|
3
|
-
* Inline widgets
|
|
3
|
+
* Inline widgets - an agent emits a tool call carrying a fragment of HTML or
|
|
4
4
|
* SVG, and Otto renders it inline in the transcript at that call's position.
|
|
5
5
|
*
|
|
6
6
|
* Widgets are NOT artifacts. An artifact is a file-backed document the user
|
|
7
7
|
* keeps (see `../artifacts/types.ts`); a widget is a thought the model had in
|
|
8
8
|
* the middle of a sentence. It has no file, no versioning, and no lifetime
|
|
9
|
-
* beyond its transcript position
|
|
9
|
+
* beyond its transcript position - the tool-call input IS the content, so a
|
|
10
10
|
* re-opened chat re-renders its widgets from the stored timeline for free.
|
|
11
11
|
*
|
|
12
12
|
* See `docs/widgets.md`.
|
|
@@ -22,7 +22,7 @@ export const WIDGET_CONTRACT_TOOL_NAME = "widget_contract";
|
|
|
22
22
|
* (messages.ts) is a `z.discriminatedUnion`, so a client that predates widgets
|
|
23
23
|
* would reject an unknown discriminator and fail to parse the ENTIRE timeline
|
|
24
24
|
* message, not just the widget. `metadata` is `z.record(z.string(), z.unknown())`
|
|
25
|
-
*
|
|
25
|
+
* - an old client carries this through untouched and renders the tool call's
|
|
26
26
|
* `plain_text` detail as an ordinary row. That is the protocol contract doing
|
|
27
27
|
* its job.
|
|
28
28
|
*/
|
|
@@ -35,7 +35,7 @@ export const WIDGET_METADATA_KEY = "ottoWidget";
|
|
|
35
35
|
export const WIDGET_PAYLOAD_VERSION = 1;
|
|
36
36
|
/**
|
|
37
37
|
* How the fragment is interpreted. Auto-detected from the code itself (a
|
|
38
|
-
* fragment starting with `<svg` is SVG), never asked of the model
|
|
38
|
+
* fragment starting with `<svg` is SVG), never asked of the model - one less
|
|
39
39
|
* thing for it to get wrong.
|
|
40
40
|
*/
|
|
41
41
|
export const WIDGET_MODES = ["html", "svg"];
|
|
@@ -64,7 +64,7 @@ const WidgetPayloadSchema = z.object({
|
|
|
64
64
|
* Read a widget payload out of a tool call's metadata bag.
|
|
65
65
|
*
|
|
66
66
|
* Returns null for anything that is not a widget of a version this build
|
|
67
|
-
* understands
|
|
67
|
+
* understands - the caller renders the ordinary tool-call row instead. Never
|
|
68
68
|
* throws: metadata is `unknown` by contract and may come from a newer daemon.
|
|
69
69
|
*/
|
|
70
70
|
export function readWidgetPayload(metadata) {
|