jinzd-ai-cli 0.4.215 → 0.4.217
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 +5 -2
- package/dist/{batch-74H5SA7P.js → batch-YCOVKTXD.js} +2 -2
- package/dist/{chat-index-R2E27VXN.js → chat-index-PS274XM7.js} +1 -1
- package/dist/{chunk-ZOF5NFKW.js → chunk-524WZOKS.js} +1 -1
- package/dist/{ci-3ALK2XJN.js → chunk-KOPUCJXM.js} +40 -46
- package/dist/{chunk-6C3JYNM6.js → chunk-MGBMNCHG.js} +279 -54
- package/dist/{chunk-KL7UBVSQ.js → chunk-OUAZOE5U.js} +2 -2
- package/dist/{chunk-RS4WBI73.js → chunk-QAYOI57M.js} +3 -1
- package/dist/{chunk-X6OXS7KU.js → chunk-SNJAOXFT.js} +1 -1
- package/dist/{chunk-OQGVGPEK.js → chunk-VHY6NVMQ.js} +2 -0
- package/dist/{chunk-3TSHNZKI.js → chunk-VTH7BLXK.js} +1 -1
- package/dist/{chunk-2224JGA6.js → chunk-WKOQ5CYC.js} +1 -1
- package/dist/chunk-WZ3VKLF3.js +105 -0
- package/dist/{chunk-7JES2NWR.js → chunk-XJGEQIYS.js} +3 -1
- package/dist/ci-52RZIYWB.js +19 -0
- package/dist/ci-format-73UXKE65.js +18 -0
- package/dist/{constants-IN2HXJK7.js → constants-DIXAD35W.js} +3 -1
- package/dist/{doctor-cli-7XL4TCVT.js → doctor-cli-7GOQPULZ.js} +4 -4
- package/dist/electron-server.js +562 -318
- package/dist/{hub-VAOG5EY6.js → hub-GIGBITZN.js} +1 -1
- package/dist/index.js +169 -73
- package/dist/pr-KPQ5RPKB.js +267 -0
- package/dist/{run-tests-J2JQ57R3.js → run-tests-K7QR5QN4.js} +1 -1
- package/dist/{run-tests-QJD43AML.js → run-tests-ZDSA3QES.js} +2 -2
- package/dist/{server-WDLV3W4F.js → server-22YF3U34.js} +5 -4
- package/dist/{server-VGPZOISQ.js → server-QT3SC2KI.js} +129 -86
- package/dist/{task-orchestrator-QFOCO3N7.js → task-orchestrator-BHQQCVTY.js} +5 -4
- package/dist/{usage-IEB476NE.js → usage-WZZFSFLM.js} +2 -2
- package/dist/web/client/app.js +53 -2
- package/dist/web/client/index.html +11 -1
- package/package.json +1 -1
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
VERSION
|
|
4
|
+
} from "./chunk-XJGEQIYS.js";
|
|
5
|
+
|
|
6
|
+
// src/cli/ci-format.ts
|
|
7
|
+
var DEFAULT_CI_THRESHOLDS = {
|
|
8
|
+
securityHigh: true,
|
|
9
|
+
testFailure: true,
|
|
10
|
+
lintFailure: true
|
|
11
|
+
};
|
|
12
|
+
function normalizeCiThresholds(input) {
|
|
13
|
+
return {
|
|
14
|
+
securityHigh: input?.securityHigh ?? DEFAULT_CI_THRESHOLDS.securityHigh,
|
|
15
|
+
testFailure: input?.testFailure ?? DEFAULT_CI_THRESHOLDS.testFailure,
|
|
16
|
+
lintFailure: input?.lintFailure ?? DEFAULT_CI_THRESHOLDS.lintFailure
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
function extractSection(markdown, heading) {
|
|
20
|
+
const start = markdown.indexOf(heading);
|
|
21
|
+
if (start < 0) return "";
|
|
22
|
+
const rest = markdown.slice(start + heading.length);
|
|
23
|
+
const next = rest.search(/\n###\s+/);
|
|
24
|
+
return next >= 0 ? rest.slice(0, next) : rest;
|
|
25
|
+
}
|
|
26
|
+
function detectCiGateSignals(markdown) {
|
|
27
|
+
const security = extractSection(markdown, "### Security Review");
|
|
28
|
+
const securityHigh = (security.match(/(?:🔴\s*CRITICAL|🔴\s*Critical|🟠\s*HIGH|🟠\s*High)/g) ?? []).length;
|
|
29
|
+
const testFailure = (markdown.match(/(?:test(?:s|ing)?\s+(?:failed|failure|failures)|failing\s+test|npm\s+test\s+failed|pytest\s+failed|vitest\s+failed)/gi) ?? []).length;
|
|
30
|
+
const lintFailure = (markdown.match(/(?:lint\s+(?:failed|failure|failures)|eslint\s+failed|ruff\s+failed|biome\s+failed|typecheck\s+failed|tsc\s+failed)/gi) ?? []).length;
|
|
31
|
+
return { securityHigh, testFailure, lintFailure };
|
|
32
|
+
}
|
|
33
|
+
function evaluateCiGate(markdown, thresholds) {
|
|
34
|
+
const normalized = normalizeCiThresholds(thresholds);
|
|
35
|
+
const signals = detectCiGateSignals(markdown);
|
|
36
|
+
const reasons = [];
|
|
37
|
+
if (normalized.securityHigh && signals.securityHigh > 0) reasons.push(`security-high:${signals.securityHigh}`);
|
|
38
|
+
if (normalized.testFailure && signals.testFailure > 0) reasons.push(`test-failure:${signals.testFailure}`);
|
|
39
|
+
if (normalized.lintFailure && signals.lintFailure > 0) reasons.push(`lint-failure:${signals.lintFailure}`);
|
|
40
|
+
return { thresholds: normalized, signals, failed: reasons.length > 0, reasons };
|
|
41
|
+
}
|
|
42
|
+
function sarifLevel(line) {
|
|
43
|
+
if (/🔴|🟠|CRITICAL|HIGH/i.test(line)) return "error";
|
|
44
|
+
if (/🟡|WARNING|MEDIUM/i.test(line)) return "warning";
|
|
45
|
+
return "note";
|
|
46
|
+
}
|
|
47
|
+
function stripMarkdown(line) {
|
|
48
|
+
return line.replace(/^[\s>*-]+/, "").replace(/[`*_]/g, "").trim();
|
|
49
|
+
}
|
|
50
|
+
function formatCiSarif(result) {
|
|
51
|
+
const lines = result.markdown.split(/\r?\n/);
|
|
52
|
+
const findingLines = lines.map((line, idx) => ({ line, idx })).filter(({ line }) => /🔴|🟠|🟡|🔵|CRITICAL|HIGH|MEDIUM|LOW|WARNING|INFO/i.test(line));
|
|
53
|
+
const results = findingLines.map(({ line, idx }, n) => ({
|
|
54
|
+
ruleId: "aicli-review-finding",
|
|
55
|
+
level: sarifLevel(line),
|
|
56
|
+
message: { text: stripMarkdown(line) || line.trim() },
|
|
57
|
+
locations: [{
|
|
58
|
+
physicalLocation: {
|
|
59
|
+
artifactLocation: { uri: "aicli-review.md" },
|
|
60
|
+
region: { startLine: idx + 1 }
|
|
61
|
+
}
|
|
62
|
+
}],
|
|
63
|
+
partialFingerprints: { aicliLine: String(n + 1) }
|
|
64
|
+
}));
|
|
65
|
+
return JSON.stringify({
|
|
66
|
+
version: "2.1.0",
|
|
67
|
+
$schema: "https://json.schemastore.org/sarif-2.1.0.json",
|
|
68
|
+
runs: [{
|
|
69
|
+
tool: {
|
|
70
|
+
driver: {
|
|
71
|
+
name: "aicli",
|
|
72
|
+
informationUri: "https://github.com/jinzhengdong/ai-cli",
|
|
73
|
+
version: VERSION,
|
|
74
|
+
rules: [{
|
|
75
|
+
id: "aicli-review-finding",
|
|
76
|
+
name: "aicli review finding",
|
|
77
|
+
shortDescription: { text: "Finding emitted by aicli CI review" },
|
|
78
|
+
helpUri: "https://github.com/jinzhengdong/ai-cli"
|
|
79
|
+
}]
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
invocations: [{ executionSuccessful: !result.gate.failed }],
|
|
83
|
+
results,
|
|
84
|
+
properties: {
|
|
85
|
+
severity: result.severity,
|
|
86
|
+
gate: result.gate,
|
|
87
|
+
posted: result.posted
|
|
88
|
+
}
|
|
89
|
+
}]
|
|
90
|
+
}, null, 2);
|
|
91
|
+
}
|
|
92
|
+
function formatCiResult(result, format) {
|
|
93
|
+
if (format === "json") return JSON.stringify(result, null, 2);
|
|
94
|
+
if (format === "sarif") return formatCiSarif(result);
|
|
95
|
+
return result.markdown;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export {
|
|
99
|
+
DEFAULT_CI_THRESHOLDS,
|
|
100
|
+
normalizeCiThresholds,
|
|
101
|
+
detectCiGateSignals,
|
|
102
|
+
evaluateCiGate,
|
|
103
|
+
formatCiSarif,
|
|
104
|
+
formatCiResult
|
|
105
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
// src/core/constants.ts
|
|
4
|
-
var VERSION = "0.4.
|
|
4
|
+
var VERSION = "0.4.217";
|
|
5
5
|
var APP_NAME = "ai-cli";
|
|
6
6
|
var CONFIG_DIR_NAME = ".aicli";
|
|
7
7
|
var CONFIG_FILE_NAME = "config.json";
|
|
@@ -12,6 +12,7 @@ var CUSTOM_COMMANDS_DIR_NAME = "commands";
|
|
|
12
12
|
var CONTEXT_FILE_CANDIDATES = ["AICLI.override.md", "AGENTS.override.md", "AICLI.md", "CLAUDE.md", "AGENTS.md"];
|
|
13
13
|
var CONTEXT_FILE_MAX_BYTES = 32 * 1024;
|
|
14
14
|
var MEMORY_FILE_NAME = "memory.md";
|
|
15
|
+
var MEMORY_STORE_FILE_NAME = "memory.jsonl";
|
|
15
16
|
var MEMORY_MAX_CHARS = 1e4;
|
|
16
17
|
var DEV_STATE_FILE_NAME = "dev-state.md";
|
|
17
18
|
var DEFAULT_MAX_TOKENS = 8192;
|
|
@@ -145,6 +146,7 @@ export {
|
|
|
145
146
|
CONTEXT_FILE_CANDIDATES,
|
|
146
147
|
CONTEXT_FILE_MAX_BYTES,
|
|
147
148
|
MEMORY_FILE_NAME,
|
|
149
|
+
MEMORY_STORE_FILE_NAME,
|
|
148
150
|
MEMORY_MAX_CHARS,
|
|
149
151
|
DEV_STATE_FILE_NAME,
|
|
150
152
|
DEFAULT_MAX_TOKENS,
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
CI_COMMENT_MARKER,
|
|
4
|
+
countSeverity,
|
|
5
|
+
runCi
|
|
6
|
+
} from "./chunk-KOPUCJXM.js";
|
|
7
|
+
import "./chunk-WZ3VKLF3.js";
|
|
8
|
+
import "./chunk-HLWUDRBO.js";
|
|
9
|
+
import "./chunk-QMXC327F.js";
|
|
10
|
+
import "./chunk-XPBEJB27.js";
|
|
11
|
+
import "./chunk-WKOQ5CYC.js";
|
|
12
|
+
import "./chunk-TZQHYZKT.js";
|
|
13
|
+
import "./chunk-XJGEQIYS.js";
|
|
14
|
+
import "./chunk-IW3Q7AE5.js";
|
|
15
|
+
export {
|
|
16
|
+
CI_COMMENT_MARKER,
|
|
17
|
+
countSeverity,
|
|
18
|
+
runCi
|
|
19
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
DEFAULT_CI_THRESHOLDS,
|
|
4
|
+
detectCiGateSignals,
|
|
5
|
+
evaluateCiGate,
|
|
6
|
+
formatCiResult,
|
|
7
|
+
formatCiSarif,
|
|
8
|
+
normalizeCiThresholds
|
|
9
|
+
} from "./chunk-WZ3VKLF3.js";
|
|
10
|
+
import "./chunk-XJGEQIYS.js";
|
|
11
|
+
export {
|
|
12
|
+
DEFAULT_CI_THRESHOLDS,
|
|
13
|
+
detectCiGateSignals,
|
|
14
|
+
evaluateCiGate,
|
|
15
|
+
formatCiResult,
|
|
16
|
+
formatCiSarif,
|
|
17
|
+
normalizeCiThresholds
|
|
18
|
+
};
|
|
@@ -26,6 +26,7 @@ import {
|
|
|
26
26
|
MCP_TOOL_PREFIX,
|
|
27
27
|
MEMORY_FILE_NAME,
|
|
28
28
|
MEMORY_MAX_CHARS,
|
|
29
|
+
MEMORY_STORE_FILE_NAME,
|
|
29
30
|
PLAN_MODE_READONLY_TOOLS,
|
|
30
31
|
PLAN_MODE_SYSTEM_ADDON,
|
|
31
32
|
PLUGINS_DIR_NAME,
|
|
@@ -37,7 +38,7 @@ import {
|
|
|
37
38
|
TEST_TIMEOUT,
|
|
38
39
|
VERSION,
|
|
39
40
|
buildUserIdentityPrompt
|
|
40
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-XJGEQIYS.js";
|
|
41
42
|
export {
|
|
42
43
|
AGENTIC_BEHAVIOR_GUIDELINE,
|
|
43
44
|
APP_NAME,
|
|
@@ -65,6 +66,7 @@ export {
|
|
|
65
66
|
MCP_TOOL_PREFIX,
|
|
66
67
|
MEMORY_FILE_NAME,
|
|
67
68
|
MEMORY_MAX_CHARS,
|
|
69
|
+
MEMORY_STORE_FILE_NAME,
|
|
68
70
|
PLAN_MODE_READONLY_TOOLS,
|
|
69
71
|
PLAN_MODE_SYSTEM_ADDON,
|
|
70
72
|
PLUGINS_DIR_NAME,
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
getConfigDirUsage,
|
|
4
4
|
listRecentCrashes
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-524WZOKS.js";
|
|
6
6
|
import {
|
|
7
7
|
ProviderRegistry
|
|
8
8
|
} from "./chunk-QMXC327F.js";
|
|
@@ -11,17 +11,17 @@ import {
|
|
|
11
11
|
getTopFailingTools,
|
|
12
12
|
getTopUsedTools,
|
|
13
13
|
resetStats
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-SNJAOXFT.js";
|
|
15
15
|
import "./chunk-XPBEJB27.js";
|
|
16
16
|
import {
|
|
17
17
|
ConfigManager
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-WKOQ5CYC.js";
|
|
19
19
|
import "./chunk-TZQHYZKT.js";
|
|
20
20
|
import {
|
|
21
21
|
DEV_STATE_FILE_NAME,
|
|
22
22
|
MEMORY_FILE_NAME,
|
|
23
23
|
VERSION
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-XJGEQIYS.js";
|
|
25
25
|
import "./chunk-IW3Q7AE5.js";
|
|
26
26
|
|
|
27
27
|
// src/diagnostics/doctor-cli.ts
|