@rubytech/taskmaster 1.0.23 → 1.0.25

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.
@@ -19,9 +19,7 @@ const applyPatchSchema = Type.Object({
19
19
  description: "Patch content using the *** Begin Patch/End Patch format.",
20
20
  }),
21
21
  });
22
- export function createApplyPatchTool(options = {}
23
- // biome-ignore lint/suspicious/noExplicitAny: TypeBox schema type from pi-agent-core uses a different module instance.
24
- ) {
22
+ export function createApplyPatchTool(options = {}) {
25
23
  const cwd = options.cwd ?? process.cwd();
26
24
  const sandboxRoot = options.sandboxRoot;
27
25
  return {
@@ -513,9 +513,7 @@ async function runExecProcess(opts) {
513
513
  kill: () => killSession(session),
514
514
  };
515
515
  }
516
- export function createExecTool(defaults
517
- // biome-ignore lint/suspicious/noExplicitAny: TypeBox schema type from pi-agent-core uses a different module instance.
518
- ) {
516
+ export function createExecTool(defaults) {
519
517
  const defaultBackgroundMs = clampNumber(defaults?.backgroundMs ?? readEnvInt("PI_BASH_YIELD_MS"), 10_000, 10, 120_000);
520
518
  const allowBackground = defaults?.allowBackground ?? true;
521
519
  const defaultTimeoutSec = typeof defaults?.timeoutSec === "number" && defaults.timeoutSec > 0
@@ -15,9 +15,7 @@ const processSchema = Type.Object({
15
15
  offset: Type.Optional(Type.Number({ description: "Log offset" })),
16
16
  limit: Type.Optional(Type.Number({ description: "Log length" })),
17
17
  });
18
- export function createProcessTool(defaults
19
- // biome-ignore lint/suspicious/noExplicitAny: TypeBox schema type from pi-agent-core uses a different module instance.
20
- ) {
18
+ export function createProcessTool(defaults) {
21
19
  if (defaults?.cleanupMs !== undefined) {
22
20
  setJobTtlMs(defaults.cleanupMs);
23
21
  }
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.0.23",
3
- "commit": "3f73e894e24608dacc1ce8f1b47e56dc3babd209",
4
- "builtAt": "2026-02-16T08:36:54.743Z"
2
+ "version": "1.0.25",
3
+ "commit": "d4ced1a166a939519e0c3fe31b9a6e8f8e48bd91",
4
+ "builtAt": "2026-02-16T08:41:57.490Z"
5
5
  }
@@ -138,7 +138,8 @@ export const updateHandlers = {
138
138
  },
139
139
  onStepComplete: (step) => {
140
140
  const ok = step.exitCode === 0 || step.exitCode === null;
141
- log.info(`update step ${step.index + 1}/${step.total}: ${step.name} ${ok ? "ok" : `FAILED (exit ${step.exitCode})`} (${step.durationMs}ms)`);
141
+ const logFn = ok ? log.info.bind(log) : log.error.bind(log);
142
+ logFn(`update step ${step.index + 1}/${step.total}: ${step.name} ${ok ? "ok" : `FAILED (exit ${step.exitCode})`} (${step.durationMs}ms)`);
142
143
  context.broadcast("update.progress", {
143
144
  phase: "step-done",
144
145
  name: step.name,
@@ -176,7 +177,7 @@ export const updateHandlers = {
176
177
  log.info(`software update completed (${result.mode}, ${result.durationMs}ms)`);
177
178
  }
178
179
  else {
179
- log.warn(`software update ${result.status}: ${result.reason ?? "unknown"} (${result.mode}, ${result.durationMs}ms)`);
180
+ log.error(`software update ${result.status}: ${result.reason ?? "unknown"} (${result.mode}, ${result.durationMs}ms)`);
180
181
  }
181
182
  const payload = {
182
183
  kind: "update",
@@ -8,7 +8,6 @@ import { detectGlobalInstallManagerForRoot, globalInstallArgs } from "./update-g
8
8
  import { trimLogTail } from "./restart-sentinel.js";
9
9
  const DEFAULT_TIMEOUT_MS = 20 * 60_000;
10
10
  const MAX_LOG_CHARS = 8000;
11
- const PREFLIGHT_MAX_COMMITS = 10;
12
11
  const START_DIRS = ["cwd", "argv1", "process"];
13
12
  /**
14
13
  * Build an augmented PATH that includes common binary locations.
@@ -278,7 +277,9 @@ export async function runGatewayUpdate(opts = {}) {
278
277
  const channel = opts.channel ?? "dev";
279
278
  const branch = channel === "dev" ? await readBranchName(runCommand, gitRoot, timeoutMs) : null;
280
279
  const needsCheckoutMain = channel === "dev" && branch !== DEV_BRANCH;
281
- gitTotalSteps = channel === "dev" ? (needsCheckoutMain ? 11 : 10) : 9;
280
+ // Steps: clean check + [checkout main] + upstream check + fetch + rebase/checkout
281
+ // + install + build + ui:build + restore control-ui + doctor + rev-parse
282
+ gitTotalSteps = channel === "dev" ? (needsCheckoutMain ? 10 : 9) : 9;
282
283
  const statusCheck = await runStep(step("clean check", ["git", "-C", gitRoot, "status", "--porcelain", "-uno", "--", ":!dist/control-ui/"], gitRoot));
283
284
  steps.push(statusCheck);
284
285
  const hasUncommittedChanges = statusCheck.stdoutTail && statusCheck.stdoutTail.trim().length > 0;
@@ -332,110 +333,7 @@ export async function runGatewayUpdate(opts = {}) {
332
333
  }
333
334
  const fetchStep = await runStep(step("git fetch", ["git", "-C", gitRoot, "fetch", "--all", "--prune", "--tags"], gitRoot));
334
335
  steps.push(fetchStep);
335
- const upstreamShaStep = await runStep(step("git rev-parse @{upstream}", ["git", "-C", gitRoot, "rev-parse", "@{upstream}"], gitRoot));
336
- steps.push(upstreamShaStep);
337
- const upstreamSha = upstreamShaStep.stdoutTail?.trim();
338
- if (!upstreamShaStep.stdoutTail || !upstreamSha) {
339
- return {
340
- status: "error",
341
- mode: "git",
342
- root: gitRoot,
343
- reason: "no-upstream-sha",
344
- before: { sha: beforeSha, version: beforeVersion },
345
- steps,
346
- durationMs: Date.now() - startedAt,
347
- };
348
- }
349
- const revListStep = await runStep(step("git rev-list", ["git", "-C", gitRoot, "rev-list", `--max-count=${PREFLIGHT_MAX_COMMITS}`, upstreamSha], gitRoot));
350
- steps.push(revListStep);
351
- if (revListStep.exitCode !== 0) {
352
- return {
353
- status: "error",
354
- mode: "git",
355
- root: gitRoot,
356
- reason: "preflight-revlist-failed",
357
- before: { sha: beforeSha, version: beforeVersion },
358
- steps,
359
- durationMs: Date.now() - startedAt,
360
- };
361
- }
362
- const candidates = (revListStep.stdoutTail ?? "")
363
- .split("\n")
364
- .map((line) => line.trim())
365
- .filter(Boolean);
366
- if (candidates.length === 0) {
367
- return {
368
- status: "error",
369
- mode: "git",
370
- root: gitRoot,
371
- reason: "preflight-no-candidates",
372
- before: { sha: beforeSha, version: beforeVersion },
373
- steps,
374
- durationMs: Date.now() - startedAt,
375
- };
376
- }
377
- const manager = await detectPackageManager(gitRoot);
378
- const preflightRoot = await fs.mkdtemp(path.join(os.tmpdir(), "taskmaster-update-preflight-"));
379
- const worktreeDir = path.join(preflightRoot, "worktree");
380
- const worktreeStep = await runStep(step("preflight worktree", ["git", "-C", gitRoot, "worktree", "add", "--detach", worktreeDir, upstreamSha], gitRoot));
381
- steps.push(worktreeStep);
382
- if (worktreeStep.exitCode !== 0) {
383
- await fs.rm(preflightRoot, { recursive: true, force: true }).catch(() => { });
384
- return {
385
- status: "error",
386
- mode: "git",
387
- root: gitRoot,
388
- reason: "preflight-worktree-failed",
389
- before: { sha: beforeSha, version: beforeVersion },
390
- steps,
391
- durationMs: Date.now() - startedAt,
392
- };
393
- }
394
- let selectedSha = null;
395
- try {
396
- for (const sha of candidates) {
397
- const shortSha = sha.slice(0, 8);
398
- const checkoutStep = await runStep(step(`preflight checkout (${shortSha})`, ["git", "-C", worktreeDir, "checkout", "--detach", sha], worktreeDir));
399
- steps.push(checkoutStep);
400
- if (checkoutStep.exitCode !== 0)
401
- continue;
402
- const depsStep = await runStep(step(`preflight deps install (${shortSha})`, managerInstallArgs(manager), worktreeDir));
403
- steps.push(depsStep);
404
- if (depsStep.exitCode !== 0)
405
- continue;
406
- const lintStep = await runStep(step(`preflight lint (${shortSha})`, managerScriptArgs(manager, "lint"), worktreeDir));
407
- steps.push(lintStep);
408
- if (lintStep.exitCode !== 0)
409
- continue;
410
- const buildStep = await runStep(step(`preflight build (${shortSha})`, managerScriptArgs(manager, "build"), worktreeDir));
411
- steps.push(buildStep);
412
- if (buildStep.exitCode !== 0)
413
- continue;
414
- selectedSha = sha;
415
- break;
416
- }
417
- }
418
- finally {
419
- const removeStep = await runStep(step("preflight cleanup", ["git", "-C", gitRoot, "worktree", "remove", "--force", worktreeDir], gitRoot));
420
- steps.push(removeStep);
421
- await runCommand(["git", "-C", gitRoot, "worktree", "prune"], {
422
- cwd: gitRoot,
423
- timeoutMs,
424
- }).catch(() => null);
425
- await fs.rm(preflightRoot, { recursive: true, force: true }).catch(() => { });
426
- }
427
- if (!selectedSha) {
428
- return {
429
- status: "error",
430
- mode: "git",
431
- root: gitRoot,
432
- reason: "preflight-no-good-commit",
433
- before: { sha: beforeSha, version: beforeVersion },
434
- steps,
435
- durationMs: Date.now() - startedAt,
436
- };
437
- }
438
- const rebaseStep = await runStep(step("git rebase", ["git", "-C", gitRoot, "rebase", selectedSha], gitRoot));
336
+ const rebaseStep = await runStep(step("git rebase", ["git", "-C", gitRoot, "rebase", "@{upstream}"], gitRoot));
439
337
  steps.push(rebaseStep);
440
338
  if (rebaseStep.exitCode !== 0) {
441
339
  const abortResult = await runCommand(["git", "-C", gitRoot, "rebase", "--abort"], {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rubytech/taskmaster",
3
- "version": "1.0.23",
3
+ "version": "1.0.25",
4
4
  "description": "AI-powered business assistant for small businesses",
5
5
  "publishConfig": {
6
6
  "access": "public"