release: dsh-infstarapi 0.2.0
CI / test (push) Canceled after 0s

This commit is contained in:
Coldsmile_7 committed 2026-11-26 08:24:56 +08:00
1 parent a8f689e39c
commit c340aec110
59 files changed
+1108 -1590

No files matched your search

+5 -5
View File
@@ -38,7 +38,7 @@ export const CLAUDE_CLI_MODES = Object.freeze({
export const DEFAULT_CLAUDE_MODE = 'edit'
/** Isolated CLI home; the plugin owns the endpoint and key it runs with. */
export const DEFAULT_CLAUDE_CONFIG_DIR = join(homedir(), '.dsh', 'geek2api-claude-cli')
export const DEFAULT_CLAUDE_CONFIG_DIR = join(homedir(), '.dsh', 'infstarapi-claude-cli')
export const DEFAULT_CLAUDE_TIMEOUT_MS = 30 * 60 * 1000
/**
* How long a streaming run may stay silent after starting. The CLI prints its
@@ -75,7 +75,7 @@ const KILL_GRACE_MS = 3_000
export const CLAUDE_NPM_PACKAGE = '@anthropic-ai/claude-code'
/** What the turn reports when no CLI could be started at all. */
export const CLAUDE_MISSING_MESSAGE = 'Claude Code CLI is not installed on this device, and Claude models on the Geek2API route run through it. Install it under Settings → Geek2API, or run: npm install -g @anthropic-ai/claude-code'
export const CLAUDE_MISSING_MESSAGE = 'Claude Code CLI is not installed on this device, and Claude models on the InfStarAPI route run through it. Install it under Settings → InfStarAPI, or run: npm install -g @anthropic-ai/claude-code'
/** The CLI's file names on PATH: the native installer ships an `.exe`, npm a `.cmd` launcher. */
export const claudeFileNames = platform => (platform === 'win32' ? ['claude.exe', 'claude.cmd'] : ['claude'])
@@ -201,7 +201,7 @@ export function buildClaudeArgs({ mode = DEFAULT_CLAUDE_MODE, model, stream = fa
if (named !== '') args.push('--model', named)
const appended = typeof appendSystemPrompt === 'string' ? appendSystemPrompt.trim() : ''
const instructions = appended === '' ? DEFAULT_APPEND_SYSTEM_PROMPT : appended
if (searchBridge !== undefined && (!/^mcp__geek2api_search_[a-f0-9]+__web_search$/u.test(searchBridge.toolName ?? '') || typeof searchBridge.configPath !== 'string')) {
if (searchBridge !== undefined && (!/^mcp__infstarapi_search_[a-f0-9]+__web_search$/u.test(searchBridge.toolName ?? '') || typeof searchBridge.configPath !== 'string')) {
throw new Error('Geek2API CLI search bridge configuration is invalid')
}
args.push('--append-system-prompt', searchBridge === undefined ? instructions : `${instructions}\n\n${searchBridge.instructions}`)
@@ -238,7 +238,7 @@ export function buildClaudeArgs({ mode = DEFAULT_CLAUDE_MODE, model, stream = fa
const MAX_PLAN_DENIALS = 8
/** A plan file or submitted plan larger than this is not returned into the turn. */
const PLAN_FILE_MAX_BYTES = 200_000
const PLAN_DIRECTORY_PREFIX = '.dsh-geek2api-plan-'
const PLAN_DIRECTORY_PREFIX = '.dsh-infstarapi-plan-'
const PLAN_FS = Object.freeze({ mkdtempSync, realpathSync, lstatSync, rmSync })
const PLAN_EXIT_DENY = 'Write the plan to the plan file first, starting with a # heading, then call ExitPlanMode again.'
const PLAN_TOO_LARGE_DENY = 'The plan exceeds the 200000-byte review limit. Write a complete, shorter plan without dropping constraints, then call ExitPlanMode again.'
@@ -527,7 +527,7 @@ function oneLine(text, limit = MAX_TOOL_SUMMARY_CHARS) {
* @returns e.g. `Bash · git status`.
*/
export function summarizeToolUse(name, input) {
const label = /^mcp__geek2api_search_[a-f0-9]+__web_search$/u.test(name ?? '') ? 'Geek2API WebSearch' : typeof name === 'string' && name !== '' ? name : 'tool'
const label = /^mcp__infstarapi_search_[a-f0-9]+__web_search$/u.test(name ?? '') ? 'InfStarAPI WebSearch' : typeof name === 'string' && name !== '' ? name : 'tool'
if (input === null || typeof input !== 'object') return label
for (const field of TOOL_SUMMARY_FIELDS) {
const value = input[field]