@zcloak/ai-agent 1.0.33 → 1.0.35
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/SKILL.md +1 -1
- package/dist/openclaw.d.ts +2 -2
- package/dist/openclaw.js +19 -11
- package/dist/openclaw.js.map +1 -1
- package/dist/types/registry.d.ts +1 -1
- package/dist/types/registry.js +1 -1
- package/dist/types/sign-event.d.ts +1 -1
- package/dist/types/sign-event.js +1 -1
- package/package.json +1 -1
package/SKILL.md
CHANGED
package/dist/openclaw.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { SyncMailboxResult } from './zmail.js';
|
|
2
|
-
export declare function getOpenClawStatusContext(): Promise<string | null>;
|
|
3
|
-
export declare function notifyOpenClawMainAgentOfNewMail(summary: SyncMailboxResult, channelContext: string): Promise<boolean>;
|
|
2
|
+
export declare function getOpenClawStatusContext(): Promise<string[] | null>;
|
|
3
|
+
export declare function notifyOpenClawMainAgentOfNewMail(summary: SyncMailboxResult, channelContext: string[]): Promise<boolean>;
|
|
4
4
|
//# sourceMappingURL=openclaw.d.ts.map
|
package/dist/openclaw.js
CHANGED
|
@@ -2,7 +2,6 @@ import { execFile } from 'node:child_process';
|
|
|
2
2
|
import * as log from './log.js';
|
|
3
3
|
const OPENCLAW_BIN = process.env['OPENCLAW_BIN'] || 'openclaw';
|
|
4
4
|
const DEFAULT_TIMEOUT_MS = 30000;
|
|
5
|
-
const MAX_STATUS_CONTEXT_CHARS = 8000;
|
|
6
5
|
function execFileText(command, args, timeoutMs = DEFAULT_TIMEOUT_MS) {
|
|
7
6
|
return new Promise((resolve, reject) => {
|
|
8
7
|
execFile(command, args, { timeout: timeoutMs }, (error, stdout, stderr) => {
|
|
@@ -14,19 +13,28 @@ function execFileText(command, args, timeoutMs = DEFAULT_TIMEOUT_MS) {
|
|
|
14
13
|
});
|
|
15
14
|
});
|
|
16
15
|
}
|
|
17
|
-
function
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
16
|
+
function extractChannelAccountsContext(statusJson) {
|
|
17
|
+
const channels = statusJson.health?.channels ?? {};
|
|
18
|
+
return Object.entries(channels).flatMap(([channel, info]) => {
|
|
19
|
+
if (!info || info.accounts === undefined) {
|
|
20
|
+
return [];
|
|
21
|
+
}
|
|
22
|
+
return [`channels.${channel}.accounts=${JSON.stringify(info.accounts)}`];
|
|
23
|
+
});
|
|
21
24
|
}
|
|
22
25
|
export async function getOpenClawStatusContext() {
|
|
23
26
|
try {
|
|
24
|
-
const { stdout, stderr } = await execFileText(OPENCLAW_BIN, ['status']);
|
|
27
|
+
const { stdout, stderr } = await execFileText(OPENCLAW_BIN, ['status', '--json', '--deep']);
|
|
25
28
|
const raw = stdout || stderr;
|
|
26
29
|
if (!raw) {
|
|
27
30
|
throw new Error('openclaw status returned no output');
|
|
28
31
|
}
|
|
29
|
-
|
|
32
|
+
const parsed = JSON.parse(raw);
|
|
33
|
+
const channelAccounts = extractChannelAccountsContext(parsed);
|
|
34
|
+
if (channelAccounts.length === 0) {
|
|
35
|
+
return [];
|
|
36
|
+
}
|
|
37
|
+
return channelAccounts;
|
|
30
38
|
}
|
|
31
39
|
catch (error) {
|
|
32
40
|
log.warn('openclaw status failed', {
|
|
@@ -39,10 +47,10 @@ export async function getOpenClawStatusContext() {
|
|
|
39
47
|
export async function notifyOpenClawMainAgentOfNewMail(summary, channelContext) {
|
|
40
48
|
const message = [
|
|
41
49
|
`New mail arrived. This zMail sync detected ${summary.inbox_new} new inbox message(s).`,
|
|
42
|
-
'
|
|
43
|
-
|
|
44
|
-
'
|
|
45
|
-
|
|
50
|
+
'Channel account context from openclaw status --json --deep:',
|
|
51
|
+
...channelContext,
|
|
52
|
+
'Choose an appropriate channel from this account context and decide how to send the notification.',
|
|
53
|
+
'If notification cannot be sent, explain to the user what channel configuration is needed.',
|
|
46
54
|
].join('\n\n');
|
|
47
55
|
try {
|
|
48
56
|
await execFileText(OPENCLAW_BIN, [
|
package/dist/openclaw.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"openclaw.js","sourceRoot":"","sources":["../src/openclaw.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C,OAAO,KAAK,GAAG,MAAM,UAAU,CAAC;AAEhC,MAAM,YAAY,GAAG,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,IAAI,UAAU,CAAC;AAC/D,MAAM,kBAAkB,GAAG,KAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"openclaw.js","sourceRoot":"","sources":["../src/openclaw.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C,OAAO,KAAK,GAAG,MAAM,UAAU,CAAC;AAEhC,MAAM,YAAY,GAAG,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,IAAI,UAAU,CAAC;AAC/D,MAAM,kBAAkB,GAAG,KAAM,CAAC;AAElC,SAAS,YAAY,CACnB,OAAe,EACf,IAAc,EACd,SAAS,GAAG,kBAAkB;IAE9B,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrC,QAAQ,CAAC,OAAO,EAAE,IAAI,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE;YACxE,IAAI,KAAK,EAAE,CAAC;gBACV,MAAM,CAAC,KAAK,CAAC,CAAC;gBACd,OAAO;YACT,CAAC;YACD,OAAO,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,IAAI,EAAE,EAAE,MAAM,EAAE,MAAM,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;QAC5D,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC;AAUD,SAAS,6BAA6B,CAAC,UAA8B;IACnE,MAAM,QAAQ,GAAG,UAAU,CAAC,MAAM,EA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C;IACd,CAAC;AACH,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,gCAAgC,CACpD,OAA0B,EAC1B,cAAwB;IAExB,MAAM,OAAO,GAAG;QACd,8CAA8C,OAAO,CAAC,SAAS,wBAAwB;QACvF,6DAA6D;QAC7D,GAAG,cAAc;QACjB,kGAAkG;QAClG,2FAA2F;KAC5F,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAEf,IAAI,CAAC;QACH,MAAM,YAAY,CAAC,YAAY,EAAE;YAC/B,OAAO;YACP,SAAS;YACT,MAAM;YACN,WAAW;YACX,OAAO;SACR,CAAC,CAAC;QACH,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,GAAG,CAAC,IAAI,CAAC,8BAA8B,EAAE;YACvC,OAAO,EAAE,YAAY;YACrB,OAAO,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;SAChE,CAAC,CAAC;QACH,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC"}
|
package/dist/types/registry.d.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Run `npm run generate-types` to regenerate this file.
|
|
5
5
|
* Source: registryIdlFactory in src/idl.ts
|
|
6
|
-
* Generated: 2026-03-
|
|
6
|
+
* Generated: 2026-03-18T17:23:53.009Z
|
|
7
7
|
*
|
|
8
8
|
* These types are derived from the Candid IDL definitions and correspond to
|
|
9
9
|
* the canister's runtime interface. Edit idl.ts to change type definitions.
|
package/dist/types/registry.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Run `npm run generate-types` to regenerate this file.
|
|
5
5
|
* Source: registryIdlFactory in src/idl.ts
|
|
6
|
-
* Generated: 2026-03-
|
|
6
|
+
* Generated: 2026-03-18T17:23:53.009Z
|
|
7
7
|
*
|
|
8
8
|
* These types are derived from the Candid IDL definitions and correspond to
|
|
9
9
|
* the canister's runtime interface. Edit idl.ts to change type definitions.
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Run `npm run generate-types` to regenerate this file.
|
|
5
5
|
* Source: signIdlFactory in src/idl.ts
|
|
6
|
-
* Generated: 2026-03-
|
|
6
|
+
* Generated: 2026-03-18T17:23:53.008Z
|
|
7
7
|
*
|
|
8
8
|
* These types are derived from the Candid IDL definitions and correspond to
|
|
9
9
|
* the canister's runtime interface. Edit idl.ts to change type definitions.
|
package/dist/types/sign-event.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Run `npm run generate-types` to regenerate this file.
|
|
5
5
|
* Source: signIdlFactory in src/idl.ts
|
|
6
|
-
* Generated: 2026-03-
|
|
6
|
+
* Generated: 2026-03-18T17:23:53.008Z
|
|
7
7
|
*
|
|
8
8
|
* These types are derived from the Candid IDL definitions and correspond to
|
|
9
9
|
* the canister's runtime interface. Edit idl.ts to change type definitions.
|