feat: add attachment slots data to article cache#1
Open
diegomarino wants to merge 2 commits intoolchyk98:masterfrom
Open
feat: add attachment slots data to article cache#1diegomarino wants to merge 2 commits intoolchyk98:masterfrom
diegomarino wants to merge 2 commits intoolchyk98:masterfrom
Conversation
## Summary
Adds attachment slots information to the article cache, enabling future BOM (Bill of Materials) generation that accounts for slot requirements and provisions.
## What are attachment slots?
In Astroneer, items have specific slot configurations:
- **placedOn**: What slot tier is required to place the item (Small, Medium, Large, Extra Large, ground, Widget, Terrain Tool)
- **provides**: What slots the item offers to attach other items
- **input/output**: For crafters, what resource slots they have (solid, gas, soil, fluid)
- **Special slots**: powerConnectors, filterSlot, fuelSlot
## Changes
- **types/article.ts**: Added `ArticleSlots` interface with full slot type definitions
- **scrapper/src/cache/_cache.json**: Enriched 58 articles with slot data
- **scrapper/src/cache/_llm_doc.md**: Generated compact documentation for LLM consumption
- **scrapper/scripts/generateLlmDoc.ts**: Script to regenerate LLM doc (`pnpm run generate-llm-doc`)
## Example: Updated JSON with slots data
```json
"Chemistry_Lab": {
"slots": {
"placedOn": "Large",
"input": { "solid": 2, "gas": 1 },
"output": { "solid": 1 }
}
}
```
## Example: LLM doc format
```
- **Chemistry_Lab** | Large | on:Large in:[solid:2,gas:1] out:[solid:1] | @Medium_Printer: 1xTungsten+1xGlass+1xCeramic
- **Medium_Storage** | Medium | on:Medium prv:[s:8] | @Small_Printer: 2xResin
- **Large_Rover** | Extra Large | on:ground prv:[l:2,xl:1] pwr:2 | @Large_Printer: 2xEXO_Chip+1xAluminum_Alloy+1xRubber
```
## Quality checklist
- [x] JSON is syntactically valid
- [x] All 191 articles preserve required fields (key, name, iconURL, imageURL)
- [x] TypeScript compiles without errors
- [x] Linter passes
There was a problem hiding this comment.
Pull request overview
This PR adds attachment slot data to the article cache to enable future Bill of Materials (BOM) generation that accounts for item placement requirements and slot provisions. The implementation includes comprehensive TypeScript type definitions, enriched cache data for 58 articles, and an auto-generated LLM documentation file.
- Added
ArticleSlotsinterface with slot type definitions including placement requirements, provided slots, input/output flow slots, and special slots (power, filter, fuel) - Created
generateLlmDoc.tsscript to generate compact, token-optimized markdown documentation from cache data - Generated
_llm_doc.mdwith 191 articles organized by type, using abbreviated notation for efficient LLM consumption
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| types/article.ts | Adds slot-related TypeScript interfaces (SlotTier, SlotPlacement, SlotCounts, FlowSlots, ArticleSlots) and integrates slots as optional field in Article interface |
| scrapper/src/cache/_llm_doc.md | Auto-generated documentation file with compact notation for 191 Astroneer items, including slot configurations and crafting recipes |
| scrapper/scripts/generateLlmDoc.ts | Script that reads cache JSON and generates abbreviated markdown documentation optimized for LLM token efficiency |
| scrapper/package.json | Adds npm script generate-llm-doc to regenerate the LLM documentation file |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Use explicit length check for empty string (olchyk98#1) - Add try-catch error handling for file reading (olchyk98#2) - Fix documentation examples to match actual output (#3) - Add missing 'mega' abbreviation to PROVIDES_ABBREV and legend (#4)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds attachment slots information to the article cache, enabling future BOM (Bill of Materials) generation that accounts for slot requirements and provisions.
What are attachment slots?
In Astroneer, items have specific slot configurations:
Changes
ArticleSlotsinterface with full slot type definitionspnpm run generate-llm-doc)Example: Updated JSON with slots data
Example: LLM doc format
Quality checklist