weaver-work-cli 0.1.38 → 0.1.39

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 (136) hide show
  1. package/README.md +4 -2
  2. package/dist/chunks/{archive-PDV724YK.js → archive-ENZYBBME.js} +556 -66
  3. package/dist/chunks/{archive-oa-4XE4MNXQ.js → archive-oa-YWLEC5V4.js} +2 -2
  4. package/dist/chunks/{asset-PDL2QE2N.js → asset-OOV6DWPA.js} +2 -2
  5. package/dist/chunks/asset-idle-RE632MY5.js +670 -0
  6. package/dist/chunks/{attachment-content-MDDGOE5E.js → attachment-content-RWN2FCLL.js} +3 -3
  7. package/dist/chunks/{blog-UYR3EUXW.js → blog-PEPOJAL7.js} +2 -2
  8. package/dist/chunks/{caizhilian-LG2X5NMF.js → caizhilian-WYIQDVPJ.js} +2 -2
  9. package/dist/chunks/{calendar-FG4BAZHE.js → calendar-CIARBAOX.js} +2 -2
  10. package/dist/chunks/{chunk-6FTTSA45.js → chunk-36DIFZAH.js} +2 -2
  11. package/dist/chunks/{chunk-UJJD4QWF.js → chunk-BJGXMFGD.js} +2 -2
  12. package/dist/chunks/{chunk-ELYDWBZJ.js → chunk-CQHGNCK2.js} +1 -1
  13. package/dist/chunks/{chunk-XJY7G4DD.js → chunk-EINRJHQ3.js} +3 -3
  14. package/dist/chunks/{chunk-UZZBA6PV.js → chunk-EZGFHJFW.js} +28 -6
  15. package/dist/chunks/{chunk-NI6GIPIM.js → chunk-F2EQXUEE.js} +438 -387
  16. package/dist/chunks/{chunk-VRYHGG6O.js → chunk-GVPJZXJ2.js} +3 -3
  17. package/dist/chunks/{chunk-IZUDA353.js → chunk-HJYVHXUQ.js} +1 -1
  18. package/dist/chunks/{chunk-KKRL3REV.js → chunk-I2HB737U.js} +2 -2
  19. package/dist/chunks/{chunk-NR6RKXPA.js → chunk-K3RUEEOL.js} +4 -2
  20. package/dist/chunks/{chunk-6LTFIFLM.js → chunk-KTCB5R5H.js} +2 -2
  21. package/dist/chunks/{chunk-J7USS3ED.js → chunk-L4N7B7ZD.js} +4 -4
  22. package/dist/chunks/{chunk-CORFRD7Q.js → chunk-MUQUHKPG.js} +2 -2
  23. package/dist/chunks/{chunk-DMV2TOMH.js → chunk-NLK2RZKG.js} +46 -46
  24. package/dist/chunks/{chunk-JSMFPO43.js → chunk-P2DAISYW.js} +1 -1
  25. package/dist/chunks/{chunk-GGJFMNJM.js → chunk-T7JDJJ7H.js} +3 -3
  26. package/dist/chunks/{chunk-OJQUJZQF.js → chunk-XXJOSZTQ.js} +2 -0
  27. package/dist/chunks/{chunk-Z32KWY6G.js → chunk-YS5DPN4T.js} +1 -1
  28. package/dist/chunks/{chunk-EG6ZU444.js → chunk-ZUX3P6BQ.js} +10 -5
  29. package/dist/chunks/{chunk-FUWVHMVV.js → chunk-ZXRNHZTE.js} +2 -2
  30. package/dist/chunks/{conflict-BQZEQ4SP.js → conflict-DRMDOL56.js} +2 -2
  31. package/dist/chunks/{contract-XIRAFTEV.js → contract-73MERZWN.js} +2 -2
  32. package/dist/chunks/{cowork-BLG62BL2.js → cowork-HNGBPD7A.js} +2 -2
  33. package/dist/chunks/{ebuilder-form-NUKG5QW4.js → ebuilder-form-OY6DVNRK.js} +3 -3
  34. package/dist/chunks/{ehr-2STW5ILH.js → ehr-RAQNEQO7.js} +2 -2
  35. package/dist/chunks/{esb-UUDQUNKY.js → esb-6XV7C7YV.js} +4 -4
  36. package/dist/chunks/{fna-6RCY4NU5.js → fna-XTSRB7G7.js} +2 -2
  37. package/dist/chunks/{host-RHM3NPXV.js → host-3F5UM5GN.js} +3 -3
  38. package/dist/chunks/{host-EJZFROU3.js → host-A7J6GDUP.js} +3 -3
  39. package/dist/chunks/{host-FWDOSRH5.js → host-VGPVP7YF.js} +3 -3
  40. package/dist/chunks/{host-7RXEDMAH.js → host-YAQAPYNP.js} +3 -3
  41. package/dist/chunks/{host-UFF33TWJ.js → host-YMBXWFWX.js} +3 -3
  42. package/dist/chunks/{hrm-PKJ6ELSH.js → hrm-TLHKC545.js} +3 -3
  43. package/dist/chunks/{im-YJAXS7CO.js → im-YOUCFMUK.js} +3 -3
  44. package/dist/chunks/{invoice-HWVSXGX6.js → invoice-WNBS2B4C.js} +3 -3
  45. package/dist/chunks/{jiuchuanhui-L7VKILZB.js → jiuchuanhui-XABWS5RN.js} +2 -2
  46. package/dist/chunks/{lazy-dispatch-NMYEIHRH.js → lazy-dispatch-NLZ5UQQI.js} +5 -5
  47. package/dist/chunks/{mail-B42RRU7G.js → mail-LRYMBFNL.js} +2 -2
  48. package/dist/chunks/{meeting-CFYVBJSS.js → meeting-ESXL6MFI.js} +10 -10
  49. package/dist/chunks/{okr-GCLF6V7W.js → okr-EOV65SSF.js} +2 -2
  50. package/dist/chunks/{plan-ZVL7GBRI.js → plan-YFPVKW6Y.js} +2 -2
  51. package/dist/chunks/{project-4YWAAE2K.js → project-MDVZUYQW.js} +2 -2
  52. package/dist/chunks/{registry-EP4VTHZS.js → registry-QCLZEDAP.js} +8 -8
  53. package/dist/chunks/{registry-FRJ6H7BT.js → registry-VT5Y2HLA.js} +4 -4
  54. package/dist/chunks/{registry-SG2PGVCF.js → registry-YX4CSEMD.js} +3 -3
  55. package/dist/chunks/{room-recommend-R3JVUUAC.js → room-recommend-L3MWH4JW.js} +4 -4
  56. package/dist/chunks/{schedule-NIJBTYDO.js → schedule-UASAVDVD.js} +4 -4
  57. package/dist/chunks/{workflow-BB24DFBY.js → workflow-KDGIUCNW.js} +9 -6
  58. package/dist/core/output.js +16 -6
  59. package/dist/index.js +33 -28
  60. package/dist/internal/e10/auth/messages.js +1 -0
  61. package/dist/internal/e10/auth-recovery.js +13 -6
  62. package/dist/internal/e10/context.js +16 -3
  63. package/dist/internal/e10/request-runtime.js +3 -1
  64. package/dist/shortcuts/archive/host.js +2 -0
  65. package/dist/shortcuts/archive/manifest.js +1 -1
  66. package/dist/shortcuts/archive/operations/borrow-list.js +13 -1
  67. package/dist/shortcuts/archive/operations/flow-url.js +1 -1
  68. package/dist/shortcuts/archive/operations/prelib.js +472 -0
  69. package/dist/shortcuts/archive/operations/registry.js +2 -0
  70. package/dist/shortcuts/archive/operations/upload.js +1 -1
  71. package/dist/shortcuts/asset-idle/errors.js +44 -0
  72. package/dist/shortcuts/asset-idle/host.js +161 -0
  73. package/dist/shortcuts/asset-idle/index.js +114 -0
  74. package/dist/shortcuts/asset-idle/manifest.js +159 -0
  75. package/dist/shortcuts/asset-idle/operations/idle.js +47 -0
  76. package/dist/shortcuts/asset-idle/operations/registry.js +33 -0
  77. package/dist/shortcuts/asset-idle/operations/shared.js +142 -0
  78. package/dist/shortcuts/asset-idle/operations/types.js +9 -0
  79. package/dist/shortcuts/asset-idle/operations.js +15 -0
  80. package/dist/shortcuts/index.js +5 -0
  81. package/dist/shortcuts/workflow/host.js +3 -0
  82. package/dist/shortcuts/workflow/index.js +1 -1
  83. package/dist/shortcuts/workflow/operations/form.js +46 -171
  84. package/dist/shortcuts/workflow/operations/todoSmartConvert/aigroupRules.js +77 -26
  85. package/dist/shortcuts/workflow/operations/todoSmartConvert/aigroupStore.js +6 -0
  86. package/dist/shortcuts/workflow/operations/todoSmartConvert/summaryCache.js +59 -117
  87. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoDetailCache.js +44 -7
  88. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoDetailFetcher.js +37 -29
  89. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.collect.js +20 -6
  90. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.detail.js +22 -18
  91. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.groupSummary.js +34 -10
  92. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.js +4 -2
  93. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.smartGroup.js +9 -2
  94. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.summary.js +110 -20
  95. package/docs/_catalog.md +3 -0
  96. package/docs/asset-idle.md +45 -0
  97. package/docs/e10-auth.md +1 -1
  98. package/docs/todo-smart-convert/subgroup-rules.md +1 -1
  99. package/package.json +1 -1
  100. package/scripts/package-skill.mjs +2 -0
  101. package/skill-template/business-info.json +14 -1
  102. package/skill-template/domains/asset-idle.md +13 -0
  103. package/skill-template/domains/wenshuding.md +3 -0
  104. package/skills/weaver-e10-archive-oa/SKILL.md +1 -0
  105. package/skills/weaver-e10-archive-oa/references/my-borrow.md +49 -0
  106. package/skills/weaver-e10-asset-idle/SKILL.md +73 -0
  107. package/skills/weaver-e10-asset-idle/references/idle-list.md +62 -0
  108. package/skills/weaver-e10-asset-idle/references/idle-stats-and-charts.md +65 -0
  109. package/skills/weaver-e10-asset-idle/references/source-manifest.json +193 -0
  110. package/skills/weaver-e10-asset-idle/references/widget-style.md +205 -0
  111. package/skills/weaver-e10-caizhilian/SKILL.md +29 -11
  112. package/skills/weaver-e10-caizhilian/references/auth-and-install.md +12 -0
  113. package/skills/weaver-e10-caizhilian/references/files.md +1 -1
  114. package/skills/weaver-e10-caizhilian/references/setting-encrypt.md +1 -1
  115. package/skills/weaver-e10-caizhilian/references/source-manifest.json +45 -45
  116. package/skills/weaver-e10-cowork/SKILL.md +2 -0
  117. package/skills/weaver-e10-jucailin/SKILL.md +2 -0
  118. package/skills/weaver-e10-jucailin/references/recruit-read.md +2 -0
  119. package/skills/weaver-e10-jucailin/references/recruit-write.md +1 -1
  120. package/skills/weaver-e10-mail/SKILL.md +3 -0
  121. package/skills/weaver-e10-shared/SKILL.md +5 -5
  122. package/skills/weaver-e10-shared/references/e10-auth-and-session.md +3 -3
  123. package/skills/weaver-e10-wenshuding/SKILL.md +29 -6
  124. package/skills/weaver-e10-wenshuding/references/archive-borrow-list.md +14 -0
  125. package/skills/weaver-e10-wenshuding/references/archive-download.md +2 -0
  126. package/skills/weaver-e10-wenshuding/references/archive-flow.md +1 -1
  127. package/skills/weaver-e10-wenshuding/references/archive-prelib-arrange.md +76 -0
  128. package/skills/weaver-e10-wenshuding/references/archive-prelib-list.md +107 -0
  129. package/skills/weaver-e10-wenshuding/references/archive-prelib-open.md +59 -0
  130. package/skills/weaver-e10-wenshuding/references/archive-upload.md +4 -1
  131. package/skills/weaver-e10-wenshuding/references/source-manifest.json +108 -65
  132. package/skills/weaver-e10-workflow/SKILL.md +5 -2
  133. package/skills/weaver-e10-workflow/aigroup/default.json +154 -19
  134. package/skills/weaver-e10-workflow/references/todo-smart-convert.md +59 -27
  135. package/skills/weaver-e10-workflow/tools/todo-serve.cjs +113 -25
  136. package/skills/weaver-e10-workflow/tools/todo-summary.cjs +292 -42
@@ -4,11 +4,11 @@ import {
4
4
  createE10RequestRuntime,
5
5
  isE10SessionExpiredResponse,
6
6
  requireE10Session
7
- } from "./chunk-UZZBA6PV.js";
7
+ } from "./chunk-EZGFHJFW.js";
8
8
  import {
9
9
  E10_SESSION_EXPIRED_MESSAGE,
10
10
  getActiveProfile
11
- } from "./chunk-OJQUJZQF.js";
11
+ } from "./chunk-XXJOSZTQ.js";
12
12
  import {
13
13
  CliError,
14
14
  isCliError,
@@ -5,11 +5,11 @@ import {
5
5
  createE10RequestRuntime,
6
6
  isE10SessionExpiredResponse,
7
7
  requireE10Session
8
- } from "./chunk-UZZBA6PV.js";
8
+ } from "./chunk-EZGFHJFW.js";
9
9
  import {
10
10
  E10_SESSION_EXPIRED_MESSAGE,
11
11
  getActiveProfile
12
- } from "./chunk-OJQUJZQF.js";
12
+ } from "./chunk-XXJOSZTQ.js";
13
13
  import {
14
14
  CliError,
15
15
  isCliError,
@@ -5,11 +5,11 @@ import {
5
5
  createE10RequestRuntime,
6
6
  isE10SessionExpiredResponse,
7
7
  requireE10Session
8
- } from "./chunk-UZZBA6PV.js";
8
+ } from "./chunk-EZGFHJFW.js";
9
9
  import {
10
10
  E10_SESSION_EXPIRED_MESSAGE,
11
11
  getActiveProfile
12
- } from "./chunk-OJQUJZQF.js";
12
+ } from "./chunk-XXJOSZTQ.js";
13
13
  import {
14
14
  CliError,
15
15
  isCliError,
@@ -11,11 +11,11 @@ import {
11
11
  createE10RequestRuntime,
12
12
  isE10SessionExpiredResponse,
13
13
  requireE10Session
14
- } from "./chunk-UZZBA6PV.js";
14
+ } from "./chunk-EZGFHJFW.js";
15
15
  import {
16
16
  E10_SESSION_EXPIRED_MESSAGE,
17
17
  getActiveProfile
18
- } from "./chunk-OJQUJZQF.js";
18
+ } from "./chunk-XXJOSZTQ.js";
19
19
 
20
20
  // src/shortcuts/hrm/host.ts
21
21
  function inferProfile(ctx) {
@@ -14,11 +14,11 @@ import {
14
14
  createE10RequestRuntime,
15
15
  isE10SessionExpiredResponse,
16
16
  requireE10Session
17
- } from "./chunk-UZZBA6PV.js";
17
+ } from "./chunk-EZGFHJFW.js";
18
18
  import {
19
19
  E10_SESSION_EXPIRED_MESSAGE,
20
20
  getActiveProfile
21
- } from "./chunk-OJQUJZQF.js";
21
+ } from "./chunk-XXJOSZTQ.js";
22
22
 
23
23
  // src/shortcuts/esb/host.ts
24
24
  var ESB_PATHS = {
@@ -2251,7 +2251,7 @@ function buildWriteOperations(endpoint, preflight, afterWrite) {
2251
2251
  );
2252
2252
  }
2253
2253
  if (endpoint.interfacePk === "create_meeting") {
2254
- const { fetchEbAppSettings, assertEbCreatePathAllowed } = await import("./conflict-BQZEQ4SP.js");
2254
+ const { fetchEbAppSettings, assertEbCreatePathAllowed } = await import("./conflict-DRMDOL56.js");
2255
2255
  assertEbCreatePathAllowed(await fetchEbAppSettings(env, applyName));
2256
2256
  }
2257
2257
  const pkQuery = writePkQuery(endpoint, payload);
@@ -12,7 +12,7 @@ import {
12
12
  meetingValidationError,
13
13
  queryBody,
14
14
  toIdCsv
15
- } from "./chunk-ELYDWBZJ.js";
15
+ } from "./chunk-CQHGNCK2.js";
16
16
 
17
17
  // src/shortcuts/meeting/operations/eb/conflict.ts
18
18
  var ACTIVE_MT_STATUS = "1,2,8,9";
@@ -296,7 +296,7 @@ var ebMeetingWritePreflight = async ({ endpoint, payload, args, env, extras }) =
296
296
  const items = rawMembers.split(/[,;,;]+/u).map((item) => item.trim()).filter((item) => item !== "");
297
297
  const nameLike = items.filter((item) => !/^\d+$/u.test(item));
298
298
  if (nameLike.length > 0) {
299
- const { resolveMemberIdsByName } = await import("./schedule-NIJBTYDO.js");
299
+ const { resolveMemberIdsByName } = await import("./schedule-UASAVDVD.js");
300
300
  const idsByName = await resolveMemberIdsByName(env, nameLike);
301
301
  const resolved = items.map((item) => idsByName.get(item) ?? item);
302
302
  payload.mainTable.hrm_members = [...new Set(resolved)].join(",");
@@ -610,7 +610,7 @@ async function findCommonFreeSlots(env, input) {
610
610
  const scheduleItems = [];
611
611
  if (includeSchedule) {
612
612
  try {
613
- const { runScheduleConflictFlow, parseScheduleConflictMessage, resolveMemberIdsByName } = await import("./schedule-NIJBTYDO.js");
613
+ const { runScheduleConflictFlow, parseScheduleConflictMessage, resolveMemberIdsByName } = await import("./schedule-UASAVDVD.js");
614
614
  const dayBegin = new Date(rangeStart.getFullYear(), rangeStart.getMonth(), rangeStart.getDate(), 0, 0, 0, 0);
615
615
  const dayEnd = new Date(rangeStart.getFullYear(), rangeStart.getMonth(), rangeStart.getDate(), 23, 59, 0, 0);
616
616
  const flow = await runScheduleConflictFlow(env, {
@@ -3,12 +3,15 @@ const require = __esbuildCreateRequire(import.meta.url);
3
3
  import {
4
4
  E10AuthSession,
5
5
  E10_AUTH_REQUIRED_MESSAGE,
6
+ E10_XIAOE_RECOVERY_FAILED_MESSAGE,
6
7
  getActiveProfile,
7
8
  hasXiaoEEnv,
8
9
  isXiaoERuntimeAgent,
10
+ readProfileConfig,
11
+ resolveXiaoEPreferredBaseUrl,
9
12
  startFetchTiming,
10
13
  tryXiaoEUnifiedLogin
11
- } from "./chunk-OJQUJZQF.js";
14
+ } from "./chunk-XXJOSZTQ.js";
12
15
  import {
13
16
  CliError
14
17
  } from "./chunk-LUSPKZKY.js";
@@ -166,7 +169,12 @@ async function recoverXiaoEAuthSession(ctx, currentSession) {
166
169
  if (!canAutomaticallyRecoverXiaoE(ctx, currentSession)) return null;
167
170
  const options = globalOptions(ctx);
168
171
  const profile = options.profile || getActiveProfile();
169
- const baseUrl = currentSession.getBaseUrl();
172
+ const config = readProfileConfig(profile);
173
+ const baseUrl = resolveXiaoEPreferredBaseUrl({
174
+ explicitBaseUrl: currentSession?.getBaseUrl() || options.baseUrl,
175
+ profileBaseUrl: config.baseUrl,
176
+ env: ctx.env
177
+ });
170
178
  const key = `${profile}
171
179
  ${baseUrl}`;
172
180
  const existing = recoveryInFlight.get(key);
@@ -178,7 +186,7 @@ ${baseUrl}`;
178
186
  profileBaseUrl: baseUrl,
179
187
  allowBundledEnvScript: true,
180
188
  allowTokenScript: true,
181
- tenantKeyFallback: currentSession.tenantKey,
189
+ tenantKeyFallback: currentSession?.tenantKey || config.tenantKey,
182
190
  profileHint: profile
183
191
  // Intentionally no logger: transparent recovery must not leak an
184
192
  // intermediate "login" step into agent stdout/stderr or JSON output.
@@ -205,7 +213,18 @@ async function getE10Session(ctx, load = {}) {
205
213
  return E10AuthSession.fromOptions(options, ctx.cwd, load);
206
214
  }
207
215
  async function requireE10Session(ctx, load = {}) {
208
- const session = await getE10Session(ctx, load);
216
+ let session = await getE10Session(ctx, load);
217
+ if (!session && canAutomaticallyRecoverXiaoE(ctx)) {
218
+ session = await recoverXiaoEAuthSession(ctx).catch(() => null);
219
+ if (!session) {
220
+ throw Object.assign(new CliError(E10_XIAOE_RECOVERY_FAILED_MESSAGE, 3 /* AuthError */), {
221
+ type: "authentication",
222
+ subtype: "xiaoe_credential_unavailable",
223
+ retryable: false,
224
+ stage: "xiaoe_unified_login"
225
+ });
226
+ }
227
+ }
209
228
  if (!session) {
210
229
  throw new CliError(E10_AUTH_REQUIRED_MESSAGE, 3 /* AuthError */);
211
230
  }
@@ -404,7 +423,8 @@ var E10RequestRuntime = class {
404
423
  maxResponseBytes: request.maxResponseBytes,
405
424
  timeoutMs: request.timeoutMs || DEFAULT_TIMEOUT_MS,
406
425
  responseType: request.responseType || "json",
407
- bigIntStrings: request.bigIntStrings ?? DEFAULT_BIG_INT_STRINGS
426
+ bigIntStrings: request.bigIntStrings ?? DEFAULT_BIG_INT_STRINGS,
427
+ followRedirects: request.followRedirects === true
408
428
  };
409
429
  }
410
430
  sessionContext() {
@@ -474,7 +494,8 @@ var E10RequestRuntime = class {
474
494
  const init = {
475
495
  method: request.method,
476
496
  headers,
477
- redirect: "manual"
497
+ // 文件下载允许跟随重定向(302 → 文件服务);其余请求保持 manual 以便识别登录跳转
498
+ redirect: request.followRedirects ? "follow" : "manual"
478
499
  };
479
500
  if (request.streamBody) {
480
501
  init.body = request.streamBody;
@@ -667,6 +688,7 @@ function cloneForHook(value) {
667
688
 
668
689
  export {
669
690
  isE10SessionExpiredResponse,
691
+ isE10AuthenticationRequired,
670
692
  requireE10Session,
671
693
  E10ApiError,
672
694
  createE10RequestRuntime