flavor-code 1.4.0-beta.3 → 1.4.0-beta.4

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 (33) hide show
  1. package/dist/agent/loop.d.ts +4 -2
  2. package/dist/{app-H7RYDMD3.js → app-UWIEIWBQ.js} +3 -3
  3. package/dist/{chunk-3BHKW5A7.js → chunk-4RR5VVX4.js} +8 -2
  4. package/dist/{chunk-NIKCPCJG.js → chunk-DCNUBQCH.js} +826 -273
  5. package/dist/{chunk-KBHWS7M6.js → chunk-KQMKY7C5.js} +4 -0
  6. package/dist/chunk-LKQTBL3R.js +107 -0
  7. package/dist/cli-main.js +20 -13
  8. package/dist/cli.js +24 -5
  9. package/dist/config/schema.d.ts +4 -0
  10. package/dist/context/manager.d.ts +9 -0
  11. package/dist/desktop/main.js +1170 -532
  12. package/dist/desktop-renderer/assets/{index-CYd5JkTR.js → index-C0t1nGih.js} +2 -2
  13. package/dist/desktop-renderer/assets/{interactive-terminal-j52Ty3QO.js → interactive-terminal-BJqe96mZ.js} +1 -1
  14. package/dist/desktop-renderer/index.html +1 -1
  15. package/dist/goal/classifier.d.ts +2 -0
  16. package/dist/goal/orchestrator.d.ts +18 -0
  17. package/dist/goal/planner.d.ts +2 -0
  18. package/dist/goal/store.d.ts +2 -0
  19. package/dist/goal/types.d.ts +8 -0
  20. package/dist/harness/journal.d.ts +2 -0
  21. package/dist/jobs/registry.d.ts +6 -0
  22. package/dist/{load-SLSL3IWR.js → load-F4AYLCF6.js} +1 -1
  23. package/dist/loop/orchestrator.d.ts +18 -0
  24. package/dist/loop/types.d.ts +7 -0
  25. package/dist/production.d.ts +17 -0
  26. package/dist/sdk/index.js +4 -4
  27. package/dist/session/tree.d.ts +2 -0
  28. package/dist/ui/session.d.ts +9 -0
  29. package/dist/utils/heap.d.ts +58 -0
  30. package/dist/utils/memory-restart.d.ts +38 -3
  31. package/dist/utils/rotation-census.d.ts +36 -0
  32. package/package.json +1 -1
  33. package/dist/chunk-CIVPKHF4.js +0 -53
@@ -2,6 +2,7 @@ import type { ContextManager } from "../context/manager.js";
2
2
  import type { HallucinationGuard } from "../hallucination/guard.js";
3
3
  import type { HookBus } from "../hooks/bus.js";
4
4
  import type { ModelRegistry } from "../models/registry.js";
5
+ import { MEMORY_PRESSURE_HEAP_RATIO } from "../utils/heap.js";
5
6
  import { type ModelMessage, type ModelTool } from "../models/types.js";
6
7
  import type { ToolRuntime } from "../tools/runtime.js";
7
8
  import type { AgentError, AgentEvent, AgentRunRequest } from "./types.js";
@@ -10,9 +11,10 @@ import type { AgentError, AgentEvent, AgentRunRequest } from "./types.js";
10
11
  * leak otherwise ends in a native OOM crash with no recovery; tripping this
11
12
  * watermark saves the session and lets the launcher relaunch on a fresh heap.
12
13
  * 0.8 keeps headroom for compaction payloads and the GC death spiral that
13
- * starts near ~0.95.
14
+ * starts near ~0.95. The reading is GC-verified: uncollected garbage alone
15
+ * must not stop a turn.
14
16
  */
15
- export declare const MEMORY_PRESSURE_HEAP_RATIO = 0.8;
17
+ export { MEMORY_PRESSURE_HEAP_RATIO };
16
18
  export declare function memoryPressureError(heapUsed: number, heapLimit: number): AgentError | undefined;
17
19
  export interface AgentLoopOptions {
18
20
  registry: ModelRegistry;
@@ -19,9 +19,9 @@ import {
19
19
  thinkingWindow,
20
20
  transcriptReducer,
21
21
  withTimeout
22
- } from "./chunk-NIKCPCJG.js";
23
- import "./chunk-CIVPKHF4.js";
24
- import "./chunk-KBHWS7M6.js";
22
+ } from "./chunk-DCNUBQCH.js";
23
+ import "./chunk-LKQTBL3R.js";
24
+ import "./chunk-KQMKY7C5.js";
25
25
  import {
26
26
  Box_default,
27
27
  ClockContext,
@@ -4,7 +4,7 @@ import {
4
4
  message,
5
5
  redactErrorText,
6
6
  redactSecrets
7
- } from "./chunk-NIKCPCJG.js";
7
+ } from "./chunk-DCNUBQCH.js";
8
8
 
9
9
  // src/rpc/server.ts
10
10
  import { createInterface } from "readline";
@@ -44,7 +44,13 @@ var FlavorRpcServer = class {
44
44
  this.#runtime = await this.#options.createRuntime({
45
45
  workspace: this.#options.workspace,
46
46
  output: (event) => {
47
- void this.#emit({ type: "event", sessionId: this.#runtime?.sessionId, event }, "output");
47
+ const emitted = this.#emit({ type: "event", sessionId: this.#runtime?.sessionId, event }, "output");
48
+ if (event.type === "exit") {
49
+ void emitted.finally(() => {
50
+ this.#closing = true;
51
+ this.#lines?.close();
52
+ });
53
+ }
48
54
  }
49
55
  });
50
56
  await this.#runtime.session.start();