flavor-code 1.2.16 → 1.2.17
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/dist/agent/types.d.ts +1 -1
- package/dist/{app-7ZCJ3UOI.js → app-F4P7RV2X.js} +1 -1
- package/dist/{chunk-5SRARNAC.js → chunk-QQCXJC4U.js} +17 -10
- package/dist/{chunk-PGS3M32Y.js → chunk-YRIPE5K5.js} +1 -1
- package/dist/cli.js +3 -3
- package/dist/desktop/main.js +17 -10
- package/dist/sdk/index.js +2 -2
- package/package.json +1 -1
package/dist/agent/types.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ export interface AgentRunRequest {
|
|
|
15
15
|
/** Messages supplied while a tool batch is running, injected before the next model call. */
|
|
16
16
|
getSteeringMessages?(): readonly string[];
|
|
17
17
|
}
|
|
18
|
-
export type AgentErrorCode = ProviderErrorCode | "iteration_limit" | "incomplete_stream";
|
|
18
|
+
export type AgentErrorCode = ProviderErrorCode | "iteration_limit" | "incomplete_stream" | "empty_response";
|
|
19
19
|
export interface AgentError {
|
|
20
20
|
code: AgentErrorCode;
|
|
21
21
|
message: string;
|
|
@@ -6539,7 +6539,8 @@ var RECOVERABLE_MODEL_ERRORS = /* @__PURE__ */ new Set([
|
|
|
6539
6539
|
"network",
|
|
6540
6540
|
"rate_limit",
|
|
6541
6541
|
"unknown",
|
|
6542
|
-
"incomplete_stream"
|
|
6542
|
+
"incomplete_stream",
|
|
6543
|
+
"empty_response"
|
|
6543
6544
|
]);
|
|
6544
6545
|
function envMaxIterations() {
|
|
6545
6546
|
const raw = process.env["FLAVOR_MAX_ITERATIONS"];
|
|
@@ -6733,6 +6734,12 @@ var AgentLoop = class {
|
|
|
6733
6734
|
} finally {
|
|
6734
6735
|
if (!completed && terminalError === void 0) {
|
|
6735
6736
|
terminalError = { code: "incomplete_stream", message: "Provider stream ended without a done or error event" };
|
|
6737
|
+
} else if (completed && assistantText.trim().length === 0 && collectedToolCalls.length === 0) {
|
|
6738
|
+
completed = false;
|
|
6739
|
+
terminalError = {
|
|
6740
|
+
code: "empty_response",
|
|
6741
|
+
message: "Provider completed without visible text or tool calls"
|
|
6742
|
+
};
|
|
6736
6743
|
}
|
|
6737
6744
|
providerError = terminalError !== void 0;
|
|
6738
6745
|
try {
|
|
@@ -6772,7 +6779,7 @@ var AgentLoop = class {
|
|
|
6772
6779
|
totalCacheCreationTokens += usage.cacheCreationTokens ?? 0;
|
|
6773
6780
|
yield { type: "usage", ...usage, totalInputTokens, totalOutputTokens };
|
|
6774
6781
|
}
|
|
6775
|
-
const providerProducedOutput = assistantText.length > 0 || collectedToolCalls.length > 0;
|
|
6782
|
+
const providerProducedOutput = assistantText.trim().length > 0 || collectedToolCalls.length > 0;
|
|
6776
6783
|
if (terminalError?.code === "context_overflow" && !reactiveRetried && !providerProducedOutput && attempt < maxAttempts) {
|
|
6777
6784
|
let compacted = false;
|
|
6778
6785
|
try {
|
|
@@ -19755,7 +19762,7 @@ async function createProductionRuntime(options) {
|
|
|
19755
19762
|
const messages = allMessages.slice(memoryLifecycle.messageStart ?? 0);
|
|
19756
19763
|
const transcriptHash = memoryTranscriptHash(messages);
|
|
19757
19764
|
if (memoryLifecycle.status === "completed" && memoryLifecycle.transcriptHash === transcriptHash) {
|
|
19758
|
-
return "
|
|
19765
|
+
return "This conversation segment was already evaluated for long-term memory.";
|
|
19759
19766
|
}
|
|
19760
19767
|
if (!manual && memoryBehavior.autoExtractPaused) {
|
|
19761
19768
|
return "Automatic long-term-memory extraction is paused after repeated dismissals; use /finish, /remember, or an explicit \u201Cremember\u201D request to store memory manually.";
|
|
@@ -19763,7 +19770,7 @@ async function createProductionRuntime(options) {
|
|
|
19763
19770
|
autoStoredContents.length = 0;
|
|
19764
19771
|
const finalization = memoryCoordinator === void 0 || !config.memory.autoExtract || options.approvalPolicy === "deny" ? { evaluated: true, candidates: false, stored: 0 } : await memoryCoordinator.finalize(memoryLifecycle.taskId ?? sessionId, messages);
|
|
19765
19772
|
if (!finalization.evaluated) {
|
|
19766
|
-
return "
|
|
19773
|
+
return "Long-term-memory evaluation failed; retry /finish after checking diagnostics.";
|
|
19767
19774
|
}
|
|
19768
19775
|
memoryLifecycle = {
|
|
19769
19776
|
status: "completed",
|
|
@@ -19775,9 +19782,9 @@ async function createProductionRuntime(options) {
|
|
|
19775
19782
|
await persist();
|
|
19776
19783
|
if (finalization.candidates && finalization.stored > 0) {
|
|
19777
19784
|
const storedText = autoStoredContents[0] ?? "a high-confidence memory";
|
|
19778
|
-
return `
|
|
19785
|
+
return `Long-term memory updated. Stored high-confidence entry: "${storedText}". Run /forget to remove it if undesired.`;
|
|
19779
19786
|
}
|
|
19780
|
-
return finalization.candidates ? "
|
|
19787
|
+
return finalization.candidates ? "Long-term-memory evaluation completed. Review the generated candidates before anything is stored." : "Long-term-memory evaluation completed; no durable candidates passed the threshold.";
|
|
19781
19788
|
};
|
|
19782
19789
|
let explicitMemoryRequest;
|
|
19783
19790
|
let automaticMemoryTask = false;
|
|
@@ -19788,10 +19795,10 @@ async function createProductionRuntime(options) {
|
|
|
19788
19795
|
timelineState = transcriptReducer(timelineState, { type: "submit", prompt });
|
|
19789
19796
|
automaticMemoryTask = !prompt.startsWith("/") && harness.permissionProfile !== "d2c";
|
|
19790
19797
|
if (automaticMemoryTask) memoryReviews.dismissAll();
|
|
19791
|
-
if (!prompt.startsWith("/")
|
|
19798
|
+
if (!prompt.startsWith("/")) {
|
|
19792
19799
|
memoryLifecycle = {
|
|
19793
19800
|
status: "active",
|
|
19794
|
-
taskId: createMemoryTaskId(),
|
|
19801
|
+
taskId: memoryLifecycle.status === "completed" ? createMemoryTaskId() : memoryLifecycle.taskId ?? createMemoryTaskId(),
|
|
19795
19802
|
messageStart: harness.main.context.snapshot().messages.length
|
|
19796
19803
|
};
|
|
19797
19804
|
}
|
|
@@ -19833,9 +19840,9 @@ async function createProductionRuntime(options) {
|
|
|
19833
19840
|
}
|
|
19834
19841
|
if (explicit === void 0 && automatic && event.payload.outcome === "completed" && memoryCoordinator !== void 0 && config.memory.autoExtract && options.approvalPolicy !== "deny" && !memoryBehavior.autoExtractPaused) {
|
|
19835
19842
|
const result = await finalizeMemoryTask();
|
|
19836
|
-
if (result.startsWith("
|
|
19843
|
+
if (result.startsWith("Long-term-memory evaluation failed")) {
|
|
19837
19844
|
emitOutput({ type: "notice", message: "Automatic long-term-memory evaluation failed; use /finish to retry after checking diagnostics." });
|
|
19838
|
-
} else if (result.startsWith("
|
|
19845
|
+
} else if (result.startsWith("Long-term-memory evaluation completed. Review") || result.startsWith("Long-term memory updated.")) {
|
|
19839
19846
|
emitOutput({ type: "notice", message: result });
|
|
19840
19847
|
}
|
|
19841
19848
|
}
|
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-
|
|
6
|
+
} from "./chunk-YRIPE5K5.js";
|
|
7
7
|
import {
|
|
8
8
|
staticTaskLines
|
|
9
9
|
} from "./chunk-KKIBYDJI.js";
|
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
packageVersion,
|
|
23
23
|
redactErrorText,
|
|
24
24
|
runPalBroker
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-QQCXJC4U.js";
|
|
26
26
|
import {
|
|
27
27
|
McpServerConfigSchema,
|
|
28
28
|
McpServerNameSchema,
|
|
@@ -861,7 +861,7 @@ async function runInteractiveCli(props) {
|
|
|
861
861
|
const [{ render, AlternateScreen }, { createElement }, { App }] = await Promise.all([
|
|
862
862
|
import("./claude-ink-ORUA7GWG.js"),
|
|
863
863
|
import("react"),
|
|
864
|
-
import("./app-
|
|
864
|
+
import("./app-F4P7RV2X.js")
|
|
865
865
|
]);
|
|
866
866
|
const instance = await render(createElement(
|
|
867
867
|
AlternateScreen,
|
package/dist/desktop/main.js
CHANGED
|
@@ -6128,7 +6128,8 @@ var RECOVERABLE_MODEL_ERRORS = /* @__PURE__ */ new Set([
|
|
|
6128
6128
|
"network",
|
|
6129
6129
|
"rate_limit",
|
|
6130
6130
|
"unknown",
|
|
6131
|
-
"incomplete_stream"
|
|
6131
|
+
"incomplete_stream",
|
|
6132
|
+
"empty_response"
|
|
6132
6133
|
]);
|
|
6133
6134
|
function envMaxIterations() {
|
|
6134
6135
|
const raw = process.env["FLAVOR_MAX_ITERATIONS"];
|
|
@@ -6322,6 +6323,12 @@ var AgentLoop = class {
|
|
|
6322
6323
|
} finally {
|
|
6323
6324
|
if (!completed && terminalError === void 0) {
|
|
6324
6325
|
terminalError = { code: "incomplete_stream", message: "Provider stream ended without a done or error event" };
|
|
6326
|
+
} else if (completed && assistantText.trim().length === 0 && collectedToolCalls.length === 0) {
|
|
6327
|
+
completed = false;
|
|
6328
|
+
terminalError = {
|
|
6329
|
+
code: "empty_response",
|
|
6330
|
+
message: "Provider completed without visible text or tool calls"
|
|
6331
|
+
};
|
|
6325
6332
|
}
|
|
6326
6333
|
providerError = terminalError !== void 0;
|
|
6327
6334
|
try {
|
|
@@ -6361,7 +6368,7 @@ var AgentLoop = class {
|
|
|
6361
6368
|
totalCacheCreationTokens += usage.cacheCreationTokens ?? 0;
|
|
6362
6369
|
yield { type: "usage", ...usage, totalInputTokens, totalOutputTokens };
|
|
6363
6370
|
}
|
|
6364
|
-
const providerProducedOutput = assistantText.length > 0 || collectedToolCalls.length > 0;
|
|
6371
|
+
const providerProducedOutput = assistantText.trim().length > 0 || collectedToolCalls.length > 0;
|
|
6365
6372
|
if (terminalError?.code === "context_overflow" && !reactiveRetried && !providerProducedOutput && attempt < maxAttempts) {
|
|
6366
6373
|
let compacted = false;
|
|
6367
6374
|
try {
|
|
@@ -23458,7 +23465,7 @@ async function createProductionRuntime(options) {
|
|
|
23458
23465
|
const messages = allMessages.slice(memoryLifecycle.messageStart ?? 0);
|
|
23459
23466
|
const transcriptHash = memoryTranscriptHash(messages);
|
|
23460
23467
|
if (memoryLifecycle.status === "completed" && memoryLifecycle.transcriptHash === transcriptHash) {
|
|
23461
|
-
return "
|
|
23468
|
+
return "This conversation segment was already evaluated for long-term memory.";
|
|
23462
23469
|
}
|
|
23463
23470
|
if (!manual && memoryBehavior.autoExtractPaused) {
|
|
23464
23471
|
return "Automatic long-term-memory extraction is paused after repeated dismissals; use /finish, /remember, or an explicit \u201Cremember\u201D request to store memory manually.";
|
|
@@ -23466,7 +23473,7 @@ async function createProductionRuntime(options) {
|
|
|
23466
23473
|
autoStoredContents.length = 0;
|
|
23467
23474
|
const finalization = memoryCoordinator === void 0 || !config.memory.autoExtract || options.approvalPolicy === "deny" ? { evaluated: true, candidates: false, stored: 0 } : await memoryCoordinator.finalize(memoryLifecycle.taskId ?? sessionId, messages);
|
|
23468
23475
|
if (!finalization.evaluated) {
|
|
23469
|
-
return "
|
|
23476
|
+
return "Long-term-memory evaluation failed; retry /finish after checking diagnostics.";
|
|
23470
23477
|
}
|
|
23471
23478
|
memoryLifecycle = {
|
|
23472
23479
|
status: "completed",
|
|
@@ -23478,9 +23485,9 @@ async function createProductionRuntime(options) {
|
|
|
23478
23485
|
await persist();
|
|
23479
23486
|
if (finalization.candidates && finalization.stored > 0) {
|
|
23480
23487
|
const storedText = autoStoredContents[0] ?? "a high-confidence memory";
|
|
23481
|
-
return `
|
|
23488
|
+
return `Long-term memory updated. Stored high-confidence entry: "${storedText}". Run /forget to remove it if undesired.`;
|
|
23482
23489
|
}
|
|
23483
|
-
return finalization.candidates ? "
|
|
23490
|
+
return finalization.candidates ? "Long-term-memory evaluation completed. Review the generated candidates before anything is stored." : "Long-term-memory evaluation completed; no durable candidates passed the threshold.";
|
|
23484
23491
|
};
|
|
23485
23492
|
let explicitMemoryRequest;
|
|
23486
23493
|
let automaticMemoryTask = false;
|
|
@@ -23491,10 +23498,10 @@ async function createProductionRuntime(options) {
|
|
|
23491
23498
|
timelineState = transcriptReducer(timelineState, { type: "submit", prompt });
|
|
23492
23499
|
automaticMemoryTask = !prompt.startsWith("/") && harness.permissionProfile !== "d2c";
|
|
23493
23500
|
if (automaticMemoryTask) memoryReviews.dismissAll();
|
|
23494
|
-
if (!prompt.startsWith("/")
|
|
23501
|
+
if (!prompt.startsWith("/")) {
|
|
23495
23502
|
memoryLifecycle = {
|
|
23496
23503
|
status: "active",
|
|
23497
|
-
taskId: createMemoryTaskId(),
|
|
23504
|
+
taskId: memoryLifecycle.status === "completed" ? createMemoryTaskId() : memoryLifecycle.taskId ?? createMemoryTaskId(),
|
|
23498
23505
|
messageStart: harness.main.context.snapshot().messages.length
|
|
23499
23506
|
};
|
|
23500
23507
|
}
|
|
@@ -23536,9 +23543,9 @@ async function createProductionRuntime(options) {
|
|
|
23536
23543
|
}
|
|
23537
23544
|
if (explicit === void 0 && automatic && event.payload.outcome === "completed" && memoryCoordinator !== void 0 && config.memory.autoExtract && options.approvalPolicy !== "deny" && !memoryBehavior.autoExtractPaused) {
|
|
23538
23545
|
const result = await finalizeMemoryTask();
|
|
23539
|
-
if (result.startsWith("
|
|
23546
|
+
if (result.startsWith("Long-term-memory evaluation failed")) {
|
|
23540
23547
|
emitOutput({ type: "notice", message: "Automatic long-term-memory evaluation failed; use /finish to retry after checking diagnostics." });
|
|
23541
|
-
} else if (result.startsWith("
|
|
23548
|
+
} else if (result.startsWith("Long-term-memory evaluation completed. Review") || result.startsWith("Long-term memory updated.")) {
|
|
23542
23549
|
emitOutput({ type: "notice", message: result });
|
|
23543
23550
|
}
|
|
23544
23551
|
}
|
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-YRIPE5K5.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-QQCXJC4U.js";
|
|
17
17
|
import "../chunk-IG4Z23CL.js";
|
|
18
18
|
import "../chunk-RQTYHUMK.js";
|
|
19
19
|
import "../chunk-S32JRDZK.js";
|