@swifty.js/swifty 0.0.35 → 0.0.36

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.
@@ -2,8 +2,8 @@ import {
2
2
  Agent,
3
3
  events_exports,
4
4
  streaming_executor_exports
5
- } from "./chunk-S5VWPTME.js";
6
- import "./chunk-OJTISIYU.js";
5
+ } from "./chunk-YUDCYSKO.js";
6
+ import "./chunk-PJ7354ZG.js";
7
7
  import "./chunk-BQFVUVLI.js";
8
8
  import "./chunk-HQSYRTER.js";
9
9
  import "./chunk-OLFXCZVH.js";
@@ -583,7 +583,7 @@ var PermissionChecker = class _PermissionChecker {
583
583
  }
584
584
  /**
585
585
  * Generate a human-readable description of the tool action for display in HITL confirmation dialogs.
586
- * Prioritizes extracting fields defined in contentFields (e.g., command, file_path);
586
+ * Prioritizes extracting fields defined in CONTENT_FIELDS (e.g., command, file_path);
587
587
  * falls back to a key:value summary of parameters if no match is found.
588
588
  */
589
589
  describeToolAction(toolName, args) {
@@ -47,7 +47,7 @@ var PackageJsonSchema = z.object({
47
47
  });
48
48
  function resolveVersion() {
49
49
  if (true) {
50
- return "0.0.35";
50
+ return "0.0.36";
51
51
  }
52
52
  const here = path.dirname(fileURLToPath(import.meta.url));
53
53
  for (const levels of ["..", "../.."]) {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  providers_exports
3
- } from "./chunk-OJTISIYU.js";
3
+ } from "./chunk-PJ7354ZG.js";
4
4
  import {
5
5
  normalizeToolResultContentBlock
6
6
  } from "./chunk-BQFVUVLI.js";
@@ -104,7 +104,7 @@ async function initializeTelemetry() {
104
104
  if (!shouldInitialize()) {
105
105
  return;
106
106
  }
107
- initialization = import("./providers-ROWSB6ND.js").then(async ({ createTelemetryRuntime }) => {
107
+ initialization = import("./providers-5SJFTU2G.js").then(async ({ createTelemetryRuntime }) => {
108
108
  runtime = await createTelemetryRuntime();
109
109
  runtime.setMode(mode);
110
110
  process.once("beforeExit", () => {
@@ -2377,9 +2377,11 @@ var tool_result_exports = {};
2377
2377
  __export(tool_result_exports, {
2378
2378
  TOOL_RESULT_PREVIEW_CHARS: () => TOOL_RESULT_PREVIEW_CHARS,
2379
2379
  applyBudget: () => applyBudget,
2380
+ buildPersistedOutputPreview: () => buildPersistedOutputPreview,
2380
2381
  isSpillReadback: () => isSpillReadback,
2381
2382
  persistLargeResult: () => persistLargeResult,
2382
2383
  replaceToolResultContent: () => replaceToolResultContent,
2384
+ spillDir: () => spillDir,
2383
2385
  toDisplayPreview: () => toDisplayPreview
2384
2386
  });
2385
2387
  import { writeFileSync as writeFileSync4, mkdirSync as mkdirSync4 } from "fs";
@@ -2421,10 +2423,8 @@ function replaceToolResultContent(result, content) {
2421
2423
  ];
2422
2424
  }
2423
2425
  }
2424
- function buildSpillPreview(content, spillPath) {
2425
- const sizeKB = Math.floor(content.length / 1024);
2426
- const preview = content.slice(0, TOOL_RESULT_PREVIEW_CHARS);
2427
- const hasMore = content.length > TOOL_RESULT_PREVIEW_CHARS;
2426
+ function buildPersistedOutputPreview(totalChars, preview, spillPath) {
2427
+ const sizeKB = Math.floor(totalChars / 1024);
2428
2428
  let msg = `<persisted-output>
2429
2429
  `;
2430
2430
  msg += `Output too large (${String(sizeKB)}KB). Full content saved to:
@@ -2433,12 +2433,19 @@ ${spillPath}
2433
2433
  `;
2434
2434
  msg += `Preview (first 2KB):
2435
2435
  ${preview}`;
2436
- if (hasMore) {
2436
+ if (totalChars > TOOL_RESULT_PREVIEW_CHARS) {
2437
2437
  msg += "\n...";
2438
2438
  }
2439
2439
  msg += "\n</persisted-output>";
2440
2440
  return msg;
2441
2441
  }
2442
+ function buildSpillPreview(content, spillPath) {
2443
+ return buildPersistedOutputPreview(
2444
+ content.length,
2445
+ content.slice(0, TOOL_RESULT_PREVIEW_CHARS),
2446
+ spillPath
2447
+ );
2448
+ }
2442
2449
  function isSpillReadback(toolName, args, workDir, sessionId) {
2443
2450
  if (toolName !== "ReadFile" || !args) {
2444
2451
  return false;
@@ -2517,6 +2524,7 @@ var Agent = class {
2517
2524
  recoveryState;
2518
2525
  maxIterations;
2519
2526
  notificationFn;
2527
+ taskManager;
2520
2528
  onLoopComplete;
2521
2529
  compactTracking = new AutoCompactTrackingState();
2522
2530
  onPermissionRequest;
@@ -2550,6 +2558,7 @@ var Agent = class {
2550
2558
  this.recoveryState = config.recoveryState ?? new RecoveryState();
2551
2559
  this.maxIterations = config.maxIterations ?? 0;
2552
2560
  this.notificationFn = config.notificationFn;
2561
+ this.taskManager = config.taskManager;
2553
2562
  this.onLoopComplete = config.onLoopComplete;
2554
2563
  this.onPermissionRequest = config.onPermissionRequest;
2555
2564
  this.activeSkills = config.activeSkills ?? /* @__PURE__ */ new Map();
@@ -3021,6 +3030,8 @@ ${body}`)
3021
3030
  this.registry,
3022
3031
  {
3023
3032
  workDir: this.workDir,
3033
+ sessionId: this.sessionId,
3034
+ taskManager: this.taskManager,
3024
3035
  abortSignal: this.abortSignal,
3025
3036
  fileHistory: this.fileHistory,
3026
3037
  fileStateCache: this.fileStateCache,
@@ -3276,6 +3287,10 @@ export {
3276
3287
  plan_file_exports,
3277
3288
  coordinator_exports,
3278
3289
  plan_mode_exports,
3290
+ TOOL_RESULT_PREVIEW_CHARS,
3291
+ spillDir,
3292
+ buildPersistedOutputPreview,
3293
+ persistLargeResult,
3279
3294
  tool_result_exports,
3280
3295
  events_exports,
3281
3296
  Agent,