@evomap/evolver-cli 2.0.0-beta.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/dist/antiGeneBenchmark.d.ts +9 -0
- package/dist/antiGeneBenchmark.js +173 -0
- package/dist/antiGeneRollout.d.ts +14 -0
- package/dist/antiGeneRollout.js +276 -0
- package/dist/atp.d.ts +122 -0
- package/dist/atp.js +413 -0
- package/dist/atpAutoDeliver.d.ts +53 -0
- package/dist/atpAutoDeliver.js +197 -0
- package/dist/atpAutobuyPrompt.d.ts +48 -0
- package/dist/atpAutobuyPrompt.js +109 -0
- package/dist/autoDistillAntiGene.d.ts +63 -0
- package/dist/autoDistillAntiGene.js +396 -0
- package/dist/autoDistillLlm.d.ts +94 -0
- package/dist/autoDistillLlm.js +510 -0
- package/dist/autoDistillTranscript.d.ts +87 -0
- package/dist/autoDistillTranscript.js +364 -0
- package/dist/autoRecall.d.ts +25 -0
- package/dist/autoRecall.js +80 -0
- package/dist/autoexec.d.ts +237 -0
- package/dist/autoexec.js +1041 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +7 -0
- package/dist/cliContracts.d.ts +72 -0
- package/dist/cliContracts.js +815 -0
- package/dist/commands.d.ts +9 -0
- package/dist/commands.js +10 -0
- package/dist/cursorRewrite.d.ts +42 -0
- package/dist/cursorRewrite.js +65 -0
- package/dist/cycleConsumer.d.ts +42 -0
- package/dist/cycleConsumer.js +519 -0
- package/dist/daemonLoop.d.ts +33 -0
- package/dist/daemonLoop.js +72 -0
- package/dist/dispatch.d.ts +10 -0
- package/dist/dispatch.js +75 -0
- package/dist/distillObserver.d.ts +33 -0
- package/dist/distillObserver.js +146 -0
- package/dist/distillPrimitives.d.ts +48 -0
- package/dist/distillPrimitives.js +142 -0
- package/dist/doctor.d.ts +54 -0
- package/dist/doctor.js +931 -0
- package/dist/geneValue.d.ts +37 -0
- package/dist/geneValue.js +97 -0
- package/dist/index.d.ts +193 -0
- package/dist/index.js +1135 -0
- package/dist/lifecycle.d.ts +75 -0
- package/dist/lifecycle.js +859 -0
- package/dist/login.d.ts +10 -0
- package/dist/login.js +38 -0
- package/dist/migrate/divergenceAudit.d.ts +29 -0
- package/dist/migrate/divergenceAudit.js +37 -0
- package/dist/migrate/fieldMap.d.ts +18 -0
- package/dist/migrate/fieldMap.js +68 -0
- package/dist/migrate/v1Import.d.ts +16 -0
- package/dist/migrate/v1Import.js +118 -0
- package/dist/phub.d.ts +18 -0
- package/dist/phub.js +284 -0
- package/dist/recall.d.ts +26 -0
- package/dist/recall.js +162 -0
- package/dist/recipe.d.ts +61 -0
- package/dist/recipe.js +564 -0
- package/dist/reflectionObserver.d.ts +8 -0
- package/dist/reflectionObserver.js +6 -0
- package/dist/reuse.d.ts +48 -0
- package/dist/reuse.js +300 -0
- package/dist/reuseReport.d.ts +20 -0
- package/dist/reuseReport.js +255 -0
- package/dist/reviewFilter.d.ts +4 -0
- package/dist/reviewFilter.js +6 -0
- package/dist/runtimeSessionSource.d.ts +9 -0
- package/dist/runtimeSessionSource.js +29 -0
- package/dist/setupHooks.d.ts +2 -0
- package/dist/setupHooks.js +410 -0
- package/dist/skill2gep.d.ts +144 -0
- package/dist/skill2gep.js +321 -0
- package/dist/skillDistill.d.ts +75 -0
- package/dist/skillDistill.js +342 -0
- package/dist/solo/breaker.d.ts +14 -0
- package/dist/solo/breaker.js +21 -0
- package/dist/solo/gitGuard.d.ts +17 -0
- package/dist/solo/gitGuard.js +62 -0
- package/dist/solo/mode.d.ts +12 -0
- package/dist/solo/mode.js +55 -0
- package/dist/thesis.d.ts +43 -0
- package/dist/thesis.js +179 -0
- package/dist/trajectoryExport.d.ts +1 -0
- package/dist/trajectoryExport.js +895 -0
- package/dist/valueDigest.d.ts +33 -0
- package/dist/valueDigest.js +94 -0
- package/dist/version.d.ts +2 -0
- package/dist/version.js +14 -0
- package/package.json +38 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { events } from '@evomap/evolver-core';
|
|
2
|
+
export declare const readEvents: typeof events.readEvents;
|
|
3
|
+
export declare const statusReport: typeof events.statusReport;
|
|
4
|
+
export declare const listCycles: typeof events.listCycles;
|
|
5
|
+
export declare const showCycle: typeof events.showCycle;
|
|
6
|
+
export declare const listTriggers: typeof events.listTriggers;
|
|
7
|
+
export declare const dailySummary: typeof events.dailySummary;
|
|
8
|
+
export declare const buildNarrativeSnapshot: typeof events.buildNarrativeSnapshot;
|
|
9
|
+
export declare const buildRetentionReport: typeof events.buildRetentionReport;
|
package/dist/commands.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// 报表函数单一来源已移到 @evomap/evolver-core(events/reports). 此处经顶层 events 命名空间 re-export 供 CLI 用.
|
|
2
|
+
import { events } from '@evomap/evolver-core';
|
|
3
|
+
export const readEvents = events.readEvents;
|
|
4
|
+
export const statusReport = events.statusReport;
|
|
5
|
+
export const listCycles = events.listCycles;
|
|
6
|
+
export const showCycle = events.showCycle;
|
|
7
|
+
export const listTriggers = events.listTriggers;
|
|
8
|
+
export const dailySummary = events.dailySummary;
|
|
9
|
+
export const buildNarrativeSnapshot = events.buildNarrativeSnapshot;
|
|
10
|
+
export const buildRetentionReport = events.buildRetentionReport;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { assetstore, observers } from '@evomap/evolver-core';
|
|
2
|
+
import { formatCursorGeneLine, type CursorGene } from '@evomap/evolver-mcp';
|
|
3
|
+
/**
|
|
4
|
+
* Map a stored gene asset onto the renderer's minimal CursorGene shape. Mirrors the CC SessionStart line voice
|
|
5
|
+
* (id + category + a short hint = summary, else the first few signals_match) so cursor users see the same memory
|
|
6
|
+
* the CC SessionStart hook would inject. Deterministic.
|
|
7
|
+
*/
|
|
8
|
+
export declare function geneToCursorGene(g: assetstore.AssetRecord): CursorGene;
|
|
9
|
+
export interface CursorRewriteWiring {
|
|
10
|
+
/** EVOLVER_CURSOR_REWRITE !== '0' AND cursor injection is installed at the project root (default ON when both). */
|
|
11
|
+
enabled: boolean;
|
|
12
|
+
/** Why it is disabled (for the daemon's startup line): 'off' (env) | 'not-installed' | undefined when enabled. */
|
|
13
|
+
reason?: 'off' | 'not-installed';
|
|
14
|
+
/** The wired observer (null when disabled). */
|
|
15
|
+
observer: ReturnType<typeof observers.cursorRewriteObserver> | null;
|
|
16
|
+
}
|
|
17
|
+
export interface CursorRewriteOptions {
|
|
18
|
+
/** Project root that holds .cursor/rules/evolver.mdc. Default cwd (the daemon runs at the repo root). */
|
|
19
|
+
projectRoot?: string;
|
|
20
|
+
/** The asset store to read the gene pool from. Default the live ~/.evomap assets dir. */
|
|
21
|
+
store?: assetstore.AssetStoreProvider;
|
|
22
|
+
/** Review gate — withholds quarantined/rejected drafts from the rendered rules (A2a). Default the live ledger. */
|
|
23
|
+
review?: assetstore.ReviewLedger;
|
|
24
|
+
/** Provenance gate — withholds untrusted hub assets from rendered rules until promotion. */
|
|
25
|
+
provenance?: assetstore.ProvenanceStore;
|
|
26
|
+
/** Max genes rendered into the always-on body (token-tax bound). Default the installer's default (8). */
|
|
27
|
+
maxGenes?: number;
|
|
28
|
+
/** Debounce window (a cycle's burst of gene events ⇒ one rewrite). Default the observer's default (2s). */
|
|
29
|
+
debounceMs?: number;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Build the live cursor rewrite observer from the environment. Returns enabled=false (no observer) when
|
|
33
|
+
* EVOLVER_CURSOR_REWRITE=0 OR cursor injection is not installed at `projectRoot` (the user never opted in). When
|
|
34
|
+
* enabled, the injected `rewrite` callback reads the current top genes from the store and re-renders
|
|
35
|
+
* .cursor/rules/evolver.mdc; the installer's own idempotency makes an unchanged gene set a true no-op (no write).
|
|
36
|
+
*/
|
|
37
|
+
export declare function resolveCursorRewriteObserver(env?: NodeJS.ProcessEnv, opts?: CursorRewriteOptions): CursorRewriteWiring;
|
|
38
|
+
/** Re-export for the installer composition: `setup-hooks --runtime=cursor` seeds evolver.mdc with the current
|
|
39
|
+
* top REVIEW-APPROVED genes (so the file is useful immediately, before the first daemon rewrite — without
|
|
40
|
+
* seeding an unapproved draft into the always-on rules, same gate as the live rewrite). */
|
|
41
|
+
export declare function currentTopCursorGenes(store: assetstore.AssetStoreProvider, review: assetstore.ReviewLedger, maxGenes?: number, provenance?: assetstore.ProvenanceStore): Promise<CursorGene[]>;
|
|
42
|
+
export { formatCursorGeneLine };
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
// Cursor rewrite composition (#124) — the CLI layer that turns the core `cursorRewriteObserver` into a LIVE
|
|
2
|
+
// rewrite of `.cursor/rules/evolver.mdc`. Core owns the trigger policy (which events count + debounce); this
|
|
3
|
+
// layer owns the side effects core must not: reading the gene pool from the asset store and rendering+writing
|
|
4
|
+
// the cursor rules file via the cursorRulesInstaller.
|
|
5
|
+
//
|
|
6
|
+
// It is hung off the SAME ObserverBus that fans out from the daemon's Ingestor (autoexec.ts), exactly like the
|
|
7
|
+
// value-digest observer — so a real cycle solidifying a gene re-renders the cursor rules file. This is the
|
|
8
|
+
// cursor analogue of CC's SessionStart hook: cursor has no pull-at-start, so freshness is rewrite-on-change.
|
|
9
|
+
//
|
|
10
|
+
// Two gates keep it safe and quiet:
|
|
11
|
+
// 1. opt-in: it only maintains the file when the user actually installed cursor injection
|
|
12
|
+
// (`evolver setup-hooks --runtime=cursor` wrote a managed evolver.mdc). No install ⇒ the observer is not
|
|
13
|
+
// registered, so a non-cursor user pays nothing.
|
|
14
|
+
// 2. one-switch off: EVOLVER_CURSOR_REWRITE=0 disables it even when installed.
|
|
15
|
+
import { assetstore, events, observers } from '@evomap/evolver-core';
|
|
16
|
+
import { cursorRulesInstalled, rewriteCursorRules, formatCursorGeneLine } from '@evomap/evolver-mcp';
|
|
17
|
+
import { listApprovedGenes, provenanceStoreForStore, reviewLedgerForStore } from './reviewFilter.js';
|
|
18
|
+
/**
|
|
19
|
+
* Map a stored gene asset onto the renderer's minimal CursorGene shape. Mirrors the CC SessionStart line voice
|
|
20
|
+
* (id + category + a short hint = summary, else the first few signals_match) so cursor users see the same memory
|
|
21
|
+
* the CC SessionStart hook would inject. Deterministic.
|
|
22
|
+
*/
|
|
23
|
+
export function geneToCursorGene(g) {
|
|
24
|
+
const id = typeof g['id'] === 'string' ? String(g['id']) : String(g.asset_id);
|
|
25
|
+
const summary = String(g['summary'] ?? '').replace(/\s+/g, ' ').trim();
|
|
26
|
+
const hint = summary || (Array.isArray(g['signals_match']) ? g['signals_match'].slice(0, 4).join(', ') : '');
|
|
27
|
+
const category = g['category'] ? String(g['category']) : undefined;
|
|
28
|
+
return { id, ...(category ? { category } : {}), ...(hint ? { hint } : {}) };
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Build the live cursor rewrite observer from the environment. Returns enabled=false (no observer) when
|
|
32
|
+
* EVOLVER_CURSOR_REWRITE=0 OR cursor injection is not installed at `projectRoot` (the user never opted in). When
|
|
33
|
+
* enabled, the injected `rewrite` callback reads the current top genes from the store and re-renders
|
|
34
|
+
* .cursor/rules/evolver.mdc; the installer's own idempotency makes an unchanged gene set a true no-op (no write).
|
|
35
|
+
*/
|
|
36
|
+
export function resolveCursorRewriteObserver(env = process.env, opts = {}) {
|
|
37
|
+
if (env['EVOLVER_CURSOR_REWRITE'] === '0')
|
|
38
|
+
return { enabled: false, reason: 'off', observer: null };
|
|
39
|
+
const projectRoot = opts.projectRoot ?? process.cwd();
|
|
40
|
+
// Opt-in gate: only maintain the file the user installed. cursorRulesInstalled is a cheap lstat+read of one file.
|
|
41
|
+
if (!cursorRulesInstalled(projectRoot))
|
|
42
|
+
return { enabled: false, reason: 'not-installed', observer: null };
|
|
43
|
+
const store = opts.store ?? new assetstore.LocalJsonlProvider(events.assetsDir());
|
|
44
|
+
const review = opts.review ?? reviewLedgerForStore(store); // co-located with the store, not pinned to live dir
|
|
45
|
+
const provenance = opts.provenance ?? provenanceStoreForStore(store); // co-located with the store, not pinned to live dir
|
|
46
|
+
const maxGenes = opts.maxGenes ?? 8;
|
|
47
|
+
const observer = observers.cursorRewriteObserver({
|
|
48
|
+
...(opts.debounceMs !== undefined ? { debounceMs: opts.debounceMs } : {}),
|
|
49
|
+
// The real side effect: read the current top TRUSTED + REVIEW-APPROVED genes and re-render the rules file.
|
|
50
|
+
// The gates are essential here: the observer fires on hub reuse and `gene.distilled`, so without them unsafe
|
|
51
|
+
// drafts could be rendered straight into cursor's alwaysApply rules.
|
|
52
|
+
async rewrite() {
|
|
53
|
+
const genes = (await listApprovedGenes(store, review, maxGenes, provenance)).map(geneToCursorGene);
|
|
54
|
+
return rewriteCursorRules(projectRoot, genes, maxGenes);
|
|
55
|
+
},
|
|
56
|
+
});
|
|
57
|
+
return { enabled: true, observer };
|
|
58
|
+
}
|
|
59
|
+
/** Re-export for the installer composition: `setup-hooks --runtime=cursor` seeds evolver.mdc with the current
|
|
60
|
+
* top REVIEW-APPROVED genes (so the file is useful immediately, before the first daemon rewrite — without
|
|
61
|
+
* seeding an unapproved draft into the always-on rules, same gate as the live rewrite). */
|
|
62
|
+
export async function currentTopCursorGenes(store, review, maxGenes = 8, provenance = provenanceStoreForStore(store)) {
|
|
63
|
+
return (await listApprovedGenes(store, review, maxGenes, provenance)).map(geneToCursorGene);
|
|
64
|
+
}
|
|
65
|
+
export { formatCursorGeneLine };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { assetstore, algo, events, exec, material as materialNs, personality } from '@evomap/evolver-core';
|
|
2
|
+
type RunnerName = NonNullable<exec.AutonomousSafety['runner']>;
|
|
3
|
+
type MaterialCycleAction = 'cycle' | 'observe' | 'skip' | 'fail';
|
|
4
|
+
type MaterialCycleStatus = exec.AutoExecVerdict['status'] | 'observed' | 'already_consumed' | 'already_terminal' | 'already_running' | 'no_signals' | 'parse_failed' | 'pending';
|
|
5
|
+
interface MaterialCycleItem {
|
|
6
|
+
materialId: string;
|
|
7
|
+
action: MaterialCycleAction;
|
|
8
|
+
status: MaterialCycleStatus;
|
|
9
|
+
cycleId?: string;
|
|
10
|
+
reason?: string;
|
|
11
|
+
}
|
|
12
|
+
export interface MaterialCycleResult {
|
|
13
|
+
claimed: number;
|
|
14
|
+
processed: number;
|
|
15
|
+
items: MaterialCycleItem[];
|
|
16
|
+
}
|
|
17
|
+
export interface MaterialCycleOptions {
|
|
18
|
+
repo: string;
|
|
19
|
+
limit?: number;
|
|
20
|
+
target?: string;
|
|
21
|
+
expectedEffect?: string;
|
|
22
|
+
runner?: RunnerName;
|
|
23
|
+
timeoutMs?: number;
|
|
24
|
+
safety?: Partial<exec.AutonomousSafety>;
|
|
25
|
+
agent?: exec.AgentRunner;
|
|
26
|
+
git?: exec.GitRunner;
|
|
27
|
+
}
|
|
28
|
+
export interface MaterialCycleDeps {
|
|
29
|
+
materialStore?: materialNs.MaterialStore;
|
|
30
|
+
consumer?: materialNs.ConsumerGroups;
|
|
31
|
+
store?: assetstore.AssetStoreProvider;
|
|
32
|
+
provenance?: assetstore.ProvenanceStore;
|
|
33
|
+
review?: assetstore.ReviewLedger;
|
|
34
|
+
ingestor?: events.Ingestor;
|
|
35
|
+
engine?: algo.CycleEngine;
|
|
36
|
+
personality?: personality.PersonalityStore;
|
|
37
|
+
}
|
|
38
|
+
export declare function cycleIdForMaterial(materialId: string): string;
|
|
39
|
+
export declare function cycleLockPathForMaterial(materialStorePath: string, materialId: string): string;
|
|
40
|
+
export declare function runMaterialCycleConsumer(opts: MaterialCycleOptions, injectedDeps?: MaterialCycleDeps): Promise<MaterialCycleResult>;
|
|
41
|
+
export declare function runCycleCommand(argv: readonly string[], injectedDeps?: MaterialCycleDeps): Promise<number>;
|
|
42
|
+
export {};
|