@cydm/pie 2.6.3 → 2.6.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.
- package/dist/builtin/extensions/ask-user/index.js +3 -3
- package/dist/builtin/extensions/plan-mode/index.js +3 -3
- package/dist/builtin/extensions/subagent/index.js +4 -4
- package/dist/builtin/extensions/todo/index.js +3 -3
- package/dist/chunks/{chunk-WG6E54WK.js → chunk-3AOMWS2Z.js} +12 -4
- package/dist/chunks/{chunk-KTSUOXA7.js → chunk-6QEDYZUR.js} +1 -1
- package/dist/chunks/{chunk-O2DKMLNX.js → chunk-OCEYHWVX.js} +48 -0
- package/dist/chunks/{chunk-Y4CYXJR7.js → chunk-YEUBQBOB.js} +1 -1
- package/dist/chunks/{src-VCWCE7YV.js → src-XT5S6AUQ.js} +2 -2
- package/dist/chunks/{test-stream-GOSEWMJ3.js → test-stream-FNWDHRTM.js} +1 -1
- package/dist/cli.js +32 -18
- package/package.json +1 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { createRequire as __createRequire } from "node:module"; const require = __createRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
createAskUserCapability
|
|
4
|
-
} from "../../../chunks/chunk-
|
|
5
|
-
import "../../../chunks/chunk-
|
|
6
|
-
import "../../../chunks/chunk-
|
|
4
|
+
} from "../../../chunks/chunk-3AOMWS2Z.js";
|
|
5
|
+
import "../../../chunks/chunk-YEUBQBOB.js";
|
|
6
|
+
import "../../../chunks/chunk-OCEYHWVX.js";
|
|
7
7
|
import "../../../chunks/chunk-XXGYUYXI.js";
|
|
8
8
|
import "../../../chunks/chunk-LZQXQOPJ.js";
|
|
9
9
|
|
|
@@ -7,9 +7,9 @@ import {
|
|
|
7
7
|
isPlanModeSafeCommand,
|
|
8
8
|
markCompletedPlanSteps,
|
|
9
9
|
restoreExecutionState
|
|
10
|
-
} from "../../../chunks/chunk-
|
|
11
|
-
import "../../../chunks/chunk-
|
|
12
|
-
import "../../../chunks/chunk-
|
|
10
|
+
} from "../../../chunks/chunk-3AOMWS2Z.js";
|
|
11
|
+
import "../../../chunks/chunk-YEUBQBOB.js";
|
|
12
|
+
import "../../../chunks/chunk-OCEYHWVX.js";
|
|
13
13
|
import {
|
|
14
14
|
Type
|
|
15
15
|
} from "../../../chunks/chunk-XXGYUYXI.js";
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { createRequire as __createRequire } from "node:module"; const require = __createRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
createCliHostCapabilities
|
|
4
|
-
} from "../../../chunks/chunk-
|
|
4
|
+
} from "../../../chunks/chunk-6QEDYZUR.js";
|
|
5
5
|
import {
|
|
6
6
|
createSharedFileSystemTools,
|
|
7
7
|
createSubagentCapability
|
|
8
|
-
} from "../../../chunks/chunk-
|
|
9
|
-
import "../../../chunks/chunk-
|
|
10
|
-
import "../../../chunks/chunk-
|
|
8
|
+
} from "../../../chunks/chunk-3AOMWS2Z.js";
|
|
9
|
+
import "../../../chunks/chunk-YEUBQBOB.js";
|
|
10
|
+
import "../../../chunks/chunk-OCEYHWVX.js";
|
|
11
11
|
import "../../../chunks/chunk-5353DEEC.js";
|
|
12
12
|
import "../../../chunks/chunk-XXGYUYXI.js";
|
|
13
13
|
import "../../../chunks/chunk-LZQXQOPJ.js";
|
|
@@ -8,9 +8,9 @@ import {
|
|
|
8
8
|
executeManageTodoList,
|
|
9
9
|
executionStateToTodos,
|
|
10
10
|
restoreExecutionState
|
|
11
|
-
} from "../../../chunks/chunk-
|
|
12
|
-
import "../../../chunks/chunk-
|
|
13
|
-
import "../../../chunks/chunk-
|
|
11
|
+
} from "../../../chunks/chunk-3AOMWS2Z.js";
|
|
12
|
+
import "../../../chunks/chunk-YEUBQBOB.js";
|
|
13
|
+
import "../../../chunks/chunk-OCEYHWVX.js";
|
|
14
14
|
import "../../../chunks/chunk-XXGYUYXI.js";
|
|
15
15
|
import "../../../chunks/chunk-LZQXQOPJ.js";
|
|
16
16
|
|
|
@@ -2,7 +2,7 @@ import { createRequire as __createRequire } from "node:module"; const require =
|
|
|
2
2
|
import {
|
|
3
3
|
Agent,
|
|
4
4
|
getToolCallerIdentity
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-YEUBQBOB.js";
|
|
6
6
|
import {
|
|
7
7
|
FileSystemGateway,
|
|
8
8
|
completeSimple,
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
getPlatformConfig,
|
|
12
12
|
hashText,
|
|
13
13
|
streamSimple
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-OCEYHWVX.js";
|
|
15
15
|
import {
|
|
16
16
|
Type
|
|
17
17
|
} from "./chunk-XXGYUYXI.js";
|
|
@@ -3344,7 +3344,10 @@ var FileSessionStore = class {
|
|
|
3344
3344
|
const previous = head.metadata;
|
|
3345
3345
|
const merged = mergeMetadata(previous, {
|
|
3346
3346
|
...metadataPatch ?? {},
|
|
3347
|
-
|
|
3347
|
+
// Self-heal drifted counters: seqs are dense, so the committed
|
|
3348
|
+
// frontier is also a lower bound on the entry count. A stale
|
|
3349
|
+
// entryCount (concurrent-writer lost update) must not persist.
|
|
3350
|
+
entryCount: Math.max(previous.entryCount + newHeaders.length, seq),
|
|
3348
3351
|
messageCount: previous.messageCount + newHeaders.filter((header) => header.type === "message").length,
|
|
3349
3352
|
rootEntryId: metadataPatch?.rootEntryId ?? previous.rootEntryId ?? newHeaders.find((header) => header.parentSeq === null)?.id ?? null,
|
|
3350
3353
|
activeEntryId: activeEntryId ?? metadataPatch?.activeEntryId ?? newHeaders[newHeaders.length - 1]?.id ?? previous.activeEntryId
|
|
@@ -3419,7 +3422,12 @@ var FileSessionStore = class {
|
|
|
3419
3422
|
return {
|
|
3420
3423
|
summaries: collected.slice(0, limit).map(toSummary),
|
|
3421
3424
|
hasMore: collected.length > limit,
|
|
3422
|
-
|
|
3425
|
+
// Sequence numbers are dense (one per committed entry), so
|
|
3426
|
+
// committedSeq is the authoritative entry count. metadata.entryCount
|
|
3427
|
+
// can drift behind it when concurrent writers race head manifests
|
|
3428
|
+
// (lost update), which would otherwise surface as ranges like
|
|
3429
|
+
// "seqs 1582-1621 of 1574" in paged UIs.
|
|
3430
|
+
total: Math.max(head.metadata.entryCount, head.committedSeq)
|
|
3423
3431
|
};
|
|
3424
3432
|
}
|
|
3425
3433
|
getEntrySummary(sessionId, entryId) {
|
|
@@ -3223,6 +3223,7 @@ var DEFAULT_OPENAI_COMPAT_STREAM_IDLE_TIMEOUT_MS = 2 * 60 * 1e3;
|
|
|
3223
3223
|
var DEFAULT_OPENAI_COMPAT_FIRST_BYTE_TIMEOUT_MS = 3 * 60 * 1e3;
|
|
3224
3224
|
var OPENAI_COMPAT_FIRST_BYTE_MAX_ESCALATION_STEPS = 3;
|
|
3225
3225
|
var openAICompatFirstByteTimeoutsByEndpoint = /* @__PURE__ */ new Map();
|
|
3226
|
+
var OPENAI_COMPAT_MAX_DUPLICATE_TOOL_CALLS = 3;
|
|
3226
3227
|
var OPENAI_COMPAT_PROTOCOL_ERROR_CODE = "provider_response_protocol_error";
|
|
3227
3228
|
var OpenAICompatProtocolError = class extends Error {
|
|
3228
3229
|
code = OPENAI_COMPAT_PROTOCOL_ERROR_CODE;
|
|
@@ -3679,6 +3680,53 @@ var streamOpenAICompletions = (model, context, options) => {
|
|
|
3679
3680
|
});
|
|
3680
3681
|
}
|
|
3681
3682
|
}
|
|
3683
|
+
const knownToolNames = new Set((context.tools ?? []).map((tool) => tool.name));
|
|
3684
|
+
const droppedToolCallBlocks = /* @__PURE__ */ new Set();
|
|
3685
|
+
const unknownNameSamples = [];
|
|
3686
|
+
if (knownToolNames.size > 0) {
|
|
3687
|
+
for (let i = toolCallEntries.length - 1; i >= 0; i--) {
|
|
3688
|
+
const entry = toolCallEntries[i];
|
|
3689
|
+
if (entry.block.name.trim() && !knownToolNames.has(entry.block.name)) {
|
|
3690
|
+
if (unknownNameSamples.length < 3) unknownNameSamples.push(JSON.stringify(entry.block.name));
|
|
3691
|
+
droppedToolCallBlocks.add(entry.block);
|
|
3692
|
+
toolCallEntries.splice(i, 1);
|
|
3693
|
+
}
|
|
3694
|
+
}
|
|
3695
|
+
}
|
|
3696
|
+
const emittedCallCounts = /* @__PURE__ */ new Map();
|
|
3697
|
+
const excessDuplicateEntries = /* @__PURE__ */ new Set();
|
|
3698
|
+
for (const entry of toolCallEntries) {
|
|
3699
|
+
const key = `${entry.block.name}
|
|
3700
|
+
${entry.partialArgs}`;
|
|
3701
|
+
const seen = (emittedCallCounts.get(key) ?? 0) + 1;
|
|
3702
|
+
emittedCallCounts.set(key, seen);
|
|
3703
|
+
if (seen > OPENAI_COMPAT_MAX_DUPLICATE_TOOL_CALLS) excessDuplicateEntries.add(entry);
|
|
3704
|
+
}
|
|
3705
|
+
if (excessDuplicateEntries.size > 0) {
|
|
3706
|
+
for (let i = toolCallEntries.length - 1; i >= 0; i--) {
|
|
3707
|
+
if (excessDuplicateEntries.has(toolCallEntries[i])) {
|
|
3708
|
+
droppedToolCallBlocks.add(toolCallEntries[i].block);
|
|
3709
|
+
toolCallEntries.splice(i, 1);
|
|
3710
|
+
}
|
|
3711
|
+
}
|
|
3712
|
+
}
|
|
3713
|
+
if (droppedToolCallBlocks.size > 0) {
|
|
3714
|
+
const unknownCount = droppedToolCallBlocks.size - excessDuplicateEntries.size;
|
|
3715
|
+
output.content = output.content.filter(
|
|
3716
|
+
(block) => block.type !== "toolCall" || !droppedToolCallBlocks.has(block)
|
|
3717
|
+
);
|
|
3718
|
+
const reasons = [];
|
|
3719
|
+
if (unknownCount > 0) {
|
|
3720
|
+
reasons.push(`${unknownCount} named tools that are not part of this request (samples: ${unknownNameSamples.join(", ")})`);
|
|
3721
|
+
}
|
|
3722
|
+
if (excessDuplicateEntries.size > 0) {
|
|
3723
|
+
reasons.push(`${excessDuplicateEntries.size} were exact duplicates of an earlier call in the same message`);
|
|
3724
|
+
}
|
|
3725
|
+
output.content.push({
|
|
3726
|
+
type: "text",
|
|
3727
|
+
text: `[dropped ${droppedToolCallBlocks.size} tool call${droppedToolCallBlocks.size === 1 ? "" : "s"}: ${reasons.join("; ")}. Re-issue only the intended calls.]`
|
|
3728
|
+
});
|
|
3729
|
+
}
|
|
3682
3730
|
for (const { block, partialArgs, contentIndex } of toolCallEntries) {
|
|
3683
3731
|
if (!block.name.trim()) {
|
|
3684
3732
|
throw createProtocolError("OpenAI-compatible stream returned a tool call without a function name.");
|
|
@@ -6,8 +6,8 @@ import {
|
|
|
6
6
|
bindToolCallerIdentity,
|
|
7
7
|
createToolCallerIdentity,
|
|
8
8
|
getToolCallerIdentity
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import "./chunk-
|
|
9
|
+
} from "./chunk-YEUBQBOB.js";
|
|
10
|
+
import "./chunk-OCEYHWVX.js";
|
|
11
11
|
import "./chunk-XXGYUYXI.js";
|
|
12
12
|
import "./chunk-LZQXQOPJ.js";
|
|
13
13
|
export {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createRequire as __createRequire } from "node:module"; const require = __createRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
EventStream
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-OCEYHWVX.js";
|
|
5
5
|
import "./chunk-XXGYUYXI.js";
|
|
6
6
|
import "./chunk-LZQXQOPJ.js";
|
|
7
7
|
|
package/dist/cli.js
CHANGED
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
createCliWebResearchHealthStore,
|
|
8
8
|
formatSize,
|
|
9
9
|
truncateHeadTail
|
|
10
|
-
} from "./chunks/chunk-
|
|
10
|
+
} from "./chunks/chunk-6QEDYZUR.js";
|
|
11
11
|
import {
|
|
12
12
|
AGENTS_CONTEXT_FILE_NAME,
|
|
13
13
|
AgentSessionController,
|
|
@@ -60,8 +60,8 @@ import {
|
|
|
60
60
|
setExtensionEnabledInSettings,
|
|
61
61
|
shouldPreserveExecutionStateForUserText,
|
|
62
62
|
supersedeExecutionState
|
|
63
|
-
} from "./chunks/chunk-
|
|
64
|
-
import "./chunks/chunk-
|
|
63
|
+
} from "./chunks/chunk-3AOMWS2Z.js";
|
|
64
|
+
import "./chunks/chunk-YEUBQBOB.js";
|
|
65
65
|
import {
|
|
66
66
|
Deref,
|
|
67
67
|
EMPTY_ASSISTANT_CONTENT_ERROR,
|
|
@@ -85,7 +85,7 @@ import {
|
|
|
85
85
|
setLogger,
|
|
86
86
|
sortToolModelCandidatesByCapability,
|
|
87
87
|
type_exports
|
|
88
|
-
} from "./chunks/chunk-
|
|
88
|
+
} from "./chunks/chunk-OCEYHWVX.js";
|
|
89
89
|
import {
|
|
90
90
|
VERSION,
|
|
91
91
|
getAgentDir,
|
|
@@ -73141,8 +73141,11 @@ var TreeSelectorComponent = class {
|
|
|
73141
73141
|
/**
|
|
73142
73142
|
* Iteratively flatten the resident window. Parents always commit before
|
|
73143
73143
|
* children, so one forward pass resolves in-window ancestry; an explicit
|
|
73144
|
-
* stack (no recursion) emits DFS rows
|
|
73145
|
-
*
|
|
73144
|
+
* stack (no recursion) emits DFS rows. Visual depth counts fork points
|
|
73145
|
+
* (see the component doc): a single-child parent continues at its own
|
|
73146
|
+
* level, so a forkless chain renders flat and only real branches indent.
|
|
73147
|
+
* Row prefixes are still capped to prefixDepthCap segments, keeping
|
|
73148
|
+
* prefix memory O(rows).
|
|
73146
73149
|
*/
|
|
73147
73150
|
rebuildRows() {
|
|
73148
73151
|
const count = this.pageSummaries.length;
|
|
@@ -73155,7 +73158,8 @@ var TreeSelectorComponent = class {
|
|
|
73155
73158
|
seqToIndex.set(summary.seq, i);
|
|
73156
73159
|
const parent = summary.parentSeq === null ? -1 : seqToIndex.get(summary.parentSeq) ?? -1;
|
|
73157
73160
|
if (parent >= 0) {
|
|
73158
|
-
|
|
73161
|
+
const parentSummary = this.pageSummaries[parent];
|
|
73162
|
+
depth[i] = depth[parent] + (parentSummary.childCount > 1 ? 1 : 0);
|
|
73159
73163
|
parentIndex[i] = parent;
|
|
73160
73164
|
const bucket = childLists[parent];
|
|
73161
73165
|
if (bucket) bucket.push(i);
|
|
@@ -73171,14 +73175,13 @@ var TreeSelectorComponent = class {
|
|
|
73171
73175
|
const rows = [];
|
|
73172
73176
|
const stack = [];
|
|
73173
73177
|
for (let i = roots.length - 1; i >= 0; i--) {
|
|
73174
|
-
stack.push({ index: roots[i], base: "",
|
|
73178
|
+
stack.push({ index: roots[i], base: "", connector: "", rail: "" });
|
|
73175
73179
|
}
|
|
73176
73180
|
while (stack.length > 0) {
|
|
73177
73181
|
const item = stack.pop();
|
|
73178
73182
|
const summary = this.pageSummaries[item.index];
|
|
73179
73183
|
const rowDepth = depth[item.index];
|
|
73180
|
-
const
|
|
73181
|
-
const segments = capSegments(item.base + connector);
|
|
73184
|
+
const segments = capSegments(item.base + item.connector);
|
|
73182
73185
|
const ancestryHidden = rowDepth > this.prefixDepthCap || summary.parentSeq !== null && parentIndex[item.index] === -1;
|
|
73183
73186
|
const prefix = ancestryHidden ? TREE_CHARS.hiddenAncestry + segments : segments;
|
|
73184
73187
|
rows.push({
|
|
@@ -73190,10 +73193,21 @@ var TreeSelectorComponent = class {
|
|
|
73190
73193
|
if (prefix.length > this.maxPrefixCharsSeen) this.maxPrefixCharsSeen = prefix.length;
|
|
73191
73194
|
if (this.collapsed.has(summary.id)) continue;
|
|
73192
73195
|
const children = childLists[item.index];
|
|
73193
|
-
if (children === void 0) continue;
|
|
73194
|
-
const
|
|
73196
|
+
if (children === void 0 || children.length === 0) continue;
|
|
73197
|
+
const isFork = summary.childCount > 1 || children.length > 1;
|
|
73198
|
+
if (!isFork) {
|
|
73199
|
+
const rail = capSegments(item.rail);
|
|
73200
|
+
stack.push({ index: children[0], base: rail, connector: "", rail });
|
|
73201
|
+
continue;
|
|
73202
|
+
}
|
|
73195
73203
|
for (let i = children.length - 1; i >= 0; i--) {
|
|
73196
|
-
|
|
73204
|
+
const last = i === children.length - 1;
|
|
73205
|
+
stack.push({
|
|
73206
|
+
index: children[i],
|
|
73207
|
+
base: capSegments(item.rail),
|
|
73208
|
+
connector: last ? TREE_CHARS.corner : TREE_CHARS.branch,
|
|
73209
|
+
rail: capSegments(item.rail + (last ? TREE_CHARS.space : TREE_CHARS.pipe))
|
|
73210
|
+
});
|
|
73197
73211
|
}
|
|
73198
73212
|
}
|
|
73199
73213
|
this.rows = rows;
|
|
@@ -80251,7 +80265,7 @@ var InteractiveMode = class {
|
|
|
80251
80265
|
async init() {
|
|
80252
80266
|
const activeSession = this.sessionManager.getActiveSession();
|
|
80253
80267
|
this.thinkingLevel = resolveInitialThinkingLevel({ session: activeSession, settingsManager: this.options.settingsManager });
|
|
80254
|
-
const { Agent } = await import("./chunks/src-
|
|
80268
|
+
const { Agent } = await import("./chunks/src-XT5S6AUQ.js");
|
|
80255
80269
|
this.agent = new Agent({
|
|
80256
80270
|
initialState: {
|
|
80257
80271
|
systemPrompt: this.buildSystemPrompt(),
|
|
@@ -81083,7 +81097,7 @@ async function runPrintMode(params) {
|
|
|
81083
81097
|
`);
|
|
81084
81098
|
console.log("Assistant: ");
|
|
81085
81099
|
}
|
|
81086
|
-
const { Agent: AgentClass } = await import("./chunks/src-
|
|
81100
|
+
const { Agent: AgentClass } = await import("./chunks/src-XT5S6AUQ.js");
|
|
81087
81101
|
let agent;
|
|
81088
81102
|
const printModeExtensions = await loadPrintModeExtensions({
|
|
81089
81103
|
cwd: runtime.cwd,
|
|
@@ -81944,7 +81958,7 @@ async function runJsonEventsMode(params) {
|
|
|
81944
81958
|
return;
|
|
81945
81959
|
}
|
|
81946
81960
|
const parent = agent;
|
|
81947
|
-
const { Agent: AgentClass } = await import("./chunks/src-
|
|
81961
|
+
const { Agent: AgentClass } = await import("./chunks/src-XT5S6AUQ.js");
|
|
81948
81962
|
const sideAgent = new AgentClass({
|
|
81949
81963
|
initialState: {
|
|
81950
81964
|
systemPrompt: parent.state.systemPrompt,
|
|
@@ -82288,7 +82302,7 @@ async function runJsonEventsMode(params) {
|
|
|
82288
82302
|
if (runtime.initialModel.unconfigured || controller) {
|
|
82289
82303
|
return;
|
|
82290
82304
|
}
|
|
82291
|
-
const { Agent: AgentClass } = await import("./chunks/src-
|
|
82305
|
+
const { Agent: AgentClass } = await import("./chunks/src-XT5S6AUQ.js");
|
|
82292
82306
|
const jsonModeExtensions = await loadJsonModeExtensions({ runtime, getAgent: () => agent });
|
|
82293
82307
|
extensionRunner = jsonModeExtensions.runner;
|
|
82294
82308
|
const tools = [...runtime.tools, ...jsonModeExtensions.extensionTools];
|
|
@@ -82882,7 +82896,7 @@ async function runWithJsonEventsConsoleIsolation(fn) {
|
|
|
82882
82896
|
}
|
|
82883
82897
|
async function createCliTestStreamFnFromEnv() {
|
|
82884
82898
|
if (!process.env.PIE_TEST_MOCK_STREAM_SEQUENCE) return void 0;
|
|
82885
|
-
return (await import("./chunks/test-stream-
|
|
82899
|
+
return (await import("./chunks/test-stream-FNWDHRTM.js")).createTestStreamFnFromSequenceEnv();
|
|
82886
82900
|
}
|
|
82887
82901
|
function resolveJsonEventsDetailFlag() {
|
|
82888
82902
|
for (let index = 0; index < process.argv.length; index += 1) {
|