nolo-cli 0.54.0-alpha.2 → 0.54.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/{_executeModel-ANY4SIAS.js → _executeModel-OPTKYHJA.js} +48 -42
- package/{action-Q4W5JPI5.js → action-ORXWW2ZG.js} +8 -8
- package/{addContentAction-O25HFR37.js → addContentAction-53BZ34AE.js} +8 -7
- package/{addDialogAgentAction-GH7AUPPB.js → addDialogAgentAction-JRYUS54Y.js} +10 -9
- package/{agentDeleteCommand-JWIKNWWI.js → agentDeleteCommand-FJIWU2BS.js} +30 -28
- package/{agentEmailCommands-PL22BEU5.js → agentEmailCommands-CE32L43B.js} +57 -52
- package/{agentListCommands-6NR7AQEK.js → agentListCommands-VJNKULIK.js} +42 -33
- package/{agentMachineCommands-TASPU6OA.js → agentMachineCommands-HCJ3WQXL.js} +30 -28
- package/{agentRecordCommands-Z64TA63M.js → agentRecordCommands-QFWERED4.js} +55 -50
- package/{agentRunCommand-4QJQLPRW.js → agentRunCommand-G3GQMUNN.js} +65 -53
- package/{agentRunControl-4GHHSXFZ.js → agentRunControl-INKFDXDA.js} +3 -1
- package/{agentRuntimeLocal-PCJJ56J2.js → agentRuntimeLocal-K327ELSL.js} +30 -26
- package/{agentSlice-KYLDUSNN.js → agentSlice-ODKF4J6M.js} +8 -8
- package/{agentSuperviseCommands-VB6BUS5H.js → agentSuperviseCommands-5AR3DKNN.js} +2 -2
- package/{appDeleteCommands-WLHMJAVT.js → appDeleteCommands-XUXMFDI4.js} +31 -29
- package/{appDeployCommands-CKON7N2E.js → appDeployCommands-37F4GPCU.js} +31 -29
- package/{appDeployStatusCommands-PXRLDASH.js → appDeployStatusCommands-WSPU7TUK.js} +31 -29
- package/{appGetCommands-RAB5RM4M.js → appGetCommands-YLOBA3EM.js} +31 -29
- package/{appListCommands-GU57FB62.js → appListCommands-UD62R5ME.js} +31 -29
- package/{authCommand-QOPOEYEK.js → authCommand-OK6HLHGS.js} +13 -13
- package/{authCommands-SBQVTD6V.js → authCommands-2DUIUEMT.js} +2 -2
- package/{chatQueueReduxAdapter-5O2WLITN.js → chatQueueReduxAdapter-TV2TUOQS.js} +26 -23
- package/{chunk-7CH6U3FL.js → chunk-2GRGFCF6.js} +2 -4
- package/{chunk-T27IEBNQ.js → chunk-2QDDKFG5.js} +74 -1
- package/{chunk-VULELK4T.js → chunk-2WBFJHQA.js} +4 -26
- package/{chunk-IKTHA3JH.js → chunk-3LKZRP7E.js} +2 -2
- package/{chunk-INXBNYCG.js → chunk-3Y2K5O2R.js} +64 -6
- package/{chunk-VRZIH5JO.js → chunk-3ZTR7ZO4.js} +1 -1
- package/{chunk-GV35EHNA.js → chunk-5FCIPEKT.js} +262 -96
- package/{chunk-RTLJUGQH.js → chunk-5UAYZEXO.js} +2 -2
- package/{chunk-TI5BCZCH.js → chunk-6COJEAYH.js} +32 -101
- package/{chunk-Y7LNKP32.js → chunk-6HDYSFLO.js} +4 -6
- package/chunk-6IGD47IC.js +19 -0
- package/chunk-6YTOJY35.js +352 -0
- package/{chunk-6FGXGFAH.js → chunk-75MSWWUE.js} +1 -1
- package/{chunk-3Z3DXZBD.js → chunk-7FAS3NEF.js} +16 -16
- package/{chunk-AV6KQCM5.js → chunk-7NYDJAQ7.js} +19 -14
- package/{chunk-CVT7L2WZ.js → chunk-A65UV3M5.js} +4 -4
- package/{chunk-7APQB6R6.js → chunk-AUVFJGPC.js} +3 -3
- package/{chunk-H4RYESI6.js → chunk-BBTN4NQD.js} +4 -4
- package/{chunk-757BGY6Y.js → chunk-BG7J6Y5X.js} +1 -1
- package/chunk-BY2FF2C4.js +526 -0
- package/{chunk-FA4SY4F5.js → chunk-BYEJ7K2Z.js} +1 -1
- package/chunk-BYXBJQAS.js +0 -0
- package/{chunk-3AOLVADY.js → chunk-DVINR3PL.js} +1 -1
- package/{chunk-UITMHBVK.js → chunk-EA5OYZVD.js} +1 -1
- package/{chunk-4NN3EK7H.js → chunk-EICIFHVS.js} +1 -1
- package/chunk-EJE33XNR.js +19059 -0
- package/{chunk-6SZ52ORL.js → chunk-FJHMLRDQ.js} +9 -9
- package/{chunk-RU5D3B22.js → chunk-GRFK2XP4.js} +2 -2
- package/{chunk-J3UALFHL.js → chunk-HJTAGT3W.js} +1 -1
- package/{chunk-WL3UOGYO.js → chunk-HPW5MNDQ.js} +38 -98
- package/{chunk-H2G6JXTR.js → chunk-HQUORJTM.js} +1 -1
- package/{chunk-OYNDYVSE.js → chunk-JON2PHYT.js} +1 -1
- package/{chunk-7K5VMB4Q.js → chunk-JXIP6ZWH.js} +7 -7
- package/{chunk-KUUTWU4I.js → chunk-K4NISKOR.js} +46 -8
- package/{chunk-SP3DPVBH.js → chunk-KLIBF3BY.js} +2 -2
- package/chunk-LRGKOI5Y.js +297 -0
- package/{chunk-LN3OQJGG.js → chunk-MLEZPE3U.js} +2 -2
- package/{chunk-FGEYVPPR.js → chunk-MYMBBB6Q.js} +5 -64
- package/{chunk-VRJUIUIY.js → chunk-N4JKMCY3.js} +2 -2
- package/{chunk-U5Z7LFZF.js → chunk-NFLA6GSU.js} +4 -4
- package/{chunk-SVEUG45B.js → chunk-NHRQCXIQ.js} +0 -24
- package/{chunk-56W233KG.js → chunk-NJUQBYFJ.js} +3 -1
- package/{chunk-Q24S4NDF.js → chunk-Q4XZVZPN.js} +1 -1
- package/{chunk-UW4INMD2.js → chunk-RHMDMTDK.js} +2 -2
- package/{chunk-MFI4FGHX.js → chunk-SAJSBPI2.js} +1 -1
- package/{chunk-WHVQA7PJ.js → chunk-SSXTSPSG.js} +27 -6
- package/{chunk-2BWU4ORW.js → chunk-SUEIAK5N.js} +1 -1
- package/{chunk-3QJTD6DO.js → chunk-SVC3GGUA.js} +5 -5
- package/{chunk-QDHZCAH3.js → chunk-SVDMVX4G.js} +118 -2
- package/{chunk-GBADO3SM.js → chunk-SWJGJMTW.js} +1 -1
- package/{chunk-DQLYEGP7.js → chunk-SYYUU7EV.js} +2 -2
- package/{chunk-U2A47SVI.js → chunk-TC6P4NDR.js} +7 -7
- package/{chunk-V4KZGLOI.js → chunk-TR4DXUYX.js} +1983 -447
- package/{chunk-BANYWEYY.js → chunk-TY3ADTX5.js} +1 -1
- package/chunk-UAD2WT54.js +64 -0
- package/{chunk-PAHILFNT.js → chunk-UGBHDMHI.js} +4 -4
- package/{chunk-6FQ2552G.js → chunk-UOWXD4VN.js} +799 -956
- package/{chunk-5WADL4O7.js → chunk-UR66XPVF.js} +3 -3
- package/{chunk-6BYAXNH5.js → chunk-VZMUOPYG.js} +12 -2
- package/{chunk-LA4IDAK7.js → chunk-WQHGJHAL.js} +440 -2981
- package/{chunk-GLGD2JGY.js → chunk-XIJZOCSP.js} +7 -7
- package/{chunk-BJLYCOZK.js → chunk-YBFJQC2M.js} +93 -776
- package/{chunk-MRWGHF56.js → chunk-YDH3FDFQ.js} +12 -356
- package/{chunk-32I5RVMY.js → chunk-YLCUU3WM.js} +3 -3
- package/{chunk-D3JQPONH.js → chunk-YQBXOHE6.js} +1 -1
- package/chunk-ZJ7UHBJS.js +89 -0
- package/{chunk-TNPCQNGQ.js → chunk-ZVOHVJI3.js} +4 -9
- package/contentThunks-KNI6VXLT.js +71 -0
- package/{createAgentAutomationAction-UJLNFFFC.js → createAgentAutomationAction-OK4L33KF.js} +27 -23
- package/{createDialogAction-TJCX6GUE.js → createDialogAction-JDSMY4AY.js} +28 -24
- package/{createPageAction-N3IYABHV.js → createPageAction-T7RA3HCG.js} +29 -24
- package/{dbSlice-D5CNGWPD.js → dbSlice-TVX6SN2T.js} +6 -6
- package/{deleteFile-44TUM34Y.js → deleteFile-JYKRT7C3.js} +3 -3
- package/{dialogCommands-35M6RBAC.js → dialogCommands-UQZYWOOV.js} +32 -30
- package/{dialogSlice-KO7ADD7H.js → dialogSlice-TYW2G7IL.js} +26 -23
- package/{docCreateCommands-VXHZWQ3P.js → docCreateCommands-OA6HZBWO.js} +34 -32
- package/{docDeleteCommands-4WFAJR6A.js → docDeleteCommands-KBB3YQI2.js} +31 -29
- package/{docReadCommands-OYREEFAR.js → docReadCommands-ZLMFVC67.js} +30 -28
- package/{docStore-5BU76DFK.js → docStore-2URPBVCS.js} +8 -33
- package/{docUpdateCommands-A7QERSME.js → docUpdateCommands-HMH5KUON.js} +34 -32
- package/{fetchMessages-KZQVBXKY.js → fetchMessages-DRABNDPZ.js} +3 -3
- package/{getPricing-HAU62AFM.js → getPricing-RFOPUWHY.js} +4 -4
- package/{handleSendMessageAction-OSGQJQ45.js → handleSendMessageAction-GO53TY7U.js} +28 -25
- package/index.js +56 -56
- package/{localDialogRead-NQ33HBSI.js → localDialogRead-PUQKFI73.js} +1 -1
- package/{machineCommands-J43U3TX5.js → machineCommands-RK6L7ZWL.js} +59 -54
- package/{machineWsRunDispatch-Z2Z6STXZ.js → machineWsRunDispatch-3X64DW2Z.js} +54 -49
- package/memberThunks-THZYZFSN.js +638 -0
- package/{models-4QF4BJVY.js → models-JVKUEER5.js} +2 -2
- package/package.json +1 -1
- package/{read-RGNPI5H2.js → read-K4JU4MQC.js} +3 -3
- package/{readDocTool-6ESWKTXD.js → readDocTool-LQGR6FUN.js} +1 -1
- package/{readlineWorkspace-YRPV6JPN.js → readlineWorkspace-XUFJV3RS.js} +604 -263
- package/{removeDialogAgentAction-JYT73FU2.js → removeDialogAgentAction-ECHCFB7N.js} +12 -11
- package/{runAgentClientLoop-5YM5WMAY.js → runAgentClientLoop-24GQ2AW6.js} +46 -40
- package/{setDialogExtraReferencesAction-D564LMYQ.js → setDialogExtraReferencesAction-KCVJNGMB.js} +9 -8
- package/{setPrimaryDialogAgentAction-ACY3BLYA.js → setPrimaryDialogAgentAction-VDOBOMKC.js} +12 -11
- package/{settingSlice-MKI3MNZJ.js → settingSlice-VR2IJSXC.js} +7 -7
- package/{skillDiscovery-GPUDHDTZ.js → skillDiscovery-2QTZINON.js} +3 -3
- package/{spaceCommands-MY26V52L.js → spaceCommands-S5YJJXL7.js} +30 -28
- package/{streamAgentChatTurn-XV5X5TNQ.js → streamAgentChatTurn-QHKP3ABO.js} +77 -64
- package/{switchDialogAgentAction-CJ5H6SAR.js → switchDialogAgentAction-5L4UP7VI.js} +10 -9
- package/{toolApiClient-B2MFXMEG.js → toolApiClient-53U4UDFF.js} +3 -2
- package/{tools-MIMELA2Y.js → tools-SSXSTC3O.js} +37 -32
- package/{tuiSummaryLlmCaller-XJ5BKNNS.js → tuiSummaryLlmCaller-URFJHFC5.js} +17 -15
- package/{updateDialogTitleAction-EIZUSWHR.js → updateDialogTitleAction-YFYAEW3T.js} +28 -24
- package/chunk-6BGAQ3KR.js +0 -7081
- package/chunk-YBV6QJKM.js +0 -441
- package/spaceSlice-JUIXC365.js +0 -127
- package/{chunk-NQ4N4IGO.js → chunk-CS6TCJ7E.js} +3 -3
- package/{chunk-PYKV6FSC.js → chunk-XOJRZUPF.js} +3 -3
|
@@ -0,0 +1,297 @@
|
|
|
1
|
+
import {
|
|
2
|
+
require_react
|
|
3
|
+
} from "./chunk-YDH3FDFQ.js";
|
|
4
|
+
import {
|
|
5
|
+
createSpaceKey,
|
|
6
|
+
normalizeSpaceId
|
|
7
|
+
} from "./chunk-UAD2WT54.js";
|
|
8
|
+
import {
|
|
9
|
+
toTimestampMs
|
|
10
|
+
} from "./chunk-7NYDJAQ7.js";
|
|
11
|
+
import {
|
|
12
|
+
fetchFromServer,
|
|
13
|
+
getAllServers
|
|
14
|
+
} from "./chunk-QOKAKDPE.js";
|
|
15
|
+
import {
|
|
16
|
+
isTombstoneRecord
|
|
17
|
+
} from "./chunk-GBRG75BQ.js";
|
|
18
|
+
import {
|
|
19
|
+
__toESM
|
|
20
|
+
} from "./chunk-4VNS5WPM.js";
|
|
21
|
+
|
|
22
|
+
// packages/create/space/spaceMembershipStore.ts
|
|
23
|
+
var import_react = __toESM(require_react(), 1);
|
|
24
|
+
var createInitialState = () => ({
|
|
25
|
+
memberSpaces: null,
|
|
26
|
+
loading: false,
|
|
27
|
+
membershipStatus: "idle",
|
|
28
|
+
initialized: false
|
|
29
|
+
});
|
|
30
|
+
var state = createInitialState();
|
|
31
|
+
var listeners = /* @__PURE__ */ new Set();
|
|
32
|
+
var version = 0;
|
|
33
|
+
var notify = () => {
|
|
34
|
+
version += 1;
|
|
35
|
+
for (const listener of listeners) {
|
|
36
|
+
try {
|
|
37
|
+
listener();
|
|
38
|
+
} catch {
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
var getMembershipUpdatedAt = (space) => {
|
|
43
|
+
if (!space) return 0;
|
|
44
|
+
return toTimestampMs(
|
|
45
|
+
space.spaceUpdatedAt ?? space.memberUpdatedAt ?? space.updatedAt ?? space.createdAt ?? space.joinedAt
|
|
46
|
+
);
|
|
47
|
+
};
|
|
48
|
+
function dedupeMemberSpacesById(memberSpaces) {
|
|
49
|
+
const membershipMap = /* @__PURE__ */ new Map();
|
|
50
|
+
memberSpaces.forEach((space) => {
|
|
51
|
+
const prev = membershipMap.get(space.spaceId);
|
|
52
|
+
if (!prev || getMembershipUpdatedAt(space) >= getMembershipUpdatedAt(prev)) {
|
|
53
|
+
membershipMap.set(space.spaceId, space);
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
return Array.from(membershipMap.values());
|
|
57
|
+
}
|
|
58
|
+
function getMemberSpaces() {
|
|
59
|
+
return state.memberSpaces;
|
|
60
|
+
}
|
|
61
|
+
function getAllMemberSpaces() {
|
|
62
|
+
const memberSpaces = dedupeMemberSpacesById(state.memberSpaces || []);
|
|
63
|
+
return [...memberSpaces].sort((a, b) => {
|
|
64
|
+
return getMembershipUpdatedAt(b) - getMembershipUpdatedAt(a);
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
function setMemberSpaces(spaces) {
|
|
68
|
+
state = {
|
|
69
|
+
...state,
|
|
70
|
+
memberSpaces: spaces,
|
|
71
|
+
loading: false,
|
|
72
|
+
error: void 0,
|
|
73
|
+
membershipStatus: "fresh",
|
|
74
|
+
initialized: true
|
|
75
|
+
};
|
|
76
|
+
notify();
|
|
77
|
+
}
|
|
78
|
+
function setMembershipLoading() {
|
|
79
|
+
state = { ...state, loading: true, membershipStatus: "loading" };
|
|
80
|
+
notify();
|
|
81
|
+
}
|
|
82
|
+
function setMembershipRejected(errorMessage, isRemoteUnavailable) {
|
|
83
|
+
const membershipStatus = isRemoteUnavailable ? "offline" : state.membershipStatus === "loading" ? "idle" : state.membershipStatus;
|
|
84
|
+
state = {
|
|
85
|
+
...state,
|
|
86
|
+
loading: false,
|
|
87
|
+
error: errorMessage,
|
|
88
|
+
membershipStatus
|
|
89
|
+
};
|
|
90
|
+
notify();
|
|
91
|
+
}
|
|
92
|
+
function hydrateMemberSpacesFromLocal(spaces) {
|
|
93
|
+
if (state.memberSpaces !== null || spaces.length === 0) return;
|
|
94
|
+
state = {
|
|
95
|
+
...state,
|
|
96
|
+
memberSpaces: dedupeMemberSpacesById(spaces),
|
|
97
|
+
loading: false
|
|
98
|
+
};
|
|
99
|
+
notify();
|
|
100
|
+
}
|
|
101
|
+
function appendRecoveredMemberships(recovered) {
|
|
102
|
+
if (!recovered || recovered.length === 0) return;
|
|
103
|
+
if (state.memberSpaces === null) {
|
|
104
|
+
state = {
|
|
105
|
+
...state,
|
|
106
|
+
memberSpaces: dedupeMemberSpacesById(recovered)
|
|
107
|
+
};
|
|
108
|
+
notify();
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
state = {
|
|
112
|
+
...state,
|
|
113
|
+
memberSpaces: dedupeMemberSpacesById([
|
|
114
|
+
...state.memberSpaces,
|
|
115
|
+
...recovered
|
|
116
|
+
]).sort((a, b) => toTimestampMs(b.joinedAt) - toTimestampMs(a.joinedAt))
|
|
117
|
+
};
|
|
118
|
+
notify();
|
|
119
|
+
}
|
|
120
|
+
function setSpaceInitialized() {
|
|
121
|
+
state = { ...state, initialized: true };
|
|
122
|
+
notify();
|
|
123
|
+
}
|
|
124
|
+
function setMembershipLoaded() {
|
|
125
|
+
state = { ...state, loading: false, error: void 0 };
|
|
126
|
+
notify();
|
|
127
|
+
}
|
|
128
|
+
function addMemberSpace(space) {
|
|
129
|
+
const existing = state.memberSpaces || [];
|
|
130
|
+
state = {
|
|
131
|
+
...state,
|
|
132
|
+
memberSpaces: dedupeMemberSpacesById([...existing, space])
|
|
133
|
+
};
|
|
134
|
+
notify();
|
|
135
|
+
}
|
|
136
|
+
function removeMemberSpace(spaceId) {
|
|
137
|
+
if (!state.memberSpaces) return;
|
|
138
|
+
const normalized = normalizeSpaceId(spaceId);
|
|
139
|
+
state = {
|
|
140
|
+
...state,
|
|
141
|
+
memberSpaces: state.memberSpaces.filter(
|
|
142
|
+
(s) => normalizeSpaceId(s.spaceId) !== normalized
|
|
143
|
+
)
|
|
144
|
+
};
|
|
145
|
+
notify();
|
|
146
|
+
}
|
|
147
|
+
function updateMemberSpaceName(spaceId, name) {
|
|
148
|
+
if (!state.memberSpaces || !name) return;
|
|
149
|
+
state = {
|
|
150
|
+
...state,
|
|
151
|
+
memberSpaces: state.memberSpaces.map(
|
|
152
|
+
(space) => space.spaceId === spaceId ? { ...space, spaceName: name } : space
|
|
153
|
+
)
|
|
154
|
+
};
|
|
155
|
+
notify();
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
// packages/create/space/spaceAccess.ts
|
|
159
|
+
var resolveSpaceRemoteServers = (state2) => {
|
|
160
|
+
const currentServer = typeof state2?.settings?.currentServer === "string" ? state2.settings.currentServer : void 0;
|
|
161
|
+
const syncServers = Array.isArray(state2?.settings?.syncServers) ? state2.settings.syncServers : void 0;
|
|
162
|
+
return getAllServers(currentServer, syncServers);
|
|
163
|
+
};
|
|
164
|
+
var selectSpaceRemoteAuth = (state2) => ({
|
|
165
|
+
token: state2?.auth?.currentToken ?? null,
|
|
166
|
+
userId: state2?.auth?.currentUser?.userId ?? null,
|
|
167
|
+
servers: resolveSpaceRemoteServers(state2)
|
|
168
|
+
});
|
|
169
|
+
var spaceListsUser = (spaceData, userId) => {
|
|
170
|
+
if (!spaceData || isTombstoneRecord(spaceData)) return false;
|
|
171
|
+
if (spaceData.ownerId === userId) return true;
|
|
172
|
+
return Array.isArray(spaceData.members) && spaceData.members.includes(userId);
|
|
173
|
+
};
|
|
174
|
+
var membershipBelongsToUser = (membership, userId) => !membership.userId || membership.userId === userId;
|
|
175
|
+
var membershipFetchCache = /* @__PURE__ */ new Map();
|
|
176
|
+
var MEMBERSHIP_FETCH_CACHE_TTL_MS = 3e4;
|
|
177
|
+
async function fetchMembershipsFromServer(server, token, userId, timeoutMs) {
|
|
178
|
+
if (!token) return { ok: false, memberships: [] };
|
|
179
|
+
const controller = new AbortController();
|
|
180
|
+
const timeoutId = setTimeout(() => controller.abort(), timeoutMs);
|
|
181
|
+
try {
|
|
182
|
+
const response = await fetch(`${server}/rpc/getUserSpaceMemberships`, {
|
|
183
|
+
method: "POST",
|
|
184
|
+
headers: {
|
|
185
|
+
Authorization: `Bearer ${token}`,
|
|
186
|
+
"Content-Type": "application/json"
|
|
187
|
+
},
|
|
188
|
+
body: JSON.stringify({ userId }),
|
|
189
|
+
signal: controller.signal
|
|
190
|
+
});
|
|
191
|
+
clearTimeout(timeoutId);
|
|
192
|
+
if (!response.ok) {
|
|
193
|
+
console.error(
|
|
194
|
+
`Failed to fetch memberships from ${server}: ${response.statusText}`
|
|
195
|
+
);
|
|
196
|
+
return { ok: false, memberships: [] };
|
|
197
|
+
}
|
|
198
|
+
const data = await response.json();
|
|
199
|
+
return {
|
|
200
|
+
ok: true,
|
|
201
|
+
server,
|
|
202
|
+
memberships: Array.isArray(data) ? data : []
|
|
203
|
+
};
|
|
204
|
+
} catch (error) {
|
|
205
|
+
clearTimeout(timeoutId);
|
|
206
|
+
console.error(`Error fetching memberships from ${server}:`, error);
|
|
207
|
+
return { ok: false, memberships: [] };
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
var fetchRemoteUserSpaceMemberships = (server, token, userId, timeoutMs = 5e3) => {
|
|
211
|
+
const cacheKey = `${server}|${userId}`;
|
|
212
|
+
const cached = membershipFetchCache.get(cacheKey);
|
|
213
|
+
if (cached) return cached;
|
|
214
|
+
const promise = fetchMembershipsFromServer(server, token, userId, timeoutMs);
|
|
215
|
+
membershipFetchCache.set(cacheKey, promise);
|
|
216
|
+
promise.catch(() => {
|
|
217
|
+
}).finally(() => {
|
|
218
|
+
setTimeout(() => {
|
|
219
|
+
if (membershipFetchCache.get(cacheKey) === promise) {
|
|
220
|
+
membershipFetchCache.delete(cacheKey);
|
|
221
|
+
}
|
|
222
|
+
}, MEMBERSHIP_FETCH_CACHE_TTL_MS);
|
|
223
|
+
});
|
|
224
|
+
return promise;
|
|
225
|
+
};
|
|
226
|
+
var fetchRemoteSpace = async (server, token, spaceId) => {
|
|
227
|
+
try {
|
|
228
|
+
const space = await fetchFromServer(
|
|
229
|
+
server,
|
|
230
|
+
createSpaceKey.space(normalizeSpaceId(spaceId)),
|
|
231
|
+
token ?? void 0
|
|
232
|
+
);
|
|
233
|
+
return space && typeof space === "object" ? space : null;
|
|
234
|
+
} catch {
|
|
235
|
+
return null;
|
|
236
|
+
}
|
|
237
|
+
};
|
|
238
|
+
var hasActiveRemoteMembership = async (server, token, userId, spaceId) => {
|
|
239
|
+
const result = await fetchRemoteUserSpaceMemberships(server, token, userId);
|
|
240
|
+
if (!result.ok) return false;
|
|
241
|
+
const normalizedSpaceId = normalizeSpaceId(spaceId);
|
|
242
|
+
return result.memberships.some((membership) => {
|
|
243
|
+
const membershipSpaceId = typeof membership?.spaceId === "string" ? normalizeSpaceId(membership.spaceId) : "";
|
|
244
|
+
return membershipSpaceId === normalizedSpaceId && membershipBelongsToUser(membership, userId) && !isTombstoneRecord(membership);
|
|
245
|
+
});
|
|
246
|
+
};
|
|
247
|
+
var fetchAuthoritativeRemoteSpace = async ({
|
|
248
|
+
servers,
|
|
249
|
+
token,
|
|
250
|
+
userId,
|
|
251
|
+
spaceId
|
|
252
|
+
}) => {
|
|
253
|
+
const normalizedSpaceId = normalizeSpaceId(spaceId);
|
|
254
|
+
for (const server of servers) {
|
|
255
|
+
const space = await fetchRemoteSpace(server, token, normalizedSpaceId);
|
|
256
|
+
if (!space) continue;
|
|
257
|
+
if (!spaceListsUser(space, userId)) {
|
|
258
|
+
throw new Error(`Current user is not a member of space: ${normalizedSpaceId}`);
|
|
259
|
+
}
|
|
260
|
+
if (space.ownerId !== userId) {
|
|
261
|
+
const hasMembership = await hasActiveRemoteMembership(
|
|
262
|
+
server,
|
|
263
|
+
token,
|
|
264
|
+
userId,
|
|
265
|
+
normalizedSpaceId
|
|
266
|
+
);
|
|
267
|
+
if (!hasMembership) {
|
|
268
|
+
throw new Error(
|
|
269
|
+
`Current user has no active membership for space: ${normalizedSpaceId}`
|
|
270
|
+
);
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
return space;
|
|
274
|
+
}
|
|
275
|
+
return null;
|
|
276
|
+
};
|
|
277
|
+
|
|
278
|
+
export {
|
|
279
|
+
selectSpaceRemoteAuth,
|
|
280
|
+
spaceListsUser,
|
|
281
|
+
membershipBelongsToUser,
|
|
282
|
+
fetchRemoteUserSpaceMemberships,
|
|
283
|
+
fetchRemoteSpace,
|
|
284
|
+
fetchAuthoritativeRemoteSpace,
|
|
285
|
+
getMemberSpaces,
|
|
286
|
+
getAllMemberSpaces,
|
|
287
|
+
setMemberSpaces,
|
|
288
|
+
setMembershipLoading,
|
|
289
|
+
setMembershipRejected,
|
|
290
|
+
hydrateMemberSpacesFromLocal,
|
|
291
|
+
appendRecoveredMemberships,
|
|
292
|
+
setSpaceInitialized,
|
|
293
|
+
setMembershipLoaded,
|
|
294
|
+
addMemberSpace,
|
|
295
|
+
removeMemberSpace,
|
|
296
|
+
updateMemberSpaceName
|
|
297
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
clearCliLocalRuntimePreparedAgentCache
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-5FCIPEKT.js";
|
|
4
4
|
import {
|
|
5
5
|
getReadableCliDb
|
|
6
6
|
} from "./chunk-43CXXVJD.js";
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
resolveAgentRecordFromHybridStore,
|
|
13
13
|
sanitizeAgentRecordForCliOutput,
|
|
14
14
|
writeAgentRecord
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-SYYUU7EV.js";
|
|
16
16
|
import {
|
|
17
17
|
resolveCliAgentKeyInput
|
|
18
18
|
} from "./chunk-EKLRRZIN.js";
|
|
@@ -1,72 +1,15 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createSpaceKey
|
|
3
|
+
} from "./chunk-UAD2WT54.js";
|
|
1
4
|
import {
|
|
2
5
|
patch,
|
|
3
6
|
read
|
|
4
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-7NYDJAQ7.js";
|
|
5
8
|
import {
|
|
6
9
|
DEVICE_LOCAL_OWNER_ID,
|
|
7
10
|
isDeviceLocalSpaceBody,
|
|
8
11
|
selectIdentityUserId
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
|
|
11
|
-
// packages/create/space/spaceKeys.ts
|
|
12
|
-
var SEPARATOR = "-";
|
|
13
|
-
var SPACE_PREFIX = "space";
|
|
14
|
-
var SPACE_PREFIX_WITH_SEPARATOR = `${SPACE_PREFIX}${SEPARATOR}`;
|
|
15
|
-
var normalizeSpaceId = (spaceId) => {
|
|
16
|
-
if (!spaceId) return spaceId;
|
|
17
|
-
return spaceId.startsWith(SPACE_PREFIX_WITH_SEPARATOR) ? spaceId.slice(SPACE_PREFIX_WITH_SEPARATOR.length) : spaceId;
|
|
18
|
-
};
|
|
19
|
-
var createSpaceKey = {
|
|
20
|
-
// 空间基础信息的key
|
|
21
|
-
space: (spaceId) => {
|
|
22
|
-
return [SPACE_PREFIX, normalizeSpaceId(spaceId)].join(SEPARATOR);
|
|
23
|
-
},
|
|
24
|
-
// 空间成员的key
|
|
25
|
-
member: (userId, spaceId) => {
|
|
26
|
-
return [SPACE_PREFIX, "member", userId, normalizeSpaceId(spaceId)].join(
|
|
27
|
-
SEPARATOR
|
|
28
|
-
);
|
|
29
|
-
},
|
|
30
|
-
// 查询用户所在的所有空间的范围
|
|
31
|
-
memberRange: (userId) => {
|
|
32
|
-
return {
|
|
33
|
-
start: [SPACE_PREFIX, "member", userId, ""].join(SEPARATOR),
|
|
34
|
-
end: [SPACE_PREFIX, "member", userId, "\uFFFF"].join(SEPARATOR)
|
|
35
|
-
};
|
|
36
|
-
},
|
|
37
|
-
/**
|
|
38
|
-
* 预留:未来若出现“按用户、按空间、且必须跨设备同步”的空间级偏好,
|
|
39
|
-
* 统一使用这个 key family。当前产品主链不要依赖它。
|
|
40
|
-
*/
|
|
41
|
-
setting: (userId, spaceId) => {
|
|
42
|
-
return [SPACE_PREFIX, "setting", userId, normalizeSpaceId(spaceId)].join(
|
|
43
|
-
SEPARATOR
|
|
44
|
-
);
|
|
45
|
-
},
|
|
46
|
-
/**
|
|
47
|
-
* 预留:未来如确实需要批量读取空间级远端偏好,再使用这个范围。
|
|
48
|
-
*/
|
|
49
|
-
settingRange: (userId) => {
|
|
50
|
-
return {
|
|
51
|
-
start: [SPACE_PREFIX, "setting", userId, ""].join(SEPARATOR),
|
|
52
|
-
end: [SPACE_PREFIX, "setting", userId, "\uFFFF"].join(SEPARATOR)
|
|
53
|
-
};
|
|
54
|
-
},
|
|
55
|
-
// 从成员key中提取空间key
|
|
56
|
-
// 成员 key 格式: space-member-{userId}-{spaceId}
|
|
57
|
-
// userId 是单段(无连字符),spaceId 是 ULID(无连字符)
|
|
58
|
-
spaceFromMember: (memberKey) => {
|
|
59
|
-
const parts = memberKey.split(SEPARATOR);
|
|
60
|
-
if (parts.length < 4) return "";
|
|
61
|
-
const spaceId = parts[parts.length - 1];
|
|
62
|
-
return [SPACE_PREFIX, spaceId].join(SEPARATOR);
|
|
63
|
-
},
|
|
64
|
-
// 从成员key中提取空间ID
|
|
65
|
-
spaceIdFromMember: (memberKey) => {
|
|
66
|
-
const parts = memberKey.split(SEPARATOR);
|
|
67
|
-
return parts.length >= 4 ? parts[parts.length - 1] : "";
|
|
68
|
-
}
|
|
69
|
-
};
|
|
12
|
+
} from "./chunk-XOJRZUPF.js";
|
|
70
13
|
|
|
71
14
|
// packages/create/space/utils/permissions.ts
|
|
72
15
|
var checkSpaceMembership = (spaceData, userId) => {
|
|
@@ -163,8 +106,6 @@ var addContentAction = async (input, thunkAPI) => {
|
|
|
163
106
|
};
|
|
164
107
|
|
|
165
108
|
export {
|
|
166
|
-
normalizeSpaceId,
|
|
167
|
-
createSpaceKey,
|
|
168
109
|
checkSpaceMembership,
|
|
169
110
|
localSpaceAuthorityPatchStamp,
|
|
170
111
|
UNCATEGORIZED_ID,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getModelConfig
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-SVDMVX4G.js";
|
|
4
4
|
import {
|
|
5
5
|
isPlatformHostedDeepseekModel,
|
|
6
6
|
isPlatformHostedOpenAIImageModel,
|
|
7
7
|
resolvePlatformHostedRouting
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-HPW5MNDQ.js";
|
|
9
9
|
import {
|
|
10
10
|
asTrimmedLowercaseString
|
|
11
11
|
} from "./chunk-QSJ3HFEF.js";
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
getAntigravityUserAgent,
|
|
12
12
|
normalizeAntigravityTokenPayload,
|
|
13
13
|
refreshAntigravityToken
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-BG7J6Y5X.js";
|
|
15
15
|
import {
|
|
16
16
|
writeOAuthCredential
|
|
17
17
|
} from "./chunk-FD36SCCD.js";
|
|
@@ -21,12 +21,12 @@ import {
|
|
|
21
21
|
import {
|
|
22
22
|
asOptionalFiniteNumber
|
|
23
23
|
} from "./chunk-WWC7I6TA.js";
|
|
24
|
-
import {
|
|
25
|
-
isRecord
|
|
26
|
-
} from "./chunk-KUG52IAP.js";
|
|
27
24
|
import {
|
|
28
25
|
asTrimmedString
|
|
29
26
|
} from "./chunk-3EUW3WEO.js";
|
|
27
|
+
import {
|
|
28
|
+
isRecord
|
|
29
|
+
} from "./chunk-KUG52IAP.js";
|
|
30
30
|
|
|
31
31
|
// packages/cli/oauth/callback-server.ts
|
|
32
32
|
import { createServer } from "node:http";
|
|
@@ -2393,29 +2393,6 @@ var require_rambda = __commonJS({
|
|
|
2393
2393
|
}
|
|
2394
2394
|
});
|
|
2395
2395
|
|
|
2396
|
-
// packages/create/types.ts
|
|
2397
|
-
var DataType = /* @__PURE__ */ ((DataType2) => {
|
|
2398
|
-
DataType2["AGENT"] = "agent";
|
|
2399
|
-
DataType2["DOC"] = "page";
|
|
2400
|
-
DataType2["DIALOG"] = "dialog";
|
|
2401
|
-
DataType2["NOTIFICATION"] = "notification";
|
|
2402
|
-
DataType2["MSG"] = "msg";
|
|
2403
|
-
DataType2["TOKEN"] = "token";
|
|
2404
|
-
DataType2["SPACE"] = "space";
|
|
2405
|
-
DataType2["TRANSACTION"] = "transaction";
|
|
2406
|
-
DataType2["SETTING"] = "setting";
|
|
2407
|
-
DataType2["TASK"] = "task";
|
|
2408
|
-
DataType2["AGENT_AUTOMATION"] = "agent-automation";
|
|
2409
|
-
DataType2["TABLE"] = "table";
|
|
2410
|
-
DataType2["TABLE_ROW"] = "table_row";
|
|
2411
|
-
DataType2["FILE"] = "file";
|
|
2412
|
-
DataType2["IMAGE"] = "image";
|
|
2413
|
-
DataType2["APP"] = "app";
|
|
2414
|
-
DataType2["EMAIL"] = "email";
|
|
2415
|
-
DataType2["Category"] = "category";
|
|
2416
|
-
return DataType2;
|
|
2417
|
-
})(DataType || {});
|
|
2418
|
-
|
|
2419
2396
|
// packages/core/toTrimmedString.ts
|
|
2420
2397
|
function toTrimmedString(value) {
|
|
2421
2398
|
return typeof value === "string" ? value.trim() : value == null ? "" : String(value).trim();
|
|
@@ -3192,7 +3169,6 @@ var sanitizeShareData = (data) => {
|
|
|
3192
3169
|
};
|
|
3193
3170
|
|
|
3194
3171
|
export {
|
|
3195
|
-
DataType,
|
|
3196
3172
|
ulid,
|
|
3197
3173
|
toTrimmedString,
|
|
3198
3174
|
toNonEmptyString,
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
openrouterModels,
|
|
5
5
|
platformHostedModels,
|
|
6
6
|
zaiModels
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-HPW5MNDQ.js";
|
|
8
8
|
|
|
9
9
|
// packages/ai/llm/modelAbility.ts
|
|
10
10
|
var MODEL_ABILITY_TABLE = {
|
|
@@ -24,6 +24,8 @@ var MODEL_ABILITY_TABLE = {
|
|
|
24
24
|
"claude-sonnet-5": { passAt1: 54, benchmarkScore: 53 },
|
|
25
25
|
"deepseek-v4-flash": { passAt1: 53 },
|
|
26
26
|
"gemini-3.7-flash": { passAt1: 58, benchmarkScore: 65, writingScore: 88 },
|
|
27
|
+
// TODO(benchmark): gemini-3.8-flash 官方基准快照未出,暂沿用 3.7 分数占位,确认后更新。
|
|
28
|
+
"gemini-3.8-flash": { passAt1: 58, benchmarkScore: 65, writingScore: 88 },
|
|
27
29
|
"muse-spark-1.1": { passAt1: 53 },
|
|
28
30
|
"gpt-5.4": { passAt1: 52 },
|
|
29
31
|
"gemini-3.6-flash": { passAt1: 49, benchmarkScore: 50 },
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
i18n_default,
|
|
3
3
|
toolRegistry
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-TR4DXUYX.js";
|
|
5
5
|
import {
|
|
6
6
|
canonicalizeToolNames
|
|
7
7
|
} from "./chunk-O6OSWFZQ.js";
|
|
8
8
|
import {
|
|
9
9
|
isNoloHostedProvider
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-HPW5MNDQ.js";
|
|
11
11
|
import {
|
|
12
12
|
asTrimmedLowercaseString
|
|
13
13
|
} from "./chunk-QSJ3HFEF.js";
|
|
@@ -432,11 +432,18 @@ function createRunActivityTracker(runId, deps = {}, options = {}) {
|
|
|
432
432
|
}
|
|
433
433
|
function doWrite() {
|
|
434
434
|
writeTimer = void 0;
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
435
|
+
withRunRecordLock(
|
|
436
|
+
runId,
|
|
437
|
+
deps,
|
|
438
|
+
() => {
|
|
439
|
+
const record = readRunRecord(runId, deps);
|
|
440
|
+
if (!record) return;
|
|
441
|
+
const activity = serializeActivity();
|
|
442
|
+
writeRunRecord({ ...record, activity }, deps);
|
|
443
|
+
lastWriteAt = now().getTime();
|
|
444
|
+
},
|
|
445
|
+
{ strict: true }
|
|
446
|
+
);
|
|
440
447
|
}
|
|
441
448
|
function scheduleWrite() {
|
|
442
449
|
if (writeTimer !== void 0) return;
|
|
@@ -498,6 +505,16 @@ function readRunRecord(runId, deps = {}) {
|
|
|
498
505
|
}
|
|
499
506
|
return null;
|
|
500
507
|
}
|
|
508
|
+
function backfillRunRecordParentDialog(runId, parentDialogId, deps = {}) {
|
|
509
|
+
if (!parentDialogId) return false;
|
|
510
|
+
const updated = withRunRecordLock(runId, deps, () => {
|
|
511
|
+
const record = readRunRecord(runId, deps);
|
|
512
|
+
if (!record || record.parentDialogId) return false;
|
|
513
|
+
writeRunRecord({ ...record, parentDialogId }, deps);
|
|
514
|
+
return true;
|
|
515
|
+
});
|
|
516
|
+
return updated === true;
|
|
517
|
+
}
|
|
501
518
|
function listRunRecords(deps = {}) {
|
|
502
519
|
const fs = deps.fs ?? nodeFs;
|
|
503
520
|
const dir = resolveRunsDir(deps.env, deps.homedir);
|
|
@@ -888,6 +905,9 @@ function finalizeRunRecord(runId, update, deps = {}) {
|
|
|
888
905
|
record.status = update.status;
|
|
889
906
|
if (typeof update.exitCode === "number") record.exitCode = update.exitCode;
|
|
890
907
|
if (update.dialogId) record.dialogId = update.dialogId;
|
|
908
|
+
if (typeof update.credits === "number" && Number.isFinite(update.credits)) {
|
|
909
|
+
record.credits = update.credits;
|
|
910
|
+
}
|
|
891
911
|
record.endedAt = now().toISOString();
|
|
892
912
|
if (record.note?.startsWith("orphaned:")) record.note = void 0;
|
|
893
913
|
writeRunRecord(record, deps);
|
|
@@ -964,7 +984,7 @@ function checkStaleRun(runId, deps = {}) {
|
|
|
964
984
|
latest.pid = void 0;
|
|
965
985
|
writeRunRecord(latest, deps);
|
|
966
986
|
return latest;
|
|
967
|
-
});
|
|
987
|
+
}) ?? record;
|
|
968
988
|
}
|
|
969
989
|
function formatDuration(startedAt, endedAt) {
|
|
970
990
|
const start = new Date(startedAt).getTime();
|
|
@@ -1391,6 +1411,7 @@ export {
|
|
|
1391
1411
|
writeRunRecord,
|
|
1392
1412
|
createRunActivityTracker,
|
|
1393
1413
|
readRunRecord,
|
|
1414
|
+
backfillRunRecordParentDialog,
|
|
1394
1415
|
listRunRecords,
|
|
1395
1416
|
findRunRecordByPid,
|
|
1396
1417
|
findRunRecord,
|
|
@@ -13,18 +13,18 @@ import {
|
|
|
13
13
|
toTimestampMs,
|
|
14
14
|
upsert,
|
|
15
15
|
write
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-7NYDJAQ7.js";
|
|
17
17
|
import {
|
|
18
18
|
createUserKey,
|
|
19
19
|
createUserPreferenceKey,
|
|
20
20
|
ulid
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-NHRQCXIQ.js";
|
|
22
22
|
import {
|
|
23
23
|
asTrimmedLowercaseString
|
|
24
24
|
} from "./chunk-QSJ3HFEF.js";
|
|
25
25
|
import {
|
|
26
26
|
BUILTIN_NOLO_AGENT_KEY
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-2WBFJHQA.js";
|
|
28
28
|
import {
|
|
29
29
|
asyncThunkCreator,
|
|
30
30
|
buildCreateSlice,
|
|
@@ -32,7 +32,7 @@ import {
|
|
|
32
32
|
createAsyncThunk,
|
|
33
33
|
createSelector,
|
|
34
34
|
selectIdentityUserId
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-XOJRZUPF.js";
|
|
36
36
|
import {
|
|
37
37
|
getAllServers,
|
|
38
38
|
getIsDesktopApp,
|
|
@@ -923,7 +923,7 @@ var initialState = {
|
|
|
923
923
|
editorFontFamily: "SF Mono, Monaco, Cascadia Code, Roboto Mono, monospace",
|
|
924
924
|
enableReadCurrentSpace: true,
|
|
925
925
|
globalPrompt: "",
|
|
926
|
-
userTonePreset: "",
|
|
926
|
+
userTonePreset: "default",
|
|
927
927
|
knowledgeCaptureLevel: DEFAULT_USER_PREFERENCE_PROFILE.knowledgeCaptureLevel,
|
|
928
928
|
spaceContextLevel: DEFAULT_USER_PREFERENCE_PROFILE.spaceContextLevel,
|
|
929
929
|
autoApproveSelfUpdateFields: [...DEFAULT_AUTO_APPROVED_SELF_UPDATE_FIELDS],
|