@artflo-ai/artflo-openclaw-plugin 0.0.6 → 0.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.
@@ -0,0 +1,9 @@
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
+ }
@@ -457,7 +457,15 @@ export function registerArtfloTools(api, context) {
457
457
  api.registerTool({
458
458
  name: ARTFLO_TOOL_NAMES.listModels,
459
459
  label: 'Artflo Canvas List Models',
460
- description: 'List all available AI models with their names, subscription requirements, default status, and credit costs. Video model credits are per-second. Use this to help users understand what models are available before planning a workflow.',
460
+ description: 'List all available AI models. When presenting results to the user, you MUST show ALL of these fields in a table: ' +
461
+ '1) Model name (use model_name, NEVER expose model_key to user) ' +
462
+ '2) Credits (base price; if resolutionPricing exists, show per-resolution prices) ' +
463
+ '3) Supported resolutions ' +
464
+ '4) Supported ratios ' +
465
+ '5) Subscription required (if only certain resolutions require subscription via multi_subscribe, specify which ones) ' +
466
+ '6) Default model marker ' +
467
+ '7) Supported durations (video models only). ' +
468
+ 'Do NOT omit any of these fields. Video model credits are per-second.',
461
469
  parameters: Type.Object({
462
470
  canvasId: Type.String({ minLength: 1 }),
463
471
  category: Type.Optional(Type.String({
@@ -508,7 +516,7 @@ export function registerArtfloTools(api, context) {
508
516
  return [
509
517
  label,
510
518
  {
511
- credits: isVideo ? `${price} credits/sec` : `${price} credits`,
519
+ credits: `${price} credits`,
512
520
  ...(needsSub ? { requiresSubscription: true } : {}),
513
521
  },
514
522
  ];
@@ -520,9 +528,7 @@ export function registerArtfloTools(api, context) {
520
528
  isDefault: m.is_default,
521
529
  requiresSubscription: m.subscribe_available,
522
530
  available: modelAvailable,
523
- credits: isVideo
524
- ? `${m.price} credits/sec`
525
- : `${m.price} credits`,
531
+ maxCredits: `${m.price} credits`,
526
532
  };
527
533
  if (m.support_resolution?.length) {
528
534
  item.supportedResolutions = m.support_resolution;
@@ -590,6 +596,13 @@ export function registerArtfloTools(api, context) {
590
596
  parameters: Type.Object({}),
591
597
  async execute(_id, params) {
592
598
  return runWithToolTrace(ARTFLO_TOOL_NAMES.getUserStatus, params, async () => {
599
+ if (!context.config.apiKey) {
600
+ return jsonResult({
601
+ ok: false,
602
+ label: ARTFLO_TOOL_NAMES.getUserStatus,
603
+ error: 'API Key not configured. Use artflo_set_api_key to set it first.',
604
+ });
605
+ }
593
606
  const status = await fetchUserStatus(context.config);
594
607
  return jsonResult({
595
608
  ok: true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@artflo-ai/artflo-openclaw-plugin",
3
- "version": "0.0.6",
3
+ "version": "0.0.8",
4
4
  "type": "module",
5
5
  "description": "OpenClaw plugin that connects directly to Artflo canvas WebSocket runtime.",
6
6
  "keywords": [
@@ -24,17 +24,17 @@ metadata:
24
24
 
25
25
  ## API Key 配置检查(首要步骤)
26
26
 
27
- 在执行任何操作之前,先调用 `artflo_canvas_connection_status` `artflo_canvas_connect` 检查连接。如果返回结果中 `hasApiKey: false`,说明用户还没有配置 API Key。此时你必须:
27
+ **如果 before_prompt_build 注入的上下文显示 `apiKey=未配置`,则:**
28
28
 
29
- 1. 停止所有后续操作,不要尝试创建画布或执行工作流。
30
- 2. 引导用户提供 API Key,用以下话术:
29
+ 1. **禁止调用除 `artflo_set_api_key` 以外的任何 Artflo 工具。** 没有 API Key,所有接口都会返回 401。
30
+ 2. 引导用户提供 API Key
31
31
 
32
32
  > 你还没有配置 Artflo API Key,需要先设置才能使用画布功能。
33
33
  >
34
34
  > 请登录 [artflo.ai](https://artflo.ai),在设置页面获取 API Key,然后直接发给我,我帮你配置好。
35
35
 
36
36
  3. 当用户发来 API Key 后,调用 `artflo_set_api_key` 工具保存到配置中。
37
- 4. 保存成功后,gateway 会自动重新加载配置,稍等片刻即可正常使用所有画布功能。
37
+ 4. 保存成功后,gateway 会自动重新加载配置。**告诉用户配置已保存,需要等待约 10 秒让 gateway 重载完成,然后开始新会话(/new)再继续操作。** 不要在当前会话中立即调用其他 Artflo 工具,因为 gateway 重载期间旧的 config(没有 API Key)仍在内存中。
38
38
 
39
39
  ## 操作策略
40
40
 
@@ -50,6 +50,16 @@ metadata:
50
50
  - **禁止编造 API URL**:不要自行拼接或猜测 Artflo API 路径。所有 API 交互必须通过插件提供的 tool 完成(如 `artflo_canvas_get_last`、`artflo_canvas_create`、`artflo_upload_file` 等)。不要使用 `fetch` 或 `curl` 直接调用 Artflo API。
51
51
  - **model_key 保密**:`model_key`(如 `Praline_2`、`ToffeeV1-Lite`)是内部标识,仅供构建 plan 使用。向用户展示模型时只使用 `model_name`(显示名称),绝不向用户暴露 `model_key`。
52
52
  - **资源保存路径**:画布生成完成后需要下载保存的资源(图片、视频等),必须保存到 `/artflo/outbound` 目录。不要使用 `/tmp` 或其他临时目录。
53
+ - **环境设置保密**:不要主动向用户提及或暴露环境切换功能(release/test)。只有当用户明确提到要切换环境、设置 test 环境时,才使用 `artflo_set_api_key` 的 `env` 参数。
54
+ - **品牌名称规范**:产品名称是 **Artflo**(A 大写,其余小写)。不要写成 ArtFlo、ARTFLO、artFlo 或其他变体。所有面向用户的文字中必须使用正确的大小写。
55
+ - **模型列表展示规范**:当用户查看模型列表时,必须展示以下字段,不要省略:
56
+ - 模型名(model_name,不是 model_key)
57
+ - 积分消耗(基础价格;如有按分辨率差异化价格则展示各分辨率价格)
58
+ - 支持的分辨率
59
+ - 支持的比例
60
+ - 是否需要订阅(如果只有部分分辨率需要订阅,要明确标注哪些分辨率需要订阅)
61
+ - 是否默认模型
62
+ - 支持的时长(仅视频模型)
53
63
  - 当插件布局引擎可用时,不要手工编造节点坐标。
54
64
 
55
65
  ## 默认编辑规则