weaver-work-cli 0.1.47 → 0.1.48

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 (181) hide show
  1. package/dist/chunks/{archive-oa-BBDP7AKJ.js → archive-oa-EDJDU3V4.js} +454 -5
  2. package/dist/chunks/{attachment-content-MCXQBD6N.js → attachment-content-4KSNBPRO.js} +3 -3
  3. package/dist/chunks/{chunk-J2VEB5K3.js → chunk-2BQESR2U.js} +2 -2
  4. package/dist/chunks/{chunk-727FH2NI.js → chunk-2IGZUMNG.js} +15 -2
  5. package/dist/chunks/{chunk-76H3IKH6.js → chunk-5B5JXTY2.js} +35 -35
  6. package/dist/chunks/{chunk-Q4OYAQYH.js → chunk-72MI3MBX.js} +4 -0
  7. package/dist/chunks/{chunk-4RWS2YYL.js → chunk-BCACE6VV.js} +2 -2
  8. package/dist/chunks/{chunk-AD46OMQK.js → chunk-EFOUMXIX.js} +119 -44
  9. package/dist/chunks/{chunk-IRMIEDXN.js → chunk-FEP6ELMR.js} +1 -1
  10. package/dist/chunks/{chunk-LIEQJIGM.js → chunk-GR76ZDDX.js} +0 -3
  11. package/dist/chunks/{chunk-JB34OE7R.js → chunk-NBEWUR7L.js} +1 -1
  12. package/dist/chunks/{chunk-6V5ZPKHV.js → chunk-NK74RE5F.js} +2 -2
  13. package/dist/chunks/{chunk-GSZTA43P.js → chunk-OCYRVZGN.js} +2 -2
  14. package/dist/chunks/{chunk-OXHHJWNC.js → chunk-PSPOFLSU.js} +1 -1
  15. package/dist/chunks/{chunk-6AXKWFKG.js → chunk-R2HHLJNN.js} +4 -4
  16. package/dist/chunks/{chunk-PSOMGA3U.js → chunk-SVFG6EMV.js} +35 -6
  17. package/dist/chunks/{chunk-IP4CWQCF.js → chunk-WMSAWAWZ.js} +8 -8
  18. package/dist/chunks/{conflict-H7EHQXYY.js → conflict-APGSD5E7.js} +2 -2
  19. package/dist/chunks/{contract-3QLAGYQL.js → contract-N6P2HIIE.js} +425 -187
  20. package/dist/chunks/{create-flow-VRVJEOBX.js → create-flow-5TXFOC7X.js} +6 -6
  21. package/dist/chunks/{ehr-SH2LM3NK.js → ehr-XI4BIVR2.js} +16 -5
  22. package/dist/chunks/{env-66FPSJDV.js → env-B6GKA2J3.js} +2 -2
  23. package/dist/chunks/{factory-UH2TZBVA.js → factory-MFCKLUT6.js} +1 -1
  24. package/dist/chunks/{group-chat-CAKMMV7K.js → group-chat-YE7WIBFO.js} +3 -3
  25. package/dist/chunks/{im-NJB7ZYMH.js → im-3RCNL5GT.js} +107 -1
  26. package/dist/chunks/{invoice-UEAHSYAE.js → invoice-FXWH5GPO.js} +2 -71
  27. package/dist/chunks/{lazy-dispatch-25XGTXLM.js → lazy-dispatch-XSAHDK6Z.js} +3 -3
  28. package/dist/chunks/{meeting-VTBFW4HI.js → meeting-RYZV2JTQ.js} +10 -10
  29. package/dist/chunks/{reception-5WITA44R.js → reception-VL6TKVAW.js} +480 -26
  30. package/dist/chunks/{recruit-stage-CAKZTUA7.js → recruit-stage-ERZD3ZNB.js} +52 -16
  31. package/dist/chunks/{registry-JVQBLFQ5.js → registry-22O6UG4I.js} +10 -10
  32. package/dist/chunks/{registry-AQVGHUM6.js → registry-7VZ6YJUF.js} +2 -2
  33. package/dist/chunks/{registry-PVUZQDDQ.js → registry-BUTEDK3C.js} +1 -1
  34. package/dist/chunks/{room-recommend-5U55FMXZ.js → room-recommend-IMZPJMYB.js} +4 -4
  35. package/dist/chunks/{schedule-IDETODCA.js → schedule-SPPAHER2.js} +4 -4
  36. package/dist/chunks/{workflow-BSYT5TGL.js → workflow-WVEFJ6KC.js} +2 -2
  37. package/dist/core/refs.js +19 -2
  38. package/dist/index.js +14 -14
  39. package/dist/shortcuts/archive-oa/constants.js +42 -0
  40. package/dist/shortcuts/archive-oa/host.js +2 -2
  41. package/dist/shortcuts/archive-oa/index.js +38 -0
  42. package/dist/shortcuts/archive-oa/operations/borrow-car.js +117 -3
  43. package/dist/shortcuts/archive-oa/operations/my-borrow-contract.js +271 -0
  44. package/dist/shortcuts/archive-oa/operations/registry.js +5 -3
  45. package/dist/shortcuts/contract/index.js +9 -1
  46. package/dist/shortcuts/contract/manifest.js +14 -2
  47. package/dist/shortcuts/contract/operations/card.js +231 -0
  48. package/dist/shortcuts/contract/operations/registry.js +2 -0
  49. package/dist/shortcuts/contract/operations/review.js +16 -5
  50. package/dist/shortcuts/contract/operations/summary.js +25 -17
  51. package/dist/shortcuts/ehr/operations/recruit-write.js +22 -5
  52. package/dist/shortcuts/ehr/recruit-stage/operations/interview-arrange.js +17 -8
  53. package/dist/shortcuts/ehr/recruit-stage/shared.js +33 -8
  54. package/dist/shortcuts/im/index.js +128 -0
  55. package/dist/shortcuts/im/operations/session.js +6 -0
  56. package/dist/shortcuts/invoice/host.js +0 -3
  57. package/dist/shortcuts/invoice/manifest.js +0 -1
  58. package/dist/shortcuts/invoice/operations/reim-subsidy.js +1 -71
  59. package/dist/shortcuts/meeting/operations/eb/conflict.js +26 -3
  60. package/dist/shortcuts/meeting/operations/eb/continuation-alias.js +63 -0
  61. package/dist/shortcuts/meeting/operations/eb/create-flow.js +71 -12
  62. package/dist/shortcuts/meeting/operations/eb/factory.js +5 -3
  63. package/dist/shortcuts/reception/host.js +33 -1
  64. package/dist/shortcuts/reception/index.js +19 -0
  65. package/dist/shortcuts/reception/manifest.js +53 -1
  66. package/dist/shortcuts/reception/operations/ask.js +18 -0
  67. package/dist/shortcuts/reception/operations/compose.js +113 -3
  68. package/dist/shortcuts/reception/operations/leads.js +245 -0
  69. package/dist/shortcuts/reception/operations/markdown.js +22 -0
  70. package/dist/shortcuts/reception/operations/registry.js +2 -0
  71. package/dist/shortcuts/reception/operations/render.js +36 -3
  72. package/dist/shortcuts/reception/operations/restaurant-rooms.js +118 -0
  73. package/dist/shortcuts/reception/operations/restaurant.js +251 -0
  74. package/dist/shortcuts/reception/operations/restaurantrooms.js +42 -0
  75. package/dist/shortcuts/reception/operations/schedule.js +7 -1
  76. package/dist/shortcuts/reception/upload.js +22 -6
  77. package/dist/shortcuts/recruit-stage/operations/interview-arrange.js +17 -8
  78. package/dist/shortcuts/recruit-stage/shared.js +42 -14
  79. package/docs/archive-oa.md +4 -2
  80. package/package.json +1 -1
  81. package/skill-template/domains/archive-oa.md +2 -1
  82. package/skill-template/master-skill-template.md +1 -0
  83. package/skill-template/skill-template.md +1 -0
  84. package/skills/weaver-e10-archive-oa/SKILL.md +33 -6
  85. package/skills/weaver-e10-archive-oa/references/borrow-car.md +32 -7
  86. package/skills/weaver-e10-archive-oa/references/contract-search.md +32 -0
  87. package/skills/weaver-e10-archive-oa/references/disabled-capabilities.md +1 -1
  88. package/skills/weaver-e10-archive-oa/references/my-borrow-contract.md +97 -0
  89. package/skills/weaver-e10-archive-oa/references/my-borrow.md +6 -1
  90. package/skills/weaver-e10-archive-oa/references/qys-contract-search.md +22 -0
  91. package/skills/weaver-e10-calendar/SKILL.md +1 -1
  92. package/skills/weaver-e10-calendar/references/calendar-query.md +1 -1
  93. package/skills/weaver-e10-calendar/references/calendar-write.md +9 -9
  94. package/skills/weaver-e10-cowork/SKILL.md +9 -6
  95. package/skills/weaver-e10-jinchengda/SKILL.md +10 -7
  96. package/skills/weaver-e10-jinchengda/references/contract-action-card-template.html +17 -0
  97. package/skills/weaver-e10-jinchengda/references/contract-action-card.md +263 -35
  98. package/skills/weaver-e10-jinchengda/references/contract-action-engine.md +8 -5
  99. package/skills/weaver-e10-jinchengda/references/contract-ai-assistant.md +1 -1
  100. package/skills/weaver-e10-jinchengda/references/contract-ai-review.md +175 -22
  101. package/skills/weaver-e10-jinchengda/references/contract-command-index.md +2 -2
  102. package/skills/weaver-e10-jinchengda/references/contract-credit-page.md +1 -1
  103. package/skills/weaver-e10-jinchengda/references/contract-doc-compare.md +1 -1
  104. package/skills/weaver-e10-jinchengda/references/contract-doc-triage.md +124 -19
  105. package/skills/weaver-e10-jinchengda/references/contract-element-extract.md +2 -2
  106. package/skills/weaver-e10-jinchengda/references/contract-execution-rules.md +4 -4
  107. package/skills/weaver-e10-jinchengda/references/contract-field-extract-other-flows.md +6 -0
  108. package/skills/weaver-e10-jinchengda/references/contract-flow-launch.md +1 -1
  109. package/skills/weaver-e10-jinchengda/references/contract-performance-query.md +1 -1
  110. package/skills/weaver-e10-jinchengda/references/contract-quote-to-contract.md +1 -1
  111. package/skills/weaver-e10-jinchengda/references/contract-risk-report-template.html +178 -0
  112. package/skills/weaver-e10-jinchengda/references/contract-template-recommend.md +1 -1
  113. package/skills/weaver-e10-jinchengda/references/orchestration.md +7 -7
  114. package/skills/weaver-e10-jinchengda/scripts/plan_actions.py +279 -0
  115. package/skills/weaver-e10-jinchengda/scripts/render_action_card.py +450 -0
  116. package/skills/weaver-e10-jinchengda/scripts/render_risk_report.py +358 -0
  117. package/skills/weaver-e10-jinchengda/scripts/validate_action_card.py +505 -0
  118. package/skills/weaver-e10-jucailin/SKILL.md +7 -4
  119. package/skills/weaver-e10-jucailin/references/recruit-create.md +3 -2
  120. package/skills/weaver-e10-jucailin/references/recruit-read.md +2 -1
  121. package/skills/weaver-e10-jucailin/references/recruit-stage-ops.md +3 -3
  122. package/skills/weaver-e10-jucailin/references/safety-boundaries.md +30 -2
  123. package/skills/weaver-e10-mail/SKILL.md +17 -4
  124. package/skills/weaver-e10-meeting/SKILL.md +94 -409
  125. package/skills/weaver-e10-meeting/references/create-flow.md +188 -0
  126. package/skills/weaver-e10-meeting/references/create-guardrails.md +234 -0
  127. package/skills/weaver-e10-meeting/references/pitfalls.md +40 -0
  128. package/skills/weaver-e10-reception-flow/SKILL.md +62 -18
  129. package/skills/weaver-e10-reception-flow/data/fields-snapshot.json +628 -26
  130. package/skills/weaver-e10-reception-flow/references/fields-snapshot.md +96 -26
  131. package/skills/weaver-e10-reception-flow/scripts/render.py +81 -2
  132. package/skills/weaver-e10-recruit-stage/SKILL.md +45 -12
  133. package/skills/weaver-e10-recruit-stage/agents/openai.yaml +58 -8
  134. package/skills/weaver-e10-recruit-stage/references/position-templates.md +5 -0
  135. package/skills/weaver-e10-recruit-stage/references/recruit-arrange-interview.md +1 -1
  136. package/skills/weaver-e10-recruit-stage/references/recruit-edit-interview-feedback.md +1 -1
  137. package/skills/weaver-e10-recruit-stage/references/recruit-jd-create.md +40 -11
  138. package/skills/weaver-e10-recruit-stage/references/recruit-list-candidate.md +1 -1
  139. package/skills/weaver-e10-recruit-stage/references/recruit-list-interview.md +1 -1
  140. package/skills/weaver-e10-recruit-stage/references/recruit-match-candidates.md +1 -1
  141. package/skills/weaver-e10-recruit-stage/references/recruit-resume-import.md +16 -0
  142. package/skills/weaver-e10-recruit-stage/references/recruit-resume-parse.md +1 -1
  143. package/skills/weaver-e10-recruit-stage/references/recruit-search-candidate.md +1 -1
  144. package/skills/weaver-e10-recruit-stage/references/recruit-urge-feedback.md +1 -1
  145. package/skills/weaver-e10-recruit-stage/references/recruit-utterance-glossary.md +127 -0
  146. package/skills/weaver-e10-shijingran/SKILL.md +6 -2
  147. package/skills/weaver-e10-shijingran/references/source-manifest.json +5 -4
  148. package/skills/weaver-e10-workflow/SKILL.md +1 -1
  149. package/skills/weaver-e10-yepiaotong/SKILL.md +8 -4
  150. package/skills/weaver-e10-yepiaotong/references/invoice-issuing-workflow.md +1 -1
  151. package/skills/weaver-e10-yepiaotong/references/invoice-reim.md +1 -1
  152. package/skills/weaver-e10-yepiaotong/references/reim-api-reference.md +2 -2
  153. package/skills/weaver-e10-yepiaotong/references/reim-form-fill-rules.md +1 -1
  154. package/skills/weaver-e10-yepiaotong/references/reim-phone-subsidy-rules.md +1 -1
  155. package/skills/weaver-e10-yepiaotong/references/reim-workflow.md +1 -0
  156. package/skills/weaver-e10-yimiaoban/SKILL.md +2 -1
  157. package/skills/weaver-e10-yimiaoban/references/msg-write.md +32 -0
  158. package/skills/weaver-e10-yimiaoban/references/session-sysmsg.md +3 -0
  159. package/skills/weaver-e10-yimiaoban/references/source-manifest.json +11 -11
  160. package/dist/chunks/{ebuilder-form-GWDTKEI2.js → ebuilder-form-I5ZIX4WO.js} +3 -3
  161. /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-README.md +0 -0
  162. /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-SKILL.md +0 -0
  163. /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-openai.yaml +0 -0
  164. /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-position-templates.md +0 -0
  165. /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-arrange-interview.md +0 -0
  166. /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-capability-check.md +0 -0
  167. /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-check-install.md +0 -0
  168. /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-detail-process.md +0 -0
  169. /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-edit-interview-feedback.md +0 -0
  170. /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-jd-create.md +0 -0
  171. /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-jd-template.md +0 -0
  172. /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-list-candidate.md +0 -0
  173. /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-list-interview.md +0 -0
  174. /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-match-candidates.md +0 -0
  175. /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-output-links.md +0 -0
  176. /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-resolve-creator.md +0 -0
  177. /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-resolve-metadata.md +0 -0
  178. /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-resume-import.md +0 -0
  179. /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-resume-parse.md +0 -0
  180. /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-search-candidate.md +0 -0
  181. /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-urge-feedback.md +0 -0
@@ -22,12 +22,12 @@ import {
22
22
  resolveWorkflowId,
23
23
  shapeBrowserValues,
24
24
  shouldAutoPickFlow
25
- } from "./chunk-AD46OMQK.js";
26
- import "./chunk-6AXKWFKG.js";
27
- import "./chunk-OXHHJWNC.js";
28
- import "./chunk-PSOMGA3U.js";
29
- import "./chunk-IRMIEDXN.js";
30
- import "./chunk-6V5ZPKHV.js";
25
+ } from "./chunk-EFOUMXIX.js";
26
+ import "./chunk-SVFG6EMV.js";
27
+ import "./chunk-R2HHLJNN.js";
28
+ import "./chunk-PSPOFLSU.js";
29
+ import "./chunk-FEP6ELMR.js";
30
+ import "./chunk-NK74RE5F.js";
31
31
  import "./chunk-7BDPM5ST.js";
32
32
  import "./chunk-UG5G54VL.js";
33
33
  import "./chunk-BUSC6UAE.js";
@@ -2451,15 +2451,22 @@ async function runEsb(host, objId, dataIds, esbActionIds) {
2451
2451
  return response?.data || {};
2452
2452
  }
2453
2453
  async function getDsOptions(host, objId, fieldId, groupId) {
2454
+ const { map } = await getDsOptionsFull(host, objId, fieldId, groupId);
2455
+ return map;
2456
+ }
2457
+ async function getDsOptionsFull(host, objId, fieldId, groupId) {
2454
2458
  const response = await host.request({
2455
2459
  path: "/api/ebuilder/common/ds/options",
2456
2460
  query: { fieldName: fieldId, objId, sourceType: "FORM", groupId }
2457
2461
  });
2458
2462
  const map = {};
2463
+ const disabled = [];
2459
2464
  for (const option of response?.data || []) {
2460
- if (option?.name && option?.id) map[option.name] = String(option.id);
2465
+ if (!option?.name || !option?.id) continue;
2466
+ if (String(option.archive) === "1") disabled.push({ name: String(option.name), id: String(option.id) });
2467
+ else map[option.name] = String(option.id);
2461
2468
  }
2462
- return map;
2469
+ return { map, disabled };
2463
2470
  }
2464
2471
  async function resolvePersonId(host, _fieldId, keyword) {
2465
2472
  const kw = String(keyword || "").trim();
@@ -3029,10 +3036,13 @@ async function buildInterviewPlan(env, cache, args) {
3029
3036
  throw ehrValidationError("recruit_field_missing", `\u9762\u8BD5\u8BA1\u5212\u8868\u5355\u7F3A\u5C11\u5B57\u6BB5 ${key}\uFF08\u73AF\u5883\u7F13\u5B58 ds/fields \u672A\u89E3\u6790\u5230\uFF0C\u8BF7\u91CD\u5EFA\u73AF\u5883\u7F13\u5B58\u540E\u91CD\u8BD5\uFF09`);
3030
3037
  }
3031
3038
  }
3032
- const typeMap = await getDsOptions(host, objId, fieldIdOf("interview_type"), cache.appId);
3033
- const typeOptionId = typeMap[type];
3039
+ const typeFull = await getDsOptionsFull(host, objId, fieldIdOf("interview_type"), cache.appId);
3040
+ const typeOptionId = typeFull.map[type];
3034
3041
  if (!typeOptionId) {
3035
- throw ehrValidationError("enum_invalid", `\u9762\u8BD5\u65B9\u5F0F\u300C${type}\u300D\u4E0D\u5728\u679A\u4E3E\u4E2D\uFF08${Object.keys(typeMap).join(" / ")}\uFF09`);
3042
+ if (typeFull.disabled.some((d) => d.name === type)) {
3043
+ throw ehrValidationError("enum_disabled", `\u9762\u8BD5\u65B9\u5F0F\u300C${type}\u300D\u5DF2\u7981\u7528\uFF08\u8BE5\u679A\u4E3E\u9879 archive=1\uFF09\uFF0C\u8BF7\u6539\u7528\u5176\u5B83\u9762\u8BD5\u65B9\u5F0F`);
3044
+ }
3045
+ throw ehrValidationError("enum_invalid", `\u9762\u8BD5\u65B9\u5F0F\u300C${type}\u300D\u4E0D\u5728\u679A\u4E3E\u4E2D\uFF08${Object.keys(typeFull.map).join(" / ")}\uFF09`);
3036
3046
  }
3037
3047
  const sessionMap = await getDsOptions(host, objId, fieldIdOf("interview_session"), cache.appId);
3038
3048
  const sessionOptionId = sessionMap[session];
@@ -3196,6 +3206,7 @@ var interviewArrangePrepare = {
3196
3206
  } : {},
3197
3207
  notify: notify ? "\u5C06\u89E6\u53D1\u300C\u65B0\u5EFA\u65E5\u7A0B\u300D\u9762\u8BD5\u901A\u77E5\u52A8\u4F5C\u6D41\uFF08\u5916\u90E8\u901A\u77E5\uFF09" : "\u9762\u8BD5\u901A\u77E5\u9ED8\u8BA4\u4E0D\u89E6\u53D1"
3198
3208
  },
3209
+ deprecated: "\u672C\u5165\u53E3\u526F\u4F5C\u7528\u4E0D\u542B\u9875\u9762\u6309\u94AE\u52A8\u4F5C\u6D41\uFF08\u65E0\u65B0\u5EFAEB\u65E5\u7A0B/\u521B\u5EFA\u89C6\u9891\u4F1A\u8BAE/AI\u9762\u8BD5\u63D0\u9192\uFF09\u4E14\u4E0D\u5E76\u5165\u9875\u9762\u9ED8\u8BA4\u503C\uFF0C\u5EFA\u8BAE\u6539\u7528 recruit-stage.interview.arrange.*\uFF08\u80FD\u529B\u76F8\u540C\u3001\u526F\u4F5C\u7528\u5B8C\u6574\uFF09",
3199
3210
  willSubmit: { formId: plan.formId, objId: plan.objId, dataDetails: plan.dataDetails },
3200
3211
  continuation: token,
3201
3212
  expiresInSeconds: CONTINUATION_TTL_SECONDS
@@ -6,8 +6,8 @@ import {
6
6
  meetingStateDir,
7
7
  readCache,
8
8
  resolveMeetingEnvMode
9
- } from "./chunk-IRMIEDXN.js";
10
- import "./chunk-6V5ZPKHV.js";
9
+ } from "./chunk-FEP6ELMR.js";
10
+ import "./chunk-NK74RE5F.js";
11
11
  import "./chunk-7BDPM5ST.js";
12
12
  import "./chunk-UG5G54VL.js";
13
13
  import "./chunk-BUSC6UAE.js";
@@ -12,7 +12,7 @@ import {
12
12
  requireConfirm,
13
13
  verifyLease,
14
14
  writeBody
15
- } from "./chunk-6V5ZPKHV.js";
15
+ } from "./chunk-NK74RE5F.js";
16
16
  import "./chunk-7BDPM5ST.js";
17
17
  import "./chunk-UG5G54VL.js";
18
18
  import "./chunk-BUSC6UAE.js";
@@ -6,9 +6,9 @@ import {
6
6
  ensureMeetingGroupChat,
7
7
  meetingEbGroupChatOperations,
8
8
  savePendingForm
9
- } from "./chunk-IP4CWQCF.js";
10
- import "./chunk-IRMIEDXN.js";
11
- import "./chunk-6V5ZPKHV.js";
9
+ } from "./chunk-WMSAWAWZ.js";
10
+ import "./chunk-FEP6ELMR.js";
11
+ import "./chunk-NK74RE5F.js";
12
12
  import "./chunk-7BDPM5ST.js";
13
13
  import "./chunk-UG5G54VL.js";
14
14
  import "./chunk-BUSC6UAE.js";
@@ -11,7 +11,7 @@ import {
11
11
  assertNoForbiddenKeys,
12
12
  getImOperation,
13
13
  imOperationDefinitions
14
- } from "./chunk-Q4OYAQYH.js";
14
+ } from "./chunk-72MI3MBX.js";
15
15
  import {
16
16
  imValidationError
17
17
  } from "./chunk-IC62NFM5.js";
@@ -226,6 +226,108 @@ function boolOption(value) {
226
226
  if (value === void 0 || value === null || value === "") return void 0;
227
227
  return value === true || value === "true" || value === "1";
228
228
  }
229
+ var BATCH_MAX_ITEMS = 1e3;
230
+ function resolvePrevRefs(input, prevData) {
231
+ const resolved = {};
232
+ for (const [key, value] of Object.entries(input)) {
233
+ if (typeof value === "string" && value.startsWith("$prev.")) {
234
+ if (!prevData) {
235
+ throw imValidationError("prev_unavailable", `${key}\uFF1A$prev \u5F15\u7528\u4E0D\u53EF\u7528\uFF08\u4E0A\u4E00\u9879\u5931\u8D25\u6216\u4E0D\u5B58\u5728\uFF09`);
236
+ }
237
+ let cursor = prevData;
238
+ for (const seg of value.slice(6).split(".")) {
239
+ if (cursor && typeof cursor === "object" && seg in cursor) {
240
+ cursor = cursor[seg];
241
+ } else {
242
+ throw imValidationError("prev_ref_missing", `${key}\uFF1A$prev \u8DEF\u5F84 "${value.slice(6)}" \u5728\u4E0A\u4E00\u9879\u7ED3\u679C\u4E2D\u4E0D\u5B58\u5728`);
243
+ }
244
+ }
245
+ resolved[key] = cursor;
246
+ } else {
247
+ resolved[key] = value;
248
+ }
249
+ }
250
+ return resolved;
251
+ }
252
+ async function executeBatchAndPrint(ctx, input, stopOnFailure) {
253
+ const rawItems = input.items;
254
+ if (!Array.isArray(rawItems) || rawItems.length === 0) {
255
+ throw imValidationError("batch_items_required", "batch \u8F93\u5165\u5FC5\u987B\u5305\u542B\u975E\u7A7A items \u6570\u7EC4");
256
+ }
257
+ if (rawItems.length > BATCH_MAX_ITEMS) {
258
+ throw imValidationError("batch_items_too_many", `items \u8D85\u8FC7\u4E0A\u9650 ${BATCH_MAX_ITEMS}`);
259
+ }
260
+ const items = [];
261
+ rawItems.forEach((raw, i) => {
262
+ if (!raw || typeof raw !== "object" || Array.isArray(raw) || typeof raw.operation !== "string") {
263
+ throw imValidationError("batch_item_invalid", `items[${i}] \u5FC5\u987B\u662F\u542B operation \u5B57\u7B26\u4E32\u5B57\u6BB5\u7684\u5BF9\u8C61`);
264
+ }
265
+ const item = raw;
266
+ items.push({
267
+ operation: String(item.operation),
268
+ input: item.input && typeof item.input === "object" && !Array.isArray(item.input) ? { ...item.input } : {}
269
+ });
270
+ });
271
+ const results = [];
272
+ let prevData = null;
273
+ let prevFailed = false;
274
+ let okCount = 0;
275
+ let failCount = 0;
276
+ const started = Date.now();
277
+ for (let i = 0; i < items.length; i++) {
278
+ const { operation, input: rawInput } = items[i];
279
+ let itemError = prevFailed && Object.values(rawInput ?? {}).some(
280
+ (v) => typeof v === "string" && v.startsWith("$prev.")
281
+ ) ? imValidationError("prev_failed_skipped", "\u4E0A\u4E00\u9879\u5931\u8D25\uFF0C\u672C\u9879\u4F9D\u8D56 $prev \u5F15\u7528\u88AB\u8DF3\u8FC7") : null;
282
+ let envelope;
283
+ if (!itemError) {
284
+ try {
285
+ const merged = resolvePrevRefs(rawInput ?? {}, prevData);
286
+ const result = await executeImOperation(operation, merged, {
287
+ ctx,
288
+ host: createImHost(ctx),
289
+ continuation: createImContinuationSigner(ctx)
290
+ });
291
+ envelope = successEnvelope(operation, result);
292
+ prevData = result.data === void 0 ? null : result.data;
293
+ prevFailed = false;
294
+ okCount++;
295
+ } catch (error) {
296
+ envelope = failureEnvelope(error);
297
+ prevData = null;
298
+ prevFailed = true;
299
+ failCount++;
300
+ }
301
+ } else {
302
+ envelope = failureEnvelope(itemError);
303
+ prevData = null;
304
+ prevFailed = true;
305
+ failCount++;
306
+ }
307
+ results.push({ index: i, operation, ...envelope });
308
+ process.stderr.write(`[batch ${i + 1}/${items.length}] ${operation} ${envelope.ok ? "ok" : "failed"}
309
+ `);
310
+ if (stopOnFailure && !envelope.ok) {
311
+ for (let j = i + 1; j < items.length; j++) {
312
+ results.push({ index: j, operation: items[j].operation, ok: false, error: { type: "batch", subtype: "skipped_stop_on_failure" } });
313
+ }
314
+ failCount += items.length - 1 - i;
315
+ break;
316
+ }
317
+ }
318
+ const ok = failCount === 0;
319
+ ctx.output.write({
320
+ schemaVersion: 1,
321
+ ok,
322
+ operation: "im.run-batch",
323
+ data: {
324
+ results,
325
+ summary: { total: items.length, ok: okCount, failed: failCount, elapsedMs: Date.now() - started }
326
+ },
327
+ warnings: []
328
+ }, { json: true });
329
+ if (!ok) process.exitCode = 1 /* GeneralError */;
330
+ }
229
331
  var imShortcut = {
230
332
  name: "im",
231
333
  description: "\u6CDB\u5FAEE10\u6613\u79D2\u529E\uFF08\u5373\u65F6\u901A\u8BAF\uFF09CLI",
@@ -238,6 +340,10 @@ var imShortcut = {
238
340
  withJsonInputOptions(im.command("run").description("Run an im operation with JSON input").argument("<operation>", "operation name, e.g. im.msg.sync.group")).action(action(async (ctx, operation, options) => {
239
341
  await executeAndPrint(ctx, String(operation), await inputFrom(options));
240
342
  }));
343
+ withJsonInputOptions(im.command("run-batch").description("Run multiple im operations sequentially in one process (strictly serial, no concurrency)").option("--stop-on-failure", "skip all remaining items after the first failure")).action(action(async (ctx, options) => {
344
+ const opts = asOptions(options);
345
+ await executeBatchAndPrint(ctx, await inputFrom(opts), boolOption(opts.stopOnFailure) === true);
346
+ }));
241
347
  const session = im.command("session").description("Session commands");
242
348
  withJsonInputOptions(session.command("list").description("\u62C9\u53D6\u5F53\u524D\u7528\u6237\u4F1A\u8BDD\u5217\u8868").option("--num <n>", "\u5355\u9875\u6761\u6570\uFF08\u9ED8\u8BA4 20\uFF0C\u6700\u591A 50\uFF1B\u4F1A\u8BDD\u5217\u8868\u4E0D\u81EA\u52A8\u7FFB\u9875\uFF09").option("--msgid <id>", "\u951A\u70B9\u6D88\u606F id").option("--flag <0|1|2>", "0 up+down / 1 up / 2 down\uFF08\u9ED8\u8BA4 2\uFF09").option("--type <type>", "\u4EC5\u5C55\u793A\u8BE5 session_type")).action(action(async (ctx, options) => {
243
349
  const opts = asOptions(options);
@@ -8,7 +8,7 @@ import {
8
8
  invoicePartialError,
9
9
  invoiceValidationError,
10
10
  isInvoiceNetworkError
11
- } from "./chunk-LIEQJIGM.js";
11
+ } from "./chunk-GR76ZDDX.js";
12
12
  import {
13
13
  reportPlatformError
14
14
  } from "./chunk-6N4JPNFL.js";
@@ -1366,7 +1366,6 @@ var invoiceOperations = [
1366
1366
  relatedInvoiceId: { type: "string" },
1367
1367
  invoiceTotal: { type: "string" }
1368
1368
  }, ["relatedInvoiceId", "invoiceTotal"]), { description: "\u989D\u5EA6\u7528\u5B8C\u540E\u6CA1\u8FDB\u660E\u7EC6\u3001\u7559\u5728\u7968\u5939\u7684\u53D1\u7968" }),
1369
- debugTrace: { type: "array", description: "\u6392\u67E5\u7528\uFF1A\u5165\u53C2\u3001\u6BCF\u884C\u91D1\u989D\u5206\u644A\u3001\u8BF7\u6C42\u4F53\u3001\u63A5\u53E3\u8FD4\u56DE" },
1370
1369
  finalMarkdown: { type: "string", description: "[processTitle](url)\uFF0C\u76F4\u63A5\u5C55\u793A\u7ED9\u7528\u6237" },
1371
1370
  result: rawObject,
1372
1371
  workflow: workflowSchema
@@ -3597,23 +3596,12 @@ function normalizeInvoices(value) {
3597
3596
  }
3598
3597
  return invoices;
3599
3598
  }
3600
- function formatRemaining(cents2) {
3601
- return Number.isFinite(cents2) ? formatCents2(cents2) : "\u4E0D\u5C01\u9876";
3602
- }
3603
3599
  function workflowViewUrl(baseUrl, requestId) {
3604
3600
  return `${baseUrl.replace(/\/+$/, "")}/sp/workflow/flowpage/view/${requestId}`;
3605
3601
  }
3606
3602
  var InvoiceReimSubsidySubmitOperation = class {
3607
3603
  name = "invoice.reim.subsidy.submit";
3608
3604
  async execute(input, { host }) {
3609
- const debugTrace = [];
3610
- const debug = (step, detail) => {
3611
- debugTrace.push({ step, detail });
3612
- const message = `[${this.name}] ${step} ${typeof detail === "string" ? detail : JSON.stringify(detail)}`;
3613
- host.debug?.(message);
3614
- if (!process.env.NODE_TEST_CONTEXT) console.error(message);
3615
- };
3616
- debugger;
3617
3605
  const processTitle = asNonEmptyString(input.processTitle, "processTitle");
3618
3606
  const reason = asNonEmptyString(input.reason, "reason");
3619
3607
  const relatedProcessId = asPositiveString(input.relatedProcessId, "relatedProcessId");
@@ -3621,54 +3609,22 @@ var InvoiceReimSubsidySubmitOperation = class {
3621
3609
  const customerId = optionalId(input.customerId, "customerId") || DEFAULT_CUSTOMER_ID;
3622
3610
  const projectId = optionalId(input.projectId, "projectId");
3623
3611
  const allowanceCents = amountCents2(input.monthlyAllowance, "monthlyAllowance");
3624
- debug("1/5 \u5165\u53C2", {
3625
- processTitle,
3626
- reason,
3627
- relatedProcessId,
3628
- invoices: invoices.map((item) => ({ fid: item.fid, total: formatCents2(item.cents) })),
3629
- monthlyAllowance: allowanceCents === null ? null : formatCents2(allowanceCents),
3630
- customerId,
3631
- projectId
3632
- });
3633
3612
  let remainingCents = allowanceCents ?? Number.POSITIVE_INFINITY;
3634
3613
  const details = [];
3635
3614
  const skipped = [];
3636
3615
  for (const item of invoices) {
3637
3616
  if (remainingCents <= 0) {
3638
3617
  skipped.push(item);
3639
- debug("2/5 \u989D\u5EA6\u5DF2\u7528\u5B8C\uFF0C\u4E0D\u8FDB\u660E\u7EC6", { fid: item.fid, total: formatCents2(item.cents) });
3640
3618
  continue;
3641
3619
  }
3642
- const remainingBefore = remainingCents;
3643
3620
  const reimbursedCents = Math.min(item.cents, remainingCents);
3644
3621
  remainingCents -= reimbursedCents;
3645
3622
  details.push({ ...item, reimbursedCents });
3646
- debug("2/5 \u660E\u7EC6\u884C", {
3647
- fid: item.fid,
3648
- total: formatCents2(item.cents),
3649
- remainingBefore: formatRemaining(remainingBefore),
3650
- reimbursedAmount: formatCents2(reimbursedCents),
3651
- remainingAfter: formatRemaining(remainingCents)
3652
- });
3653
3623
  }
3654
3624
  const relatedInvoiceIds = details.map((item) => item.fid);
3655
3625
  const invoiceTotalCents = invoices.reduce((sum, item) => sum + item.cents, 0);
3656
3626
  const reimbursedTotalCents = details.reduce((sum, item) => sum + item.reimbursedCents, 0);
3657
3627
  const capped = reimbursedTotalCents < invoiceTotalCents;
3658
- debug("2/5 \u91D1\u989D\u6C47\u603B", {
3659
- invoiceTotal: formatCents2(invoiceTotalCents),
3660
- reimbursedAmount: formatCents2(reimbursedTotalCents),
3661
- capped,
3662
- detailCount: details.length,
3663
- skippedCount: skipped.length,
3664
- details: details.map((item) => ({
3665
- fid: item.fid,
3666
- total: formatCents2(item.cents),
3667
- reimbursedAmount: formatCents2(item.reimbursedCents)
3668
- })),
3669
- skipped: skipped.map((item) => ({ fid: item.fid, total: formatCents2(item.cents) }))
3670
- });
3671
- debugger;
3672
3628
  const session = await host.getSession();
3673
3629
  const currentEmpId = asPositiveString(session.userId, "\u5F53\u524D\u4EBA\u5458 ID");
3674
3630
  const body = {
@@ -3684,21 +3640,6 @@ var InvoiceReimSubsidySubmitOperation = class {
3684
3640
  reimbursedAmount: formatCents2(item.reimbursedCents)
3685
3641
  }))
3686
3642
  };
3687
- debug("3/5 \u8BF7\u6C42\u4F53", {
3688
- path: SUBSIDY_SUBMIT_PATH,
3689
- autoCommit: body.autoCommit,
3690
- processTitle: body.processTitle,
3691
- reason: body.reason,
3692
- currentEmpId,
3693
- customerId,
3694
- projectId,
3695
- detailList: details.map((item) => ({
3696
- relatedProcessId,
3697
- relatedInvoiceId: item.fid,
3698
- reimbursedAmount: formatCents2(item.reimbursedCents)
3699
- }))
3700
- });
3701
- debugger;
3702
3643
  let result;
3703
3644
  try {
3704
3645
  result = await host.invoiceRequest({
@@ -3708,18 +3649,12 @@ var InvoiceReimSubsidySubmitOperation = class {
3708
3649
  operation: this.name,
3709
3650
  timeoutMs: 9e4
3710
3651
  });
3711
- debug("4/5 \u63A5\u53E3\u8FD4\u56DE", result);
3712
- debugger;
3713
3652
  } catch (error) {
3714
- const failure = error;
3715
- debug("4/5 \u8BF7\u6C42\u5F02\u5E38", { type: failure?.type, subtype: failure?.subtype, code: failure?.code, message: failure?.message });
3716
- debugger;
3717
3653
  if (isInvoiceNetworkError(error)) {
3718
3654
  throw invoicePartialError("\u62A5\u9500\u63D0\u4EA4\u8BF7\u6C42\u53D1\u51FA\u540E\u8FDE\u63A5\u4E2D\u65AD\uFF0C\u7ED3\u679C\u4E0D\u786E\u5B9A\uFF0C\u7981\u6B62\u81EA\u52A8\u91CD\u8BD5", {
3719
3655
  processTitle,
3720
3656
  relatedProcessId,
3721
3657
  relatedInvoiceIds,
3722
- debugTrace,
3723
3658
  workflow: workflow(this.name, "EXECUTING")
3724
3659
  }, { stage: "submit" });
3725
3660
  }
@@ -3728,10 +3663,9 @@ var InvoiceReimSubsidySubmitOperation = class {
3728
3663
  const data = result?.data && typeof result.data === "object" ? result.data : {};
3729
3664
  const dataCode = data.code;
3730
3665
  if (result?.status === false || result?.fail === true || dataCode !== void 0 && Number(dataCode) !== 0) {
3731
- debug("4/5 \u4E1A\u52A1\u5931\u8D25", { dataCode, msg: data.msg || result?.msg });
3732
3666
  throw new InvoiceCliError("api", "reim_subsidy_submit_failed", data.msg || result?.msg || "\u8BDD\u8D39 / \u6CB9\u8D39\u62A5\u9500\u63D0\u4EA4\u5931\u8D25", {
3733
3667
  code: dataCode ?? result?.code,
3734
- details: { result, debugTrace },
3668
+ details: { result },
3735
3669
  exitCode: 1
3736
3670
  });
3737
3671
  }
@@ -3740,12 +3674,10 @@ var InvoiceReimSubsidySubmitOperation = class {
3740
3674
  throw invoicePartialError("\u62A5\u9500\u63D0\u4EA4\u63A5\u53E3\u8FD4\u56DE\u6210\u529F\u4F46\u6CA1\u6709\u6D41\u7A0B ID\uFF0C\u7ED3\u679C\u4E0D\u786E\u5B9A\uFF0C\u7981\u6B62\u81EA\u52A8\u91CD\u8BD5", {
3741
3675
  processTitle,
3742
3676
  result,
3743
- debugTrace,
3744
3677
  workflow: workflow(this.name, "VERIFYING")
3745
3678
  }, { stage: "submit-response" });
3746
3679
  }
3747
3680
  const url = workflowViewUrl(session.baseUrl, requestId);
3748
- debug("5/5 \u5B8C\u6210", { requestId, url });
3749
3681
  return {
3750
3682
  status: "COMPLETE",
3751
3683
  data: {
@@ -3766,7 +3698,6 @@ var InvoiceReimSubsidySubmitOperation = class {
3766
3698
  relatedInvoiceId: item.fid,
3767
3699
  invoiceTotal: formatCents2(item.cents)
3768
3700
  })),
3769
- debugTrace,
3770
3701
  finalMarkdown: `[${processTitle}](${url})`,
3771
3702
  result,
3772
3703
  workflow: workflow(this.name, "COMPLETE")
@@ -5,9 +5,9 @@ import {
5
5
  createProgram,
6
6
  registerCommands,
7
7
  toCommandMetadata
8
- } from "./chunk-J2VEB5K3.js";
9
- import "./chunk-727FH2NI.js";
10
- import "./chunk-LIEQJIGM.js";
8
+ } from "./chunk-2BQESR2U.js";
9
+ import "./chunk-2IGZUMNG.js";
10
+ import "./chunk-GR76ZDDX.js";
11
11
  import "./chunk-AJ62BGAW.js";
12
12
  import "./chunk-6N4JPNFL.js";
13
13
  import "./chunk-6NXT4ICB.js";
@@ -3,19 +3,19 @@ const require = __esbuildCreateRequire(import.meta.url);
3
3
  import {
4
4
  getMeetingOperation,
5
5
  meetingOperationDefinitions
6
- } from "./chunk-76H3IKH6.js";
7
- import "./chunk-IP4CWQCF.js";
8
- import "./chunk-AD46OMQK.js";
9
- import "./chunk-6AXKWFKG.js";
10
- import "./chunk-4RWS2YYL.js";
11
- import "./chunk-OXHHJWNC.js";
12
- import "./chunk-PSOMGA3U.js";
13
- import "./chunk-GSZTA43P.js";
6
+ } from "./chunk-5B5JXTY2.js";
7
+ import "./chunk-OCYRVZGN.js";
8
+ import "./chunk-WMSAWAWZ.js";
9
+ import "./chunk-EFOUMXIX.js";
10
+ import "./chunk-SVFG6EMV.js";
11
+ import "./chunk-BCACE6VV.js";
12
+ import "./chunk-R2HHLJNN.js";
13
+ import "./chunk-PSPOFLSU.js";
14
14
  import {
15
15
  degradeMeetingEnvToStandard,
16
16
  meetingStateDir,
17
17
  readCache
18
- } from "./chunk-IRMIEDXN.js";
18
+ } from "./chunk-FEP6ELMR.js";
19
19
  import {
20
20
  MeetingCliError,
21
21
  asObject,
@@ -23,7 +23,7 @@ import {
23
23
  meetingAuthError,
24
24
  meetingNetworkError,
25
25
  meetingValidationError
26
- } from "./chunk-6V5ZPKHV.js";
26
+ } from "./chunk-NK74RE5F.js";
27
27
  import {
28
28
  reportPlatformError
29
29
  } from "./chunk-6N4JPNFL.js";