30 Commits

Author SHA1 Message Date
aeonframework 1afe545929 fix(security): route untrusted XML parsing through defusedxml
The repo's threat model (SECURITY.md) calls out XML/SVG content as a key
attack surface and lists "ElementTree auto-escaping" as the mitigation.
That covers XML *output* (serialization). XML *input* (parsing) across
the agent backends still goes through stdlib `xml.etree.ElementTree`,
which is vulnerable to entity-expansion DoS ("billion laughs" /
quadratic blowup) — Python 3.7.1 disabled external-entity lookup on ET
by default, but internal-entity expansion is still possible and can
exhaust CPU/RAM from a small file.

Migrate the parse/fromstring call sites in production code paths to
defusedxml.ElementTree (drop-in API). Construction calls (Element,
SubElement, tostring, register_namespace) are left on stdlib ET — those
don't parse untrusted input. Tests are left as-is in this PR.

Detected by Aeon + semgrep p/security-audit + p/owasp-top-ten
(rules: use-defused-xml, use-defused-xml-parse).
Severity: medium (DoS from agent-ingested files; not RCE).
CWE-776 Improper Restriction of Recursive Entity References.
2026-05-19 07:59:52 +00:00
yuhao aec2c13226 feat(preview): add preview trajectories and demos 2026-04-24 15:31:08 +00:00
yuhao 9b85f07fc9 feat(preview): add live preview protocol and motion demos 2026-04-24 15:31:08 +00:00
yuhao ef86f4dcc7 Fix Shotcut melt rendering and inclusive timeline timing 2026-04-20 12:10:05 +00:00
Feng Yu f6e6a899dc fix(shotcut): fix --at regression on non-empty tracks, update docs
- Rewrite _absolute_insertion_point() to walk physical playlist children
  instead of using broken prop_offset calculation
- Fix ducking window separator from ':' to '..' for correct timecode parsing
- Add 3 regression tests for --at insertion on non-empty tracks
- Update README: mark melt/ffmpeg as required dependencies, add REPL
  command reference with example session
- Update SKILL.md: add complete REPL command list, two-step workflow docs
- Sync SKILL.md to root mirror
2026-04-20 17:39:40 +08:00
Feng Yu 66be2a2e54 feat(shotcut): adopt two-step import/add model, remove batch_mode
- Split add_clip into import_media() + add_clip(clip_id) for chain sharing
- Port upstream features: --at absolute placement, volume-envelope, duck
- Fix ducking window parser: use '..' separator instead of ':' to avoid
  timecode ambiguity (split(":",1) on "HH:MM:SS.mmm:HH:MM:SS.mmm")
- Remove batch_mode; chain sharing is now the default behavior
- Add 8 new tests (208 total), 91% coverage
2026-04-20 10:30:23 +08:00
yuhao e81c3a9409 docs(skill): sync video creation harness guidance 2026-04-19 16:25:19 +00:00
yuhao 8120c9f231 fix(cli): improve video creation harness workflows 2026-04-19 16:00:33 +00:00
yuhao 99f92f0525 WIP transfer root-skills and hub updates 2026-04-18 10:12:58 +00:00
Yuhao 0b8302b173 Merge pull request #92 from jarrodcolburn/fix/melt-tractor-duration
fix(shotcut): set tractor out= before melt render to avoid 4-hour output
2026-04-17 23:33:23 +08:00
yuhao 18f75791f3 add auto-save and dry-run for all session-based softwares on one-shot cmds; highlight the design in cli-anything skill 2026-04-13 17:32:06 +00:00
sehawq 0c620b9543 test(shotcut): add unit tests for _set_tractor_out()
Cover single clip, multi-segment with blanks, and empty timeline cases
to verify tractor/background/black producer out= is set correctly.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-08 17:23:02 +03:00
ZJZAC ad83a32283 security: block extra_args from bypassing codec allowlist
extra_args could pass vcodec=..., acodec=..., or -consumer to override
the validated codec parameters. Add _validate_extra_args() that rejects
any argument starting with these prefixes.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 16:50:38 +08:00
ZJZAC 8935f478c5 security: add codec allowlist validation in melt backends
When an AI agent constructs CLI commands, it may pass arbitrary strings as
codec parameters — either through prompt injection, hallucination, or
processing untrusted input. Since codec values are passed directly to
melt/ffmpeg subprocesses, unvalidated input is an injection risk.

Fix: add ALLOWED_VCODECS / ALLOWED_ACODECS allowlists to both kdenlive
and shotcut melt_backend.py. All codec parameters are validated before
reaching subprocess.run(). Unknown codecs raise ValueError with a list
of valid options.

Also add SECURITY.md documenting the project's threat model (AI agents
as CLI callers), attack surfaces, reporting process, and security
guidelines for harness developers.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 16:17:18 +08:00
Yuhao 4fda419f4a Merge pull request #94 from ZJZAC/fix/session-race-condition
fix(session): atomic file locking to prevent race conditions in all harnesses
2026-03-17 16:30:03 +08:00
ZJZAC 2f44c85f7c fix(session): add atomic file locking to prevent race conditions in all harnesses
Closes #51

The root cause: all 10 harnesses used bare `open("w") + json.dump()` for
session saves. `open("w")` truncates the file before any lock can be
acquired, so concurrent writes silently corrupt or lose data.

Fix: add `_locked_save_json()` to each session.py that opens with "r+"
(no truncation), acquires fcntl.LOCK_EX, then truncates inside the lock.
Falls back gracefully on Windows where fcntl is unavailable.

Also:
- Update HARNESS.md with session file locking guidance (per maintainer
  request on PR #52)
- Add concurrent write tests (4 threads × 50 writes) to verify the fix

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-17 14:35:13 +08:00
J. Courtland Colburn 05876bdf5d fix(shotcut): set tractor out= before melt render to avoid 4-hour output
When clips are added to the timeline, the MLT tractor element is created
with out="00:00:00.000" and never updated. The background track defaults to
out="04:00:00.000" (a Shotcut convention). Without an explicit tractor out,
melt falls back to the longest track and renders a ~4-hour file instead of
the actual content duration.

Fix: calculate the real content duration from all non-background playlists
(summing entry in/out spans and blank lengths), then set out= on the tractor,
background playlist entry, and black producer before writing the temp MLT.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-16 18:12:20 -04:00
J. Courtland Colburn 24082fe2b7 chore: add .worktrees/ to .gitignore 2026-03-16 18:07:51 -04:00
yuhao 11acc2c66c Merge remote-tracking branch 'origin/main' into feature/skill-generation
# Conflicts:
#	.gitignore
#	blender/agent-harness/setup.py
2026-03-16 09:37:34 +00:00
yuhao 31abba22a4 docs: populate Command Groups tables in all 11 SKILL.md files
Fill in the previously empty command tables with actual commands
extracted from each CLI's Click decorators. All 11 harnesses now
have complete command documentation in their SKILL.md files.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-16 09:23:30 +00:00
yuhao 1db1622156 refactor: move SKILL.md inside Python package for pip install support
Move skills/SKILL.md from the harness root into
cli_anything/<software>/skills/SKILL.md so it is installed alongside the
package via pip. Add package_data to all 11 setup.py files. Make
ReplSkin auto-detect the skill file relative to its own __file__
location, removing the need for an explicit skill_path argument.
Update HARNESS.md, cli-anything.md, plugin README, and main README.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-16 09:06:31 +00:00
yuhao f73833d15a refactor: rename skill files to SKILL.md, drop software prefix from filename
Standardize skill file naming from <software>_SKILL.md to SKILL.md across
all 11 harnesses. Update skill_generator.py, HARNESS.md, repl_skin.py,
cli-anything.md, and plugin README.md to reference the new path. Add
SKILL.md generation section to main README.md and mark roadmap item done.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-16 08:39:51 +00:00
7. Sun 479fa5c31e feat(session): sort JSON keys for deterministic agent diffing 2026-03-15 07:57:50 +00:00
Alon Tevet 167b8a8b51 feat: Add skill path display in CLI banner and generate SKILL.md for all harnesses
## Changes

### 1. Display skill path in CLI header (repl_skin.py)
- Added `skill_path` parameter to ReplSkin class
- Banner now displays skill path when provided: `◇ Skill: skills/<software>_SKILL.md`
- This enables AI agents to discover where to read the skill documentation

### 2. Generate SKILL.md files for all 11 existing CLI harnesses
- anygen/agent-harness/skills/anygen_SKILL.md
- audacity/agent-harness/skills/audacity_SKILL.md
- blender/agent-harness/skills/blender_SKILL.md
- drawio/agent-harness/skills/drawio_SKILL.md
- gimp/agent-harness/skills/gimp_SKILL.md
- inkscape/agent-harness/skills/inkscape_SKILL.md
- kdenlive/agent-harness/skills/kdenlive_SKILL.md
- libreoffice/agent-harness/skills/libreoffice_SKILL.md
- obs-studio/agent-harness/skills/obs_studio_SKILL.md
- shotcut/agent-harness/skills/shotcut_SKILL.md
- zoom/agent-harness/skills/zoom_SKILL.md

### 3. Update HARNESS.md with skill path guidance
- Updated Phase 3 (REPL section) to show skill_path parameter usage
- Added "Display Skill Path in CLI Banner" section in Phase 6.5

### 4. Fix skill_generator.py syntax error
- Fixed list comprehension indentation on line 80-81

Addresses maintainer feedback from PR #47 comment:
- "displaying the skill path on the cli header so that agents can know where to read it"
- "generate skill.md files for all existing CLIs we have in the repo"

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-14 12:44:51 +02:00
Yuhao 92754d19c0 Merge pull request #15 from Jah-yee/fix/shotcut-auto-save
fix(shotcut): add auto-save option for one-shot mode
2026-03-11 17:02:57 +08:00
Yuhao fc817feea9 Merge pull request #13 from jarrodcolburn/fix-shotcut-lxml-dependency
fix: [shotcut] add missing lxml dependency to shotcut/agent-harness/setup.py
2026-03-11 17:01:03 +08:00
OpenClaw 02acd54ca1 fix: replace placeholder URLs with correct HKUDS/CLI-Anything URL
Fixed 8 setup.py files that had placeholder URLs:
- Changed 'yourusername' to 'HKUDS'
- Changed repo name to 'CLI-Anything'

This fixes broken metadata when packages are published to PyPI.
2026-03-11 13:53:20 +08:00
OpenClaw 17a30ba82b fix(shotcut): add auto-save option for one-shot mode
Add -s/--save flag to automatically save project after each mutation
command. This fixes the issue where one-shot commands don't persist
changes because each command runs in a new process with a fresh session.

Usage:
  shotcut-cli --project edit.mlt -s timeline add-track --type video
  # Now auto-saves after adding the track

Without -s flag, behavior is unchanged (explicit save required).
2026-03-11 02:52:33 +08:00
J. Courtland Colburn 67ef3e554e fix: add missing lxml dependency to shotcut/agent-harness/setup.py 2026-03-10 07:52:12 -04:00
yuh 01488030bd first commit 2026-03-08 21:58:43 +08:00