aspectcode 0.4.1 → 1.0.1
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 +2 -2
- package/dist/agentsMdRenderer.d.ts +16 -0
- package/dist/agentsMdRenderer.d.ts.map +1 -0
- package/dist/agentsMdRenderer.js +137 -0
- package/dist/agentsMdRenderer.js.map +1 -0
- package/dist/auth.d.ts +31 -0
- package/dist/auth.d.ts.map +1 -0
- package/dist/auth.js +386 -0
- package/dist/auth.js.map +1 -0
- package/dist/autoResolve.d.ts +41 -0
- package/dist/autoResolve.d.ts.map +1 -0
- package/dist/autoResolve.js +196 -0
- package/dist/autoResolve.js.map +1 -0
- package/dist/changeEvaluator.d.ts +56 -0
- package/dist/changeEvaluator.d.ts.map +1 -0
- package/dist/changeEvaluator.js +674 -0
- package/dist/changeEvaluator.js.map +1 -0
- package/dist/cli.d.ts +3 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/config.d.ts +37 -17
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +50 -2
- package/dist/config.js.map +1 -1
- package/dist/dreamCycle.d.ts +57 -0
- package/dist/dreamCycle.d.ts.map +1 -0
- package/dist/dreamCycle.js +334 -0
- package/dist/dreamCycle.js.map +1 -0
- package/dist/kbBuilder.d.ts +1 -2
- package/dist/kbBuilder.d.ts.map +1 -1
- package/dist/kbBuilder.js +1 -2
- package/dist/kbBuilder.js.map +1 -1
- package/dist/main.d.ts +2 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +148 -7
- package/dist/main.js.map +1 -1
- package/dist/optimize.d.ts +13 -6
- package/dist/optimize.d.ts.map +1 -1
- package/dist/optimize.js +433 -142
- package/dist/optimize.js.map +1 -1
- package/dist/pipeline.d.ts +19 -21
- package/dist/pipeline.d.ts.map +1 -1
- package/dist/pipeline.js +1093 -160
- package/dist/pipeline.js.map +1 -1
- package/dist/preferences.d.ts +80 -0
- package/dist/preferences.d.ts.map +1 -0
- package/dist/preferences.js +238 -0
- package/dist/preferences.js.map +1 -0
- package/dist/runtimeState.d.ts +30 -0
- package/dist/runtimeState.d.ts.map +1 -0
- package/dist/runtimeState.js +39 -0
- package/dist/runtimeState.js.map +1 -0
- package/dist/scopedRules.d.ts +84 -0
- package/dist/scopedRules.d.ts.map +1 -0
- package/dist/scopedRules.js +449 -0
- package/dist/scopedRules.js.map +1 -0
- package/dist/ui/Dashboard.d.ts +4 -16
- package/dist/ui/Dashboard.d.ts.map +1 -1
- package/dist/ui/Dashboard.js +339 -140
- package/dist/ui/Dashboard.js.map +1 -1
- package/dist/ui/MemoryMap.d.ts +16 -0
- package/dist/ui/MemoryMap.d.ts.map +1 -0
- package/dist/ui/MemoryMap.js +266 -0
- package/dist/ui/MemoryMap.js.map +1 -0
- package/dist/ui/SettingsPanel.d.ts +18 -0
- package/dist/ui/SettingsPanel.d.ts.map +1 -0
- package/dist/ui/SettingsPanel.js +241 -0
- package/dist/ui/SettingsPanel.js.map +1 -0
- package/dist/ui/prompts.d.ts +7 -0
- package/dist/ui/prompts.d.ts.map +1 -1
- package/dist/ui/prompts.js +63 -0
- package/dist/ui/prompts.js.map +1 -1
- package/dist/ui/store.d.ts +154 -18
- package/dist/ui/store.d.ts.map +1 -1
- package/dist/ui/store.js +154 -24
- package/dist/ui/store.js.map +1 -1
- package/dist/ui/theme.d.ts +1 -8
- package/dist/ui/theme.d.ts.map +1 -1
- package/dist/ui/theme.js +2 -21
- package/dist/ui/theme.js.map +1 -1
- package/dist/updateChecker.d.ts +13 -0
- package/dist/updateChecker.d.ts.map +1 -0
- package/dist/updateChecker.js +66 -0
- package/dist/updateChecker.js.map +1 -0
- package/dist/usageTracker.d.ts +12 -0
- package/dist/usageTracker.d.ts.map +1 -0
- package/dist/usageTracker.js +89 -0
- package/dist/usageTracker.js.map +1 -0
- package/dist/writer.d.ts +1 -7
- package/dist/writer.d.ts.map +1 -1
- package/dist/writer.js +1 -11
- package/dist/writer.js.map +1 -1
- package/node_modules/@aspectcode/core/dist/analysis/repo.d.ts.map +1 -1
- package/node_modules/@aspectcode/core/dist/analysis/repo.js +13 -2
- package/node_modules/@aspectcode/core/dist/analysis/repo.js.map +1 -1
- package/node_modules/@aspectcode/core/dist/index.d.ts +1 -3
- package/node_modules/@aspectcode/core/dist/index.d.ts.map +1 -1
- package/node_modules/@aspectcode/core/dist/index.js +1 -3
- package/node_modules/@aspectcode/core/dist/index.js.map +1 -1
- package/node_modules/@aspectcode/core/dist/parsers/genericExtractors.d.ts +14 -0
- package/node_modules/@aspectcode/core/dist/parsers/genericExtractors.d.ts.map +1 -0
- package/node_modules/@aspectcode/core/dist/parsers/genericExtractors.js +191 -0
- package/node_modules/@aspectcode/core/dist/parsers/genericExtractors.js.map +1 -0
- package/node_modules/@aspectcode/core/dist/parsers/index.d.ts +1 -0
- package/node_modules/@aspectcode/core/dist/parsers/index.d.ts.map +1 -1
- package/node_modules/@aspectcode/core/dist/parsers/index.js +6 -1
- package/node_modules/@aspectcode/core/dist/parsers/index.js.map +1 -1
- package/node_modules/@aspectcode/core/dist/parsers/languages.d.ts +20 -0
- package/node_modules/@aspectcode/core/dist/parsers/languages.d.ts.map +1 -1
- package/node_modules/@aspectcode/core/dist/parsers/languages.js +25 -0
- package/node_modules/@aspectcode/core/dist/parsers/languages.js.map +1 -1
- package/node_modules/@aspectcode/core/dist/parsers/tsJsExtractors.d.ts.map +1 -1
- package/node_modules/@aspectcode/core/dist/parsers/tsJsExtractors.js +4 -1
- package/node_modules/@aspectcode/core/dist/parsers/tsJsExtractors.js.map +1 -1
- package/node_modules/@aspectcode/core/package.json +2 -2
- package/node_modules/@aspectcode/core/parsers/cpp.wasm +0 -0
- package/node_modules/@aspectcode/core/parsers/go.wasm +0 -0
- package/node_modules/@aspectcode/core/parsers/php.wasm +0 -0
- package/node_modules/@aspectcode/core/parsers/ruby.wasm +0 -0
- package/node_modules/@aspectcode/core/parsers/rust.wasm +0 -0
- package/node_modules/@aspectcode/emitters/dist/index.d.ts +1 -17
- package/node_modules/@aspectcode/emitters/dist/index.d.ts.map +1 -1
- package/node_modules/@aspectcode/emitters/dist/index.js +2 -90
- package/node_modules/@aspectcode/emitters/dist/index.js.map +1 -1
- package/node_modules/@aspectcode/emitters/dist/instructions/index.d.ts +0 -2
- package/node_modules/@aspectcode/emitters/dist/instructions/index.d.ts.map +1 -1
- package/node_modules/@aspectcode/emitters/dist/instructions/index.js +1 -7
- package/node_modules/@aspectcode/emitters/dist/instructions/index.js.map +1 -1
- package/node_modules/@aspectcode/emitters/dist/kb/analyzers.d.ts +0 -18
- package/node_modules/@aspectcode/emitters/dist/kb/analyzers.d.ts.map +1 -1
- package/node_modules/@aspectcode/emitters/dist/kb/analyzers.js +0 -57
- package/node_modules/@aspectcode/emitters/dist/kb/analyzers.js.map +1 -1
- package/node_modules/@aspectcode/emitters/dist/kb/conventions.d.ts +0 -18
- package/node_modules/@aspectcode/emitters/dist/kb/conventions.d.ts.map +1 -1
- package/node_modules/@aspectcode/emitters/dist/kb/conventions.js +0 -130
- package/node_modules/@aspectcode/emitters/dist/kb/conventions.js.map +1 -1
- package/node_modules/@aspectcode/emitters/dist/kb/index.d.ts +2 -4
- package/node_modules/@aspectcode/emitters/dist/kb/index.d.ts.map +1 -1
- package/node_modules/@aspectcode/emitters/dist/kb/index.js +1 -11
- package/node_modules/@aspectcode/emitters/dist/kb/index.js.map +1 -1
- package/node_modules/@aspectcode/emitters/package.json +3 -3
- package/node_modules/@aspectcode/evaluator/dist/apply.d.ts +55 -0
- package/node_modules/@aspectcode/evaluator/dist/apply.d.ts.map +1 -0
- package/node_modules/@aspectcode/evaluator/dist/apply.js +368 -0
- package/node_modules/@aspectcode/evaluator/dist/apply.js.map +1 -0
- package/node_modules/@aspectcode/evaluator/dist/diagnosis.d.ts +16 -25
- package/node_modules/@aspectcode/evaluator/dist/diagnosis.d.ts.map +1 -1
- package/node_modules/@aspectcode/evaluator/dist/diagnosis.js +115 -138
- package/node_modules/@aspectcode/evaluator/dist/diagnosis.js.map +1 -1
- package/node_modules/@aspectcode/evaluator/dist/index.d.ts +8 -43
- package/node_modules/@aspectcode/evaluator/dist/index.d.ts.map +1 -1
- package/node_modules/@aspectcode/evaluator/dist/index.js +15 -61
- package/node_modules/@aspectcode/evaluator/dist/index.js.map +1 -1
- package/node_modules/@aspectcode/evaluator/dist/judge.d.ts +32 -0
- package/node_modules/@aspectcode/evaluator/dist/judge.d.ts.map +1 -0
- package/node_modules/@aspectcode/evaluator/dist/judge.js +165 -0
- package/node_modules/@aspectcode/evaluator/dist/judge.js.map +1 -0
- package/node_modules/@aspectcode/evaluator/dist/llmUtil.d.ts +15 -0
- package/node_modules/@aspectcode/evaluator/dist/llmUtil.d.ts.map +1 -0
- package/node_modules/@aspectcode/evaluator/dist/llmUtil.js +41 -0
- package/node_modules/@aspectcode/evaluator/dist/llmUtil.js.map +1 -0
- package/node_modules/@aspectcode/evaluator/dist/probes.d.ts +20 -47
- package/node_modules/@aspectcode/evaluator/dist/probes.d.ts.map +1 -1
- package/node_modules/@aspectcode/evaluator/dist/probes.js +188 -278
- package/node_modules/@aspectcode/evaluator/dist/probes.js.map +1 -1
- package/node_modules/@aspectcode/evaluator/dist/runner.d.ts +7 -32
- package/node_modules/@aspectcode/evaluator/dist/runner.d.ts.map +1 -1
- package/node_modules/@aspectcode/evaluator/dist/runner.js +21 -146
- package/node_modules/@aspectcode/evaluator/dist/runner.js.map +1 -1
- package/node_modules/@aspectcode/evaluator/dist/types.d.ts +141 -99
- package/node_modules/@aspectcode/evaluator/dist/types.d.ts.map +1 -1
- package/node_modules/@aspectcode/evaluator/dist/types.js +10 -2
- package/node_modules/@aspectcode/evaluator/dist/types.js.map +1 -1
- package/node_modules/@aspectcode/evaluator/package.json +4 -4
- package/node_modules/@aspectcode/optimizer/dist/index.d.ts +3 -10
- package/node_modules/@aspectcode/optimizer/dist/index.d.ts.map +1 -1
- package/node_modules/@aspectcode/optimizer/dist/index.js +1 -19
- package/node_modules/@aspectcode/optimizer/dist/index.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 +40 -0
- package/node_modules/@aspectcode/optimizer/dist/providers/anthropic.js.map +1 -1
- package/node_modules/@aspectcode/optimizer/dist/providers/aspectcode.d.ts +9 -0
- package/node_modules/@aspectcode/optimizer/dist/providers/aspectcode.d.ts.map +1 -0
- package/node_modules/@aspectcode/optimizer/dist/providers/aspectcode.js +83 -0
- package/node_modules/@aspectcode/optimizer/dist/providers/aspectcode.js.map +1 -0
- package/node_modules/@aspectcode/optimizer/dist/providers/index.d.ts +4 -3
- package/node_modules/@aspectcode/optimizer/dist/providers/index.d.ts.map +1 -1
- package/node_modules/@aspectcode/optimizer/dist/providers/index.js +24 -10
- package/node_modules/@aspectcode/optimizer/dist/providers/index.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 +22 -0
- package/node_modules/@aspectcode/optimizer/dist/providers/openai.js.map +1 -1
- package/node_modules/@aspectcode/optimizer/dist/providers/retry.d.ts +14 -0
- package/node_modules/@aspectcode/optimizer/dist/providers/retry.d.ts.map +1 -1
- package/node_modules/@aspectcode/optimizer/dist/providers/retry.js +1 -0
- package/node_modules/@aspectcode/optimizer/dist/providers/retry.js.map +1 -1
- package/node_modules/@aspectcode/optimizer/dist/types.d.ts +14 -0
- 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/node_modules/web-tree-sitter/LICENSE +21 -0
- package/node_modules/web-tree-sitter/README.md +198 -0
- package/node_modules/web-tree-sitter/package.json +36 -0
- package/node_modules/web-tree-sitter/tree-sitter-web.d.ts +204 -0
- package/node_modules/web-tree-sitter/tree-sitter.js +1 -0
- package/node_modules/web-tree-sitter/tree-sitter.wasm +0 -0
- package/package.json +8 -8
- package/dist/complaintProcessor.d.ts +0 -16
- package/dist/complaintProcessor.d.ts.map +0 -1
- package/dist/complaintProcessor.js +0 -134
- package/dist/complaintProcessor.js.map +0 -1
- package/node_modules/@aspectcode/emitters/dist/emitter.d.ts +0 -72
- package/node_modules/@aspectcode/emitters/dist/emitter.d.ts.map +0 -1
- package/node_modules/@aspectcode/emitters/dist/emitter.js +0 -10
- package/node_modules/@aspectcode/emitters/dist/emitter.js.map +0 -1
- package/node_modules/@aspectcode/emitters/dist/instructions/content.d.ts +0 -26
- package/node_modules/@aspectcode/emitters/dist/instructions/content.d.ts.map +0 -1
- package/node_modules/@aspectcode/emitters/dist/instructions/content.js +0 -501
- package/node_modules/@aspectcode/emitters/dist/instructions/content.js.map +0 -1
- package/node_modules/@aspectcode/emitters/dist/instructions/detection.d.ts +0 -13
- package/node_modules/@aspectcode/emitters/dist/instructions/detection.d.ts.map +0 -1
- package/node_modules/@aspectcode/emitters/dist/instructions/detection.js +0 -55
- package/node_modules/@aspectcode/emitters/dist/instructions/detection.js.map +0 -1
- package/node_modules/@aspectcode/emitters/dist/instructions/instructionsEmitter.d.ts +0 -9
- package/node_modules/@aspectcode/emitters/dist/instructions/instructionsEmitter.d.ts.map +0 -1
- package/node_modules/@aspectcode/emitters/dist/instructions/instructionsEmitter.js +0 -30
- package/node_modules/@aspectcode/emitters/dist/instructions/instructionsEmitter.js.map +0 -1
- package/node_modules/@aspectcode/emitters/dist/kb/kbEmitter.d.ts +0 -21
- package/node_modules/@aspectcode/emitters/dist/kb/kbEmitter.d.ts.map +0 -1
- package/node_modules/@aspectcode/emitters/dist/kb/kbEmitter.js +0 -125
- package/node_modules/@aspectcode/emitters/dist/kb/kbEmitter.js.map +0 -1
- package/node_modules/@aspectcode/emitters/dist/manifest.d.ts +0 -37
- package/node_modules/@aspectcode/emitters/dist/manifest.d.ts.map +0 -1
- package/node_modules/@aspectcode/emitters/dist/manifest.js +0 -50
- package/node_modules/@aspectcode/emitters/dist/manifest.js.map +0 -1
- package/node_modules/@aspectcode/emitters/dist/report.d.ts +0 -22
- package/node_modules/@aspectcode/emitters/dist/report.d.ts.map +0 -1
- package/node_modules/@aspectcode/emitters/dist/report.js +0 -3
- package/node_modules/@aspectcode/emitters/dist/report.js.map +0 -1
- package/node_modules/@aspectcode/emitters/dist/stableJson.d.ts +0 -14
- package/node_modules/@aspectcode/emitters/dist/stableJson.d.ts.map +0 -1
- package/node_modules/@aspectcode/emitters/dist/stableJson.js +0 -40
- package/node_modules/@aspectcode/emitters/dist/stableJson.js.map +0 -1
- package/node_modules/@aspectcode/emitters/dist/transaction.d.ts +0 -29
- package/node_modules/@aspectcode/emitters/dist/transaction.d.ts.map +0 -1
- package/node_modules/@aspectcode/emitters/dist/transaction.js +0 -104
- package/node_modules/@aspectcode/emitters/dist/transaction.js.map +0 -1
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Complaint processor — takes queued user complaints, calls the
|
|
3
|
-
* complaint agent to update AGENTS.md, and reports changes via the store.
|
|
4
|
-
*/
|
|
5
|
-
import type { RunContext } from './cli';
|
|
6
|
-
import type { OwnershipMode } from './writer';
|
|
7
|
-
/**
|
|
8
|
-
* Drain the complaint queue and apply each batch of complaints to AGENTS.md.
|
|
9
|
-
*
|
|
10
|
-
* Reads the current AGENTS.md, sends complaints + KB context to the LLM,
|
|
11
|
-
* writes the updated file, and surfaces changes in the dashboard.
|
|
12
|
-
*
|
|
13
|
-
* @returns true if at least one complaint was processed, false otherwise.
|
|
14
|
-
*/
|
|
15
|
-
export declare function processComplaints(ctx: RunContext, ownership: OwnershipMode, kbContent: string): Promise<boolean>;
|
|
16
|
-
//# sourceMappingURL=complaintProcessor.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"complaintProcessor.d.ts","sourceRoot":"","sources":["../src/complaintProcessor.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAWH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAIxC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAG9C;;;;;;;GAOG;AACH,wBAAsB,iBAAiB,CACrC,GAAG,EAAE,UAAU,EACf,SAAS,EAAE,aAAa,EACxB,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,OAAO,CAAC,CAmFlB"}
|
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Complaint processor — takes queued user complaints, calls the
|
|
4
|
-
* complaint agent to update AGENTS.md, and reports changes via the store.
|
|
5
|
-
*/
|
|
6
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
7
|
-
if (k2 === undefined) k2 = k;
|
|
8
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
9
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
10
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
11
|
-
}
|
|
12
|
-
Object.defineProperty(o, k2, desc);
|
|
13
|
-
}) : (function(o, m, k, k2) {
|
|
14
|
-
if (k2 === undefined) k2 = k;
|
|
15
|
-
o[k2] = m[k];
|
|
16
|
-
}));
|
|
17
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
18
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
19
|
-
}) : function(o, v) {
|
|
20
|
-
o["default"] = v;
|
|
21
|
-
});
|
|
22
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
23
|
-
var ownKeys = function(o) {
|
|
24
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
25
|
-
var ar = [];
|
|
26
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
27
|
-
return ar;
|
|
28
|
-
};
|
|
29
|
-
return ownKeys(o);
|
|
30
|
-
};
|
|
31
|
-
return function (mod) {
|
|
32
|
-
if (mod && mod.__esModule) return mod;
|
|
33
|
-
var result = {};
|
|
34
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
35
|
-
__setModuleDefault(result, mod);
|
|
36
|
-
return result;
|
|
37
|
-
};
|
|
38
|
-
})();
|
|
39
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
|
-
exports.processComplaints = processComplaints;
|
|
41
|
-
const fs = __importStar(require("fs"));
|
|
42
|
-
const path = __importStar(require("path"));
|
|
43
|
-
const optimizer_1 = require("@aspectcode/optimizer");
|
|
44
|
-
const emitters_1 = require("@aspectcode/emitters");
|
|
45
|
-
const config_1 = require("./config");
|
|
46
|
-
const writer_1 = require("./writer");
|
|
47
|
-
const store_1 = require("./ui/store");
|
|
48
|
-
/**
|
|
49
|
-
* Drain the complaint queue and apply each batch of complaints to AGENTS.md.
|
|
50
|
-
*
|
|
51
|
-
* Reads the current AGENTS.md, sends complaints + KB context to the LLM,
|
|
52
|
-
* writes the updated file, and surfaces changes in the dashboard.
|
|
53
|
-
*
|
|
54
|
-
* @returns true if at least one complaint was processed, false otherwise.
|
|
55
|
-
*/
|
|
56
|
-
async function processComplaints(ctx, ownership, kbContent) {
|
|
57
|
-
const { root, flags, log } = ctx;
|
|
58
|
-
// ── Collect all queued complaints ─────────────────────────
|
|
59
|
-
const complaints = [];
|
|
60
|
-
let next;
|
|
61
|
-
while ((next = store_1.store.shiftComplaint()) !== undefined) {
|
|
62
|
-
complaints.push(next);
|
|
63
|
-
}
|
|
64
|
-
if (complaints.length === 0)
|
|
65
|
-
return false;
|
|
66
|
-
// ── Resolve LLM provider ─────────────────────────────────
|
|
67
|
-
const config = (0, config_1.loadConfig)(root);
|
|
68
|
-
const optConfig = config?.optimize;
|
|
69
|
-
const model = flags.model ?? optConfig?.model;
|
|
70
|
-
const providerName = flags.provider ?? optConfig?.provider;
|
|
71
|
-
const maxTokens = optConfig?.maxTokens;
|
|
72
|
-
const temperature = flags.temperature ?? optConfig?.temperature;
|
|
73
|
-
let env;
|
|
74
|
-
try {
|
|
75
|
-
env = (0, optimizer_1.loadEnvFile)(root);
|
|
76
|
-
}
|
|
77
|
-
catch {
|
|
78
|
-
env = {};
|
|
79
|
-
}
|
|
80
|
-
if (providerName && !env['LLM_PROVIDER']) {
|
|
81
|
-
env['LLM_PROVIDER'] = providerName;
|
|
82
|
-
}
|
|
83
|
-
const providerOptions = {};
|
|
84
|
-
if (model)
|
|
85
|
-
providerOptions.model = model;
|
|
86
|
-
if (temperature !== undefined)
|
|
87
|
-
providerOptions.temperature = temperature;
|
|
88
|
-
if (maxTokens !== undefined)
|
|
89
|
-
providerOptions.maxTokens = maxTokens;
|
|
90
|
-
let provider;
|
|
91
|
-
try {
|
|
92
|
-
provider = (0, optimizer_1.resolveProvider)(env, providerOptions);
|
|
93
|
-
}
|
|
94
|
-
catch {
|
|
95
|
-
store_1.store.setWarning('No API key — cannot process complaints.');
|
|
96
|
-
return false;
|
|
97
|
-
}
|
|
98
|
-
// ── Read current AGENTS.md ────────────────────────────────
|
|
99
|
-
let currentInstructions;
|
|
100
|
-
try {
|
|
101
|
-
const agentsPath = path.join(root, 'AGENTS.md');
|
|
102
|
-
currentInstructions = fs.readFileSync(agentsPath, 'utf-8');
|
|
103
|
-
}
|
|
104
|
-
catch {
|
|
105
|
-
store_1.store.setWarning('AGENTS.md not found — run the pipeline first.');
|
|
106
|
-
return false;
|
|
107
|
-
}
|
|
108
|
-
// ── Run complaint agent ───────────────────────────────────
|
|
109
|
-
store_1.store.setProcessingComplaint(true);
|
|
110
|
-
store_1.store.clearComplaintChanges();
|
|
111
|
-
log.info(`Processing ${complaints.length} complaint${complaints.length === 1 ? '' : 's'}…`);
|
|
112
|
-
const result = await (0, optimizer_1.runComplaintAgent)({
|
|
113
|
-
currentInstructions,
|
|
114
|
-
kb: kbContent,
|
|
115
|
-
complaints,
|
|
116
|
-
provider,
|
|
117
|
-
log: flags.quiet ? undefined : {
|
|
118
|
-
info: (msg) => log.info(msg),
|
|
119
|
-
warn: (msg) => log.warn(msg),
|
|
120
|
-
error: (msg) => log.error(msg),
|
|
121
|
-
debug: (msg) => log.debug(msg),
|
|
122
|
-
},
|
|
123
|
-
});
|
|
124
|
-
// ── Write updated AGENTS.md ───────────────────────────────
|
|
125
|
-
if (!flags.dryRun) {
|
|
126
|
-
const host = (0, emitters_1.createNodeEmitterHost)();
|
|
127
|
-
await (0, writer_1.writeAgentsMd)(host, root, result.optimizedInstructions, ownership);
|
|
128
|
-
log.success('AGENTS.md updated from complaints');
|
|
129
|
-
}
|
|
130
|
-
store_1.store.setComplaintChanges(result.changes);
|
|
131
|
-
store_1.store.setProcessingComplaint(false);
|
|
132
|
-
return true;
|
|
133
|
-
}
|
|
134
|
-
//# sourceMappingURL=complaintProcessor.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"complaintProcessor.js","sourceRoot":"","sources":["../src/complaintProcessor.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BH,8CAuFC;AA/GD,uCAAyB;AACzB,2CAA6B;AAC7B,qDAI+B;AAE/B,mDAA6D;AAG7D,qCAAsC;AACtC,qCAAyC;AAEzC,sCAAmC;AAEnC;;;;;;;GAOG;AACI,KAAK,UAAU,iBAAiB,CACrC,GAAe,EACf,SAAwB,EACxB,SAAiB;IAEjB,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,GAAG,CAAC;IAEjC,6DAA6D;IAC7D,MAAM,UAAU,GAAa,EAAE,CAAC;IAChC,IAAI,IAAwB,CAAC;IAC7B,OAAO,CAAC,IAAI,GAAG,aAAK,CAAC,cAAc,EAAE,CAAC,KAAK,SAAS,EAAE,CAAC;QACrD,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CA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GAAG,IAAA,gCAAqB,GAAE,CAAC;QACrC,MAAM,IAAA,sBAAa,EAAC,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC,qBAAqB,EAAE,SAAS,CAAC,CAAC;QACzE,GAAG,CAAC,OAAO,CAAC,mCAAmC,CAAC,CAAC;IACnD,CAAC;IAED,aAAK,CAAC,mBAAmB,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAC1C,aAAK,CAAC,sBAAsB,CAAC,KAAK,CAAC,CAAC;IAEpC,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Emitter interface — the contract for all artifact generators.
|
|
3
|
-
*
|
|
4
|
-
* Each emitter takes an AnalysisModel + options and writes files
|
|
5
|
-
* via the EmitterHost abstraction. Emitters MUST produce deterministic
|
|
6
|
-
* output for the same input (modulo `generatedAt` timestamps).
|
|
7
|
-
*/
|
|
8
|
-
import type { AnalysisModel } from '@aspectcode/core';
|
|
9
|
-
import type { EmitterHost } from './host';
|
|
10
|
-
/** Mode for instruction content generation. */
|
|
11
|
-
export type InstructionsMode = 'safe' | 'permissive' | 'custom' | 'off';
|
|
12
|
-
/** Options passed to every emitter. */
|
|
13
|
-
export interface EmitOptions {
|
|
14
|
-
/** Absolute path to the workspace root. */
|
|
15
|
-
workspaceRoot: string;
|
|
16
|
-
/**
|
|
17
|
-
* Absolute path to the output root where generated artifacts are written.
|
|
18
|
-
*
|
|
19
|
-
* Defaults to `workspaceRoot`.
|
|
20
|
-
*
|
|
21
|
-
* This allows generating into a temp directory (tests/CLI/GitHub Action)
|
|
22
|
-
* without depending on CWD or VS Code workspace filesystem roots.
|
|
23
|
-
*/
|
|
24
|
-
outDir?: string;
|
|
25
|
-
/**
|
|
26
|
-
* ISO-8601 timestamp to embed in outputs.
|
|
27
|
-
* Defaults to `new Date().toISOString()` if omitted.
|
|
28
|
-
* Pass a fixed value in tests for determinism.
|
|
29
|
-
*/
|
|
30
|
-
generatedAt?: string;
|
|
31
|
-
/** Instruction content mode. */
|
|
32
|
-
instructionsMode?: InstructionsMode;
|
|
33
|
-
/** Pre-loaded file contents (avoids re-reading from disk). */
|
|
34
|
-
fileContents?: Map<string, string>;
|
|
35
|
-
/**
|
|
36
|
-
* Whether to generate the KB file (`kb.md`).
|
|
37
|
-
*
|
|
38
|
-
* Defaults to `false`. When `false`, only instruction files are emitted.
|
|
39
|
-
* Set to `true` to generate the knowledge base.
|
|
40
|
-
*/
|
|
41
|
-
generateKb?: boolean;
|
|
42
|
-
/**
|
|
43
|
-
* List of output format IDs to emit instruction files for.
|
|
44
|
-
*
|
|
45
|
-
* When omitted or empty, only `AGENTS.md` is written (the universal target).
|
|
46
|
-
* Supported values: 'agents', 'copilot', 'cursor', 'claudeCode',
|
|
47
|
-
* 'windsurf', 'cline', 'gemini', 'aider', 'amazonq', 'codex'.
|
|
48
|
-
*
|
|
49
|
-
* AGENTS.md is always written regardless of this list.
|
|
50
|
-
*/
|
|
51
|
-
outputFormats?: string[];
|
|
52
|
-
}
|
|
53
|
-
/** Result returned by an emitter after writing artifacts. */
|
|
54
|
-
export interface EmitResult {
|
|
55
|
-
/** Absolute paths of all files written or updated. */
|
|
56
|
-
filesWritten: string[];
|
|
57
|
-
}
|
|
58
|
-
/** A named artifact generator. */
|
|
59
|
-
export interface Emitter {
|
|
60
|
-
/** Human-readable name (e.g. "aspect-kb", "instructions"). */
|
|
61
|
-
readonly name: string;
|
|
62
|
-
/**
|
|
63
|
-
* Generate and write artifacts.
|
|
64
|
-
*
|
|
65
|
-
* @param model The analysis model to consume.
|
|
66
|
-
* @param host File I/O abstraction.
|
|
67
|
-
* @param options Generation options.
|
|
68
|
-
* @returns Paths of all files written.
|
|
69
|
-
*/
|
|
70
|
-
emit(model: AnalysisModel, host: EmitterHost, options: EmitOptions): Promise<EmitResult>;
|
|
71
|
-
}
|
|
72
|
-
//# sourceMappingURL=emitter.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"emitter.d.ts","sourceRoot":"","sources":["../src/emitter.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAI1C,+CAA+C;AAC/C,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,YAAY,GAAG,QAAQ,GAAG,KAAK,CAAC;AAExE,uCAAuC;AACvC,MAAM,WAAW,WAAW;IAC1B,2CAA2C;IAC3C,aAAa,EAAE,MAAM,CAAC;IAEtB;;;;;;;OAOG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,gCAAgC;IAChC,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IAEpC,8DAA8D;IAC9D,YAAY,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAEnC;;;;;OAKG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB;;;;;;;;OAQG;IACH,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;CAC1B;AAID,6DAA6D;AAC7D,MAAM,WAAW,UAAU;IACzB,sDAAsD;IACtD,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB;AAID,kCAAkC;AAClC,MAAM,WAAW,OAAO;IACtB,8DAA8D;IAC9D,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB;;;;;;;OAOG;IACH,IAAI,CACF,KAAK,EAAE,aAAa,EACpB,IAAI,EAAE,WAAW,EACjB,OAAO,EAAE,WAAW,GACnB,OAAO,CAAC,UAAU,CAAC,CAAC;CACxB"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Emitter interface — the contract for all artifact generators.
|
|
4
|
-
*
|
|
5
|
-
* Each emitter takes an AnalysisModel + options and writes files
|
|
6
|
-
* via the EmitterHost abstraction. Emitters MUST produce deterministic
|
|
7
|
-
* output for the same input (modulo `generatedAt` timestamps).
|
|
8
|
-
*/
|
|
9
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
//# sourceMappingURL=emitter.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"emitter.js","sourceRoot":"","sources":["../src/emitter.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import type { InstructionsMode } from '../emitter';
|
|
2
|
-
/**
|
|
3
|
-
* Generates the canonical instruction content.
|
|
4
|
-
*
|
|
5
|
-
* When `kbAvailable` is true, the content references the `kb.md` knowledge
|
|
6
|
-
* base file. When false, it provides standalone rules and guidelines only.
|
|
7
|
-
*
|
|
8
|
-
* All assistant-specific exports are derived from this single source.
|
|
9
|
-
*/
|
|
10
|
-
export declare function generateCanonicalContentForMode(mode: InstructionsMode, kbAvailable?: boolean): string;
|
|
11
|
-
/**
|
|
12
|
-
* Generate a project-customized AGENTS.md using actual KB content.
|
|
13
|
-
*
|
|
14
|
-
* Extracts key architectural facts (hubs, entry points, conventions, etc.)
|
|
15
|
-
* from the KB string and embeds them directly into the instructions file.
|
|
16
|
-
* This produces a useful, project-specific result even without an LLM.
|
|
17
|
-
*
|
|
18
|
-
* Falls back to the generic KB-aware template if no meaningful sections
|
|
19
|
-
* can be extracted.
|
|
20
|
-
*/
|
|
21
|
-
export declare function generateKbCustomContent(kbContent: string, mode?: InstructionsMode): string;
|
|
22
|
-
export declare function generateCanonicalContentSafe(): string;
|
|
23
|
-
export declare function generateCanonicalContentPermissive(): string;
|
|
24
|
-
export declare function generateCanonicalContentSafeKB(): string;
|
|
25
|
-
export declare function generateCanonicalContentPermissiveKB(): string;
|
|
26
|
-
//# sourceMappingURL=content.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"content.d.ts","sourceRoot":"","sources":["../../src/instructions/content.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAWnD;;;;;;;GAOG;AACH,wBAAgB,+BAA+B,CAC7C,IAAI,EAAE,gBAAgB,EACtB,WAAW,UAAQ,GAClB,MAAM,CAOR;AAMD;;;;;;;;;GASG;AACH,wBAAgB,uBAAuB,CACrC,SAAS,EAAE,MAAM,EACjB,IAAI,GAAE,gBAAyB,GAC9B,MAAM,CAiBR;AAqOD,wBAAgB,4BAA4B,IAAI,MAAM,CAsDrD;AAED,wBAAgB,kCAAkC,IAAI,MAAM,CA4C3D;AAMD,wBAAgB,8BAA8B,IAAI,MAAM,CAkGvD;AAED,wBAAgB,oCAAoC,IAAI,MAAM,CAoD7D"}
|