@xcompiler/cli 0.2.2 → 0.2.4
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/.env.example +18 -0
- package/README.CN.md +143 -190
- package/README.md +144 -193
- package/config.example.yaml +138 -0
- package/debug-wiki/README.md +12 -0
- package/debug-wiki/wiki/agent/calibration-fixtures.md +33 -0
- package/debug-wiki/wiki/agent/calibration-network-api.md +36 -0
- package/debug-wiki/wiki/agent/calibration-python-imports.md +33 -0
- package/debug-wiki/wiki/system/debug-issue-flow.md +29 -0
- package/debug-wiki/wiki/system/no-poisoning.md +29 -0
- package/dist/acp/index.d.ts +32 -4
- package/dist/acp/index.js +6064 -1044
- package/dist/acp/index.js.map +1 -1
- package/dist/cli/xcompiler.js +7102 -2051
- package/dist/cli/xcompiler.js.map +1 -1
- package/dist/cli/xcompiler_build.js +3519 -1520
- package/dist/cli/xcompiler_build.js.map +1 -1
- package/dist/cli/xcompiler_run.js +5196 -894
- package/dist/cli/xcompiler_run.js.map +1 -1
- package/dist/plugins/index.d.ts +30 -4
- package/dist/plugins/index.js +401 -85
- package/dist/plugins/index.js.map +1 -1
- package/dist/runtime/runtime.d.ts +79 -17
- package/dist/runtime/runtime.js +7087 -2040
- package/dist/runtime/runtime.js.map +1 -1
- package/docs/XCompiler_design.md +542 -0
- package/docs/acp.md +4 -4
- package/docs/assets/iterative-v-model-pipeline.svg +169 -0
- package/docs/assets/system-architecture.svg +134 -0
- package/docs/assets/xcompiler-icon.png +0 -0
- package/docs/deploy.md +381 -0
- package/docs/openrouter.md +158 -0
- package/docs/versioning.md +12 -0
- package/package.json +9 -1
package/dist/plugins/index.d.ts
CHANGED
|
@@ -46,11 +46,12 @@ declare class AuditLogger {
|
|
|
46
46
|
llmResponse(role: string, model: string, content: string, meta?: Record<string, unknown>): Promise<void>;
|
|
47
47
|
llmError(role: string, model: string, err: unknown): Promise<void>;
|
|
48
48
|
/**
|
|
49
|
-
* 记录一轮 Executor
|
|
50
|
-
* 写入 jsonl + markdown
|
|
49
|
+
* 记录一轮 Executor 执行摘要:简短 intent、issue 处理方案、计划调用的 actions、是否完成。
|
|
50
|
+
* 写入 jsonl + markdown 折叠块,交付时可追溯每轮决策和动作。
|
|
51
51
|
*/
|
|
52
52
|
executorTurn(stepId: string, role: string, round: number, payload: {
|
|
53
53
|
thoughts?: string;
|
|
54
|
+
issueResolutionPlan?: string;
|
|
54
55
|
actions?: unknown[];
|
|
55
56
|
done?: boolean;
|
|
56
57
|
raw?: string;
|
|
@@ -92,6 +93,12 @@ interface ChatOptions {
|
|
|
92
93
|
* 空输出、model token loop 等“表面成功但语义不可用”场景。
|
|
93
94
|
*/
|
|
94
95
|
validate?: (text: string) => void;
|
|
96
|
+
/**
|
|
97
|
+
* Whether a provider response should increase its dynamic score.
|
|
98
|
+
* Step/workflow executors should disable this and score quality through
|
|
99
|
+
* their own validation instead of treating "returned text" as task success.
|
|
100
|
+
*/
|
|
101
|
+
scoreSuccess?: boolean;
|
|
95
102
|
/**
|
|
96
103
|
* 调用者可传入回调,与 LLM 输出一同拿到实际产出该响应的 provider 名。
|
|
97
104
|
* 主要用于追溯:在 FallbackClient 中服务于响应的是链中某一个后选 provider,
|
|
@@ -126,11 +133,23 @@ interface ExecResult {
|
|
|
126
133
|
stderr: string;
|
|
127
134
|
timedOut: boolean;
|
|
128
135
|
durationMs: number;
|
|
136
|
+
timeoutReason?: string;
|
|
137
|
+
}
|
|
138
|
+
interface ExecProgressWatch {
|
|
139
|
+
/** Host-side paths whose recursive size indicates install progress. */
|
|
140
|
+
paths: string[];
|
|
141
|
+
/** Kill the child only after this much time without size growth. */
|
|
142
|
+
idleTimeoutMs: number;
|
|
143
|
+
/** Poll interval for recursive size checks. */
|
|
144
|
+
checkIntervalMs?: number;
|
|
145
|
+
/** Human-readable label used in timeout diagnostics. */
|
|
146
|
+
label?: string;
|
|
129
147
|
}
|
|
130
148
|
interface ExecExtra {
|
|
131
149
|
cwd?: string;
|
|
132
150
|
env?: Record<string, string>;
|
|
133
151
|
timeoutMs?: number;
|
|
152
|
+
progressWatch?: ExecProgressWatch;
|
|
134
153
|
}
|
|
135
154
|
/** 沙盒统一接口。任意 phase / tool 都通过此接口与运行时交互。 */
|
|
136
155
|
interface Sandbox {
|
|
@@ -152,7 +171,7 @@ interface Sandbox {
|
|
|
152
171
|
/**
|
|
153
172
|
* 运行工程入口程序。
|
|
154
173
|
* - Python:`python <args>`(自动选用 venv 内解释器)。
|
|
155
|
-
* - TypeScript
|
|
174
|
+
* - TypeScript:默认 `npx tsx <entry>`;当 args 以 `npm`/`npx`/`node`/`tsx`/`tsc` 开头时执行对应项目命令。
|
|
156
175
|
*/
|
|
157
176
|
runProgram(args: string[], extra?: ExecExtra): Promise<ExecResult>;
|
|
158
177
|
/**
|
|
@@ -238,6 +257,7 @@ declare const PlanSchema: z.ZodPipe<z.ZodObject<{
|
|
|
238
257
|
refactor: "refactor";
|
|
239
258
|
self: "self";
|
|
240
259
|
}>>;
|
|
260
|
+
phaseId: z.ZodDefault<z.ZodString>;
|
|
241
261
|
projectType: z.ZodDefault<z.ZodEnum<{
|
|
242
262
|
application: "application";
|
|
243
263
|
library: "library";
|
|
@@ -331,6 +351,7 @@ declare const PlanSchema: z.ZodPipe<z.ZodObject<{
|
|
|
331
351
|
version: "1";
|
|
332
352
|
language: "python" | "typescript";
|
|
333
353
|
intent: "greenfield" | "feature" | "refactor" | "self";
|
|
354
|
+
phaseId: string;
|
|
334
355
|
projectType: "application" | "library" | "mixed";
|
|
335
356
|
requirementDigest: string;
|
|
336
357
|
globalPrompt: string;
|
|
@@ -387,6 +408,7 @@ declare const PlanSchema: z.ZodPipe<z.ZodObject<{
|
|
|
387
408
|
version: "1";
|
|
388
409
|
language: "python" | "typescript";
|
|
389
410
|
intent: "greenfield" | "feature" | "refactor" | "self";
|
|
411
|
+
phaseId: string;
|
|
390
412
|
projectType: "application" | "library" | "mixed";
|
|
391
413
|
requirementDigest: string;
|
|
392
414
|
globalPrompt: string;
|
|
@@ -489,6 +511,8 @@ interface ToolContext {
|
|
|
489
511
|
language?: Language;
|
|
490
512
|
/** 当前 Step 的 write_file / append_file 单次 content 字节预算。 */
|
|
491
513
|
writeChunkBytes?: number;
|
|
514
|
+
/** run_tests 未提供有效过滤参数时使用的当前阶段默认测试范围。 */
|
|
515
|
+
defaultTestArgs?: string[];
|
|
492
516
|
/** Optional protocol/UI permission hook for sensitive tool operations. */
|
|
493
517
|
requestPermission?: ToolPermissionRequester;
|
|
494
518
|
/** Optional protocol/UI event hook for tool calls and file changes. */
|
|
@@ -597,6 +621,8 @@ interface HookContextMap {
|
|
|
597
621
|
'compile.finish': {
|
|
598
622
|
plan: Plan;
|
|
599
623
|
planPath: string;
|
|
624
|
+
phasePlanPath?: string;
|
|
625
|
+
currentPlanPath?: string;
|
|
600
626
|
};
|
|
601
627
|
'run.before': {
|
|
602
628
|
plan: Plan;
|
|
@@ -803,7 +829,7 @@ declare function checkPluginCompatibility(manifest: XCompilerPluginManifest, run
|
|
|
803
829
|
*/
|
|
804
830
|
declare function loadPluginSources(options: PluginLoadOptions): Promise<XCompilerPlugin[]>;
|
|
805
831
|
|
|
806
|
-
declare const XCOMPILER_VERSION = "0.2.
|
|
832
|
+
declare const XCOMPILER_VERSION = "0.2.4";
|
|
807
833
|
declare const XCOMPILER_PLUGIN_API_VERSION = 1;
|
|
808
834
|
|
|
809
835
|
export { type EngineRunSummary, type HookContextMap, type HookHandler, type HookName, type HookRegistrationOptions, type PluginApi, type PluginCompatibilityCode, type PluginCompatibilityReport, type PluginExtensionTarget, PluginHost, type PluginHostOptions, type PluginLoadOptions, type PluginRuntimeVersion, type PluginSource, type Skill, type StepAttemptOutcome, type Tool, type ToolContext, type ToolResult, XCOMPILER_PLUGIN_API_VERSION, XCOMPILER_VERSION, type XCompilerPlugin, type XCompilerPluginManifest, checkPluginCompatibility, loadPluginSources };
|