suzi-cli 0.1.1 → 0.1.2
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/dist/commands/create.d.ts +3 -0
- package/dist/commands/create.d.ts.map +1 -0
- package/dist/commands/create.js +148 -0
- package/dist/commands/create.js.map +1 -0
- package/dist/commands/list-tools.d.ts.map +1 -1
- package/dist/commands/list-tools.js +187 -138
- package/dist/commands/list-tools.js.map +1 -1
- package/dist/commands/skills.d.ts.map +1 -1
- package/dist/commands/skills.js +2 -422
- package/dist/commands/skills.js.map +1 -1
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -1
- package/dist/lib/suzi-guide.d.ts +2 -0
- package/dist/lib/suzi-guide.d.ts.map +1 -0
- package/dist/lib/suzi-guide.js +427 -0
- package/dist/lib/suzi-guide.js.map +1 -0
- package/package.json +12 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../src/commands/create.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA0EpC,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA8E5D"}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.registerCreateCommand = registerCreateCommand;
|
|
7
|
+
const child_process_1 = require("child_process");
|
|
8
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
9
|
+
const fs_1 = __importDefault(require("fs"));
|
|
10
|
+
const path_1 = __importDefault(require("path"));
|
|
11
|
+
const ui_1 = require("../utils/ui");
|
|
12
|
+
const suzi_guide_1 = require("../lib/suzi-guide");
|
|
13
|
+
const AGENT_TS_TEMPLATE = `export default defineAgent({
|
|
14
|
+
meta: {
|
|
15
|
+
name: 'My Agent',
|
|
16
|
+
version: '0.1.0',
|
|
17
|
+
},
|
|
18
|
+
resources: {
|
|
19
|
+
wallet: resource.wallet('evm'),
|
|
20
|
+
},
|
|
21
|
+
lifecycle: {
|
|
22
|
+
onActivate: async (ctx) => {
|
|
23
|
+
await ctx.actions.suzi.log({ message: 'Agent activated' });
|
|
24
|
+
},
|
|
25
|
+
onDeactivate: async (ctx) => {
|
|
26
|
+
await ctx.actions.suzi.log({ message: 'Agent deactivated' });
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
triggers: {
|
|
30
|
+
manual: on.suzi.manual(async (ctx, input) => {
|
|
31
|
+
await ctx.actions.suzi.log({ message: 'Agent executed manually' });
|
|
32
|
+
return { ok: true };
|
|
33
|
+
}),
|
|
34
|
+
},
|
|
35
|
+
});
|
|
36
|
+
`;
|
|
37
|
+
function buildSuziSystemPrompt() {
|
|
38
|
+
return `<suzi-agent-creator>
|
|
39
|
+
You are helping the user create a Suzi autonomous agent. You have full knowledge of the Suzi platform, its CLI, and the agent DSL. Your job is to help the user write an agent.ts file that implements their desired strategy or automation.
|
|
40
|
+
|
|
41
|
+
The working directory contains an agent.ts template file. Help the user modify it to match their needs.
|
|
42
|
+
|
|
43
|
+
<suzi-guide>
|
|
44
|
+
${suzi_guide_1.SUZI_GUIDE_CONTENT}
|
|
45
|
+
</suzi-guide>
|
|
46
|
+
|
|
47
|
+
<rules>
|
|
48
|
+
- Agent code MUST default-export defineAgent({...})
|
|
49
|
+
- No imports allowed — agent code is self-contained
|
|
50
|
+
- The runtime provides defineAgent, on, resource, config, requirement as globals
|
|
51
|
+
- Use ctx.actions.<protocol>.<action>() for all external calls
|
|
52
|
+
- Always include at least one trigger
|
|
53
|
+
- Use ctx.actions.suzi.log() for debugging
|
|
54
|
+
- To discover available protocols and actions, run: suzi list-tools --verbose
|
|
55
|
+
- To discover actions for a specific protocol, run: suzi list-tools --protocol <name>
|
|
56
|
+
</rules>
|
|
57
|
+
|
|
58
|
+
<workflow>
|
|
59
|
+
After the agent.ts file is ready, instruct the user to:
|
|
60
|
+
1. suzi deploy ./agent.ts — deploy the agent to Suzi
|
|
61
|
+
2. suzi agents activate <id> — activate it (the deploy output shows the agent ID)
|
|
62
|
+
3. suzi agents execute <id> — test it with a manual execution
|
|
63
|
+
4. suzi agents logs <id> — check the execution logs
|
|
64
|
+
</workflow>
|
|
65
|
+
</suzi-agent-creator>`;
|
|
66
|
+
}
|
|
67
|
+
function isClaudeAvailable() {
|
|
68
|
+
try {
|
|
69
|
+
const cmd = process.platform === 'win32' ? 'where claude' : 'which claude';
|
|
70
|
+
(0, child_process_1.execSync)(cmd, { stdio: 'ignore' });
|
|
71
|
+
return true;
|
|
72
|
+
}
|
|
73
|
+
catch {
|
|
74
|
+
return false;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
function registerCreateCommand(program) {
|
|
78
|
+
program
|
|
79
|
+
.command('create [dir]')
|
|
80
|
+
.description('Create an agent with AI assistance (launches Claude Code)')
|
|
81
|
+
.option('--no-scaffold', 'Skip agent.ts template creation')
|
|
82
|
+
.action(async (dir, opts) => {
|
|
83
|
+
const workingDir = path_1.default.resolve(process.cwd(), dir || './my-agent');
|
|
84
|
+
const shouldScaffold = opts?.scaffold !== false;
|
|
85
|
+
// Check that claude CLI is available
|
|
86
|
+
if (!isClaudeAvailable()) {
|
|
87
|
+
console.log();
|
|
88
|
+
(0, ui_1.error)('Claude Code is required but not found in PATH.');
|
|
89
|
+
console.log();
|
|
90
|
+
console.log(` Install it with:`);
|
|
91
|
+
console.log(` ${ui_1.colors.primary('$')} ${chalk_1.default.white('npm install -g @anthropic-ai/claude-code')}`);
|
|
92
|
+
console.log();
|
|
93
|
+
(0, ui_1.info)('Learn more: https://docs.anthropic.com/en/docs/claude-code');
|
|
94
|
+
process.exit(1);
|
|
95
|
+
}
|
|
96
|
+
// Ensure working directory exists
|
|
97
|
+
if (!fs_1.default.existsSync(workingDir)) {
|
|
98
|
+
fs_1.default.mkdirSync(workingDir, { recursive: true });
|
|
99
|
+
}
|
|
100
|
+
const agentPath = path_1.default.join(workingDir, 'agent.ts');
|
|
101
|
+
const agentExists = fs_1.default.existsSync(agentPath);
|
|
102
|
+
// Scaffold agent.ts template
|
|
103
|
+
if (shouldScaffold && !agentExists) {
|
|
104
|
+
fs_1.default.writeFileSync(agentPath, AGENT_TS_TEMPLATE);
|
|
105
|
+
(0, ui_1.success)(`Created agent.ts template at ${path_1.default.relative(process.cwd(), agentPath)}`);
|
|
106
|
+
}
|
|
107
|
+
else if (agentExists) {
|
|
108
|
+
(0, ui_1.info)(`Using existing agent.ts at ${path_1.default.relative(process.cwd(), agentPath)}`);
|
|
109
|
+
}
|
|
110
|
+
console.log();
|
|
111
|
+
(0, ui_1.divider)();
|
|
112
|
+
console.log();
|
|
113
|
+
console.log(` ${chalk_1.default.bold('Starting AI-assisted agent creation...')}`);
|
|
114
|
+
console.log(` ${ui_1.colors.muted(`Working directory: ${workingDir}`)}`);
|
|
115
|
+
console.log(` ${ui_1.colors.muted('Type your agent idea and Claude will build it for you.')}`);
|
|
116
|
+
console.log(` ${ui_1.colors.muted('Press Ctrl+C to exit at any time.')}`);
|
|
117
|
+
console.log();
|
|
118
|
+
// Spawn claude with suzi context appended to system prompt
|
|
119
|
+
const args = [
|
|
120
|
+
'--append-system-prompt',
|
|
121
|
+
buildSuziSystemPrompt(),
|
|
122
|
+
];
|
|
123
|
+
const child = (0, child_process_1.spawn)('claude', args, {
|
|
124
|
+
stdio: 'inherit',
|
|
125
|
+
cwd: workingDir,
|
|
126
|
+
env: { ...process.env },
|
|
127
|
+
});
|
|
128
|
+
child.on('error', (err) => {
|
|
129
|
+
(0, ui_1.error)(`Failed to start Claude Code: ${err.message}`);
|
|
130
|
+
process.exit(1);
|
|
131
|
+
});
|
|
132
|
+
child.on('exit', (code) => {
|
|
133
|
+
console.log();
|
|
134
|
+
if (fs_1.default.existsSync(agentPath)) {
|
|
135
|
+
(0, ui_1.divider)();
|
|
136
|
+
console.log();
|
|
137
|
+
console.log(chalk_1.default.bold(' Next steps:'));
|
|
138
|
+
console.log();
|
|
139
|
+
console.log(` ${ui_1.colors.primary('$')} ${chalk_1.default.white(`suzi deploy ${path_1.default.relative(process.cwd(), agentPath)}`)}`);
|
|
140
|
+
console.log(` ${ui_1.colors.primary('$')} ${chalk_1.default.white('suzi agents activate <id>')}`);
|
|
141
|
+
console.log(` ${ui_1.colors.primary('$')} ${chalk_1.default.white('suzi agents execute <id>')}`);
|
|
142
|
+
console.log();
|
|
143
|
+
}
|
|
144
|
+
process.exit(code ?? 0);
|
|
145
|
+
});
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
//# sourceMappingURL=create.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create.js","sourceRoot":"","sources":["../../src/commands/create.ts"],"names":[],"mappings":";;;;;AA0EA,sDA8EC;AAvJD,iDAAgD;AAChD,kDAA0B;AAC1B,4CAAoB;AACpB,gDAAwB;AACxB,oCAA4E;AAC5E,kDAAuD;AAEvD,MAAM,iBAAiB,GAAG;;;;;;;;;;;;;;;;;;;;;;;CAuBzB,CAAC;AAEF,SAAS,qBAAqB;IAC5B,OAAO;;;;;;EAMP,+BAAkB;;;;;;;;;;;;;;;;;;;;;sBAqBE,CAAC;AACvB,CAAC;AAED,SAAS,iBAAiB;IACxB,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,OAAO,CAAC,QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,cAAc,CAAC;QAC3E,IAAA,wBAAQ,EAAC,GAAG,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAC;QACnC,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC;AAED,SAAgB,qBAAqB,CAAC,OAAgB;IACpD,O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E,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"list-tools.d.ts","sourceRoot":"","sources":["../../src/commands/list-tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA0GpC,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAqI/D"}
|
|
@@ -5,159 +5,208 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.registerListToolsCommand = registerListToolsCommand;
|
|
7
7
|
const chalk_1 = __importDefault(require("chalk"));
|
|
8
|
+
const fs_1 = __importDefault(require("fs"));
|
|
9
|
+
const path_1 = __importDefault(require("path"));
|
|
10
|
+
const os_1 = __importDefault(require("os"));
|
|
8
11
|
const ui_1 = require("../utils/ui");
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
name: 'suzi',
|
|
93
|
-
description: 'Platform utilities (storage, logging, notifications)',
|
|
94
|
-
chain: 'N/A',
|
|
95
|
-
actions: [
|
|
96
|
-
{ name: 'set_to_store', type: 'write', description: 'Save key-value data' },
|
|
97
|
-
{ name: 'get_from_store', type: 'read', description: 'Read stored data' },
|
|
98
|
-
{ name: 'log', type: 'write', description: 'Write to agent logs' },
|
|
99
|
-
{ name: 'notify', type: 'write', description: 'Send notification (Telegram)' },
|
|
100
|
-
{ name: 'get_evm_address', type: 'read', description: 'Get agent EVM wallet' },
|
|
101
|
-
{ name: 'get_svm_address', type: 'read', description: 'Get agent SOL wallet' },
|
|
102
|
-
{ name: 'sleep', type: 'write', description: 'Pause execution' },
|
|
103
|
-
],
|
|
104
|
-
},
|
|
105
|
-
];
|
|
12
|
+
const api_1 = require("../lib/api");
|
|
13
|
+
const CACHE_DIR = path_1.default.join(os_1.default.homedir(), '.suzi');
|
|
14
|
+
const CACHE_PATH = path_1.default.join(CACHE_DIR, 'actions-cache.json');
|
|
15
|
+
const CACHE_TTL = 60 * 60 * 1000; // 1 hour
|
|
16
|
+
function readCache() {
|
|
17
|
+
try {
|
|
18
|
+
if (fs_1.default.existsSync(CACHE_PATH)) {
|
|
19
|
+
const raw = fs_1.default.readFileSync(CACHE_PATH, 'utf-8');
|
|
20
|
+
return JSON.parse(raw);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
catch {
|
|
24
|
+
// Corrupted cache — ignore
|
|
25
|
+
}
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
function writeCache(data) {
|
|
29
|
+
try {
|
|
30
|
+
if (!fs_1.default.existsSync(CACHE_DIR)) {
|
|
31
|
+
fs_1.default.mkdirSync(CACHE_DIR, { recursive: true });
|
|
32
|
+
}
|
|
33
|
+
fs_1.default.writeFileSync(CACHE_PATH, JSON.stringify(data, null, 2));
|
|
34
|
+
}
|
|
35
|
+
catch {
|
|
36
|
+
// Best-effort caching — don't fail the command if disk write fails
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
async function fetchActions() {
|
|
40
|
+
const res = await (0, api_1.get)('/api/actions');
|
|
41
|
+
if (!res.ok || !res.data?.ok) {
|
|
42
|
+
throw new Error(res.data?.error ?? `API returned status ${res.status}`);
|
|
43
|
+
}
|
|
44
|
+
return res.data.actions;
|
|
45
|
+
}
|
|
46
|
+
async function getActions(forceRefresh = false) {
|
|
47
|
+
if (!forceRefresh) {
|
|
48
|
+
const cache = readCache();
|
|
49
|
+
if (cache && Date.now() - cache.fetchedAt < CACHE_TTL) {
|
|
50
|
+
return cache.actions;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
const actions = await fetchActions();
|
|
54
|
+
writeCache({ fetchedAt: Date.now(), actions });
|
|
55
|
+
return actions;
|
|
56
|
+
}
|
|
57
|
+
function cacheAge() {
|
|
58
|
+
const cache = readCache();
|
|
59
|
+
if (!cache)
|
|
60
|
+
return null;
|
|
61
|
+
const mins = Math.floor((Date.now() - cache.fetchedAt) / 60000);
|
|
62
|
+
if (mins < 1)
|
|
63
|
+
return 'just now';
|
|
64
|
+
if (mins < 60)
|
|
65
|
+
return `${mins}m ago`;
|
|
66
|
+
return `${Math.floor(mins / 60)}h ${mins % 60}m ago`;
|
|
67
|
+
}
|
|
68
|
+
function chainBadge(actions) {
|
|
69
|
+
const chains = new Set();
|
|
70
|
+
for (const action of actions) {
|
|
71
|
+
for (const w of action.requires?.wallet ?? []) {
|
|
72
|
+
chains.add(w);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
const badges = [];
|
|
76
|
+
if (chains.has('evm'))
|
|
77
|
+
badges.push(ui_1.colors.evm('[EVM]'));
|
|
78
|
+
if (chains.has('svm'))
|
|
79
|
+
badges.push(ui_1.colors.sol('[SOL]'));
|
|
80
|
+
return badges.length > 0 ? badges.join(' ') : ui_1.colors.muted('[N/A]');
|
|
81
|
+
}
|
|
82
|
+
function isReadAction(name) {
|
|
83
|
+
const actionName = name.includes('.') ? name.split('.')[1] : name;
|
|
84
|
+
return /^(get_|list_|public_|search)/.test(actionName);
|
|
85
|
+
}
|
|
86
|
+
function groupByProtocol(actions) {
|
|
87
|
+
const groups = new Map();
|
|
88
|
+
for (const action of actions) {
|
|
89
|
+
const group = groups.get(action.protocol) ?? [];
|
|
90
|
+
group.push(action);
|
|
91
|
+
groups.set(action.protocol, group);
|
|
92
|
+
}
|
|
93
|
+
return groups;
|
|
94
|
+
}
|
|
106
95
|
function registerListToolsCommand(program) {
|
|
107
|
-
program
|
|
96
|
+
const cmd = program
|
|
108
97
|
.command('list-tools')
|
|
109
98
|
.alias('tools')
|
|
110
99
|
.description('List all available protocols and actions')
|
|
111
100
|
.option('--protocol <name>', 'Filter by protocol name')
|
|
112
101
|
.option('--verbose', 'Show all actions per protocol')
|
|
113
|
-
.action(
|
|
114
|
-
(
|
|
115
|
-
|
|
116
|
-
const filtered = opts.protocol
|
|
117
|
-
? PROTOCOLS.filter((p) => p.name === opts.protocol)
|
|
118
|
-
: PROTOCOLS;
|
|
119
|
-
if (filtered.length === 0) {
|
|
120
|
-
(0, ui_1.info)(`Protocol "${opts.protocol}" not found.`);
|
|
121
|
-
(0, ui_1.info)(`Available: ${PROTOCOLS.map((p) => p.name).join(', ')}`);
|
|
102
|
+
.option('--schema <action>', 'Show JSON schema for a specific action (requires --protocol)')
|
|
103
|
+
.action(async (opts) => {
|
|
104
|
+
if (!(0, ui_1.requireAuth)())
|
|
122
105
|
return;
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
const
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
106
|
+
try {
|
|
107
|
+
const actions = await getActions();
|
|
108
|
+
const grouped = groupByProtocol(actions);
|
|
109
|
+
// --schema: show schema for a single action
|
|
110
|
+
if (opts.schema) {
|
|
111
|
+
if (!opts.protocol) {
|
|
112
|
+
(0, ui_1.error)('--schema requires --protocol. Example: suzi list-tools --protocol polymarket --schema place_order');
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
const protocolActions = grouped.get(opts.protocol);
|
|
116
|
+
if (!protocolActions) {
|
|
117
|
+
(0, ui_1.error)(`Protocol "${opts.protocol}" not found.`);
|
|
118
|
+
(0, ui_1.info)(`Available: ${Array.from(grouped.keys()).join(', ')}`);
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
const fullName = `${opts.protocol}.${opts.schema}`;
|
|
122
|
+
const match = protocolActions.find((a) => a.name === fullName);
|
|
123
|
+
if (!match) {
|
|
124
|
+
(0, ui_1.error)(`Action "${opts.schema}" not found in ${opts.protocol}.`);
|
|
125
|
+
(0, ui_1.info)('Available actions:');
|
|
126
|
+
for (const a of protocolActions) {
|
|
127
|
+
const short = a.name.includes('.') ? a.name.split('.')[1] : a.name;
|
|
128
|
+
console.log(` ${ui_1.colors.highlight(short)} ${ui_1.colors.muted(a.description)}`);
|
|
140
129
|
}
|
|
130
|
+
return;
|
|
141
131
|
}
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
132
|
+
console.log(JSON.stringify(match.parameters, null, 2));
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
135
|
+
// Default: list protocols and actions
|
|
136
|
+
(0, ui_1.header)('Available Tools');
|
|
137
|
+
console.log();
|
|
138
|
+
const protocols = opts.protocol
|
|
139
|
+
? [[opts.protocol, grouped.get(opts.protocol)]]
|
|
140
|
+
: Array.from(grouped.entries());
|
|
141
|
+
if (opts.protocol && !grouped.has(opts.protocol)) {
|
|
142
|
+
(0, ui_1.error)(`Protocol "${opts.protocol}" not found.`);
|
|
143
|
+
(0, ui_1.info)(`Available: ${Array.from(grouped.keys()).join(', ')}`);
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
for (const [protocol, protocolActions] of protocols) {
|
|
147
|
+
if (!protocolActions)
|
|
148
|
+
continue;
|
|
149
|
+
const badge = chainBadge(protocolActions);
|
|
150
|
+
console.log(` ${chalk_1.default.bold(protocol)} ${badge}`);
|
|
151
|
+
const showDetails = opts.verbose || opts.protocol;
|
|
152
|
+
if (showDetails) {
|
|
153
|
+
const readActions = protocolActions.filter((a) => isReadAction(a.name));
|
|
154
|
+
const writeActions = protocolActions.filter((a) => !isReadAction(a.name));
|
|
155
|
+
if (writeActions.length > 0) {
|
|
156
|
+
console.log();
|
|
157
|
+
console.log(` ${chalk_1.default.yellow('Write Actions:')}`);
|
|
158
|
+
for (const action of writeActions) {
|
|
159
|
+
const shortName = action.name.includes('.') ? action.name.split('.')[1] : action.name;
|
|
160
|
+
console.log(` ${ui_1.colors.highlight(shortName)} ${ui_1.colors.muted(action.description)}`);
|
|
161
|
+
}
|
|
147
162
|
}
|
|
163
|
+
if (readActions.length > 0) {
|
|
164
|
+
console.log();
|
|
165
|
+
console.log(` ${chalk_1.default.cyan('Read Actions:')}`);
|
|
166
|
+
for (const action of readActions) {
|
|
167
|
+
const shortName = action.name.includes('.') ? action.name.split('.')[1] : action.name;
|
|
168
|
+
console.log(` ${ui_1.colors.highlight(shortName)} ${ui_1.colors.muted(action.description)}`);
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
else {
|
|
173
|
+
const writeCount = protocolActions.filter((a) => !isReadAction(a.name)).length;
|
|
174
|
+
const readCount = protocolActions.filter((a) => isReadAction(a.name)).length;
|
|
175
|
+
console.log(` ${ui_1.colors.muted(`${writeCount} write`)} + ${ui_1.colors.muted(`${readCount} read`)} actions`);
|
|
148
176
|
}
|
|
177
|
+
console.log();
|
|
149
178
|
}
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
179
|
+
const totalActions = actions.length;
|
|
180
|
+
(0, ui_1.divider)();
|
|
181
|
+
(0, ui_1.info)(`${grouped.size} protocols, ${totalActions} total actions`);
|
|
182
|
+
const age = cacheAge();
|
|
183
|
+
if (age) {
|
|
184
|
+
(0, ui_1.info)(`Cached ${age}. Run ${chalk_1.default.cyan('suzi list-tools reload')} to refresh.`);
|
|
154
185
|
}
|
|
155
|
-
|
|
186
|
+
if (!opts.verbose && !opts.protocol) {
|
|
187
|
+
(0, ui_1.info)('Use --verbose or --protocol <name> for details.');
|
|
188
|
+
}
|
|
189
|
+
(0, ui_1.info)(`Use ${chalk_1.default.cyan('suzi list-tools --protocol <name> --schema <action>')} to view schema.`);
|
|
190
|
+
}
|
|
191
|
+
catch (err) {
|
|
192
|
+
(0, ui_1.error)(`Failed to fetch actions: ${err.message}`);
|
|
193
|
+
}
|
|
194
|
+
});
|
|
195
|
+
cmd
|
|
196
|
+
.command('reload')
|
|
197
|
+
.description('Force-refresh the actions cache from the API')
|
|
198
|
+
.action(async () => {
|
|
199
|
+
if (!(0, ui_1.requireAuth)())
|
|
200
|
+
return;
|
|
201
|
+
try {
|
|
202
|
+
(0, ui_1.info)('Fetching actions from API...');
|
|
203
|
+
const actions = await getActions(true);
|
|
204
|
+
const grouped = groupByProtocol(actions);
|
|
205
|
+
(0, ui_1.info)(`Cache refreshed: ${grouped.size} protocols, ${actions.length} actions.`);
|
|
206
|
+
}
|
|
207
|
+
catch (err) {
|
|
208
|
+
(0, ui_1.error)(`Failed to refresh: ${err.message}`);
|
|
156
209
|
}
|
|
157
|
-
const totalActions = PROTOCOLS.reduce((sum, p) => sum + p.actions.length, 0);
|
|
158
|
-
(0, ui_1.divider)();
|
|
159
|
-
(0, ui_1.info)(`${PROTOCOLS.length} protocols, ${totalActions} total actions`);
|
|
160
|
-
(0, ui_1.info)('Use --verbose or --protocol <name> for details.');
|
|
161
210
|
});
|
|
162
211
|
}
|
|
163
212
|
//# sourceMappingURL=list-tools.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list-tools.js","sourceRoot":"","sources":["../../src/commands/list-tools.ts"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"list-tools.js","sourceRoot":"","sources":["../../src/commands/list-tools.ts"],"names":[],"mappings":";;;;;AA0GA,4DAqIC;AA9OD,kDAA0B;AAC1B,4CAAoB;AACpB,gDAAwB;AACxB,4CAAoB;AACpB,oCAA4F;AAC5F,oCAAiC;AAejC,MAAM,SAAS,GAAG,cAAI,CAAC,IAAI,CAAC,YAAE,CAAC,OAAO,EAAE,EAAE,OAAO,CAAC,CAAC;AACnD,MAAM,UAAU,GAAG,cAAI,CAAC,IAAI,CAAC,SAAS,EAAE,oBAAoB,CAAC,CAAC;AAC9D,MAAM,SAAS,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC,SAAS;AAE3C,SAAS,SAAS;IAChB,IAAI,CAAC;QACH,IAAI,YAAE,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;YAC9B,MAAM,GAAG,GAAG,YAAE,CAAC,YAAY,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;YACjD,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAiB,CAAC;QACzC,CAAC;IACH,CAAC;IAAC,MAAM,CAAC;QACP,2BAA2B;IAC7B,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED,SAAS,UAAU,CAAC,IAAkB;IACpC,IAAI,CAAC;QACH,IAAI,CAAC,YAAE,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC;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O,GAAQ,EAAE,CAAC;YAClB,IAAA,UAAQ,EAAC,4BAA4B,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC;QACtD,CAAC;IACH,CAAC,CAAC,CAAC;IAEL,GAAG;SACA,OAAO,CAAC,QAAQ,CAAC;SACjB,WAAW,CAAC,8CAA8C,CAAC;SAC3D,MAAM,CAAC,KAAK,IAAI,EAAE;QACjB,IAAI,CAAC,IAAA,gBAAW,GAAE;YAAE,OAAO;QAE3B,IAAI,CAAC;YACH,IAAA,SAAI,EAAC,8BAA8B,CAAC,CAAC;YACrC,MAAM,OAAO,GAAG,MAAM,UAAU,CAAC,IAAI,CAAC,CAAC;YACvC,MAAM,OAAO,GAAG,eAAe,CAAC,OAAO,CAAC,CAAC;YACzC,IAAA,SAAI,EAAC,oBAAoB,OAAO,CAAC,IAAI,eAAe,OAAO,CAAC,MAAM,WAAW,CAAC,CAAC;QACjF,CAAC;QAAC,OAAO,GAAQ,EAAE,CAAC;YAClB,IAAA,UAAQ,EAAC,sBAAsB,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC;QAChD,CAAC;IACH,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skills.d.ts","sourceRoot":"","sources":["../../src/commands/skills.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"skills.d.ts","sourceRoot":"","sources":["../../src/commands/skills.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAkDpC,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA6H5D"}
|