weaver-work-cli 0.1.32 → 0.1.36

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 (211) hide show
  1. package/README.md +2 -2
  2. package/dist/chunks/{archive-UMGX72K6.js → archive-XBVH7JU7.js} +2 -2
  3. package/dist/chunks/{archive-oa-N2IYBLF3.js → archive-oa-MZM3EKFQ.js} +2 -2
  4. package/dist/chunks/{asset-GLEGKFG5.js → asset-4XO7UOUW.js} +2 -2
  5. package/dist/chunks/{attachment-content-AQNX5N3S.js → attachment-content-VXSWANAC.js} +3 -2
  6. package/dist/chunks/{blog-E44OTVDA.js → blog-PGZKOPSC.js} +2 -2
  7. package/dist/chunks/{caizhilian-DQUFZXZL.js → caizhilian-BH4ZVGUN.js} +2 -2
  8. package/dist/chunks/{calendar-JKPIRKFD.js → calendar-MXEMTIO4.js} +2 -2
  9. package/dist/chunks/{chunk-QWY6PGL6.js → chunk-2LV74IWP.js} +361 -56
  10. package/dist/chunks/chunk-3SO6QL6U.js +73 -0
  11. package/dist/chunks/chunk-5DQEEGCC.js +229 -0
  12. package/dist/chunks/{chunk-G3QJULO2.js → chunk-6LLJFKJE.js} +1 -1
  13. package/dist/chunks/{chunk-C6R3B2ML.js → chunk-BPE37FPB.js} +35 -7
  14. package/dist/chunks/chunk-BYATLLEF.js +68 -0
  15. package/dist/chunks/chunk-BYBSCN4X.js +932 -0
  16. package/dist/chunks/{chunk-CVZ2JOSW.js → chunk-F746NKNF.js} +1 -1
  17. package/dist/chunks/{chunk-GCG2NMWR.js → chunk-HXJQI5NM.js} +4 -2
  18. package/dist/chunks/{chunk-YRVDW4WN.js → chunk-I6QGIBDM.js} +2 -2
  19. package/dist/chunks/{chunk-H7J4DC5R.js → chunk-JCSN3JGM.js} +2 -2
  20. package/dist/chunks/{chunk-2GA5ZIQL.js → chunk-JNG42JKG.js} +30 -1
  21. package/dist/chunks/{chunk-DW6AUUKS.js → chunk-JUXVYKII.js} +9 -4
  22. package/dist/chunks/{chunk-6RKD4DRZ.js → chunk-JYKABYCV.js} +2 -2
  23. package/dist/chunks/{chunk-6EFWDL7Y.js → chunk-NCOVUAZK.js} +2 -2
  24. package/dist/chunks/{chunk-E4Z23GHM.js → chunk-QHFANTX7.js} +1114 -904
  25. package/dist/chunks/{ebuilder-form-V5FG2EHC.js → chunk-QYGO5EE2.js} +22 -1148
  26. package/dist/chunks/{chunk-IURUFGZK.js → chunk-T72N74ZT.js} +50 -33
  27. package/dist/chunks/{chunk-H6XSTSLM.js → chunk-TC6MZAO3.js} +137 -204
  28. package/dist/chunks/{chunk-WKI2FBIQ.js → chunk-VPUTVEMC.js} +737 -341
  29. package/dist/chunks/{chunk-WSKBSQ2U.js → chunk-VPXOPQJI.js} +2 -2
  30. package/dist/chunks/chunk-WXFPWCXG.js +774 -0
  31. package/dist/chunks/{chunk-4YC43QQ4.js → chunk-XMGSYD6S.js} +4 -4
  32. package/dist/chunks/conflict-JAB2LJEZ.js +21 -0
  33. package/dist/chunks/continuation-RN6PZN2M.js +11 -0
  34. package/dist/chunks/contract-XI2EEIZU.js +9110 -0
  35. package/dist/chunks/cowork-SCPGLBA4.js +2527 -0
  36. package/dist/chunks/ebuilder-form-EYLHNOTA.js +121 -0
  37. package/dist/chunks/{ehr-HMFY6VIL.js → ehr-EAP77IMT.js} +1344 -27
  38. package/dist/chunks/{esb-ZYSVB7SG.js → esb-2TGGXEE7.js} +4 -4
  39. package/dist/chunks/{fna-B7RKPAZD.js → fna-2X7ZE7BU.js} +13 -8
  40. package/dist/chunks/{host-OCH2BCCV.js → host-C6EL2RKL.js} +3 -3
  41. package/dist/chunks/{host-45WED2KK.js → host-I4NRK4MX.js} +3 -3
  42. package/dist/chunks/{host-I4Z6BFYX.js → host-Q4LZGCRU.js} +3 -3
  43. package/dist/chunks/host-UEI5FGDM.js +23 -0
  44. package/dist/chunks/{host-KNZ52LJZ.js → host-XCLDDXKQ.js} +3 -3
  45. package/dist/chunks/{hrm-2KAZGUHI.js → hrm-YXERJM76.js} +3 -3
  46. package/dist/chunks/{im-ACJJWH4U.js → im-A4VZN2TQ.js} +88 -12
  47. package/dist/chunks/{invoice-ZK3WCX2U.js → invoice-2Z6YPMIS.js} +3 -3
  48. package/dist/chunks/{jiuchuanhui-5PQD3IL2.js → jiuchuanhui-AR5GMKZB.js} +2 -2
  49. package/dist/chunks/{lazy-dispatch-JQXBW3GM.js → lazy-dispatch-QXW7P4X3.js} +4 -4
  50. package/dist/chunks/{mail-S2HDDXO2.js → mail-7GZ6CPBJ.js} +45 -24
  51. package/dist/chunks/{meeting-QVN3I37L.js → meeting-3NMGA3MB.js} +278 -43
  52. package/dist/chunks/{okr-QNG4VC2Q.js → okr-BZ6XUOAG.js} +2 -2
  53. package/dist/chunks/operations-5QL3AECO.js +11 -0
  54. package/dist/chunks/{plan-A25EMW6U.js → plan-DR5CMUYP.js} +2 -2
  55. package/dist/chunks/{project-G6XV66DZ.js → project-6J63MK33.js} +2 -2
  56. package/dist/chunks/{registry-DC6KR3NH.js → registry-KDD7DHNK.js} +4 -4
  57. package/dist/chunks/{registry-2VLUAESA.js → registry-OZSMDVPP.js} +2 -2
  58. package/dist/chunks/{registry-7C5UMIPL.js → registry-TKX2E7C7.js} +2 -2
  59. package/dist/chunks/{registry-TI3CIUXF.js → registry-VRTNC6UR.js} +8 -6
  60. package/dist/chunks/{room-recommend-WRTHO6Y2.js → room-recommend-XCWRMB5P.js} +4 -3
  61. package/dist/chunks/{schedule-KFIITGSK.js → schedule-IVBICP32.js} +4 -3
  62. package/dist/chunks/{workflow-DJ7SYWAF.js → workflow-D74NFK3C.js} +179 -6
  63. package/dist/index.js +35 -25
  64. package/dist/internal/e10/auth-recovery.js +14 -4
  65. package/dist/internal/e10/fetch-timing.js +31 -0
  66. package/dist/internal/e10/request-runtime.js +5 -0
  67. package/dist/shortcuts/contract/host.js +34 -59
  68. package/dist/shortcuts/cowork/continuation.js +70 -0
  69. package/dist/shortcuts/cowork/errors.js +59 -0
  70. package/dist/shortcuts/cowork/host.js +180 -0
  71. package/dist/shortcuts/cowork/index.js +166 -0
  72. package/dist/shortcuts/cowork/manifest.js +65 -0
  73. package/dist/shortcuts/cowork/operations/discuss-write.js +277 -0
  74. package/dist/shortcuts/cowork/operations/item-write.js +380 -0
  75. package/dist/shortcuts/cowork/operations/member-write.js +283 -0
  76. package/dist/shortcuts/cowork/operations/permission-write.js +286 -0
  77. package/dist/shortcuts/cowork/operations/read.js +423 -0
  78. package/dist/shortcuts/cowork/operations/registry.js +39 -0
  79. package/dist/shortcuts/cowork/operations/review-write.js +157 -0
  80. package/dist/shortcuts/cowork/operations/shared.js +215 -0
  81. package/dist/shortcuts/cowork/operations/types.js +39 -0
  82. package/dist/shortcuts/cowork/operations.js +19 -0
  83. package/dist/shortcuts/ehr/host.js +4 -1
  84. package/dist/shortcuts/ehr/operations/recruit-candidate-import.js +757 -0
  85. package/dist/shortcuts/ehr/operations/recruit-position.js +367 -0
  86. package/dist/shortcuts/ehr/operations/recruit-stats.js +133 -0
  87. package/dist/shortcuts/ehr/operations/recruit-write.js +43 -16
  88. package/dist/shortcuts/ehr/operations/recruit.js +182 -10
  89. package/dist/shortcuts/ehr/operations/registry.js +6 -0
  90. package/dist/shortcuts/fna/operations/expense-chart.js +19 -7
  91. package/dist/shortcuts/im/diagnostics.js +97 -0
  92. package/dist/shortcuts/im/host.js +58 -31
  93. package/dist/shortcuts/im/index.js +7 -2
  94. package/dist/shortcuts/im/operations/at-mention.js +127 -0
  95. package/dist/shortcuts/im/operations/file-user.js +10 -2
  96. package/dist/shortcuts/im/operations/group-read.js +26 -5
  97. package/dist/shortcuts/im/operations/group-write.js +35 -28
  98. package/dist/shortcuts/im/operations/msg-sync.js +7 -2
  99. package/dist/shortcuts/im/operations/msg-write.js +76 -10
  100. package/dist/shortcuts/im/operations/quote-mention.js +119 -0
  101. package/dist/shortcuts/im/operations/session.js +1 -1
  102. package/dist/shortcuts/im/operations/shared.js +10 -0
  103. package/dist/shortcuts/im/operations/types.js +13 -0
  104. package/dist/shortcuts/index.js +10 -0
  105. package/dist/shortcuts/mail/host.js +12 -1
  106. package/dist/shortcuts/mail/operations/types.js +17 -2
  107. package/dist/shortcuts/meeting/host.js +27 -34
  108. package/dist/shortcuts/meeting/index.js +79 -1
  109. package/dist/shortcuts/meeting/manifest.js +10 -0
  110. package/dist/shortcuts/meeting/operations/create.js +4 -1
  111. package/dist/shortcuts/meeting/operations/eb/catalog.js +10 -0
  112. package/dist/shortcuts/meeting/operations/eb/conflict.js +84 -8
  113. package/dist/shortcuts/meeting/operations/eb/create-flow.js +1195 -140
  114. package/dist/shortcuts/meeting/operations/eb/factory.js +170 -8
  115. package/dist/shortcuts/meeting/operations/eb/index.js +16 -3
  116. package/dist/shortcuts/meeting/operations/eb/room-recommend.js +50 -5
  117. package/dist/shortcuts/meeting/operations/eb-fallback.js +163 -0
  118. package/dist/shortcuts/meeting/operations/env.js +99 -46
  119. package/dist/shortcuts/meeting/operations/form-fields.js +110 -0
  120. package/dist/shortcuts/meeting/operations/invitation.js +79 -20
  121. package/dist/shortcuts/meeting/operations/registry.js +2 -0
  122. package/dist/shortcuts/meeting/operations/standard-guard.js +71 -0
  123. package/dist/shortcuts/meeting/operations.js +16 -0
  124. package/dist/shortcuts/workflow/endpoints.js +8 -3
  125. package/dist/shortcuts/workflow/index.js +110 -1
  126. package/dist/shortcuts/workflow/operations/form.js +204 -36
  127. package/dist/shortcuts/workflow/operations/read.js +104 -23
  128. package/dist/shortcuts/workflow/operations/todoSmartConvert/aigroupRules.js +448 -0
  129. package/dist/shortcuts/workflow/operations/todoSmartConvert/aigroupStore.js +106 -0
  130. package/dist/shortcuts/workflow/operations/todoSmartConvert/businessRules.js +47 -0
  131. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.collect.js +30 -23
  132. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.core.js +1 -0
  133. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.group.js +1 -0
  134. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.groupSummary.js +2 -1
  135. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.js +2 -4
  136. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.smartGroup.js +138 -181
  137. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.summary.js +12 -7
  138. package/dist/shortcuts/workflow/operations.js +23 -1
  139. package/docs/e10-auth.md +1 -1
  140. package/docs/ehr.md +1 -1
  141. package/docs/fna.md +2 -1
  142. package/docs/im.md +8 -1
  143. package/docs/todo-smart-convert/README.md +1 -1
  144. package/docs/todo-smart-convert/data-contract.md +2 -2
  145. package/docs/todo-smart-convert/subgroup-rules.md +6 -0
  146. package/package.json +1 -1
  147. package/skill-template/business-info.json +18 -0
  148. package/skill-template/domains/cowork.md +14 -0
  149. package/skill-template/domains/yimiaoban.md +3 -3
  150. package/skill-template/skill-template.md +1 -1
  151. package/skills/weaver-e10-blog/SKILL.md +5 -5
  152. package/skills/weaver-e10-caizhilian/SKILL.md +5 -5
  153. package/skills/weaver-e10-calendar/SKILL.md +5 -5
  154. package/skills/weaver-e10-cowork/SKILL.md +101 -0
  155. package/skills/weaver-e10-cowork/references/cowork-read.md +90 -0
  156. package/skills/weaver-e10-cowork/references/cowork-write.md +131 -0
  157. package/skills/weaver-e10-cowork/references/safety-boundaries.md +45 -0
  158. package/skills/weaver-e10-esb/SKILL.md +5 -5
  159. package/skills/weaver-e10-hrm/SKILL.md +5 -5
  160. package/skills/weaver-e10-jinchengda/SKILL.md +2 -2
  161. package/skills/weaver-e10-jiuchuanhui/SKILL.md +5 -5
  162. package/skills/weaver-e10-jucailin/SKILL.md +38 -14
  163. package/skills/weaver-e10-jucailin/references/recruit-create.md +104 -0
  164. package/skills/weaver-e10-jucailin/references/recruit-read.md +25 -0
  165. package/skills/weaver-e10-jucailin/references/recruit-write.md +13 -0
  166. package/skills/weaver-e10-jucailin/references/salary.md +15 -11
  167. package/skills/weaver-e10-mail/SKILL.md +17 -14
  168. package/skills/weaver-e10-meeting/SKILL.md +442 -46
  169. package/skills/weaver-e10-meeting/references/meeting-eb.md +135 -3
  170. package/skills/weaver-e10-meeting/references/meeting-invitation.md +28 -2
  171. package/skills/weaver-e10-meeting/references/meeting-queries.md +9 -6
  172. package/skills/weaver-e10-meeting/references/meeting-verification.md +8 -6
  173. package/skills/weaver-e10-meeting.zip +0 -0
  174. package/skills/weaver-e10-okr/SKILL.md +5 -5
  175. package/skills/weaver-e10-okr/references/source-manifest.json +3 -3
  176. package/skills/weaver-e10-plan/SKILL.md +5 -5
  177. package/skills/weaver-e10-qiyecheng/SKILL.md +5 -2
  178. package/skills/weaver-e10-qiyecheng/references/catalog.md +2 -2
  179. package/skills/weaver-e10-qiyecheng/references/expense-chart.md +15 -1
  180. package/skills/weaver-e10-qiyecheng/references/source-manifest.json +22 -21
  181. package/skills/weaver-e10-shared/SKILL.md +12 -12
  182. package/skills/weaver-e10-shared/references/e10-auth-and-session.md +4 -4
  183. package/skills/weaver-e10-wenshuding/SKILL.md +5 -5
  184. package/skills/weaver-e10-workflow/SKILL.md +29 -5
  185. package/skills/weaver-e10-workflow/aigroup/default.json +88 -0
  186. package/skills/weaver-e10-workflow/references/todo-smart-convert.md +66 -14
  187. package/skills/weaver-e10-workflow/references/workflow-agent-entry.md +1 -1
  188. package/skills/weaver-e10-workflow/references/workflow-memory.md +1 -1
  189. package/skills/weaver-e10-workflow/references/workflow-query.md +12 -10
  190. package/skills/weaver-e10-workflow/references/workflow-view.md +2 -2
  191. package/skills/weaver-e10-workflow/tools/todo-serve.cjs +239 -0
  192. package/skills/weaver-e10-workflow/{scripts → tools}/todo-summary.cjs +218 -28
  193. package/skills/weaver-e10-yepiaotong/SKILL.md +10 -8
  194. package/skills/weaver-e10-yepiaotong/references/invoice-reim.md +7 -7
  195. package/skills/weaver-e10-yepiaotong/references/reim-api-reference.md +10 -10
  196. package/skills/weaver-e10-yepiaotong/references/reim-examples.md +40 -37
  197. package/skills/weaver-e10-yepiaotong/references/reim-expense-subject-rules.md +4 -4
  198. package/skills/weaver-e10-yepiaotong/references/reim-form-fill-rules.md +27 -38
  199. package/skills/weaver-e10-yepiaotong/references/reim-phone-subsidy-rules.md +4 -4
  200. package/skills/weaver-e10-yepiaotong/references/reim-workflow.md +37 -29
  201. package/skills/weaver-e10-yimiaoban/SKILL.md +156 -33
  202. package/skills/weaver-e10-yimiaoban/references/ding-write.md +1 -1
  203. package/skills/weaver-e10-yimiaoban/references/error-codes.md +5 -1
  204. package/skills/weaver-e10-yimiaoban/references/group-read.md +5 -1
  205. package/skills/weaver-e10-yimiaoban/references/group-write.md +6 -4
  206. package/skills/weaver-e10-yimiaoban/references/msg-read.md +1 -0
  207. package/skills/weaver-e10-yimiaoban/references/msg-write.md +34 -2
  208. package/skills/weaver-e10-yimiaoban/references/safety-boundaries.md +5 -2
  209. package/skills/weaver-e10-yimiaoban/references/source-manifest.json +79 -58
  210. package/skills/weaver-e10-yimiaoban/references/user-remind.md +2 -2
  211. package/skills/weaver-e10-ziguanjia/SKILL.md +5 -5
@@ -9,15 +9,15 @@ import {
9
9
  assertNoForbiddenKeys,
10
10
  esbManifest,
11
11
  getEsbOperation
12
- } from "./chunk-G3QJULO2.js";
12
+ } from "./chunk-6LLJFKJE.js";
13
13
  import {
14
14
  createEsbHost
15
- } from "./chunk-YRVDW4WN.js";
15
+ } from "./chunk-I6QGIBDM.js";
16
16
  import {
17
17
  esbValidationError
18
18
  } from "./chunk-GPMFD4RD.js";
19
- import "./chunk-DW6AUUKS.js";
20
- import "./chunk-2GA5ZIQL.js";
19
+ import "./chunk-JUXVYKII.js";
20
+ import "./chunk-JNG42JKG.js";
21
21
  import {
22
22
  isCliError,
23
23
  toErrorEnvelope
@@ -4,11 +4,11 @@ import {
4
4
  E10ApiError,
5
5
  createE10RequestRuntime,
6
6
  requireE10Session
7
- } from "./chunk-DW6AUUKS.js";
7
+ } from "./chunk-JUXVYKII.js";
8
8
  import {
9
9
  E10_SESSION_EXPIRED_MESSAGE,
10
10
  getActiveProfile
11
- } from "./chunk-2GA5ZIQL.js";
11
+ } from "./chunk-JNG42JKG.js";
12
12
  import {
13
13
  CliError,
14
14
  isCliError,
@@ -719,6 +719,7 @@ var MAX_ROWS_LIMIT = 5e3;
719
719
  var USER_INPUT_LIMIT = 500;
720
720
  var BLOCKED_MESSAGE = /拦截|高危|安全校验/;
721
721
  var CLARIFY_MESSAGE = /不明确|请补充|补充查询/;
722
+ var PERMISSION_DENIED_MESSAGE = /权限|越权/;
722
723
  function requireUserInput(value) {
723
724
  if (typeof value !== "string" || value.trim().length === 0) {
724
725
  throw fnaValidationError("user_input_required", "userInput \u5FC5\u586B\uFF08\u81EA\u7136\u8BED\u8A00\u95EE\u9898\uFF0C\u4E0D\u80FD\u4E3A\u7A7A\u767D\uFF09");
@@ -773,8 +774,9 @@ function collectColumns(rows) {
773
774
  return columns;
774
775
  }
775
776
  function classifyMessage(message) {
776
- if (BLOCKED_MESSAGE.test(message)) return "blocked";
777
- if (CLARIFY_MESSAGE.test(message)) return "clarify";
777
+ if (PERMISSION_DENIED_MESSAGE.test(message)) return { kind: "clarify", permissionDenied: true };
778
+ if (BLOCKED_MESSAGE.test(message)) return { kind: "blocked", permissionDenied: false };
779
+ if (CLARIFY_MESSAGE.test(message)) return { kind: "clarify", permissionDenied: false };
778
780
  return void 0;
779
781
  }
780
782
  function normalizeChart(data, maxRows) {
@@ -807,9 +809,12 @@ function normalizeChart(data, maxRows) {
807
809
  });
808
810
  }
809
811
  if (typeof data === "string") {
810
- const kind = classifyMessage(data);
811
- if (kind) {
812
- return fnaSuccess("fna.expense.chart", { kind, message: data }, { messageKindInferred: true });
812
+ const classified = classifyMessage(data);
813
+ if (classified) {
814
+ return fnaSuccess("fna.expense.chart", { kind: classified.kind, message: data }, {
815
+ messageKindInferred: true,
816
+ permissionDenied: classified.permissionDenied
817
+ });
813
818
  }
814
819
  }
815
820
  return fnaSuccess("fna.expense.chart", { kind: "unexpected" }, { dataType: dataTypeOf(data) });
@@ -819,7 +824,7 @@ var fnaExpenseChart = {
819
824
  resource: "expense",
820
825
  method: "expense.chart",
821
826
  action: "fna.expense.chart",
822
- summary: "\u62A5\u9500\u62A5\u8868 AI \u95EE\u7B54\uFF1A\u7528\u81EA\u7136\u8BED\u8A00\u67E5\u8BE2\u5206\u7EC4/\u6392\u540D/\u8D8B\u52BF\uFF0C\u8FD4\u56DE kind=rows/empty/clarify/blocked/unexpected\uFF1BmaxRows \u53EA\u622A\u65AD\u672C\u5730\u5C55\u793A",
827
+ summary: "\u62A5\u9500\u62A5\u8868 AI \u95EE\u7B54\uFF1A\u7528\u81EA\u7136\u8BED\u8A00\u67E5\u8BE2\u5206\u7EC4/\u6392\u540D/\u8D8B\u52BF\uFF0C\u8FD4\u56DE kind=rows/empty/clarify/blocked/unexpected\uFF1B\u65E0\u6743\u9650\u6587\u6848\u989D\u5916\u8FD4\u56DE meta.permissionDenied=true\uFF0C\u6B64\u65F6\u5FC5\u987B\u505C\u4F4F\u3001\u4E0D\u5F97\u6539\u8C03\u5176\u5B83\u63A5\u53E3\u62FC\u6570\u636E\uFF1BmaxRows \u53EA\u622A\u65AD\u672C\u5730\u5C55\u793A",
823
828
  capability: "expense-chart",
824
829
  risk: READ,
825
830
  inputSchema: schemaOf(
@@ -5,10 +5,10 @@ import {
5
5
  extractApiBusinessError,
6
6
  isAtustRedirect,
7
7
  isLoginExpired
8
- } from "./chunk-WSKBSQ2U.js";
8
+ } from "./chunk-VPXOPQJI.js";
9
9
  import "./chunk-FMPJJYYI.js";
10
- import "./chunk-DW6AUUKS.js";
11
- import "./chunk-2GA5ZIQL.js";
10
+ import "./chunk-JUXVYKII.js";
11
+ import "./chunk-JNG42JKG.js";
12
12
  import "./chunk-LUSPKZKY.js";
13
13
  import "./chunk-BUSC6UAE.js";
14
14
  export {
@@ -6,10 +6,10 @@ import {
6
6
  createEsbHost,
7
7
  isEsbFlowUnavailable,
8
8
  triggerResultCode
9
- } from "./chunk-YRVDW4WN.js";
9
+ } from "./chunk-I6QGIBDM.js";
10
10
  import "./chunk-GPMFD4RD.js";
11
- import "./chunk-DW6AUUKS.js";
12
- import "./chunk-2GA5ZIQL.js";
11
+ import "./chunk-JUXVYKII.js";
12
+ import "./chunk-JNG42JKG.js";
13
13
  import "./chunk-LUSPKZKY.js";
14
14
  import "./chunk-BUSC6UAE.js";
15
15
  export {
@@ -7,10 +7,10 @@ import {
7
7
  dirname,
8
8
  mkdir,
9
9
  writeFile
10
- } from "./chunk-IURUFGZK.js";
10
+ } from "./chunk-T72N74ZT.js";
11
11
  import "./chunk-ZEDWSH32.js";
12
- import "./chunk-DW6AUUKS.js";
13
- import "./chunk-2GA5ZIQL.js";
12
+ import "./chunk-JUXVYKII.js";
13
+ import "./chunk-JNG42JKG.js";
14
14
  import "./chunk-LUSPKZKY.js";
15
15
  import "./chunk-BUSC6UAE.js";
16
16
  export {
@@ -0,0 +1,23 @@
1
+ import { createRequire as __esbuildCreateRequire } from 'node:module';
2
+ const require = __esbuildCreateRequire(import.meta.url);
3
+ import {
4
+ createEbuilderFormHost,
5
+ encodeNlistCustomConfig,
6
+ parseDirectListUrl,
7
+ pickEbuilderDataKey,
8
+ resolveApiPrefix,
9
+ routeEbuilderPath
10
+ } from "./chunk-QYGO5EE2.js";
11
+ import "./chunk-BYATLLEF.js";
12
+ import "./chunk-JUXVYKII.js";
13
+ import "./chunk-JNG42JKG.js";
14
+ import "./chunk-LUSPKZKY.js";
15
+ import "./chunk-BUSC6UAE.js";
16
+ export {
17
+ createEbuilderFormHost,
18
+ encodeNlistCustomConfig,
19
+ parseDirectListUrl,
20
+ pickEbuilderDataKey,
21
+ resolveApiPrefix,
22
+ routeEbuilderPath
23
+ };
@@ -4,10 +4,10 @@ import {
4
4
  businessMessage,
5
5
  createHrmHost,
6
6
  isBusinessSuccess
7
- } from "./chunk-6EFWDL7Y.js";
7
+ } from "./chunk-NCOVUAZK.js";
8
8
  import "./chunk-OOUTBLZ4.js";
9
- import "./chunk-DW6AUUKS.js";
10
- import "./chunk-2GA5ZIQL.js";
9
+ import "./chunk-JUXVYKII.js";
10
+ import "./chunk-JNG42JKG.js";
11
11
  import "./chunk-LUSPKZKY.js";
12
12
  import "./chunk-BUSC6UAE.js";
13
13
  export {
@@ -2,7 +2,7 @@ import { createRequire as __esbuildCreateRequire } from 'node:module';
2
2
  const require = __esbuildCreateRequire(import.meta.url);
3
3
  import {
4
4
  createHrmHost
5
- } from "./chunk-6EFWDL7Y.js";
5
+ } from "./chunk-NCOVUAZK.js";
6
6
  import {
7
7
  getHrmOperation,
8
8
  hrmOperationDefinitions
@@ -14,8 +14,8 @@ import {
14
14
  import {
15
15
  hrmValidationError
16
16
  } from "./chunk-OOUTBLZ4.js";
17
- import "./chunk-DW6AUUKS.js";
18
- import "./chunk-2GA5ZIQL.js";
17
+ import "./chunk-JUXVYKII.js";
18
+ import "./chunk-JNG42JKG.js";
19
19
  import {
20
20
  isCliError,
21
21
  toErrorEnvelope
@@ -1,23 +1,23 @@
1
1
  import { createRequire as __esbuildCreateRequire } from 'node:module';
2
2
  const require = __esbuildCreateRequire(import.meta.url);
3
- import {
4
- createImContinuationSigner
5
- } from "./chunk-P26ZWSKU.js";
6
3
  import {
7
4
  asObject,
8
5
  assertNoForbiddenKeys,
9
6
  getImOperation,
10
7
  imOperationDefinitions
11
- } from "./chunk-QWY6PGL6.js";
12
- import "./chunk-YLCYX7LE.js";
8
+ } from "./chunk-2LV74IWP.js";
13
9
  import {
14
10
  createImHost
15
- } from "./chunk-IURUFGZK.js";
11
+ } from "./chunk-T72N74ZT.js";
12
+ import {
13
+ createImContinuationSigner
14
+ } from "./chunk-P26ZWSKU.js";
16
15
  import {
17
16
  imValidationError
18
17
  } from "./chunk-ZEDWSH32.js";
19
- import "./chunk-DW6AUUKS.js";
20
- import "./chunk-2GA5ZIQL.js";
18
+ import "./chunk-YLCYX7LE.js";
19
+ import "./chunk-JUXVYKII.js";
20
+ import "./chunk-JNG42JKG.js";
21
21
  import {
22
22
  isCliError,
23
23
  toErrorEnvelope
@@ -27,6 +27,81 @@ import "./chunk-BUSC6UAE.js";
27
27
  // src/shortcuts/im/index.ts
28
28
  import { readFile } from "node:fs/promises";
29
29
 
30
+ // src/shortcuts/im/diagnostics.ts
31
+ var TRACE_ENV = "WEAVER_WORK_CLI_TRACE";
32
+ var registeredHooks = /* @__PURE__ */ new WeakSet();
33
+ function truthy(value) {
34
+ const raw = String(value ?? "").toLowerCase();
35
+ return raw === "1" || raw === "true" || raw === "yes";
36
+ }
37
+ function traceFromCommand(ctx) {
38
+ let current = ctx.activeCommand;
39
+ for (let depth = 0; current && depth <= 3; depth += 1) {
40
+ const opts = typeof current.opts === "function" ? current.opts() : void 0;
41
+ if (opts?.trace === true) return true;
42
+ current = current.parent ?? void 0;
43
+ }
44
+ return false;
45
+ }
46
+ function imTraceEnabled(ctx) {
47
+ if (truthy(ctx.env?.[TRACE_ENV]) || truthy(process.env[TRACE_ENV])) return true;
48
+ try {
49
+ return traceFromCommand(ctx);
50
+ } catch {
51
+ return false;
52
+ }
53
+ }
54
+ var inflight = /* @__PURE__ */ new Map();
55
+ function remember(path) {
56
+ const list = inflight.get(path) ?? [];
57
+ list.push(Date.now());
58
+ inflight.set(path, list);
59
+ }
60
+ function forget(path) {
61
+ const list = inflight.get(path);
62
+ if (!list?.length) return void 0;
63
+ const startedAt = list.shift();
64
+ if (!list.length) inflight.delete(path);
65
+ return startedAt;
66
+ }
67
+ function label(request) {
68
+ const operation = request.operation || "-";
69
+ return `${request.method} ${request.path} op=${operation}`;
70
+ }
71
+ function traceInterceptor() {
72
+ return {
73
+ beforeRequest({ request }) {
74
+ remember(request.path);
75
+ },
76
+ afterResponse({ request, response }) {
77
+ const startedAt = forget(request.path);
78
+ const ms = startedAt === void 0 ? "-" : `${Date.now() - startedAt}ms`;
79
+ process.stderr.write(`[trace] ${label(request)} status=${response.status} ${ms}
80
+ `);
81
+ },
82
+ onError({ request, error }) {
83
+ const startedAt = forget(request.path);
84
+ const ms = startedAt === void 0 ? "-" : `${Date.now() - startedAt}ms`;
85
+ const code = error?.subtype || error?.code || "unknown";
86
+ process.stderr.write(`[trace] ${label(request)} status=ERR code=${code} ${ms}
87
+ `);
88
+ }
89
+ };
90
+ }
91
+ function registerImTrace(ctx) {
92
+ if (!imTraceEnabled(ctx)) return;
93
+ const hooks = ctx.hooks;
94
+ if (!hooks || registeredHooks.has(hooks)) return;
95
+ registeredHooks.add(hooks);
96
+ ctx.hooks.registerE10RequestInterceptor(traceInterceptor());
97
+ }
98
+ function printImFailure(envelope) {
99
+ const text = `${JSON.stringify(envelope, null, 2)}
100
+ `;
101
+ process.stdout.write(text);
102
+ process.stderr.write(text);
103
+ }
104
+
30
105
  // src/shortcuts/im/manifest.ts
31
106
  function buildOperations() {
32
107
  return imOperationDefinitions().map((definition) => ({
@@ -97,7 +172,7 @@ async function inputFrom(options, extra = {}) {
97
172
  ...Object.fromEntries(Object.entries(extra).filter(([, value]) => value !== void 0 && value !== ""))
98
173
  };
99
174
  }
100
- function parseJsonInput(raw, label) {
175
+ function parseJsonInput(raw, label2) {
101
176
  try {
102
177
  const parsed = JSON.parse(stripBom(raw));
103
178
  if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) {
@@ -105,7 +180,7 @@ function parseJsonInput(raw, label) {
105
180
  }
106
181
  return parsed;
107
182
  } catch {
108
- throw imValidationError("input_invalid", `${label} \u4E0D\u662F\u5408\u6CD5 JSON \u5BF9\u8C61`);
183
+ throw imValidationError("input_invalid", `${label2} \u4E0D\u662F\u5408\u6CD5 JSON \u5BF9\u8C61`);
109
184
  }
110
185
  }
111
186
  function withJsonInputOptions(command) {
@@ -133,6 +208,7 @@ function failureEnvelope(error) {
133
208
  };
134
209
  }
135
210
  async function executeAndPrint(ctx, operation, input) {
211
+ registerImTrace(ctx);
136
212
  try {
137
213
  const result = await executeImOperation(operation, input, {
138
214
  ctx,
@@ -141,7 +217,7 @@ async function executeAndPrint(ctx, operation, input) {
141
217
  });
142
218
  ctx.output.write(successEnvelope(operation, result), { json: true });
143
219
  } catch (error) {
144
- console.error(JSON.stringify(failureEnvelope(error), null, 2));
220
+ printImFailure(failureEnvelope(error));
145
221
  process.exitCode = isCliError(error) ? error.exitCode : 1 /* GeneralError */;
146
222
  }
147
223
  }
@@ -154,7 +230,7 @@ var imShortcut = {
154
230
  description: "\u6CDB\u5FAEE10\u6613\u79D2\u529E\uFF08\u5373\u65F6\u901A\u8BAF\uFF09CLI",
155
231
  category: "shortcut",
156
232
  register({ program, action }) {
157
- const im = program.command("im").description("\u6CDB\u5FAEE10\u6613\u79D2\u529E\uFF1A\u6D88\u606F/\u7FA4\u7EC4/\u4F1A\u8BDD/\u7CFB\u7EDF\u6D88\u606F");
233
+ const im = program.command("im").description("\u6CDB\u5FAEE10\u6613\u79D2\u529E\uFF1A\u6D88\u606F/\u7FA4\u7EC4/\u4F1A\u8BDD/\u7CFB\u7EDF\u6D88\u606F").option("--trace", "\u6BCF\u4E2A E10 \u8BF7\u6C42\u5728 stderr \u6253\u4E00\u884C [trace]\uFF08method/path/op/status/\u8017\u65F6\uFF0C\u4E0D\u542B\u51ED\u8BC1\uFF09");
158
234
  im.command("schema").description("Print im operation manifest for agents").action(action((ctx) => {
159
235
  ctx.output.write(imManifest, { json: true });
160
236
  }));
@@ -7,9 +7,9 @@ import {
7
7
  invoicePartialError,
8
8
  invoiceValidationError,
9
9
  isInvoiceNetworkError
10
- } from "./chunk-H7J4DC5R.js";
11
- import "./chunk-DW6AUUKS.js";
12
- import "./chunk-2GA5ZIQL.js";
10
+ } from "./chunk-JCSN3JGM.js";
11
+ import "./chunk-JUXVYKII.js";
12
+ import "./chunk-JNG42JKG.js";
13
13
  import {
14
14
  isCliError,
15
15
  toErrorEnvelope
@@ -4,11 +4,11 @@ import {
4
4
  E10ApiError,
5
5
  createE10RequestRuntime,
6
6
  requireE10Session
7
- } from "./chunk-DW6AUUKS.js";
7
+ } from "./chunk-JUXVYKII.js";
8
8
  import {
9
9
  E10_SESSION_EXPIRED_MESSAGE,
10
10
  getActiveProfile
11
- } from "./chunk-2GA5ZIQL.js";
11
+ } from "./chunk-JNG42JKG.js";
12
12
  import {
13
13
  CliError,
14
14
  isCliError,
@@ -5,12 +5,12 @@ import {
5
5
  createProgram,
6
6
  registerCommands,
7
7
  toCommandMetadata
8
- } from "./chunk-6RKD4DRZ.js";
8
+ } from "./chunk-JYKABYCV.js";
9
9
  import "./chunk-EG6ZU444.js";
10
10
  import "./chunk-AJ62BGAW.js";
11
- import "./chunk-H7J4DC5R.js";
12
- import "./chunk-DW6AUUKS.js";
13
- import "./chunk-2GA5ZIQL.js";
11
+ import "./chunk-JCSN3JGM.js";
12
+ import "./chunk-JUXVYKII.js";
13
+ import "./chunk-JNG42JKG.js";
14
14
  import "./chunk-LUSPKZKY.js";
15
15
  import "./chunk-BUSC6UAE.js";
16
16
 
@@ -4,11 +4,11 @@ import {
4
4
  E10ApiError,
5
5
  createE10RequestRuntime,
6
6
  requireE10Session
7
- } from "./chunk-DW6AUUKS.js";
7
+ } from "./chunk-JUXVYKII.js";
8
8
  import {
9
9
  E10_SESSION_EXPIRED_MESSAGE,
10
10
  getActiveProfile
11
- } from "./chunk-2GA5ZIQL.js";
11
+ } from "./chunk-JNG42JKG.js";
12
12
  import {
13
13
  CliError,
14
14
  isCliError,
@@ -128,6 +128,42 @@ function createMailContinuationSigner(ctx) {
128
128
 
129
129
  // src/shortcuts/mail/host.ts
130
130
  import { randomBytes as randomBytes2 } from "node:crypto";
131
+
132
+ // src/shortcuts/mail/operations/types.ts
133
+ var READ = "read";
134
+ var WRITE = "write";
135
+ var mailPerf = {
136
+ t0: Date.now(),
137
+ sessionMs: 0,
138
+ requestCount: 0,
139
+ requestMs: 0
140
+ };
141
+ function mailSuccess(action, data, meta) {
142
+ const payload = { ok: true, action, data };
143
+ const perf = {
144
+ elapsed_ms: Date.now() - mailPerf.t0,
145
+ session_ms: mailPerf.sessionMs || void 0,
146
+ requests: mailPerf.requestCount || void 0,
147
+ network_ms: mailPerf.requestMs || void 0
148
+ };
149
+ for (const k of Object.keys(perf)) if (perf[k] === void 0) delete perf[k];
150
+ payload.meta = { ...meta || {}, ...perf };
151
+ return payload;
152
+ }
153
+ function schemaOf(properties, options = {}) {
154
+ return {
155
+ type: "object",
156
+ additionalProperties: false,
157
+ properties,
158
+ ...options.required?.length ? { required: options.required } : {},
159
+ ...options.description ? { description: options.description } : {}
160
+ };
161
+ }
162
+ var SCHEMA_STRING = { type: "string" };
163
+ var SCHEMA_INTEGER = { type: "integer" };
164
+ var SCHEMA_BOOLEAN = { type: "boolean" };
165
+
166
+ // src/shortcuts/mail/host.ts
131
167
  function inferProfile(ctx) {
132
168
  const options = ctx.getGlobalOptions();
133
169
  return options.profile || getActiveProfile();
@@ -192,10 +228,12 @@ function mailMessage(value) {
192
228
  function createMailHost(ctx, dependencies = {}) {
193
229
  let e10Session = null;
194
230
  let sessionContext = null;
195
- const requireSession = dependencies.requireSession || requireE10Session;
231
+ const requireSession = dependencies.requireSession || ((innerCtx) => requireE10Session(innerCtx, { skipProfileEnrichment: true }));
196
232
  async function ensureSession() {
197
233
  if (!e10Session) {
234
+ const sessionStart = Date.now();
198
235
  e10Session = await requireSession(ctx);
236
+ mailPerf.sessionMs = Date.now() - sessionStart;
199
237
  sessionContext = {
200
238
  baseUrl: e10Session.getBaseUrl(),
201
239
  profile: inferProfile(ctx),
@@ -231,6 +269,7 @@ function createMailHost(ctx, dependencies = {}) {
231
269
  assertPath(path);
232
270
  const resolvedMethod = method || (body === void 0 && form === void 0 && multipart === void 0 ? "GET" : "POST");
233
271
  let response;
272
+ const reqStart = Date.now();
234
273
  try {
235
274
  response = await (await runtime()).requestJson({
236
275
  module: "mail",
@@ -253,6 +292,9 @@ function createMailHost(ctx, dependencies = {}) {
253
292
  });
254
293
  }
255
294
  throw error;
295
+ } finally {
296
+ mailPerf.requestCount += 1;
297
+ mailPerf.requestMs += Date.now() - reqStart;
256
298
  }
257
299
  if (response.status === 401 || response.status === 302) {
258
300
  throw mailAuthError("session_expired", E10_SESSION_EXPIRED_MESSAGE, { httpStatus: response.status });
@@ -287,27 +329,6 @@ function createMailHost(ctx, dependencies = {}) {
287
329
  return { request, getSession };
288
330
  }
289
331
 
290
- // src/shortcuts/mail/operations/types.ts
291
- var READ = "read";
292
- var WRITE = "write";
293
- function mailSuccess(action, data, meta) {
294
- const payload = { ok: true, action, data };
295
- if (meta && Object.keys(meta).length > 0) payload.meta = meta;
296
- return payload;
297
- }
298
- function schemaOf(properties, options = {}) {
299
- return {
300
- type: "object",
301
- additionalProperties: false,
302
- properties,
303
- ...options.required?.length ? { required: options.required } : {},
304
- ...options.description ? { description: options.description } : {}
305
- };
306
- }
307
- var SCHEMA_STRING = { type: "string" };
308
- var SCHEMA_INTEGER = { type: "integer" };
309
- var SCHEMA_BOOLEAN = { type: "boolean" };
310
-
311
332
  // src/shortcuts/mail/operations/mail-read.ts
312
333
  var FOLDER_TEXT = {
313
334
  "-10": "\u5168\u90E8",