weaver-work-cli 0.1.57 → 0.1.59
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-QGM5MLQE.js → attachment-content-TP6WDNC6.js} +3 -3
- package/dist/chunks/{caizhilian-QJ4FLSQJ.js → caizhilian-5NM4X5HG.js} +1 -1
- package/dist/chunks/{chunk-7EBV7Q3R.js → chunk-2FHP4PYS.js} +50 -27
- package/dist/chunks/{chunk-DVR2EDUU.js → chunk-6YWHRXEQ.js} +17 -1
- package/dist/chunks/{chunk-FDAJC7R4.js → chunk-AQOPPNTR.js} +2 -2
- package/dist/chunks/{chunk-6DVL5IN5.js → chunk-CI2RF3AJ.js} +7 -4
- package/dist/chunks/{chunk-WHJIUKJW.js → chunk-FM7B5BIR.js} +206 -39
- package/dist/chunks/{chunk-L2LMBFG5.js → chunk-I3BFBBP2.js} +1 -1
- package/dist/chunks/{chunk-6MS3RLPO.js → chunk-MQBMMJUV.js} +2 -2
- package/dist/chunks/{chunk-XU3FL3AW.js → chunk-QNPIY5R6.js} +4 -4
- package/dist/chunks/{chunk-AHJZIMCX.js → chunk-U2DWV6JC.js} +1 -1
- package/dist/chunks/{chunk-WMB3SMXI.js → chunk-WINR2Q6K.js} +27 -4
- package/dist/chunks/{chunk-UI66EMOR.js → chunk-XR5BGFNT.js} +4 -4
- package/dist/chunks/{chunk-TJUAGZU7.js → chunk-ZHPCNM2S.js} +6 -6
- package/dist/chunks/{conflict-VAFFPUY3.js → conflict-Y3ESXYIA.js} +2 -2
- package/dist/chunks/{create-flow-TVYE3IOH.js → create-flow-JHQSA6JF.js} +6 -6
- package/dist/chunks/{data-WVICO3DT.js → data-ZVS3BWPT.js} +3 -5
- package/dist/chunks/{env-BVVFIN4P.js → env-LQBLL3MZ.js} +2 -2
- package/dist/chunks/{factory-RCQ36LLE.js → factory-X7PN6B3B.js} +1 -1
- package/dist/chunks/{group-chat-YFZDUUY3.js → group-chat-PPFY7SPV.js} +3 -3
- package/dist/chunks/{invoice-7JGSEWT5.js → invoice-6XDMPCWB.js} +59 -8
- package/dist/chunks/{lazy-dispatch-JHGFCKJN.js → lazy-dispatch-GCA6HDOB.js} +1 -1
- package/dist/chunks/{meeting-JOHV4RH3.js → meeting-GMRQZFJP.js} +16 -12
- package/dist/chunks/{minute-doc-JLS4KMFZ.js → minute-doc-JXH3MNC7.js} +5 -5
- package/dist/chunks/{operations-ZPWBMYKE.js → operations-6NXJ7RTE.js} +1 -1
- package/dist/chunks/{registry-LITYOH2W.js → registry-WZCCBI5L.js} +10 -10
- package/dist/chunks/{room-recommend-62MECG4J.js → room-recommend-CKU5NF2E.js} +4 -4
- package/dist/chunks/{schedule-6QRXIBGU.js → schedule-DEFAO2RY.js} +4 -4
- package/dist/index.js +6 -6
- package/dist/internal/e10/auth/commands.js +29 -1
- package/dist/shortcuts/caizhilian/operations/files.js +4 -1
- package/dist/shortcuts/caizhilian/operations/handlers/document.js +33 -4
- package/dist/shortcuts/data/index.js +0 -1
- package/dist/shortcuts/data/manifest.js +1 -1
- package/dist/shortcuts/data/operations/module.js +2 -3
- package/dist/shortcuts/invoice/manifest.js +6 -4
- package/dist/shortcuts/invoice/operations/reim-subsidy.js +54 -4
- package/dist/shortcuts/meeting/host.js +6 -1
- package/dist/shortcuts/meeting/minute-doc.js +3 -2
- package/dist/shortcuts/meeting/operations/compose-outcome.js +4 -0
- package/dist/shortcuts/meeting/operations/eb/create-flow.js +29 -3
- package/dist/shortcuts/meeting/operations/eb/crm-search.js +20 -0
- package/dist/shortcuts/meeting/operations/eb/decision-task-reassign.js +113 -0
- package/dist/shortcuts/meeting/operations/eb/decision.js +41 -1
- package/dist/shortcuts/meeting/operations/eb/factory.js +4 -4
- package/dist/shortcuts/meeting/operations/eb/index.js +2 -0
- package/dist/shortcuts/meeting/operations/eb-fallback.js +3 -0
- package/dist/shortcuts/meeting/operations/registry.js +14 -1
- package/dist/shortcuts/meeting/operations/shared.js +4 -0
- package/docs/agent-invoice.md +0 -1
- package/docs/data.md +1 -1
- package/docs/e10-auth.md +5 -0
- package/docs/invoice.md +1 -1
- package/package.json +1 -1
- package/skill-template/domains/yepiaotong.md +2 -0
- package/skills/weaver-e10-caizhilian/SKILL.md +1 -1
- package/skills/weaver-e10-caizhilian/references/document.md +1 -1
- package/skills/weaver-e10-caizhilian/references/source-manifest.json +2 -2
- package/skills/weaver-e10-data/references/config-center.md +0 -1
- package/skills/weaver-e10-jucailin/SKILL.md +6 -6
- package/skills/weaver-e10-jucailin/references/recruit-read.md +3 -2
- package/skills/weaver-e10-jucailin/references/recruit-stage-ops.md +1 -1
- package/skills/weaver-e10-jucailin/references/recruit-write.md +15 -8
- package/skills/weaver-e10-jucailin/references/safety-boundaries.md +3 -1
- package/skills/weaver-e10-meeting/SKILL.md +14 -4
- package/skills/weaver-e10-recruit-stage/SKILL.md +42 -14
- package/skills/weaver-e10-recruit-stage/agents/openai.yaml +61 -20
- package/skills/weaver-e10-recruit-stage/lib/recruit-resume-photo.py +194 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-capability-check.md +5 -4
- package/skills/weaver-e10-recruit-stage/references/recruit-resolve-metadata.md +4 -5
- package/skills/weaver-e10-recruit-stage/references/recruit-resume-import-batch.md +1 -10
- package/skills/weaver-e10-recruit-stage/references/recruit-resume-import.md +25 -6
- package/skills/weaver-e10-recruit-stage/references/recruit-utterance-glossary.md +3 -2
- package/skills/weaver-e10-yepiaotong/SKILL.md +5 -5
- package/skills/weaver-e10-yepiaotong/references/invoice-output-view.md +0 -23
- package/skills/weaver-e10-yepiaotong/references/invoice-personal-list.md +1 -1
- package/skills/weaver-e10-yepiaotong/references/invoice-reim-relation.md +1 -1
- package/skills/weaver-e10-yepiaotong/references/invoice-reim.md +2 -2
- package/skills/weaver-e10-yepiaotong/references/reim-api-reference.md +15 -11
- package/skills/weaver-e10-yepiaotong/references/reim-examples.md +2 -2
- package/skills/weaver-e10-yepiaotong/references/reim-form-fill-rules.md +1 -1
- package/skills/weaver-e10-yepiaotong/references/reim-matching-rules.md +1 -1
- package/skills/weaver-e10-yepiaotong/references/reim-phone-subsidy-rules.md +80 -35
- package/skills/weaver-e10-yepiaotong/references/reim-workflow.md +9 -9
- package/skills/weaver-e10-yepiaotong/references/invoice-summarize.py +0 -217
- package/skills/weaver-e10-yepiaotong.zip +0 -0
|
@@ -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-I3BFBBP2.js";
|
|
6
6
|
import {
|
|
7
7
|
meetingSuccess,
|
|
8
8
|
meetingValidationError,
|
|
9
9
|
schemaOf
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-CI2RF3AJ.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-JHQSA6JF.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-X7PN6B3B.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-WZCCBI5L.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 ?? {};
|
|
@@ -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-WZCCBI5L.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);
|
|
@@ -7,8 +7,8 @@ import {
|
|
|
7
7
|
findCommonFreeSlots,
|
|
8
8
|
meetingEbConflictOperations,
|
|
9
9
|
runEbConflictCheck
|
|
10
|
-
} from "./chunk-
|
|
11
|
-
import "./chunk-
|
|
10
|
+
} from "./chunk-QNPIY5R6.js";
|
|
11
|
+
import "./chunk-CI2RF3AJ.js";
|
|
12
12
|
import "./chunk-7BDPM5ST.js";
|
|
13
13
|
import "./chunk-UG5G54VL.js";
|
|
14
14
|
import "./chunk-BUSC6UAE.js";
|
|
@@ -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-2FHP4PYS.js";
|
|
26
|
+
import "./chunk-QNPIY5R6.js";
|
|
27
|
+
import "./chunk-XR5BGFNT.js";
|
|
28
|
+
import "./chunk-U2DWV6JC.js";
|
|
29
|
+
import "./chunk-I3BFBBP2.js";
|
|
30
|
+
import "./chunk-CI2RF3AJ.js";
|
|
31
31
|
import "./chunk-7BDPM5ST.js";
|
|
32
32
|
import "./chunk-UG5G54VL.js";
|
|
33
33
|
import "./chunk-BUSC6UAE.js";
|
|
@@ -1780,7 +1780,6 @@ async function moduleCall(input, host) {
|
|
|
1780
1780
|
let group = typeof input.group === "string" ? input.group : "";
|
|
1781
1781
|
const confType = typeof input.type === "string" && input.type ? input.type : "api";
|
|
1782
1782
|
const timeoutMs = Math.max(1, Number(input.timeout || "60") || 60) * 1e3;
|
|
1783
|
-
const limit = input.limit === void 0 || input.limit === true ? 50 : Number(input.limit) || 0;
|
|
1784
1783
|
const fields = typeof input.fields === "string" && input.fields ? readListArg(input.fields).split(",").map((item) => item.trim()).filter(Boolean) : null;
|
|
1785
1784
|
let record;
|
|
1786
1785
|
let attrs;
|
|
@@ -1956,7 +1955,7 @@ async function moduleCall(input, host) {
|
|
|
1956
1955
|
const out = { ok: true, api_name: apiName, http: status, via: payload.via, ...tipFields(tips) };
|
|
1957
1956
|
let projected = null;
|
|
1958
1957
|
if (rows !== null) {
|
|
1959
|
-
const shown =
|
|
1958
|
+
const shown = rows;
|
|
1960
1959
|
projected = fields ? shown.map((row) => {
|
|
1961
1960
|
const picked = {};
|
|
1962
1961
|
if (row && typeof row === "object") {
|
|
@@ -1974,7 +1973,7 @@ async function moduleCall(input, host) {
|
|
|
1974
1973
|
if (flags.length) out.flags = flags;
|
|
1975
1974
|
const lines = [`== ${apiName} ==`, `${effMethod} ${apiPath} \u2192 HTTP ${status}\uFF08via=${payload.via}\uFF09`];
|
|
1976
1975
|
if (rows !== null) {
|
|
1977
|
-
lines.push(`rows=${rows.length}${total !== null && total !== void 0 ? ` / total=${total}` : ""}
|
|
1976
|
+
lines.push(`rows=${rows.length}${total !== null && total !== void 0 ? ` / total=${total}` : ""}`);
|
|
1978
1977
|
lines.push(renderTable("", projected));
|
|
1979
1978
|
} else {
|
|
1980
1979
|
lines.push(JSON.stringify(payload.value, null, 1));
|
|
@@ -2289,7 +2288,6 @@ var INPUT_SCHEMAS = {
|
|
|
2289
2288
|
"header",
|
|
2290
2289
|
"headers",
|
|
2291
2290
|
"method",
|
|
2292
|
-
"limit",
|
|
2293
2291
|
"fields",
|
|
2294
2292
|
"raw",
|
|
2295
2293
|
"show_params",
|
|
@@ -2541,7 +2539,7 @@ var dataShortcut = {
|
|
|
2541
2539
|
await run(ctx, "data.scene.search", toInput(options), false);
|
|
2542
2540
|
}));
|
|
2543
2541
|
const moduleCommand = data.command("module").description("\u6A21\u5757\u914D\u7F6E\u63A5\u53E3\u8C03\u7528\uFF08\u914D\u7F6E\u4E2D\u5FC3\u9A71\u52A8\uFF09");
|
|
2544
|
-
moduleCommand.command("call").description("\u6309 confAttrs \u7EC4\u53C2\u5E76\u8C03\u7528\u63A5\u53E3\uFF08\u5DF2\u786E\u5B9A\u6A21\u5757 + \u63A5\u53E3\u4E4B\u540E\u7528\uFF09").option("--conf-key <key>", "confKey").option("--group <module>", "\u6A21\u5757\u552F\u4E00\u6807\u8BC6\uFF0C\u5982 WORKFLOW / EHR / DOCUMENT").option("--type <confType>", "confType\uFF0C\u9ED8\u8BA4 api").option("--conf-file <path>", "\u672C\u5730 confAttrs \u6587\u4EF6\uFF08\u8DF3\u8FC7\u914D\u7F6E\u8BFB\u53D6\uFF09").option("--args <json|@file>", "\u4E1A\u52A1\u53C2\u6570\uFF08JSON \u5BF9\u8C61\uFF09").option("--query <k=v&k2=v2>", "\u4E1A\u52A1\u53C2\u6570\uFF08query \u4E32\uFF0C\u4E0E --args \u5408\u5E76\uFF09").option("--header <k: v>", "\u989D\u5916\u8BF7\u6C42\u5934\uFF08\u5355\u4E2A\uFF09").option("--headers <json|@file>", "\u989D\u5916\u8BF7\u6C42\u5934\uFF08JSON \u5BF9\u8C61\uFF09").option("--method <GET|POST|FORM>", "\u63D0\u4EA4\u65B9\u5F0F\uFF0C\u9ED8\u8BA4\u53D6 confAttrs.http_method").option("--
|
|
2542
|
+
moduleCommand.command("call").description("\u6309 confAttrs \u7EC4\u53C2\u5E76\u8C03\u7528\u63A5\u53E3\uFF08\u5DF2\u786E\u5B9A\u6A21\u5757 + \u63A5\u53E3\u4E4B\u540E\u7528\uFF09").option("--conf-key <key>", "confKey").option("--group <module>", "\u6A21\u5757\u552F\u4E00\u6807\u8BC6\uFF0C\u5982 WORKFLOW / EHR / DOCUMENT").option("--type <confType>", "confType\uFF0C\u9ED8\u8BA4 api").option("--conf-file <path>", "\u672C\u5730 confAttrs \u6587\u4EF6\uFF08\u8DF3\u8FC7\u914D\u7F6E\u8BFB\u53D6\uFF09").option("--args <json|@file>", "\u4E1A\u52A1\u53C2\u6570\uFF08JSON \u5BF9\u8C61\uFF09").option("--query <k=v&k2=v2>", "\u4E1A\u52A1\u53C2\u6570\uFF08query \u4E32\uFF0C\u4E0E --args \u5408\u5E76\uFF09").option("--header <k: v>", "\u989D\u5916\u8BF7\u6C42\u5934\uFF08\u5355\u4E2A\uFF09").option("--headers <json|@file>", "\u989D\u5916\u8BF7\u6C42\u5934\uFF08JSON \u5BF9\u8C61\uFF09").option("--method <GET|POST|FORM>", "\u63D0\u4EA4\u65B9\u5F0F\uFF0C\u9ED8\u8BA4\u53D6 confAttrs.http_method").option("--fields <a,b|@f>", "\u53EA\u4FDD\u7559\u8FD9\u4E9B\u884C\u5B57\u6BB5").option("--raw", "\u539F\u6837\u8F93\u51FA\u54CD\u5E94\u4F53").option("--show-params", "\u53EA\u6253\u5370\u5165/\u51FA\u53C2\u8BF4\u660E\uFF0C\u4E0D\u8C03\u63A5\u53E3").option("--full", "--show-params \u65F6\u56DE\u663E\u5B8C\u6574 request_example").option("--with-example", "\u540C --full").option("--no-example", "--show-params \u65F6\u5F3A\u5236\u7701\u7565 request_example").option("--dry-run", "\u53EA\u7EC4\u88C5\u8BF7\u6C42\u4E0D\u53D1\u9001\uFF08\u51ED\u636E\u8131\u654F\uFF09").option("--timeout <sec>", "\u8D85\u65F6\u79D2\u6570\uFF0C\u9ED8\u8BA4 60").action(action(async (ctx, options) => {
|
|
2545
2543
|
await run(ctx, "data.module.call", toInput(options), false);
|
|
2546
2544
|
}));
|
|
2547
2545
|
const attend = data.command("attend").description("\u8003\u52E4 REST \u63A5\u53E3");
|
|
@@ -6,8 +6,8 @@ import {
|
|
|
6
6
|
meetingStateDir,
|
|
7
7
|
readCache,
|
|
8
8
|
resolveMeetingEnvMode
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import "./chunk-
|
|
9
|
+
} from "./chunk-I3BFBBP2.js";
|
|
10
|
+
import "./chunk-CI2RF3AJ.js";
|
|
11
11
|
import "./chunk-7BDPM5ST.js";
|
|
12
12
|
import "./chunk-UG5G54VL.js";
|
|
13
13
|
import "./chunk-BUSC6UAE.js";
|
|
@@ -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-ZHPCNM2S.js";
|
|
10
|
+
import "./chunk-I3BFBBP2.js";
|
|
11
|
+
import "./chunk-CI2RF3AJ.js";
|
|
12
12
|
import "./chunk-7BDPM5ST.js";
|
|
13
13
|
import "./chunk-UG5G54VL.js";
|
|
14
14
|
import "./chunk-BUSC6UAE.js";
|
|
@@ -1469,6 +1469,7 @@ var invoiceOperations = [
|
|
|
1469
1469
|
path: "/api/secondev/fna/expense/reimbursement/aiCreateWf",
|
|
1470
1470
|
autoCommit: "1",
|
|
1471
1471
|
currentEmpId: "session.userId",
|
|
1472
|
+
invoiceDateWindow: "\u5F00\u7968\u65E5\u671F\u5FC5\u987B\u5728\u6700\u8FD1 30 \u4E2A\u4E1C\u516B\u533A\u65E5\u5386\u65E5\u5185\uFF08\u4ECA\u5929\u53CA\u524D 29 \u5929\uFF0C\u542B\u9996\u5C3E\uFF09\uFF1B\u7F3A\u5931\u3001\u65E0\u6548\u3001\u8D85\u671F\u6216\u672A\u6765\u65E5\u671F\u5747\u5728\u63D0\u4EA4\u524D\u62D2\u7EDD",
|
|
1472
1473
|
detailList: "invoices \u6BCF\u5F20\u4E00\u884C {relatedProcessId, relatedInvoiceId, reimbursedAmount}\uFF0CrelatedProcessId \u5168\u90E8\u76F8\u540C\uFF1BreimbursedAmount \u53D6\u8BE5\u53D1\u7968 total\uFF0C\u5408\u8BA1\u4E0D\u8D85\u8FC7 monthlyAllowance\uFF0C\u8D85\u989D\u90A3\u884C\u62A5\u300C\u989D\u5EA6 \u2212 \u524D\u9762\u884C\u7D2F\u52A0\u300D\uFF0C\u989D\u5EA6\u7528\u5B8C\u540E\u5269\u4E0B\u7684\u53D1\u7968\u4E0D\u8FDB\u660E\u7EC6"
|
|
1473
1474
|
},
|
|
1474
1475
|
inputSchema: {
|
|
@@ -1483,14 +1484,15 @@ var invoiceOperations = [
|
|
|
1483
1484
|
type: "array",
|
|
1484
1485
|
minItems: 1,
|
|
1485
1486
|
maxItems: 100,
|
|
1486
|
-
description: "\u672C\u6B21\u62A5\u9500\u7684\u53D1\u7968\uFF0C\u6BCF\u5F20\u751F\u6210\u4E00\u884C\u660E\u7EC6\
|
|
1487
|
+
description: "\u672C\u6B21\u62A5\u9500\u7684\u53D1\u7968\uFF0C\u4EC5\u9650\u6700\u8FD1 30 \u5929\u5F00\u7968\uFF1B\u6BCF\u5F20\u751F\u6210\u4E00\u884C\u660E\u7EC6\uFF0C\u987A\u5E8F\u5373\u989D\u5EA6\u6263\u51CF\u987A\u5E8F",
|
|
1487
1488
|
items: {
|
|
1488
1489
|
type: "object",
|
|
1489
1490
|
additionalProperties: false,
|
|
1490
|
-
required: ["fid", "total"],
|
|
1491
|
+
required: ["fid", "total", "date"],
|
|
1491
1492
|
properties: {
|
|
1492
1493
|
fid: { ...positiveId, description: "\u7968\u5939\u53D1\u7968 fid" },
|
|
1493
|
-
total: { type: "string", pattern: "^\\d+(\\.\\d{1,2})?$", description: "\u8FD9\u5F20\u53D1\u7968\u7684\u4EF7\u7A0E\u5408\u8BA1\uFF08invoice.list \u7684 total\uFF09" }
|
|
1494
|
+
total: { type: "string", pattern: "^\\d+(\\.\\d{1,2})?$", description: "\u8FD9\u5F20\u53D1\u7968\u7684\u4EF7\u7A0E\u5408\u8BA1\uFF08invoice.list \u7684 total\uFF09" },
|
|
1495
|
+
date: { type: "string", pattern: "^\\d{4}-\\d{2}-\\d{2}$", description: "\u5F00\u7968\u65E5\u671F\uFF0C\u539F\u6837\u53D6 invoice.list \u7684 date\uFF1B\u5FC5\u987B\u5728\u4ECA\u5929\u53CA\u524D 29 \u5929\u5185\uFF08\u5317\u4EAC\u65F6\u95F4\uFF0C\u542B\u9996\u5C3E\uFF09" }
|
|
1494
1496
|
}
|
|
1495
1497
|
}
|
|
1496
1498
|
},
|
|
@@ -1516,8 +1518,8 @@ var invoiceOperations = [
|
|
|
1516
1518
|
skippedInvoices: arrayOf(objectSchema({
|
|
1517
1519
|
relatedInvoiceId: { type: "string" },
|
|
1518
1520
|
invoiceTotal: { type: "string" }
|
|
1519
|
-
}, ["relatedInvoiceId", "invoiceTotal"]), { description: "\u989D\u5EA6\u7528\u5B8C\u540E\u6CA1\u8FDB\u660E\u7EC6\u3001\u7559\u5728\u7968\u5939\u7684\u53D1\u7968" }),
|
|
1520
|
-
finalMarkdown: { type: "string", description: "
|
|
1521
|
+
}, ["relatedInvoiceId", "invoiceTotal"]), { description: "\u989D\u5EA6\u7528\u5B8C\u540E\u6CA1\u8FDB\u660E\u7EC6\u3001\u7559\u5728\u7968\u5939\u7684\u53D1\u7968\uFF1B\u6210\u529F\u56DE\u6267\u6C47\u603B\u5176\u5F20\u6570\u548C\u91D1\u989D" }),
|
|
1522
|
+
finalMarkdown: { type: "string", description: "\u6210\u529F\u63D0\u793A\u3001\u62A5\u9500\u4E8B\u7531\u3001\u5B9E\u9645\u62A5\u9500\u91D1\u989D\u3001\u5DF2\u4F7F\u7528\u53D1\u7968\u5F20\u6570\u53CA\u7968\u9762\u5408\u8BA1\u3001\u5F00\u7968\u65E5\u671F\u3001\u6708\u8865\u8D34\u989D\u5EA6\uFF08\u6709\u503C\u65F6\uFF09\u3001\u8D85\u989D\u53CA\u672A\u7EB3\u5165\u53D1\u7968\u8BF4\u660E\uFF08\u6709\u5219\u5C55\u793A\uFF09\uFF0C\u672B\u5C3E\u9644\u62A5\u9500\u6D41\u7A0B\u94FE\u63A5\uFF1B\u539F\u6837\u5C55\u793A\u7ED9\u7528\u6237" },
|
|
1521
1523
|
result: rawObject,
|
|
1522
1524
|
workflow: workflowSchema
|
|
1523
1525
|
}, ["requestId", "url", "processTitle", "invoiceCount", "reimbursedAmount", "invoiceTotal", "monthlyAllowance", "capped", "details", "skippedInvoices", "finalMarkdown", "result", "workflow"])
|
|
@@ -4125,15 +4127,33 @@ function amountCents2(value, name) {
|
|
|
4125
4127
|
function formatCents2(cents2) {
|
|
4126
4128
|
return cents2 % 100 === 0 ? String(cents2 / 100) : (cents2 / 100).toFixed(2);
|
|
4127
4129
|
}
|
|
4130
|
+
function subsidyInvoiceDateRange(now = /* @__PURE__ */ new Date()) {
|
|
4131
|
+
const dateEnd = shanghaiCalendarDate(0, now);
|
|
4132
|
+
return { dateBegin: addCalendarDays(dateEnd, -29), dateEnd };
|
|
4133
|
+
}
|
|
4128
4134
|
function normalizeInvoices(value) {
|
|
4129
4135
|
if (!Array.isArray(value) || value.length === 0) throw invoiceValidationError("input_invalid", "invoices \u5FC5\u987B\u662F\u975E\u7A7A\u6570\u7EC4");
|
|
4130
4136
|
if (value.length > 100) throw invoiceValidationError("input_invalid", "invoices \u5355\u6B21\u6700\u591A\u652F\u6301 100 \u5F20");
|
|
4137
|
+
const { dateBegin, dateEnd } = subsidyInvoiceDateRange();
|
|
4131
4138
|
const invoices = value.map((item, index) => {
|
|
4132
|
-
if (!item || typeof item !== "object") throw invoiceValidationError("input_invalid", `invoices[${index}] \u5FC5\u987B\u662F {fid,total}`);
|
|
4139
|
+
if (!item || typeof item !== "object") throw invoiceValidationError("input_invalid", `invoices[${index}] \u5FC5\u987B\u662F {fid,total,date}`);
|
|
4133
4140
|
const fid = asPositiveString(String(item.fid ?? ""), `invoices[${index}].fid`);
|
|
4134
4141
|
const cents2 = amountCents2(item.total, `invoices[${index}].total`);
|
|
4135
4142
|
if (cents2 === null) throw invoiceValidationError("input_invalid", `invoices[${index}].total \u5FC5\u586B\uFF1A\u8FD9\u5F20\u53D1\u7968\u7684\u4EF7\u7A0E\u5408\u8BA1`);
|
|
4136
|
-
|
|
4143
|
+
const date = asNonEmptyString(item.date, `invoices[${index}].date`);
|
|
4144
|
+
const timestamp = Date.parse(`${date}T00:00:00Z`);
|
|
4145
|
+
if (!/^\d{4}-\d{2}-\d{2}$/u.test(date) || !Number.isFinite(timestamp) || new Date(timestamp).toISOString().slice(0, 10) !== date) {
|
|
4146
|
+
throw invoiceValidationError("input_invalid", `invoices[${index}].date \u5FC5\u987B\u662F\u6709\u6548\u7684\u5F00\u7968\u65E5\u671F\uFF08YYYY-MM-DD\uFF09`);
|
|
4147
|
+
}
|
|
4148
|
+
if (date < dateBegin || date > dateEnd) {
|
|
4149
|
+
throw invoiceValidationError("invoice_date_out_of_range", `\u53D1\u7968 ${fid} \u7684\u5F00\u7968\u65E5\u671F ${date} \u4E0D\u5728\u6700\u8FD1 30 \u5929\u8303\u56F4\uFF08${dateBegin} \u81F3 ${dateEnd}\uFF0C\u5317\u4EAC\u65F6\u95F4\uFF09\u5185\uFF0C\u4E0D\u80FD\u62A5\u9500`, {
|
|
4150
|
+
fid,
|
|
4151
|
+
date,
|
|
4152
|
+
dateBegin,
|
|
4153
|
+
dateEnd
|
|
4154
|
+
});
|
|
4155
|
+
}
|
|
4156
|
+
return { fid, cents: cents2, date };
|
|
4137
4157
|
});
|
|
4138
4158
|
if (new Set(invoices.map((item) => item.fid)).size !== invoices.length) {
|
|
4139
4159
|
throw invoiceValidationError("input_invalid", "invoices \u4E0D\u80FD\u5305\u542B\u91CD\u590D fid");
|
|
@@ -4143,6 +4163,37 @@ function normalizeInvoices(value) {
|
|
|
4143
4163
|
function workflowViewUrl(baseUrl, requestId) {
|
|
4144
4164
|
return `${baseUrl.replace(/\/+$/, "")}/sp/workflow/flowpage/view/${requestId}`;
|
|
4145
4165
|
}
|
|
4166
|
+
function subsidyReceipt(options) {
|
|
4167
|
+
const { processTitle, reason, url, details, skipped, allowanceCents, reimbursedTotalCents } = options;
|
|
4168
|
+
const money = (cents2) => `\xA5${(cents2 / 100).toFixed(2)}`;
|
|
4169
|
+
const includedTotalCents = details.reduce((sum, item) => sum + item.cents, 0);
|
|
4170
|
+
const partialAmountCents = includedTotalCents - reimbursedTotalCents;
|
|
4171
|
+
const dates = details.map((item) => item.date).sort();
|
|
4172
|
+
const firstDate = dates[0];
|
|
4173
|
+
const lastDate = dates[dates.length - 1];
|
|
4174
|
+
const dateRange = firstDate === lastDate ? firstDate : `${firstDate} \u81F3 ${lastDate}`;
|
|
4175
|
+
const lines = [
|
|
4176
|
+
"\u5DF2\u62A5\u9500\u6210\u529F\uFF0C\u6D41\u7A0B\u5DF2\u63D0\u4EA4\u3002",
|
|
4177
|
+
"",
|
|
4178
|
+
"| \u9879\u76EE | \u672C\u6B21\u62A5\u9500 |",
|
|
4179
|
+
"| --- | --- |",
|
|
4180
|
+
`| \u62A5\u9500\u4E8B\u7531 | ${reason.replace(/\|/gu, "\\|").replace(/[\r\n]+/gu, " ")} |`,
|
|
4181
|
+
`| \u62A5\u9500\u91D1\u989D | **${money(reimbursedTotalCents)}** |`,
|
|
4182
|
+
`| \u5DF2\u4F7F\u7528\u53D1\u7968 | ${details.length} \u5F20\uFF0C\u7968\u9762\u5408\u8BA1 ${money(includedTotalCents)} |`,
|
|
4183
|
+
`| \u5F00\u7968\u65E5\u671F | ${dateRange} |`
|
|
4184
|
+
];
|
|
4185
|
+
if (allowanceCents !== null) lines.push(`| \u6708\u8865\u8D34\u989D\u5EA6 | ${money(allowanceCents)} |`);
|
|
4186
|
+
lines.push("");
|
|
4187
|
+
if (partialAmountCents > 0) {
|
|
4188
|
+
lines.push(`\u672C\u6B21\u6309\u6708\u8865\u8D34\u989D\u5EA6\u62A5\u9500\uFF0C\u5DF2\u4F7F\u7528\u53D1\u7968\u4E2D\u8D85\u51FA\u7684 ${money(partialAmountCents)} \u672A\u8BA1\u5165\u62A5\u9500\u91D1\u989D\u3002`, "");
|
|
4189
|
+
}
|
|
4190
|
+
if (skipped.length > 0) {
|
|
4191
|
+
const skippedTotalCents = skipped.reduce((sum, item) => sum + item.cents, 0);
|
|
4192
|
+
lines.push(`\u6708\u8865\u8D34\u989D\u5EA6\u5DF2\u7528\u5B8C\uFF0C\u53E6\u6709 ${skipped.length} \u5F20\u53D1\u7968\uFF08\u5408\u8BA1 ${money(skippedTotalCents)}\uFF09\u672A\u7EB3\u5165\u672C\u6B21\u62A5\u9500\uFF0C\u4ECD\u5728\u7968\u5939\u3002\u540E\u7EED\u62A5\u9500\u4ECD\u987B\u6EE1\u8DB3\u6700\u8FD1 30 \u5929\u7684\u5F00\u7968\u65E5\u671F\u8981\u6C42\u3002`, "");
|
|
4193
|
+
}
|
|
4194
|
+
lines.push(`[\u67E5\u770B\u62A5\u9500\u6D41\u7A0B\uFF1A${processTitle}](${url})`);
|
|
4195
|
+
return lines.join("\n");
|
|
4196
|
+
}
|
|
4146
4197
|
var InvoiceReimSubsidySubmitOperation = class {
|
|
4147
4198
|
name = "invoice.reim.subsidy.submit";
|
|
4148
4199
|
async execute(input, { host }) {
|
|
@@ -4242,7 +4293,7 @@ var InvoiceReimSubsidySubmitOperation = class {
|
|
|
4242
4293
|
relatedInvoiceId: item.fid,
|
|
4243
4294
|
invoiceTotal: formatCents2(item.cents)
|
|
4244
4295
|
})),
|
|
4245
|
-
finalMarkdown:
|
|
4296
|
+
finalMarkdown: subsidyReceipt({ processTitle, reason, url, details, skipped, allowanceCents, reimbursedTotalCents }),
|
|
4246
4297
|
result,
|
|
4247
4298
|
workflow: workflow(this.name, "COMPLETE")
|
|
4248
4299
|
}
|
|
@@ -3,20 +3,20 @@ const require = __esbuildCreateRequire(import.meta.url);
|
|
|
3
3
|
import {
|
|
4
4
|
getMeetingOperation,
|
|
5
5
|
meetingOperationDefinitions
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-FM7B5BIR.js";
|
|
7
|
+
import "./chunk-MQBMMJUV.js";
|
|
8
8
|
import "./chunk-WMRNO6IU.js";
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-
|
|
9
|
+
import "./chunk-ZHPCNM2S.js";
|
|
10
|
+
import "./chunk-2FHP4PYS.js";
|
|
11
|
+
import "./chunk-QNPIY5R6.js";
|
|
12
|
+
import "./chunk-AQOPPNTR.js";
|
|
13
|
+
import "./chunk-XR5BGFNT.js";
|
|
14
|
+
import "./chunk-U2DWV6JC.js";
|
|
15
15
|
import {
|
|
16
16
|
degradeMeetingEnvToStandard,
|
|
17
17
|
meetingStateDir,
|
|
18
18
|
readCache
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-I3BFBBP2.js";
|
|
20
20
|
import {
|
|
21
21
|
MeetingCliError,
|
|
22
22
|
asObject,
|
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
meetingAuthError,
|
|
25
25
|
meetingNetworkError,
|
|
26
26
|
meetingValidationError
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-CI2RF3AJ.js";
|
|
28
28
|
import {
|
|
29
29
|
reportPlatformError
|
|
30
30
|
} from "./chunk-6N4JPNFL.js";
|
|
@@ -298,7 +298,8 @@ function createMeetingHost(ctx, dependencies = {}) {
|
|
|
298
298
|
exitCode: 1
|
|
299
299
|
});
|
|
300
300
|
}
|
|
301
|
-
|
|
301
|
+
const typeMismatchHint = /接口类型不一致/.test(message) ? "\uFF1BEB \u5E94\u7528\u91CC\u8BE5\u52A8\u4F5C\u6D41\u7C7B\u578B\u4E0E\u8C03\u7528\u65B9\u5F0F\u4E0D\u7B26\uFF1Aupdate \u7C7B\u63A5\u53E3\u9700\u914D\u6210\u300C\u4FEE\u6539\u6570\u636E\u300D\uFF0Ccreate \u7C7B\u9700\u914D\u6210\u300C\u65B0\u5EFA\u6570\u636E\u300D" : "";
|
|
302
|
+
throw new MeetingCliError("api", "business_error", `${message}${typeMismatchHint}`, {
|
|
302
303
|
code,
|
|
303
304
|
details: { code, message },
|
|
304
305
|
exitCode: 1
|
|
@@ -420,7 +421,10 @@ var NO_FALLBACK_SUBTYPES = /* @__PURE__ */ new Set([
|
|
|
420
421
|
"flow_not_launchable",
|
|
421
422
|
"target_changed",
|
|
422
423
|
"env_unavailable",
|
|
423
|
-
"env_fallback"
|
|
424
|
+
"env_fallback",
|
|
425
|
+
// 服务端业务错(如「update_meeting_sign_info接口类型不一致」):参数/配置问题,
|
|
426
|
+
// 换标准版不可能解决,只会让调用方白跑一轮并掩盖真实错误。
|
|
427
|
+
"business_error"
|
|
424
428
|
]);
|
|
425
429
|
function describe(error) {
|
|
426
430
|
if (error instanceof MeetingCliError) {
|
|
@@ -65,8 +65,8 @@ async function ensureMinuteDoc(env, input) {
|
|
|
65
65
|
const id = String(input.id ?? "").trim();
|
|
66
66
|
const mtId = String(input.mtId ?? "").trim();
|
|
67
67
|
if (!id || !mtId) return null;
|
|
68
|
-
const { getMeetingOperation } = await import("./registry-
|
|
69
|
-
const { meetingStateDir } = await import("./env-
|
|
68
|
+
const { getMeetingOperation } = await import("./registry-WZCCBI5L.js");
|
|
69
|
+
const { meetingStateDir } = await import("./env-LQBLL3MZ.js");
|
|
70
70
|
const { mkdir, writeFile } = await import("node:fs/promises");
|
|
71
71
|
const { join } = await import("node:path");
|
|
72
72
|
const subject = String(input.subject ?? "").trim() || `\u4F1A\u8BAE\u7EAA\u8981-${mtId}`;
|
|
@@ -78,7 +78,7 @@ async function ensureMinuteDoc(env, input) {
|
|
|
78
78
|
});
|
|
79
79
|
const dir = join(meetingStateDir(env.ctx), "minute-docs");
|
|
80
80
|
await mkdir(dir, { recursive: true });
|
|
81
|
-
const filePath = join(dir, `${
|
|
81
|
+
const filePath = join(dir, `${fileName}.docx`);
|
|
82
82
|
await writeFile(filePath, buf);
|
|
83
83
|
const upload = await getMeetingOperation("meeting.attachment.upload").handler(
|
|
84
84
|
{ file: filePath, name: `${fileName}.docx`, module: "meeting", refId: mtId },
|
|
@@ -89,7 +89,7 @@ async function ensureMinuteDoc(env, input) {
|
|
|
89
89
|
let docId = "";
|
|
90
90
|
let docError = "";
|
|
91
91
|
try {
|
|
92
|
-
const { executeCaizhilianOperation } = await import("./operations-
|
|
92
|
+
const { executeCaizhilianOperation } = await import("./operations-6NXJ7RTE.js");
|
|
93
93
|
const { createCaizhilianHost } = await import("./host-TTSGY5NZ.js");
|
|
94
94
|
const { createCaizhilianContinuationSigner } = await import("./continuation-GW6PRWK3.js");
|
|
95
95
|
const caizhilianEnv = {
|
|
@@ -128,7 +128,7 @@ async function ensureMinuteDoc(env, input) {
|
|
|
128
128
|
id,
|
|
129
129
|
mt_id: mtId,
|
|
130
130
|
doc_file: fileId,
|
|
131
|
-
...docId ? { mt_minutes:
|
|
131
|
+
...docId ? { mt_minutes: docId } : {},
|
|
132
132
|
file_type: "0",
|
|
133
133
|
minutes_status: "2"
|
|
134
134
|
},
|
|
@@ -2,7 +2,7 @@ import { createRequire as __esbuildCreateRequire } from 'node:module';
|
|
|
2
2
|
const require = __esbuildCreateRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
4
|
executeCaizhilianOperation
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-WINR2Q6K.js";
|
|
6
6
|
import "./chunk-VMCCRWFO.js";
|
|
7
7
|
import "./chunk-P5GQRWDC.js";
|
|
8
8
|
import "./chunk-7BDPM5ST.js";
|
|
@@ -4,17 +4,17 @@ import {
|
|
|
4
4
|
getMeetingOperation,
|
|
5
5
|
hasMeetingOperation,
|
|
6
6
|
meetingOperationDefinitions
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import "./chunk-
|
|
7
|
+
} from "./chunk-FM7B5BIR.js";
|
|
8
|
+
import "./chunk-MQBMMJUV.js";
|
|
9
9
|
import "./chunk-WMRNO6IU.js";
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-
|
|
15
|
-
import "./chunk-
|
|
16
|
-
import "./chunk-
|
|
17
|
-
import "./chunk-
|
|
10
|
+
import "./chunk-ZHPCNM2S.js";
|
|
11
|
+
import "./chunk-2FHP4PYS.js";
|
|
12
|
+
import "./chunk-QNPIY5R6.js";
|
|
13
|
+
import "./chunk-AQOPPNTR.js";
|
|
14
|
+
import "./chunk-XR5BGFNT.js";
|
|
15
|
+
import "./chunk-U2DWV6JC.js";
|
|
16
|
+
import "./chunk-I3BFBBP2.js";
|
|
17
|
+
import "./chunk-CI2RF3AJ.js";
|
|
18
18
|
import "./chunk-7BDPM5ST.js";
|
|
19
19
|
import "./chunk-SHYQUBY3.js";
|
|
20
20
|
import "./chunk-UG5G54VL.js";
|
|
@@ -7,10 +7,10 @@ import {
|
|
|
7
7
|
loadRooms,
|
|
8
8
|
recommendRooms,
|
|
9
9
|
rememberFrequentRoom
|
|
10
|
-
} from "./chunk-
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
10
|
+
} from "./chunk-XR5BGFNT.js";
|
|
11
|
+
import "./chunk-U2DWV6JC.js";
|
|
12
|
+
import "./chunk-I3BFBBP2.js";
|
|
13
|
+
import "./chunk-CI2RF3AJ.js";
|
|
14
14
|
import "./chunk-7BDPM5ST.js";
|
|
15
15
|
import "./chunk-UG5G54VL.js";
|
|
16
16
|
import "./chunk-BUSC6UAE.js";
|
|
@@ -8,10 +8,10 @@ import {
|
|
|
8
8
|
resolveMeetingScheduleTypeIds,
|
|
9
9
|
resolveMemberIdsByName,
|
|
10
10
|
runScheduleConflictFlow
|
|
11
|
-
} from "./chunk-
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-
|
|
11
|
+
} from "./chunk-AQOPPNTR.js";
|
|
12
|
+
import "./chunk-U2DWV6JC.js";
|
|
13
|
+
import "./chunk-I3BFBBP2.js";
|
|
14
|
+
import "./chunk-CI2RF3AJ.js";
|
|
15
15
|
import "./chunk-7BDPM5ST.js";
|
|
16
16
|
import "./chunk-UG5G54VL.js";
|
|
17
17
|
import "./chunk-BUSC6UAE.js";
|
package/dist/index.js
CHANGED
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
firstPositionalToken,
|
|
8
8
|
registerCommands,
|
|
9
9
|
toCommandMetadata
|
|
10
|
-
} from "./chunks/chunk-
|
|
10
|
+
} from "./chunks/chunk-6YWHRXEQ.js";
|
|
11
11
|
import "./chunks/chunk-2IGZUMNG.js";
|
|
12
12
|
import "./chunks/chunk-FMNCSYIG.js";
|
|
13
13
|
import "./chunks/chunk-AJ62BGAW.js";
|
|
@@ -31,7 +31,7 @@ function lazyShortcut(definition) {
|
|
|
31
31
|
placeholder.allowExcessArguments(true);
|
|
32
32
|
placeholder.helpOption(false);
|
|
33
33
|
placeholder.action(async () => {
|
|
34
|
-
const { dispatchLazyShortcut } = await import("./chunks/lazy-dispatch-
|
|
34
|
+
const { dispatchLazyShortcut } = await import("./chunks/lazy-dispatch-GCA6HDOB.js");
|
|
35
35
|
await dispatchLazyShortcut(definition, shortcutMetadata());
|
|
36
36
|
});
|
|
37
37
|
}
|
|
@@ -41,7 +41,7 @@ var builtinShortcuts = [
|
|
|
41
41
|
lazyShortcut({
|
|
42
42
|
name: "invoice",
|
|
43
43
|
description: "E10 \u4E1A\u7968\u901A\u53D1\u7968\u7BA1\u7406 CLI",
|
|
44
|
-
load: async () => (await import("./chunks/invoice-
|
|
44
|
+
load: async () => (await import("./chunks/invoice-6XDMPCWB.js")).invoiceShortcut
|
|
45
45
|
}),
|
|
46
46
|
lazyShortcut({
|
|
47
47
|
name: "ehr",
|
|
@@ -91,7 +91,7 @@ var builtinShortcuts = [
|
|
|
91
91
|
lazyShortcut({
|
|
92
92
|
name: "meeting",
|
|
93
93
|
description: "\u6CDB\u5FAEE10\u4F1A\u8BAE\u7BA1\u7406 CLI\uFF08\u6807\u51C6\u7248\uFF1A\u67E5\u8BE2/\u51B2\u7A81/\u9884\u7EA6/\u56DE\u6267/\u7B7E\u5230\uFF09",
|
|
94
|
-
load: async () => (await import("./chunks/meeting-
|
|
94
|
+
load: async () => (await import("./chunks/meeting-GMRQZFJP.js")).meetingShortcut
|
|
95
95
|
}),
|
|
96
96
|
lazyShortcut({
|
|
97
97
|
name: "okr",
|
|
@@ -151,7 +151,7 @@ var builtinShortcuts = [
|
|
|
151
151
|
lazyShortcut({
|
|
152
152
|
name: "caizhilian",
|
|
153
153
|
description: "\u6CDB\u5FAEE10\u91C7\u77E5\u8FDE\uFF08\u6587\u6863\u4E2D\u5FC3\uFF09CLI",
|
|
154
|
-
load: async () => (await import("./chunks/caizhilian-
|
|
154
|
+
load: async () => (await import("./chunks/caizhilian-5NM4X5HG.js")).caizhilianShortcut
|
|
155
155
|
}),
|
|
156
156
|
lazyShortcut({
|
|
157
157
|
name: "contract",
|
|
@@ -171,7 +171,7 @@ var builtinShortcuts = [
|
|
|
171
171
|
lazyShortcut({
|
|
172
172
|
name: "data",
|
|
173
173
|
description: "\u6CDB\u5FAEE10\u6570\u636E\u52A9\u624B CLI\uFF08\u6570\u636E\u6E90\u67E5\u8BE2 / \u914D\u7F6E\u4E2D\u5FC3 / \u573A\u666F\u5B9A\u4F4D\uFF09",
|
|
174
|
-
load: async () => (await import("./chunks/data-
|
|
174
|
+
load: async () => (await import("./chunks/data-ZVS3BWPT.js")).dataShortcut
|
|
175
175
|
})
|
|
176
176
|
];
|
|
177
177
|
function shortcutMetadata() {
|
|
@@ -327,7 +327,33 @@ function openUrlWithSystemHandler(url) {
|
|
|
327
327
|
});
|
|
328
328
|
});
|
|
329
329
|
}
|
|
330
|
-
|
|
330
|
+
/**
|
|
331
|
+
* 统一认证页面的推广渠道标识(`promotionKeyword`)。
|
|
332
|
+
*
|
|
333
|
+
* 该参数由 E10 侧用于统计「登录从哪个智能体入口发起」,因此取值必须是稳定的小写标识:
|
|
334
|
+
* 千问的宿主 key 是 `qwen`、小 e 的 `agentType` 是 `XiaoE`,但关键字统一写
|
|
335
|
+
* `qianwen` / `xiaoe`。未命中规则的(含终端默认的 `weaver-work-cli`)不下发该参数,
|
|
336
|
+
* 避免把 `weaverworkcli` 这类内部名当成渠道写进统计。
|
|
337
|
+
*
|
|
338
|
+
* 别名同时收中文:各业务 skill 让 Agent 传的是「当前智能体名称」,实际常写成「豆包」「千问」。
|
|
339
|
+
* 新增智能体时在这里补一条规则即可。
|
|
340
|
+
*/
|
|
341
|
+
const PROMOTION_KEYWORD_RULES = [
|
|
342
|
+
{ keyword: 'xiaoe', aliases: ['xiaoe', '小e', '智能小e'] },
|
|
343
|
+
{ keyword: 'workbuddy', aliases: ['workbuddy'] },
|
|
344
|
+
{ keyword: 'codex', aliases: ['codex', 'openaicodex'] },
|
|
345
|
+
{ keyword: 'doubao', aliases: ['doubao', '豆包', '豆包办公'] },
|
|
346
|
+
{ keyword: 'qianwen', aliases: ['qwen', 'qianwen', 'qwenwork', '千问', '通义千问', '千问办公'] },
|
|
347
|
+
];
|
|
348
|
+
/** 把 `agentType` 归一化成 `promotionKeyword`;无法归类时返回空串(调用方不下发该参数)。 */
|
|
349
|
+
export function resolvePromotionKeyword(agentType) {
|
|
350
|
+
const normalized = normalizeAgentAlias(agentType);
|
|
351
|
+
if (!normalized)
|
|
352
|
+
return '';
|
|
353
|
+
const matched = PROMOTION_KEYWORD_RULES.find(({ aliases }) => aliases.some((alias) => normalized.startsWith(alias)));
|
|
354
|
+
return matched ? matched.keyword : '';
|
|
355
|
+
}
|
|
356
|
+
export function buildE10AuthorizeUrl(baseUrl, redirectUri, agentType, promotionKeyword = resolvePromotionKeyword(agentType)) {
|
|
331
357
|
const authorizeParams = new URLSearchParams({
|
|
332
358
|
redirect_uri: redirectUri,
|
|
333
359
|
response_type: 'code',
|
|
@@ -335,6 +361,8 @@ export function buildE10AuthorizeUrl(baseUrl, redirectUri, agentType) {
|
|
|
335
361
|
agent_type: agentType,
|
|
336
362
|
from: agentType,
|
|
337
363
|
});
|
|
364
|
+
if (promotionKeyword)
|
|
365
|
+
authorizeParams.set('promotionKeyword', promotionKeyword);
|
|
338
366
|
return `${baseUrl}/papi/sso/oauth2.0/authorize?${authorizeParams.toString()}`;
|
|
339
367
|
}
|
|
340
368
|
/** Node's HTTP parser exposes the first unread bytes when TLS is sent to an HTTP listener. */
|
|
@@ -121,7 +121,10 @@ export function buildMultipart(fields, file) {
|
|
|
121
121
|
}
|
|
122
122
|
if (file) {
|
|
123
123
|
const mime = MIME_BY_EXT[extname(file.meta.name).toLowerCase()] || 'application/octet-stream';
|
|
124
|
-
|
|
124
|
+
// Buffer 底层恒为普通 ArrayBuffer(fs.readFile 不给 SharedArrayBuffer),
|
|
125
|
+
// 取零拷贝视图作为 Blob 分片,避免整块内容的多余拷贝。
|
|
126
|
+
const bytes = new Uint8Array(file.meta.content.buffer, file.meta.content.byteOffset, file.meta.content.byteLength);
|
|
127
|
+
form.append(file.field, new Blob([bytes], { type: mime }), file.meta.name);
|
|
125
128
|
}
|
|
126
129
|
return form;
|
|
127
130
|
}
|