nolo-cli 0.157.0-alpha.1 → 0.157.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (164) hide show
  1. package/{_executeModel-5WS2PA62.js → _executeModel-ZIQHOREX.js} +55 -55
  2. package/{accountResolver-7RYB4D2P.js → accountResolver-55EDKEIK.js} +1 -1
  3. package/{action-ZJYUBXFC.js → action-GPPJC5TI.js} +5 -5
  4. package/{addContentAction-TVHB4526.js → addContentAction-XJQEJ4XW.js} +8 -8
  5. package/{addDialogAgentAction-FDPBU6K6.js → addDialogAgentAction-5WZX5CAY.js} +7 -7
  6. package/{agentDeleteCommand-Q6M4F3U6.js → agentDeleteCommand-LQSOJEXY.js} +75 -76
  7. package/{agentEmailCommands-FNH6FEHS.js → agentEmailCommands-HTPKXONW.js} +78 -79
  8. package/{agentListCommands-JUNMFS6E.js → agentListCommands-GOCGOQUB.js} +36 -36
  9. package/{agentMachineCommands-VNLDEKNT.js → agentMachineCommands-T7DAZG77.js} +35 -32
  10. package/{agentProviderCommands-X2HQE6HY.js → agentProviderCommands-CXBHNONN.js} +5 -5
  11. package/{agentPullCommand-FA43RBRU.js → agentPullCommand-GXXEDOSA.js} +4 -4
  12. package/{agentRecordCommands-47XXRVPI.js → agentRecordCommands-HSW3RJ4H.js} +72 -73
  13. package/{agentRunCommand-QEXFJUXQ.js → agentRunCommand-TIRJ57DK.js} +75 -75
  14. package/{agentRunControl-2C5GM3BW.js → agentRunControl-QWFFIAQY.js} +9 -7
  15. package/{agentRuntimeLocal-O5GDAFTN.js → agentRuntimeLocal-J6I63NZC.js} +21 -19
  16. package/{agentSlice-E3XS5FTQ.js → agentSlice-JNM3HF3V.js} +8 -8
  17. package/{appDeleteCommands-C2J5RQ3I.js → appDeleteCommands-KKLAK2UR.js} +31 -29
  18. package/{appDeployCommands-3YRK7PSU.js → appDeployCommands-PXWK4FAX.js} +31 -29
  19. package/{appDeployStatusCommands-FPAX7MOK.js → appDeployStatusCommands-3NGWDZTX.js} +31 -29
  20. package/{appGetCommands-XAC2V766.js → appGetCommands-APWYPEO3.js} +31 -29
  21. package/{appListCommands-ZJL2W5O7.js → appListCommands-OP7IRALO.js} +31 -29
  22. package/{authCommand-J3XILHWW.js → authCommand-3Z52KJID.js} +22 -302
  23. package/{authCommands-77CHYBGF.js → authCommands-QOCKVPX3.js} +5 -5
  24. package/{builtinSkillRegistry-A6VSPJEJ.js → builtinSkillRegistry-LJV7FHNI.js} +4 -4
  25. package/{chromeCommands-OBBNJCLS.js → chromeCommands-IY4NVSXZ.js} +17 -10
  26. package/{chunk-SW4S4XYB.js → chunk-2AB2HA4M.js} +84 -34
  27. package/{chunk-C5VPAHIU.js → chunk-32ZKZET7.js} +1 -1
  28. package/{chunk-XPWGOTBQ.js → chunk-3L2WKC3W.js} +1 -8
  29. package/{chunk-3XZKV7QQ.js → chunk-3L5MSPWX.js} +1 -1
  30. package/{chunk-QLQ573SU.js → chunk-3M52COK5.js} +120 -0
  31. package/{chunk-VSOWPETY.js → chunk-4226O6F7.js} +10 -10
  32. package/{chunk-Z6KQDSZW.js → chunk-43OFVLWJ.js} +6 -6
  33. package/{chunk-TJ2VPCBE.js → chunk-4JCAW7TO.js} +2 -2
  34. package/{chunk-6TF64IF2.js → chunk-4L4K6YR7.js} +16 -2
  35. package/{chunk-PEO24UB5.js → chunk-5E5VB7PS.js} +324 -57
  36. package/{chunk-ZD2BLOY6.js → chunk-5EDQTOUR.js} +7 -7
  37. package/{chunk-HKT6QXP3.js → chunk-5IKRTRRR.js} +5 -5
  38. package/{chunk-P5QACQDK.js → chunk-62TBKWTV.js} +1 -1
  39. package/{chunk-TRW43TSC.js → chunk-6EQD4AQL.js} +41 -1
  40. package/{chunk-YLMMECCH.js → chunk-6XIE5ZGI.js} +1 -1
  41. package/{chunk-OH2M7WEU.js → chunk-6Y3ETA2Y.js} +3 -3
  42. package/{chunk-7A4LJCDR.js → chunk-B3ZIFOFI.js} +5 -5
  43. package/{chunk-WZ6OU4NX.js → chunk-BAWAKW7X.js} +2 -2
  44. package/{chunk-UUPR3TD7.js → chunk-BL4HFN6L.js} +2 -4
  45. package/{chunk-2GGXHQIW.js → chunk-BLVSFYQ3.js} +4 -2
  46. package/{chunk-HP6O6LTV.js → chunk-CDLP56BS.js} +9 -9
  47. package/{chunk-UTIMX333.js → chunk-DJ2BOPJY.js} +1 -1
  48. package/{chunk-36OMEXXR.js → chunk-DLV3H464.js} +8 -8
  49. package/{chunk-CE7PIHQD.js → chunk-ESMZW5PE.js} +3 -3
  50. package/{chunk-PSJWPSKS.js → chunk-EWO77ZGF.js} +9 -43
  51. package/{chunk-ZWG3C7VI.js → chunk-F3SOW2EU.js} +81 -1
  52. package/{chunk-FY4SDK2E.js → chunk-FDLDMJTM.js} +1 -1
  53. package/{chunk-KOB75UNU.js → chunk-FHG46N5C.js} +53 -4
  54. package/{chunk-7KYVUFDG.js → chunk-G3VYRPTV.js} +5 -267
  55. package/{chunk-DW7MGLMG.js → chunk-GGUTTH6C.js} +35 -207
  56. package/{chunk-6MJNEXUU.js → chunk-HGDKT2D6.js} +4 -0
  57. package/{chunk-B2EGWZJG.js → chunk-I7S63QUU.js} +1 -1
  58. package/{chunk-ROPSATAB.js → chunk-IF7V3CBU.js} +1 -1
  59. package/chunk-IKOKYBYJ.js +2685 -0
  60. package/{chunk-T6CBQ6BN.js → chunk-INFHX73M.js} +1 -1
  61. package/{chunk-YBNHPX4S.js → chunk-IW64YHXL.js} +155 -31
  62. package/{chunk-K43ZF2C3.js → chunk-JPPQ3GUO.js} +1 -1
  63. package/{chunk-TZTWMGE3.js → chunk-JWEXJ573.js} +3 -3
  64. package/{chunk-RUNKPFM5.js → chunk-K6Y5T4GE.js} +12 -8
  65. package/{chunk-MVJVF4ED.js → chunk-KESKU5BG.js} +18 -17
  66. package/{chunk-I2ZMGXXF.js → chunk-KFHREHUQ.js} +1 -1
  67. package/{chunk-3C2QLERX.js → chunk-KMDDG73K.js} +1 -1
  68. package/{chunk-5MM7NNO6.js → chunk-KSTEXKL6.js} +78 -39
  69. package/{chunk-EM3YOZJ4.js → chunk-L2JMH4I5.js} +3 -3
  70. package/{chunk-MM3662RS.js → chunk-LPO6AMQU.js} +780 -64
  71. package/{chunk-D4OWHT5Y.js → chunk-MAYW6V3E.js} +2 -2
  72. package/{chunk-IPAW7XLD.js → chunk-MFVOJ6KF.js} +2 -2
  73. package/{chunk-FDT27L7S.js → chunk-MLEANT7D.js} +19 -17
  74. package/{chunk-7GC3EKUG.js → chunk-MMSQTZCJ.js} +3 -3
  75. package/{chunk-XFKZ3MCV.js → chunk-MR3ITQEV.js} +344 -88
  76. package/{chunk-CBHGZRCE.js → chunk-MYOH447Z.js} +1 -1
  77. package/{chunk-6MPAEODB.js → chunk-NHEWV5FD.js} +17 -3
  78. package/{chunk-ZEHTARJA.js → chunk-NLFTBC6S.js} +321 -150
  79. package/{chunk-SKPPKHD3.js → chunk-OLUKIUX6.js} +2 -2
  80. package/{chunk-SUKSWFLP.js → chunk-PIG2IUVZ.js} +1 -1
  81. package/{chunk-SEJ5OS6F.js → chunk-PXYBUFDB.js} +4 -0
  82. package/{chunk-2MTE2PEH.js → chunk-QA2C5NKI.js} +5 -739
  83. package/{chunk-L6EQV5OC.js → chunk-QXZH5UDF.js} +3 -3
  84. package/{chunk-TNIX77YM.js → chunk-R5GO3YZP.js} +34 -1
  85. package/{chunk-X5SUT4CN.js → chunk-R7GCGOGZ.js} +6 -6
  86. package/{chunk-4Z245KOA.js → chunk-SH3XD4E2.js} +8 -4
  87. package/{chunk-JGRPBIZZ.js → chunk-SQX235S2.js} +1 -1
  88. package/chunk-TT644UJD.js +188 -0
  89. package/{chunk-IYBIRCQV.js → chunk-U34KT53V.js} +29 -11
  90. package/{chunk-ANJTRG52.js → chunk-ULQAD7ZY.js} +18 -43
  91. package/{chunk-QDA4Y5O6.js → chunk-UVYSBQ2M.js} +21 -17
  92. package/{chunk-I2RMFLLH.js → chunk-V7PCFWX3.js} +1 -1
  93. package/{chunk-HXHSTRGH.js → chunk-VYNMQ6HW.js} +0 -27
  94. package/{chunk-G47IPDOK.js → chunk-W7FGZRLK.js} +1 -1
  95. package/{chunk-7BSQK2UC.js → chunk-WRCZXJ4N.js} +2 -2
  96. package/{chunk-KX6LPG7W.js → chunk-WYJTNSVL.js} +9 -9
  97. package/{chunk-H4KACZMG.js → chunk-XZIW3Q5B.js} +271 -138
  98. package/chunk-Y5GCAMGP.js +9 -0
  99. package/{chunk-JZX2XLKC.js → chunk-YCRROBDY.js} +1 -1
  100. package/{chunk-FPWT3RH2.js → chunk-YN5DT4JS.js} +22 -22
  101. package/{chunk-SCJD2PNK.js → chunk-YPG7TUQD.js} +3 -3
  102. package/{chunk-EJU23ST5.js → chunk-ZKVS36H3.js} +5069 -3730
  103. package/{chunk-YANF2RR4.js → chunk-ZPKUJROL.js} +1 -1
  104. package/{chunk-TYND6RDQ.js → chunk-ZZDVBZOP.js} +74 -3
  105. package/{commandRegistry-OUBQIF62.js → commandRegistry-DR2RPWK6.js} +88 -96
  106. package/{contentThunks-B3FRQGP7.js → contentThunks-CSJDJDEJ.js} +21 -21
  107. package/{createAgentAutomationAction-T2YFJ6MY.js → createAgentAutomationAction-ISEUEQSY.js} +21 -21
  108. package/{createDialogAction-2NFGFBXW.js → createDialogAction-HUCFOZY3.js} +25 -25
  109. package/{createPageAction-LDAVZDN7.js → createPageAction-DT5CYXCL.js} +24 -25
  110. package/{dbSlice-5QGKMQLO.js → dbSlice-6PVPY44C.js} +7 -7
  111. package/{deleteFile-EW6QNRRT.js → deleteFile-YM6NDPAR.js} +5 -5
  112. package/{dialogCommands-ZLBEAQHE.js → dialogCommands-3W6AIUXT.js} +35 -32
  113. package/{dialogSlice-64S3J6CP.js → dialogSlice-WJEEPG4W.js} +20 -20
  114. package/{dist-NJC2W7I4.js → dist-Q2JSMAKA.js} +7 -361
  115. package/{docCreateCommands-XOG5BBFQ.js → docCreateCommands-KQHQNLRX.js} +32 -30
  116. package/{docDeleteCommands-NCW3BBRX.js → docDeleteCommands-O3DWFX2W.js} +33 -31
  117. package/{docReadCommands-OT7X44Y3.js → docReadCommands-2U2BUONC.js} +32 -30
  118. package/{docStore-NIP7OO4I.js → docStore-7JPYT25V.js} +8 -8
  119. package/{docUpdateCommands-JW7OWW2J.js → docUpdateCommands-MF3C52XI.js} +32 -30
  120. package/{getPricing-TX35D7PI.js → getPricing-XQ3N3RBP.js} +2 -2
  121. package/{handleSendMessageAction-TOKA7ED7.js → handleSendMessageAction-BV5FMID4.js} +43 -39
  122. package/index.js +8 -8
  123. package/{localRuntimeAdapter-EQM6LFYC.js → localRuntimeAdapter-6FBEJJ4D.js} +70 -69
  124. package/{localRuntimeAuthority-JDAD7CB6.js → localRuntimeAuthority-BPN5OAQG.js} +2 -2
  125. package/{localRuntimeDb-CVC62PM5.js → localRuntimeDb-QIVAXMUL.js} +1 -1
  126. package/{machineCommands-WJ7FZ67T.js → machineCommands-WCAFDI5N.js} +80 -79
  127. package/{machineWsRunDispatch-BQT4DEA2.js → machineWsRunDispatch-ZF6BBQ3X.js} +70 -71
  128. package/{memberThunks-KRV5YXOB.js → memberThunks-AZINUM4S.js} +10 -10
  129. package/package.json +6 -2
  130. package/{profileConfig-ZGOFORWV.js → profileConfig-KN3N2BLF.js} +7 -1
  131. package/{providerPresetApply-CRZFMQD5.js → providerPresetApply-PKUOHQJT.js} +5 -5
  132. package/{providerRegistry-7IS43D3X.js → providerRegistry-HNQLIFN2.js} +5 -5
  133. package/{read-5KAZHHDM.js → read-7JPIWRBQ.js} +5 -5
  134. package/{readDocTool-5QO34OSX.js → readDocTool-AAQTB2Y3.js} +1 -1
  135. package/{readlineWorkspace-JHJSU5DS.js → readlineWorkspace-I5MHMEUE.js} +375 -200
  136. package/{removeDialogAgentAction-6X63HMI3.js → removeDialogAgentAction-RMVRILLK.js} +9 -9
  137. package/{runAgentClientLoop-5QIGEALK.js → runAgentClientLoop-TSNSRQEP.js} +59 -54
  138. package/{runtimeDoctorCommands-56NWKNON.js → runtimeDoctorCommands-MMCP4B4U.js} +12 -12
  139. package/{secretCommands-ZXZRLR3R.js → secretCommands-DNY56NSU.js} +11 -1
  140. package/{setDialogExtraReferencesAction-4MAYKKYW.js → setDialogExtraReferencesAction-L3V7JTMG.js} +8 -8
  141. package/{setPrimaryDialogAgentAction-EGBAMREH.js → setPrimaryDialogAgentAction-X52JQGTJ.js} +9 -9
  142. package/settingThunks-N6XFWPOU.js +923 -0
  143. package/{spaceCommands-ZWDPTURU.js → spaceCommands-NDPGHDMD.js} +29 -27
  144. package/{streamAgentChatTurn-456DWXNY.js → streamAgentChatTurn-RJLDV4WZ.js} +154 -95
  145. package/{switchDialogAgentAction-YBKTD6DO.js → switchDialogAgentAction-ZJ5CGU7J.js} +7 -7
  146. package/{tableCommands-U3QDY4L6.js → tableCommands-IVC5S7Y3.js} +11 -11
  147. package/{toolApiClient-7WSJJJBV.js → toolApiClient-HGNO53TC.js} +2 -2
  148. package/{tools-IWNXKK4Y.js → tools-X6QNIYFJ.js} +43 -44
  149. package/{tuiSummaryLlmCaller-KLK6K3Q3.js → tuiSummaryLlmCaller-FESHBDTT.js} +7 -7
  150. package/{updateCommands-NQXAGFM7.js → updateCommands-FJHGWD3Q.js} +5 -3
  151. package/{updateDialogTitleAction-SX53FZWO.js → updateDialogTitleAction-6LURCTMG.js} +21 -21
  152. package/{workloadLifecycle-36DXRZKU.js → workloadLifecycle-6O6PMISX.js} +2 -2
  153. package/chunk-IA7TRNNR.js +0 -11
  154. package/chunk-UKZX3NHN.js +0 -48
  155. package/chunk-VAZHH6FO.js +0 -7012
  156. package/chunk-W4S6OTSC.js +0 -35
  157. package/clipboardy-GCO3GT3I.js +0 -11793
  158. package/settingThunks-FTDRZNSJ.js +0 -1371
  159. package/{agentGrantCommands-HOJ3JBBQ.js → agentGrantCommands-5DPHYEKP.js} +3 -3
  160. package/{chromeOpsCommands-3Z34RKSE.js → chromeOpsCommands-GZVVK7HU.js} +4 -4
  161. package/{chunk-XETG4RIX.js → chunk-AETZ7AD6.js} +4 -4
  162. package/{chunk-2IXDJNZI.js → chunk-GAGGEA7D.js} +3 -3
  163. package/{memoryCommands-CUNBFRVS.js → memoryCommands-ZS3VQJAL.js} +3 -3
  164. package/{offlineMarxistsAgentCommand-2QTHJCHV.js → offlineMarxistsAgentCommand-3GLX4QQY.js} +3 -3
@@ -5,10 +5,10 @@ import {
5
5
  } from "./chunk-NBTY7YJF.js";
6
6
  import {
7
7
  resolveCliLocalRuntimeKeyCapability
8
- } from "./chunk-XFKZ3MCV.js";
8
+ } from "./chunk-MR3ITQEV.js";
9
9
  import {
10
10
  HIGH_RISK_MUTATION_TOOL_NAMES
11
- } from "./chunk-QLQ573SU.js";
11
+ } from "./chunk-3M52COK5.js";
12
12
  import {
13
13
  DEFAULT_NOLO_SERVER_URL
14
14
  } from "./chunk-OLZBQWZU.js";
@@ -21,6 +21,7 @@ import {
21
21
 
22
22
  // packages/cli/agentRunArgs.ts
23
23
  import { readFileSync } from "node:fs";
24
+ import { isAbsolute } from "node:path";
24
25
  function readFlagValue(args, flag) {
25
26
  const index = args.indexOf(flag);
26
27
  if (index < 0) return void 0;
@@ -78,7 +79,8 @@ var VALUELESS_FLAGS = {
78
79
  "--ephemeral": true,
79
80
  "--memory-only": true,
80
81
  "--read-only": true,
81
- "--machine-shell": true
82
+ "--machine-shell": true,
83
+ "--instabox-allow-remote-release": true
82
84
  };
83
85
  function isValuelessFlag(arg) {
84
86
  return Object.prototype.hasOwnProperty.call(VALUELESS_FLAGS, arg);
@@ -150,7 +152,7 @@ function writeUsage(output, commandPath) {
150
152
  return;
151
153
  }
152
154
  output.write(
153
- "Usage: nolo agent run <agent> <message> [--local|--server|--auto] [--runtime-key <key>] [--ephemeral|--memory-only] [--continue <dialogId>] [--cwd <path>]\n nolo agent run --agent <agent> (--msg <message>|--msg-file <path>) [--image <url-or-path>] [--space <spaceId>] [--category <name>] [--inherit-from-dialog <dialog>] [--parent-dialog <dialog>] [--subject-dialog <dialog>] [--subject-ref <kind:id[:role]>] [--task-row-dbkey <key>] [--fallback-agent <agent>] (suggestions for agent to decide on quota) [--allowed-tool <tool>] [--blocked-tool <tool>] [--read-only] [--runtime-key <key>] [--machine-shell] [--dod <cmd>] [--bg] [--timeout-ms <n>] [--events jsonl] [--no-stream] [--skill <dbKey-or-md-path>]\n"
155
+ "Usage: nolo agent run <agent> <message> [--local|--server|--auto] [--runtime-key <key>] [--docker-workspace-mode git|empty] [--instabox-workspace empty|snapshot] [--instabox-manifest <path>] [--instabox-artifact-dir <path>] [--instabox-allow-remote-release] [--instabox-allow-paid] [--ephemeral|--memory-only] [--continue <dialogId>] [--cwd <path>]\n nolo agent run --agent <agent> (--msg <message>|--msg-file <path>) [--image <url-or-path>] [--space <spaceId>] [--category <name>] [--inherit-from-dialog <dialog>] [--parent-dialog <dialog>] [--subject-dialog <dialog>] [--subject-ref <kind:id[:role]>] [--task-row-dbkey <key>] [--fallback-agent <agent>] (suggestions for agent to decide on quota) [--allowed-tool <tool>] [--blocked-tool <tool>] [--read-only] [--runtime-key <key>] [--docker-workspace-mode git|empty] [--instabox-workspace empty|snapshot] [--instabox-manifest <path>] [--instabox-artifact-dir <path>] [--instabox-allow-remote-release] [--instabox-allow-paid] [--machine-shell] [--dod <cmd>] [--bg] [--timeout-ms <n>] [--events jsonl] [--no-stream] [--skill <dbKey-or-md-path>]\n"
154
156
  );
155
157
  }
156
158
  function parseAgentRunArgs(args, options = {}) {
@@ -166,6 +168,21 @@ function parseAgentRunArgs(args, options = {}) {
166
168
  const message = rawMessage.trim();
167
169
  const rawRuntimeKey = readFlagValue(args, "--runtime-key");
168
170
  const runtimeKey = rawRuntimeKey?.trim();
171
+ const rawDockerWorkspaceMode = readFlagValue(args, "--docker-workspace-mode")?.trim();
172
+ if (args.includes("--docker-workspace-mode") && rawDockerWorkspaceMode !== "git" && rawDockerWorkspaceMode !== "empty") {
173
+ throw new Error("--docker-workspace-mode \u5FC5\u987B\u662F git \u6216 empty");
174
+ }
175
+ const dockerWorkspaceMode = rawDockerWorkspaceMode;
176
+ if (dockerWorkspaceMode && !/^docker(:.+)?$/.test(runtimeKey ?? "")) {
177
+ throw new Error("--docker-workspace-mode \u4EC5\u9002\u7528\u4E8E --runtime-key docker[:runtimeId]");
178
+ }
179
+ const dockerWorkspaceModeRuntimeMode = runtimeModeFromArgs(args);
180
+ const dockerWorkspaceModeImplicitLocal = !dockerWorkspaceModeRuntimeMode && (isFullstackCodingAgentRef(rawAgentKey, agentKey) || isLocalCliAgentKey(agentKey) || args.includes("--dangerously-allow-shell"));
181
+ if (dockerWorkspaceMode && dockerWorkspaceModeRuntimeMode !== "local" && !dockerWorkspaceModeImplicitLocal) {
182
+ throw new Error(
183
+ "--docker-workspace-mode \u9700\u8981\u672C\u673A\u6267\u884C\u8DEF\u5F84\uFF1A\u4E0D\u5E26 --local \u65F6 runtimeMode \u89E3\u6790\u4E3A auto\uFF0C\u8BE5\u53C2\u6570\u4F1A\u88AB\u9759\u9ED8\u4E22\u5F03\u5E76\u6539\u8D70\u670D\u52A1\u7AEF\u6D3E\u53D1\u3002\u8BF7\u52A0 --local\uFF1B\u9690\u5F0F local\uFF08fullstack / local-cli agent / --dangerously-allow-shell\uFF09\u540C\u6837\u88AB\u63A5\u53D7\u3002"
184
+ );
185
+ }
169
186
  if (args.includes("--runtime-key") && !runtimeKey) {
170
187
  throw new Error(
171
188
  "runtimeKey \u5FC5\u987B\u662F\u975E\u7A7A\u7684 listRuntimes key\uFF08local | server | machine:<machineId> | docker | docker:<runtimeId> | instabox | gcp\uFF09"
@@ -190,6 +207,32 @@ function parseAgentRunArgs(args, options = {}) {
190
207
  "\u4E0D\u80FD\u540C\u65F6\u6307\u5B9A --machine-shell \u4E0E --runtime-key\uFF1A--machine-shell \u5DF2\u628A\u6D3E\u53D1\u9501\u5230\u7ED1\u5B9A\u673A\u5668\u7684 server \u901A\u9053\uFF0CruntimeKey \u4F1A\u5931\u6548\uFF0C\u8BF7\u53EA\u4FDD\u7559\u5176\u4E2D\u4E00\u4E2A"
191
208
  );
192
209
  }
210
+ const rawInstaboxWorkspace = readFlagValue(args, "--instabox-workspace")?.trim();
211
+ const rawInstaboxManifest = readFlagValue(args, "--instabox-manifest")?.trim();
212
+ const rawInstaboxArtifactDir = readFlagValue(args, "--instabox-artifact-dir")?.trim();
213
+ const instaboxAllowRemoteRelease = args.includes("--instabox-allow-remote-release");
214
+ const instaboxAllowPaid = args.includes("--instabox-allow-paid");
215
+ const hasInstaboxFlags = args.includes("--instabox-workspace") || args.includes("--instabox-manifest") || args.includes("--instabox-artifact-dir") || instaboxAllowRemoteRelease || instaboxAllowPaid;
216
+ if (hasInstaboxFlags && runtimeKey !== "instabox") {
217
+ throw new Error("--instabox-* \u53C2\u6570\u4EC5\u9002\u7528\u4E8E --runtime-key instabox");
218
+ }
219
+ if (runtimeKey === "instabox") {
220
+ if (!rawInstaboxWorkspace || rawInstaboxWorkspace !== "empty" && rawInstaboxWorkspace !== "snapshot") {
221
+ throw new Error("--runtime-key instabox \u5FC5\u987B\u6307\u5B9A --instabox-workspace empty|snapshot");
222
+ }
223
+ if (!rawInstaboxArtifactDir) {
224
+ throw new Error("--runtime-key instabox \u5FC5\u987B\u6307\u5B9A --instabox-artifact-dir <\u7EDD\u5BF9\u8DEF\u5F84>");
225
+ }
226
+ if (!isAbsolute(rawInstaboxArtifactDir) || rawInstaboxArtifactDir.includes("\0") || rawInstaboxArtifactDir.split("/").includes("..")) {
227
+ throw new Error(`--instabox-artifact-dir \u5FC5\u987B\u4E3A\u5408\u6CD5\u7EDD\u5BF9\u8DEF\u5F84\uFF0C\u4E14\u4E0D\u80FD\u5305\u542B .. \u6216\u7A7A\u5B57\u7B26: "${rawInstaboxArtifactDir}"`);
228
+ }
229
+ if (rawInstaboxWorkspace === "snapshot" && !rawInstaboxManifest) {
230
+ throw new Error("--instabox-workspace snapshot \u5FC5\u987B\u6307\u5B9A --instabox-manifest <\u6587\u4EF6\u8DEF\u5F84>");
231
+ }
232
+ if (rawInstaboxWorkspace === "empty" && args.includes("--instabox-manifest")) {
233
+ throw new Error("--instabox-workspace empty \u4E0D\u5F97\u6307\u5B9A --instabox-manifest");
234
+ }
235
+ }
193
236
  const runtimeMode = runtimeModeFromArgs(args);
194
237
  const continueDialogId = readFlagValue(args, "--continue") ?? readFlagValue(args, "--dialog");
195
238
  const spaceId = readFlagValue(args, "--space");
@@ -244,6 +287,12 @@ function parseAgentRunArgs(args, options = {}) {
244
287
  } : {},
245
288
  ...runtimeMode ? { runtimeMode } : !runtimeKey && (fullstackLocalWorkspaceDefault || explicitLocalCliAgentDefault || args.includes("--dangerously-allow-shell")) ? { runtimeMode: "local" } : {},
246
289
  ...runtimeKey ? { runtimeKey } : {},
290
+ ...dockerWorkspaceMode ? { dockerWorkspaceMode } : {},
291
+ ...rawInstaboxWorkspace ? { instaboxWorkspace: rawInstaboxWorkspace } : {},
292
+ ...rawInstaboxManifest ? { instaboxManifestPath: rawInstaboxManifest } : {},
293
+ ...rawInstaboxArtifactDir ? { instaboxArtifactDir: rawInstaboxArtifactDir } : {},
294
+ ...instaboxAllowRemoteRelease ? { instaboxAllowRemoteRelease: true } : {},
295
+ ...instaboxAllowPaid ? { instaboxAllowPaid: true } : {},
247
296
  background: args.includes("--bg"),
248
297
  noStream: args.includes("--no-stream"),
249
298
  machineShell: args.includes("--machine-shell"),
@@ -1,3 +1,7 @@
1
+ import {
2
+ buildEnvFromProfile,
3
+ loadProfileConfig
4
+ } from "./chunk-R5GO3YZP.js";
1
5
  import {
2
6
  ANTIGRAVITY_AUTH_URL,
3
7
  ANTIGRAVITY_CALLBACK_PATH,
@@ -11,7 +15,7 @@ import {
11
15
  getAntigravityUserAgent,
12
16
  normalizeAntigravityTokenPayload,
13
17
  refreshAntigravityToken
14
- } from "./chunk-JGRPBIZZ.js";
18
+ } from "./chunk-SQX235S2.js";
15
19
  import {
16
20
  asOptionalFiniteNumber
17
21
  } from "./chunk-WWC7I6TA.js";
@@ -24,10 +28,6 @@ import {
24
28
  import {
25
29
  toErrorMessage
26
30
  } from "./chunk-HNMXYYJR.js";
27
- import {
28
- buildEnvFromProfile,
29
- loadProfileConfig
30
- } from "./chunk-TNIX77YM.js";
31
31
  import {
32
32
  writeOAuthCredential
33
33
  } from "./chunk-ZWQUWF6W.js";
@@ -868,257 +868,6 @@ function resolveServerSyncConfig() {
868
868
  return null;
869
869
  }
870
870
 
871
- // packages/agent-runtime/workbuddyOAuth.ts
872
- var WORKBUDDY_APP_VERSION = "2.0.0";
873
- var WORKBUDDY_UA_VERSION = "5.5.6";
874
- var WORKBUDDY_POLL_INTERVAL_MS = 1e3;
875
- var WORKBUDDY_SIGN_IN_TIMEOUT_MS = 5 * 60 * 1e3;
876
- var WORKBUDDY_EARLY_REFRESH_SKEW_MS = 60 * 1e3;
877
- var WORKBUDDY_KEEP_RENEWED_MS = 60 * 1e3;
878
- var WORKBUDDY_REQUEST_TIMEOUT_MS = 3e4;
879
- var WORKBUDDY_SITES = {
880
- workbuddy: {
881
- id: "workbuddy",
882
- name: "WorkBuddy",
883
- endpoint: "https://copilot.tencent.com",
884
- authId: "workbuddy-desktop",
885
- platform: "workbuddy",
886
- ai: false
887
- },
888
- "workbuddy-ai": {
889
- id: "workbuddy-ai",
890
- name: "WorkBuddy AI",
891
- endpoint: "https://www.workbuddy.ai",
892
- authId: "workbuddy-desktop-ai",
893
- platform: "workbuddy-ai",
894
- ai: true
895
- }
896
- };
897
- function getWorkBuddySite(site) {
898
- if (site === "workbuddy" || site === "workbuddy-ai") {
899
- return WORKBUDDY_SITES[site];
900
- }
901
- throw new Error(`Unknown WorkBuddy site: "${String(site)}". Expected "workbuddy" or "workbuddy-ai".`);
902
- }
903
- function sanitizeWorkBuddyError(message) {
904
- return message.replace(/Bearer\s+[A-Za-z0-9._~+/-]+=*/gi, "Bearer [REDACTED]").replace(/([?&]|\b)(state|token|accessToken|refreshToken)=[^&\s]+/gi, "$1$2=[REDACTED]").replace(/(["']?(?:accessToken|refreshToken|state|token)["']?\s*:\s*["'])[^"']+["']/gi, '$1[REDACTED]"');
905
- }
906
- function sanitizeWorkBuddyDomain(rawDomain, defaultHost) {
907
- if (typeof rawDomain !== "string" || !rawDomain.trim()) {
908
- return defaultHost;
909
- }
910
- let domain = rawDomain.trim();
911
- if (domain.startsWith("https://") || domain.startsWith("http://")) {
912
- try {
913
- domain = new URL(domain).host;
914
- } catch {
915
- return defaultHost;
916
- }
917
- }
918
- const slashIdx = domain.indexOf("/");
919
- if (slashIdx !== -1) domain = domain.slice(0, slashIdx);
920
- const qIdx = domain.indexOf("?");
921
- if (qIdx !== -1) domain = domain.slice(0, qIdx);
922
- if (!/^[a-zA-Z0-9.-]+(?::[0-9]+)?$/.test(domain)) {
923
- return defaultHost;
924
- }
925
- return domain;
926
- }
927
- function normalizeWorkBuddyTokenPayload(siteOrArgs, payloadArg, baseCredentialArg, nowArg) {
928
- let site;
929
- let payload;
930
- let baseCredential;
931
- let now;
932
- if (typeof siteOrArgs === "object" && siteOrArgs !== null && "site" in siteOrArgs) {
933
- site = siteOrArgs.site;
934
- payload = siteOrArgs.payload ?? {};
935
- baseCredential = siteOrArgs.baseCredential;
936
- now = siteOrArgs.now ?? Date.now();
937
- } else {
938
- site = siteOrArgs;
939
- payload = payloadArg ?? {};
940
- baseCredential = baseCredentialArg;
941
- now = nowArg ?? Date.now();
942
- }
943
- const siteConfig = getWorkBuddySite(site);
944
- if (typeof payload.accessToken !== "string" || !payload.accessToken.trim()) {
945
- throw new Error("WorkBuddy token response missing accessToken");
946
- }
947
- const accessToken = payload.accessToken.trim();
948
- let expiresAt;
949
- const rawExpiresAt = Number(payload.expiresAt);
950
- const rawExpiresIn = Number(payload.expiresIn);
951
- if (Number.isFinite(rawExpiresAt) && rawExpiresAt > 0) {
952
- expiresAt = rawExpiresAt;
953
- } else if (Number.isFinite(rawExpiresIn) && rawExpiresIn > 0) {
954
- expiresAt = now + rawExpiresIn * 1e3;
955
- } else if (typeof baseCredential?.expiresAt === "number") {
956
- expiresAt = baseCredential.expiresAt;
957
- } else {
958
- expiresAt = now + 3600 * 1e3;
959
- }
960
- let refreshExpiresAt;
961
- const rawRefExpAt = Number(payload.refreshExpiresAt);
962
- const rawRefExpIn = Number(payload.refreshExpiresIn);
963
- if (Number.isFinite(rawRefExpAt) && rawRefExpAt > 0) {
964
- refreshExpiresAt = rawRefExpAt;
965
- } else if (Number.isFinite(rawRefExpIn) && rawRefExpIn > 0) {
966
- refreshExpiresAt = now + rawRefExpIn * 1e3;
967
- } else if (typeof baseCredential?.metadata?.refreshExpiresAt === "number") {
968
- refreshExpiresAt = baseCredential.metadata.refreshExpiresAt;
969
- }
970
- const refreshToken = typeof payload.refreshToken === "string" && payload.refreshToken.trim() ? payload.refreshToken.trim() : baseCredential?.refreshToken;
971
- const uid = typeof payload.uid === "string" && payload.uid.trim() ? payload.uid.trim() : typeof baseCredential?.metadata?.uid === "string" && baseCredential.metadata.uid.trim() ? baseCredential.metadata.uid.trim() : baseCredential?.accountId ?? "";
972
- const defaultHost = new URL(siteConfig.endpoint).host;
973
- const domain = sanitizeWorkBuddyDomain(
974
- payload.domain ?? baseCredential?.metadata?.domain,
975
- defaultHost
976
- );
977
- const rawEnterpriseId = typeof payload.enterpriseId === "string" ? payload.enterpriseId : typeof baseCredential?.metadata?.enterpriseId === "string" ? baseCredential.metadata.enterpriseId : "";
978
- const enterpriseId = rawEnterpriseId.trim();
979
- const nickname = typeof payload.nickname === "string" && payload.nickname.trim() ? payload.nickname.trim() : typeof payload.phoneNumber === "string" && payload.phoneNumber.trim() ? payload.phoneNumber.trim() : typeof baseCredential?.metadata?.nickname === "string" ? baseCredential.metadata.nickname : void 0;
980
- return {
981
- ...baseCredential ?? {},
982
- provider: site,
983
- accessToken,
984
- ...refreshToken ? { refreshToken } : {},
985
- expiresAt,
986
- obtainedAt: now,
987
- accountId: uid || nickname || siteConfig.name,
988
- metadata: {
989
- site,
990
- uid,
991
- domain,
992
- ...enterpriseId ? { enterpriseId } : {},
993
- ...refreshExpiresAt ? { refreshExpiresAt } : {},
994
- ...nickname ? { nickname } : {}
995
- }
996
- };
997
- }
998
- var renewing = /* @__PURE__ */ new Map();
999
- var renewed = /* @__PURE__ */ new Map();
1000
- function getWorkBuddyRefreshKey(site, credential) {
1001
- const accountOrUid = credential.accountId || credential.metadata?.uid || "";
1002
- const token = credential.refreshToken || "";
1003
- return `${site}
1004
- ${accountOrUid}
1005
- ${token}`;
1006
- }
1007
- async function refreshWorkBuddyToken(credential, deps = {}) {
1008
- if (!credential.refreshToken) {
1009
- throw new Error("WorkBuddy credential has no refresh_token");
1010
- }
1011
- const now = deps.now?.() ?? Date.now();
1012
- const refreshExpiresAt = credential.metadata?.refreshExpiresAt;
1013
- if (typeof refreshExpiresAt === "number" && now >= refreshExpiresAt) {
1014
- throw new Error("this WorkBuddy account is signed out; sign in again");
1015
- }
1016
- const site = credential.metadata?.site === "workbuddy-ai" || credential.provider === "workbuddy-ai" ? "workbuddy-ai" : "workbuddy";
1017
- const siteConfig = getWorkBuddySite(site);
1018
- const key = getWorkBuddyRefreshKey(site, credential);
1019
- const cached = renewed.get(key);
1020
- if (cached && now - cached.at < WORKBUDDY_KEEP_RENEWED_MS) {
1021
- return cached.credential;
1022
- }
1023
- const inflight = renewing.get(key);
1024
- if (inflight) {
1025
- return inflight;
1026
- }
1027
- const fetchImpl = deps.fetchImpl ?? fetch;
1028
- const refreshPromise = (async () => {
1029
- const defaultHost = new URL(siteConfig.endpoint).host;
1030
- const domain = sanitizeWorkBuddyDomain(credential.metadata?.domain, defaultHost);
1031
- const enterpriseId = typeof credential.metadata?.enterpriseId === "string" ? credential.metadata.enterpriseId.trim() : "";
1032
- const headers = {
1033
- "Content-Type": "application/json",
1034
- Accept: "application/json",
1035
- "User-Agent": `WorkBuddy/${WORKBUDDY_UA_VERSION}`,
1036
- "X-Refresh-Token": credential.refreshToken,
1037
- "X-Auth-Refresh-Source": "plugin",
1038
- "X-Domain": domain,
1039
- ...enterpriseId ? { "X-Enterprise-Id": enterpriseId, "X-Tenant-Id": enterpriseId } : {}
1040
- };
1041
- let response;
1042
- try {
1043
- response = await fetchImpl(`${siteConfig.endpoint}/v2/plugin/auth/token/refresh`, {
1044
- method: "POST",
1045
- headers,
1046
- body: "{}",
1047
- signal: AbortSignal.timeout(WORKBUDDY_REQUEST_TIMEOUT_MS)
1048
- });
1049
- } catch (error) {
1050
- throw new Error(sanitizeWorkBuddyError(`WorkBuddy token refresh failed: ${toErrorMessage(error)}`));
1051
- }
1052
- let text = "";
1053
- try {
1054
- text = await response.text();
1055
- } catch {
1056
- }
1057
- let env = {};
1058
- try {
1059
- env = JSON.parse(text);
1060
- } catch {
1061
- }
1062
- const code = typeof env.code === "number" ? env.code : Number.parseInt(String(env.code ?? ""), 10) || 0;
1063
- if (!response.ok) {
1064
- const why = String(env.msg || env.message || text.slice(0, 200) || response.statusText);
1065
- throw new Error(
1066
- sanitizeWorkBuddyError(
1067
- `${siteConfig.name} token refresh failed: ${why} (HTTP ${response.status}${code ? `, code ${code}` : ""})`
1068
- )
1069
- );
1070
- }
1071
- if (code !== 0) {
1072
- const why = String(env.msg || env.message || "error");
1073
- throw new Error(
1074
- sanitizeWorkBuddyError(`${siteConfig.name} token refresh failed: ${why} (${code})`)
1075
- );
1076
- }
1077
- const data = env.data && typeof env.data === "object" ? env.data : env;
1078
- if (typeof data.accessToken !== "string" || !data.accessToken.trim()) {
1079
- throw new Error("WorkBuddy gave no refreshed token");
1080
- }
1081
- const nextCredential = normalizeWorkBuddyTokenPayload(site, data, credential, now);
1082
- renewed.set(key, { credential: nextCredential, at: now });
1083
- return nextCredential;
1084
- })().finally(() => {
1085
- renewing.delete(key);
1086
- });
1087
- renewing.set(key, refreshPromise);
1088
- return refreshPromise;
1089
- }
1090
- var workbuddyRefresh = refreshWorkBuddyToken;
1091
- function getWorkBuddyHeaders(credential) {
1092
- const site = credential.metadata?.site === "workbuddy-ai" || credential.provider === "workbuddy-ai" ? "workbuddy-ai" : "workbuddy";
1093
- const siteConfig = getWorkBuddySite(site);
1094
- const defaultHost = new URL(siteConfig.endpoint).host;
1095
- const domain = sanitizeWorkBuddyDomain(credential.metadata?.domain, defaultHost);
1096
- const uid = typeof credential.metadata?.uid === "string" ? credential.metadata.uid.trim() : credential.accountId ?? "";
1097
- const rawEnterpriseId = typeof credential.metadata?.enterpriseId === "string" ? credential.metadata.enterpriseId.trim() : "";
1098
- const headers = {
1099
- Authorization: `Bearer ${credential.accessToken}`,
1100
- "X-User-Id": uid,
1101
- "X-Domain": domain,
1102
- "X-Product": "SaaS",
1103
- "X-IDE-Type": "WorkBuddy",
1104
- "User-Agent": `WorkBuddy/${WORKBUDDY_UA_VERSION}`,
1105
- "X-Requested-With": "XMLHttpRequest",
1106
- "X-Agent-Intent": "craft",
1107
- "X-Agent-Purpose": "conversation",
1108
- "X-IDE-Name": "WorkBuddy",
1109
- "X-IDE-Version": WORKBUDDY_UA_VERSION
1110
- };
1111
- if (rawEnterpriseId) {
1112
- const cleanEnterpriseId = rawEnterpriseId.replace(/[\r\n]/g, "");
1113
- headers["X-Enterprise-Id"] = cleanEnterpriseId;
1114
- headers["X-Tenant-Id"] = cleanEnterpriseId;
1115
- }
1116
- if (siteConfig.ai) {
1117
- headers["X-Agent-Type"] = "main";
1118
- }
1119
- return headers;
1120
- }
1121
-
1122
871
  // packages/agent-runtime/xaiOAuth.ts
1123
872
  var XAI_OAUTH_ISSUER = "https://auth.x.ai";
1124
873
  var XAI_OAUTH_DISCOVERY_URL = `${XAI_OAUTH_ISSUER}/.well-known/openid-configuration`;
@@ -1497,17 +1246,6 @@ async function refreshCursorToken(credential, deps = {}) {
1497
1246
  var cursorRefresh = refreshCursorToken;
1498
1247
 
1499
1248
  export {
1500
- WORKBUDDY_APP_VERSION,
1501
- WORKBUDDY_UA_VERSION,
1502
- WORKBUDDY_POLL_INTERVAL_MS,
1503
- WORKBUDDY_SIGN_IN_TIMEOUT_MS,
1504
- WORKBUDDY_REQUEST_TIMEOUT_MS,
1505
- getWorkBuddySite,
1506
- sanitizeWorkBuddyError,
1507
- sanitizeWorkBuddyDomain,
1508
- normalizeWorkBuddyTokenPayload,
1509
- workbuddyRefresh,
1510
- getWorkBuddyHeaders,
1511
1249
  startCallbackServer,
1512
1250
  runAntigravityOAuthLogin,
1513
1251
  refreshAntigravityOAuthToken,