跳到主要内容

Plugins & Marketplace

Flowy Agent Store natively supports plugins and plugin marketplaces: a plugin packages functional assets (including experts, teams, skills, connectors, and commands), while a marketplace serves as the distribution channel. The plugin architecture adheres to the local-first paradigm — the marketplace manages discovery and distribution, while imported snapshots, credentials, and runtime execution remain entirely on the local machine.


1. Plugin Architecture & Core Component Model​

Importing a plugin converts assets into standardized, reusable component definitions within the local Catalog:

Component TypeDeclaration PathRuntime MountingState & Boundary
Expert (AgentDefinition)agents array in plugin.jsonSelected as active role via Preset mechanism at session initializationPossesses dedicated system prompts and role constraints; maintains no independent session state
Team (AgentTeamDefinition)teams array in plugin.jsonLoaded from roster; Leader dynamically derives a Planned DAGFixed member collaboration with fine-grained step concurrency and dynamic re-planning
Skill (SkillDefinition)skills/<slug>/SKILL.mdInjected into reasoning context dynamically on demand or via model routingAtomic capability extension; does not establish independent conversational sessions
Connector (ConnectorDefinition)connectors/<slug>/mcp.jsonPhysical socket connection established by MCP Client after permission checkStrictly adheres to MCP standard; sensitive credentials physically stored in local vaults
Command (CommandDefinition)commands array in plugin.jsonInvoked directly by user via /cmd syntax to expand prompt templatesStateless task shortcut expanding into conversational prompts

2. Marketplace Protocols & Configuration​

Marketplace sources are declared in ~/.agent-store/config.toml across six supported source_kind protocols:

source_kindSource FormatCache VerificationTarget Scenario
indexHTTP(S) index.json manifest URLindex.json is incrementally verified via X-Linked-Etag (SHA-256 content digest); entry payloads download on demand with sha256 validationOfficial marketplace standard: small index + on-demand payloads (wb-market/<market>/index.json)
zipHTTP(S) archive URLHTTP HEAD checks X-Linked-Etag (SHA-256 archive digest)Third-party archives and frozen legacy official bundles: single archive package, metadata synchronized in one request
urlHTTPS/HTTP manifest URLIncremental hash diffing based on root _files.txt manifestSelf-hosted static HTTP servers or unpacked directory trees on CDN
githubGitHub repository identifierQuerying GitHub Releases assets and archive hashes via APIAutomated open-source repository distribution
gitGit remote repository URLFetching and commit tracking via standard Git protocolPrivate internal Git collaboration and testing
directoryLocal filesystem absolute pathReal-time filesystem mtime and hash change detectionLocal development and live debugging of experts and skills
# Each official market is an index.json hosted on ModelScope;
# with no [default_marketplaces] declared, these are exactly what the runtime registers
[default_marketplaces.experts]
source_kind = "index"
source = "https://www.modelscope.cn/models/me9rez/flowy-marketplace/resolve/master/wb-market/experts/index.json"

[default_marketplaces.skills]
source_kind = "index"
source = "https://www.modelscope.cn/models/me9rez/flowy-marketplace/resolve/master/wb-market/skills/index.json"

[default_marketplaces.connectors]
source_kind = "index"
source = "https://www.modelscope.cn/models/me9rez/flowy-marketplace/resolve/master/wb-market/connectors/index.json"
  • Content Digest Verification & Caching: An index source fetches the small index.json first (HTTP HEAD against X-Linked-Etag), then downloads entry payloads on demand with a second check against payload.sha256 / per-entry sha256; a zip source still downloads one archive wholesale with the same digest logic;
  • ModelScope Stable URLs: When hosted via ModelScope LFS, stable URLs return HTTP 302 redirects to signed CDN URLs; always configure official stable URLs in settings, never hardcode temporary signed CDN URLs;
  • Full Tree Mirroring: Other source kinds (url, git, github, directory) support full file tree mirroring using a precompiled _files.txt manifest list.
  • Switching a source does not upgrade installed resources: changing only source under the same [default_marketplaces.<id>] replaces that market's index and live cache, but installed snapshots stay unchanged. Use an explicit store/update-entry for a new version; update before exporting too (SDK syncToMarketVersion, see TypeScript SDK §4.4).

3. Ingestion & Security Audit Pipeline​

Triggering an installation via the marketplace (store/install-entry) or local folder invokes the Importer pipeline through the following deterministic security sequence:

[ External Marketplaces / Plugin Archives / Local Dirs ]
│
▼
┌────────────────────────────────────────────────────────┐
│ 1. Locate Source & Parse Manifest (plugin/marketplace) │
└──────────────────────────┬─────────────────────────────┘
│
▼
┌────────────────────────────────────────────────────────┐
│ 2. Static Security Audit (Path traversal ../ & symlinks│
└──────────────────────────┬─────────────────────────────┘
│
▼
┌────────────────────────────────────────────────────────┐
│ 3. Compute Full Tree SHA-256 Digest (content_digest) │
└──────────────────────────┬─────────────────────────────┘
│
▼
┌────────────────────────────────────────────────────────┐
│ 4. Copy to Versioned Archive (~/.agent-store/snapshots)│
└──────────────────────────┬─────────────────────────────┘
│
▼
┌────────────────────────────────────────────────────────┐
│ 5. Generate PluginSnapshot & Register in Local Catalog │
└────────────────────────────────────────────────────────┘

The three primary manifest formats and directory layouts supported are:

Manifest CategoryRoot PathCore FieldsAsset Specification
Expert Plugin Manifest.codebuddy-plugin/plugin.jsonname, version, agents, teams, commandsEncapsulates system prompts, model preferences, and bound skills
Skill Marketplace Manifest.codebuddy-skill/marketplace.jsonname, skills (with id, name, source)Each skill lives in skills/<slug>/ containing SKILL.md
Connector Marketplace Manifest.codebuddy-connector/connectors.jsonname, connectors (with id, source)Each connector lives in connectors/<slug>/ containing mcp.json

4. PluginSnapshot Immutability Mechanism​

The primary output of ingestion is a PluginSnapshot, representing a frozen, immutable physical capture of source assets:

  • Write-Once Read-Only: Once archived to disk and registered in the database, directory permissions are locked as read-only. Any change in source files mandates generating a new snapshot;
  • In-Flight Execution Version Pinning: Running sessions and Runs bind to the specific snapshot_id active at creation time, insulating active executions from concurrent catalog refreshes;
  • Deterministic Audit & Replay: Execution event streams record Snapshot IDs, schema revisions, and SHA-256 digests, supporting 100% reproducible historical replays;
  • In-Place Atomic Updates (store/update-entry): When new upstream versions are published, the host executes atomic upgrades via store.update. The pipeline adheres to an "install new version first, release old runtime only upon full verification" strategy; if the new version fails initialization or probing, the old physical assets are fully preserved without disrupting in-flight sessions. Expert preset IDs remain stable across updates (avoiding duplicate presets), skills cleanly replace directories, and connectors verify shared database rows before seamless handoff;
  • For execution engine layering and snapshot isolation details, refer to Architecture & System Specification.

5. Custom MCP Connector Integration Guide​

Developers can integrate custom MCP servers without publishing them to the public marketplace across three flexible paths:

Integration PathStorage TargetActive ScopeBest Suited For
Static ~/.agent-store/mcp.json declarationNo database record; read at host startupAll host sessionsPrivate local services and developer debugging
Dynamic HTTP management APImcp_servers database tableBound in explicit session or runSelf-hosted services requiring connection testing and OAuth
Marketplace / plugin package importWritten to mcp_servers upon installationSame as abovePackaged assets intended for team or community distribution

Three transport configurations are supported within the transport object:

{
"stdio": {
"command": "./my-mcp-server",
"args": ["--port", "9000"],
"env": { "DEBUG": "1" }
},
"http": {
"url": "https://mcp.example.com/mcp",
"headers": { "Authorization": "Bearer secret:MY_MCP_TOKEN" }
},
"sse": {
"url": "https://mcp.example.com/sse",
"headers": { "X-Api-Key": "secret:MY_API_KEY" }
}
}

5.1 Credential declarations and decoupled forms (token-schema.json)​

Connectors support three standard authentication modes (credential.mode): none (no authentication needed), oauth (browser OAuth 2.0 flow), and token (user-supplied key or token). For token mode, connector packages supply a token-schema.json declaring the field contract:

{
"title": { "zh": "高德地图密钥配置", "en": "AMap Key Setup" },
"description": { "zh": "请输入高德开放平台 Web 服务 API Key", "en": "Enter AMap Web Service API Key" },
"doc_url": { "zh": "https://lbs.amap.com/dev/key", "en": "https://lbs.amap.com/dev/key" },
"doc_label": { "zh": "前往获取高德 Key", "en": "Get AMap Key" },
"fields": [
{
"key": "AMAP_API_KEY",
"label": { "zh": "API Key", "en": "API Key" },
"placeholder": { "zh": "请输入 Web 服务 Key", "en": "e.g. 88374f..." },
"required": true,
"sensitive": true,
"type": "string"
}
]
}

Orchestrate and invoke connectors programmatically via the object-oriented TypeScript SDK (AppServerClient):

import { AppServerClient, WebSocketTransport } from "@flowy-agent-store/client";

// 1. Initialize client
const client = new AppServerClient({
transport: new WebSocketTransport("ws://127.0.0.1:8787/api/app-server/ws"),
client: { name: "connector-workflow-app", version: "1.0.0" },
});
await client.connect();

// 2. Discover enabled connectors and verify socket connectivity
const connectors = await client.connectors.list();
const testResult = await client.connectors.test("conn_github_integration");
console.log(`Connection test: ${testResult.success ? "Success" : "Failed"}`);

// 3. Create a conversation (connectors are also callable directly via client.connectors.call)
const conv = await client.conversations.create({
name: "GitHub Automation Workflow",
});

// 4. Dispatch inference prompt
await client.conversations.send(
conv.conversation_id,
"List the 3 most recent pull requests and generate a report in the right panel.",
crypto.randomUUID(),
);

For comprehensive connector method signatures and error handling, see TypeScript SDK Reference.


6. Custom Skill Development & Guidelines​

Authoring a custom skill requires no complex backend server; simply organize a valid SKILL.md file for the agent to discover and invoke:

---
name: web-scraper
display_name: Web Scraper
version: 1.0.0
description: Extract clean text and Markdown structure from any target URL
tags: ["crawler", "html", "parser"]
---

# Web Scraper Skill

## Description
Invoked when the user requires content extraction from public web pages or articles.

## Parameter Definitions
- `url` (string, required): Full HTTP(S) address of the target web page
- `format` (string, optional): Output format, supports `markdown` or `text`, defaults to `markdown`

## Constraints
1. Only scrape public web resources adhering to target robots.txt guidelines;
2. Automatically sanitize `<script>`, `<style>`, and modal DOM elements;
3. Return the parsed document content as Markdown into the session context.
  • Directory Layout: Save the file as skills/<slug>/SKILL.md;
  • Local Ingestion & Installation: Import the skill folder via the Web UI workbench or programmatically via client.store.installEntry;
  • Dynamic Runtime Routing: The Agent inspects its system instructions and task context to automatically bind and invoke the skill during relevant execution turns.

7. Credential Isolation & Access Control​

The system enforces strict zero-leakage and sanitization rules when managing sensitive credentials:

  • secret:<KEY> Reference Pattern: Plaintext tokens are strictly forbidden in connector manifests; use secret:NAME identifiers instead;
  • Local Credential Enclave: Actual secrets reside exclusively in OS-protected vaults (e.g. DPAPI / Keychain / encrypted local data files);
  • Connector Proxy Access Control: Controlled via [connector_proxy] in ~/.agent-store/config.toml:
    • enabled = false: Blocks all proxy tool execution requests;
    • enabled = true: Allows enabled connectors to execute tools; granular allow and deny lists can be configured;
  • For detailed proxy parameters, see Configuration.

8. Further Reading​