+1
-1
| { | ||
| "name": "lore-map", | ||
| "version": "0.1.0", | ||
| "version": "0.1.1", | ||
| "description": "See your codebase as a living architecture map — then edit the map and let Claude build the code", | ||
@@ -5,0 +5,0 @@ "type": "module", |
@@ -36,4 +36,7 @@ import { query } from '@anthropic-ai/claude-agent-sdk'; | ||
| systemPrompt: system, // custom system prompt (string), not the claude_code preset | ||
| allowedTools: [], // pure generation — no file/bash tools | ||
| maxTurns: 1, | ||
| allowedTools: [], // pure generation — no file/bash tools (no tool loops) | ||
| // Large outputs (e.g. the deep-scan graph) can span multiple turns when a | ||
| // turn hits the output-token limit; give it room to finish. With no tools, | ||
| // extra turns only ever continue the generation. | ||
| maxTurns: 24, | ||
| settingSources: [], // don't load the project's CLAUDE.md into reasoning calls | ||
@@ -43,12 +46,25 @@ }, | ||
| let text = ''; | ||
| // Accumulate the model's text as it streams, and also capture the final | ||
| // success result. Preferring the success result when present, but falling | ||
| // back to the accumulated text means a turn-cap stop still yields output | ||
| // instead of a hard crash. | ||
| let assistantText = ''; | ||
| let resultText = null; | ||
| let errorSubtype = null; | ||
| for await (const message of stream) { | ||
| if (message.type === 'result') { | ||
| if (message.subtype && message.subtype !== 'success') { | ||
| throw new Error(`Claude returned: ${message.subtype}`); | ||
| if (message.type === 'assistant') { | ||
| for (const block of message.message?.content || []) { | ||
| if (block.type === 'text') assistantText += block.text; | ||
| } | ||
| text = message.result ?? ''; | ||
| } else if (message.type === 'result') { | ||
| if (message.subtype === 'success') resultText = message.result ?? ''; | ||
| else errorSubtype = message.subtype; | ||
| } | ||
| } | ||
| return text.trim(); | ||
| const text = (resultText ?? assistantText).trim(); | ||
| if (!text) { | ||
| throw new Error(`Claude returned no usable output${errorSubtype ? ` (${errorSubtype})` : ''}`); | ||
| } | ||
| return text; | ||
| } | ||
@@ -55,0 +71,0 @@ |
@@ -98,2 +98,7 @@ import { Router } from 'express'; | ||
| 'Edges reference node titles within the SAME level.', | ||
| '', | ||
| 'Keep it concise so the response stays bounded: 4-8 top-level blocks; at most', | ||
| '~20 children per block (group/summarize the rest rather than listing every file);', | ||
| 'notes are one short phrase, not paragraphs. Favor the most structurally important', | ||
| 'items. Output ONLY the JSON object.', | ||
| ].join('\n'); | ||
@@ -100,0 +105,0 @@ |
@@ -37,6 +37,7 @@ import fs from 'node:fs'; | ||
| * @param {object} [opts] | ||
| * @param {number} [opts.totalBudget=350000] total chars of source to include | ||
| * @param {number} [opts.maxFileChars=14000] per-file cap (truncated beyond) | ||
| * @param {number} [opts.totalBudget=80000] total chars of source to include | ||
| * @param {number} [opts.maxFileChars=4000] per-file cap (truncated beyond) | ||
| * @param {number} [opts.maxFiles=80] max number of files to include | ||
| */ | ||
| export function gatherSources(root, files, { totalBudget = 350000, maxFileChars = 14000 } = {}) { | ||
| export function gatherSources(root, files, { totalBudget = 80000, maxFileChars = 4000, maxFiles = 80 } = {}) { | ||
| const candidates = files.filter( | ||
@@ -68,3 +69,3 @@ (f) => SOURCE_EXTS.has(path.extname(f).toLowerCase()) && !SKIP_RE.test(f) | ||
| for (const { file } of sized) { | ||
| if (used >= totalBudget) break; | ||
| if (used >= totalBudget || included >= maxFiles) break; | ||
| let content; | ||
@@ -71,0 +72,0 @@ try { |
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
407485
0.31%2624
0.81%