@contentrain/mcp 3.9.33 → 3.10.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/README.md +18 -1
- package/dist/{apply-manager-BenQNb_b.mjs → apply-manager-B-O3eAbz.mjs} +16 -8
- package/dist/apply-manager-B-O3eAbz.mjs.map +1 -0
- package/dist/{branch-lifecycle-CirYfTXu.d.mts → branch-lifecycle-4iZax7a7.d.mts} +3 -3
- package/dist/{branch-lifecycle-CirYfTXu.d.mts.map → branch-lifecycle-4iZax7a7.d.mts.map} +1 -1
- package/dist/{branch-lifecycle-CcsSyfSw.mjs → branch-lifecycle-D4DxPgQg.mjs} +53 -5
- package/dist/branch-lifecycle-D4DxPgQg.mjs.map +1 -0
- package/dist/{config-BLwZtwlI.mjs → config-BnNYu128.mjs} +3 -2
- package/dist/config-BnNYu128.mjs.map +1 -0
- package/dist/content-manager-2g0pkLFh.d.mts.map +1 -1
- package/dist/{context-Cp8b8Nxm.mjs → context-D9HXnnGj.mjs} +5 -5
- package/dist/{context-Cp8b8Nxm.mjs.map → context-D9HXnnGj.mjs.map} +1 -1
- package/dist/core/apply-manager.d.mts.map +1 -1
- package/dist/core/apply-manager.mjs +6 -6
- package/dist/core/config.d.mts.map +1 -1
- package/dist/core/config.mjs +1 -1
- package/dist/core/content-manager.mjs +1 -1
- package/dist/core/context.mjs +3 -3
- package/dist/core/doctor.mjs +4 -4
- package/dist/core/model-manager.mjs +1 -1
- package/dist/core/ops/index.mjs +6 -6
- package/dist/core/validator/index.d.mts.map +1 -1
- package/dist/core/validator/index.mjs +3 -3
- package/dist/{doctor-Qabcb-Z1.mjs → doctor-Br1NqEl2.mjs} +4 -4
- package/dist/{doctor-Qabcb-Z1.mjs.map → doctor-Br1NqEl2.mjs.map} +1 -1
- package/dist/git/branch-lifecycle.d.mts +1 -1
- package/dist/git/branch-lifecycle.mjs +2 -2
- package/dist/git/reconcile.d.mts.map +1 -1
- package/dist/git/reconcile.mjs +8 -8
- package/dist/git/transaction.d.mts +7 -3
- package/dist/git/transaction.d.mts.map +1 -1
- package/dist/git/transaction.mjs +6 -6
- package/dist/index.mjs +13 -13
- package/dist/{local-BQVdC9MM.mjs → local-CBtRYFH4.mjs} +7 -7
- package/dist/{local-BQVdC9MM.mjs.map → local-CBtRYFH4.mjs.map} +1 -1
- package/dist/{model-manager-BYF2z7qC.mjs → model-manager-D0VztE8M.mjs} +8 -5
- package/dist/model-manager-D0VztE8M.mjs.map +1 -0
- package/dist/{ops-CQ_IIedh.mjs → ops-CVI308jA.mjs} +9 -4
- package/dist/ops-CVI308jA.mjs.map +1 -0
- package/dist/providers/local/index.mjs +9 -9
- package/dist/{reconcile-CRAukgae.mjs → reconcile-DSflMfhj.mjs} +8 -7
- package/dist/reconcile-DSflMfhj.mjs.map +1 -0
- package/dist/{reconcile-C7AaUfCl.mjs → reconcile-J-iorvSa.mjs} +5 -4
- package/dist/reconcile-J-iorvSa.mjs.map +1 -0
- package/dist/server/http/index.mjs +13 -13
- package/dist/{server-CumICnp3.mjs → server-CJbmjX48.mjs} +43 -14
- package/dist/server-CJbmjX48.mjs.map +1 -0
- package/dist/server.mjs +13 -13
- package/dist/{transaction-CcjGiVYg.mjs → transaction-DnrUATJF.mjs} +14 -10
- package/dist/transaction-DnrUATJF.mjs.map +1 -0
- package/dist/{validator-Bz3jnSnb.mjs → validator-S19GHR4V.mjs} +16 -5
- package/dist/{validator-Bz3jnSnb.mjs.map → validator-S19GHR4V.mjs.map} +1 -1
- package/package.json +2 -2
- package/dist/apply-manager-BenQNb_b.mjs.map +0 -1
- package/dist/branch-lifecycle-CcsSyfSw.mjs.map +0 -1
- package/dist/config-BLwZtwlI.mjs.map +0 -1
- package/dist/model-manager-BYF2z7qC.mjs.map +0 -1
- package/dist/ops-CQ_IIedh.mjs.map +0 -1
- package/dist/reconcile-C7AaUfCl.mjs.map +0 -1
- package/dist/reconcile-CRAukgae.mjs.map +0 -1
- package/dist/server-CumICnp3.mjs.map +0 -1
- package/dist/transaction-CcjGiVYg.mjs.map +0 -1
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import { n as readContext } from "./context-
|
|
2
|
-
import { A as contentDirPath, C as resolveMdFilePath, O as writeContent, S as resolveLocaleStrategy, _ as listContent, a as countEntries, b as resolveContentDir, d as readModel, g as deleteContent, h as writeModel, i as collectFieldPaths, j as contentFilePath, m as validateModelDefinition, r as checkReferences, s as fieldDefZodSchema, u as listModels, x as resolveJsonFilePath } from "./model-manager-
|
|
3
|
-
import { a as planModelDelete, i as planModelSave, n as planVocabularySave, o as planContentSave, s as planContentDelete, t as planVocabularyDelete } from "./ops-
|
|
1
|
+
import { n as readContext } from "./context-D9HXnnGj.mjs";
|
|
2
|
+
import { A as contentDirPath, C as resolveMdFilePath, O as writeContent, S as resolveLocaleStrategy, _ as listContent, a as countEntries, b as resolveContentDir, d as readModel, g as deleteContent, h as writeModel, i as collectFieldPaths, j as contentFilePath, m as validateModelDefinition, r as checkReferences, s as fieldDefZodSchema, u as listModels, x as resolveJsonFilePath } from "./model-manager-D0VztE8M.mjs";
|
|
3
|
+
import { a as planModelDelete, i as planModelSave, n as planVocabularySave, o as planContentSave, s as planContentDelete, t as planVocabularyDelete } from "./ops-CVI308jA.mjs";
|
|
4
4
|
import { a as readJson, n as ensureDir, r as pathExists, s as writeJson, t as contentrainDir } from "./fs-BFTuXbbw.mjs";
|
|
5
5
|
import { a as writeMeta, i as readMeta, o as writeMetaEntries, r as mergeEntryMeta, t as applyStatusChange } from "./meta-manager-CSpKtjnP.mjs";
|
|
6
6
|
import { t as OverlayReader } from "./overlay-reader-Bx1YxGXq.mjs";
|
|
7
|
-
import { n as readVocabulary, t as readConfig } from "./config-
|
|
8
|
-
import { t as validateProject } from "./validator-
|
|
7
|
+
import { n as readVocabulary, t as readConfig } from "./config-BnNYu128.mjs";
|
|
8
|
+
import { t as validateProject } from "./validator-S19GHR4V.mjs";
|
|
9
9
|
import { r as createGit } from "./identity-CxAB9Qb8.mjs";
|
|
10
10
|
import { r as resolveInitDefaultBranch, t as resolveBaseBranch } from "./base-branch-Cw9DWvCC.mjs";
|
|
11
|
-
import { a as contentBranchRelation, c as listRemoteCrBranches, i as cleanupMergedBranches, n as checkBranchHealth, o as deleteRemoteBranch, u as pruneMergedRemoteBranches } from "./branch-lifecycle-
|
|
12
|
-
import { i as ensureContentBranch, n as buildBranchName, o as mergeBranch, r as createTransaction } from "./transaction-
|
|
13
|
-
import { n as withReadScope, r as isMerged, t as LocalProvider } from "./local-
|
|
11
|
+
import { a as contentBranchRelation, c as listRemoteCrBranches, d as LOCAL_MODE_NOTE, f as localModeReason, i as cleanupMergedBranches, n as checkBranchHealth, o as deleteRemoteBranch, p as pushPolicy, u as pruneMergedRemoteBranches } from "./branch-lifecycle-D4DxPgQg.mjs";
|
|
12
|
+
import { i as ensureContentBranch, n as buildBranchName, o as mergeBranch, r as createTransaction } from "./transaction-DnrUATJF.mjs";
|
|
13
|
+
import { n as withReadScope, r as isMerged, t as LocalProvider } from "./local-CBtRYFH4.mjs";
|
|
14
14
|
import { n as isToolAvailable, t as TOOL_REQUIREMENTS } from "./availability-CO8Xfx3w.mjs";
|
|
15
15
|
import { t as detectStack } from "./detect-B1QHYA0u.mjs";
|
|
16
16
|
import { t as TOOL_ANNOTATIONS } from "./annotations-BYkjoj2d.mjs";
|
|
17
17
|
import { n as listTemplates, t as getTemplate } from "./templates-Dn-iZyzp.mjs";
|
|
18
18
|
import { t as normalizeOperationError } from "./errors-De8Noahk.mjs";
|
|
19
|
-
import { t as reconcileBranches } from "./reconcile-
|
|
19
|
+
import { t as reconcileBranches } from "./reconcile-DSflMfhj.mjs";
|
|
20
20
|
import { t as buildGraph } from "./graph-builder-BPhi-1KH.mjs";
|
|
21
21
|
import { n as scanSummary, t as scanCandidates } from "./scanner-0sc_pARB.mjs";
|
|
22
|
-
import { n as applyExtract, r as applyReuse } from "./apply-manager-
|
|
23
|
-
import { t as runDoctor } from "./doctor-
|
|
22
|
+
import { n as applyExtract, r as applyReuse } from "./apply-manager-B-O3eAbz.mjs";
|
|
23
|
+
import { t as runDoctor } from "./doctor-Br1NqEl2.mjs";
|
|
24
24
|
import { join } from "node:path";
|
|
25
25
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
26
26
|
import { appendFile, readFile, writeFile } from "node:fs/promises";
|
|
@@ -492,7 +492,8 @@ function gitReport(input) {
|
|
|
492
492
|
commit: input.commit,
|
|
493
493
|
...input.sync ? { sync: input.sync } : {},
|
|
494
494
|
...input.base_advance ? { base_advance: input.base_advance } : {},
|
|
495
|
-
...input.remote_push ? { remote_push: input.remote_push } : {}
|
|
495
|
+
...input.remote_push ? { remote_push: input.remote_push } : {},
|
|
496
|
+
...input.remote_push === "disabled" ? { remote_note: LOCAL_MODE_NOTE } : {}
|
|
496
497
|
};
|
|
497
498
|
}
|
|
498
499
|
/**
|
|
@@ -502,6 +503,7 @@ function gitReport(input) {
|
|
|
502
503
|
function divergenceNextSteps(input) {
|
|
503
504
|
const steps = [];
|
|
504
505
|
if (input.base_advance === "blocked_diverged") steps.push("DIVERGED: the content is safe on the contentrain branch, but the base branch has commits contentrain does not — run contentrain_reconcile (dry_run first) to merge them and restore the fast-forward advance");
|
|
506
|
+
if (input.remote_push === "disabled") steps.push(`LOCAL MODE: ${LOCAL_MODE_NOTE} — the commit is on the local branches only; push it yourself when ready (pushing is off via git.push: false or CONTENTRAIN_NO_PUSH)`);
|
|
505
507
|
if (input.remote_push === "rejected") steps.push("PUSH REJECTED: the remote refused the contentrain push even after a retry — the local and remote contentrain branches have diverged; fetch and run contentrain_reconcile");
|
|
506
508
|
return steps;
|
|
507
509
|
}
|
|
@@ -1563,6 +1565,7 @@ function registerVocabularyTools(server, provider) {
|
|
|
1563
1565
|
workflow_action: commit.workflowAction,
|
|
1564
1566
|
...commit.base_advance ? { base_advance: commit.base_advance } : {},
|
|
1565
1567
|
...commit.remote_push ? { remote_push: commit.remote_push } : {},
|
|
1568
|
+
...commit.remote_push === "disabled" ? { remote_note: LOCAL_MODE_NOTE } : {},
|
|
1566
1569
|
...commit.warning ? { warning: commit.warning } : {},
|
|
1567
1570
|
...plan.advisories.length > 0 ? { advisories: plan.advisories } : {}
|
|
1568
1571
|
}, null, 2)
|
|
@@ -1638,6 +1641,7 @@ function registerVocabularyTools(server, provider) {
|
|
|
1638
1641
|
workflow_action: commit.workflowAction,
|
|
1639
1642
|
...commit.base_advance ? { base_advance: commit.base_advance } : {},
|
|
1640
1643
|
...commit.remote_push ? { remote_push: commit.remote_push } : {},
|
|
1644
|
+
...commit.remote_push === "disabled" ? { remote_note: LOCAL_MODE_NOTE } : {},
|
|
1641
1645
|
...commit.warning ? { warning: commit.warning } : {},
|
|
1642
1646
|
...plan.advisories.length > 0 ? { advisories: plan.advisories } : {}
|
|
1643
1647
|
}, null, 2)
|
|
@@ -1819,6 +1823,24 @@ function registerWorkflowTools(server, provider, projectRoot) {
|
|
|
1819
1823
|
};
|
|
1820
1824
|
const git = createGit(projectRoot);
|
|
1821
1825
|
const remoteName = process.env["CONTENTRAIN_REMOTE"] ?? "origin";
|
|
1826
|
+
const policy = pushPolicy(config);
|
|
1827
|
+
if (!policy.push) {
|
|
1828
|
+
const pending = (await git.branchLocal().catch(() => ({ all: [] }))).all.filter((b) => b.startsWith("cr/") && b !== CONTENTRAIN_BRANCH);
|
|
1829
|
+
return {
|
|
1830
|
+
content: [{
|
|
1831
|
+
type: "text",
|
|
1832
|
+
text: JSON.stringify({
|
|
1833
|
+
error: `Nothing was pushed: ${localModeReason(policy)} — contentrain_submit is unavailable in local mode.`,
|
|
1834
|
+
stage: "submit",
|
|
1835
|
+
remote_push: "disabled",
|
|
1836
|
+
agent_hint: "This project keeps writes local. Land pending review branches with contentrain_merge, or turn pushing back on (remove git.push: false, or set CONTENTRAIN_NO_PUSH=0) and submit again.",
|
|
1837
|
+
pending_branches: pending,
|
|
1838
|
+
next_steps: [pending.length > 0 ? `Merge a pending branch locally: contentrain_merge { branch: "${pending[0]}", confirm: true }` : "Make changes with contentrain_content_save — they stay local"]
|
|
1839
|
+
}, null, 2)
|
|
1840
|
+
}],
|
|
1841
|
+
isError: true
|
|
1842
|
+
};
|
|
1843
|
+
}
|
|
1822
1844
|
let hasRemote = false;
|
|
1823
1845
|
try {
|
|
1824
1846
|
hasRemote = (await git.getRemotes()).some((r) => r.name === remoteName);
|
|
@@ -1969,6 +1991,7 @@ function registerWorkflowTools(server, provider, projectRoot) {
|
|
|
1969
1991
|
sync: result.sync,
|
|
1970
1992
|
base_advance: result.base_advance,
|
|
1971
1993
|
remote_push: result.remote_push,
|
|
1994
|
+
...result.remote_push === "disabled" ? { remote_note: LOCAL_MODE_NOTE } : {},
|
|
1972
1995
|
...result.warning ? { warning: result.warning } : {},
|
|
1973
1996
|
...result.remote ? { remote: result.remote } : {},
|
|
1974
1997
|
next_steps: [
|
|
@@ -2075,6 +2098,10 @@ function registerWorkflowTools(server, provider, projectRoot) {
|
|
|
2075
2098
|
type: "text",
|
|
2076
2099
|
text: JSON.stringify({
|
|
2077
2100
|
error: `Branch "${input.branch}" not found locally${remoteOnly.skipped === "not-found" ? " or on the remote" : ""}.`,
|
|
2101
|
+
...remoteOnly.skipped === "local-mode" ? {
|
|
2102
|
+
remote_skipped: "local-mode",
|
|
2103
|
+
remote_note: `${LOCAL_MODE_NOTE}: the remote copy, if any, was left untouched`
|
|
2104
|
+
} : {},
|
|
2078
2105
|
...remoteOnly.warning ? { remote_warning: remoteOnly.warning } : {},
|
|
2079
2106
|
next_steps: ["List branches with contentrain_branch_list"]
|
|
2080
2107
|
})
|
|
@@ -2097,6 +2124,7 @@ function registerWorkflowTools(server, provider, projectRoot) {
|
|
|
2097
2124
|
was_merged: merged,
|
|
2098
2125
|
remote_deleted: remote.deleted,
|
|
2099
2126
|
...remote.skipped ? { remote_skipped: remote.skipped } : {},
|
|
2127
|
+
...remote.skipped === "local-mode" ? { remote_note: `${LOCAL_MODE_NOTE}: the remote copy, if any, was left untouched` } : {},
|
|
2100
2128
|
...remote.warning ? { remote_warning: remote.warning } : {},
|
|
2101
2129
|
warning: merged ? void 0 : "Branch was not merged — its commits were discarded."
|
|
2102
2130
|
}, null, 2)
|
|
@@ -2185,6 +2213,7 @@ function registerReconcileTools(server, provider, projectRoot) {
|
|
|
2185
2213
|
commit: result.commit,
|
|
2186
2214
|
base_advance: result.base_advance,
|
|
2187
2215
|
...result.remote_push ? { remote_push: result.remote_push } : {},
|
|
2216
|
+
...result.remote_push === "disabled" ? { remote_note: LOCAL_MODE_NOTE } : {},
|
|
2188
2217
|
...result.sync ? { sync: result.sync } : {},
|
|
2189
2218
|
summary: result.plan.result,
|
|
2190
2219
|
...result.plan.advisories.length > 0 ? { advisories: result.plan.advisories } : {},
|
|
@@ -3051,7 +3080,7 @@ function registerMediaTools(server, provider, _projectRoot) {
|
|
|
3051
3080
|
}
|
|
3052
3081
|
//#endregion
|
|
3053
3082
|
//#region package.json
|
|
3054
|
-
var version = "3.
|
|
3083
|
+
var version = "3.10.0";
|
|
3055
3084
|
//#endregion
|
|
3056
3085
|
//#region src/server.ts
|
|
3057
3086
|
/**
|
|
@@ -3128,4 +3157,4 @@ function resolveServerContext(input) {
|
|
|
3128
3157
|
//#endregion
|
|
3129
3158
|
export { createServer as n, DEFAULT_INSTRUCTIONS as t };
|
|
3130
3159
|
|
|
3131
|
-
//# sourceMappingURL=server-
|
|
3160
|
+
//# sourceMappingURL=server-CJbmjX48.mjs.map
|