@jini-ai/chat 0.3.11 → 0.5.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 (205) hide show
  1. package/CHANGELOG.md +130 -0
  2. package/README.md +152 -6
  3. package/dist/core/ag-ui/entry.d.ts +53 -0
  4. package/dist/core/ag-ui/entry.js +135 -0
  5. package/dist/core/agentic/chat-capabilities.d.ts +1 -1
  6. package/dist/core/agentic/index.d.ts +1 -1
  7. package/dist/core/agentic/index.js +1 -1
  8. package/dist/core/assistant-content.d.ts +6 -2
  9. package/dist/core/assistant-content.js +2 -2
  10. package/dist/core/compact-events.d.ts +3 -1
  11. package/dist/core/compact-events.js +1 -1
  12. package/dist/core/events.d.ts +1 -1
  13. package/dist/core/events.js +1 -1
  14. package/dist/core/index.d.ts +3 -3
  15. package/dist/core/index.js +3 -3
  16. package/dist/core/messages.d.ts +4 -2
  17. package/dist/core/messages.js +2 -2
  18. package/dist/core/partial-json.d.ts +6 -2
  19. package/dist/core/partial-json.js +3 -3
  20. package/dist/core/persistence/index.d.ts +1 -1
  21. package/dist/core/persistence/index.js +1 -1
  22. package/dist/core/persistence/ports.d.ts +2 -123
  23. package/dist/core/persistence/title.d.ts +3 -1
  24. package/dist/core/persistence/title.js +1 -1
  25. package/dist/core/question-form/format.d.ts +16 -7
  26. package/dist/core/question-form/format.js +3 -3
  27. package/dist/core/question-form/normalize.d.ts +7 -2
  28. package/dist/core/question-form/normalize.js +5 -5
  29. package/dist/core/question-form/scan.d.ts +18 -6
  30. package/dist/core/question-form/scan.js +14 -14
  31. package/dist/core/run-activity.d.ts +16 -4
  32. package/dist/core/run-activity.js +11 -11
  33. package/dist/core/run-events/entry.d.ts +121 -0
  34. package/dist/core/run-events/entry.js +290 -0
  35. package/dist/core/todos.d.ts +20 -8
  36. package/dist/core/todos.js +11 -11
  37. package/dist/core/tool-events.d.ts +3 -1
  38. package/dist/core/tool-events.js +1 -1
  39. package/dist/core/tool-output.d.ts +3 -1
  40. package/dist/core/tool-output.js +1 -1
  41. package/dist/core/tools.d.ts +14 -3
  42. package/dist/core/tools.js +3 -3
  43. package/dist/core/transcript.d.ts +13 -5
  44. package/dist/core/transcript.js +5 -5
  45. package/dist/core/util/manifest.d.ts +9 -3
  46. package/dist/core/util/manifest.js +3 -3
  47. package/dist/core/util/markdown-context.d.ts +11 -3
  48. package/dist/core/util/markdown-context.js +3 -3
  49. package/dist/core/util/markup-attributes.d.ts +3 -1
  50. package/dist/core/util/markup-attributes.js +1 -1
  51. package/dist/core/util/parser.d.ts +9 -5
  52. package/dist/core/util/parser.js +13 -13
  53. package/dist/core/util/recover.d.ts +6 -2
  54. package/dist/core/util/recover.js +6 -6
  55. package/dist/core/util/strip.d.ts +19 -5
  56. package/dist/core/util/strip.js +17 -17
  57. package/dist/core/util/validate.d.ts +3 -1
  58. package/dist/core/util/validate.js +1 -1
  59. package/dist/embed-widget/browser/page-actions.d.ts +121 -0
  60. package/dist/embed-widget/browser/page-actions.js +113 -0
  61. package/dist/embed-widget/browser/session-store.d.ts +44 -0
  62. package/dist/embed-widget/browser/session-store.js +103 -0
  63. package/dist/embed-widget/react/embed.d.ts +45 -0
  64. package/dist/embed-widget/react/embed.js +87 -0
  65. package/dist/embed-widget/react/header.d.ts +21 -0
  66. package/dist/embed-widget/react/header.js +18 -0
  67. package/dist/embed-widget/transports/fetch-sse.d.ts +75 -0
  68. package/dist/embed-widget/transports/fetch-sse.js +175 -0
  69. package/dist/react/agent-bridge/frontend-session-bridge.d.ts +15 -3
  70. package/dist/react/agent-bridge/frontend-session-bridge.js +13 -6
  71. package/dist/react/artifact-types.d.ts +3 -3
  72. package/dist/react/artifact-types.js +3 -3
  73. package/dist/react/components/A2uiSurfaceCard.js +34 -13
  74. package/dist/react/components/AttachmentPreviewModal.hooks.d.ts +7 -2
  75. package/dist/react/components/AttachmentPreviewModal.hooks.js +5 -5
  76. package/dist/react/components/AttachmentPreviewModal.js +2 -2
  77. package/dist/react/components/AttachmentTray.d.ts +3 -1
  78. package/dist/react/components/AttachmentTray.js +2 -2
  79. package/dist/react/components/ChatFab.js +1 -1
  80. package/dist/react/components/Composer.js +9 -9
  81. package/dist/react/components/ConversationList.js +1 -1
  82. package/dist/react/components/McpUiSurfaceCard.d.ts +4 -2
  83. package/dist/react/components/McpUiSurfaceCard.js +5 -5
  84. package/dist/react/components/MessageList.js +1 -1
  85. package/dist/react/components/MessageRow.js +9 -9
  86. package/dist/react/components/QuestionForm.js +5 -5
  87. package/dist/react/components/ToolCard.js +9 -9
  88. package/dist/react/components/composer-discovery.d.ts +29 -8
  89. package/dist/react/components/composer-discovery.js +10 -10
  90. package/dist/react/ext-event-renderer-registry.d.ts +15 -5
  91. package/dist/react/ext-event-renderer-registry.js +4 -4
  92. package/dist/react/features/chat-pane/components/AgentRuntimePicker.d.ts +3 -1
  93. package/dist/react/features/chat-pane/components/AgentRuntimePicker.js +3 -3
  94. package/dist/react/features/chat-pane/components/ChatPane.js +43 -43
  95. package/dist/react/features/chat-pane/create-daemon-attachment-uploader.d.ts +4 -1
  96. package/dist/react/features/chat-pane/create-daemon-attachment-uploader.js +5 -35
  97. package/dist/react/features/chat-pane/create-mcp-ui-tool-caller.d.ts +5 -2
  98. package/dist/react/features/chat-pane/create-mcp-ui-tool-caller.js +1 -1
  99. package/dist/react/features/chat-pane/hooks/useAgentRuntimePicker.hooks.d.ts +38 -10
  100. package/dist/react/features/chat-pane/hooks/useAgentRuntimePicker.hooks.js +15 -15
  101. package/dist/react/features/chat-pane/hooks/useChatPane.hooks.js +31 -31
  102. package/dist/react/features/chat-pane/hooks/useChatPaneAgentControl.hooks.d.ts +3 -1
  103. package/dist/react/features/chat-pane/hooks/useChatPaneAgentControl.hooks.js +3 -3
  104. package/dist/react/features/chat-pane/hooks/useChatPaneComposerPlaceholder.hooks.d.ts +4 -1
  105. package/dist/react/features/chat-pane/hooks/useChatPaneComposerPlaceholder.hooks.js +1 -1
  106. package/dist/react/features/chat-pane/hooks/useChatPaneRuntimeInventory.hooks.js +30 -30
  107. package/dist/react/features/chat-pane/hooks/useChatPaneWorkingDirectory.hooks.js +57 -57
  108. package/dist/react/features/chat-pane/rules.d.ts +13 -4
  109. package/dist/react/features/chat-pane/rules.js +5 -5
  110. package/dist/react/features/chat-pane/types.d.ts +1 -1
  111. package/dist/react/hooks/attachment-preview-cache.d.ts +7 -2
  112. package/dist/react/hooks/attachment-preview-cache.js +2 -2
  113. package/dist/react/hooks/composer-draft-cache.d.ts +17 -5
  114. package/dist/react/hooks/composer-draft-cache.js +6 -6
  115. package/dist/react/hooks/useArtifactStream.d.ts +5 -1
  116. package/dist/react/hooks/useArtifactStream.js +3 -3
  117. package/dist/react/hooks/useChatFabDrag.d.ts +9 -4
  118. package/dist/react/hooks/useChatFabDrag.js +4 -4
  119. package/dist/react/hooks/useComposer.js +8 -8
  120. package/dist/react/hooks/useConversation.js +56 -4
  121. package/dist/react/hooks/useExtEventGroups.d.ts +5 -1
  122. package/dist/react/hooks/useExtEventGroups.js +1 -1
  123. package/dist/react/hooks/useLatestOperation.d.ts +8 -3
  124. package/dist/react/hooks/useLatestOperation.js +4 -4
  125. package/dist/react/hooks/usePinnedTodos.d.ts +3 -1
  126. package/dist/react/hooks/usePinnedTodos.js +3 -3
  127. package/dist/react/hooks/useQuestionForms.d.ts +7 -2
  128. package/dist/react/hooks/useQuestionForms.js +7 -7
  129. package/dist/react/hooks/useRunActivity.d.ts +6 -1
  130. package/dist/react/hooks/useRunActivity.js +3 -3
  131. package/dist/react/hooks/useRunStream.d.ts +3 -1
  132. package/dist/react/hooks/useRunStream.js +1 -1
  133. package/dist/react/hooks/useToolTimeline.d.ts +3 -1
  134. package/dist/react/hooks/useToolTimeline.js +3 -3
  135. package/dist/react/index.d.ts +4 -4
  136. package/dist/react/index.js +6 -6
  137. package/dist/react/message-blocks.d.ts +10 -4
  138. package/dist/react/message-blocks.js +2 -2
  139. package/dist/react/styles/reference.css +3 -3
  140. package/dist/react/tool-renderer-registry.d.ts +8 -3
  141. package/dist/react/tool-renderer-registry.js +3 -3
  142. package/dist/react/util/defined-props.d.ts +3 -1
  143. package/dist/react/util/defined-props.js +1 -1
  144. package/dist/server/run-finalizer/entry.d.ts +47 -0
  145. package/dist/server/run-finalizer/entry.js +156 -0
  146. package/dist/server/run-finalizer/ports.d.ts +52 -0
  147. package/dist/store/contracts/index.d.ts +5 -0
  148. package/dist/store/contracts/index.js +5 -0
  149. package/dist/store/errors.d.ts +12 -0
  150. package/dist/store/errors.js +18 -0
  151. package/dist/store/index.d.ts +4 -0
  152. package/dist/store/index.js +2 -0
  153. package/dist/store/legacy/index.d.ts +3 -0
  154. package/dist/store/legacy/index.js +2 -0
  155. package/dist/store/legacy/sqlite/conversations.d.ts +129 -0
  156. package/dist/store/legacy/sqlite/conversations.js +274 -0
  157. package/dist/store/legacy/sqlite/index.d.ts +6 -0
  158. package/dist/store/legacy/sqlite/index.js +5 -0
  159. package/dist/store/legacy/sqlite/messages.d.ts +156 -0
  160. package/dist/store/legacy/sqlite/messages.js +246 -0
  161. package/dist/store/legacy/sqlite/schema.d.ts +3 -0
  162. package/dist/store/legacy/sqlite/schema.js +40 -0
  163. package/dist/store/pglite/index.d.ts +21 -0
  164. package/dist/store/pglite/index.js +17 -0
  165. package/dist/store/ports.d.ts +121 -0
  166. package/dist/store/ports.js +2 -0
  167. package/dist/store/postgres/index.d.ts +21 -0
  168. package/dist/store/postgres/index.js +17 -0
  169. package/dist/store/sql/boundary.d.ts +28 -0
  170. package/dist/store/sql/boundary.js +32 -0
  171. package/dist/store/sql/cursor.d.ts +24 -0
  172. package/dist/store/sql/cursor.js +49 -0
  173. package/dist/store/sql/maintenance.d.ts +9 -0
  174. package/dist/store/sql/maintenance.js +16 -0
  175. package/dist/store/sql/store.d.ts +22 -0
  176. package/dist/store/sql/store.js +340 -0
  177. package/dist/store/sql/tables.d.ts +34 -0
  178. package/dist/store/sql/tables.js +2 -0
  179. package/dist/store/sqlite/index.d.ts +36 -0
  180. package/dist/store/sqlite/index.js +29 -0
  181. package/dist/store/sqlite/schema.d.ts +49 -0
  182. package/dist/store/sqlite/schema.js +80 -0
  183. package/package.json +211 -14
  184. package/dist/react/features/model-picker/components/CredentialStatusBadge.d.ts +0 -7
  185. package/dist/react/features/model-picker/components/CredentialStatusBadge.js +0 -20
  186. package/dist/react/features/model-picker/components/ModelPicker.d.ts +0 -9
  187. package/dist/react/features/model-picker/components/ModelPicker.js +0 -34
  188. package/dist/react/features/model-picker/constants.d.ts +0 -6
  189. package/dist/react/features/model-picker/constants.js +0 -9
  190. package/dist/react/features/model-picker/dependencies.d.ts +0 -11
  191. package/dist/react/features/model-picker/dependencies.js +0 -10
  192. package/dist/react/features/model-picker/hooks/useModelPicker.hooks.d.ts +0 -27
  193. package/dist/react/features/model-picker/hooks/useModelPicker.hooks.js +0 -62
  194. package/dist/react/features/model-picker/index.d.ts +0 -32
  195. package/dist/react/features/model-picker/index.js +0 -29
  196. package/dist/react/features/model-picker/ports.d.ts +0 -11
  197. package/dist/react/features/model-picker/rules.d.ts +0 -26
  198. package/dist/react/features/model-picker/rules.js +0 -84
  199. package/dist/react/features/model-picker/types.d.ts +0 -38
  200. package/dist/react/features/model-picker/types.js +0 -2
  201. package/dist/react/poc-mcp-ui-official/PocMcpUiCard.d.ts +0 -9
  202. package/dist/react/poc-mcp-ui-official/PocMcpUiCard.js +0 -29
  203. package/dist/react/poc-mcp-ui-official/create-poc-resource.d.ts +0 -30
  204. package/dist/react/poc-mcp-ui-official/create-poc-resource.js +0 -44
  205. /package/dist/{react/features/model-picker → server/run-finalizer}/ports.js +0 -0
@@ -1,32 +0,0 @@
1
- /**
2
- * @module features/model-picker
3
- *
4
- * Public barrel — the only entry point other code (inside or outside this
5
- * package) should import from; internal files are reached only through
6
- * this file. See `source-map.md` for provenance and `types.ts`'s header for
7
- * the `@jini-ai/protocol`-only dependency boundary.
8
- *
9
- * Where this belongs (2026-08-03 `@jini-ai/chat` consolidation): `ADS-memory/reports/jini-port/recon/
10
- * r4b-webui-design.md` §1 line 41 explicitly lists "model/agent picker" among the widgets that
11
- * belong behind a host-injected slot, not inside chat-react proper — picking which LLM/agent to
12
- * run is a provider concern, not a chat-domain one. This module doesn't import anything from
13
- * chat's own domain (only this package's local `Icon`/`hooks/context` utilities), so the design
14
- * doc's instinct holds up on inspection. It moves here unchanged anyway: it has exactly one real
15
- * consumer today (this package's own barrel, plus two tests), and this workspace's precedent
16
- * (see `packages/desktop-host/source-map.md`) is to defer generalizing/slotting until a second
17
- * consumer actually exists, rather than build a slot interface nobody has asked for yet. If a
18
- * second consumer shows up, extracting this into a real host-injected slot is the intended end
19
- * state — not a rewrite, a move.
20
- */
21
- export * from './types.js';
22
- export * from './constants.js';
23
- export * from './rules.js';
24
- export * from './ports.js';
25
- export { defaultModelPickerPort } from './dependencies.js';
26
- export { useModelPicker } from './hooks/useModelPicker.hooks.js';
27
- export type { UseModelPickerOptions, ModelPickerController } from './hooks/useModelPicker.hooks.js';
28
- export { ModelPicker } from './components/ModelPicker.js';
29
- export type { ModelPickerProps } from './components/ModelPicker.js';
30
- export { CredentialStatusBadge } from './components/CredentialStatusBadge.js';
31
- export type { CredentialStatusBadgeProps } from './components/CredentialStatusBadge.js';
32
- //# sourceMappingURL=index.d.ts.map
@@ -1,29 +0,0 @@
1
- /**
2
- * @module features/model-picker
3
- *
4
- * Public barrel — the only entry point other code (inside or outside this
5
- * package) should import from; internal files are reached only through
6
- * this file. See `source-map.md` for provenance and `types.ts`'s header for
7
- * the `@jini-ai/protocol`-only dependency boundary.
8
- *
9
- * Where this belongs (2026-08-03 `@jini-ai/chat` consolidation): `ADS-memory/reports/jini-port/recon/
10
- * r4b-webui-design.md` §1 line 41 explicitly lists "model/agent picker" among the widgets that
11
- * belong behind a host-injected slot, not inside chat-react proper — picking which LLM/agent to
12
- * run is a provider concern, not a chat-domain one. This module doesn't import anything from
13
- * chat's own domain (only this package's local `Icon`/`hooks/context` utilities), so the design
14
- * doc's instinct holds up on inspection. It moves here unchanged anyway: it has exactly one real
15
- * consumer today (this package's own barrel, plus two tests), and this workspace's precedent
16
- * (see `packages/desktop-host/source-map.md`) is to defer generalizing/slotting until a second
17
- * consumer actually exists, rather than build a slot interface nobody has asked for yet. If a
18
- * second consumer shows up, extracting this into a real host-injected slot is the intended end
19
- * state — not a rewrite, a move.
20
- */
21
- export * from './types.js';
22
- export * from './constants.js';
23
- export * from './rules.js';
24
- export * from './ports.js';
25
- export { defaultModelPickerPort } from './dependencies.js';
26
- export { useModelPicker } from './hooks/useModelPicker.hooks.js';
27
- export { ModelPicker } from './components/ModelPicker.js';
28
- export { CredentialStatusBadge } from './components/CredentialStatusBadge.js';
29
- //# sourceMappingURL=index.js.map
@@ -1,11 +0,0 @@
1
- import type { FetchProviderModelsInput, FetchProviderModelsResult } from './types.js';
2
- /**
3
- * The DI seam for anything transport-shaped this feature needs. Optional —
4
- * a host that only ever supplies a static model list needs no port at all;
5
- * `fetchProviderModels` exists for hosts that want to warm a live catalogue
6
- * (mirrors OD's `fetchProviderModels`/`providerModelsCache` pair).
7
- */
8
- export interface ModelPickerPort {
9
- fetchProviderModels?(input: FetchProviderModelsInput): Promise<FetchProviderModelsResult>;
10
- }
11
- //# sourceMappingURL=ports.d.ts.map
@@ -1,26 +0,0 @@
1
- import type { CredentialStatus, ModelOption, ModelPickerGroup, ModelPickerSelection, ModelProvider } from './types.js';
2
- /**
3
- * Groups models by `providerId`, attaching each group's resolved credential
4
- * status and sorting configured providers first (stable — ties keep model
5
- * order). A model whose `providerId` has no matching entry in `providers`
6
- * gets a synthesized provider (`{ id, label: id }`) rather than being
7
- * dropped, so an unrecognized provider id still renders instead of silently
8
- * disappearing.
9
- */
10
- export declare function groupModelsByProvider(models: readonly ModelOption[], providers: readonly ModelProvider[], statusByProviderId: Readonly<Record<string, CredentialStatus>>): ModelPickerGroup[];
11
- export declare function matchesModelQuery(model: ModelOption, provider: ModelProvider, normalizedQuery: string): boolean;
12
- /** Filters each group's models by `query`; drops groups left with zero matches. Returns a shallow copy of every group when `query` is blank. */
13
- export declare function filterModelGroups(groups: readonly ModelPickerGroup[], query: string): ModelPickerGroup[];
14
- /** Finds which group (and therefore provider) `modelId` belongs to, or `null` if it isn't in any group. */
15
- export declare function findSelectedModel(groups: readonly ModelPickerGroup[], modelId: string | null | undefined): ModelPickerSelection | null;
16
- /** True when `modelId` is set but not present in any group — a free-text/custom value. */
17
- export declare function isCustomModelId(modelId: string | null | undefined, groups: readonly ModelPickerGroup[]): boolean;
18
- /** The first model in the first (highest-priority) group, or `null` if every group is empty. */
19
- export declare function firstAvailableModelId(groups: readonly ModelPickerGroup[]): string | null;
20
- /**
21
- * A one-line subtitle for the selected model: its hint, prefixed with the
22
- * provider label unless the hint already opens with it (avoids
23
- * "OpenAI · OpenAI · 4K, native multimodal"-style duplication).
24
- */
25
- export declare function modelSubtitle(selection: ModelPickerSelection): string;
26
- //# sourceMappingURL=rules.d.ts.map
@@ -1,84 +0,0 @@
1
- /**
2
- * @module rules
3
- *
4
- * Pure logic for the model-picker feature: grouping models by provider,
5
- * searching/filtering, and resolving the current selection. No React, no
6
- * transport, no DOM — ported and generified from OD's
7
- * `NewProjectPanel.tsx`'s `MediaModelCards` (provider grouping + search) and
8
- * `modelOptions.tsx`'s `matchesModelSearch`/`isCustomModel` (search matching
9
- * + custom-value detection). See `source-map.md`.
10
- */
11
- import { CREDENTIAL_STATUS_SORT_PRIORITY } from './constants.js';
12
- /**
13
- * Groups models by `providerId`, attaching each group's resolved credential
14
- * status and sorting configured providers first (stable — ties keep model
15
- * order). A model whose `providerId` has no matching entry in `providers`
16
- * gets a synthesized provider (`{ id, label: id }`) rather than being
17
- * dropped, so an unrecognized provider id still renders instead of silently
18
- * disappearing.
19
- */
20
- export function groupModelsByProvider(models, providers, statusByProviderId) {
21
- const providerById = new Map(providers.map((provider) => [provider.id, provider]));
22
- const groupsByProviderId = new Map();
23
- for (const model of models) {
24
- let group = groupsByProviderId.get(model.providerId);
25
- if (!group) {
26
- const provider = providerById.get(model.providerId) ?? { id: model.providerId, label: model.providerId };
27
- const status = statusByProviderId[model.providerId] ?? 'unconfigured';
28
- group = { provider, status, models: [] };
29
- groupsByProviderId.set(model.providerId, group);
30
- }
31
- group.models.push(model);
32
- }
33
- return Array.from(groupsByProviderId.values()).sort((a, b) => CREDENTIAL_STATUS_SORT_PRIORITY[a.status] - CREDENTIAL_STATUS_SORT_PRIORITY[b.status]);
34
- }
35
- export function matchesModelQuery(model, provider, normalizedQuery) {
36
- const haystack = `${model.id}\n${model.label}\n${model.hint ?? ''}\n${provider.label}`.toLowerCase();
37
- return haystack.includes(normalizedQuery);
38
- }
39
- /** Filters each group's models by `query`; drops groups left with zero matches. Returns a shallow copy of every group when `query` is blank. */
40
- export function filterModelGroups(groups, query) {
41
- const normalized = query.trim().toLowerCase();
42
- if (!normalized)
43
- return groups.map((group) => ({ ...group, models: group.models.slice() }));
44
- return groups
45
- .map((group) => ({
46
- ...group,
47
- models: group.models.filter((model) => matchesModelQuery(model, group.provider, normalized)),
48
- }))
49
- .filter((group) => group.models.length > 0);
50
- }
51
- /** Finds which group (and therefore provider) `modelId` belongs to, or `null` if it isn't in any group. */
52
- export function findSelectedModel(groups, modelId) {
53
- if (!modelId)
54
- return null;
55
- for (const group of groups) {
56
- const model = group.models.find((m) => m.id === modelId);
57
- if (model)
58
- return { model, group };
59
- }
60
- return null;
61
- }
62
- /** True when `modelId` is set but not present in any group — a free-text/custom value. */
63
- export function isCustomModelId(modelId, groups) {
64
- if (!modelId)
65
- return false;
66
- return findSelectedModel(groups, modelId) === null;
67
- }
68
- /** The first model in the first (highest-priority) group, or `null` if every group is empty. */
69
- export function firstAvailableModelId(groups) {
70
- return groups[0]?.models[0]?.id ?? null;
71
- }
72
- /**
73
- * A one-line subtitle for the selected model: its hint, prefixed with the
74
- * provider label unless the hint already opens with it (avoids
75
- * "OpenAI · OpenAI · 4K, native multimodal"-style duplication).
76
- */
77
- export function modelSubtitle(selection) {
78
- const hint = selection.model.hint ?? '';
79
- const providerLabel = selection.group.provider.label;
80
- if (!hint)
81
- return providerLabel;
82
- return hint.toLowerCase().startsWith(providerLabel.toLowerCase()) ? hint : `${providerLabel} · ${hint}`;
83
- }
84
- //# sourceMappingURL=rules.js.map
@@ -1,38 +0,0 @@
1
- /**
2
- * @module types
3
- *
4
- * `features/model-picker/` is an independent feature slice: it depends only
5
- * on `@jini-ai/protocol`'s agent-catalog vocabulary for what a model/agent/
6
- * provider actually is — never on this package's own conversation/message
7
- * state (`useConversation`/`useRunStream`/`transport.ts`) — so any consumer
8
- * of `@jini-ai/chat-react` can use it without pulling in a full chat UI. See
9
- * `source-map.md` for the extraction this ports (OD's `InlineModelSwitcher.tsx`
10
- * + siblings and `NewProjectPanel.tsx`'s `MediaModelCards`).
11
- *
12
- * Files with no React import (this one included) stay at the feature's top
13
- * level; `hooks/`/`components/` move under `react/` — the layout policy in
14
- * `ADS-memory/reports/jini-port/god-components-extraction-plan.md`.
15
- */
16
- import type { AgentDefinition, AgentDiagnostic, CredentialStatus, ModelCatalogOption as ModelOption, ModelProvider } from '@jini-ai/protocol';
17
- export type { AgentDefinition, AgentDiagnostic, CredentialStatus, ModelOption, ModelProvider };
18
- /** One provider's models, grouped together with that provider's resolved credential status. */
19
- export interface ModelPickerGroup {
20
- provider: ModelProvider;
21
- status: CredentialStatus;
22
- models: ModelOption[];
23
- }
24
- /** The currently-selected model plus the group (and therefore provider) it belongs to. */
25
- export interface ModelPickerSelection {
26
- model: ModelOption;
27
- group: ModelPickerGroup;
28
- }
29
- export interface FetchProviderModelsInput {
30
- providerId: string;
31
- baseUrl?: string;
32
- credential?: string;
33
- }
34
- export interface FetchProviderModelsResult {
35
- ok: boolean;
36
- models: ModelOption[];
37
- }
38
- //# sourceMappingURL=types.d.ts.map
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=types.js.map
@@ -1,9 +0,0 @@
1
- export interface PocMcpUiCardProps {
2
- /** Pre-fetched HTML — normally the `resource.text` from `createPocUiResource()`. */
3
- html: string;
4
- /** Where the (not-stood-up, for this POC) sandbox proxy page would live. */
5
- sandboxUrl: URL;
6
- }
7
- /** Renders one static MCP-UI card through the real `@mcp-ui/client` `AppRenderer`. */
8
- export declare function PocMcpUiCard({ html, sandboxUrl }: PocMcpUiCardProps): import("react").JSX.Element;
9
- //# sourceMappingURL=PocMcpUiCard.d.ts.map
@@ -1,29 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- /**
3
- * @module poc-mcp-ui-official/PocMcpUiCard
4
- *
5
- * PROOF OF CONCEPT — see `create-poc-resource.ts`'s module doc for full context. Not wired into
6
- * this package's public API, not a replacement for `McpUiSurfaceCard.tsx`.
7
- *
8
- * Wraps `@mcp-ui/client`'s real `AppRenderer` component (the current name for what older versions
9
- * of `@mcp-ui/client` called `UIResourceRenderer` — renamed around its v6.0.0 rebrand onto the
10
- * `@modelcontextprotocol/ext-apps` "MCP Apps" spec). `AppRenderer` is given pre-fetched `html`
11
- * directly (skipping MCP resource-fetching, since this POC has no live MCP server behind it) and no
12
- * `client`, which is an explicitly supported mode per its own prop doc ("Omit to disable automatic
13
- * MCP forwarding and use custom handlers instead" — this POC supplies neither, since the one static
14
- * card it renders never calls a tool back).
15
- *
16
- * `AppRenderer` builds its own `AppBridge` internally and, on mount, creates a real sandboxed
17
- * `<iframe>` pointed at `sandbox.url`, then waits for that iframe to `postMessage` back a
18
- * `ui/notifications/sandbox-proxy-ready` notification before it will hand the HTML over. That
19
- * handshake needs a REAL sandbox-proxy page served at `sandbox.url` — this POC does not stand one
20
- * up (out of scope for validating the package's own API surface), so the test that renders this
21
- * component asserts on the real, unmocked iframe `AppRenderer` creates (src, sandbox attribute,
22
- * default sizing) rather than waiting for a live handshake that would just time out under jsdom.
23
- */
24
- import { AppRenderer } from '@mcp-ui/client';
25
- /** Renders one static MCP-UI card through the real `@mcp-ui/client` `AppRenderer`. */
26
- export function PocMcpUiCard({ html, sandboxUrl }) {
27
- return (_jsx(AppRenderer, { toolName: "poc-mcp-ui-official-card", sandbox: { url: sandboxUrl }, html: html }));
28
- }
29
- //# sourceMappingURL=PocMcpUiCard.js.map
@@ -1,30 +0,0 @@
1
- /**
2
- * @module poc-mcp-ui-official/create-poc-resource
3
- *
4
- * PROOF OF CONCEPT — NOT wired into the package's public API (not re-exported from
5
- * `src/react/index.ts`), and NOT a replacement for the hand-rolled MCP-UI stack
6
- * (`McpUiSurfaceCard.tsx`, `useMcpUiHost`, `create-mcp-ui-tool-caller.ts`), which this file does
7
- * not touch.
8
- *
9
- * Validates that the REAL, official `@mcp-ui/server` package (not this repo's own reimplementation
10
- * of the MCP-UI resource shape) can build a `UIResource` end to end, per the owner's decision to
11
- * evaluate replacing the hand-rolled client with the upstream package. See
12
- * `poc-mcp-ui-official/__tests__/poc-mcp-ui-official.test.tsx` for the assertions this module
13
- * exists to feed, and `ADS-memory/` (the consuming product's own copy) / this session's final report for the CJS/ESM
14
- * interop finding that shaped how this is imported (ESM only — `@mcp-ui/client`'s CJS build is
15
- * broken in 7.1.1; `require('@mcp-ui/client')` throws / returns an empty object depending on Node
16
- * version. `@mcp-ui/server`'s CJS build works fine in this same version, but this module still
17
- * uses the ESM entry point for consistency with the client half of this POC).
18
- */
19
- import { type UIResource } from '@mcp-ui/server';
20
- /** The one concrete example this POC builds: a simple static HTML card. */
21
- export declare const POC_CARD_URI = "ui://jini-poc/mcp-ui-official-card";
22
- export declare const POC_CARD_HTML: string;
23
- /**
24
- * Builds the one UIResource this POC round-trips: server creates it, the test then feeds its
25
- * `resource.text` straight to the client's `AppRenderer` as pre-fetched `html` (see the test —
26
- * `AppRenderer`'s `html` prop skips MCP resource-fetching entirely, which is the right shape for a
27
- * standalone POC with no live MCP server behind it).
28
- */
29
- export declare function createPocUiResource(): UIResource;
30
- //# sourceMappingURL=create-poc-resource.d.ts.map
@@ -1,44 +0,0 @@
1
- /**
2
- * @module poc-mcp-ui-official/create-poc-resource
3
- *
4
- * PROOF OF CONCEPT — NOT wired into the package's public API (not re-exported from
5
- * `src/react/index.ts`), and NOT a replacement for the hand-rolled MCP-UI stack
6
- * (`McpUiSurfaceCard.tsx`, `useMcpUiHost`, `create-mcp-ui-tool-caller.ts`), which this file does
7
- * not touch.
8
- *
9
- * Validates that the REAL, official `@mcp-ui/server` package (not this repo's own reimplementation
10
- * of the MCP-UI resource shape) can build a `UIResource` end to end, per the owner's decision to
11
- * evaluate replacing the hand-rolled client with the upstream package. See
12
- * `poc-mcp-ui-official/__tests__/poc-mcp-ui-official.test.tsx` for the assertions this module
13
- * exists to feed, and `ADS-memory/` (the consuming product's own copy) / this session's final report for the CJS/ESM
14
- * interop finding that shaped how this is imported (ESM only — `@mcp-ui/client`'s CJS build is
15
- * broken in 7.1.1; `require('@mcp-ui/client')` throws / returns an empty object depending on Node
16
- * version. `@mcp-ui/server`'s CJS build works fine in this same version, but this module still
17
- * uses the ESM entry point for consistency with the client half of this POC).
18
- */
19
- import { createUIResource } from '@mcp-ui/server';
20
- /** The one concrete example this POC builds: a simple static HTML card. */
21
- export const POC_CARD_URI = 'ui://jini-poc/mcp-ui-official-card';
22
- export const POC_CARD_HTML = [
23
- '<!doctype html>',
24
- '<html>',
25
- ' <body style="font-family: sans-serif; margin: 0; padding: 16px;">',
26
- ' <h1 data-testid="poc-card-heading">Hello from @mcp-ui/server</h1>',
27
- ' <p>This card was built by the REAL, official createUIResource(), not the hand-rolled one.</p>',
28
- ' </body>',
29
- '</html>',
30
- ].join('\n');
31
- /**
32
- * Builds the one UIResource this POC round-trips: server creates it, the test then feeds its
33
- * `resource.text` straight to the client's `AppRenderer` as pre-fetched `html` (see the test —
34
- * `AppRenderer`'s `html` prop skips MCP resource-fetching entirely, which is the right shape for a
35
- * standalone POC with no live MCP server behind it).
36
- */
37
- export function createPocUiResource() {
38
- return createUIResource({
39
- uri: POC_CARD_URI,
40
- content: { type: 'rawHtml', htmlString: POC_CARD_HTML },
41
- encoding: 'text',
42
- });
43
- }
44
- //# sourceMappingURL=create-poc-resource.js.map