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.
- package/dist/chunks/{archive-oa-BBDP7AKJ.js → archive-oa-EDJDU3V4.js} +454 -5
- package/dist/chunks/{attachment-content-MCXQBD6N.js → attachment-content-4KSNBPRO.js} +3 -3
- package/dist/chunks/{chunk-J2VEB5K3.js → chunk-2BQESR2U.js} +2 -2
- package/dist/chunks/{chunk-727FH2NI.js → chunk-2IGZUMNG.js} +15 -2
- package/dist/chunks/{chunk-76H3IKH6.js → chunk-5B5JXTY2.js} +35 -35
- package/dist/chunks/{chunk-Q4OYAQYH.js → chunk-72MI3MBX.js} +4 -0
- package/dist/chunks/{chunk-4RWS2YYL.js → chunk-BCACE6VV.js} +2 -2
- package/dist/chunks/{chunk-AD46OMQK.js → chunk-EFOUMXIX.js} +119 -44
- package/dist/chunks/{chunk-IRMIEDXN.js → chunk-FEP6ELMR.js} +1 -1
- package/dist/chunks/{chunk-LIEQJIGM.js → chunk-GR76ZDDX.js} +0 -3
- package/dist/chunks/{chunk-JB34OE7R.js → chunk-NBEWUR7L.js} +1 -1
- package/dist/chunks/{chunk-6V5ZPKHV.js → chunk-NK74RE5F.js} +2 -2
- package/dist/chunks/{chunk-GSZTA43P.js → chunk-OCYRVZGN.js} +2 -2
- package/dist/chunks/{chunk-OXHHJWNC.js → chunk-PSPOFLSU.js} +1 -1
- package/dist/chunks/{chunk-6AXKWFKG.js → chunk-R2HHLJNN.js} +4 -4
- package/dist/chunks/{chunk-PSOMGA3U.js → chunk-SVFG6EMV.js} +35 -6
- package/dist/chunks/{chunk-IP4CWQCF.js → chunk-WMSAWAWZ.js} +8 -8
- package/dist/chunks/{conflict-H7EHQXYY.js → conflict-APGSD5E7.js} +2 -2
- package/dist/chunks/{contract-3QLAGYQL.js → contract-N6P2HIIE.js} +425 -187
- package/dist/chunks/{create-flow-VRVJEOBX.js → create-flow-5TXFOC7X.js} +6 -6
- package/dist/chunks/{ehr-SH2LM3NK.js → ehr-XI4BIVR2.js} +16 -5
- package/dist/chunks/{env-66FPSJDV.js → env-B6GKA2J3.js} +2 -2
- package/dist/chunks/{factory-UH2TZBVA.js → factory-MFCKLUT6.js} +1 -1
- package/dist/chunks/{group-chat-CAKMMV7K.js → group-chat-YE7WIBFO.js} +3 -3
- package/dist/chunks/{im-NJB7ZYMH.js → im-3RCNL5GT.js} +107 -1
- package/dist/chunks/{invoice-UEAHSYAE.js → invoice-FXWH5GPO.js} +2 -71
- package/dist/chunks/{lazy-dispatch-25XGTXLM.js → lazy-dispatch-XSAHDK6Z.js} +3 -3
- package/dist/chunks/{meeting-VTBFW4HI.js → meeting-RYZV2JTQ.js} +10 -10
- package/dist/chunks/{reception-5WITA44R.js → reception-VL6TKVAW.js} +480 -26
- package/dist/chunks/{recruit-stage-CAKZTUA7.js → recruit-stage-ERZD3ZNB.js} +52 -16
- package/dist/chunks/{registry-JVQBLFQ5.js → registry-22O6UG4I.js} +10 -10
- package/dist/chunks/{registry-AQVGHUM6.js → registry-7VZ6YJUF.js} +2 -2
- package/dist/chunks/{registry-PVUZQDDQ.js → registry-BUTEDK3C.js} +1 -1
- package/dist/chunks/{room-recommend-5U55FMXZ.js → room-recommend-IMZPJMYB.js} +4 -4
- package/dist/chunks/{schedule-IDETODCA.js → schedule-SPPAHER2.js} +4 -4
- package/dist/chunks/{workflow-BSYT5TGL.js → workflow-WVEFJ6KC.js} +2 -2
- package/dist/core/refs.js +19 -2
- package/dist/index.js +14 -14
- package/dist/shortcuts/archive-oa/constants.js +42 -0
- package/dist/shortcuts/archive-oa/host.js +2 -2
- package/dist/shortcuts/archive-oa/index.js +38 -0
- package/dist/shortcuts/archive-oa/operations/borrow-car.js +117 -3
- package/dist/shortcuts/archive-oa/operations/my-borrow-contract.js +271 -0
- package/dist/shortcuts/archive-oa/operations/registry.js +5 -3
- package/dist/shortcuts/contract/index.js +9 -1
- package/dist/shortcuts/contract/manifest.js +14 -2
- package/dist/shortcuts/contract/operations/card.js +231 -0
- package/dist/shortcuts/contract/operations/registry.js +2 -0
- package/dist/shortcuts/contract/operations/review.js +16 -5
- package/dist/shortcuts/contract/operations/summary.js +25 -17
- package/dist/shortcuts/ehr/operations/recruit-write.js +22 -5
- package/dist/shortcuts/ehr/recruit-stage/operations/interview-arrange.js +17 -8
- package/dist/shortcuts/ehr/recruit-stage/shared.js +33 -8
- package/dist/shortcuts/im/index.js +128 -0
- package/dist/shortcuts/im/operations/session.js +6 -0
- package/dist/shortcuts/invoice/host.js +0 -3
- package/dist/shortcuts/invoice/manifest.js +0 -1
- package/dist/shortcuts/invoice/operations/reim-subsidy.js +1 -71
- package/dist/shortcuts/meeting/operations/eb/conflict.js +26 -3
- package/dist/shortcuts/meeting/operations/eb/continuation-alias.js +63 -0
- package/dist/shortcuts/meeting/operations/eb/create-flow.js +71 -12
- package/dist/shortcuts/meeting/operations/eb/factory.js +5 -3
- package/dist/shortcuts/reception/host.js +33 -1
- package/dist/shortcuts/reception/index.js +19 -0
- package/dist/shortcuts/reception/manifest.js +53 -1
- package/dist/shortcuts/reception/operations/ask.js +18 -0
- package/dist/shortcuts/reception/operations/compose.js +113 -3
- package/dist/shortcuts/reception/operations/leads.js +245 -0
- package/dist/shortcuts/reception/operations/markdown.js +22 -0
- package/dist/shortcuts/reception/operations/registry.js +2 -0
- package/dist/shortcuts/reception/operations/render.js +36 -3
- package/dist/shortcuts/reception/operations/restaurant-rooms.js +118 -0
- package/dist/shortcuts/reception/operations/restaurant.js +251 -0
- package/dist/shortcuts/reception/operations/restaurantrooms.js +42 -0
- package/dist/shortcuts/reception/operations/schedule.js +7 -1
- package/dist/shortcuts/reception/upload.js +22 -6
- package/dist/shortcuts/recruit-stage/operations/interview-arrange.js +17 -8
- package/dist/shortcuts/recruit-stage/shared.js +42 -14
- package/docs/archive-oa.md +4 -2
- package/package.json +1 -1
- package/skill-template/domains/archive-oa.md +2 -1
- package/skill-template/master-skill-template.md +1 -0
- package/skill-template/skill-template.md +1 -0
- package/skills/weaver-e10-archive-oa/SKILL.md +33 -6
- package/skills/weaver-e10-archive-oa/references/borrow-car.md +32 -7
- package/skills/weaver-e10-archive-oa/references/contract-search.md +32 -0
- package/skills/weaver-e10-archive-oa/references/disabled-capabilities.md +1 -1
- package/skills/weaver-e10-archive-oa/references/my-borrow-contract.md +97 -0
- package/skills/weaver-e10-archive-oa/references/my-borrow.md +6 -1
- package/skills/weaver-e10-archive-oa/references/qys-contract-search.md +22 -0
- package/skills/weaver-e10-calendar/SKILL.md +1 -1
- package/skills/weaver-e10-calendar/references/calendar-query.md +1 -1
- package/skills/weaver-e10-calendar/references/calendar-write.md +9 -9
- package/skills/weaver-e10-cowork/SKILL.md +9 -6
- package/skills/weaver-e10-jinchengda/SKILL.md +10 -7
- package/skills/weaver-e10-jinchengda/references/contract-action-card-template.html +17 -0
- package/skills/weaver-e10-jinchengda/references/contract-action-card.md +263 -35
- package/skills/weaver-e10-jinchengda/references/contract-action-engine.md +8 -5
- package/skills/weaver-e10-jinchengda/references/contract-ai-assistant.md +1 -1
- package/skills/weaver-e10-jinchengda/references/contract-ai-review.md +175 -22
- package/skills/weaver-e10-jinchengda/references/contract-command-index.md +2 -2
- package/skills/weaver-e10-jinchengda/references/contract-credit-page.md +1 -1
- package/skills/weaver-e10-jinchengda/references/contract-doc-compare.md +1 -1
- package/skills/weaver-e10-jinchengda/references/contract-doc-triage.md +124 -19
- package/skills/weaver-e10-jinchengda/references/contract-element-extract.md +2 -2
- package/skills/weaver-e10-jinchengda/references/contract-execution-rules.md +4 -4
- package/skills/weaver-e10-jinchengda/references/contract-field-extract-other-flows.md +6 -0
- package/skills/weaver-e10-jinchengda/references/contract-flow-launch.md +1 -1
- package/skills/weaver-e10-jinchengda/references/contract-performance-query.md +1 -1
- package/skills/weaver-e10-jinchengda/references/contract-quote-to-contract.md +1 -1
- package/skills/weaver-e10-jinchengda/references/contract-risk-report-template.html +178 -0
- package/skills/weaver-e10-jinchengda/references/contract-template-recommend.md +1 -1
- package/skills/weaver-e10-jinchengda/references/orchestration.md +7 -7
- package/skills/weaver-e10-jinchengda/scripts/plan_actions.py +279 -0
- package/skills/weaver-e10-jinchengda/scripts/render_action_card.py +450 -0
- package/skills/weaver-e10-jinchengda/scripts/render_risk_report.py +358 -0
- package/skills/weaver-e10-jinchengda/scripts/validate_action_card.py +505 -0
- package/skills/weaver-e10-jucailin/SKILL.md +7 -4
- package/skills/weaver-e10-jucailin/references/recruit-create.md +3 -2
- package/skills/weaver-e10-jucailin/references/recruit-read.md +2 -1
- package/skills/weaver-e10-jucailin/references/recruit-stage-ops.md +3 -3
- package/skills/weaver-e10-jucailin/references/safety-boundaries.md +30 -2
- package/skills/weaver-e10-mail/SKILL.md +17 -4
- package/skills/weaver-e10-meeting/SKILL.md +94 -409
- package/skills/weaver-e10-meeting/references/create-flow.md +188 -0
- package/skills/weaver-e10-meeting/references/create-guardrails.md +234 -0
- package/skills/weaver-e10-meeting/references/pitfalls.md +40 -0
- package/skills/weaver-e10-reception-flow/SKILL.md +62 -18
- package/skills/weaver-e10-reception-flow/data/fields-snapshot.json +628 -26
- package/skills/weaver-e10-reception-flow/references/fields-snapshot.md +96 -26
- package/skills/weaver-e10-reception-flow/scripts/render.py +81 -2
- package/skills/weaver-e10-recruit-stage/SKILL.md +45 -12
- package/skills/weaver-e10-recruit-stage/agents/openai.yaml +58 -8
- package/skills/weaver-e10-recruit-stage/references/position-templates.md +5 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-arrange-interview.md +1 -1
- package/skills/weaver-e10-recruit-stage/references/recruit-edit-interview-feedback.md +1 -1
- package/skills/weaver-e10-recruit-stage/references/recruit-jd-create.md +40 -11
- package/skills/weaver-e10-recruit-stage/references/recruit-list-candidate.md +1 -1
- package/skills/weaver-e10-recruit-stage/references/recruit-list-interview.md +1 -1
- package/skills/weaver-e10-recruit-stage/references/recruit-match-candidates.md +1 -1
- package/skills/weaver-e10-recruit-stage/references/recruit-resume-import.md +16 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-resume-parse.md +1 -1
- package/skills/weaver-e10-recruit-stage/references/recruit-search-candidate.md +1 -1
- package/skills/weaver-e10-recruit-stage/references/recruit-urge-feedback.md +1 -1
- package/skills/weaver-e10-recruit-stage/references/recruit-utterance-glossary.md +127 -0
- package/skills/weaver-e10-shijingran/SKILL.md +6 -2
- package/skills/weaver-e10-shijingran/references/source-manifest.json +5 -4
- package/skills/weaver-e10-workflow/SKILL.md +1 -1
- package/skills/weaver-e10-yepiaotong/SKILL.md +8 -4
- package/skills/weaver-e10-yepiaotong/references/invoice-issuing-workflow.md +1 -1
- package/skills/weaver-e10-yepiaotong/references/invoice-reim.md +1 -1
- package/skills/weaver-e10-yepiaotong/references/reim-api-reference.md +2 -2
- package/skills/weaver-e10-yepiaotong/references/reim-form-fill-rules.md +1 -1
- package/skills/weaver-e10-yepiaotong/references/reim-phone-subsidy-rules.md +1 -1
- package/skills/weaver-e10-yepiaotong/references/reim-workflow.md +1 -0
- package/skills/weaver-e10-yimiaoban/SKILL.md +2 -1
- package/skills/weaver-e10-yimiaoban/references/msg-write.md +32 -0
- package/skills/weaver-e10-yimiaoban/references/session-sysmsg.md +3 -0
- package/skills/weaver-e10-yimiaoban/references/source-manifest.json +11 -11
- package/dist/chunks/{ebuilder-form-GWDTKEI2.js → ebuilder-form-I5ZIX4WO.js} +3 -3
- /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-README.md +0 -0
- /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-SKILL.md +0 -0
- /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-openai.yaml +0 -0
- /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-position-templates.md +0 -0
- /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-arrange-interview.md +0 -0
- /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-capability-check.md +0 -0
- /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-check-install.md +0 -0
- /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-detail-process.md +0 -0
- /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-edit-interview-feedback.md +0 -0
- /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-jd-create.md +0 -0
- /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-jd-template.md +0 -0
- /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-list-candidate.md +0 -0
- /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-list-interview.md +0 -0
- /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-match-candidates.md +0 -0
- /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-output-links.md +0 -0
- /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-resolve-creator.md +0 -0
- /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-resolve-metadata.md +0 -0
- /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-resume-import.md +0 -0
- /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-resume-parse.md +0 -0
- /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-search-candidate.md +0 -0
- /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-urge-feedback.md +0 -0
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
<section id='{{CARD_ID}}' style='padding:16px 18px;font-family:sans-serif;background:#fafbfd;border-radius:12px'>
|
|
2
|
+
|
|
3
|
+
<div style='display:flex;align-items:center;justify-content:space-between;margin-bottom:16px'>
|
|
4
|
+
<div>
|
|
5
|
+
<div style='font-size:17px;font-weight:700;color:#1f2430'>合同风险审查报告</div>
|
|
6
|
+
<div style='font-size:12px;color:#7a8497;margin-top:4px'>{{CONTRACT_NAME}}</div>
|
|
7
|
+
</div>
|
|
8
|
+
<div style='flex:0 0 auto;display:flex;align-items:center;gap:8px'>
|
|
9
|
+
<button type='button' data-act='download' style='background:#fff;color:#1d6fd8;border:1px solid #1d6fd8;border-radius:8px;padding:8px 16px;font-size:13px;font-weight:600;cursor:pointer;font-family:inherit'>下载报告</button>
|
|
10
|
+
<button type='button' data-act='detail' style='background:#1d6fd8;color:#fff;border:none;border-radius:8px;padding:9px 18px;font-size:13px;font-weight:600;cursor:pointer;font-family:inherit'>查看审查详情</button>
|
|
11
|
+
</div>
|
|
12
|
+
</div>
|
|
13
|
+
|
|
14
|
+
<div style='background:#fff;border:1px solid #e8ebf2;border-radius:12px;padding:16px;margin-bottom:14px'>
|
|
15
|
+
<div style='font-size:14px;font-weight:700;color:#1f2430;margin-bottom:12px'>审查基本信息</div>
|
|
16
|
+
<table style='border-collapse:collapse;width:100%;font-size:13px'>{{TINFO}}</table>
|
|
17
|
+
</div>
|
|
18
|
+
|
|
19
|
+
<div style='font-size:14px;font-weight:700;color:#1f2430;margin:0 0 10px 2px'>审查统计</div>
|
|
20
|
+
<div style='display:flex;gap:12px;margin-bottom:18px;flex-wrap:wrap'>
|
|
21
|
+
<div style='flex:1;min-width:130px;background:#fff;border:1px solid #e8ebf2;border-radius:12px;padding:16px;text-align:center'>
|
|
22
|
+
<div style='font-size:26px;font-weight:700;color:#1f2430'>{{STAT_TOTAL}}</div>
|
|
23
|
+
<div style='font-size:12px;color:#7a8497;margin-top:4px'>审查规则总数</div>
|
|
24
|
+
</div>
|
|
25
|
+
<div style='flex:1;min-width:130px;background:#fff;border:1px solid #e8ebf2;border-radius:12px;padding:16px;text-align:center'>
|
|
26
|
+
<div style='font-size:26px;font-weight:700;color:#1a9c5b'>{{STAT_NO_RISK}}</div>
|
|
27
|
+
<div style='font-size:12px;color:#7a8497;margin-top:4px'>判定无风险</div>
|
|
28
|
+
</div>
|
|
29
|
+
<div style='flex:1;min-width:130px;background:#fff;border:1px solid #e8ebf2;border-radius:12px;padding:16px;text-align:center'>
|
|
30
|
+
<div style='font-size:26px;font-weight:700;color:#c0392b'>{{STAT_RISK}}</div>
|
|
31
|
+
<div style='font-size:12px;color:#7a8497;margin-top:4px'>判定有风险</div>
|
|
32
|
+
</div>
|
|
33
|
+
</div>
|
|
34
|
+
|
|
35
|
+
<div style='font-size:14px;font-weight:700;color:#1f2430;margin:18px 0 10px 2px'>风险详情({{RISK_COUNT}} 条)</div>
|
|
36
|
+
{{RISK_ITEMS}}
|
|
37
|
+
|
|
38
|
+
<div style='background:#fff;border:1px solid #e8ebf2;border-radius:12px;padding:16px;margin-top:6px'>
|
|
39
|
+
<div style='font-size:14px;font-weight:700;color:#1f2430;margin-bottom:4px'>审查通过({{PASS_COUNT}} 条)</div>
|
|
40
|
+
<div style='font-size:12px;color:#7a8497;margin-bottom:12px'>以下规则已执行判定,未发现与规则冲突的条款</div>
|
|
41
|
+
{{PASS_TAGS}}
|
|
42
|
+
</div>
|
|
43
|
+
|
|
44
|
+
<p data-status style='margin:10px 0 0;color:#b45309;font-size:12px'></p>
|
|
45
|
+
</section>
|
|
46
|
+
<script>
|
|
47
|
+
(function () {
|
|
48
|
+
var CARD_ID = '{{CARD_ID}}';
|
|
49
|
+
var FILE_BASE = '{{FILE_BASE}}';
|
|
50
|
+
|
|
51
|
+
function getRoot() {
|
|
52
|
+
var el = null;
|
|
53
|
+
var sc = document.currentScript;
|
|
54
|
+
if (sc && sc.previousElementSibling && sc.previousElementSibling.id === CARD_ID) {
|
|
55
|
+
el = sc.previousElementSibling;
|
|
56
|
+
}
|
|
57
|
+
if (!el) { el = document.getElementById(CARD_ID); }
|
|
58
|
+
if (!el && document.querySelector) { el = document.querySelector('#' + CARD_ID); }
|
|
59
|
+
return el;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
var root = getRoot();
|
|
63
|
+
if (!root) { return; }
|
|
64
|
+
|
|
65
|
+
var statusEl = root.querySelector('[data-status]');
|
|
66
|
+
function say(m) { if (statusEl) { statusEl.textContent = m; } }
|
|
67
|
+
|
|
68
|
+
function getPlugin() {
|
|
69
|
+
if (window.xiaoePlugin) { return window.xiaoePlugin; }
|
|
70
|
+
if (window.rawWindow && window.rawWindow.xiaoePlugin) { return window.rawWindow.xiaoePlugin; }
|
|
71
|
+
return null;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
var DETAIL_CFG = {{DETAIL_CFG}};
|
|
75
|
+
|
|
76
|
+
function openDetail() {
|
|
77
|
+
var plugin = getPlugin();
|
|
78
|
+
if (!plugin || !plugin.rightPanel || typeof plugin.rightPanel.open !== 'function') {
|
|
79
|
+
say('当前环境不支持打开右侧面板,请在小e客户端内查看');
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
say('正在打开审查详情…');
|
|
83
|
+
try {
|
|
84
|
+
plugin.rightPanel.open(DETAIL_CFG);
|
|
85
|
+
say('');
|
|
86
|
+
} catch (err) {
|
|
87
|
+
say('审查详情打开失败,请确认右侧面板已挂载');
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
// 导出前先克隆,去掉脚本、按钮与提示位,得到干净的静态报告
|
|
92
|
+
function cleanClone() {
|
|
93
|
+
var clone = root.cloneNode(true);
|
|
94
|
+
var nodes = clone.querySelectorAll('script, [data-act], [data-status]');
|
|
95
|
+
var i;
|
|
96
|
+
for (i = nodes.length - 1; i >= 0; i--) {
|
|
97
|
+
if (nodes[i].parentNode) { nodes[i].parentNode.removeChild(nodes[i]); }
|
|
98
|
+
}
|
|
99
|
+
return clone;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
function downloadReport() {
|
|
103
|
+
var doc = root.ownerDocument || document;
|
|
104
|
+
var clone = cleanClone();
|
|
105
|
+
var html = '<!DOCTYPE html><html><head><meta charset=\'utf-8\'>'
|
|
106
|
+
+ '<title>' + FILE_BASE + '</title>'
|
|
107
|
+
+ '<style>body{margin:0;padding:16px;background:#fafbfd;font-family:sans-serif}'
|
|
108
|
+
+ '@media print{body{background:#fff}}</style></head><body>'
|
|
109
|
+
+ clone.outerHTML + '</body></html>';
|
|
110
|
+
|
|
111
|
+
if (!window.Blob || !window.URL || typeof window.URL.createObjectURL !== 'function') {
|
|
112
|
+
say('当前环境不支持文件下载,请在小e客户端内使用');
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
var url;
|
|
117
|
+
try {
|
|
118
|
+
url = window.URL.createObjectURL(new Blob([html], { type: 'text/html;charset=utf-8' }));
|
|
119
|
+
} catch (err) {
|
|
120
|
+
say('报告生成失败,请稍后重试');
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
var a = doc.createElement('a');
|
|
125
|
+
a.href = url;
|
|
126
|
+
a.download = FILE_BASE + '.html';
|
|
127
|
+
a.style.display = 'none';
|
|
128
|
+
if (doc.body && doc.body.appendChild) { doc.body.appendChild(a); }
|
|
129
|
+
a.click();
|
|
130
|
+
if (a.parentNode) { a.parentNode.removeChild(a); }
|
|
131
|
+
setTimeout(function () { window.URL.revokeObjectURL(url); }, 1500);
|
|
132
|
+
say('报告已开始下载:' + FILE_BASE + '.html');
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
// 事件委托:绑定在报告根节点上,避免子元素取不到导致点击无响应
|
|
136
|
+
root.addEventListener('click', function (e) {
|
|
137
|
+
var t = e.target;
|
|
138
|
+
var act = null;
|
|
139
|
+
while (t && t !== root) {
|
|
140
|
+
if (t.getAttribute) {
|
|
141
|
+
act = t.getAttribute('data-act');
|
|
142
|
+
if (act) { break; }
|
|
143
|
+
}
|
|
144
|
+
t = t.parentNode;
|
|
145
|
+
}
|
|
146
|
+
if (act === 'detail') { openDetail(); return; }
|
|
147
|
+
if (act === 'download') { downloadReport(); return; }
|
|
148
|
+
});
|
|
149
|
+
|
|
150
|
+
root.addEventListener('mouseover', function (e) {
|
|
151
|
+
var t = e.target;
|
|
152
|
+
var act = null;
|
|
153
|
+
while (t && t !== root) {
|
|
154
|
+
if (t.getAttribute) {
|
|
155
|
+
act = t.getAttribute('data-act');
|
|
156
|
+
if (act) { break; }
|
|
157
|
+
}
|
|
158
|
+
t = t.parentNode;
|
|
159
|
+
}
|
|
160
|
+
if (act === 'detail') { t.style.background = '#1659b8'; }
|
|
161
|
+
if (act === 'download') { t.style.background = '#eef4fd'; }
|
|
162
|
+
});
|
|
163
|
+
|
|
164
|
+
root.addEventListener('mouseout', function (e) {
|
|
165
|
+
var t = e.target;
|
|
166
|
+
var act = null;
|
|
167
|
+
while (t && t !== root) {
|
|
168
|
+
if (t.getAttribute) {
|
|
169
|
+
act = t.getAttribute('data-act');
|
|
170
|
+
if (act) { break; }
|
|
171
|
+
}
|
|
172
|
+
t = t.parentNode;
|
|
173
|
+
}
|
|
174
|
+
if (act === 'detail') { t.style.background = '#1d6fd8'; }
|
|
175
|
+
if (act === 'download') { t.style.background = '#fff'; }
|
|
176
|
+
});
|
|
177
|
+
})();
|
|
178
|
+
</script>
|
|
@@ -41,7 +41,7 @@ CLI 已把上述字段映射成 `recommendations[]`(`fileName`、`matchScore`
|
|
|
41
41
|
|
|
42
42
|
1. `contract.recommend.doc` 传整理后的需求描述。
|
|
43
43
|
2. **先用表格向用户展示**:排名 / 文件名 / 匹配分 / 合同类型 / 风险等级 / 匹配理由。
|
|
44
|
-
3. 再打开结果页:`data.url` = `{baseUrl}/sp/contract/business/template-list?recommendKey={cacheKey}`,带 `"width":
|
|
44
|
+
3. 再打开结果页:`data.url` = `{baseUrl}/sp/contract/business/template-list?recommendKey={cacheKey}`,带 `"width": 1200`。
|
|
45
45
|
4. `status = EMPTY` 表示没有匹配到范文,如实说明,不要编造模板名。
|
|
46
46
|
|
|
47
47
|
耗时提示:服务端 AI 语义匹配本身需要 **30~40 秒**,CLI 超时设为 180 秒。**慢不是失败,不要重试、不要换接口**。
|
|
@@ -202,12 +202,12 @@ S3 的唯一产物是 `next1ptions`。它必须能让人**不看上下文也能
|
|
|
202
202
|
| 要求 | 说明 |
|
|
203
203
|
|---|---|
|
|
204
204
|
| `arguments.title` | **每轮动态**,`<对象> · <这轮能给什么>`,≤20 字;它会成为右侧 HTML 文件名 |
|
|
205
|
-
| `
|
|
206
|
-
| `
|
|
207
|
-
| `
|
|
208
|
-
| `
|
|
209
|
-
| `
|
|
210
|
-
| `
|
|
205
|
+
| `arguments.width` | 带 `1300`,与 `type` / `title` / `src` 同级;禁止塞进 `customParams` 或 `sdkOptions` |
|
|
206
|
+
| `customParams.html` | **形态 B(`xiaoeCustomPage`)单串 HTML**,内嵌 `<script>` 绑点击;每个动作一张整卡可点的卡片,条数与本轮动作数一致,>4 时只列前 4。**禁止**把 `XiaoeList` 的 `customParams.items[]` 用于行为卡片——其 `detailHtml` 会被剥掉 `script`/`style`,用户点了毫无反应 |
|
|
207
|
+
| `id` | 每张卡 `<section>` 的全局唯一 id(`场景-YYYYMMDD-HHmm-4位随机`),跨轮次禁止复用;脚本用 `getElementById('<该id>')` 定位,禁用共享容器 `querySelector` |
|
|
208
|
+
| `title` | 卡片标题,动作名动词开头,与四要素①**一字不差**;排序第一那条加「推荐」徽标(HTML 内实现,**无** `recommended` 字段) |
|
|
209
|
+
| `description` | 四要素②③④压成一句,放卡片标题下的灰色描述行(全角竖线 `|` 分隔) |
|
|
210
|
+
| `script` 约束 | **只用 ES5**(禁 `??` / `?.` / 箭头函数 / `const` / `let` / 模板字符串);html 内**双引号数量为 0**;交付前 `node --check` 必须退出码 0 |
|
|
211
211
|
|
|
212
212
|
结构性关闭的动作**不进卡片**;缺证据的动作**要进**,`description` 写「缺 X」。完整结构、转义规则与 8 个常见坑见 [`contract-action-card.md`](contract-action-card.md)。
|
|
213
213
|
|
|
@@ -218,7 +218,7 @@ S3 的唯一产物是 `next1ptions`。它必须能让人**不看上下文也能
|
|
|
218
218
|
| 出口 | 动作名 | 一句收益 | 证据要求 | 代价 | 是否写数据 |
|
|
219
219
|
|---|---|---|---|---|---|
|
|
220
220
|
| E1 | 发起审批 | 生成正式审批单并进入流转 | `flowKey` 非 null + `contractType` 与 `type.tree` 对齐(带文件时还要 `fileId`) | 4~7 步 · 需确认 2 次(创建/保存、提交) | ✅ 写 |
|
|
221
|
-
| E2 |
|
|
221
|
+
| E2 | 合同预审(风险审查) | 出风险条款、要素与修改建议 | `fileId` 或 `requestId` | 2 步 · 只读(仅上传动作写文件) | 上传写文件 |
|
|
222
222
|
| E3 | 条款/表单改写 | 给出改前/改后 diff 再写回 | `fileId` 或 `requestId` | 3~5 步 · 写回需确认 1 次 | ✅ 写 |
|
|
223
223
|
| E4 | 抽要素 | 抽履约/风险/专项三项,用于预填与核对 | `fileId` | 2~3 步 · 只读 | ❌ 只读 |
|
|
224
224
|
| E5 | 文本比对 | 出差异清单与摘要 | 至少 1 份基准文件 + 1 份被比对文件 | 3 步 · 只读 | ❌ 只读 |
|
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
# -*- coding: utf-8 -*-
|
|
3
|
+
"""
|
|
4
|
+
plan_actions.py — 合同动作推荐引擎(可执行实现,2026-11-09 新增)
|
|
5
|
+
|
|
6
|
+
背景:此前 `contract-action-engine.md` 只是算法文档,1~4 张卡片全靠模型每次手算,
|
|
7
|
+
实测出现「预审后只给 1 张报告卡、漏掉查看审查详情/发起流程/查资信」的偏差。
|
|
8
|
+
本脚本把注册表、requires、抑制、排序、截断固化为可执行逻辑,
|
|
9
|
+
模型只需提供上下文状态 JSON,不再自行推断卡片条数。
|
|
10
|
+
|
|
11
|
+
用法:
|
|
12
|
+
python scripts/plan_actions.py --context ctx.json
|
|
13
|
+
python scripts/plan_actions.py --context ctx.json --pretty
|
|
14
|
+
也可以传 JSON 字符串: python scripts/plan_actions.py --context-json '{"reviewed":true,...}'
|
|
15
|
+
|
|
16
|
+
上下文(全部可选,缺省为 false / null):
|
|
17
|
+
scene doc | query | config(默认 doc)
|
|
18
|
+
docType contract | quote | tender | other
|
|
19
|
+
hasFileId 已有审查用 fileId
|
|
20
|
+
flowKey 契约锁 | 新客户 | 常规二次销售 | 老客户增值 | null
|
|
21
|
+
hasCounterparty 有对方企业全称
|
|
22
|
+
summaryReady 摘要已生成
|
|
23
|
+
reviewStarted 预审已触发(已预热/审查在跑),但**尚未拿到审查结果**
|
|
24
|
+
reviewed 已拿到审查结果(只有它为真才允许导出审查报告)
|
|
25
|
+
submitted 流程已发起
|
|
26
|
+
requestId 流程实例 id
|
|
27
|
+
compared 已完成比对
|
|
28
|
+
comparePair 比对文件对
|
|
29
|
+
compareReportReady 比对报告已生成
|
|
30
|
+
generatedDocx 报价单已生成合同
|
|
31
|
+
otherVersionAvailable 会话内存在另一版本
|
|
32
|
+
lastAction 上一步刚执行的动作 id(本轮剔除)
|
|
33
|
+
|
|
34
|
+
输出:JSON(count / title / cards[]),退出码 0。FAIL 情形返回 1 并说明缺口。
|
|
35
|
+
"""
|
|
36
|
+
|
|
37
|
+
import argparse
|
|
38
|
+
import io
|
|
39
|
+
import json
|
|
40
|
+
import sys
|
|
41
|
+
|
|
42
|
+
MAX_CARDS = 4
|
|
43
|
+
|
|
44
|
+
# ── 动作注册表 ───────────────────────────────────────────────
|
|
45
|
+
# requires : 全部为真才进候选
|
|
46
|
+
# blocked : 任一为真则退场(终态不回推 / 已完成不重复)
|
|
47
|
+
# walk : e10Sdk(系统页面已存在)/ artifact(内容已在手)/ sendQuestion(需现场加工)
|
|
48
|
+
ACTIONS = [
|
|
49
|
+
{
|
|
50
|
+
"id": "generate-contract",
|
|
51
|
+
"title": "按报价单生成合同",
|
|
52
|
+
"weight": 100,
|
|
53
|
+
"walk": "sendQuestion",
|
|
54
|
+
"desc": "用真实模板把标的与金额填成合同 docx | 缺 .docx 模板 | 3~5 步 · 确认 1 次",
|
|
55
|
+
"requires": {"docType": ["quote", "tender"]},
|
|
56
|
+
"blocked": ["generatedDocx"],
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"id": "launch-flow",
|
|
60
|
+
"title": "发起「{flowKey}」合同流程",
|
|
61
|
+
"weight": 100,
|
|
62
|
+
"walk": "e10Sdk",
|
|
63
|
+
"desc": "生成正式审批单并进入流转 | 证据齐 | 4~7 步 · 确认 2 次",
|
|
64
|
+
"requires": {"flowKey": "set", "hasFileId": True},
|
|
65
|
+
"blocked": ["submitted"],
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"id": "review",
|
|
69
|
+
"title": "合同预审",
|
|
70
|
+
"weight": 92,
|
|
71
|
+
"walk": "sendQuestion",
|
|
72
|
+
"desc": "发消息让 AI 出风险条款与修改建议 | 只读,不改原文",
|
|
73
|
+
"requires": {"hasFileId": True},
|
|
74
|
+
# 已经触发过审查(reviewStarted)就不再给「合同预审」,避免重复触发
|
|
75
|
+
"blocked": ["reviewed", "reviewStarted"],
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
"id": "export-review",
|
|
79
|
+
"title": "导出审查报告",
|
|
80
|
+
"weight": 84,
|
|
81
|
+
"walk": "artifact",
|
|
82
|
+
"desc": "查看风险条款、问题说明与建议修改 | 只读 | 点开即看",
|
|
83
|
+
# 只有「已拿到审查结果」才允许导出;reviewStarted 但无结果时不得出现
|
|
84
|
+
"requires": {"reviewed": True},
|
|
85
|
+
"blocked": [],
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
"id": "view-compare",
|
|
89
|
+
"title": "查看比对详情",
|
|
90
|
+
"weight": 82,
|
|
91
|
+
"walk": "e10Sdk",
|
|
92
|
+
"desc": "左右对照看两版差异 | 只读,仅开页面",
|
|
93
|
+
"requires": {"compared": True},
|
|
94
|
+
"blocked": [],
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
"id": "view-review",
|
|
98
|
+
"title": "查看审查详情",
|
|
99
|
+
"weight": 80,
|
|
100
|
+
"walk": "e10Sdk",
|
|
101
|
+
"desc": "打开 AI 审查页看逐条判定与原文定位 | 只读,不改原文",
|
|
102
|
+
# 审查进行中(reviewStarted)与已出结果(reviewed)两种情况都要给:
|
|
103
|
+
# 前者是用户稍后回来看进度的唯一入口,后者可看逐条判定
|
|
104
|
+
"requires": {},
|
|
105
|
+
"any_of": [{"reviewed": True}, {"reviewStarted": True}],
|
|
106
|
+
"blocked": [],
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
"id": "export-compare-report",
|
|
110
|
+
"title": "生成比对报告",
|
|
111
|
+
"weight": 78,
|
|
112
|
+
"walk": "artifact",
|
|
113
|
+
"desc": "出四指标统计与差异清单 | 只读 | 点开即看",
|
|
114
|
+
"requires": {"compared": True},
|
|
115
|
+
"blocked": [],
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
"id": "credit",
|
|
119
|
+
"title": "查对方资信",
|
|
120
|
+
"weight": 72,
|
|
121
|
+
"walk": "e10Sdk",
|
|
122
|
+
"desc": "看诉讼/被执行/工商变更 | 只开页面,只读",
|
|
123
|
+
"requires": {"hasCounterparty": True},
|
|
124
|
+
"blocked": [],
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
"id": "request-status",
|
|
128
|
+
"title": "查这份合同的审批进度",
|
|
129
|
+
"weight": 70,
|
|
130
|
+
"walk": "sendQuestion",
|
|
131
|
+
"desc": "看当前节点与审批意见 | 只读 | 1~2 步",
|
|
132
|
+
"requires": {"submitted": True, "requestId": "set"},
|
|
133
|
+
"blocked": [],
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
"id": "compare",
|
|
137
|
+
"title": "比对两份合同",
|
|
138
|
+
"weight": 60,
|
|
139
|
+
"walk": "e10Sdk",
|
|
140
|
+
"desc": "逐条比差异 | 需两份文件 | 2~3 步",
|
|
141
|
+
"requires": {"otherVersionAvailable": True},
|
|
142
|
+
"blocked": ["compared"],
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
"id": "clause-rewrite",
|
|
146
|
+
"title": "按建议改条款",
|
|
147
|
+
"weight": 56,
|
|
148
|
+
"walk": "sendQuestion",
|
|
149
|
+
"desc": "把建议条款写回合同 | 会改原文 | 需确认 2 次",
|
|
150
|
+
"requires": {"reviewed": True},
|
|
151
|
+
"blocked": [],
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
"id": "summary",
|
|
155
|
+
"title": "查看合同摘要",
|
|
156
|
+
"weight": 28,
|
|
157
|
+
"walk": "artifact",
|
|
158
|
+
"desc": "要素、标的与关键条款 | 只读 | 点开即看",
|
|
159
|
+
"requires": {"summaryReady": True},
|
|
160
|
+
"blocked": [],
|
|
161
|
+
},
|
|
162
|
+
]
|
|
163
|
+
|
|
164
|
+
# scene ≠ doc 时的动作域(query / config 不处理合同文件)
|
|
165
|
+
QUERY_ACTIONS = [
|
|
166
|
+
{"id": "query-contracts", "title": "查我负责的合同", "weight": 100, "walk": "sendQuestion",
|
|
167
|
+
"desc": "按负责人查合同列表 | 只读", "requires": {}, "blocked": []},
|
|
168
|
+
{"id": "query-performance", "title": "查直销业绩", "weight": 90, "walk": "sendQuestion",
|
|
169
|
+
"desc": "按期间汇总直销业绩 | 只读", "requires": {}, "blocked": []},
|
|
170
|
+
{"id": "query-receipts", "title": "查合同收款", "weight": 80, "walk": "sendQuestion",
|
|
171
|
+
"desc": "按合同号查收款台账 | 只读", "requires": {}, "blocked": []},
|
|
172
|
+
{"id": "query-channel", "title": "查渠道订单", "weight": 70, "walk": "sendQuestion",
|
|
173
|
+
"desc": "按渠道查订单 | 只读", "requires": {}, "blocked": []},
|
|
174
|
+
]
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
def _ok(rule_value, ctx):
|
|
178
|
+
if rule_value is True:
|
|
179
|
+
return bool(ctx.get("hasFileId") if False else True)
|
|
180
|
+
return True
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
def _match_one(cond, ctx):
|
|
184
|
+
"""单个条件组:全部为真才通过。"""
|
|
185
|
+
for key, expect in cond.items():
|
|
186
|
+
actual = ctx.get(key)
|
|
187
|
+
if expect == "set":
|
|
188
|
+
if actual in (None, "", False):
|
|
189
|
+
return False
|
|
190
|
+
continue
|
|
191
|
+
if isinstance(expect, list):
|
|
192
|
+
if actual not in expect:
|
|
193
|
+
return False
|
|
194
|
+
continue
|
|
195
|
+
if bool(actual) != bool(expect):
|
|
196
|
+
return False
|
|
197
|
+
return True
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
def matches(action, ctx):
|
|
201
|
+
"""requires 判定:requires 全真 且 (无 any_of 或任一分支全真)。"""
|
|
202
|
+
if not _match_one(action.get("requires") or {}, ctx):
|
|
203
|
+
return False
|
|
204
|
+
any_of = action.get("any_of")
|
|
205
|
+
if any_of:
|
|
206
|
+
if not any(_match_one(c, ctx) for c in any_of):
|
|
207
|
+
return False
|
|
208
|
+
return True
|
|
209
|
+
|
|
210
|
+
|
|
211
|
+
def suppressed(action, ctx):
|
|
212
|
+
"""抑制判定:终态不回推、已完成不重复、本轮刚执行的不立刻回推。"""
|
|
213
|
+
aid = action["id"]
|
|
214
|
+
for key in action.get("blocked", []):
|
|
215
|
+
if ctx.get(key):
|
|
216
|
+
return True
|
|
217
|
+
if ctx.get("lastAction") == aid:
|
|
218
|
+
return True
|
|
219
|
+
return False
|
|
220
|
+
|
|
221
|
+
|
|
222
|
+
def plan(ctx):
|
|
223
|
+
scene = ctx.get("scene") or "doc"
|
|
224
|
+
pool = QUERY_ACTIONS if scene in ("query", "config") else ACTIONS
|
|
225
|
+
|
|
226
|
+
scored = []
|
|
227
|
+
for a in pool:
|
|
228
|
+
if not matches(a, ctx):
|
|
229
|
+
continue
|
|
230
|
+
if suppressed(a, ctx):
|
|
231
|
+
continue
|
|
232
|
+
scored.append(a)
|
|
233
|
+
|
|
234
|
+
scored.sort(key=lambda x: (-x["weight"], x["id"]))
|
|
235
|
+
picked = scored[:MAX_CARDS]
|
|
236
|
+
|
|
237
|
+
cards = []
|
|
238
|
+
for a in picked:
|
|
239
|
+
title = a["title"].replace("{flowKey}", str(ctx.get("flowKey") or ""))
|
|
240
|
+
cards.append({
|
|
241
|
+
"id": a["id"],
|
|
242
|
+
"title": title,
|
|
243
|
+
"weight": a["weight"],
|
|
244
|
+
"walk": a["walk"],
|
|
245
|
+
"desc": a["desc"],
|
|
246
|
+
})
|
|
247
|
+
|
|
248
|
+
return {
|
|
249
|
+
"scene": scene,
|
|
250
|
+
"count": len(cards),
|
|
251
|
+
"title": "可做的 %d 件事" % len(cards),
|
|
252
|
+
"cards": cards,
|
|
253
|
+
"dropped": [a["id"] for a in scored[MAX_CARDS:]],
|
|
254
|
+
"hint": "" if cards else "按 contract-action-engine.md §7 空结果处理:不出卡片,说明缺什么与补法",
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
|
|
258
|
+
def main():
|
|
259
|
+
ap = argparse.ArgumentParser(description="合同动作推荐引擎")
|
|
260
|
+
ap.add_argument("--context", help="上下文状态 JSON 文件")
|
|
261
|
+
ap.add_argument("--context-json", help="上下文状态 JSON 字符串")
|
|
262
|
+
ap.add_argument("--pretty", action="store_true", help="缩进输出")
|
|
263
|
+
args = ap.parse_args()
|
|
264
|
+
|
|
265
|
+
if args.context:
|
|
266
|
+
with io.open(args.context, "r", encoding="utf-8-sig") as f:
|
|
267
|
+
ctx = json.load(f)
|
|
268
|
+
elif args.context_json:
|
|
269
|
+
ctx = json.loads(args.context_json)
|
|
270
|
+
else:
|
|
271
|
+
ap.error("必须提供 --context 或 --context-json")
|
|
272
|
+
|
|
273
|
+
result = plan(ctx)
|
|
274
|
+
print(json.dumps(result, ensure_ascii=False, indent=2 if args.pretty else None))
|
|
275
|
+
return 0
|
|
276
|
+
|
|
277
|
+
|
|
278
|
+
if __name__ == "__main__":
|
|
279
|
+
sys.exit(main())
|