@susu-eng/gralkor 26.0.6 → 26.0.8
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 +36 -7
- package/dist/cli/commands/install.d.ts.map +1 -1
- package/dist/cli/commands/install.js +1 -29
- package/dist/cli/commands/install.js.map +1 -1
- package/dist/cli/lib/openclaw.d.ts +7 -8
- package/dist/cli/lib/openclaw.d.ts.map +1 -1
- package/dist/cli/lib/openclaw.js +21 -29
- package/dist/cli/lib/openclaw.js.map +1 -1
- package/openclaw.plugin.json +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -57,24 +57,53 @@ The agent gets a unified memory interface where it doesn't need to think about w
|
|
|
57
57
|
**Using the CLI helper (recommended):**
|
|
58
58
|
|
|
59
59
|
```bash
|
|
60
|
-
npx @susu-eng/gralkor install
|
|
60
|
+
npx @susu-eng/gralkor@latest install
|
|
61
61
|
```
|
|
62
62
|
|
|
63
|
-
|
|
63
|
+
Use `@latest` to bypass npm's cache and always get the newest version. You can also pass config inline:
|
|
64
64
|
|
|
65
65
|
```bash
|
|
66
|
-
npx @susu-eng/gralkor install \
|
|
66
|
+
npx @susu-eng/gralkor@latest install \
|
|
67
67
|
--config '{"llm":{"provider":"openai","model":"gpt-4.1-mini"}}'
|
|
68
68
|
```
|
|
69
69
|
|
|
70
70
|
Or from a tarball:
|
|
71
71
|
|
|
72
72
|
```bash
|
|
73
|
-
npx @susu-eng/gralkor install /path/to/susu-eng-gralkor-memory-19.0.4.tgz
|
|
73
|
+
npx @susu-eng/gralkor@latest install /path/to/susu-eng-gralkor-memory-19.0.4.tgz
|
|
74
74
|
```
|
|
75
75
|
|
|
76
76
|
The install is idempotent — running it again with the same version is a no-op.
|
|
77
77
|
|
|
78
|
+
**What the installer handles:**
|
|
79
|
+
|
|
80
|
+
1. Checks the installed version — skips if already current, uninstalls the old version if upgrading
|
|
81
|
+
2. Runs `openclaw plugins install @susu-eng/gralkor@latest` (tolerates config warnings from stale references)
|
|
82
|
+
3. Applies any `--config`/`--set` values
|
|
83
|
+
|
|
84
|
+
The installer does **not** modify `plugins.slots.memory` or `plugins.allow` — those are your responsibility.
|
|
85
|
+
|
|
86
|
+
**Recommended sequencing for init scripts:**
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
# 1. Set allowlist (before install, so openclaw commands don't warn)
|
|
90
|
+
openclaw config set --json plugins.allow '["gralkor", ...]'
|
|
91
|
+
|
|
92
|
+
# 2. Install (or upgrade) the plugin
|
|
93
|
+
npx @susu-eng/gralkor@latest install
|
|
94
|
+
|
|
95
|
+
# 3. Assign the memory slot (after install, so the plugin exists)
|
|
96
|
+
openclaw config set plugins.slots.memory gralkor
|
|
97
|
+
|
|
98
|
+
# 4. Plugin config (via install flags or directly)
|
|
99
|
+
openclaw config set plugins.entries.gralkor.config.test true
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
**Other prerequisites:**
|
|
103
|
+
|
|
104
|
+
- **API keys**: Set `GOOGLE_API_KEY` (default), `OPENAI_API_KEY`, or the relevant provider key in the environment before starting OpenClaw.
|
|
105
|
+
- **`uv`**: Must be on PATH. The installer does not install it.
|
|
106
|
+
|
|
78
107
|
**Manual install:**
|
|
79
108
|
|
|
80
109
|
```bash
|
|
@@ -160,16 +189,16 @@ In memory mode, `memory_search` searches both the knowledge graph and native Mar
|
|
|
160
189
|
|
|
161
190
|
### Lifecycle management
|
|
162
191
|
|
|
163
|
-
Run via `npx @susu-eng/gralkor` or install globally:
|
|
192
|
+
Run via `npx @susu-eng/gralkor@latest` or install globally:
|
|
164
193
|
|
|
165
194
|
```bash
|
|
166
|
-
gralkor install # Self-install from npm (default: @susu-eng/gralkor)
|
|
195
|
+
gralkor install # Self-install from npm (default: @susu-eng/gralkor@latest)
|
|
167
196
|
gralkor config --set llm.model=gpt-4.1-mini # Set plugin config
|
|
168
197
|
gralkor check # Pre-flight: uv, API keys, plugin state, server health
|
|
169
198
|
gralkor status # Plugin version, slot, server health, graph stats
|
|
170
199
|
```
|
|
171
200
|
|
|
172
|
-
The `install` command handles version comparison, upgrades,
|
|
201
|
+
The `install` command handles version comparison, upgrades, and optional `--config`/`--set` flags.
|
|
173
202
|
|
|
174
203
|
### Plugin commands (via OpenClaw)
|
|
175
204
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"install.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/install.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,EAAE,CAAC;CAChB;AAOD,wBAAsB,OAAO,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"install.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/install.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,EAAE,CAAC;CAChB;AAOD,wBAAsB,OAAO,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CA+EjE"}
|
|
@@ -23,12 +23,6 @@ export async function install(opts) {
|
|
|
23
23
|
return;
|
|
24
24
|
}
|
|
25
25
|
const targetVersion = extractVersionFromTarball(source) ?? extractVersionFromNpmRef(source);
|
|
26
|
-
// 3. Clear stale memory slot before listing plugins.
|
|
27
|
-
// The init script or prior install may have set plugins.slots.memory: gralkor
|
|
28
|
-
// before the plugin directory exists, making all openclaw commands fail with
|
|
29
|
-
// "Config invalid: plugin not found". Clear it upfront — we'll set it back
|
|
30
|
-
// at the end after install succeeds.
|
|
31
|
-
await oc.setConfig("plugins.slots.memory", "").catch(() => { });
|
|
32
26
|
let plugins;
|
|
33
27
|
try {
|
|
34
28
|
plugins = await oc.getInstalledPlugins();
|
|
@@ -62,19 +56,6 @@ export async function install(opts) {
|
|
|
62
56
|
execute: () => oc.uninstallPlugin("gralkor"),
|
|
63
57
|
});
|
|
64
58
|
}
|
|
65
|
-
else if (!current) {
|
|
66
|
-
// Plugin not in list but directory or config metadata may exist — clean up both.
|
|
67
|
-
// uninstallPlugin may fail if the plugin isn't tracked, so fall back to
|
|
68
|
-
// removing the extension directory and config entries directly.
|
|
69
|
-
actions.push({
|
|
70
|
-
description: "Remove stale gralkor install (if present)",
|
|
71
|
-
execute: async () => {
|
|
72
|
-
await oc.uninstallPlugin("gralkor").catch(() => { });
|
|
73
|
-
await oc.removePluginDir("gralkor");
|
|
74
|
-
await oc.unsetConfig("plugins.entries.gralkor").catch(() => { });
|
|
75
|
-
},
|
|
76
|
-
});
|
|
77
|
-
}
|
|
78
59
|
// 5. Install
|
|
79
60
|
if (needsInstall) {
|
|
80
61
|
actions.push({
|
|
@@ -82,16 +63,7 @@ export async function install(opts) {
|
|
|
82
63
|
execute: () => oc.installPlugin(source),
|
|
83
64
|
});
|
|
84
65
|
}
|
|
85
|
-
// 6.
|
|
86
|
-
actions.push({
|
|
87
|
-
description: "Enable gralkor",
|
|
88
|
-
execute: () => oc.enablePlugin("gralkor"),
|
|
89
|
-
});
|
|
90
|
-
actions.push({
|
|
91
|
-
description: "Set memory slot → gralkor",
|
|
92
|
-
execute: () => oc.setConfig("plugins.slots.memory", "gralkor"),
|
|
93
|
-
});
|
|
94
|
-
// 7. Config
|
|
66
|
+
// 6. Config
|
|
95
67
|
const configEntries = buildConfigEntries(opts);
|
|
96
68
|
for (const [key, value] of configEntries) {
|
|
97
69
|
actions.push({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"install.js","sourceRoot":"","sources":["../../../src/cli/commands/install.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,KAAK,EAAE,MAAM,oBAAoB,CAAC;AACzC,OAAO,E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xC,CAAC,CAAC;IACL,CAAC;IAED,YAAY;IACZ,MAAM,aAAa,GAAG,kBAAkB,CAAC,IAAI,CAAC,CAAC;IAC/C,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,aAAa,EAAE,CAAC;QACzC,OAAO,CAAC,IAAI,CAAC;YACX,WAAW,EAAE,cAAc,GAAG,MAAM,KAAK,EAAE;YAC3C,OAAO,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC,SAAS,CAAC,kCAAkC,GAAG,EAAE,EAAE,KAAK,CAAC;SAC5E,CAAC,CAAC;IACL,CAAC;IAED,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;QAC7B,GAAG,CAAC,OAAO,MAAM,CAAC,WAAW,EAAE,CAAC,CAAC;QACjC,MAAM,MAAM,CAAC,OAAO,EAAE,CAAC;IACzB,CAAC;IAED,GAAG,CAAC,SAAS,CAAC,CAAC;AACjB,CAAC"}
|
|
@@ -13,16 +13,15 @@ export declare function checkOpenclaw(): Promise<string>;
|
|
|
13
13
|
export declare function parsePluginList(stdout: string): PluginInfo[];
|
|
14
14
|
export declare function getInstalledPlugins(): Promise<PluginInfo[]>;
|
|
15
15
|
export declare function getPluginInfo(pluginId: string): Promise<PluginInfo | null>;
|
|
16
|
-
export declare function installPlugin(source: string): Promise<void>;
|
|
17
|
-
export declare function uninstallPlugin(pluginId: string): Promise<void>;
|
|
18
16
|
/**
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
17
|
+
* Check if openclaw output contains only config warnings (no real errors).
|
|
18
|
+
* openclaw plugins install exits non-zero for stale config references
|
|
19
|
+
* (e.g. plugins.allow referencing a not-yet-installed plugin).
|
|
20
|
+
* These are harmless — the install succeeded despite the exit code.
|
|
22
21
|
*/
|
|
23
|
-
export declare function
|
|
24
|
-
export declare function
|
|
22
|
+
export declare function isConfigWarningOnly(output: string): boolean;
|
|
23
|
+
export declare function installPlugin(source: string): Promise<void>;
|
|
24
|
+
export declare function uninstallPlugin(pluginId: string): Promise<void>;
|
|
25
25
|
export declare function setConfig(key: string, value: string): Promise<void>;
|
|
26
26
|
export declare function getConfig(key: string): Promise<string | null>;
|
|
27
|
-
export declare function unsetConfig(key: string): Promise<void>;
|
|
28
27
|
//# sourceMappingURL=openclaw.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"openclaw.d.ts","sourceRoot":"","sources":["../../../src/cli/lib/openclaw.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"openclaw.d.ts","sourceRoot":"","sources":["../../../src/cli/lib/openclaw.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,OAAO,EAAE,OAAO,CAAC;CAClB;AAgCD,wBAAsB,aAAa,IAAI,OAAO,CAAC,MAAM,CAAC,CAMrD;AAED,wEAAwE;AACxE,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,UAAU,EAAE,CAiB5D;AAED,wBAAsB,mBAAmB,IAAI,OAAO,CAAC,UAAU,EAAE,CAAC,CAMjE;AAED,wBAAsB,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC,CAGhF;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAK3D;AAED,wBAAsB,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAKjE;AAED,wBAAsB,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAKrE;AAID,wBAAsB,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAKzE;AAED,wBAAsB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAKnE"}
|
package/dist/cli/lib/openclaw.js
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
import { execFile } from "node:child_process";
|
|
2
|
-
import { rm } from "node:fs/promises";
|
|
3
|
-
import { join } from "node:path";
|
|
4
|
-
import { homedir } from "node:os";
|
|
5
2
|
import { promisify } from "node:util";
|
|
6
3
|
const execFileAsync = promisify(execFile);
|
|
7
4
|
async function exec(args) {
|
|
@@ -13,11 +10,15 @@ async function exec(args) {
|
|
|
13
10
|
}
|
|
14
11
|
catch (err) {
|
|
15
12
|
if (isExecError(err)) {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
13
|
+
const stdout = err.stdout ?? "";
|
|
14
|
+
const stderr = err.stderr ?? "";
|
|
15
|
+
const exitCode = err.code ?? 1;
|
|
16
|
+
// openclaw exits non-zero for stale config warnings (e.g. plugins.allow
|
|
17
|
+
// referencing a not-yet-installed plugin). These are harmless — treat as success.
|
|
18
|
+
if (isConfigWarningOnly(stderr || stdout)) {
|
|
19
|
+
return { stdout, stderr, exitCode: 0 };
|
|
20
|
+
}
|
|
21
|
+
return { stdout, stderr, exitCode };
|
|
21
22
|
}
|
|
22
23
|
throw new Error("openclaw not found on PATH. Install: https://docs.openclaw.ai/install");
|
|
23
24
|
}
|
|
@@ -62,6 +63,18 @@ export async function getPluginInfo(pluginId) {
|
|
|
62
63
|
const plugins = await getInstalledPlugins();
|
|
63
64
|
return plugins.find((p) => p.id === pluginId) ?? null;
|
|
64
65
|
}
|
|
66
|
+
/**
|
|
67
|
+
* Check if openclaw output contains only config warnings (no real errors).
|
|
68
|
+
* openclaw plugins install exits non-zero for stale config references
|
|
69
|
+
* (e.g. plugins.allow referencing a not-yet-installed plugin).
|
|
70
|
+
* These are harmless — the install succeeded despite the exit code.
|
|
71
|
+
*/
|
|
72
|
+
export function isConfigWarningOnly(output) {
|
|
73
|
+
return output.includes("Config warnings:") &&
|
|
74
|
+
!output.includes("ENOENT") &&
|
|
75
|
+
!output.includes("npm error") &&
|
|
76
|
+
!output.includes("404");
|
|
77
|
+
}
|
|
65
78
|
export async function installPlugin(source) {
|
|
66
79
|
const result = await exec(["plugins", "install", source]);
|
|
67
80
|
if (result.exitCode !== 0) {
|
|
@@ -74,21 +87,6 @@ export async function uninstallPlugin(pluginId) {
|
|
|
74
87
|
throw new Error(`Uninstall failed: ${result.stderr || result.stdout}`);
|
|
75
88
|
}
|
|
76
89
|
}
|
|
77
|
-
/**
|
|
78
|
-
* Remove a plugin's extension directory directly.
|
|
79
|
-
* Fallback for untracked plugins that `openclaw plugins uninstall` can't handle
|
|
80
|
-
* because the plugin exists on disk but isn't in the plugin list.
|
|
81
|
-
*/
|
|
82
|
-
export async function removePluginDir(pluginId) {
|
|
83
|
-
const dir = join(homedir(), ".openclaw", "extensions", pluginId);
|
|
84
|
-
await rm(dir, { recursive: true, force: true });
|
|
85
|
-
}
|
|
86
|
-
export async function enablePlugin(pluginId) {
|
|
87
|
-
const result = await exec(["plugins", "enable", pluginId]);
|
|
88
|
-
if (result.exitCode !== 0) {
|
|
89
|
-
throw new Error(`Enable failed: ${result.stderr || result.stdout}`);
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
90
|
export async function setConfig(key, value) {
|
|
93
91
|
const result = await exec(["config", "set", key, value]);
|
|
94
92
|
if (result.exitCode !== 0) {
|
|
@@ -102,10 +100,4 @@ export async function getConfig(key) {
|
|
|
102
100
|
const val = result.stdout.trim();
|
|
103
101
|
return val || null;
|
|
104
102
|
}
|
|
105
|
-
export async function unsetConfig(key) {
|
|
106
|
-
const result = await exec(["config", "unset", key]);
|
|
107
|
-
if (result.exitCode !== 0) {
|
|
108
|
-
throw new Error(`Config unset failed: ${result.stderr || result.stdout}`);
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
103
|
//# sourceMappingURL=openclaw.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"openclaw.js","sourceRoot":"","sources":["../../../src/cli/lib/openclaw.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"openclaw.js","sourceRoot":"","sources":["../../../src/cli/lib/openclaw.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEtC,MAAM,aAAa,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAC;AAc1C,KAAK,UAAU,IAAI,CAAC,IAAc;IAChC,IAAI,CAAC;QACH,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,aAAa,CAAC,UAAU,EAAE,IAAI,EAAE;YAC/D,OAAO,EAAE,MAAM;SAChB,CAAC,CAAC;QACH,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,EAAE,CAAC;IACzC,CAAC;IAAC,OAAO,GAAY,EAAE,CAAC;QACtB,IAAI,WAAW,CAAC,GAAG,CAAC,EAAE,CAAC;YACrB,MAAM,MAAM,GAAG,GAAG,CAAC,MAAM,IAAI,EAAE,CAAC;YAChC,MAAM,MAAM,GAAG,GAAG,CAAC,MAAM,IAAI,EAAE,CAAC;YAChC,MAAM,QAAQ,GAAG,GAAG,CAAC,IAAI,IAAI,CAAC,CAAC;YAC/B,wEAAwE;YACxE,kFAAkF;YAClF,IAAI,mBAAmB,CAAC,MAAM,IAAI,MAAM,CAAC,EAAE,CAAC;gBAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,EAAE,CAAC;YACzC,CAAC;YACD,OAAO,EAAE,MAAM,EAAE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