superlocalmemory 4.1.13 → 4.1.14
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/.claude-plugin/marketplace.json +2 -2
- package/CHANGELOG.md +48 -0
- package/README.md +3 -3
- package/package.json +1 -8
- package/plugin/.claude-plugin/plugin.json +1 -1
- package/plugin/CLAUDE.md +3 -3
- package/plugin/agents/slm-governance-advisor.md +1 -1
- package/plugin/agents/slm-loop-runner.md +1 -1
- package/plugin/agents/slm-memory-advisor.md +1 -1
- package/plugin/agents/slm-optimize-advisor.md +1 -1
- package/plugin/requirements.txt +1 -1
- package/plugin/skills/slm-cache/SKILL.md +1 -1
- package/plugin/skills/slm-compress/SKILL.md +1 -1
- package/plugin/skills/slm-governance/SKILL.md +1 -1
- package/plugin/skills/slm-graph/SKILL.md +1 -1
- package/plugin/skills/slm-loop/SKILL.md +1 -1
- package/plugin/skills/slm-mesh/SKILL.md +1 -1
- package/plugin/skills/slm-profile/SKILL.md +1 -1
- package/plugin/skills/slm-recall/SKILL.md +1 -1
- package/plugin/skills/slm-remember/SKILL.md +1 -1
- package/plugin/skills/slm-scope/SKILL.md +1 -1
- package/plugin/skills/slm-session/SKILL.md +1 -1
- package/plugin/skills/slm-status/SKILL.md +1 -1
- package/plugin-src/agents/slm-memory-advisor.md +1 -1
- package/plugin-src/agents/slm-optimize-advisor.md +1 -1
- package/plugin-src/rules/AGENTS.md +1 -1
- package/plugin-src/skills/slm-cache/SKILL.md +1 -1
- package/plugin-src/skills/slm-compress/SKILL.md +1 -1
- package/plugin-src/skills/slm-governance/SKILL.md +1 -1
- package/plugin-src/skills/slm-graph/SKILL.md +1 -1
- package/plugin-src/skills/slm-loop/SKILL.md +1 -1
- package/plugin-src/skills/slm-mesh/SKILL.md +1 -1
- package/plugin-src/skills/slm-profile/SKILL.md +1 -1
- package/plugin-src/skills/slm-recall/SKILL.md +1 -1
- package/plugin-src/skills/slm-remember/SKILL.md +1 -1
- package/plugin-src/skills/slm-scope/SKILL.md +1 -1
- package/plugin-src/skills/slm-session/SKILL.md +1 -1
- package/plugin-src/skills/slm-status/SKILL.md +1 -1
- package/scripts/postinstall.js +71 -2
- package/pyproject.toml +0 -250
- package/src/superlocalmemory/__init__.py +0 -82
- package/src/superlocalmemory/access/__init__.py +0 -3
- package/src/superlocalmemory/access/rbac.py +0 -575
- package/src/superlocalmemory/attribution/__init__.py +0 -9
- package/src/superlocalmemory/attribution/signer.py +0 -173
- package/src/superlocalmemory/attribution/watermark.py +0 -189
- package/src/superlocalmemory/brain/__init__.py +0 -5
- package/src/superlocalmemory/brain/truth.py +0 -418
- package/src/superlocalmemory/cli/__init__.py +0 -5
- package/src/superlocalmemory/cli/__main__.py +0 -17
- package/src/superlocalmemory/cli/_lazy_init.py +0 -115
- package/src/superlocalmemory/cli/cache_cmd.py +0 -198
- package/src/superlocalmemory/cli/commands.py +0 -4710
- package/src/superlocalmemory/cli/compress_cmd.py +0 -151
- package/src/superlocalmemory/cli/context_commands.py +0 -193
- package/src/superlocalmemory/cli/daemon.py +0 -909
- package/src/superlocalmemory/cli/db_migrate.py +0 -150
- package/src/superlocalmemory/cli/diagnostics_cmd.py +0 -101
- package/src/superlocalmemory/cli/escape_hatch.py +0 -220
- package/src/superlocalmemory/cli/evidence_cmd.py +0 -103
- package/src/superlocalmemory/cli/gdpr_cmd.py +0 -792
- package/src/superlocalmemory/cli/gdpr_io.py +0 -109
- package/src/superlocalmemory/cli/help_cmd.py +0 -197
- package/src/superlocalmemory/cli/host_upgrades.py +0 -189
- package/src/superlocalmemory/cli/ingest_cmd.py +0 -327
- package/src/superlocalmemory/cli/json_output.py +0 -81
- package/src/superlocalmemory/cli/loop_cmd.py +0 -187
- package/src/superlocalmemory/cli/main.py +0 -1145
- package/src/superlocalmemory/cli/mesh_cmd.py +0 -38
- package/src/superlocalmemory/cli/migrate_cmd.py +0 -55
- package/src/superlocalmemory/cli/ops_cmd.py +0 -281
- package/src/superlocalmemory/cli/optimize_cmd.py +0 -179
- package/src/superlocalmemory/cli/optimize_constants.py +0 -31
- package/src/superlocalmemory/cli/pending_store.py +0 -296
- package/src/superlocalmemory/cli/proxy_cmd.py +0 -108
- package/src/superlocalmemory/cli/scale_engine_cmd.py +0 -56
- package/src/superlocalmemory/cli/service_installer.py +0 -373
- package/src/superlocalmemory/cli/setup_wizard.py +0 -1162
- package/src/superlocalmemory/cli/summary_cmd.py +0 -215
- package/src/superlocalmemory/cli/version_banner.py +0 -202
- package/src/superlocalmemory/cli/wizard_v3426_options.py +0 -129
- package/src/superlocalmemory/code_graph/__init__.py +0 -46
- package/src/superlocalmemory/code_graph/blast_radius.py +0 -177
- package/src/superlocalmemory/code_graph/bridge/__init__.py +0 -36
- package/src/superlocalmemory/code_graph/bridge/entity_resolver.py +0 -490
- package/src/superlocalmemory/code_graph/bridge/event_listeners.py +0 -206
- package/src/superlocalmemory/code_graph/bridge/fact_enricher.py +0 -159
- package/src/superlocalmemory/code_graph/bridge/hebbian_linker.py +0 -170
- package/src/superlocalmemory/code_graph/bridge/maintenance.py +0 -220
- package/src/superlocalmemory/code_graph/bridge/temporal_checker.py +0 -152
- package/src/superlocalmemory/code_graph/changes.py +0 -363
- package/src/superlocalmemory/code_graph/communities.py +0 -299
- package/src/superlocalmemory/code_graph/config.py +0 -154
- package/src/superlocalmemory/code_graph/database.py +0 -526
- package/src/superlocalmemory/code_graph/extractors/__init__.py +0 -95
- package/src/superlocalmemory/code_graph/extractors/python.py +0 -413
- package/src/superlocalmemory/code_graph/extractors/typescript.py +0 -556
- package/src/superlocalmemory/code_graph/flows.py +0 -350
- package/src/superlocalmemory/code_graph/git_hooks.py +0 -226
- package/src/superlocalmemory/code_graph/graph_engine.py +0 -295
- package/src/superlocalmemory/code_graph/graph_store.py +0 -335
- package/src/superlocalmemory/code_graph/incremental.py +0 -200
- package/src/superlocalmemory/code_graph/models.py +0 -130
- package/src/superlocalmemory/code_graph/parser.py +0 -687
- package/src/superlocalmemory/code_graph/resolver.py +0 -321
- package/src/superlocalmemory/code_graph/search.py +0 -460
- package/src/superlocalmemory/code_graph/service.py +0 -95
- package/src/superlocalmemory/code_graph/watcher.py +0 -207
- package/src/superlocalmemory/compliance/__init__.py +0 -0
- package/src/superlocalmemory/compliance/abac.py +0 -204
- package/src/superlocalmemory/compliance/audit.py +0 -385
- package/src/superlocalmemory/compliance/eu_ai_act.py +0 -101
- package/src/superlocalmemory/compliance/gdpr.py +0 -1479
- package/src/superlocalmemory/compliance/lifecycle.py +0 -158
- package/src/superlocalmemory/compliance/retention.py +0 -415
- package/src/superlocalmemory/compliance/scheduler.py +0 -217
- package/src/superlocalmemory/contracts/__init__.py +0 -1
- package/src/superlocalmemory/contracts/schemas/agent-experience-v1.schema.json +0 -92
- package/src/superlocalmemory/contracts/schemas/agent-integration-contract-v2.schema.json +0 -46
- package/src/superlocalmemory/contracts/schemas/cognitive-turn-receipt-v1.schema.json +0 -59
- package/src/superlocalmemory/contracts/v402.py +0 -62
- package/src/superlocalmemory/core/__init__.py +0 -0
- package/src/superlocalmemory/core/actor_context.py +0 -166
- package/src/superlocalmemory/core/admission.py +0 -769
- package/src/superlocalmemory/core/backend_orchestrator.py +0 -637
- package/src/superlocalmemory/core/block_hygiene.py +0 -147
- package/src/superlocalmemory/core/community_summary.py +0 -267
- package/src/superlocalmemory/core/component_healer.py +0 -144
- package/src/superlocalmemory/core/component_registry.py +0 -514
- package/src/superlocalmemory/core/config.py +0 -2204
- package/src/superlocalmemory/core/consolidation_engine.py +0 -983
- package/src/superlocalmemory/core/context_cache.py +0 -574
- package/src/superlocalmemory/core/derivation_lineage.py +0 -246
- package/src/superlocalmemory/core/embedding_worker.py +0 -208
- package/src/superlocalmemory/core/embeddings.py +0 -1052
- package/src/superlocalmemory/core/engine.py +0 -1395
- package/src/superlocalmemory/core/engine_capabilities.py +0 -24
- package/src/superlocalmemory/core/engine_ingestion.py +0 -983
- package/src/superlocalmemory/core/engine_lock.py +0 -75
- package/src/superlocalmemory/core/engine_wiring.py +0 -776
- package/src/superlocalmemory/core/entity_community.py +0 -178
- package/src/superlocalmemory/core/error_envelope.py +0 -60
- package/src/superlocalmemory/core/evidence_bundle.py +0 -528
- package/src/superlocalmemory/core/fact_consolidator.py +0 -812
- package/src/superlocalmemory/core/file_lock.py +0 -92
- package/src/superlocalmemory/core/graph_analyzer.py +0 -456
- package/src/superlocalmemory/core/graph_metrics.py +0 -597
- package/src/superlocalmemory/core/graph_pruner.py +0 -939
- package/src/superlocalmemory/core/health_monitor.py +0 -338
- package/src/superlocalmemory/core/hooks.py +0 -65
- package/src/superlocalmemory/core/ingest_gate.py +0 -133
- package/src/superlocalmemory/core/ingest_policy.py +0 -38
- package/src/superlocalmemory/core/ingestion_command.py +0 -1042
- package/src/superlocalmemory/core/injection.py +0 -434
- package/src/superlocalmemory/core/install_detector.py +0 -131
- package/src/superlocalmemory/core/key_expander.py +0 -138
- package/src/superlocalmemory/core/lifecycle_state.py +0 -153
- package/src/superlocalmemory/core/maintenance.py +0 -777
- package/src/superlocalmemory/core/maintenance_scheduler.py +0 -507
- package/src/superlocalmemory/core/materialization_control.py +0 -20
- package/src/superlocalmemory/core/mcp_embedder_proxy.py +0 -89
- package/src/superlocalmemory/core/memory_health.py +0 -266
- package/src/superlocalmemory/core/mode_capability.py +0 -111
- package/src/superlocalmemory/core/modes.py +0 -168
- package/src/superlocalmemory/core/mutations.py +0 -688
- package/src/superlocalmemory/core/ollama_embedder.py +0 -266
- package/src/superlocalmemory/core/ollama_validator.py +0 -315
- package/src/superlocalmemory/core/operation_policy.py +0 -92
- package/src/superlocalmemory/core/operation_policy_registry.py +0 -542
- package/src/superlocalmemory/core/operation_request.py +0 -127
- package/src/superlocalmemory/core/ops_remediation.py +0 -542
- package/src/superlocalmemory/core/pii.py +0 -105
- package/src/superlocalmemory/core/platform_utils.py +0 -138
- package/src/superlocalmemory/core/profiles.py +0 -234
- package/src/superlocalmemory/core/progressive_abstraction.py +0 -208
- package/src/superlocalmemory/core/projection_drain.py +0 -380
- package/src/superlocalmemory/core/queue_consumer.py +0 -168
- package/src/superlocalmemory/core/ram_lock.py +0 -160
- package/src/superlocalmemory/core/rate_limit.py +0 -151
- package/src/superlocalmemory/core/recall_gate.py +0 -95
- package/src/superlocalmemory/core/recall_pipeline.py +0 -1337
- package/src/superlocalmemory/core/recall_queue.py +0 -377
- package/src/superlocalmemory/core/recall_worker.py +0 -414
- package/src/superlocalmemory/core/registry.py +0 -121
- package/src/superlocalmemory/core/remember_admission.py +0 -161
- package/src/superlocalmemory/core/remember_runtime.py +0 -1190
- package/src/superlocalmemory/core/remote_mode.py +0 -214
- package/src/superlocalmemory/core/reranker_worker.py +0 -338
- package/src/superlocalmemory/core/safe_fs.py +0 -108
- package/src/superlocalmemory/core/scale_autopromote.py +0 -196
- package/src/superlocalmemory/core/scale_engine.py +0 -915
- package/src/superlocalmemory/core/score_contract.py +0 -82
- package/src/superlocalmemory/core/security_primitives.py +0 -672
- package/src/superlocalmemory/core/session_identity.py +0 -98
- package/src/superlocalmemory/core/shadow_router.py +0 -319
- package/src/superlocalmemory/core/slm_disabled.py +0 -85
- package/src/superlocalmemory/core/status_contract.py +0 -108
- package/src/superlocalmemory/core/store_pipeline.py +0 -1404
- package/src/superlocalmemory/core/summarizer.py +0 -200
- package/src/superlocalmemory/core/tier_manager.py +0 -461
- package/src/superlocalmemory/core/topic_signature.py +0 -156
- package/src/superlocalmemory/core/transactions/__init__.py +0 -78
- package/src/superlocalmemory/core/transactions/concrete_owners.py +0 -604
- package/src/superlocalmemory/core/transactions/erasure.py +0 -825
- package/src/superlocalmemory/core/transactions/manifest.py +0 -255
- package/src/superlocalmemory/core/transactions/manifest_key.py +0 -155
- package/src/superlocalmemory/core/transactions/obligations.py +0 -272
- package/src/superlocalmemory/core/transactions/owners.py +0 -114
- package/src/superlocalmemory/core/transactions/reconciler.py +0 -285
- package/src/superlocalmemory/core/transactions/service.py +0 -330
- package/src/superlocalmemory/core/worker_pool.py +0 -377
- package/src/superlocalmemory/core/working_memory.py +0 -288
- package/src/superlocalmemory/dynamics/__init__.py +0 -0
- package/src/superlocalmemory/dynamics/activation_guided_quantization.py +0 -374
- package/src/superlocalmemory/dynamics/eap_scheduler.py +0 -294
- package/src/superlocalmemory/dynamics/ebbinghaus_langevin_coupling.py +0 -171
- package/src/superlocalmemory/dynamics/fisher_langevin_coupling.py +0 -227
- package/src/superlocalmemory/encoding/__init__.py +0 -0
- package/src/superlocalmemory/encoding/auto_linker.py +0 -308
- package/src/superlocalmemory/encoding/cognitive_consolidator.py +0 -899
- package/src/superlocalmemory/encoding/consolidator.py +0 -472
- package/src/superlocalmemory/encoding/context_generator.py +0 -175
- package/src/superlocalmemory/encoding/emotional.py +0 -189
- package/src/superlocalmemory/encoding/entity_reflexion.py +0 -200
- package/src/superlocalmemory/encoding/entity_resolver.py +0 -687
- package/src/superlocalmemory/encoding/entropy_gate.py +0 -101
- package/src/superlocalmemory/encoding/fact_extractor.py +0 -877
- package/src/superlocalmemory/encoding/foresight.py +0 -93
- package/src/superlocalmemory/encoding/graph_builder.py +0 -346
- package/src/superlocalmemory/encoding/observation_builder.py +0 -177
- package/src/superlocalmemory/encoding/prospective_markers.py +0 -262
- package/src/superlocalmemory/encoding/scene_builder.py +0 -410
- package/src/superlocalmemory/encoding/signal_inference.py +0 -90
- package/src/superlocalmemory/encoding/temporal_parser.py +0 -432
- package/src/superlocalmemory/encoding/temporal_validator.py +0 -572
- package/src/superlocalmemory/encoding/type_router.py +0 -237
- package/src/superlocalmemory/evaluation/__init__.py +0 -13
- package/src/superlocalmemory/evaluation/calibration.py +0 -308
- package/src/superlocalmemory/evolution/__init__.py +0 -29
- package/src/superlocalmemory/evolution/blind_verifier.py +0 -122
- package/src/superlocalmemory/evolution/budget.py +0 -356
- package/src/superlocalmemory/evolution/evolution_store.py +0 -619
- package/src/superlocalmemory/evolution/llm_dispatch.py +0 -559
- package/src/superlocalmemory/evolution/model_selection.py +0 -175
- package/src/superlocalmemory/evolution/mutation_generator.py +0 -226
- package/src/superlocalmemory/evolution/skill_activator.py +0 -270
- package/src/superlocalmemory/evolution/skill_evolver.py +0 -928
- package/src/superlocalmemory/evolution/triggers.py +0 -376
- package/src/superlocalmemory/evolution/types.py +0 -114
- package/src/superlocalmemory/graph/__init__.py +0 -9
- package/src/superlocalmemory/graph/cozo_adjacency.py +0 -122
- package/src/superlocalmemory/graph/cozo_backend.py +0 -751
- package/src/superlocalmemory/hooks/__init__.py +0 -3
- package/src/superlocalmemory/hooks/_outcome_common.py +0 -523
- package/src/superlocalmemory/hooks/adapter_base.py +0 -347
- package/src/superlocalmemory/hooks/antigravity_adapter.py +0 -171
- package/src/superlocalmemory/hooks/auto_capture.py +0 -133
- package/src/superlocalmemory/hooks/auto_invoker.py +0 -521
- package/src/superlocalmemory/hooks/auto_parameterize.py +0 -147
- package/src/superlocalmemory/hooks/auto_recall.py +0 -191
- package/src/superlocalmemory/hooks/auto_recall_hook.py +0 -251
- package/src/superlocalmemory/hooks/before_web_hook.py +0 -131
- package/src/superlocalmemory/hooks/claude_code_hooks.py +0 -637
- package/src/superlocalmemory/hooks/codex_assets.py +0 -251
- package/src/superlocalmemory/hooks/codex_hooks.py +0 -186
- package/src/superlocalmemory/hooks/context_payload.py +0 -311
- package/src/superlocalmemory/hooks/copilot_adapter.py +0 -208
- package/src/superlocalmemory/hooks/cross_platform_connector.py +0 -90
- package/src/superlocalmemory/hooks/cursor_adapter.py +0 -173
- package/src/superlocalmemory/hooks/hook_daemon.py +0 -295
- package/src/superlocalmemory/hooks/hook_handlers.py +0 -822
- package/src/superlocalmemory/hooks/ide_connector.py +0 -246
- package/src/superlocalmemory/hooks/memory_protocol.py +0 -158
- package/src/superlocalmemory/hooks/portable_kit.py +0 -755
- package/src/superlocalmemory/hooks/post_tool_async_hook.py +0 -183
- package/src/superlocalmemory/hooks/post_tool_outcome_hook.py +0 -351
- package/src/superlocalmemory/hooks/prewarm_auth.py +0 -187
- package/src/superlocalmemory/hooks/rules_engine.py +0 -99
- package/src/superlocalmemory/hooks/session_registry.py +0 -330
- package/src/superlocalmemory/hooks/stop_outcome_hook.py +0 -138
- package/src/superlocalmemory/hooks/sync_loop.py +0 -114
- package/src/superlocalmemory/hooks/topic_shift_hook.py +0 -302
- package/src/superlocalmemory/hooks/user_prompt_hook.py +0 -131
- package/src/superlocalmemory/hooks/user_prompt_rehash_hook.py +0 -210
- package/src/superlocalmemory/infra/__init__.py +0 -3
- package/src/superlocalmemory/infra/auth_middleware.py +0 -145
- package/src/superlocalmemory/infra/backup.py +0 -974
- package/src/superlocalmemory/infra/backup_obligations.py +0 -423
- package/src/superlocalmemory/infra/cache_manager.py +0 -267
- package/src/superlocalmemory/infra/cloud_backup.py +0 -788
- package/src/superlocalmemory/infra/daemon_identity.py +0 -300
- package/src/superlocalmemory/infra/data_root.py +0 -238
- package/src/superlocalmemory/infra/event_bus.py +0 -637
- package/src/superlocalmemory/infra/local_diagnostics.py +0 -327
- package/src/superlocalmemory/infra/pid_manager.py +0 -193
- package/src/superlocalmemory/infra/process_identity.py +0 -180
- package/src/superlocalmemory/infra/process_reaper.py +0 -624
- package/src/superlocalmemory/infra/rate_limiter.py +0 -228
- package/src/superlocalmemory/infra/self_heal.py +0 -401
- package/src/superlocalmemory/infra/version_integrity.py +0 -229
- package/src/superlocalmemory/ingestion/__init__.py +0 -13
- package/src/superlocalmemory/ingestion/adapter_manager.py +0 -255
- package/src/superlocalmemory/ingestion/base_adapter.py +0 -171
- package/src/superlocalmemory/ingestion/calendar_adapter.py +0 -349
- package/src/superlocalmemory/ingestion/credentials.py +0 -125
- package/src/superlocalmemory/ingestion/gmail_adapter.py +0 -378
- package/src/superlocalmemory/ingestion/parsers.py +0 -100
- package/src/superlocalmemory/ingestion/transcript_adapter.py +0 -161
- package/src/superlocalmemory/integrations/__init__.py +0 -1
- package/src/superlocalmemory/integrations/bounded_loops_mcp.py +0 -431
- package/src/superlocalmemory/integrations/bounded_loops_v051.py +0 -236
- package/src/superlocalmemory/learning/__init__.py +0 -0
- package/src/superlocalmemory/learning/adaptive.py +0 -172
- package/src/superlocalmemory/learning/arm_catalog.py +0 -97
- package/src/superlocalmemory/learning/assertion_miner.py +0 -403
- package/src/superlocalmemory/learning/bandit.py +0 -654
- package/src/superlocalmemory/learning/bandit_cache.py +0 -131
- package/src/superlocalmemory/learning/behavioral.py +0 -542
- package/src/superlocalmemory/learning/bootstrap.py +0 -298
- package/src/superlocalmemory/learning/consolidation_cycle.py +0 -398
- package/src/superlocalmemory/learning/consolidation_quantization_worker.py +0 -115
- package/src/superlocalmemory/learning/consolidation_worker.py +0 -261
- package/src/superlocalmemory/learning/cross_project.py +0 -408
- package/src/superlocalmemory/learning/database.py +0 -698
- package/src/superlocalmemory/learning/dedup_hnsw.py +0 -413
- package/src/superlocalmemory/learning/engagement.py +0 -487
- package/src/superlocalmemory/learning/engagement_features.py +0 -279
- package/src/superlocalmemory/learning/ensemble.py +0 -309
- package/src/superlocalmemory/learning/entity_compiler.py +0 -356
- package/src/superlocalmemory/learning/fact_outcome_joins.py +0 -207
- package/src/superlocalmemory/learning/features.py +0 -138
- package/src/superlocalmemory/learning/feedback.py +0 -724
- package/src/superlocalmemory/learning/forgetting_scheduler.py +0 -375
- package/src/superlocalmemory/learning/hnsw_dedup.py +0 -69
- package/src/superlocalmemory/learning/labeler.py +0 -85
- package/src/superlocalmemory/learning/legacy_migration.py +0 -316
- package/src/superlocalmemory/learning/lightgbm_subprocess.py +0 -236
- package/src/superlocalmemory/learning/memory_merge.py +0 -175
- package/src/superlocalmemory/learning/model_cache.py +0 -267
- package/src/superlocalmemory/learning/model_rollback.py +0 -281
- package/src/superlocalmemory/learning/outcome_queue.py +0 -306
- package/src/superlocalmemory/learning/outcomes.py +0 -286
- package/src/superlocalmemory/learning/pattern_miner.py +0 -465
- package/src/superlocalmemory/learning/pattern_miner_constants.py +0 -90
- package/src/superlocalmemory/learning/pcos.py +0 -291
- package/src/superlocalmemory/learning/project_context.py +0 -366
- package/src/superlocalmemory/learning/propensity.py +0 -131
- package/src/superlocalmemory/learning/ranker.py +0 -300
- package/src/superlocalmemory/learning/ranker_common.py +0 -163
- package/src/superlocalmemory/learning/ranker_retrain_legacy.py +0 -210
- package/src/superlocalmemory/learning/ranker_retrain_online.py +0 -423
- package/src/superlocalmemory/learning/reward.py +0 -888
- package/src/superlocalmemory/learning/reward_archive.py +0 -223
- package/src/superlocalmemory/learning/reward_boost.py +0 -211
- package/src/superlocalmemory/learning/reward_from_outcomes.py +0 -365
- package/src/superlocalmemory/learning/reward_model.py +0 -144
- package/src/superlocalmemory/learning/reward_proxy.py +0 -578
- package/src/superlocalmemory/learning/shadow_test.py +0 -524
- package/src/superlocalmemory/learning/signal_kinds.py +0 -79
- package/src/superlocalmemory/learning/signal_worker.py +0 -268
- package/src/superlocalmemory/learning/signals.py +0 -646
- package/src/superlocalmemory/learning/skill_performance_miner.py +0 -422
- package/src/superlocalmemory/learning/source_quality.py +0 -828
- package/src/superlocalmemory/learning/trigram_index.py +0 -548
- package/src/superlocalmemory/learning/workflows.py +0 -309
- package/src/superlocalmemory/llm/__init__.py +0 -0
- package/src/superlocalmemory/llm/backbone.py +0 -364
- package/src/superlocalmemory/loops/__init__.py +0 -58
- package/src/superlocalmemory/loops/budget.py +0 -58
- package/src/superlocalmemory/loops/engine.py +0 -174
- package/src/superlocalmemory/loops/ledger.py +0 -298
- package/src/superlocalmemory/loops/models.py +0 -152
- package/src/superlocalmemory/loops/rules.py +0 -52
- package/src/superlocalmemory/math/__init__.py +0 -0
- package/src/superlocalmemory/math/ebbinghaus.py +0 -352
- package/src/superlocalmemory/math/fisher.py +0 -356
- package/src/superlocalmemory/math/fisher_quantized.py +0 -255
- package/src/superlocalmemory/math/hopfield.py +0 -282
- package/src/superlocalmemory/math/langevin.py +0 -411
- package/src/superlocalmemory/math/polar_quant.py +0 -414
- package/src/superlocalmemory/math/qjl.py +0 -115
- package/src/superlocalmemory/math/sheaf.py +0 -261
- package/src/superlocalmemory/math/turbo_quant.py +0 -318
- package/src/superlocalmemory/mcp/__init__.py +0 -0
- package/src/superlocalmemory/mcp/_daemon_proxy.py +0 -203
- package/src/superlocalmemory/mcp/_pool_adapter.py +0 -181
- package/src/superlocalmemory/mcp/_stdin_guard.py +0 -60
- package/src/superlocalmemory/mcp/agent_context.py +0 -115
- package/src/superlocalmemory/mcp/cli_fallback.py +0 -602
- package/src/superlocalmemory/mcp/http_transport.py +0 -85
- package/src/superlocalmemory/mcp/profiles.py +0 -154
- package/src/superlocalmemory/mcp/resources.py +0 -281
- package/src/superlocalmemory/mcp/server.py +0 -480
- package/src/superlocalmemory/mcp/session_binding.py +0 -98
- package/src/superlocalmemory/mcp/shared.py +0 -112
- package/src/superlocalmemory/mcp/tools.py +0 -18
- package/src/superlocalmemory/mcp/tools_active.py +0 -958
- package/src/superlocalmemory/mcp/tools_brain.py +0 -298
- package/src/superlocalmemory/mcp/tools_code_graph.py +0 -1717
- package/src/superlocalmemory/mcp/tools_context.py +0 -239
- package/src/superlocalmemory/mcp/tools_core.py +0 -1112
- package/src/superlocalmemory/mcp/tools_evolution.py +0 -343
- package/src/superlocalmemory/mcp/tools_learning.py +0 -393
- package/src/superlocalmemory/mcp/tools_loops.py +0 -345
- package/src/superlocalmemory/mcp/tools_mesh.py +0 -429
- package/src/superlocalmemory/mcp/tools_ops.py +0 -115
- package/src/superlocalmemory/mcp/tools_optimize.py +0 -322
- package/src/superlocalmemory/mcp/tools_summaries.py +0 -147
- package/src/superlocalmemory/mcp/tools_v28.py +0 -292
- package/src/superlocalmemory/mcp/tools_v3.py +0 -398
- package/src/superlocalmemory/mcp/tools_v33.py +0 -507
- package/src/superlocalmemory/mesh/__init__.py +0 -12
- package/src/superlocalmemory/mesh/broker.py +0 -812
- package/src/superlocalmemory/mesh/broker_security.py +0 -470
- package/src/superlocalmemory/mesh/discovery.py +0 -365
- package/src/superlocalmemory/mesh/lock_protocol.py +0 -313
- package/src/superlocalmemory/mesh/node_identity.py +0 -97
- package/src/superlocalmemory/mesh/outbox_remote.py +0 -429
- package/src/superlocalmemory/mesh/remote_sync.py +0 -829
- package/src/superlocalmemory/mesh/state_sync.py +0 -286
- package/src/superlocalmemory/migrations/__init__.py +0 -5
- package/src/superlocalmemory/migrations/v3_4_25_to_v3_4_26.py +0 -144
- package/src/superlocalmemory/optimize/NOTICE +0 -6
- package/src/superlocalmemory/optimize/__init__.py +0 -0
- package/src/superlocalmemory/optimize/adapters/__init__.py +0 -68
- package/src/superlocalmemory/optimize/adapters/_agent_registry.py +0 -120
- package/src/superlocalmemory/optimize/adapters/anthropic_adapter.py +0 -112
- package/src/superlocalmemory/optimize/adapters/openai_adapter.py +0 -122
- package/src/superlocalmemory/optimize/adapters/wrap.py +0 -228
- package/src/superlocalmemory/optimize/cache/__init__.py +0 -31
- package/src/superlocalmemory/optimize/cache/boundary_store.py +0 -488
- package/src/superlocalmemory/optimize/cache/centroid_store.py +0 -199
- package/src/superlocalmemory/optimize/cache/context_key.py +0 -67
- package/src/superlocalmemory/optimize/cache/exact.py +0 -88
- package/src/superlocalmemory/optimize/cache/invalidation.py +0 -36
- package/src/superlocalmemory/optimize/cache/key_builder.py +0 -111
- package/src/superlocalmemory/optimize/cache/manager.py +0 -737
- package/src/superlocalmemory/optimize/cache/semantic.py +0 -637
- package/src/superlocalmemory/optimize/cache/stampede.py +0 -50
- package/src/superlocalmemory/optimize/compress/__init__.py +0 -17
- package/src/superlocalmemory/optimize/compress/align.py +0 -159
- package/src/superlocalmemory/optimize/compress/ccr.py +0 -116
- package/src/superlocalmemory/optimize/compress/prose_llmlingua.py +0 -71
- package/src/superlocalmemory/optimize/compress/router.py +0 -667
- package/src/superlocalmemory/optimize/config/__init__.py +0 -56
- package/src/superlocalmemory/optimize/config/defaults.py +0 -43
- package/src/superlocalmemory/optimize/config/schema.py +0 -327
- package/src/superlocalmemory/optimize/config/store.py +0 -270
- package/src/superlocalmemory/optimize/metrics/__init__.py +0 -8
- package/src/superlocalmemory/optimize/metrics/counters.py +0 -155
- package/src/superlocalmemory/optimize/metrics/estimator.py +0 -87
- package/src/superlocalmemory/optimize/metrics/exporters.py +0 -77
- package/src/superlocalmemory/optimize/metrics/persistence.py +0 -115
- package/src/superlocalmemory/optimize/proxy/__init__.py +0 -28
- package/src/superlocalmemory/optimize/proxy/_helpers.py +0 -730
- package/src/superlocalmemory/optimize/proxy/anthropic_surface.py +0 -375
- package/src/superlocalmemory/optimize/proxy/capture.py +0 -550
- package/src/superlocalmemory/optimize/proxy/gemini_surface.py +0 -528
- package/src/superlocalmemory/optimize/proxy/lifecycle.py +0 -126
- package/src/superlocalmemory/optimize/proxy/openai_surface.py +0 -465
- package/src/superlocalmemory/optimize/proxy/server.py +0 -199
- package/src/superlocalmemory/optimize/proxy/vertex_surface.py +0 -246
- package/src/superlocalmemory/optimize/storage/__init__.py +0 -0
- package/src/superlocalmemory/optimize/storage/db.py +0 -1185
- package/src/superlocalmemory/optimize/storage/schema.py +0 -205
- package/src/superlocalmemory/parameterization/__init__.py +0 -47
- package/src/superlocalmemory/parameterization/cross_project.py +0 -12
- package/src/superlocalmemory/parameterization/pattern_extractor.py +0 -584
- package/src/superlocalmemory/parameterization/pii_filter.py +0 -106
- package/src/superlocalmemory/parameterization/prompt_injector.py +0 -219
- package/src/superlocalmemory/parameterization/prompt_lifecycle.py +0 -281
- package/src/superlocalmemory/parameterization/soft_prompt_generator.py +0 -542
- package/src/superlocalmemory/parameterization/workflow_miner.py +0 -17
- package/src/superlocalmemory/reliability/__init__.py +0 -45
- package/src/superlocalmemory/reliability/join_liveness.py +0 -301
- package/src/superlocalmemory/reliability/prior_distance.py +0 -243
- package/src/superlocalmemory/retrieval/__init__.py +0 -0
- package/src/superlocalmemory/retrieval/agentic.py +0 -367
- package/src/superlocalmemory/retrieval/ann_index.py +0 -235
- package/src/superlocalmemory/retrieval/bm25_channel.py +0 -451
- package/src/superlocalmemory/retrieval/bridge_discovery.py +0 -253
- package/src/superlocalmemory/retrieval/channel_registry.py +0 -154
- package/src/superlocalmemory/retrieval/channel_status.py +0 -117
- package/src/superlocalmemory/retrieval/engine.py +0 -1615
- package/src/superlocalmemory/retrieval/entity_channel.py +0 -994
- package/src/superlocalmemory/retrieval/forgetting_filter.py +0 -160
- package/src/superlocalmemory/retrieval/fusion.py +0 -81
- package/src/superlocalmemory/retrieval/graph_adjacency.py +0 -219
- package/src/superlocalmemory/retrieval/hopfield_channel.py +0 -465
- package/src/superlocalmemory/retrieval/profile_channel.py +0 -105
- package/src/superlocalmemory/retrieval/quantization_aware_search.py +0 -147
- package/src/superlocalmemory/retrieval/remote_reranker.py +0 -758
- package/src/superlocalmemory/retrieval/reranker.py +0 -674
- package/src/superlocalmemory/retrieval/scope_policy.py +0 -126
- package/src/superlocalmemory/retrieval/semantic_channel.py +0 -638
- package/src/superlocalmemory/retrieval/spreading.py +0 -288
- package/src/superlocalmemory/retrieval/spreading_activation.py +0 -616
- package/src/superlocalmemory/retrieval/strategy.py +0 -248
- package/src/superlocalmemory/retrieval/temporal_channel.py +0 -433
- package/src/superlocalmemory/retrieval/temporal_frame.py +0 -102
- package/src/superlocalmemory/retrieval/temporal_utils.py +0 -122
- package/src/superlocalmemory/retrieval/temporal_validity_filter.py +0 -499
- package/src/superlocalmemory/retrieval/time_window.py +0 -181
- package/src/superlocalmemory/retrieval/vector_store.py +0 -863
- package/src/superlocalmemory/server/__init__.py +0 -1
- package/src/superlocalmemory/server/api.py +0 -310
- package/src/superlocalmemory/server/asset_versions.py +0 -171
- package/src/superlocalmemory/server/bandit_loops.py +0 -158
- package/src/superlocalmemory/server/config_file.py +0 -90
- package/src/superlocalmemory/server/consolidation_runner.py +0 -140
- package/src/superlocalmemory/server/egress_policy.py +0 -258
- package/src/superlocalmemory/server/loopback.py +0 -85
- package/src/superlocalmemory/server/middleware/__init__.py +0 -11
- package/src/superlocalmemory/server/middleware/security_headers.py +0 -144
- package/src/superlocalmemory/server/origin.py +0 -55
- package/src/superlocalmemory/server/profile_runtime.py +0 -515
- package/src/superlocalmemory/server/rbac_enforce.py +0 -194
- package/src/superlocalmemory/server/recall_health.py +0 -343
- package/src/superlocalmemory/server/recall_serializer.py +0 -320
- package/src/superlocalmemory/server/route_mutations.py +0 -104
- package/src/superlocalmemory/server/routes/__init__.py +0 -4
- package/src/superlocalmemory/server/routes/abstraction.py +0 -314
- package/src/superlocalmemory/server/routes/adapters.py +0 -63
- package/src/superlocalmemory/server/routes/agents.py +0 -303
- package/src/superlocalmemory/server/routes/backup.py +0 -869
- package/src/superlocalmemory/server/routes/behavioral.py +0 -659
- package/src/superlocalmemory/server/routes/brain.py +0 -1892
- package/src/superlocalmemory/server/routes/chat.py +0 -393
- package/src/superlocalmemory/server/routes/compliance.py +0 -533
- package/src/superlocalmemory/server/routes/config_api.py +0 -703
- package/src/superlocalmemory/server/routes/data_io.py +0 -329
- package/src/superlocalmemory/server/routes/entity.py +0 -237
- package/src/superlocalmemory/server/routes/events.py +0 -214
- package/src/superlocalmemory/server/routes/evolution.py +0 -510
- package/src/superlocalmemory/server/routes/helpers.py +0 -499
- package/src/superlocalmemory/server/routes/ingest.py +0 -137
- package/src/superlocalmemory/server/routes/insights.py +0 -366
- package/src/superlocalmemory/server/routes/learning.py +0 -834
- package/src/superlocalmemory/server/routes/learning_telemetry.py +0 -154
- package/src/superlocalmemory/server/routes/lifecycle.py +0 -184
- package/src/superlocalmemory/server/routes/memories.py +0 -1661
- package/src/superlocalmemory/server/routes/mesh.py +0 -517
- package/src/superlocalmemory/server/routes/mesh_lock.py +0 -54
- package/src/superlocalmemory/server/routes/mesh_state.py +0 -63
- package/src/superlocalmemory/server/routes/optimize.py +0 -197
- package/src/superlocalmemory/server/routes/prewarm.py +0 -173
- package/src/superlocalmemory/server/routes/profiles.py +0 -292
- package/src/superlocalmemory/server/routes/ratelimit.py +0 -132
- package/src/superlocalmemory/server/routes/rbac.py +0 -366
- package/src/superlocalmemory/server/routes/stats.py +0 -385
- package/src/superlocalmemory/server/routes/tiers.py +0 -222
- package/src/superlocalmemory/server/routes/timeline.py +0 -258
- package/src/superlocalmemory/server/routes/token.py +0 -90
- package/src/superlocalmemory/server/routes/v3_api.py +0 -3023
- package/src/superlocalmemory/server/routes/ws.py +0 -171
- package/src/superlocalmemory/server/security_middleware.py +0 -89
- package/src/superlocalmemory/server/ui.py +0 -354
- package/src/superlocalmemory/server/unified_daemon.py +0 -6326
- package/src/superlocalmemory/server/write_identity.py +0 -195
- package/src/superlocalmemory/storage/__init__.py +0 -0
- package/src/superlocalmemory/storage/_migration_internals.py +0 -638
- package/src/superlocalmemory/storage/_schema_version.py +0 -174
- package/src/superlocalmemory/storage/access_log.py +0 -170
- package/src/superlocalmemory/storage/admission_codec.py +0 -129
- package/src/superlocalmemory/storage/admission_journal.py +0 -843
- package/src/superlocalmemory/storage/agent_experience.py +0 -546
- package/src/superlocalmemory/storage/backup.py +0 -531
- package/src/superlocalmemory/storage/correction_cases.py +0 -670
- package/src/superlocalmemory/storage/database.py +0 -3180
- package/src/superlocalmemory/storage/deferred_writes.py +0 -209
- package/src/superlocalmemory/storage/embedding_codec.py +0 -200
- package/src/superlocalmemory/storage/embedding_migrator.py +0 -672
- package/src/superlocalmemory/storage/erasure_fence.py +0 -45
- package/src/superlocalmemory/storage/execution_learning.py +0 -285
- package/src/superlocalmemory/storage/external_evidence.py +0 -359
- package/src/superlocalmemory/storage/generation_fence.py +0 -63
- package/src/superlocalmemory/storage/lineage_retention.py +0 -236
- package/src/superlocalmemory/storage/logical_edges.py +0 -86
- package/src/superlocalmemory/storage/memory_write.py +0 -115
- package/src/superlocalmemory/storage/migration_runner.py +0 -895
- package/src/superlocalmemory/storage/migration_v33.py +0 -140
- package/src/superlocalmemory/storage/migrations/M001_add_signal_features_columns.py +0 -67
- package/src/superlocalmemory/storage/migrations/M002_model_state_history.py +0 -107
- package/src/superlocalmemory/storage/migrations/M003_migration_log.py +0 -38
- package/src/superlocalmemory/storage/migrations/M004_cross_platform_sync_log.py +0 -46
- package/src/superlocalmemory/storage/migrations/M005_bandit_tables.py +0 -75
- package/src/superlocalmemory/storage/migrations/M006_action_outcomes_reward.py +0 -75
- package/src/superlocalmemory/storage/migrations/M007_pending_outcomes.py +0 -63
- package/src/superlocalmemory/storage/migrations/M009_model_lineage.py +0 -94
- package/src/superlocalmemory/storage/migrations/M010_evolution_config.py +0 -80
- package/src/superlocalmemory/storage/migrations/M011_archive_and_merge.py +0 -87
- package/src/superlocalmemory/storage/migrations/M012_shadow_observations.py +0 -72
- package/src/superlocalmemory/storage/migrations/M013_bi_temporal_columns.py +0 -55
- package/src/superlocalmemory/storage/migrations/M014_v345_scale_ready.py +0 -45
- package/src/superlocalmemory/storage/migrations/M015_add_pinned_column.py +0 -58
- package/src/superlocalmemory/storage/migrations/M016_add_scope_support.py +0 -120
- package/src/superlocalmemory/storage/migrations/M017_ccq_scope_column.py +0 -79
- package/src/superlocalmemory/storage/migrations/M018_ingestion_operations.py +0 -120
- package/src/superlocalmemory/storage/migrations/M019_derivation_lineage.py +0 -54
- package/src/superlocalmemory/storage/migrations/M020_model_state_integrity.py +0 -52
- package/src/superlocalmemory/storage/migrations/M021_ingestion_log_profile.py +0 -108
- package/src/superlocalmemory/storage/migrations/M022_entity_aliases_profile.py +0 -86
- package/src/superlocalmemory/storage/migrations/M023_mesh_profile_isolation.py +0 -194
- package/src/superlocalmemory/storage/migrations/M024_rbac_users_roles.py +0 -87
- package/src/superlocalmemory/storage/migrations/M025_perf_indexes.py +0 -90
- package/src/superlocalmemory/storage/migrations/M026_rbac_memberships_fk.py +0 -136
- package/src/superlocalmemory/storage/migrations/M027_transferable_patterns_profile.py +0 -163
- package/src/superlocalmemory/storage/migrations/M028_fact_entity_associations.py +0 -305
- package/src/superlocalmemory/storage/migrations/M029_behavioral_history_indexes.py +0 -137
- package/src/superlocalmemory/storage/migrations/M030_entity_explorer_indexes.py +0 -93
- package/src/superlocalmemory/storage/migrations/M031_dead_letter_operations.py +0 -80
- package/src/superlocalmemory/storage/migrations/M032_write_coordinator_admission.py +0 -188
- package/src/superlocalmemory/storage/migrations/M033_projection_transactions.py +0 -148
- package/src/superlocalmemory/storage/migrations/M034_obligation_integrity.py +0 -58
- package/src/superlocalmemory/storage/migrations/M035_erasure_receipts.py +0 -113
- package/src/superlocalmemory/storage/migrations/M036_vector_row_map.py +0 -107
- package/src/superlocalmemory/storage/migrations/M037_manifest_hmac_version.py +0 -162
- package/src/superlocalmemory/storage/migrations/M038_learning_feedback_channel.py +0 -77
- package/src/superlocalmemory/storage/migrations/M039_scene_fact_members.py +0 -137
- package/src/superlocalmemory/storage/migrations/M040_agent_experience_receipts.py +0 -254
- package/src/superlocalmemory/storage/migrations/M041_external_evidence_receipts.py +0 -189
- package/src/superlocalmemory/storage/migrations/M042_correction_case_ledger.py +0 -245
- package/src/superlocalmemory/storage/migrations/M043_quarantine_display_summaries.py +0 -512
- package/src/superlocalmemory/storage/migrations/M044_play_carries_its_own_evidence.py +0 -127
- package/src/superlocalmemory/storage/migrations/M045_fact_outcome_score.py +0 -158
- package/src/superlocalmemory/storage/migrations/M046_prospective_memory_has_its_own_name.py +0 -620
- package/src/superlocalmemory/storage/migrations/M047_fisher_vectors_are_stored_like_every_other_vector.py +0 -306
- package/src/superlocalmemory/storage/migrations/M048_upcoming_holds_only_what_is_upcoming.py +0 -229
- package/src/superlocalmemory/storage/migrations/M049_a_schema_version_marker_is_one_row.py +0 -201
- package/src/superlocalmemory/storage/migrations/M050_execution_learning_v2.py +0 -70
- package/src/superlocalmemory/storage/migrations/__init__.py +0 -103
- package/src/superlocalmemory/storage/migrations.py +0 -333
- package/src/superlocalmemory/storage/models.py +0 -500
- package/src/superlocalmemory/storage/projection_outbox.py +0 -346
- package/src/superlocalmemory/storage/quantized_store.py +0 -280
- package/src/superlocalmemory/storage/read_connection.py +0 -115
- package/src/superlocalmemory/storage/retention_policy.py +0 -860
- package/src/superlocalmemory/storage/schema.py +0 -1108
- package/src/superlocalmemory/storage/schema_code_graph.py +0 -282
- package/src/superlocalmemory/storage/schema_v32.py +0 -382
- package/src/superlocalmemory/storage/schema_v3410.py +0 -159
- package/src/superlocalmemory/storage/schema_v3411.py +0 -149
- package/src/superlocalmemory/storage/schema_v343.py +0 -315
- package/src/superlocalmemory/storage/schema_v345.py +0 -109
- package/src/superlocalmemory/storage/schema_v347.py +0 -140
- package/src/superlocalmemory/storage/sqlite_vectors.py +0 -169
- package/src/superlocalmemory/storage/v2_migrator.py +0 -466
- package/src/superlocalmemory/storage/write_coordinator.py +0 -949
- package/src/superlocalmemory/storage/write_lock.py +0 -88
- package/src/superlocalmemory/summaries/__init__.py +0 -37
- package/src/superlocalmemory/summaries/base.py +0 -267
- package/src/superlocalmemory/summaries/daily_reflection.py +0 -340
- package/src/superlocalmemory/summaries/non_answer.py +0 -223
- package/src/superlocalmemory/summaries/project_work_log.py +0 -440
- package/src/superlocalmemory/summaries/session_summary.py +0 -311
- package/src/superlocalmemory/trust/__init__.py +0 -0
- package/src/superlocalmemory/trust/gate.py +0 -171
- package/src/superlocalmemory/trust/provenance.py +0 -124
- package/src/superlocalmemory/trust/scorer.py +0 -413
- package/src/superlocalmemory/trust/signals.py +0 -153
- package/src/superlocalmemory/ui/assets/slm-icon-white.svg +0 -64
- package/src/superlocalmemory/ui/assets/slm-icon.svg +0 -36
- package/src/superlocalmemory/ui/css/brain.css +0 -409
- package/src/superlocalmemory/ui/css/design-system.css +0 -696
- package/src/superlocalmemory/ui/css/legacy-dashboard.css +0 -663
- package/src/superlocalmemory/ui/css/neural-glass.css +0 -1599
- package/src/superlocalmemory/ui/css/od-bridge.css +0 -158
- package/src/superlocalmemory/ui/favicon.svg +0 -36
- package/src/superlocalmemory/ui/index.html +0 -1638
- package/src/superlocalmemory/ui/js/agents.js +0 -192
- package/src/superlocalmemory/ui/js/auto-settings.js +0 -624
- package/src/superlocalmemory/ui/js/brain.js +0 -1400
- package/src/superlocalmemory/ui/js/clusters.js +0 -326
- package/src/superlocalmemory/ui/js/compliance.js +0 -307
- package/src/superlocalmemory/ui/js/core.js +0 -566
- package/src/superlocalmemory/ui/js/dashboard.js +0 -503
- package/src/superlocalmemory/ui/js/event-delegation.js +0 -113
- package/src/superlocalmemory/ui/js/events.js +0 -178
- package/src/superlocalmemory/ui/js/fact-detail.js +0 -142
- package/src/superlocalmemory/ui/js/feedback.js +0 -339
- package/src/superlocalmemory/ui/js/graph-event-bus.js +0 -83
- package/src/superlocalmemory/ui/js/graph-filters.js +0 -220
- package/src/superlocalmemory/ui/js/graph-ui.js +0 -214
- package/src/superlocalmemory/ui/js/ide-status.js +0 -115
- package/src/superlocalmemory/ui/js/init.js +0 -54
- package/src/superlocalmemory/ui/js/knowledge-graph.js +0 -945
- package/src/superlocalmemory/ui/js/lifecycle.js +0 -387
- package/src/superlocalmemory/ui/js/math-health.js +0 -114
- package/src/superlocalmemory/ui/js/memories.js +0 -394
- package/src/superlocalmemory/ui/js/memory-chat.js +0 -371
- package/src/superlocalmemory/ui/js/memory-timeline.js +0 -265
- package/src/superlocalmemory/ui/js/modal.js +0 -733
- package/src/superlocalmemory/ui/js/ng-entities.js +0 -298
- package/src/superlocalmemory/ui/js/ng-health.js +0 -208
- package/src/superlocalmemory/ui/js/ng-ingestion.js +0 -203
- package/src/superlocalmemory/ui/js/ng-mesh.js +0 -374
- package/src/superlocalmemory/ui/js/ng-shell.js +0 -524
- package/src/superlocalmemory/ui/js/ng-skills.js +0 -663
- package/src/superlocalmemory/ui/js/od-agents.js +0 -588
- package/src/superlocalmemory/ui/js/od-auth-gate.js +0 -257
- package/src/superlocalmemory/ui/js/od-backup.js +0 -878
- package/src/superlocalmemory/ui/js/od-boundedloops.js +0 -324
- package/src/superlocalmemory/ui/js/od-brain.js +0 -1095
- package/src/superlocalmemory/ui/js/od-compliance-ext.js +0 -301
- package/src/superlocalmemory/ui/js/od-components.js +0 -147
- package/src/superlocalmemory/ui/js/od-entities.js +0 -622
- package/src/superlocalmemory/ui/js/od-graph.js +0 -776
- package/src/superlocalmemory/ui/js/od-health.js +0 -579
- package/src/superlocalmemory/ui/js/od-mcp.js +0 -508
- package/src/superlocalmemory/ui/js/od-memories.js +0 -1499
- package/src/superlocalmemory/ui/js/od-mesh.js +0 -645
- package/src/superlocalmemory/ui/js/od-operations.js +0 -1268
- package/src/superlocalmemory/ui/js/od-ops-health.js +0 -417
- package/src/superlocalmemory/ui/js/od-optimize.js +0 -828
- package/src/superlocalmemory/ui/js/od-settings.js +0 -1275
- package/src/superlocalmemory/ui/js/od-shell.js +0 -819
- package/src/superlocalmemory/ui/js/od-skills.js +0 -600
- package/src/superlocalmemory/ui/js/od-team.js +0 -265
- package/src/superlocalmemory/ui/js/optimize.js +0 -191
- package/src/superlocalmemory/ui/js/profiles.js +0 -362
- package/src/superlocalmemory/ui/js/quick-actions.js +0 -334
- package/src/superlocalmemory/ui/js/recall-lab.js +0 -373
- package/src/superlocalmemory/ui/js/search.js +0 -86
- package/src/superlocalmemory/ui/js/settings.js +0 -556
- package/src/superlocalmemory/ui/js/timeline.js +0 -62
- package/src/superlocalmemory/ui/js/trust-dashboard.js +0 -225
- package/src/superlocalmemory/ui/vendor/bootstrap-icons/bootstrap-icons.css +0 -2018
- package/src/superlocalmemory/ui/vendor/bootstrap-icons/fonts/bootstrap-icons.woff +0 -0
- package/src/superlocalmemory/ui/vendor/bootstrap-icons/fonts/bootstrap-icons.woff2 +0 -0
- package/src/superlocalmemory/ui/vendor/bootstrap.bundle.min.js +0 -7
- package/src/superlocalmemory/ui/vendor/bootstrap.min.css +0 -6
- package/src/superlocalmemory/ui/vendor/d3.v7.min.js +0 -2
- package/src/superlocalmemory/ui/vendor/graphology-library.min.js +0 -2
- package/src/superlocalmemory/ui/vendor/graphology.umd.min.js +0 -2
- package/src/superlocalmemory/ui/vendor/inter-ui/inter-variable.min.css +0 -8
- package/src/superlocalmemory/ui/vendor/inter-ui/variable/InterVariable-Italic.woff2 +0 -0
- package/src/superlocalmemory/ui/vendor/inter-ui/variable/InterVariable.woff2 +0 -0
- package/src/superlocalmemory/ui/vendor/sigma.min.js +0 -1
- package/src/superlocalmemory/vector/__init__.py +0 -9
- package/src/superlocalmemory/vector/lancedb_backend.py +0 -366
|
@@ -1,733 +0,0 @@
|
|
|
1
|
-
// SuperLocalMemory V2 - Memory Detail Modal + Copy/Export
|
|
2
|
-
// Depends on: core.js
|
|
3
|
-
//
|
|
4
|
-
// Security: All dynamic values escaped via escapeHtml(). Data from local DB only.
|
|
5
|
-
// nosemgrep: innerHTML-xss — all dynamic values escaped
|
|
6
|
-
|
|
7
|
-
var currentMemoryDetail = null;
|
|
8
|
-
|
|
9
|
-
function openMemoryDetail(mem, source) {
|
|
10
|
-
// source: 'graph', 'recall', 'memories', or undefined
|
|
11
|
-
currentMemoryDetail = mem;
|
|
12
|
-
var fromGraph = source === 'graph';
|
|
13
|
-
var fromRecall = source === 'recall';
|
|
14
|
-
var body = document.getElementById('memory-detail-body');
|
|
15
|
-
if (!mem) {
|
|
16
|
-
body.textContent = 'No memory data';
|
|
17
|
-
return;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
// Store last focused element (for keyboard nav return)
|
|
21
|
-
if (!window.lastFocusedElement) {
|
|
22
|
-
window.lastFocusedElement = document.activeElement;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
var content = mem.content || mem.summary || '(no content)';
|
|
26
|
-
var tags = mem.tags || '';
|
|
27
|
-
var importance = mem.importance || 5;
|
|
28
|
-
var importanceClass = importance >= 8 ? 'success' : importance >= 5 ? 'warning' : 'secondary';
|
|
29
|
-
|
|
30
|
-
// Build detail using DOM nodes for safety
|
|
31
|
-
body.textContent = '';
|
|
32
|
-
|
|
33
|
-
var contentDiv = document.createElement('div');
|
|
34
|
-
contentDiv.className = 'memory-detail-content';
|
|
35
|
-
contentDiv.textContent = content;
|
|
36
|
-
body.appendChild(contentDiv);
|
|
37
|
-
|
|
38
|
-
body.appendChild(document.createElement('hr'));
|
|
39
|
-
|
|
40
|
-
var dl = document.createElement('dl');
|
|
41
|
-
dl.className = 'memory-detail-meta row';
|
|
42
|
-
|
|
43
|
-
// v3.4.31: disambiguate Fact ID (the atomic unit) from Memory ID (the parent).
|
|
44
|
-
var factId = mem.fact_id || mem.id || '';
|
|
45
|
-
var memoryId = mem.memory_id || mem.id || '';
|
|
46
|
-
|
|
47
|
-
// Left column
|
|
48
|
-
var col1 = document.createElement('div');
|
|
49
|
-
col1.className = 'col-md-6';
|
|
50
|
-
addDetailRow(col1, 'Memory ID', String(memoryId || '-'));
|
|
51
|
-
if (factId && factId !== memoryId) {
|
|
52
|
-
addDetailRow(col1, 'Fact ID', String(factId));
|
|
53
|
-
}
|
|
54
|
-
addDetailBadgeRow(col1, 'Category', mem.category || mem.fact_type || 'None', 'bg-primary');
|
|
55
|
-
addDetailRow(col1, 'Project', mem.project_name || '-');
|
|
56
|
-
addDetailTagsRow(col1, 'Tags', tags);
|
|
57
|
-
dl.appendChild(col1);
|
|
58
|
-
|
|
59
|
-
// Right column
|
|
60
|
-
var col2 = document.createElement('div');
|
|
61
|
-
col2.className = 'col-md-6';
|
|
62
|
-
addDetailBadgeRow(col2, 'Importance', importance + '/10', 'bg-' + importanceClass);
|
|
63
|
-
addDetailRow(col2, 'Cluster', String(mem.cluster_id || '-'));
|
|
64
|
-
addDetailRow(col2, 'Created', formatDateFull(mem.created_at));
|
|
65
|
-
if (mem.updated_at) addDetailRow(col2, 'Updated', formatDateFull(mem.updated_at));
|
|
66
|
-
|
|
67
|
-
if (typeof mem.score === 'number') {
|
|
68
|
-
var pct = Math.round(mem.score * 100);
|
|
69
|
-
addDetailRow(col2, 'Relevance Score', pct + '%');
|
|
70
|
-
}
|
|
71
|
-
dl.appendChild(col2);
|
|
72
|
-
|
|
73
|
-
body.appendChild(dl);
|
|
74
|
-
|
|
75
|
-
// v3.4.31: hydrate with full memory + fact list from /api/memories/{id}/detail
|
|
76
|
-
if (memoryId) {
|
|
77
|
-
fetch('/api/memories/' + encodeURIComponent(memoryId) + '/detail')
|
|
78
|
-
.then(function(r) { return r.ok ? r.json() : null; })
|
|
79
|
-
.then(function(data) {
|
|
80
|
-
if (!data || !data.memory) return;
|
|
81
|
-
var hydration = document.getElementById('memory-detail-hydration');
|
|
82
|
-
if (hydration) hydration.remove();
|
|
83
|
-
var block = document.createElement('div');
|
|
84
|
-
block.id = 'memory-detail-hydration';
|
|
85
|
-
block.className = 'mt-3';
|
|
86
|
-
var h = document.createElement('h6');
|
|
87
|
-
h.innerHTML = '<i class="bi bi-diagram-3"></i> Atomic facts extracted from this memory (' + (data.fact_count || 0) + ')';
|
|
88
|
-
block.appendChild(h);
|
|
89
|
-
var list = document.createElement('div');
|
|
90
|
-
list.className = 'list-group list-group-flush';
|
|
91
|
-
(data.facts || []).forEach(function(f) {
|
|
92
|
-
var row = document.createElement('div');
|
|
93
|
-
row.className = 'list-group-item list-group-item-action small fact-result-item';
|
|
94
|
-
row.setAttribute('data-fact-id', f.fact_id);
|
|
95
|
-
row.style.cursor = 'pointer';
|
|
96
|
-
var badge = '<span class="badge bg-secondary me-2">' + (f.fact_type || '-') + '</span>';
|
|
97
|
-
var confText = ' · confidence ' + (f.confidence || 0).toFixed(2);
|
|
98
|
-
row.innerHTML = badge + escapeHtml(String(f.content || '')) + '<small class="text-muted">' + escapeHtml(confText) + '</small>';
|
|
99
|
-
list.appendChild(row);
|
|
100
|
-
});
|
|
101
|
-
block.appendChild(list);
|
|
102
|
-
body.appendChild(block);
|
|
103
|
-
})
|
|
104
|
-
.catch(function(err) { console.warn('Hydration error:', err); });
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
// Context-aware action buttons
|
|
108
|
-
if (mem.id) {
|
|
109
|
-
body.appendChild(document.createElement('hr'));
|
|
110
|
-
|
|
111
|
-
var actionsDiv = document.createElement('div');
|
|
112
|
-
actionsDiv.className = 'memory-detail-graph-actions';
|
|
113
|
-
actionsDiv.style.cssText = 'display:flex; gap:10px; flex-wrap:wrap;';
|
|
114
|
-
|
|
115
|
-
// "View Original Memory" — shown on Recall Lab + Memories, hidden on Graph
|
|
116
|
-
// (On Graph the node IS the memory; on Recall Lab we have a fact, not the original)
|
|
117
|
-
if (!fromGraph) {
|
|
118
|
-
var viewBtn = document.createElement('button');
|
|
119
|
-
viewBtn.className = 'btn btn-primary btn-sm';
|
|
120
|
-
viewBtn.innerHTML = '<i class="bi bi-journal-text"></i> View Original Memory';
|
|
121
|
-
viewBtn.onclick = function() {
|
|
122
|
-
var mid = mem.memory_id || mem.id;
|
|
123
|
-
viewBtn.disabled = true;
|
|
124
|
-
viewBtn.textContent = 'Loading...';
|
|
125
|
-
fetch('/api/memories/' + encodeURIComponent(mid) + '/facts')
|
|
126
|
-
.then(function(r) { return r.json(); })
|
|
127
|
-
.then(function(data) {
|
|
128
|
-
if (data.ok && data.original_content) {
|
|
129
|
-
contentDiv.textContent = '';
|
|
130
|
-
var origLabel = document.createElement('small');
|
|
131
|
-
origLabel.className = 'text-muted d-block mb-1';
|
|
132
|
-
origLabel.textContent = 'Original memory (' + (data.fact_count || 0) + ' atomic facts extracted):';
|
|
133
|
-
contentDiv.appendChild(origLabel);
|
|
134
|
-
var origText = document.createElement('div');
|
|
135
|
-
origText.style.cssText = 'white-space:pre-wrap;background:#f8f9fa;padding:10px;border-radius:6px;margin-bottom:8px;';
|
|
136
|
-
origText.textContent = data.original_content;
|
|
137
|
-
contentDiv.appendChild(origText);
|
|
138
|
-
if (data.facts && data.facts.length > 0) {
|
|
139
|
-
var toggle = document.createElement('button');
|
|
140
|
-
toggle.className = 'btn btn-sm btn-outline-secondary mb-2';
|
|
141
|
-
toggle.textContent = 'Show atomic facts (' + data.facts.length + ')';
|
|
142
|
-
var factsDiv = document.createElement('div');
|
|
143
|
-
factsDiv.style.display = 'none';
|
|
144
|
-
data.facts.forEach(function(f) {
|
|
145
|
-
var fDiv = document.createElement('div');
|
|
146
|
-
fDiv.className = 'small py-1 border-bottom';
|
|
147
|
-
var badge = document.createElement('span');
|
|
148
|
-
badge.className = 'badge bg-secondary me-1';
|
|
149
|
-
badge.style.fontSize = '0.6rem';
|
|
150
|
-
badge.textContent = f.fact_type;
|
|
151
|
-
fDiv.appendChild(badge);
|
|
152
|
-
fDiv.appendChild(document.createTextNode(f.content));
|
|
153
|
-
factsDiv.appendChild(fDiv);
|
|
154
|
-
});
|
|
155
|
-
toggle.onclick = function() {
|
|
156
|
-
var hidden = factsDiv.style.display === 'none';
|
|
157
|
-
factsDiv.style.display = hidden ? 'block' : 'none';
|
|
158
|
-
toggle.textContent = hidden ? 'Hide atomic facts' : 'Show atomic facts (' + data.facts.length + ')';
|
|
159
|
-
};
|
|
160
|
-
contentDiv.appendChild(toggle);
|
|
161
|
-
contentDiv.appendChild(factsDiv);
|
|
162
|
-
}
|
|
163
|
-
viewBtn.textContent = 'Showing original';
|
|
164
|
-
} else {
|
|
165
|
-
viewBtn.textContent = 'Not available';
|
|
166
|
-
}
|
|
167
|
-
}).catch(function() {
|
|
168
|
-
viewBtn.textContent = 'Failed to load';
|
|
169
|
-
viewBtn.disabled = false;
|
|
170
|
-
});
|
|
171
|
-
};
|
|
172
|
-
actionsDiv.appendChild(viewBtn);
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
// "Expand Neighbors" — shown on Graph, hidden elsewhere (no graph context)
|
|
176
|
-
if (fromGraph) {
|
|
177
|
-
var expandBtn = document.createElement('button');
|
|
178
|
-
expandBtn.className = 'btn btn-outline-secondary btn-sm';
|
|
179
|
-
expandBtn.innerHTML = '<i class="bi bi-diagram-3"></i> Expand Neighbors';
|
|
180
|
-
expandBtn.onclick = function() {
|
|
181
|
-
modal.hide();
|
|
182
|
-
setTimeout(function() {
|
|
183
|
-
if (typeof expandNeighbors === 'function') expandNeighbors(mem.id);
|
|
184
|
-
}, 300);
|
|
185
|
-
};
|
|
186
|
-
actionsDiv.appendChild(expandBtn);
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
// "Filter to Cluster" — always available if cluster exists
|
|
190
|
-
if (mem.cluster_id) {
|
|
191
|
-
var filterBtn = document.createElement('button');
|
|
192
|
-
filterBtn.className = 'btn btn-outline-info btn-sm';
|
|
193
|
-
var filterIcon = document.createElement('i');
|
|
194
|
-
filterIcon.className = 'bi bi-funnel';
|
|
195
|
-
filterBtn.appendChild(filterIcon);
|
|
196
|
-
filterBtn.appendChild(document.createTextNode(' Filter to Cluster ' + mem.cluster_id));
|
|
197
|
-
filterBtn.onclick = function() {
|
|
198
|
-
modal.hide();
|
|
199
|
-
// Switch to Graph tab
|
|
200
|
-
const graphTab = document.querySelector('a[href="#graph"]');
|
|
201
|
-
if (graphTab) graphTab.click();
|
|
202
|
-
// Apply cluster filter after a delay
|
|
203
|
-
setTimeout(function() {
|
|
204
|
-
if (typeof filterState !== 'undefined' && typeof filterByCluster === 'function' && typeof renderGraph === 'function') {
|
|
205
|
-
filterState.cluster_id = mem.cluster_id;
|
|
206
|
-
const filtered = filterByCluster(originalGraphData, mem.cluster_id);
|
|
207
|
-
renderGraph(filtered);
|
|
208
|
-
// Update URL
|
|
209
|
-
const url = new URL(window.location);
|
|
210
|
-
url.searchParams.set('cluster_id', mem.cluster_id);
|
|
211
|
-
window.history.replaceState({}, '', url);
|
|
212
|
-
}
|
|
213
|
-
}, 500);
|
|
214
|
-
};
|
|
215
|
-
actionsDiv.appendChild(filterBtn);
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
// Edit button — always available
|
|
219
|
-
var editBtn = document.createElement('button');
|
|
220
|
-
editBtn.className = 'btn btn-outline-warning btn-sm';
|
|
221
|
-
editBtn.innerHTML = '<i class="bi bi-pencil"></i> Edit';
|
|
222
|
-
editBtn.onclick = function() {
|
|
223
|
-
var currentText = contentDiv.textContent;
|
|
224
|
-
var textarea = document.createElement('textarea');
|
|
225
|
-
textarea.className = 'form-control mb-2';
|
|
226
|
-
textarea.rows = 4;
|
|
227
|
-
textarea.value = currentText;
|
|
228
|
-
contentDiv.textContent = '';
|
|
229
|
-
contentDiv.appendChild(textarea);
|
|
230
|
-
var saveBtn = document.createElement('button');
|
|
231
|
-
saveBtn.className = 'btn btn-sm btn-success me-1';
|
|
232
|
-
saveBtn.textContent = 'Save';
|
|
233
|
-
saveBtn.onclick = function() {
|
|
234
|
-
var newContent = textarea.value.trim();
|
|
235
|
-
if (!newContent) return;
|
|
236
|
-
fetch('/api/memories/' + encodeURIComponent(mem.id), {
|
|
237
|
-
method: 'PATCH',
|
|
238
|
-
headers: {'Content-Type': 'application/json'},
|
|
239
|
-
body: JSON.stringify({content: newContent})
|
|
240
|
-
}).then(function(r) { return r.json(); }).then(function(d) {
|
|
241
|
-
if (d.success) {
|
|
242
|
-
contentDiv.textContent = newContent;
|
|
243
|
-
mem.content = newContent;
|
|
244
|
-
if (typeof showToast === 'function') showToast('Memory updated');
|
|
245
|
-
}
|
|
246
|
-
});
|
|
247
|
-
};
|
|
248
|
-
var cancelBtn = document.createElement('button');
|
|
249
|
-
cancelBtn.className = 'btn btn-sm btn-secondary';
|
|
250
|
-
cancelBtn.textContent = 'Cancel';
|
|
251
|
-
cancelBtn.onclick = function() { contentDiv.textContent = currentText; };
|
|
252
|
-
contentDiv.appendChild(saveBtn);
|
|
253
|
-
contentDiv.appendChild(cancelBtn);
|
|
254
|
-
};
|
|
255
|
-
actionsDiv.appendChild(editBtn);
|
|
256
|
-
|
|
257
|
-
// S9-DASH-08: Forget (soft-archive) — non-destructive; row stays
|
|
258
|
-
// in atomic_facts with archive_status='archived' and gets a
|
|
259
|
-
// payload copy in memory_archive for future restore.
|
|
260
|
-
var forgetBtn = document.createElement('button');
|
|
261
|
-
forgetBtn.className = 'btn btn-outline-warning btn-sm';
|
|
262
|
-
forgetBtn.innerHTML = '<i class="bi bi-archive"></i> Forget';
|
|
263
|
-
forgetBtn.title = 'Archive this memory — hidden from recall but recoverable';
|
|
264
|
-
forgetBtn.onclick = async function() {
|
|
265
|
-
var confirmed = await confirmDestructive({
|
|
266
|
-
title: 'Forget memory',
|
|
267
|
-
target: mem.content ? mem.content.slice(0, 80) : 'Memory #' + mem.id,
|
|
268
|
-
consequence: 'Archived — hidden from recall but recoverable.',
|
|
269
|
-
});
|
|
270
|
-
if (!confirmed) return;
|
|
271
|
-
forgetBtn.disabled = true;
|
|
272
|
-
fetch('/api/memories/' + encodeURIComponent(mem.id) + '/forget',
|
|
273
|
-
{method: 'POST'})
|
|
274
|
-
.then(function(r) { return r.json(); })
|
|
275
|
-
.then(function(d) {
|
|
276
|
-
if (d.success) {
|
|
277
|
-
modal.hide();
|
|
278
|
-
if (typeof showToast === 'function') {
|
|
279
|
-
showToast('Memory archived');
|
|
280
|
-
}
|
|
281
|
-
if (typeof loadMemories === 'function') {
|
|
282
|
-
setTimeout(loadMemories, 300);
|
|
283
|
-
}
|
|
284
|
-
} else {
|
|
285
|
-
forgetBtn.disabled = false;
|
|
286
|
-
}
|
|
287
|
-
}).catch(function() { forgetBtn.disabled = false; });
|
|
288
|
-
};
|
|
289
|
-
actionsDiv.appendChild(forgetBtn);
|
|
290
|
-
|
|
291
|
-
// S9-DASH-08: Merge — this fact is a duplicate of another;
|
|
292
|
-
// keep the target, archive this one. Writes memory_merge_log.
|
|
293
|
-
var mergeBtn = document.createElement('button');
|
|
294
|
-
mergeBtn.className = 'btn btn-outline-info btn-sm';
|
|
295
|
-
mergeBtn.innerHTML = '<i class="bi bi-union"></i> Merge into...';
|
|
296
|
-
mergeBtn.title = 'Mark this as a duplicate of another fact';
|
|
297
|
-
mergeBtn.onclick = function() {
|
|
298
|
-
var target = prompt(
|
|
299
|
-
'Merge this memory INTO which fact_id?\n\n'
|
|
300
|
-
+ '(Paste the target fact_id — this memory will be '
|
|
301
|
-
+ 'archived and audit-logged to memory_merge_log.)'
|
|
302
|
-
);
|
|
303
|
-
if (!target || !target.trim()) return;
|
|
304
|
-
mergeBtn.disabled = true;
|
|
305
|
-
fetch('/api/memories/' + encodeURIComponent(mem.id) + '/merge', {
|
|
306
|
-
method: 'POST',
|
|
307
|
-
headers: {'Content-Type': 'application/json'},
|
|
308
|
-
body: JSON.stringify({into: target.trim()}),
|
|
309
|
-
}).then(function(r) { return r.json(); })
|
|
310
|
-
.then(function(d) {
|
|
311
|
-
if (d.success) {
|
|
312
|
-
modal.hide();
|
|
313
|
-
if (typeof showToast === 'function') {
|
|
314
|
-
showToast('Merged into ' + d.into);
|
|
315
|
-
}
|
|
316
|
-
if (typeof loadMemories === 'function') {
|
|
317
|
-
setTimeout(loadMemories, 300);
|
|
318
|
-
}
|
|
319
|
-
} else {
|
|
320
|
-
mergeBtn.disabled = false;
|
|
321
|
-
if (typeof showToast === 'function') {
|
|
322
|
-
showToast('Merge failed: '
|
|
323
|
-
+ (d && (d.error || d.detail) || 'unknown'));
|
|
324
|
-
}
|
|
325
|
-
}
|
|
326
|
-
}).catch(function() { mergeBtn.disabled = false; });
|
|
327
|
-
};
|
|
328
|
-
actionsDiv.appendChild(mergeBtn);
|
|
329
|
-
|
|
330
|
-
// Task F: Set Scope — PATCH /api/memories/{fact_id}/scope
|
|
331
|
-
// Lets the user change personal → shared → global visibility.
|
|
332
|
-
var scopeBtn = document.createElement('button');
|
|
333
|
-
scopeBtn.className = 'btn btn-outline-secondary btn-sm';
|
|
334
|
-
scopeBtn.innerHTML = '<i class="bi bi-globe"></i> Set Scope…';
|
|
335
|
-
scopeBtn.title = 'Change memory visibility: personal, shared, or global';
|
|
336
|
-
(function() {
|
|
337
|
-
var scopeFormEl = null;
|
|
338
|
-
scopeBtn.addEventListener('click', function() {
|
|
339
|
-
// Toggle the inline scope form
|
|
340
|
-
if (scopeFormEl) {
|
|
341
|
-
scopeFormEl.remove();
|
|
342
|
-
scopeFormEl = null;
|
|
343
|
-
return;
|
|
344
|
-
}
|
|
345
|
-
scopeFormEl = document.createElement('div');
|
|
346
|
-
scopeFormEl.className = 'mt-2 p-2 border rounded';
|
|
347
|
-
scopeFormEl.style.cssText = 'display:flex;gap:8px;flex-wrap:wrap;align-items:center;width:100%';
|
|
348
|
-
var scopeSel = document.createElement('select');
|
|
349
|
-
scopeSel.className = 'form-select form-select-sm';
|
|
350
|
-
scopeSel.style.width = 'auto';
|
|
351
|
-
['personal', 'shared', 'global'].forEach(function(s) {
|
|
352
|
-
var opt = document.createElement('option');
|
|
353
|
-
opt.value = s;
|
|
354
|
-
opt.textContent = s;
|
|
355
|
-
if (s === (mem.scope || 'personal')) opt.selected = true;
|
|
356
|
-
scopeSel.appendChild(opt);
|
|
357
|
-
});
|
|
358
|
-
var sharedInput = document.createElement('input');
|
|
359
|
-
sharedInput.className = 'form-control form-control-sm';
|
|
360
|
-
sharedInput.placeholder = 'shared_with (profile1,profile2)';
|
|
361
|
-
sharedInput.style.flex = '1';
|
|
362
|
-
sharedInput.style.display = scopeSel.value === 'shared' ? '' : 'none';
|
|
363
|
-
if (mem.shared_with) {
|
|
364
|
-
try {
|
|
365
|
-
var sw = typeof mem.shared_with === 'string'
|
|
366
|
-
? JSON.parse(mem.shared_with) : mem.shared_with;
|
|
367
|
-
sharedInput.value = Array.isArray(sw) ? sw.join(',') : String(sw);
|
|
368
|
-
} catch(e) { sharedInput.value = String(mem.shared_with || ''); }
|
|
369
|
-
}
|
|
370
|
-
scopeSel.addEventListener('change', function() {
|
|
371
|
-
sharedInput.style.display = scopeSel.value === 'shared' ? '' : 'none';
|
|
372
|
-
});
|
|
373
|
-
var saveBtn = document.createElement('button');
|
|
374
|
-
saveBtn.className = 'btn btn-sm btn-primary';
|
|
375
|
-
saveBtn.textContent = 'Save';
|
|
376
|
-
saveBtn.addEventListener('click', function() {
|
|
377
|
-
var scope = scopeSel.value;
|
|
378
|
-
var sharedWith = scope === 'shared' ? sharedInput.value : '';
|
|
379
|
-
saveBtn.disabled = true;
|
|
380
|
-
saveBtn.textContent = 'Saving…';
|
|
381
|
-
fetch('/api/memories/' + encodeURIComponent(mem.fact_id || mem.id) + '/scope', {
|
|
382
|
-
method: 'PATCH',
|
|
383
|
-
headers: {'Content-Type': 'application/json'},
|
|
384
|
-
body: JSON.stringify({scope: scope, shared_with: sharedWith}),
|
|
385
|
-
}).then(function(r) { return r.json(); })
|
|
386
|
-
.then(function(d) {
|
|
387
|
-
if (d.success) {
|
|
388
|
-
mem.scope = scope;
|
|
389
|
-
if (typeof showToast === 'function') showToast('Scope set to ' + scope);
|
|
390
|
-
scopeFormEl.remove(); scopeFormEl = null;
|
|
391
|
-
if (typeof loadMemories === 'function') setTimeout(loadMemories, 300);
|
|
392
|
-
} else {
|
|
393
|
-
if (typeof showToast === 'function') showToast('Scope update failed: ' + (d.detail || d.error || 'unknown'));
|
|
394
|
-
saveBtn.disabled = false; saveBtn.textContent = 'Save';
|
|
395
|
-
}
|
|
396
|
-
}).catch(function() {
|
|
397
|
-
if (typeof showToast === 'function') showToast('Network error setting scope.');
|
|
398
|
-
saveBtn.disabled = false; saveBtn.textContent = 'Save';
|
|
399
|
-
});
|
|
400
|
-
});
|
|
401
|
-
scopeFormEl.appendChild(scopeSel);
|
|
402
|
-
scopeFormEl.appendChild(sharedInput);
|
|
403
|
-
scopeFormEl.appendChild(saveBtn);
|
|
404
|
-
actionsDiv.insertAdjacentElement('afterend', scopeFormEl);
|
|
405
|
-
});
|
|
406
|
-
}());
|
|
407
|
-
actionsDiv.appendChild(scopeBtn);
|
|
408
|
-
|
|
409
|
-
// Task G: Pin — POST /api/tiers/pin — keep this fact in the active tier forever
|
|
410
|
-
var factIdForTier = mem.fact_id || mem.id;
|
|
411
|
-
var pinBtn = document.createElement('button');
|
|
412
|
-
pinBtn.className = 'btn btn-outline-success btn-sm';
|
|
413
|
-
pinBtn.innerHTML = '<i class="bi bi-pin-fill"></i> Pin';
|
|
414
|
-
pinBtn.title = 'Pin to active tier — this fact will not be demoted by lifecycle';
|
|
415
|
-
pinBtn.addEventListener('click', function() {
|
|
416
|
-
pinBtn.disabled = true;
|
|
417
|
-
fetch('/api/tiers/pin', {
|
|
418
|
-
method: 'POST',
|
|
419
|
-
headers: {'Content-Type': 'application/json'},
|
|
420
|
-
body: JSON.stringify({fact_id: factIdForTier, reason: 'pinned from dashboard'}),
|
|
421
|
-
}).then(function(r) { return r.json(); })
|
|
422
|
-
.then(function(d) {
|
|
423
|
-
pinBtn.disabled = false;
|
|
424
|
-
if (typeof showToast === 'function') {
|
|
425
|
-
showToast(d && d.success ? 'Fact pinned to active tier.' : 'Pin failed: ' + (d && (d.detail || d.error) || 'unknown'));
|
|
426
|
-
}
|
|
427
|
-
}).catch(function() {
|
|
428
|
-
pinBtn.disabled = false;
|
|
429
|
-
if (typeof showToast === 'function') showToast('Network error pinning fact.');
|
|
430
|
-
});
|
|
431
|
-
});
|
|
432
|
-
actionsDiv.appendChild(pinBtn);
|
|
433
|
-
|
|
434
|
-
// Task G: Unpin — POST /api/tiers/unpin — allows normal tier demotion again
|
|
435
|
-
var unpinBtn = document.createElement('button');
|
|
436
|
-
unpinBtn.className = 'btn btn-outline-warning btn-sm';
|
|
437
|
-
unpinBtn.innerHTML = '<i class="bi bi-pin-angle"></i> Unpin';
|
|
438
|
-
unpinBtn.title = 'Unpin — allow normal lifecycle tier demotion';
|
|
439
|
-
unpinBtn.addEventListener('click', function() {
|
|
440
|
-
unpinBtn.disabled = true;
|
|
441
|
-
fetch('/api/tiers/unpin', {
|
|
442
|
-
method: 'POST',
|
|
443
|
-
headers: {'Content-Type': 'application/json'},
|
|
444
|
-
body: JSON.stringify({fact_id: factIdForTier, reason: ''}),
|
|
445
|
-
}).then(function(r) { return r.json(); })
|
|
446
|
-
.then(function(d) {
|
|
447
|
-
unpinBtn.disabled = false;
|
|
448
|
-
if (typeof showToast === 'function') {
|
|
449
|
-
showToast(d && d.success ? 'Fact unpinned — will age normally.' : 'Unpin failed: ' + (d && (d.detail || d.error) || 'unknown'));
|
|
450
|
-
}
|
|
451
|
-
}).catch(function() {
|
|
452
|
-
unpinBtn.disabled = false;
|
|
453
|
-
if (typeof showToast === 'function') showToast('Network error unpinning fact.');
|
|
454
|
-
});
|
|
455
|
-
});
|
|
456
|
-
actionsDiv.appendChild(unpinBtn);
|
|
457
|
-
|
|
458
|
-
// Delete button — always available (hard delete, irreversible)
|
|
459
|
-
var deleteBtn = document.createElement('button');
|
|
460
|
-
deleteBtn.className = 'btn btn-outline-danger btn-sm';
|
|
461
|
-
deleteBtn.innerHTML = '<i class="bi bi-trash"></i> Delete';
|
|
462
|
-
deleteBtn.title = 'Permanently delete (cannot be undone) — prefer Forget';
|
|
463
|
-
deleteBtn.onclick = async function() {
|
|
464
|
-
var confirmed = await confirmDestructive({
|
|
465
|
-
title: 'Delete memory',
|
|
466
|
-
target: mem.content ? mem.content.slice(0, 80) : 'Memory #' + mem.id,
|
|
467
|
-
consequence: 'Permanently deleted — this cannot be undone.',
|
|
468
|
-
confirmLabel: 'Delete',
|
|
469
|
-
});
|
|
470
|
-
if (!confirmed) return;
|
|
471
|
-
fetch('/api/memories/' + encodeURIComponent(mem.id), {method: 'DELETE'})
|
|
472
|
-
.then(function(r) { return r.json(); })
|
|
473
|
-
.then(function(d) {
|
|
474
|
-
if (d.success) {
|
|
475
|
-
modal.hide();
|
|
476
|
-
if (typeof showToast === 'function') showToast('Memory deleted');
|
|
477
|
-
if (typeof loadMemories === 'function') setTimeout(loadMemories, 300);
|
|
478
|
-
}
|
|
479
|
-
});
|
|
480
|
-
};
|
|
481
|
-
actionsDiv.appendChild(deleteBtn);
|
|
482
|
-
|
|
483
|
-
body.appendChild(actionsDiv);
|
|
484
|
-
}
|
|
485
|
-
|
|
486
|
-
// v2.7.4: Add feedback buttons to modal body
|
|
487
|
-
if (typeof createFeedbackButtons === 'function' && mem && mem.id) {
|
|
488
|
-
var feedbackDiv = document.createElement('div');
|
|
489
|
-
feedbackDiv.className = 'mt-3 pt-2 border-top';
|
|
490
|
-
var feedbackLabel = document.createElement('small');
|
|
491
|
-
feedbackLabel.className = 'text-muted d-block mb-1';
|
|
492
|
-
feedbackLabel.textContent = 'Was this memory useful?';
|
|
493
|
-
feedbackDiv.appendChild(feedbackLabel);
|
|
494
|
-
feedbackDiv.appendChild(createFeedbackButtons(mem.id));
|
|
495
|
-
body.appendChild(feedbackDiv);
|
|
496
|
-
}
|
|
497
|
-
|
|
498
|
-
var modalEl = document.getElementById('memoryDetailModal');
|
|
499
|
-
var modal = new bootstrap.Modal(modalEl);
|
|
500
|
-
|
|
501
|
-
// v2.7.4: Start dwell time tracking
|
|
502
|
-
if (typeof startDwellTracking === 'function' && mem && mem.id) {
|
|
503
|
-
startDwellTracking(mem.id);
|
|
504
|
-
}
|
|
505
|
-
|
|
506
|
-
// Focus first interactive element when modal opens
|
|
507
|
-
modalEl.addEventListener('shown.bs.modal', function() {
|
|
508
|
-
const firstButton = modalEl.querySelector('button, a[href]');
|
|
509
|
-
if (firstButton) {
|
|
510
|
-
firstButton.focus();
|
|
511
|
-
}
|
|
512
|
-
}, { once: true });
|
|
513
|
-
|
|
514
|
-
// Return focus when modal closes + stop dwell tracking
|
|
515
|
-
modalEl.addEventListener('hidden.bs.modal', function() {
|
|
516
|
-
// v2.7.4: Stop dwell time tracking
|
|
517
|
-
if (typeof stopDwellTracking === 'function') {
|
|
518
|
-
stopDwellTracking();
|
|
519
|
-
}
|
|
520
|
-
if (window.lastFocusedElement && typeof window.lastFocusedElement.focus === 'function') {
|
|
521
|
-
window.lastFocusedElement.focus();
|
|
522
|
-
window.lastFocusedElement = null;
|
|
523
|
-
}
|
|
524
|
-
}, { once: true });
|
|
525
|
-
|
|
526
|
-
modal.show();
|
|
527
|
-
}
|
|
528
|
-
|
|
529
|
-
function addDetailRow(parent, label, value) {
|
|
530
|
-
var dt = document.createElement('dt');
|
|
531
|
-
dt.textContent = label;
|
|
532
|
-
parent.appendChild(dt);
|
|
533
|
-
var dd = document.createElement('dd');
|
|
534
|
-
dd.textContent = value;
|
|
535
|
-
parent.appendChild(dd);
|
|
536
|
-
}
|
|
537
|
-
|
|
538
|
-
function addDetailBadgeRow(parent, label, value, badgeClass) {
|
|
539
|
-
var dt = document.createElement('dt');
|
|
540
|
-
dt.textContent = label;
|
|
541
|
-
parent.appendChild(dt);
|
|
542
|
-
var dd = document.createElement('dd');
|
|
543
|
-
var badge = document.createElement('span');
|
|
544
|
-
badge.className = 'badge ' + badgeClass;
|
|
545
|
-
badge.textContent = value;
|
|
546
|
-
dd.appendChild(badge);
|
|
547
|
-
parent.appendChild(dd);
|
|
548
|
-
}
|
|
549
|
-
|
|
550
|
-
function addDetailTagsRow(parent, label, tags) {
|
|
551
|
-
var dt = document.createElement('dt');
|
|
552
|
-
dt.textContent = label;
|
|
553
|
-
parent.appendChild(dt);
|
|
554
|
-
var dd = document.createElement('dd');
|
|
555
|
-
var tagList = typeof tags === 'string' ? tags.split(',') : (tags || []);
|
|
556
|
-
if (tagList.length === 0 || (tagList.length === 1 && !tagList[0].trim())) {
|
|
557
|
-
dd.className = 'text-muted';
|
|
558
|
-
dd.textContent = 'None';
|
|
559
|
-
} else {
|
|
560
|
-
tagList.forEach(function(t) {
|
|
561
|
-
var tag = t.trim();
|
|
562
|
-
if (tag) {
|
|
563
|
-
var badge = document.createElement('span');
|
|
564
|
-
badge.className = 'badge bg-secondary me-1';
|
|
565
|
-
badge.textContent = tag;
|
|
566
|
-
dd.appendChild(badge);
|
|
567
|
-
}
|
|
568
|
-
});
|
|
569
|
-
}
|
|
570
|
-
parent.appendChild(dd);
|
|
571
|
-
}
|
|
572
|
-
|
|
573
|
-
/**
|
|
574
|
-
* Show a shared confirmation modal for destructive dashboard actions.
|
|
575
|
-
* Creates the modal element on first call; reuses it on subsequent calls.
|
|
576
|
-
*
|
|
577
|
-
* @param {object} opts
|
|
578
|
-
* @param {string} opts.title Short header, e.g. "Delete profile"
|
|
579
|
-
* @param {string} opts.target Exact item being acted on, e.g. "my-project"
|
|
580
|
-
* @param {string} opts.consequence What happens, e.g. "Memories moved to default profile"
|
|
581
|
-
* @param {string} [opts.confirmLabel] Confirm button text (default: "Confirm")
|
|
582
|
-
* @param {string} [opts.confirmationText] Exact text required to unlock confirmation
|
|
583
|
-
* @returns {Promise<boolean>} Resolves true when confirmed, false when cancelled
|
|
584
|
-
*/
|
|
585
|
-
var activeDestructiveConfirmation = null;
|
|
586
|
-
|
|
587
|
-
function confirmDestructive(opts) {
|
|
588
|
-
return new Promise(function(resolve) {
|
|
589
|
-
if (activeDestructiveConfirmation) {
|
|
590
|
-
activeDestructiveConfirmation.cancel();
|
|
591
|
-
}
|
|
592
|
-
var settled = false;
|
|
593
|
-
var MODAL_ID = 'slm-confirm-destructive-modal';
|
|
594
|
-
var modalEl = document.getElementById(MODAL_ID);
|
|
595
|
-
|
|
596
|
-
if (!modalEl) {
|
|
597
|
-
modalEl = document.createElement('div');
|
|
598
|
-
modalEl.id = MODAL_ID;
|
|
599
|
-
modalEl.className = 'modal fade';
|
|
600
|
-
modalEl.setAttribute('tabindex', '-1');
|
|
601
|
-
modalEl.setAttribute('aria-modal', 'true');
|
|
602
|
-
modalEl.setAttribute('role', 'dialog');
|
|
603
|
-
modalEl.innerHTML =
|
|
604
|
-
'<div class="modal-dialog modal-dialog-centered">' +
|
|
605
|
-
'<div class="modal-content">' +
|
|
606
|
-
'<div class="modal-header border-0 pb-1">' +
|
|
607
|
-
'<h5 class="modal-title slm-cd-title text-danger"></h5>' +
|
|
608
|
-
'<button type="button" class="btn-close"' +
|
|
609
|
-
' data-slm-cd-action="cancel" aria-label="Close"></button>' +
|
|
610
|
-
'</div>' +
|
|
611
|
-
'<div class="modal-body pt-1">' +
|
|
612
|
-
'<p class="slm-cd-target fw-semibold mb-1"></p>' +
|
|
613
|
-
'<p class="slm-cd-consequence text-muted small mb-2"></p>' +
|
|
614
|
-
'<label class="form-label small mb-1" for="slm-cd-challenge">' +
|
|
615
|
-
'Type <code class="slm-cd-confirmation-text"></code> to continue</label>' +
|
|
616
|
-
'<input id="slm-cd-challenge" class="form-control form-control-sm slm-cd-challenge"' +
|
|
617
|
-
' type="text" autocomplete="off" spellcheck="false">' +
|
|
618
|
-
'</div>' +
|
|
619
|
-
'<div class="modal-footer border-0 pt-0">' +
|
|
620
|
-
'<button type="button" class="btn btn-secondary btn-sm"' +
|
|
621
|
-
' data-slm-cd-action="cancel">Cancel</button>' +
|
|
622
|
-
'<button type="button" class="btn btn-danger btn-sm"' +
|
|
623
|
-
' data-slm-cd-action="confirm">Confirm</button>' +
|
|
624
|
-
'</div>' +
|
|
625
|
-
'</div>' +
|
|
626
|
-
'</div>';
|
|
627
|
-
document.body.appendChild(modalEl);
|
|
628
|
-
}
|
|
629
|
-
|
|
630
|
-
var titleEl = modalEl.querySelector('.slm-cd-title');
|
|
631
|
-
var targetEl = modalEl.querySelector('.slm-cd-target');
|
|
632
|
-
var consequenceEl = modalEl.querySelector('.slm-cd-consequence');
|
|
633
|
-
var confirmationTextEl = modalEl.querySelector('.slm-cd-confirmation-text');
|
|
634
|
-
var challengeInput = modalEl.querySelector('.slm-cd-challenge');
|
|
635
|
-
var confirmBtn = modalEl.querySelector('[data-slm-cd-action="confirm"]');
|
|
636
|
-
var confirmationText = opts.confirmationText || opts.target || 'CONFIRM';
|
|
637
|
-
|
|
638
|
-
if (titleEl) titleEl.textContent = opts.title || 'Confirm action';
|
|
639
|
-
if (targetEl) targetEl.textContent = opts.target || '';
|
|
640
|
-
if (consequenceEl) consequenceEl.textContent = opts.consequence || '';
|
|
641
|
-
if (confirmationTextEl) confirmationTextEl.textContent = confirmationText;
|
|
642
|
-
if (challengeInput) challengeInput.value = '';
|
|
643
|
-
if (confirmBtn) {
|
|
644
|
-
confirmBtn.textContent = opts.confirmLabel || 'Confirm';
|
|
645
|
-
confirmBtn.disabled = true;
|
|
646
|
-
}
|
|
647
|
-
|
|
648
|
-
var bsModal = null;
|
|
649
|
-
if (typeof bootstrap !== 'undefined' && bootstrap.Modal) {
|
|
650
|
-
bsModal = bootstrap.Modal.getOrCreateInstance(modalEl);
|
|
651
|
-
}
|
|
652
|
-
|
|
653
|
-
function settle(result, hideModal) {
|
|
654
|
-
if (settled) return;
|
|
655
|
-
settled = true;
|
|
656
|
-
if (activeDestructiveConfirmation === confirmationSession) {
|
|
657
|
-
activeDestructiveConfirmation = null;
|
|
658
|
-
}
|
|
659
|
-
modalEl.removeEventListener('click', onAction);
|
|
660
|
-
if (challengeInput) challengeInput.removeEventListener('input', onChallengeInput);
|
|
661
|
-
if (bsModal) {
|
|
662
|
-
modalEl.removeEventListener('hidden.bs.modal', onHide);
|
|
663
|
-
modalEl.removeEventListener('shown.bs.modal', onShown);
|
|
664
|
-
if (hideModal !== false) bsModal.hide();
|
|
665
|
-
}
|
|
666
|
-
resolve(result);
|
|
667
|
-
}
|
|
668
|
-
|
|
669
|
-
function onAction(e) {
|
|
670
|
-
var actionEl = e.target.closest('[data-slm-cd-action]');
|
|
671
|
-
if (!actionEl) return;
|
|
672
|
-
if (actionEl.getAttribute('data-slm-cd-action') === 'confirm' &&
|
|
673
|
-
(!challengeInput || challengeInput.value !== confirmationText)) return;
|
|
674
|
-
settle(actionEl.getAttribute('data-slm-cd-action') === 'confirm');
|
|
675
|
-
}
|
|
676
|
-
|
|
677
|
-
function onChallengeInput() {
|
|
678
|
-
if (confirmBtn) confirmBtn.disabled = challengeInput.value !== confirmationText;
|
|
679
|
-
}
|
|
680
|
-
|
|
681
|
-
function onShown() {
|
|
682
|
-
if (challengeInput) challengeInput.focus();
|
|
683
|
-
}
|
|
684
|
-
|
|
685
|
-
function onHide() { settle(false); }
|
|
686
|
-
|
|
687
|
-
var confirmationSession = {
|
|
688
|
-
cancel: function() { settle(false, false); }
|
|
689
|
-
};
|
|
690
|
-
activeDestructiveConfirmation = confirmationSession;
|
|
691
|
-
|
|
692
|
-
modalEl.addEventListener('click', onAction);
|
|
693
|
-
if (challengeInput) challengeInput.addEventListener('input', onChallengeInput);
|
|
694
|
-
if (bsModal) {
|
|
695
|
-
modalEl.addEventListener('hidden.bs.modal', onHide, { once: true });
|
|
696
|
-
modalEl.addEventListener('shown.bs.modal', onShown, { once: true });
|
|
697
|
-
bsModal.show();
|
|
698
|
-
}
|
|
699
|
-
});
|
|
700
|
-
}
|
|
701
|
-
|
|
702
|
-
function copyMemoryToClipboard() {
|
|
703
|
-
if (!currentMemoryDetail) return;
|
|
704
|
-
var text = currentMemoryDetail.content || currentMemoryDetail.summary || '';
|
|
705
|
-
navigator.clipboard.writeText(text).then(function() {
|
|
706
|
-
showToast('Copied to clipboard');
|
|
707
|
-
}).catch(function() {
|
|
708
|
-
var ta = document.createElement('textarea');
|
|
709
|
-
ta.value = text;
|
|
710
|
-
document.body.appendChild(ta);
|
|
711
|
-
ta.select();
|
|
712
|
-
document.execCommand('copy');
|
|
713
|
-
document.body.removeChild(ta);
|
|
714
|
-
showToast('Copied to clipboard');
|
|
715
|
-
});
|
|
716
|
-
}
|
|
717
|
-
|
|
718
|
-
function exportMemoryAsMarkdown() {
|
|
719
|
-
if (!currentMemoryDetail) return;
|
|
720
|
-
var mem = currentMemoryDetail;
|
|
721
|
-
var md = '# Memory #' + (mem.id || 'unknown') + '\n\n';
|
|
722
|
-
md += '**Category:** ' + (mem.category || 'None') + ' \n';
|
|
723
|
-
md += '**Project:** ' + (mem.project_name || '-') + ' \n';
|
|
724
|
-
md += '**Importance:** ' + (mem.importance || 5) + '/10 \n';
|
|
725
|
-
md += '**Tags:** ' + (mem.tags || 'None') + ' \n';
|
|
726
|
-
md += '**Created:** ' + (mem.created_at || '-') + ' \n';
|
|
727
|
-
if (mem.cluster_id) md += '**Cluster:** ' + mem.cluster_id + ' \n';
|
|
728
|
-
md += '\n---\n\n';
|
|
729
|
-
md += mem.content || mem.summary || '(no content)';
|
|
730
|
-
md += '\n\n---\n*Exported from SuperLocalMemory V2*\n';
|
|
731
|
-
|
|
732
|
-
downloadFile('memory-' + (mem.id || 'export') + '.md', md, 'text/markdown');
|
|
733
|
-
}
|