@soleri/core 2.1.0 → 2.4.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/brain/brain.d.ts +3 -1
- package/dist/brain/brain.d.ts.map +1 -1
- package/dist/brain/brain.js +60 -4
- package/dist/brain/brain.js.map +1 -1
- package/dist/brain/intelligence.d.ts +36 -1
- package/dist/brain/intelligence.d.ts.map +1 -1
- package/dist/brain/intelligence.js +119 -14
- package/dist/brain/intelligence.js.map +1 -1
- package/dist/brain/types.d.ts +32 -0
- package/dist/brain/types.d.ts.map +1 -1
- package/dist/control/identity-manager.d.ts +22 -0
- package/dist/control/identity-manager.d.ts.map +1 -0
- package/dist/control/identity-manager.js +233 -0
- package/dist/control/identity-manager.js.map +1 -0
- package/dist/control/intent-router.d.ts +32 -0
- package/dist/control/intent-router.d.ts.map +1 -0
- package/dist/control/intent-router.js +242 -0
- package/dist/control/intent-router.js.map +1 -0
- package/dist/control/types.d.ts +68 -0
- package/dist/control/types.d.ts.map +1 -0
- package/dist/control/types.js +9 -0
- package/dist/control/types.js.map +1 -0
- package/dist/curator/curator.d.ts +29 -0
- package/dist/curator/curator.d.ts.map +1 -1
- package/dist/curator/curator.js +135 -0
- package/dist/curator/curator.js.map +1 -1
- package/dist/facades/types.d.ts +1 -1
- package/dist/governance/governance.d.ts +42 -0
- package/dist/governance/governance.d.ts.map +1 -0
- package/dist/governance/governance.js +488 -0
- package/dist/governance/governance.js.map +1 -0
- package/dist/governance/index.d.ts +3 -0
- package/dist/governance/index.d.ts.map +1 -0
- package/dist/governance/index.js +2 -0
- package/dist/governance/index.js.map +1 -0
- package/dist/governance/types.d.ts +102 -0
- package/dist/governance/types.d.ts.map +1 -0
- package/dist/governance/types.js +3 -0
- package/dist/governance/types.js.map +1 -0
- package/dist/index.d.ts +32 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +29 -1
- package/dist/index.js.map +1 -1
- package/dist/logging/logger.d.ts +37 -0
- package/dist/logging/logger.d.ts.map +1 -0
- package/dist/logging/logger.js +145 -0
- package/dist/logging/logger.js.map +1 -0
- package/dist/logging/types.d.ts +19 -0
- package/dist/logging/types.d.ts.map +1 -0
- package/dist/logging/types.js +2 -0
- package/dist/logging/types.js.map +1 -0
- package/dist/loop/loop-manager.d.ts +49 -0
- package/dist/loop/loop-manager.d.ts.map +1 -0
- package/dist/loop/loop-manager.js +105 -0
- package/dist/loop/loop-manager.js.map +1 -0
- package/dist/loop/types.d.ts +35 -0
- package/dist/loop/types.d.ts.map +1 -0
- package/dist/loop/types.js +8 -0
- package/dist/loop/types.js.map +1 -0
- package/dist/planning/gap-analysis.d.ts +29 -0
- package/dist/planning/gap-analysis.d.ts.map +1 -0
- package/dist/planning/gap-analysis.js +265 -0
- package/dist/planning/gap-analysis.js.map +1 -0
- package/dist/planning/gap-types.d.ts +29 -0
- package/dist/planning/gap-types.d.ts.map +1 -0
- package/dist/planning/gap-types.js +28 -0
- package/dist/planning/gap-types.js.map +1 -0
- package/dist/planning/planner.d.ts +150 -1
- package/dist/planning/planner.d.ts.map +1 -1
- package/dist/planning/planner.js +365 -2
- package/dist/planning/planner.js.map +1 -1
- package/dist/project/project-registry.d.ts +79 -0
- package/dist/project/project-registry.d.ts.map +1 -0
- package/dist/project/project-registry.js +276 -0
- package/dist/project/project-registry.js.map +1 -0
- package/dist/project/types.d.ts +28 -0
- package/dist/project/types.d.ts.map +1 -0
- package/dist/project/types.js +5 -0
- package/dist/project/types.js.map +1 -0
- package/dist/runtime/admin-extra-ops.d.ts +13 -0
- package/dist/runtime/admin-extra-ops.d.ts.map +1 -0
- package/dist/runtime/admin-extra-ops.js +284 -0
- package/dist/runtime/admin-extra-ops.js.map +1 -0
- package/dist/runtime/admin-ops.d.ts +15 -0
- package/dist/runtime/admin-ops.d.ts.map +1 -0
- package/dist/runtime/admin-ops.js +322 -0
- package/dist/runtime/admin-ops.js.map +1 -0
- package/dist/runtime/capture-ops.d.ts +15 -0
- package/dist/runtime/capture-ops.d.ts.map +1 -0
- package/dist/runtime/capture-ops.js +345 -0
- package/dist/runtime/capture-ops.js.map +1 -0
- package/dist/runtime/core-ops.d.ts +7 -3
- package/dist/runtime/core-ops.d.ts.map +1 -1
- package/dist/runtime/core-ops.js +474 -8
- package/dist/runtime/core-ops.js.map +1 -1
- package/dist/runtime/curator-extra-ops.d.ts +9 -0
- package/dist/runtime/curator-extra-ops.d.ts.map +1 -0
- package/dist/runtime/curator-extra-ops.js +59 -0
- package/dist/runtime/curator-extra-ops.js.map +1 -0
- package/dist/runtime/domain-ops.d.ts.map +1 -1
- package/dist/runtime/domain-ops.js +59 -13
- package/dist/runtime/domain-ops.js.map +1 -1
- package/dist/runtime/grading-ops.d.ts +14 -0
- package/dist/runtime/grading-ops.d.ts.map +1 -0
- package/dist/runtime/grading-ops.js +105 -0
- package/dist/runtime/grading-ops.js.map +1 -0
- package/dist/runtime/loop-ops.d.ts +13 -0
- package/dist/runtime/loop-ops.d.ts.map +1 -0
- package/dist/runtime/loop-ops.js +179 -0
- package/dist/runtime/loop-ops.js.map +1 -0
- package/dist/runtime/memory-cross-project-ops.d.ts +12 -0
- package/dist/runtime/memory-cross-project-ops.d.ts.map +1 -0
- package/dist/runtime/memory-cross-project-ops.js +165 -0
- package/dist/runtime/memory-cross-project-ops.js.map +1 -0
- package/dist/runtime/memory-extra-ops.d.ts +13 -0
- package/dist/runtime/memory-extra-ops.d.ts.map +1 -0
- package/dist/runtime/memory-extra-ops.js +173 -0
- package/dist/runtime/memory-extra-ops.js.map +1 -0
- package/dist/runtime/orchestrate-ops.d.ts +17 -0
- package/dist/runtime/orchestrate-ops.d.ts.map +1 -0
- package/dist/runtime/orchestrate-ops.js +240 -0
- package/dist/runtime/orchestrate-ops.js.map +1 -0
- package/dist/runtime/planning-extra-ops.d.ts +17 -0
- package/dist/runtime/planning-extra-ops.d.ts.map +1 -0
- package/dist/runtime/planning-extra-ops.js +300 -0
- package/dist/runtime/planning-extra-ops.js.map +1 -0
- package/dist/runtime/project-ops.d.ts +15 -0
- package/dist/runtime/project-ops.d.ts.map +1 -0
- package/dist/runtime/project-ops.js +181 -0
- package/dist/runtime/project-ops.js.map +1 -0
- package/dist/runtime/runtime.d.ts.map +1 -1
- package/dist/runtime/runtime.js +44 -1
- package/dist/runtime/runtime.js.map +1 -1
- package/dist/runtime/types.d.ts +21 -0
- package/dist/runtime/types.d.ts.map +1 -1
- package/dist/runtime/vault-extra-ops.d.ts +9 -0
- package/dist/runtime/vault-extra-ops.d.ts.map +1 -0
- package/dist/runtime/vault-extra-ops.js +195 -0
- package/dist/runtime/vault-extra-ops.js.map +1 -0
- package/dist/telemetry/telemetry.d.ts +48 -0
- package/dist/telemetry/telemetry.d.ts.map +1 -0
- package/dist/telemetry/telemetry.js +87 -0
- package/dist/telemetry/telemetry.js.map +1 -0
- package/dist/vault/vault.d.ts +94 -0
- package/dist/vault/vault.d.ts.map +1 -1
- package/dist/vault/vault.js +340 -1
- package/dist/vault/vault.js.map +1 -1
- package/package.json +1 -1
- package/src/__tests__/admin-extra-ops.test.ts +420 -0
- package/src/__tests__/admin-ops.test.ts +271 -0
- package/src/__tests__/brain-intelligence.test.ts +205 -0
- package/src/__tests__/brain.test.ts +131 -0
- package/src/__tests__/capture-ops.test.ts +509 -0
- package/src/__tests__/core-ops.test.ts +266 -2
- package/src/__tests__/curator-extra-ops.test.ts +359 -0
- package/src/__tests__/domain-ops.test.ts +66 -0
- package/src/__tests__/governance.test.ts +522 -0
- package/src/__tests__/grading-ops.test.ts +340 -0
- package/src/__tests__/identity-manager.test.ts +243 -0
- package/src/__tests__/intent-router.test.ts +222 -0
- package/src/__tests__/logger.test.ts +200 -0
- package/src/__tests__/loop-ops.test.ts +398 -0
- package/src/__tests__/memory-cross-project-ops.test.ts +246 -0
- package/src/__tests__/memory-extra-ops.test.ts +352 -0
- package/src/__tests__/orchestrate-ops.test.ts +284 -0
- package/src/__tests__/planner.test.ts +331 -0
- package/src/__tests__/planning-extra-ops.test.ts +548 -0
- package/src/__tests__/project-ops.test.ts +367 -0
- package/src/__tests__/vault-extra-ops.test.ts +407 -0
- package/src/brain/brain.ts +114 -7
- package/src/brain/intelligence.ts +179 -10
- package/src/brain/types.ts +38 -0
- package/src/control/identity-manager.ts +354 -0
- package/src/control/intent-router.ts +326 -0
- package/src/control/types.ts +102 -0
- package/src/curator/curator.ts +213 -0
- package/src/governance/governance.ts +698 -0
- package/src/governance/index.ts +18 -0
- package/src/governance/types.ts +111 -0
- package/src/index.ts +102 -2
- package/src/logging/logger.ts +154 -0
- package/src/logging/types.ts +21 -0
- package/src/loop/loop-manager.ts +130 -0
- package/src/loop/types.ts +44 -0
- package/src/planning/gap-analysis.ts +506 -0
- package/src/planning/gap-types.ts +58 -0
- package/src/planning/planner.ts +478 -2
- package/src/project/project-registry.ts +358 -0
- package/src/project/types.ts +31 -0
- package/src/runtime/admin-extra-ops.ts +307 -0
- package/src/runtime/admin-ops.ts +329 -0
- package/src/runtime/capture-ops.ts +385 -0
- package/src/runtime/core-ops.ts +535 -7
- package/src/runtime/curator-extra-ops.ts +71 -0
- package/src/runtime/domain-ops.ts +65 -13
- package/src/runtime/grading-ops.ts +121 -0
- package/src/runtime/loop-ops.ts +194 -0
- package/src/runtime/memory-cross-project-ops.ts +192 -0
- package/src/runtime/memory-extra-ops.ts +186 -0
- package/src/runtime/orchestrate-ops.ts +272 -0
- package/src/runtime/planning-extra-ops.ts +327 -0
- package/src/runtime/project-ops.ts +196 -0
- package/src/runtime/runtime.ts +49 -1
- package/src/runtime/types.ts +21 -0
- package/src/runtime/vault-extra-ops.ts +225 -0
- package/src/telemetry/telemetry.ts +118 -0
- package/src/vault/vault.ts +412 -1
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
export type PolicyType = 'quota' | 'retention' | 'auto-capture';
|
|
2
|
+
export type PolicyPreset = 'strict' | 'moderate' | 'permissive';
|
|
3
|
+
export type PolicyAction = 'capture' | 'quarantine' | 'reject' | 'propose';
|
|
4
|
+
export interface QuotaPolicy {
|
|
5
|
+
maxEntriesTotal: number;
|
|
6
|
+
maxEntriesPerCategory: number;
|
|
7
|
+
maxEntriesPerType: number;
|
|
8
|
+
warnAtPercent: number;
|
|
9
|
+
}
|
|
10
|
+
export interface RetentionPolicy {
|
|
11
|
+
archiveAfterDays: number;
|
|
12
|
+
minHitsToKeep: number;
|
|
13
|
+
deleteArchivedAfterDays: number;
|
|
14
|
+
}
|
|
15
|
+
export interface AutoCapturePolicy {
|
|
16
|
+
enabled: boolean;
|
|
17
|
+
requireReview: boolean;
|
|
18
|
+
maxPendingProposals: number;
|
|
19
|
+
autoExpireDays: number;
|
|
20
|
+
}
|
|
21
|
+
export interface VaultPolicy {
|
|
22
|
+
projectPath: string;
|
|
23
|
+
quotas: QuotaPolicy;
|
|
24
|
+
retention: RetentionPolicy;
|
|
25
|
+
autoCapture: AutoCapturePolicy;
|
|
26
|
+
}
|
|
27
|
+
export interface QuotaStatus {
|
|
28
|
+
total: number;
|
|
29
|
+
maxTotal: number;
|
|
30
|
+
byCategory: Record<string, number>;
|
|
31
|
+
byType: Record<string, number>;
|
|
32
|
+
warnAtPercent: number;
|
|
33
|
+
isWarning: boolean;
|
|
34
|
+
}
|
|
35
|
+
export interface PolicyDecision {
|
|
36
|
+
allowed: boolean;
|
|
37
|
+
action: PolicyAction;
|
|
38
|
+
reason?: string;
|
|
39
|
+
quotaStatus?: QuotaStatus;
|
|
40
|
+
}
|
|
41
|
+
export interface BatchDecision {
|
|
42
|
+
entry: {
|
|
43
|
+
type: string;
|
|
44
|
+
category: string;
|
|
45
|
+
title?: string;
|
|
46
|
+
};
|
|
47
|
+
decision: PolicyDecision;
|
|
48
|
+
}
|
|
49
|
+
export interface PolicyAuditEntry {
|
|
50
|
+
id: number;
|
|
51
|
+
projectPath: string;
|
|
52
|
+
policyType: string;
|
|
53
|
+
oldConfig: Record<string, unknown> | null;
|
|
54
|
+
newConfig: Record<string, unknown>;
|
|
55
|
+
changedBy: string | null;
|
|
56
|
+
changedAt: number;
|
|
57
|
+
}
|
|
58
|
+
export type ProposalStatus = 'pending' | 'approved' | 'rejected' | 'modified' | 'expired';
|
|
59
|
+
export interface Proposal {
|
|
60
|
+
id: number;
|
|
61
|
+
projectPath: string;
|
|
62
|
+
entryId: string | null;
|
|
63
|
+
title: string;
|
|
64
|
+
type: string;
|
|
65
|
+
category: string;
|
|
66
|
+
proposedData: Record<string, unknown>;
|
|
67
|
+
status: ProposalStatus;
|
|
68
|
+
proposedAt: number;
|
|
69
|
+
decidedAt: number | null;
|
|
70
|
+
decidedBy: string | null;
|
|
71
|
+
modificationNote: string | null;
|
|
72
|
+
source: string;
|
|
73
|
+
}
|
|
74
|
+
export interface ProposalStats {
|
|
75
|
+
total: number;
|
|
76
|
+
pending: number;
|
|
77
|
+
approved: number;
|
|
78
|
+
rejected: number;
|
|
79
|
+
modified: number;
|
|
80
|
+
expired: number;
|
|
81
|
+
acceptanceRate: number;
|
|
82
|
+
byCategory: Record<string, {
|
|
83
|
+
total: number;
|
|
84
|
+
accepted: number;
|
|
85
|
+
rate: number;
|
|
86
|
+
}>;
|
|
87
|
+
}
|
|
88
|
+
export interface GovernanceDashboard {
|
|
89
|
+
vaultSize: number;
|
|
90
|
+
quotaPercent: number;
|
|
91
|
+
quotaStatus: QuotaStatus;
|
|
92
|
+
pendingProposals: number;
|
|
93
|
+
acceptanceRate: number;
|
|
94
|
+
evaluationTrend: Record<string, number>;
|
|
95
|
+
policySummary: {
|
|
96
|
+
maxEntries: number;
|
|
97
|
+
requireReview: boolean;
|
|
98
|
+
archiveAfterDays: number;
|
|
99
|
+
autoExpireDays: number;
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/governance/types.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG,WAAW,GAAG,cAAc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CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAC/E;AAID,MAAM,WAAW,mBAAmB;IAClC,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,WAAW,CAAC;IACzB,gBAAgB,EAAE,MAAM,CAAC;IACzB,cAAc,EAAE,MAAM,CAAC;IACvB,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACxC,aAAa,EAAE;QACb,UAAU,EAAE,MAAM,CAAC;QACnB,aAAa,EAAE,OAAO,CAAC;QACvB,gBAAgB,EAAE,MAAM,CAAC;QACzB,cAAc,EAAE,MAAM,CAAC;KACxB,CAAC;CACH"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/governance/types.ts"],"names":[],"mappings":"AAAA,uEAAuE"}
|
package/dist/index.d.ts
CHANGED
|
@@ -6,13 +6,21 @@ export { tokenize, calculateTf, calculateTfIdf, cosineSimilarity, jaccardSimilar
|
|
|
6
6
|
export type { SparseVector } from './text/similarity.js';
|
|
7
7
|
export { Curator } from './curator/curator.js';
|
|
8
8
|
export type { EntryStatus, EntrySource, TagNormalizationResult, CanonicalTag, DuplicateCandidate, DuplicateDetectionResult, Contradiction, ContradictionStatus, GroomResult, GroomAllResult, ConsolidationOptions, ConsolidationResult, ChangelogEntry, HealthMetrics, HealthAuditResult, CuratorStatus, } from './curator/types.js';
|
|
9
|
+
export { Governance } from './governance/governance.js';
|
|
10
|
+
export type { PolicyType, PolicyPreset, PolicyAction, QuotaPolicy, RetentionPolicy, AutoCapturePolicy, VaultPolicy, QuotaStatus, PolicyDecision, BatchDecision, PolicyAuditEntry, ProposalStatus, Proposal, ProposalStats, GovernanceDashboard, } from './governance/types.js';
|
|
9
11
|
export { Brain } from './brain/brain.js';
|
|
10
12
|
export { BrainIntelligence } from './brain/intelligence.js';
|
|
11
|
-
export type { ScoringWeights, ScoreBreakdown, RankedResult, SearchOptions, CaptureResult, BrainStats, QueryContext, PatternStrength, StrengthsQuery, BrainSession, SessionLifecycleInput, KnowledgeProposal, ExtractionResult, GlobalPattern, DomainProfile, BuildIntelligenceResult, BrainIntelligenceStats, SessionContext, BrainExportData, BrainImportResult, } from './brain/types.js';
|
|
13
|
+
export type { ScoringWeights, ScoreBreakdown, RankedResult, SearchOptions, CaptureResult, BrainStats, QueryContext, FeedbackType, FeedbackSource, FeedbackInput, FeedbackEntry, FeedbackStats, PatternStrength, StrengthsQuery, BrainSession, SessionLifecycleInput, KnowledgeProposal, ExtractionResult, GlobalPattern, DomainProfile, BuildIntelligenceResult, BrainIntelligenceStats, SessionContext, BrainExportData, BrainImportResult, } from './brain/types.js';
|
|
12
14
|
export { CogneeClient } from './cognee/client.js';
|
|
13
15
|
export type { CogneeConfig, CogneeSearchResult, CogneeSearchType, CogneeStatus, CogneeAddResult, CogneeCognifyResult, } from './cognee/types.js';
|
|
14
|
-
export { Planner } from './planning/planner.js';
|
|
15
|
-
export type { PlanStatus, TaskStatus, PlanTask, Plan, PlanStore } from './planning/planner.js';
|
|
16
|
+
export { Planner, calculateScore } from './planning/planner.js';
|
|
17
|
+
export type { PlanStatus, TaskStatus, PlanTask, Plan, PlanStore, DriftItem, ReconciliationReport, ReviewEvidence, PlanGrade, PlanCheck, } from './planning/planner.js';
|
|
18
|
+
export { runGapAnalysis } from './planning/gap-analysis.js';
|
|
19
|
+
export type { GapAnalysisOptions, GapAnalysisPass } from './planning/gap-analysis.js';
|
|
20
|
+
export { SEVERITY_WEIGHTS, CATEGORY_PENALTY_CAPS, MIN_OBJECTIVE_LENGTH, MIN_SCOPE_LENGTH, MIN_DECISION_LENGTH, generateGapId, } from './planning/gap-types.js';
|
|
21
|
+
export type { GapSeverity, GapCategory, PlanGap } from './planning/gap-types.js';
|
|
22
|
+
export { LoopManager } from './loop/loop-manager.js';
|
|
23
|
+
export type { LoopMode, LoopConfig, LoopIteration, LoopStatus, LoopState, } from './loop/types.js';
|
|
16
24
|
export { SecretString, LLMError } from './llm/types.js';
|
|
17
25
|
export type { LLMCallOptions, LLMCallResult, CircuitState, CircuitBreakerConfig, CircuitBreakerSnapshot, KeyPoolConfig, KeyStatus, RouteEntry, RoutingConfig, RateLimitInfo, RetryConfig, } from './llm/types.js';
|
|
18
26
|
export { CircuitBreaker, CircuitOpenError, computeDelay, retry, parseRateLimitHeaders, } from './llm/utils.js';
|
|
@@ -22,8 +30,29 @@ export { registerFacade, registerAllFacades } from './facades/facade-factory.js'
|
|
|
22
30
|
export { facadeInputSchema } from './facades/types.js';
|
|
23
31
|
export type { OpHandler, AuthLevel, OpDefinition, FacadeConfig, FacadeResponse, FacadeInput, } from './facades/types.js';
|
|
24
32
|
export { LLMClient } from './llm/llm-client.js';
|
|
33
|
+
export { IdentityManager } from './control/identity-manager.js';
|
|
34
|
+
export { IntentRouter } from './control/intent-router.js';
|
|
35
|
+
export type { GuidelineCategory, Guideline, AgentIdentity, IdentityVersion, IdentityUpdateInput, GuidelineInput, IntentType, OperationalMode, IntentClassification, ModeConfig, MorphResult, } from './control/types.js';
|
|
36
|
+
export { ProjectRegistry } from './project/project-registry.js';
|
|
37
|
+
export type { RegisteredProject, ProjectRule, LinkType, ProjectLink } from './project/types.js';
|
|
38
|
+
export { Telemetry } from './telemetry/telemetry.js';
|
|
39
|
+
export type { FacadeCall, TelemetryStats } from './telemetry/telemetry.js';
|
|
40
|
+
export { Logger, createLogger } from './logging/logger.js';
|
|
41
|
+
export type { LogLevel, LogEntry, LogContext, LoggerConfig } from './logging/types.js';
|
|
25
42
|
export { createAgentRuntime } from './runtime/runtime.js';
|
|
26
43
|
export { createCoreOps } from './runtime/core-ops.js';
|
|
27
44
|
export { createDomainFacade, createDomainFacades } from './runtime/domain-ops.js';
|
|
45
|
+
export { createPlanningExtraOps } from './runtime/planning-extra-ops.js';
|
|
46
|
+
export { createMemoryExtraOps } from './runtime/memory-extra-ops.js';
|
|
47
|
+
export { createVaultExtraOps } from './runtime/vault-extra-ops.js';
|
|
48
|
+
export { createAdminOps } from './runtime/admin-ops.js';
|
|
49
|
+
export { createAdminExtraOps } from './runtime/admin-extra-ops.js';
|
|
50
|
+
export { createLoopOps } from './runtime/loop-ops.js';
|
|
51
|
+
export { createOrchestrateOps } from './runtime/orchestrate-ops.js';
|
|
52
|
+
export { createGradingOps } from './runtime/grading-ops.js';
|
|
53
|
+
export { createCaptureOps } from './runtime/capture-ops.js';
|
|
54
|
+
export { createCuratorExtraOps } from './runtime/curator-extra-ops.js';
|
|
55
|
+
export { createProjectOps } from './runtime/project-ops.js';
|
|
56
|
+
export { createMemoryCrossProjectOps } from './runtime/memory-cross-project-ops.js';
|
|
28
57
|
export type { AgentRuntimeConfig, AgentRuntime } from './runtime/types.js';
|
|
29
58
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,YAAY,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AACrF,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAGhE,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,YAAY,EAAE,YAAY,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAGnG,OAAO,EACL,QAAQ,EACR,WAAW,EACX,cAAc,EACd,gBAAgB,EAChB,iBAAiB,GAClB,MAAM,sBAAsB,CAAC;AAC9B,YAAY,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;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AE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AACvE,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,2BAA2B,EAAE,MAAM,uCAAuC,CAAC;AACpF,YAAY,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -5,13 +5,20 @@ export { Vault } from './vault/vault.js';
|
|
|
5
5
|
export { tokenize, calculateTf, calculateTfIdf, cosineSimilarity, jaccardSimilarity, } from './text/similarity.js';
|
|
6
6
|
// ─── Curator ────────────────────────────────────────────────────────
|
|
7
7
|
export { Curator } from './curator/curator.js';
|
|
8
|
+
// ─── Governance ─────────────────────────────────────────────────────
|
|
9
|
+
export { Governance } from './governance/governance.js';
|
|
8
10
|
// ─── Brain ───────────────────────────────────────────────────────────
|
|
9
11
|
export { Brain } from './brain/brain.js';
|
|
10
12
|
export { BrainIntelligence } from './brain/intelligence.js';
|
|
11
13
|
// ─── Cognee ─────────────────────────────────────────────────────────
|
|
12
14
|
export { CogneeClient } from './cognee/client.js';
|
|
13
15
|
// ─── Planning ────────────────────────────────────────────────────────
|
|
14
|
-
export { Planner } from './planning/planner.js';
|
|
16
|
+
export { Planner, calculateScore } from './planning/planner.js';
|
|
17
|
+
// ─── Plan Gap Analysis ──────────────────────────────────────────────
|
|
18
|
+
export { runGapAnalysis } from './planning/gap-analysis.js';
|
|
19
|
+
export { SEVERITY_WEIGHTS, CATEGORY_PENALTY_CAPS, MIN_OBJECTIVE_LENGTH, MIN_SCOPE_LENGTH, MIN_DECISION_LENGTH, generateGapId, } from './planning/gap-types.js';
|
|
20
|
+
// ─── Loop ────────────────────────────────────────────────────────────
|
|
21
|
+
export { LoopManager } from './loop/loop-manager.js';
|
|
15
22
|
// ─── LLM Types ───────────────────────────────────────────────────────
|
|
16
23
|
export { SecretString, LLMError } from './llm/types.js';
|
|
17
24
|
// ─── LLM Utils ───────────────────────────────────────────────────────
|
|
@@ -23,8 +30,29 @@ export { registerFacade, registerAllFacades } from './facades/facade-factory.js'
|
|
|
23
30
|
export { facadeInputSchema } from './facades/types.js';
|
|
24
31
|
// ─── LLM Client ─────────────────────────────────────────────────────
|
|
25
32
|
export { LLMClient } from './llm/llm-client.js';
|
|
33
|
+
// ─── Control ────────────────────────────────────────────────────────
|
|
34
|
+
export { IdentityManager } from './control/identity-manager.js';
|
|
35
|
+
export { IntentRouter } from './control/intent-router.js';
|
|
36
|
+
// ─── Project Registry ──────────────────────────────────────────────
|
|
37
|
+
export { ProjectRegistry } from './project/project-registry.js';
|
|
38
|
+
// ─── Telemetry ─────────────────────────────────────────────────────
|
|
39
|
+
export { Telemetry } from './telemetry/telemetry.js';
|
|
40
|
+
// ─── Logging ────────────────────────────────────────────────────────
|
|
41
|
+
export { Logger, createLogger } from './logging/logger.js';
|
|
26
42
|
// ─── Runtime Factory ────────────────────────────────────────────────
|
|
27
43
|
export { createAgentRuntime } from './runtime/runtime.js';
|
|
28
44
|
export { createCoreOps } from './runtime/core-ops.js';
|
|
29
45
|
export { createDomainFacade, createDomainFacades } from './runtime/domain-ops.js';
|
|
46
|
+
export { createPlanningExtraOps } from './runtime/planning-extra-ops.js';
|
|
47
|
+
export { createMemoryExtraOps } from './runtime/memory-extra-ops.js';
|
|
48
|
+
export { createVaultExtraOps } from './runtime/vault-extra-ops.js';
|
|
49
|
+
export { createAdminOps } from './runtime/admin-ops.js';
|
|
50
|
+
export { createAdminExtraOps } from './runtime/admin-extra-ops.js';
|
|
51
|
+
export { createLoopOps } from './runtime/loop-ops.js';
|
|
52
|
+
export { createOrchestrateOps } from './runtime/orchestrate-ops.js';
|
|
53
|
+
export { createGradingOps } from './runtime/grading-ops.js';
|
|
54
|
+
export { createCaptureOps } from './runtime/capture-ops.js';
|
|
55
|
+
export { createCuratorExtraOps } from './runtime/curator-extra-ops.js';
|
|
56
|
+
export { createProjectOps } from './runtime/project-ops.js';
|
|
57
|
+
export { createMemoryCrossProjectOps } from './runtime/memory-cross-project-ops.js';
|
|
30
58
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAEhE,wEAAwE;AACxE,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAGzC,uEAAuE;AACvE,OAAO,EACL,QAAQ,EACR,WAAW,EACX,cAAc,EACd,gBAAgB,EAChB,iBAAiB,GAClB,MAAM,sBAAsB,CAAC;AAG9B,uEAAuE;AACvE,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAoB/C,wEAAwE;AACxE,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAEhE,wEAAwE;AACxE,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAGzC,uEAAuE;AACvE,OAAO,EACL,QAAQ,EACR,WAAW,EACX,cAAc,EACd,gBAAgB,EAChB,i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logging with daily rotation and 7-day retention.
|
|
6
|
+
*
|
|
7
|
+
* Ported from Salvador MCP's src/utils/logger.ts.
|
|
8
|
+
*/
|
|
9
|
+
import type { LogContext, LoggerConfig } from './types.js';
|
|
10
|
+
export declare class Logger {
|
|
11
|
+
private readonly prefix;
|
|
12
|
+
private readonly minLevel;
|
|
13
|
+
private fileLogDir;
|
|
14
|
+
private fileLogPrefix;
|
|
15
|
+
private currentLogDate;
|
|
16
|
+
private currentLogPath;
|
|
17
|
+
constructor(config?: LoggerConfig);
|
|
18
|
+
/**
|
|
19
|
+
* Enable file-based logging. Output is teed to
|
|
20
|
+
* {dir}/{prefix}-YYYY-MM-DD.log in addition to stderr.
|
|
21
|
+
* Automatically prunes log files older than 7 days.
|
|
22
|
+
*/
|
|
23
|
+
enableFileLog(dir: string, prefix?: string): void;
|
|
24
|
+
debug(message: string, context?: LogContext): void;
|
|
25
|
+
info(message: string, context?: LogContext): void;
|
|
26
|
+
warn(message: string, context?: LogContext): void;
|
|
27
|
+
error(message: string, context?: LogContext): void;
|
|
28
|
+
private log;
|
|
29
|
+
private writeToFile;
|
|
30
|
+
/** Switch to a new log file if the date has changed */
|
|
31
|
+
private rotateFileIfNeeded;
|
|
32
|
+
/** Remove log files older than LOG_RETENTION_DAYS */
|
|
33
|
+
private pruneOldLogs;
|
|
34
|
+
}
|
|
35
|
+
/** Factory function for creating a logger. */
|
|
36
|
+
export declare function createLogger(config?: LoggerConfig): Logger;
|
|
37
|
+
//# sourceMappingURL=logger.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/logging/logger.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,OAAO,KAAK,EAAY,UAAU,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAgBrE,qBAAa,MAAM;IACjB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;IAChC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAS;IAClC,OAAO,CAAC,UAAU,CAAuB;IACzC,OAAO,CAAC,aAAa,CAAS;IAC9B,OAAO,CAAC,cAAc,CAAuB;IAC7C,OAAO,CAAC,cAAc,CAAuB;gBAEjC,MAAM,CAAC,EAAE,YAAY;IAajC;;;;OAIG;IACH,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI;IAQjD,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,UAAU,GAAG,IAAI;IAIlD,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,UAAU,GAAG,IAAI;IAIjD,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,UAAU,GAAG,IAAI;IAIjD,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,UAAU,GAAG,IAAI;IAIlD,OAAO,CAAC,GAAG;IAkBX,OAAO,CAAC,WAAW;IAoBnB,uDAAuD;IACvD,OAAO,CAAC,kBAAkB;IAS1B,qDAAqD;IACrD,OAAO,CAAC,YAAY;CAsBrB;AAED,8CAA8C;AAC9C,wBAAgB,YAAY,CAAC,MAAM,CAAC,EAAE,YAAY,GAAG,MAAM,CAE1D"}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Structured logger for Soleri agents.
|
|
3
|
+
*
|
|
4
|
+
* All output routes through stderr (stdout is reserved for MCP JSON-RPC).
|
|
5
|
+
* Supports optional file logging with daily rotation and 7-day retention.
|
|
6
|
+
*
|
|
7
|
+
* Ported from Salvador MCP's src/utils/logger.ts.
|
|
8
|
+
*/
|
|
9
|
+
import { appendFileSync, mkdirSync, readdirSync, unlinkSync } from 'node:fs';
|
|
10
|
+
import { join } from 'node:path';
|
|
11
|
+
const LEVEL_ORDER = ['debug', 'info', 'warn', 'error'];
|
|
12
|
+
// MCP stdio servers must keep stdout clean for JSON-RPC.
|
|
13
|
+
// Route ALL log levels through stderr (console.error/console.warn).
|
|
14
|
+
const LEVEL_METHODS = {
|
|
15
|
+
debug: 'error',
|
|
16
|
+
info: 'error',
|
|
17
|
+
warn: 'warn',
|
|
18
|
+
error: 'error',
|
|
19
|
+
};
|
|
20
|
+
/** Max age for log files before auto-pruning (7 days) */
|
|
21
|
+
const LOG_RETENTION_DAYS = 7;
|
|
22
|
+
export class Logger {
|
|
23
|
+
prefix;
|
|
24
|
+
minLevel;
|
|
25
|
+
fileLogDir = null;
|
|
26
|
+
fileLogPrefix;
|
|
27
|
+
currentLogDate = null;
|
|
28
|
+
currentLogPath = null;
|
|
29
|
+
constructor(config) {
|
|
30
|
+
this.prefix = config?.prefix ?? '[Soleri]';
|
|
31
|
+
this.fileLogPrefix = 'agent';
|
|
32
|
+
const envLevel = process.env.SOLERI_LOG_LEVEL;
|
|
33
|
+
const level = config?.level ?? envLevel ?? 'info';
|
|
34
|
+
const levelIndex = LEVEL_ORDER.indexOf(level);
|
|
35
|
+
this.minLevel = levelIndex >= 0 ? levelIndex : LEVEL_ORDER.indexOf('info');
|
|
36
|
+
if (config?.fileLogDir) {
|
|
37
|
+
this.enableFileLog(config.fileLogDir);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Enable file-based logging. Output is teed to
|
|
42
|
+
* {dir}/{prefix}-YYYY-MM-DD.log in addition to stderr.
|
|
43
|
+
* Automatically prunes log files older than 7 days.
|
|
44
|
+
*/
|
|
45
|
+
enableFileLog(dir, prefix) {
|
|
46
|
+
mkdirSync(dir, { recursive: true });
|
|
47
|
+
this.fileLogDir = dir;
|
|
48
|
+
if (prefix)
|
|
49
|
+
this.fileLogPrefix = prefix;
|
|
50
|
+
this.rotateFileIfNeeded();
|
|
51
|
+
this.pruneOldLogs();
|
|
52
|
+
}
|
|
53
|
+
debug(message, context) {
|
|
54
|
+
this.log('debug', message, context);
|
|
55
|
+
}
|
|
56
|
+
info(message, context) {
|
|
57
|
+
this.log('info', message, context);
|
|
58
|
+
}
|
|
59
|
+
warn(message, context) {
|
|
60
|
+
this.log('warn', message, context);
|
|
61
|
+
}
|
|
62
|
+
error(message, context) {
|
|
63
|
+
this.log('error', message, context);
|
|
64
|
+
}
|
|
65
|
+
log(level, message, context) {
|
|
66
|
+
if (LEVEL_ORDER.indexOf(level) < this.minLevel)
|
|
67
|
+
return;
|
|
68
|
+
const method = LEVEL_METHODS[level];
|
|
69
|
+
const tag = level.toUpperCase();
|
|
70
|
+
// Console output (stderr)
|
|
71
|
+
if (context) {
|
|
72
|
+
console[method](`${this.prefix}[${tag}] ${message}`, context);
|
|
73
|
+
}
|
|
74
|
+
else {
|
|
75
|
+
console[method](`${this.prefix}[${tag}] ${message}`);
|
|
76
|
+
}
|
|
77
|
+
// File output (if enabled)
|
|
78
|
+
if (this.fileLogDir) {
|
|
79
|
+
this.writeToFile(tag, message, context);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
writeToFile(tag, message, context) {
|
|
83
|
+
this.rotateFileIfNeeded();
|
|
84
|
+
if (!this.currentLogPath)
|
|
85
|
+
return;
|
|
86
|
+
const ts = new Date().toISOString();
|
|
87
|
+
let line = `${ts} [${tag}] ${message}`;
|
|
88
|
+
if (context) {
|
|
89
|
+
try {
|
|
90
|
+
line += ' ' + JSON.stringify(context);
|
|
91
|
+
}
|
|
92
|
+
catch {
|
|
93
|
+
// Skip unserializable context
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
try {
|
|
97
|
+
appendFileSync(this.currentLogPath, line + '\n');
|
|
98
|
+
}
|
|
99
|
+
catch {
|
|
100
|
+
// Silently fail — file logging should never break the app
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
/** Switch to a new log file if the date has changed */
|
|
104
|
+
rotateFileIfNeeded() {
|
|
105
|
+
if (!this.fileLogDir)
|
|
106
|
+
return;
|
|
107
|
+
const today = new Date().toISOString().slice(0, 10); // YYYY-MM-DD
|
|
108
|
+
if (today !== this.currentLogDate) {
|
|
109
|
+
this.currentLogDate = today;
|
|
110
|
+
this.currentLogPath = join(this.fileLogDir, `${this.fileLogPrefix}-${today}.log`);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
/** Remove log files older than LOG_RETENTION_DAYS */
|
|
114
|
+
pruneOldLogs() {
|
|
115
|
+
if (!this.fileLogDir)
|
|
116
|
+
return;
|
|
117
|
+
const prefix = this.fileLogPrefix;
|
|
118
|
+
try {
|
|
119
|
+
const cutoff = Date.now() - LOG_RETENTION_DAYS * 24 * 60 * 60 * 1000;
|
|
120
|
+
const files = readdirSync(this.fileLogDir);
|
|
121
|
+
for (const file of files) {
|
|
122
|
+
if (!file.startsWith(`${prefix}-`) || !file.endsWith('.log'))
|
|
123
|
+
continue;
|
|
124
|
+
const dateStr = file.slice(`${prefix}-`.length, -'.log'.length);
|
|
125
|
+
const fileDate = new Date(dateStr).getTime();
|
|
126
|
+
if (!isNaN(fileDate) && fileDate < cutoff) {
|
|
127
|
+
try {
|
|
128
|
+
unlinkSync(join(this.fileLogDir, file));
|
|
129
|
+
}
|
|
130
|
+
catch {
|
|
131
|
+
// Ignore individual file deletion errors
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
catch {
|
|
137
|
+
// Ignore pruning errors
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
/** Factory function for creating a logger. */
|
|
142
|
+
export function createLogger(config) {
|
|
143
|
+
return new Logger(config);
|
|
144
|
+
}
|
|
145
|
+
//# sourceMappingURL=logger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../../src/logging/logger.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC7E,OAAO,EAAE,IAAI,EAAE,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|
|
5
|
+
export interface LogEntry {
|
|
6
|
+
level: LogLevel;
|
|
7
|
+
message: string;
|
|
8
|
+
context?: LogContext;
|
|
9
|
+
timestamp: string;
|
|
10
|
+
}
|
|
11
|
+
export interface LoggerConfig {
|
|
12
|
+
/** Minimum log level. Default: 'info' (or SOLERI_LOG_LEVEL env var) */
|
|
13
|
+
level?: LogLevel;
|
|
14
|
+
/** Prefix for log messages. Default: '[Soleri]' */
|
|
15
|
+
prefix?: string;
|
|
16
|
+
/** Directory for file logging. If set, enables file output on construction. */
|
|
17
|
+
fileLogDir?: string;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/logging/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,QAAQ,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;AAE3D,MAAM,WAAW,UAAU;IACzB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,QAAQ;IACvB,KAAK,EAAE,QAAQ,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,UAAU,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,YAAY;IAC3B,uEAAuE;IACvE,KAAK,CAAC,EAAE,QAAQ,CAAC;IACjB,mDAAmD;IACnD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,+EAA+E;IAC/E,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/logging/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Loop manager — lightweight in-memory state tracker for iterative
|
|
3
|
+
* validation loops.
|
|
4
|
+
*
|
|
5
|
+
* Tracks active loop, iteration history, and past loop results.
|
|
6
|
+
* Session-scoped (no persistence across restarts).
|
|
7
|
+
*/
|
|
8
|
+
import type { LoopConfig, LoopIteration, LoopState } from './types.js';
|
|
9
|
+
export declare class LoopManager {
|
|
10
|
+
private activeLoop;
|
|
11
|
+
private completedLoops;
|
|
12
|
+
/**
|
|
13
|
+
* Start a new validation loop.
|
|
14
|
+
* Throws if a loop is already active.
|
|
15
|
+
*/
|
|
16
|
+
startLoop(config: LoopConfig): LoopState;
|
|
17
|
+
/**
|
|
18
|
+
* Record an iteration result on the active loop.
|
|
19
|
+
* If the iteration passes, the loop status is NOT automatically changed —
|
|
20
|
+
* call `completeLoop()` explicitly when validation is confirmed.
|
|
21
|
+
* If max iterations reached and this iteration fails, status becomes 'max-iterations'.
|
|
22
|
+
*/
|
|
23
|
+
iterate(result: {
|
|
24
|
+
validationScore?: number;
|
|
25
|
+
validationResult?: string;
|
|
26
|
+
passed: boolean;
|
|
27
|
+
}): LoopIteration;
|
|
28
|
+
/**
|
|
29
|
+
* Mark the active loop as completed (validation passed).
|
|
30
|
+
*/
|
|
31
|
+
completeLoop(): LoopState;
|
|
32
|
+
/**
|
|
33
|
+
* Cancel the active loop.
|
|
34
|
+
*/
|
|
35
|
+
cancelLoop(): LoopState;
|
|
36
|
+
/**
|
|
37
|
+
* Get current loop status. Returns null if no active loop.
|
|
38
|
+
*/
|
|
39
|
+
getStatus(): LoopState | null;
|
|
40
|
+
/**
|
|
41
|
+
* Get history of all completed/cancelled/max-iterations loops.
|
|
42
|
+
*/
|
|
43
|
+
getHistory(): LoopState[];
|
|
44
|
+
/**
|
|
45
|
+
* Check if a loop is currently active.
|
|
46
|
+
*/
|
|
47
|
+
isActive(): boolean;
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=loop-manager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loop-manager.d.ts","sourceRoot":"","sources":["../../src/loop/loop-manager.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAEvE,qBAAa,WAAW;IACtB,OAAO,CAAC,UAAU,CAA0B;IAC5C,OAAO,CAAC,cAAc,CAAmB;IAEzC;;;OAGG;IACH,SAAS,CAAC,MAAM,EAAE,UAAU,GAAG,SAAS;IAoBxC;;;;;OAKG;IACH,OAAO,CAAC,MAAM,EAAE;QACd,eAAe,CAAC,EAAE,MAAM,CAAC;QACzB,gBAAgB,CAAC,EAAE,MAAM,CAAC;QAC1B,MAAM,EAAE,OAAO,CAAC;KACjB,GAAG,aAAa;IA6BjB;;OAEG;IACH,YAAY,IAAI,SAAS;IAazB;;OAEG;IACH,UAAU,IAAI,SAAS;IAavB;;OAEG;IACH,SAAS,IAAI,SAAS,GAAG,IAAI;IAI7B;;OAEG;IACH,UAAU,IAAI,SAAS,EAAE;IAIzB;;OAEG;IACH,QAAQ,IAAI,OAAO;CAGpB"}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Loop manager — lightweight in-memory state tracker for iterative
|
|
3
|
+
* validation loops.
|
|
4
|
+
*
|
|
5
|
+
* Tracks active loop, iteration history, and past loop results.
|
|
6
|
+
* Session-scoped (no persistence across restarts).
|
|
7
|
+
*/
|
|
8
|
+
export class LoopManager {
|
|
9
|
+
activeLoop = null;
|
|
10
|
+
completedLoops = [];
|
|
11
|
+
/**
|
|
12
|
+
* Start a new validation loop.
|
|
13
|
+
* Throws if a loop is already active.
|
|
14
|
+
*/
|
|
15
|
+
startLoop(config) {
|
|
16
|
+
if (this.activeLoop) {
|
|
17
|
+
throw new Error(`Loop already active: ${this.activeLoop.id} (mode: ${this.activeLoop.config.mode}). ` +
|
|
18
|
+
'Cancel or complete it first.');
|
|
19
|
+
}
|
|
20
|
+
const loop = {
|
|
21
|
+
id: `loop-${Date.now()}`,
|
|
22
|
+
config,
|
|
23
|
+
iterations: [],
|
|
24
|
+
status: 'active',
|
|
25
|
+
startedAt: new Date().toISOString(),
|
|
26
|
+
};
|
|
27
|
+
this.activeLoop = loop;
|
|
28
|
+
return loop;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Record an iteration result on the active loop.
|
|
32
|
+
* If the iteration passes, the loop status is NOT automatically changed —
|
|
33
|
+
* call `completeLoop()` explicitly when validation is confirmed.
|
|
34
|
+
* If max iterations reached and this iteration fails, status becomes 'max-iterations'.
|
|
35
|
+
*/
|
|
36
|
+
iterate(result) {
|
|
37
|
+
if (!this.activeLoop) {
|
|
38
|
+
throw new Error('No active loop. Start one first.');
|
|
39
|
+
}
|
|
40
|
+
const iteration = {
|
|
41
|
+
iteration: this.activeLoop.iterations.length + 1,
|
|
42
|
+
timestamp: new Date().toISOString(),
|
|
43
|
+
validationScore: result.validationScore,
|
|
44
|
+
validationResult: result.validationResult,
|
|
45
|
+
passed: result.passed,
|
|
46
|
+
};
|
|
47
|
+
this.activeLoop.iterations.push(iteration);
|
|
48
|
+
// Auto-transition to max-iterations if limit reached and not passing
|
|
49
|
+
if (!result.passed &&
|
|
50
|
+
this.activeLoop.iterations.length >= this.activeLoop.config.maxIterations) {
|
|
51
|
+
this.activeLoop.status = 'max-iterations';
|
|
52
|
+
this.activeLoop.completedAt = new Date().toISOString();
|
|
53
|
+
this.completedLoops.push(this.activeLoop);
|
|
54
|
+
this.activeLoop = null;
|
|
55
|
+
}
|
|
56
|
+
return iteration;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Mark the active loop as completed (validation passed).
|
|
60
|
+
*/
|
|
61
|
+
completeLoop() {
|
|
62
|
+
if (!this.activeLoop) {
|
|
63
|
+
throw new Error('No active loop to complete.');
|
|
64
|
+
}
|
|
65
|
+
this.activeLoop.status = 'completed';
|
|
66
|
+
this.activeLoop.completedAt = new Date().toISOString();
|
|
67
|
+
const completed = this.activeLoop;
|
|
68
|
+
this.completedLoops.push(completed);
|
|
69
|
+
this.activeLoop = null;
|
|
70
|
+
return completed;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Cancel the active loop.
|
|
74
|
+
*/
|
|
75
|
+
cancelLoop() {
|
|
76
|
+
if (!this.activeLoop) {
|
|
77
|
+
throw new Error('No active loop to cancel.');
|
|
78
|
+
}
|
|
79
|
+
this.activeLoop.status = 'cancelled';
|
|
80
|
+
this.activeLoop.completedAt = new Date().toISOString();
|
|
81
|
+
const cancelled = this.activeLoop;
|
|
82
|
+
this.completedLoops.push(cancelled);
|
|
83
|
+
this.activeLoop = null;
|
|
84
|
+
return cancelled;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Get current loop status. Returns null if no active loop.
|
|
88
|
+
*/
|
|
89
|
+
getStatus() {
|
|
90
|
+
return this.activeLoop;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Get history of all completed/cancelled/max-iterations loops.
|
|
94
|
+
*/
|
|
95
|
+
getHistory() {
|
|
96
|
+
return [...this.completedLoops];
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Check if a loop is currently active.
|
|
100
|
+
*/
|
|
101
|
+
isActive() {
|
|
102
|
+
return this.activeLoop !== null;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
//# sourceMappingURL=loop-manager.js.map
|