weaver-work-cli 0.1.68 → 0.1.69

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 (146) hide show
  1. package/dist/chunks/{archive-SJTC5265.js → archive-VUTREF3P.js} +4 -4
  2. package/dist/chunks/{archive-oa-PN46RTI2.js → archive-oa-VXXO4RTB.js} +4 -4
  3. package/dist/chunks/{asset-XM3Y4FVU.js → asset-45U6TY7I.js} +32 -5
  4. package/dist/chunks/{asset-idle-DHGP3NYY.js → asset-idle-YCRBMTIT.js} +4 -4
  5. package/dist/chunks/{attachment-content-IXIBOET6.js → attachment-content-7BEDNQ3O.js} +3 -3
  6. package/dist/chunks/{blog-JC47AIXK.js → blog-5AML4WMG.js} +4 -4
  7. package/dist/chunks/{caizhilian-IKIHM77A.js → caizhilian-3P7BUNHT.js} +6 -6
  8. package/dist/chunks/{calendar-GZTSJ57Y.js → calendar-2HUXM3CZ.js} +4 -4
  9. package/dist/chunks/{chunk-QO6JYDIW.js → chunk-3CBURKSY.js} +4 -4
  10. package/dist/chunks/{chunk-Y7RGBRLG.js → chunk-3TZURS7M.js} +1 -1
  11. package/dist/chunks/{chunk-X7ZTM4XG.js → chunk-4XYRTXRR.js} +1 -1
  12. package/dist/chunks/{chunk-OKUJY5YB.js → chunk-67AN5YJT.js} +61 -18
  13. package/dist/chunks/{chunk-LXXR2RRE.js → chunk-6DH73Q5H.js} +50 -50
  14. package/dist/chunks/{chunk-3W5NMGDS.js → chunk-727VKJQK.js} +2 -2
  15. package/dist/chunks/{chunk-QHKY4WZA.js → chunk-BEYEXCWU.js} +2 -2
  16. package/dist/chunks/{chunk-26FCCU5O.js → chunk-DSBV4GRK.js} +3 -3
  17. package/dist/chunks/{chunk-HWA2A25Y.js → chunk-E7VWE2XI.js} +3 -3
  18. package/dist/chunks/{chunk-6OK4LW76.js → chunk-ELF5TPSG.js} +6 -6
  19. package/dist/chunks/{chunk-BJNSTCJK.js → chunk-ERAE4GHX.js} +1 -1
  20. package/dist/chunks/{chunk-YSEHTSHS.js → chunk-FMAZ42HS.js} +11 -11
  21. package/dist/chunks/{chunk-TJN4PIYO.js → chunk-GTAFCAVP.js} +2 -0
  22. package/dist/chunks/{chunk-WSHIOSGM.js → chunk-H2NRTGZR.js} +3 -3
  23. package/dist/chunks/{chunk-4WCVRDC5.js → chunk-HG6INLH6.js} +13 -0
  24. package/dist/chunks/{chunk-FDBAFANU.js → chunk-I5XB4MZT.js} +227 -23
  25. package/dist/chunks/{chunk-C5IIIT4D.js → chunk-JAIZY37Z.js} +4 -4
  26. package/dist/chunks/{chunk-FJUOUSV3.js → chunk-LRKKKO5A.js} +36 -9
  27. package/dist/chunks/{chunk-HLT6B26P.js → chunk-LSVA7QA6.js} +1 -1
  28. package/dist/chunks/{chunk-6N4JPNFL.js → chunk-MD5CW4B6.js} +1 -1
  29. package/dist/chunks/{chunk-O7KPHPXQ.js → chunk-MLJK4KLE.js} +34 -34
  30. package/dist/chunks/{chunk-Q6D6PSMH.js → chunk-QYDSTYGG.js} +3 -3
  31. package/dist/chunks/{chunk-AFZTMYGC.js → chunk-T24EBWAZ.js} +1 -1
  32. package/dist/chunks/{chunk-6T5X6YWX.js → chunk-U3OO3IZF.js} +3 -3
  33. package/dist/chunks/{chunk-VLY5RTVO.js → chunk-UVWW5ABZ.js} +3 -3
  34. package/dist/chunks/{chunk-NP3ZZFGI.js → chunk-VZUH3LKI.js} +16 -5
  35. package/dist/chunks/{chunk-3NJQTG6X.js → chunk-YR3K53BU.js} +2 -2
  36. package/dist/chunks/{conflict-CEXRX2KP.js → conflict-VKCRXHUV.js} +2 -2
  37. package/dist/chunks/{contract-PM3EUPZC.js → contract-3PMHUASH.js} +164 -5
  38. package/dist/chunks/{cowork-34CBYVQP.js → cowork-FZBTTBYX.js} +4 -4
  39. package/dist/chunks/{create-flow-DG6D7U2L.js → create-flow-WYPLBLRK.js} +6 -6
  40. package/dist/chunks/{data-3G4GQS5P.js → data-2YZ6A6TL.js} +19 -4
  41. package/dist/chunks/{ebuilder-form-5ENYH7IF.js → ebuilder-form-AWPTMZBZ.js} +5 -5
  42. package/dist/chunks/{ehr-2CONM7R6.js → ehr-MNPR4TE5.js} +4 -4
  43. package/dist/chunks/{entry-mode-KMP66KHE.js → entry-mode-BCJ7RPFC.js} +3 -3
  44. package/dist/chunks/{env-SW6CTETI.js → env-SCVCHBN2.js} +2 -2
  45. package/dist/chunks/{esb-FQASCY2H.js → esb-GSB5QCEX.js} +6 -6
  46. package/dist/chunks/{factory-ETQAICPA.js → factory-CBXYOEBF.js} +1 -1
  47. package/dist/chunks/{fna-FCLVIWAS.js → fna-XBSNUS2V.js} +4 -4
  48. package/dist/chunks/{group-chat-GTYMCBYS.js → group-chat-RFL4U7RF.js} +3 -3
  49. package/dist/chunks/{host-P7G22WNM.js → host-2UMNXX5H.js} +4 -4
  50. package/dist/chunks/{host-XLCBLNJD.js → host-BD44ASOD.js} +4 -4
  51. package/dist/chunks/{host-2ED2KC4X.js → host-NVDG3NC6.js} +4 -4
  52. package/dist/chunks/{host-46NYKDQP.js → host-R7BP3CTI.js} +4 -4
  53. package/dist/chunks/{host-7IPZKIM4.js → host-SYPCA63D.js} +4 -4
  54. package/dist/chunks/{host-2UYZEY2V.js → host-XVWBOSEN.js} +4 -4
  55. package/dist/chunks/{hrm-5WSMSKPX.js → hrm-FZUDJAND.js} +17 -11
  56. package/dist/chunks/{im-P7GNBRG6.js → im-F5NENPD7.js} +4 -4
  57. package/dist/chunks/{invoice-2QCVNXBG.js → invoice-DS6FLU55.js} +42 -6
  58. package/dist/chunks/{jiuchuanhui-FHGFYAHU.js → jiuchuanhui-PY2WEBUH.js} +157 -9
  59. package/dist/chunks/{lazy-dispatch-K25LTKQY.js → lazy-dispatch-F6O2EPGR.js} +7 -7
  60. package/dist/chunks/{mail-P7VMUKQW.js → mail-ZEOSANEJ.js} +4 -4
  61. package/dist/chunks/{meeting-3PTTPUSG.js → meeting-N2AGGLVI.js} +15 -15
  62. package/dist/chunks/{minute-doc-3IMRJDJV.js → minute-doc-C62EZOJH.js} +4 -4
  63. package/dist/chunks/{okr-OIWJRYWY.js → okr-OZUMTMCL.js} +4 -4
  64. package/dist/chunks/{operations-MI2BSKZX.js → operations-UTUWFJTX.js} +5 -5
  65. package/dist/chunks/{performance-OPEQNW7Y.js → performance-GBKM5G2Y.js} +3 -3
  66. package/dist/chunks/{plan-TJAS4N5X.js → plan-C2NENH42.js} +4 -4
  67. package/dist/chunks/{project-CYBGU6K6.js → project-FAJ2P3UR.js} +4 -4
  68. package/dist/chunks/{reception-2VSWJQ5N.js → reception-NH6MJFPR.js} +16 -8
  69. package/dist/chunks/{recruit-stage-KHJYQE3I.js → recruit-stage-DPEFHLSE.js} +3 -3
  70. package/dist/chunks/{registry-PHPYTXS4.js → registry-7US3QQXV.js} +12 -12
  71. package/dist/chunks/{registry-QRMXRSCT.js → registry-FTPUUHWC.js} +5 -5
  72. package/dist/chunks/{registry-FXBOGH2X.js → registry-Y2HWS6JS.js} +4 -4
  73. package/dist/chunks/{room-recommend-BKCPAXQG.js → room-recommend-LMNF76YS.js} +4 -4
  74. package/dist/chunks/{schedule-Q3MPSZV6.js → schedule-4QE2THAP.js} +4 -4
  75. package/dist/chunks/{smart-extract-TYYKC244.js → smart-extract-GTYKF5TJ.js} +4 -4
  76. package/dist/chunks/{workflow-GEDHALMY.js → workflow-KXYTQZ2H.js} +81 -12
  77. package/dist/core/error-codes.js +1 -1
  78. package/dist/core/host-policy.js +56 -0
  79. package/dist/core/timing.js +227 -0
  80. package/dist/index.js +39 -36
  81. package/dist/internal/e10/auth/commands.js +11 -0
  82. package/dist/internal/e10/auth/error-log.js +13 -0
  83. package/dist/internal/e10/auth/messages.js +10 -0
  84. package/dist/internal/e10/auth/xiaoe.js +12 -2
  85. package/dist/internal/e10/context.js +39 -12
  86. package/dist/internal/e10/network-error.js +28 -0
  87. package/dist/internal/e10/tls-policy.js +260 -0
  88. package/dist/shortcuts/asset/manifest.js +34 -1
  89. package/dist/shortcuts/contract/manifest.js +166 -1
  90. package/dist/shortcuts/data/manifest.js +32 -1
  91. package/dist/shortcuts/hrm/index.js +20 -7
  92. package/dist/shortcuts/invoice/manifest.js +43 -1
  93. package/dist/shortcuts/jiuchuanhui/host.js +76 -4
  94. package/dist/shortcuts/jiuchuanhui/manifest.js +102 -1
  95. package/dist/shortcuts/reception/host.js +19 -5
  96. package/dist/shortcuts/workflow/index.js +55 -5
  97. package/dist/shortcuts/workflow/operations/read.js +12 -2
  98. package/dist/shortcuts/workflow/operations/types.js +7 -1
  99. package/dist/shortcuts/workflow/operations/write.js +20 -2
  100. package/dist/shortcuts/workflow/operations.js +19 -1
  101. package/docs/e10-auth.md +48 -1
  102. package/package.json +1 -1
  103. package/scripts/xiaoe_env.py +18 -3
  104. package/skills/weaver-e10-asset-idle/SKILL.md +1 -1
  105. package/skills/weaver-e10-blog/SKILL.md +2 -2
  106. package/skills/weaver-e10-calendar/SKILL.md +1 -1
  107. package/skills/weaver-e10-data/SKILL.md +1 -1
  108. package/skills/weaver-e10-esb/SKILL.md +1 -1
  109. package/skills/weaver-e10-esb/references/source-manifest.json +3 -3
  110. package/skills/weaver-e10-hrm/SKILL.md +1 -1
  111. package/skills/weaver-e10-jiuchuanhui/references/customer.md +1 -0
  112. package/skills/weaver-e10-jucailin/SKILL.md +84 -17
  113. package/skills/weaver-e10-jucailin/agents/openai.yaml +2 -1
  114. package/skills/weaver-e10-jucailin/references/recruit-create.md +7 -8
  115. package/skills/weaver-e10-jucailin/references/recruit-implement-INDEX.md +41 -0
  116. package/skills/weaver-e10-jucailin/references/recruit-implement-consult-sop.md +77 -0
  117. package/skills/weaver-e10-jucailin/references/recruit-implement-guardrails.md +41 -0
  118. package/skills/weaver-e10-jucailin/references/recruit-implement-kb-data-update-channels.md +31 -0
  119. package/skills/weaver-e10-jucailin/references/recruit-implement-kb-form-external.md +43 -0
  120. package/skills/weaver-e10-jucailin/references/recruit-implement-kb-talent-base-form.md +32 -0
  121. package/skills/weaver-e10-jucailin/references/recruit-implement-pattern-external-collect-update-talent.md +93 -0
  122. package/skills/weaver-e10-jucailin/references/recruit-implement-pattern-external-share-edit.md +64 -0
  123. package/skills/weaver-e10-jucailin/references/recruit-read.md +1 -1
  124. package/skills/weaver-e10-jucailin/references/recruit-stage-ops.md +1 -1
  125. package/skills/weaver-e10-jucailin/references/recruit-write.md +4 -11
  126. package/skills/weaver-e10-jucailin/references/safety-boundaries.md +3 -3
  127. package/skills/weaver-e10-mail/SKILL.md +52 -10
  128. package/skills/weaver-e10-mail/references/mail-agent-entry.md +1 -2
  129. package/skills/weaver-e10-meeting/SKILL.md +1 -1
  130. package/skills/weaver-e10-meeting/references/meeting-verification.md +1 -1
  131. package/skills/weaver-e10-okr/SKILL.md +1 -1
  132. package/skills/weaver-e10-okr/references/source-manifest.json +3 -3
  133. package/skills/weaver-e10-plan/SKILL.md +2 -2
  134. package/skills/weaver-e10-plan/references/source-manifest.json +3 -3
  135. package/skills/weaver-e10-qiyecheng/SKILL.md +2 -2
  136. package/skills/weaver-e10-qiyecheng/references/source-manifest.json +3 -3
  137. package/skills/weaver-e10-reception-flow/SKILL.md +53 -16
  138. package/skills/weaver-e10-shared/SKILL.md +4 -9
  139. package/skills/weaver-e10-shared/references/e10-auth-and-session.md +2 -2
  140. package/skills/weaver-e10-shijingran/SKILL.md +14 -6
  141. package/skills/weaver-e10-shijingran/references/source-manifest.json +5 -4
  142. package/skills/weaver-e10-workflow/SKILL.md +1 -1
  143. package/skills/weaver-e10-workflow/references/source-manifest.json +3 -3
  144. package/skills/weaver-e10-workflow/references/workflow-agent-entry.md +1 -2
  145. package/skills/weaver-e10-ziguanjia/SKILL.md +1 -1
  146. package/skills/weaver-e10-ziguanjia/references/ziguanjia-agent-entry.md +1 -2
@@ -6,13 +6,17 @@ import {
6
6
  import {
7
7
  E10ApiError,
8
8
  createE10RequestRuntime,
9
- getE10Session
10
- } from "./chunk-FJUOUSV3.js";
11
- import "./chunk-TJN4PIYO.js";
12
- import "./chunk-FDBAFANU.js";
9
+ getE10Session,
10
+ requireE10Session
11
+ } from "./chunk-LRKKKO5A.js";
12
+ import {
13
+ E10_AUTH_REQUIRED_MESSAGE
14
+ } from "./chunk-GTAFCAVP.js";
15
+ import "./chunk-I5XB4MZT.js";
13
16
  import {
14
17
  CliError,
15
18
  isCliError,
19
+ isStructuredError,
16
20
  toErrorEnvelope
17
21
  } from "./chunk-UG5G54VL.js";
18
22
  import "./chunk-BUSC6UAE.js";
@@ -447,8 +451,9 @@ async function fetchRestaurantRooms(runtime, options = {}) {
447
451
 
448
452
  // src/shortcuts/reception/host.ts
449
453
  var UPLOAD_TIMEOUT_MS = 18e4;
450
- function createReceptionHost(ctx) {
454
+ function createReceptionHost(ctx, dependencies = {}) {
451
455
  let cached = null;
456
+ const requireSession = dependencies.requireSession || requireE10Session;
452
457
  async function resolve2() {
453
458
  if (cached) return cached;
454
459
  const e10 = await getE10Session(ctx);
@@ -560,9 +565,12 @@ function createReceptionHost(ctx) {
560
565
  }
561
566
  }
562
567
  async function fetchRestaurantRooms2(options = {}) {
563
- const { e10 } = await resolve2();
564
- if (!e10) {
565
- throw receptionEnvironmentError("NO_SESSION", "\u672A\u53D6\u5F97 E10 \u4F1A\u8BDD\uFF0C\u65E0\u6CD5\u67E5\u8BE2\u5C0F\u98DF\u5802\u5305\u53A2");
568
+ let e10;
569
+ try {
570
+ e10 = await requireSession(ctx);
571
+ } catch (error) {
572
+ if (isStructuredError(error)) throw error;
573
+ throw receptionEnvironmentError("NO_SESSION", E10_AUTH_REQUIRED_MESSAGE);
566
574
  }
567
575
  const runtime = createE10RequestRuntime(ctx, e10);
568
576
  return fetchRestaurantRooms(runtime, {
@@ -12,13 +12,13 @@ import {
12
12
  createE10RequestRuntime,
13
13
  isE10SessionExpiredResponse,
14
14
  requireE10Session
15
- } from "./chunk-FJUOUSV3.js";
15
+ } from "./chunk-LRKKKO5A.js";
16
16
  import {
17
17
  E10_SESSION_EXPIRED_MESSAGE
18
- } from "./chunk-TJN4PIYO.js";
18
+ } from "./chunk-GTAFCAVP.js";
19
19
  import {
20
20
  getActiveProfile
21
- } from "./chunk-FDBAFANU.js";
21
+ } from "./chunk-I5XB4MZT.js";
22
22
  import {
23
23
  CliError,
24
24
  isCliError,
@@ -4,20 +4,20 @@ import {
4
4
  getMeetingOperation,
5
5
  hasMeetingOperation,
6
6
  meetingOperationDefinitions
7
- } from "./chunk-LXXR2RRE.js";
8
- import "./chunk-O7KPHPXQ.js";
9
- import "./chunk-6OK4LW76.js";
10
- import "./chunk-3NJQTG6X.js";
7
+ } from "./chunk-6DH73Q5H.js";
8
+ import "./chunk-MLJK4KLE.js";
9
+ import "./chunk-ELF5TPSG.js";
10
+ import "./chunk-YR3K53BU.js";
11
11
  import "./chunk-WMRNO6IU.js";
12
- import "./chunk-YSEHTSHS.js";
13
- import "./chunk-QHKY4WZA.js";
14
- import "./chunk-QO6JYDIW.js";
15
- import "./chunk-C5IIIT4D.js";
16
- import "./chunk-BJNSTCJK.js";
17
- import "./chunk-X7ZTM4XG.js";
18
- import "./chunk-Y7RGBRLG.js";
12
+ import "./chunk-FMAZ42HS.js";
13
+ import "./chunk-BEYEXCWU.js";
14
+ import "./chunk-3CBURKSY.js";
15
+ import "./chunk-JAIZY37Z.js";
16
+ import "./chunk-ERAE4GHX.js";
17
+ import "./chunk-4XYRTXRR.js";
18
+ import "./chunk-3TZURS7M.js";
19
19
  import "./chunk-7BDPM5ST.js";
20
- import "./chunk-FDBAFANU.js";
20
+ import "./chunk-I5XB4MZT.js";
21
21
  import "./chunk-UG5G54VL.js";
22
22
  import "./chunk-BUSC6UAE.js";
23
23
  export {
@@ -4,13 +4,13 @@ import {
4
4
  esbOperationDefinitions,
5
5
  getEsbOperation,
6
6
  hasEsbOperation
7
- } from "./chunk-HLT6B26P.js";
8
- import "./chunk-VLY5RTVO.js";
7
+ } from "./chunk-LSVA7QA6.js";
8
+ import "./chunk-UVWW5ABZ.js";
9
9
  import "./chunk-TXUG266F.js";
10
10
  import "./chunk-7BDPM5ST.js";
11
- import "./chunk-FJUOUSV3.js";
12
- import "./chunk-TJN4PIYO.js";
13
- import "./chunk-FDBAFANU.js";
11
+ import "./chunk-LRKKKO5A.js";
12
+ import "./chunk-GTAFCAVP.js";
13
+ import "./chunk-I5XB4MZT.js";
14
14
  import "./chunk-UG5G54VL.js";
15
15
  import "./chunk-BUSC6UAE.js";
16
16
  export {
@@ -4,14 +4,14 @@ import {
4
4
  getWorkflowOperation,
5
5
  hasWorkflowOperation,
6
6
  workflowOperationDefinitions
7
- } from "./chunk-OKUJY5YB.js";
7
+ } from "./chunk-67AN5YJT.js";
8
8
  import "./chunk-HP7JIYMT.js";
9
9
  import "./chunk-WRXSAVKO.js";
10
- import "./chunk-4WCVRDC5.js";
10
+ import "./chunk-HG6INLH6.js";
11
11
  import "./chunk-AJ62BGAW.js";
12
12
  import "./chunk-7BDPM5ST.js";
13
- import "./chunk-TJN4PIYO.js";
14
- import "./chunk-FDBAFANU.js";
13
+ import "./chunk-GTAFCAVP.js";
14
+ import "./chunk-I5XB4MZT.js";
15
15
  import "./chunk-UG5G54VL.js";
16
16
  import "./chunk-BUSC6UAE.js";
17
17
  export {
@@ -7,10 +7,10 @@ import {
7
7
  loadRooms,
8
8
  recommendRooms,
9
9
  rememberFrequentRoom
10
- } from "./chunk-C5IIIT4D.js";
11
- import "./chunk-BJNSTCJK.js";
12
- import "./chunk-X7ZTM4XG.js";
13
- import "./chunk-Y7RGBRLG.js";
10
+ } from "./chunk-JAIZY37Z.js";
11
+ import "./chunk-ERAE4GHX.js";
12
+ import "./chunk-4XYRTXRR.js";
13
+ import "./chunk-3TZURS7M.js";
14
14
  import "./chunk-7BDPM5ST.js";
15
15
  import "./chunk-UG5G54VL.js";
16
16
  import "./chunk-BUSC6UAE.js";
@@ -8,10 +8,10 @@ import {
8
8
  resolveMeetingScheduleTypeIds,
9
9
  resolveMemberIdsByName,
10
10
  runScheduleConflictFlow
11
- } from "./chunk-QO6JYDIW.js";
12
- import "./chunk-BJNSTCJK.js";
13
- import "./chunk-X7ZTM4XG.js";
14
- import "./chunk-Y7RGBRLG.js";
11
+ } from "./chunk-3CBURKSY.js";
12
+ import "./chunk-ERAE4GHX.js";
13
+ import "./chunk-4XYRTXRR.js";
14
+ import "./chunk-3TZURS7M.js";
15
15
  import "./chunk-7BDPM5ST.js";
16
16
  import "./chunk-UG5G54VL.js";
17
17
  import "./chunk-BUSC6UAE.js";
@@ -2,7 +2,7 @@ import { createRequire as __esbuildCreateRequire } from 'node:module';
2
2
  const require = __esbuildCreateRequire(import.meta.url);
3
3
  import {
4
4
  defaultResultThresholdChars
5
- } from "./chunk-4WCVRDC5.js";
5
+ } from "./chunk-HG6INLH6.js";
6
6
  import {
7
7
  stateRoot
8
8
  } from "./chunk-AJ62BGAW.js";
@@ -15,11 +15,11 @@ import {
15
15
  createE10RequestRuntime,
16
16
  isE10SessionExpiredResponse,
17
17
  requireE10Session
18
- } from "./chunk-FJUOUSV3.js";
19
- import "./chunk-TJN4PIYO.js";
18
+ } from "./chunk-LRKKKO5A.js";
19
+ import "./chunk-GTAFCAVP.js";
20
20
  import {
21
21
  getActiveProfile
22
- } from "./chunk-FDBAFANU.js";
22
+ } from "./chunk-I5XB4MZT.js";
23
23
  import {
24
24
  CliError,
25
25
  isCliError,
@@ -2,7 +2,7 @@ import { createRequire as __esbuildCreateRequire } from 'node:module';
2
2
  const require = __esbuildCreateRequire(import.meta.url);
3
3
  import {
4
4
  createWorkflowHost
5
- } from "./chunk-HWA2A25Y.js";
5
+ } from "./chunk-E7VWE2XI.js";
6
6
  import {
7
7
  USER_INTENT_RULE_FILE,
8
8
  aigroupUserDir,
@@ -17,24 +17,25 @@ import {
17
17
  validateRuleFile,
18
18
  workflowOperationDefinitions,
19
19
  workflowSuccess
20
- } from "./chunk-OKUJY5YB.js";
20
+ } from "./chunk-67AN5YJT.js";
21
21
  import {
22
22
  createWorkflowContinuationSigner
23
23
  } from "./chunk-HP7JIYMT.js";
24
24
  import {
25
25
  CLARIFICATION_SUBTYPE,
26
26
  WorkflowCliError,
27
+ workflowPolicyError,
27
28
  workflowValidationError
28
29
  } from "./chunk-WRXSAVKO.js";
29
- import "./chunk-4WCVRDC5.js";
30
+ import "./chunk-HG6INLH6.js";
30
31
  import "./chunk-AJ62BGAW.js";
31
32
  import {
32
33
  reportPlatformError
33
- } from "./chunk-6N4JPNFL.js";
34
+ } from "./chunk-MD5CW4B6.js";
34
35
  import "./chunk-7BDPM5ST.js";
35
- import "./chunk-FJUOUSV3.js";
36
- import "./chunk-TJN4PIYO.js";
37
- import "./chunk-FDBAFANU.js";
36
+ import "./chunk-LRKKKO5A.js";
37
+ import "./chunk-GTAFCAVP.js";
38
+ import "./chunk-I5XB4MZT.js";
38
39
  import {
39
40
  isCliError,
40
41
  toErrorEnvelope
@@ -70,6 +71,32 @@ var workflowManifest = {
70
71
  withheldOperations: WITHHELD
71
72
  };
72
73
 
74
+ // src/core/host-policy.ts
75
+ var HOST_ENV_MARKERS = [
76
+ { host: "doubao", marker: "DOUBAO" }
77
+ ];
78
+ var HOST_DENIED_CAPABILITIES = {
79
+ doubao: ["memory"]
80
+ };
81
+ function detectHostByEnv(env = process.env) {
82
+ const keys = Object.keys(env ?? {});
83
+ for (const { host, marker } of HOST_ENV_MARKERS) {
84
+ if (keys.some((key) => key.toUpperCase().includes(marker))) return host;
85
+ }
86
+ return null;
87
+ }
88
+ function hostCapabilityDenial(capability, env = process.env) {
89
+ if (!capability) return null;
90
+ const hostKey = detectHostByEnv(env);
91
+ if (!hostKey) return null;
92
+ const denied = HOST_DENIED_CAPABILITIES[hostKey] ?? [];
93
+ if (!denied.includes(capability)) return null;
94
+ return { host: hostKey === "doubao" ? "\u8C46\u5305" : hostKey, hostKey, capability };
95
+ }
96
+ function isCapabilityDeniedHere(capability, env = process.env) {
97
+ return hostCapabilityDenial(capability, env) !== null;
98
+ }
99
+
73
100
  // src/shortcuts/workflow/operations.ts
74
101
  function idempotentReplayEnvelope(error, operation) {
75
102
  if (!(error instanceof WorkflowCliError) || error.subtype !== "continuation_already_applied") return null;
@@ -133,8 +160,18 @@ async function settleAppliedContinuation(input, result, context, definition) {
133
160
  if (!reference) return;
134
161
  await context.continuation.settle(reference, result.data, definition.action || definition.name);
135
162
  }
163
+ function assertHostAllows(operation, capability) {
164
+ const denial = hostCapabilityDenial(capability);
165
+ if (!denial) return;
166
+ throw workflowPolicyError(
167
+ "host_capability_denied",
168
+ `\u5F53\u524D\u8FD0\u884C\u73AF\u5883\uFF08${denial.host}\uFF09\u4E0D\u63D0\u4F9B\u300C${denial.capability}\u300D\u7C7B\u64CD\u4F5C\uFF0C${operation} \u5DF2\u5728\u8BE5\u73AF\u5883\u7981\u7528\u3002\u8FD9\u4E0D\u662F\u8D26\u53F7\u6743\u9650\u95EE\u9898\uFF0C\u6362\u8D26\u53F7\u3001\u6539\u5199\u53C2\u6570\u6216\u91CD\u8BD5\u90FD\u4E0D\u4F1A\u6210\u529F\uFF1B\u8BF7\u76F4\u63A5\u544A\u77E5\u7528\u6237\u5F53\u524D\u5E73\u53F0\u4E0D\u652F\u6301\u8BE5\u80FD\u529B\uFF0C\u4E0D\u8981\u5C1D\u8BD5\u7ED5\u8FC7\u3002`,
169
+ { host: denial.host, capability: denial.capability, operation }
170
+ );
171
+ }
136
172
  async function executeWorkflowOperation(operation, rawInput, context) {
137
173
  const definition = getWorkflowOperation(operation);
174
+ assertHostAllows(operation, definition.capability);
138
175
  const input = asObject(rawInput);
139
176
  assertNoForbiddenKeys(input);
140
177
  let result;
@@ -329,7 +366,24 @@ function fieldNamesOf(inputSchema) {
329
366
  if (!properties || typeof properties !== "object" || Array.isArray(properties)) return [];
330
367
  return Object.keys(properties);
331
368
  }
369
+ function visibleOperations() {
370
+ return workflowManifest.operations.filter((definition) => !isCapabilityDeniedHere(definition.capability));
371
+ }
372
+ function hostWithheldOperations() {
373
+ return workflowManifest.operations.filter((definition) => isCapabilityDeniedHere(definition.capability)).map((definition) => ({
374
+ name: definition.name,
375
+ reason: `\u5F53\u524D\u8FD0\u884C\u73AF\u5883\u4E0D\u63D0\u4F9B\u300C${definition.capability}\u300D\u7C7B\u64CD\u4F5C\uFF0C\u5DF2\u5728\u8BE5\u73AF\u5883\u7981\u7528`
376
+ }));
377
+ }
378
+ function requiredHints(inputSchema) {
379
+ const schema = inputSchema;
380
+ const required = Array.isArray(schema?.required) && schema.required.length ? schema.required : void 0;
381
+ const anyOf = Array.isArray(schema?.anyOf) ? schema.anyOf : null;
382
+ const atLeastOne = anyOf ? [...new Set(anyOf.flatMap((branch) => branch?.required ?? []))] : [];
383
+ return { ...required ? { required } : {}, ...atLeastOne.length ? { atLeastOne } : {} };
384
+ }
332
385
  function manifestIndex() {
386
+ const operations = visibleOperations();
333
387
  return {
334
388
  schemaVersion: workflowManifest.schemaVersion,
335
389
  name: workflowManifest.name,
@@ -339,26 +393,41 @@ function manifestIndex() {
339
393
  status: workflowManifest.status,
340
394
  sourceSkill: workflowManifest.sourceSkill,
341
395
  capabilities: workflowManifest.capabilities,
342
- operationCount: workflowManifest.operations.length,
343
- operations: workflowManifest.operations.map((definition) => ({
396
+ operationCount: operations.length,
397
+ operations: operations.map((definition) => ({
344
398
  name: definition.name,
345
399
  resource: definition.resource,
346
400
  summary: definition.summary,
347
401
  ...definition.capability ? { capability: definition.capability } : {},
348
402
  risk: definition.risk,
349
403
  ...definition.requiresConfirmation ? { requiresConfirmation: true } : {},
350
- fields: fieldNamesOf(definition.inputSchema)
404
+ fields: fieldNamesOf(definition.inputSchema),
405
+ ...requiredHints(definition.inputSchema)
351
406
  })),
352
- withheldOperations: workflowManifest.withheldOperations,
407
+ withheldOperations: [...workflowManifest.withheldOperations, ...hostWithheldOperations()],
353
408
  operationsHint: "\u9ED8\u8BA4\u53EA\u5217 operation \u4E0E\u5B57\u6BB5\u540D\uFF1B\u5B57\u6BB5\u7C7B\u578B\u3001\u679A\u4E3E\u548C\u586B\u5199\u53E3\u5F84\u7528 `workflow schema --operation <name>` \u5355\u53D6\uFF0C\u6574\u4EFD\u5B8C\u6574 manifest \u7528 `workflow schema --full`\u3002"
354
409
  };
355
410
  }
411
+ function manifestFull() {
412
+ return {
413
+ ...workflowManifest,
414
+ operations: visibleOperations(),
415
+ withheldOperations: [...workflowManifest.withheldOperations, ...hostWithheldOperations()]
416
+ };
417
+ }
356
418
  function findOperationContract(name) {
357
419
  const full = name.startsWith("workflow.") ? name : `workflow.${name}`;
358
420
  const matched = workflowManifest.operations.find((definition) => definition.name === full);
359
421
  if (!matched) {
360
422
  throw workflowValidationError("operation_unknown", `\u6D41\u7A0B\u6A21\u5757\u4E0D\u652F\u6301\u64CD\u4F5C\uFF1A${name}`);
361
423
  }
424
+ if (isCapabilityDeniedHere(matched.capability)) {
425
+ throw workflowPolicyError(
426
+ "host_capability_denied",
427
+ `\u5F53\u524D\u8FD0\u884C\u73AF\u5883\u4E0D\u63D0\u4F9B\u300C${matched.capability}\u300D\u7C7B\u64CD\u4F5C\uFF0C${full} \u5DF2\u5728\u8BE5\u73AF\u5883\u7981\u7528\u3002\u8FD9\u4E0D\u662F\u8D26\u53F7\u6743\u9650\u95EE\u9898\uFF0C\u6362\u8D26\u53F7\u3001\u6539\u5199\u53C2\u6570\u6216\u91CD\u8BD5\u90FD\u4E0D\u4F1A\u6210\u529F\uFF1B\u8BF7\u76F4\u63A5\u544A\u77E5\u7528\u6237\u5F53\u524D\u5E73\u53F0\u4E0D\u652F\u6301\u8BE5\u80FD\u529B\uFF0C\u4E0D\u8981\u5C1D\u8BD5\u7ED5\u8FC7\u3002`,
428
+ { capability: matched.capability, operation: full }
429
+ );
430
+ }
362
431
  return matched;
363
432
  }
364
433
  function withJsonInputOptions(command) {
@@ -378,7 +447,7 @@ var workflowShortcut = {
378
447
  throw workflowValidationError("option_conflict", "\u4E0D\u80FD\u540C\u65F6\u4F20 --operation \u548C --full");
379
448
  }
380
449
  if (opts.full === true) {
381
- ctx.output.write(workflowManifest, { json: true });
450
+ ctx.output.write(manifestFull(), { json: true });
382
451
  return;
383
452
  }
384
453
  if (requested) {
@@ -22,7 +22,7 @@ function codeFromStructured(type, subtype, httpStatus) {
22
22
  if (type === 'authentication') {
23
23
  return /expired|invalid_token|token_expired/u.test(subtype) ? 'E-0002' : 'E-0001';
24
24
  }
25
- if (type === 'permission' || type === 'authorization')
25
+ if (type === 'permission' || type === 'authorization' || type === 'policy')
26
26
  return 'E-0005';
27
27
  if (type === 'validation' || type === 'usage')
28
28
  return 'E-0003';
@@ -0,0 +1,56 @@
1
+ /**
2
+ * 宿主能力策略:按**进程环境变量**判断当前运行宿主,并对该宿主禁用指定 capability。
3
+ *
4
+ * ★ 判据只认环境变量,**不读 session / 已持久化的 agentType**,这是本模块的核心约束:
5
+ *
6
+ * - `auth init --agent_type doubao` 会把 agentType 固化进 session。若门禁读 session,
7
+ * 同一台机器上的**手动调用**也会被一起禁掉(用户要求「手动调用不受影响」);
8
+ * - 手动在终端调用时,进程环境里没有宿主注入的变量,一律放行;
9
+ * - 同一台机器上其他宿主注入的是各自的前缀(`WORKBUDDY_*` / `QWENWORK_*`),互不影响。
10
+ *
11
+ * 判据用「key 名是否包含宿主标识」而不是前缀匹配:宿主注入的变量名在版本间会变
12
+ * (`DOUBAO_OFFICE_AGENT_NAME`、`DOUBAO_HOME`…),包含匹配不会漏。
13
+ *
14
+ * 2026-11-26 豆包渠道要求:豆包连接器禁止调用记忆类 operation
15
+ * (`workflow.memoryExtract` 写记忆 / `workflow.memoryPrompt` 读记忆),
16
+ * 其他连接器与手动调用不受影响。
17
+ */
18
+ /** 宿主识别:环境变量 key 名包含 marker(大小写不敏感)即判定为该宿主。 */
19
+ export const HOST_ENV_MARKERS = [
20
+ { host: 'doubao', marker: 'DOUBAO' },
21
+ ];
22
+ /** 按宿主禁用的 capability。用 capability 而非命令名:新增同类 operation 自动被禁。 */
23
+ export const HOST_DENIED_CAPABILITIES = {
24
+ doubao: ['memory'],
25
+ };
26
+ /**
27
+ * 从进程环境推断宿主;识别不到返回 null(= 手动调用,一律放行)。
28
+ *
29
+ * 只看 key 名、不看 value:宿主注入的值在不同版本间不固定,key 名稳定得多。
30
+ */
31
+ export function detectHostByEnv(env = process.env) {
32
+ const keys = Object.keys(env ?? {});
33
+ for (const { host, marker } of HOST_ENV_MARKERS) {
34
+ if (keys.some((key) => key.toUpperCase().includes(marker)))
35
+ return host;
36
+ }
37
+ return null;
38
+ }
39
+ /**
40
+ * 当前宿主是否禁用了该 capability;禁用时返回命中详情,否则 null。
41
+ */
42
+ export function hostCapabilityDenial(capability, env = process.env) {
43
+ if (!capability)
44
+ return null;
45
+ const hostKey = detectHostByEnv(env);
46
+ if (!hostKey)
47
+ return null;
48
+ const denied = HOST_DENIED_CAPABILITIES[hostKey] ?? [];
49
+ if (!denied.includes(capability))
50
+ return null;
51
+ return { host: hostKey === 'doubao' ? '豆包' : hostKey, hostKey, capability };
52
+ }
53
+ /** 便捷判定,供 manifest / schema 过滤使用。 */
54
+ export function isCapabilityDeniedHere(capability, env = process.env) {
55
+ return hostCapabilityDenial(capability, env) !== null;
56
+ }
@@ -0,0 +1,227 @@
1
+ import { appendFileSync, mkdirSync } from 'node:fs';
2
+ import { homedir } from 'node:os';
3
+ import { resolve } from 'node:path';
4
+ /**
5
+ * 分阶段耗时采集(排障用,默认完全关闭)。
6
+ *
7
+ * 背景:小e / 沙箱里「登录很慢」的抱怨无法归因——`--json` 模式下 `logger.debug` 与
8
+ * 登录过程的 `recoveryLogger` 全部静默,`E10_TRACE_REQ=1` 只能看到业务接口,看不到
9
+ * 「读 auth 文件、teamsCheck 富化、平台换票、Python 解释器探测」这些真正可能慢的环节。
10
+ * 更麻烦的是:**如果慢在 Agent 侧(读 Skill、模型回合),CLI 里连一行日志都不会出现**,
11
+ * 于是所有嫌疑都被算到 CLI 头上。本模块给出唯一的进程级时间轴:
12
+ *
13
+ * - `PROCESS_START_MS` 用 `process.uptime()` 反推进程真实起点,
14
+ * 因此 `cli.entry` 那一段就是「node 启动 + 模块求值」的本征开销;
15
+ * - 每个 span 记录相对起点的偏移与自身耗时,先发生的先输出,可直接看出串行链;
16
+ * - 退出时先写 JSONL(默认 `~/.weaver-work-cli/logs/timing-YYYY-MM-DD.jsonl`),
17
+ * 再按需在 stderr 打一份要点。**JSONL 是主通道**:`--json` 的 stderr 必须保持
18
+ * 「只有一个 JSON 对象」的契约,不能混入人类可读行。
19
+ *
20
+ * 开关(任一命中即开启):
21
+ * - 全局参数 `--timing`(`enableTimingFromArgv()` 在入口按 argv 预扫描,
22
+ * 不能等 commander 解析完再开,否则最贵的启动段已经过去了);
23
+ * - 环境变量 `WEAVER_WORK_CLI_TIMING=1|true|yes|on`:写文件,非 `--json` 时附带 stderr;
24
+ * - `WEAVER_WORK_CLI_TIMING=stderr`:连 `--json` 也打 stderr(人工排障专用,
25
+ * 不要让 Agent 带这个值跑业务命令);
26
+ * - `WEAVER_WORK_CLI_TIMING=file`:只写文件,stderr 一个字都不加。
27
+ *
28
+ * 约定:meta 只放**不含凭证、不含业务数据**的标量(阶段结果、来源类型、解释器名、
29
+ * 接口路径)。绝不记录 token、cookie、请求体、`--input-json` 的内容。
30
+ */
31
+ const ENV_KEY = 'WEAVER_WORK_CLI_TIMING';
32
+ const MAX_SPANS = 500;
33
+ /** 进程真实起点:`uptime()` 是进程已存活毫秒数,反推回去即 node 被 exec 的时刻。 */
34
+ const PROCESS_START_MS = Date.now() - Math.round(process.uptime() * 1000);
35
+ let enabled = false;
36
+ let stderrForced = false;
37
+ let fileDisabled = false;
38
+ let exitHookRegistered = false;
39
+ let flushed = false;
40
+ let droppedSpans = 0;
41
+ const spans = [];
42
+ function offsetMs() {
43
+ return Date.now() - PROCESS_START_MS;
44
+ }
45
+ function normalizeFlag(raw) {
46
+ return String(raw ?? '').trim().toLowerCase();
47
+ }
48
+ function wantsTiming(raw) {
49
+ return raw === '1' || raw === 'true' || raw === 'yes' || raw === 'on'
50
+ || raw === 'file' || raw === 'stderr';
51
+ }
52
+ /** `--json` 下 stderr 只能有一个 JSON 对象,人类可读行必须让路。 */
53
+ function jsonModeFromArgv(argv) {
54
+ return argv.some((arg) => arg === '--json' || arg === '--json=true');
55
+ }
56
+ function timingHome(env) {
57
+ return env.WEAVER_WORK_CLI_HOME || env.WORK_CLI_HOME || resolve(homedir(), '.weaver-work-cli');
58
+ }
59
+ function timingLogPath(env = process.env) {
60
+ const now = new Date();
61
+ const day = `${now.getFullYear()}-${String(now.getMonth() + 1).padStart(2, '0')}-${String(now.getDate()).padStart(2, '0')}`;
62
+ return resolve(timingHome(env), 'logs', `timing-${day}.jsonl`);
63
+ }
64
+ function mergeMeta(base, extra) {
65
+ if (!base && !extra)
66
+ return undefined;
67
+ const merged = {};
68
+ for (const [key, value] of Object.entries(base || {})) {
69
+ if (value !== undefined)
70
+ merged[key] = value;
71
+ }
72
+ for (const [key, value] of Object.entries(extra || {})) {
73
+ if (value !== undefined)
74
+ merged[key] = value;
75
+ }
76
+ return Object.keys(merged).length ? merged : undefined;
77
+ }
78
+ function formatMeta(meta) {
79
+ if (!meta)
80
+ return '';
81
+ const text = Object.entries(meta)
82
+ .map(([key, value]) => `${key}=${String(value)}`)
83
+ .join(' ');
84
+ return text ? ` ${text}` : '';
85
+ }
86
+ function registerExitHook() {
87
+ if (exitHookRegistered)
88
+ return;
89
+ exitHookRegistered = true;
90
+ process.on('exit', (code) => finishTiming(typeof code === 'number' ? code : undefined));
91
+ }
92
+ /**
93
+ * 入口最早期调用一次。`--timing` 必须在这里就识别出来:commander 解析完再开,
94
+ * `cli.entry` / shortcut 加载这些最可能拖慢「一条命令几秒」的段落就全都记不到了。
95
+ */
96
+ export function enableTimingFromArgv(argv = process.argv, env = process.env) {
97
+ if (enabled)
98
+ return true;
99
+ const raw = normalizeFlag(env[ENV_KEY]);
100
+ const byEnv = wantsTiming(raw);
101
+ const byArgv = argv.some((arg) => arg === '--timing' || arg === '--timing=true');
102
+ if (!byEnv && !byArgv)
103
+ return false;
104
+ enabled = true;
105
+ stderrForced = raw === 'stderr';
106
+ fileDisabled = raw === 'file';
107
+ registerExitHook();
108
+ return true;
109
+ }
110
+ /** 供程序内部显式开启(测试、嵌入式调用)用。 */
111
+ export function enableTiming(options = {}) {
112
+ enabled = true;
113
+ stderrForced = options.stderr === true;
114
+ fileDisabled = options.file === false;
115
+ registerExitHook();
116
+ }
117
+ export function isTimingEnabled() {
118
+ return enabled;
119
+ }
120
+ /**
121
+ * 开始一个计时段。返回的结束函数可调用多次(幂等),关闭时返回 `null`,
122
+ * 调用方用 `?.()` 短路 ⇒ 未开启时除一次布尔判断外零开销。
123
+ */
124
+ export function startTiming(name, meta) {
125
+ if (!enabled)
126
+ return null;
127
+ const startMs = offsetMs();
128
+ let closed = false;
129
+ return (extra) => {
130
+ if (closed)
131
+ return;
132
+ closed = true;
133
+ pushSpan({ name, startMs, ms: Math.max(0, offsetMs() - startMs), meta: mergeMeta(meta, extra) });
134
+ };
135
+ }
136
+ /** 瞬时标记(无耗时,只占一个时间点),用于「node 启动到入口求值完毕」这类边界。 */
137
+ export function markTiming(name, meta) {
138
+ if (!enabled)
139
+ return;
140
+ const at = offsetMs();
141
+ pushSpan({ name, startMs: at, ms: 0, meta });
142
+ }
143
+ function pushSpan(span) {
144
+ if (spans.length >= MAX_SPANS) {
145
+ droppedSpans += 1;
146
+ return;
147
+ }
148
+ spans.push(span);
149
+ }
150
+ /** 只取命令名,丢掉所有 `--flag` 与看起来像 JSON / 长文本的参数(避免把业务数据写进日志)。 */
151
+ function commandLabel(argv) {
152
+ const tokens = [];
153
+ for (const token of argv.slice(2)) {
154
+ if (token.startsWith('-'))
155
+ continue;
156
+ if (/^[[{]/.test(token) || token.length > 48)
157
+ continue;
158
+ tokens.push(token);
159
+ if (tokens.length >= 3)
160
+ break;
161
+ }
162
+ return tokens.join(' ');
163
+ }
164
+ function shouldWriteStderr(argv) {
165
+ if (stderrForced)
166
+ return true;
167
+ if (fileDisabled && !stderrForced)
168
+ return !jsonModeFromArgv(argv) && !argv.includes('--quiet');
169
+ return !jsonModeFromArgv(argv);
170
+ }
171
+ function summaryLines(totalMs) {
172
+ const ordered = [...spans].sort((left, right) => left.startMs - right.startMs || right.ms - left.ms);
173
+ const lines = [`[timing] total=${totalMs}ms spans=${spans.length}${droppedSpans ? ` dropped=${droppedSpans}` : ''}`];
174
+ for (const span of ordered) {
175
+ const bar = span.ms > 0 ? `${String(span.ms).padStart(5)}ms` : ' mark';
176
+ lines.push(`[timing] +${String(span.startMs).padStart(6)}ms ${bar} ${span.name}${formatMeta(span.meta)}`);
177
+ }
178
+ return lines;
179
+ }
180
+ function writeJsonl(totalMs, exitCode) {
181
+ if (fileDisabled)
182
+ return;
183
+ const env = process.env;
184
+ const record = {
185
+ ts: new Date().toISOString(),
186
+ command: commandLabel(process.argv),
187
+ totalMs,
188
+ exitCode: exitCode ?? null,
189
+ pid: process.pid,
190
+ ppid: process.ppid,
191
+ node: process.version,
192
+ platform: process.platform,
193
+ spans: [...spans].sort((left, right) => left.startMs - right.startMs),
194
+ droppedSpans,
195
+ // 只记录「宿主标记是否存在」,绝不落值里的凭证。
196
+ host: {
197
+ xiaoeUserToken: Boolean(env.XIAOE_USER_TOKEN),
198
+ xiaoeClientType: env.XIAOE_CLIENT_TYPE || '',
199
+ runtimeAgent: env.WEAVER_RUNTIME_AGENT || '',
200
+ profile: env.WEAVER_PROFILE || '',
201
+ ci: Boolean(env.CI),
202
+ },
203
+ };
204
+ try {
205
+ const path = timingLogPath(env);
206
+ mkdirSync(resolve(path, '..'), { recursive: true, mode: 0o700 });
207
+ appendFileSync(path, `${JSON.stringify(record)}\n`, { encoding: 'utf8', mode: 0o600 });
208
+ }
209
+ catch {
210
+ // 排障通道自身失败绝不能影响命令结果。
211
+ }
212
+ }
213
+ /** 命令结束时调用(`process.on('exit')` 也会兜底;重复调用只生效一次)。 */
214
+ export function finishTiming(exitCode) {
215
+ if (!enabled || flushed)
216
+ return;
217
+ flushed = true;
218
+ const totalMs = offsetMs();
219
+ writeJsonl(totalMs, exitCode);
220
+ if (shouldWriteStderr(process.argv)) {
221
+ process.stderr.write(`${summaryLines(totalMs).join('\n')}\n`);
222
+ }
223
+ }
224
+ /** 供 `doctor` 等命令回报日志位置。 */
225
+ export function timingLogFile() {
226
+ return timingLogPath(process.env);
227
+ }