@yyc3/ai-family-kernel 0.0.0-stage → 2.54.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/README.md +11 -2
- package/dist/src/01-/344/271/235/345/261/202/346/236/266/346/236/204/345/210/206/345/261/202/345/272/225/345/272/247/index.d.ts +24 -0
- package/dist/src/01-/344/271/235/345/261/202/346/236/266/346/236/204/345/210/206/345/261/202/345/272/225/345/272/247/index.js +24 -0
- package/dist/src/01-/344/271/235/345/261/202/346/236/266/346/236/204/345/210/206/345/261/202/345/272/225/345/272/247/layer-1-foundation/foundation-capability.d.ts +16 -0
- package/dist/src/01-/344/271/235/345/261/202/346/236/266/346/236/204/345/210/206/345/261/202/345/272/225/345/272/247/layer-1-foundation/foundation-capability.js +29 -0
- package/dist/src/01-/344/271/235/345/261/202/346/236/266/346/236/204/345/210/206/345/261/202/345/272/225/345/272/247/layer-1-foundation/index.d.ts +4 -0
- package/dist/src/01-/344/271/235/345/261/202/346/236/266/346/236/204/345/210/206/345/261/202/345/272/225/345/272/247/layer-1-foundation/index.js +4 -0
- package/dist/src/01-/344/271/235/345/261/202/346/236/266/346/236/204/345/210/206/345/261/202/345/272/225/345/272/247/layer-2-bole/bole-capability.d.ts +16 -0
- package/dist/src/01-/344/271/235/345/261/202/346/236/266/346/236/204/345/210/206/345/261/202/345/272/225/345/272/247/layer-2-bole/bole-capability.js +29 -0
- package/dist/src/01-/344/271/235/345/261/202/346/236/266/346/236/204/345/210/206/345/261/202/345/272/225/345/272/247/layer-2-bole/index.d.ts +4 -0
- package/dist/src/01-/344/271/235/345/261/202/346/236/266/346/236/204/345/210/206/345/261/202/345/272/225/345/272/247/layer-2-bole/index.js +4 -0
- package/dist/src/01-/344/271/235/345/261/202/346/236/266/346/236/204/345/210/206/345/261/202/345/272/225/345/272/247/layer-3-prophet/index.d.ts +4 -0
- package/dist/src/01-/344/271/235/345/261/202/346/236/266/346/236/204/345/210/206/345/261/202/345/272/225/345/272/247/layer-3-prophet/index.js +4 -0
- package/dist/src/01-/344/271/235/345/261/202/346/236/266/346/236/204/345/210/206/345/261/202/345/272/225/345/272/247/layer-3-prophet/prophet-capability.d.ts +16 -0
- package/dist/src/01-/344/271/235/345/261/202/346/236/266/346/236/204/345/210/206/345/261/202/345/272/225/345/272/247/layer-3-prophet/prophet-capability.js +29 -0
- package/dist/src/01-/344/271/235/345/261/202/346/236/266/346/236/204/345/210/206/345/261/202/345/272/225/345/272/247/layer-4-thinker/index.d.ts +4 -0
- package/dist/src/01-/344/271/235/345/261/202/346/236/266/346/236/204/345/210/206/345/261/202/345/272/225/345/272/247/layer-4-thinker/index.js +4 -0
- package/dist/src/01-/344/271/235/345/261/202/346/236/266/346/236/204/345/210/206/345/261/202/345/272/225/345/272/247/layer-4-thinker/thinker-capability.d.ts +16 -0
- package/dist/src/01-/344/271/235/345/261/202/346/236/266/346/236/204/345/210/206/345/261/202/345/272/225/345/272/247/layer-4-thinker/thinker-capability.js +29 -0
- package/dist/src/01-/344/271/235/345/261/202/346/236/266/346/236/204/345/210/206/345/261/202/345/272/225/345/272/247/layer-5-navigator/index.d.ts +4 -0
- package/dist/src/01-/344/271/235/345/261/202/346/236/266/346/236/204/345/210/206/345/261/202/345/272/225/345/272/247/layer-5-navigator/index.js +4 -0
- package/dist/src/01-/344/271/235/345/261/202/346/236/266/346/236/204/345/210/206/345/261/202/345/272/225/345/272/247/layer-5-navigator/navigator-capability.d.ts +16 -0
- package/dist/src/01-/344/271/235/345/261/202/346/236/266/346/236/204/345/210/206/345/261/202/345/272/225/345/272/247/layer-5-navigator/navigator-capability.js +29 -0
- package/dist/src/01-/344/271/235/345/261/202/346/236/266/346/236/204/345/210/206/345/261/202/345/272/225/345/272/247/layer-6-creative/creative-capability.d.ts +16 -0
- package/dist/src/01-/344/271/235/345/261/202/346/236/266/346/236/204/345/210/206/345/261/202/345/272/225/345/272/247/layer-6-creative/creative-capability.js +29 -0
- package/dist/src/01-/344/271/235/345/261/202/346/236/266/346/236/204/345/210/206/345/261/202/345/272/225/345/272/247/layer-6-creative/index.d.ts +4 -0
- package/dist/src/01-/344/271/235/345/261/202/346/236/266/346/236/204/345/210/206/345/261/202/345/272/225/345/272/247/layer-6-creative/index.js +4 -0
- package/dist/src/01-/344/271/235/345/261/202/346/236/266/346/236/204/345/210/206/345/261/202/345/272/225/345/272/247/layer-7-master/index.d.ts +4 -0
- package/dist/src/01-/344/271/235/345/261/202/346/236/266/346/236/204/345/210/206/345/261/202/345/272/225/345/272/247/layer-7-master/index.js +4 -0
- package/dist/src/01-/344/271/235/345/261/202/346/236/266/346/236/204/345/210/206/345/261/202/345/272/225/345/272/247/layer-7-master/master-capability.d.ts +16 -0
- package/dist/src/01-/344/271/235/345/261/202/346/236/266/346/236/204/345/210/206/345/261/202/345/272/225/345/272/247/layer-7-master/master-capability.js +29 -0
- package/dist/src/01-/344/271/235/345/261/202/346/236/266/346/236/204/345/210/206/345/261/202/345/272/225/345/272/247/layer-8-guardian/guardian-capability.d.ts +16 -0
- package/dist/src/01-/344/271/235/345/261/202/346/236/266/346/236/204/345/210/206/345/261/202/345/272/225/345/272/247/layer-8-guardian/guardian-capability.js +29 -0
- package/dist/src/01-/344/271/235/345/261/202/346/236/266/346/236/204/345/210/206/345/261/202/345/272/225/345/272/247/layer-8-guardian/index.d.ts +4 -0
- package/dist/src/01-/344/271/235/345/261/202/346/236/266/346/236/204/345/210/206/345/261/202/345/272/225/345/272/247/layer-8-guardian/index.js +4 -0
- package/dist/src/01-/344/271/235/345/261/202/346/236/266/346/236/204/345/210/206/345/261/202/345/272/225/345/272/247/layer-9-meta-oracle/index.d.ts +4 -0
- package/dist/src/01-/344/271/235/345/261/202/346/236/266/346/236/204/345/210/206/345/261/202/345/272/225/345/272/247/layer-9-meta-oracle/index.js +4 -0
- package/dist/src/01-/344/271/235/345/261/202/346/236/266/346/236/204/345/210/206/345/261/202/345/272/225/345/272/247/layer-9-meta-oracle/meta-oracle-capability.d.ts +17 -0
- package/dist/src/01-/344/271/235/345/261/202/346/236/266/346/236/204/345/210/206/345/261/202/345/272/225/345/272/247/layer-9-meta-oracle/meta-oracle-capability.js +30 -0
- package/dist/src/01-/344/271/235/345/261/202/346/236/266/346/236/204/345/210/206/345/261/202/345/272/225/345/272/247/layer-registry.d.ts +34 -0
- package/dist/src/01-/344/271/235/345/261/202/346/236/266/346/236/204/345/210/206/345/261/202/345/272/225/345/272/247/layer-registry.js +76 -0
- package/dist/src/01-/344/271/235/345/261/202/346/236/266/346/236/204/345/210/206/345/261/202/345/272/225/345/272/247/types.d.ts +49 -0
- package/dist/src/01-/344/271/235/345/261/202/346/236/266/346/236/204/345/210/206/345/261/202/345/272/225/345/272/247/types.js +33 -0
- package/dist/src/02-/344/272/221/346/236/242/346/240/270/345/277/203/345/274/225/346/223/216/cloud-pivot-orchestrator/index.d.ts +7 -0
- package/dist/src/02-/344/272/221/346/236/242/346/240/270/345/277/203/345/274/225/346/223/216/cloud-pivot-orchestrator/index.js +7 -0
- package/dist/src/02-/344/272/221/346/236/242/346/240/270/345/277/203/345/274/225/346/223/216/cloud-pivot-orchestrator/orchestrator.d.ts +47 -0
- package/dist/src/02-/344/272/221/346/236/242/346/240/270/345/277/203/345/274/225/346/223/216/cloud-pivot-orchestrator/orchestrator.js +59 -0
- package/dist/src/02-/344/272/221/346/236/242/346/240/270/345/277/203/345/274/225/346/223/216/cloud-pivot-orchestrator/task-decomposer.d.ts +21 -0
- package/dist/src/02-/344/272/221/346/236/242/346/240/270/345/277/203/345/274/225/346/223/216/cloud-pivot-orchestrator/task-decomposer.js +72 -0
- package/dist/src/02-/344/272/221/346/236/242/346/240/270/345/277/203/345/274/225/346/223/216/cloud-pivot-orchestrator/verification-gateway/confidence-calibrator.d.ts +31 -0
- package/dist/src/02-/344/272/221/346/236/242/346/240/270/345/277/203/345/274/225/346/223/216/cloud-pivot-orchestrator/verification-gateway/confidence-calibrator.js +39 -0
- package/dist/src/02-/344/272/221/346/236/242/346/240/270/345/277/203/345/274/225/346/223/216/cloud-pivot-orchestrator/verification-gateway/consistency-metrics.d.ts +45 -0
- package/dist/src/02-/344/272/221/346/236/242/346/240/270/345/277/203/345/274/225/346/223/216/cloud-pivot-orchestrator/verification-gateway/consistency-metrics.js +44 -0
- package/dist/src/02-/344/272/221/346/236/242/346/240/270/345/277/203/345/274/225/346/223/216/cloud-pivot-orchestrator/verification-gateway/cross-validator.d.ts +44 -0
- package/dist/src/02-/344/272/221/346/236/242/346/240/270/345/277/203/345/274/225/346/223/216/cloud-pivot-orchestrator/verification-gateway/cross-validator.js +69 -0
- package/dist/src/02-/344/272/221/346/236/242/346/240/270/345/277/203/345/274/225/346/223/216/cloud-pivot-orchestrator/verification-gateway/gateway.d.ts +64 -0
- package/dist/src/02-/344/272/221/346/236/242/346/240/270/345/277/203/345/274/225/346/223/216/cloud-pivot-orchestrator/verification-gateway/gateway.js +96 -0
- package/dist/src/02-/344/272/221/346/236/242/346/240/270/345/277/203/345/274/225/346/223/216/cloud-pivot-orchestrator/verification-gateway/ground-truth-checker.d.ts +33 -0
- package/dist/src/02-/344/272/221/346/236/242/346/240/270/345/277/203/345/274/225/346/223/216/cloud-pivot-orchestrator/verification-gateway/ground-truth-checker.js +74 -0
- package/dist/src/02-/344/272/221/346/236/242/346/240/270/345/277/203/345/274/225/346/223/216/cloud-pivot-orchestrator/verification-gateway/index.d.ts +12 -0
- package/dist/src/02-/344/272/221/346/236/242/346/240/270/345/277/203/345/274/225/346/223/216/cloud-pivot-orchestrator/verification-gateway/index.js +12 -0
- package/dist/src/02-/344/272/221/346/236/242/346/240/270/345/277/203/345/274/225/346/223/216/cloud-pivot-orchestrator/verification-gateway/oracle-registry.d.ts +18 -0
- package/dist/src/02-/344/272/221/346/236/242/346/240/270/345/277/203/345/274/225/346/223/216/cloud-pivot-orchestrator/verification-gateway/oracle-registry.js +26 -0
- package/dist/src/02-/344/272/221/346/236/242/346/240/270/345/277/203/345/274/225/346/223/216/dashu-self-healing/index.d.ts +5 -0
- package/dist/src/02-/344/272/221/346/236/242/346/240/270/345/277/203/345/274/225/346/223/216/dashu-self-healing/index.js +5 -0
- package/dist/src/02-/344/272/221/346/236/242/346/240/270/345/277/203/345/274/225/346/223/216/dashu-self-healing/self-healing-controller.d.ts +33 -0
- package/dist/src/02-/344/272/221/346/236/242/346/240/270/345/277/203/345/274/225/346/223/216/dashu-self-healing/self-healing-controller.js +68 -0
- package/dist/src/02-/344/272/221/346/236/242/346/240/270/345/277/203/345/274/225/346/223/216/family-communication-bus/event-bus.d.ts +99 -0
- package/dist/src/02-/344/272/221/346/236/242/346/240/270/345/277/203/345/274/225/346/223/216/family-communication-bus/event-bus.js +178 -0
- package/dist/src/02-/344/272/221/346/236/242/346/240/270/345/277/203/345/274/225/346/223/216/family-communication-bus/index.d.ts +7 -0
- package/dist/src/02-/344/272/221/346/236/242/346/240/270/345/277/203/345/274/225/346/223/216/family-communication-bus/index.js +7 -0
- package/dist/src/02-/344/272/221/346/236/242/346/240/270/345/277/203/345/274/225/346/223/216/family-communication-bus/trajectory-bridge.d.ts +57 -0
- package/dist/src/02-/344/272/221/346/236/242/346/240/270/345/277/203/345/274/225/346/223/216/family-communication-bus/trajectory-bridge.js +72 -0
- package/dist/src/02-/344/272/221/346/236/242/346/240/270/345/277/203/345/274/225/346/223/216/family-phone-system/index.d.ts +4 -0
- package/dist/src/02-/344/272/221/346/236/242/346/240/270/345/277/203/345/274/225/346/223/216/family-phone-system/index.js +4 -0
- package/dist/src/02-/344/272/221/346/236/242/346/240/270/345/277/203/345/274/225/346/223/216/family-phone-system/phone-system.d.ts +46 -0
- package/dist/src/02-/344/272/221/346/236/242/346/240/270/345/277/203/345/274/225/346/223/216/family-phone-system/phone-system.js +85 -0
- package/dist/src/02-/344/272/221/346/236/242/346/240/270/345/277/203/345/274/225/346/223/216/global-status-center/index.d.ts +4 -0
- package/dist/src/02-/344/272/221/346/236/242/346/240/270/345/277/203/345/274/225/346/223/216/global-status-center/index.js +4 -0
- package/dist/src/02-/344/272/221/346/236/242/346/240/270/345/277/203/345/274/225/346/223/216/global-status-center/status-center.d.ts +27 -0
- package/dist/src/02-/344/272/221/346/236/242/346/240/270/345/277/203/345/274/225/346/223/216/global-status-center/status-center.js +57 -0
- package/dist/src/02-/344/272/221/346/236/242/346/240/270/345/277/203/345/274/225/346/223/216/index.d.ts +21 -0
- package/dist/src/02-/344/272/221/346/236/242/346/240/270/345/277/203/345/274/225/346/223/216/index.js +21 -0
- package/dist/src/02-/344/272/221/346/236/242/346/240/270/345/277/203/345/274/225/346/223/216/mcp-adapter/bus-mcp-codec.d.ts +29 -0
- package/dist/src/02-/344/272/221/346/236/242/346/240/270/345/277/203/345/274/225/346/223/216/mcp-adapter/bus-mcp-codec.js +84 -0
- package/dist/src/02-/344/272/221/346/236/242/346/240/270/345/277/203/345/274/225/346/223/216/mcp-adapter/index.d.ts +31 -0
- package/dist/src/02-/344/272/221/346/236/242/346/240/270/345/277/203/345/274/225/346/223/216/mcp-adapter/index.js +28 -0
- package/dist/src/02-/344/272/221/346/236/242/346/240/270/345/277/203/345/274/225/346/223/216/mcp-adapter/server/index.d.ts +5 -0
- package/dist/src/02-/344/272/221/346/236/242/346/240/270/345/277/203/345/274/225/346/223/216/mcp-adapter/server/index.js +5 -0
- package/dist/src/02-/344/272/221/346/236/242/346/240/270/345/277/203/345/274/225/346/223/216/mcp-adapter/server/protocol.d.ts +80 -0
- package/dist/src/02-/344/272/221/346/236/242/346/240/270/345/277/203/345/274/225/346/223/216/mcp-adapter/server/protocol.js +148 -0
- package/dist/src/02-/344/272/221/346/236/242/346/240/270/345/277/203/345/274/225/346/223/216/mcp-adapter/stdio-transport.d.ts +47 -0
- package/dist/src/02-/344/272/221/346/236/242/346/240/270/345/277/203/345/274/225/346/223/216/mcp-adapter/stdio-transport.js +178 -0
- package/dist/src/02-/344/272/221/346/236/242/346/240/270/345/277/203/345/274/225/346/223/216/mcp-adapter/types.d.ts +63 -0
- package/dist/src/02-/344/272/221/346/236/242/346/240/270/345/277/203/345/274/225/346/223/216/mcp-adapter/types.js +7 -0
- package/dist/src/02-/344/272/221/346/236/242/346/240/270/345/277/203/345/274/225/346/223/216/types.d.ts +167 -0
- package/dist/src/02-/344/272/221/346/236/242/346/240/270/345/277/203/345/274/225/346/223/216/types.js +23 -0
- package/dist/src/05-/346/214/201/347/273/255/345/255/246/344/271/240/345/274/225/346/223/216/experience-reflow/index.d.ts +7 -0
- package/dist/src/05-/346/214/201/347/273/255/345/255/246/344/271/240/345/274/225/346/223/216/experience-reflow/index.js +7 -0
- package/dist/src/05-/346/214/201/347/273/255/345/255/246/344/271/240/345/274/225/346/223/216/experience-reflow/outcome-labeler.d.ts +34 -0
- package/dist/src/05-/346/214/201/347/273/255/345/255/246/344/271/240/345/274/225/346/223/216/experience-reflow/outcome-labeler.js +38 -0
- package/dist/src/05-/346/214/201/347/273/255/345/255/246/344/271/240/345/274/225/346/223/216/experience-reflow/pattern-extractor.d.ts +64 -0
- package/dist/src/05-/346/214/201/347/273/255/345/255/246/344/271/240/345/274/225/346/223/216/experience-reflow/pattern-extractor.js +94 -0
- package/dist/src/05-/346/214/201/347/273/255/345/255/246/344/271/240/345/274/225/346/223/216/experience-reflow/trajectory-collector.d.ts +39 -0
- package/dist/src/05-/346/214/201/347/273/255/345/255/246/344/271/240/345/274/225/346/223/216/experience-reflow/trajectory-collector.js +36 -0
- package/dist/src/05-/346/214/201/347/273/255/345/255/246/344/271/240/345/274/225/346/223/216/index.d.ts +23 -0
- package/dist/src/05-/346/214/201/347/273/255/345/255/246/344/271/240/345/274/225/346/223/216/index.js +23 -0
- package/dist/src/05-/346/214/201/347/273/255/345/255/246/344/271/240/345/274/225/346/223/216/knowledge-update/index.d.ts +7 -0
- package/dist/src/05-/346/214/201/347/273/255/345/255/246/344/271/240/345/274/225/346/223/216/knowledge-update/index.js +7 -0
- package/dist/src/05-/346/214/201/347/273/255/345/255/246/344/271/240/345/274/225/346/223/216/knowledge-update/preference-tracker.d.ts +32 -0
- package/dist/src/05-/346/214/201/347/273/255/345/255/246/344/271/240/345/274/225/346/223/216/knowledge-update/preference-tracker.js +49 -0
- package/dist/src/05-/346/214/201/347/273/255/345/255/246/344/271/240/345/274/225/346/223/216/knowledge-update/rule-evolution.d.ts +41 -0
- package/dist/src/05-/346/214/201/347/273/255/345/255/246/344/271/240/345/274/225/346/223/216/knowledge-update/rule-evolution.js +60 -0
- package/dist/src/05-/346/214/201/347/273/255/345/255/246/344/271/240/345/274/225/346/223/216/knowledge-update/semantic-diff.d.ts +32 -0
- package/dist/src/05-/346/214/201/347/273/255/345/255/246/344/271/240/345/274/225/346/223/216/knowledge-update/semantic-diff.js +69 -0
- package/dist/src/05-/346/214/201/347/273/255/345/255/246/344/271/240/345/274/225/346/223/216/learning-loop.d.ts +146 -0
- package/dist/src/05-/346/214/201/347/273/255/345/255/246/344/271/240/345/274/225/346/223/216/learning-loop.js +171 -0
- package/dist/src/05-/346/214/201/347/273/255/345/255/246/344/271/240/345/274/225/346/223/216/learning-scheduler/budget-allocator.d.ts +29 -0
- package/dist/src/05-/346/214/201/347/273/255/345/255/246/344/271/240/345/274/225/346/223/216/learning-scheduler/budget-allocator.js +58 -0
- package/dist/src/05-/346/214/201/347/273/255/345/255/246/344/271/240/345/274/225/346/223/216/learning-scheduler/index.d.ts +6 -0
- package/dist/src/05-/346/214/201/347/273/255/345/255/246/344/271/240/345/274/225/346/223/216/learning-scheduler/index.js +6 -0
- package/dist/src/05-/346/214/201/347/273/255/345/255/246/344/271/240/345/274/225/346/223/216/learning-scheduler/priority-queue.d.ts +22 -0
- package/dist/src/05-/346/214/201/347/273/255/345/255/246/344/271/240/345/274/225/346/223/216/learning-scheduler/priority-queue.js +34 -0
- package/dist/src/05-/346/214/201/347/273/255/345/255/246/344/271/240/345/274/225/346/223/216/param-adaptation.d.ts +59 -0
- package/dist/src/05-/346/214/201/347/273/255/345/255/246/344/271/240/345/274/225/346/223/216/param-adaptation.js +55 -0
- package/dist/src/05-/346/214/201/347/273/255/345/255/246/344/271/240/345/274/225/346/223/216/skill-consolidation/index.d.ts +12 -0
- package/dist/src/05-/346/214/201/347/273/255/345/255/246/344/271/240/345/274/225/346/223/216/skill-consolidation/index.js +12 -0
- package/dist/src/05-/346/214/201/347/273/255/345/255/246/344/271/240/345/274/225/346/223/216/skill-consolidation/skill-eval.d.ts +77 -0
- package/dist/src/05-/346/214/201/347/273/255/345/255/246/344/271/240/345/274/225/346/223/216/skill-consolidation/skill-eval.js +110 -0
- package/dist/src/05-/346/214/201/347/273/255/345/255/246/344/271/240/345/274/225/346/223/216/skill-consolidation/skill-executor.d.ts +51 -0
- package/dist/src/05-/346/214/201/347/273/255/345/255/246/344/271/240/345/274/225/346/223/216/skill-consolidation/skill-executor.js +63 -0
- package/dist/src/05-/346/214/201/347/273/255/345/255/246/344/271/240/345/274/225/346/223/216/skill-consolidation/skill-id.d.ts +32 -0
- package/dist/src/05-/346/214/201/347/273/255/345/255/246/344/271/240/345/274/225/346/223/216/skill-consolidation/skill-id.js +54 -0
- package/dist/src/05-/346/214/201/347/273/255/345/255/246/344/271/240/345/274/225/346/223/216/skill-consolidation/skill-index.d.ts +29 -0
- package/dist/src/05-/346/214/201/347/273/255/345/255/246/344/271/240/345/274/225/346/223/216/skill-consolidation/skill-index.js +32 -0
- package/dist/src/05-/346/214/201/347/273/255/345/255/246/344/271/240/345/274/225/346/223/216/skill-consolidation/skill-merger.d.ts +26 -0
- package/dist/src/05-/346/214/201/347/273/255/345/255/246/344/271/240/345/274/225/346/223/216/skill-consolidation/skill-merger.js +65 -0
- package/dist/src/05-/346/214/201/347/273/255/345/255/246/344/271/240/345/274/225/346/223/216/skill-consolidation/skill-pruner.d.ts +31 -0
- package/dist/src/05-/346/214/201/347/273/255/345/255/246/344/271/240/345/274/225/346/223/216/skill-consolidation/skill-pruner.js +35 -0
- package/dist/src/05-/346/214/201/347/273/255/345/255/246/344/271/240/345/274/225/346/223/216/skill-consolidation/skill-store-file.d.ts +33 -0
- package/dist/src/05-/346/214/201/347/273/255/345/255/246/344/271/240/345/274/225/346/223/216/skill-consolidation/skill-store-file.js +76 -0
- package/dist/src/05-/346/214/201/347/273/255/345/255/246/344/271/240/345/274/225/346/223/216/skill-consolidation/skill-versioner.d.ts +33 -0
- package/dist/src/05-/346/214/201/347/273/255/345/255/246/344/271/240/345/274/225/346/223/216/skill-consolidation/skill-versioner.js +63 -0
- package/dist/src/05-/346/214/201/347/273/255/345/255/246/344/271/240/345/274/225/346/223/216/stability-guard/forgetting-detector.d.ts +31 -0
- package/dist/src/05-/346/214/201/347/273/255/345/255/246/344/271/240/345/274/225/346/223/216/stability-guard/forgetting-detector.js +26 -0
- package/dist/src/05-/346/214/201/347/273/255/345/255/246/344/271/240/345/274/225/346/223/216/stability-guard/index.d.ts +7 -0
- package/dist/src/05-/346/214/201/347/273/255/345/255/246/344/271/240/345/274/225/346/223/216/stability-guard/index.js +7 -0
- package/dist/src/05-/346/214/201/347/273/255/345/255/246/344/271/240/345/274/225/346/223/216/stability-guard/regression-tester.d.ts +30 -0
- package/dist/src/05-/346/214/201/347/273/255/345/255/246/344/271/240/345/274/225/346/223/216/stability-guard/regression-tester.js +48 -0
- package/dist/src/05-/346/214/201/347/273/255/345/255/246/344/271/240/345/274/225/346/223/216/stability-guard/rollback-controller.d.ts +19 -0
- package/dist/src/05-/346/214/201/347/273/255/345/255/246/344/271/240/345/274/225/346/223/216/stability-guard/rollback-controller.js +19 -0
- package/dist/src/05-/346/214/201/347/273/255/345/255/246/344/271/240/345/274/225/346/223/216/types.d.ts +137 -0
- package/dist/src/05-/346/214/201/347/273/255/345/255/246/344/271/240/345/274/225/346/223/216/types.js +22 -0
- package/dist/src/06-/346/262/273/347/220/206/344/270/255/345/277/203/compliance-audit/compliance-audit.d.ts +20 -0
- package/dist/src/06-/346/262/273/347/220/206/344/270/255/345/277/203/compliance-audit/compliance-audit.js +83 -0
- package/dist/src/06-/346/262/273/347/220/206/344/270/255/345/277/203/compliance-audit/index.d.ts +4 -0
- package/dist/src/06-/346/262/273/347/220/206/344/270/255/345/277/203/compliance-audit/index.js +4 -0
- package/dist/src/06-/346/262/273/347/220/206/344/270/255/345/277/203/index.d.ts +18 -0
- package/dist/src/06-/346/262/273/347/220/206/344/270/255/345/277/203/index.js +18 -0
- package/dist/src/06-/346/262/273/347/220/206/344/270/255/345/277/203/policy-registry/index.d.ts +6 -0
- package/dist/src/06-/346/262/273/347/220/206/344/270/255/345/277/203/policy-registry/index.js +6 -0
- package/dist/src/06-/346/262/273/347/220/206/344/270/255/345/277/203/policy-registry/policy-bus.d.ts +39 -0
- package/dist/src/06-/346/262/273/347/220/206/344/270/255/345/277/203/policy-registry/policy-bus.js +73 -0
- package/dist/src/06-/346/262/273/347/220/206/344/270/255/345/277/203/policy-registry/policy-registry.d.ts +19 -0
- package/dist/src/06-/346/262/273/347/220/206/344/270/255/345/277/203/policy-registry/policy-registry.js +44 -0
- package/dist/src/06-/346/262/273/347/220/206/344/270/255/345/277/203/policy-registry/security-policies.d.ts +54 -0
- package/dist/src/06-/346/262/273/347/220/206/344/270/255/345/277/203/policy-registry/security-policies.js +80 -0
- package/dist/src/06-/346/262/273/347/220/206/344/270/255/345/277/203/quality-governance/index.d.ts +4 -0
- package/dist/src/06-/346/262/273/347/220/206/344/270/255/345/277/203/quality-governance/index.js +4 -0
- package/dist/src/06-/346/262/273/347/220/206/344/270/255/345/277/203/quality-governance/quality-governance.d.ts +23 -0
- package/dist/src/06-/346/262/273/347/220/206/344/270/255/345/277/203/quality-governance/quality-governance.js +38 -0
- package/dist/src/06-/346/262/273/347/220/206/344/270/255/345/277/203/security-governance/index.d.ts +4 -0
- package/dist/src/06-/346/262/273/347/220/206/344/270/255/345/277/203/security-governance/index.js +4 -0
- package/dist/src/06-/346/262/273/347/220/206/344/270/255/345/277/203/security-governance/security-governance.d.ts +24 -0
- package/dist/src/06-/346/262/273/347/220/206/344/270/255/345/277/203/security-governance/security-governance.js +29 -0
- package/dist/src/06-/346/262/273/347/220/206/344/270/255/345/277/203/types.d.ts +77 -0
- package/dist/src/06-/346/262/273/347/220/206/344/270/255/345/277/203/types.js +17 -0
- package/dist/src/07-/350/207/252/346/204/210/344/270/255/345/277/203/consistency-repair/consistency-repair.d.ts +25 -0
- package/dist/src/07-/350/207/252/346/204/210/344/270/255/345/277/203/consistency-repair/consistency-repair.js +66 -0
- package/dist/src/07-/350/207/252/346/204/210/344/270/255/345/277/203/consistency-repair/index.d.ts +4 -0
- package/dist/src/07-/350/207/252/346/204/210/344/270/255/345/277/203/consistency-repair/index.js +4 -0
- package/dist/src/07-/350/207/252/346/204/210/344/270/255/345/277/203/degradation-controller/degradation-controller.d.ts +50 -0
- package/dist/src/07-/350/207/252/346/204/210/344/270/255/345/277/203/degradation-controller/degradation-controller.js +90 -0
- package/dist/src/07-/350/207/252/346/204/210/344/270/255/345/277/203/degradation-controller/index.d.ts +4 -0
- package/dist/src/07-/350/207/252/346/204/210/344/270/255/345/277/203/degradation-controller/index.js +4 -0
- package/dist/src/07-/350/207/252/346/204/210/344/270/255/345/277/203/fault-detector/fault-detector.d.ts +42 -0
- package/dist/src/07-/350/207/252/346/204/210/344/270/255/345/277/203/fault-detector/fault-detector.js +55 -0
- package/dist/src/07-/350/207/252/346/204/210/344/270/255/345/277/203/fault-detector/index.d.ts +4 -0
- package/dist/src/07-/350/207/252/346/204/210/344/270/255/345/277/203/fault-detector/index.js +4 -0
- package/dist/src/07-/350/207/252/346/204/210/344/270/255/345/277/203/index.d.ts +19 -0
- package/dist/src/07-/350/207/252/346/204/210/344/270/255/345/277/203/index.js +19 -0
- package/dist/src/07-/350/207/252/346/204/210/344/270/255/345/277/203/rollback-controller/index.d.ts +4 -0
- package/dist/src/07-/350/207/252/346/204/210/344/270/255/345/277/203/rollback-controller/index.js +4 -0
- package/dist/src/07-/350/207/252/346/204/210/344/270/255/345/277/203/rollback-controller/rollback-controller.d.ts +36 -0
- package/dist/src/07-/350/207/252/346/204/210/344/270/255/345/277/203/rollback-controller/rollback-controller.js +71 -0
- package/dist/src/07-/350/207/252/346/204/210/344/270/255/345/277/203/types.d.ts +73 -0
- package/dist/src/07-/350/207/252/346/204/210/344/270/255/345/277/203/types.js +63 -0
- package/dist/src/08-/347/263/273/347/273/237/350/243/205/351/205/215/index.d.ts +5 -0
- package/dist/src/08-/347/263/273/347/273/237/350/243/205/351/205/215/index.js +5 -0
- package/dist/src/08-/347/263/273/347/273/237/350/243/205/351/205/215/mcp-server-assembly.d.ts +48 -0
- package/dist/src/08-/347/263/273/347/273/237/350/243/205/351/205/215/mcp-server-assembly.js +53 -0
- package/dist/src/08-/347/263/273/347/273/237/350/243/205/351/205/215/runtime-assembly.d.ts +175 -0
- package/dist/src/08-/347/263/273/347/273/237/350/243/205/351/205/215/runtime-assembly.js +249 -0
- package/dist/src/08-/347/263/273/347/273/237/350/243/205/351/205/215/runtime-entry.d.ts +68 -0
- package/dist/src/08-/347/263/273/347/273/237/350/243/205/351/205/215/runtime-entry.js +86 -0
- package/dist/src/09-/345/217/257/350/247/202/346/265/213/346/200/247/capability-instrumentation.d.ts +53 -0
- package/dist/src/09-/345/217/257/350/247/202/346/265/213/346/200/247/capability-instrumentation.js +85 -0
- package/dist/src/09-/345/217/257/350/247/202/346/265/213/346/200/247/collaboration-instrumentation.d.ts +56 -0
- package/dist/src/09-/345/217/257/350/247/202/346/265/213/346/200/247/collaboration-instrumentation.js +100 -0
- package/dist/src/09-/345/217/257/350/247/202/346/265/213/346/200/247/family-metrics.d.ts +172 -0
- package/dist/src/09-/345/217/257/350/247/202/346/265/213/346/200/247/family-metrics.js +314 -0
- package/dist/src/09-/345/217/257/350/247/202/346/265/213/346/200/247/index.d.ts +8 -0
- package/dist/src/09-/345/217/257/350/247/202/346/265/213/346/200/247/index.js +8 -0
- package/dist/src/09-/345/217/257/350/247/202/346/265/213/346/200/247/metrics-registry.d.ts +123 -0
- package/dist/src/09-/345/217/257/350/247/202/346/265/213/346/200/247/metrics-registry.js +270 -0
- package/dist/src/09-/345/217/257/350/247/202/346/265/213/346/200/247/metrics-server.d.ts +45 -0
- package/dist/src/09-/345/217/257/350/247/202/346/265/213/346/200/247/metrics-server.js +86 -0
- package/dist/src/10-/350/203/275/345/212/233/346/263/250/345/206/214/344/270/255/345/277/203/allowlist.d.ts +79 -0
- package/dist/src/10-/350/203/275/345/212/233/346/263/250/345/206/214/344/270/255/345/277/203/allowlist.js +122 -0
- package/dist/src/10-/350/203/275/345/212/233/346/263/250/345/206/214/344/270/255/345/277/203/catalog.d.ts +67 -0
- package/dist/src/10-/350/203/275/345/212/233/346/263/250/345/206/214/344/270/255/345/277/203/catalog.js +71 -0
- package/dist/src/10-/350/203/275/345/212/233/346/263/250/345/206/214/344/270/255/345/277/203/index.d.ts +14 -0
- package/dist/src/10-/350/203/275/345/212/233/346/263/250/345/206/214/344/270/255/345/277/203/index.js +10 -0
- package/dist/src/10-/350/203/275/345/212/233/346/263/250/345/206/214/344/270/255/345/277/203/integrity.d.ts +44 -0
- package/dist/src/10-/350/203/275/345/212/233/346/263/250/345/206/214/344/270/255/345/277/203/integrity.js +99 -0
- package/dist/src/10-/350/203/275/345/212/233/346/263/250/345/206/214/344/270/255/345/277/203/plugin-loader.d.ts +39 -0
- package/dist/src/10-/350/203/275/345/212/233/346/263/250/345/206/214/344/270/255/345/277/203/plugin-loader.js +89 -0
- package/dist/src/a2a-adapter/card-discovery.d.ts +40 -0
- package/dist/src/a2a-adapter/card-discovery.js +47 -0
- package/dist/src/a2a-adapter/index.d.ts +7 -0
- package/dist/src/a2a-adapter/index.js +7 -0
- package/dist/src/a2a-adapter/task-delegate.d.ts +85 -0
- package/dist/src/a2a-adapter/task-delegate.js +94 -0
- package/dist/src/index.d.ts +10 -0
- package/dist/src/index.js +10 -0
- package/dist/vendor/memory-framework/episodic-store/episode-indexer.d.ts +30 -0
- package/dist/vendor/memory-framework/episodic-store/episode-indexer.js +45 -0
- package/dist/vendor/memory-framework/episodic-store/index.d.ts +30 -0
- package/dist/vendor/memory-framework/episodic-store/index.js +45 -0
- package/dist/vendor/memory-framework/episodic-store/retrieval-adapter.d.ts +20 -0
- package/dist/vendor/memory-framework/episodic-store/retrieval-adapter.js +29 -0
- package/dist/vendor/memory-framework/episodic-store/trajectory-logger.d.ts +36 -0
- package/dist/vendor/memory-framework/episodic-store/trajectory-logger.js +32 -0
- package/dist/vendor/memory-framework/index.d.ts +19 -0
- package/dist/vendor/memory-framework/index.js +19 -0
- package/dist/vendor/memory-framework/memory-orchestrator/consistency-checker.d.ts +20 -0
- package/dist/vendor/memory-framework/memory-orchestrator/consistency-checker.js +41 -0
- package/dist/vendor/memory-framework/memory-orchestrator/index.d.ts +55 -0
- package/dist/vendor/memory-framework/memory-orchestrator/index.js +185 -0
- package/dist/vendor/memory-framework/memory-orchestrator/retrieval-router.d.ts +21 -0
- package/dist/vendor/memory-framework/memory-orchestrator/retrieval-router.js +37 -0
- package/dist/vendor/memory-framework/procedural-memory/guardrail-registry.d.ts +34 -0
- package/dist/vendor/memory-framework/procedural-memory/guardrail-registry.js +22 -0
- package/dist/vendor/memory-framework/procedural-memory/index.d.ts +31 -0
- package/dist/vendor/memory-framework/procedural-memory/index.js +34 -0
- package/dist/vendor/memory-framework/procedural-memory/prompt-rule-extractor.d.ts +95 -0
- package/dist/vendor/memory-framework/procedural-memory/prompt-rule-extractor.js +160 -0
- package/dist/vendor/memory-framework/procedural-memory/skill-registry.d.ts +115 -0
- package/dist/vendor/memory-framework/procedural-memory/skill-registry.js +165 -0
- package/dist/vendor/memory-framework/procedural-memory/workflow-patterns.d.ts +36 -0
- package/dist/vendor/memory-framework/procedural-memory/workflow-patterns.js +22 -0
- package/dist/vendor/memory-framework/semantic-graph/entity-resolver.d.ts +26 -0
- package/dist/vendor/memory-framework/semantic-graph/entity-resolver.js +61 -0
- package/dist/vendor/memory-framework/semantic-graph/index.d.ts +23 -0
- package/dist/vendor/memory-framework/semantic-graph/index.js +25 -0
- package/dist/vendor/memory-framework/semantic-graph/knowledge-graph.d.ts +50 -0
- package/dist/vendor/memory-framework/semantic-graph/knowledge-graph.js +44 -0
- package/dist/vendor/memory-framework/sensory-buffer/index.d.ts +41 -0
- package/dist/vendor/memory-framework/sensory-buffer/index.js +70 -0
- package/dist/vendor/memory-framework/types.d.ts +192 -0
- package/dist/vendor/memory-framework/types.js +42 -0
- package/dist/vendor/memory-framework/working-context/attention-scorer.d.ts +39 -0
- package/dist/vendor/memory-framework/working-context/attention-scorer.js +45 -0
- package/dist/vendor/memory-framework/working-context/context-window.d.ts +33 -0
- package/dist/vendor/memory-framework/working-context/context-window.js +35 -0
- package/dist/vendor/memory-framework/working-context/index.d.ts +30 -0
- package/dist/vendor/memory-framework/working-context/index.js +44 -0
- package/dist/vendor/memory-framework/write-policy/consolidation.d.ts +37 -0
- package/dist/vendor/memory-framework/write-policy/consolidation.js +50 -0
- package/dist/vendor/memory-framework/write-policy/forgetting-policy.d.ts +28 -0
- package/dist/vendor/memory-framework/write-policy/forgetting-policy.js +31 -0
- package/dist/vendor/memory-framework/write-policy/index.d.ts +40 -0
- package/dist/vendor/memory-framework/write-policy/index.js +50 -0
- package/dist/vendor/memory-framework/write-policy/salience-scorer.d.ts +41 -0
- package/dist/vendor/memory-framework/write-policy/salience-scorer.js +70 -0
- package/dist/vendor/self-judge-kit/assumption-tracker.d.ts +31 -0
- package/dist/vendor/self-judge-kit/assumption-tracker.js +45 -0
- package/dist/vendor/self-judge-kit/confidence-scorer.d.ts +46 -0
- package/dist/vendor/self-judge-kit/confidence-scorer.js +60 -0
- package/dist/vendor/self-judge-kit/deviation-detector.d.ts +23 -0
- package/dist/vendor/self-judge-kit/deviation-detector.js +55 -0
- package/dist/vendor/self-judge-kit/escalation-policy.d.ts +17 -0
- package/dist/vendor/self-judge-kit/escalation-policy.js +45 -0
- package/dist/vendor/self-judge-kit/index.d.ts +46 -0
- package/dist/vendor/self-judge-kit/index.js +79 -0
- package/dist/vendor/self-judge-kit/types.d.ts +87 -0
- package/dist/vendor/self-judge-kit/types.js +18 -0
- package/package.json +41 -4
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 技能注册中心(skill-registry)——「知/学」支柱 procedural-memory 子模块。
|
|
3
|
+
* 职责:承载**可版本化**的技能定义(工具使用模式 / 工作流能力)。
|
|
4
|
+
* 生命周期:版本化永久|存储介质:Git 版本化 YAML|写入触发:学习引擎固化 / 人工审核。
|
|
5
|
+
*
|
|
6
|
+
* TODO(infra): 技能定义落盘为 Git YAML(procedural/*.yaml),支持 A/B 对比与回滚。
|
|
7
|
+
*/
|
|
8
|
+
/** 查询分词(确定性):CJK 相邻二元组(单字回退)+ latin/digit 词,统一小写。 */
|
|
9
|
+
function tokenizeQuery(query) {
|
|
10
|
+
const lower = query.toLowerCase();
|
|
11
|
+
const tokens = new Set();
|
|
12
|
+
for (const run of lower.match(/[\u3000-\u9fff\uff00-\uffef]+/g) ?? []) {
|
|
13
|
+
if (run.length === 1) {
|
|
14
|
+
tokens.add(run);
|
|
15
|
+
}
|
|
16
|
+
else {
|
|
17
|
+
for (let i = 0; i < run.length - 1; i += 1)
|
|
18
|
+
tokens.add(run.slice(i, i + 2));
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
for (const word of lower.match(/[a-z0-9][a-z0-9-]*/g) ?? [])
|
|
22
|
+
tokens.add(word);
|
|
23
|
+
return [...tokens];
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* 纯索引匹配(P3-T4):tag 命中权重 3 > id 命中 2 > 描述命中 1,同分按 id 升序;
|
|
27
|
+
* 只读索引条目,不触碰任何正文(steps / examples)。
|
|
28
|
+
*/
|
|
29
|
+
export function matchSkillIndexEntries(entries, query, limit = 5) {
|
|
30
|
+
const tokens = tokenizeQuery(query);
|
|
31
|
+
if (tokens.length === 0)
|
|
32
|
+
return [];
|
|
33
|
+
const scored = [];
|
|
34
|
+
for (const entry of entries) {
|
|
35
|
+
let score = 0;
|
|
36
|
+
const tags = (entry.tags ?? []).join(' ').toLowerCase();
|
|
37
|
+
const id = entry.id.toLowerCase();
|
|
38
|
+
const description = entry.description.toLowerCase();
|
|
39
|
+
for (const token of tokens) {
|
|
40
|
+
if (tags.includes(token))
|
|
41
|
+
score += 3;
|
|
42
|
+
if (id.includes(token))
|
|
43
|
+
score += 2;
|
|
44
|
+
if (description.includes(token))
|
|
45
|
+
score += 1;
|
|
46
|
+
}
|
|
47
|
+
if (score > 0)
|
|
48
|
+
scored.push({ entry, score });
|
|
49
|
+
}
|
|
50
|
+
scored.sort((a, b) => b.score - a.score || a.entry.id.localeCompare(b.entry.id));
|
|
51
|
+
return scored.slice(0, limit).map((s) => s.entry);
|
|
52
|
+
}
|
|
53
|
+
/** 技能注册中心实现(内存桩,多版本共存)。 */
|
|
54
|
+
export class SkillRegistry {
|
|
55
|
+
/** id → (version → definition) */
|
|
56
|
+
versions = new Map();
|
|
57
|
+
/** 元数据索引(P3-T4):与正文注册表(versions)物理分离。 */
|
|
58
|
+
indexEntries = new Map();
|
|
59
|
+
register(skill) {
|
|
60
|
+
const byVersion = this.versions.get(skill.id) ?? new Map();
|
|
61
|
+
byVersion.set(skill.version, skill);
|
|
62
|
+
this.versions.set(skill.id, byVersion);
|
|
63
|
+
// TODO(infra): 写入 Git 版本化 YAML
|
|
64
|
+
return skill;
|
|
65
|
+
}
|
|
66
|
+
get(id, version) {
|
|
67
|
+
const byVersion = this.versions.get(id);
|
|
68
|
+
if (!byVersion)
|
|
69
|
+
return undefined;
|
|
70
|
+
if (version)
|
|
71
|
+
return byVersion.get(version);
|
|
72
|
+
return this.latest(id);
|
|
73
|
+
}
|
|
74
|
+
latest(id) {
|
|
75
|
+
const byVersion = this.versions.get(id);
|
|
76
|
+
if (!byVersion)
|
|
77
|
+
return undefined;
|
|
78
|
+
// 桩:以版本字符串降序取 active 版本
|
|
79
|
+
return [...byVersion.values()]
|
|
80
|
+
.filter((s) => s.status === 'active')
|
|
81
|
+
.sort((a, b) => compareSemver(b.version, a.version))[0];
|
|
82
|
+
}
|
|
83
|
+
list() {
|
|
84
|
+
const out = [];
|
|
85
|
+
for (const byVersion of this.versions.values()) {
|
|
86
|
+
out.push(...byVersion.values());
|
|
87
|
+
}
|
|
88
|
+
return out;
|
|
89
|
+
}
|
|
90
|
+
rollback(id) {
|
|
91
|
+
const byVersion = this.versions.get(id);
|
|
92
|
+
if (!byVersion)
|
|
93
|
+
return undefined;
|
|
94
|
+
const ordered = [...byVersion.values()].sort((a, b) => compareSemver(b.version, a.version));
|
|
95
|
+
const current = ordered[0];
|
|
96
|
+
const prev = ordered[1]; // 次新版本
|
|
97
|
+
if (current)
|
|
98
|
+
byVersion.set(current.version, { ...current, status: 'rolled-back' });
|
|
99
|
+
if (prev) {
|
|
100
|
+
const reActivated = { ...prev, status: 'active' };
|
|
101
|
+
byVersion.set(prev.version, reActivated);
|
|
102
|
+
// TODO(infra): 触发 Git tag 回退 + 稳定性回归(stability-guard)
|
|
103
|
+
return reActivated;
|
|
104
|
+
}
|
|
105
|
+
return undefined;
|
|
106
|
+
}
|
|
107
|
+
findByLogicalId(logicalId) {
|
|
108
|
+
for (const byVersion of this.versions.values()) {
|
|
109
|
+
for (const skill of byVersion.values()) {
|
|
110
|
+
if (skill.status === 'active' && (skill.logicalId ?? skill.id) === logicalId) {
|
|
111
|
+
return this.latest(skill.id);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
return undefined;
|
|
116
|
+
}
|
|
117
|
+
loadFromManifest(entries) {
|
|
118
|
+
const skippedPlanned = [];
|
|
119
|
+
let loaded = 0;
|
|
120
|
+
for (const entry of entries) {
|
|
121
|
+
// planned 条目未实装:不注入运行时(契约侧由 manifest:check 记账)
|
|
122
|
+
if (entry.status === 'planned') {
|
|
123
|
+
skippedPlanned.push(entry.id);
|
|
124
|
+
continue;
|
|
125
|
+
}
|
|
126
|
+
this.register({
|
|
127
|
+
id: entry.id,
|
|
128
|
+
logicalId: entry.id, // manifest 技能的统一 id 即契约 id
|
|
129
|
+
name: entry.name,
|
|
130
|
+
version: entry.version ?? '0.0.0',
|
|
131
|
+
description: entry.description,
|
|
132
|
+
when: entry.examples ?? [],
|
|
133
|
+
steps: [],
|
|
134
|
+
status: 'active',
|
|
135
|
+
});
|
|
136
|
+
loaded += 1;
|
|
137
|
+
}
|
|
138
|
+
return { loaded, skippedPlanned };
|
|
139
|
+
}
|
|
140
|
+
loadIndex(entries) {
|
|
141
|
+
for (const entry of entries) {
|
|
142
|
+
if (!entry.id)
|
|
143
|
+
throw new Error('索引条目缺少 id');
|
|
144
|
+
this.indexEntries.set(entry.id, entry);
|
|
145
|
+
}
|
|
146
|
+
return this.indexEntries.size;
|
|
147
|
+
}
|
|
148
|
+
listIndex() {
|
|
149
|
+
return [...this.indexEntries.values()];
|
|
150
|
+
}
|
|
151
|
+
match(query, limit = 5) {
|
|
152
|
+
return matchSkillIndexEntries([...this.indexEntries.values()], query, limit);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
/** 语义化版本比较(简化:按数值段比较)。 */
|
|
156
|
+
export function compareSemver(a, b) {
|
|
157
|
+
const pa = a.split('.').map(Number);
|
|
158
|
+
const pb = b.split('.').map(Number);
|
|
159
|
+
for (let i = 0; i < 3; i += 1) {
|
|
160
|
+
const d = (pa[i] ?? 0) - (pb[i] ?? 0);
|
|
161
|
+
if (d !== 0)
|
|
162
|
+
return d;
|
|
163
|
+
}
|
|
164
|
+
return 0;
|
|
165
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 工作流模式(workflow-patterns)——「知/学」支柱 procedural-memory 子模块。
|
|
3
|
+
* 职责:承载可复用的工作流模板(条件 → 策略 → 结果),供学习引擎固化/淘汰。
|
|
4
|
+
*
|
|
5
|
+
* TODO(infra): 与 experience-reflow.pattern-extractor 打通,实现自动提炼与版本管理。
|
|
6
|
+
*/
|
|
7
|
+
/** 工作流模式条目("条件X→策略Y→结果Z"三元组的可执行形态)。 */
|
|
8
|
+
export interface WorkflowPattern {
|
|
9
|
+
readonly id: string;
|
|
10
|
+
readonly version: string;
|
|
11
|
+
/** 适用条件。 */
|
|
12
|
+
readonly condition: string;
|
|
13
|
+
/** 策略(执行路径)。 */
|
|
14
|
+
readonly strategy: readonly string[];
|
|
15
|
+
/** 预期结果(用于回归校验)。 */
|
|
16
|
+
readonly expectedOutcome?: string;
|
|
17
|
+
/** 历史使用统计。 */
|
|
18
|
+
readonly stats?: {
|
|
19
|
+
uses: number;
|
|
20
|
+
successRate: number;
|
|
21
|
+
};
|
|
22
|
+
readonly status: 'active' | 'deprecated' | 'rolled-back';
|
|
23
|
+
}
|
|
24
|
+
/** 工作流模式库端口。 */
|
|
25
|
+
export interface WorkflowPatternStorePort {
|
|
26
|
+
upsert(pattern: WorkflowPattern): WorkflowPattern;
|
|
27
|
+
match(condition: string): readonly WorkflowPattern[];
|
|
28
|
+
list(): readonly WorkflowPattern[];
|
|
29
|
+
}
|
|
30
|
+
/** 工作流模式库实现(内存桩)。 */
|
|
31
|
+
export declare class WorkflowPatternStore implements WorkflowPatternStorePort {
|
|
32
|
+
private readonly patterns;
|
|
33
|
+
upsert(pattern: WorkflowPattern): WorkflowPattern;
|
|
34
|
+
match(condition: string): readonly WorkflowPattern[];
|
|
35
|
+
list(): readonly WorkflowPattern[];
|
|
36
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 工作流模式(workflow-patterns)——「知/学」支柱 procedural-memory 子模块。
|
|
3
|
+
* 职责:承载可复用的工作流模板(条件 → 策略 → 结果),供学习引擎固化/淘汰。
|
|
4
|
+
*
|
|
5
|
+
* TODO(infra): 与 experience-reflow.pattern-extractor 打通,实现自动提炼与版本管理。
|
|
6
|
+
*/
|
|
7
|
+
/** 工作流模式库实现(内存桩)。 */
|
|
8
|
+
export class WorkflowPatternStore {
|
|
9
|
+
patterns = new Map();
|
|
10
|
+
upsert(pattern) {
|
|
11
|
+
this.patterns.set(pattern.id, pattern);
|
|
12
|
+
// TODO(infra): 写入 Git 版本化 YAML(procedural/workflow-patterns.yaml)
|
|
13
|
+
return pattern;
|
|
14
|
+
}
|
|
15
|
+
match(condition) {
|
|
16
|
+
const c = condition.toLowerCase();
|
|
17
|
+
return [...this.patterns.values()].filter((p) => p.status === 'active' && p.condition.toLowerCase().includes(c));
|
|
18
|
+
}
|
|
19
|
+
list() {
|
|
20
|
+
return [...this.patterns.values()];
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 实体解析器(entity-resolver)——「知」支柱 semantic-graph 子模块。
|
|
3
|
+
* 职责:把用户输入中的实体指称解析为图谱中的规范化实体(消歧 + 归一)。
|
|
4
|
+
* 边界:只做实体对齐,不做关系推理。
|
|
5
|
+
*
|
|
6
|
+
* TODO(infra): 接入实体链接模型(EL)+ 别名库 + 上下文消歧。
|
|
7
|
+
*/
|
|
8
|
+
import type { Entity, KnowledgeGraphPort } from './knowledge-graph.js';
|
|
9
|
+
/** 实体映射(别名/画像 → 规范化实体)。 */
|
|
10
|
+
export interface EntityMention {
|
|
11
|
+
readonly surface: string;
|
|
12
|
+
/** 候选实体 id 及置信度。 */
|
|
13
|
+
readonly candidates: readonly {
|
|
14
|
+
id: string;
|
|
15
|
+
confidence: number;
|
|
16
|
+
}[];
|
|
17
|
+
}
|
|
18
|
+
/** 实体解析器。 */
|
|
19
|
+
export declare class EntityResolver {
|
|
20
|
+
private readonly graph;
|
|
21
|
+
constructor(graph: KnowledgeGraphPort);
|
|
22
|
+
/** 解析输入中的实体提及列表。 */
|
|
23
|
+
resolve(text: string): readonly EntityMention[];
|
|
24
|
+
/** 取置信度最高的规范化实体。 */
|
|
25
|
+
resolveTop(text: string): readonly Entity[];
|
|
26
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 实体解析器(entity-resolver)——「知」支柱 semantic-graph 子模块。
|
|
3
|
+
* 职责:把用户输入中的实体指称解析为图谱中的规范化实体(消歧 + 归一)。
|
|
4
|
+
* 边界:只做实体对齐,不做关系推理。
|
|
5
|
+
*
|
|
6
|
+
* TODO(infra): 接入实体链接模型(EL)+ 别名库 + 上下文消歧。
|
|
7
|
+
*/
|
|
8
|
+
/** 实体解析器。 */
|
|
9
|
+
export class EntityResolver {
|
|
10
|
+
graph;
|
|
11
|
+
constructor(graph) {
|
|
12
|
+
this.graph = graph;
|
|
13
|
+
}
|
|
14
|
+
/** 解析输入中的实体提及列表。 */
|
|
15
|
+
resolve(text) {
|
|
16
|
+
const tokens = tokenize(text);
|
|
17
|
+
const mentions = [];
|
|
18
|
+
for (const t of tokens) {
|
|
19
|
+
const hits = [];
|
|
20
|
+
for (const id of candidateIds(this.graph, t)) {
|
|
21
|
+
const e = this.graph.getEntity(id);
|
|
22
|
+
if (!e)
|
|
23
|
+
continue;
|
|
24
|
+
hits.push({ id, confidence: aliasScore(e, t) });
|
|
25
|
+
}
|
|
26
|
+
if (hits.length > 0)
|
|
27
|
+
mentions.push({ surface: t, candidates: hits });
|
|
28
|
+
}
|
|
29
|
+
// TODO(infra): 用实体链接模型对候选做上下文消歧与重排
|
|
30
|
+
return mentions;
|
|
31
|
+
}
|
|
32
|
+
/** 取置信度最高的规范化实体。 */
|
|
33
|
+
resolveTop(text) {
|
|
34
|
+
const out = [];
|
|
35
|
+
for (const m of this.resolve(text)) {
|
|
36
|
+
const best = [...m.candidates].sort((a, b) => b.confidence - a.confidence)[0];
|
|
37
|
+
if (!best)
|
|
38
|
+
continue;
|
|
39
|
+
const e = this.graph.getEntity(best.id);
|
|
40
|
+
if (e)
|
|
41
|
+
out.push(e);
|
|
42
|
+
}
|
|
43
|
+
return out;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
function tokenize(text) {
|
|
47
|
+
return text
|
|
48
|
+
.split(/[\s,,。、;;::]+/)
|
|
49
|
+
.map((s) => s.trim())
|
|
50
|
+
.filter((s) => s.length > 0);
|
|
51
|
+
}
|
|
52
|
+
function candidateIds(graph, token) {
|
|
53
|
+
// 桩实现:无法枚举全部实体,故以邻居查询为空;真实实现需图谱全文索引。
|
|
54
|
+
// TODO(infra): 以图库全文/向量索引按 token 召回候选 id
|
|
55
|
+
void graph;
|
|
56
|
+
void token;
|
|
57
|
+
return [];
|
|
58
|
+
}
|
|
59
|
+
function aliasScore(e, token) {
|
|
60
|
+
return e.name.toLowerCase() === token.toLowerCase() ? 1 : 0.5;
|
|
61
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 语义记忆(semantic-graph)——「知」支柱第 4 层。
|
|
3
|
+
* 生命周期:永久(可遗忘)|存储介质:图库 / 向量库|写入触发:实体/关系确认。
|
|
4
|
+
*/
|
|
5
|
+
import { EntityResolver } from './entity-resolver.js';
|
|
6
|
+
import { KnowledgeGraph } from './knowledge-graph.js';
|
|
7
|
+
import type { MemoryHit, MemoryQuery } from '../types.js';
|
|
8
|
+
export { EntityResolver } from './entity-resolver.js';
|
|
9
|
+
export { KnowledgeGraph } from './knowledge-graph.js';
|
|
10
|
+
export type { Entity, Relation, Triple } from './knowledge-graph.js';
|
|
11
|
+
export type { EntityMention } from './entity-resolver.js';
|
|
12
|
+
/** 语义存储端口。 */
|
|
13
|
+
export interface SemanticStorePort {
|
|
14
|
+
graph: KnowledgeGraph;
|
|
15
|
+
resolver: EntityResolver;
|
|
16
|
+
retrieve(query: MemoryQuery): readonly MemoryHit[];
|
|
17
|
+
}
|
|
18
|
+
/** 语义存储实现(内存桩)。 */
|
|
19
|
+
export declare class SemanticStore implements SemanticStorePort {
|
|
20
|
+
readonly graph: KnowledgeGraph;
|
|
21
|
+
readonly resolver: EntityResolver;
|
|
22
|
+
retrieve(query: MemoryQuery): readonly MemoryHit[];
|
|
23
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 语义记忆(semantic-graph)——「知」支柱第 4 层。
|
|
3
|
+
* 生命周期:永久(可遗忘)|存储介质:图库 / 向量库|写入触发:实体/关系确认。
|
|
4
|
+
*/
|
|
5
|
+
import { EntityResolver } from './entity-resolver.js';
|
|
6
|
+
import { KnowledgeGraph } from './knowledge-graph.js';
|
|
7
|
+
export { EntityResolver } from './entity-resolver.js';
|
|
8
|
+
export { KnowledgeGraph } from './knowledge-graph.js';
|
|
9
|
+
/** 语义存储实现(内存桩)。 */
|
|
10
|
+
export class SemanticStore {
|
|
11
|
+
graph = new KnowledgeGraph();
|
|
12
|
+
resolver = new EntityResolver(this.graph);
|
|
13
|
+
retrieve(query) {
|
|
14
|
+
const anchors = query.entities ?? (query.text ? this.resolver.resolveTop(query.text).map((e) => e.id) : []);
|
|
15
|
+
const triples = this.graph.query(anchors);
|
|
16
|
+
return triples.map((t, i) => ({
|
|
17
|
+
layer: 'semantic',
|
|
18
|
+
id: `sem-${t.subject.id}-${t.predicate}-${t.object.id}-${i}`,
|
|
19
|
+
content: t,
|
|
20
|
+
score: 0.8,
|
|
21
|
+
salience: 0.7,
|
|
22
|
+
recordTime: Date.now(),
|
|
23
|
+
}));
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 知识图谱(knowledge-graph)——「知」支柱 semantic-graph 子模块。
|
|
3
|
+
* 职责:承载实体(Entity)、关系(Relation)、画像(Profile)与领域知识。
|
|
4
|
+
* 生命周期:永久(可遗忘)|存储介质:图库 / 向量库|写入触发:实体/关系确认。
|
|
5
|
+
*
|
|
6
|
+
* TODO(infra): 落地为图数据库(Neo4j / 属性图)+ 向量库(Milvus/pgvector)双写。
|
|
7
|
+
*/
|
|
8
|
+
/** 实体节点。 */
|
|
9
|
+
export interface Entity {
|
|
10
|
+
readonly id: string;
|
|
11
|
+
readonly name: string;
|
|
12
|
+
readonly type: string;
|
|
13
|
+
readonly attributes?: Readonly<Record<string, unknown>>;
|
|
14
|
+
}
|
|
15
|
+
/** 关系边。 */
|
|
16
|
+
export interface Relation {
|
|
17
|
+
readonly id: string;
|
|
18
|
+
readonly fromId: string;
|
|
19
|
+
readonly toId: string;
|
|
20
|
+
readonly predicate: string;
|
|
21
|
+
/** 关系强度/置信度 0–1。 */
|
|
22
|
+
readonly weight: number;
|
|
23
|
+
}
|
|
24
|
+
/** 三元组(供学习引擎 pattern-extractor 复用)。 */
|
|
25
|
+
export interface Triple {
|
|
26
|
+
readonly subject: Entity;
|
|
27
|
+
readonly predicate: string;
|
|
28
|
+
readonly object: Entity;
|
|
29
|
+
}
|
|
30
|
+
/** 知识图谱端口。 */
|
|
31
|
+
export interface KnowledgeGraphPort {
|
|
32
|
+
upsertEntity(entity: Entity): Entity;
|
|
33
|
+
upsertRelation(relation: Relation): Relation;
|
|
34
|
+
getEntity(id: string): Entity | undefined;
|
|
35
|
+
neighbors(id: string): readonly Relation[];
|
|
36
|
+
query(entities: readonly string[]): readonly Triple[];
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* 知识图谱实现(内存桩)。
|
|
40
|
+
* 以邻接表承载实体与关系,支持实体锚点查询。
|
|
41
|
+
*/
|
|
42
|
+
export declare class KnowledgeGraph implements KnowledgeGraphPort {
|
|
43
|
+
private readonly entities;
|
|
44
|
+
private readonly relations;
|
|
45
|
+
upsertEntity(entity: Entity): Entity;
|
|
46
|
+
upsertRelation(relation: Relation): Relation;
|
|
47
|
+
getEntity(id: string): Entity | undefined;
|
|
48
|
+
neighbors(id: string): readonly Relation[];
|
|
49
|
+
query(entities: readonly string[]): readonly Triple[];
|
|
50
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 知识图谱(knowledge-graph)——「知」支柱 semantic-graph 子模块。
|
|
3
|
+
* 职责:承载实体(Entity)、关系(Relation)、画像(Profile)与领域知识。
|
|
4
|
+
* 生命周期:永久(可遗忘)|存储介质:图库 / 向量库|写入触发:实体/关系确认。
|
|
5
|
+
*
|
|
6
|
+
* TODO(infra): 落地为图数据库(Neo4j / 属性图)+ 向量库(Milvus/pgvector)双写。
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* 知识图谱实现(内存桩)。
|
|
10
|
+
* 以邻接表承载实体与关系,支持实体锚点查询。
|
|
11
|
+
*/
|
|
12
|
+
export class KnowledgeGraph {
|
|
13
|
+
entities = new Map();
|
|
14
|
+
relations = new Map();
|
|
15
|
+
upsertEntity(entity) {
|
|
16
|
+
this.entities.set(entity.id, entity);
|
|
17
|
+
// TODO(infra): 写入图库节点 + 向量库嵌入
|
|
18
|
+
return entity;
|
|
19
|
+
}
|
|
20
|
+
upsertRelation(relation) {
|
|
21
|
+
this.relations.set(relation.id, relation);
|
|
22
|
+
// TODO(infra): 写入图库边
|
|
23
|
+
return relation;
|
|
24
|
+
}
|
|
25
|
+
getEntity(id) {
|
|
26
|
+
return this.entities.get(id);
|
|
27
|
+
}
|
|
28
|
+
neighbors(id) {
|
|
29
|
+
return [...this.relations.values()].filter((r) => r.fromId === id || r.toId === id);
|
|
30
|
+
}
|
|
31
|
+
query(entities) {
|
|
32
|
+
const out = [];
|
|
33
|
+
for (const eid of entities) {
|
|
34
|
+
for (const r of this.neighbors(eid)) {
|
|
35
|
+
const s = this.entities.get(r.fromId);
|
|
36
|
+
const o = this.entities.get(r.toId);
|
|
37
|
+
if (s && o && r.fromId === eid) {
|
|
38
|
+
out.push({ subject: s, predicate: r.predicate, object: o });
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
return out;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 感知缓冲(sensory-buffer)——「知」支柱第 1 层。
|
|
3
|
+
* 生命周期:秒级(会话内)|存储介质:内存环形缓冲|写入触发:输入到达即写。
|
|
4
|
+
*
|
|
5
|
+
* TODO(infra): 真实实现应把环形缓冲落到 Redis Stream / 内存映射文件,
|
|
6
|
+
* 并接入多模态摄入管道(text/audio/image/event)。
|
|
7
|
+
*/
|
|
8
|
+
/** 感知样本(单条原始输入)。 */
|
|
9
|
+
export interface SensorySample {
|
|
10
|
+
readonly id: string;
|
|
11
|
+
readonly modality: 'text' | 'audio' | 'image' | 'event';
|
|
12
|
+
readonly content: unknown;
|
|
13
|
+
/** 事件时间(传感器产生时刻)。 */
|
|
14
|
+
readonly ts: number;
|
|
15
|
+
}
|
|
16
|
+
/** 感知缓冲端口(供 memory-orchestrator 依赖注入)。 */
|
|
17
|
+
export interface SensoryBufferPort {
|
|
18
|
+
push(sample: Omit<SensorySample, 'id'>): SensorySample;
|
|
19
|
+
recent(limit?: number): readonly SensorySample[];
|
|
20
|
+
/** 取出并移除所有早于 `now - ttlMs` 的样本。 */
|
|
21
|
+
drainExpired(now: number): readonly SensorySample[];
|
|
22
|
+
clear(): void;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* 内存环形缓冲实现(最小可用桩)。
|
|
26
|
+
* 容量固定,写入 O(1),过期样本由 drainExpired 惰性回收。
|
|
27
|
+
*/
|
|
28
|
+
export declare class SensoryBuffer implements SensoryBufferPort {
|
|
29
|
+
private readonly capacity;
|
|
30
|
+
private readonly ttlMs;
|
|
31
|
+
private readonly slots;
|
|
32
|
+
private head;
|
|
33
|
+
private size;
|
|
34
|
+
private seq;
|
|
35
|
+
constructor(capacity?: number, ttlMs?: number);
|
|
36
|
+
push(sample: Omit<SensorySample, 'id'>): SensorySample;
|
|
37
|
+
recent(limit?: number): readonly SensorySample[];
|
|
38
|
+
drainExpired(now: number): readonly SensorySample[];
|
|
39
|
+
clear(): void;
|
|
40
|
+
private nextId;
|
|
41
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 感知缓冲(sensory-buffer)——「知」支柱第 1 层。
|
|
3
|
+
* 生命周期:秒级(会话内)|存储介质:内存环形缓冲|写入触发:输入到达即写。
|
|
4
|
+
*
|
|
5
|
+
* TODO(infra): 真实实现应把环形缓冲落到 Redis Stream / 内存映射文件,
|
|
6
|
+
* 并接入多模态摄入管道(text/audio/image/event)。
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* 内存环形缓冲实现(最小可用桩)。
|
|
10
|
+
* 容量固定,写入 O(1),过期样本由 drainExpired 惰性回收。
|
|
11
|
+
*/
|
|
12
|
+
export class SensoryBuffer {
|
|
13
|
+
capacity;
|
|
14
|
+
ttlMs;
|
|
15
|
+
slots;
|
|
16
|
+
head = 0;
|
|
17
|
+
size = 0;
|
|
18
|
+
seq = 0;
|
|
19
|
+
constructor(capacity = 256, ttlMs = 5_000) {
|
|
20
|
+
this.capacity = capacity;
|
|
21
|
+
this.ttlMs = ttlMs;
|
|
22
|
+
this.slots = new Array(this.capacity).fill(undefined);
|
|
23
|
+
}
|
|
24
|
+
push(sample) {
|
|
25
|
+
const entry = { ...sample, id: this.nextId() };
|
|
26
|
+
// 环形覆盖:容量满时推进 head(最旧项被覆盖)
|
|
27
|
+
this.slots[this.head] = entry;
|
|
28
|
+
this.head = (this.head + 1) % this.capacity;
|
|
29
|
+
if (this.size < this.capacity)
|
|
30
|
+
this.size += 1;
|
|
31
|
+
// TODO(infra): 写入 Redis Stream / 多模态摄入管道
|
|
32
|
+
return entry;
|
|
33
|
+
}
|
|
34
|
+
recent(limit = this.size) {
|
|
35
|
+
const out = [];
|
|
36
|
+
for (let i = Math.max(0, this.size - limit); i < this.size; i += 1) {
|
|
37
|
+
const idx = (this.head - this.size + i + this.capacity) % this.capacity;
|
|
38
|
+
const item = this.slots[idx];
|
|
39
|
+
if (item)
|
|
40
|
+
out.push(item);
|
|
41
|
+
}
|
|
42
|
+
return out;
|
|
43
|
+
}
|
|
44
|
+
drainExpired(now) {
|
|
45
|
+
const expired = [];
|
|
46
|
+
const kept = this.recent().filter((s) => {
|
|
47
|
+
if (now - s.ts > this.ttlMs) {
|
|
48
|
+
expired.push(s);
|
|
49
|
+
return false;
|
|
50
|
+
}
|
|
51
|
+
return true;
|
|
52
|
+
});
|
|
53
|
+
// 重建缓冲(桩实现,重放 retained)
|
|
54
|
+
this.slots.fill(undefined);
|
|
55
|
+
this.head = 0;
|
|
56
|
+
this.size = 0;
|
|
57
|
+
for (const s of kept)
|
|
58
|
+
this.push({ modality: s.modality, content: s.content, ts: s.ts });
|
|
59
|
+
return expired;
|
|
60
|
+
}
|
|
61
|
+
clear() {
|
|
62
|
+
this.slots.fill(undefined);
|
|
63
|
+
this.head = 0;
|
|
64
|
+
this.size = 0;
|
|
65
|
+
}
|
|
66
|
+
nextId() {
|
|
67
|
+
this.seq += 1;
|
|
68
|
+
return `sensory-${Date.now()}-${this.seq}`;
|
|
69
|
+
}
|
|
70
|
+
}
|