clawlet 0.1.0 → 0.2.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.
Files changed (3) hide show
  1. package/README.md +25 -17
  2. package/package.json +1 -1
  3. package/src/agent.ts +12 -3
package/README.md CHANGED
@@ -32,8 +32,16 @@ TELEGRAM_BOT_TOKEN=
32
32
  ```
33
33
 
34
34
  3. Install and run clawlet cli
35
-
36
- You will need nodejs and a package manager (like pnpm) or npm:
35
+
36
+ If you want to use the published release use:
37
+
38
+ ```
39
+ $ npx clawlet
40
+ ```
41
+
42
+ ## Development Version
43
+
44
+ If you cloned this repository run:
37
45
 
38
46
  ```
39
47
  $ pnpm install
@@ -43,25 +51,25 @@ $ pnpm start
43
51
  ## Roadmap
44
52
 
45
53
  * features
46
- - [ ] handle session history
47
- - [ ] read/write files and trash in workspace folder
48
- - [ ] git history for workspace folder
49
- - [ ] <AGENTS.md> support
50
- - [ ] <SOUL.md> support
51
- - [ ] users details at USER.md
52
- - [ ] assistants details at IDENTITY.md
53
- - [ ] daily memory in memory/*.md
54
- - [ ] longterm memory in MEMORY.md
54
+ - [x] handle session history
55
+ - [x] read/write files and trash in workspace folder
56
+ - [x] git history for workspace folder
57
+ - [x] <AGENTS.md> support
58
+ - [x] <SOUL.md> support
59
+ - [x] users details at USER.md
60
+ - [x] assistants details at IDENTITY.md
61
+ - [x] daily memory in memory/*.md
62
+ - [x] longterm memory in MEMORY.md
55
63
  - [ ] heartbeat crons via HEARTBEAT.md
56
- - [ ] <SKILL.md> support (install + use and sandbox)
57
- - [ ] permission handling for skills
58
- - [ ] connection for api keys and credentials
64
+ - [x] <SKILL.md> support (install + use and sandbox)
65
+ - [x] permission handling for skills
66
+ - [x] connection for api keys and credentials
59
67
  - [ ] add mcp configuration
60
68
  * local llm
61
- - [ ] support mlx locally on macosx M3++
69
+ - [x] support mlx locally on macosx M3++
62
70
  * messaging
63
- - [ ] chat via command line interface
64
- - [ ] chat via telegram bot
71
+ - [x] chat via command line interface
72
+ - [x] chat via telegram bot
65
73
  * make available with (p)npx
66
74
  * operating system support
67
75
  - [x] runs on macosx
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clawlet",
3
- "version": "0.1.0",
3
+ "version": "0.2.1",
4
4
  "description": "A lightweight AI based personal assistant.",
5
5
  "main": "src/cli.ts",
6
6
  "type": "module",
package/src/agent.ts CHANGED
@@ -14,8 +14,14 @@ import { createOpenAICompatible } from '@ai-sdk/openai-compatible';
14
14
  import 'dotenv/config';
15
15
  import { hermesToolMiddleware } from '@ai-sdk-tool/parser';
16
16
  import { AgentMemory } from './memory.js';
17
- import { readFile, writeFile, copyFile, access } from 'node:fs/promises';
17
+ import { readFile, writeFile, copyFile, access, mkdir } from 'node:fs/promises';
18
18
  import path from 'path';
19
+ import { fileURLToPath } from 'node:url';
20
+
21
+ // Resolve the package root directory (where template/ lives), independent of cwd
22
+ const __filename = fileURLToPath(import.meta.url);
23
+ const __dirname = path.dirname(__filename);
24
+ const PACKAGE_ROOT = path.resolve(__dirname, '..');
19
25
 
20
26
  // --- ADAPTER INTERFACES ---
21
27
 
@@ -1121,15 +1127,18 @@ export class Agent {
1121
1127
  this.initialized = true;
1122
1128
 
1123
1129
  // Bootstrap: copy AGENTS.template -> workspace/AGENTS.md if missing
1130
+ // Templates are resolved from the package install directory (PACKAGE_ROOT),
1131
+ // NOT from process.cwd(), so this works correctly via npx/global install.
1124
1132
  const workspaceDir = path.join(process.cwd(), 'workspace');
1125
1133
  const agentsMdPath = path.join(workspaceDir, 'AGENTS.md');
1126
- const templatePath = path.join(process.cwd(), 'template', 'AGENTS.template');
1134
+ const templatePath = path.join(PACKAGE_ROOT, 'template', 'AGENTS.template');
1127
1135
 
1128
1136
  try {
1129
1137
  await access(agentsMdPath);
1130
1138
  } catch {
1131
1139
  // AGENTS.md does not exist, copy from template
1132
1140
  try {
1141
+ await mkdir(workspaceDir, { recursive: true });
1133
1142
  await copyFile(templatePath, agentsMdPath);
1134
1143
  console.log(` 📋 Copied AGENTS.template -> workspace/AGENTS.md`);
1135
1144
  } catch (e: any) {
@@ -1151,7 +1160,7 @@ export class Agent {
1151
1160
 
1152
1161
  if (needsBootstrap) {
1153
1162
  try {
1154
- const bootstrapPath = path.join(process.cwd(), 'template', 'BOOTSTRAP.md');
1163
+ const bootstrapPath = path.join(PACKAGE_ROOT, 'template', 'BOOTSTRAP.md');
1155
1164
  this.bootstrapPrompt = await readFile(bootstrapPath, 'utf-8');
1156
1165
  console.log(` 🚀 Bootstrap mode: SOUL.md, IDENTITY.md, or USER.md missing. Running BOOTSTRAP.md first.`);
1157
1166
  } catch (e: any) {