@phnx-labs/agents-cli 1.19.2 → 1.20.3

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 (156) hide show
  1. package/CHANGELOG.md +140 -0
  2. package/README.md +72 -12
  3. package/dist/browser.js +0 -0
  4. package/dist/commands/browser.js +88 -16
  5. package/dist/commands/cli.d.ts +14 -0
  6. package/dist/commands/cli.js +244 -0
  7. package/dist/commands/cloud.js +1 -1
  8. package/dist/commands/commands.js +27 -10
  9. package/dist/commands/computer.js +18 -1
  10. package/dist/commands/doctor.d.ts +1 -1
  11. package/dist/commands/doctor.js +2 -2
  12. package/dist/commands/exec.js +38 -18
  13. package/dist/commands/factory.d.ts +3 -14
  14. package/dist/commands/factory.js +3 -3
  15. package/dist/commands/feedback.d.ts +7 -0
  16. package/dist/commands/feedback.js +89 -0
  17. package/dist/commands/helper.d.ts +12 -0
  18. package/dist/commands/helper.js +87 -0
  19. package/dist/commands/hooks.js +89 -10
  20. package/dist/commands/mcp.js +166 -10
  21. package/dist/commands/packages.js +196 -27
  22. package/dist/commands/permissions.js +21 -6
  23. package/dist/commands/plugins.js +11 -4
  24. package/dist/commands/profiles.d.ts +8 -0
  25. package/dist/commands/profiles.js +118 -5
  26. package/dist/commands/prune.js +39 -160
  27. package/dist/commands/pull.js +58 -5
  28. package/dist/commands/routines.js +107 -14
  29. package/dist/commands/rules.js +8 -4
  30. package/dist/commands/secrets-migrate.d.ts +24 -0
  31. package/dist/commands/secrets-migrate.js +198 -0
  32. package/dist/commands/secrets-sync.d.ts +11 -0
  33. package/dist/commands/secrets-sync.js +155 -0
  34. package/dist/commands/secrets.js +79 -46
  35. package/dist/commands/sessions.d.ts +28 -0
  36. package/dist/commands/sessions.js +98 -33
  37. package/dist/commands/setup.d.ts +1 -0
  38. package/dist/commands/setup.js +37 -28
  39. package/dist/commands/skills.js +25 -8
  40. package/dist/commands/subagents.js +69 -49
  41. package/dist/commands/teams.js +61 -10
  42. package/dist/commands/utils.d.ts +33 -0
  43. package/dist/commands/utils.js +139 -0
  44. package/dist/commands/versions.d.ts +4 -3
  45. package/dist/commands/versions.js +134 -130
  46. package/dist/commands/view.d.ts +6 -0
  47. package/dist/commands/view.js +175 -19
  48. package/dist/commands/workflows.js +29 -6
  49. package/dist/computer.js +0 -0
  50. package/dist/index.js +38 -6
  51. package/dist/lib/acp/client.js +6 -1
  52. package/dist/lib/acp/harnesses.js +8 -0
  53. package/dist/lib/agents.d.ts +4 -0
  54. package/dist/lib/agents.js +125 -34
  55. package/dist/lib/auto-pull-worker.js +18 -1
  56. package/dist/lib/browser/cdp.d.ts +8 -1
  57. package/dist/lib/browser/cdp.js +40 -3
  58. package/dist/lib/browser/chrome.d.ts +13 -0
  59. package/dist/lib/browser/chrome.js +46 -3
  60. package/dist/lib/browser/domain-skills.d.ts +51 -0
  61. package/dist/lib/browser/domain-skills.js +157 -0
  62. package/dist/lib/browser/drivers/local.js +45 -4
  63. package/dist/lib/browser/drivers/ssh.js +2 -2
  64. package/dist/lib/browser/ipc.d.ts +8 -1
  65. package/dist/lib/browser/ipc.js +37 -28
  66. package/dist/lib/browser/profiles.d.ts +16 -3
  67. package/dist/lib/browser/profiles.js +44 -4
  68. package/dist/lib/browser/service.d.ts +3 -0
  69. package/dist/lib/browser/service.js +40 -5
  70. package/dist/lib/browser/types.d.ts +11 -4
  71. package/dist/lib/cli-resources.d.ts +137 -0
  72. package/dist/lib/cli-resources.js +477 -0
  73. package/dist/lib/cloud/factory.d.ts +1 -1
  74. package/dist/lib/cloud/factory.js +1 -1
  75. package/dist/lib/cloud/rush.js +5 -5
  76. package/dist/lib/command-skills.js +0 -2
  77. package/dist/lib/computer-rpc.d.ts +3 -0
  78. package/dist/lib/computer-rpc.js +53 -0
  79. package/dist/lib/daemon.js +20 -0
  80. package/dist/lib/events.d.ts +16 -2
  81. package/dist/lib/events.js +33 -2
  82. package/dist/lib/exec.d.ts +42 -13
  83. package/dist/lib/exec.js +127 -33
  84. package/dist/lib/help.js +11 -5
  85. package/dist/lib/hooks/cache.d.ts +38 -0
  86. package/dist/lib/hooks/cache.js +242 -0
  87. package/dist/lib/hooks/profile.d.ts +33 -0
  88. package/dist/lib/hooks/profile.js +129 -0
  89. package/dist/lib/hooks.d.ts +0 -10
  90. package/dist/lib/hooks.js +246 -11
  91. package/dist/lib/mcp.d.ts +15 -0
  92. package/dist/lib/mcp.js +46 -0
  93. package/dist/lib/migrate.js +1 -1
  94. package/dist/lib/overdue.d.ts +26 -0
  95. package/dist/lib/overdue.js +101 -0
  96. package/dist/lib/permissions.d.ts +13 -0
  97. package/dist/lib/permissions.js +55 -1
  98. package/dist/lib/plugin-marketplace.js +1 -1
  99. package/dist/lib/plugins.js +15 -1
  100. package/dist/lib/profiles-presets.d.ts +26 -0
  101. package/dist/lib/profiles-presets.js +216 -0
  102. package/dist/lib/profiles.d.ts +34 -0
  103. package/dist/lib/profiles.js +112 -1
  104. package/dist/lib/resources/mcp.js +37 -0
  105. package/dist/lib/resources.d.ts +1 -1
  106. package/dist/lib/rotate.js +10 -4
  107. package/dist/lib/routines-format.d.ts +47 -0
  108. package/dist/lib/routines-format.js +194 -0
  109. package/dist/lib/routines.d.ts +8 -2
  110. package/dist/lib/routines.js +34 -14
  111. package/dist/lib/runner.js +83 -15
  112. package/dist/lib/scheduler.js +8 -1
  113. package/dist/lib/secrets/Agents CLI.app/Contents/CodeResources +0 -0
  114. package/dist/lib/secrets/Agents CLI.app/Contents/MacOS/Agents CLI +0 -0
  115. package/dist/lib/secrets/Agents CLI.app/Contents/_CodeSignature/CodeResources +1 -9
  116. package/dist/lib/secrets/bundles.d.ts +34 -17
  117. package/dist/lib/secrets/bundles.js +210 -36
  118. package/dist/lib/secrets/index.d.ts +49 -30
  119. package/dist/lib/secrets/index.js +126 -115
  120. package/dist/lib/secrets/install-helper.d.ts +45 -0
  121. package/dist/lib/secrets/install-helper.js +165 -0
  122. package/dist/lib/secrets/linux.js +4 -4
  123. package/dist/lib/secrets/sync.d.ts +56 -0
  124. package/dist/lib/secrets/sync.js +180 -0
  125. package/dist/lib/session/active.d.ts +8 -0
  126. package/dist/lib/session/active.js +3 -2
  127. package/dist/lib/session/db.d.ts +0 -4
  128. package/dist/lib/session/db.js +0 -26
  129. package/dist/lib/session/parse.d.ts +1 -0
  130. package/dist/lib/session/parse.js +44 -0
  131. package/dist/lib/session/render.js +4 -4
  132. package/dist/lib/session/types.d.ts +2 -2
  133. package/dist/lib/session/types.js +1 -1
  134. package/dist/lib/shims.d.ts +5 -2
  135. package/dist/lib/shims.js +70 -38
  136. package/dist/lib/state.d.ts +14 -2
  137. package/dist/lib/state.js +51 -20
  138. package/dist/lib/teams/agents.d.ts +5 -4
  139. package/dist/lib/teams/agents.js +48 -22
  140. package/dist/lib/teams/api.d.ts +2 -1
  141. package/dist/lib/teams/api.js +4 -3
  142. package/dist/lib/teams/parsers.d.ts +1 -1
  143. package/dist/lib/teams/parsers.js +153 -3
  144. package/dist/lib/teams/summarizer.js +18 -2
  145. package/dist/lib/teams/worktree.js +14 -3
  146. package/dist/lib/types.d.ts +63 -4
  147. package/dist/lib/types.js +8 -3
  148. package/dist/lib/usage.d.ts +27 -2
  149. package/dist/lib/usage.js +100 -17
  150. package/dist/lib/versions.d.ts +45 -3
  151. package/dist/lib/versions.js +455 -60
  152. package/package.json +15 -14
  153. package/scripts/install-helper.js +97 -0
  154. package/scripts/postinstall.js +16 -0
  155. package/dist/lib/secrets/Agents CLI.app/Contents/embedded.provisionprofile +0 -0
  156. package/npm-shrinkwrap.json +0 -3162
@@ -48,12 +48,35 @@ export declare function getAvailableResources(cwd?: string): AvailableResources;
48
48
  export declare function getActuallySyncedResources(agent: AgentId, version: string, options?: {
49
49
  cwd?: string;
50
50
  }): AvailableResources;
51
+ /** Resource names that only exist in the project's `.agents/` layer, grouped by kind. */
52
+ export interface ProjectOnlyResources {
53
+ commands: Set<string>;
54
+ skills: Set<string>;
55
+ hooks: Set<string>;
56
+ subagents: Set<string>;
57
+ plugins: Set<string>;
58
+ workflows: Set<string>;
59
+ }
60
+ /**
61
+ * Names that exist ONLY in the project's `.agents/` layer (no matching entry in
62
+ * user/system/extra layers). Sync intentionally skips project-layer commands,
63
+ * skills, hooks, subagents, plugins, and workflows for security — see the
64
+ * defense comments above each sync branch in syncResourcesToVersion. Without
65
+ * this filter, those names would forever appear in the "New resources" diff
66
+ * because they live in `available` but never reach `actuallySynced`.
67
+ */
68
+ export declare function getProjectOnlyResources(cwd?: string): ProjectOnlyResources;
51
69
  /**
52
70
  * Compare available resources with what's ACTUALLY synced to version home.
53
71
  * Returns only NEW resources that haven't been synced yet.
54
72
  * Source of truth: the actual files/config, NOT agents.yaml tracking.
73
+ *
74
+ * `projectOnly` (recommended): the result of `getProjectOnlyResources(cwd)`.
75
+ * Names listed there are filtered out for kinds that sync intentionally
76
+ * excludes the project layer — otherwise they would re-appear as "new"
77
+ * on every run and "Yes, sync all new" would silently do nothing for them.
55
78
  */
56
- export declare function getNewResources(available: AvailableResources, actuallySynced: AvailableResources): AvailableResources;
79
+ export declare function getNewResources(available: AvailableResources, actuallySynced: AvailableResources, projectOnly?: ProjectOnlyResources): AvailableResources;
57
80
  /**
58
81
  * Check if there are any new resources to sync.
59
82
  * When version is provided, uses version-specific capability checks.
@@ -63,7 +86,7 @@ export declare function hasNewResources(diff: AvailableResources, agent?: AgentI
63
86
  * Prompt user to select which NEW resources to sync.
64
87
  * Only shows resources that haven't been synced yet.
65
88
  */
66
- export declare function promptNewResourceSelection(agent: AgentId, newResources: AvailableResources): Promise<ResourceSelection | null>;
89
+ export declare function promptNewResourceSelection(agent: AgentId, newResources: AvailableResources, version?: string): Promise<ResourceSelection | null>;
67
90
  /**
68
91
  * Prompt user to select which resources to sync from ~/.agents/.
69
92
  * Returns the selection, or null if user cancels.
@@ -118,7 +141,7 @@ export declare function listInstalledVersions(agent: AgentId): string[];
118
141
  * List every version directory for an agent, including ones missing the
119
142
  * binary (typically home-only leftovers from a prior `removeVersion`).
120
143
  *
121
- * Used by `agents prune` to surface stale installs that the regular
144
+ * Used by `agents prune cleanup` to surface stale installs that the regular
122
145
  * `listInstalledVersions` filters out. Do NOT use elsewhere — every other
123
146
  * call site assumes a working binary.
124
147
  */
@@ -163,6 +186,14 @@ export declare function softDeleteVersionDir(agent: AgentId, version: string): s
163
186
  * Nothing is hard-deleted.
164
187
  */
165
188
  export declare function removeVersion(agent: AgentId, version: string): boolean;
189
+ /**
190
+ * Print the standard footer after one or more versions were soft-deleted to
191
+ * trash. Reminds the user that sessions stay readable and how to restore.
192
+ */
193
+ export declare function printTrashFooter(moved: Array<{
194
+ agent: AgentId;
195
+ version: string;
196
+ }>): void;
166
197
  /**
167
198
  * Remove all versions of an agent. Preserves each version's `home/` directory
168
199
  * so conversation history is never deleted; the per-version folders (now
@@ -277,6 +308,17 @@ export interface InstalledAgentTargetResult {
277
308
  directAgents: AgentId[];
278
309
  versionSelections: Map<AgentId, string[]>;
279
310
  }
311
+ /**
312
+ * Thrown when the user references an agent@version that is not installed.
313
+ * Carries the parsed (agentId, version) so callers can react — e.g. prompt
314
+ * to install it on demand — without having to parse the error message.
315
+ */
316
+ export declare class VersionNotInstalledError extends Error {
317
+ readonly agentId: AgentId;
318
+ readonly version: string;
319
+ readonly installedVersions: readonly string[];
320
+ constructor(agentId: AgentId, version: string, installedVersions: readonly string[]);
321
+ }
280
322
  /**
281
323
  * Resolve a comma-separated --agents list into concrete version selections.
282
324
  * Bare agents target the default version, or the newest installed version when no default exists.