flavor-code 1.3.23 → 1.4.0-beta.10

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.
Files changed (181) hide show
  1. package/README.md +439 -434
  2. package/README.zh-CN.md +436 -431
  3. package/dist/agent/loop.d.ts +7 -2
  4. package/dist/{app-NTEUPJKJ.js → app-SMIB6P23.js} +82 -161
  5. package/dist/{chunk-Z62P4LL7.js → chunk-BYHO2CA5.js} +10412 -8712
  6. package/dist/{chunk-RPFWB45Y.js → chunk-EXOSMO57.js} +13 -8
  7. package/dist/chunk-N5MXHJKD.js +107 -0
  8. package/dist/{chunk-7OICVL2M.js → chunk-RAYH6K2H.js} +2 -44
  9. package/dist/{chunk-VEUSROUQ.js → chunk-UO4DLWU5.js} +8 -2
  10. package/dist/{chunk-SUSLIHXO.js → chunk-XMRKRPNC.js} +179 -14253
  11. package/dist/{chunk-RQTYHUMK.js → chunk-ZJCAQXA7.js} +17 -1
  12. package/dist/{claude-ink-6CEG2XZZ.js → claude-ink-6EZHF64C.js} +2 -3
  13. package/dist/cli-main.js +75 -28
  14. package/dist/cli.js +54 -10
  15. package/dist/config/load.d.ts +2 -0
  16. package/dist/config/schema.d.ts +8 -0
  17. package/dist/context/manager.d.ts +9 -0
  18. package/dist/desktop/main.js +3035 -1237
  19. package/dist/desktop-renderer/assets/index-Bk6FYhyh.css +1 -0
  20. package/dist/desktop-renderer/assets/index-RNe5Gtum.js +154 -0
  21. package/dist/desktop-renderer/assets/{interactive-terminal-CTFo4fK9.js → interactive-terminal-DestMQ2z.js} +1 -1
  22. package/dist/desktop-renderer/index.html +2 -2
  23. package/dist/doctor.d.ts +38 -0
  24. package/dist/execution/docker.d.ts +5 -1
  25. package/dist/execution/types.d.ts +11 -0
  26. package/dist/git/service.d.ts +3 -3
  27. package/dist/git/tools.d.ts +1 -1
  28. package/dist/goal/classifier.d.ts +2 -0
  29. package/dist/goal/orchestrator.d.ts +23 -2
  30. package/dist/goal/planner.d.ts +2 -0
  31. package/dist/goal/store.d.ts +2 -0
  32. package/dist/goal/types.d.ts +14 -0
  33. package/dist/harness/journal.d.ts +2 -0
  34. package/dist/harness/local.d.ts +2 -0
  35. package/dist/init/project.d.ts +0 -6
  36. package/dist/jobs/registry.d.ts +8 -1
  37. package/dist/{load-4FWNXE6F.js → load-EW56Q2MM.js} +1 -1
  38. package/dist/loop/orchestrator.d.ts +20 -0
  39. package/dist/loop/types.d.ts +7 -0
  40. package/dist/loop/verifier.d.ts +2 -0
  41. package/dist/models/openai.d.ts +1 -1
  42. package/dist/models/structured.d.ts +7 -0
  43. package/dist/models/types.d.ts +1 -1
  44. package/dist/production.d.ts +17 -0
  45. package/dist/sdk/index.js +5 -5
  46. package/dist/session/tree.d.ts +2 -0
  47. package/dist/tools/lsp.d.ts +15 -10
  48. package/dist/tools/runtime.d.ts +2 -1
  49. package/dist/tools/search.d.ts +1 -0
  50. package/dist/tools/shell.d.ts +17 -12
  51. package/dist/tools/types.d.ts +2 -1
  52. package/dist/ui/commands.d.ts +1 -1
  53. package/dist/ui/session.d.ts +12 -0
  54. package/dist/ui/transcript.d.ts +9 -0
  55. package/dist/update/check.d.ts +20 -0
  56. package/dist/utils/abort.d.ts +20 -0
  57. package/dist/utils/execFileNoThrow.d.ts +1 -0
  58. package/dist/utils/heap.d.ts +58 -0
  59. package/dist/utils/memory-restart.d.ts +42 -3
  60. package/dist/utils/process-tree.d.ts +2 -0
  61. package/dist/utils/rotation-census.d.ts +36 -0
  62. package/dist/utils/semver.d.ts +3 -0
  63. package/dist/utils/spawn-executable.d.ts +2 -0
  64. package/package.json +3 -2
  65. package//346/212/200/346/234/257/346/226/271/346/241/210/346/212/245/345/221/212.md +5848 -5848
  66. package/dist/astgraph/db.mjs +0 -237
  67. package/dist/astgraph/extract.mjs +0 -239
  68. package/dist/astgraph/flavor-plugin.json +0 -25
  69. package/dist/astgraph/grammars.mjs +0 -68
  70. package/dist/astgraph/index.js +0 -301
  71. package/dist/astgraph/indexer.mjs +0 -175
  72. package/dist/astgraph/query.mjs +0 -165
  73. package/dist/astgraph/resolve.mjs +0 -93
  74. package/dist/astgraph/vendor/tree-sitter-javascript.wasm +0 -0
  75. package/dist/astgraph/vendor/tree-sitter-tsx.wasm +0 -0
  76. package/dist/astgraph/vendor/tree-sitter-typescript.wasm +0 -0
  77. package/dist/astgraph/vendor/tree-sitter.js +0 -3980
  78. package/dist/astgraph/vendor/tree-sitter.wasm +0 -0
  79. package/dist/astgraph/vendor/zod/LICENSE +0 -21
  80. package/dist/astgraph/vendor/zod/index.js +0 -4
  81. package/dist/astgraph/vendor/zod/locales/index.js +0 -1
  82. package/dist/astgraph/vendor/zod/locales/package.json +0 -7
  83. package/dist/astgraph/vendor/zod/package.json +0 -135
  84. package/dist/astgraph/vendor/zod/v4/classic/checks.js +0 -1
  85. package/dist/astgraph/vendor/zod/v4/classic/coerce.js +0 -17
  86. package/dist/astgraph/vendor/zod/v4/classic/compat.js +0 -31
  87. package/dist/astgraph/vendor/zod/v4/classic/errors.js +0 -48
  88. package/dist/astgraph/vendor/zod/v4/classic/external.js +0 -20
  89. package/dist/astgraph/vendor/zod/v4/classic/from-json-schema.js +0 -599
  90. package/dist/astgraph/vendor/zod/v4/classic/index.js +0 -4
  91. package/dist/astgraph/vendor/zod/v4/classic/iso.js +0 -30
  92. package/dist/astgraph/vendor/zod/v4/classic/package.json +0 -7
  93. package/dist/astgraph/vendor/zod/v4/classic/parse.js +0 -15
  94. package/dist/astgraph/vendor/zod/v4/classic/schemas.js +0 -1395
  95. package/dist/astgraph/vendor/zod/v4/core/api.js +0 -1087
  96. package/dist/astgraph/vendor/zod/v4/core/checks.js +0 -575
  97. package/dist/astgraph/vendor/zod/v4/core/core.js +0 -78
  98. package/dist/astgraph/vendor/zod/v4/core/doc.js +0 -35
  99. package/dist/astgraph/vendor/zod/v4/core/errors.js +0 -185
  100. package/dist/astgraph/vendor/zod/v4/core/index.js +0 -16
  101. package/dist/astgraph/vendor/zod/v4/core/json-schema-generator.js +0 -95
  102. package/dist/astgraph/vendor/zod/v4/core/json-schema-processors.js +0 -601
  103. package/dist/astgraph/vendor/zod/v4/core/json-schema.js +0 -1
  104. package/dist/astgraph/vendor/zod/v4/core/package.json +0 -7
  105. package/dist/astgraph/vendor/zod/v4/core/parse.js +0 -93
  106. package/dist/astgraph/vendor/zod/v4/core/regexes.js +0 -139
  107. package/dist/astgraph/vendor/zod/v4/core/registries.js +0 -51
  108. package/dist/astgraph/vendor/zod/v4/core/schemas.js +0 -2239
  109. package/dist/astgraph/vendor/zod/v4/core/standard-schema.js +0 -1
  110. package/dist/astgraph/vendor/zod/v4/core/to-json-schema.js +0 -448
  111. package/dist/astgraph/vendor/zod/v4/core/util.js +0 -674
  112. package/dist/astgraph/vendor/zod/v4/core/versions.js +0 -5
  113. package/dist/astgraph/vendor/zod/v4/index.js +0 -3
  114. package/dist/astgraph/vendor/zod/v4/locales/ar.js +0 -106
  115. package/dist/astgraph/vendor/zod/v4/locales/az.js +0 -105
  116. package/dist/astgraph/vendor/zod/v4/locales/be.js +0 -156
  117. package/dist/astgraph/vendor/zod/v4/locales/bg.js +0 -120
  118. package/dist/astgraph/vendor/zod/v4/locales/ca.js +0 -107
  119. package/dist/astgraph/vendor/zod/v4/locales/cs.js +0 -111
  120. package/dist/astgraph/vendor/zod/v4/locales/da.js +0 -115
  121. package/dist/astgraph/vendor/zod/v4/locales/de.js +0 -108
  122. package/dist/astgraph/vendor/zod/v4/locales/el.js +0 -109
  123. package/dist/astgraph/vendor/zod/v4/locales/en.js +0 -113
  124. package/dist/astgraph/vendor/zod/v4/locales/eo.js +0 -109
  125. package/dist/astgraph/vendor/zod/v4/locales/es.js +0 -132
  126. package/dist/astgraph/vendor/zod/v4/locales/fa.js +0 -114
  127. package/dist/astgraph/vendor/zod/v4/locales/fi.js +0 -112
  128. package/dist/astgraph/vendor/zod/v4/locales/fr-CA.js +0 -107
  129. package/dist/astgraph/vendor/zod/v4/locales/fr.js +0 -125
  130. package/dist/astgraph/vendor/zod/v4/locales/he.js +0 -214
  131. package/dist/astgraph/vendor/zod/v4/locales/hr.js +0 -122
  132. package/dist/astgraph/vendor/zod/v4/locales/hu.js +0 -108
  133. package/dist/astgraph/vendor/zod/v4/locales/hy.js +0 -147
  134. package/dist/astgraph/vendor/zod/v4/locales/id.js +0 -106
  135. package/dist/astgraph/vendor/zod/v4/locales/index.js +0 -52
  136. package/dist/astgraph/vendor/zod/v4/locales/is.js +0 -109
  137. package/dist/astgraph/vendor/zod/v4/locales/it.js +0 -108
  138. package/dist/astgraph/vendor/zod/v4/locales/ja.js +0 -107
  139. package/dist/astgraph/vendor/zod/v4/locales/ka.js +0 -112
  140. package/dist/astgraph/vendor/zod/v4/locales/kh.js +0 -5
  141. package/dist/astgraph/vendor/zod/v4/locales/km.js +0 -110
  142. package/dist/astgraph/vendor/zod/v4/locales/ko.js +0 -111
  143. package/dist/astgraph/vendor/zod/v4/locales/lt.js +0 -203
  144. package/dist/astgraph/vendor/zod/v4/locales/mk.js +0 -109
  145. package/dist/astgraph/vendor/zod/v4/locales/ms.js +0 -107
  146. package/dist/astgraph/vendor/zod/v4/locales/nl.js +0 -110
  147. package/dist/astgraph/vendor/zod/v4/locales/no.js +0 -108
  148. package/dist/astgraph/vendor/zod/v4/locales/ota.js +0 -109
  149. package/dist/astgraph/vendor/zod/v4/locales/package.json +0 -7
  150. package/dist/astgraph/vendor/zod/v4/locales/pl.js +0 -109
  151. package/dist/astgraph/vendor/zod/v4/locales/ps.js +0 -114
  152. package/dist/astgraph/vendor/zod/v4/locales/pt.js +0 -108
  153. package/dist/astgraph/vendor/zod/v4/locales/ro.js +0 -119
  154. package/dist/astgraph/vendor/zod/v4/locales/ru.js +0 -156
  155. package/dist/astgraph/vendor/zod/v4/locales/sl.js +0 -109
  156. package/dist/astgraph/vendor/zod/v4/locales/sv.js +0 -110
  157. package/dist/astgraph/vendor/zod/v4/locales/ta.js +0 -110
  158. package/dist/astgraph/vendor/zod/v4/locales/th.js +0 -110
  159. package/dist/astgraph/vendor/zod/v4/locales/tr.js +0 -105
  160. package/dist/astgraph/vendor/zod/v4/locales/ua.js +0 -5
  161. package/dist/astgraph/vendor/zod/v4/locales/uk.js +0 -108
  162. package/dist/astgraph/vendor/zod/v4/locales/ur.js +0 -110
  163. package/dist/astgraph/vendor/zod/v4/locales/uz.js +0 -110
  164. package/dist/astgraph/vendor/zod/v4/locales/vi.js +0 -108
  165. package/dist/astgraph/vendor/zod/v4/locales/yo.js +0 -107
  166. package/dist/astgraph/vendor/zod/v4/locales/zh-CN.js +0 -109
  167. package/dist/astgraph/vendor/zod/v4/locales/zh-TW.js +0 -107
  168. package/dist/astgraph/vendor/zod/v4/mini/checks.js +0 -1
  169. package/dist/astgraph/vendor/zod/v4/mini/coerce.js +0 -22
  170. package/dist/astgraph/vendor/zod/v4/mini/external.js +0 -14
  171. package/dist/astgraph/vendor/zod/v4/mini/index.js +0 -3
  172. package/dist/astgraph/vendor/zod/v4/mini/iso.js +0 -34
  173. package/dist/astgraph/vendor/zod/v4/mini/package.json +0 -7
  174. package/dist/astgraph/vendor/zod/v4/mini/parse.js +0 -1
  175. package/dist/astgraph/vendor/zod/v4/mini/schemas.js +0 -961
  176. package/dist/astgraph/vendor/zod/v4/package.json +0 -7
  177. package/dist/chunk-CIVPKHF4.js +0 -53
  178. package/dist/chunk-OTYFL4AG.js +0 -16
  179. package/dist/desktop-renderer/assets/index-D75ozXnZ.js +0 -154
  180. package/dist/desktop-renderer/assets/index-ZZsUx916.css +0 -1
  181. package/dist/devtools-4QTPKBKK.js +0 -2
@@ -1,185 +0,0 @@
1
- import { $constructor } from "./core.js";
2
- import * as util from "./util.js";
3
- const initializer = (inst, def) => {
4
- inst.name = "$ZodError";
5
- Object.defineProperty(inst, "_zod", {
6
- value: inst._zod,
7
- enumerable: false,
8
- });
9
- Object.defineProperty(inst, "issues", {
10
- value: def,
11
- enumerable: false,
12
- });
13
- inst.message = JSON.stringify(def, util.jsonStringifyReplacer, 2);
14
- Object.defineProperty(inst, "toString", {
15
- value: () => inst.message,
16
- enumerable: false,
17
- });
18
- };
19
- export const $ZodError = $constructor("$ZodError", initializer);
20
- export const $ZodRealError = $constructor("$ZodError", initializer, { Parent: Error });
21
- export function flattenError(error, mapper = (issue) => issue.message) {
22
- const fieldErrors = {};
23
- const formErrors = [];
24
- for (const sub of error.issues) {
25
- if (sub.path.length > 0) {
26
- fieldErrors[sub.path[0]] = fieldErrors[sub.path[0]] || [];
27
- fieldErrors[sub.path[0]].push(mapper(sub));
28
- }
29
- else {
30
- formErrors.push(mapper(sub));
31
- }
32
- }
33
- return { formErrors, fieldErrors };
34
- }
35
- export function formatError(error, mapper = (issue) => issue.message) {
36
- const fieldErrors = { _errors: [] };
37
- const processError = (error, path = []) => {
38
- for (const issue of error.issues) {
39
- if (issue.code === "invalid_union" && issue.errors.length) {
40
- issue.errors.map((issues) => processError({ issues }, [...path, ...issue.path]));
41
- }
42
- else if (issue.code === "invalid_key") {
43
- processError({ issues: issue.issues }, [...path, ...issue.path]);
44
- }
45
- else if (issue.code === "invalid_element") {
46
- processError({ issues: issue.issues }, [...path, ...issue.path]);
47
- }
48
- else {
49
- const fullpath = [...path, ...issue.path];
50
- if (fullpath.length === 0) {
51
- fieldErrors._errors.push(mapper(issue));
52
- }
53
- else {
54
- let curr = fieldErrors;
55
- let i = 0;
56
- while (i < fullpath.length) {
57
- const el = fullpath[i];
58
- const terminal = i === fullpath.length - 1;
59
- if (!terminal) {
60
- curr[el] = curr[el] || { _errors: [] };
61
- }
62
- else {
63
- curr[el] = curr[el] || { _errors: [] };
64
- curr[el]._errors.push(mapper(issue));
65
- }
66
- curr = curr[el];
67
- i++;
68
- }
69
- }
70
- }
71
- }
72
- };
73
- processError(error);
74
- return fieldErrors;
75
- }
76
- export function treeifyError(error, mapper = (issue) => issue.message) {
77
- const result = { errors: [] };
78
- const processError = (error, path = []) => {
79
- var _a, _b;
80
- for (const issue of error.issues) {
81
- if (issue.code === "invalid_union" && issue.errors.length) {
82
- // regular union error
83
- issue.errors.map((issues) => processError({ issues }, [...path, ...issue.path]));
84
- }
85
- else if (issue.code === "invalid_key") {
86
- processError({ issues: issue.issues }, [...path, ...issue.path]);
87
- }
88
- else if (issue.code === "invalid_element") {
89
- processError({ issues: issue.issues }, [...path, ...issue.path]);
90
- }
91
- else {
92
- const fullpath = [...path, ...issue.path];
93
- if (fullpath.length === 0) {
94
- result.errors.push(mapper(issue));
95
- continue;
96
- }
97
- let curr = result;
98
- let i = 0;
99
- while (i < fullpath.length) {
100
- const el = fullpath[i];
101
- const terminal = i === fullpath.length - 1;
102
- if (typeof el === "string") {
103
- curr.properties ?? (curr.properties = {});
104
- (_a = curr.properties)[el] ?? (_a[el] = { errors: [] });
105
- curr = curr.properties[el];
106
- }
107
- else {
108
- curr.items ?? (curr.items = []);
109
- (_b = curr.items)[el] ?? (_b[el] = { errors: [] });
110
- curr = curr.items[el];
111
- }
112
- if (terminal) {
113
- curr.errors.push(mapper(issue));
114
- }
115
- i++;
116
- }
117
- }
118
- }
119
- };
120
- processError(error);
121
- return result;
122
- }
123
- /** Format a ZodError as a human-readable string in the following form.
124
- *
125
- * From
126
- *
127
- * ```ts
128
- * ZodError {
129
- * issues: [
130
- * {
131
- * expected: 'string',
132
- * code: 'invalid_type',
133
- * path: [ 'username' ],
134
- * message: 'Invalid input: expected string'
135
- * },
136
- * {
137
- * expected: 'number',
138
- * code: 'invalid_type',
139
- * path: [ 'favoriteNumbers', 1 ],
140
- * message: 'Invalid input: expected number'
141
- * }
142
- * ];
143
- * }
144
- * ```
145
- *
146
- * to
147
- *
148
- * ```
149
- * username
150
- * ✖ Expected number, received string at "username
151
- * favoriteNumbers[0]
152
- * ✖ Invalid input: expected number
153
- * ```
154
- */
155
- export function toDotPath(_path) {
156
- const segs = [];
157
- const path = _path.map((seg) => (typeof seg === "object" ? seg.key : seg));
158
- for (const seg of path) {
159
- if (typeof seg === "number")
160
- segs.push(`[${seg}]`);
161
- else if (typeof seg === "symbol")
162
- segs.push(`[${JSON.stringify(String(seg))}]`);
163
- else if (/[^\w$]/.test(seg))
164
- segs.push(`[${JSON.stringify(seg)}]`);
165
- else {
166
- if (segs.length)
167
- segs.push(".");
168
- segs.push(seg);
169
- }
170
- }
171
- return segs.join("");
172
- }
173
- export function prettifyError(error) {
174
- const lines = [];
175
- // sort by path length
176
- const issues = [...error.issues].sort((a, b) => (a.path ?? []).length - (b.path ?? []).length);
177
- // Process each issue
178
- for (const issue of issues) {
179
- lines.push(`✖ ${issue.message}`);
180
- if (issue.path?.length)
181
- lines.push(` → at ${toDotPath(issue.path)}`);
182
- }
183
- // Convert Map to formatted string
184
- return lines.join("\n");
185
- }
@@ -1,16 +0,0 @@
1
- export * from "./core.js";
2
- export * from "./parse.js";
3
- export * from "./errors.js";
4
- export * from "./schemas.js";
5
- export * from "./checks.js";
6
- export * from "./versions.js";
7
- export * as util from "./util.js";
8
- export * as regexes from "./regexes.js";
9
- export * as locales from "../locales/index.js";
10
- export * from "./registries.js";
11
- export * from "./doc.js";
12
- export * from "./api.js";
13
- export * from "./to-json-schema.js";
14
- export { toJSONSchema } from "./json-schema-processors.js";
15
- export { JSONSchemaGenerator } from "./json-schema-generator.js";
16
- export * as JSONSchema from "./json-schema.js";
@@ -1,95 +0,0 @@
1
- import { allProcessors } from "./json-schema-processors.js";
2
- import { extractDefs, finalize, initializeContext, process, } from "./to-json-schema.js";
3
- /**
4
- * Legacy class-based interface for JSON Schema generation.
5
- * This class wraps the new functional implementation to provide backward compatibility.
6
- *
7
- * @deprecated Use the `toJSONSchema` function instead for new code.
8
- *
9
- * @example
10
- * ```typescript
11
- * // Legacy usage (still supported)
12
- * const gen = new JSONSchemaGenerator({ target: "draft-07" });
13
- * gen.process(schema);
14
- * const result = gen.emit(schema);
15
- *
16
- * // Preferred modern usage
17
- * const result = toJSONSchema(schema, { target: "draft-07" });
18
- * ```
19
- */
20
- export class JSONSchemaGenerator {
21
- /** @deprecated Access via ctx instead */
22
- get metadataRegistry() {
23
- return this.ctx.metadataRegistry;
24
- }
25
- /** @deprecated Access via ctx instead */
26
- get target() {
27
- return this.ctx.target;
28
- }
29
- /** @deprecated Access via ctx instead */
30
- get unrepresentable() {
31
- return this.ctx.unrepresentable;
32
- }
33
- /** @deprecated Access via ctx instead */
34
- get override() {
35
- return this.ctx.override;
36
- }
37
- /** @deprecated Access via ctx instead */
38
- get io() {
39
- return this.ctx.io;
40
- }
41
- /** @deprecated Access via ctx instead */
42
- get counter() {
43
- return this.ctx.counter;
44
- }
45
- set counter(value) {
46
- this.ctx.counter = value;
47
- }
48
- /** @deprecated Access via ctx instead */
49
- get seen() {
50
- return this.ctx.seen;
51
- }
52
- constructor(params) {
53
- // Normalize target for internal context
54
- let normalizedTarget = params?.target ?? "draft-2020-12";
55
- if (normalizedTarget === "draft-4")
56
- normalizedTarget = "draft-04";
57
- if (normalizedTarget === "draft-7")
58
- normalizedTarget = "draft-07";
59
- this.ctx = initializeContext({
60
- processors: allProcessors,
61
- target: normalizedTarget,
62
- ...(params?.metadata && { metadata: params.metadata }),
63
- ...(params?.unrepresentable && { unrepresentable: params.unrepresentable }),
64
- ...(params?.override && { override: params.override }),
65
- ...(params?.io && { io: params.io }),
66
- });
67
- }
68
- /**
69
- * Process a schema to prepare it for JSON Schema generation.
70
- * This must be called before emit().
71
- */
72
- process(schema, _params = { path: [], schemaPath: [] }) {
73
- return process(schema, this.ctx, _params);
74
- }
75
- /**
76
- * Emit the final JSON Schema after processing.
77
- * Must call process() first.
78
- */
79
- emit(schema, _params) {
80
- // Apply emit params to the context
81
- if (_params) {
82
- if (_params.cycles)
83
- this.ctx.cycles = _params.cycles;
84
- if (_params.reused)
85
- this.ctx.reused = _params.reused;
86
- if (_params.external)
87
- this.ctx.external = _params.external;
88
- }
89
- extractDefs(this.ctx, schema);
90
- const result = finalize(this.ctx, schema);
91
- // Strip ~standard property to match old implementation's return type
92
- const { "~standard": _, ...plainResult } = result;
93
- return plainResult;
94
- }
95
- }