@adapttable/ai-react 0.1.0 → 0.2.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,52 @@
1
1
  # @adapttable/ai-react
2
2
 
3
+ ## 0.2.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [3cf4297]
8
+ - Updated dependencies [5e66063]
9
+ - Updated dependencies [06c3694]
10
+ - Updated dependencies [14ba2ea]
11
+ - Updated dependencies [037c2a5]
12
+ - Updated dependencies [1039051]
13
+ - @adapttable/core@3.2.0
14
+ - @adapttable/react@1.2.0
15
+ - @adapttable/ai@0.2.1
16
+
17
+ ## 0.2.0
18
+
19
+ ### Minor Changes
20
+
21
+ - 96110a1: `tableAgent` offers every row and bulk action the host composed as a governed agent capability — `rowAction.<key>` on one row, `bulkAction.<key>` on the current selection. The table's write policy and approval apply, an action's `ai.approval` overrides them, an action with a `confirm` block asks a person, and `ai: false` keeps an action away from the agent. `tableActionCapabilities` builds the same definitions for `createAgentSession`.
22
+ - 832d63d: A backend-mode voice clip can be the assistant's turn: `useSpeechInput({ onClip: assistant.sendClip })` sends it through the HTTP transport on the turn's first round, and the backend's `transcript` becomes the reader's message, with a localized "Voice message" placeholder until it arrives. `createAgentHttpClient().send` takes `audio` and `onTranscript`, and `AssistantTransport.send` receives `audio`.
23
+
24
+ ### Patch Changes
25
+
26
+ - Updated dependencies [96110a1]
27
+ - Updated dependencies [42f4117]
28
+ - Updated dependencies [9c0d3ef]
29
+ - Updated dependencies [c587812]
30
+ - Updated dependencies [bd95c61]
31
+ - Updated dependencies [d90cdd1]
32
+ - Updated dependencies [e82b90f]
33
+ - Updated dependencies [832d63d]
34
+ - Updated dependencies [81eeb48]
35
+ - Updated dependencies [e245987]
36
+ - Updated dependencies [65306b8]
37
+ - Updated dependencies [84fbb7d]
38
+ - Updated dependencies [d91b4f1]
39
+ - Updated dependencies [d6e7d65]
40
+ - Updated dependencies [ad6532c]
41
+ - Updated dependencies [0a5aa1b]
42
+ - Updated dependencies [ea48c20]
43
+ - Updated dependencies [67d276d]
44
+ - Updated dependencies [091be10]
45
+ - Updated dependencies [aa57a3a]
46
+ - @adapttable/ai@0.2.0
47
+ - @adapttable/core@3.1.0
48
+ - @adapttable/react@1.1.0
49
+
3
50
  ## 0.1.0
4
51
 
5
52
  ### Minor Changes
package/dist/index.cjs CHANGED
@@ -73,6 +73,7 @@ function useTableAssistant(options) {
73
73
  draft: state.draft,
74
74
  setDraft: store.setDraft,
75
75
  send: store.send,
76
+ sendClip: store.sendClip,
76
77
  stop: store.stop,
77
78
  resume: store.resume,
78
79
  interrupted: state.interrupted,
@@ -736,7 +737,17 @@ function bindLiveSession(optionsRef, runtimeRef, revisionCounter, flushAdmission
736
737
  onProgress: (report) => {
737
738
  reportProgress.current(report);
738
739
  },
739
- capabilities: optionsRef.current.capabilities,
740
+ capabilities: [...optionsRef.current.capabilities ?? [], ...(0, _adapttable_ai.tableActionCapabilities)(runtimeRef.current.view()?.actions, {
741
+ actions: () => runtimeRef.current.view()?.actions,
742
+ rowFor: (rowKey) => {
743
+ const view = runtimeRef.current.view();
744
+ return view?.rows.find((row) => view.getRowId(row) === rowKey);
745
+ },
746
+ selectedIds: () => {
747
+ const selection = runtimeRef.current.view()?.selection;
748
+ return selection ? [...selection.selectedIds] : void 0;
749
+ }
750
+ })],
740
751
  ...optionsRef.current.capabilityApproval ? { capabilityApproval: optionsRef.current.capabilityApproval } : {},
741
752
  ...optionsRef.current.excludeCapabilities ? { excludeCapabilities: optionsRef.current.excludeCapabilities } : {}
742
753
  });
@@ -769,7 +780,7 @@ function TableAgentProvider({ feature, children }) {
769
780
  const waitForChrome = (0, react.useRef)(() => Promise.resolve(false));
770
781
  const reportProgress = (0, react.useRef)(() => void 0);
771
782
  const tableIdRef = (0, react.useRef)(options.tableId);
772
- const registryKeyOf = (next) => `${exclusionKey(next.excludeCapabilities)}!${JSON.stringify(next.capabilityApproval ?? {})}`;
783
+ const registryKeyOf = (next) => `${exclusionKey(next.excludeCapabilities)}!${JSON.stringify(next.capabilityApproval ?? {})}!${(0, _adapttable_ai.tableActionSignature)(runtime.view()?.actions)}`;
773
784
  const registryRef = (0, react.useRef)(registryKeyOf(options));
774
785
  const registryKey = registryKeyOf(options);
775
786
  const sessionRef = (0, react.useRef)(null);