@holoscript/framework 6.0.3 → 6.0.4
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/CHANGELOG.md +1 -2
- package/ROADMAP.md +68 -66
- package/dist/{InvisibleWallet-BB6tFvRA.d.cts → InvisibleWallet-EFiuaLn3.d.cts} +1 -1
- package/dist/{OrchestratorAgent-BvWgf9uw.d.cts → OrchestratorAgent-CrLDGNL6.d.cts} +1 -1
- package/dist/agents/index.cjs +11 -10
- package/dist/agents/index.d.cts +4 -16
- package/dist/ai/index.cjs +2 -2
- package/dist/behavior.cjs +10 -0
- package/dist/economy/index.cjs +4 -4
- package/dist/economy/index.d.cts +2 -2
- package/dist/index.cjs +33 -11
- package/dist/index.d.cts +3 -3
- package/dist/swarm/index.cjs +3 -0
- package/package.json +14 -9
- package/src/__tests__/bounty-marketplace.test.ts +53 -21
- package/src/__tests__/delegation.test.ts +1 -4
- package/src/__tests__/done-log-audit.test.ts +38 -46
- package/src/__tests__/framework.test.ts +172 -53
- package/src/__tests__/goal-synthesizer.test.ts +9 -6
- package/src/__tests__/presence.test.ts +1 -1
- package/src/__tests__/protocol-agent.test.ts +12 -11
- package/src/__tests__/revenue-splitter.test.ts +22 -15
- package/src/__tests__/scenario-driven-todo.test.ts +55 -35
- package/src/__tests__/self-improve.test.ts +28 -9
- package/src/__tests__/service-lifecycle.test.ts +9 -3
- package/src/__tests__/skill-router.test.ts +3 -3
- package/src/agents/CulturalMemory.ts +6 -6
- package/src/agents/DelegationTraceHooks.ts +560 -0
- package/src/agents/FederatedRegistryAdapter.ts +1 -1
- package/src/agents/NormEngine.ts +3 -8
- package/src/agents/OrchestratorAgent.ts +1 -1
- package/src/agents/TaskDelegationService.ts +5 -9
- package/src/agents/__tests__/AgentWalletRegistry.test.ts +5 -4
- package/src/agents/__tests__/CrossRealityHandoff.test.ts +9 -3
- package/src/agents/__tests__/DelegationTraceHooks.test.ts +390 -0
- package/src/agents/__tests__/TaskDelegationService.test.ts +4 -2
- package/src/agents/spatial-comms/Layer1RealTime.ts +36 -19
- package/src/agents/spatial-comms/Layer2A2A.ts +1 -3
- package/src/agents/spatial-comms/Layer3MCP.ts +13 -4
- package/src/agents/spatial-comms/ProtocolTypes.ts +5 -2
- package/src/agents/spatial-comms/examples/multi-agent-world-creation.ts +2 -2
- package/src/ai/HoloScriptGenerator.ts +2 -2
- package/src/ai/__tests__/PerceptionSystem.prod.test.ts +1 -1
- package/src/ai/__tests__/PerceptionSystem.test.ts +14 -14
- package/src/ai/__tests__/SteeringBehaviors.prod.test.ts +1 -1
- package/src/ai/index.ts +5 -1
- package/src/board/audit.ts +17 -6
- package/src/board/board-ops.ts +45 -15
- package/src/board/board-types.ts +94 -20
- package/src/delegation.ts +5 -3
- package/src/distributed-claimer.ts +13 -2
- package/src/economy/BountyManager.ts +40 -18
- package/src/economy/KnowledgeMarketplace.ts +27 -8
- package/src/economy/PaymentWebhookService.ts +0 -1
- package/src/economy/RevenueSplitter.ts +2 -4
- package/src/economy/UnifiedBudgetOptimizer.ts +8 -9
- package/src/economy/_core-stubs.ts +1 -1
- package/src/economy/x402-facilitator.ts +17 -8
- package/src/index.ts +16 -12
- package/src/knowledge/__tests__/knowledge-consolidator.test.ts +138 -89
- package/src/knowledge/__tests__/knowledge-store-vector.test.ts +59 -16
- package/src/knowledge/brain.ts +7 -7
- package/src/knowledge/consolidation.ts +16 -16
- package/src/knowledge/knowledge-consolidator.ts +60 -30
- package/src/knowledge/knowledge-store.ts +83 -45
- package/src/learning/ProceduralCompiler.ts +6 -1
- package/src/learning/learning/MemoryConsolidator.ts +102 -0
- package/src/learning/learning/MemoryScorer.ts +69 -0
- package/src/learning/learning/ProceduralCompiler.ts +45 -0
- package/src/learning/learning/SemanticClusterer.ts +66 -0
- package/src/llm/llm-adapter.ts +24 -10
- package/src/mesh/index.ts +37 -17
- package/src/protocol/goal-synthesizer.ts +24 -34
- package/src/protocol/implementations.ts +91 -22
- package/src/protocol/micro-phase-decomposer.ts +25 -17
- package/src/protocol/micro-step-decomposer.test.ts +104 -39
- package/src/protocol-agent.test.ts +17 -7
- package/src/protocol-agent.ts +45 -42
- package/src/self-improve/absorb-scanner.ts +9 -6
- package/src/self-improve/evolution-engine.ts +36 -18
- package/src/self-improve/framework-absorber.ts +21 -16
- package/src/self-improve/index.ts +2 -10
- package/src/self-improve/prompt-optimizer.ts +31 -19
- package/src/self-improve/test-generator.ts +16 -12
- package/src/skill-router.ts +7 -6
- package/src/swarm/messaging/GossipProtocol.ts +1 -1
- package/src/swarm/messaging/__tests__/BroadcastChannel.prod.test.ts +31 -9
- package/src/swarm/messaging/__tests__/GossipProtocol.prod.test.ts +21 -7
- package/src/swarm/messaging/__tests__/SwarmEventBus.prod.test.ts +24 -8
- package/src/swarm/messaging/__tests__/SwarmEventBus.test.ts +6 -2
- package/src/team.ts +277 -122
- package/src/training/scripts/generate-spatial-dataset.ts +1 -1
- package/src/training/training/LRScheduler.ts +377 -0
- package/src/training/training/QualityScoringPipeline.ts +139 -0
- package/src/training/training/SoftDedup.ts +461 -0
- package/src/training/training/SparsityMonitor.ts +685 -0
- package/src/training/training/SparsityMonitorTypes.ts +209 -0
- package/src/training/training/SpatialTrainingDataGenerator.ts +1526 -0
- package/src/training/training/SpatialTrainingDataTypes.ts +216 -0
- package/src/training/training/TrainingPipelineConfig.ts +215 -0
- package/src/training/training/__tests__/CorpusValidation.test.ts +87 -0
- package/src/training/training/__tests__/LRScheduler.test.ts +592 -0
- package/src/training/training/__tests__/SoftDedup.test.ts +415 -0
- package/src/training/training/__tests__/SparsityMonitor.test.ts +1623 -0
- package/src/training/training/__tests__/SpatialCorpusValidation.test.ts +72 -0
- package/src/training/training/__tests__/SpatialTrainingDataGenerator.test.ts +1244 -0
- package/src/training/training/__tests__/TrainingMonkeyIntegration.test.ts +897 -0
- package/src/training/training/__tests__/TrainingPipelineConfig.test.ts +202 -0
- package/src/training/training/__tests__/schema.test.ts +72 -0
- package/src/training/training/__tests__/training-constants.test.ts +106 -0
- package/src/training/training/__tests__/trait-mappings.test.ts +81 -0
- package/src/training/training/constants.ts +94 -0
- package/src/training/training/index.ts +17 -0
- package/src/training/training/schema.ts +147 -0
- package/src/training/training/scripts/generate-novel-use-cases-dataset.ts +272 -0
- package/src/training/training/scripts/generate-spatial-dataset.ts +521 -0
- package/src/training/training/trainingmonkey/TrainingMonkeyIntegration.ts +477 -0
- package/src/training/training/trainingmonkey/TrainingMonkeyTypes.ts +230 -0
- package/src/training/training/trainingmonkey/index.ts +26 -0
- package/src/training/training/trait-mappings.ts +157 -0
- package/src/types.ts +2 -7
- package/ALL-test-results.json +0 -1
- package/LICENSE +0 -21
- package/dist/AgentManifest-CB4xM-Ma.d.ts +0 -704
- package/dist/BehaviorTree-BrBFECv5.d.ts +0 -103
- package/dist/InvisibleWallet-rtRrBOA8.d.ts +0 -1732
- package/dist/OrchestratorAgent-Q_CbVTmO.d.ts +0 -798
- package/dist/agents/index.d.ts +0 -1788
- package/dist/agents/index.js +0 -4695
- package/dist/ai/index.d.ts +0 -1753
- package/dist/ai/index.js +0 -5244
- package/dist/behavior.d.ts +0 -130
- package/dist/behavior.js +0 -407
- package/dist/economy/index.d.ts +0 -747
- package/dist/economy/index.js +0 -3617
- package/dist/implementations-D9T3un9D.d.ts +0 -236
- package/dist/index.d.ts +0 -1729
- package/dist/index.js +0 -24277
- package/dist/learning/index.d.ts +0 -104
- package/dist/learning/index.js +0 -189
- package/dist/negotiation/index.d.ts +0 -610
- package/dist/negotiation/index.js +0 -931
- package/dist/skills/index.d.ts +0 -289
- package/dist/skills/index.js +0 -1079
- package/dist/swarm/index.d.ts +0 -2433
- package/dist/swarm/index.js +0 -5221
- package/dist/training/index.d.ts +0 -1734
- package/dist/training/index.js +0 -2687
- package/extract-failures.js +0 -10
- package/src/training/training/data/novel-use-cases.jsonl +0 -153
- package/src/training/training/data/spatial-reasoning-10k.jsonl +0 -9354
- package/src/types/core-stubs.d.ts +0 -113
- package/test-output.txt +0 -0
- package/test-result.json +0 -1
- package/tsc-errors.txt +0 -4
- package/tsc_output.txt +0 -0
- package/typescript-errors-2.txt +0 -0
- package/typescript-errors.txt +0 -22
- package/vitest-log-utf8.txt +0 -268
- package/vitest-log.txt +0 -0
package/dist/index.d.cts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { ac as StoredEntry, ad as ModelConfig, ae as KnowledgeStore, af as AgentConfig, c as BountyManager, ag as TeamConfig, ah as TaskDef, ai as CycleResult, aj as ProposalResult, ak as AgentRuntime, al as SuggestionCreateResult, am as SuggestionVoteResult, an as SuggestionStatus, ao as SuggestionListResult, ap as TeamMode, aq as SetModeResult, ar as DeriveResult, as as AgentPresence, at as PresenceResult, au as HeartbeatResult, e as BountyReward, B as Bounty, h as ClaimResult$1, i as CompletionProof, t as PayoutResult, av as ExcitabilityMetadata, aw as KnowledgeDomain, ax as HotBufferEntry, ay as ConsolidationResult, az as ReconsolidationEvent, aA as DomainConsolidationConfig, aB as KnowledgeInsight, aC as ProtocolAgentConfig, aD as ProtocolAgentHandle } from './InvisibleWallet-
|
|
2
|
-
export { aE as AgentCycleResult, aF as AgentPresenceStatus, aG as AgentRole, aH as AgentStatus, b as BountyCurrency, d as BountyManagerConfig, f as BountyStatus, C as CHAIN_IDS, g as CHAIN_ID_TO_NETWORK, aI as ClaimFilter, aJ as ConsensusMode, k as CreatorRevenueAggregator, aK as DOMAIN_CONSOLIDATION, aL as DOMAIN_HALF_LIVES, aM as EmbedResult, I as InvisibleWalletStub, aN as KNOWLEDGE_DOMAINS, aO as KnowledgeConfig, K as KnowledgeListing, m as KnowledgeMarketplace, aP as LLMProvider, n as ListingResult, o as ListingStatus, M as MICRO_PAYMENT_THRESHOLD, p as MicroPaymentLedger, P as PaymentGateway, r as PaymentWebhookService, aQ as PhaseHook, aR as PresenceConfig, v as PricingFactors, aS as ProtocolStyle, w as PurchaseResult, aT as RECONSOLIDATION_WINDOW_MS, aU as ReputationTier, E as RevenueSplitter, aV as SemanticSearchOptions, aW as SlotInfo, aX as SlotRole, aY as Suggestion, aZ as SuggestionVoteEntry, U as USDC_CONTRACTS, a3 as X402Facilitator, aa as X402_VERSION, a_ as applyHalfLifeDecay, a$ as computeExcitability, b0 as triggerReconsolidation } from './InvisibleWallet-
|
|
1
|
+
import { ac as StoredEntry, ad as ModelConfig, ae as KnowledgeStore, af as AgentConfig, c as BountyManager, ag as TeamConfig, ah as TaskDef, ai as CycleResult, aj as ProposalResult, ak as AgentRuntime, al as SuggestionCreateResult, am as SuggestionVoteResult, an as SuggestionStatus, ao as SuggestionListResult, ap as TeamMode, aq as SetModeResult, ar as DeriveResult, as as AgentPresence, at as PresenceResult, au as HeartbeatResult, e as BountyReward, B as Bounty, h as ClaimResult$1, i as CompletionProof, t as PayoutResult, av as ExcitabilityMetadata, aw as KnowledgeDomain, ax as HotBufferEntry, ay as ConsolidationResult, az as ReconsolidationEvent, aA as DomainConsolidationConfig, aB as KnowledgeInsight, aC as ProtocolAgentConfig, aD as ProtocolAgentHandle } from './InvisibleWallet-EFiuaLn3.cjs';
|
|
2
|
+
export { aE as AgentCycleResult, aF as AgentPresenceStatus, aG as AgentRole, aH as AgentStatus, b as BountyCurrency, d as BountyManagerConfig, f as BountyStatus, C as CHAIN_IDS, g as CHAIN_ID_TO_NETWORK, aI as ClaimFilter, aJ as ConsensusMode, k as CreatorRevenueAggregator, aK as DOMAIN_CONSOLIDATION, aL as DOMAIN_HALF_LIVES, aM as EmbedResult, I as InvisibleWalletStub, aN as KNOWLEDGE_DOMAINS, aO as KnowledgeConfig, K as KnowledgeListing, m as KnowledgeMarketplace, aP as LLMProvider, n as ListingResult, o as ListingStatus, M as MICRO_PAYMENT_THRESHOLD, p as MicroPaymentLedger, P as PaymentGateway, r as PaymentWebhookService, aQ as PhaseHook, aR as PresenceConfig, v as PricingFactors, aS as ProtocolStyle, w as PurchaseResult, aT as RECONSOLIDATION_WINDOW_MS, aU as ReputationTier, E as RevenueSplitter, aV as SemanticSearchOptions, aW as SlotInfo, aX as SlotRole, aY as Suggestion, aZ as SuggestionVoteEntry, U as USDC_CONTRACTS, a3 as X402Facilitator, aa as X402_VERSION, a_ as applyHalfLifeDecay, a$ as computeExcitability, b0 as triggerReconsolidation } from './InvisibleWallet-EFiuaLn3.cjs';
|
|
3
3
|
export { A as ActionNode, a as BTContext, B as BTNode, b as BehaviorTree, C as ConditionNode, I as InverterNode, N as NodeStatus, R as RepeaterNode, S as SelectorNode, c as SequenceNode, W as WaitNode } from './BehaviorTree-BrBFECv5.cjs';
|
|
4
4
|
export { BridgeResult, ClawHubManifest, HoloClawSkill, HoloClawSkillInput, HoloClawSkillOutput, ParsedSkill, SchemaField, SkillActionStep, SkillMetadata, SkillStateVar, SkillTest, SkillTraitDecl, fromHoloClawSkill, generateClawHubManifest, generateClawHubPackage, getHsInstallCommand, getInstallCommand, getPublishCommand, hsplusToSkillMd, parseHsplus, parseSkillMd, skillMdToHsplus, toHoloClawSkill, toHsplus, toSkillMd } from './skills/index.cjs';
|
|
5
5
|
export { AuditEntry, InitiateOptions, NegotiationConfig, NegotiationEvents, NegotiationProtocol, NegotiationSession, NegotiationStatus, Proposal, ProposalInput, ProposalStatus, Resolution, ResolutionOutcome, TieBreaker, Vote, VoteInput, VoteTally, VotingHandler, VotingMechanism, VotingResult, approvalHandler, bordaHandler, checkQuorum, consensusHandler, getNegotiationProtocol, getTrustWeight, getVotingHandler, majorityHandler, rankedHandler, resetNegotiationProtocol, supermajorityHandler, weightedHandler } from './negotiation/index.cjs';
|
|
6
6
|
import { G as Goal, B as BaseAgent, A as AgentIdentity, P as PhaseResult, b as ProtocolCycleResult } from './implementations-D9T3un9D.cjs';
|
|
7
7
|
export { c as BaseService, E as ExecutionPlan, d as ExecutionResult, e as Gotcha, M as MicroPhaseDecomposer, f as MicroPhaseGroup, g as MicroPhaseTask, h as PWGEntry, i as PWGSeverity, j as Pattern, a as ProtocolPhase, S as ServiceConfig, k as ServiceError, l as ServiceErrorCode, m as ServiceHealth, n as ServiceLifecycle, o as ServiceManager, p as ServiceManagerHealth, q as ServiceMetadata, r as ServiceMetrics, W as Wisdom, s as isGotcha, t as isPattern, u as isWisdom } from './implementations-D9T3un9D.cjs';
|
|
8
|
-
export { O as OrchestratorAgent, m as OrchestratorConfig } from './OrchestratorAgent-
|
|
8
|
+
export { O as OrchestratorAgent, m as OrchestratorConfig } from './OrchestratorAgent-CrLDGNL6.cjs';
|
|
9
9
|
export { ACOConfig, ACOEngine, ACOResult, AgentInfo, AntiEntropySync, BroadcastChannel, ChannelManager, CollectiveIntelligence, CollectiveIntelligenceConfig, ContributionSynthesizer, CreateSwarmRequest, DebugEventListener, DisbandOptions, ElectionMessage, ElectionRole, ElectionState, EventHandler, EventPriority, FlockingBehavior, FormationController, FormationType, GossipHandler, HeartbeatMessage, IAgentRelation, IAgentSnapshot, IBoid, IChannelConfig, IChannelMessage, IChannelSubscriber, IDebugEvent, IEventBusConfig, IEventBusStats, IEventSubscription, IFlockingConfig, IFormationConfig, IFormationSlot, IGossipConfig, IGossipMessage, IGossipPeer, IHealthCheck, IHistogramBuckets, IInspectionResult, IMetricDefinition, IMetricStats, IMetricValue, ISummaryPercentiles, ISwarmEvent, ISwarmSnapshot, IZone, IZoneClaim, IZoneClaimingConfig, IZoneEvent, JoinRequest, LeaderElection, LeaderElectionConfig, LeaveRequest, MemberInfo, MembershipEvent, MessageHandler, MetricType, PSOConfig, PSOEngine, PSOResult, Particle, PeerSelector, QuorumConfig, QuorumPolicy, QuorumState, QuorumStatus, SwarmCoordinator, SwarmEvent, SwarmEventBus, SwarmInfo, SwarmInspector, SwarmManager, SwarmManagerConfig, SwarmMembership, SwarmMembershipConfig, SwarmMetrics, SynthesisResult, SynthesizerConfig, TaskInfo, Vector3, VoteRequestMessage, VoteResponseMessage, VotingRound, VotingRoundConfig, ZoneClaiming, ZoneState } from './swarm/index.cjs';
|
|
10
10
|
export { AIAdapter, AICopilot, ALL_CATEGORIES, AnthropicAdapter, AnthropicAdapterConfig, BTStatus, BTTreeContext, BTTreeDef, BehaviorSelector, Blackboard, ExplainResult, FireworksAdapter, FireworksAdapterConfig, FixResult, GeminiAdapter, GeminiAdapterConfig, GenerateOptions, GenerateResult, GenerationAnalytics, GenerationCache, GoalPlanner, GuardFn, GuardNode, HoloScriptGenerator, InfluenceMap, LMStudioAdapter, LMStudioAdapterConfig, NVIDIAAdapter, NVIDIAAdapterConfig, NavMesh, OllamaAdapter, OllamaAdapterConfig, OpenAIAdapter, OpenAIAdapterConfig, OptimizeResult, ParallelNode, PerceptionSystem, PromptTemplate, PromptTemplateSystem, QuickPrompts, SearchResult, SemanticSearchService, StateAction, StateConfig, StateMachine, SteeringBehavior, SteeringBehaviors, TemplateContext, TogetherAdapter, TogetherAdapterConfig, TrainingDataGenerator, TransitionConfig, UtilityAI, XAIAdapter, XAIAdapterConfig, cachedGenerate, createAnalytics, createTrainingDataGenerator, explainHoloScript, fixHoloScript, generateBatch, generateHoloScript, generateHoloScriptWithAdapter, getAIAdapter, getDefaultAIAdapter, isAISafe, listAIAdapters, optimizeHoloScript, registerAIAdapter, setDefaultAIAdapter, unregisterAIAdapter, useAnthropic, useFireworks, useGemini, useGrok, useLMStudio, useNVIDIA, useOllama, useOpenAI, useTogether, useXAI, validateAIOutput, validateBatch } from './ai/index.cjs';
|
|
11
11
|
export { AlpacaEntry, DEFAULT_GENERATOR_THRESHOLDS, DEFAULT_INTEGRATION_CONFIG, DEFAULT_LR_SCHEDULER_CONFIG, DEFAULT_SCORING_CONFIG, DEFAULT_SOFTDEDUP_CONFIG, DEFAULT_TRAINING_PIPELINE_CONFIG, DIFFICULTY_LEVELS, DatasetSplit, DifficultyLevel, EnergyEfficiencyMetrics, GRPO_LR_SCHEDULER_CONFIG, GeneratorMetrics, IntegrationResult, LRScheduleStats, LRScheduler, LRSchedulerConfig, LRSchedulerSnapshot, LayerActivityInput, NgramStats, PipelineSettings, QUALITY_THRESHOLDS, QualityDetail, QualityScore, QualityScoringConfig, QualityScoringPipeline, QualityTier, RULEFORGE_DOMAINS, RuleForgeDomain, SNNLayerMetrics, SceneObject, SoftDedup, SoftDedupConfig, SoftDedupResult, SoftDedupStats, SparsityMonitor, SparsityMonitorConfig, SparsityMonitorStats, SparsityQualityHistoryEntry, SparsitySnapshot, SparsityViolation, SpatialDifficulty, SpatialGeneratorConfig, SpatialGeneratorStats, SpatialRelationship, SpatialRelationshipParams, SpatialRelationshipType, SpatialScene, SpatialTrainingDataGenerator, SpatialTrainingExample, SpatialTrainingJSONLEntry, SplitStats, TM_REGISTERED_TRAITS, TRAINING_CATEGORIES, TrainingCategory, TrainingCompressionResult, TrainingExample, TrainingExampleMetadata, TrainingHyperparameters, TrainingMetadata, TrainingMonkeyConfig, TrainingMonkeyIntegration, TrainingMonkeyIntegrationConfig, TrainingPipelineConfig, TrainingQualityScore, TrainingValidationError, TrainingValidationResult, TraitMapping, TraitValidationReport, WeightedAlpacaEntry, buildTrainingPipelineConfig, computeTotalSteps, createGRPOScheduler, createSFTScheduler, createSoftDedup, createSparsityMonitor, createSpatialTrainingDataGenerator, createTrainingMonkeyIntegration, generateValidationReport, getQualityTier, isValidCategory, isValidDifficulty, validateTrainingExample, validateTraitName } from './training/index.cjs';
|
package/dist/swarm/index.cjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@holoscript/framework",
|
|
3
|
-
"version": "6.0.
|
|
3
|
+
"version": "6.0.4",
|
|
4
4
|
"description": "The framework where agents remember, learn, and earn. Knowledge-compounding team orchestration.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.cjs",
|
|
@@ -16,6 +16,11 @@
|
|
|
16
16
|
"require": "./dist/behavior.cjs",
|
|
17
17
|
"types": "./dist/behavior.d.ts"
|
|
18
18
|
},
|
|
19
|
+
"./behavior": {
|
|
20
|
+
"import": "./dist/behavior.js",
|
|
21
|
+
"require": "./dist/behavior.cjs",
|
|
22
|
+
"types": "./dist/behavior.d.ts"
|
|
23
|
+
},
|
|
19
24
|
"./agents": {
|
|
20
25
|
"import": "./dist/agents/index.js",
|
|
21
26
|
"require": "./dist/agents/index.cjs",
|
|
@@ -57,6 +62,11 @@
|
|
|
57
62
|
"types": "./dist/negotiation/index.d.ts"
|
|
58
63
|
}
|
|
59
64
|
},
|
|
65
|
+
"scripts": {
|
|
66
|
+
"build": "tsup",
|
|
67
|
+
"test": "vitest run --passWithNoTests",
|
|
68
|
+
"test:watch": "vitest"
|
|
69
|
+
},
|
|
60
70
|
"keywords": [
|
|
61
71
|
"holoscript",
|
|
62
72
|
"agent",
|
|
@@ -67,16 +77,11 @@
|
|
|
67
77
|
],
|
|
68
78
|
"license": "MIT",
|
|
69
79
|
"dependencies": {
|
|
70
|
-
"@holoscript/core": "
|
|
80
|
+
"@holoscript/core": "workspace:*"
|
|
71
81
|
},
|
|
72
82
|
"devDependencies": {
|
|
73
83
|
"tsup": "^8.0.0",
|
|
74
84
|
"typescript": "^5.7.0",
|
|
75
|
-
"vitest": "^3.
|
|
76
|
-
},
|
|
77
|
-
"scripts": {
|
|
78
|
-
"build": "tsup",
|
|
79
|
-
"test": "vitest run --passWithNoTests",
|
|
80
|
-
"test:watch": "vitest"
|
|
85
|
+
"vitest": "^3.0.0"
|
|
81
86
|
}
|
|
82
|
-
}
|
|
87
|
+
}
|
|
@@ -20,8 +20,12 @@ describe('BountyManager', () => {
|
|
|
20
20
|
|
|
21
21
|
it('rejects zero or negative reward', () => {
|
|
22
22
|
const mgr = new BountyManager();
|
|
23
|
-
expect(() => mgr.createBounty('t1', { amount: 0, currency: 'credits' }, 'a')).toThrow(
|
|
24
|
-
|
|
23
|
+
expect(() => mgr.createBounty('t1', { amount: 0, currency: 'credits' }, 'a')).toThrow(
|
|
24
|
+
'positive'
|
|
25
|
+
);
|
|
26
|
+
expect(() => mgr.createBounty('t1', { amount: -1, currency: 'credits' }, 'a')).toThrow(
|
|
27
|
+
'positive'
|
|
28
|
+
);
|
|
25
29
|
});
|
|
26
30
|
|
|
27
31
|
it('claims an open bounty', () => {
|
|
@@ -45,7 +49,12 @@ describe('BountyManager', () => {
|
|
|
45
49
|
it('rejects claiming an expired bounty', () => {
|
|
46
50
|
const mgr = new BountyManager();
|
|
47
51
|
// Deadline in the past
|
|
48
|
-
const bounty = mgr.createBounty(
|
|
52
|
+
const bounty = mgr.createBounty(
|
|
53
|
+
'task-1',
|
|
54
|
+
{ amount: 1, currency: 'credits' },
|
|
55
|
+
'alice',
|
|
56
|
+
Date.now() - 1000
|
|
57
|
+
);
|
|
49
58
|
const result = mgr.claimBounty(bounty.id, 'bob');
|
|
50
59
|
expect(result.success).toBe(false);
|
|
51
60
|
expect(result.error).toContain('expired');
|
|
@@ -55,7 +64,10 @@ describe('BountyManager', () => {
|
|
|
55
64
|
const mgr = new BountyManager();
|
|
56
65
|
const bounty = mgr.createBounty('task-1', { amount: 0.05, currency: 'USDC' }, 'alice');
|
|
57
66
|
mgr.claimBounty(bounty.id, 'bob');
|
|
58
|
-
const payout = mgr.completeBounty(bounty.id, {
|
|
67
|
+
const payout = mgr.completeBounty(bounty.id, {
|
|
68
|
+
summary: 'Fixed the bug',
|
|
69
|
+
commitHash: 'abc123',
|
|
70
|
+
});
|
|
59
71
|
expect(payout.success).toBe(true);
|
|
60
72
|
expect(payout.amount).toBe(0.05);
|
|
61
73
|
expect(payout.settlement).toBe('ledger'); // < 0.10 USDC = ledger
|
|
@@ -161,20 +173,20 @@ describe('KnowledgeMarketplace', () => {
|
|
|
161
173
|
it('lists and buys knowledge', () => {
|
|
162
174
|
const mp = new KnowledgeMarketplace();
|
|
163
175
|
const entry = mockEntry();
|
|
164
|
-
const listing = mp.sellKnowledge(entry, 0.
|
|
176
|
+
const listing = mp.sellKnowledge(entry, 0.1, 'alice');
|
|
165
177
|
expect(listing.success).toBe(true);
|
|
166
178
|
|
|
167
179
|
const purchase = mp.buyKnowledge(listing.listingId, 'bob');
|
|
168
180
|
expect(purchase.success).toBe(true);
|
|
169
|
-
expect(purchase.price).toBe(0.
|
|
181
|
+
expect(purchase.price).toBe(0.1);
|
|
170
182
|
expect(purchase.entryId).toBe('W.TEST.001');
|
|
171
183
|
});
|
|
172
184
|
|
|
173
185
|
it('prevents duplicate listings', () => {
|
|
174
186
|
const mp = new KnowledgeMarketplace();
|
|
175
187
|
const entry = mockEntry();
|
|
176
|
-
mp.sellKnowledge(entry, 0.
|
|
177
|
-
const dup = mp.sellKnowledge(entry, 0.
|
|
188
|
+
mp.sellKnowledge(entry, 0.1, 'alice');
|
|
189
|
+
const dup = mp.sellKnowledge(entry, 0.2, 'alice');
|
|
178
190
|
expect(dup.success).toBe(false);
|
|
179
191
|
expect(dup.error).toContain('already listed');
|
|
180
192
|
});
|
|
@@ -182,7 +194,7 @@ describe('KnowledgeMarketplace', () => {
|
|
|
182
194
|
it('prevents buying your own listing', () => {
|
|
183
195
|
const mp = new KnowledgeMarketplace();
|
|
184
196
|
const entry = mockEntry();
|
|
185
|
-
const listing = mp.sellKnowledge(entry, 0.
|
|
197
|
+
const listing = mp.sellKnowledge(entry, 0.1, 'alice');
|
|
186
198
|
const purchase = mp.buyKnowledge(listing.listingId, 'alice');
|
|
187
199
|
expect(purchase.success).toBe(false);
|
|
188
200
|
expect(purchase.error).toContain('own listing');
|
|
@@ -191,7 +203,7 @@ describe('KnowledgeMarketplace', () => {
|
|
|
191
203
|
it('prevents buying a sold listing', () => {
|
|
192
204
|
const mp = new KnowledgeMarketplace();
|
|
193
205
|
const entry = mockEntry();
|
|
194
|
-
const listing = mp.sellKnowledge(entry, 0.
|
|
206
|
+
const listing = mp.sellKnowledge(entry, 0.1, 'alice');
|
|
195
207
|
mp.buyKnowledge(listing.listingId, 'bob');
|
|
196
208
|
const second = mp.buyKnowledge(listing.listingId, 'charlie');
|
|
197
209
|
expect(second.success).toBe(false);
|
|
@@ -207,7 +219,7 @@ describe('KnowledgeMarketplace', () => {
|
|
|
207
219
|
it('delists an active listing', () => {
|
|
208
220
|
const mp = new KnowledgeMarketplace();
|
|
209
221
|
const entry = mockEntry();
|
|
210
|
-
const listing = mp.sellKnowledge(entry, 0.
|
|
222
|
+
const listing = mp.sellKnowledge(entry, 0.1, 'alice');
|
|
211
223
|
expect(mp.delist(listing.listingId, 'alice')).toBe(true);
|
|
212
224
|
expect(mp.activeListings()).toHaveLength(0);
|
|
213
225
|
});
|
|
@@ -215,7 +227,7 @@ describe('KnowledgeMarketplace', () => {
|
|
|
215
227
|
it('only seller can delist', () => {
|
|
216
228
|
const mp = new KnowledgeMarketplace();
|
|
217
229
|
const entry = mockEntry();
|
|
218
|
-
const listing = mp.sellKnowledge(entry, 0.
|
|
230
|
+
const listing = mp.sellKnowledge(entry, 0.1, 'alice');
|
|
219
231
|
expect(mp.delist(listing.listingId, 'bob')).toBe(false);
|
|
220
232
|
});
|
|
221
233
|
|
|
@@ -223,7 +235,7 @@ describe('KnowledgeMarketplace', () => {
|
|
|
223
235
|
const mp = new KnowledgeMarketplace();
|
|
224
236
|
const e1 = mockEntry({ id: 'W.TEST.001' });
|
|
225
237
|
const e2 = mockEntry({ id: 'W.TEST.002' });
|
|
226
|
-
const l1 = mp.sellKnowledge(e1, 0.
|
|
238
|
+
const l1 = mp.sellKnowledge(e1, 0.1, 'alice');
|
|
227
239
|
const l2 = mp.sellKnowledge(e2, 0.25, 'alice');
|
|
228
240
|
mp.buyKnowledge(l1.listingId, 'bob');
|
|
229
241
|
mp.buyKnowledge(l2.listingId, 'charlie');
|
|
@@ -233,7 +245,7 @@ describe('KnowledgeMarketplace', () => {
|
|
|
233
245
|
it('tracks purchase history', () => {
|
|
234
246
|
const mp = new KnowledgeMarketplace();
|
|
235
247
|
const e1 = mockEntry({ id: 'W.TEST.001' });
|
|
236
|
-
const listing = mp.sellKnowledge(e1, 0.
|
|
248
|
+
const listing = mp.sellKnowledge(e1, 0.1, 'alice');
|
|
237
249
|
mp.buyKnowledge(listing.listingId, 'bob');
|
|
238
250
|
expect(mp.purchaseHistory('bob')).toHaveLength(1);
|
|
239
251
|
expect(mp.purchaseHistory('charlie')).toHaveLength(0);
|
|
@@ -243,11 +255,11 @@ describe('KnowledgeMarketplace', () => {
|
|
|
243
255
|
const mp = new KnowledgeMarketplace();
|
|
244
256
|
const e1 = mockEntry({ id: 'W.TEST.001' });
|
|
245
257
|
const e2 = mockEntry({ id: 'W.TEST.002' });
|
|
246
|
-
const l1 = mp.sellKnowledge(e1, 0.
|
|
247
|
-
const l2 = mp.sellKnowledge(e2, 0.
|
|
258
|
+
const l1 = mp.sellKnowledge(e1, 0.1, 'alice');
|
|
259
|
+
const l2 = mp.sellKnowledge(e2, 0.2, 'bob');
|
|
248
260
|
mp.buyKnowledge(l1.listingId, 'bob');
|
|
249
261
|
mp.buyKnowledge(l2.listingId, 'alice');
|
|
250
|
-
expect(mp.totalVolume()).toBeCloseTo(0.
|
|
262
|
+
expect(mp.totalVolume()).toBeCloseTo(0.3);
|
|
251
263
|
});
|
|
252
264
|
});
|
|
253
265
|
|
|
@@ -257,7 +269,13 @@ describe('KnowledgeStore marketplace integration', () => {
|
|
|
257
269
|
it('prices and lists entries via store', () => {
|
|
258
270
|
const store = new KnowledgeStore({ persist: false });
|
|
259
271
|
const entry = store.publish(
|
|
260
|
-
{
|
|
272
|
+
{
|
|
273
|
+
type: 'wisdom',
|
|
274
|
+
content: 'Cache invalidation matters',
|
|
275
|
+
domain: 'engineering',
|
|
276
|
+
confidence: 0.9,
|
|
277
|
+
source: 'test',
|
|
278
|
+
},
|
|
261
279
|
'alice'
|
|
262
280
|
);
|
|
263
281
|
const price = store.priceEntry(entry.id);
|
|
@@ -270,7 +288,13 @@ describe('KnowledgeStore marketplace integration', () => {
|
|
|
270
288
|
it('buys a listed entry and increments reuseCount', () => {
|
|
271
289
|
const store = new KnowledgeStore({ persist: false });
|
|
272
290
|
const entry = store.publish(
|
|
273
|
-
{
|
|
291
|
+
{
|
|
292
|
+
type: 'pattern',
|
|
293
|
+
content: 'Use dependency injection',
|
|
294
|
+
domain: 'architecture',
|
|
295
|
+
confidence: 0.8,
|
|
296
|
+
source: 'test',
|
|
297
|
+
},
|
|
274
298
|
'alice'
|
|
275
299
|
);
|
|
276
300
|
const listing = store.listForSale(entry.id, 'alice', 0.05);
|
|
@@ -283,7 +307,13 @@ describe('KnowledgeStore marketplace integration', () => {
|
|
|
283
307
|
it('returns active listings', () => {
|
|
284
308
|
const store = new KnowledgeStore({ persist: false });
|
|
285
309
|
const e1 = store.publish(
|
|
286
|
-
{
|
|
310
|
+
{
|
|
311
|
+
type: 'gotcha',
|
|
312
|
+
content: 'Watch out for NaN',
|
|
313
|
+
domain: 'js',
|
|
314
|
+
confidence: 0.7,
|
|
315
|
+
source: 'test',
|
|
316
|
+
},
|
|
287
317
|
'alice'
|
|
288
318
|
);
|
|
289
319
|
store.listForSale(e1.id, 'alice');
|
|
@@ -328,7 +358,9 @@ describe('Team bounty integration', () => {
|
|
|
328
358
|
|
|
329
359
|
it('rejects bounty for nonexistent task', () => {
|
|
330
360
|
const team = makeTeam();
|
|
331
|
-
expect(() => team.createBounty('nope', { amount: 1, currency: 'credits' }, 'a')).toThrow(
|
|
361
|
+
expect(() => team.createBounty('nope', { amount: 1, currency: 'credits' }, 'a')).toThrow(
|
|
362
|
+
'not found'
|
|
363
|
+
);
|
|
332
364
|
});
|
|
333
365
|
|
|
334
366
|
it('claims bounty for a team agent', async () => {
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import { describe, it, expect, beforeEach } from 'vitest';
|
|
2
|
-
import {
|
|
3
|
-
DelegationManager,
|
|
4
|
-
InProcessBoardAdapter,
|
|
5
|
-
} from '../delegation';
|
|
2
|
+
import { DelegationManager, InProcessBoardAdapter } from '../delegation';
|
|
6
3
|
import type { TaskDef } from '../types';
|
|
7
4
|
|
|
8
5
|
function makeTask(overrides: Partial<TaskDef> = {}): TaskDef {
|
|
@@ -4,12 +4,7 @@
|
|
|
4
4
|
* Tests the done-log audit logic: violations, stats, and Team.audit() integration.
|
|
5
5
|
*/
|
|
6
6
|
import { describe, it, expect, vi } from 'vitest';
|
|
7
|
-
import {
|
|
8
|
-
DoneLogAuditor,
|
|
9
|
-
auditDoneLog,
|
|
10
|
-
isLikelyReportEntry,
|
|
11
|
-
isCommitProof,
|
|
12
|
-
} from '../board/audit';
|
|
7
|
+
import { DoneLogAuditor, auditDoneLog, isLikelyReportEntry, isCommitProof } from '../board/audit';
|
|
13
8
|
import type { DoneLogEntry } from '../board/board-types';
|
|
14
9
|
import { Team } from '../team';
|
|
15
10
|
|
|
@@ -85,10 +80,7 @@ describe('auditDoneLog', () => {
|
|
|
85
80
|
});
|
|
86
81
|
|
|
87
82
|
it('counts verified and unverified', () => {
|
|
88
|
-
const entries = [
|
|
89
|
-
makeEntry({ commitHash: 'abc1234' }),
|
|
90
|
-
makeEntry({ commitHash: undefined }),
|
|
91
|
-
];
|
|
83
|
+
const entries = [makeEntry({ commitHash: 'abc1234' }), makeEntry({ commitHash: undefined })];
|
|
92
84
|
const result = auditDoneLog(entries);
|
|
93
85
|
expect(result.verified).toBe(1);
|
|
94
86
|
expect(result.unverified).toBe(1);
|
|
@@ -135,21 +127,21 @@ describe('DoneLogAuditor.audit()', () => {
|
|
|
135
127
|
const entries = [makeEntry({ completedBy: '' })];
|
|
136
128
|
const auditor = new DoneLogAuditor(entries);
|
|
137
129
|
const violations = auditor.audit();
|
|
138
|
-
expect(violations.some(v => v.rule === 'missing-completedBy')).toBe(true);
|
|
130
|
+
expect(violations.some((v) => v.rule === 'missing-completedBy')).toBe(true);
|
|
139
131
|
});
|
|
140
132
|
|
|
141
133
|
it('detects missing summary', () => {
|
|
142
134
|
const entries = [makeEntry({ summary: '' })];
|
|
143
135
|
const auditor = new DoneLogAuditor(entries);
|
|
144
136
|
const violations = auditor.audit();
|
|
145
|
-
expect(violations.some(v => v.rule === 'missing-summary')).toBe(true);
|
|
137
|
+
expect(violations.some((v) => v.rule === 'missing-summary')).toBe(true);
|
|
146
138
|
});
|
|
147
139
|
|
|
148
140
|
it('detects missing commit proof', () => {
|
|
149
141
|
const entries = [makeEntry({ commitHash: undefined })];
|
|
150
142
|
const auditor = new DoneLogAuditor(entries);
|
|
151
143
|
const violations = auditor.audit();
|
|
152
|
-
expect(violations.some(v => v.rule === 'missing-commit')).toBe(true);
|
|
144
|
+
expect(violations.some((v) => v.rule === 'missing-commit')).toBe(true);
|
|
153
145
|
});
|
|
154
146
|
|
|
155
147
|
it('detects duplicate taskId entries', () => {
|
|
@@ -159,7 +151,7 @@ describe('DoneLogAuditor.audit()', () => {
|
|
|
159
151
|
];
|
|
160
152
|
const auditor = new DoneLogAuditor(entries);
|
|
161
153
|
const violations = auditor.audit();
|
|
162
|
-
expect(violations.some(v => v.rule === 'duplicate-entry')).toBe(true);
|
|
154
|
+
expect(violations.some((v) => v.rule === 'duplicate-entry')).toBe(true);
|
|
163
155
|
});
|
|
164
156
|
|
|
165
157
|
it('detects non-monotonic timestamps', () => {
|
|
@@ -169,7 +161,7 @@ describe('DoneLogAuditor.audit()', () => {
|
|
|
169
161
|
];
|
|
170
162
|
const auditor = new DoneLogAuditor(entries);
|
|
171
163
|
const violations = auditor.audit();
|
|
172
|
-
expect(violations.some(v => v.rule === 'non-monotonic-timestamp')).toBe(true);
|
|
164
|
+
expect(violations.some((v) => v.rule === 'non-monotonic-timestamp')).toBe(true);
|
|
173
165
|
});
|
|
174
166
|
|
|
175
167
|
it('skips report entries from field checks', () => {
|
|
@@ -204,9 +196,9 @@ describe('DoneLogAuditor.stats()', () => {
|
|
|
204
196
|
const auditor = new DoneLogAuditor(entries);
|
|
205
197
|
const stats = auditor.stats();
|
|
206
198
|
expect(stats.byAgent).toHaveLength(2);
|
|
207
|
-
const alice = stats.byAgent.find(a => a.agent === 'alice');
|
|
199
|
+
const alice = stats.byAgent.find((a) => a.agent === 'alice');
|
|
208
200
|
expect(alice?.completed).toBe(2);
|
|
209
|
-
const bob = stats.byAgent.find(a => a.agent === 'bob');
|
|
201
|
+
const bob = stats.byAgent.find((a) => a.agent === 'bob');
|
|
210
202
|
expect(bob?.completed).toBe(1);
|
|
211
203
|
});
|
|
212
204
|
|
|
@@ -217,18 +209,16 @@ describe('DoneLogAuditor.stats()', () => {
|
|
|
217
209
|
];
|
|
218
210
|
const auditor = new DoneLogAuditor(entries);
|
|
219
211
|
const stats = auditor.stats();
|
|
220
|
-
const alice = stats.byAgent.find(a => a.agent === 'alice');
|
|
212
|
+
const alice = stats.byAgent.find((a) => a.agent === 'alice');
|
|
221
213
|
expect(alice?.verified).toBe(1);
|
|
222
214
|
expect(alice?.unverified).toBe(1);
|
|
223
215
|
});
|
|
224
216
|
|
|
225
217
|
it('detects synthesizer source from taskId', () => {
|
|
226
|
-
const entries = [
|
|
227
|
-
makeEntry({ taskId: 'task_synth_001' }),
|
|
228
|
-
];
|
|
218
|
+
const entries = [makeEntry({ taskId: 'task_synth_001' })];
|
|
229
219
|
const auditor = new DoneLogAuditor(entries);
|
|
230
220
|
const stats = auditor.stats();
|
|
231
|
-
expect(stats.bySource.some(s => s.source === 'synthesizer')).toBe(true);
|
|
221
|
+
expect(stats.bySource.some((s) => s.source === 'synthesizer')).toBe(true);
|
|
232
222
|
});
|
|
233
223
|
|
|
234
224
|
it('groups completion over time by date', () => {
|
|
@@ -275,7 +265,7 @@ describe('DoneLogAuditor.fullAudit()', () => {
|
|
|
275
265
|
expect(result.audit.unverified).toBe(1);
|
|
276
266
|
|
|
277
267
|
// violations
|
|
278
|
-
expect(result.violations.some(v => v.rule === 'missing-commit')).toBe(true);
|
|
268
|
+
expect(result.violations.some((v) => v.rule === 'missing-commit')).toBe(true);
|
|
279
269
|
|
|
280
270
|
// stats
|
|
281
271
|
expect(result.stats.total).toBe(2);
|
|
@@ -306,29 +296,31 @@ describe('Team.audit()', () => {
|
|
|
306
296
|
|
|
307
297
|
// Mock fetch for the remote board call
|
|
308
298
|
const fetchSpy = vi.spyOn(globalThis, 'fetch').mockResolvedValueOnce(
|
|
309
|
-
new Response(
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
299
|
+
new Response(
|
|
300
|
+
JSON.stringify({
|
|
301
|
+
board: {
|
|
302
|
+
open: [],
|
|
303
|
+
claimed: [],
|
|
304
|
+
done_log: [
|
|
305
|
+
{
|
|
306
|
+
taskId: 't1',
|
|
307
|
+
title: 'Remote task',
|
|
308
|
+
completedBy: 'remote-agent',
|
|
309
|
+
commitHash: 'abcdef1',
|
|
310
|
+
timestamp: '2026-04-05T10:00:00Z',
|
|
311
|
+
summary: 'Done remotely',
|
|
312
|
+
},
|
|
313
|
+
{
|
|
314
|
+
taskId: 't2',
|
|
315
|
+
title: 'Another remote task',
|
|
316
|
+
completedBy: 'remote-agent',
|
|
317
|
+
timestamp: '2026-04-05T11:00:00Z',
|
|
318
|
+
summary: 'Also done',
|
|
319
|
+
},
|
|
320
|
+
],
|
|
321
|
+
},
|
|
322
|
+
})
|
|
323
|
+
)
|
|
332
324
|
);
|
|
333
325
|
|
|
334
326
|
const result = await team.audit();
|