- Add 'Skill' to allowedTools so model can invoke Skill tool to load
review/security-review SKILL.md content
- Restore src/costrict/command/locales/ with zh-CN/en templates telling
model to use Skill tool (aligns with opencode PR #360 approach)
- Remove model: 'inherit' from review registration (was resolving to
wrong model, strict:plan works without it)
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- Merge strict:review/strict:security-review into reviewSkills.ts (single
file registers all four commands: /review, /security-review,
/strict:review, /strict:security-review)
- Remove conflicting prompt commands from src/commands/ (review.ts,
security-review.ts) so bundled skills take precedence
- Remove REVIEW_AGENTS import from builtInAgents.ts and mcp.ts
- Remove agent generation logic from generate-review-builtin.ts
- Configure allowedTools and model: 'inherit' per claudecode spec
- Switch test branch to optimize/agent-prompts
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Invert the enablement logic so raw dump is disabled unless
CSC_DISABLE_RAW_DUMP or COSTRICT_DISABLE_RAW_DUMP is explicitly
set to 0 or false.
Signed-off-by: 林凯90331 <90331@sangfor.com>
Co-authored-by: CoStrict <zgsm@sangfor.com.cn>
Include commit short hash and formatted build timestamp in the
version string, matching the output format of cs --version.
Signed-off-by: 林凯90331 <90331@sangfor.com>
Co-authored-by: CoStrict <zgsm@sangfor.com.cn>
Replace custom extension.ts initialization and agent-based routing with
csc's built-in registerBundledSkill({ files }) mechanism. Review and
security-review skills are now registered with embedded files that
get lazily extracted to disk on first invocation. Locale is resolved
at startup via getResolvedLanguage().
- Remove agent generation from generate-review-builtin.ts (skill-only)
- Remove extension.ts, REVIEW_AGENTS registration, strict:* skills
- Add reviewSkills.ts with registerReviewSkills() for unified registration
- Adapt to new costrict-review index.json format (skills-only, new paths)
- Remove src/costrict/command/locales/ (no longer needed)
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Wrap bun build --compile to produce self-contained executables for linux-x64 (glibc/musl) and windows-x64, each in modern (AVX2) and baseline (SSE2) variants. The build:binary:* aliases run the existing build pipeline first so dist/cli.js post-processing (feature flags, import.meta.require) stays in effect.
Signed-off-by: 林凯90331 <90331@sangfor.com>
Co-authored-by: CoStrict <zgsm@sangfor.com.cn>
- Add in-process isRunning flag to block reentrant runBatch (file lock
fails when pid === process.pid)
- Replace setInterval + double immediate trigger with self-scheduling
setTimeout that only fires after previous batch awaits
- Move clearQueue() to right after readQueue() so any unexpected
concurrent runBatch sees an empty queue and exits immediately
- Cache repoInfo and workingTreeDiff in processTask, pass into all three
upload functions to halve git invocations per task
- Add 30s AbortController timeout on postJson fetch so the worker no
longer hangs indefinitely on unresponsive networks
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
When https_proxy is configured, configureGlobalAgents() calls __require("undici")
synchronously. In the npm package, undici was listed as devDependencies and thus
absent from node_modules after installation. Node.js 22 would then attempt to load
its built-in ESM undici via CJS require(), causing an ESM/CJS interop deadlock that
hung the process indefinitely with no way to interrupt it.
Moving undici to dependencies ensures it is installed as a CJS-compatible module,
allowing __require("undici") to resolve correctly under Node.js.
- Add headless fallback in `hasPermissionsToUseToolInner` that respects
`askUserQuestionTimeoutSeconds` from settings (default 600s) when
`shouldAvoidPermissionPrompts` is true, instead of hanging indefinitely
- Set `shouldAvoidPermissionPrompts: true` on `toolPermissionContext` in
`-p` (pipe/headless) mode so the new path is triggered
- Hoist `parsedInput` before the try block so the headless path can use
Zod-transformed input (includes defaults like `multiSelect: false`)
Replace per-turn detached workers with a file-backed queue consumed by
a single long-running batch worker (30s interval, 0-10s jitter).
- queue.ts, batchWorker.ts: file queue with pid-based lock for worker
singleton; tasks deduped by sessionID:messageID before processing
- worker.ts: retry with backoff (5s, 10s) for 429 and network errors;
update commit state per upload so partial failures resume cleanly;
export auth, loadSessionMessages, getSessionDirectory and upload*
helpers for batchWorker reuse
- git.ts: cap commit log at 50 entries within last 7 days; pause 500ms
every 10 commits to spread load
- worker.ts: resolve session jsonl via ~/.claude/projects/{normalized}
with fallbacks, scanning for the file containing the target session
- logger.ts: file + stderr logger gated by CSC_RAW_DUMP_DEBUG, default
silent
- sessionDataUploader.ts: implement createSessionTurnUploader to pick
the last assistant message; query.ts fires uploadSessionTurn after
query_api_streaming_end (non-blocking)
Signed-off-by: 林凯90331 <90331@sangfor.com>
Co-authored-by: CoStrict <zgsm@sangfor.com.cn>
Introduce a framework-decoupled raw-dump module that uploads conversation, summary, and commits data to the CoStrict server in a non-blocking detached worker process.
- Add src/services/rawDump/ with index, types, state, spawn, git, worker, and README
- Implement reportTurn and reportSession entry points with in-memory dedup and env-based disable switch (CSC_DISABLE_RAW_DUMP / COSTRICT_DISABLE_RAW_DUMP)
- Replace sessionDataUploader stub with uploadSessionTurn that delegates to reportTurn
Signed-off-by: 林凯90331 <90331@sangfor.com>
Co-authored-by: CoStrict <zgsm@sangfor.com.cn>
Files are still present on disk and generated by build:review-builtin.
.gitignore rules prevent them from being re-committed.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- Add generate-review-builtin.ts script (downloads from zgsm-ai/costrict-review)
- Add review module (index.ts, extension.ts) with locale-aware skill init
- Add CommandLocale module with zh-CN/en templates for /review and /security-review
- Integrate REVIEW_AGENTS into builtInAgents.ts
- Route /review command to CoStrictReviewer agent
- Simplify /security-review to use Skill tool with locale templates
- Remove old generate-skills.ts and inline security-review skill
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>