@nonoun/native-ai 1.0.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.
Files changed (144) hide show
  1. package/dist/a2ui/a2ui-diagnostics.d.ts +31 -0
  2. package/dist/a2ui/a2ui-diagnostics.d.ts.map +1 -0
  3. package/dist/a2ui/a2ui-element.d.ts +30 -0
  4. package/dist/a2ui/a2ui-element.d.ts.map +1 -0
  5. package/dist/a2ui/a2ui-presets.d.ts +22 -0
  6. package/dist/a2ui/a2ui-presets.d.ts.map +1 -0
  7. package/dist/a2ui/adapters/a2a-adapter.d.ts +38 -0
  8. package/dist/a2ui/adapters/a2a-adapter.d.ts.map +1 -0
  9. package/dist/a2ui/adapters/adapter-types.d.ts +19 -0
  10. package/dist/a2ui/adapters/adapter-types.d.ts.map +1 -0
  11. package/dist/a2ui/adapters/ag-ui-adapter.d.ts +42 -0
  12. package/dist/a2ui/adapters/ag-ui-adapter.d.ts.map +1 -0
  13. package/dist/a2ui/adapters/direct-adapter.d.ts +30 -0
  14. package/dist/a2ui/adapters/direct-adapter.d.ts.map +1 -0
  15. package/dist/a2ui/adapters/index.d.ts +8 -0
  16. package/dist/a2ui/adapters/index.d.ts.map +1 -0
  17. package/dist/a2ui/index.d.ts +15 -0
  18. package/dist/a2ui/index.d.ts.map +1 -0
  19. package/dist/a2ui/install.d.ts +23 -0
  20. package/dist/a2ui/install.d.ts.map +1 -0
  21. package/dist/a2ui/protocol/a2ui-adapter.d.ts +50 -0
  22. package/dist/a2ui/protocol/a2ui-adapter.d.ts.map +1 -0
  23. package/dist/a2ui/protocol/a2ui-component-map.d.ts +49 -0
  24. package/dist/a2ui/protocol/a2ui-component-map.d.ts.map +1 -0
  25. package/dist/a2ui/protocol/a2ui-converter.d.ts +34 -0
  26. package/dist/a2ui/protocol/a2ui-converter.d.ts.map +1 -0
  27. package/dist/a2ui/protocol/a2ui-surface.d.ts +33 -0
  28. package/dist/a2ui/protocol/a2ui-surface.d.ts.map +1 -0
  29. package/dist/a2ui/protocol/a2ui-transport.d.ts +80 -0
  30. package/dist/a2ui/protocol/a2ui-transport.d.ts.map +1 -0
  31. package/dist/a2ui/protocol/a2ui-types.d.ts +104 -0
  32. package/dist/a2ui/protocol/a2ui-types.d.ts.map +1 -0
  33. package/dist/a2ui/protocol/index.d.ts +13 -0
  34. package/dist/a2ui/protocol/index.d.ts.map +1 -0
  35. package/dist/a2ui/protocol/kernel-bridge.d.ts +114 -0
  36. package/dist/a2ui/protocol/kernel-bridge.d.ts.map +1 -0
  37. package/dist/a2ui/register.d.ts +11 -0
  38. package/dist/a2ui/register.d.ts.map +1 -0
  39. package/dist/a2ui/session/agent-session.d.ts +44 -0
  40. package/dist/a2ui/session/agent-session.d.ts.map +1 -0
  41. package/dist/a2ui/session/catalog.d.ts +41 -0
  42. package/dist/a2ui/session/catalog.d.ts.map +1 -0
  43. package/dist/a2ui/session/event-emitter.d.ts +17 -0
  44. package/dist/a2ui/session/event-emitter.d.ts.map +1 -0
  45. package/dist/a2ui/session/index.d.ts +9 -0
  46. package/dist/a2ui/session/index.d.ts.map +1 -0
  47. package/dist/a2ui/session/session-manager.d.ts +33 -0
  48. package/dist/a2ui/session/session-manager.d.ts.map +1 -0
  49. package/dist/a2ui/session/surface-registry.d.ts +32 -0
  50. package/dist/a2ui/session/surface-registry.d.ts.map +1 -0
  51. package/dist/a2ui/session/types.d.ts +27 -0
  52. package/dist/a2ui/session/types.d.ts.map +1 -0
  53. package/dist/adapter-mock-CmByL6zQ.js +845 -0
  54. package/dist/chat/avatar/chat-avatar-element.d.ts +18 -0
  55. package/dist/chat/avatar/chat-avatar-element.d.ts.map +1 -0
  56. package/dist/chat/avatar/index.d.ts +2 -0
  57. package/dist/chat/avatar/index.d.ts.map +1 -0
  58. package/dist/chat/avatar/n-chat-avatar.d.ts +2 -0
  59. package/dist/chat/avatar/n-chat-avatar.d.ts.map +1 -0
  60. package/dist/chat/chat-input-element.d.ts +32 -0
  61. package/dist/chat/chat-input-element.d.ts.map +1 -0
  62. package/dist/chat/chat-panel-element.d.ts +100 -0
  63. package/dist/chat/chat-panel-element.d.ts.map +1 -0
  64. package/dist/chat/feed/chat-feed-element.d.ts +48 -0
  65. package/dist/chat/feed/chat-feed-element.d.ts.map +1 -0
  66. package/dist/chat/feed/index.d.ts +2 -0
  67. package/dist/chat/feed/index.d.ts.map +1 -0
  68. package/dist/chat/feed/n-chat-feed.d.ts +2 -0
  69. package/dist/chat/feed/n-chat-feed.d.ts.map +1 -0
  70. package/dist/chat/gateway/adapter-chatgpt.d.ts +67 -0
  71. package/dist/chat/gateway/adapter-chatgpt.d.ts.map +1 -0
  72. package/dist/chat/gateway/adapter-claude.d.ts +68 -0
  73. package/dist/chat/gateway/adapter-claude.d.ts.map +1 -0
  74. package/dist/chat/gateway/adapter-mock.d.ts +3 -0
  75. package/dist/chat/gateway/adapter-mock.d.ts.map +1 -0
  76. package/dist/chat/gateway/adapter.d.ts +71 -0
  77. package/dist/chat/gateway/adapter.d.ts.map +1 -0
  78. package/dist/chat/gateway/controller.d.ts +46 -0
  79. package/dist/chat/gateway/controller.d.ts.map +1 -0
  80. package/dist/chat/gateway/index.d.ts +9 -0
  81. package/dist/chat/gateway/index.d.ts.map +1 -0
  82. package/dist/chat/gateway/runtime.d.ts +53 -0
  83. package/dist/chat/gateway/runtime.d.ts.map +1 -0
  84. package/dist/chat/gateway/types.d.ts +73 -0
  85. package/dist/chat/gateway/types.d.ts.map +1 -0
  86. package/dist/chat/gateway.d.ts +2 -0
  87. package/dist/chat/gateway.d.ts.map +1 -0
  88. package/dist/chat/index.d.ts +17 -0
  89. package/dist/chat/index.d.ts.map +1 -0
  90. package/dist/chat/message/chat-input-structured-element.d.ts +43 -0
  91. package/dist/chat/message/chat-input-structured-element.d.ts.map +1 -0
  92. package/dist/chat/message/chat-message-activity-element.d.ts +32 -0
  93. package/dist/chat/message/chat-message-activity-element.d.ts.map +1 -0
  94. package/dist/chat/message/chat-message-element.d.ts +44 -0
  95. package/dist/chat/message/chat-message-element.d.ts.map +1 -0
  96. package/dist/chat/message/chat-message-genui-element.d.ts +45 -0
  97. package/dist/chat/message/chat-message-genui-element.d.ts.map +1 -0
  98. package/dist/chat/message/chat-message-seed-element.d.ts +33 -0
  99. package/dist/chat/message/chat-message-seed-element.d.ts.map +1 -0
  100. package/dist/chat/message/chat-message-text-element.d.ts +37 -0
  101. package/dist/chat/message/chat-message-text-element.d.ts.map +1 -0
  102. package/dist/chat/message/chat-messages-element.d.ts +39 -0
  103. package/dist/chat/message/chat-messages-element.d.ts.map +1 -0
  104. package/dist/chat/message/index.d.ts +8 -0
  105. package/dist/chat/message/index.d.ts.map +1 -0
  106. package/dist/chat/message/n-chat-message.d.ts +2 -0
  107. package/dist/chat/message/n-chat-message.d.ts.map +1 -0
  108. package/dist/chat/register.d.ts +13 -0
  109. package/dist/chat/register.d.ts.map +1 -0
  110. package/dist/chat/stream/classify.d.ts +19 -0
  111. package/dist/chat/stream/classify.d.ts.map +1 -0
  112. package/dist/chat/stream/create-transport.d.ts +19 -0
  113. package/dist/chat/stream/create-transport.d.ts.map +1 -0
  114. package/dist/chat/stream/index.d.ts +9 -0
  115. package/dist/chat/stream/index.d.ts.map +1 -0
  116. package/dist/chat/stream/parse-json.d.ts +9 -0
  117. package/dist/chat/stream/parse-json.d.ts.map +1 -0
  118. package/dist/chat/stream/parse-ndjson.d.ts +9 -0
  119. package/dist/chat/stream/parse-ndjson.d.ts.map +1 -0
  120. package/dist/chat/stream/parse-sse.d.ts +9 -0
  121. package/dist/chat/stream/parse-sse.d.ts.map +1 -0
  122. package/dist/chat/stream/types.d.ts +42 -0
  123. package/dist/chat/stream/types.d.ts.map +1 -0
  124. package/dist/chat/telemetry/emitter.d.ts +20 -0
  125. package/dist/chat/telemetry/emitter.d.ts.map +1 -0
  126. package/dist/chat/telemetry/events.d.ts +11 -0
  127. package/dist/chat/telemetry/events.d.ts.map +1 -0
  128. package/dist/chat/telemetry/index.d.ts +5 -0
  129. package/dist/chat/telemetry/index.d.ts.map +1 -0
  130. package/dist/chat/telemetry/redactor.d.ts +17 -0
  131. package/dist/chat/telemetry/redactor.d.ts.map +1 -0
  132. package/dist/chat/telemetry/types.d.ts +27 -0
  133. package/dist/chat/telemetry/types.d.ts.map +1 -0
  134. package/dist/gateway.d.ts +2 -0
  135. package/dist/gateway.d.ts.map +1 -0
  136. package/dist/gateway.js +33 -0
  137. package/dist/index.d.ts +5 -0
  138. package/dist/index.d.ts.map +1 -0
  139. package/dist/native-ai.css +1404 -0
  140. package/dist/native-ai.js +11142 -0
  141. package/dist/register.d.ts +12 -0
  142. package/dist/register.d.ts.map +1 -0
  143. package/dist/register.js +0 -0
  144. package/package.json +66 -0
@@ -0,0 +1,104 @@
1
+ /**
2
+ * A2UI Protocol — Wire Format Types
3
+ *
4
+ * Type definitions for Google's A2UI (Agent-to-UI) protocol.
5
+ * Supports both v0.8 and v0.9 message formats.
6
+ * No runtime code except type guard functions.
7
+ */
8
+ export type A2UIProtocolVersion = '0.8' | '0.9';
9
+ export type A2UIServerMessage = A2UICreateSurface | A2UIUpdateComponents | A2UIUpdateDataModel | A2UIDeleteSurface | A2UICatalogRequest;
10
+ export interface A2UICreateSurface {
11
+ readonly createSurface: {
12
+ readonly surfaceId: string;
13
+ readonly catalogId?: string;
14
+ readonly theme?: Readonly<Record<string, string>>;
15
+ };
16
+ }
17
+ export interface A2UIUpdateComponents {
18
+ readonly updateComponents: {
19
+ readonly surfaceId: string;
20
+ readonly components: readonly A2UIComponent[];
21
+ };
22
+ }
23
+ export interface A2UIUpdateDataModel {
24
+ readonly updateDataModel: {
25
+ readonly surfaceId: string;
26
+ readonly path?: string;
27
+ readonly value?: unknown;
28
+ };
29
+ }
30
+ export interface A2UIDeleteSurface {
31
+ readonly deleteSurface: {
32
+ readonly surfaceId: string;
33
+ };
34
+ }
35
+ export interface A2UICatalogRequest {
36
+ readonly requestCatalog: {
37
+ readonly surfaceId?: string;
38
+ };
39
+ }
40
+ export interface A2UICatalogResponse {
41
+ readonly catalog: {
42
+ readonly surfaceId?: string;
43
+ readonly supportedTypes: readonly string[];
44
+ readonly version: string;
45
+ };
46
+ }
47
+ export type A2UIClientMessage = A2UIActionMessage | A2UIErrorMessage | A2UICatalogResponse;
48
+ export interface A2UIActionMessage {
49
+ readonly action: {
50
+ readonly surfaceId: string;
51
+ readonly sourceComponentId: string;
52
+ readonly name: string;
53
+ readonly timestamp: string;
54
+ readonly context?: Readonly<Record<string, unknown>>;
55
+ };
56
+ }
57
+ export interface A2UIErrorMessage {
58
+ readonly error: {
59
+ readonly surfaceId: string;
60
+ readonly code: string;
61
+ readonly message: string;
62
+ };
63
+ }
64
+ export interface A2UIComponent {
65
+ readonly id: string;
66
+ readonly component: string;
67
+ readonly children?: readonly string[];
68
+ readonly child?: string;
69
+ readonly text?: string;
70
+ readonly label?: string;
71
+ readonly variant?: string;
72
+ readonly disabled?: boolean;
73
+ readonly action?: A2UIComponentAction;
74
+ readonly accessibility?: {
75
+ readonly label?: string;
76
+ readonly description?: string;
77
+ };
78
+ readonly [key: string]: unknown;
79
+ }
80
+ export interface A2UIComponentAction {
81
+ readonly event: {
82
+ readonly name: string;
83
+ readonly context?: Readonly<Record<string, unknown>>;
84
+ };
85
+ }
86
+ export interface A2UIDataBinding {
87
+ readonly path: string;
88
+ }
89
+ export type A2UIStandardType = 'Text' | 'Button' | 'TextField' | 'TextArea' | 'CheckBox' | 'Switch' | 'ChoicePicker' | 'Slider' | 'DateTimeInput' | 'Row' | 'Column' | 'Card' | 'Modal' | 'Tabs' | 'List' | 'ListItem' | 'Image' | 'Icon' | 'Divider' | 'Badge' | 'Avatar' | 'Select' | 'Video' | 'AudioPlayer';
90
+ export declare function isDataBinding(value: unknown): value is A2UIDataBinding;
91
+ export declare function isCreateSurface(msg: A2UIServerMessage): msg is A2UICreateSurface;
92
+ export declare function isUpdateComponents(msg: A2UIServerMessage): msg is A2UIUpdateComponents;
93
+ export declare function isUpdateDataModel(msg: A2UIServerMessage): msg is A2UIUpdateDataModel;
94
+ export declare function isDeleteSurface(msg: A2UIServerMessage): msg is A2UIDeleteSurface;
95
+ export declare function isCatalogRequest(msg: A2UIServerMessage): msg is A2UICatalogRequest;
96
+ export declare function isActionMessage(msg: A2UIClientMessage): msg is A2UIActionMessage;
97
+ export declare function isErrorMessage(msg: A2UIClientMessage): msg is A2UIErrorMessage;
98
+ export declare function isCatalogResponse(msg: A2UIClientMessage): msg is A2UICatalogResponse;
99
+ /**
100
+ * Parse a raw JSON string into a typed A2UI server message.
101
+ * Returns null if the JSON is not a valid A2UI message.
102
+ */
103
+ export declare function parseServerMessage(json: string): A2UIServerMessage | null;
104
+ //# sourceMappingURL=a2ui-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"a2ui-types.d.ts","sourceRoot":"","sources":["../../../src/a2ui/protocol/a2ui-types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,MAAM,MAAM,mBAAmB,GAAG,KAAK,GAAG,KAAK,CAAC;AAIhD,MAAM,MAAM,iBAAiB,GACzB,iBAAiB,GACjB,oBAAoB,GACpB,mBAAmB,GACnB,iBAAiB,GACjB,kBAAkB,CAAC;AAEvB,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,aAAa,EAAE;QACtB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;QAC3B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;QAC5B,QAAQ,CAAC,KAAK,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;KACnD,CAAC;CACH;AAED,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,gBAAgB,EAAE;QACzB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;QAC3B,QAAQ,CAAC,UAAU,EAAE,SAAS,aAAa,EAAE,CAAC;KAC/C,CAAC;CACH;AAED,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,eAAe,E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GACN,SAAS,GACT,OAAO,GACP,QAAQ,GACR,QAAQ,GACR,OAAO,GACP,aAAa,CAAC;AAIlB,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,eAAe,CAQtE;AAED,wBAAgB,eAAe,CAAC,GAAG,EAAE,iBAAiB,GAAG,GAAG,IAAI,iBAAiB,CAEhF;AAED,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,iBAAiB,GAAG,GAAG,IAAI,oBAAoB,CAEtF;AAED,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,iBAAiB,GAAG,GAAG,IAAI,mBAAmB,CAEpF;AAED,wBAAgB,eAAe,CAAC,GAAG,EAAE,iBAAiB,GAAG,GAAG,IAAI,iBAAiB,CAEhF;AAED,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,iBAAiB,GAAG,GAAG,IAAI,kBAAkB,CAElF;AAED,wBAAgB,eAAe,CAAC,GAAG,EAAE,iBAAiB,GAAG,GAAG,IAAI,iBAAiB,CAEhF;AAED,wBAAgB,cAAc,CAAC,GAAG,EAAE,iBAAiB,GAAG,GAAG,IAAI,gBAAgB,CAE9E;AAED,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,iBAAiB,GAAG,GAAG,IAAI,mBAAmB,CAEpF;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,iBAAiB,GAAG,IAAI,CAYzE"}
@@ -0,0 +1,13 @@
1
+ export { A2UIAdapter, createA2UIAdapter } from './a2ui-adapter.ts';
2
+ export type { A2UIAdapterOptions } from './a2ui-adapter.ts';
3
+ export { SurfaceManager, createSurfaceManager, resolveJsonPointer, setJsonPointer } from './a2ui-surface.ts';
4
+ export type { SurfaceState } from './a2ui-surface.ts';
5
+ export { a2uiToUINode, uiNodeToA2UI, conversionToPlan } from './a2ui-converter.ts';
6
+ export type { ConversionResult, DataBindingEntry, ToUINodeOptions, ToA2UIOptions } from './a2ui-converter.ts';
7
+ export { resolveNativeTag, resolveA2UIType, COMPONENT_MAP, getSupportedTypes, textVariantTag, textFieldInputType, dateTimeInputType } from './a2ui-component-map.ts';
8
+ export type { ComponentMapping, ChildStrategy } from './a2ui-component-map.ts';
9
+ export { isDataBinding, isCreateSurface, isUpdateComponents, isUpdateDataModel, isDeleteSurface, isCatalogRequest, isCatalogResponse, isActionMessage, isErrorMessage, parseServerMessage, } from './a2ui-types.ts';
10
+ export type { A2UIProtocolVersion, A2UIServerMessage, A2UICreateSurface, A2UIUpdateComponents, A2UIUpdateDataModel, A2UIDeleteSurface, A2UICatalogRequest, A2UICatalogResponse, A2UIClientMessage, A2UIActionMessage, A2UIErrorMessage, A2UIComponent, A2UIComponentAction, A2UIDataBinding, A2UIStandardType, } from './a2ui-types.ts';
11
+ export { WebSocketTransport, SSETransport, createWebSocketTransport, createSSETransport } from './a2ui-transport.ts';
12
+ export type { TransportState, TransportEvents, WebSocketTransportOptions, SSETransportOptions } from './a2ui-transport.ts';
13
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/a2ui/protocol/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACnE,YAAY,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAC7G,YAAY,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACnF,YAAY,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAC9G,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,aAAa,EAAE,iBAAiB,EAAE,cAAc,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACrK,YAAY,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAC/E,OAAO,EACL,aAAa,EACb,eAAe,EACf,kBAAkB,EAClB,iBAAiB,EACjB,eAAe,EACf,gBAAgB,EAChB,iBAAiB,EACjB,eAAe,EACf,cAAc,EACd,kBAAkB,GACnB,MAAM,iBAAiB,CAAC;AACzB,YAAY,EACV,mBAAmB,EACnB,iBAAiB,EACjB,iBAAiB,EACjB,oBAAoB,EACpB,mBAAmB,EACnB,iBAAiB,EACjB,kBAAkB,EAClB,mBAAmB,EACnB,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,aAAa,EACb,mBAAmB,EACnB,eAAe,EACf,gBAAgB,GACjB,MAAM,iBAAiB,CAAC;AAGzB,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,wBAAwB,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACrH,YAAY,EAAE,cAAc,EAAE,eAAe,EAAE,yBAAyB,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC"}
@@ -0,0 +1,114 @@
1
+ /**
2
+ * Kernel Bridge Interface
3
+ *
4
+ * Decouples A2UI protocol from the concrete Kernel class.
5
+ * The real Kernel satisfies this via TypeScript structural typing — no `implements` needed.
6
+ *
7
+ * Only the subset of Kernel/types/patch that A2UI actually accesses is duplicated here.
8
+ */
9
+ import type { Dispose } from '@nonoun/native-ui';
10
+ export interface UINode {
11
+ readonly id: string;
12
+ readonly tag: string;
13
+ readonly attributes?: Readonly<Record<string, string>>;
14
+ readonly properties?: Readonly<Record<string, unknown>>;
15
+ readonly children?: readonly UINode[];
16
+ readonly textContent?: string;
17
+ readonly events?: Readonly<Record<string, string>>;
18
+ readonly slot?: string;
19
+ }
20
+ export type CommandSource = 'human' | 'generated' | 'replay';
21
+ export interface UIPlan {
22
+ readonly id: string;
23
+ readonly version: number;
24
+ readonly root: UINode;
25
+ readonly source: CommandSource;
26
+ readonly timestamp: number;
27
+ }
28
+ export type PatchOp = {
29
+ readonly type: 'add';
30
+ readonly parentId: string;
31
+ readonly node: UINode;
32
+ readonly index?: number;
33
+ } | {
34
+ readonly type: 'remove';
35
+ readonly targetId: string;
36
+ } | {
37
+ readonly type: 'replace';
38
+ readonly targetId: string;
39
+ readonly node: UINode;
40
+ } | {
41
+ readonly type: 'set-attribute';
42
+ readonly targetId: string;
43
+ readonly name: string;
44
+ readonly value: string;
45
+ } | {
46
+ readonly type: 'remove-attribute';
47
+ readonly targetId: string;
48
+ readonly name: string;
49
+ } | {
50
+ readonly type: 'set-property';
51
+ readonly targetId: string;
52
+ readonly name: string;
53
+ readonly value: unknown;
54
+ } | {
55
+ readonly type: 'set-text';
56
+ readonly targetId: string;
57
+ readonly text: string;
58
+ } | {
59
+ readonly type: 'set-event';
60
+ readonly targetId: string;
61
+ readonly event: string;
62
+ readonly commandType: string;
63
+ } | {
64
+ readonly type: 'remove-event';
65
+ readonly targetId: string;
66
+ readonly event: string;
67
+ };
68
+ export interface UIPatch {
69
+ readonly planId: string;
70
+ readonly ops: readonly PatchOp[];
71
+ readonly source: CommandSource;
72
+ readonly timestamp: number;
73
+ }
74
+ export interface PlanResult {
75
+ readonly plan: UIPlan;
76
+ readonly validation: {
77
+ readonly valid: boolean;
78
+ readonly errors: readonly {
79
+ readonly path: string;
80
+ readonly code: string;
81
+ readonly message: string;
82
+ }[];
83
+ };
84
+ readonly accessibility: {
85
+ readonly violations: readonly unknown[];
86
+ readonly passes: number;
87
+ };
88
+ readonly warnings: readonly string[];
89
+ }
90
+ export interface Command<T = unknown> {
91
+ readonly type: string;
92
+ readonly payload: T;
93
+ readonly id: string;
94
+ readonly timestamp: number;
95
+ readonly source: CommandSource;
96
+ }
97
+ export type CommandFilter = (command: Command) => boolean;
98
+ export type CommandHandler<T = unknown> = (command: Command<T>) => void | Promise<void>;
99
+ /**
100
+ * The subset of the Kernel API that A2UI needs.
101
+ * Real `Kernel` from `@nonoun/native-ui/kernel` satisfies this structurally.
102
+ */
103
+ export interface A2UIKernelBridge {
104
+ readonly bus: {
105
+ on(typeOrFilter: string | CommandFilter, handler: CommandHandler): Dispose;
106
+ };
107
+ readonly executor: {
108
+ getElements(planId: string): Map<string, HTMLElement> | null;
109
+ };
110
+ executePlan(plan: UIPlan, container: HTMLElement): Map<string, HTMLElement>;
111
+ patchPlan(patch: UIPatch): unknown;
112
+ teardownPlan(planId: string): void;
113
+ }
114
+ //# sourceMappingURL=kernel-bridge.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"kernel-bridge.d.ts","sourceRoot":"","sources":["../../../src/a2ui/protocol/kernel-bridge.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAIjD,MAAM,WAAW,MAAM;IACrB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,UAAU,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IACvD,QAAQ,CAAC,UAAU,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IACxD,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACtC,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,MAAM,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IACnD,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;CACxB;AAID,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,WAAW,GAAG,QAAQ,CAAC;AAE7D,MAAM,WAAW,MAAM;IACrB,QAAQ,CAA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AAC,GAAG,OAAO;IAClC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,CAAC,CAAC;IACpB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAC;CAChC;AAED,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,EAAE,OAAO,KAAK,OAAO,CAAC;AAC1D,MAAM,MAAM,cAAc,CAAC,CAAC,GAAG,OAAO,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;AAIxF;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,GAAG,EAAE;QACZ,EAAE,CAAC,YAAY,EAAE,MAAM,GAAG,aAAa,EAAE,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC;KAC5E,CAAC;IACF,QAAQ,CAAC,QAAQ,EAAE;QACjB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,GAAG,IAAI,CAAC;KAC9D,CAAC;IACF,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,WAAW,GAAG,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;IAC5E,SAAS,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC;IACnC,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CACpC"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Register native-a2ui
3
+ *
4
+ * Side-effect module that registers the <native-a2ui> custom element
5
+ * and all dogfooded n-* components it creates via document.createElement.
6
+ *
7
+ * Usage:
8
+ * import '@nonoun/native-ai/register';
9
+ */
10
+ export {};
11
+ //# sourceMappingURL=register.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../../src/a2ui/register.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG"}
@@ -0,0 +1,44 @@
1
+ /**
2
+ * NAgentSession — Per-Agent Session
3
+ *
4
+ * Represents a single agent-to-renderer connection. Each session wraps
5
+ * a dedicated A2UIAdapter (1:1) and validates ownership + catalog
6
+ * before delegating to the existing protocol layer.
7
+ */
8
+ import type { A2UIServerMessage } from '../protocol/a2ui-types.ts';
9
+ import type { A2UIKernelBridge } from '../protocol/kernel-bridge.ts';
10
+ import type { NSessionStatus, NInteractionEvent } from './types.ts';
11
+ import { NEventEmitter } from './event-emitter.ts';
12
+ import type { NCatalog } from './catalog.ts';
13
+ import type { NSurfaceRegistry } from './surface-registry.ts';
14
+ interface SessionEventMap {
15
+ 'interaction': (e: NInteractionEvent) => void;
16
+ 'surface-ready': (surfaceId: string) => void;
17
+ 'status-change': (status: NSessionStatus) => void;
18
+ 'catalog-violation': (type: string, componentId: string) => void;
19
+ }
20
+ export interface NAgentSessionConfig {
21
+ readonly agentId: string;
22
+ readonly catalog: NCatalog;
23
+ readonly surfaces?: readonly string[];
24
+ }
25
+ export declare class NAgentSession {
26
+ #private;
27
+ readonly id: string;
28
+ readonly agentId: string;
29
+ readonly catalog: NCatalog;
30
+ readonly eventEmitter: NEventEmitter;
31
+ constructor(kernel: A2UIKernelBridge, registry: NSurfaceRegistry, config: NAgentSessionConfig);
32
+ get status(): NSessionStatus;
33
+ /**
34
+ * Inbound: agent sends A2UI payload.
35
+ * Validates ownership and catalog before forwarding to the internal adapter.
36
+ */
37
+ receive(message: A2UIServerMessage | string): void;
38
+ /** Subscribe to session events. */
39
+ on<K extends keyof SessionEventMap>(event: K, handler: SessionEventMap[K]): () => void;
40
+ /** Terminate the session and clean up. */
41
+ terminate(): void;
42
+ }
43
+ export {};
44
+ //# sourceMappingURL=agent-session.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-session.d.ts","sourceRoot":"","sources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OAAO,CAAC,OAAO,EAAE,iBAAiB,GAAG,MAAM,GAAG,IAAI;IA4ClD,mCAAmC;IACnC,EAAE,CAAC,CAAC,SAAS,MAAM,eAAe,EAAE,KAAK,EAAE,CAAC,EAAE,OAAO,EAAE,eAAe,CAAC,CAAC,CAAC,GAAG,MAAM,IAAI;IAStF,0CAA0C;IAC1C,SAAS,IAAI,IAAI;CAqBlB"}
@@ -0,0 +1,41 @@
1
+ /**
2
+ * NCatalog — Per-Session Component Catalog
3
+ *
4
+ * Scoped component catalog for security enforcement.
5
+ * Agents can only render components granted in their session's catalog.
6
+ * Reads from the existing COMPONENT_MAP in a2ui-component-map.ts.
7
+ */
8
+ import type { A2UIComponent } from '../protocol/a2ui-types.ts';
9
+ export interface NCatalogEntry {
10
+ readonly a2uiType: string;
11
+ readonly tagName: string;
12
+ readonly properties: readonly string[];
13
+ readonly events: readonly string[];
14
+ }
15
+ export declare class NCatalog {
16
+ #private;
17
+ constructor(entries: readonly NCatalogEntry[]);
18
+ /** All catalog entries. */
19
+ get entries(): readonly NCatalogEntry[];
20
+ /** Check if a component type is in this catalog. */
21
+ has(a2uiType: string): boolean;
22
+ /** Get entry for a component type. */
23
+ get(a2uiType: string): NCatalogEntry | undefined;
24
+ /**
25
+ * Serialize to A2UI catalog format for AgentCard / negotiation.
26
+ */
27
+ toManifest(): object;
28
+ /**
29
+ * Filter an A2UI component array against this catalog.
30
+ * Returns only components whose type is allowed.
31
+ * Also strips blocked component IDs from parent children arrays.
32
+ */
33
+ filterComponents(components: readonly A2UIComponent[], onViolation?: (type: string, id: string) => void): A2UIComponent[];
34
+ }
35
+ /**
36
+ * Build a catalog from the existing COMPONENT_MAP.
37
+ * - `'core-only'`: excludes `native-dashboard-*` elements (recommended default)
38
+ * - `'full'`: all registered component types
39
+ */
40
+ export declare function buildCatalogFromRegistry(scope?: 'full' | 'core-only'): NCatalog;
41
+ //# sourceMappingURL=catalog.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"catalog.d.ts","sourceRoot":"","sources":["../../../src/a2ui/session/catalog.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAM/D,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,UAAU,EAAE,SAAS,MAAM,EAAE,CAAC;IACvC,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;CACpC;AAID,qBAAa,QAAQ;;gBAGP,OAAO,EAAE,SAAS,aAAa,EAAE;IAM7C,2BAA2B;IAC3B,IAAI,OAAO,IAAI,SAAS,aAAa,EAAE,CAEtC;IAED,oDAAoD;IACpD,GAAG,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO;IAI9B,sCAAsC;IACtC,GAAG,CAAC,QAAQ,EAAE,MAAM,GAAG,aAAa,GAAG,SAAS;IAIhD;;OAEG;IACH,UAAU,IAAI,MAAM;IAapB;;;;OAIG;IACH,gBAAgB,CACd,UAAU,EAAE,SAAS,aAAa,EAAE,EACpC,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,KAAK,IAAI,GAC/C,aAAa,EAAE;CAsBnB;AAaD;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,KAAK,GAAE,MAAM,GAAG,WAAyB,GAAG,QAAQ,CAO5F"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * NEventEmitter — Typed Interaction Event Pub/Sub
3
+ *
4
+ * Routes user interaction events from rendered surfaces back to agent sessions.
5
+ * Each NAgentSession creates one NEventEmitter instance.
6
+ */
7
+ import type { NInteractionEvent } from './types.ts';
8
+ export declare class NEventEmitter {
9
+ #private;
10
+ /** Emit an interaction event to all subscribers. */
11
+ emit(event: NInteractionEvent): void;
12
+ /** Subscribe to interaction events. Returns an unsubscribe function. */
13
+ on(handler: (event: NInteractionEvent) => void): () => void;
14
+ /** Remove all subscribers. */
15
+ destroy(): void;
16
+ }
17
+ //# sourceMappingURL=event-emitter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"event-emitter.d.ts","sourceRoot":"","sources":["../../../src/a2ui/session/event-emitter.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAEpD,qBAAa,aAAa;;IAGxB,oDAAoD;IACpD,IAAI,CAAC,KAAK,EAAE,iBAAiB,GAAG,IAAI;IAIpC,wEAAwE;IACxE,EAAE,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,iBAAiB,KAAK,IAAI,GAAG,MAAM,IAAI;IAK3D,8BAA8B;IAC9B,OAAO,IAAI,IAAI;CAGhB"}
@@ -0,0 +1,9 @@
1
+ export { NSessionManager } from './session-manager.ts';
2
+ export { NAgentSession } from './agent-session.ts';
3
+ export type { NAgentSessionConfig } from './agent-session.ts';
4
+ export { NSurfaceRegistry } from './surface-registry.ts';
5
+ export { NEventEmitter } from './event-emitter.ts';
6
+ export { NCatalog, buildCatalogFromRegistry } from './catalog.ts';
7
+ export type { NCatalogEntry } from './catalog.ts';
8
+ export type { NSessionConfig, NSessionStatus, NInteractionEvent, NSurfaceState } from './types.ts';
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/a2ui/session/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,YAAY,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AAClE,YAAY,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClD,YAAY,EAAE,cAAc,EAAE,cAAc,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC"}
@@ -0,0 +1,33 @@
1
+ /**
2
+ * NSessionManager — Multi-Session Orchestrator
3
+ *
4
+ * Host-facing singleton that manages all active agent sessions.
5
+ * Creates sessions, resolves catalogs, and controls surface ownership transfers.
6
+ */
7
+ import type { A2UIKernelBridge } from '../protocol/kernel-bridge.ts';
8
+ import type { NSessionConfig } from './types.ts';
9
+ import { NAgentSession } from './agent-session.ts';
10
+ import { NSurfaceRegistry } from './surface-registry.ts';
11
+ export declare class NSessionManager {
12
+ #private;
13
+ readonly surfaces: NSurfaceRegistry;
14
+ constructor(kernel: A2UIKernelBridge);
15
+ /** Create a new agent session with the given configuration. */
16
+ createSession(config: NSessionConfig): NAgentSession;
17
+ /** Get a session by ID. */
18
+ getSession(id: string): NAgentSession | undefined;
19
+ /** Get all active sessions. */
20
+ getSessions(): readonly NAgentSession[];
21
+ /**
22
+ * Transfer surface ownership between sessions.
23
+ * Only the session manager (orchestrator) can perform transfers.
24
+ */
25
+ transferSurfaceOwnership(surfaceId: string, toSessionId: string): void;
26
+ /** Terminate a single session and clean up. */
27
+ terminateSession(id: string): void;
28
+ /** Terminate all sessions. */
29
+ terminateAll(): void;
30
+ /** Destroy the session manager and all sessions. */
31
+ destroy(): void;
32
+ }
33
+ //# sourceMappingURL=session-manager.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"session-manager.d.ts","sourceRoot":"","sources":["../../../src/a2ui/session/session-manager.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAGzD,qBAAa,eAAe;;IAC1B,QAAQ,CAAC,QAAQ,EAAE,gBAAgB,CAAC;gBAIxB,MAAM,EAAE,gBAAgB;IAKpC,+DAA+D;IAC/D,aAAa,CAAC,MAAM,EAAE,cAAc,GAAG,aAAa;IA+BpD,2BAA2B;IAC3B,UAAU,CAAC,EAAE,EAAE,MAAM,GAAG,aAAa,GAAG,SAAS;IAIjD,+BAA+B;IAC/B,WAAW,IAAI,SAAS,aAAa,EAAE;IAIvC;;;OAGG;IACH,wBAAwB,CAAC,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,IAAI;IAMtE,+CAA+C;IAC/C,gBAAgB,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI;IAOlC,8BAA8B;IAC9B,YAAY,IAAI,IAAI;IAKpB,oDAAoD;IACpD,OAAO,IAAI,IAAI;CAIhB"}
@@ -0,0 +1,32 @@
1
+ /**
2
+ * NSurfaceRegistry — Cross-Session Surface Coordination
3
+ *
4
+ * Tracks surfaces, ownership (single writer), observers (read-only),
5
+ * mount points, and state snapshots. Provides event notifications
6
+ * for surface updates and removals.
7
+ */
8
+ import type { NSurfaceState } from './types.ts';
9
+ import type { NAgentSession } from './agent-session.ts';
10
+ type SurfaceUpdatedHandler = (surfaceId: string, state: NSurfaceState) => void;
11
+ type SurfaceRemovedHandler = (surfaceId: string) => void;
12
+ export declare class NSurfaceRegistry {
13
+ #private;
14
+ registerMount(surfaceId: string, element: HTMLElement): void;
15
+ getMount(surfaceId: string): HTMLElement | undefined;
16
+ unregisterMount(surfaceId: string): void;
17
+ setOwner(surfaceId: string, session: NAgentSession): void;
18
+ getOwner(surfaceId: string): NAgentSession | undefined;
19
+ clearOwner(surfaceId: string): void;
20
+ isOwner(surfaceId: string, session: NAgentSession): boolean;
21
+ transferOwnership(surfaceId: string, to: NAgentSession): void;
22
+ addObserver(surfaceId: string, session: NAgentSession): void;
23
+ removeObserver(surfaceId: string, session: NAgentSession): void;
24
+ getObservers(surfaceId: string): readonly NAgentSession[];
25
+ updateState(surfaceId: string, state: NSurfaceState): void;
26
+ getState(surfaceId: string): NSurfaceState | undefined;
27
+ on(event: 'surface-updated', handler: SurfaceUpdatedHandler): () => void;
28
+ on(event: 'surface-removed', handler: SurfaceRemovedHandler): () => void;
29
+ destroy(): void;
30
+ }
31
+ export {};
32
+ //# sourceMappingURL=surface-registry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"surface-registry.d.ts","sourceRoot":"","sources":["../../../src/a2ui/session/surface-registry.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAGhD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAcxD,KAAK,qBAAqB,GAAG,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,aAAa,KAAK,IAAI,CAAC;AAC/E,KAAK,qBAAqB,GAAG,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;AAIzD,qBAAa,gBAAgB;;IAO3B,aAAa,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,GAAG,IAAI;IAe5D,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,WAAW,GAAG,SAAS;IAIpD,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI;IASxC,QAAQ,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,GAAG,IAAI;IAMzD,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,aAAa,GAAG,SAAS;IAItD,UAAU,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI;IAKnC,OAAO,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,GAAG,OAAO;IAI3D,iBAAiB,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE,EAAE,aAAa,GAAG,IAAI;IAQ7D,WAAW,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,GAAG,IAAI;IAM5D,cAAc,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,GAAG,IAAI;IAI/D,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,aAAa,EAAE;IAOzD,WAAW,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,aAAa,GAAG,IAAI;IAO1D,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,aAAa,GAAG,SAAS;IAMtD,EAAE,CAAC,KAAK,EAAE,iBAAiB,EAAE,OAAO,EAAE,qBAAqB,GAAG,MAAM,IAAI;IACxE,EAAE,CAAC,KAAK,EAAE,iBAAiB,EAAE,OAAO,EAAE,qBAAqB,GAAG,MAAM,IAAI;IAcxE,OAAO,IAAI,IAAI;CAKhB"}
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Session Layer — Shared Types
3
+ *
4
+ * Core type definitions for multi-session A2A support.
5
+ */
6
+ import type { A2UIComponent } from '../protocol/a2ui-types.ts';
7
+ export type NSessionStatus = 'connecting' | 'active' | 'suspended' | 'terminated';
8
+ export interface NSessionConfig {
9
+ readonly agentId: string;
10
+ readonly catalog: import('./catalog.ts').NCatalog | 'full' | 'core-only';
11
+ readonly surfaces?: readonly string[];
12
+ readonly metadata?: Readonly<Record<string, unknown>>;
13
+ }
14
+ export interface NInteractionEvent {
15
+ readonly surfaceId: string;
16
+ readonly componentId: string;
17
+ readonly eventType: string;
18
+ readonly payload: Readonly<Record<string, unknown>>;
19
+ readonly timestamp: number;
20
+ }
21
+ export interface NSurfaceState {
22
+ readonly surfaceId: string;
23
+ readonly components: readonly A2UIComponent[];
24
+ readonly dataModel: Readonly<Record<string, unknown>>;
25
+ readonly updatedAt: number;
26
+ }
27
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/a2ui/session/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAI/D,MAAM,MAAM,cAAc,GAAG,YAAY,GAAG,QAAQ,GAAG,WAAW,GAAG,YAAY,CAAC;AAIlF,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,OAAO,EAAE,OAAO,cAAc,EAAE,QAAQ,GAAG,MAAM,GAAG,WAAW,CAAC;IACzE,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACtC,QAAQ,CAAC,QAAQ,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;CACvD;AAID,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IACpD,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC5B;AAID,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,UAAU,EAAE,SAAS,aAAa,EAAE,CAAC;IAC9C,QAAQ,CAAC,SAAS,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IACtD,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC5B"}