@lumenflow/core 2.2.2 → 2.3.1
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/active-wu-detector.d.ts +1 -1
- package/dist/active-wu-detector.js +1 -1
- package/dist/arg-parser.js +51 -18
- package/dist/backlog-generator.d.ts +4 -4
- package/dist/backlog-generator.js +4 -4
- package/dist/backlog-sync-validator.js +1 -1
- package/dist/cleanup-lock.d.ts +9 -2
- package/dist/cleanup-lock.js +17 -7
- package/dist/code-path-validator.d.ts +3 -3
- package/dist/code-path-validator.js +3 -3
- package/dist/compliance-parser.d.ts +1 -1
- package/dist/compliance-parser.js +1 -1
- package/dist/constants/backlog-patterns.d.ts +1 -1
- package/dist/constants/backlog-patterns.js +1 -1
- package/dist/constants/dora-constants.d.ts +1 -1
- package/dist/constants/dora-constants.js +1 -1
- package/dist/constants/gate-constants.d.ts +1 -1
- package/dist/constants/gate-constants.js +1 -1
- package/dist/constants/linter-constants.d.ts +1 -1
- package/dist/constants/linter-constants.js +1 -1
- package/dist/constants/tokenizer-constants.d.ts +1 -1
- package/dist/constants/tokenizer-constants.js +1 -1
- package/dist/context/location-resolver.js +2 -1
- package/dist/context-validation-integration.d.ts +1 -0
- package/dist/core/scope-checker.d.ts +3 -3
- package/dist/core/scope-checker.js +3 -3
- package/dist/core/tool-runner.d.ts +5 -5
- package/dist/core/tool-runner.js +5 -5
- package/dist/core/tool.constants.d.ts +1 -1
- package/dist/core/tool.constants.js +1 -1
- package/dist/core/tool.schemas.d.ts +2 -2
- package/dist/core/tool.schemas.js +1 -1
- package/dist/core/worktree-guard.d.ts +1 -1
- package/dist/core/worktree-guard.js +1 -1
- package/dist/coverage-gate.d.ts +12 -3
- package/dist/coverage-gate.js +15 -8
- package/dist/date-utils.d.ts +4 -4
- package/dist/date-utils.js +4 -4
- package/dist/dependency-graph.d.ts +6 -0
- package/dist/dependency-graph.js +43 -2
- package/dist/dependency-guard.d.ts +2 -2
- package/dist/dependency-guard.js +3 -3
- package/dist/dependency-validator.d.ts +4 -4
- package/dist/dependency-validator.js +4 -7
- package/dist/domain/orchestration.constants.d.ts +31 -10
- package/dist/domain/orchestration.constants.js +45 -16
- package/dist/domain/orchestration.schemas.d.ts +54 -28
- package/dist/domain/orchestration.schemas.js +2 -2
- package/dist/domain/orchestration.types.d.ts +2 -2
- package/dist/domain/orchestration.types.js +2 -2
- package/dist/error-handler.d.ts +10 -10
- package/dist/error-handler.js +10 -10
- package/dist/file-classifiers.d.ts +6 -6
- package/dist/file-classifiers.js +6 -6
- package/dist/gates-config.d.ts +74 -0
- package/dist/gates-config.js +209 -2
- package/dist/git-adapter.d.ts +11 -11
- package/dist/git-adapter.js +11 -11
- package/dist/git-context-extractor.d.ts +112 -0
- package/dist/git-context-extractor.js +559 -0
- package/dist/hardcoded-strings.d.ts +1 -1
- package/dist/hardcoded-strings.js +1 -1
- package/dist/incremental-lint.d.ts +1 -1
- package/dist/incremental-lint.js +2 -2
- package/dist/incremental-test.d.ts +1 -1
- package/dist/incremental-test.js +1 -1
- package/dist/index.d.ts +13 -0
- package/dist/index.js +25 -0
- package/dist/invariants/check-automated-tests.d.ts +2 -2
- package/dist/invariants/check-automated-tests.js +3 -3
- package/dist/lane-checker.d.ts +28 -7
- package/dist/lane-checker.js +316 -159
- package/dist/lane-suggest-prompt.d.ts +108 -0
- package/dist/lane-suggest-prompt.js +359 -0
- package/dist/lane-validator.d.ts +3 -3
- package/dist/lane-validator.js +3 -3
- package/dist/logs-lib.d.ts +1 -1
- package/dist/logs-lib.js +1 -1
- package/dist/lumenflow-config-schema.d.ts +162 -0
- package/dist/lumenflow-config-schema.js +180 -0
- package/dist/manual-test-validator.d.ts +2 -2
- package/dist/manual-test-validator.js +3 -3
- package/dist/merge-lock.d.ts +8 -1
- package/dist/merge-lock.js +16 -7
- package/dist/micro-worktree.d.ts +81 -13
- package/dist/micro-worktree.js +98 -17
- package/dist/migration-deployer.d.ts +1 -1
- package/dist/migration-deployer.js +1 -1
- package/dist/orchestration-advisory-loader.d.ts +2 -2
- package/dist/orchestration-advisory-loader.js +10 -6
- package/dist/orchestration-advisory.d.ts +3 -3
- package/dist/orchestration-advisory.js +4 -4
- package/dist/orchestration-di.d.ts +4 -4
- package/dist/orchestration-di.js +4 -4
- package/dist/orchestration-rules.d.ts +4 -4
- package/dist/orchestration-rules.js +18 -10
- package/dist/orphan-detector.d.ts +3 -3
- package/dist/orphan-detector.js +3 -3
- package/dist/patrol-loop.d.ts +170 -0
- package/dist/patrol-loop.js +186 -0
- package/dist/process-detector.d.ts +5 -5
- package/dist/process-detector.js +5 -5
- package/dist/rebase-artifact-cleanup.d.ts +3 -3
- package/dist/rebase-artifact-cleanup.js +3 -3
- package/dist/resolve-policy.d.ts +195 -0
- package/dist/resolve-policy.js +203 -0
- package/dist/risk-detector.d.ts +2 -2
- package/dist/risk-detector.js +2 -2
- package/dist/rollback-utils.d.ts +1 -1
- package/dist/rollback-utils.js +1 -1
- package/dist/section-headings.d.ts +1 -1
- package/dist/section-headings.js +1 -1
- package/dist/spawn-escalation.d.ts +4 -4
- package/dist/spawn-escalation.js +3 -3
- package/dist/spawn-monitor.d.ts +4 -4
- package/dist/spawn-monitor.js +4 -4
- package/dist/spawn-recovery.d.ts +3 -3
- package/dist/spawn-recovery.js +3 -3
- package/dist/spawn-registry-schema.d.ts +2 -2
- package/dist/spawn-registry-schema.js +2 -2
- package/dist/spawn-registry-store.d.ts +2 -2
- package/dist/spawn-registry-store.js +2 -2
- package/dist/spawn-strategy.d.ts +17 -11
- package/dist/spawn-strategy.js +47 -44
- package/dist/spawn-tree.d.ts +3 -3
- package/dist/spawn-tree.js +3 -3
- package/dist/state-cleanup-core.d.ts +205 -0
- package/dist/state-cleanup-core.js +240 -0
- package/dist/state-doctor-core.d.ts +168 -0
- package/dist/state-doctor-core.js +251 -0
- package/dist/stream-error-handler.d.ts +67 -0
- package/dist/stream-error-handler.js +94 -0
- package/dist/telemetry.d.ts +1 -1
- package/dist/telemetry.js +1 -1
- package/dist/template-loader.d.ts +162 -0
- package/dist/template-loader.js +372 -0
- package/dist/test-baseline.d.ts +176 -0
- package/dist/test-baseline.js +282 -0
- package/dist/usecases/get-suggestions.usecase.d.ts +1 -1
- package/dist/validation/command-registry.js +37 -0
- package/dist/validators/backlog-sync.js +4 -2
- package/dist/worktree-scanner.d.ts +1 -1
- package/dist/worktree-scanner.js +1 -1
- package/dist/worktree-symlink.d.ts +3 -3
- package/dist/worktree-symlink.js +3 -3
- package/dist/wu-backlog-updater.d.ts +1 -1
- package/dist/wu-backlog-updater.js +1 -1
- package/dist/wu-claim-helpers.d.ts +1 -1
- package/dist/wu-claim-helpers.js +1 -1
- package/dist/wu-claim-resume.d.ts +1 -1
- package/dist/wu-claim-resume.js +1 -1
- package/dist/wu-consistency-checker.d.ts +1 -1
- package/dist/wu-consistency-checker.js +17 -11
- package/dist/wu-constants.d.ts +73 -21
- package/dist/wu-constants.js +65 -22
- package/dist/wu-done-branch-only.d.ts +1 -1
- package/dist/wu-done-branch-only.js +1 -1
- package/dist/wu-done-docs-generate.d.ts +1 -1
- package/dist/wu-done-docs-generate.js +1 -1
- package/dist/wu-done-messages.d.ts +2 -2
- package/dist/wu-done-messages.js +2 -2
- package/dist/wu-done-metadata.d.ts +3 -3
- package/dist/wu-done-metadata.js +3 -3
- package/dist/wu-done-pr.d.ts +1 -1
- package/dist/wu-done-pr.js +4 -2
- package/dist/wu-done-preflight.d.ts +8 -0
- package/dist/wu-done-preflight.js +18 -2
- package/dist/wu-done-ui.d.ts +3 -3
- package/dist/wu-done-ui.js +3 -3
- package/dist/wu-done-validation.d.ts +30 -0
- package/dist/wu-done-validation.js +106 -1
- package/dist/wu-done-worktree.d.ts +1 -1
- package/dist/wu-done-worktree.js +11 -1
- package/dist/wu-events-cleanup.d.ts +148 -0
- package/dist/wu-events-cleanup.js +401 -0
- package/dist/wu-helpers.d.ts +2 -2
- package/dist/wu-helpers.js +2 -2
- package/dist/wu-id-generator.d.ts +58 -0
- package/dist/wu-id-generator.js +103 -0
- package/dist/wu-lint.js +1 -1
- package/dist/wu-preflight-validators.d.ts +13 -1
- package/dist/wu-preflight-validators.js +56 -1
- package/dist/wu-recovery.d.ts +2 -2
- package/dist/wu-recovery.js +4 -4
- package/dist/wu-repair-core.d.ts +5 -5
- package/dist/wu-repair-core.js +6 -6
- package/dist/wu-schema-normalization.d.ts +1 -1
- package/dist/wu-schema-normalization.js +1 -1
- package/dist/wu-schema.d.ts +7 -7
- package/dist/wu-schema.js +8 -8
- package/dist/wu-spawn-context.d.ts +87 -0
- package/dist/wu-spawn-context.js +175 -0
- package/dist/wu-spawn-helpers.d.ts +1 -1
- package/dist/wu-spawn-helpers.js +1 -1
- package/dist/wu-spawn.d.ts +177 -4
- package/dist/wu-spawn.js +694 -72
- package/dist/wu-state-schema.d.ts +1 -1
- package/dist/wu-state-schema.js +1 -1
- package/dist/wu-state-store.d.ts +3 -3
- package/dist/wu-state-store.js +3 -3
- package/dist/wu-status-transition.d.ts +1 -1
- package/dist/wu-status-transition.js +1 -1
- package/dist/wu-status-updater.d.ts +3 -3
- package/dist/wu-status-updater.js +3 -3
- package/dist/wu-validation-constants.d.ts +2 -2
- package/dist/wu-validation-constants.js +2 -2
- package/dist/wu-validation.d.ts +3 -3
- package/dist/wu-validation.js +3 -3
- package/dist/wu-yaml-fixer.d.ts +2 -2
- package/dist/wu-yaml-fixer.js +3 -3
- package/dist/wu-yaml.d.ts +23 -0
- package/dist/wu-yaml.js +76 -2
- package/package.json +5 -2
package/dist/risk-detector.js
CHANGED
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
* healthcare domain (PHI, RLS, auth). No standard library exists for this
|
|
16
16
|
* domain-specific classification.
|
|
17
17
|
*
|
|
18
|
-
* @see {@link
|
|
19
|
-
* @see {@link
|
|
18
|
+
* @see {@link packages/@lumenflow/cli/src/gates.ts} - Consumer of risk detection
|
|
19
|
+
* @see {@link packages/@lumenflow/cli/src/lib/file-classifiers.ts} - File classification utilities
|
|
20
20
|
*/
|
|
21
21
|
import path from 'node:path';
|
|
22
22
|
import { isDocumentationPath } from './file-classifiers.js';
|
package/dist/rollback-utils.d.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* WU-1255: Per-file error tracking for robust rollback operations.
|
|
6
6
|
* Ensures all files are attempted even if some fail, with clear error reporting.
|
|
7
7
|
*
|
|
8
|
-
* @see {@link
|
|
8
|
+
* @see {@link packages/@lumenflow/cli/src/wu-done.ts} - Consumer (rollbackTransaction function)
|
|
9
9
|
*/
|
|
10
10
|
/**
|
|
11
11
|
* Error entry for failed file restoration
|
package/dist/rollback-utils.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* WU-1255: Per-file error tracking for robust rollback operations.
|
|
6
6
|
* Ensures all files are attempted even if some fail, with clear error reporting.
|
|
7
7
|
*
|
|
8
|
-
* @see {@link
|
|
8
|
+
* @see {@link packages/@lumenflow/cli/src/wu-done.ts} - Consumer (rollbackTransaction function)
|
|
9
9
|
*/
|
|
10
10
|
/* eslint-disable security/detect-non-literal-fs-filename */
|
|
11
11
|
import { writeFileSync, unlinkSync } from 'node:fs';
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
*/
|
|
10
10
|
/**
|
|
11
11
|
* Default section headings (fallbacks when frontmatter is missing)
|
|
12
|
-
* Re-exports from wu-constants.
|
|
12
|
+
* Re-exports from wu-constants.ts for backwards compatibility
|
|
13
13
|
*/
|
|
14
14
|
export declare const DEFAULT_SECTION_HEADINGS: {
|
|
15
15
|
backlog: {
|
package/dist/section-headings.js
CHANGED
|
@@ -11,7 +11,7 @@ import { getSectionHeadings } from './backlog-parser.js';
|
|
|
11
11
|
import { BACKLOG_SECTIONS, STATUS_SECTIONS } from './wu-constants.js';
|
|
12
12
|
/**
|
|
13
13
|
* Default section headings (fallbacks when frontmatter is missing)
|
|
14
|
-
* Re-exports from wu-constants.
|
|
14
|
+
* Re-exports from wu-constants.ts for backwards compatibility
|
|
15
15
|
*/
|
|
16
16
|
export const DEFAULT_SECTION_HEADINGS = {
|
|
17
17
|
backlog: {
|
|
@@ -14,9 +14,9 @@
|
|
|
14
14
|
* PatientPath's custom spawn-registry.jsonl and memory bus patterns.
|
|
15
15
|
* No external library exists for this domain-specific agent lifecycle management.
|
|
16
16
|
*
|
|
17
|
-
* @see {@link
|
|
18
|
-
* @see {@link
|
|
19
|
-
* @see {@link
|
|
17
|
+
* @see {@link packages/@lumenflow/cli/src/lib/__tests__/spawn-escalation.test.ts} - Tests
|
|
18
|
+
* @see {@link packages/@lumenflow/cli/src/lib/spawn-recovery.ts} - Recovery logic
|
|
19
|
+
* @see {@link packages/@lumenflow/cli/src/lib/mem-signal-core.ts} - Signal creation
|
|
20
20
|
*/
|
|
21
21
|
/**
|
|
22
22
|
* Signal type for spawn failures
|
|
@@ -83,7 +83,7 @@ export declare function escalateStuckSpawn(spawnId: any, options?: EscalateStuck
|
|
|
83
83
|
recovery_action: any;
|
|
84
84
|
recovery_attempts: any;
|
|
85
85
|
last_checkpoint: any;
|
|
86
|
-
suggested_action: "
|
|
86
|
+
suggested_action: "block" | "retry" | "human_escalate";
|
|
87
87
|
message: string;
|
|
88
88
|
};
|
|
89
89
|
spawnStatus: "escalated";
|
package/dist/spawn-escalation.js
CHANGED
|
@@ -14,9 +14,9 @@
|
|
|
14
14
|
* PatientPath's custom spawn-registry.jsonl and memory bus patterns.
|
|
15
15
|
* No external library exists for this domain-specific agent lifecycle management.
|
|
16
16
|
*
|
|
17
|
-
* @see {@link
|
|
18
|
-
* @see {@link
|
|
19
|
-
* @see {@link
|
|
17
|
+
* @see {@link packages/@lumenflow/cli/src/lib/__tests__/spawn-escalation.test.ts} - Tests
|
|
18
|
+
* @see {@link packages/@lumenflow/cli/src/lib/spawn-recovery.ts} - Recovery logic
|
|
19
|
+
* @see {@link packages/@lumenflow/cli/src/lib/mem-signal-core.ts} - Signal creation
|
|
20
20
|
*/
|
|
21
21
|
import fs from 'node:fs/promises';
|
|
22
22
|
import path from 'node:path';
|
package/dist/spawn-monitor.d.ts
CHANGED
|
@@ -15,10 +15,10 @@
|
|
|
15
15
|
* PatientPath's spawn-registry.jsonl and lane-lock files. No external
|
|
16
16
|
* library exists for this custom format.
|
|
17
17
|
*
|
|
18
|
-
* @see {@link
|
|
19
|
-
* @see {@link
|
|
20
|
-
* @see {@link
|
|
21
|
-
* @see {@link
|
|
18
|
+
* @see {@link packages/@lumenflow/cli/src/__tests__/orchestrate-monitor.test.ts} - Tests
|
|
19
|
+
* @see {@link packages/@lumenflow/cli/src/lib/__tests__/spawn-monitor.test.ts} - Signal handler tests
|
|
20
|
+
* @see {@link packages/@lumenflow/cli/src/orchestrate-monitor.ts} - CLI entry point
|
|
21
|
+
* @see {@link packages/@lumenflow/cli/src/lib/spawn-registry-store.ts} - Registry storage
|
|
22
22
|
*/
|
|
23
23
|
/**
|
|
24
24
|
* Default threshold for stuck spawn detection (in minutes)
|
package/dist/spawn-monitor.js
CHANGED
|
@@ -15,10 +15,10 @@
|
|
|
15
15
|
* PatientPath's spawn-registry.jsonl and lane-lock files. No external
|
|
16
16
|
* library exists for this custom format.
|
|
17
17
|
*
|
|
18
|
-
* @see {@link
|
|
19
|
-
* @see {@link
|
|
20
|
-
* @see {@link
|
|
21
|
-
* @see {@link
|
|
18
|
+
* @see {@link packages/@lumenflow/cli/src/__tests__/orchestrate-monitor.test.ts} - Tests
|
|
19
|
+
* @see {@link packages/@lumenflow/cli/src/lib/__tests__/spawn-monitor.test.ts} - Signal handler tests
|
|
20
|
+
* @see {@link packages/@lumenflow/cli/src/orchestrate-monitor.ts} - CLI entry point
|
|
21
|
+
* @see {@link packages/@lumenflow/cli/src/lib/spawn-registry-store.ts} - Registry storage
|
|
22
22
|
*/
|
|
23
23
|
import fs from 'node:fs/promises';
|
|
24
24
|
import path from 'node:path';
|
package/dist/spawn-recovery.d.ts
CHANGED
|
@@ -15,9 +15,9 @@
|
|
|
15
15
|
* PatientPath's custom spawn-registry.jsonl, lane-lock, and memory-store.
|
|
16
16
|
* No external library exists for this domain-specific agent lifecycle management.
|
|
17
17
|
*
|
|
18
|
-
* @see {@link
|
|
19
|
-
* @see {@link
|
|
20
|
-
* @see {@link
|
|
18
|
+
* @see {@link packages/@lumenflow/cli/src/lib/__tests__/spawn-recovery.test.ts} - Tests
|
|
19
|
+
* @see {@link packages/@lumenflow/cli/src/lib/spawn-monitor.ts} - Monitoring logic
|
|
20
|
+
* @see {@link packages/@lumenflow/cli/src/lib/spawn-registry-store.ts} - Spawn state
|
|
21
21
|
*/
|
|
22
22
|
/**
|
|
23
23
|
* Recovery action constants
|
package/dist/spawn-recovery.js
CHANGED
|
@@ -15,9 +15,9 @@
|
|
|
15
15
|
* PatientPath's custom spawn-registry.jsonl, lane-lock, and memory-store.
|
|
16
16
|
* No external library exists for this domain-specific agent lifecycle management.
|
|
17
17
|
*
|
|
18
|
-
* @see {@link
|
|
19
|
-
* @see {@link
|
|
20
|
-
* @see {@link
|
|
18
|
+
* @see {@link packages/@lumenflow/cli/src/lib/__tests__/spawn-recovery.test.ts} - Tests
|
|
19
|
+
* @see {@link packages/@lumenflow/cli/src/lib/spawn-monitor.ts} - Monitoring logic
|
|
20
|
+
* @see {@link packages/@lumenflow/cli/src/lib/spawn-registry-store.ts} - Spawn state
|
|
21
21
|
*/
|
|
22
22
|
import fs from 'node:fs/promises';
|
|
23
23
|
import path from 'node:path';
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* Zod schemas for spawn event validation.
|
|
5
5
|
* Defines schema for tracking sub-agent spawns by orchestrators.
|
|
6
6
|
*
|
|
7
|
-
* @see {@link
|
|
8
|
-
* @see {@link
|
|
7
|
+
* @see {@link packages/@lumenflow/cli/src/lib/__tests__/spawn-registry-store.test.ts} - Tests
|
|
8
|
+
* @see {@link packages/@lumenflow/cli/src/lib/spawn-registry-store.ts} - Store implementation
|
|
9
9
|
*/
|
|
10
10
|
import { z } from 'zod';
|
|
11
11
|
/**
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* Zod schemas for spawn event validation.
|
|
5
5
|
* Defines schema for tracking sub-agent spawns by orchestrators.
|
|
6
6
|
*
|
|
7
|
-
* @see {@link
|
|
8
|
-
* @see {@link
|
|
7
|
+
* @see {@link packages/@lumenflow/cli/src/lib/__tests__/spawn-registry-store.test.ts} - Tests
|
|
8
|
+
* @see {@link packages/@lumenflow/cli/src/lib/spawn-registry-store.ts} - Store implementation
|
|
9
9
|
*/
|
|
10
10
|
import { z } from 'zod';
|
|
11
11
|
import crypto from 'node:crypto';
|
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
* - Atomic append operations
|
|
10
10
|
* - O(1) queries by parent WU, target WU, and status
|
|
11
11
|
*
|
|
12
|
-
* @see {@link
|
|
13
|
-
* @see {@link
|
|
12
|
+
* @see {@link packages/@lumenflow/cli/src/lib/__tests__/spawn-registry-store.test.ts} - Tests
|
|
13
|
+
* @see {@link packages/@lumenflow/cli/src/lib/spawn-registry-schema.ts} - Schema definitions
|
|
14
14
|
*/
|
|
15
15
|
import { type SpawnEvent } from './spawn-registry-schema.js';
|
|
16
16
|
/**
|
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
* - Atomic append operations
|
|
10
10
|
* - O(1) queries by parent WU, target WU, and status
|
|
11
11
|
*
|
|
12
|
-
* @see {@link
|
|
13
|
-
* @see {@link
|
|
12
|
+
* @see {@link packages/@lumenflow/cli/src/lib/__tests__/spawn-registry-store.test.ts} - Tests
|
|
13
|
+
* @see {@link packages/@lumenflow/cli/src/lib/spawn-registry-schema.ts} - Schema definitions
|
|
14
14
|
*/
|
|
15
15
|
import fs from 'node:fs/promises';
|
|
16
16
|
import path from 'node:path';
|
package/dist/spawn-strategy.d.ts
CHANGED
|
@@ -17,7 +17,11 @@ export interface SpawnStrategy {
|
|
|
17
17
|
declare abstract class BaseSpawnStrategy implements SpawnStrategy {
|
|
18
18
|
protected getCorePreamble(wuId: string): string;
|
|
19
19
|
abstract getPreamble(wuId: string): string;
|
|
20
|
-
|
|
20
|
+
/**
|
|
21
|
+
* Default skill loading instruction - shared by GenericStrategy and GeminiCliStrategy
|
|
22
|
+
* ClaudeCodeStrategy overrides this with Claude-specific paths
|
|
23
|
+
*/
|
|
24
|
+
getSkillLoadingInstruction(): string;
|
|
21
25
|
}
|
|
22
26
|
/**
|
|
23
27
|
* Strategy for Claude Code (Local/Terminal)
|
|
@@ -28,26 +32,28 @@ export declare class ClaudeCodeStrategy extends BaseSpawnStrategy {
|
|
|
28
32
|
}
|
|
29
33
|
/**
|
|
30
34
|
* Strategy for Gemini CLI (Multimodal/Ecosystem)
|
|
35
|
+
* Uses default getSkillLoadingInstruction from base class
|
|
31
36
|
*/
|
|
32
37
|
export declare class GeminiCliStrategy extends BaseSpawnStrategy {
|
|
33
38
|
getPreamble(wuId: string): string;
|
|
34
|
-
getSkillLoadingInstruction(): string;
|
|
35
39
|
}
|
|
36
40
|
/**
|
|
37
41
|
* Generic Strategy (Unknown/Other clients)
|
|
42
|
+
* Uses default getSkillLoadingInstruction from base class
|
|
38
43
|
*/
|
|
39
44
|
export declare class GenericStrategy extends BaseSpawnStrategy {
|
|
40
45
|
getPreamble(wuId: string): string;
|
|
41
|
-
getSkillLoadingInstruction(): string;
|
|
42
46
|
}
|
|
43
47
|
/**
|
|
44
|
-
*
|
|
48
|
+
* Create a strategy for the given client
|
|
49
|
+
* @param clientName - Client name (e.g. 'claude-code', 'gemini-cli')
|
|
45
50
|
*/
|
|
46
|
-
export declare
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
export declare function createSpawnStrategy(clientName: string): SpawnStrategy;
|
|
52
|
+
/**
|
|
53
|
+
* Factory for creating strategies (legacy wrapper)
|
|
54
|
+
* @deprecated Use createSpawnStrategy function directly
|
|
55
|
+
*/
|
|
56
|
+
export declare const SpawnStrategyFactory: {
|
|
57
|
+
create: typeof createSpawnStrategy;
|
|
58
|
+
};
|
|
53
59
|
export {};
|
package/dist/spawn-strategy.js
CHANGED
|
@@ -10,7 +10,18 @@ class BaseSpawnStrategy {
|
|
|
10
10
|
2. Read .lumenflow/constraints.md (non-negotiable constraints)
|
|
11
11
|
3. Read README.md (project structure and tech stack)
|
|
12
12
|
4. Read docs/04-operations/_frameworks/lumenflow/lumenflow-complete.md sections 1-7 (TDD, gates, Definition of Done)
|
|
13
|
-
5. Read docs/04-operations/tasks/wu/${wuId}.yaml (the specific WU you're working on)
|
|
13
|
+
5. Read docs/04-operations/tasks/wu/${wuId}.yaml (the specific WU you're working on)
|
|
14
|
+
6. Read docs/04-operations/_frameworks/lumenflow/agent/onboarding/quick-ref-commands.md (CLI tooling reference - USE THESE COMMANDS)`;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Default skill loading instruction - shared by GenericStrategy and GeminiCliStrategy
|
|
18
|
+
* ClaudeCodeStrategy overrides this with Claude-specific paths
|
|
19
|
+
*/
|
|
20
|
+
getSkillLoadingInstruction() {
|
|
21
|
+
return `## Skills Selection
|
|
22
|
+
|
|
23
|
+
1. Check \`.lumenflow/agents\` for available skills.
|
|
24
|
+
2. Select relevant skills for this task.`;
|
|
14
25
|
}
|
|
15
26
|
}
|
|
16
27
|
/**
|
|
@@ -27,7 +38,7 @@ export class ClaudeCodeStrategy extends BaseSpawnStrategy {
|
|
|
27
38
|
// Actually, checking original behavior: CLAUDE.md was #1.
|
|
28
39
|
// But new plan says LUMENFLOW.md is core.
|
|
29
40
|
// We will append it as an overlay step.
|
|
30
|
-
preamble += `\
|
|
41
|
+
preamble += `\n7. Read .claude/CLAUDE.md (Claude-specific workflow overlay)`;
|
|
31
42
|
}
|
|
32
43
|
return preamble;
|
|
33
44
|
}
|
|
@@ -41,66 +52,58 @@ export class ClaudeCodeStrategy extends BaseSpawnStrategy {
|
|
|
41
52
|
}
|
|
42
53
|
/**
|
|
43
54
|
* Strategy for Gemini CLI (Multimodal/Ecosystem)
|
|
55
|
+
* Uses default getSkillLoadingInstruction from base class
|
|
44
56
|
*/
|
|
45
57
|
export class GeminiCliStrategy extends BaseSpawnStrategy {
|
|
46
58
|
getPreamble(wuId) {
|
|
47
59
|
let preamble = this.getCorePreamble(wuId);
|
|
48
60
|
if (existsSync('GEMINI.md')) {
|
|
49
|
-
preamble += `\
|
|
61
|
+
preamble += `\n7. Read GEMINI.md (Gemini-specific workflow overlay)`;
|
|
50
62
|
}
|
|
51
63
|
return preamble;
|
|
52
64
|
}
|
|
53
|
-
getSkillLoadingInstruction() {
|
|
54
|
-
return `## Skills Selection
|
|
55
|
-
|
|
56
|
-
1. Check \`.lumenflow/agents\` for available skills.
|
|
57
|
-
2. Select relevant skills for this task.`;
|
|
58
|
-
}
|
|
59
65
|
}
|
|
60
66
|
/**
|
|
61
67
|
* Generic Strategy (Unknown/Other clients)
|
|
68
|
+
* Uses default getSkillLoadingInstruction from base class
|
|
62
69
|
*/
|
|
63
70
|
export class GenericStrategy extends BaseSpawnStrategy {
|
|
64
71
|
getPreamble(wuId) {
|
|
65
72
|
return this.getCorePreamble(wuId);
|
|
66
73
|
}
|
|
67
|
-
getSkillLoadingInstruction() {
|
|
68
|
-
return `## Skills Selection
|
|
69
|
-
|
|
70
|
-
1. Check \`.lumenflow/agents\` for available skills.
|
|
71
|
-
2. Select relevant skills for this task.`;
|
|
72
|
-
}
|
|
73
74
|
}
|
|
74
75
|
/**
|
|
75
|
-
*
|
|
76
|
+
* Create a strategy for the given client
|
|
77
|
+
* @param clientName - Client name (e.g. 'claude-code', 'gemini-cli')
|
|
76
78
|
*/
|
|
77
|
-
export
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
return new GenericStrategy();
|
|
100
|
-
default:
|
|
101
|
-
// Warn? The factory just creates. The caller should warn if it fell back.
|
|
102
|
-
// But here we just return Generic.
|
|
103
|
-
return new GenericStrategy();
|
|
104
|
-
}
|
|
79
|
+
export function createSpawnStrategy(clientName) {
|
|
80
|
+
switch (clientName.toLowerCase()) {
|
|
81
|
+
case 'claude': // Legacy alias
|
|
82
|
+
case 'claude-code':
|
|
83
|
+
return new ClaudeCodeStrategy();
|
|
84
|
+
case 'gemini': // Alias
|
|
85
|
+
case 'gemini-cli':
|
|
86
|
+
return new GeminiCliStrategy();
|
|
87
|
+
case 'codex': // Deprecated alias
|
|
88
|
+
case 'codex-cli':
|
|
89
|
+
// Codex might need its own strategy later (sandbox), but for now generic or claude-like?
|
|
90
|
+
// Plan says: "codex: preamble: false, strategy: cloud-sandbox" -> implies Generic or dedicated.
|
|
91
|
+
// For now, let's map to Generic but maybe we should add CodexStrategy if it has diff behavior.
|
|
92
|
+
// Re-reading plan: "CodexStrategy: Emphasizes cloud sandbox constraints"
|
|
93
|
+
// But for this "Minimal" pass, let's stick to Generic with a comment,
|
|
94
|
+
// OR essentially treat it as Generic since we don't have constraints logic here yet (it's in wu-spawn).
|
|
95
|
+
// Actually, let's return GenericStrategy but we might handle constraints elsewhere.
|
|
96
|
+
return new GenericStrategy();
|
|
97
|
+
default:
|
|
98
|
+
// Warn? The factory just creates. The caller should warn if it fell back.
|
|
99
|
+
// But here we just return Generic.
|
|
100
|
+
return new GenericStrategy();
|
|
105
101
|
}
|
|
106
102
|
}
|
|
103
|
+
/**
|
|
104
|
+
* Factory for creating strategies (legacy wrapper)
|
|
105
|
+
* @deprecated Use createSpawnStrategy function directly
|
|
106
|
+
*/
|
|
107
|
+
export const SpawnStrategyFactory = {
|
|
108
|
+
create: createSpawnStrategy,
|
|
109
|
+
};
|
package/dist/spawn-tree.d.ts
CHANGED
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
* Integrates with spawn-registry-store and spawn-registry-schema.
|
|
9
9
|
* No external tree library needed - logic is tightly coupled to spawn data model.
|
|
10
10
|
*
|
|
11
|
-
* @see {@link
|
|
12
|
-
* @see {@link
|
|
13
|
-
* @see {@link
|
|
11
|
+
* @see {@link packages/@lumenflow/cli/src/__tests__/spawn-list.test.ts} - Tests
|
|
12
|
+
* @see {@link packages/@lumenflow/cli/src/spawn-list.ts} - CLI command
|
|
13
|
+
* @see {@link packages/@lumenflow/cli/src/lib/spawn-registry-store.ts} - Data source
|
|
14
14
|
*/
|
|
15
15
|
/**
|
|
16
16
|
* Status indicators for terminal output.
|
package/dist/spawn-tree.js
CHANGED
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
* Integrates with spawn-registry-store and spawn-registry-schema.
|
|
9
9
|
* No external tree library needed - logic is tightly coupled to spawn data model.
|
|
10
10
|
*
|
|
11
|
-
* @see {@link
|
|
12
|
-
* @see {@link
|
|
13
|
-
* @see {@link
|
|
11
|
+
* @see {@link packages/@lumenflow/cli/src/__tests__/spawn-list.test.ts} - Tests
|
|
12
|
+
* @see {@link packages/@lumenflow/cli/src/spawn-list.ts} - CLI command
|
|
13
|
+
* @see {@link packages/@lumenflow/cli/src/lib/spawn-registry-store.ts} - Data source
|
|
14
14
|
*/
|
|
15
15
|
import fs from 'node:fs/promises';
|
|
16
16
|
import path from 'node:path';
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* State Cleanup Core (WU-1208)
|
|
3
|
+
*
|
|
4
|
+
* Unified orchestration of all state cleanup operations:
|
|
5
|
+
* - Signal cleanup (TTL-based, from @lumenflow/memory)
|
|
6
|
+
* - Memory cleanup (lifecycle-based, from @lumenflow/memory)
|
|
7
|
+
* - Event archival (age-based, from @lumenflow/core)
|
|
8
|
+
*
|
|
9
|
+
* Cleanup order: signals -> memory -> events (dependency order)
|
|
10
|
+
*
|
|
11
|
+
* Design principles:
|
|
12
|
+
* - Non-fatal errors: failures in one cleanup type don't block others
|
|
13
|
+
* - Consistent summary: aggregated counts for all cleanup types
|
|
14
|
+
* - Configurable: supports --dry-run and type-specific flags
|
|
15
|
+
*
|
|
16
|
+
* @see {@link packages/@lumenflow/cli/src/state-cleanup.ts} - CLI wrapper
|
|
17
|
+
* @see {@link packages/@lumenflow/core/src/__tests__/state-cleanup-core.test.ts} - Tests
|
|
18
|
+
*/
|
|
19
|
+
/**
|
|
20
|
+
* Cleanup types supported by state:cleanup
|
|
21
|
+
*/
|
|
22
|
+
export type CleanupType = 'signals' | 'memory' | 'events';
|
|
23
|
+
/**
|
|
24
|
+
* Signal cleanup result (from @lumenflow/memory/signal-cleanup-core)
|
|
25
|
+
*/
|
|
26
|
+
export interface SignalCleanupResult {
|
|
27
|
+
success: boolean;
|
|
28
|
+
removedIds: string[];
|
|
29
|
+
retainedIds: string[];
|
|
30
|
+
bytesFreed: number;
|
|
31
|
+
compactionRatio: number;
|
|
32
|
+
dryRun?: boolean;
|
|
33
|
+
breakdown: {
|
|
34
|
+
ttlExpired: number;
|
|
35
|
+
unreadTtlExpired: number;
|
|
36
|
+
countLimitExceeded: number;
|
|
37
|
+
activeWuProtected: number;
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Memory cleanup result (from @lumenflow/memory/mem-cleanup-core)
|
|
42
|
+
*/
|
|
43
|
+
export interface MemoryCleanupResult {
|
|
44
|
+
success: boolean;
|
|
45
|
+
removedIds: string[];
|
|
46
|
+
retainedIds: string[];
|
|
47
|
+
bytesFreed: number;
|
|
48
|
+
compactionRatio: number;
|
|
49
|
+
dryRun?: boolean;
|
|
50
|
+
breakdown: {
|
|
51
|
+
ephemeral: number;
|
|
52
|
+
session: number;
|
|
53
|
+
wu: number;
|
|
54
|
+
sensitive: number;
|
|
55
|
+
ttlExpired: number;
|
|
56
|
+
activeSessionProtected: number;
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Event archival result (from @lumenflow/core/wu-events-cleanup)
|
|
61
|
+
*/
|
|
62
|
+
export interface EventArchivalResult {
|
|
63
|
+
success: boolean;
|
|
64
|
+
archivedWuIds: string[];
|
|
65
|
+
retainedWuIds: string[];
|
|
66
|
+
archivedEventCount: number;
|
|
67
|
+
retainedEventCount: number;
|
|
68
|
+
bytesArchived: number;
|
|
69
|
+
dryRun?: boolean;
|
|
70
|
+
breakdown: {
|
|
71
|
+
archivedOlderThanThreshold: number;
|
|
72
|
+
retainedActiveWu: number;
|
|
73
|
+
retainedWithinThreshold: number;
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Signal cleanup function type
|
|
78
|
+
*/
|
|
79
|
+
export type CleanupSignalsFn = (baseDir: string, options: {
|
|
80
|
+
dryRun?: boolean;
|
|
81
|
+
}) => Promise<SignalCleanupResult>;
|
|
82
|
+
/**
|
|
83
|
+
* Memory cleanup function type
|
|
84
|
+
*/
|
|
85
|
+
export type CleanupMemoryFn = (baseDir: string, options: {
|
|
86
|
+
dryRun?: boolean;
|
|
87
|
+
}) => Promise<MemoryCleanupResult>;
|
|
88
|
+
/**
|
|
89
|
+
* Event archival function type
|
|
90
|
+
*/
|
|
91
|
+
export type ArchiveEventsFn = (baseDir: string, options: {
|
|
92
|
+
dryRun?: boolean;
|
|
93
|
+
}) => Promise<EventArchivalResult>;
|
|
94
|
+
/**
|
|
95
|
+
* Error that occurred during a specific cleanup type
|
|
96
|
+
*/
|
|
97
|
+
export interface CleanupError {
|
|
98
|
+
type: CleanupType;
|
|
99
|
+
message: string;
|
|
100
|
+
error?: Error;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Summary of signal cleanup
|
|
104
|
+
*/
|
|
105
|
+
export interface SignalCleanupSummary {
|
|
106
|
+
removedCount: number;
|
|
107
|
+
retainedCount: number;
|
|
108
|
+
bytesFreed: number;
|
|
109
|
+
breakdown: SignalCleanupResult['breakdown'];
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Summary of memory cleanup
|
|
113
|
+
*/
|
|
114
|
+
export interface MemoryCleanupSummary {
|
|
115
|
+
removedCount: number;
|
|
116
|
+
retainedCount: number;
|
|
117
|
+
bytesFreed: number;
|
|
118
|
+
breakdown: MemoryCleanupResult['breakdown'];
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Summary of event archival
|
|
122
|
+
*/
|
|
123
|
+
export interface EventArchivalSummary {
|
|
124
|
+
archivedWuCount: number;
|
|
125
|
+
retainedWuCount: number;
|
|
126
|
+
archivedEventCount: number;
|
|
127
|
+
retainedEventCount: number;
|
|
128
|
+
bytesArchived: number;
|
|
129
|
+
breakdown: EventArchivalResult['breakdown'];
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Overall summary of state cleanup
|
|
133
|
+
*/
|
|
134
|
+
export interface StateCleanupSummary {
|
|
135
|
+
totalBytesFreed: number;
|
|
136
|
+
typesExecuted: CleanupType[];
|
|
137
|
+
typesSkipped: CleanupType[];
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Options for unified state cleanup
|
|
141
|
+
*/
|
|
142
|
+
export interface StateCleanupOptions {
|
|
143
|
+
/** If true, preview without modifications */
|
|
144
|
+
dryRun?: boolean;
|
|
145
|
+
/** Only execute signal cleanup */
|
|
146
|
+
signalsOnly?: boolean;
|
|
147
|
+
/** Only execute memory cleanup */
|
|
148
|
+
memoryOnly?: boolean;
|
|
149
|
+
/** Only execute event archival */
|
|
150
|
+
eventsOnly?: boolean;
|
|
151
|
+
/** Signal cleanup function (injectable for testing) */
|
|
152
|
+
cleanupSignals?: CleanupSignalsFn;
|
|
153
|
+
/** Memory cleanup function (injectable for testing) */
|
|
154
|
+
cleanupMemory?: CleanupMemoryFn;
|
|
155
|
+
/** Event archival function (injectable for testing) */
|
|
156
|
+
archiveEvents?: ArchiveEventsFn;
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Result of unified state cleanup
|
|
160
|
+
*/
|
|
161
|
+
export interface StateCleanupResult {
|
|
162
|
+
/** Whether all executed cleanups succeeded */
|
|
163
|
+
success: boolean;
|
|
164
|
+
/** True if in dry-run mode */
|
|
165
|
+
dryRun?: boolean;
|
|
166
|
+
/** Signal cleanup summary (undefined if skipped) */
|
|
167
|
+
signals?: SignalCleanupSummary;
|
|
168
|
+
/** Memory cleanup summary (undefined if skipped) */
|
|
169
|
+
memory?: MemoryCleanupSummary;
|
|
170
|
+
/** Event archival summary (undefined if skipped) */
|
|
171
|
+
events?: EventArchivalSummary;
|
|
172
|
+
/** Errors from failed cleanups (non-fatal) */
|
|
173
|
+
errors: CleanupError[];
|
|
174
|
+
/** Aggregated summary */
|
|
175
|
+
summary: StateCleanupSummary;
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Orchestrate all state cleanup operations in dependency order.
|
|
179
|
+
*
|
|
180
|
+
* Executes cleanups in order: signals -> memory -> events
|
|
181
|
+
*
|
|
182
|
+
* Non-fatal: failures in one cleanup type don't block others.
|
|
183
|
+
* All errors are collected and reported in the result.
|
|
184
|
+
*
|
|
185
|
+
* @param baseDir - Project base directory
|
|
186
|
+
* @param options - State cleanup options
|
|
187
|
+
* @returns Unified cleanup result with summaries and errors
|
|
188
|
+
*
|
|
189
|
+
* @example
|
|
190
|
+
* // Full cleanup with dry-run
|
|
191
|
+
* const result = await cleanupState(baseDir, { dryRun: true });
|
|
192
|
+
*
|
|
193
|
+
* @example
|
|
194
|
+
* // Signals only
|
|
195
|
+
* const result = await cleanupState(baseDir, { signalsOnly: true });
|
|
196
|
+
*
|
|
197
|
+
* @example
|
|
198
|
+
* // With injected cleanup functions (for testing or custom implementations)
|
|
199
|
+
* const result = await cleanupState(baseDir, {
|
|
200
|
+
* cleanupSignals: myCustomSignalCleanup,
|
|
201
|
+
* cleanupMemory: myCustomMemoryCleanup,
|
|
202
|
+
* archiveEvents: myCustomEventArchival,
|
|
203
|
+
* });
|
|
204
|
+
*/
|
|
205
|
+
export declare function cleanupState(baseDir: string, options?: StateCleanupOptions): Promise<StateCleanupResult>;
|