@codedir/mimir-code 0.1.0 → 0.1.2

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.d.ts CHANGED
@@ -250,17 +250,17 @@ declare const ConfigSchema: z.ZodObject<{
250
250
  temperature: z.ZodDefault<z.ZodNumber>;
251
251
  maxTokens: z.ZodDefault<z.ZodNumber>;
252
252
  }, "strip", z.ZodTypeAny, {
253
- provider: "deepseek" | "anthropic" | "openai" | "google" | "gemini" | "qwen" | "ollama";
254
253
  model: string;
254
+ provider: "deepseek" | "anthropic" | "openai" | "google" | "gemini" | "qwen" | "ollama";
255
255
  temperature: number;
256
256
  maxTokens: number;
257
- apiKey?: string | undefined;
258
257
  baseURL?: string | undefined;
258
+ apiKey?: string | undefined;
259
259
  }, {
260
- provider: "deepseek" | "anthropic" | "openai" | "google" | "gemini" | "qwen" | "ollama";
261
260
  model: string;
262
- apiKey?: string | undefined;
261
+ provider: "deepseek" | "anthropic" | "openai" | "google" | "gemini" | "qwen" | "ollama";
263
262
  baseURL?: string | undefined;
263
+ apiKey?: string | undefined;
264
264
  temperature?: number | undefined;
265
265
  maxTokens?: number | undefined;
266
266
  }>;
@@ -413,18 +413,18 @@ declare const ConfigSchema: z.ZodObject<{
413
413
  maxFileSizeMB?: number | undefined;
414
414
  }>;
415
415
  }, "strip", z.ZodTypeAny, {
416
- permissions: {
417
- autoAccept: boolean;
418
- acceptRiskLevel: "low" | "medium" | "high" | "critical";
419
- alwaysAcceptCommands: string[];
420
- };
421
416
  llm: {
422
- provider: "deepseek" | "anthropic" | "openai" | "google" | "gemini" | "qwen" | "ollama";
423
417
  model: string;
418
+ provider: "deepseek" | "anthropic" | "openai" | "google" | "gemini" | "qwen" | "ollama";
424
419
  temperature: number;
425
420
  maxTokens: number;
426
- apiKey?: string | undefined;
427
421
  baseURL?: string | undefined;
422
+ apiKey?: string | undefined;
423
+ };
424
+ permissions: {
425
+ autoAccept: boolean;
426
+ acceptRiskLevel: "low" | "medium" | "high" | "critical";
427
+ alwaysAcceptCommands: string[];
428
428
  };
429
429
  keyBindings: {
430
430
  interrupt: string[];
@@ -476,19 +476,19 @@ declare const ConfigSchema: z.ZodObject<{
476
476
  maxFileSizeMB: number;
477
477
  };
478
478
  }, {
479
- permissions: {
480
- autoAccept?: boolean | undefined;
481
- acceptRiskLevel?: "low" | "medium" | "high" | "critical" | undefined;
482
- alwaysAcceptCommands?: string[] | null | undefined;
483
- };
484
479
  llm: {
485
- provider: "deepseek" | "anthropic" | "openai" | "google" | "gemini" | "qwen" | "ollama";
486
480
  model: string;
487
- apiKey?: string | undefined;
481
+ provider: "deepseek" | "anthropic" | "openai" | "google" | "gemini" | "qwen" | "ollama";
488
482
  baseURL?: string | undefined;
483
+ apiKey?: string | undefined;
489
484
  temperature?: number | undefined;
490
485
  maxTokens?: number | undefined;
491
486
  };
487
+ permissions: {
488
+ autoAccept?: boolean | undefined;
489
+ acceptRiskLevel?: "low" | "medium" | "high" | "critical" | undefined;
490
+ alwaysAcceptCommands?: string[] | null | undefined;
491
+ };
492
492
  keyBindings: {
493
493
  interrupt?: string | string[] | undefined;
494
494
  accept?: string | string[] | undefined;
@@ -671,7 +671,7 @@ declare class ConfigLoader {
671
671
 
672
672
  /**
673
673
  * FileSystemAdapter - Cross-platform file system implementation
674
- * Uses Node.js fs/promises + globby for file operations
674
+ * Uses Node.js fs/promises + fast-glob for file operations
675
675
  */
676
676
 
677
677
  declare class FileSystemAdapter implements IFileSystem {
package/dist/index.js CHANGED
@@ -420,7 +420,7 @@ var BaseLLMProvider = class {
420
420
  };
421
421
 
422
422
  // src/providers/DeepSeekProvider.ts
423
- import { encoding_for_model } from "tiktoken";
423
+ import { encode } from "gpt-tokenizer";
424
424
 
425
425
  // src/providers/utils/apiClient.ts
426
426
  import axios from "axios";
@@ -755,7 +755,6 @@ async function* parseAnthropicStream(stream) {
755
755
  // src/providers/DeepSeekProvider.ts
756
756
  var DeepSeekProvider = class extends BaseLLMProvider {
757
757
  apiClient;
758
- encoder;
759
758
  constructor(config) {
760
759
  super(config);
761
760
  const apiKey = config.apiKey || process.env.DEEPSEEK_API_KEY;
@@ -773,7 +772,6 @@ var DeepSeekProvider = class extends BaseLLMProvider {
773
772
  },
774
773
  timeout: 6e4
775
774
  });
776
- this.encoder = encoding_for_model("gpt-4");
777
775
  }
778
776
  async chat(messages, tools) {
779
777
  return this.withRetry(async () => {
@@ -806,7 +804,7 @@ var DeepSeekProvider = class extends BaseLLMProvider {
806
804
  }
807
805
  }
808
806
  countTokens(text) {
809
- return this.encoder.encode(text).length;
807
+ return encode(text).length;
810
808
  }
811
809
  calculateCost(inputTokens, outputTokens) {
812
810
  const pricing = getStaticPricing("deepseek", this.config.model);
@@ -849,10 +847,9 @@ var DeepSeekProvider = class extends BaseLLMProvider {
849
847
  };
850
848
 
851
849
  // src/providers/AnthropicProvider.ts
852
- import { encoding_for_model as encoding_for_model2 } from "tiktoken";
850
+ import { encode as encode2 } from "gpt-tokenizer";
853
851
  var AnthropicProvider = class extends BaseLLMProvider {
854
852
  apiClient;
855
- encoder;
856
853
  constructor(config) {
857
854
  super(config);
858
855
  const apiKey = config.apiKey || process.env.ANTHROPIC_API_KEY;
@@ -871,7 +868,6 @@ var AnthropicProvider = class extends BaseLLMProvider {
871
868
  },
872
869
  timeout: 6e4
873
870
  });
874
- this.encoder = encoding_for_model2("gpt-4");
875
871
  }
876
872
  async chat(messages, tools) {
877
873
  return this.withRetry(async () => {
@@ -916,7 +912,7 @@ var AnthropicProvider = class extends BaseLLMProvider {
916
912
  }
917
913
  }
918
914
  countTokens(text) {
919
- return this.encoder.encode(text).length;
915
+ return encode2(text).length;
920
916
  }
921
917
  calculateCost(inputTokens, outputTokens) {
922
918
  const pricing = getStaticPricing("anthropic", this.config.model);
@@ -1585,7 +1581,7 @@ var ConfigLoader = class {
1585
1581
 
1586
1582
  // src/platform/FileSystemAdapter.ts
1587
1583
  import fs2 from "fs/promises";
1588
- import { globby } from "globby";
1584
+ import fg from "fast-glob";
1589
1585
  var FileSystemAdapter = class {
1590
1586
  async readFile(path4, encoding = "utf-8") {
1591
1587
  return fs2.readFile(path4, encoding);
@@ -1626,7 +1622,7 @@ var FileSystemAdapter = class {
1626
1622
  await fs2.copyFile(src, dest);
1627
1623
  }
1628
1624
  async glob(pattern, options) {
1629
- return globby(pattern, {
1625
+ return fg(pattern, {
1630
1626
  cwd: options?.cwd,
1631
1627
  ignore: options?.ignore
1632
1628
  });