latitude-mcp-server 2.1.5 → 2.1.7
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.d.ts +4 -4
- package/dist/api.js +17 -43
- package/package.json +1 -1
package/dist/api.d.ts
CHANGED
|
@@ -28,12 +28,12 @@ export declare function createVersion(name: string): Promise<Version>;
|
|
|
28
28
|
export declare function publishVersion(versionUuid: string, title?: string): Promise<Version>;
|
|
29
29
|
export declare function listDocuments(versionUuid?: string): Promise<Document[]>;
|
|
30
30
|
export declare function getDocument(path: string, versionUuid?: string): Promise<Document>;
|
|
31
|
-
export declare function createOrUpdateDocument(versionUuid: string, path: string, content: string): Promise<Document>;
|
|
31
|
+
export declare function createOrUpdateDocument(versionUuid: string, path: string, content: string, force?: boolean): Promise<Document>;
|
|
32
32
|
export declare function deleteDocument(versionUuid: string, path: string): Promise<void>;
|
|
33
33
|
export declare function runDocument(path: string, parameters?: Record<string, unknown>, versionUuid?: string): Promise<RunResult>;
|
|
34
34
|
/**
|
|
35
|
-
* Deploy changes to LIVE version
|
|
36
|
-
*
|
|
35
|
+
* Deploy changes directly to LIVE version using force mode
|
|
36
|
+
* This bypasses the draft->publish workflow which requires provider validation
|
|
37
37
|
*/
|
|
38
|
-
export declare function deployToLive(changes: DocumentChange[],
|
|
38
|
+
export declare function deployToLive(changes: DocumentChange[], _versionName?: string): Promise<DeployResult>;
|
|
39
39
|
export declare function getPromptNames(): Promise<string[]>;
|
package/dist/api.js
CHANGED
|
@@ -171,12 +171,12 @@ async function getDocument(path, versionUuid = 'live') {
|
|
|
171
171
|
const normalizedPath = path.startsWith('/') ? path.slice(1) : path;
|
|
172
172
|
return request(`/projects/${projectId}/versions/${versionUuid}/documents/${normalizedPath}`);
|
|
173
173
|
}
|
|
174
|
-
async function createOrUpdateDocument(versionUuid, path, content) {
|
|
174
|
+
async function createOrUpdateDocument(versionUuid, path, content, force = false) {
|
|
175
175
|
const projectId = getProjectId();
|
|
176
|
-
logger.debug(`Creating/updating document: ${path} (${content.length} chars)`);
|
|
176
|
+
logger.debug(`Creating/updating document: ${path} (${content.length} chars, force=${force})`);
|
|
177
177
|
return request(`/projects/${projectId}/versions/${versionUuid}/documents/create-or-update`, {
|
|
178
178
|
method: 'POST',
|
|
179
|
-
body: { path, prompt: content },
|
|
179
|
+
body: { path, prompt: content, force },
|
|
180
180
|
});
|
|
181
181
|
}
|
|
182
182
|
async function deleteDocument(versionUuid, path) {
|
|
@@ -197,49 +197,21 @@ async function runDocument(path, parameters, versionUuid = 'live') {
|
|
|
197
197
|
});
|
|
198
198
|
}
|
|
199
199
|
/**
|
|
200
|
-
*
|
|
201
|
-
*
|
|
200
|
+
* Deploy changes directly to LIVE version using force mode
|
|
201
|
+
* This bypasses the draft->publish workflow which requires provider validation
|
|
202
202
|
*/
|
|
203
|
-
function
|
|
204
|
-
const now = new Date();
|
|
205
|
-
const options = {
|
|
206
|
-
timeZone: 'America/Los_Angeles',
|
|
207
|
-
day: 'numeric',
|
|
208
|
-
month: 'short',
|
|
209
|
-
year: 'numeric',
|
|
210
|
-
hour: '2-digit',
|
|
211
|
-
minute: '2-digit',
|
|
212
|
-
hour12: false,
|
|
213
|
-
};
|
|
214
|
-
const formatted = now.toLocaleString('en-US', options);
|
|
215
|
-
// "Jan 14, 2025, 13:11" → "14 Jan 2025 - 13:11"
|
|
216
|
-
const match = formatted.match(/(\w+)\s+(\d+),\s+(\d+),\s+(\d+:\d+)/);
|
|
217
|
-
let timestamp = match
|
|
218
|
-
? `${match[2]} ${match[1]} ${match[3]} - ${match[4]}`
|
|
219
|
-
: now.toISOString().replace(/[:.]/g, '-');
|
|
220
|
-
if (prefix) {
|
|
221
|
-
return `${prefix} (${timestamp})`;
|
|
222
|
-
}
|
|
223
|
-
return timestamp;
|
|
224
|
-
}
|
|
225
|
-
/**
|
|
226
|
-
* Deploy changes to LIVE version
|
|
227
|
-
* Creates a draft → applies changes → publishes to LIVE
|
|
228
|
-
*/
|
|
229
|
-
async function deployToLive(changes, versionName) {
|
|
230
|
-
const name = versionName || formatSFTimestamp();
|
|
231
|
-
logger.info(`Creating draft: ${name}`);
|
|
232
|
-
const version = await createVersion(name);
|
|
203
|
+
async function deployToLive(changes, _versionName) {
|
|
233
204
|
const added = [];
|
|
234
205
|
const modified = [];
|
|
235
206
|
const deleted = [];
|
|
236
|
-
//
|
|
207
|
+
// Process each change directly to LIVE with force=true
|
|
237
208
|
for (const change of changes) {
|
|
238
|
-
logger.
|
|
209
|
+
logger.info(`Deploying ${change.status}: ${change.path}`);
|
|
239
210
|
if (change.status === 'deleted') {
|
|
240
211
|
try {
|
|
241
|
-
await deleteDocument(
|
|
212
|
+
await deleteDocument('live', change.path);
|
|
242
213
|
deleted.push(change.path);
|
|
214
|
+
logger.debug(`Deleted: ${change.path}`);
|
|
243
215
|
}
|
|
244
216
|
catch (error) {
|
|
245
217
|
// Document might not exist, log and continue
|
|
@@ -247,20 +219,22 @@ async function deployToLive(changes, versionName) {
|
|
|
247
219
|
}
|
|
248
220
|
}
|
|
249
221
|
else {
|
|
250
|
-
|
|
222
|
+
// Use force=true to push directly to LIVE
|
|
223
|
+
await createOrUpdateDocument('live', change.path, change.content, true);
|
|
251
224
|
if (change.status === 'added') {
|
|
252
225
|
added.push(change.path);
|
|
253
226
|
}
|
|
254
227
|
else {
|
|
255
228
|
modified.push(change.path);
|
|
256
229
|
}
|
|
230
|
+
logger.debug(`${change.status}: ${change.path}`);
|
|
257
231
|
}
|
|
258
232
|
}
|
|
259
|
-
|
|
260
|
-
const
|
|
261
|
-
|
|
233
|
+
// Get current LIVE version info
|
|
234
|
+
const docs = await listDocuments('live');
|
|
235
|
+
const liveVersionUuid = docs.length > 0 ? docs[0].versionUuid : 'live';
|
|
262
236
|
return {
|
|
263
|
-
version:
|
|
237
|
+
version: { uuid: liveVersionUuid },
|
|
264
238
|
documentsProcessed: changes.length,
|
|
265
239
|
added,
|
|
266
240
|
modified,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "latitude-mcp-server",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.7",
|
|
4
4
|
"description": "Simplified MCP server for Latitude.so prompt management - 8 focused tools for push, pull, run, and manage prompts",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|