weaver-work-cli 0.1.31 → 0.1.33
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 +2 -2
- package/dist/chunks/{archive-U766FTFH.js → archive-FVFY6GZN.js} +2 -2
- package/dist/chunks/{archive-oa-DMWEKX3L.js → archive-oa-NW3OD4UV.js} +2 -2
- package/dist/chunks/{asset-TCR7VDEV.js → asset-7QJKMIDV.js} +2 -2
- package/dist/chunks/{attachment-content-AQNX5N3S.js → attachment-content-OSAVA6K3.js} +3 -2
- package/dist/chunks/{blog-EVZWGDVM.js → blog-I7SDPNW4.js} +2 -2
- package/dist/chunks/{caizhilian-JOWS6SL5.js → caizhilian-O37ZIQNY.js} +2 -2
- package/dist/chunks/{calendar-5WNCV66Q.js → calendar-7KXE4ED3.js} +2 -2
- package/dist/chunks/{chunk-VZTXRG6X.js → chunk-2FLWXFVS.js} +4 -4
- package/dist/chunks/{chunk-QWY6PGL6.js → chunk-2LV74IWP.js} +361 -56
- package/dist/chunks/chunk-3SO6QL6U.js +73 -0
- package/dist/chunks/{chunk-H3WDBYJW.js → chunk-6ATGWRZM.js} +6 -4
- package/dist/chunks/chunk-BYATLLEF.js +68 -0
- package/dist/chunks/chunk-BYBSCN4X.js +932 -0
- package/dist/chunks/{chunk-324YPTC2.js → chunk-D223PTXU.js} +11 -2
- package/dist/chunks/{chunk-R2IJAK7T.js → chunk-EEWPQE3O.js} +2 -2
- package/dist/chunks/{chunk-J7RJTZSV.js → chunk-GFPXQIY2.js} +2 -2
- package/dist/chunks/{chunk-AC7KJWC5.js → chunk-HEL5XTYI.js} +12 -6
- package/dist/chunks/{chunk-CVZ2JOSW.js → chunk-IHUYP6LO.js} +1 -1
- package/dist/chunks/{chunk-R7O5PUWO.js → chunk-ILMBNVSG.js} +2 -2
- package/dist/chunks/{chunk-6V7ZLF34.js → chunk-KAS45KNR.js} +1 -1
- package/dist/chunks/{chunk-H6XSTSLM.js → chunk-MEEFGWTM.js} +54 -196
- package/dist/chunks/{chunk-GCG2NMWR.js → chunk-MQ2I5AA3.js} +4 -2
- package/dist/chunks/chunk-NHA62QD7.js +774 -0
- package/dist/chunks/{chunk-2DUV44UX.js → chunk-OCU4RLHC.js} +641 -309
- package/dist/chunks/{chunk-65QMVWHS.js → chunk-PRHJGPMA.js} +2 -2
- package/dist/chunks/{chunk-WHD4XMRP.js → chunk-Q6LWB5HX.js} +2 -2
- package/dist/chunks/{chunk-D4LTJSJD.js → chunk-RBGOMK4Y.js} +50 -33
- package/dist/chunks/chunk-VBCFFFGT.js +226 -0
- package/dist/chunks/{ebuilder-form-NJ4YK6CC.js → chunk-WRRJ4GG2.js} +22 -1148
- package/dist/chunks/{chunk-RCGYCOMG.js → chunk-WY74UBJ6.js} +264 -750
- package/dist/chunks/conflict-SFNEVJY5.js +21 -0
- package/dist/chunks/continuation-RN6PZN2M.js +11 -0
- package/dist/chunks/cowork-CKWYHXYB.js +2508 -0
- package/dist/chunks/ebuilder-form-KOLJRVZD.js +121 -0
- package/dist/chunks/{ehr-MMYN36VA.js → ehr-WFOC3B4D.js} +1174 -20
- package/dist/chunks/{esb-HIWHOU7Q.js → esb-LJZTN663.js} +4 -4
- package/dist/chunks/{fna-KBACQTA5.js → fna-F7QRIIZC.js} +2 -2
- package/dist/chunks/{host-3OHS5QUX.js → host-BCGUVEWX.js} +3 -3
- package/dist/chunks/host-BQBRHVR3.js +23 -0
- package/dist/chunks/{host-KQL5N4HO.js → host-DGE2TZD4.js} +3 -3
- package/dist/chunks/{host-LLSZQCWR.js → host-KXPTEWFS.js} +3 -3
- package/dist/chunks/{host-IG6KEH5Q.js → host-VQ6JJXGQ.js} +3 -3
- package/dist/chunks/{hrm-LYEC67ZQ.js → hrm-NI6XAKW5.js} +3 -3
- package/dist/chunks/{im-RN2UKAEU.js → im-7TRTF3KT.js} +88 -12
- package/dist/chunks/{invoice-EEPHLAF6.js → invoice-AOXWJKYT.js} +3 -3
- package/dist/chunks/{jiuchuanhui-WVVZYSJE.js → jiuchuanhui-7NQWEZAW.js} +2 -2
- package/dist/chunks/{lazy-dispatch-MDOFFL2S.js → lazy-dispatch-RNS4EE4S.js} +4 -4
- package/dist/chunks/{mail-LNQLTF6L.js → mail-VDHJAB4O.js} +3 -3
- package/dist/chunks/{meeting-XSD3BDVQ.js → meeting-GA7XCNNP.js} +214 -43
- package/dist/chunks/{okr-TMWTIU2K.js → okr-TQIRERPQ.js} +2 -2
- package/dist/chunks/operations-5QL3AECO.js +11 -0
- package/dist/chunks/{plan-A2FSFA7T.js → plan-4RY4LN2P.js} +2 -2
- package/dist/chunks/{project-T26QLBQF.js → project-D6XT2OC5.js} +2 -2
- package/dist/chunks/{registry-JCFEYXOE.js → registry-JHRIDQ3A.js} +4 -4
- package/dist/chunks/{registry-2VLUAESA.js → registry-OZSMDVPP.js} +2 -2
- package/dist/chunks/{registry-ZJMJVWFA.js → registry-QKMI43Q6.js} +8 -6
- package/dist/chunks/{registry-Q7OQJ3SU.js → registry-VOGKFFTR.js} +2 -2
- package/dist/chunks/{room-recommend-UR4ZDZS6.js → room-recommend-D4EUOOWY.js} +4 -3
- package/dist/chunks/{schedule-5L2PM4M6.js → schedule-XPFBHPCV.js} +4 -3
- package/dist/chunks/{workflow-TR6PG2SL.js → workflow-HLBZRWIY.js} +172 -6
- package/dist/core/package-paths.js +16 -2
- package/dist/index.js +30 -25
- package/dist/internal/e10/auth-recovery.js +14 -4
- package/dist/shortcuts/contract/host.js +34 -59
- package/dist/shortcuts/cowork/continuation.js +70 -0
- package/dist/shortcuts/cowork/errors.js +59 -0
- package/dist/shortcuts/cowork/host.js +172 -0
- package/dist/shortcuts/cowork/index.js +166 -0
- package/dist/shortcuts/cowork/manifest.js +65 -0
- package/dist/shortcuts/cowork/operations/discuss-write.js +277 -0
- package/dist/shortcuts/cowork/operations/item-write.js +380 -0
- package/dist/shortcuts/cowork/operations/member-write.js +283 -0
- package/dist/shortcuts/cowork/operations/permission-write.js +286 -0
- package/dist/shortcuts/cowork/operations/read.js +423 -0
- package/dist/shortcuts/cowork/operations/registry.js +39 -0
- package/dist/shortcuts/cowork/operations/review-write.js +157 -0
- package/dist/shortcuts/cowork/operations/shared.js +215 -0
- package/dist/shortcuts/cowork/operations/types.js +24 -0
- package/dist/shortcuts/cowork/operations.js +19 -0
- package/dist/shortcuts/ehr/host.js +4 -1
- package/dist/shortcuts/ehr/operations/recruit-candidate-import.js +757 -0
- package/dist/shortcuts/ehr/operations/recruit-position.js +367 -0
- package/dist/shortcuts/ehr/operations/recruit-stats.js +133 -0
- package/dist/shortcuts/ehr/operations/recruit-write.js +8 -16
- package/dist/shortcuts/ehr/operations/recruit.js +35 -10
- package/dist/shortcuts/ehr/operations/registry.js +6 -0
- package/dist/shortcuts/im/diagnostics.js +97 -0
- package/dist/shortcuts/im/host.js +58 -31
- package/dist/shortcuts/im/index.js +7 -2
- package/dist/shortcuts/im/operations/at-mention.js +127 -0
- package/dist/shortcuts/im/operations/file-user.js +10 -2
- package/dist/shortcuts/im/operations/group-read.js +26 -5
- package/dist/shortcuts/im/operations/group-write.js +35 -28
- package/dist/shortcuts/im/operations/msg-sync.js +7 -2
- package/dist/shortcuts/im/operations/msg-write.js +76 -10
- package/dist/shortcuts/im/operations/quote-mention.js +119 -0
- package/dist/shortcuts/im/operations/session.js +1 -1
- package/dist/shortcuts/im/operations/shared.js +10 -0
- package/dist/shortcuts/im/operations/types.js +13 -0
- package/dist/shortcuts/index.js +5 -0
- package/dist/shortcuts/mail/host.js +4 -1
- package/dist/shortcuts/meeting/host.js +27 -34
- package/dist/shortcuts/meeting/operations/create.js +4 -1
- package/dist/shortcuts/meeting/operations/eb/catalog.js +5 -0
- package/dist/shortcuts/meeting/operations/eb/conflict.js +78 -7
- package/dist/shortcuts/meeting/operations/eb/create-flow.js +168 -26
- package/dist/shortcuts/meeting/operations/eb/factory.js +69 -1
- package/dist/shortcuts/meeting/operations/eb/index.js +16 -3
- package/dist/shortcuts/meeting/operations/eb/room-recommend.js +14 -3
- package/dist/shortcuts/meeting/operations/eb-fallback.js +159 -0
- package/dist/shortcuts/meeting/operations/env.js +93 -46
- package/dist/shortcuts/meeting/operations/form-fields.js +110 -0
- package/dist/shortcuts/meeting/operations/registry.js +2 -0
- package/dist/shortcuts/meeting/operations/standard-guard.js +71 -0
- package/dist/shortcuts/meeting/operations.js +16 -0
- package/dist/shortcuts/workflow/index.js +110 -1
- package/dist/shortcuts/workflow/operations/form.js +24 -3
- package/dist/shortcuts/workflow/operations/read.js +104 -23
- package/dist/shortcuts/workflow/operations/todoSmartConvert/aigroupRules.js +448 -0
- package/dist/shortcuts/workflow/operations/todoSmartConvert/aigroupStore.js +106 -0
- package/dist/shortcuts/workflow/operations/todoSmartConvert/businessRules.js +47 -0
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.collect.js +30 -23
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.core.js +1 -0
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.group.js +1 -0
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.groupSummary.js +2 -1
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.js +2 -4
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.smartGroup.js +138 -181
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.summary.js +12 -7
- package/docs/e10-auth.md +1 -1
- package/docs/im.md +8 -1
- package/docs/todo-smart-convert/README.md +1 -1
- package/docs/todo-smart-convert/data-contract.md +2 -2
- package/docs/todo-smart-convert/subgroup-rules.md +6 -0
- package/package.json +1 -1
- package/skill-template/domains/yimiaoban.md +3 -3
- package/skill-template/skill-template.md +1 -1
- package/skills/weaver-e10-blog/SKILL.md +5 -5
- package/skills/weaver-e10-caizhilian/SKILL.md +5 -5
- package/skills/weaver-e10-calendar/SKILL.md +5 -5
- package/skills/weaver-e10-esb/SKILL.md +5 -5
- package/skills/weaver-e10-hrm/SKILL.md +5 -5
- package/skills/weaver-e10-jinchengda/SKILL.md +2 -2
- package/skills/weaver-e10-jiuchuanhui/SKILL.md +5 -5
- package/skills/weaver-e10-jucailin/SKILL.md +18 -12
- package/skills/weaver-e10-jucailin/references/recruit-create.md +104 -0
- package/skills/weaver-e10-mail/SKILL.md +5 -5
- package/skills/weaver-e10-meeting/SKILL.md +171 -25
- package/skills/weaver-e10-meeting/references/meeting-eb.md +4 -3
- package/skills/weaver-e10-meeting/references/meeting-queries.md +9 -6
- package/skills/weaver-e10-meeting/references/meeting-verification.md +8 -6
- package/skills/weaver-e10-meeting.zip +0 -0
- package/skills/weaver-e10-okr/SKILL.md +5 -5
- package/skills/weaver-e10-okr/references/source-manifest.json +3 -3
- package/skills/weaver-e10-plan/SKILL.md +5 -5
- package/skills/weaver-e10-shared/SKILL.md +12 -12
- package/skills/weaver-e10-shared/references/e10-auth-and-session.md +4 -4
- package/skills/weaver-e10-wenshuding/SKILL.md +5 -5
- package/skills/weaver-e10-workflow/SKILL.md +29 -5
- package/skills/weaver-e10-workflow/aigroup/default.json +88 -0
- package/skills/weaver-e10-workflow/references/todo-smart-convert.md +66 -14
- package/skills/weaver-e10-workflow/references/workflow-agent-entry.md +1 -1
- package/skills/weaver-e10-workflow/references/workflow-memory.md +1 -1
- package/skills/weaver-e10-workflow/references/workflow-query.md +12 -10
- package/skills/weaver-e10-workflow/references/workflow-view.md +2 -2
- package/skills/weaver-e10-workflow/tools/todo-serve.cjs +239 -0
- package/skills/weaver-e10-workflow/{scripts → tools}/todo-summary.cjs +218 -28
- package/skills/weaver-e10-yepiaotong/SKILL.md +10 -8
- package/skills/weaver-e10-yepiaotong/references/invoice-reim.md +7 -7
- package/skills/weaver-e10-yepiaotong/references/reim-api-reference.md +10 -10
- package/skills/weaver-e10-yepiaotong/references/reim-examples.md +40 -37
- package/skills/weaver-e10-yepiaotong/references/reim-expense-subject-rules.md +4 -4
- package/skills/weaver-e10-yepiaotong/references/reim-form-fill-rules.md +27 -38
- package/skills/weaver-e10-yepiaotong/references/reim-phone-subsidy-rules.md +4 -4
- package/skills/weaver-e10-yepiaotong/references/reim-workflow.md +37 -29
- package/skills/weaver-e10-yimiaoban/SKILL.md +156 -33
- package/skills/weaver-e10-yimiaoban/references/ding-write.md +1 -1
- package/skills/weaver-e10-yimiaoban/references/error-codes.md +5 -1
- package/skills/weaver-e10-yimiaoban/references/group-read.md +5 -1
- package/skills/weaver-e10-yimiaoban/references/group-write.md +6 -4
- package/skills/weaver-e10-yimiaoban/references/msg-read.md +1 -0
- package/skills/weaver-e10-yimiaoban/references/msg-write.md +34 -2
- package/skills/weaver-e10-yimiaoban/references/safety-boundaries.md +5 -2
- package/skills/weaver-e10-yimiaoban/references/source-manifest.json +79 -58
- package/skills/weaver-e10-yimiaoban/references/user-remind.md +2 -2
- package/skills/weaver-e10-ziguanjia/SKILL.md +5 -5
|
@@ -9,15 +9,15 @@ import {
|
|
|
9
9
|
assertNoForbiddenKeys,
|
|
10
10
|
esbManifest,
|
|
11
11
|
getEsbOperation
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-KAS45KNR.js";
|
|
13
13
|
import {
|
|
14
14
|
createEsbHost
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-ILMBNVSG.js";
|
|
16
16
|
import {
|
|
17
17
|
esbValidationError
|
|
18
18
|
} from "./chunk-GPMFD4RD.js";
|
|
19
|
-
import "./chunk-
|
|
20
|
-
import "./chunk-
|
|
19
|
+
import "./chunk-6ATGWRZM.js";
|
|
20
|
+
import "./chunk-D223PTXU.js";
|
|
21
21
|
import {
|
|
22
22
|
isCliError,
|
|
23
23
|
toErrorEnvelope
|
|
@@ -4,11 +4,11 @@ import {
|
|
|
4
4
|
E10ApiError,
|
|
5
5
|
createE10RequestRuntime,
|
|
6
6
|
requireE10Session
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-6ATGWRZM.js";
|
|
8
8
|
import {
|
|
9
9
|
E10_SESSION_EXPIRED_MESSAGE,
|
|
10
10
|
getActiveProfile
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-D223PTXU.js";
|
|
12
12
|
import {
|
|
13
13
|
CliError,
|
|
14
14
|
isCliError,
|
|
@@ -6,10 +6,10 @@ import {
|
|
|
6
6
|
createEsbHost,
|
|
7
7
|
isEsbFlowUnavailable,
|
|
8
8
|
triggerResultCode
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-ILMBNVSG.js";
|
|
10
10
|
import "./chunk-GPMFD4RD.js";
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-
|
|
11
|
+
import "./chunk-6ATGWRZM.js";
|
|
12
|
+
import "./chunk-D223PTXU.js";
|
|
13
13
|
import "./chunk-LUSPKZKY.js";
|
|
14
14
|
import "./chunk-BUSC6UAE.js";
|
|
15
15
|
export {
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { createRequire as __esbuildCreateRequire } from 'node:module';
|
|
2
|
+
const require = __esbuildCreateRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
createEbuilderFormHost,
|
|
5
|
+
encodeNlistCustomConfig,
|
|
6
|
+
parseDirectListUrl,
|
|
7
|
+
pickEbuilderDataKey,
|
|
8
|
+
resolveApiPrefix,
|
|
9
|
+
routeEbuilderPath
|
|
10
|
+
} from "./chunk-WRRJ4GG2.js";
|
|
11
|
+
import "./chunk-BYATLLEF.js";
|
|
12
|
+
import "./chunk-6ATGWRZM.js";
|
|
13
|
+
import "./chunk-D223PTXU.js";
|
|
14
|
+
import "./chunk-LUSPKZKY.js";
|
|
15
|
+
import "./chunk-BUSC6UAE.js";
|
|
16
|
+
export {
|
|
17
|
+
createEbuilderFormHost,
|
|
18
|
+
encodeNlistCustomConfig,
|
|
19
|
+
parseDirectListUrl,
|
|
20
|
+
pickEbuilderDataKey,
|
|
21
|
+
resolveApiPrefix,
|
|
22
|
+
routeEbuilderPath
|
|
23
|
+
};
|
|
@@ -7,10 +7,10 @@ import {
|
|
|
7
7
|
dirname,
|
|
8
8
|
mkdir,
|
|
9
9
|
writeFile
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-RBGOMK4Y.js";
|
|
11
11
|
import "./chunk-ZEDWSH32.js";
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-6ATGWRZM.js";
|
|
13
|
+
import "./chunk-D223PTXU.js";
|
|
14
14
|
import "./chunk-LUSPKZKY.js";
|
|
15
15
|
import "./chunk-BUSC6UAE.js";
|
|
16
16
|
export {
|
|
@@ -4,10 +4,10 @@ import {
|
|
|
4
4
|
businessMessage,
|
|
5
5
|
createHrmHost,
|
|
6
6
|
isBusinessSuccess
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-Q6LWB5HX.js";
|
|
8
8
|
import "./chunk-OOUTBLZ4.js";
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
9
|
+
import "./chunk-6ATGWRZM.js";
|
|
10
|
+
import "./chunk-D223PTXU.js";
|
|
11
11
|
import "./chunk-LUSPKZKY.js";
|
|
12
12
|
import "./chunk-BUSC6UAE.js";
|
|
13
13
|
export {
|
|
@@ -5,10 +5,10 @@ import {
|
|
|
5
5
|
extractApiBusinessError,
|
|
6
6
|
isAtustRedirect,
|
|
7
7
|
isLoginExpired
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-PRHJGPMA.js";
|
|
9
9
|
import "./chunk-FMPJJYYI.js";
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
10
|
+
import "./chunk-6ATGWRZM.js";
|
|
11
|
+
import "./chunk-D223PTXU.js";
|
|
12
12
|
import "./chunk-LUSPKZKY.js";
|
|
13
13
|
import "./chunk-BUSC6UAE.js";
|
|
14
14
|
export {
|
|
@@ -2,7 +2,7 @@ import { createRequire as __esbuildCreateRequire } from 'node:module';
|
|
|
2
2
|
const require = __esbuildCreateRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
4
|
createHrmHost
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-Q6LWB5HX.js";
|
|
6
6
|
import {
|
|
7
7
|
getHrmOperation,
|
|
8
8
|
hrmOperationDefinitions
|
|
@@ -14,8 +14,8 @@ import {
|
|
|
14
14
|
import {
|
|
15
15
|
hrmValidationError
|
|
16
16
|
} from "./chunk-OOUTBLZ4.js";
|
|
17
|
-
import "./chunk-
|
|
18
|
-
import "./chunk-
|
|
17
|
+
import "./chunk-6ATGWRZM.js";
|
|
18
|
+
import "./chunk-D223PTXU.js";
|
|
19
19
|
import {
|
|
20
20
|
isCliError,
|
|
21
21
|
toErrorEnvelope
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import { createRequire as __esbuildCreateRequire } from 'node:module';
|
|
2
2
|
const require = __esbuildCreateRequire(import.meta.url);
|
|
3
|
-
import {
|
|
4
|
-
createImContinuationSigner
|
|
5
|
-
} from "./chunk-P26ZWSKU.js";
|
|
6
3
|
import {
|
|
7
4
|
asObject,
|
|
8
5
|
assertNoForbiddenKeys,
|
|
9
6
|
getImOperation,
|
|
10
7
|
imOperationDefinitions
|
|
11
|
-
} from "./chunk-
|
|
12
|
-
import "./chunk-YLCYX7LE.js";
|
|
8
|
+
} from "./chunk-2LV74IWP.js";
|
|
13
9
|
import {
|
|
14
10
|
createImHost
|
|
15
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-RBGOMK4Y.js";
|
|
12
|
+
import {
|
|
13
|
+
createImContinuationSigner
|
|
14
|
+
} from "./chunk-P26ZWSKU.js";
|
|
16
15
|
import {
|
|
17
16
|
imValidationError
|
|
18
17
|
} from "./chunk-ZEDWSH32.js";
|
|
19
|
-
import "./chunk-
|
|
20
|
-
import "./chunk-
|
|
18
|
+
import "./chunk-YLCYX7LE.js";
|
|
19
|
+
import "./chunk-6ATGWRZM.js";
|
|
20
|
+
import "./chunk-D223PTXU.js";
|
|
21
21
|
import {
|
|
22
22
|
isCliError,
|
|
23
23
|
toErrorEnvelope
|
|
@@ -27,6 +27,81 @@ import "./chunk-BUSC6UAE.js";
|
|
|
27
27
|
// src/shortcuts/im/index.ts
|
|
28
28
|
import { readFile } from "node:fs/promises";
|
|
29
29
|
|
|
30
|
+
// src/shortcuts/im/diagnostics.ts
|
|
31
|
+
var TRACE_ENV = "WEAVER_WORK_CLI_TRACE";
|
|
32
|
+
var registeredHooks = /* @__PURE__ */ new WeakSet();
|
|
33
|
+
function truthy(value) {
|
|
34
|
+
const raw = String(value ?? "").toLowerCase();
|
|
35
|
+
return raw === "1" || raw === "true" || raw === "yes";
|
|
36
|
+
}
|
|
37
|
+
function traceFromCommand(ctx) {
|
|
38
|
+
let current = ctx.activeCommand;
|
|
39
|
+
for (let depth = 0; current && depth <= 3; depth += 1) {
|
|
40
|
+
const opts = typeof current.opts === "function" ? current.opts() : void 0;
|
|
41
|
+
if (opts?.trace === true) return true;
|
|
42
|
+
current = current.parent ?? void 0;
|
|
43
|
+
}
|
|
44
|
+
return false;
|
|
45
|
+
}
|
|
46
|
+
function imTraceEnabled(ctx) {
|
|
47
|
+
if (truthy(ctx.env?.[TRACE_ENV]) || truthy(process.env[TRACE_ENV])) return true;
|
|
48
|
+
try {
|
|
49
|
+
return traceFromCommand(ctx);
|
|
50
|
+
} catch {
|
|
51
|
+
return false;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
var inflight = /* @__PURE__ */ new Map();
|
|
55
|
+
function remember(path) {
|
|
56
|
+
const list = inflight.get(path) ?? [];
|
|
57
|
+
list.push(Date.now());
|
|
58
|
+
inflight.set(path, list);
|
|
59
|
+
}
|
|
60
|
+
function forget(path) {
|
|
61
|
+
const list = inflight.get(path);
|
|
62
|
+
if (!list?.length) return void 0;
|
|
63
|
+
const startedAt = list.shift();
|
|
64
|
+
if (!list.length) inflight.delete(path);
|
|
65
|
+
return startedAt;
|
|
66
|
+
}
|
|
67
|
+
function label(request) {
|
|
68
|
+
const operation = request.operation || "-";
|
|
69
|
+
return `${request.method} ${request.path} op=${operation}`;
|
|
70
|
+
}
|
|
71
|
+
function traceInterceptor() {
|
|
72
|
+
return {
|
|
73
|
+
beforeRequest({ request }) {
|
|
74
|
+
remember(request.path);
|
|
75
|
+
},
|
|
76
|
+
afterResponse({ request, response }) {
|
|
77
|
+
const startedAt = forget(request.path);
|
|
78
|
+
const ms = startedAt === void 0 ? "-" : `${Date.now() - startedAt}ms`;
|
|
79
|
+
process.stderr.write(`[trace] ${label(request)} status=${response.status} ${ms}
|
|
80
|
+
`);
|
|
81
|
+
},
|
|
82
|
+
onError({ request, error }) {
|
|
83
|
+
const startedAt = forget(request.path);
|
|
84
|
+
const ms = startedAt === void 0 ? "-" : `${Date.now() - startedAt}ms`;
|
|
85
|
+
const code = error?.subtype || error?.code || "unknown";
|
|
86
|
+
process.stderr.write(`[trace] ${label(request)} status=ERR code=${code} ${ms}
|
|
87
|
+
`);
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
function registerImTrace(ctx) {
|
|
92
|
+
if (!imTraceEnabled(ctx)) return;
|
|
93
|
+
const hooks = ctx.hooks;
|
|
94
|
+
if (!hooks || registeredHooks.has(hooks)) return;
|
|
95
|
+
registeredHooks.add(hooks);
|
|
96
|
+
ctx.hooks.registerE10RequestInterceptor(traceInterceptor());
|
|
97
|
+
}
|
|
98
|
+
function printImFailure(envelope) {
|
|
99
|
+
const text = `${JSON.stringify(envelope, null, 2)}
|
|
100
|
+
`;
|
|
101
|
+
process.stdout.write(text);
|
|
102
|
+
process.stderr.write(text);
|
|
103
|
+
}
|
|
104
|
+
|
|
30
105
|
// src/shortcuts/im/manifest.ts
|
|
31
106
|
function buildOperations() {
|
|
32
107
|
return imOperationDefinitions().map((definition) => ({
|
|
@@ -97,7 +172,7 @@ async function inputFrom(options, extra = {}) {
|
|
|
97
172
|
...Object.fromEntries(Object.entries(extra).filter(([, value]) => value !== void 0 && value !== ""))
|
|
98
173
|
};
|
|
99
174
|
}
|
|
100
|
-
function parseJsonInput(raw,
|
|
175
|
+
function parseJsonInput(raw, label2) {
|
|
101
176
|
try {
|
|
102
177
|
const parsed = JSON.parse(stripBom(raw));
|
|
103
178
|
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) {
|
|
@@ -105,7 +180,7 @@ function parseJsonInput(raw, label) {
|
|
|
105
180
|
}
|
|
106
181
|
return parsed;
|
|
107
182
|
} catch {
|
|
108
|
-
throw imValidationError("input_invalid", `${
|
|
183
|
+
throw imValidationError("input_invalid", `${label2} \u4E0D\u662F\u5408\u6CD5 JSON \u5BF9\u8C61`);
|
|
109
184
|
}
|
|
110
185
|
}
|
|
111
186
|
function withJsonInputOptions(command) {
|
|
@@ -133,6 +208,7 @@ function failureEnvelope(error) {
|
|
|
133
208
|
};
|
|
134
209
|
}
|
|
135
210
|
async function executeAndPrint(ctx, operation, input) {
|
|
211
|
+
registerImTrace(ctx);
|
|
136
212
|
try {
|
|
137
213
|
const result = await executeImOperation(operation, input, {
|
|
138
214
|
ctx,
|
|
@@ -141,7 +217,7 @@ async function executeAndPrint(ctx, operation, input) {
|
|
|
141
217
|
});
|
|
142
218
|
ctx.output.write(successEnvelope(operation, result), { json: true });
|
|
143
219
|
} catch (error) {
|
|
144
|
-
|
|
220
|
+
printImFailure(failureEnvelope(error));
|
|
145
221
|
process.exitCode = isCliError(error) ? error.exitCode : 1 /* GeneralError */;
|
|
146
222
|
}
|
|
147
223
|
}
|
|
@@ -154,7 +230,7 @@ var imShortcut = {
|
|
|
154
230
|
description: "\u6CDB\u5FAEE10\u6613\u79D2\u529E\uFF08\u5373\u65F6\u901A\u8BAF\uFF09CLI",
|
|
155
231
|
category: "shortcut",
|
|
156
232
|
register({ program, action }) {
|
|
157
|
-
const im = program.command("im").description("\u6CDB\u5FAEE10\u6613\u79D2\u529E\uFF1A\u6D88\u606F/\u7FA4\u7EC4/\u4F1A\u8BDD/\u7CFB\u7EDF\u6D88\u606F");
|
|
233
|
+
const im = program.command("im").description("\u6CDB\u5FAEE10\u6613\u79D2\u529E\uFF1A\u6D88\u606F/\u7FA4\u7EC4/\u4F1A\u8BDD/\u7CFB\u7EDF\u6D88\u606F").option("--trace", "\u6BCF\u4E2A E10 \u8BF7\u6C42\u5728 stderr \u6253\u4E00\u884C [trace]\uFF08method/path/op/status/\u8017\u65F6\uFF0C\u4E0D\u542B\u51ED\u8BC1\uFF09");
|
|
158
234
|
im.command("schema").description("Print im operation manifest for agents").action(action((ctx) => {
|
|
159
235
|
ctx.output.write(imManifest, { json: true });
|
|
160
236
|
}));
|
|
@@ -7,9 +7,9 @@ import {
|
|
|
7
7
|
invoicePartialError,
|
|
8
8
|
invoiceValidationError,
|
|
9
9
|
isInvoiceNetworkError
|
|
10
|
-
} from "./chunk-
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-
|
|
10
|
+
} from "./chunk-EEWPQE3O.js";
|
|
11
|
+
import "./chunk-6ATGWRZM.js";
|
|
12
|
+
import "./chunk-D223PTXU.js";
|
|
13
13
|
import {
|
|
14
14
|
isCliError,
|
|
15
15
|
toErrorEnvelope
|
|
@@ -4,11 +4,11 @@ import {
|
|
|
4
4
|
E10ApiError,
|
|
5
5
|
createE10RequestRuntime,
|
|
6
6
|
requireE10Session
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-6ATGWRZM.js";
|
|
8
8
|
import {
|
|
9
9
|
E10_SESSION_EXPIRED_MESSAGE,
|
|
10
10
|
getActiveProfile
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-D223PTXU.js";
|
|
12
12
|
import {
|
|
13
13
|
CliError,
|
|
14
14
|
isCliError,
|
|
@@ -5,12 +5,12 @@ import {
|
|
|
5
5
|
createProgram,
|
|
6
6
|
registerCommands,
|
|
7
7
|
toCommandMetadata
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-GFPXQIY2.js";
|
|
9
9
|
import "./chunk-EG6ZU444.js";
|
|
10
10
|
import "./chunk-AJ62BGAW.js";
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
11
|
+
import "./chunk-EEWPQE3O.js";
|
|
12
|
+
import "./chunk-6ATGWRZM.js";
|
|
13
|
+
import "./chunk-D223PTXU.js";
|
|
14
14
|
import "./chunk-LUSPKZKY.js";
|
|
15
15
|
import "./chunk-BUSC6UAE.js";
|
|
16
16
|
|
|
@@ -4,11 +4,11 @@ import {
|
|
|
4
4
|
E10ApiError,
|
|
5
5
|
createE10RequestRuntime,
|
|
6
6
|
requireE10Session
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-6ATGWRZM.js";
|
|
8
8
|
import {
|
|
9
9
|
E10_SESSION_EXPIRED_MESSAGE,
|
|
10
10
|
getActiveProfile
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-D223PTXU.js";
|
|
12
12
|
import {
|
|
13
13
|
CliError,
|
|
14
14
|
isCliError,
|
|
@@ -192,7 +192,7 @@ function mailMessage(value) {
|
|
|
192
192
|
function createMailHost(ctx, dependencies = {}) {
|
|
193
193
|
let e10Session = null;
|
|
194
194
|
let sessionContext = null;
|
|
195
|
-
const requireSession = dependencies.requireSession || requireE10Session;
|
|
195
|
+
const requireSession = dependencies.requireSession || ((innerCtx) => requireE10Session(innerCtx, { skipProfileEnrichment: true }));
|
|
196
196
|
async function ensureSession() {
|
|
197
197
|
if (!e10Session) {
|
|
198
198
|
e10Session = await requireSession(ctx);
|