@frase/mcp-server 0.2.1 → 0.3.0
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/api-client.d.ts +3 -90
- package/dist/api-client.d.ts.map +1 -1
- package/dist/api-client.js +2 -214
- package/dist/api-client.js.map +1 -1
- package/dist/cache.d.ts +2 -49
- package/dist/cache.d.ts.map +1 -1
- package/dist/cache.js +2 -94
- package/dist/cache.js.map +1 -1
- package/dist/cli/config-writer.d.ts.map +1 -1
- package/dist/cli/config-writer.js +52 -7
- package/dist/cli/config-writer.js.map +1 -1
- package/dist/config.d.ts +3 -14
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +2 -28
- package/dist/config.js.map +1 -1
- package/dist/formatter.d.ts +2 -44
- package/dist/formatter.d.ts.map +1 -1
- package/dist/formatter.js +2 -142
- package/dist/formatter.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/prompts/cms-publishing.d.ts +16 -0
- package/dist/prompts/cms-publishing.d.ts.map +1 -0
- package/dist/prompts/cms-publishing.js +84 -0
- package/dist/prompts/cms-publishing.js.map +1 -0
- package/dist/prompts/competitive-intelligence.d.ts +16 -0
- package/dist/prompts/competitive-intelligence.d.ts.map +1 -0
- package/dist/prompts/competitive-intelligence.js +78 -0
- package/dist/prompts/competitive-intelligence.js.map +1 -0
- package/dist/prompts/content-governance.d.ts +16 -0
- package/dist/prompts/content-governance.d.ts.map +1 -0
- package/dist/prompts/content-governance.js +113 -0
- package/dist/prompts/content-governance.js.map +1 -0
- package/dist/prompts/geo-optimization.d.ts +17 -0
- package/dist/prompts/geo-optimization.d.ts.map +1 -0
- package/dist/prompts/geo-optimization.js +79 -0
- package/dist/prompts/geo-optimization.js.map +1 -0
- package/dist/prompts/index.d.ts.map +1 -1
- package/dist/prompts/index.js +15 -0
- package/dist/prompts/index.js.map +1 -1
- package/dist/tools/atomization.d.ts +8 -0
- package/dist/tools/atomization.d.ts.map +1 -0
- package/dist/tools/atomization.js +172 -0
- package/dist/tools/atomization.js.map +1 -0
- package/dist/tools/audits.d.ts.map +1 -1
- package/dist/tools/audits.js +1 -2
- package/dist/tools/audits.js.map +1 -1
- package/dist/tools/briefs.d.ts +2 -2
- package/dist/tools/briefs.d.ts.map +1 -1
- package/dist/tools/briefs.js +63 -4
- package/dist/tools/briefs.js.map +1 -1
- package/dist/tools/clusters.d.ts +9 -0
- package/dist/tools/clusters.d.ts.map +1 -0
- package/dist/tools/clusters.js +166 -0
- package/dist/tools/clusters.js.map +1 -0
- package/dist/tools/cms-connections.d.ts +7 -0
- package/dist/tools/cms-connections.d.ts.map +1 -0
- package/dist/tools/cms-connections.js +96 -0
- package/dist/tools/cms-connections.js.map +1 -0
- package/dist/tools/competitive-analysis.js +2 -2
- package/dist/tools/competitive-analysis.js.map +1 -1
- package/dist/tools/content.d.ts +2 -2
- package/dist/tools/content.d.ts.map +1 -1
- package/dist/tools/content.js +73 -9
- package/dist/tools/content.js.map +1 -1
- package/dist/tools/discover.d.ts +15 -0
- package/dist/tools/discover.d.ts.map +1 -0
- package/dist/tools/discover.js +180 -0
- package/dist/tools/discover.js.map +1 -0
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +32 -0
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/jobs.d.ts +2 -2
- package/dist/tools/opportunities.d.ts +11 -0
- package/dist/tools/opportunities.d.ts.map +1 -0
- package/dist/tools/opportunities.js +122 -0
- package/dist/tools/opportunities.js.map +1 -0
- package/dist/tools/site-health.d.ts +7 -0
- package/dist/tools/site-health.d.ts.map +1 -0
- package/dist/tools/site-health.js +120 -0
- package/dist/tools/site-health.js.map +1 -0
- package/dist/types.d.ts +2 -180
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +1 -1
- package/package.json +26 -7
- package/server.json +4 -4
package/dist/api-client.d.ts
CHANGED
|
@@ -1,93 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* API Client — re-exported from @frase/core
|
|
3
3
|
*/
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
* API Error class
|
|
7
|
-
*/
|
|
8
|
-
export declare class FraseApiError extends Error {
|
|
9
|
-
readonly status: number;
|
|
10
|
-
readonly code: string;
|
|
11
|
-
readonly details?: unknown | undefined;
|
|
12
|
-
constructor(status: number, code: string, message: string, details?: unknown | undefined);
|
|
13
|
-
/**
|
|
14
|
-
* Check if this error is retryable
|
|
15
|
-
*/
|
|
16
|
-
get isRetryable(): boolean;
|
|
17
|
-
/**
|
|
18
|
-
* Format error for display
|
|
19
|
-
*/
|
|
20
|
-
toMarkdown(): string;
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Paginated response structure
|
|
24
|
-
*/
|
|
25
|
-
export interface PaginatedResponse<T> {
|
|
26
|
-
data: T[];
|
|
27
|
-
pagination: {
|
|
28
|
-
page: number;
|
|
29
|
-
page_size: number;
|
|
30
|
-
total: number;
|
|
31
|
-
has_more: boolean;
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* API response structure
|
|
36
|
-
*/
|
|
37
|
-
export interface ApiResponse<T> {
|
|
38
|
-
data: T;
|
|
39
|
-
request_id: string;
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* Frase API Client
|
|
43
|
-
*/
|
|
44
|
-
export declare class FraseApiClient {
|
|
45
|
-
private config;
|
|
46
|
-
private cache;
|
|
47
|
-
constructor(config: Config);
|
|
48
|
-
/**
|
|
49
|
-
* Sleep for a specified duration
|
|
50
|
-
*/
|
|
51
|
-
private sleep;
|
|
52
|
-
/**
|
|
53
|
-
* Calculate retry delay with exponential backoff
|
|
54
|
-
*/
|
|
55
|
-
private getRetryDelay;
|
|
56
|
-
/**
|
|
57
|
-
* Make an HTTP request with retry logic
|
|
58
|
-
*/
|
|
59
|
-
request<T>(method: string, path: string, options?: {
|
|
60
|
-
body?: unknown;
|
|
61
|
-
params?: Record<string, string | number | boolean | undefined>;
|
|
62
|
-
cacheTtl?: number;
|
|
63
|
-
}): Promise<T>;
|
|
64
|
-
/**
|
|
65
|
-
* GET request
|
|
66
|
-
*/
|
|
67
|
-
get<T>(path: string, params?: Record<string, string | number | boolean | undefined>, cacheTtl?: number): Promise<T>;
|
|
68
|
-
/**
|
|
69
|
-
* POST request
|
|
70
|
-
*/
|
|
71
|
-
post<T>(path: string, body: unknown): Promise<T>;
|
|
72
|
-
/**
|
|
73
|
-
* PUT request
|
|
74
|
-
*/
|
|
75
|
-
put<T>(path: string, body: unknown): Promise<T>;
|
|
76
|
-
/**
|
|
77
|
-
* PATCH request
|
|
78
|
-
*/
|
|
79
|
-
patch<T>(path: string, body: unknown): Promise<T>;
|
|
80
|
-
/**
|
|
81
|
-
* DELETE request
|
|
82
|
-
*/
|
|
83
|
-
delete<T>(path: string): Promise<T>;
|
|
84
|
-
/**
|
|
85
|
-
* Clear all cached data
|
|
86
|
-
*/
|
|
87
|
-
clearCache(): void;
|
|
88
|
-
/**
|
|
89
|
-
* Destroy the client (for graceful shutdown)
|
|
90
|
-
*/
|
|
91
|
-
destroy(): void;
|
|
92
|
-
}
|
|
4
|
+
export { FraseApiClient, FraseApiError } from "@frase/core";
|
|
5
|
+
export type { PaginatedResponse, ApiResponse } from "@frase/core";
|
|
93
6
|
//# sourceMappingURL=api-client.d.ts.map
|
package/dist/api-client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api-client.d.ts","sourceRoot":"","sources":["../src/api-client.ts"],"names":[],"mappings":"AAAA;;GAEG;
|
|
1
|
+
{"version":3,"file":"api-client.d.ts","sourceRoot":"","sources":["../src/api-client.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5D,YAAY,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC"}
|
package/dist/api-client.js
CHANGED
|
@@ -1,217 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* API Client — re-exported from @frase/core
|
|
3
3
|
*/
|
|
4
|
-
|
|
5
|
-
import { debugLog } from "./config.js";
|
|
6
|
-
/**
|
|
7
|
-
* Retry configuration
|
|
8
|
-
*/
|
|
9
|
-
const RETRY_CONFIG = {
|
|
10
|
-
maxRetries: 2,
|
|
11
|
-
baseDelayMs: 1000,
|
|
12
|
-
maxDelayMs: 10000,
|
|
13
|
-
retryableStatuses: [429, 500, 502, 503, 504],
|
|
14
|
-
};
|
|
15
|
-
/**
|
|
16
|
-
* API Error class
|
|
17
|
-
*/
|
|
18
|
-
export class FraseApiError extends Error {
|
|
19
|
-
status;
|
|
20
|
-
code;
|
|
21
|
-
details;
|
|
22
|
-
constructor(status, code, message, details) {
|
|
23
|
-
super(message);
|
|
24
|
-
this.status = status;
|
|
25
|
-
this.code = code;
|
|
26
|
-
this.details = details;
|
|
27
|
-
this.name = "FraseApiError";
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Check if this error is retryable
|
|
31
|
-
*/
|
|
32
|
-
get isRetryable() {
|
|
33
|
-
return RETRY_CONFIG.retryableStatuses.includes(this.status);
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Format error for display
|
|
37
|
-
*/
|
|
38
|
-
toMarkdown() {
|
|
39
|
-
let md = `**Error:** ${this.message}\n`;
|
|
40
|
-
md += `- Code: \`${this.code}\`\n`;
|
|
41
|
-
md += `- Status: ${this.status}\n`;
|
|
42
|
-
if (this.details) {
|
|
43
|
-
md += `- Details: ${JSON.stringify(this.details)}\n`;
|
|
44
|
-
}
|
|
45
|
-
return md;
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* Frase API Client
|
|
50
|
-
*/
|
|
51
|
-
export class FraseApiClient {
|
|
52
|
-
config;
|
|
53
|
-
cache;
|
|
54
|
-
constructor(config) {
|
|
55
|
-
this.config = config;
|
|
56
|
-
this.cache = new ResponseCache();
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* Sleep for a specified duration
|
|
60
|
-
*/
|
|
61
|
-
sleep(ms) {
|
|
62
|
-
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
* Calculate retry delay with exponential backoff
|
|
66
|
-
*/
|
|
67
|
-
getRetryDelay(attempt, retryAfter) {
|
|
68
|
-
if (retryAfter) {
|
|
69
|
-
const seconds = parseInt(retryAfter, 10);
|
|
70
|
-
if (!isNaN(seconds)) {
|
|
71
|
-
return Math.min(seconds * 1000, RETRY_CONFIG.maxDelayMs);
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
// Exponential backoff: 1s, 2s, 4s... capped at maxDelayMs
|
|
75
|
-
const delay = RETRY_CONFIG.baseDelayMs * Math.pow(2, attempt);
|
|
76
|
-
return Math.min(delay, RETRY_CONFIG.maxDelayMs);
|
|
77
|
-
}
|
|
78
|
-
/**
|
|
79
|
-
* Make an HTTP request with retry logic
|
|
80
|
-
*/
|
|
81
|
-
async request(method, path, options) {
|
|
82
|
-
const { body, params, cacheTtl } = options || {};
|
|
83
|
-
// Build URL with query params
|
|
84
|
-
let url = `${this.config.apiUrl}${path}`;
|
|
85
|
-
if (params) {
|
|
86
|
-
const searchParams = new URLSearchParams();
|
|
87
|
-
for (const [key, value] of Object.entries(params)) {
|
|
88
|
-
if (value !== undefined) {
|
|
89
|
-
searchParams.set(key, String(value));
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
const queryString = searchParams.toString();
|
|
93
|
-
if (queryString) {
|
|
94
|
-
url += `?${queryString}`;
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
// Check cache for GET requests
|
|
98
|
-
if (method === "GET" && cacheTtl) {
|
|
99
|
-
const cacheKey = ResponseCache.key(method, path, params);
|
|
100
|
-
const cached = this.cache.get(cacheKey);
|
|
101
|
-
if (cached) {
|
|
102
|
-
debugLog(this.config, `Cache hit: ${path}`);
|
|
103
|
-
return cached;
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
let lastError = null;
|
|
107
|
-
for (let attempt = 0; attempt <= RETRY_CONFIG.maxRetries; attempt++) {
|
|
108
|
-
try {
|
|
109
|
-
debugLog(this.config, `Request: ${method} ${path} (attempt ${attempt + 1})`);
|
|
110
|
-
const response = await fetch(url, {
|
|
111
|
-
method,
|
|
112
|
-
headers: {
|
|
113
|
-
"Content-Type": "application/json",
|
|
114
|
-
"X-API-KEY": this.config.apiKey,
|
|
115
|
-
"User-Agent": "frase-mcp-server/0.2.1",
|
|
116
|
-
},
|
|
117
|
-
body: body ? JSON.stringify(body) : undefined,
|
|
118
|
-
});
|
|
119
|
-
if (!response.ok) {
|
|
120
|
-
let errorData = {};
|
|
121
|
-
try {
|
|
122
|
-
errorData = (await response.json());
|
|
123
|
-
}
|
|
124
|
-
catch {
|
|
125
|
-
// Ignore JSON parse errors
|
|
126
|
-
}
|
|
127
|
-
const error = new FraseApiError(response.status, errorData.error?.code || `http_${response.status}`, errorData.error?.message || `HTTP ${response.status}`, errorData);
|
|
128
|
-
// Check if we should retry
|
|
129
|
-
if (attempt < RETRY_CONFIG.maxRetries && error.isRetryable) {
|
|
130
|
-
const delay = this.getRetryDelay(attempt, response.headers.get("Retry-After") || undefined);
|
|
131
|
-
debugLog(this.config, `Retrying in ${delay}ms...`);
|
|
132
|
-
await this.sleep(delay);
|
|
133
|
-
continue;
|
|
134
|
-
}
|
|
135
|
-
throw error;
|
|
136
|
-
}
|
|
137
|
-
const contentType = response.headers.get("Content-Type") || "";
|
|
138
|
-
const isJson = contentType.includes("application/json") ||
|
|
139
|
-
// If no content-type header, default to JSON for backwards compatibility
|
|
140
|
-
!contentType;
|
|
141
|
-
const data = (isJson ? await response.json() : await response.text());
|
|
142
|
-
// Cache successful GET responses
|
|
143
|
-
if (method === "GET" && cacheTtl) {
|
|
144
|
-
const cacheKey = ResponseCache.key(method, path, params);
|
|
145
|
-
this.cache.set(cacheKey, data, cacheTtl);
|
|
146
|
-
}
|
|
147
|
-
// Invalidate cache on write operations
|
|
148
|
-
if (method !== "GET") {
|
|
149
|
-
const resourceType = path.split("/")[1]; // e.g., /sites -> sites
|
|
150
|
-
if (resourceType) {
|
|
151
|
-
this.cache.invalidateResourceType(resourceType);
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
return data;
|
|
155
|
-
}
|
|
156
|
-
catch (error) {
|
|
157
|
-
lastError = error;
|
|
158
|
-
// Don't retry FraseApiError unless it's retryable
|
|
159
|
-
if (error instanceof FraseApiError && !error.isRetryable) {
|
|
160
|
-
throw error;
|
|
161
|
-
}
|
|
162
|
-
// Network errors - retry if we have attempts left
|
|
163
|
-
if (attempt < RETRY_CONFIG.maxRetries && !(error instanceof FraseApiError)) {
|
|
164
|
-
const delay = this.getRetryDelay(attempt);
|
|
165
|
-
debugLog(this.config, `Network error, retrying in ${delay}ms...`);
|
|
166
|
-
await this.sleep(delay);
|
|
167
|
-
continue;
|
|
168
|
-
}
|
|
169
|
-
throw error;
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
throw lastError || new Error("Request failed after retries");
|
|
173
|
-
}
|
|
174
|
-
/**
|
|
175
|
-
* GET request
|
|
176
|
-
*/
|
|
177
|
-
get(path, params, cacheTtl) {
|
|
178
|
-
return this.request("GET", path, { params, cacheTtl });
|
|
179
|
-
}
|
|
180
|
-
/**
|
|
181
|
-
* POST request
|
|
182
|
-
*/
|
|
183
|
-
post(path, body) {
|
|
184
|
-
return this.request("POST", path, { body });
|
|
185
|
-
}
|
|
186
|
-
/**
|
|
187
|
-
* PUT request
|
|
188
|
-
*/
|
|
189
|
-
put(path, body) {
|
|
190
|
-
return this.request("PUT", path, { body });
|
|
191
|
-
}
|
|
192
|
-
/**
|
|
193
|
-
* PATCH request
|
|
194
|
-
*/
|
|
195
|
-
patch(path, body) {
|
|
196
|
-
return this.request("PATCH", path, { body });
|
|
197
|
-
}
|
|
198
|
-
/**
|
|
199
|
-
* DELETE request
|
|
200
|
-
*/
|
|
201
|
-
delete(path) {
|
|
202
|
-
return this.request("DELETE", path);
|
|
203
|
-
}
|
|
204
|
-
/**
|
|
205
|
-
* Clear all cached data
|
|
206
|
-
*/
|
|
207
|
-
clearCache() {
|
|
208
|
-
this.cache.clear();
|
|
209
|
-
}
|
|
210
|
-
/**
|
|
211
|
-
* Destroy the client (for graceful shutdown)
|
|
212
|
-
*/
|
|
213
|
-
destroy() {
|
|
214
|
-
this.cache.destroy();
|
|
215
|
-
}
|
|
216
|
-
}
|
|
4
|
+
export { FraseApiClient, FraseApiError } from "@frase/core";
|
|
217
5
|
//# sourceMappingURL=api-client.js.map
|
package/dist/api-client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api-client.js","sourceRoot":"","sources":["../src/api-client.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"api-client.js","sourceRoot":"","sources":["../src/api-client.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC"}
|
package/dist/cache.d.ts
CHANGED
|
@@ -1,52 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Cache — re-exported from @frase/core
|
|
3
3
|
*/
|
|
4
|
-
|
|
5
|
-
* Cache TTL configuration (in milliseconds)
|
|
6
|
-
*/
|
|
7
|
-
export declare const CACHE_TTL: {
|
|
8
|
-
readonly lists: 60000;
|
|
9
|
-
readonly resources: 300000;
|
|
10
|
-
};
|
|
11
|
-
/**
|
|
12
|
-
* Simple cache implementation
|
|
13
|
-
*/
|
|
14
|
-
export declare class ResponseCache {
|
|
15
|
-
private cache;
|
|
16
|
-
private cleanupInterval;
|
|
17
|
-
constructor();
|
|
18
|
-
/**
|
|
19
|
-
* Get a cached value
|
|
20
|
-
*/
|
|
21
|
-
get<T>(key: string): T | undefined;
|
|
22
|
-
/**
|
|
23
|
-
* Set a cached value
|
|
24
|
-
*/
|
|
25
|
-
set<T>(key: string, data: T, ttl: number): void;
|
|
26
|
-
/**
|
|
27
|
-
* Generate cache key for a request
|
|
28
|
-
*/
|
|
29
|
-
static key(method: string, path: string, params?: Record<string, unknown>): string;
|
|
30
|
-
/**
|
|
31
|
-
* Invalidate cache entries matching a pattern
|
|
32
|
-
*/
|
|
33
|
-
invalidate(pattern: string | RegExp): void;
|
|
34
|
-
/**
|
|
35
|
-
* Invalidate all cache entries for a resource type
|
|
36
|
-
* Called after write operations
|
|
37
|
-
*/
|
|
38
|
-
invalidateResourceType(resourceType: string): void;
|
|
39
|
-
/**
|
|
40
|
-
* Clear all cached entries
|
|
41
|
-
*/
|
|
42
|
-
clear(): void;
|
|
43
|
-
/**
|
|
44
|
-
* Clean up expired entries
|
|
45
|
-
*/
|
|
46
|
-
private cleanup;
|
|
47
|
-
/**
|
|
48
|
-
* Stop the cleanup interval (for graceful shutdown)
|
|
49
|
-
*/
|
|
50
|
-
destroy(): void;
|
|
51
|
-
}
|
|
4
|
+
export { ResponseCache, CACHE_TTL } from "@frase/core";
|
|
52
5
|
//# sourceMappingURL=cache.d.ts.map
|
package/dist/cache.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cache.d.ts","sourceRoot":"","sources":["../src/cache.ts"],"names":[],"mappings":"AAAA;;GAEG;
|
|
1
|
+
{"version":3,"file":"cache.d.ts","sourceRoot":"","sources":["../src/cache.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC"}
|
package/dist/cache.js
CHANGED
|
@@ -1,97 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Cache — re-exported from @frase/core
|
|
3
3
|
*/
|
|
4
|
-
|
|
5
|
-
* Cache TTL configuration (in milliseconds)
|
|
6
|
-
*/
|
|
7
|
-
export const CACHE_TTL = {
|
|
8
|
-
lists: 60_000, // 1 minute for list endpoints
|
|
9
|
-
resources: 300_000, // 5 minutes for individual resources
|
|
10
|
-
};
|
|
11
|
-
/**
|
|
12
|
-
* Simple cache implementation
|
|
13
|
-
*/
|
|
14
|
-
export class ResponseCache {
|
|
15
|
-
cache = new Map();
|
|
16
|
-
cleanupInterval = null;
|
|
17
|
-
constructor() {
|
|
18
|
-
// Run cleanup every minute
|
|
19
|
-
this.cleanupInterval = setInterval(() => this.cleanup(), 60_000);
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Get a cached value
|
|
23
|
-
*/
|
|
24
|
-
get(key) {
|
|
25
|
-
const entry = this.cache.get(key);
|
|
26
|
-
if (!entry) {
|
|
27
|
-
return undefined;
|
|
28
|
-
}
|
|
29
|
-
if (Date.now() > entry.expiresAt) {
|
|
30
|
-
this.cache.delete(key);
|
|
31
|
-
return undefined;
|
|
32
|
-
}
|
|
33
|
-
return entry.data;
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Set a cached value
|
|
37
|
-
*/
|
|
38
|
-
set(key, data, ttl) {
|
|
39
|
-
this.cache.set(key, {
|
|
40
|
-
data,
|
|
41
|
-
expiresAt: Date.now() + ttl,
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Generate cache key for a request
|
|
46
|
-
*/
|
|
47
|
-
static key(method, path, params) {
|
|
48
|
-
const paramStr = params ? JSON.stringify(params) : "";
|
|
49
|
-
return `${method}:${path}:${paramStr}`;
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* Invalidate cache entries matching a pattern
|
|
53
|
-
*/
|
|
54
|
-
invalidate(pattern) {
|
|
55
|
-
const regex = typeof pattern === "string" ? new RegExp(pattern) : pattern;
|
|
56
|
-
for (const key of this.cache.keys()) {
|
|
57
|
-
if (regex.test(key)) {
|
|
58
|
-
this.cache.delete(key);
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
/**
|
|
63
|
-
* Invalidate all cache entries for a resource type
|
|
64
|
-
* Called after write operations
|
|
65
|
-
*/
|
|
66
|
-
invalidateResourceType(resourceType) {
|
|
67
|
-
this.invalidate(new RegExp(`:/${resourceType}`));
|
|
68
|
-
}
|
|
69
|
-
/**
|
|
70
|
-
* Clear all cached entries
|
|
71
|
-
*/
|
|
72
|
-
clear() {
|
|
73
|
-
this.cache.clear();
|
|
74
|
-
}
|
|
75
|
-
/**
|
|
76
|
-
* Clean up expired entries
|
|
77
|
-
*/
|
|
78
|
-
cleanup() {
|
|
79
|
-
const now = Date.now();
|
|
80
|
-
for (const [key, entry] of this.cache.entries()) {
|
|
81
|
-
if (now > entry.expiresAt) {
|
|
82
|
-
this.cache.delete(key);
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
/**
|
|
87
|
-
* Stop the cleanup interval (for graceful shutdown)
|
|
88
|
-
*/
|
|
89
|
-
destroy() {
|
|
90
|
-
if (this.cleanupInterval) {
|
|
91
|
-
clearInterval(this.cleanupInterval);
|
|
92
|
-
this.cleanupInterval = null;
|
|
93
|
-
}
|
|
94
|
-
this.cache.clear();
|
|
95
|
-
}
|
|
96
|
-
}
|
|
4
|
+
export { ResponseCache, CACHE_TTL } from "@frase/core";
|
|
97
5
|
//# sourceMappingURL=cache.js.map
|
package/dist/cache.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cache.js","sourceRoot":"","sources":["../src/cache.ts"],"names":[],"mappings":"AAAA;;GAEG;
|
|
1
|
+
{"version":3,"file":"cache.js","sourceRoot":"","sources":["../src/cache.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config-writer.d.ts","sourceRoot":"","sources":["../../src/cli/config-writer.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAErD,2CAA2C;AAC3C,UAAU,cAAc;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC7B;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,cAAc,CAU/E;
|
|
1
|
+
{"version":3,"file":"config-writer.d.ts","sourceRoot":"","sources":["../../src/cli/config-writer.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAErD,2CAA2C;AAC3C,UAAU,cAAc;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC7B;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,cAAc,CAU/E;AAuDD;;GAEG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,YAAY,GAAG,OAAO,CAYzD;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAiE5F"}
|
|
@@ -21,19 +21,59 @@ export function buildFraseEntry(apiKey, apiUrl) {
|
|
|
21
21
|
};
|
|
22
22
|
}
|
|
23
23
|
/**
|
|
24
|
-
*
|
|
25
|
-
*
|
|
24
|
+
* Strip single-line (//) and block (/* * /) comments from JSONC.
|
|
25
|
+
* Respects strings — does not strip inside "quoted values".
|
|
26
|
+
*/
|
|
27
|
+
function stripJsonComments(text) {
|
|
28
|
+
let result = "";
|
|
29
|
+
let i = 0;
|
|
30
|
+
while (i < text.length) {
|
|
31
|
+
// Skip strings
|
|
32
|
+
if (text[i] === '"') {
|
|
33
|
+
let j = i + 1;
|
|
34
|
+
while (j < text.length && text[j] !== '"') {
|
|
35
|
+
if (text[j] === '\\')
|
|
36
|
+
j++; // skip escaped char
|
|
37
|
+
j++;
|
|
38
|
+
}
|
|
39
|
+
result += text.slice(i, j + 1);
|
|
40
|
+
i = j + 1;
|
|
41
|
+
// Block comment
|
|
42
|
+
}
|
|
43
|
+
else if (text[i] === '/' && text[i + 1] === '*') {
|
|
44
|
+
const end = text.indexOf('*/', i + 2);
|
|
45
|
+
i = end === -1 ? text.length : end + 2;
|
|
46
|
+
// Line comment
|
|
47
|
+
}
|
|
48
|
+
else if (text[i] === '/' && text[i + 1] === '/') {
|
|
49
|
+
const end = text.indexOf('\n', i + 2);
|
|
50
|
+
i = end === -1 ? text.length : end;
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
result += text[i];
|
|
54
|
+
i++;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
return result;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Read a JSON/JSONC config file, returning empty object if it doesn't exist.
|
|
61
|
+
* Returns { data, malformed, hasComments }:
|
|
62
|
+
* - malformed is true if the file exists but is not valid JSON/JSONC
|
|
63
|
+
* - hasComments is true if the file contained // or /* comments
|
|
26
64
|
*/
|
|
27
65
|
function readJsonConfig(path) {
|
|
28
66
|
if (!existsSync(path)) {
|
|
29
|
-
return { data: {}, malformed: false };
|
|
67
|
+
return { data: {}, malformed: false, hasComments: false };
|
|
30
68
|
}
|
|
31
69
|
try {
|
|
32
70
|
const content = readFileSync(path, "utf-8");
|
|
33
|
-
|
|
71
|
+
const hasComments = /\/\/|\/\*/.test(content);
|
|
72
|
+
const stripped = hasComments ? stripJsonComments(content) : content;
|
|
73
|
+
return { data: JSON.parse(stripped), malformed: false, hasComments };
|
|
34
74
|
}
|
|
35
75
|
catch {
|
|
36
|
-
return { data: {}, malformed: true };
|
|
76
|
+
return { data: {}, malformed: true, hasComments: false };
|
|
37
77
|
}
|
|
38
78
|
}
|
|
39
79
|
/**
|
|
@@ -43,7 +83,7 @@ export function hasFraseEntry(tool) {
|
|
|
43
83
|
if (!tool.configPath || !existsSync(tool.configPath)) {
|
|
44
84
|
return false;
|
|
45
85
|
}
|
|
46
|
-
const { data } = readJsonConfig(tool.configPath);
|
|
86
|
+
const { data } = readJsonConfig(tool.configPath); // hasComments not needed for read-only check
|
|
47
87
|
if (tool.id === "vscode") {
|
|
48
88
|
const mcp = data.mcp;
|
|
49
89
|
const servers = mcp?.servers;
|
|
@@ -72,7 +112,7 @@ export function writeFraseConfig(tool, apiKey, apiUrl) {
|
|
|
72
112
|
throw new Error(`Cannot create directory: ${dir}. Check permissions.`);
|
|
73
113
|
}
|
|
74
114
|
// Read existing config
|
|
75
|
-
const { data: config, malformed } = readJsonConfig(configPath);
|
|
115
|
+
const { data: config, malformed, hasComments } = readJsonConfig(configPath);
|
|
76
116
|
if (malformed) {
|
|
77
117
|
console.log(` Warning: ${configPath} contains invalid JSON.`);
|
|
78
118
|
console.log(" A backup will be created before overwriting.");
|
|
@@ -114,6 +154,11 @@ export function writeFraseConfig(tool, apiKey, apiUrl) {
|
|
|
114
154
|
}
|
|
115
155
|
throw err;
|
|
116
156
|
}
|
|
157
|
+
if (hasComments) {
|
|
158
|
+
const backupPath = configPath + ".backup";
|
|
159
|
+
console.log(` Warning: ${configPath} contained comments (// or /* */) which have been stripped.`);
|
|
160
|
+
console.log(` Your original file was backed up to: ${backupPath}`);
|
|
161
|
+
}
|
|
117
162
|
return configPath;
|
|
118
163
|
}
|
|
119
164
|
//# sourceMappingURL=config-writer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config-writer.js","sourceRoot":"","sources":["../../src/cli/config-writer.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,SAAS,EAAE,UAAU,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACtG,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAUpC;;GAEG;AACH,MAAM,UAAU,eAAe,CAAC,MAAc,EAAE,MAAe;IAC7D,MAAM,GAAG,GAA2B,EAAE,aAAa,EAAE,MAAM,EAAE,CAAC;IAC9D,IAAI,MAAM,EAAE,CAAC;QACX,GAAG,CAAC,aAAa,GAAG,MAAM,CAAC;IAC7B,CAAC;IACD,OAAO;QACL,OAAO,EAAE,KAAK;QACd,IAAI,EAAE,CAAC,IAAI,EAAE,mBAAmB,CAAC;QACjC,GAAG;KACJ,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,SAAS,cAAc,CAAC,IAAY;IAClC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;QACtB,OAAO,EAAE,IAAI,EAAE,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"config-writer.js","sourceRoot":"","sources":["../../src/cli/config-writer.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,SAAS,EAAE,UAAU,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACtG,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAUpC;;GAEG;AACH,MAAM,UAAU,eAAe,CAAC,MAAc,EAAE,MAAe;IAC7D,MAAM,GAAG,GAA2B,EAAE,aAAa,EAAE,MAAM,EAAE,CAAC;IAC9D,IAAI,MAAM,EAAE,CAAC;QACX,GAAG,CAAC,aAAa,GAAG,MAAM,CAAC;IAC7B,CAAC;IACD,OAAO;QACL,OAAO,EAAE,KAAK;QACd,IAAI,EAAE,CAAC,IAAI,EAAE,mB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AC,CAAC;QAC7D,IAAI,GAAG,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,GAAG,CAAC,QAAQ,CAAC,YAAY,CAAC,EAAE,CAAC;YACzD,MAAM,IAAI,KAAK,CAAC,mBAAmB,UAAU,2BAA2B,CAAC,CAAC;QAC5E,CAAC;QACD,MAAM,GAAG,CAAC;IACZ,CAAC;IAED,IAAI,WAAW,EAAE,CAAC;QAChB,MAAM,UAAU,GAAG,UAAU,GAAG,SAAS,CAAC;QAC1C,OAAO,CAAC,GAAG,CAAC,cAAc,UAAU,6DAA6D,CAAC,CAAC;QACnG,OAAO,CAAC,GAAG,CAAC,0CAA0C,UAAU,EAAE,CAAC,CAAC;IACtE,CAAC;IAED,OAAO,UAAU,CAAC;AACpB,CAAC"}
|
package/dist/config.d.ts
CHANGED
|
@@ -1,17 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Configuration
|
|
2
|
+
* Configuration — re-exported from @frase/core
|
|
3
3
|
*/
|
|
4
|
-
export
|
|
5
|
-
|
|
6
|
-
apiUrl: string;
|
|
7
|
-
debug: boolean;
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* Load configuration from environment variables
|
|
11
|
-
*/
|
|
12
|
-
export declare function loadConfig(): Config;
|
|
13
|
-
/**
|
|
14
|
-
* Log debug message if debug mode is enabled
|
|
15
|
-
*/
|
|
16
|
-
export declare function debugLog(config: Config, ...args: unknown[]): void;
|
|
4
|
+
export { loadConfig, debugLog, getConfigPath } from "@frase/core";
|
|
5
|
+
export type { Config } from "@frase/core";
|
|
17
6
|
//# sourceMappingURL=config.d.ts.map
|
package/dist/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAClE,YAAY,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC"}
|