@lvx74/openrrouter-ai-agent 1.0.3 → 1.0.4

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/cli.js +7 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvx74/openrrouter-ai-agent",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "description": "A powerful AI agent toolkit compatible with @openai/agents for building conversational AI with tool calling support using OpenRouter",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
package/src/cli.js CHANGED
@@ -15,6 +15,7 @@ export function createChatInterface(agent, options = {}) {
15
15
  exitCommands = ['/exit', '/quit'],
16
16
  showHelp = true,
17
17
  assistantName = 'Assistant',
18
+ historyFile = null
18
19
  } = options
19
20
 
20
21
  const rl = readline.createInterface({
@@ -76,7 +77,7 @@ export function createChatInterface(agent, options = {}) {
76
77
 
77
78
  function showHelpMessage() {
78
79
  console.log('\nšŸ“– Comandi disponibili:')
79
- console.log(` • ${exitCommands.join('/')} - Esci dalla chat`)
80
+ console.log(` • ${exitCommands.join(' ')} - Esci dalla chat`)
80
81
  console.log(' • /reset - Resetta la conversazione')
81
82
  console.log(' • /history - Mostra cronologia')
82
83
  console.log(' • /tools - Lista dei tools disponibili')
@@ -86,6 +87,7 @@ export function createChatInterface(agent, options = {}) {
86
87
 
87
88
  // Main input handler
88
89
  async function handleInput(input) {
90
+
89
91
  if (handleSpecialCommands(input)) {
90
92
  return
91
93
  }
@@ -97,6 +99,10 @@ export function createChatInterface(agent, options = {}) {
97
99
  try {
98
100
  const result = await agent.run(input)
99
101
  console.log(`\nšŸ¤– ${assistantName}: ${result.content}`)
102
+ if(historyFile) {
103
+ saveHistory(agent, historyFile)
104
+ console.log(`\nšŸ’¾ Cronologia salvata in ${historyFile}`)
105
+ }
100
106
  } catch (error) {
101
107
  console.error('\nāŒ Errore:', error.message)
102
108
  }