@xgjktech/xg_cwork_im 1.17.1 → 1.17.3

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/package.json CHANGED
@@ -1,76 +1,76 @@
1
- {
2
- "name": "@xgjktech/xg_cwork_im",
3
- "version": "1.17.1",
4
- "description": "XG CWork IM channel plugin for OpenClaw",
5
- "keywords": [
6
- "bot",
7
- "channel",
8
- "openclaw",
9
- "xg_cwork_im",
10
- "im"
11
- ],
12
- "license": "MIT",
13
- "type": "module",
14
- "main": "dist/index.js",
15
- "types": "dist/index.d.ts",
16
- "engines": {
17
- "node": ">=22.19.0"
18
- },
19
- "files": [
20
- ".npmrc",
21
- "dist/**/*",
22
- "openclaw.plugin.json"
23
- ],
24
- "scripts": {
25
- "build": "tsc -p tsconfig.json",
26
- "type-check": "tsc -p tsconfig.json --noEmit",
27
- "lint": "tsc -p tsconfig.json --noEmit",
28
- "test": "npm run build && node --test dist/src/inbound-terminal-state.test.js dist/src/user-facing-errors.test.js dist/src/deliver-text.test.js dist/src/agent-context-types.test.js dist/src/block-streaming-config.test.js dist/src/per-message-fallback-notice.test.js dist/src/thinking-ws-progress.test.js dist/src/resource-file.test.js dist/src/turn-deliver-buffer.test.js dist/src/run-usage.test.js dist/src/ws-run-event-unmapped.test.js dist/src/send-service.test.js dist/src/send-file-tool.test.js dist/src/plan-tool-result.test.js dist/src/plan-blocked-notice.test.js dist/src/plan-store-access.test.js dist/src/plan-tool-middleware.test.js dist/src/plan-event-subscription.test.js dist/src/plan-ws-registry.test.js dist/src/plan-stat-event.test.js",
29
- "install:prod": "npm install --omit=dev",
30
- "prepublishOnly": "npm run build"
31
- },
32
- "dependencies": {
33
- "@sinclair/typebox": "^0.32.0",
34
- "@xgjktech/xg-openclaw-shared": "^0.2.0",
35
- "axios": "^1.6.0",
36
- "ws": "^8.17.0",
37
- "zod": "^3.22.0"
38
- },
39
- "devDependencies": {
40
- "@types/node": "^22.19.0",
41
- "@types/ws": "^8.5.10",
42
- "openclaw": "^2026.6.10",
43
- "typescript": "^5.3.0"
44
- },
45
- "peerDependencies": {
46
- "openclaw": ">=2026.6.10"
47
- },
48
- "peerDependenciesMeta": {
49
- "openclaw": {
50
- "optional": true
51
- }
52
- },
53
- "openclaw": {
54
- "extensions": [
55
- "./dist/index.js"
56
- ],
57
- "channels": [
58
- "xg_cwork_im"
59
- ],
60
- "installDependencies": false,
61
- "channel": {
62
- "id": "xg_cwork_im",
63
- "label": "XG CWork IM",
64
- "selectionLabel": "XG CWork IM (工作说说)",
65
- "blurb": "工作说说 IM 机器人 Channel 插件,通过 WebSocket 长连接接收消息。",
66
- "aliases": [
67
- "xg_cwork_im",
68
- "im"
69
- ]
70
- },
71
- "install": {
72
- "localPath": ".",
73
- "defaultChoice": "local"
74
- }
75
- }
76
- }
1
+ {
2
+ "name": "@xgjktech/xg_cwork_im",
3
+ "version": "1.17.3",
4
+ "description": "XG CWork IM channel plugin for OpenClaw",
5
+ "keywords": [
6
+ "bot",
7
+ "channel",
8
+ "openclaw",
9
+ "xg_cwork_im",
10
+ "im"
11
+ ],
12
+ "license": "MIT",
13
+ "type": "module",
14
+ "main": "dist/index.js",
15
+ "types": "dist/index.d.ts",
16
+ "engines": {
17
+ "node": ">=22.19.0"
18
+ },
19
+ "files": [
20
+ ".npmrc",
21
+ "dist/**/*",
22
+ "openclaw.plugin.json"
23
+ ],
24
+ "scripts": {
25
+ "build": "tsc -p tsconfig.json",
26
+ "type-check": "tsc -p tsconfig.json --noEmit",
27
+ "lint": "tsc -p tsconfig.json --noEmit",
28
+ "test": "npm run build && node --test dist/src/inbound-terminal-state.test.js dist/src/user-facing-errors.test.js dist/src/deliver-text.test.js dist/src/agent-context-types.test.js dist/src/block-streaming-config.test.js dist/src/per-message-fallback-notice.test.js dist/src/thinking-ws-progress.test.js dist/src/resource-file.test.js dist/src/turn-deliver-buffer.test.js dist/src/run-usage.test.js dist/src/ws-run-event-unmapped.test.js dist/src/send-service.test.js dist/src/send-file-tool.test.js dist/src/plan-tool-result.test.js dist/src/plan-blocked-notice.test.js dist/src/plan-store-access.test.js dist/src/plan-tool-middleware.test.js dist/src/plan-event-subscription.test.js dist/src/plan-ws-registry.test.js dist/src/plan-stat-event.test.js",
29
+ "install:prod": "npm install --omit=dev",
30
+ "prepublishOnly": "npm run build"
31
+ },
32
+ "dependencies": {
33
+ "@sinclair/typebox": "^0.32.0",
34
+ "@xgjktech/xg-openclaw-shared": "^0.2.0",
35
+ "axios": "^1.6.0",
36
+ "ws": "^8.17.0",
37
+ "zod": "^3.22.0"
38
+ },
39
+ "devDependencies": {
40
+ "@types/node": "^22.19.0",
41
+ "@types/ws": "^8.5.10",
42
+ "openclaw": "^2026.6.10",
43
+ "typescript": "^5.3.0"
44
+ },
45
+ "peerDependencies": {
46
+ "openclaw": ">=2026.6.10"
47
+ },
48
+ "peerDependenciesMeta": {
49
+ "openclaw": {
50
+ "optional": true
51
+ }
52
+ },
53
+ "openclaw": {
54
+ "extensions": [
55
+ "./dist/index.js"
56
+ ],
57
+ "channels": [
58
+ "xg_cwork_im"
59
+ ],
60
+ "installDependencies": false,
61
+ "channel": {
62
+ "id": "xg_cwork_im",
63
+ "label": "XG CWork IM",
64
+ "selectionLabel": "XG CWork IM (工作说说)",
65
+ "blurb": "工作说说 IM 机器人 Channel 插件,通过 WebSocket 长连接接收消息。",
66
+ "aliases": [
67
+ "xg_cwork_im",
68
+ "im"
69
+ ]
70
+ },
71
+ "install": {
72
+ "localPath": ".",
73
+ "defaultChoice": "local"
74
+ }
75
+ }
76
+ }
@@ -1,24 +0,0 @@
1
- import type { BlockedTaskNotice } from "./plan-blocked-notice.js";
2
- export interface ToolCallTarget {
3
- groupId: string;
4
- token: string;
5
- sessionKey?: string;
6
- }
7
- /** 测试用:替换时间源,避免测 TTL 时 sleep。 */
8
- export declare function setNowFnForTest(fn: () => number): void;
9
- export declare function registerToolCallTarget(toolCallId: string, target: ToolCallTarget): void;
10
- /** 取出并删除(一次性消费)。未命中返回 undefined。 */
11
- export declare function takeToolCallTarget(toolCallId: string): ToolCallTarget | undefined;
12
- /**
13
- * 传入本次扫描出的全部 notice,返回其中「需要推送的新增项」,并同步更新集合。
14
- *
15
- * 语义(按 DESIGN.md D2):
16
- * - 新增 = 本次 keys − 已推送 keys → 返回它们
17
- * - 清理 = 已推送集中「本次已不在」的 key → 移除(让 blocked→修复→再 blocked 能重新推)
18
- * - 已推送集 = 已推送 ∪ 新增
19
- * - 按 planId 分桶
20
- */
21
- export declare function diffAndMarkBlockedNotices(planId: string, notices: readonly BlockedTaskNotice[]): BlockedTaskNotice[];
22
- /** 测试用:重置模块级缓存与 stateDir */
23
- export declare function resetPlanSessionRegistryForTest(): void;
24
- //# sourceMappingURL=plan-session-registry.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"plan-session-registry.d.ts","sourceRoot":"","sources":["../../src/plan-session-registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAElE,MAAM,WAAW,cAAc;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC;CACvB;AAeD,iCAAiC;AACjC,wBAAgB,eAAe,CAAC,EAAE,EAAE,MAAM,MAAM,GAAG,IAAI,CAEtD;AA0BD,wBAAgB,sBAAsB,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,cAAc,GAAG,IAAI,CAMvF;AAED,oCAAoC;AACpC,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,MAAM,GAAG,cAAc,GAAG,SAAS,CAUjF;AAED;;;;;;;;GAQG;AACH,wBAAgB,yBAAyB,CACrC,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,SAAS,iBAAiB,EAAE,GACtC,iBAAiB,EAAE,CAsBrB;AAED,4BAA4B;AAC5B,wBAAgB,+BAA+B,IAAI,IAAI,CAItD"}
@@ -1,84 +0,0 @@
1
- /** toolCallId → 投递目标表的 TTL:超过这个时长未被消费的登记视为过期。 */
2
- const TOOL_CALL_TARGET_TTL_MS = 10 * 60 * 1000;
3
- /** toolCallId → 投递目标表的容量上限:超出时逐出最旧的条目(插入序)。 */
4
- const TOOL_CALL_TARGET_CAPACITY = 500;
5
- let nowFn = () => Date.now();
6
- /** 测试用:替换时间源,避免测 TTL 时 sleep。 */
7
- export function setNowFnForTest(fn) {
8
- nowFn = fn;
9
- }
10
- const toolCallTargets = new Map();
11
- /** planId → 已推送 blocked notice key 集合 */
12
- const blockedNotifiedKeys = new Map();
13
- function evictExpiredToolCallTargets() {
14
- const now = nowFn();
15
- for (const [toolCallId, entry] of toolCallTargets) {
16
- if (now - entry.registeredAt > TOOL_CALL_TARGET_TTL_MS) {
17
- toolCallTargets.delete(toolCallId);
18
- }
19
- }
20
- }
21
- function evictOldestToolCallTargetsOverCapacity() {
22
- while (toolCallTargets.size > TOOL_CALL_TARGET_CAPACITY) {
23
- const oldestKey = toolCallTargets.keys().next().value;
24
- if (oldestKey === undefined) {
25
- break;
26
- }
27
- toolCallTargets.delete(oldestKey);
28
- }
29
- }
30
- export function registerToolCallTarget(toolCallId, target) {
31
- evictExpiredToolCallTargets();
32
- // 重新登记同一 id 应刷新插入序(视为新条目),先删再插
33
- toolCallTargets.delete(toolCallId);
34
- toolCallTargets.set(toolCallId, { target, registeredAt: nowFn() });
35
- evictOldestToolCallTargetsOverCapacity();
36
- }
37
- /** 取出并删除(一次性消费)。未命中返回 undefined。 */
38
- export function takeToolCallTarget(toolCallId) {
39
- const entry = toolCallTargets.get(toolCallId);
40
- if (!entry) {
41
- return undefined;
42
- }
43
- toolCallTargets.delete(toolCallId);
44
- if (nowFn() - entry.registeredAt > TOOL_CALL_TARGET_TTL_MS) {
45
- return undefined;
46
- }
47
- return entry.target;
48
- }
49
- /**
50
- * 传入本次扫描出的全部 notice,返回其中「需要推送的新增项」,并同步更新集合。
51
- *
52
- * 语义(按 DESIGN.md D2):
53
- * - 新增 = 本次 keys − 已推送 keys → 返回它们
54
- * - 清理 = 已推送集中「本次已不在」的 key → 移除(让 blocked→修复→再 blocked 能重新推)
55
- * - 已推送集 = 已推送 ∪ 新增
56
- * - 按 planId 分桶
57
- */
58
- export function diffAndMarkBlockedNotices(planId, notices) {
59
- const notified = blockedNotifiedKeys.get(planId) ?? new Set();
60
- const currentKeys = new Set(notices.map((n) => n.key));
61
- const fresh = notices.filter((n) => !notified.has(n.key));
62
- for (const key of notified) {
63
- if (!currentKeys.has(key)) {
64
- notified.delete(key);
65
- }
66
- }
67
- for (const notice of fresh) {
68
- notified.add(notice.key);
69
- }
70
- if (notified.size > 0) {
71
- blockedNotifiedKeys.set(planId, notified);
72
- }
73
- else {
74
- blockedNotifiedKeys.delete(planId);
75
- }
76
- return fresh;
77
- }
78
- /** 测试用:重置模块级缓存与 stateDir */
79
- export function resetPlanSessionRegistryForTest() {
80
- toolCallTargets.clear();
81
- blockedNotifiedKeys.clear();
82
- nowFn = () => Date.now();
83
- }
84
- //# sourceMappingURL=plan-session-registry.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"plan-session-registry.js","sourceRoot":"","sources":["../../src/plan-session-registry.ts"],"names":[],"mappings":"AAQA,iDAAiD;AACjD,MAAM,uBAAuB,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AAE/C,+CAA+C;AAC/C,MAAM,yBAAyB,GAAG,GAAG,CAAC;AAOtC,IAAI,KAAK,GAAiB,GAAG,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC;AAE3C,iCAAiC;AACjC,MAAM,UAAU,eAAe,CAAC,EAAgB;IAC5C,KAAK,GAAG,EAAE,CAAC;AACf,CAAC;AAED,MAAM,eAAe,GAAG,IAAI,GAAG,EAA+B,CAAC;AAE/D,yCAAyC;AACzC,MAAM,mBAAmB,GAAG,IAAI,GAAG,EAAuB,CAAC;AAE3D,SAAS,2BAA2B;IAChC,MAAM,GAAG,GAAG,KAAK,EA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ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"plan-session-registry.test.d.ts","sourceRoot":"","sources":["../../src/plan-session-registry.test.ts"],"names":[],"mappings":""}
@@ -1,109 +0,0 @@
1
- import assert from "node:assert/strict";
2
- import { beforeEach, describe, it } from "node:test";
3
- import { diffAndMarkBlockedNotices, registerToolCallTarget, resetPlanSessionRegistryForTest, setNowFnForTest, takeToolCallTarget, } from "./plan-session-registry.js";
4
- function makeTarget(overrides = {}) {
5
- return {
6
- groupId: "group-1",
7
- token: "token-1",
8
- ...overrides,
9
- };
10
- }
11
- function makeNotice(overrides = {}) {
12
- return {
13
- key: "plan-1::0::缺少权限",
14
- taskIndex: 0,
15
- taskTitle: "备份旧配置",
16
- note: "缺少权限",
17
- content: "计划「X」卡在任务「备份旧配置」:缺少权限\n需要人工介入才能继续。",
18
- ...overrides,
19
- };
20
- }
21
- beforeEach(() => {
22
- resetPlanSessionRegistryForTest();
23
- });
24
- describe("registerToolCallTarget / takeToolCallTarget", () => {
25
- it("hits with the registered target and deletes it on consume (take twice → second undefined)", () => {
26
- registerToolCallTarget("call-1", makeTarget());
27
- const first = takeToolCallTarget("call-1");
28
- assert.deepEqual(first, makeTarget());
29
- const second = takeToolCallTarget("call-1");
30
- assert.equal(second, undefined);
31
- });
32
- it("misses for an unregistered id", () => {
33
- assert.equal(takeToolCallTarget("does-not-exist"), undefined);
34
- });
35
- it("expires entries past TTL (injected now, no sleep)", () => {
36
- let t = 0;
37
- setNowFnForTest(() => t);
38
- registerToolCallTarget("call-ttl", makeTarget());
39
- t = 10 * 60 * 1000 + 1; // TTL + 1ms
40
- assert.equal(takeToolCallTarget("call-ttl"), undefined);
41
- });
42
- it("does not expire an entry read exactly at TTL boundary", () => {
43
- let t = 0;
44
- setNowFnForTest(() => t);
45
- registerToolCallTarget("call-boundary", makeTarget());
46
- t = 10 * 60 * 1000; // exactly TTL, not yet exceeded
47
- assert.ok(takeToolCallTarget("call-boundary"));
48
- });
49
- it("evicts the oldest entry when capacity is exceeded", () => {
50
- let t = 0;
51
- setNowFnForTest(() => t);
52
- for (let i = 0; i < 500; i++) {
53
- t += 1;
54
- registerToolCallTarget(`call-${i}`, makeTarget({ groupId: `g${i}` }));
55
- }
56
- // 表已满 500 条,call-0 是最旧的
57
- t += 1;
58
- registerToolCallTarget("call-500", makeTarget({ groupId: "g500" }));
59
- assert.equal(takeToolCallTarget("call-0"), undefined, "oldest entry should have been evicted");
60
- const kept = takeToolCallTarget("call-500");
61
- assert.ok(kept);
62
- assert.equal(kept.groupId, "g500");
63
- });
64
- });
65
- describe("diffAndMarkBlockedNotices", () => {
66
- it("returns all notices on first call", () => {
67
- const notices = [makeNotice()];
68
- const fresh = diffAndMarkBlockedNotices("plan-1", notices);
69
- assert.deepEqual(fresh, notices);
70
- });
71
- it("returns empty on repeated identical call", () => {
72
- const notices = [makeNotice()];
73
- diffAndMarkBlockedNotices("plan-1", notices);
74
- const second = diffAndMarkBlockedNotices("plan-1", notices);
75
- assert.deepEqual(second, []);
76
- });
77
- it("treats a note change as a new notification (different key)", () => {
78
- const first = [makeNotice({ key: "plan-1::0::缺少权限" })];
79
- diffAndMarkBlockedNotices("plan-1", first);
80
- const changed = [makeNotice({ key: "plan-1::0::权限问题已升级", note: "权限问题已升级" })];
81
- const fresh = diffAndMarkBlockedNotices("plan-1", changed);
82
- assert.deepEqual(fresh, changed);
83
- });
84
- it("clears a key once the task is no longer blocked, allowing re-notification later", () => {
85
- const notice = makeNotice({ key: "plan-1::0::缺少权限" });
86
- diffAndMarkBlockedNotices("plan-1", [notice]);
87
- // task 修复:本次扫描不再含该 key
88
- const clearedFresh = diffAndMarkBlockedNotices("plan-1", []);
89
- assert.deepEqual(clearedFresh, []);
90
- // 再次 blocked,同 key 应视为新增重新推送
91
- const reblocked = diffAndMarkBlockedNotices("plan-1", [notice]);
92
- assert.deepEqual(reblocked, [notice]);
93
- });
94
- it("keeps separate planIds independent", () => {
95
- const noticeA = makeNotice({ key: "plan-a::0::原因A" });
96
- const noticeB = makeNotice({ key: "plan-b::0::原因B" });
97
- const freshA = diffAndMarkBlockedNotices("plan-a", [noticeA]);
98
- const freshB = diffAndMarkBlockedNotices("plan-b", [noticeB]);
99
- assert.deepEqual(freshA, [noticeA]);
100
- assert.deepEqual(freshB, [noticeB]);
101
- // plan-a 重复调用不应受 plan-b 影响,反之亦然
102
- assert.deepEqual(diffAndMarkBlockedNotices("plan-a", [noticeA]), []);
103
- assert.deepEqual(diffAndMarkBlockedNotices("plan-b", [noticeB]), []);
104
- });
105
- it("returns an empty array and does not throw when there are no notices", () => {
106
- assert.deepEqual(diffAndMarkBlockedNotices("plan-empty", []), []);
107
- });
108
- });
109
- //# sourceMappingURL=plan-session-registry.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"plan-session-registry.test.js","sourceRoot":"","sources":["../../src/plan-session-registry.test.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,oBAAoB,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,WAAW,CAAC;AAErD,OAAO,EACH,yBAAyB,EACzB,sBAAsB,EACtB,+BAA+B,EAC/B,eAAe,EACf,kBAAkB,GACrB,MAAM,4BAA4B,CAAC;AAEpC,SAAS,UAAU,CAAC,YAA8E,EAAE;IAChG,OAAO;QACH,OAAO,EAAE,SAAS;QAClB,KAAK,EAAE,SAAS;QAChB,GAAG,SAAS;KACf,CAAC;AACN,CAAC;AAED,SAAS,UAAU,CAAC,YAAwC,EAAE;IAC1D,OAAO;QACH,GAAG,EAAE,iBAAiB;QACtB,SAAS,EAAE,CAAC;QACZ,SAAS,EAAE,OAAO;QAClB,IAAI,EAAE,MAAM;QACZ,OAAO,EAAE,oCAAoC;QAC7C,GAAG,SAAS;KACf,CAAC;AACN,CAAC;AAED,UAAU,CAAC,GAAG,EAAE;IACZ,+BAA+B,EAAE,CAAC;AACtC,CAAC,CAAC,CAAC;AAEH,QAAQ,CAAC,6CAA6C,EAAE,G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