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,13 @@
|
|
|
1
|
+
[Unit]
|
|
2
|
+
Description=Abtars Watchdog
|
|
3
|
+
After=network.target
|
|
4
|
+
|
|
5
|
+
[Service]
|
|
6
|
+
Type=simple
|
|
7
|
+
ExecStart=%h/.abtars/watchdog.sh
|
|
8
|
+
Restart=on-failure
|
|
9
|
+
RestartSec=5
|
|
10
|
+
Environment=PATH=%h/.abtars/bin:%h/.local/bin:%h/.npm-global/bin:/usr/local/bin:/usr/bin:/bin
|
|
11
|
+
|
|
12
|
+
[Install]
|
|
13
|
+
WantedBy=default.target
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# abtars.sh — bridge launcher (spawned by watchdog or `abtars start`)
|
|
3
|
+
set -euo pipefail
|
|
4
|
+
|
|
5
|
+
ABTARS_HOME="${ABTARS_HOME:-$HOME/.abtars}"
|
|
6
|
+
CURRENT="$ABTARS_HOME/current/bundle"
|
|
7
|
+
|
|
8
|
+
# Make globally-installed abmind resolvable by the bundle
|
|
9
|
+
GLOBAL_MODULES="$(npm root -g 2>/dev/null || true)"
|
|
10
|
+
ABMIND_LIB="${ABMIND_HOME:-$HOME/.abmind}/lib/node_modules"
|
|
11
|
+
NODE_PATH="${GLOBAL_MODULES:+$GLOBAL_MODULES:}${ABMIND_LIB:+$ABMIND_LIB:}${NODE_PATH:-}"
|
|
12
|
+
export NODE_PATH
|
|
13
|
+
|
|
14
|
+
exec node "$CURRENT/abtars.js" "$@"
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
[Unit]
|
|
2
|
+
Description=Abtars — AI agent bridge for Telegram/Discord
|
|
3
|
+
After=network-online.target
|
|
4
|
+
Wants=network-online.target
|
|
5
|
+
|
|
6
|
+
[Service]
|
|
7
|
+
Type=simple
|
|
8
|
+
User=%i
|
|
9
|
+
WorkingDirectory=%h/.abtars
|
|
10
|
+
ExecStart=%h/.abtars/abtars.sh
|
|
11
|
+
Restart=always
|
|
12
|
+
RestartSec=60
|
|
13
|
+
Environment=NODE_ENV=production
|
|
14
|
+
|
|
15
|
+
# Logging
|
|
16
|
+
StandardOutput=journal
|
|
17
|
+
StandardError=journal
|
|
18
|
+
SyslogIdentifier=abtars
|
|
19
|
+
|
|
20
|
+
[Install]
|
|
21
|
+
WantedBy=default.target
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# Manage the abtars-browser Docker container.
|
|
3
|
+
# Usage:
|
|
4
|
+
# ./scripts/browser-patchright.sh # build + start (headless)
|
|
5
|
+
# ./scripts/browser-patchright.sh start # start only (no build, use existing image)
|
|
6
|
+
# ./scripts/browser-patchright.sh --headed # build + start (visible via WSLg)
|
|
7
|
+
# ./scripts/browser-patchright.sh stop # stop + remove
|
|
8
|
+
# ./scripts/browser-patchright.sh status # check if running
|
|
9
|
+
set -euo pipefail
|
|
10
|
+
|
|
11
|
+
IMAGE="abtars-browser"
|
|
12
|
+
CONTAINER="abtars-browser"
|
|
13
|
+
AB_HOME="${HOME}/.abtars"
|
|
14
|
+
PROJECT_DIR="$(cd "$(dirname "$0")/.." && pwd)"
|
|
15
|
+
SOCKET_DIR="$AB_HOME/browser-socket"
|
|
16
|
+
HEADED=false
|
|
17
|
+
SKIP_BUILD=false
|
|
18
|
+
|
|
19
|
+
CMD=""
|
|
20
|
+
for arg in "$@"; do
|
|
21
|
+
case "$arg" in
|
|
22
|
+
--headed) HEADED=true ;;
|
|
23
|
+
start) CMD="start"; SKIP_BUILD=true ;;
|
|
24
|
+
*) CMD="$arg" ;;
|
|
25
|
+
esac
|
|
26
|
+
done
|
|
27
|
+
|
|
28
|
+
run_container() {
|
|
29
|
+
docker rm -f "$CONTAINER" 2>/dev/null || true
|
|
30
|
+
mkdir -p "$SOCKET_DIR"
|
|
31
|
+
|
|
32
|
+
echo "🚀 Starting $CONTAINER..."
|
|
33
|
+
EXTRA_ARGS=""
|
|
34
|
+
if [ "$HEADED" = true ]; then
|
|
35
|
+
EXTRA_ARGS="-e DISPLAY=$DISPLAY -e BROWSER_HEADED=1 -v /tmp/.X11-unix:/tmp/.X11-unix"
|
|
36
|
+
echo " 👁️ Headed mode — browser visible via WSLg"
|
|
37
|
+
fi
|
|
38
|
+
docker run -d \
|
|
39
|
+
--name "$CONTAINER" \
|
|
40
|
+
--restart unless-stopped \
|
|
41
|
+
--user "$(id -u):$(id -g)" \
|
|
42
|
+
-v "$SOCKET_DIR:/run/browser" \
|
|
43
|
+
-v "$AB_HOME/secret/cookies:/run/browser/cookies:ro" \
|
|
44
|
+
-e BROWSER_SOCKET_PATH=/run/browser/browser.sock \
|
|
45
|
+
-e BROWSER_CHANNEL="${BROWSER_CHANNEL:-chrome}" \
|
|
46
|
+
-e BROWSER_ALLOWED_DOMAINS="${BROWSER_ALLOWED_DOMAINS:-}" \
|
|
47
|
+
$EXTRA_ARGS \
|
|
48
|
+
"$IMAGE"
|
|
49
|
+
|
|
50
|
+
echo "✅ Browser container running — socket at $SOCKET_DIR/browser.sock"
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
case "${CMD:-help}" in
|
|
54
|
+
stop)
|
|
55
|
+
docker rm -f "$CONTAINER" 2>/dev/null && echo "Stopped $CONTAINER" || echo "Not running"
|
|
56
|
+
;;
|
|
57
|
+
status)
|
|
58
|
+
docker ps --filter "name=$CONTAINER" --format "{{.Status}}" | grep -q . \
|
|
59
|
+
&& echo "Running" || echo "Not running"
|
|
60
|
+
;;
|
|
61
|
+
start)
|
|
62
|
+
run_container
|
|
63
|
+
;;
|
|
64
|
+
build)
|
|
65
|
+
echo "🔨 Building $IMAGE..."
|
|
66
|
+
DOCKER_BUILDKIT=0 docker build -t "$IMAGE" -f "$PROJECT_DIR/docker/browser/Dockerfile" "$PROJECT_DIR" 2>&1 | tail -5
|
|
67
|
+
run_container
|
|
68
|
+
;;
|
|
69
|
+
*)
|
|
70
|
+
echo "Usage: $0 <command> [--headed]"
|
|
71
|
+
echo ""
|
|
72
|
+
echo "Commands:"
|
|
73
|
+
echo " build Build image + start container"
|
|
74
|
+
echo " start Start container (existing image)"
|
|
75
|
+
echo " stop Stop + remove container"
|
|
76
|
+
echo " status Check if running"
|
|
77
|
+
exit 1
|
|
78
|
+
;;
|
|
79
|
+
esac
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
3
|
+
<plist version="1.0">
|
|
4
|
+
<dict>
|
|
5
|
+
<key>Label</key><string>com.abtars.daemon</string>
|
|
6
|
+
<key>UserName</key><string>{{USER}}</string>
|
|
7
|
+
<key>GroupName</key><string>{{GROUP}}</string>
|
|
8
|
+
<key>WorkingDirectory</key><string>/Users/{{USER}}/.abtars</string>
|
|
9
|
+
<key>ProgramArguments</key>
|
|
10
|
+
<array>
|
|
11
|
+
<string>/Users/{{USER}}/.abtars/watchdog.sh</string>
|
|
12
|
+
</array>
|
|
13
|
+
<key>KeepAlive</key><true/>
|
|
14
|
+
<key>RunAtLoad</key><true/>
|
|
15
|
+
<key>StandardOutPath</key><string>/Users/{{USER}}/.abtars/logs/daemon.out.log</string>
|
|
16
|
+
<key>StandardErrorPath</key><string>/Users/{{USER}}/.abtars/logs/daemon.err.log</string>
|
|
17
|
+
<key>EnvironmentVariables</key>
|
|
18
|
+
<dict>
|
|
19
|
+
<key>ABTARS_HOME</key><string>/Users/{{USER}}/.abtars</string>
|
|
20
|
+
<key>ABMIND_HOME</key><string>/Users/{{USER}}/.abmind</string>
|
|
21
|
+
<key>SUPERVISION</key><string>launchd</string>
|
|
22
|
+
</dict>
|
|
23
|
+
</dict>
|
|
24
|
+
</plist>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
3
|
+
<plist version="1.0">
|
|
4
|
+
<dict>
|
|
5
|
+
<key>Label</key>
|
|
6
|
+
<string>com.abtars.watchdog</string>
|
|
7
|
+
<key>ProgramArguments</key>
|
|
8
|
+
<array>
|
|
9
|
+
<string>{{HOME}}/.abtars/watchdog.sh</string>
|
|
10
|
+
</array>
|
|
11
|
+
<key>RunAtLoad</key>
|
|
12
|
+
<true/>
|
|
13
|
+
<key>KeepAlive</key>
|
|
14
|
+
<true/>
|
|
15
|
+
<key>ThrottleInterval</key>
|
|
16
|
+
<integer>10</integer>
|
|
17
|
+
<key>StandardOutPath</key>
|
|
18
|
+
<string>{{HOME}}/.abtars/logs/watchdog-launchd.log</string>
|
|
19
|
+
<key>StandardErrorPath</key>
|
|
20
|
+
<string>{{HOME}}/.abtars/logs/watchdog-launchd.log</string>
|
|
21
|
+
<key>EnvironmentVariables</key>
|
|
22
|
+
<dict>
|
|
23
|
+
<key>PATH</key>
|
|
24
|
+
<string>{{HOME}}/.abtars/bin:{{HOME}}/.local/bin:{{HOME}}/.npm-global/bin:/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin</string>
|
|
25
|
+
</dict>
|
|
26
|
+
</dict>
|
|
27
|
+
</plist>
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
set -euo pipefail
|
|
3
|
+
|
|
4
|
+
AB="$HOME/.abtars"
|
|
5
|
+
ABMIND="${ABMIND_HOME:-$HOME/.abmind}"
|
|
6
|
+
DEST="$HOME/.backup-abtars"
|
|
7
|
+
DATE=$(date +%Y%m%d)
|
|
8
|
+
|
|
9
|
+
mkdir -p "$DEST"
|
|
10
|
+
|
|
11
|
+
# WAL-safe memory.db backup via sqlite3
|
|
12
|
+
DB="$ABMIND/memory/memory.db"
|
|
13
|
+
DB_TMP="$DEST/.memory-$DATE.db"
|
|
14
|
+
if [ -f "$DB" ] && command -v sqlite3 &>/dev/null; then
|
|
15
|
+
sqlite3 "$DB" ".backup '$DB_TMP'"
|
|
16
|
+
fi
|
|
17
|
+
|
|
18
|
+
# Zip backup: abtars config/skills + abmind core/memory
|
|
19
|
+
cd "$AB"
|
|
20
|
+
zip -qr "$DEST/abtars-$DATE.zip" \
|
|
21
|
+
config/ secret/ skills/ prompts/ tasks/ topics/ reports/ finance/ core/ \
|
|
22
|
+
-x "config/.env.skills" 2>/dev/null || true
|
|
23
|
+
|
|
24
|
+
# Add abmind memory/core + sleep reports
|
|
25
|
+
if [ -d "$ABMIND/memory" ]; then
|
|
26
|
+
cd "$ABMIND"
|
|
27
|
+
zip -qr "$DEST/abtars-$DATE.zip" \
|
|
28
|
+
memory/core/ memory/sleep/ 2>/dev/null || true
|
|
29
|
+
fi
|
|
30
|
+
|
|
31
|
+
# Add the WAL-safe DB copy
|
|
32
|
+
if [ -f "$DB_TMP" ]; then
|
|
33
|
+
cd "$DEST"
|
|
34
|
+
zip -qj "$DEST/abtars-$DATE.zip" "$DB_TMP"
|
|
35
|
+
rm -f "$DB_TMP"
|
|
36
|
+
fi
|
|
37
|
+
|
|
38
|
+
# Encrypted DB backup
|
|
39
|
+
mkdir -p "$AB/backup"
|
|
40
|
+
DB_KEY="$AB/secret/db.key"
|
|
41
|
+
if [ -f "$DB_KEY" ] && [ -f "$DB" ]; then
|
|
42
|
+
sqlite3 "$DB" ".backup '$AB/backup/memory.db.tmp'"
|
|
43
|
+
openssl enc -aes-256-cbc -pbkdf2 -salt -pass "file:$DB_KEY" \
|
|
44
|
+
-in "$AB/backup/memory.db.tmp" -out "$AB/backup/memory.db.enc"
|
|
45
|
+
rm -f "$AB/backup/memory.db.tmp"
|
|
46
|
+
fi
|
|
47
|
+
|
|
48
|
+
# Prune >7 days
|
|
49
|
+
find "$DEST" -name "abtars-*.zip" -mtime +7 -delete
|
|
50
|
+
|
|
51
|
+
# DoD: verify zip contains memory DB and is reasonable size
|
|
52
|
+
ZIP="$DEST/abtars-$DATE.zip"
|
|
53
|
+
if ! unzip -l "$ZIP" 2>/dev/null | grep -q "memory.*\.db"; then
|
|
54
|
+
echo "ERROR: backup zip missing memory.db" >&2
|
|
55
|
+
exit 1
|
|
56
|
+
fi
|
|
57
|
+
MIN_SIZE=100000 # 100KB minimum
|
|
58
|
+
ACTUAL=$(stat -f%z "$ZIP" 2>/dev/null || stat -c%s "$ZIP" 2>/dev/null || echo 0)
|
|
59
|
+
if [ "$ACTUAL" -lt "$MIN_SIZE" ]; then
|
|
60
|
+
echo "ERROR: backup zip too small (${ACTUAL} bytes)" >&2
|
|
61
|
+
exit 1
|
|
62
|
+
fi
|