nolo-cli 0.10.0 → 0.12.0-alpha.1
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-YAXYAUOK.js → _executeModel-MWAY74HA.js} +47 -44
- package/{action-TLI3V62L.js → action-RAXNQQKC.js} +9 -10
- package/{addContentAction-PLWJSCOZ.js → addContentAction-ZHI7TVV3.js} +8 -10
- package/{addDialogAgentAction-BJ6SB76X.js → addDialogAgentAction-JWXPKXNC.js} +7 -8
- package/{agentDeleteCommand-2VYX73U5.js → agentDeleteCommand-LXR5A5FV.js} +36 -26
- package/{agentEmailCommands-3GDZIX64.js → agentEmailCommands-DXRAP7BB.js} +63 -58
- package/{agentListCommands-UWVBT3LH.js → agentListCommands-ZFMS5ZLY.js} +132 -35
- package/{agentMachineCommands-WOKMUG2Y.js → agentMachineCommands-ZJLYVV52.js} +40 -29
- package/{agentPullCommand-O2MTUAFR.js → agentPullCommand-KRBRIFIY.js} +6 -6
- package/{agentRecordCommands-MVNZRH3U.js → agentRecordCommands-DFS626TB.js} +55 -50
- package/{agentRunCommand-K7THIJLA.js → agentRunCommand-GWBIE2TS.js} +60 -56
- package/{agentRunControl-K4VKNEHF.js → agentRunControl-IX4F5W2C.js} +3 -3
- package/{agentRuntimeLocal-WJIGU24U.js → agentRuntimeLocal-YNZSHMZC.js} +29 -14
- package/{agentSlice-LL5TKZEO.js → agentSlice-T2PXOEPQ.js} +9 -10
- package/{authCommand-TC2SW2CQ.js → authCommand-DMW336GT.js} +13 -13
- package/{authCommands-XPEHTKSM.js → authCommands-GH5T6RYV.js} +6 -6
- package/{chunk-5JGGZCZL.js → chunk-3HHTVM6G.js} +64 -5
- package/chunk-3QKO4EHV.js +112 -0
- package/{chunk-AUQ747NZ.js → chunk-43UD5ZP7.js} +76 -15
- package/{chunk-6SLCD4RB.js → chunk-4BTHUYMY.js} +596 -67
- package/{chunk-T7R3NGUU.js → chunk-4EH7AR52.js} +13 -13
- package/{chunk-C3RUNRHT.js → chunk-4GBNEA5B.js} +1 -1
- package/{chunk-4IJYA27C.js → chunk-4LG74DRG.js} +1 -1
- package/{chunk-2FTTDCD4.js → chunk-4ON5AV72.js} +2 -1
- package/{chunk-IWX4UW2E.js → chunk-524BDL33.js} +89 -8
- package/{chunk-EXXFGKF7.js → chunk-5ITRDSHY.js} +1400 -119
- package/{chunk-ISNCLGUZ.js → chunk-5NBHQD4D.js} +4 -3
- package/{chunk-7KNKFIRO.js → chunk-6LMFFG3K.js} +3 -3
- package/{chunk-PAKN26FP.js → chunk-6OVCRC72.js} +1 -1
- package/{chunk-CKOJQDKR.js → chunk-7JJCGV7N.js} +146 -3
- package/{chunk-KBKYAONQ.js → chunk-7MYHLZ3F.js} +2 -2
- package/{chunk-PIVFPOW6.js → chunk-AM53Q2SD.js} +175 -2541
- package/chunk-BYXBJQAS.js +0 -0
- package/{chunk-CL3IOKGK.js → chunk-DE5BA4O6.js} +20 -2
- package/{chunk-6KUOUWMP.js → chunk-DRMGJFGQ.js} +300 -89
- package/{chunk-QAALPJS7.js → chunk-EBH7G34M.js} +20 -7
- package/{chunk-HJGEVL7C.js → chunk-G3B356GF.js} +15 -17
- package/{chunk-OZMMKDBI.js → chunk-GDBCUWQ3.js} +26 -20
- package/{chunk-I5URP43I.js → chunk-GPZM7QH6.js} +9 -9
- package/chunk-IKXL2HZ3.js +70 -0
- package/{chunk-AS4PVWA4.js → chunk-IVAOVLM7.js} +1 -1
- package/{chunk-TNPIMII7.js → chunk-JUN3HFMN.js} +221 -81
- package/{chunk-HFASY3WO.js → chunk-JZDIW766.js} +1 -1
- package/{chunk-6JJWFVZ6.js → chunk-LHSJMY5V.js} +17 -17
- package/chunk-LTRXGFMS.js +83 -0
- package/{chunk-YIHFXH5Q.js → chunk-MEVCDATU.js} +3 -3
- package/{chunk-TILFE6LV.js → chunk-NCGFB7NN.js} +5 -3
- package/{chunk-BE2OOJ5P.js → chunk-NITP2JDG.js} +42 -11
- package/{chunk-YPRZSPF3.js → chunk-OCDEWRE2.js} +1 -1
- package/{chunk-VVX233PH.js → chunk-OHEKYYJF.js} +9 -9
- package/chunk-OOIN7HSO.js +146 -0
- package/{chunk-WPE4F4Z6.js → chunk-OPKKB25T.js} +1 -1
- package/{chunk-OR2XR25C.js → chunk-QCA3EPYK.js} +8 -8
- package/{chunk-SL35K7AH.js → chunk-QLUFR47U.js} +13 -83
- package/{chunk-CDTLMEB3.js → chunk-RNQ5BLR2.js} +1 -1
- package/{chunk-AVMKZHBC.js → chunk-RSEUHW6T.js} +3 -2
- package/{chunk-TYSCFY6S.js → chunk-RZ735TLX.js} +762 -167
- package/chunk-S3UTETIC.js +4885 -0
- package/chunk-S73OEOHH.js +2286 -0
- package/{chunk-JRKKFRAV.js → chunk-TSKWE74T.js} +58 -8
- package/{chunk-A67QFHAA.js → chunk-UG3WOFU6.js} +1 -1
- package/{chunk-4ZDM73SD.js → chunk-V2J635L5.js} +1 -1
- package/chunk-VC6OZXO5.js +298 -0
- package/{chunk-7U44LYTR.js → chunk-WPHL6ALY.js} +1 -1
- package/{chunk-4SIMLBEU.js → chunk-WTYKCU4W.js} +9 -9
- package/{chunk-NPVBXJY2.js → chunk-WWU275LU.js} +9 -9
- package/{chunk-ZQ2UM4KG.js → chunk-WZSRQNQG.js} +1 -292
- package/{chunk-DSZUWUYB.js → chunk-XHQWJUW4.js} +2 -2
- package/{chunk-GAKEBQD6.js → chunk-YDCZVUFP.js} +4 -0
- package/{chunk-2O4IZNTG.js → chunk-YTQLJYLB.js} +2 -2
- package/{chunk-3Y3HW5PX.js → chunk-ZPFRLGIZ.js} +1512 -935
- package/{chunk-5KLGBAAR.js → chunk-ZR4VHQ5D.js} +14 -13
- package/cliEnvHelpers-VYC2OPTB.js +30 -0
- package/{cliExecutor-DNE7TCC4.js → cliExecutor-K3F7DMRO.js} +2 -2
- package/{createAgentAutomationAction-CCE7CWGQ.js → createAgentAutomationAction-G32GKDGV.js} +22 -23
- package/{createDialogAction-QTRR4AT7.js → createDialogAction-TISANRZK.js} +25 -25
- package/{createPageAction-Y4KQOAJE.js → createPageAction-O7KOYNV4.js} +27 -27
- package/{dbSlice-WWNV2SGX.js → dbSlice-WDP2ZZHK.js} +7 -8
- package/{deleteFile-OW53A6BX.js → deleteFile-M7UNIUOO.js} +5 -5
- package/{dialogCommands-SMKIAC3Y.js → dialogCommands-6JPB3YQY.js} +33 -23
- package/{dialogSlice-PT7YBWNE.js → dialogSlice-PRHHYSP5.js} +21 -22
- package/{docCreateCommands-RFNA4HNM.js → docCreateCommands-75E6TZNN.js} +36 -25
- package/{docDeleteCommands-4YZ325M6.js → docDeleteCommands-EJHLN7LW.js} +37 -27
- package/{docReadCommands-RT6VAFFG.js → docReadCommands-RJYBC4FS.js} +36 -25
- package/{docStore-QUQZAFZF.js → docStore-H5VWKT5D.js} +22 -23
- package/{docUpdateCommands-EKKKNYPW.js → docUpdateCommands-MG4CNISV.js} +36 -25
- package/fetchMessages-KTNM7QAR.js +1 -1
- package/{getPricing-3E6UNPKL.js → getPricing-6TOZXPAU.js} +7 -3
- package/{handleSendMessageAction-5NSYAS53.js → handleSendMessageAction-QTUGICSZ.js} +22 -23
- package/index.js +77 -76
- package/{machineCommands-DOOSIUKG.js → machineCommands-MAV7M3TK.js} +67 -60
- package/{machineWsRunDispatch-PIOIQRBW.js → machineWsRunDispatch-ZOEGTKHC.js} +54 -49
- package/{memoryCommands-O4MIPIWQ.js → memoryCommands-AFMES3LN.js} +5 -5
- package/{models-4OPOOLFS.js → models-LSCRJJ6P.js} +2 -2
- package/package.json +1 -1
- package/{read-GW7ZEI23.js → read-2MIMRBZ2.js} +5 -5
- package/{readDocTool-HUFU6OCT.js → readDocTool-QHVGQHUJ.js} +1 -1
- package/{readlineWorkspace-QEAOH5EP.js → readlineWorkspace-SWQKC7ZS.js} +1126 -678
- package/{removeDialogAgentAction-OHMCNSSD.js → removeDialogAgentAction-GTX5AN54.js} +11 -11
- package/{runAgentClientLoop-AIGLXC3R.js → runAgentClientLoop-P25HACXX.js} +42 -40
- package/{runtimeDoctorCommands-LRHLPDRC.js → runtimeDoctorCommands-QNF3J3UV.js} +6 -6
- package/{setDialogExtraReferencesAction-YJUM5BWQ.js → setDialogExtraReferencesAction-WFQ63KYO.js} +7 -8
- package/{setPrimaryDialogAgentAction-EBAREZDM.js → setPrimaryDialogAgentAction-P57FXTSU.js} +11 -11
- package/{settingSlice-UW4IUI5L.js → settingSlice-CK5YZGNI.js} +8 -9
- package/skillDiscovery-ZYHSX7VD.js +16 -0
- package/{spaceCommands-BKHSPR73.js → spaceCommands-6O5EFEM5.js} +41 -33
- package/{spaceSlice-TYNWE3OC.js → spaceSlice-4EXTYXS4.js} +25 -24
- package/{streamAgentChatTurn-HRMFFA7E.js → streamAgentChatTurn-Q3FJAHG2.js} +205 -107
- package/{tableCommands-O7O2LBEG.js → tableCommands-E4SQWDOX.js} +10 -10
- package/{tools-3JNDS3WH.js → tools-AHNQE4GP.js} +33 -31
- package/{tuiSummaryLlmCaller-RV3THLZF.js → tuiSummaryLlmCaller-TXLF4MEI.js} +8 -6
- package/{updateCommands-VOSPKXFF.js → updateCommands-XZDOOYFH.js} +13 -5
- package/{updateDialogTitleAction-OCETSKCP.js → updateDialogTitleAction-XZDVLKVX.js} +25 -25
- package/chunk-5MMAK75Q.js +0 -15
- package/chunk-AZPCASRE.js +0 -36
- package/chunk-BBYVOSU2.js +0 -792
- package/chunk-DCOA4QSN.js +0 -105
- package/chunk-UAD2WT54.js +0 -64
- package/{chunk-DZ3XJVET.js → chunk-3QAF2LTL.js} +3 -3
- package/{chunk-X7W4TNB4.js → chunk-CMKUBIGW.js} +3 -3
- package/{chunk-4CQLVGRV.js → chunk-ID4G2MAR.js} +3 -3
- package/{chunk-5CS33IBL.js → chunk-PDL2AV3E.js} +3 -3
- package/{chunk-EHLHSX7R.js → chunk-TOILAPLH.js} +3 -3
- package/{chunk-UTLZINAP.js → chunk-TSUJOM6N.js} +10 -10
- package/{offlineMarxistsAgentCommand-BCPJITJL.js → offlineMarxistsAgentCommand-5OOWZLJI.js} +3 -3
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
updateContentTitle
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-AM53Q2SD.js";
|
|
4
4
|
import {
|
|
5
5
|
require_date_fns
|
|
6
6
|
} from "./chunk-M76ECQRD.js";
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
import {
|
|
14
14
|
patch,
|
|
15
15
|
readAndWait
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-NITP2JDG.js";
|
|
17
17
|
import {
|
|
18
18
|
asOptionalTrimmedString
|
|
19
19
|
} from "./chunk-G3SUCT4W.js";
|
|
@@ -367,7 +367,7 @@ async function saveDocState(arg, { dispatch, getState }) {
|
|
|
367
367
|
}
|
|
368
368
|
}
|
|
369
369
|
async function createDocState(args, thunkApi) {
|
|
370
|
-
const { createPageAction } = await import("./createPageAction-
|
|
370
|
+
const { createPageAction } = await import("./createPageAction-O7KOYNV4.js");
|
|
371
371
|
return createPageAction(args, thunkApi);
|
|
372
372
|
}
|
|
373
373
|
function subscribe(listener) {
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
asOptionalFiniteNumber
|
|
3
3
|
} from "./chunk-WWC7I6TA.js";
|
|
4
|
+
import {
|
|
5
|
+
isRecord
|
|
6
|
+
} from "./chunk-KUG52IAP.js";
|
|
4
7
|
import {
|
|
5
8
|
asTrimmedString
|
|
6
9
|
} from "./chunk-3EUW3WEO.js";
|
|
7
10
|
import {
|
|
8
11
|
asOptionalTrimmedString
|
|
9
12
|
} from "./chunk-G3SUCT4W.js";
|
|
10
|
-
import {
|
|
11
|
-
isRecord
|
|
12
|
-
} from "./chunk-KUG52IAP.js";
|
|
13
13
|
|
|
14
14
|
// packages/agent-runtime/agentRecordConfig.ts
|
|
15
15
|
function stringField(record, key) {
|
|
@@ -261,6 +261,8 @@ function pickAllowlistedAgentConfigFields(source, dbKey) {
|
|
|
261
261
|
}
|
|
262
262
|
const tools = uniqueToolNames(source.tools) ?? uniqueToolNames(source.toolNames);
|
|
263
263
|
if (tools) snapshot.tools = tools;
|
|
264
|
+
const enabledPacks = uniqueToolNames(source.enabledPacks);
|
|
265
|
+
if (enabledPacks) snapshot.enabledPacks = enabledPacks;
|
|
264
266
|
for (const key of DESKTOP_AGENT_CONFIG_SNAPSHOT_OBJECT_FIELDS) {
|
|
265
267
|
const value = sanitizePlainObject(source[key]);
|
|
266
268
|
if (value) {
|
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
resolveFileCategory
|
|
3
|
-
} from "./chunk-AZPCASRE.js";
|
|
4
1
|
import {
|
|
5
2
|
loadFileFromIndexedDb,
|
|
6
3
|
removeAction,
|
|
7
4
|
saveFileToIndexedDb
|
|
8
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-WPHL6ALY.js";
|
|
9
6
|
import {
|
|
10
7
|
fileKey,
|
|
11
8
|
getFileIdFromKey,
|
|
@@ -15,7 +12,7 @@ import {
|
|
|
15
12
|
readAction,
|
|
16
13
|
readRequestManager,
|
|
17
14
|
resolveAgentReadServers
|
|
18
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-XHQWJUW4.js";
|
|
19
16
|
import {
|
|
20
17
|
asyncThunkCreator,
|
|
21
18
|
buildCreateSlice,
|
|
@@ -35,7 +32,7 @@ import {
|
|
|
35
32
|
shouldReplaceLocalWithRemoteRecord,
|
|
36
33
|
shouldReplicateLocalRecord,
|
|
37
34
|
uploadToCurrentServer
|
|
38
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-TSUJOM6N.js";
|
|
39
36
|
import {
|
|
40
37
|
fetchFromClientDb,
|
|
41
38
|
fetchFromServer,
|
|
@@ -45,12 +42,12 @@ import {
|
|
|
45
42
|
import {
|
|
46
43
|
isTombstoneRecord
|
|
47
44
|
} from "./chunk-GBRG75BQ.js";
|
|
48
|
-
import {
|
|
49
|
-
API_ENDPOINTS
|
|
50
|
-
} from "./chunk-LCBAMY2M.js";
|
|
51
45
|
import {
|
|
52
46
|
isRecord
|
|
53
47
|
} from "./chunk-KUG52IAP.js";
|
|
48
|
+
import {
|
|
49
|
+
API_ENDPOINTS
|
|
50
|
+
} from "./chunk-LCBAMY2M.js";
|
|
54
51
|
|
|
55
52
|
// packages/database/actions/readAndWait.ts
|
|
56
53
|
var hashTokenScope = (currentToken) => {
|
|
@@ -456,6 +453,39 @@ var upsertAction = async (upsertConfig, thunkApi) => {
|
|
|
456
453
|
}
|
|
457
454
|
};
|
|
458
455
|
|
|
456
|
+
// packages/app/utils/fileUtils.ts
|
|
457
|
+
var fileConstructor = typeof globalThis !== "undefined" && typeof globalThis.File === "function" ? globalThis.File : void 0;
|
|
458
|
+
var isImageMimeType = (value) => typeof value === "string" && value.toLowerCase().startsWith("image/");
|
|
459
|
+
var IMAGE_FILE_NAME_RE = /\.(avif|bmp|gif|heic|heif|ico|jpe?g|png|svg|tiff?|webp)$/i;
|
|
460
|
+
var VIDEO_FILE_NAME_RE = /\.(avi|m4v|mkv|mov|mp4|mpeg|mpg|webm)$/i;
|
|
461
|
+
var AUDIO_FILE_NAME_RE = /\.(aac|flac|m4a|mp3|ogg|wav|weba)$/i;
|
|
462
|
+
var DOCUMENT_FILE_NAME_RE = /\.(csv|doc|docx|md|odt|pdf|ppt|pptx|rtf|txt|xls|xlsx)$/i;
|
|
463
|
+
var isImageFileName = (value) => typeof value === "string" && IMAGE_FILE_NAME_RE.test(value.trim());
|
|
464
|
+
var isVideoMimeType = (value) => typeof value === "string" && value.toLowerCase().startsWith("video/");
|
|
465
|
+
var isAudioMimeType = (value) => typeof value === "string" && value.toLowerCase().startsWith("audio/");
|
|
466
|
+
var isPdfMimeType = (value) => typeof value === "string" && value.toLowerCase() === "application/pdf";
|
|
467
|
+
var isDocumentMimeType = (value) => {
|
|
468
|
+
if (typeof value !== "string") return false;
|
|
469
|
+
const normalized = value.toLowerCase();
|
|
470
|
+
return isPdfMimeType(normalized) || normalized === "text/plain" || normalized === "text/markdown" || normalized === "text/csv" || normalized === "application/msword" || normalized === "application/vnd.openxmlformats-officedocument.wordprocessingml.document" || normalized === "application/vnd.ms-powerpoint" || normalized === "application/vnd.openxmlformats-officedocument.presentationml.presentation" || normalized === "application/vnd.ms-excel" || normalized === "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" || normalized === "application/rtf" || normalized === "application/vnd.oasis.opendocument.text";
|
|
471
|
+
};
|
|
472
|
+
var resolveFileCategory = ({
|
|
473
|
+
mimeType,
|
|
474
|
+
fileName
|
|
475
|
+
}) => {
|
|
476
|
+
if (isImageMimeType(mimeType) || isImageFileName(fileName)) return "image";
|
|
477
|
+
if (isVideoMimeType(mimeType) || typeof fileName === "string" && VIDEO_FILE_NAME_RE.test(fileName.trim())) {
|
|
478
|
+
return "video";
|
|
479
|
+
}
|
|
480
|
+
if (isAudioMimeType(mimeType) || typeof fileName === "string" && AUDIO_FILE_NAME_RE.test(fileName.trim())) {
|
|
481
|
+
return "audio";
|
|
482
|
+
}
|
|
483
|
+
if (isDocumentMimeType(mimeType) || typeof fileName === "string" && DOCUMENT_FILE_NAME_RE.test(fileName.trim())) {
|
|
484
|
+
return "document";
|
|
485
|
+
}
|
|
486
|
+
return "other";
|
|
487
|
+
};
|
|
488
|
+
|
|
459
489
|
// packages/database/actions/upload.ts
|
|
460
490
|
var saveToClientDb2 = async (clientDb, dbKey, metadata) => {
|
|
461
491
|
if (!clientDb) {
|
|
@@ -674,7 +704,7 @@ var dbSlice = createSliceWithThunks({
|
|
|
674
704
|
// 动态 import 在调用期解析,避开 TDZ/求值顺序问题(同下方 share)。
|
|
675
705
|
read: create.asyncThunk(
|
|
676
706
|
async (payload, thunkApi) => {
|
|
677
|
-
const { readAction: readAction2 } = await import("./read-
|
|
707
|
+
const { readAction: readAction2 } = await import("./read-2MIMRBZ2.js");
|
|
678
708
|
return readAction2(payload, thunkApi);
|
|
679
709
|
},
|
|
680
710
|
{
|
|
@@ -748,7 +778,7 @@ var dbSlice = createSliceWithThunks({
|
|
|
748
778
|
// 这里改成动态 import,运行期才解析,彻底断开这条边。
|
|
749
779
|
share: create.asyncThunk(
|
|
750
780
|
async (config, thunkApi) => {
|
|
751
|
-
const { shareResourceAction } = await import("./action-
|
|
781
|
+
const { shareResourceAction } = await import("./action-RAXNQQKC.js");
|
|
752
782
|
return shareResourceAction(config, thunkApi);
|
|
753
783
|
}
|
|
754
784
|
),
|
|
@@ -784,6 +814,7 @@ var dbSlice_default = dbSlice.reducer;
|
|
|
784
814
|
export {
|
|
785
815
|
readAndWaitAction,
|
|
786
816
|
toTimestampMs,
|
|
817
|
+
resolveFileCategory,
|
|
787
818
|
uploadFileAction,
|
|
788
819
|
dbAdapter,
|
|
789
820
|
selectById,
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
resolveMachineId
|
|
3
3
|
} from "./chunk-6HYVJV7B.js";
|
|
4
|
+
import {
|
|
5
|
+
getDefaultCliLocalRuntimeDb
|
|
6
|
+
} from "./chunk-H33743XH.js";
|
|
4
7
|
import {
|
|
5
8
|
buildCliRuntimeEnv,
|
|
6
9
|
clearProfileAuthToken,
|
|
@@ -9,15 +12,6 @@ import {
|
|
|
9
12
|
loadProfileConfig,
|
|
10
13
|
saveDefaultProfile
|
|
11
14
|
} from "./chunk-ROWQEJRP.js";
|
|
12
|
-
import {
|
|
13
|
-
resolveAuthTokenFromEnv
|
|
14
|
-
} from "./chunk-ISNCLGUZ.js";
|
|
15
|
-
import {
|
|
16
|
-
DEFAULT_NOLO_SERVER_URL
|
|
17
|
-
} from "./chunk-OLZBQWZU.js";
|
|
18
|
-
import {
|
|
19
|
-
getDefaultCliLocalRuntimeDb
|
|
20
|
-
} from "./chunk-H33743XH.js";
|
|
21
15
|
import {
|
|
22
16
|
createMemoryKey,
|
|
23
17
|
createMemoryOwnerIndexKey,
|
|
@@ -30,6 +24,12 @@ import {
|
|
|
30
24
|
import {
|
|
31
25
|
asTrimmedString
|
|
32
26
|
} from "./chunk-3EUW3WEO.js";
|
|
27
|
+
import {
|
|
28
|
+
resolveAuthTokenFromEnv
|
|
29
|
+
} from "./chunk-5NBHQD4D.js";
|
|
30
|
+
import {
|
|
31
|
+
DEFAULT_NOLO_SERVER_URL
|
|
32
|
+
} from "./chunk-OLZBQWZU.js";
|
|
33
33
|
import {
|
|
34
34
|
normalizeServerOrigin
|
|
35
35
|
} from "./chunk-CF7PE763.js";
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getModelAbility
|
|
3
|
+
} from "./chunk-IKXL2HZ3.js";
|
|
4
|
+
|
|
5
|
+
// packages/ai/agent/safeAgentSummary.ts
|
|
6
|
+
function parseTimestamp(val) {
|
|
7
|
+
if (typeof val === "number" && Number.isFinite(val)) return val;
|
|
8
|
+
if (typeof val === "string") return Date.parse(val) || 0;
|
|
9
|
+
return 0;
|
|
10
|
+
}
|
|
11
|
+
function safeTimestamp(val) {
|
|
12
|
+
if (typeof val === "number" && Number.isFinite(val)) return val;
|
|
13
|
+
if (typeof val === "string") return val;
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
16
|
+
function parseAgentRecordId(privateKey, explicitId) {
|
|
17
|
+
if (explicitId && typeof explicitId === "string" && explicitId.trim()) {
|
|
18
|
+
return explicitId.trim();
|
|
19
|
+
}
|
|
20
|
+
if (privateKey && typeof privateKey === "string") {
|
|
21
|
+
const match = privateKey.match(/^agent-[^-]+-(.+)$/i);
|
|
22
|
+
if (match?.[1]) return match[1];
|
|
23
|
+
}
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
function resolveFavoriteStatus(record, options) {
|
|
27
|
+
if (options?.isFavorite !== void 0) {
|
|
28
|
+
return {
|
|
29
|
+
isFavorite: !!options.isFavorite,
|
|
30
|
+
favoritedAt: safeTimestamp(options.favoritedAt)
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
if (record?.isFavorite === true) {
|
|
34
|
+
return {
|
|
35
|
+
isFavorite: true,
|
|
36
|
+
favoritedAt: safeTimestamp(record?.favoritedAt)
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
const favoritesMap = options?.favoritesMap;
|
|
40
|
+
if (!favoritesMap) {
|
|
41
|
+
return { isFavorite: false, favoritedAt: null };
|
|
42
|
+
}
|
|
43
|
+
const candidateKeys = [];
|
|
44
|
+
if (typeof record?.dbKey === "string" && record.dbKey) candidateKeys.push(record.dbKey);
|
|
45
|
+
if (typeof record?.privateKey === "string" && record.privateKey) candidateKeys.push(record.privateKey);
|
|
46
|
+
if (typeof record?.publicKey === "string" && record.publicKey) candidateKeys.push(record.publicKey);
|
|
47
|
+
if (typeof record?.id === "string" && record.id) {
|
|
48
|
+
candidateKeys.push(record.id);
|
|
49
|
+
candidateKeys.push(`agent-pub-${record.id}`);
|
|
50
|
+
if (options?.userId) {
|
|
51
|
+
candidateKeys.push(`agent-${options.userId}-${record.id}`);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
let matched = false;
|
|
55
|
+
let highestFavAt = null;
|
|
56
|
+
let highestFavTime = -1;
|
|
57
|
+
for (const key of candidateKeys) {
|
|
58
|
+
const val = favoritesMap instanceof Map ? favoritesMap.get(key) : favoritesMap[key];
|
|
59
|
+
if (val !== void 0 && val !== false && val !== null) {
|
|
60
|
+
const favAt = val === true ? 1 : safeTimestamp(val);
|
|
61
|
+
if (favAt === null) continue;
|
|
62
|
+
matched = true;
|
|
63
|
+
const time = parseTimestamp(favAt);
|
|
64
|
+
if (time > highestFavTime) {
|
|
65
|
+
highestFavTime = time;
|
|
66
|
+
highestFavAt = favAt;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
if (matched) {
|
|
71
|
+
return {
|
|
72
|
+
isFavorite: true,
|
|
73
|
+
favoritedAt: highestFavAt ?? 1
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
return { isFavorite: false, favoritedAt: null };
|
|
77
|
+
}
|
|
78
|
+
function toSafeAgentSummary(record, options) {
|
|
79
|
+
const rawId = parseAgentRecordId(
|
|
80
|
+
typeof record?.privateKey === "string" ? record.privateKey : record?.dbKey,
|
|
81
|
+
typeof record?.id === "string" ? record.id : void 0
|
|
82
|
+
);
|
|
83
|
+
const id = rawId ?? (typeof record?.id === "string" ? record.id : null);
|
|
84
|
+
const publicRecordDenied = record?.publicRecordExists === false || options?.publicRecordExists === false;
|
|
85
|
+
const publicRecordConfirmed = record?.publicRecordExists === true || options?.publicRecordExists === true;
|
|
86
|
+
let publicKey;
|
|
87
|
+
if (typeof record?.publicKey === "string" && record.publicKey && !publicRecordDenied) {
|
|
88
|
+
publicKey = record.publicKey;
|
|
89
|
+
} else if (publicRecordConfirmed && id) {
|
|
90
|
+
publicKey = `agent-pub-${id}`;
|
|
91
|
+
}
|
|
92
|
+
const name = typeof record?.name === "string" && record.name ? record.name : "(unnamed)";
|
|
93
|
+
const handle = typeof record?.handle === "string" && record.handle ? record.handle : null;
|
|
94
|
+
const introduction = typeof record?.introduction === "string" && record.introduction ? record.introduction : typeof record?.description === "string" && record.description ? record.description : null;
|
|
95
|
+
const model = typeof record?.model === "string" && record.model ? record.model : null;
|
|
96
|
+
const provider = typeof record?.provider === "string" && record.provider ? record.provider : typeof record?.apiSource === "string" && record.apiSource ? record.apiSource : null;
|
|
97
|
+
const apiSource = typeof record?.apiSource === "string" && record.apiSource ? record.apiSource : null;
|
|
98
|
+
const cliProvider = typeof record?.cliProvider === "string" && record.cliProvider ? record.cliProvider : null;
|
|
99
|
+
const tools = Array.isArray(record?.tools) ? record.tools.filter((t) => typeof t === "string") : [];
|
|
100
|
+
const inputPrice = typeof record?.inputPrice === "number" && Number.isFinite(record.inputPrice) ? record.inputPrice : null;
|
|
101
|
+
const outputPrice = typeof record?.outputPrice === "number" && Number.isFinite(record.outputPrice) ? record.outputPrice : null;
|
|
102
|
+
const modelAbility = model ? getModelAbility(model) ?? null : null;
|
|
103
|
+
const favStatus = resolveFavoriteStatus(record, options);
|
|
104
|
+
const isPublic = record?.isPublic === true || record?.isPublicFlag === true || record?.publicRecordExists === true;
|
|
105
|
+
const updatedAt = safeTimestamp(record?.updatedAt ?? record?.createdAt ?? record?.created);
|
|
106
|
+
return {
|
|
107
|
+
id,
|
|
108
|
+
...publicKey !== void 0 ? { publicKey } : {},
|
|
109
|
+
name,
|
|
110
|
+
handle,
|
|
111
|
+
introduction,
|
|
112
|
+
model,
|
|
113
|
+
provider,
|
|
114
|
+
apiSource,
|
|
115
|
+
cliProvider,
|
|
116
|
+
tools,
|
|
117
|
+
inputPrice,
|
|
118
|
+
outputPrice,
|
|
119
|
+
modelAbility,
|
|
120
|
+
isFavorite: favStatus.isFavorite,
|
|
121
|
+
favoritedAt: favStatus.favoritedAt,
|
|
122
|
+
isPublic,
|
|
123
|
+
updatedAt
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
function sortSafeAgentSummaries(agents) {
|
|
127
|
+
return [...agents].sort((left, right) => {
|
|
128
|
+
const leftFav = left.isFavorite === true;
|
|
129
|
+
const rightFav = right.isFavorite === true;
|
|
130
|
+
if (leftFav && !rightFav) return -1;
|
|
131
|
+
if (!leftFav && rightFav) return 1;
|
|
132
|
+
if (leftFav && rightFav) {
|
|
133
|
+
const leftFavAt = parseTimestamp(left.favoritedAt);
|
|
134
|
+
const rightFavAt = parseTimestamp(right.favoritedAt);
|
|
135
|
+
if (leftFavAt !== rightFavAt) return rightFavAt - leftFavAt;
|
|
136
|
+
}
|
|
137
|
+
const leftUpdated = parseTimestamp(left.updatedAt ?? left.createdAt);
|
|
138
|
+
const rightUpdated = parseTimestamp(right.updatedAt ?? right.createdAt);
|
|
139
|
+
return rightUpdated - leftUpdated;
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
export {
|
|
144
|
+
toSafeAgentSummary,
|
|
145
|
+
sortSafeAgentSummaries
|
|
146
|
+
};
|
|
@@ -2,27 +2,27 @@ import {
|
|
|
2
2
|
buildLocalAgentLookupKeys,
|
|
3
3
|
normalizeAgentHandle,
|
|
4
4
|
shouldReadAgentKeyRemotely
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-RNQ5BLR2.js";
|
|
6
6
|
import {
|
|
7
7
|
resolveCliAgentKeyInput
|
|
8
8
|
} from "./chunk-VHBWHNVT.js";
|
|
9
|
+
import {
|
|
10
|
+
toErrorMessage
|
|
11
|
+
} from "./chunk-HNMXYYJR.js";
|
|
9
12
|
import {
|
|
10
13
|
readPipeText,
|
|
11
14
|
spawnProcess
|
|
12
15
|
} from "./chunk-IDZTNRP2.js";
|
|
16
|
+
import {
|
|
17
|
+
createAgentKey
|
|
18
|
+
} from "./chunk-O4BU24WZ.js";
|
|
13
19
|
import {
|
|
14
20
|
parseUserIdFromAuthToken,
|
|
15
21
|
readOption,
|
|
16
22
|
resolveAuthToken,
|
|
17
23
|
resolveServerCandidates,
|
|
18
24
|
resolveServerUrl
|
|
19
|
-
} from "./chunk-
|
|
20
|
-
import {
|
|
21
|
-
toErrorMessage
|
|
22
|
-
} from "./chunk-HNMXYYJR.js";
|
|
23
|
-
import {
|
|
24
|
-
createAgentKey
|
|
25
|
-
} from "./chunk-O4BU24WZ.js";
|
|
25
|
+
} from "./chunk-5NBHQD4D.js";
|
|
26
26
|
|
|
27
27
|
// packages/cli/agentRecordHelpers.ts
|
|
28
28
|
import { readFileSync } from "node:fs";
|
|
@@ -1,86 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
|
-
MEMORY_USE_GUIDANCE
|
|
2
|
+
MEMORY_USE_GUIDANCE,
|
|
3
|
+
wrapHistoricalSummaryWithReplayGuard
|
|
3
4
|
} from "./chunk-KKY4B2Q2.js";
|
|
4
5
|
|
|
5
|
-
// packages/agent-runtime/modelLayerOverride.ts
|
|
6
|
-
var MODEL_LAYER_KEYS = [
|
|
7
|
-
"provider",
|
|
8
|
-
"model",
|
|
9
|
-
"apiSource",
|
|
10
|
-
"cliProvider",
|
|
11
|
-
"useServerProxy",
|
|
12
|
-
"apiKey",
|
|
13
|
-
"apiKeyRef",
|
|
14
|
-
"apiKeyHeader",
|
|
15
|
-
"customProviderUrl",
|
|
16
|
-
"credentialRef",
|
|
17
|
-
"credentialSynced",
|
|
18
|
-
"temperature",
|
|
19
|
-
"top_p",
|
|
20
|
-
"frequency_penalty",
|
|
21
|
-
"presence_penalty",
|
|
22
|
-
"max_tokens",
|
|
23
|
-
"reasoning_effort",
|
|
24
|
-
"enableThinking",
|
|
25
|
-
"thinkingBudget"
|
|
26
|
-
];
|
|
27
|
-
function mergeReferences(base, extra) {
|
|
28
|
-
const safeBase = Array.isArray(base) ? base : [];
|
|
29
|
-
const safeExtra = Array.isArray(extra) ? extra : [];
|
|
30
|
-
const seen = /* @__PURE__ */ new Set();
|
|
31
|
-
const merged = [];
|
|
32
|
-
for (const item of [...safeBase, ...safeExtra]) {
|
|
33
|
-
const key = item?.dbKey;
|
|
34
|
-
if (key && seen.has(key)) continue;
|
|
35
|
-
if (key) seen.add(key);
|
|
36
|
-
if (item) merged.push(item);
|
|
37
|
-
}
|
|
38
|
-
return merged;
|
|
39
|
-
}
|
|
40
|
-
var asNonEmptyString = (value) => typeof value === "string" && value.trim().length > 0;
|
|
41
|
-
function buildModelLayerOverride(agent) {
|
|
42
|
-
if (!agent || !asNonEmptyString(agent.provider) || !asNonEmptyString(agent.model)) {
|
|
43
|
-
return null;
|
|
44
|
-
}
|
|
45
|
-
const override = {
|
|
46
|
-
provider: agent.provider,
|
|
47
|
-
model: agent.model
|
|
48
|
-
};
|
|
49
|
-
for (const key of MODEL_LAYER_KEYS) {
|
|
50
|
-
if (key === "provider" || key === "model") continue;
|
|
51
|
-
const value = agent[key];
|
|
52
|
-
if (value !== void 0) {
|
|
53
|
-
override[key] = value;
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
if (Array.isArray(agent.references) && agent.references.length > 0) {
|
|
57
|
-
override.references = agent.references;
|
|
58
|
-
}
|
|
59
|
-
return override;
|
|
60
|
-
}
|
|
61
|
-
function applyModelLayerOverride(base, override) {
|
|
62
|
-
const next = { ...base };
|
|
63
|
-
for (const key of MODEL_LAYER_KEYS) {
|
|
64
|
-
delete next[key];
|
|
65
|
-
}
|
|
66
|
-
for (const key of MODEL_LAYER_KEYS) {
|
|
67
|
-
const value = override[key];
|
|
68
|
-
if (value !== void 0) {
|
|
69
|
-
next[key] = value;
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
const merged = mergeReferences(
|
|
73
|
-
base.references,
|
|
74
|
-
override.references
|
|
75
|
-
);
|
|
76
|
-
if (merged.length > 0) {
|
|
77
|
-
next.references = merged;
|
|
78
|
-
} else {
|
|
79
|
-
delete next.references;
|
|
80
|
-
}
|
|
81
|
-
return next;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
6
|
// packages/agent-runtime/turnContext.ts
|
|
85
7
|
var DEFAULT_RECENT_CONTENT_LIMIT = 10;
|
|
86
8
|
var asTrimmed = (value) => typeof value === "string" ? value.trim() : "";
|
|
@@ -160,7 +82,8 @@ var buildSkillDiscoveryLayer = (skills, boundFolder) => {
|
|
|
160
82
|
const lines = [
|
|
161
83
|
"--- \u53EF\u7528\u6280\u80FD\uFF08Skills\uFF09---",
|
|
162
84
|
`\u5DE5\u4F5C\u533A ${boundFolder} \u4E2D\u53D1\u73B0\u4E86 ${skills.length} \u4E2A\u6280\u80FD\uFF08SKILL.md\uFF09\uFF1A`,
|
|
163
|
-
"\u6A21\u578B\u53EF\u6309\u9700\u7528
|
|
85
|
+
"\u6A21\u578B\u53EF\u6309\u9700\u7528 loadSkill \u5DE5\u5177\u6309\u540D\u52A0\u8F7D\uFF0C\u628A SKILL.md \u5168\u6587\u62C9\u8FDB\u4E0A\u4E0B\u6587\u540E\u9075\u5FAA\u5176\u6307\u4EE4\uFF1B",
|
|
86
|
+
"\u5982 loadSkill \u4E0D\u53EF\u7528\u6216\u60F3\u76F4\u63A5\u8BFB\u53D6\u6587\u4EF6\uFF0C\u4E0B\u65B9 path \u4ECD\u53EF\u7528 readFile \u4F5C\u4E3A fallback\uFF1A",
|
|
164
87
|
"",
|
|
165
88
|
...skills.map(
|
|
166
89
|
(s) => `- ${s.name}: ${s.description}
|
|
@@ -200,6 +123,14 @@ var buildLinkedSpacesSection = async (args) => {
|
|
|
200
123
|
"\u63D0\u793A\uFF1A\u5982\u9700\u67E5\u8BE2\u8FD9\u4E9B\u7A7A\u95F4\u7684\u8BE6\u7EC6\u5185\u5BB9\uFF0C\u53EF\u4F7F\u7528 read \u5DE5\u5177\u914D\u5408\u5BF9\u5E94\u7684 dbKey\u3002"
|
|
201
124
|
].join("\n");
|
|
202
125
|
};
|
|
126
|
+
var buildDialogSummaryLayer = (args) => {
|
|
127
|
+
const historical = wrapHistoricalSummaryWithReplayGuard(
|
|
128
|
+
asTrimmed(args.summary)
|
|
129
|
+
);
|
|
130
|
+
if (!historical) return null;
|
|
131
|
+
return makeLayer("dialog-summary", `--- \u5386\u53F2\u5BF9\u8BDD\u6458\u8981 ---
|
|
132
|
+
${historical}`);
|
|
133
|
+
};
|
|
203
134
|
var buildMemoryOverlayLayer = (args) => {
|
|
204
135
|
const promptBlock = asTrimmed(args.promptBlock);
|
|
205
136
|
if (!promptBlock) return null;
|
|
@@ -216,11 +147,10 @@ var buildMemoryUseGuidanceLayer = (args) => {
|
|
|
216
147
|
};
|
|
217
148
|
|
|
218
149
|
export {
|
|
219
|
-
buildModelLayerOverride,
|
|
220
|
-
applyModelLayerOverride,
|
|
221
150
|
buildSpaceContextLayer,
|
|
222
151
|
buildSkillDiscoveryLayer,
|
|
223
152
|
buildLinkedSpacesSection,
|
|
153
|
+
buildDialogSummaryLayer,
|
|
224
154
|
buildMemoryOverlayLayer,
|
|
225
155
|
buildMemoryUseGuidanceLayer
|
|
226
156
|
};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
|
+
CORE_DRAIN_REASON,
|
|
2
3
|
isGatewayHttpStatus,
|
|
3
4
|
parseRetryAfterHeaderMs
|
|
4
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-YDCZVUFP.js";
|
|
5
6
|
import {
|
|
6
7
|
asTrimmedLowercaseString
|
|
7
8
|
} from "./chunk-QSJ3HFEF.js";
|
|
@@ -61,7 +62,7 @@ async function resolveConnectorWebSocketTarget(input) {
|
|
|
61
62
|
}
|
|
62
63
|
if (response && !response.ok) {
|
|
63
64
|
const json2 = await response.clone().json().catch(() => null);
|
|
64
|
-
const retryable = json2?.retryable === true || json2?.reason ===
|
|
65
|
+
const retryable = json2?.retryable === true || json2?.reason === CORE_DRAIN_REASON || isGatewayHttpStatus(response.status);
|
|
65
66
|
if (retryable) {
|
|
66
67
|
const reason = typeof json2?.reason === "string" ? json2.reason : "retryable";
|
|
67
68
|
const message = typeof json2?.error === "string" ? json2.error : `Connector websocket unavailable with HTTP ${response.status}`;
|