@jefuriiij/synthra 0.1.4 → 0.1.5
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 +65 -23
- 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 +63 -21
- 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.5",
|
|
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.5</div>
|
|
868
868
|
<div>Cost figures approximate \xB7 @jefuriiij</div>
|
|
869
869
|
</footer>
|
|
870
870
|
|
|
@@ -3031,7 +3031,7 @@ import { mkdir as mkdir5, readFile as readFile10, stat as stat2, writeFile as wr
|
|
|
3031
3031
|
|
|
3032
3032
|
// src/hooks/claude-md.ts
|
|
3033
3033
|
import { readFile as readFile9, writeFile as writeFile4 } from "fs/promises";
|
|
3034
|
-
var POLICY_VERSION =
|
|
3034
|
+
var POLICY_VERSION = 2;
|
|
3035
3035
|
var POLICY_BEGIN = `<!-- synthra-policy v${POLICY_VERSION} BEGIN -->`;
|
|
3036
3036
|
var POLICY_END = `<!-- synthra-policy v${POLICY_VERSION} END -->`;
|
|
3037
3037
|
var ANY_BLOCK_RE = /<!--\s*synthra-policy\s+v\d+\s+BEGIN\s*-->[\s\S]*?<!--\s*synthra-policy\s+v\d+\s+END\s*-->\s*/g;
|
|
@@ -3040,33 +3040,75 @@ function policyBlock() {
|
|
|
3040
3040
|
POLICY_BEGIN,
|
|
3041
3041
|
"## Synthra context policy",
|
|
3042
3042
|
"",
|
|
3043
|
-
"Synthra has pre-loaded
|
|
3044
|
-
"
|
|
3045
|
-
"
|
|
3043
|
+
"Synthra has pre-loaded structured context into this session and exposes",
|
|
3044
|
+
"the project's code graph through MCP tools. **Prefer these tools over",
|
|
3045
|
+
"Grep / Glob / Read** \u2014 they are faster, cheaper, and already filtered",
|
|
3046
3046
|
"to relevant files.",
|
|
3047
3047
|
"",
|
|
3048
3048
|
"### Tools",
|
|
3049
3049
|
"",
|
|
3050
|
-
"- **`graph_continue(query)`** \u2014
|
|
3051
|
-
"
|
|
3052
|
-
|
|
3053
|
-
"
|
|
3054
|
-
'
|
|
3055
|
-
|
|
3050
|
+
"- **`graph_continue(query)`** \u2014 returns a `Confidence` label, the list",
|
|
3051
|
+
" of relevant `Files`, and signatures + top function bodies for those",
|
|
3052
|
+
" files. Your default first move when you need project context.",
|
|
3053
|
+
"- **`graph_read(target)`** \u2014 fetch source. Prefer the",
|
|
3054
|
+
' `"file/path.ts::SymbolName"` form over a bare file path \u2014 reading one',
|
|
3055
|
+
" symbol is ~50 tokens, reading a whole file is thousands.",
|
|
3056
3056
|
"- **`graph_register_edit(files)`** \u2014 after you edit files, call this so",
|
|
3057
|
-
"
|
|
3057
|
+
" subsequent turns weight your changes and avoid stale snapshots.",
|
|
3058
3058
|
"",
|
|
3059
|
-
"###
|
|
3059
|
+
"### When to call `graph_continue` \u2014 and when to skip",
|
|
3060
3060
|
"",
|
|
3061
|
-
"
|
|
3062
|
-
"
|
|
3063
|
-
"
|
|
3064
|
-
|
|
3065
|
-
"
|
|
3066
|
-
"
|
|
3067
|
-
"
|
|
3068
|
-
"
|
|
3069
|
-
"
|
|
3061
|
+
"**Call `graph_continue` only when you do NOT already know the relevant",
|
|
3062
|
+
"files.**",
|
|
3063
|
+
"",
|
|
3064
|
+
"Call it when:",
|
|
3065
|
+
"- This is the first message of a new task or conversation",
|
|
3066
|
+
"- The task shifts to a different area of the codebase",
|
|
3067
|
+
"- You need files you haven't seen yet in this session",
|
|
3068
|
+
"",
|
|
3069
|
+
"**Skip `graph_continue` when:**",
|
|
3070
|
+
"- You already identified the relevant files earlier in this conversation",
|
|
3071
|
+
"- You are doing follow-up work on files already read (verify, refactor,",
|
|
3072
|
+
" test, docs, cleanup, commit)",
|
|
3073
|
+
"- The task is pure text (commit message, explanation, summary)",
|
|
3074
|
+
"",
|
|
3075
|
+
'If skipping, go directly to `graph_read("file.ts::symbol")` on what',
|
|
3076
|
+
"you already know.",
|
|
3077
|
+
"",
|
|
3078
|
+
"### Confidence caps",
|
|
3079
|
+
"",
|
|
3080
|
+
"When `graph_continue` returns:",
|
|
3081
|
+
"",
|
|
3082
|
+
"- **`Confidence: high`** \u2192 Stop. Do NOT Grep, Glob, or further explore",
|
|
3083
|
+
" for this query. The graph already has it.",
|
|
3084
|
+
"- **`Confidence: medium`** or **`low`** \u2192 You may use Grep / Glob",
|
|
3085
|
+
" sparingly, but the PreToolUse hook may still block redundant calls.",
|
|
3086
|
+
"",
|
|
3087
|
+
"### Reading code",
|
|
3088
|
+
"",
|
|
3089
|
+
"- **Always use `file::symbol` notation** with `graph_read`. Whole-file",
|
|
3090
|
+
" reads should be rare \u2014 only when you genuinely need the full file.",
|
|
3091
|
+
"- If `graph_continue`'s `Files` list contains a `::` entry, pass it",
|
|
3092
|
+
" verbatim to `graph_read`.",
|
|
3093
|
+
"",
|
|
3094
|
+
"### Don'ts",
|
|
3095
|
+
"",
|
|
3096
|
+
"- Don't Grep / Glob before calling `graph_continue` when required \u2014 the",
|
|
3097
|
+
" PreToolUse hook may block it.",
|
|
3098
|
+
"- Don't call `graph_continue` more than once per turn.",
|
|
3099
|
+
"- Don't read whole files when a symbol-level read would suffice.",
|
|
3100
|
+
"",
|
|
3101
|
+
"### Session-end resume note",
|
|
3102
|
+
"",
|
|
3103
|
+
`When the user signals they're done (e.g. "bye", "wrap up", "done"),`,
|
|
3104
|
+
"proactively update `.synthra/CONTEXT.md` with:",
|
|
3105
|
+
"",
|
|
3106
|
+
"- **Current Task**: one sentence on what was being worked on",
|
|
3107
|
+
"- **Key Decisions**: bullet list, max 3 items",
|
|
3108
|
+
"- **Next Steps**: bullet list, max 3 items",
|
|
3109
|
+
"",
|
|
3110
|
+
"Keep `CONTEXT.md` under 20 lines total. Don't summarise the conversation",
|
|
3111
|
+
"\u2014 write only what's needed to resume next session.",
|
|
3070
3112
|
"",
|
|
3071
3113
|
"_This block is managed by Synthra. Edits inside the BEGIN/END markers",
|
|
3072
3114
|
"are overwritten on every `syn .` run._",
|