ctxinit 0.1.0
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/LICENSE +21 -0
- package/README.md +484 -0
- package/bin/ctx.js +3 -0
- package/dist/analysis/index.d.ts +2 -0
- package/dist/analysis/index.d.ts.map +1 -0
- package/dist/analysis/index.js +18 -0
- package/dist/analysis/index.js.map +1 -0
- package/dist/analysis/static-analysis.d.ts +79 -0
- package/dist/analysis/static-analysis.d.ts.map +1 -0
- package/dist/analysis/static-analysis.js +279 -0
- package/dist/analysis/static-analysis.js.map +1 -0
- package/dist/bootstrap/index.d.ts +8 -0
- package/dist/bootstrap/index.d.ts.map +1 -0
- package/dist/bootstrap/index.js +13 -0
- package/dist/bootstrap/index.js.map +1 -0
- package/dist/bootstrap/orchestrator.d.ts +48 -0
- package/dist/bootstrap/orchestrator.d.ts.map +1 -0
- package/dist/bootstrap/orchestrator.js +363 -0
- package/dist/bootstrap/orchestrator.js.map +1 -0
- package/dist/bootstrap/validator.d.ts +25 -0
- package/dist/bootstrap/validator.d.ts.map +1 -0
- package/dist/bootstrap/validator.js +412 -0
- package/dist/bootstrap/validator.js.map +1 -0
- package/dist/build/atomic.d.ts +74 -0
- package/dist/build/atomic.d.ts.map +1 -0
- package/dist/build/atomic.js +235 -0
- package/dist/build/atomic.js.map +1 -0
- package/dist/build/index.d.ts +10 -0
- package/dist/build/index.d.ts.map +1 -0
- package/dist/build/index.js +26 -0
- package/dist/build/index.js.map +1 -0
- package/dist/build/lock.d.ts +102 -0
- package/dist/build/lock.d.ts.map +1 -0
- package/dist/build/lock.js +297 -0
- package/dist/build/lock.js.map +1 -0
- package/dist/build/manifest.d.ts +138 -0
- package/dist/build/manifest.d.ts.map +1 -0
- package/dist/build/manifest.js +269 -0
- package/dist/build/manifest.js.map +1 -0
- package/dist/build/orchestrator.d.ts +103 -0
- package/dist/build/orchestrator.d.ts.map +1 -0
- package/dist/build/orchestrator.js +524 -0
- package/dist/build/orchestrator.js.map +1 -0
- package/dist/cli/bootstrap.d.ts +77 -0
- package/dist/cli/bootstrap.d.ts.map +1 -0
- package/dist/cli/bootstrap.js +527 -0
- package/dist/cli/bootstrap.js.map +1 -0
- package/dist/cli/build.d.ts +32 -0
- package/dist/cli/build.d.ts.map +1 -0
- package/dist/cli/build.js +156 -0
- package/dist/cli/build.js.map +1 -0
- package/dist/cli/diff.d.ts +23 -0
- package/dist/cli/diff.d.ts.map +1 -0
- package/dist/cli/diff.js +226 -0
- package/dist/cli/diff.js.map +1 -0
- package/dist/cli/hooks.d.ts +29 -0
- package/dist/cli/hooks.d.ts.map +1 -0
- package/dist/cli/hooks.js +176 -0
- package/dist/cli/hooks.js.map +1 -0
- package/dist/cli/init.d.ts +53 -0
- package/dist/cli/init.d.ts.map +1 -0
- package/dist/cli/init.js +254 -0
- package/dist/cli/init.js.map +1 -0
- package/dist/cli/lint.d.ts +46 -0
- package/dist/cli/lint.d.ts.map +1 -0
- package/dist/cli/lint.js +210 -0
- package/dist/cli/lint.js.map +1 -0
- package/dist/cli/migrate.d.ts +28 -0
- package/dist/cli/migrate.d.ts.map +1 -0
- package/dist/cli/migrate.js +350 -0
- package/dist/cli/migrate.js.map +1 -0
- package/dist/cli/verify.d.ts +21 -0
- package/dist/cli/verify.d.ts.map +1 -0
- package/dist/cli/verify.js +209 -0
- package/dist/cli/verify.js.map +1 -0
- package/dist/cli.d.ts +8 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +262 -0
- package/dist/cli.js.map +1 -0
- package/dist/compiler/agents-compiler.d.ts +24 -0
- package/dist/compiler/agents-compiler.d.ts.map +1 -0
- package/dist/compiler/agents-compiler.js +192 -0
- package/dist/compiler/agents-compiler.js.map +1 -0
- package/dist/compiler/base-compiler.d.ts +152 -0
- package/dist/compiler/base-compiler.d.ts.map +1 -0
- package/dist/compiler/base-compiler.js +180 -0
- package/dist/compiler/base-compiler.js.map +1 -0
- package/dist/compiler/claude-compiler.d.ts +24 -0
- package/dist/compiler/claude-compiler.d.ts.map +1 -0
- package/dist/compiler/claude-compiler.js +182 -0
- package/dist/compiler/claude-compiler.js.map +1 -0
- package/dist/compiler/cursor-compiler.d.ts +33 -0
- package/dist/compiler/cursor-compiler.d.ts.map +1 -0
- package/dist/compiler/cursor-compiler.js +136 -0
- package/dist/compiler/cursor-compiler.js.map +1 -0
- package/dist/compiler/index.d.ts +7 -0
- package/dist/compiler/index.d.ts.map +1 -0
- package/dist/compiler/index.js +24 -0
- package/dist/compiler/index.js.map +1 -0
- package/dist/compiler/rule-selector.d.ts +115 -0
- package/dist/compiler/rule-selector.d.ts.map +1 -0
- package/dist/compiler/rule-selector.js +273 -0
- package/dist/compiler/rule-selector.js.map +1 -0
- package/dist/compiler/token-estimator.d.ts +74 -0
- package/dist/compiler/token-estimator.d.ts.map +1 -0
- package/dist/compiler/token-estimator.js +191 -0
- package/dist/compiler/token-estimator.js.map +1 -0
- package/dist/config/index.d.ts +2 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/index.js +18 -0
- package/dist/config/index.js.map +1 -0
- package/dist/config/loader.d.ts +48 -0
- package/dist/config/loader.d.ts.map +1 -0
- package/dist/config/loader.js +175 -0
- package/dist/config/loader.js.map +1 -0
- package/dist/git/gitignore.d.ts +59 -0
- package/dist/git/gitignore.d.ts.map +1 -0
- package/dist/git/gitignore.js +268 -0
- package/dist/git/gitignore.js.map +1 -0
- package/dist/git/hooks.d.ts +34 -0
- package/dist/git/hooks.d.ts.map +1 -0
- package/dist/git/hooks.js +129 -0
- package/dist/git/hooks.js.map +1 -0
- package/dist/git/husky.d.ts +52 -0
- package/dist/git/husky.d.ts.map +1 -0
- package/dist/git/husky.js +219 -0
- package/dist/git/husky.js.map +1 -0
- package/dist/git/index.d.ts +9 -0
- package/dist/git/index.d.ts.map +1 -0
- package/dist/git/index.js +15 -0
- package/dist/git/index.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +23 -0
- package/dist/index.js.map +1 -0
- package/dist/llm/base-provider.d.ts +43 -0
- package/dist/llm/base-provider.d.ts.map +1 -0
- package/dist/llm/base-provider.js +91 -0
- package/dist/llm/base-provider.js.map +1 -0
- package/dist/llm/index.d.ts +17 -0
- package/dist/llm/index.d.ts.map +1 -0
- package/dist/llm/index.js +36 -0
- package/dist/llm/index.js.map +1 -0
- package/dist/llm/prompts/bootstrap-prompt.d.ts +27 -0
- package/dist/llm/prompts/bootstrap-prompt.d.ts.map +1 -0
- package/dist/llm/prompts/bootstrap-prompt.js +278 -0
- package/dist/llm/prompts/bootstrap-prompt.js.map +1 -0
- package/dist/llm/prompts/index.d.ts +5 -0
- package/dist/llm/prompts/index.d.ts.map +1 -0
- package/dist/llm/prompts/index.js +11 -0
- package/dist/llm/prompts/index.js.map +1 -0
- package/dist/llm/provider-factory.d.ts +27 -0
- package/dist/llm/provider-factory.d.ts.map +1 -0
- package/dist/llm/provider-factory.js +213 -0
- package/dist/llm/provider-factory.js.map +1 -0
- package/dist/llm/providers/claude-api.d.ts +21 -0
- package/dist/llm/providers/claude-api.d.ts.map +1 -0
- package/dist/llm/providers/claude-api.js +110 -0
- package/dist/llm/providers/claude-api.js.map +1 -0
- package/dist/llm/providers/claude-code.d.ts +21 -0
- package/dist/llm/providers/claude-code.d.ts.map +1 -0
- package/dist/llm/providers/claude-code.js +120 -0
- package/dist/llm/providers/claude-code.js.map +1 -0
- package/dist/llm/providers/codex-cli.d.ts +25 -0
- package/dist/llm/providers/codex-cli.d.ts.map +1 -0
- package/dist/llm/providers/codex-cli.js +129 -0
- package/dist/llm/providers/codex-cli.js.map +1 -0
- package/dist/llm/providers/cursor-cli.d.ts +24 -0
- package/dist/llm/providers/cursor-cli.d.ts.map +1 -0
- package/dist/llm/providers/cursor-cli.js +106 -0
- package/dist/llm/providers/cursor-cli.js.map +1 -0
- package/dist/llm/providers/gemini-api.d.ts +20 -0
- package/dist/llm/providers/gemini-api.d.ts.map +1 -0
- package/dist/llm/providers/gemini-api.js +121 -0
- package/dist/llm/providers/gemini-api.js.map +1 -0
- package/dist/llm/providers/gemini-cli.d.ts +20 -0
- package/dist/llm/providers/gemini-cli.d.ts.map +1 -0
- package/dist/llm/providers/gemini-cli.js +109 -0
- package/dist/llm/providers/gemini-cli.js.map +1 -0
- package/dist/llm/providers/interactive.d.ts +42 -0
- package/dist/llm/providers/interactive.d.ts.map +1 -0
- package/dist/llm/providers/interactive.js +200 -0
- package/dist/llm/providers/interactive.js.map +1 -0
- package/dist/llm/providers/openai-api.d.ts +21 -0
- package/dist/llm/providers/openai-api.d.ts.map +1 -0
- package/dist/llm/providers/openai-api.js +107 -0
- package/dist/llm/providers/openai-api.js.map +1 -0
- package/dist/llm/types.d.ts +128 -0
- package/dist/llm/types.d.ts.map +1 -0
- package/dist/llm/types.js +8 -0
- package/dist/llm/types.js.map +1 -0
- package/dist/parser/index.d.ts +3 -0
- package/dist/parser/index.d.ts.map +1 -0
- package/dist/parser/index.js +19 -0
- package/dist/parser/index.js.map +1 -0
- package/dist/parser/path-security.d.ts +40 -0
- package/dist/parser/path-security.d.ts.map +1 -0
- package/dist/parser/path-security.js +183 -0
- package/dist/parser/path-security.js.map +1 -0
- package/dist/parser/rule-parser.d.ts +50 -0
- package/dist/parser/rule-parser.d.ts.map +1 -0
- package/dist/parser/rule-parser.js +203 -0
- package/dist/parser/rule-parser.js.map +1 -0
- package/dist/schemas/config.d.ts +202 -0
- package/dist/schemas/config.d.ts.map +1 -0
- package/dist/schemas/config.js +96 -0
- package/dist/schemas/config.js.map +1 -0
- package/dist/schemas/index.d.ts +3 -0
- package/dist/schemas/index.d.ts.map +1 -0
- package/dist/schemas/index.js +19 -0
- package/dist/schemas/index.js.map +1 -0
- package/dist/schemas/rule.d.ts +67 -0
- package/dist/schemas/rule.d.ts.map +1 -0
- package/dist/schemas/rule.js +44 -0
- package/dist/schemas/rule.js.map +1 -0
- package/package.json +69 -0
- package/templates/architecture.md +35 -0
- package/templates/bootstrap-prompt.md +242 -0
- package/templates/config.yaml +25 -0
- package/templates/project.md +44 -0
- package/templates/rules/example.md +36 -0
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Rule selection strategies for compilation
|
|
3
|
+
*
|
|
4
|
+
* Supports filtering and ordering rules by:
|
|
5
|
+
* - Directory: Include rules from specific directories
|
|
6
|
+
* - Glob: Include rules whose globs match current context
|
|
7
|
+
* - Priority: Order rules by priority, select until budget exhausted
|
|
8
|
+
* - Tag: Include rules with specific tags
|
|
9
|
+
*/
|
|
10
|
+
import { ParsedRule } from '../schemas/rule';
|
|
11
|
+
import { SelectionStrategy } from '../schemas/config';
|
|
12
|
+
/**
|
|
13
|
+
* Selection context for glob-based matching
|
|
14
|
+
*/
|
|
15
|
+
export interface SelectionContext {
|
|
16
|
+
/** Project root directory */
|
|
17
|
+
projectRoot: string;
|
|
18
|
+
/** Files in current context (for glob matching) */
|
|
19
|
+
contextFiles?: string[];
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Selection options for filtering rules
|
|
23
|
+
*/
|
|
24
|
+
export interface SelectionOptions {
|
|
25
|
+
/** Selection strategy */
|
|
26
|
+
strategy: SelectionStrategy;
|
|
27
|
+
/** Directories to include (for 'directory' strategy) */
|
|
28
|
+
includeDirs?: string[];
|
|
29
|
+
/** Tags to include (for 'tag' strategy) */
|
|
30
|
+
includeTags?: string[];
|
|
31
|
+
/** Maximum token budget */
|
|
32
|
+
maxTokens?: number;
|
|
33
|
+
/** Always include these rule IDs */
|
|
34
|
+
alwaysInclude?: string[];
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Result of rule selection
|
|
38
|
+
*/
|
|
39
|
+
export interface SelectionResult {
|
|
40
|
+
/** Selected rules */
|
|
41
|
+
rules: ParsedRule[];
|
|
42
|
+
/** Total estimated tokens */
|
|
43
|
+
totalTokens: number;
|
|
44
|
+
/** Rules excluded due to budget */
|
|
45
|
+
excludedByBudget: ParsedRule[];
|
|
46
|
+
/** Rules excluded by filter */
|
|
47
|
+
excludedByFilter: ParsedRule[];
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Filter rules by directory
|
|
51
|
+
*
|
|
52
|
+
* @param rules - Rules to filter
|
|
53
|
+
* @param includeDirs - Directories to include
|
|
54
|
+
* @returns Filtered rules
|
|
55
|
+
*/
|
|
56
|
+
export declare function filterByDirectory(rules: ParsedRule[], includeDirs: string[]): ParsedRule[];
|
|
57
|
+
/**
|
|
58
|
+
* Filter rules by glob matching against context files
|
|
59
|
+
*
|
|
60
|
+
* @param rules - Rules to filter
|
|
61
|
+
* @param context - Selection context with project root and context files
|
|
62
|
+
* @returns Filtered rules
|
|
63
|
+
*/
|
|
64
|
+
export declare function filterByGlob(rules: ParsedRule[], context: SelectionContext): ParsedRule[];
|
|
65
|
+
/**
|
|
66
|
+
* Filter rules by tag
|
|
67
|
+
*
|
|
68
|
+
* @param rules - Rules to filter
|
|
69
|
+
* @param includeTags - Tags to include (at least one must match)
|
|
70
|
+
* @returns Filtered rules
|
|
71
|
+
*/
|
|
72
|
+
export declare function filterByTag(rules: ParsedRule[], includeTags: string[]): ParsedRule[];
|
|
73
|
+
/**
|
|
74
|
+
* Sort rules by priority (highest first), then alphabetically by ID
|
|
75
|
+
*
|
|
76
|
+
* @param rules - Rules to sort
|
|
77
|
+
* @returns Sorted rules
|
|
78
|
+
*/
|
|
79
|
+
export declare function sortByPriority(rules: ParsedRule[]): ParsedRule[];
|
|
80
|
+
/**
|
|
81
|
+
* Select rules until token budget is exhausted
|
|
82
|
+
*
|
|
83
|
+
* @param rules - Rules to select from (already sorted)
|
|
84
|
+
* @param maxTokens - Maximum token budget
|
|
85
|
+
* @param alwaysIncludeIds - Rule IDs to always include first
|
|
86
|
+
* @returns Selection result with selected rules and metadata
|
|
87
|
+
*/
|
|
88
|
+
export declare function selectByBudget(rules: ParsedRule[], maxTokens: number, alwaysIncludeIds?: string[]): SelectionResult;
|
|
89
|
+
/**
|
|
90
|
+
* Select rules using the specified strategy
|
|
91
|
+
*
|
|
92
|
+
* @param rules - All available rules
|
|
93
|
+
* @param options - Selection options
|
|
94
|
+
* @param context - Selection context
|
|
95
|
+
* @returns Selection result
|
|
96
|
+
*/
|
|
97
|
+
export declare function selectRules(rules: ParsedRule[], options: SelectionOptions, context: SelectionContext): SelectionResult;
|
|
98
|
+
/**
|
|
99
|
+
* Get rules with always_apply flag set to true
|
|
100
|
+
*
|
|
101
|
+
* @param rules - All rules
|
|
102
|
+
* @returns Rules with always_apply: true
|
|
103
|
+
*/
|
|
104
|
+
export declare function getAlwaysApplyRules(rules: ParsedRule[]): ParsedRule[];
|
|
105
|
+
/**
|
|
106
|
+
* Partition rules into always-apply and conditional
|
|
107
|
+
*
|
|
108
|
+
* @param rules - All rules
|
|
109
|
+
* @returns Object with alwaysApply and conditional arrays
|
|
110
|
+
*/
|
|
111
|
+
export declare function partitionRules(rules: ParsedRule[]): {
|
|
112
|
+
alwaysApply: ParsedRule[];
|
|
113
|
+
conditional: ParsedRule[];
|
|
114
|
+
};
|
|
115
|
+
//# sourceMappingURL=rule-selector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rule-selector.d.ts","sourceRoot":"","sources":["../../src/compiler/rule-selector.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAGtD;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,6BAA6B;IAC7B,WAAW,EAAE,MAAM,CAAC;IACpB,mDAAmD;IACnD,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;CACzB;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,yBAAyB;IACzB,QAAQ,EAAE,iBAAiB,CAAC;IAC5B,wDAAwD;IACxD,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;I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,UAAU,EAAE,CAErE;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,UAAU,EAAE,GAAG;IACnD,WAAW,EAAE,UAAU,EAAE,CAAC;IAC1B,WAAW,EAAE,UAAU,EAAE,CAAC;CAC3B,CAaA"}
|
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Rule selection strategies for compilation
|
|
4
|
+
*
|
|
5
|
+
* Supports filtering and ordering rules by:
|
|
6
|
+
* - Directory: Include rules from specific directories
|
|
7
|
+
* - Glob: Include rules whose globs match current context
|
|
8
|
+
* - Priority: Order rules by priority, select until budget exhausted
|
|
9
|
+
* - Tag: Include rules with specific tags
|
|
10
|
+
*/
|
|
11
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
12
|
+
if (k2 === undefined) k2 = k;
|
|
13
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
14
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
15
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
16
|
+
}
|
|
17
|
+
Object.defineProperty(o, k2, desc);
|
|
18
|
+
}) : (function(o, m, k, k2) {
|
|
19
|
+
if (k2 === undefined) k2 = k;
|
|
20
|
+
o[k2] = m[k];
|
|
21
|
+
}));
|
|
22
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
23
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
24
|
+
}) : function(o, v) {
|
|
25
|
+
o["default"] = v;
|
|
26
|
+
});
|
|
27
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
28
|
+
var ownKeys = function(o) {
|
|
29
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
30
|
+
var ar = [];
|
|
31
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
32
|
+
return ar;
|
|
33
|
+
};
|
|
34
|
+
return ownKeys(o);
|
|
35
|
+
};
|
|
36
|
+
return function (mod) {
|
|
37
|
+
if (mod && mod.__esModule) return mod;
|
|
38
|
+
var result = {};
|
|
39
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
40
|
+
__setModuleDefault(result, mod);
|
|
41
|
+
return result;
|
|
42
|
+
};
|
|
43
|
+
})();
|
|
44
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
45
|
+
exports.filterByDirectory = filterByDirectory;
|
|
46
|
+
exports.filterByGlob = filterByGlob;
|
|
47
|
+
exports.filterByTag = filterByTag;
|
|
48
|
+
exports.sortByPriority = sortByPriority;
|
|
49
|
+
exports.selectByBudget = selectByBudget;
|
|
50
|
+
exports.selectRules = selectRules;
|
|
51
|
+
exports.getAlwaysApplyRules = getAlwaysApplyRules;
|
|
52
|
+
exports.partitionRules = partitionRules;
|
|
53
|
+
const path = __importStar(require("path"));
|
|
54
|
+
const minimatch_1 = require("minimatch");
|
|
55
|
+
const token_estimator_1 = require("./token-estimator");
|
|
56
|
+
/**
|
|
57
|
+
* Filter rules by directory
|
|
58
|
+
*
|
|
59
|
+
* @param rules - Rules to filter
|
|
60
|
+
* @param includeDirs - Directories to include
|
|
61
|
+
* @returns Filtered rules
|
|
62
|
+
*/
|
|
63
|
+
function filterByDirectory(rules, includeDirs) {
|
|
64
|
+
if (!includeDirs || includeDirs.length === 0) {
|
|
65
|
+
return rules;
|
|
66
|
+
}
|
|
67
|
+
return rules.filter(rule => {
|
|
68
|
+
const ruleDir = path.dirname(rule.path);
|
|
69
|
+
return includeDirs.some(dir => {
|
|
70
|
+
// Match exact directory or nested subdirectories
|
|
71
|
+
const normalizedDir = dir.replace(/^\/|\/$/g, '');
|
|
72
|
+
const normalizedRuleDir = ruleDir.replace(/^\/|\/$/g, '');
|
|
73
|
+
return normalizedRuleDir === normalizedDir ||
|
|
74
|
+
normalizedRuleDir.startsWith(normalizedDir + '/') ||
|
|
75
|
+
normalizedDir === '.';
|
|
76
|
+
});
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Filter rules by glob matching against context files
|
|
81
|
+
*
|
|
82
|
+
* @param rules - Rules to filter
|
|
83
|
+
* @param context - Selection context with project root and context files
|
|
84
|
+
* @returns Filtered rules
|
|
85
|
+
*/
|
|
86
|
+
function filterByGlob(rules, context) {
|
|
87
|
+
if (!context.contextFiles || context.contextFiles.length === 0) {
|
|
88
|
+
return rules;
|
|
89
|
+
}
|
|
90
|
+
return rules.filter(rule => {
|
|
91
|
+
// Check if any of the rule's globs match any context file
|
|
92
|
+
for (const glob of rule.effectiveGlobs) {
|
|
93
|
+
try {
|
|
94
|
+
// Use minimatch to check if any context file matches the glob
|
|
95
|
+
for (const contextFile of context.contextFiles) {
|
|
96
|
+
if ((0, minimatch_1.minimatch)(contextFile, glob, { matchBase: true })) {
|
|
97
|
+
return true;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
catch {
|
|
102
|
+
// Invalid glob, skip
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
return false;
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Filter rules by tag
|
|
110
|
+
*
|
|
111
|
+
* @param rules - Rules to filter
|
|
112
|
+
* @param includeTags - Tags to include (at least one must match)
|
|
113
|
+
* @returns Filtered rules
|
|
114
|
+
*/
|
|
115
|
+
function filterByTag(rules, includeTags) {
|
|
116
|
+
if (!includeTags || includeTags.length === 0) {
|
|
117
|
+
return rules;
|
|
118
|
+
}
|
|
119
|
+
return rules.filter(rule => {
|
|
120
|
+
const ruleTags = rule.frontmatter.tags || [];
|
|
121
|
+
return ruleTags.some(tag => includeTags.includes(tag));
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Sort rules by priority (highest first), then alphabetically by ID
|
|
126
|
+
*
|
|
127
|
+
* @param rules - Rules to sort
|
|
128
|
+
* @returns Sorted rules
|
|
129
|
+
*/
|
|
130
|
+
function sortByPriority(rules) {
|
|
131
|
+
return [...rules].sort((a, b) => {
|
|
132
|
+
const priorityDiff = b.frontmatter.priority - a.frontmatter.priority;
|
|
133
|
+
if (priorityDiff !== 0) {
|
|
134
|
+
return priorityDiff;
|
|
135
|
+
}
|
|
136
|
+
// Equal priority: sort alphabetically by ID
|
|
137
|
+
return a.frontmatter.id.localeCompare(b.frontmatter.id);
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Select rules until token budget is exhausted
|
|
142
|
+
*
|
|
143
|
+
* @param rules - Rules to select from (already sorted)
|
|
144
|
+
* @param maxTokens - Maximum token budget
|
|
145
|
+
* @param alwaysIncludeIds - Rule IDs to always include first
|
|
146
|
+
* @returns Selection result with selected rules and metadata
|
|
147
|
+
*/
|
|
148
|
+
function selectByBudget(rules, maxTokens, alwaysIncludeIds = []) {
|
|
149
|
+
const effectiveBudget = (0, token_estimator_1.applyBudgetMargin)(maxTokens);
|
|
150
|
+
const selected = [];
|
|
151
|
+
const excludedByBudget = [];
|
|
152
|
+
let totalTokens = 0;
|
|
153
|
+
// First, add always-include rules
|
|
154
|
+
const alwaysInclude = rules.filter(r => alwaysIncludeIds.includes(r.frontmatter.id));
|
|
155
|
+
const remaining = rules.filter(r => !alwaysIncludeIds.includes(r.frontmatter.id));
|
|
156
|
+
for (const rule of alwaysInclude) {
|
|
157
|
+
const tokens = (0, token_estimator_1.estimateTokens)(rule.content).tokens;
|
|
158
|
+
totalTokens += tokens;
|
|
159
|
+
selected.push(rule);
|
|
160
|
+
}
|
|
161
|
+
// Then add remaining rules until budget exhausted
|
|
162
|
+
for (const rule of remaining) {
|
|
163
|
+
const tokens = (0, token_estimator_1.estimateTokens)(rule.content).tokens;
|
|
164
|
+
if (totalTokens + tokens <= effectiveBudget) {
|
|
165
|
+
totalTokens += tokens;
|
|
166
|
+
selected.push(rule);
|
|
167
|
+
}
|
|
168
|
+
else {
|
|
169
|
+
excludedByBudget.push(rule);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
return {
|
|
173
|
+
rules: selected,
|
|
174
|
+
totalTokens,
|
|
175
|
+
excludedByBudget,
|
|
176
|
+
excludedByFilter: [],
|
|
177
|
+
};
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* Select rules using the specified strategy
|
|
181
|
+
*
|
|
182
|
+
* @param rules - All available rules
|
|
183
|
+
* @param options - Selection options
|
|
184
|
+
* @param context - Selection context
|
|
185
|
+
* @returns Selection result
|
|
186
|
+
*/
|
|
187
|
+
function selectRules(rules, options, context) {
|
|
188
|
+
let filtered = [...rules];
|
|
189
|
+
const excludedByFilter = [];
|
|
190
|
+
// Apply strategy-based filtering
|
|
191
|
+
switch (options.strategy) {
|
|
192
|
+
case 'directory':
|
|
193
|
+
if (options.includeDirs) {
|
|
194
|
+
filtered = filterByDirectory(filtered, options.includeDirs);
|
|
195
|
+
excludedByFilter.push(...rules.filter(r => !filtered.includes(r)));
|
|
196
|
+
}
|
|
197
|
+
break;
|
|
198
|
+
case 'glob':
|
|
199
|
+
if (context.contextFiles) {
|
|
200
|
+
filtered = filterByGlob(filtered, context);
|
|
201
|
+
excludedByFilter.push(...rules.filter(r => !filtered.includes(r)));
|
|
202
|
+
}
|
|
203
|
+
break;
|
|
204
|
+
case 'tag':
|
|
205
|
+
if (options.includeTags) {
|
|
206
|
+
filtered = filterByTag(filtered, options.includeTags);
|
|
207
|
+
excludedByFilter.push(...rules.filter(r => !filtered.includes(r)));
|
|
208
|
+
}
|
|
209
|
+
break;
|
|
210
|
+
case 'priority':
|
|
211
|
+
// Priority strategy: sort by priority, no filtering
|
|
212
|
+
break;
|
|
213
|
+
case 'all':
|
|
214
|
+
// Include all rules
|
|
215
|
+
break;
|
|
216
|
+
}
|
|
217
|
+
// Always sort by priority for consistent ordering
|
|
218
|
+
filtered = sortByPriority(filtered);
|
|
219
|
+
// Apply token budget if specified
|
|
220
|
+
if (options.maxTokens !== undefined) {
|
|
221
|
+
// If budget is zero or negative, exclude all rules
|
|
222
|
+
if (options.maxTokens <= 0) {
|
|
223
|
+
return {
|
|
224
|
+
rules: [],
|
|
225
|
+
totalTokens: 0,
|
|
226
|
+
excludedByBudget: filtered,
|
|
227
|
+
excludedByFilter,
|
|
228
|
+
};
|
|
229
|
+
}
|
|
230
|
+
const result = selectByBudget(filtered, options.maxTokens, options.alwaysInclude);
|
|
231
|
+
return {
|
|
232
|
+
...result,
|
|
233
|
+
excludedByFilter,
|
|
234
|
+
};
|
|
235
|
+
}
|
|
236
|
+
// No budget constraint
|
|
237
|
+
const totalTokens = filtered.reduce((sum, rule) => sum + (0, token_estimator_1.estimateTokens)(rule.content).tokens, 0);
|
|
238
|
+
return {
|
|
239
|
+
rules: filtered,
|
|
240
|
+
totalTokens,
|
|
241
|
+
excludedByBudget: [],
|
|
242
|
+
excludedByFilter,
|
|
243
|
+
};
|
|
244
|
+
}
|
|
245
|
+
/**
|
|
246
|
+
* Get rules with always_apply flag set to true
|
|
247
|
+
*
|
|
248
|
+
* @param rules - All rules
|
|
249
|
+
* @returns Rules with always_apply: true
|
|
250
|
+
*/
|
|
251
|
+
function getAlwaysApplyRules(rules) {
|
|
252
|
+
return rules.filter(rule => rule.frontmatter.always_apply === true);
|
|
253
|
+
}
|
|
254
|
+
/**
|
|
255
|
+
* Partition rules into always-apply and conditional
|
|
256
|
+
*
|
|
257
|
+
* @param rules - All rules
|
|
258
|
+
* @returns Object with alwaysApply and conditional arrays
|
|
259
|
+
*/
|
|
260
|
+
function partitionRules(rules) {
|
|
261
|
+
const alwaysApply = [];
|
|
262
|
+
const conditional = [];
|
|
263
|
+
for (const rule of rules) {
|
|
264
|
+
if (rule.frontmatter.always_apply) {
|
|
265
|
+
alwaysApply.push(rule);
|
|
266
|
+
}
|
|
267
|
+
else {
|
|
268
|
+
conditional.push(rule);
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
return { alwaysApply, conditional };
|
|
272
|
+
}
|
|
273
|
+
//# sourceMappingURL=rule-selector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rule-selector.js","sourceRoot":"","sources":["../../src/compiler/rule-selector.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuDH,8CAgBC;AASD,oCAqBC;AASD,kCASC;AAQD,wCASC;AAUD,wCAsCC;AAUD,kCA8EC;AAQD,kDAEC;AAQD,wCAgBC;AAhTD,2CAA6B;AAC7B,yCAAsC;AAGtC,uDAAsE;AA0CtE;;;;;;GAMG;AACH,SAAgB,iBAAiB,CAAC,KAAmB,EAAE,WAAqB;IAC1E,IAAI,CAAC,WAAW,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC7C,OAAO,KAAK,CAAC;IACf,CAAC;IAED,OAAO,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE;QACzB,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACxC,OAAO,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE;YAC5B,iDAAiD;YACjD,MAAM,aAAa,GAAG,GAAG,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;YAClD,MAAM,iBAAiB,GAAG,OAAO,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;YAC1D,OAAO,iBAAiB,KAAK,aAAa;gBACnC,iBAAiB,CAAC,UAAU,CAAC,aAAa,GAAG,GAAG,CAAC;gBACjD,aAAa,KAAK,GAAG,CAAC;QAC/B,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC;AAED;;;;;;GAMG;AACH,SAAgB,YAAY,CAAC,KAAmB,EAAE,OAAyB;IACzE,IAAI,CA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,OAAO,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,YAAY,KAAK,IAAI,CAAC,CAAC;AACtE,CAAC;AAED;;;;;GAKG;AACH,SAAgB,cAAc,CAAC,KAAmB;IAIhD,MAAM,WAAW,GAAiB,EAAE,CAAC;IACrC,MAAM,WAAW,GAAiB,EAAE,CAAC;IAErC,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,IAAI,IAAI,CAAC,WAAW,CAAC,YAAY,EAAE,CAAC;YAClC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACzB,CAAC;aAAM,CAAC;YACN,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACzB,CAAC;IACH,CAAC;IAED,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,CAAC;AACtC,CAAC"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Content-aware token estimation for AI context budget control
|
|
3
|
+
*
|
|
4
|
+
* Uses character-to-token ratios based on content type:
|
|
5
|
+
* - Prose (English text): 3.5 chars/token
|
|
6
|
+
* - Code (programming languages): 2.5 chars/token
|
|
7
|
+
* - Mixed content: 3.0 chars/token
|
|
8
|
+
* - CJK (Chinese, Japanese, Korean): 1.5 chars/token
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Content type for token estimation
|
|
12
|
+
*/
|
|
13
|
+
export type ContentType = 'prose' | 'code' | 'mixed' | 'cjk';
|
|
14
|
+
/**
|
|
15
|
+
* Token estimation result
|
|
16
|
+
*/
|
|
17
|
+
export interface TokenEstimation {
|
|
18
|
+
/** Estimated token count */
|
|
19
|
+
tokens: number;
|
|
20
|
+
/** Detected content type */
|
|
21
|
+
contentType: ContentType;
|
|
22
|
+
/** Character count */
|
|
23
|
+
characters: number;
|
|
24
|
+
/** Ratio used for estimation */
|
|
25
|
+
ratio: number;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Detect content type from text content
|
|
29
|
+
*
|
|
30
|
+
* @param content - Text content to analyze
|
|
31
|
+
* @returns Detected content type
|
|
32
|
+
*/
|
|
33
|
+
export declare function detectContentType(content: string): ContentType;
|
|
34
|
+
/**
|
|
35
|
+
* Estimate token count for content
|
|
36
|
+
*
|
|
37
|
+
* @param content - Text content to estimate
|
|
38
|
+
* @returns Token estimation with count, type, and ratio
|
|
39
|
+
*/
|
|
40
|
+
export declare function estimateTokens(content: string): TokenEstimation;
|
|
41
|
+
/**
|
|
42
|
+
* Estimate tokens with a specific content type override
|
|
43
|
+
*
|
|
44
|
+
* @param content - Text content to estimate
|
|
45
|
+
* @param contentType - Override content type
|
|
46
|
+
* @returns Token estimation
|
|
47
|
+
*/
|
|
48
|
+
export declare function estimateTokensWithType(content: string, contentType: ContentType): TokenEstimation;
|
|
49
|
+
/**
|
|
50
|
+
* Apply budget margin for metadata overhead
|
|
51
|
+
*
|
|
52
|
+
* @param budget - Original token budget
|
|
53
|
+
* @param marginPercent - Margin percentage (default: 5%)
|
|
54
|
+
* @returns Effective budget after margin
|
|
55
|
+
*/
|
|
56
|
+
export declare function applyBudgetMargin(budget: number, marginPercent?: number): number;
|
|
57
|
+
/**
|
|
58
|
+
* Check if adding content would exceed budget
|
|
59
|
+
*
|
|
60
|
+
* @param currentTokens - Current token count
|
|
61
|
+
* @param additionalContent - Content to add
|
|
62
|
+
* @param budget - Token budget
|
|
63
|
+
* @param marginPercent - Margin percentage (default: 5%)
|
|
64
|
+
* @returns true if budget would be exceeded
|
|
65
|
+
*/
|
|
66
|
+
export declare function wouldExceedBudget(currentTokens: number, additionalContent: string, budget: number, marginPercent?: number): boolean;
|
|
67
|
+
/**
|
|
68
|
+
* Get the character-to-token ratio for a content type
|
|
69
|
+
*
|
|
70
|
+
* @param contentType - Content type
|
|
71
|
+
* @returns Character-to-token ratio
|
|
72
|
+
*/
|
|
73
|
+
export declare function getRatio(contentType: ContentType): number;
|
|
74
|
+
//# sourceMappingURL=token-estimator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"token-estimator.d.ts","sourceRoot":"","sources":["../../src/compiler/token-estimator.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,MAAM,GAAG,OAAO,GAAG,KAAK,CAAC;AAE7D;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,4BAA4B;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,4BAA4B;IAC5B,WAAW,EAAE,WAAW,CAAC;IACzB,sBAAsB;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,gCAAgC;IAChC,KAAK,EAAE,MAAM,CAAC;CACf;AAmDD;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,WAAW,CAoD9D;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,eAAe,CAsB/D;AAED;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,WAAW,GAAG,eAAe,CAWjG;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,EAAE,aAAa,GAAE,MAAU,GAAG,MAAM,CAEnF;AAED;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAC/B,aAAa,EAAE,MAAM,EACrB,iBAAiB,EAAE,MAAM,EACzB,MAAM,EAAE,MAAM,EACd,aAAa,GAAE,MAAU,GACxB,OAAO,CAIT;AAED;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,WAAW,EAAE,WAAW,GAAG,MAAM,CAEzD"}
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Content-aware token estimation for AI context budget control
|
|
4
|
+
*
|
|
5
|
+
* Uses character-to-token ratios based on content type:
|
|
6
|
+
* - Prose (English text): 3.5 chars/token
|
|
7
|
+
* - Code (programming languages): 2.5 chars/token
|
|
8
|
+
* - Mixed content: 3.0 chars/token
|
|
9
|
+
* - CJK (Chinese, Japanese, Korean): 1.5 chars/token
|
|
10
|
+
*/
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.detectContentType = detectContentType;
|
|
13
|
+
exports.estimateTokens = estimateTokens;
|
|
14
|
+
exports.estimateTokensWithType = estimateTokensWithType;
|
|
15
|
+
exports.applyBudgetMargin = applyBudgetMargin;
|
|
16
|
+
exports.wouldExceedBudget = wouldExceedBudget;
|
|
17
|
+
exports.getRatio = getRatio;
|
|
18
|
+
/**
|
|
19
|
+
* Character-to-token ratios by content type
|
|
20
|
+
*/
|
|
21
|
+
const TOKEN_RATIOS = {
|
|
22
|
+
prose: 3.5,
|
|
23
|
+
code: 2.5,
|
|
24
|
+
mixed: 3.0,
|
|
25
|
+
cjk: 1.5,
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* Code indicators for content type detection
|
|
29
|
+
*/
|
|
30
|
+
const CODE_INDICATORS = [
|
|
31
|
+
/\bimport\s+/,
|
|
32
|
+
/\bexport\s+/,
|
|
33
|
+
/\bfunction\s+/,
|
|
34
|
+
/\bclass\s+/,
|
|
35
|
+
/\bconst\s+/,
|
|
36
|
+
/\blet\s+/,
|
|
37
|
+
/\bvar\s+/,
|
|
38
|
+
/\bdef\s+/,
|
|
39
|
+
/\basync\s+/,
|
|
40
|
+
/=>/,
|
|
41
|
+
/\breturn\s+/,
|
|
42
|
+
/\bif\s*\(/,
|
|
43
|
+
/\bfor\s*\(/,
|
|
44
|
+
/\bwhile\s*\(/,
|
|
45
|
+
/\bswitch\s*\(/,
|
|
46
|
+
/\{\s*$/m,
|
|
47
|
+
/^\s*\}/m,
|
|
48
|
+
];
|
|
49
|
+
/**
|
|
50
|
+
* CJK Unicode ranges
|
|
51
|
+
* - CJK Unified Ideographs: U+4E00-U+9FFF
|
|
52
|
+
* - CJK Extension A: U+3400-U+4DBF
|
|
53
|
+
* - Hiragana: U+3040-U+309F
|
|
54
|
+
* - Katakana: U+30A0-U+30FF
|
|
55
|
+
* - Hangul Syllables: U+AC00-U+D7AF
|
|
56
|
+
*/
|
|
57
|
+
const CJK_PATTERN = /[\u4E00-\u9FFF\u3400-\u4DBF\u3040-\u309F\u30A0-\u30FF\uAC00-\uD7AF]/g;
|
|
58
|
+
/**
|
|
59
|
+
* Threshold for content type detection (percentage of content)
|
|
60
|
+
*/
|
|
61
|
+
const CODE_INDICATOR_THRESHOLD = 3; // Minimum matches to consider code
|
|
62
|
+
const CJK_RATIO_THRESHOLD = 0.3; // 30% CJK characters
|
|
63
|
+
/**
|
|
64
|
+
* Detect content type from text content
|
|
65
|
+
*
|
|
66
|
+
* @param content - Text content to analyze
|
|
67
|
+
* @returns Detected content type
|
|
68
|
+
*/
|
|
69
|
+
function detectContentType(content) {
|
|
70
|
+
if (!content || content.length === 0) {
|
|
71
|
+
return 'mixed';
|
|
72
|
+
}
|
|
73
|
+
// Check for CJK content first
|
|
74
|
+
const cjkMatches = content.match(CJK_PATTERN) || [];
|
|
75
|
+
const cjkRatio = cjkMatches.length / content.length;
|
|
76
|
+
if (cjkRatio >= CJK_RATIO_THRESHOLD) {
|
|
77
|
+
return 'cjk';
|
|
78
|
+
}
|
|
79
|
+
// Count code indicators
|
|
80
|
+
let codeIndicatorCount = 0;
|
|
81
|
+
for (const indicator of CODE_INDICATORS) {
|
|
82
|
+
const matches = content.match(new RegExp(indicator, 'g')) || [];
|
|
83
|
+
codeIndicatorCount += matches.length;
|
|
84
|
+
}
|
|
85
|
+
// If enough code indicators, consider it code
|
|
86
|
+
if (codeIndicatorCount >= CODE_INDICATOR_THRESHOLD) {
|
|
87
|
+
return 'code';
|
|
88
|
+
}
|
|
89
|
+
// Check if it looks like markdown prose
|
|
90
|
+
const lines = content.split('\n');
|
|
91
|
+
const proseIndicators = [
|
|
92
|
+
/^#+\s+/, // Markdown headers
|
|
93
|
+
/^\s*[-*]\s+/, // Bullet points
|
|
94
|
+
/^\d+\.\s+/, // Numbered lists
|
|
95
|
+
/\*\*[^*]+\*\*/, // Bold text
|
|
96
|
+
/\*[^*]+\*/, // Italic text
|
|
97
|
+
];
|
|
98
|
+
let proseCount = 0;
|
|
99
|
+
for (const line of lines) {
|
|
100
|
+
for (const indicator of proseIndicators) {
|
|
101
|
+
if (indicator.test(line)) {
|
|
102
|
+
proseCount++;
|
|
103
|
+
break;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
// If significant prose indicators and low code indicators
|
|
108
|
+
if (proseCount >= 3 && codeIndicatorCount < CODE_INDICATOR_THRESHOLD) {
|
|
109
|
+
return 'prose';
|
|
110
|
+
}
|
|
111
|
+
// Default to mixed
|
|
112
|
+
return 'mixed';
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Estimate token count for content
|
|
116
|
+
*
|
|
117
|
+
* @param content - Text content to estimate
|
|
118
|
+
* @returns Token estimation with count, type, and ratio
|
|
119
|
+
*/
|
|
120
|
+
function estimateTokens(content) {
|
|
121
|
+
const characters = content.length;
|
|
122
|
+
if (characters === 0) {
|
|
123
|
+
return {
|
|
124
|
+
tokens: 0,
|
|
125
|
+
contentType: 'mixed',
|
|
126
|
+
characters: 0,
|
|
127
|
+
ratio: TOKEN_RATIOS.mixed,
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
const contentType = detectContentType(content);
|
|
131
|
+
const ratio = TOKEN_RATIOS[contentType];
|
|
132
|
+
const tokens = Math.ceil(characters / ratio);
|
|
133
|
+
return {
|
|
134
|
+
tokens,
|
|
135
|
+
contentType,
|
|
136
|
+
characters,
|
|
137
|
+
ratio,
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Estimate tokens with a specific content type override
|
|
142
|
+
*
|
|
143
|
+
* @param content - Text content to estimate
|
|
144
|
+
* @param contentType - Override content type
|
|
145
|
+
* @returns Token estimation
|
|
146
|
+
*/
|
|
147
|
+
function estimateTokensWithType(content, contentType) {
|
|
148
|
+
const characters = content.length;
|
|
149
|
+
const ratio = TOKEN_RATIOS[contentType];
|
|
150
|
+
const tokens = Math.ceil(characters / ratio);
|
|
151
|
+
return {
|
|
152
|
+
tokens,
|
|
153
|
+
contentType,
|
|
154
|
+
characters,
|
|
155
|
+
ratio,
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Apply budget margin for metadata overhead
|
|
160
|
+
*
|
|
161
|
+
* @param budget - Original token budget
|
|
162
|
+
* @param marginPercent - Margin percentage (default: 5%)
|
|
163
|
+
* @returns Effective budget after margin
|
|
164
|
+
*/
|
|
165
|
+
function applyBudgetMargin(budget, marginPercent = 5) {
|
|
166
|
+
return Math.floor(budget * (1 - marginPercent / 100));
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* Check if adding content would exceed budget
|
|
170
|
+
*
|
|
171
|
+
* @param currentTokens - Current token count
|
|
172
|
+
* @param additionalContent - Content to add
|
|
173
|
+
* @param budget - Token budget
|
|
174
|
+
* @param marginPercent - Margin percentage (default: 5%)
|
|
175
|
+
* @returns true if budget would be exceeded
|
|
176
|
+
*/
|
|
177
|
+
function wouldExceedBudget(currentTokens, additionalContent, budget, marginPercent = 5) {
|
|
178
|
+
const effectiveBudget = applyBudgetMargin(budget, marginPercent);
|
|
179
|
+
const additionalTokens = estimateTokens(additionalContent).tokens;
|
|
180
|
+
return currentTokens + additionalTokens > effectiveBudget;
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* Get the character-to-token ratio for a content type
|
|
184
|
+
*
|
|
185
|
+
* @param contentType - Content type
|
|
186
|
+
* @returns Character-to-token ratio
|
|
187
|
+
*/
|
|
188
|
+
function getRatio(contentType) {
|
|
189
|
+
return TOKEN_RATIOS[contentType];
|
|
190
|
+
}
|
|
191
|
+
//# sourceMappingURL=token-estimator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"token-estimator.js","sourceRoot":"","sources":["../../src/compiler/token-estimator.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;AA4EH,8CAoDC;AAQD,wCAsBC;AASD,wDAWC;AASD,8CAEC;AAWD,8CASC;AAQD,4BAEC;AAtMD;;GAEG;AACH,MAAM,YAAY,GAAgC;IAChD,KAAK,EAAE,GAAG;IACV,IAAI,EAAE,GAAG;IACT,KAAK,EAAE,GAAG;IACV,GAAG,EAAE,GAAG;CACT,CAAC;AAEF;;GAEG;AACH,MAAM,eAAe,GAAG;IACtB,aAAa;IACb,aAAa;IACb,eAAe;IACf,YAAY;IACZ,YAAY;IACZ,UAAU;IACV,UAAU;IACV,UAAU;IACV,YAAY;IACZ,IAAI;IACJ,aAAa;IACb,WAAW;IACX,YAAY;IACZ,cAAc;IACd,eAAe;IACf,SAAS;IACT,SAAS;CACV,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,WAAW,GAAG,sEAAsE,CAAC;AAE3F;;GAEG;AACH,MAAM,wBAAwB,GAAG,CAAC,CAAC,CAAE,mCAAmC;AACxE,MAAM,mBAAmB,GAAG,GAAG,CAAC,CAAK,qBAAqB;AAE1D;;;;;GAKG;AACH,SAAgB,iBAAiB,CAAC,OAAe;IAC/C,IAAI,CAAC,OAAO,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACrC,OAAO,OAAO,CAAC;IACjB,CAAC;IAED,8BAA8B;IAC9B,MAAM,UAAU,GAAG,OAAO,CAAC,KAAK,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC;IACpD,MAAM,QAAQ,GAAG,UAAU,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAEpD,IAAI,QAAQ,IAAI,mBAAmB,EAAE,CAAC;QACpC,OAAO,KAAK,CAAC;IACf,CAAC;IAED,wBAAwB;IACxB,IAAI,kBAAkB,GAAG,CAAC,CAAC;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