weaver-work-cli 0.1.36 → 0.1.38

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 (93) hide show
  1. package/dist/chunks/{archive-XBVH7JU7.js → archive-PDV724YK.js} +5 -4
  2. package/dist/chunks/{archive-oa-MZM3EKFQ.js → archive-oa-4XE4MNXQ.js} +4 -3
  3. package/dist/chunks/{asset-4XO7UOUW.js → asset-PDL2QE2N.js} +8 -7
  4. package/dist/chunks/{attachment-content-VXSWANAC.js → attachment-content-MDDGOE5E.js} +3 -3
  5. package/dist/chunks/{blog-PGZKOPSC.js → blog-UYR3EUXW.js} +5 -4
  6. package/dist/chunks/{caizhilian-BH4ZVGUN.js → caizhilian-LG2X5NMF.js} +5 -4
  7. package/dist/chunks/{calendar-MXEMTIO4.js → calendar-FG4BAZHE.js} +4 -3
  8. package/dist/chunks/{chunk-NCOVUAZK.js → chunk-6FTTSA45.js} +4 -3
  9. package/dist/chunks/{chunk-HXJQI5NM.js → chunk-6LTFIFLM.js} +3 -2
  10. package/dist/chunks/{chunk-QYGO5EE2.js → chunk-CORFRD7Q.js} +4 -3
  11. package/dist/chunks/{chunk-QHFANTX7.js → chunk-DMV2TOMH.js} +1348 -90
  12. package/dist/chunks/{chunk-TC6MZAO3.js → chunk-ELYDWBZJ.js} +52 -2
  13. package/dist/chunks/{chunk-JCSN3JGM.js → chunk-FUWVHMVV.js} +7 -6
  14. package/dist/chunks/{chunk-BPE37FPB.js → chunk-GGJFMNJM.js} +3 -3
  15. package/dist/chunks/{chunk-6LLJFKJE.js → chunk-IZUDA353.js} +1 -1
  16. package/dist/chunks/{chunk-XMGSYD6S.js → chunk-J7USS3ED.js} +4 -4
  17. package/dist/chunks/{chunk-F746NKNF.js → chunk-JSMFPO43.js} +1 -1
  18. package/dist/chunks/{chunk-T72N74ZT.js → chunk-KKRL3REV.js} +5 -4
  19. package/dist/chunks/{chunk-VPUTVEMC.js → chunk-NI6GIPIM.js} +98 -3
  20. package/dist/chunks/{chunk-VPXOPQJI.js → chunk-NR6RKXPA.js} +2 -2
  21. package/dist/chunks/{chunk-JNG42JKG.js → chunk-OJQUJZQF.js} +4 -6
  22. package/dist/chunks/{chunk-I6QGIBDM.js → chunk-UJJD4QWF.js} +4 -3
  23. package/dist/chunks/{chunk-JUXVYKII.js → chunk-UZZBA6PV.js} +174 -14
  24. package/dist/chunks/{chunk-JYKABYCV.js → chunk-VRYHGG6O.js} +2 -2
  25. package/dist/chunks/{chunk-WXFPWCXG.js → chunk-XJY7G4DD.js} +3 -3
  26. package/dist/chunks/{chunk-5DQEEGCC.js → chunk-Z32KWY6G.js} +1 -1
  27. package/dist/chunks/{conflict-JAB2LJEZ.js → conflict-BQZEQ4SP.js} +2 -2
  28. package/dist/chunks/{contract-XI2EEIZU.js → contract-XIRAFTEV.js} +4 -3
  29. package/dist/chunks/{cowork-SCPGLBA4.js → cowork-BLG62BL2.js} +4 -3
  30. package/dist/chunks/{ebuilder-form-EYLHNOTA.js → ebuilder-form-NUKG5QW4.js} +3 -3
  31. package/dist/chunks/{ehr-EAP77IMT.js → ehr-2STW5ILH.js} +4 -3
  32. package/dist/chunks/{esb-2TGGXEE7.js → esb-UUDQUNKY.js} +4 -4
  33. package/dist/chunks/{fna-2X7ZE7BU.js → fna-6RCY4NU5.js} +4 -3
  34. package/dist/chunks/{host-C6EL2RKL.js → host-7RXEDMAH.js} +3 -3
  35. package/dist/chunks/{host-XCLDDXKQ.js → host-EJZFROU3.js} +3 -3
  36. package/dist/chunks/{host-I4NRK4MX.js → host-FWDOSRH5.js} +3 -3
  37. package/dist/chunks/{host-Q4LZGCRU.js → host-RHM3NPXV.js} +3 -3
  38. package/dist/chunks/{host-UEI5FGDM.js → host-UFF33TWJ.js} +3 -3
  39. package/dist/chunks/{hrm-YXERJM76.js → hrm-PKJ6ELSH.js} +3 -3
  40. package/dist/chunks/{im-A4VZN2TQ.js → im-YJAXS7CO.js} +3 -3
  41. package/dist/chunks/{invoice-2Z6YPMIS.js → invoice-HWVSXGX6.js} +3 -3
  42. package/dist/chunks/{jiuchuanhui-AR5GMKZB.js → jiuchuanhui-L7VKILZB.js} +4 -3
  43. package/dist/chunks/{lazy-dispatch-QXW7P4X3.js → lazy-dispatch-NMYEIHRH.js} +4 -4
  44. package/dist/chunks/{mail-7GZ6CPBJ.js → mail-B42RRU7G.js} +4 -3
  45. package/dist/chunks/{meeting-3NMGA3MB.js → meeting-CFYVBJSS.js} +13 -12
  46. package/dist/chunks/{okr-BZ6XUOAG.js → okr-GCLF6V7W.js} +4 -3
  47. package/dist/chunks/{plan-DR5CMUYP.js → plan-ZVL7GBRI.js} +4 -3
  48. package/dist/chunks/{project-6J63MK33.js → project-4YWAAE2K.js} +4 -3
  49. package/dist/chunks/{registry-VRTNC6UR.js → registry-EP4VTHZS.js} +8 -8
  50. package/dist/chunks/{registry-KDD7DHNK.js → registry-FRJ6H7BT.js} +4 -4
  51. package/dist/chunks/{registry-TKX2E7C7.js → registry-SG2PGVCF.js} +2 -2
  52. package/dist/chunks/{room-recommend-XCWRMB5P.js → room-recommend-R3JVUUAC.js} +4 -4
  53. package/dist/chunks/{schedule-IVBICP32.js → schedule-NIJBTYDO.js} +4 -4
  54. package/dist/chunks/{workflow-D74NFK3C.js → workflow-BB24DFBY.js} +4 -4
  55. package/dist/index.js +27 -27
  56. package/dist/internal/e10/auth-recovery.js +114 -1
  57. package/dist/internal/e10/client.js +16 -2
  58. package/dist/internal/e10/request-runtime.js +103 -7
  59. package/dist/shortcuts/archive/host.js +3 -2
  60. package/dist/shortcuts/archive-oa/host.js +2 -1
  61. package/dist/shortcuts/asset/host.js +6 -5
  62. package/dist/shortcuts/blog/host.js +3 -2
  63. package/dist/shortcuts/caizhilian/host.js +3 -2
  64. package/dist/shortcuts/calendar/host.js +2 -1
  65. package/dist/shortcuts/contract/host.js +2 -1
  66. package/dist/shortcuts/cowork/host.js +2 -1
  67. package/dist/shortcuts/ebuilder-form/host.js +3 -1
  68. package/dist/shortcuts/ehr/host.js +2 -1
  69. package/dist/shortcuts/esb/host.js +2 -1
  70. package/dist/shortcuts/fna/host.js +2 -1
  71. package/dist/shortcuts/hrm/host.js +2 -1
  72. package/dist/shortcuts/im/host.js +3 -2
  73. package/dist/shortcuts/invoice/host.js +5 -4
  74. package/dist/shortcuts/jiuchuanhui/host.js +2 -1
  75. package/dist/shortcuts/mail/host.js +2 -1
  76. package/dist/shortcuts/meeting/host.js +3 -2
  77. package/dist/shortcuts/meeting/invitation/text.js +71 -0
  78. package/dist/shortcuts/meeting/operations/eb/create-flow.js +1073 -50
  79. package/dist/shortcuts/meeting/operations/eb/crm-search.js +478 -0
  80. package/dist/shortcuts/meeting/operations/eb/factory.js +60 -1
  81. package/dist/shortcuts/meeting/operations/eb/index.js +2 -0
  82. package/dist/shortcuts/meeting/operations/invitation.js +122 -9
  83. package/dist/shortcuts/okr/host.js +2 -1
  84. package/dist/shortcuts/plan/host.js +2 -1
  85. package/dist/shortcuts/project/host.js +2 -1
  86. package/dist/shortcuts/workflow/operations/form.js +160 -2
  87. package/package.json +1 -1
  88. package/skills/weaver-e10-meeting/SKILL.md +250 -301
  89. package/skills/weaver-e10-meeting/references/meeting-eb.md +203 -0
  90. package/skills/weaver-e10-meeting/references/meeting-invitation.md +37 -5
  91. package/skills/weaver-e10-meeting.zip +0 -0
  92. package/skills/weaver-e10-okr/references/source-manifest.json +3 -3
  93. package/skills/weaver-e10-yimiaoban/references/source-manifest.json +3 -3
@@ -1530,6 +1530,50 @@ function isWriteKind(kind) {
1530
1530
  var EB_BASE = "/api/ebuilder/form/formdata/v2";
1531
1531
  var EB_READ_OP = { list: "getFormDataList", detail: "getFormDataByPk", get: "getFormDataList" };
1532
1532
  var EB_WRITE_OP = { create: "saveFormData", update: "updateFormData", delete: "deleteFormData" };
1533
+ var PERSONNEL_FIELDS = [
1534
+ "caller",
1535
+ "contacter",
1536
+ "mt_creator",
1537
+ "creator",
1538
+ "updater",
1539
+ "hrm_members",
1540
+ "attend_user",
1541
+ "inviters",
1542
+ "reporting_user",
1543
+ "topic_presenter"
1544
+ ];
1545
+ async function buildPersonnelText(env, data) {
1546
+ const ids = [];
1547
+ for (const key of PERSONNEL_FIELDS) {
1548
+ const raw = String(data?.[key] ?? "").trim();
1549
+ if (raw === "" || !/^[\d,\s]+$/u.test(raw)) continue;
1550
+ ids.push(...raw.split(",").map((one) => one.trim()).filter((one) => one !== ""));
1551
+ }
1552
+ if (ids.length === 0) return {};
1553
+ const names = /* @__PURE__ */ new Map();
1554
+ try {
1555
+ const { hrmEmployeeOperations } = await import("./employee-SAK2QYXX.js");
1556
+ const batch = hrmEmployeeOperations.find((operation) => operation.name === "hrm.employee.batch");
1557
+ if (batch) {
1558
+ const result = await batch.handler({ ids: [...new Set(ids)] }, env);
1559
+ for (const row of result?.data?.rows ?? result?.data?.userList ?? []) {
1560
+ const id = String(row.id ?? "").trim();
1561
+ const name = String(row.name ?? "").trim();
1562
+ if (id && name) names.set(id, name);
1563
+ }
1564
+ }
1565
+ } catch {
1566
+ return {};
1567
+ }
1568
+ const out = {};
1569
+ for (const key of PERSONNEL_FIELDS) {
1570
+ const raw = String(data?.[key] ?? "").trim();
1571
+ if (raw === "" || !/^[\d,\s]+$/u.test(raw)) continue;
1572
+ const mapped = raw.split(",").map((one) => names.get(one.trim()) ?? one.trim()).filter((one) => one !== "");
1573
+ if (mapped.length > 0) out[key] = mapped.join(",");
1574
+ }
1575
+ return out;
1576
+ }
1533
1577
  var CONTINUATION_TTL_SECONDS = 600;
1534
1578
  function ebBusinessSuccess(value) {
1535
1579
  if (!value || typeof value !== "object") return false;
@@ -1705,9 +1749,15 @@ function buildReadOperation(endpoint) {
1705
1749
  if (key !== "mainTable") detailNodes[key] = value;
1706
1750
  }
1707
1751
  }
1752
+ const personnelText = endpoint.operation.startsWith("meeting.") ? await buildPersonnelText(env, data) : {};
1708
1753
  return meetingSuccess(
1709
1754
  endpoint.operation,
1710
- { id, data, ...Object.keys(detailNodes).length > 0 ? { details: detailNodes } : {} },
1755
+ {
1756
+ id,
1757
+ data,
1758
+ ...Object.keys(personnelText).length > 0 ? { personnelText } : {},
1759
+ ...Object.keys(detailNodes).length > 0 ? { details: detailNodes } : {}
1760
+ },
1711
1761
  endpoint.notes ? { meta: { notes: endpoint.notes } } : {}
1712
1762
  );
1713
1763
  }
@@ -2201,7 +2251,7 @@ function buildWriteOperations(endpoint, preflight, afterWrite) {
2201
2251
  );
2202
2252
  }
2203
2253
  if (endpoint.interfacePk === "create_meeting") {
2204
- const { fetchEbAppSettings, assertEbCreatePathAllowed } = await import("./conflict-JAB2LJEZ.js");
2254
+ const { fetchEbAppSettings, assertEbCreatePathAllowed } = await import("./conflict-BQZEQ4SP.js");
2205
2255
  assertEbCreatePathAllowed(await fetchEbAppSettings(env, applyName));
2206
2256
  }
2207
2257
  const pkQuery = writePkQuery(endpoint, payload);
@@ -2,13 +2,14 @@ import { createRequire as __esbuildCreateRequire } from 'node:module';
2
2
  const require = __esbuildCreateRequire(import.meta.url);
3
3
  import {
4
4
  createE10RequestRuntime,
5
+ isE10SessionExpiredResponse,
5
6
  requireE10Session
6
- } from "./chunk-JUXVYKII.js";
7
+ } from "./chunk-UZZBA6PV.js";
7
8
  import {
8
9
  E10_REAUTH_GUIDANCE,
9
10
  E10_SESSION_EXPIRED_MESSAGE,
10
11
  getActiveProfile
11
- } from "./chunk-JNG42JKG.js";
12
+ } from "./chunk-OJQUJZQF.js";
12
13
  import {
13
14
  CliError
14
15
  } from "./chunk-LUSPKZKY.js";
@@ -264,7 +265,7 @@ function createInvoiceHost(ctx, dependencies = {}) {
264
265
  timeoutMs,
265
266
  trustedHeaders: trustedInvoiceHeaders(token)
266
267
  });
267
- if (response.status === 401 || response.status === 302) {
268
+ if (isE10SessionExpiredResponse(response)) {
268
269
  throw invoiceAuthError("session_expired", E10_SESSION_EXPIRED_MESSAGE, { httpStatus: response.status });
269
270
  }
270
271
  if (response.parseError) {
@@ -331,7 +332,7 @@ function createInvoiceHost(ctx, dependencies = {}) {
331
332
  timeoutMs,
332
333
  trustedHeaders: trustedInvoiceHeaders(token)
333
334
  });
334
- if (response.status === 401 || response.status === 302) {
335
+ if (isE10SessionExpiredResponse(response)) {
335
336
  throw invoiceAuthError("session_expired", E10_SESSION_EXPIRED_MESSAGE, { httpStatus: response.status });
336
337
  }
337
338
  if (response.parseError) {
@@ -373,7 +374,7 @@ function createInvoiceHost(ctx, dependencies = {}) {
373
374
  timeoutMs,
374
375
  trustedHeaders: trustedInvoiceHeaders(token)
375
376
  });
376
- if (response.status === 401 || response.status === 302) {
377
+ if (isE10SessionExpiredResponse(response)) {
377
378
  throw invoiceAuthError("session_expired", E10_SESSION_EXPIRED_MESSAGE, { httpStatus: response.status });
378
379
  }
379
380
  if (response.parseError) {
@@ -400,7 +401,7 @@ function createInvoiceHost(ctx, dependencies = {}) {
400
401
  timeoutMs,
401
402
  trustedHeaders: trustedInvoiceHeaders(token)
402
403
  });
403
- if (response.status === 401 || response.status === 302) {
404
+ if (isE10SessionExpiredResponse(response)) {
404
405
  throw invoiceAuthError("session_expired", E10_SESSION_EXPIRED_MESSAGE, { httpStatus: response.status });
405
406
  }
406
407
  const contentType = response.contentType;
@@ -4,7 +4,7 @@ import {
4
4
  cacheScopeSuffix,
5
5
  readCache,
6
6
  writeCache
7
- } from "./chunk-F746NKNF.js";
7
+ } from "./chunk-JSMFPO43.js";
8
8
  import {
9
9
  EB_BASE,
10
10
  SCHEMA_DATETIME_MINUTE,
@@ -13,7 +13,7 @@ import {
13
13
  meetingSuccess,
14
14
  queryBody,
15
15
  schemaOf
16
- } from "./chunk-TC6MZAO3.js";
16
+ } from "./chunk-ELYDWBZJ.js";
17
17
 
18
18
  // src/shortcuts/meeting/operations/eb/room-recommend.ts
19
19
  var ROOMS_TTL_MS = 24 * 60 * 60 * 1e3;
@@ -121,7 +121,7 @@ async function loadFrequentRooms(env, options = {}) {
121
121
  const counts = /* @__PURE__ */ new Map();
122
122
  let requests = 0;
123
123
  try {
124
- const { getMeetingOperation } = await import("./registry-VRTNC6UR.js");
124
+ const { getMeetingOperation } = await import("./registry-EP4VTHZS.js");
125
125
  const listOp = getMeetingOperation("meeting.eb.meeting.list");
126
126
  for (let pageNo = 1; pageNo <= 5; pageNo += 1) {
127
127
  const page = await listOp.handler(
@@ -2,7 +2,7 @@ import { createRequire as __esbuildCreateRequire } from 'node:module';
2
2
  const require = __esbuildCreateRequire(import.meta.url);
3
3
  import {
4
4
  isEsbFlowUnavailable
5
- } from "./chunk-I6QGIBDM.js";
5
+ } from "./chunk-UJJD4QWF.js";
6
6
  import {
7
7
  esbValidationError
8
8
  } from "./chunk-GPMFD4RD.js";
@@ -3,13 +3,13 @@ const require = __esbuildCreateRequire(import.meta.url);
3
3
  import {
4
4
  readCache,
5
5
  writeCache
6
- } from "./chunk-F746NKNF.js";
6
+ } from "./chunk-JSMFPO43.js";
7
7
  import {
8
8
  SCHEMA_DATETIME_MINUTE,
9
9
  meetingSuccess,
10
10
  meetingValidationError,
11
11
  schemaOf
12
- } from "./chunk-TC6MZAO3.js";
12
+ } from "./chunk-ELYDWBZJ.js";
13
13
 
14
14
  // src/shortcuts/meeting/operations/eb/schedule.ts
15
15
  var SCHEDULE_TYPE_PATH = "/api/ebuilder/form/formdata/v2/getFormDataList/queryAgendaType";
@@ -110,9 +110,9 @@ async function runScheduleConflictFlow(env, input) {
110
110
  if (!employeeId) {
111
111
  throw meetingValidationError("schedule_employee_required", "\u53D6\u4E0D\u5230\u5F53\u524D\u767B\u5F55\u7528\u6237 id\uFF0C\u65E0\u6CD5\u89E6\u53D1 ESB \u65E5\u7A0B\u67E5\u8BE2");
112
112
  }
113
- const { createEsbHost } = await import("./host-I4NRK4MX.js");
113
+ const { createEsbHost } = await import("./host-FWDOSRH5.js");
114
114
  const { createEsbContinuationSigner } = await import("./continuation-NLECEJPX.js");
115
- const { getEsbOperation } = await import("./registry-KDD7DHNK.js");
115
+ const { getEsbOperation } = await import("./registry-FRJ6H7BT.js");
116
116
  const esbEnv = {
117
117
  ctx: env.ctx,
118
118
  host: createEsbHost(env.ctx),
@@ -2,7 +2,7 @@ import { createRequire as __esbuildCreateRequire } from 'node:module';
2
2
  const require = __esbuildCreateRequire(import.meta.url);
3
3
  import {
4
4
  meetingStateDir
5
- } from "./chunk-5DQEEGCC.js";
5
+ } from "./chunk-Z32KWY6G.js";
6
6
 
7
7
  // src/shortcuts/meeting/operations/eb/cache.ts
8
8
  import { mkdir, readFile, writeFile } from "node:fs/promises";
@@ -9,12 +9,13 @@ import {
9
9
  import {
10
10
  E10ApiError,
11
11
  createE10RequestRuntime,
12
+ isE10SessionExpiredResponse,
12
13
  requireE10Session
13
- } from "./chunk-JUXVYKII.js";
14
+ } from "./chunk-UZZBA6PV.js";
14
15
  import {
15
16
  E10_SESSION_EXPIRED_MESSAGE,
16
17
  getActiveProfile
17
- } from "./chunk-JNG42JKG.js";
18
+ } from "./chunk-OJQUJZQF.js";
18
19
 
19
20
  // src/shortcuts/im/host.ts
20
21
  import { createHash } from "node:crypto";
@@ -149,7 +150,7 @@ function createImHost(ctx, dependencies = {}) {
149
150
  } catch (error) {
150
151
  mapRuntimeNetworkError(error);
151
152
  }
152
- if (response.status === 401 || response.status === 302) {
153
+ if (isE10SessionExpiredResponse(response)) {
153
154
  throw imAuthError("session_expired", E10_SESSION_EXPIRED_MESSAGE, { httpStatus: response.status });
154
155
  }
155
156
  if (response.parseError) {
@@ -205,7 +206,7 @@ function createImHost(ctx, dependencies = {}) {
205
206
  } catch (error) {
206
207
  mapRuntimeNetworkError(error);
207
208
  }
208
- if (response.status === 401 || response.status === 302) {
209
+ if (isE10SessionExpiredResponse(response)) {
209
210
  throw imAuthError("session_expired", E10_SESSION_EXPIRED_MESSAGE);
210
211
  }
211
212
  if (response.status !== 200) {
@@ -24,7 +24,7 @@ import {
24
24
  createFetchTimingSink,
25
25
  hasXiaoEEnv,
26
26
  runWithFetchTiming
27
- } from "./chunk-JNG42JKG.js";
27
+ } from "./chunk-OJQUJZQF.js";
28
28
 
29
29
  // src/shortcuts/workflow/operations/form.ts
30
30
  import { randomUUID } from "node:crypto";
@@ -5448,7 +5448,8 @@ function extractFields(layoutData, requiredMap, disableEditMap, displayMap) {
5448
5448
  const name = String(option.name ?? option.content ?? "").trim();
5449
5449
  if (optionId && name) options.push({ id: optionId, name });
5450
5450
  }
5451
- const isBrowser = Object.keys(browserType).length > 0 || BROWSER_COMPONENTS.has(normalized);
5451
+ const componentBase = normalized.replace(/component$/, "");
5452
+ const isBrowser = Object.keys(browserType).length > 0 || BROWSER_COMPONENTS.has(normalized) || BROWSER_COMPONENTS.has(componentBase);
5452
5453
  const isSelect = SELECT_COMPONENTS.has(normalized) || options.length > 0;
5453
5454
  result.push({
5454
5455
  id: fieldId,
@@ -6378,6 +6379,24 @@ async function buildCreateFormData(workflowId, env, options = {}) {
6378
6379
  if (compsFieldIds.size && !String(f.subFormId ?? "").trim() && !compsFieldIds.has(fid)) continue;
6379
6380
  visibleFields.push(f);
6380
6381
  }
6382
+ const hiddenBySubform = /* @__PURE__ */ new Map();
6383
+ for (const f of fields) {
6384
+ const fid = String(f.id ?? "");
6385
+ const sid = String(f.subFormId ?? "").trim();
6386
+ if (!sid || !hiddenCellIds.has(fid)) continue;
6387
+ hiddenBySubform.set(sid, (hiddenBySubform.get(sid) || 0) + 1);
6388
+ }
6389
+ const survivingSubforms = new Set(
6390
+ visibleFields.map((f) => String(f.subFormId ?? "").trim()).filter(Boolean)
6391
+ );
6392
+ const invisibleSubformWarnings = [];
6393
+ for (const [sid, count] of hiddenBySubform) {
6394
+ if (survivingSubforms.has(sid)) continue;
6395
+ invisibleSubformWarnings.push(
6396
+ `\u660E\u7EC6\u8868 ${sid} \u7684 ${count} \u4E2A\u5B57\u6BB5\u5168\u90E8\u88AB\u5224\u4E3A\u300C\u4E0D\u53EF\u89C1\u300D\uFF08\u8BE5\u660E\u7EC6\u8868\u6240\u5728\u7684\u884C/\u5217\u5728\u8868\u5355\u5E03\u5C40\u91CC\u662F\u9690\u85CF\u7684\uFF09\uFF0C\u56E0\u6B64\u6CA1\u6709\u51FA\u73B0\u5728\u5B57\u6BB5\u6E05\u5355\u91CC\u3002\u8981\u4E48\u5728\u8868\u5355\u8BBE\u8BA1\u5668\u91CC\u628A\u660E\u7EC6\u8868\u632A\u5230\u53EF\u89C1\u884C\uFF0C\u8981\u4E48\u53D6\u6D88\u9690\u85CF\u5B83\u6240\u5728\u7684\u884C/\u5217\uFF0C\u7136\u540E\u91CD\u65B0\u8F7D\u5165\u8868\u5355\u3002`
6397
+ );
6398
+ }
6399
+ let layoutWarning = invisibleSubformWarnings.length ? invisibleSubformWarnings.join("\uFF1B") : null;
6381
6400
  const defaults = normalizeDefaults(layoutData.defaultDetails);
6382
6401
  const systemFieldValues = _normalizeSystemFieldValues(layoutData.businessOperatorObj);
6383
6402
  let linkageActions = Array.isArray(layoutData.linkageActions) ? layoutData.linkageActions : [];
@@ -6419,6 +6438,33 @@ async function buildCreateFormData(workflowId, env, options = {}) {
6419
6438
  }
6420
6439
  }
6421
6440
  const folderOptionValues = _mainValueMap(defaults);
6441
+ const conditionalHiddenSubforms = /* @__PURE__ */ new Set();
6442
+ const conditionalMainFields = /* @__PURE__ */ new Set();
6443
+ const conditionalHints = collectDetailShowLinkages(layoutData.viewLinkages, fields);
6444
+ const fieldShowIds = collectFieldShowLinkageIds(layoutData.viewLinkages);
6445
+ for (const fid of Array.from(mainHidden)) {
6446
+ if (!fieldShowIds.has(fid)) continue;
6447
+ if (hiddenCellIds.has(fid)) continue;
6448
+ const target = visibleFields.find((f) => String(f.id ?? "") === fid);
6449
+ if (!target) continue;
6450
+ conditionalMainFields.add(fid);
6451
+ mainHidden.delete(fid);
6452
+ invisibleSubformWarnings.push(
6453
+ `\u5B57\u6BB5\u300C${target.name}\u300D(${fid}) \u56E0\u663E\u793A\u8054\u52A8\u9690\u85CF\uFF08\u8BE5\u5B57\u6BB5\u672C\u8EAB\u662F\u89E6\u53D1\u5B57\u6BB5\uFF09\uFF0C\u5DF2\u7167\u5E38\u4E0B\u53D1\u5E76\u6807 conditional: true`
6454
+ );
6455
+ }
6456
+ for (const sid of Array.from(hiddenSubforms)) {
6457
+ const hint = conditionalHints.get(sid);
6458
+ if (!hint) continue;
6459
+ const usable = visibleFields.some((f) => String(f.subFormId ?? "") === sid && !hiddenCellIds.has(String(f.id ?? "")));
6460
+ if (!usable) continue;
6461
+ conditionalHiddenSubforms.add(sid);
6462
+ hiddenSubforms.delete(sid);
6463
+ invisibleSubformWarnings.push(
6464
+ `\u660E\u7EC6\u8868 ${sid}${hint.tableName ? `\uFF08${hint.tableName}\uFF09` : ""} \u56E0\u663E\u793A\u8054\u52A8\u9690\u85CF\uFF0C\u89E6\u53D1\u5B57\u6BB5\uFF1A${hint.triggerNames.join("\u3001") || hint.triggerIds.join("\u3001")}\u3002\u8BE5\u8868\u5B57\u6BB5\u5DF2\u7167\u5E38\u4E0B\u53D1\uFF08\u6807 conditional: true\uFF09\uFF0C\u628A\u89E6\u53D1\u5B57\u6BB5\u586B\u4E0A\u540E\u8868\u5355\u91CC\u5C31\u4F1A\u663E\u793A\uFF1B\u4E0D\u8981\u56DE\u300C\u8868\u5355\u91CC\u6CA1\u6709\u8FD9\u5F20\u660E\u7EC6\u8868\u300D\u3002`
6465
+ );
6466
+ }
6467
+ layoutWarning = invisibleSubformWarnings.length ? invisibleSubformWarnings.join("\uFF1B") : null;
6422
6468
  for (const field of visibleFields) {
6423
6469
  const fieldId = String(field.id ?? "");
6424
6470
  const subFormId = String(field.subFormId ?? "");
@@ -6479,6 +6525,8 @@ async function buildCreateFormData(workflowId, env, options = {}) {
6479
6525
  } else if (slimSubFormId) {
6480
6526
  item.subFormId = slimSubFormId;
6481
6527
  }
6528
+ if (slimSubFormId && conditionalHiddenSubforms.has(slimSubFormId)) item.conditional = true;
6529
+ if (!slimSubFormId && conditionalMainFields.has(String(field.id ?? ""))) item.conditional = true;
6482
6530
  item.componentKey = field.componentKey;
6483
6531
  const initialValue = initialValueByFieldId.get(String(field.id ?? ""));
6484
6532
  if (initialValue !== void 0) item.initialValue = initialValue;
@@ -6612,6 +6660,8 @@ async function buildCreateFormData(workflowId, env, options = {}) {
6612
6660
  },
6613
6661
  systemFieldWarning: minorWarning,
6614
6662
  requiredInfoWarning: requiredInfoWarningText(context),
6663
+ // 明细表整表不可见时的告警(见 layoutWarning 注释):有值时**不要**回"表单里没有这张明细表"。
6664
+ layoutWarning,
6615
6665
  // 原 Python 把完整 context 落盘;此处通过 continuation 承载,返回结构保持文档契约。
6616
6666
  continuation: token
6617
6667
  }
@@ -7732,6 +7782,50 @@ function mergeLinkageDetails(merged, linkageDetails) {
7732
7782
  function emptyLinkageVisibility() {
7733
7783
  return [/* @__PURE__ */ new Set(), {}, {}, {}];
7734
7784
  }
7785
+ function collectFieldShowLinkageIds(linkages) {
7786
+ const out = /* @__PURE__ */ new Set();
7787
+ if (!Array.isArray(linkages)) return out;
7788
+ for (const rule of linkages) {
7789
+ const details = Array.isArray(rule?.linkageDetails) ? rule.linkageDetails : [];
7790
+ for (const detail of details) {
7791
+ if (!detail || typeof detail !== "object") continue;
7792
+ if (String(detail.linkageObj ?? "") !== "field") continue;
7793
+ if (String(detail.linkageProp ?? "") !== "show") continue;
7794
+ const fid = String(detail.linkageValue ?? "").trim();
7795
+ if (fid) out.add(fid);
7796
+ }
7797
+ }
7798
+ return out;
7799
+ }
7800
+ function collectDetailShowLinkages(linkages, fields) {
7801
+ const out = /* @__PURE__ */ new Map();
7802
+ if (!Array.isArray(linkages)) return out;
7803
+ const list = Array.isArray(fields) ? fields : [];
7804
+ const nameOf = (id) => {
7805
+ for (const f of list) {
7806
+ if (String(f?.id ?? "") === id) return String(f?.name ?? id);
7807
+ }
7808
+ return id;
7809
+ };
7810
+ for (const rule of linkages) {
7811
+ const details = Array.isArray(rule?.linkageDetails) ? rule.linkageDetails : [];
7812
+ for (const detail of details) {
7813
+ if (!detail || typeof detail !== "object") continue;
7814
+ if (String(detail.linkageObj ?? "") !== "detail") continue;
7815
+ if (String(detail.linkageProp ?? "") !== "show") continue;
7816
+ const sid = String(detail.linkageValue ?? "").trim();
7817
+ if (!sid) continue;
7818
+ const conds = Array.isArray(rule?.condition?.conditionDetails) ? rule.condition.conditionDetails : [];
7819
+ const triggerIds = conds.map((c) => String(c?.targetId ?? "").trim()).filter(Boolean);
7820
+ out.set(sid, {
7821
+ triggerIds,
7822
+ triggerNames: triggerIds.map(nameOf),
7823
+ tableName: nameOf(sid) === sid ? "" : nameOf(sid)
7824
+ });
7825
+ }
7826
+ }
7827
+ return out;
7828
+ }
7735
7829
  function computeLinkageVisibility(linkages, entries, defaults, linkageDetails, systemFieldValues, fields) {
7736
7830
  const hiddenSubforms = /* @__PURE__ */ new Set();
7737
7831
  const rowHidden = {};
@@ -8434,7 +8528,8 @@ async function runCreateRequest(args, env, options = {}) {
8434
8528
  }
8435
8529
  const [details, valueAmbiguities, preview] = await resolveEntryValues(env, entries, context.layout.form_id);
8436
8530
  const merged = mergeDetails(context.defaults || [], details);
8437
- const isXiaoE = hasXiaoEEnv(env.ctx.env, env.ctx.getGlobalOptions?.());
8531
+ const forceServerSubmit = args.forceServerSubmit === true;
8532
+ const isXiaoE = forceServerSubmit ? false : hasXiaoEEnv(env.ctx.env, env.ctx.getGlobalOptions?.());
8438
8533
  const linkageDetails = isXiaoE ? [] : await runFieldLinkage(env, linkageContextFromPayload(context), entries, null, merged, false, context.defaults || []);
8439
8534
  const merged2 = fillDetailDefaultsByRow(
8440
8535
  mergeLinkageDetails(merged, linkageDetails),
@@ -8,11 +8,11 @@ import {
8
8
  import {
9
9
  createE10RequestRuntime,
10
10
  requireE10Session
11
- } from "./chunk-JUXVYKII.js";
11
+ } from "./chunk-UZZBA6PV.js";
12
12
  import {
13
13
  E10_SESSION_EXPIRED_MESSAGE,
14
14
  getActiveProfile
15
- } from "./chunk-JNG42JKG.js";
15
+ } from "./chunk-OJQUJZQF.js";
16
16
 
17
17
  // src/shortcuts/workflow/host.ts
18
18
  var DEFAULT_TIMEOUT_MS = 3e4;
@@ -754,12 +754,6 @@ function packageFileUrl(...segments) {
754
754
  return pathToFileURL(packagePath(...segments));
755
755
  }
756
756
 
757
- // src/internal/e10/auth/xiaoe.ts
758
- import { execFile } from "node:child_process";
759
- import { accessSync, constants as fsConstants, existsSync as existsSync4, readFileSync as readFileSync3, readdirSync as readdirSync2, statSync } from "node:fs";
760
- import { homedir as homedir2 } from "node:os";
761
- import { join as join2 } from "node:path";
762
-
763
757
  // src/core/runtime-agent.ts
764
758
  var XIAOE_RUNTIME_AGENT_ALIASES = /* @__PURE__ */ new Set([
765
759
  "xiaoe",
@@ -781,6 +775,10 @@ function isXiaoERuntime(options) {
781
775
  }
782
776
 
783
777
  // src/internal/e10/auth/xiaoe.ts
778
+ import { execFile } from "node:child_process";
779
+ import { accessSync, constants as fsConstants, existsSync as existsSync4, readFileSync as readFileSync3, readdirSync as readdirSync2, statSync } from "node:fs";
780
+ import { homedir as homedir2 } from "node:os";
781
+ import { join as join2 } from "node:path";
784
782
  var DEFAULT_E10_BASE_URL = "https://www.e-cology.com.cn";
785
783
  var XIAOE_AGENT_TYPE = "XiaoE";
786
784
  var XIAOE_UNIFIED_LOGIN_MAP_ENV_KEYS = [
@@ -12,12 +12,13 @@ import {
12
12
  import {
13
13
  E10ApiError,
14
14
  createE10RequestRuntime,
15
+ isE10SessionExpiredResponse,
15
16
  requireE10Session
16
- } from "./chunk-JUXVYKII.js";
17
+ } from "./chunk-UZZBA6PV.js";
17
18
  import {
18
19
  E10_SESSION_EXPIRED_MESSAGE,
19
20
  getActiveProfile
20
- } from "./chunk-JNG42JKG.js";
21
+ } from "./chunk-OJQUJZQF.js";
21
22
 
22
23
  // src/shortcuts/esb/host.ts
23
24
  var ESB_PATHS = {
@@ -125,7 +126,7 @@ function createEsbHost(ctx, dependencies = {}) {
125
126
  } catch (error) {
126
127
  mapRuntimeNetworkError(error);
127
128
  }
128
- if (response.status === 401 || response.status === 302) {
129
+ if (isE10SessionExpiredResponse(response)) {
129
130
  throw esbAuthError(
130
131
  "session_expired",
131
132
  E10_SESSION_EXPIRED_MESSAGE,