@arbidocs/blocks 0.4.145 → 0.4.146
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/agents/index.cjs +267 -267
- package/dist/agents/index.js +10 -10
- package/dist/chat/index.cjs +1 -1
- package/dist/chat/index.js +1 -1
- package/dist/{chunk-J4M37SXY.js → chunk-A6IU4GIW.js} +190 -7
- package/dist/chunk-A6IU4GIW.js.map +1 -0
- package/dist/{chunk-34GDGE77.cjs → chunk-C3CGJK7A.cjs} +192 -6
- package/dist/chunk-C3CGJK7A.cjs.map +1 -0
- package/dist/{chunk-KTSF4HFC.js → chunk-C44TDH54.js} +6 -6
- package/dist/{chunk-KTSF4HFC.js.map → chunk-C44TDH54.js.map} +1 -1
- package/dist/chunk-EV7W64B6.js +134 -0
- package/dist/chunk-EV7W64B6.js.map +1 -0
- package/dist/{chunk-QOL3M4FJ.js → chunk-IJST4EBM.js} +9 -9
- package/dist/{chunk-QOL3M4FJ.js.map → chunk-IJST4EBM.js.map} +1 -1
- package/dist/{chunk-NSNHRZBH.cjs → chunk-LPYEUD2D.cjs} +4 -4
- package/dist/{chunk-NSNHRZBH.cjs.map → chunk-LPYEUD2D.cjs.map} +1 -1
- package/dist/{chunk-ULPFRK3J.cjs → chunk-MFMASSEO.cjs} +8 -8
- package/dist/{chunk-ULPFRK3J.cjs.map → chunk-MFMASSEO.cjs.map} +1 -1
- package/dist/{chunk-KPO67GBR.cjs → chunk-O2GW5IY6.cjs} +33 -33
- package/dist/{chunk-KPO67GBR.cjs.map → chunk-O2GW5IY6.cjs.map} +1 -1
- package/dist/{chunk-NGDXDHLG.js → chunk-OBWYM25Y.js} +3 -3
- package/dist/{chunk-NGDXDHLG.js.map → chunk-OBWYM25Y.js.map} +1 -1
- package/dist/{chunk-WO7QAVTL.cjs → chunk-RB7GX2VT.cjs} +9 -9
- package/dist/{chunk-WO7QAVTL.cjs.map → chunk-RB7GX2VT.cjs.map} +1 -1
- package/dist/chunk-RXK3XP62.cjs +144 -0
- package/dist/chunk-RXK3XP62.cjs.map +1 -0
- package/dist/{chunk-VVZ34A2P.js → chunk-T5B7FM7S.js} +4 -4
- package/dist/{chunk-VVZ34A2P.js.map → chunk-T5B7FM7S.js.map} +1 -1
- package/dist/collaboration/index.cjs +9 -9
- package/dist/collaboration/index.js +1 -1
- package/dist/connect/docx.cjs +10 -10
- package/dist/connect/docx.js +7 -7
- package/dist/connect/index.cjs +433 -74
- package/dist/connect/index.cjs.map +1 -1
- package/dist/connect/index.d.ts +1 -0
- package/dist/connect/index.js +379 -22
- package/dist/connect/index.js.map +1 -1
- package/dist/connection/ConnectedNotificationRelevance.d.ts +4 -1
- package/dist/connection/workspace-settings/ConnectedWorkspaceSettings.d.ts +53 -0
- package/dist/connection/workspace-settings/index.d.ts +2 -0
- package/dist/connection/workspace-settings/useConnectedWorkspaceSettings.d.ts +85 -0
- package/dist/document-tools/index.cjs +1 -1
- package/dist/document-tools/index.js +1 -1
- package/dist/facts/index.cjs +1 -1
- package/dist/facts/index.js +1 -1
- package/dist/files/index.cjs +1 -1
- package/dist/files/index.js +1 -1
- package/dist/index.cjs +357 -530
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +21 -203
- package/dist/index.js.map +1 -1
- package/dist/settings/index.cjs +10 -10
- package/dist/settings/index.js +2 -2
- package/dist/shell/index.cjs +1 -1
- package/dist/shell/index.js +1 -1
- package/dist/site/index.cjs +5 -5
- package/dist/site/index.js +1 -1
- package/dist/studio/index.cjs +2 -2
- package/dist/studio/index.js +2 -2
- package/dist/workflow-canvas/index.cjs +23 -23
- package/dist/workflow-canvas/index.js +10 -10
- package/dist/workspaces/CommonWorkspaceToggle.d.ts +15 -0
- package/dist/workspaces/index.cjs +38 -107
- package/dist/workspaces/index.cjs.map +1 -1
- package/dist/workspaces/index.d.ts +1 -0
- package/dist/workspaces/index.js +5 -102
- package/dist/workspaces/index.js.map +1 -1
- package/node_modules/@arbidocs/coedit/package.json +1 -1
- package/package.json +4 -4
- package/dist/chunk-34GDGE77.cjs.map +0 -1
- package/dist/chunk-J4M37SXY.js.map +0 -1
package/dist/connect/index.cjs
CHANGED
|
@@ -1,34 +1,36 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var chunkRXK3XP62_cjs = require('../chunk-RXK3XP62.cjs');
|
|
5
5
|
var chunkU73KPFYH_cjs = require('../chunk-U73KPFYH.cjs');
|
|
6
6
|
var chunkODRHHWHY_cjs = require('../chunk-ODRHHWHY.cjs');
|
|
7
|
-
var
|
|
7
|
+
var chunkMFMASSEO_cjs = require('../chunk-MFMASSEO.cjs');
|
|
8
8
|
var chunkGAYMJWTC_cjs = require('../chunk-GAYMJWTC.cjs');
|
|
9
9
|
var chunkGFNELPDP_cjs = require('../chunk-GFNELPDP.cjs');
|
|
10
10
|
var chunkJH6JTI76_cjs = require('../chunk-JH6JTI76.cjs');
|
|
11
11
|
require('../chunk-464YPRAE.cjs');
|
|
12
12
|
require('../chunk-V5OAXIBN.cjs');
|
|
13
13
|
require('../chunk-5FYU7ZIU.cjs');
|
|
14
|
-
var
|
|
14
|
+
var chunkO4YPVYPO_cjs = require('../chunk-O4YPVYPO.cjs');
|
|
15
|
+
var chunkC3CGJK7A_cjs = require('../chunk-C3CGJK7A.cjs');
|
|
16
|
+
var chunkXAJIKT6Y_cjs = require('../chunk-XAJIKT6Y.cjs');
|
|
15
17
|
var chunkV46W7YLI_cjs = require('../chunk-V46W7YLI.cjs');
|
|
16
18
|
var chunkO6IEZDRC_cjs = require('../chunk-O6IEZDRC.cjs');
|
|
17
19
|
require('../chunk-LJJJ6CYH.cjs');
|
|
18
20
|
var chunkI2QSDQQV_cjs = require('../chunk-I2QSDQQV.cjs');
|
|
19
21
|
require('../chunk-RC25WMVB.cjs');
|
|
20
|
-
var
|
|
21
|
-
require('../chunk-DETZZBG2.cjs');
|
|
22
|
+
var chunkRB7GX2VT_cjs = require('../chunk-RB7GX2VT.cjs');
|
|
22
23
|
var chunkRFIBUWLF_cjs = require('../chunk-RFIBUWLF.cjs');
|
|
23
|
-
var
|
|
24
|
-
|
|
24
|
+
var chunkLPYEUD2D_cjs = require('../chunk-LPYEUD2D.cjs');
|
|
25
|
+
require('../chunk-EYKISBDO.cjs');
|
|
25
26
|
require('../chunk-AHDJXIUB.cjs');
|
|
27
|
+
var chunkRQ2Y7USX_cjs = require('../chunk-RQ2Y7USX.cjs');
|
|
26
28
|
require('../chunk-ZW6FPIFC.cjs');
|
|
29
|
+
require('../chunk-DETZZBG2.cjs');
|
|
30
|
+
require('../chunk-DTROMMDX.cjs');
|
|
27
31
|
var chunkV4ISCZJ7_cjs = require('../chunk-V4ISCZJ7.cjs');
|
|
28
32
|
var chunk2EI7NCUA_cjs = require('../chunk-2EI7NCUA.cjs');
|
|
29
33
|
var chunkC2CWWEHO_cjs = require('../chunk-C2CWWEHO.cjs');
|
|
30
|
-
require('../chunk-EYKISBDO.cjs');
|
|
31
|
-
require('../chunk-DTROMMDX.cjs');
|
|
32
34
|
var chunkQVBZESYQ_cjs = require('../chunk-QVBZESYQ.cjs');
|
|
33
35
|
require('../chunk-ADOKTJHV.cjs');
|
|
34
36
|
var chunk6YTHQ73P_cjs = require('../chunk-6YTHQ73P.cjs');
|
|
@@ -40,8 +42,8 @@ require('../chunk-B6MVQCXW.cjs');
|
|
|
40
42
|
var chunkJKB7WT7L_cjs = require('../chunk-JKB7WT7L.cjs');
|
|
41
43
|
var chunkJSTKEZBS_cjs = require('../chunk-JSTKEZBS.cjs');
|
|
42
44
|
require('../chunk-76L6LOP3.cjs');
|
|
43
|
-
require('../chunk-32HW2Q33.cjs');
|
|
44
45
|
require('../chunk-7UTB4PHM.cjs');
|
|
46
|
+
require('../chunk-32HW2Q33.cjs');
|
|
45
47
|
require('../chunk-FX3K6LNZ.cjs');
|
|
46
48
|
require('../chunk-PPCATBOY.cjs');
|
|
47
49
|
require('../chunk-MHVNT4J3.cjs');
|
|
@@ -140,7 +142,7 @@ function ConnectedWorkspaceActivity({
|
|
|
140
142
|
[feed.data]
|
|
141
143
|
);
|
|
142
144
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
143
|
-
|
|
145
|
+
chunkC3CGJK7A_cjs.WorkspaceActivityList,
|
|
144
146
|
{
|
|
145
147
|
...listProps,
|
|
146
148
|
items,
|
|
@@ -806,14 +808,19 @@ function ConnectedWorkspaceNotificationMenu({
|
|
|
806
808
|
workspaceId: workspaceProp,
|
|
807
809
|
...menuProps
|
|
808
810
|
}) {
|
|
809
|
-
const {
|
|
811
|
+
const { notify } = chunkKPZZ5FHE_cjs.useBlocksEnvironment();
|
|
812
|
+
const { workspaceId: selected, live } = chunkGFNELPDP_cjs.useConnectedWorkspace();
|
|
810
813
|
const workspaceId = workspaceProp ?? selected;
|
|
811
|
-
const { level, setLevel, isLoading, isSaving } = react$1.useWorkspaceNotificationLevel(
|
|
812
|
-
|
|
813
|
-
|
|
814
|
+
const { level, setLevel, isLoading, isSaving, error } = react$1.useWorkspaceNotificationLevel(
|
|
815
|
+
workspaceId,
|
|
816
|
+
{ enabled: live }
|
|
817
|
+
);
|
|
818
|
+
react.useEffect(() => {
|
|
819
|
+
if (error) notify("Could not save the workspace notification setting", "error");
|
|
820
|
+
}, [error, notify]);
|
|
814
821
|
if (!workspaceId) return null;
|
|
815
822
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
816
|
-
|
|
823
|
+
chunkC3CGJK7A_cjs.WorkspaceNotificationMenu,
|
|
817
824
|
{
|
|
818
825
|
...menuProps,
|
|
819
826
|
level,
|
|
@@ -827,12 +834,12 @@ function ConnectedThreadFollow({
|
|
|
827
834
|
as = "button",
|
|
828
835
|
...props
|
|
829
836
|
}) {
|
|
830
|
-
const {
|
|
837
|
+
const { live } = chunkGFNELPDP_cjs.useConnectedWorkspace();
|
|
831
838
|
const { following, setFollowing, isLoading, isSaving } = react$1.useFollowThread(conversationId, {
|
|
832
|
-
enabled:
|
|
839
|
+
enabled: live
|
|
833
840
|
});
|
|
834
841
|
if (!conversationId) return null;
|
|
835
|
-
const Control = as === "menu-item" ?
|
|
842
|
+
const Control = as === "menu-item" ? chunkC3CGJK7A_cjs.ThreadFollowMenuItem : chunkC3CGJK7A_cjs.ThreadFollowButton;
|
|
836
843
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
837
844
|
Control,
|
|
838
845
|
{
|
|
@@ -905,7 +912,7 @@ function ConnectedSkillUpload({ onDone, labels, className }) {
|
|
|
905
912
|
onChange: (e) => {
|
|
906
913
|
const file = e.target.files?.[0];
|
|
907
914
|
e.target.value = "";
|
|
908
|
-
if (file) void add(() =>
|
|
915
|
+
if (file) void add(() => chunkRB7GX2VT_cjs.importSkillFile(file));
|
|
909
916
|
}
|
|
910
917
|
}
|
|
911
918
|
),
|
|
@@ -930,7 +937,7 @@ function ConnectedSkillUpload({ onDone, labels, className }) {
|
|
|
930
937
|
className: "space-y-2",
|
|
931
938
|
onSubmit: (e) => {
|
|
932
939
|
e.preventDefault();
|
|
933
|
-
if (url.trim()) void add(() =>
|
|
940
|
+
if (url.trim()) void add(() => chunkRB7GX2VT_cjs.importSkillFromUrl(url));
|
|
934
941
|
},
|
|
935
942
|
children: [
|
|
936
943
|
/* @__PURE__ */ jsxRuntime.jsx(ui.Label, { htmlFor: "skills-add-url", children: l.fromLink }),
|
|
@@ -994,9 +1001,9 @@ function ConnectedSkillsLibrary({
|
|
|
994
1001
|
const [type, setType] = react.useState("all");
|
|
995
1002
|
const [view, setView] = react.useState("gallery");
|
|
996
1003
|
const [isBusy, setIsBusy] = react.useState(false);
|
|
997
|
-
const all = react.useMemo(() =>
|
|
1004
|
+
const all = react.useMemo(() => chunkRB7GX2VT_cjs.buildLibrarySkills(builtins, listings ?? []), [builtins, listings]);
|
|
998
1005
|
const shown = react.useMemo(
|
|
999
|
-
() =>
|
|
1006
|
+
() => chunkRB7GX2VT_cjs.filterLibrarySkills(all, { query, source, type }),
|
|
1000
1007
|
[all, query, source, type]
|
|
1001
1008
|
);
|
|
1002
1009
|
const current = all.find((s) => s.slug === selected) ?? null;
|
|
@@ -1007,21 +1014,21 @@ function ConnectedSkillsLibrary({
|
|
|
1007
1014
|
const count = (s) => all.filter((x) => x.source === s).length;
|
|
1008
1015
|
const sourceOptions = [
|
|
1009
1016
|
{ id: "all", label: "All", count: all.length },
|
|
1010
|
-
{ id: "builtin", label:
|
|
1011
|
-
{ id: "mine", label:
|
|
1012
|
-
{ id: "shared", label:
|
|
1017
|
+
{ id: "builtin", label: chunkRB7GX2VT_cjs.SKILL_SOURCE_LABELS.builtin, count: count("builtin") },
|
|
1018
|
+
{ id: "mine", label: chunkRB7GX2VT_cjs.SKILL_SOURCE_LABELS.mine, count: count("mine") },
|
|
1019
|
+
{ id: "shared", label: chunkRB7GX2VT_cjs.SKILL_SOURCE_LABELS.shared, count: count("shared") }
|
|
1013
1020
|
];
|
|
1014
1021
|
const types = [...new Set(all.map((s) => s.type))];
|
|
1015
1022
|
const typeOptions = [
|
|
1016
1023
|
{ id: "all", label: "Any kind" },
|
|
1017
|
-
...types.map((t) => ({ id: t, label:
|
|
1024
|
+
...types.map((t) => ({ id: t, label: chunkRB7GX2VT_cjs.SKILL_TYPE_LABELS[t] ?? t }))
|
|
1018
1025
|
];
|
|
1019
1026
|
const pick = (slug) => {
|
|
1020
1027
|
setSelected(slug);
|
|
1021
1028
|
setMode("detail");
|
|
1022
1029
|
};
|
|
1023
1030
|
const markdownOf = async (skill) => {
|
|
1024
|
-
if (!skill.docExtId) return
|
|
1031
|
+
if (!skill.docExtId) return chunkRB7GX2VT_cjs.workflowToSkillMarkdown(skill.workflow);
|
|
1025
1032
|
const response = await arbi.documents.download(skill.docExtId);
|
|
1026
1033
|
if (!response.ok) throw new Error(`Could not read the skill (${response.status})`);
|
|
1027
1034
|
return response.text();
|
|
@@ -1029,7 +1036,7 @@ function ConnectedSkillsLibrary({
|
|
|
1029
1036
|
const saveAs = (slug, markdown, shared = false) => upload.mutateAsync([
|
|
1030
1037
|
{
|
|
1031
1038
|
folder: `${SKILL_FOLDER}${slug}`,
|
|
1032
|
-
fileName:
|
|
1039
|
+
fileName: chunkRB7GX2VT_cjs.SKILL_MAIN_FILENAME,
|
|
1033
1040
|
content: new Blob([markdown], { type: "text/markdown" }),
|
|
1034
1041
|
shared
|
|
1035
1042
|
}
|
|
@@ -1092,7 +1099,7 @@ function ConnectedSkillsLibrary({
|
|
|
1092
1099
|
try {
|
|
1093
1100
|
documentTools.downloadBlob(
|
|
1094
1101
|
new Blob([await markdownOf(skill)], { type: "text/markdown" }),
|
|
1095
|
-
|
|
1102
|
+
chunkRB7GX2VT_cjs.SKILL_MAIN_FILENAME
|
|
1096
1103
|
);
|
|
1097
1104
|
} catch (error) {
|
|
1098
1105
|
notify(errorText(error, "Could not export the skill"), "error");
|
|
@@ -1133,10 +1140,10 @@ function ConnectedSkillsLibrary({
|
|
|
1133
1140
|
}
|
|
1134
1141
|
)
|
|
1135
1142
|
] }),
|
|
1136
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1143
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkRB7GX2VT_cjs.SkillViewToggle, { value: view, onChange: setView })
|
|
1137
1144
|
] }),
|
|
1138
1145
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1139
|
-
|
|
1146
|
+
chunkRB7GX2VT_cjs.SkillFilterChips,
|
|
1140
1147
|
{
|
|
1141
1148
|
label: "Show",
|
|
1142
1149
|
value: source,
|
|
@@ -1145,7 +1152,7 @@ function ConnectedSkillsLibrary({
|
|
|
1145
1152
|
}
|
|
1146
1153
|
),
|
|
1147
1154
|
types.length > 1 && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1148
|
-
|
|
1155
|
+
chunkRB7GX2VT_cjs.SkillFilterChips,
|
|
1149
1156
|
{
|
|
1150
1157
|
label: "Kind",
|
|
1151
1158
|
value: type,
|
|
@@ -1192,12 +1199,12 @@ function ConnectedSkillsLibrary({
|
|
|
1192
1199
|
view === "gallery" ? "grid grid-cols-[repeat(auto-fill,minmax(9.5rem,1fr))]" : "flex flex-col"
|
|
1193
1200
|
),
|
|
1194
1201
|
children: shown.map((skill) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1195
|
-
|
|
1202
|
+
chunkRB7GX2VT_cjs.SkillTile,
|
|
1196
1203
|
{
|
|
1197
1204
|
name: skill.title,
|
|
1198
1205
|
testId: `skill-tile-${skill.slug}`,
|
|
1199
1206
|
description: skill.description,
|
|
1200
|
-
sourceLabel: skill.isShared ? `${
|
|
1207
|
+
sourceLabel: skill.isShared ? `${chunkRB7GX2VT_cjs.SKILL_SOURCE_LABELS.mine}, shared` : chunkRB7GX2VT_cjs.SKILL_SOURCE_LABELS[skill.source],
|
|
1201
1208
|
type: skill.type,
|
|
1202
1209
|
icon,
|
|
1203
1210
|
layout: view,
|
|
@@ -1232,7 +1239,7 @@ function ConnectedSkillsLibrary({
|
|
|
1232
1239
|
}
|
|
1233
1240
|
),
|
|
1234
1241
|
mode === "new" && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1235
|
-
|
|
1242
|
+
chunkRB7GX2VT_cjs.SkillGenerateForm,
|
|
1236
1243
|
{
|
|
1237
1244
|
icon,
|
|
1238
1245
|
onGenerate: (desc) => {
|
|
@@ -1259,11 +1266,11 @@ function ConnectedSkillsLibrary({
|
|
|
1259
1266
|
),
|
|
1260
1267
|
mode === "add" && /* @__PURE__ */ jsxRuntime.jsx(ConnectedSkillUpload, { onDone: done }),
|
|
1261
1268
|
mode === "detail" && current && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1262
|
-
|
|
1269
|
+
chunkRB7GX2VT_cjs.SkillLibraryDetail,
|
|
1263
1270
|
{
|
|
1264
1271
|
skill: current,
|
|
1265
1272
|
icon,
|
|
1266
|
-
instructions: current.docExtId ? currentText ?
|
|
1273
|
+
instructions: current.docExtId ? currentText ? chunkRB7GX2VT_cjs.parseSkillFrontmatter(currentText, chunkRB7GX2VT_cjs.SKILL_MAIN_FILENAME).content : "" : current.workflow.run.kind === "prompt" ? current.workflow.run.promptTemplate : "",
|
|
1267
1274
|
isLoading: !!current.docExtId && textLoading,
|
|
1268
1275
|
actions: {
|
|
1269
1276
|
onRun: () => onRun(current.slug),
|
|
@@ -1298,7 +1305,7 @@ function SkillEditor({
|
|
|
1298
1305
|
const [seeded, setSeeded] = react.useState(!isEditing);
|
|
1299
1306
|
const [nameError, setNameError] = react.useState(null);
|
|
1300
1307
|
if (isEditing && !seeded && text !== void 0) {
|
|
1301
|
-
const parsed =
|
|
1308
|
+
const parsed = chunkRB7GX2VT_cjs.parseSkillFrontmatter(text, chunkRB7GX2VT_cjs.SKILL_MAIN_FILENAME);
|
|
1302
1309
|
setDescription(parsed.description ?? "");
|
|
1303
1310
|
setBody(parsed.content ?? "");
|
|
1304
1311
|
setSeeded(true);
|
|
@@ -1312,15 +1319,15 @@ function SkillEditor({
|
|
|
1312
1319
|
notify("Add a short description.", "error");
|
|
1313
1320
|
return;
|
|
1314
1321
|
}
|
|
1315
|
-
const slug =
|
|
1322
|
+
const slug = chunkRB7GX2VT_cjs.skillSlug(name);
|
|
1316
1323
|
try {
|
|
1317
|
-
await onSave(slug,
|
|
1324
|
+
await onSave(slug, chunkRB7GX2VT_cjs.serializeSkill({ name: slug, description, body }), isEditing);
|
|
1318
1325
|
} catch (err) {
|
|
1319
1326
|
notify(errorText(err, "Could not save the skill"), "error");
|
|
1320
1327
|
}
|
|
1321
1328
|
};
|
|
1322
1329
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1323
|
-
|
|
1330
|
+
chunkRB7GX2VT_cjs.SkillEditForm,
|
|
1324
1331
|
{
|
|
1325
1332
|
name,
|
|
1326
1333
|
onNameChange: setName,
|
|
@@ -1356,9 +1363,9 @@ function ConnectedAgentCreator({
|
|
|
1356
1363
|
agent,
|
|
1357
1364
|
initialName,
|
|
1358
1365
|
onSaved,
|
|
1359
|
-
capabilities =
|
|
1360
|
-
templates =
|
|
1361
|
-
types =
|
|
1366
|
+
capabilities = chunkRB7GX2VT_cjs.DEFAULT_AGENT_CAPABILITIES,
|
|
1367
|
+
templates = chunkRB7GX2VT_cjs.DEFAULT_AGENT_TEMPLATES,
|
|
1368
|
+
types = chunkRB7GX2VT_cjs.DEFAULT_AGENT_TYPES,
|
|
1362
1369
|
canRevokeWorkspaces = false,
|
|
1363
1370
|
labels
|
|
1364
1371
|
}) {
|
|
@@ -1400,7 +1407,7 @@ function ConnectedAgentCreator({
|
|
|
1400
1407
|
const initialValues = react.useMemo(
|
|
1401
1408
|
() => ({
|
|
1402
1409
|
name: agent?.given_name ?? initialName ?? "",
|
|
1403
|
-
persona: isEdit ?
|
|
1410
|
+
persona: isEdit ? chunkRB7GX2VT_cjs.stripPersonaPreamble(String(agents.PERSONA ?? "")) : "",
|
|
1404
1411
|
modelName: String(agents.AGENT_MODEL_NAME ?? ""),
|
|
1405
1412
|
capabilities: Object.fromEntries(capabilities.map(({ key }) => [key, Boolean(agents[key])])),
|
|
1406
1413
|
type: "builtin",
|
|
@@ -1419,7 +1426,7 @@ function ConnectedAgentCreator({
|
|
|
1419
1426
|
try {
|
|
1420
1427
|
let agentExtId = agent?.external_id ?? early?.id ?? "";
|
|
1421
1428
|
if (!agentExtId) {
|
|
1422
|
-
if (!
|
|
1429
|
+
if (!chunkRB7GX2VT_cjs.isValidAgentName(values.name)) {
|
|
1423
1430
|
notify("Give the agent a name first.", "error");
|
|
1424
1431
|
return;
|
|
1425
1432
|
}
|
|
@@ -1455,7 +1462,7 @@ function ConnectedAgentCreator({
|
|
|
1455
1462
|
title: `agent-${name}`,
|
|
1456
1463
|
sections: {
|
|
1457
1464
|
Agents: {
|
|
1458
|
-
PERSONA:
|
|
1465
|
+
PERSONA: chunkRB7GX2VT_cjs.composePersona(name, values.persona),
|
|
1459
1466
|
...values.modelName ? { AGENT_MODEL_NAME: values.modelName } : {},
|
|
1460
1467
|
...Object.fromEntries(capabilities.map(({ key }) => [key, !!values.capabilities[key]])),
|
|
1461
1468
|
ENABLED_SKILLS: values.capabilities.SKILLS_ENABLED && skills.length ? skills : null,
|
|
@@ -1478,7 +1485,7 @@ function ConnectedAgentCreator({
|
|
|
1478
1485
|
};
|
|
1479
1486
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
1480
1487
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1481
|
-
|
|
1488
|
+
chunkRB7GX2VT_cjs.AgentCreator,
|
|
1482
1489
|
{
|
|
1483
1490
|
open: ready,
|
|
1484
1491
|
onOpenChange,
|
|
@@ -1494,11 +1501,11 @@ function ConnectedAgentCreator({
|
|
|
1494
1501
|
) : void 0,
|
|
1495
1502
|
revokingWorkspaceId: revokeAccess.isPending ? revokeAccess.variables?.workspaceId : void 0,
|
|
1496
1503
|
avatar: (values) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1497
|
-
|
|
1504
|
+
chunkRB7GX2VT_cjs.AgentAvatarField,
|
|
1498
1505
|
{
|
|
1499
1506
|
picture,
|
|
1500
1507
|
isBusy: avatarBusy,
|
|
1501
|
-
canGenerate: isEdit ||
|
|
1508
|
+
canGenerate: isEdit || chunkRB7GX2VT_cjs.isValidAgentName(values.name),
|
|
1502
1509
|
onGenerate: () => handleGenerateAvatar(values)
|
|
1503
1510
|
}
|
|
1504
1511
|
),
|
|
@@ -1550,7 +1557,7 @@ function ConnectedAgentCreator({
|
|
|
1550
1557
|
/* @__PURE__ */ jsxRuntime.jsx(ui.DialogTitle, { children: "Connect your agent" }),
|
|
1551
1558
|
/* @__PURE__ */ jsxRuntime.jsx(ui.DialogDescription, { children: "This key is shown once. Run the script on the machine that will host the agent." })
|
|
1552
1559
|
] }),
|
|
1553
|
-
connect && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1560
|
+
connect && /* @__PURE__ */ jsxRuntime.jsx(chunkRB7GX2VT_cjs.AgentConnectInstructions, { email: connect.email, signingKey: connect.signingKey })
|
|
1554
1561
|
]
|
|
1555
1562
|
}
|
|
1556
1563
|
) })
|
|
@@ -1587,7 +1594,7 @@ function ConnectedWorkflowHistory({
|
|
|
1587
1594
|
const { openConversation } = chunkKPZZ5FHE_cjs.useBlocksEnvironment();
|
|
1588
1595
|
const { data: runs = [], isLoading } = react$1.useWorkflowRuns(workflow?.external_id);
|
|
1589
1596
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1590
|
-
|
|
1597
|
+
chunkRB7GX2VT_cjs.TaskRunsDialog,
|
|
1591
1598
|
{
|
|
1592
1599
|
inline,
|
|
1593
1600
|
hideHeader,
|
|
@@ -1623,14 +1630,14 @@ function ConnectedTaskActivityDialog({
|
|
|
1623
1630
|
const activity = react$1.useConversationActivity(conversationId, { live });
|
|
1624
1631
|
const { data: agents = [] } = react$1.useAgents();
|
|
1625
1632
|
const { userId } = chunkGFNELPDP_cjs.useConnectedWorkspace();
|
|
1626
|
-
const { members } =
|
|
1633
|
+
const { members } = chunkMFMASSEO_cjs.useConnectedWorkspaceRole();
|
|
1627
1634
|
const renderPerson = react.useCallback(
|
|
1628
1635
|
(id) => {
|
|
1629
1636
|
const isMe = !!id && id === userId;
|
|
1630
1637
|
const member = members.find((m) => m.user.external_id === id)?.user;
|
|
1631
1638
|
const name = member && [member.given_name, member.family_name].filter(Boolean).join(" ") || member?.email;
|
|
1632
1639
|
const person = { id, label: isMe ? "You" : name || "Someone", isMe };
|
|
1633
|
-
return renderTaskPerson ? renderTaskPerson(person) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
1640
|
+
return renderTaskPerson ? renderTaskPerson(person) : /* @__PURE__ */ jsxRuntime.jsx(chunkLPYEUD2D_cjs.PersonPill, { person });
|
|
1634
1641
|
},
|
|
1635
1642
|
[renderTaskPerson, userId, members]
|
|
1636
1643
|
);
|
|
@@ -1639,7 +1646,7 @@ function ConnectedTaskActivityDialog({
|
|
|
1639
1646
|
[agents]
|
|
1640
1647
|
);
|
|
1641
1648
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1642
|
-
|
|
1649
|
+
chunkRB7GX2VT_cjs.TaskActivityDialog,
|
|
1643
1650
|
{
|
|
1644
1651
|
open: true,
|
|
1645
1652
|
onOpenChange: (open) => !open && onClose(),
|
|
@@ -1785,7 +1792,7 @@ function useWorkflowThread(workflow, options = {}) {
|
|
|
1785
1792
|
);
|
|
1786
1793
|
const conversation = conversations.data?.find((c) => c.external_id === threadId);
|
|
1787
1794
|
const steps = react.useMemo(
|
|
1788
|
-
() => chunkJSTKEZBS_cjs.workflowSteps(workflow).length > 0 ? chunkJSTKEZBS_cjs.workflowSteps(workflow) :
|
|
1795
|
+
() => chunkJSTKEZBS_cjs.workflowSteps(workflow).length > 0 ? chunkJSTKEZBS_cjs.workflowSteps(workflow) : chunkRB7GX2VT_cjs.fromPlanSteps(conversation?.plan?.steps ?? []),
|
|
1789
1796
|
[workflow, conversation?.plan?.steps]
|
|
1790
1797
|
);
|
|
1791
1798
|
const activity = react$1.useConversationActivity(threadId, { live: !!threadId });
|
|
@@ -1845,7 +1852,7 @@ function useWorkflowThread(workflow, options = {}) {
|
|
|
1845
1852
|
criteria: [],
|
|
1846
1853
|
max_passes: 3,
|
|
1847
1854
|
documents: [],
|
|
1848
|
-
steps:
|
|
1855
|
+
steps: chunkRB7GX2VT_cjs.toPlanSteps(workflow, {
|
|
1849
1856
|
inputs: values,
|
|
1850
1857
|
resolveWorkflow: options.resolveWorkflow,
|
|
1851
1858
|
compose: options.compose
|
|
@@ -1932,7 +1939,7 @@ function useWorkflowThread(workflow, options = {}) {
|
|
|
1932
1939
|
const anyRunning = Object.values(states).some((s) => s.status === "running");
|
|
1933
1940
|
const needsStart = !threadId || idle && !anyRunning;
|
|
1934
1941
|
const runError = idle ? conversation?.last_error ?? null : null;
|
|
1935
|
-
const view =
|
|
1942
|
+
const view = chunkRB7GX2VT_cjs.useWorkflowView({
|
|
1936
1943
|
steps,
|
|
1937
1944
|
states,
|
|
1938
1945
|
inputs,
|
|
@@ -2100,7 +2107,7 @@ function WorkflowWordDialog({
|
|
|
2100
2107
|
title: title ?? labels.wordTitle,
|
|
2101
2108
|
size: "xl",
|
|
2102
2109
|
testId: "workflow-word-dialog",
|
|
2103
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(chunkULWRNGGE_cjs.ModalScaffold.Body, { className: "h-[70dvh] p-0", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2110
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(chunkULWRNGGE_cjs.ModalScaffold.Body, { className: "h-[70dvh] p-0", children: /* @__PURE__ */ jsxRuntime.jsx(chunkMFMASSEO_cjs.ConnectedNativeDocxEditor, { documentId: id, title: title ?? labels.wordTitle }) })
|
|
2104
2111
|
}
|
|
2105
2112
|
);
|
|
2106
2113
|
}
|
|
@@ -2409,7 +2416,7 @@ function ConnectedWorkflowRunner({
|
|
|
2409
2416
|
);
|
|
2410
2417
|
};
|
|
2411
2418
|
const runner = (compact) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2412
|
-
|
|
2419
|
+
chunkRB7GX2VT_cjs.WorkflowRunner,
|
|
2413
2420
|
{
|
|
2414
2421
|
people,
|
|
2415
2422
|
...runnerProps,
|
|
@@ -2455,7 +2462,7 @@ function ConnectedWorkflowRunner({
|
|
|
2455
2462
|
) }),
|
|
2456
2463
|
inThread && conversationId ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
2457
2464
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2458
|
-
|
|
2465
|
+
chunkRB7GX2VT_cjs.WorkflowStepBar,
|
|
2459
2466
|
{
|
|
2460
2467
|
run: view,
|
|
2461
2468
|
levels: chunkJSTKEZBS_cjs.stepLevels(view.steps),
|
|
@@ -2656,7 +2663,7 @@ function ConnectedTagTable({
|
|
|
2656
2663
|
const fail = (e) => setError(e instanceof Error ? e.message : String(e));
|
|
2657
2664
|
const snapshot = (data) => {
|
|
2658
2665
|
const title = exportTitle ?? KIND_TITLES[kind];
|
|
2659
|
-
const bytes =
|
|
2666
|
+
const bytes = chunkC3CGJK7A_cjs.tagTableDocx(data, {
|
|
2660
2667
|
title,
|
|
2661
2668
|
nameOf: (id) => people.find((p) => p.value === id)?.label
|
|
2662
2669
|
});
|
|
@@ -2666,7 +2673,7 @@ function ConnectedTagTable({
|
|
|
2666
2673
|
};
|
|
2667
2674
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
|
|
2668
2675
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2669
|
-
|
|
2676
|
+
chunkC3CGJK7A_cjs.TagTable,
|
|
2670
2677
|
{
|
|
2671
2678
|
...props,
|
|
2672
2679
|
table,
|
|
@@ -3721,6 +3728,356 @@ function ConnectedSettingsPage({
|
|
|
3721
3728
|
}
|
|
3722
3729
|
);
|
|
3723
3730
|
}
|
|
3731
|
+
function errorDetail(err) {
|
|
3732
|
+
const e = err;
|
|
3733
|
+
const detail = e?.detail ?? e?.apiError?.detail ?? e?.response?.data?.detail ?? e?.error?.detail;
|
|
3734
|
+
if (typeof detail === "string" && detail) return detail;
|
|
3735
|
+
const message = detail?.message;
|
|
3736
|
+
return typeof message === "string" && message ? message : void 0;
|
|
3737
|
+
}
|
|
3738
|
+
function errorStatus(err) {
|
|
3739
|
+
const e = err;
|
|
3740
|
+
return e?.status ?? e?.response?.status;
|
|
3741
|
+
}
|
|
3742
|
+
var workspaceWord = () => ui.getEntityLabel("WORKSPACE").toLowerCase();
|
|
3743
|
+
var inviteMessage = (emails) => `${emails.length === 1 ? `${emails[0]} isn't on the platform yet.` : `These users aren't on the platform yet:
|
|
3744
|
+
${emails.join("\n")}`}
|
|
3745
|
+
|
|
3746
|
+
Invite them by email? Once they sign up, they'll usually get access to this ${workspaceWord()} automatically \u2014 if not, they can request it themselves.`;
|
|
3747
|
+
function useConnectedWorkspaceSettings(workspaceId, { onLeft } = {}) {
|
|
3748
|
+
const { notify, confirm } = chunkKPZZ5FHE_cjs.useBlocksEnvironment();
|
|
3749
|
+
const { workspaceId: openWorkspaceId, userId } = chunkGFNELPDP_cjs.useConnectedWorkspace();
|
|
3750
|
+
const { data: workspaces } = react$1.useWorkspaces();
|
|
3751
|
+
const workspace = workspaces?.find((w) => w.external_id === workspaceId);
|
|
3752
|
+
const update = react$1.useUpdateWorkspace();
|
|
3753
|
+
const add = react$1.useAddWorkspaceMembers();
|
|
3754
|
+
const remove = react$1.useRemoveWorkspaceMembers();
|
|
3755
|
+
const members = workspace?.users ?? [];
|
|
3756
|
+
const role = members.find((m) => m.user.external_id === userId)?.role ?? null;
|
|
3757
|
+
const isOwner = role === "owner";
|
|
3758
|
+
const isMember = role !== null;
|
|
3759
|
+
const stillOpen = () => {
|
|
3760
|
+
if (!workspace) return false;
|
|
3761
|
+
if (openWorkspaceId === workspace.external_id) return true;
|
|
3762
|
+
notify(
|
|
3763
|
+
`Not saved: you switched to another ${workspaceWord()} first. Open "${workspace.name}" and try again.`,
|
|
3764
|
+
"warning"
|
|
3765
|
+
);
|
|
3766
|
+
return false;
|
|
3767
|
+
};
|
|
3768
|
+
const updateIdentity = async (data) => {
|
|
3769
|
+
if (!workspace || !stillOpen()) return;
|
|
3770
|
+
const changed = [
|
|
3771
|
+
...data.name !== workspace.name ? ["name"] : [],
|
|
3772
|
+
...data.description !== (workspace.description || "") ? ["description"] : []
|
|
3773
|
+
];
|
|
3774
|
+
try {
|
|
3775
|
+
await update.mutateAsync({ name: data.name, description: data.description });
|
|
3776
|
+
if (changed.length > 0) {
|
|
3777
|
+
notify(`${ui.getEntityLabel("WORKSPACE")} ${changed.join(", ")} updated`, "success");
|
|
3778
|
+
}
|
|
3779
|
+
} catch (err) {
|
|
3780
|
+
notify(err instanceof Error ? err.message : "Failed to update workspace", "error");
|
|
3781
|
+
throw err;
|
|
3782
|
+
}
|
|
3783
|
+
};
|
|
3784
|
+
const setPublic = async (isPublic) => {
|
|
3785
|
+
if (!workspace || !stillOpen()) return;
|
|
3786
|
+
await update.mutateAsync({ is_public: isPublic });
|
|
3787
|
+
notify(`Workspace is now ${isPublic ? "common" : "members-only"}`, "success");
|
|
3788
|
+
};
|
|
3789
|
+
const invite = async (emails, memberRole) => {
|
|
3790
|
+
try {
|
|
3791
|
+
await add.mutateAsync({ emails, role: memberRole, confirmInvite: true });
|
|
3792
|
+
notify(
|
|
3793
|
+
emails.length === 1 ? `Invitation sent to ${emails[0]}` : `Invitations sent to ${emails.length} users`,
|
|
3794
|
+
"success"
|
|
3795
|
+
);
|
|
3796
|
+
} catch (err) {
|
|
3797
|
+
const detail = errorDetail(err);
|
|
3798
|
+
notify(
|
|
3799
|
+
detail ? `Couldn't send the invitation: ${detail}` : "Failed to send the invitation.",
|
|
3800
|
+
"error"
|
|
3801
|
+
);
|
|
3802
|
+
}
|
|
3803
|
+
};
|
|
3804
|
+
const share = async (emails, memberRole = "collaborator") => {
|
|
3805
|
+
if (!workspace) return "error";
|
|
3806
|
+
const current = new Set(members.map((m) => m.user.email.toLowerCase()));
|
|
3807
|
+
try {
|
|
3808
|
+
const added = new Set(
|
|
3809
|
+
(await add.mutateAsync({ emails, role: memberRole }) ?? []).map(
|
|
3810
|
+
(m) => m.user.email.toLowerCase()
|
|
3811
|
+
)
|
|
3812
|
+
);
|
|
3813
|
+
const failed = emails.filter((email) => !added.has(email.toLowerCase()));
|
|
3814
|
+
if (failed.length === 0) return "added";
|
|
3815
|
+
const already = failed.filter((email) => current.has(email.toLowerCase()));
|
|
3816
|
+
const unknown = failed.filter((email) => !current.has(email.toLowerCase()));
|
|
3817
|
+
if (added.size > 0) {
|
|
3818
|
+
notify(`Added ${added.size} ${added.size === 1 ? "member" : "members"}`, "success");
|
|
3819
|
+
}
|
|
3820
|
+
if (already.length > 0) {
|
|
3821
|
+
notify(
|
|
3822
|
+
already.length === 1 ? `${already[0]} is already a member` : `${already.length} users are already members`,
|
|
3823
|
+
"info"
|
|
3824
|
+
);
|
|
3825
|
+
}
|
|
3826
|
+
if (unknown.length > 0 && await confirm({
|
|
3827
|
+
message: inviteMessage(unknown),
|
|
3828
|
+
title: "Invite by email?",
|
|
3829
|
+
kind: "yesno"
|
|
3830
|
+
})) {
|
|
3831
|
+
await invite(unknown, memberRole);
|
|
3832
|
+
return added.size > 0 ? "partial" : "invited";
|
|
3833
|
+
}
|
|
3834
|
+
return added.size > 0 ? "partial" : "already_member";
|
|
3835
|
+
} catch (err) {
|
|
3836
|
+
const status = errorStatus(err);
|
|
3837
|
+
const detail = errorDetail(err) || "Failed to add member to workspace";
|
|
3838
|
+
const lower = detail.toLowerCase();
|
|
3839
|
+
if (lower.includes("already has access")) return "already_member";
|
|
3840
|
+
const notRegistered = status === 404 || lower.includes("not found") || lower.includes("no user") || lower.includes("does not exist") || lower.includes("user not registered");
|
|
3841
|
+
if (notRegistered) {
|
|
3842
|
+
if (await confirm({
|
|
3843
|
+
message: inviteMessage(emails),
|
|
3844
|
+
title: "Invite by email?",
|
|
3845
|
+
kind: "yesno"
|
|
3846
|
+
})) {
|
|
3847
|
+
await invite(emails, memberRole);
|
|
3848
|
+
return "invited";
|
|
3849
|
+
}
|
|
3850
|
+
return "cancelled";
|
|
3851
|
+
}
|
|
3852
|
+
const quota = status === 402 || lower.includes("limit reached") || lower.includes("quota") || lower.includes("upgrade");
|
|
3853
|
+
if (!quota) notify(detail, "error");
|
|
3854
|
+
return "error";
|
|
3855
|
+
}
|
|
3856
|
+
};
|
|
3857
|
+
const removeMember = async (userExtId, email, name) => {
|
|
3858
|
+
if (!workspace || !isOwner) return;
|
|
3859
|
+
const ok = await confirm({
|
|
3860
|
+
message: `Remove ${name} (${email}) from the "${workspace.name}" ${ui.getEntityLabel("WORKSPACE")}?
|
|
3861
|
+
|
|
3862
|
+
Note that ${ui.getEntityLabel("WORKSPACEUSER", "PLURAL").toLowerCase()} may have saved private content in the workspace that you cannot see. If you remove them from the ${workspaceWord()} they will immediately lose access to any content in the ${workspaceWord()}.`,
|
|
3863
|
+
title: `Remove ${ui.getEntityLabel("WORKSPACEUSER")}`
|
|
3864
|
+
});
|
|
3865
|
+
if (!ok) return;
|
|
3866
|
+
try {
|
|
3867
|
+
await remove.mutateAsync([userExtId]);
|
|
3868
|
+
notify(`Successfully removed ${name} from workspace`, "success");
|
|
3869
|
+
} catch {
|
|
3870
|
+
notify(`Failed to remove ${name} from workspace`, "error");
|
|
3871
|
+
}
|
|
3872
|
+
};
|
|
3873
|
+
const leave = async () => {
|
|
3874
|
+
if (!workspace || !userId || isOwner) return;
|
|
3875
|
+
const name = workspace.name;
|
|
3876
|
+
const ok = await confirm({
|
|
3877
|
+
message: `Are you sure you want to leave the "${name}" ${ui.getEntityLabel("WORKSPACE")}?
|
|
3878
|
+
|
|
3879
|
+
You will lose access to all content in this ${workspaceWord()}.`,
|
|
3880
|
+
title: "Leave Workspace"
|
|
3881
|
+
});
|
|
3882
|
+
if (!ok) return;
|
|
3883
|
+
try {
|
|
3884
|
+
await remove.mutateAsync([userId]);
|
|
3885
|
+
onLeft?.();
|
|
3886
|
+
notify(`Successfully left ${name}`, "success");
|
|
3887
|
+
} catch {
|
|
3888
|
+
notify("Failed to leave workspace", "error");
|
|
3889
|
+
}
|
|
3890
|
+
};
|
|
3891
|
+
return {
|
|
3892
|
+
workspace,
|
|
3893
|
+
members,
|
|
3894
|
+
role,
|
|
3895
|
+
isOwner,
|
|
3896
|
+
isMember,
|
|
3897
|
+
updateIdentity,
|
|
3898
|
+
setPublic,
|
|
3899
|
+
share,
|
|
3900
|
+
removeMember,
|
|
3901
|
+
leave,
|
|
3902
|
+
isSharing: add.isPending,
|
|
3903
|
+
isRemoving: remove.isPending
|
|
3904
|
+
};
|
|
3905
|
+
}
|
|
3906
|
+
var isAgentMember = (member) => member.user.external_id.startsWith("agt-");
|
|
3907
|
+
var memberName = (member) => member.user.family_name ? `${member.user.given_name} ${member.user.family_name}` : member.user.given_name;
|
|
3908
|
+
function ConnectedWorkspaceSettings({
|
|
3909
|
+
workspaceId,
|
|
3910
|
+
project,
|
|
3911
|
+
projectLine,
|
|
3912
|
+
membersTable,
|
|
3913
|
+
shareDialog,
|
|
3914
|
+
children,
|
|
3915
|
+
onExport,
|
|
3916
|
+
onOpenActivity,
|
|
3917
|
+
onLeft,
|
|
3918
|
+
testId = "workspace-settings-page"
|
|
3919
|
+
}) {
|
|
3920
|
+
const settings = useConnectedWorkspaceSettings(workspaceId, { onLeft });
|
|
3921
|
+
const { workspace, members, isOwner, isMember } = settings;
|
|
3922
|
+
const { data: userSettings } = react$1.useUserSettings();
|
|
3923
|
+
const isDeveloper = userSettings?.developer === true;
|
|
3924
|
+
const showAgents = userSettings?.show_agent_sessions ?? false;
|
|
3925
|
+
const visibleMembers = react.useMemo(
|
|
3926
|
+
() => showAgents ? members : members.filter((m) => !isAgentMember(m)),
|
|
3927
|
+
[members, showAgents]
|
|
3928
|
+
);
|
|
3929
|
+
const [membersExpanded, setMembersExpanded] = react.useState(false);
|
|
3930
|
+
const [shareOpen, setShareOpen] = react.useState(false);
|
|
3931
|
+
if (!workspace) {
|
|
3932
|
+
return /* @__PURE__ */ jsxRuntime.jsx(chunkRXK3XP62_cjs.PageLoading, { children: /* @__PURE__ */ jsxRuntime.jsx(chunkC3CGJK7A_cjs.LoadingIndicator, { message: "Loading workspace..." }) });
|
|
3933
|
+
}
|
|
3934
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
3935
|
+
/* @__PURE__ */ jsxRuntime.jsxs(chunkRXK3XP62_cjs.WorkspacePageFrame, { testId, children: [
|
|
3936
|
+
/* @__PURE__ */ jsxRuntime.jsxs(chunkRXK3XP62_cjs.WorkspaceIdentityPanel, { children: [
|
|
3937
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3938
|
+
chunkC3CGJK7A_cjs.EntityIdentityBar,
|
|
3939
|
+
{
|
|
3940
|
+
testId: "workspace-identity-bar",
|
|
3941
|
+
canEdit: isOwner,
|
|
3942
|
+
actions: isMember ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
3943
|
+
ConnectedWorkspaceNotificationMenu,
|
|
3944
|
+
{
|
|
3945
|
+
workspaceId: workspace.external_id,
|
|
3946
|
+
onOpenActivity,
|
|
3947
|
+
testId: "workspace-home-notification-menu"
|
|
3948
|
+
}
|
|
3949
|
+
) : void 0,
|
|
3950
|
+
fields: [
|
|
3951
|
+
{
|
|
3952
|
+
label: "Name",
|
|
3953
|
+
value: workspace.name,
|
|
3954
|
+
placeholder: "Untitled",
|
|
3955
|
+
maxLength: chunkC3CGJK7A_cjs.IDENTITY_NAME_MAX_LENGTH,
|
|
3956
|
+
valueClassName: "truncate text-base font-semibold",
|
|
3957
|
+
testId: "workspace-home-title",
|
|
3958
|
+
hideLabel: true,
|
|
3959
|
+
leading: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3960
|
+
chunkV46W7YLI_cjs.WorkspaceIdentity,
|
|
3961
|
+
{
|
|
3962
|
+
workspace: {
|
|
3963
|
+
...react$1.toShellWorkspace(workspace),
|
|
3964
|
+
projectLine: projectLine?.(workspace)
|
|
3965
|
+
},
|
|
3966
|
+
expanded: false
|
|
3967
|
+
}
|
|
3968
|
+
),
|
|
3969
|
+
trailing: project && /* @__PURE__ */ jsxRuntime.jsx(
|
|
3970
|
+
chunkRXK3XP62_cjs.WorkspaceProjectSlot,
|
|
3971
|
+
{
|
|
3972
|
+
testId: "workspace-home-project",
|
|
3973
|
+
caption: `${ui.getEntityLabel("PROJECT")}:`,
|
|
3974
|
+
children: project({ workspace, isOwner })
|
|
3975
|
+
}
|
|
3976
|
+
),
|
|
3977
|
+
// Both fields go up together: the endpoint takes the pair.
|
|
3978
|
+
onSave: (name) => settings.updateIdentity({ name, description: workspace.description ?? "" })
|
|
3979
|
+
},
|
|
3980
|
+
{
|
|
3981
|
+
label: "Description",
|
|
3982
|
+
value: workspace.description ?? "",
|
|
3983
|
+
placeholder: "No description",
|
|
3984
|
+
multiline: true,
|
|
3985
|
+
valueClassName: "line-clamp-2 text-sm text-muted-foreground",
|
|
3986
|
+
testId: "workspace-home-description",
|
|
3987
|
+
hideLabel: true,
|
|
3988
|
+
trailing: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3989
|
+
chunkRXK3XP62_cjs.WorkspaceAudienceLine,
|
|
3990
|
+
{
|
|
3991
|
+
visibility: {
|
|
3992
|
+
testId: "workspace-home-visibility",
|
|
3993
|
+
caption: "Visibility:",
|
|
3994
|
+
toggle: isOwner && isDeveloper ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
3995
|
+
chunkRXK3XP62_cjs.CommonWorkspaceToggle,
|
|
3996
|
+
{
|
|
3997
|
+
isCommon: workspace.is_public ?? false,
|
|
3998
|
+
onToggle: (value) => void settings.setPublic(value),
|
|
3999
|
+
"data-testid": "workspace-visibility-toggle"
|
|
4000
|
+
}
|
|
4001
|
+
) : void 0,
|
|
4002
|
+
stateText: workspace.is_public ? "Common \u2014 everyone on this deployment" : "Members only",
|
|
4003
|
+
stateHelp: workspace.is_public ? "Everyone on this deployment can see its files, not only its members." : "Only members of this workspace can see its files."
|
|
4004
|
+
},
|
|
4005
|
+
members: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4006
|
+
chunkXAJIKT6Y_cjs.MemberAvatarStack,
|
|
4007
|
+
{
|
|
4008
|
+
members: visibleMembers.map((m) => ({
|
|
4009
|
+
name: memberName(m),
|
|
4010
|
+
picture: m.user.picture
|
|
4011
|
+
})),
|
|
4012
|
+
total: visibleMembers.length,
|
|
4013
|
+
expanded: membersExpanded,
|
|
4014
|
+
onClick: () => setMembersExpanded((open) => !open),
|
|
4015
|
+
testId: "workspace-home-members-toggle"
|
|
4016
|
+
}
|
|
4017
|
+
),
|
|
4018
|
+
share: isOwner && shareDialog ? {
|
|
4019
|
+
label: "Share",
|
|
4020
|
+
onClick: () => setShareOpen(true),
|
|
4021
|
+
testId: "workspace-quick-add-member"
|
|
4022
|
+
} : void 0
|
|
4023
|
+
}
|
|
4024
|
+
),
|
|
4025
|
+
onSave: (description) => settings.updateIdentity({ name: workspace.name, description })
|
|
4026
|
+
}
|
|
4027
|
+
]
|
|
4028
|
+
}
|
|
4029
|
+
),
|
|
4030
|
+
isMember && membersTable && /* @__PURE__ */ jsxRuntime.jsx(
|
|
4031
|
+
chunkRXK3XP62_cjs.ExpandableSection,
|
|
4032
|
+
{
|
|
4033
|
+
expanded: membersExpanded,
|
|
4034
|
+
testId: "workspace-settings-members-section",
|
|
4035
|
+
children: membersTable({
|
|
4036
|
+
workspace,
|
|
4037
|
+
members: visibleMembers,
|
|
4038
|
+
onRemove: settings.removeMember,
|
|
4039
|
+
isRemoving: settings.isRemoving
|
|
4040
|
+
})
|
|
4041
|
+
}
|
|
4042
|
+
)
|
|
4043
|
+
] }),
|
|
4044
|
+
children,
|
|
4045
|
+
isMember && onExport && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex justify-end px-4 pb-4", children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4046
|
+
ui.Button,
|
|
4047
|
+
{
|
|
4048
|
+
variant: "outline",
|
|
4049
|
+
size: "sm",
|
|
4050
|
+
onClick: onExport,
|
|
4051
|
+
"data-testid": "workspace-transfer-button",
|
|
4052
|
+
children: [
|
|
4053
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.FolderInput, { className: "size-4" }),
|
|
4054
|
+
"Export, copy or move\u2026"
|
|
4055
|
+
]
|
|
4056
|
+
}
|
|
4057
|
+
) }),
|
|
4058
|
+
!isOwner && /* @__PURE__ */ jsxRuntime.jsx(
|
|
4059
|
+
chunkRXK3XP62_cjs.LeaveFooter,
|
|
4060
|
+
{
|
|
4061
|
+
testId: "workspace-settings-footer",
|
|
4062
|
+
leave: {
|
|
4063
|
+
testId: "workspace-leave-button",
|
|
4064
|
+
label: settings.isRemoving ? "Leaving\u2026" : `Leave ${ui.getEntityLabel("WORKSPACE").toLowerCase()}`,
|
|
4065
|
+
disabled: settings.isRemoving,
|
|
4066
|
+
onClick: () => void settings.leave()
|
|
4067
|
+
}
|
|
4068
|
+
}
|
|
4069
|
+
)
|
|
4070
|
+
] }),
|
|
4071
|
+
isOwner && shareDialog?.({
|
|
4072
|
+
open: shareOpen,
|
|
4073
|
+
onOpenChange: setShareOpen,
|
|
4074
|
+
workspace,
|
|
4075
|
+
members: visibleMembers,
|
|
4076
|
+
onShare: settings.share,
|
|
4077
|
+
isSharing: settings.isSharing
|
|
4078
|
+
})
|
|
4079
|
+
] });
|
|
4080
|
+
}
|
|
3724
4081
|
function useConnectedDocxNotifications(onOpen) {
|
|
3725
4082
|
const arbi = react$1.useArbi();
|
|
3726
4083
|
const { status, user, apiUrl } = chunkGFNELPDP_cjs.useConnection();
|
|
@@ -9301,43 +9658,43 @@ Object.defineProperty(exports, "useWorkspaceDocs", {
|
|
|
9301
9658
|
});
|
|
9302
9659
|
Object.defineProperty(exports, "ConnectedWorkflowDocumentsField", {
|
|
9303
9660
|
enumerable: true,
|
|
9304
|
-
get: function () { return
|
|
9661
|
+
get: function () { return chunkMFMASSEO_cjs.ConnectedWorkflowDocumentsField; }
|
|
9305
9662
|
});
|
|
9306
9663
|
Object.defineProperty(exports, "ConnectedWorkflowLauncher", {
|
|
9307
9664
|
enumerable: true,
|
|
9308
|
-
get: function () { return
|
|
9665
|
+
get: function () { return chunkMFMASSEO_cjs.ConnectedWorkflowLauncher; }
|
|
9309
9666
|
});
|
|
9310
9667
|
Object.defineProperty(exports, "ConnectedWorkflowsTable", {
|
|
9311
9668
|
enumerable: true,
|
|
9312
|
-
get: function () { return
|
|
9669
|
+
get: function () { return chunkMFMASSEO_cjs.ConnectedWorkflowsTable; }
|
|
9313
9670
|
});
|
|
9314
9671
|
Object.defineProperty(exports, "DEFAULT_CONNECTED_WORKFLOWS_TABLE_LABELS", {
|
|
9315
9672
|
enumerable: true,
|
|
9316
|
-
get: function () { return
|
|
9673
|
+
get: function () { return chunkMFMASSEO_cjs.DEFAULT_CONNECTED_WORKFLOWS_TABLE_LABELS; }
|
|
9317
9674
|
});
|
|
9318
9675
|
Object.defineProperty(exports, "NativeDocxSupportProvider", {
|
|
9319
9676
|
enumerable: true,
|
|
9320
|
-
get: function () { return
|
|
9677
|
+
get: function () { return chunkMFMASSEO_cjs.NativeDocxSupportProvider; }
|
|
9321
9678
|
});
|
|
9322
9679
|
Object.defineProperty(exports, "toWorkflowFieldDocument", {
|
|
9323
9680
|
enumerable: true,
|
|
9324
|
-
get: function () { return
|
|
9681
|
+
get: function () { return chunkMFMASSEO_cjs.toWorkflowFieldDocument; }
|
|
9325
9682
|
});
|
|
9326
9683
|
Object.defineProperty(exports, "useConnectedAgentOptions", {
|
|
9327
9684
|
enumerable: true,
|
|
9328
|
-
get: function () { return
|
|
9685
|
+
get: function () { return chunkMFMASSEO_cjs.useConnectedAgentOptions; }
|
|
9329
9686
|
});
|
|
9330
9687
|
Object.defineProperty(exports, "useConnectedWorkflowScopeSource", {
|
|
9331
9688
|
enumerable: true,
|
|
9332
|
-
get: function () { return
|
|
9689
|
+
get: function () { return chunkMFMASSEO_cjs.useConnectedWorkflowScopeSource; }
|
|
9333
9690
|
});
|
|
9334
9691
|
Object.defineProperty(exports, "useConnectedWorkspaceRole", {
|
|
9335
9692
|
enumerable: true,
|
|
9336
|
-
get: function () { return
|
|
9693
|
+
get: function () { return chunkMFMASSEO_cjs.useConnectedWorkspaceRole; }
|
|
9337
9694
|
});
|
|
9338
9695
|
Object.defineProperty(exports, "useNativeDocxSupport", {
|
|
9339
9696
|
enumerable: true,
|
|
9340
|
-
get: function () { return
|
|
9697
|
+
get: function () { return chunkMFMASSEO_cjs.useNativeDocxSupport; }
|
|
9341
9698
|
});
|
|
9342
9699
|
Object.defineProperty(exports, "ConnectedWorkspaceDataProvider", {
|
|
9343
9700
|
enumerable: true,
|
|
@@ -9412,6 +9769,7 @@ exports.ConnectedWorkflowHistory = ConnectedWorkflowHistory;
|
|
|
9412
9769
|
exports.ConnectedWorkflowRunner = ConnectedWorkflowRunner;
|
|
9413
9770
|
exports.ConnectedWorkspaceActivity = ConnectedWorkspaceActivity;
|
|
9414
9771
|
exports.ConnectedWorkspaceNotificationMenu = ConnectedWorkspaceNotificationMenu;
|
|
9772
|
+
exports.ConnectedWorkspaceSettings = ConnectedWorkspaceSettings;
|
|
9415
9773
|
exports.DEFAULT_CONNECTED_SKILL_UPLOAD_LABELS = DEFAULT_CONNECTED_SKILL_UPLOAD_LABELS;
|
|
9416
9774
|
exports.DEFAULT_CONNECTED_WORKFLOW_RUNNER_LABELS = DEFAULT_CONNECTED_WORKFLOW_RUNNER_LABELS;
|
|
9417
9775
|
exports.DEFAULT_SETTINGS_SECTIONS = DEFAULT_SETTINGS_SECTIONS;
|
|
@@ -9439,6 +9797,7 @@ exports.useCalendarViewStore = useCalendarViewStore;
|
|
|
9439
9797
|
exports.useConnectedDocxNotifications = useConnectedDocxNotifications;
|
|
9440
9798
|
exports.useConnectedShellWorkspaces = useConnectedShellWorkspaces;
|
|
9441
9799
|
exports.useConnectedWorkNotifications = useConnectedWorkNotifications;
|
|
9800
|
+
exports.useConnectedWorkspaceSettings = useConnectedWorkspaceSettings;
|
|
9442
9801
|
exports.workflowRunView = workflowRunView;
|
|
9443
9802
|
//# sourceMappingURL=index.cjs.map
|
|
9444
9803
|
//# sourceMappingURL=index.cjs.map
|