@jefuriiij/synthra 0.1.5 → 0.1.6
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/cli/index.js +32 -14
- package/dist/cli/index.js.map +1 -1
- package/dist/dashboard/index.js +1 -1
- package/dist/dashboard/index.js.map +1 -1
- package/dist/server/index.js +27 -9
- package/dist/server/index.js.map +1 -1
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -18,7 +18,7 @@ var init_package = __esm({
|
|
|
18
18
|
"package.json"() {
|
|
19
19
|
package_default = {
|
|
20
20
|
name: "@jefuriiij/synthra",
|
|
21
|
-
version: "0.1.
|
|
21
|
+
version: "0.1.6",
|
|
22
22
|
publishConfig: {
|
|
23
23
|
access: "public"
|
|
24
24
|
},
|
|
@@ -864,7 +864,7 @@ var public_default = `<!doctype html>
|
|
|
864
864
|
|
|
865
865
|
<!-- ============ Footer ============ -->
|
|
866
866
|
<footer class="foot">
|
|
867
|
-
<div>Synth<em>ra</em> \xB7 v0.1.
|
|
867
|
+
<div>Synth<em>ra</em> \xB7 v0.1.6</div>
|
|
868
868
|
<div>Cost figures approximate \xB7 @jefuriiij</div>
|
|
869
869
|
</footer>
|
|
870
870
|
|
|
@@ -3045,6 +3045,12 @@ function policyBlock() {
|
|
|
3045
3045
|
"Grep / Glob / Read** \u2014 they are faster, cheaper, and already filtered",
|
|
3046
3046
|
"to relevant files.",
|
|
3047
3047
|
"",
|
|
3048
|
+
"> **Tool namespace.** Synthra's MCP tools are exposed as",
|
|
3049
|
+
"> `mcp__synthra__graph_continue`, `mcp__synthra__graph_read`, and",
|
|
3050
|
+
"> `mcp__synthra__graph_register_edit`. Below they are referred to by",
|
|
3051
|
+
"> their short names (`graph_continue` etc.) for readability \u2014 use the",
|
|
3052
|
+
"> full namespaced form when actually invoking them.",
|
|
3053
|
+
"",
|
|
3048
3054
|
"### Tools",
|
|
3049
3055
|
"",
|
|
3050
3056
|
"- **`graph_continue(query)`** \u2014 returns a `Confidence` label, the list",
|
|
@@ -3081,8 +3087,11 @@ function policyBlock() {
|
|
|
3081
3087
|
"",
|
|
3082
3088
|
"- **`Confidence: high`** \u2192 Stop. Do NOT Grep, Glob, or further explore",
|
|
3083
3089
|
" for this query. The graph already has it.",
|
|
3084
|
-
"- **`Confidence: medium`**
|
|
3085
|
-
"
|
|
3090
|
+
"- **`Confidence: medium`** \u2192 Read the listed `Files` directly via",
|
|
3091
|
+
' `graph_read("file::symbol")` *before* trying Grep. The graph has',
|
|
3092
|
+
" narrowed the search space \u2014 use it, don't bypass it.",
|
|
3093
|
+
"- **`Confidence: low`** \u2192 You may use Grep / Glob, but the PreToolUse",
|
|
3094
|
+
" hook may still block redundant calls.",
|
|
3086
3095
|
"",
|
|
3087
3096
|
"### Reading code",
|
|
3088
3097
|
"",
|
|
@@ -3139,8 +3148,16 @@ async function patchClaudeMd(path) {
|
|
|
3139
3148
|
}
|
|
3140
3149
|
|
|
3141
3150
|
// src/cli/bootstrap.ts
|
|
3142
|
-
var
|
|
3143
|
-
|
|
3151
|
+
var GITIGNORE_ENTRIES = [
|
|
3152
|
+
{
|
|
3153
|
+
comment: "added by synthra (heavy generated state \u2014 gitignored by design)",
|
|
3154
|
+
entry: ".synthra-graph/"
|
|
3155
|
+
},
|
|
3156
|
+
{
|
|
3157
|
+
comment: "added by synthra \u2014 MCP registration. Remove this line if you want to share the synthra MCP entry with teammates via committed .mcp.json",
|
|
3158
|
+
entry: ".mcp.json"
|
|
3159
|
+
}
|
|
3160
|
+
];
|
|
3144
3161
|
async function exists(path) {
|
|
3145
3162
|
try {
|
|
3146
3163
|
await stat2(path);
|
|
@@ -3160,11 +3177,12 @@ async function patchGitignore(path) {
|
|
|
3160
3177
|
existing = await readFile10(path, "utf8");
|
|
3161
3178
|
} catch {
|
|
3162
3179
|
}
|
|
3163
|
-
const
|
|
3164
|
-
|
|
3165
|
-
|
|
3166
|
-
${
|
|
3167
|
-
|
|
3180
|
+
const trimmed = new Set(existing.split(/\r?\n/).map((l) => l.trim()));
|
|
3181
|
+
const missing = GITIGNORE_ENTRIES.filter((e) => !trimmed.has(e.entry));
|
|
3182
|
+
if (missing.length === 0) return false;
|
|
3183
|
+
const block = missing.map((m) => `# ${m.comment}
|
|
3184
|
+
${m.entry}`).join("\n") + "\n";
|
|
3185
|
+
const appendix = (existing.length === 0 || existing.endsWith("\n") ? "" : "\n") + (existing.length ? "\n" : "") + block;
|
|
3168
3186
|
await writeFile5(path, existing + appendix, "utf8");
|
|
3169
3187
|
return true;
|
|
3170
3188
|
}
|
|
@@ -4786,10 +4804,10 @@ function runClaude(bin, args, cwd, stdio = "pipe") {
|
|
|
4786
4804
|
}
|
|
4787
4805
|
async function registerMcp(bin, mcpPort, cwd) {
|
|
4788
4806
|
const url = `http://127.0.0.1:${mcpPort}/mcp`;
|
|
4789
|
-
await runClaude(bin, ["mcp", "remove", MCP_NAME, "--scope", "
|
|
4807
|
+
await runClaude(bin, ["mcp", "remove", MCP_NAME, "--scope", "project"], cwd).catch(() => void 0);
|
|
4790
4808
|
const reg = await runClaude(
|
|
4791
4809
|
bin,
|
|
4792
|
-
["mcp", "add", MCP_NAME, "--transport", "http", "--scope", "
|
|
4810
|
+
["mcp", "add", MCP_NAME, "--transport", "http", "--scope", "project", url],
|
|
4793
4811
|
cwd
|
|
4794
4812
|
);
|
|
4795
4813
|
if (reg.code !== 0) {
|
|
@@ -4801,7 +4819,7 @@ async function registerMcp(bin, mcpPort, cwd) {
|
|
|
4801
4819
|
return true;
|
|
4802
4820
|
}
|
|
4803
4821
|
async function unregisterMcp(bin, cwd) {
|
|
4804
|
-
const r = await runClaude(bin, ["mcp", "remove", MCP_NAME, "--scope", "
|
|
4822
|
+
const r = await runClaude(bin, ["mcp", "remove", MCP_NAME, "--scope", "project"], cwd);
|
|
4805
4823
|
if (r.code === 0) log.debug("unregistered MCP server");
|
|
4806
4824
|
}
|
|
4807
4825
|
async function spawnClaude(bin, opts) {
|