flavor-code 1.2.14 → 1.2.16
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 +8 -3
- package/README.zh-CN.md +8 -3
- package/dist/agent/planner.d.ts +2 -0
- package/dist/{app-UJAGMKD5.js → app-7ZCJ3UOI.js} +1 -1
- package/dist/auth/store.d.ts +7 -0
- package/dist/{chunk-4YXDGGIC.js → chunk-5SRARNAC.js} +640 -79
- package/dist/{chunk-KL6TR2KG.js → chunk-PGS3M32Y.js} +1 -1
- package/dist/cli.js +78 -16
- package/dist/desktop/main.js +965 -334
- package/dist/desktop/preload.cjs +2 -0
- package/dist/desktop-renderer/assets/index-BmXr_vX3.js +151 -0
- package/dist/desktop-renderer/assets/{index-CPxt3vFY.css → index-DEL8gXBO.css} +1 -1
- package/dist/desktop-renderer/index.html +2 -2
- package/dist/evolve/store.d.ts +26 -0
- package/dist/git/insights.d.ts +52 -0
- package/dist/git/service.d.ts +43 -0
- package/dist/git/tools.d.ts +9 -0
- package/dist/sdk/index.js +2 -2
- package/dist/session/store.d.ts +1 -0
- package/dist/tools/shell.d.ts +11 -0
- package/dist/ui/commands.d.ts +8 -2
- package/dist/ui/session.d.ts +3 -0
- package/package.json +1 -1
- package/dist/desktop-renderer/assets/index-CcD0D6x0.js +0 -151
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
<meta name="color-scheme" content="light" />
|
|
7
7
|
<meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data:; connect-src 'self' http://127.0.0.1:* http://localhost:* ws://127.0.0.1:* ws://localhost:*; frame-src http://127.0.0.1:* http://localhost:*" />
|
|
8
8
|
<title>Flavor Code</title>
|
|
9
|
-
<script type="module" crossorigin src="./assets/index-
|
|
10
|
-
<link rel="stylesheet" crossorigin href="./assets/index-
|
|
9
|
+
<script type="module" crossorigin src="./assets/index-BmXr_vX3.js"></script>
|
|
10
|
+
<link rel="stylesheet" crossorigin href="./assets/index-DEL8gXBO.css">
|
|
11
11
|
</head>
|
|
12
12
|
<body>
|
|
13
13
|
<div id="root"></div>
|
package/dist/evolve/store.d.ts
CHANGED
|
@@ -41,9 +41,17 @@ export interface EvolveReflection extends EvolveReflectionInput {
|
|
|
41
41
|
at: string;
|
|
42
42
|
perTool: Record<string, ToolTrend>;
|
|
43
43
|
}
|
|
44
|
+
export interface EvolveRule {
|
|
45
|
+
id: string;
|
|
46
|
+
text: string;
|
|
47
|
+
addedAt: string;
|
|
48
|
+
/** Signal id that motivated this rule, when it came from a suggestion. */
|
|
49
|
+
sourceId?: string;
|
|
50
|
+
}
|
|
44
51
|
export interface EvolveStoreOptions {
|
|
45
52
|
workspace: string;
|
|
46
53
|
maxSignals?: number;
|
|
54
|
+
maxRules?: number;
|
|
47
55
|
}
|
|
48
56
|
/** Collapse whitespace and quoted values so equivalent messages coalesce. */
|
|
49
57
|
export declare function normalizeError(message: unknown): string;
|
|
@@ -58,7 +66,9 @@ export declare class EvolveStore {
|
|
|
58
66
|
readonly reflectionsFile: string;
|
|
59
67
|
readonly doneFile: string;
|
|
60
68
|
readonly verifiedFile: string;
|
|
69
|
+
readonly rulesFile: string;
|
|
61
70
|
readonly maxSignals: number;
|
|
71
|
+
readonly maxRules: number;
|
|
62
72
|
constructor(options: EvolveStoreOptions);
|
|
63
73
|
/**
|
|
64
74
|
* Record one failed tool call. Dedupes by (tool, errorCode, normalized error):
|
|
@@ -88,4 +98,20 @@ export declare class EvolveStore {
|
|
|
88
98
|
verifiedIds(): Promise<string[]>;
|
|
89
99
|
/** Mark a suggestion as verified so it is no longer proposed. */
|
|
90
100
|
markSuggestionVerified(id: string): Promise<void>;
|
|
101
|
+
/** Learned guardrail rules, oldest first. */
|
|
102
|
+
listRules(): Promise<EvolveRule[]>;
|
|
103
|
+
/**
|
|
104
|
+
* Add one guardrail rule. Dedupes by fingerprint of the normalized text and
|
|
105
|
+
* keeps at most maxRules entries (oldest dropped first).
|
|
106
|
+
*/
|
|
107
|
+
addRule(input: {
|
|
108
|
+
text: string;
|
|
109
|
+
sourceId?: string;
|
|
110
|
+
}): Promise<{
|
|
111
|
+
added: boolean;
|
|
112
|
+
rule: EvolveRule;
|
|
113
|
+
}>;
|
|
114
|
+
removeRule(id: string): Promise<{
|
|
115
|
+
removed: boolean;
|
|
116
|
+
}>;
|
|
91
117
|
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import type { ModelRegistry } from "../models/registry.js";
|
|
3
|
+
export interface GitInsightOptions {
|
|
4
|
+
registry: ModelRegistry;
|
|
5
|
+
/** Cheap model id provider; evaluated lazily so /model switches apply. */
|
|
6
|
+
modelId(): string;
|
|
7
|
+
}
|
|
8
|
+
export declare function suggestCommitMessage(options: GitInsightOptions, input: {
|
|
9
|
+
stat: string;
|
|
10
|
+
diff: string;
|
|
11
|
+
hint?: string;
|
|
12
|
+
}, signal: AbortSignal): Promise<string>;
|
|
13
|
+
/** Strip fences/quotes and any trailing commentary the model may add. */
|
|
14
|
+
export declare function cleanCommitMessage(raw: string): string;
|
|
15
|
+
export declare const ReviewFindingSchema: z.ZodObject<{
|
|
16
|
+
severity: z.ZodEnum<{
|
|
17
|
+
critical: "critical";
|
|
18
|
+
nit: "nit";
|
|
19
|
+
warning: "warning";
|
|
20
|
+
}>;
|
|
21
|
+
file: z.ZodString;
|
|
22
|
+
line: z.ZodString;
|
|
23
|
+
issue: z.ZodString;
|
|
24
|
+
suggestion: z.ZodString;
|
|
25
|
+
}, z.core.$strict>;
|
|
26
|
+
export declare const ReviewReportSchema: z.ZodObject<{
|
|
27
|
+
summary: z.ZodString;
|
|
28
|
+
verdict: z.ZodEnum<{
|
|
29
|
+
"needs-work": "needs-work";
|
|
30
|
+
ship: "ship";
|
|
31
|
+
"ship-with-fixes": "ship-with-fixes";
|
|
32
|
+
}>;
|
|
33
|
+
findings: z.ZodArray<z.ZodObject<{
|
|
34
|
+
severity: z.ZodEnum<{
|
|
35
|
+
critical: "critical";
|
|
36
|
+
nit: "nit";
|
|
37
|
+
warning: "warning";
|
|
38
|
+
}>;
|
|
39
|
+
file: z.ZodString;
|
|
40
|
+
line: z.ZodString;
|
|
41
|
+
issue: z.ZodString;
|
|
42
|
+
suggestion: z.ZodString;
|
|
43
|
+
}, z.core.$strict>>;
|
|
44
|
+
}, z.core.$strict>;
|
|
45
|
+
export type ReviewReport = z.infer<typeof ReviewReportSchema>;
|
|
46
|
+
export declare function reviewDiff(options: GitInsightOptions, input: {
|
|
47
|
+
stat: string;
|
|
48
|
+
diff: string;
|
|
49
|
+
untracked: readonly string[];
|
|
50
|
+
focus?: string;
|
|
51
|
+
}, signal: AbortSignal): Promise<ReviewReport>;
|
|
52
|
+
export declare function formatReviewReport(report: ReviewReport): string;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export interface GitResult {
|
|
2
|
+
ok: boolean;
|
|
3
|
+
stdout: string;
|
|
4
|
+
stderr: string;
|
|
5
|
+
code: number;
|
|
6
|
+
}
|
|
7
|
+
export declare function git(workspace: string, args: readonly string[], timeoutMs?: number): Promise<GitResult>;
|
|
8
|
+
export declare function isGitRepository(workspace: string): Promise<boolean>;
|
|
9
|
+
export interface GitChangeSummary {
|
|
10
|
+
branch: string;
|
|
11
|
+
head: string;
|
|
12
|
+
/** porcelain v1 lines, e.g. `M src/a.ts`. */
|
|
13
|
+
statusLines: readonly string[];
|
|
14
|
+
stagedFiles: readonly string[];
|
|
15
|
+
unstagedFiles: readonly string[];
|
|
16
|
+
untrackedFiles: readonly string[];
|
|
17
|
+
}
|
|
18
|
+
/** Snapshot of the working tree used to drive /commit decisions. */
|
|
19
|
+
export declare function changeSummary(workspace: string): Promise<GitChangeSummary>;
|
|
20
|
+
/** The staged diff (capped) plus a short stat summary for model prompts. */
|
|
21
|
+
export declare function stagedDiff(workspace: string, maxChars?: number): Promise<{
|
|
22
|
+
diff: string;
|
|
23
|
+
stat: string;
|
|
24
|
+
truncated: boolean;
|
|
25
|
+
}>;
|
|
26
|
+
/** All uncommitted changes (staged + unstaged + untracked names) for review. */
|
|
27
|
+
export declare function uncommittedDiff(workspace: string, maxChars?: number): Promise<{
|
|
28
|
+
diff: string;
|
|
29
|
+
stat: string;
|
|
30
|
+
untracked: readonly string[];
|
|
31
|
+
}>;
|
|
32
|
+
export declare function stageAll(workspace: string): Promise<void>;
|
|
33
|
+
export declare function commit(workspace: string, commitMessage: string): Promise<string>;
|
|
34
|
+
export interface GitHistoryEntry {
|
|
35
|
+
hash: string;
|
|
36
|
+
date: string;
|
|
37
|
+
author: string;
|
|
38
|
+
subject: string;
|
|
39
|
+
}
|
|
40
|
+
/** Commit history for the repository, or for one file when a path is given. */
|
|
41
|
+
export declare function fileHistory(workspace: string, path: string | undefined, limit: number): Promise<GitHistoryEntry[]>;
|
|
42
|
+
/** Short branch@sha marker used to tag session checkpoints with git state. */
|
|
43
|
+
export declare function gitMarker(workspace: string): Promise<string | undefined>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import type { ToolDefinition } from "../tools/types.js";
|
|
3
|
+
declare const GitHistoryInput: z.ZodObject<{
|
|
4
|
+
path: z.ZodOptional<z.ZodString>;
|
|
5
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
6
|
+
}, z.core.$strip>;
|
|
7
|
+
export type GitHistoryInput = z.infer<typeof GitHistoryInput>;
|
|
8
|
+
export declare function createGitHistoryTool(workspace: string): ToolDefinition<GitHistoryInput, string>;
|
|
9
|
+
export {};
|
package/dist/sdk/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
FlavorRpcServer,
|
|
5
5
|
TraceRecordSchema,
|
|
6
6
|
TraceRecorder
|
|
7
|
-
} from "../chunk-
|
|
7
|
+
} from "../chunk-PGS3M32Y.js";
|
|
8
8
|
import {
|
|
9
9
|
AgentMessageQueue,
|
|
10
10
|
DockerExecutionEnvironment,
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
WorkspaceCheckpointStore,
|
|
14
14
|
buildDockerInvocation,
|
|
15
15
|
createProductionRuntime
|
|
16
|
-
} from "../chunk-
|
|
16
|
+
} from "../chunk-5SRARNAC.js";
|
|
17
17
|
import "../chunk-IG4Z23CL.js";
|
|
18
18
|
import "../chunk-RQTYHUMK.js";
|
|
19
19
|
import "../chunk-S32JRDZK.js";
|
package/dist/session/store.d.ts
CHANGED
|
@@ -35,6 +35,7 @@ export declare const SessionDocumentSchema: z.ZodObject<{
|
|
|
35
35
|
dependencies: z.ZodArray<z.ZodString>;
|
|
36
36
|
expectedOutputs: z.ZodArray<z.ZodString>;
|
|
37
37
|
verification: z.ZodArray<z.ZodString>;
|
|
38
|
+
files: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
38
39
|
}, z.core.$strict>>;
|
|
39
40
|
}, z.core.$strict>>;
|
|
40
41
|
states: z.ZodRecord<z.ZodString, z.ZodEnum<{
|
package/dist/tools/shell.d.ts
CHANGED
|
@@ -55,6 +55,17 @@ export declare function normalizeShellCommand(input: {
|
|
|
55
55
|
command: string;
|
|
56
56
|
args: string[];
|
|
57
57
|
};
|
|
58
|
+
type WindowsShellKind = "pwsh" | "powershell" | "cmd";
|
|
59
|
+
/**
|
|
60
|
+
* Build the command line handed to cmd.exe via `spawn(shell: true)` on Windows.
|
|
61
|
+
* `commandLine` is the pre-quoted line used directly for the cmd.exe fallback.
|
|
62
|
+
*
|
|
63
|
+
* For PowerShell we do not pass the raw line through cmd: `-EncodedCommand`
|
|
64
|
+
* (UTF-16LE base64) carries the script untouched, so arguments with spaces,
|
|
65
|
+
* quotes or `&` reach the child program exactly as given. `chcp 65001` keeps
|
|
66
|
+
* the console code page UTF-8 so redirected pipes decode consistently.
|
|
67
|
+
*/
|
|
68
|
+
export declare function buildWindowsCommandLine(kind: WindowsShellKind, commandLine: string, command: string, args: readonly string[]): string;
|
|
58
69
|
export declare function createShellTool(workspace: string, options?: ShellToolOptions): ShellTool;
|
|
59
70
|
export declare function executeShell(root: string, input: z.infer<typeof ShellInput>, cancellation: AbortSignal, maxBytes: number, onOutput?: (stream: "stdout" | "stderr", text: string) => void): Promise<ShellResult>;
|
|
60
71
|
export {};
|
package/dist/ui/commands.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const MVP_COMMANDS: readonly ["model", "init", "config", "login", "permissions", "skills", "plugins", "hooks", "tasks", "finish", "compact", "clear", "help", "exit", "audit", "usage", "loop", "goal", "evolve", "mcp", "ide", "memory", "remember", "forget", "forget-cold", "checkpoint", "tree", "rewind", "unrevert", "fork", "pals", "chat", "co-work"];
|
|
1
|
+
export declare const MVP_COMMANDS: readonly ["model", "init", "config", "login", "logout", "permissions", "skills", "plugins", "hooks", "tasks", "finish", "compact", "clear", "help", "exit", "audit", "usage", "loop", "goal", "evolve", "mcp", "commit", "review", "ide", "memory", "remember", "forget", "forget-cold", "checkpoint", "tree", "rewind", "unrevert", "fork", "pals", "chat", "co-work"];
|
|
2
2
|
export declare const COMMAND_DESCRIPTIONS: Record<(typeof MVP_COMMANDS)[number], string>;
|
|
3
3
|
export type PermissionCommandMode = PermissionMode;
|
|
4
4
|
export type ModelRole = "main" | "subagent";
|
|
@@ -63,6 +63,12 @@ export type SlashCommand = {
|
|
|
63
63
|
} | {
|
|
64
64
|
name: "goal";
|
|
65
65
|
goal: string;
|
|
66
|
+
} | {
|
|
67
|
+
name: "commit";
|
|
68
|
+
hint?: string;
|
|
69
|
+
} | {
|
|
70
|
+
name: "review";
|
|
71
|
+
focus?: string;
|
|
66
72
|
} | {
|
|
67
73
|
name: "remember";
|
|
68
74
|
type: MemoryType;
|
|
@@ -81,7 +87,7 @@ export type SlashCommand = {
|
|
|
81
87
|
target: string;
|
|
82
88
|
goal: string;
|
|
83
89
|
} | CoWorkSlashCommand | {
|
|
84
|
-
name: Exclude<(typeof MVP_COMMANDS)[number], "model" | "permissions" | "audit" | "loop" | "goal" | "evolve" | "mcp" | "remember" | "forget" | "checkpoint" | "rewind" | "fork" | "pals" | "chat" | "co-work">;
|
|
90
|
+
name: Exclude<(typeof MVP_COMMANDS)[number], "model" | "permissions" | "audit" | "loop" | "goal" | "evolve" | "commit" | "review" | "mcp" | "remember" | "forget" | "checkpoint" | "rewind" | "fork" | "pals" | "chat" | "co-work">;
|
|
85
91
|
} | {
|
|
86
92
|
name: "audit";
|
|
87
93
|
toolFilter?: string | undefined;
|
package/dist/ui/session.d.ts
CHANGED
|
@@ -129,6 +129,8 @@ export interface SessionServices {
|
|
|
129
129
|
tasks(): unknown;
|
|
130
130
|
audit(toolFilter?: string): string | Promise<string>;
|
|
131
131
|
evolve(args: readonly string[]): string | Promise<string>;
|
|
132
|
+
gitCommit?(hint: string | undefined, signal: AbortSignal): Promise<string>;
|
|
133
|
+
gitReview?(focus: string | undefined, signal: AbortSignal): Promise<string>;
|
|
132
134
|
usage(): string | Promise<string>;
|
|
133
135
|
cancelActiveTask(): void | Promise<void>;
|
|
134
136
|
clearContext(): void | Promise<void>;
|
|
@@ -151,6 +153,7 @@ export interface SessionServices {
|
|
|
151
153
|
output(event: SessionOutput): void;
|
|
152
154
|
questions: QuestionBridge;
|
|
153
155
|
login(): Promise<string>;
|
|
156
|
+
logout(): Promise<string>;
|
|
154
157
|
pals?: PalSessionServices;
|
|
155
158
|
}
|
|
156
159
|
export interface MultimodalSessionInput {
|