@nonoun/native-ai 1.0.21 → 1.0.23
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/a2ui/a2ui-diagnostics.d.ts +31 -0
- package/dist/a2ui/a2ui-diagnostics.d.ts.map +1 -0
- package/dist/a2ui/a2ui-element.d.ts +30 -0
- package/dist/a2ui/a2ui-element.d.ts.map +1 -0
- package/dist/a2ui/a2ui-presets.d.ts +22 -0
- package/dist/a2ui/a2ui-presets.d.ts.map +1 -0
- package/dist/a2ui/adapters/a2a-adapter.d.ts +38 -0
- package/dist/a2ui/adapters/a2a-adapter.d.ts.map +1 -0
- package/dist/a2ui/adapters/adapter-types.d.ts +19 -0
- package/dist/a2ui/adapters/adapter-types.d.ts.map +1 -0
- package/dist/a2ui/adapters/ag-ui-adapter.d.ts +42 -0
- package/dist/a2ui/adapters/ag-ui-adapter.d.ts.map +1 -0
- package/dist/a2ui/adapters/direct-adapter.d.ts +30 -0
- package/dist/a2ui/adapters/direct-adapter.d.ts.map +1 -0
- package/dist/a2ui/adapters/index.d.ts +8 -0
- package/dist/a2ui/adapters/index.d.ts.map +1 -0
- package/dist/a2ui/index.d.ts +15 -0
- package/dist/a2ui/index.d.ts.map +1 -0
- package/dist/a2ui/install.d.ts +23 -0
- package/dist/a2ui/install.d.ts.map +1 -0
- package/dist/a2ui/protocol/a2ui-adapter.d.ts +52 -0
- package/dist/a2ui/protocol/a2ui-adapter.d.ts.map +1 -0
- package/dist/a2ui/protocol/a2ui-component-map.d.ts +98 -0
- package/dist/a2ui/protocol/a2ui-component-map.d.ts.map +1 -0
- package/dist/a2ui/protocol/a2ui-composition-map.d.ts +101 -0
- package/dist/a2ui/protocol/a2ui-composition-map.d.ts.map +1 -0
- package/dist/a2ui/protocol/a2ui-converter.d.ts +37 -0
- package/dist/a2ui/protocol/a2ui-converter.d.ts.map +1 -0
- package/dist/a2ui/protocol/a2ui-surface.d.ts +34 -0
- package/dist/a2ui/protocol/a2ui-surface.d.ts.map +1 -0
- package/dist/a2ui/protocol/a2ui-transport.d.ts +80 -0
- package/dist/a2ui/protocol/a2ui-transport.d.ts.map +1 -0
- package/dist/a2ui/protocol/a2ui-types.d.ts +104 -0
- package/dist/a2ui/protocol/a2ui-types.d.ts.map +1 -0
- package/dist/a2ui/protocol/index.d.ts +15 -0
- package/dist/a2ui/protocol/index.d.ts.map +1 -0
- package/dist/a2ui/protocol/kernel-bridge.d.ts +114 -0
- package/dist/a2ui/protocol/kernel-bridge.d.ts.map +1 -0
- package/dist/a2ui/register.d.ts +12 -0
- package/dist/a2ui/register.d.ts.map +1 -0
- package/dist/a2ui/session/agent-session.d.ts +44 -0
- package/dist/a2ui/session/agent-session.d.ts.map +1 -0
- package/dist/a2ui/session/catalog.d.ts +41 -0
- package/dist/a2ui/session/catalog.d.ts.map +1 -0
- package/dist/a2ui/session/event-emitter.d.ts +17 -0
- package/dist/a2ui/session/event-emitter.d.ts.map +1 -0
- package/dist/a2ui/session/index.d.ts +9 -0
- package/dist/a2ui/session/index.d.ts.map +1 -0
- package/dist/a2ui/session/session-manager.d.ts +33 -0
- package/dist/a2ui/session/session-manager.d.ts.map +1 -0
- package/dist/a2ui/session/surface-registry.d.ts +32 -0
- package/dist/a2ui/session/surface-registry.d.ts.map +1 -0
- package/dist/a2ui/session/types.d.ts +27 -0
- package/dist/a2ui/session/types.d.ts.map +1 -0
- package/dist/chat/avatar/chat-avatar-element.d.ts +18 -0
- package/dist/chat/avatar/chat-avatar-element.d.ts.map +1 -0
- package/dist/chat/avatar/index.d.ts +2 -0
- package/dist/chat/avatar/index.d.ts.map +1 -0
- package/dist/chat/avatar/n-chat-avatar.d.ts +2 -0
- package/dist/chat/avatar/n-chat-avatar.d.ts.map +1 -0
- package/dist/chat/chat-input-element.d.ts +35 -0
- package/dist/chat/chat-input-element.d.ts.map +1 -0
- package/dist/chat/chat-panel-element.d.ts +100 -0
- package/dist/chat/chat-panel-element.d.ts.map +1 -0
- package/dist/chat/feed/chat-feed-element.d.ts +48 -0
- package/dist/chat/feed/chat-feed-element.d.ts.map +1 -0
- package/dist/chat/feed/index.d.ts +2 -0
- package/dist/chat/feed/index.d.ts.map +1 -0
- package/dist/chat/feed/n-chat-feed.d.ts +2 -0
- package/dist/chat/feed/n-chat-feed.d.ts.map +1 -0
- package/dist/chat/gateway/adapter-chatgpt.d.ts +67 -0
- package/dist/chat/gateway/adapter-chatgpt.d.ts.map +1 -0
- package/dist/chat/gateway/adapter-claude.d.ts +68 -0
- package/dist/chat/gateway/adapter-claude.d.ts.map +1 -0
- package/dist/chat/gateway/adapter-mock.d.ts +3 -0
- package/dist/chat/gateway/adapter-mock.d.ts.map +1 -0
- package/dist/chat/gateway/adapter.d.ts +71 -0
- package/dist/chat/gateway/adapter.d.ts.map +1 -0
- package/dist/chat/gateway/controller.d.ts +46 -0
- package/dist/chat/gateway/controller.d.ts.map +1 -0
- package/dist/chat/gateway/index.d.ts +9 -0
- package/dist/chat/gateway/index.d.ts.map +1 -0
- package/dist/chat/gateway/runtime.d.ts +53 -0
- package/dist/chat/gateway/runtime.d.ts.map +1 -0
- package/dist/chat/gateway/types.d.ts +73 -0
- package/dist/chat/gateway/types.d.ts.map +1 -0
- package/dist/chat/gateway.d.ts +2 -0
- package/dist/chat/gateway.d.ts.map +1 -0
- package/dist/chat/index.d.ts +17 -0
- package/dist/chat/index.d.ts.map +1 -0
- package/dist/chat/message/chat-input-structured-element.d.ts +43 -0
- package/dist/chat/message/chat-input-structured-element.d.ts.map +1 -0
- package/dist/chat/message/chat-message-activity-element.d.ts +32 -0
- package/dist/chat/message/chat-message-activity-element.d.ts.map +1 -0
- package/dist/chat/message/chat-message-element.d.ts +44 -0
- package/dist/chat/message/chat-message-element.d.ts.map +1 -0
- package/dist/chat/message/chat-message-genui-element.d.ts +45 -0
- package/dist/chat/message/chat-message-genui-element.d.ts.map +1 -0
- package/dist/chat/message/chat-message-seed-element.d.ts +33 -0
- package/dist/chat/message/chat-message-seed-element.d.ts.map +1 -0
- package/dist/chat/message/chat-message-text-element.d.ts +37 -0
- package/dist/chat/message/chat-message-text-element.d.ts.map +1 -0
- package/dist/chat/message/chat-messages-element.d.ts +39 -0
- package/dist/chat/message/chat-messages-element.d.ts.map +1 -0
- package/dist/chat/message/index.d.ts +8 -0
- package/dist/chat/message/index.d.ts.map +1 -0
- package/dist/chat/message/n-chat-message.d.ts +2 -0
- package/dist/chat/message/n-chat-message.d.ts.map +1 -0
- package/dist/chat/register.d.ts +13 -0
- package/dist/chat/register.d.ts.map +1 -0
- package/dist/chat/stream/classify.d.ts +19 -0
- package/dist/chat/stream/classify.d.ts.map +1 -0
- package/dist/chat/stream/create-transport.d.ts +19 -0
- package/dist/chat/stream/create-transport.d.ts.map +1 -0
- package/dist/chat/stream/index.d.ts +9 -0
- package/dist/chat/stream/index.d.ts.map +1 -0
- package/dist/chat/stream/parse-json.d.ts +9 -0
- package/dist/chat/stream/parse-json.d.ts.map +1 -0
- package/dist/chat/stream/parse-ndjson.d.ts +9 -0
- package/dist/chat/stream/parse-ndjson.d.ts.map +1 -0
- package/dist/chat/stream/parse-sse.d.ts +9 -0
- package/dist/chat/stream/parse-sse.d.ts.map +1 -0
- package/dist/chat/stream/types.d.ts +42 -0
- package/dist/chat/stream/types.d.ts.map +1 -0
- package/dist/chat/telemetry/emitter.d.ts +20 -0
- package/dist/chat/telemetry/emitter.d.ts.map +1 -0
- package/dist/chat/telemetry/events.d.ts +11 -0
- package/dist/chat/telemetry/events.d.ts.map +1 -0
- package/dist/chat/telemetry/index.d.ts +5 -0
- package/dist/chat/telemetry/index.d.ts.map +1 -0
- package/dist/chat/telemetry/redactor.d.ts +17 -0
- package/dist/chat/telemetry/redactor.d.ts.map +1 -0
- package/dist/chat/telemetry/types.d.ts +27 -0
- package/dist/chat/telemetry/types.d.ts.map +1 -0
- package/dist/gateway.d.ts +2 -0
- package/dist/gateway.d.ts.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/native-ai.css +1567 -0
- package/dist/native-ai.js +252 -202
- package/dist/register.d.ts +12 -0
- package/dist/register.d.ts.map +1 -0
- package/dist/register.js +246 -196
- package/package.json +1 -1
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A2UI Diagnostics — CodeMirror Lint Source
|
|
3
|
+
*
|
|
4
|
+
* Validates A2UI JSON content using brace-counting envelope parsing.
|
|
5
|
+
* Supports both single-line JSONL and multi-line pretty-printed JSON
|
|
6
|
+
* separated by blank lines (as used by the A2UI workbench editor).
|
|
7
|
+
*
|
|
8
|
+
* Returns CodeMirror Diagnostic objects for inline error/warning display.
|
|
9
|
+
*
|
|
10
|
+
* Checks performed:
|
|
11
|
+
* 1. JSON syntax — each envelope must be valid JSON
|
|
12
|
+
* 2. Must be an object — not array/null/primitive
|
|
13
|
+
* 3. Envelope key — must be a known A2UI message type
|
|
14
|
+
* 4. Surface ID — envelope body must contain surfaceId (except requestCatalog)
|
|
15
|
+
* 5. Version field — warning if missing
|
|
16
|
+
* 6. Surface lifecycle — warns if a surfaceId is used before createSurface
|
|
17
|
+
* 7. Root component — warns if no surface has a root component
|
|
18
|
+
*/
|
|
19
|
+
import type { Diagnostic } from '@codemirror/lint';
|
|
20
|
+
import type { EditorView } from '@codemirror/view';
|
|
21
|
+
/**
|
|
22
|
+
* CodeMirror lint source for A2UI JSON content.
|
|
23
|
+
*
|
|
24
|
+
* Use with the `linter()` extension from `@codemirror/lint`:
|
|
25
|
+
* ```ts
|
|
26
|
+
* import { linter } from '@codemirror/lint';
|
|
27
|
+
* const ext = linter(a2uiLinter);
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
export declare function a2uiLinter(view: EditorView): Diagnostic[];
|
|
31
|
+
//# sourceMappingURL=a2ui-diagnostics.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"a2ui-diagnostics.d.ts","sourceRoot":"","sources":["../../src/a2ui/a2ui-diagnostics.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AA2DnD;;;;;;;;GAQG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,UAAU,GAAG,UAAU,EAAE,CA4KzD"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* NA2UI — A2UI Protocol Workbench Element
|
|
3
|
+
*
|
|
4
|
+
* Layout: chip-toggled multi-panel — preview left, N resizable panes right.
|
|
5
|
+
* Chips: JSON-IN, JSON-OUT, HTML, CSS, JS, COMPONENTS (multiple active at once).
|
|
6
|
+
* Chrome & layout patterns mirror <native-playground> for a unified devtool look.
|
|
7
|
+
*
|
|
8
|
+
* Renders A2UI components directly (no iframe) using a local Kernel + A2UIAdapter.
|
|
9
|
+
* Native-ui components must be registered on the page for rendering to work.
|
|
10
|
+
*
|
|
11
|
+
* @attr {string} stream - JSONL envelope stream content
|
|
12
|
+
* @fires native:a2ui-action - When an action fires inside the preview
|
|
13
|
+
* @fires native:a2ui-state - When surface state updates after processing envelopes
|
|
14
|
+
*/
|
|
15
|
+
import { NativeElement } from '@nonoun/native-ui';
|
|
16
|
+
import '@nonoun/native-code/register';
|
|
17
|
+
export declare class NA2UI extends NativeElement {
|
|
18
|
+
#private;
|
|
19
|
+
static observedAttributes: string[];
|
|
20
|
+
get stream(): string;
|
|
21
|
+
set stream(val: string);
|
|
22
|
+
attributeChangedCallback(name: string, old: string | null, val: string | null): void;
|
|
23
|
+
playAll(): void;
|
|
24
|
+
step(): void;
|
|
25
|
+
stepBack(): void;
|
|
26
|
+
reset(): void;
|
|
27
|
+
setup(): void;
|
|
28
|
+
teardown(): void;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=a2ui-element.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"a2ui-element.d.ts","sourceRoot":"","sources":["../../src/a2ui/a2ui-element.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,aAAa,EAA+C,MAAM,mBAAmB,CAAC;AAa/F,OAAO,8BAA8B,CAAC;AAqFtC,qBAAa,KAAM,SAAQ,aAAa;;IACtC,MAAM,CAAC,kBAAkB,WAAc;IAyDvC,IAAI,MAAM,IAAI,MAAM,CAA+B;IACnD,IAAI,MAAM,CAAC,GAAG,EAAE,MAAM,EAKrB;IAID,wBAAwB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI;IASpF,OAAO,IAAI,IAAI;IACf,IAAI,IAAI,IAAI;IACZ,QAAQ,IAAI,IAAI;IAChB,KAAK,IAAI,IAAI;IAIb,KAAK,IAAI,IAAI;IAwJb,QAAQ,IAAI,IAAI;CAq3CjB"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export interface PresetEntry {
|
|
2
|
+
label: string;
|
|
3
|
+
group: string;
|
|
4
|
+
envelopes: Record<string, unknown>[];
|
|
5
|
+
}
|
|
6
|
+
export type PresetGroup = (typeof PRESET_GROUPS)[number];
|
|
7
|
+
export declare const PRESET_GROUPS: readonly [{
|
|
8
|
+
readonly id: "general";
|
|
9
|
+
readonly label: "General";
|
|
10
|
+
}, {
|
|
11
|
+
readonly id: "interactive";
|
|
12
|
+
readonly label: "Interactive";
|
|
13
|
+
}, {
|
|
14
|
+
readonly id: "clinical";
|
|
15
|
+
readonly label: "Clinical";
|
|
16
|
+
}, {
|
|
17
|
+
readonly id: "travel";
|
|
18
|
+
readonly label: "Travel";
|
|
19
|
+
readonly hidden: true;
|
|
20
|
+
}];
|
|
21
|
+
export declare const PRESETS: Record<string, PresetEntry>;
|
|
22
|
+
//# sourceMappingURL=a2ui-presets.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"a2ui-presets.d.ts","sourceRoot":"","sources":["../../src/a2ui/a2ui-presets.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC;CACtC;AAED,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC;AAEzD,eAAO,MAAM,aAAa;;;;;;;;;;;;;EAKhB,CAAC;AAEX,eAAO,MAAM,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAmtD/C,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A2AAdapter — Google A2A Protocol Adapter
|
|
3
|
+
*
|
|
4
|
+
* Implements the Google Agent-to-Agent (A2A) JSON-RPC protocol.
|
|
5
|
+
* Uses SSE for streaming inbound task updates and HTTP POST for outbound interactions.
|
|
6
|
+
*
|
|
7
|
+
* Agent discovery: serves an AgentCard built from the session's NCatalog.
|
|
8
|
+
* Task lifecycle: submitted → working → completed/failed.
|
|
9
|
+
*/
|
|
10
|
+
import type { NAgentSession } from '../session/agent-session.ts';
|
|
11
|
+
import type { NAdapter, NAdapterConfig } from './adapter-types.ts';
|
|
12
|
+
export interface A2AAdapterOptions {
|
|
13
|
+
readonly endpoint: string;
|
|
14
|
+
readonly agentName?: string;
|
|
15
|
+
readonly agentDescription?: string;
|
|
16
|
+
readonly surfaces?: readonly string[];
|
|
17
|
+
readonly onTaskRequest?: (request: A2ATaskRequest) => boolean | Promise<boolean>;
|
|
18
|
+
}
|
|
19
|
+
export interface A2ATaskRequest {
|
|
20
|
+
readonly taskId: string;
|
|
21
|
+
readonly agentId: string;
|
|
22
|
+
readonly payload: unknown;
|
|
23
|
+
}
|
|
24
|
+
export declare class A2AAdapter implements NAdapter {
|
|
25
|
+
#private;
|
|
26
|
+
readonly type: "a2a";
|
|
27
|
+
constructor(options: A2AAdapterOptions);
|
|
28
|
+
/**
|
|
29
|
+
* Build an AgentCard from the session's catalog for A2A discovery.
|
|
30
|
+
*/
|
|
31
|
+
getAgentCard(): object;
|
|
32
|
+
/** Connect: open SSE stream and create a session. */
|
|
33
|
+
connect(config: NAdapterConfig): Promise<void>;
|
|
34
|
+
/** Disconnect: close SSE and terminate session. */
|
|
35
|
+
disconnect(): Promise<void>;
|
|
36
|
+
get session(): NAgentSession | null;
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=a2a-adapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"a2a-adapter.d.ts","sourceRoot":"","sources":["../../../src/a2ui/adapters/a2a-adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAKnE,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IACnC,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACtC,QAAQ,CAAC,aAAa,CAAC,EAAE,CAAC,OAAO,EAAE,cAAc,KAAK,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CAClF;AAED,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;CAC3B;AAID,qBAAa,UAAW,YAAW,QAAQ;;IACzC,QAAQ,CAAC,IAAI,EAAG,KAAK,CAAU;gBAQnB,OAAO,EAAE,iBAAiB;IAItC;;OAEG;IACH,YAAY,IAAI,MAAM;IAYtB,qDAAqD;IAC/C,OAAO,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;IAiBpD,mDAAmD;IAC7C,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAYjC,IAAI,OAAO,IAAI,aAAa,GAAG,IAAI,CAElC;CAoCF"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* NAdapter — Common Protocol Adapter Interface
|
|
3
|
+
*
|
|
4
|
+
* All transport adapters (A2A, AG-UI, Direct) implement this interface.
|
|
5
|
+
*/
|
|
6
|
+
import type { NSessionManager } from '../session/session-manager.ts';
|
|
7
|
+
import type { NEventEmitter } from '../session/event-emitter.ts';
|
|
8
|
+
import type { NCatalog } from '../session/catalog.ts';
|
|
9
|
+
export interface NAdapterConfig {
|
|
10
|
+
readonly sessionManager: NSessionManager;
|
|
11
|
+
readonly eventEmitter: NEventEmitter;
|
|
12
|
+
readonly defaultCatalog: NCatalog;
|
|
13
|
+
}
|
|
14
|
+
export interface NAdapter {
|
|
15
|
+
connect(config: NAdapterConfig): Promise<void>;
|
|
16
|
+
disconnect(): Promise<void>;
|
|
17
|
+
readonly type: 'a2a' | 'ag-ui' | 'direct';
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=adapter-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adapter-types.d.ts","sourceRoot":"","sources":["../../../src/a2ui/adapters/adapter-types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEtD,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,cAAc,EAAE,eAAe,CAAC;IACzC,QAAQ,CAAC,YAAY,EAAE,aAAa,CAAC;IACrC,QAAQ,CAAC,cAAc,EAAE,QAAQ,CAAC;CACnC;AAED,MAAM,WAAW,QAAQ;IACvB,OAAO,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/C,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5B,QAAQ,CAAC,IAAI,EAAE,KAAK,GAAG,OAAO,GAAG,QAAQ,CAAC;CAC3C"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AGUIAdapter — CopilotKit AG-UI Protocol Adapter
|
|
3
|
+
*
|
|
4
|
+
* Implements bidirectional streaming between an AG-UI agent and native-ui surfaces.
|
|
5
|
+
* Extracts A2UI payloads from AG-UI events and emits interaction events back.
|
|
6
|
+
*
|
|
7
|
+
* Requires `@ag-ui/client` as a peer dependency.
|
|
8
|
+
*/
|
|
9
|
+
import type { NAgentSession } from '../session/agent-session.ts';
|
|
10
|
+
import type { NAdapter, NAdapterConfig } from './adapter-types.ts';
|
|
11
|
+
interface AGUIEvent {
|
|
12
|
+
readonly type: string;
|
|
13
|
+
readonly data?: unknown;
|
|
14
|
+
}
|
|
15
|
+
interface AGUIRunAgent {
|
|
16
|
+
run(options: {
|
|
17
|
+
onEvent: (event: AGUIEvent) => void;
|
|
18
|
+
}): {
|
|
19
|
+
cancel: () => void;
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
export interface AGUIAdapterOptions {
|
|
23
|
+
/** An AG-UI agent instance (from @ag-ui/client). */
|
|
24
|
+
readonly agent: AGUIRunAgent;
|
|
25
|
+
/** AG-UI event type carrying A2UI payloads (default: 'CUSTOM'). */
|
|
26
|
+
readonly a2uiEventType?: string;
|
|
27
|
+
/** AG-UI event type for outbound interaction events (default: 'CUSTOM'). */
|
|
28
|
+
readonly interactionEventType?: string;
|
|
29
|
+
readonly surfaces?: readonly string[];
|
|
30
|
+
}
|
|
31
|
+
export declare class AGUIAdapter implements NAdapter {
|
|
32
|
+
#private;
|
|
33
|
+
readonly type: "ag-ui";
|
|
34
|
+
constructor(options: AGUIAdapterOptions);
|
|
35
|
+
/** Connect: start the AG-UI run and create a session. */
|
|
36
|
+
connect(config: NAdapterConfig): Promise<void>;
|
|
37
|
+
/** Disconnect: cancel the AG-UI run and terminate session. */
|
|
38
|
+
disconnect(): Promise<void>;
|
|
39
|
+
get session(): NAgentSession | null;
|
|
40
|
+
}
|
|
41
|
+
export {};
|
|
42
|
+
//# sourceMappingURL=ag-ui-adapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ag-ui-adapter.d.ts","sourceRoot":"","sources":["../../../src/a2ui/adapters/ag-ui-adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAKnE,UAAU,SAAS;IACjB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC;CACzB;AAED,UAAU,YAAY;IACpB,GAAG,CAAC,OAAO,EAAE;QAAE,OAAO,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,IAAI,CAAA;KAAE,GAAG;QAAE,MAAM,EAAE,MAAM,IAAI,CAAA;KAAE,CAAC;CAC/E;AAID,MAAM,WAAW,kBAAkB;IACjC,oDAAoD;IACpD,QAAQ,CAAC,KAAK,EAAE,YAAY,CAAC;IAC7B,mEAAmE;IACnE,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAChC,4EAA4E;IAC5E,QAAQ,CAAC,oBAAoB,CAAC,EAAE,MAAM,CAAC;IACvC,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CACvC;AAID,qBAAa,WAAY,YAAW,QAAQ;;IAC1C,QAAQ,CAAC,IAAI,EAAG,OAAO,CAAU;gBAQrB,OAAO,EAAE,kBAAkB;IAIvC,yDAAyD;IACnD,OAAO,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;IA0BpD,8DAA8D;IACxD,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAYjC,IAAI,OAAO,IAAI,aAAa,GAAG,IAAI,CAElC;CAoBF"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DirectAdapter — Same-Origin Protocol Adapter
|
|
3
|
+
*
|
|
4
|
+
* For testing, Web Workers, same-origin iframes, and direct function calls.
|
|
5
|
+
* The simplest adapter — no transport layer, just direct method calls.
|
|
6
|
+
*/
|
|
7
|
+
import type { A2UIServerMessage } from '../protocol/a2ui-types.ts';
|
|
8
|
+
import type { NInteractionEvent } from '../session/types.ts';
|
|
9
|
+
import type { NAgentSession } from '../session/agent-session.ts';
|
|
10
|
+
import type { NAdapter, NAdapterConfig } from './adapter-types.ts';
|
|
11
|
+
export interface DirectAdapterOptions {
|
|
12
|
+
readonly agentId?: string;
|
|
13
|
+
readonly surfaces?: readonly string[];
|
|
14
|
+
}
|
|
15
|
+
export declare class DirectAdapter implements NAdapter {
|
|
16
|
+
#private;
|
|
17
|
+
readonly type: "direct";
|
|
18
|
+
constructor(options?: DirectAdapterOptions);
|
|
19
|
+
/** Connect the adapter and create a session. */
|
|
20
|
+
connect(config: NAdapterConfig): Promise<void>;
|
|
21
|
+
/** Inject an A2UI payload directly (no transport). */
|
|
22
|
+
send(message: A2UIServerMessage | string): void;
|
|
23
|
+
/** Subscribe to interaction events from rendered surfaces. */
|
|
24
|
+
onInteraction(handler: (e: NInteractionEvent) => void): () => void;
|
|
25
|
+
/** Get the underlying session (for testing / advanced use). */
|
|
26
|
+
get session(): NAgentSession | null;
|
|
27
|
+
/** Disconnect and terminate the session. */
|
|
28
|
+
disconnect(): Promise<void>;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=direct-adapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"direct-adapter.d.ts","sourceRoot":"","sources":["../../../src/a2ui/adapters/direct-adapter.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AACnE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAInE,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CACvC;AAID,qBAAa,aAAc,YAAW,QAAQ;;IAC5C,QAAQ,CAAC,IAAI,EAAG,QAAQ,CAAU;gBAOtB,OAAO,CAAC,EAAE,oBAAoB;IAI1C,gDAAgD;IAC1C,OAAO,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;IASpD,sDAAsD;IACtD,IAAI,CAAC,OAAO,EAAE,iBAAiB,GAAG,MAAM,GAAG,IAAI;IAK/C,8DAA8D;IAC9D,aAAa,CAAC,OAAO,EAAE,CAAC,CAAC,EAAE,iBAAiB,KAAK,IAAI,GAAG,MAAM,IAAI;IASlE,+DAA+D;IAC/D,IAAI,OAAO,IAAI,aAAa,GAAG,IAAI,CAElC;IAED,4CAA4C;IACtC,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;CASlC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export type { NAdapter, NAdapterConfig } from './adapter-types.ts';
|
|
2
|
+
export { DirectAdapter } from './direct-adapter.ts';
|
|
3
|
+
export type { DirectAdapterOptions } from './direct-adapter.ts';
|
|
4
|
+
export { A2AAdapter } from './a2a-adapter.ts';
|
|
5
|
+
export type { A2AAdapterOptions, A2ATaskRequest } from './a2a-adapter.ts';
|
|
6
|
+
export { AGUIAdapter } from './ag-ui-adapter.ts';
|
|
7
|
+
export type { AGUIAdapterOptions } from './ag-ui-adapter.ts';
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/a2ui/adapters/index.ts"],"names":[],"mappings":"AACA,YAAY,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAGnE,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,YAAY,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,YAAY,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC1E,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,YAAY,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export { A2UIAdapter, createA2UIAdapter, SurfaceManager, createSurfaceManager, resolveJsonPointer, setJsonPointer, a2uiToUINode, uiNodeToA2UI, conversionToPlan, ComponentRegistry, defaultRegistry, resolveNativeTag, resolveA2UIType, COMPONENT_MAP, getSupportedTypes, getComponentCategory, getCompatibleTypes, textVariantTag, textFieldInputType, dateTimeInputType, CompositionRegistry, defaultCompositionRegistry, COMPOSITION_MAP, resolveComponent, isDataBinding, isCreateSurface, isUpdateComponents, isUpdateDataModel, isDeleteSurface, isCatalogRequest, isCatalogResponse, isActionMessage, isErrorMessage, parseServerMessage, WebSocketTransport, SSETransport, createWebSocketTransport, createSSETransport, } from './protocol/index.ts';
|
|
2
|
+
export type { A2UIAdapterOptions, SurfaceState, ConversionResult, DataBindingEntry, ToUINodeOptions, ToA2UIOptions, ComponentMapping, ChildStrategy, RegistrySnapshot, EventSpec, PropertySpec, MethodSpec, CompositionSpec, CompositionTemplate, TemplateNode, PropDelegation, StateProjection, EventBubble, CompositionGap, A2UIProtocolVersion, A2UIServerMessage, A2UICreateSurface, A2UIUpdateComponents, A2UIUpdateDataModel, A2UIDeleteSurface, A2UICatalogRequest, A2UICatalogResponse, A2UIClientMessage, A2UIActionMessage, A2UIErrorMessage, A2UIComponent, A2UIComponentAction, A2UIDataBinding, A2UIStandardType, TransportState, TransportEvents, WebSocketTransportOptions, SSETransportOptions, } from './protocol/index.ts';
|
|
3
|
+
export type { A2UIKernelBridge, UINode, UIPlan, PatchOp, UIPatch, PlanResult, CommandSource, Command, CommandFilter, CommandHandler, } from './protocol/kernel-bridge.ts';
|
|
4
|
+
export { installA2UI } from './install.ts';
|
|
5
|
+
export { NA2UI } from './a2ui-element.ts';
|
|
6
|
+
export { NSessionManager, NAgentSession, NSurfaceRegistry, NEventEmitter, NCatalog, buildCatalogFromRegistry, } from './session/index.ts';
|
|
7
|
+
export type { NAgentSessionConfig, NCatalogEntry, NSessionConfig, NSessionStatus, NInteractionEvent, NSurfaceState, } from './session/index.ts';
|
|
8
|
+
export type { NAdapter, NAdapterConfig } from './adapters/index.ts';
|
|
9
|
+
export { DirectAdapter } from './adapters/index.ts';
|
|
10
|
+
export type { DirectAdapterOptions } from './adapters/index.ts';
|
|
11
|
+
export { A2AAdapter } from './adapters/index.ts';
|
|
12
|
+
export type { A2AAdapterOptions, A2ATaskRequest } from './adapters/index.ts';
|
|
13
|
+
export { AGUIAdapter } from './adapters/index.ts';
|
|
14
|
+
export type { AGUIAdapterOptions } from './adapters/index.ts';
|
|
15
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{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,OAAO,EAAE,UAAU,EAC5C,aAAa,EAAE,OAAO,EAAE,aAAa,EAAE,cAAc,GACtD,MAAM,6BAA6B,CAAC;AAGrC,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAG3C,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAG1C,OAAO,EACL,eAAe,EACf,aAAa,EACb,gBAAgB,EAChB,aAAa,EACb,QAAQ,EACR,wBAAwB,GACzB,MAAM,oBAAoB,CAAC;AAE5B,YAAY,EACV,mBAAmB,EACnB,aAAa,EACb,cAAc,EACd,cAAc,EACd,iBAAiB,EACjB,aAAa,GACd,MAAM,oBAAoB,CAAC;AAG5B,YAAY,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,YAAY,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,YAAY,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC7E,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,YAAY,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Install the A2UI plugin into a Kernel instance.
|
|
3
|
+
*
|
|
4
|
+
* ```ts
|
|
5
|
+
* import { getKernel } from '@nonoun/native-ui/kernel';
|
|
6
|
+
* import { installA2UI } from '@nonoun/native-ai';
|
|
7
|
+
*
|
|
8
|
+
* const kernel = getKernel();
|
|
9
|
+
* installA2UI(kernel);
|
|
10
|
+
*
|
|
11
|
+
* // Later — lazily instantiated on first access:
|
|
12
|
+
* const a2ui = kernel.plugin<A2UIAdapter>('a2ui');
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
|
+
import type { A2UIKernelBridge } from './protocol/kernel-bridge.ts';
|
|
16
|
+
import type { A2UIAdapterOptions } from './protocol/a2ui-adapter.ts';
|
|
17
|
+
/** Minimal interface for the Kernel.use() method. */
|
|
18
|
+
interface PluginHost {
|
|
19
|
+
use<T>(name: string, factory: () => T): void;
|
|
20
|
+
}
|
|
21
|
+
export declare function installA2UI(kernel: A2UIKernelBridge & PluginHost, options?: A2UIAdapterOptions): void;
|
|
22
|
+
export {};
|
|
23
|
+
//# sourceMappingURL=install.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"install.d.ts","sourceRoot":"","sources":["../../src/a2ui/install.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAEpE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAErE,qDAAqD;AACrD,UAAU,UAAU;IAClB,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,GAAG,IAAI,CAAC;CAC9C;AAED,wBAAgB,WAAW,CACzB,MAAM,EAAE,gBAAgB,GAAG,UAAU,EACrC,OAAO,CAAC,EAAE,kBAAkB,GAC3B,IAAI,CAEN"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A2UI Adapter
|
|
3
|
+
*
|
|
4
|
+
* Top-level facade for Google A2UI protocol compatibility.
|
|
5
|
+
* Integrates SurfaceManager, converter, and component map
|
|
6
|
+
* to provide a unified API for receiving and emitting A2UI messages.
|
|
7
|
+
*/
|
|
8
|
+
import type { A2UIServerMessage, A2UIClientMessage, A2UIUpdateComponents, A2UIProtocolVersion } from './a2ui-types.ts';
|
|
9
|
+
import type { ComponentRegistry } from './a2ui-component-map.ts';
|
|
10
|
+
import type { SurfaceState } from './a2ui-surface.ts';
|
|
11
|
+
import type { A2UIKernelBridge as Kernel } from './kernel-bridge.ts';
|
|
12
|
+
import type { UIPlan } from './kernel-bridge.ts';
|
|
13
|
+
import type { PlanResult } from './kernel-bridge.ts';
|
|
14
|
+
export interface A2UIAdapterOptions {
|
|
15
|
+
readonly version?: A2UIProtocolVersion;
|
|
16
|
+
readonly onClientMessage?: (msg: A2UIClientMessage) => void;
|
|
17
|
+
readonly onRender?: (surfaceId: string, container: HTMLElement) => void;
|
|
18
|
+
readonly registry?: ComponentRegistry;
|
|
19
|
+
}
|
|
20
|
+
export declare class A2UIAdapter {
|
|
21
|
+
#private;
|
|
22
|
+
constructor(kernel: Kernel, options?: A2UIAdapterOptions);
|
|
23
|
+
/**
|
|
24
|
+
* Process a raw A2UI server message.
|
|
25
|
+
* Accepts either a parsed object or JSON string.
|
|
26
|
+
* If a container is provided, it is used as the render target for new surfaces.
|
|
27
|
+
*/
|
|
28
|
+
receive(message: A2UIServerMessage | string, container?: HTMLElement): void;
|
|
29
|
+
/**
|
|
30
|
+
* Parse a JSON string into a typed A2UI server message.
|
|
31
|
+
* Returns null if invalid.
|
|
32
|
+
*/
|
|
33
|
+
parse(json: string): A2UIServerMessage | null;
|
|
34
|
+
/**
|
|
35
|
+
* Convert a UIPlan to A2UI updateComponents format.
|
|
36
|
+
*/
|
|
37
|
+
emit(plan: UIPlan, surfaceId?: string): A2UIUpdateComponents;
|
|
38
|
+
/**
|
|
39
|
+
* Convert a Planner result to A2UI updateComponents format.
|
|
40
|
+
*/
|
|
41
|
+
emitPlanResult(result: PlanResult, surfaceId?: string): A2UIUpdateComponents;
|
|
42
|
+
getSurface(surfaceId: string): SurfaceState | null;
|
|
43
|
+
getSurfaceIds(): readonly string[];
|
|
44
|
+
getDataModel(surfaceId: string): Record<string, unknown> | null;
|
|
45
|
+
/**
|
|
46
|
+
* Returns the list of A2UI component types supported by this adapter.
|
|
47
|
+
*/
|
|
48
|
+
getSupportedTypes(): readonly string[];
|
|
49
|
+
destroy(): void;
|
|
50
|
+
}
|
|
51
|
+
export declare function createA2UIAdapter(kernel: Kernel, options?: A2UIAdapterOptions): A2UIAdapter;
|
|
52
|
+
//# sourceMappingURL=a2ui-adapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"a2ui-adapter.d.ts","sourceRoot":"","sources":["../../../src/a2ui/protocol/a2ui-adapter.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EACV,iBAAiB,EACjB,iBAAiB,EACjB,oBAAoB,EACpB,mBAAmB,EAEpB,MAAM,iBAAiB,CAAC;AAKzB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAEjE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,KAAK,EAAE,gBAAgB,IAAI,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACrE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAIrD,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,OAAO,CAAC,EAAE,mBAAmB,CAAC;IACvC,QAAQ,CAAC,eAAe,CAAC,EAAE,CAAC,GAAG,EAAE,iBAAiB,KAAK,IAAI,CAAC;IAC5D,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,WAAW,KAAK,IAAI,CAAC;IACxE,QAAQ,CAAC,QAAQ,CAAC,EAAE,iBAAiB,CAAC;CACvC;AAID,qBAAa,WAAW;;gBAIV,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,kBAAkB;IAYxD;;;;OAIG;IACH,OAAO,CAAC,OAAO,EAAE,iBAAiB,GAAG,MAAM,EAAE,SAAS,CAAC,EAAE,WAAW,GAAG,IAAI;IAqC3E;;;OAGG;IACH,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,iBAAiB,GAAG,IAAI;IAM7C;;OAEG;IACH,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,oBAAoB;IAkB5D;;OAEG;IACH,cAAc,CAAC,MAAM,EAAE,UAAU,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,oBAAoB;IAM5E,UAAU,CAAC,SAAS,EAAE,MAAM,GAAG,YAAY,GAAG,IAAI;IAIlD,aAAa,IAAI,SAAS,MAAM,EAAE;IAIlC,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;IAM/D;;OAEG;IACH,iBAAiB,IAAI,SAAS,MAAM,EAAE;IAMtC,OAAO,IAAI,IAAI;CAGhB;AAED,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,kBAAkB,GAAG,WAAW,CAE3F"}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A2UI Component Map
|
|
3
|
+
*
|
|
4
|
+
* Bidirectional mapping between A2UI abstract component types
|
|
5
|
+
* and native-ui concrete HTML/custom element tags.
|
|
6
|
+
*
|
|
7
|
+
* The `ComponentRegistry` class provides a mutable registry with
|
|
8
|
+
* change tracking via a signal. The default singleton (`defaultRegistry`)
|
|
9
|
+
* preserves backward compatibility with existing free-function imports.
|
|
10
|
+
*/
|
|
11
|
+
import type { Signal } from '@nonoun/native-ui';
|
|
12
|
+
export type ChildStrategy = 'children' | 'textContent' | 'slot-label' | 'none';
|
|
13
|
+
export interface EventSpec {
|
|
14
|
+
readonly event: string;
|
|
15
|
+
readonly detail?: Readonly<Record<string, string>>;
|
|
16
|
+
readonly description: string;
|
|
17
|
+
}
|
|
18
|
+
export interface PropertySpec {
|
|
19
|
+
readonly attr: string;
|
|
20
|
+
readonly type: string;
|
|
21
|
+
readonly reactive?: boolean;
|
|
22
|
+
readonly note?: string;
|
|
23
|
+
}
|
|
24
|
+
export interface MethodSpec {
|
|
25
|
+
readonly name: string;
|
|
26
|
+
readonly params?: Readonly<Record<string, string>>;
|
|
27
|
+
readonly returns?: string;
|
|
28
|
+
readonly description: string;
|
|
29
|
+
}
|
|
30
|
+
export interface ComponentMapping {
|
|
31
|
+
readonly a2uiType: string;
|
|
32
|
+
readonly nativeTag: string;
|
|
33
|
+
readonly defaultAttributes?: Readonly<Record<string, string>>;
|
|
34
|
+
readonly childStrategy: ChildStrategy;
|
|
35
|
+
/** Maps A2UI property names to native-ui attribute names */
|
|
36
|
+
readonly propertyMap?: Readonly<Record<string, string>>;
|
|
37
|
+
/** Maps A2UI variant values to native-ui variant values */
|
|
38
|
+
readonly variantMap?: Readonly<Record<string, string>>;
|
|
39
|
+
/** The native-ui event name that maps to A2UI action */
|
|
40
|
+
readonly actionEvent?: string;
|
|
41
|
+
/** Full event surface — supersedes actionEvent when present. */
|
|
42
|
+
readonly events?: readonly EventSpec[];
|
|
43
|
+
/** Full property surface — supersedes propertyMap when present. */
|
|
44
|
+
readonly properties?: readonly PropertySpec[];
|
|
45
|
+
/** Imperative methods on the rendered element. */
|
|
46
|
+
readonly methods?: readonly MethodSpec[];
|
|
47
|
+
}
|
|
48
|
+
export interface RegistrySnapshot {
|
|
49
|
+
readonly mappings: ComponentMapping[];
|
|
50
|
+
readonly categories: Record<string, string>;
|
|
51
|
+
}
|
|
52
|
+
export declare class ComponentRegistry {
|
|
53
|
+
#private;
|
|
54
|
+
constructor(mappings: readonly ComponentMapping[], categories?: Readonly<Record<string, string>>);
|
|
55
|
+
get version(): Signal<number>;
|
|
56
|
+
get(type: string): ComponentMapping | undefined;
|
|
57
|
+
has(type: string): boolean;
|
|
58
|
+
get size(): number;
|
|
59
|
+
keys(): IterableIterator<string>;
|
|
60
|
+
values(): IterableIterator<ComponentMapping>;
|
|
61
|
+
entries(): IterableIterator<[string, ComponentMapping]>;
|
|
62
|
+
forEach(cb: (mapping: ComponentMapping, type: string, map: Map<string, ComponentMapping>) => void): void;
|
|
63
|
+
[Symbol.iterator](): IterableIterator<[string, ComponentMapping]>;
|
|
64
|
+
add(mapping: ComponentMapping, notify?: boolean): void;
|
|
65
|
+
update(a2uiType: string, patch: Partial<Omit<ComponentMapping, 'a2uiType'>>): void;
|
|
66
|
+
remove(a2uiType: string): void;
|
|
67
|
+
setCategory(a2uiType: string, category: string): void;
|
|
68
|
+
toJSON(): RegistrySnapshot;
|
|
69
|
+
static fromJSON(data: RegistrySnapshot): ComponentRegistry;
|
|
70
|
+
clone(): ComponentRegistry;
|
|
71
|
+
resolveNativeTag(a2uiType: string): ComponentMapping | null;
|
|
72
|
+
resolveA2UIType(tag: string, attributes?: Readonly<Record<string, string>>): string | null;
|
|
73
|
+
getSupportedTypes(): readonly string[];
|
|
74
|
+
getComponentCategory(a2uiType: string): string;
|
|
75
|
+
getCompatibleTypes(a2uiType: string): readonly string[];
|
|
76
|
+
}
|
|
77
|
+
export declare const defaultRegistry: ComponentRegistry;
|
|
78
|
+
/** All component mappings, keyed by A2UI type. */
|
|
79
|
+
export declare const COMPONENT_MAP: ComponentRegistry;
|
|
80
|
+
export declare function resolveNativeTag(a2uiType: string): ComponentMapping | null;
|
|
81
|
+
export declare function resolveA2UIType(tag: string, attributes?: Readonly<Record<string, string>>): string | null;
|
|
82
|
+
export declare function getSupportedTypes(): readonly string[];
|
|
83
|
+
export declare function getComponentCategory(a2uiType: string): string;
|
|
84
|
+
export declare function getCompatibleTypes(a2uiType: string): readonly string[];
|
|
85
|
+
/**
|
|
86
|
+
* For A2UI Text components, resolve the variant to an HTML tag.
|
|
87
|
+
* Returns 'span' by default.
|
|
88
|
+
*/
|
|
89
|
+
export declare function textVariantTag(variant?: string): string;
|
|
90
|
+
/**
|
|
91
|
+
* For A2UI DateTimeInput components, resolve enableDate/enableTime to HTML input type.
|
|
92
|
+
*/
|
|
93
|
+
export declare function dateTimeInputType(enableDate?: boolean, enableTime?: boolean): string;
|
|
94
|
+
/**
|
|
95
|
+
* For A2UI TextField components, resolve the variant to an HTML input type attribute.
|
|
96
|
+
*/
|
|
97
|
+
export declare function textFieldInputType(variant?: string): string;
|
|
98
|
+
//# sourceMappingURL=a2ui-component-map.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"a2ui-component-map.d.ts","sourceRoot":"","sources":["../../../src/a2ui/protocol/a2ui-component-map.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAIhD,MAAM,MAAM,aAAa,GAAG,UAAU,GAAG,aAAa,GAAG,YAAY,GAAG,MAAM,CAAC;AAI/E,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IACnD,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAC9B;AAED,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IACnD,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAC9B;AAID,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,iBAAiB,C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O,MAAM,aAAa,EAAE,iBAAmC,CAAC;AAIhE,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,gBAAgB,GAAG,IAAI,CAE1E;AAED,wBAAgB,eAAe,CAC7B,GAAG,EAAE,MAAM,EACX,UAAU,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,GAC5C,MAAM,GAAG,IAAI,CAEf;AAED,wBAAgB,iBAAiB,IAAI,SAAS,MAAM,EAAE,CAErD;AAED,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAE7D;AAED,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,MAAM,EAAE,CAEtE;AAeD;;;GAGG;AACH,wBAAgB,cAAc,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAGvD;AAID;;GAEG;AACH,wBAAgB,iBAAiB,CAC/B,UAAU,CAAC,EAAE,OAAO,EACpB,UAAU,CAAC,EAAE,OAAO,GACnB,MAAM,CAIR;AAWD;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAG3D"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A2UI Composition Map
|
|
3
|
+
*
|
|
4
|
+
* Bridge between abstract A2UI schema types and native-ui primitives.
|
|
5
|
+
* Sits above the Component Map — while the Component Map handles 1:1
|
|
6
|
+
* mappings (A2UI type → native tag), the Composition Map handles
|
|
7
|
+
* complex types that require assembling multiple primitives into a
|
|
8
|
+
* coordinated template with prop delegation, state projection,
|
|
9
|
+
* and event bubbling.
|
|
10
|
+
*
|
|
11
|
+
* The `CompositionRegistry` class provides a mutable registry with
|
|
12
|
+
* change tracking via a signal. The default singleton
|
|
13
|
+
* (`defaultCompositionRegistry`) preserves backward compatibility.
|
|
14
|
+
*/
|
|
15
|
+
import type { Signal } from '@nonoun/native-ui';
|
|
16
|
+
import type { ComponentMapping, ComponentRegistry } from './a2ui-component-map.ts';
|
|
17
|
+
export interface TemplateNode {
|
|
18
|
+
readonly role: string;
|
|
19
|
+
readonly primitiveType: string;
|
|
20
|
+
readonly staticProps?: Readonly<Record<string, unknown>>;
|
|
21
|
+
readonly children?: readonly TemplateNode[];
|
|
22
|
+
readonly repeatFrom?: string;
|
|
23
|
+
}
|
|
24
|
+
export type CompositionTemplate = TemplateNode;
|
|
25
|
+
export interface PropDelegation {
|
|
26
|
+
readonly from: string;
|
|
27
|
+
readonly toRole: string;
|
|
28
|
+
readonly toProp: string;
|
|
29
|
+
readonly transform?: 'direct' | 'variantMap' | 'boolean' | 'count' | 'template';
|
|
30
|
+
readonly templateString?: string;
|
|
31
|
+
}
|
|
32
|
+
export interface StateProjection {
|
|
33
|
+
readonly compositeState: string;
|
|
34
|
+
readonly childStates: Readonly<Record<string, string | Readonly<Record<string, unknown>>>>;
|
|
35
|
+
readonly description?: string;
|
|
36
|
+
}
|
|
37
|
+
export interface EventBubble {
|
|
38
|
+
readonly fromRole: string;
|
|
39
|
+
readonly fromEvent: string;
|
|
40
|
+
readonly toAction: string;
|
|
41
|
+
readonly payloadStrategy?: 'passthrough' | 'index' | 'merge';
|
|
42
|
+
readonly mergePayload?: Readonly<Record<string, string>>;
|
|
43
|
+
}
|
|
44
|
+
export interface CompositionGap {
|
|
45
|
+
readonly need: string;
|
|
46
|
+
readonly impact: string;
|
|
47
|
+
readonly workaround?: string;
|
|
48
|
+
}
|
|
49
|
+
export interface CompositionSpec {
|
|
50
|
+
readonly a2uiType: string;
|
|
51
|
+
readonly description: string;
|
|
52
|
+
readonly mappingStatus: 'none' | 'partial';
|
|
53
|
+
readonly template: CompositionTemplate;
|
|
54
|
+
readonly propDelegation: readonly PropDelegation[];
|
|
55
|
+
readonly stateProjection: readonly StateProjection[];
|
|
56
|
+
readonly eventBubbling: readonly EventBubble[];
|
|
57
|
+
readonly requiredStates: readonly string[];
|
|
58
|
+
readonly gaps?: readonly CompositionGap[];
|
|
59
|
+
}
|
|
60
|
+
export declare class CompositionRegistry {
|
|
61
|
+
#private;
|
|
62
|
+
constructor(specs: readonly CompositionSpec[]);
|
|
63
|
+
get version(): Signal<number>;
|
|
64
|
+
get(type: string): CompositionSpec | undefined;
|
|
65
|
+
has(type: string): boolean;
|
|
66
|
+
get size(): number;
|
|
67
|
+
keys(): IterableIterator<string>;
|
|
68
|
+
values(): IterableIterator<CompositionSpec>;
|
|
69
|
+
add(spec: CompositionSpec): void;
|
|
70
|
+
remove(a2uiType: string): void;
|
|
71
|
+
resolveStrategy(a2uiType: string, componentRegistry: ComponentRegistry): 'direct' | 'composition' | 'unknown';
|
|
72
|
+
toJSON(): {
|
|
73
|
+
compositions: CompositionSpec[];
|
|
74
|
+
};
|
|
75
|
+
static fromJSON(data: {
|
|
76
|
+
compositions: CompositionSpec[];
|
|
77
|
+
}): CompositionRegistry;
|
|
78
|
+
getAllGaps(): Array<{
|
|
79
|
+
a2uiType: string;
|
|
80
|
+
gap: CompositionGap;
|
|
81
|
+
}>;
|
|
82
|
+
coverageReport(componentRegistry: ComponentRegistry, allSchemaTypes: readonly string[]): {
|
|
83
|
+
direct: string[];
|
|
84
|
+
composed: string[];
|
|
85
|
+
unresolved: string[];
|
|
86
|
+
gapCount: number;
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
export declare function resolveComponent(a2uiType: string, compositionRegistry: CompositionRegistry, componentRegistry: ComponentRegistry): {
|
|
90
|
+
strategy: 'direct';
|
|
91
|
+
mapping: ComponentMapping;
|
|
92
|
+
} | {
|
|
93
|
+
strategy: 'composition';
|
|
94
|
+
spec: CompositionSpec;
|
|
95
|
+
} | {
|
|
96
|
+
strategy: 'unknown';
|
|
97
|
+
type: string;
|
|
98
|
+
};
|
|
99
|
+
export declare const defaultCompositionRegistry: CompositionRegistry;
|
|
100
|
+
export declare const COMPOSITION_MAP: CompositionRegistry;
|
|
101
|
+
//# sourceMappingURL=a2ui-composition-map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,0BAA0B,qBAAgD,CAAC;AACxF,eAAO,MAAM,eAAe,EAAE,mBAAgD,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A2UI Converter
|
|
3
|
+
*
|
|
4
|
+
* Bidirectional conversion between A2UI flat adjacency lists
|
|
5
|
+
* and native-ui nested UINode trees.
|
|
6
|
+
*/
|
|
7
|
+
import type { UINode, UIPlan, CommandSource } from './kernel-bridge.ts';
|
|
8
|
+
import type { A2UIComponent, A2UIProtocolVersion } from './a2ui-types.ts';
|
|
9
|
+
import type { ComponentRegistry } from './a2ui-component-map.ts';
|
|
10
|
+
export interface ConversionResult {
|
|
11
|
+
readonly root: UINode;
|
|
12
|
+
readonly bindings: ReadonlyMap<string, readonly DataBindingEntry[]>;
|
|
13
|
+
readonly warnings: readonly string[];
|
|
14
|
+
readonly orphans: readonly string[];
|
|
15
|
+
}
|
|
16
|
+
export interface DataBindingEntry {
|
|
17
|
+
readonly property: string;
|
|
18
|
+
readonly path: string;
|
|
19
|
+
}
|
|
20
|
+
export interface ToUINodeOptions {
|
|
21
|
+
readonly rootId?: string;
|
|
22
|
+
readonly surfaceId?: string;
|
|
23
|
+
readonly version?: A2UIProtocolVersion;
|
|
24
|
+
readonly registry?: ComponentRegistry;
|
|
25
|
+
}
|
|
26
|
+
export interface ToA2UIOptions {
|
|
27
|
+
readonly surfaceId?: string;
|
|
28
|
+
readonly version?: A2UIProtocolVersion;
|
|
29
|
+
readonly registry?: ComponentRegistry;
|
|
30
|
+
}
|
|
31
|
+
export declare function a2uiToUINode(components: readonly A2UIComponent[], options?: ToUINodeOptions): ConversionResult;
|
|
32
|
+
export declare function uiNodeToA2UI(root: UINode, options?: ToA2UIOptions): readonly A2UIComponent[];
|
|
33
|
+
/**
|
|
34
|
+
* Wrap a conversion result as a UIPlan.
|
|
35
|
+
*/
|
|
36
|
+
export declare function conversionToPlan(result: ConversionResult, source?: CommandSource): UIPlan;
|
|
37
|
+
//# sourceMapp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