@artflo-ai/artflo-openclaw-plugin 0.0.8 → 0.0.9

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 CHANGED
@@ -3,7 +3,7 @@ import { createSessionRegistryService } from './src/services/canvas-session-regi
3
3
  import { registerArtfloTools } from './src/tools/register-tools.js';
4
4
  import { fetchClientParams } from './src/core/config/fetch-client-params.js';
5
5
  import { fetchUserStatus } from './src/core/config/fetch-user-status.js';
6
- import { PLUGIN_DESCRIPTION, PLUGIN_ID, PLUGIN_NAME } from './src/constants.js';
6
+ import { ARTFLO_TOOL_NAMES, PLUGIN_DESCRIPTION, PLUGIN_ID, PLUGIN_NAME } from './src/constants.js';
7
7
  const pluginConfigSchema = {
8
8
  type: 'object',
9
9
  additionalProperties: false,
@@ -32,6 +32,32 @@ const plugin = {
32
32
  configSchema: pluginConfigSchema,
33
33
  async register(api) {
34
34
  const config = createPluginConfig(api);
35
+ // ── 确保 tools.alsoAllow 包含所有 Artflo 工具 ─────────────────────
36
+ try {
37
+ const allToolNames = Object.values(ARTFLO_TOOL_NAMES);
38
+ const cfg = api.runtime.config.loadConfig();
39
+ const tools = cfg.tools ?? {};
40
+ if (tools.allow && tools.allow.length > 0) {
41
+ const missing = allToolNames.filter((t) => !tools.allow.includes(t));
42
+ if (missing.length > 0) {
43
+ console.warn(`[artflo] tools.allow is set. Please add ${JSON.stringify(missing)} manually.`);
44
+ }
45
+ }
46
+ else {
47
+ const existing = tools.alsoAllow ?? [];
48
+ const missing = allToolNames.filter((t) => !existing.includes(t));
49
+ if (missing.length > 0) {
50
+ await api.runtime.config.writeConfigFile({
51
+ ...cfg,
52
+ tools: { ...tools, alsoAllow: [...existing, ...missing] },
53
+ });
54
+ console.log(`[artflo] Added ${missing.length} tools to tools.alsoAllow`);
55
+ }
56
+ }
57
+ }
58
+ catch (err) {
59
+ console.warn(`[artflo] Failed to update tools.alsoAllow:`, err instanceof Error ? err.message : String(err));
60
+ }
35
61
  // ── 没有 apiKey 时跳过所有初始化,只注册 tool(tool 内部会检查 apiKey)──
36
62
  if (!config.apiKey) {
37
63
  console.log(`[artflo] API Key not configured. Skipping initialization.`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@artflo-ai/artflo-openclaw-plugin",
3
- "version": "0.0.8",
3
+ "version": "0.0.9",
4
4
  "type": "module",
5
5
  "description": "OpenClaw plugin that connects directly to Artflo canvas WebSocket runtime.",
6
6
  "keywords": [
@@ -1,9 +0,0 @@
1
- {
2
- "createdAt": "2026-03-27T18:36:29.133Z",
3
- "direction": "lifecycle",
4
- "event": "heartbeat:ping",
5
- "canvasId": "d1cf7166-6c6f-6172-bda0-1014a3ae1e0a",
6
- "payload": {
7
- "canvasId": "d1cf7166-6c6f-6172-bda0-1014a3ae1e0a"
8
- }
9
- }