agentram 0.1.10 → 0.1.12

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
@@ -1009,3 +1009,32 @@ agentram tui
1009
1009
  ```
1010
1010
 
1011
1011
  When `textual` is installed, AgentRAM uses a real full-screen TUI with mouse wheel scrolling inside the chat frame. If `textual` is missing, it falls back to the basic print-based terminal UI.
1012
+
1013
+ ## npm Python Dependencies
1014
+
1015
+ When installed through npm, AgentRAM runs a `postinstall` step that tries to install Python TUI dependencies for the Python interpreter used by `agentram`:
1016
+
1017
+ ```text
1018
+ textual>=0.80
1019
+ prompt_toolkit>=3.0
1020
+ ```
1021
+
1022
+ Set target Python before install when needed:
1023
+
1024
+ ```powershell
1025
+ $env:PYTHON="C:\Users\admin\anaconda3\python.exe"
1026
+ npm install -g agentram@latest
1027
+ ```
1028
+
1029
+ Skip automatic Python dependency install:
1030
+
1031
+ ```powershell
1032
+ $env:AGENTRAM_SKIP_PY_DEPS="1"
1033
+ npm install -g agentram@latest
1034
+ ```
1035
+
1036
+ If auto install fails, install manually:
1037
+
1038
+ ```powershell
1039
+ python -m pip install textual prompt_toolkit
1040
+ ```
package/agentram/cli.py CHANGED
@@ -751,12 +751,7 @@ def supervisor_workflow_text(context: McpContext, prompt: str) -> str:
751
751
  outputs[slot] = f"error: {model_error_hint(str(error))}"
752
752
  if not main_agent:
753
753
  outputs["main"] = "No main agent bound. Use /bind-agent main <provider> <model>."
754
- if small_agent and outputs.get("small") and not outputs["small"].startswith("error:"):
755
- call_tool(
756
- context,
757
- "agentram_emit_event",
758
- {"type": "DECISION", "payload": {"content": outputs["small"]}, "task_id": "codex", "ingest": True},
759
- )
754
+ persist_workflow_memory(context, prompt, plan, outputs)
760
755
  return "\n".join(
761
756
  [
762
757
  "Workflow: supervisor -> main + small -> merge",
@@ -771,6 +766,28 @@ def supervisor_workflow_text(context: McpContext, prompt: str) -> str:
771
766
  ]
772
767
  )
773
768
 
769
+ def persist_workflow_memory(context: McpContext, prompt: str, plan: str, outputs: dict[str, str]) -> None:
770
+ small_notes = outputs.get("small", "").strip()
771
+ main_result = outputs.get("main", "").strip()
772
+ note_parts = [
773
+ f"User request: {prompt}",
774
+ f"Supervisor plan: {trim(plan.strip(), 1200)}" if plan.strip() else "Supervisor plan: -",
775
+ ]
776
+ if small_notes and not small_notes.startswith("error:"):
777
+ note_parts.append(f"Small memory notes: {trim(small_notes, 1200)}")
778
+ else:
779
+ note_parts.append("Small memory notes: unavailable; persisted supervisor plan as fallback RAM note.")
780
+ if main_result and not main_result.startswith("error:"):
781
+ note_parts.append(f"Main result summary: {trim(main_result, 600)}")
782
+ content = "\n".join(note_parts).strip()
783
+ if not content:
784
+ return
785
+ call_tool(
786
+ context,
787
+ "agentram_emit_event",
788
+ {"type": "DECISION", "payload": {"content": content}, "task_id": "codex", "ingest": True},
789
+ )
790
+
774
791
  def supervisor_plan(supervisor: AgentModelEndpoint | None, prompt: str, memory_context: str) -> str:
775
792
  if not supervisor:
776
793
  return "No supervisor bound. Fallback plan: handle user request, run main coding agent, ask small agent to update RAM notes."
@@ -0,0 +1,38 @@
1
+ #!/usr/bin/env node
2
+ const { spawnSync } = require("node:child_process");
3
+
4
+ if (process.env.AGENTRAM_SKIP_PY_DEPS === "1") {
5
+ console.log("AgentRAM: skip Python TUI deps because AGENTRAM_SKIP_PY_DEPS=1");
6
+ process.exit(0);
7
+ }
8
+
9
+ const candidates = process.env.PYTHON
10
+ ? [process.env.PYTHON]
11
+ : ["python", ...(process.platform === "win32" ? ["py"] : [])];
12
+ const deps = ["textual>=0.80", "prompt_toolkit>=3.0"];
13
+
14
+ function runPython(command, args) {
15
+ const finalArgs = command === "py" ? ["-3", ...args] : args;
16
+ return spawnSync(command, finalArgs, { stdio: "inherit" });
17
+ }
18
+
19
+ let lastError = null;
20
+ for (const command of candidates) {
21
+ const probe = runPython(command, ["-c", "import sys; print(sys.executable)"]);
22
+ if (probe.error || probe.status !== 0) {
23
+ lastError = probe.error || new Error(`${command} exited ${probe.status}`);
24
+ continue;
25
+ }
26
+
27
+ console.log(`AgentRAM: installing Python TUI deps with ${command}`);
28
+ const install = runPython(command, ["-m", "pip", "install", ...deps]);
29
+ if (!install.error && install.status === 0) {
30
+ process.exit(0);
31
+ }
32
+ lastError = install.error || new Error(`${command} pip install exited ${install.status}`);
33
+ }
34
+
35
+ console.warn("AgentRAM: Python TUI deps were not installed automatically.");
36
+ console.warn("AgentRAM: run `python -m pip install textual prompt_toolkit` manually, or set PYTHON to the target interpreter.");
37
+ if (lastError) console.warn(`AgentRAM: ${lastError.message}`);
38
+ process.exit(process.env.AGENTRAM_STRICT_POSTINSTALL === "1" ? 1 : 0);
package/package.json CHANGED
@@ -1,51 +1,52 @@
1
- {
2
- "name": "agentram",
3
- "version": "0.1.10",
4
- "description": "Async, model-agnostic Working RAM for coding agents.",
5
- "license": "MIT",
6
- "homepage": "https://github.com/trancongnghia/AGENT_RAM#readme",
7
- "repository": {
8
- "type": "git",
9
- "url": "git+https://github.com/trancongnghia/AGENT_RAM.git"
10
- },
11
- "bugs": {
12
- "url": "https://github.com/trancongnghia/AGENT_RAM/issues"
13
- },
14
- "keywords": [
15
- "agent",
16
- "memory",
17
- "codex",
18
- "claude",
19
- "mcp",
20
- "llm"
21
- ],
22
- "bin": {
23
- "agentram": "bin/agentram.js",
24
- "agentram-mcp": "bin/agentram-mcp.js"
25
- },
26
- "scripts": {
27
- "agentram": "node bin/agentram.js",
28
- "agentram:mcp": "node bin/agentram-mcp.js",
29
- "test": "python -m pytest -q",
30
- "pack:dry-run": "npm pack --dry-run",
31
- "prepublishOnly": "npm test"
32
- },
33
- "files": [
34
- "agentram/*.py",
35
- "bin/*.js",
36
- ".claude/agents/*.md",
37
- ".claude/commands/*.md",
38
- "agentram_mcp_server.py",
39
- "agentram_daemon.py",
40
- "codex_ram.py",
41
- "pyproject.toml",
42
- "README.md",
43
- "LICENSE"
44
- ],
45
- "engines": {
46
- "node": ">=16"
47
- },
48
- "publishConfig": {
49
- "access": "public"
50
- }
51
- }
1
+ {
2
+ "name": "agentram",
3
+ "version": "0.1.12",
4
+ "description": "Async, model-agnostic Working RAM for coding agents.",
5
+ "license": "MIT",
6
+ "homepage": "https://github.com/trancongnghia/AGENT_RAM#readme",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/trancongnghia/AGENT_RAM.git"
10
+ },
11
+ "bugs": {
12
+ "url": "https://github.com/trancongnghia/AGENT_RAM/issues"
13
+ },
14
+ "keywords": [
15
+ "agent",
16
+ "memory",
17
+ "codex",
18
+ "claude",
19
+ "mcp",
20
+ "llm"
21
+ ],
22
+ "bin": {
23
+ "agentram": "bin/agentram.js",
24
+ "agentram-mcp": "bin/agentram-mcp.js"
25
+ },
26
+ "scripts": {
27
+ "agentram": "node bin/agentram.js",
28
+ "agentram:mcp": "node bin/agentram-mcp.js",
29
+ "test": "python -m pytest -q",
30
+ "pack:dry-run": "npm pack --dry-run",
31
+ "prepublishOnly": "npm test",
32
+ "postinstall": "node bin/agentram-postinstall.js"
33
+ },
34
+ "files": [
35
+ "agentram/*.py",
36
+ "bin/*.js",
37
+ ".claude/agents/*.md",
38
+ ".claude/commands/*.md",
39
+ "agentram_mcp_server.py",
40
+ "agentram_daemon.py",
41
+ "codex_ram.py",
42
+ "pyproject.toml",
43
+ "README.md",
44
+ "LICENSE"
45
+ ],
46
+ "engines": {
47
+ "node": ">=16"
48
+ },
49
+ "publishConfig": {
50
+ "access": "public"
51
+ }
52
+ }
package/pyproject.toml CHANGED
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "agentram"
7
- version = "0.1.10"
7
+ version = "0.1.12"
8
8
  description = "Async, model-agnostic RAM layer for agentic coding tools."
9
9
  readme = "README.md"
10
10
  license = "MIT"