claudish 3.0.3 → 3.0.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/index.js +40 -17
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -38311,22 +38311,41 @@ var init_gemini_adapter = __esm(() => {
|
|
|
38311
38311
|
init_logger();
|
|
38312
38312
|
REASONING_PATTERNS = [
|
|
38313
38313
|
/^Wait,?\s+I(?:'m|\s+am)\s+\w+ing\b/i,
|
|
38314
|
+
/^Wait,?\s+(?:if|that|the|this|I\s+(?:need|should|will|have|already))/i,
|
|
38314
38315
|
/^Wait[.!]?\s*$/i,
|
|
38315
|
-
/^Let\s+me\s+(think|check|verify|see|look|analyze|consider)/i,
|
|
38316
|
+
/^Let\s+me\s+(think|check|verify|see|look|analyze|consider|first|start)/i,
|
|
38317
|
+
/^Let's\s+(check|see|look|start|first|try|think|verify|examine|analyze)/i,
|
|
38316
38318
|
/^I\s+need\s+to\s+/i,
|
|
38317
38319
|
/^O[kK](?:ay)?[.,!]?\s*(?:so|let|I|now|first)?/i,
|
|
38318
38320
|
/^[Hh]mm+/,
|
|
38319
38321
|
/^So[,.]?\s+(?:I|let|first|now|the)/i,
|
|
38320
38322
|
/^(?:First|Next|Then|Now)[,.]?\s+(?:I|let|we)/i,
|
|
38321
38323
|
/^(?:Thinking\s+about|Considering)/i,
|
|
38322
|
-
/^I(?:'ll|\s+will
|
|
38323
|
-
/^
|
|
38324
|
+
/^I(?:'ll|\s+will)\s+(?:first|now|start|begin|try|check|fix|look|examine|modify|create|update|read|investigate|adjust|improve|integrate|mark|also|verify|need|rethink|add|help|use|run|search|find|explore|analyze|review|test|implement|write|make|set|get|see|open|close|save|load|fetch|call|send|build|compile|execute|process|handle|parse|format|validate|clean|clear|remove|delete|move|copy|rename|install|configure|setup|initialize|prepare|work|continue|proceed|ensure|confirm)/i,
|
|
38325
|
+
/^I\s+should\s+/i,
|
|
38326
|
+
/^I\s+will\s+(?:first|now|start|verify|check|create|modify|look|need|also|add|help|use|run|search|find|explore|analyze|review|test|implement|write)/i,
|
|
38327
|
+
/^(?:Debug|Checking|Verifying|Looking\s+at):/i,
|
|
38328
|
+
/^I\s+also\s+(?:notice|need|see|want)/i,
|
|
38329
|
+
/^The\s+(?:goal|issue|problem|idea|plan)\s+is/i,
|
|
38330
|
+
/^In\s+the\s+(?:old|current|previous|new|existing)\s+/i,
|
|
38331
|
+
/^`[^`]+`\s+(?:is|has|does|needs|should|will|doesn't|hasn't)/i
|
|
38324
38332
|
];
|
|
38325
38333
|
REASONING_CONTINUATION_PATTERNS = [
|
|
38326
38334
|
/^And\s+(?:then|I|now|so)/i,
|
|
38327
|
-
/^
|
|
38335
|
+
/^And\s+I(?:'ll|\s+will)/i,
|
|
38336
|
+
/^But\s+(?:I|first|wait|actually|the|if)/i,
|
|
38328
38337
|
/^Actually[,.]?\s+/i,
|
|
38329
|
-
|
|
38338
|
+
/^Also[,.]?\s+(?:I|the|check|note)/i,
|
|
38339
|
+
/^\d+\.\s+(?:I|First|Check|Run|Create|Update|Read|Modify|Add|Fix|Look)/i,
|
|
38340
|
+
/^-\s+(?:I|First|Check|Run|Create|Update|Read|Modify|Add|Fix)/i,
|
|
38341
|
+
/^Or\s+(?:I|just|we|maybe|perhaps)/i,
|
|
38342
|
+
/^Since\s+(?:I|the|this|we|it)/i,
|
|
38343
|
+
/^Because\s+(?:I|the|this|we|it)/i,
|
|
38344
|
+
/^If\s+(?:I|the|this|we|it)\s+/i,
|
|
38345
|
+
/^This\s+(?:is|means|requires|should|will|confirms|suggests)/i,
|
|
38346
|
+
/^That\s+(?:means|is|should|will|explains|confirms)/i,
|
|
38347
|
+
/^Lines?\s+\d+/i,
|
|
38348
|
+
/^The\s+`[^`]+`\s+(?:is|has|contains|needs|should)/i
|
|
38330
38349
|
];
|
|
38331
38350
|
GeminiAdapter = class GeminiAdapter extends BaseModelAdapter {
|
|
38332
38351
|
thoughtSignatures = new Map;
|
|
@@ -39879,8 +39898,8 @@ var init_openai_compat = __esm(() => {
|
|
|
39879
39898
|
});
|
|
39880
39899
|
|
|
39881
39900
|
// src/handlers/openrouter-handler.ts
|
|
39882
|
-
import { writeFileSync as writeFileSync8 } from "node:fs";
|
|
39883
|
-
import {
|
|
39901
|
+
import { writeFileSync as writeFileSync8, mkdirSync as mkdirSync5 } from "node:fs";
|
|
39902
|
+
import { homedir as homedir2 } from "node:os";
|
|
39884
39903
|
import { join as join8 } from "node:path";
|
|
39885
39904
|
|
|
39886
39905
|
class OpenRouterHandler {
|
|
@@ -39928,7 +39947,9 @@ class OpenRouterHandler {
|
|
|
39928
39947
|
context_left_percent: leftPct,
|
|
39929
39948
|
updated_at: Date.now()
|
|
39930
39949
|
};
|
|
39931
|
-
|
|
39950
|
+
const claudishDir = join8(homedir2(), ".claudish");
|
|
39951
|
+
mkdirSync5(claudishDir, { recursive: true });
|
|
39952
|
+
writeFileSync8(join8(claudishDir, `tokens-${this.port}.json`), JSON.stringify(data), "utf-8");
|
|
39932
39953
|
} catch (e) {}
|
|
39933
39954
|
}
|
|
39934
39955
|
async handle(c, payload) {
|
|
@@ -60580,8 +60601,8 @@ var init_undici = __esm(() => {
|
|
|
60580
60601
|
});
|
|
60581
60602
|
|
|
60582
60603
|
// src/handlers/local-provider-handler.ts
|
|
60583
|
-
import { writeFileSync as writeFileSync9 } from "node:fs";
|
|
60584
|
-
import {
|
|
60604
|
+
import { writeFileSync as writeFileSync9, mkdirSync as mkdirSync6 } from "node:fs";
|
|
60605
|
+
import { homedir as homedir3 } from "node:os";
|
|
60585
60606
|
import { join as join9 } from "node:path";
|
|
60586
60607
|
|
|
60587
60608
|
class LocalProviderHandler {
|
|
@@ -60748,7 +60769,9 @@ class LocalProviderHandler {
|
|
|
60748
60769
|
context_left_percent: leftPct,
|
|
60749
60770
|
updated_at: Date.now()
|
|
60750
60771
|
};
|
|
60751
|
-
|
|
60772
|
+
const claudishDir = join9(homedir3(), ".claudish");
|
|
60773
|
+
mkdirSync6(claudishDir, { recursive: true });
|
|
60774
|
+
writeFileSync9(join9(claudishDir, `tokens-${this.port}.json`), JSON.stringify(data), "utf-8");
|
|
60752
60775
|
} catch (e) {}
|
|
60753
60776
|
}
|
|
60754
60777
|
async handle(c, payload) {
|
|
@@ -61270,24 +61293,24 @@ __export(exports_update_checker, {
|
|
|
61270
61293
|
});
|
|
61271
61294
|
import { execSync } from "node:child_process";
|
|
61272
61295
|
import { createInterface as createInterface2 } from "node:readline";
|
|
61273
|
-
import { existsSync as existsSync7, readFileSync as readFileSync6, writeFileSync as writeFileSync10, mkdirSync as
|
|
61296
|
+
import { existsSync as existsSync7, readFileSync as readFileSync6, writeFileSync as writeFileSync10, mkdirSync as mkdirSync7, unlinkSync as unlinkSync2 } from "node:fs";
|
|
61274
61297
|
import { join as join10 } from "node:path";
|
|
61275
|
-
import { tmpdir as
|
|
61298
|
+
import { tmpdir as tmpdir2, homedir as homedir4, platform } from "node:os";
|
|
61276
61299
|
function getCacheFilePath() {
|
|
61277
61300
|
let cacheDir;
|
|
61278
61301
|
if (isWindows2) {
|
|
61279
|
-
const localAppData = process.env.LOCALAPPDATA || join10(
|
|
61302
|
+
const localAppData = process.env.LOCALAPPDATA || join10(homedir4(), "AppData", "Local");
|
|
61280
61303
|
cacheDir = join10(localAppData, "claudish");
|
|
61281
61304
|
} else {
|
|
61282
|
-
cacheDir = join10(
|
|
61305
|
+
cacheDir = join10(homedir4(), ".cache", "claudish");
|
|
61283
61306
|
}
|
|
61284
61307
|
try {
|
|
61285
61308
|
if (!existsSync7(cacheDir)) {
|
|
61286
|
-
|
|
61309
|
+
mkdirSync7(cacheDir, { recursive: true });
|
|
61287
61310
|
}
|
|
61288
61311
|
return join10(cacheDir, "update-check.json");
|
|
61289
61312
|
} catch {
|
|
61290
|
-
return join10(
|
|
61313
|
+
return join10(tmpdir2(), "claudish-update-check.json");
|
|
61291
61314
|
}
|
|
61292
61315
|
}
|
|
61293
61316
|
function readCache() {
|