返回 Skill 列表
extension
分类: 开发与工程无需 API Key

PPTmaker

Upload any locally generated artifact back to SSTIDP and return a user-visible download URL. Use after any skill, tool, or shell command that leaves real files in the workspace or sandbox.

person作者: zweiwenhubModelScope

When to Use

Use this skill when any upstream step has already created a real local artifact and the user now needs a downloadable platform link.

Typical examples:

  • A report generator produced .docx, .pdf, .xlsx, .csv, .md, or .html files.
  • An image, audio, or video step produced .png, .jpg, .webp, .mp3, .wav, or .mp4 files.
  • A code or shell step exported .json, .txt, .zip, .tar.gz, or other build artifacts.
  • The upstream step wrote several files into a directory and the user wants the latest one or a packaged archive.
  • The user explicitly asks for a download link instead of only a local sandbox path.

Core Rules

1. This skill publishes links; it does not generate files

  • Use it after any file-producing skill, tool call, script, or shell command.
  • Do not call it until a real file already exists on disk.
  • Never invent a path just to produce a link.

2. It is format-agnostic

  • This skill is not limited to Word documents.
  • If the platform upload endpoint accepts the file bytes, this skill can publish the link.
  • Common cases include documents, spreadsheets, archives, code exports, images, audio, video, logs, and structured data files.

3. Prefer absolute existing paths, but support discovery when needed

  • Always use an absolute local path when possible.
  • If a previous step returned a relative path, resolve it before upload.
  • If the file does not exist, stop and fix the generation step first.
  • If the upstream step only gives you a directory, glob, or output folder, use the helper script's discovery options.
  • If the file was just created in the current sandbox working directory, prefer ./file.ext or file.ext over $(pwd)/file.ext.

4. Required config is the platform API, not MinIO

  • This skill uploads through the SSTIDP application API such as /api/file or /api/application/.../upload_file.
  • BASE_URL must point to the SSTIDP service that exposes those API routes.
  • MinIO endpoint, bucket, access key, and secret key are not substitutes for BASE_URL or API_TOKEN.
  • If BASE_URL or API_TOKEN is missing, stop and surface that configuration gap instead of probing unrelated storage variables.

5. Default to generic upload for first-round testing

  • The helper script defaults to the generic /api/file endpoint.
  • This only requires BASE_URL and API_TOKEN, so it is the easiest way to test whether link publishing works.
  • Generic upload is enough when the immediate goal is “return a user-visible download URL”.

6. Chat upload is optional and only for later use

  • If UPLOAD_MODE=chat and both APPLICATION_ID and CHAT_ID are configured, the script will call the chat upload endpoint.
  • Chat mode is useful when you want the file to follow the conversation lifecycle.
  • For the first verification round, prefer generic upload mode unless chat binding is required.

7. Surface the result clearly

  • After upload succeeds, return the relative URL and absolute URL.
  • Prefer a markdown link like [下载 文件名](relative_url) in the final answer.
  • If helpful, also include the plain absolute URL for copy-and-paste use outside the platform.

8. Treat the helper implementation as read-only

  • publish_download_link.py, SKILL.md, and sibling files are part of the skill implementation.
  • Do not use write_file, edit_file, str_replace, or similar tools to modify anything under /skills/download-link-publisher/ during normal skill execution.
  • Execute the helper script as-is and consume its stdout instead of rewriting the script to change output shape.
  • If the output format feels inconvenient, parse the existing UPLOAD_RESULTS_JSON= block rather than patching the script.
  • If upload fails, fix the input path or config, or report the failure. Do not mutate the skill implementation in place.

9. Use the narrowest discovery rule that matches the artifact

  • If you already know the file path, use --file.
  • If the producer writes into a folder, use --dir with one or more --pattern rules.
  • If only the newest artifact matters, add --latest.
  • If the upstream step produces a whole folder, use --zip-dir to publish one archive.
  • Use --dry-run first if file selection is ambiguous.

Helper Script

The helper script publish_download_link.py is stored next to this SKILL.md.

Treat that script as read-only during normal use. A successful run already emits a machine-readable UPLOAD_RESULTS_JSON= block and a human-readable DOWNLOAD_LINKS: section. After one successful upload for the chosen artifact, stop using this skill and answer the user. Do not rerun the same upload just to reshape the output.

Typical single-file command:

python <skill_dir>/publish_download_link.py --file "/absolute/path/to/output.any"

Multiple files are also supported:

python <skill_dir>/publish_download_link.py --file "/absolute/path/to/a.pdf" --file "/absolute/path/to/b.png"

Upload the newest matching file in a build directory:

python <skill_dir>/publish_download_link.py --dir "/workspace/output" --pattern "*.pdf" --pattern "*.docx" --latest

Resolve candidates first without uploading:

python <skill_dir>/publish_download_link.py --dir "/workspace/output" --pattern "*.xlsx" --recursive --dry-run

Zip a whole folder and publish that archive:

python <skill_dir>/publish_download_link.py --zip-dir "/workspace/export_bundle"

The script automatically loads a sibling .env file when the platform mounts this skill and injects skill parameters.

Supported Config Keys

  • BASE_URL: Required. Example: http://127.0.0.1:8081
  • API_TOKEN: Required. Supports raw token or Bearer <token>
  • UPLOAD_MODE: Optional. auto, file, or chat. Default is auto
  • APPLICATION_ID: Optional. Required only for chat upload mode
  • CHAT_ID: Optional. Required only for chat upload mode
  • DEBUG: Optional. true or false. Only used by chat upload mode
  • SOURCE_TYPE: Optional. Used by generic /api/file mode
  • SOURCE_ID: Optional. Used by generic /api/file mode
  • META: Optional. JSON string merged into generic upload metadata

Recommended Workflow

  1. Let an upstream producer create the file or output directory.
  2. If you already have a direct file path, run publish_download_link.py with --file.
  3. If you only have a directory or output area, use --dir/--pattern, --glob, or --zip-dir.
  4. If file selection is ambiguous, run once with --dry-run.
  5. Run the real upload command.
  6. Read UPLOAD_RESULTS_JSON= or DOWNLOAD_LINKS: from the script output.
  7. Reply to the user with the generated markdown link and the plain URL.
  8. Stop after the first successful upload. Only rerun if the previous attempt failed or the selected file was wrong.

Compatible Producers

This skill is designed to follow any upstream producer that leaves a real local file, including:

  • document generators
  • spreadsheet exporters
  • image or video renderers
  • dataset and report exports
  • code or JSON artifact writers
  • shell commands and custom scripts
  • archive and build packaging steps