@phnx-labs/agents-cli 1.23.28 → 1.23.30

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.
Files changed (171) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/README.md +33 -82
  3. package/dist/bootstrap.js +0 -17
  4. package/dist/cli/command-registry.js +0 -2
  5. package/dist/commands/cloud.js +0 -58
  6. package/dist/commands/config.js +0 -4
  7. package/dist/commands/daemon-index.js +1 -1
  8. package/dist/commands/daemon.js +14 -63
  9. package/dist/commands/doctor.js +0 -12
  10. package/dist/commands/events.js +1 -1
  11. package/dist/commands/feed.d.ts +1 -3
  12. package/dist/commands/feed.js +1 -6
  13. package/dist/commands/fleet-capture.js +2 -4
  14. package/dist/commands/focus.d.ts +0 -1
  15. package/dist/commands/focus.js +2 -4
  16. package/dist/commands/inspect.d.ts +1 -19
  17. package/dist/commands/inspect.js +8 -474
  18. package/dist/commands/mine.js +1 -1
  19. package/dist/commands/prune.js +2 -64
  20. package/dist/commands/ps-roster.d.ts +0 -4
  21. package/dist/commands/ps-roster.js +2 -30
  22. package/dist/commands/ps.js +1 -4
  23. package/dist/commands/repo.d.ts +1 -1
  24. package/dist/commands/repo.js +4 -4
  25. package/dist/commands/sessions-browser.d.ts +0 -2
  26. package/dist/commands/sessions-browser.js +2 -32
  27. package/dist/commands/sessions-optimize.js +3 -4
  28. package/dist/commands/setup-mine.js +0 -1
  29. package/dist/commands/ssh.js +8 -9
  30. package/dist/commands/sync.js +1 -1
  31. package/dist/commands/update.js +2 -2
  32. package/dist/commands/watchdog.js +3 -4
  33. package/dist/lib/accounting/rotate.d.ts +0 -2
  34. package/dist/lib/accounting/rotate.js +1 -4
  35. package/dist/lib/agent-spec/agents.d.ts +0 -1
  36. package/dist/lib/agent-spec/agents.js +0 -8
  37. package/dist/lib/answer-router.d.ts +1 -1
  38. package/dist/lib/answer-router.js +9 -10
  39. package/dist/lib/auth-health.d.ts +0 -1
  40. package/dist/lib/auth-health.js +0 -3
  41. package/dist/lib/cli-entry.d.ts +0 -1
  42. package/dist/lib/cli-entry.js +0 -36
  43. package/dist/lib/cloud/types.d.ts +0 -2
  44. package/dist/lib/config-keys.d.ts +1 -1
  45. package/dist/lib/config-keys.js +1 -4
  46. package/dist/lib/daemon/daemon.d.ts +0 -4
  47. package/dist/lib/daemon/daemon.js +6 -202
  48. package/dist/lib/daemon/heartbeat-service.d.ts +1 -1
  49. package/dist/lib/daemon/heartbeat-service.js +1 -8
  50. package/dist/lib/daemon-services.d.ts +1 -1
  51. package/dist/lib/daemon-services.js +1 -11
  52. package/dist/lib/device-config.d.ts +0 -2
  53. package/dist/lib/device-config.js +4 -22
  54. package/dist/lib/devices/config-migration.js +1 -3
  55. package/dist/lib/exec.d.ts +2 -5
  56. package/dist/lib/exec.js +18 -18
  57. package/dist/lib/factory/snapshot.d.ts +0 -5
  58. package/dist/lib/factory/snapshot.js +1 -28
  59. package/dist/lib/feed/events.d.ts +1 -11
  60. package/dist/lib/feed/events.js +0 -20
  61. package/dist/lib/feed/feed.d.ts +1 -3
  62. package/dist/lib/feed/feed.js +18 -1
  63. package/dist/lib/feed-outcome.d.ts +0 -2
  64. package/dist/lib/feed-outcome.js +0 -5
  65. package/dist/lib/fleet/capture.d.ts +0 -1
  66. package/dist/lib/fleet/capture.js +0 -3
  67. package/dist/lib/fleet/manifest.js +0 -6
  68. package/dist/lib/fleet/types.d.ts +0 -1
  69. package/dist/lib/harness/adapter.d.ts +0 -7
  70. package/dist/lib/harness/adapters/claude.js +0 -18
  71. package/dist/lib/harness/adapters/codex.js +0 -10
  72. package/dist/lib/harness/adapters/cursor.js +0 -11
  73. package/dist/lib/harness/adapters/kimi.js +0 -3
  74. package/dist/lib/harness/adapters/muse.js +0 -11
  75. package/dist/lib/harness/index.d.ts +1 -1
  76. package/dist/lib/harness/index.js +0 -2
  77. package/dist/lib/hosts/passthrough.js +2 -10
  78. package/dist/lib/hosts/ready.d.ts +0 -4
  79. package/dist/lib/hosts/ready.js +0 -9
  80. package/dist/lib/hosts/reconcile.d.ts +0 -1
  81. package/dist/lib/hosts/reconcile.js +0 -8
  82. package/dist/lib/installations/migrate.d.ts +0 -2
  83. package/dist/lib/installations/migrate.js +0 -145
  84. package/dist/lib/loop.js +1 -2
  85. package/dist/lib/menubar/snapshot.d.ts +0 -1
  86. package/dist/lib/menubar/snapshot.js +1 -4
  87. package/dist/lib/placement.d.ts +1 -2
  88. package/dist/lib/placement.js +4 -24
  89. package/dist/lib/profiles.d.ts +0 -1
  90. package/dist/lib/profiles.js +0 -6
  91. package/dist/lib/session/active.d.ts +4 -3
  92. package/dist/lib/session/active.js +3 -4
  93. package/dist/lib/session/db.d.ts +7 -5
  94. package/dist/lib/session/db.js +11 -14
  95. package/dist/lib/session/discover.d.ts +3 -2
  96. package/dist/lib/session/discover.js +12 -129
  97. package/dist/lib/session/live-metadata.js +0 -2
  98. package/dist/lib/session/presentation.d.ts +0 -1
  99. package/dist/lib/session/presentation.js +3 -8
  100. package/dist/lib/session/selection.d.ts +0 -2
  101. package/dist/lib/session/selection.js +2 -12
  102. package/dist/lib/session/session-cache.d.ts +2 -1
  103. package/dist/lib/session/session-cache.js +1 -0
  104. package/dist/lib/session/title.d.ts +10 -0
  105. package/dist/lib/session/title.js +9 -0
  106. package/dist/lib/staleness/detectors/commands.d.ts +1 -1
  107. package/dist/lib/staleness/detectors/hooks.d.ts +1 -1
  108. package/dist/lib/staleness/detectors/mcp.d.ts +1 -1
  109. package/dist/lib/staleness/detectors/permissions.d.ts +1 -1
  110. package/dist/lib/staleness/detectors/plugins.d.ts +1 -1
  111. package/dist/lib/staleness/detectors/rules.d.ts +1 -1
  112. package/dist/lib/staleness/detectors/skills.d.ts +1 -1
  113. package/dist/lib/staleness/detectors/subagents.d.ts +1 -1
  114. package/dist/lib/staleness/detectors/workflows.d.ts +1 -1
  115. package/dist/lib/staleness/writers/commands.d.ts +1 -1
  116. package/dist/lib/staleness/writers/hooks.d.ts +1 -1
  117. package/dist/lib/staleness/writers/mcp.d.ts +1 -1
  118. package/dist/lib/staleness/writers/permissions.d.ts +1 -1
  119. package/dist/lib/staleness/writers/plugins.d.ts +1 -1
  120. package/dist/lib/staleness/writers/rules.d.ts +1 -1
  121. package/dist/lib/staleness/writers/skills.d.ts +1 -1
  122. package/dist/lib/staleness/writers/subagents.d.ts +1 -1
  123. package/dist/lib/staleness/writers/workflows.d.ts +1 -1
  124. package/dist/lib/startup/command-registry.js +5 -2
  125. package/dist/lib/state.d.ts +0 -3
  126. package/dist/lib/state.js +2 -25
  127. package/dist/lib/types.d.ts +0 -1
  128. package/dist/lib/watchdog/runner.d.ts +0 -2
  129. package/dist/lib/watchdog/runner.js +0 -2
  130. package/package.json +2 -2
  131. package/scripts/postinstall.js +2 -2
  132. package/dist/commands/routines.d.ts +0 -14
  133. package/dist/commands/routines.js +0 -2149
  134. package/dist/commands/routines.test-fixture.d.ts +0 -52
  135. package/dist/commands/routines.test-fixture.js +0 -254
  136. package/dist/lib/catchup.d.ts +0 -19
  137. package/dist/lib/catchup.js +0 -83
  138. package/dist/lib/daemon/catchup-service.d.ts +0 -18
  139. package/dist/lib/daemon/catchup-service.js +0 -21
  140. package/dist/lib/daemon/runner.d.ts +0 -91
  141. package/dist/lib/daemon/runner.js +0 -1927
  142. package/dist/lib/harness/adapters/droid.d.ts +0 -2
  143. package/dist/lib/harness/adapters/droid.js +0 -14
  144. package/dist/lib/overdue.d.ts +0 -9
  145. package/dist/lib/overdue.js +0 -74
  146. package/dist/lib/routine-activation.d.ts +0 -13
  147. package/dist/lib/routine-activation.js +0 -117
  148. package/dist/lib/routine-context.d.ts +0 -59
  149. package/dist/lib/routine-context.js +0 -181
  150. package/dist/lib/routine-notify-owner.d.ts +0 -4
  151. package/dist/lib/routine-notify-owner.js +0 -49
  152. package/dist/lib/routine-notify.d.ts +0 -17
  153. package/dist/lib/routine-notify.js +0 -138
  154. package/dist/lib/routine-process-cleanup.d.ts +0 -9
  155. package/dist/lib/routine-process-cleanup.js +0 -81
  156. package/dist/lib/routine-readiness.d.ts +0 -31
  157. package/dist/lib/routine-readiness.js +0 -256
  158. package/dist/lib/routines-format.d.ts +0 -7
  159. package/dist/lib/routines-format.js +0 -127
  160. package/dist/lib/routines-placement.d.ts +0 -16
  161. package/dist/lib/routines-placement.js +0 -60
  162. package/dist/lib/routines-project.d.ts +0 -49
  163. package/dist/lib/routines-project.js +0 -306
  164. package/dist/lib/sandbox.d.ts +0 -15
  165. package/dist/lib/sandbox.js +0 -309
  166. package/dist/lib/scheduler.d.ts +0 -23
  167. package/dist/lib/scheduler.js +0 -106
  168. package/dist/lib/scheduling/routines.d.ts +0 -264
  169. package/dist/lib/scheduling/routines.js +0 -1292
  170. package/dist/lib/triggers/webhook.d.ts +0 -26
  171. package/dist/lib/triggers/webhook.js +0 -181
@@ -1,5 +1,4 @@
1
1
  import chalk from 'chalk';
2
- import { formatBytes } from '../lib/format.js';
3
2
  import { confirm } from '@inquirer/prompts';
4
3
  import { diffVersionCommands, iterCommandsCapableVersions, removeCommandFromVersion, } from '../lib/commands.js';
5
4
  import { diffVersionSkills, iterSkillsCapableVersions, removeSkillFromVersion, } from '../lib/plugins/skills.js';
@@ -10,10 +9,9 @@ import { getGlobalDefault } from '../lib/installations/versions.js';
10
9
  import { resolveAgentName, formatAgentError } from '../lib/agents.js';
11
10
  import { pruneDuplicates } from './view.js';
12
11
  import { isInteractiveTerminal, isPromptCancelled } from './utils.js';
13
- import { previewRunsPrune, pruneRuns, countAllRuns } from '../lib/scheduling/routines.js';
14
12
  import { registerPruneTrashCommands } from './prune-trash.js';
15
13
  const RESOURCE_TYPES = ['commands', 'skills', 'hooks', 'plugins', 'subagents'];
16
- const STATE_TYPES = ['sessions', 'runs'];
14
+ const STATE_TYPES = ['sessions'];
17
15
  const ALL_TYPES = [...RESOURCE_TYPES, 'versions', ...STATE_TYPES];
18
16
  function scopePairs(pairs, all) {
19
17
  if (all)
@@ -108,55 +106,6 @@ async function runSessionsPrune(options) {
108
106
  console.log(chalk.yellow('Session history is durable. agents-cli does not hard-delete session records.'));
109
107
  console.log(chalk.gray('Browse sessions with: sessions'));
110
108
  }
111
- async function runRunsPrune(options) {
112
- const keep = options.keep ? parseInt(options.keep, 10) : 10;
113
- if (isNaN(keep) || keep < 0) {
114
- console.log(chalk.red('--keep must be a non-negative integer'));
115
- process.exit(1);
116
- }
117
- const preview = previewRunsPrune(keep);
118
- const total = countAllRuns();
119
- if (preview.length === 0) {
120
- console.log(chalk.green(`All jobs have ${keep} or fewer runs. Nothing to prune.`));
121
- return;
122
- }
123
- console.log(chalk.bold(`Routine runs to prune (keeping last ${keep} per job)\n`));
124
- const byJob = new Map();
125
- for (const run of preview) {
126
- byJob.set(run.jobName, (byJob.get(run.jobName) || 0) + 1);
127
- }
128
- for (const [job, count] of byJob) {
129
- console.log(` ${chalk.cyan(job)}: ${count} old runs`);
130
- }
131
- console.log();
132
- if (options.dryRun) {
133
- console.log(chalk.gray(`${preview.length} of ${total} runs would be deleted. Run without --dry-run to delete.`));
134
- return;
135
- }
136
- if (!options.yes) {
137
- if (!isInteractiveTerminal()) {
138
- console.log(chalk.yellow('Non-interactive shell: pass -y to confirm, or --dry-run to preview.'));
139
- process.exit(1);
140
- }
141
- let ok = false;
142
- try {
143
- ok = await confirm({ message: `Delete ${preview.length} old runs?`, default: false });
144
- }
145
- catch (err) {
146
- if (isPromptCancelled(err)) {
147
- console.log(chalk.gray('Cancelled'));
148
- return;
149
- }
150
- throw err;
151
- }
152
- if (!ok) {
153
- console.log(chalk.gray('Cancelled'));
154
- return;
155
- }
156
- }
157
- const { deleted, bytesFreed } = pruneRuns(keep);
158
- console.log(chalk.green(`Pruned ${deleted} runs (${formatBytes(bytesFreed)}).`));
159
- }
160
109
  async function runOrphanPrune(resourceTypes, options) {
161
110
  const groups = collectOrphans(resourceTypes, options.all === true);
162
111
  if (groups.length === 0) {
@@ -221,12 +170,11 @@ export function registerPruneCommand(program) {
221
170
  .description('Uninstall agent CLI versions. Moves version data to trash for recovery.');
222
171
  pruneCmd
223
172
  .command('cleanup [target]')
224
- .description('Remove orphan resources, old versions, or routine runs')
173
+ .description('Remove orphan resources or old versions')
225
174
  .option('--all', 'For orphan cleanup: sweep every installed version (default: current default version per agent)')
226
175
  .option('--dry-run', 'Show what would be removed without deleting (default for state targets)')
227
176
  .option('-y, --yes', 'Skip confirmation prompt')
228
177
  .option('--older-than <days>', 'Deprecated for sessions; accepted but no data is deleted')
229
- .option('--keep <n>', 'For runs: keep the last N runs per job (default: 10)')
230
178
  .addHelpText('after', `
231
179
  Targets:
232
180
  (none) Orphans across commands, skills, hooks + duplicate versions
@@ -236,7 +184,6 @@ Targets:
236
184
  versions Older duplicate version installs only
237
185
  <agent> Older duplicate versions for one agent (e.g. 'claude')
238
186
  sessions No-op compatibility target; session history is durable
239
- runs Routine execution logs, keeping only --keep per job (default 10)
240
187
 
241
188
  Examples:
242
189
  # Full sweep: orphan resources + duplicate versions for current defaults
@@ -260,12 +207,6 @@ Examples:
260
207
  # Show the durable-session notice
261
208
  agents prune cleanup sessions --dry-run
262
209
 
263
- # Preview runs cleanup (keeping last 10)
264
- agents prune cleanup runs --dry-run
265
-
266
- # Keep only the last 5 runs per job
267
- agents prune cleanup runs --keep 5 -y
268
-
269
210
  What's an orphan?
270
211
  A command, skill, or hook present inside a version home but missing from every
271
212
  configured source (project .agents/, central ~/.agents/, and any enabled extra
@@ -285,9 +226,6 @@ Durability:
285
226
  case 'sessions':
286
227
  await runSessionsPrune(options);
287
228
  break;
288
- case 'runs':
289
- await runRunsPrune(options);
290
- break;
291
229
  }
292
230
  return;
293
231
  }
@@ -42,14 +42,11 @@ export declare function renderActiveSessions(asJson: boolean, waitingOnly?: bool
42
42
  hosts?: string[];
43
43
  bookmarksOnly?: boolean;
44
44
  statuses?: LiveStatusFilter[];
45
- routine?: boolean | string;
46
45
  includeLead?: boolean;
47
46
  }): Promise<void>;
48
- export declare function filterActiveSessionsByRoutine(sessions: ActiveSession[], routine: boolean | string | undefined): ActiveSession[];
49
47
  export type LiveStatusFilter = 'working' | 'idle' | 'waiting' | 'orphaned' | 'crashed' | 'closed' | 'abandoned' | 'queued' | 'unknown';
50
48
  export declare function matchesLiveStatus(session: ActiveSession, status: LiveStatusFilter): boolean;
51
49
  export declare function requestedLiveStatuses(options: LiveStatusFlags): LiveStatusFilter[];
52
- export declare function resolveRoutineName(query: string, names: readonly string[]): string | null;
53
50
  export interface LiveRosterOptions extends LiveStatusFlags {
54
51
  json?: boolean;
55
52
  interactive?: boolean;
@@ -61,7 +58,6 @@ export interface LiveRosterOptions extends LiveStatusFlags {
61
58
  until?: string;
62
59
  all?: boolean;
63
60
  bookmarks?: boolean;
64
- routine?: boolean | string;
65
61
  project?: string;
66
62
  includeLead?: boolean;
67
63
  sort?: string;
@@ -10,7 +10,6 @@ import { machineId, normalizeHost } from '../lib/session/sync/config.js';
10
10
  import { stringWidth, truncateToWidth, padToWidth, terminalWidth } from '../lib/session/width.js';
11
11
  import { formatCompactAge } from '../lib/session/relative-time.js';
12
12
  import { colorAgent } from '../lib/agents.js';
13
- import { fuzzyMatch, FUZZY_PRESETS } from '../lib/fuzzy.js';
14
13
  import { listBookmarks } from '../lib/session/bookmarks.js';
15
14
  import { cleanPreview, formatTodoCompact, isAwaitingUser, shortCwd, signalBadges, statusColor } from '../lib/session/presentation.js';
16
15
  import { githubRepoUrlFromCwd } from './sessions-picker.js';
@@ -400,10 +399,9 @@ export async function renderActiveSessions(asJson, waitingOnly = false, opts = {
400
399
  const merged = opts.bookmarksOnly
401
400
  ? gathered.sessions.filter((s) => !!s.sessionId && listBookmarks().has(s.sessionId))
402
401
  : gathered.sessions;
403
- const routineFiltered = filterActiveSessionsByRoutine(merged, opts.routine);
404
402
  const statusFiltered = opts.statuses?.length
405
- ? routineFiltered.filter((session) => opts.statuses.some((status) => matchesLiveStatus(session, status)))
406
- : routineFiltered.filter(isRunningLiveSession);
403
+ ? merged.filter((session) => opts.statuses.some((status) => matchesLiveStatus(session, status)))
404
+ : merged.filter(isRunningLiveSession);
407
405
  const sessions = statusFiltered;
408
406
  if (asJson) {
409
407
  await enrichTmuxLocators(sessions.filter(s => sessionProcessIsLocal(s, self)));
@@ -443,18 +441,6 @@ export async function renderActiveSessions(asJson, waitingOnly = false, opts = {
443
441
  if (waitingOnly && sessions.some(isAwaitingUser))
444
442
  process.exitCode = 1;
445
443
  }
446
- export function filterActiveSessionsByRoutine(sessions, routine) {
447
- if (!routine)
448
- return sessions;
449
- const routineSessions = sessions.filter((session) => session.origin === 'routine' || !!session.routineName);
450
- if (typeof routine !== 'string')
451
- return routineSessions;
452
- const names = [...new Set(routineSessions.map((session) => session.routineName).filter((name) => !!name))];
453
- const selected = resolveRoutineName(routine, names);
454
- return selected
455
- ? routineSessions.filter((session) => session.routineName === selected)
456
- : [];
457
- }
458
444
  export function matchesLiveStatus(session, status) {
459
445
  if (status === 'working')
460
446
  return session.activity === 'working' || (!session.activity && session.status === 'running');
@@ -487,18 +473,6 @@ export function requestedLiveStatuses(options) {
487
473
  function printCrossMachineTip() {
488
474
  console.log(chalk.gray("\nTip: include sessions from your other machines — register them with 'ag devices sync', then rerun. Use --local to skip."));
489
475
  }
490
- export function resolveRoutineName(query, names) {
491
- const normalized = query.trim().toLowerCase();
492
- if (!normalized)
493
- return null;
494
- const exact = names.find((name) => name.toLowerCase() === normalized);
495
- if (exact)
496
- return exact;
497
- const containing = names.filter((name) => name.toLowerCase().includes(normalized));
498
- if (containing.length === 1)
499
- return containing[0];
500
- return fuzzyMatch(query, names, FUZZY_PRESETS.dynamic);
501
- }
502
476
  export async function runLiveRoster(options) {
503
477
  const liveStatuses = requestedLiveStatuses(options);
504
478
  const hosts = options.host;
@@ -518,7 +492,6 @@ export async function runLiveRoster(options) {
518
492
  since: options.since,
519
493
  all: options.all,
520
494
  bookmarks: options.bookmarks,
521
- routine: options.routine,
522
495
  }), { local: options.local === true, hosts });
523
496
  return;
524
497
  }
@@ -528,7 +501,6 @@ export async function runLiveRoster(options) {
528
501
  hosts,
529
502
  bookmarksOnly: options.bookmarks === true,
530
503
  statuses: liveStatuses,
531
- routine: options.routine,
532
504
  includeLead: options.includeLead === true,
533
505
  });
534
506
  }
@@ -55,7 +55,6 @@ export function registerPsCommand(program) {
55
55
  .option('-D, --device <target...>', 'Only these devices (alias from `agents devices`, user@host, or `all`; repeatable)')
56
56
  .option('--status <state...>', `Only these live states: ${PS_STATUSES.join(', ')} (repeatable or comma-separated)`)
57
57
  .option('--bookmarks', 'Only bookmarked sessions (bookmark one with `sessions bookmark <id>`)')
58
- .option('--routines, --routine [name]', 'Only routine-run sessions; pass a name to narrow to one routine (fuzzy name matching)')
59
58
  .option('--no-interactive', 'Print the roster instead of opening the picker on a TTY')
60
59
  .option('--include-lead', 'Also list project Lead sessions (agents lead), which are hidden by default');
61
60
  setHelpSections(ps, {
@@ -72,9 +71,8 @@ export function registerPsCommand(program) {
72
71
  # Only agents waiting on you (exits 1 when any are waiting)
73
72
  agents ps --status waiting
74
73
 
75
- # Only bookmarked sessions, or the runs of one routine
74
+ # Only bookmarked sessions
76
75
  agents ps --bookmarks
77
- agents ps --routine nightly-review
78
76
 
79
77
  # Act on one row by its 8-character id
80
78
  agents ps focus 4b2f1a9c
@@ -115,7 +113,6 @@ export function registerPsCommand(program) {
115
113
  host: deviceScope(opts.device),
116
114
  interactive: opts.interactive,
117
115
  bookmarks: opts.bookmarks,
118
- routine: opts.routine,
119
116
  includeLead: opts.includeLead,
120
117
  });
121
118
  });
@@ -1,5 +1,5 @@
1
1
  import type { Command } from 'commander';
2
- type RepoResourceKind = 'skill' | 'command' | 'plugin' | 'hook' | 'mcp' | 'subagent' | 'rule' | 'workflow' | 'routine' | 'profile' | 'permission' | 'clis' | 'config' | 'other';
2
+ type RepoResourceKind = 'skill' | 'command' | 'plugin' | 'hook' | 'mcp' | 'subagent' | 'rule' | 'workflow' | 'profile' | 'permission' | 'clis' | 'config' | 'other';
3
3
  export type ChangeAction = 'new' | 'changed' | 'removed';
4
4
  export declare function resourceUnit(file: string): {
5
5
  kind: RepoResourceKind;
@@ -67,21 +67,21 @@ function deriveAlias(source) {
67
67
  const RESOURCE_DIRS = {
68
68
  skills: 'skill', commands: 'command', prompts: 'command', plugins: 'plugin',
69
69
  hooks: 'hook', mcp: 'mcp', subagents: 'subagent', rules: 'rule',
70
- workflows: 'workflow', routines: 'routine', profiles: 'profile',
70
+ workflows: 'workflow', profiles: 'profile',
71
71
  permissions: 'permission', clis: 'clis',
72
72
  };
73
73
  const RESOURCE_LABELS = {
74
74
  skill: ['skill', 'skills'], command: ['command', 'commands'],
75
75
  plugin: ['plugin', 'plugins'], hook: ['hook', 'hooks'], mcp: ['MCP', 'MCPs'],
76
76
  subagent: ['subagent', 'subagents'], rule: ['rule', 'rules'],
77
- workflow: ['workflow', 'workflows'], routine: ['routine', 'routines'],
77
+ workflow: ['workflow', 'workflows'],
78
78
  profile: ['profile', 'profiles'], permission: ['permission', 'permissions'],
79
79
  clis: ['CLI', 'CLIs'], config: ['config file', 'config files'],
80
80
  other: ['other file', 'other files'],
81
81
  };
82
82
  const RESOURCE_ORDER = [
83
83
  'skill', 'command', 'plugin', 'hook', 'mcp', 'subagent', 'rule',
84
- 'workflow', 'routine', 'profile', 'permission', 'clis', 'config', 'other',
84
+ 'workflow', 'profile', 'permission', 'clis', 'config', 'other',
85
85
  ];
86
86
  export function resourceUnit(file) {
87
87
  const parts = file.split('/');
@@ -880,7 +880,7 @@ export function registerRepoCommands(program) {
880
880
  if (anyPulled) {
881
881
  const { isDaemonRunning, signalDaemonReload } = await import('../lib/daemon/daemon.js');
882
882
  if (isDaemonRunning() && signalDaemonReload()) {
883
- console.log(chalk.gray('Reloaded the routines daemon (device pins refreshed).'));
883
+ console.log(chalk.gray('Reloaded the daemon (service config refreshed).'));
884
884
  }
885
885
  }
886
886
  if (userPulled) {
@@ -13,7 +13,6 @@ export interface BrowserFilter {
13
13
  statuses: LiveStatusFilter[];
14
14
  project?: string;
15
15
  until?: string;
16
- routine: boolean | string;
17
16
  skill?: string;
18
17
  plugin?: string;
19
18
  limit: number;
@@ -32,7 +31,6 @@ export declare function activeBrowserSeed(opts: {
32
31
  since?: string;
33
32
  all?: boolean;
34
33
  bookmarks?: boolean;
35
- routine?: boolean | string;
36
34
  }): Partial<BrowserFilter>;
37
35
  export declare function remotePoolArgs(f: BrowserFilter, fixedFilters: boolean): string[];
38
36
  export declare function liveRowKey(a: ActiveSession, self: string): string;
@@ -14,7 +14,7 @@ import { buildPreview, setRemotePreviewRepaint, LIVE_ROW_PREFIX, handlePickedSes
14
14
  import { gatherActiveSessions, isRunningLiveSession } from '../lib/session/active.js';
15
15
  import { cleanPreview, formatPickerLabel, pickerColumnsFor, liveHostLabel, formatLiveStatusHeadline } from '../lib/session/presentation.js';
16
16
  import { matchesTeam, mergeLocalFirst, parseAgentFilter, sessionMatchesQuery } from '../lib/session/selection.js';
17
- import { matchesLiveStatus, resolveRoutineName } from './ps-roster.js';
17
+ import { matchesLiveStatus } from './ps-roster.js';
18
18
  export function buildInitialFilter(initial) {
19
19
  return {
20
20
  running: initial.running ?? false,
@@ -28,7 +28,6 @@ export function buildInitialFilter(initial) {
28
28
  statuses: initial.statuses ?? [],
29
29
  project: initial.project,
30
30
  until: initial.until,
31
- routine: initial.routine ?? false,
32
31
  skill: initial.skill,
33
32
  plugin: initial.plugin,
34
33
  limit: initial.limit ?? 500,
@@ -40,7 +39,7 @@ function poolCacheKey(f) {
40
39
  const versionScoped = f.agent?.includes('@') ? f.agent : '';
41
40
  return [
42
41
  f.window ?? 'all', f.until ?? '', f.teams, f.team ? 'team' : '', versionScoped,
43
- f.project ?? '', f.routine, f.skill ?? '', f.plugin ?? '', f.limit, f.unmanaged, f.sort,
42
+ f.project ?? '', f.skill ?? '', f.plugin ?? '', f.limit, f.unmanaged, f.sort,
44
43
  ].join('|');
45
44
  }
46
45
  const WHOLE_TEAM_POOL_LIMIT = 5000;
@@ -68,11 +67,6 @@ export function browserFilterToArgv(f, query = '') {
68
67
  live.push('-D', f.device);
69
68
  if (f.bookmarks)
70
69
  live.push('--bookmarks');
71
- if (f.routine) {
72
- live.push('--routine');
73
- if (typeof f.routine === 'string')
74
- live.push(f.routine);
75
- }
76
70
  return live;
77
71
  }
78
72
  const a = ['sessions'];
@@ -94,11 +88,6 @@ export function browserFilterToArgv(f, query = '') {
94
88
  a.push('--until', f.until);
95
89
  if (f.project)
96
90
  a.push('--project', f.project);
97
- if (f.routine) {
98
- a.push('--routine');
99
- if (typeof f.routine === 'string')
100
- a.push(f.routine);
101
- }
102
91
  if (f.skill)
103
92
  a.push('--skill', f.skill);
104
93
  if (f.plugin)
@@ -122,7 +111,6 @@ export function activeBrowserSeed(opts) {
122
111
  running: true,
123
112
  teams: !!opts.teams,
124
113
  bookmarks: !!opts.bookmarks,
125
- routine: opts.routine ?? false,
126
114
  agent: opts.agent,
127
115
  projectScope: 'all',
128
116
  device: normalizeDeviceSeed(opts.host?.[0]),
@@ -167,7 +155,6 @@ async function fetchRawPool(f, self, local, hosts, fixedFilters = false) {
167
155
  since,
168
156
  until: f.until,
169
157
  project: f.project,
170
- origin: f.routine ? 'routine' : undefined,
171
158
  skill: f.skill,
172
159
  plugin: f.plugin,
173
160
  excludeTeamOrigin: !shouldShowTeamSessions(f),
@@ -206,11 +193,6 @@ export function remotePoolArgs(f, fixedFilters) {
206
193
  forwarded.push('--until', f.until);
207
194
  if (f.project)
208
195
  forwarded.push('--project', f.project);
209
- if (f.routine) {
210
- forwarded.push('--routine');
211
- if (typeof f.routine === 'string')
212
- forwarded.push(f.routine);
213
- }
214
196
  if (f.skill)
215
197
  forwarded.push('--skill', f.skill);
216
198
  if (f.plugin)
@@ -260,8 +242,6 @@ export function liveSessionToMeta(a, self) {
260
242
  prNumber: a.pr?.number,
261
243
  ticketId: a.ticket?.id,
262
244
  worktreeSlug: a.worktree?.slug,
263
- origin: a.origin,
264
- routineName: a.routineName,
265
245
  };
266
246
  }
267
247
  export function mergeLiveIntoPool(rows, live, self, includeUnindexed = true) {
@@ -284,14 +264,6 @@ export function applyFilters(rows, live, f, self, bookmarks) {
284
264
  let out = rows;
285
265
  if (f.bookmarks)
286
266
  out = out.filter((r) => bookmarks.has(r.id));
287
- if (f.routine) {
288
- out = out.filter((r) => r.origin === 'routine' || !!r.routineName);
289
- if (typeof f.routine === 'string') {
290
- const routineNames = distinct(out.map((r) => r.routineName));
291
- const selected = resolveRoutineName(f.routine, routineNames);
292
- out = selected ? out.filter((r) => r.routineName === selected) : [];
293
- }
294
- }
295
267
  if (f.agent) {
296
268
  const { agent, version: rawVersion } = parseAgentFilter(f.agent);
297
269
  const localVersion = agent && agent in AGENTS
@@ -371,8 +343,6 @@ function headerFor(f) {
371
343
  bits.push('running');
372
344
  if (f.teams)
373
345
  bits.push('teams');
374
- if (f.routine)
375
- bits.push(`routine:${typeof f.routine === 'string' ? f.routine : 'all'}`);
376
346
  if (f.bookmarks)
377
347
  bits.push('bookmarks');
378
348
  return bits.join(' · ');
@@ -28,14 +28,13 @@ export function registerOptimizeCommand(parent, invocation) {
28
28
  # Machine-readable segment counts
29
29
  ${invocation} --json
30
30
 
31
- # Wire it to a weekly routine so the index never re-bloats
32
- agents routines add sessions-optimize --schedule "0 4 * * 0" --agent claude \\
33
- --prompt "Run: ${invocation}"
31
+ # Run it weekly from your crontab so the index never re-bloats
32
+ 0 4 * * 0 ${invocation}
34
33
  `,
35
34
  notes: `
36
35
  - FTS5 appends a segment on every insert and tombstones every delete; the scanner delete+inserts a session's docs on each rescan and never self-merges, so \`tool_call_text_data\` / \`session_text_data\` bloat with unmerged segments — GBs of index for tens of MB of content, and queries slow down.
37
36
  - This runs FTS5 \`'optimize'\`: it merges every segment into one and purges tombstones. Non-destructive — no searchable content is lost.
38
- - Reclaimed space becomes reusable free pages inside the DB file. To return it to the OS, use the operator lifecycle command \`agents daemon stop\`, run \`VACUUM\` against \`~/.agents/.history/sessions/sessions.db\`, then \`agents daemon start\`. \`agents routines stop\` disables only the scheduler service.
37
+ - Reclaimed space becomes reusable free pages inside the DB file. To return it to the OS, use the operator lifecycle command \`agents daemon stop\`, run \`VACUUM\` against \`~/.agents/.history/sessions/sessions.db\`, then \`agents daemon start\`.
39
38
  `,
40
39
  });
41
40
  }
@@ -9,7 +9,6 @@ const DISABLEABLE_FEATURES = [
9
9
  { name: 'browser', hint: 'automate a browser' },
10
10
  { name: 'computer', hint: 'drive native desktop apps' },
11
11
  { name: 'secrets', hint: 'keychain-backed env bundles' },
12
- { name: 'routines', hint: 'run agents on a cron schedule' },
13
12
  ];
14
13
  async function runMineWizard() {
15
14
  if (!isInteractiveTerminal()) {
@@ -773,7 +773,6 @@ function registerDevicesCommands(program) {
773
773
  Configure a device:
774
774
  agents devices config mac-mini # settings menu (TTY) / print (piped)
775
775
  agents devices config mac-mini agents.max-concurrent 4
776
- agents devices config mac-mini scheduler.enabled off
777
776
  agents devices config mac-mini notes "runs the releases"
778
777
  agents devices config win-mini ssh.auth password
779
778
  agents devices config worker ssh.identity-file ~/.ssh/worker_ed25519
@@ -1213,7 +1212,7 @@ function registerDevicesCommands(program) {
1213
1212
  };
1214
1213
  const configCmd = devicesCmd
1215
1214
  .command('config [name] [key] [value...]')
1216
- .description('Get, set, or unset a device’s settings (scheduler, agent cap, ssh overrides, auto-launch, notes). ' +
1215
+ .description('Get, set, or unset a device’s settings (agent cap, ssh overrides, auto-launch, notes). ' +
1217
1216
  'Bare opens an interactive settings menu (TTY) or prints the resolved config (piped). ' +
1218
1217
  'Per-device values live in the tracked devices/<name>/agents.yaml config: block; --fleet targets the ' +
1219
1218
  'fleet-wide defaults (central fleet.defaults.config) every device inherits unless it overrides the key.')
@@ -1241,10 +1240,10 @@ function registerDevicesCommands(program) {
1241
1240
  examples: `
1242
1241
  agents devices config mac-mini # settings menu (TTY) / print config (piped)
1243
1242
  agents devices config mac-mini agents.max-concurrent 4 # cap concurrent agents on mac-mini
1244
- agents devices config mac-mini scheduler.enabled off # no routines firing there
1245
- agents devices config mac-mini scheduler.enabled # read the effective value back
1246
- agents devices config mac-mini scheduler.enabled --unset # inherit the fleet default again
1247
- agents devices config --fleet scheduler.enabled off # fleet-wide default (all devices)
1243
+ agents devices config mac-mini watchdog.enabled on # nudge stalled sessions there
1244
+ agents devices config mac-mini watchdog.enabled # read the effective value back
1245
+ agents devices config mac-mini watchdog.enabled --unset # inherit the fleet default again
1246
+ agents devices config --fleet watchdog.enabled on # fleet-wide default (all devices)
1248
1247
  agents devices config --fleet agents.max-concurrent 2 # every box caps at 2 unless it overrides
1249
1248
  agents devices config --fleet # print the fleet defaults layer
1250
1249
  agents devices config mac-mini notes "runs the releases" # append an operator note
@@ -1261,7 +1260,7 @@ function registerDevicesCommands(program) {
1261
1260
  Keys: role (worker|personal), see 'agents devices role',
1262
1261
  description (one line saying what the box is for — see
1263
1262
  'agents devices describe'; renders in the devices list tail),
1264
- agents.max-concurrent, scheduler.enabled, daemon.enabled,
1263
+ agents.max-concurrent, daemon.enabled,
1265
1264
  watchdog.enabled, tmux.enabled, browser.remote-control,
1266
1265
  browser.task-idle-minutes, browser.profile,
1267
1266
  notes, ssh.user, ssh.auth (key|password), ssh.bundle, ssh.bundle-key,
@@ -1278,9 +1277,9 @@ function registerDevicesCommands(program) {
1278
1277
 
1279
1278
  Booleans take on/off (or true/false). 'notes' appends one entry per
1280
1279
  invocation. ssh.* / platform / user overlay the discovered registry
1281
- profile at dial time. scheduler.enabled / daemon.enabled take effect
1280
+ profile at dial time. daemon.enabled takes effect
1282
1281
  when the daemon reloads or restarts on that device. Machine-local keys
1283
- (scheduler.enabled, daemon.enabled, tmux.enabled, browser.remote-control,
1282
+ (daemon.enabled, tmux.enabled, browser.remote-control,
1284
1283
  browser.task-idle-minutes, browser.profile) can only be read or set on
1285
1284
  the device itself; --fleet still writes a fleet-wide default those boxes
1286
1285
  inherit until they override.
@@ -130,7 +130,7 @@ export function registerSyncCommand(program) {
130
130
  .option('--secrets', 'Umbrella: pull encrypted secret bundles from the remote', false)
131
131
  .option('--cloud', 'Umbrella: fetch all remote state but skip the local reconcile', false)
132
132
  .option('--local', "Umbrella: reconcile resources into installed agents only (no fetch)", false)
133
- .option('--prune-clis', 'Umbrella: also purge stale/legacy agents-cli installs (npx-cache, pre-1.22.30, unsafe helper) when a fixed peer exists. DESTRUCTIVE and off by default — the purge never runs on a routine sync.', false)
133
+ .option('--prune-clis', 'Umbrella: also purge stale/legacy agents-cli installs (npx-cache, pre-1.22.30, unsafe helper) when a fixed peer exists. DESTRUCTIVE and off by default — the purge never runs on an ordinary sync.', false)
134
134
  .option('--delete', 'Also remove what a repo deleted: trash plugins, commands and skills that came from that repo and no longer exist in it. Needs a repo (agents sync <repo> --delete); resources from other repos or installed by hand are kept', false)
135
135
  .action(async (agentSpec, repo, opts) => {
136
136
  await runSync(agentSpec, repo, opts);
@@ -73,7 +73,7 @@ function printOutcome(outcome, json) {
73
73
  return;
74
74
  }
75
75
  console.log(chalk.green(`Updated ${name}: release ${outcome.fromRelease} -> ${outcome.toRelease}`));
76
- console.log(chalk.gray(`Its name is unchanged, so every default, project pin, and routine that names ${name} still resolves to it.`));
76
+ console.log(chalk.gray(`Its name is unchanged, so every default, project pin, and profile that names ${name} still resolves to it.`));
77
77
  for (const other of outcome.alsoUpdated) {
78
78
  console.log(chalk.gray(` ${other.agent}@${other.label} shares the same binary and now also reports release ${other.releaseVersion}.`));
79
79
  }
@@ -270,7 +270,7 @@ agents update --check
270
270
  agents update claude --check --json
271
271
  agents update --auto`,
272
272
  notes: 'One managed installation per harness: a bare `<agent>` updates that installation, keeping its name and every '
273
- + 'reference to it. That is why a default, a project pin, a routine version, or a profile that names claude@main '
273
+ + 'reference to it. That is why a default, a project pin, or a profile that names claude@main '
274
274
  + 'keeps working after you update it. '
275
275
  + '`--to <release>` pins the installation to a concrete release (excluded from the automatic pass), `--to latest` '
276
276
  + 'unpins it. The legacy `agents update <agent>@<label>` selector still addresses a specific installation by its '
@@ -13,7 +13,7 @@ import { sessionHeadline } from '../lib/session/title.js';
13
13
  function stateDir() {
14
14
  return path.join(getRuntimeStateDir(), 'watchdog');
15
15
  }
16
- async function reloadDaemonForRoutine(startIfStopped) {
16
+ async function reloadDaemonForWatchdog(startIfStopped) {
17
17
  // Keep daemon dependencies off startup. If running, reload it; enable additionally starts it when stopped.
18
18
  const { isDaemonRunning, ensureDaemonStarted, signalDaemonReload } = await import('../lib/daemon/daemon.js');
19
19
  if (isDaemonRunning()) {
@@ -83,7 +83,6 @@ export function formatWatchdogTickLines(result, willInject, verbose = false) {
83
83
  o.machine ?? 'local',
84
84
  o.project ?? (o.cwd ? path.basename(o.cwd) : undefined),
85
85
  o.activity ?? o.status,
86
- o.origin === 'routine' ? `routine ${o.routineName ?? 'unknown'}` : undefined,
87
86
  o.owner ? `owner ${o.owner}` : undefined,
88
87
  o.startedAtMs ? `started ${elapsedLabel(result.atMs, o.startedAtMs)}` : undefined,
89
88
  o.lastActivityMs ? `activity ${elapsedLabel(result.atMs, o.lastActivityMs)}` : undefined,
@@ -240,12 +239,12 @@ export function registerWatchdogCommand(program) {
240
239
  });
241
240
  const turnOn = async () => {
242
241
  setConfigValue('watchdog.enabled', true);
243
- await reloadDaemonForRoutine(true);
242
+ await reloadDaemonForWatchdog(true);
244
243
  console.log(chalk.green('watchdog: ON on this device (every 3 minutes)'));
245
244
  };
246
245
  const turnOff = async () => {
247
246
  setConfigValue('watchdog.enabled', false);
248
- await reloadDaemonForRoutine(false);
247
+ await reloadDaemonForWatchdog(false);
249
248
  console.log(chalk.yellow('watchdog: OFF on this device'));
250
249
  };
251
250
  cmd.command('enable')
@@ -89,8 +89,6 @@ export declare function collectRunCandidates(agent: AgentId): Promise<RotateCand
89
89
  export declare function collectHarnessCandidates(agentIds?: AgentId[]): Promise<Map<AgentId, RotateCandidate[]>>;
90
90
  export declare function matchAccountCandidate(candidates: RotateCandidate[], account: string, preferredLabel?: string | null): RotateCandidate | null;
91
91
  export declare function matchAccountVersion(candidates: RotateCandidate[], account: string, preferredLabel?: string | null): string | null;
92
- export declare function resolveAccountCandidate(agent: AgentId, account: string, preferredLabel?: string | null): Promise<RotateCandidate | null>;
93
- export declare function resolveAccountVersion(agent: AgentId, account: string, preferredLabel?: string | null): Promise<string | null>;
94
92
  export declare function selectBalancedVersion(agent: AgentId): Promise<RotateResult | null>;
95
93
  export declare function buildRotationDecisionEvent(rotation: RotateResult, agent: AgentId, strategy: RunStrategy): EventPayload;
96
94
  export declare function resolveRunVersion(agent: AgentId, strategy: RunStrategy, cwd?: string, collect?: (agent: AgentId) => Promise<RotateCandidate[]>, model?: string): Promise<{
@@ -490,13 +490,10 @@ export function matchAccountCandidate(candidates, account, preferredLabel) {
490
490
  export function matchAccountVersion(candidates, account, preferredLabel) {
491
491
  return matchAccountCandidate(candidates, account, preferredLabel)?.version ?? null;
492
492
  }
493
- export async function resolveAccountCandidate(agent, account, preferredLabel) {
493
+ async function resolveAccountCandidate(agent, account, preferredLabel) {
494
494
  const candidates = await collectRunCandidates(agent);
495
495
  return matchAccountCandidate(candidates, account, preferredLabel);
496
496
  }
497
- export async function resolveAccountVersion(agent, account, preferredLabel) {
498
- return (await resolveAccountCandidate(agent, account, preferredLabel))?.version ?? null;
499
- }
500
497
  export async function selectBalancedVersion(agent) {
501
498
  return pickBalancedCandidate(await collectRunCandidates(agent));
502
499
  }
@@ -30,7 +30,6 @@ interface AgentRegistryConfig extends AgentConfig {
30
30
  }
31
31
  export declare const AGENTS: Record<AgentId, AgentRegistryConfig>;
32
32
  export declare const ALL_AGENT_IDS: AgentId[];
33
- export declare const ROUTINE_AGENT_IDS: readonly string[];
34
33
  export declare const MANAGED_AGENT_IDS: AgentId[];
35
34
  export declare function isSelfUpdatingAgent(agent: AgentId): boolean;
36
35
  export declare function isAgentHardDeprecated(agent: AgentId): boolean;
@@ -714,14 +714,6 @@ export const AGENTS = {
714
714
  },
715
715
  };
716
716
  export const ALL_AGENT_IDS = Object.keys(AGENTS);
717
- export const ROUTINE_AGENT_IDS = Object.freeze([
718
- 'claude',
719
- 'codex',
720
- 'cursor',
721
- 'kimi',
722
- 'droid',
723
- 'muse',
724
- ]);
725
717
  export const MANAGED_AGENT_IDS = ALL_AGENT_IDS.filter((id) => !AGENTS[id].deprecated?.hard);
726
718
  export function isSelfUpdatingAgent(agent) {
727
719
  const cfg = AGENTS[agent];
@@ -1,7 +1,7 @@
1
1
  import { type OpenBlock, type BlockOption } from './feed/feed.js';
2
2
  import type { ActiveSession } from './session/active.js';
3
3
  import type { InjectTarget } from './terminal/index.js';
4
- export type AnswerRouteKind = 'mailbox' | 'tmux' | 'iterm' | 'resume' | 'refuse';
4
+ export type AnswerRouteKind = 'mailbox' | 'tmux' | 'iterm' | 'vscodium' | 'resume' | 'refuse';
5
5
  export interface AnswerRoute {
6
6
  kind: AnswerRouteKind;
7
7
  reason: string;