@garyr/pt-cli 0.40.0 → 0.41.0
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/.test-home-remote/.pt/config.yaml +10 -0
- package/README.md +85 -65
- package/dist/commands/initCommand.js +4 -4
- package/dist/commands/learnCommand.js +120 -432
- package/dist/commands/template-detection.js +256 -0
- package/dist/commands/template-prompts.js +332 -0
- package/dist/commands/template-utils.js +565 -0
- package/dist/commands/updateCommand.js +94 -547
- package/dist/config.js +2 -5
- package/dist/safety.js +203 -42
- package/doc/security.md +96 -36
- package/package.json +1 -1
- package/skills/agency-pt-operator/SKILL.md +54 -9
- package/src/commands/initCommand.ts +9 -9
- package/src/commands/learnCommand.ts +157 -423
- package/src/commands/template-detection.ts +269 -0
- package/src/commands/template-prompts.ts +406 -0
- package/src/commands/template-utils.ts +651 -0
- package/src/commands/updateCommand.ts +146 -582
- package/src/config.ts +2 -5
- package/src/safety.ts +239 -53
- package/tests/remote.test.ts +110 -0
- package/tests/safety.test.ts +296 -0
- package/tests/update.test.ts +417 -0
|
@@ -326,29 +326,29 @@ export async function init(targetName: string | undefined, destPath: string | un
|
|
|
326
326
|
}
|
|
327
327
|
// Determine which tasks to include
|
|
328
328
|
let selectedTaskNames: string[] = [];
|
|
329
|
-
|
|
329
|
+
|
|
330
330
|
if (options.skipPostConfig) {
|
|
331
331
|
// Skip entirely
|
|
332
332
|
selectedTaskNames = [];
|
|
333
333
|
} else if (options.dryRun) {
|
|
334
334
|
// In dry-run, select all (for display)
|
|
335
|
-
selectedTaskNames = allTasks.map(t => t.command || t.script || '');
|
|
335
|
+
selectedTaskNames = allTasks.map(t => t.command || `./${t.script}` || '');
|
|
336
336
|
console.log(chalk.yellow(`\n[DRY RUN] Applicable post-config tasks:`));
|
|
337
337
|
for (const t of allTasks) {
|
|
338
338
|
const desc = t.description ? ` (${t.description})` : '';
|
|
339
|
-
console.log(chalk.gray(` [template] - ${t.command || t.script}${desc}`));
|
|
339
|
+
console.log(chalk.gray(` [template] - ${t.command || `./${t.script}`}${desc}`));
|
|
340
340
|
}
|
|
341
341
|
} else if (options.yes) {
|
|
342
342
|
// All tasks selected
|
|
343
|
-
selectedTaskNames = allTasks.map(t => t.command || t.script || '');
|
|
343
|
+
selectedTaskNames = allTasks.map(t => t.command || `./${t.script}` || '');
|
|
344
344
|
} else if (allTasks.length === 0) {
|
|
345
345
|
selectedTaskNames = [];
|
|
346
346
|
} else {
|
|
347
347
|
// Checkbox prompt
|
|
348
348
|
const choices: Array<{name: string; value: string; checked?: boolean}> = [];
|
|
349
|
-
|
|
349
|
+
|
|
350
350
|
for (const t of allTasks) {
|
|
351
|
-
const cmd = t.command || t.script || '(no command)';
|
|
351
|
+
const cmd = t.command || `./${t.script}` || '(no command)';
|
|
352
352
|
const desc = t.description ? ` (${t.description})` : '';
|
|
353
353
|
choices.push({
|
|
354
354
|
name: `${cmd}${desc}`,
|
|
@@ -356,7 +356,7 @@ export async function init(targetName: string | undefined, destPath: string | un
|
|
|
356
356
|
checked: true
|
|
357
357
|
});
|
|
358
358
|
}
|
|
359
|
-
|
|
359
|
+
|
|
360
360
|
const response = await inquirer.prompt({
|
|
361
361
|
type: 'checkbox',
|
|
362
362
|
name: 'selected',
|
|
@@ -373,7 +373,7 @@ export async function init(targetName: string | undefined, destPath: string | un
|
|
|
373
373
|
selectedTaskNames = response.selected || [];
|
|
374
374
|
}
|
|
375
375
|
|
|
376
|
-
|
|
376
|
+
// Write post_config scripts for selected tasks
|
|
377
377
|
if (selectedTaskNames.length > 0 && !options.dryRun) {
|
|
378
378
|
let bashContent = '#!/bin/bash\n# Auto-generated post_config script\n\n';
|
|
379
379
|
let batContent = '@echo off\n:: Auto-generated post_config script\n\n';
|
|
@@ -444,4 +444,4 @@ function createStructure(dirPath: string, folders: FolderNode[], dryRun: boolean
|
|
|
444
444
|
createStructure(fullDirPath, folder.children, dryRun);
|
|
445
445
|
}
|
|
446
446
|
}
|
|
447
|
-
}
|
|
447
|
+
}
|