@agentworkforce/cli 2.0.1 → 2.1.1
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 +13 -0
- package/dist/cli.d.ts +8 -0
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +69 -2
- package/dist/cli.js.map +1 -1
- package/dist/launch-metadata.d.ts.map +1 -1
- package/dist/launch-metadata.js +12 -1
- package/dist/launch-metadata.js.map +1 -1
- package/dist/launch-metadata.test.js +58 -0
- package/dist/launch-metadata.test.js.map +1 -1
- package/dist/persona-tui.d.ts +85 -0
- package/dist/persona-tui.d.ts.map +1 -0
- package/dist/persona-tui.js +390 -0
- package/dist/persona-tui.js.map +1 -0
- package/dist/persona-tui.test.d.ts +2 -0
- package/dist/persona-tui.test.d.ts.map +1 -0
- package/dist/persona-tui.test.js +130 -0
- package/dist/persona-tui.test.js.map +1 -0
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [2.1.1] - 2026-05-11
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
|
|
14
|
+
- Launch-metadata: only warn after sustained ingest failures
|
|
15
|
+
|
|
16
|
+
## [2.1.0] - 2026-05-11
|
|
17
|
+
|
|
18
|
+
### Changed
|
|
19
|
+
|
|
20
|
+
- Persona-tui: address review feedback
|
|
21
|
+
- Cli: open interactive persona picker on bare invocation
|
|
22
|
+
|
|
10
23
|
## [2.0.1] - 2026-05-11
|
|
11
24
|
|
|
12
25
|
### Changed
|
package/dist/cli.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { type Harness, type PersonaMount, type PersonaSelection, type SidecarMdMode } from '@agentworkforce/persona-kit';
|
|
3
3
|
import { type PickCandidate } from './persona-picker.js';
|
|
4
|
+
import { type TuiCandidate } from './persona-tui.js';
|
|
4
5
|
export declare const CLI_VERSION: string;
|
|
5
6
|
export declare const CREATE_SELECTOR = "persona-maker@best";
|
|
6
7
|
/**
|
|
@@ -180,6 +181,13 @@ export declare function readSingleCharChoice(prompt: string, valid: readonly str
|
|
|
180
181
|
* unsupported patch op/path resolution.
|
|
181
182
|
*/
|
|
182
183
|
export declare function applyAcceptedPatches(personaFilePath: string, accepted: readonly ImproverProposal[]): void;
|
|
184
|
+
/**
|
|
185
|
+
* Enumerate personas for the interactive TUI. Source label mirrors the cascade
|
|
186
|
+
* shown by `agentworkforce list` so the picker tells the user *where* a
|
|
187
|
+
* persona is coming from (cwd, user, dir:n, library) without a separate
|
|
188
|
+
* lookup.
|
|
189
|
+
*/
|
|
190
|
+
export declare function buildTuiCandidates(): TuiCandidate[];
|
|
183
191
|
/**
|
|
184
192
|
* Enumerate persona candidates for the picker. Local overrides win over the
|
|
185
193
|
* built-in catalog when ids collide; the picker only needs the projection
|
package/dist/cli.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAsBA,OAAO,EAiBL,KAAK,OAAO,EAIZ,KAAK,YAAY,EACjB,KAAK,gBAAgB,EAIrB,KAAK,aAAa,EAEnB,MAAM,6BAA6B,CAAC;AA0BrC,OAAO,EAAe,KAAK,aAAa,EAAmB,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAsBA,OAAO,EAiBL,KAAK,OAAO,EAIZ,KAAK,YAAY,EACjB,KAAK,gBAAgB,EAIrB,KAAK,aAAa,EAEnB,MAAM,6BAA6B,CAAC;AA0BrC,OAAO,EAAe,KAAK,aAAa,EAAmB,MAAM,qBAAqB,CAAC;AACvF,OAAO,EAAkD,KAAK,YAAY,EAA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AK,EAAE,WAAW,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACrC,CA6EA"}
|
package/dist/cli.js
CHANGED
|
@@ -13,8 +13,13 @@ import { startLaunchMetadataRecording } from './launch-metadata.js';
|
|
|
13
13
|
import { buildPersonaSourceDirectories, defaultCwdPersonaDir, loadLocalPersonas, loadPersonaSourceConfig, normalizePersonaDir, savePersonaSourceConfig } from './local-personas.js';
|
|
14
14
|
import { installPersonas } from './persona-install.js';
|
|
15
15
|
import { pickPersona } from './persona-picker.js';
|
|
16
|
+
import { recordRecent, loadRecents, runPersonaPickerTui } from './persona-tui.js';
|
|
16
17
|
const USAGE = `Usage: agentworkforce <command> [args...]
|
|
17
18
|
|
|
19
|
+
Run with no arguments inside a TTY to open an interactive persona picker —
|
|
20
|
+
the top 3 most recently used personas are shown first, and typing fuzzy-
|
|
21
|
+
searches across persona names and descriptions.
|
|
22
|
+
|
|
18
23
|
Commands:
|
|
19
24
|
create [flags] Opens persona-maker@best for creating a new
|
|
20
25
|
persona, with target path passed as persona inputs.
|
|
@@ -2141,6 +2146,9 @@ async function runAgentSelector(selector, flags, inputValues) {
|
|
|
2141
2146
|
const code = runDryRun(selection);
|
|
2142
2147
|
process.exit(code);
|
|
2143
2148
|
}
|
|
2149
|
+
// Record only on real launches so `--dry-run` validations don't pollute the
|
|
2150
|
+
// MRU list used by the bare-invocation picker.
|
|
2151
|
+
recordRecent(target.spec.id);
|
|
2144
2152
|
const capture = {};
|
|
2145
2153
|
const code = await runInteractive(selection, {
|
|
2146
2154
|
installInRepo: flags.installInRepo,
|
|
@@ -3047,6 +3055,55 @@ function applyPatchInPlace(root, patch) {
|
|
|
3047
3055
|
// op === 'set'
|
|
3048
3056
|
cursor[finalSeg] = patch.value;
|
|
3049
3057
|
}
|
|
3058
|
+
/**
|
|
3059
|
+
* Enumerate personas for the interactive TUI. Source label mirrors the cascade
|
|
3060
|
+
* shown by `agentworkforce list` so the picker tells the user *where* a
|
|
3061
|
+
* persona is coming from (cwd, user, dir:n, library) without a separate
|
|
3062
|
+
* lookup.
|
|
3063
|
+
*/
|
|
3064
|
+
export function buildTuiCandidates() {
|
|
3065
|
+
const byId = new Map();
|
|
3066
|
+
for (const spec of listBuiltInPersonas()) {
|
|
3067
|
+
byId.set(spec.id, { id: spec.id, description: spec.description, source: 'library' });
|
|
3068
|
+
}
|
|
3069
|
+
for (const [id, spec] of local.byId.entries()) {
|
|
3070
|
+
byId.set(id, {
|
|
3071
|
+
id,
|
|
3072
|
+
description: spec.description,
|
|
3073
|
+
source: local.sources.get(id) ?? 'library'
|
|
3074
|
+
});
|
|
3075
|
+
}
|
|
3076
|
+
return [...byId.values()].sort((a, b) => a.id.localeCompare(b.id));
|
|
3077
|
+
}
|
|
3078
|
+
/**
|
|
3079
|
+
* Bare-invocation flow: open the interactive TUI, then hand the chosen
|
|
3080
|
+
* persona to {@link runAgentSelector}. Quitting the picker (Esc / Ctrl-C)
|
|
3081
|
+
* exits with conventional 130 so shell pipelines see SIGINT-style failure.
|
|
3082
|
+
*
|
|
3083
|
+
* runAgentSelector terminates the process via process.exit; this function
|
|
3084
|
+
* only returns when the picker is dismissed without a selection.
|
|
3085
|
+
*/
|
|
3086
|
+
async function runInteractivePicker() {
|
|
3087
|
+
const candidates = buildTuiCandidates();
|
|
3088
|
+
if (candidates.length === 0) {
|
|
3089
|
+
process.stderr.write('No personas available. Try `agentworkforce install <pack>` or run with --help.\n');
|
|
3090
|
+
process.exit(1);
|
|
3091
|
+
}
|
|
3092
|
+
const selected = await runPersonaPickerTui({
|
|
3093
|
+
candidates,
|
|
3094
|
+
recentIds: loadRecents()
|
|
3095
|
+
});
|
|
3096
|
+
if (!selected) {
|
|
3097
|
+
process.exit(130);
|
|
3098
|
+
}
|
|
3099
|
+
await runAgentSelector(selected, {
|
|
3100
|
+
installInRepo: false,
|
|
3101
|
+
noLaunchMetadata: false,
|
|
3102
|
+
dryRun: false
|
|
3103
|
+
});
|
|
3104
|
+
// runAgentSelector has Promise<never> return type; this is unreachable.
|
|
3105
|
+
process.exit(0);
|
|
3106
|
+
}
|
|
3050
3107
|
/**
|
|
3051
3108
|
* Enumerate persona candidates for the picker. Local overrides win over the
|
|
3052
3109
|
* built-in catalog when ids collide; the picker only needs the projection
|
|
@@ -3173,9 +3230,19 @@ async function runPick(args) {
|
|
|
3173
3230
|
export async function main() {
|
|
3174
3231
|
const argv = process.argv.slice(2);
|
|
3175
3232
|
const [subcommand, ...rest] = argv;
|
|
3176
|
-
if (
|
|
3233
|
+
if (subcommand === '-h' || subcommand === '--help') {
|
|
3234
|
+
process.stdout.write(USAGE);
|
|
3235
|
+
process.exit(0);
|
|
3236
|
+
}
|
|
3237
|
+
if (!subcommand) {
|
|
3238
|
+
if (process.stdin.isTTY && process.stderr.isTTY) {
|
|
3239
|
+
await runInteractivePicker();
|
|
3240
|
+
// runInteractivePicker either runAgentSelector → process.exit, or
|
|
3241
|
+
// exits itself on quit / no-match. Satisfy TS's unreachable check.
|
|
3242
|
+
process.exit(0);
|
|
3243
|
+
}
|
|
3177
3244
|
process.stdout.write(USAGE);
|
|
3178
|
-
process.exit(
|
|
3245
|
+
process.exit(1);
|
|
3179
3246
|
}
|
|
3180
3247
|
if (subcommand === '-v' || subcommand === '--version') {
|
|
3181
3248
|
process.stdout.write(`${CLI_VERSION}\n`);
|