nolo-cli 0.211.0 → 0.212.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-VVQEOY3D.js → _executeModel-KE6MBNUJ.js} +51 -48
- package/{action-U235TV4P.js → action-DF5UYSJF.js} +4 -4
- package/{addContentAction-7C76J7ST.js → addContentAction-N2YC5IL3.js} +8 -8
- package/{addDialogAgentAction-KTYANUEC.js → addDialogAgentAction-3NKVQCEC.js} +15 -12
- package/{agentDeleteCommand-WHRU6VDJ.js → agentDeleteCommand-NWK7VU4N.js} +71 -67
- package/{agentEmailCommands-ALLHXPW3.js → agentEmailCommands-UZ4DHEX2.js} +77 -72
- package/{agentListCommands-POKMEKMS.js → agentListCommands-HE7L2A6L.js} +190 -77
- package/{agentMachineCommands-WJLZLBPI.js → agentMachineCommands-6TE4MBMP.js} +30 -29
- package/{agentProviderCommands-MN3ABDME.js → agentProviderCommands-Q5O33MED.js} +33 -4
- package/{agentRecordCommands-OULZW3KM.js → agentRecordCommands-L3QQ7HZ4.js} +66 -61
- package/{agentRunCommand-ZNG4LGNQ.js → agentRunCommand-2IFGQHCO.js} +68 -64
- package/{agentRunControl-AF7BMR22.js → agentRunControl-OI3LOENH.js} +7 -6
- package/{agentRuntimeLocal-YMUHFV5M.js → agentRuntimeLocal-HL526DNQ.js} +28 -25
- package/{agentSlice-WNGUIMQZ.js → agentSlice-TMYP2UEA.js} +12 -12
- package/{appDeleteCommands-6MXPLAVF.js → appDeleteCommands-ZERW4AXY.js} +30 -29
- package/{appDeployCommands-ERRSVASW.js → appDeployCommands-DUWSMYHL.js} +30 -29
- package/{appDeployStatusCommands-ULICISLI.js → appDeployStatusCommands-N2KIE4BF.js} +30 -29
- package/{appGetCommands-WYYYWROF.js → appGetCommands-YVR4NPVY.js} +30 -29
- package/{appListCommands-DFCUCRCV.js → appListCommands-JS6HOHZS.js} +30 -29
- package/{authCommand-ZJMWXFMA.js → authCommand-FE2C3ZUM.js} +14 -14
- package/{authCommands-WK6E42L2.js → authCommands-HV3EAU3V.js} +2 -2
- package/{builtinSkillRegistry-HH75G5J3.js → builtinSkillRegistry-3YOIGEF6.js} +5 -4
- package/{chunk-JKW6LERJ.js → chunk-22CIEBYO.js} +14 -14
- package/{chunk-6HVBI6TI.js → chunk-25JZEIXN.js} +1 -218
- package/{chunk-TRZP7JZ7.js → chunk-2QHFH3DR.js} +1 -0
- package/{chunk-4LEGTOSR.js → chunk-3AKFVZ2I.js} +1 -1
- package/{chunk-XE4Q46FF.js → chunk-3CGG2PAL.js} +1 -1
- package/{chunk-25M2K6OA.js → chunk-3FOQHGHN.js} +3 -3
- package/{chunk-BSISWVB4.js → chunk-4I7ERB7F.js} +1 -1
- package/{chunk-TCTSYFDM.js → chunk-4KH4J3G5.js} +19 -6
- package/{chunk-NEZGPBL7.js → chunk-5AQR3DGV.js} +2 -2
- package/{chunk-YLTLB5A7.js → chunk-5RYBGBQH.js} +7 -6
- package/{chunk-RIALQUSF.js → chunk-6NSSLV67.js} +5 -5
- package/{chunk-RXCCWVA2.js → chunk-6OQUPIQF.js} +3 -3
- package/chunk-6VLJ6YA7.js +11751 -0
- package/{chunk-27E2CBBY.js → chunk-7OCO4TDT.js} +1 -1
- package/chunk-7RFNTILS.js +2213 -0
- package/{chunk-4WCEC56C.js → chunk-AVTVGMDY.js} +1 -1
- package/{chunk-3J3U3KXB.js → chunk-B7NJ3T4A.js} +4 -4
- package/{chunk-UMEGDH6A.js → chunk-BFM34N54.js} +7 -7
- package/chunk-CJEIOP3E.js +0 -0
- package/{chunk-YXOBCDNW.js → chunk-CJRONOYL.js} +5 -5
- package/{chunk-LT3EAHJY.js → chunk-CQ46IRNN.js} +38 -36
- package/{chunk-NTSRCTUX.js → chunk-CTPXME7U.js} +2 -2
- package/{chunk-M4NTDZG3.js → chunk-D5RCRX4A.js} +134 -141
- package/{chunk-25OB36GU.js → chunk-DM6UMOEL.js} +4 -4
- package/{chunk-TPCDYNJK.js → chunk-EYUBHHFB.js} +1 -1
- package/{chunk-Y6M7KJOA.js → chunk-EZFQ6XRV.js} +2 -2
- package/{chunk-ZOO3WJIE.js → chunk-FHU44LN3.js} +711 -40
- package/chunk-FY7F4Q6X.js +127 -0
- package/chunk-G7MLNNEX.js +84 -0
- package/{chunk-RYWO5AKN.js → chunk-GNDJKC4B.js} +10 -10
- package/{chunk-V3M6IXQI.js → chunk-GPO7FCEZ.js} +187 -36
- package/{chunk-RQ22OZD7.js → chunk-H2TJUNCH.js} +1 -1
- package/{chunk-C2XZM3K4.js → chunk-HIRC32DV.js} +5 -24
- package/{chunk-QQM464AL.js → chunk-HPFCI4SK.js} +3 -3
- package/chunk-HRMJUN5J.js +26 -0
- package/{chunk-HD3WR3TD.js → chunk-IAPCBNEE.js} +1 -1
- package/{chunk-XDMGY5IU.js → chunk-IF45XG7K.js} +220 -9
- package/{chunk-NLT32XBZ.js → chunk-IIQ6JGRI.js} +2 -2
- package/{chunk-OP7PTBAJ.js → chunk-IJXYFTV7.js} +8 -8
- package/{chunk-IIHY4ZAI.js → chunk-INSBKSBB.js} +8 -4
- package/{chunk-PAFTGNWA.js → chunk-JIT6FSXJ.js} +1 -1
- package/{chunk-WTKYP6QO.js → chunk-JTDORD5P.js} +5 -5
- package/{chunk-ECX3NKRD.js → chunk-JY5NGFFH.js} +11 -0
- package/chunk-KC4XDTT3.js +227 -0
- package/{chunk-PLYWH7XM.js → chunk-KIM6CLW5.js} +7 -7
- package/{chunk-SCYQJPGA.js → chunk-M6RL5JCD.js} +147 -20
- package/chunk-MMA3LZ3W.js +105 -0
- package/{chunk-I5PBXF7O.js → chunk-MMNYUVLW.js} +1 -1
- package/{chunk-NHQKWPLP.js → chunk-NJR3WKVP.js} +24 -22
- package/{chunk-W5VC7F7V.js → chunk-NOMIGOST.js} +59 -60
- package/{chunk-WI6OGHXJ.js → chunk-NRFKLKRU.js} +5 -5
- package/{chunk-NXCGNS4N.js → chunk-OHNELDTO.js} +1 -1
- package/{chunk-7IYBN7IA.js → chunk-OOF4UPC5.js} +22 -13
- package/{chunk-UIOEHFF6.js → chunk-OQHIVPG4.js} +1 -0
- package/{chunk-X4F26D5K.js → chunk-P5L7CXOC.js} +58 -33
- package/{chunk-5ORJGHTL.js → chunk-PDGKOTO7.js} +5 -5
- package/{chunk-UCPAVEQB.js → chunk-PYRUW7XN.js} +1 -1
- package/{chunk-SU3QL7YG.js → chunk-QT6PKHYJ.js} +1 -1
- package/{chunk-SN5XE6GQ.js → chunk-RPQXPZZF.js} +4 -4
- package/{chunk-ZN5AH4BY.js → chunk-RU4SD66C.js} +6 -6
- package/{chunk-YKFP6UGT.js → chunk-SOHTHFV2.js} +14 -14
- package/{chunk-CKOO42G5.js → chunk-UHJGXRJ4.js} +4 -4
- package/{chunk-CVCRAO6Q.js → chunk-UTV2AYEG.js} +9 -7
- package/{chunk-DQLB4NQ3.js → chunk-VPAZOH2D.js} +2 -2
- package/{chunk-MBS6CTZB.js → chunk-VZKUKCA6.js} +236 -1993
- package/{chunk-LNYHAKBP.js → chunk-W4S457LU.js} +1 -1
- package/chunk-WPORQFYN.js +74 -0
- package/{chunk-ET2CWLIJ.js → chunk-WXYLV624.js} +3 -3
- package/chunk-XFYFMTOM.js +92 -0
- package/{chunk-NV572QM3.js → chunk-YJMRHHGY.js} +15 -15
- package/{chunk-JBOUVTZX.js → chunk-YOIW77S2.js} +13 -2
- package/{chunk-ADBWFYJD.js → chunk-YPD3VJZW.js} +9 -9
- package/{chunk-DA7CTWT4.js → chunk-YWSEPJ7C.js} +5 -5
- package/{chunk-3V2QMRNN.js → chunk-ZL5RAEEB.js} +3 -3
- package/cliAgentConfigHelpers-WJBZQTLW.js +41 -0
- package/{commandRegistry-FI2IOQ3U.js → commandRegistry-VVMTPFAX.js} +85 -81
- package/{contentThunks-5LKNNDGY.js → contentThunks-N52O67MI.js} +25 -24
- package/{createAgentAutomationAction-TI4QG4CY.js → createAgentAutomationAction-ZC57YRSV.js} +25 -24
- package/{createDialogAction-TJ3JKLO4.js → createDialogAction-VQW5WDYX.js} +27 -26
- package/{createPageAction-GKXT6WEH.js → createPageAction-M5VDA7SC.js} +26 -25
- package/{dbSlice-LPMZ2DGJ.js → dbSlice-HP7G4LX3.js} +7 -7
- package/{deleteFile-EPUQHKPA.js → deleteFile-7VQGLK2V.js} +3 -3
- package/{dialogCommands-IWPXIZ5P.js → dialogCommands-JHMR2N2Y.js} +32 -30
- package/{dialogSlice-ZWNNS7GZ.js → dialogSlice-GRSVGDTF.js} +23 -22
- package/{dialogUsageCommand-ZCPPHPJ5.js → dialogUsageCommand-7KCPYGHG.js} +1 -1
- package/{docCreateCommands-HFSPKJSI.js → docCreateCommands-F2K3UPSQ.js} +28 -27
- package/{docDeleteCommands-CRL62POH.js → docDeleteCommands-XGXB5RFT.js} +29 -28
- package/{docReadCommands-QOTOX3XW.js → docReadCommands-7HWZZV6J.js} +28 -27
- package/{docStore-WYLRB7ED.js → docStore-KNZK6Y2G.js} +10 -10
- package/{docUpdateCommands-7BMH4MCA.js → docUpdateCommands-OZZ7NQII.js} +28 -27
- package/{fetchMessages-YY4SATNR.js → fetchMessages-M3QU7ZCQ.js} +1 -1
- package/{getPricing-OQXBJ6VZ.js → getPricing-2MNMXEVG.js} +3 -3
- package/{handleSendMessageAction-P27YP2DQ.js → handleSendMessageAction-SHIH74GJ.js} +46 -44
- package/hostCredentialCreate-X64WK4JD.js +357 -0
- package/index.js +5 -5
- package/{keys-P4ZDOVJW.js → keys-BEGDOTRL.js} +3 -1
- package/{localDialogRead-5VCMQQZF.js → localDialogRead-XRLAH4CZ.js} +1 -1
- package/{localRuntimeAdapter-GP6ZSSO3.js → localRuntimeAdapter-A7K3ABA6.js} +73 -66
- package/{machineCommands-6Z6H4BFX.js → machineCommands-DE3MR7CJ.js} +65 -60
- package/{machineWsRunDispatch-F2ZIXMYM.js → machineWsRunDispatch-R26P5V36.js} +65 -60
- package/{memberThunks-YSEFJF47.js → memberThunks-7WJAY5V6.js} +8 -8
- package/package.json +1 -1
- package/{projectArchive-PIGEOX3D.js → projectArchive-GGL5HLMD.js} +26 -25
- package/{providerPresetApply-ZYMLQA46.js → providerPresetApply-YXGV6NXB.js} +4 -4
- package/{providerRegistry-E34XWDLJ.js → providerRegistry-S6UL6UNA.js} +4 -4
- package/{read-DIIQBOOO.js → read-4VZQODSN.js} +3 -3
- package/{readDocTool-HXYGOEA7.js → readDocTool-AVD32RUJ.js} +1 -1
- package/{readlineWorkspace-UG25G7KC.js → readlineWorkspace-XKYKNL2I.js} +157 -100
- package/{removeDialogAgentAction-ALJDUJ2E.js → removeDialogAgentAction-FKL4BYMR.js} +17 -14
- package/{runAgentClientLoop-IO5F7TCZ.js → runAgentClientLoop-V7E2WBVM.js} +49 -46
- package/{runtimeDoctorCommands-PGAA47G5.js → runtimeDoctorCommands-QAI3MBKQ.js} +6 -6
- package/{secretCommands-ZCZ4KVET.js → secretCommands-4QS3HCA2.js} +3 -3
- package/{setDialogExtraReferencesAction-O3SVMD5A.js → setDialogExtraReferencesAction-TLIOLWWI.js} +10 -10
- package/{setPrimaryDialogAgentAction-HE7RVFFF.js → setPrimaryDialogAgentAction-2OLWRFYR.js} +18 -15
- package/{settingThunks-BWWJQG4L.js → settingThunks-UGBPCNYF.js} +12 -11
- package/{spaceCommands-UAELIFEI.js → spaceCommands-4KSLKVNF.js} +28 -27
- package/{streamAgentChatTurn-VUKZQYJR.js → streamAgentChatTurn-7FR7X2NU.js} +57 -54
- package/{switchDialogAgentAction-3VZS7SOS.js → switchDialogAgentAction-UZSAG2N5.js} +15 -12
- package/{tools-VRXJAVYI.js → tools-ZLKCC25W.js} +43 -40
- package/{tuiSummaryLlmCaller-TGCHZLSW.js → tuiSummaryLlmCaller-WC54MVGP.js} +10 -10
- package/{updateCommands-Q6CYAEYJ.js → updateCommands-4744PL3P.js} +3 -1
- package/{updateDialogTitleAction-MULWCJCW.js → updateDialogTitleAction-U53ZT7PJ.js} +38 -70
- package/usageCommand-F4IPVMIZ.js +32 -0
- package/usageRebuildCommand-HAW2AD5N.js +626 -0
- package/chunk-4LCOCOR5.js +0 -50
- package/chunk-7AUQ3WCW.js +0 -51
- package/chunk-ZRAU6T47.js +0 -56
- package/{agentFavoriteCommands-GAFEXKKP.js → agentFavoriteCommands-EDK743YA.js} +1 -1
- package/{agentGrantCommands-V5FOQKFD.js → agentGrantCommands-RQWK2TEV.js} +1 -1
- package/{agentPullCommand-2JMJP5BS.js → agentPullCommand-6EM3URVK.js} +1 -1
- package/{chunk-BTYQAODF.js → chunk-CZM5YTZ7.js} +3 -3
- package/{chunk-A2ZMIRLN.js → chunk-INN4LTAJ.js} +5 -5
- package/{chunk-XPHZK3PJ.js → chunk-JNKSDZFS.js} +3 -3
- package/{chunk-PV6JJAUB.js → chunk-TCZHTTUU.js} +8 -8
- package/{chunk-AKE53VMW.js → chunk-ZCWRMUWT.js} +0 -0
- package/{tableCommands-D7WR4QSM.js → tableCommands-MP6VFSVT.js} +3 -3
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
DEVIN_CONNECT_URL,
|
|
3
|
-
parseSseDataLineJson,
|
|
4
|
-
parseSseDataLineObject
|
|
5
|
-
} from "./chunk-NTSRCTUX.js";
|
|
6
1
|
import {
|
|
7
2
|
applyChatCompletionDelta,
|
|
8
3
|
applyResponsesToolEvent,
|
|
@@ -11,7 +6,12 @@ import {
|
|
|
11
6
|
flushChatCompletionStream,
|
|
12
7
|
providerHttpFailure,
|
|
13
8
|
throwIfChatCompletionStreamFailed
|
|
14
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-4KH4J3G5.js";
|
|
10
|
+
import {
|
|
11
|
+
DEVIN_CONNECT_URL,
|
|
12
|
+
parseSseDataLineJson,
|
|
13
|
+
parseSseDataLineObject
|
|
14
|
+
} from "./chunk-CTPXME7U.js";
|
|
15
15
|
import {
|
|
16
16
|
readSseFrames
|
|
17
17
|
} from "./chunk-HNUWUO75.js";
|
|
@@ -29,7 +29,7 @@ import {
|
|
|
29
29
|
import {
|
|
30
30
|
hasImageInRuntimeMessages,
|
|
31
31
|
stripImagePartsFromMessages
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-W4S457LU.js";
|
|
33
33
|
import {
|
|
34
34
|
applyShapingCounts,
|
|
35
35
|
attachProjectionFacts,
|
|
@@ -66,7 +66,7 @@ import {
|
|
|
66
66
|
hashStablePrefixContent,
|
|
67
67
|
resolveResponseGuidelines,
|
|
68
68
|
resolveToolGuidedSections
|
|
69
|
-
} from "./chunk-
|
|
69
|
+
} from "./chunk-NOMIGOST.js";
|
|
70
70
|
import {
|
|
71
71
|
classifyUnparsableToolArgs,
|
|
72
72
|
collectStablePromptPrefix,
|
|
@@ -90,7 +90,7 @@ import {
|
|
|
90
90
|
toOpenAiCompatibleMessages,
|
|
91
91
|
toResponsesTools,
|
|
92
92
|
transferDowngradedToolTurnOrigin
|
|
93
|
-
} from "./chunk-
|
|
93
|
+
} from "./chunk-UTV2AYEG.js";
|
|
94
94
|
import {
|
|
95
95
|
TOOL_HAD_IMAGES,
|
|
96
96
|
TOOL_IMAGES,
|
|
@@ -111,7 +111,6 @@ import {
|
|
|
111
111
|
DEFAULT_SUBTASK_MAX_TOOL_CALLS,
|
|
112
112
|
DEFAULT_SUBTASK_MAX_WALL_CLOCK_MS,
|
|
113
113
|
NOLO_WORKSPACE_TOOL_NAMES,
|
|
114
|
-
applyToolSurfaceConstraints,
|
|
115
114
|
buildDialogReadEnvelope,
|
|
116
115
|
buildNoloWorkspaceCommandArgs,
|
|
117
116
|
buildNoloWorkspaceOpenAiTools,
|
|
@@ -123,7 +122,10 @@ import {
|
|
|
123
122
|
parseNoloWorkspaceToolArguments,
|
|
124
123
|
readTextStreamUpToChars,
|
|
125
124
|
resolveNoloDialogInput
|
|
126
|
-
} from "./chunk-
|
|
125
|
+
} from "./chunk-25JZEIXN.js";
|
|
126
|
+
import {
|
|
127
|
+
applyToolSurfaceConstraints
|
|
128
|
+
} from "./chunk-KC4XDTT3.js";
|
|
127
129
|
import {
|
|
128
130
|
clipToolText,
|
|
129
131
|
resolveHistoricalToolContentCap,
|
|
@@ -132,7 +134,7 @@ import {
|
|
|
132
134
|
import {
|
|
133
135
|
resolveAgentImageInputSupport,
|
|
134
136
|
resolveToolImagePolicy
|
|
135
|
-
} from "./chunk-
|
|
137
|
+
} from "./chunk-YWSEPJ7C.js";
|
|
136
138
|
import {
|
|
137
139
|
buildDialogFallbackTitleFromUserInput
|
|
138
140
|
} from "./chunk-2MBTWINN.js";
|
|
@@ -147,7 +149,7 @@ import {
|
|
|
147
149
|
resolveEmptyAssistantFallbackMessage,
|
|
148
150
|
resolveEmptyAssistantOutcome,
|
|
149
151
|
resolveTruncatedReasoningTailLog
|
|
150
|
-
} from "./chunk-
|
|
152
|
+
} from "./chunk-JTDORD5P.js";
|
|
151
153
|
import {
|
|
152
154
|
COMPACTION_SUMMARY_SCHEMA_VERSION,
|
|
153
155
|
COMPACTION_SUMMARY_SYSTEM_PROMPT,
|
|
@@ -165,7 +167,7 @@ import {
|
|
|
165
167
|
resolveCompressionTriggerRatio,
|
|
166
168
|
sha256Hex,
|
|
167
169
|
truncateToolOutputForContext
|
|
168
|
-
} from "./chunk-
|
|
170
|
+
} from "./chunk-CZM5YTZ7.js";
|
|
169
171
|
import {
|
|
170
172
|
createProviderCallTimingTracker,
|
|
171
173
|
finalizeProviderCallTiming,
|
|
@@ -176,6 +178,9 @@ import {
|
|
|
176
178
|
import {
|
|
177
179
|
clipCompactText
|
|
178
180
|
} from "./chunk-5MMAK75Q.js";
|
|
181
|
+
import {
|
|
182
|
+
assertCredentialRef
|
|
183
|
+
} from "./chunk-OQHIVPG4.js";
|
|
179
184
|
import {
|
|
180
185
|
asRecordOrEmpty
|
|
181
186
|
} from "./chunk-KX6YBIHG.js";
|
|
@@ -191,7 +196,7 @@ import {
|
|
|
191
196
|
import {
|
|
192
197
|
canonicalizeToolName,
|
|
193
198
|
canonicalizeToolNames
|
|
194
|
-
} from "./chunk-
|
|
199
|
+
} from "./chunk-ZCWRMUWT.js";
|
|
195
200
|
import {
|
|
196
201
|
buildInteractiveCommandBlockedResult,
|
|
197
202
|
buildProcessTaskResultCapsule,
|
|
@@ -214,26 +219,29 @@ import {
|
|
|
214
219
|
spillToolOutput,
|
|
215
220
|
toProcessTaskView,
|
|
216
221
|
truncateToolOutput
|
|
217
|
-
} from "./chunk-
|
|
222
|
+
} from "./chunk-JNKSDZFS.js";
|
|
218
223
|
import {
|
|
219
224
|
estimateTokenCount
|
|
220
225
|
} from "./chunk-PSCNXBYA.js";
|
|
221
|
-
import {
|
|
222
|
-
resolveNoloStateDir
|
|
223
|
-
} from "./chunk-6UBGXX2W.js";
|
|
224
226
|
import {
|
|
225
227
|
buildProviderAuthHeaders,
|
|
226
228
|
buildProviderExecutionPlan
|
|
227
|
-
} from "./chunk-
|
|
229
|
+
} from "./chunk-TCZHTTUU.js";
|
|
228
230
|
import {
|
|
229
231
|
toErrorMessage
|
|
230
232
|
} from "./chunk-HNMXYYJR.js";
|
|
231
233
|
import {
|
|
232
234
|
isRecord
|
|
233
235
|
} from "./chunk-KUG52IAP.js";
|
|
236
|
+
import {
|
|
237
|
+
asTrimmedLowercaseString
|
|
238
|
+
} from "./chunk-QSJ3HFEF.js";
|
|
234
239
|
import {
|
|
235
240
|
normalizeServerOrigin
|
|
236
241
|
} from "./chunk-CF7PE763.js";
|
|
242
|
+
import {
|
|
243
|
+
resolveNoloStateDir
|
|
244
|
+
} from "./chunk-6UBGXX2W.js";
|
|
237
245
|
import {
|
|
238
246
|
dialogMessageKey,
|
|
239
247
|
dialogMessageRange
|
|
@@ -250,9 +258,6 @@ import {
|
|
|
250
258
|
import {
|
|
251
259
|
asOptionalTrimmedString
|
|
252
260
|
} from "./chunk-G3SUCT4W.js";
|
|
253
|
-
import {
|
|
254
|
-
asTrimmedLowercaseString
|
|
255
|
-
} from "./chunk-QSJ3HFEF.js";
|
|
256
261
|
import {
|
|
257
262
|
__export
|
|
258
263
|
} from "./chunk-4VNS5WPM.js";
|
|
@@ -13243,6 +13248,14 @@ var SECRET_PATTERNS = [
|
|
|
13243
13248
|
placeholder: "[REDACTED:API_KEY]",
|
|
13244
13249
|
regex: /\bsk-[a-zA-Z0-9_\-]{24,}\b/g
|
|
13245
13250
|
},
|
|
13251
|
+
// 3b. BigModel / 智谱(GLM)API Key:32 位 hex + "." + 16 位字母数字
|
|
13252
|
+
// (2026-11 实证:这类 key 没有任何可辨识前缀,此前漏在清洗与入路隔离之外,
|
|
13253
|
+
// 用户贴进对话后明文直接进了 prompt / 历史 / 工具日志。)
|
|
13254
|
+
{
|
|
13255
|
+
kind: "BIGMODEL_KEY",
|
|
13256
|
+
placeholder: "[REDACTED:BIGMODEL_KEY]",
|
|
13257
|
+
regex: /\b[0-9a-fA-F]{32}\.[A-Za-z0-9]{16}\b/g
|
|
13258
|
+
},
|
|
13246
13259
|
// 4. GitHub 访问令牌 (ghp_..., gho_..., github_pat_...)
|
|
13247
13260
|
{
|
|
13248
13261
|
kind: "GITHUB_TOKEN",
|
|
@@ -13278,9 +13291,11 @@ var QUICK_PROBE_SUBSTRINGS = [
|
|
|
13278
13291
|
"PASSWD",
|
|
13279
13292
|
"SECRET_KEY"
|
|
13280
13293
|
];
|
|
13294
|
+
var UNPREFIXED_PROBE_REGEX = /\b[0-9a-fA-F]{32}\.[A-Za-z0-9]{16}\b/;
|
|
13281
13295
|
function hasPotentialSecrets(text2) {
|
|
13282
13296
|
if (typeof text2 !== "string" || text2.length === 0) return false;
|
|
13283
|
-
|
|
13297
|
+
if (QUICK_PROBE_SUBSTRINGS.some((probe) => text2.includes(probe))) return true;
|
|
13298
|
+
return UNPREFIXED_PROBE_REGEX.test(text2);
|
|
13284
13299
|
}
|
|
13285
13300
|
function scrubSecrets(text2) {
|
|
13286
13301
|
if (typeof text2 !== "string" || text2.length === 0) {
|
|
@@ -14481,41 +14496,86 @@ function buildDestructiveShellBlockedError(reason, request3) {
|
|
|
14481
14496
|
error.permissionRequest = request3;
|
|
14482
14497
|
return error;
|
|
14483
14498
|
}
|
|
14499
|
+
var KEY_SHAPED_VALUE = /(?:^|[\s"'=])(?:sk-ant-[A-Za-z0-9_\-]{20,}|sk-[A-Za-z0-9_\-]{24,}|gh[pousr]_[A-Za-z0-9]{30,}|github_pat_[A-Za-z0-9_]{40,}|[0-9a-fA-F]{32}\.[A-Za-z0-9]{16})(?=$|[\s"'])/;
|
|
14500
|
+
var CREDENTIAL_REF_IN_TEXT = /(?:vault-cred-[A-Za-z0-9]+|\$nolo_cred:)/;
|
|
14501
|
+
function inspectCommandCredentialUse(command) {
|
|
14502
|
+
const text2 = typeof command === "string" ? command : "";
|
|
14503
|
+
if (!text2) return { hasCredential: false, hasRawSecret: false };
|
|
14504
|
+
const hasRef = CREDENTIAL_REF_IN_TEXT.test(text2);
|
|
14505
|
+
const hasRawSecret = KEY_SHAPED_VALUE.test(text2);
|
|
14506
|
+
return { hasCredential: hasRef || hasRawSecret, hasRawSecret };
|
|
14507
|
+
}
|
|
14508
|
+
function buildCredentialUsePermissionRequest(command) {
|
|
14509
|
+
return {
|
|
14510
|
+
id: "permission-shell-credential-use",
|
|
14511
|
+
tool: "execShell",
|
|
14512
|
+
action: "shell_command_credential_use",
|
|
14513
|
+
title: "\u786E\u8BA4\u5728\u547D\u4EE4\u4E2D\u4F7F\u7528\u51ED\u636E",
|
|
14514
|
+
body: "\u8BE5\u547D\u4EE4\u5F15\u7528\u4E86\u51ED\u636E\uFF08API key \u6216 vault \u5F15\u7528\uFF09\u3002\u786E\u8BA4\u540E\u7531\u672C\u673A\u53D7\u63A7\u901A\u9053\u53D6\u7528\uFF1B\u660E\u6587\u4E0D\u4F1A\u5199\u8FDB\u547D\u4EE4\u5386\u53F2\u6216\u8BB0\u5F55\u3002",
|
|
14515
|
+
...command ? { command } : {},
|
|
14516
|
+
suggestedRule: {
|
|
14517
|
+
scope: "once",
|
|
14518
|
+
pattern: { capability: "credential_use", target: "shell_command" }
|
|
14519
|
+
}
|
|
14520
|
+
};
|
|
14521
|
+
}
|
|
14522
|
+
function buildCredentialUseBlockedError(reason, command) {
|
|
14523
|
+
const error = buildDestructiveShellBlockedError(
|
|
14524
|
+
reason,
|
|
14525
|
+
buildCredentialUsePermissionRequest(command)
|
|
14526
|
+
);
|
|
14527
|
+
error.code = "credential_use_requires_confirmation";
|
|
14528
|
+
return error;
|
|
14529
|
+
}
|
|
14484
14530
|
async function evaluateExecShellDestructiveGuard(input, ctx) {
|
|
14485
14531
|
const guardEnabled = ctx.enableDestructiveShellGuard !== false;
|
|
14486
14532
|
if (!guardEnabled || ctx.confirmed) {
|
|
14487
|
-
return;
|
|
14533
|
+
return null;
|
|
14488
14534
|
}
|
|
14489
14535
|
const rawCommand = resolveShellCommandArg(
|
|
14490
14536
|
typeof input === "object" && input !== null ? input : { command: input }
|
|
14491
14537
|
);
|
|
14492
14538
|
const extraInput = typeof input === "object" && input !== null ? input.input : void 0;
|
|
14493
|
-
|
|
14494
|
-
return;
|
|
14495
|
-
}
|
|
14539
|
+
const destructive = isDestructiveShellCommand({ command: rawCommand, input: extraInput });
|
|
14496
14540
|
const displayCommand = toDisplayCommand(rawCommand);
|
|
14497
|
-
const
|
|
14541
|
+
const credentialUse = inspectCommandCredentialUse(displayCommand).hasCredential || typeof extraInput === "string" && inspectCommandCredentialUse(extraInput).hasCredential;
|
|
14542
|
+
if (!destructive && !credentialUse) {
|
|
14543
|
+
return null;
|
|
14544
|
+
}
|
|
14545
|
+
const request3 = destructive ? buildDestructiveShellPermissionRequest(displayCommand) : buildCredentialUsePermissionRequest(displayCommand);
|
|
14498
14546
|
if (!ctx.confirmDestructiveAction) {
|
|
14547
|
+
if (credentialUse) {
|
|
14548
|
+
throw buildCredentialUseBlockedError(
|
|
14549
|
+
"shell command carrying credentials blocked: no confirmation channel available",
|
|
14550
|
+
displayCommand
|
|
14551
|
+
);
|
|
14552
|
+
}
|
|
14499
14553
|
if (ctx.blockDestructiveWithoutConfirmation) {
|
|
14500
14554
|
throw buildDestructiveShellBlockedError(
|
|
14501
14555
|
"destructive shell command blocked: no confirmation channel available",
|
|
14502
14556
|
request3
|
|
14503
14557
|
);
|
|
14504
14558
|
}
|
|
14505
|
-
return;
|
|
14559
|
+
return null;
|
|
14506
14560
|
}
|
|
14507
|
-
const
|
|
14508
|
-
|
|
14561
|
+
const decision = await ctx.confirmDestructiveAction(request3);
|
|
14562
|
+
const approved = typeof decision === "boolean" ? decision : decision?.approved === true;
|
|
14563
|
+
if (!approved) {
|
|
14509
14564
|
throw buildDestructiveShellBlockedError(
|
|
14510
14565
|
"destructive shell command blocked: user declined confirmation",
|
|
14511
14566
|
request3
|
|
14512
14567
|
);
|
|
14513
14568
|
}
|
|
14569
|
+
if (typeof decision === "object" && decision?.hostResult) {
|
|
14570
|
+
return decision.hostResult;
|
|
14571
|
+
}
|
|
14572
|
+
return null;
|
|
14514
14573
|
}
|
|
14515
14574
|
async function evaluateCapabilityPolicy(capability, normalizedInput, ctx) {
|
|
14516
14575
|
if (capability.name === "execShell") {
|
|
14517
|
-
await evaluateExecShellDestructiveGuard(normalizedInput, ctx);
|
|
14576
|
+
return await evaluateExecShellDestructiveGuard(normalizedInput, ctx);
|
|
14518
14577
|
}
|
|
14578
|
+
return null;
|
|
14519
14579
|
}
|
|
14520
14580
|
|
|
14521
14581
|
// packages/agent-runtime/capabilities/execShellCapability.ts
|
|
@@ -14890,7 +14950,10 @@ async function invokeCapability(capabilityOrName, input, ctx = {}) {
|
|
|
14890
14950
|
const binding = authority && capability.name === "execShell" ? execShellExecutionBinding(normalizedInput, ctx) : void 0;
|
|
14891
14951
|
const signal = ctx.abortSignal;
|
|
14892
14952
|
const confirm = ctx.confirmDestructiveAction;
|
|
14893
|
-
await evaluateCapabilityPolicy(capability, normalizedInput, ctx);
|
|
14953
|
+
const hostExecutedResult = await evaluateCapabilityPolicy(capability, normalizedInput, ctx);
|
|
14954
|
+
if (hostExecutedResult) {
|
|
14955
|
+
return hostExecutedResult;
|
|
14956
|
+
}
|
|
14894
14957
|
if (ctx.onInvoke) {
|
|
14895
14958
|
await ctx.onInvoke(capability.name, normalizedInput);
|
|
14896
14959
|
}
|
|
@@ -18290,7 +18353,10 @@ async function runExecShellGates(args2) {
|
|
|
18290
18353
|
parsedInput = { command: parsedInput };
|
|
18291
18354
|
}
|
|
18292
18355
|
}
|
|
18293
|
-
await evaluateExecShellDestructiveGuard(parsedInput, opts);
|
|
18356
|
+
const hostExecutedResult = await evaluateExecShellDestructiveGuard(parsedInput, opts);
|
|
18357
|
+
if (hostExecutedResult) {
|
|
18358
|
+
return { kind: "handled", result: hostExecutedResult };
|
|
18359
|
+
}
|
|
18294
18360
|
opts.confirmed = true;
|
|
18295
18361
|
return { kind: "pass", opts };
|
|
18296
18362
|
}
|
|
@@ -18569,7 +18635,10 @@ async function executeToolCall(args2) {
|
|
|
18569
18635
|
`${toolName} confirmation`
|
|
18570
18636
|
);
|
|
18571
18637
|
const gateResult = replacement?.metadata?.actionGateResult;
|
|
18572
|
-
|
|
18638
|
+
const hostExecuted = replacement?.metadata?.hostExecuted === true;
|
|
18639
|
+
if (replacement !== void 0 && hostExecuted) {
|
|
18640
|
+
toolResult = replacement;
|
|
18641
|
+
} else if (replacement !== void 0 && isCompletedActionGateResult(gateResult)) {
|
|
18573
18642
|
writeSession.approved = true;
|
|
18574
18643
|
} else {
|
|
18575
18644
|
toolResult = replacement ?? {
|
|
@@ -21287,7 +21356,193 @@ async function resolveOpenAiCompatibleProviderConfig(args2) {
|
|
|
21287
21356
|
};
|
|
21288
21357
|
}
|
|
21289
21358
|
|
|
21359
|
+
// packages/agent-runtime/macOsKeychainCredentialBroker.ts
|
|
21360
|
+
import { spawn as spawn2 } from "node:child_process";
|
|
21361
|
+
var MACOS_KEYCHAIN_SERVICE_PREFIX = "nolo.credentials.keys";
|
|
21362
|
+
var MACOS_KEYCHAIN_ACCOUNT = "api-key";
|
|
21363
|
+
var SECURITY_ITEM_NOT_FOUND_EXIT = 44;
|
|
21364
|
+
var DEFAULT_SECURITY_BIN = "/usr/bin/security";
|
|
21365
|
+
function safeCredentialRef(ref) {
|
|
21366
|
+
try {
|
|
21367
|
+
return assertCredentialRef(ref);
|
|
21368
|
+
} catch {
|
|
21369
|
+
throw new Error("invalid_ref");
|
|
21370
|
+
}
|
|
21371
|
+
}
|
|
21372
|
+
function credentialRefToMacOsKeychainService(ref, servicePrefix = MACOS_KEYCHAIN_SERVICE_PREFIX) {
|
|
21373
|
+
const safe = safeCredentialRef(ref);
|
|
21374
|
+
const hex = Buffer.from(safe, "utf8").toString("hex");
|
|
21375
|
+
if (!hex) {
|
|
21376
|
+
throw new Error("invalid_ref");
|
|
21377
|
+
}
|
|
21378
|
+
return `${servicePrefix}.${hex}`;
|
|
21379
|
+
}
|
|
21380
|
+
function rethrowBrokerError(op, _error) {
|
|
21381
|
+
throw new Error(`credential_broker_${op}_failed`);
|
|
21382
|
+
}
|
|
21383
|
+
function createDefaultSecurityRunner(securityBin = DEFAULT_SECURITY_BIN) {
|
|
21384
|
+
return function defaultSecurityRunner(input) {
|
|
21385
|
+
return new Promise((resolve6) => {
|
|
21386
|
+
let settled = false;
|
|
21387
|
+
const finish = (result4) => {
|
|
21388
|
+
if (settled) return;
|
|
21389
|
+
settled = true;
|
|
21390
|
+
resolve6(result4);
|
|
21391
|
+
};
|
|
21392
|
+
let child;
|
|
21393
|
+
try {
|
|
21394
|
+
child = spawn2(securityBin, input.args, {
|
|
21395
|
+
stdio: ["pipe", "pipe", "pipe"]
|
|
21396
|
+
});
|
|
21397
|
+
} catch {
|
|
21398
|
+
finish({ exitCode: -1, stdout: "", stderr: "" });
|
|
21399
|
+
return;
|
|
21400
|
+
}
|
|
21401
|
+
let stdout = "";
|
|
21402
|
+
let stderr = "";
|
|
21403
|
+
child.stdout?.setEncoding("utf8");
|
|
21404
|
+
child.stderr?.setEncoding("utf8");
|
|
21405
|
+
child.stdout?.on("data", (chunk) => {
|
|
21406
|
+
stdout += chunk;
|
|
21407
|
+
});
|
|
21408
|
+
child.stderr?.on("data", (chunk) => {
|
|
21409
|
+
stderr += chunk;
|
|
21410
|
+
});
|
|
21411
|
+
child.on("error", () => {
|
|
21412
|
+
finish({ exitCode: -1, stdout: "", stderr: "" });
|
|
21413
|
+
});
|
|
21414
|
+
child.on("close", (code) => {
|
|
21415
|
+
finish({
|
|
21416
|
+
exitCode: typeof code === "number" ? code : -1,
|
|
21417
|
+
stdout,
|
|
21418
|
+
stderr
|
|
21419
|
+
});
|
|
21420
|
+
});
|
|
21421
|
+
if (input.stdin !== void 0) {
|
|
21422
|
+
child.stdin?.write(input.stdin);
|
|
21423
|
+
}
|
|
21424
|
+
child.stdin?.end();
|
|
21425
|
+
});
|
|
21426
|
+
};
|
|
21427
|
+
}
|
|
21428
|
+
function createMacOsKeychainCredentialBroker(options = {}) {
|
|
21429
|
+
const runner = options.runner ?? createDefaultSecurityRunner(options.securityBin);
|
|
21430
|
+
const servicePrefix = options.servicePrefix ?? MACOS_KEYCHAIN_SERVICE_PREFIX;
|
|
21431
|
+
const account = options.account ?? MACOS_KEYCHAIN_ACCOUNT;
|
|
21432
|
+
const serviceFor = (ref) => credentialRefToMacOsKeychainService(ref, servicePrefix);
|
|
21433
|
+
return {
|
|
21434
|
+
async get(ref) {
|
|
21435
|
+
const safeRef = safeCredentialRef(ref);
|
|
21436
|
+
const service4 = serviceFor(safeRef);
|
|
21437
|
+
let result4;
|
|
21438
|
+
try {
|
|
21439
|
+
result4 = await runner({
|
|
21440
|
+
args: [
|
|
21441
|
+
"find-generic-password",
|
|
21442
|
+
"-a",
|
|
21443
|
+
account,
|
|
21444
|
+
"-s",
|
|
21445
|
+
service4,
|
|
21446
|
+
"-w"
|
|
21447
|
+
]
|
|
21448
|
+
});
|
|
21449
|
+
} catch (error) {
|
|
21450
|
+
rethrowBrokerError("get", error);
|
|
21451
|
+
}
|
|
21452
|
+
if (result4.exitCode === SECURITY_ITEM_NOT_FOUND_EXIT) {
|
|
21453
|
+
return null;
|
|
21454
|
+
}
|
|
21455
|
+
if (result4.exitCode !== 0) {
|
|
21456
|
+
rethrowBrokerError("get");
|
|
21457
|
+
}
|
|
21458
|
+
const secret = result4.stdout.replace(/\n$/, "");
|
|
21459
|
+
return secret.length > 0 ? secret : null;
|
|
21460
|
+
},
|
|
21461
|
+
async put(ref, secret) {
|
|
21462
|
+
const safeRef = safeCredentialRef(ref);
|
|
21463
|
+
const value = asTrimmedString(secret);
|
|
21464
|
+
if (!value) {
|
|
21465
|
+
throw new Error("Cannot store an empty credential secret.");
|
|
21466
|
+
}
|
|
21467
|
+
const service4 = serviceFor(safeRef);
|
|
21468
|
+
const stdin = `${value}
|
|
21469
|
+
${value}
|
|
21470
|
+
`;
|
|
21471
|
+
let result4;
|
|
21472
|
+
try {
|
|
21473
|
+
result4 = await runner({
|
|
21474
|
+
args: [
|
|
21475
|
+
"add-generic-password",
|
|
21476
|
+
"-a",
|
|
21477
|
+
account,
|
|
21478
|
+
"-s",
|
|
21479
|
+
service4,
|
|
21480
|
+
"-U",
|
|
21481
|
+
"-w"
|
|
21482
|
+
],
|
|
21483
|
+
stdin
|
|
21484
|
+
});
|
|
21485
|
+
} catch (error) {
|
|
21486
|
+
rethrowBrokerError("put", error);
|
|
21487
|
+
}
|
|
21488
|
+
if (result4.exitCode !== 0) {
|
|
21489
|
+
rethrowBrokerError("put");
|
|
21490
|
+
}
|
|
21491
|
+
},
|
|
21492
|
+
async delete(ref) {
|
|
21493
|
+
const safeRef = safeCredentialRef(ref);
|
|
21494
|
+
const service4 = serviceFor(safeRef);
|
|
21495
|
+
let result4;
|
|
21496
|
+
try {
|
|
21497
|
+
result4 = await runner({
|
|
21498
|
+
args: [
|
|
21499
|
+
"delete-generic-password",
|
|
21500
|
+
"-a",
|
|
21501
|
+
account,
|
|
21502
|
+
"-s",
|
|
21503
|
+
service4
|
|
21504
|
+
]
|
|
21505
|
+
});
|
|
21506
|
+
} catch (error) {
|
|
21507
|
+
rethrowBrokerError("delete", error);
|
|
21508
|
+
}
|
|
21509
|
+
if (result4.exitCode === 0 || result4.exitCode === SECURITY_ITEM_NOT_FOUND_EXIT) {
|
|
21510
|
+
return;
|
|
21511
|
+
}
|
|
21512
|
+
rethrowBrokerError("delete");
|
|
21513
|
+
},
|
|
21514
|
+
async has(ref) {
|
|
21515
|
+
const safeRef = safeCredentialRef(ref);
|
|
21516
|
+
const service4 = serviceFor(safeRef);
|
|
21517
|
+
let result4;
|
|
21518
|
+
try {
|
|
21519
|
+
result4 = await runner({
|
|
21520
|
+
args: [
|
|
21521
|
+
"find-generic-password",
|
|
21522
|
+
"-a",
|
|
21523
|
+
account,
|
|
21524
|
+
"-s",
|
|
21525
|
+
service4
|
|
21526
|
+
]
|
|
21527
|
+
});
|
|
21528
|
+
} catch (error) {
|
|
21529
|
+
rethrowBrokerError("has", error);
|
|
21530
|
+
}
|
|
21531
|
+
if (result4.exitCode === SECURITY_ITEM_NOT_FOUND_EXIT) {
|
|
21532
|
+
return false;
|
|
21533
|
+
}
|
|
21534
|
+
if (result4.exitCode !== 0) {
|
|
21535
|
+
rethrowBrokerError("has");
|
|
21536
|
+
}
|
|
21537
|
+
return true;
|
|
21538
|
+
}
|
|
21539
|
+
};
|
|
21540
|
+
}
|
|
21541
|
+
|
|
21290
21542
|
// packages/agent-runtime/windowsCredentialManagerBroker.ts
|
|
21543
|
+
import { spawn as spawn3 } from "node:child_process";
|
|
21544
|
+
var WINDOWS_CREDENTIAL_TARGET_PREFIX = "nolo.credentials.keys";
|
|
21545
|
+
var WIN_ERROR_NOT_FOUND = 1168;
|
|
21291
21546
|
var WINDOWS_CREDENTIAL_MANAGER_SCRIPT = `
|
|
21292
21547
|
$ErrorActionPreference = 'Stop'
|
|
21293
21548
|
try {
|
|
@@ -21410,6 +21665,419 @@ public class NoloCredNative {
|
|
|
21410
21665
|
exit 1
|
|
21411
21666
|
}
|
|
21412
21667
|
`.trim();
|
|
21668
|
+
function safeCredentialRef2(ref) {
|
|
21669
|
+
try {
|
|
21670
|
+
return assertCredentialRef(ref);
|
|
21671
|
+
} catch {
|
|
21672
|
+
throw new Error("invalid_ref");
|
|
21673
|
+
}
|
|
21674
|
+
}
|
|
21675
|
+
function credentialRefToWindowsCredentialTarget(ref, targetPrefix = WINDOWS_CREDENTIAL_TARGET_PREFIX) {
|
|
21676
|
+
const safe = safeCredentialRef2(ref);
|
|
21677
|
+
const hex = Buffer.from(safe, "utf8").toString("hex");
|
|
21678
|
+
if (!hex) {
|
|
21679
|
+
throw new Error("invalid_ref");
|
|
21680
|
+
}
|
|
21681
|
+
return `${targetPrefix}.${hex}`;
|
|
21682
|
+
}
|
|
21683
|
+
function rethrowBrokerError2(op, _error) {
|
|
21684
|
+
throw new Error(`credential_broker_${op}_failed`);
|
|
21685
|
+
}
|
|
21686
|
+
function buildWindowsCredentialPowerShellArgs(script = WINDOWS_CREDENTIAL_MANAGER_SCRIPT) {
|
|
21687
|
+
const encoded = Buffer.from(script, "utf16le").toString("base64");
|
|
21688
|
+
return [
|
|
21689
|
+
"-NoProfile",
|
|
21690
|
+
"-NonInteractive",
|
|
21691
|
+
"-ExecutionPolicy",
|
|
21692
|
+
"Bypass",
|
|
21693
|
+
"-EncodedCommand",
|
|
21694
|
+
encoded
|
|
21695
|
+
];
|
|
21696
|
+
}
|
|
21697
|
+
function requestStdin(payload) {
|
|
21698
|
+
return JSON.stringify(payload);
|
|
21699
|
+
}
|
|
21700
|
+
function parseGetSecretFromStdout(stdout) {
|
|
21701
|
+
const trimmed = asTrimmedString(stdout);
|
|
21702
|
+
if (!trimmed) {
|
|
21703
|
+
rethrowBrokerError2("get");
|
|
21704
|
+
}
|
|
21705
|
+
let parsed;
|
|
21706
|
+
try {
|
|
21707
|
+
parsed = JSON.parse(trimmed);
|
|
21708
|
+
} catch {
|
|
21709
|
+
rethrowBrokerError2("get");
|
|
21710
|
+
}
|
|
21711
|
+
if (parsed === null || typeof parsed !== "object" || Array.isArray(parsed) || typeof parsed.secret !== "string") {
|
|
21712
|
+
rethrowBrokerError2("get");
|
|
21713
|
+
}
|
|
21714
|
+
return parsed.secret;
|
|
21715
|
+
}
|
|
21716
|
+
function spawnShell(bin, args2, stdin) {
|
|
21717
|
+
return new Promise((resolve6) => {
|
|
21718
|
+
let settled = false;
|
|
21719
|
+
const finish = (result4) => {
|
|
21720
|
+
if (settled) return;
|
|
21721
|
+
settled = true;
|
|
21722
|
+
resolve6(result4);
|
|
21723
|
+
};
|
|
21724
|
+
let child;
|
|
21725
|
+
try {
|
|
21726
|
+
child = spawn3(bin, args2, {
|
|
21727
|
+
stdio: ["pipe", "pipe", "pipe"],
|
|
21728
|
+
windowsHide: true
|
|
21729
|
+
});
|
|
21730
|
+
} catch {
|
|
21731
|
+
finish({ exitCode: -1, stdout: "", stderr: "" });
|
|
21732
|
+
return;
|
|
21733
|
+
}
|
|
21734
|
+
let stdout = "";
|
|
21735
|
+
let stderr = "";
|
|
21736
|
+
child.stdout?.setEncoding("utf8");
|
|
21737
|
+
child.stderr?.setEncoding("utf8");
|
|
21738
|
+
child.stdout?.on("data", (chunk) => {
|
|
21739
|
+
stdout += chunk;
|
|
21740
|
+
});
|
|
21741
|
+
child.stderr?.on("data", (chunk) => {
|
|
21742
|
+
stderr += chunk;
|
|
21743
|
+
});
|
|
21744
|
+
child.on("error", () => {
|
|
21745
|
+
finish({ exitCode: -1, stdout: "", stderr: "" });
|
|
21746
|
+
});
|
|
21747
|
+
child.on("close", (code) => {
|
|
21748
|
+
finish({
|
|
21749
|
+
exitCode: typeof code === "number" ? code : -1,
|
|
21750
|
+
stdout,
|
|
21751
|
+
stderr
|
|
21752
|
+
});
|
|
21753
|
+
});
|
|
21754
|
+
if (stdin !== void 0) {
|
|
21755
|
+
child.stdin?.write(stdin);
|
|
21756
|
+
}
|
|
21757
|
+
child.stdin?.end();
|
|
21758
|
+
});
|
|
21759
|
+
}
|
|
21760
|
+
function createDefaultWindowsCredentialRunner(shellBin) {
|
|
21761
|
+
let resolvedBin = shellBin ?? null;
|
|
21762
|
+
return async function defaultWindowsCredentialRunner(input) {
|
|
21763
|
+
if (resolvedBin) {
|
|
21764
|
+
return spawnShell(resolvedBin, input.args, input.stdin);
|
|
21765
|
+
}
|
|
21766
|
+
const first = await spawnShell("powershell.exe", input.args, input.stdin);
|
|
21767
|
+
if (first.exitCode !== -1) {
|
|
21768
|
+
resolvedBin = "powershell.exe";
|
|
21769
|
+
return first;
|
|
21770
|
+
}
|
|
21771
|
+
const second = await spawnShell("pwsh", input.args, input.stdin);
|
|
21772
|
+
if (second.exitCode !== -1) {
|
|
21773
|
+
resolvedBin = "pwsh";
|
|
21774
|
+
}
|
|
21775
|
+
return second;
|
|
21776
|
+
};
|
|
21777
|
+
}
|
|
21778
|
+
function createWindowsCredentialManagerBroker(options = {}) {
|
|
21779
|
+
const runner = options.runner ?? createDefaultWindowsCredentialRunner(options.shellBin);
|
|
21780
|
+
const targetPrefix = options.targetPrefix ?? WINDOWS_CREDENTIAL_TARGET_PREFIX;
|
|
21781
|
+
const targetFor = (ref) => credentialRefToWindowsCredentialTarget(ref, targetPrefix);
|
|
21782
|
+
const staticArgs = buildWindowsCredentialPowerShellArgs();
|
|
21783
|
+
return {
|
|
21784
|
+
async get(ref) {
|
|
21785
|
+
const safeRef = safeCredentialRef2(ref);
|
|
21786
|
+
const target = targetFor(safeRef);
|
|
21787
|
+
let result4;
|
|
21788
|
+
try {
|
|
21789
|
+
result4 = await runner({
|
|
21790
|
+
args: staticArgs,
|
|
21791
|
+
stdin: requestStdin({ op: "get", target })
|
|
21792
|
+
});
|
|
21793
|
+
} catch (error) {
|
|
21794
|
+
rethrowBrokerError2("get", error);
|
|
21795
|
+
}
|
|
21796
|
+
if (result4.exitCode === WIN_ERROR_NOT_FOUND) {
|
|
21797
|
+
return null;
|
|
21798
|
+
}
|
|
21799
|
+
if (result4.exitCode !== 0) {
|
|
21800
|
+
rethrowBrokerError2("get");
|
|
21801
|
+
}
|
|
21802
|
+
const secret = parseGetSecretFromStdout(result4.stdout);
|
|
21803
|
+
return secret.length > 0 ? secret : null;
|
|
21804
|
+
},
|
|
21805
|
+
async put(ref, secret) {
|
|
21806
|
+
const safeRef = safeCredentialRef2(ref);
|
|
21807
|
+
const value = asTrimmedString(secret);
|
|
21808
|
+
if (!value) {
|
|
21809
|
+
throw new Error("Cannot store an empty credential secret.");
|
|
21810
|
+
}
|
|
21811
|
+
const target = targetFor(safeRef);
|
|
21812
|
+
let result4;
|
|
21813
|
+
try {
|
|
21814
|
+
result4 = await runner({
|
|
21815
|
+
args: staticArgs,
|
|
21816
|
+
stdin: requestStdin({ op: "put", target, secret: value })
|
|
21817
|
+
});
|
|
21818
|
+
} catch (error) {
|
|
21819
|
+
rethrowBrokerError2("put", error);
|
|
21820
|
+
}
|
|
21821
|
+
if (result4.exitCode !== 0) {
|
|
21822
|
+
rethrowBrokerError2("put");
|
|
21823
|
+
}
|
|
21824
|
+
},
|
|
21825
|
+
async delete(ref) {
|
|
21826
|
+
const safeRef = safeCredentialRef2(ref);
|
|
21827
|
+
const target = targetFor(safeRef);
|
|
21828
|
+
let result4;
|
|
21829
|
+
try {
|
|
21830
|
+
result4 = await runner({
|
|
21831
|
+
args: staticArgs,
|
|
21832
|
+
stdin: requestStdin({ op: "delete", target })
|
|
21833
|
+
});
|
|
21834
|
+
} catch (error) {
|
|
21835
|
+
rethrowBrokerError2("delete", error);
|
|
21836
|
+
}
|
|
21837
|
+
if (result4.exitCode === 0 || result4.exitCode === WIN_ERROR_NOT_FOUND) {
|
|
21838
|
+
return;
|
|
21839
|
+
}
|
|
21840
|
+
rethrowBrokerError2("delete");
|
|
21841
|
+
},
|
|
21842
|
+
async has(ref) {
|
|
21843
|
+
const safeRef = safeCredentialRef2(ref);
|
|
21844
|
+
const target = targetFor(safeRef);
|
|
21845
|
+
let result4;
|
|
21846
|
+
try {
|
|
21847
|
+
result4 = await runner({
|
|
21848
|
+
args: staticArgs,
|
|
21849
|
+
stdin: requestStdin({ op: "has", target })
|
|
21850
|
+
});
|
|
21851
|
+
} catch (error) {
|
|
21852
|
+
rethrowBrokerError2("has", error);
|
|
21853
|
+
}
|
|
21854
|
+
if (result4.exitCode === WIN_ERROR_NOT_FOUND) {
|
|
21855
|
+
return false;
|
|
21856
|
+
}
|
|
21857
|
+
if (result4.exitCode !== 0) {
|
|
21858
|
+
rethrowBrokerError2("has");
|
|
21859
|
+
}
|
|
21860
|
+
return true;
|
|
21861
|
+
}
|
|
21862
|
+
};
|
|
21863
|
+
}
|
|
21864
|
+
|
|
21865
|
+
// packages/agent-runtime/linuxSecretServiceCredentialBroker.ts
|
|
21866
|
+
import { spawn as spawn4 } from "node:child_process";
|
|
21867
|
+
var LINUX_SECRET_SERVICE_ATTRIBUTE = "nolo-credential";
|
|
21868
|
+
var SECRET_TOOL_NO_MATCH_EXIT = 1;
|
|
21869
|
+
var DEFAULT_SECRET_TOOL_BIN = "secret-tool";
|
|
21870
|
+
function safeCredentialRef3(ref) {
|
|
21871
|
+
try {
|
|
21872
|
+
return assertCredentialRef(ref);
|
|
21873
|
+
} catch {
|
|
21874
|
+
throw new Error("invalid_ref");
|
|
21875
|
+
}
|
|
21876
|
+
}
|
|
21877
|
+
function brokerFailure(op) {
|
|
21878
|
+
throw new Error(`credential_broker_${op}_failed`);
|
|
21879
|
+
}
|
|
21880
|
+
function createDefaultSecretToolRunner(secretToolBin = DEFAULT_SECRET_TOOL_BIN) {
|
|
21881
|
+
return (input) => new Promise((resolve6) => {
|
|
21882
|
+
let stdout = "";
|
|
21883
|
+
let stderr = "";
|
|
21884
|
+
let settled = false;
|
|
21885
|
+
const finish = (result4) => {
|
|
21886
|
+
if (settled) return;
|
|
21887
|
+
settled = true;
|
|
21888
|
+
resolve6(result4);
|
|
21889
|
+
};
|
|
21890
|
+
let child;
|
|
21891
|
+
try {
|
|
21892
|
+
child = spawn4(secretToolBin, input.args, {
|
|
21893
|
+
stdio: ["pipe", "pipe", "pipe"]
|
|
21894
|
+
});
|
|
21895
|
+
} catch {
|
|
21896
|
+
finish({ exitCode: -1, stdout: "", stderr: "" });
|
|
21897
|
+
return;
|
|
21898
|
+
}
|
|
21899
|
+
child.stdout?.on("data", (chunk) => {
|
|
21900
|
+
stdout += chunk;
|
|
21901
|
+
});
|
|
21902
|
+
child.stderr?.on("data", (chunk) => {
|
|
21903
|
+
stderr += chunk;
|
|
21904
|
+
});
|
|
21905
|
+
child.on("error", () => {
|
|
21906
|
+
finish({ exitCode: -1, stdout: "", stderr: "" });
|
|
21907
|
+
});
|
|
21908
|
+
child.on("close", (code) => {
|
|
21909
|
+
finish({
|
|
21910
|
+
exitCode: typeof code === "number" ? code : -1,
|
|
21911
|
+
stdout,
|
|
21912
|
+
stderr
|
|
21913
|
+
});
|
|
21914
|
+
});
|
|
21915
|
+
if (input.stdin !== void 0) {
|
|
21916
|
+
child.stdin?.write(input.stdin);
|
|
21917
|
+
}
|
|
21918
|
+
child.stdin?.end();
|
|
21919
|
+
});
|
|
21920
|
+
}
|
|
21921
|
+
function createLinuxSecretServiceCredentialBroker(options = {}) {
|
|
21922
|
+
const runner = options.runner ?? createDefaultSecretToolRunner(options.secretToolBin);
|
|
21923
|
+
const attribute = options.attribute ?? LINUX_SECRET_SERVICE_ATTRIBUTE;
|
|
21924
|
+
const attrArgs = (ref) => [attribute, ref];
|
|
21925
|
+
const lookup3 = async (ref) => {
|
|
21926
|
+
try {
|
|
21927
|
+
return await runner({ args: ["lookup", ...attrArgs(ref)] });
|
|
21928
|
+
} catch {
|
|
21929
|
+
brokerFailure("get");
|
|
21930
|
+
}
|
|
21931
|
+
};
|
|
21932
|
+
return {
|
|
21933
|
+
async get(ref) {
|
|
21934
|
+
const safeRef = safeCredentialRef3(ref);
|
|
21935
|
+
const result4 = await lookup3(safeRef);
|
|
21936
|
+
if (result4.exitCode === SECRET_TOOL_NO_MATCH_EXIT) return null;
|
|
21937
|
+
if (result4.exitCode !== 0) brokerFailure("get");
|
|
21938
|
+
const secret = result4.stdout.replace(/\n$/, "");
|
|
21939
|
+
return secret.length > 0 ? secret : null;
|
|
21940
|
+
},
|
|
21941
|
+
async put(ref, secret) {
|
|
21942
|
+
const safeRef = safeCredentialRef3(ref);
|
|
21943
|
+
const value = asTrimmedString(secret);
|
|
21944
|
+
if (!value) {
|
|
21945
|
+
throw new Error("Cannot store an empty credential secret.");
|
|
21946
|
+
}
|
|
21947
|
+
const args2 = [
|
|
21948
|
+
"store",
|
|
21949
|
+
`--label=nolo-credential:${safeRef}`,
|
|
21950
|
+
...attrArgs(safeRef)
|
|
21951
|
+
];
|
|
21952
|
+
if (value.includes("\n") || args2.some((arg) => arg.includes(value))) {
|
|
21953
|
+
brokerFailure("put");
|
|
21954
|
+
}
|
|
21955
|
+
let result4;
|
|
21956
|
+
try {
|
|
21957
|
+
result4 = await runner({ args: args2, stdin: value });
|
|
21958
|
+
} catch {
|
|
21959
|
+
brokerFailure("put");
|
|
21960
|
+
}
|
|
21961
|
+
if (result4.exitCode !== 0) brokerFailure("put");
|
|
21962
|
+
},
|
|
21963
|
+
async delete(ref) {
|
|
21964
|
+
const safeRef = safeCredentialRef3(ref);
|
|
21965
|
+
let result4;
|
|
21966
|
+
try {
|
|
21967
|
+
result4 = await runner({ args: ["clear", ...attrArgs(safeRef)] });
|
|
21968
|
+
} catch {
|
|
21969
|
+
brokerFailure("delete");
|
|
21970
|
+
}
|
|
21971
|
+
if (result4.exitCode === 0 || result4.exitCode === SECRET_TOOL_NO_MATCH_EXIT) {
|
|
21972
|
+
return;
|
|
21973
|
+
}
|
|
21974
|
+
brokerFailure("delete");
|
|
21975
|
+
},
|
|
21976
|
+
async has(ref) {
|
|
21977
|
+
const safeRef = safeCredentialRef3(ref);
|
|
21978
|
+
const result4 = await lookup3(safeRef);
|
|
21979
|
+
if (result4.exitCode === SECRET_TOOL_NO_MATCH_EXIT) return false;
|
|
21980
|
+
if (result4.exitCode !== 0) brokerFailure("has");
|
|
21981
|
+
return true;
|
|
21982
|
+
}
|
|
21983
|
+
};
|
|
21984
|
+
}
|
|
21985
|
+
|
|
21986
|
+
// packages/agent-runtime/desktopHostCredentialBroker.ts
|
|
21987
|
+
function createClosedCredentialBroker(code = "credential_store_unavailable") {
|
|
21988
|
+
const fail9 = () => {
|
|
21989
|
+
throw new Error(code);
|
|
21990
|
+
};
|
|
21991
|
+
return {
|
|
21992
|
+
get: fail9,
|
|
21993
|
+
put: fail9,
|
|
21994
|
+
delete: fail9,
|
|
21995
|
+
has: () => false
|
|
21996
|
+
};
|
|
21997
|
+
}
|
|
21998
|
+
function createHostCredentialBrokerChain(args2) {
|
|
21999
|
+
const { strict, session, legacy, notifySessionFallback, notifyLegacyHit } = args2;
|
|
22000
|
+
const legacyNoticed = /* @__PURE__ */ new Set();
|
|
22001
|
+
let sessionNotified = false;
|
|
22002
|
+
const noticeSession = () => {
|
|
22003
|
+
if (sessionNotified || !notifySessionFallback) return;
|
|
22004
|
+
sessionNotified = true;
|
|
22005
|
+
try {
|
|
22006
|
+
notifySessionFallback();
|
|
22007
|
+
} catch {
|
|
22008
|
+
}
|
|
22009
|
+
};
|
|
22010
|
+
return {
|
|
22011
|
+
async get(ref) {
|
|
22012
|
+
try {
|
|
22013
|
+
const strictValue = await strict.get(ref);
|
|
22014
|
+
if (strictValue !== null && strictValue !== void 0) return strictValue;
|
|
22015
|
+
} catch {
|
|
22016
|
+
}
|
|
22017
|
+
const sessionValue = await session.get(ref);
|
|
22018
|
+
if (sessionValue !== null && sessionValue !== void 0) return sessionValue;
|
|
22019
|
+
if (!legacy) return null;
|
|
22020
|
+
const legacyValue = await legacy.get(ref);
|
|
22021
|
+
if (legacyValue !== null && legacyValue !== void 0) {
|
|
22022
|
+
if (notifyLegacyHit && !legacyNoticed.has(ref)) {
|
|
22023
|
+
legacyNoticed.add(ref);
|
|
22024
|
+
try {
|
|
22025
|
+
notifyLegacyHit(ref);
|
|
22026
|
+
} catch {
|
|
22027
|
+
}
|
|
22028
|
+
}
|
|
22029
|
+
return legacyValue;
|
|
22030
|
+
}
|
|
22031
|
+
return null;
|
|
22032
|
+
},
|
|
22033
|
+
async put(ref, secret) {
|
|
22034
|
+
try {
|
|
22035
|
+
await strict.put(ref, secret);
|
|
22036
|
+
if (await strict.has(ref)) return;
|
|
22037
|
+
} catch {
|
|
22038
|
+
}
|
|
22039
|
+
await session.put(ref, secret);
|
|
22040
|
+
noticeSession();
|
|
22041
|
+
},
|
|
22042
|
+
async delete(ref) {
|
|
22043
|
+
try {
|
|
22044
|
+
await strict.delete(ref);
|
|
22045
|
+
} catch {
|
|
22046
|
+
}
|
|
22047
|
+
try {
|
|
22048
|
+
await session.delete(ref);
|
|
22049
|
+
} catch {
|
|
22050
|
+
}
|
|
22051
|
+
if (legacy) await legacy.delete(ref);
|
|
22052
|
+
},
|
|
22053
|
+
async has(ref) {
|
|
22054
|
+
try {
|
|
22055
|
+
if (await strict.has(ref)) return true;
|
|
22056
|
+
} catch {
|
|
22057
|
+
}
|
|
22058
|
+
if (await session.has(ref)) return true;
|
|
22059
|
+
return legacy ? await legacy.has(ref) : false;
|
|
22060
|
+
}
|
|
22061
|
+
};
|
|
22062
|
+
}
|
|
22063
|
+
function createStrictHostCredentialBroker(options = {}) {
|
|
22064
|
+
const platform = options.platform ?? process.platform;
|
|
22065
|
+
const env = options.env ?? process.env;
|
|
22066
|
+
const override = String(env.NOLO_DESKTOP_CREDENTIAL_STORE ?? "").trim().toLowerCase();
|
|
22067
|
+
if (override === "file") {
|
|
22068
|
+
return createClosedCredentialBroker("credential_store_file_not_allowed");
|
|
22069
|
+
}
|
|
22070
|
+
if (platform === "darwin" || override === "keychain") {
|
|
22071
|
+
return options.keychainBroker ?? (options.createKeychainBroker ?? (() => createMacOsKeychainCredentialBroker()))();
|
|
22072
|
+
}
|
|
22073
|
+
if (platform === "win32" || override === "credman") {
|
|
22074
|
+
return options.windowsCredentialBroker ?? (options.createWindowsCredentialBroker ?? (() => createWindowsCredentialManagerBroker()))();
|
|
22075
|
+
}
|
|
22076
|
+
if (platform === "linux" || override === "secret-service") {
|
|
22077
|
+
return options.linuxSecretServiceBroker ?? (options.createLinuxSecretServiceBroker ?? (() => createLinuxSecretServiceCredentialBroker()))();
|
|
22078
|
+
}
|
|
22079
|
+
return createClosedCredentialBroker("credential_store_unsupported");
|
|
22080
|
+
}
|
|
21413
22081
|
|
|
21414
22082
|
// packages/agent-runtime/dialogMessageRecord.ts
|
|
21415
22083
|
function dialogMessageRecordToAgentRuntimeMessage(record2) {
|
|
@@ -21861,11 +22529,11 @@ async function readNoloProcessStream(readable) {
|
|
|
21861
22529
|
async function runNoloWorkspaceCliTool(call, args2) {
|
|
21862
22530
|
const cliArgs = buildNoloWorkspaceCommandArgs(call);
|
|
21863
22531
|
const bunSpawn = globalThis.Bun?.spawn;
|
|
21864
|
-
const
|
|
22532
|
+
const spawn5 = args2.spawn ?? (typeof bunSpawn === "function" ? bunSpawn : nodeSpawnFallback);
|
|
21865
22533
|
const execPath = args2.processExecPath ?? process.execPath;
|
|
21866
22534
|
const entrypoint = args2.cliEntrypoint;
|
|
21867
22535
|
const cmd = entrypoint && entrypoint !== execPath ? [execPath, entrypoint, ...cliArgs] : [execPath, ...cliArgs];
|
|
21868
|
-
const proc =
|
|
22536
|
+
const proc = spawn5({
|
|
21869
22537
|
cmd,
|
|
21870
22538
|
stdout: "pipe",
|
|
21871
22539
|
stderr: "pipe",
|
|
@@ -21980,7 +22648,7 @@ function buildLoadSkillExecutor(args2) {
|
|
|
21980
22648
|
const { resolveSkillByName } = await import("./skillDiscovery-XKHROSH2.js");
|
|
21981
22649
|
const resolved = resolveSkillByName(args2.cwd, name);
|
|
21982
22650
|
if (!resolved) {
|
|
21983
|
-
const { resolveBuiltinSkillByName } = await import("./builtinSkillRegistry-
|
|
22651
|
+
const { resolveBuiltinSkillByName } = await import("./builtinSkillRegistry-3YOIGEF6.js");
|
|
21984
22652
|
const builtin = resolveBuiltinSkillByName(name);
|
|
21985
22653
|
if (builtin) {
|
|
21986
22654
|
return {
|
|
@@ -22039,7 +22707,7 @@ async function loadPreciseSkill(cwd, parsed) {
|
|
|
22039
22707
|
if (!nonEmpty(parsed.slug) || has2("projectBinding") || has2("relativePath")) {
|
|
22040
22708
|
return reject("builtin requires only an exact slug.");
|
|
22041
22709
|
}
|
|
22042
|
-
const { listBuiltinSkills } = await import("./builtinSkillRegistry-
|
|
22710
|
+
const { listBuiltinSkills } = await import("./builtinSkillRegistry-3YOIGEF6.js");
|
|
22043
22711
|
const builtin = listBuiltinSkills().find((entry) => entry.slug === parsed.slug);
|
|
22044
22712
|
if (!builtin) return reject("builtin slug not found.");
|
|
22045
22713
|
return {
|
|
@@ -22742,12 +23410,15 @@ function verifyOwnerRouteAck(headers, expectedRequestId) {
|
|
|
22742
23410
|
}
|
|
22743
23411
|
|
|
22744
23412
|
export {
|
|
23413
|
+
createHostCredentialBrokerChain,
|
|
23414
|
+
createStrictHostCredentialBroker,
|
|
22745
23415
|
readCommandActionGatePayload,
|
|
22746
23416
|
readActionGate,
|
|
22747
23417
|
Option_exports,
|
|
22748
23418
|
Duration_exports,
|
|
22749
23419
|
Exit_exports,
|
|
22750
23420
|
Effect_exports,
|
|
23421
|
+
scrubSecrets,
|
|
22751
23422
|
isDestructiveShellCommand,
|
|
22752
23423
|
evaluateShellCommandPolicy,
|
|
22753
23424
|
filterRetainedLedgerRecords,
|