@askexenow/exe-os 0.9.267 → 0.9.268
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/deploy/compose/.env.customer.example +10 -0
- package/deploy/compose/docker-compose.yml +5 -6
- package/dist/active-agent-CA6YCKRU.js +25 -0
- package/dist/active-agent-S55CV6MK.js +26 -0
- package/dist/active-agent-T4IMZLH4.js +25 -0
- package/dist/active-agent-USYNCT45.js +26 -0
- package/dist/agentic-ontology-AZVW3ZYE.js +25 -0
- package/dist/backfill-metadata-556UWRQK.js +597 -0
- package/dist/backfill-metadata-Q5QBN45Z.js +597 -0
- package/dist/behaviors-CPS3PGWK.js +25 -0
- package/dist/bin/agentic-ontology-backfill.js +5 -5
- package/dist/bin/agentic-reflection-backfill.js +6 -6
- package/dist/bin/agentic-semantic-label.js +5 -5
- package/dist/bin/backfill-conversations.js +5 -5
- package/dist/bin/backfill-responses.js +5 -5
- package/dist/bin/backfill-vectors.js +6 -6
- package/dist/bin/bulk-sync-postgres.js +6 -6
- package/dist/bin/cc-doctor.js +4 -4
- package/dist/bin/cleanup-stale-review-tasks.js +9 -9
- package/dist/bin/cli.js +16 -16
- package/dist/bin/exe-agent-config.js +2 -2
- package/dist/bin/exe-agent.js +4 -4
- package/dist/bin/exe-assign.js +7 -7
- package/dist/bin/exe-boot.js +16 -16
- package/dist/bin/exe-call.js +4 -4
- package/dist/bin/exe-cloud.js +4 -4
- package/dist/bin/exe-dispatch.js +9 -9
- package/dist/bin/exe-doctor.js +1 -1
- package/dist/bin/exe-export-behaviors.js +7 -7
- package/dist/bin/exe-forget.js +6 -6
- package/dist/bin/exe-gateway.js +7 -7
- package/dist/bin/exe-healthcheck.js +4 -4
- package/dist/bin/exe-heartbeat.js +9 -9
- package/dist/bin/exe-kill.js +12 -12
- package/dist/bin/exe-launch-agent.js +16 -16
- package/dist/bin/exe-new-employee.js +6 -6
- package/dist/bin/exe-pending-messages.js +10 -10
- package/dist/bin/exe-pending-notifications.js +9 -9
- package/dist/bin/exe-pending-reviews.js +9 -9
- package/dist/bin/exe-rename.js +4 -4
- package/dist/bin/exe-review.js +11 -11
- package/dist/bin/exe-search.js +5 -5
- package/dist/bin/exe-session-cleanup.js +14 -14
- package/dist/bin/exe-settings.js +4 -4
- package/dist/bin/exe-start-codex.js +11 -11
- package/dist/bin/exe-start-opencode.js +8 -8
- package/dist/bin/exe-status.js +10 -10
- package/dist/bin/exe-team.js +3 -3
- package/dist/bin/git-sweep.js +10 -10
- package/dist/bin/graph-backfill.js +4 -4
- package/dist/bin/graph-export.js +5 -5
- package/dist/bin/import-history.js +7 -7
- package/dist/bin/install.js +6 -6
- package/dist/bin/intercom-check.js +4 -4
- package/dist/bin/mcp-sessions.js +2 -2
- package/dist/bin/orchestration-metrics.js +4 -4
- package/dist/bin/postgres-agentic-reflection-backfill.js +2 -2
- package/dist/bin/postgres-agentic-semantic-backfill.js +1 -1
- package/dist/bin/scan-tasks.js +9 -9
- package/dist/bin/setup.js +1 -1
- package/dist/bin/shard-migrate.js +4 -4
- package/dist/bin/stack-update.js +2 -2
- package/dist/bin/vps-health-gate.js +1 -1
- package/dist/capacity-monitor-WP4XXR7R.js +49 -0
- package/dist/capacity-monitor-ZGQ54TJG.js +49 -0
- package/dist/catchup-brief-X6O7W2YR.js +151 -0
- package/dist/catchup-brief-Z7SNTGLV.js +151 -0
- package/dist/chunk-23MJ2AJJ.js +227 -0
- package/dist/chunk-2NIJORQE.js +1335 -0
- package/dist/chunk-32RG5ZJN.js +3955 -0
- package/dist/chunk-3VTC7TJF.js +128 -0
- package/dist/chunk-3ZXL2KBT.js +1073 -0
- package/dist/chunk-44MXQ47E.js +185 -0
- package/dist/chunk-474SY5VD.js +159 -0
- package/dist/chunk-4LMI7RAW.js +1345 -0
- package/dist/chunk-4OH73UXH.js +1090 -0
- package/dist/chunk-4TOJXBXG.js +1073 -0
- package/dist/chunk-52UCKTIS.js +333 -0
- package/dist/chunk-5CHJKN6Y.js +668 -0
- package/dist/chunk-5MOYMGS5.js +818 -0
- package/dist/chunk-5ZSES6UA.js +363 -0
- package/dist/chunk-6HTXA4IM.js +394 -0
- package/dist/chunk-6L5DS7XO.js +394 -0
- package/dist/chunk-6TZCFZNG.js +171 -0
- package/dist/chunk-6WKV4F6L.js +1021 -0
- package/dist/chunk-7EOWAMTZ.js +69 -0
- package/dist/chunk-7MKEEX3T.js +2091 -0
- package/dist/chunk-7QYTIVXO.js +1051 -0
- package/dist/chunk-7SLLNRR3.js +129 -0
- package/dist/chunk-7V53QH5T.js +204 -0
- package/dist/chunk-7XDVTUTI.js +50 -0
- package/dist/chunk-A2E2TBDU.js +330 -0
- package/dist/chunk-A4DKFB77.js +159 -0
- package/dist/chunk-AUUJONUS.js +58 -0
- package/dist/chunk-B4YGGOCL.js +284 -0
- package/dist/chunk-BVYP37Y3.js +1345 -0
- package/dist/chunk-BXY5Y3RI.js +3955 -0
- package/dist/chunk-C3MK24X5.js +13696 -0
- package/dist/chunk-C74ZXYPJ.js +123 -0
- package/dist/chunk-CBO7IM7Q.js +135 -0
- package/dist/chunk-DIZLK77N.js +240 -0
- package/dist/chunk-DLTODKBW.js +1921 -0
- package/dist/chunk-DNJVH7A7.js +221 -0
- package/dist/chunk-E2FPTCL5.js +297 -0
- package/dist/chunk-E5USG7Z4.js +54 -0
- package/dist/chunk-E64IJVDT.js +85 -0
- package/dist/chunk-EFGQ72GA.js +76 -0
- package/dist/chunk-EODAYF7M.js +97 -0
- package/dist/chunk-EOKBXGMP.js +495 -0
- package/dist/chunk-EPYHCDZZ.js +551 -0
- package/dist/chunk-FHLIK2XG.js +38 -0
- package/dist/chunk-FO6CLTAL.js +128 -0
- package/dist/chunk-FSBNZ5YU.js +244 -0
- package/dist/chunk-FSGO7ADD.js +333 -0
- package/dist/chunk-G5L6YLG4.js +85 -0
- package/dist/chunk-GHPZEKDK.js +447 -0
- package/dist/chunk-GLSNVF6N.js +97 -0
- package/dist/chunk-GQ2XYRG3.js +163 -0
- package/dist/chunk-HGTXRRBK.js +230 -0
- package/dist/chunk-HILKCYA4.js +97 -0
- package/dist/chunk-HYI4PN4J.js +1148 -0
- package/dist/chunk-IDMLHBCK.js +1090 -0
- package/dist/chunk-IOVGBFTA.js +159 -0
- package/dist/chunk-ISAHJV4Z.js +346 -0
- package/dist/chunk-IXQ3XIG2.js +197 -0
- package/dist/chunk-JJ4VDZ5E.js +377 -0
- package/dist/chunk-JJOBSWJY.js +214 -0
- package/dist/chunk-JNRIWD5S.js +604 -0
- package/dist/chunk-JP45GCVR.js +630 -0
- package/dist/chunk-JWMFB6XM.js +244 -0
- package/dist/chunk-K7W4TYMT.js +33 -0
- package/dist/chunk-KFYOA37Q.js +562 -0
- package/dist/chunk-KUACUU74.js +58 -0
- package/dist/chunk-LHBWJIFR.js +290 -0
- package/dist/chunk-LMUDBSYR.js +551 -0
- package/dist/chunk-LSV3ODBA.js +13696 -0
- package/dist/chunk-M7GR2WO4.js +81 -0
- package/dist/chunk-MCBSXDR4.js +513 -0
- package/dist/chunk-MGJ2Z7QJ.js +127 -0
- package/dist/chunk-MUA24YMF.js +382 -0
- package/dist/chunk-MWDTPILI.js +204 -0
- package/dist/chunk-N4OGW6LW.js +731 -0
- package/dist/chunk-NBXL2BL5.js +330 -0
- package/dist/chunk-NT6A3EBV.js +1051 -0
- package/dist/chunk-ONEJTZID.js +348 -0
- package/dist/chunk-OREDDY5Y.js +513 -0
- package/dist/chunk-OSXQTCW5.js +55 -0
- package/dist/chunk-P2Q6UT2C.js +128 -0
- package/dist/chunk-PDIODWQM.js +731 -0
- package/dist/chunk-Q3NKXRHX.js +30 -0
- package/dist/chunk-QIEJRCF3.js +1148 -0
- package/dist/chunk-QILNBNN2.js +284 -0
- package/dist/chunk-QS7R2M4A.js +54 -0
- package/dist/chunk-RSIDQBIG.js +210 -0
- package/dist/chunk-SD6UFZRH.js +280 -0
- package/dist/chunk-SDL5IADB.js +76 -0
- package/dist/chunk-SFSGDC7D.js +81 -0
- package/dist/chunk-SHXHDHAX.js +127 -0
- package/dist/chunk-SQ5NFDBG.js +197 -0
- package/dist/chunk-SR34TKRT.js +214 -0
- package/dist/chunk-SYKAF5B3.js +185 -0
- package/dist/chunk-T2WWBFOX.js +447 -0
- package/dist/chunk-TINMRD3X.js +157 -0
- package/dist/chunk-TMV776ZJ.js +244 -0
- package/dist/chunk-TN45CTOI.js +70 -0
- package/dist/chunk-TYXB66FM.js +56 -0
- package/dist/chunk-UNCGZXPU.js +3556 -0
- package/dist/chunk-VAYBTLN4.js +50 -0
- package/dist/chunk-VGYL7CN2.js +260 -0
- package/dist/chunk-VIGJN5ZP.js +75 -0
- package/dist/chunk-WCFKKE7C.js +1921 -0
- package/dist/chunk-WEUOMPUC.js +346 -0
- package/dist/chunk-WRL6CIH2.js +262 -0
- package/dist/chunk-WS77NXRB.js +89 -0
- package/dist/chunk-XSRBNOLY.js +377 -0
- package/dist/chunk-XZLMH7QF.js +371 -0
- package/dist/chunk-YAITGMJO.js +89 -0
- package/dist/chunk-YDT3SUWK.js +171 -0
- package/dist/chunk-YG77F6MB.js +382 -0
- package/dist/chunk-YLWI3SAX.js +495 -0
- package/dist/chunk-YML4D7JL.js +818 -0
- package/dist/co-activation-V4G7RCBA.js +72 -0
- package/dist/co-occurrence-7AQY66CT.js +74 -0
- package/dist/code-context-index-GWAZ4PKV.js +30 -0
- package/dist/core-memory-FEVKN2AT.js +110 -0
- package/dist/core-memory-ISYNYO7T.js +110 -0
- package/dist/crdt-sync-INN5CLWY.js +33 -0
- package/dist/crm-webhook-2WGEYYAM.js +10 -0
- package/dist/crm-webhook-D7IORFLD.js +10 -0
- package/dist/cto-delegation-gate-2CMVCQW4.js +206 -0
- package/dist/cto-delegation-gate-DIMFA42F.js +206 -0
- package/dist/daemon-orchestration-G5HGOMGQ.js +135 -0
- package/dist/daemon-orchestration-IDK4LYVS.js +135 -0
- package/dist/db-backup-QDXIAYHX.js +33 -0
- package/dist/dreaming-A5QYLE67.js +32 -0
- package/dist/dreaming-CPFMD5SH.js +32 -0
- package/dist/entity-boost-BEVW2KFT.js +356 -0
- package/dist/exe-drift-Y6SN4EXZ.js +68 -0
- package/dist/exe-export-K4ZU3KZO.js +73 -0
- package/dist/exe-export-MZXEN45T.js +73 -0
- package/dist/exe-import-PWVIL5NW.js +76 -0
- package/dist/exe-import-R3AKAHWQ.js +76 -0
- package/dist/exe-key-BQVOD3YE.js +579 -0
- package/dist/exe-key-HXOWRGJT.js +579 -0
- package/dist/exe-snapshot-6URR2ANA.js +164 -0
- package/dist/exe-snapshot-C5JSC536.js +164 -0
- package/dist/fast-db-init-2CWMIQWR.js +7 -0
- package/dist/fast-db-init-UVZ2J5GS.js +7 -0
- package/dist/gateway/index.js +8 -8
- package/dist/git-staleness-VM6FPEQB.js +110 -0
- package/dist/git-task-sweep-ANHNEX7E.js +40 -0
- package/dist/git-task-sweep-R5BYJC3Y.js +40 -0
- package/dist/global-procedures-TLT6PO6L.js +20 -0
- package/dist/graph-auto-extract-BULI4PBB.js +162 -0
- package/dist/hooks/bug-report-worker.js +11 -11
- package/dist/hooks/codex-stop-task-finalizer.js +11 -11
- package/dist/hooks/commit-complete.js +11 -11
- package/dist/hooks/error-recall.js +6 -6
- package/dist/hooks/exe-heartbeat-hook.js +3 -3
- package/dist/hooks/ingest-worker.js +2 -2
- package/dist/hooks/ingest.js +6 -6
- package/dist/hooks/instructions-loaded.js +4 -4
- package/dist/hooks/manifest.json +20 -20
- package/dist/hooks/notification.js +4 -4
- package/dist/hooks/post-compact.js +10 -10
- package/dist/hooks/post-tool-combined.js +6 -6
- package/dist/hooks/pre-compact.js +13 -13
- package/dist/hooks/pre-tool-use.js +14 -14
- package/dist/hooks/prompt-submit.js +21 -21
- package/dist/hooks/session-end.js +18 -18
- package/dist/hooks/session-start.js +10 -10
- package/dist/hooks/stop.js +17 -17
- package/dist/hooks/subagent-stop.js +10 -10
- package/dist/hooks/summary-worker.js +16 -16
- package/dist/index.js +17 -17
- package/dist/installer-BEMMHBG5.js +342 -0
- package/dist/installer-CZWRBJ3Y.js +38 -0
- package/dist/installer-H43E54BM.js +38 -0
- package/dist/installer-HXKOP4YR.js +296 -0
- package/dist/installer-JAEYJUZW.js +342 -0
- package/dist/installer-ZPA6QLAX.js +296 -0
- package/dist/lib/cloud-sync.js +4 -4
- package/dist/lib/consolidation.js +5 -5
- package/dist/lib/database.js +2 -2
- package/dist/lib/db-daemon-client.js +1 -1
- package/dist/lib/db.js +2 -2
- package/dist/lib/embedder.js +2 -2
- package/dist/lib/employee-templates.js +4 -4
- package/dist/lib/employees.js +2 -2
- package/dist/lib/exe-daemon-client.js +1 -1
- package/dist/lib/exe-daemon.js +35 -35
- package/dist/lib/hybrid-search.js +5 -5
- package/dist/lib/identity.js +2 -2
- package/dist/lib/messaging.js +9 -9
- package/dist/lib/reminders.js +3 -3
- package/dist/lib/schedules.js +5 -5
- package/dist/lib/session-registry.js +4 -4
- package/dist/lib/skill-learning.js +4 -4
- package/dist/lib/store.js +4 -4
- package/dist/lib/task-router.js +3 -3
- package/dist/lib/tasks.js +10 -10
- package/dist/lib/tmux-routing.js +8 -8
- package/dist/lib/token-spend.js +3 -3
- package/dist/mcp/register-tools.js +57 -57
- package/dist/mcp/server.js +58 -58
- package/dist/mcp/tools/complete-reminder.js +4 -4
- package/dist/mcp/tools/create-reminder.js +4 -4
- package/dist/mcp/tools/create-task.js +12 -12
- package/dist/mcp/tools/deactivate-behavior.js +5 -5
- package/dist/mcp/tools/list-reminders.js +4 -4
- package/dist/mcp/tools/list-tasks.js +12 -12
- package/dist/mcp/tools/send-message.js +11 -11
- package/dist/mcp/tools/update-task.js +11 -11
- package/dist/mcp-http-config-44D7MOF6.js +27 -0
- package/dist/mcp-http-config-TCDXI6LL.js +27 -0
- package/dist/memory-cards-NNFQKOQI.js +174 -0
- package/dist/memory-graph-extractor-6VIBIUZM.js +17 -0
- package/dist/memory-poisoning-defense-P6WG3SNX.js +225 -0
- package/dist/memory-queue-client-O57KWE6B.js +16 -0
- package/dist/memory-reflection-FDJQ5ZDA.js +238 -0
- package/dist/message-queue-client-NITLPOBU.js +92 -0
- package/dist/notifications-4NS7LYYR.js +45 -0
- package/dist/notifications-L4NHSF2U.js +45 -0
- package/dist/orchestration-events-SSAWHTVL.js +25 -0
- package/dist/orchestrator-P3BTGGVB.js +33 -0
- package/dist/orchestrator-WNQFM4DU.js +33 -0
- package/dist/pipeline-router-AYPUBNHD.js +13 -0
- package/dist/pipeline-router-I7SA5NCJ.js +13 -0
- package/dist/plan-limits-GW3HHMGQ.js +26 -0
- package/dist/project-boot-TLNZDC2S.js +299 -0
- package/dist/projection-worker-MZFBSWCU.js +964 -0
- package/dist/reranker-IP2FXTLK.js +19 -0
- package/dist/reranker-RZB6XAOK.js +19 -0
- package/dist/review-polling-PRKTKLVD.js +124 -0
- package/dist/review-polling-TLFRX3H3.js +124 -0
- package/dist/runtime/index.js +11 -11
- package/dist/session-events-SOGVDZH6.js +36 -0
- package/dist/session-events-WHSKIP26.js +36 -0
- package/dist/session-kill-telemetry-AHFZUYJG.js +29 -0
- package/dist/session-scope-DNCP34ND.js +86 -0
- package/dist/session-scope-YWB765YV.js +86 -0
- package/dist/setup-wizard-IZSKLVWW.js +12 -0
- package/dist/skill-refinement-34DIUMPK.js +157 -0
- package/dist/skill-refinement-KB7RN46L.js +157 -0
- package/dist/stack-update-PQGX7KLH.js +52 -0
- package/dist/steward-gate-GX35HOTT.js +13 -0
- package/dist/task-enforcement-7NLUA7NZ.js +333 -0
- package/dist/task-enforcement-CO3UKUD3.js +333 -0
- package/dist/task-scope-4NTALPYO.js +35 -0
- package/dist/task-scope-J4QQT3DP.js +35 -0
- package/dist/tasks-crud-OJNNAL4F.js +77 -0
- package/dist/tasks-crud-T5DP4DUU.js +77 -0
- package/dist/tasks-notify-22255SAJ.js +38 -0
- package/dist/tasks-notify-ZVA4WIY5.js +38 -0
- package/dist/tasks-review-HMSWMG5X.js +47 -0
- package/dist/tasks-review-ODCDMDYP.js +47 -0
- package/dist/telemetry-upload-LCDD763H.js +739 -0
- package/dist/telemetry-upload-ZJOGSCD3.js +739 -0
- package/dist/token-budget-KQDJ5ZE5.js +84 -0
- package/dist/tool-capability-index-ZDDBVQT5.js +10 -0
- package/dist/tool-telemetry-AAUJQIIB.js +17 -0
- package/dist/tui/App.js +16 -16
- package/dist/tui-data-OYJAJYE4.js +258 -0
- package/dist/tui-data-QFMDLK6B.js +258 -0
- package/dist/wiki-acl-SH3BRQC2.js +111 -0
- package/dist/worker-gate-C366DEJR.js +21 -0
- package/dist/worker-gate-UZKHTBG7.js +21 -0
- package/dist/workflow-engine-5WGLCTKB.js +28 -0
- package/dist/workflow-engine-LNQ6G5E2.js +28 -0
- package/dist/worktree-BD7NDIDS.js +26 -0
- package/dist/worktree-sweep-6QFFMZUV.js +19 -0
- package/package.json +2 -2
- package/release-notes.json +30 -13
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getClient
|
|
3
|
+
} from "./chunk-UNCGZXPU.js";
|
|
4
|
+
|
|
5
|
+
// src/lib/behaviors.ts
|
|
6
|
+
import crypto from "crypto";
|
|
7
|
+
async function storeBehavior(opts) {
|
|
8
|
+
try {
|
|
9
|
+
const { loadEmployeesSync, baseAgentName } = await import("./lib/employees.js");
|
|
10
|
+
const roster = loadEmployeesSync();
|
|
11
|
+
if (roster.length > 0) {
|
|
12
|
+
const base = baseAgentName(opts.agentId, roster);
|
|
13
|
+
if (!roster.some((e) => e.name === opts.agentId || e.name === base)) {
|
|
14
|
+
process.stderr.write(
|
|
15
|
+
`[behaviors] WARNING: Agent "${opts.agentId}" not found in roster. Storing behavior anyway \u2014 may be orphaned.
|
|
16
|
+
`
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
} catch {
|
|
21
|
+
}
|
|
22
|
+
const client = getClient();
|
|
23
|
+
const id = crypto.randomUUID();
|
|
24
|
+
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
25
|
+
const duplicate = await client.execute({
|
|
26
|
+
sql: `SELECT id FROM behaviors
|
|
27
|
+
WHERE agent_id = ?
|
|
28
|
+
AND COALESCE(domain, '') = COALESCE(?, '')
|
|
29
|
+
AND COALESCE(project_name, '') = COALESCE(?, '')
|
|
30
|
+
AND active = 1
|
|
31
|
+
AND lower(trim(content)) = lower(trim(?))
|
|
32
|
+
ORDER BY updated_at DESC
|
|
33
|
+
LIMIT 1`,
|
|
34
|
+
args: [opts.agentId, opts.domain ?? null, opts.projectName ?? null, opts.content]
|
|
35
|
+
});
|
|
36
|
+
const existingId = duplicate.rows[0]?.id;
|
|
37
|
+
if (existingId) return String(existingId);
|
|
38
|
+
let vector = null;
|
|
39
|
+
if (!process.env.VITEST) {
|
|
40
|
+
try {
|
|
41
|
+
const { embed } = await import("./lib/embedder.js");
|
|
42
|
+
const vec = await embed(opts.content);
|
|
43
|
+
vector = new Float32Array(vec);
|
|
44
|
+
} catch {
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
let createdByDevice = null;
|
|
48
|
+
try {
|
|
49
|
+
const { loadDeviceId } = await import("./lib/license.js");
|
|
50
|
+
createdByDevice = loadDeviceId() ?? null;
|
|
51
|
+
} catch {
|
|
52
|
+
}
|
|
53
|
+
const createdByAgent = process.env.AGENT_ID ?? null;
|
|
54
|
+
const sourceSessionId = process.env.CLAUDE_SESSION_ID ?? process.env.SESSION_ID ?? null;
|
|
55
|
+
let deviceId = null;
|
|
56
|
+
if (opts.deviceScoped) {
|
|
57
|
+
try {
|
|
58
|
+
const { loadDeviceId } = await import("./lib/license.js");
|
|
59
|
+
deviceId = loadDeviceId() ?? null;
|
|
60
|
+
} catch {
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
await client.execute({
|
|
64
|
+
sql: `INSERT INTO behaviors (id, agent_id, project_name, domain, priority, content, active, created_at, updated_at, vector, created_by_agent, created_by_device, source_session_id, device_id)
|
|
65
|
+
VALUES (?, ?, ?, ?, ?, ?, 1, ?, ?, ?, ?, ?, ?, ?)`,
|
|
66
|
+
args: [id, opts.agentId, opts.projectName ?? null, opts.domain ?? null, opts.priority ?? "p1", opts.content, now, now, vector ? vector.buffer : null, createdByAgent, createdByDevice, sourceSessionId, deviceId]
|
|
67
|
+
});
|
|
68
|
+
return id;
|
|
69
|
+
}
|
|
70
|
+
async function listBehaviors(agentId, projectName, limit = 30) {
|
|
71
|
+
const client = getClient();
|
|
72
|
+
let currentDeviceId = null;
|
|
73
|
+
try {
|
|
74
|
+
const { loadDeviceId } = await import("./lib/license.js");
|
|
75
|
+
currentDeviceId = loadDeviceId() ?? null;
|
|
76
|
+
} catch {
|
|
77
|
+
}
|
|
78
|
+
const result = await client.execute({
|
|
79
|
+
sql: `SELECT id, agent_id, project_name, domain, priority, content, active, created_at, updated_at, vector, created_by_agent, created_by_device, source_session_id, device_id
|
|
80
|
+
FROM behaviors
|
|
81
|
+
WHERE agent_id = ? AND active = 1
|
|
82
|
+
AND (project_name IS NULL OR project_name = ?)
|
|
83
|
+
AND (device_id IS NULL OR device_id = ?)
|
|
84
|
+
ORDER BY
|
|
85
|
+
CASE WHEN priority = 'p0' THEN 0
|
|
86
|
+
WHEN priority = 'p1' THEN 1
|
|
87
|
+
ELSE 2 END,
|
|
88
|
+
CASE
|
|
89
|
+
WHEN lower(coalesce(domain, '')) IN ('identity', 'title', 'role') THEN 0
|
|
90
|
+
WHEN lower(content) LIKE '%identity%' THEN 0
|
|
91
|
+
WHEN lower(content) LIKE '%title%' THEN 0
|
|
92
|
+
WHEN lower(content) LIKE '%who are you%' THEN 0
|
|
93
|
+
ELSE 1
|
|
94
|
+
END,
|
|
95
|
+
updated_at DESC
|
|
96
|
+
LIMIT ?`,
|
|
97
|
+
args: [agentId, projectName ?? "", currentDeviceId ?? "", limit]
|
|
98
|
+
});
|
|
99
|
+
return result.rows.map((r) => ({
|
|
100
|
+
id: String(r.id),
|
|
101
|
+
agent_id: String(r.agent_id),
|
|
102
|
+
project_name: r.project_name ? String(r.project_name) : null,
|
|
103
|
+
domain: r.domain ? String(r.domain) : null,
|
|
104
|
+
priority: String(r.priority || "p1"),
|
|
105
|
+
content: String(r.content),
|
|
106
|
+
active: Number(r.active),
|
|
107
|
+
created_at: String(r.created_at),
|
|
108
|
+
updated_at: String(r.updated_at),
|
|
109
|
+
vector: r.vector ? Array.from(new Float32Array(r.vector)) : null,
|
|
110
|
+
created_by_agent: r.created_by_agent ? String(r.created_by_agent) : null,
|
|
111
|
+
created_by_device: r.created_by_device ? String(r.created_by_device) : null,
|
|
112
|
+
source_session_id: r.source_session_id ? String(r.source_session_id) : null,
|
|
113
|
+
device_id: r.device_id ? String(r.device_id) : null
|
|
114
|
+
}));
|
|
115
|
+
}
|
|
116
|
+
async function listBehaviorsByDomain(agentId, domain) {
|
|
117
|
+
const client = getClient();
|
|
118
|
+
const result = await client.execute({
|
|
119
|
+
sql: `SELECT id, agent_id, project_name, domain, priority, content, active, created_at, updated_at, vector
|
|
120
|
+
FROM behaviors
|
|
121
|
+
WHERE agent_id = ? AND domain = ? AND active = 1`,
|
|
122
|
+
args: [agentId, domain]
|
|
123
|
+
});
|
|
124
|
+
return result.rows.map((r) => ({
|
|
125
|
+
id: String(r.id),
|
|
126
|
+
agent_id: String(r.agent_id),
|
|
127
|
+
project_name: r.project_name ? String(r.project_name) : null,
|
|
128
|
+
domain: r.domain ? String(r.domain) : null,
|
|
129
|
+
priority: String(r.priority || "p1"),
|
|
130
|
+
content: String(r.content),
|
|
131
|
+
active: Number(r.active),
|
|
132
|
+
created_at: String(r.created_at),
|
|
133
|
+
updated_at: String(r.updated_at),
|
|
134
|
+
vector: r.vector ? Array.from(new Float32Array(r.vector)) : null,
|
|
135
|
+
created_by_agent: r.created_by_agent ? String(r.created_by_agent) : null,
|
|
136
|
+
created_by_device: r.created_by_device ? String(r.created_by_device) : null,
|
|
137
|
+
source_session_id: r.source_session_id ? String(r.source_session_id) : null,
|
|
138
|
+
device_id: r.device_id ? String(r.device_id) : null
|
|
139
|
+
}));
|
|
140
|
+
}
|
|
141
|
+
async function listBehaviorsSince(agentId, sinceIso, projectName, limit = 15) {
|
|
142
|
+
const client = getClient();
|
|
143
|
+
let currentDeviceId = null;
|
|
144
|
+
try {
|
|
145
|
+
const { loadDeviceId } = await import("./lib/license.js");
|
|
146
|
+
currentDeviceId = loadDeviceId() ?? null;
|
|
147
|
+
} catch {
|
|
148
|
+
}
|
|
149
|
+
const result = await client.execute({
|
|
150
|
+
sql: `SELECT id, agent_id, project_name, domain, priority, content, active, created_at, updated_at, vector, created_by_agent, created_by_device, source_session_id, device_id
|
|
151
|
+
FROM behaviors
|
|
152
|
+
WHERE agent_id = ? AND active = 1
|
|
153
|
+
AND (project_name IS NULL OR project_name = ?)
|
|
154
|
+
AND (device_id IS NULL OR device_id = ?)
|
|
155
|
+
AND (created_at > ? OR updated_at > ?)
|
|
156
|
+
ORDER BY
|
|
157
|
+
CASE WHEN priority = 'p0' THEN 0
|
|
158
|
+
WHEN priority = 'p1' THEN 1
|
|
159
|
+
ELSE 2 END,
|
|
160
|
+
updated_at DESC
|
|
161
|
+
LIMIT ?`,
|
|
162
|
+
args: [agentId, projectName ?? "", currentDeviceId ?? "", sinceIso, sinceIso, limit]
|
|
163
|
+
});
|
|
164
|
+
return result.rows.map((r) => ({
|
|
165
|
+
id: String(r.id),
|
|
166
|
+
agent_id: String(r.agent_id),
|
|
167
|
+
project_name: r.project_name ? String(r.project_name) : null,
|
|
168
|
+
domain: r.domain ? String(r.domain) : null,
|
|
169
|
+
priority: String(r.priority || "p1"),
|
|
170
|
+
content: String(r.content),
|
|
171
|
+
active: Number(r.active),
|
|
172
|
+
created_at: String(r.created_at),
|
|
173
|
+
updated_at: String(r.updated_at),
|
|
174
|
+
vector: r.vector ? Array.from(new Float32Array(r.vector)) : null,
|
|
175
|
+
created_by_agent: r.created_by_agent ? String(r.created_by_agent) : null,
|
|
176
|
+
created_by_device: r.created_by_device ? String(r.created_by_device) : null,
|
|
177
|
+
source_session_id: r.source_session_id ? String(r.source_session_id) : null,
|
|
178
|
+
device_id: r.device_id ? String(r.device_id) : null
|
|
179
|
+
}));
|
|
180
|
+
}
|
|
181
|
+
async function listSharedSkills(currentAgentId, projectName, limit = 30) {
|
|
182
|
+
const client = getClient();
|
|
183
|
+
let currentDeviceId = null;
|
|
184
|
+
try {
|
|
185
|
+
const { loadDeviceId } = await import("./lib/license.js");
|
|
186
|
+
currentDeviceId = loadDeviceId() ?? null;
|
|
187
|
+
} catch {
|
|
188
|
+
}
|
|
189
|
+
const result = await client.execute({
|
|
190
|
+
sql: `SELECT id, agent_id, project_name, domain, priority, content, active, created_at, updated_at, vector, created_by_agent, created_by_device, source_session_id, device_id
|
|
191
|
+
FROM behaviors
|
|
192
|
+
WHERE domain = 'skill' AND active = 1
|
|
193
|
+
AND (project_name IS NULL OR project_name = ?)
|
|
194
|
+
AND (device_id IS NULL OR device_id = ?)
|
|
195
|
+
ORDER BY
|
|
196
|
+
CASE WHEN agent_id = ? THEN 0 ELSE 1 END,
|
|
197
|
+
updated_at DESC
|
|
198
|
+
LIMIT ?`,
|
|
199
|
+
args: [projectName ?? "", currentDeviceId ?? "", currentAgentId, limit]
|
|
200
|
+
});
|
|
201
|
+
return result.rows.map((r) => ({
|
|
202
|
+
id: String(r.id),
|
|
203
|
+
agent_id: String(r.agent_id),
|
|
204
|
+
project_name: r.project_name ? String(r.project_name) : null,
|
|
205
|
+
domain: r.domain ? String(r.domain) : null,
|
|
206
|
+
priority: String(r.priority || "p1"),
|
|
207
|
+
content: String(r.content),
|
|
208
|
+
active: Number(r.active),
|
|
209
|
+
created_at: String(r.created_at),
|
|
210
|
+
updated_at: String(r.updated_at),
|
|
211
|
+
vector: r.vector ? Array.from(new Float32Array(r.vector)) : null,
|
|
212
|
+
created_by_agent: r.created_by_agent ? String(r.created_by_agent) : null,
|
|
213
|
+
created_by_device: r.created_by_device ? String(r.created_by_device) : null,
|
|
214
|
+
source_session_id: r.source_session_id ? String(r.source_session_id) : null,
|
|
215
|
+
device_id: r.device_id ? String(r.device_id) : null,
|
|
216
|
+
shared: String(r.agent_id) !== currentAgentId
|
|
217
|
+
}));
|
|
218
|
+
}
|
|
219
|
+
async function deactivateBehavior(id) {
|
|
220
|
+
const client = getClient();
|
|
221
|
+
const result = await client.execute({
|
|
222
|
+
sql: `UPDATE behaviors SET active = 0, updated_at = ? WHERE id = ? AND active = 1`,
|
|
223
|
+
args: [(/* @__PURE__ */ new Date()).toISOString(), id]
|
|
224
|
+
});
|
|
225
|
+
return (result.rowsAffected ?? 0) > 0;
|
|
226
|
+
}
|
|
227
|
+
async function reactivateBehavior(id) {
|
|
228
|
+
const client = getClient();
|
|
229
|
+
const result = await client.execute({
|
|
230
|
+
sql: `UPDATE behaviors SET active = 1, updated_at = ? WHERE id = ? AND active = 0`,
|
|
231
|
+
args: [(/* @__PURE__ */ new Date()).toISOString(), id]
|
|
232
|
+
});
|
|
233
|
+
return (result.rowsAffected ?? 0) > 0;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
export {
|
|
237
|
+
storeBehavior,
|
|
238
|
+
listBehaviors,
|
|
239
|
+
listBehaviorsByDomain,
|
|
240
|
+
listBehaviorsSince,
|
|
241
|
+
listSharedSkills,
|
|
242
|
+
deactivateBehavior,
|
|
243
|
+
reactivateBehavior
|
|
244
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import {
|
|
2
|
+
completeReminder
|
|
3
|
+
} from "./chunk-TYXB66FM.js";
|
|
4
|
+
|
|
5
|
+
// src/mcp/tools/complete-reminder.ts
|
|
6
|
+
import { z } from "zod";
|
|
7
|
+
function registerCompleteReminder(server) {
|
|
8
|
+
server.registerTool(
|
|
9
|
+
"complete_reminder",
|
|
10
|
+
{
|
|
11
|
+
title: "Complete Reminder",
|
|
12
|
+
description: "Mark a reminder as done. Accepts UUID or text substring.",
|
|
13
|
+
inputSchema: {
|
|
14
|
+
reminder_id: z.string().describe("Reminder UUID or text substring to match")
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
async ({ reminder_id }) => {
|
|
18
|
+
const reminder = await completeReminder(reminder_id);
|
|
19
|
+
if (!reminder) {
|
|
20
|
+
return {
|
|
21
|
+
content: [{ type: "text", text: `No active reminder matching "${reminder_id}".` }]
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
return {
|
|
25
|
+
content: [{ type: "text", text: `Reminder completed: "${reminder.text}"` }]
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export {
|
|
32
|
+
registerCompleteReminder
|
|
33
|
+
};
|