nolo-cli 0.8.0-alpha.14 → 0.8.0-alpha.19

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 (98) hide show
  1. package/README.md +1 -1
  2. package/{_executeModel-KBMAUV6G.js → _executeModel-BOMQGOZC.js} +33 -30
  3. package/{action-SQGI5JY5.js → action-AEHDRQHP.js} +4 -4
  4. package/{addContentAction-ZX2PUS3X.js → addContentAction-OL5YQ6LW.js} +3 -3
  5. package/{addDialogAgentAction-ULADQX2Q.js → addDialogAgentAction-XU5Y2E2X.js} +2 -2
  6. package/{agentDeleteCommand-GNVYHOGZ.js → agentDeleteCommand-5DD2IM3J.js} +12 -11
  7. package/{agentEmailCommands-QETL62SU.js → agentEmailCommands-SE7MBTAG.js} +35 -32
  8. package/{agentListCommands-FM4OWXYT.js → agentListCommands-I6KZYCIG.js} +13 -12
  9. package/{agentMachineCommands-LDHJBWQO.js → agentMachineCommands-SBYN6EXT.js} +13 -12
  10. package/{agentRecordCommands-UW76EZ25.js → agentRecordCommands-F74NBFOZ.js} +35 -32
  11. package/{agentRunCommand-UFBOW4ZF.js → agentRunCommand-3DGDK4Y3.js} +41 -36
  12. package/{agentRuntimeLocal-XL5PLRJV.js → agentRuntimeLocal-ZYEIPTY4.js} +9 -8
  13. package/{agentSlice-2IBSFH4O.js → agentSlice-XEH6Y334.js} +3 -3
  14. package/{authCommand-PXFX6JDT.js → authCommand-EB5JSOX5.js} +3 -3
  15. package/{authCommands-356AYWEK.js → authCommands-XPEHTKSM.js} +2 -2
  16. package/{chunk-QTFSBLCF.js → chunk-2BIV3FMX.js} +25 -236
  17. package/{chunk-ZDXZSXYQ.js → chunk-2NNJ6S5U.js} +1 -1
  18. package/{chunk-6A3LI5TZ.js → chunk-2T2C6CNY.js} +2 -2
  19. package/{chunk-2IRF4LEX.js → chunk-4NDK6NWB.js} +87 -114
  20. package/{chunk-SRLZ7IVA.js → chunk-4P2MDGKS.js} +78 -211
  21. package/{chunk-MXLQWBVM.js → chunk-4QEWT7KD.js} +33 -3
  22. package/{chunk-DSNONPGW.js → chunk-5KLGBAAR.js} +1 -1
  23. package/{chunk-6CBN7GGH.js → chunk-64AAZRGY.js} +4 -4
  24. package/{chunk-QKRUUZCL.js → chunk-6RSAUKSQ.js} +24 -13
  25. package/{chunk-TWPGVS2U.js → chunk-7DAJ4AI4.js} +2 -2
  26. package/{chunk-RLCFUU46.js → chunk-7KCUSYT2.js} +4 -10
  27. package/chunk-AFON4QUU.js +112 -0
  28. package/chunk-AGFH73SK.js +239 -0
  29. package/{chunk-572EKYLF.js → chunk-BBYVOSU2.js} +1 -1
  30. package/{chunk-2MALU52L.js → chunk-C3RUNRHT.js} +1 -1
  31. package/{chunk-SL35K7AH.js → chunk-C4FTUXVF.js} +2 -82
  32. package/{chunk-JRPR5M4O.js → chunk-C77B4AFC.js} +2 -2
  33. package/{chunk-USZMK5UT.js → chunk-DCOA4QSN.js} +1 -1
  34. package/{chunk-BKPVTIEK.js → chunk-FVYY6MCS.js} +3 -3
  35. package/{chunk-3TZDXYSF.js → chunk-HNW7IJSK.js} +1 -1
  36. package/{chunk-B6DFDN4R.js → chunk-IEKTE4JQ.js} +2 -2
  37. package/{chunk-BR2WP3DF.js → chunk-IWX4UW2E.js} +9 -9
  38. package/{chunk-MMRAIO5Y.js → chunk-IX4C5TCO.js} +3 -3
  39. package/{chunk-6XKX2N2E.js → chunk-JRCUAPXX.js} +1 -1
  40. package/{chunk-XDVAYP26.js → chunk-JRKKFRAV.js} +1 -1
  41. package/{chunk-V2AISYMA.js → chunk-KPSWSDUF.js} +2 -2
  42. package/chunk-LTRXGFMS.js +83 -0
  43. package/{chunk-PCWC3JTN.js → chunk-MTU75CZ2.js} +1 -1
  44. package/{chunk-DGFWICQJ.js → chunk-N54XAP77.js} +1 -1
  45. package/{chunk-SACYB45H.js → chunk-O2ZNTTET.js} +5 -5
  46. package/{chunk-SH2CFQOH.js → chunk-O4BU24WZ.js} +2 -181
  47. package/{chunk-PFUCDPUH.js → chunk-OFM4S5P3.js} +13 -13
  48. package/{chunk-VH4YK6KZ.js → chunk-OI54SUZ7.js} +6 -6
  49. package/{chunk-QO4YO77G.js → chunk-OZNNTJM7.js} +2 -2
  50. package/{chunk-DG7AAAR3.js → chunk-P3PKED2I.js} +62 -2
  51. package/{chunk-JW43YCM5.js → chunk-PY4NLIAF.js} +1 -1
  52. package/{chunk-7IPLJUYC.js → chunk-RL776AGR.js} +1 -1
  53. package/{chunk-EQHI2AR3.js → chunk-RM7KF6OT.js} +41 -22
  54. package/{chunk-RJKDVL4L.js → chunk-SDJDLO5W.js} +2 -2
  55. package/{chunk-RTZFUR3V.js → chunk-SHAFJ4TI.js} +3 -3
  56. package/{chunk-YYUCRDOK.js → chunk-SOTZ6RDN.js} +1 -1
  57. package/chunk-VC6OZXO5.js +298 -0
  58. package/{chunk-EXTIQUCI.js → chunk-VVX233PH.js} +1 -1
  59. package/{chunk-ZQ2UM4KG.js → chunk-WZSRQNQG.js} +1 -292
  60. package/{chunk-Q2YZULBH.js → chunk-XENYHRUE.js} +1 -1
  61. package/{chunk-VQ2AJRGD.js → chunk-YPRZSPF3.js} +1 -1
  62. package/{chunk-I6DI7SGU.js → chunk-YRG2GO6E.js} +222 -63
  63. package/{cliExecutor-DNE7TCC4.js → cliExecutor-K3F7DMRO.js} +2 -2
  64. package/{createAgentAutomationAction-CSWOQOY5.js → createAgentAutomationAction-MBUL3ALA.js} +12 -12
  65. package/{createDialogAction-6VWL2TDI.js → createDialogAction-3JLD4VED.js} +16 -15
  66. package/{createPageAction-INRC4MH2.js → createPageAction-Z2AOWGIW.js} +17 -16
  67. package/{dbSlice-TO2TSMWM.js → dbSlice-LSKJDY2R.js} +2 -2
  68. package/{dialogCommands-DWSE4PMW.js → dialogCommands-4IX4XIZE.js} +14 -13
  69. package/{dialogSlice-CELFVS3F.js → dialogSlice-NRQ5WIJO.js} +12 -12
  70. package/{docCreateCommands-UFJL5PUM.js → docCreateCommands-SIL3NPGT.js} +14 -12
  71. package/{docDeleteCommands-XHEIBAB2.js → docDeleteCommands-7IOMLUS4.js} +16 -14
  72. package/{docReadCommands-PEDIC2CW.js → docReadCommands-FNFXUA5L.js} +14 -12
  73. package/{docStore-Q5AFYT6G.js → docStore-DBFNPMHU.js} +13 -13
  74. package/{docUpdateCommands-WBRODQ7P.js → docUpdateCommands-X2HNDVUC.js} +14 -12
  75. package/{fetchMessages-U6ZHN56A.js → fetchMessages-KTNM7QAR.js} +2 -2
  76. package/{getPricing-PWPJ6MNV.js → getPricing-3E6UNPKL.js} +3 -3
  77. package/{handleSendMessageAction-PPIGKCBQ.js → handleSendMessageAction-G3WLT6I7.js} +12 -12
  78. package/index.js +45 -45
  79. package/{localDialogRead-Z5UTAJPU.js → localDialogRead-2VRI24F4.js} +1 -1
  80. package/{machineCommands-3D7JMHUP.js → machineCommands-GPEWO27H.js} +37 -34
  81. package/{machineWsRunDispatch-PA5BR4AX.js → machineWsRunDispatch-2LSYCV4S.js} +34 -31
  82. package/{models-XLEOET3E.js → models-4OPOOLFS.js} +2 -2
  83. package/package.json +3 -2
  84. package/{readlineWorkspace-7WPA5OUS.js → readlineWorkspace-UL4LXWHX.js} +252 -78
  85. package/{removeDialogAgentAction-3MUQGFZX.js → removeDialogAgentAction-U3CP2M2H.js} +4 -4
  86. package/{runAgentClientLoop-DRAXPP6R.js → runAgentClientLoop-KKV7BWWC.js} +27 -24
  87. package/{setDialogExtraReferencesAction-MXHX2HPK.js → setDialogExtraReferencesAction-S7GUFLTN.js} +2 -2
  88. package/{setPrimaryDialogAgentAction-7DLDZHDT.js → setPrimaryDialogAgentAction-5SF7G5OS.js} +4 -4
  89. package/{settingSlice-PNLASZGI.js → settingSlice-EXYZ5EFP.js} +3 -3
  90. package/skillDiscovery-UGSQGX2U.js +16 -0
  91. package/{spaceCommands-ORSFAWEY.js → spaceCommands-E7VOF4LO.js} +16 -19
  92. package/{spaceSlice-5F2CDP2O.js → spaceSlice-KIDVQWOV.js} +16 -14
  93. package/{streamAgentChatTurn-ROOB5RLM.js → streamAgentChatTurn-YQH6ZGE6.js} +41 -36
  94. package/{tools-BAWXW4F6.js → tools-5C7OGJEW.js} +21 -19
  95. package/{tuiSummaryLlmCaller-JSI4GL6W.js → tuiSummaryLlmCaller-RV3THLZF.js} +4 -4
  96. package/{understanding-GQKNDDWM.js → understanding-3CUQQ6SV.js} +3 -3
  97. package/{updateDialogTitleAction-KJM65IGF.js → updateDialogTitleAction-JHAVYVIP.js} +12 -12
  98. package/{chunk-X7W4TNB4.js → chunk-CMKUBIGW.js} +3 -3
@@ -8,17 +8,17 @@ import {
8
8
  import {
9
9
  buildDialogAttachmentPlan,
10
10
  extractFileContentIds
11
- } from "./chunk-PCWC3JTN.js";
11
+ } from "./chunk-MTU75CZ2.js";
12
12
  import {
13
13
  getApproxPricePerImage
14
14
  } from "./chunk-CWMSB67P.js";
15
15
  import {
16
16
  deleteServerSyncedCredential,
17
17
  runLlm
18
- } from "./chunk-QKRUUZCL.js";
18
+ } from "./chunk-6RSAUKSQ.js";
19
19
  import {
20
20
  cleanupCliSessionForDialog
21
- } from "./chunk-6A3LI5TZ.js";
21
+ } from "./chunk-2T2C6CNY.js";
22
22
  import {
23
23
  getDialogAgentIds,
24
24
  getPrimaryDialogAgentId
@@ -28,25 +28,25 @@ import {
28
28
  } from "./chunk-M76ECQRD.js";
29
29
  import {
30
30
  fetchMessages
31
- } from "./chunk-YYUCRDOK.js";
31
+ } from "./chunk-SOTZ6RDN.js";
32
32
  import {
33
33
  UNCATEGORIZED_ID,
34
34
  addContentAction,
35
35
  checkSpaceMembership,
36
36
  localSpaceAuthorityPatchStamp
37
- } from "./chunk-ZDXZSXYQ.js";
37
+ } from "./chunk-2NNJ6S5U.js";
38
38
  import {
39
39
  createSpaceKey,
40
40
  normalizeSpaceId
41
41
  } from "./chunk-UAD2WT54.js";
42
42
  import {
43
43
  ALL_MODELS
44
- } from "./chunk-USZMK5UT.js";
44
+ } from "./chunk-DCOA4QSN.js";
45
45
  import {
46
46
  MODEL_LOOKUP_MAP,
47
47
  findModelConfig,
48
48
  getModelConfig
49
- } from "./chunk-572EKYLF.js";
49
+ } from "./chunk-BBYVOSU2.js";
50
50
  import {
51
51
  createFileCredentialBroker
52
52
  } from "./chunk-5CS33IBL.js";
@@ -80,7 +80,7 @@ import {
80
80
  selectRemoteServer,
81
81
  selectRemoteServers,
82
82
  selectRemoteSyncServers
83
- } from "./chunk-6CBN7GGH.js";
83
+ } from "./chunk-64AAZRGY.js";
84
84
  import {
85
85
  patch,
86
86
  read,
@@ -93,7 +93,7 @@ import {
93
93
  uploadFileAction,
94
94
  upsertSSREntity,
95
95
  write
96
- } from "./chunk-V2AISYMA.js";
96
+ } from "./chunk-KPSWSDUF.js";
97
97
  import {
98
98
  resolveFileCategory
99
99
  } from "./chunk-AZPCASRE.js";
@@ -120,12 +120,11 @@ import {
120
120
  isTableMetaKey,
121
121
  isTaskKey,
122
122
  metaKey,
123
- require_index_umd,
124
123
  rowKey,
125
124
  splitKey,
126
125
  toTrimmedString,
127
126
  ulid
128
- } from "./chunk-SH2CFQOH.js";
127
+ } from "./chunk-O4BU24WZ.js";
129
128
  import {
130
129
  asNonEmptyStringArray,
131
130
  asTrimmedNonEmptyStringArray
@@ -11539,7 +11538,7 @@ var require_html_parse_stringify = __commonJS({
11539
11538
  });
11540
11539
 
11541
11540
  // packages/create/space/category/categoryActions.ts
11542
- var import_ulid = __toESM(require_index_umd(), 1);
11541
+ import { ulid as ulid2 } from "ulid";
11543
11542
 
11544
11543
  // packages/create/space/spaceCollapsedState.ts
11545
11544
  var SPACE_COLLAPSE_STORAGE_PREFIX = "space-collapsed-categories:";
@@ -11684,7 +11683,7 @@ var createCategoryActions = (create) => ({
11684
11683
  dbKey: spaceKey
11685
11684
  })).unwrap();
11686
11685
  checkSpaceMembership(spaceData, currentUserId);
11687
- const newCategoryId = categoryId || (0, import_ulid.ulid)();
11686
+ const newCategoryId = categoryId || ulid2();
11688
11687
  if (spaceData.categories?.[newCategoryId]) {
11689
11688
  throw new Error(`\u5206\u7C7B ID "${newCategoryId}" \u5DF2\u5B58\u5728\u3002`);
11690
11689
  }
@@ -11967,6 +11966,9 @@ function add(message, type, options) {
11967
11966
  title: message,
11968
11967
  type,
11969
11968
  icon: options?.icon,
11969
+ description: options?.description,
11970
+ action: options?.action,
11971
+ position: options?.position,
11970
11972
  // loading toasts stay until explicitly replaced/closed (timeout=0)
11971
11973
  timeout: type === "loading" ? timeout ?? 0 : timeout ?? DEFAULT_TIMEOUT
11972
11974
  });
@@ -13607,6 +13609,10 @@ function buildFallbackActivity(toolName, args) {
13607
13609
  refs: [{ type: "file", path }]
13608
13610
  };
13609
13611
  }
13612
+ case "loadSkill": {
13613
+ const name = asTrimmedString(args.name);
13614
+ return name ? { title: "\u52A0\u8F7D\u6280\u80FD", detail: name } : void 0;
13615
+ }
13610
13616
  case "execShell": {
13611
13617
  const command = asTrimmedString(
13612
13618
  typeof args.cmd === "string" ? args.cmd : args.command
@@ -14034,7 +14040,7 @@ async function captureUnderstandingFromCompletedUiTurn(input) {
14034
14040
  if (!input.agentKey) return;
14035
14041
  const latestUserInput = getLatestUserInputFromMessages(input.messages);
14036
14042
  if (!latestUserInput) return;
14037
- const { captureUnderstandingMemoryFromDialog } = await import("./understanding-GQKNDDWM.js");
14043
+ const { captureUnderstandingMemoryFromDialog } = await import("./understanding-3CUQQ6SV.js");
14038
14044
  await captureUnderstandingMemoryFromDialog({
14039
14045
  db: input.db,
14040
14046
  userId: selectIdentityUserId(input.state),
@@ -14959,7 +14965,7 @@ var messageSlice = createSliceWithThunks({
14959
14965
  runtimeOptions: args.runtimeOptions
14960
14966
  });
14961
14967
  if (agentKeyToUse) {
14962
- const { streamAgentChatTurn } = await import("./agentSlice-2IBSFH4O.js");
14968
+ const { streamAgentChatTurn } = await import("./agentSlice-XEH6Y334.js");
14963
14969
  await dispatch(
14964
14970
  streamAgentChatTurn({
14965
14971
  agentKey: agentKeyToUse,
@@ -15077,8 +15083,8 @@ function clearWorkflow() {
15077
15083
  }
15078
15084
 
15079
15085
  // packages/chat/dialog/actions/updateTokensAction.ts
15080
- var import_ulid2 = __toESM(require_index_umd());
15081
15086
  var import_date_fns = __toESM(require_date_fns());
15087
+ import { ulid as ulid3 } from "ulid";
15082
15088
 
15083
15089
  // packages/ai/token/saveTokenRecord.ts
15084
15090
  var import_pino = __toESM(require_pino());
@@ -17331,7 +17337,7 @@ var saveTokenUsage = async (data, thunkApi) => {
17331
17337
  );
17332
17338
  return {
17333
17339
  success: true,
17334
- id: (0, import_ulid2.ulid)(Date.now()),
17340
+ id: ulid3(Date.now()),
17335
17341
  record: updatedStats
17336
17342
  };
17337
17343
  } catch (error) {
@@ -17377,7 +17383,7 @@ var updateTokensAction = async ({ dialogId, dialogKey, usage: usageRaw, agentCon
17377
17383
  const persistedTokenData = {
17378
17384
  ...tokenData,
17379
17385
  type: "token" /* TOKEN */,
17380
- id: (0, import_ulid2.ulid)(timestamp),
17386
+ id: ulid3(timestamp),
17381
17387
  dateKey: (0, import_date_fns.format)(timestamp, "yyyy-MM-dd"),
17382
17388
  // Keep the same clock used for id/dateKey so record keys never see
17383
17389
  // undefined when a prepare helper omits timestamp.
@@ -17567,7 +17573,7 @@ var deleteDialogThunk = async (payload, thunkApi) => {
17567
17573
  }
17568
17574
  if (isCurrentDialog) {
17569
17575
  await thunkApi.dispatch(resetMsgs());
17570
- const { clearPendingAttachments: clearPendingAttachments2 } = await import("./dialogSlice-CELFVS3F.js");
17576
+ const { clearPendingAttachments: clearPendingAttachments2 } = await import("./dialogSlice-NRQ5WIJO.js");
17571
17577
  dispatch(clearPendingAttachments2());
17572
17578
  clearWorkflow();
17573
17579
  }
@@ -17576,35 +17582,35 @@ var deleteDialogThunk = async (payload, thunkApi) => {
17576
17582
 
17577
17583
  // packages/chat/dialog/dialogSlice.ts
17578
17584
  var runCreateDialogAction = async (args, thunkApi) => {
17579
- const { createDialogAction } = await import("./createDialogAction-6VWL2TDI.js");
17585
+ const { createDialogAction } = await import("./createDialogAction-3JLD4VED.js");
17580
17586
  return createDialogAction(args, thunkApi);
17581
17587
  };
17582
17588
  var runCreateAgentAutomationAction = async (args, thunkApi) => {
17583
- const { createAgentAutomationAction } = await import("./createAgentAutomationAction-CSWOQOY5.js");
17589
+ const { createAgentAutomationAction } = await import("./createAgentAutomationAction-MBUL3ALA.js");
17584
17590
  return createAgentAutomationAction(args, thunkApi);
17585
17591
  };
17586
17592
  var runUpdateDialogTitleAction = async (args, thunkApi) => {
17587
- const { updateDialogTitleAction } = await import("./updateDialogTitleAction-KJM65IGF.js");
17593
+ const { updateDialogTitleAction } = await import("./updateDialogTitleAction-JHAVYVIP.js");
17588
17594
  return updateDialogTitleAction(args, thunkApi);
17589
17595
  };
17590
17596
  var runAddDialogAgentAction = async (args, thunkApi) => {
17591
- const { addDialogAgentAction } = await import("./addDialogAgentAction-ULADQX2Q.js");
17597
+ const { addDialogAgentAction } = await import("./addDialogAgentAction-XU5Y2E2X.js");
17592
17598
  return addDialogAgentAction(args, thunkApi);
17593
17599
  };
17594
17600
  var runRemoveDialogAgentAction = async (args, thunkApi) => {
17595
- const { removeDialogAgentAction } = await import("./removeDialogAgentAction-3MUQGFZX.js");
17601
+ const { removeDialogAgentAction } = await import("./removeDialogAgentAction-U3CP2M2H.js");
17596
17602
  return removeDialogAgentAction(args, thunkApi);
17597
17603
  };
17598
17604
  var runSetPrimaryDialogAgentAction = async (args, thunkApi) => {
17599
- const { setPrimaryDialogAgentAction } = await import("./setPrimaryDialogAgentAction-7DLDZHDT.js");
17605
+ const { setPrimaryDialogAgentAction } = await import("./setPrimaryDialogAgentAction-5SF7G5OS.js");
17600
17606
  return setPrimaryDialogAgentAction(args, thunkApi);
17601
17607
  };
17602
17608
  var runSetDialogExtraReferencesAction = async (args, thunkApi) => {
17603
- const { setDialogExtraReferencesAction } = await import("./setDialogExtraReferencesAction-MXHX2HPK.js");
17609
+ const { setDialogExtraReferencesAction } = await import("./setDialogExtraReferencesAction-S7GUFLTN.js");
17604
17610
  return setDialogExtraReferencesAction(args, thunkApi);
17605
17611
  };
17606
17612
  var runHandleSendMessageAction = async (args, thunkApi) => {
17607
- const { handleSendMessageAction } = await import("./handleSendMessageAction-PPIGKCBQ.js");
17613
+ const { handleSendMessageAction } = await import("./handleSendMessageAction-G3WLT6I7.js");
17608
17614
  return handleSendMessageAction(args, thunkApi);
17609
17615
  };
17610
17616
  function clearDialogState() {
@@ -17617,7 +17623,7 @@ var createPageAndAddReference = createAsyncThunk(
17617
17623
  async (payload, { dispatch, getState, rejectWithValue }) => {
17618
17624
  const { slateData, jsonData, title, type, fileId, groupId, dialogKey } = payload;
17619
17625
  try {
17620
- const { createDocState } = await import("./docStore-Q5AFYT6G.js");
17626
+ const { createDocState } = await import("./docStore-DBFNPMHU.js");
17621
17627
  const pageKey = await createDocState(
17622
17628
  { slateData, title },
17623
17629
  { dispatch, getState }
@@ -17775,7 +17781,7 @@ var selectTotalDialogTokens = selectCurrentDialogTokens;
17775
17781
 
17776
17782
  // packages/render/table/tableSlice.ts
17777
17783
  var import_date_fns3 = __toESM(require_date_fns(), 1);
17778
- var import_ulid4 = __toESM(require_index_umd(), 1);
17784
+ import { ulid as ulid5 } from "ulid";
17779
17785
 
17780
17786
  // packages/render/table/fetchAndCacheTableRows.ts
17781
17787
  var getRowTimestamp = (row) => {
@@ -17974,7 +17980,7 @@ var fetchAndCacheTableRows = async ({
17974
17980
 
17975
17981
  // packages/render/table/createTableAction.ts
17976
17982
  var import_date_fns2 = __toESM(require_date_fns(), 1);
17977
- var import_ulid3 = __toESM(require_index_umd(), 1);
17983
+ import { ulid as ulid4 } from "ulid";
17978
17984
 
17979
17985
  // node_modules/i18next/dist/esm/i18next.js
17980
17986
  var consoleLogger = {
@@ -20478,7 +20484,7 @@ var normalizeColumns = (inputColumns) => {
20478
20484
  const name = c.name.trim();
20479
20485
  if (!name) return null;
20480
20486
  const col = {
20481
- id: asOptionalTrimmedString(c.id) ?? (0, import_ulid3.ulid)(),
20487
+ id: asOptionalTrimmedString(c.id) ?? ulid4(),
20482
20488
  name
20483
20489
  };
20484
20490
  const label = asOptionalTrimmedString(c.label);
@@ -20510,7 +20516,7 @@ var normalizeColumns = (inputColumns) => {
20510
20516
  }
20511
20517
  return DEFAULT_COLUMNS.map((c) => ({
20512
20518
  ...c,
20513
- id: (0, import_ulid3.ulid)()
20519
+ id: ulid4()
20514
20520
  }));
20515
20521
  };
20516
20522
  var normalizeStringArray2 = (value) => {
@@ -20553,7 +20559,7 @@ var createTableAction = async ({
20553
20559
  const userId = selectIdentityUserId(state3);
20554
20560
  if (!userId) throw new Error("User ID not found.");
20555
20561
  const spaceId = customSpaceId ?? selectCurrentSpaceId(state3);
20556
- const tableId = (0, import_ulid3.ulid)();
20562
+ const tableId = ulid4();
20557
20563
  const now = /* @__PURE__ */ new Date();
20558
20564
  const nowIso = (0, import_date_fns2.formatISO)(now);
20559
20565
  const dbKey = metaKey(userId, tableId);
@@ -20983,7 +20989,7 @@ var tableSlice = createSliceWithThunks3({
20983
20989
  try {
20984
20990
  const nowIso = (0, import_date_fns3.formatISO)(/* @__PURE__ */ new Date());
20985
20991
  const newColumn = {
20986
- id: (0, import_ulid4.ulid)(),
20992
+ id: ulid5(),
20987
20993
  name: columnName,
20988
20994
  // 默认显示名与机器名一致;之后用户可以单独改 label
20989
20995
  label: columnName
@@ -23140,7 +23146,7 @@ async function fetchUserData(db, types, userId, options = {}) {
23140
23146
  }
23141
23147
 
23142
23148
  // packages/create/space/addSpaceAction.ts
23143
- var import_ulid6 = __toESM(require_index_umd(), 1);
23149
+ import { ulid as ulid6 } from "ulid";
23144
23150
  async function getUserDataOnce({
23145
23151
  types,
23146
23152
  userId,
@@ -23173,7 +23179,7 @@ var addSpaceAction = async (input, thunkAPI) => {
23173
23179
  const state3 = getState();
23174
23180
  const accountUserId = selectIdentityUserId(state3);
23175
23181
  const userId = resolveEffectiveSpaceActorId(accountUserId);
23176
- const spaceId = (0, import_ulid6.ulid)();
23182
+ const spaceId = ulid6();
23177
23183
  const now = Date.now();
23178
23184
  const nowISO = new Date(now).toISOString();
23179
23185
  const spaceData = {
@@ -23757,7 +23763,7 @@ var fetchSpaceAction = async (input, thunkAPI) => {
23757
23763
  const spaceKey = createSpaceKey.space(spaceId);
23758
23764
  const readSpace = async (dbKey) => {
23759
23765
  try {
23760
- const { read: read2, readAndWait: readAndWait2 } = await import("./dbSlice-TO2TSMWM.js");
23766
+ const { read: read2, readAndWait: readAndWait2 } = await import("./dbSlice-LSKJDY2R.js");
23761
23767
  if (fresh) {
23762
23768
  return await dispatch(readAndWait2(dbKey)).unwrap();
23763
23769
  }
@@ -23998,76 +24004,6 @@ var dedupeMemberSpaces = (memberSpaces) => {
23998
24004
  });
23999
24005
  return Array.from(membershipMap.values());
24000
24006
  };
24001
- var extractTypedIdentityId = (key, type) => {
24002
- if (!key || !type || !key.startsWith(`${type}-`)) return null;
24003
- const parts = key.split("-");
24004
- if (parts.length < 2) return null;
24005
- if (parts.length >= 3) return parts.slice(2).join("-");
24006
- return parts[1] || null;
24007
- };
24008
- var isCanonicalTypedDbKey = (key, type) => {
24009
- if (!key || !type || !key.startsWith(`${type}-`)) return false;
24010
- const parts = key.split("-");
24011
- return parts.length >= 3;
24012
- };
24013
- var dedupeSpaceContents = (contents) => {
24014
- if (!contents) return { contents: {}, removedKeys: [], changed: false };
24015
- const entries = Object.entries(contents);
24016
- const sorted = [...entries].sort((a, b) => {
24017
- const aItem = a[1];
24018
- const bItem = b[1];
24019
- const aType = String(aItem?.type || "").toLowerCase();
24020
- const bType = String(bItem?.type || "").toLowerCase();
24021
- const aCanonical = isCanonicalTypedDbKey(a[0], aType) || isCanonicalTypedDbKey(String(aItem?.contentKey || ""), aType);
24022
- const bCanonical = isCanonicalTypedDbKey(b[0], bType) || isCanonicalTypedDbKey(String(bItem?.contentKey || ""), bType);
24023
- if (aCanonical !== bCanonical) return aCanonical ? -1 : 1;
24024
- const aUpdated = toTimestampMs(aItem?.updatedAt);
24025
- const bUpdated = toTimestampMs(bItem?.updatedAt);
24026
- return bUpdated - aUpdated;
24027
- });
24028
- let changed = false;
24029
- const deduped = {};
24030
- const seenIdentity = /* @__PURE__ */ new Set();
24031
- for (const [entryKey, item] of sorted) {
24032
- if (!item) {
24033
- if (Object.prototype.hasOwnProperty.call(deduped, entryKey)) changed = true;
24034
- else deduped[entryKey] = item;
24035
- continue;
24036
- }
24037
- const normalizedType = String(item.type || "").toLowerCase();
24038
- const currentContentKey = String(item.contentKey || entryKey);
24039
- const typedIdFromEntry = extractTypedIdentityId(entryKey, normalizedType);
24040
- const typedIdFromContent = extractTypedIdentityId(currentContentKey, normalizedType);
24041
- const identityId = typedIdFromEntry || typedIdFromContent || currentContentKey || entryKey;
24042
- const identity = `${normalizedType || "unknown"}:${identityId}`;
24043
- if (seenIdentity.has(identity)) {
24044
- changed = true;
24045
- continue;
24046
- }
24047
- seenIdentity.add(identity);
24048
- const contentKeyIsCanonical = isCanonicalTypedDbKey(
24049
- currentContentKey,
24050
- normalizedType
24051
- );
24052
- const entryKeyIsCanonical = isCanonicalTypedDbKey(entryKey, normalizedType);
24053
- const canonicalKey = contentKeyIsCanonical && currentContentKey || entryKeyIsCanonical && entryKey || entryKey;
24054
- const canonicalContentKey = contentKeyIsCanonical && currentContentKey || entryKeyIsCanonical && entryKey || currentContentKey;
24055
- if (canonicalKey !== entryKey || canonicalContentKey !== item.contentKey) {
24056
- changed = true;
24057
- }
24058
- deduped[canonicalKey] = {
24059
- ...item,
24060
- contentKey: canonicalContentKey
24061
- };
24062
- }
24063
- const removedKeys = Object.keys(contents).filter(
24064
- (key) => !Object.prototype.hasOwnProperty.call(deduped, key)
24065
- );
24066
- if (!changed && removedKeys.length > 0) {
24067
- changed = true;
24068
- }
24069
- return { contents: deduped, removedKeys, changed };
24070
- };
24071
24007
  var createSpaceThunks = (create) => ({
24072
24008
  // --- 读取当前设备下的空间侧边栏状态 ---
24073
24009
  fetchSpaceSidebarState: create.asyncThunk(fetchSpaceSidebarStateAction, {
@@ -24161,107 +24097,7 @@ var createSpaceThunks = (create) => ({
24161
24097
  state3.initialized = true;
24162
24098
  }
24163
24099
  }
24164
- }),
24165
- fixSpace: create.asyncThunk(
24166
- async (spaceId, thunkAPI) => {
24167
- const spaceKey = createSpaceKey.space(spaceId);
24168
- const spaceData = await thunkAPI.dispatch(
24169
- read({ dbKey: spaceKey })
24170
- ).unwrap();
24171
- if (!spaceData) {
24172
- throw new Error("\u7A7A\u95F4\u4E0D\u5B58\u5728");
24173
- }
24174
- const changes = {};
24175
- const spaceDataId = String(spaceData.id || "");
24176
- if (spaceDataId.startsWith("space-")) {
24177
- changes.id = spaceDataId.slice(6);
24178
- }
24179
- const {
24180
- contents: dedupedContents,
24181
- removedKeys,
24182
- changed: deduped
24183
- } = dedupeSpaceContents(spaceData.contents);
24184
- const agentReferenceEntries = Object.entries(dedupedContents).filter(
24185
- ([entryKey, item]) => {
24186
- if (!item) return false;
24187
- const normalizedType = String(item.type || "").toLowerCase();
24188
- const contentKey = String(item.contentKey || entryKey);
24189
- return normalizedType === "agent" || contentKey.startsWith("agent-") || entryKey.startsWith("agent-");
24190
- }
24191
- );
24192
- const orphanAgentEntryKeys = (await Promise.all(
24193
- agentReferenceEntries.map(async ([entryKey, item]) => {
24194
- const dbKey = String(item?.contentKey || entryKey);
24195
- try {
24196
- const entity = await thunkAPI.dispatch(
24197
- read({ dbKey })
24198
- ).unwrap();
24199
- return entity ? null : entryKey;
24200
- } catch {
24201
- return entryKey;
24202
- }
24203
- })
24204
- )).filter((key) => !!key);
24205
- let contentChanges = null;
24206
- if (deduped) {
24207
- contentChanges = { ...dedupedContents };
24208
- for (const removedKey of removedKeys) {
24209
- if (!Object.prototype.hasOwnProperty.call(contentChanges, removedKey)) {
24210
- contentChanges[removedKey] = null;
24211
- }
24212
- }
24213
- }
24214
- if (orphanAgentEntryKeys.length > 0) {
24215
- if (!contentChanges) contentChanges = { ...dedupedContents };
24216
- orphanAgentEntryKeys.forEach((entryKey) => {
24217
- contentChanges[entryKey] = null;
24218
- });
24219
- }
24220
- if (contentChanges) {
24221
- changes.contents = contentChanges;
24222
- }
24223
- if (Object.keys(changes).length === 0) {
24224
- return {
24225
- repaired: false,
24226
- deduped: false,
24227
- prunedOrphanAgentRefs: 0,
24228
- spaceData
24229
- };
24230
- }
24231
- changes.updatedAt = Math.max(
24232
- Date.now(),
24233
- toTimestampMs(spaceData.updatedAt) + 1
24234
- );
24235
- await thunkAPI.dispatch(
24236
- patch({ dbKey: spaceKey, changes })
24237
- ).unwrap();
24238
- const refreshedSpaceData = await thunkAPI.dispatch(
24239
- read({ dbKey: spaceKey })
24240
- ).unwrap();
24241
- return {
24242
- repaired: true,
24243
- deduped,
24244
- prunedOrphanAgentRefs: orphanAgentEntryKeys.length,
24245
- spaceData: refreshedSpaceData || { ...spaceData, ...changes }
24246
- };
24247
- },
24248
- {
24249
- fulfilled: (state3, action2) => {
24250
- if (state3.currentSpaceId !== action2.meta.arg) return;
24251
- const nextSpace = action2.payload.spaceData;
24252
- if (!nextSpace) return;
24253
- if (!state3.currentSpace) {
24254
- state3.currentSpace = nextSpace;
24255
- return;
24256
- }
24257
- const currentUpdatedAt = toTimestampMs(state3.currentSpace.updatedAt);
24258
- const nextUpdatedAt2 = toTimestampMs(nextSpace.updatedAt);
24259
- if (nextUpdatedAt2 > currentUpdatedAt) {
24260
- state3.currentSpace = nextSpace;
24261
- }
24262
- }
24263
- }
24264
- )
24100
+ })
24265
24101
  });
24266
24102
 
24267
24103
  // packages/create/space/spaceEventCore.ts
@@ -24313,6 +24149,25 @@ var DEFAULT_COLLAPSED_CATEGORIES = {
24313
24149
  var createSliceWithThunks4 = buildCreateSlice({
24314
24150
  creators: { asyncThunk: asyncThunkCreator }
24315
24151
  });
24152
+ var FAVORITES_COLLAPSED_STORAGE_KEY = "nolo-sidebar-favorites-collapsed";
24153
+ var readStoredFavoritesCollapsed = () => {
24154
+ try {
24155
+ if (typeof window === "undefined") return false;
24156
+ return window.localStorage.getItem(FAVORITES_COLLAPSED_STORAGE_KEY) === "1";
24157
+ } catch {
24158
+ return false;
24159
+ }
24160
+ };
24161
+ var writeStoredFavoritesCollapsed = (collapsed) => {
24162
+ try {
24163
+ if (typeof window === "undefined") return;
24164
+ window.localStorage.setItem(
24165
+ FAVORITES_COLLAPSED_STORAGE_KEY,
24166
+ collapsed ? "1" : "0"
24167
+ );
24168
+ } catch {
24169
+ }
24170
+ };
24316
24171
  var initialState4 = {
24317
24172
  currentSpaceId: null,
24318
24173
  currentSpace: null,
@@ -24327,7 +24182,8 @@ var initialState4 = {
24327
24182
  dialogTitles: {},
24328
24183
  // 第一层网页体验:对话切走后仍可在 sidebar 感知其运行中/已完成。
24329
24184
  // 多窗口/多 tab 的已读同步语义暂不在这里定义,等桌面端阶段统一设计。
24330
- unreadDialogIds: {}
24185
+ unreadDialogIds: {},
24186
+ favoritesCollapsed: readStoredFavoritesCollapsed()
24331
24187
  };
24332
24188
  var getSpaceUpdatedAt2 = (space) => {
24333
24189
  if (!space) return 0;
@@ -24364,6 +24220,7 @@ var spaceSlice = createSliceWithThunks4({
24364
24220
  state3.memberSpaces = null;
24365
24221
  state3.collapsedCategories = {};
24366
24222
  state3.viewMode = "all";
24223
+ state3.favoritesCollapsed = readStoredFavoritesCollapsed();
24367
24224
  state3.initialized = false;
24368
24225
  state3.loading = false;
24369
24226
  state3.error = void 0;
@@ -24377,6 +24234,11 @@ var spaceSlice = createSliceWithThunks4({
24377
24234
  setViewMode: create.reducer((state3, action2) => {
24378
24235
  state3.viewMode = action2.payload;
24379
24236
  }),
24237
+ /** 切换侧边栏「我的收藏」专区折叠态,并持久化到 localStorage */
24238
+ toggleFavoritesCollapse: create.reducer((state3) => {
24239
+ state3.favoritesCollapsed = !state3.favoritesCollapsed;
24240
+ writeStoredFavoritesCollapsed(state3.favoritesCollapsed);
24241
+ }),
24380
24242
  /** 用本地缓存先恢复空间列表,远端校验完成后再由 fetchUserSpaceMemberships.fulfilled 覆盖。 */
24381
24243
  hydrateMemberSpacesFromLocal: create.reducer(
24382
24244
  (state3, action2) => {
@@ -24449,12 +24311,12 @@ var {
24449
24311
  fetchUserSpaceMemberships,
24450
24312
  addMember,
24451
24313
  removeMember,
24452
- fixSpace,
24453
24314
  fetchSpaceSidebarState,
24454
24315
  applySpaceEvent,
24455
24316
  markDialogRead,
24456
24317
  resetSpace,
24457
24318
  setViewMode,
24319
+ toggleFavoritesCollapse,
24458
24320
  hydrateMemberSpacesFromLocal
24459
24321
  } = spaceSlice.actions;
24460
24322
  var selectSpaceState = (state3) => state3.space;
@@ -24514,6 +24376,10 @@ var selectIsCategoryCollapsed = (categoryId) => createSelector(
24514
24376
  selectCollapsedCategories,
24515
24377
  (collapsed) => collapsed[categoryId] ?? (DEFAULT_COLLAPSED_CATEGORIES[categoryId] ?? true)
24516
24378
  );
24379
+ var selectFavoritesCollapsed = createSelector(
24380
+ selectSpaceState,
24381
+ (space) => space.favoritesCollapsed ?? false
24382
+ );
24517
24383
  var selectDialogStatuses = createSelector(
24518
24384
  selectSpaceState,
24519
24385
  (space) => space.dialogStatuses ?? {}
@@ -24617,12 +24483,12 @@ export {
24617
24483
  fetchUserSpaceMemberships,
24618
24484
  addMember,
24619
24485
  removeMember,
24620
- fixSpace,
24621
24486
  fetchSpaceSidebarState,
24622
24487
  applySpaceEvent,
24623
24488
  markDialogRead,
24624
24489
  resetSpace,
24625
24490
  setViewMode,
24491
+ toggleFavoritesCollapse,
24626
24492
  hydrateMemberSpacesFromLocal,
24627
24493
  selectCurrentSpaceId,
24628
24494
  selectCurrentSpace,
@@ -24633,6 +24499,7 @@ export {
24633
24499
  selectSpaceInitialized,
24634
24500
  selectCollapsedCategories,
24635
24501
  selectIsCategoryCollapsed,
24502
+ selectFavoritesCollapsed,
24636
24503
  selectDialogStatuses,
24637
24504
  selectDialogEventTimestamps,
24638
24505
  selectDialogTitles,
@@ -1,10 +1,18 @@
1
+ import {
2
+ buildCurrentTimeBlock,
3
+ buildIdentityBlock,
4
+ buildRuntimeGuidanceBlocks
5
+ } from "./chunk-AGFH73SK.js";
6
+ import {
7
+ canonicalizeToolNames
8
+ } from "./chunk-P3PKED2I.js";
1
9
  import {
2
10
  clipCompactText
3
11
  } from "./chunk-5MMAK75Q.js";
4
12
  import {
5
13
  findModelConfig,
6
14
  getProviderByModelName
7
- } from "./chunk-572EKYLF.js";
15
+ } from "./chunk-BBYVOSU2.js";
8
16
  import {
9
17
  compactWhitespace
10
18
  } from "./chunk-DWLEOOGR.js";
@@ -625,9 +633,31 @@ async function runLocalAgentTurn(input) {
625
633
  throw error;
626
634
  }
627
635
  const history = input.continueDialogId ? await input.adapter.loadDialogHistory(input.continueDialogId) : [];
636
+ const identityBlock = buildIdentityBlock({
637
+ agentName: agentConfig.name,
638
+ agentId: agentConfig.key,
639
+ model: agentConfig.model
640
+ });
641
+ const agentTools = canonicalizeToolNames(agentConfig.toolNames ?? []);
642
+ const guidanceBlocks = buildRuntimeGuidanceBlocks(agentTools);
643
+ const guidanceScopes = [
644
+ guidanceBlocks.startupProtocol,
645
+ guidanceBlocks.contextLayerContract,
646
+ guidanceBlocks.emailRegistrationWorkflow,
647
+ guidanceBlocks.webResearchToolPolicy
648
+ ].map((content) => content.trim()).filter((content) => content.length > 0).map((content) => ({ content, cacheScope: "session" }));
649
+ const currentTimeScope = [
650
+ { content: buildCurrentTimeBlock(/* @__PURE__ */ new Date(), void 0), cacheScope: "turn" }
651
+ ];
652
+ const mergedContextBlockScopes = [
653
+ { content: identityBlock, cacheScope: "session" },
654
+ ...guidanceScopes,
655
+ ...currentTimeScope,
656
+ ...input.contextBlockScopes ?? []
657
+ ];
628
658
  const hasContextBlocks = (input.contextBlocks ?? []).some(
629
659
  (block) => block.trim()
630
- ) || (input.contextBlockScopes ?? []).some(
660
+ ) || mergedContextBlockScopes.some(
631
661
  (block) => block.content.trim()
632
662
  );
633
663
  const promptMessageCount = agentConfig.prompt?.trim() || hasContextBlocks ? 1 : 0;
@@ -635,7 +665,7 @@ async function runLocalAgentTurn(input) {
635
665
  const messages = buildMessages({
636
666
  prompt: agentConfig.prompt,
637
667
  contextBlocks: input.contextBlocks,
638
- contextBlockScopes: input.contextBlockScopes,
668
+ contextBlockScopes: mergedContextBlockScopes,
639
669
  history,
640
670
  input: input.input
641
671
  });
@@ -15,7 +15,7 @@ import {
15
15
  resolvePlatformServerUrl,
16
16
  resolveProviderTransportDecision,
17
17
  toResponsesTools
18
- } from "./chunk-XDVAYP26.js";
18
+ } from "./chunk-JRKKFRAV.js";
19
19
 
20
20
  // packages/agent-runtime/openAiCompatibleMessages.ts
21
21
  function toOpenAiCompatibleMessages(messages) {
@@ -7,7 +7,7 @@ import {
7
7
  toTimestampMs,
8
8
  upsert,
9
9
  write
10
- } from "./chunk-V2AISYMA.js";
10
+ } from "./chunk-KPSWSDUF.js";
11
11
  import {
12
12
  asRecordOrEmpty
13
13
  } from "./chunk-KX6YBIHG.js";
@@ -15,7 +15,7 @@ import {
15
15
  createUserKey,
16
16
  createUserPreferenceKey,
17
17
  ulid
18
- } from "./chunk-SH2CFQOH.js";
18
+ } from "./chunk-O4BU24WZ.js";
19
19
  import {
20
20
  asTrimmedLowercaseString
21
21
  } from "./chunk-QSJ3HFEF.js";
@@ -919,8 +919,8 @@ var initialState = {
919
919
  editorTabSize: 2,
920
920
  editorFontFamily: "SF Mono, Monaco, Cascadia Code, Roboto Mono, monospace",
921
921
  enableReadCurrentSpace: true,
922
- globalPrompt: "\u4EE5\u4E0B\u662F\u5173\u4E8E\u6211\u7684\u901A\u7528\u8BF4\u660E\uFF0C\u8BF7\u5728\u4EFB\u610F\u573A\u666F\u4E0B\u90FD\u4EE5\u6B64\u6765\u7406\u89E3\u548C\u670D\u52A1\u6211\uFF1A\n1. \u6211\u5E0C\u671B\u4F60\u7528\u6E05\u6670\u3001\u7B80\u6D01\u7684\u65B9\u5F0F\u56DE\u7B54\u95EE\u9898\uFF0C\u5E76\u5728\u5FC5\u8981\u65F6\u7ED9\u51FA\u793A\u4F8B\u3002\n2. \u5982\u679C\u6709\u591A\u79CD\u89E3\u51B3\u65B9\u6848\uFF0C\u8BF7\u5148\u7ED9\u51FA\u63A8\u8350\u65B9\u6848\uFF0C\u518D\u7B80\u8981\u8BF4\u660E\u5176\u4ED6\u65B9\u6848\u7684\u4F18\u7F3A\u70B9\u3002\n3. \u5F53\u4F60\u4E0D\u786E\u5B9A\u7B54\u6848\u65F6\uFF0C\u8BF7\u660E\u786E\u8BF4\u660E\u4E0D\u786E\u5B9A\uFF0C\u5E76\u63A8\u6D4B\u53EF\u80FD\u7684\u65B9\u5411\uFF0C\u800C\u4E0D\u662F\u7F16\u9020\u4E8B\u5B9E\u3002\n4. \u5982\u679C\u6D89\u53CA\u4EE3\u7801\uFF0C\u8BF7\u4F18\u5148\u4F7F\u7528\u73B0\u4EE3\u3001\u901A\u7528\u7684\u6700\u4F73\u5B9E\u8DF5\u3002",
923
- userTonePreset: DEFAULT_USER_PREFERENCE_PROFILE.tone?.preset ?? "default",
922
+ globalPrompt: "",
923
+ userTonePreset: "",
924
924
  knowledgeCaptureLevel: DEFAULT_USER_PREFERENCE_PROFILE.knowledgeCaptureLevel,
925
925
  spaceContextLevel: DEFAULT_USER_PREFERENCE_PROFILE.spaceContextLevel,
926
926
  autoApproveSelfUpdateFields: [...DEFAULT_AUTO_APPROVED_SELF_UPDATE_FIELDS],