@time-machine-lab/tmlbrain 0.1.0 → 0.1.2
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 +55 -14
- package/bin/tmlbrain.js +460 -57
- package/docs/architecture.md +20 -1
- package/docs/backup.md +57 -5
- package/docs/indexing.md +23 -4
- package/docs/install.md +44 -15
- package/docs/runtime.md +26 -9
- package/docs/server-api.md +62 -13
- package/docs/sync.md +24 -4
- package/package.json +3 -1
- package/scripts/backup/scheduled-backup.sh +32 -0
- package/scripts/backup/tmlbrain-backup.service +9 -0
- package/scripts/backup/tmlbrain-backup.timer +10 -0
- package/scripts/docker/server-entrypoint.sh +5 -1
- package/scripts/release/parse-auto-release.js +1 -1
- package/skills/tmlbrain/SKILL.md +34 -10
|
@@ -12,7 +12,7 @@ BARE_REPO="${TMLBRAIN_BARE_REPO:-$DATA_DIR/tmlbrain.git}"
|
|
|
12
12
|
KNOWLEDGE_REPO="${TMLBRAIN_KNOWLEDGE_REPO:-}"
|
|
13
13
|
KNOWLEDGE_REF="${TMLBRAIN_KNOWLEDGE_REF:-main}"
|
|
14
14
|
HOST="${TMLBRAIN_HOST:-0.0.0.0}"
|
|
15
|
-
PORT="${TMLBRAIN_PORT:-
|
|
15
|
+
PORT="${TMLBRAIN_PORT:-8477}"
|
|
16
16
|
|
|
17
17
|
mkdir -p "$DATA_DIR"
|
|
18
18
|
|
|
@@ -81,4 +81,8 @@ fi
|
|
|
81
81
|
|
|
82
82
|
git push -u origin HEAD:main >/dev/null 2>&1 || true
|
|
83
83
|
|
|
84
|
+
if [ "${TMLBRAIN_BACKUP_INTERVAL_SECONDS:-0}" != "0" ]; then
|
|
85
|
+
TMLBRAIN_WORKTREE="$WORKTREE" TMLBRAIN_APP_DIR="/app" /app/scripts/backup/scheduled-backup.sh &
|
|
86
|
+
fi
|
|
87
|
+
|
|
84
88
|
exec node /app/bin/tmlbrain.js serve --host "$HOST" --port "$PORT"
|
package/skills/tmlbrain/SKILL.md
CHANGED
|
@@ -29,9 +29,13 @@ the TMLBrain knowledge base.
|
|
|
29
29
|
|
|
30
30
|
- When a user says "archive to the knowledge base", "store this", "save this",
|
|
31
31
|
"record this", or similar, treat it as "save this knowledge into TMLBrain".
|
|
32
|
-
- Use `tmlbrain save` for that user-facing save path.
|
|
32
|
+
- Use `tmlbrain save` for that user-facing save path. Treat archive, store,
|
|
33
|
+
save, and record as equivalent user intents for storing knowledge. Do not set
|
|
33
34
|
`status: archived` or choose `knowledge/90-archive/` unless the user
|
|
34
35
|
explicitly means inactive historical content.
|
|
36
|
+
- Classify new saved knowledge according to the folder taxonomy before saving.
|
|
37
|
+
Do not default to `knowledge/00-inbox/` when the document intent can be
|
|
38
|
+
inferred from the title or content.
|
|
35
39
|
- Explain available actions as save, search, update, and sync. Avoid exposing
|
|
36
40
|
internal names such as archive, ingest, Git, commit, or backup unless the user
|
|
37
41
|
asks about implementation details.
|
|
@@ -40,7 +44,7 @@ the TMLBrain knowledge base.
|
|
|
40
44
|
|
|
41
45
|
Use the approved folder taxonomy:
|
|
42
46
|
|
|
43
|
-
- `knowledge/00-inbox/`: temporary or unclassified notes.
|
|
47
|
+
- `knowledge/00-inbox/`: temporary or genuinely unclassified notes only.
|
|
44
48
|
- `knowledge/10-projects/`: project-specific documents, plans, decisions, and retrospectives.
|
|
45
49
|
- `knowledge/20-areas/`: long-lived responsibility areas.
|
|
46
50
|
- `knowledge/30-resources/`: reusable research, notes, methods, and learning material.
|
|
@@ -72,20 +76,28 @@ for newly saved knowledge.
|
|
|
72
76
|
4. If needed, use `tmlbrain index` and inspect `.tmlbrain/index/` outputs.
|
|
73
77
|
5. If graph retrieval is enabled, use CocoIndex-derived metadata/graph indexes and LightRAG retrieval after exact search.
|
|
74
78
|
6. Read relevant local source documents.
|
|
75
|
-
7. For new knowledge, use `tmlbrain save`.
|
|
79
|
+
7. For new knowledge, classify its intent, then use `tmlbrain save`.
|
|
76
80
|
8. For updates, use `tmlbrain remote update --file <path> --replace <old> --with <new>` or a content-file update when a full document replacement is explicitly intended.
|
|
77
|
-
9.
|
|
78
|
-
10.
|
|
81
|
+
9. For explicit deletion requests, use `tmlbrain remote delete --file <path>`; otherwise prefer marking stale.
|
|
82
|
+
10. Show or summarize the server-returned diff and result.
|
|
83
|
+
11. Run `tmlbrain sync --pull` again so the local snapshot and indexes reflect the accepted server commit.
|
|
79
84
|
|
|
80
85
|
## Command Recipes
|
|
81
86
|
|
|
82
87
|
Initialize or repair local runtime:
|
|
83
88
|
|
|
84
89
|
```text
|
|
85
|
-
|
|
90
|
+
npm install -g @time-machine-lab/tmlbrain@latest
|
|
91
|
+
tmlbrain client install
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
Update an existing npm-installed client without re-entering setup:
|
|
95
|
+
|
|
96
|
+
```text
|
|
97
|
+
tmlbrain update
|
|
86
98
|
```
|
|
87
99
|
|
|
88
|
-
Run local CLI after
|
|
100
|
+
Run local CLI after package installation:
|
|
89
101
|
|
|
90
102
|
```text
|
|
91
103
|
tmlbrain client install
|
|
@@ -95,6 +107,8 @@ Enable optional graph runtime:
|
|
|
95
107
|
|
|
96
108
|
```text
|
|
97
109
|
tmlbrain graph setup
|
|
110
|
+
tmlbrain graph index
|
|
111
|
+
tmlbrain graph query "question"
|
|
98
112
|
```
|
|
99
113
|
|
|
100
114
|
Validate metadata and links:
|
|
@@ -133,6 +147,12 @@ Update a precise server-side text region:
|
|
|
133
147
|
tmlbrain remote update --file knowledge/00-inbox/note.md --replace "old text" --with "new text"
|
|
134
148
|
```
|
|
135
149
|
|
|
150
|
+
Delete a knowledge document only when the user explicitly asks for deletion:
|
|
151
|
+
|
|
152
|
+
```text
|
|
153
|
+
tmlbrain remote delete --file knowledge/30-resources/old-note.md
|
|
154
|
+
```
|
|
155
|
+
|
|
136
156
|
Refresh local snapshot from the server:
|
|
137
157
|
|
|
138
158
|
```text
|
|
@@ -143,19 +163,19 @@ Show or change the configured server:
|
|
|
143
163
|
|
|
144
164
|
```text
|
|
145
165
|
tmlbrain config show
|
|
146
|
-
tmlbrain config set-server http://server-host:
|
|
166
|
+
tmlbrain config set-server http://server-host:8477 --token <token>
|
|
147
167
|
```
|
|
148
168
|
|
|
149
169
|
Start the server API from the server worktree:
|
|
150
170
|
|
|
151
171
|
```text
|
|
152
|
-
tmlbrain serve --host 0.0.0.0 --port
|
|
172
|
+
tmlbrain serve --host 0.0.0.0 --port 8477
|
|
153
173
|
```
|
|
154
174
|
|
|
155
175
|
Deploy the server with Docker:
|
|
156
176
|
|
|
157
177
|
```text
|
|
158
|
-
docker run -d --name tmlbrain-server -p
|
|
178
|
+
docker run -d --name tmlbrain-server -p 8477:8477 -e TMLBRAIN_SERVER_TOKEN=<token> -e TMLBRAIN_KNOWLEDGE_REPO=<git-url> -v tmlbrain-data:/data <DOCKER_REPO>:latest
|
|
159
179
|
```
|
|
160
180
|
|
|
161
181
|
Back up server state:
|
|
@@ -177,6 +197,10 @@ If TMLBrain reports a conflict package:
|
|
|
177
197
|
Do not ask the user to interpret raw Git conflict markers. Do not force-push or
|
|
178
198
|
silently overwrite remote content.
|
|
179
199
|
|
|
200
|
+
For API update conflicts, the CLI creates a conflict package automatically from
|
|
201
|
+
the server's structured `409` response and refreshes the local snapshot when it
|
|
202
|
+
can. Review the package before retrying the update.
|
|
203
|
+
|
|
180
204
|
## Forbidden Client Actions
|
|
181
205
|
|
|
182
206
|
Do not run these as a normal client workflow:
|