flavor-code 1.2.8 → 1.2.9

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 (39) hide show
  1. package/README.md +35 -0
  2. package/README.zh-CN.md +36 -6
  3. package/dist/agent/loop.d.ts +4 -0
  4. package/dist/agent/types.d.ts +10 -0
  5. package/dist/{app-NL2O75LQ.js → app-USAFQVSX.js} +379 -12
  6. package/dist/{chunk-NVLYFU6P.js → chunk-F2HMO5Q2.js} +28 -11
  7. package/dist/{chunk-6X5PHLZI.js → chunk-G32MCAZA.js} +1 -1
  8. package/dist/{chunk-N2S7USST.js → chunk-RQTYHUMK.js} +2 -1
  9. package/dist/{chunk-ED4R7ZCP.js → chunk-WGYNTR4Q.js} +1820 -492
  10. package/dist/{chunk-MBLAXTUP.js → chunk-XFCJXRJ2.js} +15 -5
  11. package/dist/{claude-ink-WPWPEL5A.js → claude-ink-ORUA7GWG.js} +2 -2
  12. package/dist/cli.js +9 -8
  13. package/dist/config/protected-file.d.ts +6 -0
  14. package/dist/context/manager.d.ts +2 -0
  15. package/dist/context/workspace-instructions.d.ts +10 -0
  16. package/dist/desktop/main.js +12725 -5181
  17. package/dist/desktop/pixel-worker.js +73 -0
  18. package/dist/desktop/preload.cjs +80 -2
  19. package/dist/desktop-renderer/assets/index-D-s27J39.js +151 -0
  20. package/dist/desktop-renderer/assets/index-DMZBSGrp.css +1 -0
  21. package/dist/desktop-renderer/index.html +3 -4
  22. package/dist/harness/local.d.ts +4 -1
  23. package/dist/jobs/registry.d.ts +48 -0
  24. package/dist/{load-RN3WBX4C.js → load-6ZMEBHSG.js} +1 -1
  25. package/dist/permissions/engine.d.ts +7 -0
  26. package/dist/production.d.ts +13 -1
  27. package/dist/sdk/index.js +4 -4
  28. package/dist/terminal/service.d.ts +57 -0
  29. package/dist/tools/files.d.ts +10 -0
  30. package/dist/tools/jobs.d.ts +4 -0
  31. package/dist/tools/runtime.d.ts +2 -0
  32. package/dist/tools/shell.d.ts +13 -3
  33. package/dist/tools/terminal.d.ts +3 -0
  34. package/dist/tools/types.d.ts +76 -4
  35. package/dist/tools/web.d.ts +53 -0
  36. package/package.json +13 -2
  37. package//346/212/200/346/234/257/346/226/271/346/241/210/346/212/245/345/221/212.md +752 -1
  38. package/dist/desktop-renderer/assets/index-57tXtXhI.js +0 -143
  39. package/dist/desktop-renderer/assets/index-Cm_ktmXm.css +0 -1
@@ -152,11 +152,12 @@ var FlavorConfigSchema = z.object({
152
152
 
153
153
  // src/config/protected-file.ts
154
154
  import { randomUUID } from "crypto";
155
- import { mkdir, open, readFile, rename, rm, stat } from "fs/promises";
155
+ import { copyFile, mkdir, open, readFile, rename, rm, stat, unlink } from "fs/promises";
156
156
  import { dirname } from "path";
157
157
  var LOCK_WAIT_MS = 20;
158
158
  var LOCK_TIMEOUT_MS = 2e3;
159
159
  var STALE_LOCK_MS = 3e4;
160
+ var defaultFileOperations = { rename, copyFile, unlink };
160
161
  async function readRecoverableFile(path, decode) {
161
162
  let primaryError;
162
163
  try {
@@ -183,9 +184,9 @@ async function updateProtectedFile(options) {
183
184
  const next = await options.update(current?.value);
184
185
  if (current !== void 0) {
185
186
  const backup = options.backupEncode === void 0 ? await options.encode(current.value) : await options.backupEncode(current.value);
186
- await writeAtomic(`${options.path}.bak`, backup);
187
+ await writeAtomic(`${options.path}.bak`, backup, options.fileOperations ?? defaultFileOperations);
187
188
  }
188
- await writeAtomic(options.path, await options.encode(next));
189
+ await writeAtomic(options.path, await options.encode(next), options.fileOperations ?? defaultFileOperations);
189
190
  return next;
190
191
  }, options.lockTimeoutMs ?? LOCK_TIMEOUT_MS, options.staleLockMs ?? STALE_LOCK_MS);
191
192
  }
@@ -259,7 +260,7 @@ function isProcessAlive(pid) {
259
260
  return isCode(error, "EPERM");
260
261
  }
261
262
  }
262
- async function writeAtomic(path, content) {
263
+ async function writeAtomic(path, content, operations) {
263
264
  const temporary = `${path}.${process.pid}.${randomUUID()}.tmp`;
264
265
  let handle;
265
266
  try {
@@ -268,12 +269,21 @@ async function writeAtomic(path, content) {
268
269
  await handle.sync();
269
270
  await handle.close();
270
271
  handle = void 0;
271
- await rename(temporary, path);
272
+ try {
273
+ await operations.rename(temporary, path);
274
+ } catch (error) {
275
+ if (!isWindowsSharingError(error)) throw error;
276
+ await operations.copyFile(temporary, path);
277
+ await operations.unlink(temporary).catch(() => void 0);
278
+ }
272
279
  } finally {
273
280
  await handle?.close().catch(() => void 0);
274
281
  await rm(temporary, { force: true }).catch(() => void 0);
275
282
  }
276
283
  }
284
+ function isWindowsSharingError(error) {
285
+ return typeof error === "object" && error !== null && "code" in error && ["EPERM", "EACCES", "EBUSY", "EEXIST"].includes(String(error.code));
286
+ }
277
287
  function delay(ms) {
278
288
  return new Promise((resolvePromise) => setTimeout(resolvePromise, ms));
279
289
  }
@@ -10,8 +10,8 @@ import {
10
10
  useStdout,
11
11
  use_app_default,
12
12
  use_input_default
13
- } from "./chunk-NVLYFU6P.js";
14
- import "./chunk-N2S7USST.js";
13
+ } from "./chunk-F2HMO5Q2.js";
14
+ import "./chunk-RQTYHUMK.js";
15
15
  import "./chunk-S32JRDZK.js";
16
16
  export {
17
17
  AlternateScreen,
package/dist/cli.js CHANGED
@@ -3,7 +3,7 @@ import { createRequire } from "node:module"; const require = createRequire(impor
3
3
  import {
4
4
  FlavorRpcServer,
5
5
  TraceRecorder
6
- } from "./chunk-6X5PHLZI.js";
6
+ } from "./chunk-G32MCAZA.js";
7
7
  import {
8
8
  staticTaskLines
9
9
  } from "./chunk-KKIBYDJI.js";
@@ -20,7 +20,7 @@ import {
20
20
  message,
21
21
  packageVersion,
22
22
  redactErrorText
23
- } from "./chunk-ED4R7ZCP.js";
23
+ } from "./chunk-WGYNTR4Q.js";
24
24
  import {
25
25
  McpServerConfigSchema,
26
26
  McpServerNameSchema,
@@ -29,8 +29,8 @@ import {
29
29
  readRecoverableFile,
30
30
  setProjectSkillDisabled,
31
31
  updateProtectedFile
32
- } from "./chunk-MBLAXTUP.js";
33
- import "./chunk-N2S7USST.js";
32
+ } from "./chunk-XFCJXRJ2.js";
33
+ import "./chunk-RQTYHUMK.js";
34
34
  import "./chunk-S32JRDZK.js";
35
35
 
36
36
  // src/cli.tsx
@@ -601,6 +601,7 @@ var EvaluationSpecSchema = z.object({
601
601
  }).strict();
602
602
 
603
603
  // src/eval/runner.ts
604
+ var DEFAULT_VERIFICATION_TIMEOUT_MS = 10 * 6e4;
604
605
  async function runEvaluation(spec, dependencies) {
605
606
  const now = dependencies.now ?? Date.now;
606
607
  const started = now();
@@ -631,7 +632,7 @@ async function runEvaluation(spec, dependencies) {
631
632
  command: check.command,
632
633
  args: check.args,
633
634
  cwd: spec.workspace,
634
- ...check.timeoutMs === void 0 ? {} : { timeoutMs: check.timeoutMs }
635
+ timeoutMs: check.timeoutMs ?? DEFAULT_VERIFICATION_TIMEOUT_MS
635
636
  });
636
637
  verification.push({
637
638
  command: [check.command, ...check.args].join(" "),
@@ -669,7 +670,7 @@ async function runEvaluationFile(path, outputPath) {
669
670
  })),
670
671
  ...parsed.maxTokens === void 0 ? {} : { maxTokens: parsed.maxTokens }
671
672
  };
672
- const configured = await import("./load-RN3WBX4C.js").then(({ loadConfig: loadConfig2 }) => loadConfig2({ cwd: workspace, home: process.env.USERPROFILE ?? process.env.HOME ?? workspace }));
673
+ const configured = await import("./load-6ZMEBHSG.js").then(({ loadConfig: loadConfig2 }) => loadConfig2({ cwd: workspace, home: process.env.USERPROFILE ?? process.env.HOME ?? workspace }));
673
674
  const environment = createExecutionEnvironment(workspace, configured.config.execution) ?? new LocalExecutionEnvironment();
674
675
  let report;
675
676
  try {
@@ -769,9 +770,9 @@ function createProgram() {
769
770
  }
770
771
  setInteractiveProcessTitle();
771
772
  const [{ render, AlternateScreen }, { createElement }, { App }] = await Promise.all([
772
- import("./claude-ink-WPWPEL5A.js"),
773
+ import("./claude-ink-ORUA7GWG.js"),
773
774
  import("react"),
774
- import("./app-NL2O75LQ.js")
775
+ import("./app-USAFQVSX.js")
775
776
  ]);
776
777
  const instance = await render(createElement(
777
778
  AlternateScreen,
@@ -10,6 +10,12 @@ export interface ProtectedFileUpdate<T> {
10
10
  backupEncode?(current: T): string | Promise<string>;
11
11
  lockTimeoutMs?: number;
12
12
  staleLockMs?: number;
13
+ fileOperations?: ProtectedFileOperations;
14
+ }
15
+ export interface ProtectedFileOperations {
16
+ rename(source: string, target: string): Promise<void>;
17
+ copyFile(source: string, target: string): Promise<void>;
18
+ unlink(path: string): Promise<void>;
13
19
  }
14
20
  export declare function readRecoverableFile<T>(path: string, decode: (raw: string) => T | Promise<T>): Promise<RecoverableFile<T> | undefined>;
15
21
  export declare function updateProtectedFile<T>(options: ProtectedFileUpdate<T>): Promise<T>;
@@ -6,6 +6,8 @@ export interface ContextManagerOptions {
6
6
  /** Dynamic system suffix excluded from the stable prompt-cache prefix. */
7
7
  volatileSystem?: SystemPromptSource;
8
8
  flavor?: string;
9
+ /** Root AGENTS.md/CLAUDE.md guidance, separate from FLAVOR.md attribution. */
10
+ workspaceInstructions?: string;
9
11
  memory?: string;
10
12
  taskState?: string;
11
13
  /** Stable user preferences, emitted as the final system section for prompt caching. */
@@ -0,0 +1,10 @@
1
+ export interface WorkspaceInstructionOptions {
2
+ maxFileBytes?: number;
3
+ maxTotalBytes?: number;
4
+ }
5
+ export declare class WorkspaceInstructions {
6
+ #private;
7
+ constructor(workspace: string, options?: WorkspaceInstructionOptions);
8
+ baseline(scope?: string): Promise<string>;
9
+ discover(paths: readonly string[], scope?: string): Promise<string[]>;
10
+ }