@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,33 @@
|
|
|
1
|
+
import { observers } from '@evomap/evolver-core';
|
|
2
|
+
/** Markdown file sink: appends each weekly digest to <home>/evolution/value-digest.md (inspectable history). */
|
|
3
|
+
export declare function fileDigestSink(path: string): observers.DigestSink;
|
|
4
|
+
/** Terminal MOTD sink: prints the digest to stdout (the operator sees it on the next daemon tick). */
|
|
5
|
+
export declare function motdDigestSink(write?: (s: string) => void): observers.DigestSink;
|
|
6
|
+
/** Fan a digest out to several sinks; one sink throwing does not stop the others (the bus still isolates the
|
|
7
|
+
* observer as a whole, but a single bad sink should not starve a working one). */
|
|
8
|
+
export declare function multiSink(sinks: readonly observers.DigestSink[]): observers.DigestSink;
|
|
9
|
+
/** File-backed cadence state so "weekly" survives daemon restarts (the bus is in-process; a week is not). */
|
|
10
|
+
export declare class FileDigestState implements observers.DigestStateStore {
|
|
11
|
+
private readonly path;
|
|
12
|
+
constructor(path: string);
|
|
13
|
+
lastDeliveredAt(): number | undefined;
|
|
14
|
+
markDelivered(at: number): void;
|
|
15
|
+
}
|
|
16
|
+
export interface ValueDigestWiring {
|
|
17
|
+
/** EVOLVER_VALUE_DIGEST !== '0' (default ON). */
|
|
18
|
+
enabled: boolean;
|
|
19
|
+
/** The wired observer (null when disabled). */
|
|
20
|
+
observer: ReturnType<typeof observers.valueDigestObserver> | null;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Build the live value-digest observer from the environment, reading the SAME ledger material `evolver value`
|
|
24
|
+
* reads (proxy traces + root_events) priced with the adapter's table. Returns enabled=false (no observer) when
|
|
25
|
+
* EVOLVER_VALUE_DIGEST=0. The summaryProvider re-reads disk each tick so the digest reflects current state; the
|
|
26
|
+
* cadence + the measured-value gate (in the core observer) keep that cheap and quiet.
|
|
27
|
+
*/
|
|
28
|
+
export declare function resolveValueDigestObserver(env?: NodeJS.ProcessEnv, opts?: {
|
|
29
|
+
home?: string;
|
|
30
|
+
eventsPath?: string;
|
|
31
|
+
tracesDir?: string;
|
|
32
|
+
motd?: boolean;
|
|
33
|
+
}): ValueDigestWiring;
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
// Value digest composition (#113) — the CLI layer that turns the core `valueDigestObserver` into a LIVE
|
|
2
|
+
// notification. Core owns the observer logic + the gate; this composition layer owns the side-effecting pieces
|
|
3
|
+
// core must not: the concrete sinks (a local markdown file + a terminal MOTD), the file-backed cadence state,
|
|
4
|
+
// and the summary provider wired to the adapter's price table + the proxy traces + root_events on disk.
|
|
5
|
+
//
|
|
6
|
+
// Off by default for the MOTD (it prints to the operator's terminal); the file sink always writes (cheap, local,
|
|
7
|
+
// inspectable). EVOLVER_VALUE_DIGEST=0 disables the digest observer entirely (the退订 one-switch the issue asks
|
|
8
|
+
// for). The observer is hung off the SAME ObserverBus that fans out from the Ingestor, so a real run's events
|
|
9
|
+
// tick the cadence check — this is the bus's first live built-in observer.
|
|
10
|
+
import { appendFileSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs';
|
|
11
|
+
import { dirname, join } from 'node:path';
|
|
12
|
+
import { events, observers, ops } from '@evomap/evolver-core';
|
|
13
|
+
import { loadPriceTable } from '@evomap/evolver-adapter-public';
|
|
14
|
+
/** Markdown file sink: appends each weekly digest to <home>/evolution/value-digest.md (inspectable history). */
|
|
15
|
+
export function fileDigestSink(path) {
|
|
16
|
+
return {
|
|
17
|
+
name: 'file',
|
|
18
|
+
deliver(markdown, meta) {
|
|
19
|
+
mkdirSync(dirname(path), { recursive: true });
|
|
20
|
+
appendFileSync(path, `\n<!-- ${meta.at} -->\n${markdown}\n`, 'utf8');
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
/** Terminal MOTD sink: prints the digest to stdout (the operator sees it on the next daemon tick). */
|
|
25
|
+
export function motdDigestSink(write = (s) => process.stdout.write(s)) {
|
|
26
|
+
return { name: 'motd', deliver(markdown) { write(`\n${markdown}\n`); } };
|
|
27
|
+
}
|
|
28
|
+
/** Fan a digest out to several sinks; one sink throwing does not stop the others (the bus still isolates the
|
|
29
|
+
* observer as a whole, but a single bad sink should not starve a working one). */
|
|
30
|
+
export function multiSink(sinks) {
|
|
31
|
+
return {
|
|
32
|
+
name: sinks.map((s) => s.name).join('+') || 'none',
|
|
33
|
+
async deliver(markdown, meta) {
|
|
34
|
+
const errs = [];
|
|
35
|
+
for (const s of sinks) {
|
|
36
|
+
try {
|
|
37
|
+
await s.deliver(markdown, meta);
|
|
38
|
+
}
|
|
39
|
+
catch (e) {
|
|
40
|
+
errs.push(e);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
if (errs.length === sinks.length && errs.length > 0)
|
|
44
|
+
throw errs[0]; // all failed → surface to the bus DLQ
|
|
45
|
+
},
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
/** File-backed cadence state so "weekly" survives daemon restarts (the bus is in-process; a week is not). */
|
|
49
|
+
export class FileDigestState {
|
|
50
|
+
path;
|
|
51
|
+
constructor(path) {
|
|
52
|
+
this.path = path;
|
|
53
|
+
}
|
|
54
|
+
lastDeliveredAt() {
|
|
55
|
+
try {
|
|
56
|
+
const v = JSON.parse(readFileSync(this.path, 'utf8'));
|
|
57
|
+
return typeof v.lastDeliveredAt === 'number' ? v.lastDeliveredAt : undefined;
|
|
58
|
+
}
|
|
59
|
+
catch {
|
|
60
|
+
return undefined;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
markDelivered(at) {
|
|
64
|
+
mkdirSync(dirname(this.path), { recursive: true });
|
|
65
|
+
writeFileSync(this.path, JSON.stringify({ lastDeliveredAt: at }), 'utf8');
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Build the live value-digest observer from the environment, reading the SAME ledger material `evolver value`
|
|
70
|
+
* reads (proxy traces + root_events) priced with the adapter's table. Returns enabled=false (no observer) when
|
|
71
|
+
* EVOLVER_VALUE_DIGEST=0. The summaryProvider re-reads disk each tick so the digest reflects current state; the
|
|
72
|
+
* cadence + the measured-value gate (in the core observer) keep that cheap and quiet.
|
|
73
|
+
*/
|
|
74
|
+
export function resolveValueDigestObserver(env = process.env, opts = {}) {
|
|
75
|
+
if (env['EVOLVER_VALUE_DIGEST'] === '0')
|
|
76
|
+
return { enabled: false, observer: null };
|
|
77
|
+
const home = opts.home ?? events.evomapHome();
|
|
78
|
+
const eventsPath = opts.eventsPath ?? events.rootEventsPath();
|
|
79
|
+
const tracesDir = opts.tracesDir ?? events.tracesDir();
|
|
80
|
+
const prices = loadPriceTable();
|
|
81
|
+
const sinks = [fileDigestSink(join(home, 'evolution', 'value-digest.md'))];
|
|
82
|
+
if (opts.motd ?? env['EVOLVER_VALUE_DIGEST_MOTD'] === '1')
|
|
83
|
+
sinks.push(motdDigestSink());
|
|
84
|
+
const observer = observers.valueDigestObserver({
|
|
85
|
+
summaryProvider: (window) => ops.loadValueSummary({
|
|
86
|
+
traces: ops.readTraceRecords(tracesDir),
|
|
87
|
+
events: events.readEvents(eventsPath),
|
|
88
|
+
prices,
|
|
89
|
+
}, window),
|
|
90
|
+
sink: multiSink(sinks),
|
|
91
|
+
state: new FileDigestState(join(home, 'evolution', 'value-digest-state.json')),
|
|
92
|
+
});
|
|
93
|
+
return { enabled: true, observer };
|
|
94
|
+
}
|
package/dist/version.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { dirname } from 'node:path';
|
|
2
|
+
import { fileURLToPath } from 'node:url';
|
|
3
|
+
import { util } from '@evomap/evolver-core';
|
|
4
|
+
function isEvolverCliPackage(pkg) {
|
|
5
|
+
return pkg.name === '@evomap/evolver-cli'
|
|
6
|
+
|| (typeof pkg.bin === 'object' && typeof pkg.bin['evolver'] === 'string');
|
|
7
|
+
}
|
|
8
|
+
/** Resolve the installed evolver CLI version from the nearest package metadata. */
|
|
9
|
+
export function getCliVersion() {
|
|
10
|
+
return util.resolveRuntimeVersion({
|
|
11
|
+
startDir: dirname(fileURLToPath(import.meta.url)),
|
|
12
|
+
isPackage: isEvolverCliPackage,
|
|
13
|
+
});
|
|
14
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@evomap/evolver-cli",
|
|
3
|
+
"version": "2.0.0-beta.0",
|
|
4
|
+
"private": false,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"description": "evolver CLI (status/watch/cycles/rebuild-views/...)",
|
|
7
|
+
"bin": {
|
|
8
|
+
"evolver": "./dist/cli.js"
|
|
9
|
+
},
|
|
10
|
+
"main": "./dist/index.js",
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"exports": {
|
|
13
|
+
".": {
|
|
14
|
+
"types": "./dist/index.d.ts",
|
|
15
|
+
"default": "./dist/index.js"
|
|
16
|
+
},
|
|
17
|
+
"./dispatch": {
|
|
18
|
+
"types": "./dist/dispatch.d.ts",
|
|
19
|
+
"default": "./dist/dispatch.js"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"dependencies": {
|
|
23
|
+
"@evomap/evolver-core": "2.0.0-beta.0",
|
|
24
|
+
"@evomap/evolver-adapter-public": "2.0.0-beta.0",
|
|
25
|
+
"@evomap/evolver-mcp": "2.0.0-beta.0",
|
|
26
|
+
"@evomap/evolver-proxy": "2.0.0-beta.0",
|
|
27
|
+
"@evomap/evolver-runtime-adapters": "2.0.0-beta.0"
|
|
28
|
+
},
|
|
29
|
+
"publishConfig": {
|
|
30
|
+
"access": "public",
|
|
31
|
+
"tag": "v2-beta"
|
|
32
|
+
},
|
|
33
|
+
"files": [
|
|
34
|
+
"dist/",
|
|
35
|
+
"README.md",
|
|
36
|
+
"package.json"
|
|
37
|
+
]
|
|
38
|
+
}
|