@carlonicora/nextjs-jsonapi 1.107.1 → 1.109.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.
- package/dist/{AssistantInterface-BYgI5z1-.d.mts → AssistantInterface-B1c8FhGA.d.mts} +2 -0
- package/dist/{AssistantInterface-DfDcz0gJ.d.ts → AssistantInterface-BBUHxOCd.d.ts} +2 -0
- package/dist/{AssistantMessageInterface-BpEhx2pC.d.ts → AssistantMessageInterface-Cs1yb-gF.d.ts} +3 -1
- package/dist/{AssistantMessageInterface-DJ3Me16Y.d.mts → AssistantMessageInterface-DQ3mH5L8.d.mts} +3 -1
- package/dist/{AuthComponent-B6DIk8Vf.d.ts → AuthComponent-Cd7lcYif.d.ts} +1 -1
- package/dist/{AuthComponent-BKI0ZbtD.d.mts → AuthComponent-DdxCFgUZ.d.mts} +1 -1
- package/dist/{BlockNoteEditor-RWRVIEZC.js → BlockNoteEditor-3XYBZLWO.js} +20 -19
- package/dist/BlockNoteEditor-3XYBZLWO.js.map +1 -0
- package/dist/{BlockNoteEditor-7TSK7PNG.mjs → BlockNoteEditor-EBFZG7AL.mjs} +5 -4
- package/dist/{BlockNoteEditor-7TSK7PNG.mjs.map → BlockNoteEditor-EBFZG7AL.mjs.map} +1 -1
- package/dist/{auth.interface-BBUgMZzs.d.ts → auth.interface-8b601idJ.d.ts} +1 -1
- package/dist/{auth.interface-XYEREOD6.d.mts → auth.interface-CXBF8Mhi.d.mts} +1 -1
- package/dist/billing/index.js +347 -346
- package/dist/billing/index.js.map +1 -1
- package/dist/billing/index.mjs +4 -3
- package/dist/billing/index.mjs.map +1 -1
- package/dist/chunk-3J7RQBF3.js +123 -0
- package/dist/chunk-3J7RQBF3.js.map +1 -0
- package/dist/{chunk-VLDLERJN.js → chunk-7E3O52U5.js} +15 -8
- package/dist/chunk-7E3O52U5.js.map +1 -0
- package/dist/{chunk-RXXZGPC3.js → chunk-CFI4WZ5R.js} +159 -113
- package/dist/chunk-CFI4WZ5R.js.map +1 -0
- package/dist/chunk-CQID6RCF.mjs +38 -0
- package/dist/chunk-CQID6RCF.mjs.map +1 -0
- package/dist/{chunk-WSOPEIRP.mjs → chunk-CRTVAQEK.mjs} +46 -27
- package/dist/chunk-CRTVAQEK.mjs.map +1 -0
- package/dist/{chunk-N3NVIPSU.mjs → chunk-MSNNAHDB.mjs} +129 -83
- package/dist/{chunk-N3NVIPSU.mjs.map → chunk-MSNNAHDB.mjs.map} +1 -1
- package/dist/chunk-MZTKPPET.mjs +123 -0
- package/dist/chunk-MZTKPPET.mjs.map +1 -0
- package/dist/{chunk-2IRWQVG4.js → chunk-UHO3KUUH.js} +842 -823
- package/dist/chunk-UHO3KUUH.js.map +1 -0
- package/dist/{chunk-CFECWLHH.mjs → chunk-UOYIWJEJ.mjs} +10 -3
- package/dist/chunk-UOYIWJEJ.mjs.map +1 -0
- package/dist/chunk-YQQHAFBS.js +38 -0
- package/dist/chunk-YQQHAFBS.js.map +1 -0
- package/dist/client/index.d.mts +8 -16
- package/dist/client/index.d.ts +8 -16
- package/dist/client/index.js +5 -4
- package/dist/client/index.js.map +1 -1
- package/dist/client/index.mjs +4 -3
- package/dist/components/index.d.mts +8 -7
- package/dist/components/index.d.ts +8 -7
- package/dist/components/index.js +5 -4
- package/dist/components/index.js.map +1 -1
- package/dist/components/index.mjs +4 -3
- package/dist/{config-CLQynoaa.d.ts → config-CN23v3eJ.d.ts} +4 -1
- package/dist/{config-k61pe_o2.d.mts → config-gh88Qn4h.d.mts} +4 -1
- package/dist/contexts/index.d.mts +18 -7
- package/dist/contexts/index.d.ts +18 -7
- package/dist/contexts/index.js +5 -4
- package/dist/contexts/index.js.map +1 -1
- package/dist/contexts/index.mjs +4 -3
- package/dist/core/index.d.mts +44 -11
- package/dist/core/index.d.ts +44 -11
- package/dist/core/index.js +2 -2
- package/dist/core/index.mjs +1 -1
- package/dist/features/help/index.css +29 -0
- package/dist/features/help/index.css.map +1 -0
- package/dist/features/help/index.d.mts +115 -0
- package/dist/features/help/index.d.ts +115 -0
- package/dist/features/help/index.js +532 -0
- package/dist/features/help/index.js.map +1 -0
- package/dist/features/help/index.mjs +532 -0
- package/dist/features/help/index.mjs.map +1 -0
- package/dist/features/help/server/createHelpAssetRouteHandler.d.mts +11 -0
- package/dist/features/help/server/createHelpAssetRouteHandler.d.ts +11 -0
- package/dist/features/help/server/createHelpAssetRouteHandler.js +43 -0
- package/dist/features/help/server/createHelpAssetRouteHandler.js.map +1 -0
- package/dist/features/help/server/createHelpAssetRouteHandler.mjs +43 -0
- package/dist/features/help/server/createHelpAssetRouteHandler.mjs.map +1 -0
- package/dist/features/help/server.d.mts +71 -0
- package/dist/features/help/server.d.ts +71 -0
- package/dist/features/help/server.js +123 -0
- package/dist/features/help/server.js.map +1 -0
- package/dist/features/help/server.mjs +123 -0
- package/dist/features/help/server.mjs.map +1 -0
- package/dist/help-content-config.interface-B9L02u9i.d.mts +50 -0
- package/dist/help-content-config.interface-B9L02u9i.d.ts +50 -0
- package/dist/index.d.mts +10 -8
- package/dist/index.d.ts +10 -8
- package/dist/index.js +4 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3 -2
- package/dist/{notification.interface-aLEJbA_g.d.ts → notification.interface-C1T1C2ee.d.ts} +1 -100
- package/dist/{notification.interface-DLZGtV7Z.d.mts → notification.interface-DIxR23eS.d.mts} +1 -100
- package/dist/{s3.service-CVgLWaDc.d.mts → s3.service-0BTClOYO.d.mts} +2 -2
- package/dist/{s3.service-SLlX0Zbz.d.ts → s3.service-CT27Fm1s.d.ts} +2 -2
- package/dist/server/index.d.mts +4 -3
- package/dist/server/index.d.ts +4 -3
- package/dist/server/index.js +3 -3
- package/dist/server/index.mjs +1 -1
- package/dist/types-CQSjy7et.d.mts +101 -0
- package/dist/types-DHOxe8rc.d.ts +101 -0
- package/dist/usePageUrlGenerator-tjq2mlDV.d.ts +14 -0
- package/dist/usePageUrlGenerator-uOnyJ6j2.d.mts +14 -0
- package/dist/{useSocket-BkxHHujj.d.mts → useSocket-B1fMIr17.d.mts} +1 -1
- package/dist/{useSocket-CMDjWFYm.d.ts → useSocket-BdJTBXKv.d.ts} +1 -1
- package/package.json +20 -1
- package/src/client/config.ts +9 -1
- package/src/core/registry/helpStore.ts +45 -0
- package/src/features/assistant/contexts/AssistantContext.tsx +35 -19
- package/src/features/assistant/contexts/__tests__/AssistantContext.spec.tsx +66 -6
- package/src/features/assistant/data/Assistant.ts +2 -0
- package/src/features/assistant/data/AssistantInterface.ts +2 -0
- package/src/features/assistant/data/AssistantService.ts +18 -8
- package/src/features/assistant-message/components/parts/MessageSourcesPanel.tsx +6 -4
- package/src/features/assistant-message/components/parts/tabs/ContentsTab.tsx +5 -1
- package/src/features/assistant-message/components/parts/tabs/ReferencesTab.tsx +2 -1
- package/src/features/assistant-message/data/AssistantMessage.ts +27 -1
- package/src/features/assistant-message/data/AssistantMessageInterface.ts +1 -0
- package/src/features/assistant-message/data/__tests__/AssistantMessage.spec.ts +7 -3
- package/src/features/help/components/HelpArticleBody.tsx +54 -0
- package/src/features/help/components/HelpAskAi.tsx +36 -0
- package/src/features/help/components/HelpAssistantSheet.tsx +53 -0
- package/src/features/help/components/HelpHeader.tsx +40 -0
- package/src/features/help/components/HelpHint.tsx +77 -0
- package/src/features/help/components/HelpSearchResultRow.tsx +51 -0
- package/src/features/help/components/HelpSideNav.tsx +84 -0
- package/src/features/help/components/HelpTOC.tsx +49 -0
- package/src/features/help/components/__tests__/HelpAskAi.spec.tsx +68 -0
- package/src/features/help/components/__tests__/HelpAssistantSheet.spec.tsx +36 -0
- package/src/features/help/components/__tests__/HelpHint.spec.tsx +50 -0
- package/src/features/help/components/__tests__/HelpSearchResultRow.spec.tsx +59 -0
- package/src/features/help/components/__tests__/HelpSideNav.spec.tsx +52 -0
- package/src/features/help/components/mdx/Callout.tsx +21 -0
- package/src/features/help/components/mdx/EntityRef.tsx +18 -0
- package/src/features/help/components/mdx/KeyBinding.tsx +6 -0
- package/src/features/help/components/mdx/Related.tsx +33 -0
- package/src/features/help/components/mdx/Screenshot.tsx +9 -0
- package/src/features/help/components/mdx/Steps.tsx +21 -0
- package/src/features/help/components/mdx/Video.tsx +8 -0
- package/src/features/help/components/mdx/mdx-server-components.ts +23 -0
- package/src/features/help/components/mdx/mdxComponents.ts +9 -0
- package/src/features/help/contexts/HelpContext.spec.tsx +28 -0
- package/src/features/help/contexts/HelpContext.tsx +24 -0
- package/src/features/help/hooks/useHelp.ts +1 -0
- package/src/features/help/hooks/useHelpArticle.ts +7 -0
- package/src/features/help/hooks/useHelpFilter.ts +27 -0
- package/src/features/help/hooks/useHelpManifest.ts +5 -0
- package/src/features/help/i18n-keys.ts +34 -0
- package/src/features/help/index.ts +27 -0
- package/src/features/help/interfaces/help-content-config.interface.ts +17 -0
- package/src/features/help/server/__tests__/createHelpAssetRouteHandler.spec.ts +43 -0
- package/src/features/help/server/createHelpAssetRouteHandler.ts +35 -0
- package/src/features/help/server/generateHelpArticleMetadata.ts +18 -0
- package/src/features/help/server/generateHelpArticleStaticParams.ts +7 -0
- package/src/features/help/server/generateHelpModeStaticParams.ts +5 -0
- package/src/features/help/server/getHelpContent.ts +17 -0
- package/src/features/help/server/index.ts +8 -0
- package/src/features/help/server/serializeHelpArticle.tsx +46 -0
- package/src/features/help/server-entry.ts +20 -0
- package/src/features/help/types/help-article.types.ts +37 -0
- package/src/features/help/utils/__tests__/helpNavigation.spec.ts +70 -0
- package/src/features/help/utils/articleUrl.ts +13 -0
- package/src/features/help/utils/helpNavigation.ts +29 -0
- package/src/features/how-to/HowToModule.ts +1 -1
- package/src/features/how-to/data/HowTo.ts +21 -3
- package/src/features/how-to/data/HowToInterface.ts +1 -0
- package/src/index.ts +4 -0
- package/src/shadcnui/ui/context-menu.tsx +3 -1
- package/src/shadcnui/ui/popover.tsx +3 -1
- package/dist/BlockNoteEditor-RWRVIEZC.js.map +0 -1
- package/dist/chunk-2IRWQVG4.js.map +0 -1
- package/dist/chunk-CFECWLHH.mjs.map +0 -1
- package/dist/chunk-RXXZGPC3.js.map +0 -1
- package/dist/chunk-VLDLERJN.js.map +0 -1
- package/dist/chunk-WSOPEIRP.mjs.map +0 -1
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__name
|
|
3
|
+
} from "./chunk-PAWJFY3S.mjs";
|
|
4
|
+
|
|
5
|
+
// src/core/registry/helpStore.ts
|
|
6
|
+
var HELP_CONTENT_KEY = /* @__PURE__ */ Symbol.for("nextjs-jsonapi:helpContent");
|
|
7
|
+
var HELP_READER_KEY = /* @__PURE__ */ Symbol.for("nextjs-jsonapi:helpReader");
|
|
8
|
+
var globalStore = globalThis;
|
|
9
|
+
if (globalStore[HELP_CONTENT_KEY] === void 0) {
|
|
10
|
+
globalStore[HELP_CONTENT_KEY] = null;
|
|
11
|
+
}
|
|
12
|
+
if (globalStore[HELP_READER_KEY] === void 0) {
|
|
13
|
+
globalStore[HELP_READER_KEY] = null;
|
|
14
|
+
}
|
|
15
|
+
function _setStaticHelpContent(cfg) {
|
|
16
|
+
globalStore[HELP_CONTENT_KEY] = cfg;
|
|
17
|
+
}
|
|
18
|
+
__name(_setStaticHelpContent, "_setStaticHelpContent");
|
|
19
|
+
function _getStaticHelpContent() {
|
|
20
|
+
return globalStore[HELP_CONTENT_KEY] ?? null;
|
|
21
|
+
}
|
|
22
|
+
__name(_getStaticHelpContent, "_getStaticHelpContent");
|
|
23
|
+
function setHelpReader(reader) {
|
|
24
|
+
globalStore[HELP_READER_KEY] = reader;
|
|
25
|
+
}
|
|
26
|
+
__name(setHelpReader, "setHelpReader");
|
|
27
|
+
function _getStaticHelpReader() {
|
|
28
|
+
return globalStore[HELP_READER_KEY] ?? null;
|
|
29
|
+
}
|
|
30
|
+
__name(_getStaticHelpReader, "_getStaticHelpReader");
|
|
31
|
+
|
|
32
|
+
export {
|
|
33
|
+
_setStaticHelpContent,
|
|
34
|
+
_getStaticHelpContent,
|
|
35
|
+
setHelpReader,
|
|
36
|
+
_getStaticHelpReader
|
|
37
|
+
};
|
|
38
|
+
//# sourceMappingURL=chunk-CQID6RCF.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/core/registry/helpStore.ts"],"sourcesContent":["/**\n * Centralized help-content store accessible from client and server contexts.\n * Uses globalThis Symbol keys to persist across HMR/Turbopack reloads and to\n * bridge between the client-side `configureJsonApi` (in `client/config.ts`)\n * and server-side consumers (HelpProvider, getHelpContent, serializeHelpArticle).\n *\n * NO external dependencies to avoid circular imports.\n *\n * Pattern mirrors `bootstrapStore.ts`.\n */\n\n// Help content config shape is duplicated here as `unknown` to avoid pulling\n// the help feature into this core file. Callers cast on read.\ntype HelpReader = (article: { path: string }) => Promise<string>;\n\nconst HELP_CONTENT_KEY = Symbol.for(\"nextjs-jsonapi:helpContent\");\nconst HELP_READER_KEY = Symbol.for(\"nextjs-jsonapi:helpReader\");\n\nconst globalStore = globalThis as unknown as {\n [HELP_CONTENT_KEY]?: unknown | null;\n [HELP_READER_KEY]?: HelpReader | null;\n};\n\nif (globalStore[HELP_CONTENT_KEY] === undefined) {\n globalStore[HELP_CONTENT_KEY] = null;\n}\nif (globalStore[HELP_READER_KEY] === undefined) {\n globalStore[HELP_READER_KEY] = null;\n}\n\nexport function _setStaticHelpContent(cfg: unknown | null): void {\n globalStore[HELP_CONTENT_KEY] = cfg;\n}\n\nexport function _getStaticHelpContent<T = unknown>(): T | null {\n return (globalStore[HELP_CONTENT_KEY] as T | null) ?? null;\n}\n\nexport function setHelpReader(reader: HelpReader): void {\n globalStore[HELP_READER_KEY] = reader;\n}\n\nexport function _getStaticHelpReader(): HelpReader | null {\n return globalStore[HELP_READER_KEY] ?? null;\n}\n"],"mappings":";;;;;AAeA,IAAM,mBAAmB,uBAAO,IAAI,4BAA4B;AAChE,IAAM,kBAAkB,uBAAO,IAAI,2BAA2B;AAE9D,IAAM,cAAc;AAKpB,IAAI,YAAY,gBAAgB,MAAM,QAAW;AAC/C,cAAY,gBAAgB,IAAI;AAClC;AACA,IAAI,YAAY,eAAe,MAAM,QAAW;AAC9C,cAAY,eAAe,IAAI;AACjC;AAEO,SAAS,sBAAsB,KAA2B;AAC/D,cAAY,gBAAgB,IAAI;AAClC;AAFgB;AAIT,SAAS,wBAA+C;AAC7D,SAAQ,YAAY,gBAAgB,KAAkB;AACxD;AAFgB;AAIT,SAAS,cAAc,QAA0B;AACtD,cAAY,eAAe,IAAI;AACjC;AAFgB;AAIT,SAAS,uBAA0C;AACxD,SAAO,YAAY,eAAe,KAAK;AACzC;AAFgB;","names":[]}
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
useI18nLocale,
|
|
21
21
|
useI18nRouter,
|
|
22
22
|
useI18nTranslations
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-UOYIWJEJ.mjs";
|
|
24
24
|
import {
|
|
25
25
|
AVAILABLE_OAUTH_SCOPES,
|
|
26
26
|
AssistantMessage,
|
|
@@ -60,7 +60,7 @@ import {
|
|
|
60
60
|
showToast,
|
|
61
61
|
useComposedRefs,
|
|
62
62
|
useIsMobile
|
|
63
|
-
} from "./chunk-
|
|
63
|
+
} from "./chunk-MSNNAHDB.mjs";
|
|
64
64
|
import {
|
|
65
65
|
JsonApiContext
|
|
66
66
|
} from "./chunk-VOXD3ZLY.mjs";
|
|
@@ -1958,6 +1958,7 @@ function ContextMenuContent({
|
|
|
1958
1958
|
alignOffset = 4,
|
|
1959
1959
|
side = "right",
|
|
1960
1960
|
sideOffset = 0,
|
|
1961
|
+
anchor,
|
|
1961
1962
|
...props
|
|
1962
1963
|
}) {
|
|
1963
1964
|
return /* @__PURE__ */ jsx19(ContextMenuPrimitive.Portal, { children: /* @__PURE__ */ jsx19(
|
|
@@ -1968,6 +1969,7 @@ function ContextMenuContent({
|
|
|
1968
1969
|
alignOffset,
|
|
1969
1970
|
side,
|
|
1970
1971
|
sideOffset,
|
|
1972
|
+
anchor,
|
|
1971
1973
|
children: /* @__PURE__ */ jsx19(
|
|
1972
1974
|
ContextMenuPrimitive.Popup,
|
|
1973
1975
|
{
|
|
@@ -2958,6 +2960,7 @@ function PopoverContent({
|
|
|
2958
2960
|
alignOffset = 0,
|
|
2959
2961
|
side = "bottom",
|
|
2960
2962
|
sideOffset = 4,
|
|
2963
|
+
anchor,
|
|
2961
2964
|
...props
|
|
2962
2965
|
}) {
|
|
2963
2966
|
return /* @__PURE__ */ jsx28(PopoverPrimitive.Portal, { children: /* @__PURE__ */ jsx28(
|
|
@@ -2967,6 +2970,7 @@ function PopoverContent({
|
|
|
2967
2970
|
alignOffset,
|
|
2968
2971
|
side,
|
|
2969
2972
|
sideOffset,
|
|
2973
|
+
anchor,
|
|
2970
2974
|
className: "isolate z-50",
|
|
2971
2975
|
children: /* @__PURE__ */ jsx28(
|
|
2972
2976
|
PopoverPrimitive.Popup,
|
|
@@ -9588,7 +9592,7 @@ import { useRef as useRef15 } from "react";
|
|
|
9588
9592
|
import dynamic from "next/dynamic";
|
|
9589
9593
|
import React15 from "react";
|
|
9590
9594
|
import { jsx as jsx74 } from "react/jsx-runtime";
|
|
9591
|
-
var BlockNoteEditor = dynamic(() => import("./BlockNoteEditor-
|
|
9595
|
+
var BlockNoteEditor = dynamic(() => import("./BlockNoteEditor-EBFZG7AL.mjs"), {
|
|
9592
9596
|
ssr: false
|
|
9593
9597
|
});
|
|
9594
9598
|
var BlockNoteEditorContainer = React15.memo(/* @__PURE__ */ __name(function EditorContainer(props) {
|
|
@@ -13103,7 +13107,7 @@ import { createContext as createContext16, useCallback as useCallback24, useCont
|
|
|
13103
13107
|
import { jsx as jsx133 } from "react/jsx-runtime";
|
|
13104
13108
|
var AssistantContext = createContext16(void 0);
|
|
13105
13109
|
function stripOptimistic(list) {
|
|
13106
|
-
return list.filter((m) => !m.
|
|
13110
|
+
return list.filter((m) => !m.isOptimistic);
|
|
13107
13111
|
}
|
|
13108
13112
|
__name(stripOptimistic, "stripOptimistic");
|
|
13109
13113
|
function nextPosition(list) {
|
|
@@ -13121,7 +13125,7 @@ function withPatchedTitle(source, title) {
|
|
|
13121
13125
|
});
|
|
13122
13126
|
}
|
|
13123
13127
|
__name(withPatchedTitle, "withPatchedTitle");
|
|
13124
|
-
function AssistantProvider({ children, dehydratedAssistant, dehydratedMessages }) {
|
|
13128
|
+
function AssistantProvider({ children, dehydratedAssistant, dehydratedMessages, manageUrl = true }) {
|
|
13125
13129
|
const t = useTranslations45();
|
|
13126
13130
|
const generateUrl = usePageUrlGenerator();
|
|
13127
13131
|
const [assistant, setAssistant] = useState41(
|
|
@@ -13137,7 +13141,7 @@ function AssistantProvider({ children, dehydratedAssistant, dehydratedMessages }
|
|
|
13137
13141
|
const [failedMessageIds, setFailedMessageIds] = useState41(() => /* @__PURE__ */ new Set());
|
|
13138
13142
|
const { socket } = useSocketContext();
|
|
13139
13143
|
const sendMessage = useCallback24(
|
|
13140
|
-
async (content) => {
|
|
13144
|
+
async (content, opts) => {
|
|
13141
13145
|
const trimmed = content.trim();
|
|
13142
13146
|
if (!trimmed) return;
|
|
13143
13147
|
const optimistic = AssistantMessage.buildOptimistic({
|
|
@@ -13155,18 +13159,24 @@ function AssistantProvider({ children, dehydratedAssistant, dehydratedMessages }
|
|
|
13155
13159
|
socket?.on("assistant:status", handler);
|
|
13156
13160
|
try {
|
|
13157
13161
|
if (!assistant) {
|
|
13158
|
-
const created = await AssistantService.create({
|
|
13162
|
+
const created = await AssistantService.create({
|
|
13163
|
+
firstMessage: trimmed,
|
|
13164
|
+
howToMode: opts?.howToMode,
|
|
13165
|
+
limitToHowToId: opts?.limitToHowToId
|
|
13166
|
+
});
|
|
13159
13167
|
const msgs = await AssistantMessageService.findByAssistant({ assistantId: created.id });
|
|
13160
13168
|
setAssistant(created);
|
|
13161
13169
|
setMessages(msgs);
|
|
13162
13170
|
setThreads((prev) => [created, ...prev]);
|
|
13163
|
-
if (typeof window !== "undefined") {
|
|
13171
|
+
if (manageUrl && typeof window !== "undefined") {
|
|
13164
13172
|
window.history.replaceState(null, "", `/assistants/${created.id}`);
|
|
13165
13173
|
}
|
|
13166
13174
|
} else {
|
|
13167
13175
|
const result = await AssistantService.appendMessage({
|
|
13168
13176
|
assistantId: assistant.id,
|
|
13169
|
-
content: trimmed
|
|
13177
|
+
content: trimmed,
|
|
13178
|
+
howToMode: opts?.howToMode,
|
|
13179
|
+
limitToHowToId: opts?.limitToHowToId
|
|
13170
13180
|
});
|
|
13171
13181
|
setMessages((prev) => [...stripOptimistic(prev), ...result]);
|
|
13172
13182
|
}
|
|
@@ -13199,17 +13209,20 @@ function AssistantProvider({ children, dehydratedAssistant, dehydratedMessages }
|
|
|
13199
13209
|
},
|
|
13200
13210
|
[messages, sendMessage]
|
|
13201
13211
|
);
|
|
13202
|
-
const selectThread = useCallback24(
|
|
13203
|
-
|
|
13204
|
-
|
|
13205
|
-
|
|
13206
|
-
|
|
13207
|
-
|
|
13208
|
-
|
|
13209
|
-
|
|
13210
|
-
|
|
13211
|
-
|
|
13212
|
-
|
|
13212
|
+
const selectThread = useCallback24(
|
|
13213
|
+
async (id) => {
|
|
13214
|
+
const [target, msgs] = await Promise.all([
|
|
13215
|
+
AssistantService.findOne({ id }),
|
|
13216
|
+
AssistantMessageService.findByAssistant({ assistantId: id })
|
|
13217
|
+
]);
|
|
13218
|
+
setAssistant(target);
|
|
13219
|
+
setMessages(msgs);
|
|
13220
|
+
if (manageUrl && typeof window !== "undefined") {
|
|
13221
|
+
window.history.replaceState(null, "", `/assistants/${id}`);
|
|
13222
|
+
}
|
|
13223
|
+
},
|
|
13224
|
+
[manageUrl]
|
|
13225
|
+
);
|
|
13213
13226
|
const renameThread = useCallback24(async (id, title2) => {
|
|
13214
13227
|
await AssistantService.rename({ id, title: title2 });
|
|
13215
13228
|
setAssistant((prev) => prev && prev.id === id ? withPatchedTitle(prev, title2) : prev);
|
|
@@ -13219,10 +13232,10 @@ function AssistantProvider({ children, dehydratedAssistant, dehydratedMessages }
|
|
|
13219
13232
|
setAssistant(void 0);
|
|
13220
13233
|
setMessages([]);
|
|
13221
13234
|
setFailedMessageIds(/* @__PURE__ */ new Set());
|
|
13222
|
-
if (typeof window !== "undefined") {
|
|
13235
|
+
if (manageUrl && typeof window !== "undefined") {
|
|
13223
13236
|
window.history.replaceState(null, "", "/assistants");
|
|
13224
13237
|
}
|
|
13225
|
-
}, []);
|
|
13238
|
+
}, [manageUrl]);
|
|
13226
13239
|
const deleteThread = useCallback24(async (id) => {
|
|
13227
13240
|
await AssistantService.delete({ id });
|
|
13228
13241
|
setThreads((prev) => prev.filter((t2) => t2.id !== id));
|
|
@@ -18640,7 +18653,8 @@ function ReferencesTab({ references }) {
|
|
|
18640
18653
|
} catch {
|
|
18641
18654
|
return null;
|
|
18642
18655
|
}
|
|
18643
|
-
const
|
|
18656
|
+
const helpContentSlug = ref.helpContentSlug;
|
|
18657
|
+
const href = helpContentSlug ? `/help/${helpContentSlug}` : generate({ page: module, id: ref.id });
|
|
18644
18658
|
return /* @__PURE__ */ jsxs126(TableRow, { children: [
|
|
18645
18659
|
/* @__PURE__ */ jsx209(TableCell, { children: /* @__PURE__ */ jsx209(Link4, { href, target: "_blank", rel: "noopener noreferrer", className: "font-medium", children: ref.identifier }) }),
|
|
18646
18660
|
/* @__PURE__ */ jsx209(TableCell, { className: "text-muted-foreground text-xs", children: module.name })
|
|
@@ -18783,7 +18797,8 @@ function ContentsTab({ citations, sources }) {
|
|
|
18783
18797
|
} catch {
|
|
18784
18798
|
return null;
|
|
18785
18799
|
}
|
|
18786
|
-
const
|
|
18800
|
+
const helpContentSlug = source.helpContentSlug;
|
|
18801
|
+
const href = helpContentSlug ? `/help/${helpContentSlug}` : generate({ page: module, id: source.id });
|
|
18787
18802
|
const name = source.name ?? source.identifier;
|
|
18788
18803
|
return /* @__PURE__ */ jsxs129(TableRow, { children: [
|
|
18789
18804
|
/* @__PURE__ */ jsx212(TableCell, { children: /* @__PURE__ */ jsxs129(Link5, { href, target: "_blank", rel: "noopener noreferrer", children: [
|
|
@@ -18919,10 +18934,11 @@ function MessageSourcesPanel({ message, isLatestAssistant, onSelectFollowUp, sou
|
|
|
18919
18934
|
const citationsCount = message.citations.length;
|
|
18920
18935
|
const suggestionsCount = isLatestAssistant ? message.suggestedQuestions.length : 0;
|
|
18921
18936
|
const contentsCount = useMemo31(() => {
|
|
18922
|
-
if (sources) return sources.size;
|
|
18923
18937
|
const ids = /* @__PURE__ */ new Set();
|
|
18924
18938
|
for (const c of message.citations) {
|
|
18925
|
-
if (c.nodeId)
|
|
18939
|
+
if (!c.nodeId) continue;
|
|
18940
|
+
if (sources && !sources.has(c.nodeId)) continue;
|
|
18941
|
+
ids.add(c.nodeId);
|
|
18926
18942
|
}
|
|
18927
18943
|
return ids.size;
|
|
18928
18944
|
}, [message.citations, sources]);
|
|
@@ -22458,9 +22474,12 @@ export {
|
|
|
22458
22474
|
HowToSelector,
|
|
22459
22475
|
AssistantProvider,
|
|
22460
22476
|
useAssistantContext,
|
|
22477
|
+
AssistantComposer,
|
|
22478
|
+
AssistantEmptyState,
|
|
22461
22479
|
MessageSourcesPanel,
|
|
22462
22480
|
MessageItem,
|
|
22463
22481
|
MessageList,
|
|
22482
|
+
AssistantThread,
|
|
22464
22483
|
AssistantContainer,
|
|
22465
22484
|
NotificationErrorBoundary,
|
|
22466
22485
|
generateNotificationData,
|
|
@@ -22535,4 +22554,4 @@ export {
|
|
|
22535
22554
|
useOAuthClients,
|
|
22536
22555
|
useOAuthClient
|
|
22537
22556
|
};
|
|
22538
|
-
//# sourceMappingURL=chunk-
|
|
22557
|
+
//# sourceMappingURL=chunk-CRTVAQEK.mjs.map
|