@husar.ai/cli 0.4.0 → 0.4.2

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 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.
@@ -0,0 +1,15 @@
1
+ export interface CloudProject {
2
+ name: string;
3
+ adminURL: string;
4
+ }
5
+ export interface ProjectsResponse {
6
+ items: CloudProject[];
7
+ hasNext: boolean;
8
+ total: number;
9
+ }
10
+ export declare function getProjects(accessToken: string): Promise<CloudProject[]>;
11
+ export declare function getUserInfo(accessToken: string): Promise<{
12
+ username: string;
13
+ fullName?: string;
14
+ } | null>;
15
+ export declare function verifyAccessToken(accessToken: string): Promise<boolean>;
@@ -0,0 +1,86 @@
1
+ const CLOUD_API_URL = process.env.HUSAR_CLOUD_API || 'https://backend.husar.ai/api/graphql';
2
+ export async function getProjects(accessToken) {
3
+ const response = await fetch(CLOUD_API_URL, {
4
+ method: 'POST',
5
+ headers: {
6
+ 'Content-Type': 'application/json',
7
+ Authorization: accessToken,
8
+ },
9
+ body: JSON.stringify({
10
+ query: `
11
+ query GetUserProjects {
12
+ users {
13
+ user {
14
+ cms {
15
+ projects(page: { start: 0, limit: 100 }) {
16
+ items {
17
+ name
18
+ adminURL
19
+ }
20
+ page {
21
+ hasNext
22
+ total
23
+ }
24
+ }
25
+ }
26
+ }
27
+ }
28
+ }
29
+ `,
30
+ }),
31
+ });
32
+ if (!response.ok) {
33
+ throw new Error(`Cloud API request failed: ${response.status} ${response.statusText}`);
34
+ }
35
+ const json = await response.json();
36
+ if (json.errors) {
37
+ const errorMessage = json.errors[0]?.message || 'Unknown cloud API error';
38
+ throw new Error(`Cloud API error: ${errorMessage}`);
39
+ }
40
+ const projects = json.data?.users?.user?.cms?.projects?.items;
41
+ if (!projects) {
42
+ return [];
43
+ }
44
+ return projects;
45
+ }
46
+ export async function getUserInfo(accessToken) {
47
+ const response = await fetch(CLOUD_API_URL, {
48
+ method: 'POST',
49
+ headers: {
50
+ 'Content-Type': 'application/json',
51
+ Authorization: accessToken,
52
+ },
53
+ body: JSON.stringify({
54
+ query: `
55
+ query GetUserInfo {
56
+ users {
57
+ user {
58
+ me {
59
+ username
60
+ fullName
61
+ }
62
+ }
63
+ }
64
+ }
65
+ `,
66
+ }),
67
+ });
68
+ if (!response.ok) {
69
+ throw new Error(`Cloud API request failed: ${response.status} ${response.statusText}`);
70
+ }
71
+ const json = await response.json();
72
+ if (json.errors) {
73
+ return null;
74
+ }
75
+ return json.data?.users?.user?.me ?? null;
76
+ }
77
+ export async function verifyAccessToken(accessToken) {
78
+ try {
79
+ const userInfo = await getUserInfo(accessToken);
80
+ return userInfo !== null;
81
+ }
82
+ catch {
83
+ return false;
84
+ }
85
+ }
86
+ //# sourceMappingURL=api.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api.js","sourceRoot":"","sources":["../../src/auth/api.ts"],"names":[],"mappings":"AAKA,MAAM,aAAa,GAAG,OAAO,CAAC,GAAG,CAAC,eAAe,IAAI,sCAAsC,CAAC;AAqB5F,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,WAAmB;IACnD,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,aAAa,EAAE;QAC1C,MAAM,EAAE,MAAM;QACd,OAAO,EAAE;YACP,cAAc,EAAE,kBAAkB;YAClC,aAAa,EAAE,WAAW;SAC3B;QACD,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;YACnB,KAAK,EAAE;;;;;;;;;;;;;;;;;;;OAmBN;SACF,CAAC;KACH,CAAC,CAAC;IAEH,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;QACjB,MAAM,IAAI,KAAK,CAAC,6BAA6B,QAAQ,CAAC,MAAM,IAAI,QAAQ,CAAC,UA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QD,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,WAAmB;IACzD,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,MAAM,WAAW,CAAC,WAAW,CAAC,CAAC;QAChD,OAAO,QAAQ,KAAK,IAAI,CAAC;IAC3B,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC"}
@@ -0,0 +1,32 @@
1
+ export interface AuthConfig {
2
+ email?: string;
3
+ accessToken?: string;
4
+ refreshToken?: string;
5
+ lastRefresh?: number;
6
+ }
7
+ export interface CloudAuth {
8
+ email?: string;
9
+ accessToken: string;
10
+ refreshToken?: string;
11
+ }
12
+ export interface ProjectAuth {
13
+ projectName: string;
14
+ host: string;
15
+ adminToken: string;
16
+ }
17
+ export interface FullAuthConfig extends AuthConfig {
18
+ projects?: Record<string, ProjectAuth>;
19
+ }
20
+ export declare function readAuthConfig(): Promise<FullAuthConfig>;
21
+ export declare function writeAuthConfig(config: FullAuthConfig): Promise<void>;
22
+ export declare function isLoggedIn(): Promise<boolean>;
23
+ export declare function getCurrentUser(): Promise<{
24
+ email: string;
25
+ } | null>;
26
+ export declare function saveLogin(email: string, accessToken: string, refreshToken?: string): Promise<void>;
27
+ export declare function saveCloudAuth(cloudAuth: CloudAuth): Promise<void>;
28
+ export declare function getCloudAuth(): Promise<CloudAuth | null>;
29
+ export declare function saveProjectAuth(project: ProjectAuth): Promise<void>;
30
+ export declare function getProjectAuth(projectName: string): Promise<ProjectAuth | null>;
31
+ export declare function clearAuth(): Promise<void>;
32
+ export declare function getConfigPath(): string;
@@ -0,0 +1,95 @@
1
+ import { promises as fs } from 'node:fs';
2
+ import { homedir } from 'node:os';
3
+ import { join } from 'node:path';
4
+ const CONFIG_DIR = join(homedir(), '.husar');
5
+ const CONFIG_FILE = join(CONFIG_DIR, 'config.json');
6
+ const DIR_MODE = 0o700;
7
+ const FILE_MODE = 0o600;
8
+ async function ensureConfigDir() {
9
+ try {
10
+ await fs.mkdir(CONFIG_DIR, { recursive: true, mode: DIR_MODE });
11
+ }
12
+ catch (err) {
13
+ try {
14
+ await fs.chmod(CONFIG_DIR, DIR_MODE);
15
+ }
16
+ catch {
17
+ }
18
+ }
19
+ }
20
+ export async function readAuthConfig() {
21
+ try {
22
+ await ensureConfigDir();
23
+ const content = await fs.readFile(CONFIG_FILE, 'utf-8');
24
+ return JSON.parse(content);
25
+ }
26
+ catch {
27
+ return {};
28
+ }
29
+ }
30
+ export async function writeAuthConfig(config) {
31
+ await ensureConfigDir();
32
+ await fs.writeFile(CONFIG_FILE, JSON.stringify(config, null, 2), { encoding: 'utf-8', mode: FILE_MODE });
33
+ try {
34
+ await fs.chmod(CONFIG_FILE, FILE_MODE);
35
+ }
36
+ catch {
37
+ }
38
+ }
39
+ export async function isLoggedIn() {
40
+ const config = await readAuthConfig();
41
+ return !!(config.accessToken && config.email);
42
+ }
43
+ export async function getCurrentUser() {
44
+ const config = await readAuthConfig();
45
+ if (!config.accessToken || !config.email) {
46
+ return null;
47
+ }
48
+ return { email: config.email };
49
+ }
50
+ export async function saveLogin(email, accessToken, refreshToken) {
51
+ const config = await readAuthConfig();
52
+ config.email = email;
53
+ config.accessToken = accessToken;
54
+ config.refreshToken = refreshToken;
55
+ config.lastRefresh = Date.now();
56
+ await writeAuthConfig(config);
57
+ }
58
+ export async function saveCloudAuth(cloudAuth) {
59
+ const config = await readAuthConfig();
60
+ config.email = cloudAuth.email;
61
+ config.accessToken = cloudAuth.accessToken;
62
+ config.refreshToken = cloudAuth.refreshToken;
63
+ config.lastRefresh = Date.now();
64
+ await writeAuthConfig(config);
65
+ }
66
+ export async function getCloudAuth() {
67
+ const config = await readAuthConfig();
68
+ if (!config.accessToken) {
69
+ return null;
70
+ }
71
+ return {
72
+ email: config.email,
73
+ accessToken: config.accessToken,
74
+ refreshToken: config.refreshToken,
75
+ };
76
+ }
77
+ export async function saveProjectAuth(project) {
78
+ const config = await readAuthConfig();
79
+ if (!config.projects) {
80
+ config.projects = {};
81
+ }
82
+ config.projects[project.projectName] = project;
83
+ await writeAuthConfig(config);
84
+ }
85
+ export async function getProjectAuth(projectName) {
86
+ const config = await readAuthConfig();
87
+ return config.projects?.[projectName] ?? null;
88
+ }
89
+ export async function clearAuth() {
90
+ await writeAuthConfig({});
91
+ }
92
+ export function getConfigPath() {
93
+ return CONFIG_FILE;
94
+ }
95
+ //# sourceMappingURL=config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/auth/config.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,EAAE,EAAE,QAAQ,CAAC,CAAC;AAC7C,MAAM,WAAW,GAAG,IAAI,CAAC,UAAU,EAAE,aAAa,CAAC,CAAC;AAUpD,MAAM,QAAQ,GAAG,KAAK,CAAC;AACvB,MAAM,SAAS,GAAG,KAAK,CAAC;AA0CxB,KAAK,UAAU,eAAe;IAC5B,IAAI,CAAC;QACH,MAAM,EAAE,CAAC,KAAK,CAAC,UAAU,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC;IAClE,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QAEb,IAAI,CAAC;YACH,MAAM,EAAE,CAAC,KAAK,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;QACvC,CAAC;QAAC,MAAM,CAAC;QAET,CAAC;IACH,CAAC;AACH,CAAC;AAKD,MAAM,CAAC,KAAK,UAAU,cAAc;IAClC,IAAI,CAAC;QACH,MAAM,eAAe,EAAE,CAAC;QACxB,MAAM,OAAO,GAAG,MAAM,EAAE,CAAC,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC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C,OAAO,MAAM,CAAC,QAAQ,EAAE,CAAC,WAAW,CAAC,IAAI,IAAI,CAAC;AAChD,CAAC;AAKD,MAAM,CAAC,KAAK,UAAU,SAAS;IAC7B,MAAM,eAAe,CAAC,EAAE,CAAC,CAAC;AAC5B,CAAC;AAKD,MAAM,UAAU,aAAa;IAC3B,OAAO,WAAW,CAAC;AACrB,CAAC"}
@@ -0,0 +1,30 @@
1
+ import { ProjectAuth } from './config.js';
2
+ export interface CloudLoginResult {
3
+ success: boolean;
4
+ email?: string;
5
+ accessToken?: string;
6
+ error?: string;
7
+ }
8
+ export interface PanelLoginResult {
9
+ success: boolean;
10
+ project?: ProjectAuth;
11
+ error?: string;
12
+ }
13
+ export interface LoginResult {
14
+ success: boolean;
15
+ email?: string;
16
+ project?: ProjectAuth;
17
+ error?: string;
18
+ }
19
+ export declare function startCloudLoginFlow(options?: {
20
+ port?: number;
21
+ timeout?: number;
22
+ }): Promise<CloudLoginResult>;
23
+ export declare function startPanelLoginFlow(panelHost: string, options?: {
24
+ port?: number;
25
+ timeout?: number;
26
+ }): Promise<PanelLoginResult>;
27
+ export declare function startLoginFlow(options?: {
28
+ port?: number;
29
+ timeout?: number;
30
+ }): Promise<LoginResult>;