@series-inc/stowkit-cli 0.6.21 → 0.6.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/store.d.ts +1 -0
- package/dist/store.js +3 -0
- package/package.json +2 -2
- package/skill.md +38 -160
package/dist/store.d.ts
CHANGED
package/dist/store.js
CHANGED
|
@@ -52,6 +52,9 @@ export function searchAssets(registry, query, opts) {
|
|
|
52
52
|
thumbnailUrl: asset.thumbnail
|
|
53
53
|
? `https://storage.googleapis.com/${bucket}/packages/${pkgName}/${verStr}/thumbnails/${asset.stringId.split('/').map(encodeURIComponent).join('/')}.${asset.thumbnailFormat ?? 'png'}`
|
|
54
54
|
: null,
|
|
55
|
+
audioUrl: asset.type === 'audio'
|
|
56
|
+
? `https://storage.googleapis.com/${bucket}/packages/${pkgName}/${verStr}/${asset.file.split('/').map(encodeURIComponent).join('/')}`
|
|
57
|
+
: null,
|
|
55
58
|
...(asset.filtering ? { filtering: asset.filtering } : {}),
|
|
56
59
|
},
|
|
57
60
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@series-inc/stowkit-cli",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.22",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"bin": {
|
|
6
6
|
"stowkit": "./dist/cli.js"
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"dev": "tsc --watch"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@series-inc/stowkit-packer-gui": "^0.1.
|
|
20
|
+
"@series-inc/stowkit-packer-gui": "^0.1.22",
|
|
21
21
|
"@series-inc/stowkit-editor": "^0.1.8",
|
|
22
22
|
"draco3d": "^1.5.7",
|
|
23
23
|
"fbx-parser": "^2.1.3",
|
package/skill.md
CHANGED
|
@@ -2,17 +2,38 @@
|
|
|
2
2
|
|
|
3
3
|
StowKit is a game asset pipeline that compresses and packs assets into `.stow` binary files for runtime loading.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## How "Adding an Asset" Works
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
When the user says "add this asset" or "use this model/texture/sound", this is always a two-step process:
|
|
8
8
|
|
|
9
|
-
1
|
|
10
|
-
2. Run `stowkit build` (or `stowkit scan`)
|
|
11
|
-
3. The CLI detects the new file, generates the correct `.stowmeta` with proper defaults, and processes it
|
|
9
|
+
**Step 1 — Pipeline (this skill):** Place the source file (FBX, GLB, PNG, WAV, etc.) into the project's `srcArtDir` folder, then run `stowkit build`. The CLI compresses it and packs it into a `.stow` file. That's it for this step.
|
|
12
10
|
|
|
13
|
-
**
|
|
11
|
+
**Step 2 — Runtime (three-loader skill):** In the game code, load the asset from the `.stow` pack using `StowKitLoader` and the asset's `stringId`. For example: `pack.loadMesh('hero_model')`.
|
|
14
12
|
|
|
15
|
-
|
|
13
|
+
**Never load raw source files (FBX, PNG, GLB, WAV) directly in game code.** No `THREE.FBXLoader`, no `THREE.TextureLoader` on raw PNGs, no `fetch('assets/model.fbx')`. All assets go through the StowKit pipeline first and are loaded from `.stow` packs at runtime.
|
|
14
|
+
|
|
15
|
+
**Never use the asset store to find local project files.** The store is a remote registry for shared reusable packs. To find what assets are in the current project, read `.stowmeta` files, glob for files in `srcArtDir`, or run `stowkit status`.
|
|
16
|
+
|
|
17
|
+
## Quick Decision Guide
|
|
18
|
+
|
|
19
|
+
| User wants to... | Do this |
|
|
20
|
+
|---|---|
|
|
21
|
+
| Add a new asset (texture, mesh, audio, GLB) | Place file in `srcArtDir`, run `stowkit build`, then load from pack in game code |
|
|
22
|
+
| Change compression/quality settings | Edit the **existing** `.stowmeta` (never create one), run `stowkit build` |
|
|
23
|
+
| Create a new material | `stowkit create-material <path>` then `stowkit build` |
|
|
24
|
+
| Rename / move / delete an asset | `stowkit rename`, `stowkit move`, or `stowkit delete` |
|
|
25
|
+
| See what's in a built pack | `stowkit inspect <file.stow>` |
|
|
26
|
+
| Check project health | `stowkit status` |
|
|
27
|
+
| Visually browse/edit assets | `stowkit packer` |
|
|
28
|
+
| Load assets at runtime (Three.js) | Use `@series-inc/stowkit-three-loader` — see Runtime Reader section |
|
|
29
|
+
|
|
30
|
+
## CRITICAL Rules
|
|
31
|
+
|
|
32
|
+
1. **Never manually create `.stowmeta` files.** They are auto-generated by `stowkit build` / `stowkit scan`. Only **edit** an existing one (to change quality, pack, stringId, etc.).
|
|
33
|
+
2. **Never manually create GLB `children` arrays.** The build populates them automatically on first run.
|
|
34
|
+
3. **Never load raw FBX/PNG/GLB/WAV files directly in game code.** Everything goes through the pipeline (`stowkit build`) and is loaded from `.stow` packs at runtime via `StowKitLoader`.
|
|
35
|
+
4. **To create materials, use `stowkit create-material`** — don't hand-write `.stowmat` unless you have a specific reason.
|
|
36
|
+
5. **Always run `stowkit build` after changes** — the CLI handles scanning, processing, and packing in one step.
|
|
16
37
|
|
|
17
38
|
## Project Structure
|
|
18
39
|
|
|
@@ -53,9 +74,6 @@ stowkit move <path> <folder> # Move an asset to a different folder (updates G
|
|
|
53
74
|
stowkit delete <path> # Delete an asset and its .stowmeta/.stowcache files
|
|
54
75
|
stowkit set-id <path> <id> # Change an asset's stringId
|
|
55
76
|
stowkit inspect <file.stow> # Show manifest of a built .stow pack (use -v for details)
|
|
56
|
-
stowkit store search <query> # Search the asset store (add --json for machine-readable output)
|
|
57
|
-
stowkit store list # List all packages in the store
|
|
58
|
-
stowkit store info <package> # Show package details and all assets
|
|
59
77
|
stowkit packer [dir] # Open the packer GUI in browser
|
|
60
78
|
stowkit editor [dir] # Open the level editor in browser
|
|
61
79
|
stowkit serve [dir] # Start API server only (no GUI)
|
|
@@ -66,9 +84,6 @@ All commands default to the current directory.
|
|
|
66
84
|
**Options:**
|
|
67
85
|
- `--force` — Ignore cache and reprocess everything
|
|
68
86
|
- `--verbose` / `-v` — Detailed output
|
|
69
|
-
- `--json` — Output store results as JSON (for programmatic/AI use)
|
|
70
|
-
- `--type <type>` — Filter store search by asset type (e.g. `staticMesh`, `texture`)
|
|
71
|
-
- `--limit <n>` — Max number of store search results to return
|
|
72
87
|
- `--port <number>` — Server port (default 3210)
|
|
73
88
|
- `--schema <name>` — Material schema template for `create-material` (default: `pbr`)
|
|
74
89
|
|
|
@@ -531,145 +546,17 @@ To refresh skill files without updating the CLI: `stowkit init --update`
|
|
|
531
546
|
|
|
532
547
|
**When to run this:** If you notice this skill file is missing documentation for commands that exist in `stowkit --help`, or if the user asks you to update StowKit.
|
|
533
548
|
|
|
534
|
-
##
|
|
535
|
-
|
|
536
|
-
StowKit includes a shared asset store for publishing, searching, and importing reusable asset packs across projects. Assets are stored in a GCS bucket with a central `registry.json` manifest.
|
|
537
|
-
|
|
538
|
-
### Publishing to the store
|
|
539
|
-
|
|
540
|
-
To publish a pack, you need an `assets-package.json` in the project root:
|
|
541
|
-
|
|
542
|
-
```json
|
|
543
|
-
{
|
|
544
|
-
"name": "my-pack",
|
|
545
|
-
"version": "1.0.0",
|
|
546
|
-
"author": "your-name",
|
|
547
|
-
"description": "A short description of what's in this pack",
|
|
548
|
-
"tags": ["environment", "fantasy", "low-poly"],
|
|
549
|
-
"bucket": "gs://venus-shared-assets-test"
|
|
550
|
-
}
|
|
551
|
-
```
|
|
552
|
-
|
|
553
|
-
Then run `stowkit publish` from the packer GUI's Publish modal, or programmatically via the CLI server's `/api/publish` endpoint. The publish flow:
|
|
554
|
-
|
|
555
|
-
1. Scans all assets in the `srcArtDir` and builds a dependency graph
|
|
556
|
-
2. Uploads all source files to `packages/{name}/{version}/` in GCS
|
|
557
|
-
3. Uploads per-asset thumbnails (captured in the packer GUI)
|
|
558
|
-
4. Uploads a pack-level thumbnail if present (see below)
|
|
559
|
-
5. Updates the central `registry.json` with the new version
|
|
560
|
-
|
|
561
|
-
**Pack-level thumbnail:** Place a `thumbnail.webp`, `thumbnail.png`, or `thumbnail.jpg` in the project root directory. During publish, this file is uploaded alongside the package and displayed as the pack's cover image in the store. If no custom thumbnail is provided, the store shows a collage of individual asset thumbnails.
|
|
562
|
-
|
|
563
|
-
**Version management:** Bump the `version` field in `assets-package.json` before each publish. Publishing the same version again requires `--force`.
|
|
564
|
-
|
|
565
|
-
### Searching the store (REST API — preferred for AI)
|
|
566
|
-
|
|
567
|
-
When the StowKit server is running, use the REST endpoints directly for clean JSON — no CLI parsing needed:
|
|
568
|
-
|
|
569
|
-
```
|
|
570
|
-
GET /api/asset-store/search?q=coral&limit=10 # Search assets, returns JSON array
|
|
571
|
-
GET /api/asset-store/search?q=ocean&type=texture # Filter by type
|
|
572
|
-
GET /api/asset-store/search?q=boss,idle&limit=5 # AND search (comma-separated)
|
|
573
|
-
GET /api/asset-store/packages # List all packages
|
|
574
|
-
GET /api/asset-store/package/<name> # Package details + all assets
|
|
575
|
-
```
|
|
576
|
-
|
|
577
|
-
All responses are JSON. Search results include `thumbnailUrl` for assets that have thumbnails.
|
|
578
|
-
|
|
579
|
-
### Searching the store (CLI fallback)
|
|
580
|
-
|
|
581
|
-
If the server isn't running, the CLI falls back to direct registry fetch:
|
|
582
|
-
|
|
583
|
-
```bash
|
|
584
|
-
stowkit store search coral # Find assets matching "coral"
|
|
585
|
-
stowkit store search "boss, idle" # AND search — both terms must match
|
|
586
|
-
stowkit store search ocean --type texture # Find textures tagged/named "ocean"
|
|
587
|
-
stowkit store search sword --json --limit 10 # Top 10 results as JSON
|
|
588
|
-
stowkit store list # List all published packages
|
|
589
|
-
stowkit store info ninja-adventure --json # Full package details as JSON
|
|
590
|
-
```
|
|
591
|
-
|
|
592
|
-
When the server IS running, CLI store commands automatically proxy through it and always output JSON.
|
|
593
|
-
|
|
594
|
-
### Search scoring algorithm
|
|
595
|
-
|
|
596
|
-
Search uses a ranked scoring system with AND semantics. Each search term must independently clear a minimum threshold — weak matches alone won't surface results.
|
|
597
|
-
|
|
598
|
-
**Scoring tiers (per term, highest match wins):**
|
|
599
|
-
|
|
600
|
-
| Score | Match type | Example |
|
|
601
|
-
|-------|-----------|---------|
|
|
602
|
-
| 100 | Exact stringId match | "boss" matches asset "boss" |
|
|
603
|
-
| 90 | Exact package name match | "ninja-adventure" matches the pack |
|
|
604
|
-
| 80 | Exact asset tag match | "coral" matches tag "coral" |
|
|
605
|
-
| 60 | Word match in stringId or tag | "boss" matches "actor/boss/idle" |
|
|
606
|
-
| 50 | stringId starts with term | "act" matches "actor/boss/idle" |
|
|
607
|
-
| 45-50 | Word match in package name/tag | "ninja" matches pack "ninja-adventure" |
|
|
608
|
-
| 40 | Word prefix in stringId | "att" matches "attack" |
|
|
609
|
-
| 25-35 | Substring/prefix matches | Various partial matches |
|
|
610
|
-
| < 20 | File path, type, description | Below threshold — boost only |
|
|
611
|
-
|
|
612
|
-
**Key behaviors:**
|
|
613
|
-
- **AND semantics:** Multi-term queries (comma-separated) require ALL terms to match. "boss, idle" only returns assets matching both words.
|
|
614
|
-
- **Minimum threshold (20):** Weak signals like file path matches or type name matches can't surface assets on their own. They only boost already-qualifying results.
|
|
615
|
-
- **Tags score high:** Asset tags are curated metadata and rank just below exact name matches. If an asset has a tag that matches your query, it will surface prominently.
|
|
616
|
-
- **Package metadata scoped:** When searching within a specific pack, package-level fields (name, description, tags) are excluded from scoring to prevent every asset from matching.
|
|
617
|
-
|
|
618
|
-
**Word splitting:** StringIds and names are split on underscores, hyphens, dots, slashes, camelCase, and spaces. "NinjaBoss_Attack" becomes ["ninja", "boss", "attack"].
|
|
619
|
-
|
|
620
|
-
### Searching in the Packer GUI
|
|
621
|
-
|
|
622
|
-
The packer GUI has a **Store** button that opens a full-featured asset store browser:
|
|
623
|
-
|
|
624
|
-
- **Global search:** Type a query without selecting a pack — shows matching **packs** (not individual assets), sorted by number of matches. Click a pack to browse its assets with the search term preserved.
|
|
625
|
-
- **In-pack search:** Select a pack first, then search — shows individual assets within that pack, flat (no folder grouping), with AND scoring.
|
|
626
|
-
- **Type filters:** Filter by asset type (texture, staticMesh, skinnedMesh, audio, materialSchema, animationClip) using toggle pills.
|
|
627
|
-
- **Show All:** Checkbox to flatten the folder hierarchy and see all assets in the current pack at once. Combines with type filters.
|
|
628
|
-
- **Folder browsing:** When not searching, navigate the pack's folder structure. Breadcrumbs below the filter bar show your current path.
|
|
629
|
-
- **Thumbnail size:** Slider in the footer to adjust grid card size.
|
|
630
|
-
- **Selection + dependencies:** Click assets to select them. Transitive dependencies are auto-resolved and shown with amber badges. The Import button downloads all selected assets and their deps into the project's `srcArtDir`.
|
|
631
|
-
|
|
632
|
-
### JSON search result format
|
|
633
|
-
|
|
634
|
-
```json
|
|
635
|
-
[
|
|
636
|
-
{
|
|
637
|
-
"stringId": "coral_1",
|
|
638
|
-
"type": "staticMesh",
|
|
639
|
-
"packageName": "ocean_pack",
|
|
640
|
-
"version": "1.0.0",
|
|
641
|
-
"file": "Meshes/Coral_1.fbx",
|
|
642
|
-
"size": 59952,
|
|
643
|
-
"tags": ["coral", "environment"],
|
|
644
|
-
"dependencies": ["M_Sea_Floor"],
|
|
645
|
-
"thumbnail": true,
|
|
646
|
-
"thumbnailFormat": "png",
|
|
647
|
-
"thumbnailUrl": "https://storage.googleapis.com/venus-shared-assets-test/packages/ocean_pack/1.0.0/thumbnails/coral_1.png"
|
|
648
|
-
}
|
|
649
|
-
]
|
|
650
|
-
```
|
|
651
|
-
|
|
652
|
-
### Dependency resolution
|
|
653
|
-
|
|
654
|
-
Assets have dependency chains: meshes depend on materials, materials depend on textures. When importing an asset, all transitive dependencies are automatically resolved and downloaded. If two assets share the same dependency, it's only downloaded once.
|
|
655
|
-
|
|
656
|
-
### Importing from the store
|
|
657
|
-
|
|
658
|
-
The packer GUI's Store modal handles importing. Selected assets and their transitive dependencies are downloaded directly into the project's `srcArtDir`. Already-imported assets are marked with a green "Imported" badge.
|
|
659
|
-
|
|
660
|
-
### Thumbnail URLs
|
|
661
|
-
|
|
662
|
-
Per-asset thumbnails (captured in the packer GUI during publish):
|
|
663
|
-
```
|
|
664
|
-
https://storage.googleapis.com/{bucket}/packages/{packageName}/{version}/thumbnails/{stringId}.{format}
|
|
665
|
-
```
|
|
666
|
-
|
|
667
|
-
Pack-level thumbnails (from project root `thumbnail.webp`):
|
|
668
|
-
```
|
|
669
|
-
https://storage.googleapis.com/{bucket}/packages/{packageName}/{version}/thumbnail.webp
|
|
670
|
-
```
|
|
549
|
+
## Common AI Mistakes to Avoid
|
|
671
550
|
|
|
672
|
-
|
|
551
|
+
| Mistake | Why it's wrong | What to do instead |
|
|
552
|
+
|---|---|---|
|
|
553
|
+
| Loading raw FBX/PNG/GLB in game code (`THREE.FBXLoader`, `THREE.TextureLoader`, `fetch('assets/...')`) | StowKit projects never load raw source files at runtime — they're compressed and packed | Place file in `srcArtDir`, `stowkit build`, then `pack.loadMesh()`/`pack.loadTexture()` from the `.stow` pack |
|
|
554
|
+
| Searching the asset store to find files in the local project | The store is a remote registry for shared packs, not the local project | Glob for files in `srcArtDir`, read `.stowmeta` files, or run `stowkit status` |
|
|
555
|
+
| Creating a `.stowmeta` file from scratch | The CLI generates these with correct defaults and cache stamps | Place the source file in `srcArtDir`, run `stowkit build` |
|
|
556
|
+
| Writing a `.stowmat` by hand when `create-material` exists | Hand-written materials often have wrong structure | `stowkit create-material <path>` |
|
|
557
|
+
| Running `stowkit process` without `stowkit scan` first | New files won't have `.stowmeta` yet | Just use `stowkit build` — it does scan + process + pack |
|
|
558
|
+
| Editing a GLB's `children` array before first build | The array doesn't exist yet — it's populated by the build | Run `stowkit build` first, then edit the generated children |
|
|
559
|
+
| Deleting files manually instead of using `stowkit delete` | Orphans the `.stowmeta` and `.stowcache` sidecars | `stowkit delete <path>` handles everything |
|
|
673
560
|
|
|
674
561
|
## Common Tasks for AI Agents
|
|
675
562
|
|
|
@@ -736,12 +623,3 @@ This is useful for verifying build output, checking which assets ended up in whi
|
|
|
736
623
|
- **Clean orphaned files:** `stowkit clean`
|
|
737
624
|
- **Set up with engine:** `stowkit init --with-engine` (installs `@series-inc/rundot-3d-engine` + `three`)
|
|
738
625
|
- **Update CLI + skill files:** `stowkit update`
|
|
739
|
-
- **Search the asset store (REST):** `curl http://localhost:3210/api/asset-store/search?q=sword&limit=10` (returns JSON array with thumbnailUrls)
|
|
740
|
-
- **AND search (REST):** `curl "http://localhost:3210/api/asset-store/search?q=boss,idle&limit=10"` (both terms must match)
|
|
741
|
-
- **Find all meshes (REST):** `curl "http://localhost:3210/api/asset-store/search?q=mesh&type=staticMesh&limit=10"`
|
|
742
|
-
- **List all packages (REST):** `curl http://localhost:3210/api/asset-store/packages`
|
|
743
|
-
- **Get package details (REST):** `curl http://localhost:3210/api/asset-store/package/ocean_pack`
|
|
744
|
-
- **Show a thumbnail to the user:** Use the `thumbnailUrl` from search results — it's a public URL
|
|
745
|
-
- **Add a pack thumbnail:** Place `thumbnail.webp` (or `.png`/`.jpg`) in the project root before publishing
|
|
746
|
-
- **Publish a pack:** Open the packer GUI (`stowkit packer`), click Publish, fill in version/description/tags, and publish
|
|
747
|
-
- **Browse the store visually:** Open the packer GUI, click the Store button to browse, search, filter by type, and import assets
|