@askexenow/exe-os 0.9.119 → 0.9.121
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/dist/bin/cli.js +11 -7
- package/dist/bin/exe-boot.js +9 -6
- package/dist/bin/exe-dispatch.js +9 -6
- package/dist/bin/exe-gateway.js +9 -6
- package/dist/bin/exe-session-cleanup.js +9 -6
- package/dist/bin/git-sweep.js +9 -6
- package/dist/bin/intercom-check.js +42 -6
- package/dist/bin/scan-tasks.js +9 -6
- package/dist/gateway/index.js +9 -6
- package/dist/hooks/bug-report-worker.js +9 -6
- package/dist/hooks/codex-stop-task-finalizer.js +9 -6
- package/dist/hooks/commit-complete.js +9 -6
- package/dist/hooks/ingest.js +9 -6
- package/dist/hooks/pre-compact.js +9 -6
- package/dist/hooks/prompt-submit.js +69 -7
- package/dist/hooks/session-end.js +9 -6
- package/dist/index.js +42 -6
- package/dist/lib/consolidation.js +1 -1
- package/dist/lib/exe-daemon.js +45 -8
- package/dist/lib/skill-learning.js +9 -6
- package/dist/lib/tasks.js +9 -6
- package/dist/lib/tmux-routing.js +9 -6
- package/dist/mcp/register-tools.js +485 -324
- package/dist/mcp/server.js +485 -324
- package/dist/mcp/tools/create-task.js +9 -6
- package/dist/mcp/tools/update-task.js +9 -6
- package/dist/runtime/index.js +42 -6
- package/dist/tui/App.js +9 -6
- package/package.json +1 -1
package/dist/bin/cli.js
CHANGED
|
@@ -15863,15 +15863,18 @@ var init_embedder = __esm({
|
|
|
15863
15863
|
import crypto10 from "crypto";
|
|
15864
15864
|
async function storeBehavior(opts) {
|
|
15865
15865
|
try {
|
|
15866
|
-
const { loadEmployeesSync: loadEmployeesSync2 } = await Promise.resolve().then(() => (init_employees(), employees_exports));
|
|
15866
|
+
const { loadEmployeesSync: loadEmployeesSync2, baseAgentName: baseAgentName2 } = await Promise.resolve().then(() => (init_employees(), employees_exports));
|
|
15867
15867
|
const roster = loadEmployeesSync2();
|
|
15868
|
-
if (roster.length > 0
|
|
15869
|
-
|
|
15870
|
-
|
|
15868
|
+
if (roster.length > 0) {
|
|
15869
|
+
const base = baseAgentName2(opts.agentId, roster);
|
|
15870
|
+
if (!roster.some((e) => e.name === opts.agentId || e.name === base)) {
|
|
15871
|
+
process.stderr.write(
|
|
15872
|
+
`[behaviors] WARNING: Agent "${opts.agentId}" not found in roster. Storing behavior anyway \u2014 may be orphaned.
|
|
15873
|
+
`
|
|
15874
|
+
);
|
|
15871
15875
|
}
|
|
15872
15876
|
}
|
|
15873
|
-
} catch
|
|
15874
|
-
if (e instanceof Error && e.message.includes("not found in roster")) throw e;
|
|
15877
|
+
} catch {
|
|
15875
15878
|
}
|
|
15876
15879
|
const client = getClient();
|
|
15877
15880
|
const id = crypto10.randomUUID();
|
|
@@ -37373,7 +37376,8 @@ function summarizeChunk(chunk, filePath) {
|
|
|
37373
37376
|
}
|
|
37374
37377
|
}
|
|
37375
37378
|
function isChunkable(filePath) {
|
|
37376
|
-
|
|
37379
|
+
const lang = languageForFile(filePath);
|
|
37380
|
+
return lang === "typescript" || lang === "javascript";
|
|
37377
37381
|
}
|
|
37378
37382
|
var LANGUAGE_BY_EXTENSION, TEXT_LIKE_LANGUAGES;
|
|
37379
37383
|
var init_code_chunker = __esm({
|
package/dist/bin/exe-boot.js
CHANGED
|
@@ -7989,15 +7989,18 @@ var init_embedder = __esm({
|
|
|
7989
7989
|
import crypto5 from "crypto";
|
|
7990
7990
|
async function storeBehavior(opts) {
|
|
7991
7991
|
try {
|
|
7992
|
-
const { loadEmployeesSync: loadEmployeesSync2 } = await Promise.resolve().then(() => (init_employees(), employees_exports));
|
|
7992
|
+
const { loadEmployeesSync: loadEmployeesSync2, baseAgentName: baseAgentName2 } = await Promise.resolve().then(() => (init_employees(), employees_exports));
|
|
7993
7993
|
const roster = loadEmployeesSync2();
|
|
7994
|
-
if (roster.length > 0
|
|
7995
|
-
|
|
7996
|
-
|
|
7994
|
+
if (roster.length > 0) {
|
|
7995
|
+
const base = baseAgentName2(opts.agentId, roster);
|
|
7996
|
+
if (!roster.some((e) => e.name === opts.agentId || e.name === base)) {
|
|
7997
|
+
process.stderr.write(
|
|
7998
|
+
`[behaviors] WARNING: Agent "${opts.agentId}" not found in roster. Storing behavior anyway \u2014 may be orphaned.
|
|
7999
|
+
`
|
|
8000
|
+
);
|
|
7997
8001
|
}
|
|
7998
8002
|
}
|
|
7999
|
-
} catch
|
|
8000
|
-
if (e instanceof Error && e.message.includes("not found in roster")) throw e;
|
|
8003
|
+
} catch {
|
|
8001
8004
|
}
|
|
8002
8005
|
const client = getClient();
|
|
8003
8006
|
const id = crypto5.randomUUID();
|
package/dist/bin/exe-dispatch.js
CHANGED
|
@@ -6501,15 +6501,18 @@ var init_embedder = __esm({
|
|
|
6501
6501
|
import crypto5 from "crypto";
|
|
6502
6502
|
async function storeBehavior(opts) {
|
|
6503
6503
|
try {
|
|
6504
|
-
const { loadEmployeesSync: loadEmployeesSync2 } = await Promise.resolve().then(() => (init_employees(), employees_exports));
|
|
6504
|
+
const { loadEmployeesSync: loadEmployeesSync2, baseAgentName: baseAgentName2 } = await Promise.resolve().then(() => (init_employees(), employees_exports));
|
|
6505
6505
|
const roster = loadEmployeesSync2();
|
|
6506
|
-
if (roster.length > 0
|
|
6507
|
-
|
|
6508
|
-
|
|
6506
|
+
if (roster.length > 0) {
|
|
6507
|
+
const base = baseAgentName2(opts.agentId, roster);
|
|
6508
|
+
if (!roster.some((e) => e.name === opts.agentId || e.name === base)) {
|
|
6509
|
+
process.stderr.write(
|
|
6510
|
+
`[behaviors] WARNING: Agent "${opts.agentId}" not found in roster. Storing behavior anyway \u2014 may be orphaned.
|
|
6511
|
+
`
|
|
6512
|
+
);
|
|
6509
6513
|
}
|
|
6510
6514
|
}
|
|
6511
|
-
} catch
|
|
6512
|
-
if (e instanceof Error && e.message.includes("not found in roster")) throw e;
|
|
6515
|
+
} catch {
|
|
6513
6516
|
}
|
|
6514
6517
|
const client = getClient();
|
|
6515
6518
|
const id = crypto5.randomUUID();
|
package/dist/bin/exe-gateway.js
CHANGED
|
@@ -12031,15 +12031,18 @@ var init_tasks_notify = __esm({
|
|
|
12031
12031
|
import crypto8 from "crypto";
|
|
12032
12032
|
async function storeBehavior(opts) {
|
|
12033
12033
|
try {
|
|
12034
|
-
const { loadEmployeesSync: loadEmployeesSync2 } = await Promise.resolve().then(() => (init_employees(), employees_exports));
|
|
12034
|
+
const { loadEmployeesSync: loadEmployeesSync2, baseAgentName: baseAgentName2 } = await Promise.resolve().then(() => (init_employees(), employees_exports));
|
|
12035
12035
|
const roster = loadEmployeesSync2();
|
|
12036
|
-
if (roster.length > 0
|
|
12037
|
-
|
|
12038
|
-
|
|
12036
|
+
if (roster.length > 0) {
|
|
12037
|
+
const base = baseAgentName2(opts.agentId, roster);
|
|
12038
|
+
if (!roster.some((e) => e.name === opts.agentId || e.name === base)) {
|
|
12039
|
+
process.stderr.write(
|
|
12040
|
+
`[behaviors] WARNING: Agent "${opts.agentId}" not found in roster. Storing behavior anyway \u2014 may be orphaned.
|
|
12041
|
+
`
|
|
12042
|
+
);
|
|
12039
12043
|
}
|
|
12040
12044
|
}
|
|
12041
|
-
} catch
|
|
12042
|
-
if (e instanceof Error && e.message.includes("not found in roster")) throw e;
|
|
12045
|
+
} catch {
|
|
12043
12046
|
}
|
|
12044
12047
|
const client = getClient();
|
|
12045
12048
|
const id = crypto8.randomUUID();
|
|
@@ -8884,15 +8884,18 @@ var init_embedder = __esm({
|
|
|
8884
8884
|
import crypto5 from "crypto";
|
|
8885
8885
|
async function storeBehavior(opts) {
|
|
8886
8886
|
try {
|
|
8887
|
-
const { loadEmployeesSync: loadEmployeesSync2 } = await Promise.resolve().then(() => (init_employees(), employees_exports));
|
|
8887
|
+
const { loadEmployeesSync: loadEmployeesSync2, baseAgentName: baseAgentName2 } = await Promise.resolve().then(() => (init_employees(), employees_exports));
|
|
8888
8888
|
const roster = loadEmployeesSync2();
|
|
8889
|
-
if (roster.length > 0
|
|
8890
|
-
|
|
8891
|
-
|
|
8889
|
+
if (roster.length > 0) {
|
|
8890
|
+
const base = baseAgentName2(opts.agentId, roster);
|
|
8891
|
+
if (!roster.some((e) => e.name === opts.agentId || e.name === base)) {
|
|
8892
|
+
process.stderr.write(
|
|
8893
|
+
`[behaviors] WARNING: Agent "${opts.agentId}" not found in roster. Storing behavior anyway \u2014 may be orphaned.
|
|
8894
|
+
`
|
|
8895
|
+
);
|
|
8892
8896
|
}
|
|
8893
8897
|
}
|
|
8894
|
-
} catch
|
|
8895
|
-
if (e instanceof Error && e.message.includes("not found in roster")) throw e;
|
|
8898
|
+
} catch {
|
|
8896
8899
|
}
|
|
8897
8900
|
const client = getClient();
|
|
8898
8901
|
const id = crypto5.randomUUID();
|
package/dist/bin/git-sweep.js
CHANGED
|
@@ -6418,15 +6418,18 @@ var init_embedder = __esm({
|
|
|
6418
6418
|
import crypto5 from "crypto";
|
|
6419
6419
|
async function storeBehavior(opts) {
|
|
6420
6420
|
try {
|
|
6421
|
-
const { loadEmployeesSync: loadEmployeesSync2 } = await Promise.resolve().then(() => (init_employees(), employees_exports));
|
|
6421
|
+
const { loadEmployeesSync: loadEmployeesSync2, baseAgentName: baseAgentName2 } = await Promise.resolve().then(() => (init_employees(), employees_exports));
|
|
6422
6422
|
const roster = loadEmployeesSync2();
|
|
6423
|
-
if (roster.length > 0
|
|
6424
|
-
|
|
6425
|
-
|
|
6423
|
+
if (roster.length > 0) {
|
|
6424
|
+
const base = baseAgentName2(opts.agentId, roster);
|
|
6425
|
+
if (!roster.some((e) => e.name === opts.agentId || e.name === base)) {
|
|
6426
|
+
process.stderr.write(
|
|
6427
|
+
`[behaviors] WARNING: Agent "${opts.agentId}" not found in roster. Storing behavior anyway \u2014 may be orphaned.
|
|
6428
|
+
`
|
|
6429
|
+
);
|
|
6426
6430
|
}
|
|
6427
6431
|
}
|
|
6428
|
-
} catch
|
|
6429
|
-
if (e instanceof Error && e.message.includes("not found in roster")) throw e;
|
|
6432
|
+
} catch {
|
|
6430
6433
|
}
|
|
6431
6434
|
const client = getClient();
|
|
6432
6435
|
const id = crypto5.randomUUID();
|
|
@@ -8461,20 +8461,24 @@ __export(behaviors_exports, {
|
|
|
8461
8461
|
deactivateBehavior: () => deactivateBehavior,
|
|
8462
8462
|
listBehaviors: () => listBehaviors,
|
|
8463
8463
|
listBehaviorsByDomain: () => listBehaviorsByDomain,
|
|
8464
|
+
listBehaviorsSince: () => listBehaviorsSince,
|
|
8464
8465
|
storeBehavior: () => storeBehavior
|
|
8465
8466
|
});
|
|
8466
8467
|
import crypto4 from "crypto";
|
|
8467
8468
|
async function storeBehavior(opts) {
|
|
8468
8469
|
try {
|
|
8469
|
-
const { loadEmployeesSync: loadEmployeesSync2 } = await Promise.resolve().then(() => (init_employees(), employees_exports));
|
|
8470
|
+
const { loadEmployeesSync: loadEmployeesSync2, baseAgentName: baseAgentName2 } = await Promise.resolve().then(() => (init_employees(), employees_exports));
|
|
8470
8471
|
const roster = loadEmployeesSync2();
|
|
8471
|
-
if (roster.length > 0
|
|
8472
|
-
|
|
8473
|
-
|
|
8472
|
+
if (roster.length > 0) {
|
|
8473
|
+
const base = baseAgentName2(opts.agentId, roster);
|
|
8474
|
+
if (!roster.some((e) => e.name === opts.agentId || e.name === base)) {
|
|
8475
|
+
process.stderr.write(
|
|
8476
|
+
`[behaviors] WARNING: Agent "${opts.agentId}" not found in roster. Storing behavior anyway \u2014 may be orphaned.
|
|
8477
|
+
`
|
|
8478
|
+
);
|
|
8474
8479
|
}
|
|
8475
8480
|
}
|
|
8476
|
-
} catch
|
|
8477
|
-
if (e instanceof Error && e.message.includes("not found in roster")) throw e;
|
|
8481
|
+
} catch {
|
|
8478
8482
|
}
|
|
8479
8483
|
const client = getClient();
|
|
8480
8484
|
const id = crypto4.randomUUID();
|
|
@@ -8565,6 +8569,38 @@ async function listBehaviorsByDomain(agentId, domain) {
|
|
|
8565
8569
|
source_session_id: r.source_session_id ? String(r.source_session_id) : null
|
|
8566
8570
|
}));
|
|
8567
8571
|
}
|
|
8572
|
+
async function listBehaviorsSince(agentId, sinceIso, projectName, limit = 15) {
|
|
8573
|
+
const client = getClient();
|
|
8574
|
+
const result = await client.execute({
|
|
8575
|
+
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
|
|
8576
|
+
FROM behaviors
|
|
8577
|
+
WHERE agent_id = ? AND active = 1
|
|
8578
|
+
AND (project_name IS NULL OR project_name = ?)
|
|
8579
|
+
AND (created_at > ? OR updated_at > ?)
|
|
8580
|
+
ORDER BY
|
|
8581
|
+
CASE WHEN priority = 'p0' THEN 0
|
|
8582
|
+
WHEN priority = 'p1' THEN 1
|
|
8583
|
+
ELSE 2 END,
|
|
8584
|
+
updated_at DESC
|
|
8585
|
+
LIMIT ?`,
|
|
8586
|
+
args: [agentId, projectName ?? "", sinceIso, sinceIso, limit]
|
|
8587
|
+
});
|
|
8588
|
+
return result.rows.map((r) => ({
|
|
8589
|
+
id: String(r.id),
|
|
8590
|
+
agent_id: String(r.agent_id),
|
|
8591
|
+
project_name: r.project_name ? String(r.project_name) : null,
|
|
8592
|
+
domain: r.domain ? String(r.domain) : null,
|
|
8593
|
+
priority: String(r.priority || "p1"),
|
|
8594
|
+
content: String(r.content),
|
|
8595
|
+
active: Number(r.active),
|
|
8596
|
+
created_at: String(r.created_at),
|
|
8597
|
+
updated_at: String(r.updated_at),
|
|
8598
|
+
vector: r.vector ? Array.from(new Float32Array(r.vector)) : null,
|
|
8599
|
+
created_by_agent: r.created_by_agent ? String(r.created_by_agent) : null,
|
|
8600
|
+
created_by_device: r.created_by_device ? String(r.created_by_device) : null,
|
|
8601
|
+
source_session_id: r.source_session_id ? String(r.source_session_id) : null
|
|
8602
|
+
}));
|
|
8603
|
+
}
|
|
8568
8604
|
async function deactivateBehavior(id) {
|
|
8569
8605
|
const client = getClient();
|
|
8570
8606
|
const result = await client.execute({
|
package/dist/bin/scan-tasks.js
CHANGED
|
@@ -6489,15 +6489,18 @@ var init_embedder = __esm({
|
|
|
6489
6489
|
import crypto5 from "crypto";
|
|
6490
6490
|
async function storeBehavior(opts) {
|
|
6491
6491
|
try {
|
|
6492
|
-
const { loadEmployeesSync: loadEmployeesSync2 } = await Promise.resolve().then(() => (init_employees(), employees_exports));
|
|
6492
|
+
const { loadEmployeesSync: loadEmployeesSync2, baseAgentName: baseAgentName2 } = await Promise.resolve().then(() => (init_employees(), employees_exports));
|
|
6493
6493
|
const roster = loadEmployeesSync2();
|
|
6494
|
-
if (roster.length > 0
|
|
6495
|
-
|
|
6496
|
-
|
|
6494
|
+
if (roster.length > 0) {
|
|
6495
|
+
const base = baseAgentName2(opts.agentId, roster);
|
|
6496
|
+
if (!roster.some((e) => e.name === opts.agentId || e.name === base)) {
|
|
6497
|
+
process.stderr.write(
|
|
6498
|
+
`[behaviors] WARNING: Agent "${opts.agentId}" not found in roster. Storing behavior anyway \u2014 may be orphaned.
|
|
6499
|
+
`
|
|
6500
|
+
);
|
|
6497
6501
|
}
|
|
6498
6502
|
}
|
|
6499
|
-
} catch
|
|
6500
|
-
if (e instanceof Error && e.message.includes("not found in roster")) throw e;
|
|
6503
|
+
} catch {
|
|
6501
6504
|
}
|
|
6502
6505
|
const client = getClient();
|
|
6503
6506
|
const id = crypto5.randomUUID();
|
package/dist/gateway/index.js
CHANGED
|
@@ -10351,15 +10351,18 @@ var init_tasks_notify = __esm({
|
|
|
10351
10351
|
import crypto7 from "crypto";
|
|
10352
10352
|
async function storeBehavior(opts) {
|
|
10353
10353
|
try {
|
|
10354
|
-
const { loadEmployeesSync: loadEmployeesSync2 } = await Promise.resolve().then(() => (init_employees(), employees_exports));
|
|
10354
|
+
const { loadEmployeesSync: loadEmployeesSync2, baseAgentName: baseAgentName2 } = await Promise.resolve().then(() => (init_employees(), employees_exports));
|
|
10355
10355
|
const roster = loadEmployeesSync2();
|
|
10356
|
-
if (roster.length > 0
|
|
10357
|
-
|
|
10358
|
-
|
|
10356
|
+
if (roster.length > 0) {
|
|
10357
|
+
const base = baseAgentName2(opts.agentId, roster);
|
|
10358
|
+
if (!roster.some((e) => e.name === opts.agentId || e.name === base)) {
|
|
10359
|
+
process.stderr.write(
|
|
10360
|
+
`[behaviors] WARNING: Agent "${opts.agentId}" not found in roster. Storing behavior anyway \u2014 may be orphaned.
|
|
10361
|
+
`
|
|
10362
|
+
);
|
|
10359
10363
|
}
|
|
10360
10364
|
}
|
|
10361
|
-
} catch
|
|
10362
|
-
if (e instanceof Error && e.message.includes("not found in roster")) throw e;
|
|
10365
|
+
} catch {
|
|
10363
10366
|
}
|
|
10364
10367
|
const client = getClient();
|
|
10365
10368
|
const id = crypto7.randomUUID();
|
|
@@ -10190,15 +10190,18 @@ var init_embedder = __esm({
|
|
|
10190
10190
|
import crypto5 from "crypto";
|
|
10191
10191
|
async function storeBehavior(opts) {
|
|
10192
10192
|
try {
|
|
10193
|
-
const { loadEmployeesSync: loadEmployeesSync2 } = await Promise.resolve().then(() => (init_employees(), employees_exports));
|
|
10193
|
+
const { loadEmployeesSync: loadEmployeesSync2, baseAgentName: baseAgentName2 } = await Promise.resolve().then(() => (init_employees(), employees_exports));
|
|
10194
10194
|
const roster = loadEmployeesSync2();
|
|
10195
|
-
if (roster.length > 0
|
|
10196
|
-
|
|
10197
|
-
|
|
10195
|
+
if (roster.length > 0) {
|
|
10196
|
+
const base = baseAgentName2(opts.agentId, roster);
|
|
10197
|
+
if (!roster.some((e) => e.name === opts.agentId || e.name === base)) {
|
|
10198
|
+
process.stderr.write(
|
|
10199
|
+
`[behaviors] WARNING: Agent "${opts.agentId}" not found in roster. Storing behavior anyway \u2014 may be orphaned.
|
|
10200
|
+
`
|
|
10201
|
+
);
|
|
10198
10202
|
}
|
|
10199
10203
|
}
|
|
10200
|
-
} catch
|
|
10201
|
-
if (e instanceof Error && e.message.includes("not found in roster")) throw e;
|
|
10204
|
+
} catch {
|
|
10202
10205
|
}
|
|
10203
10206
|
const client = getClient();
|
|
10204
10207
|
const id = crypto5.randomUUID();
|
|
@@ -8474,15 +8474,18 @@ var init_embedder = __esm({
|
|
|
8474
8474
|
import crypto4 from "crypto";
|
|
8475
8475
|
async function storeBehavior(opts) {
|
|
8476
8476
|
try {
|
|
8477
|
-
const { loadEmployeesSync: loadEmployeesSync2 } = await Promise.resolve().then(() => (init_employees(), employees_exports));
|
|
8477
|
+
const { loadEmployeesSync: loadEmployeesSync2, baseAgentName: baseAgentName2 } = await Promise.resolve().then(() => (init_employees(), employees_exports));
|
|
8478
8478
|
const roster = loadEmployeesSync2();
|
|
8479
|
-
if (roster.length > 0
|
|
8480
|
-
|
|
8481
|
-
|
|
8479
|
+
if (roster.length > 0) {
|
|
8480
|
+
const base = baseAgentName2(opts.agentId, roster);
|
|
8481
|
+
if (!roster.some((e) => e.name === opts.agentId || e.name === base)) {
|
|
8482
|
+
process.stderr.write(
|
|
8483
|
+
`[behaviors] WARNING: Agent "${opts.agentId}" not found in roster. Storing behavior anyway \u2014 may be orphaned.
|
|
8484
|
+
`
|
|
8485
|
+
);
|
|
8482
8486
|
}
|
|
8483
8487
|
}
|
|
8484
|
-
} catch
|
|
8485
|
-
if (e instanceof Error && e.message.includes("not found in roster")) throw e;
|
|
8488
|
+
} catch {
|
|
8486
8489
|
}
|
|
8487
8490
|
const client = getClient();
|
|
8488
8491
|
const id = crypto4.randomUUID();
|
|
@@ -6483,15 +6483,18 @@ var init_embedder = __esm({
|
|
|
6483
6483
|
import crypto5 from "crypto";
|
|
6484
6484
|
async function storeBehavior(opts) {
|
|
6485
6485
|
try {
|
|
6486
|
-
const { loadEmployeesSync: loadEmployeesSync2 } = await Promise.resolve().then(() => (init_employees(), employees_exports));
|
|
6486
|
+
const { loadEmployeesSync: loadEmployeesSync2, baseAgentName: baseAgentName2 } = await Promise.resolve().then(() => (init_employees(), employees_exports));
|
|
6487
6487
|
const roster = loadEmployeesSync2();
|
|
6488
|
-
if (roster.length > 0
|
|
6489
|
-
|
|
6490
|
-
|
|
6488
|
+
if (roster.length > 0) {
|
|
6489
|
+
const base = baseAgentName2(opts.agentId, roster);
|
|
6490
|
+
if (!roster.some((e) => e.name === opts.agentId || e.name === base)) {
|
|
6491
|
+
process.stderr.write(
|
|
6492
|
+
`[behaviors] WARNING: Agent "${opts.agentId}" not found in roster. Storing behavior anyway \u2014 may be orphaned.
|
|
6493
|
+
`
|
|
6494
|
+
);
|
|
6491
6495
|
}
|
|
6492
6496
|
}
|
|
6493
|
-
} catch
|
|
6494
|
-
if (e instanceof Error && e.message.includes("not found in roster")) throw e;
|
|
6497
|
+
} catch {
|
|
6495
6498
|
}
|
|
6496
6499
|
const client = getClient();
|
|
6497
6500
|
const id = crypto5.randomUUID();
|
package/dist/hooks/ingest.js
CHANGED
|
@@ -8369,15 +8369,18 @@ var init_embedder = __esm({
|
|
|
8369
8369
|
import crypto5 from "crypto";
|
|
8370
8370
|
async function storeBehavior(opts) {
|
|
8371
8371
|
try {
|
|
8372
|
-
const { loadEmployeesSync: loadEmployeesSync2 } = await Promise.resolve().then(() => (init_employees(), employees_exports));
|
|
8372
|
+
const { loadEmployeesSync: loadEmployeesSync2, baseAgentName: baseAgentName2 } = await Promise.resolve().then(() => (init_employees(), employees_exports));
|
|
8373
8373
|
const roster = loadEmployeesSync2();
|
|
8374
|
-
if (roster.length > 0
|
|
8375
|
-
|
|
8376
|
-
|
|
8374
|
+
if (roster.length > 0) {
|
|
8375
|
+
const base = baseAgentName2(opts.agentId, roster);
|
|
8376
|
+
if (!roster.some((e) => e.name === opts.agentId || e.name === base)) {
|
|
8377
|
+
process.stderr.write(
|
|
8378
|
+
`[behaviors] WARNING: Agent "${opts.agentId}" not found in roster. Storing behavior anyway \u2014 may be orphaned.
|
|
8379
|
+
`
|
|
8380
|
+
);
|
|
8377
8381
|
}
|
|
8378
8382
|
}
|
|
8379
|
-
} catch
|
|
8380
|
-
if (e instanceof Error && e.message.includes("not found in roster")) throw e;
|
|
8383
|
+
} catch {
|
|
8381
8384
|
}
|
|
8382
8385
|
const client = getClient();
|
|
8383
8386
|
const id = crypto5.randomUUID();
|
|
@@ -6467,15 +6467,18 @@ var init_embedder = __esm({
|
|
|
6467
6467
|
import crypto5 from "crypto";
|
|
6468
6468
|
async function storeBehavior(opts) {
|
|
6469
6469
|
try {
|
|
6470
|
-
const { loadEmployeesSync: loadEmployeesSync2 } = await Promise.resolve().then(() => (init_employees(), employees_exports));
|
|
6470
|
+
const { loadEmployeesSync: loadEmployeesSync2, baseAgentName: baseAgentName2 } = await Promise.resolve().then(() => (init_employees(), employees_exports));
|
|
6471
6471
|
const roster = loadEmployeesSync2();
|
|
6472
|
-
if (roster.length > 0
|
|
6473
|
-
|
|
6474
|
-
|
|
6472
|
+
if (roster.length > 0) {
|
|
6473
|
+
const base = baseAgentName2(opts.agentId, roster);
|
|
6474
|
+
if (!roster.some((e) => e.name === opts.agentId || e.name === base)) {
|
|
6475
|
+
process.stderr.write(
|
|
6476
|
+
`[behaviors] WARNING: Agent "${opts.agentId}" not found in roster. Storing behavior anyway \u2014 may be orphaned.
|
|
6477
|
+
`
|
|
6478
|
+
);
|
|
6475
6479
|
}
|
|
6476
6480
|
}
|
|
6477
|
-
} catch
|
|
6478
|
-
if (e instanceof Error && e.message.includes("not found in roster")) throw e;
|
|
6481
|
+
} catch {
|
|
6479
6482
|
}
|
|
6480
6483
|
const client = getClient();
|
|
6481
6484
|
const id = crypto5.randomUUID();
|
|
@@ -10041,20 +10041,24 @@ __export(behaviors_exports, {
|
|
|
10041
10041
|
deactivateBehavior: () => deactivateBehavior,
|
|
10042
10042
|
listBehaviors: () => listBehaviors,
|
|
10043
10043
|
listBehaviorsByDomain: () => listBehaviorsByDomain,
|
|
10044
|
+
listBehaviorsSince: () => listBehaviorsSince,
|
|
10044
10045
|
storeBehavior: () => storeBehavior
|
|
10045
10046
|
});
|
|
10046
10047
|
import crypto6 from "crypto";
|
|
10047
10048
|
async function storeBehavior(opts) {
|
|
10048
10049
|
try {
|
|
10049
|
-
const { loadEmployeesSync: loadEmployeesSync2 } = await Promise.resolve().then(() => (init_employees(), employees_exports));
|
|
10050
|
+
const { loadEmployeesSync: loadEmployeesSync2, baseAgentName: baseAgentName2 } = await Promise.resolve().then(() => (init_employees(), employees_exports));
|
|
10050
10051
|
const roster = loadEmployeesSync2();
|
|
10051
|
-
if (roster.length > 0
|
|
10052
|
-
|
|
10053
|
-
|
|
10052
|
+
if (roster.length > 0) {
|
|
10053
|
+
const base = baseAgentName2(opts.agentId, roster);
|
|
10054
|
+
if (!roster.some((e) => e.name === opts.agentId || e.name === base)) {
|
|
10055
|
+
process.stderr.write(
|
|
10056
|
+
`[behaviors] WARNING: Agent "${opts.agentId}" not found in roster. Storing behavior anyway \u2014 may be orphaned.
|
|
10057
|
+
`
|
|
10058
|
+
);
|
|
10054
10059
|
}
|
|
10055
10060
|
}
|
|
10056
|
-
} catch
|
|
10057
|
-
if (e instanceof Error && e.message.includes("not found in roster")) throw e;
|
|
10061
|
+
} catch {
|
|
10058
10062
|
}
|
|
10059
10063
|
const client = getClient();
|
|
10060
10064
|
const id = crypto6.randomUUID();
|
|
@@ -10145,6 +10149,38 @@ async function listBehaviorsByDomain(agentId, domain) {
|
|
|
10145
10149
|
source_session_id: r.source_session_id ? String(r.source_session_id) : null
|
|
10146
10150
|
}));
|
|
10147
10151
|
}
|
|
10152
|
+
async function listBehaviorsSince(agentId, sinceIso, projectName, limit = 15) {
|
|
10153
|
+
const client = getClient();
|
|
10154
|
+
const result = await client.execute({
|
|
10155
|
+
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
|
|
10156
|
+
FROM behaviors
|
|
10157
|
+
WHERE agent_id = ? AND active = 1
|
|
10158
|
+
AND (project_name IS NULL OR project_name = ?)
|
|
10159
|
+
AND (created_at > ? OR updated_at > ?)
|
|
10160
|
+
ORDER BY
|
|
10161
|
+
CASE WHEN priority = 'p0' THEN 0
|
|
10162
|
+
WHEN priority = 'p1' THEN 1
|
|
10163
|
+
ELSE 2 END,
|
|
10164
|
+
updated_at DESC
|
|
10165
|
+
LIMIT ?`,
|
|
10166
|
+
args: [agentId, projectName ?? "", sinceIso, sinceIso, limit]
|
|
10167
|
+
});
|
|
10168
|
+
return result.rows.map((r) => ({
|
|
10169
|
+
id: String(r.id),
|
|
10170
|
+
agent_id: String(r.agent_id),
|
|
10171
|
+
project_name: r.project_name ? String(r.project_name) : null,
|
|
10172
|
+
domain: r.domain ? String(r.domain) : null,
|
|
10173
|
+
priority: String(r.priority || "p1"),
|
|
10174
|
+
content: String(r.content),
|
|
10175
|
+
active: Number(r.active),
|
|
10176
|
+
created_at: String(r.created_at),
|
|
10177
|
+
updated_at: String(r.updated_at),
|
|
10178
|
+
vector: r.vector ? Array.from(new Float32Array(r.vector)) : null,
|
|
10179
|
+
created_by_agent: r.created_by_agent ? String(r.created_by_agent) : null,
|
|
10180
|
+
created_by_device: r.created_by_device ? String(r.created_by_device) : null,
|
|
10181
|
+
source_session_id: r.source_session_id ? String(r.source_session_id) : null
|
|
10182
|
+
}));
|
|
10183
|
+
}
|
|
10148
10184
|
async function deactivateBehavior(id) {
|
|
10149
10185
|
const client = getClient();
|
|
10150
10186
|
const result = await client.execute({
|
|
@@ -13444,6 +13480,7 @@ ${fresh.map(
|
|
|
13444
13480
|
if (!IS_CODEX_RUNTIME && agent.agentId !== "default") {
|
|
13445
13481
|
try {
|
|
13446
13482
|
const counterPath = path26.join(CACHE_DIR3, `prompt-count-${getSessionKey()}`);
|
|
13483
|
+
const behaviorLastCheckPath = path26.join(CACHE_DIR3, `behavior-lastcheck-${getSessionKey()}`);
|
|
13447
13484
|
let count = 1;
|
|
13448
13485
|
try {
|
|
13449
13486
|
count = parseInt(readFileSync17(counterPath, "utf8").trim(), 10) + 1;
|
|
@@ -13462,10 +13499,35 @@ ${fresh.map(
|
|
|
13462
13499
|
behaviorContext = `
|
|
13463
13500
|
## Your Behavioral Memory
|
|
13464
13501
|
Validated patterns and corrections for this session. Follow them.
|
|
13465
|
-
Sourced from exe-os Layer 2 (Expertise).
|
|
13502
|
+
Sourced from exe-os Layer 2 (Expertise).
|
|
13503
|
+
|
|
13504
|
+
${lines.join("\n")}`;
|
|
13505
|
+
}
|
|
13506
|
+
mkdirSync12(CACHE_DIR3, { recursive: true });
|
|
13507
|
+
writeFileSync11(behaviorLastCheckPath, (/* @__PURE__ */ new Date()).toISOString(), "utf8");
|
|
13508
|
+
} else {
|
|
13509
|
+
let lastCheckedAt = "";
|
|
13510
|
+
try {
|
|
13511
|
+
lastCheckedAt = readFileSync17(behaviorLastCheckPath, "utf8").trim();
|
|
13512
|
+
} catch {
|
|
13513
|
+
}
|
|
13514
|
+
if (!lastCheckedAt) {
|
|
13515
|
+
lastCheckedAt = "1970-01-01T00:00:00.000Z";
|
|
13516
|
+
}
|
|
13517
|
+
const { listBehaviorsSince: listBehaviorsSince2 } = await Promise.resolve().then(() => (init_behaviors(), behaviors_exports));
|
|
13518
|
+
const newBehaviors = await listBehaviorsSince2(agent.agentId, lastCheckedAt);
|
|
13519
|
+
if (newBehaviors.length > 0) {
|
|
13520
|
+
const lines = newBehaviors.map(
|
|
13521
|
+
(b) => `- [${b.domain ?? "workflow"}] ${b.content.slice(0, 200)}`
|
|
13522
|
+
);
|
|
13523
|
+
behaviorContext = `
|
|
13524
|
+
## New Behavioral Updates (hot-reload)
|
|
13525
|
+
These behaviors were added/modified since your session started. Apply them immediately.
|
|
13466
13526
|
|
|
13467
13527
|
${lines.join("\n")}`;
|
|
13468
13528
|
}
|
|
13529
|
+
mkdirSync12(CACHE_DIR3, { recursive: true });
|
|
13530
|
+
writeFileSync11(behaviorLastCheckPath, (/* @__PURE__ */ new Date()).toISOString(), "utf8");
|
|
13469
13531
|
}
|
|
13470
13532
|
} catch {
|
|
13471
13533
|
}
|
|
@@ -6483,15 +6483,18 @@ var init_embedder = __esm({
|
|
|
6483
6483
|
import crypto5 from "crypto";
|
|
6484
6484
|
async function storeBehavior(opts) {
|
|
6485
6485
|
try {
|
|
6486
|
-
const { loadEmployeesSync: loadEmployeesSync2 } = await Promise.resolve().then(() => (init_employees(), employees_exports));
|
|
6486
|
+
const { loadEmployeesSync: loadEmployeesSync2, baseAgentName: baseAgentName2 } = await Promise.resolve().then(() => (init_employees(), employees_exports));
|
|
6487
6487
|
const roster = loadEmployeesSync2();
|
|
6488
|
-
if (roster.length > 0
|
|
6489
|
-
|
|
6490
|
-
|
|
6488
|
+
if (roster.length > 0) {
|
|
6489
|
+
const base = baseAgentName2(opts.agentId, roster);
|
|
6490
|
+
if (!roster.some((e) => e.name === opts.agentId || e.name === base)) {
|
|
6491
|
+
process.stderr.write(
|
|
6492
|
+
`[behaviors] WARNING: Agent "${opts.agentId}" not found in roster. Storing behavior anyway \u2014 may be orphaned.
|
|
6493
|
+
`
|
|
6494
|
+
);
|
|
6491
6495
|
}
|
|
6492
6496
|
}
|
|
6493
|
-
} catch
|
|
6494
|
-
if (e instanceof Error && e.message.includes("not found in roster")) throw e;
|
|
6497
|
+
} catch {
|
|
6495
6498
|
}
|
|
6496
6499
|
const client = getClient();
|
|
6497
6500
|
const id = crypto5.randomUUID();
|
package/dist/index.js
CHANGED
|
@@ -6489,20 +6489,24 @@ __export(behaviors_exports, {
|
|
|
6489
6489
|
deactivateBehavior: () => deactivateBehavior,
|
|
6490
6490
|
listBehaviors: () => listBehaviors,
|
|
6491
6491
|
listBehaviorsByDomain: () => listBehaviorsByDomain,
|
|
6492
|
+
listBehaviorsSince: () => listBehaviorsSince,
|
|
6492
6493
|
storeBehavior: () => storeBehavior
|
|
6493
6494
|
});
|
|
6494
6495
|
import crypto5 from "crypto";
|
|
6495
6496
|
async function storeBehavior(opts) {
|
|
6496
6497
|
try {
|
|
6497
|
-
const { loadEmployeesSync: loadEmployeesSync2 } = await Promise.resolve().then(() => (init_employees(), employees_exports));
|
|
6498
|
+
const { loadEmployeesSync: loadEmployeesSync2, baseAgentName: baseAgentName2 } = await Promise.resolve().then(() => (init_employees(), employees_exports));
|
|
6498
6499
|
const roster = loadEmployeesSync2();
|
|
6499
|
-
if (roster.length > 0
|
|
6500
|
-
|
|
6501
|
-
|
|
6500
|
+
if (roster.length > 0) {
|
|
6501
|
+
const base = baseAgentName2(opts.agentId, roster);
|
|
6502
|
+
if (!roster.some((e) => e.name === opts.agentId || e.name === base)) {
|
|
6503
|
+
process.stderr.write(
|
|
6504
|
+
`[behaviors] WARNING: Agent "${opts.agentId}" not found in roster. Storing behavior anyway \u2014 may be orphaned.
|
|
6505
|
+
`
|
|
6506
|
+
);
|
|
6502
6507
|
}
|
|
6503
6508
|
}
|
|
6504
|
-
} catch
|
|
6505
|
-
if (e instanceof Error && e.message.includes("not found in roster")) throw e;
|
|
6509
|
+
} catch {
|
|
6506
6510
|
}
|
|
6507
6511
|
const client = getClient();
|
|
6508
6512
|
const id = crypto5.randomUUID();
|
|
@@ -6593,6 +6597,38 @@ async function listBehaviorsByDomain(agentId, domain) {
|
|
|
6593
6597
|
source_session_id: r.source_session_id ? String(r.source_session_id) : null
|
|
6594
6598
|
}));
|
|
6595
6599
|
}
|
|
6600
|
+
async function listBehaviorsSince(agentId, sinceIso, projectName, limit = 15) {
|
|
6601
|
+
const client = getClient();
|
|
6602
|
+
const result = await client.execute({
|
|
6603
|
+
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
|
|
6604
|
+
FROM behaviors
|
|
6605
|
+
WHERE agent_id = ? AND active = 1
|
|
6606
|
+
AND (project_name IS NULL OR project_name = ?)
|
|
6607
|
+
AND (created_at > ? OR updated_at > ?)
|
|
6608
|
+
ORDER BY
|
|
6609
|
+
CASE WHEN priority = 'p0' THEN 0
|
|
6610
|
+
WHEN priority = 'p1' THEN 1
|
|
6611
|
+
ELSE 2 END,
|
|
6612
|
+
updated_at DESC
|
|
6613
|
+
LIMIT ?`,
|
|
6614
|
+
args: [agentId, projectName ?? "", sinceIso, sinceIso, limit]
|
|
6615
|
+
});
|
|
6616
|
+
return result.rows.map((r) => ({
|
|
6617
|
+
id: String(r.id),
|
|
6618
|
+
agent_id: String(r.agent_id),
|
|
6619
|
+
project_name: r.project_name ? String(r.project_name) : null,
|
|
6620
|
+
domain: r.domain ? String(r.domain) : null,
|
|
6621
|
+
priority: String(r.priority || "p1"),
|
|
6622
|
+
content: String(r.content),
|
|
6623
|
+
active: Number(r.active),
|
|
6624
|
+
created_at: String(r.created_at),
|
|
6625
|
+
updated_at: String(r.updated_at),
|
|
6626
|
+
vector: r.vector ? Array.from(new Float32Array(r.vector)) : null,
|
|
6627
|
+
created_by_agent: r.created_by_agent ? String(r.created_by_agent) : null,
|
|
6628
|
+
created_by_device: r.created_by_device ? String(r.created_by_device) : null,
|
|
6629
|
+
source_session_id: r.source_session_id ? String(r.source_session_id) : null
|
|
6630
|
+
}));
|
|
6631
|
+
}
|
|
6596
6632
|
async function deactivateBehavior(id) {
|
|
6597
6633
|
const client = getClient();
|
|
6598
6634
|
const result = await client.execute({
|