@jini-ai/chat 0.6.23 → 0.7.0

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 (40) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/README.md +8 -0
  3. package/dist/core/accepted-input.d.ts +1 -1
  4. package/dist/core/accepted-input.js +5 -4
  5. package/dist/core/durable-projection.js +8 -1
  6. package/dist/core/question-answer.js +2 -1
  7. package/dist/core/turn-usage.d.ts +1 -1
  8. package/dist/core/turn-usage.js +4 -5
  9. package/dist/react/components/AttachmentTray.d.ts +4 -1
  10. package/dist/react/components/AttachmentTray.js +20 -5
  11. package/dist/react/components/Composer.d.ts +3 -1
  12. package/dist/react/components/Composer.js +16 -14
  13. package/dist/react/components/ComposerDiscovery.d.ts +2 -0
  14. package/dist/react/components/ComposerDiscovery.js +4 -3
  15. package/dist/react/components/ConversationList.d.ts +4 -2
  16. package/dist/react/components/ConversationList.js +16 -7
  17. package/dist/react/components/CopyMessageButton.d.ts +3 -1
  18. package/dist/react/components/CopyMessageButton.js +3 -2
  19. package/dist/react/components/FolderChips.d.ts +3 -1
  20. package/dist/react/components/FolderChips.js +8 -5
  21. package/dist/react/components/MessageList.js +1 -1
  22. package/dist/react/components/MessageRow.js +1 -1
  23. package/dist/react/components/ToolCard.js +7 -7
  24. package/dist/react/components/ToolCard.rules.d.ts +5 -0
  25. package/dist/react/components/ToolCard.rules.js +9 -2
  26. package/dist/react/components/mcp-ui-surface-state.js +11 -0
  27. package/dist/react/features/chat-pane/components/AgentRuntimePicker.d.ts +1 -1
  28. package/dist/react/features/chat-pane/components/AgentRuntimePicker.js +38 -27
  29. package/dist/react/features/chat-pane/components/ChatPane.js +19 -8
  30. package/dist/react/features/chat-pane/components/RuntimeDropUp.d.ts +2 -1
  31. package/dist/react/features/chat-pane/components/RuntimeDropUp.js +11 -6
  32. package/dist/react/features/chat-pane/hooks/useChatPane.hooks.js +8 -0
  33. package/dist/react/features/chat-pane/rules.d.ts +22 -1
  34. package/dist/react/features/chat-pane/rules.js +36 -10
  35. package/dist/react/features/chat-pane/styles.d.ts +1 -1
  36. package/dist/react/features/chat-pane/styles.js +32 -39
  37. package/dist/react/features/chat-pane/types.d.ts +10 -0
  38. package/dist/react/index.d.ts +1 -0
  39. package/dist/react/styles/chat-settings.css +149 -0
  40. package/package.json +21 -18
@@ -12,6 +12,8 @@ export interface ChatPaneAgentOption {
12
12
  label: string;
13
13
  identityKind?: 'concrete' | 'alias' | 'routing-mode';
14
14
  resolvedId?: string;
15
+ /** Model-specific levels; absent inherits the runtime vocabulary, empty narrows it to Default. */
16
+ reasoning?: readonly ChatPaneAgentOption[];
15
17
  }
16
18
  /**
17
19
  * Browser-safe runtime inventory consumed by the chat pane. This is
@@ -48,6 +50,10 @@ export interface ChatPaneAgent {
48
50
  reason: string;
49
51
  };
50
52
  reasoningOptions?: readonly ChatPaneAgentOption[];
53
+ /** Effort lives in model IDs for these runtimes, so no independent control is offered. */
54
+ reasoningInModelId?: {
55
+ levels: readonly ChatPaneAgentOption[];
56
+ };
51
57
  supportsCustomModel?: boolean;
52
58
  supportsConcreteModelSelection?: boolean;
53
59
  diagnostic?: string;
@@ -203,6 +209,8 @@ export type DeliverMidRunMessage = (input: {
203
209
  attachments?: readonly ChatAttachment[];
204
210
  }) => Promise<MidRunMessageDelivery>;
205
211
  export interface ChatPaneProps extends UserTextRedactionOptions {
212
+ /** Automation base for the package-owned composer and runtime picker; false opts out. */
213
+ agentHandle?: string | false | undefined;
206
214
  transport: ChatTransport;
207
215
  /** Host-localized text shown verbatim while the active run is awaiting acceptance.
208
216
  * Omit to use the translated `Sending…` label; ignored once sending ends. */
@@ -417,6 +425,8 @@ export interface ByokRuntimeSummary {
417
425
  }[];
418
426
  }
419
427
  export interface AgentRuntimePickerProps {
428
+ /** Stable automation base; generated by default, false opts out at every leaf. */
429
+ agentHandle?: string | false | undefined;
420
430
  agents: readonly ChatPaneAgent[];
421
431
  nativeToolPolicy?: NativeToolPolicyInput;
422
432
  value: ChatPaneAgentSelection;
@@ -177,4 +177,5 @@ export type { AcceptedChatInput } from '../core/accepted-input.js';
177
177
  export { isAwaitingAnswer } from '../core/run-activity.js';
178
178
  export { createFrontendRequestCaller } from './features/chat-pane/create-frontend-request-caller.js';
179
179
  export type { FrontendRequestCallerRequired, FrontendRequestInput } from './features/chat-pane/create-frontend-request-caller.js';
180
+ export type { SurfaceRecoveryInfo } from '../core/surface-recovery.js';
180
181
  //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,149 @@
1
+ /** Optional presentation for ChatSettingsDialog and ChatSettingsSegmented.
2
+ * Import @jini-ai/chat/react/styles/chat-settings.css; hosts may bind the
3
+ * --jini-chat-settings-* tokens to their theme. All tokens have standalone defaults.
4
+ */
5
+ /* Chat settings (Jini `ChatSettingsDialog`, restyled 2026-10-17 after owner called it "awful"):
6
+ fixed header + tabs, only the panel body scrolls. Each option is one row: switch, then label with
7
+ a one-line muted description (owner 2026-10-17: ⓘ tooltips floated too far from their icon, so
8
+ no tooltips here). Full CLI access is the card header; the capabilities it switches all at once
9
+ sit in the card body beneath it. */
10
+ .jini-chat-settings-dialog {
11
+ box-sizing: border-box;
12
+ width: 36rem;
13
+ max-width: calc(100vw - 2rem);
14
+ /* Top-anchored, not centred: switching tabs changes the height, and a centred dialog would
15
+ move its header and tabs under the pointer each time. */
16
+ max-height: min(42rem, calc(100dvh - clamp(1rem, 10vh, 5rem) - 1rem));
17
+ margin: clamp(1rem, 10vh, 5rem) auto auto;
18
+ padding: 0;
19
+ overflow: hidden;
20
+ border: var(--jini-border-width, 1px) solid var(--jini-chat-settings-border, #d9dce2);
21
+ border-radius: var(--radius-lg, 12px);
22
+ background: var(--jini-chat-settings-bg, #fff);
23
+ color: var(--jini-chat-settings-fg, #1a1916);
24
+ font: inherit;
25
+ box-shadow: var(--jini-overlay-shadow, 0 12px 36px #0003);
26
+ background-image: var(--jini-panel-texture, none);
27
+ }
28
+ .jini-chat-settings-dialog[open] { display: flex; flex-direction: column; }
29
+ .jini-chat-settings-dialog::backdrop { background: var(--jini-chat-settings-overlay-bg, #0006);
30
+ backdrop-filter: var(--jini-chat-settings-backdrop-filter, none);
31
+ }
32
+ .jini-chat-settings-header {
33
+ flex: none; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
34
+ padding: 0.875rem 0.875rem 0 1.5rem;
35
+ }
36
+ .jini-chat-settings-header .jini-dialog-title { margin: 0; font-size: 1.125rem; font-weight: 700; line-height: 1.3; }
37
+ .jini-chat-settings-dialog .jini-chat-settings-close {
38
+ display: inline-flex; align-items: center; justify-content: center; flex: none;
39
+ width: 2.25rem; height: 2.25rem; min-width: 0; min-height: 0; padding: 0;
40
+ border: 0; border-radius: var(--radius, 8px); background: transparent; color: var(--jini-chat-settings-muted, #676767);
41
+ font-size: 1.5rem; line-height: 1; cursor: pointer;
42
+ }
43
+ .jini-chat-settings-dialog .jini-chat-settings-close:hover { background: var(--jini-chat-settings-subtle, #f4f5f7); color: var(--jini-chat-settings-fg, #1a1916); }
44
+ .jini-chat-settings-dialog .jini-chat-settings-close:focus-visible { outline: 2px solid var(--jini-chat-settings-accent, #3b66c4); outline-offset: 2px; }
45
+ .jini-chat-settings-dialog > .tab-bar { display: flex; border-bottom: 1px solid var(--jini-chat-settings-border, #d9dce2); flex: none; flex-wrap: nowrap; margin: 0.25rem 0 0; padding: 0 1.5rem; gap: 0.5rem; }
46
+ .jini-chat-settings-dialog > .tab-bar .tab-bar-item {
47
+ display: inline-flex; align-items: center; flex-shrink: 0; background: none;
48
+ border: 0; border-bottom: 2px solid transparent; border-radius: 0; padding: 0.65rem 0.25rem;
49
+ margin-bottom: -1px; font: inherit; font-size: var(--text-sm, 0.875rem); font-weight: 600;
50
+ color: var(--jini-chat-settings-muted, #676767); cursor: pointer; transition: color 140ms, border-color 140ms;
51
+ }
52
+ .jini-chat-settings-dialog > .tab-bar .tab-bar-item:hover { color: var(--jini-chat-settings-fg, #1a1916); }
53
+ .jini-chat-settings-dialog > .tab-bar .tab-bar-item[aria-selected="true"] {
54
+ color: var(--jini-chat-settings-selected-text, var(--jini-chat-settings-accent, #3b66c4));
55
+ border-bottom-color: var(--jini-chat-settings-selected-ring, var(--jini-chat-settings-accent, #3b66c4));
56
+ }
57
+ .jini-chat-settings-dialog .tab-bar-item:focus-visible { outline: 2px solid var(--jini-chat-settings-accent, #3b66c4); outline-offset: -2px; border-radius: 4px 4px 0 0; }
58
+ .jini-chat-settings-body {
59
+ flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
60
+ padding: 1.25rem 1.5rem 1.5rem; overflow-wrap: anywhere;
61
+ }
62
+ .jini-chat-settings-group { display: flex; flex-direction: column; min-width: 0; margin: 0; padding: 0; border: 0; }
63
+ .jini-chat-settings-group + .jini-chat-settings-group { margin-top: 1.25rem; }
64
+ .jini-chat-settings-legend { padding: 0; margin-bottom: 0.5rem; font-size: var(--text-sm, 0.875rem); font-weight: 600; color: var(--jini-chat-settings-fg, #1a1916); }
65
+ /* Tool calls: the shared segmented-control look, built on real radios for keyboard and AT. */
66
+ .jini-chat-settings-segmented {
67
+ display: inline-flex; flex-wrap: wrap; align-self: flex-start; max-width: 100%; gap: 0.25rem; padding: 0.2rem;
68
+ border: 1px solid var(--jini-chat-settings-border, #d9dce2); border-radius: 8px; background: var(--jini-chat-settings-subtle, #f4f5f7);
69
+ }
70
+ .jini-chat-settings-legend > .info-tip { margin-left: 0.3rem; }
71
+ .jini-chat-settings-segment {
72
+ position: relative; display: inline-flex; align-items: center; padding: 0.4rem 0.95rem;
73
+ border-radius: 6px; font-size: var(--text-sm, 0.875rem); color: var(--jini-chat-settings-muted, #676767); cursor: pointer;
74
+ }
75
+ .jini-chat-settings-segment input {
76
+ position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer;
77
+ }
78
+ .jini-chat-settings-segment:hover { color: var(--jini-chat-settings-fg, #1a1916); }
79
+ /* The same pill also supports a host tablist:
80
+ tab buttons, so the global filled `button` look comes off and `[aria-selected]` stands in for a
81
+ checked radio below. */
82
+ button.jini-chat-settings-segment {
83
+ border: 0; background: transparent; font-family: inherit; font-weight: inherit; letter-spacing: normal;
84
+ line-height: inherit; transition: none;
85
+ }
86
+ button.jini-chat-settings-segment:hover { opacity: 1; }
87
+ .jini-chat-settings-segment:has(input:checked), .jini-chat-settings-segment[aria-selected="true"] { background: var(--jini-chat-settings-selected-bg, #fff); color: var(--jini-chat-settings-fg, #1a1916); font-weight: 600; box-shadow: var(--jini-chat-settings-selected-shadow, 0 1px 3px #0002); }
88
+ .jini-chat-settings-segment:has(input:focus-visible), .jini-chat-settings-segment[role="tab"]:focus-visible { outline: 2px solid var(--jini-chat-settings-accent, #3b66c4); outline-offset: 1px; }
89
+ .jini-chat-settings-segment:has(input:disabled) { opacity: 0.5; cursor: not-allowed; }
90
+ /* Switch, then label with its one-line description; the switch centres on the label line. */
91
+ .jini-chat-settings-row { display: flex; align-items: flex-start; gap: 0.75rem; padding-block: 0.5rem; }
92
+ .jini-chat-settings-row > input[role="switch"] { margin-top: 0.0625rem; }
93
+ .jini-chat-settings-text { display: flex; flex-direction: column; gap: 0.125rem; min-width: 0; }
94
+ /* A switch's ⓘ follows its label's text, like the legend's (owner, 2026-10-21), outside the label so a tap never toggles. */
95
+ .jini-chat-settings-label-row { display: flex; align-items: center; gap: 0.3rem; }
96
+ .jini-chat-settings-label-row > .info-tip { flex: none; }
97
+ .jini-chat-settings-label { font-size: 0.9375rem; line-height: 1.4; cursor: pointer; }
98
+ .jini-chat-settings-description { margin: 0; font-size: 0.8125rem; line-height: 1.35; color: var(--jini-text-muted, var(--jini-chat-settings-muted, #676767)); }
99
+ .jini-chat-settings-description--group { margin: -0.25rem 0 0.625rem; }
100
+ .jini-chat-settings-row:has(input:disabled) .jini-chat-settings-label { color: var(--jini-chat-settings-muted, #676767); cursor: not-allowed; }
101
+ /* Same track-and-knob geometry as the shared permission controls. */
102
+ .jini-chat-settings-dialog input[type="checkbox"][role="switch"] {
103
+ appearance: none; -webkit-appearance: none; position: relative; flex: none;
104
+ width: 38px; height: 22px; margin: 0; border-radius: 999px; cursor: pointer;
105
+ border: 1px solid var(--jini-border-strong, var(--jini-chat-settings-border, #d9dce2));
106
+ background: var(--jini-border-strong, var(--jini-chat-settings-border, #d9dce2)); transition: background-color 120ms ease;
107
+ }
108
+ .jini-chat-settings-dialog input[type="checkbox"][role="switch"]::after {
109
+ content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%;
110
+ background: var(--jini-control-thumb-bg, #fff); box-shadow: var(--jini-control-thumb-shadow, 0 1px 2px #0003); transition: transform 120ms ease;
111
+ }
112
+ .jini-chat-settings-dialog input[type="checkbox"][role="switch"]:checked { background: var(--jini-chat-settings-accent, #3b66c4); border-color: var(--jini-chat-settings-accent, #3b66c4); }
113
+ .jini-chat-settings-dialog input[type="checkbox"][role="switch"]:checked::after { transform: translateX(16px); }
114
+ .jini-chat-settings-dialog input[type="checkbox"][role="switch"]:focus-visible { outline: 2px solid var(--jini-chat-settings-accent, #3b66c4); outline-offset: 2px; }
115
+ .jini-chat-settings-dialog input[type="checkbox"][role="switch"]:disabled { opacity: 0.5; cursor: not-allowed; }
116
+ @media (prefers-reduced-motion: reduce) {
117
+ .jini-chat-settings-dialog input[role="switch"], .jini-chat-settings-dialog input[role="switch"]::after { transition: none; }
118
+ }
119
+ .jini-chat-settings-note { margin: 0 0 1rem; font-size: var(--text-sm, 0.875rem); color: var(--jini-chat-settings-muted, #676767); line-height: 1.5; }
120
+ .jini-chat-settings-error { margin: 1rem 0 0; font-size: var(--text-sm, 0.875rem); color: var(--jini-chat-settings-danger, #b42318); }
121
+ .jini-chat-settings-row--master {
122
+ padding: 0.625rem 1rem; border: 1px solid var(--jini-chat-settings-border, #d9dce2); border-radius: var(--radius-lg, 12px) var(--radius-lg, 12px) 0 0;
123
+ background: var(--jini-chat-settings-subtle, #f4f5f7);
124
+ }
125
+ .jini-chat-settings-row--master .jini-chat-settings-label { font-weight: 600; }
126
+ .jini-chat-settings-capabilities {
127
+ padding: 0.375rem 1rem 0.5rem 1.75rem; border: 1px solid var(--jini-chat-settings-border, #d9dce2); border-top: 0;
128
+ border-radius: 0 0 var(--radius-lg, 12px) var(--radius-lg, 12px);
129
+ }
130
+ /* Help has its own touch target, outside every setting's button or label. The 44px target is an
131
+ invisible hit area (17.6px icon + 2 × 13px), not a wider icon: sizing the icon itself to 44px
132
+ added ~80px to the Tool calls pill and wrapped it onto two rows in a 390px dialog. The ≤640px
133
+ phone floor in styles.css (44px min on every [role="button"] in `.jini-dialog`) did the same,
134
+ so it is undone here and the hit area takes over at that width too. */
135
+ @media (pointer: coarse), (max-width: 640px) {
136
+ .jini-chat-settings-legend .info-tip-icon,
137
+ .jini-chat-settings-label-row > .info-tip .info-tip-icon { position: relative; }
138
+ .jini-chat-settings-legend .info-tip-icon::before,
139
+ .jini-chat-settings-label-row > .info-tip .info-tip-icon::before { content: ""; position: absolute; inset: -13px; }
140
+ .jini-dialog .jini-chat-settings-legend .info-tip-icon[role="button"],
141
+ .jini-dialog .jini-chat-settings-label-row > .info-tip .info-tip-icon[role="button"] { min-width: 0; min-height: 0; }
142
+ }
143
+ @media (max-width: 640px) {
144
+ .jini-chat-settings-dialog input[type="checkbox"][role="switch"] { width: 38px; height: 22px; }
145
+ .jini-chat-settings-body { padding-inline: 1rem; }
146
+ .jini-chat-settings-dialog > .tab-bar { padding-inline: 1rem; }
147
+ .jini-chat-settings-header { padding-left: 1rem; }
148
+ }
149
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jini-ai/chat",
3
- "version": "0.6.23",
3
+ "version": "0.7.0",
4
4
  "description": "Jini's chat/artifact frontend, consolidated into one package with two subpaths: framework-free chat vocabulary and pure parsers in `/core`, headless hooks + presentational components + slots in `/react`. Import only the layer you need.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -38,7 +38,8 @@
38
38
  "./vanilla": "browser",
39
39
  "./browser/lazy-loader": "browser",
40
40
  "./vanilla/style.css": "browser",
41
- "./browser/frontend-session-bridge": "browser"
41
+ "./browser/frontend-session-bridge": "browser",
42
+ "./react/styles/chat-settings.css": "browser"
42
43
  },
43
44
  "neutralEntries": [
44
45
  "src/store/contracts"
@@ -192,7 +193,8 @@
192
193
  "types": "./dist/embed-widget/browser/frontend-session-bridge.d.ts",
193
194
  "import": "./dist/embed-widget/browser/frontend-session-bridge.js",
194
195
  "default": "./dist/embed-widget/browser/frontend-session-bridge.js"
195
- }
196
+ },
197
+ "./react/styles/chat-settings.css": "./dist/react/styles/chat-settings.css"
196
198
  },
197
199
  "files": [
198
200
  "dist",
@@ -214,10 +216,10 @@
214
216
  },
215
217
  "dependencies": {
216
218
  "kysely": "^0.29.6",
217
- "@jini-ai/core": "^0.6.23",
218
- "@jini-ai/agentic": "^0.6.23",
219
- "@jini-ai/diagnostics": "^0.6.22",
220
- "@jini-ai/db": "^0.6.19"
219
+ "@jini-ai/diagnostics": "^0.7.0",
220
+ "@jini-ai/db": "^0.7.0",
221
+ "@jini-ai/agentic": "^0.7.0",
222
+ "@jini-ai/core": "^0.7.0"
221
223
  },
222
224
  "peerDependencies": {
223
225
  "react": "^18.3.0 || ^19.0.0",
@@ -232,9 +234,9 @@
232
234
  "@radix-ui/react-radio-group": "^1.4.7",
233
235
  "@radix-ui/react-select": "^2.3.7",
234
236
  "@radix-ui/react-slot": "^1.3.3",
235
- "@jini-ai/agent-runtime": "^0.6.10",
236
- "@jini-ai/protocol": "^0.6.10",
237
- "@jini-ai/ui": "^0.6.10"
237
+ "@jini-ai/agent-runtime": "^0.7.0",
238
+ "@jini-ai/protocol": "^0.7.0",
239
+ "@jini-ai/ui": "^0.7.0"
238
240
  },
239
241
  "devDependencies": {
240
242
  "@mcp-ui/client": "7.1.1",
@@ -261,13 +263,14 @@
261
263
  "pg": "8.23.0",
262
264
  "@ag-ui/core": "0.0.58",
263
265
  "fast-check": "4.3.0",
264
- "@jini-ai/agentic": "^0.6.23",
265
- "@jini-ai/agent-runtime": "0.6.23",
266
- "@jini-ai/ui": "^0.6.23",
267
- "@jini-ai/core": "^0.6.23",
268
- "@jini-ai/protocol": "^0.6.19",
269
- "@jini-ai/diagnostics": "^0.6.22",
270
- "@jini-ai/db": "0.6.19"
266
+ "@jini-ai/ui-kit": "^0.7.0",
267
+ "@jini-ai/db": "0.7.0",
268
+ "@jini-ai/agentic": "^0.7.0",
269
+ "@jini-ai/agent-runtime": "0.7.0",
270
+ "@jini-ai/core": "^0.7.0",
271
+ "@jini-ai/diagnostics": "^0.7.0",
272
+ "@jini-ai/protocol": "^0.7.0",
273
+ "@jini-ai/ui": "^0.7.0"
271
274
  },
272
275
  "typesVersions": {
273
276
  "*": {
@@ -384,7 +387,7 @@
384
387
  }
385
388
  },
386
389
  "scripts": {
387
- "build": "tsc -p tsconfig.json && mkdir -p dist/react/styles && cp src/react/styles/reference.css dist/react/styles/ && mkdir -p dist/embed-widget/vanilla && node --input-type=module -e \"import {writeFileSync,readFileSync} from 'node:fs'; import {CHAT_BUBBLE_STYLE} from './dist/embed-widget/browser/lazy-loader.js'; writeFileSync('dist/embed-widget/vanilla/style.css',CHAT_BUBBLE_STYLE+'\\n'+readFileSync('src/embed-widget/vanilla/style.css','utf8'));\"",
390
+ "build": "tsc -p tsconfig.json && mkdir -p dist/react/styles && cp src/react/styles/*.css dist/react/styles/ && mkdir -p dist/embed-widget/vanilla && node --input-type=module -e \"import {writeFileSync,readFileSync} from 'node:fs'; import {CHAT_BUBBLE_STYLE} from './dist/embed-widget/browser/lazy-loader.js'; writeFileSync('dist/embed-widget/vanilla/style.css',CHAT_BUBBLE_STYLE+'\\n'+readFileSync('src/embed-widget/vanilla/style.css','utf8'));\"",
388
391
  "typecheck": "tsc -p tsconfig.json --noEmit",
389
392
  "test": "vitest run",
390
393
  "test:coverage": "vitest run --coverage",