@quukk/opencode-clawmessenger 0.2.0 → 1.0.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/README.md +71 -623
- package/bin/opencode-clawmessenger +2 -2
- package/bin/opencode-clawmessenger-setup +5 -5
- package/dist/cli.d.ts +0 -1
- package/dist/cli.js +1 -288
- package/dist/core/auto-register.d.ts +0 -1
- package/dist/core/auto-register.js +1 -174
- package/dist/core/auto-serve.d.ts +13 -0
- package/dist/core/auto-serve.js +1 -0
- package/dist/core/config.d.ts +2 -3
- package/dist/core/config.js +1 -80
- package/dist/core/daemon.d.ts +0 -1
- package/dist/core/daemon.js +1 -77
- package/dist/core/dedup.d.ts +0 -1
- package/dist/core/dedup.js +1 -25
- package/dist/core/hook-manager.d.ts +0 -1
- package/dist/core/hook-manager.js +1 -33
- package/dist/core/logger.d.ts +0 -1
- package/dist/core/logger.js +1 -49
- package/dist/core/mac-address.d.ts +0 -1
- package/dist/core/mac-address.js +1 -43
- package/dist/core/message-handler.d.ts +1 -1
- package/dist/core/message-handler.js +1 -984
- package/dist/core/ops-assistant.d.ts +0 -1
- package/dist/core/ops-assistant.js +1 -270
- package/dist/core/qr-crypto.d.ts +0 -1
- package/dist/core/qr-crypto.js +1 -66
- package/dist/core/session-manager.d.ts +0 -1
- package/dist/core/session-manager.js +1 -144
- package/dist/core/types.d.ts +1 -2
- package/dist/core/types.js +1 -26
- package/dist/index.d.ts +0 -1
- package/dist/index.js +1 -16
- package/dist/openclaw/client.d.ts +0 -1
- package/dist/openclaw/client.js +1 -494
- package/dist/opencode/client.d.ts +0 -1
- package/dist/opencode/client.js +1 -279
- package/dist/opencode/event-handler.d.ts +0 -1
- package/dist/opencode/event-handler.js +1 -467
- package/dist/plugin.d.ts +0 -1
- package/dist/plugin.js +1 -148
- package/dist/rongcloud/client.d.ts +0 -1
- package/dist/rongcloud/client.js +1 -292
- package/dist/rongcloud/env-polyfill.d.ts +0 -1
- package/dist/rongcloud/env-polyfill.js +1 -107
- package/dist/rongcloud/server-api.d.ts +0 -1
- package/dist/rongcloud/server-api.js +1 -157
- package/dist/standalone.d.ts +0 -1
- package/dist/standalone.js +1 -229
- package/dist/types/plugin.d.ts +0 -1
- package/dist/types/plugin.js +1 -2
- package/dist/websocket/client.d.ts +0 -1
- package/dist/websocket/client.js +1 -88
- package/dist/websocket/server-client.d.ts +0 -1
- package/dist/websocket/server-client.js +1 -98
- package/package.json +83 -81
- package/dist/cli.d.ts.map +0 -1
- package/dist/cli.js.map +0 -1
- package/dist/core/auto-register.d.ts.map +0 -1
- package/dist/core/auto-register.js.map +0 -1
- package/dist/core/config.d.ts.map +0 -1
- package/dist/core/config.js.map +0 -1
- package/dist/core/daemon.d.ts.map +0 -1
- package/dist/core/daemon.js.map +0 -1
- package/dist/core/dedup.d.ts.map +0 -1
- package/dist/core/dedup.js.map +0 -1
- package/dist/core/hook-manager.d.ts.map +0 -1
- package/dist/core/hook-manager.js.map +0 -1
- package/dist/core/logger.d.ts.map +0 -1
- package/dist/core/logger.js.map +0 -1
- package/dist/core/mac-address.d.ts.map +0 -1
- package/dist/core/mac-address.js.map +0 -1
- package/dist/core/message-handler.d.ts.map +0 -1
- package/dist/core/message-handler.js.map +0 -1
- package/dist/core/ops-assistant.d.ts.map +0 -1
- package/dist/core/ops-assistant.js.map +0 -1
- package/dist/core/qr-crypto.d.ts.map +0 -1
- package/dist/core/qr-crypto.js.map +0 -1
- package/dist/core/session-manager.d.ts.map +0 -1
- package/dist/core/session-manager.js.map +0 -1
- package/dist/core/types.d.ts.map +0 -1
- package/dist/core/types.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/openclaw/client.d.ts.map +0 -1
- package/dist/openclaw/client.js.map +0 -1
- package/dist/opencode/client.d.ts.map +0 -1
- package/dist/opencode/client.js.map +0 -1
- package/dist/opencode/event-handler.d.ts.map +0 -1
- package/dist/opencode/event-handler.js.map +0 -1
- package/dist/plugin.d.ts.map +0 -1
- package/dist/plugin.js.map +0 -1
- package/dist/rongcloud/client.d.ts.map +0 -1
- package/dist/rongcloud/client.js.map +0 -1
- package/dist/rongcloud/env-polyfill.d.ts.map +0 -1
- package/dist/rongcloud/env-polyfill.js.map +0 -1
- package/dist/rongcloud/server-api.d.ts.map +0 -1
- package/dist/rongcloud/server-api.js.map +0 -1
- package/dist/standalone.d.ts.map +0 -1
- package/dist/standalone.js.map +0 -1
- package/dist/types/plugin.d.ts.map +0 -1
- package/dist/types/plugin.js.map +0 -1
- package/dist/websocket/client.d.ts.map +0 -1
- package/dist/websocket/client.js.map +0 -1
- package/dist/websocket/server-client.d.ts.map +0 -1
- package/dist/websocket/server-client.js.map +0 -1
package/dist/core/config.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ declare const ClawMessengerConfigSchema: z.ZodObject<{
|
|
|
7
7
|
accountId: z.ZodOptional<z.ZodString>;
|
|
8
8
|
nodeName: z.ZodOptional<z.ZodString>;
|
|
9
9
|
serverUrl: z.ZodDefault<z.ZodString>;
|
|
10
|
-
opencodeUrl: z.
|
|
10
|
+
opencodeUrl: z.ZodOptional<z.ZodString>;
|
|
11
11
|
opencodeDir: z.ZodOptional<z.ZodString>;
|
|
12
12
|
opencodePassword: z.ZodOptional<z.ZodString>;
|
|
13
13
|
apiBaseUrl: z.ZodOptional<z.ZodString>;
|
|
@@ -24,13 +24,13 @@ declare const ClawMessengerConfigSchema: z.ZodObject<{
|
|
|
24
24
|
}>>;
|
|
25
25
|
}, "strip", z.ZodTypeAny, {
|
|
26
26
|
serverUrl: string;
|
|
27
|
-
opencodeUrl: string;
|
|
28
27
|
chatTimeout: number;
|
|
29
28
|
nodeName?: string | undefined;
|
|
30
29
|
token?: string | undefined;
|
|
31
30
|
appKey?: string | undefined;
|
|
32
31
|
appSecret?: string | undefined;
|
|
33
32
|
accountId?: string | undefined;
|
|
33
|
+
opencodeUrl?: string | undefined;
|
|
34
34
|
opencodeDir?: string | undefined;
|
|
35
35
|
opencodePassword?: string | undefined;
|
|
36
36
|
apiBaseUrl?: string | undefined;
|
|
@@ -65,4 +65,3 @@ export declare class ConfigManager {
|
|
|
65
65
|
exists(): boolean;
|
|
66
66
|
}
|
|
67
67
|
export { ClawMessengerConfigSchema };
|
|
68
|
-
//# sourceMappingURL=config.d.ts.map
|
package/dist/core/config.js
CHANGED
|
@@ -1,80 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { readFileSync, writeFileSync, existsSync, mkdirSync } from 'fs';
|
|
3
|
-
import { join, dirname } from 'path';
|
|
4
|
-
import { homedir } from 'os';
|
|
5
|
-
import { getServerUrl } from './auto-register.js';
|
|
6
|
-
const ClawMessengerConfigSchema = z.object({
|
|
7
|
-
appKey: z.string().min(1).optional(),
|
|
8
|
-
appSecret: z.string().optional(),
|
|
9
|
-
token: z.string().optional(),
|
|
10
|
-
accountId: z.string().optional(),
|
|
11
|
-
nodeName: z.string().optional(),
|
|
12
|
-
serverUrl: z.string().default(getServerUrl()),
|
|
13
|
-
opencodeUrl: z.string().default('http://127.0.0.1:4096'),
|
|
14
|
-
opencodeDir: z.string().optional(),
|
|
15
|
-
opencodePassword: z.string().optional(),
|
|
16
|
-
apiBaseUrl: z.string().optional(),
|
|
17
|
-
chatTimeout: z.number().min(1).default(600),
|
|
18
|
-
hooks: z.object({
|
|
19
|
-
onSessionCreated: z.string().optional(),
|
|
20
|
-
onSessionIdle: z.string().optional(),
|
|
21
|
-
}).optional(),
|
|
22
|
-
});
|
|
23
|
-
export class ConfigManager {
|
|
24
|
-
constructor(configPath) {
|
|
25
|
-
this.configPath = configPath || join(homedir(), '.config', 'opencode', 'clawmessenger.json');
|
|
26
|
-
}
|
|
27
|
-
load() {
|
|
28
|
-
if (this.config)
|
|
29
|
-
return this.config;
|
|
30
|
-
let fileConfig = {};
|
|
31
|
-
if (existsSync(this.configPath)) {
|
|
32
|
-
try {
|
|
33
|
-
fileConfig = JSON.parse(readFileSync(this.configPath, 'utf-8'));
|
|
34
|
-
}
|
|
35
|
-
catch { }
|
|
36
|
-
}
|
|
37
|
-
const envConfig = {
|
|
38
|
-
appKey: process.env.CLAW_APP_KEY,
|
|
39
|
-
appSecret: process.env.CLAW_APP_SECRET,
|
|
40
|
-
token: process.env.CLAW_TOKEN,
|
|
41
|
-
accountId: process.env.CLAW_ACCOUNT_ID,
|
|
42
|
-
serverUrl: process.env.DM_SERVER_URL,
|
|
43
|
-
opencodeUrl: process.env.CLAW_OPENCODE_URL,
|
|
44
|
-
opencodeDir: process.env.CLAW_OPENCODE_DIR,
|
|
45
|
-
opencodePassword: process.env.OPENCODE_SERVER_PASSWORD,
|
|
46
|
-
apiBaseUrl: process.env.CLAW_API_BASE_URL,
|
|
47
|
-
chatTimeout: process.env.CLAW_CHAT_TIMEOUT ? parseInt(process.env.CLAW_CHAT_TIMEOUT, 10) : undefined,
|
|
48
|
-
};
|
|
49
|
-
for (const [k, v] of Object.entries(envConfig)) {
|
|
50
|
-
if (v !== undefined && v !== '') {
|
|
51
|
-
fileConfig[k] = v;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
this.config = ClawMessengerConfigSchema.parse(fileConfig);
|
|
55
|
-
return this.config;
|
|
56
|
-
}
|
|
57
|
-
save(config) {
|
|
58
|
-
const dir = dirname(this.configPath);
|
|
59
|
-
if (!existsSync(dir))
|
|
60
|
-
mkdirSync(dir, { recursive: true });
|
|
61
|
-
let existing = {};
|
|
62
|
-
if (existsSync(this.configPath)) {
|
|
63
|
-
try {
|
|
64
|
-
existing = JSON.parse(readFileSync(this.configPath, 'utf-8'));
|
|
65
|
-
}
|
|
66
|
-
catch { }
|
|
67
|
-
}
|
|
68
|
-
const merged = { ...existing, ...config };
|
|
69
|
-
writeFileSync(this.configPath, JSON.stringify(merged, null, 2));
|
|
70
|
-
this.config = undefined;
|
|
71
|
-
}
|
|
72
|
-
getConfigPath() {
|
|
73
|
-
return this.configPath;
|
|
74
|
-
}
|
|
75
|
-
exists() {
|
|
76
|
-
return existsSync(this.configPath);
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
export { ClawMessengerConfigSchema };
|
|
80
|
-
//# sourceMappingURL=config.js.map
|
|
1
|
+
const a0_0x2bc86e=a0_0x10ad;(function(_0xccd322,_0x3f8b77){const _0x225663=a0_0x10ad,_0x1651ba=_0xccd322();while(!![]){try{const _0x51b569=parseInt(_0x225663(0x20b))/0x1+-parseInt(_0x225663(0x1fd))/0x2*(-parseInt(_0x225663(0x200))/0x3)+-parseInt(_0x225663(0x21a))/0x4+-parseInt(_0x225663(0x205))/0x5+parseInt(_0x225663(0x21b))/0x6+parseInt(_0x225663(0x208))/0x7*(-parseInt(_0x225663(0x20a))/0x8)+-parseInt(_0x225663(0x20f))/0x9*(-parseInt(_0x225663(0x1fc))/0xa);if(_0x51b569===_0x3f8b77)break;else _0x1651ba['push'](_0x1651ba['shift']());}catch(_0x18170a){_0x1651ba['push'](_0x1651ba['shift']());}}}(a0_0x1117,0x44e95));import{z}from'zod';function a0_0x10ad(_0x24284d,_0x37a4a2){_0x24284d=_0x24284d-0x1f3;const _0x1117c2=a0_0x1117();let _0x10adf0=_0x1117c2[_0x24284d];if(a0_0x10ad['DtUdoD']===undefined){var _0x515661=function(_0x17d4c1){const _0x4a9e6a='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0xda729b='',_0x4a459b='';for(let _0x1e38e9=0x0,_0x230b2b,_0x8dd687,_0x4a9b3d=0x0;_0x8dd687=_0x17d4c1['charAt'](_0x4a9b3d++);~_0x8dd687&&(_0x230b2b=_0x1e38e9%0x4?_0x230b2b*0x40+_0x8dd687:_0x8dd687,_0x1e38e9++%0x4)?_0xda729b+=String['fromCharCode'](0xff&_0x230b2b>>(-0x2*_0x1e38e9&0x6)):0x0){_0x8dd687=_0x4a9e6a['indexOf'](_0x8dd687);}for(let _0x55bb78=0x0,_0x4c0709=_0xda729b['length'];_0x55bb78<_0x4c0709;_0x55bb78++){_0x4a459b+='%'+('00'+_0xda729b['charCodeAt'](_0x55bb78)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x4a459b);};a0_0x10ad['FsXDdq']=_0x515661,a0_0x10ad['IUyyuc']={},a0_0x10ad['DtUdoD']=!![];}const _0x47352f=_0x1117c2[0x0],_0x252281=_0x24284d+_0x47352f,_0x3f73f9=a0_0x10ad['IUyyuc'][_0x252281];return!_0x3f73f9?(_0x10adf0=a0_0x10ad['FsXDdq'](_0x10adf0),a0_0x10ad['IUyyuc'][_0x252281]=_0x10adf0):_0x10adf0=_0x3f73f9,_0x10adf0;}function a0_0x1117(){const _0x46b9e2=['qwjIAei','mZq0nJaZn0zQzxbvtG','zw50CMLLCW','ohr5z2nUwa','mtq0mdqZsLDuzxLg','u25cExG','u3bNA1K','zgvMyxvSDa','mtHbDezItu0','B3b0Aw9UywW','sNr2Ehe','DxrMltG','zK5ODfm','y29UzMLN','zxHPC3rZ','C3rYAw5N','z09IzuG','y2jVCva','AMDWwK4','mteZmdGWnhbtuuvPua','mtG0odaZmgXIswnxwq','y29UzMLNugf0Aa','y2XHD21LC3nLBMDLCI5QC29U','tvrMEhO','EhHfAxi','zvPJtgC','lMnVBMzPzW','B3bLBMnVzgu','B2jQzwn0','C3rYAw5NAwz5','q29pCee','BNvTyMvY','mtq1mJm3mhnQC0fetG','mtbyrNLqAfy','Bg9Hza','u0nxs0y','mtK0nJCZtM9gBvHM','vxfPEwe','C2f2zq','CgfYC2u','ugnvDvm','ndG2mJb0t1DrrwW','z2v0q29UzMLNugf0Aa'];a0_0x1117=function(){return _0x46b9e2;};return a0_0x1117();}import{readFileSync,writeFileSync,existsSync,mkdirSync}from'fs';import{join,dirname}from'path';import{homedir}from'os';import{getServerUrl}from'./auto-register.js';const ClawMessengerConfigSchema=z[a0_0x2bc86e(0x1f8)]({'appKey':z[a0_0x2bc86e(0x216)]()['min'](0x1)[a0_0x2bc86e(0x210)](),'appSecret':z[a0_0x2bc86e(0x216)]()['optional'](),'token':z[a0_0x2bc86e(0x216)]()[a0_0x2bc86e(0x210)](),'accountId':z[a0_0x2bc86e(0x216)]()[a0_0x2bc86e(0x210)](),'nodeName':z['string']()[a0_0x2bc86e(0x210)](),'serverUrl':z['string']()[a0_0x2bc86e(0x20e)](getServerUrl()),'opencodeUrl':z[a0_0x2bc86e(0x216)]()['optional'](),'opencodeDir':z['string']()['optional'](),'opencodePassword':z[a0_0x2bc86e(0x216)]()['optional'](),'apiBaseUrl':z['string']()[a0_0x2bc86e(0x210)](),'chatTimeout':z[a0_0x2bc86e(0x1fb)]()['min'](0x1)[a0_0x2bc86e(0x20e)](0x258),'hooks':z['object']({'onSessionCreated':z[a0_0x2bc86e(0x216)]()[a0_0x2bc86e(0x210)](),'onSessionIdle':z['string']()[a0_0x2bc86e(0x210)]()})[a0_0x2bc86e(0x210)]()});export class ConfigManager{constructor(_0xf27a93){const _0x8c38f4=a0_0x2bc86e,_0x1bcb70={'gObeH':function(_0x439469,_0x5f45c3,_0x46c66d,_0x53242d,_0x3a0ff4){return _0x439469(_0x5f45c3,_0x46c66d,_0x53242d,_0x3a0ff4);},'SnByx':function(_0x3eb4c4){return _0x3eb4c4();},'MTfxz':_0x8c38f4(0x1f6),'PPHvz':_0x8c38f4(0x1f7),'CoOpA':_0x8c38f4(0x21d)};this[_0x8c38f4(0x21c)]=_0xf27a93||_0x1bcb70[_0x8c38f4(0x217)](join,_0x1bcb70[_0x8c38f4(0x20c)](homedir),_0x1bcb70[_0x8c38f4(0x1f3)],_0x1bcb70['PPHvz'],_0x1bcb70[_0x8c38f4(0x1fa)]);}[a0_0x2bc86e(0x1fe)](){const _0x365de0=a0_0x2bc86e,_0xc2d174={'xxEir':function(_0x120956,_0x249b22){return _0x120956!==_0x249b22;},'fNhtS':function(_0x5aa883,_0x2d5fa7){return _0x5aa883(_0x2d5fa7);},'AbbhB':function(_0x53b7c0,_0xcae4d4){return _0x53b7c0===_0xcae4d4;},'eZcLg':'PcUuS','SCWKF':_0x365de0(0x20d)};if(this[_0x365de0(0x214)])return this[_0x365de0(0x214)];let _0x26a270={};if(_0xc2d174[_0x365de0(0x213)](existsSync,this[_0x365de0(0x21c)]))try{_0x26a270=JSON['parse'](readFileSync(this[_0x365de0(0x21c)],_0x365de0(0x212)));}catch{}const _0x17c27f={'appKey':process.env.CLAW_APP_KEY,'appSecret':process.env.CLAW_APP_SECRET,'token':process.env.CLAW_TOKEN,'accountId':process.env.CLAW_ACCOUNT_ID,'serverUrl':process.env.DM_SERVER_URL,'opencodeUrl':process.env.CLAW_OPENCODE_URL,'opencodeDir':process.env.CLAW_OPENCODE_DIR,'opencodePassword':process.env.OPENCODE_SERVER_PASSWORD,'apiBaseUrl':process.env.CLAW_API_BASE_URL,'chatTimeout':process.env.CLAW_CHAT_TIMEOUT?parseInt(process.env.CLAW_CHAT_TIMEOUT,0xa):undefined};for(const [_0x5bca54,_0x3b63a5]of Object[_0x365de0(0x209)](_0x17c27f)){_0xc2d174['AbbhB'](_0xc2d174[_0x365de0(0x1f5)],_0x365de0(0x204))?_0x3b63a5!==undefined&&_0x3b63a5!==''&&(_0xc2d174[_0x365de0(0x207)](_0xc2d174[_0x365de0(0x1ff)],_0x365de0(0x211))?_0x2c50fc=_0x56bfb9[_0x365de0(0x203)](_0x3d7203(this['configPath'],_0x365de0(0x212))):_0x26a270[_0x5bca54]=_0x3b63a5):_0x2095e4!==_0x7b449c&&_0xc2d174[_0x365de0(0x1f4)](_0x320d48,'')&&(_0x4cca13[_0x624f9b]=_0x1e1c57);}return this[_0x365de0(0x214)]=ClawMessengerConfigSchema[_0x365de0(0x203)](_0x26a270),this['config'];}[a0_0x2bc86e(0x202)](_0x37727b){const _0x3b4420=a0_0x2bc86e,_0x2b1974={'Uqiya':function(_0x13b317,_0x13480d,_0xa18d7){return _0x13b317(_0x13480d,_0xa18d7);},'cboqP':function(_0x551f57,_0x35ceb6){return _0x551f57(_0x35ceb6);},'PmXoH':function(_0x5b7fa8,_0x31f612,_0x14f395){return _0x5b7fa8(_0x31f612,_0x14f395);}},_0x693e5d=dirname(this[_0x3b4420(0x21c)]);if(!existsSync(_0x693e5d))_0x2b1974[_0x3b4420(0x201)](mkdirSync,_0x693e5d,{'recursive':!![]});let _0x5d5f74={};if(_0x2b1974[_0x3b4420(0x218)](existsSync,this[_0x3b4420(0x21c)]))try{_0x5d5f74=JSON[_0x3b4420(0x203)](_0x2b1974[_0x3b4420(0x201)](readFileSync,this[_0x3b4420(0x21c)],_0x3b4420(0x212)));}catch{}const _0x3b7f64={..._0x5d5f74,..._0x37727b};_0x2b1974['PmXoH'](writeFileSync,this[_0x3b4420(0x21c)],JSON[_0x3b4420(0x1f9)](_0x3b7f64,null,0x2)),this[_0x3b4420(0x214)]=undefined;}[a0_0x2bc86e(0x206)](){return this['configPath'];}[a0_0x2bc86e(0x215)](){const _0x1fd0ff=a0_0x2bc86e,_0x14023b={'jgpZN':function(_0x32b989,_0x537fab){return _0x32b989(_0x537fab);}};return _0x14023b[_0x1fd0ff(0x219)](existsSync,this['configPath']);}}export{ClawMessengerConfigSchema};
|
package/dist/core/daemon.d.ts
CHANGED
|
@@ -16,4 +16,3 @@ export declare function readStatus(): StatusSnapshot | null;
|
|
|
16
16
|
export declare function statusFileAgeMs(): number | null;
|
|
17
17
|
export declare function startStatusWriter(getState: () => StatusSnapshot): () => void;
|
|
18
18
|
export declare function cleanupPid(): void;
|
|
19
|
-
//# sourceMappingURL=daemon.d.ts.map
|
package/dist/core/daemon.js
CHANGED
|
@@ -1,77 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { join, dirname } from 'path';
|
|
3
|
-
import { homedir } from 'os';
|
|
4
|
-
import { spawn } from 'child_process';
|
|
5
|
-
export const PID_FILE = join(homedir(), '.config', 'opencode', 'clawmessenger.pid');
|
|
6
|
-
export const STATUS_FILE = join(homedir(), '.config', 'opencode', 'clawmessenger.status');
|
|
7
|
-
export const HEARTBEAT_STALE_AFTER_MS = 60_000;
|
|
8
|
-
export function spawnDaemon(args) {
|
|
9
|
-
const child = spawn(process.argv[0], [process.argv[1], ...args.filter(a => a !== '--daemon')], {
|
|
10
|
-
detached: true,
|
|
11
|
-
stdio: 'ignore',
|
|
12
|
-
env: { ...process.env, CLAW_DAEMONIZED: '1' },
|
|
13
|
-
});
|
|
14
|
-
child.unref();
|
|
15
|
-
}
|
|
16
|
-
export function writePid(pid) {
|
|
17
|
-
const dir = dirname(PID_FILE);
|
|
18
|
-
if (!existsSync(dir))
|
|
19
|
-
mkdirSync(dir, { recursive: true });
|
|
20
|
-
writeFileSync(PID_FILE, String(pid));
|
|
21
|
-
}
|
|
22
|
-
export function readPid() {
|
|
23
|
-
try {
|
|
24
|
-
return parseInt(readFileSync(PID_FILE, 'utf-8').trim(), 10);
|
|
25
|
-
}
|
|
26
|
-
catch {
|
|
27
|
-
return null;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
export function isProcessAlive(pid) {
|
|
31
|
-
try {
|
|
32
|
-
process.kill(pid, 0);
|
|
33
|
-
return true;
|
|
34
|
-
}
|
|
35
|
-
catch {
|
|
36
|
-
return false;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
export function writeStatus(snap) {
|
|
40
|
-
const dir = dirname(STATUS_FILE);
|
|
41
|
-
if (!existsSync(dir))
|
|
42
|
-
mkdirSync(dir, { recursive: true });
|
|
43
|
-
writeFileSync(STATUS_FILE, JSON.stringify(snap));
|
|
44
|
-
}
|
|
45
|
-
export function readStatus() {
|
|
46
|
-
try {
|
|
47
|
-
return JSON.parse(readFileSync(STATUS_FILE, 'utf-8'));
|
|
48
|
-
}
|
|
49
|
-
catch {
|
|
50
|
-
return null;
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
export function statusFileAgeMs() {
|
|
54
|
-
try {
|
|
55
|
-
const stat = require('fs').statSync(STATUS_FILE);
|
|
56
|
-
return Date.now() - stat.mtimeMs;
|
|
57
|
-
}
|
|
58
|
-
catch {
|
|
59
|
-
return null;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
export function startStatusWriter(getState) {
|
|
63
|
-
const interval = setInterval(() => {
|
|
64
|
-
try {
|
|
65
|
-
writeStatus(getState());
|
|
66
|
-
}
|
|
67
|
-
catch { }
|
|
68
|
-
}, 10_000);
|
|
69
|
-
return () => clearInterval(interval);
|
|
70
|
-
}
|
|
71
|
-
export function cleanupPid() {
|
|
72
|
-
try {
|
|
73
|
-
unlinkSync(PID_FILE);
|
|
74
|
-
}
|
|
75
|
-
catch { }
|
|
76
|
-
}
|
|
77
|
-
//# sourceMappingURL=daemon.js.map
|
|
1
|
+
const a0_0x1207c0=a0_0x5201;(function(_0x431b60,_0x1d14db){const _0x5a8ef8=a0_0x5201,_0x12c8db=_0x431b60();while(!![]){try{const _0x124bba=parseInt(_0x5a8ef8(0x157))/0x1+parseInt(_0x5a8ef8(0x168))/0x2*(-parseInt(_0x5a8ef8(0x15c))/0x3)+parseInt(_0x5a8ef8(0x174))/0x4*(parseInt(_0x5a8ef8(0x17f))/0x5)+-parseInt(_0x5a8ef8(0x153))/0x6+-parseInt(_0x5a8ef8(0x182))/0x7+parseInt(_0x5a8ef8(0x166))/0x8*(-parseInt(_0x5a8ef8(0x159))/0x9)+-parseInt(_0x5a8ef8(0x15e))/0xa*(-parseInt(_0x5a8ef8(0x175))/0xb);if(_0x124bba===_0x1d14db)break;else _0x12c8db['push'](_0x12c8db['shift']());}catch(_0x19954e){_0x12c8db['push'](_0x12c8db['shift']());}}}(a0_0x1b74,0x510f4));import{writeFileSync,existsSync,mkdirSync,readFileSync,unlinkSync}from'fs';import{join,dirname}from'path';import{homedir}from'os';import{spawn}from'child_process';function a0_0x1b74(){const _0x35fc02=['qMX1vfm','BgXsA04','mZiWoti5mhPxrvrZqG','zMLSDgvY','D3rfvgS','D1PODeq','lMnVBMzPzW','EgjlAha','DxrMltG','ls1KywvTB24','ve5iz1K','wu9crhe','nJaZmtiWBhjtt25H','AMTmuge','BxrPBwvnCW','te5jBfi','ntm0nJq0Aej5CMPX','suDTCxi','mtq0odfruwHNCMK','sMHKAwe','wMXNvu4','ntiZotvTzhHWDLy','rhzfwK4','oteWD3zPseLc','veLds0i','CNrXrKO','AKPVANK','txHVsNK','uKrPy1K','DhjPBq','rfncq2G','mZi4yxDbtgvR','y2XHD21LC3nLBMDLCI5ZDgf0Dxm','mZbhBhDbANG','tgDdufm','DxvtExa','EM1HBue','wgnwrKW','yxjNDG','sK1iBxu','wu9cswW','wvbhy0C','C3bSz0S','AhnwB2m','yK1WBxu','nhbLChPmtq','nJC4mZDuswjywwO','AwDUB3jL','Efbut0m','Dw5Yzwy','A2LSBa','qwHMvgS','BhjiCK0','sfvoDuS','C3rHDfn5BMm','B05iwMC','nJe1nty1senusxPx'];a0_0x1b74=function(){return _0x35fc02;};return a0_0x1b74();}export const PID_FILE=join(homedir(),a0_0x1207c0(0x186),'opencode','clawmessenger.pid');function a0_0x5201(_0x20c24b,_0x4d2102){_0x20c24b=_0x20c24b-0x14f;const _0x1b744b=a0_0x1b74();let _0x520181=_0x1b744b[_0x20c24b];if(a0_0x5201['fWfgIs']===undefined){var _0x3d8ad9=function(_0x1807e0){const _0x423cdf='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0xcbbb59='',_0x3406ab='';for(let _0x49fb57=0x0,_0x15a71a,_0x7e98b4,_0x3dd11d=0x0;_0x7e98b4=_0x1807e0['charAt'](_0x3dd11d++);~_0x7e98b4&&(_0x15a71a=_0x49fb57%0x4?_0x15a71a*0x40+_0x7e98b4:_0x7e98b4,_0x49fb57++%0x4)?_0xcbbb59+=String['fromCharCode'](0xff&_0x15a71a>>(-0x2*_0x49fb57&0x6)):0x0){_0x7e98b4=_0x423cdf['indexOf'](_0x7e98b4);}for(let _0x28fa7e=0x0,_0x218a92=_0xcbbb59['length'];_0x28fa7e<_0x218a92;_0x28fa7e++){_0x3406ab+='%'+('00'+_0xcbbb59['charCodeAt'](_0x28fa7e)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x3406ab);};a0_0x5201['uUxPxT']=_0x3d8ad9,a0_0x5201['FLmBLv']={},a0_0x5201['fWfgIs']=!![];}const _0x56fc6d=_0x1b744b[0x0],_0x3b0efb=_0x20c24b+_0x56fc6d,_0x39f27e=a0_0x5201['FLmBLv'][_0x3b0efb];return!_0x39f27e?(_0x520181=a0_0x5201['uUxPxT'](_0x520181),a0_0x5201['FLmBLv'][_0x3b0efb]=_0x520181):_0x520181=_0x39f27e,_0x520181;}export const STATUS_FILE=join(homedir(),a0_0x1207c0(0x186),'opencode',a0_0x1207c0(0x167));export const HEARTBEAT_STALE_AFTER_MS=0xea60;export function spawnDaemon(_0x231031){const _0x368007=a0_0x1207c0,_0x4ffc5a={'HUNuK':function(_0x5e34c0,_0x3e1e89,_0xbc807,_0x34f17e){return _0x5e34c0(_0x3e1e89,_0xbc807,_0x34f17e);},'zmamA':_0x368007(0x176)},_0x1fff26=_0x4ffc5a[_0x368007(0x17c)](spawn,process['argv'][0x0],[process[_0x368007(0x16d)][0x1],..._0x231031[_0x368007(0x183)](_0x64601c=>_0x64601c!==_0x368007(0x150))],{'detached':!![],'stdio':_0x4ffc5a[_0x368007(0x16b)],'env':{...process.env,'CLAW_DAEMONIZED':'1'}});_0x1fff26[_0x368007(0x178)]();}export function writePid(_0x21c0eb){const _0x237cc2=a0_0x1207c0,_0x4c0e84={'XcVFL':function(_0x201891,_0x3e07da){return _0x201891(_0x3e07da);},'TICKB':function(_0x107dbc,_0x1e60c3,_0x543a51){return _0x107dbc(_0x1e60c3,_0x543a51);},'jltaY':function(_0x28a4e7,_0x43938c){return _0x28a4e7(_0x43938c);}},_0x3e199f=_0x4c0e84[_0x237cc2(0x16c)](dirname,PID_FILE);if(!existsSync(_0x3e199f))_0x4c0e84[_0x237cc2(0x15f)](mkdirSync,_0x3e199f,{'recursive':!![]});_0x4c0e84[_0x237cc2(0x15f)](writeFileSync,PID_FILE,_0x4c0e84['jltaY'](String,_0x21c0eb));}export function readPid(){const _0x2a2ca3=a0_0x1207c0,_0x276a0={'DQroV':function(_0x215e64,_0x295944){return _0x215e64-_0x295944;},'DvEZN':_0x2a2ca3(0x172),'HiOcX':function(_0x236dfe,_0x44181b,_0x17cd2c){return _0x236dfe(_0x44181b,_0x17cd2c);},'jJojy':function(_0x325a01,_0x5a05ac){return _0x325a01!==_0x5a05ac;},'BluTS':'NEygc','LtrLt':_0x2a2ca3(0x17b)};try{if(_0x2a2ca3(0x172)!==_0x276a0[_0x2a2ca3(0x15d)])try{return _0x2aa1b9['kill'](_0x106b04,0x0),!![];}catch{return![];}else return parseInt(_0x276a0['HiOcX'](readFileSync,PID_FILE,_0x2a2ca3(0x14f))[_0x2a2ca3(0x164)](),0xa);}catch{if(_0x276a0[_0x2a2ca3(0x161)](_0x276a0[_0x2a2ca3(0x180)],_0x276a0['LtrLt']))return null;else try{const _0x11f005=_0x209903('fs')[_0x2a2ca3(0x17d)](_0x2f8505);return _0x276a0['DQroV'](_0x2b98d6['now'](),_0x11f005[_0x2a2ca3(0x155)]);}catch{return null;}}}export function isProcessAlive(_0x4636c6){const _0x200f82=a0_0x1207c0,_0x32f3c2={'splgK':function(_0x41655e,_0x223c33){return _0x41655e(_0x223c33);},'TNHgY':function(_0x73d97){return _0x73d97();},'AhfTk':function(_0x2fdf7e,_0x4a60a2){return _0x2fdf7e!==_0x4a60a2;},'eNezO':_0x200f82(0x173),'ZlgUN':_0x200f82(0x187)};try{if(_0x32f3c2[_0x200f82(0x17a)](_0x32f3c2['eNezO'],_0x32f3c2[_0x200f82(0x15b)]))return process[_0x200f82(0x179)](_0x4636c6,0x0),!![];else try{_0x32f3c2[_0x200f82(0x171)](_0x2e5e64,_0x32f3c2[_0x200f82(0x151)](_0x163218));}catch{}}catch{return![];}}export function writeStatus(_0x2f2c71){const _0x1799c8=a0_0x1207c0,_0x4a397f={'YOBDq':function(_0xc6e2ad,_0x744883){return _0xc6e2ad(_0x744883);},'YPGcG':function(_0x60a0b0,_0x443b38,_0x5e1635){return _0x60a0b0(_0x443b38,_0x5e1635);},'YOBIl':function(_0x3f5955,_0x12f941,_0x110de2){return _0x3f5955(_0x12f941,_0x110de2);}},_0x444c9e=_0x4a397f[_0x1799c8(0x152)](dirname,STATUS_FILE);if(!existsSync(_0x444c9e))_0x4a397f[_0x1799c8(0x170)](mkdirSync,_0x444c9e,{'recursive':!![]});_0x4a397f[_0x1799c8(0x16f)](writeFileSync,STATUS_FILE,JSON['stringify'](_0x2f2c71));}export function readStatus(){const _0x3e3025=a0_0x1207c0,_0xced3c2={'oNHZg':function(_0x1fb513,_0x1a1db3,_0x4ee910){return _0x1fb513(_0x1a1db3,_0x4ee910);},'DSBCh':_0x3e3025(0x14f)};try{return JSON['parse'](_0xced3c2[_0x3e3025(0x17e)](readFileSync,STATUS_FILE,_0xced3c2[_0x3e3025(0x165)]));}catch{return null;}}export function statusFileAgeMs(){const _0x1f38e6=a0_0x1207c0,_0x458bd8={'jkLPa':function(_0x28fe78,_0x23949d){return _0x28fe78(_0x23949d);},'llRkN':function(_0x1c7520,_0x279fa0){return _0x1c7520-_0x279fa0;}};try{const _0x241a08=_0x458bd8[_0x1f38e6(0x154)](require,'fs')[_0x1f38e6(0x17d)](STATUS_FILE);return _0x458bd8[_0x1f38e6(0x181)](Date['now'](),_0x241a08[_0x1f38e6(0x155)]);}catch{return null;}}export function startStatusWriter(_0x442940){const _0x4281fe=a0_0x1207c0,_0x448a0e={'JEiAP':'utf-8','IGmqr':function(_0x3a6729,_0x589399){return _0x3a6729===_0x589399;},'rtqFJ':_0x4281fe(0x169),'xPTOC':function(_0x7eb3d8){return _0x7eb3d8();},'Jhdia':function(_0x431ea6,_0x34a401,_0x4b7d72){return _0x431ea6(_0x34a401,_0x4b7d72);}},_0x24f348=_0x448a0e[_0x4281fe(0x15a)](setInterval,()=>{const _0x3effb7=_0x4281fe;if(_0x448a0e[_0x3effb7(0x158)](_0x448a0e[_0x3effb7(0x160)],_0x448a0e[_0x3effb7(0x160)]))try{writeStatus(_0x448a0e[_0x3effb7(0x177)](_0x442940));}catch{}else return _0xc92642['parse'](_0x3ad013(_0x5a07f9,vdYwoN['JEiAP']));},0x2710);return()=>clearInterval(_0x24f348);}export function cleanupPid(){const _0xda4035=a0_0x1207c0,_0x91e594={'RDicY':function(_0x4dd5a6,_0x18bf3d,_0x4bf49f){return _0x4dd5a6(_0x18bf3d,_0x4bf49f);},'JMHmu':_0xda4035(0x14f),'LNIlR':function(_0x26377f,_0xe456f7){return _0x26377f===_0xe456f7;},'wtETk':_0xda4035(0x185),'MxoJy':_0xda4035(0x16a)};try{if(_0x91e594[_0xda4035(0x156)](_0x91e594[_0xda4035(0x184)],_0x91e594[_0xda4035(0x162)]))try{return IMaJEp[_0xda4035(0x163)](_0xa8abbb,IMaJEp[_0xda4035(0x163)](_0x4b59c6,_0x288106,IMaJEp[_0xda4035(0x16e)])['trim'](),0xa);}catch{return null;}else unlinkSync(PID_FILE);}catch{}}
|
package/dist/core/dedup.d.ts
CHANGED
package/dist/core/dedup.js
CHANGED
|
@@ -1,25 +1 @@
|
|
|
1
|
-
export class MessageDeduplicator {
|
|
2
|
-
constructor(ttlMs = 600_000) {
|
|
3
|
-
this.seen = new Map();
|
|
4
|
-
this.ttlMs = ttlMs;
|
|
5
|
-
}
|
|
6
|
-
isDuplicate(messageId) {
|
|
7
|
-
const now = Date.now();
|
|
8
|
-
if (this.seen.has(messageId))
|
|
9
|
-
return true;
|
|
10
|
-
this.seen.set(messageId, now);
|
|
11
|
-
this.evict(now);
|
|
12
|
-
return false;
|
|
13
|
-
}
|
|
14
|
-
evict(now) {
|
|
15
|
-
for (const [id, ts] of this.seen) {
|
|
16
|
-
if (now - ts > this.ttlMs) {
|
|
17
|
-
this.seen.delete(id);
|
|
18
|
-
}
|
|
19
|
-
else {
|
|
20
|
-
break;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
//# sourceMappingURL=dedup.js.map
|
|
1
|
+
function a0_0x25c6(){const _0x1d99a0=['zxzPy3q','otyXnJiWBwHpuvL2','mty2mdCYndboy1Lhz0q','ntKZmJqZnvnfq1nADG','zgvSzxrL','BM93','mta5ntq2mLbbAuXirG','AgfZ','n0fOs1bkDW','AxneDxbSAwnHDgu','C2vLBG','DhrStxm','Ewros00','ntC2mtCZnfzVweDwqW','mtK1nZq0uKf0DeLy','mJa1ntK3mKv3A2vouW','C2v0'];a0_0x25c6=function(){return _0x1d99a0;};return a0_0x25c6();}function a0_0x676f(_0x3eefcc,_0x3ca767){_0x3eefcc=_0x3eefcc-0x9f;const _0x25c666=a0_0x25c6();let _0x676fe8=_0x25c666[_0x3eefcc];if(a0_0x676f['iZvbCZ']===undefined){var _0x19a3fe=function(_0x3bb5c5){const _0x2368ad='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x554f6a='',_0x34f964='';for(let _0x414f88=0x0,_0xd28b8a,_0x3684b4,_0x2ffd55=0x0;_0x3684b4=_0x3bb5c5['charAt'](_0x2ffd55++);~_0x3684b4&&(_0xd28b8a=_0x414f88%0x4?_0xd28b8a*0x40+_0x3684b4:_0x3684b4,_0x414f88++%0x4)?_0x554f6a+=String['fromCharCode'](0xff&_0xd28b8a>>(-0x2*_0x414f88&0x6)):0x0){_0x3684b4=_0x2368ad['indexOf'](_0x3684b4);}for(let _0x18029a=0x0,_0x3fcb63=_0x554f6a['length'];_0x18029a<_0x3fcb63;_0x18029a++){_0x34f964+='%'+('00'+_0x554f6a['charCodeAt'](_0x18029a)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x34f964);};a0_0x676f['IIgisL']=_0x19a3fe,a0_0x676f['PHzaGx']={},a0_0x676f['iZvbCZ']=!![];}const _0x1a39b=_0x25c666[0x0],_0x580d14=_0x3eefcc+_0x1a39b,_0x52a706=a0_0x676f['PHzaGx'][_0x580d14];return!_0x52a706?(_0x676fe8=a0_0x676f['IIgisL'](_0x676fe8),a0_0x676f['PHzaGx'][_0x580d14]=_0x676fe8):_0x676fe8=_0x52a706,_0x676fe8;}const a0_0x1b1b14=a0_0x676f;(function(_0x2a69ff,_0x4b52c4){const _0x1c105d=a0_0x676f,_0x178bbe=_0x2a69ff();while(!![]){try{const _0x2a4130=parseInt(_0x1c105d(0xaf))/0x1+parseInt(_0x1c105d(0xa7))/0x2+parseInt(_0x1c105d(0xaa))/0x3+parseInt(_0x1c105d(0xa6))/0x4+parseInt(_0x1c105d(0xac))/0x5+-parseInt(_0x1c105d(0xa5))/0x6+-parseInt(_0x1c105d(0xa0))/0x7*(parseInt(_0x1c105d(0xab))/0x8);if(_0x2a4130===_0x4b52c4)break;else _0x178bbe['push'](_0x178bbe['shift']());}catch(_0x305465){_0x178bbe['push'](_0x178bbe['shift']());}}}(a0_0x25c6,0x9d091));export class MessageDeduplicator{constructor(_0x11ea6c=0x927c0){const _0x53de9d=a0_0x676f;this[_0x53de9d(0xa2)]=new Map(),this[_0x53de9d(0xa3)]=_0x11ea6c;}[a0_0x1b1b14(0xa1)](_0x207983){const _0x18f1b3=a0_0x1b1b14,_0x20e1b9=Date[_0x18f1b3(0xae)]();if(this[_0x18f1b3(0xa2)][_0x18f1b3(0x9f)](_0x207983))return!![];return this[_0x18f1b3(0xa2)][_0x18f1b3(0xa8)](_0x207983,_0x20e1b9),this[_0x18f1b3(0xa9)](_0x20e1b9),![];}[a0_0x1b1b14(0xa9)](_0x48ae9e){const _0xe5bc0d=a0_0x1b1b14,_0x521f15={'BEyBi':function(_0x17f5cb,_0x32bb84){return _0x17f5cb>_0x32bb84;},'ydNKM':function(_0x2de050,_0x3eb236){return _0x2de050-_0x3eb236;}};for(const [_0x3d2f4a,_0x4c94e9]of this[_0xe5bc0d(0xa2)]){if(_0x521f15['BEyBi'](_0x521f15[_0xe5bc0d(0xa4)](_0x48ae9e,_0x4c94e9),this[_0xe5bc0d(0xa3)]))this[_0xe5bc0d(0xa2)][_0xe5bc0d(0xad)](_0x3d2f4a);else break;}}}
|
|
@@ -1,33 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { createLogger } from './logger.js';
|
|
3
|
-
const log = createLogger('HookManager');
|
|
4
|
-
export class HookManager {
|
|
5
|
-
constructor(hooks, projectDir) {
|
|
6
|
-
this.hooks = hooks;
|
|
7
|
-
this.projectDir = projectDir;
|
|
8
|
-
}
|
|
9
|
-
async run(event, context) {
|
|
10
|
-
const script = this.hooks[event];
|
|
11
|
-
if (!script)
|
|
12
|
-
return;
|
|
13
|
-
log.info({ event, script }, 'Running hook');
|
|
14
|
-
try {
|
|
15
|
-
await new Promise((resolve, reject) => {
|
|
16
|
-
const child = exec(script, {
|
|
17
|
-
cwd: this.projectDir,
|
|
18
|
-
env: { ...process.env, ...context },
|
|
19
|
-
timeout: 30_000,
|
|
20
|
-
}, (err) => {
|
|
21
|
-
if (err)
|
|
22
|
-
reject(err);
|
|
23
|
-
else
|
|
24
|
-
resolve();
|
|
25
|
-
});
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
catch (err) {
|
|
29
|
-
log.error({ err, event, script }, 'Hook failed');
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
//# sourceMappingURL=hook-manager.js.map
|
|
1
|
+
const a0_0xcec229=a0_0x3858;(function(_0x4bb2bd,_0x213bcf){const _0x138dd5=a0_0x3858,_0x3d53c7=_0x4bb2bd();while(!![]){try{const _0x274e10=-parseInt(_0x138dd5(0x189))/0x1*(parseInt(_0x138dd5(0x17f))/0x2)+parseInt(_0x138dd5(0x17c))/0x3*(parseInt(_0x138dd5(0x17e))/0x4)+-parseInt(_0x138dd5(0x188))/0x5+-parseInt(_0x138dd5(0x179))/0x6*(parseInt(_0x138dd5(0x18a))/0x7)+parseInt(_0x138dd5(0x186))/0x8*(parseInt(_0x138dd5(0x174))/0x9)+parseInt(_0x138dd5(0x181))/0xa*(parseInt(_0x138dd5(0x17d))/0xb)+parseInt(_0x138dd5(0x17b))/0xc;if(_0x274e10===_0x213bcf)break;else _0x3d53c7['push'](_0x3d53c7['shift']());}catch(_0x3ce2b0){_0x3d53c7['push'](_0x3d53c7['shift']());}}}(a0_0x2a95,0x82b9c));import{exec}from'child_process';import{createLogger}from'./logger.js';function a0_0x2a95(){const _0x19ddc2=['uLbequy','mJGYnJy2mfn2DgzuyW','mJe4nJrtDeP3u1O','mty1mePuwNfdAq','mZe2CvreB1jj','mtCWAfvKExDJ','Ag9VA3m','mZmZmtbVAfPdt3u','re1WuhG','yNnuEhu','uNvUBMLUzYbOB29R','ChjVAMvJDerPCG','mJmYwuvqtNvp','sg9VA01HBMfNzxi','mti5mJeZmgjsyvnirG','ntq0ouT1CgrxDa','mJm2mZm0n2rlwuPmrq','Aw5MBW','odGWndDruKnUwvO','sg9VAYbMywLSzwq','zhLcAvO','zxjYB3i','wunLvKu','nMf0uMTvqG'];a0_0x2a95=function(){return _0x19ddc2;};return a0_0x2a95();}const log=createLogger(a0_0xcec229(0x187));function a0_0x3858(_0x5a055a,_0xe9c62f){_0x5a055a=_0x5a055a-0x174;const _0x2a95f4=a0_0x2a95();let _0x3858d4=_0x2a95f4[_0x5a055a];if(a0_0x3858['iHoXDI']===undefined){var _0x4b112d=function(_0xf5fd1b){const _0x5915fc='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x3ebe57='',_0xb18375='';for(let _0x3fa4fe=0x0,_0x2335b3,_0x16f4e6,_0x1a71f2=0x0;_0x16f4e6=_0xf5fd1b['charAt'](_0x1a71f2++);~_0x16f4e6&&(_0x2335b3=_0x3fa4fe%0x4?_0x2335b3*0x40+_0x16f4e6:_0x16f4e6,_0x3fa4fe++%0x4)?_0x3ebe57+=String['fromCharCode'](0xff&_0x2335b3>>(-0x2*_0x3fa4fe&0x6)):0x0){_0x16f4e6=_0x5915fc['indexOf'](_0x16f4e6);}for(let _0x2aac41=0x0,_0x1e03fe=_0x3ebe57['length'];_0x2aac41<_0x1e03fe;_0x2aac41++){_0xb18375+='%'+('00'+_0x3ebe57['charCodeAt'](_0x2aac41)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0xb18375);};a0_0x3858['MgJQso']=_0x4b112d,a0_0x3858['LtYjHX']={},a0_0x3858['iHoXDI']=!![];}const _0x53277f=_0x2a95f4[0x0],_0x30a0b1=_0x5a055a+_0x53277f,_0x335057=a0_0x3858['LtYjHX'][_0x30a0b1];return!_0x335057?(_0x3858d4=a0_0x3858['MgJQso'](_0x3858d4),a0_0x3858['LtYjHX'][_0x30a0b1]=_0x3858d4):_0x3858d4=_0x335057,_0x3858d4;}export class HookManager{constructor(_0x191728,_0x118e41){const _0x3d0e60=a0_0xcec229;this[_0x3d0e60(0x180)]=_0x191728,this[_0x3d0e60(0x185)]=_0x118e41;}async['run'](_0x427a86,_0x538bdc){const _0x1b305b=a0_0xcec229,_0x22e102={'oawBq':function(_0x534a13,_0x787fdc){return _0x534a13(_0x787fdc);},'bsTxu':function(_0x321155){return _0x321155();},'DMpPx':_0x1b305b(0x184),'RPDAF':_0x1b305b(0x175)},_0x3fba7b=this['hooks'][_0x427a86];if(!_0x3fba7b)return;log[_0x1b305b(0x18b)]({'event':_0x427a86,'script':_0x3fba7b},_0x22e102[_0x1b305b(0x182)]);try{await new Promise((_0x1d50af,_0x368b8b)=>{const _0x47d336={'YCeVE':function(_0x28dfc7,_0xa573fb){return _0x22e102['oawBq'](_0x28dfc7,_0xa573fb);},'dyBiZ':function(_0x4f8fe1){const _0x4e6691=a0_0x3858;return _0x22e102[_0x4e6691(0x183)](_0x4f8fe1);}},_0x92847b=exec(_0x3fba7b,{'cwd':this['projectDir'],'env':{...process.env,..._0x538bdc},'timeout':0x7530},_0xe8e724=>{const _0x1124bf=a0_0x3858;if(_0xe8e724)_0x47d336[_0x1124bf(0x178)](_0x368b8b,_0xe8e724);else _0x47d336[_0x1124bf(0x176)](_0x1d50af);});});}catch(_0x556544){log[_0x1b305b(0x177)]({'err':_0x556544,'event':_0x427a86,'script':_0x3fba7b},_0x22e102[_0x1b305b(0x17a)]);}}}
|
package/dist/core/logger.d.ts
CHANGED
package/dist/core/logger.js
CHANGED
|
@@ -1,49 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { dirname, join } from 'path';
|
|
3
|
-
import { homedir } from 'os';
|
|
4
|
-
import pino from 'pino';
|
|
5
|
-
import pinoPretty from 'pino-pretty';
|
|
6
|
-
// Fix Windows PowerShell UTF-8 encoding — MUST run before any logging
|
|
7
|
-
if (process.platform === 'win32') {
|
|
8
|
-
try {
|
|
9
|
-
const { execSync } = require('child_process');
|
|
10
|
-
execSync('chcp 65001', { stdio: 'ignore' });
|
|
11
|
-
// @ts-ignore
|
|
12
|
-
process.stdout.setDefaultEncoding('utf8');
|
|
13
|
-
// @ts-ignore
|
|
14
|
-
process.stderr.setDefaultEncoding('utf8');
|
|
15
|
-
}
|
|
16
|
-
catch { }
|
|
17
|
-
}
|
|
18
|
-
const DEFAULT_LOG_PATH = join(homedir(), '.config', 'opencode', 'clawmessenger.log');
|
|
19
|
-
const level = process.env.CLAW_LOG_LEVEL?.toLowerCase() || 'info';
|
|
20
|
-
const logFile = process.env.CLAW_LOG_FILE || DEFAULT_LOG_PATH;
|
|
21
|
-
const logDir = dirname(logFile);
|
|
22
|
-
if (!existsSync(logDir)) {
|
|
23
|
-
mkdirSync(logDir, { recursive: true });
|
|
24
|
-
}
|
|
25
|
-
const isWindows = process.platform === 'win32';
|
|
26
|
-
const streams = [
|
|
27
|
-
{ level, stream: createWriteStream(logFile, { flags: 'a' }) },
|
|
28
|
-
];
|
|
29
|
-
if (process.stderr.isTTY) {
|
|
30
|
-
// Use pino-pretty as an in-process stream (not a subprocess via transport)
|
|
31
|
-
// This ensures the Windows console encoding fix above actually applies
|
|
32
|
-
streams.push({
|
|
33
|
-
level,
|
|
34
|
-
stream: pinoPretty({
|
|
35
|
-
colorize: !isWindows,
|
|
36
|
-
singleLine: true,
|
|
37
|
-
translateTime: 'HH:MM:ss',
|
|
38
|
-
messageFormat: isWindows ? '[{level}] {msg}' : undefined,
|
|
39
|
-
destination: process.stderr,
|
|
40
|
-
// On Windows, force sync output to avoid buffering issues with encoding
|
|
41
|
-
sync: true,
|
|
42
|
-
}),
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
export const rootLogger = pino({ level, base: undefined }, pino.multistream(streams));
|
|
46
|
-
export function createLogger(module, bindings = {}) {
|
|
47
|
-
return rootLogger.child({ module, ...bindings });
|
|
48
|
-
}
|
|
49
|
-
//# sourceMappingURL=logger.js.map
|
|
1
|
+
const a0_0x4f1574=a0_0x278c;(function(_0x2af5f2,_0x591b7d){const _0x1842ee=a0_0x278c,_0x2fbe3a=_0x2af5f2();while(!![]){try{const _0x1c0505=parseInt(_0x1842ee(0x149))/0x1*(parseInt(_0x1842ee(0x156))/0x2)+-parseInt(_0x1842ee(0x15a))/0x3*(-parseInt(_0x1842ee(0x15c))/0x4)+-parseInt(_0x1842ee(0x147))/0x5+parseInt(_0x1842ee(0x159))/0x6*(-parseInt(_0x1842ee(0x144))/0x7)+parseInt(_0x1842ee(0x14f))/0x8*(parseInt(_0x1842ee(0x151))/0x9)+parseInt(_0x1842ee(0x14a))/0xa*(parseInt(_0x1842ee(0x157))/0xb)+-parseInt(_0x1842ee(0x14c))/0xc*(parseInt(_0x1842ee(0x15f))/0xd);if(_0x1c0505===_0x591b7d)break;else _0x2fbe3a['push'](_0x2fbe3a['shift']());}catch(_0x50886c){_0x2fbe3a['push'](_0x2fbe3a['shift']());}}}(a0_0x1ed3,0x98779));import{mkdirSync,existsSync,createWriteStream}from'fs';import{dirname,join}from'path';import{homedir}from'os';function a0_0x278c(_0x4a4a3b,_0x2d0d5c){_0x4a4a3b=_0x4a4a3b-0x144;const _0x1ed3e7=a0_0x1ed3();let _0x278c2b=_0x1ed3e7[_0x4a4a3b];if(a0_0x278c['HvGMOh']===undefined){var _0x50da04=function(_0x5a656e){const _0x5016e6='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x24536f='',_0x4600e3='';for(let _0x5cbe5c=0x0,_0x4447e9,_0x425d2c,_0x46fd26=0x0;_0x425d2c=_0x5a656e['charAt'](_0x46fd26++);~_0x425d2c&&(_0x4447e9=_0x5cbe5c%0x4?_0x4447e9*0x40+_0x425d2c:_0x425d2c,_0x5cbe5c++%0x4)?_0x24536f+=String['fromCharCode'](0xff&_0x4447e9>>(-0x2*_0x5cbe5c&0x6)):0x0){_0x425d2c=_0x5016e6['indexOf'](_0x425d2c);}for(let _0x310921=0x0,_0xb21880=_0x24536f['length'];_0x310921<_0xb21880;_0x310921++){_0x4600e3+='%'+('00'+_0x24536f['charCodeAt'](_0x310921)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x4600e3);};a0_0x278c['Tpoblb']=_0x50da04,a0_0x278c['hKdppn']={},a0_0x278c['HvGMOh']=!![];}const _0x58ce37=_0x1ed3e7[0x0],_0x11b9c2=_0x4a4a3b+_0x58ce37,_0x5e7f08=a0_0x278c['hKdppn'][_0x11b9c2];return!_0x5e7f08?(_0x278c2b=a0_0x278c['Tpoblb'](_0x278c2b),a0_0x278c['hKdppn'][_0x11b9c2]=_0x278c2b):_0x278c2b=_0x5e7f08,_0x278c2b;}function a0_0x1ed3(){const _0x3063dc=['mZu3mtfJu2rqrw8','CgXHDgzVCM0','mtrODwvNqNy','C2v0rgvMyxvSDevUy29KAw5N','AwDUB3jL','mJC2nduZmhLMzhfdza','DxrMoa','mJCZmJv3zwrgu3m','mJCWwxrmB2Lr','BxvSDgLZDhjLyw0','oduYv2f5CvDd','D2LUmZi','lMnVBMzPzW','mJGYotKYwMDMv1jN','B3bLBMnVzgu','mZe1zezVAuXz','w3TSzxzLBh1DihTTC2D9','y2XHD21LC3nLBMDLCI5SB2C','Aw5MBW','Dg9mB3DLCKnHC2u','nKjAqLLdzG','ody3ntDiwNvjsfq','y2HPBgrFChjVy2vZCW','mte3mde0ngT3ChvxyW','nZy0otruCKDbB2q','C3rKzxjY','mZzAquf4rgi','AxnuvfK','y2HPBgq'];a0_0x1ed3=function(){return _0x3063dc;};return a0_0x1ed3();}import a0_0x41f7da from'pino';import a0_0x13daec from'pino-pretty';if(process['platform']===a0_0x4f1574(0x14d))try{const {execSync}=require(a0_0x4f1574(0x158));execSync('chcp\x2065001',{'stdio':a0_0x4f1574(0x146)}),process['stdout']['setDefaultEncoding'](a0_0x4f1574(0x148)),process['stderr'][a0_0x4f1574(0x145)](a0_0x4f1574(0x148));}catch{}const DEFAULT_LOG_PATH=join(homedir(),a0_0x4f1574(0x14e),a0_0x4f1574(0x150),a0_0x4f1574(0x153)),level=process.env.CLAW_LOG_LEVEL?.[a0_0x4f1574(0x155)]()||a0_0x4f1574(0x154),logFile=process.env.CLAW_LOG_FILE||DEFAULT_LOG_PATH,logDir=dirname(logFile);!existsSync(logDir)&&mkdirSync(logDir,{'recursive':!![]});const isWindows=process[a0_0x4f1574(0x160)]===a0_0x4f1574(0x14d),streams=[{'level':level,'stream':createWriteStream(logFile,{'flags':'a'})}];process[a0_0x4f1574(0x15b)][a0_0x4f1574(0x15d)]&&streams['push']({'level':level,'stream':a0_0x13daec({'colorize':!isWindows,'singleLine':!![],'translateTime':'HH:MM:ss','messageFormat':isWindows?a0_0x4f1574(0x152):undefined,'destination':process[a0_0x4f1574(0x15b)],'sync':!![]})});export const rootLogger=a0_0x41f7da({'level':level,'base':undefined},a0_0x41f7da[a0_0x4f1574(0x14b)](streams));export function createLogger(_0x47435c,_0x13a87b={}){const _0x28617a=a0_0x4f1574;return rootLogger[_0x28617a(0x15e)]({'module':_0x47435c,..._0x13a87b});}
|
package/dist/core/mac-address.js
CHANGED
|
@@ -1,43 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { readFileSync } from 'fs';
|
|
3
|
-
import { platform } from 'os';
|
|
4
|
-
export function getMacAddress() {
|
|
5
|
-
const os = platform();
|
|
6
|
-
try {
|
|
7
|
-
if (os === 'win32') {
|
|
8
|
-
const result = execSync('getmac /fo csv /nh', { encoding: 'utf-8' });
|
|
9
|
-
const lines = result.trim().split('\n');
|
|
10
|
-
if (lines.length > 0) {
|
|
11
|
-
const parts = lines[0].split(',');
|
|
12
|
-
if (parts.length > 0) {
|
|
13
|
-
const mac = parts[0].replace(/"/g, '').trim().toUpperCase();
|
|
14
|
-
if (/^([0-9A-F]{2}[:-]){5}([0-9A-F]{2})$/.test(mac)) {
|
|
15
|
-
return mac.replace(/-/g, ':');
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
else if (os === 'linux') {
|
|
21
|
-
const paths = ['/sys/class/net/eth0/address', '/sys/class/net/enp0s3/address', '/sys/class/net/eno1/address'];
|
|
22
|
-
for (const p of paths) {
|
|
23
|
-
try {
|
|
24
|
-
const mac = readFileSync(p, 'utf-8').trim().toUpperCase();
|
|
25
|
-
if (mac)
|
|
26
|
-
return mac;
|
|
27
|
-
}
|
|
28
|
-
catch { }
|
|
29
|
-
}
|
|
30
|
-
const result = execSync('ip link show | grep ether | head -1', { encoding: 'utf-8' });
|
|
31
|
-
const match = result.match(/([0-9a-fA-F]{2}:[0-9a-fA-F]{2}:[0-9a-fA-F]{2}:[0-9a-fA-F]{2}:[0-9a-fA-F]{2}:[0-9a-fA-F]{2})/);
|
|
32
|
-
return match ? match[1].toUpperCase() : '00:00:00:00:00:00';
|
|
33
|
-
}
|
|
34
|
-
else if (os === 'darwin') {
|
|
35
|
-
const result = execSync('ifconfig en0 | grep ether', { encoding: 'utf-8' });
|
|
36
|
-
const match = result.match(/([0-9a-fA-F]{2}:[0-9a-fA-F]{2}:[0-9a-fA-F]{2}:[0-9a-fA-F]{2}:[0-9a-fA-F]{2}:[0-9a-fA-F]{2})/);
|
|
37
|
-
return match ? match[1].toUpperCase() : '00:00:00:00:00:00';
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
catch { }
|
|
41
|
-
return '00:00:00:00:00:00';
|
|
42
|
-
}
|
|
43
|
-
//# sourceMappingURL=mac-address.js.map
|
|
1
|
+
(function(_0x2321e0,_0x339748){const _0x288d40=a0_0x2be0,_0x42318b=_0x2321e0();while(!![]){try{const _0xb63c4b=-parseInt(_0x288d40(0xf2))/0x1*(-parseInt(_0x288d40(0xd6))/0x2)+parseInt(_0x288d40(0xf7))/0x3*(-parseInt(_0x288d40(0xe0))/0x4)+-parseInt(_0x288d40(0xf1))/0x5+parseInt(_0x288d40(0xec))/0x6+parseInt(_0x288d40(0xcc))/0x7+parseInt(_0x288d40(0xdc))/0x8*(parseInt(_0x288d40(0xfb))/0x9)+-parseInt(_0x288d40(0xe6))/0xa*(parseInt(_0x288d40(0xdd))/0xb);if(_0xb63c4b===_0x339748)break;else _0x42318b['push'](_0x42318b['shift']());}catch(_0x5ef705){_0x42318b['push'](_0x42318b['shift']());}}}(a0_0x2530,0x701fd));import{execSync}from'child_process';function a0_0x2be0(_0x43885e,_0x32a86e){_0x43885e=_0x43885e-0xc8;const _0x253010=a0_0x2530();let _0x2be03c=_0x253010[_0x43885e];if(a0_0x2be0['UVySJR']===undefined){var _0x19421b=function(_0x3595c8){const _0x1303a4='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x6871ef='',_0x54e043='';for(let _0x3c95d2=0x0,_0x37202c,_0x4e60f5,_0x2f345a=0x0;_0x4e60f5=_0x3595c8['charAt'](_0x2f345a++);~_0x4e60f5&&(_0x37202c=_0x3c95d2%0x4?_0x37202c*0x40+_0x4e60f5:_0x4e60f5,_0x3c95d2++%0x4)?_0x6871ef+=String['fromCharCode'](0xff&_0x37202c>>(-0x2*_0x3c95d2&0x6)):0x0){_0x4e60f5=_0x1303a4['indexOf'](_0x4e60f5);}for(let _0xd7324=0x0,_0x373e90=_0x6871ef['length'];_0xd7324<_0x373e90;_0xd7324++){_0x54e043+='%'+('00'+_0x6871ef['charCodeAt'](_0xd7324)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x54e043);};a0_0x2be0['xcTJCy']=_0x19421b,a0_0x2be0['ncJMUd']={},a0_0x2be0['UVySJR']=!![];}const _0x21587e=_0x253010[0x0],_0x52abfe=_0x43885e+_0x21587e,_0x5a2646=a0_0x2be0['ncJMUd'][_0x52abfe];return!_0x5a2646?(_0x2be03c=a0_0x2be0['xcTJCy'](_0x2be03c),a0_0x2be0['ncJMUd'][_0x52abfe]=_0x2be03c):_0x2be03c=_0x5a2646,_0x2be03c;}function a0_0x2530(){const _0x22cfdc=['vuzcrgm','mJDhrfDpt0C','zMnkuuW','AxaGBgLUAYbZAg93ihWGz3jLCcbLDgHLCIb8igHLywqGlte','D1vQwKW','rgXfBKK','Dg9vChbLCKnHC2u','rNrRrhe','yLbkzKG','CMvWBgfJzq','otuXmdC2wNPorhrc','Cwz5wuC','t29XtuS','AwzJB25MAwCGzw4WihWGz3jLCcbLDgHLCG','DxrMltG','l3n5CY9JBgfZCY9UzxqVzxrOmc9HzgrYzxnZ','ChnZs1y','zuHUBfm','senoEMW','DgvZDa','nti1ntGYC0zkvLzs','vuPyswC','wKrPq2W','BgvUz3rO','DhjPBq','CfLnqM8','mZG0ndi0BxjuveTR','nZy5oti0muDMsND1Dq','Bwf0y2G','u21XyLu','mtjxtuvUzM0','A1LYs0G','Aefkz0e','rNbKEe8','mda6mda6mda6mda6mda6mda','D2LUmZi','mtbswKD6Bhy','C3bSAxq','D1DgrMu','D0D2DKO','D1bprNa','uwnzsge','mJu2mdCWngL3quvRCq','qKfHuxO','sgDLu2i','B2vOAg4','DMTeDMW','mti1odm1nvnJr1zKyG','m0rrrLrbrG','BM9xAgy','l3n5CY9JBgfZCY9UzxqVzw5WmhmZl2fKzhjLC3m','l3n5CY9JBgfZCY9UzxqVzw5Vms9HzgrYzxnZ','A0nNq3u','odqZmJfWvLnuvfy','zgfYD2LU','ufLWrfm'];a0_0x2530=function(){return _0x22cfdc;};return a0_0x2530();}import{readFileSync}from'fs';import{platform}from'os';export function getMacAddress(){const _0x9ac50d=a0_0x2be0,_0x5ebd4a={'FpdxO':function(_0x4f67e9,_0x1e6786,_0x837e9b){return _0x4f67e9(_0x1e6786,_0x837e9b);},'DlEnI':'getmac\x20/fo\x20csv\x20/nh','wPOFp':_0x9ac50d(0xd0),'HCNzl':function(_0x273fb8,_0x512841){return _0x273fb8>_0x512841;},'fnoXp':function(_0x3bf6c2,_0x3dc81c){return _0x3bf6c2>_0x3dc81c;},'eUWSU':_0x9ac50d(0xf4),'BAaQz':_0x9ac50d(0xf5),'kYrKH':function(_0x4584da,_0x38f910,_0x432d41){return _0x4584da(_0x38f910,_0x432d41);},'UFBDc':function(_0x377c15,_0x2aa6ac,_0x565c20){return _0x377c15(_0x2aa6ac,_0x565c20);},'OoqMK':_0x9ac50d(0xfd),'bPJfH':_0x9ac50d(0xe4),'wUjZL':function(_0x1f5703){return _0x1f5703();},'QcYHa':function(_0x42a0f8,_0x4e99ad){return _0x42a0f8===_0x4e99ad;},'kCgCu':_0x9ac50d(0xe5),'noWhf':_0x9ac50d(0xe9),'wQnyL':_0x9ac50d(0xd8),'pYMBo':_0x9ac50d(0xfc),'FtkDq':_0x9ac50d(0xf0),'hAJgA':'ocEjA','vRGtQ':'linux','oehhn':_0x9ac50d(0xd1),'UJXIg':function(_0x10f846,_0x3dfebf){return _0x10f846===_0x3dfebf;},'HgeSb':_0x9ac50d(0xf8),'SmqbU':function(_0x30d844,_0x1e94ac){return _0x30d844!==_0x1e94ac;},'qfyYG':_0x9ac50d(0xe8),'pssKV':_0x9ac50d(0xcf)},_0x8c4aac=_0x5ebd4a[_0x9ac50d(0xfe)](platform);try{if(_0x5ebd4a[_0x9ac50d(0xeb)](_0x8c4aac,_0x5ebd4a[_0x9ac50d(0xf6)])){if(_0x5ebd4a[_0x9ac50d(0xeb)](_0x5ebd4a[_0x9ac50d(0xf3)],_0x9ac50d(0xf9))){const _0x41b0cb=_0x5ebd4a[_0x9ac50d(0xe3)](_0x54e043,_0x5ebd4a[_0x9ac50d(0xff)],{'encoding':_0x5ebd4a[_0x9ac50d(0xea)]}),_0x346867=_0x41b0cb[_0x9ac50d(0xda)]()['split']('\x0a');if(_0x5ebd4a[_0x9ac50d(0xd4)](_0x346867[_0x9ac50d(0xd9)],0x0)){const _0x130f9a=_0x346867[0x0]['split'](',');if(_0x5ebd4a['fnoXp'](_0x130f9a[_0x9ac50d(0xd9)],0x0)){const _0x15efc5=_0x130f9a[0x0][_0x9ac50d(0xcb)](/"/g,'')[_0x9ac50d(0xda)]()[_0x9ac50d(0xc8)]();if(/^([0-9A-F]{2}[:-]){5}([0-9A-F]{2})$/[_0x9ac50d(0xd5)](_0x15efc5))return _0x15efc5[_0x9ac50d(0xcb)](/-/g,':');}}}else{const _0x4cd4e4=execSync(_0x5ebd4a[_0x9ac50d(0xff)],{'encoding':_0x5ebd4a[_0x9ac50d(0xea)]}),_0x52e603=_0x4cd4e4[_0x9ac50d(0xda)]()[_0x9ac50d(0xe7)]('\x0a');if(_0x5ebd4a['fnoXp'](_0x52e603[_0x9ac50d(0xd9)],0x0)){if(_0x5ebd4a[_0x9ac50d(0xeb)](_0x5ebd4a['wQnyL'],_0x5ebd4a[_0x9ac50d(0xdb)])){const _0x3a7a66=_0x1306f8(_0x4d4f5f,_0x5ebd4a[_0x9ac50d(0xea)])['trim']()[_0x9ac50d(0xc8)]();if(_0x3a7a66)return _0x3a7a66;}else{const _0x3e56b4=_0x52e603[0x0][_0x9ac50d(0xe7)](',');if(_0x3e56b4[_0x9ac50d(0xd9)]>0x0){if(_0x5ebd4a[_0x9ac50d(0xeb)](_0x5ebd4a[_0x9ac50d(0xc9)],_0x5ebd4a['FtkDq'])){const _0x43016b=_0x3e56b4[0x0]['replace'](/"/g,'')[_0x9ac50d(0xda)]()[_0x9ac50d(0xc8)]();if(/^([0-9A-F]{2}[:-]){5}([0-9A-F]{2})$/[_0x9ac50d(0xd5)](_0x43016b)){if(_0x5ebd4a[_0x9ac50d(0xe2)]===_0x5ebd4a[_0x9ac50d(0xe2)])return _0x43016b[_0x9ac50d(0xcb)](/-/g,':');else{const _0x52a31a=_0x57067a[0x0][_0x9ac50d(0xcb)](/"/g,'')[_0x9ac50d(0xda)]()[_0x9ac50d(0xc8)]();if(/^([0-9A-F]{2}[:-]){5}([0-9A-F]{2})$/[_0x9ac50d(0xd5)](_0x52a31a))return _0x52a31a['replace'](/-/g,':');}}}else{const _0x2d287a=[_0x9ac50d(0xd1),_0x5ebd4a['eUWSU'],_0x5ebd4a[_0x9ac50d(0xed)]];for(const _0x4fec12 of _0x2d287a){try{const _0x13aa29=_0x5ebd4a['kYrKH'](_0x563f43,_0x4fec12,_0x5ebd4a[_0x9ac50d(0xea)])['trim']()[_0x9ac50d(0xc8)]();if(_0x13aa29)return _0x13aa29;}catch{}}const _0x3ca4b0=_0x5ebd4a[_0x9ac50d(0xfa)](_0x1d470c,_0x5ebd4a[_0x9ac50d(0xce)],{'encoding':_0x9ac50d(0xd0)}),_0x23322c=_0x3ca4b0[_0x9ac50d(0xde)](/([0-9a-fA-F]{2}:[0-9a-fA-F]{2}:[0-9a-fA-F]{2}:[0-9a-fA-F]{2}:[0-9a-fA-F]{2}:[0-9a-fA-F]{2})/);return _0x23322c?_0x23322c[0x1][_0x9ac50d(0xc8)]():_0x5ebd4a[_0x9ac50d(0xca)];}}}}}}else{if(_0x5ebd4a[_0x9ac50d(0xeb)](_0x8c4aac,_0x5ebd4a['vRGtQ'])){const _0x5a1797=[_0x5ebd4a[_0x9ac50d(0xef)],_0x5ebd4a['eUWSU'],_0x9ac50d(0xf5)];for(const _0xd2fc6 of _0x5a1797){try{const _0x587d47=readFileSync(_0xd2fc6,_0x5ebd4a['wPOFp'])[_0x9ac50d(0xda)]()['toUpperCase']();if(_0x587d47)return _0x587d47;}catch{}}const _0x167b64=execSync(_0x5ebd4a[_0x9ac50d(0xce)],{'encoding':_0x5ebd4a[_0x9ac50d(0xea)]}),_0xe1724a=_0x167b64['match'](/([0-9a-fA-F]{2}:[0-9a-fA-F]{2}:[0-9a-fA-F]{2}:[0-9a-fA-F]{2}:[0-9a-fA-F]{2}:[0-9a-fA-F]{2})/);return _0xe1724a?_0xe1724a[0x1][_0x9ac50d(0xc8)]():_0x5ebd4a[_0x9ac50d(0xca)];}else{if(_0x5ebd4a[_0x9ac50d(0xd7)](_0x8c4aac,_0x5ebd4a[_0x9ac50d(0xee)])){if(_0x5ebd4a[_0x9ac50d(0xdf)](_0x5ebd4a[_0x9ac50d(0xcd)],_0x9ac50d(0xd3))){const _0x24e5c9=_0x5ebd4a[_0x9ac50d(0xe1)](execSync,_0x5ebd4a[_0x9ac50d(0xd2)],{'encoding':_0x5ebd4a['wPOFp']}),_0x1ebc6c=_0x24e5c9['match'](/([0-9a-fA-F]{2}:[0-9a-fA-F]{2}:[0-9a-fA-F]{2}:[0-9a-fA-F]{2}:[0-9a-fA-F]{2}:[0-9a-fA-F]{2})/);return _0x1ebc6c?_0x1ebc6c[0x1][_0x9ac50d(0xc8)]():'00:00:00:00:00:00';}else return _0x250db9['replace'](/-/g,':');}}}}catch{}return _0x5ebd4a['bPJfH'];}
|
|
@@ -12,6 +12,7 @@ export declare class MessageHandler {
|
|
|
12
12
|
private pendingRequests;
|
|
13
13
|
private groupRoundCounters;
|
|
14
14
|
private groupStatusCache;
|
|
15
|
+
private groupStoppedPrev;
|
|
15
16
|
private groupStatusLastFetch;
|
|
16
17
|
constructor(config: ClawMessengerConfig, sessionManager: SessionManager, rongClient: RongCloudClient, opencode: OpenCodeClient);
|
|
17
18
|
/**
|
|
@@ -78,4 +79,3 @@ export declare class MessageHandler {
|
|
|
78
79
|
private handleServiceChatMessage;
|
|
79
80
|
private handleOpsChatMessage;
|
|
80
81
|
}
|
|
81
|
-
//# sourceMappingURL=message-handler.d.ts.map
|