@cydm/pie 1.0.17 → 1.0.18

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.
@@ -1,7 +1,7 @@
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-B4VUX6SD.js";
4
+ } from "../../../chunks/chunk-G4GV2CRT.js";
5
5
  import "../../../chunks/chunk-VE2HDCNB.js";
6
6
  import "../../../chunks/chunk-5DA2D3K2.js";
7
7
  import "../../../chunks/chunk-TG2EQLX2.js";
@@ -7,7 +7,7 @@ import {
7
7
  isPlanModeSafeCommand,
8
8
  markCompletedPlanSteps,
9
9
  restoreExecutionState
10
- } from "../../../chunks/chunk-B4VUX6SD.js";
10
+ } from "../../../chunks/chunk-G4GV2CRT.js";
11
11
  import "../../../chunks/chunk-VE2HDCNB.js";
12
12
  import "../../../chunks/chunk-5DA2D3K2.js";
13
13
  import "../../../chunks/chunk-TG2EQLX2.js";
@@ -1,11 +1,11 @@
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-4MIOCDBV.js";
4
+ } from "../../../chunks/chunk-MHFUWY7I.js";
5
5
  import {
6
6
  createSharedFileSystemTools,
7
7
  createSubagentCapability
8
- } from "../../../chunks/chunk-B4VUX6SD.js";
8
+ } from "../../../chunks/chunk-G4GV2CRT.js";
9
9
  import "../../../chunks/chunk-VE2HDCNB.js";
10
10
  import "../../../chunks/chunk-5DA2D3K2.js";
11
11
  import "../../../chunks/chunk-TG2EQLX2.js";
@@ -7,7 +7,7 @@ import {
7
7
  executeManageTodoList,
8
8
  executionStateToTodos,
9
9
  restoreExecutionState
10
- } from "../../../chunks/chunk-B4VUX6SD.js";
10
+ } from "../../../chunks/chunk-G4GV2CRT.js";
11
11
  import "../../../chunks/chunk-VE2HDCNB.js";
12
12
  import "../../../chunks/chunk-5DA2D3K2.js";
13
13
  import "../../../chunks/chunk-TG2EQLX2.js";
@@ -7207,6 +7207,70 @@ function summarizeToolResults(value) {
7207
7207
  }
7208
7208
  return { count: value.length, errors, toolNames };
7209
7209
  }
7210
+ function collectTextLength(content) {
7211
+ if (typeof content === "string") return content.length;
7212
+ if (!Array.isArray(content)) return 0;
7213
+ let length = 0;
7214
+ for (const block of content) {
7215
+ if (!isRecord(block)) continue;
7216
+ if (typeof block.text === "string") length += block.text.length;
7217
+ }
7218
+ return length;
7219
+ }
7220
+ function collectArgumentLength(content) {
7221
+ if (!Array.isArray(content)) return 0;
7222
+ let length = 0;
7223
+ for (const block of content) {
7224
+ if (!isRecord(block) || !("arguments" in block)) continue;
7225
+ if (typeof block.arguments === "string") {
7226
+ length += block.arguments.length;
7227
+ continue;
7228
+ }
7229
+ try {
7230
+ length += JSON.stringify(block.arguments).length;
7231
+ } catch {
7232
+ length += String(block.arguments).length;
7233
+ }
7234
+ }
7235
+ return length;
7236
+ }
7237
+ function summarizeMessages(value) {
7238
+ if (!Array.isArray(value)) return typeof value;
7239
+ const roles = [];
7240
+ const toolNames = [];
7241
+ const stopReasons = [];
7242
+ let errorCount = 0;
7243
+ let contentBlocks = 0;
7244
+ let textLength = 0;
7245
+ let argumentLength = 0;
7246
+ for (const message of value) {
7247
+ if (!isRecord(message)) continue;
7248
+ const role = typeof message.role === "string" ? message.role : void 0;
7249
+ if (role && roles.length < 20) roles.push(role);
7250
+ if (typeof message.stopReason === "string" && stopReasons.length < 20) stopReasons.push(message.stopReason);
7251
+ if (typeof message.errorMessage === "string" && message.errorMessage) errorCount++;
7252
+ if (typeof message.toolName === "string" && toolNames.length < 20) toolNames.push(message.toolName);
7253
+ const content = Array.isArray(message.content) ? message.content : [];
7254
+ contentBlocks += content.length;
7255
+ textLength += collectTextLength(message.content);
7256
+ argumentLength += collectArgumentLength(message.content);
7257
+ for (const block of content) {
7258
+ if (isRecord(block) && typeof block.name === "string" && toolNames.length < 20) {
7259
+ toolNames.push(block.name);
7260
+ }
7261
+ }
7262
+ }
7263
+ return {
7264
+ count: value.length,
7265
+ roles,
7266
+ toolNames: [...new Set(toolNames)].slice(0, 20),
7267
+ stopReasons: [...new Set(stopReasons)].slice(0, 20),
7268
+ errorCount,
7269
+ contentBlocks,
7270
+ textLength,
7271
+ argumentLength
7272
+ };
7273
+ }
7210
7274
  function summarizeFailure(value) {
7211
7275
  if (!isRecord(value)) return typeof value;
7212
7276
  return {
@@ -7259,6 +7323,10 @@ function summarizeMeta(meta) {
7259
7323
  summary[key] = Array.isArray(value) ? { count: value.length } : typeof value;
7260
7324
  continue;
7261
7325
  }
7326
+ if (key === "addedMessages") {
7327
+ summary[key] = summarizeMessages(value);
7328
+ continue;
7329
+ }
7262
7330
  if (key === "message") {
7263
7331
  summary[key] = summarizeMessage(value);
7264
7332
  continue;
@@ -8,7 +8,7 @@ import {
8
8
  createSharedWebSearchTool,
9
9
  interpretShellExit,
10
10
  requestInteraction
11
- } from "./chunk-B4VUX6SD.js";
11
+ } from "./chunk-G4GV2CRT.js";
12
12
  import {
13
13
  Type
14
14
  } from "./chunk-5DA2D3K2.js";
package/dist/cli.js CHANGED
@@ -14,7 +14,7 @@ import {
14
14
  getSettingsPath,
15
15
  getThemesDir,
16
16
  migrateConfigFromAgentDir
17
- } from "./chunks/chunk-4MIOCDBV.js";
17
+ } from "./chunks/chunk-MHFUWY7I.js";
18
18
  import {
19
19
  AGENTS_CONTEXT_FILE_NAME,
20
20
  AgentSessionController,
@@ -55,7 +55,7 @@ import {
55
55
  selectToolsForRuntimePolicy,
56
56
  shouldPreserveExecutionStateForUserText,
57
57
  supersedeExecutionState
58
- } from "./chunks/chunk-B4VUX6SD.js";
58
+ } from "./chunks/chunk-G4GV2CRT.js";
59
59
  import "./chunks/chunk-VE2HDCNB.js";
60
60
  import {
61
61
  Deref,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cydm/pie",
3
- "version": "1.0.17",
3
+ "version": "1.0.18",
4
4
  "description": "Pie AI Agent CLI",
5
5
  "type": "module",
6
6
  "bin": {