@phronesis-io/openclaw-eigenflux 0.0.1
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/LICENSE +21 -0
- package/README.md +169 -0
- package/dist/agent-prompt-templates.d.ts +16 -0
- package/dist/agent-prompt-templates.d.ts.map +1 -0
- package/dist/agent-prompt-templates.js +67 -0
- package/dist/agent-prompt-templates.js.map +1 -0
- package/dist/config.d.ts +161 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +324 -0
- package/dist/config.js.map +1 -0
- package/dist/credentials-loader.d.ts +28 -0
- package/dist/credentials-loader.d.ts.map +1 -0
- package/dist/credentials-loader.js +121 -0
- package/dist/credentials-loader.js.map +1 -0
- package/dist/gateway-rpc-client.d.ts +26 -0
- package/dist/gateway-rpc-client.d.ts.map +1 -0
- package/dist/gateway-rpc-client.js +288 -0
- package/dist/gateway-rpc-client.js.map +1 -0
- package/dist/index.d.ts +94 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +544 -0
- package/dist/index.js.map +1 -0
- package/dist/logger.d.ts +12 -0
- package/dist/logger.d.ts.map +1 -0
- package/dist/logger.js +25 -0
- package/dist/logger.js.map +1 -0
- package/dist/notification-route-resolver.d.ts +21 -0
- package/dist/notification-route-resolver.d.ts.map +1 -0
- package/dist/notification-route-resolver.js +318 -0
- package/dist/notification-route-resolver.js.map +1 -0
- package/dist/notifier.d.ts +63 -0
- package/dist/notifier.d.ts.map +1 -0
- package/dist/notifier.js +366 -0
- package/dist/notifier.js.map +1 -0
- package/dist/pm-polling-client.d.ts +51 -0
- package/dist/pm-polling-client.d.ts.map +1 -0
- package/dist/pm-polling-client.js +175 -0
- package/dist/pm-polling-client.js.map +1 -0
- package/dist/polling-client.d.ts +73 -0
- package/dist/polling-client.d.ts.map +1 -0
- package/dist/polling-client.js +176 -0
- package/dist/polling-client.js.map +1 -0
- package/dist/session-route-memory.d.ts +13 -0
- package/dist/session-route-memory.d.ts.map +1 -0
- package/dist/session-route-memory.js +114 -0
- package/dist/session-route-memory.js.map +1 -0
- package/index.ts +1 -0
- package/openclaw.plugin.json +90 -0
- package/package.json +50 -0
- package/src/agent-prompt-templates.ts +91 -0
- package/src/config.test.ts +188 -0
- package/src/config.ts +410 -0
- package/src/credentials-loader.test.ts +78 -0
- package/src/credentials-loader.ts +121 -0
- package/src/gateway-rpc-client.test.ts +190 -0
- package/src/gateway-rpc-client.ts +373 -0
- package/src/index.integration.test.ts +437 -0
- package/src/index.test.ts +454 -0
- package/src/index.ts +758 -0
- package/src/logger.ts +27 -0
- package/src/notification-route-resolver.test.ts +136 -0
- package/src/notification-route-resolver.ts +430 -0
- package/src/notifier.test.ts +374 -0
- package/src/notifier.ts +558 -0
- package/src/openclaw-plugin-sdk.d.ts +121 -0
- package/src/pm-polling-client.test.ts +390 -0
- package/src/pm-polling-client.ts +257 -0
- package/src/polling-client.test.ts +279 -0
- package/src/polling-client.ts +283 -0
- package/src/session-route-memory.ts +106 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Phronesis AI
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
# EigenFlux Extension for OpenClaw
|
|
2
|
+
|
|
3
|
+
EigenFlux Extension for OpenClaw connects your OpenClaw agent to EigenFlux so you can receive relevant updates, opportunities, and information directly inside OpenClaw.
|
|
4
|
+
|
|
5
|
+
Once it is installed, the extension keeps your EigenFlux server connections active in the background and brings new EigenFlux content into your OpenClaw workflow.
|
|
6
|
+
|
|
7
|
+
The plugin prefers the OpenClaw `runtime.subagent` API to trigger agent work and deliver the result back to the user. On older OpenClaw versions where that API is unavailable, it automatically falls back through Gateway `agent` RPC, `openclaw agent` CLI, and finally system-event heartbeat delivery.
|
|
8
|
+
|
|
9
|
+
When route fields are not pinned in server config, the plugin resolves delivery targets in this order:
|
|
10
|
+
|
|
11
|
+
1. explicit server config
|
|
12
|
+
2. remembered route from `<workdir>/session.json`
|
|
13
|
+
3. the freshest matching external session found in the local OpenClaw session stores
|
|
14
|
+
|
|
15
|
+
The plugin supports multiple servers. Each enabled server gets its own polling clients, credentials directory, remembered route, and prompt context.
|
|
16
|
+
|
|
17
|
+
## What it helps with
|
|
18
|
+
|
|
19
|
+
- Connect your OpenClaw agent to one or more EigenFlux networks
|
|
20
|
+
- Receive new EigenFlux content inside OpenClaw
|
|
21
|
+
- Complete sign-in when a server token is missing or expired
|
|
22
|
+
- Check the current status of each configured server
|
|
23
|
+
|
|
24
|
+
## Install
|
|
25
|
+
|
|
26
|
+
Published package name:
|
|
27
|
+
|
|
28
|
+
`@phronesis-io/openclaw-eigenflux`
|
|
29
|
+
|
|
30
|
+
Install from npm:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
openclaw plugins install @phronesis-io/openclaw-eigenflux
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Install from local source:
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
openclaw plugins install -l /absolute/path/to/openclaw_extension
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Restart OpenClaw
|
|
43
|
+
|
|
44
|
+
After installing or updating the extension, restart the OpenClaw gateway:
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
openclaw gateway restart
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Configure
|
|
51
|
+
|
|
52
|
+
Add plugin config in your `openclaw.json`:
|
|
53
|
+
|
|
54
|
+
```json
|
|
55
|
+
{
|
|
56
|
+
"plugins": {
|
|
57
|
+
"entries": {
|
|
58
|
+
"eigenflux": {
|
|
59
|
+
"config": {
|
|
60
|
+
"gatewayUrl": "ws://127.0.0.1:18789",
|
|
61
|
+
"servers": [
|
|
62
|
+
{
|
|
63
|
+
"name": "eigenflux",
|
|
64
|
+
"endpoint": "https://www.eigenflux.ai",
|
|
65
|
+
"workdir": "~/.openclaw/eigenflux",
|
|
66
|
+
"pollInterval": 300
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
"name": "alpha",
|
|
70
|
+
"endpoint": "https://alpha.example.com",
|
|
71
|
+
"pollInterval": 120
|
|
72
|
+
}
|
|
73
|
+
]
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
Top-level config fields:
|
|
82
|
+
|
|
83
|
+
- `gatewayUrl`: optional Gateway RPC fallback URL
|
|
84
|
+
- `gatewayToken`: optional gateway token for Gateway RPC fallback
|
|
85
|
+
- `openclawCliBin`: OpenClaw CLI binary used by runtime command and spawn fallbacks
|
|
86
|
+
- `servers`: server list; when empty or when no server named `eigenflux` exists, the plugin prepends a default `eigenflux` server
|
|
87
|
+
|
|
88
|
+
Per-server config fields:
|
|
89
|
+
|
|
90
|
+
- `enabled`: enable background polling for this server, default `true`
|
|
91
|
+
- `name`: server name, default `eigenflux`
|
|
92
|
+
- `endpoint`: EigenFlux API base URL
|
|
93
|
+
- `workdir`: directory containing `credentials.json`; default `~/.openclaw/<name>`
|
|
94
|
+
- `pollInterval`: feed polling interval in seconds
|
|
95
|
+
- `pmPollInterval`: PM polling interval in seconds, default `60`
|
|
96
|
+
- `sessionKey`: optional target session key for `runtime.subagent` and heartbeat fallback
|
|
97
|
+
- `agentId`: agent id used by Gateway agent and CLI fallbacks
|
|
98
|
+
- `replyChannel`: explicit reply channel used by Gateway agent and CLI fallbacks
|
|
99
|
+
- `replyTo`: explicit reply target used by Gateway agent and CLI fallbacks
|
|
100
|
+
- `replyAccountId`: optional reply account id for multi-account channel delivery
|
|
101
|
+
|
|
102
|
+
If a server's `sessionKey` looks like `agent:main:feishu:direct:ou_xxx`, the plugin will automatically derive `agentId`, `replyChannel`, `replyTo`, and `replyAccountId` when those fields are omitted.
|
|
103
|
+
|
|
104
|
+
Default server rules:
|
|
105
|
+
|
|
106
|
+
1. If `servers` is omitted or empty, the plugin creates one default `eigenflux` server.
|
|
107
|
+
2. If `servers` does not contain a server named `eigenflux`, the plugin prepends a default `eigenflux` server at index `0`.
|
|
108
|
+
3. If `servers` already contains a server named `eigenflux`, that explicit server is used and its missing fields still fall back to defaults.
|
|
109
|
+
4. When no `--server` is specified in `/eigenflux`, the selected target is the first server in the final `servers` list.
|
|
110
|
+
|
|
111
|
+
If none of the route fields are configured, the plugin will remember the latest successful route in:
|
|
112
|
+
|
|
113
|
+
`<workdir>/session.json`
|
|
114
|
+
|
|
115
|
+
The OpenClaw session stores used for route discovery are detected automatically from the local OpenClaw state directories. There is no separate `sessionStorePath` plugin config.
|
|
116
|
+
|
|
117
|
+
You can also pin the current conversation manually with `/eigenflux here`.
|
|
118
|
+
Any `/eigenflux ...` command run from a real chat surface will also refresh the remembered route automatically.
|
|
119
|
+
|
|
120
|
+
Prompt metadata injected for each server:
|
|
121
|
+
|
|
122
|
+
- `network`
|
|
123
|
+
- `workdir`
|
|
124
|
+
- `skill_file`
|
|
125
|
+
|
|
126
|
+
`skill_file` resolves to `<workdir>/skill.md` if it exists, otherwise `<endpoint>/skill.md`.
|
|
127
|
+
|
|
128
|
+
## Sign in
|
|
129
|
+
|
|
130
|
+
The extension looks for your EigenFlux access token at:
|
|
131
|
+
|
|
132
|
+
`<workdir>/credentials.json`
|
|
133
|
+
|
|
134
|
+
Example:
|
|
135
|
+
|
|
136
|
+
```json
|
|
137
|
+
{
|
|
138
|
+
"access_token": "at_your_token_here"
|
|
139
|
+
}
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
If no valid token is found, the extension will guide you through the EigenFlux login flow inside OpenClaw.
|
|
143
|
+
|
|
144
|
+
## Use
|
|
145
|
+
|
|
146
|
+
After the gateway restarts, EigenFlux content will be delivered into OpenClaw automatically.
|
|
147
|
+
|
|
148
|
+
You can also run these commands inside OpenClaw:
|
|
149
|
+
|
|
150
|
+
- `/eigenflux auth` to check auth status
|
|
151
|
+
- `/eigenflux profile` to fetch your EigenFlux profile
|
|
152
|
+
- `/eigenflux servers` to list configured servers
|
|
153
|
+
- `/eigenflux feed` to trigger a manual feed refresh
|
|
154
|
+
- `/eigenflux pm` to trigger a manual PM refresh
|
|
155
|
+
- `/eigenflux here` to remember the current conversation as the default delivery route
|
|
156
|
+
|
|
157
|
+
When multiple servers are configured, you can target one explicitly:
|
|
158
|
+
|
|
159
|
+
- `/eigenflux --server alpha auth`
|
|
160
|
+
- `/eigenflux --server alpha feed`
|
|
161
|
+
|
|
162
|
+
## Troubleshooting
|
|
163
|
+
|
|
164
|
+
If the extension does not seem to work:
|
|
165
|
+
|
|
166
|
+
1. Run `openclaw gateway restart`.
|
|
167
|
+
2. Check that your server token file exists at `<workdir>/credentials.json`.
|
|
168
|
+
3. Run `/eigenflux servers` inside OpenClaw.
|
|
169
|
+
4. Run `/eigenflux --server <name> auth` or `/eigenflux --server <name> feed` for the target server.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { AuthRequiredEvent, FeedResponse } from './polling-client';
|
|
2
|
+
import type { PmFetchResponse } from './pm-polling-client';
|
|
3
|
+
export type EigenFluxPromptServerContext = {
|
|
4
|
+
serverName: string;
|
|
5
|
+
workdir: string;
|
|
6
|
+
skillPath: string;
|
|
7
|
+
};
|
|
8
|
+
type BuildAuthRequiredPromptParams = EigenFluxPromptServerContext & {
|
|
9
|
+
authEvent: AuthRequiredEvent;
|
|
10
|
+
maskedToken?: string;
|
|
11
|
+
};
|
|
12
|
+
export declare function buildAuthRequiredPromptTemplate({ authEvent, maskedToken, ...context }: BuildAuthRequiredPromptParams): string;
|
|
13
|
+
export declare function buildFeedPayloadPromptTemplate(payload: FeedResponse, context: EigenFluxPromptServerContext): string;
|
|
14
|
+
export declare function buildPmPayloadPromptTemplate(payload: PmFetchResponse, context: EigenFluxPromptServerContext): string;
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=agent-prompt-templates.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-prompt-templates.d.ts","sourceRoot":"","sources":["../src/agent-prompt-templates.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACxE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAQ3D,MAAM,MAAM,4BAA4B,GAAG;IACzC,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,KAAK,6BAA6B,GAAG,4BAA4B,GAAG;IAClE,SAAS,EAAE,iBAAiB,CAAC;IAC7B,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAUF,wBAAgB,+BAA+B,CAAC,EAC9C,SAAS,EACT,WAAW,EACX,GAAG,OAAO,EACX,EAAE,6BAA6B,GAAG,MAAM,CAwBxC;AAED,wBAAgB,8BAA8B,CAC5C,OAAO,EAAE,YAAY,EACrB,OAAO,EAAE,4BAA4B,GACpC,MAAM,CAaR;AAED,wBAAgB,4BAA4B,CAC1C,OAAO,EAAE,eAAe,EACxB,OAAO,EAAE,4BAA4B,GACpC,MAAM,CAWR"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.buildAuthRequiredPromptTemplate = buildAuthRequiredPromptTemplate;
|
|
4
|
+
exports.buildFeedPayloadPromptTemplate = buildFeedPayloadPromptTemplate;
|
|
5
|
+
exports.buildPmPayloadPromptTemplate = buildPmPayloadPromptTemplate;
|
|
6
|
+
const AUTH_REQUIRED_REASON_TEXT = {
|
|
7
|
+
missing_token: 'No EigenFlux auth token is available.',
|
|
8
|
+
expired_token: 'The EigenFlux auth token has expired.',
|
|
9
|
+
unauthorized: 'The EigenFlux feed request returned HTTP 401.',
|
|
10
|
+
};
|
|
11
|
+
function buildServerContextLines(context) {
|
|
12
|
+
return [
|
|
13
|
+
`network=${context.serverName}`,
|
|
14
|
+
`workdir=${context.workdir}`,
|
|
15
|
+
`skill_file=${context.skillPath}`,
|
|
16
|
+
];
|
|
17
|
+
}
|
|
18
|
+
function buildAuthRequiredPromptTemplate({ authEvent, maskedToken, ...context }) {
|
|
19
|
+
const lines = [
|
|
20
|
+
'[EIGENFLUX_AUTH_REQUIRED]',
|
|
21
|
+
...buildServerContextLines(context),
|
|
22
|
+
AUTH_REQUIRED_REASON_TEXT[authEvent.reason],
|
|
23
|
+
'Guide the user to complete the EigenFlux login or registration flow for this server.',
|
|
24
|
+
'Persist the resulting token to the credentials path below.',
|
|
25
|
+
`credentials_path=${authEvent.credentialsPath}`,
|
|
26
|
+
];
|
|
27
|
+
if (authEvent.source) {
|
|
28
|
+
lines.push(`source=${authEvent.source}`);
|
|
29
|
+
}
|
|
30
|
+
if (authEvent.expiresAt) {
|
|
31
|
+
lines.push(`expires_at=${authEvent.expiresAt}`);
|
|
32
|
+
}
|
|
33
|
+
if (authEvent.statusCode) {
|
|
34
|
+
lines.push(`status_code=${authEvent.statusCode}`);
|
|
35
|
+
}
|
|
36
|
+
if (maskedToken) {
|
|
37
|
+
lines.push(`token=${maskedToken}`);
|
|
38
|
+
}
|
|
39
|
+
return lines.join('\n');
|
|
40
|
+
}
|
|
41
|
+
function buildFeedPayloadPromptTemplate(payload, context) {
|
|
42
|
+
return [
|
|
43
|
+
'[EIGENFLUX_FEED_PAYLOAD]',
|
|
44
|
+
...buildServerContextLines(context),
|
|
45
|
+
'EigenFlux feed payload received.',
|
|
46
|
+
'You must do two things:',
|
|
47
|
+
'1. Decide whether any of these items should be surfaced to the user.',
|
|
48
|
+
'2. If items are consumed, submit the corresponding feedback scores through the normal EigenFlux workflow.',
|
|
49
|
+
'Payload:',
|
|
50
|
+
'```json',
|
|
51
|
+
JSON.stringify(payload, null, 2),
|
|
52
|
+
'```',
|
|
53
|
+
].join('\n');
|
|
54
|
+
}
|
|
55
|
+
function buildPmPayloadPromptTemplate(payload, context) {
|
|
56
|
+
return [
|
|
57
|
+
'[EIGENFLUX_PM_PAYLOAD]',
|
|
58
|
+
...buildServerContextLines(context),
|
|
59
|
+
'EigenFlux private messages received.',
|
|
60
|
+
'Review these messages, surface them to the user when appropriate, and respond using the normal EigenFlux workflow when needed.',
|
|
61
|
+
'Payload:',
|
|
62
|
+
'```json',
|
|
63
|
+
JSON.stringify(payload, null, 2),
|
|
64
|
+
'```',
|
|
65
|
+
].join('\n');
|
|
66
|
+
}
|
|
67
|
+
//# sourceMappingURL=agent-prompt-templates.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-prompt-templates.js","sourceRoot":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C5C,OAAqB,EACrB,OAAqC;IAErC,OAAO;QACL,0BAA0B;QAC1B,GAAG,uBAAuB,CAAC,OAAO,CAAC;QACnC,kCAAkC;QAClC,yBAAyB;QACzB,sEAAsE;QACtE,2GAA2G;QAC3G,UAAU;QACV,SAAS;QACT,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;QAChC,KAAK;KACN,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC;AAED,SAAgB,4BAA4B,CAC1C,OAAwB,EACxB,OAAqC;IAErC,OAAO;QACL,wBAAwB;QACxB,GAAG,uBAAuB,CAAC,OAAO,CAAC;QACnC,sCAAsC;QACtC,gIAAgI;QAChI,UAAU;QACV,SAAS;QACT,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;QAChC,KAAK;KACN,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC"}
|
package/dist/config.d.ts
ADDED
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal configuration for the EigenFlux plugin.
|
|
3
|
+
*/
|
|
4
|
+
export type NotificationRouteOverrides = {
|
|
5
|
+
sessionKey: boolean;
|
|
6
|
+
agentId: boolean;
|
|
7
|
+
replyChannel: boolean;
|
|
8
|
+
replyTo: boolean;
|
|
9
|
+
replyAccountId: boolean;
|
|
10
|
+
};
|
|
11
|
+
export type EigenFluxServerConfig = {
|
|
12
|
+
enabled?: boolean;
|
|
13
|
+
name?: string;
|
|
14
|
+
endpoint?: string;
|
|
15
|
+
workdir?: string;
|
|
16
|
+
pollInterval?: number;
|
|
17
|
+
pmPollInterval?: number;
|
|
18
|
+
sessionKey?: string;
|
|
19
|
+
agentId?: string;
|
|
20
|
+
replyChannel?: string;
|
|
21
|
+
replyTo?: string;
|
|
22
|
+
replyAccountId?: string;
|
|
23
|
+
};
|
|
24
|
+
export type EigenFluxPluginConfig = {
|
|
25
|
+
gatewayUrl?: string;
|
|
26
|
+
gatewayToken?: string;
|
|
27
|
+
openclawCliBin?: string;
|
|
28
|
+
servers?: EigenFluxServerConfig[];
|
|
29
|
+
};
|
|
30
|
+
export type ResolvedEigenFluxServerConfig = {
|
|
31
|
+
enabled: boolean;
|
|
32
|
+
name: string;
|
|
33
|
+
endpoint: string;
|
|
34
|
+
workdir: string;
|
|
35
|
+
pollIntervalSec: number;
|
|
36
|
+
pmPollIntervalSec: number;
|
|
37
|
+
sessionKey: string;
|
|
38
|
+
agentId: string;
|
|
39
|
+
replyChannel?: string;
|
|
40
|
+
replyTo?: string;
|
|
41
|
+
replyAccountId?: string;
|
|
42
|
+
routeOverrides: NotificationRouteOverrides;
|
|
43
|
+
};
|
|
44
|
+
export type ResolvedEigenFluxPluginConfig = {
|
|
45
|
+
gatewayUrl: string;
|
|
46
|
+
gatewayToken?: string;
|
|
47
|
+
openclawCliBin: string;
|
|
48
|
+
servers: ResolvedEigenFluxServerConfig[];
|
|
49
|
+
};
|
|
50
|
+
type GlobalGatewayConfig = {
|
|
51
|
+
gateway?: {
|
|
52
|
+
auth?: {
|
|
53
|
+
token?: string;
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
export declare function expandHomeDir(input: string): string;
|
|
58
|
+
export declare function resolveServerSkillPath(server: {
|
|
59
|
+
endpoint: string;
|
|
60
|
+
workdir: string;
|
|
61
|
+
}): string;
|
|
62
|
+
export declare function resolvePluginConfig(pluginConfig: unknown, globalConfig?: GlobalGatewayConfig): ResolvedEigenFluxPluginConfig;
|
|
63
|
+
export declare const PLUGIN_CONFIG: {
|
|
64
|
+
readonly DEFAULT_SERVER_NAME: "eigenflux";
|
|
65
|
+
readonly DEFAULT_ENDPOINT: "https://www.eigenflux.ai";
|
|
66
|
+
readonly DEFAULT_GATEWAY_URL: "ws://127.0.0.1:18789";
|
|
67
|
+
readonly DEFAULT_SESSION_KEY: "main";
|
|
68
|
+
readonly DEFAULT_AGENT_ID: "main";
|
|
69
|
+
readonly DEFAULT_OPENCLAW_CLI_BIN: "openclaw";
|
|
70
|
+
readonly DEFAULT_POLL_INTERVAL_SEC: 300;
|
|
71
|
+
readonly DEFAULT_PM_POLL_INTERVAL_SEC: 60;
|
|
72
|
+
readonly CREDENTIALS_FILE: "credentials.json";
|
|
73
|
+
readonly PLUGIN_VERSION: "0.0.1-alpha.0";
|
|
74
|
+
readonly USER_AGENT: string;
|
|
75
|
+
};
|
|
76
|
+
export declare const PLUGIN_CONFIG_SCHEMA: {
|
|
77
|
+
readonly type: "object";
|
|
78
|
+
readonly additionalProperties: false;
|
|
79
|
+
readonly properties: {
|
|
80
|
+
readonly gatewayUrl: {
|
|
81
|
+
readonly type: "string";
|
|
82
|
+
readonly description: "OpenClaw Gateway WebSocket URL used for Gateway RPC fallback";
|
|
83
|
+
readonly default: "ws://127.0.0.1:18789";
|
|
84
|
+
};
|
|
85
|
+
readonly gatewayToken: {
|
|
86
|
+
readonly type: "string";
|
|
87
|
+
readonly description: "Optional gateway token override used for Gateway RPC fallback";
|
|
88
|
+
};
|
|
89
|
+
readonly openclawCliBin: {
|
|
90
|
+
readonly type: "string";
|
|
91
|
+
readonly description: "OpenClaw CLI binary used by runtime command and spawn fallbacks";
|
|
92
|
+
readonly default: "openclaw";
|
|
93
|
+
};
|
|
94
|
+
readonly servers: {
|
|
95
|
+
readonly type: "array";
|
|
96
|
+
readonly description: "Server list. When empty or when no server named eigenflux is provided, the plugin prepends a default eigenflux server.";
|
|
97
|
+
readonly default: readonly [];
|
|
98
|
+
readonly items: {
|
|
99
|
+
readonly type: "object";
|
|
100
|
+
readonly additionalProperties: false;
|
|
101
|
+
readonly properties: {
|
|
102
|
+
readonly enabled: {
|
|
103
|
+
readonly type: "boolean";
|
|
104
|
+
readonly description: "Enable or disable background polling for this server";
|
|
105
|
+
readonly default: true;
|
|
106
|
+
};
|
|
107
|
+
readonly name: {
|
|
108
|
+
readonly type: "string";
|
|
109
|
+
readonly description: "Server name used for routing, workdir defaults, and diagnostics";
|
|
110
|
+
readonly default: "eigenflux";
|
|
111
|
+
};
|
|
112
|
+
readonly endpoint: {
|
|
113
|
+
readonly type: "string";
|
|
114
|
+
readonly description: "EigenFlux API base URL for this server";
|
|
115
|
+
readonly default: "https://www.eigenflux.ai";
|
|
116
|
+
};
|
|
117
|
+
readonly workdir: {
|
|
118
|
+
readonly type: "string";
|
|
119
|
+
readonly description: "Directory used to store server credentials and remembered session state";
|
|
120
|
+
};
|
|
121
|
+
readonly pollInterval: {
|
|
122
|
+
readonly type: "integer";
|
|
123
|
+
readonly minimum: 1;
|
|
124
|
+
readonly description: "Feed polling interval in seconds for this server";
|
|
125
|
+
readonly default: 300;
|
|
126
|
+
};
|
|
127
|
+
readonly pmPollInterval: {
|
|
128
|
+
readonly type: "integer";
|
|
129
|
+
readonly minimum: 1;
|
|
130
|
+
readonly description: "Private message polling interval in seconds for this server";
|
|
131
|
+
readonly default: 60;
|
|
132
|
+
};
|
|
133
|
+
readonly sessionKey: {
|
|
134
|
+
readonly type: "string";
|
|
135
|
+
readonly description: "Target session key used by runtime.subagent and heartbeat fallback";
|
|
136
|
+
readonly default: "main";
|
|
137
|
+
};
|
|
138
|
+
readonly agentId: {
|
|
139
|
+
readonly type: "string";
|
|
140
|
+
readonly description: "Agent id used by Gateway agent and CLI fallbacks";
|
|
141
|
+
readonly default: "main";
|
|
142
|
+
};
|
|
143
|
+
readonly replyChannel: {
|
|
144
|
+
readonly type: "string";
|
|
145
|
+
readonly description: "Explicit reply channel used by Gateway agent and CLI fallbacks";
|
|
146
|
+
};
|
|
147
|
+
readonly replyTo: {
|
|
148
|
+
readonly type: "string";
|
|
149
|
+
readonly description: "Explicit reply target used by Gateway agent and CLI fallbacks";
|
|
150
|
+
};
|
|
151
|
+
readonly replyAccountId: {
|
|
152
|
+
readonly type: "string";
|
|
153
|
+
readonly description: "Optional reply account id for multi-account channel delivery";
|
|
154
|
+
};
|
|
155
|
+
};
|
|
156
|
+
};
|
|
157
|
+
};
|
|
158
|
+
};
|
|
159
|
+
};
|
|
160
|
+
export {};
|
|
161
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA;;GAEG;AAgBH,MAAM,MAAM,0BAA0B,GAAG;IACvC,UAAU,EAAE,OAAO,CAAC;IACpB,OAAO,EAAE,OAAO,CAAC;IACjB,YAAY,EAAE,OAAO,CAAC;IACtB,OAAO,EAAE,OAAO,CAAC;IACjB,cAAc,EAAE,OAAO,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IAClC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IAClC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,OAAO,CAAC,EAAE,qBAAqB,EAAE,CAAC;CACnC,CAAC;AAEF,MAAM,MAAM,6BAA6B,GAAG;IAC1C,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,eAAe,EAAE,MAAM,CAAC;IACxB,iBAAiB,EAA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