@burtson-labs/bandit-engine 2.1.7 → 2.1.9

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 (89) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/dist/AdvancedTab-D7SDAQEL.mjs +229 -0
  3. package/dist/AdvancedTab-D7SDAQEL.mjs.map +1 -0
  4. package/dist/CrewSection-N2J3TJGU.mjs +15 -0
  5. package/dist/InstructionsTab-MKOGBQ5L.mjs +195 -0
  6. package/dist/InstructionsTab-MKOGBQ5L.mjs.map +1 -0
  7. package/dist/PersonalizationTab-KPTVJKB3.mjs +179 -0
  8. package/dist/PersonalizationTab-KPTVJKB3.mjs.map +1 -0
  9. package/dist/{ProjectsPane-E5D72PUG.mjs → ProjectsPane-C63C6GW5.mjs} +17 -13
  10. package/dist/ProjectsPane-C63C6GW5.mjs.map +1 -0
  11. package/dist/{SchedulesTab-AKJ6WFZV.mjs → SchedulesTab-TEOM3NWQ.mjs} +13 -11
  12. package/dist/SchedulesTab-TEOM3NWQ.mjs.map +1 -0
  13. package/dist/{aiProviderStore-ANPQVHGD.mjs → aiProviderStore-GH4JZTMW.mjs} +3 -2
  14. package/dist/chat-QAEEYO73.mjs +29 -0
  15. package/dist/chunk-3CDCJJ4S.mjs +64 -0
  16. package/dist/chunk-3CDCJJ4S.mjs.map +1 -0
  17. package/dist/chunk-5JNKGMMN.mjs +5871 -0
  18. package/dist/chunk-5JNKGMMN.mjs.map +1 -0
  19. package/dist/{chunk-KWOUXBSF.mjs → chunk-5LXCZJLJ.mjs} +5 -213
  20. package/dist/chunk-5LXCZJLJ.mjs.map +1 -0
  21. package/dist/{chunk-GX4FVZNA.mjs → chunk-DHXSFFLX.mjs} +4 -26
  22. package/dist/chunk-DHXSFFLX.mjs.map +1 -0
  23. package/dist/chunk-F56OTXXR.mjs +17 -0
  24. package/dist/chunk-F56OTXXR.mjs.map +1 -0
  25. package/dist/{chunk-SQJ4OKWM.mjs → chunk-GN3X7IIZ.mjs} +18 -1734
  26. package/dist/chunk-GN3X7IIZ.mjs.map +1 -0
  27. package/dist/chunk-H2XUGGKV.mjs +168 -0
  28. package/dist/chunk-H2XUGGKV.mjs.map +1 -0
  29. package/dist/{chunk-4NUQYUZH.mjs → chunk-JGJRY4MR.mjs} +7 -569
  30. package/dist/chunk-JGJRY4MR.mjs.map +1 -0
  31. package/dist/chunk-KPT7NNNK.mjs +214 -0
  32. package/dist/chunk-KPT7NNNK.mjs.map +1 -0
  33. package/dist/chunk-LC64VSDS.mjs +541 -0
  34. package/dist/chunk-LC64VSDS.mjs.map +1 -0
  35. package/dist/{chunk-DH5A2HT2.mjs → chunk-LY3O7UWA.mjs} +45 -1
  36. package/dist/chunk-LY3O7UWA.mjs.map +1 -0
  37. package/dist/chunk-MR643IO6.mjs +294 -0
  38. package/dist/chunk-MR643IO6.mjs.map +1 -0
  39. package/dist/{chunk-4NHPLHXU.mjs → chunk-MX37LD3Z.mjs} +5469 -11527
  40. package/dist/chunk-MX37LD3Z.mjs.map +1 -0
  41. package/dist/chunk-MX7Z4RSP.mjs +1203 -0
  42. package/dist/chunk-MX7Z4RSP.mjs.map +1 -0
  43. package/dist/chunk-P42M52OW.mjs +1732 -0
  44. package/dist/chunk-P42M52OW.mjs.map +1 -0
  45. package/dist/{chunk-5URP2E5V.mjs → chunk-UT46TXNG.mjs} +42 -6
  46. package/dist/chunk-UT46TXNG.mjs.map +1 -0
  47. package/dist/{chunk-2HFSBPOE.mjs → chunk-WDFQG3RM.mjs} +21 -1
  48. package/dist/chunk-WDFQG3RM.mjs.map +1 -0
  49. package/dist/chunk-XWUHUDAV.mjs +814 -0
  50. package/dist/chunk-XWUHUDAV.mjs.map +1 -0
  51. package/dist/chunk-Y272M3D5.mjs +28 -0
  52. package/dist/chunk-Y272M3D5.mjs.map +1 -0
  53. package/dist/chunk-YY7BX2HM.mjs +566 -0
  54. package/dist/chunk-YY7BX2HM.mjs.map +1 -0
  55. package/dist/crew-delegate-card-I4SSZU5H.mjs +229 -0
  56. package/dist/crew-delegate-card-I4SSZU5H.mjs.map +1 -0
  57. package/dist/crew-mention-picker-OSJ2NHUB.mjs +118 -0
  58. package/dist/crew-mention-picker-OSJ2NHUB.mjs.map +1 -0
  59. package/dist/crew-task-card-ZCXFTR34.mjs +416 -0
  60. package/dist/crew-task-card-ZCXFTR34.mjs.map +1 -0
  61. package/dist/index.d.mts +121 -8
  62. package/dist/index.d.ts +121 -8
  63. package/dist/index.js +11313 -8127
  64. package/dist/index.js.map +1 -1
  65. package/dist/index.mjs +1222 -2217
  66. package/dist/index.mjs.map +1 -1
  67. package/dist/{modelStore-YNANSWCN.mjs → modelStore-KO45QAO2.mjs} +3 -2
  68. package/dist/modelStore-KO45QAO2.mjs.map +1 -0
  69. package/dist/{public-Tq2Pmw9m.d.mts → public-_W_Zew3C.d.mts} +14 -0
  70. package/dist/{public-Tq2Pmw9m.d.ts → public-_W_Zew3C.d.ts} +14 -0
  71. package/dist/public-types.d.mts +1 -1
  72. package/dist/public-types.d.ts +1 -1
  73. package/dist/{schedule-confirm-card-D4K76HEA.mjs → schedule-confirm-card-Y2JF2RBV.mjs} +5 -5
  74. package/package.json +1 -1
  75. package/dist/ProjectsPane-E5D72PUG.mjs.map +0 -1
  76. package/dist/SchedulesTab-AKJ6WFZV.mjs.map +0 -1
  77. package/dist/chat-MI4IL3WK.mjs +0 -19
  78. package/dist/chunk-2HFSBPOE.mjs.map +0 -1
  79. package/dist/chunk-4NHPLHXU.mjs.map +0 -1
  80. package/dist/chunk-4NUQYUZH.mjs.map +0 -1
  81. package/dist/chunk-5URP2E5V.mjs.map +0 -1
  82. package/dist/chunk-DH5A2HT2.mjs.map +0 -1
  83. package/dist/chunk-GX4FVZNA.mjs.map +0 -1
  84. package/dist/chunk-KWOUXBSF.mjs.map +0 -1
  85. package/dist/chunk-SQJ4OKWM.mjs.map +0 -1
  86. /package/dist/{aiProviderStore-ANPQVHGD.mjs.map → CrewSection-N2J3TJGU.mjs.map} +0 -0
  87. /package/dist/{chat-MI4IL3WK.mjs.map → aiProviderStore-GH4JZTMW.mjs.map} +0 -0
  88. /package/dist/{modelStore-YNANSWCN.mjs.map → chat-QAEEYO73.mjs.map} +0 -0
  89. /package/dist/{schedule-confirm-card-D4K76HEA.mjs.map → schedule-confirm-card-Y2JF2RBV.mjs.map} +0 -0
package/CHANGELOG.md CHANGED
@@ -2,6 +2,26 @@
2
2
 
3
3
  Notable changes to `@burtson-labs/bandit-engine`. Versions follow semver.
4
4
 
5
+ ## 2.1.9
6
+
7
+ ### Crew
8
+
9
+ - Hand work to a Bandit from the chat ("@Riley …" picker and the delegate_to_bandit tool, always behind a confirm card) and follow it in a live task card: steps, Approve/Decline, Stop, result with Stash link. Settings → Crew gets Bandits and Tasks views and a Connected workspaces panel (Slack workspaces and Microsoft Teams tenants bound to the organization; Add to Slack, claim, disconnect). The sections sidebar gets a Crew row.
10
+
11
+ ## 2.1.8
12
+
13
+ ### Management (web console; the native shells are unchanged)
14
+
15
+ - Personalities are retired from the web console in favour of two plain layers: **Assistant instructions** (Settings → Workspace; one standing prompt for everyone) and each person's **Custom instructions** (Settings → You → Personalization: "What should Bandit know about you?" and "How would you like Bandit to respond?", 1,500 characters each). Together they form the PERSONA block of the system prompt, where the active personality's prompt went. Stored personality records are not touched; the active one's prompt is still read as the fallback for one release, and a customized active personality is copied into that browser's Custom instructions once (`migrations.customInstructionsFromPersonality`). The voice greeting says the workspace's name (or Bandit) instead of a personality name. `useInstructionsStore`, `composePersonaPrompt` and `planPersonalityMigration` are exported.
16
+ - **What Bandit remembers** is a page: the Memories modal's body is now `MemoryManager` (exported), rendered under Personalization with the memory on/off switch, search, edit, pin, delete, select-several and clear-by-kind. Local edits and per-kind clears are persisted (the modal changed them in memory only). The sidebar's "Memories" entries open the page on the web; native keeps the sheet.
17
+ - **Crew** is its own section, and a new **Advanced** section holds the model provider page, service status and the workspace Export / Import / Reset. Import now MERGES by default (add or replace by name, delete nothing); "Replace everything" sits behind a confirmation. Exports carry `assistantInstructions` (`version: 2`); older files import unchanged. Importing branding no longer drops the active personality from the `main` record.
18
+ - "Include Bandit personalities" and "Restore deleted Bandit personalities" leave Preferences on the web (they edited the workspace's list from a personal page).
19
+ - "Reset all storage" confirms in a dialog that lists exactly what is deleted, including that it clears the saved sign-in and reloads.
20
+
21
+ ### Deprecations
22
+
23
+ - `ChatModal` (and `ChatModalProps`) are deprecated and will be removed in 3.0. The floating assistant sends the raw personality prompt without the core rules, memory, project context or the Engine picker's model; embed `Chat` instead. The native shells still render it on Management; nothing else in the engine uses it.
24
+
5
25
  ## 2.1.7
6
26
 
7
27
  ### Management
@@ -0,0 +1,229 @@
1
+ import {
2
+ ProviderTab,
3
+ ServiceStatusCard
4
+ } from "./chunk-MX7Z4RSP.mjs";
5
+ import "./chunk-LC64VSDS.mjs";
6
+ import {
7
+ Download,
8
+ FileUp,
9
+ RotateCcw
10
+ } from "./chunk-YY7BX2HM.mjs";
11
+ import {
12
+ ManagementCard
13
+ } from "./chunk-LY3O7UWA.mjs";
14
+ import "./chunk-DHXSFFLX.mjs";
15
+ import "./chunk-Y272M3D5.mjs";
16
+ import "./chunk-KPT7NNNK.mjs";
17
+ import "./chunk-K7SQWDNF.mjs";
18
+ import "./chunk-S3DWWUBD.mjs";
19
+ import "./chunk-NI7BKLC7.mjs";
20
+ import "./chunk-WDFQG3RM.mjs";
21
+
22
+ // src/management/components/AdvancedTab.tsx
23
+ import { Stack as Stack2 } from "@mui/material";
24
+
25
+ // src/management/components/WorkspaceConfigCard.tsx
26
+ import { useRef, useState } from "react";
27
+ import {
28
+ Button,
29
+ Dialog,
30
+ DialogActions,
31
+ DialogContent,
32
+ DialogContentText,
33
+ DialogTitle,
34
+ Stack,
35
+ Typography
36
+ } from "@mui/material";
37
+ import { jsx, jsxs } from "react/jsx-runtime";
38
+ var WorkspaceConfigCard = ({
39
+ onExport,
40
+ onImport,
41
+ onReset,
42
+ showSnackbar
43
+ }) => {
44
+ const inputRef = useRef(null);
45
+ const [mode, setMode] = useState("merge");
46
+ const [confirmReplace, setConfirmReplace] = useState(false);
47
+ const [confirmReset, setConfirmReset] = useState(false);
48
+ const [busy, setBusy] = useState(false);
49
+ const pick = (next) => {
50
+ setMode(next);
51
+ requestAnimationFrame(() => inputRef.current?.click());
52
+ };
53
+ const handleFile = async (event) => {
54
+ const input = event.target;
55
+ const file = input.files?.[0];
56
+ if (!file) return;
57
+ setBusy(true);
58
+ try {
59
+ const summary = await onImport(file, mode);
60
+ showSnackbar?.(summary, "success");
61
+ } catch (error) {
62
+ showSnackbar?.(
63
+ error instanceof Error && error.message ? `Couldn't import: ${error.message}` : "Couldn't import that file.",
64
+ "error"
65
+ );
66
+ } finally {
67
+ setBusy(false);
68
+ input.value = "";
69
+ }
70
+ };
71
+ const run = async (action, ok, failed) => {
72
+ setBusy(true);
73
+ try {
74
+ await action();
75
+ showSnackbar?.(ok, "success");
76
+ } catch {
77
+ showSnackbar?.(failed, "error");
78
+ } finally {
79
+ setBusy(false);
80
+ }
81
+ };
82
+ return /* @__PURE__ */ jsxs(
83
+ ManagementCard,
84
+ {
85
+ title: "Workspace configuration",
86
+ description: "Move branding, assistant instructions, personalities and local knowledge documents between workspaces, or start again.",
87
+ children: [
88
+ /* @__PURE__ */ jsxs(Stack, { spacing: 1.5, children: [
89
+ /* @__PURE__ */ jsxs(Stack, { direction: "row", sx: { flexWrap: "wrap", gap: 1 }, children: [
90
+ /* @__PURE__ */ jsx(
91
+ Button,
92
+ {
93
+ variant: "outlined",
94
+ startIcon: /* @__PURE__ */ jsx(Download, {}),
95
+ disabled: busy,
96
+ onClick: () => void run(
97
+ onExport,
98
+ "Workspace configuration exported.",
99
+ "Couldn't export the configuration."
100
+ ),
101
+ children: "Export"
102
+ }
103
+ ),
104
+ /* @__PURE__ */ jsx(
105
+ Button,
106
+ {
107
+ variant: "outlined",
108
+ startIcon: /* @__PURE__ */ jsx(FileUp, {}),
109
+ disabled: busy,
110
+ onClick: () => pick("merge"),
111
+ children: "Import"
112
+ }
113
+ ),
114
+ /* @__PURE__ */ jsx(
115
+ Button,
116
+ {
117
+ variant: "text",
118
+ color: "inherit",
119
+ disabled: busy,
120
+ onClick: () => setConfirmReplace(true),
121
+ children: "Replace everything\u2026"
122
+ }
123
+ ),
124
+ /* @__PURE__ */ jsx(
125
+ Button,
126
+ {
127
+ variant: "text",
128
+ color: "inherit",
129
+ startIcon: /* @__PURE__ */ jsx(RotateCcw, {}),
130
+ disabled: busy,
131
+ onClick: () => setConfirmReset(true),
132
+ children: "Reset to defaults\u2026"
133
+ }
134
+ ),
135
+ /* @__PURE__ */ jsx(
136
+ "input",
137
+ {
138
+ ref: inputRef,
139
+ type: "file",
140
+ accept: "application/json,.json",
141
+ hidden: true,
142
+ "aria-label": "Workspace configuration file",
143
+ onChange: (e) => void handleFile(e)
144
+ }
145
+ )
146
+ ] }),
147
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "text.secondary", children: "Import adds what's in the file and replaces items with the same name; nothing is deleted. Replace everything also removes personalities and local documents the file doesn't list." })
148
+ ] }),
149
+ /* @__PURE__ */ jsxs(Dialog, { open: confirmReplace, onClose: () => setConfirmReplace(false), children: [
150
+ /* @__PURE__ */ jsx(DialogTitle, { children: "Replace everything from a file?" }),
151
+ /* @__PURE__ */ jsx(DialogContent, { children: /* @__PURE__ */ jsx(DialogContentText, { children: "The file becomes the whole configuration for what it contains: personalities it doesn't list are deleted, and local knowledge documents are emptied before the file's are added. Branding and assistant instructions in the file overwrite the current ones. This can't be undone; export first if you may want to go back." }) }),
152
+ /* @__PURE__ */ jsxs(DialogActions, { children: [
153
+ /* @__PURE__ */ jsx(Button, { onClick: () => setConfirmReplace(false), children: "Cancel" }),
154
+ /* @__PURE__ */ jsx(
155
+ Button,
156
+ {
157
+ color: "error",
158
+ variant: "contained",
159
+ onClick: () => {
160
+ setConfirmReplace(false);
161
+ pick("replace");
162
+ },
163
+ children: "Choose file and replace"
164
+ }
165
+ )
166
+ ] })
167
+ ] }),
168
+ /* @__PURE__ */ jsxs(Dialog, { open: confirmReset, onClose: () => setConfirmReset(false), children: [
169
+ /* @__PURE__ */ jsx(DialogTitle, { children: "Reset branding to defaults?" }),
170
+ /* @__PURE__ */ jsx(DialogContent, { children: /* @__PURE__ */ jsx(DialogContentText, { children: "Name, logo and theme go back to this deployment's defaults. Assistant instructions, personalities and knowledge documents are not touched." }) }),
171
+ /* @__PURE__ */ jsxs(DialogActions, { children: [
172
+ /* @__PURE__ */ jsx(Button, { onClick: () => setConfirmReset(false), children: "Cancel" }),
173
+ /* @__PURE__ */ jsx(
174
+ Button,
175
+ {
176
+ color: "error",
177
+ variant: "contained",
178
+ onClick: () => {
179
+ setConfirmReset(false);
180
+ void run(
181
+ onReset,
182
+ "Branding reset to defaults.",
183
+ "Couldn't reset branding."
184
+ );
185
+ },
186
+ children: "Reset"
187
+ }
188
+ )
189
+ ] })
190
+ ] })
191
+ ]
192
+ }
193
+ );
194
+ };
195
+
196
+ // src/management/components/AdvancedTab.tsx
197
+ import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
198
+ var AdvancedTab = ({
199
+ packageSettings,
200
+ showProvider,
201
+ onExport,
202
+ onImport,
203
+ onReset,
204
+ showSnackbar
205
+ }) => /* @__PURE__ */ jsxs2(Stack2, { spacing: 2, children: [
206
+ showProvider && /* @__PURE__ */ jsx2(
207
+ ManagementCard,
208
+ {
209
+ title: "Model provider",
210
+ description: "The model service chat requests go to. Gateway is the default; OpenAI, Ollama and others are options.",
211
+ children: /* @__PURE__ */ jsx2(ProviderTab, {})
212
+ }
213
+ ),
214
+ /* @__PURE__ */ jsx2(ServiceStatusCard, { packageSettings }),
215
+ /* @__PURE__ */ jsx2(
216
+ WorkspaceConfigCard,
217
+ {
218
+ onExport,
219
+ onImport,
220
+ onReset,
221
+ showSnackbar
222
+ }
223
+ )
224
+ ] });
225
+ var AdvancedTab_default = AdvancedTab;
226
+ export {
227
+ AdvancedTab_default as default
228
+ };
229
+ //# sourceMappingURL=AdvancedTab-D7SDAQEL.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/management/components/AdvancedTab.tsx","../src/management/components/WorkspaceConfigCard.tsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAOA,SAAS,SAAAA,cAAa;;;ACDtB,SAAgB,QAAQ,gBAAgB;AACxC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AA8EC,SAGe,KAHf;AA1DD,IAAM,sBAA0D,CAAC;AAAA,EACtE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAM;AACJ,QAAM,WAAW,OAAyB,IAAI;AAC9C,QAAM,CAAC,MAAM,OAAO,IAAI,SAA2B,OAAO;AAC1D,QAAM,CAAC,gBAAgB,iBAAiB,IAAI,SAAS,KAAK;AAC1D,QAAM,CAAC,cAAc,eAAe,IAAI,SAAS,KAAK;AACtD,QAAM,CAAC,MAAM,OAAO,IAAI,SAAS,KAAK;AAEtC,QAAM,OAAO,CAAC,SAA2B;AACvC,YAAQ,IAAI;AAEZ,0BAAsB,MAAM,SAAS,SAAS,MAAM,CAAC;AAAA,EACvD;AAEA,QAAM,aAAa,OAAO,UAA+C;AACvE,UAAM,QAAQ,MAAM;AACpB,UAAM,OAAO,MAAM,QAAQ,CAAC;AAC5B,QAAI,CAAC,KAAM;AACX,YAAQ,IAAI;AACZ,QAAI;AACF,YAAM,UAAU,MAAM,SAAS,MAAM,IAAI;AACzC,qBAAe,SAAS,SAAS;AAAA,IACnC,SAAS,OAAO;AACd;AAAA,QACE,iBAAiB,SAAS,MAAM,UAC5B,oBAAoB,MAAM,OAAO,KACjC;AAAA,QACJ;AAAA,MACF;AAAA,IACF,UAAE;AACA,cAAQ,KAAK;AAEb,YAAM,QAAQ;AAAA,IAChB;AAAA,EACF;AAEA,QAAM,MAAM,OAAO,QAAoC,IAAY,WAAmB;AACpF,YAAQ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AA;AAAA,MACC,OAAM;AAAA,MACN,aAAY;AAAA,MAEZ,0BAAAA,KAAC,eAAY;AAAA;AAAA,EACf;AAAA,EAEF,gBAAAA,KAAC,qBAAkB,iBAAkC;AAAA,EACrD,gBAAAA;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA;AAAA,EACF;AAAA,GACF;AAGF,IAAO,sBAAQ;","names":["Stack","jsx","jsxs","Stack"]}
@@ -0,0 +1,15 @@
1
+ import {
2
+ CrewSection_default
3
+ } from "./chunk-XWUHUDAV.mjs";
4
+ import "./chunk-3CDCJJ4S.mjs";
5
+ import "./chunk-YY7BX2HM.mjs";
6
+ import "./chunk-MR643IO6.mjs";
7
+ import "./chunk-F56OTXXR.mjs";
8
+ import "./chunk-K7SQWDNF.mjs";
9
+ import "./chunk-S3DWWUBD.mjs";
10
+ import "./chunk-NI7BKLC7.mjs";
11
+ import "./chunk-WDFQG3RM.mjs";
12
+ export {
13
+ CrewSection_default as default
14
+ };
15
+ //# sourceMappingURL=CrewSection-N2J3TJGU.mjs.map
@@ -0,0 +1,195 @@
1
+ import {
2
+ ASSISTANT_INSTRUCTIONS_LIMIT,
3
+ DEFAULT_ASSISTANT_INSTRUCTIONS,
4
+ useInstructionsStore
5
+ } from "./chunk-H2XUGGKV.mjs";
6
+ import {
7
+ ManagementCard
8
+ } from "./chunk-LY3O7UWA.mjs";
9
+ import {
10
+ useModelStore
11
+ } from "./chunk-5LXCZJLJ.mjs";
12
+ import "./chunk-KPT7NNNK.mjs";
13
+ import "./chunk-K7SQWDNF.mjs";
14
+ import "./chunk-NI7BKLC7.mjs";
15
+
16
+ // src/management/components/InstructionsTab.tsx
17
+ import { useEffect, useState } from "react";
18
+ import {
19
+ Alert,
20
+ Box,
21
+ Button,
22
+ Collapse,
23
+ Stack,
24
+ TextField,
25
+ Typography
26
+ } from "@mui/material";
27
+ import { jsx, jsxs } from "react/jsx-runtime";
28
+ var InstructionsTab = ({ showSnackbar }) => {
29
+ const hydrated = useInstructionsStore((state) => state.hydrated);
30
+ const saved = useInstructionsStore((state) => state.assistant);
31
+ const hydrate = useInstructionsStore((state) => state.hydrate);
32
+ const saveAssistantInstructions = useInstructionsStore(
33
+ (state) => state.saveAssistantInstructions
34
+ );
35
+ const migration = useInstructionsStore((state) => state.migration);
36
+ const activePersonality = useModelStore(
37
+ (state) => state.availableModels.find((m) => m.name === state.selectedModel)
38
+ );
39
+ const [draft, setDraft] = useState(saved);
40
+ const [saving, setSaving] = useState(false);
41
+ const [showDefault, setShowDefault] = useState(false);
42
+ useEffect(() => {
43
+ if (!hydrated) void hydrate();
44
+ }, [hydrated, hydrate]);
45
+ useEffect(() => {
46
+ setDraft(saved);
47
+ }, [saved]);
48
+ const dirty = draft !== saved;
49
+ const over = draft.length > ASSISTANT_INSTRUCTIONS_LIMIT;
50
+ const legacyPrompt = activePersonality?.systemPrompt?.trim() ?? "";
51
+ const legacyInUse = !saved.trim() && legacyPrompt.length > 0 && legacyPrompt !== DEFAULT_ASSISTANT_INSTRUCTIONS.trim() && !migration?.from;
52
+ const save = async (text) => {
53
+ setSaving(true);
54
+ try {
55
+ const ok = await saveAssistantInstructions(text.trim());
56
+ showSnackbar?.(
57
+ ok ? text.trim() ? "Assistant instructions saved. They apply to everyone's next message." : "Assistant instructions cleared. Bandit's default voice is back." : "Couldn't save the instructions. Try again.",
58
+ ok ? "success" : "error"
59
+ );
60
+ } finally {
61
+ setSaving(false);
62
+ }
63
+ };
64
+ return /* @__PURE__ */ jsx(Stack, { spacing: 2, sx: { maxWidth: 880 }, children: /* @__PURE__ */ jsx(
65
+ ManagementCard,
66
+ {
67
+ title: "Assistant instructions",
68
+ description: "How Bandit introduces itself and behaves for everyone here: its name, tone and standing rules. Each person's own Custom instructions are added after these.",
69
+ children: /* @__PURE__ */ jsxs(Stack, { spacing: 1.5, children: [
70
+ legacyInUse && /* @__PURE__ */ jsxs(
71
+ Alert,
72
+ {
73
+ severity: "info",
74
+ action: /* @__PURE__ */ jsx(
75
+ Button,
76
+ {
77
+ color: "inherit",
78
+ size: "small",
79
+ onClick: () => setDraft(legacyPrompt),
80
+ children: "Copy it here"
81
+ }
82
+ ),
83
+ children: [
84
+ "Chats still use the prompt of the personality that was active before",
85
+ activePersonality?.name ? ` (${activePersonality.name})` : "",
86
+ ". Copy it here to keep it, or write new instructions."
87
+ ]
88
+ }
89
+ ),
90
+ /* @__PURE__ */ jsx(
91
+ TextField,
92
+ {
93
+ label: "Instructions for everyone",
94
+ value: draft,
95
+ onChange: (e) => setDraft(e.target.value),
96
+ placeholder: "Leave empty to use Bandit's default voice. For example: You are the Acme assistant. Be concise and formal. Refer people to the IT desk for account problems.",
97
+ multiline: true,
98
+ minRows: 6,
99
+ maxRows: 24,
100
+ fullWidth: true,
101
+ disabled: !hydrated,
102
+ error: over,
103
+ inputProps: {
104
+ maxLength: Math.max(ASSISTANT_INSTRUCTIONS_LIMIT, draft.length)
105
+ },
106
+ helperText: over ? `Over the limit by ${(draft.length - ASSISTANT_INSTRUCTIONS_LIMIT).toLocaleString()} characters. Shorten it to keep adding.` : `${draft.length.toLocaleString()} / ${ASSISTANT_INSTRUCTIONS_LIMIT.toLocaleString()}`,
107
+ FormHelperTextProps: { sx: { textAlign: "right", mx: 0 } },
108
+ InputLabelProps: { shrink: true },
109
+ sx: { "& textarea": { lineHeight: 1.5 } }
110
+ }
111
+ ),
112
+ /* @__PURE__ */ jsxs(
113
+ Stack,
114
+ {
115
+ direction: { xs: "column-reverse", sm: "row" },
116
+ spacing: 1,
117
+ justifyContent: "space-between",
118
+ alignItems: { sm: "center" },
119
+ children: [
120
+ /* @__PURE__ */ jsx(
121
+ Button,
122
+ {
123
+ variant: "text",
124
+ color: "inherit",
125
+ onClick: () => setShowDefault((v) => !v),
126
+ "aria-expanded": showDefault,
127
+ sx: { alignSelf: { xs: "flex-start", sm: "center" } },
128
+ children: showDefault ? "Hide Bandit's default voice" : "Show Bandit's default voice"
129
+ }
130
+ ),
131
+ /* @__PURE__ */ jsxs(Stack, { direction: { xs: "column-reverse", sm: "row" }, spacing: 1, children: [
132
+ /* @__PURE__ */ jsx(
133
+ Button,
134
+ {
135
+ variant: "text",
136
+ color: "inherit",
137
+ onClick: () => setDraft(saved),
138
+ disabled: !dirty || saving,
139
+ children: "Discard"
140
+ }
141
+ ),
142
+ /* @__PURE__ */ jsx(
143
+ Button,
144
+ {
145
+ variant: "contained",
146
+ onClick: () => void save(draft),
147
+ disabled: !dirty || saving,
148
+ children: saving ? "Saving\u2026" : "Save instructions"
149
+ }
150
+ )
151
+ ] })
152
+ ]
153
+ }
154
+ ),
155
+ /* @__PURE__ */ jsx(Collapse, { in: showDefault, children: /* @__PURE__ */ jsxs(
156
+ Box,
157
+ {
158
+ sx: (theme) => ({
159
+ p: 1.5,
160
+ borderRadius: `${Number(theme.shape.borderRadius)}px`,
161
+ border: `1px dashed ${theme.palette.divider}`,
162
+ bgcolor: theme.palette.bandit?.surface.subtle ?? "transparent"
163
+ }),
164
+ children: [
165
+ /* @__PURE__ */ jsx(Typography, { variant: "body2", color: "text.secondary", sx: { mb: 1 }, children: "What answers when this page is empty and a person has written no Custom instructions of their own." }),
166
+ /* @__PURE__ */ jsx(
167
+ Typography,
168
+ {
169
+ component: "pre",
170
+ variant: "body2",
171
+ sx: { whiteSpace: "pre-wrap", fontFamily: "inherit", m: 0, mb: 1.5 },
172
+ children: DEFAULT_ASSISTANT_INSTRUCTIONS
173
+ }
174
+ ),
175
+ /* @__PURE__ */ jsx(
176
+ Button,
177
+ {
178
+ size: "small",
179
+ variant: "outlined",
180
+ onClick: () => setDraft(DEFAULT_ASSISTANT_INSTRUCTIONS),
181
+ children: "Start from the default"
182
+ }
183
+ )
184
+ ]
185
+ }
186
+ ) })
187
+ ] })
188
+ }
189
+ ) });
190
+ };
191
+ var InstructionsTab_default = InstructionsTab;
192
+ export {
193
+ InstructionsTab_default as default
194
+ };
195
+ //# sourceMappingURL=InstructionsTab-MKOGBQ5L.mjs.map
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I,EAAE,IAAI,EAAE,GAAG,gHAGlE;AAAA,cACA;AAAA,gBAAC;AAAA;AAAA,kBACC,WAAU;AAAA,kBACV,SAAQ;AAAA,kBACR,IAAI,EAAE,YAAY,YAAY,YAAY,WAAW,GAAG,GAAG,IAAI,IAAI;AAAA,kBAElE;AAAA;AAAA,cACH;AAAA,cACA;AAAA,gBAAC;AAAA;AAAA,kBACC,MAAK;AAAA,kBACL,SAAQ;AAAA,kBACR,SAAS,MAAM,SAAS,8BAA8B;AAAA,kBACvD;AAAA;AAAA,cAED;AAAA;AAAA;AAAA,QACF,GACF;AAAA,SACF;AAAA;AAAA,EACF,GACF;AAEJ;AAEA,IAAO,0BAAQ;","names":[]}
@@ -0,0 +1,179 @@
1
+ import {
2
+ MemoryManager
3
+ } from "./chunk-5JNKGMMN.mjs";
4
+ import "./chunk-YY7BX2HM.mjs";
5
+ import {
6
+ CUSTOM_INSTRUCTIONS_LIMITS,
7
+ useInstructionsStore
8
+ } from "./chunk-H2XUGGKV.mjs";
9
+ import {
10
+ ManagementCard
11
+ } from "./chunk-LY3O7UWA.mjs";
12
+ import "./chunk-Y272M3D5.mjs";
13
+ import "./chunk-GN3X7IIZ.mjs";
14
+ import "./chunk-5LXCZJLJ.mjs";
15
+ import "./chunk-KPT7NNNK.mjs";
16
+ import "./chunk-K7SQWDNF.mjs";
17
+ import "./chunk-S3DWWUBD.mjs";
18
+ import "./chunk-NI7BKLC7.mjs";
19
+ import "./chunk-UT46TXNG.mjs";
20
+ import "./chunk-WDFQG3RM.mjs";
21
+
22
+ // src/management/components/PersonalizationTab.tsx
23
+ import { useEffect, useState } from "react";
24
+ import { Box, Button, Stack, Switch, TextField, Typography } from "@mui/material";
25
+ import { jsx, jsxs } from "react/jsx-runtime";
26
+ var ABOUT_PLACEHOLDER = "Your work, your interests, the tools you use, how you like to be addressed. For example: I'm a nurse in Kansas City; I use Excel a lot; call me Mark.";
27
+ var STYLE_PLACEHOLDER = "Tone, length, format. For example: Keep answers short unless I ask for detail. Use bullet points for steps. No emojis.";
28
+ var countText = (value, limit) => `${value.length.toLocaleString()} / ${limit.toLocaleString()}`;
29
+ var PersonalizationTab = ({
30
+ preferences,
31
+ updatePreference,
32
+ showSnackbar
33
+ }) => {
34
+ const hydrated = useInstructionsStore((state) => state.hydrated);
35
+ const saved = useInstructionsStore((state) => state.custom);
36
+ const hydrate = useInstructionsStore((state) => state.hydrate);
37
+ const saveCustomInstructions = useInstructionsStore(
38
+ (state) => state.saveCustomInstructions
39
+ );
40
+ const [draft, setDraft] = useState(saved);
41
+ const [saving, setSaving] = useState(false);
42
+ useEffect(() => {
43
+ if (!hydrated) void hydrate();
44
+ }, [hydrated, hydrate]);
45
+ useEffect(() => {
46
+ setDraft(saved);
47
+ }, [saved]);
48
+ const dirty = draft.about !== saved.about || draft.responseStyle !== saved.responseStyle;
49
+ const aboutOver = draft.about.length > CUSTOM_INSTRUCTIONS_LIMITS.about;
50
+ const styleOver = draft.responseStyle.length > CUSTOM_INSTRUCTIONS_LIMITS.responseStyle;
51
+ const save = async () => {
52
+ setSaving(true);
53
+ try {
54
+ const ok = await saveCustomInstructions({
55
+ about: draft.about.trim(),
56
+ responseStyle: draft.responseStyle.trim()
57
+ });
58
+ showSnackbar?.(
59
+ ok ? "Custom instructions saved. They apply to your next message." : "Couldn't save your instructions. Try again.",
60
+ ok ? "success" : "error"
61
+ );
62
+ } finally {
63
+ setSaving(false);
64
+ }
65
+ };
66
+ const fieldSx = { "& textarea": { lineHeight: 1.5 } };
67
+ return /* @__PURE__ */ jsxs(Stack, { spacing: 2, sx: { maxWidth: 880 }, children: [
68
+ /* @__PURE__ */ jsx(
69
+ ManagementCard,
70
+ {
71
+ title: "Custom instructions",
72
+ description: "Bandit reads these with every message you send. Keep them short and concrete; they add to whatever your workspace has set.",
73
+ children: /* @__PURE__ */ jsxs(Stack, { spacing: 2, children: [
74
+ /* @__PURE__ */ jsx(
75
+ TextField,
76
+ {
77
+ label: "What should Bandit know about you?",
78
+ value: draft.about,
79
+ onChange: (e) => setDraft({ ...draft, about: e.target.value }),
80
+ placeholder: ABOUT_PLACEHOLDER,
81
+ multiline: true,
82
+ minRows: 3,
83
+ maxRows: 10,
84
+ fullWidth: true,
85
+ disabled: !hydrated,
86
+ error: aboutOver,
87
+ inputProps: {
88
+ maxLength: Math.max(CUSTOM_INSTRUCTIONS_LIMITS.about, draft.about.length)
89
+ },
90
+ helperText: aboutOver ? `Over the limit by ${(draft.about.length - CUSTOM_INSTRUCTIONS_LIMITS.about).toLocaleString()} characters. Shorten it to keep adding.` : countText(draft.about, CUSTOM_INSTRUCTIONS_LIMITS.about),
91
+ FormHelperTextProps: { sx: { textAlign: "right", mx: 0 } },
92
+ InputLabelProps: { shrink: true },
93
+ sx: fieldSx
94
+ }
95
+ ),
96
+ /* @__PURE__ */ jsx(
97
+ TextField,
98
+ {
99
+ label: "How would you like Bandit to respond?",
100
+ value: draft.responseStyle,
101
+ onChange: (e) => setDraft({ ...draft, responseStyle: e.target.value }),
102
+ placeholder: STYLE_PLACEHOLDER,
103
+ multiline: true,
104
+ minRows: 3,
105
+ maxRows: 14,
106
+ fullWidth: true,
107
+ disabled: !hydrated,
108
+ error: styleOver,
109
+ inputProps: {
110
+ maxLength: Math.max(
111
+ CUSTOM_INSTRUCTIONS_LIMITS.responseStyle,
112
+ draft.responseStyle.length
113
+ )
114
+ },
115
+ helperText: styleOver ? `Over the limit by ${(draft.responseStyle.length - CUSTOM_INSTRUCTIONS_LIMITS.responseStyle).toLocaleString()} characters. This text was kept from your previous personality; shorten it to keep adding.` : countText(draft.responseStyle, CUSTOM_INSTRUCTIONS_LIMITS.responseStyle),
116
+ FormHelperTextProps: { sx: { textAlign: "right", mx: 0 } },
117
+ InputLabelProps: { shrink: true },
118
+ sx: fieldSx
119
+ }
120
+ ),
121
+ /* @__PURE__ */ jsxs(
122
+ Stack,
123
+ {
124
+ direction: { xs: "column-reverse", sm: "row" },
125
+ spacing: 1,
126
+ justifyContent: "flex-end",
127
+ children: [
128
+ /* @__PURE__ */ jsx(
129
+ Button,
130
+ {
131
+ variant: "text",
132
+ color: "inherit",
133
+ onClick: () => setDraft(saved),
134
+ disabled: !dirty || saving,
135
+ children: "Discard"
136
+ }
137
+ ),
138
+ /* @__PURE__ */ jsx(
139
+ Button,
140
+ {
141
+ variant: "contained",
142
+ onClick: () => void save(),
143
+ disabled: !dirty || saving,
144
+ children: saving ? "Saving\u2026" : "Save instructions"
145
+ }
146
+ )
147
+ ]
148
+ }
149
+ )
150
+ ] })
151
+ }
152
+ ),
153
+ /* @__PURE__ */ jsx(
154
+ ManagementCard,
155
+ {
156
+ title: "Memory",
157
+ description: preferences.memoryEnabled ? "Bandit keeps facts you ask it to remember and notes it takes itself, and brings them into new chats when they help." : "Memory is off: Bandit won't save new memories or use the ones below. They stay here until you delete them.",
158
+ actions: /* @__PURE__ */ jsx(
159
+ Switch,
160
+ {
161
+ checked: preferences.memoryEnabled,
162
+ onChange: (e) => updatePreference("memoryEnabled", e.target.checked),
163
+ color: "primary",
164
+ slotProps: { input: { "aria-label": "Use memory" } }
165
+ }
166
+ ),
167
+ children: /* @__PURE__ */ jsxs(Box, { sx: { mt: 0.5 }, children: [
168
+ /* @__PURE__ */ jsx(Typography, { variant: "subtitle2", sx: { fontWeight: 600, mb: 1 }, children: "What Bandit remembers" }),
169
+ /* @__PURE__ */ jsx(MemoryManager, { variant: "page", active: true })
170
+ ] })
171
+ }
172
+ )
173
+ ] });
174
+ };
175
+ var PersonalizationTab_default = PersonalizationTab;
176
+ export {
177
+ PersonalizationTab_default as default
178
+ };
179
+ //# sourceMappingURL=PersonalizationTab-KPTVJKB3.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/management/components/PersonalizationTab.tsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAMA,SAAgB,WAAW,gBAAgB;AAC3C,SAAS,KAAK,QAAQ,OAAO,QAAQ,WAAW,kBAAkB;AA8FxD,cAiDA,YAjDA;AA1EV,IAAM,o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