@heyamiko/amiko-cli 0.4.12 → 0.5.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/index.js +75768 -0
- package/package.json +26 -19
- package/PLAN.md +0 -113
- package/bun.lock +0 -743
- package/dist/__tests__/cli-non-tty.test.js +0 -74
- package/dist/agent/piAgent.js +0 -239
- package/dist/agent/tools.js +0 -149
- package/dist/app.js +0 -355
- package/dist/cli.js +0 -99
- package/dist/commands.js +0 -22
- package/dist/components/ModelPicker.js +0 -63
- package/dist/config.js +0 -26
- package/dist/configFile.js +0 -23
- package/dist/headless.js +0 -227
- package/dist/memory/qmd.js +0 -87
- package/dist/prompt.js +0 -43
- package/dist/session.js +0 -26
- package/dist/types.js +0 -1
- package/dist/workspace.js +0 -42
- package/src/__tests__/cli-non-tty.test.ts +0 -86
- package/src/agent/piAgent.ts +0 -266
- package/src/agent/tools.ts +0 -153
- package/src/app.tsx +0 -448
- package/src/cli.tsx +0 -121
- package/src/commands.ts +0 -39
- package/src/components/ModelPicker.tsx +0 -107
- package/src/config.ts +0 -31
- package/src/configFile.ts +0 -33
- package/src/headless.ts +0 -243
- package/src/memory/qmd.ts +0 -111
- package/src/prompt.ts +0 -55
- package/src/session.ts +0 -35
- package/src/types.ts +0 -40
- package/src/workspace.ts +0 -58
- package/tsconfig.json +0 -16
package/src/workspace.ts
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import fs from "node:fs/promises";
|
|
2
|
-
import path from "node:path";
|
|
3
|
-
|
|
4
|
-
const DEFAULT_IDENTITY = "# Identity\n\nYou are Amiko, a helpful CLI agent.\n";
|
|
5
|
-
const DEFAULT_PERSONALITY = "# Personality\n\n- Clear, concise, friendly.\n- Ask for clarification when unsure.\n";
|
|
6
|
-
const DEFAULT_MEMORY = "# Memory\n\n";
|
|
7
|
-
|
|
8
|
-
export type WorkspaceFiles = {
|
|
9
|
-
root: string;
|
|
10
|
-
identityPath: string;
|
|
11
|
-
personalityPath: string;
|
|
12
|
-
memoryPath: string;
|
|
13
|
-
sessionsDir: string;
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
async function ensureDir(dirPath: string) {
|
|
17
|
-
await fs.mkdir(dirPath, { recursive: true });
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
async function ensureFile(filePath: string, content: string) {
|
|
21
|
-
try {
|
|
22
|
-
await fs.access(filePath);
|
|
23
|
-
} catch {
|
|
24
|
-
await fs.writeFile(filePath, content, "utf8");
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export async function initWorkspace(root: string): Promise<WorkspaceFiles> {
|
|
29
|
-
const identityPath = path.join(root, "IDENTITY.md");
|
|
30
|
-
const personalityPath = path.join(root, "PERSONALITY.md");
|
|
31
|
-
const memoryPath = path.join(root, "MEMORY.md");
|
|
32
|
-
const sessionsDir = path.join(root, "sessions");
|
|
33
|
-
|
|
34
|
-
await ensureDir(root);
|
|
35
|
-
await ensureDir(sessionsDir);
|
|
36
|
-
|
|
37
|
-
await ensureFile(identityPath, DEFAULT_IDENTITY);
|
|
38
|
-
await ensureFile(personalityPath, DEFAULT_PERSONALITY);
|
|
39
|
-
await ensureFile(memoryPath, DEFAULT_MEMORY);
|
|
40
|
-
|
|
41
|
-
return {
|
|
42
|
-
root,
|
|
43
|
-
identityPath,
|
|
44
|
-
personalityPath,
|
|
45
|
-
memoryPath,
|
|
46
|
-
sessionsDir
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
export async function readWorkspaceFiles(files: WorkspaceFiles) {
|
|
51
|
-
const [identity, personality, memory] = await Promise.all([
|
|
52
|
-
fs.readFile(files.identityPath, "utf8"),
|
|
53
|
-
fs.readFile(files.personalityPath, "utf8"),
|
|
54
|
-
fs.readFile(files.memoryPath, "utf8")
|
|
55
|
-
]);
|
|
56
|
-
|
|
57
|
-
return { identity, personality, memory };
|
|
58
|
-
}
|
package/tsconfig.json
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "ES2022",
|
|
4
|
-
"module": "NodeNext",
|
|
5
|
-
"moduleResolution": "NodeNext",
|
|
6
|
-
"outDir": "dist",
|
|
7
|
-
"rootDir": "src",
|
|
8
|
-
"jsx": "react-jsx",
|
|
9
|
-
"strict": true,
|
|
10
|
-
"esModuleInterop": true,
|
|
11
|
-
"forceConsistentCasingInFileNames": true,
|
|
12
|
-
"skipLibCheck": true,
|
|
13
|
-
"types": ["node"]
|
|
14
|
-
},
|
|
15
|
-
"include": ["src"]
|
|
16
|
-
}
|