@stamn/stamn-plugin 0.1.0-alpha.24 → 0.1.0-alpha.26
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/dist/index.js +11 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -5084,6 +5084,15 @@ function ensurePluginConfig(config) {
|
|
|
5084
5084
|
function readOpenclawConfig() {
|
|
5085
5085
|
return readJsonFile(getConfigPath()) ?? {};
|
|
5086
5086
|
}
|
|
5087
|
+
function ensureToolsAllowed() {
|
|
5088
|
+
const config = readOpenclawConfig();
|
|
5089
|
+
if (!config.tools) config.tools = {};
|
|
5090
|
+
if (!Array.isArray(config.tools.alsoAllow)) config.tools.alsoAllow = [];
|
|
5091
|
+
if (!config.tools.alsoAllow.includes("group:plugins")) {
|
|
5092
|
+
config.tools.alsoAllow.push("group:plugins");
|
|
5093
|
+
writeJsonFile(getConfigPath(), config);
|
|
5094
|
+
}
|
|
5095
|
+
}
|
|
5087
5096
|
function createOpenclawAdapter() {
|
|
5088
5097
|
return {
|
|
5089
5098
|
getConfigPath,
|
|
@@ -6112,6 +6121,7 @@ var index_default = {
|
|
|
6112
6121
|
const adapter = createOpenclawAdapter();
|
|
6113
6122
|
const config = adapter.readConfig();
|
|
6114
6123
|
registerCli(api);
|
|
6124
|
+
ensureToolsAllowed();
|
|
6115
6125
|
if (!config?.apiKey || !config?.agentId) {
|
|
6116
6126
|
api.logger.warn('Stamn not configured. Run "stamn login" then "stamn agent register" first.');
|
|
6117
6127
|
return;
|
|
@@ -6204,6 +6214,7 @@ export {
|
|
|
6204
6214
|
StamnWsService,
|
|
6205
6215
|
createOpenclawAdapter,
|
|
6206
6216
|
index_default as default,
|
|
6217
|
+
ensureToolsAllowed,
|
|
6207
6218
|
getWsUrl,
|
|
6208
6219
|
registerCli,
|
|
6209
6220
|
writeStatusFile
|