nolo-cli 0.54.0-alpha.2 → 0.61.0-alpha.2
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/README.md +3 -3
- package/{_executeModel-ANY4SIAS.js → _executeModel-CKT6RGTL.js} +58 -49
- package/{action-Q4W5JPI5.js → action-76JX3JX3.js} +9 -8
- package/{addContentAction-O25HFR37.js → addContentAction-V3NAZRTJ.js} +9 -7
- package/{addDialogAgentAction-GH7AUPPB.js → addDialogAgentAction-RZOAF46K.js} +11 -9
- package/{agentDeleteCommand-JWIKNWWI.js → agentDeleteCommand-VN7NPXQ4.js} +37 -32
- package/{agentEmailCommands-PL22BEU5.js → agentEmailCommands-F2TNAV4A.js} +73 -65
- package/{agentGrantCommands-2LEZDADN.js → agentGrantCommands-R3VQEZJR.js} +1 -1
- package/{agentListCommands-6NR7AQEK.js → agentListCommands-OSM2ANI3.js} +78 -39
- package/{agentMachineCommands-TASPU6OA.js → agentMachineCommands-MTPWYVRV.js} +38 -33
- package/{agentPullCommand-M552CYSI.js → agentPullCommand-N7L2CT7L.js} +2 -2
- package/agentRecordCommands-VWAWTVVC.js +122 -0
- package/agentRunCommand-PLZOBNVK.js +149 -0
- package/{agentRunControl-4GHHSXFZ.js → agentRunControl-WECMOO6O.js} +13 -6
- package/{agentRuntimeLocal-PCJJ56J2.js → agentRuntimeLocal-XCJLRWQE.js} +35 -28
- package/{agentSlice-KYLDUSNN.js → agentSlice-F6DOP4IW.js} +10 -9
- package/{appDeleteCommands-WLHMJAVT.js → appDeleteCommands-3BCFTRFJ.js} +37 -32
- package/{appDeployCommands-CKON7N2E.js → appDeployCommands-B4GMHCYA.js} +37 -32
- package/{appDeployStatusCommands-PXRLDASH.js → appDeployStatusCommands-4MN36WIG.js} +37 -32
- package/{appGetCommands-RAB5RM4M.js → appGetCommands-4GJIEUAX.js} +37 -32
- package/{appListCommands-GU57FB62.js → appListCommands-CHU53GSX.js} +37 -32
- package/{authCommand-QOPOEYEK.js → authCommand-WOTWLJNF.js} +38 -32
- package/{authCommands-SBQVTD6V.js → authCommands-ILTBI6JV.js} +8 -6
- package/{chatQueueReduxAdapter-5O2WLITN.js → chatQueueReduxAdapter-HNSQXNIR.js} +29 -24
- package/{chunk-WL3UOGYO.js → chunk-22BTGNSP.js} +151 -155
- package/{chunk-7CH6U3FL.js → chunk-2GRGFCF6.js} +2 -4
- package/{chunk-V4KZGLOI.js → chunk-2HPRMEEZ.js} +3059 -1079
- package/{chunk-UNZDCI3O.js → chunk-2KDR4CWE.js} +35 -4
- package/{chunk-VRZIH5JO.js → chunk-2PGGC63K.js} +1 -1
- package/{chunk-T27IEBNQ.js → chunk-2QDDKFG5.js} +74 -1
- package/{chunk-7K5VMB4Q.js → chunk-37QVS7BU.js} +21 -8
- package/{chunk-UITMHBVK.js → chunk-37XDGCY7.js} +1 -1
- package/chunk-3BLB7QKO.js +433 -0
- package/{chunk-NQ4N4IGO.js → chunk-3JQ2NRYU.js} +33 -10
- package/{chunk-UW4INMD2.js → chunk-3JWKQDA4.js} +2 -2
- package/{chunk-IKTHA3JH.js → chunk-3QGUVVX5.js} +2 -2
- package/{chunk-WHVQA7PJ.js → chunk-45YO6H7P.js} +97 -35
- package/chunk-4C4ST2YE.js +20015 -0
- package/{chunk-32I5RVMY.js → chunk-4NJEIGBQ.js} +5 -5
- package/{chunk-KUUTWU4I.js → chunk-5ZYA4JJ3.js} +90 -22
- package/chunk-6YTOJY35.js +352 -0
- package/{chunk-INXBNYCG.js → chunk-7A3RRUCQ.js} +155 -12
- package/{chunk-GV35EHNA.js → chunk-7O7KH4X5.js} +1262 -971
- package/{chunk-Y7LNKP32.js → chunk-7UF7CQ6B.js} +4 -6
- package/{chunk-2BWU4ORW.js → chunk-AQMVUA7N.js} +2 -1
- package/{chunk-LA4IDAK7.js → chunk-AVE2YR4F.js} +1056 -3591
- package/{chunk-TI5BCZCH.js → chunk-B7DXRX7F.js} +59 -121
- package/chunk-BFU6C242.js +66 -0
- package/{chunk-FA4SY4F5.js → chunk-BYEJ7K2Z.js} +1 -1
- package/chunk-BYXBJQAS.js +0 -0
- package/{chunk-IA3A5373.js → chunk-C3FZR5EC.js} +1 -1
- package/{chunk-IWUMSAQF.js → chunk-CJCJF5XB.js} +26 -3
- package/{chunk-PAHILFNT.js → chunk-CP7VIDZ7.js} +4 -4
- package/{chunk-OYNDYVSE.js → chunk-CTCW7U7N.js} +1 -1
- package/{chunk-BJLYCOZK.js → chunk-D5XKNNUV.js} +135 -795
- package/{chunk-AV6KQCM5.js → chunk-DNNSCSA2.js} +19 -14
- package/{chunk-3AOLVADY.js → chunk-DVINR3PL.js} +1 -1
- package/{chunk-NI2BS6UD.js → chunk-DWUCB2A3.js} +1 -1
- package/{chunk-AA564GBL.js → chunk-DZZL7UBV.js} +1 -1
- package/{chunk-6FGXGFAH.js → chunk-E6RGHPDR.js} +6 -4
- package/chunk-EDKF7RX4.js +30 -0
- package/{chunk-6SZ52ORL.js → chunk-ES6CVKVD.js} +24 -30
- package/{chunk-DQLYEGP7.js → chunk-FHAGENAS.js} +3 -4
- package/{chunk-56W233KG.js → chunk-FKFMIBTT.js} +5 -1
- package/{chunk-INZZJSQF.js → chunk-FZGV4FGK.js} +24 -12
- package/{chunk-D3JQPONH.js → chunk-GAL47RNP.js} +1 -1
- package/{chunk-6FQ2552G.js → chunk-HBPV76EK.js} +1085 -1150
- package/{chunk-LN3OQJGG.js → chunk-HLU5Q2GV.js} +4 -4
- package/{chunk-U2A47SVI.js → chunk-HQP7HJDL.js} +7 -7
- package/{chunk-H2G6JXTR.js → chunk-HQUORJTM.js} +1 -1
- package/{chunk-3Z3DXZBD.js → chunk-IYCUMIYS.js} +24 -20
- package/{chunk-7APQB6R6.js → chunk-JX5PJCWS.js} +8 -6
- package/{chunk-LYGNQHUW.js → chunk-JYYZCK2Z.js} +2 -4
- package/{chunk-PYKV6FSC.js → chunk-KWSQR2KK.js} +16 -31
- package/{chunk-VULELK4T.js → chunk-L7B47JXR.js} +37 -64
- package/{chunk-4NN3EK7H.js → chunk-LAFC3B2I.js} +1 -1
- package/{chunk-VRJUIUIY.js → chunk-LJKICKVC.js} +2 -2
- package/chunk-M3JEW6N6.js +193 -0
- package/chunk-MBOEV4L2.js +301 -0
- package/{chunk-QDHZCAH3.js → chunk-MMZ6ZTVO.js} +229 -74
- package/{chunk-JDSUTNYY.js → chunk-MP64VFGD.js} +2 -2
- package/{chunk-U5Z7LFZF.js → chunk-MXUDQZXQ.js} +47 -8
- package/chunk-N4G4PKQ6.js +23 -0
- package/{chunk-SVEUG45B.js → chunk-NHRQCXIQ.js} +0 -24
- package/{chunk-KXKQO4Q6.js → chunk-NTW5GWDM.js} +58 -1
- package/chunk-ONXOABJR.js +215 -0
- package/{chunk-BANYWEYY.js → chunk-OZX2IPKM.js} +8 -3
- package/{chunk-Q24S4NDF.js → chunk-P7OOB7QP.js} +1 -1
- package/{chunk-GLGD2JGY.js → chunk-PEZJEQAO.js} +7 -7
- package/{chunk-GBADO3SM.js → chunk-PQDIDWGX.js} +1 -1
- package/chunk-PSCNXBYA.js +11 -0
- package/chunk-QEFJJS2I.js +508 -0
- package/{chunk-757BGY6Y.js → chunk-QEW2MFDQ.js} +1 -1
- package/{chunk-SP3DPVBH.js → chunk-RDBARW6T.js} +8 -3
- package/{chunk-TNPCQNGQ.js → chunk-RJ2SAFB5.js} +83 -41
- package/{chunk-FGEYVPPR.js → chunk-RVWRKFUB.js} +8 -65
- package/{chunk-43CXXVJD.js → chunk-RXX4GDIH.js} +1 -1
- package/chunk-SEJ5OS6F.js +49 -0
- package/{chunk-MFI4FGHX.js → chunk-SOJM57FX.js} +5 -2
- package/{chunk-EKLRRZIN.js → chunk-SPAQ4PVV.js} +0 -5
- package/{chunk-L7NG2M6H.js → chunk-TRV2MIDW.js} +89 -74
- package/chunk-UAD2WT54.js +64 -0
- package/{chunk-RTLJUGQH.js → chunk-UZPQSVM6.js} +2 -2
- package/{chunk-3QJTD6DO.js → chunk-VMWYBIXG.js} +9 -7
- package/{chunk-ZHXJ6M7T.js → chunk-W7XHHYWM.js} +4 -0
- package/{chunk-5WADL4O7.js → chunk-XAVSS3KE.js} +21 -3
- package/{chunk-CVT7L2WZ.js → chunk-XOKOSO35.js} +13 -22
- package/{chunk-6BYAXNH5.js → chunk-XTJTN3RW.js} +57 -4
- package/{chunk-T5HJEUQN.js → chunk-YCDWJX45.js} +1 -1
- package/{chunk-MRWGHF56.js → chunk-YDH3FDFQ.js} +12 -356
- package/{chunk-H4RYESI6.js → chunk-Z4QSJILV.js} +85 -13
- package/chunk-ZJ7UHBJS.js +89 -0
- package/{chunk-O5FLGN2L.js → chunk-ZRSJ3JEH.js} +6 -2
- package/{cliExecutor-BBUVQU4L.js → cliExecutor-HG3S345O.js} +1 -1
- package/{codingSkills-BCQXRZOI.js → codingSkills-VDXQYWX4.js} +2 -2
- package/contentThunks-7YG2ZYQC.js +73 -0
- package/{cooldownCommands-GI5NNWGL.js → cooldownCommands-BSCH2W7P.js} +2 -2
- package/{createAgentAutomationAction-UJLNFFFC.js → createAgentAutomationAction-PJQSCAIO.js} +32 -26
- package/createDialogAction-SFEJX6SP.js +64 -0
- package/{createPageAction-N3IYABHV.js → createPageAction-B7WRHOQO.js} +35 -28
- package/{dbSlice-D5CNGWPD.js → dbSlice-IBVOBVMS.js} +7 -6
- package/{deleteFile-44TUM34Y.js → deleteFile-FWP2PSBG.js} +4 -3
- package/{dialogCommands-35M6RBAC.js → dialogCommands-VL2X22QC.js} +38 -33
- package/{dialogSlice-KO7ADD7H.js → dialogSlice-ANMACABO.js} +29 -24
- package/{docCreateCommands-VXHZWQ3P.js → docCreateCommands-ITLGZ5YI.js} +40 -35
- package/{docDeleteCommands-4WFAJR6A.js → docDeleteCommands-LH3YNL4C.js} +37 -32
- package/{docReadCommands-OYREEFAR.js → docReadCommands-YAJ77F36.js} +36 -31
- package/{docStore-5BU76DFK.js → docStore-D4HGHPWI.js} +9 -33
- package/{docUpdateCommands-A7QERSME.js → docUpdateCommands-DQBOMH2G.js} +40 -35
- package/{fetchMessages-KZQVBXKY.js → fetchMessages-DRABNDPZ.js} +3 -3
- package/{getPricing-HAU62AFM.js → getPricing-NM3NUTAS.js} +5 -5
- package/handleSendMessageAction-DF2OABGW.js +675 -0
- package/index.js +79 -88
- package/{lib-2ZTNRXR4.js → lib-FRRS27KN.js} +63 -28
- package/{localDialogRead-NQ33HBSI.js → localDialogRead-PUQKFI73.js} +1 -1
- package/{localRuntimeAuthority-KQDAE64E.js → localRuntimeAuthority-R5UBODT3.js} +6 -4
- package/{localRuntimeDb-PF7CFKDL.js → localRuntimeDb-P37ZTX55.js} +1 -1
- package/{machineCommands-J43U3TX5.js → machineCommands-JXDYQ5LB.js} +309 -87
- package/{machineWsRunDispatch-Z2Z6STXZ.js → machineWsRunDispatch-3QHI7JX5.js} +67 -59
- package/memberThunks-VZI6G7YZ.js +640 -0
- package/{models-4QF4BJVY.js → models-FAMINFZ7.js} +2 -2
- package/package.json +3 -2
- package/{read-RGNPI5H2.js → read-2BYWW7AA.js} +4 -3
- package/{readDocTool-6ESWKTXD.js → readDocTool-LC3A7QTB.js} +1 -1
- package/{readlineWorkspace-YRPV6JPN.js → readlineWorkspace-KVZTEAHB.js} +4609 -2698
- package/{removeDialogAgentAction-JYT73FU2.js → removeDialogAgentAction-SFYZXHNK.js} +14 -12
- package/{runAgentClientLoop-5YM5WMAY.js → runAgentClientLoop-KGTEL7ZP.js} +60 -50
- package/{runtimeDoctorCommands-JKTTN723.js → runtimeDoctorCommands-CROTMULY.js} +7 -5
- package/{setDialogExtraReferencesAction-D564LMYQ.js → setDialogExtraReferencesAction-Q32RGFTA.js} +10 -8
- package/{setPrimaryDialogAgentAction-ACY3BLYA.js → setPrimaryDialogAgentAction-BFYJHUJS.js} +14 -12
- package/{settingSlice-MKI3MNZJ.js → settingSlice-IRUU4VFB.js} +8 -7
- package/{skillDiscovery-GPUDHDTZ.js → skillDiscovery-NTRLM6KP.js} +3 -3
- package/{spaceCommands-MY26V52L.js → spaceCommands-KNAYWMCZ.js} +40 -220
- package/{streamAgentChatTurn-XV5X5TNQ.js → streamAgentChatTurn-FLYPTXKZ.js} +140 -95
- package/{switchDialogAgentAction-CJ5H6SAR.js → switchDialogAgentAction-L2KOKCGG.js} +11 -9
- package/{tableCommands-R6WFRDYF.js → tableCommands-SUNTHAYX.js} +1 -1
- package/{toolApiClient-B2MFXMEG.js → toolApiClient-VGYUB4P5.js} +4 -2
- package/{tools-MIMELA2Y.js → tools-CVLUXK6P.js} +46 -38
- package/{tuiSummaryLlmCaller-XJ5BKNNS.js → tuiSummaryLlmCaller-F3DPFFZM.js} +20 -16
- package/{updateCommands-IYKLF3JX.js → updateCommands-AJYSD73Y.js} +2 -2
- package/{updateDialogTitleAction-EIZUSWHR.js → updateDialogTitleAction-HWJIZEIV.js} +33 -27
- package/agentRecordCommands-Z64TA63M.js +0 -114
- package/agentRunCommand-4QJQLPRW.js +0 -134
- package/agentSuperviseCommands-VB6BUS5H.js +0 -640
- package/chunk-6BGAQ3KR.js +0 -7081
- package/chunk-FD36SCCD.js +0 -105
- package/chunk-J3UALFHL.js +0 -370
- package/chunk-RU5D3B22.js +0 -230
- package/chunk-YBV6QJKM.js +0 -441
- package/createDialogAction-TJCX6GUE.js +0 -58
- package/handleSendMessageAction-OSGQJQ45.js +0 -406
- package/spaceSlice-JUIXC365.js +0 -127
|
@@ -20,20 +20,6 @@ import {
|
|
|
20
20
|
asOptionalTrimmedString
|
|
21
21
|
} from "./chunk-G3SUCT4W.js";
|
|
22
22
|
|
|
23
|
-
// packages/agent-runtime/agentRecordKeys.ts
|
|
24
|
-
function buildAgentRuntimeAgentLookupKeys(args) {
|
|
25
|
-
if (/^agent(-pub)?-/.test(args.agentRef)) {
|
|
26
|
-
return [args.agentRef];
|
|
27
|
-
}
|
|
28
|
-
return [
|
|
29
|
-
ownedAgentKey(args.userId, args.agentRef),
|
|
30
|
-
publicAgentKey(args.agentRef)
|
|
31
|
-
];
|
|
32
|
-
}
|
|
33
|
-
function shouldFetchAgentRuntimeRecordRemotely(dbKey) {
|
|
34
|
-
return /^agent(-pub)?-/.test(dbKey);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
23
|
// packages/agent-runtime/runtimeToolSurface.ts
|
|
38
24
|
var DEFAULT_PRIVATE_NOLO_WORKSPACE_TOOLS = [
|
|
39
25
|
"listDialogs",
|
|
@@ -51,6 +37,25 @@ var DEFAULT_PRIVATE_NOLO_WORKSPACE_TOOLS = [
|
|
|
51
37
|
"cliWhoami",
|
|
52
38
|
"cliDoctor"
|
|
53
39
|
];
|
|
40
|
+
var DEFAULT_SUBTASK_REFERENCE_NOLO_WORKSPACE_TOOLS = [
|
|
41
|
+
"readDialog",
|
|
42
|
+
"queryDialogsBySubjectRef",
|
|
43
|
+
"readDoc",
|
|
44
|
+
"queryTableRows"
|
|
45
|
+
];
|
|
46
|
+
function applyToolSurfaceConstraints(surface, constraints) {
|
|
47
|
+
const allowed = constraints.allowedToolNames == null ? null : new Set(asTrimmedNonEmptyStringArray(constraints.allowedToolNames));
|
|
48
|
+
const blocked = new Set(asTrimmedNonEmptyStringArray(constraints.blockedToolNames ?? []));
|
|
49
|
+
const narrow = (names) => names.filter(
|
|
50
|
+
(name) => (allowed === null || allowed.has(name)) && !blocked.has(name)
|
|
51
|
+
);
|
|
52
|
+
return {
|
|
53
|
+
...surface,
|
|
54
|
+
explicitToolNames: narrow(surface.explicitToolNames),
|
|
55
|
+
injectedToolNames: narrow(surface.injectedToolNames),
|
|
56
|
+
finalToolNames: narrow(surface.finalToolNames)
|
|
57
|
+
};
|
|
58
|
+
}
|
|
54
59
|
function uniqueToolNames(values) {
|
|
55
60
|
return [...new Set(asTrimmedNonEmptyStringArray(values))];
|
|
56
61
|
}
|
|
@@ -75,21 +80,29 @@ function explicitOnlyReason(args) {
|
|
|
75
80
|
function resolveRuntimeToolSurface(args) {
|
|
76
81
|
const explicitToolNames = uniqueToolNames(args.explicitToolNames ?? []);
|
|
77
82
|
if (canInjectPrivateDefaults(args)) {
|
|
78
|
-
const
|
|
83
|
+
const baseInjected = args.injectPrivateDefaults === false ? args.defaultInjectedToolNames ?? DEFAULT_SUBTASK_REFERENCE_NOLO_WORKSPACE_TOOLS : args.defaultInjectedToolNames ?? DEFAULT_PRIVATE_NOLO_WORKSPACE_TOOLS;
|
|
84
|
+
const injectedToolNames2 = uniqueToolNames([
|
|
85
|
+
...baseInjected,
|
|
86
|
+
...args.additionalRequiredToolNames ?? []
|
|
87
|
+
]);
|
|
79
88
|
return {
|
|
80
89
|
explicitToolNames,
|
|
81
|
-
injectedToolNames,
|
|
90
|
+
injectedToolNames: injectedToolNames2,
|
|
82
91
|
finalToolNames: uniqueToolNames([
|
|
83
92
|
...explicitToolNames,
|
|
84
|
-
...
|
|
93
|
+
...injectedToolNames2
|
|
85
94
|
]),
|
|
86
95
|
auditReason: "private-authenticated-defaults"
|
|
87
96
|
};
|
|
88
97
|
}
|
|
98
|
+
const injectedToolNames = uniqueToolNames(args.additionalRequiredToolNames ?? []);
|
|
89
99
|
return {
|
|
90
100
|
explicitToolNames,
|
|
91
|
-
injectedToolNames
|
|
92
|
-
finalToolNames:
|
|
101
|
+
injectedToolNames,
|
|
102
|
+
finalToolNames: uniqueToolNames([
|
|
103
|
+
...explicitToolNames,
|
|
104
|
+
...injectedToolNames
|
|
105
|
+
]),
|
|
93
106
|
auditReason: explicitOnlyReason(args)
|
|
94
107
|
};
|
|
95
108
|
}
|
|
@@ -116,7 +129,10 @@ function resolveRuntimeToolSurfaceForAgent(args) {
|
|
|
116
129
|
agentOwnerId: inferredOwnerId,
|
|
117
130
|
invocationVisibility: visibility,
|
|
118
131
|
runtimeHost: args.runtimeHost,
|
|
119
|
-
trustedPrivateInvocation: args.trustedPrivateInvocation
|
|
132
|
+
trustedPrivateInvocation: args.trustedPrivateInvocation,
|
|
133
|
+
injectPrivateDefaults: args.injectPrivateDefaults,
|
|
134
|
+
defaultInjectedToolNames: args.defaultInjectedToolNames,
|
|
135
|
+
additionalRequiredToolNames: args.additionalRequiredToolNames
|
|
120
136
|
});
|
|
121
137
|
}
|
|
122
138
|
var SECRET_FIELD_NAMES = [
|
|
@@ -146,6 +162,20 @@ function redactAgentRecordForWorkspaceTool(record) {
|
|
|
146
162
|
return redacted;
|
|
147
163
|
}
|
|
148
164
|
|
|
165
|
+
// packages/agent-runtime/agentRecordKeys.ts
|
|
166
|
+
function buildAgentRuntimeAgentLookupKeys(args) {
|
|
167
|
+
if (/^agent(-pub)?-/.test(args.agentRef)) {
|
|
168
|
+
return [args.agentRef];
|
|
169
|
+
}
|
|
170
|
+
return [
|
|
171
|
+
ownedAgentKey(args.userId, args.agentRef),
|
|
172
|
+
publicAgentKey(args.agentRef)
|
|
173
|
+
];
|
|
174
|
+
}
|
|
175
|
+
function shouldFetchAgentRuntimeRecordRemotely(dbKey) {
|
|
176
|
+
return /^agent(-pub)?-/.test(dbKey);
|
|
177
|
+
}
|
|
178
|
+
|
|
149
179
|
// packages/ai/agent/agentSelectionPriority.ts
|
|
150
180
|
function parseAgentTimestamp(value) {
|
|
151
181
|
if (typeof value === "number" && Number.isFinite(value)) return value;
|
|
@@ -181,21 +211,26 @@ function compareAgentSelection(left, right) {
|
|
|
181
211
|
const rightUpdated = parseAgentTimestamp(right.updatedAt ?? right.createdAt);
|
|
182
212
|
return rightUpdated - leftUpdated;
|
|
183
213
|
}
|
|
184
|
-
var AGENT_SELECTION_PRIORITY_INSTRUCTIONS = ` - \u4F18\u5148\u7EA7\u5951\u7EA6\
|
|
185
|
-
1. \
|
|
186
|
-
2. \
|
|
187
|
-
3. \
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
214
|
+
var AGENT_SELECTION_PRIORITY_INSTRUCTIONS = ` - \u4F18\u5148\u7EA7\u5951\u7EA6\uFF1A\u4E24\u9636\u6BB5\u53D1\u73B0\u4E0E\u9009\u4EBA\u5951\u7EA6\uFF08listAgents \u9ED8\u8BA4 scope="preferred"\uFF09\uFF1A
|
|
215
|
+
1. \u9996\u8F6E\u53D1\u73B0\uFF1A\u9ED8\u8BA4\u8C03\u7528 listAgents()\uFF08\u5373 scope="preferred"\uFF09\uFF0C\u4EC5\u53D1\u73B0\u7528\u6237\u5DF2\u6709\u5173\u7CFB\u7684 preferred Agent\uFF08\u6536\u85CF\u3001\u81EA\u6709\u3001OAuth \u8BA2\u9605\u3001\u81EA\u5B9A\u4E49 API\u3001\u672C\u5730 Agent\uFF09\u3002
|
|
216
|
+
2. \u6210\u672C\u5F52\u5C5E\u8BC6\u522B\uFF1A\u6839\u636E billingSource \u660E\u786E\u5224\u5B9A\uFF08user_subscription\uFF1A\u7528\u6237\u8BA2\u9605/OAuth\uFF1Buser_api\uFF1A\u7528\u6237\u81EA\u5B9A\u4E49 API\uFF1Blocal\uFF1A\u672C\u5730\u8FD0\u884C\uFF1Bplatform_credits\uFF1A\u5E73\u53F0\u79EF\u5206\uFF09\u3002
|
|
217
|
+
3. \u4F18\u5148\u7EA7\u6392\u5E8F\uFF08\u4E0E\u5217\u8868\u6392\u5E8F\u771F\u503C\u4E00\u81F4\uFF09\uFF1A
|
|
218
|
+
(1) \u6536\u85CF\u7684 OAuth / \u81EA\u5B9A\u4E49 Agent\uFF08billingSource="user_subscription" \u6216 "user_api"\uFF0CisFavorite=true\uFF1A\u79C1\u6709\u8BA2\u9605/\u51ED\u636E\u4F18\u5148\uFF09
|
|
219
|
+
(2) \u5176\u4ED6\u6536\u85CF Agent\uFF08isFavorite=true\uFF09
|
|
220
|
+
(3) \u672A\u6536\u85CF\u7684 OAuth / \u81EA\u5B9A\u4E49 Agent\uFF08billingSource="user_subscription" \u6216 "user_api"\uFF09
|
|
221
|
+
(4) \u5176\u4ED6\u81EA\u5EFA Agent\uFF08isOwned=true\uFF09
|
|
222
|
+
(5) \u516C\u5F00 / \u5E73\u53F0 Agent\uFF08billingSource="platform_credits" \u6216\u793E\u533A\u516C\u5F00\uFF09
|
|
223
|
+
\u540C\u6863\u4F4D\u4E0B\u6536\u85CF\u9879\u6309\u6700\u8FD1\u6536\u85CF\uFF08favoritedAt\uFF09\u4F18\u5148\uFF0C\u5176\u4F59\u6309\u6700\u8FD1\u66F4\u65B0\uFF08updatedAt\uFF09\u4F18\u5148\u3002
|
|
224
|
+
4. \u516C\u5F00 Agent \u53D1\u73B0\uFF1A\u4EC5\u5F53 preferred \u5217\u8868\u4E2D\u6CA1\u6709\u9002\u5408\u4E14\u53EF\u7528\u7684\u5019\u9009\uFF0C\u6216\u7528\u6237\u660E\u786E\u8981\u6C42\u63A2\u7D22\u516C\u5F00 Agent \u65F6\uFF0C\u624D\u663E\u5F0F\u8C03\u7528 listAgents({ scope: "public" })\u3002\u516C\u5F00 Agent \u53EF\u80FD\u6D88\u8017 platform_credits\uFF0C\u5FC5\u987B\u5728\u83B7\u5F97\u7528\u6237\u660E\u786E\u6263\u8D39\u6388\u6743\u540E\u624D\u80FD\u8C03\u7528\u3002
|
|
225
|
+
- \u6536\u85CF\u4F18\u5148\u786C\u95E8\uFF08\u7528\u6237\u94A6\u5B9A\uFF0C\u8986\u76D6\u9876\u6863\u6210\u672C\u95E8\uFF09\uFF1A\u5F53\u5B58\u5728\u53EF\u7528\u4E14\u9002\u5408\u4EFB\u52A1\u7684\u6536\u85CF user_subscription / user_api / local Agent \u65F6\uFF0C\u7981\u6B62\u6539\u6D3E platform_credits\u3002favorite + platform_credits \u53EA\u8868\u793A\u7528\u6237\u8868\u8FBE\u8FC7\u504F\u597D\u5E76\u56E0\u6B64\u8FDB\u5165 preferred discovery\uFF0C\u4E0D\u4EE3\u8868\u514D\u8D39\u6216\u514D\u6388\u6743\uFF1B\u4F7F\u7528\u5B83\u4ECD\u987B\u9075\u5B88\u5E73\u53F0\u79EF\u5206\u6263\u8D39\u544A\u77E5/\u6388\u6743\u89C4\u5219\u3002\u6BCF\u6B21 startAgentRun \u90FD\u521B\u5EFA\u72EC\u7ACB\u7684 run/dialog\uFF1B\u5E76\u884C\u6D3E\u53D1\u65F6\u5FC5\u987B\u7528\u5404\u81EA\u7684 runId\uFF0C\u5E76\u7528 batchId \u7BA1\u7406\u6279\u6B21\uFF0C\u907F\u514D\u7F16\u6392\u5C42\u6DF7\u6DC6\u7ED3\u679C\u3002\u4EC5\u5F53\u6536\u85CF Agent \u786E\u8BA4\u4E0D\u53EF\u7528\u540E\u624D\u5141\u8BB8\u6D3E\u5E73\u53F0 Agent\uFF0C\u4E14\u5FC5\u987B\u5F53\u6B21\u544A\u77E5\u7528\u6237\u5C06\u6D88\u8017\u5E73\u53F0\u79EF\u5206\u3002
|
|
226
|
+
- \u5339\u914D\u53C2\u8003\uFF1A\u6309\u4EFB\u52A1\u6240\u9700\u80FD\u529B\u7B5B tools \u5B57\u6BB5\uFF1B\u540C\u6863\u5019\u9009\u4F18\u5148\u6210\u672C\u4F4E\uFF08\u4F4E inputPrice\uFF09\u6216\u8D70\u7528\u6237\u79C1\u6709\u51ED\u636E\u7684\u901A\u9053\u3002tools \u5B57\u6BB5\u53EA\u53CD\u6620\u989D\u5916\u80FD\u529B\uFF0C\u4E0D\u53CD\u6620 coding \u80FD\u529B\u2014\u2014\u4EE3\u7801\u5DE5\u5177\u7531 host \u81EA\u52A8\u6CE8\u5165\uFF0Ctools=[] \u4E0D\u4EE3\u8868\u4E0D\u80FD\u5199\u4EE3\u7801\uFF0C\u4E0D\u8981\u636E\u6B64\u6392\u9664\u5019\u9009\u3002
|
|
227
|
+
- isOwned=true\u3001isOAuth=true \u6216 apiSource="custom" \u7684\u5019\u9009\u6309\u4F18\u5148\u7EA7\u5951\u7EA6\u5904\u7406\u3002
|
|
228
|
+
- qualityContext \u662F task-domain-specific supporting evidence\uFF1A\u53EA\u5728\u5339\u914D\u7684 task domain \u5185\u3001suitable candidates \u4E2D\uFF0C\u5E76\u4E14\u4ECD\u6392\u5728\u73B0\u6709\u4F18\u5148\u7EA7 / \u6210\u672C / \u53EF\u7528\u6027\u89C4\u5219\u4E4B\u540E\u53C2\u8003\u3002
|
|
229
|
+
\u6BCF\u884C\u5F62\u5982 \`dimension [direction] (benchmark version): model=score\`\u3002\u6BCF\u4E2A dimension\uFF08preference / rubric / slop / repetition / length / task_success \u7B49\uFF09\u90FD\u662F\u4E00\u6761\u72EC\u7ACB evidence\uFF0C\u4E0D\u662F\u603B\u5206\u7684\u4E00\u90E8\u5206\u3002
|
|
230
|
+
direction \u53EA\u662F\u6307\u6807\u65B9\u5411\uFF1Ahigher_better \u8D8A\u9AD8\u8D8A\u597D\uFF0Clower_better \u8D8A\u4F4E\u8D8A\u597D\uFF0Cneutral \u53EA\u63CF\u8FF0\u884C\u4E3A\u7279\u5F81\uFF08\u5982\u8F93\u51FA\u957F\u5EA6\uFF09\uFF0C\u4E0D\u4EE3\u8868\u4F18\u52A3\u3002
|
|
231
|
+
\u7981\u6B62\u628A\u4E0D\u540C dimension \u76F8\u52A0 / \u5E73\u5747 / \u5F52\u4E00\u5316\uFF0C\u6216\u751F\u6210 overall score / winner / rank\uFF1B\u7981\u6B62\u8DE8 benchmark identity \u6BD4\u8F83 raw score\uFF1B\u540C\u4E00 dimension \u5185\u53EA\u6BD4\u8F83\u540C\u4E00\u884C\u7684\u540C\u7C7B benchmark evidence\u3002
|
|
232
|
+
\u672A\u5217\u51FA\u7684 model \u6216 dimension \u8868\u793A\u6CA1\u6709 curated evidence\uFF1A\u4E0D\u662F 0\uFF0C\u4E5F\u4E0D\u662F\u8F83\u5F31\u3002\u54EA\u4E9B dimension \u66F4\u91CD\u8981\u7531\u5F53\u524D\u4EFB\u52A1\u51B3\u5B9A\uFF0C\u4E0D\u8981\u5199\u6B7B\u6743\u91CD\u3002
|
|
233
|
+
- 429 \u9650\u6D41\u4E0E\u77E5\u60C5\u6743\u5951\u7EA6\uFF1A\u4EFB\u4F55\u7528\u6237\u79C1\u6709\u51ED\u636E\u4E0E\u81EA\u5EFA Agent\uFF08billingSource \u4E3A user_subscription / user_api / local\uFF0C\u6216 isOwned=true\uFF09\u51FA\u73B0\u5728 listAgents \u7684 unavailableAgents\uFF08429 \u51B7\u5374\u671F\uFF09\u4E2D\u65F6\uFF0C\u7981\u6B62\u9759\u9ED8\u8DF3\u8FC7\uFF1B\u6539\u6D3E\u5E73\u53F0 Agent\uFF08\u6D88\u8017\u5E73\u53F0\u79EF\u5206\uFF09\u524D\u5FC5\u987B\u5728\u56DE\u590D\u4E2D\u544A\u77E5\u7528\u6237\uFF1A\u54EA\u4E2A\u8BA2\u9605/\u81EA\u5EFA agent \u9650\u6D41\u3001\u9884\u8BA1\u4F55\u65F6\u6062\u590D\uFF08nextAvailableAt\uFF09\u3001\u672C\u6B21\u5C06\u6263\u5E73\u53F0\u79EF\u5206\uFF1B\u4EFB\u52A1\u4E0D\u7D27\u6025\u5EFA\u8BAE\u7B49\u6062\u590D\u6216\u8BE2\u95EE\u7528\u6237\u3002`;
|
|
199
234
|
|
|
200
235
|
// packages/agent-runtime/noloWorkspaceTools.ts
|
|
201
236
|
var NOLO_WORKSPACE_TOOL_NAMES = [
|
|
@@ -278,10 +313,12 @@ function buildNoloWorkspaceOpenAiTools(args) {
|
|
|
278
313
|
description: "Confirmed dialog ids or dbKeys to delete."
|
|
279
314
|
}
|
|
280
315
|
}, ["query"]);
|
|
281
|
-
add("listAgents", "List the
|
|
282
|
-
|
|
283
|
-
publicOnly: { type: "boolean", description: "
|
|
284
|
-
showUnavailable: { type: "boolean", description: "Include agents currently rate-limited (429). Default false." }
|
|
316
|
+
add("listAgents", "List agents for delegation. Default scope='preferred' returns the user's favorites, owned, OAuth, custom API, and local agents only; scope='public' discovers shared/marketplace agents; scope='all' returns their deduplicated union. Public agents may consume platform credits. Copy the agentKey verbatim; use the runnable agentKey exactly and do not infer it from the display name. publicOnly is deprecated compatibility for scope='public'. Rate-limited agents are hidden unless showUnavailable is true.", {
|
|
317
|
+
scope: { type: "string", enum: ["preferred", "public", "all"], description: "Discovery scope; preferred is the default and does not load the public marketplace." },
|
|
318
|
+
publicOnly: { type: "boolean", description: "Deprecated compatibility alias for scope='public'." },
|
|
319
|
+
showUnavailable: { type: "boolean", description: "Include agents currently rate-limited (429). Default false." },
|
|
320
|
+
verbose: { type: "boolean", description: "Return full safe-summary details when supported." },
|
|
321
|
+
space: stringToolParam("Optional space id or URL.")
|
|
285
322
|
});
|
|
286
323
|
add("readAgent", "Read one agent's full config by exact agentKey returned by listAgents (agent-<userId>-<id> or agent-pub-<id>); do not use the display name.", {
|
|
287
324
|
agent: stringToolParam("Exact agentKey from listAgents (preferred; copy verbatim; plain id or URL are compatibility fallbacks).")
|
|
@@ -605,7 +642,11 @@ function buildNoloWorkspaceCommandArgs(call) {
|
|
|
605
642
|
const cliArgs = ["agent", "list"];
|
|
606
643
|
const space = noloStringArg(args.space);
|
|
607
644
|
if (space) cliArgs.push("--space", space);
|
|
645
|
+
const scope = noloStringArg(args.scope);
|
|
646
|
+
if (scope) cliArgs.push("--scope", scope);
|
|
608
647
|
if (args.publicOnly === true) cliArgs.push("--public-only");
|
|
648
|
+
if (args.showUnavailable === true) cliArgs.push("--show-unavailable");
|
|
649
|
+
if (args.verbose === true) cliArgs.push("--verbose");
|
|
609
650
|
cliArgs.push("--json", "--safe");
|
|
610
651
|
return cliArgs;
|
|
611
652
|
}
|
|
@@ -671,12 +712,13 @@ function buildNoloWorkspaceCommandArgs(call) {
|
|
|
671
712
|
}
|
|
672
713
|
|
|
673
714
|
export {
|
|
715
|
+
applyToolSurfaceConstraints,
|
|
716
|
+
resolveRuntimeToolSurfaceForAgent,
|
|
717
|
+
redactAgentRecordForWorkspaceTool,
|
|
674
718
|
compareAgentSelection,
|
|
675
719
|
AGENT_SELECTION_PRIORITY_INSTRUCTIONS,
|
|
676
720
|
buildAgentRuntimeAgentLookupKeys,
|
|
677
721
|
shouldFetchAgentRuntimeRecordRemotely,
|
|
678
|
-
resolveRuntimeToolSurfaceForAgent,
|
|
679
|
-
redactAgentRecordForWorkspaceTool,
|
|
680
722
|
NOLO_WORKSPACE_TOOL_NAMES,
|
|
681
723
|
buildNoloWorkspaceOpenAiTools,
|
|
682
724
|
noloPositiveIntegerString,
|
|
@@ -1,72 +1,17 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createSpaceKey
|
|
3
|
+
} from "./chunk-UAD2WT54.js";
|
|
1
4
|
import {
|
|
2
5
|
patch,
|
|
3
6
|
read
|
|
4
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-DNNSCSA2.js";
|
|
5
8
|
import {
|
|
6
9
|
DEVICE_LOCAL_OWNER_ID,
|
|
7
|
-
isDeviceLocalSpaceBody
|
|
10
|
+
isDeviceLocalSpaceBody
|
|
11
|
+
} from "./chunk-KWSQR2KK.js";
|
|
12
|
+
import {
|
|
8
13
|
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
|
-
};
|
|
14
|
+
} from "./chunk-SEJ5OS6F.js";
|
|
70
15
|
|
|
71
16
|
// packages/create/space/utils/permissions.ts
|
|
72
17
|
var checkSpaceMembership = (spaceData, userId) => {
|
|
@@ -163,8 +108,6 @@ var addContentAction = async (input, thunkAPI) => {
|
|
|
163
108
|
};
|
|
164
109
|
|
|
165
110
|
export {
|
|
166
|
-
normalizeSpaceId,
|
|
167
|
-
createSpaceKey,
|
|
168
111
|
checkSpaceMembership,
|
|
169
112
|
localSpaceAuthorityPatchStamp,
|
|
170
113
|
UNCATEGORIZED_ID,
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
|
|
5
5
|
// packages/cli/agentCommandSupport.ts
|
|
6
6
|
async function getDefaultCliDb() {
|
|
7
|
-
const { getDefaultCliLocalRuntimeDb } = await import("./localRuntimeDb-
|
|
7
|
+
const { getDefaultCliLocalRuntimeDb } = await import("./localRuntimeDb-P37ZTX55.js");
|
|
8
8
|
return getDefaultCliLocalRuntimeDb();
|
|
9
9
|
}
|
|
10
10
|
function createNullCliDb() {
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
// packages/identity/sessionSource.ts
|
|
2
|
+
var IDENTITY_SESSION_READER = Symbol.for(
|
|
3
|
+
"nolo.identity.sessionReader"
|
|
4
|
+
);
|
|
5
|
+
var moduleFallbackReader = null;
|
|
6
|
+
function getBoundSessionSnapshot() {
|
|
7
|
+
return moduleFallbackReader?.() ?? null;
|
|
8
|
+
}
|
|
9
|
+
function getSessionSnapshotForState(state) {
|
|
10
|
+
const reader = state?.[IDENTITY_SESSION_READER];
|
|
11
|
+
if (typeof reader === "function") {
|
|
12
|
+
return reader();
|
|
13
|
+
}
|
|
14
|
+
return getBoundSessionSnapshot();
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
// packages/identity/selectors.local.ts
|
|
18
|
+
var LOCAL_USER_ID = (typeof process !== "undefined" ? process.env?.NOLO_LOCAL_USER_ID : void 0) || (typeof process !== "undefined" ? process.env?.NOLO_USER_ID : void 0) || "local";
|
|
19
|
+
var LOCAL_USER = {
|
|
20
|
+
userId: LOCAL_USER_ID,
|
|
21
|
+
username: "Local User"
|
|
22
|
+
};
|
|
23
|
+
var selectIdentityUserId = (state) => {
|
|
24
|
+
const snapshot = getSessionSnapshotForState(state);
|
|
25
|
+
if (snapshot) return snapshot.activeAccountId ?? void 0;
|
|
26
|
+
return LOCAL_USER_ID;
|
|
27
|
+
};
|
|
28
|
+
var selectIdentityToken = (state) => {
|
|
29
|
+
return getSessionSnapshotForState(state)?.activeToken ?? void 0;
|
|
30
|
+
};
|
|
31
|
+
var selectIdentityUser = (state) => {
|
|
32
|
+
const snapshot = getSessionSnapshotForState(state);
|
|
33
|
+
if (snapshot) {
|
|
34
|
+
const active = snapshot.accounts.find(
|
|
35
|
+
(account) => account.userId === snapshot.activeAccountId
|
|
36
|
+
);
|
|
37
|
+
return active ?? null;
|
|
38
|
+
}
|
|
39
|
+
return LOCAL_USER;
|
|
40
|
+
};
|
|
41
|
+
var selectIdentityUserBalance = (state) => void 0;
|
|
42
|
+
|
|
43
|
+
export {
|
|
44
|
+
getSessionSnapshotForState,
|
|
45
|
+
selectIdentityUserId,
|
|
46
|
+
selectIdentityToken,
|
|
47
|
+
selectIdentityUser,
|
|
48
|
+
selectIdentityUserBalance
|
|
49
|
+
};
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getRuntimeServerContext,
|
|
3
3
|
scheduleDeleteReplication
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-KWSQR2KK.js";
|
|
5
5
|
import {
|
|
6
6
|
fetchFromClientDb
|
|
7
7
|
} from "./chunk-QOKAKDPE.js";
|
|
8
|
+
import {
|
|
9
|
+
selectIdentityToken
|
|
10
|
+
} from "./chunk-SEJ5OS6F.js";
|
|
8
11
|
import {
|
|
9
12
|
buildTombstoneRecord
|
|
10
13
|
} from "./chunk-GBRG75BQ.js";
|
|
@@ -191,7 +194,7 @@ var removeAction = async (payload, thunkApi) => {
|
|
|
191
194
|
preferredServerOrigin,
|
|
192
195
|
currentServer,
|
|
193
196
|
syncServers,
|
|
194
|
-
hasToken: Boolean(state
|
|
197
|
+
hasToken: Boolean(selectIdentityToken(state))
|
|
195
198
|
});
|
|
196
199
|
const localData = await fetchFromClientDb(clientDb, dbKey);
|
|
197
200
|
const hadLocalData = Boolean(localData);
|
|
@@ -10,8 +10,6 @@ import {
|
|
|
10
10
|
var CURRENT_OPERATOR_USER_ID = "0e95801d90";
|
|
11
11
|
var NOLO_DEFAULT_AGENT_ID = "01NOLOAPPBLD000000019KCKT0";
|
|
12
12
|
var NOLO_DEFAULT_AGENT_KEY = publicAgentKey(NOLO_DEFAULT_AGENT_ID);
|
|
13
|
-
var NOLO_PROJECT_MANAGER_AGENT_ID = "01NOLOPROJMGR00000000MSVGG";
|
|
14
|
-
var NOLO_PROJECT_MANAGER_AGENT_KEY = ownedAgentKey(CURRENT_OPERATOR_USER_ID, NOLO_PROJECT_MANAGER_AGENT_ID);
|
|
15
13
|
var NOLO_FRONTEND_AGENT_ID = "01FRONTENDAG0000000115N4E1";
|
|
16
14
|
var NOLO_FRONTEND_AGENT_KEY = ownedAgentKey(CURRENT_OPERATOR_USER_ID, NOLO_FRONTEND_AGENT_ID);
|
|
17
15
|
var LOCAL_CODEX_AGENT_ID = "01LOCALCODEXCLI000000NEW";
|
|
@@ -27,8 +25,6 @@ var AGENT_ALIAS_TO_KEY = {
|
|
|
27
25
|
"frontend agent": NOLO_FRONTEND_AGENT_KEY,
|
|
28
26
|
"\u524D\u7AEFagent": NOLO_FRONTEND_AGENT_KEY,
|
|
29
27
|
"\u524D\u7AEF agent": NOLO_FRONTEND_AGENT_KEY,
|
|
30
|
-
"project-manager": NOLO_PROJECT_MANAGER_AGENT_KEY,
|
|
31
|
-
pm: NOLO_PROJECT_MANAGER_AGENT_KEY,
|
|
32
28
|
// Explicit local CLI agents. These are ordinary private agent records that
|
|
33
29
|
// run through the current computer local runtime when unbound.
|
|
34
30
|
"local-codex": LOCAL_CODEX_AGENT_KEY,
|
|
@@ -55,7 +51,6 @@ function isLocalCliAgentKey(agentKey) {
|
|
|
55
51
|
export {
|
|
56
52
|
NOLO_DEFAULT_AGENT_ID,
|
|
57
53
|
NOLO_DEFAULT_AGENT_KEY,
|
|
58
|
-
NOLO_PROJECT_MANAGER_AGENT_KEY,
|
|
59
54
|
LOCAL_CODEX_AGENT_ID,
|
|
60
55
|
LOCAL_CODEX_AGENT_KEY,
|
|
61
56
|
resolveCliAgentKeyInput,
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
resolveNoloHome
|
|
3
|
-
} from "./chunk-GLKOYSRU.js";
|
|
4
|
-
|
|
5
1
|
// packages/database-engine/cliAuthorityBrokerClient.ts
|
|
6
2
|
import { createConnection } from "node:net";
|
|
7
3
|
var DEFAULT_ITERATOR_PAGE_SIZE = 200;
|
|
@@ -18,6 +14,20 @@ var CliAuthorityBrokerUnavailableError = class extends Error {
|
|
|
18
14
|
}
|
|
19
15
|
}
|
|
20
16
|
};
|
|
17
|
+
var CliAuthorityBrokerTimeoutError = class extends Error {
|
|
18
|
+
reason = "cli_authority_broker_timeout";
|
|
19
|
+
endpoint;
|
|
20
|
+
timeoutMs;
|
|
21
|
+
constructor(endpoint, timeoutMs, cause) {
|
|
22
|
+
super(`CLI authority broker request at ${endpoint} timed out after ${timeoutMs}ms`);
|
|
23
|
+
this.name = "CliAuthorityBrokerTimeoutError";
|
|
24
|
+
this.endpoint = endpoint;
|
|
25
|
+
this.timeoutMs = timeoutMs;
|
|
26
|
+
if (cause !== void 0) {
|
|
27
|
+
this.cause = cause;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
};
|
|
21
31
|
var CliAuthorityBrokerProtocolError = class extends Error {
|
|
22
32
|
code;
|
|
23
33
|
retryable;
|
|
@@ -31,8 +41,30 @@ var CliAuthorityBrokerProtocolError = class extends Error {
|
|
|
31
41
|
function isCliAuthorityBrokerUnavailableError(error) {
|
|
32
42
|
return error instanceof CliAuthorityBrokerUnavailableError || typeof error === "object" && error !== null && error.reason === "cli_authority_broker_unavailable" && error.status === 503;
|
|
33
43
|
}
|
|
44
|
+
function isCliAuthorityBrokerTimeoutError(error) {
|
|
45
|
+
return error instanceof CliAuthorityBrokerTimeoutError || typeof error === "object" && error !== null && error.reason === "cli_authority_broker_timeout";
|
|
46
|
+
}
|
|
34
47
|
function isCliAuthorityBrokerProtocolError(error) {
|
|
35
|
-
return error instanceof CliAuthorityBrokerProtocolError;
|
|
48
|
+
return error instanceof CliAuthorityBrokerProtocolError || typeof error === "object" && error !== null && error.name === "CliAuthorityBrokerProtocolError";
|
|
49
|
+
}
|
|
50
|
+
function isBrokerUnavailableCause(error) {
|
|
51
|
+
if (!error) return false;
|
|
52
|
+
if (isCliAuthorityBrokerTimeoutError(error) || isCliAuthorityBrokerProtocolError(error)) {
|
|
53
|
+
return false;
|
|
54
|
+
}
|
|
55
|
+
if (isCliAuthorityBrokerUnavailableError(error)) {
|
|
56
|
+
return true;
|
|
57
|
+
}
|
|
58
|
+
if (typeof error === "object") {
|
|
59
|
+
const code = error.code;
|
|
60
|
+
if (typeof code === "string" && /^(ECONNREFUSED|ENOENT|ECONNRESET|EPIPE|EADDRNOTAVAIL|ENETUNREACH|EHOSTUNREACH)$/i.test(code)) {
|
|
61
|
+
return true;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
65
|
+
if (/timed out/i.test(message)) return false;
|
|
66
|
+
if (/malformed response|protocol mismatch/i.test(message)) return false;
|
|
67
|
+
return /ECONNREFUSED|ENOENT|ECONNRESET|EPIPE|closed connection without response|returned no response/i.test(message);
|
|
36
68
|
}
|
|
37
69
|
function resolveBrokerSocketTarget(endpoint) {
|
|
38
70
|
if (endpoint.startsWith("unix://")) {
|
|
@@ -50,6 +82,7 @@ function resolveBrokerSocketTarget(endpoint) {
|
|
|
50
82
|
}
|
|
51
83
|
function createCliAuthorityBrokerSocketInvoker(options) {
|
|
52
84
|
const target = resolveBrokerSocketTarget(options.endpoint);
|
|
85
|
+
const timeoutMs = options.timeoutMs ?? 5e3;
|
|
53
86
|
return async (request) => {
|
|
54
87
|
return await new Promise((resolve, reject) => {
|
|
55
88
|
const socket = target.kind === "unix" ? createConnection(target.path) : createConnection({ host: target.host, port: target.port });
|
|
@@ -58,9 +91,9 @@ function createCliAuthorityBrokerSocketInvoker(options) {
|
|
|
58
91
|
const timeout = setTimeout(() => {
|
|
59
92
|
finish(() => {
|
|
60
93
|
socket.destroy();
|
|
61
|
-
reject(new
|
|
94
|
+
reject(new CliAuthorityBrokerTimeoutError(options.endpoint, timeoutMs));
|
|
62
95
|
});
|
|
63
|
-
},
|
|
96
|
+
}, timeoutMs);
|
|
64
97
|
const finish = (fn) => {
|
|
65
98
|
if (settled) return;
|
|
66
99
|
settled = true;
|
|
@@ -79,18 +112,34 @@ function createCliAuthorityBrokerSocketInvoker(options) {
|
|
|
79
112
|
finish(() => {
|
|
80
113
|
const payload = responseBuffer.trim();
|
|
81
114
|
if (!payload) {
|
|
82
|
-
reject(
|
|
115
|
+
reject(
|
|
116
|
+
new CliAuthorityBrokerUnavailableError(
|
|
117
|
+
options.endpoint,
|
|
118
|
+
new Error(`CLI authority broker at ${options.endpoint} closed connection without response`)
|
|
119
|
+
)
|
|
120
|
+
);
|
|
83
121
|
return;
|
|
84
122
|
}
|
|
85
123
|
try {
|
|
86
124
|
resolve(JSON.parse(payload));
|
|
87
|
-
} catch (
|
|
88
|
-
reject(
|
|
125
|
+
} catch (parseError) {
|
|
126
|
+
reject(
|
|
127
|
+
new CliAuthorityBrokerProtocolError({
|
|
128
|
+
code: "MALFORMED_RESPONSE",
|
|
129
|
+
message: `CLI authority broker at ${options.endpoint} returned malformed response: ${parseError instanceof Error ? parseError.message : String(parseError)}`
|
|
130
|
+
})
|
|
131
|
+
);
|
|
89
132
|
}
|
|
90
133
|
});
|
|
91
134
|
});
|
|
92
135
|
socket.on("error", (error) => {
|
|
93
|
-
finish(() =>
|
|
136
|
+
finish(() => {
|
|
137
|
+
if (isBrokerUnavailableCause(error)) {
|
|
138
|
+
reject(new CliAuthorityBrokerUnavailableError(options.endpoint, error));
|
|
139
|
+
} else {
|
|
140
|
+
reject(error);
|
|
141
|
+
}
|
|
142
|
+
});
|
|
94
143
|
});
|
|
95
144
|
});
|
|
96
145
|
};
|
|
@@ -98,15 +147,39 @@ function createCliAuthorityBrokerSocketInvoker(options) {
|
|
|
98
147
|
async function invokeBrokerRequest(options, request) {
|
|
99
148
|
try {
|
|
100
149
|
const response = await options.invoke(request);
|
|
101
|
-
if (response.ok)
|
|
150
|
+
if (!response || typeof response !== "object" || typeof response.ok !== "boolean") {
|
|
151
|
+
throw new CliAuthorityBrokerProtocolError({
|
|
152
|
+
code: "MALFORMED_RESPONSE",
|
|
153
|
+
message: `CLI authority broker protocol mismatch at ${options.endpoint}`
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
if (response.ok) {
|
|
157
|
+
if (!response.result || typeof response.result !== "object") {
|
|
158
|
+
throw new CliAuthorityBrokerProtocolError({
|
|
159
|
+
code: "MALFORMED_RESPONSE",
|
|
160
|
+
message: `CLI authority broker protocol mismatch at ${options.endpoint}`
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
return response.result;
|
|
164
|
+
}
|
|
165
|
+
if (!response.error || typeof response.error !== "object" || typeof response.error.code !== "string" || typeof response.error.message !== "string") {
|
|
166
|
+
throw new CliAuthorityBrokerProtocolError({
|
|
167
|
+
code: "MALFORMED_RESPONSE",
|
|
168
|
+
message: `CLI authority broker protocol mismatch at ${options.endpoint}`
|
|
169
|
+
});
|
|
170
|
+
}
|
|
102
171
|
if (response.error.code === "BROKER_UNAVAILABLE") {
|
|
103
172
|
throw new CliAuthorityBrokerUnavailableError(options.endpoint, response.error);
|
|
104
173
|
}
|
|
105
174
|
throw new CliAuthorityBrokerProtocolError(response.error);
|
|
106
175
|
} catch (error) {
|
|
176
|
+
if (isCliAuthorityBrokerTimeoutError(error)) throw error;
|
|
107
177
|
if (isCliAuthorityBrokerUnavailableError(error)) throw error;
|
|
108
178
|
if (isCliAuthorityBrokerProtocolError(error)) throw error;
|
|
109
|
-
|
|
179
|
+
if (isBrokerUnavailableCause(error)) {
|
|
180
|
+
throw new CliAuthorityBrokerUnavailableError(options.endpoint, error);
|
|
181
|
+
}
|
|
182
|
+
throw error;
|
|
110
183
|
}
|
|
111
184
|
}
|
|
112
185
|
function createCliAuthorityBrokerClient(options) {
|
|
@@ -179,68 +252,10 @@ function createCliAuthorityBrokerClient(options) {
|
|
|
179
252
|
};
|
|
180
253
|
}
|
|
181
254
|
|
|
182
|
-
// packages/database-engine/cliAuthorityStoreDriver.ts
|
|
183
|
-
import path from "node:path";
|
|
184
|
-
function readCliAuthorityDriver(env) {
|
|
185
|
-
const value = env.NOLO_CLI_AUTHORITY_DRIVER?.trim();
|
|
186
|
-
if (value === "broker") {
|
|
187
|
-
return { driver: "broker", invalidDriver: null };
|
|
188
|
-
}
|
|
189
|
-
return {
|
|
190
|
-
driver: "broker",
|
|
191
|
-
invalidDriver: value ? value : null
|
|
192
|
-
};
|
|
193
|
-
}
|
|
194
|
-
function resolveCliAuthorityRunDir(options = {}) {
|
|
195
|
-
return path.join(resolveNoloHome({
|
|
196
|
-
...options,
|
|
197
|
-
env: options.env ?? process.env
|
|
198
|
-
}), "run");
|
|
199
|
-
}
|
|
200
|
-
function hashString(value) {
|
|
201
|
-
let hash = 0;
|
|
202
|
-
for (let index = 0; index < value.length; index += 1) {
|
|
203
|
-
hash = (hash << 5) - hash + value.charCodeAt(index) | 0;
|
|
204
|
-
}
|
|
205
|
-
return Math.abs(hash);
|
|
206
|
-
}
|
|
207
|
-
function resolveCliAuthorityBrokerPort(options = {}) {
|
|
208
|
-
const envPort = options.env?.NOLO_CLI_AUTHORITY_BROKER_PORT?.trim();
|
|
209
|
-
if (envPort) {
|
|
210
|
-
const port = Number(envPort);
|
|
211
|
-
if (Number.isInteger(port) && port > 0 && port < 65536) return port;
|
|
212
|
-
}
|
|
213
|
-
const noloHome = resolveNoloHome({
|
|
214
|
-
...options,
|
|
215
|
-
env: options.env ?? {}
|
|
216
|
-
});
|
|
217
|
-
return 47e3 + hashString(noloHome) % 2e3;
|
|
218
|
-
}
|
|
219
|
-
function resolveCliAuthorityStoreDriver(options = {}) {
|
|
220
|
-
return readCliAuthorityDriver(options.env ?? {}).driver;
|
|
221
|
-
}
|
|
222
|
-
function resolveCliAuthorityBrokerSocketPath(options) {
|
|
223
|
-
return path.join(resolveCliAuthorityRunDir(options), "authority-store-broker.sock");
|
|
224
|
-
}
|
|
225
|
-
function resolveCliAuthorityBrokerEndpoint(options) {
|
|
226
|
-
if (options.transport === "tcp") {
|
|
227
|
-
return `tcp://127.0.0.1:${resolveCliAuthorityBrokerPort(options)}`;
|
|
228
|
-
}
|
|
229
|
-
return `unix://${resolveCliAuthorityBrokerSocketPath(options)}`;
|
|
230
|
-
}
|
|
231
|
-
function resolveCliAuthorityBrokerMetadataPath(options) {
|
|
232
|
-
return path.join(resolveCliAuthorityRunDir(options), "authority-store-broker.json");
|
|
233
|
-
}
|
|
234
|
-
function resolveCliAuthorityBrokerHealthPath(options) {
|
|
235
|
-
return path.join(resolveCliAuthorityRunDir(options), "authority-store-broker.health.json");
|
|
236
|
-
}
|
|
237
|
-
|
|
238
255
|
export {
|
|
239
256
|
isCliAuthorityBrokerUnavailableError,
|
|
257
|
+
isCliAuthorityBrokerTimeoutError,
|
|
258
|
+
isCliAuthorityBrokerProtocolError,
|
|
240
259
|
createCliAuthorityBrokerSocketInvoker,
|
|
241
|
-
createCliAuthorityBrokerClient
|
|
242
|
-
resolveCliAuthorityStoreDriver,
|
|
243
|
-
resolveCliAuthorityBrokerEndpoint,
|
|
244
|
-
resolveCliAuthorityBrokerMetadataPath,
|
|
245
|
-
resolveCliAuthorityBrokerHealthPath
|
|
260
|
+
createCliAuthorityBrokerClient
|
|
246
261
|
};
|