thincoder 0.12.24 → 0.12.25
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/package.json +1 -1
- package/src/advisor.mjs +9 -3
- package/src/agent/setup.mjs +5 -0
- package/src/tools/bash.md +1 -1
package/package.json
CHANGED
package/src/advisor.mjs
CHANGED
|
@@ -92,6 +92,12 @@ try { ADVISOR_DESIGN = readFileSync(join(__dirname, "prompts", "advisor-design.m
|
|
|
92
92
|
* @param {string} [reviewType] — "design" for design review, undefined/"code" for code review
|
|
93
93
|
* @returns {string} the system prompt
|
|
94
94
|
*/
|
|
95
|
+
/** Append local time so the reviewer knows "now" (same grounding as the agent loop). */
|
|
96
|
+
function withTime(prompt) {
|
|
97
|
+
const timeZone = Intl.DateTimeFormat().resolvedOptions().timeZone || "local"
|
|
98
|
+
return prompt + `\n\nCurrent time: ${new Date().toLocaleString("sv-SE")} (${timeZone}).`
|
|
99
|
+
}
|
|
100
|
+
|
|
95
101
|
export function buildAdvisorSystemPrompt(agent, prior, reviewType) {
|
|
96
102
|
// Round decision is DETERMINISTIC (decision 2026-08-08): _advisorRound > 0
|
|
97
103
|
// with a stored review output means convergence (round 2+); 0 means round 1.
|
|
@@ -215,7 +221,7 @@ export function prepareAdvisorMessages(agent, reviewType, designToken = null, do
|
|
|
215
221
|
// after a failed design review). Fresh session.
|
|
216
222
|
if (reviewType === "design" && (agent._advisorRound || 0) === 0) {
|
|
217
223
|
return [
|
|
218
|
-
{ role: "system", content: buildAdvisorSystemPrompt(agent, prior, reviewType) },
|
|
224
|
+
{ role: "system", content: withTime(buildAdvisorSystemPrompt(agent, prior, reviewType)) },
|
|
219
225
|
{ role: "user", content: escapeLiteralEscapes(buildAdvisorUserMessage(agent, prior, reviewType, designToken, documents, paths)) },
|
|
220
226
|
]
|
|
221
227
|
}
|
|
@@ -243,7 +249,7 @@ export function prepareAdvisorMessages(agent, reviewType, designToken = null, do
|
|
|
243
249
|
// Mutations exist → KEEP the round (cap keeps advancing through retries).
|
|
244
250
|
const user = buildAdvisorUserMessage(agent, prior, reviewType, designToken, documents, paths)
|
|
245
251
|
return [
|
|
246
|
-
{ role: "system", content: buildAdvisorSystemPrompt(agent, prior, reviewType) },
|
|
252
|
+
{ role: "system", content: withTime(buildAdvisorSystemPrompt(agent, prior, reviewType)) },
|
|
247
253
|
{
|
|
248
254
|
role: "user",
|
|
249
255
|
// NOTE (2026-08-06): the leading prefix is a PLAIN "System reminder:",
|
|
@@ -271,7 +277,7 @@ export function prepareAdvisorMessages(agent, reviewType, designToken = null, do
|
|
|
271
277
|
// review surface.
|
|
272
278
|
const scopeFiles = resolveScopeFiles(agent, paths)
|
|
273
279
|
return [
|
|
274
|
-
{ role: "system", content: buildAdvisorSystemPrompt(agent, prior, reviewType) },
|
|
280
|
+
{ role: "system", content: withTime(buildAdvisorSystemPrompt(agent, prior, reviewType)) },
|
|
275
281
|
{ role: "user", content: escapeLiteralEscapes(buildAdvisorFollowUp(agent, prior, scopeFiles)) },
|
|
276
282
|
]
|
|
277
283
|
}
|
package/src/agent/setup.mjs
CHANGED
|
@@ -221,6 +221,11 @@ export async function prepareRun(agent, input, callbacks, {
|
|
|
221
221
|
? `${base}\n\n${mainOverlay}`
|
|
222
222
|
: base
|
|
223
223
|
|
|
224
|
+
// Local time + timezone on every agent (main, subagent, consult) — without it "today"/
|
|
225
|
+
// "just now"/"recent" in user messages and search freshness are ungrounded.
|
|
226
|
+
const timeZone = Intl.DateTimeFormat().resolvedOptions().timeZone || "local"
|
|
227
|
+
systemPrompt += `\n\nCurrent time: ${new Date().toLocaleString("sv-SE")} (${timeZone}).`
|
|
228
|
+
|
|
224
229
|
const projectRules = await loadProjectInstructions(agent.cwd)
|
|
225
230
|
if (projectRules) {
|
|
226
231
|
systemPrompt += `\n\nProject instructions (follow these as project conventions):\n<untrusted_project_instructions>\n${escapeXml(projectRules)}\n</untrusted_project_instructions>`
|
package/src/tools/bash.md
CHANGED
|
@@ -28,7 +28,7 @@ Notes:
|
|
|
28
28
|
- The environment sets GIT_PAGER=cat, PAGER=cat, EDITOR=true, TERM=dumb — but still always use non-interactive flags
|
|
29
29
|
- Output is capped at ~200K chars; if you need more, redirect to a file and read it. Truncated output ends with a `[... truncated: N chars omitted]` marker — the missing tail may contain errors.
|
|
30
30
|
- Check `[stderr]` for error messages, warnings, and diagnostic output — it is separated from `[stdout]` so you can quickly identify problems.
|
|
31
|
-
- On Windows
|
|
31
|
+
- On Windows the shell is **cmd.exe** (NOT Git Bash, NOT PowerShell): `&&`/`||` chaining works, use cmd built-ins (`del`, `dir`, `type`, `findstr`, `tasklist`) and `/dev/null`→`NUL`, `2>/dev/null`→`>nul 2>&1`. Bash-isms (`rm -rf`, `cp -r`, `head`, `$(...)`) FAIL. For complex logic prefer `node -e` over shell gymnastics.
|
|
32
32
|
- Never use bash to read, copy, or transmit secret files (.env, keys, tokens)
|
|
33
33
|
- Do NOT run destructive commands (rm -rf, force-push, drop table) without explicit user confirmation
|
|
34
34
|
- After commands that change files (git checkout, npm install, etc.), repo_outline and code_search may be stale — re-run them to get current results.
|