infiniloom-node 0.4.7 → 0.4.8

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/README.md CHANGED
@@ -187,10 +187,10 @@ Scan a repository with full configuration options.
187
187
  Count tokens in text for a specific model.
188
188
 
189
189
  **Parameters:**
190
- - `text` - Text to tokenize
190
+ - `text` - Text to tokenize (null/undefined returns 0)
191
191
  - `model` - Optional model name (default: "claude")
192
192
 
193
- **Returns:** Token count
193
+ **Returns:** Token count (0 for empty, null, or undefined input)
194
194
 
195
195
  #### `semanticCompress(text: string, similarityThreshold?: number, budgetRatio?: number): string`
196
196
 
@@ -199,9 +199,9 @@ Compress text using semantic compression while preserving important content.
199
199
  **Parameters:**
200
200
  - `text` - Text to compress
201
201
  - `similarityThreshold` - Threshold for grouping similar chunks (0.0-1.0, default: 0.7). Note: Only affects output when built with "embeddings" feature.
202
- - `budgetRatio` - Target size as ratio of original (0.0-1.0, default: 0.5). Lower values = more aggressive compression.
202
+ - `budgetRatio` - Target size as ratio of original (0.0-1.0, default: 0.5). Lower values = more aggressive compression. Affects content as small as 10 characters. Use 1.0 to preserve content unchanged.
203
203
 
204
- **Returns:** Compressed text
204
+ **Returns:** Compressed text (may include truncation markers showing percentage and character counts)
205
205
 
206
206
  #### `scanSecurity(path: string): SecurityFinding[]`
207
207
 
@@ -567,7 +567,7 @@ interface PackOptions {
567
567
  exclude?: string[]; // Glob patterns to exclude (e.g., ["**/*.test.ts"])
568
568
  includeTests?: boolean; // Include test files (default: false)
569
569
  securityThreshold?: string;// Minimum severity to block: "critical", "high", "medium", "low"
570
- tokenBudget?: number; // Limit total output tokens (0 = no limit)
570
+ tokenBudget?: number; // Limit total output tokens (0 = no limit, negative values rejected)
571
571
  // Git-based filtering options (PR review integration)
572
572
  changedOnly?: boolean; // Only include files changed in git
573
573
  baseSha?: string; // Base SHA/ref for diff comparison (e.g., "main", "HEAD~5")
package/index.d.ts CHANGED
@@ -29,7 +29,10 @@ export interface PackOptions {
29
29
  includeTests?: boolean
30
30
  /** Minimum security severity to block on: "critical", "high", "medium", "low" (default: "critical") */
31
31
  securityThreshold?: string
32
- /** Token budget for total output (0 = no limit). Files are included by importance until budget is reached. */
32
+ /**
33
+ * Token budget for total output (0 = no limit). Files are included by importance until budget is reached.
34
+ * Negative values are invalid and will throw an error.
35
+ */
33
36
  tokenBudget?: number
34
37
  /** Only include files changed in git (requires baseSha or uses uncommitted changes) */
35
38
  changedOnly?: boolean
@@ -154,7 +157,7 @@ export declare function scanWithOptions(path: string, options?: ScanOptions | un
154
157
  * Count tokens in text for a specific model
155
158
  *
156
159
  * # Arguments
157
- * * `text` - Text to tokenize
160
+ * * `text` - Text to tokenize (null/undefined returns 0)
158
161
  * * `model` - Optional model name (default: "claude")
159
162
  *
160
163
  * # Returns
@@ -168,7 +171,7 @@ export declare function scanWithOptions(path: string, options?: ScanOptions | un
168
171
  * console.log(`Tokens: ${count}`);
169
172
  * ```
170
173
  */
171
- export declare function countTokens(text: string, model?: string | undefined | null): number
174
+ export declare function countTokens(text?: string | undefined | null, model?: string | undefined | null): number
172
175
  /**
173
176
  * Compress text using semantic compression
174
177
  *
@@ -821,6 +824,12 @@ export interface ImpactOptions {
821
824
  depth?: number
822
825
  /** Include test files in analysis */
823
826
  includeTests?: boolean
827
+ /** Target model for token counting (default: "claude") */
828
+ model?: string
829
+ /** Glob patterns to exclude (e.g., ["**/*.test.ts", "dist/**"]) */
830
+ exclude?: Array<string>
831
+ /** Glob patterns to include (e.g., ["src/**/*.ts"]) */
832
+ include?: Array<string>
824
833
  }
825
834
  /** Symbol affected by a change */
826
835
  export interface AffectedSymbol {
@@ -887,6 +896,12 @@ export interface DiffContextOptions {
887
896
  includeDiff?: boolean
888
897
  /** Output format: "xml", "markdown", "json" (default: "xml") */
889
898
  format?: string
899
+ /** Target model for token counting (default: "claude") */
900
+ model?: string
901
+ /** Glob patterns to exclude (e.g., ["**/*.test.ts", "dist/**"]) */
902
+ exclude?: Array<string>
903
+ /** Glob patterns to include (e.g., ["src/**/*.ts"]) */
904
+ include?: Array<string>
890
905
  }
891
906
  /** Context-aware diff result */
892
907
  export interface DiffContextResult {
Binary file
Binary file
Binary file
Binary file
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "infiniloom-node",
3
- "version": "0.4.7",
3
+ "version": "0.4.8",
4
4
  "description": "Node.js bindings for infiniloom - Repository context engine for LLMs",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",