oomi-ai 0.1.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/README.md +25 -0
- package/agent_instructions.md +12 -0
- package/bin/oomi-ai.js +115 -0
- package/package.json +15 -0
package/README.md
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# oomi-ai
|
|
2
|
+
|
|
3
|
+
CLI to install Oomi agent instructions into an OpenClaw workspace.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
```
|
|
7
|
+
npm install -g oomi-ai
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
## Usage
|
|
11
|
+
```
|
|
12
|
+
oomi init
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Optional flags:
|
|
16
|
+
```
|
|
17
|
+
oomi init --workspace /path/to/openclaw/workspace
|
|
18
|
+
oomi init --agents-file /path/to/AGENTS.md
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
By default, the CLI writes to:
|
|
22
|
+
- `$OPENCLAW_WORKSPACE/AGENTS.md` (if set), otherwise
|
|
23
|
+
- `~/.openclaw/workspace/AGENTS.md`
|
|
24
|
+
|
|
25
|
+
Restart OpenClaw after running this command.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# Oomi Avatar Control
|
|
2
|
+
|
|
3
|
+
Before using avatar commands, call `get_avatar_capabilities` and prefer canonical values.
|
|
4
|
+
Inline tags are stripped from user-visible text.
|
|
5
|
+
|
|
6
|
+
Use inline tags like:
|
|
7
|
+
- [anim:Waving], [anim:Walking], [anim:Idle], [anim:Sitting Idle]
|
|
8
|
+
- [face:happy], [face:sad], [face:surprised], [face:focused], [face:gentle], [face:thinking]
|
|
9
|
+
- [gesture:nod], [gesture:think], [gesture:shrug], [gesture:wave], [gesture:bow]
|
|
10
|
+
- [look:camera], [look:left], [look:right], [look:up], [look:down]
|
|
11
|
+
|
|
12
|
+
Aliases allowed (if needed): wave -> Waving, walk -> Walking, idle -> Idle, sit/sitting -> Sitting Idle
|
package/bin/oomi-ai.js
ADDED
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import fs from 'fs';
|
|
3
|
+
import os from 'os';
|
|
4
|
+
import path from 'path';
|
|
5
|
+
|
|
6
|
+
const MARKER_START = '<oomi-agent-instructions>';
|
|
7
|
+
const MARKER_END = '</oomi-agent-instructions>';
|
|
8
|
+
|
|
9
|
+
function usage() {
|
|
10
|
+
console.log(`oomi init [--agents-file PATH] [--workspace PATH]
|
|
11
|
+
|
|
12
|
+
Installs Oomi agent instructions into OpenClaw AGENTS.md.
|
|
13
|
+
`);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
function readFile(filePath) {
|
|
17
|
+
return fs.readFileSync(filePath, 'utf-8');
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function writeFile(filePath, content) {
|
|
21
|
+
fs.writeFileSync(filePath, content);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function resolveWorkspace() {
|
|
25
|
+
const envWorkspace = process.env.OPENCLAW_WORKSPACE || process.env.OPENCLAW_HOME;
|
|
26
|
+
if (envWorkspace) return envWorkspace;
|
|
27
|
+
return path.join(os.homedir(), '.openclaw', 'workspace');
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function resolveAgentsFile(cliAgentsFile, cliWorkspace) {
|
|
31
|
+
if (cliAgentsFile) return cliAgentsFile;
|
|
32
|
+
const workspace = cliWorkspace || resolveWorkspace();
|
|
33
|
+
return path.join(workspace, 'AGENTS.md');
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function resolveInstructionsFile() {
|
|
37
|
+
return path.join(path.dirname(new URL(import.meta.url).pathname), '..', 'agent_instructions.md');
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function installBlock(agentsPath, block) {
|
|
41
|
+
let existing = '';
|
|
42
|
+
if (fs.existsSync(agentsPath)) {
|
|
43
|
+
existing = readFile(agentsPath);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
let content = '';
|
|
47
|
+
if (existing.includes(MARKER_START) && existing.includes(MARKER_END)) {
|
|
48
|
+
const pre = existing.split(MARKER_START)[0];
|
|
49
|
+
const post = existing.split(MARKER_END)[1];
|
|
50
|
+
content = `${pre}${block}${post}`;
|
|
51
|
+
} else {
|
|
52
|
+
const spacer = existing && !existing.endsWith('\n\n') ? '\n\n' : '';
|
|
53
|
+
content = `${existing}${spacer}${block}\n`;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
writeFile(agentsPath, content);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
function parseArgs(argv) {
|
|
60
|
+
const args = { command: null, agentsFile: null, workspace: null };
|
|
61
|
+
const rest = argv.slice(2);
|
|
62
|
+
if (rest.length > 0) {
|
|
63
|
+
args.command = rest[0];
|
|
64
|
+
}
|
|
65
|
+
for (let i = 1; i < rest.length; i += 1) {
|
|
66
|
+
const val = rest[i];
|
|
67
|
+
if (val === '--agents-file') {
|
|
68
|
+
args.agentsFile = rest[i + 1];
|
|
69
|
+
i += 1;
|
|
70
|
+
} else if (val === '--workspace') {
|
|
71
|
+
args.workspace = rest[i + 1];
|
|
72
|
+
i += 1;
|
|
73
|
+
} else if (val === '--help' || val === '-h') {
|
|
74
|
+
usage();
|
|
75
|
+
process.exit(0);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
return args;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
function main() {
|
|
82
|
+
const args = parseArgs(process.argv);
|
|
83
|
+
if (!args.command || args.command === 'help' || args.command === '--help') {
|
|
84
|
+
usage();
|
|
85
|
+
process.exit(0);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
if (args.command !== 'init') {
|
|
89
|
+
console.error(`Unknown command: ${args.command}`);
|
|
90
|
+
usage();
|
|
91
|
+
process.exit(1);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
const agentsPath = resolveAgentsFile(args.agentsFile, args.workspace);
|
|
95
|
+
const instructionsPath = resolveInstructionsFile();
|
|
96
|
+
|
|
97
|
+
if (!fs.existsSync(instructionsPath)) {
|
|
98
|
+
console.error('Agent instructions file not found in package.');
|
|
99
|
+
process.exit(1);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
const instructions = readFile(instructionsPath).trim();
|
|
103
|
+
const block = `${MARKER_START}\n${instructions}\n${MARKER_END}`;
|
|
104
|
+
|
|
105
|
+
const dir = path.dirname(agentsPath);
|
|
106
|
+
if (!fs.existsSync(dir)) {
|
|
107
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
installBlock(agentsPath, block);
|
|
111
|
+
console.log(`Installed Oomi agent instructions into ${agentsPath}`);
|
|
112
|
+
console.log('Restart OpenClaw to pick up changes.');
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
main();
|
package/package.json
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "oomi-ai",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Oomi CLI for OpenClaw setup",
|
|
5
|
+
"bin": {
|
|
6
|
+
"oomi": "bin/oomi-ai.js"
|
|
7
|
+
},
|
|
8
|
+
"type": "module",
|
|
9
|
+
"license": "MIT",
|
|
10
|
+
"files": [
|
|
11
|
+
"bin/oomi-ai.js",
|
|
12
|
+
"agent_instructions.md",
|
|
13
|
+
"README.md"
|
|
14
|
+
]
|
|
15
|
+
}
|