add stable media support and sync skillhub UI

This commit is contained in:
wtgoku
2026-04-08 23:17:42 +08:00
parent ff4f370763
commit 4b20dc5e37
32 changed files with 6269 additions and 393 deletions
+11 -1
View File
@@ -13,6 +13,7 @@ It is meant to validate these product-facing APIs first:
- `run`
- `jobs`
- `artifacts`
- `media`
- basic `budget`, `project`, and `models` stubs
## Project Relationship
@@ -21,6 +22,8 @@ See [docs/project-relationship.md](./docs/project-relationship.md).
Persistence details for the current local backend are documented in
[docs/persistence.md](./docs/persistence.md).
Stable media URL behavior and rollout notes are documented in
[docs/stable-media-url-v1.md](./docs/stable-media-url-v1.md).
This note explains how `popiartcli`, `popiartServer`, and `PopiNewAPI` split responsibilities, and why routing, billing attribution, and provider access belong in the backend layers rather than the CLI.
@@ -48,6 +51,8 @@ Use it from `popiartcli`:
cd /Users/jiajia/popiartcli
go run ./cmd/popiart --endpoint http://127.0.0.1:8080/v1 auth login --key <your-popinewapi-key>
go run ./cmd/popiart --endpoint http://127.0.0.1:8080/v1 skills list
go run ./cmd/popiart --endpoint http://127.0.0.1:8080/v1 media upload ./source.png
go run ./cmd/popiart --endpoint http://127.0.0.1:8080/v1 artifacts upload ./source.png --role source
```
Optional skillhub source:
@@ -61,7 +66,12 @@ In local development, `/tmp/Popiart_skillhub` is used automatically when it exis
## Notes
- Local persistence is intentionally thin: `sessions`, `job refs`, and project route overrides live in SQLite.
- `artifact` no longer has a local blob store. For sync image results, the server stores `result_refs_json` in the job row and derives artifact metadata on demand.
- The local backend now keeps a lightweight media store under `POPIART_DATA_DIR/media/` and exposes stable `media` URLs for uploaded files and persisted job outputs.
- `artifact` metadata is still derived from `result_refs_json`, but new artifacts bind to a local `media_id` and a stable `url`.
- New endpoints now include:
- `POST /v1/media/upload`
- `GET /v1/media/:id`
- `GET /v1/media/:id/content`
- `job logs` are synthesized from job state transitions instead of being stored as a separate table.
- The local development backend verifies your login key against the local `PopiNewAPI`.
- This server is a development backend, not the final production architecture.