capafy-publisher
Creator-side Capafy workflow for publishing, updating, packaging, uploading, re-shipping, or managing an Agent/Skill. Also handles creator earnings, payouts, statistics, refunds, certification/KYC, review links, Agent continuation, and publisher-account switching. Generic buyer login, balance, orders, purchases, subscriptions, and instances belong to capafy-user.
- License 许可
- MIT
- 最近更新
- 2026-11-15
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- capafy-publisher
- description
- Creator-side Capafy workflow for publishing, updating, packaging, uploading, re-shipping, or managing an Agent/Skill. Also handles creator earnings, payouts, statistics, refunds, certification/KYC, review links, Agent continuation, and publisher-account switching. Generic buyer login, balance, orders, purchases, subscriptions, and instances belong to capafy-user.
02 资源文件 150
- 参考文档api-docs/00_overview.md35.1 KB
- 参考文档api-docs/index.json541 B
- 脚本capafy_platform/api.py4.0 KB
- 脚本capafy_platform/auth.py2.2 KB
- 脚本capafy_platform/defaults.py526 B
- 脚本capafy_platform/file_api.py8.1 KB
- 脚本capafy_platform/http_cli.py3.0 KB
- 脚本capafy_platform/http.py13.6 KB
- 脚本capafy_platform/login_commands.py3.2 KB
- 脚本capafy_platform/runtime_context.py4.3 KB
- 脚本capafy_platform/token_store.py2.4 KB
- 脚本packager.py7.7 KB
- 脚本packaging/__init__.py1.3 KB
- 脚本packaging/common/cli.py2.1 KB
- 脚本packaging/common/constants.py3.6 KB
- 脚本packaging/common/exclusion_rules.py3.6 KB
- 脚本packaging/common/final_zip_files.py3.0 KB
- 脚本packaging/common/fs.py5.9 KB
- 脚本packaging/common/home.py2.5 KB
- 脚本packaging/common/instruction_docs.py581 B
- 脚本packaging/common/local_path_detection.py5.9 KB
- 脚本packaging/common/minimal_toml.py9.2 KB
- 脚本packaging/common/packaged_files.py5.0 KB
- 脚本packaging/common/text_parse.py1.1 KB
- 脚本packaging/common/url_values.py2.5 KB
- 脚本packaging/config/dotenv.py3.0 KB
- 脚本packaging/config/json_io.py4.7 KB
- 脚本packaging/config/toml_loader.py3.1 KB
- 脚本packaging/config/yaml_loader.py1.0 KB
- 脚本packaging/publish/artifacts/archive.py4.4 KB
- 脚本packaging/publish/artifacts/bundle_context.py770 B
- 脚本packaging/publish/artifacts/package_invariants.py2.0 KB
- 脚本packaging/publish/artifacts/package.py1.9 KB
- 脚本packaging/publish/artifacts/path_refs.py1.8 KB
- 脚本packaging/publish/artifacts/relative_path_invariants.py5.3 KB
- 脚本packaging/publish/artifacts/validate_runtime.py9.7 KB
- 脚本packaging/publish/domain/contexts.py903 B
- 脚本packaging/publish/domain/publish_work_state.py15.0 KB
- 脚本packaging/publish/domain/source_snapshot.py2.4 KB
- 脚本packaging/publish/init/__init__.py286 B
- 脚本packaging/publish/init/command.py10.5 KB
- 脚本packaging/publish/init/discovery/__init__.py307 B
- 脚本packaging/publish/init/discovery/candidates.py14.9 KB
- 脚本packaging/publish/init/discovery/documents.py6.7 KB
- 脚本packaging/publish/init/discovery/runtime_units.py6.6 KB
- 脚本packaging/publish/init/draft.py9.8 KB
- 脚本packaging/publish/init/preconditions.py3.9 KB
- 脚本packaging/publish/init/state.py3.0 KB
- 脚本packaging/publish/platform/__init__.py495 B
- 脚本packaging/publish/platform/agent_request.py7.9 KB
- 脚本packaging/publish/platform/environment_selection.py7.6 KB
- 脚本packaging/publish/platform/facade.py3.6 KB
- 脚本packaging/publish/platform/remote_status.py6.0 KB
- 脚本packaging/publish/platform/required_credentials.py9.1 KB
- 脚本packaging/publish/platform/response_normalize.py1.8 KB
- 脚本packaging/publish/platform/runtime_mapping.py10.2 KB
- 脚本packaging/publish/platform/status.py3.8 KB
- 脚本packaging/publish/platform/upload.py4.4 KB
- 脚本packaging/publish/platform/url_proxy_environment.py8.4 KB
- 脚本packaging/publish/platform/url_proxy.py1.7 KB
- 脚本packaging/publish/profiles/download/prepare.py7.8 KB
- 脚本packaging/publish/profiles/download/stage.py7.2 KB
- 脚本packaging/publish/profiles/mode_dispatch.py1.3 KB
- 脚本packaging/publish/profiles/run_online/prepare.py12.4 KB
- 脚本packaging/publish/profiles/run_online/runtime_dependencies.py3.3 KB
- 脚本packaging/publish/profiles/run_online/stage.py7.8 KB
- 脚本packaging/publish/profiles/run_online/tree_copy.py5.1 KB
- 脚本packaging/publish/reviewed_scan.py12.6 KB
- 脚本packaging/publish/security/deep_scan_payload.py3.8 KB
- 脚本packaging/publish/security/scan/candidate_annotation.py4.1 KB
- 脚本packaging/publish/security/scan/entries.py7.7 KB
- 脚本packaging/publish/security/scan/env_reference_scan.py5.8 KB
- 脚本packaging/publish/security/scan/file_candidates.py6.6 KB
- 脚本packaging/publish/security/scan/scan_only_paths.py1.1 KB
- 脚本packaging/publish/security/scan/special_files.py8.4 KB
- 脚本packaging/publish/security/scan/staging_scan.py1.9 KB
- 脚本packaging/publish/security/scan/structured_scan_policy.py3.7 KB
- 脚本packaging/publish/security/scan/structured_value_candidates.py9.5 KB
- 脚本packaging/publish/security/scan/support.py1.5 KB
- 脚本packaging/publish/security/sensitive/deep_scan_findings.py9.0 KB
- 脚本packaging/publish/security/sensitive/keywords.py6.9 KB
- 脚本packaging/publish/security/sensitive/literals.py9.8 KB
- 脚本packaging/publish/security/sensitive/placeholders.py8.9 KB
- 脚本packaging/publish/security/sensitive/text_redact.py11.3 KB
- 脚本packaging/publish/security/sensitive/value_strip.py4.0 KB
- 脚本packaging/publish/selection/confirmed_resolution.py5.8 KB
- 脚本packaging/publish/selection/confirmed_workspace_documents.py10.7 KB
- 脚本packaging/publish/selection/explicit_skill.py10.8 KB
- 脚本packaging/publish/selection/external_skill_bindings.py10.4 KB
- 脚本packaging/publish/selection/inventory.py3.1 KB
- 脚本packaging/publish/selection/local_ref_confirmation.py6.1 KB
- 脚本packaging/publish/selection/markdown.py5.4 KB
- 脚本packaging/publish/selection/path_shapes.py4.6 KB
- 脚本packaging/publish/selection/selectable.py3.1 KB
- 脚本packaging/publish/selection/selection_groups.py8.2 KB
- 脚本packaging/publish/selection/symlinks.py3.2 KB
- 脚本packaging/publish/selection/unit_metadata.py3.0 KB
- 脚本packaging/publish/selection/units.py4.5 KB
- 脚本packaging/publish/staging/build_reviewed.py11.9 KB
- 脚本packaging/publish/staging/exclusions.py1.4 KB
- 脚本packaging/publish/staging/local_path_cleanup.py3.0 KB
- 脚本packaging/publish/staging/local_path_sanitizer.py3.4 KB
- 脚本packaging/publish/staging/markdown_references.py11.8 KB
- 脚本packaging/publish/staging/pipeline.py5.2 KB
- 脚本packaging/publish/staging/review.py6.8 KB
- 脚本packaging/publish/staging/selection_payload.py2.8 KB
- 脚本packaging/publish/staging/source_boundary.py4.1 KB
- 脚本packaging/publish/staging/source_snapshot_roots.py3.0 KB
- 脚本packaging/publish/staging/strip.py12.3 KB
- 脚本packaging/publish/staging/tree_copy.py3.1 KB
- 脚本packaging/publish/submit/binding.py13.9 KB
- 脚本packaging/publish/submit/command.py4.1 KB
- 脚本packaging/publish/submit/continue_upload.py10.2 KB
- 脚本packaging/publish/submit/prepare.py4.5 KB
- 脚本packaging/runtime/__init__.py1.2 KB
- 脚本packaging/runtime/contracts.py8.9 KB
- 脚本packaging/runtime/llm/api_formats.py1015 B
- 脚本packaging/runtime/llm/official_providers.py23.2 KB
- 脚本packaging/runtime/plugins/claude_sdk/url_proxy.py7.4 KB
- 脚本packaging/runtime/plugins/codex/home.py1.9 KB
- 脚本packaging/runtime/plugins/codex/target.py409 B
- 脚本packaging/runtime/plugins/codex/url_proxy.py9.9 KB
- 脚本packaging/runtime/plugins/hermes/config.py937 B
- 脚本packaging/runtime/plugins/hermes/provider.py6.5 KB
- 脚本packaging/runtime/plugins/hermes/route_scan.py6.7 KB
- 脚本packaging/runtime/plugins/hermes/target.py425 B
- 脚本packaging/runtime/plugins/hermes/url_proxy.py1.3 KB
- 脚本packaging/runtime/plugins/openclaw/official_providers.py3.2 KB
- 脚本packaging/runtime/plugins/openclaw/route_scan.py8.1 KB
- 脚本packaging/runtime/plugins/openclaw/selection.py5.9 KB
- 脚本packaging/runtime/plugins/openclaw/target.py4.7 KB
- 脚本packaging/runtime/plugins/openclaw/url_proxy.py2.5 KB
- 脚本packaging/runtime/plugins/openclaw/workspace_paths.py7.1 KB
- 脚本packaging/runtime/plugins/openclaw/workspace_plans.py3.4 KB
- 脚本packaging/runtime/plugins/support.py1.8 KB
- 脚本packaging/runtime/profiles/__init__.py3.1 KB
- 参考文档packaging/runtime/profiles/claude_sdk.json722 B
- 参考文档packaging/runtime/profiles/codex.json1.0 KB
- 参考文档packaging/runtime/profiles/hermes.json1.5 KB
- 参考文档packaging/runtime/profiles/openclaw.json1.2 KB
- 脚本packaging/runtime/profiles/path_resolver.py2.4 KB
- 脚本packaging/runtime/registry.py5.7 KB
- 脚本packaging/runtime/resolution.py4.7 KB
- 脚本packaging/runtime/stage_plan.py7.9 KB
- 脚本packaging/runtime/support.py1.2 KB
- 脚本packaging/runtime/validation.py5.1 KB
- 参考文档publish-workflow.md17.5 KB
- 参考文档requirements.txt17 B
- 脚本self_update_v2.py31.1 KB
- 脚本self_update.py30.1 KB
03 SKILL.md 正文
capafy-publisher
Use this file for entry points and rules that the host must enforce. Read publish-workflow.md for the state machine and sensitive-scan details. Read api-docs/00_overview.md for HTTP fields and platform enumerations.
Prerequisites
- Run scripts in this directory with
python3. - Python 3.8 or newer is required.
- The host must allow Python execution in this skill directory.
- Run
python3 self_update_v2.py --checkbefore publisher commands. If the installed version is belowminSupportedVersion, V2 installs the current release before the command is retried.
Read order
Read only:
SKILL.mdpublish-workflow.mdapi-docs/index.jsonapi-docs/00_overview.md
Do not read Markdown under .temp/, .pytest_cache/, dist/, or docs/.
Public commands
login-init
login-verify
login-token
publish-init
publish-submit
publish-status
publish-remote-status
publish-refresh-url
publish-list
Every command returns one of three JSON result shapes:
- Success:
ok: true,requires_action: false. - Expected pause:
ok: true,requires_action: true, withaction_type. - Failure:
ok: false,status: error,requires_action: false.
Use the JSON fields, not only the exit code, to decide what happens next.
Login
- Enter publisher login only for creator publishing or creator-account management. Generic Capafy login belongs to
capafy-user. - Email login requires explicit acceptance of both the Terms of Service and Privacy Policy before
login-init. - Email login flow:
login-initthenlogin-verify. - Use
login-init'sexpires_in_secfrom the successful send time; never assume a fixed OTP lifetime. After a failed or expired verification, runlogin-initfor a new challenge and email code before retryinglogin-verify. - Direct token or account switching:
login-token --access-token <token>. - If the publish request itself contains an explicitly supplied token (for example
token: ...,token:...,access_token: ..., oraccess token: ...), including a token next to a Publisher installation request, treat it as a direct developer-Skill token handoff even when it appears alongside an install request. Runlogin-tokenbeforepublish-init; when Publisher was just installed, run it immediately after installation. A successful validation replaces the developer Skill (capafy-publisher) rootconfig.jsontoken. Never fall back silently to the old local token, usecapafy-user/config.json, or echo/log the supplied token. - Never echo a token, OTP, authorization header, or raw login response.
login-tokenvalidates the token throughGET /agent/accountbefore saving it.- Token priority is
CAPAFY_ACCESS_TOKEN, then the publisher skill's localconfig.json. - Platform base URL priority is explicit
--base-url, thenCAPAFY_PLATFORM_BASE_URL, then the code default.
Main publish chain
publish-init without selections
→ creator/LLM confirms a real candidate
→ publish-init with selections
→ web confirmation of selected skills/files
→ publish-submit(action=prepare)
→ handle deep scan, dispositions, or environment-name selection locally
→ publish-submit(action=continue_upload)
→ upload the package and submit packageUrl + requiredCredentials once
→ final web review and configuration confirmation
→ publish-remote-status
Web pages serve two purposes:
- Confirm files and selected skills after
publish-init. - Review the uploaded package, confirm Run Online credentials when required, and submit the version for review after
continue_upload.
When a command returns review_url, paste it verbatim, explain its purpose in one sentence, and pause. Refresh expired links with publish-refresh-url; do not rerun a publish step only to get a new link.
Non-negotiable host rules
- MUST decide new Agent versus version update before submitting
publish-initselections. - MUST run Phase A (
publish-initwithout selections) before creating the selections file. - MUST use only candidate paths returned by Phase A; never guess or recover a local path from platform history.
- For an update, MUST keep the original
agent_idand reconcileworkflowInfo.selection_groupsfirst. - When
review_urlis returned, MUST paste it verbatim and STOP until the creator completes that web page. requires_action: trueis an expected pause, not a command failure.- MUST use
publish-remote-statusfor platform review state;publish-statusis local-only. - NEVER display tokens, secrets,
generic.value, or raw platform responses in chat or normal CLI output.
Creator-facing language
Do not expose internal field names as if the creator already knows them. Translate them:
| Internal term | Creator-facing wording |
|---|---|
--runtime-dir |
project root or current workspace |
--skill-dir |
skill source directory |
--env |
target runtime |
agent_id |
Agent ID |
agent_type: run_online |
Run Online mode |
agent_type: download |
Download mode |
selection_groups |
skills/files selected for this release |
.temp or manifest |
local draft |
--reset-local-state |
discard the local draft and start over |
--deep-scan |
use the LLM to inspect every staged file for missed sensitive values |
--dispositions-file |
choices for replacing or excluding sensitive Download values |
--environment-selection-file |
optional local environment-variable name selection |
publish-init rules
--envand--runtime-dirare always required.--runtime-diris the current project/workspace root, not the publisher directory and not the skill directory.- Use
--skill-dironly for one explicit skill directory containingSKILL.md. - Support one selected skill or multiple selected skills in the same release. A creator-merged skill with one entry
SKILL.mdis one selection; preserve its internal component directories and files. - Preserve
./and../references; they are not creator-local absolute paths. Packaging validates explicit relative Markdown link destinations against the final ZIP layout. Commands, code examples, and configuration paths may use a runtime working directory; do not resolve them relative to the document or rewrite the creator's source to satisfy this check. - Run discovery before submitting selections. Never invent a candidate path.
- Submit selections with
--selections-file. skills[]must contain at least one real candidate.- Use one Agent ID source. If both the CLI and selections contain it, they must match.
- Reuse the same runtime and explicit skill paths between discovery and submission.
- Before updating an existing Agent, read the latest platform selection and ask whether to keep the current skill or switch.
- Historical platform paths are logical paths, not proof of the current local filesystem location.
- Use
--reset-local-stateonly when the creator explicitly abandons the active local draft.
Runtime path notes and copy-pastable examples live in publish-workflow.md.
Deep scan
Run Online and Download both support deep scan.
Deep scan means the host LLM reads every file under the returned staging_path and looks for sensitive literals that the regular rule scan missed. scan_files lists the complete staging file set and marks which files can produce package findings.
Rules:
- Ask the creator before spending the extra time and tokens.
- Do not inspect host environment-variable values.
- Do not recreate items already found by the rule scan.
- Do not create
url_proxyentries. Only report missed generic sensitive values. - Findings must use a concrete staged file as
source. - Pass findings through
--deep-scan-findings-file; never hand-edit reviewed-scan output. - If nothing is found, rerun
publish-submit --action preparewithout--deep-scan. needs_deep_scanis an expected pause and exits successfully in both modes.
Mode-specific publish-submit inputs
--dispositions-fileis Download-only. Run Online rejects it.--environment-selection-fileis Run Online-only. Download rejects it.--deep-scanand--deep-scan-findings-fileare separate steps and cannot be used together.--deep-scanand--environment-selection-filecannot be used together. Complete deep scan first, then submit findings and any environment-name selection on the nextpublish-submit --action preparerun.- Normal Run Online preparation records environment-variable names only. It reads values only when the creator explicitly selects names for inclusion in the final merged submission.
- When the creator explicitly asks to upload local values for candidate environment variables, treat that request as authorization to edit only the generated selection file's
selectedarray and rerunpublish-submit --action preparewith--environment-selection-file. If a selected value is missing locally, stop before upload; otherwise the final review page remains the human confirmation boundary. - Read only the exact selected environment-variable names. Never enumerate the host environment or display, log, or persist the selected values.
Status and recovery
publish-statusshows only the local draft summary.publish-remote-status --agent-id <id>shows the latest platform version and confirmed selection.publish-listreturns the creator's minimal Agent list for choosing an Agent ID.- Resume
publish-submitfailures from the matching local draft. Do not create a new Agent to recover from a later-step failure. - A rejected version must be rebuilt through the same Agent ID.
--reset-local-statechanges local files only; it does not cancel anything on the platform.
Safety boundaries
- Never upload login state, private keys, OAuth caches, credentials stores, or unselected host environment-variable values. Selected host environment-variable values may be uploaded only through the explicit Run Online
--environment-selection-fileflow above. - Never expose raw platform responses, signed upload URLs, presign headers, tokens, OTPs, or internal absolute paths in normal CLI output.
- Do not edit the creator's source files during packaging. Sensitive replacement happens only in staging.
- Do not bypass creator confirmation pages.
See publish-workflow.md for exact re-entry branches, staging rules, reviewed-scan structure, and runtime-specific examples.
04 同仓库更多 Skills
rag-architect-agent
Agente Arquiteto de RAG, Embeddings & Busca Vetorial. Especialista em design e implementação de pipelines de Retrieval-Augmented Generation de alta fidelidade: chunking semântico, modelagem pgvector no PostgreSQL (Neon/Supabase), busca híbrida (cosseno + BM25), reranking, validação via TypeSafe AI e filosofia Ponytail (anti-overengineering).
rag-architecture-patterns
Padrões arquiteturais e implementação de pipelines RAG (Retrieval-Augmented Generation) de alta fidelidade para qualquer projeto ou sistema. Cobre chunking semântico, embeddings, busca híbrida (pgvector + BM25), reranking, validação via TypeSafe AI e filosofia Ponytail (anti-overengineering).
skill-repair
Use this to fix and re-install agent skills that have failed installation. This skill provides the necessary context and permissions to surgically update the `manifest.json` after a fix has been applied.
security-scan
Scan your Claude Code configuration (.claude/ directory) for security vulnerabilities, misconfigurations, and injection risks using AgentShield. Checks CLAUDE.md, settings.json, MCP servers, hooks, and agent definitions.
security-review
Use this skill when adding authentication, handling user input, working with secrets, creating API endpoints, or implementing payment/sensitive features. Provides comprehensive security checklist and patterns.
security-bounty-hunter
Hunt for exploitable, bounty-worthy security issues in repositories. Focuses on remotely reachable vulnerabilities that qualify for real reports instead of noisy local-only findings.