smart-commit-copilot-cli 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/CHANGELOG.md +31 -0
- package/LICENSE +21 -0
- package/README.md +392 -0
- package/docs/configuration.md +262 -0
- package/docs/contracts.md +134 -0
- package/docs/getting-started.md +177 -0
- package/docs/integrations.md +85 -0
- package/docs/publish.md +135 -0
- package/docs/release-checklist.md +39 -0
- package/docs/releases/0.1.0-draft.md +52 -0
- package/docs/roadmap.md +94 -0
- package/examples/agent/bridge-agent.mjs +51 -0
- package/examples/agent/report-agent.mjs +48 -0
- package/examples/config/smart-commit.json +60 -0
- package/examples/hooks/cursor-bridge-wrapper.sh +12 -0
- package/examples/hooks/husky-pre-commit.sh +6 -0
- package/examples/hooks/smart-commit-bridge.sh +11 -0
- package/out/cli.js +19 -0
- package/out/cli.js.map +1 -0
- package/out/cliApp.js +239 -0
- package/out/cliApp.js.map +1 -0
- package/out/commands/bridge.js +607 -0
- package/out/commands/bridge.js.map +1 -0
- package/out/commands/report.js +266 -0
- package/out/commands/report.js.map +1 -0
- package/out/commands/types.js +3 -0
- package/out/commands/types.js.map +1 -0
- package/out/commitMessage/index.js +110 -0
- package/out/commitMessage/index.js.map +1 -0
- package/out/commitMessage/mockProvider.js +27 -0
- package/out/commitMessage/mockProvider.js.map +1 -0
- package/out/commitMessage/openaiProvider.js +44 -0
- package/out/commitMessage/openaiProvider.js.map +1 -0
- package/out/commitMessage/prompt.js +65 -0
- package/out/commitMessage/prompt.js.map +1 -0
- package/out/commitMessage/protocol.js +126 -0
- package/out/commitMessage/protocol.js.map +1 -0
- package/out/commitMessage/provider.js +3 -0
- package/out/commitMessage/provider.js.map +1 -0
- package/out/config/cliArgs.js +249 -0
- package/out/config/cliArgs.js.map +1 -0
- package/out/config/constants.js +47 -0
- package/out/config/constants.js.map +1 -0
- package/out/config/env.js +183 -0
- package/out/config/env.js.map +1 -0
- package/out/config/file.js +245 -0
- package/out/config/file.js.map +1 -0
- package/out/config/index.js +46 -0
- package/out/config/index.js.map +1 -0
- package/out/config/legacySmartCommit.js +200 -0
- package/out/config/legacySmartCommit.js.map +1 -0
- package/out/config/merge.js +70 -0
- package/out/config/merge.js.map +1 -0
- package/out/config/runtime.js +36 -0
- package/out/config/runtime.js.map +1 -0
- package/out/config/schema.js +204 -0
- package/out/config/schema.js.map +1 -0
- package/out/contracts.js +311 -0
- package/out/contracts.js.map +1 -0
- package/out/git.js +119 -0
- package/out/git.js.map +1 -0
- package/out/logger.js +17 -0
- package/out/logger.js.map +1 -0
- package/out/openaiCompatible.js +67 -0
- package/out/openaiCompatible.js.map +1 -0
- package/out/output.js +23 -0
- package/out/output.js.map +1 -0
- package/out/passHistory/index.js +119 -0
- package/out/passHistory/index.js.map +1 -0
- package/out/passHistory/store.js +252 -0
- package/out/passHistory/store.js.map +1 -0
- package/out/passHistory/types.js +6 -0
- package/out/passHistory/types.js.map +1 -0
- package/out/promptContext.js +72 -0
- package/out/promptContext.js.map +1 -0
- package/out/renderOutput.js +89 -0
- package/out/renderOutput.js.map +1 -0
- package/out/reporting/aggregate.js +113 -0
- package/out/reporting/aggregate.js.map +1 -0
- package/out/reporting/index.js +72 -0
- package/out/reporting/index.js.map +1 -0
- package/out/reporting/mockProvider.js +25 -0
- package/out/reporting/mockProvider.js.map +1 -0
- package/out/reporting/openaiProvider.js +19 -0
- package/out/reporting/openaiProvider.js.map +1 -0
- package/out/reporting/prompt.js +28 -0
- package/out/reporting/prompt.js.map +1 -0
- package/out/reporting/provider.js +3 -0
- package/out/reporting/provider.js.map +1 -0
- package/out/reporting/render.js +151 -0
- package/out/reporting/render.js.map +1 -0
- package/out/reporting/timeWindow.js +79 -0
- package/out/reporting/timeWindow.js.map +1 -0
- package/out/reporting/types.js +11 -0
- package/out/reporting/types.js.map +1 -0
- package/out/review/index.js +64 -0
- package/out/review/index.js.map +1 -0
- package/out/review/mockProvider.js +57 -0
- package/out/review/mockProvider.js.map +1 -0
- package/out/review/openaiProvider.js +40 -0
- package/out/review/openaiProvider.js.map +1 -0
- package/out/review/parser.js +92 -0
- package/out/review/parser.js.map +1 -0
- package/out/review/prompt.js +61 -0
- package/out/review/prompt.js.map +1 -0
- package/out/review/provider.js +3 -0
- package/out/review/provider.js.map +1 -0
- package/out/review/types.js +3 -0
- package/out/review/types.js.map +1 -0
- package/package.json +44 -0
package/out/logger.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.shouldLog = shouldLog;
|
|
4
|
+
exports.formatLogLine = formatLogLine;
|
|
5
|
+
const priorities = {
|
|
6
|
+
debug: 10,
|
|
7
|
+
info: 20,
|
|
8
|
+
warn: 30,
|
|
9
|
+
error: 40
|
|
10
|
+
};
|
|
11
|
+
function shouldLog(activeLevel, messageLevel) {
|
|
12
|
+
return priorities[messageLevel] >= priorities[activeLevel];
|
|
13
|
+
}
|
|
14
|
+
function formatLogLine(level, message) {
|
|
15
|
+
return `[smart-commit][${level}] ${message}\n`;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=logger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":";;AASA,8BAEC;AAED,sCAEC;AAbD,MAAM,UAAU,GAAgC;IAC9C,KAAK,EAAE,EAAE;IACT,IAAI,EAAE,EAAE;IACR,IAAI,EAAE,EAAE;IACR,KAAK,EAAE,EAAE;CACV,CAAC;AAEF,SAAgB,SAAS,CAAC,WAAwB,EAAE,YAAyB;IAC3E,OAAO,UAAU,CAAC,YAAY,CAAC,IAAI,UAAU,CAAC,WAAW,CAAC,CAAC;AAC7D,CAAC;AAED,SAAgB,aAAa,CAAC,KAAkB,EAAE,OAAe;IAC/D,OAAO,kBAAkB,KAAK,KAAK,OAAO,IAAI,CAAC;AACjD,CAAC"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.requestOpenAICompatibleText = requestOpenAICompatibleText;
|
|
4
|
+
async function requestOpenAICompatibleText(input) {
|
|
5
|
+
const timeoutSignal = AbortSignal.timeout(Math.max(1, input.config.connection.requestTimeoutMs));
|
|
6
|
+
let response;
|
|
7
|
+
try {
|
|
8
|
+
response = await fetch(buildChatCompletionsUrl(input.config.connection.baseUrl), {
|
|
9
|
+
method: "POST",
|
|
10
|
+
headers: {
|
|
11
|
+
"Content-Type": "application/json",
|
|
12
|
+
Authorization: `Bearer ${input.config.connection.apiKey}`,
|
|
13
|
+
...input.config.connection.extraHeaders
|
|
14
|
+
},
|
|
15
|
+
body: JSON.stringify({
|
|
16
|
+
model: input.config.connection.model,
|
|
17
|
+
messages: input.messages,
|
|
18
|
+
temperature: input.temperature,
|
|
19
|
+
stream: false
|
|
20
|
+
}),
|
|
21
|
+
signal: timeoutSignal
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
catch (error) {
|
|
25
|
+
if (isAbortError(error) || timeoutSignal.aborted) {
|
|
26
|
+
throw new Error(`LLM ${input.taskLabel} request timed out after ${input.config.connection.requestTimeoutMs}ms.`);
|
|
27
|
+
}
|
|
28
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
29
|
+
throw new Error(`LLM ${input.taskLabel} request failed: ${message}`);
|
|
30
|
+
}
|
|
31
|
+
const text = await response.text();
|
|
32
|
+
if (!response.ok) {
|
|
33
|
+
throw new Error(`LLM ${input.taskLabel} request failed with status ${response.status}: ${text}`);
|
|
34
|
+
}
|
|
35
|
+
let data;
|
|
36
|
+
try {
|
|
37
|
+
data = JSON.parse(text);
|
|
38
|
+
}
|
|
39
|
+
catch (error) {
|
|
40
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
41
|
+
throw new Error(`Failed to parse LLM response JSON: ${message}`);
|
|
42
|
+
}
|
|
43
|
+
const content = extractContent(data);
|
|
44
|
+
if (!content) {
|
|
45
|
+
throw new Error(`LLM ${input.taskLabel} response did not contain message content.`);
|
|
46
|
+
}
|
|
47
|
+
return content.trim();
|
|
48
|
+
}
|
|
49
|
+
function buildChatCompletionsUrl(baseUrl) {
|
|
50
|
+
const normalized = baseUrl.trim().replace(/\/+$/, "");
|
|
51
|
+
return normalized.endsWith("/chat/completions") ? normalized : `${normalized}/chat/completions`;
|
|
52
|
+
}
|
|
53
|
+
function extractContent(response) {
|
|
54
|
+
const content = response.choices?.[0]?.message?.content;
|
|
55
|
+
if (typeof content === "string") {
|
|
56
|
+
return content;
|
|
57
|
+
}
|
|
58
|
+
if (Array.isArray(content)) {
|
|
59
|
+
return content.map((item) => item.text || "").join("").trim();
|
|
60
|
+
}
|
|
61
|
+
return "";
|
|
62
|
+
}
|
|
63
|
+
function isAbortError(error) {
|
|
64
|
+
return ((typeof DOMException !== "undefined" && error instanceof DOMException && error.name === "AbortError") ||
|
|
65
|
+
(error instanceof Error && error.name === "AbortError"));
|
|
66
|
+
}
|
|
67
|
+
//# sourceMappingURL=openaiCompatible.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"openaiCompatible.js","sourceRoot":"","sources":["../src/openaiCompatible.ts"],"names":[],"mappings":";;AAYA,kEAuDC;AAvDM,KAAK,UAAU,2BAA2B,CAAC,KAKjD;IACC,MAAM,aAAa,GAAG,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,UAAU,CAAC,gBAAgB,CAAC,CAAC,CAAC;IAEjG,IAAI,QAAkB,CAAC;IACvB,IAAI,CAAC;QACH,QAAQ,GAAG,MAAM,KAAK,CAAC,uBAAuB,CAAC,KAAK,CAAC,MAAM,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE;YAC/E,MAAM,EAAE,MAAM;YACd,OAAO,EAAE;gBACP,cAAc,EAAE,kBAAkB;gBAClC,aAAa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WAAW,IAAI,KAAK,YAAY,YAAY,IAAI,KAAK,CAAC,IAAI,KAAK,YAAY,CAAC;QACrG,CAAC,KAAK,YAAY,KAAK,IAAI,KAAK,CAAC,IAAI,KAAK,YAAY,CAAC,CACxD,CAAC;AACJ,CAAC"}
|
package/out/output.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.redactCliConfig = redactCliConfig;
|
|
4
|
+
function redactCliConfig(config) {
|
|
5
|
+
return {
|
|
6
|
+
...config,
|
|
7
|
+
connection: {
|
|
8
|
+
...config.connection,
|
|
9
|
+
apiKey: redactSecret(config.connection.apiKey)
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
function redactSecret(value) {
|
|
14
|
+
const trimmed = value.trim();
|
|
15
|
+
if (!trimmed) {
|
|
16
|
+
return "";
|
|
17
|
+
}
|
|
18
|
+
if (trimmed.length <= 4) {
|
|
19
|
+
return "*".repeat(trimmed.length);
|
|
20
|
+
}
|
|
21
|
+
return `${"*".repeat(Math.max(4, trimmed.length - 4))}${trimmed.slice(-4)}`;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=output.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"output.js","sourceRoot":"","sources":["../src/output.ts"],"names":[],"mappings":";;AAUA,0CAQC;AARD,SAAgB,eAAe,CAAC,MAAiB;IAC/C,OAAO;QACL,GAAG,MAAM;QACT,UAAU,EAAE;YACV,GAAG,MAAM,CAAC,UAAU;YACpB,MAAM,EAAE,YAAY,CAAC,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC;SAC/C;KACF,CAAC;AACJ,CAAC;AAED,SAAS,YAAY,CAAC,KAAa;IACjC,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;IAC7B,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,IAAI,OAAO,CAAC,MAAM,IAAI,CAAC,EAAE,CAAC;QACxB,OAAO,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IACpC,CAAC;IAED,OAAO,GAAG,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AAC9E,CAAC"}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
36
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.maybeWritePassHistoryRecord = maybeWritePassHistoryRecord;
|
|
40
|
+
const path = __importStar(require("node:path"));
|
|
41
|
+
const store_1 = require("./store");
|
|
42
|
+
__exportStar(require("./store"), exports);
|
|
43
|
+
__exportStar(require("./types"), exports);
|
|
44
|
+
async function maybeWritePassHistoryRecord(input) {
|
|
45
|
+
if (!input.config.passHistory.enabled) {
|
|
46
|
+
return {
|
|
47
|
+
enabled: false,
|
|
48
|
+
wrote: false,
|
|
49
|
+
filePath: null,
|
|
50
|
+
eventType: null,
|
|
51
|
+
error: null
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
const filePath = (0, store_1.resolvePassHistoryFilePath)({
|
|
55
|
+
configuredDirPath: input.config.passHistory.dirPath,
|
|
56
|
+
repositoryPath: input.repositoryPath
|
|
57
|
+
});
|
|
58
|
+
try {
|
|
59
|
+
const record = buildPassHistoryRecord(input);
|
|
60
|
+
await (0, store_1.appendPassHistoryRecord)({
|
|
61
|
+
filePath,
|
|
62
|
+
record,
|
|
63
|
+
maxEntries: input.config.passHistory.maxEntries
|
|
64
|
+
});
|
|
65
|
+
return {
|
|
66
|
+
enabled: true,
|
|
67
|
+
wrote: true,
|
|
68
|
+
filePath,
|
|
69
|
+
eventType: input.eventType,
|
|
70
|
+
error: null
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
catch (error) {
|
|
74
|
+
return {
|
|
75
|
+
enabled: true,
|
|
76
|
+
wrote: false,
|
|
77
|
+
filePath,
|
|
78
|
+
eventType: input.eventType,
|
|
79
|
+
error: error instanceof Error ? error.message : String(error)
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
function buildPassHistoryRecord(input) {
|
|
84
|
+
const timestampMetadata = (0, store_1.createPassHistoryTimestampMetadata)();
|
|
85
|
+
return {
|
|
86
|
+
timestamp: timestampMetadata.timestamp,
|
|
87
|
+
timestampMs: timestampMetadata.timestampMs,
|
|
88
|
+
timezoneOffsetMinutes: timestampMetadata.timezoneOffsetMinutes,
|
|
89
|
+
id: (0, store_1.createPassHistoryRecordId)(),
|
|
90
|
+
eventType: input.eventType,
|
|
91
|
+
repositoryPath: input.repositoryPath,
|
|
92
|
+
repositoryName: path.basename(input.repositoryPath),
|
|
93
|
+
branchName: input.branchName,
|
|
94
|
+
model: input.config.connection.model,
|
|
95
|
+
threshold: input.config.review.threshold,
|
|
96
|
+
reviewMode: "single",
|
|
97
|
+
decision: input.reviewDecision,
|
|
98
|
+
score: input.score,
|
|
99
|
+
reviewSummary: input.reviewSummary,
|
|
100
|
+
fullDiffChars: input.fullDiffChars,
|
|
101
|
+
commitMessage: input.commitMessage,
|
|
102
|
+
commitMessageSource: mapCommitMessageSource(input.commitMessageSource),
|
|
103
|
+
codeReviewSkillId: input.config.review.skill.path ? "custom" : input.config.review.skill.id,
|
|
104
|
+
gitCommitMessageSkillId: input.config.commitMessage.skill.path ? "custom" : input.config.commitMessage.skill.id,
|
|
105
|
+
autoCommitAndPush: input.config.git.autoCommit && input.config.git.autoPush,
|
|
106
|
+
autoCommit: input.config.git.autoCommit,
|
|
107
|
+
autoPush: input.config.git.autoPush,
|
|
108
|
+
didCommit: input.didCommit,
|
|
109
|
+
didPush: input.didPush,
|
|
110
|
+
commitSHA: input.commitSha
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
function mapCommitMessageSource(source) {
|
|
114
|
+
if (source === "provided") {
|
|
115
|
+
return "user";
|
|
116
|
+
}
|
|
117
|
+
return source;
|
|
118
|
+
}
|
|
119
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/passHistory/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQA,kEAsDC;AA9DD,gDAAkC;AAElC,mCAA6I;AAG7I,0CAAwB;AACxB,0CAAwB;AAEjB,KAAK,UAAU,2BAA2B,CAAC,KAcjD;IACC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,WAAW,CAAC,OAAO,EAAE,CAAC;QACtC,OAAO;YACL,OAAO,EAAE,KAAK;YACd,KAAK,EAAE,KAAK;YACZ,QAAQ,EAAE,IAAI;YACd,SAAS,EAAE,IAAI;YACf,KAAK,EAAE,IAAI;SACZ,CAAC;IACJ,CAAC;IAED,MAAM,QAAQ,GAAG,IAAA,kCAA0B,EAAC;QAC1C,iBAAiB,EAAE,KAAK,CAAC,MAAM,CAAC,WAAW,CAAC,OAAO;QACnD,cAAc,EAAE,KAAK,CAAC,cAAc;KACrC,CAAC,CAAC;IAEH,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,sBAAsB,CAAC,KAAK,CAAC,CAAC;QAC7C,MAAM,IAAA,+BAAuB,EAAC;YAC5B,QAAQ;YACR,MAAM;YACN,UAAU,EAAE,KAAK,CAAC,MAAM,CAAC,WAAW,CAAC,UAAU;SAChD,CAAC,CAAC;QAEH,OAAO;YACL,OAAO,EAAE,IAAI;YACb,KAAK,EAAE,IAAI;YACX,QAAQ;YACR,SAAS,EAAE,KAAK,CAAC,SAAS;YAC1B,KAAK,EAAE,IAAI;SACZ,CAAC;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO;YACL,OAAO,EAAE,IAAI;YACb,KAA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E,KAAK,CAAC,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,EAAE;QAC/G,iBAAiB,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,UAAU,IAAI,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,QAAQ;QAC3E,UAAU,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,UAAU;QACvC,QAAQ,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,QAAQ;QACnC,SAAS,EAAE,KAAK,CAAC,SAAS;QAC1B,OAAO,EAAE,KAAK,CAAC,OAAO;QACtB,SAAS,EAAE,KAAK,CAAC,SAAS;KAC3B,CAAC;AACJ,CAAC;AAED,SAAS,sBAAsB,CAC7B,MAA2C;IAE3C,IAAI,MAAM,KAAK,UAAU,EAAE,CAAC;QAC1B,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.resolvePassHistoryDirectoryPath = resolvePassHistoryDirectoryPath;
|
|
37
|
+
exports.resolvePassHistoryFilePath = resolvePassHistoryFilePath;
|
|
38
|
+
exports.createPassHistoryRecordId = createPassHistoryRecordId;
|
|
39
|
+
exports.formatLocalTimestamp = formatLocalTimestamp;
|
|
40
|
+
exports.createPassHistoryTimestampMetadata = createPassHistoryTimestampMetadata;
|
|
41
|
+
exports.appendPassHistoryRecord = appendPassHistoryRecord;
|
|
42
|
+
exports.loadPassHistoryRecords = loadPassHistoryRecords;
|
|
43
|
+
const fs = __importStar(require("node:fs/promises"));
|
|
44
|
+
const path = __importStar(require("node:path"));
|
|
45
|
+
const types_1 = require("./types");
|
|
46
|
+
function resolvePassHistoryDirectoryPath(input) {
|
|
47
|
+
const configuredDirPath = input.configuredDirPath.trim();
|
|
48
|
+
if (!configuredDirPath) {
|
|
49
|
+
return path.join(path.normalize(input.repositoryPath), types_1.DEFAULT_PASS_HISTORY_DIRECTORY_NAME);
|
|
50
|
+
}
|
|
51
|
+
return path.isAbsolute(configuredDirPath)
|
|
52
|
+
? path.normalize(configuredDirPath)
|
|
53
|
+
: path.resolve(input.repositoryPath, configuredDirPath);
|
|
54
|
+
}
|
|
55
|
+
function resolvePassHistoryFilePath(input) {
|
|
56
|
+
return path.join(resolvePassHistoryDirectoryPath(input), types_1.PASS_HISTORY_FILE_NAME);
|
|
57
|
+
}
|
|
58
|
+
function createPassHistoryRecordId(now = new Date()) {
|
|
59
|
+
return `${now.getTime()}-${Math.random().toString(36).slice(2, 10)}`;
|
|
60
|
+
}
|
|
61
|
+
function formatLocalTimestamp(now = new Date()) {
|
|
62
|
+
const year = now.getFullYear();
|
|
63
|
+
const month = String(now.getMonth() + 1).padStart(2, "0");
|
|
64
|
+
const day = String(now.getDate()).padStart(2, "0");
|
|
65
|
+
const hours = String(now.getHours()).padStart(2, "0");
|
|
66
|
+
const minutes = String(now.getMinutes()).padStart(2, "0");
|
|
67
|
+
const seconds = String(now.getSeconds()).padStart(2, "0");
|
|
68
|
+
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
|
|
69
|
+
}
|
|
70
|
+
function createPassHistoryTimestampMetadata(now = new Date()) {
|
|
71
|
+
return {
|
|
72
|
+
timestamp: formatLocalTimestamp(now),
|
|
73
|
+
timestampMs: now.getTime(),
|
|
74
|
+
timezoneOffsetMinutes: now.getTimezoneOffset()
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
async function appendPassHistoryRecord(input) {
|
|
78
|
+
const directoryPath = path.dirname(input.filePath);
|
|
79
|
+
await ensureDirectory(directoryPath);
|
|
80
|
+
await ensureFileExists(input.filePath);
|
|
81
|
+
const content = await fs.readFile(input.filePath, "utf8");
|
|
82
|
+
const lines = content.split(/\r?\n/).filter((line) => line.trim().length > 0);
|
|
83
|
+
const updatedLines = [JSON.stringify(input.record), ...lines].slice(0, input.maxEntries);
|
|
84
|
+
await fs.writeFile(input.filePath, `${updatedLines.join("\n")}\n`, "utf8");
|
|
85
|
+
}
|
|
86
|
+
async function loadPassHistoryRecords(filePath) {
|
|
87
|
+
let content = "";
|
|
88
|
+
try {
|
|
89
|
+
content = await fs.readFile(filePath, "utf8");
|
|
90
|
+
}
|
|
91
|
+
catch (error) {
|
|
92
|
+
if (isNotFoundError(error)) {
|
|
93
|
+
return {
|
|
94
|
+
records: [],
|
|
95
|
+
warnings: [`Pass history file not found: ${filePath}`]
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
throw error;
|
|
99
|
+
}
|
|
100
|
+
const records = [];
|
|
101
|
+
const warnings = [];
|
|
102
|
+
const lines = content.split(/\r?\n/);
|
|
103
|
+
for (const [index, line] of lines.entries()) {
|
|
104
|
+
if (!line.trim()) {
|
|
105
|
+
continue;
|
|
106
|
+
}
|
|
107
|
+
try {
|
|
108
|
+
records.push(parsePassHistoryRecord(line));
|
|
109
|
+
}
|
|
110
|
+
catch (error) {
|
|
111
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
112
|
+
warnings.push(`Skipped invalid pass history line ${index + 1}: ${message}`);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
return { records, warnings };
|
|
116
|
+
}
|
|
117
|
+
async function ensureDirectory(directoryPath) {
|
|
118
|
+
try {
|
|
119
|
+
const stats = await fs.stat(directoryPath);
|
|
120
|
+
if (!stats.isDirectory()) {
|
|
121
|
+
throw new Error(`Configured pass history directory is not a directory: ${directoryPath}`);
|
|
122
|
+
}
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
catch (error) {
|
|
126
|
+
if (isNotFoundError(error)) {
|
|
127
|
+
await fs.mkdir(directoryPath, { recursive: true });
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
throw error;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
async function ensureFileExists(filePath) {
|
|
134
|
+
try {
|
|
135
|
+
const stats = await fs.stat(filePath);
|
|
136
|
+
if (!stats.isFile()) {
|
|
137
|
+
throw new Error(`Pass history path is not a file: ${filePath}`);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
catch (error) {
|
|
141
|
+
if (isNotFoundError(error)) {
|
|
142
|
+
await fs.writeFile(filePath, "", "utf8");
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
throw error;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
function parsePassHistoryRecord(line) {
|
|
149
|
+
let parsed;
|
|
150
|
+
try {
|
|
151
|
+
parsed = JSON.parse(line);
|
|
152
|
+
}
|
|
153
|
+
catch (error) {
|
|
154
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
155
|
+
throw new Error(`invalid JSON: ${message}`);
|
|
156
|
+
}
|
|
157
|
+
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) {
|
|
158
|
+
throw new Error("record must be a JSON object");
|
|
159
|
+
}
|
|
160
|
+
const record = parsed;
|
|
161
|
+
return {
|
|
162
|
+
timestamp: requireString(record.timestamp, "timestamp"),
|
|
163
|
+
timestampMs: requireFiniteNumber(record.timestampMs, "timestampMs"),
|
|
164
|
+
timezoneOffsetMinutes: requireFiniteNumber(record.timezoneOffsetMinutes, "timezoneOffsetMinutes"),
|
|
165
|
+
id: requireString(record.id, "id"),
|
|
166
|
+
eventType: requireEventType(record.eventType),
|
|
167
|
+
repositoryPath: requireString(record.repositoryPath, "repositoryPath"),
|
|
168
|
+
repositoryName: requireString(record.repositoryName, "repositoryName"),
|
|
169
|
+
branchName: requireString(record.branchName, "branchName"),
|
|
170
|
+
model: requireString(record.model, "model"),
|
|
171
|
+
threshold: requireFiniteNumber(record.threshold, "threshold"),
|
|
172
|
+
reviewMode: requireReviewMode(record.reviewMode),
|
|
173
|
+
decision: requireDecision(record.decision),
|
|
174
|
+
score: parseNullableNumber(record.score, "score"),
|
|
175
|
+
reviewSummary: requireString(record.reviewSummary, "reviewSummary"),
|
|
176
|
+
fullDiffChars: requireFiniteNumber(record.fullDiffChars, "fullDiffChars"),
|
|
177
|
+
commitMessage: requireString(record.commitMessage, "commitMessage"),
|
|
178
|
+
commitMessageSource: requireCommitMessageSource(record.commitMessageSource),
|
|
179
|
+
codeReviewSkillId: requireString(record.codeReviewSkillId, "codeReviewSkillId"),
|
|
180
|
+
gitCommitMessageSkillId: requireString(record.gitCommitMessageSkillId, "gitCommitMessageSkillId"),
|
|
181
|
+
autoCommitAndPush: requireBoolean(record.autoCommitAndPush, "autoCommitAndPush"),
|
|
182
|
+
autoCommit: parseOptionalBoolean(record.autoCommit, true),
|
|
183
|
+
autoPush: parseOptionalBoolean(record.autoPush, true),
|
|
184
|
+
didCommit: parseOptionalBoolean(record.didCommit, record.commitSHA !== null),
|
|
185
|
+
didPush: parseOptionalBoolean(record.didPush, record.eventType === "commit_push_completed"),
|
|
186
|
+
commitSHA: parseNullableString(record.commitSHA, "commitSHA")
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
function isNotFoundError(error) {
|
|
190
|
+
return Boolean(error && typeof error === "object" && "code" in error && error.code === "ENOENT");
|
|
191
|
+
}
|
|
192
|
+
function requireString(value, fieldName) {
|
|
193
|
+
if (typeof value !== "string" || !value.trim()) {
|
|
194
|
+
throw new Error(`${fieldName} must be a non-empty string`);
|
|
195
|
+
}
|
|
196
|
+
return value;
|
|
197
|
+
}
|
|
198
|
+
function requireFiniteNumber(value, fieldName) {
|
|
199
|
+
if (typeof value !== "number" || !Number.isFinite(value)) {
|
|
200
|
+
throw new Error(`${fieldName} must be a finite number`);
|
|
201
|
+
}
|
|
202
|
+
return value;
|
|
203
|
+
}
|
|
204
|
+
function requireBoolean(value, fieldName) {
|
|
205
|
+
if (typeof value !== "boolean") {
|
|
206
|
+
throw new Error(`${fieldName} must be a boolean`);
|
|
207
|
+
}
|
|
208
|
+
return value;
|
|
209
|
+
}
|
|
210
|
+
function parseNullableNumber(value, fieldName) {
|
|
211
|
+
if (value === null) {
|
|
212
|
+
return null;
|
|
213
|
+
}
|
|
214
|
+
return requireFiniteNumber(value, fieldName);
|
|
215
|
+
}
|
|
216
|
+
function parseNullableString(value, fieldName) {
|
|
217
|
+
if (value === null) {
|
|
218
|
+
return null;
|
|
219
|
+
}
|
|
220
|
+
return requireString(value, fieldName);
|
|
221
|
+
}
|
|
222
|
+
function parseOptionalBoolean(value, defaultValue) {
|
|
223
|
+
if (value === undefined) {
|
|
224
|
+
return defaultValue;
|
|
225
|
+
}
|
|
226
|
+
return requireBoolean(value, "optionalBoolean");
|
|
227
|
+
}
|
|
228
|
+
function requireEventType(value) {
|
|
229
|
+
if (value === "review_passed" || value === "commit_push_completed") {
|
|
230
|
+
return value;
|
|
231
|
+
}
|
|
232
|
+
throw new Error("eventType must be review_passed or commit_push_completed");
|
|
233
|
+
}
|
|
234
|
+
function requireCommitMessageSource(value) {
|
|
235
|
+
if (value === "user" || value === "generated" || value === "hybrid") {
|
|
236
|
+
return value;
|
|
237
|
+
}
|
|
238
|
+
throw new Error("commitMessageSource must be user, generated, or hybrid");
|
|
239
|
+
}
|
|
240
|
+
function requireReviewMode(value) {
|
|
241
|
+
if (value === "single" || value === "chunked") {
|
|
242
|
+
return value;
|
|
243
|
+
}
|
|
244
|
+
throw new Error("reviewMode must be single or chunked");
|
|
245
|
+
}
|
|
246
|
+
function requireDecision(value) {
|
|
247
|
+
if (value === "pass" || value === "block") {
|
|
248
|
+
return value;
|
|
249
|
+
}
|
|
250
|
+
throw new Error("decision must be pass or block");
|
|
251
|
+
}
|
|
252
|
+
//# sourceMappingURL=store.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"store.js","sourceRoot":"","sources":["../../src/passHistory/store.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BA,0EASC;AAED,gEAEC;AAED,8DAEC;AAED,oDAQC;AAED,gFAMC;AAED,0DAQC;AAED,wDA+BC;AA5GD,qDAAuC;AACvC,gDAAkC;AAClC,mCAIiB;AAwBjB,SAAgB,+BAA+B,CAAC,KAAsC;IACpF,MAAM,iBAAiB,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IAAI,KAAK,KAAK,uBAAuB,EAAE,CAAC;QACnE,OAAO,KAAK,CAAC;IACf,CAAC;IACD,MAAM,IAAI,KAAK,CAAC,0DAA0D,CAAC,CAAC;AAC9E,CAAC;AAED,SAAS,0BAA0B,CAAC,KAAc;IAChD,IAAI,KAAK,KAAK,MAAM,IAAI,KAAK,KAAK,WAAW,IAAI,KAAK,KAAK,QAAQ,EAAE,CAAC;QACpE,OAAO,KAAK,CAAC;IACf,CAAC;IACD,MAAM,IAAI,KAAK,CAAC,wDAAwD,CAAC,CAAC;AAC5E,CAAC;AAED,SAAS,iBAAiB,CAAC,KAAc;IACvC,IAAI,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QAC9C,OAAO,KAAK,CAAC;IACf,CAAC;IACD,MAAM,IAAI,KAAK,CAAC,sCAAsC,CAAC,CAAC;AAC1D,CAAC;AAED,SAAS,eAAe,CAAC,KAAc;IACrC,IAAI,KAAK,KAAK,MAAM,IAAI,KAAK,KAAK,OAAO,EAAE,CAAC;QAC1C,OAAO,KAAK,CAAC;IACf,CAAC;IACD,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAC;AACpD,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DEFAULT_PASS_HISTORY_DIRECTORY_NAME = exports.PASS_HISTORY_FILE_NAME = void 0;
|
|
4
|
+
exports.PASS_HISTORY_FILE_NAME = "pass-history.jsonl";
|
|
5
|
+
exports.DEFAULT_PASS_HISTORY_DIRECTORY_NAME = ".smart-commit-cli";
|
|
6
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/passHistory/types.ts"],"names":[],"mappings":";;;AAAa,QAAA,sBAAsB,GAAG,oBAAoB,CAAC;AAC9C,QAAA,mCAAmC,GAAG,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.buildPromptAugmentation = buildPromptAugmentation;
|
|
37
|
+
const fs = __importStar(require("node:fs"));
|
|
38
|
+
const path = __importStar(require("node:path"));
|
|
39
|
+
function buildPromptAugmentation(input) {
|
|
40
|
+
const lines = [];
|
|
41
|
+
const configuredPath = input.skill.path.trim();
|
|
42
|
+
const promptTuning = input.skill.promptTuning.trim();
|
|
43
|
+
if (configuredPath) {
|
|
44
|
+
const resolvedPath = resolveSkillPath(input.repositoryPath, configuredPath);
|
|
45
|
+
let content;
|
|
46
|
+
try {
|
|
47
|
+
content = fs.readFileSync(resolvedPath, "utf8");
|
|
48
|
+
}
|
|
49
|
+
catch (error) {
|
|
50
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
51
|
+
throw new Error(`Failed to read ${input.categoryLabel} skill file at ${resolvedPath}: ${message}`);
|
|
52
|
+
}
|
|
53
|
+
const normalized = content.trim();
|
|
54
|
+
if (!normalized) {
|
|
55
|
+
throw new Error(`${input.categoryLabel} skill file must not be empty: ${resolvedPath}`);
|
|
56
|
+
}
|
|
57
|
+
lines.push(`Custom ${input.categoryLabel} instructions:\n${normalized}`);
|
|
58
|
+
}
|
|
59
|
+
else if (input.skill.id.trim()) {
|
|
60
|
+
lines.push(`Selected ${input.categoryLabel} profile: ${input.skill.id.trim()}.`);
|
|
61
|
+
}
|
|
62
|
+
if (promptTuning) {
|
|
63
|
+
lines.push(`Additional ${input.categoryLabel} tuning:\n${promptTuning}`);
|
|
64
|
+
}
|
|
65
|
+
return lines;
|
|
66
|
+
}
|
|
67
|
+
function resolveSkillPath(repositoryPath, configuredPath) {
|
|
68
|
+
return path.isAbsolute(configuredPath)
|
|
69
|
+
? path.normalize(configuredPath)
|
|
70
|
+
: path.resolve(repositoryPath, configuredPath);
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=promptContext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"promptContext.js","sourceRoot":"","sources":["../src/promptContext.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASA,0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