nolo-cli 0.209.0-alpha.1 → 0.210.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.
Files changed (97) hide show
  1. package/{_executeModel-C4BBPBMI.js → _executeModel-VVQEOY3D.js} +26 -26
  2. package/{action-HNG2JKWK.js → action-U235TV4P.js} +3 -3
  3. package/{addContentAction-FEN3H2EE.js → addContentAction-7C76J7ST.js} +6 -6
  4. package/{addDialogAgentAction-DDA6S3WS.js → addDialogAgentAction-KTYANUEC.js} +5 -5
  5. package/{agentDeleteCommand-WUCCLXRY.js → agentDeleteCommand-WHRU6VDJ.js} +38 -38
  6. package/{agentEmailCommands-S3TIFYYC.js → agentEmailCommands-ALLHXPW3.js} +38 -38
  7. package/{agentListCommands-AZX2PX4F.js → agentListCommands-POKMEKMS.js} +10 -10
  8. package/{agentMachineCommands-YYYQWXPK.js → agentMachineCommands-WJLZLBPI.js} +8 -8
  9. package/{agentRecordCommands-KA42VBIY.js → agentRecordCommands-OULZW3KM.js} +35 -35
  10. package/{agentRunCommand-AKFBUJY5.js → agentRunCommand-ZNG4LGNQ.js} +40 -40
  11. package/{agentRuntimeLocal-YP5JION7.js → agentRuntimeLocal-YMUHFV5M.js} +7 -7
  12. package/{agentSlice-HFQKZPGI.js → agentSlice-WNGUIMQZ.js} +6 -6
  13. package/{appDeleteCommands-TGZMTUXA.js → appDeleteCommands-6MXPLAVF.js} +7 -7
  14. package/{appDeployCommands-527YN47H.js → appDeployCommands-ERRSVASW.js} +7 -7
  15. package/{appDeployStatusCommands-KUSAKEME.js → appDeployStatusCommands-ULICISLI.js} +7 -7
  16. package/{appGetCommands-5KUXJ4VE.js → appGetCommands-WYYYWROF.js} +7 -7
  17. package/{appListCommands-FJDBOSMG.js → appListCommands-DFCUCRCV.js} +7 -7
  18. package/{authCommand-AUP7FHGM.js → authCommand-ZJMWXFMA.js} +6 -6
  19. package/{chunk-GTQFLOYM.js → chunk-25M2K6OA.js} +2 -2
  20. package/{createPageAction-AO5OKX3T.js → chunk-3J3U3KXB.js} +9 -69
  21. package/{chunk-MOCY5LJI.js → chunk-4WCEC56C.js} +2 -2
  22. package/{chunk-UAOZTOFA.js → chunk-5ORJGHTL.js} +3 -3
  23. package/{chunk-ZKF7ZGN6.js → chunk-7IYBN7IA.js} +4 -4
  24. package/{chunk-IQ52JEVT.js → chunk-ADBWFYJD.js} +5 -5
  25. package/{chunk-HWZT5DKX.js → chunk-BSISWVB4.js} +1 -1
  26. package/chunk-C6KNNXWU.js +185 -0
  27. package/{chunk-QAYCF4CH.js → chunk-DQLB4NQ3.js} +2 -2
  28. package/{chunk-CTZ4O3XD.js → chunk-F6UUQOG6.js} +1 -1
  29. package/{chunk-WYKMOZTW.js → chunk-HD3WR3TD.js} +1 -1
  30. package/{chunk-RXUKDHS5.js → chunk-IIHY4ZAI.js} +1 -1
  31. package/{chunk-5P5RH265.js → chunk-JKW6LERJ.js} +12 -12
  32. package/{chunk-WYOJXAIC.js → chunk-LT3EAHJY.js} +33 -33
  33. package/{chunk-GWXL4KVM.js → chunk-M4NTDZG3.js} +30 -30
  34. package/{chunk-JBFZMJ4J.js → chunk-MBS6CTZB.js} +18 -18
  35. package/{chunk-BXLWFS62.js → chunk-NHQKWPLP.js} +20 -12
  36. package/{chunk-T3U2KQF4.js → chunk-NLT32XBZ.js} +3 -3
  37. package/{chunk-W4MOO6XC.js → chunk-NV572QM3.js} +9 -2
  38. package/{chunk-Z3MQYKRN.js → chunk-NXCGNS4N.js} +2 -2
  39. package/{chunk-B2WYM23T.js → chunk-OP7PTBAJ.js} +4 -4
  40. package/{chunk-6K2AKJAD.js → chunk-PAFTGNWA.js} +2 -2
  41. package/{chunk-GL7W7TTR.js → chunk-QQM464AL.js} +2 -2
  42. package/{chunk-SOEYACRP.js → chunk-RXCCWVA2.js} +2 -2
  43. package/{chunk-KULR4QDX.js → chunk-RYWO5AKN.js} +6 -6
  44. package/{chunk-V77PUU5T.js → chunk-SCYQJPGA.js} +1 -1
  45. package/{chunk-32GANJHJ.js → chunk-UCPAVEQB.js} +1 -1
  46. package/{chunk-OHYCQKPW.js → chunk-UMEGDH6A.js} +6 -6
  47. package/{chunk-TZFDJZLM.js → chunk-V3M6IXQI.js} +31 -31
  48. package/{chunk-W7DFYXGQ.js → chunk-WI6OGHXJ.js} +1 -1
  49. package/{chunk-GITM3OZS.js → chunk-YKFP6UGT.js} +20 -11
  50. package/{chunk-JYL7LFKD.js → chunk-YLTLB5A7.js} +3 -3
  51. package/{chunk-GHSXAOWH.js → chunk-ZN5AH4BY.js} +5 -5
  52. package/{chunk-2VDB25VM.js → chunk-ZOO3WJIE.js} +15 -15
  53. package/{commandRegistry-DYVXLHEI.js → commandRegistry-FI2IOQ3U.js} +58 -58
  54. package/{contentThunks-E4QWF36P.js → contentThunks-5LKNNDGY.js} +12 -12
  55. package/{createAgentAutomationAction-NS3WKF2O.js → createAgentAutomationAction-TI4QG4CY.js} +12 -12
  56. package/{createDialogAction-UG2SNRXX.js → createDialogAction-TJ3JKLO4.js} +13 -13
  57. package/createPageAction-GKXT6WEH.js +80 -0
  58. package/{dbSlice-JK7LWBDO.js → dbSlice-LPMZ2DGJ.js} +5 -5
  59. package/{deleteFile-CE24BROO.js → deleteFile-EPUQHKPA.js} +3 -3
  60. package/desktopFolderProjects-SFY5EZS3.js +45 -0
  61. package/{dialogCommands-T7KQMAQO.js → dialogCommands-IWPXIZ5P.js} +7 -7
  62. package/{dialogSlice-ZR5REV4T.js → dialogSlice-ZWNNS7GZ.js} +10 -10
  63. package/{docCreateCommands-L3ZCQ7XR.js → docCreateCommands-HFSPKJSI.js} +7 -7
  64. package/{docDeleteCommands-HUG57JRT.js → docDeleteCommands-CRL62POH.js} +7 -7
  65. package/{docReadCommands-BYMKBKNL.js → docReadCommands-QOTOX3XW.js} +7 -7
  66. package/{docStore-XWLUIDGI.js → docStore-WYLRB7ED.js} +6 -6
  67. package/{docUpdateCommands-JHJDZRII.js → docUpdateCommands-7BMH4MCA.js} +7 -7
  68. package/{handleSendMessageAction-OSA5S6SH.js → handleSendMessageAction-P27YP2DQ.js} +62 -25
  69. package/index.js +4 -4
  70. package/{localRuntimeAdapter-D3C4PG66.js → localRuntimeAdapter-GP6ZSSO3.js} +34 -34
  71. package/{machineCommands-MSY2I3CV.js → machineCommands-6Z6H4BFX.js} +39 -39
  72. package/{machineWsRunDispatch-JQQ35APL.js → machineWsRunDispatch-F2ZIXMYM.js} +35 -35
  73. package/{memberThunks-WT2KVRP4.js → memberThunks-YSEFJF47.js} +6 -6
  74. package/package.json +1 -1
  75. package/projectArchive-PIGEOX3D.js +121 -0
  76. package/{read-ILTT75DW.js → read-DIIQBOOO.js} +3 -3
  77. package/{readDocTool-374CFJYO.js → readDocTool-HXYGOEA7.js} +1 -1
  78. package/{readlineWorkspace-IPCX6XLM.js → readlineWorkspace-UG25G7KC.js} +53 -53
  79. package/{removeDialogAgentAction-UQFCQO6L.js → removeDialogAgentAction-ALJDUJ2E.js} +7 -7
  80. package/{runAgentClientLoop-Z63BHKC2.js → runAgentClientLoop-IO5F7TCZ.js} +24 -24
  81. package/{setDialogExtraReferencesAction-GBIT7WAG.js → setDialogExtraReferencesAction-O3SVMD5A.js} +6 -6
  82. package/{setPrimaryDialogAgentAction-23PMBXWD.js → setPrimaryDialogAgentAction-HE7RVFFF.js} +7 -7
  83. package/{settingThunks-SWYDFUYT.js → settingThunks-BWWJQG4L.js} +5 -5
  84. package/{skillDiscovery-BKLWW2EZ.js → skillDiscovery-XKHROSH2.js} +2 -2
  85. package/{spaceCommands-BKEULUSP.js → spaceCommands-UAELIFEI.js} +7 -7
  86. package/{streamAgentChatTurn-BCOVALCO.js → streamAgentChatTurn-VUKZQYJR.js} +68 -53
  87. package/{switchDialogAgentAction-O7WTPLKG.js → switchDialogAgentAction-3VZS7SOS.js} +5 -5
  88. package/{tableCommands-QYB64L5I.js → tableCommands-D7WR4QSM.js} +1 -1
  89. package/{tools-56LSBUVX.js → tools-VRXJAVYI.js} +21 -21
  90. package/{tuiSummaryLlmCaller-4QCQ2TIN.js → tuiSummaryLlmCaller-TGCHZLSW.js} +2 -2
  91. package/{updateDialogTitleAction-BFBSDYW2.js → updateDialogTitleAction-MULWCJCW.js} +12 -12
  92. package/{chunk-6Q7UTJKR.js → chunk-AGP3YSEC.js} +0 -0
  93. package/{chunk-SZ4ADZFT.js → chunk-LNYHAKBP.js} +3 -3
  94. package/{chunk-3QKILTO3.js → chunk-NTSRCTUX.js} +3 -3
  95. package/{chunk-3IBHFELR.js → chunk-TCTSYFDM.js} +3 -3
  96. package/{chunk-CMLBKYEI.js → chunk-ZRSNONOB.js} +0 -0
  97. package/{workloadLifecycle-JA75D6JR.js → workloadLifecycle-4BEQHMSD.js} +3 -3
@@ -12,91 +12,30 @@ import {
12
12
  slateToRenderMarkdown
13
13
  } from "./chunk-63W5N6P3.js";
14
14
  import {
15
- addContentToSpace
16
- } from "./chunk-BXLWFS62.js";
15
+ addContentToSpace,
16
+ resolveCreationSpaceId
17
+ } from "./chunk-NHQKWPLP.js";
18
+ import {
19
+ runtime_default
20
+ } from "./chunk-MBS6CTZB.js";
17
21
  import {
18
22
  getCurrentSpaceId
19
23
  } from "./chunk-5XBUWM6I.js";
20
- import {
21
- runtime_default
22
- } from "./chunk-JBFZMJ4J.js";
23
- import "./chunk-TZXPT53C.js";
24
- import "./chunk-LEC5ALIN.js";
25
- import "./chunk-523DITKR.js";
26
- import "./chunk-IQ52JEVT.js";
27
- import "./chunk-BYXBJQAS.js";
28
- import "./chunk-QYPE3TS3.js";
29
- import "./chunk-T3U2KQF4.js";
30
- import "./chunk-4JH2UMJR.js";
31
- import "./chunk-QAYCF4CH.js";
32
- import "./chunk-UAD2WT54.js";
33
- import "./chunk-5RGU3J7P.js";
34
- import "./chunk-ZRAU6T47.js";
35
- import "./chunk-4LCOCOR5.js";
36
- import "./chunk-OWYYDMGJ.js";
37
- import "./chunk-YDH3FDFQ.js";
38
- import "./chunk-HWZT5DKX.js";
39
24
  import {
40
25
  write
41
- } from "./chunk-OHYCQKPW.js";
42
- import "./chunk-3PVYUPXK.js";
43
- import "./chunk-MOCY5LJI.js";
44
- import "./chunk-6K2AKJAD.js";
45
- import "./chunk-32GANJHJ.js";
46
- import "./chunk-UEILX4EV.js";
47
- import "./chunk-X4F26D5K.js";
48
- import "./chunk-6Q7UTJKR.js";
49
- import "./chunk-QQ56R7KS.js";
50
- import "./chunk-OW765XBU.js";
26
+ } from "./chunk-UMEGDH6A.js";
51
27
  import {
52
28
  selectIdentityUserId
53
29
  } from "./chunk-PXYBUFDB.js";
54
- import "./chunk-Y2WUYX4I.js";
55
- import "./chunk-D2MDMY2M.js";
56
30
  import {
57
31
  parseSkillDocProtocol
58
32
  } from "./chunk-AETZ7AD6.js";
59
- import "./chunk-Y6ORVLSS.js";
60
- import "./chunk-KHCLMKZZ.js";
61
- import "./chunk-WTKYP6QO.js";
62
- import "./chunk-5ZUL4CUO.js";
63
- import "./chunk-BTYQAODF.js";
64
- import "./chunk-H57T64RA.js";
65
- import "./chunk-UKZX3NHN.js";
66
- import "./chunk-5MMAK75Q.js";
67
- import "./chunk-TRZP7JZ7.js";
68
- import "./chunk-UIOEHFF6.js";
69
- import "./chunk-KX6YBIHG.js";
70
- import "./chunk-DWLEOOGR.js";
71
- import "./chunk-7DPNBQSV.js";
72
- import "./chunk-G7Y4GXTY.js";
73
- import "./chunk-LOEO7LRC.js";
74
- import "./chunk-M2EJHDJP.js";
75
- import "./chunk-PSCNXBYA.js";
76
- import "./chunk-6UBGXX2W.js";
77
- import "./chunk-YUA6OAH5.js";
78
- import "./chunk-SM3NSZJV.js";
79
- import "./chunk-JRTNUU5Z.js";
80
- import "./chunk-HNMXYYJR.js";
81
- import "./chunk-KUG52IAP.js";
82
- import "./chunk-LCBAMY2M.js";
83
- import "./chunk-4SN6J65J.js";
84
- import "./chunk-CF7PE763.js";
85
33
  import {
86
34
  createPageKey
87
35
  } from "./chunk-ECX3NKRD.js";
88
- import "./chunk-XJWWBO34.js";
89
- import "./chunk-I42VC5KR.js";
90
- import "./chunk-U6VC4MU4.js";
91
- import "./chunk-WWC7I6TA.js";
92
- import "./chunk-3EUW3WEO.js";
93
36
  import {
94
37
  asOptionalTrimmedString
95
38
  } from "./chunk-G3SUCT4W.js";
96
- import "./chunk-T43B7LB2.js";
97
- import "./chunk-GOO6G4PY.js";
98
- import "./chunk-QSJ3HFEF.js";
99
- import "./chunk-4VNS5WPM.js";
100
39
 
101
40
  // packages/render/page/createPageAction.ts
102
41
  var normalizeCategoryId = (raw) => {
@@ -118,7 +57,7 @@ var createPageAction = async ({
118
57
  const state = getState();
119
58
  const userId = selectIdentityUserId(state);
120
59
  if (!userId) throw new Error("User ID not found.");
121
- const spaceId = customSpaceId ?? getCurrentSpaceId();
60
+ const spaceId = resolveCreationSpaceId(customSpaceId, getCurrentSpaceId());
122
61
  const { dbKey, id } = createPageKey.create(userId);
123
62
  const now = /* @__PURE__ */ new Date();
124
63
  const defaultTitle = runtime_default.t("page:untitled", {
@@ -193,6 +132,7 @@ var createPageAction = async ({
193
132
  }
194
133
  return dbKey;
195
134
  };
135
+
196
136
  export {
197
137
  createPageAction
198
138
  };
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  getRuntimeServerContext,
3
3
  scheduleDeleteReplication
4
- } from "./chunk-32GANJHJ.js";
4
+ } from "./chunk-UCPAVEQB.js";
5
5
  import {
6
6
  fetchFromClientDb
7
- } from "./chunk-6Q7UTJKR.js";
7
+ } from "./chunk-AGP3YSEC.js";
8
8
  import {
9
9
  selectIdentityToken
10
10
  } from "./chunk-PXYBUFDB.js";
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  createCliLocalRuntimeAdapter,
3
3
  summarizeEndpoint
4
- } from "./chunk-GWXL4KVM.js";
4
+ } from "./chunk-M4NTDZG3.js";
5
5
  import {
6
6
  clipMultilineText
7
- } from "./chunk-KULR4QDX.js";
7
+ } from "./chunk-RYWO5AKN.js";
8
8
  import {
9
9
  runLocalAgentTurn
10
- } from "./chunk-2VDB25VM.js";
10
+ } from "./chunk-ZOO3WJIE.js";
11
11
  import {
12
12
  applyToolSurfaceConstraints
13
13
  } from "./chunk-6HVBI6TI.js";
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  addContentToSpace
3
- } from "./chunk-BXLWFS62.js";
3
+ } from "./chunk-NHQKWPLP.js";
4
4
  import {
5
5
  format,
6
6
  prepareAndPersistMessage,
7
7
  uiAskChoiceFunc,
8
8
  uiAskChoiceFunctionSchema
9
- } from "./chunk-JBFZMJ4J.js";
9
+ } from "./chunk-MBS6CTZB.js";
10
10
  import {
11
11
  formatISO
12
12
  } from "./chunk-ZRAU6T47.js";
@@ -16,10 +16,10 @@ import {
16
16
  removeCachedEntity,
17
17
  upsertSSREntity,
18
18
  write
19
- } from "./chunk-OHYCQKPW.js";
19
+ } from "./chunk-UMEGDH6A.js";
20
20
  import {
21
21
  isDevelopment
22
- } from "./chunk-6Q7UTJKR.js";
22
+ } from "./chunk-AGP3YSEC.js";
23
23
  import {
24
24
  selectIdentityUserId
25
25
  } from "./chunk-PXYBUFDB.js";
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  upsertSSREntity,
3
3
  write
4
- } from "./chunk-OHYCQKPW.js";
4
+ } from "./chunk-UMEGDH6A.js";
5
5
  import {
6
6
  getRuntimeServerContext,
7
7
  resolveRecordAuthority
8
- } from "./chunk-32GANJHJ.js";
8
+ } from "./chunk-UCPAVEQB.js";
9
9
  import {
10
10
  TIMEOUT,
11
11
  asyncThunkCreator,
@@ -458,7 +458,7 @@ var slice = createSliceWithThunks({
458
458
  const overrides = {};
459
459
  if (args.systemPromptOverride !== void 0) overrides.prompt = args.systemPromptOverride;
460
460
  if (args.toolsOverride !== void 0) overrides.tools = args.toolsOverride;
461
- const { _executeModel } = await import("./_executeModel-C4BBPBMI.js");
461
+ const { _executeModel } = await import("./_executeModel-VVQEOY3D.js");
462
462
  return _executeModel(
463
463
  {
464
464
  isStreaming: args.isStreaming ?? false,
@@ -479,7 +479,7 @@ var slice = createSliceWithThunks({
479
479
  * - 循环直到无工具调用或触发其他运行时停止条件
480
480
  */
481
481
  runAgent: create.asyncThunk(async (args, thunkApi) => {
482
- const { runAgentClientLoop } = await import("./runAgentClientLoop-Z63BHKC2.js");
482
+ const { runAgentClientLoop } = await import("./runAgentClientLoop-IO5F7TCZ.js");
483
483
  const { content: loopContent, toolCallCount } = await runAgentClientLoop(
484
484
  {
485
485
  agentKey: args.agentKey,
@@ -495,7 +495,7 @@ var slice = createSliceWithThunks({
495
495
  * 聊天轮次流式 Agent 调用
496
496
  */
497
497
  streamAgentChatTurn: create.asyncThunk(async (args, thunkApi) => {
498
- const { streamAgentChatTurnHandler } = await import("./streamAgentChatTurn-BCOVALCO.js");
498
+ const { streamAgentChatTurnHandler } = await import("./streamAgentChatTurn-VUKZQYJR.js");
499
499
  return streamAgentChatTurnHandler(args, thunkApi);
500
500
  }),
501
501
  /**
@@ -4,7 +4,7 @@ import {
4
4
  import {
5
5
  getAllServers,
6
6
  getIsDesktopApp
7
- } from "./chunk-6Q7UTJKR.js";
7
+ } from "./chunk-AGP3YSEC.js";
8
8
  import {
9
9
  SERVERS
10
10
  } from "./chunk-LCBAMY2M.js";
@@ -0,0 +1,185 @@
1
+ // packages/chat/web/desktopFolderProjects.ts
2
+ var DESKTOP_FOLDER_PROJECTS_KEY = "nolo:desktop-folder-projects:v1";
3
+ function updateDesktopProject(storage, projectId, patch) {
4
+ const raw = storage.getItem(DESKTOP_FOLDER_PROJECTS_KEY);
5
+ if (raw && !Array.isArray(JSON.parse(raw))) throw new Error("\u9879\u76EE\u8BB0\u5F55\u65E0\u6CD5\u8BFB\u53D6");
6
+ const projects = readDesktopFolderProjects(raw);
7
+ if (raw && JSON.parse(raw).length !== projects.length) throw new Error("\u9879\u76EE\u8BB0\u5F55\u5305\u542B\u65E0\u6548\u6216\u91CD\u590D\u9879\uFF0C\u672A\u8986\u76D6\u539F\u8BB0\u5F55");
8
+ const current = projects.find((p) => p.id === projectId);
9
+ if (!current) throw new Error("\u9879\u76EE\u4E0D\u5B58\u5728");
10
+ if (patch.instructions !== void 0 && typeof patch.instructions !== "string") {
11
+ throw new Error("\u9879\u76EE\u6307\u4EE4\u683C\u5F0F\u9519\u8BEF");
12
+ }
13
+ const updated = { ...current, ...patch, id: current.id };
14
+ if (!updated.name.trim()) throw new Error("\u8BF7\u586B\u5199\u9879\u76EE\u540D\u79F0");
15
+ storage.setItem(DESKTOP_FOLDER_PROJECTS_KEY, JSON.stringify(projects.map((p) => p.id === projectId ? updated : p)));
16
+ if (typeof window !== "undefined") window.dispatchEvent(new Event(DESKTOP_FOLDER_SELECTION_EVENT));
17
+ return updated;
18
+ }
19
+ function selectDesktopProject(storage, projectId) {
20
+ if (projectId && !readDesktopFolderProjects(storage.getItem(DESKTOP_FOLDER_PROJECTS_KEY)).some((p) => p.id === projectId)) throw new Error("\u9879\u76EE\u4E0D\u5B58\u5728");
21
+ if (projectId) storage.setItem(DESKTOP_SELECTED_FOLDER_PROJECT_KEY, projectId);
22
+ else storage.removeItem(DESKTOP_SELECTED_FOLDER_PROJECT_KEY);
23
+ if (typeof window !== "undefined") window.dispatchEvent(new Event(DESKTOP_FOLDER_SELECTION_EVENT));
24
+ }
25
+ function readDesktopFolderProjects(raw) {
26
+ if (!raw) return [];
27
+ try {
28
+ const value = JSON.parse(raw);
29
+ if (!Array.isArray(value)) return [];
30
+ const seen = /* @__PURE__ */ new Set();
31
+ const ids = /* @__PURE__ */ new Set();
32
+ return value.filter((item) => !!item && typeof item === "object" && typeof item.id === "string" && !!item.id.trim() && typeof item.name === "string" && !!item.name.trim() && typeof item.localPath === "string" && (item.linkedContentKeys === void 0 || Array.isArray(item.linkedContentKeys) && item.linkedContentKeys.every((key) => typeof key === "string")) && (item.outcomeKeys === void 0 || Array.isArray(item.outcomeKeys) && item.outcomeKeys.every((key) => typeof key === "string")) && (item.archiveKey === void 0 || typeof item.archiveKey === "string") && (item.groups === void 0 || Array.isArray(item.groups) && item.groups.every(
33
+ (g) => !!g && typeof g === "object" && typeof g.id === "string" && !!g.id.trim() && typeof g.name === "string" && !!g.name.trim() && Array.isArray(g.contentKeys) && g.contentKeys.every((k) => typeof k === "string")
34
+ ))).map((item) => {
35
+ if (item.instructions !== void 0 && typeof item.instructions !== "string") {
36
+ const { instructions: _bad, ...rest } = item;
37
+ return rest;
38
+ }
39
+ return item;
40
+ }).filter((item) => {
41
+ const key = item.localPath.trim() ? `path:${item.localPath}` : `id:${item.id}`;
42
+ if (seen.has(key) || ids.has(item.id)) return false;
43
+ ids.add(item.id);
44
+ seen.add(key);
45
+ return true;
46
+ });
47
+ } catch {
48
+ return [];
49
+ }
50
+ }
51
+ function createDesktopProjectGroup(storage, projectId, name) {
52
+ const trimmed = name.trim();
53
+ if (!trimmed) throw new Error("\u8BF7\u586B\u5199\u5206\u7EC4\u540D\u79F0");
54
+ const raw = storage.getItem(DESKTOP_FOLDER_PROJECTS_KEY);
55
+ const projects = readDesktopFolderProjects(raw);
56
+ const current = projects.find((p) => p.id === projectId);
57
+ if (!current) throw new Error("\u9879\u76EE\u4E0D\u5B58\u5728");
58
+ const existingGroups = current.groups ?? [];
59
+ const newGroup = {
60
+ id: `group-${Date.now()}-${Math.random().toString(36).slice(2, 8)}`,
61
+ name: trimmed,
62
+ contentKeys: []
63
+ };
64
+ return updateDesktopProject(storage, projectId, {
65
+ groups: [...existingGroups, newGroup]
66
+ });
67
+ }
68
+ function assignDesktopProjectContentGroup(storage, projectId, contentKey, groupId) {
69
+ const raw = storage.getItem(DESKTOP_FOLDER_PROJECTS_KEY);
70
+ const projects = readDesktopFolderProjects(raw);
71
+ const current = projects.find((p) => p.id === projectId);
72
+ if (!current) throw new Error("\u9879\u76EE\u4E0D\u5B58\u5728");
73
+ const groups = current.groups ?? [];
74
+ if (groupId !== null && !groups.some((g) => g.id === groupId)) {
75
+ throw new Error("\u5206\u7EC4\u4E0D\u5B58\u5728");
76
+ }
77
+ const nextGroups = groups.map((g) => {
78
+ const filteredKeys = g.contentKeys.filter((k) => k !== contentKey);
79
+ if (g.id === groupId) {
80
+ return { ...g, contentKeys: [...filteredKeys, contentKey] };
81
+ }
82
+ return { ...g, contentKeys: filteredKeys };
83
+ });
84
+ return updateDesktopProject(storage, projectId, { groups: nextGroups });
85
+ }
86
+ function addDesktopFolderProject(current, next) {
87
+ if (!next.id.trim() || !next.name.trim()) return [...current];
88
+ if (current.some((p) => !!next.localPath.trim() && p.localPath === next.localPath || p.id === next.id)) return [...current];
89
+ return [...current, next];
90
+ }
91
+ function removeDesktopFolderProject(current, projectId) {
92
+ return current.filter((project) => project.id !== projectId);
93
+ }
94
+ var DESKTOP_SELECTED_FOLDER_PROJECT_KEY = "nolo:desktop-selected-folder-project:v1";
95
+ var DESKTOP_FOLDER_SELECTION_EVENT = "nolo:desktop-folder-selection";
96
+ function resolveSelectedDesktopFolder(projects, selectedId) {
97
+ return projects.find((project) => project.id === selectedId) ?? null;
98
+ }
99
+ function readSelectedDesktopFolderProject(storage) {
100
+ return resolveSelectedDesktopFolder(
101
+ readDesktopFolderProjects(storage.getItem(DESKTOP_FOLDER_PROJECTS_KEY)),
102
+ storage.getItem(DESKTOP_SELECTED_FOLDER_PROJECT_KEY)
103
+ );
104
+ }
105
+ function readSelectedDesktopFolderPath(storage) {
106
+ return readSelectedDesktopFolderProject(storage)?.localPath ?? null;
107
+ }
108
+ var DESKTOP_DIALOG_PROJECTS_KEY = "nolo:desktop-dialog-projects:v1";
109
+ function readDialogProjectId(storage, dialogKey) {
110
+ try {
111
+ const raw = storage.getItem(DESKTOP_DIALOG_PROJECTS_KEY);
112
+ const records = raw ? JSON.parse(raw) : {};
113
+ if (!records || typeof records !== "object" || Array.isArray(records)) return null;
114
+ const id = records[dialogKey];
115
+ return typeof id === "string" && id.trim() ? id : null;
116
+ } catch {
117
+ return null;
118
+ }
119
+ }
120
+ function bindDialogToProject(storage, dialogKey, projectId) {
121
+ if (!dialogKey.trim() || !projectId.trim()) throw new Error("Invalid dialog/project binding");
122
+ const raw = storage.getItem(DESKTOP_DIALOG_PROJECTS_KEY);
123
+ let records = {};
124
+ try {
125
+ const parsed = raw ? JSON.parse(raw) : {};
126
+ if (parsed && typeof parsed === "object" && !Array.isArray(parsed)) {
127
+ records = Object.fromEntries(Object.entries(parsed).filter(([, v]) => typeof v === "string"));
128
+ }
129
+ } catch {
130
+ }
131
+ storage.setItem(DESKTOP_DIALOG_PROJECTS_KEY, JSON.stringify({ ...records, [dialogKey]: projectId }));
132
+ }
133
+ function readDialogFolderPath(storage, dialogKey) {
134
+ const id = readDialogProjectId(storage, dialogKey);
135
+ return resolveSelectedDesktopFolder(
136
+ readDesktopFolderProjects(storage.getItem(DESKTOP_FOLDER_PROJECTS_KEY)),
137
+ id
138
+ )?.localPath ?? null;
139
+ }
140
+ function bindSelectedProjectToDialog(storage, dialogKey) {
141
+ if (!dialogKey.trim()) return null;
142
+ const project = readSelectedDesktopFolderProject(storage);
143
+ if (!project) return null;
144
+ bindDialogToProject(storage, dialogKey, project.id);
145
+ return project;
146
+ }
147
+ function readDesktopDefaultWorkspacePath() {
148
+ if (typeof window === "undefined") return null;
149
+ return window.__NOLO_DESKTOP_CWD__?.trim() || null;
150
+ }
151
+ function resolveDialogWorkspaceFolder(storage, dialogKey) {
152
+ const projectId = readDialogProjectId(storage, dialogKey);
153
+ const projectPath = projectId ? resolveSelectedDesktopFolder(
154
+ readDesktopFolderProjects(storage.getItem(DESKTOP_FOLDER_PROJECTS_KEY)),
155
+ projectId
156
+ )?.localPath ?? null : null;
157
+ if (projectId) {
158
+ const exists = readDesktopFolderProjects(storage.getItem(DESKTOP_FOLDER_PROJECTS_KEY)).some((p) => p.id === projectId);
159
+ return { cwd: projectPath || null, projectId, missing: !exists };
160
+ }
161
+ return { cwd: readDesktopDefaultWorkspacePath(), projectId: null, missing: false };
162
+ }
163
+
164
+ export {
165
+ DESKTOP_FOLDER_PROJECTS_KEY,
166
+ updateDesktopProject,
167
+ selectDesktopProject,
168
+ readDesktopFolderProjects,
169
+ createDesktopProjectGroup,
170
+ assignDesktopProjectContentGroup,
171
+ addDesktopFolderProject,
172
+ removeDesktopFolderProject,
173
+ DESKTOP_SELECTED_FOLDER_PROJECT_KEY,
174
+ DESKTOP_FOLDER_SELECTION_EVENT,
175
+ resolveSelectedDesktopFolder,
176
+ readSelectedDesktopFolderProject,
177
+ readSelectedDesktopFolderPath,
178
+ DESKTOP_DIALOG_PROJECTS_KEY,
179
+ readDialogProjectId,
180
+ bindDialogToProject,
181
+ readDialogFolderPath,
182
+ bindSelectedProjectToDialog,
183
+ readDesktopDefaultWorkspacePath,
184
+ resolveDialogWorkspaceFolder
185
+ };
@@ -4,11 +4,11 @@ import {
4
4
  import {
5
5
  patch,
6
6
  read
7
- } from "./chunk-OHYCQKPW.js";
7
+ } from "./chunk-UMEGDH6A.js";
8
8
  import {
9
9
  DEVICE_LOCAL_OWNER_ID,
10
10
  isDeviceLocalSpaceBody
11
- } from "./chunk-32GANJHJ.js";
11
+ } from "./chunk-UCPAVEQB.js";
12
12
  import {
13
13
  selectIdentityUserId
14
14
  } from "./chunk-PXYBUFDB.js";
@@ -8,7 +8,7 @@ import {
8
8
  mapDiscoveredSkillsToCatalogEntries,
9
9
  resolveSkillCatalog,
10
10
  resolveSkillCatalogSync
11
- } from "./chunk-CMLBKYEI.js";
11
+ } from "./chunk-ZRSNONOB.js";
12
12
 
13
13
  // packages/agent-runtime/skillDiscovery.ts
14
14
  import { existsSync, readFileSync, readdirSync, statSync } from "node:fs";
@@ -206,7 +206,7 @@ async function readDocFunc(args, thunkApi) {
206
206
  throw new Error(`\u65E0\u6548\u7684\u9875\u9762 ID: ${id}\u3002\u9875\u9762 ID \u901A\u5E38\u4EE5 "page-" \u5F00\u5934\u3002`);
207
207
  }
208
208
  try {
209
- const { readAction } = await import("./read-ILTT75DW.js");
209
+ const { readAction } = await import("./read-DIIQBOOO.js");
210
210
  const pageData = await readAction({ dbKey: id }, thunkApi);
211
211
  if (!pageData) {
212
212
  throw new Error(`\u672A\u627E\u5230 ID \u4E3A ${id} \u7684\u9875\u9762\u3002`);
@@ -7,7 +7,7 @@ import {
7
7
  import {
8
8
  patch,
9
9
  selectById
10
- } from "./chunk-OHYCQKPW.js";
10
+ } from "./chunk-UMEGDH6A.js";
11
11
 
12
12
  // packages/chat/dialog/actions/setDialogExtraReferencesAction.ts
13
13
  var setDialogExtraReferencesAction = async (extraReferences, thunkApi) => {
@@ -5,7 +5,7 @@ import {
5
5
  inlineImageUrlsForCustomProvider,
6
6
  prepareTools,
7
7
  shouldInlineImageUrlsForAgent
8
- } from "./chunk-GTQFLOYM.js";
8
+ } from "./chunk-25M2K6OA.js";
9
9
  import {
10
10
  CONFIRMATION_INPUT_KEYS,
11
11
  INVALID_TOOL_ARGS_REPLACEMENT,
@@ -14,16 +14,16 @@ import {
14
14
  performFetchRequest,
15
15
  sanitizeOutboundMessages,
16
16
  stripModelToolArgs
17
- } from "./chunk-W4MOO6XC.js";
17
+ } from "./chunk-NV572QM3.js";
18
18
  import {
19
19
  findToolExecutor,
20
20
  toolDefinitionsByName
21
- } from "./chunk-WYOJXAIC.js";
21
+ } from "./chunk-LT3EAHJY.js";
22
22
  import {
23
23
  classifyApiError,
24
24
  classifyGenerationError,
25
25
  extractErrorDiagnostics
26
- } from "./chunk-GHSXAOWH.js";
26
+ } from "./chunk-ZN5AH4BY.js";
27
27
  import {
28
28
  createSSEParser,
29
29
  createToolRunId,
@@ -32,13 +32,10 @@ import {
32
32
  toolRunSetPending,
33
33
  toolRunStarted,
34
34
  toolRunSucceeded
35
- } from "./chunk-KULR4QDX.js";
35
+ } from "./chunk-RYWO5AKN.js";
36
36
  import {
37
37
  getPublicImageAgentMode
38
38
  } from "./chunk-VIDPVFP3.js";
39
- import {
40
- getCurrentSpaceId
41
- } from "./chunk-5XBUWM6I.js";
42
39
  import {
43
40
  addToolMessage,
44
41
  messageStreamEnd,
@@ -46,10 +43,13 @@ import {
46
43
  toast,
47
44
  toolResultNeedsUserConfirmation,
48
45
  updateToolMessage
49
- } from "./chunk-JBFZMJ4J.js";
46
+ } from "./chunk-MBS6CTZB.js";
50
47
  import {
51
48
  streamAgentChatTurn
52
- } from "./chunk-IQ52JEVT.js";
49
+ } from "./chunk-ADBWFYJD.js";
50
+ import {
51
+ getCurrentSpaceId
52
+ } from "./chunk-5XBUWM6I.js";
53
53
  import {
54
54
  addActiveController,
55
55
  getActiveDialogKey,
@@ -61,10 +61,10 @@ import {
61
61
  } from "./chunk-YDH3FDFQ.js";
62
62
  import {
63
63
  selectCurrentServer
64
- } from "./chunk-HWZT5DKX.js";
64
+ } from "./chunk-BSISWVB4.js";
65
65
  import {
66
66
  write
67
- } from "./chunk-OHYCQKPW.js";
67
+ } from "./chunk-UMEGDH6A.js";
68
68
  import {
69
69
  createAsyncThunk
70
70
  } from "./chunk-X4F26D5K.js";