@avcodes/mi
Advanced tools
+2
-2
@@ -27,3 +27,3 @@ #!/usr/bin/env node | ||
| // ─ Send streaming chat completion request ─ | ||
| await loadTools(); const response = await fetch(`${(process.env.OPENAI_BASE_URL || 'https://api.openai.com').replace(/\/+$/, '')}/v1/chat/completions`, { method: 'POST', headers: { 'Content-Type': 'application/json', Authorization: `Bearer ${process.env.OPENAI_API_KEY}` }, body: JSON.stringify({ model: process.env.MODEL || 'gpt-5.4', messages, tools: toolSchemas, stream: true, ...(process.env.REASONING_EFFORT && { reasoning_effort: process.env.REASONING_EFFORT }) }) }); | ||
| await loadTools(); const response = await fetch(`${(process.env.OPENAI_BASE_URL || 'https://api.openai.com').replace(/\/+$/, '')}/v1/chat/completions`, { method: 'POST', headers: { 'Content-Type': 'application/json', Authorization: `Bearer ${process.env.OPENAI_API_KEY}` }, body: JSON.stringify({ model: process.env.MODEL || 'gpt-5.4', messages, tools: toolSchemas, stream: true, ...(process.env.REASONING_EFFORT && { reasoning_effort: process.env.REASONING_EFFORT }), ...(process.env.MI_API_PARAMS && JSON.parse(process.env.MI_API_PARAMS)) }) }); | ||
| if (!response.ok) { const body = await response.json().catch(() => ({})); throw new Error(body.error?.message || `HTTP ${response.status}`); } | ||
@@ -61,3 +61,3 @@ | ||
| const ver = JSON.parse(readFileSync(`${DIR}package.json`, 'utf8')).version; if (['-v','--version'].some(f => process.argv.includes(f))) { console.log(ver); process.exit(0); } if (['-h','--help'].some(f => process.argv.includes(f))) { console.log(`mi ${ver}\n\nusage: mi [-p prompt] [-f file] [--sandbox] [-v]\n\nmodes:\n mi -p "prompt" one-shot\n echo "..." | mi pipe\n mi repl (/reset, /new, /clear all reset history)\n\nflags:\n -p <prompt> run prompt and exit\n -f <file> attach file to context\n --sandbox run in docker\n -v, --version print version\n -h, --help show this help\n\nenv: OPENAI_API_KEY MODEL OPENAI_BASE_URL REASONING_EFFORT SYSTEM_PROMPT MI_HOME MI_IMAGE`); process.exit(0); } | ||
| const ver = JSON.parse(readFileSync(`${DIR}package.json`, 'utf8')).version; if (['-v','--version'].some(f => process.argv.includes(f))) { console.log(ver); process.exit(0); } if (['-h','--help'].some(f => process.argv.includes(f))) { console.log(`mi ${ver}\n\nusage: mi [-p prompt] [-f file] [--sandbox] [-v]\n\nmodes:\n mi -p "prompt" one-shot\n echo "..." | mi pipe\n mi repl (/reset, /new, /clear all reset history)\n\nflags:\n -p <prompt> run prompt and exit\n -f <file> attach file to context\n --sandbox run in docker\n -v, --version print version\n -h, --help show this help\n\nenv: OPENAI_API_KEY MODEL OPENAI_BASE_URL REASONING_EFFORT SYSTEM_PROMPT MI_HOME MI_IMAGE MI_API_PARAMS`); process.exit(0); } | ||
@@ -64,0 +64,0 @@ // Append -f file contents, AGENTS.md (auto-ingested repo context), and skill summaries to system message. |
+1
-1
| { | ||
| "name": "@avcodes/mi", | ||
| "version": "1.7.9", | ||
| "version": "1.7.10", | ||
| "description": "agentic coding in 30 loc. a loop, two tools, and an llm.", | ||
@@ -5,0 +5,0 @@ "type": "module", |
+1
-0
@@ -91,2 +91,3 @@ [](https://www.youtube.com/watch?v=JdMBn7FXilg) | ||
| | `MI_SANDBOX` | (unset) | truthy = always run in Docker container | | ||
| | `MI_API_PARAMS` | (unset) | JSON object merged into chat completion payload (e.g. `{"temperature":0}`) | | ||
| | `MI_IMAGE` | `ghcr.io/av/mi:latest` | docker image for sandbox mode | | ||
@@ -93,0 +94,0 @@ |
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 14 instances in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 13 instances in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
72126
0.27%257
0.39%23
9.52%