memorix 1.5.1 → 1.6.0
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/CHANGELOG.md +23 -0
- package/README.md +3 -3
- package/README.zh-CN.md +3 -3
- package/TEAM.md +86 -86
- package/dist/cli/index.js +243 -42
- package/dist/cli/memcode.js +0 -0
- package/dist/index.js +167 -20
- package/dist/maintenance-runner.js +5 -4
- package/dist/media-audio-runner.js +5 -4
- package/dist/media-video-runner.js +5 -4
- package/dist/memcode-runtime/CHANGELOG.md +23 -0
- package/dist/sdk.js +166 -19
- package/dist/vector-backfill-runner.js +5 -4
- package/docs/1.2.4-PERSISTENT-MEMORY-DELIVERY.md +1 -1
- package/docs/API_REFERENCE.md +1 -1
- package/docs/DESIGN_DECISIONS.md +357 -357
- package/docs/DEVELOPMENT.md +5 -3
- package/package.json +1 -1
- package/plugins/claude/memorix/.claude-plugin/plugin.json +1 -1
- package/plugins/codebuddy/memorix/.codebuddy-plugin/plugin.json +1 -1
- package/plugins/codex/memorix/.codex-plugin/plugin.json +1 -1
- package/plugins/copilot/memorix/plugin.json +1 -1
- package/plugins/gemini/memorix/gemini-extension.json +1 -1
- package/plugins/omp/memorix/package.json +1 -1
- package/plugins/openclaw/memorix/.codex-plugin/plugin.json +1 -1
- package/plugins/pi/memorix/package.json +1 -1
- package/server.json +2 -2
- package/src/audit/index.ts +156 -156
- package/src/cli/commands/codegraph.ts +48 -5
- package/src/cli/commands/context.ts +20 -4
- package/src/cli/commands/formation.ts +48 -48
- package/src/cli/commands/git-hook-install.ts +111 -111
- package/src/cli/commands/handoff.ts +54 -54
- package/src/cli/commands/hooks-status.ts +63 -63
- package/src/cli/commands/ingest.ts +44 -44
- package/src/cli/commands/integrate-shared.ts +15 -15
- package/src/cli/commands/lock.ts +82 -82
- package/src/cli/commands/message.ts +104 -104
- package/src/cli/commands/poll.ts +58 -58
- package/src/cli/commands/reasoning.ts +118 -118
- package/src/cli/commands/resume.ts +4 -0
- package/src/cli/commands/skills.ts +114 -114
- package/src/cli/commands/task.ts +167 -167
- package/src/cli/commands/transfer.ts +47 -47
- package/src/cli/index.ts +406 -406
- package/src/cli/tui/ChatView.tsx +234 -234
- package/src/cli/tui/CommandBar.tsx +312 -312
- package/src/cli/tui/ContextRail.tsx +118 -118
- package/src/cli/tui/HeaderBar.tsx +72 -72
- package/src/cli/tui/LogoBanner.tsx +51 -51
- package/src/cli/tui/index.ts +41 -41
- package/src/cli/version.ts +7 -7
- package/src/cli/workbench.ts +1 -1
- package/src/codegraph/auto-context.ts +4 -1
- package/src/codegraph/context-pack.ts +3 -1
- package/src/codegraph/external-provider.ts +93 -0
- package/src/dashboard/project-classification.ts +64 -64
- package/src/git/hooks-path.ts +85 -85
- package/src/hooks/installers/index.ts +1 -1
- package/src/hooks/official-skills.ts +3 -3
- package/src/hooks/pattern-detector.ts +173 -173
- package/src/hooks/rules/memorix-agent-rules.md +1 -1
- package/src/hooks/significance-filter.ts +250 -250
- package/src/knowledge/context-receipt.ts +41 -0
- package/src/knowledge/workflows.ts +6 -3
- package/src/knowledge/workset.ts +56 -2
- package/src/llm/memory-manager.ts +328 -328
- package/src/llm/quality.ts +248 -248
- package/src/memory/attribution-guard.ts +249 -249
- package/src/memory/disclosure-policy.ts +135 -135
- package/src/memory/entity-extractor.ts +197 -197
- package/src/memory/formation/evaluate.ts +217 -217
- package/src/memory/freshness.ts +122 -122
- package/src/memory/graph.ts +197 -197
- package/src/memory/refs.ts +94 -94
- package/src/memory/secret-filter.ts +79 -79
- package/src/orchestrate/adapters/claude-stream.ts +192 -192
- package/src/orchestrate/adapters/claude.ts +111 -111
- package/src/orchestrate/adapters/codex-stream.ts +134 -134
- package/src/orchestrate/adapters/codex.ts +41 -41
- package/src/orchestrate/adapters/gemini-stream.ts +166 -166
- package/src/orchestrate/adapters/gemini.ts +42 -42
- package/src/orchestrate/adapters/index.ts +73 -73
- package/src/orchestrate/adapters/opencode-stream.ts +143 -143
- package/src/orchestrate/adapters/opencode.ts +47 -47
- package/src/orchestrate/adapters/types.ts +77 -77
- package/src/orchestrate/capability-router.ts +284 -284
- package/src/orchestrate/cost-tracker.ts +219 -219
- package/src/orchestrate/error-recovery.ts +191 -191
- package/src/orchestrate/evidence.ts +140 -140
- package/src/orchestrate/ledger.ts +110 -110
- package/src/orchestrate/memorix-bridge.ts +343 -343
- package/src/orchestrate/output-budget.ts +80 -80
- package/src/orchestrate/permission.ts +152 -152
- package/src/orchestrate/pipeline-trace.ts +131 -131
- package/src/orchestrate/prompt-builder.ts +155 -155
- package/src/orchestrate/ring-buffer.ts +37 -37
- package/src/orchestrate/task-graph.ts +389 -389
- package/src/project/aliases.ts +374 -374
- package/src/rules/adapters/trae.ts +56 -56
- package/src/rules/syncer.ts +235 -235
- package/src/search/query-expansion.ts +52 -52
- package/src/server/formation-timeout.ts +27 -27
- package/src/server.ts +15 -3
- package/src/skills/mini-skills.ts +386 -386
- package/src/store/chat-store.ts +119 -119
- package/src/store/graph-store.ts +249 -249
- package/src/store/mini-skill-store.ts +349 -349
- package/src/store/persistence-json.ts +212 -212
- package/src/store/persistence.ts +291 -291
- package/src/store/project-affinity.ts +195 -195
- package/src/team/event-bus.ts +76 -76
- package/src/team/handoff.ts +161 -161
- package/src/team/poll.ts +132 -132
- package/src/workspace/mcp-adapters/codex.ts +191 -191
- package/src/workspace/mcp-adapters/copilot.ts +105 -105
- package/src/workspace/mcp-adapters/cursor.ts +53 -53
- package/src/workspace/mcp-adapters/kiro.ts +64 -64
- package/src/workspace/mcp-adapters/opencode.ts +123 -123
- package/src/workspace/mcp-adapters/trae.ts +134 -134
- package/src/workspace/mcp-adapters/windsurf.ts +91 -91
- package/src/workspace/sanitizer.ts +60 -60
package/src/knowledge/workset.ts
CHANGED
|
@@ -8,6 +8,7 @@ import { WorkflowStore } from './workflow-store.js';
|
|
|
8
8
|
import { OutcomeStore } from './outcome-store.js';
|
|
9
9
|
import { qualityFromOutcome, type OutcomeQuality } from './outcome-types.js';
|
|
10
10
|
import { selectWorkflows } from './workflows.js';
|
|
11
|
+
import type { AgentTarget } from '../types.js';
|
|
11
12
|
import { renderLongTermMemorySummary, selectLongTermMemoriesForTask } from '../memory/long-term.js';
|
|
12
13
|
import { governContextCandidates, type GovernancePlan } from './governor.js';
|
|
13
14
|
import type {
|
|
@@ -73,6 +74,18 @@ export interface WorksetWorkflow {
|
|
|
73
74
|
cautions: string[];
|
|
74
75
|
}
|
|
75
76
|
|
|
77
|
+
/**
|
|
78
|
+
* A task-scoped plan assembled from existing workflow and wiki assets. It is
|
|
79
|
+
* descriptive rather than an authorization boundary: host agents retain their
|
|
80
|
+
* own tool and approval policies.
|
|
81
|
+
*/
|
|
82
|
+
export interface WorksetAgentLoadout {
|
|
83
|
+
agent: AgentTarget;
|
|
84
|
+
workflowIds: string[];
|
|
85
|
+
requiredContext: string[];
|
|
86
|
+
allowedTools: string[];
|
|
87
|
+
}
|
|
88
|
+
|
|
76
89
|
export interface WorksetMemorySource {
|
|
77
90
|
id: number;
|
|
78
91
|
title: string;
|
|
@@ -156,6 +169,7 @@ export interface TaskWorkset {
|
|
|
156
169
|
pages: WorksetPage[];
|
|
157
170
|
durableMemory: WorksetLongTermMemory[];
|
|
158
171
|
workflows: WorksetWorkflow[];
|
|
172
|
+
agentLoadout?: WorksetAgentLoadout;
|
|
159
173
|
cautions: WorksetCaution[];
|
|
160
174
|
verification: string[];
|
|
161
175
|
evidenceIds: string[];
|
|
@@ -179,6 +193,8 @@ export interface BuildTaskWorksetInput {
|
|
|
179
193
|
projectId: string;
|
|
180
194
|
dataDir: string;
|
|
181
195
|
task?: string;
|
|
196
|
+
/** Optional target used to select workflows explicitly compatible with this agent. */
|
|
197
|
+
agent?: AgentTarget;
|
|
182
198
|
lens: string;
|
|
183
199
|
currentFacts?: string[];
|
|
184
200
|
continuation?: WorksetContinuation;
|
|
@@ -313,6 +329,18 @@ function workflowOutput(selection: WorkflowSelection): WorksetWorkflow {
|
|
|
313
329
|
};
|
|
314
330
|
}
|
|
315
331
|
|
|
332
|
+
function workflowLoadout(agent: AgentTarget | undefined, selections: WorkflowSelection[]): WorksetAgentLoadout | undefined {
|
|
333
|
+
if (!agent) return undefined;
|
|
334
|
+
return {
|
|
335
|
+
agent,
|
|
336
|
+
workflowIds: selections.map(selection => selection.workflow.id),
|
|
337
|
+
requiredContext: unique(selections.flatMap(selection => selection.workflow.requiredContext))
|
|
338
|
+
.map(item => short(item, 18)).slice(0, 4),
|
|
339
|
+
allowedTools: unique(selections.flatMap(selection => selection.workflow.allowedTools))
|
|
340
|
+
.map(item => short(item, 12)).slice(0, 6),
|
|
341
|
+
};
|
|
342
|
+
}
|
|
343
|
+
|
|
316
344
|
function appendLine(
|
|
317
345
|
lines: string[],
|
|
318
346
|
candidate: string,
|
|
@@ -853,6 +881,23 @@ export function renderTaskWorksetPrompt(input: Omit<TaskWorkset, 'prompt' | 'bud
|
|
|
853
881
|
}
|
|
854
882
|
}
|
|
855
883
|
|
|
884
|
+
if (input.agentLoadout) {
|
|
885
|
+
appendLine(lines, '', maxTokens, omitted, 'agent-loadout-heading');
|
|
886
|
+
appendLine(lines, 'Agent loadout (' + input.agentLoadout.agent + ')', maxTokens, omitted, 'agent-loadout-heading');
|
|
887
|
+
for (const required of input.agentLoadout.requiredContext.slice(0, 2)) {
|
|
888
|
+
appendLine(lines, '- Need: ' + required, maxTokens, omitted, 'agent-loadout-context');
|
|
889
|
+
}
|
|
890
|
+
if (input.agentLoadout.allowedTools.length > 0) {
|
|
891
|
+
appendLine(
|
|
892
|
+
lines,
|
|
893
|
+
'- Workflow tools: ' + input.agentLoadout.allowedTools.join(', '),
|
|
894
|
+
maxTokens,
|
|
895
|
+
omitted,
|
|
896
|
+
'agent-loadout-tools',
|
|
897
|
+
);
|
|
898
|
+
}
|
|
899
|
+
}
|
|
900
|
+
|
|
856
901
|
if (input.verification.length > 0) {
|
|
857
902
|
appendLine(lines, '', maxTokens, omitted, 'verification-heading');
|
|
858
903
|
appendLine(lines, 'Verify', maxTokens, omitted, 'verification-heading');
|
|
@@ -965,6 +1010,7 @@ export async function buildTaskWorkset(input: BuildTaskWorksetInput): Promise<Ta
|
|
|
965
1010
|
let workspace: KnowledgeWorkspace | undefined;
|
|
966
1011
|
let pages: WorksetPage[] = [];
|
|
967
1012
|
let workflows: WorksetWorkflow[] = [];
|
|
1013
|
+
let workflowSelections: WorkflowSelection[] = [];
|
|
968
1014
|
try {
|
|
969
1015
|
workspace = await preferredWorkspace(input.projectId, input.dataDir);
|
|
970
1016
|
if (workspace) {
|
|
@@ -985,14 +1031,15 @@ export async function buildTaskWorkset(input: BuildTaskWorksetInput): Promise<Ta
|
|
|
985
1031
|
if (task) {
|
|
986
1032
|
const workflowStore = new WorkflowStore();
|
|
987
1033
|
await workflowStore.init(input.dataDir);
|
|
988
|
-
|
|
1034
|
+
workflowSelections = selectWorkflows({
|
|
989
1035
|
workflows: workflowStore.listWorkflows(workspace.id, 'active'),
|
|
990
1036
|
task,
|
|
991
1037
|
projectId: input.projectId,
|
|
992
1038
|
store: workflowStore,
|
|
1039
|
+
...(input.agent ? { agent: input.agent } : {}),
|
|
993
1040
|
limit: 2,
|
|
994
1041
|
});
|
|
995
|
-
workflows =
|
|
1042
|
+
workflows = workflowSelections.map(workflowOutput);
|
|
996
1043
|
for (const workflow of workflows) {
|
|
997
1044
|
for (const caution of workflow.cautions) {
|
|
998
1045
|
cautions.push({ kind: 'workflow-failed-verification', message: caution });
|
|
@@ -1018,6 +1065,10 @@ export async function buildTaskWorkset(input: BuildTaskWorksetInput): Promise<Ta
|
|
|
1018
1065
|
workflows,
|
|
1019
1066
|
});
|
|
1020
1067
|
const governedDurableIds = new Set(governed.durableMemory.map(memory => memory.id));
|
|
1068
|
+
const agentLoadout = workflowLoadout(
|
|
1069
|
+
input.agent,
|
|
1070
|
+
workflowSelections.filter(selection => governed.workflows.some(workflow => workflow.id === selection.workflow.id)),
|
|
1071
|
+
);
|
|
1021
1072
|
const evidenceIds = unique(governed.claims.flatMap(claim => evidenceIdsForClaim(
|
|
1022
1073
|
claim,
|
|
1023
1074
|
evidenceByClaim.get(claim.id) ?? [],
|
|
@@ -1084,6 +1135,9 @@ export async function buildTaskWorkset(input: BuildTaskWorksetInput): Promise<Ta
|
|
|
1084
1135
|
pages: pages.filter(page => page.claimIds.some(claimId => governed.claims.some(claim => claim.id === claimId))),
|
|
1085
1136
|
durableMemory: governed.durableMemory,
|
|
1086
1137
|
workflows: governed.workflows,
|
|
1138
|
+
...(agentLoadout
|
|
1139
|
+
? { agentLoadout }
|
|
1140
|
+
: {}),
|
|
1087
1141
|
cautions: normalizedCautions,
|
|
1088
1142
|
verification,
|
|
1089
1143
|
evidenceIds,
|