@vincemakes/kiso-tools-node 0.50.0 → 0.51.0

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/index.d.ts CHANGED
@@ -254,6 +254,9 @@ export interface ShellTasks {
254
254
  readonly startedAt: string;
255
255
  };
256
256
  readonly ready?: boolean;
257
+ /** 0.50.1: when the command was spawned (ms since the epoch) — the
258
+ * task's runtime counts from here, not from the promotion. */
259
+ readonly startedAt: number;
257
260
  readonly stop: () => void;
258
261
  }): {
259
262
  readonly id: string;
package/dist/index.js CHANGED
@@ -1461,6 +1461,9 @@ export function shellTool(opts) {
1461
1461
  const ceiling = opts.limits?.maxForegroundMs ?? DEFAULT_MAX_FOREGROUND_MS;
1462
1462
  const raised = Math.max(asked ?? DEFAULT_FOREGROUND_MS, floor);
1463
1463
  const timeout = tasks !== undefined ? (ceiling > 0 ? Math.min(raised, Math.max(ceiling, floor)) : raised) : (asked ?? DEFAULT_SHELL_TIMEOUT_MS);
1464
+ // 0.50.1: the ceiling, not the model, cut this wait — a promotion
1465
+ // at it says so, so the model does not take it for its own
1466
+ const cut = tasks !== undefined && asked !== undefined && raised > timeout ? asked : undefined;
1464
1467
  // E group: a PRE-aborted signal never spawns the command.
1465
1468
  if (ctx.signal.aborted) {
1466
1469
  return { content: "shell aborted before start", isError: true, errorKind: "fatal" };
@@ -1491,6 +1494,8 @@ export function shellTool(opts) {
1491
1494
  // timeout/abort can kill the WHOLE TREE (children included),
1492
1495
  // not just the outer shell (Area 4). cwd is the workspace.
1493
1496
  let child;
1497
+ // 0.50.1: a promoted task's runtime counts from here
1498
+ const spawnedAt = Date.now();
1494
1499
  try {
1495
1500
  child = startCommand(command, { cwd: opts.workspaceRoot, env });
1496
1501
  }
@@ -1641,6 +1646,7 @@ export function shellTool(opts) {
1641
1646
  ...(readyWhen !== undefined ? { readyWhen } : {}),
1642
1647
  runner: ownerIdentity(),
1643
1648
  ready: reason === "ready",
1649
+ startedAt: spawnedAt,
1644
1650
  stop: () => stopPromoted(),
1645
1651
  });
1646
1652
  const out = new RotatingOutput(task.outputPath, TASK_OUTPUT_CAP);
@@ -1656,7 +1662,7 @@ export function shellTool(opts) {
1656
1662
  ? "moved to the background by the person; "
1657
1663
  : reason === "steer"
1658
1664
  ? "moved to the background so the person's message could land; "
1659
- : `still running after ${timeout} ms; `) +
1665
+ : `still running after ${timeout} ms${cut !== undefined ? ` (the limit; you asked ${cut} ms)` : ""}; `) +
1660
1666
  `continued as background task ${task.id} (not killed — it keeps running). ${taskNote(task.outputPath)}` +
1661
1667
  (tail !== "" ? `\nOutput so far:\n${tail}` : ""),
1662
1668
  isError: false,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vincemakes/kiso-tools-node",
3
- "version": "0.50.0",
3
+ "version": "0.51.0",
4
4
  "description": "kiso coding tools for Node hosts \u2014 read file, list directory, search text, write/edit file, shell command.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -25,7 +25,7 @@
25
25
  "test": "vitest run"
26
26
  },
27
27
  "dependencies": {
28
- "@vincemakes/kiso-core": "0.50.0",
28
+ "@vincemakes/kiso-core": "0.51.0",
29
29
  "ignore": "^7.0.9"
30
30
  },
31
31
  "devDependencies": {