65 lines
1.7 KiB
JavaScript
65 lines
1.7 KiB
JavaScript
/**
|
|
* Artisan subcommands the `artisan` tool is willing to run.
|
|
* Anything not on this list is rejected — the agent must not pass arbitrary
|
|
* artisan commands (e.g. `tinker` interactive, `db:wipe` without confirm, etc.).
|
|
*
|
|
* Destructive commands additionally require `confirm: true` in the tool call.
|
|
*/
|
|
export const ARTISAN_ALLOWED = [
|
|
'make:controller',
|
|
'make:model',
|
|
'make:migration',
|
|
'make:seeder',
|
|
'make:factory',
|
|
'make:request',
|
|
'make:resource',
|
|
'make:middleware',
|
|
'make:job',
|
|
'make:event',
|
|
'make:listener',
|
|
'make:mail',
|
|
'make:notification',
|
|
'make:policy',
|
|
'make:command',
|
|
'make:test',
|
|
'migrate',
|
|
'migrate:rollback',
|
|
'migrate:status',
|
|
'migrate:fresh',
|
|
'migrate:refresh',
|
|
'migrate:reset',
|
|
'db:seed',
|
|
'db:wipe',
|
|
'route:list',
|
|
'config:clear',
|
|
'config:cache',
|
|
'cache:clear',
|
|
'view:clear',
|
|
'route:clear',
|
|
'optimize:clear',
|
|
'queue:work',
|
|
'queue:listen',
|
|
'queue:failed',
|
|
'queue:retry',
|
|
'queue:batches',
|
|
'queue:clear',
|
|
'reverb:start',
|
|
'storage:link',
|
|
'key:generate',
|
|
'about',
|
|
'list',
|
|
];
|
|
/** Commands that mutate/destroy data and therefore require confirm: true. */
|
|
export const ARTISAN_DESTRUCTIVE = new Set([
|
|
'migrate:fresh',
|
|
'migrate:refresh',
|
|
'migrate:reset',
|
|
'db:wipe',
|
|
'queue:clear',
|
|
]);
|
|
/** Long-running commands tracked via processManager instead of runCommand. */
|
|
export const ARTISAN_BACKGROUND = new Set(['queue:work', 'queue:listen', 'reverb:start']);
|
|
export function isAllowedArtisanCommand(command) {
|
|
return ARTISAN_ALLOWED.includes(command);
|
|
}
|
|
//# sourceMappingURL=artisanAllowList.js.map
|