### Extension backend entrypoint with register/start/stop Source: https://github.com/alikon-art/determinflow/blob/main/docs/extension-development.md Backend entrypoint for an extension. register() only declares contributions and must not connect databases, start tasks, or access the network; I/O initialization goes in start(), and resource release goes in the repeatable stop(). The Host may call stop() for rollback even if startup only partially completed. ```python class ExampleExtension: def register(self, registrar): registrar.add_router(router) registrar.add_tool_contributor(register_tools) registrar.add_health_check(check_dependency) registrar.add_memory_provider(provider) registrar.add_memory_scope_authorizer(authorizer) async def start(self, runtime): self.workflow = runtime.workflow_runtime async def stop(self): pass def create(): return ExampleExtension() ``` -------------------------------- ### extension.toml manifest example Source: https://github.com/alikon-art/determinflow/blob/main/docs/plugin-packages.md Example extension.toml manifest for a DeterminFlow plugin. Declares extension metadata, resource namespace, resource paths, installation requirements, settings schema, lifecycle commands, page UI, and a background process. The lifecycle commands use ${PYTHON} and ${PLUGIN_REVISION} placeholders; the process reads configuration via ${CONFIG_FILE}. ```toml [extension] id = "example-plugin" name = "Example Plugin" version = "1.0.0" api_version = "1" description = "Example package." backend = "example_plugin.extension:create_extension" dependencies = [] capabilities = ["api.routes", "resources.workflows"] [resource_namespace] prefix = "example" [resources] agents = "resources/agents.json" prompts = "resources/prompts.json" skills = "resources/skills.json" skill_bundles = "resources/skill-bundles" rules = "resources/rules.json" rule_bundles = "resources/rule-bundles" workflows = "resources/workflows" script_libraries = "resources/script-library" [installation] requirements = "requirements.txt" [settings] schema = "settings.schema.json" [lifecycle] migrate_command = [ "${PYTHON}", "-m", "example_plugin.migrations", "migrate", "--revision", "${PLUGIN_REVISION}", ] verify_command = [ "${PYTHON}", "-m", "example_plugin.migrations", "verify", "--revision", "${PLUGIN_REVISION}", ] timeout_seconds = 300 [page] label = "Example 配置" static_dir = "ui" entrypoint = "index.html" [[processes]] id = "example-api" command = ["${PYTHON}", "-m", "example_plugin.api"] working_directory = "." environment = { EXAMPLE_CONFIG = "${CONFIG_FILE}" } healthcheck_url = "http://127.0.0.1:8090/health" start_timeout_seconds = 30 stop_timeout_seconds = 10 ``` -------------------------------- ### POST /api/plugins/install Source: https://github.com/alikon-art/determinflow/blob/main/docs/plugin-packages.md Installs a plugin from a Git URL/ref/subdirectory. Optionally supports an advanced `resource_prefix` override. ```APIDOC ## POST /api/plugins/install ### Description Installs a plugin from a Git URL/ref/subdirectory. Optionally supports an advanced `resource_prefix` override. ### Method POST ### Endpoint /api/plugins/install ### Parameters #### Request Body - **resource_prefix** (string) - Optional - Advanced override for resource prefix. ``` -------------------------------- ### Local verification commands Source: https://github.com/alikon-art/determinflow/blob/main/CONTRIBUTING.md Run the local verification steps for the DeterminFlow repository. Requires Python 3.11+ and Node.js 22+. Installs Python dependencies, runs the Python test suite, then installs web dependencies and runs lint, extension tests, workflow tests, and the build. ```bash python -m pip install -r requirements-dev.lock python -m pytest -q cd web npm ci npm run lint npm run test:extensions npm run test:workflow npm run build ``` -------------------------------- ### plugin-repository.toml index Source: https://github.com/alikon-art/determinflow/blob/main/docs/plugin-packages.md Optional directory index for a multi-plugin repository. Core reads this index from config/plugin-sources.json to provide quick-install entries; installation still re-preflights the manifest and locks an exact commit. ```toml schema_version = "1" name = "Example Plugins" [[plugins]] id = "example-plugin" subdirectory = "plugins/example-plugin" ``` -------------------------------- ### Run DeterminFlow from source on Windows PowerShell Source: https://github.com/alikon-art/determinflow/blob/main/README.en.md Commands to clone the repository, create a virtual environment, install dependencies, copy configuration files, and run the application on Windows PowerShell. ```powershell git clone https://github.com/alikon-art/DeterminFlow.git Set-Location DeterminFlow python -m venv .venv .\\.venv\\Scripts\\python.exe -m pip install -r requirements.lock Copy-Item .env.example .env Copy-Item config\models_config.example.json config\models_config.json .\\.venv\\Scripts\\python.exe run.py ``` -------------------------------- ### Conventional Commits examples Source: https://github.com/alikon-art/determinflow/blob/main/CONTRIBUTING.md Example commit messages following the Conventional Commits format. Use this format for all commits to the repository. ```text feat(workflow): add retry backoff policy fix(plugin): reject paths outside package root ``` -------------------------------- ### GET /api/plugins/{id}/ui/{path} Source: https://github.com/alikon-art/determinflow/blob/main/docs/plugin-packages.md Serves static pages for a running plugin. ```APIDOC ## GET /api/plugins/{id}/ui/{path} ### Description Serves static pages for a running plugin. ### Method GET ### Endpoint /api/plugins/{id}/ui/{path} ### Parameters #### Path Parameters - **id** (string) - Required - The plugin identifier. - **path** (string) - Required - The static page path. ``` -------------------------------- ### Script node configuration with script_argv Source: https://github.com/alikon-art/determinflow/blob/main/src/core/defaults/skills/script-library-guide/SKILL.md Example configuration for a Script node using the library source. The script_argv array passes each argument as a complete argv item; spaces, quotes, and JSON are not re-split by a shell. script_source must be inline or library, script_type must match the actual entry, and script_group is required only in library mode. ```json { "node_type": "script", "node_params": { "script_source": "library", "script_type": "python", "script_group": "utils", "script_name": "normalize", "script_argv": ["--input", "{{source_file}}", "--mode", "strict"], "timeout": "300" } } ``` -------------------------------- ### GET /api/resource-marketplace/skills/:slug/reviews Source: https://github.com/alikon-art/determinflow/blob/main/docs/resource-marketplace.md Compatibility endpoint that returns the first 50 visible reviews. ```APIDOC ## GET /api/resource-marketplace/skills/:slug/reviews ### Description Compatibility endpoint that returns the first 50 visible reviews. ### Method GET ### Endpoint /api/resource-marketplace/skills/:slug/reviews ### Parameters #### Path Parameters - **slug** (string) - Required - The slug of the skill. ### Response #### Success Response (200) - **reviews** (array) - List of reviews. #### Response Example { "reviews": [] } ``` -------------------------------- ### GET /api/resource-marketplace/skills/:slug/preview Source: https://github.com/alikon-art/determinflow/blob/main/docs/resource-marketplace.md Reads the read-only UTF-8 SKILL.md content. ```APIDOC ## GET /api/resource-marketplace/skills/:slug/preview ### Description Reads the read-only UTF-8 SKILL.md content using the same expected_version_id and expected_sha256 as installation. Does not increase download count. Returns 409 version_changed if the version changed, and fails closed if the hash does not match. Public websites must not call this preview endpoint. ### Method GET ### Endpoint /api/resource-marketplace/skills/:slug/preview ### Parameters #### Path Parameters - **slug** (string) - Required - The slug of the skill. #### Query Parameters - **expected_version_id** (string) - Required - The expected version ID. - **expected_sha256** (string) - Required - The expected SHA-256 hash. ### Response #### Success Response (200) - **content** (string) - The content of the SKILL.md file. #### Response Example { "content": "# Skill" } ``` -------------------------------- ### Run marketplace review CLI commands Source: https://github.com/alikon-art/determinflow/blob/main/docs/resource-marketplace.md Review CLI commands for the marketplace. Requires the desktop client to be started and logged in. The default endpoint is http://127.0.0.1:8020. Approve, reject, and suspend require --confirm; approve and reject also require a SHA-256. The tool does not read or output access or refresh tokens. ```bash python3 scripts/marketplace_review.py queue python3 scripts/marketplace_review.py show python3 scripts/marketplace_review.py approve --sha256 <64-lowerhex> --confirm python3 scripts/marketplace_review.py reject --sha256 <64-lowerhex> --reason "原因" --confirm python3 scripts/marketplace_review.py suspend --version-id --reason "原因" --confirm ``` -------------------------------- ### POST /api/resource-marketplace/skills/{slug}/update Source: https://github.com/alikon-art/determinflow/blob/main/docs/resource-marketplace.md Updates an installed skill from the marketplace. ```APIDOC ## POST /api/resource-marketplace/skills/{slug}/update ### Description Updates an installed skill from the marketplace. Requires the same version ID and digest lock. Core re-fetches trusted details, confirms the target, and validates the same marketplace, resource, publisher, and a semantically newer version. It checks local source, path, and original text bytes before and after download, rejecting modifications, symlinks, or extra files. Only atomically replaces the installed SKILL.md. Enabling, auto-injection, scope, priority, and grouping are preserved. On write or reload failure, the old file and source record are restored. ### Method POST ### Endpoint /api/resource-marketplace/skills/{slug}/update ### Parameters #### Path Parameters - **slug** (string) - Required - The slug of the skill to update. ### Response #### Success Response (200) - **updated** (boolean) - Indicates the update was successful. - **installed** (boolean) - Indicates the skill is installed. - **enabled** (boolean) - The actual enabled state after update. #### Response Example { "updated": true, "installed": true, "enabled": true } ``` -------------------------------- ### GET /api/plugins Source: https://github.com/alikon-art/determinflow/blob/main/docs/plugin-packages.md Lists the running status, target status, source, version, and configuration contract of all plugins. ```APIDOC ## GET /api/plugins ### Description Lists the running status, target status, source, version, and configuration contract of all plugins. ### Method GET ### Endpoint /api/plugins ### Response #### Success Response (200) - **package_management_read_only** (boolean) - Indicates whether package management is read-only (true when DETERMINFLOW_PLUGIN_PACKAGES_READ_ONLY=true). #### Response Example { "package_management_read_only": true } ``` -------------------------------- ### Optional provider methods: health() and legacy_runtime_settings() Source: https://github.com/alikon-art/determinflow/blob/main/docs/settings-extension-contract.md These two methods are optional for providers. `health()` returns a tuple of a boolean and a string, used for bounded liveness checks; it must not return secrets or raise exceptions. `legacy_runtime_settings()` returns a dict of generic Core keys, used only when Core settings do not exist yet and exactly one provider is configured after plugin start. ```python async def health(self) -> tuple[bool, str]: """Bounded liveness. Missing health() cannot enable external memory.""" ``` ```python def legacy_runtime_settings(self) -> dict: """Generic Core keys only, excluding enabled/external_enabled/provider_id.""" ``` -------------------------------- ### GET /api/resource-marketplace/catalog/skills Source: https://github.com/alikon-art/determinflow/blob/main/docs/resource-marketplace.md Provides server-side pagination for the skill catalog. ```APIDOC ## GET /api/resource-marketplace/catalog/skills ### Description Provides server-side pagination for the skill catalog. Query fields include q, category, sort, page, page_size, and favorites. Default page is 1, page size is 24. Page numbers range from 1 to 100000, page size from 1 to 100. When favorites=true, it proxies only the current logged-in account's favorites and uses existing account renewal. When favorites=false or omitted, it keeps the anonymous public catalog and does not cache private lists as public results. The public catalog excludes deprecated resources; the favorites list still includes favorited published deprecated items. ### Method GET ### Endpoint /api/resource-marketplace/catalog/skills ### Parameters #### Query Parameters - **q** (string) - Optional - Search query. - **category** (string) - Optional - Category filter. - **sort** (string) - Optional - Sort order. - **page** (integer) - Optional - Page number (1-100000). Default 1. - **page_size** (integer) - Optional - Items per page (1-100). Default 24. - **favorites** (boolean) - Optional - If true, returns only favorites of the current account. ### Response #### Success Response (200) - **items** (array) - List of skills. - **page** (integer) - Current page. - **page_size** (integer) - Items per page. - **total** (integer) - Total number of items. #### Response Example { "items": [], "page": 1, "page_size": 24, "total": 0 } ``` -------------------------------- ### Run macOS-specific desktop verification Source: https://github.com/alikon-art/determinflow/blob/main/desktop/README.md Additional macOS verification commands. Creates a virtual environment, installs macOS build dependencies, builds the core backend with MACOSX_DEPLOYMENT_TARGET=11.0, generates the macOS icon, runs the macOS build, and verifies the .app bundle and .dmg with load-command and container checks while forbidding updater artifacts. ```bash python -m venv desktop/.build/macos-venv desktop/.build/macos-venv/bin/python desktop/scripts/install_macos_build_dependencies.py MACOSX_DEPLOYMENT_TARGET=11.0 desktop/.build/macos-venv/bin/python \ desktop/scripts/build_backend.py --flavor core desktop/.build/macos-venv/bin/python desktop/scripts/smoke_backend.py python desktop/scripts/generate_macos_icon.py (cd desktop && MACOSX_DEPLOYMENT_TARGET=11.0 npm run build:macos) desktop/.build/macos-venv/bin/python desktop/scripts/verify_bundle.py \ --expected-flavor core \ --app-bundle desktop/src-tauri/target/release/bundle/macos/DeterminFlow.app \ --dmg desktop/src-tauri/target/release/bundle/dmg/DeterminFlow_1.0.2_aarch64.dmg \ --verify-macos-load-commands \ --verify-dmg-container \ --forbid-updater-artifacts desktop/src-tauri/target/release/bundle ``` -------------------------------- ### Run platform-independent desktop verification Source: https://github.com/alikon-art/determinflow/blob/main/desktop/README.md Platform-independent verification commands for macOS or Linux. Runs packaging tests, stages defaults, builds the web frontend, installs PyInstaller 6.21.0, builds and smoke-tests the backend, verifies the bundle, and runs desktop npm and cargo tests. ```bash python -m pytest tests/test_desktop_packaging.py -q python desktop/scripts/stage_defaults.py (cd web && npm ci && npm run build) python -m pip install pyinstaller==6.21.0 python desktop/scripts/build_backend.py python desktop/scripts/smoke_backend.py python desktop/scripts/verify_bundle.py (cd desktop && npm ci) (cd desktop && npm test) (cd desktop/src-tauri && cargo test) ``` -------------------------------- ### GET /api/resource-marketplace/status Source: https://github.com/alikon-art/determinflow/blob/main/docs/resource-marketplace.md Retrieves the embed URL for the resource marketplace. ```APIDOC ## GET /api/resource-marketplace/status ### Description Returns the embed URL for the resource marketplace. ### Method GET ### Endpoint /api/resource-marketplace/status ### Response #### Success Response (200) - **embed_url** (string) - The URL to embed the marketplace. #### Response Example { "embed_url": "https://example.com/embed/marketplace" } ``` -------------------------------- ### LLM pricing configuration JSON structure Source: https://github.com/alikon-art/determinflow/blob/main/docs/llm-pricing.md Configuration file structure for LLM pricing. The `rates` object supports `prompt`, `cached_prompt`, `completion`, and optional `reasoning`; if `reasoning` is omitted, reasoning tokens are billed as `completion` tokens without double charging. `time_bands` uses local time in the rule's timezone, start inclusive and end exclusive; start after end means crossing midnight, and `days` can be `0`-`6` or `mon`-`sun`. A start equal to end is not a valid all-day window; omit the time band for all-day rules. ```json { "version": "price-table-version", "currency": "USD", "timezone": "UTC", "unit_tokens": 1000000, "rules": [ { "id": "stable-rule-id", "provider": "provider-id", "model": "model-name", "effective_from": "2026-07-18T00:00:00Z", "effective_to": null, "rates": { "prompt": "CONFIGURE_ME", "cached_prompt": "CONFIGURE_ME", "completion": "CONFIGURE_ME" }, "time_bands": [] } ] } ``` -------------------------------- ### Cross-resource resolution with runtime.resolve_resource Source: https://github.com/alikon-art/determinflow/blob/main/docs/extension-development.md Resolves cross-resource references using local resource IDs. The Host builds explicit mappings and runtime snapshots based on the manifest default prefix or the override value at install time; do not manually concatenate or trim prefixes in code. Cross-plugin owners must be listed in the current manifest's dependencies or resolution fails closed. ```python runtime.resolve_resource("prompt", "writer") runtime.resolve_resource( "workflow", "build", plugin_id="workflow-provider", ) ``` -------------------------------- ### GET /api/resource-marketplace/skills/:slug/reviews/page Source: https://github.com/alikon-art/determinflow/blob/main/docs/resource-marketplace.md Anonymously paginates public visible reviews. ```APIDOC ## GET /api/resource-marketplace/skills/:slug/reviews/page ### Description Anonymously paginates public visible reviews. Default page is 1, page size is 20. Page and page size follow the same public validation as the catalog. Public review fields are id, author_label, rating, body, created_at, updated_at. It does not include account IDs or hidden moderation notes. ### Method GET ### Endpoint /api/resource-marketplace/skills/:slug/reviews/page ### Parameters #### Path Parameters - **slug** (string) - Required - The slug of the skill. #### Query Parameters - **page** (integer) - Optional - Page number (1-100000). Default 1. - **page_size** (integer) - Optional - Items per page (1-100). Default 20. ### Response #### Success Response (200) - **reviews** (array) - List of reviews. - **page** (integer) - Current page. - **page_size** (integer) - Items per page. - **total** (integer) - Total number of reviews. #### Response Example { "reviews": [], "page": 1, "page_size": 20, "total": 0 } ``` -------------------------------- ### GET /api/plugins/catalog Source: https://github.com/alikon-art/determinflow/blob/main/docs/plugin-packages.md Reads the optional catalog index from the official repository on demand. ```APIDOC ## GET /api/plugins/catalog ### Description Reads the optional catalog index from the official repository on demand. ### Method GET ### Endpoint /api/plugins/catalog ``` -------------------------------- ### GET /api/memory/settings Source: https://github.com/alikon-art/determinflow/blob/main/docs/settings-extension-contract.md Retrieves the current memory settings, including provider statuses and effective enabled state. ```APIDOC ## GET /api/memory/settings ### Description Retrieves the current memory settings, including provider statuses and effective enabled state. ### Method GET ### Endpoint /api/memory/settings ### Response #### Success Response (200) - **settings** (object) - The current memory settings. - **providers** (array) - List of providers with their status. - **effective_enabled** (boolean) - Whether memory is effectively enabled. - **reason** (string) - Reason for the current state. - **schema** (object) - JSON schema for shared form controls. #### Response Example { "settings": { "...MemorySettings" }, "providers": [{ "id": "", "name": "", "status": "", "healthy": true, "reason": "" }], "effective_enabled": false, "reason": "", "schema": {} } ``` -------------------------------- ### Safe operation order for Cron jobs Source: https://github.com/alikon-art/determinflow/blob/main/src/core/defaults/skills/automation-guide/SKILL.md Recommended safe operation order for creating and verifying a Cron job: check status and list, create, get to verify schedule/prompt/agent_type/repeat, optionally run a low-risk smoke test, check output for real artifacts, then keep enabled or pause for corrections. run incurs model costs and side effects, so only trigger authorized tasks. ```text status/list -> create -> get(核对 schedule、prompt、agent_type、repeat) -> run(低风险代表性任务可手动冒烟) -> output(核验真实产物) -> 保持启用,或 pause 后修正 ``` -------------------------------- ### Configure eslint-plugin-react for TypeScript ESLint Source: https://github.com/alikon-art/determinflow/blob/main/web/README.md Install eslint-plugin-react and update the ESLint config to enable React-specific rules. This is the second step after configuring parserOptions. ```javascript // eslint.config.js import react from 'eslint-plugin-react' export default tseslint.config({ // Set the react version settings: { react: { version: '18.3' } }, plugins: { // Add the react plugin react, }, rules: { // other rules... // Enable its recommended rules ...react.configs.recommended.rules, ...react.configs['jsx-runtime'].rules, }, }) ``` -------------------------------- ### GET/PUT /api/memory/settings response shape Source: https://github.com/alikon-art/determinflow/blob/main/docs/settings-extension-contract.md Shared JSON shape returned by both GET and PUT endpoints. The PUT body is { "settings": object } and returns the same shape. Write access requires a Bearer token unless no admin token is configured, in which case loopback is allowed. ```json { "settings": { "...MemorySettings" }, "providers": [{ "id": "", "name": "", "status": "", "healthy": true, "reason": "" }], "effective_enabled": false, "reason": "", "schema": {} } ``` -------------------------------- ### Docker 启动 Source: https://github.com/alikon-art/determinflow/blob/main/README.md 使用 Docker Compose 构建并启动 DeterminFlow。 ```bash docker compose up --build ``` -------------------------------- ### Plugin repository layout Source: https://github.com/alikon-art/determinflow/blob/main/docs/plugin-packages.md Shows the recommended layout for a single-plugin repository and for a repository containing multiple plugins, where each plugin root is identified by a subdirectory. The optional plugin-repository.toml index at the repository root points to each plugin's subdirectory. ```text plugin-repository.toml plugins/ example-plugin/ extension.toml requirements.txt settings.schema.json backend/ resources/ ui/ ``` -------------------------------- ### 开发与验证命令 Source: https://github.com/alikon-art/determinflow/blob/main/README.md 用于安装开发依赖、运行测试、构建 Web 前端以及验证 Docker Compose 配置。 ```bash python -m pip install -r requirements-dev.lock python -m pytest -q (cd web && npm run lint && npm run test:extensions && npm run build) docker compose -f docker-compose.yml config -q ``` -------------------------------- ### macOS / Linux 从源码运行 Source: https://github.com/alikon-art/determinflow/blob/main/README.md 在 macOS 或 Linux 上克隆仓库、创建虚拟环境、安装依赖并启动应用。需要 Python 3.11+、Node.js 22.12+ 和 npm。 ```bash git clone https://github.com/alikon-art/DeterminFlow.git cd DeterminFlow python -m venv .venv source .venv/bin/activate python -m pip install -r requirements.lock cp .env.example .env cp config/models_config.example.json config/models_config.json python run.py ``` -------------------------------- ### Agent opt-in definition for workspace tools Source: https://github.com/alikon-art/determinflow/blob/main/docs/workspace-contracts.md Required Agent definition to opt into workspace tools. The extension_options.workspace.enabled must be true and scope must be "user" for a normal product user; an internal Main can use scope "local" only when local_main_enabled is true. The tools list is illustrative and does not replace other allowed tools; workspace_delete is separately available. ```json {"extension_options":{"workspace":{"enabled":true,"scope":"user"}}, "tools":["workspace_list","workspace_read","workspace_search","workspace_write","workspace_versions"]} ``` -------------------------------- ### Publish signed registry to S3-compatible storage Source: https://github.com/alikon-art/determinflow/blob/main/docs/plugin-packages.md Publish command for S3-compatible object storage. It first uploads and publicly verifies immutable objects under `packages/` and `snapshots//`, then updates `manifest.json.sig`, and finally updates `manifest.json`. R2, MinIO, and other compatible services use the same command; if an immutable key already exists with different content, the operation fails closed. ```bash python -m src.plugin_system.registry_release publish-s3 \ --registry-dir /tmp/determinflow-plugin-registry \ --prefix plugins/v1 \ --bucket "$PLUGIN_DISTRIBUTION_BUCKET" \ --endpoint-url "$PLUGIN_DISTRIBUTION_S3_ENDPOINT" \ --public-base-url https://cdn.example.com ``` -------------------------------- ### Agent opt-in configuration for memory scope Source: https://github.com/alikon-art/determinflow/blob/main/docs/memory-contracts.md JSON configuration to enable a memory plugin and set the memory scope to 'user' or 'local'. User scope requires a valid memory_scope and must not fall back to a global bank. Local scope is only for Core local main sessions with an empty resource_owner. ```json { "extension_options": { "": { "enabled": true, "scope": "user" } } } ``` -------------------------------- ### Minimal SKILL.md frontmatter Source: https://github.com/alikon-art/determinflow/blob/main/src/core/defaults/skills/skill-rule-authoring-guide/SKILL.md Minimal frontmatter for a SKILL.md file. The name must match the directory name in kebab-case, and the description must include trigger conditions because it is the discovery entry point. ```yaml --- name: example-guide description: 在什么任务、操作和故障场景下必须加载,以及它解决什么问题。 --- ``` -------------------------------- ### runtime.resolve_resource usage Source: https://github.com/alikon-art/determinflow/blob/main/docs/plugin-packages.md Shows how a backend resolves resources from its own plugin or from a dependency plugin using runtime.resolve_resource. The first call resolves a local prompt; the second resolves a workflow from another plugin by specifying plugin_id. Cross-plugin owners must be listed in the manifest's dependencies. ```python own_prompt = runtime.resolve_resource("prompt", "writer") build_workflow = runtime.resolve_resource( "workflow", "build", plugin_id="shared-writing-resources", ) ``` -------------------------------- ### Skill directory structure Source: https://github.com/alikon-art/determinflow/blob/main/src/core/defaults/skills/skill-rule-authoring-guide/SKILL.md Shows the required directory layout for a DeterminFlow Skill. Each Skill is a directory containing SKILL.md plus optional scripts/, references/, and assets/ subdirectories. ```text skill-name/ ├── SKILL.md ├── scripts/ ├── references/ └── assets/ ``` -------------------------------- ### 直接编辑 definition.json 后运行校验脚本(validate_definition.py) Source: https://github.com/alikon-art/determinflow/blob/main/src/core/defaults/skills/workflow-guide/SKILL.md 仅在 API 不可用且任务明确要求直接维护资源时,才编辑 data/workflows/{workflow_id}/definition.json。编辑后必须运行此命令。支持单个文件、目录或 --all。退出码 0 表示通过(可含 warning),1 表示存在必须修复的 error。 ```bash python data/skills/workflow-guide/scripts/validate_definition.py data/workflows/{workflow_id}/definition.json ``` -------------------------------- ### Library script directory structure Source: https://github.com/alikon-art/determinflow/blob/main/src/core/defaults/skills/script-library-guide/SKILL.md Shows the required directory layout for a library script. The entry file must match the directory name, and only one of {name}.sh or {name}.py is allowed. SCRIPT.md is recommended for documenting usage, inputs, outputs, side effects, and version. ```text data/script-library/{group}/{name}/ ├── {name}.sh # 或 {name}.py,二选一 └── SCRIPT.md # 推荐:说明用途、输入、输出、副作用和版本 ``` -------------------------------- ### Build signed registry with registry_release Source: https://github.com/alikon-art/determinflow/blob/main/docs/plugin-packages.md Build command for the `registry_release` tool. It reads only the exact commit from Git, rejects symlinks, non-regular files, Python bytecode, and oversized packages; ZIP timestamps and permissions are fixed so the same commit yields the same package digest. The signing private key is read only from the environment variable, never written to the repository or command arguments. ```bash PLUGIN_REGISTRY_SIGNING_KEY='' \ python -m src.plugin_system.registry_release build \ --repository /path/to/DeterminFlow-Plugins \ --source-url https://github.com/alikon-art/DeterminFlow-Plugins.git \ --ref main \ --output /tmp/determinflow-plugin-registry ``` -------------------------------- ### Configure signed HTTPS distribution source Source: https://github.com/alikon-art/determinflow/blob/main/docs/plugin-packages.md Source configuration for a signed HTTPS distribution. The `url` is the persistent identity in the lock and must normalize to a Git address. `registry.public_key` is an independent 32-byte Ed25519 public key, not reused for Git hosting credentials. `registry.endpoints` are tried in order, each must be a credential-free, query-free, and fragment-free HTTPS root URL. Legacy single `registry.url` configuration remains compatible. ```json { "id": "determinflow-official", "name": "DeterminFlow 官方插件", "url": "https://github.com/alikon-art/DeterminFlow-Plugins.git", "ref": "main", "mirrors": [ "https://gitee.com/alikon/DeterminFlow-Plugins.git" ], "registry": { "endpoints": [ "https://plugins.example.invalid/v1", "https://plugins-backup.example.invalid/v1" ], "public_key": "" } } ``` -------------------------------- ### Minimal signed manifest fields Source: https://github.com/alikon-art/determinflow/blob/main/docs/plugin-packages.md Minimal fields of the manifest. `source` after normalization must match the configured Git identity. The ZIP contains only the Plugin root directory contents with `extension.toml` at the archive root; `subdirectory` is written to the lock for Git fallback. `package.path` must be a safe relative path so the same signed manifest can be copied verbatim to multiple endpoints. Legacy absolute or relative `package.url` manifests remain compatible. ```json { "schema_version": 1, "source": "https://github.com/alikon-art/DeterminFlow-Plugins.git", "ref": "main", "resolved_commit": "0123456789abcdef0123456789abcdef01234567", "plugins": [ { "id": "example-plugin", "name": "Example Plugin", "version": "1.0.0", "description": "Example package.", "subdirectory": "plugins/example-plugin", "ref": "main", "commit": "0123456789abcdef0123456789abcdef01234567", "content_sha256": "<64-hex>", "package": { "path": "packages/example-plugin/0123456789abcdef0123456789abcdef01234567.zip", "sha256": "<64-hex>" } } ] } ``` -------------------------------- ### Extension manifest configuration Source: https://github.com/alikon-art/determinflow/blob/main/docs/extension-development.md Defines the extension manifest with required fields: id, name, version, api_version, backend entrypoint, frontend module, dependencies, capabilities, resource namespace prefix, and resource paths. The dependencies field only accepts Extension IDs; the Host auto-enables transitive dependencies and detects cycles. Resource paths must be inside the extension directory and only Core-declared resource types are accepted. ```toml [extension] id = "example-tools" # 扩展唯一标识 name = "Example Tools" # 展示名称 version = "1.0.0" # 扩展版本 api_version = "1" # Extension API 版本 backend = "example.backend:create" # 可选 Python entrypoint frontend = "example-tools" # 可选前端模块 ID dependencies = [] # 必需 Extension ID 完整列表 capabilities = ["agent.tools"] # 能力声明,仅用于审计 [resource_namespace] prefix = "example" # 开发者默认 Prefix,安装时可高级覆盖 [resources] agents = "resources/agents.json" prompts = "resources/prompts.json" skill_bundles = "resources/skill-bundles" rule_bundles = "resources/rule-bundles" workflows = "resources/workflows" script_libraries = "resources/script-library" ``` -------------------------------- ### workspace.execute Source: https://github.com/alikon-art/determinflow/blob/main/docs/workspace-contracts.md Executes a file operation on the workspace. The operation is specified by the 'operation' parameter, and the target file is given by 'path'. Additional parameters like 'limit' and 'expected_version' control the behavior. ```APIDOC ## workspace.execute ### Description Executes a file operation on the workspace. The operation is specified by the 'operation' parameter, and the target file is given by 'path'. Additional parameters like 'limit' and 'expected_version' control the behavior. ### Method EXECUTE ### Endpoint workspace.execute ### Parameters #### Path Parameters - **path** (string) - Required - Relative POSIX path to the file. Absolute paths, traversal, empty components, backslashes, and controls are rejected. Root is allowed for status/list/search. #### Query Parameters - **operation** (string) - Required - The operation to perform. Allowed values: `status`, `list`, `stat`, `read`, `read_text`, `search`, `write`, `delete`, `versions`. - **limit** (integer) - Optional - Maximum number of characters for text reads (max 12000) or maximum number of records for list/search/version pages (max 100). - **expected_version** (string) - Optional - The exact prior version for updates and deletes. A write without this is create-only. - **resource_owner** (string) - Required - The resource owner identifier. - **external_ref** (string) - Required - The external reference identifier. - **workspace_scope** (string) - Required - Opaque lowercase 64-hex identifier supplied by trusted product identity. - **agent_type** (string) - Required - The agent type identifier. #### Request Body - **content** (string) - Optional - The content to write for write operations. - **idempotency_key** (string) - Required for write/delete - The idempotency key derived from the actual injected tool call ID and session. ### Request Example ```json { "resource_owner": "product-plugin", "external_ref": "trusted-session-anchor", "workspace_scope": "trusted_scope", "agent_type": "resolved-agent-id", "operation": "read_text", "path": "notes/INDEX.md", "limit": 6000 } ``` ### Response #### Success Response (200) - **committed** (boolean) - Required for successful mutations - Indicates durable catalog commit. - **path** (string) - The file path. - **version** (string) - The file version. - **size** (integer) - The file size in bytes. - **content_type** (string) - The MIME type of the file. - **sha256** (string) - The SHA-256 hash of the file content. - **updated_at** (string) - The last update timestamp. - **parse_status** (string) - The parse status of the file. #### Response Example ```json { "committed": true, "path": "notes/INDEX.md", "version": "abc123", "size": 1234, "content_type": "text/markdown", "sha256": "...", "updated_at": "2023-01-01T00:00:00Z", "parse_status": "parsed" } ``` ### Error Handling - **invalid** (422) - Invalid request. - **forbidden** (403) - Forbidden operation. - **missing** (404) - File not found. - **conflict** (409) - Version conflict or idempotency conflict. - **unsupported** (415) - Unsupported operation or content type. - **too large** (413) - Request exceeds size limit. - **unavailable** (503) - Service unavailable. Provider transport exceptions are translated to generic errors without connection credentials. ``` -------------------------------- ### Windows PowerShell 从源码运行 Source: https://github.com/alikon-art/determinflow/blob/main/README.md 在 Windows PowerShell 中克隆仓库、创建虚拟环境、安装依赖并启动应用。需要 Python 3.11+、Node.js 22.12+ 和 npm。 ```powershell git clone https://github.com/alikon-art/DeterminFlow.git Set-Location DeterminFlow python -m venv .venv .\ .venv\Scripts\python.exe -m pip install -r requirements.lock Copy-Item .env.example .env Copy-Item config\models_config.example.json config\models_config.json .\ .venv\Scripts\python.exe run.py ``` -------------------------------- ### PUT /api/memory/settings Source: https://github.com/alikon-art/determinflow/blob/main/docs/settings-extension-contract.md Updates the memory settings with the provided settings object and returns the updated settings. ```APIDOC ## PUT /api/memory/settings ### Description Updates the memory settings with the provided settings object and returns the updated settings. ### Method PUT ### Endpoint /api/memory/settings ### Request Body - **settings** (object) - Required - The memory settings to apply. ### Request Example { "settings": {} } ### Response #### Success Response (200) - **settings** (object) - The updated memory settings. - **providers** (array) - List of providers with their status. - **effective_enabled** (boolean) - Whether memory is effectively enabled. - **reason** (string) - Reason for the current state. - **schema** (object) - JSON schema for shared form controls. #### Response Example { "settings": { "...MemorySettings" }, "providers": [{ "id": "", "name": "", "status": "", "healthy": true, "reason": "" }], "effective_enabled": false, "reason": "", "schema": {} } ``` -------------------------------- ### HTTP 创建 Task 时使用 node_model_overrides 指定节点模型(JSON) Source: https://github.com/alikon-art/determinflow/blob/main/src/core/defaults/skills/workflow-guide/SKILL.md 用于在 HTTP 创建 Task 时,为指定 Agent 节点(node_type=agent)选择 Core 已配置的 Provider 与预定义模型,并用 node_model_params_overrides 叠加本次 Task 的临时 Agent model_params。节点 ID 必须存在且类型为 agent,模型引用必须出现在 Core 当前模型列表中。选择结果会写入 Task 的定义快照和运行身份守卫,因此重试与恢复继续使用同一模型;Workflow 模板不会被修改。 ```json { "node_model_overrides": { "writer": "provider_id:model_name" }, "node_model_params_overrides": { "writer": { "temperature": 0.4, "reasoning_effort": "high" } } } ``` -------------------------------- ### PUT /api/plugins/{id}/config Source: https://github.com/alikon-art/determinflow/blob/main/docs/plugin-packages.md Validates and saves the configuration for a plugin. ```APIDOC ## PUT /api/plugins/{id}/config ### Description Validates and saves the configuration for a plugin. ### Method PUT ### Endpoint /api/plugins/{id}/config ### Parameters #### Path Parameters - **id** (string) - Required - The plugin identifier. ``` -------------------------------- ### FrontendExtension 默认导出示例 Source: https://github.com/alikon-art/determinflow/blob/main/docs/extension-development.md frontend/index.tsx 默认导出 FrontendExtension,包含 id、pages 和 component。extension.id 必须等于 manifest 的 frontend,页面 ID 不得重复。 ```tsx const extension = { id: "example-tools", pages: [{ id: "example", label: "Example", icon: Wrench, component: ExamplePage }], }; export default extension; ``` -------------------------------- ### Materialize workspace file for session Source: https://github.com/alikon-art/determinflow/blob/main/docs/workspace-contracts.md Use this method to explicitly materialize a workspace file for a session. It authorizes and reads the authoritative provider before accessing the cache, and verifies the content hash. Disabled or unauthorized calls create no directories, and the returned absolute path is never exposed by model tools. ```python path = await workspace.materialize_for_session( session, invocation_context=trusted_context, path="materials/source.txt", ) # Read/process this temporary file. Explicitly commit any intended output later. workspace.clear_cache() # Only after consumers finish with their paths. ``` -------------------------------- ### Plugin [settings] TOML metadata Source: https://github.com/alikon-art/determinflow/blob/main/docs/settings-extension-contract.md Declares a plugin settings category. The schema field is required; title, description, section_id, and order are optional with defaults: title from plugin name, description from plugin description, section_id "settings", and order 100. The public descriptor id becomes plugin::. ```toml [settings] schema = "settings.schema.json" title = "Example" description = "Connection and retrieval parameters" section_id = "memory" order = 90 ``` -------------------------------- ### WF_VAR and script_out output protocol Source: https://github.com/alikon-art/determinflow/blob/main/src/core/defaults/skills/script-library-guide/SKILL.md Output protocol for scripts to exchange structured results with the workflow via stdout. Tag casing must match exactly, and each WF_VAR key should use a stable variable name; list/dict values must be valid JSON with double quotes. Business logs must not fake these protocol tags. ```text result_key:value 给节点历史与下游摘要使用的短说明 ``` -------------------------------- ### POST /api/plugins/{id}/rollback Source: https://github.com/alikon-art/determinflow/blob/main/docs/plugin-packages.md Switches back to a historical revision. ```APIDOC ## POST /api/plugins/{id}/rollback ### Description Switches back to a historical revision. ### Method POST ### Endpoint /api/plugins/{id}/rollback ### Parameters #### Path Parameters - **id** (string) - Required - The plugin identifier. ``` -------------------------------- ### Required files at distribution root Source: https://github.com/alikon-art/determinflow/blob/main/docs/plugin-packages.md Files that every distribution root path must provide. `manifest.json.sig` is an Ed25519 signature over the raw bytes of `manifest.json`, either a 64-byte raw value or Base64/Hex text. ```text manifest.json manifest.json.sig ``` -------------------------------- ### DELETE /api/plugins/{id}/config Source: https://github.com/alikon-art/determinflow/blob/main/docs/plugin-packages.md Clears the explicit configuration and reuses environment and default values after restart. ```APIDOC ## DELETE /api/plugins/{id}/config ### Description Clears the explicit configuration and reuses environment and default values after restart. ### Method DELETE ### Endpoint /api/plugins/{id}/config ### Parameters #### Path Parameters - **id** (string) - Required - The plugin identifier. ``` -------------------------------- ### Schedule formats: once, interval, cron Source: https://github.com/alikon-art/determinflow/blob/main/src/core/defaults/skills/automation-guide/SKILL.md Defines the three supported schedule formats for DeterminFlow Cron jobs: once with a timezone-aware ISO 8601 timestamp, interval in integer minutes, and standard five-field cron expressions validated by croniter. After modifying a schedule, re-read the job to confirm next_run_at matches expectations. ```text once:2026-08-04T09:00:00+08:00 interval:60 cron:0 9 * * * ``` -------------------------------- ### POST /api/resource-marketplace/skills/:slug/reviews/:review_id/report Source: https://github.com/alikon-art/determinflow/blob/main/docs/resource-marketplace.md Reports a currently visible public review. ```APIDOC ## POST /api/resource-marketplace/skills/:slug/reviews/:review_id/report ### Description Reports a currently visible public review. The request body is {expected_updated_at, reason, details}. Cannot report your own review. ### Method POST ### Endpoint /api/resource-marketplace/skills/:slug/reviews/:review_id/report ### Parameters #### Path Parameters - **slug** (string) - Required - The slug of the skill. - **review_id** (string) - Required - The ID of the review to report. #### Request Body - **expected_updated_at** (string) - Required - The expected updated_at timestamp for CAS. - **reason** (string) - Required - The reason for the report. - **details** (string) - Optional - Additional details. ### Response #### Success Response (200) - **reported** (boolean) - Indicates the report was submitted. #### Response Example { "reported": true } ``` -------------------------------- ### Configure parserOptions for TypeScript ESLint Source: https://github.com/alikon-art/determinflow/blob/main/web/README.md Configure the top-level parserOptions to enable type-aware lint rules. This is the first step in expanding the ESLint configuration for a production React + TypeScript + Vite application. ```javascript export default tseslint.config({ languageOptions: { // other options... parserOptions: { project: ['./tsconfig.node.json', './tsconfig.app.json'], tsconfigRootDir: import.meta.dirname, }, }, }) ``` -------------------------------- ### DELETE /api/plugins/{id} Source: https://github.com/alikon-art/determinflow/blob/main/docs/plugin-packages.md Marks a plugin for uninstallation and disables it after restart. ```APIDOC ## DELETE /api/plugins/{id} ### Description Marks a plugin for uninstallation and disables it after restart. ### Method DELETE ### Endpoint /api/plugins/{id} ### Parameters #### Path Parameters - **id** (string) - Required - The plugin identifier. ``` -------------------------------- ### Registrar interface: add_memory_scope_authorizer and add_memory_provider Source: https://github.com/alikon-art/determinflow/blob/main/docs/memory-contracts.md Used to register a memory scope authorizer and a memory provider with the core memory runtime. The authorizer is a trusted owner-scoped object, and add_memory_scope_authorizer is the unique shared interface with product plugins. ```python registrar.add_memory_scope_authorizer(authorizer) registrar.add_memory_provider(provider) ```