march-cli 0.1.1 → 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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "march-cli",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "March CLI — terminal-native coding agent with context reconstruction",
5
5
  "type": "module",
6
6
  "main": "./src/main.mjs",
@@ -27,7 +27,7 @@ export { installModelPayloadDumper } from "./model-payload-dumper.mjs";
27
27
  export { createDefaultSessionManager, resolveRunnerSessionManager } from "./runner/runner-init.mjs";
28
28
  export { getRunnerSessionStats, syncEngineSessionState } from "./runner/runner-session-state.mjs";
29
29
 
30
- export async function createRunner({ cwd, modelId = null, provider = null, providers = {}, stateRoot, ui, memoryStore = null, memoryTools = [], shellRuntime = null, mcpTools = [], mcpInjections = [], mcpClientManager = null, webTools = [], namespace = "", sessionManager = null, useRuntimeHost = false, projectMarchDir = null, syncPiSidecar = false, extensionPaths = [], lifecycleHooks = [], lifecycleDiagnostics = [], authStorage = null, permissionController = null, modelContextDumper = null, turnNotifier = null, onModelPayload = null, createAgentSessionImpl = createAgentSession, createAgentSessionRuntimeImpl, createRuntimeServices, createRuntimeSessionFromServices, maxTurns, trimBatch, serviceTier = null }) {
30
+ export async function createRunner({ cwd, modelId = null, provider = null, providers = {}, stateRoot, ui, memoryRoot = null, memoryStore = null, memoryTools = [], shellRuntime = null, mcpTools = [], mcpInjections = [], mcpClientManager = null, webTools = [], namespace = "", sessionManager = null, useRuntimeHost = false, projectMarchDir = null, syncPiSidecar = false, extensionPaths = [], lifecycleHooks = [], lifecycleDiagnostics = [], authStorage = null, permissionController = null, modelContextDumper = null, turnNotifier = null, onModelPayload = null, createAgentSessionImpl = createAgentSession, createAgentSessionRuntimeImpl, createRuntimeServices, createRuntimeSessionFromServices, maxTurns, trimBatch, serviceTier = null }) {
31
31
  if (!useRuntimeHost && extensionPaths.length > 0) {
32
32
  throw new Error("--extension requires the default pi runtime host path");
33
33
  }
@@ -47,7 +47,7 @@ export async function createRunner({ cwd, modelId = null, provider = null, provi
47
47
  retry: { enabled: true, maxRetries: 3, baseDelayMs: 2000 },
48
48
  });
49
49
  const lspService = new LspService({ cwd });
50
- const engine = new ContextEngine({ cwd, modelId, provider, namespace, shellRuntime, lspService, injections: mcpInjections, maxTurns, trimBatch });
50
+ const engine = new ContextEngine({ cwd, modelId, provider, namespace, memoryRoot, shellRuntime, lspService, injections: mcpInjections, maxTurns, trimBatch });
51
51
  const resolvedSessionManager = resolveRunnerSessionManager(cwd, sessionManager);
52
52
  const sessionBinding = createSessionBinding(null);
53
53
  let currentModelCallKind = "model";
@@ -6,8 +6,9 @@ import { buildProjectContext } from "./project-context.mjs";
6
6
  import { formatRecallHints } from "../memory/markdown-store.mjs";
7
7
 
8
8
  export class ContextEngine {
9
- constructor({ cwd, modelId, provider = "deepseek", thinkingLevel = "medium", namespace = "", shellRuntime = null, lspService = null, injections = [], maxTurns, trimBatch }) {
9
+ constructor({ cwd, modelId, provider = "deepseek", thinkingLevel = "medium", namespace = "", memoryRoot = null, shellRuntime = null, lspService = null, injections = [], maxTurns, trimBatch }) {
10
10
  this.cwd = cwd;
11
+ this.memoryRoot = memoryRoot;
11
12
  this.modelId = modelId;
12
13
  this.provider = provider;
13
14
  this.thinkingLevel = thinkingLevel;
@@ -116,7 +117,7 @@ export class ContextEngine {
116
117
  // ── Private layers ──────────────────────────────────────────────────
117
118
 
118
119
  #buildSessionIdentity() {
119
- return buildSessionIdentity({ cwd: this.cwd, workspaceRoot: this.cwd });
120
+ return buildSessionIdentity({ cwd: this.cwd, workspaceRoot: this.cwd, memoryRoot: this.memoryRoot });
120
121
  }
121
122
 
122
123
  #buildRecentChat() {
@@ -1,15 +1,17 @@
1
1
  export function buildSessionIdentity({
2
2
  cwd,
3
3
  workspaceRoot = cwd,
4
+ memoryRoot = null,
4
5
  platform = process.platform,
5
6
  } = {}) {
6
7
  const shellInfo = platform === "win32"
7
8
  ? "shells: powershell (recommended), bash (Git Bash)"
8
9
  : "shell: bash";
10
+ const memoryInfo = memoryRoot ? `memory_root: ${memoryRoot}\n` : "";
9
11
 
10
12
  return `[session_identity]
11
13
  cwd: ${cwd}
12
14
  workspace_root: ${workspaceRoot}
13
- platform: ${platform}
15
+ ${memoryInfo}platform: ${platform}
14
16
  ${shellInfo}`;
15
17
  }
@@ -56,5 +56,5 @@ The user primarily asks for software engineering work: fixing bugs, adding behav
56
56
  - [memory_hint source="..."] blocks in recent_chat show memory hints matched from your thinking output. Use memory_open(id) to read the full content.
57
57
  - Use memory_search(query) for full-text search across all memories.
58
58
  - To edit an existing memory, use memory_open(id) to get its path, then edit_file with mode="patch" for targeted edits.
59
- - Use memory_save() to create memories or update whole fields. Before creating a new memory, merge related updates into an existing memory when they share the same topic or decision thread. Tags are the primary retrieval key for future recall. Prefer lowercase kebab-case tags like 'march-cli', 'tooling', 'permissions'.
59
+ - Use memory_save() to create memories or update whole fields. Before creating a new memory, first search/open related memories and merge updates into an existing memory when they share the same topic, project, or decision thread; prefer modifying the existing memory file over creating a scattered new one. Tags are the primary retrieval key for future recall. Prefer lowercase kebab-case tags like 'march-cli', 'tooling', 'permissions'.
60
60
  </memory_system>
package/src/main.mjs CHANGED
@@ -155,6 +155,7 @@ export async function run(argv) {
155
155
  providers: config.providers,
156
156
  stateRoot,
157
157
  ui,
158
+ memoryRoot,
158
159
  memoryStore,
159
160
  memoryTools,
160
161
  shellRuntime,