@saccolabs/tars 1.9.1 → 1.10.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
CHANGED
package/src/prompts/system.md
CHANGED
|
@@ -16,11 +16,15 @@ You are **{{ASSISTANT_NAME}}**, a personal AI assistant. You are autonomous, pro
|
|
|
16
16
|
|
|
17
17
|
## Operational Rules
|
|
18
18
|
|
|
19
|
-
- **Memory**:
|
|
20
|
-
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
19
|
+
- **Memory Management**: Tars uses a tiered memory system:
|
|
20
|
+
- **Durable Memory (`.gemini/GEMINI.md`)**: Strictly for your core identity, personality, and high-level background directives.
|
|
21
|
+
- **Explicit Instruction ONLY**: You may only write to `.gemini/GEMINI.md` (using `replace` or `write_file`) if the user explicitly instructs you to "remember this every time" or "save this to your durable memory."
|
|
22
|
+
- **Conciseness Policy**: Always read the file first to check its length. Keep it under 100 lines. If it grows too long, summarize or move older, less relevant facts to the Knowledge Base (MCP).
|
|
23
|
+
- **No `save_memory`**: Do NOT use the deprecated `save_memory` tool.
|
|
24
|
+
- **Active Memory (MCP)**: Use the `tars-memory` MCP tools for all autonomous memory operations:
|
|
25
|
+
- `memory_store_fact` / `memory_delete_fact` / `memory_list_facts` for preferences and durable rules.
|
|
26
|
+
- `memory_add_note` for daily observations and project context.
|
|
27
|
+
- `memory_search` to recall past facts and notes.
|
|
24
28
|
- **Safety**: Do **NOT** run `gemini` CLI commands or manage the `tars` supervisor process (start/stop/restart) directly. You will forcefully terminate your own active node process if you do. If a restart is required, you must ask the **USER** to do it. Use internal tools or config files for other operations.
|
|
25
29
|
- **Tools**: Use absolute file paths. Maximize parallelism and tool usage. Use background processes (`&`) for long-running shell commands.
|
|
26
30
|
- **Non-Interactive Execution**: NEVER run interactive commands that wait for user input (e.g., `npx create-next-app` without flags). ALWAYS use non-interactive flags (e.g., `--yes`, `--non-interactive`). If you are unsure what the non-interactive flags are for a specific command, search the web or command's `--help` output first.
|
|
@@ -6,6 +6,7 @@ const si = require('systeminformation');
|
|
|
6
6
|
const chokidar = require('chokidar');
|
|
7
7
|
const path = require('path');
|
|
8
8
|
const fs = require('fs');
|
|
9
|
+
const os = require('os');
|
|
9
10
|
const dotenv = require('dotenv');
|
|
10
11
|
const { exec } = require('child_process');
|
|
11
12
|
|
|
@@ -17,11 +18,12 @@ const handle = app.getRequestHandler();
|
|
|
17
18
|
|
|
18
19
|
const port = process.env.PORT || 3000;
|
|
19
20
|
const DASH_PASSWORD = process.env.DASH_PASSWORD || 'changeme';
|
|
20
|
-
|
|
21
|
+
|
|
22
|
+
// Path Agnostic Configuration
|
|
23
|
+
const REAL_HOME = process.env.REAL_HOME || os.homedir();
|
|
24
|
+
const BASE_DIR = process.env.BASE_DIR || path.join(REAL_HOME, '.tars');
|
|
21
25
|
const DATA_DIR = path.join(BASE_DIR, 'data');
|
|
22
26
|
|
|
23
|
-
// Hardcoding the real home for PM2 logs as process.env.HOME is being overriden in the tars shell environment
|
|
24
|
-
const REAL_HOME = '/home/stark';
|
|
25
27
|
const OUT_LOG = path.join(REAL_HOME, '.pm2/logs/tars-supervisor-out.log');
|
|
26
28
|
const ERR_LOG = path.join(REAL_HOME, '.pm2/logs/tars-supervisor-error.log');
|
|
27
29
|
|
|
@@ -91,22 +93,23 @@ app.prepare().then(() => {
|
|
|
91
93
|
// Tars CLI Commands
|
|
92
94
|
server.post('/api/tars/command', (req, res) => {
|
|
93
95
|
const { action, key, value } = req.body;
|
|
96
|
+
const TARS_BIN = path.join(BASE_DIR, 'apps/tars/dist/cli/index.js');
|
|
94
97
|
let command = '';
|
|
95
98
|
|
|
96
99
|
if (action === 'restart') {
|
|
97
|
-
command =
|
|
100
|
+
command = `${TARS_BIN} restart`;
|
|
98
101
|
} else if (action === 'secret' && key && value) {
|
|
99
102
|
// Basic sanitization to prevent command injection
|
|
100
103
|
const sanitizedKey = key.replace(/[^a-zA-Z0-9_]/g, '');
|
|
101
104
|
const sanitizedValue = value.replace(/'/g, "'\\''");
|
|
102
|
-
command =
|
|
105
|
+
command = `${TARS_BIN} secret set ${sanitizedKey} '${sanitizedValue}'`;
|
|
103
106
|
} else {
|
|
104
107
|
return res.status(400).json({ error: 'Invalid action or missing parameters' });
|
|
105
108
|
}
|
|
106
109
|
|
|
107
110
|
console.log(`Executing Tars Command: ${command}`);
|
|
108
|
-
//
|
|
109
|
-
exec(
|
|
111
|
+
// Inherit environment including PATH
|
|
112
|
+
exec(command, { env: process.env }, (error, stdout, stderr) => {
|
|
110
113
|
if (error) {
|
|
111
114
|
console.error(`Tars Command Error: ${error.message}`);
|
|
112
115
|
return res.status(500).json({ error: error.message, stderr });
|