Skip to content

ichendev/hello-runtime

v1.0.0MIT

A worked example of the C2 plugin protocol: a Node process that contributes a command, calls one of the host's, and listens for host events.

What this package declares

The file a client reads when it loads this plugin, exactly as this revision carries it.

plugin.json
{
  "$schema": "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json",
  "name": "hello-runtime",
  "version": "1.0.0",
  "description": "A worked example of the C2 plugin protocol: a Node process that contributes a command, calls one of the host's, and listens for host events.",
  "author": { "name": "C2" },
  "license": "MIT",
  "keywords": ["example", "plugin-protocol", "runtime"],
  "extensions": {
    "dev.codetwo": {
      "standardVersion": "1.2.0",
      "commands": [
        {
          "id": "hello.dirty",
          "title": "Check changes",
          "description": "Count modified files in the active workspace.",
          "argsSchema": {
            "type": "object",
            "additionalProperties": false,
            "required": ["cwd"],
            "properties": { "cwd": { "type": "string" } }
          }
        }
      ],
      "runtime": {
        "protocol": "1.0.0",
        "command": "node",
        "args": ["plugin.js"],
        "inject": []
      },
      "ui": [
        {
          "id": "dirty-workspace",
          "slot": "session.header",
          "label": "Check changes",
          "description": "Count modified files in the active workspace.",
          "command": "hello.dirty"
        },
        {
          "id": "dirty-workspace-toolbar",
          "slot": "composer.toolbar",
          "label": "Check changes",
          "description": "Count modified files in the active workspace.",
          "command": "hello.dirty"
        }
      ]
    }
  }
}

Client extensions

Data this package carries for particular clients. The directory lists the clients named and never reads what is addressed to them.

  • dev.codetwo