nolo-cli 0.8.0-alpha.12 → 0.8.0-alpha.14
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-JOUHEEDS.js → _executeModel-KBMAUV6G.js} +26 -22
- package/{action-PAXRPJJF.js → action-SQGI5JY5.js} +5 -4
- package/{addContentAction-CZVWF3QZ.js → addContentAction-ZX2PUS3X.js} +4 -3
- package/{addDialogAgentAction-CCIDTPHC.js → addDialogAgentAction-ULADQX2Q.js} +3 -2
- package/{agentDeleteCommand-TVJH2JID.js → agentDeleteCommand-GNVYHOGZ.js} +11 -8
- package/{agentEmailCommands-TB2RKQJL.js → agentEmailCommands-QETL62SU.js} +29 -25
- package/{agentListCommands-GVD6ZQ3B.js → agentListCommands-FM4OWXYT.js} +12 -9
- package/{agentMachineCommands-UJI6CDKE.js → agentMachineCommands-LDHJBWQO.js} +11 -8
- package/{agentRecordCommands-IQBFI3QO.js → agentRecordCommands-UW76EZ25.js} +29 -25
- package/{agentRunCommand-VCQ5ONRC.js → agentRunCommand-UFBOW4ZF.js} +33 -26
- package/{agentRuntimeLocal-JTCFVEEL.js → agentRuntimeLocal-XL5PLRJV.js} +16 -12
- package/{agentSlice-NZMLVXT5.js → agentSlice-2IBSFH4O.js} +5 -4
- package/{authCommand-WXMD3IPR.js → authCommand-PXFX6JDT.js} +8 -1
- package/{authCommands-X74AFDTC.js → authCommands-356AYWEK.js} +10 -1
- package/{chunk-FUU63UA7.js → chunk-2IRF4LEX.js} +418 -12
- package/chunk-3TZDXYSF.js +71 -0
- package/chunk-4ZDM73SD.js +34 -0
- package/{chunk-TDIQFT2F.js → chunk-5CS33IBL.js} +1 -1
- package/{chunk-IYQV26RA.js → chunk-6A3LI5TZ.js} +2 -2
- package/{chunk-VEJLAVTC.js → chunk-6CBN7GGH.js} +2 -2
- package/{chunk-BSTNFPHD.js → chunk-6XKX2N2E.js} +1 -1
- package/{chunk-IEPE5Z7Y.js → chunk-7IPLJUYC.js} +1 -1
- package/{chunk-6VTZSYDT.js → chunk-B6DFDN4R.js} +2 -2
- package/{chunk-QNCWJXVH.js → chunk-BKPVTIEK.js} +4 -4
- package/{chunk-LM25IZBJ.js → chunk-DG7AAAR3.js} +1 -1
- package/{chunk-K367HWYT.js → chunk-DGFWICQJ.js} +1 -1
- package/chunk-DSNONPGW.js +386 -0
- package/{chunk-GH7LOVLY.js → chunk-EQHI2AR3.js} +21 -17
- package/{chunk-OF5H3QWS.js → chunk-EXTIQUCI.js} +182 -0
- package/chunk-I42VC5KR.js +15 -0
- package/{chunk-FY4NQTEC.js → chunk-I6DI7SGU.js} +41 -19
- package/chunk-JEXVIMYZ.js +55 -0
- package/{chunk-4EPRP7A3.js → chunk-JRPR5M4O.js} +2 -2
- package/{chunk-VJEKUYDK.js → chunk-JW43YCM5.js} +1 -1
- package/{chunk-GSENGCXB.js → chunk-MMRAIO5Y.js} +3 -3
- package/{chunk-AAKR4CKW.js → chunk-MXLQWBVM.js} +1 -88
- package/chunk-OPZYGHUC.js +89 -0
- package/{chunk-J4576WMJ.js → chunk-PCWC3JTN.js} +1 -1
- package/{chunk-6HSAQUHW.js → chunk-PFUCDPUH.js} +19 -20
- package/{chunk-HEIIIZBX.js → chunk-Q2YZULBH.js} +1 -1
- package/{chunk-6G3WLUY5.js → chunk-QKRUUZCL.js} +6 -6
- package/{chunk-IAXBCTTE.js → chunk-QO4YO77G.js} +2 -2
- package/{chunk-NDZOFKHS.js → chunk-QTFSBLCF.js} +8 -15
- package/{chunk-RAUV2V7X.js → chunk-RJKDVL4L.js} +2 -2
- package/{chunk-MTV2I4IF.js → chunk-RLCFUU46.js} +3 -3
- package/{chunk-OF6IBT3Z.js → chunk-RTZFUR3V.js} +5 -5
- package/{chunk-U5CWPEKM.js → chunk-SACYB45H.js} +19 -378
- package/{chunk-PN7AFLOK.js → chunk-SH2CFQOH.js} +3 -13
- package/{chunk-CM54RSSA.js → chunk-SL35K7AH.js} +21 -1
- package/{chunk-OW6OA65Z.js → chunk-SRLZ7IVA.js} +170 -176
- package/{chunk-VEWET5JQ.js → chunk-TWPGVS2U.js} +2 -2
- package/{chunk-G5H7RNFL.js → chunk-V2AISYMA.js} +2 -2
- package/{chunk-5KDNEBJR.js → chunk-VH4YK6KZ.js} +14 -4
- package/{chunk-AUGHVUFE.js → chunk-YYUCRDOK.js} +1 -1
- package/{chunk-H2RMRZJE.js → chunk-ZDXZSXYQ.js} +1 -1
- package/{chunk-NXZGF7F7.js → chunk-ZQ2UM4KG.js} +1 -1
- package/{createAgentAutomationAction-CGYKGZQK.js → createAgentAutomationAction-CSWOQOY5.js} +12 -10
- package/{createDialogAction-W34WVXOG.js → createDialogAction-6VWL2TDI.js} +15 -13
- package/{createPageAction-BX3BTTBM.js → createPageAction-INRC4MH2.js} +13 -11
- package/{dbSlice-C4UJLRZP.js → dbSlice-TO2TSMWM.js} +3 -2
- package/{dialogCommands-DS6WHBNJ.js → dialogCommands-DWSE4PMW.js} +13 -10
- package/{dialogSlice-3QIHGXBA.js → dialogSlice-CELFVS3F.js} +12 -10
- package/{docCreateCommands-X6ACQKZU.js → docCreateCommands-UFJL5PUM.js} +12 -9
- package/{docDeleteCommands-NS7VBNDH.js → docDeleteCommands-XHEIBAB2.js} +13 -10
- package/{docReadCommands-U5PGIWTF.js → docReadCommands-PEDIC2CW.js} +12 -9
- package/{docStore-ZUQS4K5X.js → docStore-Q5AFYT6G.js} +13 -11
- package/{docUpdateCommands-MKUDMRFB.js → docUpdateCommands-WBRODQ7P.js} +12 -9
- package/{fetchMessages-JOCYIFKL.js → fetchMessages-U6ZHN56A.js} +3 -2
- package/{handleSendMessageAction-T4LFZFCM.js → handleSendMessageAction-PPIGKCBQ.js} +12 -10
- package/index.js +49 -45
- package/{localDialogRead-D3BELSTF.js → localDialogRead-Z5UTAJPU.js} +1 -1
- package/{machineCommands-EFFHN5DU.js → machineCommands-3D7JMHUP.js} +28 -24
- package/{machineWsRunDispatch-NXBROTNC.js → machineWsRunDispatch-PA5BR4AX.js} +28 -24
- package/package.json +1 -1
- package/{readlineWorkspace-32SJR27M.js → readlineWorkspace-7WPA5OUS.js} +166 -32
- package/{removeDialogAgentAction-CXLST3N6.js → removeDialogAgentAction-3MUQGFZX.js} +5 -4
- package/{runAgentClientLoop-AUA4XII6.js → runAgentClientLoop-DRAXPP6R.js} +21 -19
- package/{setDialogExtraReferencesAction-LP6VYGU7.js → setDialogExtraReferencesAction-MXHX2HPK.js} +3 -2
- package/{setPrimaryDialogAgentAction-D3GGH23T.js → setPrimaryDialogAgentAction-7DLDZHDT.js} +5 -4
- package/{settingSlice-J4I3Z5H7.js → settingSlice-PNLASZGI.js} +4 -3
- package/{spaceCommands-JLMZTC3V.js → spaceCommands-ORSFAWEY.js} +11 -8
- package/{spaceSlice-ECPEQE5G.js → spaceSlice-5F2CDP2O.js} +12 -10
- package/{streamAgentChatTurn-5UNGDRXQ.js → streamAgentChatTurn-ROOB5RLM.js} +29 -27
- package/{tools-BLAZGXMF.js → tools-BAWXW4F6.js} +19 -17
- package/tuiSummaryLlmCaller-JSI4GL6W.js +78 -0
- package/{understanding-HCSFPE7R.js → understanding-GQKNDDWM.js} +7 -54
- package/{updateDialogTitleAction-Y4SKBCZX.js → updateDialogTitleAction-KJM65IGF.js} +14 -11
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
buildLocalAgentLookupKeys,
|
|
9
9
|
normalizeAgentHandle,
|
|
10
10
|
shouldReadAgentKeyRemotely
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-DGFWICQJ.js";
|
|
12
12
|
import {
|
|
13
13
|
LOCAL_CODEX_AGENT_ID,
|
|
14
14
|
LOCAL_CODEX_AGENT_KEY,
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
} from "./chunk-VHBWHNVT.js";
|
|
18
18
|
import {
|
|
19
19
|
inferCaptureIntent
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-6XKX2N2E.js";
|
|
21
21
|
import {
|
|
22
22
|
CliProviderQuotaError,
|
|
23
23
|
executeCli
|
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
} from "./chunk-ATNTHIZI.js";
|
|
28
28
|
import {
|
|
29
29
|
prepareTools
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-JRPR5M4O.js";
|
|
31
31
|
import {
|
|
32
32
|
getAntigravityUserAgent,
|
|
33
33
|
isAntigravityOAuthAgent,
|
|
@@ -43,16 +43,16 @@ import {
|
|
|
43
43
|
readXPostFunctionSchema,
|
|
44
44
|
readXhsProfileFunc,
|
|
45
45
|
readXhsProfileFunctionSchema
|
|
46
|
-
} from "./chunk-
|
|
46
|
+
} from "./chunk-I6DI7SGU.js";
|
|
47
47
|
import {
|
|
48
48
|
normalizeDialogTitle
|
|
49
49
|
} from "./chunk-OWOHNGCN.js";
|
|
50
50
|
import {
|
|
51
51
|
BUILTIN_TITLE_LLM_CONFIG
|
|
52
|
-
} from "./chunk-
|
|
52
|
+
} from "./chunk-4ZDM73SD.js";
|
|
53
53
|
import {
|
|
54
54
|
fetchServerSyncedCredential
|
|
55
|
-
} from "./chunk-
|
|
55
|
+
} from "./chunk-QKRUUZCL.js";
|
|
56
56
|
import {
|
|
57
57
|
isCompiledBinary,
|
|
58
58
|
parseUserIdFromAuthToken
|
|
@@ -65,29 +65,31 @@ import {
|
|
|
65
65
|
buildLocalWorkspaceOpenAiTools,
|
|
66
66
|
buildLocalWorkspacePolicyToolNames,
|
|
67
67
|
buildLocalWorkspaceToolset,
|
|
68
|
-
buildPlatformChatCompletionRequest,
|
|
69
|
-
canUsePlatformChatProvider,
|
|
70
68
|
createHybridRecordStore,
|
|
71
69
|
createLocalWorkspaceToolExecutors,
|
|
72
70
|
dialogMessageRecordToAgentRuntimeMessage,
|
|
73
71
|
executeLocalToolWithPolicy,
|
|
74
72
|
executeOpenAiCompatibleChatCompletion,
|
|
75
|
-
parsePlatformChatCompletionData,
|
|
76
|
-
parsePlatformChatCompletionResponse,
|
|
77
73
|
parseSseDataLineJson,
|
|
78
74
|
readOpenAiCompatibleSseCompletion,
|
|
75
|
+
resolveOpenAiCompatibleProviderConfig
|
|
76
|
+
} from "./chunk-SACYB45H.js";
|
|
77
|
+
import {
|
|
78
|
+
buildPlatformChatCompletionRequest,
|
|
79
|
+
canUsePlatformChatProvider,
|
|
80
|
+
parsePlatformChatCompletionData,
|
|
81
|
+
parsePlatformChatCompletionResponse,
|
|
79
82
|
readSseDataValues,
|
|
80
|
-
resolveOpenAiCompatibleProviderConfig,
|
|
81
83
|
resolvePlatformChatProviderConfig,
|
|
82
84
|
shouldUsePlatformChatProvider
|
|
83
|
-
} from "./chunk-
|
|
85
|
+
} from "./chunk-DSNONPGW.js";
|
|
84
86
|
import {
|
|
85
87
|
resolveAgentRuntimeConfigFromRecord
|
|
86
88
|
} from "./chunk-TILFE6LV.js";
|
|
87
89
|
import {
|
|
88
90
|
parseToolArgumentsJson,
|
|
89
91
|
summarizeToolArguments
|
|
90
|
-
} from "./chunk-
|
|
92
|
+
} from "./chunk-MXLQWBVM.js";
|
|
91
93
|
import {
|
|
92
94
|
buildNoloWorkspaceCliToolExecutors,
|
|
93
95
|
buildNoloWorkspaceOpenAiTools,
|
|
@@ -95,7 +97,7 @@ import {
|
|
|
95
97
|
filterNoloWorkspaceToolNames,
|
|
96
98
|
parseNoloWorkspaceToolArguments,
|
|
97
99
|
resolveRuntimeToolSurfaceForAgent
|
|
98
|
-
} from "./chunk-
|
|
100
|
+
} from "./chunk-DG7AAAR3.js";
|
|
99
101
|
import {
|
|
100
102
|
clipCompactText
|
|
101
103
|
} from "./chunk-5MMAK75Q.js";
|
|
@@ -104,7 +106,7 @@ import {
|
|
|
104
106
|
resolveCurrentRunRuntimeToolPolicy,
|
|
105
107
|
resolveLocalWorkspaceExecutorOptionsFromPolicy,
|
|
106
108
|
resolveRequestedRuntimeToolNames
|
|
107
|
-
} from "./chunk-
|
|
109
|
+
} from "./chunk-5CS33IBL.js";
|
|
108
110
|
import {
|
|
109
111
|
createOAuthTokenStore,
|
|
110
112
|
isTokenExpired,
|
|
@@ -121,10 +123,12 @@ import {
|
|
|
121
123
|
asRecordOrEmpty
|
|
122
124
|
} from "./chunk-KX6YBIHG.js";
|
|
123
125
|
import {
|
|
124
|
-
asTrimmedNonEmptyStringArray,
|
|
125
126
|
dialogMessageRange,
|
|
126
127
|
require_index_umd
|
|
127
|
-
} from "./chunk-
|
|
128
|
+
} from "./chunk-SH2CFQOH.js";
|
|
129
|
+
import {
|
|
130
|
+
asTrimmedNonEmptyStringArray
|
|
131
|
+
} from "./chunk-I42VC5KR.js";
|
|
128
132
|
import {
|
|
129
133
|
asOptionalFiniteNumber
|
|
130
134
|
} from "./chunk-WWC7I6TA.js";
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import {
|
|
2
|
+
resolveMachineId
|
|
3
|
+
} from "./chunk-6HYVJV7B.js";
|
|
1
4
|
import {
|
|
2
5
|
buildCliRuntimeEnv,
|
|
3
6
|
clearProfileAuthToken,
|
|
@@ -12,6 +15,21 @@ import {
|
|
|
12
15
|
import {
|
|
13
16
|
DEFAULT_NOLO_SERVER_URL
|
|
14
17
|
} from "./chunk-OLZBQWZU.js";
|
|
18
|
+
import {
|
|
19
|
+
getDefaultCliLocalRuntimeDb
|
|
20
|
+
} from "./chunk-H33743XH.js";
|
|
21
|
+
import {
|
|
22
|
+
createMemoryKey,
|
|
23
|
+
createMemoryOwnerIndexKey,
|
|
24
|
+
createMemorySubjectKindIndexKey,
|
|
25
|
+
memoryOwnerRange
|
|
26
|
+
} from "./chunk-SH2CFQOH.js";
|
|
27
|
+
import {
|
|
28
|
+
asTrimmedNonEmptyStringArray
|
|
29
|
+
} from "./chunk-I42VC5KR.js";
|
|
30
|
+
import {
|
|
31
|
+
asTrimmedString
|
|
32
|
+
} from "./chunk-3EUW3WEO.js";
|
|
15
33
|
import {
|
|
16
34
|
normalizeServerOrigin
|
|
17
35
|
} from "./chunk-CF7PE763.js";
|
|
@@ -20,6 +38,151 @@ import {
|
|
|
20
38
|
import { createInterface } from "node:readline/promises";
|
|
21
39
|
import { stdin as input, stdout as output } from "node:process";
|
|
22
40
|
import { spawn } from "node:child_process";
|
|
41
|
+
|
|
42
|
+
// packages/ai/memory/delete.ts
|
|
43
|
+
var normalizeSet = (values) => {
|
|
44
|
+
if (!Array.isArray(values) || values.length === 0) return null;
|
|
45
|
+
const normalized = asTrimmedNonEmptyStringArray(values);
|
|
46
|
+
return normalized.length > 0 ? new Set(normalized) : null;
|
|
47
|
+
};
|
|
48
|
+
var matchesFilters = (item, filters) => {
|
|
49
|
+
const idSet = normalizeSet(filters.ids);
|
|
50
|
+
if (idSet && !idSet.has(item.id)) return false;
|
|
51
|
+
const kindSet = normalizeSet(filters.kinds);
|
|
52
|
+
if (kindSet && !kindSet.has(item.kind)) return false;
|
|
53
|
+
const facetSet = normalizeSet(filters.facets);
|
|
54
|
+
if (facetSet && (!item.facet || !facetSet.has(item.facet))) return false;
|
|
55
|
+
if (filters.subjectType && item.subjectType !== filters.subjectType) return false;
|
|
56
|
+
if (filters.subjectId && item.subjectId !== filters.subjectId) return false;
|
|
57
|
+
const prefix = asTrimmedString(filters.patternKeyPrefix);
|
|
58
|
+
if (prefix && !(item.patternKey ?? "").startsWith(prefix)) return false;
|
|
59
|
+
if (filters.sourceDialogId && item.sourceDialogId !== filters.sourceDialogId) {
|
|
60
|
+
return false;
|
|
61
|
+
}
|
|
62
|
+
const tagSet = normalizeSet(filters.tags);
|
|
63
|
+
if (tagSet) {
|
|
64
|
+
const itemTags = new Set(asTrimmedNonEmptyStringArray(item.tags));
|
|
65
|
+
for (const tag of tagSet) {
|
|
66
|
+
if (!itemTags.has(tag)) return false;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
return true;
|
|
70
|
+
};
|
|
71
|
+
var deleteMemoryItemWithIndexesInBatch = (batch, item) => {
|
|
72
|
+
batch.del(createMemoryKey(item.ownerType, item.ownerId, item.id));
|
|
73
|
+
batch.del(
|
|
74
|
+
createMemoryOwnerIndexKey(
|
|
75
|
+
item.ownerType,
|
|
76
|
+
item.ownerId,
|
|
77
|
+
item.createdAt,
|
|
78
|
+
item.id
|
|
79
|
+
)
|
|
80
|
+
);
|
|
81
|
+
batch.del(
|
|
82
|
+
createMemorySubjectKindIndexKey(
|
|
83
|
+
item.subjectType,
|
|
84
|
+
item.subjectId,
|
|
85
|
+
item.kind,
|
|
86
|
+
item.createdAt,
|
|
87
|
+
item.id
|
|
88
|
+
)
|
|
89
|
+
);
|
|
90
|
+
};
|
|
91
|
+
var deleteMemoriesForOwnerFromDb = async (db, owner, filters = {}) => {
|
|
92
|
+
const range = memoryOwnerRange(owner.ownerType, owner.ownerId);
|
|
93
|
+
const matchedItems = [];
|
|
94
|
+
const limit = typeof filters.limit === "number" && filters.limit > 0 ? filters.limit : Number.POSITIVE_INFINITY;
|
|
95
|
+
for await (const [, value] of db.iterator({
|
|
96
|
+
gte: range.start,
|
|
97
|
+
lte: range.end,
|
|
98
|
+
reverse: true
|
|
99
|
+
})) {
|
|
100
|
+
const memoryId = typeof value?.memoryId === "string" ? value.memoryId : "";
|
|
101
|
+
if (!memoryId) continue;
|
|
102
|
+
const item = await db.get(createMemoryKey(owner.ownerType, owner.ownerId, memoryId)).catch(() => null);
|
|
103
|
+
if (!item) continue;
|
|
104
|
+
if (!matchesFilters(item, filters)) continue;
|
|
105
|
+
matchedItems.push(item);
|
|
106
|
+
if (matchedItems.length >= limit) break;
|
|
107
|
+
}
|
|
108
|
+
if (matchedItems.length === 0) {
|
|
109
|
+
return { deletedCount: 0, deletedIds: [], matchedItems: [] };
|
|
110
|
+
}
|
|
111
|
+
const batch = db.batch();
|
|
112
|
+
for (const item of matchedItems) {
|
|
113
|
+
deleteMemoryItemWithIndexesInBatch(batch, item);
|
|
114
|
+
}
|
|
115
|
+
await batch.write();
|
|
116
|
+
return {
|
|
117
|
+
deletedCount: matchedItems.length,
|
|
118
|
+
deletedIds: matchedItems.map((item) => item.id),
|
|
119
|
+
matchedItems
|
|
120
|
+
};
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
// packages/cli/client/memoryRekey.ts
|
|
124
|
+
async function scanLocalMemoryItems(localDb, machineId) {
|
|
125
|
+
const range = memoryOwnerRange("user", machineId);
|
|
126
|
+
const refs = [];
|
|
127
|
+
for await (const [, value] of localDb.iterator({
|
|
128
|
+
gte: range.start,
|
|
129
|
+
lte: range.end,
|
|
130
|
+
reverse: true
|
|
131
|
+
})) {
|
|
132
|
+
refs.push(value ?? {});
|
|
133
|
+
}
|
|
134
|
+
const items = await Promise.all(
|
|
135
|
+
refs.map(
|
|
136
|
+
(ref) => typeof ref?.memoryId === "string" ? localDb.get(createMemoryKey("user", machineId, ref.memoryId)).catch(() => null) : Promise.resolve(null)
|
|
137
|
+
)
|
|
138
|
+
);
|
|
139
|
+
return items.filter((item) => !!item);
|
|
140
|
+
}
|
|
141
|
+
async function performLocalMemoryRekey(args) {
|
|
142
|
+
const { localDb, authToken, serverUrl, machineId } = args;
|
|
143
|
+
const fetchImpl = args.fetchImpl ?? fetch;
|
|
144
|
+
const items = await scanLocalMemoryItems(localDb, machineId);
|
|
145
|
+
if (items.length === 0) {
|
|
146
|
+
return { migrated: 0, merged: 0 };
|
|
147
|
+
}
|
|
148
|
+
const snapshotIds = items.map((item) => item.id);
|
|
149
|
+
const response = await fetchImpl(`${serverUrl}/api/memory/rekey`, {
|
|
150
|
+
method: "POST",
|
|
151
|
+
headers: {
|
|
152
|
+
Authorization: `Bearer ${authToken}`,
|
|
153
|
+
"Content-Type": "application/json"
|
|
154
|
+
},
|
|
155
|
+
body: JSON.stringify({ items }),
|
|
156
|
+
signal: AbortSignal?.timeout?.(3e4)
|
|
157
|
+
}).catch((e) => {
|
|
158
|
+
if (e?.name === "TimeoutError" || e?.name === "AbortError") {
|
|
159
|
+
throw new Error("memory rekey upload timed out (30s)");
|
|
160
|
+
}
|
|
161
|
+
throw e;
|
|
162
|
+
});
|
|
163
|
+
if (!response.ok) {
|
|
164
|
+
let detail = "";
|
|
165
|
+
try {
|
|
166
|
+
const body2 = await response.json();
|
|
167
|
+
detail = body2?.error?.message ?? "";
|
|
168
|
+
} catch {
|
|
169
|
+
}
|
|
170
|
+
throw new Error(
|
|
171
|
+
`memory rekey upload failed (HTTP ${response.status})${detail ? `: ${detail}` : ""}`
|
|
172
|
+
);
|
|
173
|
+
}
|
|
174
|
+
const body = await response.json().catch(() => ({}));
|
|
175
|
+
const migrated = typeof body?.migratedCount === "number" ? body.migratedCount : 0;
|
|
176
|
+
const merged = typeof body?.mergedCount === "number" ? body.mergedCount : 0;
|
|
177
|
+
await deleteMemoriesForOwnerFromDb(
|
|
178
|
+
localDb,
|
|
179
|
+
{ ownerType: "user", ownerId: machineId },
|
|
180
|
+
{ ids: snapshotIds }
|
|
181
|
+
);
|
|
182
|
+
return { migrated, merged };
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
// packages/cli/authCommands.ts
|
|
23
186
|
var LOGIN_HELP_TEXT = `Log in to Nolo and save a local profile.
|
|
24
187
|
|
|
25
188
|
Usage:
|
|
@@ -106,6 +269,25 @@ async function saveTokenLogin(args) {
|
|
|
106
269
|
authToken: args.authToken.trim()
|
|
107
270
|
});
|
|
108
271
|
args.output.log(`Saved profile default -> ${args.serverUrl}`);
|
|
272
|
+
try {
|
|
273
|
+
const localDb = await getDefaultCliLocalRuntimeDb();
|
|
274
|
+
const machineId = resolveMachineId();
|
|
275
|
+
const result = await performLocalMemoryRekey({
|
|
276
|
+
localDb,
|
|
277
|
+
authToken: args.authToken.trim(),
|
|
278
|
+
serverUrl: args.serverUrl,
|
|
279
|
+
machineId
|
|
280
|
+
});
|
|
281
|
+
if (result.migrated > 0 || result.merged > 0) {
|
|
282
|
+
args.output.log(
|
|
283
|
+
`[nolo] Migrated ${result.migrated} local memor${result.migrated === 1 ? "y" : "ies"} to your account` + (result.merged > 0 ? ` (${result.merged} merged with existing)` : "") + "."
|
|
284
|
+
);
|
|
285
|
+
}
|
|
286
|
+
} catch (error) {
|
|
287
|
+
args.error.error(
|
|
288
|
+
`[nolo] Local memory migration skipped: ${error instanceof Error ? error.message : String(error)}`
|
|
289
|
+
);
|
|
290
|
+
}
|
|
109
291
|
return 0;
|
|
110
292
|
}
|
|
111
293
|
async function runWebLogin(args) {
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// packages/core/stringArray.ts
|
|
2
|
+
function asNonEmptyStringArray(value) {
|
|
3
|
+
if (!Array.isArray(value)) return [];
|
|
4
|
+
return value.filter(
|
|
5
|
+
(item) => typeof item === "string" && !!item.trim()
|
|
6
|
+
);
|
|
7
|
+
}
|
|
8
|
+
function asTrimmedNonEmptyStringArray(value) {
|
|
9
|
+
return asNonEmptyStringArray(value).map((item) => item.trim());
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export {
|
|
13
|
+
asNonEmptyStringArray,
|
|
14
|
+
asTrimmedNonEmptyStringArray
|
|
15
|
+
};
|
|
@@ -25,10 +25,10 @@ import {
|
|
|
25
25
|
} from "./chunk-63W5N6P3.js";
|
|
26
26
|
import {
|
|
27
27
|
createDocState
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-MMRAIO5Y.js";
|
|
29
29
|
import {
|
|
30
30
|
createDialogAction
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-VH4YK6KZ.js";
|
|
32
32
|
import {
|
|
33
33
|
buildSkillDocMarkdown,
|
|
34
34
|
normalizeSkillBudgetTier,
|
|
@@ -37,7 +37,7 @@ import {
|
|
|
37
37
|
parseExternalSkillMarkdown,
|
|
38
38
|
parseSkillDocProtocol,
|
|
39
39
|
resolvePageSkillMetadata
|
|
40
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-ZQ2UM4KG.js";
|
|
41
41
|
import {
|
|
42
42
|
addCategory,
|
|
43
43
|
addContentToSpace,
|
|
@@ -68,16 +68,16 @@ import {
|
|
|
68
68
|
updateContentCategory,
|
|
69
69
|
updateContentTitle,
|
|
70
70
|
updateStep
|
|
71
|
-
} from "./chunk-
|
|
71
|
+
} from "./chunk-SRLZ7IVA.js";
|
|
72
72
|
import {
|
|
73
73
|
createAgent,
|
|
74
74
|
runLlm,
|
|
75
75
|
streamAgentChatTurn,
|
|
76
76
|
updateAgent
|
|
77
|
-
} from "./chunk-
|
|
77
|
+
} from "./chunk-QKRUUZCL.js";
|
|
78
78
|
import {
|
|
79
79
|
addContentAction
|
|
80
|
-
} from "./chunk-
|
|
80
|
+
} from "./chunk-ZDXZSXYQ.js";
|
|
81
81
|
import {
|
|
82
82
|
createSpaceKey,
|
|
83
83
|
normalizeSpaceId
|
|
@@ -97,7 +97,7 @@ import {
|
|
|
97
97
|
redactAgentRecordForWorkspaceTool,
|
|
98
98
|
resolveNoloDialogInput,
|
|
99
99
|
verifyNoloDialogSubjectRefQuery
|
|
100
|
-
} from "./chunk-
|
|
100
|
+
} from "./chunk-DG7AAAR3.js";
|
|
101
101
|
import {
|
|
102
102
|
DEFAULT_MODEL
|
|
103
103
|
} from "./chunk-572EKYLF.js";
|
|
@@ -126,14 +126,14 @@ import {
|
|
|
126
126
|
} from "./chunk-HNMXYYJR.js";
|
|
127
127
|
import {
|
|
128
128
|
shareResourceAction
|
|
129
|
-
} from "./chunk-
|
|
129
|
+
} from "./chunk-QO4YO77G.js";
|
|
130
130
|
import {
|
|
131
131
|
AGENT_UPDATE_FIELD_NAMES,
|
|
132
132
|
normalizeAgentUpdateFieldList,
|
|
133
133
|
selectAutoApproveSelfUpdateFields,
|
|
134
134
|
selectCurrentServer,
|
|
135
135
|
selectSyncServers
|
|
136
|
-
} from "./chunk-
|
|
136
|
+
} from "./chunk-6CBN7GGH.js";
|
|
137
137
|
import {
|
|
138
138
|
patch,
|
|
139
139
|
read,
|
|
@@ -141,14 +141,12 @@ import {
|
|
|
141
141
|
readAndWaitAction,
|
|
142
142
|
toTimestampMs,
|
|
143
143
|
write
|
|
144
|
-
} from "./chunk-
|
|
144
|
+
} from "./chunk-V2AISYMA.js";
|
|
145
145
|
import {
|
|
146
146
|
asRecordOrEmpty
|
|
147
147
|
} from "./chunk-KX6YBIHG.js";
|
|
148
148
|
import {
|
|
149
149
|
SEPARATOR,
|
|
150
|
-
asNonEmptyStringArray,
|
|
151
|
-
asTrimmedNonEmptyStringArray,
|
|
152
150
|
createAgentKey,
|
|
153
151
|
dialogMessageRange,
|
|
154
152
|
fileKey,
|
|
@@ -158,7 +156,11 @@ import {
|
|
|
158
156
|
rowKey,
|
|
159
157
|
toTrimmedString,
|
|
160
158
|
ulid
|
|
161
|
-
} from "./chunk-
|
|
159
|
+
} from "./chunk-SH2CFQOH.js";
|
|
160
|
+
import {
|
|
161
|
+
asNonEmptyStringArray,
|
|
162
|
+
asTrimmedNonEmptyStringArray
|
|
163
|
+
} from "./chunk-I42VC5KR.js";
|
|
162
164
|
import {
|
|
163
165
|
asOptionalFiniteNumber
|
|
164
166
|
} from "./chunk-WWC7I6TA.js";
|
|
@@ -3211,6 +3213,7 @@ var space_locale_default = {
|
|
|
3211
3213
|
name_placeholder: "Enter space name",
|
|
3212
3214
|
description_placeholder: "Enter space description (optional)",
|
|
3213
3215
|
description_max_length: "Description cannot exceed 200 characters",
|
|
3216
|
+
description_too_long: "Description cannot exceed 500 characters",
|
|
3214
3217
|
// === 创建空间 ===
|
|
3215
3218
|
create_new_space: "New space",
|
|
3216
3219
|
create_space: "Create Space",
|
|
@@ -3246,6 +3249,9 @@ var space_locale_default = {
|
|
|
3246
3249
|
no_space_data: "Space data not found",
|
|
3247
3250
|
try_repair: "Try to Repair",
|
|
3248
3251
|
repair_success: "Repair operation completed successfully",
|
|
3252
|
+
repair_space: "Repair Space",
|
|
3253
|
+
repair_count_warn: "This space has {{count}} content items. Repair will re-deduplicate and remove orphaned references. Continue?",
|
|
3254
|
+
repair: "Repair",
|
|
3249
3255
|
repair_error: "Repair operation failed",
|
|
3250
3256
|
try_later: "Please try again later",
|
|
3251
3257
|
// === 基本信息 ===
|
|
@@ -3268,6 +3274,7 @@ var space_locale_default = {
|
|
|
3268
3274
|
permission_updated: "Permission settings updated successfully",
|
|
3269
3275
|
// === 默认空间 ===
|
|
3270
3276
|
save_changes: "Save Changes",
|
|
3277
|
+
save_success: "Settings saved successfully",
|
|
3271
3278
|
set_as_default: "Set as Default Space",
|
|
3272
3279
|
current_default: "Current Default Space",
|
|
3273
3280
|
cancel_changes: "Cancel Changes",
|
|
@@ -3517,6 +3524,7 @@ var space_locale_default = {
|
|
|
3517
3524
|
name_placeholder: "\u8F93\u5165\u7A7A\u95F4\u540D\u79F0",
|
|
3518
3525
|
description_placeholder: "\u8F93\u5165\u7A7A\u95F4\u63CF\u8FF0\uFF08\u53EF\u9009\uFF09",
|
|
3519
3526
|
description_max_length: "\u63CF\u8FF0\u4E0D\u80FD\u8D85\u8FC7200\u4E2A\u5B57\u7B26",
|
|
3527
|
+
description_too_long: "\u63CF\u8FF0\u4E0D\u80FD\u8D85\u8FC7 500 \u4E2A\u5B57\u7B26",
|
|
3520
3528
|
// === 创建空间 ===
|
|
3521
3529
|
create_new_space: "\u65B0\u5EFA\u7A7A\u95F4",
|
|
3522
3530
|
create_space: "\u521B\u5EFA\u7A7A\u95F4",
|
|
@@ -3552,6 +3560,9 @@ var space_locale_default = {
|
|
|
3552
3560
|
no_space_data: "\u672A\u627E\u5230\u7A7A\u95F4\u6570\u636E",
|
|
3553
3561
|
try_repair: "\u5C1D\u8BD5\u4FEE\u590D",
|
|
3554
3562
|
repair_success: "\u4FEE\u590D\u64CD\u4F5C\u6210\u529F\u5B8C\u6210",
|
|
3563
|
+
repair_space: "\u4FEE\u590D\u7A7A\u95F4",
|
|
3564
|
+
repair_count_warn: "\u6B64\u7A7A\u95F4\u6709 {{count}} \u9879\u5185\u5BB9\u3002\u4FEE\u590D\u5C06\u91CD\u65B0\u53BB\u91CD\u5E76\u6E05\u9664\u5B64\u7ACB\u7684\u5F15\u7528\u3002\u662F\u5426\u7EE7\u7EED\uFF1F",
|
|
3565
|
+
repair: "\u4FEE\u590D",
|
|
3555
3566
|
repair_error: "\u4FEE\u590D\u64CD\u4F5C\u5931\u8D25",
|
|
3556
3567
|
try_later: "\u8BF7\u7A0D\u540E\u91CD\u8BD5",
|
|
3557
3568
|
// === 基本信息 ===
|
|
@@ -3574,6 +3585,7 @@ var space_locale_default = {
|
|
|
3574
3585
|
permission_updated: "\u6743\u9650\u8BBE\u7F6E\u66F4\u65B0\u6210\u529F",
|
|
3575
3586
|
// === 默认空间 ===
|
|
3576
3587
|
save_changes: "\u4FDD\u5B58\u66F4\u6539",
|
|
3588
|
+
save_success: "\u8BBE\u7F6E\u4FDD\u5B58\u6210\u529F",
|
|
3577
3589
|
set_as_default: "\u8BBE\u4E3A\u9ED8\u8BA4\u7A7A\u95F4",
|
|
3578
3590
|
current_default: "\u5F53\u524D\u9ED8\u8BA4\u7A7A\u95F4",
|
|
3579
3591
|
cancel_changes: "\u53D6\u6D88\u66F4\u6539",
|
|
@@ -3823,6 +3835,7 @@ var space_locale_default = {
|
|
|
3823
3835
|
name_placeholder: "\u8F38\u5165\u7A7A\u9593\u540D\u7A31",
|
|
3824
3836
|
description_placeholder: "\u8F38\u5165\u7A7A\u9593\u63CF\u8FF0\uFF08\u53EF\u9078\uFF09",
|
|
3825
3837
|
description_max_length: "\u63CF\u8FF0\u4E0D\u80FD\u8D85\u904E200\u500B\u5B57\u7B26",
|
|
3838
|
+
description_too_long: "\u63CF\u8FF0\u4E0D\u80FD\u8D85\u904E 500 \u500B\u5B57\u5143",
|
|
3826
3839
|
// === 创建空间 ===
|
|
3827
3840
|
create_new_space: "\u65B0\u5EFA\u7A7A\u9593",
|
|
3828
3841
|
create_space: "\u5275\u5EFA\u7A7A\u9593",
|
|
@@ -3857,6 +3870,9 @@ var space_locale_default = {
|
|
|
3857
3870
|
no_space_data: "\u672A\u627E\u5230\u7A7A\u9593\u8CC7\u6599",
|
|
3858
3871
|
try_repair: "\u5617\u8A66\u4FEE\u5FA9",
|
|
3859
3872
|
repair_success: "\u4FEE\u5FA9\u64CD\u4F5C\u6210\u529F\u5B8C\u6210",
|
|
3873
|
+
repair_space: "\u4FEE\u5FA9\u7A7A\u9593",
|
|
3874
|
+
repair_count_warn: "\u6B64\u7A7A\u9593\u6709 {{count}} \u9805\u5167\u5BB9\u3002\u4FEE\u5FA9\u5C07\u91CD\u65B0\u53BB\u91CD\u4E26\u6E05\u9664\u5B64\u7ACB\u7684\u5F15\u7528\u3002\u662F\u5426\u7E7C\u7E8C\uFF1F",
|
|
3875
|
+
repair: "\u4FEE\u5FA9",
|
|
3860
3876
|
repair_error: "\u4FEE\u5FA9\u64CD\u4F5C\u5931\u6557",
|
|
3861
3877
|
try_later: "\u8ACB\u7A0D\u5F8C\u91CD\u8A66",
|
|
3862
3878
|
// === 基本信息 ===
|
|
@@ -3879,6 +3895,7 @@ var space_locale_default = {
|
|
|
3879
3895
|
permission_updated: "\u6B0A\u9650\u8A2D\u5B9A\u66F4\u65B0\u6210\u529F",
|
|
3880
3896
|
// === 默认空间 ===
|
|
3881
3897
|
save_changes: "\u5132\u5B58\u8B8A\u66F4",
|
|
3898
|
+
save_success: "\u8A2D\u5B9A\u5DF2\u5132\u5B58",
|
|
3882
3899
|
set_as_default: "\u8A2D\u70BA\u9810\u8A2D\u7A7A\u9593",
|
|
3883
3900
|
current_default: "\u76EE\u524D\u9810\u8A2D\u7A7A\u9593",
|
|
3884
3901
|
cancel_changes: "\u53D6\u6D88\u8B8A\u66F4",
|
|
@@ -4120,6 +4137,7 @@ var space_locale_default = {
|
|
|
4120
4137
|
name_placeholder: "\u30B9\u30DA\u30FC\u30B9\u540D\u3092\u5165\u529B",
|
|
4121
4138
|
description_placeholder: "\u30B9\u30DA\u30FC\u30B9\u306E\u8AAC\u660E\u3092\u5165\u529B\uFF08\u4EFB\u610F\uFF09",
|
|
4122
4139
|
description_max_length: "\u8AAC\u660E\u306F200\u6587\u5B57\u4EE5\u4E0B\u306B\u3057\u3066\u304F\u3060\u3055\u3044",
|
|
4140
|
+
description_too_long: "\u8AAC\u660E\u306F500\u6587\u5B57\u4EE5\u5185\u3067\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044",
|
|
4123
4141
|
// === スペース作成 ===
|
|
4124
4142
|
create_new_space: "\u30B9\u30DA\u30FC\u30B9\u3092\u4F5C\u6210",
|
|
4125
4143
|
create_space: "\u30B9\u30DA\u30FC\u30B9\u3092\u4F5C\u6210",
|
|
@@ -4155,6 +4173,9 @@ var space_locale_default = {
|
|
|
4155
4173
|
no_space_data: "\u30B9\u30DA\u30FC\u30B9\u30C7\u30FC\u30BF\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093",
|
|
4156
4174
|
try_repair: "\u4FEE\u5FA9\u3092\u8A66\u884C",
|
|
4157
4175
|
repair_success: "\u4FEE\u5FA9\u64CD\u4F5C\u304C\u6B63\u5E38\u306B\u5B8C\u4E86\u3057\u307E\u3057\u305F",
|
|
4176
|
+
repair_space: "\u30B9\u30DA\u30FC\u30B9\u3092\u4FEE\u5FA9",
|
|
4177
|
+
repair_count_warn: "\u3053\u306E\u30B9\u30DA\u30FC\u30B9\u306B\u306F {{count}} \u4EF6\u306E\u30B3\u30F3\u30C6\u30F3\u30C4\u304C\u3042\u308A\u307E\u3059\u3002\u4FEE\u5FA9\u306F\u91CD\u8907\u3092\u6574\u7406\u3057\u3001\u5B64\u7ACB\u3057\u305F\u53C2\u7167\u3092\u524A\u9664\u3057\u307E\u3059\u3002\u7D9A\u884C\u3057\u307E\u3059\u304B\uFF1F",
|
|
4178
|
+
repair: "\u4FEE\u5FA9",
|
|
4158
4179
|
repair_error: "\u4FEE\u5FA9\u64CD\u4F5C\u306B\u5931\u6557\u3057\u307E\u3057\u305F",
|
|
4159
4180
|
try_later: "\u3057\u3070\u3089\u304F\u3057\u3066\u304B\u3089\u518D\u5EA6\u304A\u8A66\u3057\u304F\u3060\u3055\u3044",
|
|
4160
4181
|
// === 基本情報 ===
|
|
@@ -4177,6 +4198,7 @@ var space_locale_default = {
|
|
|
4177
4198
|
permission_updated: "\u6A29\u9650\u8A2D\u5B9A\u304C\u6B63\u5E38\u306B\u66F4\u65B0\u3055\u308C\u307E\u3057\u305F",
|
|
4178
4199
|
// === デフォルトスペース ===
|
|
4179
4200
|
save_changes: "\u5909\u66F4\u3092\u4FDD\u5B58",
|
|
4201
|
+
save_success: "\u8A2D\u5B9A\u3092\u4FDD\u5B58\u3057\u307E\u3057\u305F",
|
|
4180
4202
|
set_as_default: "\u30C7\u30D5\u30A9\u30EB\u30C8\u30B9\u30DA\u30FC\u30B9\u306B\u8A2D\u5B9A",
|
|
4181
4203
|
current_default: "\u73FE\u5728\u306E\u30C7\u30D5\u30A9\u30EB\u30C8\u30B9\u30DA\u30FC\u30B9",
|
|
4182
4204
|
cancel_changes: "\u5909\u66F4\u3092\u30AD\u30E3\u30F3\u30BB\u30EB",
|
|
@@ -13540,7 +13562,7 @@ async function deleteDialogsFunc(args, thunkApi) {
|
|
|
13540
13562
|
const deletedDialogIds = [];
|
|
13541
13563
|
const deletedDialogKeys = [];
|
|
13542
13564
|
const failures = [];
|
|
13543
|
-
const { deleteDialog } = await import("./dialogSlice-
|
|
13565
|
+
const { deleteDialog } = await import("./dialogSlice-CELFVS3F.js");
|
|
13544
13566
|
for (const target of targets) {
|
|
13545
13567
|
try {
|
|
13546
13568
|
await thunkApi.dispatch(deleteDialog(target.dbKey)).unwrap();
|
|
@@ -19122,7 +19144,7 @@ var selectUserIdFromState = (state) => typeof state?.auth?.currentUser?.userId =
|
|
|
19122
19144
|
var selectCurrentServerFromState = (state) => typeof state?.settings?.currentServer === "string" ? state.settings.currentServer : null;
|
|
19123
19145
|
async function addImageContentToSpace(input) {
|
|
19124
19146
|
const injectedAddContentAction = input.thunkApi?.extra?.addContentAction;
|
|
19125
|
-
const addContentAction2 = typeof injectedAddContentAction === "function" ? injectedAddContentAction : (await import("./addContentAction-
|
|
19147
|
+
const addContentAction2 = typeof injectedAddContentAction === "function" ? injectedAddContentAction : (await import("./addContentAction-ZX2PUS3X.js")).addContentAction;
|
|
19126
19148
|
await addContentAction2(
|
|
19127
19149
|
{
|
|
19128
19150
|
spaceId: input.spaceId,
|
|
@@ -22486,7 +22508,7 @@ var executeToolRun = createAsyncThunk(
|
|
|
22486
22508
|
if (!executionInput) {
|
|
22487
22509
|
throw new Error(`ToolRun ${id} has no input to execute with.`);
|
|
22488
22510
|
}
|
|
22489
|
-
const { findToolExecutor: findToolExecutor2 } = await import("./tools-
|
|
22511
|
+
const { findToolExecutor: findToolExecutor2 } = await import("./tools-BAWXW4F6.js");
|
|
22490
22512
|
const { executor } = findToolExecutor2(run.toolName);
|
|
22491
22513
|
toolRunStarted({
|
|
22492
22514
|
id: run.id,
|
|
@@ -22510,7 +22532,7 @@ var executeToolRun = createAsyncThunk(
|
|
|
22510
22532
|
const latestState = thunkApi.getState();
|
|
22511
22533
|
const userId = latestState.auth?.currentUser?.userId;
|
|
22512
22534
|
if (userId) {
|
|
22513
|
-
const { fetchUserSpaceMemberships } = await import("./spaceSlice-
|
|
22535
|
+
const { fetchUserSpaceMemberships } = await import("./spaceSlice-5F2CDP2O.js");
|
|
22514
22536
|
await thunkApi.dispatch(fetchUserSpaceMemberships(userId));
|
|
22515
22537
|
}
|
|
22516
22538
|
}
|
|
@@ -24913,7 +24935,7 @@ async function updateDocFunc(args, thunkApi) {
|
|
|
24913
24935
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
24914
24936
|
};
|
|
24915
24937
|
await dispatch(write({ data: updatedPageData, customKey: id })).unwrap();
|
|
24916
|
-
const { getDocState, applyExternalDocUpdate } = await import("./docStore-
|
|
24938
|
+
const { getDocState, applyExternalDocUpdate } = await import("./docStore-Q5AFYT6G.js");
|
|
24917
24939
|
if (getDocState().pageKey === id) {
|
|
24918
24940
|
applyExternalDocUpdate({
|
|
24919
24941
|
slateData: finalSlateData,
|
|
@@ -24938,7 +24960,7 @@ async function updateDocFunc(args, thunkApi) {
|
|
|
24938
24960
|
// packages/ai/tools/updateUserPreferenceProfileTool.ts
|
|
24939
24961
|
async function dispatchSetSettings(thunkApi, changes) {
|
|
24940
24962
|
const injectedSetSettings = thunkApi?.extra?.setSettings;
|
|
24941
|
-
const setSettings = typeof injectedSetSettings === "function" ? injectedSetSettings : (await import("./settingSlice-
|
|
24963
|
+
const setSettings = typeof injectedSetSettings === "function" ? injectedSetSettings : (await import("./settingSlice-PNLASZGI.js")).setSettings;
|
|
24942
24964
|
await thunkApi.dispatch(setSettings(changes)).unwrap();
|
|
24943
24965
|
}
|
|
24944
24966
|
var updateUserPreferenceProfileFunctionSchema = {
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
// packages/core/clipHeadAndTail.ts
|
|
2
|
+
import { writeFileSync, mkdirSync } from "node:fs";
|
|
3
|
+
import { join } from "node:path";
|
|
4
|
+
import { tmpdir } from "node:os";
|
|
5
|
+
function clipHeadAndTail(rawContent, options = {}) {
|
|
6
|
+
const maxHeadBytes = options.maxHeadBytes ?? 1e3;
|
|
7
|
+
const maxTailBytes = options.maxTailBytes ?? 2500;
|
|
8
|
+
const maxTotalBytes = options.maxTotalBytes ?? 4e3;
|
|
9
|
+
const originalBytes = Buffer.byteLength(rawContent, "utf8");
|
|
10
|
+
if (originalBytes <= maxTotalBytes) {
|
|
11
|
+
return { content: rawContent, clipped: false, originalBytes };
|
|
12
|
+
}
|
|
13
|
+
const buf = Buffer.from(rawContent, "utf8");
|
|
14
|
+
let headEnd = Math.min(maxHeadBytes, buf.length);
|
|
15
|
+
while (headEnd > 0 && (buf[headEnd] & 192) === 128) {
|
|
16
|
+
headEnd--;
|
|
17
|
+
}
|
|
18
|
+
let tailStart = Math.max(0, buf.length - maxTailBytes);
|
|
19
|
+
while (tailStart < buf.length && (buf[tailStart] & 192) === 128) {
|
|
20
|
+
tailStart++;
|
|
21
|
+
}
|
|
22
|
+
if (tailStart < headEnd) {
|
|
23
|
+
tailStart = headEnd;
|
|
24
|
+
}
|
|
25
|
+
const headStr = buf.toString("utf8", 0, headEnd);
|
|
26
|
+
const tailStr = buf.toString("utf8", tailStart, buf.length);
|
|
27
|
+
const elidedBytes = Math.max(0, originalBytes - headEnd - (buf.length - tailStart));
|
|
28
|
+
let logPath = void 0;
|
|
29
|
+
if (options.saveTempLog !== false) {
|
|
30
|
+
try {
|
|
31
|
+
const dir = join(tmpdir(), "nolo-tool-logs");
|
|
32
|
+
mkdirSync(dir, { recursive: true });
|
|
33
|
+
const safeId = (options.toolCallId || `tool-${Date.now()}`).replace(/[^a-zA-Z0-9_-]/g, "_");
|
|
34
|
+
logPath = join(dir, `${safeId}.log`);
|
|
35
|
+
writeFileSync(logPath, rawContent, "utf8");
|
|
36
|
+
} catch {
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
const logHint = logPath ? ` Full output saved to ${logPath}` : "";
|
|
40
|
+
const notice = `
|
|
41
|
+
|
|
42
|
+
[... truncated ${elidedBytes} bytes.${logHint}]
|
|
43
|
+
|
|
44
|
+
`;
|
|
45
|
+
return {
|
|
46
|
+
content: `${headStr}${notice}${tailStr}`,
|
|
47
|
+
clipped: true,
|
|
48
|
+
logPath,
|
|
49
|
+
originalBytes
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export {
|
|
54
|
+
clipHeadAndTail
|
|
55
|
+
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
i18n_default,
|
|
3
3
|
toolRegistry
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-I6DI7SGU.js";
|
|
5
5
|
import {
|
|
6
6
|
canonicalizeToolNames
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-DG7AAAR3.js";
|
|
8
8
|
import {
|
|
9
9
|
asTrimmedLowercaseString
|
|
10
10
|
} from "./chunk-QSJ3HFEF.js";
|