@epiccontext/mcp 0.1.55 → 0.1.57
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 +27 -1
- package/dist/api/client.d.ts.map +1 -1
- package/dist/api/client.js +102 -0
- package/dist/api/client.js.map +1 -1
- package/dist/cli/commands/add-app.d.ts +9 -0
- package/dist/cli/commands/add-app.d.ts.map +1 -0
- package/dist/cli/commands/add-app.js +111 -0
- package/dist/cli/commands/add-app.js.map +1 -0
- package/dist/cli/commands/init.d.ts.map +1 -1
- package/dist/cli/commands/init.js +37 -16
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/pull.d.ts +2 -0
- package/dist/cli/commands/pull.d.ts.map +1 -1
- package/dist/cli/commands/pull.js +122 -67
- package/dist/cli/commands/pull.js.map +1 -1
- package/dist/cli/commands/push.d.ts +2 -0
- package/dist/cli/commands/push.d.ts.map +1 -1
- package/dist/cli/commands/push.js +130 -75
- package/dist/cli/commands/push.js.map +1 -1
- package/dist/cli/commands/serve.d.ts.map +1 -1
- package/dist/cli/commands/serve.js +2 -1
- package/dist/cli/commands/serve.js.map +1 -1
- package/dist/cli/commands/status.d.ts.map +1 -1
- package/dist/cli/commands/status.js +21 -3
- package/dist/cli/commands/status.js.map +1 -1
- package/dist/cli/commands/validate.d.ts.map +1 -1
- package/dist/cli/commands/validate.js +6 -5
- package/dist/cli/commands/validate.js.map +1 -1
- package/dist/cli/config.d.ts +4 -0
- package/dist/cli/config.d.ts.map +1 -1
- package/dist/cli/config.js +20 -0
- package/dist/cli/config.js.map +1 -1
- package/dist/cli/files.d.ts +9 -1
- package/dist/cli/files.d.ts.map +1 -1
- package/dist/cli/files.js +147 -31
- package/dist/cli/files.js.map +1 -1
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +12 -0
- package/dist/cli/index.js.map +1 -1
- package/dist/mcp/server.d.ts +1 -0
- package/dist/mcp/server.d.ts.map +1 -1
- package/dist/mcp/server.js +12 -0
- package/dist/mcp/server.js.map +1 -1
- package/dist/mcp/tools/list-documents.d.ts +10 -0
- package/dist/mcp/tools/list-documents.d.ts.map +1 -0
- package/dist/mcp/tools/list-documents.js +86 -0
- package/dist/mcp/tools/list-documents.js.map +1 -0
- package/dist/mcp/tools/read-document.d.ts +10 -0
- package/dist/mcp/tools/read-document.d.ts.map +1 -0
- package/dist/mcp/tools/read-document.js +119 -0
- package/dist/mcp/tools/read-document.js.map +1 -0
- package/dist/mcp/tools/sync-all.d.ts.map +1 -1
- package/dist/mcp/tools/sync-all.js +9 -0
- package/dist/mcp/tools/sync-all.js.map +1 -1
- package/dist/mcp/tools/sync-documents.d.ts +10 -0
- package/dist/mcp/tools/sync-documents.d.ts.map +1 -0
- package/dist/mcp/tools/sync-documents.js +89 -0
- package/dist/mcp/tools/sync-documents.js.map +1 -0
- package/dist/mcp/tools/sync-from-app.d.ts.map +1 -1
- package/dist/mcp/tools/sync-from-app.js +6 -0
- package/dist/mcp/tools/sync-from-app.js.map +1 -1
- package/dist/mcp/tools/sync-to-app.d.ts.map +1 -1
- package/dist/mcp/tools/sync-to-app.js +6 -0
- package/dist/mcp/tools/sync-to-app.js.map +1 -1
- package/dist/skills/generator.d.ts.map +1 -1
- package/dist/skills/generator.js +98 -5
- package/dist/skills/generator.js.map +1 -1
- package/dist/sync/deletions.d.ts +31 -0
- package/dist/sync/deletions.d.ts.map +1 -0
- package/dist/sync/deletions.js +110 -0
- package/dist/sync/deletions.js.map +1 -0
- package/dist/sync/document-files.d.ts +31 -0
- package/dist/sync/document-files.d.ts.map +1 -0
- package/dist/sync/document-files.js +98 -0
- package/dist/sync/document-files.js.map +1 -0
- package/dist/sync/document-manifest.d.ts +22 -0
- package/dist/sync/document-manifest.d.ts.map +1 -0
- package/dist/sync/document-manifest.js +55 -0
- package/dist/sync/document-manifest.js.map +1 -0
- package/dist/sync/document-pull.d.ts +16 -0
- package/dist/sync/document-pull.d.ts.map +1 -0
- package/dist/sync/document-pull.js +149 -0
- package/dist/sync/document-pull.js.map +1 -0
- package/dist/sync/document-push.d.ts +14 -0
- package/dist/sync/document-push.d.ts.map +1 -0
- package/dist/sync/document-push.js +107 -0
- package/dist/sync/document-push.js.map +1 -0
- package/dist/sync/pull.d.ts +4 -0
- package/dist/sync/pull.d.ts.map +1 -1
- package/dist/sync/pull.js +91 -0
- package/dist/sync/pull.js.map +1 -1
- package/dist/sync/push.d.ts +4 -0
- package/dist/sync/push.d.ts.map +1 -1
- package/dist/sync/push.js +44 -1
- package/dist/sync/push.js.map +1 -1
- package/dist/sync/watcher.d.ts.map +1 -1
- package/dist/sync/watcher.js +25 -5
- package/dist/sync/watcher.js.map +1 -1
- package/dist/types/index.d.ts +127 -0
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import chalk from "chalk";
|
|
2
2
|
import ora from "ora";
|
|
3
|
-
import { loadConfig, getContextPath, getProjectRoot } from "../config.js";
|
|
3
|
+
import { loadConfig, getContextPath, getDocumentsPath, getProjectRoot } from "../config.js";
|
|
4
4
|
import { createClient } from "../../api/client.js";
|
|
5
5
|
import { pullFromCloud } from "../../sync/pull.js";
|
|
6
|
+
import { pullDocuments } from "../../sync/document-pull.js";
|
|
6
7
|
import { generateAndWriteSkills } from "../../skills/generator.js";
|
|
7
8
|
export async function pullCommand(options) {
|
|
8
9
|
const config = loadConfig();
|
|
@@ -32,86 +33,140 @@ export async function pullCommand(options) {
|
|
|
32
33
|
apiKey: config.auth.apiKey,
|
|
33
34
|
projectId: config.project.id,
|
|
34
35
|
});
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
console.log(
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
if (result.filesDeleted > 0 && result.deletedPaths.length > 0) {
|
|
49
|
-
console.log(chalk.red(` Deleted: ${result.filesDeleted} orphan file(s)`));
|
|
50
|
-
// Show a few examples
|
|
51
|
-
const deletedExamples = result.deletedPaths.slice(0, 5);
|
|
52
|
-
for (const deletedPath of deletedExamples) {
|
|
53
|
-
console.log(chalk.red(` - ${deletedPath}`));
|
|
36
|
+
// Pull context (unless --documents-only)
|
|
37
|
+
if (!options.documentsOnly) {
|
|
38
|
+
const spinner = ora("Pulling context from EpicContext...").start();
|
|
39
|
+
try {
|
|
40
|
+
const result = await pullFromCloud(client, contextPath, {
|
|
41
|
+
section: options.section,
|
|
42
|
+
force: options.force,
|
|
43
|
+
deleteOrphans: options.deleteOrphans,
|
|
44
|
+
});
|
|
45
|
+
spinner.succeed("Context pull complete!");
|
|
46
|
+
console.log("");
|
|
47
|
+
if (result.filesWritten > 0) {
|
|
48
|
+
console.log(chalk.green(` ${result.filesWritten} file(s) written`));
|
|
54
49
|
}
|
|
55
|
-
|
|
56
|
-
|
|
50
|
+
// Show deleted files (orphans removed)
|
|
51
|
+
if (result.filesDeleted > 0 && result.deletedPaths.length > 0) {
|
|
52
|
+
console.log(chalk.red(` Deleted: ${result.filesDeleted} orphan file(s)`));
|
|
53
|
+
// Show a few examples
|
|
54
|
+
const deletedExamples = result.deletedPaths.slice(0, 5);
|
|
55
|
+
for (const deletedPath of deletedExamples) {
|
|
56
|
+
console.log(chalk.red(` - ${deletedPath}`));
|
|
57
|
+
}
|
|
58
|
+
if (result.deletedPaths.length > 5) {
|
|
59
|
+
console.log(chalk.red(` ... and ${result.deletedPaths.length - 5} more`));
|
|
60
|
+
}
|
|
57
61
|
}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
62
|
+
// Show files deleted via deletion manifest
|
|
63
|
+
if (result.filesDeletedByManifest && result.filesDeletedByManifest > 0) {
|
|
64
|
+
console.log(chalk.yellow(` Deleted via deletion manifest: ${result.filesDeletedByManifest} file(s)`));
|
|
65
|
+
const manifestExamples = (result.deletedByManifestPaths || []).slice(0, 5);
|
|
66
|
+
for (const deletedPath of manifestExamples) {
|
|
67
|
+
console.log(chalk.yellow(` - ${deletedPath}`));
|
|
68
|
+
}
|
|
69
|
+
if ((result.deletedByManifestPaths || []).length > 5) {
|
|
70
|
+
console.log(chalk.yellow(` ... and ${(result.deletedByManifestPaths || []).length - 5} more`));
|
|
71
|
+
}
|
|
66
72
|
}
|
|
67
|
-
|
|
68
|
-
|
|
73
|
+
// Show skipped files with explanation (local files that are newer)
|
|
74
|
+
if (result.filesSkipped > 0 && result.skippedPaths.length > 0) {
|
|
75
|
+
console.log(chalk.gray(` Skipped: ${result.filesSkipped} file(s) - local version is newer`));
|
|
76
|
+
// Show a few examples
|
|
77
|
+
const examples = result.skippedPaths.slice(0, 3);
|
|
78
|
+
for (const skippedPath of examples) {
|
|
79
|
+
console.log(chalk.gray(` - ${skippedPath}`));
|
|
80
|
+
}
|
|
81
|
+
if (result.skippedPaths.length > 3) {
|
|
82
|
+
console.log(chalk.gray(` ... and ${result.skippedPaths.length - 3} more`));
|
|
83
|
+
}
|
|
84
|
+
console.log("");
|
|
85
|
+
console.log(chalk.gray(` Tip: Use ${chalk.cyan("--force")} to overwrite local with cloud versions`));
|
|
86
|
+
}
|
|
87
|
+
else if (result.filesSkipped > 0) {
|
|
88
|
+
console.log(chalk.yellow(` ${result.filesSkipped} file(s) skipped`));
|
|
89
|
+
}
|
|
90
|
+
if (result.filesWritten === 0 && result.filesSkipped === 0 && result.filesDeleted === 0 && (!result.filesDeletedByManifest || result.filesDeletedByManifest === 0)) {
|
|
91
|
+
console.log(chalk.gray(" No changes (local folder is in sync)"));
|
|
92
|
+
}
|
|
93
|
+
// Generate skills if --with-skills flag is set
|
|
94
|
+
if (options.withSkills) {
|
|
95
|
+
console.log("");
|
|
96
|
+
const skillSpinner = ora("Generating Claude Code skills...").start();
|
|
97
|
+
try {
|
|
98
|
+
const projectRoot = getProjectRoot();
|
|
99
|
+
if (!projectRoot) {
|
|
100
|
+
skillSpinner.warn("Could not determine project root for skills generation");
|
|
101
|
+
}
|
|
102
|
+
else {
|
|
103
|
+
const skillResult = generateAndWriteSkills(projectRoot);
|
|
104
|
+
if (skillResult.errors.length > 0) {
|
|
105
|
+
skillSpinner.warn(`Skills generated with ${skillResult.errors.length} error(s)`);
|
|
106
|
+
for (const error of skillResult.errors.slice(0, 3)) {
|
|
107
|
+
console.log(chalk.yellow(` - ${error}`));
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
else {
|
|
111
|
+
skillSpinner.succeed(`Generated ${skillResult.written} skill file(s)`);
|
|
112
|
+
}
|
|
113
|
+
console.log(chalk.gray(` Skills installed to .claude/skills/`));
|
|
114
|
+
console.log(chalk.gray(` Master command: /context [action] [section] [target]`));
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
catch (skillError) {
|
|
118
|
+
skillSpinner.fail("Skills generation failed");
|
|
119
|
+
console.error(chalk.yellow(" Warning:"), skillError.message);
|
|
120
|
+
}
|
|
69
121
|
}
|
|
70
|
-
console.log("");
|
|
71
|
-
console.log(chalk.gray(` Tip: Use ${chalk.cyan("--force")} to overwrite local with cloud versions`));
|
|
72
122
|
}
|
|
73
|
-
|
|
74
|
-
console.
|
|
123
|
+
catch (error) {
|
|
124
|
+
console.error(chalk.red("Context pull failed:"), error.message);
|
|
125
|
+
if (!options.withDocuments) {
|
|
126
|
+
process.exit(1);
|
|
127
|
+
}
|
|
75
128
|
}
|
|
76
|
-
|
|
77
|
-
|
|
129
|
+
}
|
|
130
|
+
// Pull documents (if --with-documents or --documents-only)
|
|
131
|
+
if (options.withDocuments || options.documentsOnly) {
|
|
132
|
+
const documentsPath = getDocumentsPath();
|
|
133
|
+
if (!documentsPath) {
|
|
134
|
+
console.log(chalk.yellow(" DOCUMENTS path not configured. Skipping document pull."));
|
|
78
135
|
}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
console.log("");
|
|
82
|
-
const skillSpinner = ora("Generating Claude Code skills...").start();
|
|
136
|
+
else {
|
|
137
|
+
const docSpinner = ora("Pulling documents from EpicContext...").start();
|
|
83
138
|
try {
|
|
84
|
-
const
|
|
85
|
-
|
|
86
|
-
|
|
139
|
+
const docResult = await pullDocuments(client, documentsPath, {
|
|
140
|
+
force: options.force,
|
|
141
|
+
maxFileSize: config.documents?.maxFileSize,
|
|
142
|
+
});
|
|
143
|
+
docSpinner.succeed("Document pull complete!");
|
|
144
|
+
console.log("");
|
|
145
|
+
if (docResult.downloaded > 0) {
|
|
146
|
+
console.log(chalk.green(` ${docResult.downloaded} document(s) downloaded`));
|
|
87
147
|
}
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
|
|
148
|
+
if (docResult.skipped > 0) {
|
|
149
|
+
console.log(chalk.gray(` ${docResult.skipped} document(s) skipped (already up to date)`));
|
|
150
|
+
}
|
|
151
|
+
if (docResult.deleted > 0) {
|
|
152
|
+
console.log(chalk.yellow(` ${docResult.deleted} document(s) removed (deleted in cloud)`));
|
|
153
|
+
}
|
|
154
|
+
if (docResult.errors.length > 0) {
|
|
155
|
+
console.log(chalk.red(` ${docResult.errors.length} error(s):`));
|
|
156
|
+
for (const err of docResult.errors.slice(0, 3)) {
|
|
157
|
+
console.log(chalk.red(` - ${err.path}: ${err.error}`));
|
|
98
158
|
}
|
|
99
|
-
|
|
100
|
-
|
|
159
|
+
}
|
|
160
|
+
if (docResult.downloaded === 0 && docResult.skipped === 0 && docResult.deleted === 0) {
|
|
161
|
+
console.log(chalk.gray(" No document changes"));
|
|
101
162
|
}
|
|
102
163
|
}
|
|
103
|
-
catch (
|
|
104
|
-
|
|
105
|
-
console.error(chalk.
|
|
106
|
-
// Don't exit - skills are optional, pull succeeded
|
|
164
|
+
catch (error) {
|
|
165
|
+
docSpinner.fail("Document pull failed");
|
|
166
|
+
console.error(chalk.red("Error:"), error.message);
|
|
107
167
|
}
|
|
108
168
|
}
|
|
109
|
-
console.log("");
|
|
110
|
-
}
|
|
111
|
-
catch (error) {
|
|
112
|
-
spinner.fail("Pull failed");
|
|
113
|
-
console.error(chalk.red("Error:"), error.message);
|
|
114
|
-
process.exit(1);
|
|
115
169
|
}
|
|
170
|
+
console.log("");
|
|
116
171
|
}
|
|
117
172
|
//# sourceMappingURL=pull.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pull.js","sourceRoot":"","sources":["../../../src/cli/commands/pull.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,GAAG,MAAM,KAAK,CAAC;AAEtB,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"pull.js","sourceRoot":"","sources":["../../../src/cli/commands/pull.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,GAAG,MAAM,KAAK,CAAC;AAEtB,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC5F,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AAWnE,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,OAAoB;IACpD,MAAM,MAAM,GAAG,UAAU,EAAE,CAAC;IAE5B,IAAI,CAAC,MAAM,EAAE,OAAO,EAAE,EAAE,IAAI,CAAC,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;QAClD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,uCAA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CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;oBAC5D,CAAC;gBACH,CAAC;gBACD,IAAI,SAAS,CAAC,UAAU,KAAK,CAAC,IAAI,SAAS,CAAC,OAAO,KAAK,CAAC,IAAI,SAAS,CAAC,OAAO,KAAK,CAAC,EAAE,CAAC;oBACrF,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,uBAAuB,CAAC,CAAC,CAAC;gBACnD,CAAC;YACH,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,UAAU,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC;gBACxC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAG,KAAe,CAAC,OAAO,CAAC,CAAC;YAC/D,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;AAClB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"push.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/push.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"push.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/push.ts"],"names":[],"mappings":"AAQA,MAAM,WAAW,WAAW;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED,wBAAsB,WAAW,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAyMrE"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import chalk from "chalk";
|
|
2
2
|
import ora from "ora";
|
|
3
|
-
import { loadConfig, getContextPath } from "../config.js";
|
|
3
|
+
import { loadConfig, getContextPath, getDocumentsPath } from "../config.js";
|
|
4
4
|
import { createClient } from "../../api/client.js";
|
|
5
5
|
import { pushToCloud } from "../../sync/push.js";
|
|
6
|
+
import { pushDocuments } from "../../sync/document-push.js";
|
|
6
7
|
import { runQuickValidation } from "./validate.js";
|
|
7
8
|
export async function pushCommand(options) {
|
|
8
9
|
const config = loadConfig();
|
|
@@ -46,89 +47,143 @@ export async function pushCommand(options) {
|
|
|
46
47
|
apiKey: config.auth.apiKey,
|
|
47
48
|
projectId: config.project.id,
|
|
48
49
|
});
|
|
49
|
-
//
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
if (validation.errors > 0) {
|
|
53
|
-
console.log(chalk.yellow(`\n⚠️ Pre-push validation found ${validation.errors} error(s) and ${validation.warnings} warning(s).`));
|
|
54
|
-
console.log(chalk.gray(` Run ${chalk.cyan("npx @epicontext/mcp validate")} to see details.\n`));
|
|
55
|
-
}
|
|
56
|
-
else {
|
|
57
|
-
console.log(chalk.gray(`\n ℹ Pre-push check: ${validation.warnings} warning(s). Run ${chalk.cyan("npx @epicontext/mcp validate")} for details.\n`));
|
|
58
|
-
}
|
|
50
|
+
// Skip context push if --documents-only
|
|
51
|
+
if (options.documentsOnly) {
|
|
52
|
+
// Jump straight to document push below
|
|
59
53
|
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
});
|
|
72
|
-
if (isDryRun) {
|
|
73
|
-
spinner.succeed("Dry run complete - no changes were made");
|
|
74
|
-
console.log("");
|
|
75
|
-
console.log(chalk.cyan(" The following changes would be made:\n"));
|
|
54
|
+
else {
|
|
55
|
+
// Run quick validation before pushing
|
|
56
|
+
const validation = runQuickValidation(contextPath);
|
|
57
|
+
if (validation.errors > 0 || validation.warnings > 0) {
|
|
58
|
+
if (validation.errors > 0) {
|
|
59
|
+
console.log(chalk.yellow(`\n⚠️ Pre-push validation found ${validation.errors} error(s) and ${validation.warnings} warning(s).`));
|
|
60
|
+
console.log(chalk.gray(` Run ${chalk.cyan("npx @epicontext/mcp validate")} to see details.\n`));
|
|
61
|
+
}
|
|
62
|
+
else {
|
|
63
|
+
console.log(chalk.gray(`\n ℹ Pre-push check: ${validation.warnings} warning(s). Run ${chalk.cyan("npx @epicontext/mcp validate")} for details.\n`));
|
|
64
|
+
}
|
|
76
65
|
}
|
|
77
|
-
|
|
78
|
-
|
|
66
|
+
const isDryRun = options.dryRun ?? false;
|
|
67
|
+
const spinnerText = isDryRun
|
|
68
|
+
? "Checking what would be pushed..."
|
|
69
|
+
: "Pushing to EpicContext...";
|
|
70
|
+
const spinner = ora(spinnerText).start();
|
|
71
|
+
try {
|
|
72
|
+
// Default to folder_wins for push - user is explicitly sending local changes to cloud
|
|
73
|
+
const result = await pushToCloud(client, contextPath, {
|
|
74
|
+
path: options.section,
|
|
75
|
+
conflictResolution: "folder_wins",
|
|
76
|
+
dryRun: isDryRun,
|
|
77
|
+
});
|
|
78
|
+
if (isDryRun) {
|
|
79
|
+
spinner.succeed("Dry run complete - no changes were made");
|
|
80
|
+
console.log("");
|
|
81
|
+
console.log(chalk.cyan(" The following changes would be made:\n"));
|
|
82
|
+
}
|
|
83
|
+
else {
|
|
84
|
+
spinner.succeed("Push complete!");
|
|
85
|
+
console.log("");
|
|
86
|
+
}
|
|
87
|
+
console.log(chalk.gray(` Files processed: ${result.filesProcessed}`));
|
|
88
|
+
if (result.result.created > 0) {
|
|
89
|
+
const verb = isDryRun ? "Would create" : "Created";
|
|
90
|
+
console.log(chalk.green(` ${verb}: ${result.result.created} block(s)`));
|
|
91
|
+
}
|
|
92
|
+
if (result.result.updated > 0) {
|
|
93
|
+
const verb = isDryRun ? "Would update" : "Updated";
|
|
94
|
+
console.log(chalk.blue(` ${verb}: ${result.result.updated} block(s)`));
|
|
95
|
+
}
|
|
96
|
+
// Show deleted orphan blocks
|
|
97
|
+
if (result.result.deleted && result.result.deleted > 0) {
|
|
98
|
+
const verb = isDryRun ? "Would delete" : "Deleted";
|
|
99
|
+
console.log(chalk.yellow(` ${verb}: ${result.result.deleted} orphan block(s)`));
|
|
100
|
+
}
|
|
101
|
+
// Show deletion manifest activity
|
|
102
|
+
if (result.archivedByManifest && result.archivedByManifest > 0) {
|
|
103
|
+
console.log(chalk.yellow(` Archived via deletion manifest: ${result.archivedByManifest} block(s)`));
|
|
104
|
+
}
|
|
105
|
+
if (result.autoDetectedDeletions && result.autoDetectedDeletions > 0) {
|
|
106
|
+
console.log(chalk.yellow(` Auto-detected local deletions: ${result.autoDetectedDeletions} block(s)`));
|
|
107
|
+
}
|
|
108
|
+
// Show skipped files (should be rare with folder_wins, but can happen with parse errors)
|
|
109
|
+
if (result.result.skipped > 0) {
|
|
110
|
+
const verb = isDryRun ? "Would skip" : "Skipped";
|
|
111
|
+
console.log(chalk.gray(` ${verb}: ${result.result.skipped} file(s)`));
|
|
112
|
+
}
|
|
113
|
+
if (result.result.errors.length > 0) {
|
|
114
|
+
console.log(chalk.red(` Errors: ${result.result.errors.length}`));
|
|
115
|
+
for (const error of result.result.errors) {
|
|
116
|
+
console.log(chalk.red(` - ${error.path}: ${error.error}`));
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
// IMPORTANT: Show warning about potential orphans (blocks in cloud not in local folder)
|
|
120
|
+
const potentialOrphans = result.result.potentialOrphans;
|
|
121
|
+
if (potentialOrphans && potentialOrphans.length > 0) {
|
|
122
|
+
console.log("");
|
|
123
|
+
console.log(chalk.yellow(` ⚠️ ${potentialOrphans.length} block(s) exist in cloud but not in your local CONTEXT folder:`));
|
|
124
|
+
// Show first 5 orphans as examples
|
|
125
|
+
const displayOrphans = potentialOrphans.slice(0, 5);
|
|
126
|
+
for (const orphan of displayOrphans) {
|
|
127
|
+
console.log(chalk.yellow(` - ${orphan.sectionType}/${orphan.key}${orphan.name ? ` (${orphan.name})` : ""}`));
|
|
128
|
+
}
|
|
129
|
+
if (potentialOrphans.length > 5) {
|
|
130
|
+
console.log(chalk.yellow(` ... and ${potentialOrphans.length - 5} more`));
|
|
131
|
+
}
|
|
132
|
+
console.log("");
|
|
133
|
+
console.log(chalk.gray(" These blocks were NOT deleted. They may have been created by team members."));
|
|
134
|
+
console.log(chalk.gray(` Run ${chalk.cyan("npx @epiccontext/mcp pull")} first to get the latest blocks.`));
|
|
135
|
+
}
|
|
79
136
|
console.log("");
|
|
137
|
+
if (isDryRun && (result.result.created > 0 || result.result.updated > 0 || (result.result.deleted && result.result.deleted > 0))) {
|
|
138
|
+
console.log(chalk.gray(`Run ${chalk.cyan("npx @epicontext/mcp push")} (without --dry-run) to apply these changes.`));
|
|
139
|
+
}
|
|
80
140
|
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
if (result.result.updated > 0) {
|
|
87
|
-
const verb = isDryRun ? "Would update" : "Updated";
|
|
88
|
-
console.log(chalk.blue(` ${verb}: ${result.result.updated} block(s)`));
|
|
89
|
-
}
|
|
90
|
-
// Show deleted orphan blocks
|
|
91
|
-
if (result.result.deleted && result.result.deleted > 0) {
|
|
92
|
-
const verb = isDryRun ? "Would delete" : "Deleted";
|
|
93
|
-
console.log(chalk.yellow(` ${verb}: ${result.result.deleted} orphan block(s)`));
|
|
94
|
-
}
|
|
95
|
-
// Show skipped files (should be rare with folder_wins, but can happen with parse errors)
|
|
96
|
-
if (result.result.skipped > 0) {
|
|
97
|
-
const verb = isDryRun ? "Would skip" : "Skipped";
|
|
98
|
-
console.log(chalk.gray(` ${verb}: ${result.result.skipped} file(s)`));
|
|
99
|
-
}
|
|
100
|
-
if (result.result.errors.length > 0) {
|
|
101
|
-
console.log(chalk.red(` Errors: ${result.result.errors.length}`));
|
|
102
|
-
for (const error of result.result.errors) {
|
|
103
|
-
console.log(chalk.red(` - ${error.path}: ${error.error}`));
|
|
141
|
+
catch (error) {
|
|
142
|
+
spinner.fail(isDryRun ? "Dry run failed" : "Push failed");
|
|
143
|
+
console.error(chalk.red("Error:"), error.message);
|
|
144
|
+
if (!options.withDocuments) {
|
|
145
|
+
process.exit(1);
|
|
104
146
|
}
|
|
105
147
|
}
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
148
|
+
} // end of !documentsOnly block
|
|
149
|
+
// Push documents (if --with-documents or --documents-only)
|
|
150
|
+
if (options.withDocuments || options.documentsOnly) {
|
|
151
|
+
const documentsPath = getDocumentsPath();
|
|
152
|
+
if (!documentsPath) {
|
|
153
|
+
console.log(chalk.yellow(" DOCUMENTS path not configured. Skipping document push."));
|
|
154
|
+
}
|
|
155
|
+
else {
|
|
156
|
+
const isDryRun = options.dryRun ?? false;
|
|
157
|
+
const docSpinner = ora(isDryRun ? "Checking documents to push..." : "Pushing documents to EpicContext...").start();
|
|
158
|
+
try {
|
|
159
|
+
const docResult = await pushDocuments(client, documentsPath, {
|
|
160
|
+
dryRun: isDryRun,
|
|
161
|
+
});
|
|
162
|
+
docSpinner.succeed(isDryRun ? "Document dry run complete" : "Document push complete!");
|
|
163
|
+
console.log("");
|
|
164
|
+
if (docResult.uploaded > 0) {
|
|
165
|
+
const verb = isDryRun ? "Would upload" : "Uploaded";
|
|
166
|
+
console.log(chalk.green(` ${verb}: ${docResult.uploaded} document(s)`));
|
|
167
|
+
}
|
|
168
|
+
if (docResult.skipped > 0) {
|
|
169
|
+
console.log(chalk.gray(` Skipped: ${docResult.skipped} document(s) (already up to date)`));
|
|
170
|
+
}
|
|
171
|
+
if (docResult.errors.length > 0) {
|
|
172
|
+
console.log(chalk.red(` ${docResult.errors.length} error(s):`));
|
|
173
|
+
for (const err of docResult.errors.slice(0, 3)) {
|
|
174
|
+
console.log(chalk.red(` - ${err.path}: ${err.error}`));
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
if (docResult.uploaded === 0 && docResult.skipped === 0) {
|
|
178
|
+
console.log(chalk.gray(" No document changes"));
|
|
179
|
+
}
|
|
115
180
|
}
|
|
116
|
-
|
|
117
|
-
|
|
181
|
+
catch (error) {
|
|
182
|
+
docSpinner.fail("Document push failed");
|
|
183
|
+
console.error(chalk.red("Error:"), error.message);
|
|
118
184
|
}
|
|
119
|
-
console.log("");
|
|
120
|
-
console.log(chalk.gray(" These blocks were NOT deleted. They may have been created by team members."));
|
|
121
|
-
console.log(chalk.gray(` Run ${chalk.cyan("npx @epiccontext/mcp pull")} first to get the latest blocks.`));
|
|
122
|
-
}
|
|
123
|
-
console.log("");
|
|
124
|
-
if (isDryRun && (result.result.created > 0 || result.result.updated > 0 || (result.result.deleted && result.result.deleted > 0))) {
|
|
125
|
-
console.log(chalk.gray(`Run ${chalk.cyan("npx @epicontext/mcp push")} (without --dry-run) to apply these changes.`));
|
|
126
185
|
}
|
|
127
186
|
}
|
|
128
|
-
|
|
129
|
-
spinner.fail(isDryRun ? "Dry run failed" : "Push failed");
|
|
130
|
-
console.error(chalk.red("Error:"), error.message);
|
|
131
|
-
process.exit(1);
|
|
132
|
-
}
|
|
187
|
+
console.log("");
|
|
133
188
|
}
|
|
134
189
|
//# sourceMappingURL=push.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"push.js","sourceRoot":"","sources":["../../../src/cli/commands/push.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,GAAG,MAAM,KAAK,CAAC;AACtB,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"push.js","sourceRoot":"","sources":["../../../src/cli/commands/push.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,GAAG,MAAM,KAAK,CAAC;AACtB,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAC5E,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,WA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"AAKA,MAAM,WAAW,YAAY;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAsB,YAAY,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"serve.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/serve.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,YAAY;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAsB,YAAY,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAoDvE"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import chalk from "chalk";
|
|
2
|
-
import { loadConfig, getContextPath } from "../config.js";
|
|
2
|
+
import { loadConfig, getContextPath, getDocumentsPath } from "../config.js";
|
|
3
3
|
import { createClient } from "../../api/client.js";
|
|
4
4
|
import { startMcpServer } from "../../mcp/server.js";
|
|
5
5
|
export async function serveCommand(options) {
|
|
@@ -42,6 +42,7 @@ export async function serveCommand(options) {
|
|
|
42
42
|
await startMcpServer({
|
|
43
43
|
client,
|
|
44
44
|
contextPath: contextPath || "./CONTEXT",
|
|
45
|
+
documentsPath: getDocumentsPath() || undefined,
|
|
45
46
|
config: config || { version: 1 },
|
|
46
47
|
isConfigured: !!isConfigured,
|
|
47
48
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serve.js","sourceRoot":"","sources":["../../../src/cli/commands/serve.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"serve.js","sourceRoot":"","sources":["../../../src/cli/commands/serve.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,cAAc,CA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E,CAAC,CAAC;QAC9D,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IACpB,CAAC;SAAM,CAAC;QACN,+CAA+C;QAC/C,0DAA0D;QAC1D,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,2CAA2C,CAAC,CAAC,CAAC;QACzE,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,6DAA6D,CAAC,CAAC,CAAC;QAC3F,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IACpB,CAAC;IAED,IAAI,CAAC;QACH,MAAM,cAAc,CAAC;YACnB,MAAM;YACN,WAAW,EAAE,WAAW,IAAI,WAAW;YACvC,aAAa,EAAE,gBAAgB,EAAE,IAAI,SAAS;YAC9C,MAAM,EAAE,MAAM,IAAI,EAAE,OAAO,EAAE,CAAC,EAAE;YAChC,YAAY,EAAE,CAAC,CAAC,YAAY;SAC7B,CAAC,CAAC;IACL,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,mBAAmB,CAAC,EAAG,KAAe,CAAC,OAAO,CAAC,CAAC;QACxE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/status.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/status.ts"],"names":[],"mappings":"AASA,wBAAsB,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC,CAiGnD"}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
import * as fs from "fs";
|
|
1
2
|
import chalk from "chalk";
|
|
2
3
|
import ora from "ora";
|
|
3
|
-
import { loadConfig, getProjectRoot, getContextPath } from "../config.js";
|
|
4
|
+
import { loadConfig, getProjectRoot, getContextPath, getDocumentsPath } from "../config.js";
|
|
4
5
|
import { createClient } from "../../api/client.js";
|
|
5
6
|
import { readContextFolder } from "../files.js";
|
|
7
|
+
import { readDocumentManifest } from "../../sync/document-manifest.js";
|
|
6
8
|
export async function statusCommand() {
|
|
7
9
|
const config = loadConfig();
|
|
8
10
|
if (!config?.project?.id || !config?.auth?.apiKey) {
|
|
@@ -46,8 +48,24 @@ export async function statusCommand() {
|
|
|
46
48
|
console.log("");
|
|
47
49
|
// Local folder info
|
|
48
50
|
console.log(chalk.gray("Local:"));
|
|
49
|
-
console.log(`
|
|
50
|
-
|
|
51
|
+
console.log(` CONTEXT: ${config.sync.path} (${localFiles.length} files)`);
|
|
52
|
+
// Documents info
|
|
53
|
+
const documentsPath = getDocumentsPath();
|
|
54
|
+
if (documentsPath && fs.existsSync(documentsPath)) {
|
|
55
|
+
const manifest = readDocumentManifest(documentsPath);
|
|
56
|
+
console.log(` DOCUMENTS: ${config.sync.documentsPath || "./DOCUMENTS"} (${manifest.entries.length} files)`);
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
console.log(` DOCUMENTS: ${chalk.dim("not set up")}`);
|
|
60
|
+
}
|
|
61
|
+
// Apps info
|
|
62
|
+
const apps = config.apps || [];
|
|
63
|
+
if (apps.length > 0) {
|
|
64
|
+
console.log(` Apps: ${apps.length} registered (${apps.map(a => a.name).join(", ")})`);
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
67
|
+
console.log(` Apps: ${chalk.dim("none registered")}`);
|
|
68
|
+
}
|
|
51
69
|
console.log("");
|
|
52
70
|
// Sync settings
|
|
53
71
|
console.log(chalk.gray("Sync Settings:"));
|