flavor-code 1.4.2 → 1.4.3
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 +53 -1
- package/README.zh-CN.md +53 -1
- package/dist/agent/loop.d.ts +1 -0
- package/dist/{app-4CUS3GEJ.js → app-TVY2HM5L.js} +891 -604
- package/dist/apply-WOW3QU5I.js +51 -0
- package/dist/broker-cli-X5H46FZV.js +15 -0
- package/dist/check-CSKTV4O2.js +16 -0
- package/dist/chunk-3563SW4X.js +10513 -0
- package/dist/chunk-36IDJRLQ.js +630 -0
- package/dist/chunk-3UX2CGDW.js +1955 -0
- package/dist/chunk-4TMLXZVZ.js +75 -0
- package/dist/{chunk-7YFHRORG.js → chunk-5BDKRA6U.js} +412 -172
- package/dist/chunk-6F66UXBI.js +48 -0
- package/dist/{chunk-KMBDK4SN.js → chunk-6URQ7FIF.js} +24 -88
- package/dist/chunk-7Y64WNBB.js +8930 -0
- package/dist/chunk-AA4QNKTF.js +501 -0
- package/dist/chunk-BDX777JR.js +11 -0
- package/dist/chunk-CVP5OUHD.js +103 -0
- package/dist/chunk-EWD7FWTH.js +14547 -0
- package/dist/{chunk-N5MXHJKD.js → chunk-GTFP2R5I.js} +1 -1
- package/dist/{chunk-W2TIY6JY.js → chunk-IKGT4MDT.js} +2028 -516
- package/dist/chunk-IQEEFDEE.js +389 -0
- package/dist/chunk-IU3UBETC.js +30 -0
- package/dist/chunk-JQM2L2YM.js +1003 -0
- package/dist/chunk-KRWWCVXA.js +74 -0
- package/dist/chunk-OKHV7CTB.js +482 -0
- package/dist/chunk-ONRY3C2L.js +196 -0
- package/dist/chunk-PULWAH6E.js +474 -0
- package/dist/chunk-PZ5NKRVA.js +85 -0
- package/dist/chunk-QACFKPZP.js +43704 -0
- package/dist/chunk-RBAZLFKB.js +1022 -0
- package/dist/chunk-RV3EXUXM.js +30 -0
- package/dist/chunk-TIEOVQW6.js +61 -0
- package/dist/chunk-WLZUAVVU.js +15 -0
- package/dist/chunk-X442CJJH.js +114 -0
- package/dist/chunk-X6U6BO5D.js +2130 -0
- package/dist/{chunk-RAYH6K2H.js → chunk-Y7EH4NVO.js} +1 -1
- package/dist/{chunk-S32JRDZK.js → chunk-ZKKVSR37.js} +6 -1
- package/dist/{claude-ink-VQU3C5UL.js → claude-ink-F554I3GJ.js} +9 -4
- package/dist/cli-MAWCV2YR.js +163 -0
- package/dist/cli-main.js +3805 -473
- package/dist/cli.js +50 -4
- package/dist/config/load.d.ts +8 -0
- package/dist/config/protected-file.d.ts +2 -0
- package/dist/config/schema.d.ts +14 -0
- package/dist/context/global-instructions.d.ts +12 -0
- package/dist/context/manager.d.ts +4 -0
- package/dist/desktop/main.js +4943 -1562
- package/dist/desktop/preload.cjs +30 -0
- package/dist/desktop-renderer/assets/index-BWklSoOO.css +1 -0
- package/dist/desktop-renderer/assets/index-CjC0Ibiq.js +153 -0
- package/dist/desktop-renderer/assets/{interactive-terminal-ouQQ3brz.js → interactive-terminal-IjIT3Xoa.js} +1 -1
- package/dist/desktop-renderer/index.html +2 -2
- package/dist/doctor-SEL32R7M.js +20 -0
- package/dist/harness/local.d.ts +1 -0
- package/dist/load-RHWXNUCS.js +25 -0
- package/dist/log-ATFIPRNU.js +19 -0
- package/dist/manager-IYBNNKUP.js +191 -0
- package/dist/models/anthropic.d.ts +3 -0
- package/dist/node-LOIXT44J.js +879 -0
- package/dist/plugin-worker-entry.js +1 -1
- package/dist/production-TQROFEPV.js +46 -0
- package/dist/production.d.ts +28 -1
- package/dist/project-3QXE22TG.js +11 -0
- package/dist/react-M6JGXSJZ.js +7 -0
- package/dist/recorder-FAGJJH3N.js +11 -0
- package/dist/sdk/index.js +30 -8
- package/dist/server-2KLKPHPL.js +11 -0
- package/dist/session/store.d.ts +1 -0
- package/dist/store-MZZERW7K.js +18 -0
- package/dist/ui/commands.d.ts +11 -3
- package/dist/ui/session.d.ts +2 -1
- package/dist/usage-summary-G5FBOJLK.js +13 -0
- package/dist/write-stream-CGD57URC.js +77 -0
- package/package.json +1 -1
- package//346/212/200/346/234/257/346/226/271/346/241/210/346/212/245/345/221/212.md +649 -1
- package/dist/chunk-B23V72YR.js +0 -170
- package/dist/chunk-QKND3FX7.js +0 -26103
- package/dist/desktop-renderer/assets/index-Bk6FYhyh.css +0 -1
- package/dist/desktop-renderer/assets/index-CPXrzFgv.js +0 -154
- package/dist/load-UPOG3XQR.js +0 -19
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { createRequire } from "node:module"; const require =
|
|
2
|
+
import { createRequire as createFlavorRequire } from "node:module"; const require = createFlavorRequire(import.meta.url);
|
|
3
3
|
|
|
4
4
|
// src/ui/task-progress-model.ts
|
|
5
5
|
var FRAMES = ["\u280B", "\u2819", "\u2839", "\u2838", "\u283C", "\u2834", "\u2826", "\u2827", "\u2807", "\u280F"];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { createRequire } from "node:module"; const require =
|
|
2
|
+
import { createRequire as createFlavorRequire } from "node:module"; const require = createFlavorRequire(import.meta.url);
|
|
3
3
|
var __create = Object.create;
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
5
5
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -15,6 +15,10 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
|
|
|
15
15
|
var __commonJS = (cb, mod) => function __require2() {
|
|
16
16
|
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
17
17
|
};
|
|
18
|
+
var __export = (target, all) => {
|
|
19
|
+
for (var name in all)
|
|
20
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
21
|
+
};
|
|
18
22
|
var __copyProps = (to, from, except, desc) => {
|
|
19
23
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
20
24
|
for (let key of __getOwnPropNames(from))
|
|
@@ -35,5 +39,6 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
35
39
|
export {
|
|
36
40
|
__require,
|
|
37
41
|
__commonJS,
|
|
42
|
+
__export,
|
|
38
43
|
__toESM
|
|
39
44
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { createRequire } from "node:module"; const require =
|
|
2
|
+
import { createRequire as createFlavorRequire } from "node:module"; const require = createFlavorRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
4
|
AlternateScreen,
|
|
5
5
|
Box_default,
|
|
@@ -10,9 +10,14 @@ import {
|
|
|
10
10
|
useStdout,
|
|
11
11
|
use_app_default,
|
|
12
12
|
use_input_default
|
|
13
|
-
} from "./chunk-
|
|
14
|
-
import "./chunk-
|
|
15
|
-
import "./chunk-
|
|
13
|
+
} from "./chunk-IKGT4MDT.js";
|
|
14
|
+
import "./chunk-PULWAH6E.js";
|
|
15
|
+
import "./chunk-AA4QNKTF.js";
|
|
16
|
+
import "./chunk-TIEOVQW6.js";
|
|
17
|
+
import "./chunk-IU3UBETC.js";
|
|
18
|
+
import "./chunk-3UX2CGDW.js";
|
|
19
|
+
import "./chunk-KRWWCVXA.js";
|
|
20
|
+
import "./chunk-ZKKVSR37.js";
|
|
16
21
|
export {
|
|
17
22
|
AlternateScreen,
|
|
18
23
|
Box_default as Box,
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire as createFlavorRequire } from "node:module"; const require = createFlavorRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
createExecutionEnvironment,
|
|
5
|
+
createProductionRuntime
|
|
6
|
+
} from "./chunk-QACFKPZP.js";
|
|
7
|
+
import "./chunk-TIEOVQW6.js";
|
|
8
|
+
import "./chunk-OKHV7CTB.js";
|
|
9
|
+
import {
|
|
10
|
+
DEFAULT_MAX_OUTPUT_BYTES,
|
|
11
|
+
executeShell
|
|
12
|
+
} from "./chunk-JQM2L2YM.js";
|
|
13
|
+
import "./chunk-IU3UBETC.js";
|
|
14
|
+
import "./chunk-PZ5NKRVA.js";
|
|
15
|
+
import "./chunk-6F66UXBI.js";
|
|
16
|
+
import "./chunk-3UX2CGDW.js";
|
|
17
|
+
import "./chunk-7Y64WNBB.js";
|
|
18
|
+
import "./chunk-CVP5OUHD.js";
|
|
19
|
+
import "./chunk-3563SW4X.js";
|
|
20
|
+
import "./chunk-RBAZLFKB.js";
|
|
21
|
+
import "./chunk-36IDJRLQ.js";
|
|
22
|
+
import "./chunk-WLZUAVVU.js";
|
|
23
|
+
import "./chunk-RV3EXUXM.js";
|
|
24
|
+
import "./chunk-IQEEFDEE.js";
|
|
25
|
+
import "./chunk-GTFP2R5I.js";
|
|
26
|
+
import "./chunk-5BDKRA6U.js";
|
|
27
|
+
import "./chunk-X6U6BO5D.js";
|
|
28
|
+
import "./chunk-BDX777JR.js";
|
|
29
|
+
import "./chunk-ONRY3C2L.js";
|
|
30
|
+
import {
|
|
31
|
+
external_exports
|
|
32
|
+
} from "./chunk-EWD7FWTH.js";
|
|
33
|
+
import "./chunk-KRWWCVXA.js";
|
|
34
|
+
import "./chunk-X442CJJH.js";
|
|
35
|
+
import "./chunk-ZKKVSR37.js";
|
|
36
|
+
|
|
37
|
+
// src/eval/cli.ts
|
|
38
|
+
import { readFile, writeFile } from "fs/promises";
|
|
39
|
+
import { dirname, resolve } from "path";
|
|
40
|
+
|
|
41
|
+
// src/execution/local.ts
|
|
42
|
+
var LocalExecutionEnvironment = class {
|
|
43
|
+
kind = "local";
|
|
44
|
+
exec(request, signal) {
|
|
45
|
+
const cancellation = signal ?? new AbortController().signal;
|
|
46
|
+
return executeShell(request.cwd, {
|
|
47
|
+
command: request.command,
|
|
48
|
+
args: [...request.args],
|
|
49
|
+
cwd: request.cwd,
|
|
50
|
+
...request.timeoutMs === void 0 ? {} : { timeoutMs: request.timeoutMs }
|
|
51
|
+
}, cancellation, DEFAULT_MAX_OUTPUT_BYTES);
|
|
52
|
+
}
|
|
53
|
+
async dispose() {
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
// src/eval/schema.ts
|
|
58
|
+
var EvaluationSpecSchema = external_exports.object({
|
|
59
|
+
name: external_exports.string().trim().min(1).max(256),
|
|
60
|
+
workspace: external_exports.string().trim().min(1).max(32768),
|
|
61
|
+
prompt: external_exports.string().trim().min(1).max(1e6),
|
|
62
|
+
verification: external_exports.array(external_exports.object({
|
|
63
|
+
command: external_exports.string().trim().min(1).max(32768),
|
|
64
|
+
args: external_exports.array(external_exports.string()).max(1e3),
|
|
65
|
+
timeoutMs: external_exports.number().int().positive().max(864e5).optional()
|
|
66
|
+
}).strict()).min(1).max(100),
|
|
67
|
+
maxTokens: external_exports.number().int().positive().max(Number.MAX_SAFE_INTEGER).optional()
|
|
68
|
+
}).strict();
|
|
69
|
+
|
|
70
|
+
// src/eval/runner.ts
|
|
71
|
+
var DEFAULT_VERIFICATION_TIMEOUT_MS = 10 * 6e4;
|
|
72
|
+
async function runEvaluation(spec, dependencies) {
|
|
73
|
+
const now = dependencies.now ?? Date.now;
|
|
74
|
+
const started = now();
|
|
75
|
+
let input = 0;
|
|
76
|
+
let output = 0;
|
|
77
|
+
const runtime = await dependencies.createRuntime({
|
|
78
|
+
workspace: spec.workspace,
|
|
79
|
+
output: (event) => {
|
|
80
|
+
if (event.type === "usage") {
|
|
81
|
+
input = event.totalInputTokens;
|
|
82
|
+
output = event.totalOutputTokens;
|
|
83
|
+
} else if (event.type === "done" && input === 0 && output === 0) {
|
|
84
|
+
input = event.usage.inputTokens;
|
|
85
|
+
output = event.usage.outputTokens;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
try {
|
|
90
|
+
await runtime.session.start();
|
|
91
|
+
await runtime.session.submit(spec.prompt);
|
|
92
|
+
} finally {
|
|
93
|
+
await runtime.session.close();
|
|
94
|
+
await runtime.dispose();
|
|
95
|
+
}
|
|
96
|
+
const verification = [];
|
|
97
|
+
for (const check of spec.verification) {
|
|
98
|
+
const result = await dependencies.executionEnvironment.exec({
|
|
99
|
+
command: check.command,
|
|
100
|
+
args: check.args,
|
|
101
|
+
cwd: spec.workspace,
|
|
102
|
+
timeoutMs: check.timeoutMs ?? DEFAULT_VERIFICATION_TIMEOUT_MS
|
|
103
|
+
});
|
|
104
|
+
verification.push({
|
|
105
|
+
command: [check.command, ...check.args].join(" "),
|
|
106
|
+
exitCode: result.exitCode,
|
|
107
|
+
passed: result.exitCode === 0,
|
|
108
|
+
stdout: result.stdout,
|
|
109
|
+
stderr: result.stderr
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
const total = input + output;
|
|
113
|
+
const withinBudget = spec.maxTokens === void 0 || total <= spec.maxTokens;
|
|
114
|
+
return {
|
|
115
|
+
name: spec.name,
|
|
116
|
+
workspace: spec.workspace,
|
|
117
|
+
passed: withinBudget && verification.every((item) => item.passed),
|
|
118
|
+
durationMs: Math.max(0, now() - started),
|
|
119
|
+
tokens: { input, output, total, withinBudget },
|
|
120
|
+
verification
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
// src/eval/cli.ts
|
|
125
|
+
async function runEvaluationFile(path, outputPath) {
|
|
126
|
+
const specPath = resolve(path);
|
|
127
|
+
const parsed = EvaluationSpecSchema.parse(JSON.parse(await readFile(specPath, "utf8")));
|
|
128
|
+
const workspace = resolve(dirname(specPath), parsed.workspace);
|
|
129
|
+
const spec = {
|
|
130
|
+
name: parsed.name,
|
|
131
|
+
prompt: parsed.prompt,
|
|
132
|
+
workspace,
|
|
133
|
+
verification: parsed.verification.map((step) => ({
|
|
134
|
+
command: step.command,
|
|
135
|
+
args: step.args,
|
|
136
|
+
...step.timeoutMs === void 0 ? {} : { timeoutMs: step.timeoutMs }
|
|
137
|
+
})),
|
|
138
|
+
...parsed.maxTokens === void 0 ? {} : { maxTokens: parsed.maxTokens }
|
|
139
|
+
};
|
|
140
|
+
const configured = await import("./load-RHWXNUCS.js").then(({ loadConfig }) => loadConfig({ cwd: workspace, home: process.env.USERPROFILE ?? process.env.HOME ?? workspace }));
|
|
141
|
+
const environment = createExecutionEnvironment(workspace, configured.config.execution) ?? new LocalExecutionEnvironment();
|
|
142
|
+
let report;
|
|
143
|
+
try {
|
|
144
|
+
report = await runEvaluation(spec, {
|
|
145
|
+
createRuntime: (options) => createProductionRuntime({
|
|
146
|
+
...options,
|
|
147
|
+
home: process.env.USERPROFILE ?? process.env.HOME ?? workspace,
|
|
148
|
+
approvalPolicy: "deny"
|
|
149
|
+
}),
|
|
150
|
+
executionEnvironment: environment
|
|
151
|
+
});
|
|
152
|
+
} finally {
|
|
153
|
+
await environment.dispose();
|
|
154
|
+
}
|
|
155
|
+
const body = `${JSON.stringify(report, null, 2)}
|
|
156
|
+
`;
|
|
157
|
+
if (outputPath === void 0) process.stdout.write(body);
|
|
158
|
+
else await writeFile(resolve(outputPath), body, "utf8");
|
|
159
|
+
return report.passed ? 0 : 1;
|
|
160
|
+
}
|
|
161
|
+
export {
|
|
162
|
+
runEvaluationFile
|
|
163
|
+
};
|