weaver-work-cli 0.1.59 → 0.1.61

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 (124) hide show
  1. package/dist/chunks/{archive-4SQAVTIB.js → archive-S2VKZWQ3.js} +2 -2
  2. package/dist/chunks/{archive-oa-W2UEJ67L.js → archive-oa-HEDSIUUY.js} +2 -2
  3. package/dist/chunks/{asset-EGZEABBI.js → asset-HYH4W357.js} +2 -2
  4. package/dist/chunks/{asset-idle-EBUZBB6M.js → asset-idle-N7REBNGL.js} +2 -2
  5. package/dist/chunks/{attachment-content-TP6WDNC6.js → attachment-content-VYYA75FR.js} +3 -3
  6. package/dist/chunks/{blog-2YKMWOWI.js → blog-SLMZZICV.js} +2 -2
  7. package/dist/chunks/{caizhilian-5NM4X5HG.js → caizhilian-RV43KKBT.js} +4 -4
  8. package/dist/chunks/{calendar-H4QTJCUY.js → calendar-DMVZ4OLY.js} +2 -2
  9. package/dist/chunks/{chunk-QNPIY5R6.js → chunk-6XSSAUNW.js} +4 -4
  10. package/dist/chunks/{chunk-AQOPPNTR.js → chunk-BIA2NKUG.js} +4 -4
  11. package/dist/chunks/{chunk-VMCCRWFO.js → chunk-BQYX2UX5.js} +2 -2
  12. package/dist/chunks/{chunk-CI2RF3AJ.js → chunk-DTCQFTHW.js} +1 -1
  13. package/dist/chunks/{chunk-I3BFBBP2.js → chunk-E5YD5JWR.js} +1 -1
  14. package/dist/chunks/{chunk-PH7N4UFT.js → chunk-EGANE35F.js} +1 -1
  15. package/dist/chunks/{chunk-Z4IPY5GV.js → chunk-H6YOMI3U.js} +2 -2
  16. package/dist/chunks/{chunk-U2DWV6JC.js → chunk-ILALC2N6.js} +1 -1
  17. package/dist/chunks/{chunk-WINR2Q6K.js → chunk-KXJA42EA.js} +86 -19
  18. package/dist/chunks/{chunk-CQ4OVCKG.js → chunk-KY3R42RS.js} +2 -2
  19. package/dist/chunks/{chunk-WVH5ESDA.js → chunk-NRYDJN4J.js} +1 -1
  20. package/dist/chunks/{chunk-TGM7BWEH.js → chunk-P6TXQK75.js} +2 -2
  21. package/dist/chunks/{chunk-6YWHRXEQ.js → chunk-QBDXJS2W.js} +119 -9
  22. package/dist/chunks/{chunk-2IGZUMNG.js → chunk-SHX7XBYR.js} +180 -18
  23. package/dist/chunks/{chunk-XR5BGFNT.js → chunk-T2KVJFWJ.js} +10 -4
  24. package/dist/chunks/{chunk-FMNCSYIG.js → chunk-TEZHIB6T.js} +2 -2
  25. package/dist/chunks/{chunk-2FHP4PYS.js → chunk-UBGWIXU3.js} +116 -40
  26. package/dist/chunks/{chunk-5N222HK6.js → chunk-UBRWONP4.js} +2 -2
  27. package/dist/chunks/{chunk-MQBMMJUV.js → chunk-UQFPF4EX.js} +2 -2
  28. package/dist/chunks/{chunk-4GG72JAT.js → chunk-V2LASYKO.js} +2 -2
  29. package/dist/chunks/{chunk-FM7B5BIR.js → chunk-VBFBMM7G.js} +61 -53
  30. package/dist/chunks/{chunk-ZHPCNM2S.js → chunk-VNYOUAWV.js} +11 -11
  31. package/dist/chunks/{chunk-SFM3M2L3.js → chunk-WIWDVETN.js} +19 -3
  32. package/dist/chunks/{chunk-44KJ7WFA.js → chunk-XT77MP54.js} +2 -2
  33. package/dist/chunks/chunk-YI2YMW5N.js +111 -0
  34. package/dist/chunks/{conflict-Y3ESXYIA.js → conflict-GFJRS6I7.js} +2 -2
  35. package/dist/chunks/{contract-LLRKMLQQ.js → contract-U3ZGNRWB.js} +2 -2
  36. package/dist/chunks/{cowork-2RDFBZWB.js → cowork-EX7PKIDK.js} +2 -2
  37. package/dist/chunks/{create-flow-JHQSA6JF.js → create-flow-EJZD434E.js} +6 -6
  38. package/dist/chunks/{data-ZVS3BWPT.js → data-FOODGAMF.js} +278 -123
  39. package/dist/chunks/{ebuilder-form-TWSXS5NA.js → ebuilder-form-I2EOKODG.js} +5 -5
  40. package/dist/chunks/{ehr-52GBKNJR.js → ehr-TE4RFNID.js} +2 -2
  41. package/dist/chunks/entry-mode-ZOLSXEGX.js +19 -0
  42. package/dist/chunks/{env-LQBLL3MZ.js → env-TID5NFR6.js} +2 -2
  43. package/dist/chunks/{esb-HJSXCEOM.js → esb-7L6MHYLB.js} +4 -4
  44. package/dist/chunks/{factory-X7PN6B3B.js → factory-OG7BPMH5.js} +1 -1
  45. package/dist/chunks/{fna-OBACRT3J.js → fna-6V2ENR3Y.js} +2 -2
  46. package/dist/chunks/{group-chat-PPFY7SPV.js → group-chat-5DKPWIHL.js} +3 -3
  47. package/dist/chunks/{host-TTSGY5NZ.js → host-3DLYA54R.js} +3 -3
  48. package/dist/chunks/{host-KJT3G5D2.js → host-GOJHHTPY.js} +3 -3
  49. package/dist/chunks/{host-KOWUMNAY.js → host-OGBHL75G.js} +3 -3
  50. package/dist/chunks/{host-MFXRA2MY.js → host-ONZC6AE7.js} +3 -3
  51. package/dist/chunks/{host-W4JCNRFS.js → host-TJ5VVHM7.js} +3 -3
  52. package/dist/chunks/{host-2BKMPWDH.js → host-VTPAWDZV.js} +3 -3
  53. package/dist/chunks/{hrm-AK3WGBMN.js → hrm-2N7NFQDZ.js} +3 -3
  54. package/dist/chunks/{im-JZSBPO4Z.js → im-XCH47ZBN.js} +3 -3
  55. package/dist/chunks/{invoice-6XDMPCWB.js → invoice-XQRKMGNY.js} +3 -3
  56. package/dist/chunks/{jiuchuanhui-K4EQU6GK.js → jiuchuanhui-PL6DRPBM.js} +2 -2
  57. package/dist/chunks/{lazy-dispatch-GCA6HDOB.js → lazy-dispatch-UATEN7H7.js} +5 -5
  58. package/dist/chunks/{mail-IKVCQCVZ.js → mail-Q7Z4CQ4D.js} +2 -2
  59. package/dist/chunks/{meeting-GMRQZFJP.js → meeting-5E3BNARL.js} +13 -12
  60. package/dist/chunks/{minute-doc-JXH3MNC7.js → minute-doc-NXRE5C77.js} +4 -4
  61. package/dist/chunks/{okr-KV43FPPX.js → okr-3O3XNYOK.js} +2 -2
  62. package/dist/chunks/{operations-6NXJ7RTE.js → operations-EZWG72FH.js} +4 -4
  63. package/dist/chunks/performance-Y7CPNSOR.js +1295 -0
  64. package/dist/chunks/{plan-WOYR4WEG.js → plan-BLGPZF5M.js} +2 -2
  65. package/dist/chunks/{project-CQJKBUIL.js → project-6MZMLJMP.js} +2 -2
  66. package/dist/chunks/{reception-MPBU3JXC.js → reception-F2VT2X52.js} +2 -2
  67. package/dist/chunks/{recruit-stage-USTTRHOX.js → recruit-stage-4ETIBMIW.js} +2 -2
  68. package/dist/chunks/{registry-GURQG4ZV.js → registry-3FYSWV3U.js} +3 -3
  69. package/dist/chunks/{registry-SS5J2FZQ.js → registry-7RS74TCK.js} +4 -4
  70. package/dist/chunks/{registry-WZCCBI5L.js → registry-I4DVPDMU.js} +11 -10
  71. package/dist/chunks/{room-recommend-CKU5NF2E.js → room-recommend-GWCVKCXW.js} +4 -4
  72. package/dist/chunks/{schedule-DEFAO2RY.js → schedule-6AN63MJQ.js} +4 -4
  73. package/dist/chunks/{smart-extract-APX2PNIN.js → smart-extract-SR4SJJKN.js} +3 -3
  74. package/dist/chunks/{workflow-WMPW3WSB.js → workflow-KF7FA2UQ.js} +7 -7
  75. package/dist/cmd/refs/index.js +124 -4
  76. package/dist/core/output.js +199 -26
  77. package/dist/core/refs.js +36 -0
  78. package/dist/index.js +38 -33
  79. package/dist/internal/e10/auth/xiaoe.js +25 -3
  80. package/dist/shortcuts/caizhilian/operations/files.js +86 -15
  81. package/dist/shortcuts/data/index.js +12 -2
  82. package/dist/shortcuts/data/manifest.js +4 -2
  83. package/dist/shortcuts/data/operations/attribution.js +229 -0
  84. package/dist/shortcuts/data/operations/ds.js +87 -92
  85. package/dist/shortcuts/data/operations/index.js +3 -1
  86. package/dist/shortcuts/index.js +5 -0
  87. package/dist/shortcuts/meeting/operations/eb/create-flow.js +111 -12
  88. package/dist/shortcuts/meeting/operations/eb/entry-mode.js +116 -0
  89. package/dist/shortcuts/meeting/operations/eb/index.js +2 -0
  90. package/dist/shortcuts/meeting/operations/eb/room-recommend.js +11 -0
  91. package/dist/shortcuts/meeting/operations/registry.js +4 -0
  92. package/dist/shortcuts/performance/continuation.js +74 -0
  93. package/dist/shortcuts/performance/errors.js +65 -0
  94. package/dist/shortcuts/performance/host.js +105 -0
  95. package/dist/shortcuts/performance/index.js +109 -0
  96. package/dist/shortcuts/performance/manifest.js +30 -0
  97. package/dist/shortcuts/performance/operations/hrm-resolve.js +114 -0
  98. package/dist/shortcuts/performance/operations/registry.js +44 -0
  99. package/dist/shortcuts/performance/operations/scheme-detail.js +70 -0
  100. package/dist/shortcuts/performance/operations/scheme-draft.js +116 -0
  101. package/dist/shortcuts/performance/operations/scheme-publish.js +158 -0
  102. package/dist/shortcuts/performance/operations/types.js +32 -0
  103. package/dist/shortcuts/performance/scheme-validate.js +307 -0
  104. package/dist/shortcuts/performance/shared.js +158 -0
  105. package/docs/agent-io-channel-design.md +67 -3
  106. package/docs/data.md +2 -1
  107. package/package.json +1 -1
  108. package/scripts/xiaoe_env.py +6 -1
  109. package/skill-template/business-info.json +19 -0
  110. package/skill-template/domains/performance.md +18 -0
  111. package/skills/weaver-e10-caizhilian/SKILL.md +1 -1
  112. package/skills/weaver-e10-data/references/datasource.md +2 -1
  113. package/skills/weaver-e10-meeting/SKILL.md +16 -3
  114. package/skills/weaver-e10-performance/SKILL.md +202 -0
  115. package/skills/weaver-e10-performance/agents/openai.yaml +74 -0
  116. package/skills/weaver-e10-performance/references/default-assembly.md +108 -0
  117. package/skills/weaver-e10-performance/references/entity-resolution.md +69 -0
  118. package/skills/weaver-e10-performance/references/enums-and-normalization.md +80 -0
  119. package/skills/weaver-e10-performance/references/examples.md +146 -0
  120. package/skills/weaver-e10-performance/references/extraction-guide.md +144 -0
  121. package/skills/weaver-e10-performance/references/scheme-edit-req-fields.md +185 -0
  122. package/skills/weaver-e10-performance/references/scheme-setting-page.md +62 -0
  123. package/skills/weaver-e10-performance/scripts/parse_appraisal_doc.py +483 -0
  124. package/skills/weaver-e10-shared/references/json-output-contract.md +5 -0
@@ -297,6 +297,35 @@ function pruneRefs(ctx, options = {}) {
297
297
  cleanupIncomplete
298
298
  };
299
299
  }
300
+ function readWindow(items, offset, limit) {
301
+ const total = items.length;
302
+ const start = Math.min(Math.max(Math.floor(offset) || 0, 0), total);
303
+ const size = Math.max(Math.floor(limit) || 0, 1);
304
+ const end = Math.min(start + size, total);
305
+ return {
306
+ offset: start,
307
+ returned: end - start,
308
+ total,
309
+ hasMore: end < total,
310
+ ...end < total ? { nextOffset: end } : {},
311
+ items: items.slice(start, end)
312
+ };
313
+ }
314
+ function readTextWindow(text, charOffset, charLimit) {
315
+ const chars = Array.from(text);
316
+ const totalChars = chars.length;
317
+ const start = Math.min(Math.max(Math.floor(charOffset) || 0, 0), totalChars);
318
+ const size = Math.max(Math.floor(charLimit) || 0, 1);
319
+ const end = Math.min(start + size, totalChars);
320
+ return {
321
+ charOffset: start,
322
+ returnedChars: end - start,
323
+ totalChars,
324
+ hasMore: end < totalChars,
325
+ ...end < totalChars ? { nextCharOffset: end } : {},
326
+ text: chars.slice(start, end).join("")
327
+ };
328
+ }
300
329
  function pickValue(value, path) {
301
330
  let cursor = value;
302
331
  let tokens = tokenizePath(path);
@@ -372,12 +401,20 @@ var DEFAULT_RESULT_THRESHOLD_BYTES = 24 * 1024;
372
401
  var DEFAULT_REF_TTL_MS = 30 * 6e4;
373
402
  var DEFAULT_REF_MAX_COUNT = 50;
374
403
  var DEFAULT_REF_MAX_BYTES = 200 * 1024 * 1024;
404
+ var KEEP_ALL = Number.MAX_SAFE_INTEGER;
375
405
  var COMPACT_TIERS = [
376
- { array: 10, string: 200 },
377
- { array: 5, string: 80 },
378
- { array: 2, string: 40 },
406
+ { array: KEEP_ALL, string: 200 },
407
+ { array: KEEP_ALL, string: 80 },
408
+ { array: KEEP_ALL, string: 40 },
409
+ { array: 50, string: 40 },
410
+ { array: 20, string: 40 },
411
+ { array: 10, string: 40 },
412
+ { array: 5, string: 20 },
413
+ { array: 2, string: 20 },
379
414
  { array: 1, string: 20 }
380
415
  ];
416
+ var MAX_OMISSION_ENTRIES = 6;
417
+ var MAX_OMISSION_IN_NOTICE = 2;
381
418
  function numberFromEnv(name) {
382
419
  const raw = process.env[name];
383
420
  if (raw === void 0 || raw.trim() === "") return void 0;
@@ -422,34 +459,83 @@ function isLinkField(key) {
422
459
  if (!key) return false;
423
460
  return /(?:^|[a-z0-9])(?:url|urls|uri|href|link|links)$/i.test(key);
424
461
  }
425
- function compactValue(value, arrayLimit, stringLimit, depth = 0, key) {
462
+ function isIntegrityField(key) {
463
+ if (!key) return false;
464
+ const normalized = key.replace(/[^a-z0-9]/gi, "").toLowerCase();
465
+ return [
466
+ "id",
467
+ "ids",
468
+ "fid",
469
+ "uuid",
470
+ "guid",
471
+ "code",
472
+ "codes",
473
+ "number",
474
+ "numbers",
475
+ "no",
476
+ "status",
477
+ "state",
478
+ "amount",
479
+ "total",
480
+ "count",
481
+ "date",
482
+ "time",
483
+ "timestamp",
484
+ "hash",
485
+ "sha256",
486
+ "hasmore",
487
+ "offset",
488
+ "limit",
489
+ "pagesize",
490
+ "pageno",
491
+ "nextoffset",
492
+ "nextpagetoken"
493
+ ].some((suffix) => normalized === suffix || normalized.endsWith(suffix));
494
+ }
495
+ function childPath(path, key) {
496
+ return path ? `${path}.${key}` : key;
497
+ }
498
+ function compactValue(value, arrayLimit, stringLimit, depth = 0, key, path = "", sink) {
426
499
  if (depth > 6) return "<omitted: too deep>";
427
- const limit = isLinkField(key) ? Number.MAX_SAFE_INTEGER : stringLimit;
500
+ const limit = isLinkField(key) || isIntegrityField(key) ? Number.MAX_SAFE_INTEGER : stringLimit;
428
501
  if (typeof value === "string") {
429
- return value.length > limit ? `${value.slice(0, limit)}\u2026(truncated ${value.length - limit} chars)` : value;
502
+ if (value.length > limit) {
503
+ const chars = Array.from(value);
504
+ if (chars.length <= limit) return value;
505
+ sink?.({ path, kind: "string", total: chars.length, shown: limit });
506
+ return `${chars.slice(0, limit).join("")}\u2026(truncated ${chars.length - limit} chars)`;
507
+ }
508
+ return value;
430
509
  }
431
510
  if (Array.isArray(value)) {
432
- return value.slice(0, arrayLimit).map((item) => compactValue(item, arrayLimit, limit, depth + 1, key));
511
+ if (value.length > arrayLimit) {
512
+ sink?.({ path, kind: "array", total: value.length, shown: arrayLimit });
513
+ }
514
+ return value.slice(0, arrayLimit).map((item, index) => compactValue(item, arrayLimit, limit, depth + 1, key, `${path}[${index}]`, sink));
433
515
  }
434
516
  if (value && typeof value === "object") {
435
517
  const out = {};
436
518
  for (const [name, inner] of Object.entries(value)) {
437
- out[name] = compactValue(inner, arrayLimit, stringLimit, depth + 1, name);
519
+ out[name] = compactValue(inner, arrayLimit, stringLimit, depth + 1, name, childPath(path, name), sink);
438
520
  }
439
521
  return out;
440
522
  }
441
523
  return value;
442
524
  }
443
- function compactRecord(value, budgetBytes, keepKeys) {
525
+ function compactRecord(value, budgetBytes, keepKeys, sink) {
444
526
  let current = value;
527
+ let last = [];
445
528
  for (const tier of COMPACT_TIERS) {
446
529
  const out = {};
530
+ const truncations = [];
447
531
  for (const [key, inner] of Object.entries(value)) {
448
- out[key] = keepKeys.includes(key) ? inner : compactValue(inner, tier.array, tier.string);
532
+ out[key] = keepKeys.includes(key) ? inner : compactValue(inner, tier.array, tier.string, 0, key, key, (item) => truncations.push(item));
449
533
  }
450
534
  current = out;
451
- if (bytesOf(out) <= budgetBytes) return out;
535
+ last = truncations;
536
+ if (bytesOf(out) <= budgetBytes) break;
452
537
  }
538
+ for (const item of last) sink?.(item);
453
539
  return current;
454
540
  }
455
541
  function skeletonOf(value, keepKeys, hasRef = true) {
@@ -512,33 +598,107 @@ function withLeadingMeta(value, leading, body, extraWarnings) {
512
598
  warnings: [...compactWarnings, ...extraWarnings]
513
599
  };
514
600
  }
601
+ function byOmitted(left, right) {
602
+ return right.total - right.shown - (left.total - left.shown);
603
+ }
604
+ function normalizePath(path) {
605
+ return path.replace(/\[\d+\]/g, "[]");
606
+ }
607
+ function dedupeByTemplate(truncations) {
608
+ const seen = /* @__PURE__ */ new Map();
609
+ for (const item of [...truncations].sort(byOmitted)) {
610
+ const key = `${item.kind}:${normalizePath(item.path)}`;
611
+ if (!seen.has(key)) seen.set(key, item);
612
+ }
613
+ return [...seen.values()];
614
+ }
615
+ function describeTruncations(truncations) {
616
+ const groups = dedupeByTemplate(truncations);
617
+ const arrays = groups.filter((item) => item.kind === "array");
618
+ const strings = groups.filter((item) => item.kind === "string");
619
+ const parts = [];
620
+ for (const item of arrays.slice(0, MAX_OMISSION_IN_NOTICE)) {
621
+ parts.push(`${normalizePath(item.path)} \u5171 ${item.total} \u6761\uFF0C\u4EC5\u663E\u793A ${item.shown} \u6761`);
622
+ }
623
+ for (const item of strings.slice(0, MAX_OMISSION_IN_NOTICE)) {
624
+ parts.push(`${normalizePath(item.path)} \u5171 ${item.total} \u5B57\u7B26\uFF0C\u4EC5\u4FDD\u7559\u524D ${item.shown} \u5B57\u7B26`);
625
+ }
626
+ if (!parts.length) return "";
627
+ const hidden = groups.length - parts.length;
628
+ return hidden > 0 ? `${parts.join("\uFF1B")}\uFF1B\u53E6\u6709 ${hidden} \u5904\u88AB\u622A\u65AD` : parts.join("\uFF1B");
629
+ }
630
+ function previewOmittedOf(truncations) {
631
+ const arrays = dedupeByTemplate(truncations).filter((item) => item.kind === "array").sort(byOmitted).slice(0, MAX_OMISSION_ENTRIES);
632
+ if (!arrays.length) return void 0;
633
+ return Object.fromEntries(arrays.map((item) => [
634
+ normalizePath(item.path),
635
+ { total: item.total, shown: item.shown }
636
+ ]));
637
+ }
638
+ function previewTruncatedFieldsOf(truncations) {
639
+ const strings = dedupeByTemplate(truncations).filter((item) => item.kind === "string").sort(byOmitted).slice(0, MAX_OMISSION_ENTRIES);
640
+ if (!strings.length) return void 0;
641
+ return Object.fromEntries(strings.map((item) => [
642
+ normalizePath(item.path),
643
+ { unit: "chars", total: item.total, shown: item.shown }
644
+ ]));
645
+ }
646
+ function withTruncationNotice(leading, truncations) {
647
+ const detail = describeTruncations(truncations);
648
+ if (!detail) return leading;
649
+ const refId = String(leading.refId ?? "<refId>");
650
+ const recovery = leading.resultPersisted === true ? `\u53D6\u5168\u91CF\u7528 --input-ref ${refId}\uFF0C\u6216 refs get ${refId} <\u5B57\u6BB5\u8DEF\u5F84>\u3002` : "\u5B8C\u6574\u7ED3\u679C\u672A\u80FD\u6682\u5B58\uFF0C\u65E0\u6CD5\u6062\u590D\u3002";
651
+ const notice = `${String(leading.largeOutputNotice ?? "")}\u26A0\uFE0F stdout \u4EC5\u4E3A\u9884\u89C8\uFF0C\u4E0D\u662F\u5168\u91CF\uFF1A${detail}\u3002${recovery}`;
652
+ const omitted = previewOmittedOf(truncations);
653
+ const truncatedFields = previewTruncatedFieldsOf(truncations);
654
+ return {
655
+ ...leading,
656
+ ...omitted ? { previewOmitted: omitted } : {},
657
+ ...truncatedFields ? { previewTruncatedFields: truncatedFields } : {},
658
+ largeOutputNotice: notice
659
+ };
660
+ }
515
661
  function slimmedBody(value, threshold, hasRef) {
516
662
  const base = value && typeof value === "object" && !Array.isArray(value) ? value : { data: value };
517
- const compacted = compactRecord(base, threshold, ENVELOPE_KEEP_KEYS);
518
- if (bytesOf(compacted) <= threshold) return compacted;
519
- return skeletonOf(base, ENVELOPE_KEEP_KEYS, hasRef);
663
+ const truncations = [];
664
+ const compacted = compactRecord(base, threshold, ENVELOPE_KEEP_KEYS, (item) => truncations.push(item));
665
+ if (bytesOf(compacted) <= threshold) return { body: compacted, truncations };
666
+ return { body: skeletonOf(base, ENVELOPE_KEEP_KEYS, hasRef), truncations: skeletonTruncations(base) };
667
+ }
668
+ function skeletonTruncations(base) {
669
+ const out = [];
670
+ for (const [key, inner] of Object.entries(base)) {
671
+ if (Array.isArray(inner) && inner.length > 0 && !ENVELOPE_KEEP_KEYS.includes(key)) {
672
+ out.push({ path: key, kind: "array", total: inner.length, shown: 0 });
673
+ }
674
+ }
675
+ return out;
520
676
  }
521
677
  function fitEnvelope(value, leading, extraWarnings, budgetBytes) {
522
678
  const hasRef = leading.resultPersisted === true;
523
- const body = slimmedBody(value, budgetBytes, hasRef);
524
- let envelope = withLeadingMeta(value, leading, body, extraWarnings);
679
+ const { body, truncations } = slimmedBody(value, budgetBytes, hasRef);
680
+ let envelope = withLeadingMeta(value, withTruncationNotice(leading, truncations), body, extraWarnings);
525
681
  if (bytesOf(envelope) <= budgetBytes) return envelope;
526
682
  const base = value && typeof value === "object" && !Array.isArray(value) ? value : { data: value };
527
683
  envelope = withLeadingMeta(
528
684
  value,
529
- leading,
685
+ withTruncationNotice(leading, skeletonTruncations(base)),
530
686
  skeletonOf(base, ENVELOPE_KEEP_KEYS, leading.resultPersisted === true),
531
687
  extraWarnings
532
688
  );
533
689
  if (bytesOf(envelope) <= budgetBytes) return envelope;
534
690
  const persisted = leading.resultPersisted === true;
535
691
  const refId = String(leading.refId ?? "").slice(0, 80);
692
+ const finalOmitted = previewOmittedOf(skeletonTruncations(base));
693
+ const finalNotice = persisted ? `\u7ED3\u679C\u5DF2\u7CBE\u7B80\uFF0C\u4F7F\u7528 --input-ref ${refId} \u8BFB\u53D6\u3002` : "\u7ED3\u679C\u65E0\u6CD5\u6682\u5B58\uFF1Bstdout \u4EC5\u4FDD\u7559\u7CBE\u7B80\u5185\u5BB9\uFF0C\u5B8C\u6574\u7ED3\u679C\u4E0D\u53EF\u6062\u590D\u3002";
694
+ const finalDetail = describeTruncations(skeletonTruncations(base));
536
695
  return {
537
696
  ...persisted ? { refId } : {},
538
697
  resultPersisted: persisted,
539
698
  outputBytes: Number(leading.outputBytes) || 0,
540
- largeOutputNotice: persisted ? `\u7ED3\u679C\u5DF2\u7CBE\u7B80\uFF0C\u4F7F\u7528 --input-ref ${refId} \u8BFB\u53D6\u3002` : "\u7ED3\u679C\u65E0\u6CD5\u6682\u5B58\uFF1Bstdout \u4EC5\u4FDD\u7559\u7CBE\u7B80\u5185\u5BB9\uFF0C\u5B8C\u6574\u7ED3\u679C\u4E0D\u53EF\u6062\u590D\u3002",
699
+ largeOutputNotice: finalDetail ? `${finalNotice}\u26A0\uFE0F \u9884\u89C8\u4E0D\u662F\u5168\u91CF\uFF1A${finalDetail}\u3002` : finalNotice,
541
700
  previewTruncated: true,
701
+ ...finalOmitted ? { previewOmitted: finalOmitted } : {},
542
702
  schemaVersion: typeof base.schemaVersion === "number" || typeof base.schemaVersion === "string" ? String(base.schemaVersion).slice(0, 20) : 1,
543
703
  ok: typeof base.ok === "boolean" ? base.ok : true,
544
704
  ...typeof base.operation === "string" ? { operation: base.operation.slice(0, 80) } : {},
@@ -660,6 +820,8 @@ export {
660
820
  readRef,
661
821
  listRefs,
662
822
  pruneRefs,
823
+ readWindow,
824
+ readTextWindow,
663
825
  pickValue,
664
826
  resolveRefInput,
665
827
  DEFAULT_RESULT_THRESHOLD_BYTES,
@@ -4,7 +4,7 @@ import {
4
4
  cacheScopeSuffix,
5
5
  readCache,
6
6
  writeCache
7
- } from "./chunk-U2DWV6JC.js";
7
+ } from "./chunk-ILALC2N6.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-CI2RF3AJ.js";
16
+ } from "./chunk-DTCQFTHW.js";
17
17
 
18
18
  // src/shortcuts/meeting/operations/eb/usage-cache.ts
19
19
  var USAGE_TTL_MS = 5 * 60 * 1e3;
@@ -88,7 +88,7 @@ async function clearCache(env, key) {
88
88
  try {
89
89
  const { rm } = await import("node:fs/promises");
90
90
  const { join } = await import("node:path");
91
- const { meetingStateDir } = await import("./env-LQBLL3MZ.js");
91
+ const { meetingStateDir } = await import("./env-TID5NFR6.js");
92
92
  await rm(join(meetingStateDir(env.ctx), "cache", `${key}.json`), { force: true });
93
93
  } catch {
94
94
  }
@@ -221,7 +221,7 @@ async function loadFrequentRooms(env, options = {}) {
221
221
  const counts = /* @__PURE__ */ new Map();
222
222
  let requests = 0;
223
223
  try {
224
- const { getMeetingOperation } = await import("./registry-WZCCBI5L.js");
224
+ const { getMeetingOperation } = await import("./registry-I4DVPDMU.js");
225
225
  const listOp = getMeetingOperation("meeting.eb.meeting.list");
226
226
  let seen = 0;
227
227
  let total = 0;
@@ -298,6 +298,7 @@ async function recommendRooms(env, input) {
298
298
  const usable = roomData.rooms.filter((room) => room.status === "0");
299
299
  let busyCount = 0;
300
300
  const candidates = [];
301
+ const purposeHitIds = /* @__PURE__ */ new Set();
301
302
  for (const room of usable) {
302
303
  const isBusy = busy.ids.has(room.id);
303
304
  if (isBusy) {
@@ -349,6 +350,7 @@ async function recommendRooms(env, input) {
349
350
  if (hostHit) {
350
351
  reasons.push(`\u5E26\u5BA2\u6237\u4F18\u5148\uFF1A${descHit ? `\u63CF\u8FF0\u542B\u300C${desc.slice(0, 30)}\u300D` : `\u540D\u79F0\u542B\u300C${hostHit[1]}\u300D`}`);
351
352
  score += 35;
353
+ if (!isBusy) purposeHitIds.add(room.id);
352
354
  }
353
355
  }
354
356
  if (isBusy) {
@@ -371,6 +373,10 @@ async function recommendRooms(env, input) {
371
373
  reasons
372
374
  });
373
375
  }
376
+ if (requirement.hasCustomer === true && purposeHitIds.size > 0) {
377
+ const preferred = candidates.filter((candidate) => purposeHitIds.has(candidate.id));
378
+ if (preferred.length > 0) candidates.splice(0, candidates.length, ...preferred);
379
+ }
374
380
  candidates.sort((left, right) => {
375
381
  if (right.score !== left.score) return right.score - left.score;
376
382
  const leftCap = left.capacity.max > 0 ? left.capacity.max : Number.MAX_SAFE_INTEGER;
@@ -4,12 +4,12 @@ import {
4
4
  createE10RequestRuntime,
5
5
  isE10SessionExpiredResponse,
6
6
  requireE10Session
7
- } from "./chunk-WVH5ESDA.js";
7
+ } from "./chunk-NRYDJN4J.js";
8
8
  import {
9
9
  E10_REAUTH_GUIDANCE,
10
10
  E10_SESSION_EXPIRED_MESSAGE,
11
11
  getActiveProfile
12
- } from "./chunk-SFM3M2L3.js";
12
+ } from "./chunk-WIWDVETN.js";
13
13
  import {
14
14
  CliError
15
15
  } from "./chunk-UG5G54VL.js";