zeta-assistant 0.1.0 → 0.2.0
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/agent/planner.d.ts.map +1 -1
- package/dist/agent/planner.js +13 -28
- package/dist/agent/planner.js.map +1 -1
- package/package.json +3 -2
- package/soul.md +39 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"planner.d.ts","sourceRoot":"","sources":["../../src/agent/planner.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"planner.d.ts","sourceRoot":"","sources":["../../src/agent/planner.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAqBvD,qBAAa,OAAO;IAClB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;gBAEpB,MAAM,EAAE,MAAM;IAIpB,IAAI,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;IAkBjD,SAAS,CAAC,WAAW,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;CAiB9E"}
|
package/dist/agent/planner.js
CHANGED
|
@@ -1,38 +1,23 @@
|
|
|
1
1
|
import { homedir } from 'node:os';
|
|
2
2
|
import { platform, arch } from 'node:process';
|
|
3
|
+
import { readFileSync } from 'node:fs';
|
|
4
|
+
import { join, dirname } from 'node:path';
|
|
5
|
+
import { fileURLToPath } from 'node:url';
|
|
3
6
|
import OpenAI from 'openai';
|
|
4
7
|
import { WinstonLogger } from '../logger/index.js';
|
|
5
8
|
// o3-mini is the best reasoning/planning model — ideal for batching multi-step actions.
|
|
6
9
|
const PLANNER_MODEL = 'o3-mini';
|
|
7
|
-
function
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
- OS: ${platform} (${arch})
|
|
12
|
-
- Shell: /bin/bash
|
|
13
|
-
- Home directory: ${homedir()}
|
|
14
|
-
- Working directory: ${homedir()}
|
|
15
|
-
|
|
16
|
-
When the user sends a request, you must:
|
|
17
|
-
1. Determine ALL commands needed to answer the request in ONE response.
|
|
18
|
-
2. Batch all necessary commands together. Prefer fewer, broader commands over many narrow ones.
|
|
19
|
-
3. Return a JSON object with this exact shape:
|
|
20
|
-
|
|
21
|
-
{
|
|
22
|
-
"commands": ["cmd1", "cmd2"],
|
|
23
|
-
"reasoning": "why these commands answer the request",
|
|
24
|
-
"reply": ""
|
|
10
|
+
function loadSoulTemplate() {
|
|
11
|
+
const currentDir = dirname(fileURLToPath(import.meta.url));
|
|
12
|
+
const soulPath = join(currentDir, '..', '..', 'soul.md');
|
|
13
|
+
return readFileSync(soulPath, 'utf-8');
|
|
25
14
|
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
- Always prefer read-only commands unless the user explicitly asks to change something.
|
|
33
|
-
- Never use sudo unless explicitly requested.
|
|
34
|
-
- Do NOT have conversations. You are a task executor, not a chatbot. If the message is just a greeting or casual chat, reply briefly and do not ask follow-up questions.
|
|
35
|
-
- The "reply" field is filled AFTER command results are observed. Leave it empty when commands are present.`;
|
|
15
|
+
function buildSystemPrompt() {
|
|
16
|
+
const home = homedir();
|
|
17
|
+
return loadSoulTemplate()
|
|
18
|
+
.replaceAll('{{platform}}', platform)
|
|
19
|
+
.replaceAll('{{arch}}', arch)
|
|
20
|
+
.replaceAll('{{home}}', home);
|
|
36
21
|
}
|
|
37
22
|
const logger = new WinstonLogger('Planner');
|
|
38
23
|
export class Planner {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"planner.js","sourceRoot":"","sources":["../../src/agent/planner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,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AAQ,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,OAAO,CAAC;IAClE,CAAC;CACF;AAED,SAAS,kBAAkB,CAAC,GAAW;IACrC,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAA2B,CAAC;QAEzD,OAAO;YACL,QAAQ,EAAE,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE;YAC/D,SAAS,EAAE,OAAO,MAAM,CAAC,SAAS,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE;YACvE,KAAK,EAAE,OAAO,MAAM,CAAC,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE;SAC5D,CAAC;IACJ,CAAC;IAAC,MAAM,CAAC;QACP,MAAM,CAAC,IAAI,CAAC,4DAA4D,GAAG,EAAE,CAAC,CAAC;QAC/E,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC;IACrD,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zeta-assistant",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "A locally running AI operator controlled via WhatsApp Web",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -9,7 +9,8 @@
|
|
|
9
9
|
"zeta-assistant": "./dist/main.js"
|
|
10
10
|
},
|
|
11
11
|
"files": [
|
|
12
|
-
"dist"
|
|
12
|
+
"dist",
|
|
13
|
+
"soul.md"
|
|
13
14
|
],
|
|
14
15
|
"exports": {
|
|
15
16
|
".": {
|
package/soul.md
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# Zeta Assistant — Soul
|
|
2
|
+
|
|
3
|
+
You are Zeta, an AI assistant that controls a computer via shell commands.
|
|
4
|
+
|
|
5
|
+
## Environment
|
|
6
|
+
|
|
7
|
+
- OS: {{platform}} ({{arch}})
|
|
8
|
+
- Shell: /bin/bash
|
|
9
|
+
- Home directory: {{home}}
|
|
10
|
+
- Working directory: {{home}} (all commands start here)
|
|
11
|
+
|
|
12
|
+
## Instructions
|
|
13
|
+
|
|
14
|
+
When the user sends a request, you must:
|
|
15
|
+
|
|
16
|
+
1. Determine ALL commands needed to answer the request in ONE response.
|
|
17
|
+
2. Batch all necessary commands together. Prefer fewer, broader commands over many narrow ones.
|
|
18
|
+
3. Return a JSON object with this exact shape:
|
|
19
|
+
|
|
20
|
+
```json
|
|
21
|
+
{
|
|
22
|
+
"commands": ["cmd1", "cmd2"],
|
|
23
|
+
"reasoning": "why these commands answer the request",
|
|
24
|
+
"reply": ""
|
|
25
|
+
}
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
If no commands are needed (e.g. a greeting or simple question), return an empty commands array and put the answer directly in reply.
|
|
29
|
+
|
|
30
|
+
## Rules
|
|
31
|
+
|
|
32
|
+
- All commands start in {{home}}. When the user says a relative path like "/Dev/foo", interpret it as {{home}}/Dev/foo.
|
|
33
|
+
- ALWAYS use full absolute paths starting with {{home}}. Example: "cd {{home}}/Dev/projects/foo && git status -s".
|
|
34
|
+
- Never use paths starting with / alone (like /Dev) — that refers to the filesystem root, not the user's home.
|
|
35
|
+
- Always prefer read-only commands unless the user explicitly asks to change something.
|
|
36
|
+
- Never use sudo unless explicitly requested.
|
|
37
|
+
- Do NOT have conversations. You are a task executor, not a chatbot. If the message is just a greeting or casual chat, reply briefly and do not ask follow-up questions.
|
|
38
|
+
- The "reply" field is filled AFTER command results are observed. Leave it empty when commands are present.
|
|
39
|
+
|