aspectcode 0.3.4 → 0.3.5
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/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 +48 -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 +34 -0
- package/node_modules/@aspectcode/evaluator/dist/runner.d.ts.map +1 -0
- package/node_modules/@aspectcode/evaluator/dist/runner.js +183 -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/package.json +2 -1
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Export-based prompt harvester.
|
|
3
|
+
*
|
|
4
|
+
* Reads a user-provided `aspectcode-prompts.jsonl` file containing
|
|
5
|
+
* manually exported or tool-exported conversation turns.
|
|
6
|
+
*
|
|
7
|
+
* Format: one JSON object per line:
|
|
8
|
+
* ```jsonl
|
|
9
|
+
* {"userPrompt":"...","assistantResponse":"...","filesReferenced":["src/foo.ts"],"timestamp":"2025-01-01T00:00:00Z"}
|
|
10
|
+
* ```
|
|
11
|
+
*/
|
|
12
|
+
import type { HarvestedPrompt } from '../types';
|
|
13
|
+
import type { OptLogger } from '../types';
|
|
14
|
+
/**
|
|
15
|
+
* Harvest prompts from a user-provided JSONL export file.
|
|
16
|
+
*/
|
|
17
|
+
export declare function harvestExport(root: string, options?: {
|
|
18
|
+
max?: number;
|
|
19
|
+
since?: Date;
|
|
20
|
+
log?: OptLogger;
|
|
21
|
+
filePath?: string;
|
|
22
|
+
}): Promise<HarvestedPrompt[]>;
|
|
23
|
+
//# sourceMappingURL=export.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"export.d.ts","sourceRoot":"","sources":["../../src/harvest/export.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAIH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAEhD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAK1C;;GAEG;AACH,wBAAsB,aAAa,CACjC,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,IAAI,CAAC;IAAC,GAAG,CAAC,EAAE,SAAS,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,GAC3E,OAAO,CAAC,eAAe,EAAE,CAAC,CAgD5B"}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Export-based prompt harvester.
|
|
4
|
+
*
|
|
5
|
+
* Reads a user-provided `aspectcode-prompts.jsonl` file containing
|
|
6
|
+
* manually exported or tool-exported conversation turns.
|
|
7
|
+
*
|
|
8
|
+
* Format: one JSON object per line:
|
|
9
|
+
* ```jsonl
|
|
10
|
+
* {"userPrompt":"...","assistantResponse":"...","filesReferenced":["src/foo.ts"],"timestamp":"2025-01-01T00:00:00Z"}
|
|
11
|
+
* ```
|
|
12
|
+
*/
|
|
13
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
16
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
17
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
18
|
+
}
|
|
19
|
+
Object.defineProperty(o, k2, desc);
|
|
20
|
+
}) : (function(o, m, k, k2) {
|
|
21
|
+
if (k2 === undefined) k2 = k;
|
|
22
|
+
o[k2] = m[k];
|
|
23
|
+
}));
|
|
24
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
25
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
26
|
+
}) : function(o, v) {
|
|
27
|
+
o["default"] = v;
|
|
28
|
+
});
|
|
29
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
30
|
+
var ownKeys = function(o) {
|
|
31
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
32
|
+
var ar = [];
|
|
33
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
34
|
+
return ar;
|
|
35
|
+
};
|
|
36
|
+
return ownKeys(o);
|
|
37
|
+
};
|
|
38
|
+
return function (mod) {
|
|
39
|
+
if (mod && mod.__esModule) return mod;
|
|
40
|
+
var result = {};
|
|
41
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
42
|
+
__setModuleDefault(result, mod);
|
|
43
|
+
return result;
|
|
44
|
+
};
|
|
45
|
+
})();
|
|
46
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
47
|
+
exports.harvestExport = harvestExport;
|
|
48
|
+
const fs = __importStar(require("fs"));
|
|
49
|
+
const path = __importStar(require("path"));
|
|
50
|
+
const common_1 = require("./common");
|
|
51
|
+
/** Default export file name. */
|
|
52
|
+
const EXPORT_FILE = 'aspectcode-prompts.jsonl';
|
|
53
|
+
/**
|
|
54
|
+
* Harvest prompts from a user-provided JSONL export file.
|
|
55
|
+
*/
|
|
56
|
+
async function harvestExport(root, options) {
|
|
57
|
+
const log = options?.log ?? common_1.noopLogger;
|
|
58
|
+
const max = options?.max ?? common_1.DEFAULT_MAX_PER_SOURCE;
|
|
59
|
+
const exportPath = options?.filePath || path.join(root, EXPORT_FILE);
|
|
60
|
+
if (!fs.existsSync(exportPath)) {
|
|
61
|
+
log.debug(`export: no file at ${exportPath}`);
|
|
62
|
+
return [];
|
|
63
|
+
}
|
|
64
|
+
const content = fs.readFileSync(exportPath, 'utf-8');
|
|
65
|
+
const lines = content.split('\n').filter((l) => l.trim());
|
|
66
|
+
const prompts = [];
|
|
67
|
+
for (let i = 0; i < lines.length; i++) {
|
|
68
|
+
try {
|
|
69
|
+
const entry = JSON.parse(lines[i]);
|
|
70
|
+
const userPrompt = entry.userPrompt || entry.user_prompt || entry.prompt || '';
|
|
71
|
+
const assistantResponse = entry.assistantResponse || entry.assistant_response || entry.response || '';
|
|
72
|
+
if (!userPrompt || !assistantResponse)
|
|
73
|
+
continue;
|
|
74
|
+
const explicitFiles = Array.isArray(entry.filesReferenced)
|
|
75
|
+
? entry.filesReferenced
|
|
76
|
+
: Array.isArray(entry.files_referenced)
|
|
77
|
+
? entry.files_referenced
|
|
78
|
+
: [];
|
|
79
|
+
const allText = userPrompt + '\n' + assistantResponse;
|
|
80
|
+
prompts.push({
|
|
81
|
+
source: 'export',
|
|
82
|
+
timestamp: entry.timestamp || undefined,
|
|
83
|
+
userPrompt,
|
|
84
|
+
assistantResponse,
|
|
85
|
+
filesReferenced: [...new Set([
|
|
86
|
+
...explicitFiles,
|
|
87
|
+
...(0, common_1.extractFilePaths)(allText, root),
|
|
88
|
+
])],
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
catch (err) {
|
|
92
|
+
log.debug(`export: failed to parse line ${i + 1}: ${err}`);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
log.debug(`export: parsed ${prompts.length} entries from ${exportPath}`);
|
|
96
|
+
return (0, common_1.filterRecent)(prompts, options?.since, max);
|
|
97
|
+
}
|
|
98
|
+
//# sourceMappingURL=export.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"export.js","sourceRoot":"","sources":["../../src/harvest/export.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAcH,sCAmDC;AA/DD,uCAAyB;AACzB,2CAA6B;AAE7B,qCAA8F;AAG9F,gCAAgC;AAChC,MAAM,WAAW,GAAG,0BAA0B,CAAC;AAE/C;;GAEG;AACI,KAAK,UAAU,aAAa,CACjC,IAAY,EACZ,OAA4E;IAE5E,MAAM,GAAG,GAAG,OAAO,EAAE,GAAG,IAAI,mBAAU,CAAC;IACvC,MAAM,GAAG,GAAG,OAAO,EAAE,GAAG,IAAI,+BAAsB,CAAC;IAEnD,MAAM,UAAU,GAAG,OAAO,EAAE,QAAQ,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;IAErE,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;QAC/B,GAAG,CAAC,KAAK,CAAC,sBAAsB,UAAU,EAAE,CAAC,CAAC;QAC9C,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,MAAM,OAAO,GAAG,EAAE,CAAC,YAAY,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;IACrD,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;IAC1D,MAAM,OAAO,GAAsB,EAAE,CAAC;IAEtC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACtC,IAAI,CAAC;YACH,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;YACnC,MAAM,UAAU,GAAG,KAAK,CAAC,UAAU,IAAI,KAAK,CAAC,WAAW,IAAI,KAAK,CAAC,MAAM,IAAI,EAAE,CAAC;YAC/E,MAAM,iBAAiB,GAAG,KAAK,CAAC,iBAAiB,IAAI,KAAK,CAAC,kBAAkB,IAAI,KAAK,CAAC,QAAQ,IAAI,EAAE,CAAC;YAEtG,IAAI,CAAC,UAAU,IAAI,CAAC,iBAAiB;gBAAE,SAAS;YAEhD,MAAM,aAAa,GAAa,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,eAAe,CAAC;gBAClE,CAAC,CAAC,KAAK,CAAC,eAAe;gBACvB,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,gBAAgB,CAAC;oBACrC,CAAC,CAAC,KAAK,CAAC,gBAAgB;oBACxB,CAAC,CAAC,EAAE,CAAC;YAET,MAAM,OAAO,GAAG,UAAU,GAAG,IAAI,GAAG,iBAAiB,CAAC;YAEtD,OAAO,CAAC,IAAI,CAAC;gBACX,MAAM,EAAE,QAAQ;gBAChB,SAAS,EAAE,KAAK,CAAC,SAAS,IAAI,SAAS;gBACvC,UAAU;gBACV,iBAAiB;gBACjB,eAAe,EAAE,CAAC,GAAG,IAAI,GAAG,CAAC;wBAC3B,GAAG,aAAa;wBAChB,GAAG,IAAA,yBAAgB,EAAC,OAAO,EAAE,IAAI,CAAC;qBACnC,CAAC,CAAC;aACJ,CAAC,CAAC;QACL,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,GAAG,CAAC,KAAK,CAAC,gCAAgC,CAAC,GAAG,CAAC,KAAK,GAAG,EAAE,CAAC,CAAC;QAC7D,CAAC;IACH,CAAC;IAED,GAAG,CAAC,KAAK,CAAC,kBAAkB,OAAO,CAAC,MAAM,iBAAiB,UAAU,EAAE,CAAC,CAAC;IACzE,OAAO,IAAA,qBAAY,EAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;AACpD,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Prompt harvester — aggregates conversation history from AI coding tools.
|
|
3
|
+
*
|
|
4
|
+
* Supported sources:
|
|
5
|
+
* - aider: `.aider.chat.history.md` (markdown)
|
|
6
|
+
* - claude-code: `~/.claude/projects/<hash>/*.jsonl` (JSONL)
|
|
7
|
+
* - cline: VS Code globalStorage `saoudrizwan.claude-dev` (JSON)
|
|
8
|
+
* - copilot-chat: VS Code state.vscdb (SQLite)
|
|
9
|
+
* - cursor: Cursor state.vscdb (SQLite)
|
|
10
|
+
* - windsurf: Windsurf state.vscdb (SQLite)
|
|
11
|
+
* - export: `aspectcode-prompts.jsonl` (JSONL, user-provided)
|
|
12
|
+
*
|
|
13
|
+
* SQLite sources require the optional `better-sqlite3` dependency.
|
|
14
|
+
* If unavailable, those sources are gracefully skipped.
|
|
15
|
+
*/
|
|
16
|
+
import type { HarvestedPrompt, HarvestOptions } from '../types';
|
|
17
|
+
/**
|
|
18
|
+
* Harvest prompts from all configured AI tool conversation histories.
|
|
19
|
+
*
|
|
20
|
+
* Each source is attempted independently — failures in one source
|
|
21
|
+
* don't prevent harvesting from others.
|
|
22
|
+
*/
|
|
23
|
+
export declare function harvestPrompts(options: HarvestOptions): Promise<HarvestedPrompt[]>;
|
|
24
|
+
export { harvestAider } from './aider';
|
|
25
|
+
export { harvestClaudeCode } from './claudeCode';
|
|
26
|
+
export { harvestCline } from './cline';
|
|
27
|
+
export { harvestCopilotChat, harvestCursor, harvestWindsurf } from './vscodeDb';
|
|
28
|
+
export { harvestExport } from './export';
|
|
29
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/harvest/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAgB,MAAM,UAAU,CAAC;AAiC9E;;;;;GAKG;AACH,wBAAsB,cAAc,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC,CA+BxF;AAGD,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAChF,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Prompt harvester — aggregates conversation history from AI coding tools.
|
|
4
|
+
*
|
|
5
|
+
* Supported sources:
|
|
6
|
+
* - aider: `.aider.chat.history.md` (markdown)
|
|
7
|
+
* - claude-code: `~/.claude/projects/<hash>/*.jsonl` (JSONL)
|
|
8
|
+
* - cline: VS Code globalStorage `saoudrizwan.claude-dev` (JSON)
|
|
9
|
+
* - copilot-chat: VS Code state.vscdb (SQLite)
|
|
10
|
+
* - cursor: Cursor state.vscdb (SQLite)
|
|
11
|
+
* - windsurf: Windsurf state.vscdb (SQLite)
|
|
12
|
+
* - export: `aspectcode-prompts.jsonl` (JSONL, user-provided)
|
|
13
|
+
*
|
|
14
|
+
* SQLite sources require the optional `better-sqlite3` dependency.
|
|
15
|
+
* If unavailable, those sources are gracefully skipped.
|
|
16
|
+
*/
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.harvestExport = exports.harvestWindsurf = exports.harvestCursor = exports.harvestCopilotChat = exports.harvestCline = exports.harvestClaudeCode = exports.harvestAider = void 0;
|
|
19
|
+
exports.harvestPrompts = harvestPrompts;
|
|
20
|
+
const common_1 = require("./common");
|
|
21
|
+
const aider_1 = require("./aider");
|
|
22
|
+
const claudeCode_1 = require("./claudeCode");
|
|
23
|
+
const cline_1 = require("./cline");
|
|
24
|
+
const vscodeDb_1 = require("./vscodeDb");
|
|
25
|
+
const export_1 = require("./export");
|
|
26
|
+
/** All supported prompt sources. */
|
|
27
|
+
const ALL_SOURCES = [
|
|
28
|
+
'aider',
|
|
29
|
+
'claude-code',
|
|
30
|
+
'cline',
|
|
31
|
+
'copilot-chat',
|
|
32
|
+
'cursor',
|
|
33
|
+
'windsurf',
|
|
34
|
+
'export',
|
|
35
|
+
];
|
|
36
|
+
/** Map from source name to harvester function. */
|
|
37
|
+
const HARVESTERS = {
|
|
38
|
+
'aider': aider_1.harvestAider,
|
|
39
|
+
'claude-code': claudeCode_1.harvestClaudeCode,
|
|
40
|
+
'cline': cline_1.harvestCline,
|
|
41
|
+
'copilot-chat': vscodeDb_1.harvestCopilotChat,
|
|
42
|
+
'cursor': vscodeDb_1.harvestCursor,
|
|
43
|
+
'windsurf': vscodeDb_1.harvestWindsurf,
|
|
44
|
+
'export': export_1.harvestExport,
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* Harvest prompts from all configured AI tool conversation histories.
|
|
48
|
+
*
|
|
49
|
+
* Each source is attempted independently — failures in one source
|
|
50
|
+
* don't prevent harvesting from others.
|
|
51
|
+
*/
|
|
52
|
+
async function harvestPrompts(options) {
|
|
53
|
+
const log = options.log ?? common_1.noopLogger;
|
|
54
|
+
const sources = options.sources ?? ALL_SOURCES;
|
|
55
|
+
const maxPerSource = options.maxPerSource ?? 50;
|
|
56
|
+
const allPrompts = [];
|
|
57
|
+
for (const source of sources) {
|
|
58
|
+
const harvester = HARVESTERS[source];
|
|
59
|
+
if (!harvester) {
|
|
60
|
+
log.warn(`harvest: unknown source "${source}", skipping`);
|
|
61
|
+
continue;
|
|
62
|
+
}
|
|
63
|
+
try {
|
|
64
|
+
const prompts = await harvester(options.root, {
|
|
65
|
+
max: maxPerSource,
|
|
66
|
+
since: options.since,
|
|
67
|
+
log,
|
|
68
|
+
});
|
|
69
|
+
allPrompts.push(...prompts);
|
|
70
|
+
if (prompts.length > 0) {
|
|
71
|
+
log.info(`harvest: ${source} → ${prompts.length} prompts`);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
catch (err) {
|
|
75
|
+
log.debug(`harvest: ${source} failed: ${err}`);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
log.info(`harvest: total ${allPrompts.length} prompts from ${sources.length} sources`);
|
|
79
|
+
return allPrompts;
|
|
80
|
+
}
|
|
81
|
+
// Re-export individual harvesters for direct use
|
|
82
|
+
var aider_2 = require("./aider");
|
|
83
|
+
Object.defineProperty(exports, "harvestAider", { enumerable: true, get: function () { return aider_2.harvestAider; } });
|
|
84
|
+
var claudeCode_2 = require("./claudeCode");
|
|
85
|
+
Object.defineProperty(exports, "harvestClaudeCode", { enumerable: true, get: function () { return claudeCode_2.harvestClaudeCode; } });
|
|
86
|
+
var cline_2 = require("./cline");
|
|
87
|
+
Object.defineProperty(exports, "harvestCline", { enumerable: true, get: function () { return cline_2.harvestCline; } });
|
|
88
|
+
var vscodeDb_2 = require("./vscodeDb");
|
|
89
|
+
Object.defineProperty(exports, "harvestCopilotChat", { enumerable: true, get: function () { return vscodeDb_2.harvestCopilotChat; } });
|
|
90
|
+
Object.defineProperty(exports, "harvestCursor", { enumerable: true, get: function () { return vscodeDb_2.harvestCursor; } });
|
|
91
|
+
Object.defineProperty(exports, "harvestWindsurf", { enumerable: true, get: function () { return vscodeDb_2.harvestWindsurf; } });
|
|
92
|
+
var export_2 = require("./export");
|
|
93
|
+
Object.defineProperty(exports, "harvestExport", { enumerable: true, get: function () { return export_2.harvestExport; } });
|
|
94
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/harvest/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAyCH,wCA+BC;AArED,qCAAsC;AACtC,mCAAuC;AACvC,6CAAiD;AACjD,mCAAuC;AACvC,yCAAgF;AAChF,qCAAyC;AAEzC,oCAAoC;AACpC,MAAM,WAAW,GAAmB;IAClC,OAAO;IACP,aAAa;IACb,OAAO;IACP,cAAc;IACd,QAAQ;IACR,UAAU;IACV,QAAQ;CACT,CAAC;AAEF,kDAAkD;AAClD,MAAM,UAAU,GAGmB;IACjC,OAAO,EAAE,oBAAY;IACrB,aAAa,EAAE,8BAAiB;IAChC,OAAO,EAAE,oBAAY;IACrB,cAAc,EAAE,6BAAkB;IAClC,QAAQ,EAAE,wBAAa;IACvB,UAAU,EAAE,0BAAe;IAC3B,QAAQ,EAAE,sBAAa;CACxB,CAAC;AAEF;;;;;GAKG;AACI,KAAK,UAAU,cAAc,CAAC,OAAuB;IAC1D,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,IAAI,mBAAU,CAAC;IACtC,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,IAAI,WAAW,CAAC;IAC/C,MAAM,YAAY,GAAG,OAAO,CAAC,YAAY,IAAI,EAAE,CAAC;IAEhD,MAAM,UAAU,GAAsB,EAAE,CAAC;IAEzC,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;QAC7B,MAAM,SAAS,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC;QACrC,IAAI,CAAC,SAAS,EAAE,CAAC;YACf,GAAG,CAAC,IAAI,CAAC,4BAA4B,MAAM,aAAa,CAAC,CAAC;YAC1D,SAAS;QACX,CAAC;QAED,IAAI,CAAC;YACH,MAAM,OAAO,GAAG,MAAM,SAAS,CAAC,OAAO,CAAC,IAAI,EAAE;gBAC5C,GAAG,EAAE,YAAY;gBACjB,KAAK,EAAE,OAAO,CAAC,KAAK;gBACpB,GAAG;aACJ,CAAC,CAAC;YACH,UAAU,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,CAAC;YAC5B,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBACvB,GAAG,CAAC,IAAI,CAAC,YAAY,MAAM,MAAM,OAAO,CAAC,MAAM,UAAU,CAAC,CAAC;YAC7D,CAAC;QACH,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,GAAG,CAAC,KAAK,CAAC,YAAY,MAAM,YAAY,GAAG,EAAE,CAAC,CAAC;QACjD,CAAC;IACH,CAAC;IAED,GAAG,CAAC,IAAI,CAAC,kBAAkB,UAAU,CAAC,MAAM,iBAAiB,OAAO,CAAC,MAAM,UAAU,CAAC,CAAC;IACvF,OAAO,UAAU,CAAC;AACpB,CAAC;AAED,iDAAiD;AACjD,iCAAuC;AAA9B,qGAAA,YAAY,OAAA;AACrB,2CAAiD;AAAxC,+GAAA,iBAAiB,OAAA;AAC1B,iCAAuC;AAA9B,qGAAA,YAAY,OAAA;AACrB,uCAAgF;AAAvE,8GAAA,kBAAkB,OAAA;AAAE,yGAAA,aAAa,OAAA;AAAE,2GAAA,eAAe,OAAA;AAC3D,mCAAyC;AAAhC,uGAAA,aAAa,OAAA"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SQLite-based prompt harvester for VS Code forks (Copilot Chat, Cursor, Windsurf).
|
|
3
|
+
*
|
|
4
|
+
* All three store conversations in `state.vscdb` — a SQLite database with an
|
|
5
|
+
* `ItemTable(key TEXT, value TEXT)` key-value schema. The difference is which
|
|
6
|
+
* keys hold the conversation data and the JSON shape within.
|
|
7
|
+
*
|
|
8
|
+
* `better-sqlite3` is an optional dependency. If unavailable, these
|
|
9
|
+
* harvesters gracefully return empty arrays.
|
|
10
|
+
*/
|
|
11
|
+
import type { HarvestedPrompt } from '../types';
|
|
12
|
+
import type { OptLogger } from '../types';
|
|
13
|
+
/**
|
|
14
|
+
* Harvest prompts from GitHub Copilot Chat conversations.
|
|
15
|
+
*/
|
|
16
|
+
export declare function harvestCopilotChat(root: string, options?: {
|
|
17
|
+
max?: number;
|
|
18
|
+
since?: Date;
|
|
19
|
+
log?: OptLogger;
|
|
20
|
+
}): Promise<HarvestedPrompt[]>;
|
|
21
|
+
/**
|
|
22
|
+
* Harvest prompts from Cursor's conversation history.
|
|
23
|
+
*/
|
|
24
|
+
export declare function harvestCursor(root: string, options?: {
|
|
25
|
+
max?: number;
|
|
26
|
+
since?: Date;
|
|
27
|
+
log?: OptLogger;
|
|
28
|
+
}): Promise<HarvestedPrompt[]>;
|
|
29
|
+
/**
|
|
30
|
+
* Harvest prompts from Windsurf's conversation history.
|
|
31
|
+
*/
|
|
32
|
+
export declare function harvestWindsurf(root: string, options?: {
|
|
33
|
+
max?: number;
|
|
34
|
+
since?: Date;
|
|
35
|
+
log?: OptLogger;
|
|
36
|
+
}): Promise<HarvestedPrompt[]>;
|
|
37
|
+
//# sourceMappingURL=vscodeDb.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vscodeDb.d.ts","sourceRoot":"","sources":["../../src/harvest/vscodeDb.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAKH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAShD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAsD1C;;GAEG;AACH,wBAAsB,kBAAkB,CACtC,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,IAAI,CAAC;IAAC,GAAG,CAAC,EAAE,SAAS,CAAA;CAAE,GACxD,OAAO,CAAC,eAAe,EAAE,CAAC,CA6C5B;AA8ED;;GAEG;AACH,wBAAsB,aAAa,CACjC,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,IAAI,CAAC;IAAC,GAAG,CAAC,EAAE,SAAS,CAAA;CAAE,GACxD,OAAO,CAAC,eAAe,EAAE,CAAC,CAgC5B;AAyHD;;GAEG;AACH,wBAAsB,eAAe,CACnC,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,IAAI,CAAC;IAAC,GAAG,CAAC,EAAE,SAAS,CAAA;CAAE,GACxD,OAAO,CAAC,eAAe,EAAE,CAAC,CAoC5B"}
|