feat(sculptok): add sculptok#1333
Conversation
|
@greptileai review Auto-nudge from |
There was a problem hiding this comment.
Pull request overview
Adds a new published CLI + MCP server under library/ai/sculptok/ for the SculptOK api-open surface, including hand-authored workflow commands and a local SQLite mirror to support offline operations in the printed catalog.
Changes:
- Introduces the SculptOK printed CLI (
sculptok-pp-cli) and MCP server (sculptok-pp-mcp) with generated endpoint coverage plus hand-authored “generate/cost/search/analytics/reconcile/sync” workflows. - Adds a pure-Go SQLite store + tests to persist jobs/credit events/drawings for offline querying and reporting.
- Includes publish artifacts and provenance (manuscripts, patch index entries, goreleaser/golangci configs, NOTICE/AGENTS/release-ledger skeletons).
Reviewed changes
Copilot reviewed 109 out of 111 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| library/ai/sculptok/NOTICE | Adds NOTICE for the new printed CLI directory. |
| library/ai/sculptok/mcp-descriptions.json | Adds MCP tool description overrides (e.g., credits_balance). |
| library/ai/sculptok/manifest.json | Adds MCP manifest for sculptok-pp-mcp (entrypoint + required user config). |
| library/ai/sculptok/Makefile | Adds local build/test/lint/install targets for CLI and MCP binaries. |
| library/ai/sculptok/internal/types/types.go | Adds basic API data types for credits/drawings. |
| library/ai/sculptok/internal/store/store_test.go | Adds store tests for upsert/list/search/analytics/reconcile/read-only open behavior. |
| library/ai/sculptok/internal/sculptok/client_test.go | Adds httptest-based client tests (envelope errors, submit/status/upload, paging). |
| library/ai/sculptok/internal/mcp/cobratree/walker.go | Adds Cobra-tree walker registering shell-out MCP tools for CLI commands. |
| library/ai/sculptok/internal/mcp/cobratree/typemap.go | Adds flag→MCP schema mapping for Cobra/pflag flags. |
| library/ai/sculptok/internal/mcp/cobratree/shellout.go | Adds MCP shell-out execution, root-flag blocking, and CLI arg synthesis. |
| library/ai/sculptok/internal/mcp/cobratree/names.go | Adds tool-name normalization for command paths. |
| library/ai/sculptok/internal/mcp/cobratree/cli_path.go | Adds companion CLI path resolution (sibling/env/PATH). |
| library/ai/sculptok/internal/mcp/cobratree/classify.go | Adds command classification (endpoint/framework/novel/hidden) for MCP mirroring. |
| library/ai/sculptok/internal/cliutil/verifyenv.go | Adds verifier/dogfood env-var gates used by generated and hand-authored commands. |
| library/ai/sculptok/internal/cliutil/text.go | Adds text normalization + stored-time parsing + auth/error helpers. |
| library/ai/sculptok/internal/cliutil/ratelimit.go | Adds adaptive limiter + Retry-After parsing + backoff helpers. |
| library/ai/sculptok/internal/cliutil/probe.go | Adds lightweight reachability probing helper. |
| library/ai/sculptok/internal/cliutil/odata_date.go | Adds OData date parsing helper. |
| library/ai/sculptok/internal/cliutil/odata_date_test.go | Adds tests for OData date parsing behavior. |
| library/ai/sculptok/internal/cliutil/jwtshape.go | Adds JWT shape heuristics + cookie-jar scanning helper. |
| library/ai/sculptok/internal/cliutil/jwtshape_test.go | Adds tests for JWT shape checks and cookie-jar extraction. |
| library/ai/sculptok/internal/cliutil/fanout.go | Adds generic bounded-concurrency fanout runner with deterministic error reporting. |
| library/ai/sculptok/internal/cliutil/extractnumber.go | Adds JSON number/string numeric extractors for loose-typed JSON. |
| library/ai/sculptok/internal/cliutil/extractnumber_test.go | Adds tests for ExtractNumber/ExtractInt edge cases. |
| library/ai/sculptok/internal/cliutil/duration.go | Adds duration parsing that extends stdlib with d/w suffixes. |
| library/ai/sculptok/internal/cliutil/duration_test.go | Adds tests for loose duration parsing. |
| library/ai/sculptok/internal/client/client_verify_short_circuit_test.go | Adds tests pinning verify-mode mutating-verb short-circuit behavior. |
| library/ai/sculptok/internal/client/client_test.go | Adds tests for response-body truncation behavior. |
| library/ai/sculptok/internal/cli/which_test.go | Adds tests for the which command ranking/index behavior. |
| library/ai/sculptok/internal/cli/version.go | Adds version command implementation and build-time override hook. |
| library/ai/sculptok/internal/cli/truncate_json_array.go | Adds hand-authored helper used by generated list commands to enforce --limit. |
| library/ai/sculptok/internal/cli/sync.go | Adds hand-authored sync from free history endpoints into the local store. |
| library/ai/sculptok/internal/cli/search.go | Adds offline search across local jobs/credits/drawings. |
| library/ai/sculptok/internal/cli/search_test.go | Adds placeholder skipped test for novel search command. |
| library/ai/sculptok/internal/cli/sculptok_shared_test.go | Adds tests for shared SculptOK workflow helpers (cost, image field, URL check). |
| library/ai/sculptok/internal/cli/reconcile.go | Adds offline reconcile command (credit charges without matching local job). |
| library/ai/sculptok/internal/cli/reconcile_test.go | Adds placeholder skipped test for novel reconcile command. |
| library/ai/sculptok/internal/cli/promoted_drawings.go | Adds generated/presented drawings list command wrapper. |
| library/ai/sculptok/internal/cli/import.go | Adds generic JSONL import framework command (POST per record). |
| library/ai/sculptok/internal/cli/generate.go | Adds generate command group wiring for depthmap/stl/threed/restore. |
| library/ai/sculptok/internal/cli/generate_threed.go | Adds hand-authored image→3D workflow command. |
| library/ai/sculptok/internal/cli/generate_threed_test.go | Adds placeholder skipped test for generate threed command. |
| library/ai/sculptok/internal/cli/generate_stl.go | Adds hand-authored image→STL workflow command. |
| library/ai/sculptok/internal/cli/generate_stl_test.go | Adds placeholder skipped test for generate stl command. |
| library/ai/sculptok/internal/cli/generate_restore.go | Adds hand-authored restore (bg removal / HD restore) workflow command. |
| library/ai/sculptok/internal/cli/generate_depthmap.go | Adds hand-authored depthmap workflow command. |
| library/ai/sculptok/internal/cli/generate_depthmap_test.go | Adds placeholder skipped test for generate depthmap command. |
| library/ai/sculptok/internal/cli/draw.go | Adds generated hidden draw command group for raw async submit/status endpoints. |
| library/ai/sculptok/internal/cli/draw_status.go | Adds generated draw status endpoint command. |
| library/ai/sculptok/internal/cli/deliver.go | Adds --deliver sink parsing and delivery implementations (stdout/file/webhook). |
| library/ai/sculptok/internal/cli/credits.go | Adds generated hidden credits command group. |
| library/ai/sculptok/internal/cli/credits_history.go | Adds generated credits history endpoint command. |
| library/ai/sculptok/internal/cli/credits_balance.go | Adds generated credits balance endpoint command. |
| library/ai/sculptok/internal/cli/cost.go | Adds hand-authored cost estimator comparing expected spend vs live balance. |
| library/ai/sculptok/internal/cli/cost_test.go | Adds placeholder skipped test for novel cost command. |
| library/ai/sculptok/internal/cli/auth.go | Adds auth management commands (setup/status/set-token/logout). |
| library/ai/sculptok/internal/cli/api_discovery.go | Adds API discovery browser (api command) for hidden interface endpoints. |
| library/ai/sculptok/internal/cli/analytics.go | Adds offline analytics aggregation over locally synced credit events. |
| library/ai/sculptok/internal/cli/analytics_test.go | Adds placeholder skipped test for novel analytics command. |
| library/ai/sculptok/internal/cli/agent_context.go | Adds machine-readable agent-context JSON surface for runtime introspection. |
| library/ai/sculptok/internal/cache/cache.go | Adds file-based response cache implementation. |
| library/ai/sculptok/go.mod | Adds Go module definition and dependencies for the new CLI/MCP. |
| library/ai/sculptok/cmd/sculptok-pp-mcp/main.go | Adds MCP server entrypoint with stdio/http transport selection. |
| library/ai/sculptok/cmd/sculptok-pp-cli/main.go | Adds CLI entrypoint delegating to internal/cli.Execute(). |
| library/ai/sculptok/CHANGELOG.md | Adds release-ledger changelog skeleton (automation-owned). |
| library/ai/sculptok/AGENTS.md | Adds per-CLI agent guide describing runtime introspection and patching expectations. |
| library/ai/sculptok/.printing-press.json | Adds provenance manifest for the printed CLI/MCP (run_id, spec checksum, novel features, etc.). |
| library/ai/sculptok/.printing-press-tools-polish.json | Adds tools polish metadata artifact from generation. |
| library/ai/sculptok/.printing-press-release.json | Adds release-ledger skeleton for post-merge automation to populate. |
| library/ai/sculptok/.printing-press-pii-polish.json | Adds PII polish metadata artifact from generation. |
| library/ai/sculptok/.printing-press-patches/sculptok-truncate-json-array-helper.json | Records the local patch providing truncateJSONArray to fix generator gap. |
| library/ai/sculptok/.printing-press-patches/sculptok-store-and-generate-workflow.json | Records the local patch implementing store + workflow/novel commands that must survive regen. |
| library/ai/sculptok/.printing-press-patches/.gitkeep | Ensures patch directory is tracked even when empty. |
| library/ai/sculptok/.manuscripts/20260622-164426-352dd01a/research/2026-06-22-170804-novel-features-brainstorm.md | Adds research brainstorming manuscript. |
| library/ai/sculptok/.manuscripts/20260622-164426-352dd01a/research/2026-06-22-170804-feat-sculptok-pp-cli-brief.md | Adds research brief manuscript. |
| library/ai/sculptok/.manuscripts/20260622-164426-352dd01a/research/2026-06-22-170804-feat-sculptok-pp-cli-absorb-manifest.md | Adds absorb/transcendence manifest manuscript. |
| library/ai/sculptok/.manuscripts/20260622-164426-352dd01a/proofs/phase5-acceptance.json | Adds phase-5 acceptance proof JSON. |
| library/ai/sculptok/.manuscripts/20260622-164426-352dd01a/proofs/phase-4.95-findings.md | Adds documented code review findings from generation. |
| library/ai/sculptok/.manuscripts/20260622-164426-352dd01a/proofs/2026-06-22-170804-fix-sculptok-pp-cli-shipcheck.md | Adds shipcheck proof manuscript. |
| library/ai/sculptok/.manuscripts/20260622-164426-352dd01a/proofs/2026-06-22-170804-fix-sculptok-pp-cli-polish.md | Adds polish pass proof manuscript. |
| library/ai/sculptok/.manuscripts/20260622-164426-352dd01a/proofs/2026-06-22-170804-fix-sculptok-pp-cli-build-log.md | Adds build-log proof manuscript. |
| library/ai/sculptok/.manuscripts/20260622-164426-352dd01a/proofs/2026-06-22-170804-fix-sculptok-pp-cli-acceptance.md | Adds live acceptance proof manuscript. |
| library/ai/sculptok/.manuscripts/20260622-164426-352dd01a/discovery/api-contract-verified.md | Adds verified API contract notes (envelope, endpoints, pricing). |
| library/ai/sculptok/.goreleaser.yaml | Adds goreleaser configuration building both CLI and MCP binaries. |
| library/ai/sculptok/.golangci.yml | Adds golangci-lint configuration enabling common linters + goimports formatting. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Greptile SummaryThis PR introduces the first CLI and MCP for SculptOK — a greenfield Go module that wraps SculptOK's async, credit-metered API into a single-command workflow (upload → submit → poll → download) backed by a local SQLite job store for offline search, spend analytics, and credit reconciliation.
Confidence Score: 4/5Safe to merge with the search.go credit-window issue tracked for a follow-up fix; no data corruption or API-spend risk introduced. The credits search path in search.go applies --limit as a search-window rather than a result cap, meaning a user searching for an older credit event with the default --limit 20 will silently see zero results even when matching records exist in the local store. The generate stl command does not persist its flag values to the SQLite params column, unlike every other generate subcommand. All other workflow logic, API client behaviour, store operations, and output handling reviewed cleanly. library/ai/sculptok/internal/cli/search.go (credit search window semantics) and library/ai/sculptok/internal/cli/generate_stl.go (missing recorded params map) Important Files Changed
|
|
Addressed review findings in
The remaining suggestions (config.go dead-var, deliver.go context, auth.go import grouping, cliutil/text.go regexp compile, cobratree search classification, draw.go group annotation) are in generator-owned/templated files ( |
|
@greptileai review Auto-nudge from |
|
Fixed the P1 in |
|
@greptileai review Auto-nudge from |
|
Fixed the batch all-failure P1 in |
|
@greptileai review Auto-nudge from |
sculptok
SculptOK AI depth-map, relief, STL and 3D generation CLI — the first CLI and MCP for SculptOK. Turn a local image into a depth map, printable STL, or 3D model in one command, with credit-cost preflight and a local SQLite job store no other tool has.
API: sculptok | Category: ai | Press version: 4.24.0
Spec: Hand-authored internal YAML from the official api-open REST docs (no public OpenAPI exists)
Publication Path
New print — no merged CLI and no existing PR matched this slug (greenfield; no prior SculptOK CLI/MCP/SDK anywhere).
CLI Shape
Novel Commands
generate depthmapgenerate stlgenerate threedcostanalyticsreconcilesearchAlso ships the full official api-open surface (credits balance/history, draw depthmap/restore/threed/stl/status, drawings list) plus a hand-built submit→poll workflow, credit-cost-aware generation, and a pure-Go SQLite store.
What This CLI Does
The first CLI and MCP for SculptOK. SculptOK's web tool is async and credit-metered: upload, submit a draw, wait, refresh, then download. This CLI collapses that into one command (
generate depthmap/stl/threed/restore) that uploads a local image, previews the credit cost, polls to completion, and saves the results. Every draw, credit event, and upload is mirrored into a local SQLite database for offline search, spend analytics by kind, and credit/job reconciliation.Manuscripts
Validation Results
Publish Live Gate
Full live dogfood reran at publish time against the real SculptOK API and passed (64 passed / 0 failed / 49 skipped). A live depth-map generation (upload→submit→poll→download→persist) was verified end-to-end during generation, producing a real 1280×1280 depth map for 10 credits. Generation commands are guarded against credit spend under the verify/dogfood harness.
Notes
{code,msg,data}envelope; the hand-built workflow/store commands treatcode != 0as a typed error.credits balance(generated command) serves a cached GET — use--no-cacheorcostfor a fresh balance; generated absorbed commands surface the full envelope (data is correct/agent-parseable).