@seanhogg/builderforce-memory 2026.6.28 → 2026.6.30

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.
Files changed (47) hide show
  1. package/README.md +28 -0
  2. package/dist/diagnostics/index.d.ts +7 -0
  3. package/dist/diagnostics/index.d.ts.map +1 -0
  4. package/dist/diagnostics/index.js +6 -0
  5. package/dist/diagnostics/index.js.map +1 -0
  6. package/dist/diagnostics/stack-diagnostic.d.ts +71 -0
  7. package/dist/diagnostics/stack-diagnostic.d.ts.map +1 -0
  8. package/dist/diagnostics/stack-diagnostic.js +43 -0
  9. package/dist/diagnostics/stack-diagnostic.js.map +1 -0
  10. package/dist/index.d.ts +4 -0
  11. package/dist/index.d.ts.map +1 -1
  12. package/dist/index.js +4 -0
  13. package/dist/index.js.map +1 -1
  14. package/dist/workflow/index.d.ts +11 -0
  15. package/dist/workflow/index.d.ts.map +1 -0
  16. package/dist/workflow/index.js +10 -0
  17. package/dist/workflow/index.js.map +1 -0
  18. package/dist/workflow/registry.d.ts +23 -0
  19. package/dist/workflow/registry.d.ts.map +1 -0
  20. package/dist/workflow/registry.js +47 -0
  21. package/dist/workflow/registry.js.map +1 -0
  22. package/dist/workflow/run.d.ts +26 -0
  23. package/dist/workflow/run.d.ts.map +1 -0
  24. package/dist/workflow/run.js +40 -0
  25. package/dist/workflow/run.js.map +1 -0
  26. package/dist/workflow/steps.d.ts +19 -0
  27. package/dist/workflow/steps.d.ts.map +1 -0
  28. package/dist/workflow/steps.js +318 -0
  29. package/dist/workflow/steps.js.map +1 -0
  30. package/dist/workflow/templates.d.ts +24 -0
  31. package/dist/workflow/templates.d.ts.map +1 -0
  32. package/dist/workflow/templates.js +80 -0
  33. package/dist/workflow/templates.js.map +1 -0
  34. package/dist/workflow/types.d.ts +38 -0
  35. package/dist/workflow/types.d.ts.map +1 -0
  36. package/dist/workflow/types.js +11 -0
  37. package/dist/workflow/types.js.map +1 -0
  38. package/package.json +7 -5
  39. package/src/diagnostics/index.ts +14 -0
  40. package/src/diagnostics/stack-diagnostic.ts +103 -0
  41. package/src/index.ts +36 -0
  42. package/src/workflow/index.ts +24 -0
  43. package/src/workflow/registry.ts +55 -0
  44. package/src/workflow/run.ts +58 -0
  45. package/src/workflow/steps.ts +325 -0
  46. package/src/workflow/templates.ts +87 -0
  47. package/src/workflow/types.ts +42 -0
package/README.md CHANGED
@@ -35,6 +35,34 @@ The layered stack:
35
35
  | Online distillation | ✅ |
36
36
  | Persistent semantic memory | ✅ |
37
37
  | Agent workflows | ✅ |
38
+ | Create-an-LLM pipeline + diagnostics | ✅ |
39
+
40
+ ---
41
+
42
+ ## Create an LLM (workflow + diagnostics)
43
+
44
+ The `TRAIN_LLM` workflow trains a custom `EvermindLM` on **any** corpus and packages
45
+ it as a portable `.evermind` artifact — domain-agnostic (resume tailoring, support
46
+ replies, code, prose). Every run is gated by built-in diagnostics so a broken model
47
+ never ships:
48
+
49
+ ```ts
50
+ import { runWorkflow, TRAIN_LLM } from '@seanhogg/builderforce-memory';
51
+
52
+ const r = await runWorkflow(TRAIN_LLM); // or cloneTemplate('train-llm', { steps: [...] })
53
+ const artifact = r.artifacts.evermind; // ArrayBuffer → ship + serve
54
+ ```
55
+
56
+ Generic build step types (compose your own pipeline via the step registry):
57
+
58
+ | Step | What it validates |
59
+ |------|-------------------|
60
+ | `train-tokenizer` | Learns a BPE vocab from your corpus |
61
+ | `dataset-quality` | Gates corpus size / sequence count / duplicate ratio **before** spending epochs |
62
+ | `train-model` | Trains the `EvermindLM` (exposes the loss curve on `ctx.bag.trainingHistory`) |
63
+ | `convergence` | Asserts training loss actually decreased (the model learned) |
64
+ | `evaluate` / `generate-check` | Output is non-empty **and** seed-reproducible |
65
+ | `roundtrip` | Packages the trained model → loads → generates; served output must match trained |
38
66
 
39
67
  ---
40
68
 
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Diagnostics — the generic workflow runner + execution-output types.
3
+ * The configurable workflow / template layer lives in `../workflow/`.
4
+ */
5
+ export { runStackDiagnostic } from "./stack-diagnostic.js";
6
+ export type { StackStep, StackStepResult, StackContext, StackDiagnosticResult, RunStackOptions, StepStatus, } from "./stack-diagnostic.js";
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/diagnostics/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,YAAY,EACV,SAAS,EACT,eAAe,EACf,YAAY,EACZ,qBAAqB,EACrB,eAAe,EACf,UAAU,GACX,MAAM,uBAAuB,CAAC"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Diagnostics — the generic workflow runner + execution-output types.
3
+ * The configurable workflow / template layer lives in `../workflow/`.
4
+ */
5
+ export { runStackDiagnostic } from "./stack-diagnostic.js";
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/diagnostics/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC"}
@@ -0,0 +1,71 @@
1
+ /**
2
+ * stack-diagnostic.ts — the generic workflow runner + execution-output types.
3
+ *
4
+ * A workflow is an ordered list of {@link StackStep}s. `runStackDiagnostic`
5
+ * executes them, capturing per-step pass/fail + timing + error and streaming a
6
+ * callback — so the result is an "execution output" timeline a UI renders: run a
7
+ * workflow, watch each step, see exactly which one breaks.
8
+ *
9
+ * The concrete steps (the 7 agent-stack layers, the LLM-creation pipeline) and
10
+ * the configurable workflow/template layer live in `../workflow/` and compile
11
+ * down to `StackStep[]` runnable here. Steps share a {@link StackContext}: `bag`
12
+ * is scratch threaded across steps; `artifacts` is the workflow's OUTPUT (e.g. a
13
+ * trained `.evermind` blob).
14
+ */
15
+ export type StepStatus = "pass" | "fail" | "skip";
16
+ /** One step's result — the shape an execution-output timeline renders per row. */
17
+ export interface StackStepResult {
18
+ id: string;
19
+ /** Grouping tag, e.g. "L1".."L7" for the agent-stack layers, or "BUILD". */
20
+ layer: string;
21
+ label: string;
22
+ status: StepStatus;
23
+ ms: number;
24
+ /** Short human detail on success (e.g. "retrieved 3 chunks"). */
25
+ detail?: string;
26
+ /** Failure message when status === "fail". */
27
+ error?: string;
28
+ }
29
+ /** Shared state threaded across steps. */
30
+ export interface StackContext {
31
+ /** Scratch populated/consumed by steps (e.g. the model L1 builds, L7 deploys). */
32
+ bag: Record<string, unknown>;
33
+ /** Workflow OUTPUTS — what the run produces (e.g. `artifacts.evermind` = blob). */
34
+ artifacts: Record<string, unknown>;
35
+ /** Prior step results so far — this IS the observability trace. */
36
+ trace: StackStepResult[];
37
+ /** Optional IDBFactory (Node/fake-indexeddb); browser uses global indexedDB. */
38
+ idbFactory?: unknown;
39
+ now: () => number;
40
+ }
41
+ export interface StackStep {
42
+ id: string;
43
+ layer: string;
44
+ label: string;
45
+ /** Throw to fail the step; optionally return a human detail string. */
46
+ run: (ctx: StackContext) => Promise<string | void>;
47
+ }
48
+ export interface RunStackOptions {
49
+ /** Streamed as each step settles — for live execution-output rendering. */
50
+ onStep?: (r: StackStepResult) => void;
51
+ /** Injectable clock for deterministic timing in tests. Default Date.now. */
52
+ now?: () => number;
53
+ /** IDBFactory for Node; omit in the browser. */
54
+ idbFactory?: unknown;
55
+ }
56
+ export interface StackDiagnosticResult {
57
+ ok: boolean;
58
+ steps: StackStepResult[];
59
+ /** The first step that failed (the breaking point), if any. */
60
+ firstFailure?: StackStepResult;
61
+ /** Outputs produced by the run (e.g. `artifacts.evermind` for a build workflow). */
62
+ artifacts: Record<string, unknown>;
63
+ totalMs: number;
64
+ }
65
+ /**
66
+ * Run the steps in order, capturing each result. Never throws — a step that
67
+ * throws becomes a `fail` row, and the run continues so the caller sees the full
68
+ * timeline (and exactly where it broke). Pass `onStep` to stream rows live.
69
+ */
70
+ export declare function runStackDiagnostic(steps: StackStep[], opts?: RunStackOptions): Promise<StackDiagnosticResult>;
71
+ //# sourceMappingURL=stack-diagnostic.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stack-diagnostic.d.ts","sourceRoot":"","sources":["../../src/diagnostics/stack-diagnostic.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;AAElD,kFAAkF;AAClF,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,4EAA4E;IAC5E,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,UAAU,CAAC;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,iEAAiE;IACjE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,8CAA8C;IAC9C,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,0CAA0C;AAC1C,MAAM,WAAW,YAAY;IAC3B,kFAAkF;IAClF,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC7B,mFAAmF;IACnF,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnC,mEAAmE;IACnE,KAAK,EAAE,eAAe,EAAE,CAAC;IACzB,gFAAgF;IAChF,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,GAAG,EAAE,MAAM,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,uEAAuE;IACvE,GAAG,EAAE,CAAC,GAAG,EAAE,YAAY,KAAK,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;CACpD;AAED,MAAM,WAAW,eAAe;IAC9B,2EAA2E;IAC3E,MAAM,CAAC,EAAE,CAAC,CAAC,EAAE,eAAe,KAAK,IAAI,CAAC;IACtC,4EAA4E;IAC5E,GAAG,CAAC,EAAE,MAAM,MAAM,CAAC;IACnB,gDAAgD;IAChD,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,WAAW,qBAAqB;IACpC,EAAE,EAAE,OAAO,CAAC;IACZ,KAAK,EAAE,eAAe,EAAE,CAAC;IACzB,+DAA+D;IAC/D,YAAY,CAAC,EAAE,eAAe,CAAC;IAC/B,oFAAoF;IACpF,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnC,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;;;GAIG;AACH,wBAAsB,kBAAkB,CACtC,KAAK,EAAE,SAAS,EAAE,EAClB,IAAI,GAAE,eAAoB,GACzB,OAAO,CAAC,qBAAqB,CAAC,CAuBhC"}
@@ -0,0 +1,43 @@
1
+ /**
2
+ * stack-diagnostic.ts — the generic workflow runner + execution-output types.
3
+ *
4
+ * A workflow is an ordered list of {@link StackStep}s. `runStackDiagnostic`
5
+ * executes them, capturing per-step pass/fail + timing + error and streaming a
6
+ * callback — so the result is an "execution output" timeline a UI renders: run a
7
+ * workflow, watch each step, see exactly which one breaks.
8
+ *
9
+ * The concrete steps (the 7 agent-stack layers, the LLM-creation pipeline) and
10
+ * the configurable workflow/template layer live in `../workflow/` and compile
11
+ * down to `StackStep[]` runnable here. Steps share a {@link StackContext}: `bag`
12
+ * is scratch threaded across steps; `artifacts` is the workflow's OUTPUT (e.g. a
13
+ * trained `.evermind` blob).
14
+ */
15
+ /**
16
+ * Run the steps in order, capturing each result. Never throws — a step that
17
+ * throws becomes a `fail` row, and the run continues so the caller sees the full
18
+ * timeline (and exactly where it broke). Pass `onStep` to stream rows live.
19
+ */
20
+ export async function runStackDiagnostic(steps, opts = {}) {
21
+ const now = opts.now ?? (() => Date.now());
22
+ const ctx = { bag: {}, artifacts: {}, trace: [], idbFactory: opts.idbFactory, now };
23
+ const results = [];
24
+ let firstFailure;
25
+ const start = now();
26
+ for (const step of steps) {
27
+ const t0 = now();
28
+ let result;
29
+ try {
30
+ const detail = await step.run(ctx);
31
+ result = { id: step.id, layer: step.layer, label: step.label, status: "pass", ms: now() - t0, ...(detail ? { detail } : {}) };
32
+ }
33
+ catch (e) {
34
+ result = { id: step.id, layer: step.layer, label: step.label, status: "fail", ms: now() - t0, error: e instanceof Error ? e.message : String(e) };
35
+ firstFailure ??= result;
36
+ }
37
+ results.push(result);
38
+ ctx.trace.push(result);
39
+ opts.onStep?.(result);
40
+ }
41
+ return { ok: !firstFailure, steps: results, ...(firstFailure ? { firstFailure } : {}), artifacts: ctx.artifacts, totalMs: now() - start };
42
+ }
43
+ //# sourceMappingURL=stack-diagnostic.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stack-diagnostic.js","sourceRoot":"","sources":["../../src/diagnostics/stack-diagnostic.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AA0DH;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACtC,KAAkB,EAClB,OAAwB,EAAE;IAE1B,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC;IAC3C,MAAM,GAAG,GAAiB,EAAE,GAAG,EAAE,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,UAAU,EAAE,IAAI,CAAC,UAAU,EAAE,GAAG,EAAE,CAAC;IAClG,MAAM,OAAO,GAAsB,EAAE,CAAC;IACtC,IAAI,YAAyC,CAAC;IAC9C,MAAM,KAAK,GAAG,GAAG,EAAE,CAAC;IAEpB,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,MAAM,EAAE,GAAG,GAAG,EAAE,CAAC;QACjB,IAAI,MAAuB,CAAC;QAC5B,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,GAAG,CAAC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emoryEntry, MemoryStoreOptions, RememberOptions, FactType, } from './memory/MemoryStore.js';
58
58
  export { EvermindCognition, workspacePresenceGatherer } from './cognition/index.js';
59
59
  export type { EvermindCognitionOptions, WorkspacePresenceRule, Claim, CognitionFactStore, CommitResult, EvidenceContext, EvidenceGatherer, EvidenceResult, Verdict, } from './cognition/index.js';
60
+ export { runStackDiagnostic } from './diagnostics/index.js';
61
+ export type { StackStep, StackStepResult, StackContext, StackDiagnosticResult, RunStackOptions, StepStatus, } from './diagnostics/index.js';
62
+ export { runWorkflow, compileWorkflow, validateWorkflow, buildEvermindStackSteps, StepTypeRegistry, createDefaultRegistry, defaultStepRegistry, BUILTIN_STEPS, AGENTIC_SEVEN_LAYER, TRAIN_LLM, WORKFLOW_TEMPLATES, getTemplate, cloneTemplate, } from './workflow/index.js';
63
+ export type { WorkflowConfig, WorkflowStepConfig, StepTypeInfo, StepFactory, WorkflowValidationError, RunWorkflowOptions, } from './workflow/index.js';
60
64
  export { DistillationEngine } from './distillation/DistillationEngine.js';
61
65
  export type { DistillOptions, DistillResult, DistillBatchResult, DistillationLog, QualityGate, } from './distillation/DistillationEngine.js';
62
66
  export { SSMAgent } from './agent/SSMAgent.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAGH,OAAO,EAAE,YAAY,EAAE,MAAmB,oBAAoB,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAmB,oBAAoB,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAE7F,YAAY,EAAE,gBAAgB,EAAE,MAAU,oBAAoB,CAAC;AAC/D,YAAY,EAAE,mBAAmB,EAAE,MAAO,oBAAoB,CAAC;AAC/D,YAAY,EACR,mBAAmB,EACnB,eAAe,EACf,YAAY,EACZ,WAAW,EACX,WAAW,EACX,WAAW,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CAAC;AAG9C,OAAO,EAAE,QAAQ,EAAE,MAAO,qBAAqB,CAAC;AAChD,YAAY,EAAE,eAAe,EAAE,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAGpG,OAAO,EAAE,QAAQ,EAAE,MAAO,sBAAsB,CAAC;AACjD,YAAY,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAMzD,OAAO,EAAE,UAAU,EAAE,MAAe,yBAAyB,CAAC;AAC9D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAEjE,eAAO,MAAM,GAAG;IACZ;;;;;OAKG;4BACY,iBAAiB;CAC1B,CAAC"}
package/dist/index.js CHANGED
@@ -50,6 +50,10 @@ export { InferenceRouter } from './router/InferenceRouter.js';
50
50
  export { MemoryStore } from './memory/MemoryStore.js';
51
51
  // ── Cognition (Evermind — Write-Through Cognition) ────────────────────────────
52
52
  export { EvermindCognition, workspacePresenceGatherer } from './cognition/index.js';
53
+ // ── Diagnostics (execution-output runner) ──────────────────────────────────────
54
+ export { runStackDiagnostic } from './diagnostics/index.js';
55
+ // ── Workflows (configurable templates + step registry → run + .evermind output) ─
56
+ export { runWorkflow, compileWorkflow, validateWorkflow, buildEvermindStackSteps, StepTypeRegistry, createDefaultRegistry, defaultStepRegistry, BUILTIN_STEPS, AGENTIC_SEVEN_LAYER, TRAIN_LLM, WORKFLOW_TEMPLATES, getTemplate, cloneTemplate, } from './workflow/index.js';
53
57
  // ── Distillation ──────────────────────────────────────────────────────────────
54
58
  export { DistillationEngine } from './distillation/DistillationEngine.js';
55
59
  // ── Agent ─────────────────────────────────────────────────────────────────────
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,iFAAiF;AACjF,OAAO,EAAE,YAAY,EAAE,MAAmB,oBAAoB,CAAC;AAC/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B,EAAE,MAAM,sBAAsB,CAAC;AAapF,kFAAkF;AAClF,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAU5D,mFAAmF;AACnF,OAAO,EACH,WAAW,EACX,eAAe,EACf,gBAAgB,EAChB,uBAAuB,EACvB,gBAAgB,EAChB,qBAAqB,EACrB,mBAAmB,EACnB,aAAa,EACb,mBAAmB,EACnB,SAAS,EACT,kBAAkB,EAClB,WAAW,EACX,aAAa,GAChB,MAAM,qBAAqB,CAAC;AAU7B,iFAAiF;AACjF,OAAO,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAS1E,iFAAiF;AACjF,OAAO,EAAE,QAAQ,EAAE,MAAO,qBAAqB,CAAC;AAGhD,iFAAiF;AACjF,OAAO,EAAE,QAAQ,EAAE,MAAO,sBAAsB,CAAC;AAGjD,iFAAiF;AACjF,mDAAmD;AACnD,qEAAqE;AAErE,OAAO,EAAE,UAAU,EAAE,MAAe,yBAAyB,CAAC;AAG9D,MAAM,CAAC,MAAM,GAAG,GAAG;IACf;;;;;OAKG;IACH,MAAM,EAAE,CAAC,IAAuB,EAAE,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC;CACtD,CAAC"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Configurable agent/LLM workflows — templates, a step-type registry, and a
3
+ * runner that produces an execution-output timeline (+ a trained `.evermind`
4
+ * artifact for build workflows).
5
+ */
6
+ export type { WorkflowConfig, WorkflowStepConfig, StepTypeInfo, StepFactory } from "./types.js";
7
+ export { StepTypeRegistry, createDefaultRegistry, defaultStepRegistry } from "./registry.js";
8
+ export { BUILTIN_STEPS } from "./steps.js";
9
+ export { AGENTIC_SEVEN_LAYER, TRAIN_LLM, WORKFLOW_TEMPLATES, getTemplate, cloneTemplate, } from "./templates.js";
10
+ export { compileWorkflow, validateWorkflow, runWorkflow, buildEvermindStackSteps, type WorkflowValidationError, type RunWorkflowOptions, } from "./run.js";
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/workflow/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,YAAY,EAAE,cAAc,EAAE,kBAAkB,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAChG,OAAO,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAC7F,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EACL,mBAAmB,EACnB,SAAS,EACT,kBAAkB,EAClB,WAAW,EACX,aAAa,GACd,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,eAAe,EACf,gBAAgB,EAChB,WAAW,EACX,uBAAuB,EACvB,KAAK,uBAAuB,EAC5B,KAAK,kBAAkB,GACxB,MAAM,UAAU,CAAC"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Configurable agent/LLM workflows — templates, a step-type registry, and a
3
+ * runner that produces an execution-output timeline (+ a trained `.evermind`
4
+ * artifact for build workflows).
5
+ */
6
+ export { StepTypeRegistry, createDefaultRegistry, defaultStepRegistry } from "./registry.js";
7
+ export { BUILTIN_STEPS } from "./steps.js";
8
+ export { AGENTIC_SEVEN_LAYER, TRAIN_LLM, WORKFLOW_TEMPLATES, getTemplate, cloneTemplate, } from "./templates.js";
9
+ export { compileWorkflow, validateWorkflow, runWorkflow, buildEvermindStackSteps, } from "./run.js";
10
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/workflow/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAC7F,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EACL,mBAAmB,EACnB,SAAS,EACT,kBAAkB,EAClB,WAAW,EACX,aAAa,GACd,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,eAAe,EACf,gBAAgB,EAChB,WAAW,EACX,uBAAuB,GAGxB,MAAM,UAAU,CAAC"}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * workflow/registry.ts — the step-type registry.
3
+ *
4
+ * Maps a step `type` → its factory + metadata. Built-ins are pre-registered;
5
+ * callers (e.g. the agent runtime) can `register` real implementations for the
6
+ * layers they own. Unknown types compile to a failing step so a bad workflow is
7
+ * localized in the timeline rather than crashing the run.
8
+ */
9
+ import type { StepFactory, StepTypeInfo, WorkflowStepConfig } from "./types.js";
10
+ import type { StackStep } from "../diagnostics/stack-diagnostic.js";
11
+ export declare class StepTypeRegistry {
12
+ private readonly map;
13
+ register(info: StepTypeInfo, factory: StepFactory): this;
14
+ has(type: string): boolean;
15
+ /** Compile one step config to a runnable step (failing step for unknown types). */
16
+ build(cfg: WorkflowStepConfig): StackStep;
17
+ /** All registered step types — a workflow-builder palette reads this. */
18
+ types(): StepTypeInfo[];
19
+ }
20
+ export declare function createDefaultRegistry(): StepTypeRegistry;
21
+ /** Shared registry seeded with the built-in step types. */
22
+ export declare const defaultStepRegistry: StepTypeRegistry;
23
+ //# sourceMappingURL=registry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/workflow/registry.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAChF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oCAAoC,CAAC;AAEpE,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAmE;IAEvF,QAAQ,CAAC,IAAI,EAAE,YAAY,EAAE,OAAO,EAAE,WAAW,GAAG,IAAI;IAKxD,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAI1B,mFAAmF;IACnF,KAAK,CAAC,GAAG,EAAE,kBAAkB,GAAG,SAAS;IAezC,yEAAyE;IACzE,KAAK,IAAI,YAAY,EAAE;CAGxB;AAED,wBAAgB,qBAAqB,IAAI,gBAAgB,CAIxD;AAED,2DAA2D;AAC3D,eAAO,MAAM,mBAAmB,kBAA0B,CAAC"}
@@ -0,0 +1,47 @@
1
+ /**
2
+ * workflow/registry.ts — the step-type registry.
3
+ *
4
+ * Maps a step `type` → its factory + metadata. Built-ins are pre-registered;
5
+ * callers (e.g. the agent runtime) can `register` real implementations for the
6
+ * layers they own. Unknown types compile to a failing step so a bad workflow is
7
+ * localized in the timeline rather than crashing the run.
8
+ */
9
+ import { BUILTIN_STEPS } from "./steps.js";
10
+ export class StepTypeRegistry {
11
+ map = new Map();
12
+ register(info, factory) {
13
+ this.map.set(info.type, { info, factory });
14
+ return this;
15
+ }
16
+ has(type) {
17
+ return this.map.has(type);
18
+ }
19
+ /** Compile one step config to a runnable step (failing step for unknown types). */
20
+ build(cfg) {
21
+ const entry = this.map.get(cfg.type);
22
+ if (!entry) {
23
+ return {
24
+ id: cfg.id,
25
+ layer: "?",
26
+ label: cfg.label ?? cfg.type,
27
+ run: async () => {
28
+ throw new Error(`unknown step type "${cfg.type}"`);
29
+ },
30
+ };
31
+ }
32
+ return entry.factory(cfg);
33
+ }
34
+ /** All registered step types — a workflow-builder palette reads this. */
35
+ types() {
36
+ return [...this.map.values()].map((e) => e.info);
37
+ }
38
+ }
39
+ export function createDefaultRegistry() {
40
+ const r = new StepTypeRegistry();
41
+ for (const { info, factory } of Object.values(BUILTIN_STEPS))
42
+ r.register(info, factory);
43
+ return r;
44
+ }
45
+ /** Shared registry seeded with the built-in step types. */
46
+ export const defaultStepRegistry = createDefaultRegistry();
47
+ //# sourceMappingURL=registry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registry.js","sourceRoot":"","sources":["../../src/workflow/registry.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;A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MAAM,CAAC,MAAM,CAAC,aAAa,CAAC;QAAE,CAAC,CAAC,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IACxF,OAAO,CAAC,CAAC;AACX,CAAC;AAED,2DAA2D;AAC3D,MAAM,CAAC,MAAM,mBAAmB,GAAG,qBAAqB,EAAE,CAAC"}
@@ -0,0 +1,26 @@
1
+ /**
2
+ * workflow/run.ts — compile, validate, and run a workflow config.
3
+ */
4
+ import { type RunStackOptions, type StackDiagnosticResult, type StackStep } from "../diagnostics/stack-diagnostic.js";
5
+ import { StepTypeRegistry } from "./registry.js";
6
+ import type { WorkflowConfig } from "./types.js";
7
+ /** Compile a workflow config to runnable steps (unknown types → failing steps). */
8
+ export declare function compileWorkflow(config: WorkflowConfig, registry?: StepTypeRegistry): StackStep[];
9
+ export interface WorkflowValidationError {
10
+ stepId: string;
11
+ type: string;
12
+ message: string;
13
+ }
14
+ /** Static checks before running: non-empty, unique ids, known types. */
15
+ export declare function validateWorkflow(config: WorkflowConfig, registry?: StepTypeRegistry): WorkflowValidationError[];
16
+ export interface RunWorkflowOptions extends RunStackOptions {
17
+ registry?: StepTypeRegistry;
18
+ }
19
+ /**
20
+ * Run a workflow config and return its execution-output timeline + artifacts
21
+ * (e.g. `result.artifacts.evermind` is the trained model for a build workflow).
22
+ */
23
+ export declare function runWorkflow(config: WorkflowConfig, opts?: RunWorkflowOptions): Promise<StackDiagnosticResult>;
24
+ /** Back-compat: the 7-layer template compiled to steps (consumed by the e2e test). */
25
+ export declare function buildEvermindStackSteps(): StackStep[];
26
+ //# sourceMappingURL=run.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../src/workflow/run.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,qBAAqB,EAC1B,KAAK,SAAS,EACf,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAuB,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEtE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEjD,mFAAmF;AACnF,wBAAgB,eAAe,CAAC,MAAM,EAAE,cAAc,EAAE,QAAQ,GAAE,gBAAsC,GAAG,SAAS,EAAE,CAErH;AAED,MAAM,WAAW,uBAAuB;IACtC,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,wEAAwE;AACxE,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,cAAc,EAAE,QAAQ,GAAE,gBAAsC,GAAG,uBAAuB,EAAE,CAapI;AAED,MAAM,WAAW,kBAAmB,SAAQ,eAAe;IACzD,QAAQ,CAAC,EAAE,gBAAgB,CAAC;CAC7B;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,cAAc,EAAE,IAAI,GAAE,kBAAuB,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAGjH;AAED,sFAAsF;AACtF,wBAAgB,uBAAuB,IAAI,SAAS,EAAE,CAErD"}
@@ -0,0 +1,40 @@
1
+ /**
2
+ * workflow/run.ts — compile, validate, and run a workflow config.
3
+ */
4
+ import { runStackDiagnostic, } from "../diagnostics/stack-diagnostic.js";
5
+ import { defaultStepRegistry } from "./registry.js";
6
+ import { AGENTIC_SEVEN_LAYER } from "./templates.js";
7
+ /** Compile a workflow config to runnable steps (unknown types → failing steps). */
8
+ export function compileWorkflow(config, registry = defaultStepRegistry) {
9
+ return config.steps.map((s) => registry.build(s));
10
+ }
11
+ /** Static checks before running: non-empty, unique ids, known types. */
12
+ export function validateWorkflow(config, registry = defaultStepRegistry) {
13
+ const errors = [];
14
+ if (!config.steps || config.steps.length === 0) {
15
+ errors.push({ stepId: "", type: "", message: "workflow has no steps" });
16
+ return errors;
17
+ }
18
+ const seen = new Set();
19
+ for (const s of config.steps) {
20
+ if (seen.has(s.id))
21
+ errors.push({ stepId: s.id, type: s.type, message: `duplicate step id "${s.id}"` });
22
+ seen.add(s.id);
23
+ if (!registry.has(s.type))
24
+ errors.push({ stepId: s.id, type: s.type, message: `unknown step type "${s.type}"` });
25
+ }
26
+ return errors;
27
+ }
28
+ /**
29
+ * Run a workflow config and return its execution-output timeline + artifacts
30
+ * (e.g. `result.artifacts.evermind` is the trained model for a build workflow).
31
+ */
32
+ export function runWorkflow(config, opts = {}) {
33
+ const { registry = defaultStepRegistry, ...runOpts } = opts;
34
+ return runStackDiagnostic(compileWorkflow(config, registry), runOpts);
35
+ }
36
+ /** Back-compat: the 7-layer template compiled to steps (consumed by the e2e test). */
37
+ export function buildEvermindStackSteps() {
38
+ return compileWorkflow(AGENTIC_SEVEN_LAYER);
39
+ }
40
+ //# sourceMappingURL=run.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run.js","sourceRoot":"","sources":["../../src/workflow/run.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,kBAAkB,GAInB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,mBAAmB,EAAoB,MAAM,eAAe,CAAC;AACtE,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAGrD,mFAAmF;AACnF,MAAM,UAAU,eAAe,CAAC,MAAsB,EAAE,WAA6B,mBAAmB;IACtG,OAAO,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;AACpD,CAAC;AAQD,wEAAwE;AACxE,MAAM,UAAU,gBAAgB,CAAC,MAAsB,EAAE,WAA6B,mBAAmB;IACvG,MAAM,MAAM,GAA8B,EAAE,CAAC;IAC7C,IAAI,CAAC,MAAM,CAAC,KAAK,IAAI,MAAM,CAAC,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC/C,MAAM,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,IAAI,EA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Agent-stack layers (L1..L7) — the diagnostic checks (the 7-layer template).
6
+ * • LLM-creation pipeline (BUILD) — train-tokenizer → train-model → evaluate →
7
+ * package, which produces a trained `.evermind` artifact (a custom LLM) into
8
+ * `ctx.artifacts.evermind`.
9
+ *
10
+ * A custom workflow mixes these freely; new step types register the same way.
11
+ */
12
+ import type { StepFactory, StepTypeInfo } from "./types.js";
13
+ interface Registered {
14
+ info: StepTypeInfo;
15
+ factory: StepFactory;
16
+ }
17
+ export declare const BUILTIN_STEPS: Record<string, Registered>;
18
+ export {};
19
+ //# sourceMappingURL=steps.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"steps.d.ts","sourceRoot":"","sources":["../../src/workflow/steps.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAYH,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAsB,MAAM,YAAY,CAAC;AAgChF,UAAU,UAAU;IAClB,IAAI,EAAE,YAAY,CAAC;IACnB,OAAO,EAAE,WAAW,CAAC;CACtB;AAED,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAyQpD,CAAC"}