weaver-work-cli 0.1.49 → 0.1.52
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/README.md +1 -1
- package/dist/chunks/{attachment-content-MU2LPI5P.js → attachment-content-MBYYSQIX.js} +3 -3
- package/dist/chunks/{chunk-ZKEUGS2U.js → chunk-7UOXOGFL.js} +4 -4
- package/dist/chunks/{chunk-72MI3MBX.js → chunk-ATEXBEPD.js} +55 -15
- package/dist/chunks/{chunk-3NV2ETZR.js → chunk-D3TDNRFE.js} +8 -8
- package/dist/chunks/{chunk-6GWU63YF.js → chunk-DZOC77ZD.js} +1 -1
- package/dist/chunks/{chunk-K3BT54CU.js → chunk-IRMA3GVP.js} +1 -1
- package/dist/chunks/{chunk-3X7VOSBA.js → chunk-KLZ3ULQQ.js} +1 -1
- package/dist/chunks/{chunk-YLCYX7LE.js → chunk-KMRT7NAT.js} +18 -5
- package/dist/chunks/{chunk-NBEWUR7L.js → chunk-LALWNK6M.js} +167 -44
- package/dist/chunks/{chunk-BRRW7CWA.js → chunk-LM2H7SZI.js} +26 -26
- package/dist/chunks/{chunk-KV5SOWMS.js → chunk-LTRLF6MM.js} +4 -4
- package/dist/chunks/{chunk-D2QRZUW4.js → chunk-RPRFIG6I.js} +35 -28
- package/dist/chunks/{chunk-GEOMANP7.js → chunk-RWFRZSIP.js} +2 -2
- package/dist/chunks/{chunk-EJVA5ZVB.js → chunk-ZRHKGQRQ.js} +2 -2
- package/dist/chunks/{conflict-6347A7YK.js → conflict-D2HYKBMH.js} +2 -2
- package/dist/chunks/{contract-N6P2HIIE.js → contract-MFOFMM2J.js} +4284 -254
- package/dist/chunks/{create-flow-7WG7LVX5.js → create-flow-7ZATJVTM.js} +6 -6
- package/dist/chunks/{data-QO7QWOIV.js → data-WK5CQXNF.js} +17 -32
- package/dist/chunks/{env-LHRKSLG6.js → env-5DO4YENS.js} +2 -2
- package/dist/chunks/{factory-2H7Z4RWJ.js → factory-3M7D7WJC.js} +1 -1
- package/dist/chunks/{fna-ZVB2IILI.js → fna-ECOYBQYL.js} +328 -5
- package/dist/chunks/{group-chat-EW6PNDDT.js → group-chat-B2HT5NEO.js} +3 -3
- package/dist/chunks/{im-3RCNL5GT.js → im-TN2JYVGJ.js} +2 -2
- package/dist/chunks/{invoice-FXWH5GPO.js → invoice-V7ZTITUO.js} +726 -206
- package/dist/chunks/{meeting-N2FQBHXI.js → meeting-HZOX3CBB.js} +10 -10
- package/dist/chunks/{msg-parse-4GSQ2WTO.js → msg-parse-FPFVPMYI.js} +5 -1
- package/dist/chunks/{reception-MYOKJULO.js → reception-QGPNTGHG.js} +98 -82
- package/dist/chunks/{recruit-stage-FKWS5UQF.js → recruit-stage-XCMVEQA2.js} +718 -131
- package/dist/chunks/{registry-BUTEDK3C.js → registry-E5RQJVWN.js} +2 -2
- package/dist/chunks/{registry-7VZ6YJUF.js → registry-KYPFFQIH.js} +1 -1
- package/dist/chunks/{registry-CKUVBS53.js → registry-SJHSBO5G.js} +10 -10
- package/dist/chunks/{room-recommend-MBCYENQ2.js → room-recommend-5AHR4YQV.js} +4 -4
- package/dist/chunks/{schedule-5IFMCXME.js → schedule-KZPJUPC2.js} +4 -4
- package/dist/chunks/smart-extract-IXHCZE4R.js +2846 -0
- package/dist/chunks/{workflow-2TRU2ZSP.js → workflow-UHKCZJMY.js} +1 -1
- package/dist/index.js +14 -9
- package/dist/shortcuts/contract/host.js +11 -0
- package/dist/shortcuts/contract/index.js +13 -0
- package/dist/shortcuts/contract/manifest.js +204 -0
- package/dist/shortcuts/contract/operations/card-action.js +585 -0
- package/dist/shortcuts/contract/operations/card-ebdf-list.js +315 -0
- package/dist/shortcuts/contract/operations/card-plan.js +327 -0
- package/dist/shortcuts/contract/operations/card-risk-report.js +565 -0
- package/dist/shortcuts/contract/operations/elements-build.js +714 -0
- package/dist/shortcuts/contract/operations/elements-spec.js +216 -0
- package/dist/shortcuts/contract/operations/first-screen.js +563 -0
- package/dist/shortcuts/contract/operations/flow.js +81 -25
- package/dist/shortcuts/contract/operations/modeltext.js +132 -0
- package/dist/shortcuts/contract/operations/op-resolver.js +22 -0
- package/dist/shortcuts/contract/operations/performance.js +58 -7
- package/dist/shortcuts/contract/operations/quote.js +410 -22
- package/dist/shortcuts/contract/operations/registry.js +22 -0
- package/dist/shortcuts/contract/operations/review.js +73 -58
- package/dist/shortcuts/contract/operations/save-recognize.js +151 -0
- package/dist/shortcuts/contract/operations/summary-validate.js +293 -0
- package/dist/shortcuts/contract/operations/summary.js +4 -2
- package/dist/shortcuts/contract/operations/upload.js +48 -7
- package/dist/shortcuts/contract/prewarm-cache.js +90 -0
- package/dist/shortcuts/contract/prewarm.js +88 -0
- package/dist/shortcuts/contract/upload-cache.js +49 -4
- package/dist/shortcuts/data/index.js +1 -6
- package/dist/shortcuts/data/manifest.js +2 -2
- package/dist/shortcuts/data/operations/index.js +1 -1
- package/dist/shortcuts/data/operations/query.js +23 -46
- package/dist/shortcuts/fna/host.js +4 -2
- package/dist/shortcuts/fna/manifest.js +14 -5
- package/dist/shortcuts/fna/operations/audit.js +334 -0
- package/dist/shortcuts/fna/operations/registry.js +2 -0
- package/dist/shortcuts/im/operations/at-mention.js +6 -3
- package/dist/shortcuts/im/operations/msg-parse.js +35 -5
- package/dist/shortcuts/im/operations/msg-sync.js +3 -1
- package/dist/shortcuts/im/operations/msg-write.js +57 -9
- package/dist/shortcuts/index.js +5 -0
- package/dist/shortcuts/invoice/index.js +0 -12
- package/dist/shortcuts/invoice/manifest.js +201 -50
- package/dist/shortcuts/invoice/operations/registry.js +4 -2
- package/dist/shortcuts/invoice/operations/reim-relation.js +438 -0
- package/dist/shortcuts/invoice/operations/shared.js +3 -19
- package/dist/shortcuts/invoice/operations/upload-and-validate.js +109 -73
- package/dist/shortcuts/meeting/operations/from-group-chat.js +16 -2
- package/dist/shortcuts/reception/constants.js +3 -7
- package/dist/shortcuts/reception/operations/leads.js +30 -6
- package/dist/shortcuts/reception/operations/panels.js +3 -2
- package/dist/shortcuts/recruit-stage/operations/interview-arrange.js +4 -2
- package/dist/shortcuts/recruit-stage/operations/jd-create.js +6 -2
- package/dist/shortcuts/recruit-stage/operations/list.js +217 -1
- package/dist/shortcuts/recruit-stage/operations/resume-import.js +144 -158
- package/dist/shortcuts/recruit-stage/operations/search.js +348 -0
- package/dist/shortcuts/recruit-stage/shared.js +5 -0
- package/dist/shortcuts/recruit-stage/tag-lookup.js +136 -0
- package/dist/shortcuts/smart-extract/constants.js +79 -0
- package/dist/shortcuts/smart-extract/continuation.js +71 -0
- package/dist/shortcuts/smart-extract/errors.js +68 -0
- package/dist/shortcuts/smart-extract/host.js +191 -0
- package/dist/shortcuts/smart-extract/index.js +105 -0
- package/dist/shortcuts/smart-extract/ledger.js +70 -0
- package/dist/shortcuts/smart-extract/manifest.js +35 -0
- package/dist/shortcuts/smart-extract/operations/attachment.js +212 -0
- package/dist/shortcuts/smart-extract/operations/batch.js +67 -0
- package/dist/shortcuts/smart-extract/operations/config.js +118 -0
- package/dist/shortcuts/smart-extract/operations/fill.js +489 -0
- package/dist/shortcuts/smart-extract/operations/preview.js +174 -0
- package/dist/shortcuts/smart-extract/operations/registry.js +34 -0
- package/dist/shortcuts/smart-extract/operations/save.js +355 -0
- package/dist/shortcuts/smart-extract/operations/shared.js +191 -0
- package/dist/shortcuts/smart-extract/operations/structure.js +401 -0
- package/dist/shortcuts/smart-extract/operations/target.js +167 -0
- package/dist/shortcuts/smart-extract/operations/types.js +22 -0
- package/dist/shortcuts/smart-extract/operations/validate.js +408 -0
- package/dist/shortcuts/workflow/operations/read.js +77 -15
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.collect.js +140 -24
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.core.js +42 -14
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.js +4 -6
- package/docs/SKILL.md +1 -1
- package/docs/_catalog.md +4 -1
- package/docs/agent-invoice.md +5 -7
- package/docs/data.md +5 -1
- package/docs/fna.md +24 -4
- package/docs/invoice.md +7 -5
- package/docs/smart-extract.md +156 -0
- package/package.json +1 -1
- package/skill-template/business-info.json +21 -1
- package/skill-template/domains/qiyecheng.md +6 -2
- package/skill-template/domains/smart-extract.md +16 -0
- package/skill-template/domains/yepiaotong.md +2 -2
- package/skills/weaver-e10-data/references/scene-and-misc.md +4 -3
- package/skills/weaver-e10-jinchengda/SKILL.md +159 -11
- package/skills/weaver-e10-jinchengda/references/contract-action-card.md +13 -8
- package/skills/weaver-e10-jinchengda/references/contract-action-engine.md +5 -4
- package/skills/weaver-e10-jinchengda/references/contract-clause-library-crud.md +44 -2
- package/skills/weaver-e10-jinchengda/references/contract-command-index.md +2 -2
- package/skills/weaver-e10-jinchengda/references/contract-element-save-record.md +220 -0
- package/skills/weaver-e10-jinchengda/references/contract-field-extract-new-customer.md +68 -33
- package/skills/weaver-e10-jinchengda/references/contract-field-extract-other-flows.md +26 -15
- package/skills/weaver-e10-jinchengda/references/contract-flow-launch.md +1 -1
- package/skills/weaver-e10-jinchengda/references/contract-modeltext-library.md +128 -0
- package/skills/weaver-e10-jinchengda/references/contract-multi-file.md +90 -0
- package/skills/weaver-e10-jinchengda/references/contract-performance-query.md +96 -2
- package/skills/weaver-e10-jinchengda/references/contract-quote-to-contract.md +167 -5
- package/skills/weaver-e10-jinchengda/scripts/contract_first_screen.py +200 -0
- package/skills/weaver-e10-jinchengda/scripts/fill_contract_from_quote.py +572 -0
- package/skills/weaver-e10-jinchengda/scripts/fill_plan.py +997 -0
- package/skills/weaver-e10-jinchengda/scripts/quote_screen.py +560 -0
- package/skills/weaver-e10-jinchengda/scripts/triage_contract.py +894 -0
- package/skills/weaver-e10-jinchengda/scripts/validate_action_card.py +93 -0
- package/skills/weaver-e10-jinchengda/scripts/verify_docx_placeholders.py +118 -0
- package/skills/weaver-e10-qiyecheng/SKILL.md +58 -7
- package/skills/weaver-e10-qiyecheng/references/ai-check-audit.md +118 -0
- package/skills/weaver-e10-qiyecheng/references/budget.md +14 -0
- package/skills/weaver-e10-qiyecheng/references/catalog.md +42 -3
- package/skills/weaver-e10-qiyecheng/references/expense-center.md +8 -0
- package/skills/weaver-e10-qiyecheng/references/expense-chart.md +9 -0
- package/skills/weaver-e10-qiyecheng/references/invoice-writeoff.md +13 -0
- package/skills/weaver-e10-qiyecheng/references/loan-management.md +14 -0
- package/skills/weaver-e10-qiyecheng/references/self-hosted-mode.md +239 -0
- package/skills/weaver-e10-qiyecheng/references/source-manifest.json +153 -40
- package/skills/weaver-e10-reception-flow/SKILL.md +43 -6
- package/skills/weaver-e10-reception-flow/references/guide.md +1 -1
- package/skills/weaver-e10-recruit-stage/SKILL.md +62 -4
- package/skills/weaver-e10-recruit-stage/agents/openai.yaml +42 -8
- package/skills/weaver-e10-recruit-stage/references/env-ziyong.md +79 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-arrange-interview.md +11 -3
- package/skills/weaver-e10-recruit-stage/references/recruit-edit-interview-feedback.md +3 -2
- package/skills/weaver-e10-recruit-stage/references/recruit-interview-not-attended.md +153 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-jd-create.md +7 -4
- package/skills/weaver-e10-recruit-stage/references/recruit-match-candidates.md +1 -1
- package/skills/weaver-e10-recruit-stage/references/recruit-my-positions.md +66 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-output-links.md +156 -40
- package/skills/weaver-e10-recruit-stage/references/recruit-resume-import-batch.md +122 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-resume-import.md +36 -8
- package/skills/weaver-e10-recruit-stage/references/recruit-search-by-tag.md +157 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-utterance-glossary.md +35 -0
- package/skills/weaver-e10-smart-extract/SKILL.md +169 -0
- package/skills/weaver-e10-smart-extract/references/api-contract.md +71 -0
- package/skills/weaver-e10-smart-extract/references/result-format.md +102 -0
- package/skills/weaver-e10-smart-extract/references/troubleshooting.md +105 -0
- package/skills/weaver-e10-workflow/SKILL.md +2 -1
- package/skills/weaver-e10-workflow/references/todo-smart-convert.md +29 -6
- package/skills/weaver-e10-workflow/references/workflow-query.md +1 -1
- package/skills/weaver-e10-workflow/references/workflow-view.md +1 -1
- package/skills/weaver-e10-workflow/tools/todo-summary.cjs +162 -10
- package/skills/weaver-e10-yepiaotong/SKILL.md +53 -35
- package/skills/weaver-e10-yepiaotong/references/invoice-add.md +2 -0
- package/skills/weaver-e10-yepiaotong/references/invoice-file-upload.md +1 -1
- package/skills/weaver-e10-yepiaotong/references/invoice-import.md +19 -2
- package/skills/weaver-e10-yepiaotong/references/invoice-issuing-workflow.md +19 -32
- package/skills/weaver-e10-yepiaotong/references/invoice-ocr-preview.md +8 -2
- package/skills/weaver-e10-yepiaotong/references/invoice-reim-relation.md +407 -0
- package/skills/weaver-e10-yepiaotong/references/invoice-reim.md +18 -53
- package/skills/weaver-e10-yepiaotong/references/invoice-upload-and-validate.md +97 -39
- package/skills/weaver-e10-yepiaotong/references/reim-api-reference.md +96 -7
- package/skills/weaver-e10-yepiaotong/references/reim-examples.md +5 -38
- package/skills/weaver-e10-yepiaotong/references/reim-form-fill-rules.md +14 -14
- package/skills/weaver-e10-yepiaotong/references/reim-matching-rules.md +8 -4
- package/skills/weaver-e10-yepiaotong/references/reim-phone-subsidy-rules.md +139 -94
- package/skills/weaver-e10-yepiaotong/references/reim-workflow.md +131 -58
- package/skills/weaver-e10-yepiaotong/references/source-manifest.json +110 -43
- package/skills/weaver-e10-yimiaoban/SKILL.md +8 -6
- package/skills/weaver-e10-yimiaoban/references/msg-read.md +20 -0
- package/skills/weaver-e10-yimiaoban/references/msg-write.md +7 -0
- package/skills/weaver-e10-yimiaoban/references/source-manifest.json +18 -15
- package/dist/shortcuts/invoice/operations/validate-preview.js +0 -40
- package/skills/weaver-e10-jinchengda/scripts/plan_actions.py +0 -279
- package/skills/weaver-e10-jinchengda/scripts/render_action_card.py +0 -450
- package/skills/weaver-e10-jinchengda/scripts/render_risk_report.py +0 -358
- package/skills/weaver-e10-yepiaotong/references/invoice-validation-preview.md +0 -40
|
@@ -22,12 +22,12 @@ import {
|
|
|
22
22
|
resolveWorkflowId,
|
|
23
23
|
shapeBrowserValues,
|
|
24
24
|
shouldAutoPickFlow
|
|
25
|
-
} from "./chunk-
|
|
26
|
-
import "./chunk-
|
|
27
|
-
import "./chunk-
|
|
28
|
-
import "./chunk-
|
|
29
|
-
import "./chunk-
|
|
30
|
-
import "./chunk-
|
|
25
|
+
} from "./chunk-LM2H7SZI.js";
|
|
26
|
+
import "./chunk-7UOXOGFL.js";
|
|
27
|
+
import "./chunk-LTRLF6MM.js";
|
|
28
|
+
import "./chunk-KLZ3ULQQ.js";
|
|
29
|
+
import "./chunk-DZOC77ZD.js";
|
|
30
|
+
import "./chunk-IRMA3GVP.js";
|
|
31
31
|
import "./chunk-7BDPM5ST.js";
|
|
32
32
|
import "./chunk-UG5G54VL.js";
|
|
33
33
|
import "./chunk-BUSC6UAE.js";
|
|
@@ -418,46 +418,25 @@ function renderTable(title, rows, columns) {
|
|
|
418
418
|
}
|
|
419
419
|
|
|
420
420
|
// src/shortcuts/data/operations/query.ts
|
|
421
|
-
var QUERY_PARAM_ALIASES = [
|
|
422
|
-
["dimension", "dimension"],
|
|
423
|
-
["confGroup", "conf-group"],
|
|
424
|
-
["username", "username"],
|
|
425
|
-
["startDate", "start-date"]
|
|
426
|
-
];
|
|
427
|
-
function argStr(input, key) {
|
|
428
|
-
const value = input[key];
|
|
429
|
-
if (value === void 0 || value === null || value === true) return "";
|
|
430
|
-
return String(value).trim();
|
|
431
|
-
}
|
|
432
|
-
function buildQueryString(input) {
|
|
433
|
-
return "?" + QUERY_PARAM_ALIASES.map(([name, flag]) => {
|
|
434
|
-
const snake = flag.replace(/-/g, "_");
|
|
435
|
-
const raw = argStr(input, name) || argStr(input, snake) || argStr(input, flag);
|
|
436
|
-
return `${encodeURIComponent(name)}=${encodeURIComponent(raw)}`;
|
|
437
|
-
}).join("&");
|
|
438
|
-
}
|
|
439
421
|
async function executeQuery(input, host) {
|
|
440
422
|
const conn = needArg(input, "conn");
|
|
441
423
|
const model = needArg(input, "model");
|
|
442
424
|
const schema = needArg(input, "schema");
|
|
443
425
|
const dslRaw = needArg(input, "dsl");
|
|
426
|
+
const questionContextRaw = needArg(input, "question_context", "question-context");
|
|
444
427
|
const dslQuery = readJsonArg(dslRaw, "--dsl");
|
|
428
|
+
const questionContext = readJsonArg(questionContextRaw, "--question-context");
|
|
445
429
|
const body = {
|
|
446
430
|
connId: conn,
|
|
447
431
|
model,
|
|
448
432
|
schema,
|
|
449
433
|
tableId: input.table_id || input.tableId || "",
|
|
450
|
-
dslQuery
|
|
434
|
+
dslQuery,
|
|
435
|
+
questionContext
|
|
451
436
|
};
|
|
452
|
-
if (input.debug !== void 0 && input.debug !== null && input.debug !== "") {
|
|
453
|
-
const flag = String(input.debug).toLowerCase();
|
|
454
|
-
if (flag === "true" || flag === "1") body.debug = true;
|
|
455
|
-
else if (flag === "false" || flag === "0") body.debug = false;
|
|
456
|
-
else throw dataValidationError("debug_invalid", `--debug \u503C\u5FC5\u987B\u4E3A true \u6216 false\uFF08\u5F53\u524D: ${input.debug}\uFF09`);
|
|
457
|
-
}
|
|
458
437
|
const response = await host.request({
|
|
459
438
|
method: "POST",
|
|
460
|
-
path:
|
|
439
|
+
path: "/api/dw/dsl/executeQueryDsl",
|
|
461
440
|
body,
|
|
462
441
|
headers: { "Content-Type": "application/json;charset=utf-8" }
|
|
463
442
|
});
|
|
@@ -473,11 +452,17 @@ async function executeQuery(input, host) {
|
|
|
473
452
|
}
|
|
474
453
|
}
|
|
475
454
|
const payload = response?.data;
|
|
476
|
-
const rows = Array.isArray(payload) ? payload : payload
|
|
455
|
+
const rows = Array.isArray(payload) ? payload : Array.isArray(payload?.dataList) ? payload.dataList : Array.isArray(payload?.records) ? payload.records : [];
|
|
456
|
+
const tips = scanTips(response);
|
|
477
457
|
const lines = [];
|
|
478
458
|
if (payload && !Array.isArray(payload) && payload.sql) lines.push(`SQL: ${payload.sql}`);
|
|
479
459
|
if (String(code) !== "200" && code !== void 0) lines.push(`code=${code} msg=${response?.msg || ""}`);
|
|
480
|
-
lines.push(
|
|
460
|
+
lines.push(...tipsLines(tips.tipTimeout ? {
|
|
461
|
+
tipTimeout: true,
|
|
462
|
+
tipTimeoutMsg: tips.tipTimeoutMsg
|
|
463
|
+
} : tips));
|
|
464
|
+
if (tips.tipTimeout) lines.push("(\u5E73\u53F0\u672A\u6267\u884C\u6570\u636E\u8FD4\u56DE\uFF1A\u8BF7\u6309\u4E0A\u8FF0\u63D0\u793A\u6536\u7A84\u65F6\u95F4\u8303\u56F4)");
|
|
465
|
+
else lines.push(rows.length ? renderTable(`\u7ED3\u679C ${rows.length} \u884C`, rows) : "(\u7A7A\uFF1A0 \u884C)");
|
|
481
466
|
return { data: response, text: lines.join("\n") };
|
|
482
467
|
}
|
|
483
468
|
|
|
@@ -2150,7 +2135,7 @@ async function sceneSearch(input, host) {
|
|
|
2150
2135
|
|
|
2151
2136
|
// src/shortcuts/data/operations/index.ts
|
|
2152
2137
|
var DEFINITIONS = [
|
|
2153
|
-
{ name: "data.dsl.query", summary: "\u76F4\u63A5\u6267\u884C DSL \u67E5\u8BE2\uFF08executeQueryDsl\
|
|
2138
|
+
{ name: "data.dsl.query", summary: "\u76F4\u63A5\u6267\u884C DSL \u67E5\u8BE2\uFF08executeQueryDsl\uFF1B\u4E0E ds list/chart/stat/count \u4E3A\u72EC\u7ACB\u901A\u9053\uFF09", capability: "dsl", handler: executeQuery, command: "query" },
|
|
2154
2139
|
{ name: "data.ds.groups", summary: "\u5185\u7F6E\u6570\u636E\u6E90\u5206\u7EC4\u6E05\u5355\uFF08\u4EC5\u7528\u4E8E ds find \u7684\u9ED8\u8BA4\u626B\u63CF\u5019\u9009\u96C6\uFF09", capability: "discovery", handler: dsGroups, command: "ds groups" },
|
|
2155
2140
|
{ name: "data.ds.find", summary: "\u6309\u5173\u952E\u8BCD\u8DE8\u5206\u7EC4\u627E\u8868\uFF08\u8FDB\u7A0B\u5185\u5E76\u53D1\u6247\u51FA + \u672C\u5730\u8FC7\u6EE4 + \u8DEF\u7531\u5EFA\u8BAE\uFF09", capability: "discovery", handler: dsFind, command: "ds find" },
|
|
2156
2141
|
{ name: "data.ds.describe", summary: "\u4E00\u6B21\u5E76\u53D1\u53D6\u56DE\u5B57\u6BB5\u5143\u6570\u636E + \u8BCD\u5E93\uFF0C\u5E76\u7ED9\u51FA\u5173\u8054\u5B57\u6BB5/\u901A\u9053\u63D0\u793A", capability: "discovery", handler: dsDescribe, command: "ds describe" },
|
|
@@ -2203,8 +2188,8 @@ async function executeDataOperation(name, input, host) {
|
|
|
2203
2188
|
// src/shortcuts/data/manifest.ts
|
|
2204
2189
|
var INPUT_SCHEMAS = {
|
|
2205
2190
|
"data.dsl.query": {
|
|
2206
|
-
required: ["conn", "model", "schema", "dsl"],
|
|
2207
|
-
optional: ["table_id"
|
|
2191
|
+
required: ["conn", "model", "schema", "dsl", "question_context"],
|
|
2192
|
+
optional: ["table_id"]
|
|
2208
2193
|
},
|
|
2209
2194
|
"data.ds.groups": { required: [], optional: ["pattern"] },
|
|
2210
2195
|
"data.ds.find": {
|
|
@@ -2417,7 +2402,7 @@ var dataShortcut = {
|
|
|
2417
2402
|
data.command("run").description("Run a data operation with JSON input").argument("<operation>", `operation name, e.g. data.ds.count\uFF08\u5171 ${operationNames().length} \u4E2A\uFF09`).option("--input <path>", "JSON input file, or - for stdin").option("--input-json <json>", "inline JSON input object").action(action(async (ctx, operation, options) => {
|
|
2418
2403
|
await run(ctx, String(operation), await inputFrom(options), true);
|
|
2419
2404
|
}));
|
|
2420
|
-
data.command("query").description("\u76F4\u63A5\u6267\u884C DSL \u67E5\u8BE2\uFF08executeQueryDsl\uFF09").option("--conn <connId>", "\u6570\u636E\u8FDE\u63A5 ID\uFF08CONN_*\uFF09").option("--model <model>", "\u6A21\u578B\u6807\u8BC6\uFF0C\u5982 dw / ebuilder / flow").option("--schema <schema>", "\u5E93\u540D").option("--table-id <id>", "\u6570\u636E\u96C6 / \u6D41\u7A0B ID").option("--dsl <json|@file>", "DSL \u67E5\u8BE2\u4F53").
|
|
2405
|
+
data.command("query").description("\u76F4\u63A5\u6267\u884C DSL \u67E5\u8BE2\uFF08executeQueryDsl\uFF09").option("--conn <connId>", "\u6570\u636E\u8FDE\u63A5 ID\uFF08CONN_*\uFF09").option("--model <model>", "\u6A21\u578B\u6807\u8BC6\uFF0C\u5982 dw / ebuilder / flow").option("--schema <schema>", "\u5E93\u540D").option("--table-id <id>", "\u6570\u636E\u96C6 / \u6D41\u7A0B ID").option("--dsl <json|@file>", "DSL \u67E5\u8BE2\u4F53").requiredOption("--question-context <json|@file>", "\u95EE\u53E5\u4E0A\u4E0B\u6587\uFF0C\u542B dimensions / timeRanges").action(action(async (ctx, options) => {
|
|
2421
2406
|
await run(ctx, "data.dsl.query", toInput(options), false);
|
|
2422
2407
|
}));
|
|
2423
2408
|
const ds = data.command("ds").description("\u6570\u636E\u6E90\uFF1A\u5206\u7EC4 / \u627E\u8868 / \u5143\u6570\u636E / \u53D6\u6570");
|
|
@@ -6,8 +6,8 @@ import {
|
|
|
6
6
|
meetingStateDir,
|
|
7
7
|
readCache,
|
|
8
8
|
resolveMeetingEnvMode
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import "./chunk-
|
|
9
|
+
} from "./chunk-DZOC77ZD.js";
|
|
10
|
+
import "./chunk-IRMA3GVP.js";
|
|
11
11
|
import "./chunk-7BDPM5ST.js";
|
|
12
12
|
import "./chunk-UG5G54VL.js";
|
|
13
13
|
import "./chunk-BUSC6UAE.js";
|
|
@@ -185,10 +185,10 @@ function assertPath(requestPath) {
|
|
|
185
185
|
if (/^https?:/i.test(requestPath) || /[\r\n]/.test(requestPath) || requestPath.includes("/../")) {
|
|
186
186
|
throw fnaValidationError("path_invalid", "\u8BF7\u6C42\u8DEF\u5F84\u4E0D\u5141\u8BB8\u8DE8\u57DF\u6216\u8DEF\u5F84\u9003\u9038");
|
|
187
187
|
}
|
|
188
|
-
if (!requestPath.startsWith("/api/fna/") && !requestPath.startsWith("/api/app/fna/") && !requestPath.startsWith("/api/secondev/fna/")) {
|
|
188
|
+
if (!requestPath.startsWith("/api/fna/") && !requestPath.startsWith("/api/app/fna/") && !requestPath.startsWith("/api/secondev/fna/") && !requestPath.startsWith("/api/ai/application/rule/check/")) {
|
|
189
189
|
throw fnaValidationError(
|
|
190
190
|
"path_not_allowed",
|
|
191
|
-
"FNA \u8D39\u63A7\u4E2D\u5FC3\u53EA\u80FD\u8C03\u7528 /api/fna/\u3001/api/app/fna/ \u6216 /api/
|
|
191
|
+
"FNA \u8D39\u63A7\u4E2D\u5FC3\u53EA\u80FD\u8C03\u7528 /api/fna/\u3001/api/app/fna/\u3001/api/secondev/fna/ \u6216 /api/ai/application/rule/check/ \u8DEF\u5F84"
|
|
192
192
|
);
|
|
193
193
|
}
|
|
194
194
|
}
|
|
@@ -601,6 +601,320 @@ var budgetOperations = [
|
|
|
601
601
|
fnaBudgetExecuteList
|
|
602
602
|
];
|
|
603
603
|
|
|
604
|
+
// src/shortcuts/fna/operations/audit.ts
|
|
605
|
+
var AUDIT_TIMEOUT_MS = 6e5;
|
|
606
|
+
var CHECK_MODES = ["batch", "single"];
|
|
607
|
+
var DIMENSIONS = ["user", "node"];
|
|
608
|
+
var DEFAULT_DIMENSION = "node";
|
|
609
|
+
var AUDIT_PATH = "/api/ai/application/rule/check/aiCheckAudit";
|
|
610
|
+
function toIdString(value, field, options = {}) {
|
|
611
|
+
if (value === void 0 || value === null || value === "") {
|
|
612
|
+
throw fnaValidationError("id_required", `${field} \u5FC5\u586B`);
|
|
613
|
+
}
|
|
614
|
+
if (typeof value === "number" && !Number.isFinite(value)) {
|
|
615
|
+
throw fnaValidationError("id_invalid", `${field} \u5FC5\u987B\u662F\u6574\u6570\u6216\u6570\u5B57\u5B57\u7B26\u4E32`);
|
|
616
|
+
}
|
|
617
|
+
const text = String(value).trim();
|
|
618
|
+
if (!/^\d+$/.test(text)) {
|
|
619
|
+
throw fnaValidationError("id_invalid", `${field} \u5FC5\u987B\u662F\u6574\u6570\u6216\u6570\u5B57\u5B57\u7B26\u4E32\uFF1A${text}`);
|
|
620
|
+
}
|
|
621
|
+
if (!options.allowZero && text === "0") {
|
|
622
|
+
throw fnaValidationError("id_invalid", `${field} \u4E0D\u80FD\u4E3A 0\uFF08\u670D\u52A1\u7AEF\u4F1A\u628A 0 \u5F53\u7A7A\u6570\u636E\u5904\u7406\uFF09`);
|
|
623
|
+
}
|
|
624
|
+
return text;
|
|
625
|
+
}
|
|
626
|
+
function optionalId(value, field, options = {}) {
|
|
627
|
+
if (value === void 0 || value === null || value === "") return void 0;
|
|
628
|
+
return toIdString(value, field, options);
|
|
629
|
+
}
|
|
630
|
+
function optionalEnum(value, allowed, field, subtype = `${field}_invalid`) {
|
|
631
|
+
if (value === void 0 || value === null || value === "") return void 0;
|
|
632
|
+
const text = String(value);
|
|
633
|
+
if (!allowed.includes(text)) {
|
|
634
|
+
throw fnaValidationError(subtype, `${field} \u53EA\u80FD\u662F ${allowed.join(" / ")}\uFF1A${text}`);
|
|
635
|
+
}
|
|
636
|
+
return text;
|
|
637
|
+
}
|
|
638
|
+
function requireRuleList(value) {
|
|
639
|
+
if (value === void 0 || value === null || value === "") return void 0;
|
|
640
|
+
if (typeof value !== "string") {
|
|
641
|
+
throw fnaValidationError(
|
|
642
|
+
"rule_list_invalid",
|
|
643
|
+
'ruleList \u5FC5\u987B\u662F\u5B57\u7B26\u4E32\uFF1AJSON \u5B57\u7B26\u4E32\u6570\u7EC4\uFF08["\u89C4\u52191","\u89C4\u52192"]\uFF09\u6216 ## \u5206\u9694\u6587\u672C\uFF1B\u6570\u7EC4\u8BF7\u5148\u5E8F\u5217\u5316\u6210\u5B57\u7B26\u4E32'
|
|
644
|
+
);
|
|
645
|
+
}
|
|
646
|
+
const text = value.trim();
|
|
647
|
+
if (!text) return void 0;
|
|
648
|
+
if (text.startsWith("[")) {
|
|
649
|
+
try {
|
|
650
|
+
const parsed = JSON.parse(text);
|
|
651
|
+
if (!Array.isArray(parsed) || parsed.some((item) => typeof item !== "string")) {
|
|
652
|
+
throw new Error("not a string array");
|
|
653
|
+
}
|
|
654
|
+
} catch {
|
|
655
|
+
throw fnaValidationError("rule_list_invalid", "ruleList \u4EE5 [ \u5F00\u5934\u4F46\u4E0D\u662F\u5408\u6CD5\u7684 JSON \u5B57\u7B26\u4E32\u6570\u7EC4");
|
|
656
|
+
}
|
|
657
|
+
}
|
|
658
|
+
return text;
|
|
659
|
+
}
|
|
660
|
+
function buildAuditBody(args) {
|
|
661
|
+
return compact({
|
|
662
|
+
workflowId: toIdString(args.workflowId, "workflowId"),
|
|
663
|
+
requestId: toIdString(args.requestId, "requestId"),
|
|
664
|
+
nodeId: toIdString(args.nodeId, "nodeId"),
|
|
665
|
+
dimension: optionalEnum(args.dimension, DIMENSIONS, "dimension") ?? DEFAULT_DIMENSION,
|
|
666
|
+
refId: optionalId(args.refId, "refId"),
|
|
667
|
+
settingId: optionalId(args.settingId, "settingId", { allowZero: true }),
|
|
668
|
+
ruleList: requireRuleList(args.ruleList),
|
|
669
|
+
pageType: args.pageType === void 0 || args.pageType === "" ? void 0 : String(args.pageType),
|
|
670
|
+
checkMode: optionalEnum(args.checkMode, CHECK_MODES, "checkMode", "check_mode_invalid"),
|
|
671
|
+
recordId: optionalId(args.recordId, "recordId", { allowZero: true }),
|
|
672
|
+
userId: optionalId(args.userId, "userId")
|
|
673
|
+
});
|
|
674
|
+
}
|
|
675
|
+
var RISK_NAMES = { 0: "\u4F4E\u98CE\u9669", 1: "\u4E2D\u98CE\u9669", 2: "\u9AD8\u98CE\u9669" };
|
|
676
|
+
function asText(value) {
|
|
677
|
+
if (value === void 0 || value === null) return null;
|
|
678
|
+
const text = String(value);
|
|
679
|
+
return text === "" ? null : text;
|
|
680
|
+
}
|
|
681
|
+
function asCount(value) {
|
|
682
|
+
const numeric = Number(value);
|
|
683
|
+
return Number.isFinite(numeric) ? numeric : null;
|
|
684
|
+
}
|
|
685
|
+
function normalizeRuleResults(payload) {
|
|
686
|
+
const raw = Array.isArray(payload?.results) ? payload.results : [];
|
|
687
|
+
return raw.map((item) => {
|
|
688
|
+
const riskType = asCount(item?.riskType);
|
|
689
|
+
return {
|
|
690
|
+
id: asText(item?.id),
|
|
691
|
+
rule: asText(item?.rule),
|
|
692
|
+
result: asText(item?.result),
|
|
693
|
+
passed: typeof item?.passed === "boolean" ? item.passed : null,
|
|
694
|
+
riskType,
|
|
695
|
+
riskName: asText(item?.riskName) ?? (riskType !== null ? RISK_NAMES[riskType] ?? null : null),
|
|
696
|
+
generated: typeof item?.generated === "boolean" ? item.generated : null,
|
|
697
|
+
fieldId: asText(item?.fieldId),
|
|
698
|
+
auditResult: asText(item?.auditResult),
|
|
699
|
+
auditReason: asText(item?.auditReason)
|
|
700
|
+
};
|
|
701
|
+
});
|
|
702
|
+
}
|
|
703
|
+
function normalizeAuditResult(data) {
|
|
704
|
+
const catResult = data?.catResult;
|
|
705
|
+
const recordId = asText(data?.recordId);
|
|
706
|
+
const firstForm = Array.isArray(data?.formDataList) ? data.formDataList[0] : void 0;
|
|
707
|
+
const form = firstForm ? { id: asText(firstForm.id), refId: asText(firstForm.refId), title: asText(firstForm.title) } : null;
|
|
708
|
+
if (!catResult || typeof catResult !== "object") {
|
|
709
|
+
return {
|
|
710
|
+
status: "empty",
|
|
711
|
+
recordId,
|
|
712
|
+
formData: form,
|
|
713
|
+
emptyReason: asText(data?.msg),
|
|
714
|
+
conclusion: "none",
|
|
715
|
+
totalRules: 0,
|
|
716
|
+
passedCount: 0,
|
|
717
|
+
failedCount: 0,
|
|
718
|
+
results: [],
|
|
719
|
+
suggestions: null
|
|
720
|
+
};
|
|
721
|
+
}
|
|
722
|
+
const ruleRecordId = asText(catResult.otherParam?.ruleRecordId) ?? recordId;
|
|
723
|
+
const content = catResult.chatMessage?.content;
|
|
724
|
+
if (typeof content !== "string" || !content.trim()) {
|
|
725
|
+
return {
|
|
726
|
+
status: "unparsed",
|
|
727
|
+
recordId: ruleRecordId,
|
|
728
|
+
formData: form,
|
|
729
|
+
emptyReason: null,
|
|
730
|
+
conclusion: "none",
|
|
731
|
+
totalRules: 0,
|
|
732
|
+
passedCount: 0,
|
|
733
|
+
failedCount: 0,
|
|
734
|
+
results: [],
|
|
735
|
+
suggestions: null,
|
|
736
|
+
contentPreview: typeof content === "string" ? content.slice(0, 500) : null
|
|
737
|
+
};
|
|
738
|
+
}
|
|
739
|
+
let payload;
|
|
740
|
+
try {
|
|
741
|
+
payload = JSON.parse(content);
|
|
742
|
+
} catch {
|
|
743
|
+
return {
|
|
744
|
+
status: "unparsed",
|
|
745
|
+
recordId: ruleRecordId,
|
|
746
|
+
formData: form,
|
|
747
|
+
emptyReason: null,
|
|
748
|
+
conclusion: "none",
|
|
749
|
+
totalRules: 0,
|
|
750
|
+
passedCount: 0,
|
|
751
|
+
failedCount: 0,
|
|
752
|
+
results: [],
|
|
753
|
+
suggestions: null,
|
|
754
|
+
contentPreview: content.slice(0, 500)
|
|
755
|
+
};
|
|
756
|
+
}
|
|
757
|
+
const results = normalizeRuleResults(payload);
|
|
758
|
+
const rawFailed = asCount(payload?.failedCount);
|
|
759
|
+
const failedCount = rawFailed ?? results.filter((item) => item.passed === false).length;
|
|
760
|
+
const rawPassed = asCount(payload?.passedCount);
|
|
761
|
+
const passedCount = rawPassed ?? results.filter((item) => item.passed === true).length;
|
|
762
|
+
return {
|
|
763
|
+
status: "checked",
|
|
764
|
+
recordId: ruleRecordId,
|
|
765
|
+
formData: form,
|
|
766
|
+
emptyReason: null,
|
|
767
|
+
title: asText(payload?.title) ?? form?.title ?? null,
|
|
768
|
+
conclusion: failedCount > 0 ? "failed" : "passed",
|
|
769
|
+
totalRules: asCount(payload?.totalRules) ?? results.length,
|
|
770
|
+
passedCount,
|
|
771
|
+
failedCount,
|
|
772
|
+
results,
|
|
773
|
+
suggestions: payload?.suggestions ?? null
|
|
774
|
+
};
|
|
775
|
+
}
|
|
776
|
+
function mapAuditApiError(error) {
|
|
777
|
+
if (error instanceof FnaCliError && error.type === "api" && error.subtype === "business_error") {
|
|
778
|
+
const message = error.message || "";
|
|
779
|
+
if (message.includes("\u672A\u83B7\u53D6\u5F53\u524D\u4EBA\u5458\u4FE1\u606F") || message.includes("\u4EBA\u5458")) {
|
|
780
|
+
throw new FnaCliError("api", "person_unavailable", message || "\u672A\u83B7\u53D6\u5F53\u524D\u4EBA\u5458\u4FE1\u606F", {
|
|
781
|
+
code: error.code,
|
|
782
|
+
retryable: false,
|
|
783
|
+
details: error.details,
|
|
784
|
+
exitCode: 1
|
|
785
|
+
});
|
|
786
|
+
}
|
|
787
|
+
}
|
|
788
|
+
throw error;
|
|
789
|
+
}
|
|
790
|
+
async function requestAudit(env, body) {
|
|
791
|
+
let response;
|
|
792
|
+
try {
|
|
793
|
+
response = await env.host.request({
|
|
794
|
+
method: "POST",
|
|
795
|
+
path: AUDIT_PATH,
|
|
796
|
+
body,
|
|
797
|
+
timeoutMs: AUDIT_TIMEOUT_MS
|
|
798
|
+
});
|
|
799
|
+
} catch (error) {
|
|
800
|
+
if (isFnaNetworkError(error)) {
|
|
801
|
+
throw fnaPartialError(
|
|
802
|
+
"\u9884\u5BA1\u8BF7\u6C42\u53D1\u9001\u540E\u8FDE\u63A5\u4E2D\u65AD/\u8D85\u65F6\uFF0C\u672C\u6B21\u662F\u5426\u5DF2\u751F\u6210\u9884\u5BA1\u8BB0\u5F55\u4E0D\u786E\u5B9A\uFF0C\u7981\u6B62\u81EA\u52A8\u91CD\u8BD5\uFF1B\u8BF7\u6309 requestId + nodeId \u56DE\u67E5\u9884\u5BA1\u8BB0\u5F55\u540E\u518D\u51B3\u5B9A\u662F\u5426\u91CD\u8DD1",
|
|
803
|
+
{ attempted: { requestId: body.requestId, nodeId: body.nodeId, recordId: body.recordId ?? null } },
|
|
804
|
+
{ stage: "aiCheckAudit" }
|
|
805
|
+
);
|
|
806
|
+
}
|
|
807
|
+
throw mapAuditApiError(error);
|
|
808
|
+
}
|
|
809
|
+
return normalizeAuditResult(unwrapData(response));
|
|
810
|
+
}
|
|
811
|
+
var fnaAuditCheckPrepare = {
|
|
812
|
+
name: "fna.audit.check.prepare",
|
|
813
|
+
resource: "audit",
|
|
814
|
+
method: "audit.check.prepare",
|
|
815
|
+
action: "fna.audit.check.prepare",
|
|
816
|
+
summary: "AI \u89C4\u5219\u9884\u5BA1\uFF08\u51C6\u5907\uFF09\uFF1A\u6821\u9A8C workflowId/requestId/nodeId \u7B49\u5165\u53C2\u5E76\u751F\u6210\u786E\u8BA4\u9884\u89C8\u4E0E continuation\uFF0C\u4E0D\u53D1\u9001\u8BF7\u6C42\u3001\u4E0D\u6D88\u8017\u6A21\u578B\u989D\u5EA6",
|
|
817
|
+
capability: "audit",
|
|
818
|
+
risk: WRITE,
|
|
819
|
+
requiresConfirmation: true,
|
|
820
|
+
inputSchema: schemaOf(
|
|
821
|
+
{
|
|
822
|
+
workflowId: { ...SCHEMA_ID, description: "\u6D41\u7A0B ID\uFF08\u5FC5\u586B\uFF0C>0\uFF09\uFF1B\u4E0E requestId\u3001nodeId \u62FC\u6210\u6570\u636E\u6E90 ids" },
|
|
823
|
+
requestId: { ...SCHEMA_ID, description: "\u6D41\u7A0B\u5B9E\u4F8B ID\uFF0C\u5373\u9884\u5BA1\u5355\u636E ID\uFF08\u5FC5\u586B\uFF0C>0\uFF09" },
|
|
824
|
+
nodeId: { ...SCHEMA_ID, description: "\u6D41\u7A0B\u8282\u70B9 ID\uFF08\u5FC5\u586B\uFF0C>0\uFF09\uFF1B\u53D6\u5F53\u524D\u5F85\u529E\u8282\u70B9\u7684 nodeId" },
|
|
825
|
+
dimension: { type: "string", enum: [...DIMENSIONS], default: DEFAULT_DIMENSION, description: "\u9884\u5BA1\u8BB0\u5F55\u7EF4\u5EA6\uFF1Anode\uFF08\u6309\u8282\u70B9\uFF0C\u4E0D\u8BB0\u4E2A\u4EBA\uFF0C\u52A8\u4F5C\u6D41 RPC \u7528\u8FD9\u4E2A\uFF0C\u9ED8\u8BA4\uFF09/ user\uFF08\u6309\u4EBA\uFF09" },
|
|
826
|
+
refId: { ...SCHEMA_ID, description: "\u89C4\u5219\u914D\u7F6E\u5173\u8054 ID\uFF0C\u9ED8\u8BA4\u53D6 workflowId\uFF1BEB \u6D41\u7A0B\u4F20\u8868\u5355 ID" },
|
|
827
|
+
settingId: { ...SCHEMA_ID, description: "\u89C4\u5219\u8BBE\u7F6E ID\uFF1B>0 \u65F6\u76F4\u63A5\u53D6\u8BE5\u89C4\u5219\u8BBE\u7F6E\uFF0C0 \u7B49\u540C\u4E0D\u4F20" },
|
|
828
|
+
ruleList: { type: "string", description: "\u8FFD\u52A0\u89C4\u5219\uFF1AJSON \u5B57\u7B26\u4E32\u6570\u7EC4\u6216 ## \u5206\u9694\u6587\u672C\uFF08\u6570\u7EC4\u9700\u5148\u5E8F\u5217\u5316\u6210\u5B57\u7B26\u4E32\uFF09" },
|
|
829
|
+
pageType: { type: "string", description: "\u9875\u9762\u7C7B\u578B\uFF0C\u9ED8\u8BA4 flowPage\uFF0C\u900F\u4F20\u7ED9\u89C4\u5219\u67E5\u8BE2" },
|
|
830
|
+
checkMode: { type: "string", enum: [...CHECK_MODES], description: "\u68C0\u9A8C\u6A21\u5F0F\uFF1Abatch\uFF08\u4E00\u6B21 AI \u5BA1\u6838\uFF09/ single\uFF08\u9010\u6761\u5BA1\u6838\u540E\u5408\u5E76\uFF09\uFF1B\u4F20\u4E86\u4F1A\u8986\u76D6\u6D41\u7A0B\u914D\u7F6E" },
|
|
831
|
+
recordId: { ...SCHEMA_ID, description: "\u5DF2\u6709\u9884\u5BA1\u8BB0\u5F55 ID\uFF1B\u4F20\u4E86\u5219\u672C\u6B21\u7ED3\u679C\u8FFD\u52A0\u5230\u8BE5\u8BB0\u5F55\uFF080 \u7B49\u540C\u4E0D\u4F20\uFF09" },
|
|
832
|
+
userId: { ...SCHEMA_ID, description: "\u6267\u884C\u4EBA ID\uFF08>0\uFF09\uFF1B\u4E0D\u4F20\u7528\u5F53\u524D\u767B\u5F55\u4EBA\uFF0C\u4F20\u4E86\u4EBA\u5458\u4E0D\u5B58\u5728\u4F1A\u76F4\u63A5\u5931\u8D25\uFF0C\u4E0D\u56DE\u9000" }
|
|
833
|
+
},
|
|
834
|
+
{
|
|
835
|
+
required: ["workflowId", "requestId", "nodeId"],
|
|
836
|
+
description: "AI \u89C4\u5219\u9884\u5BA1\uFF08\u51C6\u5907\uFF09\uFF1A\u53EA\u505A\u8F93\u5165\u5F52\u4E00\u5316\u4E0E\u786E\u8BA4\uFF0C\u4E0D\u89E6\u7F51"
|
|
837
|
+
}
|
|
838
|
+
),
|
|
839
|
+
handler: async (args, env) => {
|
|
840
|
+
const body = buildAuditBody(args);
|
|
841
|
+
const session = await env.host.getSession();
|
|
842
|
+
const token = await env.continuation.issue(
|
|
843
|
+
{
|
|
844
|
+
operation: "fna.audit.check.apply",
|
|
845
|
+
baseUrl: session.baseUrl,
|
|
846
|
+
profile: session.profile,
|
|
847
|
+
userId: session.userId,
|
|
848
|
+
body,
|
|
849
|
+
fingerprint: fingerprint(body)
|
|
850
|
+
},
|
|
851
|
+
CONTINUATION_TTL_SECONDS * 1e3
|
|
852
|
+
);
|
|
853
|
+
return fnaSuccess("fna.audit.check.prepare", {
|
|
854
|
+
status: "AWAITING_CONFIRMATION",
|
|
855
|
+
preview: {
|
|
856
|
+
...body,
|
|
857
|
+
action: "\u6309\u6D41\u7A0B\u914D\u7F6E\u7684 AI \u89C4\u5219\u5BF9\u8BE5\u5355\u636E\u505A\u9884\u5BA1",
|
|
858
|
+
cost: "\u4F1A\u6D88\u8017\u4E00\u6B21\u6216\u591A\u6B21\u5927\u6A21\u578B\u8C03\u7528\uFF08single \u6A21\u5F0F\u9010\u6761\u5BA1\u6838\uFF09\uFF0C\u901A\u5E38\u6570\u5341\u79D2\u5230\u6570\u5206\u949F",
|
|
859
|
+
sideEffect: "\u4F1A\u5199\u5165/\u66F4\u65B0\u9884\u5BA1\u8BB0\u5F55 ai_check_audit_record\uFF1B\u4F20 recordId \u65F6\u8FFD\u52A0\u5230\u8BE5\u8BB0\u5F55",
|
|
860
|
+
appendToRecord: body.recordId ?? null,
|
|
861
|
+
hint: "\u5411\u7528\u6237\u5C55\u793A\u5355\u636E\uFF08requestId\uFF09\u3001\u8282\u70B9\u3001\u68C0\u9A8C\u6A21\u5F0F\u4E0E\u526F\u4F5C\u7528\u540E\u518D\u786E\u8BA4\uFF1B\u786E\u8BA4\u540E\u8C03\u7528 fna.audit.check.apply"
|
|
862
|
+
},
|
|
863
|
+
continuation: token,
|
|
864
|
+
expiresInSeconds: CONTINUATION_TTL_SECONDS
|
|
865
|
+
});
|
|
866
|
+
}
|
|
867
|
+
};
|
|
868
|
+
var fnaAuditCheckApply = {
|
|
869
|
+
name: "fna.audit.check.apply",
|
|
870
|
+
resource: "audit",
|
|
871
|
+
method: "audit.check.apply",
|
|
872
|
+
action: "fna.audit.check.apply",
|
|
873
|
+
summary: "AI \u89C4\u5219\u9884\u5BA1\uFF08\u6267\u884C\uFF09\uFF1A\u9700 confirm=true \u4E0E prepare \u7684 continuation\uFF0C\u8FD4\u56DE\u9010\u6761\u89C4\u5219\u7684 passed/riskName \u4E0E\u6C47\u603B\u8BA1\u6570\uFF1B\u4F1A\u5199\u9884\u5BA1\u8BB0\u5F55\u5E76\u6D88\u8017\u5927\u6A21\u578B",
|
|
874
|
+
capability: "audit",
|
|
875
|
+
risk: WRITE,
|
|
876
|
+
requiresConfirmation: true,
|
|
877
|
+
inputSchema: schemaOf(
|
|
878
|
+
{
|
|
879
|
+
workflowId: { ...SCHEMA_ID, description: "\u6D41\u7A0B ID\uFF08\u5FC5\u586B\uFF0C>0\uFF09\uFF1B\u4E0E prepare \u65F6\u4E00\u81F4" },
|
|
880
|
+
requestId: { ...SCHEMA_ID, description: "\u6D41\u7A0B\u5B9E\u4F8B ID\uFF08\u5FC5\u586B\uFF0C>0\uFF09\uFF1B\u4E0E prepare \u65F6\u4E00\u81F4" },
|
|
881
|
+
nodeId: { ...SCHEMA_ID, description: "\u6D41\u7A0B\u8282\u70B9 ID\uFF08\u5FC5\u586B\uFF0C>0\uFF09\uFF1B\u4E0E prepare \u65F6\u4E00\u81F4" },
|
|
882
|
+
dimension: { type: "string", enum: [...DIMENSIONS], default: DEFAULT_DIMENSION, description: "\u9884\u5BA1\u8BB0\u5F55\u7EF4\u5EA6\uFF1Anode\uFF08\u9ED8\u8BA4\uFF09/ user\uFF1B\u4E0D\u4F20\u6309 prepare \u9ED8\u8BA4\u503C node" },
|
|
883
|
+
refId: { ...SCHEMA_ID, description: "\u89C4\u5219\u914D\u7F6E\u5173\u8054 ID\uFF0C\u9ED8\u8BA4\u53D6 workflowId" },
|
|
884
|
+
settingId: { ...SCHEMA_ID, description: "\u89C4\u5219\u8BBE\u7F6E ID\uFF1B>0 \u65F6\u76F4\u63A5\u53D6\u8BE5\u89C4\u5219\u8BBE\u7F6E" },
|
|
885
|
+
ruleList: { type: "string", description: "\u8FFD\u52A0\u89C4\u5219\uFF1AJSON \u5B57\u7B26\u4E32\u6570\u7EC4\u6216 ## \u5206\u9694\u6587\u672C" },
|
|
886
|
+
pageType: { type: "string", description: "\u9875\u9762\u7C7B\u578B\uFF0C\u9ED8\u8BA4 flowPage" },
|
|
887
|
+
checkMode: { type: "string", enum: [...CHECK_MODES], description: "\u68C0\u9A8C\u6A21\u5F0F\uFF1Abatch / single" },
|
|
888
|
+
recordId: { ...SCHEMA_ID, description: "\u5DF2\u6709\u9884\u5BA1\u8BB0\u5F55 ID\uFF1B\u4F20\u4E86\u5219\u8FFD\u52A0\u5230\u8BE5\u8BB0\u5F55" },
|
|
889
|
+
userId: { ...SCHEMA_ID, description: "\u6267\u884C\u4EBA ID\uFF08>0\uFF09\uFF1B\u4E0D\u4F20\u7528\u5F53\u524D\u767B\u5F55\u4EBA" },
|
|
890
|
+
confirm: { const: true },
|
|
891
|
+
continuation: { ...SCHEMA_STRING_NONEMPTY, description: "prepare \u8FD4\u56DE\u7684 continuation" }
|
|
892
|
+
},
|
|
893
|
+
{
|
|
894
|
+
required: ["workflowId", "requestId", "nodeId", "confirm", "continuation"],
|
|
895
|
+
description: "AI \u89C4\u5219\u9884\u5BA1\uFF08\u6267\u884C\uFF09\uFF1A\u5199\u5165\u9884\u5BA1\u8BB0\u5F55\u5E76\u6D88\u8017\u5927\u6A21\u578B"
|
|
896
|
+
}
|
|
897
|
+
),
|
|
898
|
+
handler: async (args, env) => {
|
|
899
|
+
requireConfirm(args, "fna.audit.check.apply");
|
|
900
|
+
const body = buildAuditBody(args);
|
|
901
|
+
const lease = await verifyLease(args, "fna.audit.check.apply", env);
|
|
902
|
+
if (fingerprint(body) !== lease.fingerprint) {
|
|
903
|
+
throw fnaValidationError("target_changed", "\u9884\u5BA1\u76EE\u6807\u4E0E prepare \u65F6\u7684\u5FEB\u7167\u4E0D\u4E00\u81F4\uFF0C\u8BF7\u91CD\u65B0\u6267\u884C prepare");
|
|
904
|
+
}
|
|
905
|
+
const data = await requestAudit(env, body);
|
|
906
|
+
return fnaSuccess("fna.audit.check.apply", data, {
|
|
907
|
+
checkMode: body.checkMode ?? "flow-config",
|
|
908
|
+
dimension: body.dimension ?? DEFAULT_DIMENSION,
|
|
909
|
+
timeoutMs: AUDIT_TIMEOUT_MS
|
|
910
|
+
});
|
|
911
|
+
}
|
|
912
|
+
};
|
|
913
|
+
var auditOperations = [
|
|
914
|
+
fnaAuditCheckPrepare,
|
|
915
|
+
fnaAuditCheckApply
|
|
916
|
+
];
|
|
917
|
+
|
|
604
918
|
// src/shortcuts/fna/operations/expense-center.ts
|
|
605
919
|
var SUM_AMOUNT_PROPERTIES = {
|
|
606
920
|
employeeId: { ...SCHEMA_ID, description: "\u5458\u5DE5 ID\uFF08\u6570\u5B57\uFF09\uFF1B\u4E3A\u7A7A\u9ED8\u8BA4\u5F53\u524D\u767B\u5F55\u4EBA" },
|
|
@@ -1271,6 +1585,7 @@ function buildRegistry() {
|
|
|
1271
1585
|
const registry = /* @__PURE__ */ new Map();
|
|
1272
1586
|
const definitions = [
|
|
1273
1587
|
...budgetOperations,
|
|
1588
|
+
...auditOperations,
|
|
1274
1589
|
...expenseCenterOperations,
|
|
1275
1590
|
...expenseChartOperations,
|
|
1276
1591
|
...loanOperations,
|
|
@@ -1309,6 +1624,14 @@ var FNA_WITHHELD = [
|
|
|
1309
1624
|
{
|
|
1310
1625
|
name: "fna.expense.chart.raw.sql",
|
|
1311
1626
|
reason: "\u62A5\u9500\u62A5\u8868 AI \u95EE\u7B54\u7531\u670D\u52A1\u7AEF\u751F\u6210 SQL \u5E76\u505A\u79DF\u6237\u9694\u79BB\u6539\u5199\u4E0E\u5B89\u5168\u6821\u9A8C\uFF1BCLI \u53EA\u63A5\u53D7 userInput\uFF0C\u4E0D\u66B4\u9732\u3001\u4E0D\u56DE\u4F20 SQL\uFF0C\u4E5F\u4E0D\u5141\u8BB8\u8C03\u7528\u65B9\u7ED5\u8FC7\u5B89\u5168\u6821\u9A8C\u81EA\u5199 SQL\u3002"
|
|
1627
|
+
},
|
|
1628
|
+
{
|
|
1629
|
+
name: "fna.audit.rule.configure",
|
|
1630
|
+
reason: "AI \u89C4\u5219\u9884\u5BA1\u53EA\u6309\u6D41\u7A0B\u5DF2\u914D\u7F6E\u7684\u89C4\u5219\u6267\u884C\uFF08\u53EF\u4F20 ruleList/settingId \u6307\u5B9A\uFF09\uFF0C\u4E0D\u652F\u6301\u65B0\u589E\u3001\u7F16\u8F91\u3001\u5220\u9664\u89C4\u5219\u914D\u7F6E\u6216\u89C4\u5219\u8BBE\u7F6E\uFF1B\u6E90\u8D44\u6599\u672A\u63D0\u4F9B\u89C4\u5219\u7EF4\u62A4\u63A5\u53E3\u3002"
|
|
1631
|
+
},
|
|
1632
|
+
{
|
|
1633
|
+
name: "fna.audit.formdata.raw",
|
|
1634
|
+
reason: "aiCheckAudit \u8FD4\u56DE\u7684 data.formDataList \u542B\u5B8C\u6574\u4E3B\u8868/\u660E\u7EC6/\u53D1\u7968\u6570\u636E\uFF0C\u4F53\u79EF\u5927\u4E14\u542B\u4E1A\u52A1\u654F\u611F\u5B57\u6BB5\uFF1BCLI \u53EA\u56DE\u4F20 id/refId/title \u6458\u8981\uFF0C\u4E0D\u628A\u6574\u6BB5\u8868\u5355\u6570\u636E\u66B4\u9732\u7ED9 Agent\u3002"
|
|
1312
1635
|
}
|
|
1313
1636
|
];
|
|
1314
1637
|
function buildOperations() {
|
|
@@ -1325,12 +1648,12 @@ function buildOperations() {
|
|
|
1325
1648
|
var fnaManifest = {
|
|
1326
1649
|
schemaVersion: 1,
|
|
1327
1650
|
name: "fna",
|
|
1328
|
-
title: "\u6CDB\u5FAEE10\u9F50\u4E1A\u6210\u8D39\u63A7\u4E2D\u5FC3\uFF08\u9884\u7B97\u67E5\u8BE2/\u8D39\u7528\u4E2D\u5FC3/\u62A5\u9500\u62A5\u8868/\u501F\u6B3E\u7BA1\u7406/\u53D1\u7968\u6838\u9500\uFF09",
|
|
1329
|
-
version: "0.1.
|
|
1651
|
+
title: "\u6CDB\u5FAEE10\u9F50\u4E1A\u6210\u8D39\u63A7\u4E2D\u5FC3\uFF08\u9884\u7B97\u67E5\u8BE2/\u8D39\u7528\u4E2D\u5FC3/\u62A5\u9500\u62A5\u8868/AI\u89C4\u5219\u9884\u5BA1/\u501F\u6B3E\u7BA1\u7406/\u53D1\u7968\u6838\u9500\uFF09",
|
|
1652
|
+
version: "0.1.2",
|
|
1330
1653
|
host: "e10-fna",
|
|
1331
1654
|
status: "builtin",
|
|
1332
1655
|
sourceSkill: "weaver-e10-qiyecheng",
|
|
1333
|
-
capabilities: ["budget", "expense", "expense-chart", "loan", "invoice-writeoff"],
|
|
1656
|
+
capabilities: ["budget", "expense", "expense-chart", "audit", "loan", "invoice-writeoff"],
|
|
1334
1657
|
operations: buildOperations(),
|
|
1335
1658
|
withheldOperations: FNA_WITHHELD
|
|
1336
1659
|
};
|
|
@@ -6,9 +6,9 @@ import {
|
|
|
6
6
|
ensureMeetingGroupChat,
|
|
7
7
|
meetingEbGroupChatOperations,
|
|
8
8
|
savePendingForm
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
9
|
+
} from "./chunk-D3TDNRFE.js";
|
|
10
|
+
import "./chunk-DZOC77ZD.js";
|
|
11
|
+
import "./chunk-IRMA3GVP.js";
|
|
12
12
|
import "./chunk-7BDPM5ST.js";
|
|
13
13
|
import "./chunk-UG5G54VL.js";
|
|
14
14
|
import "./chunk-BUSC6UAE.js";
|
|
@@ -11,11 +11,11 @@ import {
|
|
|
11
11
|
assertNoForbiddenKeys,
|
|
12
12
|
getImOperation,
|
|
13
13
|
imOperationDefinitions
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-ATEXBEPD.js";
|
|
15
15
|
import {
|
|
16
16
|
imValidationError
|
|
17
17
|
} from "./chunk-IC62NFM5.js";
|
|
18
|
-
import "./chunk-
|
|
18
|
+
import "./chunk-KMRT7NAT.js";
|
|
19
19
|
import "./chunk-7BDPM5ST.js";
|
|
20
20
|
import "./chunk-6NXT4ICB.js";
|
|
21
21
|
import "./chunk-U6R6FZHD.js";
|