@arbidocs/react 0.3.137 → 0.3.138
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/dist/chunk-J4MX2W4H.js +26 -0
- package/dist/chunk-J4MX2W4H.js.map +1 -0
- package/dist/chunk-ZMTLGO3K.cjs +29 -0
- package/dist/chunk-ZMTLGO3K.cjs.map +1 -0
- package/dist/index.cjs +53 -58
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +18 -1
- package/dist/index.d.ts +18 -1
- package/dist/index.js +18 -28
- package/dist/index.js.map +1 -1
- package/dist/viewers/index.cjs +119 -1
- package/dist/viewers/index.cjs.map +1 -1
- package/dist/viewers/index.d.cts +38 -2
- package/dist/viewers/index.d.ts +38 -2
- package/dist/viewers/index.js +118 -2
- package/dist/viewers/index.js.map +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { createContext, useMemo, useContext } from 'react';
|
|
2
|
+
import { Arbi } from '@arbidocs/sdk/browser';
|
|
3
|
+
import { jsx } from 'react/jsx-runtime';
|
|
4
|
+
|
|
5
|
+
// src/ArbiProvider.tsx
|
|
6
|
+
var ArbiContext = createContext(null);
|
|
7
|
+
function ArbiProvider({ children, ...options }) {
|
|
8
|
+
const arbi = useMemo(
|
|
9
|
+
() => new Arbi(options),
|
|
10
|
+
// Stable on url + deploymentDomain — re-creating the instance on every render would be wrong
|
|
11
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
12
|
+
[options.url, options.deploymentDomain, options.credentials]
|
|
13
|
+
);
|
|
14
|
+
return /* @__PURE__ */ jsx(ArbiContext.Provider, { value: arbi, children });
|
|
15
|
+
}
|
|
16
|
+
function useArbi() {
|
|
17
|
+
const arbi = useContext(ArbiContext);
|
|
18
|
+
if (!arbi) {
|
|
19
|
+
throw new Error("useArbi() must be used within an <ArbiProvider>");
|
|
20
|
+
}
|
|
21
|
+
return arbi;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export { ArbiProvider, useArbi };
|
|
25
|
+
//# sourceMappingURL=chunk-J4MX2W4H.js.map
|
|
26
|
+
//# sourceMappingURL=chunk-J4MX2W4H.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/ArbiProvider.tsx","../src/useArbi.ts"],"names":[],"mappings":";;;;;AAYO,IAAM,WAAA,GAAc,cAA2B,IAAI,CAAA;AAMnD,SAAS,YAAA,CAAa,EAAE,QAAA,EAAU,GAAG,SAAQ,EAAsB;AACxE,EAAA,MAAM,IAAA,GAAO,OAAA;AAAA,IACX,MAAM,IAAI,IAAA,CAAK,OAAO,CAAA;AAAA;AAAA;AAAA,IAGtB,CAAC,OAAA,CAAQ,GAAA,EAAK,OAAA,CAAQ,gBAAA,EAAkB,QAAQ,WAAW;AAAA,GAC7D;AAEA,EAAA,2BAAQ,WAAA,CAAY,QAAA,EAAZ,EAAqB,KAAA,EAAO,MAAO,QAAA,EAAS,CAAA;AACtD;ACnBO,SAAS,OAAA,GAAgB;AAC9B,EAAA,MAAM,IAAA,GAAO,WAAW,WAAW,CAAA;AACnC,EAAA,IAAI,CAAC,IAAA,EAAM;AACT,IAAA,MAAM,IAAI,MAAM,iDAAiD,CAAA;AAAA,EACnE;AACA,EAAA,OAAO,IAAA;AACT","file":"chunk-J4MX2W4H.js","sourcesContent":["/**\n * ArbiProvider — React context that holds an Arbi instance.\n *\n * Usage:\n * <ArbiProvider url=\"https://arbi.mycompany.com\">\n * <App />\n * </ArbiProvider>\n */\n\nimport { createContext, useMemo, type ReactNode } from 'react'\nimport { Arbi, type ArbiOptions } from '@arbidocs/sdk/browser'\n\nexport const ArbiContext = createContext<Arbi | null>(null)\n\nexport interface ArbiProviderProps extends ArbiOptions {\n children: ReactNode\n}\n\nexport function ArbiProvider({ children, ...options }: ArbiProviderProps) {\n const arbi = useMemo(\n () => new Arbi(options),\n // Stable on url + deploymentDomain — re-creating the instance on every render would be wrong\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [options.url, options.deploymentDomain, options.credentials]\n )\n\n return <ArbiContext.Provider value={arbi}>{children}</ArbiContext.Provider>\n}\n","/**\n * Hook to access the Arbi instance from the nearest ArbiProvider.\n */\n\nimport { useContext } from 'react'\nimport type { Arbi } from '@arbidocs/sdk/browser'\nimport { ArbiContext } from './ArbiProvider'\n\nexport function useArbi(): Arbi {\n const arbi = useContext(ArbiContext)\n if (!arbi) {\n throw new Error('useArbi() must be used within an <ArbiProvider>')\n }\n return arbi\n}\n"]}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var react = require('react');
|
|
4
|
+
var browser = require('@arbidocs/sdk/browser');
|
|
5
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
6
|
+
|
|
7
|
+
// src/ArbiProvider.tsx
|
|
8
|
+
var ArbiContext = react.createContext(null);
|
|
9
|
+
function ArbiProvider({ children, ...options }) {
|
|
10
|
+
const arbi = react.useMemo(
|
|
11
|
+
() => new browser.Arbi(options),
|
|
12
|
+
// Stable on url + deploymentDomain — re-creating the instance on every render would be wrong
|
|
13
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
14
|
+
[options.url, options.deploymentDomain, options.credentials]
|
|
15
|
+
);
|
|
16
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ArbiContext.Provider, { value: arbi, children });
|
|
17
|
+
}
|
|
18
|
+
function useArbi() {
|
|
19
|
+
const arbi = react.useContext(ArbiContext);
|
|
20
|
+
if (!arbi) {
|
|
21
|
+
throw new Error("useArbi() must be used within an <ArbiProvider>");
|
|
22
|
+
}
|
|
23
|
+
return arbi;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
exports.ArbiProvider = ArbiProvider;
|
|
27
|
+
exports.useArbi = useArbi;
|
|
28
|
+
//# sourceMappingURL=chunk-ZMTLGO3K.cjs.map
|
|
29
|
+
//# sourceMappingURL=chunk-ZMTLGO3K.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/ArbiProvider.tsx","../src/useArbi.ts"],"names":["createContext","useMemo","Arbi","useContext"],"mappings":";;;;;;;AAYO,IAAM,WAAA,GAAcA,oBAA2B,IAAI,CAAA;AAMnD,SAAS,YAAA,CAAa,EAAE,QAAA,EAAU,GAAG,SAAQ,EAAsB;AACxE,EAAA,MAAM,IAAA,GAAOC,aAAA;AAAA,IACX,MAAM,IAAIC,YAAA,CAAK,OAAO,CAAA;AAAA;AAAA;AAAA,IAGtB,CAAC,OAAA,CAAQ,GAAA,EAAK,OAAA,CAAQ,gBAAA,EAAkB,QAAQ,WAAW;AAAA,GAC7D;AAEA,EAAA,sCAAQ,WAAA,CAAY,QAAA,EAAZ,EAAqB,KAAA,EAAO,MAAO,QAAA,EAAS,CAAA;AACtD;ACnBO,SAAS,OAAA,GAAgB;AAC9B,EAAA,MAAM,IAAA,GAAOC,iBAAW,WAAW,CAAA;AACnC,EAAA,IAAI,CAAC,IAAA,EAAM;AACT,IAAA,MAAM,IAAI,MAAM,iDAAiD,CAAA;AAAA,EACnE;AACA,EAAA,OAAO,IAAA;AACT","file":"chunk-ZMTLGO3K.cjs","sourcesContent":["/**\n * ArbiProvider — React context that holds an Arbi instance.\n *\n * Usage:\n * <ArbiProvider url=\"https://arbi.mycompany.com\">\n * <App />\n * </ArbiProvider>\n */\n\nimport { createContext, useMemo, type ReactNode } from 'react'\nimport { Arbi, type ArbiOptions } from '@arbidocs/sdk/browser'\n\nexport const ArbiContext = createContext<Arbi | null>(null)\n\nexport interface ArbiProviderProps extends ArbiOptions {\n children: ReactNode\n}\n\nexport function ArbiProvider({ children, ...options }: ArbiProviderProps) {\n const arbi = useMemo(\n () => new Arbi(options),\n // Stable on url + deploymentDomain — re-creating the instance on every render would be wrong\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [options.url, options.deploymentDomain, options.credentials]\n )\n\n return <ArbiContext.Provider value={arbi}>{children}</ArbiContext.Provider>\n}\n","/**\n * Hook to access the Arbi instance from the nearest ArbiProvider.\n */\n\nimport { useContext } from 'react'\nimport type { Arbi } from '@arbidocs/sdk/browser'\nimport { ArbiContext } from './ArbiProvider'\n\nexport function useArbi(): Arbi {\n const arbi = useContext(ArbiContext)\n if (!arbi) {\n throw new Error('useArbi() must be used within an <ArbiProvider>')\n }\n return arbi\n}\n"]}
|
package/dist/index.cjs
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var chunkZBZKHBDS_cjs = require('./chunk-ZBZKHBDS.cjs');
|
|
4
|
+
var chunkZMTLGO3K_cjs = require('./chunk-ZMTLGO3K.cjs');
|
|
4
5
|
var React2 = require('react');
|
|
5
|
-
var browser = require('@arbidocs/sdk/browser');
|
|
6
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
7
6
|
var reactQuery = require('@tanstack/react-query');
|
|
7
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
8
|
+
var browser = require('@arbidocs/sdk/browser');
|
|
8
9
|
var lucideReact = require('lucide-react');
|
|
9
10
|
var client = require('@arbidocs/client');
|
|
10
11
|
var zustand = require('zustand');
|
|
@@ -22,17 +23,6 @@ var React2__default = /*#__PURE__*/_interopDefault(React2);
|
|
|
22
23
|
var ReactMarkdown__default = /*#__PURE__*/_interopDefault(ReactMarkdown);
|
|
23
24
|
var Cropper__default = /*#__PURE__*/_interopDefault(Cropper);
|
|
24
25
|
|
|
25
|
-
var ArbiContext = React2.createContext(null);
|
|
26
|
-
function ArbiProvider({ children, ...options }) {
|
|
27
|
-
const arbi = React2.useMemo(
|
|
28
|
-
() => new browser.Arbi(options),
|
|
29
|
-
// Stable on url + deploymentDomain — re-creating the instance on every render would be wrong
|
|
30
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
31
|
-
[options.url, options.deploymentDomain, options.credentials]
|
|
32
|
-
);
|
|
33
|
-
return /* @__PURE__ */ jsxRuntime.jsx(ArbiContext.Provider, { value: arbi, children });
|
|
34
|
-
}
|
|
35
|
-
|
|
36
26
|
// src/chat/styles.ts
|
|
37
27
|
var DEFAULT_THEME = {
|
|
38
28
|
primaryColor: "#00adef",
|
|
@@ -355,15 +345,8 @@ function agentStatusStyle(theme) {
|
|
|
355
345
|
alignSelf: "flex-start"
|
|
356
346
|
};
|
|
357
347
|
}
|
|
358
|
-
function useArbi() {
|
|
359
|
-
const arbi = React2.useContext(ArbiContext);
|
|
360
|
-
if (!arbi) {
|
|
361
|
-
throw new Error("useArbi() must be used within an <ArbiProvider>");
|
|
362
|
-
}
|
|
363
|
-
return arbi;
|
|
364
|
-
}
|
|
365
348
|
function AuthScreen({ theme, labels, onLogin }) {
|
|
366
|
-
const arbi = useArbi();
|
|
349
|
+
const arbi = chunkZMTLGO3K_cjs.useArbi();
|
|
367
350
|
const [mode, setMode] = React2.useState("login");
|
|
368
351
|
const [step, setStep] = React2.useState("email");
|
|
369
352
|
const [email, setEmail] = React2.useState("");
|
|
@@ -621,7 +604,7 @@ var arbiQueryKeys = {
|
|
|
621
604
|
workspaceChronology: (workspaceId) => ["arbi", "workspaceChronology", workspaceId]
|
|
622
605
|
};
|
|
623
606
|
function useWorkspaces(options) {
|
|
624
|
-
const arbi = useArbi();
|
|
607
|
+
const arbi = chunkZMTLGO3K_cjs.useArbi();
|
|
625
608
|
return reactQuery.useQuery({
|
|
626
609
|
queryKey: arbiQueryKeys.workspaces(),
|
|
627
610
|
queryFn: () => arbi.workspaces.list(),
|
|
@@ -629,7 +612,7 @@ function useWorkspaces(options) {
|
|
|
629
612
|
});
|
|
630
613
|
}
|
|
631
614
|
function useDocuments(workspaceId, options) {
|
|
632
|
-
const arbi = useArbi();
|
|
615
|
+
const arbi = chunkZMTLGO3K_cjs.useArbi();
|
|
633
616
|
return reactQuery.useQuery({
|
|
634
617
|
queryKey: arbiQueryKeys.documents(workspaceId ?? ""),
|
|
635
618
|
queryFn: () => arbi.documents.list(),
|
|
@@ -637,7 +620,7 @@ function useDocuments(workspaceId, options) {
|
|
|
637
620
|
});
|
|
638
621
|
}
|
|
639
622
|
function useConversations(workspaceId, options) {
|
|
640
|
-
const arbi = useArbi();
|
|
623
|
+
const arbi = chunkZMTLGO3K_cjs.useArbi();
|
|
641
624
|
return reactQuery.useQuery({
|
|
642
625
|
queryKey: arbiQueryKeys.conversations(workspaceId ?? ""),
|
|
643
626
|
queryFn: () => arbi.conversations.list(),
|
|
@@ -645,7 +628,7 @@ function useConversations(workspaceId, options) {
|
|
|
645
628
|
});
|
|
646
629
|
}
|
|
647
630
|
function useTags(workspaceId, options) {
|
|
648
|
-
const arbi = useArbi();
|
|
631
|
+
const arbi = chunkZMTLGO3K_cjs.useArbi();
|
|
649
632
|
return reactQuery.useQuery({
|
|
650
633
|
queryKey: arbiQueryKeys.tags(workspaceId ?? ""),
|
|
651
634
|
queryFn: () => arbi.tags.list(),
|
|
@@ -653,7 +636,7 @@ function useTags(workspaceId, options) {
|
|
|
653
636
|
});
|
|
654
637
|
}
|
|
655
638
|
function useThumbnails(docIds, options) {
|
|
656
|
-
const arbi = useArbi();
|
|
639
|
+
const arbi = chunkZMTLGO3K_cjs.useArbi();
|
|
657
640
|
return reactQuery.useQuery({
|
|
658
641
|
queryKey: arbiQueryKeys.thumbnails(docIds),
|
|
659
642
|
queryFn: () => arbi.documents.getThumbnails(docIds),
|
|
@@ -662,7 +645,7 @@ function useThumbnails(docIds, options) {
|
|
|
662
645
|
});
|
|
663
646
|
}
|
|
664
647
|
function useParsedDocument(docId, stage = "final", options) {
|
|
665
|
-
const arbi = useArbi();
|
|
648
|
+
const arbi = chunkZMTLGO3K_cjs.useArbi();
|
|
666
649
|
return reactQuery.useQuery({
|
|
667
650
|
queryKey: arbiQueryKeys.parsedDoc(docId ?? "", stage),
|
|
668
651
|
queryFn: () => arbi.documents.getParsedContent(docId, stage),
|
|
@@ -670,13 +653,13 @@ function useParsedDocument(docId, stage = "final", options) {
|
|
|
670
653
|
});
|
|
671
654
|
}
|
|
672
655
|
function useAssistantQuery() {
|
|
673
|
-
const arbi = useArbi();
|
|
656
|
+
const arbi = chunkZMTLGO3K_cjs.useArbi();
|
|
674
657
|
return reactQuery.useMutation({
|
|
675
658
|
mutationFn: ({ question, ...options }) => arbi.assistant.query(question, options)
|
|
676
659
|
});
|
|
677
660
|
}
|
|
678
661
|
function useAgents(options) {
|
|
679
|
-
const arbi = useArbi();
|
|
662
|
+
const arbi = chunkZMTLGO3K_cjs.useArbi();
|
|
680
663
|
return reactQuery.useQuery({
|
|
681
664
|
queryKey: arbiQueryKeys.agents(),
|
|
682
665
|
queryFn: () => arbi.agents.list(),
|
|
@@ -684,13 +667,13 @@ function useAgents(options) {
|
|
|
684
667
|
});
|
|
685
668
|
}
|
|
686
669
|
function useDeleteAgents() {
|
|
687
|
-
const arbi = useArbi();
|
|
670
|
+
const arbi = chunkZMTLGO3K_cjs.useArbi();
|
|
688
671
|
return reactQuery.useMutation({
|
|
689
672
|
mutationFn: ({ agentExtIds }) => arbi.agents.delete(agentExtIds)
|
|
690
673
|
});
|
|
691
674
|
}
|
|
692
675
|
function useSessions(options) {
|
|
693
|
-
const arbi = useArbi();
|
|
676
|
+
const arbi = chunkZMTLGO3K_cjs.useArbi();
|
|
694
677
|
return reactQuery.useQuery({
|
|
695
678
|
queryKey: arbiQueryKeys.sessions(),
|
|
696
679
|
queryFn: () => arbi.sessions.list(),
|
|
@@ -698,7 +681,7 @@ function useSessions(options) {
|
|
|
698
681
|
});
|
|
699
682
|
}
|
|
700
683
|
function useHealth(options) {
|
|
701
|
-
const arbi = useArbi();
|
|
684
|
+
const arbi = chunkZMTLGO3K_cjs.useArbi();
|
|
702
685
|
return reactQuery.useQuery({
|
|
703
686
|
queryKey: arbiQueryKeys.health(),
|
|
704
687
|
queryFn: () => arbi.health.check(),
|
|
@@ -706,7 +689,7 @@ function useHealth(options) {
|
|
|
706
689
|
});
|
|
707
690
|
}
|
|
708
691
|
function useTasks(options) {
|
|
709
|
-
const arbi = useArbi();
|
|
692
|
+
const arbi = chunkZMTLGO3K_cjs.useArbi();
|
|
710
693
|
return reactQuery.useQuery({
|
|
711
694
|
queryKey: arbiQueryKeys.tasks(),
|
|
712
695
|
queryFn: () => arbi.tasks.list(),
|
|
@@ -714,7 +697,7 @@ function useTasks(options) {
|
|
|
714
697
|
});
|
|
715
698
|
}
|
|
716
699
|
function useMemories(workspaceId, options) {
|
|
717
|
-
const arbi = useArbi();
|
|
700
|
+
const arbi = chunkZMTLGO3K_cjs.useArbi();
|
|
718
701
|
return reactQuery.useQuery({
|
|
719
702
|
queryKey: arbiQueryKeys.memories(workspaceId ?? ""),
|
|
720
703
|
queryFn: () => arbi.memory.list({ pinnedOnly: options?.pinnedOnly }),
|
|
@@ -722,7 +705,7 @@ function useMemories(workspaceId, options) {
|
|
|
722
705
|
});
|
|
723
706
|
}
|
|
724
707
|
function useConfigs(options) {
|
|
725
|
-
const arbi = useArbi();
|
|
708
|
+
const arbi = chunkZMTLGO3K_cjs.useArbi();
|
|
726
709
|
return reactQuery.useQuery({
|
|
727
710
|
queryKey: arbiQueryKeys.configs(),
|
|
728
711
|
queryFn: () => arbi.agentConfig.list(),
|
|
@@ -730,7 +713,7 @@ function useConfigs(options) {
|
|
|
730
713
|
});
|
|
731
714
|
}
|
|
732
715
|
function useActivity(options) {
|
|
733
|
-
const arbi = useArbi();
|
|
716
|
+
const arbi = chunkZMTLGO3K_cjs.useArbi();
|
|
734
717
|
return reactQuery.useQuery({
|
|
735
718
|
queryKey: arbiQueryKeys.activity(),
|
|
736
719
|
queryFn: () => arbi.dm.listActivity({ limit: options?.limit, offset: options?.offset }),
|
|
@@ -738,7 +721,7 @@ function useActivity(options) {
|
|
|
738
721
|
});
|
|
739
722
|
}
|
|
740
723
|
function useProjects(options) {
|
|
741
|
-
const arbi = useArbi();
|
|
724
|
+
const arbi = chunkZMTLGO3K_cjs.useArbi();
|
|
742
725
|
return reactQuery.useQuery({
|
|
743
726
|
queryKey: arbiQueryKeys.projects(),
|
|
744
727
|
queryFn: () => arbi.projects.list(),
|
|
@@ -746,7 +729,7 @@ function useProjects(options) {
|
|
|
746
729
|
});
|
|
747
730
|
}
|
|
748
731
|
function useProjectUsage(projectExtId, monthsBack = 0, options) {
|
|
749
|
-
const arbi = useArbi();
|
|
732
|
+
const arbi = chunkZMTLGO3K_cjs.useArbi();
|
|
750
733
|
return reactQuery.useQuery({
|
|
751
734
|
queryKey: arbiQueryKeys.projectUsage(projectExtId ?? "", monthsBack),
|
|
752
735
|
queryFn: () => arbi.projects.usage(projectExtId, monthsBack),
|
|
@@ -754,7 +737,7 @@ function useProjectUsage(projectExtId, monthsBack = 0, options) {
|
|
|
754
737
|
});
|
|
755
738
|
}
|
|
756
739
|
function useProjectsUsage(projectExtIds, monthsBack = 0, options) {
|
|
757
|
-
const arbi = useArbi();
|
|
740
|
+
const arbi = chunkZMTLGO3K_cjs.useArbi();
|
|
758
741
|
const enabled = (options?.enabled ?? true) && arbi.isLoggedIn;
|
|
759
742
|
const results = reactQuery.useQueries({
|
|
760
743
|
queries: projectExtIds.map((id) => ({
|
|
@@ -819,7 +802,7 @@ function useProjectsUsage(projectExtIds, monthsBack = 0, options) {
|
|
|
819
802
|
}, [signature]);
|
|
820
803
|
}
|
|
821
804
|
function useProjectInvoices(projectExtId, options) {
|
|
822
|
-
const arbi = useArbi();
|
|
805
|
+
const arbi = chunkZMTLGO3K_cjs.useArbi();
|
|
823
806
|
return reactQuery.useQuery({
|
|
824
807
|
queryKey: arbiQueryKeys.projectInvoices(projectExtId ?? ""),
|
|
825
808
|
queryFn: () => arbi.projects.invoices(projectExtId),
|
|
@@ -827,7 +810,7 @@ function useProjectInvoices(projectExtId, options) {
|
|
|
827
810
|
});
|
|
828
811
|
}
|
|
829
812
|
function useUserUsageToday(options) {
|
|
830
|
-
const arbi = useArbi();
|
|
813
|
+
const arbi = chunkZMTLGO3K_cjs.useArbi();
|
|
831
814
|
return reactQuery.useQuery({
|
|
832
815
|
queryKey: arbiQueryKeys.userUsageToday(),
|
|
833
816
|
queryFn: () => arbi.user.usageToday(),
|
|
@@ -835,7 +818,7 @@ function useUserUsageToday(options) {
|
|
|
835
818
|
});
|
|
836
819
|
}
|
|
837
820
|
function useWorkspaceChronology(workspaceId, options) {
|
|
838
|
-
const arbi = useArbi();
|
|
821
|
+
const arbi = chunkZMTLGO3K_cjs.useArbi();
|
|
839
822
|
return reactQuery.useQuery({
|
|
840
823
|
queryKey: arbiQueryKeys.workspaceChronology(workspaceId ?? ""),
|
|
841
824
|
queryFn: () => arbi.workspaces.chronology(workspaceId),
|
|
@@ -843,7 +826,7 @@ function useWorkspaceChronology(workspaceId, options) {
|
|
|
843
826
|
});
|
|
844
827
|
}
|
|
845
828
|
function WorkspaceScreen({ theme, labels, onSelect }) {
|
|
846
|
-
const arbi = useArbi();
|
|
829
|
+
const arbi = chunkZMTLGO3K_cjs.useArbi();
|
|
847
830
|
const { data: workspaces, isLoading } = useWorkspaces();
|
|
848
831
|
const [mode, setMode] = React2.useState("select");
|
|
849
832
|
const [selected, setSelected] = React2.useState("");
|
|
@@ -1080,7 +1063,7 @@ function citeChunkStyle(theme) {
|
|
|
1080
1063
|
};
|
|
1081
1064
|
}
|
|
1082
1065
|
function ChatView({ workspaceId, theme, labels }) {
|
|
1083
|
-
const arbi = useArbi();
|
|
1066
|
+
const arbi = chunkZMTLGO3K_cjs.useArbi();
|
|
1084
1067
|
const { data: docs, refetch: refetchDocs } = useDocuments(workspaceId);
|
|
1085
1068
|
const mutation = useAssistantQuery();
|
|
1086
1069
|
const [messages, setMessages] = React2.useState([]);
|
|
@@ -1260,7 +1243,7 @@ function ChatView({ workspaceId, theme, labels }) {
|
|
|
1260
1243
|
] });
|
|
1261
1244
|
}
|
|
1262
1245
|
function ChatWidget({ theme, labels, initialWorkspaceId, width, height }) {
|
|
1263
|
-
const arbi = useArbi();
|
|
1246
|
+
const arbi = chunkZMTLGO3K_cjs.useArbi();
|
|
1264
1247
|
const [screen, setScreen] = React2.useState("auth");
|
|
1265
1248
|
const [workspaceId, setWorkspaceId] = React2.useState(initialWorkspaceId);
|
|
1266
1249
|
const resolveWorkspace = React2.useCallback(async () => {
|
|
@@ -1350,7 +1333,7 @@ function ArbiChat({
|
|
|
1350
1333
|
}),
|
|
1351
1334
|
[]
|
|
1352
1335
|
);
|
|
1353
|
-
return /* @__PURE__ */ jsxRuntime.jsx(reactQuery.QueryClientProvider, { client: queryClient, children: /* @__PURE__ */ jsxRuntime.jsx(ArbiProvider, { url, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1336
|
+
return /* @__PURE__ */ jsxRuntime.jsx(reactQuery.QueryClientProvider, { client: queryClient, children: /* @__PURE__ */ jsxRuntime.jsx(chunkZMTLGO3K_cjs.ArbiProvider, { url, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1354
1337
|
ArbiChatPanel,
|
|
1355
1338
|
{
|
|
1356
1339
|
workspaceId,
|
|
@@ -1487,7 +1470,7 @@ function useArbiWsContext() {
|
|
|
1487
1470
|
return ctx;
|
|
1488
1471
|
}
|
|
1489
1472
|
function ArbiWebSocketProvider({ enabled = true, children }) {
|
|
1490
|
-
const arbi = useArbi();
|
|
1473
|
+
const arbi = chunkZMTLGO3K_cjs.useArbi();
|
|
1491
1474
|
const subscribersRef = React2.useRef(/* @__PURE__ */ new Set());
|
|
1492
1475
|
const setStatus = useArbiWsStore((s) => s.setStatus);
|
|
1493
1476
|
const applyTaskUpdate = useArbiWsStore((s) => s.applyTaskUpdate);
|
|
@@ -1709,7 +1692,7 @@ function useAiTask() {
|
|
|
1709
1692
|
};
|
|
1710
1693
|
}
|
|
1711
1694
|
function useSemanticSearch(docIds) {
|
|
1712
|
-
const arbi = useArbi();
|
|
1695
|
+
const arbi = chunkZMTLGO3K_cjs.useArbi();
|
|
1713
1696
|
const [query, setQuery] = React2.useState("");
|
|
1714
1697
|
const mutation = reactQuery.useMutation({
|
|
1715
1698
|
mutationFn: async ({ query: q, mode }) => {
|
|
@@ -2951,8 +2934,8 @@ Question: ${question}`,
|
|
|
2951
2934
|
`Suggest 3-6 concise, reusable labels for the document "${docName ?? docId}" \u2014 covering document type, the key issues it touches, and any key parties. Return them as a short comma-separated list with a one-line rationale for each.`,
|
|
2952
2935
|
[docId]
|
|
2953
2936
|
);
|
|
2954
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-3", "data-testid": "doc-qa", children: [
|
|
2955
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
2937
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-w-0 space-y-3", "data-testid": "doc-qa", children: [
|
|
2938
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-w-0 items-center gap-2", children: [
|
|
2956
2939
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2957
2940
|
chunkZBZKHBDS_cjs.Input,
|
|
2958
2941
|
{
|
|
@@ -2960,7 +2943,7 @@ Question: ${question}`,
|
|
|
2960
2943
|
onChange: (e) => setQ(e.target.value),
|
|
2961
2944
|
onKeyDown: (e) => e.key === "Enter" && (e.preventDefault(), ask()),
|
|
2962
2945
|
placeholder: "Ask about this document\u2026",
|
|
2963
|
-
className: "bg-card text-sm placeholder:text-muted-foreground/70 focus-visible:border-ring/60 focus-visible:ring-2 focus-visible:ring-ring/50",
|
|
2946
|
+
className: "min-w-0 flex-1 bg-card text-sm placeholder:text-muted-foreground/70 focus-visible:border-ring/60 focus-visible:ring-2 focus-visible:ring-ring/50",
|
|
2964
2947
|
"data-testid": "doc-qa-input"
|
|
2965
2948
|
}
|
|
2966
2949
|
),
|
|
@@ -2971,6 +2954,7 @@ Question: ${question}`,
|
|
|
2971
2954
|
size: "icon",
|
|
2972
2955
|
onClick: ask,
|
|
2973
2956
|
disabled: task.isRunning || !q.trim(),
|
|
2957
|
+
className: "shrink-0",
|
|
2974
2958
|
"data-testid": "doc-qa-send",
|
|
2975
2959
|
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Send, { className: "size-4" })
|
|
2976
2960
|
}
|
|
@@ -2982,6 +2966,7 @@ Question: ${question}`,
|
|
|
2982
2966
|
size: "sm",
|
|
2983
2967
|
onClick: suggestTags,
|
|
2984
2968
|
disabled: task.isRunning,
|
|
2969
|
+
className: "shrink-0",
|
|
2985
2970
|
"data-testid": "doc-qa-tags",
|
|
2986
2971
|
children: [
|
|
2987
2972
|
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Tags, { className: "size-4" }),
|
|
@@ -5316,7 +5301,7 @@ function groupConversations(notifications, myExtId) {
|
|
|
5316
5301
|
return conversations;
|
|
5317
5302
|
}
|
|
5318
5303
|
function useDirectMessages(options) {
|
|
5319
|
-
const arbi = useArbi();
|
|
5304
|
+
const arbi = chunkZMTLGO3K_cjs.useArbi();
|
|
5320
5305
|
const queryClient = reactQuery.useQueryClient();
|
|
5321
5306
|
const enabled = options?.enabled ?? arbi.isLoggedIn;
|
|
5322
5307
|
const query = reactQuery.useQuery({
|
|
@@ -6124,9 +6109,11 @@ function DocumentTable({
|
|
|
6124
6109
|
workspaceId,
|
|
6125
6110
|
documents,
|
|
6126
6111
|
onOpenDocument,
|
|
6112
|
+
openOnRowClick = true,
|
|
6127
6113
|
selectedIds,
|
|
6128
6114
|
onSelectionChange,
|
|
6129
6115
|
height = 480,
|
|
6116
|
+
extraColumns,
|
|
6130
6117
|
className
|
|
6131
6118
|
}) {
|
|
6132
6119
|
const query = useDocuments(workspaceId, { enabled: !documents });
|
|
@@ -6258,9 +6245,10 @@ function DocumentTable({
|
|
|
6258
6245
|
sortable: true,
|
|
6259
6246
|
field: "folder",
|
|
6260
6247
|
valueFormatter: (p) => p.value || "\u2014"
|
|
6261
|
-
}
|
|
6248
|
+
},
|
|
6249
|
+
...extraColumns ?? []
|
|
6262
6250
|
],
|
|
6263
|
-
[openDocument, viewingDocId, tagNameById]
|
|
6251
|
+
[openDocument, viewingDocId, tagNameById, extraColumns]
|
|
6264
6252
|
);
|
|
6265
6253
|
const handleGridReady = (e) => {
|
|
6266
6254
|
gridApiRef.current = e.api;
|
|
@@ -6271,6 +6259,7 @@ function DocumentTable({
|
|
|
6271
6259
|
emitSelection(ids);
|
|
6272
6260
|
};
|
|
6273
6261
|
const handleRowClicked = (e) => {
|
|
6262
|
+
if (!openOnRowClick) return;
|
|
6274
6263
|
const id = e.data?.external_id;
|
|
6275
6264
|
if (id) openDocument(id);
|
|
6276
6265
|
};
|
|
@@ -6520,7 +6509,7 @@ function DocumentCardMenu({
|
|
|
6520
6509
|
canDelete = true,
|
|
6521
6510
|
testId = "document-card-menu"
|
|
6522
6511
|
}) {
|
|
6523
|
-
const arbi = useArbi();
|
|
6512
|
+
const arbi = chunkZMTLGO3K_cjs.useArbi();
|
|
6524
6513
|
const queryClient = reactQuery.useQueryClient();
|
|
6525
6514
|
const invalidateDocuments = () => {
|
|
6526
6515
|
const workspaceId = arbi.getWorkspaceId();
|
|
@@ -6664,7 +6653,7 @@ function DocumentGallery({
|
|
|
6664
6653
|
},
|
|
6665
6654
|
[onOpenDocument, setViewingDocId]
|
|
6666
6655
|
);
|
|
6667
|
-
const arbi = useArbi();
|
|
6656
|
+
const arbi = chunkZMTLGO3K_cjs.useArbi();
|
|
6668
6657
|
const queryClient = reactQuery.useQueryClient();
|
|
6669
6658
|
const [renamingId, setRenamingId] = React2__default.default.useState(null);
|
|
6670
6659
|
const rename = reactQuery.useMutation({
|
|
@@ -7171,6 +7160,14 @@ Object.defineProperty(exports, "toggleVariants", {
|
|
|
7171
7160
|
enumerable: true,
|
|
7172
7161
|
get: function () { return chunkZBZKHBDS_cjs.toggleVariants; }
|
|
7173
7162
|
});
|
|
7163
|
+
Object.defineProperty(exports, "ArbiProvider", {
|
|
7164
|
+
enumerable: true,
|
|
7165
|
+
get: function () { return chunkZMTLGO3K_cjs.ArbiProvider; }
|
|
7166
|
+
});
|
|
7167
|
+
Object.defineProperty(exports, "useArbi", {
|
|
7168
|
+
enumerable: true,
|
|
7169
|
+
get: function () { return chunkZMTLGO3K_cjs.useArbi; }
|
|
7170
|
+
});
|
|
7174
7171
|
Object.defineProperty(exports, "Arbi", {
|
|
7175
7172
|
enumerable: true,
|
|
7176
7173
|
get: function () { return browser.Arbi; }
|
|
@@ -7196,7 +7193,6 @@ exports.ArbiBotIcon = ArbiBotIcon;
|
|
|
7196
7193
|
exports.ArbiChat = ArbiChat;
|
|
7197
7194
|
exports.ArbiChatPanel = ArbiChatPanel;
|
|
7198
7195
|
exports.ArbiIcon = ArbiIcon;
|
|
7199
|
-
exports.ArbiProvider = ArbiProvider;
|
|
7200
7196
|
exports.ArbiWebSocketProvider = ArbiWebSocketProvider;
|
|
7201
7197
|
exports.ArtifactCanvas = ArtifactCanvas;
|
|
7202
7198
|
exports.AudIcon = AudIcon;
|
|
@@ -7290,7 +7286,6 @@ exports.toRedlineMarkdown = toRedlineMarkdown;
|
|
|
7290
7286
|
exports.useActivity = useActivity;
|
|
7291
7287
|
exports.useAgents = useAgents;
|
|
7292
7288
|
exports.useAiTask = useAiTask;
|
|
7293
|
-
exports.useArbi = useArbi;
|
|
7294
7289
|
exports.useArbiConnected = useArbiConnected;
|
|
7295
7290
|
exports.useArbiDocumentSync = useArbiDocumentSync;
|
|
7296
7291
|
exports.useArbiUiStore = useArbiUiStore;
|