abtars 0.1.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +190 -0
- package/README.md +84 -0
- package/bundle/_registry.generated-M4WY2MMI.js +35 -0
- package/bundle/_registry.generated-M4WY2MMI.js.map +7 -0
- package/bundle/abtars-browser.js +162 -0
- package/bundle/abtars-browser.js.map +7 -0
- package/bundle/abtars-cli.js +1438 -0
- package/bundle/abtars-cli.js.map +7 -0
- package/bundle/abtars-restart.js +12 -0
- package/bundle/abtars-restart.js.map +7 -0
- package/bundle/abtars-rss.js +165 -0
- package/bundle/abtars-rss.js.map +7 -0
- package/bundle/abtars-task.js +258 -0
- package/bundle/abtars-task.js.map +7 -0
- package/bundle/abtars.js +4072 -0
- package/bundle/abtars.js.map +7 -0
- package/bundle/agent-api-rate-limit-OQNFMXTZ.js +38 -0
- package/bundle/agent-api-rate-limit-OQNFMXTZ.js.map +7 -0
- package/bundle/agent-registry-LT4JNQH6.js +18 -0
- package/bundle/agent-registry-LT4JNQH6.js.map +7 -0
- package/bundle/agents/default.md +29 -0
- package/bundle/anthropic-adapter-2APTH3LA.js +40 -0
- package/bundle/anthropic-adapter-2APTH3LA.js.map +7 -0
- package/bundle/bridge-lock-transport-4AC2G5G6.js +39 -0
- package/bundle/bridge-lock-transport-4AC2G5G6.js.map +7 -0
- package/bundle/browse-delivery-JXBY36GK.js +17 -0
- package/bundle/browse-delivery-JXBY36GK.js.map +7 -0
- package/bundle/browser-ELNDVPLC.js +18 -0
- package/bundle/browser-ELNDVPLC.js.map +7 -0
- package/bundle/capability-CIL3G4FI.js +17 -0
- package/bundle/capability-CIL3G4FI.js.map +7 -0
- package/bundle/chunk-265TPOPC.js +289 -0
- package/bundle/chunk-265TPOPC.js.map +7 -0
- package/bundle/chunk-2UENBO6M.js +223 -0
- package/bundle/chunk-2UENBO6M.js.map +7 -0
- package/bundle/chunk-2UPU3OW6.js +67 -0
- package/bundle/chunk-2UPU3OW6.js.map +7 -0
- package/bundle/chunk-2XU2X4OI.js +125 -0
- package/bundle/chunk-2XU2X4OI.js.map +7 -0
- package/bundle/chunk-3B7BBE4F.js +758 -0
- package/bundle/chunk-3B7BBE4F.js.map +7 -0
- package/bundle/chunk-3E545J66.js +69 -0
- package/bundle/chunk-3E545J66.js.map +7 -0
- package/bundle/chunk-5R2ANXQ7.js +510 -0
- package/bundle/chunk-5R2ANXQ7.js.map +7 -0
- package/bundle/chunk-6CPN4IGS.js +507 -0
- package/bundle/chunk-6CPN4IGS.js.map +7 -0
- package/bundle/chunk-6NR3OHEW.js +88 -0
- package/bundle/chunk-6NR3OHEW.js.map +7 -0
- package/bundle/chunk-6SETMHNN.js +206 -0
- package/bundle/chunk-6SETMHNN.js.map +7 -0
- package/bundle/chunk-6UCRKRWR.js +644 -0
- package/bundle/chunk-6UCRKRWR.js.map +7 -0
- package/bundle/chunk-AR6GO6YC.js +83 -0
- package/bundle/chunk-AR6GO6YC.js.map +7 -0
- package/bundle/chunk-AZJIODTQ.js +54 -0
- package/bundle/chunk-AZJIODTQ.js.map +7 -0
- package/bundle/chunk-BHMZ4RCC.js +3706 -0
- package/bundle/chunk-BHMZ4RCC.js.map +7 -0
- package/bundle/chunk-BQ2L4GMG.js +9175 -0
- package/bundle/chunk-BQ2L4GMG.js.map +7 -0
- package/bundle/chunk-BSSBCSCL.js +159 -0
- package/bundle/chunk-BSSBCSCL.js.map +7 -0
- package/bundle/chunk-BUUVFUPO.js +157 -0
- package/bundle/chunk-BUUVFUPO.js.map +7 -0
- package/bundle/chunk-CEVRHKJY.js +131 -0
- package/bundle/chunk-CEVRHKJY.js.map +7 -0
- package/bundle/chunk-CWOHNFUV.js +39 -0
- package/bundle/chunk-CWOHNFUV.js.map +7 -0
- package/bundle/chunk-D2DCBO6M.js +228 -0
- package/bundle/chunk-D2DCBO6M.js.map +7 -0
- package/bundle/chunk-FMWKEPM7.js +31 -0
- package/bundle/chunk-FMWKEPM7.js.map +7 -0
- package/bundle/chunk-GRNENTPA.js +145 -0
- package/bundle/chunk-GRNENTPA.js.map +7 -0
- package/bundle/chunk-GST5T3WZ.js +93 -0
- package/bundle/chunk-GST5T3WZ.js.map +7 -0
- package/bundle/chunk-GUQVJC3U.js +299 -0
- package/bundle/chunk-GUQVJC3U.js.map +7 -0
- package/bundle/chunk-HX7Y7EYP.js +3659 -0
- package/bundle/chunk-HX7Y7EYP.js.map +7 -0
- package/bundle/chunk-JCJS4ZIB.js +296 -0
- package/bundle/chunk-JCJS4ZIB.js.map +7 -0
- package/bundle/chunk-JW6RU47G.js +184 -0
- package/bundle/chunk-JW6RU47G.js.map +7 -0
- package/bundle/chunk-LSPKJQCI.js +24 -0
- package/bundle/chunk-LSPKJQCI.js.map +7 -0
- package/bundle/chunk-M6VBAPNT.js +16 -0
- package/bundle/chunk-M6VBAPNT.js.map +7 -0
- package/bundle/chunk-MPX525QO.js +129 -0
- package/bundle/chunk-MPX525QO.js.map +7 -0
- package/bundle/chunk-MW6WDLU7.js +130 -0
- package/bundle/chunk-MW6WDLU7.js.map +7 -0
- package/bundle/chunk-NT3OBORC.js +215 -0
- package/bundle/chunk-NT3OBORC.js.map +7 -0
- package/bundle/chunk-NWDBD4PA.js +50 -0
- package/bundle/chunk-NWDBD4PA.js.map +7 -0
- package/bundle/chunk-OP7BTAWY.js +29 -0
- package/bundle/chunk-OP7BTAWY.js.map +7 -0
- package/bundle/chunk-PLCY3GFH.js +77 -0
- package/bundle/chunk-PLCY3GFH.js.map +7 -0
- package/bundle/chunk-PNEDC45Y.js +97 -0
- package/bundle/chunk-PNEDC45Y.js.map +7 -0
- package/bundle/chunk-QBGBT5QS.js +81 -0
- package/bundle/chunk-QBGBT5QS.js.map +7 -0
- package/bundle/chunk-RVE2N7FA.js +70 -0
- package/bundle/chunk-RVE2N7FA.js.map +7 -0
- package/bundle/chunk-TZHIDLDS.js +71910 -0
- package/bundle/chunk-TZHIDLDS.js.map +7 -0
- package/bundle/chunk-UCQ2WC3B.js +126 -0
- package/bundle/chunk-UCQ2WC3B.js.map +7 -0
- package/bundle/chunk-UHRP745J.js +214 -0
- package/bundle/chunk-UHRP745J.js.map +7 -0
- package/bundle/chunk-V76TVMCM.js +58 -0
- package/bundle/chunk-V76TVMCM.js.map +7 -0
- package/bundle/chunk-VVEDVGCR.js +981 -0
- package/bundle/chunk-VVEDVGCR.js.map +7 -0
- package/bundle/chunk-W6FAL35D.js +102 -0
- package/bundle/chunk-W6FAL35D.js.map +7 -0
- package/bundle/chunk-X6TERNVJ.js +15902 -0
- package/bundle/chunk-X6TERNVJ.js.map +7 -0
- package/bundle/chunk-X76UX47U.js +47 -0
- package/bundle/chunk-X76UX47U.js.map +7 -0
- package/bundle/chunk-XREWVCUO.js +518 -0
- package/bundle/chunk-XREWVCUO.js.map +7 -0
- package/bundle/chunk-Y6XAEX2Q.js +408 -0
- package/bundle/chunk-Y6XAEX2Q.js.map +7 -0
- package/bundle/chunk-YOCTDKKL.js +28 -0
- package/bundle/chunk-YOCTDKKL.js.map +7 -0
- package/bundle/chunk-ZXPXCDA6.js +160 -0
- package/bundle/chunk-ZXPXCDA6.js.map +7 -0
- package/bundle/commands-BHVUOU3V.js +31 -0
- package/bundle/commands-BHVUOU3V.js.map +7 -0
- package/bundle/completion-buffer-P253ONKF.js +13 -0
- package/bundle/completion-buffer-P253ONKF.js.map +7 -0
- package/bundle/config-RGSDAPZN.js +19 -0
- package/bundle/config-RGSDAPZN.js.map +7 -0
- package/bundle/config-show-ERTATR6E.js +40 -0
- package/bundle/config-show-ERTATR6E.js.map +7 -0
- package/bundle/context-HCEGZNDC.js +72 -0
- package/bundle/context-HCEGZNDC.js.map +7 -0
- package/bundle/delegation-tools-GYTS2D6A.js +27 -0
- package/bundle/delegation-tools-GYTS2D6A.js.map +7 -0
- package/bundle/deploy-lib-import-32ZFKHWP.js +49 -0
- package/bundle/deploy-lib-import-32ZFKHWP.js.map +7 -0
- package/bundle/digital-signature-OFCGSHWO.js +13 -0
- package/bundle/digital-signature-OFCGSHWO.js.map +7 -0
- package/bundle/direct-api-transport-YR7SXXNN.js +860 -0
- package/bundle/direct-api-transport-YR7SXXNN.js.map +7 -0
- package/bundle/discord-adapter-YYWVMPPU.js +584 -0
- package/bundle/discord-adapter-YYWVMPPU.js.map +7 -0
- package/bundle/dist-MTMKARCP.js +1969 -0
- package/bundle/dist-MTMKARCP.js.map +7 -0
- package/bundle/dns-wakeup-27M7D2MR.js +107 -0
- package/bundle/dns-wakeup-27M7D2MR.js.map +7 -0
- package/bundle/doctor-QNUSDY73.js +248 -0
- package/bundle/doctor-QNUSDY73.js.map +7 -0
- package/bundle/ensure-invariants-NMXNS476.js +49 -0
- package/bundle/ensure-invariants-NMXNS476.js.map +7 -0
- package/bundle/env-schema-2KBHBDGN.js +19 -0
- package/bundle/env-schema-2KBHBDGN.js.map +7 -0
- package/bundle/esm-DDP6NCZG.js +100663 -0
- package/bundle/esm-DDP6NCZG.js.map +7 -0
- package/bundle/fallback-policy-L4QV2PEJ.js +46 -0
- package/bundle/fallback-policy-L4QV2PEJ.js.map +7 -0
- package/bundle/health-check-SPA7NT6N.js +56 -0
- package/bundle/health-check-SPA7NT6N.js.map +7 -0
- package/bundle/hook-system-6Q5YTR53.js +17 -0
- package/bundle/hook-system-6Q5YTR53.js.map +7 -0
- package/bundle/hotskills-K7BM4YLB.js +12 -0
- package/bundle/hotskills-K7BM4YLB.js.map +7 -0
- package/bundle/install-6HRZVKUM.js +15 -0
- package/bundle/install-6HRZVKUM.js.map +7 -0
- package/bundle/install-log-IAPHYKD4.js +28 -0
- package/bundle/install-log-IAPHYKD4.js.map +7 -0
- package/bundle/install-manifest-SPQRUNXL.js +102 -0
- package/bundle/install-manifest-SPQRUNXL.js.map +7 -0
- package/bundle/install-validate-PVLZXYLQ.js +53 -0
- package/bundle/install-validate-PVLZXYLQ.js.map +7 -0
- package/bundle/irc-adapter-OI5UZSQF.js +293 -0
- package/bundle/irc-adapter-OI5UZSQF.js.map +7 -0
- package/bundle/irc-config-55YO6EGB.js +88 -0
- package/bundle/irc-config-55YO6EGB.js.map +7 -0
- package/bundle/logs-ZNYXX5PA.js +19 -0
- package/bundle/logs-ZNYXX5PA.js.map +7 -0
- package/bundle/media-utils-XNNDTYFI.js +4662 -0
- package/bundle/media-utils-XNNDTYFI.js.map +7 -0
- package/bundle/message-pipeline-LLH5SYMO.js +33 -0
- package/bundle/message-pipeline-LLH5SYMO.js.map +7 -0
- package/bundle/meta.json +41304 -0
- package/bundle/model-health-registry-35LQNVQR.js +11 -0
- package/bundle/model-health-registry-35LQNVQR.js.map +7 -0
- package/bundle/notification-Y5S5MMLV.js +13 -0
- package/bundle/notification-Y5S5MMLV.js.map +7 -0
- package/bundle/openrouter-credits-EDY7ETAU.js +32 -0
- package/bundle/openrouter-credits-EDY7ETAU.js.map +7 -0
- package/bundle/passwd-RRFV4CC5.js +133 -0
- package/bundle/passwd-RRFV4CC5.js.map +7 -0
- package/bundle/paths-G33RZWZ7.js +17 -0
- package/bundle/paths-G33RZWZ7.js.map +7 -0
- package/bundle/peer-client-52XYMNI7.js +156 -0
- package/bundle/peer-client-52XYMNI7.js.map +7 -0
- package/bundle/peer-config-VK6EDLN5.js +16 -0
- package/bundle/peer-config-VK6EDLN5.js.map +7 -0
- package/bundle/peer-sessions-EAXTNQ36.js +49 -0
- package/bundle/peer-sessions-EAXTNQ36.js.map +7 -0
- package/bundle/pending-callback-RIMQZ7FJ.js +40 -0
- package/bundle/pending-callback-RIMQZ7FJ.js.map +7 -0
- package/bundle/phase-transport-KYERDL2O.js +22 -0
- package/bundle/phase-transport-KYERDL2O.js.map +7 -0
- package/bundle/public/css/dashboard.css +542 -0
- package/bundle/public/index.html +180 -0
- package/bundle/public/js/app.js +437 -0
- package/bundle/public/memory-universe.js +384 -0
- package/bundle/responses-adapter-AAQTY3K4.js +30 -0
- package/bundle/responses-adapter-AAQTY3K4.js.map +7 -0
- package/bundle/restore-ZE3SEPSS.js +46 -0
- package/bundle/restore-ZE3SEPSS.js.map +7 -0
- package/bundle/self-healer-utils-DMUUXC47.js +43 -0
- package/bundle/self-healer-utils-DMUUXC47.js.map +7 -0
- package/bundle/skill-stats-LLEXEXLR.js +22 -0
- package/bundle/skill-stats-LLEXEXLR.js.map +7 -0
- package/bundle/sleep-OYIUOVQD.js +19 -0
- package/bundle/sleep-OYIUOVQD.js.map +7 -0
- package/bundle/soul-loader-54WCVNLJ.js +16 -0
- package/bundle/soul-loader-54WCVNLJ.js.map +7 -0
- package/bundle/src-JL4PVO23.js +8 -0
- package/bundle/src-JL4PVO23.js.map +7 -0
- package/bundle/sse-parser-anthropic-P7CE2MH2.js +72 -0
- package/bundle/sse-parser-anthropic-P7CE2MH2.js.map +7 -0
- package/bundle/sse-parser-responses-EQQA5FWN.js +63 -0
- package/bundle/sse-parser-responses-EQQA5FWN.js.map +7 -0
- package/bundle/ssrf-guard-FZCBYIVW.js +64 -0
- package/bundle/ssrf-guard-FZCBYIVW.js.map +7 -0
- package/bundle/start-FH3GRMJ4.js +35 -0
- package/bundle/start-FH3GRMJ4.js.map +7 -0
- package/bundle/stream-single-WSG4D53C.js +33 -0
- package/bundle/stream-single-WSG4D53C.js.map +7 -0
- package/bundle/stt-2UH3RITX.js +14 -0
- package/bundle/stt-2UH3RITX.js.map +7 -0
- package/bundle/subagent-runtime-LE2ZXH3G.js +12 -0
- package/bundle/subagent-runtime-LE2ZXH3G.js.map +7 -0
- package/bundle/system-message-T5R3EYYN.js +30 -0
- package/bundle/system-message-T5R3EYYN.js.map +7 -0
- package/bundle/system-status-KQ6KHFJ6.js +189 -0
- package/bundle/system-status-KQ6KHFJ6.js.map +7 -0
- package/bundle/task-store-K7CQDEPI.js +22 -0
- package/bundle/task-store-K7CQDEPI.js.map +7 -0
- package/bundle/telegram-adapter-2V3XUMT5.js +1060 -0
- package/bundle/telegram-adapter-2V3XUMT5.js.map +7 -0
- package/bundle/tool-registry-MU3OX4UI.js +38 -0
- package/bundle/tool-registry-MU3OX4UI.js.map +7 -0
- package/bundle/tool-sandbox-VYOK4ZOA.js +20 -0
- package/bundle/tool-sandbox-VYOK4ZOA.js.map +7 -0
- package/bundle/transport-config-YLXU33RO.js +57 -0
- package/bundle/transport-config-YLXU33RO.js.map +7 -0
- package/bundle/update-QCW5LXRN.js +13 -0
- package/bundle/update-QCW5LXRN.js.map +7 -0
- package/bundle/update-check-27KZSAP6.js +12 -0
- package/bundle/update-check-27KZSAP6.js.map +7 -0
- package/bundle/usage-tracker-OVVEVMOY.js +17 -0
- package/bundle/usage-tracker-OVVEVMOY.js.map +7 -0
- package/bundle/user-registry-D4SD73UV.js +16 -0
- package/bundle/user-registry-D4SD73UV.js.map +7 -0
- package/core/professor.json +14 -0
- package/core/prompts/browsing_prompt.md +39 -0
- package/core/prompts/compaction.md +32 -0
- package/core/skills/memory/classification/SKILL.md +37 -0
- package/core/skills/memory/memory-anomalies/SKILL.md +39 -0
- package/core/skills/memory/memory-search/SKILL.md +48 -0
- package/core/skills/memory/topic-save/SKILL.md +44 -0
- package/core/skills/ops/cron/SKILL.md +51 -0
- package/core/skills/ops/gdrive-backup/SKILL.md +15 -0
- package/core/skills/ops/session-start/SKILL.md +11 -0
- package/core/skills/ops/skill-authoring/SKILL.md +54 -0
- package/core/skills/ops/system-health/SKILL.md +104 -0
- package/core/skills/ops/troubleshooting/SKILL.md +48 -0
- package/core/skills/ops/trust-gating/SKILL.md +30 -0
- package/core/skills/tools/a2a-communication/SKILL.md +68 -0
- package/core/skills/tools/browse-delegate/SKILL.md +27 -0
- package/core/skills/tools/browser/SKILL.md +36 -0
- package/core/skills/tools/clawhub/SKILL.md +44 -0
- package/core/skills/tools/delegation/SKILL.md +48 -0
- package/core/skills/tools/fxtwitter/SKILL.md +52 -0
- package/core/skills/tools/gmail/SKILL.md +44 -0
- package/core/skills/tools/irc-chat/SKILL.md +84 -0
- package/core/skills/tools/linear/SKILL.md +90 -0
- package/core/skills/tools/mcporter/SKILL.md +46 -0
- package/core/skills/tools/model-scout/SKILL.md +132 -0
- package/core/skills/tools/model-scout/scout-add-model.py +67 -0
- package/core/skills/tools/model-scout/scout-ollama.py +116 -0
- package/core/skills/tools/model-scout/scout-openrouter.py +85 -0
- package/core/skills/tools/nlm/SKILL.md +40 -0
- package/core/skills/tools/todo/SKILL.md +30 -0
- package/core/skills/tools/twitterX/SKILL.md +52 -0
- package/core/skills/tools/twitterX/scripts/abtars-tweet.js +532 -0
- package/core/skills/tools/twitterX/scripts/package.json +1 -0
- package/core/skills/tools/web-fetch/SKILL.md +29 -0
- package/package.json +59 -0
- package/scripts/abtars-daemon.service +23 -0
- package/scripts/abtars-fetch.sh +42 -0
- package/scripts/abtars-watchdog.service +13 -0
- package/scripts/abtars.sh +14 -0
- package/scripts/abtars@.service +21 -0
- package/scripts/browser-patchright.sh +79 -0
- package/scripts/com.abtars.daemon.plist +24 -0
- package/scripts/com.abtars.watchdog.plist +27 -0
- package/scripts/daily-backup.sh +62 -0
- package/scripts/doctor.sh +553 -0
- package/scripts/hooks/audit-logger.sh +22 -0
- package/scripts/upgrade-deps.sh +64 -0
- package/scripts/watchdog.sh +309 -0
|
@@ -0,0 +1,384 @@
|
|
|
1
|
+
/* Memory Universe — 3D visualization of extracted memories */
|
|
2
|
+
/* Standalone module, loaded on demand by dashboard */
|
|
3
|
+
|
|
4
|
+
(function() {
|
|
5
|
+
'use strict';
|
|
6
|
+
|
|
7
|
+
var V = '0.183.2';
|
|
8
|
+
var CDN = 'https://cdn.jsdelivr.net/npm/three@' + V;
|
|
9
|
+
|
|
10
|
+
var TYPE_COLORS = {
|
|
11
|
+
fact: [0.0, 0.9, 0.9], // cyan
|
|
12
|
+
decision: [0.7, 0.3, 1.0], // purple
|
|
13
|
+
preference: [1.0, 0.6, 0.1], // amber
|
|
14
|
+
event: [0.2, 1.0, 0.4], // green
|
|
15
|
+
lesson: [1.0, 0.15, 0.15], // red
|
|
16
|
+
feedback: [1.0, 0.85, 0.2], // gold
|
|
17
|
+
story: [0.3, 0.5, 1.0], // blue
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
window.initMemoryUniverse = function(token) {
|
|
21
|
+
// Create overlay
|
|
22
|
+
var overlay = document.createElement('div');
|
|
23
|
+
overlay.id = 'memory-universe-overlay';
|
|
24
|
+
overlay.style.cssText = 'position:fixed;top:0;left:0;width:100%;height:100%;z-index:10000;background:#000;';
|
|
25
|
+
overlay.innerHTML = '<div id="mu-loading" style="position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);color:#0ff;font-family:monospace;font-size:18px;">Loading Memory Universe...</div>' +
|
|
26
|
+
'<div id="mu-info" style="display:none;position:absolute;right:0;top:0;width:340px;height:100%;background:rgba(0,0,0,0.85);border-left:1px solid #0ff3;padding:20px;overflow-y:auto;font-family:monospace;color:#e0e0e0;font-size:15px;"></div>' +
|
|
27
|
+
'<div id="mu-tooltip" style="display:none;position:absolute;pointer-events:none;background:rgba(0,10,20,0.9);border:1px solid #0ff5;padding:8px 12px;border-radius:4px;color:#e0e0e0;font-family:monospace;font-size:12px;max-width:300px;"></div>' +
|
|
28
|
+
'<button id="mu-close" style="position:absolute;top:16px;left:16px;z-index:10001;background:none;border:none;color:#0ff6;font-size:16px;cursor:pointer;padding:6px 10px;font-family:monospace;">← back</button>' +
|
|
29
|
+
'<div id="mu-stats" style="position:absolute;bottom:16px;left:16px;color:#0ff8;font-family:monospace;font-size:12px;"></div>';
|
|
30
|
+
document.body.appendChild(overlay);
|
|
31
|
+
|
|
32
|
+
var closeBtn = document.getElementById('mu-close');
|
|
33
|
+
closeBtn.onclick = destroy;
|
|
34
|
+
document.addEventListener('keydown', onEsc);
|
|
35
|
+
|
|
36
|
+
function onEsc(e) { if (e.key === 'Escape') destroy(); }
|
|
37
|
+
function destroy() {
|
|
38
|
+
document.removeEventListener('keydown', onEsc);
|
|
39
|
+
if (animId) cancelAnimationFrame(animId);
|
|
40
|
+
overlay.remove();
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
var animId = null;
|
|
44
|
+
var memories = [], entities = [], links = [];
|
|
45
|
+
var particleData = [];
|
|
46
|
+
|
|
47
|
+
// Fetch data then load Three.js
|
|
48
|
+
fetch('/api/memory/all', { headers: { 'Authorization': 'Bearer ' + token } })
|
|
49
|
+
.then(function(r) { return r.json(); })
|
|
50
|
+
.then(function(data) {
|
|
51
|
+
memories = data.memories || [];
|
|
52
|
+
// #225: entities + memory_entities dropped. Viz renders memories only;
|
|
53
|
+
// entity-cluster and link code below is now dead-but-harmless (no-ops
|
|
54
|
+
// on empty arrays). Future: simplify or repurpose viz — separate ticket.
|
|
55
|
+
entities = data.entities || [];
|
|
56
|
+
links = data.links || [];
|
|
57
|
+
document.getElementById('mu-stats').textContent = memories.length + ' memories';
|
|
58
|
+
// Inject import map for Three.js ES modules
|
|
59
|
+
var im = document.createElement('script');
|
|
60
|
+
im.type = 'importmap';
|
|
61
|
+
im.textContent = JSON.stringify({ imports: {
|
|
62
|
+
"three": CDN + "/build/three.module.min.js",
|
|
63
|
+
"three/addons/": CDN + "/examples/jsm/"
|
|
64
|
+
}});
|
|
65
|
+
document.head.appendChild(im);
|
|
66
|
+
return import(CDN + "/build/three.module.min.js");
|
|
67
|
+
})
|
|
68
|
+
.then(function(THREE) {
|
|
69
|
+
return Promise.all([
|
|
70
|
+
import(CDN + "/examples/jsm/controls/OrbitControls.js"),
|
|
71
|
+
import(CDN + "/examples/jsm/postprocessing/EffectComposer.js"),
|
|
72
|
+
import(CDN + "/examples/jsm/postprocessing/RenderPass.js"),
|
|
73
|
+
import(CDN + "/examples/jsm/postprocessing/UnrealBloomPass.js"),
|
|
74
|
+
]).then(function(mods) {
|
|
75
|
+
return { THREE: THREE, OrbitControls: mods[0].OrbitControls, EffectComposer: mods[1].EffectComposer, RenderPass: mods[2].RenderPass, UnrealBloomPass: mods[3].UnrealBloomPass };
|
|
76
|
+
});
|
|
77
|
+
})
|
|
78
|
+
.then(function(m) { buildScene(m); })
|
|
79
|
+
.catch(function(err) {
|
|
80
|
+
document.getElementById('mu-loading').textContent = 'Error: ' + err.message;
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
function buildScene(m) {
|
|
84
|
+
var THREE = m.THREE;
|
|
85
|
+
document.getElementById('mu-loading').style.display = 'none';
|
|
86
|
+
|
|
87
|
+
var w = window.innerWidth, h = window.innerHeight;
|
|
88
|
+
var scene = new THREE.Scene();
|
|
89
|
+
scene.background = new THREE.Color(0x000008);
|
|
90
|
+
|
|
91
|
+
var camera = new THREE.PerspectiveCamera(60, w / h, 0.1, 1000);
|
|
92
|
+
camera.position.set(0, 5, 25);
|
|
93
|
+
|
|
94
|
+
var renderer = new THREE.WebGLRenderer({ antialias: true });
|
|
95
|
+
renderer.setSize(w, h);
|
|
96
|
+
renderer.setPixelRatio(Math.min(window.devicePixelRatio, 2));
|
|
97
|
+
renderer.toneMapping = THREE.ACESFilmicToneMapping;
|
|
98
|
+
renderer.toneMappingExposure = 1.2;
|
|
99
|
+
overlay.insertBefore(renderer.domElement, overlay.firstChild);
|
|
100
|
+
|
|
101
|
+
// Post-processing: bloom
|
|
102
|
+
var composer = new m.EffectComposer(renderer);
|
|
103
|
+
composer.addPass(new m.RenderPass(scene, camera));
|
|
104
|
+
var bloom = new m.UnrealBloomPass(new THREE.Vector2(w, h), 0.8, 0.3, 0.6);
|
|
105
|
+
composer.addPass(bloom);
|
|
106
|
+
|
|
107
|
+
// Controls
|
|
108
|
+
var controls = new m.OrbitControls(camera, renderer.domElement);
|
|
109
|
+
controls.enableDamping = true;
|
|
110
|
+
controls.dampingFactor = 0.05;
|
|
111
|
+
controls.autoRotate = true;
|
|
112
|
+
controls.autoRotateSpeed = 0.3;
|
|
113
|
+
|
|
114
|
+
// Starfield background
|
|
115
|
+
var starGeo = new THREE.BufferGeometry();
|
|
116
|
+
var starPos = new Float32Array(3000 * 3);
|
|
117
|
+
for (var i = 0; i < 3000; i++) {
|
|
118
|
+
starPos[i * 3] = (Math.random() - 0.5) * 200;
|
|
119
|
+
starPos[i * 3 + 1] = (Math.random() - 0.5) * 200;
|
|
120
|
+
starPos[i * 3 + 2] = (Math.random() - 0.5) * 200;
|
|
121
|
+
}
|
|
122
|
+
starGeo.setAttribute('position', new THREE.BufferAttribute(starPos, 3));
|
|
123
|
+
var starMat = new THREE.ShaderMaterial({
|
|
124
|
+
vertexShader: 'void main() { vec4 mv = modelViewMatrix * vec4(position,1.0); gl_PointSize = 1.5; gl_Position = projectionMatrix * mv; }',
|
|
125
|
+
fragmentShader: 'void main() { float d = length(gl_PointCoord-vec2(0.5)); if(d>0.5) discard; gl_FragColor = vec4(0.2,0.27,0.4, 1.0-d*2.0); }',
|
|
126
|
+
transparent: true, depthWrite: false,
|
|
127
|
+
});
|
|
128
|
+
scene.add(new THREE.Points(starGeo, starMat));
|
|
129
|
+
|
|
130
|
+
// Build entity clusters — assign positions
|
|
131
|
+
var entityPositions = {};
|
|
132
|
+
entities.forEach(function(e, i) {
|
|
133
|
+
var angle = (i / Math.max(entities.length, 1)) * Math.PI * 2;
|
|
134
|
+
var r = 6 + Math.random() * 4;
|
|
135
|
+
entityPositions[e.id] = { x: Math.cos(angle) * r, y: (Math.random() - 0.5) * 4, z: Math.sin(angle) * r };
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
// Map memory→entities
|
|
139
|
+
var memEntityMap = {};
|
|
140
|
+
links.forEach(function(l) {
|
|
141
|
+
if (!memEntityMap[l.memory_id]) memEntityMap[l.memory_id] = [];
|
|
142
|
+
memEntityMap[l.memory_id].push(l.entity_id);
|
|
143
|
+
});
|
|
144
|
+
|
|
145
|
+
// Memory particles
|
|
146
|
+
var count = memories.length;
|
|
147
|
+
var positions = new Float32Array(count * 3);
|
|
148
|
+
var colors = new Float32Array(count * 3);
|
|
149
|
+
var sizes = new Float32Array(count);
|
|
150
|
+
var opacities = new Float32Array(count);
|
|
151
|
+
var pulseRates = new Float32Array(count);
|
|
152
|
+
var brightnesses = new Float32Array(count);
|
|
153
|
+
var hasEmbeddings = new Float32Array(count);
|
|
154
|
+
|
|
155
|
+
var now = Date.now();
|
|
156
|
+
var oldest = memories.reduce(function(a, m) { return Math.min(a, m.created_at || now); }, now);
|
|
157
|
+
var timeSpan = Math.max(now - oldest, 1);
|
|
158
|
+
|
|
159
|
+
memories.forEach(function(mem, i) {
|
|
160
|
+
var c = TYPE_COLORS[mem.memory_type] || TYPE_COLORS.fact;
|
|
161
|
+
|
|
162
|
+
// Position: entity cluster or random sphere
|
|
163
|
+
var px, py, pz;
|
|
164
|
+
var memEntities = memEntityMap[mem.id];
|
|
165
|
+
if (memEntities && memEntities.length > 0) {
|
|
166
|
+
var ep = entityPositions[memEntities[0]];
|
|
167
|
+
if (ep) {
|
|
168
|
+
px = ep.x + (Math.random() - 0.5) * 3;
|
|
169
|
+
py = ep.y + (Math.random() - 0.5) * 2;
|
|
170
|
+
pz = ep.z + (Math.random() - 0.5) * 3;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
if (px === undefined) {
|
|
174
|
+
var theta = Math.random() * Math.PI * 2;
|
|
175
|
+
var phi = Math.acos(2 * Math.random() - 1);
|
|
176
|
+
var rad = 4 + Math.random() * 10;
|
|
177
|
+
px = rad * Math.sin(phi) * Math.cos(theta);
|
|
178
|
+
py = ((mem.created_at - oldest) / timeSpan) * 12 - 6 + (Math.random() - 0.5) * 2;
|
|
179
|
+
pz = rad * Math.sin(phi) * Math.sin(theta);
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
positions[i * 3] = px;
|
|
183
|
+
positions[i * 3 + 1] = py;
|
|
184
|
+
positions[i * 3 + 2] = pz;
|
|
185
|
+
|
|
186
|
+
colors[i * 3] = c[0];
|
|
187
|
+
colors[i * 3 + 1] = c[1];
|
|
188
|
+
colors[i * 3 + 2] = c[2];
|
|
189
|
+
|
|
190
|
+
sizes[i] = Math.max(0.8, Math.min(4.0, 0.8 + (mem.recall_count || 0) * 0.3));
|
|
191
|
+
|
|
192
|
+
// Credibility → opacity: 1=confirmed(1.0), 6=unknown(0.3)
|
|
193
|
+
opacities[i] = Math.max(0.3, 1.0 - ((mem.credibility || 6) - 1) * 0.14);
|
|
194
|
+
|
|
195
|
+
// Pulse: emotion intensity (further from 0 = faster)
|
|
196
|
+
pulseRates[i] = Math.abs(mem.emotion_score || 0) * 0.6;
|
|
197
|
+
|
|
198
|
+
// Brightness: classification (S=1.5, C=1.1, R=0.8, U=0.5)
|
|
199
|
+
brightnesses[i] = 0.5 + (mem.classification || 0) * 0.33;
|
|
200
|
+
|
|
201
|
+
// Trust → core dot: 3=bright, 0=none
|
|
202
|
+
hasEmbeddings[i] = (mem.trust || 0) / 3.0;
|
|
203
|
+
|
|
204
|
+
particleData.push({
|
|
205
|
+
index: i,
|
|
206
|
+
memory: mem,
|
|
207
|
+
basePos: { x: px, y: py, z: pz },
|
|
208
|
+
entities: memEntities || [],
|
|
209
|
+
});
|
|
210
|
+
});
|
|
211
|
+
|
|
212
|
+
var geo = new THREE.BufferGeometry();
|
|
213
|
+
geo.setAttribute('position', new THREE.BufferAttribute(positions, 3));
|
|
214
|
+
geo.setAttribute('color', new THREE.BufferAttribute(colors, 3));
|
|
215
|
+
geo.setAttribute('size', new THREE.BufferAttribute(sizes, 1));
|
|
216
|
+
geo.setAttribute('opacity', new THREE.BufferAttribute(opacities, 1));
|
|
217
|
+
geo.setAttribute('pulseRate', new THREE.BufferAttribute(pulseRates, 1));
|
|
218
|
+
geo.setAttribute('brightness', new THREE.BufferAttribute(brightnesses, 1));
|
|
219
|
+
geo.setAttribute('hasEmbed', new THREE.BufferAttribute(hasEmbeddings, 1));
|
|
220
|
+
|
|
221
|
+
var vertexShader = [
|
|
222
|
+
'attribute float size;',
|
|
223
|
+
'attribute float opacity;',
|
|
224
|
+
'attribute float pulseRate;',
|
|
225
|
+
'attribute float brightness;',
|
|
226
|
+
'attribute float hasEmbed;',
|
|
227
|
+
'uniform float uTime;',
|
|
228
|
+
'varying vec3 vColor;',
|
|
229
|
+
'varying float vOpacity;',
|
|
230
|
+
'varying float vHasEmbed;',
|
|
231
|
+
'void main() {',
|
|
232
|
+
' float pulse = pulseRate > 0.0 ? 0.85 + 0.15 * sin(uTime * pulseRate + float(gl_VertexID) * 1.7) : 1.0;',
|
|
233
|
+
' vColor = color * brightness * pulse;',
|
|
234
|
+
' vOpacity = opacity;',
|
|
235
|
+
' vHasEmbed = hasEmbed;',
|
|
236
|
+
' vec4 mvPosition = modelViewMatrix * vec4(position, 1.0);',
|
|
237
|
+
' gl_PointSize = size * pulse * (400.0 / -mvPosition.z);',
|
|
238
|
+
' gl_Position = projectionMatrix * mvPosition;',
|
|
239
|
+
'}',
|
|
240
|
+
].join('\n');
|
|
241
|
+
|
|
242
|
+
var fragmentShader = [
|
|
243
|
+
'varying vec3 vColor;',
|
|
244
|
+
'varying float vOpacity;',
|
|
245
|
+
'varying float vHasEmbed;',
|
|
246
|
+
'void main() {',
|
|
247
|
+
' float d = length(gl_PointCoord - vec2(0.5));',
|
|
248
|
+
' if (d > 0.5) discard;',
|
|
249
|
+
' float glow = exp(-d * 12.0);',
|
|
250
|
+
// Core dot for trust
|
|
251
|
+
' float core = vHasEmbed * smoothstep(0.08, 0.0, d) * 0.8;',
|
|
252
|
+
' vec3 col = vColor * glow + vec3(core);',
|
|
253
|
+
' gl_FragColor = vec4(col, glow * vOpacity + core);',
|
|
254
|
+
'}',
|
|
255
|
+
].join('\n');
|
|
256
|
+
|
|
257
|
+
var mat = new THREE.ShaderMaterial({
|
|
258
|
+
vertexShader: vertexShader,
|
|
259
|
+
fragmentShader: fragmentShader,
|
|
260
|
+
uniforms: { uTime: { value: 0.0 } },
|
|
261
|
+
vertexColors: true,
|
|
262
|
+
transparent: true,
|
|
263
|
+
blending: THREE.AdditiveBlending,
|
|
264
|
+
depthWrite: false,
|
|
265
|
+
});
|
|
266
|
+
|
|
267
|
+
var points = new THREE.Points(geo, mat);
|
|
268
|
+
scene.add(points);
|
|
269
|
+
|
|
270
|
+
// Entity connection lines
|
|
271
|
+
var lineMat = new THREE.LineBasicMaterial({ color: 0x0066aa, transparent: true, opacity: 0.08 });
|
|
272
|
+
links.forEach(function(l) {
|
|
273
|
+
var mems = particleData.filter(function(p) { return p.entities.indexOf(l.entity_id) >= 0; });
|
|
274
|
+
for (var a = 0; a < mems.length; a++) {
|
|
275
|
+
for (var b = a + 1; b < mems.length && b < a + 3; b++) {
|
|
276
|
+
var lineGeo = new THREE.BufferGeometry().setFromPoints([
|
|
277
|
+
new THREE.Vector3(mems[a].basePos.x, mems[a].basePos.y, mems[a].basePos.z),
|
|
278
|
+
new THREE.Vector3(mems[b].basePos.x, mems[b].basePos.y, mems[b].basePos.z),
|
|
279
|
+
]);
|
|
280
|
+
scene.add(new THREE.Line(lineGeo, lineMat));
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
});
|
|
284
|
+
|
|
285
|
+
// Raycaster for interaction
|
|
286
|
+
var raycaster = new THREE.Raycaster();
|
|
287
|
+
raycaster.params.Points.threshold = 0.5;
|
|
288
|
+
var mouse = new THREE.Vector2();
|
|
289
|
+
var tooltip = document.getElementById('mu-tooltip');
|
|
290
|
+
var infoPanel = document.getElementById('mu-info');
|
|
291
|
+
var hoveredIdx = -1;
|
|
292
|
+
|
|
293
|
+
renderer.domElement.addEventListener('mousemove', function(e) {
|
|
294
|
+
mouse.x = (e.clientX / w) * 2 - 1;
|
|
295
|
+
mouse.y = -(e.clientY / h) * 2 + 1;
|
|
296
|
+
raycaster.setFromCamera(mouse, camera);
|
|
297
|
+
var intersects = raycaster.intersectObject(points);
|
|
298
|
+
if (intersects.length > 0) {
|
|
299
|
+
var idx = intersects[0].index;
|
|
300
|
+
if (idx !== hoveredIdx && idx < particleData.length) {
|
|
301
|
+
hoveredIdx = idx;
|
|
302
|
+
var mem = particleData[idx].memory;
|
|
303
|
+
tooltip.style.display = 'block';
|
|
304
|
+
tooltip.style.left = (e.clientX + 16) + 'px';
|
|
305
|
+
tooltip.style.top = (e.clientY - 10) + 'px';
|
|
306
|
+
tooltip.textContent = mem.content_en ? mem.content_en.substring(0, 120) + (mem.content_en.length > 120 ? '...' : '') : '(empty)';
|
|
307
|
+
}
|
|
308
|
+
} else {
|
|
309
|
+
hoveredIdx = -1;
|
|
310
|
+
tooltip.style.display = 'none';
|
|
311
|
+
}
|
|
312
|
+
});
|
|
313
|
+
|
|
314
|
+
renderer.domElement.addEventListener('click', function(e) {
|
|
315
|
+
raycaster.setFromCamera(mouse, camera);
|
|
316
|
+
var intersects = raycaster.intersectObject(points);
|
|
317
|
+
if (intersects.length > 0 && intersects[0].index < particleData.length) {
|
|
318
|
+
var mem = particleData[intersects[0].index].memory;
|
|
319
|
+
var entNames = particleData[intersects[0].index].entities.map(function(eid) {
|
|
320
|
+
var ent = entities.find(function(e) { return e.id === eid; });
|
|
321
|
+
return ent ? ent.name : '?';
|
|
322
|
+
});
|
|
323
|
+
var typeColorMap = { fact: '#0ee', decision: '#b44ff', preference: '#fa0', event: '#3f4', lesson: '#f22', feedback: '#fd3' };
|
|
324
|
+
var typeColor = typeColorMap[mem.memory_type] || '#fff';
|
|
325
|
+
infoPanel.style.display = 'block';
|
|
326
|
+
infoPanel.innerHTML =
|
|
327
|
+
'<div style="margin-bottom:16px;"><button onclick="document.getElementById(\'mu-info\').style.display=\'none\'" style="background:none;border:1px solid #0ff5;color:#0ff;cursor:pointer;padding:4px 10px;border-radius:3px;">✕</button></div>' +
|
|
328
|
+
'<div style="color:#0ff;font-size:11px;margin-bottom:8px;">MEMORY #' + mem.id + '</div>' +
|
|
329
|
+
'<div style="margin-bottom:12px;line-height:1.5;">' + escHtml(mem.content_en || '') + '</div>' +
|
|
330
|
+
(mem.content_original && mem.content_original !== mem.content_en ? '<div style="color:#888;font-size:11px;margin-bottom:12px;">' + escHtml(mem.content_original) + '</div>' : '') +
|
|
331
|
+
'<div style="display:grid;grid-template-columns:1fr 1fr;gap:6px;font-size:12px;">' +
|
|
332
|
+
'<div>Type: <span style="color:' + typeColor + ';">' + (mem.memory_type || '?') + '</span></div>' +
|
|
333
|
+
'<div>Class: <span style="color:' + (['#0ff','#66f','#fa0','#f22'][mem.classification || 0] || '#fff') + ';">' + (['U','R','C','S'][mem.classification || 0] || '?') + '</span></div>' +
|
|
334
|
+
'<div>Emotion: <span style="color:' + (mem.emotion_score > 0 ? '#4f4' : mem.emotion_score < 0 ? '#f44' : '#888') + ';">' + (mem.emotion_score || 0) + '</span></div>' +
|
|
335
|
+
'<div>Recall: <span style="color:#0ff;">' + (mem.recall_count || 0) + '</span></div>' +
|
|
336
|
+
'<div>Trust: ' + (mem.trust ?? '?') + '</div>' +
|
|
337
|
+
'<div>Integrity: ' + (mem.integrity ?? '?') + '</div>' +
|
|
338
|
+
'<div>Credibility: ' + (mem.credibility ?? '?') + '</div>' +
|
|
339
|
+
'<div>Relevance: ' + (mem.relevance_score || 0) + '</div>' +
|
|
340
|
+
'</div>' +
|
|
341
|
+
(entNames.length > 0 ? '<div style="margin-top:12px;color:#0ff8;font-size:11px;">Entities: ' + entNames.join(', ') + '</div>' : '') +
|
|
342
|
+
'<div style="margin-top:12px;color:#666;font-size:10px;">Created: ' + new Date(mem.created_at).toLocaleString() + '</div>';
|
|
343
|
+
}
|
|
344
|
+
});
|
|
345
|
+
|
|
346
|
+
// Animation
|
|
347
|
+
var clock = new THREE.Clock();
|
|
348
|
+
function animate() {
|
|
349
|
+
animId = requestAnimationFrame(animate);
|
|
350
|
+
var t = clock.getElapsedTime();
|
|
351
|
+
var posAttr = geo.attributes.position;
|
|
352
|
+
|
|
353
|
+
for (var i = 0; i < particleData.length; i++) {
|
|
354
|
+
var p = particleData[i];
|
|
355
|
+
var drift = 0.15;
|
|
356
|
+
posAttr.array[i * 3] = p.basePos.x + Math.sin(t * 0.3 + i * 0.7) * drift;
|
|
357
|
+
posAttr.array[i * 3 + 1] = p.basePos.y + Math.cos(t * 0.2 + i * 1.1) * drift;
|
|
358
|
+
posAttr.array[i * 3 + 2] = p.basePos.z + Math.sin(t * 0.25 + i * 0.5) * drift;
|
|
359
|
+
}
|
|
360
|
+
posAttr.needsUpdate = true;
|
|
361
|
+
|
|
362
|
+
mat.uniforms.uTime.value = t;
|
|
363
|
+
controls.update();
|
|
364
|
+
composer.render();
|
|
365
|
+
}
|
|
366
|
+
animate();
|
|
367
|
+
|
|
368
|
+
// Resize
|
|
369
|
+
window.addEventListener('resize', function() {
|
|
370
|
+
w = window.innerWidth; h = window.innerHeight;
|
|
371
|
+
camera.aspect = w / h;
|
|
372
|
+
camera.updateProjectionMatrix();
|
|
373
|
+
renderer.setSize(w, h);
|
|
374
|
+
composer.setSize(w, h);
|
|
375
|
+
});
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
function escHtml(s) {
|
|
379
|
+
var d = document.createElement('div');
|
|
380
|
+
d.textContent = s;
|
|
381
|
+
return d.innerHTML;
|
|
382
|
+
}
|
|
383
|
+
};
|
|
384
|
+
})();
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { createRequire as __bundleCreateRequire } from 'node:module'; import { fileURLToPath as __bundleFileURLToPath } from 'node:url'; import { dirname as __bundleDirname } from 'node:path'; const require = __bundleCreateRequire(import.meta.url); const __chunk_filename = __bundleFileURLToPath(import.meta.url); const __chunk_dirname = __bundleDirname(__chunk_filename);
|
|
2
|
+
import "./chunk-NWDBD4PA.js";
|
|
3
|
+
|
|
4
|
+
// src/components/transport/responses-adapter.ts
|
|
5
|
+
function toResponsesRequest(model, messages, tools, maxTokens) {
|
|
6
|
+
const system = messages.find((m) => m.role === "system");
|
|
7
|
+
const userMessages = messages.filter((m) => m.role !== "system");
|
|
8
|
+
const input = userMessages.map((m) => typeof m.content === "string" ? m.content : JSON.stringify(m.content)).join("\n\n");
|
|
9
|
+
return {
|
|
10
|
+
model,
|
|
11
|
+
input,
|
|
12
|
+
...system ? { instructions: typeof system.content === "string" ? system.content : "" } : {},
|
|
13
|
+
...tools?.length ? { tools } : {},
|
|
14
|
+
...maxTokens ? { max_output_tokens: maxTokens } : {}
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
function fromResponsesResponse(resp) {
|
|
18
|
+
for (const item of resp.output) {
|
|
19
|
+
if (item.type === "message" && item.content) {
|
|
20
|
+
const text = item.content.find((c) => c.type === "text");
|
|
21
|
+
if (text?.text) return text.text;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
return "";
|
|
25
|
+
}
|
|
26
|
+
export {
|
|
27
|
+
fromResponsesResponse,
|
|
28
|
+
toResponsesRequest
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=responses-adapter-AAQTY3K4.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/components/transport/responses-adapter.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * responses-adapter.ts \u2014 OpenAI Responses API format adapter (#465).\n * Converts between our internal chat format and the Responses API wire format.\n */\n\nexport interface ResponsesRequest {\n model: string;\n input: string;\n instructions?: string;\n tools?: unknown[];\n max_output_tokens?: number;\n}\n\nexport interface ResponsesResponse {\n id: string;\n output: Array<{ type: string; content?: Array<{ type: string; text?: string }>; name?: string; arguments?: string }>;\n}\n\n/** Convert chat/completions-style messages to Responses API request. */\nexport function toResponsesRequest(\n model: string,\n messages: Array<{ role: string; content: string | unknown[] }>,\n tools?: unknown[],\n maxTokens?: number,\n): ResponsesRequest {\n // System message \u2192 instructions, rest \u2192 concatenated input\n const system = messages.find(m => m.role === \"system\");\n const userMessages = messages.filter(m => m.role !== \"system\");\n const input = userMessages.map(m => typeof m.content === \"string\" ? m.content : JSON.stringify(m.content)).join(\"\\n\\n\");\n\n return {\n model,\n input,\n ...(system ? { instructions: typeof system.content === \"string\" ? system.content : \"\" } : {}),\n ...(tools?.length ? { tools } : {}),\n ...(maxTokens ? { max_output_tokens: maxTokens } : {}),\n };\n}\n\n/** Extract text content from Responses API response. */\nexport function fromResponsesResponse(resp: ResponsesResponse): string {\n for (const item of resp.output) {\n if (item.type === \"message\" && item.content) {\n const text = item.content.find(c => c.type === \"text\");\n if (text?.text) return text.text;\n }\n }\n return \"\";\n}\n"],
|
|
5
|
+
"mappings": ";;;;AAmBO,SAAS,mBACd,OACA,UACA,OACA,WACkB;AAElB,QAAM,SAAS,SAAS,KAAK,OAAK,EAAE,SAAS,QAAQ;AACrD,QAAM,eAAe,SAAS,OAAO,OAAK,EAAE,SAAS,QAAQ;AAC7D,QAAM,QAAQ,aAAa,IAAI,OAAK,OAAO,EAAE,YAAY,WAAW,EAAE,UAAU,KAAK,UAAU,EAAE,OAAO,CAAC,EAAE,KAAK,MAAM;AAEtH,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA,GAAI,SAAS,EAAE,cAAc,OAAO,OAAO,YAAY,WAAW,OAAO,UAAU,GAAG,IAAI,CAAC;AAAA,IAC3F,GAAI,OAAO,SAAS,EAAE,MAAM,IAAI,CAAC;AAAA,IACjC,GAAI,YAAY,EAAE,mBAAmB,UAAU,IAAI,CAAC;AAAA,EACtD;AACF;AAGO,SAAS,sBAAsB,MAAiC;AACrE,aAAW,QAAQ,KAAK,QAAQ;AAC9B,QAAI,KAAK,SAAS,aAAa,KAAK,SAAS;AAC3C,YAAM,OAAO,KAAK,QAAQ,KAAK,OAAK,EAAE,SAAS,MAAM;AACrD,UAAI,MAAM,KAAM,QAAO,KAAK;AAAA,IAC9B;AAAA,EACF;AACA,SAAO;AACT;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { createRequire as __bundleCreateRequire } from 'node:module'; import { fileURLToPath as __bundleFileURLToPath } from 'node:url'; import { dirname as __bundleDirname } from 'node:path'; const require = __bundleCreateRequire(import.meta.url); const __chunk_filename = __bundleFileURLToPath(import.meta.url); const __chunk_dirname = __bundleDirname(__chunk_filename);
|
|
2
|
+
import {
|
|
3
|
+
abtarsHome,
|
|
4
|
+
init_paths
|
|
5
|
+
} from "./chunk-X76UX47U.js";
|
|
6
|
+
import "./chunk-NWDBD4PA.js";
|
|
7
|
+
|
|
8
|
+
// src/cli/commands/restore.ts
|
|
9
|
+
init_paths();
|
|
10
|
+
import { existsSync } from "node:fs";
|
|
11
|
+
import { spawnSync } from "node:child_process";
|
|
12
|
+
async function restore(archivePath) {
|
|
13
|
+
if (!archivePath) {
|
|
14
|
+
process.stderr.write("Usage: abtars restore <file.zip|.7z>\n");
|
|
15
|
+
return 1;
|
|
16
|
+
}
|
|
17
|
+
if (!existsSync(archivePath)) {
|
|
18
|
+
process.stderr.write(`File not found: ${archivePath}
|
|
19
|
+
`);
|
|
20
|
+
return 1;
|
|
21
|
+
}
|
|
22
|
+
const home = abtarsHome();
|
|
23
|
+
const is7z = archivePath.endsWith(".7z");
|
|
24
|
+
const listCmd = is7z ? spawnSync("7z", ["l", archivePath], { encoding: "utf-8" }) : spawnSync("unzip", ["-l", archivePath], { encoding: "utf-8" });
|
|
25
|
+
if (!listCmd.stdout?.includes("config/")) {
|
|
26
|
+
process.stderr.write("Error: archive does not contain config/ \u2014 not a valid abtars backup\n");
|
|
27
|
+
return 1;
|
|
28
|
+
}
|
|
29
|
+
let result;
|
|
30
|
+
if (is7z) {
|
|
31
|
+
result = spawnSync("7z", ["x", `-o${home}`, "-aoa", archivePath], { encoding: "utf-8", stdio: "inherit" });
|
|
32
|
+
} else {
|
|
33
|
+
result = spawnSync("unzip", ["-o", archivePath, "-d", home], { encoding: "utf-8", stdio: "inherit" });
|
|
34
|
+
}
|
|
35
|
+
if (result.status !== 0) {
|
|
36
|
+
process.stderr.write("Restore failed\n");
|
|
37
|
+
return 1;
|
|
38
|
+
}
|
|
39
|
+
process.stdout.write(`\u2713 Restored to ${home}
|
|
40
|
+
`);
|
|
41
|
+
return 0;
|
|
42
|
+
}
|
|
43
|
+
export {
|
|
44
|
+
restore
|
|
45
|
+
};
|
|
46
|
+
//# sourceMappingURL=restore-ZE3SEPSS.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/cli/commands/restore.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * `abtars restore` \u2014 extract user data from backup archive to ~/.abtars/\n */\n\nimport { existsSync } from \"node:fs\";\nimport { spawnSync } from \"node:child_process\";\nimport { abtarsHome } from \"../../paths.js\";\n\nexport async function restore(archivePath: string): Promise<number> {\n if (!archivePath) {\n process.stderr.write(\"Usage: abtars restore <file.zip|.7z>\\n\");\n return 1;\n }\n if (!existsSync(archivePath)) {\n process.stderr.write(`File not found: ${archivePath}\\n`);\n return 1;\n }\n\n const home = abtarsHome();\n const is7z = archivePath.endsWith(\".7z\");\n\n // Sanity check: verify archive contains config/\n const listCmd = is7z\n ? spawnSync(\"7z\", [\"l\", archivePath], { encoding: \"utf-8\" })\n : spawnSync(\"unzip\", [\"-l\", archivePath], { encoding: \"utf-8\" });\n if (!listCmd.stdout?.includes(\"config/\")) {\n process.stderr.write(\"Error: archive does not contain config/ \u2014 not a valid abtars backup\\n\");\n return 1;\n }\n\n // Extract\n let result;\n if (is7z) {\n result = spawnSync(\"7z\", [\"x\", `-o${home}`, \"-aoa\", archivePath], { encoding: \"utf-8\", stdio: \"inherit\" });\n } else {\n result = spawnSync(\"unzip\", [\"-o\", archivePath, \"-d\", home], { encoding: \"utf-8\", stdio: \"inherit\" });\n }\n\n if (result.status !== 0) {\n process.stderr.write(\"Restore failed\\n\");\n return 1;\n }\n\n process.stdout.write(`\u2713 Restored to ${home}\\n`);\n return 0;\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;AAMA;AAFA,SAAS,kBAAkB;AAC3B,SAAS,iBAAiB;AAG1B,eAAsB,QAAQ,aAAsC;AAClE,MAAI,CAAC,aAAa;AAChB,YAAQ,OAAO,MAAM,wCAAwC;AAC7D,WAAO;AAAA,EACT;AACA,MAAI,CAAC,WAAW,WAAW,GAAG;AAC5B,YAAQ,OAAO,MAAM,mBAAmB,WAAW;AAAA,CAAI;AACvD,WAAO;AAAA,EACT;AAEA,QAAM,OAAO,WAAW;AACxB,QAAM,OAAO,YAAY,SAAS,KAAK;AAGvC,QAAM,UAAU,OACZ,UAAU,MAAM,CAAC,KAAK,WAAW,GAAG,EAAE,UAAU,QAAQ,CAAC,IACzD,UAAU,SAAS,CAAC,MAAM,WAAW,GAAG,EAAE,UAAU,QAAQ,CAAC;AACjE,MAAI,CAAC,QAAQ,QAAQ,SAAS,SAAS,GAAG;AACxC,YAAQ,OAAO,MAAM,4EAAuE;AAC5F,WAAO;AAAA,EACT;AAGA,MAAI;AACJ,MAAI,MAAM;AACR,aAAS,UAAU,MAAM,CAAC,KAAK,KAAK,IAAI,IAAI,QAAQ,WAAW,GAAG,EAAE,UAAU,SAAS,OAAO,UAAU,CAAC;AAAA,EAC3G,OAAO;AACL,aAAS,UAAU,SAAS,CAAC,MAAM,aAAa,MAAM,IAAI,GAAG,EAAE,UAAU,SAAS,OAAO,UAAU,CAAC;AAAA,EACtG;AAEA,MAAI,OAAO,WAAW,GAAG;AACvB,YAAQ,OAAO,MAAM,kBAAkB;AACvC,WAAO;AAAA,EACT;AAEA,UAAQ,OAAO,MAAM,sBAAiB,IAAI;AAAA,CAAI;AAC9C,SAAO;AACT;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { createRequire as __bundleCreateRequire } from 'node:module'; import { fileURLToPath as __bundleFileURLToPath } from 'node:url'; import { dirname as __bundleDirname } from 'node:path'; const require = __bundleCreateRequire(import.meta.url); const __chunk_filename = __bundleFileURLToPath(import.meta.url); const __chunk_dirname = __bundleDirname(__chunk_filename);
|
|
2
|
+
import {
|
|
3
|
+
init_log_and_swallow,
|
|
4
|
+
logAndSwallow
|
|
5
|
+
} from "./chunk-FMWKEPM7.js";
|
|
6
|
+
import {
|
|
7
|
+
init_logger,
|
|
8
|
+
logInfo
|
|
9
|
+
} from "./chunk-BUUVFUPO.js";
|
|
10
|
+
import "./chunk-X76UX47U.js";
|
|
11
|
+
import "./chunk-NWDBD4PA.js";
|
|
12
|
+
|
|
13
|
+
// src/components/self-healer-utils.ts
|
|
14
|
+
init_logger();
|
|
15
|
+
init_log_and_swallow();
|
|
16
|
+
import { execFileSync } from "node:child_process";
|
|
17
|
+
var TAG = "self-healer";
|
|
18
|
+
function healPort(port) {
|
|
19
|
+
try {
|
|
20
|
+
const cmd = process.platform === "darwin" ? "lsof" : "fuser";
|
|
21
|
+
const args = process.platform === "darwin" ? ["-ti", `:${port}`] : [`${port}/tcp`];
|
|
22
|
+
const out = execFileSync(cmd, args, { encoding: "utf-8", timeout: 5e3 }).trim();
|
|
23
|
+
if (!out) return false;
|
|
24
|
+
const pids = out.split(/\s+/).map(Number).filter((p) => p > 0 && p !== process.pid);
|
|
25
|
+
if (pids.length === 0) return false;
|
|
26
|
+
for (const pid of pids) {
|
|
27
|
+
try {
|
|
28
|
+
process.kill(pid, "SIGKILL");
|
|
29
|
+
} catch (err) {
|
|
30
|
+
logAndSwallow(TAG, "kill pid", err);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
logInfo(TAG, `healPort(${port}): killed PID ${pids.join(", ")}`);
|
|
34
|
+
return true;
|
|
35
|
+
} catch (err) {
|
|
36
|
+
logAndSwallow(TAG, "healPort", err);
|
|
37
|
+
return false;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
export {
|
|
41
|
+
healPort
|
|
42
|
+
};
|
|
43
|
+
//# sourceMappingURL=self-healer-utils-DMUUXC47.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/components/self-healer-utils.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * Shared healing utilities \u2014 called by service-registry during background retry.\n */\nimport { execFileSync } from \"node:child_process\";\nimport { logInfo } from \"./logger.js\";\nimport { logAndSwallow } from \"./log-and-swallow.js\";\n\nconst TAG = \"self-healer\";\n\n/** Kill the process holding a port. Returns true if killed, false if nothing found. */\nexport function healPort(port: number): boolean {\n try {\n const cmd = process.platform === \"darwin\" ? \"lsof\" : \"fuser\";\n const args = process.platform === \"darwin\" ? [\"-ti\", `:${port}`] : [`${port}/tcp`];\n const out = execFileSync(cmd, args, { encoding: \"utf-8\", timeout: 5000 }).trim();\n if (!out) return false;\n const pids = out.split(/\\s+/).map(Number).filter(p => p > 0 && p !== process.pid);\n if (pids.length === 0) return false;\n for (const pid of pids) {\n try { process.kill(pid, \"SIGKILL\"); } catch (err) { logAndSwallow(TAG, \"kill pid\", err); }\n }\n logInfo(TAG, `healPort(${port}): killed PID ${pids.join(\", \")}`);\n return true;\n } catch (err) {\n logAndSwallow(TAG, \"healPort\", err);\n return false;\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;AAIA;AACA;AAFA,SAAS,oBAAoB;AAI7B,IAAM,MAAM;AAGL,SAAS,SAAS,MAAuB;AAC9C,MAAI;AACF,UAAM,MAAM,QAAQ,aAAa,WAAW,SAAS;AACrD,UAAM,OAAO,QAAQ,aAAa,WAAW,CAAC,OAAO,IAAI,IAAI,EAAE,IAAI,CAAC,GAAG,IAAI,MAAM;AACjF,UAAM,MAAM,aAAa,KAAK,MAAM,EAAE,UAAU,SAAS,SAAS,IAAK,CAAC,EAAE,KAAK;AAC/E,QAAI,CAAC,IAAK,QAAO;AACjB,UAAM,OAAO,IAAI,MAAM,KAAK,EAAE,IAAI,MAAM,EAAE,OAAO,OAAK,IAAI,KAAK,MAAM,QAAQ,GAAG;AAChF,QAAI,KAAK,WAAW,EAAG,QAAO;AAC9B,eAAW,OAAO,MAAM;AACtB,UAAI;AAAE,gBAAQ,KAAK,KAAK,SAAS;AAAA,MAAG,SAAS,KAAK;AAAE,sBAAc,KAAK,YAAY,GAAG;AAAA,MAAG;AAAA,IAC3F;AACA,YAAQ,KAAK,YAAY,IAAI,iBAAiB,KAAK,KAAK,IAAI,CAAC,EAAE;AAC/D,WAAO;AAAA,EACT,SAAS,KAAK;AACZ,kBAAc,KAAK,YAAY,GAAG;AAClC,WAAO;AAAA,EACT;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { createRequire as __bundleCreateRequire } from 'node:module'; import { fileURLToPath as __bundleFileURLToPath } from 'node:url'; import { dirname as __bundleDirname } from 'node:path'; const require = __bundleCreateRequire(import.meta.url); const __chunk_filename = __bundleFileURLToPath(import.meta.url); const __chunk_dirname = __bundleDirname(__chunk_filename);
|
|
2
|
+
import {
|
|
3
|
+
_getStats,
|
|
4
|
+
_reset,
|
|
5
|
+
bumpRead,
|
|
6
|
+
flush,
|
|
7
|
+
init,
|
|
8
|
+
setProvenance
|
|
9
|
+
} from "./chunk-AR6GO6YC.js";
|
|
10
|
+
import "./chunk-FMWKEPM7.js";
|
|
11
|
+
import "./chunk-BUUVFUPO.js";
|
|
12
|
+
import "./chunk-X76UX47U.js";
|
|
13
|
+
import "./chunk-NWDBD4PA.js";
|
|
14
|
+
export {
|
|
15
|
+
_getStats,
|
|
16
|
+
_reset,
|
|
17
|
+
bumpRead,
|
|
18
|
+
flush,
|
|
19
|
+
init,
|
|
20
|
+
setProvenance
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=skill-stats-LLEXEXLR.js.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { createRequire as __bundleCreateRequire } from 'node:module'; import { fileURLToPath as __bundleFileURLToPath } from 'node:url'; import { dirname as __bundleDirname } from 'node:path'; const require = __bundleCreateRequire(import.meta.url); const __chunk_filename = __bundleFileURLToPath(import.meta.url); const __chunk_dirname = __bundleDirname(__chunk_filename);
|
|
2
|
+
import {
|
|
3
|
+
createSleepHandle,
|
|
4
|
+
register
|
|
5
|
+
} from "./chunk-NT3OBORC.js";
|
|
6
|
+
import "./chunk-OP7BTAWY.js";
|
|
7
|
+
import "./chunk-YOCTDKKL.js";
|
|
8
|
+
import "./chunk-CEVRHKJY.js";
|
|
9
|
+
import "./chunk-M6VBAPNT.js";
|
|
10
|
+
import "./chunk-FMWKEPM7.js";
|
|
11
|
+
import "./chunk-JCJS4ZIB.js";
|
|
12
|
+
import "./chunk-BUUVFUPO.js";
|
|
13
|
+
import "./chunk-X76UX47U.js";
|
|
14
|
+
import "./chunk-NWDBD4PA.js";
|
|
15
|
+
export {
|
|
16
|
+
createSleepHandle,
|
|
17
|
+
register
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=sleep-OYIUOVQD.js.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { createRequire as __bundleCreateRequire } from 'node:module'; import { fileURLToPath as __bundleFileURLToPath } from 'node:url'; import { dirname as __bundleDirname } from 'node:path'; const require = __bundleCreateRequire(import.meta.url); const __chunk_filename = __bundleFileURLToPath(import.meta.url); const __chunk_dirname = __bundleDirname(__chunk_filename);
|
|
2
|
+
import {
|
|
3
|
+
loadMinimalSoul,
|
|
4
|
+
loadSoulBundle
|
|
5
|
+
} from "./chunk-UCQ2WC3B.js";
|
|
6
|
+
import "./chunk-GST5T3WZ.js";
|
|
7
|
+
import "./chunk-FMWKEPM7.js";
|
|
8
|
+
import "./chunk-JCJS4ZIB.js";
|
|
9
|
+
import "./chunk-BUUVFUPO.js";
|
|
10
|
+
import "./chunk-X76UX47U.js";
|
|
11
|
+
import "./chunk-NWDBD4PA.js";
|
|
12
|
+
export {
|
|
13
|
+
loadMinimalSoul,
|
|
14
|
+
loadSoulBundle
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=soul-loader-54WCVNLJ.js.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { createRequire as __bundleCreateRequire } from 'node:module'; import { fileURLToPath as __bundleFileURLToPath } from 'node:url'; import { dirname as __bundleDirname } from 'node:path'; const require = __bundleCreateRequire(import.meta.url); const __chunk_filename = __bundleFileURLToPath(import.meta.url); const __chunk_dirname = __bundleDirname(__chunk_filename);
|
|
2
|
+
import {
|
|
3
|
+
require_src
|
|
4
|
+
} from "./chunk-TZHIDLDS.js";
|
|
5
|
+
import "./chunk-HX7Y7EYP.js";
|
|
6
|
+
import "./chunk-NWDBD4PA.js";
|
|
7
|
+
export default require_src();
|
|
8
|
+
//# sourceMappingURL=src-JL4PVO23.js.map
|