@phnx-labs/agents-cli 1.20.34 → 1.20.35
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/CHANGELOG.md +22 -0
- package/README.md +5 -1
- package/dist/commands/computer-actions.d.ts +15 -0
- package/dist/commands/computer-actions.js +120 -22
- package/dist/commands/cost.js +17 -12
- package/dist/commands/doctor.d.ts +1 -0
- package/dist/commands/doctor.js +59 -14
- package/dist/commands/events.d.ts +16 -0
- package/dist/commands/events.js +173 -0
- package/dist/commands/exec.js +6 -1
- package/dist/commands/hosts.js +28 -24
- package/dist/commands/inspect.d.ts +2 -0
- package/dist/commands/inspect.js +54 -7
- package/dist/commands/logs.d.ts +17 -0
- package/dist/commands/logs.js +139 -0
- package/dist/commands/models.d.ts +3 -0
- package/dist/commands/models.js +27 -8
- package/dist/commands/permissions.js +9 -2
- package/dist/commands/repo.d.ts +34 -0
- package/dist/commands/repo.js +243 -65
- package/dist/commands/resource-view.d.ts +20 -0
- package/dist/commands/resource-view.js +90 -28
- package/dist/commands/secrets.js +40 -16
- package/dist/commands/sessions-resume.d.ts +2 -0
- package/dist/commands/sessions-resume.js +209 -0
- package/dist/commands/sessions-tail.d.ts +10 -0
- package/dist/commands/sessions-tail.js +11 -0
- package/dist/commands/sessions.d.ts +73 -1
- package/dist/commands/sessions.js +273 -53
- package/dist/commands/view.d.ts +3 -0
- package/dist/commands/view.js +19 -8
- package/dist/commands/wallet.d.ts +6 -0
- package/dist/commands/wallet.js +22 -5
- package/dist/index.js +58 -31
- package/dist/lib/agents.js +30 -9
- package/dist/lib/browser/cdp.js +5 -1
- package/dist/lib/browser/drivers/ssh.d.ts +8 -0
- package/dist/lib/browser/drivers/ssh.js +76 -16
- package/dist/lib/browser/ipc.d.ts +3 -0
- package/dist/lib/browser/ipc.js +13 -9
- package/dist/lib/browser/service.js +71 -15
- package/dist/lib/daemon.d.ts +35 -0
- package/dist/lib/daemon.js +33 -5
- package/dist/lib/devices/connect.d.ts +3 -2
- package/dist/lib/devices/connect.js +5 -3
- package/dist/lib/events.d.ts +9 -2
- package/dist/lib/events.js +70 -11
- package/dist/lib/exec.js +22 -0
- package/dist/lib/hooks.js +8 -2
- package/dist/lib/hosts/dispatch.js +6 -7
- package/dist/lib/hosts/logs.d.ts +16 -0
- package/dist/lib/hosts/logs.js +45 -0
- package/dist/lib/hosts/progress.d.ts +66 -0
- package/dist/lib/hosts/progress.js +125 -17
- package/dist/lib/hosts/ready.d.ts +23 -2
- package/dist/lib/hosts/ready.js +35 -13
- package/dist/lib/hosts/reconcile.d.ts +53 -0
- package/dist/lib/hosts/reconcile.js +81 -0
- package/dist/lib/hosts/tasks.d.ts +8 -0
- package/dist/lib/hosts/tasks.js +14 -0
- package/dist/lib/permissions.d.ts +4 -0
- package/dist/lib/permissions.js +35 -0
- package/dist/lib/picker.d.ts +24 -0
- package/dist/lib/picker.js +124 -0
- package/dist/lib/plugin-marketplace.d.ts +30 -0
- package/dist/lib/plugin-marketplace.js +215 -2
- package/dist/lib/plugins.d.ts +5 -0
- package/dist/lib/plugins.js +45 -4
- package/dist/lib/session/active.d.ts +7 -0
- package/dist/lib/session/active.js +11 -3
- package/dist/lib/session/discover.js +94 -0
- package/dist/lib/session/parse.d.ts +6 -0
- package/dist/lib/session/parse.js +283 -2
- package/dist/lib/session/pid-registry.d.ts +21 -0
- package/dist/lib/session/pid-registry.js +80 -0
- package/dist/lib/session/remote-active.d.ts +26 -0
- package/dist/lib/session/remote-active.js +141 -0
- package/dist/lib/session/remote.js +2 -6
- package/dist/lib/session/render.js +1 -1
- package/dist/lib/session/sync/config.d.ts +8 -0
- package/dist/lib/session/sync/config.js +11 -2
- package/dist/lib/session/types.d.ts +1 -1
- package/dist/lib/session/types.js +1 -1
- package/dist/lib/shims.d.ts +11 -3
- package/dist/lib/shims.js +54 -30
- package/dist/lib/ssh-exec.d.ts +26 -3
- package/dist/lib/ssh-exec.js +45 -3
- package/dist/lib/ssh-tunnel.d.ts +24 -5
- package/dist/lib/ssh-tunnel.js +60 -62
- package/dist/lib/staleness/writers/hooks.js +1 -1
- package/dist/lib/startup/command-registry.d.ts +2 -0
- package/dist/lib/startup/command-registry.js +4 -0
- package/dist/lib/teams/registry.js +25 -9
- package/dist/lib/terminal/backends/ghostty.d.ts +6 -0
- package/dist/lib/terminal/backends/ghostty.js +69 -0
- package/dist/lib/terminal/backends/index.d.ts +18 -0
- package/dist/lib/terminal/backends/index.js +29 -0
- package/dist/lib/terminal/backends/iterm.d.ts +6 -0
- package/dist/lib/terminal/backends/iterm.js +62 -0
- package/dist/lib/terminal/backends/tmux.d.ts +14 -0
- package/dist/lib/terminal/backends/tmux.js +23 -0
- package/dist/lib/terminal/engine.d.ts +39 -0
- package/dist/lib/terminal/engine.js +54 -0
- package/dist/lib/terminal/index.d.ts +14 -0
- package/dist/lib/terminal/index.js +5 -0
- package/dist/lib/terminal/policy.d.ts +11 -0
- package/dist/lib/terminal/policy.js +11 -0
- package/dist/lib/terminal/quote.d.ts +11 -0
- package/dist/lib/terminal/quote.js +13 -0
- package/dist/lib/terminal/shell.d.ts +6 -0
- package/dist/lib/terminal/shell.js +23 -0
- package/dist/lib/terminal/transport.d.ts +15 -0
- package/dist/lib/terminal/transport.js +40 -0
- package/dist/lib/terminal/types.d.ts +59 -0
- package/dist/lib/terminal/types.js +13 -0
- package/dist/lib/types.d.ts +7 -0
- package/dist/lib/versions.d.ts +7 -3
- package/dist/lib/versions.js +10 -5
- package/dist/lib/whats-new.d.ts +9 -0
- package/dist/lib/whats-new.js +35 -0
- package/package.json +1 -1
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Terminal launch engine — open an interactive command as a tab or split pane
|
|
3
|
+
* in iTerm / Ghostty / tmux, on this machine or a remote host.
|
|
4
|
+
*
|
|
5
|
+
* Public entry point. Callers typically use `openSurfaces` (a batch with a
|
|
6
|
+
* layout policy) or `openSurface` (a single request), and `availableBackends` /
|
|
7
|
+
* `detectCurrentBackend` to pick a target. See docs/terminal-engine.md.
|
|
8
|
+
*/
|
|
9
|
+
export type { Backend, SplitDirection, Layout, EngineContext, LaunchSpec, LaunchRequest, LaunchResult, TerminalBackend, } from './types.js';
|
|
10
|
+
export { currentContext } from './types.js';
|
|
11
|
+
export { BACKENDS, detectCurrentBackend, availableBackends, itermBackend, ghosttyBackend, tmuxBackend } from './backends/index.js';
|
|
12
|
+
export { planLayouts, type Packing } from './policy.js';
|
|
13
|
+
export { specForRequest, buildRequests, openSurface, openSurfaces, type OpenOptions, type OpenManyOptions, type BuildRequestsOptions, type SurfaceItem, } from './engine.js';
|
|
14
|
+
export { runLocal, runRemote, runSpec, remoteCommand, type HostResolver, type RunResult } from './transport.js';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { currentContext } from './types.js';
|
|
2
|
+
export { BACKENDS, detectCurrentBackend, availableBackends, itermBackend, ghosttyBackend, tmuxBackend } from './backends/index.js';
|
|
3
|
+
export { planLayouts } from './policy.js';
|
|
4
|
+
export { specForRequest, buildRequests, openSurface, openSurfaces, } from './engine.js';
|
|
5
|
+
export { runLocal, runRemote, runSpec, remoteCommand } from './transport.js';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Layout policy — how a batch of surfaces is arranged.
|
|
3
|
+
*
|
|
4
|
+
* `two-per-tab` (default) packs sessions two-up: session 1 opens a new tab,
|
|
5
|
+
* session 2 splits it (right), session 3 opens a new tab, and so on — so each
|
|
6
|
+
* tab holds a left+right pair. `tabs` gives every session its own tab.
|
|
7
|
+
*/
|
|
8
|
+
import type { Layout } from './types.js';
|
|
9
|
+
export type Packing = 'two-per-tab' | 'tabs';
|
|
10
|
+
/** Assign a layout to each index in a batch of `count` surfaces. */
|
|
11
|
+
export declare function planLayouts(count: number, packing?: Packing): Layout[];
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** Assign a layout to each index in a batch of `count` surfaces. */
|
|
2
|
+
export function planLayouts(count, packing = 'two-per-tab') {
|
|
3
|
+
const out = [];
|
|
4
|
+
for (let i = 0; i < count; i++) {
|
|
5
|
+
if (packing === 'tabs')
|
|
6
|
+
out.push('tab');
|
|
7
|
+
else
|
|
8
|
+
out.push(i % 2 === 0 ? 'tab' : 'split-right');
|
|
9
|
+
}
|
|
10
|
+
return out;
|
|
11
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Quoting helpers for building launch commands.
|
|
3
|
+
*
|
|
4
|
+
* `shellQuote` is the single canonical POSIX single-quoter, re-exported from the
|
|
5
|
+
* SSH transport so the local and remote legs quote identically. `appleScriptStr`
|
|
6
|
+
* is the AppleScript string-literal escaper used by the iTerm/Ghostty backends.
|
|
7
|
+
*/
|
|
8
|
+
import { shellQuote } from '../ssh-exec.js';
|
|
9
|
+
export { shellQuote };
|
|
10
|
+
/** AppleScript double-quoted string literal (escape backslash, then quote). */
|
|
11
|
+
export declare function appleScriptStr(s: string): string;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Quoting helpers for building launch commands.
|
|
3
|
+
*
|
|
4
|
+
* `shellQuote` is the single canonical POSIX single-quoter, re-exported from the
|
|
5
|
+
* SSH transport so the local and remote legs quote identically. `appleScriptStr`
|
|
6
|
+
* is the AppleScript string-literal escaper used by the iTerm/Ghostty backends.
|
|
7
|
+
*/
|
|
8
|
+
import { shellQuote } from '../ssh-exec.js';
|
|
9
|
+
export { shellQuote };
|
|
10
|
+
/** AppleScript double-quoted string literal (escape backslash, then quote). */
|
|
11
|
+
export function appleScriptStr(s) {
|
|
12
|
+
return `"${s.replace(/\\/g, '\\\\').replace(/"/g, '\\"')}"`;
|
|
13
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** `cd <cwd> && exec <command>` — for backends that don't set cwd natively. */
|
|
2
|
+
export declare function loginExec(cwd: string, command: string[]): string;
|
|
3
|
+
/** `exec <command>` — for backends that set the working directory natively. */
|
|
4
|
+
export declare function execOnly(command: string[]): string;
|
|
5
|
+
/** Wrap an inner shell script in an interactive login zsh: `zsh -ilc '<inner>'`. */
|
|
6
|
+
export declare function iLoginShell(inner: string): string;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Interactive-login-shell wrappers shared by every backend.
|
|
3
|
+
*
|
|
4
|
+
* `-i` is load-bearing, not cosmetic: the version-pinned shims (e.g.
|
|
5
|
+
* `claude@2.1.187`) live in `~/.agents/.cache/shims`, which `.zshrc` puts on
|
|
6
|
+
* PATH for *interactive* shells only. A plain `zsh -lc` (login, non-interactive)
|
|
7
|
+
* skips `.zshrc`, so the shim isn't found and the surface dies with "command not
|
|
8
|
+
* found". Every backend wraps its command in `zsh -ilc` for this reason — do not
|
|
9
|
+
* drop the `-i`.
|
|
10
|
+
*/
|
|
11
|
+
import { shellQuote } from './quote.js';
|
|
12
|
+
/** `cd <cwd> && exec <command>` — for backends that don't set cwd natively. */
|
|
13
|
+
export function loginExec(cwd, command) {
|
|
14
|
+
return `cd ${shellQuote(cwd)} && exec ${command.join(' ')}`;
|
|
15
|
+
}
|
|
16
|
+
/** `exec <command>` — for backends that set the working directory natively. */
|
|
17
|
+
export function execOnly(command) {
|
|
18
|
+
return `exec ${command.join(' ')}`;
|
|
19
|
+
}
|
|
20
|
+
/** Wrap an inner shell script in an interactive login zsh: `zsh -ilc '<inner>'`. */
|
|
21
|
+
export function iLoginShell(inner) {
|
|
22
|
+
return `zsh -ilc ${shellQuote(inner)}`;
|
|
23
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { LaunchSpec } from './types.js';
|
|
2
|
+
/** Resolve a host alias to an ssh target. Default: identity (ssh_config resolves it). */
|
|
3
|
+
export type HostResolver = (alias: string) => string;
|
|
4
|
+
export interface RunResult {
|
|
5
|
+
ok: boolean;
|
|
6
|
+
error?: string;
|
|
7
|
+
}
|
|
8
|
+
/** Run the spec on this machine: spawn the launcher, resolve when it exits. */
|
|
9
|
+
export declare function runLocal(spec: LaunchSpec): Promise<RunResult>;
|
|
10
|
+
/** Serialize a launch argv into a single POSIX-quoted shell command string. */
|
|
11
|
+
export declare function remoteCommand(spec: LaunchSpec): string;
|
|
12
|
+
/** Run the spec on a remote host over SSH. */
|
|
13
|
+
export declare function runRemote(spec: LaunchSpec, target: string): RunResult;
|
|
14
|
+
/** Run a spec locally (no host / 'local') or on a resolved remote host. */
|
|
15
|
+
export declare function runSpec(spec: LaunchSpec, host?: string, resolveHost?: HostResolver): Promise<RunResult>;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Transport — runs a LaunchSpec locally or on a remote host.
|
|
3
|
+
*
|
|
4
|
+
* Local: spawn the launcher (osascript / tmux) and wait for it to exit — these
|
|
5
|
+
* are short-lived commands that create the surface and return, so waiting gives
|
|
6
|
+
* a real success/failure. Remote: serialize the argv into one shell string and
|
|
7
|
+
* hand it to `sshExec` — the same hardened SSH primitive `agents sessions
|
|
8
|
+
* --host` and the browser driver use (target-injection guard, POSIX quoting,
|
|
9
|
+
* connection multiplexing).
|
|
10
|
+
*/
|
|
11
|
+
import { spawn } from 'child_process';
|
|
12
|
+
import { sshExec } from '../ssh-exec.js';
|
|
13
|
+
import { shellQuote } from './quote.js';
|
|
14
|
+
/** Run the spec on this machine: spawn the launcher, resolve when it exits. */
|
|
15
|
+
export function runLocal(spec) {
|
|
16
|
+
return new Promise((resolve) => {
|
|
17
|
+
const child = spawn(spec.argv[0], spec.argv.slice(1), { stdio: 'ignore' });
|
|
18
|
+
child.on('error', (err) => resolve({ ok: false, error: err.message }));
|
|
19
|
+
child.on('close', (code) => resolve(code === 0 ? { ok: true } : { ok: false, error: `${spec.argv[0]} exited with code ${code}` }));
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
/** Serialize a launch argv into a single POSIX-quoted shell command string. */
|
|
23
|
+
export function remoteCommand(spec) {
|
|
24
|
+
return spec.argv.map(shellQuote).join(' ');
|
|
25
|
+
}
|
|
26
|
+
/** Run the spec on a remote host over SSH. */
|
|
27
|
+
export function runRemote(spec, target) {
|
|
28
|
+
const res = sshExec(target, remoteCommand(spec), { multiplex: true });
|
|
29
|
+
if (res.code === 0)
|
|
30
|
+
return { ok: true };
|
|
31
|
+
const err = (res.stderr || '').trim();
|
|
32
|
+
return { ok: false, error: err || `ssh exited with code ${res.code}` };
|
|
33
|
+
}
|
|
34
|
+
/** Run a spec locally (no host / 'local') or on a resolved remote host. */
|
|
35
|
+
export async function runSpec(spec, host, resolveHost) {
|
|
36
|
+
if (!host || host === 'local')
|
|
37
|
+
return runLocal(spec);
|
|
38
|
+
const target = resolveHost ? resolveHost(host) : host;
|
|
39
|
+
return runRemote(spec, target);
|
|
40
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Core types for the terminal launch engine.
|
|
3
|
+
*
|
|
4
|
+
* The engine opens an *interactive* surface — a tab or a split pane — running a
|
|
5
|
+
* command, in a chosen terminal backend (iTerm / Ghostty / tmux), on this
|
|
6
|
+
* machine or a remote host. This is distinct from cloud providers
|
|
7
|
+
* (src/lib/cloud), which dispatch autonomous headless tasks; a terminal surface
|
|
8
|
+
* is attended and live. See docs/terminal-engine.md.
|
|
9
|
+
*/
|
|
10
|
+
/** An interactive terminal backend the engine can drive. */
|
|
11
|
+
export type Backend = 'iterm' | 'ghostty' | 'tmux';
|
|
12
|
+
/** Which way a split pane grows. `right` = side-by-side; `down` = stacked. */
|
|
13
|
+
export type SplitDirection = 'right' | 'down';
|
|
14
|
+
/** Where a surface lands: a new tab, or a split of the current pane. */
|
|
15
|
+
export type Layout = 'tab' | 'split-right' | 'split-down';
|
|
16
|
+
/** Ambient facts a backend needs to decide availability and detection. */
|
|
17
|
+
export interface EngineContext {
|
|
18
|
+
platform: NodeJS.Platform;
|
|
19
|
+
env: NodeJS.ProcessEnv;
|
|
20
|
+
}
|
|
21
|
+
/** Snapshot the live process context. */
|
|
22
|
+
export declare function currentContext(): EngineContext;
|
|
23
|
+
/** The concrete OS command that opens a surface — the pure output of a backend. */
|
|
24
|
+
export interface LaunchSpec {
|
|
25
|
+
/** argv to run (e.g. `['osascript','-e',script]` or `['tmux','split-window',…]`). */
|
|
26
|
+
argv: string[];
|
|
27
|
+
}
|
|
28
|
+
/** A single "open this command as this surface" instruction. */
|
|
29
|
+
export interface LaunchRequest {
|
|
30
|
+
backend: Backend;
|
|
31
|
+
layout: Layout;
|
|
32
|
+
/** Working directory the command runs in. */
|
|
33
|
+
cwd: string;
|
|
34
|
+
/** argv to exec in the surface (e.g. a resume command). */
|
|
35
|
+
command: string[];
|
|
36
|
+
/** undefined / 'local' = this machine; otherwise a resolvable host alias. */
|
|
37
|
+
host?: string;
|
|
38
|
+
}
|
|
39
|
+
/** Outcome of opening one surface. Never throws for launch failures — reports them. */
|
|
40
|
+
export interface LaunchResult {
|
|
41
|
+
ok: boolean;
|
|
42
|
+
request: LaunchRequest;
|
|
43
|
+
error?: string;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* A terminal backend: pure builders + an availability check. No side effects —
|
|
47
|
+
* building a spec never opens anything, so every backend is unit-testable
|
|
48
|
+
* without a display. The engine's transport is what actually runs the spec.
|
|
49
|
+
*/
|
|
50
|
+
export interface TerminalBackend {
|
|
51
|
+
readonly id: Backend;
|
|
52
|
+
readonly label: string;
|
|
53
|
+
/** Can this backend be driven here? (platform + app installed / inside tmux). */
|
|
54
|
+
isAvailable(ctx: EngineContext): boolean;
|
|
55
|
+
/** Command that opens a new tab running `command` in `cwd`. */
|
|
56
|
+
buildTab(cwd: string, command: string[]): LaunchSpec;
|
|
57
|
+
/** Command that splits the current surface, running `command` in `cwd`. */
|
|
58
|
+
buildSplit(cwd: string, command: string[], direction: SplitDirection): LaunchSpec;
|
|
59
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Core types for the terminal launch engine.
|
|
3
|
+
*
|
|
4
|
+
* The engine opens an *interactive* surface — a tab or a split pane — running a
|
|
5
|
+
* command, in a chosen terminal backend (iTerm / Ghostty / tmux), on this
|
|
6
|
+
* machine or a remote host. This is distinct from cloud providers
|
|
7
|
+
* (src/lib/cloud), which dispatch autonomous headless tasks; a terminal surface
|
|
8
|
+
* is attended and live. See docs/terminal-engine.md.
|
|
9
|
+
*/
|
|
10
|
+
/** Snapshot the live process context. */
|
|
11
|
+
export function currentContext() {
|
|
12
|
+
return { platform: process.platform, env: process.env };
|
|
13
|
+
}
|
package/dist/lib/types.d.ts
CHANGED
|
@@ -86,6 +86,13 @@ export interface AgentConfig {
|
|
|
86
86
|
*/
|
|
87
87
|
nativeCommandRuntime?: boolean;
|
|
88
88
|
hooksDir: string;
|
|
89
|
+
/**
|
|
90
|
+
* Directory (relative to a plugin's install dir) the agent reads its plugin
|
|
91
|
+
* manifest from, when it differs from the canonical `.claude-plugin/`. Codex
|
|
92
|
+
* uses `.codex-plugin`, Droid `.factory-plugin`. Set to `.` when the agent
|
|
93
|
+
* reads the manifest from the plugin ROOT (Copilot). syncPluginToVersion
|
|
94
|
+
* mirrors `.claude-plugin/plugin.json` into this dir.
|
|
95
|
+
*/
|
|
89
96
|
pluginManifestDir?: string;
|
|
90
97
|
instructionsFile: string;
|
|
91
98
|
format: 'markdown' | 'toml';
|
package/dist/lib/versions.d.ts
CHANGED
|
@@ -337,9 +337,13 @@ export declare function listRepoNames(): string[];
|
|
|
337
337
|
* sync path uses. Passing the result as an explicit `selection` means the sync
|
|
338
338
|
* touches only that repo's resources — no orphan-sweep of the other layers.
|
|
339
339
|
*
|
|
340
|
-
* `memory` is set to `[]
|
|
341
|
-
*
|
|
342
|
-
*
|
|
340
|
+
* `memory` is set to `'all'`, NOT `[]`: the composed rules-memory file is a
|
|
341
|
+
* merge of ALL layers, so scoping the sync to a single repo must still
|
|
342
|
+
* recompile it in the same pass (RUSH-1354). Leaving it out — or using the
|
|
343
|
+
* `[]` skip-sentinel — silently strands the memory file at its old content
|
|
344
|
+
* whenever a repo-scoped sync runs after a rules change. `'all'` makes
|
|
345
|
+
* `syncResourcesToVersion` recompose from every layer via the active preset,
|
|
346
|
+
* exactly as an unscoped full reconcile does.
|
|
343
347
|
*/
|
|
344
348
|
export declare function buildRepoScopedSelection(repo: string, cwd?: string): ResourceSelection;
|
|
345
349
|
/**
|
package/dist/lib/versions.js
CHANGED
|
@@ -1692,9 +1692,13 @@ function resourceSourceMap(kind, cwd, available) {
|
|
|
1692
1692
|
* sync path uses. Passing the result as an explicit `selection` means the sync
|
|
1693
1693
|
* touches only that repo's resources — no orphan-sweep of the other layers.
|
|
1694
1694
|
*
|
|
1695
|
-
* `memory` is set to `[]
|
|
1696
|
-
*
|
|
1697
|
-
*
|
|
1695
|
+
* `memory` is set to `'all'`, NOT `[]`: the composed rules-memory file is a
|
|
1696
|
+
* merge of ALL layers, so scoping the sync to a single repo must still
|
|
1697
|
+
* recompile it in the same pass (RUSH-1354). Leaving it out — or using the
|
|
1698
|
+
* `[]` skip-sentinel — silently strands the memory file at its old content
|
|
1699
|
+
* whenever a repo-scoped sync runs after a rules change. `'all'` makes
|
|
1700
|
+
* `syncResourcesToVersion` recompose from every layer via the active preset,
|
|
1701
|
+
* exactly as an unscoped full reconcile does.
|
|
1698
1702
|
*/
|
|
1699
1703
|
export function buildRepoScopedSelection(repo, cwd = process.cwd()) {
|
|
1700
1704
|
const patterns = [`${repo}:*`];
|
|
@@ -1706,8 +1710,9 @@ export function buildRepoScopedSelection(repo, cwd = process.cwd()) {
|
|
|
1706
1710
|
if (names.length > 0)
|
|
1707
1711
|
selection[kind] = names;
|
|
1708
1712
|
}
|
|
1709
|
-
//
|
|
1710
|
-
|
|
1713
|
+
// Recompile the memory file from all layers even under a repo scope — it is
|
|
1714
|
+
// composed, not a per-repo artifact (see skipMemory below and RUSH-1354).
|
|
1715
|
+
selection.memory = 'all';
|
|
1711
1716
|
return selection;
|
|
1712
1717
|
}
|
|
1713
1718
|
/**
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Render a compact "What's new" summary from a CHANGELOG.md body: one bullet
|
|
3
|
+
* per feature/fix heading (the `**...**` lines) for each version in the range
|
|
4
|
+
* the user actually moved through, `(fromVersion, toVersion]`. The verbose
|
|
5
|
+
* sub-bullets are intentionally dropped — the full notes live in the changelog.
|
|
6
|
+
*
|
|
7
|
+
* Returns colored lines ready to print, empty when nothing is in range.
|
|
8
|
+
*/
|
|
9
|
+
export declare function renderWhatsNew(changelog: string, fromVersion: string, toVersion: string): string[];
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import chalk from 'chalk';
|
|
2
|
+
import { compareVersions } from './agent-spec/primitives.js';
|
|
3
|
+
/**
|
|
4
|
+
* Render a compact "What's new" summary from a CHANGELOG.md body: one bullet
|
|
5
|
+
* per feature/fix heading (the `**...**` lines) for each version in the range
|
|
6
|
+
* the user actually moved through, `(fromVersion, toVersion]`. The verbose
|
|
7
|
+
* sub-bullets are intentionally dropped — the full notes live in the changelog.
|
|
8
|
+
*
|
|
9
|
+
* Returns colored lines ready to print, empty when nothing is in range.
|
|
10
|
+
*/
|
|
11
|
+
export function renderWhatsNew(changelog, fromVersion, toVersion) {
|
|
12
|
+
const out = [];
|
|
13
|
+
let inRelevantSection = false;
|
|
14
|
+
for (const line of changelog.split('\n')) {
|
|
15
|
+
const versionMatch = line.match(/^## (\d+\.\d+\.\d+)/);
|
|
16
|
+
if (versionMatch) {
|
|
17
|
+
const currentVersion = versionMatch[1];
|
|
18
|
+
// Bounding the top end matters when upgrading to a specific older
|
|
19
|
+
// version, and guards against a changelog that lists unreleased entries.
|
|
20
|
+
inRelevantSection =
|
|
21
|
+
compareVersions(currentVersion, fromVersion) > 0 &&
|
|
22
|
+
compareVersions(currentVersion, toVersion) <= 0;
|
|
23
|
+
if (inRelevantSection) {
|
|
24
|
+
out.push('');
|
|
25
|
+
out.push(chalk.bold(`v${currentVersion}`));
|
|
26
|
+
}
|
|
27
|
+
continue;
|
|
28
|
+
}
|
|
29
|
+
// Only the bold headings — one bullet per feature/fix.
|
|
30
|
+
if (inRelevantSection && line.startsWith('**') && line.endsWith('**')) {
|
|
31
|
+
out.push(` ${chalk.cyan('•')} ${line.replace(/\*\*/g, '')}`);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
return out;
|
|
35
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@phnx-labs/agents-cli",
|
|
3
|
-
"version": "1.20.
|
|
3
|
+
"version": "1.20.35",
|
|
4
4
|
"description": "One CLI for all your AI coding agents - versions, config, cloud dispatch, sessions, and teams (now with first-class Grok Build CLI support)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|