@askexenow/exe-os 0.9.112 → 0.9.113
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/README.md +9 -7
- package/dist/bin/agentic-ontology-backfill.js +54 -11
- package/dist/bin/agentic-reflection-backfill.js +29 -1
- package/dist/bin/agentic-semantic-label.js +29 -1
- package/dist/bin/backfill-conversations.js +53 -10
- package/dist/bin/backfill-responses.js +54 -11
- package/dist/bin/backfill-vectors.js +29 -1
- package/dist/bin/bulk-sync-postgres.js +55 -12
- package/dist/bin/cleanup-stale-review-tasks.js +75 -15
- package/dist/bin/cli.js +293 -76
- package/dist/bin/exe-agent-config.js +7 -1
- package/dist/bin/exe-agent.js +28 -2
- package/dist/bin/exe-assign.js +54 -11
- package/dist/bin/exe-boot.js +481 -147
- package/dist/bin/exe-call.js +45 -4
- package/dist/bin/exe-cloud.js +93 -15
- package/dist/bin/exe-dispatch.js +369 -24
- package/dist/bin/exe-doctor.js +53 -10
- package/dist/bin/exe-export-behaviors.js +54 -11
- package/dist/bin/exe-forget.js +54 -11
- package/dist/bin/exe-gateway.js +128 -23
- package/dist/bin/exe-heartbeat.js +75 -15
- package/dist/bin/exe-kill.js +54 -11
- package/dist/bin/exe-launch-agent.js +70 -12
- package/dist/bin/exe-new-employee.js +175 -7
- package/dist/bin/exe-pending-messages.js +75 -15
- package/dist/bin/exe-pending-notifications.js +75 -15
- package/dist/bin/exe-pending-reviews.js +75 -15
- package/dist/bin/exe-rename.js +54 -11
- package/dist/bin/exe-review.js +54 -11
- package/dist/bin/exe-search.js +54 -11
- package/dist/bin/exe-session-cleanup.js +491 -146
- package/dist/bin/exe-settings.js +10 -4
- package/dist/bin/exe-start-codex.js +524 -245
- package/dist/bin/exe-start-opencode.js +534 -165
- package/dist/bin/exe-status.js +75 -15
- package/dist/bin/exe-support.js +1 -1
- package/dist/bin/exe-team.js +54 -11
- package/dist/bin/git-sweep.js +369 -24
- package/dist/bin/graph-backfill.js +54 -11
- package/dist/bin/graph-export.js +54 -11
- package/dist/bin/install.js +62 -4
- package/dist/bin/intercom-check.js +491 -146
- package/dist/bin/pre-publish.js +13 -1
- package/dist/bin/scan-tasks.js +369 -24
- package/dist/bin/setup.js +91 -13
- package/dist/bin/shard-migrate.js +54 -11
- package/dist/bin/stack-update.js +1 -1
- package/dist/bin/update.js +3 -3
- package/dist/gateway/index.js +128 -23
- package/dist/hooks/bug-report-worker.js +128 -23
- package/dist/hooks/codex-stop-task-finalizer.js +512 -140
- package/dist/hooks/commit-complete.js +369 -24
- package/dist/hooks/error-recall.js +54 -11
- package/dist/hooks/ingest.js +4575 -252
- package/dist/hooks/instructions-loaded.js +54 -11
- package/dist/hooks/notification.js +54 -11
- package/dist/hooks/post-compact.js +75 -15
- package/dist/hooks/post-tool-combined.js +75 -15
- package/dist/hooks/pre-compact.js +449 -104
- package/dist/hooks/pre-tool-use.js +90 -15
- package/dist/hooks/prompt-submit.js +129 -24
- package/dist/hooks/session-end.js +451 -109
- package/dist/hooks/session-start.js +104 -16
- package/dist/hooks/stop.js +74 -14
- package/dist/hooks/subagent-stop.js +75 -15
- package/dist/hooks/summary-worker.js +73 -7
- package/dist/index.js +128 -23
- package/dist/lib/agent-config.js +16 -1
- package/dist/lib/cloud-sync.js +38 -1
- package/dist/lib/consolidation.js +16 -1
- package/dist/lib/database.js +16 -0
- package/dist/lib/db.js +16 -0
- package/dist/lib/device-registry.js +16 -0
- package/dist/lib/employee-templates.js +29 -3
- package/dist/lib/employees.js +16 -1
- package/dist/lib/exe-daemon.js +268 -42
- package/dist/lib/hybrid-search.js +54 -11
- package/dist/lib/license.js +3 -3
- package/dist/lib/messaging.js +21 -4
- package/dist/lib/schedules.js +29 -1
- package/dist/lib/skill-learning.js +458 -70
- package/dist/lib/status-brief.js +14 -1
- package/dist/lib/store.js +54 -11
- package/dist/lib/tasks.js +393 -91
- package/dist/lib/tmux-routing.js +316 -14
- package/dist/mcp/server.js +169 -30
- package/dist/mcp/tools/create-task.js +75 -13
- package/dist/mcp/tools/deactivate-behavior.js +33 -24
- package/dist/mcp/tools/list-tasks.js +21 -4
- package/dist/mcp/tools/send-message.js +21 -4
- package/dist/mcp/tools/update-task.js +390 -91
- package/dist/runtime/index.js +446 -101
- package/dist/tui/App.js +208 -54
- package/package.json +1 -1
|
@@ -3034,6 +3034,22 @@ async function ensureSchema() {
|
|
|
3034
3034
|
} catch (e) {
|
|
3035
3035
|
logCatchDebug("migration", e);
|
|
3036
3036
|
}
|
|
3037
|
+
try {
|
|
3038
|
+
await client.execute({
|
|
3039
|
+
sql: `ALTER TABLE memories ADD COLUMN visibility TEXT DEFAULT 'private'`,
|
|
3040
|
+
args: []
|
|
3041
|
+
});
|
|
3042
|
+
} catch (e) {
|
|
3043
|
+
logCatchDebug("migration", e);
|
|
3044
|
+
}
|
|
3045
|
+
try {
|
|
3046
|
+
await client.execute({
|
|
3047
|
+
sql: `ALTER TABLE memories ADD COLUMN strength REAL DEFAULT 1.0`,
|
|
3048
|
+
args: []
|
|
3049
|
+
});
|
|
3050
|
+
} catch (e) {
|
|
3051
|
+
logCatchDebug("migration", e);
|
|
3052
|
+
}
|
|
3037
3053
|
}
|
|
3038
3054
|
async function disposeDatabase() {
|
|
3039
3055
|
if (_walCheckpointTimer) {
|
|
@@ -3600,11 +3616,17 @@ var init_platform_procedures = __esm({
|
|
|
3600
3616
|
content: "Founder -> coordinator (the executive agent, internally routed as 'COO') -> CTO/CMO. CTO -> engineers. CMO -> content production. Never skip levels: the coordinator does not bypass managers for specialist work. Specialists report to their manager. If you need cross-team info, use ask_team_memory \u2014 don't read other agents' task folders. Each level owns dispatch downward and review upward."
|
|
3601
3617
|
},
|
|
3602
3618
|
{
|
|
3603
|
-
title: "
|
|
3619
|
+
title: "Orchestration phase guidance \u2014 recommend, never trap",
|
|
3604
3620
|
domain: "workflow",
|
|
3605
3621
|
priority: "p1",
|
|
3606
3622
|
content: "New customers start best in Phase 1: founder \u2194 coordinator/Chief of Staff, building company context. Suggest Phase 2 executives when domain work repeats; suggest Phase 3 parallel execution only when review/permission gates are ready. This is guidance, not a blocker: users may jump phases anytime. Never overwrite their phase, role titles, identities, or custom org design."
|
|
3607
3623
|
},
|
|
3624
|
+
{
|
|
3625
|
+
title: "Routing slot vs display title \u2014 internal 'coo' is plumbing, not your name",
|
|
3626
|
+
domain: "identity",
|
|
3627
|
+
priority: "p0",
|
|
3628
|
+
content: "These procedures reference 'COO' as a shorthand for the coordinator role. This is an INTERNAL routing slot used by exe-os code (chain-of-command checks, dispatch logic, session detection). It is NOT your display title. Your actual title comes from your identity file's `title:` field \u2014 that is what you use externally: introductions, sign-offs, team comms, and any user-facing text. If your identity says `title: AI Chief of Staff`, you are the AI Chief of Staff. The routing slot stays `role: coo` for code compatibility \u2014 never rename it, but also never introduce yourself as 'COO' unless your identity file explicitly says so. The founder chose your title; respect it."
|
|
3629
|
+
},
|
|
3608
3630
|
{
|
|
3609
3631
|
title: "Single dispatch path \u2014 create_task only",
|
|
3610
3632
|
domain: "workflow",
|
|
@@ -3638,6 +3660,12 @@ var init_platform_procedures = __esm({
|
|
|
3638
3660
|
priority: "p0",
|
|
3639
3661
|
content: "NEVER: (1) Access the database directly \u2014 it's SQLCipher encrypted, always fails. Use MCP tools only. (2) Manually spawn tmux sessions \u2014 create_task handles it. (3) Run git checkout main \u2014 agents work in worktrees. (4) Modify another agent's in-progress task. (5) Push to remote \u2014 the COO reviews and pushes. (6) Skip update_task(done) \u2014 it's the ONLY way your work gets reviewed. (7) Run git init."
|
|
3640
3662
|
},
|
|
3663
|
+
{
|
|
3664
|
+
title: "Destructive operations \u2014 mandatory reviewer gate",
|
|
3665
|
+
domain: "security",
|
|
3666
|
+
priority: "p0",
|
|
3667
|
+
content: "Before ANY destructive operation (delete, remove, overwrite, drop, reset, force-push, truncate), you MUST: (1) Have your full task spec accessible \u2014 if you cannot read it, STOP and report to your reviewer. Never improvise destructive actions. (2) Confirm with your reviewer (assigned_by or COO) before executing. (3) If the task spec explicitly authorizes the operation, proceed \u2014 but log it. Violation = immediate task failure. This applies to ALL agents regardless of role."
|
|
3668
|
+
},
|
|
3641
3669
|
{
|
|
3642
3670
|
title: "Customer patch triage \u2014 upstream bug vs customization",
|
|
3643
3671
|
domain: "support",
|
|
@@ -3923,10 +3951,24 @@ function stableId(memoryId, type, content) {
|
|
|
3923
3951
|
return createHash2("sha256").update(`${memoryId}:${type}:${content}`).digest("hex").slice(0, 32);
|
|
3924
3952
|
}
|
|
3925
3953
|
function cleanText(text) {
|
|
3926
|
-
|
|
3927
|
-
|
|
3928
|
-
|
|
3929
|
-
|
|
3954
|
+
let cleaned = text.replace(
|
|
3955
|
+
/```(\w*)\n(.*?)(?:\n[\s\S]*?)```/g,
|
|
3956
|
+
(_m, lang, firstLine) => `[code${lang ? `:${lang}` : ""}] ${firstLine.trim()}`
|
|
3957
|
+
);
|
|
3958
|
+
cleaned = cleaned.replace(/<[^>]+>/g, " ").replace(/\s+/g, " ").trim();
|
|
3959
|
+
return cleaned;
|
|
3960
|
+
}
|
|
3961
|
+
function splitSegments(text) {
|
|
3962
|
+
const cleaned = cleanText(text);
|
|
3963
|
+
const segments = cleaned.split(/(?<=[.!?:;])\s+|\n{2,}|(?<=\))\s+(?=[A-Z])|\s*[|│]\s*/).map((s) => s.trim()).filter((s) => s.length >= MIN_SEGMENT_CHARS && s.length <= MAX_SEGMENT_CHARS);
|
|
3964
|
+
if (segments.length === 0 && cleaned.length >= MIN_SEGMENT_CHARS) {
|
|
3965
|
+
const lines = cleaned.split(/\n+/).map((l) => l.trim()).filter((l) => l.length >= MIN_SEGMENT_CHARS && l.length <= MAX_SEGMENT_CHARS);
|
|
3966
|
+
if (lines.length > 0) return lines;
|
|
3967
|
+
if (cleaned.length >= MIN_SEGMENT_CHARS) {
|
|
3968
|
+
return [cleaned.slice(0, MAX_SEGMENT_CHARS)];
|
|
3969
|
+
}
|
|
3970
|
+
}
|
|
3971
|
+
return segments;
|
|
3930
3972
|
}
|
|
3931
3973
|
function inferCardType(sentence, toolName) {
|
|
3932
3974
|
const lower = sentence.toLowerCase();
|
|
@@ -3958,12 +4000,12 @@ function predicateFor(type) {
|
|
|
3958
4000
|
}
|
|
3959
4001
|
}
|
|
3960
4002
|
function extractMemoryCards(row) {
|
|
3961
|
-
const
|
|
4003
|
+
const segments = splitSegments(row.raw_text);
|
|
3962
4004
|
const cards = [];
|
|
3963
|
-
for (const sentence of
|
|
4005
|
+
for (const sentence of segments) {
|
|
3964
4006
|
const type = inferCardType(sentence, row.tool_name);
|
|
3965
4007
|
const subject = extractSubject(sentence, row.agent_id);
|
|
3966
|
-
const content = sentence.length >
|
|
4008
|
+
const content = sentence.length > MAX_SEGMENT_CHARS ? `${sentence.slice(0, MAX_SEGMENT_CHARS - 1)}\u2026` : sentence;
|
|
3967
4009
|
cards.push({
|
|
3968
4010
|
id: stableId(row.id, type, content),
|
|
3969
4011
|
memory_id: row.id,
|
|
@@ -4059,13 +4101,14 @@ Source memory: ${String(row.source_ref ?? row.memory_id)}`,
|
|
|
4059
4101
|
last_accessed: String(row.timestamp)
|
|
4060
4102
|
}));
|
|
4061
4103
|
}
|
|
4062
|
-
var MAX_CARDS_PER_MEMORY,
|
|
4104
|
+
var MAX_CARDS_PER_MEMORY, MAX_SEGMENT_CHARS, MIN_SEGMENT_CHARS;
|
|
4063
4105
|
var init_memory_cards = __esm({
|
|
4064
4106
|
"src/lib/memory-cards.ts"() {
|
|
4065
4107
|
"use strict";
|
|
4066
4108
|
init_database();
|
|
4067
|
-
MAX_CARDS_PER_MEMORY =
|
|
4068
|
-
|
|
4109
|
+
MAX_CARDS_PER_MEMORY = 8;
|
|
4110
|
+
MAX_SEGMENT_CHARS = 500;
|
|
4111
|
+
MIN_SEGMENT_CHARS = 20;
|
|
4069
4112
|
}
|
|
4070
4113
|
});
|
|
4071
4114
|
|
package/dist/bin/graph-export.js
CHANGED
|
@@ -3249,6 +3249,22 @@ async function ensureSchema() {
|
|
|
3249
3249
|
} catch (e) {
|
|
3250
3250
|
logCatchDebug("migration", e);
|
|
3251
3251
|
}
|
|
3252
|
+
try {
|
|
3253
|
+
await client.execute({
|
|
3254
|
+
sql: `ALTER TABLE memories ADD COLUMN visibility TEXT DEFAULT 'private'`,
|
|
3255
|
+
args: []
|
|
3256
|
+
});
|
|
3257
|
+
} catch (e) {
|
|
3258
|
+
logCatchDebug("migration", e);
|
|
3259
|
+
}
|
|
3260
|
+
try {
|
|
3261
|
+
await client.execute({
|
|
3262
|
+
sql: `ALTER TABLE memories ADD COLUMN strength REAL DEFAULT 1.0`,
|
|
3263
|
+
args: []
|
|
3264
|
+
});
|
|
3265
|
+
} catch (e) {
|
|
3266
|
+
logCatchDebug("migration", e);
|
|
3267
|
+
}
|
|
3252
3268
|
}
|
|
3253
3269
|
async function disposeDatabase() {
|
|
3254
3270
|
if (_walCheckpointTimer) {
|
|
@@ -4372,11 +4388,17 @@ var init_platform_procedures = __esm({
|
|
|
4372
4388
|
content: "Founder -> coordinator (the executive agent, internally routed as 'COO') -> CTO/CMO. CTO -> engineers. CMO -> content production. Never skip levels: the coordinator does not bypass managers for specialist work. Specialists report to their manager. If you need cross-team info, use ask_team_memory \u2014 don't read other agents' task folders. Each level owns dispatch downward and review upward."
|
|
4373
4389
|
},
|
|
4374
4390
|
{
|
|
4375
|
-
title: "
|
|
4391
|
+
title: "Orchestration phase guidance \u2014 recommend, never trap",
|
|
4376
4392
|
domain: "workflow",
|
|
4377
4393
|
priority: "p1",
|
|
4378
4394
|
content: "New customers start best in Phase 1: founder \u2194 coordinator/Chief of Staff, building company context. Suggest Phase 2 executives when domain work repeats; suggest Phase 3 parallel execution only when review/permission gates are ready. This is guidance, not a blocker: users may jump phases anytime. Never overwrite their phase, role titles, identities, or custom org design."
|
|
4379
4395
|
},
|
|
4396
|
+
{
|
|
4397
|
+
title: "Routing slot vs display title \u2014 internal 'coo' is plumbing, not your name",
|
|
4398
|
+
domain: "identity",
|
|
4399
|
+
priority: "p0",
|
|
4400
|
+
content: "These procedures reference 'COO' as a shorthand for the coordinator role. This is an INTERNAL routing slot used by exe-os code (chain-of-command checks, dispatch logic, session detection). It is NOT your display title. Your actual title comes from your identity file's `title:` field \u2014 that is what you use externally: introductions, sign-offs, team comms, and any user-facing text. If your identity says `title: AI Chief of Staff`, you are the AI Chief of Staff. The routing slot stays `role: coo` for code compatibility \u2014 never rename it, but also never introduce yourself as 'COO' unless your identity file explicitly says so. The founder chose your title; respect it."
|
|
4401
|
+
},
|
|
4380
4402
|
{
|
|
4381
4403
|
title: "Single dispatch path \u2014 create_task only",
|
|
4382
4404
|
domain: "workflow",
|
|
@@ -4410,6 +4432,12 @@ var init_platform_procedures = __esm({
|
|
|
4410
4432
|
priority: "p0",
|
|
4411
4433
|
content: "NEVER: (1) Access the database directly \u2014 it's SQLCipher encrypted, always fails. Use MCP tools only. (2) Manually spawn tmux sessions \u2014 create_task handles it. (3) Run git checkout main \u2014 agents work in worktrees. (4) Modify another agent's in-progress task. (5) Push to remote \u2014 the COO reviews and pushes. (6) Skip update_task(done) \u2014 it's the ONLY way your work gets reviewed. (7) Run git init."
|
|
4412
4434
|
},
|
|
4435
|
+
{
|
|
4436
|
+
title: "Destructive operations \u2014 mandatory reviewer gate",
|
|
4437
|
+
domain: "security",
|
|
4438
|
+
priority: "p0",
|
|
4439
|
+
content: "Before ANY destructive operation (delete, remove, overwrite, drop, reset, force-push, truncate), you MUST: (1) Have your full task spec accessible \u2014 if you cannot read it, STOP and report to your reviewer. Never improvise destructive actions. (2) Confirm with your reviewer (assigned_by or COO) before executing. (3) If the task spec explicitly authorizes the operation, proceed \u2014 but log it. Violation = immediate task failure. This applies to ALL agents regardless of role."
|
|
4440
|
+
},
|
|
4413
4441
|
{
|
|
4414
4442
|
title: "Customer patch triage \u2014 upstream bug vs customization",
|
|
4415
4443
|
domain: "support",
|
|
@@ -4695,10 +4723,24 @@ function stableId(memoryId, type, content) {
|
|
|
4695
4723
|
return createHash2("sha256").update(`${memoryId}:${type}:${content}`).digest("hex").slice(0, 32);
|
|
4696
4724
|
}
|
|
4697
4725
|
function cleanText(text) {
|
|
4698
|
-
|
|
4699
|
-
|
|
4700
|
-
|
|
4701
|
-
|
|
4726
|
+
let cleaned = text.replace(
|
|
4727
|
+
/```(\w*)\n(.*?)(?:\n[\s\S]*?)```/g,
|
|
4728
|
+
(_m, lang, firstLine) => `[code${lang ? `:${lang}` : ""}] ${firstLine.trim()}`
|
|
4729
|
+
);
|
|
4730
|
+
cleaned = cleaned.replace(/<[^>]+>/g, " ").replace(/\s+/g, " ").trim();
|
|
4731
|
+
return cleaned;
|
|
4732
|
+
}
|
|
4733
|
+
function splitSegments(text) {
|
|
4734
|
+
const cleaned = cleanText(text);
|
|
4735
|
+
const segments = cleaned.split(/(?<=[.!?:;])\s+|\n{2,}|(?<=\))\s+(?=[A-Z])|\s*[|│]\s*/).map((s) => s.trim()).filter((s) => s.length >= MIN_SEGMENT_CHARS && s.length <= MAX_SEGMENT_CHARS);
|
|
4736
|
+
if (segments.length === 0 && cleaned.length >= MIN_SEGMENT_CHARS) {
|
|
4737
|
+
const lines = cleaned.split(/\n+/).map((l) => l.trim()).filter((l) => l.length >= MIN_SEGMENT_CHARS && l.length <= MAX_SEGMENT_CHARS);
|
|
4738
|
+
if (lines.length > 0) return lines;
|
|
4739
|
+
if (cleaned.length >= MIN_SEGMENT_CHARS) {
|
|
4740
|
+
return [cleaned.slice(0, MAX_SEGMENT_CHARS)];
|
|
4741
|
+
}
|
|
4742
|
+
}
|
|
4743
|
+
return segments;
|
|
4702
4744
|
}
|
|
4703
4745
|
function inferCardType(sentence, toolName) {
|
|
4704
4746
|
const lower = sentence.toLowerCase();
|
|
@@ -4730,12 +4772,12 @@ function predicateFor(type) {
|
|
|
4730
4772
|
}
|
|
4731
4773
|
}
|
|
4732
4774
|
function extractMemoryCards(row) {
|
|
4733
|
-
const
|
|
4775
|
+
const segments = splitSegments(row.raw_text);
|
|
4734
4776
|
const cards = [];
|
|
4735
|
-
for (const sentence of
|
|
4777
|
+
for (const sentence of segments) {
|
|
4736
4778
|
const type = inferCardType(sentence, row.tool_name);
|
|
4737
4779
|
const subject = extractSubject(sentence, row.agent_id);
|
|
4738
|
-
const content = sentence.length >
|
|
4780
|
+
const content = sentence.length > MAX_SEGMENT_CHARS ? `${sentence.slice(0, MAX_SEGMENT_CHARS - 1)}\u2026` : sentence;
|
|
4739
4781
|
cards.push({
|
|
4740
4782
|
id: stableId(row.id, type, content),
|
|
4741
4783
|
memory_id: row.id,
|
|
@@ -4831,13 +4873,14 @@ Source memory: ${String(row.source_ref ?? row.memory_id)}`,
|
|
|
4831
4873
|
last_accessed: String(row.timestamp)
|
|
4832
4874
|
}));
|
|
4833
4875
|
}
|
|
4834
|
-
var MAX_CARDS_PER_MEMORY,
|
|
4876
|
+
var MAX_CARDS_PER_MEMORY, MAX_SEGMENT_CHARS, MIN_SEGMENT_CHARS;
|
|
4835
4877
|
var init_memory_cards = __esm({
|
|
4836
4878
|
"src/lib/memory-cards.ts"() {
|
|
4837
4879
|
"use strict";
|
|
4838
4880
|
init_database();
|
|
4839
|
-
MAX_CARDS_PER_MEMORY =
|
|
4840
|
-
|
|
4881
|
+
MAX_CARDS_PER_MEMORY = 8;
|
|
4882
|
+
MAX_SEGMENT_CHARS = 500;
|
|
4883
|
+
MIN_SEGMENT_CHARS = 20;
|
|
4841
4884
|
}
|
|
4842
4885
|
});
|
|
4843
4886
|
|
package/dist/bin/install.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
4
6
|
var __esm = (fn, res) => function __init() {
|
|
5
7
|
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
6
8
|
};
|
|
@@ -8,6 +10,15 @@ var __export = (target, all) => {
|
|
|
8
10
|
for (var name in all)
|
|
9
11
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
12
|
};
|
|
13
|
+
var __copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
+
for (let key of __getOwnPropNames(from))
|
|
16
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
17
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
18
|
+
}
|
|
19
|
+
return to;
|
|
20
|
+
};
|
|
21
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
11
22
|
|
|
12
23
|
// src/lib/secure-files.ts
|
|
13
24
|
import { chmodSync, existsSync, mkdirSync } from "fs";
|
|
@@ -171,6 +182,7 @@ __export(agent_config_exports, {
|
|
|
171
182
|
getAgentRuntime: () => getAgentRuntime,
|
|
172
183
|
loadAgentConfig: () => loadAgentConfig,
|
|
173
184
|
saveAgentConfig: () => saveAgentConfig,
|
|
185
|
+
setAgentMcps: () => setAgentMcps,
|
|
174
186
|
setAgentRuntime: () => setAgentRuntime
|
|
175
187
|
});
|
|
176
188
|
import { readFileSync as readFileSync2, writeFileSync, existsSync as existsSync3 } from "fs";
|
|
@@ -197,7 +209,7 @@ function getAgentRuntime(agentId) {
|
|
|
197
209
|
if (orgDefault) return orgDefault;
|
|
198
210
|
return { runtime: DEFAULT_RUNTIME, model: DEFAULT_MODELS[DEFAULT_RUNTIME] };
|
|
199
211
|
}
|
|
200
|
-
function setAgentRuntime(agentId, runtime, model, reasoning_effort) {
|
|
212
|
+
function setAgentRuntime(agentId, runtime, model, reasoning_effort, mcps) {
|
|
201
213
|
const knownModels = KNOWN_RUNTIMES[runtime];
|
|
202
214
|
if (!knownModels) {
|
|
203
215
|
return {
|
|
@@ -212,12 +224,26 @@ function setAgentRuntime(agentId, runtime, model, reasoning_effort) {
|
|
|
212
224
|
};
|
|
213
225
|
}
|
|
214
226
|
const config = loadAgentConfig();
|
|
227
|
+
const existing = config[agentId];
|
|
215
228
|
const entry = { runtime, model };
|
|
216
229
|
if (reasoning_effort) entry.reasoning_effort = reasoning_effort;
|
|
230
|
+
if (mcps !== void 0) {
|
|
231
|
+
entry.mcps = mcps.includes("exe-os") ? mcps : ["exe-os", ...mcps];
|
|
232
|
+
} else if (existing?.mcps) {
|
|
233
|
+
entry.mcps = existing.mcps;
|
|
234
|
+
}
|
|
217
235
|
config[agentId] = entry;
|
|
218
236
|
saveAgentConfig(config);
|
|
219
237
|
return { ok: true };
|
|
220
238
|
}
|
|
239
|
+
function setAgentMcps(agentId, mcps) {
|
|
240
|
+
const config = loadAgentConfig();
|
|
241
|
+
const existing = config[agentId] ?? getAgentRuntime(agentId);
|
|
242
|
+
existing.mcps = mcps.includes("exe-os") ? mcps : ["exe-os", ...mcps];
|
|
243
|
+
config[agentId] = existing;
|
|
244
|
+
saveAgentConfig(config);
|
|
245
|
+
return { ok: true };
|
|
246
|
+
}
|
|
221
247
|
function clearAgentRuntime(agentId) {
|
|
222
248
|
const config = loadAgentConfig();
|
|
223
249
|
delete config[agentId];
|
|
@@ -614,6 +640,16 @@ import { chmodSync as chmodSync2, existsSync as existsSync7, mkdirSync as mkdirS
|
|
|
614
640
|
import { randomBytes } from "crypto";
|
|
615
641
|
import path6 from "path";
|
|
616
642
|
import os5 from "os";
|
|
643
|
+
function resolveDefaultAgentId() {
|
|
644
|
+
if (process.env.AGENT_ID && process.env.AGENT_ID !== "default") return process.env.AGENT_ID;
|
|
645
|
+
try {
|
|
646
|
+
const { loadEmployeesSync: loadEmployeesSync2 } = (init_employees(), __toCommonJS(employees_exports));
|
|
647
|
+
const coo = loadEmployeesSync2().find((e) => e.role === "COO");
|
|
648
|
+
if (coo) return coo.name;
|
|
649
|
+
} catch {
|
|
650
|
+
}
|
|
651
|
+
return "exe";
|
|
652
|
+
}
|
|
617
653
|
function mcpHttpPort() {
|
|
618
654
|
return process.env.EXE_MCP_PORT || DEFAULT_MCP_HTTP_PORT;
|
|
619
655
|
}
|
|
@@ -643,11 +679,14 @@ function readOrCreateDaemonToken(homeDir = os5.homedir()) {
|
|
|
643
679
|
function buildMcpHttpHeaders(homeDir = os5.homedir(), opts = {}) {
|
|
644
680
|
const agentId = opts.useShellPlaceholders ? "${AGENT_ID:-exe}" : opts.agentId ?? DEFAULT_MCP_HTTP_AGENT_ID;
|
|
645
681
|
const agentRole = opts.useShellPlaceholders ? "${AGENT_ROLE:-COO}" : opts.agentRole ?? DEFAULT_MCP_HTTP_AGENT_ROLE;
|
|
646
|
-
|
|
682
|
+
const sessionName = opts.useShellPlaceholders ? "$(tmux display-message -p '#{session_name}' 2>/dev/null || echo '')" : process.env.EXE_SESSION_NAME ?? "";
|
|
683
|
+
const headers = {
|
|
647
684
|
Authorization: `Bearer ${readOrCreateDaemonToken(homeDir)}`,
|
|
648
685
|
"X-Agent-Id": agentId,
|
|
649
686
|
"X-Agent-Role": agentRole
|
|
650
687
|
};
|
|
688
|
+
if (sessionName) headers["X-Exe-Session"] = sessionName;
|
|
689
|
+
return headers;
|
|
651
690
|
}
|
|
652
691
|
function buildClaudeHttpMcpEntry(homeDir = os5.homedir()) {
|
|
653
692
|
return {
|
|
@@ -661,19 +700,22 @@ var init_mcp_http_config = __esm({
|
|
|
661
700
|
"src/adapters/mcp-http-config.ts"() {
|
|
662
701
|
"use strict";
|
|
663
702
|
DEFAULT_MCP_HTTP_PORT = "48739";
|
|
664
|
-
DEFAULT_MCP_HTTP_AGENT_ID =
|
|
703
|
+
DEFAULT_MCP_HTTP_AGENT_ID = resolveDefaultAgentId();
|
|
665
704
|
DEFAULT_MCP_HTTP_AGENT_ROLE = "COO";
|
|
666
705
|
}
|
|
667
706
|
});
|
|
668
707
|
|
|
669
708
|
// src/adapters/runtime-hook-manifest.ts
|
|
709
|
+
function isLegacyHomeDirHookCommand(command) {
|
|
710
|
+
return LEGACY_HOME_DIR_HOOK_PATTERNS.some((pattern) => command.includes(pattern));
|
|
711
|
+
}
|
|
670
712
|
function commandHasAnyMarker(command, markers) {
|
|
671
713
|
return markers.some((marker) => command.includes(marker));
|
|
672
714
|
}
|
|
673
715
|
function isLegacySplitPostToolCommand(command) {
|
|
674
716
|
return commandHasAnyMarker(command, LEGACY_SPLIT_POST_TOOL_HOOK_MARKERS);
|
|
675
717
|
}
|
|
676
|
-
var EXE_HOOKS, EXE_HOOK_MANIFEST, LEGACY_SPLIT_POST_TOOL_HOOK_MARKERS;
|
|
718
|
+
var EXE_HOOKS, EXE_HOOK_MANIFEST, LEGACY_SPLIT_POST_TOOL_HOOK_MARKERS, LEGACY_HOME_DIR_HOOK_PATTERNS;
|
|
677
719
|
var init_runtime_hook_manifest = __esm({
|
|
678
720
|
"src/adapters/runtime-hook-manifest.ts"() {
|
|
679
721
|
"use strict";
|
|
@@ -806,6 +848,14 @@ var init_runtime_hook_manifest = __esm({
|
|
|
806
848
|
"dist/hooks/error-recall.js",
|
|
807
849
|
"dist/hooks/ingest-worker.js"
|
|
808
850
|
];
|
|
851
|
+
LEGACY_HOME_DIR_HOOK_PATTERNS = [
|
|
852
|
+
".exe-os/hooks/",
|
|
853
|
+
// Old hook storage path (pre-npm-package era)
|
|
854
|
+
"log-prefix.js",
|
|
855
|
+
// Removed hook from early versions
|
|
856
|
+
"approval-bridge.log"
|
|
857
|
+
// Removed log redirect from early versions
|
|
858
|
+
];
|
|
809
859
|
}
|
|
810
860
|
});
|
|
811
861
|
|
|
@@ -1272,6 +1322,14 @@ async function mergeHooks(packageRoot, homeDir = os6.homedir()) {
|
|
|
1272
1322
|
];
|
|
1273
1323
|
let added = 0;
|
|
1274
1324
|
let skipped = 0;
|
|
1325
|
+
for (const eventKey of Object.keys(settings.hooks)) {
|
|
1326
|
+
const groups = settings.hooks[eventKey];
|
|
1327
|
+
if (!Array.isArray(groups)) continue;
|
|
1328
|
+
settings.hooks[eventKey] = groups.map((g) => ({
|
|
1329
|
+
...g,
|
|
1330
|
+
hooks: g.hooks.filter((h) => !isLegacyHomeDirHookCommand(h.command))
|
|
1331
|
+
})).filter((g) => g.hooks.length > 0);
|
|
1332
|
+
}
|
|
1275
1333
|
const postToolGroups = settings.hooks["PostToolUse"];
|
|
1276
1334
|
if (Array.isArray(postToolGroups)) {
|
|
1277
1335
|
settings.hooks["PostToolUse"] = postToolGroups.map((g) => ({
|