nolo-cli 0.106.0-alpha.1 → 0.107.0-alpha.2

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 (79) hide show
  1. package/{_executeModel-C5ZUOC7O.js → _executeModel-KDHK4U2M.js} +20 -20
  2. package/{action-YVYQEAAV.js → action-P4TNFGAD.js} +3 -3
  3. package/{addContentAction-O7R66HEX.js → addContentAction-MB2HHMDZ.js} +2 -2
  4. package/{addDialogAgentAction-74OA7KYP.js → addDialogAgentAction-MCEABSBA.js} +1 -1
  5. package/{agentDeleteCommand-YB3S2LPY.js → agentDeleteCommand-OWYHN6D6.js} +8 -8
  6. package/{agentEmailCommands-YBCBTG6X.js → agentEmailCommands-G2KQI7UR.js} +23 -23
  7. package/{agentListCommands-3GWH4E4G.js → agentListCommands-B2V4YAC4.js} +8 -8
  8. package/{agentMachineCommands-QHYLBTVW.js → agentMachineCommands-QTDSBHOW.js} +9 -9
  9. package/{agentRecordCommands-P76DPWKV.js → agentRecordCommands-YAYOJMPB.js} +23 -23
  10. package/{agentRunCommand-EQPL4F4K.js → agentRunCommand-BO23NMRR.js} +24 -24
  11. package/{agentRuntimeLocal-FRUE5P2V.js → agentRuntimeLocal-KCMC2TBD.js} +8 -8
  12. package/{agentSlice-7OEXULAY.js → agentSlice-34SBL6YW.js} +2 -2
  13. package/{appDeleteCommands-JPWTSFID.js → appDeleteCommands-JEPA3EWE.js} +8 -8
  14. package/{appDeployCommands-YCVY2UYO.js → appDeployCommands-UTB76XFM.js} +8 -8
  15. package/{appDeployStatusCommands-JMCEIKTI.js → appDeployStatusCommands-LGHF2SBD.js} +8 -8
  16. package/{appGetCommands-EXWT3QAE.js → appGetCommands-PX2BFHOB.js} +8 -8
  17. package/{appListCommands-PKRLSWRE.js → appListCommands-BSMPTWKC.js} +8 -8
  18. package/{chatQueueReduxAdapter-ZBDDI2E5.js → chatQueueReduxAdapter-UC5C5TOQ.js} +8 -8
  19. package/{chunk-GDNQO3QR.js → chunk-2VY6CTU7.js} +10 -10
  20. package/{chunk-TJGWNDGO.js → chunk-374UZRGT.js} +12 -12
  21. package/{chunk-5H7KJX7J.js → chunk-4MK3I7Y4.js} +1 -1
  22. package/{chunk-UOBDA2JS.js → chunk-4PY3VJ5Z.js} +8 -8
  23. package/{chunk-LC43IGO4.js → chunk-62CATUYY.js} +5 -5
  24. package/{chunk-HJUYAD4A.js → chunk-6Z7MY3V7.js} +1 -1
  25. package/{chunk-V4MJDUSR.js → chunk-AHAHBQMU.js} +1 -1
  26. package/{chunk-ZNV445LB.js → chunk-AWGT4G6B.js} +1 -1
  27. package/{chunk-TOP2VXOR.js → chunk-BFDFRLLQ.js} +2 -2
  28. package/{chunk-YCJN2RA3.js → chunk-DSYKPRR7.js} +3 -3
  29. package/{chunk-J3WULTWA.js → chunk-EZXBKNZR.js} +3 -3
  30. package/{chunk-ZCYXJSTU.js → chunk-GO3Z72MT.js} +1 -1
  31. package/{chunk-AFUORTY4.js → chunk-GP5LKBUZ.js} +1 -1
  32. package/{chunk-4OEFYTWL.js → chunk-HKNXJGEC.js} +1 -1
  33. package/{chunk-FM2YTE6D.js → chunk-J5EPCOGW.js} +1 -1
  34. package/{chunk-H56FOERC.js → chunk-JD7CZWO7.js} +186 -48
  35. package/{chunk-JZL6EHZR.js → chunk-LPL7G3VQ.js} +3 -3
  36. package/{chunk-L5UXH3B2.js → chunk-MRIHM22T.js} +1 -1
  37. package/{chunk-DNCEALKX.js → chunk-P5EVSOPA.js} +2 -2
  38. package/{chunk-BP4XNZRM.js → chunk-PBA4UJBK.js} +1 -1
  39. package/{chunk-RJXZDT2P.js → chunk-PCAQ3CGE.js} +3 -3
  40. package/{chunk-UKZDAFYT.js → chunk-QTGQ2LTL.js} +1 -1
  41. package/{chunk-S4VLC46A.js → chunk-UFBOLJLZ.js} +2 -2
  42. package/{chunk-WC6UUQ2C.js → chunk-VRFZJKTT.js} +155 -155
  43. package/{chunk-H62HCIUP.js → chunk-VRTTFDBM.js} +2 -1
  44. package/{chunk-3DII57IT.js → chunk-XD2MJFUG.js} +1 -1
  45. package/{chunk-IUTWFZOX.js → chunk-XQDCXFEI.js} +5 -5
  46. package/{chunk-XA2FJW4L.js → chunk-ZH5DU4YN.js} +4 -4
  47. package/{contentThunks-AZVYDLM4.js → contentThunks-ZM3CQDMQ.js} +9 -9
  48. package/{createAgentAutomationAction-V55DNYCE.js → createAgentAutomationAction-VERPVS43.js} +9 -9
  49. package/{createDialogAction-H6URYLIZ.js → createDialogAction-HFSQUQFZ.js} +10 -10
  50. package/{createPageAction-I3HH23O3.js → createPageAction-GCTZVUUD.js} +9 -9
  51. package/{dbSlice-XVWBAGYN.js → dbSlice-A6C6H32X.js} +1 -1
  52. package/{dialogCommands-YVMHDEOX.js → dialogCommands-H7FPUYUQ.js} +9 -9
  53. package/{dialogSlice-LVJ67QWE.js → dialogSlice-SJE23YAS.js} +8 -8
  54. package/{docCreateCommands-7UTWDYJU.js → docCreateCommands-WRG2JLGM.js} +8 -8
  55. package/{docDeleteCommands-GG6BJ4PS.js → docDeleteCommands-SHWJIBJS.js} +8 -8
  56. package/{docReadCommands-QHMQVSLP.js → docReadCommands-WJN3WT6O.js} +8 -8
  57. package/{docStore-UJNL6SBT.js → docStore-MIVUIPWV.js} +2 -2
  58. package/{docUpdateCommands-QPL6IVUK.js → docUpdateCommands-IE32IL6O.js} +8 -8
  59. package/{handleSendMessageAction-CCL7ETCL.js → handleSendMessageAction-6ZDDLDLZ.js} +8 -8
  60. package/index.js +49 -49
  61. package/{machineCommands-2QNINBNI.js → machineCommands-RD3XXI47.js} +26 -26
  62. package/{machineWsRunDispatch-S3XXOKR7.js → machineWsRunDispatch-UFOU4S4X.js} +23 -23
  63. package/{memberThunks-QGFLFVCI.js → memberThunks-P2ECUJ56.js} +2 -2
  64. package/package.json +1 -1
  65. package/pdf-U6KSUEZZ.js +26435 -0
  66. package/{readlineWorkspace-4GULS23D.js → readlineWorkspace-JUP4HGIW.js} +25 -25
  67. package/{removeDialogAgentAction-IX3MN2ZO.js → removeDialogAgentAction-J6X5QMTA.js} +3 -3
  68. package/{runAgentClientLoop-MUMLW2SA.js → runAgentClientLoop-Y7Y5EHDI.js} +18 -18
  69. package/{setDialogExtraReferencesAction-X4HCPNZL.js → setDialogExtraReferencesAction-WX5VTY6O.js} +2 -2
  70. package/{setPrimaryDialogAgentAction-4GMIQLOD.js → setPrimaryDialogAgentAction-FN22THHT.js} +3 -3
  71. package/{settingSlice-ZQZVUPKK.js → settingSlice-P4ZW7K5X.js} +2 -2
  72. package/{spaceCommands-BMXKR7H6.js → spaceCommands-5GLCWZPO.js} +8 -8
  73. package/{streamAgentChatTurn-6EOS5PNG.js → streamAgentChatTurn-EJBHJN7Z.js} +21 -21
  74. package/{switchDialogAgentAction-N52LRPA3.js → switchDialogAgentAction-LVTEV3FR.js} +1 -1
  75. package/{tools-4AJZHAK3.js → tools-NENBL6TI.js} +15 -15
  76. package/{tuiSummaryLlmCaller-WFRWERGK.js → tuiSummaryLlmCaller-OHHFTHMG.js} +4 -4
  77. package/{updateDialogTitleAction-4YUVCBDU.js → updateDialogTitleAction-OGOWGGUV.js} +9 -9
  78. package/{authCommand-F4EFRRX6.js → authCommand-YW42YZA4.js} +1 -1
  79. /package/{chunk-OEVAY4J6.js → chunk-XT35TTFG.js} +0 -0
@@ -10,7 +10,7 @@ import {
10
10
  import {
11
11
  patch,
12
12
  readAndWait
13
- } from "./chunk-H62HCIUP.js";
13
+ } from "./chunk-VRTTFDBM.js";
14
14
  import {
15
15
  asOptionalTrimmedString
16
16
  } from "./chunk-G3SUCT4W.js";
@@ -326,7 +326,7 @@ async function saveDocState(arg, { dispatch, getState }) {
326
326
  ).unwrap();
327
327
  if (dbSpaceId) {
328
328
  try {
329
- const { updateContentTitle } = await import("./contentThunks-AZVYDLM4.js");
329
+ const { updateContentTitle } = await import("./contentThunks-ZM3CQDMQ.js");
330
330
  await dispatch(
331
331
  updateContentTitle({
332
332
  spaceId: dbSpaceId,
@@ -365,7 +365,7 @@ async function saveDocState(arg, { dispatch, getState }) {
365
365
  }
366
366
  }
367
367
  async function createDocState(args, thunkApi) {
368
- const { createPageAction } = await import("./createPageAction-I3HH23O3.js");
368
+ const { createPageAction } = await import("./createPageAction-GCTZVUUD.js");
369
369
  return createPageAction(args, thunkApi);
370
370
  }
371
371
  function subscribe(listener) {
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  createCliLocalRuntimeAdapter,
3
3
  summarizeEndpoint
4
- } from "./chunk-GDNQO3QR.js";
4
+ } from "./chunk-2VY6CTU7.js";
5
5
  import {
6
6
  clipMultilineText
7
- } from "./chunk-H56FOERC.js";
7
+ } from "./chunk-JD7CZWO7.js";
8
8
  import {
9
9
  runLocalAgentTurn
10
- } from "./chunk-LC43IGO4.js";
10
+ } from "./chunk-62CATUYY.js";
11
11
  import {
12
12
  applyToolSurfaceConstraints
13
13
  } from "./chunk-IIVGDG4I.js";
@@ -40,7 +40,7 @@ import {
40
40
  clipCompactText,
41
41
  isMeaningfulChatCompletionOutput,
42
42
  isMeaningfulResponsesOutput
43
- } from "./chunk-DNCEALKX.js";
43
+ } from "./chunk-P5EVSOPA.js";
44
44
  import {
45
45
  NOLO_CLIENT_VERSION_HEADER,
46
46
  isPlatformMimoProviderModel
@@ -14,7 +14,7 @@ import {
14
14
  toTimestampMs,
15
15
  upsert,
16
16
  write
17
- } from "./chunk-H62HCIUP.js";
17
+ } from "./chunk-VRTTFDBM.js";
18
18
  import {
19
19
  createUserKey,
20
20
  createUserPreferenceKey,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  normalizeTimingMs
3
- } from "./chunk-DNCEALKX.js";
3
+ } from "./chunk-P5EVSOPA.js";
4
4
  import {
5
5
  MODEL_LOOKUP_MAP
6
6
  } from "./chunk-OIVSQH2O.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  fetchReferenceContents,
3
3
  resolveReferenceAssets
4
- } from "./chunk-IUTWFZOX.js";
4
+ } from "./chunk-XQDCXFEI.js";
5
5
 
6
6
  // packages/ai/agent/fetchAgentContexts.ts
7
7
  async function fetchAgentContexts(references, dispatch) {
@@ -52,7 +52,7 @@ import {
52
52
  setMembershipRejected,
53
53
  setSpaceInitialized,
54
54
  updateMemberSpaceName
55
- } from "./chunk-HJUYAD4A.js";
55
+ } from "./chunk-6Z7MY3V7.js";
56
56
  import {
57
57
  ToolApiError,
58
58
  buildToolRequestHeaders,
@@ -63,7 +63,7 @@ import {
63
63
  } from "./chunk-VLTIYV3X.js";
64
64
  import {
65
65
  setDialogExtraReferencesAction
66
- } from "./chunk-UKZDAFYT.js";
66
+ } from "./chunk-QTGQ2LTL.js";
67
67
  import {
68
68
  waitForAbortableDelay
69
69
  } from "./chunk-N4G4PKQ6.js";
@@ -81,10 +81,10 @@ import {
81
81
  } from "./chunk-VF4K2QE6.js";
82
82
  import {
83
83
  createDocState
84
- } from "./chunk-YCJN2RA3.js";
84
+ } from "./chunk-DSYKPRR7.js";
85
85
  import {
86
86
  createDialogAction
87
- } from "./chunk-RJXZDT2P.js";
87
+ } from "./chunk-PCAQ3CGE.js";
88
88
  import {
89
89
  DEFAULT_COLLAPSED_CATEGORIES,
90
90
  addContentToSpace,
@@ -102,7 +102,7 @@ import {
102
102
  updateContentCategory,
103
103
  updateContentTitle,
104
104
  writeStoredCollapsedCategories
105
- } from "./chunk-JZL6EHZR.js";
105
+ } from "./chunk-LPL7G3VQ.js";
106
106
  import {
107
107
  getCurrentSpaceId,
108
108
  getCurrentSpaceIdRaw,
@@ -124,14 +124,14 @@ import {
124
124
  selectMsgById,
125
125
  uiAskChoiceFunc,
126
126
  uiAskChoiceFunctionSchema
127
- } from "./chunk-WC6UUQ2C.js";
127
+ } from "./chunk-VRFZJKTT.js";
128
128
  import {
129
129
  createAgent,
130
130
  deleteServerSyncedCredential,
131
131
  runLlm,
132
132
  streamAgentChatTurn,
133
133
  updateAgent
134
- } from "./chunk-XA2FJW4L.js";
134
+ } from "./chunk-ZH5DU4YN.js";
135
135
  import {
136
136
  getActiveDialogKey,
137
137
  selectCurrentDialogKey,
@@ -179,7 +179,7 @@ import {
179
179
  } from "./chunk-FDTR4QJ6.js";
180
180
  import {
181
181
  buildDatabaseFileContentUrl
182
- } from "./chunk-DNCEALKX.js";
182
+ } from "./chunk-P5EVSOPA.js";
183
183
  import {
184
184
  DEFAULT_MODEL
185
185
  } from "./chunk-OIVSQH2O.js";
@@ -198,14 +198,14 @@ import {
198
198
  } from "./chunk-O6OSWFZQ.js";
199
199
  import {
200
200
  shareResourceAction
201
- } from "./chunk-BP4XNZRM.js";
201
+ } from "./chunk-PBA4UJBK.js";
202
202
  import {
203
203
  AGENT_UPDATE_FIELD_NAMES,
204
204
  normalizeAgentUpdateFieldList,
205
205
  selectAutoApproveSelfUpdateFields,
206
206
  selectCurrentServer,
207
207
  selectSyncServers
208
- } from "./chunk-AFUORTY4.js";
208
+ } from "./chunk-GP5LKBUZ.js";
209
209
  import {
210
210
  asRecordOrEmpty
211
211
  } from "./chunk-KX6YBIHG.js";
@@ -213,7 +213,7 @@ import {
213
213
  UNCATEGORIZED_ID,
214
214
  addContentAction,
215
215
  checkSpaceMembership
216
- } from "./chunk-V4MJDUSR.js";
216
+ } from "./chunk-AHAHBQMU.js";
217
217
  import {
218
218
  createSpaceKey,
219
219
  normalizeSpaceId
@@ -223,12 +223,13 @@ import {
223
223
  read,
224
224
  readAndWait,
225
225
  readAndWaitAction,
226
+ readFileContentAction,
226
227
  remove,
227
228
  selectById,
228
229
  selectEntities,
229
230
  toTimestampMs,
230
231
  write
231
- } from "./chunk-H62HCIUP.js";
232
+ } from "./chunk-VRTTFDBM.js";
232
233
  import {
233
234
  SEPARATOR,
234
235
  TYPE_STORAGE_PREFIXES,
@@ -308,6 +309,50 @@ import {
308
309
  __toESM
309
310
  } from "./chunk-4VNS5WPM.js";
310
311
 
312
+ // packages/ai/tools/agentAutomationSchemas.ts
313
+ var agentAutomationTriggerSchema = {
314
+ oneOf: [
315
+ {
316
+ type: "object",
317
+ description: "Cron trigger.",
318
+ properties: {
319
+ type: { type: "string", enum: ["cron"] },
320
+ expression: {
321
+ type: "string",
322
+ description: "Cron expression, e.g. 0 9 * * *."
323
+ },
324
+ timezone: {
325
+ type: "string",
326
+ description: "Optional timezone, e.g. Asia/Shanghai."
327
+ }
328
+ },
329
+ required: ["type", "expression"],
330
+ additionalProperties: false
331
+ },
332
+ {
333
+ type: "object",
334
+ description: "Inbound email trigger. Cheap code-side filters are evaluated before starting an Agent run. When both are present they use AND semantics.",
335
+ properties: {
336
+ type: { type: "string", enum: ["email"] },
337
+ fromContains: {
338
+ type: "string",
339
+ description: "Case-insensitive substring match against sender email address."
340
+ },
341
+ subjectContains: {
342
+ type: "string",
343
+ description: "Case-insensitive substring match against email subject."
344
+ }
345
+ },
346
+ required: ["type"],
347
+ anyOf: [
348
+ { required: ["fromContains"] },
349
+ { required: ["subjectContains"] }
350
+ ],
351
+ additionalProperties: false
352
+ }
353
+ ]
354
+ };
355
+
311
356
  // packages/ai/tools/modelUsageTools.ts
312
357
  var queryModelUsageFunctionSchema = {
313
358
  name: "queryModelUsage",
@@ -432,7 +477,7 @@ var queryUserGrowthReportFunctionSchema = {
432
477
  };
433
478
  var createAgentAutomationFunctionSchema = {
434
479
  name: "createAgentAutomation",
435
- description: "\u521B\u5EFA\u4E00\u4E2A\u957F\u671F agent automation \u89C4\u5219\u3002\u9002\u5408\u8BA9 agent \u6309 cron \u5B9A\u65F6\u68C0\u67E5\u7528\u91CF\u3001\u751F\u6210\u62A5\u544A\u6216\u6267\u884C\u63D0\u9192\uFF1B\u53EF\u9009\u62E9\u521B\u5EFA\u540E\u7ACB\u523B\u8BD5\u8FD0\u884C\u4E00\u6B21\u3002",
480
+ description: "\u521B\u5EFA\u957F\u671F agent automation\u3002\u652F\u6301 cron \u5B9A\u65F6\u89E6\u53D1\uFF0C\u4EE5\u53CA\u6309\u53D1\u4EF6\u4EBA/\u4E3B\u9898\u9884\u8FC7\u6EE4\u7684\u65B0\u90AE\u4EF6\u4E8B\u4EF6\u89E6\u53D1\u3002email \u89E6\u53D1\u53EA\u5728\u4EE3\u7801\u8FC7\u6EE4\u547D\u4E2D\u540E\u542F\u52A8\u540E\u53F0 Agent run\u3002",
436
481
  parameters: {
437
482
  type: "object",
438
483
  properties: {
@@ -442,29 +487,9 @@ var createAgentAutomationFunctionSchema = {
442
487
  },
443
488
  instruction: {
444
489
  type: "string",
445
- description: "automation \u6BCF\u6B21\u6267\u884C\u65F6\u4EA4\u7ED9 agent \u7684\u5B8C\u6574\u4EFB\u52A1\u63CF\u8FF0\uFF0C\u5E94\u5305\u542B\u68C0\u67E5\u6761\u4EF6\u548C\u901A\u77E5\u65B9\u5F0F\u3002"
446
- },
447
- trigger: {
448
- type: "object",
449
- description: "\u89E6\u53D1\u89C4\u5219\u3002v0 \u53EA\u652F\u6301 cron\u3002",
450
- properties: {
451
- type: {
452
- type: "string",
453
- enum: ["cron"],
454
- description: "\u89E6\u53D1\u7C7B\u578B\u3002v0 \u53EA\u652F\u6301 cron\u3002"
455
- },
456
- expression: {
457
- type: "string",
458
- description: "cron \u8868\u8FBE\u5F0F\uFF0C\u4F8B\u5982\u6BCF\u5929 09:00 \u6267\u884C\u4E3A 0 9 * * *\u3002"
459
- },
460
- timezone: {
461
- type: "string",
462
- description: "\u53EF\u9009\u65F6\u533A\uFF0C\u4F8B\u5982 Asia/Shanghai\u3002"
463
- }
464
- },
465
- required: ["type", "expression"],
466
- additionalProperties: false
490
+ description: "automation \u6BCF\u6B21\u6267\u884C\u65F6\u4EA4\u7ED9 agent \u7684\u5B8C\u6574\u4EFB\u52A1\u63CF\u8FF0\uFF0C\u5E94\u5305\u542B\u5904\u7406\u76EE\u6807\u548C\u5FC5\u8981\u7684\u901A\u77E5\u65B9\u5F0F\u3002"
467
491
  },
492
+ trigger: agentAutomationTriggerSchema,
468
493
  ownerAgentKey: {
469
494
  type: "string",
470
495
  description: "\u6267\u884C\u8BE5 automation \u7684 agentKey\u3002\u9ED8\u8BA4\u4F7F\u7528\u5F53\u524D agent\u3002"
@@ -489,7 +514,7 @@ var createAgentAutomationFunctionSchema = {
489
514
  },
490
515
  runOnceNow: {
491
516
  type: "boolean",
492
- description: "\u521B\u5EFA\u540E\u662F\u5426\u7ACB\u5373\u6267\u884C\u4E00\u6B21\uFF0C\u7528\u6765\u9A8C\u8BC1 automation \u4F1A\u4EA7\u751F\u4EC0\u4E48\u7ED3\u679C\u3002",
517
+ description: "cron \u521B\u5EFA\u540E\u53EF\u7ACB\u5373\u8BD5\u8FD0\u884C\uFF1Bemail trigger \u4E0D\u652F\u6301\uFF0C\u56E0\u4E3A\u521B\u5EFA\u65F6\u6CA1\u6709\u89E6\u53D1\u90AE\u4EF6\u4E0A\u4E0B\u6587\u3002",
493
518
  default: false
494
519
  }
495
520
  },
@@ -3945,7 +3970,7 @@ async function deleteDialogsFunc(args, thunkApi) {
3945
3970
  const deletedDialogIds = [];
3946
3971
  const deletedDialogKeys = [];
3947
3972
  const failures = [];
3948
- const { deleteDialog: deleteDialog2 } = await import("./dialogSlice-LVJ67QWE.js");
3973
+ const { deleteDialog: deleteDialog2 } = await import("./dialogSlice-SJE23YAS.js");
3949
3974
  for (const target of targets) {
3950
3975
  try {
3951
3976
  await thunkApi.dispatch(deleteDialog2(target.dbKey)).unwrap();
@@ -5057,7 +5082,7 @@ var fetchSpaceAction = async (input, thunkAPI) => {
5057
5082
  const spaceKey = createSpaceKey.space(spaceId);
5058
5083
  const readSpace = async (dbKey) => {
5059
5084
  try {
5060
- const { read: read2, readAndWait: readAndWait2 } = await import("./dbSlice-XVWBAGYN.js");
5085
+ const { read: read2, readAndWait: readAndWait2 } = await import("./dbSlice-A6C6H32X.js");
5061
5086
  if (fresh) {
5062
5087
  return await dispatch(readAndWait2(dbKey)).unwrap();
5063
5088
  }
@@ -5698,6 +5723,23 @@ var sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
5698
5723
  var normalizeContains = (value) => asTrimmedLowercaseString(value);
5699
5724
  var participantList = (emails) => Array.isArray(emails) ? asTrimmedNonEmptyStringArray(emails).map((email) => ({ email })) : [];
5700
5725
  var emailText = (email) => [email?.subject, email?.from?.email, email?.from?.name, email?.text, email?.html].filter((value) => typeof value === "string").join("\n");
5726
+ var emailAttachments = (email) => Array.isArray(email?.attachments) ? email.attachments : [];
5727
+ var attachmentPreview = (attachment) => {
5728
+ const name = asOptionalTrimmedString(attachment?.filename) ?? "attachment";
5729
+ const contentType = asOptionalTrimmedString(attachment?.contentType) ?? "application/octet-stream";
5730
+ const fileId = asOptionalTrimmedString(attachment?.fileId) ?? "unknown-file";
5731
+ const size = Number.isFinite(Number(attachment?.size)) ? ` | ${Number(attachment.size)} bytes` : "";
5732
+ return `- ${name} | ${contentType}${size} | fileId: ${fileId}`;
5733
+ };
5734
+ var attachmentListPreview = (email) => {
5735
+ const attachments = emailAttachments(email);
5736
+ if (attachments.length === 0) return "";
5737
+ return [
5738
+ `\u9644\u4EF6\uFF08${attachments.length}\uFF09\uFF1A`,
5739
+ ...attachments.map(attachmentPreview),
5740
+ "\u8BFB\u53D6\u9644\u4EF6\uFF1A\u518D\u6B21\u8C03\u7528 email_read\uFF0C\u4F20\u5165\u5F53\u524D dbKey \u548C attachmentFileId\u3002"
5741
+ ].join("\n");
5742
+ };
5701
5743
  var matchesWaitFilters = (email, args) => {
5702
5744
  const subjectContains = normalizeContains(args.subjectContains);
5703
5745
  const fromContains = normalizeContains(args.fromContains);
@@ -5723,6 +5765,58 @@ var stripHtml = (html) => typeof html === "string" ? compactWhitespace(
5723
5765
  html.replace(/<a\b[^>]*href=["']([^"']+)["'][^>]*>/gi, " $1 ").replace(/<[^>]+>/g, " ")
5724
5766
  ) : "";
5725
5767
  var cleanUrl = (url) => url.replace(/[),.;\]}>]+$/g, "");
5768
+ var extractPdfText = async (blob) => {
5769
+ const pdfjsLib = await import("./pdf-U6KSUEZZ.js");
5770
+ if (typeof window !== "undefined" && pdfjsLib.GlobalWorkerOptions && !pdfjsLib.GlobalWorkerOptions.workerSrc) {
5771
+ pdfjsLib.GlobalWorkerOptions.workerSrc = "/public/assets/pdf.worker.mjs";
5772
+ }
5773
+ const data = await blob.arrayBuffer();
5774
+ const pdf = await pdfjsLib.getDocument({ data }).promise;
5775
+ const pages = [];
5776
+ for (let pageNumber = 1; pageNumber <= pdf.numPages; pageNumber += 1) {
5777
+ const page = await pdf.getPage(pageNumber);
5778
+ const textContent = await page.getTextContent();
5779
+ const text = textContent.items.map((item) => typeof item?.str === "string" ? item.str : "").filter(Boolean).join(" ").trim();
5780
+ if (text) pages.push(`--- page ${pageNumber} ---
5781
+ ${text}`);
5782
+ }
5783
+ return pages.join("\n\n").trim();
5784
+ };
5785
+ var readEmailAttachment = async (email, fileId, maxChars, thunkApi) => {
5786
+ const attachment = emailAttachments(email).find(
5787
+ (item) => asOptionalTrimmedString(item?.fileId) === fileId
5788
+ );
5789
+ if (!attachment) {
5790
+ throw new Error(`\u9644\u4EF6 ${fileId} \u4E0D\u5C5E\u4E8E\u90AE\u4EF6 ${email?.dbKey || "unknown"}`);
5791
+ }
5792
+ const result = await readFileContentAction({ fileId }, thunkApi);
5793
+ const blob = result.blob;
5794
+ const contentType = (asOptionalTrimmedString(attachment?.contentType) || asOptionalTrimmedString(blob.type) || "application/octet-stream").toLowerCase();
5795
+ const filename = asOptionalTrimmedString(attachment?.filename) ?? fileId;
5796
+ let content;
5797
+ if (contentType === "application/pdf" || filename.toLowerCase().endsWith(".pdf")) {
5798
+ content = await extractPdfText(blob);
5799
+ if (!content) {
5800
+ throw new Error(
5801
+ `PDF \u9644\u4EF6 ${filename} \u6CA1\u6709\u53EF\u63D0\u53D6\u7684\u6587\u5B57\u5C42\uFF0C\u53EF\u80FD\u662F\u626B\u63CF\u7248\uFF1B\u8BF7\u6539\u7528 OCR \u80FD\u529B\u5904\u7406\u8BE5 fileId\u3002`
5802
+ );
5803
+ }
5804
+ } else if (contentType.startsWith("text/") || contentType.includes("json") || contentType.includes("csv") || contentType.includes("xml") || /\.(txt|md|csv|json|xml|html?|log)$/i.test(filename)) {
5805
+ content = await blob.text();
5806
+ } else {
5807
+ throw new Error(
5808
+ `\u9644\u4EF6 ${filename} (${contentType}) \u6682\u4E0D\u652F\u6301\u76F4\u63A5\u8F6C\u6587\u672C\uFF1BfileId=${fileId} \u4ECD\u53EF\u4EA4\u7ED9\u5BF9\u5E94\u7684\u6587\u4EF6/\u5A92\u4F53\u5904\u7406\u80FD\u529B\u3002`
5809
+ );
5810
+ }
5811
+ const truncated = content.length > maxChars;
5812
+ return {
5813
+ attachment,
5814
+ content: truncated ? content.slice(0, maxChars) : content,
5815
+ totalChars: content.length,
5816
+ truncated,
5817
+ source: result.source
5818
+ };
5819
+ };
5726
5820
  var extractEmailVerificationArtifacts = ({
5727
5821
  text,
5728
5822
  html
@@ -5790,13 +5884,25 @@ var emailSearchFunctionSchema = {
5790
5884
  };
5791
5885
  var emailReadFunctionSchema = {
5792
5886
  name: "email_read",
5793
- description: "\u8BFB\u53D6\u4E00\u5C01\u90AE\u4EF6\u7684\u5B8C\u6574\u5185\u5BB9\u3002\u9700\u8981 email:read \u6743\u9650\u3002",
5887
+ description: [
5888
+ "\u8BFB\u53D6\u4E00\u5C01\u90AE\u4EF6\u7684\u5B8C\u6574\u5185\u5BB9\u3002\u9700\u8981 email:read \u6743\u9650\u3002",
5889
+ "\u90AE\u4EF6\u6709\u9644\u4EF6\u65F6\u4F1A\u5217\u51FA\u9644\u4EF6 fileId\u3002\u8981\u8BFB\u53D6 PDF/\u6587\u672C/CSV/JSON \u9644\u4EF6\uFF0C\u518D\u4F20 attachmentFileId\uFF1B\u5DE5\u5177\u4F1A\u5148\u6821\u9A8C\u8BE5\u6587\u4EF6\u786E\u5B9E\u5C5E\u4E8E\u8FD9\u5C01\u90AE\u4EF6\u3002",
5890
+ "PDF \u4F18\u5148\u76F4\u63A5\u63D0\u53D6\u6587\u5B57\u5C42\uFF1B\u626B\u63CF\u7248 PDF \u4F1A\u63D0\u793A\u6539\u7528 OCR\u3002"
5891
+ ].join("\n"),
5794
5892
  parameters: {
5795
5893
  type: "object",
5796
5894
  properties: {
5797
5895
  dbKey: {
5798
5896
  type: "string",
5799
5897
  description: "\u90AE\u4EF6\u8BB0\u5F55\u7684 dbKey\uFF0C\u4F8B\u5982 email-userId-emailId\u3002"
5898
+ },
5899
+ attachmentFileId: {
5900
+ type: "string",
5901
+ description: "\u53EF\u9009\u3002\u5F53\u524D\u90AE\u4EF6 attachments[] \u4E2D\u7684 fileId\uFF1B\u63D0\u4F9B\u540E\u8BFB\u53D6\u8BE5\u9644\u4EF6\u6587\u672C\u3002"
5902
+ },
5903
+ maxChars: {
5904
+ type: "number",
5905
+ description: "\u8BFB\u53D6\u9644\u4EF6\u65F6\u6700\u591A\u8FD4\u56DE\u591A\u5C11\u5B57\u7B26\uFF0C\u9ED8\u8BA4 12000\uFF0C\u8303\u56F4 1000-50000\u3002"
5800
5906
  }
5801
5907
  },
5802
5908
  required: ["dbKey"]
@@ -6075,15 +6181,47 @@ ${artifacts.verificationLinks.slice(1).join("\n")}` : ""
6075
6181
  };
6076
6182
  }
6077
6183
  async function emailReadFunc(args, thunkApi) {
6078
- const email = await callToolApi(thunkApi, "/rpc/getEmail", args, {
6184
+ const email = await callToolApi(thunkApi, "/rpc/getEmail", { dbKey: args.dbKey }, {
6079
6185
  withAuth: true
6080
6186
  });
6187
+ const attachmentFileId = asOptionalTrimmedString(args.attachmentFileId);
6188
+ if (attachmentFileId) {
6189
+ const maxChars = clampInteger(args.maxChars, 12e3, 1e3, 5e4);
6190
+ const attachmentResult = await readEmailAttachment(
6191
+ email,
6192
+ attachmentFileId,
6193
+ maxChars,
6194
+ thunkApi
6195
+ );
6196
+ const filename = asOptionalTrimmedString(attachmentResult.attachment?.filename) ?? attachmentFileId;
6197
+ return {
6198
+ rawData: {
6199
+ emailDbKey: email?.dbKey,
6200
+ attachment: attachmentResult.attachment,
6201
+ content: attachmentResult.content,
6202
+ totalChars: attachmentResult.totalChars,
6203
+ truncated: attachmentResult.truncated,
6204
+ source: attachmentResult.source
6205
+ },
6206
+ displayData: [
6207
+ `\u9644\u4EF6\uFF1A${filename} | fileId: ${attachmentFileId}`,
6208
+ attachmentResult.truncated ? `\u5185\u5BB9\u5DF2\u622A\u65AD\uFF1A\u8FD4\u56DE ${attachmentResult.content.length}/${attachmentResult.totalChars} \u5B57\u7B26\u3002` : `\u5185\u5BB9\u5B57\u7B26\u6570\uFF1A${attachmentResult.totalChars}`,
6209
+ "",
6210
+ attachmentResult.content
6211
+ ].join("\n")
6212
+ };
6213
+ }
6081
6214
  const body = asOptionalTrimmedString(email?.text) ?? asOptionalTrimmedString(email?.html) ?? "";
6215
+ const attachments = attachmentListPreview(email);
6082
6216
  return {
6083
6217
  rawData: email,
6084
- displayData: `${emailPreview(email)}
6085
-
6086
- ${body.slice(0, 4e3)}`
6218
+ displayData: [
6219
+ emailPreview(email),
6220
+ "",
6221
+ body.slice(0, 4e3),
6222
+ attachments ? `
6223
+ ${attachments}` : ""
6224
+ ].filter(Boolean).join("\n")
6087
6225
  };
6088
6226
  }
6089
6227
  async function emailUpdateTagsFunc(args, thunkApi) {
@@ -10900,7 +11038,7 @@ var selectUserIdFromState = (state2) => {
10900
11038
  var selectCurrentServerFromState = (state2) => typeof state2?.settings?.currentServer === "string" ? state2.settings.currentServer : null;
10901
11039
  async function addImageContentToSpace(input) {
10902
11040
  const injectedAddContentAction = input.thunkApi?.extra?.addContentAction;
10903
- const addContentAction2 = typeof injectedAddContentAction === "function" ? injectedAddContentAction : (await import("./addContentAction-O7R66HEX.js")).addContentAction;
11041
+ const addContentAction2 = typeof injectedAddContentAction === "function" ? injectedAddContentAction : (await import("./addContentAction-MB2HHMDZ.js")).addContentAction;
10904
11042
  await addContentAction2(
10905
11043
  {
10906
11044
  spaceId: input.spaceId,
@@ -14906,7 +15044,7 @@ var executeToolRun = createAsyncThunk(
14906
15044
  if (!executionInput) {
14907
15045
  throw new Error(`ToolRun ${id} has no input to execute with.`);
14908
15046
  }
14909
- const { findToolExecutor: findToolExecutor2 } = await import("./tools-4AJZHAK3.js");
15047
+ const { findToolExecutor: findToolExecutor2 } = await import("./tools-NENBL6TI.js");
14910
15048
  const { executor } = findToolExecutor2(run.toolName);
14911
15049
  toolRunStarted({
14912
15050
  id: run.id,
@@ -14930,7 +15068,7 @@ var executeToolRun = createAsyncThunk(
14930
15068
  const latestState = thunkApi.getState();
14931
15069
  const userId = selectIdentityUserId(latestState);
14932
15070
  if (userId) {
14933
- const { fetchUserSpaceMemberships } = await import("./memberThunks-QGFLFVCI.js");
15071
+ const { fetchUserSpaceMemberships } = await import("./memberThunks-P2ECUJ56.js");
14934
15072
  await thunkApi.dispatch(fetchUserSpaceMemberships(userId));
14935
15073
  }
14936
15074
  }
@@ -17413,7 +17551,7 @@ async function updateDocFunc(args, thunkApi) {
17413
17551
  updated_at: (/* @__PURE__ */ new Date()).toISOString()
17414
17552
  };
17415
17553
  await dispatch(write({ data: updatedPageData, customKey: id })).unwrap();
17416
- const { getDocState, applyExternalDocUpdate } = await import("./docStore-UJNL6SBT.js");
17554
+ const { getDocState, applyExternalDocUpdate } = await import("./docStore-MIVUIPWV.js");
17417
17555
  if (getDocState().pageKey === id) {
17418
17556
  applyExternalDocUpdate({
17419
17557
  slateData: finalSlateData,
@@ -17438,7 +17576,7 @@ async function updateDocFunc(args, thunkApi) {
17438
17576
  // packages/ai/tools/updateUserPreferenceProfileTool.ts
17439
17577
  async function dispatchSetSettings(thunkApi, changes) {
17440
17578
  const injectedSetSettings = thunkApi?.extra?.setSettings;
17441
- const setSettings = typeof injectedSetSettings === "function" ? injectedSetSettings : (await import("./settingSlice-ZQZVUPKK.js")).setSettings;
17579
+ const setSettings = typeof injectedSetSettings === "function" ? injectedSetSettings : (await import("./settingSlice-P4ZW7K5X.js")).setSettings;
17442
17580
  await thunkApi.dispatch(setSettings(changes)).unwrap();
17443
17581
  }
17444
17582
  var updateUserPreferenceProfileFunctionSchema = {
@@ -9,7 +9,7 @@ import {
9
9
  initReactI18next,
10
10
  instance,
11
11
  toast
12
- } from "./chunk-WC6UUQ2C.js";
12
+ } from "./chunk-VRFZJKTT.js";
13
13
  import {
14
14
  require_date_fns
15
15
  } from "./chunk-M76ECQRD.js";
@@ -27,7 +27,7 @@ import {
27
27
  addContentAction,
28
28
  checkSpaceMembership,
29
29
  localSpaceAuthorityPatchStamp
30
- } from "./chunk-V4MJDUSR.js";
30
+ } from "./chunk-AHAHBQMU.js";
31
31
  import {
32
32
  createSpaceKey,
33
33
  normalizeSpaceId
@@ -41,7 +41,7 @@ import {
41
41
  uploadFileAction,
42
42
  upsertSSREntity,
43
43
  write
44
- } from "./chunk-H62HCIUP.js";
44
+ } from "./chunk-VRTTFDBM.js";
45
45
  import {
46
46
  SEPARATOR,
47
47
  asTrimmedNonEmptyStringArray,
@@ -7,7 +7,7 @@ import {
7
7
  } from "./chunk-IIVGDG4I.js";
8
8
  import {
9
9
  getModelContextWindow
10
- } from "./chunk-4OEFYTWL.js";
10
+ } from "./chunk-HKNXJGEC.js";
11
11
  import {
12
12
  estimateTokenCount
13
13
  } from "./chunk-PSCNXBYA.js";
@@ -6,10 +6,10 @@ import {
6
6
  } from "./chunk-DWLEOOGR.js";
7
7
  import {
8
8
  addContentAction
9
- } from "./chunk-V4MJDUSR.js";
9
+ } from "./chunk-AHAHBQMU.js";
10
10
  import {
11
11
  upload
12
- } from "./chunk-H62HCIUP.js";
12
+ } from "./chunk-VRTTFDBM.js";
13
13
  import {
14
14
  getRuntimeServerContext
15
15
  } from "./chunk-UKWGR5SS.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  selectCurrentServer,
3
3
  selectRemoteServers
4
- } from "./chunk-AFUORTY4.js";
4
+ } from "./chunk-GP5LKBUZ.js";
5
5
  import {
6
6
  createUserKey,
7
7
  extractAgentInfo,
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  addContentToSpace
3
- } from "./chunk-JZL6EHZR.js";
3
+ } from "./chunk-LPL7G3VQ.js";
4
4
  import {
5
5
  prepareAndPersistMessage,
6
6
  uiAskChoiceFunc,
7
7
  uiAskChoiceFunctionSchema
8
- } from "./chunk-WC6UUQ2C.js";
8
+ } from "./chunk-VRFZJKTT.js";
9
9
  import {
10
10
  require_date_fns
11
11
  } from "./chunk-M76ECQRD.js";
@@ -22,7 +22,7 @@ import {
22
22
  removeCachedEntity,
23
23
  upsertSSREntity,
24
24
  write
25
- } from "./chunk-H62HCIUP.js";
25
+ } from "./chunk-VRTTFDBM.js";
26
26
  import {
27
27
  createAgentKey,
28
28
  createDialogKey,
@@ -7,7 +7,7 @@ import {
7
7
  import {
8
8
  patch,
9
9
  selectById
10
- } from "./chunk-H62HCIUP.js";
10
+ } from "./chunk-VRTTFDBM.js";
11
11
  import {
12
12
  __toESM
13
13
  } from "./chunk-4VNS5WPM.js";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  toolRegistry
3
- } from "./chunk-H56FOERC.js";
3
+ } from "./chunk-JD7CZWO7.js";
4
4
  import {
5
5
  i18n_default
6
- } from "./chunk-WC6UUQ2C.js";
6
+ } from "./chunk-VRFZJKTT.js";
7
7
  import {
8
8
  canonicalizeToolNames
9
9
  } from "./chunk-O6OSWFZQ.js";