aspectcode 0.3.4 → 0.4.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/dist/cli.d.ts +1 -2
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +1 -2
- package/dist/cli.js.map +1 -1
- package/dist/config.d.ts +0 -2
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js.map +1 -1
- package/dist/diffSummary.d.ts +17 -0
- package/dist/diffSummary.d.ts.map +1 -0
- package/dist/diffSummary.js +49 -0
- package/dist/diffSummary.js.map +1 -0
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +13 -16
- package/dist/main.js.map +1 -1
- package/dist/optimize.d.ts +6 -3
- package/dist/optimize.d.ts.map +1 -1
- package/dist/optimize.js +85 -102
- package/dist/optimize.js.map +1 -1
- package/dist/pipeline.d.ts +5 -4
- package/dist/pipeline.d.ts.map +1 -1
- package/dist/pipeline.js +45 -10
- package/dist/pipeline.js.map +1 -1
- package/dist/summary.d.ts +15 -0
- package/dist/summary.d.ts.map +1 -0
- package/dist/summary.js +51 -0
- package/dist/summary.js.map +1 -0
- package/dist/ui/Dashboard.d.ts +15 -7
- package/dist/ui/Dashboard.d.ts.map +1 -1
- package/dist/ui/Dashboard.js +55 -24
- package/dist/ui/Dashboard.js.map +1 -1
- package/dist/ui/store.d.ts +33 -0
- package/dist/ui/store.d.ts.map +1 -1
- package/dist/ui/store.js +24 -1
- package/dist/ui/store.js.map +1 -1
- package/dist/ui/theme.d.ts +3 -3
- package/dist/ui/theme.js +3 -3
- package/dist/ui/theme.js.map +1 -1
- package/node_modules/@aspectcode/evaluator/dist/diagnosis.d.ts +33 -0
- package/node_modules/@aspectcode/evaluator/dist/diagnosis.d.ts.map +1 -0
- package/node_modules/@aspectcode/evaluator/dist/diagnosis.js +172 -0
- package/node_modules/@aspectcode/evaluator/dist/diagnosis.js.map +1 -0
- package/node_modules/@aspectcode/evaluator/dist/harvest/aider.d.ts +23 -0
- package/node_modules/@aspectcode/evaluator/dist/harvest/aider.d.ts.map +1 -0
- package/node_modules/@aspectcode/evaluator/dist/harvest/aider.js +125 -0
- package/node_modules/@aspectcode/evaluator/dist/harvest/aider.js.map +1 -0
- package/node_modules/@aspectcode/evaluator/dist/harvest/claudeCode.d.ts +17 -0
- package/node_modules/@aspectcode/evaluator/dist/harvest/claudeCode.d.ts.map +1 -0
- package/node_modules/@aspectcode/evaluator/dist/harvest/claudeCode.js +223 -0
- package/node_modules/@aspectcode/evaluator/dist/harvest/claudeCode.js.map +1 -0
- package/node_modules/@aspectcode/evaluator/dist/harvest/cline.d.ts +17 -0
- package/node_modules/@aspectcode/evaluator/dist/harvest/cline.d.ts.map +1 -0
- package/node_modules/@aspectcode/evaluator/dist/harvest/cline.js +179 -0
- package/node_modules/@aspectcode/evaluator/dist/harvest/cline.js.map +1 -0
- package/node_modules/@aspectcode/evaluator/dist/harvest/common.d.ts +39 -0
- package/node_modules/@aspectcode/evaluator/dist/harvest/common.d.ts.map +1 -0
- package/node_modules/@aspectcode/evaluator/dist/harvest/common.js +170 -0
- package/node_modules/@aspectcode/evaluator/dist/harvest/common.js.map +1 -0
- package/node_modules/@aspectcode/evaluator/dist/harvest/export.d.ts +23 -0
- package/node_modules/@aspectcode/evaluator/dist/harvest/export.d.ts.map +1 -0
- package/node_modules/@aspectcode/evaluator/dist/harvest/export.js +98 -0
- package/node_modules/@aspectcode/evaluator/dist/harvest/export.js.map +1 -0
- package/node_modules/@aspectcode/evaluator/dist/harvest/index.d.ts +29 -0
- package/node_modules/@aspectcode/evaluator/dist/harvest/index.d.ts.map +1 -0
- package/node_modules/@aspectcode/evaluator/dist/harvest/index.js +94 -0
- package/node_modules/@aspectcode/evaluator/dist/harvest/index.js.map +1 -0
- package/node_modules/@aspectcode/evaluator/dist/harvest/vscodeDb.d.ts +37 -0
- package/node_modules/@aspectcode/evaluator/dist/harvest/vscodeDb.d.ts.map +1 -0
- package/node_modules/@aspectcode/evaluator/dist/harvest/vscodeDb.js +473 -0
- package/node_modules/@aspectcode/evaluator/dist/harvest/vscodeDb.js.map +1 -0
- package/node_modules/@aspectcode/evaluator/dist/index.d.ts +49 -0
- package/node_modules/@aspectcode/evaluator/dist/index.d.ts.map +1 -0
- package/node_modules/@aspectcode/evaluator/dist/index.js +75 -0
- package/node_modules/@aspectcode/evaluator/dist/index.js.map +1 -0
- package/node_modules/@aspectcode/evaluator/dist/probes.d.ts +38 -0
- package/node_modules/@aspectcode/evaluator/dist/probes.d.ts.map +1 -0
- package/node_modules/@aspectcode/evaluator/dist/probes.js +229 -0
- package/node_modules/@aspectcode/evaluator/dist/probes.js.map +1 -0
- package/node_modules/@aspectcode/evaluator/dist/runner.d.ts +44 -0
- package/node_modules/@aspectcode/evaluator/dist/runner.d.ts.map +1 -0
- package/node_modules/@aspectcode/evaluator/dist/runner.js +186 -0
- package/node_modules/@aspectcode/evaluator/dist/runner.js.map +1 -0
- package/node_modules/@aspectcode/evaluator/dist/types.d.ts +176 -0
- package/node_modules/@aspectcode/evaluator/dist/types.d.ts.map +1 -0
- package/node_modules/@aspectcode/evaluator/dist/types.js +9 -0
- package/node_modules/@aspectcode/evaluator/dist/types.js.map +1 -0
- package/node_modules/@aspectcode/evaluator/package.json +41 -0
- package/node_modules/@aspectcode/optimizer/dist/agent.d.ts +12 -13
- package/node_modules/@aspectcode/optimizer/dist/agent.d.ts.map +1 -1
- package/node_modules/@aspectcode/optimizer/dist/agent.js +52 -110
- package/node_modules/@aspectcode/optimizer/dist/agent.js.map +1 -1
- package/node_modules/@aspectcode/optimizer/dist/index.d.ts +3 -3
- package/node_modules/@aspectcode/optimizer/dist/index.d.ts.map +1 -1
- package/node_modules/@aspectcode/optimizer/dist/index.js +3 -5
- package/node_modules/@aspectcode/optimizer/dist/index.js.map +1 -1
- package/node_modules/@aspectcode/optimizer/dist/prompts.d.ts +8 -21
- package/node_modules/@aspectcode/optimizer/dist/prompts.d.ts.map +1 -1
- package/node_modules/@aspectcode/optimizer/dist/prompts.js +36 -94
- package/node_modules/@aspectcode/optimizer/dist/prompts.js.map +1 -1
- package/node_modules/@aspectcode/optimizer/dist/providers/anthropic.d.ts.map +1 -1
- package/node_modules/@aspectcode/optimizer/dist/providers/anthropic.js +10 -1
- package/node_modules/@aspectcode/optimizer/dist/providers/anthropic.js.map +1 -1
- package/node_modules/@aspectcode/optimizer/dist/providers/openai.d.ts.map +1 -1
- package/node_modules/@aspectcode/optimizer/dist/providers/openai.js +10 -1
- package/node_modules/@aspectcode/optimizer/dist/providers/openai.js.map +1 -1
- package/node_modules/@aspectcode/optimizer/dist/types.d.ts +33 -24
- package/node_modules/@aspectcode/optimizer/dist/types.d.ts.map +1 -1
- package/node_modules/@aspectcode/optimizer/dist/types.js.map +1 -1
- package/node_modules/@aspectcode/optimizer/package.json +2 -2
- package/package.json +4 -3
|
@@ -1,18 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
|
-
* Prompt templates for the
|
|
3
|
+
* Prompt templates for the generation agent.
|
|
4
4
|
*
|
|
5
|
-
*
|
|
5
|
+
* Two prompts:
|
|
6
6
|
* 1. System prompt — sets context with KB content.
|
|
7
|
-
* 2.
|
|
8
|
-
* 3. Eval prompt — asks the LLM to score and critique a candidate.
|
|
7
|
+
* 2. Generate prompt — asks the LLM to generate AGENTS.md from scratch using KB.
|
|
9
8
|
*/
|
|
10
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
10
|
exports.truncateKb = truncateKb;
|
|
12
11
|
exports.buildSystemPrompt = buildSystemPrompt;
|
|
13
|
-
exports.
|
|
14
|
-
exports.buildEvalPrompt = buildEvalPrompt;
|
|
15
|
-
exports.parseEvalResponse = parseEvalResponse;
|
|
12
|
+
exports.buildGeneratePrompt = buildGeneratePrompt;
|
|
16
13
|
exports.buildComplaintPrompt = buildComplaintPrompt;
|
|
17
14
|
exports.parseComplaintResponse = parseComplaintResponse;
|
|
18
15
|
/** Default maximum KB characters to include before truncation. */
|
|
@@ -40,18 +37,19 @@ function truncateKb(kb, charBudget = DEFAULT_KB_CHAR_BUDGET) {
|
|
|
40
37
|
*/
|
|
41
38
|
function buildSystemPrompt(kb, kbCharBudget, toolInstructions) {
|
|
42
39
|
const trimmedKb = truncateKb(kb, kbCharBudget);
|
|
43
|
-
let prompt = `You are an expert AI coding assistant instruction
|
|
40
|
+
let prompt = `You are an expert AI coding assistant instruction author.
|
|
44
41
|
|
|
45
|
-
Your job is to
|
|
46
|
-
|
|
42
|
+
Your job is to generate AGENTS.md — the guidelines that AI coding assistants
|
|
43
|
+
follow when working in a codebase. You author these instructions from scratch
|
|
47
44
|
so they are maximally useful, precise, and aligned with the actual codebase.
|
|
48
45
|
|
|
49
|
-
Below is the project's internal knowledge base
|
|
50
|
-
reference to understand the codebase — but NEVER
|
|
51
|
-
The AI assistant reading AGENTS.md will NOT have
|
|
52
|
-
Map section, symbol index, or any other external
|
|
53
|
-
guidance (file paths, naming conventions, key
|
|
54
|
-
must be written directly as self-contained
|
|
46
|
+
Below is the project's internal knowledge base generated by static analysis.
|
|
47
|
+
Use it as YOUR private reference to understand the codebase — but NEVER
|
|
48
|
+
reference it in the output. The AI assistant reading AGENTS.md will NOT have
|
|
49
|
+
access to the knowledge base, Map section, symbol index, or any other external
|
|
50
|
+
document. All codebase-specific guidance (file paths, naming conventions, key
|
|
51
|
+
modules, architectural patterns) must be written directly as self-contained
|
|
52
|
+
rules inside AGENTS.md.
|
|
55
53
|
|
|
56
54
|
Forbidden in output:
|
|
57
55
|
- References to "the Map", "the KB", "the knowledge base", "the Context section"
|
|
@@ -75,94 +73,38 @@ ${toolInstructions}`;
|
|
|
75
73
|
return prompt;
|
|
76
74
|
}
|
|
77
75
|
/**
|
|
78
|
-
* Build the user prompt for
|
|
76
|
+
* Build the user prompt for AGENTS.md generation.
|
|
79
77
|
*
|
|
80
|
-
*
|
|
81
|
-
*
|
|
78
|
+
* Asks the LLM to generate AGENTS.md from scratch using the KB
|
|
79
|
+
* (static analysis) provided in the system prompt as context.
|
|
80
|
+
* Optionally includes a KB diff for incremental regeneration.
|
|
82
81
|
*/
|
|
83
|
-
function
|
|
84
|
-
let prompt = `
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
-
|
|
94
|
-
|
|
95
|
-
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
82
|
+
function buildGeneratePrompt(kbDiff) {
|
|
83
|
+
let prompt = `Generate AGENTS.md instructions from scratch for this codebase.
|
|
84
|
+
Use the knowledge base in the system prompt to understand the project, then
|
|
85
|
+
produce specific, actionable coding guidelines tailored to THIS codebase.
|
|
86
|
+
|
|
87
|
+
## Requirements
|
|
88
|
+
- Structure the output with clear sections: a brief project overview, golden rules,
|
|
89
|
+
a recommended workflow, code-change guidelines, and troubleshooting tips.
|
|
90
|
+
- Make every rule specific to THIS codebase. Inline actual file paths, naming conventions,
|
|
91
|
+
key modules, architecture patterns, entry points, and high-risk hubs.
|
|
92
|
+
- Derive all project-specific details from the knowledge base — but NEVER reference the
|
|
93
|
+
knowledge base, Map, KB, or any external document in the output.
|
|
94
|
+
- AGENTS.md must be fully self-contained — the AI reading it has no other reference.
|
|
95
|
+
- Remove generic advice that any developer already knows. Every line should earn its place.
|
|
96
|
+
- Be concise but comprehensive — cover architecture, conventions, risk zones, and workflows.
|
|
97
|
+
- Output ONLY the instruction content (no explanations, preamble, or markdown fences).`;
|
|
99
98
|
if (kbDiff) {
|
|
100
99
|
prompt += `
|
|
101
100
|
|
|
102
101
|
## Recent KB Changes (diff)
|
|
103
|
-
The following diff shows what changed in the
|
|
104
|
-
Focus
|
|
102
|
+
The following diff shows what changed in the codebase since the last generation.
|
|
103
|
+
Focus on areas affected by these changes:
|
|
105
104
|
${kbDiff}`;
|
|
106
|
-
}
|
|
107
|
-
if (priorFeedback) {
|
|
108
|
-
prompt += `
|
|
109
|
-
|
|
110
|
-
## Prior Evaluation Feedback
|
|
111
|
-
A previous iteration received this feedback. Address these points:
|
|
112
|
-
${priorFeedback}`;
|
|
113
105
|
}
|
|
114
106
|
return prompt;
|
|
115
107
|
}
|
|
116
|
-
/**
|
|
117
|
-
* Build the evaluation prompt that asks the LLM to score and critique
|
|
118
|
-
* a candidate set of instructions.
|
|
119
|
-
*/
|
|
120
|
-
function buildEvalPrompt(candidateInstructions, kb, kbCharBudget) {
|
|
121
|
-
const trimmedKb = truncateKb(kb, kbCharBudget);
|
|
122
|
-
return `You are evaluating AI coding assistant instructions (AGENTS.md) for quality.
|
|
123
|
-
|
|
124
|
-
Score the following candidate instructions on a scale of 1–10 based on:
|
|
125
|
-
1. **Specificity** — Are rules grounded in the actual codebase (real file paths, real patterns), not generic?
|
|
126
|
-
2. **Actionability** — Can an AI assistant follow each rule unambiguously?
|
|
127
|
-
3. **Completeness** — Are key architectural patterns and conventions covered?
|
|
128
|
-
4. **Conciseness** — Is every line valuable, with no filler?
|
|
129
|
-
5. **Self-contained** — Are ALL rules fully inline? The AI reading AGENTS.md will NOT have
|
|
130
|
-
access to any external document. Penalize any reference to "the Map", "the KB",
|
|
131
|
-
"the knowledge base", "kb.md", "the symbol index", or similar external documents.
|
|
132
|
-
|
|
133
|
-
Respond in EXACTLY this format (no other text):
|
|
134
|
-
SCORE: <number 1-10>
|
|
135
|
-
FEEDBACK: <one paragraph of overall assessment>
|
|
136
|
-
SUGGESTIONS:
|
|
137
|
-
- <specific improvement 1>
|
|
138
|
-
- <specific improvement 2>
|
|
139
|
-
- <specific improvement 3>
|
|
140
|
-
|
|
141
|
-
## Knowledge Base (private reference — do not expect in output)
|
|
142
|
-
${trimmedKb}
|
|
143
|
-
|
|
144
|
-
## Candidate Instructions
|
|
145
|
-
${candidateInstructions}`;
|
|
146
|
-
}
|
|
147
|
-
/**
|
|
148
|
-
* Parse the structured evaluation response into an EvalResult.
|
|
149
|
-
*/
|
|
150
|
-
function parseEvalResponse(response) {
|
|
151
|
-
const scoreMatch = response.match(/SCORE:\s*(\d+)/i);
|
|
152
|
-
const score = scoreMatch ? Math.min(10, Math.max(1, parseInt(scoreMatch[1], 10))) : 5;
|
|
153
|
-
const feedbackMatch = response.match(/FEEDBACK:\s*(.+?)(?=SUGGESTIONS:|$)/is);
|
|
154
|
-
const feedback = feedbackMatch ? feedbackMatch[1].trim() : 'No feedback provided.';
|
|
155
|
-
const suggestionsMatch = response.match(/SUGGESTIONS:\s*([\s\S]*)/i);
|
|
156
|
-
const suggestions = [];
|
|
157
|
-
if (suggestionsMatch) {
|
|
158
|
-
for (const line of suggestionsMatch[1].split('\n')) {
|
|
159
|
-
const trimmed = line.replace(/^[-*]\s*/, '').trim();
|
|
160
|
-
if (trimmed)
|
|
161
|
-
suggestions.push(trimmed);
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
return { score, feedback, suggestions };
|
|
165
|
-
}
|
|
166
108
|
// ── Complaint-driven prompts ─────────────────────────────────
|
|
167
109
|
/**
|
|
168
110
|
* Build a prompt that instructs the LLM to address specific user complaints
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompts.js","sourceRoot":"","sources":["../src/prompts.ts"],"names":[],"mappings":";AAAA
|
|
1
|
+
{"version":3,"file":"prompts.js","sourceRoot":"","sources":["../src/prompts.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;AASH,gCAeC;AAMD,8CAuCC;AASD,kDA6BC;AAQD,oDAmCC;AAKD,wDAoBC;AA7KD,kEAAkE;AAClE,MAAM,sBAAsB,GAAG,KAAM,CAAC;AAEtC;;;GAGG;AACH,SAAgB,UAAU,CAAC,EAAU,EAAE,aAAqB,sBAAsB;IAChF,IAAI,EAAE,CAAC,MAAM,IAAI,UAAU;QAAE,OAAO,EAAE,CAAC;IAEvC,8CAA8C;IAC9C,MAAM,OAAO,GAAG,EAAE,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IACrC,IAAI,OAAO,GAAG,CAAC,IAAI,OAAO,GAA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oCAmBe,CAAC;AACrC,CAAC;AAED;;GAEG;AACH,SAAgB,sBAAsB,CAAC,QAAgB;IAIrD,MAAM,OAAO,GAAa,EAAE,CAAC;IAE7B,MAAM,YAAY,GAAG,QAAQ,CAAC,KAAK,CAAC,2CAA2C,CAAC,CAAC;IACjF,IAAI,YAAY,EAAE,CAAC;QACjB,KAAK,MAAM,IAAI,IAAI,YAAY,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;YAC/C,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;YACpD,IAAI,OAAO;gBAAE,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACrC,CAAC;IACH,CAAC;IAED,MAAM,iBAAiB,GAAG,QAAQ,CAAC,KAAK,CAAC,4BAA4B,CAAC,CAAC;IACvE,MAAM,YAAY,GAAG,iBAAiB;QACpC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE;QAC7B,CAAC,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC,kDAAkD;IAEvE,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,CAAC;AACnC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"anthropic.d.ts","sourceRoot":"","sources":["../../src/providers/anthropic.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"anthropic.d.ts","sourceRoot":"","sources":["../../src/providers/anthropic.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAA2B,WAAW,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAOtF;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,eAAe,GAAG,WAAW,CA+F9F"}
|
|
@@ -71,6 +71,10 @@ function createAnthropicProvider(apiKey, options) {
|
|
|
71
71
|
return {
|
|
72
72
|
name: 'anthropic',
|
|
73
73
|
async chat(messages) {
|
|
74
|
+
const result = await this.chatWithUsage(messages);
|
|
75
|
+
return result.content;
|
|
76
|
+
},
|
|
77
|
+
async chatWithUsage(messages) {
|
|
74
78
|
return (0, retry_1.withRetry)(async () => {
|
|
75
79
|
const client = await getClient();
|
|
76
80
|
// Anthropic handles system prompts as a separate field,
|
|
@@ -118,7 +122,12 @@ function createAnthropicProvider(apiKey, options) {
|
|
|
118
122
|
console.warn(`[optimizer] Anthropic response truncated (stop_reason=max_tokens). ` +
|
|
119
123
|
`Consider increasing maxTokens (currently ${maxTokens}).`);
|
|
120
124
|
}
|
|
121
|
-
return
|
|
125
|
+
return {
|
|
126
|
+
content,
|
|
127
|
+
usage: response.usage
|
|
128
|
+
? { inputTokens: response.usage.input_tokens, outputTokens: response.usage.output_tokens }
|
|
129
|
+
: undefined,
|
|
130
|
+
};
|
|
122
131
|
});
|
|
123
132
|
},
|
|
124
133
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"anthropic.js","sourceRoot":"","sources":["../../src/providers/anthropic.ts"],"names":[],"mappings":";AAAA;;;;;;;;;GASG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgBH,
|
|
1
|
+
{"version":3,"file":"anthropic.js","sourceRoot":"","sources":["../../src/providers/anthropic.ts"],"names":[],"mappings":";AAAA;;;;;;;;;GASG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgBH,0DA+FC;AA5GD,mCAAoC;AAEpC,MAAM,aAAa,GAAG,2BAA2B,CAAC;AAClD,MAAM,mBAAmB,GAAG,GAAG,CAAC;AAChC,MAAM,kBAAkB,GAAG,IAAI,CAAC;AAEhC;;;;;;GAMG;AACH,SAAgB,uBAAuB,CAAC,MAAc,EAAE,OAAyB;IAC/E,MAAM,OAAO,GAAG,OAAO,EAAE,KAA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CAAC,YAAY,EAAE,YAAY,EAAE,QAAQ,CAAC,KAAK,CAAC,aAAa,EAAE;wBAC1F,CAAC,CAAC,SAAS;iBACd,CAAC;YACJ,CAAC,CAAC,CAAC;QACL,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"openai.d.ts","sourceRoot":"","sources":["../../src/providers/openai.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"openai.d.ts","sourceRoot":"","sources":["../../src/providers/openai.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAA2B,WAAW,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAOtF;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,eAAe,GAAG,WAAW,CA4D3F"}
|
|
@@ -69,6 +69,10 @@ function createOpenAiProvider(apiKey, options) {
|
|
|
69
69
|
return {
|
|
70
70
|
name: 'openai',
|
|
71
71
|
async chat(messages) {
|
|
72
|
+
const result = await this.chatWithUsage(messages);
|
|
73
|
+
return result.content;
|
|
74
|
+
},
|
|
75
|
+
async chatWithUsage(messages) {
|
|
72
76
|
return (0, retry_1.withRetry)(async () => {
|
|
73
77
|
const client = await getClient();
|
|
74
78
|
const response = await client.chat.completions.create({
|
|
@@ -90,7 +94,12 @@ function createOpenAiProvider(apiKey, options) {
|
|
|
90
94
|
console.warn(`[optimizer] OpenAI response truncated (finish_reason=length). ` +
|
|
91
95
|
`Consider increasing maxTokens (currently ${maxTokens}).`);
|
|
92
96
|
}
|
|
93
|
-
return
|
|
97
|
+
return {
|
|
98
|
+
content,
|
|
99
|
+
usage: response.usage
|
|
100
|
+
? { inputTokens: response.usage.prompt_tokens, outputTokens: response.usage.completion_tokens }
|
|
101
|
+
: undefined,
|
|
102
|
+
};
|
|
94
103
|
});
|
|
95
104
|
},
|
|
96
105
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"openai.js","sourceRoot":"","sources":["../../src/providers/openai.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgBH,
|
|
1
|
+
{"version":3,"file":"openai.js","sourceRoot":"","sources":["../../src/providers/openai.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgBH,oDA4DC;AAzED,mCAAoC;AAEpC,MAAM,aAAa,GAAG,aAAa,CAAC;AACpC,MAAM,mBAAmB,GAAG,GAAG,CAAC;AAChC,MAAM,kBAAkB,GAAG,IAAI,CAAC;AAEhC;;;;;;GAMG;AACH,SAAgB,oBAAoB,CAAC,MAAc,EAAE,OAAyB;IAC5E,MAAM,OAAO,GAAG,OAAO,EAAE,KAAK,IAAI,aAAa,CAAC;IAChD,MAAM,WAAW,GAAG,OAAO,EAAE,WAAW,IAAI,mBAAmB,CAAC;IAChE,MAAM,SAAS,GAAG,OAAO,EAAE,SAAS,IAAI,kBAAkB,CAAC;IAE3D,oCAAoC;IACpC,IAAI,aAAiF,CAAC;IAEtF,KAAK,UAAU,SAAS;QACtB,IAAI,CAAC,aAAa,EAAE,CAAC;YACnB,aAAa,GAAG,kDAAO,QAAQ,IAAE,IAAI,CAAC,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,IAAI,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC;QACzF,CAAC;QACD,OAAO,aAAa,CAAC;IACvB,CAAC;IAED,OAAO;QACL,IAAI,EAAE,QAAQ;QAEd,KAAK,CAAC,IAAI,CAAC,QAAuB;YAChC,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,aAAc,CAAC,QAAQ,CAAC,CAAC;YACnD,OAAO,MAAM,CAAC,OAAO,CAAC;QACxB,CAAC;QAED,KA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
|
content: string;
|
|
11
11
|
}
|
|
12
|
+
/** Token usage from a single LLM call. */
|
|
13
|
+
export interface ChatUsage {
|
|
14
|
+
inputTokens: number;
|
|
15
|
+
outputTokens: number;
|
|
16
|
+
}
|
|
17
|
+
/** Result from an LLM call that includes optional token usage. */
|
|
18
|
+
export interface ChatResult {
|
|
19
|
+
content: string;
|
|
20
|
+
usage?: ChatUsage;
|
|
21
|
+
}
|
|
12
22
|
/**
|
|
13
23
|
* Provider-agnostic LLM interface.
|
|
14
24
|
*
|
|
@@ -20,6 +30,11 @@ export interface LlmProvider {
|
|
|
20
30
|
readonly name: string;
|
|
21
31
|
/** Send a chat completion request and return the assistant reply. */
|
|
22
32
|
chat(messages: ChatMessage[]): Promise<string>;
|
|
33
|
+
/**
|
|
34
|
+
* Send a chat completion request and return the reply with token usage.
|
|
35
|
+
* Optional — providers that don't implement this fall back to `chat()`.
|
|
36
|
+
*/
|
|
37
|
+
chatWithUsage?(messages: ChatMessage[]): Promise<ChatResult>;
|
|
23
38
|
}
|
|
24
39
|
/** Options passed to provider factory functions. */
|
|
25
40
|
export interface ProviderOptions {
|
|
@@ -37,54 +52,48 @@ export interface OptLogger {
|
|
|
37
52
|
error(msg: string): void;
|
|
38
53
|
debug(msg: string): void;
|
|
39
54
|
}
|
|
40
|
-
/** Options for a single
|
|
55
|
+
/** Options for a single generation run. */
|
|
41
56
|
export interface OptimizeOptions {
|
|
42
|
-
/**
|
|
43
|
-
|
|
57
|
+
/**
|
|
58
|
+
* Fallback content returned when the LLM call fails or is cancelled.
|
|
59
|
+
* When omitted, an empty string is used as the fallback.
|
|
60
|
+
*/
|
|
61
|
+
currentInstructions?: string;
|
|
44
62
|
/** Full KB content (architecture + map + context). */
|
|
45
63
|
kb: string;
|
|
46
64
|
/** Line-level diff of KB changes (undefined on first run). */
|
|
47
65
|
kbDiff?: string;
|
|
48
66
|
/** Concatenated content from other AI tool instruction files (read-only context). */
|
|
49
67
|
toolInstructions?: string;
|
|
50
|
-
/** Maximum agent iterations (optimize → eval → refine). */
|
|
51
|
-
maxIterations: number;
|
|
52
68
|
/** LLM provider to use. */
|
|
53
69
|
provider: LlmProvider;
|
|
54
70
|
/** Optional logger for progress reporting. */
|
|
55
71
|
log?: OptLogger;
|
|
56
|
-
/** Minimum eval score (1–10) to accept a candidate without further iteration. Default: 8. */
|
|
57
|
-
acceptThreshold?: number;
|
|
58
72
|
/** AbortSignal for cooperative cancellation. */
|
|
59
73
|
signal?: AbortSignal;
|
|
60
|
-
/** Delay in ms between iterations to avoid rate limiting. Default: 0. */
|
|
61
|
-
iterationDelayMs?: number;
|
|
62
74
|
/** Character budget for KB content in prompts. Default: 60000. */
|
|
63
75
|
kbCharBudget?: number;
|
|
64
76
|
/**
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
* Formatted as a human-readable summary of probe failures and diagnosis.
|
|
77
|
+
* Progress callback invoked at each meaningful step inside the agent.
|
|
78
|
+
* Useful for updating a CLI dashboard or progress bar.
|
|
68
79
|
*/
|
|
69
|
-
|
|
80
|
+
onProgress?: (step: OptimizeStep) => void;
|
|
70
81
|
}
|
|
71
|
-
/**
|
|
72
|
-
export interface
|
|
73
|
-
/**
|
|
74
|
-
|
|
75
|
-
/**
|
|
76
|
-
|
|
77
|
-
/** Concrete improvement suggestions. */
|
|
78
|
-
suggestions: string[];
|
|
82
|
+
/** Progress step emitted by the optimization agent via `onProgress`. */
|
|
83
|
+
export interface OptimizeStep {
|
|
84
|
+
/** Which sub-step is running. */
|
|
85
|
+
kind: 'generating' | 'done';
|
|
86
|
+
/** Optional human-readable detail. */
|
|
87
|
+
detail?: string;
|
|
79
88
|
}
|
|
80
89
|
/** Final result of the optimization agent. */
|
|
81
90
|
export interface OptimizeResult {
|
|
82
91
|
/** The optimized instructions content (to be placed between markers). */
|
|
83
92
|
optimizedInstructions: string;
|
|
84
|
-
/**
|
|
85
|
-
iterations: number;
|
|
86
|
-
/** Per-iteration reasoning / eval feedback. */
|
|
93
|
+
/** Human-readable reasoning / status messages. */
|
|
87
94
|
reasoning: string[];
|
|
95
|
+
/** Aggregate token usage across all LLM calls in this run. */
|
|
96
|
+
usage?: ChatUsage;
|
|
88
97
|
}
|
|
89
98
|
/** Supported provider keys looked up in the environment. */
|
|
90
99
|
export declare const PROVIDER_ENV_KEYS: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,+CAA+C;AAC/C,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,QAAQ,GAAG,MAAM,GAAG,WAAW,CAAC;IACtC,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;;;;GAKG;AACH,MAAM,WAAW,WAAW;IAC1B,iEAAiE;IACjE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB,qEAAqE;IACrE,IAAI,CAAC,QAAQ,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,+CAA+C;AAC/C,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,QAAQ,GAAG,MAAM,GAAG,WAAW,CAAC;IACtC,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,0CAA0C;AAC1C,MAAM,WAAW,SAAS;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,kEAAkE;AAClE,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB;AAED;;;;;GAKG;AACH,MAAM,WAAW,WAAW;IAC1B,iEAAiE;IACjE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB,qEAAqE;IACrE,IAAI,CAAC,QAAQ,EAAE,WAAW,EAAE,GAAG,OAAO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;IACtC,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,8CAA8C;AAC9C,MAAM,WAAW,cAAc;IAC7B,yEAAyE;IACzE,qBAAqB,EAAE,MAAM,CAAC;IAE9B,kDAAkD;IAClD,SAAS,EAAE,MAAM,EAAE,CAAC;IAEpB,8DAA8D;IAC9D,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB;AAID,4DAA4D;AAC5D,eAAO,MAAM,iBAAiB;;;CAGpB,CAAC;AAEX,MAAM,MAAM,YAAY,GAAG,MAAM,OAAO,iBAAiB,CAAC;AAI1D,6EAA6E;AAC7E,MAAM,WAAW,gBAAgB;IAC/B,iCAAiC;IACjC,mBAAmB,EAAE,MAAM,CAAC;IAE5B,sDAAsD;IACtD,EAAE,EAAE,MAAM,CAAC;IAEX,+DAA+D;IAC/D,UAAU,EAAE,MAAM,EAAE,CAAC;IAErB,2BAA2B;IAC3B,QAAQ,EAAE,WAAW,CAAC;IAEtB,uBAAuB;IACvB,GAAG,CAAC,EAAE,SAAS,CAAC;IAEhB,0DAA0D;IAC1D,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB,gDAAgD;IAChD,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB;AAED,+CAA+C;AAC/C,MAAM,WAAW,eAAe;IAC9B,iCAAiC;IACjC,qBAAqB,EAAE,MAAM,CAAC;IAE9B,kEAAkE;IAClE,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB;AAED,qDAAqD;AACrD,eAAO,MAAM,gBAAgB,iBAAiB,CAAC;AAE/C,sDAAsD;AACtD,eAAO,MAAM,aAAa,cAAc,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAsHH,+DAA+D;AAE/D,4DAA4D;AAC/C,QAAA,iBAAiB,GAAG;IAC/B,MAAM,EAAE,gBAAgB;IACxB,SAAS,EAAE,mBAAmB;CACtB,CAAC;AAuCX,qDAAqD;AACxC,QAAA,gBAAgB,GAAG,cAAc,CAAC;AAE/C,sDAAsD;AACzC,QAAA,aAAa,GAAG,WAAW,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aspectcode/optimizer",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"private": true,
|
|
5
|
-
"description": "LLM-powered instruction
|
|
5
|
+
"description": "LLM-powered instruction generator for Aspect Code",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"main": "dist/index.js",
|
|
8
8
|
"types": "dist/index.d.ts",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "aspectcode",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "CLI for Aspect Code — generate knowledge-base artifacts from the command line",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/main.js",
|
|
@@ -38,6 +38,7 @@
|
|
|
38
38
|
"prepublishOnly": "npm run build",
|
|
39
39
|
"prepack": "node scripts/prepack.mjs",
|
|
40
40
|
"postpack": "node scripts/postpack.mjs",
|
|
41
|
+
"check:bundled": "node scripts/check-bundled-deps.mjs",
|
|
41
42
|
"test": "mocha --require ts-node/register 'test/**/*.test.ts'"
|
|
42
43
|
},
|
|
43
44
|
"bundledDependencies": [
|
|
@@ -50,8 +51,8 @@
|
|
|
50
51
|
"@anthropic-ai/sdk": "^0.39.0",
|
|
51
52
|
"@aspectcode/core": "0.3.1",
|
|
52
53
|
"@aspectcode/emitters": "0.3.4",
|
|
53
|
-
"@aspectcode/evaluator": "0.
|
|
54
|
-
"@aspectcode/optimizer": "0.
|
|
54
|
+
"@aspectcode/evaluator": "0.4.0",
|
|
55
|
+
"@aspectcode/optimizer": "0.4.0",
|
|
55
56
|
"chokidar": "^4.0.3",
|
|
56
57
|
"dotenv": "^16.4.0",
|
|
57
58
|
"ink": "3.2.0",
|