@husar.ai/cli 0.4.0 → 0.4.1
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/MCP_SERVER.md +92 -0
- package/dist/zeus/const.js +1058 -212
- package/dist/zeus/const.js.map +1 -1
- package/dist/zeus/index.d.ts +5196 -1293
- package/dist/zeus/index.js +49 -11
- package/dist/zeus/index.js.map +1 -1
- package/package.json +3 -3
- package/src/zeus/const.ts +1060 -212
- package/src/zeus/index.ts +5371 -1544
package/MCP_SERVER.md
CHANGED
|
@@ -49,6 +49,8 @@ Notes:
|
|
|
49
49
|
|
|
50
50
|
## Available Tools
|
|
51
51
|
|
|
52
|
+
### Core CLI Tools
|
|
53
|
+
|
|
52
54
|
- `husar_copy`:
|
|
53
55
|
- Purpose: Parse a CMS file into a shape or model and upsert via CLI.
|
|
54
56
|
- Inputs:
|
|
@@ -69,6 +71,96 @@ Notes:
|
|
|
69
71
|
- `cms/zeus/index.ts`, `cms/zeus/const.ts`
|
|
70
72
|
- `cms/host.ts`, `cms/ssr.ts`, `cms/react.ts`
|
|
71
73
|
|
|
74
|
+
### Discovery & Schema Tools
|
|
75
|
+
|
|
76
|
+
These tools help AI agents understand the CMS structure before making updates:
|
|
77
|
+
|
|
78
|
+
- `listModels`: List all model definitions with their field structures.
|
|
79
|
+
- `listViews`: List all view definitions with their field structures.
|
|
80
|
+
- `listShapes`: List all available shape definitions.
|
|
81
|
+
- `graphQLTypes`: Get the generated GraphQL SDL schema showing all input/output types. Essential for understanding the exact structure expected by `model.upsert` and `view.upsert`.
|
|
82
|
+
|
|
83
|
+
### Combined "GetWithContent" Tools
|
|
84
|
+
|
|
85
|
+
**Recommended workflow:** Always call the appropriate `getWithContent` tool BEFORE calling `upsert` to understand the exact data structure expected.
|
|
86
|
+
|
|
87
|
+
- `model.getWithContent`:
|
|
88
|
+
- Purpose: Get complete model information including definition, fieldSet (expanded shapes), GraphQL types, and optionally current content.
|
|
89
|
+
- Inputs:
|
|
90
|
+
- `name` (required): Model name
|
|
91
|
+
- `slug` (optional): Document slug to fetch existing content
|
|
92
|
+
- `filter` (optional): Root params filter (e.g., `{ "_language": "en" }`)
|
|
93
|
+
- Returns: `{ definition, fieldSet, graphQLTypes, content }`
|
|
94
|
+
|
|
95
|
+
- `view.getWithContent`:
|
|
96
|
+
- Purpose: Get complete view information including definition, fieldSet (expanded shapes), GraphQL types, and current content.
|
|
97
|
+
- Inputs:
|
|
98
|
+
- `name` (required): View name
|
|
99
|
+
- `filter` (optional): Root params filter (e.g., `{ "_language": "en" }`)
|
|
100
|
+
- Returns: `{ definition, fieldSet, graphQLTypes, content }`
|
|
101
|
+
|
|
102
|
+
- `shape.getWithDefinition`:
|
|
103
|
+
- Purpose: Get complete shape information including definition, fieldSet (expanded nested shapes), and GraphQL types.
|
|
104
|
+
- Inputs:
|
|
105
|
+
- `name` (required): Shape name
|
|
106
|
+
- Returns: `{ definition, fieldSet, graphQLTypes }`
|
|
107
|
+
|
|
108
|
+
### Model CRUD Tools
|
|
109
|
+
|
|
110
|
+
- `model.model`: Return full model configuration
|
|
111
|
+
- `model.previewFields`: Return expanded fields for model
|
|
112
|
+
- `model.fieldSet`: Return admin page fieldset
|
|
113
|
+
- `model.upsert`: Create or update a model content document
|
|
114
|
+
- **Important:** First call `model.getWithContent` to see the expected structure
|
|
115
|
+
- Inputs: `name`, `slug`, `args` (document content), `draft_version`, `filter`
|
|
116
|
+
- `model.remove`: Remove a model entry
|
|
117
|
+
- `model.list`: List model entries
|
|
118
|
+
- `model.listPaginated`: List model entries with pagination
|
|
119
|
+
- `model.one`: Get one model entry by slug
|
|
120
|
+
- `model.listById`: Get entries by IDs
|
|
121
|
+
|
|
122
|
+
### View CRUD Tools
|
|
123
|
+
|
|
124
|
+
- `view.model`: Return full view configuration
|
|
125
|
+
- `view.previewFields`: Return expanded fields for view
|
|
126
|
+
- `view.fieldSet`: Return admin page fieldset for view
|
|
127
|
+
- `view.upsert`: Create or update a view entry (singleton)
|
|
128
|
+
- **Important:** First call `view.getWithContent` to see the expected structure
|
|
129
|
+
- Inputs: `name`, `args` (view content), `draft_version`, `filter`, `formArgs`
|
|
130
|
+
- `view.remove`: Remove a view entry
|
|
131
|
+
- `view.list`: List view entries
|
|
132
|
+
- `view.one`: Get one view entry
|
|
133
|
+
|
|
134
|
+
### Shape Tools
|
|
135
|
+
|
|
136
|
+
- `shape.model`: Return full shape configuration
|
|
137
|
+
- `shape.previewFields`: Return expanded fields for shape
|
|
138
|
+
- `shape.fieldSet`: Return admin page fieldset for shape
|
|
139
|
+
|
|
140
|
+
### Form Tools
|
|
141
|
+
|
|
142
|
+
- `form.model`, `form.previewFields`, `form.fieldSet`: Form configuration tools
|
|
143
|
+
- `form.upsert`, `form.remove`, `form.list`, `form.one`: Form CRUD operations
|
|
144
|
+
- `form.submitResponse`, `form.responses`, `form.response`, `form.removeResponse`, `form.responseFieldSet`: Form response handling
|
|
145
|
+
|
|
146
|
+
### Definition Management Tools
|
|
147
|
+
|
|
148
|
+
These tools manage CMS definitions (schemas), not content:
|
|
149
|
+
|
|
150
|
+
- `upsertModel`, `removeModel`: Manage model definitions
|
|
151
|
+
- `upsertView`, `removeView`: Manage view definitions
|
|
152
|
+
- `upsertShape`, `removeShape`: Manage shape definitions
|
|
153
|
+
- `upsertForm`, `removeForm`: Manage form definitions
|
|
154
|
+
- `removeModelWithDocuments`: Remove a model and all its documents
|
|
155
|
+
- `removeDocumentsWithParams`: Remove documents matching root params
|
|
156
|
+
|
|
157
|
+
### AI Generation Tools
|
|
158
|
+
|
|
159
|
+
- `generateContent`: Generate content using AI
|
|
160
|
+
- `generateImage`: Generate an image
|
|
161
|
+
- `translateDocument`, `translateView`, `translateForm`: Translation tools
|
|
162
|
+
- `husarViewAgent`: Specialized agent for view creation/modification from natural language
|
|
163
|
+
|
|
72
164
|
## Troubleshooting
|
|
73
165
|
|
|
74
166
|
- CLI not found: Ensure `@husar.ai/cli` is installed globally or that `husar.ai` is on PATH.
|