Skip to content

feat(artifact): pull an artifact's files and send where a share came from - #11

Merged
adamdotdevin merged 1 commit into
devfrom
artifact-pull
Nov 18, 2026
Merged

adamdotdevin merged 1 commit into
devfrom
artifact-pull

Conversation

@adamdotdevin

Copy link
Copy Markdown
Member

Console's artifact read APIs are live in production (/api/artifacts/:slug/files, /blobs/:sha256), and publish accepts source claims.

  • artifact pull <name> [dir] [--revision N] [--force] writes a revision's files to dir (default ./<name>). The folder must be new or empty unless --force. Unsafe paths (absolute, .., backslash, control characters) fail the whole pull before anything is written; a symlink on any segment under the folder stops it; every file is checked against its SHA-256 before writing; blobs are pinned to the listed revision.
  • artifact share sends source from git when the folder is in a repo: repo (remote.origin.url stripped of user, password, query, fragment and helper:: prefixes, matching Console's own stripping), branch, commitSha. Nothing outside git. No sessionID: the share subprocess can't know the harness session without walking the process tree, and the harness hook already starts the comment watch.
  • README and help updated.

Tests: 8 new in test/artifact.test.ts (source stripping with a real git repo and a token in the remote, scp and local remotes, pull latest and --revision, empty-folder rule and --force, unsafe paths, symlinked folder and file, digest mismatch); each broken on purpose and red. bun run check passes; the full suite passed on Linux (887 tests). Needs a normal release to reach npx @opencode/console.

@adamdotdevin
adamdotdevin merged commit d61bbd1 into dev Nov 18, 2026
1 check passed
@adamdotdevin
adamdotdevin deleted the artifact-pull branch November 18, 2026 03:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant