Skip to content
This repository was archived by the owner on Sep 7, 2026. It is now read-only.

Add agnes-media: image/video generation via Agnes AI API - #11

Closed
Fectivnfy112357 wants to merge 1 commit into
hetaoBackend:mainfrom
Fectivnfy112357:feat/agnes-media
Closed

Fectivnfy112357 wants to merge 1 commit into
hetaoBackend:mainfrom
Fectivnfy112357:feat/agnes-media

Conversation

@Fectivnfy112357

Copy link
Copy Markdown
Collaborator

What it solves

Calling a production media-generation API from an agent means juggling
request payloads, async task queues, polling and file download — error-prone
and slow to repeat. agnes-media wraps both Agnes AI production models
(agnes-image-2.1-flash sync images, agnes-video-v2.0 async videos) behind
a single stdlib-only Python script: image for seconds-fast images, video
for minute-scale videos with automatic frame-count math (8n+1) and built-in
polling.

Try it

Install from /pluginsLocal, then ask:

generate an image of a glowing floating city above a canyon at sunrise, cinematic, wide angle

Expected result: the generated image saved to the output directory
(default ~/Downloads), with the script printing ok=true and the file
paths.

Direct usage:

python <skill_dir>/scripts/agnes.py image --prompt "..." --size 2K --ratio 16:9
python <skill_dir>/scripts/agnes.py video --prompt "..." --duration 5
python <skill_dir>/scripts/agnes.py image --image a.png b.png --prompt "compose these"

Dependencies and platforms

  • An Agnes AI API key (paid service) — provided via --api-key, the
    AGNES_API_KEY environment variable, or an .env file.
  • Python 3.8+ (stdlib-only script).

Network and data

  • The script talks only to the Agnes AI API (apihub.agnes-ai.com).
  • The API key is read from the user's own environment/config; it is never
    stored in this plugin's directory.
  • Local input images are sent to the API as data URIs for image-to-image /
    video tasks.
  • No telemetry, no other third-party services.

Test evidence

  • npm run validateOK plugin Fectivnfy112357/agnes-media
  • Script exercised against the live Agnes AI API (image sync + video async
    with polling, image-to-image and keyframes paths in active use).

Agent-plugin contribution for the community registry:
plugins/Fectivnfy112357/agnes-media/

@hetaoBackend hetaoBackend left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

暂不符合收录门禁,当前 credential 与下载边界不安全:

  1. --api-key 会把 secret 放进 shell history/进程参数;Skill 还会静默扫描 ~/.hermes/.env、AppData 等其他工具的配置并把找到的 key 发给远端。请移除命令行 key,改为明确的环境变量/受控配置,并且不要跨产品目录自动发现凭据。
  2. README 声明只连接 apihub.agnes-ai.com,但下载逻辑会无条件跟随 API 返回的任意 URL,实际可能连接其他域名。请校验/allowlist 下载目标或准确披露;同时限制响应/下载大小、校验 content type,并使用安全文件名。
  3. 图像/视频输入会把本地文件完整发送到付费第三方服务。Skill 必须在发送前让用户确认具体文件、目标、数据用途和可能费用,不能仅在 README 泛化披露。
  4. 500/503 创建请求自动重试对付费生成可能重复计费/生成;除非 API 有 idempotency key 或明确幂等契约,不应自动重试 mutating POST。请禁用或实现可靠幂等。
  5. 请补离线 mock-server 测试覆盖 credential 来源、重试、轮询、任意下载 URL、超大响应和错误脱敏。

validator 通过只证明包结构,不证明付费远端调用安全。

@hetaoBackend hetaoBackend left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Fectivnfy112357 当前 head 仍存在多项高风险 blocker,暂不适合收录:

  1. 接受 --api-key 并静默扫描 Hermes 的多个凭据目录;secret 会进入 shell history/process args,也越界读取其他产品目录。
  2. 无条件下载 API 返回的任意 URL,跟随 redirect,无协议/域名/content-type/大小限制;vid 可作为路径逃逸文件名写出 --out
  3. 响应、本地输入、base64 和下载均无大小上限,存在内存/磁盘耗尽及半写文件风险。
  4. 对付费生成 POST 的 500/503 自动重试,但没有 idempotency key 或上游幂等证据,可能重复计费。
  5. 上传本地文件和触发付费生成前缺少目标、文件、用途和费用确认。
  6. 没有 plugin-specific 离线安全测试;当前通用 npm run check 通过不能覆盖上述行为。

请先整体重做凭据、下载、付费幂等和确认边界,再提交可复现离线测试。

@Fectivnfy112357
Fectivnfy112357 marked this pull request as draft August 15, 2026 16:33
@Fectivnfy112357 Fectivnfy112357 closed this by deleting the head repository Aug 17, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants