@nonoun/native-ai 1.0.19 → 1.0.21

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.
Files changed (142) hide show
  1. package/dist/native-ai.js +1673 -225
  2. package/dist/register.js +813 -112
  3. package/package.json +1 -1
  4. package/dist/a2ui/a2ui-diagnostics.d.ts +0 -31
  5. package/dist/a2ui/a2ui-diagnostics.d.ts.map +0 -1
  6. package/dist/a2ui/a2ui-element.d.ts +0 -30
  7. package/dist/a2ui/a2ui-element.d.ts.map +0 -1
  8. package/dist/a2ui/a2ui-presets.d.ts +0 -22
  9. package/dist/a2ui/a2ui-presets.d.ts.map +0 -1
  10. package/dist/a2ui/adapters/a2a-adapter.d.ts +0 -38
  11. package/dist/a2ui/adapters/a2a-adapter.d.ts.map +0 -1
  12. package/dist/a2ui/adapters/adapter-types.d.ts +0 -19
  13. package/dist/a2ui/adapters/adapter-types.d.ts.map +0 -1
  14. package/dist/a2ui/adapters/ag-ui-adapter.d.ts +0 -42
  15. package/dist/a2ui/adapters/ag-ui-adapter.d.ts.map +0 -1
  16. package/dist/a2ui/adapters/direct-adapter.d.ts +0 -30
  17. package/dist/a2ui/adapters/direct-adapter.d.ts.map +0 -1
  18. package/dist/a2ui/adapters/index.d.ts +0 -8
  19. package/dist/a2ui/adapters/index.d.ts.map +0 -1
  20. package/dist/a2ui/index.d.ts +0 -15
  21. package/dist/a2ui/index.d.ts.map +0 -1
  22. package/dist/a2ui/install.d.ts +0 -23
  23. package/dist/a2ui/install.d.ts.map +0 -1
  24. package/dist/a2ui/protocol/a2ui-adapter.d.ts +0 -52
  25. package/dist/a2ui/protocol/a2ui-adapter.d.ts.map +0 -1
  26. package/dist/a2ui/protocol/a2ui-component-map.d.ts +0 -75
  27. package/dist/a2ui/protocol/a2ui-component-map.d.ts.map +0 -1
  28. package/dist/a2ui/protocol/a2ui-converter.d.ts +0 -37
  29. package/dist/a2ui/protocol/a2ui-converter.d.ts.map +0 -1
  30. package/dist/a2ui/protocol/a2ui-surface.d.ts +0 -34
  31. package/dist/a2ui/protocol/a2ui-surface.d.ts.map +0 -1
  32. package/dist/a2ui/protocol/a2ui-transport.d.ts +0 -80
  33. package/dist/a2ui/protocol/a2ui-transport.d.ts.map +0 -1
  34. package/dist/a2ui/protocol/a2ui-types.d.ts +0 -104
  35. package/dist/a2ui/protocol/a2ui-types.d.ts.map +0 -1
  36. package/dist/a2ui/protocol/index.d.ts +0 -13
  37. package/dist/a2ui/protocol/index.d.ts.map +0 -1
  38. package/dist/a2ui/protocol/kernel-bridge.d.ts +0 -114
  39. package/dist/a2ui/protocol/kernel-bridge.d.ts.map +0 -1
  40. package/dist/a2ui/register.d.ts +0 -12
  41. package/dist/a2ui/register.d.ts.map +0 -1
  42. package/dist/a2ui/session/agent-session.d.ts +0 -44
  43. package/dist/a2ui/session/agent-session.d.ts.map +0 -1
  44. package/dist/a2ui/session/catalog.d.ts +0 -41
  45. package/dist/a2ui/session/catalog.d.ts.map +0 -1
  46. package/dist/a2ui/session/event-emitter.d.ts +0 -17
  47. package/dist/a2ui/session/event-emitter.d.ts.map +0 -1
  48. package/dist/a2ui/session/index.d.ts +0 -9
  49. package/dist/a2ui/session/index.d.ts.map +0 -1
  50. package/dist/a2ui/session/session-manager.d.ts +0 -33
  51. package/dist/a2ui/session/session-manager.d.ts.map +0 -1
  52. package/dist/a2ui/session/surface-registry.d.ts +0 -32
  53. package/dist/a2ui/session/surface-registry.d.ts.map +0 -1
  54. package/dist/a2ui/session/types.d.ts +0 -27
  55. package/dist/a2ui/session/types.d.ts.map +0 -1
  56. package/dist/chat/avatar/chat-avatar-element.d.ts +0 -18
  57. package/dist/chat/avatar/chat-avatar-element.d.ts.map +0 -1
  58. package/dist/chat/avatar/index.d.ts +0 -2
  59. package/dist/chat/avatar/index.d.ts.map +0 -1
  60. package/dist/chat/avatar/n-chat-avatar.d.ts +0 -2
  61. package/dist/chat/avatar/n-chat-avatar.d.ts.map +0 -1
  62. package/dist/chat/chat-input-element.d.ts +0 -32
  63. package/dist/chat/chat-input-element.d.ts.map +0 -1
  64. package/dist/chat/chat-panel-element.d.ts +0 -100
  65. package/dist/chat/chat-panel-element.d.ts.map +0 -1
  66. package/dist/chat/feed/chat-feed-element.d.ts +0 -48
  67. package/dist/chat/feed/chat-feed-element.d.ts.map +0 -1
  68. package/dist/chat/feed/index.d.ts +0 -2
  69. package/dist/chat/feed/index.d.ts.map +0 -1
  70. package/dist/chat/feed/n-chat-feed.d.ts +0 -2
  71. package/dist/chat/feed/n-chat-feed.d.ts.map +0 -1
  72. package/dist/chat/gateway/adapter-chatgpt.d.ts +0 -67
  73. package/dist/chat/gateway/adapter-chatgpt.d.ts.map +0 -1
  74. package/dist/chat/gateway/adapter-claude.d.ts +0 -68
  75. package/dist/chat/gateway/adapter-claude.d.ts.map +0 -1
  76. package/dist/chat/gateway/adapter-mock.d.ts +0 -3
  77. package/dist/chat/gateway/adapter-mock.d.ts.map +0 -1
  78. package/dist/chat/gateway/adapter.d.ts +0 -71
  79. package/dist/chat/gateway/adapter.d.ts.map +0 -1
  80. package/dist/chat/gateway/controller.d.ts +0 -46
  81. package/dist/chat/gateway/controller.d.ts.map +0 -1
  82. package/dist/chat/gateway/index.d.ts +0 -9
  83. package/dist/chat/gateway/index.d.ts.map +0 -1
  84. package/dist/chat/gateway/runtime.d.ts +0 -53
  85. package/dist/chat/gateway/runtime.d.ts.map +0 -1
  86. package/dist/chat/gateway/types.d.ts +0 -73
  87. package/dist/chat/gateway/types.d.ts.map +0 -1
  88. package/dist/chat/gateway.d.ts +0 -2
  89. package/dist/chat/gateway.d.ts.map +0 -1
  90. package/dist/chat/index.d.ts +0 -17
  91. package/dist/chat/index.d.ts.map +0 -1
  92. package/dist/chat/message/chat-input-structured-element.d.ts +0 -43
  93. package/dist/chat/message/chat-input-structured-element.d.ts.map +0 -1
  94. package/dist/chat/message/chat-message-activity-element.d.ts +0 -32
  95. package/dist/chat/message/chat-message-activity-element.d.ts.map +0 -1
  96. package/dist/chat/message/chat-message-element.d.ts +0 -44
  97. package/dist/chat/message/chat-message-element.d.ts.map +0 -1
  98. package/dist/chat/message/chat-message-genui-element.d.ts +0 -45
  99. package/dist/chat/message/chat-message-genui-element.d.ts.map +0 -1
  100. package/dist/chat/message/chat-message-seed-element.d.ts +0 -33
  101. package/dist/chat/message/chat-message-seed-element.d.ts.map +0 -1
  102. package/dist/chat/message/chat-message-text-element.d.ts +0 -37
  103. package/dist/chat/message/chat-message-text-element.d.ts.map +0 -1
  104. package/dist/chat/message/chat-messages-element.d.ts +0 -39
  105. package/dist/chat/message/chat-messages-element.d.ts.map +0 -1
  106. package/dist/chat/message/index.d.ts +0 -8
  107. package/dist/chat/message/index.d.ts.map +0 -1
  108. package/dist/chat/message/n-chat-message.d.ts +0 -2
  109. package/dist/chat/message/n-chat-message.d.ts.map +0 -1
  110. package/dist/chat/register.d.ts +0 -13
  111. package/dist/chat/register.d.ts.map +0 -1
  112. package/dist/chat/stream/classify.d.ts +0 -19
  113. package/dist/chat/stream/classify.d.ts.map +0 -1
  114. package/dist/chat/stream/create-transport.d.ts +0 -19
  115. package/dist/chat/stream/create-transport.d.ts.map +0 -1
  116. package/dist/chat/stream/index.d.ts +0 -9
  117. package/dist/chat/stream/index.d.ts.map +0 -1
  118. package/dist/chat/stream/parse-json.d.ts +0 -9
  119. package/dist/chat/stream/parse-json.d.ts.map +0 -1
  120. package/dist/chat/stream/parse-ndjson.d.ts +0 -9
  121. package/dist/chat/stream/parse-ndjson.d.ts.map +0 -1
  122. package/dist/chat/stream/parse-sse.d.ts +0 -9
  123. package/dist/chat/stream/parse-sse.d.ts.map +0 -1
  124. package/dist/chat/stream/types.d.ts +0 -42
  125. package/dist/chat/stream/types.d.ts.map +0 -1
  126. package/dist/chat/telemetry/emitter.d.ts +0 -20
  127. package/dist/chat/telemetry/emitter.d.ts.map +0 -1
  128. package/dist/chat/telemetry/events.d.ts +0 -11
  129. package/dist/chat/telemetry/events.d.ts.map +0 -1
  130. package/dist/chat/telemetry/index.d.ts +0 -5
  131. package/dist/chat/telemetry/index.d.ts.map +0 -1
  132. package/dist/chat/telemetry/redactor.d.ts +0 -17
  133. package/dist/chat/telemetry/redactor.d.ts.map +0 -1
  134. package/dist/chat/telemetry/types.d.ts +0 -27
  135. package/dist/chat/telemetry/types.d.ts.map +0 -1
  136. package/dist/gateway.d.ts +0 -2
  137. package/dist/gateway.d.ts.map +0 -1
  138. package/dist/index.d.ts +0 -5
  139. package/dist/index.d.ts.map +0 -1
  140. package/dist/native-ai.css +0 -1422
  141. package/dist/register.d.ts +0 -12
  142. package/dist/register.d.ts.map +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nonoun/native-ai",
3
- "version": "1.0.19",
3
+ "version": "1.0.21",
4
4
  "description": "AI components for @nonoun/native-ui — A2UI protocol adapter + chat input/message layout",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -1,31 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,30 +0,0 @@
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
@@ -1 +0,0 @@
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;CAu3CjB"}
@@ -1,22 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,38 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,19 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,42 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,30 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,8 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,15 +0,0 @@
1
- export { A2UIAdapter, createA2UIAdapter, SurfaceManager, createSurfaceManager, resolveJsonPointer, setJsonPointer, a2uiToUINode, uiNodeToA2UI, conversionToPlan, resolveNativeTag, resolveA2UIType, COMPONENT_MAP, getSupportedTypes, textVariantTag, textFieldInputType, dateTimeInputType, 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, 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
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/a2ui/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,WAAW,EAAE,iBAAiB,EAC9B,cAAc,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,cAAc,EACxE,YAAY,EAAE,YAAY,EAAE,gBAAgB,EAC5C,gBAAgB,EAAE,eAAe,EAAE,aAAa,EAAE,iBAAiB,EAAE,cAAc,EAAE,kBAAkB,EAAE,iBAAiB,EAC1H,aAAa,EAAE,eAAe,EAAE,kBAAkB,EAAE,iBAAiB,EACrE,eAAe,EAAE,gBAAgB,EAAE,iBAAiB,EACpD,eAAe,EAAE,cAAc,EAAE,kBAAkB,EACnD,kBAAkB,EAAE,YAAY,EAAE,wBAAwB,EAAE,kBAAkB,GAC/E,MAAM,qBAAqB,CAAC;AAE7B,YAAY,EACV,kBAAkB,EAAE,YAAY,EAChC,gBAAgB,EAAE,gBAAgB,EAAE,eAAe,EAAE,aAAa,EAClE,gBAAgB,EAAE,aAAa,EAC/B,mBAAmB,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,oBAAoB,EAC/E,mBAAmB,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,mBAAmB,EAC/E,iBAAiB,EAAE,iBAAiB,EAAE,gBAAgB,EACtD,aAAa,EAAE,mBAAmB,EAAE,eAAe,EAAE,gBAAgB,EACrE,cAAc,EAAE,eAAe,EAAE,yBAAyB,EAAE,mBAAmB,GAChF,MAAM,qBAAqB,CAAC;AAG7B,YAAY,EACV,gBAAgB,EAChB,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,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"}
@@ -1,23 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,52 +0,0 @@
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
@@ -1 +0,0 @@
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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BAAiB,IAAI,SAAS,MAAM,EAAE;IAMtC,OAAO,IAAI,IAAI;CAGhB;AAED,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,kBAAkB,GAAG,WAAW,CAE3F"}
@@ -1,75 +0,0 @@
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 ComponentMapping {
14
- readonly a2uiType: string;
15
- readonly nativeTag: string;
16
- readonly defaultAttributes?: Readonly<Record<string, string>>;
17
- readonly childStrategy: ChildStrategy;
18
- /** Maps A2UI property names to native-ui attribute names */
19
- readonly propertyMap?: Readonly<Record<string, string>>;
20
- /** Maps A2UI variant values to native-ui variant values */
21
- readonly variantMap?: Readonly<Record<string, string>>;
22
- /** The native-ui event name that maps to A2UI action */
23
- readonly actionEvent?: string;
24
- }
25
- export interface RegistrySnapshot {
26
- readonly mappings: ComponentMapping[];
27
- readonly categories: Record<string, string>;
28
- }
29
- export declare class ComponentRegistry {
30
- #private;
31
- constructor(mappings: readonly ComponentMapping[], categories?: Readonly<Record<string, string>>);
32
- get version(): Signal<number>;
33
- get(type: string): ComponentMapping | undefined;
34
- has(type: string): boolean;
35
- get size(): number;
36
- keys(): IterableIterator<string>;
37
- values(): IterableIterator<ComponentMapping>;
38
- entries(): IterableIterator<[string, ComponentMapping]>;
39
- forEach(cb: (mapping: ComponentMapping, type: string, map: Map<string, ComponentMapping>) => void): void;
40
- [Symbol.iterator](): IterableIterator<[string, ComponentMapping]>;
41
- add(mapping: ComponentMapping, notify?: boolean): void;
42
- update(a2uiType: string, patch: Partial<Omit<ComponentMapping, 'a2uiType'>>): void;
43
- remove(a2uiType: string): void;
44
- setCategory(a2uiType: string, category: string): void;
45
- toJSON(): RegistrySnapshot;
46
- static fromJSON(data: RegistrySnapshot): ComponentRegistry;
47
- clone(): ComponentRegistry;
48
- resolveNativeTag(a2uiType: string): ComponentMapping | null;
49
- resolveA2UIType(tag: string, attributes?: Readonly<Record<string, string>>): string | null;
50
- getSupportedTypes(): readonly string[];
51
- getComponentCategory(a2uiType: string): string;
52
- getCompatibleTypes(a2uiType: string): readonly string[];
53
- }
54
- export declare const defaultRegistry: ComponentRegistry;
55
- /** All component mappings, keyed by A2UI type. */
56
- export declare const COMPONENT_MAP: ComponentRegistry;
57
- export declare function resolveNativeTag(a2uiType: string): ComponentMapping | null;
58
- export declare function resolveA2UIType(tag: string, attributes?: Readonly<Record<string, string>>): string | null;
59
- export declare function getSupportedTypes(): readonly string[];
60
- export declare function getComponentCategory(a2uiType: string): string;
61
- export declare function getCompatibleTypes(a2uiType: string): readonly string[];
62
- /**
63
- * For A2UI Text components, resolve the variant to an HTML tag.
64
- * Returns 'span' by default.
65
- */
66
- export declare function textVariantTag(variant?: string): string;
67
- /**
68
- * For A2UI DateTimeInput components, resolve enableDate/enableTime to HTML input type.
69
- */
70
- export declare function dateTimeInputType(enableDate?: boolean, enableTime?: boolean): string;
71
- /**
72
- * For A2UI TextField components, resolve the variant to an HTML input type attribute.
73
- */
74
- export declare function textFieldInputType(variant?: string): string;
75
- //# sourceMappingURL=a2ui-component-map.d.ts.map
@@ -1 +0,0 @@
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,gBAAgB;IAC/B,QAAQ,CA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gB,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"}
@@ -1,37 +0,0 @@
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
- //# sourceMappingURL=a2ui-converter.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"a2ui-converter.d.ts","sourceRoot":"","sources":["../../../src/a2ui/protocol/a2ui-converter.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxE,OAAO,KAAK,EAAE,aAAa,EAAmB,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAS3F,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAIjE,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,QAAQ,EAAE,WAAW,CAAC,MAAM,EAAE,SAAS,gBAAgB,EAAE,CAAC,CAAC;IACpE,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;IACrC,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;CACrC;AAED,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAID,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,OAAO,CAAC,EAAE,mBAAmB,CAAC;IACvC,QAAQ,CAAC,QAAQ,CAAC,EAAE,iBAAiB,CAAC;CACvC;AAED,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,OAAO,CAAC,EAAE,mBAAmB,CAAC;IACvC,QAAQ,CAAC,QAAQ,CAAC,EAAE,iBAAiB,CAAC;CACvC;AAmBD,wBAAgB,YAAY,CAC1B,UAAU,EAAE,SAAS,aAAa,EAAE,EACpC,OAAO,CAAC,EAAE,eAAe,GACxB,gBAAgB,CAgElB;AAuYD,wBAAgB,YAAY,CAC1B,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE,aAAa,GACtB,SAAS,aAAa,EAAE,CAU1B;AA2HD;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,gBAAgB,EACxB,MAAM,GAAE,aAA2B,GAClC,MAAM,CAQR"}
@@ -1,34 +0,0 @@
1
- /**
2
- * A2UI Surface Manager
3
- *
4
- * Manages A2UI surface lifecycle: create → updateComponents → updateDataModel → delete.
5
- * Each surface maps to one UIPlan in the kernel.
6
- */
7
- import type { ReadonlySignal } from '@nonoun/native-ui';
8
- import type { A2UIServerMessage, A2UIActionMessage, A2UIComponent } from './a2ui-types.ts';
9
- import type { ComponentRegistry } from './a2ui-component-map.ts';
10
- import type { A2UIKernelBridge as Kernel } from './kernel-bridge.ts';
11
- import type { PatchOp } from './kernel-bridge.ts';
12
- export interface SurfaceState {
13
- readonly surfaceId: string;
14
- readonly planId: string;
15
- readonly catalogId?: string;
16
- readonly theme?: Readonly<Record<string, string>>;
17
- readonly container: HTMLElement;
18
- readonly rendered: boolean;
19
- }
20
- export declare function resolveJsonPointer(data: unknown, pointer: string): unknown;
21
- export declare function setJsonPointer(data: Record<string, unknown>, pointer: string, value: unknown): void;
22
- export declare class SurfaceManager {
23
- #private;
24
- readonly surfaceCount: ReadonlySignal<number>;
25
- constructor(kernel: Kernel, onAction: (msg: A2UIActionMessage) => void, onRender?: (surfaceId: string, container: HTMLElement) => void, registry?: ComponentRegistry);
26
- handleMessage(msg: A2UIServerMessage, container?: HTMLElement): void;
27
- getSurface(surfaceId: string): SurfaceState | null;
28
- getSurfaceIds(): readonly string[];
29
- getDataModel(surfaceId: string): Record<string, unknown> | null;
30
- destroy(): void;
31
- }
32
- export declare function diffComponents(oldComponents: readonly A2UIComponent[], newComponents: readonly A2UIComponent[], surfaceId: string, registry?: ComponentRegistry): readonly PatchOp[];
33
- export declare function createSurfaceManager(kernel: Kernel, onAction: (msg: A2UIActionMessage) => void, registry?: ComponentRegistry): SurfaceManager;
34
- //# sourceMappingURL=a2ui-surface.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"a2ui-surface.d.ts","sourceRoot":"","sources":["../../../src/a2ui/protocol/a2ui-surface.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAU,cAAc,EAAW,MAAM,mBAAmB,CAAC;AACzE,OAAO,KAAK,EACV,iBAAiB,EACjB,iBAAiB,EACjB,aAAa,EAKd,MAAM,iBAAiB,CAAC;AASzB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,KAAK,EAAE,gBAAgB,IAAI,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACrE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAIlD,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,KAAK,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAClD,QAAQ,CAAC,SAAS,EAAE,WAAW,CAAC;IAChC,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;CAC5B;AAkBD,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,E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IAdapter, forwarding inbound
6
- * messages to receive() and outbound client messages back to the server.
7
- */
8
- import type { A2UIAdapter } from './a2ui-adapter.ts';
9
- import type { A2UIClientMessage, A2UIServerMessage } from './a2ui-types.ts';
10
- export type TransportState = 'disconnected' | 'connecting' | 'connected' | 'reconnecting' | 'closed';
11
- export interface TransportEvents {
12
- readonly onStateChange?: (state: TransportState) => void;
13
- readonly onError?: (error: Error) => void;
14
- readonly onMessage?: (msg: A2UIServerMessage) => void;
15
- }
16
- export interface WebSocketTransportOptions extends TransportEvents {
17
- /** Render container for received surfaces. */
18
- readonly container?: HTMLElement;
19
- /** Auto-reconnect on disconnect (default: true). */
20
- readonly reconnect?: boolean;
21
- /** Max reconnect attempts (default: 5). */
22
- readonly maxReconnects?: number;
23
- /** Base reconnect delay in ms (default: 1000). Doubles each attempt. */
24
- readonly reconnectDelay?: number;
25
- /** Protocols to pass to WebSocket constructor. */
26
- readonly protocols?: string | string[];
27
- }
28
- export declare class WebSocketTransport {
29
- #private;
30
- constructor(adapter: A2UIAdapter, url: string, options?: WebSocketTransportOptions);
31
- get state(): TransportState;
32
- /**
33
- * Open the WebSocket connection.
34
- * Messages are forwarded to adapter.receive() as they arrive.
35
- */
36
- connect(): void;
37
- /**
38
- * Send a client message (action, error) to the server.
39
- */
40
- send(msg: A2UIClientMessage): void;
41
- /**
42
- * Close the connection. No reconnection will be attempted.
43
- */
44
- close(): void;
45
- }
46
- export interface SSETransportOptions extends TransportEvents {
47
- /** Render container for received surfaces. */
48
- readonly container?: HTMLElement;
49
- /** EventSource init options (e.g., withCredentials). */
50
- readonly eventSourceInit?: EventSourceInit;
51
- /** SSE event name to listen for (default: 'message'). */
52
- readonly eventName?: string;
53
- /**
54
- * URL to POST client messages to (actions, errors).
55
- * If not provided, send() will throw.
56
- */
57
- readonly postUrl?: string;
58
- }
59
- export declare class SSETransport {
60
- #private;
61
- constructor(adapter: A2UIAdapter, url: string, options?: SSETransportOptions);
62
- get state(): TransportState;
63
- /**
64
- * Open the SSE connection.
65
- * Messages are forwarded to adapter.receive() as they arrive.
66
- */
67
- connect(): void;
68
- /**
69
- * Send a client message to the server via POST.
70
- * Requires postUrl to be set in options.
71
- */
72
- send(msg: A2UIClientMessage): Promise<void>;
73
- /**
74
- * Close the SSE connection.
75
- */
76
- close(): void;
77
- }
78
- export declare function createWebSocketTransport(adapter: A2UIAdapter, url: string, options?: WebSocketTransportOptions): WebSocketTransport;
79
- export declare function createSSETransport(adapter: A2UIAdapter, url: string, options?: SSETransportOptions): SSETransport;
80
- //# sourceMappingURL=a2ui-transport.d.ts.map