agent-memory-cli 0.1.0__py3-none-any.whl
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.
- agent_memory/__init__.py +9 -0
- agent_memory/__main__.py +9 -0
- agent_memory/archive.py +359 -0
- agent_memory/cli.py +437 -0
- agent_memory/debrief.py +336 -0
- agent_memory/doctor.py +710 -0
- agent_memory/git_runner.py +68 -0
- agent_memory/home.py +246 -0
- agent_memory/layout.py +198 -0
- agent_memory/org.py +218 -0
- agent_memory/publication.py +433 -0
- agent_memory/setup/__init__.py +53 -0
- agent_memory/setup/claude.py +34 -0
- agent_memory/setup/codex.py +39 -0
- agent_memory/setup/common.py +1015 -0
- agent_memory/setup/legacy.py +67 -0
- agent_memory/startup.py +254 -0
- agent_memory/status.py +137 -0
- agent_memory/sync.py +649 -0
- agent_memory/templates/org-memory/decisions.md +5 -0
- agent_memory/templates/org-memory/recent.md +16 -0
- agent_memory/templates/org-memory/rules.md +5 -0
- agent_memory/templates/project-memory/decision_log.md +3 -0
- agent_memory/templates/project-memory/known_debt.md +8 -0
- agent_memory/templates/project-memory/open_threads.md +3 -0
- agent_memory/templates/project-memory/project_facts.md +4 -0
- agent_memory/templates/workflow/SKILL.md +42 -0
- agent_memory/workflow.py +287 -0
- agent_memory_cli-0.1.0.dist-info/METADATA +261 -0
- agent_memory_cli-0.1.0.dist-info/RECORD +33 -0
- agent_memory_cli-0.1.0.dist-info/WHEEL +4 -0
- agent_memory_cli-0.1.0.dist-info/entry_points.txt +2 -0
- agent_memory_cli-0.1.0.dist-info/licenses/LICENSE +201 -0
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: 2026 Kiloloop
|
|
2
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
"""``agent-memory setup <runtime>``: one planner, one applier, a spec per runtime."""
|
|
4
|
+
|
|
5
|
+
from __future__ import annotations
|
|
6
|
+
|
|
7
|
+
from typing import Dict
|
|
8
|
+
|
|
9
|
+
from . import claude, codex
|
|
10
|
+
from .common import (
|
|
11
|
+
Plan,
|
|
12
|
+
Result,
|
|
13
|
+
RuntimeSpec,
|
|
14
|
+
SetupError,
|
|
15
|
+
Step,
|
|
16
|
+
apply_plan,
|
|
17
|
+
detect_repo,
|
|
18
|
+
known_template_digests,
|
|
19
|
+
known_workflow_digests,
|
|
20
|
+
lines,
|
|
21
|
+
plan_setup,
|
|
22
|
+
run_setup,
|
|
23
|
+
script_text,
|
|
24
|
+
template_digest,
|
|
25
|
+
to_json,
|
|
26
|
+
workflow_digest,
|
|
27
|
+
workflow_text,
|
|
28
|
+
)
|
|
29
|
+
|
|
30
|
+
SPECS: Dict[str, RuntimeSpec] = {claude.SPEC.name: claude.SPEC, codex.SPEC.name: codex.SPEC}
|
|
31
|
+
RUNTIMES = tuple(SPECS)
|
|
32
|
+
|
|
33
|
+
__all__ = [
|
|
34
|
+
"Plan",
|
|
35
|
+
"RUNTIMES",
|
|
36
|
+
"Result",
|
|
37
|
+
"RuntimeSpec",
|
|
38
|
+
"SPECS",
|
|
39
|
+
"SetupError",
|
|
40
|
+
"Step",
|
|
41
|
+
"apply_plan",
|
|
42
|
+
"detect_repo",
|
|
43
|
+
"known_template_digests",
|
|
44
|
+
"known_workflow_digests",
|
|
45
|
+
"lines",
|
|
46
|
+
"plan_setup",
|
|
47
|
+
"run_setup",
|
|
48
|
+
"script_text",
|
|
49
|
+
"template_digest",
|
|
50
|
+
"to_json",
|
|
51
|
+
"workflow_digest",
|
|
52
|
+
"workflow_text",
|
|
53
|
+
]
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: 2026 Kiloloop
|
|
2
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
"""``agent-memory setup claude``: the Claude Code hook.
|
|
4
|
+
|
|
5
|
+
Claude Code reads ``.claude/settings.json`` and runs each ``SessionStart``
|
|
6
|
+
command with the ``startup`` matcher when a session begins, with the
|
|
7
|
+
repository as its working directory; what the command prints to stdout is
|
|
8
|
+
added to the session's context. So the script prints its manifest, and a
|
|
9
|
+
warning, as plain lines. The registration retires the two hook commands the
|
|
10
|
+
kernel used to install, and removes their scripts only when they are byte
|
|
11
|
+
for byte what it wrote; the kernel's envelope hook and anything custom stay. Beside the hook goes the
|
|
12
|
+
workflow file, a repository skill Claude Code loads on demand.
|
|
13
|
+
"""
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
|
|
17
|
+
from . import legacy
|
|
18
|
+
from .common import RuntimeSpec
|
|
19
|
+
|
|
20
|
+
SETTINGS_SCHEMA = "https://json.schemastore.org/claude-code-settings.json"
|
|
21
|
+
|
|
22
|
+
SPEC = RuntimeSpec(
|
|
23
|
+
name="claude",
|
|
24
|
+
settings_file=".claude/settings.json",
|
|
25
|
+
script_file=".claude/hooks/agent-memory-pull.sh",
|
|
26
|
+
event="SessionStart",
|
|
27
|
+
matcher="startup",
|
|
28
|
+
timeout=30,
|
|
29
|
+
workflow_file=".claude/skills/agent-memory/SKILL.md",
|
|
30
|
+
report_body=" printf '%s\\n' \"$1\"",
|
|
31
|
+
fresh_settings={"$schema": SETTINGS_SCHEMA},
|
|
32
|
+
legacy_registrations=legacy.CLAUDE_LEGACY_REGISTRATIONS,
|
|
33
|
+
legacy_files=legacy.CLAUDE_LEGACY_FILES,
|
|
34
|
+
)
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: 2026 Kiloloop
|
|
2
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
"""``agent-memory setup codex``: the Codex hook.
|
|
4
|
+
|
|
5
|
+
Codex reads ``.codex/hooks.json``; a ``SessionStart`` entry whose matcher is
|
|
6
|
+
``^startup$`` runs when a session begins, and the command answers with a
|
|
7
|
+
JSON envelope whose ``additionalContext`` the runtime adds to the session.
|
|
8
|
+
The script therefore reports through that envelope, and the ``startup`` verb
|
|
9
|
+
renders one for this runtime. The entry is the memory half only: it sits
|
|
10
|
+
beside the kernel's ``session-init --hook`` entry, which keeps verifying
|
|
11
|
+
protocol files and status, and only that entry's ``--pull-memory`` flag is
|
|
12
|
+
retired, so memory is pulled once. Its ``additionalContextLimit`` belongs
|
|
13
|
+
to it and is never touched. Beside the hook goes the workflow file, a
|
|
14
|
+
repository skill under ``.agents/skills/``, where Codex discovers them.
|
|
15
|
+
"""
|
|
16
|
+
|
|
17
|
+
from __future__ import annotations
|
|
18
|
+
|
|
19
|
+
from . import legacy
|
|
20
|
+
from .common import RuntimeSpec
|
|
21
|
+
|
|
22
|
+
REPORT_BODY = (
|
|
23
|
+
" printf '{\"continue\": true, \"systemMessage\": \"%s\", \"hookSpecificOutput\": "
|
|
24
|
+
"{\"hookEventName\": \"SessionStart\", \"additionalContext\": \"%s\"}}\\n' \"$1\" \"$1\""
|
|
25
|
+
)
|
|
26
|
+
|
|
27
|
+
SPEC = RuntimeSpec(
|
|
28
|
+
name="codex",
|
|
29
|
+
settings_file=".codex/hooks.json",
|
|
30
|
+
script_file=".codex/hooks/agent-memory-pull.sh",
|
|
31
|
+
event="SessionStart",
|
|
32
|
+
matcher="^startup$",
|
|
33
|
+
timeout=60,
|
|
34
|
+
workflow_file=".agents/skills/agent-memory/SKILL.md",
|
|
35
|
+
report_body=REPORT_BODY,
|
|
36
|
+
hook_fields={"statusMessage": "Pulling agent memory"},
|
|
37
|
+
fresh_settings={"description": "agent-memory startup: pull the memory home and list the files to read."},
|
|
38
|
+
legacy_flag=(legacy.CODEX_SESSION_INIT_PREFIX, legacy.CODEX_LEGACY_PULL_FLAG),
|
|
39
|
+
)
|