autodev-cli 1.4.93 → 1.4.95
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/media/profile/00-identity.md +35 -0
- package/media/profile/01-learning.md +23 -0
- package/media/profile/02-memory-mcp.md +49 -0
- package/media/profile/03-living-docs.md +18 -0
- package/media/profile/04-skill-files.md +9 -0
- package/media/profile/05-skill-creation.md +18 -0
- package/media/profile/06-core-rules.md +58 -0
- package/media/profile/07-core-loop.md +31 -0
- package/media/profile/08-thinking.md +30 -0
- package/media/profile/09-parallel-panel.md +29 -0
- package/media/profile/10-codebase-verification.md +19 -0
- package/media/profile/11-git-debug-security.md +16 -0
- package/media/profile/12-todo-format.md +20 -0
- package/media/profile/13-workflow-principles.md +17 -0
- package/media/profile/14-contracts.md +16 -0
- package/media/profile/15-soul.md +12 -0
- package/media/profile/16-journal.md +38 -0
- package/media/profile/17-issue-tracking.md +19 -0
- package/media/profile/18-knowledgebase.md +13 -0
- package/media/profile/19-subagent-context-management.md +510 -0
- package/media/profile/20-project-graph.md +56 -0
- package/out/commands/mcpOperate.js +196 -1
- package/out/commands/mcpOperate.js.map +1 -1
- package/out/core/settingsLoader.d.ts +4 -1
- package/out/core/settingsLoader.js.map +1 -1
- package/out/graphStore.d.ts +153 -0
- package/out/graphStore.js +412 -0
- package/out/graphStore.js.map +1 -0
- package/out/mcpInstallCheck.d.ts +2 -1
- package/out/mcpInstallCheck.js.map +1 -1
- package/out/profileBuilder.js +26 -1
- package/out/profileBuilder.js.map +1 -1
- package/package.json +3 -2
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Project Graph — durable, per-project, cross-session shared memory for agents.
|
|
3
|
+
*
|
|
4
|
+
* This is the "knowledge/work graph" from the graph-engineering playbook: a
|
|
5
|
+
* typed, queryable graph of Entities, Claims, Sources, Artifacts, AgentRuns,
|
|
6
|
+
* Evaluations, Tasks, Commits and Metrics, connected by provenance edges. It is
|
|
7
|
+
* DISTINCT from the file-based memory (`.autodev/memories/`) and the Memory MCP:
|
|
8
|
+
* memory is prose recall; the graph is structured, sourced, versioned facts that
|
|
9
|
+
* many agents read and write across sessions. The mantra: the agent forgets, the
|
|
10
|
+
* graph does not.
|
|
11
|
+
*
|
|
12
|
+
* STORAGE. One append-only log per project at `.autodev/graph/graph.jsonl`.
|
|
13
|
+
* Every mutation is a self-contained JSON line carrying its own provenance
|
|
14
|
+
* (run_id, agent_id, timestamp). Current state is materialised by replaying the
|
|
15
|
+
* log. Append-only buys three things the playbook demands: an audit trail,
|
|
16
|
+
* crash safety, and lock-free concurrent writes — several agents in the same
|
|
17
|
+
* workspace simply append their own lines and re-read to see each other's.
|
|
18
|
+
*
|
|
19
|
+
* INVARIANTS (enforced on write, per the playbook):
|
|
20
|
+
* 1. Every `claim` has a source, or is explicitly marked `inference: true`.
|
|
21
|
+
* 2. Every `artifact` has an authoring run (auto) and a `version`.
|
|
22
|
+
* 3. Every `evaluation` identifies a `rubric`.
|
|
23
|
+
* 4. Superseded nodes remain addressable — supersede never deletes; it links a
|
|
24
|
+
* new version with a `supersedes` edge and flags the old one.
|
|
25
|
+
*/
|
|
26
|
+
export type GraphNodeType = 'entity' | 'claim' | 'source' | 'artifact' | 'agent_run' | 'evaluation' | 'task' | 'commit' | 'metric' | 'note' | 'question' | 'decision';
|
|
27
|
+
export type GraphEdgeType = 'mentions' | 'supports' | 'contradicts' | 'derived_from' | 'produced' | 'evaluates' | 'revises' | 'supersedes' | 'depends_on' | 'parent_of' | 'resolved_to' | 'relates_to';
|
|
28
|
+
export declare const NODE_TYPES: GraphNodeType[];
|
|
29
|
+
export declare const EDGE_TYPES: GraphEdgeType[];
|
|
30
|
+
export interface GraphNode {
|
|
31
|
+
id: string;
|
|
32
|
+
type: GraphNodeType;
|
|
33
|
+
name: string;
|
|
34
|
+
body?: string;
|
|
35
|
+
props?: Record<string, unknown>;
|
|
36
|
+
/** Where the fact came from (a citation, url, file:line, or a source node id). */
|
|
37
|
+
source?: string;
|
|
38
|
+
/** Claims only: true when the claim is a reasoned inference, not sourced. */
|
|
39
|
+
inference?: boolean;
|
|
40
|
+
/** Artifacts only: the version this node describes. */
|
|
41
|
+
version?: string;
|
|
42
|
+
/** Evaluations only: the rubric the judgement was made against. */
|
|
43
|
+
rubric?: string;
|
|
44
|
+
aliases?: string[];
|
|
45
|
+
/** Set when a newer node supersedes this one; the node stays addressable. */
|
|
46
|
+
supersededBy?: string;
|
|
47
|
+
runId: string;
|
|
48
|
+
agentId: string;
|
|
49
|
+
createdAt: string;
|
|
50
|
+
updatedAt: string;
|
|
51
|
+
}
|
|
52
|
+
export interface GraphEdge {
|
|
53
|
+
id: string;
|
|
54
|
+
type: GraphEdgeType;
|
|
55
|
+
from: string;
|
|
56
|
+
to: string;
|
|
57
|
+
props?: Record<string, unknown>;
|
|
58
|
+
source?: string;
|
|
59
|
+
runId: string;
|
|
60
|
+
agentId: string;
|
|
61
|
+
createdAt: string;
|
|
62
|
+
}
|
|
63
|
+
export interface Identity {
|
|
64
|
+
agentId: string;
|
|
65
|
+
runId: string;
|
|
66
|
+
}
|
|
67
|
+
export interface AddNodeInput {
|
|
68
|
+
type: string;
|
|
69
|
+
name: string;
|
|
70
|
+
id?: string;
|
|
71
|
+
body?: string;
|
|
72
|
+
props?: Record<string, unknown>;
|
|
73
|
+
source?: string;
|
|
74
|
+
inference?: boolean;
|
|
75
|
+
version?: string;
|
|
76
|
+
rubric?: string;
|
|
77
|
+
aliases?: string[];
|
|
78
|
+
}
|
|
79
|
+
export interface AddEdgeInput {
|
|
80
|
+
type: string;
|
|
81
|
+
from: string;
|
|
82
|
+
to: string;
|
|
83
|
+
props?: Record<string, unknown>;
|
|
84
|
+
source?: string;
|
|
85
|
+
}
|
|
86
|
+
/** A write rejected by an invariant — the caller turns this into a helpful error. */
|
|
87
|
+
export declare class GraphInvariantError extends Error {
|
|
88
|
+
}
|
|
89
|
+
export declare class GraphStore {
|
|
90
|
+
private identity;
|
|
91
|
+
private readonly dir;
|
|
92
|
+
private readonly file;
|
|
93
|
+
private nodes;
|
|
94
|
+
private edges;
|
|
95
|
+
private lastSize;
|
|
96
|
+
private lastMtimeMs;
|
|
97
|
+
constructor(workspaceRoot: string, identity: Identity);
|
|
98
|
+
/** Where the graph lives (for messages). */
|
|
99
|
+
get path(): string;
|
|
100
|
+
private ensureDir;
|
|
101
|
+
/** Re-materialise from disk when the log changed under us (another agent wrote). */
|
|
102
|
+
reloadIfChanged(): void;
|
|
103
|
+
private apply;
|
|
104
|
+
private append;
|
|
105
|
+
addNode(input: AddNodeInput): {
|
|
106
|
+
node: GraphNode;
|
|
107
|
+
created: boolean;
|
|
108
|
+
};
|
|
109
|
+
addEdge(input: AddEdgeInput): GraphEdge;
|
|
110
|
+
/**
|
|
111
|
+
* Version a node: create the replacement, link it with a `supersedes` edge,
|
|
112
|
+
* and flag the old node `supersededBy`. The old node stays addressable
|
|
113
|
+
* (invariant 4) — it just drops out of default query results.
|
|
114
|
+
*/
|
|
115
|
+
supersede(oldId: string, replacement: AddNodeInput): {
|
|
116
|
+
oldId: string;
|
|
117
|
+
node: GraphNode;
|
|
118
|
+
edge: GraphEdge;
|
|
119
|
+
};
|
|
120
|
+
getNode(idOrName: string): GraphNode | undefined;
|
|
121
|
+
query(opts: {
|
|
122
|
+
type?: string;
|
|
123
|
+
text?: string;
|
|
124
|
+
id?: string;
|
|
125
|
+
includeSuperseded?: boolean;
|
|
126
|
+
limit?: number;
|
|
127
|
+
}): GraphNode[];
|
|
128
|
+
/**
|
|
129
|
+
* Bounded neighbourhood around a node — the playbook's "context construction
|
|
130
|
+
* from a graph": resolve the entity, expand a hop or two over allowed edge
|
|
131
|
+
* types, and return a small, citable subgraph rather than the whole graph.
|
|
132
|
+
*/
|
|
133
|
+
neighbors(opts: {
|
|
134
|
+
idOrName: string;
|
|
135
|
+
hops?: number;
|
|
136
|
+
edgeTypes?: string[];
|
|
137
|
+
limit?: number;
|
|
138
|
+
}): {
|
|
139
|
+
center: GraphNode;
|
|
140
|
+
nodes: GraphNode[];
|
|
141
|
+
edges: GraphEdge[];
|
|
142
|
+
} | null;
|
|
143
|
+
stats(): {
|
|
144
|
+
nodeCount: number;
|
|
145
|
+
edgeCount: number;
|
|
146
|
+
nodesByType: Record<string, number>;
|
|
147
|
+
edgesByType: Record<string, number>;
|
|
148
|
+
superseded: number;
|
|
149
|
+
isolated: number;
|
|
150
|
+
contradictions: number;
|
|
151
|
+
openQuestions: number;
|
|
152
|
+
};
|
|
153
|
+
}
|
|
@@ -0,0 +1,412 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Project Graph — durable, per-project, cross-session shared memory for agents.
|
|
4
|
+
*
|
|
5
|
+
* This is the "knowledge/work graph" from the graph-engineering playbook: a
|
|
6
|
+
* typed, queryable graph of Entities, Claims, Sources, Artifacts, AgentRuns,
|
|
7
|
+
* Evaluations, Tasks, Commits and Metrics, connected by provenance edges. It is
|
|
8
|
+
* DISTINCT from the file-based memory (`.autodev/memories/`) and the Memory MCP:
|
|
9
|
+
* memory is prose recall; the graph is structured, sourced, versioned facts that
|
|
10
|
+
* many agents read and write across sessions. The mantra: the agent forgets, the
|
|
11
|
+
* graph does not.
|
|
12
|
+
*
|
|
13
|
+
* STORAGE. One append-only log per project at `.autodev/graph/graph.jsonl`.
|
|
14
|
+
* Every mutation is a self-contained JSON line carrying its own provenance
|
|
15
|
+
* (run_id, agent_id, timestamp). Current state is materialised by replaying the
|
|
16
|
+
* log. Append-only buys three things the playbook demands: an audit trail,
|
|
17
|
+
* crash safety, and lock-free concurrent writes — several agents in the same
|
|
18
|
+
* workspace simply append their own lines and re-read to see each other's.
|
|
19
|
+
*
|
|
20
|
+
* INVARIANTS (enforced on write, per the playbook):
|
|
21
|
+
* 1. Every `claim` has a source, or is explicitly marked `inference: true`.
|
|
22
|
+
* 2. Every `artifact` has an authoring run (auto) and a `version`.
|
|
23
|
+
* 3. Every `evaluation` identifies a `rubric`.
|
|
24
|
+
* 4. Superseded nodes remain addressable — supersede never deletes; it links a
|
|
25
|
+
* new version with a `supersedes` edge and flags the old one.
|
|
26
|
+
*/
|
|
27
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
28
|
+
if (k2 === undefined) k2 = k;
|
|
29
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
30
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
31
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
32
|
+
}
|
|
33
|
+
Object.defineProperty(o, k2, desc);
|
|
34
|
+
}) : (function(o, m, k, k2) {
|
|
35
|
+
if (k2 === undefined) k2 = k;
|
|
36
|
+
o[k2] = m[k];
|
|
37
|
+
}));
|
|
38
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
39
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
40
|
+
}) : function(o, v) {
|
|
41
|
+
o["default"] = v;
|
|
42
|
+
});
|
|
43
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
44
|
+
var ownKeys = function(o) {
|
|
45
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
46
|
+
var ar = [];
|
|
47
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
48
|
+
return ar;
|
|
49
|
+
};
|
|
50
|
+
return ownKeys(o);
|
|
51
|
+
};
|
|
52
|
+
return function (mod) {
|
|
53
|
+
if (mod && mod.__esModule) return mod;
|
|
54
|
+
var result = {};
|
|
55
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
56
|
+
__setModuleDefault(result, mod);
|
|
57
|
+
return result;
|
|
58
|
+
};
|
|
59
|
+
})();
|
|
60
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
61
|
+
exports.GraphStore = exports.GraphInvariantError = exports.EDGE_TYPES = exports.NODE_TYPES = void 0;
|
|
62
|
+
const fs = __importStar(require("fs"));
|
|
63
|
+
const path = __importStar(require("path"));
|
|
64
|
+
const crypto = __importStar(require("crypto"));
|
|
65
|
+
exports.NODE_TYPES = [
|
|
66
|
+
'entity', 'claim', 'source', 'artifact', 'agent_run',
|
|
67
|
+
'evaluation', 'task', 'commit', 'metric', 'note', 'question', 'decision',
|
|
68
|
+
];
|
|
69
|
+
exports.EDGE_TYPES = [
|
|
70
|
+
'mentions', 'supports', 'contradicts', 'derived_from', 'produced',
|
|
71
|
+
'evaluates', 'revises', 'supersedes', 'depends_on', 'parent_of',
|
|
72
|
+
'resolved_to', 'relates_to',
|
|
73
|
+
];
|
|
74
|
+
/** A write rejected by an invariant — the caller turns this into a helpful error. */
|
|
75
|
+
class GraphInvariantError extends Error {
|
|
76
|
+
}
|
|
77
|
+
exports.GraphInvariantError = GraphInvariantError;
|
|
78
|
+
function slug(s) {
|
|
79
|
+
return s.toLowerCase().trim().replace(/[^a-z0-9]+/g, '-').replace(/^-+|-+$/g, '').slice(0, 60) || 'x';
|
|
80
|
+
}
|
|
81
|
+
function shortId() { return crypto.randomBytes(5).toString('hex'); }
|
|
82
|
+
class GraphStore {
|
|
83
|
+
identity;
|
|
84
|
+
dir;
|
|
85
|
+
file;
|
|
86
|
+
nodes = new Map();
|
|
87
|
+
edges = new Map();
|
|
88
|
+
lastSize = -1;
|
|
89
|
+
lastMtimeMs = -1;
|
|
90
|
+
constructor(workspaceRoot, identity) {
|
|
91
|
+
this.identity = identity;
|
|
92
|
+
this.dir = path.join(workspaceRoot, '.autodev', 'graph');
|
|
93
|
+
this.file = path.join(this.dir, 'graph.jsonl');
|
|
94
|
+
this.reloadIfChanged();
|
|
95
|
+
}
|
|
96
|
+
/** Where the graph lives (for messages). */
|
|
97
|
+
get path() { return this.file; }
|
|
98
|
+
// ── persistence ──────────────────────────────────────────────────────────
|
|
99
|
+
ensureDir() {
|
|
100
|
+
if (!fs.existsSync(this.dir)) {
|
|
101
|
+
fs.mkdirSync(this.dir, { recursive: true });
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
/** Re-materialise from disk when the log changed under us (another agent wrote). */
|
|
105
|
+
reloadIfChanged() {
|
|
106
|
+
let st = null;
|
|
107
|
+
try {
|
|
108
|
+
st = fs.statSync(this.file);
|
|
109
|
+
}
|
|
110
|
+
catch {
|
|
111
|
+
st = null;
|
|
112
|
+
}
|
|
113
|
+
if (!st) {
|
|
114
|
+
if (this.lastSize !== 0) {
|
|
115
|
+
this.nodes.clear();
|
|
116
|
+
this.edges.clear();
|
|
117
|
+
this.lastSize = 0;
|
|
118
|
+
this.lastMtimeMs = 0;
|
|
119
|
+
}
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
if (st.size === this.lastSize && st.mtimeMs === this.lastMtimeMs) {
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
this.nodes.clear();
|
|
126
|
+
this.edges.clear();
|
|
127
|
+
const text = fs.readFileSync(this.file, 'utf8');
|
|
128
|
+
for (const line of text.split('\n')) {
|
|
129
|
+
const t = line.trim();
|
|
130
|
+
if (!t) {
|
|
131
|
+
continue;
|
|
132
|
+
}
|
|
133
|
+
let op;
|
|
134
|
+
try {
|
|
135
|
+
op = JSON.parse(t);
|
|
136
|
+
}
|
|
137
|
+
catch {
|
|
138
|
+
continue;
|
|
139
|
+
} // tolerate a torn final line
|
|
140
|
+
this.apply(op);
|
|
141
|
+
}
|
|
142
|
+
this.lastSize = st.size;
|
|
143
|
+
this.lastMtimeMs = st.mtimeMs;
|
|
144
|
+
}
|
|
145
|
+
apply(op) {
|
|
146
|
+
if (op.op === 'node') {
|
|
147
|
+
const { op: _o, ...node } = op;
|
|
148
|
+
this.nodes.set(node.id, node);
|
|
149
|
+
}
|
|
150
|
+
else if (op.op === 'edge') {
|
|
151
|
+
const { op: _o, ...edge } = op;
|
|
152
|
+
this.edges.set(edge.id, edge);
|
|
153
|
+
}
|
|
154
|
+
else if (op.op === 'supersede') {
|
|
155
|
+
const old = this.nodes.get(op.id);
|
|
156
|
+
if (old) {
|
|
157
|
+
old.supersededBy = op.by;
|
|
158
|
+
old.updatedAt = op.ts;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
append(op) {
|
|
163
|
+
this.ensureDir();
|
|
164
|
+
fs.appendFileSync(this.file, JSON.stringify(op) + '\n');
|
|
165
|
+
try {
|
|
166
|
+
const st = fs.statSync(this.file);
|
|
167
|
+
this.lastSize = st.size;
|
|
168
|
+
this.lastMtimeMs = st.mtimeMs;
|
|
169
|
+
}
|
|
170
|
+
catch { /* stat best-effort */ }
|
|
171
|
+
this.apply(op);
|
|
172
|
+
}
|
|
173
|
+
// ── writes ───────────────────────────────────────────────────────────────
|
|
174
|
+
addNode(input) {
|
|
175
|
+
this.reloadIfChanged();
|
|
176
|
+
const type = String(input.type || '').toLowerCase().trim();
|
|
177
|
+
if (!exports.NODE_TYPES.includes(type)) {
|
|
178
|
+
throw new GraphInvariantError(`unknown node type "${input.type}". Allowed: ${exports.NODE_TYPES.join(', ')}`);
|
|
179
|
+
}
|
|
180
|
+
const name = String(input.name || '').trim();
|
|
181
|
+
if (!name) {
|
|
182
|
+
throw new GraphInvariantError('node "name" is required');
|
|
183
|
+
}
|
|
184
|
+
// Invariant 1 — a claim must be sourced or explicitly an inference.
|
|
185
|
+
if (type === 'claim' && !input.source && input.inference !== true) {
|
|
186
|
+
throw new GraphInvariantError('a "claim" needs a source (pass source:"file:line"/url/source-node-id) or inference:true');
|
|
187
|
+
}
|
|
188
|
+
// Invariant 2 — an artifact must carry a version (its run is auto-attached).
|
|
189
|
+
if (type === 'artifact' && !String(input.version || '').trim()) {
|
|
190
|
+
throw new GraphInvariantError('an "artifact" needs a version (pass version:"1.4.93" / a commit sha / a semver)');
|
|
191
|
+
}
|
|
192
|
+
// Invariant 3 — an evaluation must name the rubric it judged against.
|
|
193
|
+
if (type === 'evaluation' && !String(input.rubric || '').trim()) {
|
|
194
|
+
throw new GraphInvariantError('an "evaluation" needs a rubric (pass rubric:"what criteria were checked")');
|
|
195
|
+
}
|
|
196
|
+
// Stable ids: entities dedupe by normalised name so resolution is idempotent;
|
|
197
|
+
// everything else gets a fresh id unless the caller pins one (upsert).
|
|
198
|
+
const id = String(input.id || '').trim()
|
|
199
|
+
|| (type === 'entity' ? `entity:${slug(name)}` : `${type}:${shortId()}`);
|
|
200
|
+
const now = new Date().toISOString();
|
|
201
|
+
const existing = this.nodes.get(id);
|
|
202
|
+
const node = {
|
|
203
|
+
id, type, name,
|
|
204
|
+
body: input.body ?? existing?.body,
|
|
205
|
+
props: input.props ?? existing?.props,
|
|
206
|
+
source: input.source ?? existing?.source,
|
|
207
|
+
inference: input.inference ?? existing?.inference,
|
|
208
|
+
version: input.version ?? existing?.version,
|
|
209
|
+
rubric: input.rubric ?? existing?.rubric,
|
|
210
|
+
aliases: mergeAliases(existing?.aliases, input.aliases, existing?.name, name),
|
|
211
|
+
supersededBy: existing?.supersededBy,
|
|
212
|
+
runId: this.identity.runId,
|
|
213
|
+
agentId: this.identity.agentId,
|
|
214
|
+
createdAt: existing?.createdAt ?? now,
|
|
215
|
+
updatedAt: now,
|
|
216
|
+
};
|
|
217
|
+
this.append({ op: 'node', ...node });
|
|
218
|
+
return { node, created: !existing };
|
|
219
|
+
}
|
|
220
|
+
addEdge(input) {
|
|
221
|
+
this.reloadIfChanged();
|
|
222
|
+
const type = String(input.type || '').toLowerCase().trim();
|
|
223
|
+
if (!exports.EDGE_TYPES.includes(type)) {
|
|
224
|
+
throw new GraphInvariantError(`unknown edge type "${input.type}". Allowed: ${exports.EDGE_TYPES.join(', ')}`);
|
|
225
|
+
}
|
|
226
|
+
const from = String(input.from || '').trim();
|
|
227
|
+
const to = String(input.to || '').trim();
|
|
228
|
+
if (!from || !to) {
|
|
229
|
+
throw new GraphInvariantError('edge needs both "from" and "to" node ids');
|
|
230
|
+
}
|
|
231
|
+
if (!this.nodes.has(from)) {
|
|
232
|
+
throw new GraphInvariantError(`edge "from" node not found: ${from}`);
|
|
233
|
+
}
|
|
234
|
+
if (!this.nodes.has(to)) {
|
|
235
|
+
throw new GraphInvariantError(`edge "to" node not found: ${to}`);
|
|
236
|
+
}
|
|
237
|
+
const edge = {
|
|
238
|
+
id: `edge:${shortId()}`, type, from, to,
|
|
239
|
+
props: input.props, source: input.source,
|
|
240
|
+
runId: this.identity.runId, agentId: this.identity.agentId,
|
|
241
|
+
createdAt: new Date().toISOString(),
|
|
242
|
+
};
|
|
243
|
+
this.append({ op: 'edge', ...edge });
|
|
244
|
+
return edge;
|
|
245
|
+
}
|
|
246
|
+
/**
|
|
247
|
+
* Version a node: create the replacement, link it with a `supersedes` edge,
|
|
248
|
+
* and flag the old node `supersededBy`. The old node stays addressable
|
|
249
|
+
* (invariant 4) — it just drops out of default query results.
|
|
250
|
+
*/
|
|
251
|
+
supersede(oldId, replacement) {
|
|
252
|
+
this.reloadIfChanged();
|
|
253
|
+
const old = this.nodes.get(oldId);
|
|
254
|
+
if (!old) {
|
|
255
|
+
throw new GraphInvariantError(`supersede: node not found: ${oldId}`);
|
|
256
|
+
}
|
|
257
|
+
const { node } = this.addNode({ ...replacement, type: old.type });
|
|
258
|
+
const edge = this.addEdge({ type: 'supersedes', from: node.id, to: oldId });
|
|
259
|
+
this.append({ op: 'supersede', id: oldId, by: node.id, runId: this.identity.runId, agentId: this.identity.agentId, ts: new Date().toISOString() });
|
|
260
|
+
return { oldId, node, edge };
|
|
261
|
+
}
|
|
262
|
+
// ── reads ────────────────────────────────────────────────────────────────
|
|
263
|
+
getNode(idOrName) {
|
|
264
|
+
this.reloadIfChanged();
|
|
265
|
+
if (!idOrName) {
|
|
266
|
+
return undefined;
|
|
267
|
+
}
|
|
268
|
+
if (this.nodes.has(idOrName)) {
|
|
269
|
+
return this.nodes.get(idOrName);
|
|
270
|
+
}
|
|
271
|
+
const needle = idOrName.toLowerCase();
|
|
272
|
+
// exact name match first, then alias, then the entity-slug convention
|
|
273
|
+
for (const n of this.nodes.values()) {
|
|
274
|
+
if (n.name.toLowerCase() === needle) {
|
|
275
|
+
return n;
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
for (const n of this.nodes.values()) {
|
|
279
|
+
if ((n.aliases || []).some(a => a.toLowerCase() === needle)) {
|
|
280
|
+
return n;
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
return this.nodes.get(`entity:${slug(idOrName)}`);
|
|
284
|
+
}
|
|
285
|
+
query(opts) {
|
|
286
|
+
this.reloadIfChanged();
|
|
287
|
+
const limit = Math.max(1, Math.min(200, opts.limit ?? 30));
|
|
288
|
+
const type = opts.type ? String(opts.type).toLowerCase() : undefined;
|
|
289
|
+
const text = opts.text ? String(opts.text).toLowerCase() : undefined;
|
|
290
|
+
const out = [];
|
|
291
|
+
for (const n of this.nodes.values()) {
|
|
292
|
+
if (opts.id && n.id !== opts.id) {
|
|
293
|
+
continue;
|
|
294
|
+
}
|
|
295
|
+
if (type && n.type !== type) {
|
|
296
|
+
continue;
|
|
297
|
+
}
|
|
298
|
+
if (!opts.includeSuperseded && n.supersededBy) {
|
|
299
|
+
continue;
|
|
300
|
+
}
|
|
301
|
+
if (text) {
|
|
302
|
+
const hay = `${n.name}\n${n.body ?? ''}\n${(n.aliases || []).join(' ')}`.toLowerCase();
|
|
303
|
+
if (!hay.includes(text)) {
|
|
304
|
+
continue;
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
out.push(n);
|
|
308
|
+
}
|
|
309
|
+
// freshest first — recent verified facts are the most useful context
|
|
310
|
+
out.sort((a, b) => b.updatedAt.localeCompare(a.updatedAt));
|
|
311
|
+
return out.slice(0, limit);
|
|
312
|
+
}
|
|
313
|
+
/**
|
|
314
|
+
* Bounded neighbourhood around a node — the playbook's "context construction
|
|
315
|
+
* from a graph": resolve the entity, expand a hop or two over allowed edge
|
|
316
|
+
* types, and return a small, citable subgraph rather than the whole graph.
|
|
317
|
+
*/
|
|
318
|
+
neighbors(opts) {
|
|
319
|
+
this.reloadIfChanged();
|
|
320
|
+
const center = this.getNode(opts.idOrName);
|
|
321
|
+
if (!center) {
|
|
322
|
+
return null;
|
|
323
|
+
}
|
|
324
|
+
const hops = Math.max(1, Math.min(3, opts.hops ?? 1));
|
|
325
|
+
const edgeLimit = Math.max(1, Math.min(200, opts.limit ?? 40));
|
|
326
|
+
const allow = opts.edgeTypes && opts.edgeTypes.length
|
|
327
|
+
? new Set(opts.edgeTypes.map(e => e.toLowerCase())) : null;
|
|
328
|
+
const seen = new Set([center.id]);
|
|
329
|
+
const nodeOut = new Map([[center.id, center]]);
|
|
330
|
+
const edgeOut = [];
|
|
331
|
+
let frontier = [center.id];
|
|
332
|
+
for (let h = 0; h < hops && edgeOut.length < edgeLimit; h++) {
|
|
333
|
+
const next = [];
|
|
334
|
+
for (const e of this.edges.values()) {
|
|
335
|
+
if (allow && !allow.has(e.type)) {
|
|
336
|
+
continue;
|
|
337
|
+
}
|
|
338
|
+
const touchesFrontier = frontier.includes(e.from) || frontier.includes(e.to);
|
|
339
|
+
if (!touchesFrontier) {
|
|
340
|
+
continue;
|
|
341
|
+
}
|
|
342
|
+
if (!edgeOut.find(x => x.id === e.id)) {
|
|
343
|
+
edgeOut.push(e);
|
|
344
|
+
if (edgeOut.length >= edgeLimit) {
|
|
345
|
+
break;
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
for (const nid of [e.from, e.to]) {
|
|
349
|
+
if (!seen.has(nid)) {
|
|
350
|
+
seen.add(nid);
|
|
351
|
+
const nn = this.nodes.get(nid);
|
|
352
|
+
if (nn) {
|
|
353
|
+
nodeOut.set(nid, nn);
|
|
354
|
+
next.push(nid);
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
frontier = next;
|
|
360
|
+
if (!frontier.length) {
|
|
361
|
+
break;
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
return { center, nodes: [...nodeOut.values()], edges: edgeOut };
|
|
365
|
+
}
|
|
366
|
+
stats() {
|
|
367
|
+
this.reloadIfChanged();
|
|
368
|
+
const nodesByType = {};
|
|
369
|
+
const edgesByType = {};
|
|
370
|
+
let superseded = 0, openQuestions = 0;
|
|
371
|
+
const touched = new Set();
|
|
372
|
+
for (const e of this.edges.values()) {
|
|
373
|
+
edgesByType[e.type] = (edgesByType[e.type] || 0) + 1;
|
|
374
|
+
touched.add(e.from);
|
|
375
|
+
touched.add(e.to);
|
|
376
|
+
}
|
|
377
|
+
let isolated = 0;
|
|
378
|
+
for (const n of this.nodes.values()) {
|
|
379
|
+
nodesByType[n.type] = (nodesByType[n.type] || 0) + 1;
|
|
380
|
+
if (n.supersededBy) {
|
|
381
|
+
superseded++;
|
|
382
|
+
}
|
|
383
|
+
if (n.type === 'question' && !n.supersededBy) {
|
|
384
|
+
openQuestions++;
|
|
385
|
+
}
|
|
386
|
+
if (!touched.has(n.id) && !n.supersededBy) {
|
|
387
|
+
isolated++;
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
const contradictions = edgesByType['contradicts'] || 0;
|
|
391
|
+
return {
|
|
392
|
+
nodeCount: this.nodes.size, edgeCount: this.edges.size,
|
|
393
|
+
nodesByType, edgesByType, superseded, isolated, contradictions, openQuestions,
|
|
394
|
+
};
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
exports.GraphStore = GraphStore;
|
|
398
|
+
function mergeAliases(prev, add, prevName, newName) {
|
|
399
|
+
const set = new Set(prev || []);
|
|
400
|
+
for (const a of add || []) {
|
|
401
|
+
if (a && a.trim()) {
|
|
402
|
+
set.add(a.trim());
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
// if a node is re-added under a different display name, keep the old name as an alias
|
|
406
|
+
if (prevName && newName && prevName !== newName) {
|
|
407
|
+
set.add(prevName);
|
|
408
|
+
}
|
|
409
|
+
const arr = [...set];
|
|
410
|
+
return arr.length ? arr : undefined;
|
|
411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K,CAAC,IAAI;YACtD,WAAW,EAAE,WAAW,EAAE,UAAU,EAAE,QAAQ,EAAE,cAAc,EAAE,aAAa;SAC9E,CAAC;IACJ,CAAC;CACF;AAnQD,gCAmQC;AAED,SAAS,YAAY,CAAC,IAA0B,EAAE,GAAyB,EAAE,QAAiB,EAAE,OAAgB;IAC9G,MAAM,GAAG,GAAG,IAAI,GAAG,CAAS,IAAI,IAAI,EAAE,CAAC,CAAC;IACxC,KAAK,MAAM,CAAC,IAAI,GAAG,IAAI,EAAE,EAAE,CAAC;QAAC,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC;YAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;QAAC,CAAC;IAAC,CAAC;IACxE,sFAAsF;IACtF,IAAI,QAAQ,IAAI,OAAO,IAAI,QAAQ,KAAK,OAAO,EAAE,CAAC;QAAC,GAAG,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IAAC,CAAC;IACvE,MAAM,GAAG,GAAG,CAAC,GAAG,GAAG,CAAC,CAAC;IACrB,OAAO,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,CAAC;AACtC,CAAC"}
|
package/out/mcpInstallCheck.d.ts
CHANGED
|
@@ -5,7 +5,8 @@ export interface McpInstallInfo {
|
|
|
5
5
|
pkg?: string;
|
|
6
6
|
}
|
|
7
7
|
interface CheckTarget {
|
|
8
|
-
command
|
|
8
|
+
/** Remote (http/sse) MCP entries have no command — treated as status 'unknown'. */
|
|
9
|
+
command?: string;
|
|
9
10
|
args: string[];
|
|
10
11
|
}
|
|
11
12
|
export declare function invalidateMcpInstallCache(): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcpInstallCheck.js","sourceRoot":"","sources":["../src/mcpInstallCheck.ts"],"names":[],"mappings":";AAAA,8EAA8E;AAC9E,0EAA0E;AAC1E,uDAAuD;AACv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