nolo-cli 0.8.0-alpha.15 → 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-KUP2WVMT.js → _executeModel-BOMQGOZC.js} +33 -30
  3. package/{action-ZJWE3Y5S.js → action-AEHDRQHP.js} +4 -4
  4. package/{addContentAction-TVDBNJM5.js → addContentAction-OL5YQ6LW.js} +3 -3
  5. package/{addDialogAgentAction-EKH774VT.js → addDialogAgentAction-XU5Y2E2X.js} +2 -2
  6. package/{agentDeleteCommand-GNVYHOGZ.js → agentDeleteCommand-5DD2IM3J.js} +12 -11
  7. package/{agentEmailCommands-VSPS3MZT.js → agentEmailCommands-SE7MBTAG.js} +35 -32
  8. package/{agentListCommands-FM4OWXYT.js → agentListCommands-I6KZYCIG.js} +13 -12
  9. package/{agentMachineCommands-7EK7IKEV.js → agentMachineCommands-SBYN6EXT.js} +13 -12
  10. package/{agentRecordCommands-GYLQ5OA6.js → agentRecordCommands-F74NBFOZ.js} +35 -32
  11. package/{agentRunCommand-KL2A7CGA.js → agentRunCommand-3DGDK4Y3.js} +41 -36
  12. package/{agentRuntimeLocal-XL5PLRJV.js → agentRuntimeLocal-ZYEIPTY4.js} +9 -8
  13. package/{agentSlice-OEHVCG26.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-M2GJTPUU.js → chunk-2BIV3FMX.js} +25 -236
  17. package/{chunk-MGOJ5R6J.js → chunk-2NNJ6S5U.js} +1 -1
  18. package/{chunk-KTVVPRJS.js → chunk-2T2C6CNY.js} +2 -2
  19. package/{chunk-E7LCFMW5.js → chunk-4NDK6NWB.js} +86 -113
  20. package/{chunk-HBY2MXIN.js → chunk-4P2MDGKS.js} +76 -211
  21. package/{chunk-MXLQWBVM.js → chunk-4QEWT7KD.js} +33 -3
  22. package/{chunk-DSNONPGW.js → chunk-5KLGBAAR.js} +1 -1
  23. package/{chunk-TSS3XJY4.js → chunk-64AAZRGY.js} +2 -2
  24. package/{chunk-BZMZUAFJ.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-FY3KVW36.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-AURGW6TR.js → chunk-IEKTE4JQ.js} +2 -2
  37. package/{chunk-BR2WP3DF.js → chunk-IWX4UW2E.js} +9 -9
  38. package/{chunk-AWCQ2SK4.js → chunk-IX4C5TCO.js} +3 -3
  39. package/{chunk-6GANEXVO.js → chunk-JRCUAPXX.js} +1 -1
  40. package/{chunk-XDVAYP26.js → chunk-JRKKFRAV.js} +1 -1
  41. package/{chunk-COMXDWNM.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-PA23IU5W.js → chunk-OFM4S5P3.js} +13 -13
  48. package/{chunk-ZJDUYY3D.js → chunk-OI54SUZ7.js} +6 -6
  49. package/{chunk-63SLEOLK.js → chunk-OZNNTJM7.js} +2 -2
  50. package/{chunk-DG7AAAR3.js → chunk-P3PKED2I.js} +62 -2
  51. package/{chunk-NGXGGF4K.js → chunk-PY4NLIAF.js} +1 -1
  52. package/{chunk-7IPLJUYC.js → chunk-RL776AGR.js} +1 -1
  53. package/{chunk-MTAJCUIC.js → chunk-RM7KF6OT.js} +41 -22
  54. package/{chunk-RJKDVL4L.js → chunk-SDJDLO5W.js} +2 -2
  55. package/{chunk-N5Z5DMDD.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-4P3XCCG2.js → chunk-YRG2GO6E.js} +210 -63
  63. package/{cliExecutor-DNE7TCC4.js → cliExecutor-K3F7DMRO.js} +2 -2
  64. package/{createAgentAutomationAction-KY7OQ4YJ.js → createAgentAutomationAction-MBUL3ALA.js} +12 -12
  65. package/{createDialogAction-CWPWISDF.js → createDialogAction-3JLD4VED.js} +16 -15
  66. package/{createPageAction-GDQVH2DC.js → createPageAction-Z2AOWGIW.js} +17 -16
  67. package/{dbSlice-PR44QPXY.js → dbSlice-LSKJDY2R.js} +2 -2
  68. package/{dialogCommands-DWSE4PMW.js → dialogCommands-4IX4XIZE.js} +14 -13
  69. package/{dialogSlice-2EX2IPKM.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-BDZODEOU.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-3ZTXMDDU.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-7PL6UCMC.js → machineCommands-GPEWO27H.js} +37 -34
  81. package/{machineWsRunDispatch-Q6XZLVQE.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-6S37COYT.js → readlineWorkspace-UL4LXWHX.js} +252 -78
  85. package/{removeDialogAgentAction-GJQJNDW6.js → removeDialogAgentAction-U3CP2M2H.js} +4 -4
  86. package/{runAgentClientLoop-Y2LTIWEU.js → runAgentClientLoop-KKV7BWWC.js} +27 -24
  87. package/{setDialogExtraReferencesAction-M7OQG54N.js → setDialogExtraReferencesAction-S7GUFLTN.js} +2 -2
  88. package/{setPrimaryDialogAgentAction-46UNFJDL.js → setPrimaryDialogAgentAction-5SF7G5OS.js} +4 -4
  89. package/{settingSlice-FVUUH4JA.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-ULWMVNFC.js → spaceSlice-KIDVQWOV.js} +16 -14
  93. package/{streamAgentChatTurn-J4YW33EM.js → streamAgentChatTurn-YQH6ZGE6.js} +41 -36
  94. package/{tools-753HRGSD.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-PXLE3P4E.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-BZMZUAFJ.js";
18
+ } from "./chunk-6RSAUKSQ.js";
19
19
  import {
20
20
  cleanupCliSessionForDialog
21
- } from "./chunk-KTVVPRJS.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-MGOJ5R6J.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-TSS3XJY4.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-COMXDWNM.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
  }
@@ -11969,6 +11968,7 @@ function add(message, type, options) {
11969
11968
  icon: options?.icon,
11970
11969
  description: options?.description,
11971
11970
  action: options?.action,
11971
+ position: options?.position,
11972
11972
  // loading toasts stay until explicitly replaced/closed (timeout=0)
11973
11973
  timeout: type === "loading" ? timeout ?? 0 : timeout ?? DEFAULT_TIMEOUT
11974
11974
  });
@@ -13609,6 +13609,10 @@ function buildFallbackActivity(toolName, args) {
13609
13609
  refs: [{ type: "file", path }]
13610
13610
  };
13611
13611
  }
13612
+ case "loadSkill": {
13613
+ const name = asTrimmedString(args.name);
13614
+ return name ? { title: "\u52A0\u8F7D\u6280\u80FD", detail: name } : void 0;
13615
+ }
13612
13616
  case "execShell": {
13613
13617
  const command = asTrimmedString(
13614
13618
  typeof args.cmd === "string" ? args.cmd : args.command
@@ -14036,7 +14040,7 @@ async function captureUnderstandingFromCompletedUiTurn(input) {
14036
14040
  if (!input.agentKey) return;
14037
14041
  const latestUserInput = getLatestUserInputFromMessages(input.messages);
14038
14042
  if (!latestUserInput) return;
14039
- const { captureUnderstandingMemoryFromDialog } = await import("./understanding-GQKNDDWM.js");
14043
+ const { captureUnderstandingMemoryFromDialog } = await import("./understanding-3CUQQ6SV.js");
14040
14044
  await captureUnderstandingMemoryFromDialog({
14041
14045
  db: input.db,
14042
14046
  userId: selectIdentityUserId(input.state),
@@ -14961,7 +14965,7 @@ var messageSlice = createSliceWithThunks({
14961
14965
  runtimeOptions: args.runtimeOptions
14962
14966
  });
14963
14967
  if (agentKeyToUse) {
14964
- const { streamAgentChatTurn } = await import("./agentSlice-OEHVCG26.js");
14968
+ const { streamAgentChatTurn } = await import("./agentSlice-XEH6Y334.js");
14965
14969
  await dispatch(
14966
14970
  streamAgentChatTurn({
14967
14971
  agentKey: agentKeyToUse,
@@ -15079,8 +15083,8 @@ function clearWorkflow() {
15079
15083
  }
15080
15084
 
15081
15085
  // packages/chat/dialog/actions/updateTokensAction.ts
15082
- var import_ulid2 = __toESM(require_index_umd());
15083
15086
  var import_date_fns = __toESM(require_date_fns());
15087
+ import { ulid as ulid3 } from "ulid";
15084
15088
 
15085
15089
  // packages/ai/token/saveTokenRecord.ts
15086
15090
  var import_pino = __toESM(require_pino());
@@ -17333,7 +17337,7 @@ var saveTokenUsage = async (data, thunkApi) => {
17333
17337
  );
17334
17338
  return {
17335
17339
  success: true,
17336
- id: (0, import_ulid2.ulid)(Date.now()),
17340
+ id: ulid3(Date.now()),
17337
17341
  record: updatedStats
17338
17342
  };
17339
17343
  } catch (error) {
@@ -17379,7 +17383,7 @@ var updateTokensAction = async ({ dialogId, dialogKey, usage: usageRaw, agentCon
17379
17383
  const persistedTokenData = {
17380
17384
  ...tokenData,
17381
17385
  type: "token" /* TOKEN */,
17382
- id: (0, import_ulid2.ulid)(timestamp),
17386
+ id: ulid3(timestamp),
17383
17387
  dateKey: (0, import_date_fns.format)(timestamp, "yyyy-MM-dd"),
17384
17388
  // Keep the same clock used for id/dateKey so record keys never see
17385
17389
  // undefined when a prepare helper omits timestamp.
@@ -17569,7 +17573,7 @@ var deleteDialogThunk = async (payload, thunkApi) => {
17569
17573
  }
17570
17574
  if (isCurrentDialog) {
17571
17575
  await thunkApi.dispatch(resetMsgs());
17572
- const { clearPendingAttachments: clearPendingAttachments2 } = await import("./dialogSlice-2EX2IPKM.js");
17576
+ const { clearPendingAttachments: clearPendingAttachments2 } = await import("./dialogSlice-NRQ5WIJO.js");
17573
17577
  dispatch(clearPendingAttachments2());
17574
17578
  clearWorkflow();
17575
17579
  }
@@ -17578,35 +17582,35 @@ var deleteDialogThunk = async (payload, thunkApi) => {
17578
17582
 
17579
17583
  // packages/chat/dialog/dialogSlice.ts
17580
17584
  var runCreateDialogAction = async (args, thunkApi) => {
17581
- const { createDialogAction } = await import("./createDialogAction-CWPWISDF.js");
17585
+ const { createDialogAction } = await import("./createDialogAction-3JLD4VED.js");
17582
17586
  return createDialogAction(args, thunkApi);
17583
17587
  };
17584
17588
  var runCreateAgentAutomationAction = async (args, thunkApi) => {
17585
- const { createAgentAutomationAction } = await import("./createAgentAutomationAction-KY7OQ4YJ.js");
17589
+ const { createAgentAutomationAction } = await import("./createAgentAutomationAction-MBUL3ALA.js");
17586
17590
  return createAgentAutomationAction(args, thunkApi);
17587
17591
  };
17588
17592
  var runUpdateDialogTitleAction = async (args, thunkApi) => {
17589
- const { updateDialogTitleAction } = await import("./updateDialogTitleAction-PXLE3P4E.js");
17593
+ const { updateDialogTitleAction } = await import("./updateDialogTitleAction-JHAVYVIP.js");
17590
17594
  return updateDialogTitleAction(args, thunkApi);
17591
17595
  };
17592
17596
  var runAddDialogAgentAction = async (args, thunkApi) => {
17593
- const { addDialogAgentAction } = await import("./addDialogAgentAction-EKH774VT.js");
17597
+ const { addDialogAgentAction } = await import("./addDialogAgentAction-XU5Y2E2X.js");
17594
17598
  return addDialogAgentAction(args, thunkApi);
17595
17599
  };
17596
17600
  var runRemoveDialogAgentAction = async (args, thunkApi) => {
17597
- const { removeDialogAgentAction } = await import("./removeDialogAgentAction-GJQJNDW6.js");
17601
+ const { removeDialogAgentAction } = await import("./removeDialogAgentAction-U3CP2M2H.js");
17598
17602
  return removeDialogAgentAction(args, thunkApi);
17599
17603
  };
17600
17604
  var runSetPrimaryDialogAgentAction = async (args, thunkApi) => {
17601
- const { setPrimaryDialogAgentAction } = await import("./setPrimaryDialogAgentAction-46UNFJDL.js");
17605
+ const { setPrimaryDialogAgentAction } = await import("./setPrimaryDialogAgentAction-5SF7G5OS.js");
17602
17606
  return setPrimaryDialogAgentAction(args, thunkApi);
17603
17607
  };
17604
17608
  var runSetDialogExtraReferencesAction = async (args, thunkApi) => {
17605
- const { setDialogExtraReferencesAction } = await import("./setDialogExtraReferencesAction-M7OQG54N.js");
17609
+ const { setDialogExtraReferencesAction } = await import("./setDialogExtraReferencesAction-S7GUFLTN.js");
17606
17610
  return setDialogExtraReferencesAction(args, thunkApi);
17607
17611
  };
17608
17612
  var runHandleSendMessageAction = async (args, thunkApi) => {
17609
- const { handleSendMessageAction } = await import("./handleSendMessageAction-3ZTXMDDU.js");
17613
+ const { handleSendMessageAction } = await import("./handleSendMessageAction-G3WLT6I7.js");
17610
17614
  return handleSendMessageAction(args, thunkApi);
17611
17615
  };
17612
17616
  function clearDialogState() {
@@ -17619,7 +17623,7 @@ var createPageAndAddReference = createAsyncThunk(
17619
17623
  async (payload, { dispatch, getState, rejectWithValue }) => {
17620
17624
  const { slateData, jsonData, title, type, fileId, groupId, dialogKey } = payload;
17621
17625
  try {
17622
- const { createDocState } = await import("./docStore-BDZODEOU.js");
17626
+ const { createDocState } = await import("./docStore-DBFNPMHU.js");
17623
17627
  const pageKey = await createDocState(
17624
17628
  { slateData, title },
17625
17629
  { dispatch, getState }
@@ -17777,7 +17781,7 @@ var selectTotalDialogTokens = selectCurrentDialogTokens;
17777
17781
 
17778
17782
  // packages/render/table/tableSlice.ts
17779
17783
  var import_date_fns3 = __toESM(require_date_fns(), 1);
17780
- var import_ulid4 = __toESM(require_index_umd(), 1);
17784
+ import { ulid as ulid5 } from "ulid";
17781
17785
 
17782
17786
  // packages/render/table/fetchAndCacheTableRows.ts
17783
17787
  var getRowTimestamp = (row) => {
@@ -17976,7 +17980,7 @@ var fetchAndCacheTableRows = async ({
17976
17980
 
17977
17981
  // packages/render/table/createTableAction.ts
17978
17982
  var import_date_fns2 = __toESM(require_date_fns(), 1);
17979
- var import_ulid3 = __toESM(require_index_umd(), 1);
17983
+ import { ulid as ulid4 } from "ulid";
17980
17984
 
17981
17985
  // node_modules/i18next/dist/esm/i18next.js
17982
17986
  var consoleLogger = {
@@ -20480,7 +20484,7 @@ var normalizeColumns = (inputColumns) => {
20480
20484
  const name = c.name.trim();
20481
20485
  if (!name) return null;
20482
20486
  const col = {
20483
- id: asOptionalTrimmedString(c.id) ?? (0, import_ulid3.ulid)(),
20487
+ id: asOptionalTrimmedString(c.id) ?? ulid4(),
20484
20488
  name
20485
20489
  };
20486
20490
  const label = asOptionalTrimmedString(c.label);
@@ -20512,7 +20516,7 @@ var normalizeColumns = (inputColumns) => {
20512
20516
  }
20513
20517
  return DEFAULT_COLUMNS.map((c) => ({
20514
20518
  ...c,
20515
- id: (0, import_ulid3.ulid)()
20519
+ id: ulid4()
20516
20520
  }));
20517
20521
  };
20518
20522
  var normalizeStringArray2 = (value) => {
@@ -20555,7 +20559,7 @@ var createTableAction = async ({
20555
20559
  const userId = selectIdentityUserId(state3);
20556
20560
  if (!userId) throw new Error("User ID not found.");
20557
20561
  const spaceId = customSpaceId ?? selectCurrentSpaceId(state3);
20558
- const tableId = (0, import_ulid3.ulid)();
20562
+ const tableId = ulid4();
20559
20563
  const now = /* @__PURE__ */ new Date();
20560
20564
  const nowIso = (0, import_date_fns2.formatISO)(now);
20561
20565
  const dbKey = metaKey(userId, tableId);
@@ -20985,7 +20989,7 @@ var tableSlice = createSliceWithThunks3({
20985
20989
  try {
20986
20990
  const nowIso = (0, import_date_fns3.formatISO)(/* @__PURE__ */ new Date());
20987
20991
  const newColumn = {
20988
- id: (0, import_ulid4.ulid)(),
20992
+ id: ulid5(),
20989
20993
  name: columnName,
20990
20994
  // 默认显示名与机器名一致;之后用户可以单独改 label
20991
20995
  label: columnName
@@ -23142,7 +23146,7 @@ async function fetchUserData(db, types, userId, options = {}) {
23142
23146
  }
23143
23147
 
23144
23148
  // packages/create/space/addSpaceAction.ts
23145
- var import_ulid6 = __toESM(require_index_umd(), 1);
23149
+ import { ulid as ulid6 } from "ulid";
23146
23150
  async function getUserDataOnce({
23147
23151
  types,
23148
23152
  userId,
@@ -23175,7 +23179,7 @@ var addSpaceAction = async (input, thunkAPI) => {
23175
23179
  const state3 = getState();
23176
23180
  const accountUserId = selectIdentityUserId(state3);
23177
23181
  const userId = resolveEffectiveSpaceActorId(accountUserId);
23178
- const spaceId = (0, import_ulid6.ulid)();
23182
+ const spaceId = ulid6();
23179
23183
  const now = Date.now();
23180
23184
  const nowISO = new Date(now).toISOString();
23181
23185
  const spaceData = {
@@ -23759,7 +23763,7 @@ var fetchSpaceAction = async (input, thunkAPI) => {
23759
23763
  const spaceKey = createSpaceKey.space(spaceId);
23760
23764
  const readSpace = async (dbKey) => {
23761
23765
  try {
23762
- const { read: read2, readAndWait: readAndWait2 } = await import("./dbSlice-PR44QPXY.js");
23766
+ const { read: read2, readAndWait: readAndWait2 } = await import("./dbSlice-LSKJDY2R.js");
23763
23767
  if (fresh) {
23764
23768
  return await dispatch(readAndWait2(dbKey)).unwrap();
23765
23769
  }
@@ -24000,76 +24004,6 @@ var dedupeMemberSpaces = (memberSpaces) => {
24000
24004
  });
24001
24005
  return Array.from(membershipMap.values());
24002
24006
  };
24003
- var extractTypedIdentityId = (key, type) => {
24004
- if (!key || !type || !key.startsWith(`${type}-`)) return null;
24005
- const parts = key.split("-");
24006
- if (parts.length < 2) return null;
24007
- if (parts.length >= 3) return parts.slice(2).join("-");
24008
- return parts[1] || null;
24009
- };
24010
- var isCanonicalTypedDbKey = (key, type) => {
24011
- if (!key || !type || !key.startsWith(`${type}-`)) return false;
24012
- const parts = key.split("-");
24013
- return parts.length >= 3;
24014
- };
24015
- var dedupeSpaceContents = (contents) => {
24016
- if (!contents) return { contents: {}, removedKeys: [], changed: false };
24017
- const entries = Object.entries(contents);
24018
- const sorted = [...entries].sort((a, b) => {
24019
- const aItem = a[1];
24020
- const bItem = b[1];
24021
- const aType = String(aItem?.type || "").toLowerCase();
24022
- const bType = String(bItem?.type || "").toLowerCase();
24023
- const aCanonical = isCanonicalTypedDbKey(a[0], aType) || isCanonicalTypedDbKey(String(aItem?.contentKey || ""), aType);
24024
- const bCanonical = isCanonicalTypedDbKey(b[0], bType) || isCanonicalTypedDbKey(String(bItem?.contentKey || ""), bType);
24025
- if (aCanonical !== bCanonical) return aCanonical ? -1 : 1;
24026
- const aUpdated = toTimestampMs(aItem?.updatedAt);
24027
- const bUpdated = toTimestampMs(bItem?.updatedAt);
24028
- return bUpdated - aUpdated;
24029
- });
24030
- let changed = false;
24031
- const deduped = {};
24032
- const seenIdentity = /* @__PURE__ */ new Set();
24033
- for (const [entryKey, item] of sorted) {
24034
- if (!item) {
24035
- if (Object.prototype.hasOwnProperty.call(deduped, entryKey)) changed = true;
24036
- else deduped[entryKey] = item;
24037
- continue;
24038
- }
24039
- const normalizedType = String(item.type || "").toLowerCase();
24040
- const currentContentKey = String(item.contentKey || entryKey);
24041
- const typedIdFromEntry = extractTypedIdentityId(entryKey, normalizedType);
24042
- const typedIdFromContent = extractTypedIdentityId(currentContentKey, normalizedType);
24043
- const identityId = typedIdFromEntry || typedIdFromContent || currentContentKey || entryKey;
24044
- const identity = `${normalizedType || "unknown"}:${identityId}`;
24045
- if (seenIdentity.has(identity)) {
24046
- changed = true;
24047
- continue;
24048
- }
24049
- seenIdentity.add(identity);
24050
- const contentKeyIsCanonical = isCanonicalTypedDbKey(
24051
- currentContentKey,
24052
- normalizedType
24053
- );
24054
- const entryKeyIsCanonical = isCanonicalTypedDbKey(entryKey, normalizedType);
24055
- const canonicalKey = contentKeyIsCanonical && currentContentKey || entryKeyIsCanonical && entryKey || entryKey;
24056
- const canonicalContentKey = contentKeyIsCanonical && currentContentKey || entryKeyIsCanonical && entryKey || currentContentKey;
24057
- if (canonicalKey !== entryKey || canonicalContentKey !== item.contentKey) {
24058
- changed = true;
24059
- }
24060
- deduped[canonicalKey] = {
24061
- ...item,
24062
- contentKey: canonicalContentKey
24063
- };
24064
- }
24065
- const removedKeys = Object.keys(contents).filter(
24066
- (key) => !Object.prototype.hasOwnProperty.call(deduped, key)
24067
- );
24068
- if (!changed && removedKeys.length > 0) {
24069
- changed = true;
24070
- }
24071
- return { contents: deduped, removedKeys, changed };
24072
- };
24073
24007
  var createSpaceThunks = (create) => ({
24074
24008
  // --- 读取当前设备下的空间侧边栏状态 ---
24075
24009
  fetchSpaceSidebarState: create.asyncThunk(fetchSpaceSidebarStateAction, {
@@ -24163,107 +24097,7 @@ var createSpaceThunks = (create) => ({
24163
24097
  state3.initialized = true;
24164
24098
  }
24165
24099
  }
24166
- }),
24167
- fixSpace: create.asyncThunk(
24168
- async (spaceId, thunkAPI) => {
24169
- const spaceKey = createSpaceKey.space(spaceId);
24170
- const spaceData = await thunkAPI.dispatch(
24171
- read({ dbKey: spaceKey })
24172
- ).unwrap();
24173
- if (!spaceData) {
24174
- throw new Error("\u7A7A\u95F4\u4E0D\u5B58\u5728");
24175
- }
24176
- const changes = {};
24177
- const spaceDataId = String(spaceData.id || "");
24178
- if (spaceDataId.startsWith("space-")) {
24179
- changes.id = spaceDataId.slice(6);
24180
- }
24181
- const {
24182
- contents: dedupedContents,
24183
- removedKeys,
24184
- changed: deduped
24185
- } = dedupeSpaceContents(spaceData.contents);
24186
- const agentReferenceEntries = Object.entries(dedupedContents).filter(
24187
- ([entryKey, item]) => {
24188
- if (!item) return false;
24189
- const normalizedType = String(item.type || "").toLowerCase();
24190
- const contentKey = String(item.contentKey || entryKey);
24191
- return normalizedType === "agent" || contentKey.startsWith("agent-") || entryKey.startsWith("agent-");
24192
- }
24193
- );
24194
- const orphanAgentEntryKeys = (await Promise.all(
24195
- agentReferenceEntries.map(async ([entryKey, item]) => {
24196
- const dbKey = String(item?.contentKey || entryKey);
24197
- try {
24198
- const entity = await thunkAPI.dispatch(
24199
- read({ dbKey })
24200
- ).unwrap();
24201
- return entity ? null : entryKey;
24202
- } catch {
24203
- return entryKey;
24204
- }
24205
- })
24206
- )).filter((key) => !!key);
24207
- let contentChanges = null;
24208
- if (deduped) {
24209
- contentChanges = { ...dedupedContents };
24210
- for (const removedKey of removedKeys) {
24211
- if (!Object.prototype.hasOwnProperty.call(contentChanges, removedKey)) {
24212
- contentChanges[removedKey] = null;
24213
- }
24214
- }
24215
- }
24216
- if (orphanAgentEntryKeys.length > 0) {
24217
- if (!contentChanges) contentChanges = { ...dedupedContents };
24218
- orphanAgentEntryKeys.forEach((entryKey) => {
24219
- contentChanges[entryKey] = null;
24220
- });
24221
- }
24222
- if (contentChanges) {
24223
- changes.contents = contentChanges;
24224
- }
24225
- if (Object.keys(changes).length === 0) {
24226
- return {
24227
- repaired: false,
24228
- deduped: false,
24229
- prunedOrphanAgentRefs: 0,
24230
- spaceData
24231
- };
24232
- }
24233
- changes.updatedAt = Math.max(
24234
- Date.now(),
24235
- toTimestampMs(spaceData.updatedAt) + 1
24236
- );
24237
- await thunkAPI.dispatch(
24238
- patch({ dbKey: spaceKey, changes })
24239
- ).unwrap();
24240
- const refreshedSpaceData = await thunkAPI.dispatch(
24241
- read({ dbKey: spaceKey })
24242
- ).unwrap();
24243
- return {
24244
- repaired: true,
24245
- deduped,
24246
- prunedOrphanAgentRefs: orphanAgentEntryKeys.length,
24247
- spaceData: refreshedSpaceData || { ...spaceData, ...changes }
24248
- };
24249
- },
24250
- {
24251
- fulfilled: (state3, action2) => {
24252
- if (state3.currentSpaceId !== action2.meta.arg) return;
24253
- const nextSpace = action2.payload.spaceData;
24254
- if (!nextSpace) return;
24255
- if (!state3.currentSpace) {
24256
- state3.currentSpace = nextSpace;
24257
- return;
24258
- }
24259
- const currentUpdatedAt = toTimestampMs(state3.currentSpace.updatedAt);
24260
- const nextUpdatedAt2 = toTimestampMs(nextSpace.updatedAt);
24261
- if (nextUpdatedAt2 > currentUpdatedAt) {
24262
- state3.currentSpace = nextSpace;
24263
- }
24264
- }
24265
- }
24266
- )
24100
+ })
24267
24101
  });
24268
24102
 
24269
24103
  // packages/create/space/spaceEventCore.ts
@@ -24315,6 +24149,25 @@ var DEFAULT_COLLAPSED_CATEGORIES = {
24315
24149
  var createSliceWithThunks4 = buildCreateSlice({
24316
24150
  creators: { asyncThunk: asyncThunkCreator }
24317
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
+ };
24318
24171
  var initialState4 = {
24319
24172
  currentSpaceId: null,
24320
24173
  currentSpace: null,
@@ -24329,7 +24182,8 @@ var initialState4 = {
24329
24182
  dialogTitles: {},
24330
24183
  // 第一层网页体验:对话切走后仍可在 sidebar 感知其运行中/已完成。
24331
24184
  // 多窗口/多 tab 的已读同步语义暂不在这里定义,等桌面端阶段统一设计。
24332
- unreadDialogIds: {}
24185
+ unreadDialogIds: {},
24186
+ favoritesCollapsed: readStoredFavoritesCollapsed()
24333
24187
  };
24334
24188
  var getSpaceUpdatedAt2 = (space) => {
24335
24189
  if (!space) return 0;
@@ -24366,6 +24220,7 @@ var spaceSlice = createSliceWithThunks4({
24366
24220
  state3.memberSpaces = null;
24367
24221
  state3.collapsedCategories = {};
24368
24222
  state3.viewMode = "all";
24223
+ state3.favoritesCollapsed = readStoredFavoritesCollapsed();
24369
24224
  state3.initialized = false;
24370
24225
  state3.loading = false;
24371
24226
  state3.error = void 0;
@@ -24379,6 +24234,11 @@ var spaceSlice = createSliceWithThunks4({
24379
24234
  setViewMode: create.reducer((state3, action2) => {
24380
24235
  state3.viewMode = action2.payload;
24381
24236
  }),
24237
+ /** 切换侧边栏「我的收藏」专区折叠态,并持久化到 localStorage */
24238
+ toggleFavoritesCollapse: create.reducer((state3) => {
24239
+ state3.favoritesCollapsed = !state3.favoritesCollapsed;
24240
+ writeStoredFavoritesCollapsed(state3.favoritesCollapsed);
24241
+ }),
24382
24242
  /** 用本地缓存先恢复空间列表,远端校验完成后再由 fetchUserSpaceMemberships.fulfilled 覆盖。 */
24383
24243
  hydrateMemberSpacesFromLocal: create.reducer(
24384
24244
  (state3, action2) => {
@@ -24451,12 +24311,12 @@ var {
24451
24311
  fetchUserSpaceMemberships,
24452
24312
  addMember,
24453
24313
  removeMember,
24454
- fixSpace,
24455
24314
  fetchSpaceSidebarState,
24456
24315
  applySpaceEvent,
24457
24316
  markDialogRead,
24458
24317
  resetSpace,
24459
24318
  setViewMode,
24319
+ toggleFavoritesCollapse,
24460
24320
  hydrateMemberSpacesFromLocal
24461
24321
  } = spaceSlice.actions;
24462
24322
  var selectSpaceState = (state3) => state3.space;
@@ -24516,6 +24376,10 @@ var selectIsCategoryCollapsed = (categoryId) => createSelector(
24516
24376
  selectCollapsedCategories,
24517
24377
  (collapsed) => collapsed[categoryId] ?? (DEFAULT_COLLAPSED_CATEGORIES[categoryId] ?? true)
24518
24378
  );
24379
+ var selectFavoritesCollapsed = createSelector(
24380
+ selectSpaceState,
24381
+ (space) => space.favoritesCollapsed ?? false
24382
+ );
24519
24383
  var selectDialogStatuses = createSelector(
24520
24384
  selectSpaceState,
24521
24385
  (space) => space.dialogStatuses ?? {}
@@ -24619,12 +24483,12 @@ export {
24619
24483
  fetchUserSpaceMemberships,
24620
24484
  addMember,
24621
24485
  removeMember,
24622
- fixSpace,
24623
24486
  fetchSpaceSidebarState,
24624
24487
  applySpaceEvent,
24625
24488
  markDialogRead,
24626
24489
  resetSpace,
24627
24490
  setViewMode,
24491
+ toggleFavoritesCollapse,
24628
24492
  hydrateMemberSpacesFromLocal,
24629
24493
  selectCurrentSpaceId,
24630
24494
  selectCurrentSpace,
@@ -24635,6 +24499,7 @@ export {
24635
24499
  selectSpaceInitialized,
24636
24500
  selectCollapsedCategories,
24637
24501
  selectIsCategoryCollapsed,
24502
+ selectFavoritesCollapsed,
24638
24503
  selectDialogStatuses,
24639
24504
  selectDialogEventTimestamps,
24640
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-COMXDWNM.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";