@technomoron/agent-run 0.99.30 → 0.99.32
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/CHANGES +29 -0
- package/README.md +416 -6
- package/dist/agent-brain.js +6 -0
- package/dist/brain/cli.js +203 -0
- package/dist/brain/config.js +79 -0
- package/dist/brain/connectors.js +63 -0
- package/dist/brain/git.js +120 -0
- package/dist/brain/projects.js +148 -0
- package/dist/brain/server.js +197 -0
- package/dist/brain/skills.js +53 -0
- package/dist/brain/store.js +343 -0
- package/dist/brain/todos.js +124 -0
- package/dist/checks.js +3 -1
- package/dist/cli.js +11 -13
- package/dist/commands.js +10 -1
- package/dist/config/render-skills.js +2 -1
- package/dist/config-tree.js +12 -7
- package/dist/constants.js +10 -2
- package/dist/project.js +29 -1
- package/dist/renderer.js +23 -1
- package/dist/templates.js +2 -1
- package/dist/version.js +22 -0
- package/examples/basic-config/brain.example.jsonc +7 -0
- package/ops/systemd/agent-brain.service +14 -0
- package/ops/systemd/ai-tools-update.service +1 -0
- package/package.json +17 -7
- package/scripts/ensure-agent-brain.sh +26 -0
- package/scripts/install-systemd-jobs.sh +8 -1
- package/scripts/update-ai-tools.sh +24 -2
- package/examples/basic-config/README.md +0 -23
package/CHANGES
CHANGED
|
@@ -1,6 +1,35 @@
|
|
|
1
1
|
CHANGES
|
|
2
2
|
=======
|
|
3
3
|
|
|
4
|
+
Version 0.99.32 (2026-09-06)
|
|
5
|
+
----------------------------
|
|
6
|
+
* Add severity, an assigned C1/H1/M1/L1 label, and an open/fixed/wontfix state
|
|
7
|
+
to review knowledge, with `review_list` and `resolve_review` for working
|
|
8
|
+
through findings in priority order.
|
|
9
|
+
* Add `amend_knowledge` to revise an active item in place, keeping its id, file
|
|
10
|
+
name, and history.
|
|
11
|
+
* Let `remember` choose a file name instead of the item id, with the id appended
|
|
12
|
+
when that name is taken.
|
|
13
|
+
* Read the package version from `package.json` in one place instead of a second
|
|
14
|
+
copy in the source, so the version agent-brain reports cannot drift.
|
|
15
|
+
* Fix task updates resetting every field the caller did not mention, which made
|
|
16
|
+
completing a task discard its description, priority, labels, and notes.
|
|
17
|
+
|
|
18
|
+
Version 0.99.31 (2026-09-06)
|
|
19
|
+
----------------------------
|
|
20
|
+
* Add agent-brain for shared project knowledge, skills, review context and
|
|
21
|
+
tasks through a per-user MCP service on a private Unix socket.
|
|
22
|
+
* Add project creation and registration, global/project/default scopes,
|
|
23
|
+
Markdown knowledge with SQLite search, and structured task storage.
|
|
24
|
+
* Add read-only GitHub and Trello task imports and explicit Git synchronization
|
|
25
|
+
for portable knowledge, with revision checks and conflict reporting.
|
|
26
|
+
* Connect all four native agents to the brain and preserve existing profiles,
|
|
27
|
+
memory and skill templates.
|
|
28
|
+
* Create the standard knowledge directories and explain automatic placement
|
|
29
|
+
by scope and type in the brain-memory skill.
|
|
30
|
+
* Add optional systemd service management for selected users, including safe
|
|
31
|
+
startup pulls, and consolidate project documentation in README.md.
|
|
32
|
+
|
|
4
33
|
Version 0.99.30 (2026-09-06)
|
|
5
34
|
----------------------------
|
|
6
35
|
* Add native Gemini CLI and Grok Build adapters alongside Codex and Claude
|
package/README.md
CHANGED
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
**Config once. Run with any native coding agent.**
|
|
4
4
|
|
|
5
|
+
For persistent knowledge, shared skills, and tasks, use the bundled
|
|
6
|
+
[`agent-brain` MCP server](#persistent-context-with-agent-brain). It runs as a per-user service
|
|
7
|
+
hosted by `@technomoron/apicore-server` on a private Unix socket. Native agents
|
|
8
|
+
connect through a stdio-to-socket bridge.
|
|
9
|
+
Node 24 or newer is required.
|
|
10
|
+
|
|
5
11
|
`agent-run` lets you manage Codex, Claude Code, Gemini CLI, and Grok Build from
|
|
6
12
|
one shared configuration system while continuing to use each vendor's native
|
|
7
13
|
agent.
|
|
@@ -211,10 +217,11 @@ The mapped path is:
|
|
|
211
217
|
`profile` is resolved in this order:
|
|
212
218
|
|
|
213
219
|
1. `AGENT_RUN_PROFILE` in `.agent-run.env`
|
|
214
|
-
2.
|
|
215
|
-
3. `
|
|
216
|
-
4. `package.json.
|
|
217
|
-
5.
|
|
220
|
+
2. Registered agent-brain source root (the most specific match)
|
|
221
|
+
3. GitHub `origin` remote
|
|
222
|
+
4. `package.json.repository` (string or object `url`)
|
|
223
|
+
5. `package.json.name`
|
|
224
|
+
6. The project path as `[parent]/[current]`
|
|
218
225
|
|
|
219
226
|
Examples:
|
|
220
227
|
|
|
@@ -230,6 +237,9 @@ path, so values like `/tmp/foo`, `C:/tmp/foo`, or `../foo` are rejected.
|
|
|
230
237
|
|
|
231
238
|
The path fallback lets plain directories work without a Git repository or a
|
|
232
239
|
`package.json`. The explicit profile sources above always take precedence.
|
|
240
|
+
With agent-brain enabled, an unconfigured directory uses the default profile.
|
|
241
|
+
An explicit `AGENT_RUN_PROFILE` still takes precedence, and namespaced brain
|
|
242
|
+
project names resolve to their registered profiles.
|
|
233
243
|
|
|
234
244
|
## Overrides
|
|
235
245
|
|
|
@@ -284,8 +294,11 @@ project memory directory. Project memory is plain Markdown so it can be
|
|
|
284
294
|
reviewed and shared through the Git repository that normally holds the
|
|
285
295
|
`.agent-run` config tree.
|
|
286
296
|
|
|
287
|
-
|
|
288
|
-
|
|
297
|
+
With agent-brain enabled, `memory/` is the canonical project knowledge directory
|
|
298
|
+
and remains in place; existing `notes/memory/` is also read. Without agent-brain,
|
|
299
|
+
legacy `memory/` moves to `notes/memory/`. Loose `memory*.md` files and Markdown
|
|
300
|
+
files directly under the old `memories/` directory move to the applicable memory
|
|
301
|
+
directory. Agent-run detects the old layout
|
|
289
302
|
before updating or launching an agent. If those files are tracked, agent-run
|
|
290
303
|
shows the moves and asks before staging them with `git mv`. In a non-Git config
|
|
291
304
|
tree, or for untracked files, it uses ordinary filesystem moves. Non-interactive
|
|
@@ -430,6 +443,15 @@ node dist/agent-run.js update examples/basic-config/project
|
|
|
430
443
|
node dist/agent-run.js check examples/basic-config/project
|
|
431
444
|
```
|
|
432
445
|
|
|
446
|
+
To add persistent knowledge and tasks to the starter, first copy its
|
|
447
|
+
`agent-config/` directory outside your source repository, then run
|
|
448
|
+
`agent-brain init --configdir /path/to/agent-config`. Existing profiles are
|
|
449
|
+
preserved, and the brain MCP connection is added on the next generation or
|
|
450
|
+
launch. [brain.example.jsonc](examples/basic-config/brain.example.jsonc) shows
|
|
451
|
+
the optional root configuration; the starter commands do not enable it.
|
|
452
|
+
Generated starter runtime files live below
|
|
453
|
+
`examples/basic-config/agent-config/starter/basic-project/live/`.
|
|
454
|
+
|
|
433
455
|
Check the current repo:
|
|
434
456
|
|
|
435
457
|
```sh
|
|
@@ -466,6 +488,378 @@ files. Use `--yes` to confirm tracked `git mv` operations in a non-interactive
|
|
|
466
488
|
run. Omit `--yes` to review and confirm tracked moves interactively. The
|
|
467
489
|
command stages moves but never commits them.
|
|
468
490
|
|
|
491
|
+
## Persistent context with agent-brain
|
|
492
|
+
|
|
493
|
+
`agent-brain` gives the native agents the same project knowledge, skills, and
|
|
494
|
+
tasks through MCP. It uses the official Node MCP SDK. The persistent
|
|
495
|
+
service runs under `@technomoron/apicore-server` on a private Unix socket.
|
|
496
|
+
Node 24 or newer is required; SQLite and FTS come from Node, with no database
|
|
497
|
+
package to compile.
|
|
498
|
+
|
|
499
|
+
### Start using it
|
|
500
|
+
|
|
501
|
+
```sh
|
|
502
|
+
agent-brain init
|
|
503
|
+
agent-brain serve
|
|
504
|
+
```
|
|
505
|
+
|
|
506
|
+
Keep the service running, or enable the systemd user service described below.
|
|
507
|
+
In another terminal:
|
|
508
|
+
|
|
509
|
+
```sh
|
|
510
|
+
cd ~/code/my-project
|
|
511
|
+
agent-run create my-project --quick
|
|
512
|
+
agent-run codex
|
|
513
|
+
```
|
|
514
|
+
|
|
515
|
+
Omit `--quick` for the short interactive setup, or use `--guided` to add an
|
|
516
|
+
architecture summary, constraints, conventions, and a preferred agent.
|
|
517
|
+
Creation detects the source root, Git remote, languages, package manager,
|
|
518
|
+
documentation, and package scripts. It writes configuration outside the source
|
|
519
|
+
repository. Existing directories and duplicate project registrations are rejected.
|
|
520
|
+
|
|
521
|
+
`agent-run project list` lists registrations. `project info` shows the current
|
|
522
|
+
project, and `project bootstrap` returns detected information for the agent to
|
|
523
|
+
inspect and turn into proposals. Bootstrap does not invent or save architectural
|
|
524
|
+
facts; the agent can use the knowledge tools after the user confirms its proposals.
|
|
525
|
+
|
|
526
|
+
All commands accept `--configdir PATH`. Brain commands also accept `--cwd PATH`.
|
|
527
|
+
`agent-brain --help` lists the commands.
|
|
528
|
+
|
|
529
|
+
### Scopes and existing profiles
|
|
530
|
+
|
|
531
|
+
```text
|
|
532
|
+
~/.agent-run/
|
|
533
|
+
brain.jsonc
|
|
534
|
+
global/skills/<name>/SKILL.md
|
|
535
|
+
global/constraints/*.md
|
|
536
|
+
projects/my-project/
|
|
537
|
+
agent-run.jsonc
|
|
538
|
+
config.yaml
|
|
539
|
+
project.md
|
|
540
|
+
memory/*.md
|
|
541
|
+
todo/*.md
|
|
542
|
+
live/
|
|
543
|
+
default/
|
|
544
|
+
agent-run.jsonc
|
|
545
|
+
skills/
|
|
546
|
+
preferences/
|
|
547
|
+
constraints/
|
|
548
|
+
conventions/
|
|
549
|
+
reviews/
|
|
550
|
+
memory/*.md
|
|
551
|
+
todo/
|
|
552
|
+
templates/
|
|
553
|
+
live/
|
|
554
|
+
index/knowledge.sqlite
|
|
555
|
+
runtime/
|
|
556
|
+
```
|
|
557
|
+
|
|
558
|
+
Inside a registered or existing configured project, retrieval includes global
|
|
559
|
+
and project knowledge. Elsewhere it includes global and default knowledge.
|
|
560
|
+
Default knowledge never appears in a configured project. Among registered
|
|
561
|
+
source roots, the most specific matching root wins; equal matches are rejected.
|
|
562
|
+
An explicit `AGENT_RUN_PROFILE` in `.agent-run.env` keeps precedence over registration.
|
|
563
|
+
|
|
564
|
+
Project names can include a namespace: `technomoron/agent-run` lives under
|
|
565
|
+
`projects/technomoron/agent-run`. The original name also works in
|
|
566
|
+
`AGENT_RUN_PROFILE`; no alias is needed.
|
|
567
|
+
|
|
568
|
+
Existing JSONC manifests, Nunjucks templates, and `org/repo` profiles remain
|
|
569
|
+
supported. Brain reads existing `notes/memory` directories in place, including
|
|
570
|
+
the config root's global notes. It does not move or delete them. New knowledge
|
|
571
|
+
uses the directories above. Existing files without metadata are treated as
|
|
572
|
+
inferred, relevant-only knowledge; adding metadata gives you explicit control.
|
|
573
|
+
Legacy review metadata is preserved, and reviews marked addressed or resolved
|
|
574
|
+
are excluded from active recall. Canonical `global/skills/<name>/SKILL.md` files
|
|
575
|
+
also support existing Nunjucks variables when served or rendered for native agents.
|
|
576
|
+
|
|
577
|
+
`agent-brain init` installs the shared brain skills and a default profile, and
|
|
578
|
+
creates `brain.jsonc` only if it does not exist. It preserves existing files.
|
|
579
|
+
It creates the topic directories shown above in global, default, and registered
|
|
580
|
+
project scopes, plus `rules/`, `decisions/`, `specs/`, and `observations/` for
|
|
581
|
+
the other knowledge types. Project creation uses the same layout. Empty topic
|
|
582
|
+
directories stay empty until there is relevant content to store.
|
|
583
|
+
Normal profile rendering then adds the brain MCP server and shared instructions
|
|
584
|
+
to Codex, Claude, Gemini, and Grok. An explicitly configured `agent-brain` MCP
|
|
585
|
+
entry takes precedence. Set `enabled` to `false` to stop automatic integration
|
|
586
|
+
and restore the previous unconfigured-project behavior.
|
|
587
|
+
|
|
588
|
+
```jsonc
|
|
589
|
+
{
|
|
590
|
+
"enabled": true,
|
|
591
|
+
"contextBudget": 16000,
|
|
592
|
+
"connectors": {}
|
|
593
|
+
}
|
|
594
|
+
```
|
|
595
|
+
|
|
596
|
+
`contextBudget` counts serialized characters, not model tokens. A context result
|
|
597
|
+
reports omitted items. Use `get_knowledge` to read complete items when necessary.
|
|
598
|
+
Always-recalled knowledge is considered first, then matching file patterns,
|
|
599
|
+
then lexical results. Search uses FTS ranking with extra weight for titles and tags.
|
|
600
|
+
Symbols contribute search terms. Manual Markdown changes are read on every query;
|
|
601
|
+
the index can be deleted while the service is stopped and rebuilt on the next query.
|
|
602
|
+
|
|
603
|
+
### Knowledge and skills
|
|
604
|
+
|
|
605
|
+
Knowledge is one Markdown file per item, with YAML metadata:
|
|
606
|
+
|
|
607
|
+
```markdown
|
|
608
|
+
---
|
|
609
|
+
id: auth-refresh-single-use
|
|
610
|
+
type: constraint
|
|
611
|
+
scope: project
|
|
612
|
+
authority: user
|
|
613
|
+
status: active
|
|
614
|
+
recall: always
|
|
615
|
+
tags: [auth]
|
|
616
|
+
applies_to: ["src/auth/**"]
|
|
617
|
+
created: 2026-09-06
|
|
618
|
+
---
|
|
619
|
+
|
|
620
|
+
# Refresh tokens are single-use
|
|
621
|
+
|
|
622
|
+
A successfully consumed refresh token must never be accepted again.
|
|
623
|
+
```
|
|
624
|
+
|
|
625
|
+
The storage directories are `rules`, `preferences`, `conventions`, `constraints`,
|
|
626
|
+
`decisions`, `specs`, `reviews`, `memory`, and `observations`. Scope metadata must
|
|
627
|
+
match the file's directory. IDs must be unique across the active scopes.
|
|
628
|
+
Invalid metadata produces an error identifying the file. Symlinked storage
|
|
629
|
+
paths are rejected. Individual Markdown files are limited to 1 MiB.
|
|
630
|
+
|
|
631
|
+
Choose the scope and singular knowledge type when calling `remember`; MCP writes
|
|
632
|
+
the file into the corresponding directory. User preferences belong in
|
|
633
|
+
`preferences/`, requirements in `constraints/`, established practices in
|
|
634
|
+
`conventions/`, confirmed specifications in `specs/`, and confirmed choices in
|
|
635
|
+
`decisions/`. Code-derived facts remain inferred `observations/`; source
|
|
636
|
+
references and history belong in `memory/`, with planned features labeled as
|
|
637
|
+
plans. An import request does not make inferred content authoritative.
|
|
638
|
+
Use the todo tools for tasks. Reusable workflows are `skills/<name>/SKILL.md`
|
|
639
|
+
files, and reusable templates belong in `templates/`; `remember` does not
|
|
640
|
+
install either. Global skills remain available without copying them into each
|
|
641
|
+
project. The brain-memory skill explains these choices to native agents.
|
|
642
|
+
|
|
643
|
+
Available MCP tools include `get_context`, `search_knowledge`, `get_knowledge`,
|
|
644
|
+
`remember`, `amend_knowledge`, `promote`, `deprecate_knowledge`, `review_context`,
|
|
645
|
+
`review_list`, and `resolve_review`.
|
|
646
|
+
Writes use atomic file replacement and a shared lock; concurrent writes either
|
|
647
|
+
complete or report that the caller should retry. After a crashed writer, stop
|
|
648
|
+
the service, verify the PID in `runtime/brain-write.lock` is no longer running,
|
|
649
|
+
and remove that lock before restarting.
|
|
650
|
+
|
|
651
|
+
```sh
|
|
652
|
+
agent-brain remember --json '{"scope":"project","type":"observation","title":"Refresh handling","content":"Investigate concurrent refresh requests."}'
|
|
653
|
+
agent-brain search "refresh"
|
|
654
|
+
agent-brain get ITEM_ID
|
|
655
|
+
agent-brain amend ITEM_ID --revision REVISION --json '{"content":"Corrected text."}'
|
|
656
|
+
agent-brain deprecate ITEM_ID --revision REVISION "No longer applies"
|
|
657
|
+
agent-brain promote ITEM_ID --scope global --revision REVISION --confirmed
|
|
658
|
+
```
|
|
659
|
+
|
|
660
|
+
`amend_knowledge` revises an active item in place, keeping its id, file name, scope,
|
|
661
|
+
type, authority, and history, and updating only the fields you pass. Use it to correct
|
|
662
|
+
or extend knowledge instead of writing a near-duplicate. Scope, type, authority, and
|
|
663
|
+
review severity are not amendable; if one of those is wrong, deprecate the item and
|
|
664
|
+
write a corrected one.
|
|
665
|
+
|
|
666
|
+
#### File names
|
|
667
|
+
|
|
668
|
+
`remember` names each file after the item id. Pass `filename` to choose the name
|
|
669
|
+
instead, as lower-case words separated by single dashes and no extension:
|
|
670
|
+
|
|
671
|
+
```sh
|
|
672
|
+
agent-brain remember --json '{"scope":"project","type":"observation","title":"Build flow","content":"...","filename":"build-flow"}'
|
|
673
|
+
```
|
|
674
|
+
|
|
675
|
+
If that name is taken, the item id is appended rather than overwriting anything. The
|
|
676
|
+
name is storage only and is never written into the metadata: the `id` in the front
|
|
677
|
+
matter is the identity, so files stay safe to rename by hand and the item is still found
|
|
678
|
+
by id afterwards.
|
|
679
|
+
|
|
680
|
+
#### Review findings
|
|
681
|
+
|
|
682
|
+
Review knowledge is a numbered, prioritized list. `remember` requires a
|
|
683
|
+
`severity` of `critical`, `high`, `medium`, or `low` when the type is `review`,
|
|
684
|
+
and rejects `severity` for every other type. The store assigns the finding
|
|
685
|
+
label itself: `C1`, `H1`, `M1`, `L1`, counting up per severity within the scope.
|
|
686
|
+
Resolved numbers are never handed out again, so a label always refers to the
|
|
687
|
+
same finding.
|
|
688
|
+
|
|
689
|
+
Each finding also carries a `state` of `open`, `fixed`, or `wontfix`, separate
|
|
690
|
+
from the `active` and `deprecated` status that controls recall. New findings
|
|
691
|
+
start `open`.
|
|
692
|
+
|
|
693
|
+
```sh
|
|
694
|
+
agent-brain review list
|
|
695
|
+
agent-brain review list --severity high --state open
|
|
696
|
+
agent-brain review resolve ITEM_ID --revision REVISION --state fixed "Fixed by using a stable command name"
|
|
697
|
+
```
|
|
698
|
+
|
|
699
|
+
`review_list` returns findings in severity then number order, open ones only
|
|
700
|
+
unless states are given, each with the revision needed to resolve it.
|
|
701
|
+
`resolve_review` records the state and reason and takes the finding out of active
|
|
702
|
+
recall, keeping its text and history. Mark a finding `wontfix` only when the user
|
|
703
|
+
has said it is intentional.
|
|
704
|
+
|
|
705
|
+
Finding labels are indexed, so `search_knowledge` for `H2` finds that finding.
|
|
706
|
+
Review files written before these fields existed keep parsing; they simply carry
|
|
707
|
+
no label and stay out of the finding list.
|
|
708
|
+
|
|
709
|
+
Remembered deductions default to inferred authority and must remain observations,
|
|
710
|
+
memories, or review records. Global writes require explicit user authority.
|
|
711
|
+
Promotion copies an item, records its origin, preserves the original, and requires
|
|
712
|
+
confirmation. Deprecation and promotion require the last-read revision so stale
|
|
713
|
+
requests cannot overwrite newer work. An agent's authority claim is an instruction
|
|
714
|
+
contract, not a separate authentication system; the Unix account owns the data.
|
|
715
|
+
|
|
716
|
+
Skills use YAML `name` and `description` metadata in `skills/<name>/SKILL.md`.
|
|
717
|
+
`list_skills` returns descriptions, and `get_skill` loads the body on demand.
|
|
718
|
+
A project/default skill overrides a global skill with the same name. Add
|
|
719
|
+
`extends: global:NAME` to include the global skill's instructions before the local
|
|
720
|
+
instructions. The existing native skill-template system continues to work.
|
|
721
|
+
|
|
722
|
+
The installed `brain-memory`, `brain-review`, and `todo-manager` skills describe
|
|
723
|
+
retrieval, persistence, review learning, and task workflows. Review records use
|
|
724
|
+
the knowledge tools and remain inferred unless confirmed by the user.
|
|
725
|
+
|
|
726
|
+
### Tasks and connectors
|
|
727
|
+
|
|
728
|
+
Tasks are separate from knowledge and stored in `todo/<id>.md`. Supported states
|
|
729
|
+
are `todo`, `doing`, `blocked`, `done`, and `cancelled`. Tasks have titles,
|
|
730
|
+
descriptions, priorities, owners, due dates, labels, notes, and optional external
|
|
731
|
+
source identities.
|
|
732
|
+
|
|
733
|
+
```sh
|
|
734
|
+
agent-brain todo add --json '{"scope":"project","title":"Check refresh handling","priority":"high"}'
|
|
735
|
+
agent-brain todo list
|
|
736
|
+
agent-brain todo get ITEM_ID
|
|
737
|
+
agent-brain todo complete ITEM_ID --revision REVISION
|
|
738
|
+
```
|
|
739
|
+
|
|
740
|
+
MCP exposes `todo_list`, `todo_get`, `todo_add`, `todo_update`, `todo_complete`,
|
|
741
|
+
`todo_import`, and `todo_sync`. Update requests require the current revision.
|
|
742
|
+
|
|
743
|
+
Configure optional connectors in `brain.jsonc`:
|
|
744
|
+
|
|
745
|
+
```jsonc
|
|
746
|
+
{
|
|
747
|
+
"enabled": true,
|
|
748
|
+
"connectors": {
|
|
749
|
+
"issues": {
|
|
750
|
+
"type": "github",
|
|
751
|
+
"repository": "my-org/my-project",
|
|
752
|
+
"tokenEnv": "GITHUB_TOKEN"
|
|
753
|
+
},
|
|
754
|
+
"board": {
|
|
755
|
+
"type": "trello",
|
|
756
|
+
"board": "BOARD_ID",
|
|
757
|
+
"keyEnv": "TRELLO_API_KEY",
|
|
758
|
+
"tokenEnv": "TRELLO_TOKEN"
|
|
759
|
+
}
|
|
760
|
+
}
|
|
761
|
+
}
|
|
762
|
+
```
|
|
763
|
+
|
|
764
|
+
```sh
|
|
765
|
+
agent-brain todo import issues --scope project
|
|
766
|
+
agent-brain todo sync issues --scope project
|
|
767
|
+
```
|
|
768
|
+
|
|
769
|
+
Credentials are read from the process environment and never written to task files.
|
|
770
|
+
Set credentials in the service's environment.
|
|
771
|
+
GitHub imports paginate and exclude pull requests. Trello maps due-complete cards
|
|
772
|
+
to done, archived cards to cancelled, and other cards to todo; it does not guess
|
|
773
|
+
workflow states from list names.
|
|
774
|
+
|
|
775
|
+
Imports deduplicate by source identity and scope. Synchronization compares local
|
|
776
|
+
and remote fields against the last imported version, preserves local-only edits,
|
|
777
|
+
and reports conflicting task IDs without replacing those tasks. Deleted remote
|
|
778
|
+
items are retained locally. These connectors only read remote systems; completing
|
|
779
|
+
a local task does not close a GitHub issue or modify a Trello card.
|
|
780
|
+
|
|
781
|
+
### Git portability
|
|
782
|
+
|
|
783
|
+
```sh
|
|
784
|
+
agent-brain sync
|
|
785
|
+
agent-brain sync init --confirmed
|
|
786
|
+
agent-brain sync save --confirmed --message "Your approved commit message"
|
|
787
|
+
agent-brain sync pull --confirmed
|
|
788
|
+
agent-brain sync push --confirmed
|
|
789
|
+
```
|
|
790
|
+
|
|
791
|
+
The command without an action previews Git status and eligible files. Saving
|
|
792
|
+
includes Markdown knowledge, skills, tasks, project metadata, and `.gitignore`.
|
|
793
|
+
It excludes indexes, runtime state, secrets, `brain.jsonc`, and native agent
|
|
794
|
+
configuration. Existing staged changes block a save. Configure the remote and
|
|
795
|
+
upstream with normal Git commands using your existing credentials.
|
|
796
|
+
After cloning onto another machine, run `agent-brain init` to restore generated
|
|
797
|
+
profile markers and shared templates, then update source roots in `config.yaml`
|
|
798
|
+
to match that machine.
|
|
799
|
+
|
|
800
|
+
The configuration directory must itself be the repository root. Pull uses rebase
|
|
801
|
+
and reports conflicted files; resolve conflicts before syncing again. Each action
|
|
802
|
+
requires explicit authorization. There are no automatic commits, pulls, or pushes.
|
|
803
|
+
|
|
804
|
+
### Persistent service under apicore-server
|
|
805
|
+
|
|
806
|
+
All native agents connect to the same long-lived service for the Unix user.
|
|
807
|
+
Start it on Linux or macOS:
|
|
808
|
+
|
|
809
|
+
```sh
|
|
810
|
+
agent-brain serve
|
|
811
|
+
```
|
|
812
|
+
|
|
813
|
+
The service hosts SDK Streamable HTTP at `/mcp` using apicore's Fastify instance.
|
|
814
|
+
It listens on `$XDG_RUNTIME_DIR/agent-brain.sock`, or
|
|
815
|
+
`~/.agent-run/runtime/agent-brain.sock` when that variable is absent. The socket
|
|
816
|
+
directory must belong to the current user and have mode `0700`; the socket has
|
|
817
|
+
mode `0600`. No TCP listener or application user database is created.
|
|
818
|
+
|
|
819
|
+
`agent-run mcp` bridges native-agent stdio to this socket. Use `--socket PATH`
|
|
820
|
+
for a particular service. The bridge verifies the socket's ownership and private
|
|
821
|
+
permissions. A missing or unreachable socket is an error; start the service
|
|
822
|
+
before connecting. There is no standalone stdio server or TCP fallback. Apicore
|
|
823
|
+
supports Unix sockets directly, so localhost binding is unnecessary. The brain
|
|
824
|
+
service currently requires Linux or macOS.
|
|
825
|
+
|
|
826
|
+
After a crash, remove a stale socket only after checking that its service is
|
|
827
|
+
stopped. Starting a second service on an existing socket fails without replacing
|
|
828
|
+
the first service's socket.
|
|
829
|
+
|
|
830
|
+
For a user service, copy `ops/systemd/agent-brain.service` to
|
|
831
|
+
`~/.config/systemd/user/`, adjust `ExecStart` if your executable is elsewhere, and
|
|
832
|
+
run `systemctl --user daemon-reload` followed by
|
|
833
|
+
`systemctl --user enable --now agent-brain`. Installation is explicit.
|
|
834
|
+
|
|
835
|
+
The supplied service uses `serve --pull`. On startup this pulls the configuration
|
|
836
|
+
repository with `--ff-only --no-rebase` when it is clean and has an upstream.
|
|
837
|
+
Dirty checkouts and missing upstreams are skipped. Divergence or network failures
|
|
838
|
+
are reported in the service journal and the service continues with local files.
|
|
839
|
+
Startup never commits, pushes, stashes, or rebases local work. Omit `--pull` to
|
|
840
|
+
disable this behavior for a manually launched service.
|
|
841
|
+
|
|
842
|
+
The AI tools updater can install and restart the service for explicitly selected
|
|
843
|
+
accounts; see [Systemd Jobs](#systemd-jobs). Existing user unit
|
|
844
|
+
overrides still take precedence over the installed system-wide user unit.
|
|
845
|
+
|
|
846
|
+
Each HTTP request resolves the proxy's source directory through agent-run's
|
|
847
|
+
resolver. Tools cannot select another project's scope through arguments. The
|
|
848
|
+
service shares canonical files and the SQLite index; it does not keep a watcher
|
|
849
|
+
or a separate authoritative cache.
|
|
850
|
+
|
|
851
|
+
### Remaining roadmap
|
|
852
|
+
|
|
853
|
+
The initial implementation uses lexical retrieval and path matching. Embeddings,
|
|
854
|
+
vector ranking, background watchers, debounced automatic Git synchronization,
|
|
855
|
+
remote task writes, and additional connectors remain future work. No model
|
|
856
|
+
provider or external account is required for the local features.
|
|
857
|
+
|
|
858
|
+
Transport and connector implementations follow the
|
|
859
|
+
[Node MCP SDK server documentation](https://ts.sdk.modelcontextprotocol.io/server),
|
|
860
|
+
[GitHub Issues REST API](https://docs.github.com/en/rest/issues/issues), and
|
|
861
|
+
[Trello board API](https://developer.atlassian.com/cloud/trello/rest/api-group-boards/).
|
|
862
|
+
|
|
469
863
|
## Systemd Jobs
|
|
470
864
|
|
|
471
865
|
The repo includes optional systemd units for keeping global AI tooling current.
|
|
@@ -491,6 +885,22 @@ npm, pnpm, corepack, fallow, ripgrep, pm2, tsx, typescript,
|
|
|
491
885
|
The optional apt package list still defaults to `gh` and can be changed with
|
|
492
886
|
`AI_TOOLS_APT_PACKAGES`.
|
|
493
887
|
|
|
888
|
+
To keep agent-brain running for a particular account, put
|
|
889
|
+
`AI_TOOLS_BRAIN_USERS="bjorn"` in `/etc/default/ai-tools-update`. The installer
|
|
890
|
+
also installs the user service and its management helper. After installing the
|
|
891
|
+
package, the updater enables that account's service, enables lingering so it
|
|
892
|
+
starts at boot without an interactive login, and restarts it to load the update.
|
|
893
|
+
No accounts are selected by default. The service remains owned by the selected
|
|
894
|
+
user and listens on that user's private Unix socket.
|
|
895
|
+
|
|
896
|
+
Node 24 or newer must be installed at `/usr/local/bin/node` before running the
|
|
897
|
+
updater. `AI_TOOLS_AGENT_RUN_PACKAGE` can select a package version or a
|
|
898
|
+
root-owned local package archive while testing an unpublished build; it defaults
|
|
899
|
+
to `@technomoron/agent-run@latest`. The updater's `--agent-brain` option installs
|
|
900
|
+
only this package and manages the selected services. The settings file is read
|
|
901
|
+
by the systemd job; when invoking the script directly, pass these environment
|
|
902
|
+
variables explicitly.
|
|
903
|
+
|
|
494
904
|
## Login Warning
|
|
495
905
|
|
|
496
906
|
For user-owned machines, `scripts/agent-config-login-warning.sh` can be called
|