@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 CHANGED
@@ -19,7 +19,7 @@ TMLBrain keeps three coordinated copies of the knowledge base:
19
19
  - Maintain a clean folder structure for documents.
20
20
  - Let AI search local snapshots and request server-side precise Markdown updates.
21
21
  - Pull read-only local snapshots from the server copy.
22
- - Back up the server copy to GitHub on a server-side schedule.
22
+ - Back up accepted server writes to GitHub from the server side.
23
23
  - Build an optional online reading layer later.
24
24
 
25
25
  ## Repository Layout
@@ -34,40 +34,66 @@ TMLBrain/
34
34
  docs/ Architecture, decisions, and operating docs.
35
35
  ```
36
36
 
37
- ## Local Tooling
37
+ ## Client Install
38
38
 
39
- The npm package exposes a dependency-light CLI:
39
+ Recommended npm install:
40
+
41
+ ```text
42
+ npm install -g @time-machine-lab/tmlbrain@latest
43
+ tmlbrain client install
44
+ ```
45
+
46
+ The installer asks for a server URL. Leave it empty to start in local-only
47
+ mode, or provide the TMLBrain server URL and token to enable team sync and
48
+ server-side writes.
49
+
50
+ Non-interactive npm install:
51
+
52
+ ```text
53
+ npm install -g @time-machine-lab/tmlbrain@latest
54
+ tmlbrain client install --server http://server-host:8477 --token <token> --yes
55
+ ```
56
+
57
+ After installation:
40
58
 
41
59
  ```text
42
- npx @time-machine-lab/tmlbrain client install
43
60
  tmlbrain find "keyword"
44
61
  tmlbrain save --title "Title" --content "Content"
62
+ tmlbrain remote update --file knowledge/30-resources/note.md --replace "old" --with "new"
63
+ tmlbrain remote delete --file knowledge/30-resources/old-note.md
45
64
  ```
46
65
 
66
+ Saving and archiving into the knowledge base are the same user intent:
67
+ TMLBrain stores the content and classifies it into the approved taxonomy. It
68
+ does not default normal saves to `knowledge/00-inbox/`; inbox is only for
69
+ genuinely unclassified or explicitly temporary capture.
70
+
71
+ Deletion is explicit: use `remote delete` only when the user really wants a
72
+ document removed. Otherwise prefer marking content stale through `remote update`.
73
+
47
74
  Clients use Node for exact search and local indexing. HTTP-only clients do not
48
75
  need Git. Server-side writes use Node plus Git from the server worktree.
49
76
  Python-based CocoIndex and LightRAG support are optional graph retrieval
50
77
  enhancements.
51
78
 
52
- Interactive client install asks for a server URL. Leave it empty to start in
53
- local-only mode, or provide the TMLBrain server URL and token to enable team
54
- sync and server-side writes.
55
-
56
- Non-interactive client install:
79
+ Update an existing client without re-entering the setup flow:
57
80
 
58
81
  ```text
59
- npx @time-machine-lab/tmlbrain client install --server http://server-host:7389 --token secret --yes
82
+ tmlbrain update
60
83
  ```
61
84
 
85
+ Use `npx -y @time-machine-lab/tmlbrain@latest client install` only when you
86
+ want a one-time install without keeping a global `tmlbrain` command.
87
+
62
88
  ## Server Docker
63
89
 
64
90
  The server is deployed separately from clients and requires a token:
65
91
 
66
92
  ```text
67
93
  docker run -d --name tmlbrain-server \
68
- -p 7389:7389 \
94
+ -p 8477:8477 \
69
95
  -e TMLBRAIN_SERVER_TOKEN=change-me \
70
- -e TMLBRAIN_KNOWLEDGE_REPO=https://github.com/Time-Machine-Lab/TMLBrainKnowledge.git \
96
+ -e TMLBRAIN_KNOWLEDGE_REPO=https://github.com/Time-Machine-Lab/Knowledge.git \
71
97
  -e TMLBRAIN_KNOWLEDGE_REF=main \
72
98
  -v tmlbrain-data:/data \
73
99
  <DOCKER_REPO>:latest
@@ -87,13 +113,13 @@ Only pushes to `main` are considered. A release runs when the HEAD commit
87
113
  message contains `<Auto>` and a version flag:
88
114
 
89
115
  ```text
90
- [tml-brain]<Auto> release server and client -v:0.1.0 -rp:7389 -de:<-e KEY=value>
116
+ [tml-brain]<Auto> release server and client -v:0.1.0 -rp:8477 -de:<-e KEY=value>
91
117
  ```
92
118
 
93
119
  - `-v` is required and becomes both the npm package version and Docker image
94
120
  version; use a Docker-compatible value such as `0.1.0` or `0.1.0-beta.1`.
95
121
  - `-rp` sets the default server port baked into the Docker image; it defaults
96
- to `7389`.
122
+ to `8477`.
97
123
  - `-de` is optional runtime Docker argument metadata recorded in
98
124
  the commit message and may also be copied into `prod_deploy.log` manually.
99
125
 
@@ -101,6 +127,8 @@ The workflow publishes `@time-machine-lab/tmlbrain` to npm, pushes the server
101
127
  image to the Docker repository configured by `DOCKER_REPO`, and then deploys
102
128
  that image to the configured server with `SERVER_HOST`, `SERVER_USER`, and
103
129
  `SERVER_PWD`. Docker images are tagged as `latest`, `version`, and `vversion`.
130
+ The server deploy step skips Docker login by default and directly pulls the
131
+ public image. Only set `TMLBRAIN_SERVER_DOCKER_LOGIN=true` for private images.
104
132
  The workflow does not mutate repository files; if
105
133
  maintainers want a production release note, update `prod_deploy.log` manually
106
134
  before committing the auto-release instruction.
@@ -134,6 +162,17 @@ for private repositories, or `public_repo` only for public repositories. The
134
162
  running server needs this credential to push knowledge backups to GitHub;
135
163
  clients never need it.
136
164
 
165
+ Optional GitHub connectivity secret:
166
+
167
+ ```text
168
+ TMLBRAIN_SERVER_GIT_PROXY_URL
169
+ ```
170
+
171
+ Use it only when the server cannot reach GitHub directly. The deployment applies
172
+ the proxy to Git operations for `https://github.com` only. If this secret is not
173
+ set but a `tmlbrain-proxy` container exists on the server, deployment uses that
174
+ container as the Git-only proxy automatically.
175
+
137
176
  The Docker image contains the TMLBrain tool and knowledge templates only. Real
138
177
  team knowledge should live in a dedicated knowledge repository configured with
139
178
  `TMLBRAIN_KNOWLEDGE_REPO`. If the server volume already has `/data/worktree`,
@@ -148,5 +187,7 @@ starts.
148
187
  - Markdown is the default document format.
149
188
  - Small, precise server-side edits are preferred over whole-document rewrites.
150
189
  - Every document should have a clear owner, status, and update path.
190
+ - Saved knowledge should be classified into the taxonomy instead of piling up
191
+ in inbox.
151
192
  - AI should help maintain the knowledge base instead of only searching it.
152
193
  - Clients do not push to the server repository or dedicated knowledge repository.