ascn-integrations

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

ASCN Integrations

ASCN集成

This document is normative. RFC2119 keywords (
MUST
,
SHOULD
,
MAY
) define required behavior.
本文档为规范性文档。RFC2119关键词(
MUST
SHOULD
MAY
)用于定义强制行为要求。

Mission

任务目标

Design and deliver missing capability as reusable ASCN integrations, then package them as user-visible plugins.
设计并交付缺失的功能,将其作为可复用的ASCN集成,然后打包为用户可见的插件。

When To Use

适用场景

Use this skill when a workflow task cannot be completed with existing handlers/triggers/tools.
Typical triggers:
  1. missing handler for a required API/service
  2. missing trigger type for required event source
  3. schema/contract mismatch blocks reliable workflow composition
  4. required UI ergonomics (
    params_ui
    , options, conditional fields) are missing
当现有处理器/触发器/工具无法完成工作流任务时,使用本技能。
典型触发场景:
  1. 缺少所需API/服务的处理器
  2. 缺少针对所需事件源的触发器类型
  3. Schema/契约不匹配阻碍了可靠的工作流组合
  4. 缺少所需的UI人机交互设计(
    params_ui
    、选项、条件字段)

Required Inputs

必需输入

The integrator MUST collect:
  1. workspace_id
    (UUID)
  2. capability gap summary (what cannot be built today)
  3. target use-cases (at least one concrete workflow scenario)
  4. expected input/output contract (JSON-level)
  5. auth/secret requirements
  6. publish target (
    user
    plugin first, system copy later)
If
workspace_id
or contract expectations are missing, stop and request them.
集成人员必须收集以下信息:
  1. workspace_id
    (UUID格式)
  2. 功能缺口总结(当前无法实现的功能)
  3. �目标用例(至少一个具体的工作流场景)
  4. 预期的输入/输出契约(JSON层级)
  5. 认证/密钥要求
  6. 发布目标(先发布为
    user
    插件,后续再发布系统副本)
如果缺少
workspace_id
或契约预期信息,需停止操作并请求补充。

Required MCP Tool Surface

必需的MCP工具集

  1. control.docs.get
  2. control.registry.list
  3. control.registry.details
  4. control.workflows.list
  5. control.workflows.describe
  6. control.workflows.validate
  7. control.workflows.create
  8. control.workflows.patch
  9. control.workflows.activate
  10. control.tools.ensure_export
  11. control.tools.list_exports
  12. control.plugins.create_plugin
  13. control.plugins.update_plugin
  14. control.plugins.list
  1. control.docs.get
  2. control.registry.list
  3. control.registry.details
  4. control.workflows.list
  5. control.workflows.describe
  6. control.workflows.validate
  7. control.workflows.create
  8. control.workflows.patch
  9. control.workflows.activate
  10. control.tools.ensure_export
  11. control.tools.list_exports
  12. control.plugins.create_plugin
  13. control.plugins.update_plugin
  14. control.plugins.list

Delivery Modes

交付模式

Mode A: Workflow-backed integration (preferred first)

模式A:基于工作流的集成(优先选择)

Use existing handlers to build a reusable workflow and export it through
Trigger.Tool
.
使用现有处理器构建可复用的工作流,并通过
Trigger.Tool
导出。

Mode B: Native integration (new handler/trigger code)

模式B:原生集成(新的处理器/触发器代码)

Use only when Mode A cannot satisfy latency, auth, determinism, or protocol constraints.
Native integrations MUST still be wrapped/published as plugins for user consumption.
仅当模式A无法满足延迟、认证、确定性或协议约束时使用。
原生集成仍必须封装为插件发布,以供用户使用。

Deterministic Flow

确定性流程

  1. Discover existing capability (
    control.registry.list
    ,
    control.registry.details
    ,
    control.tools.list_exports
    ).
  2. Produce contract draft:
    • canonical handler id (
      Vendor.Action
      )
    • params_schema
      (input object)
    • returns_schema
      (output object)
  3. Choose delivery mode (
    A
    or
    B
    ) with explicit reason.
  4. Implement integration.
  5. Validate workflow/config contract (
    control.workflows.validate
    ).
  6. Activate export (
    control.workflows.activate
    ,
    control.tools.ensure_export
    ).
  7. Bundle handlers into plugin (
    control.plugins.create_plugin
    then
    update_plugin
    if needed).
  8. Verify plugin visibility with
    control.plugins.list
    and registry views.
  1. 发现现有功能(
    control.registry.list
    control.registry.details
    control.tools.list_exports
    )。
  2. 生成契约草案:
    • 标准处理器ID(
      Vendor.Action
      格式)
    • params_schema
      (输入对象)
    • returns_schema
      (输出对象)
  3. 选择交付模式(
    A
    B
    )并说明明确理由。
  4. 实现集成。
  5. 验证工作流/配置契约(
    control.workflows.validate
    )。
  6. 激活导出(
    control.workflows.activate
    control.tools.ensure_export
    )。
  7. 将处理器打包为插件(先执行
    control.plugins.create_plugin
    ,必要时执行
    update_plugin
    )。
  8. 通过
    control.plugins.list
    和注册表视图验证插件可见性。

Plugin Packaging Rules

插件打包规则

  1. Plugin name MUST be stable and vendor/domain-scoped (e.g.
    StripeOps
    ,
    CRMHubspot
    ).
  2. Handler names MUST be canonical and collision-safe.
  3. One plugin MAY contain multiple handlers if they share domain and auth model.
  4. Plugin definitions SHOULD include UI metadata (
    name
    ,
    description
    ,
    icon
    ,
    tags
    ) before handoff.
  5. Unwrapped
    Trigger.Tool
    exports MUST still be user-visible as flat
    User.<Handler>
    entries.
  6. Wrapped/published handlers MUST be rendered as first-class plugin cards/forms with plugin metadata (
    name
    ,
    description
    ,
    icon
    ) and handler
    params_ui
    .
  1. 插件名称必须稳定,且按供应商/领域划分范围(例如
    StripeOps
    CRMHubspot
    )。
  2. 处理器名称必须是标准格式且避免冲突。
  3. 如果多个处理器共享同一领域和认证模型,可包含在同一个插件中。
  4. 移交前,插件定义应包含UI元数据(
    name
    description
    icon
    tags
    )。
  5. 未封装的
    Trigger.Tool
    导出仍需以扁平的
    User.<Handler>
    条目形式对用户可见。
  6. 已封装/发布的处理器必须以一等插件卡片/表单的形式展示,包含插件元数据(
    name
    description
    icon
    )和处理器的
    params_ui

Params UI Best Practices

Params UI最佳实践

params_ui
MUST be human-usable and contract-aligned.
  1. Every key in
    params_ui
    SHOULD exist in
    params_schema.properties
    .
  2. Localize labels/hints where possible (
    en
    ,
    ru
    ).
  3. Prefer explicit controls:
    • string
      ,
      string_multiline
      ,
      number
      ,
      boolean
      ,
      options
      ,
      array
      ,
      object
      ,
      string_json
  4. Use conditional visibility for complex forms via
    displayOptions.show
    .
  5. Put dangerous/advanced options behind conditional toggles.
  6. Include safe defaults where deterministic behavior is expected.
  7. Use
    options
    only for selectable values; use
    displayOptions.show
    only for conditional visibility.
  8. Keep field order identical to the execution mental model (auth -> target -> behavior -> advanced).
Example conditional field pattern:
json
[
  {
    "key": "auth_mode",
    "control": "options",
    "label": {"en": "Auth mode"},
    "options": [
      {"value": "api_key", "label": {"en": "API key"}},
      {"value": "oauth", "label": {"en": "OAuth"}}
    ]
  },
  {
    "key": "api_key",
    "control": "string",
    "label": {"en": "API key"},
    "displayOptions": {"show": {"auth_mode": ["api_key"]}}
  }
]
Minimal
params_ui
field contract (recommended):
json
{
  "key": "string",
  "control": "string|string_multiline|number|boolean|options|array|object|string_json",
  "label": {"en": "Field label"},
  "hint": {"en": "Optional guidance"},
  "required": false,
  "default": null,
  "options": [
    {"value": "v1", "label": {"en": "Value 1"}}
  ],
  "displayOptions": {"show": {"other_key": ["match_value"]}}
}
Rules for this contract:
  1. options
    MUST exist only when
    control=options
    .
  2. displayOptions.show
    MUST reference keys that exist in the same
    params_ui
    .
  3. required=true
    fields SHOULD be present in
    params_schema.required
    .
  4. Secret-bearing fields SHOULD use hints directing users to secrets, not literal defaults.
params_ui
必须易于人类使用且与契约保持一致。
  1. params_ui
    中的每个键都应存在于
    params_schema.properties
    中。
  2. 尽可能本地化标签/提示信息(支持
    en
    ru
    )。
  3. 优先使用明确的控件类型:
    • string
      string_multiline
      number
      boolean
      options
      array
      object
      string_json
  4. 通过
    displayOptions.show
    为复杂表单设置条件可见性。
  5. 将危险/高级选项放在条件切换开关之后。
  6. 在预期确定性行为的场景中提供安全默认值。
  7. 仅对可选值使用
    options
    ;仅对条件可见性使用
    displayOptions.show
  8. 字段顺序应与执行逻辑的思维模型一致(认证 -> 目标 -> 行为 -> 高级选项)。
示例条件字段模式:
json
[
  {
    "key": "auth_mode",
    "control": "options",
    "label": {"en": "Auth mode"},
    "options": [
      {"value": "api_key", "label": {"en": "API key"}},
      {"value": "oauth", "label": {"en": "OAuth"}}
    ]
  },
  {
    "key": "api_key",
    "control": "string",
    "label": {"en": "API key"},
    "displayOptions": {"show": {"auth_mode": ["api_key"]}}
  }
]
推荐的最小
params_ui
字段契约:
json
{
  "key": "string",
  "control": "string|string_multiline|number|boolean|options|array|object|string_json",
  "label": {"en": "Field label"},
  "hint": {"en": "Optional guidance"},
  "required": false,
  "default": null,
  "options": [
    {"value": "v1", "label": {"en": "Value 1"}}
  ],
  "displayOptions": {"show": {"other_key": ["match_value"]}}
}
本契约规则:
  1. 仅当
    control=options
    时,
    options
    字段才必须存在。
  2. displayOptions.show
    必须引用同一
    params_ui
    中存在的键。
  3. required=true
    的字段应出现在
    params_schema.required
    中。
  4. 承载密钥的字段应使用提示信息引导用户使用密钥,而非提供字面默认值。

Security & Secrets

安全与密钥

  1. Credentials MUST come from secrets (
    ={{ $secrets.name }}
    ), never literals.
  2. params_schema
    SHOULD mark required secret-driven fields clearly.
  3. Integration MUST document minimum secret set for successful invocation.
  1. 凭证必须来自密钥存储(
    ={{ $secrets.name }}
    ),绝不能使用字面量。
  2. params_schema
    应清晰标记需要密钥驱动的必填字段。
  3. 集成必须记录成功调用所需的最小密钥集合。

Output Contract

输出契约

Every completion MUST include:
json
{
  "integration": {
    "mode": "workflow|native",
    "capability_status": "implemented",
    "handler_names": ["Vendor.Action"]
  },
  "plugin": {
    "plugin_name": "VendorOps",
    "created_or_updated": true
  },
  "verification": {
    "validated": true,
    "activated": true,
    "visible_in_plugins_list": true
  },
  "open_items": []
}
每个完成的任务必须包含以下内容:
json
{
  "integration": {
    "mode": "workflow|native",
    "capability_status": "implemented",
    "handler_names": ["Vendor.Action"]
  },
  "plugin": {
    "plugin_name": "VendorOps",
    "created_or_updated": true
  },
  "verification": {
    "validated": true,
    "activated": true,
    "visible_in_plugins_list": true
  },
  "open_items": []
}

Hand-off Back To ASCN Operator

移交回ASCN操作员

After integration delivery:
  1. return canonical handler/plugin identifiers
  2. return required secrets and minimal invocation payload
  3. instruct caller to resume lifecycle operations with
    ascn-operator
集成交付完成后:
  1. 返回标准的处理器/插件标识符
  2. 返回所需的密钥和最小调用负载
  3. 指导调用者使用
    ascn-operator
    恢复生命周期操作