weaver-work-cli 0.1.65 → 0.1.66
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.
- package/dist/chunks/{attachment-content-QUM27QNB.js → attachment-content-NRBGS5XG.js} +3 -3
- package/dist/chunks/{chunk-F4ME3CGS.js → chunk-2BAZJCG7.js} +2 -2
- package/dist/chunks/{chunk-SHX7XBYR.js → chunk-4WCVRDC5.js} +83 -33
- package/dist/chunks/{chunk-IJDZ7VDC.js → chunk-5FQT7GSN.js} +2 -2
- package/dist/chunks/{chunk-E3OQSNF5.js → chunk-AAOYOPHW.js} +1 -1
- package/dist/chunks/{chunk-LRK7YND4.js → chunk-BZ6HAY2U.js} +7 -7
- package/dist/chunks/{chunk-6AW5LW4T.js → chunk-EYEJW5SG.js} +4 -4
- package/dist/chunks/{chunk-CUY64WP4.js → chunk-GOZ75GHU.js} +38 -38
- package/dist/chunks/{chunk-JDZOYHAL.js → chunk-M7IEDTRI.js} +1 -1
- package/dist/chunks/{chunk-NZLFKBEM.js → chunk-NNXZMBIB.js} +6 -6
- package/dist/chunks/{chunk-K7QKQRSL.js → chunk-NP3ZZFGI.js} +24 -24
- package/dist/chunks/{chunk-QT7GGCSY.js → chunk-SAADVUK6.js} +32 -32
- package/dist/chunks/{chunk-IT3SB7RV.js → chunk-VWQGF3KW.js} +15 -4
- package/dist/chunks/{chunk-D6SWOUUP.js → chunk-YFX5JKOY.js} +2 -2
- package/dist/chunks/{chunk-ZV3TYANI.js → chunk-YT73QQMS.js} +1 -1
- package/dist/chunks/{conflict-76ZUL3E7.js → conflict-LJYKIUJM.js} +2 -2
- package/dist/chunks/{contract-INMS7SYQ.js → contract-N5WNHKHI.js} +94 -30
- package/dist/chunks/{create-flow-7WGKLRHH.js → create-flow-75MCKXGI.js} +6 -6
- package/dist/chunks/{entry-mode-3UMMMK6Z.js → entry-mode-3PI6A7JD.js} +3 -3
- package/dist/chunks/{env-7EGXNZR2.js → env-FI62FOKK.js} +2 -2
- package/dist/chunks/{factory-BDERKTYX.js → factory-HLS4SDQM.js} +1 -1
- package/dist/chunks/{group-chat-4E7EZMTJ.js → group-chat-MFBVOLKY.js} +3 -3
- package/dist/chunks/{lazy-dispatch-4WOIL3ZQ.js → lazy-dispatch-K25LTKQY.js} +2 -2
- package/dist/chunks/{meeting-2FMYZXG5.js → meeting-ROWDB3DO.js} +11 -11
- package/dist/chunks/{minute-doc-3DHMYMBE.js → minute-doc-ABMO2UDX.js} +2 -2
- package/dist/chunks/{registry-6UGQO35C.js → registry-NLAO2W6T.js} +2 -2
- package/dist/chunks/{registry-XXFMYPBM.js → registry-QV6IPRVM.js} +11 -11
- package/dist/chunks/{room-recommend-7LD2OHL5.js → room-recommend-P54PQTCN.js} +4 -4
- package/dist/chunks/{schedule-ZAYMZKTQ.js → schedule-BEBFGMT6.js} +4 -4
- package/dist/chunks/{smart-extract-FOBSVNYW.js → smart-extract-DEBLJPCQ.js} +11 -11
- package/dist/chunks/{workflow-NYJJIT3D.js → workflow-LBFFZZN2.js} +2 -2
- package/dist/cmd/refs/index.js +24 -23
- package/dist/core/output.js +134 -41
- package/dist/index.js +7 -7
- package/dist/shortcuts/contract/manifest.js +11 -4
- package/dist/shortcuts/contract/operations/first-screen.js +41 -19
- package/dist/shortcuts/contract/operations/flow.js +2 -0
- package/dist/shortcuts/contract/operations/ledger.js +58 -8
- package/dist/shortcuts/contract/operations/quote-recognize.js +31 -9
- package/dist/shortcuts/contract/operations/quote-submit.js +4 -1
- package/dist/shortcuts/contract/operations/upload.js +21 -1
- package/dist/shortcuts/contract/upload-cache.js +2 -2
- package/dist/shortcuts/smart-extract/operations/fill.js +14 -14
- package/dist/shortcuts/workflow/index.js +2 -2
- package/dist/shortcuts/workflow/operations/form.js +28 -4
- package/docs/agent-io-channel-design.md +21 -10
- package/docs/smart-extract.md +1 -1
- package/docs/todo-smart-convert/data-contract.md +1 -1
- package/package.json +1 -1
- package/skills/weaver-e10-jinchengda/SKILL.md +67 -31
- package/skills/weaver-e10-jinchengda/references/contract-ai-review.md +18 -18
- package/skills/weaver-e10-jinchengda/references/contract-clause-insert.md +4 -4
- package/skills/weaver-e10-jinchengda/references/contract-clause-library-crud.md +1 -1
- package/skills/weaver-e10-jinchengda/references/contract-command-index.md +2 -2
- package/skills/weaver-e10-jinchengda/references/contract-compare-report.md +6 -6
- package/skills/weaver-e10-jinchengda/references/contract-credit-page.md +3 -3
- package/skills/weaver-e10-jinchengda/references/contract-disabled-capabilities.md +1 -1
- package/skills/weaver-e10-jinchengda/references/contract-doc-compare.md +6 -6
- package/skills/weaver-e10-jinchengda/references/contract-doc-triage.md +7 -7
- package/skills/weaver-e10-jinchengda/references/contract-element-save-record.md +9 -9
- package/skills/weaver-e10-jinchengda/references/contract-execution-rules.md +3 -3
- package/skills/weaver-e10-jinchengda/references/contract-field-extract-new-customer.md +11 -11
- package/skills/weaver-e10-jinchengda/references/contract-field-extract-other-flows.md +18 -18
- package/skills/weaver-e10-jinchengda/references/contract-flow-launch.md +4 -4
- package/skills/weaver-e10-jinchengda/references/contract-ledger-catalog.md +18 -15
- package/skills/weaver-e10-jinchengda/references/contract-ledger-query-playbook.md +51 -28
- package/skills/weaver-e10-jinchengda/references/contract-ledger-rules.md +6 -6
- package/skills/weaver-e10-jinchengda/references/contract-modeltext-library.md +1 -1
- package/skills/weaver-e10-jinchengda/references/contract-multi-file.md +20 -9
- package/skills/weaver-e10-jinchengda/references/contract-object-detect.md +18 -18
- package/skills/weaver-e10-jinchengda/references/contract-open-web-pages.md +9 -9
- package/skills/weaver-e10-jinchengda/references/contract-performance-query.md +4 -4
- package/skills/weaver-e10-jinchengda/references/contract-quote-to-contract.md +42 -30
- package/skills/weaver-e10-jinchengda/references/contract-template-recommend.md +1 -1
- package/skills/weaver-e10-jinchengda/references/contract-type-fingerprints.md +8 -8
- package/skills/weaver-e10-jinchengda/references/contract-workflow-discovery.md +1 -1
- package/skills/weaver-e10-jinchengda/references/orchestration.md +2 -2
- package/skills/weaver-e10-jucailin/references/recruit-interview-overview.md +1 -1
- package/skills/weaver-e10-shared/references/json-output-contract.md +4 -3
- package/skills/weaver-e10-smart-extract/SKILL.md +1 -1
|
@@ -8,10 +8,10 @@ import {
|
|
|
8
8
|
looksLikeFileId,
|
|
9
9
|
meetingAttachmentContentOperations,
|
|
10
10
|
parseFileIdList
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-2BAZJCG7.js";
|
|
12
12
|
import "./chunk-WMRNO6IU.js";
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-
|
|
13
|
+
import "./chunk-AAOYOPHW.js";
|
|
14
|
+
import "./chunk-M7IEDTRI.js";
|
|
15
15
|
import "./chunk-7BDPM5ST.js";
|
|
16
16
|
import "./chunk-UG5G54VL.js";
|
|
17
17
|
import "./chunk-BUSC6UAE.js";
|
|
@@ -5,13 +5,13 @@ import {
|
|
|
5
5
|
} from "./chunk-WMRNO6IU.js";
|
|
6
6
|
import {
|
|
7
7
|
meetingStateDir
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-AAOYOPHW.js";
|
|
9
9
|
import {
|
|
10
10
|
SCHEMA_ID,
|
|
11
11
|
meetingSuccess,
|
|
12
12
|
meetingValidationError,
|
|
13
13
|
schemaOf
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-M7IEDTRI.js";
|
|
15
15
|
|
|
16
16
|
// src/shortcuts/meeting/operations/attachment-content.ts
|
|
17
17
|
import { mkdir, writeFile } from "node:fs/promises";
|
|
@@ -397,7 +397,17 @@ function resolveRefInput(ctx, options) {
|
|
|
397
397
|
}
|
|
398
398
|
|
|
399
399
|
// src/core/output.ts
|
|
400
|
-
var
|
|
400
|
+
var HOST_OUTPUT_MAX_CHARS_FALLBACK = 3e4;
|
|
401
|
+
var HOST_OUTPUT_HARD_MAX_CHARS = 15e4;
|
|
402
|
+
var HOST_OUTPUT_RESERVE_CHARS = 2e3;
|
|
403
|
+
var MIN_RESULT_THRESHOLD_CHARS = 2048;
|
|
404
|
+
function hostOutputMaxChars(env = process.env) {
|
|
405
|
+
const raw = Number(env.BASH_MAX_OUTPUT_LENGTH);
|
|
406
|
+
return Number.isFinite(raw) && raw > 0 ? Math.min(Math.floor(raw), HOST_OUTPUT_HARD_MAX_CHARS) : HOST_OUTPUT_MAX_CHARS_FALLBACK;
|
|
407
|
+
}
|
|
408
|
+
function defaultResultThresholdChars(env = process.env) {
|
|
409
|
+
return Math.max(MIN_RESULT_THRESHOLD_CHARS, hostOutputMaxChars(env) - HOST_OUTPUT_RESERVE_CHARS);
|
|
410
|
+
}
|
|
401
411
|
var DEFAULT_REF_TTL_MS = 30 * 6e4;
|
|
402
412
|
var DEFAULT_REF_MAX_COUNT = 50;
|
|
403
413
|
var DEFAULT_REF_MAX_BYTES = 200 * 1024 * 1024;
|
|
@@ -409,6 +419,8 @@ var COMPACT_TIERS = [
|
|
|
409
419
|
{ array: 50, string: 40 },
|
|
410
420
|
{ array: 20, string: 40 },
|
|
411
421
|
{ array: 10, string: 40 },
|
|
422
|
+
{ array: 8, string: 40 },
|
|
423
|
+
{ array: 6, string: 30 },
|
|
412
424
|
{ array: 5, string: 20 },
|
|
413
425
|
{ array: 2, string: 20 },
|
|
414
426
|
{ array: 1, string: 20 }
|
|
@@ -436,9 +448,10 @@ function numeric(ctx, envName, configKey, fallback) {
|
|
|
436
448
|
if (typeof fromConfig === "number" && Number.isFinite(fromConfig)) return fromConfig;
|
|
437
449
|
return fallback;
|
|
438
450
|
}
|
|
439
|
-
function
|
|
440
|
-
const
|
|
441
|
-
|
|
451
|
+
function resultThresholdChars(ctx) {
|
|
452
|
+
const fallback = defaultResultThresholdChars();
|
|
453
|
+
const value = numeric(ctx, "WEAVER_WORK_CLI_REF_THRESHOLD", "resultThreshold", fallback);
|
|
454
|
+
return value === 0 || value >= MIN_RESULT_THRESHOLD_CHARS ? Math.floor(value) : fallback;
|
|
442
455
|
}
|
|
443
456
|
function refTtlMs(ctx) {
|
|
444
457
|
const value = numeric(ctx, "WEAVER_WORK_CLI_REF_TTL_MS", "refTtlMs", DEFAULT_REF_TTL_MS);
|
|
@@ -455,6 +468,9 @@ function refMaxBytes(ctx) {
|
|
|
455
468
|
function bytesOf(value) {
|
|
456
469
|
return Buffer.byteLength(JSON.stringify(value ?? null, null, 2), "utf8");
|
|
457
470
|
}
|
|
471
|
+
function charsOf(value) {
|
|
472
|
+
return JSON.stringify(value ?? null, null, 2).length;
|
|
473
|
+
}
|
|
458
474
|
function isLinkField(key) {
|
|
459
475
|
if (!key) return false;
|
|
460
476
|
return /(?:^|[a-z0-9])(?:url|urls|uri|href|link|links)$/i.test(key);
|
|
@@ -522,7 +538,7 @@ function compactValue(value, arrayLimit, stringLimit, depth = 0, key, path = "",
|
|
|
522
538
|
}
|
|
523
539
|
return value;
|
|
524
540
|
}
|
|
525
|
-
function compactRecord(value,
|
|
541
|
+
function compactRecord(value, budgetChars, keepKeys, sink) {
|
|
526
542
|
let current = value;
|
|
527
543
|
let last = [];
|
|
528
544
|
for (const tier of COMPACT_TIERS) {
|
|
@@ -533,7 +549,7 @@ function compactRecord(value, budgetBytes, keepKeys, sink) {
|
|
|
533
549
|
}
|
|
534
550
|
current = out;
|
|
535
551
|
last = truncations;
|
|
536
|
-
if (
|
|
552
|
+
if (charsOf(out) <= budgetChars) break;
|
|
537
553
|
}
|
|
538
554
|
for (const item of last) sink?.(item);
|
|
539
555
|
return current;
|
|
@@ -643,26 +659,56 @@ function previewTruncatedFieldsOf(truncations) {
|
|
|
643
659
|
{ unit: "chars", total: item.total, shown: item.shown }
|
|
644
660
|
]));
|
|
645
661
|
}
|
|
662
|
+
function recoveryOf(leading, truncations) {
|
|
663
|
+
const refId = typeof leading.refId === "string" ? leading.refId.trim() : "";
|
|
664
|
+
if (!refId || leading.resultPersisted !== true) return void 0;
|
|
665
|
+
const groups = dedupeByTemplate(truncations).sort(byOmitted);
|
|
666
|
+
const array = groups.find((item) => item.kind === "array");
|
|
667
|
+
const text = groups.find((item) => item.kind === "string");
|
|
668
|
+
if (!array && !text) return void 0;
|
|
669
|
+
const out = {
|
|
670
|
+
refId,
|
|
671
|
+
note: "\u5B8C\u6574\u7ED3\u679C\u5DF2\u6682\u5B58\u5728\u672C\u5730 ref\uFF1A\u4E0D\u8981\u91CD\u65B0\u8C03\u7528\u4E1A\u52A1\u63A5\u53E3\u53D6\u540C\u4E00\u6279\u6570\u636E\uFF0C\u4E5F\u4E0D\u8981\u62FF\u9884\u89C8\u5224\u65AD\u6761\u6570\u6216\u5206\u9875\u3002"
|
|
672
|
+
};
|
|
673
|
+
if (array) {
|
|
674
|
+
const path = normalizePath(array.path);
|
|
675
|
+
const remaining = array.total - array.shown;
|
|
676
|
+
out.items = { path, total: array.total, shown: array.shown, remaining };
|
|
677
|
+
if (!path.includes("[") && remaining > 0) {
|
|
678
|
+
out.readRemainingItems = `weaver-work-cli refs get ${refId} ${path} --offset ${array.shown} --limit ${Math.min(remaining, 50)}`;
|
|
679
|
+
}
|
|
680
|
+
}
|
|
681
|
+
if (text) {
|
|
682
|
+
const path = normalizePath(text.path);
|
|
683
|
+
if (!path.includes("[")) {
|
|
684
|
+
out.readTruncatedText = `weaver-work-cli refs get ${refId} ${path} --char-offset 0 --char-limit 2000`;
|
|
685
|
+
}
|
|
686
|
+
}
|
|
687
|
+
return out;
|
|
688
|
+
}
|
|
646
689
|
function withTruncationNotice(leading, truncations) {
|
|
647
690
|
const detail = describeTruncations(truncations);
|
|
648
691
|
if (!detail) return leading;
|
|
649
|
-
const
|
|
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}`;
|
|
692
|
+
const persisted = leading.resultPersisted === true;
|
|
652
693
|
const omitted = previewOmittedOf(truncations);
|
|
694
|
+
const recovery = recoveryOf(leading, truncations);
|
|
653
695
|
const truncatedFields = previewTruncatedFieldsOf(truncations);
|
|
696
|
+
const tail = persisted ? recovery ? "" : "\u5B8C\u6574\u7ED3\u679C\u5728\u672C\u5730 ref\uFF0C\u7528 refs get \u6309\u8DEF\u5F84\u53D6\uFF0C\u4E0D\u8981\u91CD\u65B0\u8C03\u7528\u4E1A\u52A1\u63A5\u53E3\u3002" : "\u5B8C\u6574\u7ED3\u679C\u672A\u80FD\u6682\u5B58\uFF0C\u65E0\u6CD5\u6062\u590D\u3002";
|
|
697
|
+
const notice = `\u26A0\uFE0F stdout \u4EC5\u4E3A\u9884\u89C8\uFF0C\u4E0D\u662F\u5168\u91CF\uFF08\u4E0D\u8981\u636E\u6B64\u5224\u65AD\u6761\u6570\u6216\u5206\u9875\uFF09\uFF1A${detail}\u3002${tail}`;
|
|
698
|
+
const { largeOutputNotice: rawNotice, ...rest } = leading;
|
|
654
699
|
return {
|
|
655
|
-
...
|
|
700
|
+
...rest,
|
|
656
701
|
...omitted ? { previewOmitted: omitted } : {},
|
|
657
|
-
...
|
|
658
|
-
largeOutputNotice: notice
|
|
702
|
+
...recovery ? { recovery } : {},
|
|
703
|
+
largeOutputNotice: `${String(rawNotice ?? "")}${notice}`,
|
|
704
|
+
...truncatedFields ? { previewTruncatedFields: truncatedFields } : {}
|
|
659
705
|
};
|
|
660
706
|
}
|
|
661
|
-
function slimmedBody(value,
|
|
707
|
+
function slimmedBody(value, thresholdChars, hasRef) {
|
|
662
708
|
const base = value && typeof value === "object" && !Array.isArray(value) ? value : { data: value };
|
|
663
709
|
const truncations = [];
|
|
664
|
-
const compacted = compactRecord(base,
|
|
665
|
-
if (
|
|
710
|
+
const compacted = compactRecord(base, thresholdChars, ENVELOPE_KEEP_KEYS, (item) => truncations.push(item));
|
|
711
|
+
if (charsOf(compacted) <= thresholdChars) return { body: compacted, truncations };
|
|
666
712
|
return { body: skeletonOf(base, ENVELOPE_KEEP_KEYS, hasRef), truncations: skeletonTruncations(base) };
|
|
667
713
|
}
|
|
668
714
|
function skeletonTruncations(base) {
|
|
@@ -674,11 +720,11 @@ function skeletonTruncations(base) {
|
|
|
674
720
|
}
|
|
675
721
|
return out;
|
|
676
722
|
}
|
|
677
|
-
function fitEnvelope(value, leading, extraWarnings,
|
|
723
|
+
function fitEnvelope(value, leading, extraWarnings, budgetChars) {
|
|
678
724
|
const hasRef = leading.resultPersisted === true;
|
|
679
|
-
const { body, truncations } = slimmedBody(value,
|
|
725
|
+
const { body, truncations } = slimmedBody(value, budgetChars, hasRef);
|
|
680
726
|
let envelope = withLeadingMeta(value, withTruncationNotice(leading, truncations), body, extraWarnings);
|
|
681
|
-
if (
|
|
727
|
+
if (charsOf(envelope) <= budgetChars) return envelope;
|
|
682
728
|
const base = value && typeof value === "object" && !Array.isArray(value) ? value : { data: value };
|
|
683
729
|
envelope = withLeadingMeta(
|
|
684
730
|
value,
|
|
@@ -686,19 +732,20 @@ function fitEnvelope(value, leading, extraWarnings, budgetBytes) {
|
|
|
686
732
|
skeletonOf(base, ENVELOPE_KEEP_KEYS, leading.resultPersisted === true),
|
|
687
733
|
extraWarnings
|
|
688
734
|
);
|
|
689
|
-
if (
|
|
735
|
+
if (charsOf(envelope) <= budgetChars) return envelope;
|
|
690
736
|
const persisted = leading.resultPersisted === true;
|
|
691
737
|
const refId = String(leading.refId ?? "").slice(0, 80);
|
|
692
738
|
const finalOmitted = previewOmittedOf(skeletonTruncations(base));
|
|
693
|
-
const finalNotice = persisted ? `\u7ED3\u679C\u5DF2\u7CBE\u7B80\
|
|
739
|
+
const finalNotice = persisted ? `\u7ED3\u679C\u5DF2\u7CBE\u7B80\uFF1A\u5B8C\u6574\u5185\u5BB9\u5728\u672C\u5730 ref ${refId}\uFF0C\u7528 refs get ${refId} <\u8DEF\u5F84> \u53D6\uFF0C\u4E0D\u8981\u91CD\u65B0\u8C03\u7528\u4E1A\u52A1\u63A5\u53E3\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
740
|
const finalDetail = describeTruncations(skeletonTruncations(base));
|
|
695
741
|
return {
|
|
696
742
|
...persisted ? { refId } : {},
|
|
697
743
|
resultPersisted: persisted,
|
|
698
|
-
outputBytes: Number(leading.outputBytes) || 0,
|
|
699
|
-
largeOutputNotice: finalDetail ? `${finalNotice}\u26A0\uFE0F \u9884\u89C8\u4E0D\u662F\u5168\u91CF\uFF1A${finalDetail}\u3002` : finalNotice,
|
|
700
744
|
previewTruncated: true,
|
|
701
745
|
...finalOmitted ? { previewOmitted: finalOmitted } : {},
|
|
746
|
+
outputChars: Number(leading.outputChars) || 0,
|
|
747
|
+
outputBytes: Number(leading.outputBytes) || 0,
|
|
748
|
+
largeOutputNotice: finalDetail ? `${finalNotice}\u26A0\uFE0F \u9884\u89C8\u4E0D\u662F\u5168\u91CF\uFF1A${finalDetail}\u3002` : finalNotice,
|
|
702
749
|
schemaVersion: typeof base.schemaVersion === "number" || typeof base.schemaVersion === "string" ? String(base.schemaVersion).slice(0, 20) : 1,
|
|
703
750
|
ok: typeof base.ok === "boolean" ? base.ok : true,
|
|
704
751
|
...typeof base.operation === "string" ? { operation: base.operation.slice(0, 80) } : {},
|
|
@@ -756,11 +803,12 @@ var Output = class {
|
|
|
756
803
|
console.log(stringifyForStdout(this.prepare(value, options), options.compactPaths));
|
|
757
804
|
}
|
|
758
805
|
prepare(value, options) {
|
|
759
|
-
const threshold =
|
|
806
|
+
const threshold = resultThresholdChars(this.ctx);
|
|
760
807
|
if (options.persist === false || threshold <= 0) return value;
|
|
761
808
|
const finalBudget = Math.max(1024, threshold - 1024);
|
|
809
|
+
const chars = charsOf(value);
|
|
810
|
+
if (chars <= threshold) return value;
|
|
762
811
|
const bytes = bytesOf(value);
|
|
763
|
-
if (bytes <= threshold) return value;
|
|
764
812
|
const limits = { maxCount: refMaxCount(this.ctx), maxBytes: refMaxBytes(this.ctx) };
|
|
765
813
|
const warnings = [];
|
|
766
814
|
try {
|
|
@@ -778,18 +826,19 @@ var Output = class {
|
|
|
778
826
|
}
|
|
779
827
|
if (retention?.overLimit) warnings.push("ref_store_over_limit");
|
|
780
828
|
if (retention?.cleanupIncomplete) warnings.push("ref_gc_incomplete");
|
|
781
|
-
return fitEnvelope(value, this.leadingFor(meta, bytes, retention), warnings, finalBudget);
|
|
829
|
+
return fitEnvelope(value, this.leadingFor(meta, bytes, chars, retention), warnings, finalBudget);
|
|
782
830
|
} catch (error) {
|
|
783
831
|
const code = error && typeof error === "object" && "code" in error ? String(error.code) : "";
|
|
784
832
|
const message = code === "ENOSPC" ? "\u78C1\u76D8\u7A7A\u95F4\u4E0D\u8DB3" : code === "EACCES" || code === "EPERM" ? "CLI \u6682\u5B58\u76EE\u5F55\u65E0\u5199\u5165\u6743\u9650" : "\u65E0\u6CD5\u5199\u5165 CLI \u6682\u5B58\u76EE\u5F55";
|
|
785
833
|
process.stderr.write(
|
|
786
|
-
`[weaver-work-cli] \u7ED3\u679C ${bytes} \u5B57\u8282\u8D85\u8FC7 stdout \u9884\u7B97 ${threshold} \u5B57\
|
|
834
|
+
`[weaver-work-cli] \u7ED3\u679C ${chars} \u5B57\u7B26\uFF08${bytes} \u5B57\u8282\uFF09\u8D85\u8FC7 stdout \u9884\u7B97 ${threshold} \u5B57\u7B26\u4E14\u843D\u76D8\u5931\u8D25\uFF0C\u8F93\u51FA\u5DF2\u7CBE\u7B80\uFF1A${message}
|
|
787
835
|
`
|
|
788
836
|
);
|
|
789
837
|
return fitEnvelope(
|
|
790
838
|
value,
|
|
791
839
|
{
|
|
792
840
|
outputBytes: bytes,
|
|
841
|
+
outputChars: chars,
|
|
793
842
|
resultPersisted: false,
|
|
794
843
|
largeOutputNotice: `\u7ED3\u679C\u8D85\u8FC7 stdout \u9650\u5236\u4E14\u65E0\u6CD5\u6682\u5B58\uFF1B\u5F53\u524D\u5185\u5BB9\u5DF2\u7CBE\u7B80\uFF0C\u53EF\u80FD\u4E0D\u5B8C\u6574\uFF1A${message.slice(0, 160)}`
|
|
795
844
|
},
|
|
@@ -798,16 +847,17 @@ var Output = class {
|
|
|
798
847
|
);
|
|
799
848
|
}
|
|
800
849
|
}
|
|
801
|
-
leadingFor(meta, bytes, retention) {
|
|
850
|
+
leadingFor(meta, bytes, chars, retention) {
|
|
802
851
|
const retentionNotice = retention?.cleanupIncomplete ? " \u90E8\u5206\u65E7\u5F15\u7528\u6682\u65F6\u65E0\u6CD5\u5220\u9664\uFF0CCLI \u4F1A\u5728\u540E\u7EED\u547D\u4EE4\u91CD\u8BD5\u3002" : retention?.overLimit ? " \u672C\u7ED3\u679C\u8D85\u8FC7\u6682\u5B58\u5BB9\u91CF\u4E0A\u9650\uFF0C\u5DF2\u4FDD\u7559\u672C\u6B21\u7ED3\u679C\u5E76\u6DD8\u6C70\u65E7\u7ED3\u679C\u3002" : "";
|
|
803
852
|
return {
|
|
804
853
|
refId: meta.refId,
|
|
805
854
|
resultPersisted: true,
|
|
806
|
-
|
|
855
|
+
previewTruncated: true,
|
|
807
856
|
sha256: meta.sha256,
|
|
808
857
|
expiresAt: meta.expiresAt,
|
|
809
|
-
|
|
810
|
-
|
|
858
|
+
outputChars: chars,
|
|
859
|
+
outputBytes: bytes,
|
|
860
|
+
largeOutputNotice: `\u7ED3\u679C ${chars} \u5B57\u7B26\u5DF2\u8D85 stdout \u9884\u7B97 ${resultThresholdChars(this.ctx)} \u5B57\u7B26\uFF0C\u5168\u91CF\u5DF2\u6682\u5B58\u4E3A\u672C\u5730 ref\u3002\u53D6\u5168\u91CF\u7528 refs get ${meta.refId} <\u8DEF\u5F84>\uFF08\u6216 --input-ref ${meta.refId} \u5582\u7ED9\u4E0B\u4E00\u6761\u547D\u4EE4\uFF09\uFF0C\u4E0D\u8981\u91CD\u65B0\u8C03\u7528\u4E1A\u52A1\u63A5\u53E3\u3002` + retentionNotice
|
|
811
861
|
};
|
|
812
862
|
}
|
|
813
863
|
raw(message) {
|
|
@@ -824,11 +874,11 @@ export {
|
|
|
824
874
|
readTextWindow,
|
|
825
875
|
pickValue,
|
|
826
876
|
resolveRefInput,
|
|
827
|
-
|
|
828
|
-
|
|
877
|
+
defaultResultThresholdChars,
|
|
878
|
+
resultThresholdChars,
|
|
829
879
|
refMaxCount,
|
|
830
880
|
refMaxBytes,
|
|
831
|
-
|
|
881
|
+
charsOf,
|
|
832
882
|
stringifyForStdout,
|
|
833
883
|
Output
|
|
834
884
|
};
|
|
@@ -3,13 +3,13 @@ const require = __esbuildCreateRequire(import.meta.url);
|
|
|
3
3
|
import {
|
|
4
4
|
readCache,
|
|
5
5
|
writeCache
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-YT73QQMS.js";
|
|
7
7
|
import {
|
|
8
8
|
SCHEMA_DATETIME_MINUTE,
|
|
9
9
|
meetingSuccess,
|
|
10
10
|
meetingValidationError,
|
|
11
11
|
schemaOf
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-M7IEDTRI.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";
|
|
@@ -2,12 +2,12 @@ import { createRequire as __esbuildCreateRequire } from 'node:module';
|
|
|
2
2
|
const require = __esbuildCreateRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
4
|
meetingStateDir
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-AAOYOPHW.js";
|
|
6
6
|
import {
|
|
7
7
|
meetingSuccess,
|
|
8
8
|
meetingValidationError,
|
|
9
9
|
schemaOf
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-M7IEDTRI.js";
|
|
11
11
|
|
|
12
12
|
// src/shortcuts/meeting/operations/eb/group-chat.ts
|
|
13
13
|
import { mkdir, readFile, readdir, rm, writeFile } from "node:fs/promises";
|
|
@@ -159,7 +159,7 @@ async function triggerGroupFlow(env, input, meetingName, memberIds) {
|
|
|
159
159
|
if (addressText === "[object Object]") addressText = "";
|
|
160
160
|
if (addressText) {
|
|
161
161
|
try {
|
|
162
|
-
const { resolveAddressRoom } = await import("./create-flow-
|
|
162
|
+
const { resolveAddressRoom } = await import("./create-flow-75MCKXGI.js");
|
|
163
163
|
const room = await resolveAddressRoom(env, addressText);
|
|
164
164
|
if (room?.name) addressText = room.name;
|
|
165
165
|
} catch {
|
|
@@ -201,7 +201,7 @@ async function bindGroupToMeeting(env, meetingId, groupId) {
|
|
|
201
201
|
const group = String(groupId).trim();
|
|
202
202
|
if (id === "" || group === "") return { ok: false, error: "\u6CA1\u6709\u4F1A\u8BAE id \u6216\u7FA4 id" };
|
|
203
203
|
try {
|
|
204
|
-
const { EB_BASE, ebBusinessSuccess, writeBody } = await import("./factory-
|
|
204
|
+
const { EB_BASE, ebBusinessSuccess, writeBody } = await import("./factory-HLS4SDQM.js");
|
|
205
205
|
const session = await env.host.getSession();
|
|
206
206
|
await env.host.request({
|
|
207
207
|
method: "POST",
|
|
@@ -219,7 +219,7 @@ async function bindGroupToMeeting(env, meetingId, groupId) {
|
|
|
219
219
|
return { ok: false, error: String(error?.message ?? error).slice(0, 300) };
|
|
220
220
|
}
|
|
221
221
|
try {
|
|
222
|
-
const { getMeetingOperation } = await import("./registry-
|
|
222
|
+
const { getMeetingOperation } = await import("./registry-QV6IPRVM.js");
|
|
223
223
|
const detail = getMeetingOperation("meeting.eb.meeting.detail");
|
|
224
224
|
const read = await detail.handler({ id }, env);
|
|
225
225
|
const main = read?.data?.data ?? read?.data?.main ?? {};
|
|
@@ -235,7 +235,7 @@ async function bindGroupToMeeting(env, meetingId, groupId) {
|
|
|
235
235
|
}
|
|
236
236
|
async function searchMyRequests(env, options = {}) {
|
|
237
237
|
try {
|
|
238
|
-
const { getWorkflowOperation } = await import("./registry-
|
|
238
|
+
const { getWorkflowOperation } = await import("./registry-NLAO2W6T.js");
|
|
239
239
|
const op = getWorkflowOperation("workflow.search");
|
|
240
240
|
const wfEnv = await buildWorkflowEnv(env);
|
|
241
241
|
const args = { category: "mine", pageSize: 20, sort: "createTime:desc" };
|
|
@@ -267,7 +267,7 @@ async function resolveMeetingByRequestId(env, requestId, sinceMs) {
|
|
|
267
267
|
const target = String(requestId).trim();
|
|
268
268
|
if (target === "") return null;
|
|
269
269
|
try {
|
|
270
|
-
const { getMeetingOperation } = await import("./registry-
|
|
270
|
+
const { getMeetingOperation } = await import("./registry-QV6IPRVM.js");
|
|
271
271
|
const list = getMeetingOperation("meeting.eb.meeting.list");
|
|
272
272
|
const detail = getMeetingOperation("meeting.eb.meeting.detail");
|
|
273
273
|
const page = await list.handler({ pageSize: 30 }, env);
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
cacheScopeSuffix,
|
|
5
5
|
readCache,
|
|
6
6
|
writeCache
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-YT73QQMS.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-
|
|
16
|
+
} from "./chunk-M7IEDTRI.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-
|
|
91
|
+
const { meetingStateDir } = await import("./env-FI62FOKK.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-
|
|
224
|
+
const { getMeetingOperation } = await import("./registry-QV6IPRVM.js");
|
|
225
225
|
const listOp = getMeetingOperation("meeting.eb.meeting.list");
|
|
226
226
|
let seen = 0;
|
|
227
227
|
let total = 0;
|