nothumanallowed 8.6.0 → 8.6.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/package.json +1 -1
- package/src/cli.mjs +7 -1
- package/src/commands/ask.mjs +58 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nothumanallowed",
|
|
3
|
-
"version": "8.6.
|
|
3
|
+
"version": "8.6.1",
|
|
4
4
|
"description": "NotHumanAllowed — 38 AI agents + unified productivity suite. Gmail, Calendar, Drive, Contacts, Tasks, GitHub, Notion, Slack, voice chat, smart scheduler. Zero-dependency CLI.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
package/src/cli.mjs
CHANGED
|
@@ -8,7 +8,7 @@ import { spawnCore } from './spawn.mjs';
|
|
|
8
8
|
import { loadConfig, setConfigValue } from './config.mjs';
|
|
9
9
|
import { checkForUpdates, runUpdate, checkNpmVersion } from './updater.mjs';
|
|
10
10
|
import { download } from './downloader.mjs';
|
|
11
|
-
import { cmdAsk, cmdAgentCreate } from './commands/ask.mjs';
|
|
11
|
+
import { cmdAsk, cmdAgentCreate, cmdAgentList, cmdAgentDelete } from './commands/ask.mjs';
|
|
12
12
|
import { cmdPlan } from './commands/plan.mjs';
|
|
13
13
|
import { cmdTasks } from './commands/tasks.mjs';
|
|
14
14
|
import { cmdOps } from './commands/ops.mjs';
|
|
@@ -60,6 +60,12 @@ export async function main(argv) {
|
|
|
60
60
|
case 'agent:create':
|
|
61
61
|
return cmdAgentCreate(args);
|
|
62
62
|
|
|
63
|
+
case 'agent:list':
|
|
64
|
+
return cmdAgentList();
|
|
65
|
+
|
|
66
|
+
case 'agent:delete':
|
|
67
|
+
return cmdAgentDelete(args);
|
|
68
|
+
|
|
63
69
|
case 'run':
|
|
64
70
|
return cmdRun(args);
|
|
65
71
|
|
package/src/commands/ask.mjs
CHANGED
|
@@ -195,6 +195,64 @@ export async function cmdAsk(args) {
|
|
|
195
195
|
* nha agent:create <name> <tagline> <system-prompt>
|
|
196
196
|
* Creates a custom agent file in ~/.nha/agents/
|
|
197
197
|
*/
|
|
198
|
+
/**
|
|
199
|
+
* nha agent:list — Show all available agents (built-in + custom)
|
|
200
|
+
*/
|
|
201
|
+
export async function cmdAgentList() {
|
|
202
|
+
info('Built-in agents:');
|
|
203
|
+
for (const name of AGENTS) {
|
|
204
|
+
const agentFile = path.join(AGENTS_DIR, `${name}.mjs`);
|
|
205
|
+
if (fs.existsSync(agentFile)) {
|
|
206
|
+
const source = fs.readFileSync(agentFile, 'utf-8');
|
|
207
|
+
const { card } = parseAgentFile(source, name);
|
|
208
|
+
console.log(` ${C}${name.padEnd(16)}${NC} ${D}${card?.tagline || card?.category || ''}${NC}`);
|
|
209
|
+
} else {
|
|
210
|
+
console.log(` ${D}${name.padEnd(16)} (not downloaded)${NC}`);
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
// Custom agents
|
|
215
|
+
if (fs.existsSync(AGENTS_DIR)) {
|
|
216
|
+
const custom = fs.readdirSync(AGENTS_DIR)
|
|
217
|
+
.filter(f => f.endsWith('.mjs'))
|
|
218
|
+
.map(f => f.replace('.mjs', ''))
|
|
219
|
+
.filter(n => !AGENTS.includes(n));
|
|
220
|
+
if (custom.length > 0) {
|
|
221
|
+
console.log(`\n${Y}Custom agents:${NC}`);
|
|
222
|
+
for (const name of custom) {
|
|
223
|
+
const source = fs.readFileSync(path.join(AGENTS_DIR, `${name}.mjs`), 'utf-8');
|
|
224
|
+
const { card } = parseAgentFile(source, name);
|
|
225
|
+
console.log(` ${Y}${name.padEnd(16)}${NC} ${D}${card?.tagline || ''}${NC}`);
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
console.log(`\n ${D}Invoke: nha ask <agent> "prompt"${NC}`);
|
|
230
|
+
console.log(` ${D}Create: nha agent:create <name> "<tagline>" "<system prompt>"${NC}`);
|
|
231
|
+
console.log(` ${D}Delete: nha agent:delete <name>${NC}\n`);
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
/**
|
|
235
|
+
* nha agent:delete <name> — Delete a custom agent
|
|
236
|
+
*/
|
|
237
|
+
export async function cmdAgentDelete(args) {
|
|
238
|
+
const name = (args[0] || '').toLowerCase();
|
|
239
|
+
if (!name) {
|
|
240
|
+
fail('Usage: nha agent:delete <agent-name>');
|
|
241
|
+
process.exit(1);
|
|
242
|
+
}
|
|
243
|
+
if (AGENTS.includes(name)) {
|
|
244
|
+
fail(`"${name}" is a built-in agent and cannot be deleted.`);
|
|
245
|
+
process.exit(1);
|
|
246
|
+
}
|
|
247
|
+
const agentFile = path.join(AGENTS_DIR, `${name}.mjs`);
|
|
248
|
+
if (!fs.existsSync(agentFile)) {
|
|
249
|
+
fail(`Agent "${name}" not found.`);
|
|
250
|
+
process.exit(1);
|
|
251
|
+
}
|
|
252
|
+
fs.unlinkSync(agentFile);
|
|
253
|
+
ok(`Agent "${name}" deleted.`);
|
|
254
|
+
}
|
|
255
|
+
|
|
198
256
|
export async function cmdAgentCreate(args) {
|
|
199
257
|
const name = (args[0] || '').toLowerCase().replace(/[^a-z0-9_-]/g, '');
|
|
200
258
|
const tagline = args[1] || '';
|