flavor-code 1.2.11 → 1.2.14
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 +39 -35
- package/README.zh-CN.md +39 -35
- package/dist/{app-MXWPZBEU.js → app-UJAGMKD5.js} +6 -4
- package/dist/astgraph/db.mjs +237 -0
- package/dist/astgraph/extract.mjs +239 -0
- package/dist/astgraph/flavor-plugin.json +25 -0
- package/dist/astgraph/grammars.mjs +68 -0
- package/dist/astgraph/index.js +301 -0
- package/dist/astgraph/indexer.mjs +175 -0
- package/dist/astgraph/query.mjs +165 -0
- package/dist/astgraph/resolve.mjs +93 -0
- package/dist/astgraph/vendor/tree-sitter-javascript.wasm +0 -0
- package/dist/astgraph/vendor/tree-sitter-tsx.wasm +0 -0
- package/dist/astgraph/vendor/tree-sitter-typescript.wasm +0 -0
- package/dist/astgraph/vendor/tree-sitter.js +3980 -0
- package/dist/astgraph/vendor/tree-sitter.wasm +0 -0
- package/dist/astgraph/vendor/zod/LICENSE +21 -0
- package/dist/astgraph/vendor/zod/index.js +4 -0
- package/dist/astgraph/vendor/zod/locales/index.js +1 -0
- package/dist/astgraph/vendor/zod/locales/package.json +7 -0
- package/dist/astgraph/vendor/zod/package.json +135 -0
- package/dist/astgraph/vendor/zod/v4/classic/checks.js +1 -0
- package/dist/astgraph/vendor/zod/v4/classic/coerce.js +17 -0
- package/dist/astgraph/vendor/zod/v4/classic/compat.js +31 -0
- package/dist/astgraph/vendor/zod/v4/classic/errors.js +48 -0
- package/dist/astgraph/vendor/zod/v4/classic/external.js +20 -0
- package/dist/astgraph/vendor/zod/v4/classic/from-json-schema.js +599 -0
- package/dist/astgraph/vendor/zod/v4/classic/index.js +4 -0
- package/dist/astgraph/vendor/zod/v4/classic/iso.js +30 -0
- package/dist/astgraph/vendor/zod/v4/classic/package.json +7 -0
- package/dist/astgraph/vendor/zod/v4/classic/parse.js +15 -0
- package/dist/astgraph/vendor/zod/v4/classic/schemas.js +1395 -0
- package/dist/astgraph/vendor/zod/v4/core/api.js +1087 -0
- package/dist/astgraph/vendor/zod/v4/core/checks.js +575 -0
- package/dist/astgraph/vendor/zod/v4/core/core.js +78 -0
- package/dist/astgraph/vendor/zod/v4/core/doc.js +35 -0
- package/dist/astgraph/vendor/zod/v4/core/errors.js +185 -0
- package/dist/astgraph/vendor/zod/v4/core/index.js +16 -0
- package/dist/astgraph/vendor/zod/v4/core/json-schema-generator.js +95 -0
- package/dist/astgraph/vendor/zod/v4/core/json-schema-processors.js +601 -0
- package/dist/astgraph/vendor/zod/v4/core/json-schema.js +1 -0
- package/dist/astgraph/vendor/zod/v4/core/package.json +7 -0
- package/dist/astgraph/vendor/zod/v4/core/parse.js +93 -0
- package/dist/astgraph/vendor/zod/v4/core/regexes.js +139 -0
- package/dist/astgraph/vendor/zod/v4/core/registries.js +51 -0
- package/dist/astgraph/vendor/zod/v4/core/schemas.js +2239 -0
- package/dist/astgraph/vendor/zod/v4/core/standard-schema.js +1 -0
- package/dist/astgraph/vendor/zod/v4/core/to-json-schema.js +448 -0
- package/dist/astgraph/vendor/zod/v4/core/util.js +674 -0
- package/dist/astgraph/vendor/zod/v4/core/versions.js +5 -0
- package/dist/astgraph/vendor/zod/v4/index.js +3 -0
- package/dist/astgraph/vendor/zod/v4/locales/ar.js +106 -0
- package/dist/astgraph/vendor/zod/v4/locales/az.js +105 -0
- package/dist/astgraph/vendor/zod/v4/locales/be.js +156 -0
- package/dist/astgraph/vendor/zod/v4/locales/bg.js +120 -0
- package/dist/astgraph/vendor/zod/v4/locales/ca.js +107 -0
- package/dist/astgraph/vendor/zod/v4/locales/cs.js +111 -0
- package/dist/astgraph/vendor/zod/v4/locales/da.js +115 -0
- package/dist/astgraph/vendor/zod/v4/locales/de.js +108 -0
- package/dist/astgraph/vendor/zod/v4/locales/el.js +109 -0
- package/dist/astgraph/vendor/zod/v4/locales/en.js +113 -0
- package/dist/astgraph/vendor/zod/v4/locales/eo.js +109 -0
- package/dist/astgraph/vendor/zod/v4/locales/es.js +132 -0
- package/dist/astgraph/vendor/zod/v4/locales/fa.js +114 -0
- package/dist/astgraph/vendor/zod/v4/locales/fi.js +112 -0
- package/dist/astgraph/vendor/zod/v4/locales/fr-CA.js +107 -0
- package/dist/astgraph/vendor/zod/v4/locales/fr.js +125 -0
- package/dist/astgraph/vendor/zod/v4/locales/he.js +214 -0
- package/dist/astgraph/vendor/zod/v4/locales/hr.js +122 -0
- package/dist/astgraph/vendor/zod/v4/locales/hu.js +108 -0
- package/dist/astgraph/vendor/zod/v4/locales/hy.js +147 -0
- package/dist/astgraph/vendor/zod/v4/locales/id.js +106 -0
- package/dist/astgraph/vendor/zod/v4/locales/index.js +52 -0
- package/dist/astgraph/vendor/zod/v4/locales/is.js +109 -0
- package/dist/astgraph/vendor/zod/v4/locales/it.js +108 -0
- package/dist/astgraph/vendor/zod/v4/locales/ja.js +107 -0
- package/dist/astgraph/vendor/zod/v4/locales/ka.js +112 -0
- package/dist/astgraph/vendor/zod/v4/locales/kh.js +5 -0
- package/dist/astgraph/vendor/zod/v4/locales/km.js +110 -0
- package/dist/astgraph/vendor/zod/v4/locales/ko.js +111 -0
- package/dist/astgraph/vendor/zod/v4/locales/lt.js +203 -0
- package/dist/astgraph/vendor/zod/v4/locales/mk.js +109 -0
- package/dist/astgraph/vendor/zod/v4/locales/ms.js +107 -0
- package/dist/astgraph/vendor/zod/v4/locales/nl.js +110 -0
- package/dist/astgraph/vendor/zod/v4/locales/no.js +108 -0
- package/dist/astgraph/vendor/zod/v4/locales/ota.js +109 -0
- package/dist/astgraph/vendor/zod/v4/locales/package.json +7 -0
- package/dist/astgraph/vendor/zod/v4/locales/pl.js +109 -0
- package/dist/astgraph/vendor/zod/v4/locales/ps.js +114 -0
- package/dist/astgraph/vendor/zod/v4/locales/pt.js +108 -0
- package/dist/astgraph/vendor/zod/v4/locales/ro.js +119 -0
- package/dist/astgraph/vendor/zod/v4/locales/ru.js +156 -0
- package/dist/astgraph/vendor/zod/v4/locales/sl.js +109 -0
- package/dist/astgraph/vendor/zod/v4/locales/sv.js +110 -0
- package/dist/astgraph/vendor/zod/v4/locales/ta.js +110 -0
- package/dist/astgraph/vendor/zod/v4/locales/th.js +110 -0
- package/dist/astgraph/vendor/zod/v4/locales/tr.js +105 -0
- package/dist/astgraph/vendor/zod/v4/locales/ua.js +5 -0
- package/dist/astgraph/vendor/zod/v4/locales/uk.js +108 -0
- package/dist/astgraph/vendor/zod/v4/locales/ur.js +110 -0
- package/dist/astgraph/vendor/zod/v4/locales/uz.js +110 -0
- package/dist/astgraph/vendor/zod/v4/locales/vi.js +108 -0
- package/dist/astgraph/vendor/zod/v4/locales/yo.js +107 -0
- package/dist/astgraph/vendor/zod/v4/locales/zh-CN.js +109 -0
- package/dist/astgraph/vendor/zod/v4/locales/zh-TW.js +107 -0
- package/dist/astgraph/vendor/zod/v4/mini/checks.js +1 -0
- package/dist/astgraph/vendor/zod/v4/mini/coerce.js +22 -0
- package/dist/astgraph/vendor/zod/v4/mini/external.js +14 -0
- package/dist/astgraph/vendor/zod/v4/mini/index.js +3 -0
- package/dist/astgraph/vendor/zod/v4/mini/iso.js +34 -0
- package/dist/astgraph/vendor/zod/v4/mini/package.json +7 -0
- package/dist/astgraph/vendor/zod/v4/mini/parse.js +1 -0
- package/dist/astgraph/vendor/zod/v4/mini/schemas.js +961 -0
- package/dist/astgraph/vendor/zod/v4/package.json +7 -0
- package/dist/{chunk-OT5XIN6G.js → chunk-4YXDGGIC.js} +4763 -3763
- package/dist/{chunk-XFCJXRJ2.js → chunk-IG4Z23CL.js} +6 -0
- package/dist/{chunk-EY6KE7L2.js → chunk-KL6TR2KG.js} +1 -1
- package/dist/cli.js +5 -5
- package/dist/config/schema.d.ts +6 -0
- package/dist/desktop/main.js +5028 -4023
- package/dist/desktop-renderer/assets/{index-sgEm4kjf.js → index-CcD0D6x0.js} +2 -2
- package/dist/desktop-renderer/index.html +1 -1
- package/dist/evolve/loader.d.ts +21 -0
- package/dist/evolve/service.d.ts +37 -0
- package/dist/evolve/store.d.ts +91 -0
- package/dist/hooks/types.d.ts +5 -1
- package/dist/init/project.d.ts +8 -0
- package/dist/{load-6ZMEBHSG.js → load-GKA7P6RJ.js} +1 -1
- package/dist/models/structured.d.ts +14 -0
- package/dist/permissions/engine.d.ts +2 -0
- package/dist/plugins/host.d.ts +9 -0
- package/dist/plugins/types.d.ts +3 -2
- package/dist/sdk/index.js +3 -3
- package/dist/tools/shell.d.ts +14 -1
- package/dist/tools/types.d.ts +2 -0
- package/dist/ui/commands.d.ts +5 -2
- package/dist/ui/session.d.ts +5 -1
- package/package.json +5 -3
- package//346/212/200/346/234/257/346/226/271/346/241/210/346/212/245/345/221/212.md +303 -1
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
export interface EvolveSignal {
|
|
2
|
+
id: string;
|
|
3
|
+
tool: string;
|
|
4
|
+
errorCode?: string;
|
|
5
|
+
error: string;
|
|
6
|
+
/** Key names of the failing tool input — never values, so secrets stay out of the file. */
|
|
7
|
+
args: string[];
|
|
8
|
+
firstAt: string;
|
|
9
|
+
lastAt: string;
|
|
10
|
+
count: number;
|
|
11
|
+
}
|
|
12
|
+
export interface EvolveSuggestion {
|
|
13
|
+
id: string;
|
|
14
|
+
tool: string;
|
|
15
|
+
count: number;
|
|
16
|
+
error: string;
|
|
17
|
+
hint: string;
|
|
18
|
+
/** Trend of this tool's failure count since the last run (only when trends are supplied). */
|
|
19
|
+
trend?: "improving" | "stable" | "worsening";
|
|
20
|
+
/** Failure-count delta since the last run, from the supplied trends. */
|
|
21
|
+
delta?: number;
|
|
22
|
+
}
|
|
23
|
+
export interface ToolTrend {
|
|
24
|
+
/** Failure count of this tool in the run (per-run, not cumulative). */
|
|
25
|
+
failures: number;
|
|
26
|
+
/** Change vs the previous run: negative means the fix is working. */
|
|
27
|
+
delta: number;
|
|
28
|
+
}
|
|
29
|
+
export interface EvolveReflectionInput {
|
|
30
|
+
iterations: number;
|
|
31
|
+
reason: string;
|
|
32
|
+
toolCalls: number;
|
|
33
|
+
toolErrors: number;
|
|
34
|
+
steers: number;
|
|
35
|
+
totalFailures: number;
|
|
36
|
+
signalDelta: number;
|
|
37
|
+
failedTools: readonly string[];
|
|
38
|
+
perTool?: Record<string, ToolTrend>;
|
|
39
|
+
}
|
|
40
|
+
export interface EvolveReflection extends EvolveReflectionInput {
|
|
41
|
+
at: string;
|
|
42
|
+
perTool: Record<string, ToolTrend>;
|
|
43
|
+
}
|
|
44
|
+
export interface EvolveStoreOptions {
|
|
45
|
+
workspace: string;
|
|
46
|
+
maxSignals?: number;
|
|
47
|
+
}
|
|
48
|
+
/** Collapse whitespace and quoted values so equivalent messages coalesce. */
|
|
49
|
+
export declare function normalizeError(message: unknown): string;
|
|
50
|
+
/** Stable id for a (tool, errorCode, error) triple, so repeated failures coalesce. */
|
|
51
|
+
export declare function fingerprint(tool: string, errorCode: string | undefined, error: unknown): string;
|
|
52
|
+
/** Value-free summary of tool args: only key names, never secrets. */
|
|
53
|
+
export declare function argKeys(args: unknown): string[];
|
|
54
|
+
export declare class EvolveStore {
|
|
55
|
+
#private;
|
|
56
|
+
readonly dir: string;
|
|
57
|
+
readonly signalsFile: string;
|
|
58
|
+
readonly reflectionsFile: string;
|
|
59
|
+
readonly doneFile: string;
|
|
60
|
+
readonly verifiedFile: string;
|
|
61
|
+
readonly maxSignals: number;
|
|
62
|
+
constructor(options: EvolveStoreOptions);
|
|
63
|
+
/**
|
|
64
|
+
* Record one failed tool call. Dedupes by (tool, errorCode, normalized error):
|
|
65
|
+
* existing entries get count/lastAt bumped instead of growing unbounded.
|
|
66
|
+
*/
|
|
67
|
+
recordSignal(input: {
|
|
68
|
+
tool: string;
|
|
69
|
+
errorCode?: string;
|
|
70
|
+
error: unknown;
|
|
71
|
+
args?: unknown;
|
|
72
|
+
}): Promise<{
|
|
73
|
+
added: boolean;
|
|
74
|
+
record: EvolveSignal;
|
|
75
|
+
}>;
|
|
76
|
+
signals(): Promise<EvolveSignal[]>;
|
|
77
|
+
clearSignals(): Promise<void>;
|
|
78
|
+
appendReflection(input: EvolveReflectionInput): Promise<EvolveReflection>;
|
|
79
|
+
reflections(limit?: number): Promise<EvolveReflection[]>;
|
|
80
|
+
/** Aggregate open suggestions from repeated failure signals. */
|
|
81
|
+
openSuggestions(input?: {
|
|
82
|
+
threshold?: number;
|
|
83
|
+
limit?: number;
|
|
84
|
+
trends?: Readonly<Record<string, number>>;
|
|
85
|
+
}): Promise<EvolveSuggestion[]>;
|
|
86
|
+
markSuggestionDone(id: string): Promise<void>;
|
|
87
|
+
/** Ids of suggestions whose underlying tool failure is improving (auto-verified). */
|
|
88
|
+
verifiedIds(): Promise<string[]>;
|
|
89
|
+
/** Mark a suggestion as verified so it is no longer proposed. */
|
|
90
|
+
markSuggestionVerified(id: string): Promise<void>;
|
|
91
|
+
}
|
package/dist/hooks/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
export declare const HOOK_EVENT_NAMES: readonly ["SessionStart", "UserPromptSubmit", "Stop", "SessionEnd", "BeforePlan", "AfterPlan", "SubagentStart", "SubagentStop", "BeforeModelCall", "AfterModelCall", "PreToolUse", "PermissionRequest", "PostToolUse", "PostToolUseFailure", "PreCompact", "PostCompact", "PluginLoad", "PluginUnload", "Notification"];
|
|
2
|
+
export declare const HOOK_EVENT_NAMES: readonly ["SessionStart", "UserPromptSubmit", "Stop", "SessionEnd", "BeforePlan", "AfterPlan", "SubagentStart", "SubagentStop", "BeforeModelCall", "AfterModelCall", "PreToolUse", "PermissionRequest", "PostToolUse", "PostToolUseFailure", "PreCompact", "PostCompact", "PluginLoad", "PluginUnload", "Notification", "LoopEnd"];
|
|
3
3
|
export declare const HookEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
4
4
|
version: z.ZodLiteral<1>;
|
|
5
5
|
type: z.ZodLiteral<"SessionStart">;
|
|
@@ -76,6 +76,10 @@ export declare const HookEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
76
76
|
version: z.ZodLiteral<1>;
|
|
77
77
|
type: z.ZodLiteral<"Notification">;
|
|
78
78
|
payload: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
79
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
80
|
+
version: z.ZodLiteral<1>;
|
|
81
|
+
type: z.ZodLiteral<"LoopEnd">;
|
|
82
|
+
payload: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
79
83
|
}, z.core.$strip>], "type">;
|
|
80
84
|
export declare const HookDecisionSchema: z.ZodObject<{
|
|
81
85
|
decision: z.ZodEnum<{
|
package/dist/init/project.d.ts
CHANGED
|
@@ -13,6 +13,8 @@ export interface ProjectFacts {
|
|
|
13
13
|
instructionFiles: string[];
|
|
14
14
|
configFiles: string[];
|
|
15
15
|
gitignorePath?: string;
|
|
16
|
+
/** True when an astgraph code-graph index (`.flavor/astgraph/index.db`) exists. */
|
|
17
|
+
hasCodeGraph: boolean;
|
|
16
18
|
cautions: string[];
|
|
17
19
|
}
|
|
18
20
|
export interface InitResult {
|
|
@@ -22,4 +24,10 @@ export interface InitResult {
|
|
|
22
24
|
facts: ProjectFacts;
|
|
23
25
|
}
|
|
24
26
|
export declare function inspectProject(cwd: string): Promise<ProjectFacts>;
|
|
27
|
+
/**
|
|
28
|
+
* Copy the astgraph plugin (runtime + vendored WASM grammars + zod) into the
|
|
29
|
+
* workspace's project plugin directory. Mirrors the codeisland distribution
|
|
30
|
+
* pattern: an existing installation is never overwritten.
|
|
31
|
+
*/
|
|
32
|
+
export declare function copyAstgraphPlugin(cwd: string): Promise<void>;
|
|
25
33
|
export declare function initializeFlavor(cwd: string): Promise<InitResult>;
|
|
@@ -72,4 +72,18 @@ export declare class StructuredOutputError extends Error {
|
|
|
72
72
|
}
|
|
73
73
|
export declare function withStructuredOutput<T>(options: StructuredOutputOptions<T>): StructuredModel<T>;
|
|
74
74
|
export declare function strictJsonSchema(schema: z.ZodType<unknown>): Record<string, unknown>;
|
|
75
|
+
/**
|
|
76
|
+
* Extract the first JSON object or array from free-form model text (plain JSON,
|
|
77
|
+
* fenced ```json blocks, or JSON embedded in prose). Returns undefined when no
|
|
78
|
+
* parseable object is found.
|
|
79
|
+
*/
|
|
80
|
+
export declare function extractJsonObject(text: string): unknown;
|
|
81
|
+
/**
|
|
82
|
+
* Best-effort type coercion guided by a JSON schema. Some providers serialize
|
|
83
|
+
* typed fields as strings (`"10"` for an integer). This rewrites string→number /
|
|
84
|
+
* string→boolean where the schema demands those types, recursing into object
|
|
85
|
+
* properties and anyOf branches. Values already matching the schema are
|
|
86
|
+
* returned unchanged, so a valid payload is a no-op.
|
|
87
|
+
*/
|
|
88
|
+
export declare function coerceByJsonSchema(value: unknown, schema: unknown): unknown;
|
|
75
89
|
export declare function modelToolFromZod(name: string, description: string, schema: z.ZodType<unknown>): ModelTool;
|
|
@@ -15,6 +15,8 @@ export interface PermissionRequest {
|
|
|
15
15
|
args?: readonly string[];
|
|
16
16
|
cwd?: string;
|
|
17
17
|
allowAlways?: false;
|
|
18
|
+
/** Declared read-only by the tool definition; granted the same treatment as READ_TOOLS. */
|
|
19
|
+
readOnly?: boolean;
|
|
18
20
|
}
|
|
19
21
|
export interface PermissionEngineOptions {
|
|
20
22
|
workspace: string;
|
package/dist/plugins/host.d.ts
CHANGED
|
@@ -11,5 +11,14 @@ export declare class PluginHost {
|
|
|
11
11
|
get loadedPlugins(): readonly LoadedPlugin[];
|
|
12
12
|
loadAll(): Promise<void>;
|
|
13
13
|
unloadAll(): Promise<void>;
|
|
14
|
+
/**
|
|
15
|
+
* Reload one plugin from disk: unloads the active instance (if any), then
|
|
16
|
+
* re-discovers and activates the current version. Used by the evolve loop to
|
|
17
|
+
* hot-load fix plugins after verification.
|
|
18
|
+
*/
|
|
19
|
+
reload(name: string): Promise<{
|
|
20
|
+
ok: boolean;
|
|
21
|
+
error?: string;
|
|
22
|
+
}>;
|
|
14
23
|
unload(name: string): Promise<void>;
|
|
15
24
|
}
|
package/dist/plugins/types.d.ts
CHANGED
|
@@ -24,6 +24,7 @@ export declare const PluginManifestSchema: z.ZodObject<{
|
|
|
24
24
|
AfterPlan: "AfterPlan";
|
|
25
25
|
BeforeModelCall: "BeforeModelCall";
|
|
26
26
|
BeforePlan: "BeforePlan";
|
|
27
|
+
LoopEnd: "LoopEnd";
|
|
27
28
|
Notification: "Notification";
|
|
28
29
|
PermissionRequest: "PermissionRequest";
|
|
29
30
|
PluginLoad: "PluginLoad";
|
|
@@ -81,7 +82,7 @@ export interface PluginContext {
|
|
|
81
82
|
readonly config: unknown;
|
|
82
83
|
readonly logger: PluginLogger;
|
|
83
84
|
readonly services: PluginServices;
|
|
84
|
-
registerCommand(name: string, command: PluginCommandHandler): PluginDisposer;
|
|
85
|
+
registerCommand(name: string, command: PluginCommandHandler, description?: string): PluginDisposer;
|
|
85
86
|
registerTool(name: string, tool: ToolDefinition<unknown>): PluginDisposer;
|
|
86
87
|
registerHook(name: HookEventName, hook: HookHandler, options?: HookHandlerOptions): PluginDisposer;
|
|
87
88
|
registerSkillRoot(name: string, root: string): PluginDisposer;
|
|
@@ -108,7 +109,7 @@ export interface LoadedPlugin {
|
|
|
108
109
|
readonly root: string;
|
|
109
110
|
}
|
|
110
111
|
export interface PluginRegistrationCallbacks {
|
|
111
|
-
command(name: string, command: PluginCommandHandler): PluginDisposer;
|
|
112
|
+
command(name: string, command: PluginCommandHandler, description?: string): PluginDisposer;
|
|
112
113
|
tool(name: string, tool: ToolDefinition<unknown>): PluginDisposer;
|
|
113
114
|
hook(name: HookEventName, hook: HookHandler, options?: HookHandlerOptions): PluginDisposer;
|
|
114
115
|
/** Consumers must revalidate identity before access, or delegate reading to SkillRegistry. */
|
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-KL6TR2KG.js";
|
|
8
8
|
import {
|
|
9
9
|
AgentMessageQueue,
|
|
10
10
|
DockerExecutionEnvironment,
|
|
@@ -13,8 +13,8 @@ import {
|
|
|
13
13
|
WorkspaceCheckpointStore,
|
|
14
14
|
buildDockerInvocation,
|
|
15
15
|
createProductionRuntime
|
|
16
|
-
} from "../chunk-
|
|
17
|
-
import "../chunk-
|
|
16
|
+
} from "../chunk-4YXDGGIC.js";
|
|
17
|
+
import "../chunk-IG4Z23CL.js";
|
|
18
18
|
import "../chunk-RQTYHUMK.js";
|
|
19
19
|
import "../chunk-S32JRDZK.js";
|
|
20
20
|
|
package/dist/tools/shell.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ declare const ShellInput: z.ZodObject<{
|
|
|
9
9
|
args: z.ZodArray<z.ZodString>;
|
|
10
10
|
cwd: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
11
11
|
timeoutMs: z.ZodOptional<z.ZodNullable<z.ZodCoercedNumber<unknown>>>;
|
|
12
|
-
background: z.ZodOptional<z.ZodBoolean
|
|
12
|
+
background: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodString & z.ZodType<"false" | "true", string, z.core.$ZodTypeInternals<"false" | "true", string>>]>>;
|
|
13
13
|
}, z.core.$strip>;
|
|
14
14
|
export interface ShellToolOptions {
|
|
15
15
|
maxOutputBytes?: number;
|
|
@@ -42,6 +42,19 @@ export interface ShellBackgroundResult extends ShellResult {
|
|
|
42
42
|
type ShellTool = Omit<ToolDefinition<z.infer<typeof ShellInput>, ShellResult | ShellBackgroundResult>, "execute"> & {
|
|
43
43
|
execute(input: z.infer<typeof ShellInput>, signal: AbortSignal, context?: import("./types.js").ToolContext): Promise<ShellResult | ShellBackgroundResult>;
|
|
44
44
|
};
|
|
45
|
+
/**
|
|
46
|
+
* Normalize weak model calls that stuff a whole command line into `command`
|
|
47
|
+
* (e.g. `command: "git log --oneline"`). Splits only when the first token is a
|
|
48
|
+
* bare command name (no path separators), so explicit paths with spaces —
|
|
49
|
+
* `command: "C:\\Program Files\\node.exe"` — are left untouched.
|
|
50
|
+
*/
|
|
51
|
+
export declare function normalizeShellCommand(input: {
|
|
52
|
+
command: string;
|
|
53
|
+
args: readonly string[];
|
|
54
|
+
}): {
|
|
55
|
+
command: string;
|
|
56
|
+
args: string[];
|
|
57
|
+
};
|
|
45
58
|
export declare function createShellTool(workspace: string, options?: ShellToolOptions): ShellTool;
|
|
46
59
|
export declare function executeShell(root: string, input: z.infer<typeof ShellInput>, cancellation: AbortSignal, maxBytes: number, onOutput?: (stream: "stdout" | "stderr", text: string) => void): Promise<ShellResult>;
|
|
47
60
|
export {};
|
package/dist/tools/types.d.ts
CHANGED
|
@@ -89,6 +89,8 @@ export interface ToolDefinition<T, O = unknown> {
|
|
|
89
89
|
modelInputSchema?: Record<string, unknown>;
|
|
90
90
|
/** Whether providers should enforce strict function arguments. Defaults to true. */
|
|
91
91
|
modelStrict?: boolean;
|
|
92
|
+
/** Declared read-only: allowed without approval, same as Read/Glob/Grep (including plan mode). */
|
|
93
|
+
readOnly?: boolean;
|
|
92
94
|
paths(input: T): string[];
|
|
93
95
|
/**
|
|
94
96
|
* Optional short human-readable parameter summary, rendered dimmed next to the tool name.
|
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", "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", "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"];
|
|
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";
|
|
@@ -81,10 +81,13 @@ export type SlashCommand = {
|
|
|
81
81
|
target: string;
|
|
82
82
|
goal: string;
|
|
83
83
|
} | CoWorkSlashCommand | {
|
|
84
|
-
name: Exclude<(typeof MVP_COMMANDS)[number], "model" | "permissions" | "audit" | "loop" | "goal" | "mcp" | "remember" | "forget" | "checkpoint" | "rewind" | "fork" | "pals" | "chat" | "co-work">;
|
|
84
|
+
name: Exclude<(typeof MVP_COMMANDS)[number], "model" | "permissions" | "audit" | "loop" | "goal" | "evolve" | "mcp" | "remember" | "forget" | "checkpoint" | "rewind" | "fork" | "pals" | "chat" | "co-work">;
|
|
85
85
|
} | {
|
|
86
86
|
name: "audit";
|
|
87
87
|
toolFilter?: string | undefined;
|
|
88
|
+
} | {
|
|
89
|
+
name: "evolve";
|
|
90
|
+
args: string[];
|
|
88
91
|
} | {
|
|
89
92
|
name: "unknown";
|
|
90
93
|
input: string;
|
package/dist/ui/session.d.ts
CHANGED
|
@@ -128,6 +128,7 @@ export interface SessionServices {
|
|
|
128
128
|
hooksStatus(): readonly unknown[];
|
|
129
129
|
tasks(): unknown;
|
|
130
130
|
audit(toolFilter?: string): string | Promise<string>;
|
|
131
|
+
evolve(args: readonly string[]): string | Promise<string>;
|
|
131
132
|
usage(): string | Promise<string>;
|
|
132
133
|
cancelActiveTask(): void | Promise<void>;
|
|
133
134
|
clearContext(): void | Promise<void>;
|
|
@@ -142,7 +143,10 @@ export interface SessionServices {
|
|
|
142
143
|
forget(query: string): Promise<string>;
|
|
143
144
|
forgetCold(): Promise<string>;
|
|
144
145
|
finishTask(): Promise<string>;
|
|
145
|
-
pluginCommands(): readonly
|
|
146
|
+
pluginCommands(): readonly {
|
|
147
|
+
name: string;
|
|
148
|
+
description?: string;
|
|
149
|
+
}[];
|
|
146
150
|
runPluginCommand(name: string, args: readonly string[], signal: AbortSignal): Promise<unknown>;
|
|
147
151
|
output(event: SessionOutput): void;
|
|
148
152
|
questions: QuestionBridge;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "flavor-code",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.14",
|
|
4
4
|
"author": "YachuanWzh",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"publishConfig": {
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"scripts": {
|
|
32
32
|
"build": "npm run build:icons && npm run build:cli && npm run build:desktop",
|
|
33
33
|
"build:icons": "node scripts/build-icons.mjs",
|
|
34
|
-
"build:cli": "tsup && tsc -p tsconfig.sdk.json && node -e \"require('fs').cpSync('src/init/codeisland','dist/codeisland',{recursive:true})\"",
|
|
34
|
+
"build:cli": "tsup && tsc -p tsconfig.sdk.json && node -e \"require('fs').cpSync('src/init/codeisland','dist/codeisland',{recursive:true});require('fs').cpSync('src/init/astgraph','dist/astgraph',{recursive:true})\"",
|
|
35
35
|
"build:desktop": "npm run build:desktop:main && npm run build:desktop:renderer",
|
|
36
36
|
"build:desktop:main": "tsup --config tsup.desktop.config.ts",
|
|
37
37
|
"build:desktop:renderer": "vite build --config vite.desktop.config.ts",
|
|
@@ -127,9 +127,11 @@
|
|
|
127
127
|
"electron-builder": "^26.15.3",
|
|
128
128
|
"playwright-core": "^1.62.1",
|
|
129
129
|
"sharp": "^0.35.3",
|
|
130
|
+
"tree-sitter-wasms": "0.1.13",
|
|
130
131
|
"tsup": "^8.5.1",
|
|
131
132
|
"vite": "^8.1.5",
|
|
132
|
-
"vitest": "^4.1.10"
|
|
133
|
+
"vitest": "^4.1.10",
|
|
134
|
+
"web-tree-sitter": "0.25.10"
|
|
133
135
|
},
|
|
134
136
|
"allowScripts": {
|
|
135
137
|
"electron-winstaller@5.4.0": true,
|