@askexenow/exe-os 0.9.92 → 0.9.94
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/docker-compose.yml +1 -0
- package/dist/bin/agentic-ontology-backfill.js +65 -8
- package/dist/bin/agentic-reflection-backfill.js +54 -3
- package/dist/bin/agentic-semantic-label.js +54 -3
- package/dist/bin/backfill-conversations.js +69 -9
- package/dist/bin/backfill-responses.js +69 -9
- package/dist/bin/backfill-vectors.js +54 -3
- package/dist/bin/bulk-sync-postgres.js +66 -8
- package/dist/bin/cleanup-stale-review-tasks.js +118 -13
- package/dist/bin/cli.js +1605 -456
- package/dist/bin/customer-readiness.js +51 -0
- package/dist/bin/exe-agent.js +17 -3
- package/dist/bin/exe-assign.js +75 -9
- package/dist/bin/exe-boot.js +111 -12
- package/dist/bin/exe-call.js +17 -3
- package/dist/bin/exe-cloud.js +76 -10
- package/dist/bin/exe-dispatch.js +133 -18
- package/dist/bin/exe-doctor.js +75 -9
- package/dist/bin/exe-export-behaviors.js +75 -9
- package/dist/bin/exe-forget.js +94 -9
- package/dist/bin/exe-gateway.js +132 -18
- package/dist/bin/exe-heartbeat.js +118 -13
- package/dist/bin/exe-kill.js +75 -9
- package/dist/bin/exe-launch-agent.js +75 -9
- package/dist/bin/exe-new-employee.js +18 -4
- package/dist/bin/exe-pending-messages.js +118 -13
- package/dist/bin/exe-pending-notifications.js +118 -13
- package/dist/bin/exe-pending-reviews.js +118 -13
- package/dist/bin/exe-rename.js +75 -9
- package/dist/bin/exe-review.js +75 -9
- package/dist/bin/exe-search.js +100 -9
- package/dist/bin/exe-session-cleanup.js +133 -18
- package/dist/bin/exe-settings.js +1 -0
- package/dist/bin/exe-start-codex.js +65 -8
- package/dist/bin/exe-start-opencode.js +65 -8
- package/dist/bin/exe-status.js +118 -13
- package/dist/bin/exe-support.js +1 -0
- package/dist/bin/exe-team.js +75 -9
- package/dist/bin/git-sweep.js +133 -18
- package/dist/bin/graph-backfill.js +65 -8
- package/dist/bin/graph-export.js +75 -9
- package/dist/bin/intercom-check.js +133 -18
- package/dist/bin/scan-tasks.js +133 -18
- package/dist/bin/setup.js +55 -4
- package/dist/bin/shard-migrate.js +65 -8
- package/dist/bin/stack-update.js +57 -1
- package/dist/bin/update.js +1 -1
- package/dist/gateway/index.js +133 -18
- package/dist/hooks/bug-report-worker.js +133 -18
- package/dist/hooks/codex-stop-task-finalizer.js +123 -14
- package/dist/hooks/commit-complete.js +133 -18
- package/dist/hooks/error-recall.js +100 -9
- package/dist/hooks/ingest.js +75 -9
- package/dist/hooks/instructions-loaded.js +75 -9
- package/dist/hooks/notification.js +75 -9
- package/dist/hooks/post-compact.js +310 -50
- package/dist/hooks/post-tool-combined.js +433 -13
- package/dist/hooks/pre-compact.js +133 -18
- package/dist/hooks/pre-tool-use.js +118 -13
- package/dist/hooks/prompt-submit.js +191 -19
- package/dist/hooks/session-end.js +133 -18
- package/dist/hooks/session-start.js +143 -13
- package/dist/hooks/stop.js +118 -13
- package/dist/hooks/subagent-stop.js +118 -13
- package/dist/hooks/summary-worker.js +96 -7
- package/dist/index.js +133 -18
- package/dist/lib/cloud-sync.js +38 -0
- package/dist/lib/consolidation.js +3 -1
- package/dist/lib/database.js +37 -0
- package/dist/lib/db.js +37 -0
- package/dist/lib/device-registry.js +37 -0
- package/dist/lib/employee-templates.js +17 -3
- package/dist/lib/exe-daemon.js +913 -42
- package/dist/lib/hybrid-search.js +100 -9
- package/dist/lib/license.js +1 -1
- package/dist/lib/messaging.js +40 -4
- package/dist/lib/schedules.js +54 -3
- package/dist/lib/store.js +75 -9
- package/dist/lib/tasks.js +58 -9
- package/dist/lib/tmux-routing.js +58 -9
- package/dist/mcp/server.js +875 -42
- package/dist/mcp/tools/create-task.js +67 -12
- package/dist/mcp/tools/list-tasks.js +46 -5
- package/dist/mcp/tools/send-message.js +40 -4
- package/dist/mcp/tools/update-task.js +58 -9
- package/dist/runtime/index.js +133 -18
- package/dist/tui/App.js +132 -18
- package/package.json +1 -1
package/dist/bin/exe-review.js
CHANGED
|
@@ -2779,6 +2779,20 @@ async function ensureSchema() {
|
|
|
2779
2779
|
});
|
|
2780
2780
|
} catch {
|
|
2781
2781
|
}
|
|
2782
|
+
try {
|
|
2783
|
+
await client.execute({
|
|
2784
|
+
sql: `ALTER TABLE tasks ADD COLUMN spawn_runtime TEXT`,
|
|
2785
|
+
args: []
|
|
2786
|
+
});
|
|
2787
|
+
} catch {
|
|
2788
|
+
}
|
|
2789
|
+
try {
|
|
2790
|
+
await client.execute({
|
|
2791
|
+
sql: `ALTER TABLE tasks ADD COLUMN spawn_model TEXT`,
|
|
2792
|
+
args: []
|
|
2793
|
+
});
|
|
2794
|
+
} catch {
|
|
2795
|
+
}
|
|
2782
2796
|
await client.executeMultiple(`
|
|
2783
2797
|
CREATE VIRTUAL TABLE IF NOT EXISTS conversations_fts USING fts5(
|
|
2784
2798
|
content_text,
|
|
@@ -3030,6 +3044,22 @@ async function ensureSchema() {
|
|
|
3030
3044
|
);
|
|
3031
3045
|
} catch {
|
|
3032
3046
|
}
|
|
3047
|
+
for (const col of [
|
|
3048
|
+
"ALTER TABLE memories ADD COLUMN valid_from TEXT",
|
|
3049
|
+
"ALTER TABLE memories ADD COLUMN invalid_at TEXT"
|
|
3050
|
+
]) {
|
|
3051
|
+
try {
|
|
3052
|
+
await client.execute(col);
|
|
3053
|
+
} catch {
|
|
3054
|
+
}
|
|
3055
|
+
}
|
|
3056
|
+
try {
|
|
3057
|
+
await client.execute({
|
|
3058
|
+
sql: `UPDATE memories SET valid_from = timestamp WHERE valid_from IS NULL`,
|
|
3059
|
+
args: []
|
|
3060
|
+
});
|
|
3061
|
+
} catch {
|
|
3062
|
+
}
|
|
3033
3063
|
try {
|
|
3034
3064
|
await client.execute({
|
|
3035
3065
|
sql: `ALTER TABLE memories ADD COLUMN memory_type TEXT DEFAULT 'raw'`,
|
|
@@ -3072,6 +3102,13 @@ async function ensureSchema() {
|
|
|
3072
3102
|
} catch {
|
|
3073
3103
|
}
|
|
3074
3104
|
}
|
|
3105
|
+
try {
|
|
3106
|
+
await client.execute({
|
|
3107
|
+
sql: `ALTER TABLE memories ADD COLUMN procedure_for TEXT`,
|
|
3108
|
+
args: []
|
|
3109
|
+
});
|
|
3110
|
+
} catch {
|
|
3111
|
+
}
|
|
3075
3112
|
try {
|
|
3076
3113
|
await client.execute({
|
|
3077
3114
|
sql: `UPDATE tasks SET status = 'closed' WHERE status = 'done' AND result IS NOT NULL`,
|
|
@@ -4210,6 +4247,20 @@ var init_platform_procedures = __esm({
|
|
|
4210
4247
|
priority: "p1",
|
|
4211
4248
|
content: "Once per session (COO boot only, never repeat), call list_my_feature_requests to check if any previously filed feature requests have been shipped by AskExe. If any request has status 'shipped' with a shipped_version, surface it to the founder immediately: '\u{1F680} N feature(s) shipped \u2014 run exe-os update to get version X.Y.Z'. This is a one-time check at boot, not a recurring poll. If no requests exist or none are shipped, skip silently. If the MCP tool is unavailable or the network call fails, skip silently \u2014 this is informational, not blocking."
|
|
4212
4249
|
},
|
|
4250
|
+
// --- Tool guidance ---
|
|
4251
|
+
{
|
|
4252
|
+
title: "How to use company_actions \u2014 execute business actions through gateway connectors",
|
|
4253
|
+
domain: "tools",
|
|
4254
|
+
priority: "p2",
|
|
4255
|
+
content: "The company_actions tool executes business actions through gateway connectors (e.g. send WhatsApp, trigger workflows, update CRM). It routes through the exe-gateway on the VPS. Actions are defined by the customer's gateway configuration \u2014 each connector (WhatsApp, Shopify, email, etc.) exposes specific actions. Use query_company_brain to find available data first, then company_actions to act on it. Requires gateway auth token. Read-only founders should NOT use this \u2014 it mutates external state."
|
|
4256
|
+
},
|
|
4257
|
+
// --- Release awareness ---
|
|
4258
|
+
{
|
|
4259
|
+
title: "What's New check \u2014 surface new features after update",
|
|
4260
|
+
domain: "support",
|
|
4261
|
+
priority: "p1",
|
|
4262
|
+
content: "Once per session (COO boot only, never repeat), check if the installed exe-os version is newer than the last session. If it is, read the bundled release-notes.json (at the package root) and surface a brief summary to the founder: 'Updated to exe-os vX.Y.Z \u2014 N new features, M fixes.' List the top 3 features by name. This helps the founder know what they got from the update. If release-notes.json doesn't exist or the version hasn't changed, skip silently. Never repeat this check in the same session."
|
|
4263
|
+
},
|
|
4213
4264
|
// --- Platform vs Customer ownership ---
|
|
4214
4265
|
{
|
|
4215
4266
|
title: "What the platform provides vs what you customize",
|
|
@@ -4298,13 +4349,13 @@ var init_platform_procedures = __esm({
|
|
|
4298
4349
|
title: "MCP tools \u2014 memory, decision, and search",
|
|
4299
4350
|
domain: "tool-use",
|
|
4300
4351
|
priority: "p1",
|
|
4301
|
-
content: `memory(action="recall") / recall_my_memory: search your own memories (semantic + FTS). memory(action="ask_team") / ask_team_memory: search a colleague's memories by agent name. memory(action="store") / store_memory: persist a memory. memory(action="commit") / commit_memory: high-importance memory that survives consolidation. Requires summary. memory(action="search") / search_everything: unified search across memories, tasks, entities, conversations. memory(action="session_context") / get_session_context: temporal memory window. Requires session_id + target_timestamp. memory(action="consolidate") / consolidate_memories: merge duplicate/related memories. memory(action="cardinality") / get_memory_cardinality: count memories per agent. decision(action="store") / store_decision: record an architectural decision (domain, decision, rationale). decision(action="get") / get_decision: retrieve a past decision by domain or query.`
|
|
4352
|
+
content: `memory(action="recall") / recall_my_memory: search your own memories (semantic + FTS). Supports as_of param for bi-temporal queries (what did I know at time X?), kind param to filter by memory type (decision, procedure, observation, raw, conversation, behavior). memory(action="ask_team") / ask_team_memory: search a colleague's memories by agent name. memory(action="store") / store_memory: persist a memory. Supports kind param and procedure_for domain tag for procedure-type memories. memory(action="commit") / commit_memory: high-importance memory that survives consolidation. Requires summary. memory(action="search") / search_everything: unified search across memories, tasks, entities, conversations. memory(action="session_context") / get_session_context: temporal memory window. Requires session_id + target_timestamp. memory(action="consolidate") / consolidate_memories: merge duplicate/related memories. memory(action="cardinality") / get_memory_cardinality: count memories per agent. memory(action="supersede") / supersede: replace an old memory with a new version (old_id + new text). decision(action="store") / store_decision: record an architectural decision (domain, decision, rationale). decision(action="get") / get_decision: retrieve a past decision by domain or query.`
|
|
4302
4353
|
},
|
|
4303
4354
|
{
|
|
4304
4355
|
title: "MCP tools \u2014 task orchestration",
|
|
4305
4356
|
domain: "tool-use",
|
|
4306
4357
|
priority: "p1",
|
|
4307
|
-
content:
|
|
4358
|
+
content: `task(action="create") / create_task: dispatch work (title, assigned_to, context). The ONLY dispatch path. Auto-spawns session. Supports spawn_runtime and spawn_model params to override the agent's default runtime/model for a specific task. task(action="list") / list_tasks: query tasks by status, assignee, project. task(action="get") / get_task: fetch full task details by task_id. task(action="update") / update_task: change status (in_progress, done, blocked, cancelled) + result summary. task(action="close") / close_task: finalize a reviewed task (COO only). task(action="checkpoint") / checkpoint_task: save progress state for crash recovery. task(action="resume") / resume_employee: re-spawn an employee session for an existing task.`
|
|
4308
4359
|
},
|
|
4309
4360
|
{
|
|
4310
4361
|
title: "MCP tools \u2014 knowledge graph (GraphRAG)",
|
|
@@ -4334,7 +4385,7 @@ var init_platform_procedures = __esm({
|
|
|
4334
4385
|
title: "MCP tools \u2014 admin, config, and operations",
|
|
4335
4386
|
domain: "tool-use",
|
|
4336
4387
|
priority: "p1",
|
|
4337
|
-
content: 'config(action="list_employees"): view roster. config(action="agent_spend"): token usage per agent. config(action="daemon_health"): check exed status. config(action="license_status"): check license. config(action="cloud_sync"): force sync. config(action="memory_audit"): health check (dupes, null vectors). config(action="run_consolidation"): trigger memory consolidation. config(action="company_procedure", subaction="store|list|deactivate"): manage company procedures. config(action="global_procedure"): list all procedures (platform + company). config(action="create_trigger|list_triggers"): scheduled agent jobs. config(action="export_orchestration|import_orchestration"): portable org state. diagnostics(action="healthcheck|doctor|status_brief|check_update|cloud_status"): system diagnostics. mcp_ping(): daemon health + license status + tool usage stats.'
|
|
4388
|
+
content: 'config(action="list_employees"): view roster. config(action="agent_spend"): token usage per agent. config(action="daemon_health"): check exed status. config(action="license_status"): check license. config(action="cloud_sync"): force sync. config(action="memory_audit"): health check (dupes, null vectors). config(action="run_consolidation"): trigger memory consolidation. config(action="company_procedure", subaction="store|list|deactivate"): manage company procedures. config(action="global_procedure"): list all procedures (platform + company). config(action="create_trigger|list_triggers"): scheduled agent jobs. config(action="export_orchestration|import_orchestration"): portable org state. diagnostics(action="healthcheck|doctor|status_brief|check_update|cloud_status"): system diagnostics. diagnostics(action="tool_search"): semantic tool discovery \u2014 find relevant MCP tools by natural language query. Returns top-K tools ranked by relevance. diagnostics(action="drift"): identity drift detection \u2014 score how far an agent has drifted from its role identity. Returns drift score + recommendations. mcp_ping(): daemon health + license status + tool usage stats.'
|
|
4338
4389
|
}
|
|
4339
4390
|
];
|
|
4340
4391
|
PLATFORM_PROCEDURE_TITLES = new Set(
|
|
@@ -5018,6 +5069,8 @@ async function writeMemory(record) {
|
|
|
5018
5069
|
source_type: record.source_type ?? null,
|
|
5019
5070
|
tier: record.tier ?? classifyTier(record),
|
|
5020
5071
|
supersedes_id: record.supersedes_id ?? null,
|
|
5072
|
+
valid_from: record.valid_from ?? record.timestamp,
|
|
5073
|
+
invalid_at: record.invalid_at ?? null,
|
|
5021
5074
|
draft: record.draft ? 1 : 0,
|
|
5022
5075
|
memory_type: memoryType,
|
|
5023
5076
|
trajectory: record.trajectory ? JSON.stringify(record.trajectory) : null,
|
|
@@ -5036,7 +5089,8 @@ async function writeMemory(record) {
|
|
|
5036
5089
|
token_cost: record.token_cost ?? null,
|
|
5037
5090
|
audience: record.audience ?? null,
|
|
5038
5091
|
language_type: record.language_type ?? inferLanguageType(record),
|
|
5039
|
-
parent_memory_id: record.parent_memory_id ?? null
|
|
5092
|
+
parent_memory_id: record.parent_memory_id ?? null,
|
|
5093
|
+
procedure_for: record.procedure_for ?? null
|
|
5040
5094
|
};
|
|
5041
5095
|
_pendingRecords.push(dbRow);
|
|
5042
5096
|
orgBus.emit({
|
|
@@ -5091,6 +5145,8 @@ async function flushBatch() {
|
|
|
5091
5145
|
const sourceType = row.source_type ?? null;
|
|
5092
5146
|
const tier = row.tier ?? 3;
|
|
5093
5147
|
const supersedesId = row.supersedes_id ?? null;
|
|
5148
|
+
const validFrom = row.valid_from ?? row.timestamp;
|
|
5149
|
+
const invalidAt = row.invalid_at ?? null;
|
|
5094
5150
|
const draft = row.draft ? 1 : 0;
|
|
5095
5151
|
const memoryType = row.memory_type ?? "raw";
|
|
5096
5152
|
const trajectory = row.trajectory ?? null;
|
|
@@ -5110,15 +5166,16 @@ async function flushBatch() {
|
|
|
5110
5166
|
const audience = row.audience ?? null;
|
|
5111
5167
|
const languageType = row.language_type ?? null;
|
|
5112
5168
|
const parentMemoryId = row.parent_memory_id ?? null;
|
|
5169
|
+
const procedureFor = row.procedure_for ?? null;
|
|
5113
5170
|
const cols = `id, agent_id, agent_role, session_id, timestamp,
|
|
5114
5171
|
tool_name, project_name,
|
|
5115
5172
|
has_error, raw_text, vector, version, task_id, importance, status,
|
|
5116
5173
|
confidence, last_accessed,
|
|
5117
5174
|
workspace_id, document_id, user_id, char_offset, page_number,
|
|
5118
|
-
source_path, source_type, tier, supersedes_id, draft, memory_type, trajectory, content_hash,
|
|
5175
|
+
source_path, source_type, tier, supersedes_id, valid_from, invalid_at, draft, memory_type, trajectory, content_hash,
|
|
5119
5176
|
intent, outcome, domain, referenced_entities, retrieval_count,
|
|
5120
5177
|
chain_position, review_status, context_window_pct, file_paths, commit_hash,
|
|
5121
|
-
duration_ms, token_cost, audience, language_type, parent_memory_id`;
|
|
5178
|
+
duration_ms, token_cost, audience, language_type, parent_memory_id, procedure_for`;
|
|
5122
5179
|
const metaArgs = [
|
|
5123
5180
|
intent,
|
|
5124
5181
|
outcome,
|
|
@@ -5134,7 +5191,8 @@ async function flushBatch() {
|
|
|
5134
5191
|
tokenCost,
|
|
5135
5192
|
audience,
|
|
5136
5193
|
languageType,
|
|
5137
|
-
parentMemoryId
|
|
5194
|
+
parentMemoryId,
|
|
5195
|
+
procedureFor
|
|
5138
5196
|
];
|
|
5139
5197
|
const baseArgs = [
|
|
5140
5198
|
row.id,
|
|
@@ -5163,6 +5221,8 @@ async function flushBatch() {
|
|
|
5163
5221
|
sourceType,
|
|
5164
5222
|
tier,
|
|
5165
5223
|
supersedesId,
|
|
5224
|
+
validFrom,
|
|
5225
|
+
invalidAt,
|
|
5166
5226
|
draft,
|
|
5167
5227
|
memoryType,
|
|
5168
5228
|
trajectory,
|
|
@@ -5170,8 +5230,8 @@ async function flushBatch() {
|
|
|
5170
5230
|
];
|
|
5171
5231
|
return {
|
|
5172
5232
|
sql: hasVector ? `INSERT OR IGNORE INTO memories (${cols})
|
|
5173
|
-
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, vector32(?), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)` : `INSERT OR IGNORE INTO memories (${cols})
|
|
5174
|
-
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, NULL, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`,
|
|
5233
|
+
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, vector32(?), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)` : `INSERT OR IGNORE INTO memories (${cols})
|
|
5234
|
+
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, NULL, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`,
|
|
5175
5235
|
args: hasVector ? [...baseArgs, vectorToBlob(row.vector), ...sharedArgs, ...metaArgs] : [...baseArgs, ...sharedArgs, ...metaArgs]
|
|
5176
5236
|
};
|
|
5177
5237
|
};
|
|
@@ -5287,6 +5347,12 @@ async function searchMemories(queryVector, agentId, options) {
|
|
|
5287
5347
|
AND vector IS NOT NULL${statusFilter}${draftFilter}
|
|
5288
5348
|
AND COALESCE(confidence, 0.7) >= 0.3`;
|
|
5289
5349
|
const args = [agentId];
|
|
5350
|
+
if (options?.asOf) {
|
|
5351
|
+
sql += ` AND (valid_from IS NULL OR valid_from <= ?) AND (invalid_at IS NULL OR invalid_at > ?)`;
|
|
5352
|
+
args.push(options.asOf, options.asOf);
|
|
5353
|
+
} else {
|
|
5354
|
+
sql += ` AND invalid_at IS NULL`;
|
|
5355
|
+
}
|
|
5290
5356
|
const scope = buildWikiScopeFilter(options, "");
|
|
5291
5357
|
sql += scope.clause;
|
|
5292
5358
|
args.push(...scope.args);
|
package/dist/bin/exe-search.js
CHANGED
|
@@ -2764,6 +2764,20 @@ async function ensureSchema() {
|
|
|
2764
2764
|
});
|
|
2765
2765
|
} catch {
|
|
2766
2766
|
}
|
|
2767
|
+
try {
|
|
2768
|
+
await client.execute({
|
|
2769
|
+
sql: `ALTER TABLE tasks ADD COLUMN spawn_runtime TEXT`,
|
|
2770
|
+
args: []
|
|
2771
|
+
});
|
|
2772
|
+
} catch {
|
|
2773
|
+
}
|
|
2774
|
+
try {
|
|
2775
|
+
await client.execute({
|
|
2776
|
+
sql: `ALTER TABLE tasks ADD COLUMN spawn_model TEXT`,
|
|
2777
|
+
args: []
|
|
2778
|
+
});
|
|
2779
|
+
} catch {
|
|
2780
|
+
}
|
|
2767
2781
|
await client.executeMultiple(`
|
|
2768
2782
|
CREATE VIRTUAL TABLE IF NOT EXISTS conversations_fts USING fts5(
|
|
2769
2783
|
content_text,
|
|
@@ -3015,6 +3029,22 @@ async function ensureSchema() {
|
|
|
3015
3029
|
);
|
|
3016
3030
|
} catch {
|
|
3017
3031
|
}
|
|
3032
|
+
for (const col of [
|
|
3033
|
+
"ALTER TABLE memories ADD COLUMN valid_from TEXT",
|
|
3034
|
+
"ALTER TABLE memories ADD COLUMN invalid_at TEXT"
|
|
3035
|
+
]) {
|
|
3036
|
+
try {
|
|
3037
|
+
await client.execute(col);
|
|
3038
|
+
} catch {
|
|
3039
|
+
}
|
|
3040
|
+
}
|
|
3041
|
+
try {
|
|
3042
|
+
await client.execute({
|
|
3043
|
+
sql: `UPDATE memories SET valid_from = timestamp WHERE valid_from IS NULL`,
|
|
3044
|
+
args: []
|
|
3045
|
+
});
|
|
3046
|
+
} catch {
|
|
3047
|
+
}
|
|
3018
3048
|
try {
|
|
3019
3049
|
await client.execute({
|
|
3020
3050
|
sql: `ALTER TABLE memories ADD COLUMN memory_type TEXT DEFAULT 'raw'`,
|
|
@@ -3057,6 +3087,13 @@ async function ensureSchema() {
|
|
|
3057
3087
|
} catch {
|
|
3058
3088
|
}
|
|
3059
3089
|
}
|
|
3090
|
+
try {
|
|
3091
|
+
await client.execute({
|
|
3092
|
+
sql: `ALTER TABLE memories ADD COLUMN procedure_for TEXT`,
|
|
3093
|
+
args: []
|
|
3094
|
+
});
|
|
3095
|
+
} catch {
|
|
3096
|
+
}
|
|
3060
3097
|
try {
|
|
3061
3098
|
await client.execute({
|
|
3062
3099
|
sql: `UPDATE tasks SET status = 'closed' WHERE status = 'done' AND result IS NOT NULL`,
|
|
@@ -4195,6 +4232,20 @@ var init_platform_procedures = __esm({
|
|
|
4195
4232
|
priority: "p1",
|
|
4196
4233
|
content: "Once per session (COO boot only, never repeat), call list_my_feature_requests to check if any previously filed feature requests have been shipped by AskExe. If any request has status 'shipped' with a shipped_version, surface it to the founder immediately: '\u{1F680} N feature(s) shipped \u2014 run exe-os update to get version X.Y.Z'. This is a one-time check at boot, not a recurring poll. If no requests exist or none are shipped, skip silently. If the MCP tool is unavailable or the network call fails, skip silently \u2014 this is informational, not blocking."
|
|
4197
4234
|
},
|
|
4235
|
+
// --- Tool guidance ---
|
|
4236
|
+
{
|
|
4237
|
+
title: "How to use company_actions \u2014 execute business actions through gateway connectors",
|
|
4238
|
+
domain: "tools",
|
|
4239
|
+
priority: "p2",
|
|
4240
|
+
content: "The company_actions tool executes business actions through gateway connectors (e.g. send WhatsApp, trigger workflows, update CRM). It routes through the exe-gateway on the VPS. Actions are defined by the customer's gateway configuration \u2014 each connector (WhatsApp, Shopify, email, etc.) exposes specific actions. Use query_company_brain to find available data first, then company_actions to act on it. Requires gateway auth token. Read-only founders should NOT use this \u2014 it mutates external state."
|
|
4241
|
+
},
|
|
4242
|
+
// --- Release awareness ---
|
|
4243
|
+
{
|
|
4244
|
+
title: "What's New check \u2014 surface new features after update",
|
|
4245
|
+
domain: "support",
|
|
4246
|
+
priority: "p1",
|
|
4247
|
+
content: "Once per session (COO boot only, never repeat), check if the installed exe-os version is newer than the last session. If it is, read the bundled release-notes.json (at the package root) and surface a brief summary to the founder: 'Updated to exe-os vX.Y.Z \u2014 N new features, M fixes.' List the top 3 features by name. This helps the founder know what they got from the update. If release-notes.json doesn't exist or the version hasn't changed, skip silently. Never repeat this check in the same session."
|
|
4248
|
+
},
|
|
4198
4249
|
// --- Platform vs Customer ownership ---
|
|
4199
4250
|
{
|
|
4200
4251
|
title: "What the platform provides vs what you customize",
|
|
@@ -4283,13 +4334,13 @@ var init_platform_procedures = __esm({
|
|
|
4283
4334
|
title: "MCP tools \u2014 memory, decision, and search",
|
|
4284
4335
|
domain: "tool-use",
|
|
4285
4336
|
priority: "p1",
|
|
4286
|
-
content: `memory(action="recall") / recall_my_memory: search your own memories (semantic + FTS). memory(action="ask_team") / ask_team_memory: search a colleague's memories by agent name. memory(action="store") / store_memory: persist a memory. memory(action="commit") / commit_memory: high-importance memory that survives consolidation. Requires summary. memory(action="search") / search_everything: unified search across memories, tasks, entities, conversations. memory(action="session_context") / get_session_context: temporal memory window. Requires session_id + target_timestamp. memory(action="consolidate") / consolidate_memories: merge duplicate/related memories. memory(action="cardinality") / get_memory_cardinality: count memories per agent. decision(action="store") / store_decision: record an architectural decision (domain, decision, rationale). decision(action="get") / get_decision: retrieve a past decision by domain or query.`
|
|
4337
|
+
content: `memory(action="recall") / recall_my_memory: search your own memories (semantic + FTS). Supports as_of param for bi-temporal queries (what did I know at time X?), kind param to filter by memory type (decision, procedure, observation, raw, conversation, behavior). memory(action="ask_team") / ask_team_memory: search a colleague's memories by agent name. memory(action="store") / store_memory: persist a memory. Supports kind param and procedure_for domain tag for procedure-type memories. memory(action="commit") / commit_memory: high-importance memory that survives consolidation. Requires summary. memory(action="search") / search_everything: unified search across memories, tasks, entities, conversations. memory(action="session_context") / get_session_context: temporal memory window. Requires session_id + target_timestamp. memory(action="consolidate") / consolidate_memories: merge duplicate/related memories. memory(action="cardinality") / get_memory_cardinality: count memories per agent. memory(action="supersede") / supersede: replace an old memory with a new version (old_id + new text). decision(action="store") / store_decision: record an architectural decision (domain, decision, rationale). decision(action="get") / get_decision: retrieve a past decision by domain or query.`
|
|
4287
4338
|
},
|
|
4288
4339
|
{
|
|
4289
4340
|
title: "MCP tools \u2014 task orchestration",
|
|
4290
4341
|
domain: "tool-use",
|
|
4291
4342
|
priority: "p1",
|
|
4292
|
-
content:
|
|
4343
|
+
content: `task(action="create") / create_task: dispatch work (title, assigned_to, context). The ONLY dispatch path. Auto-spawns session. Supports spawn_runtime and spawn_model params to override the agent's default runtime/model for a specific task. task(action="list") / list_tasks: query tasks by status, assignee, project. task(action="get") / get_task: fetch full task details by task_id. task(action="update") / update_task: change status (in_progress, done, blocked, cancelled) + result summary. task(action="close") / close_task: finalize a reviewed task (COO only). task(action="checkpoint") / checkpoint_task: save progress state for crash recovery. task(action="resume") / resume_employee: re-spawn an employee session for an existing task.`
|
|
4293
4344
|
},
|
|
4294
4345
|
{
|
|
4295
4346
|
title: "MCP tools \u2014 knowledge graph (GraphRAG)",
|
|
@@ -4319,7 +4370,7 @@ var init_platform_procedures = __esm({
|
|
|
4319
4370
|
title: "MCP tools \u2014 admin, config, and operations",
|
|
4320
4371
|
domain: "tool-use",
|
|
4321
4372
|
priority: "p1",
|
|
4322
|
-
content: 'config(action="list_employees"): view roster. config(action="agent_spend"): token usage per agent. config(action="daemon_health"): check exed status. config(action="license_status"): check license. config(action="cloud_sync"): force sync. config(action="memory_audit"): health check (dupes, null vectors). config(action="run_consolidation"): trigger memory consolidation. config(action="company_procedure", subaction="store|list|deactivate"): manage company procedures. config(action="global_procedure"): list all procedures (platform + company). config(action="create_trigger|list_triggers"): scheduled agent jobs. config(action="export_orchestration|import_orchestration"): portable org state. diagnostics(action="healthcheck|doctor|status_brief|check_update|cloud_status"): system diagnostics. mcp_ping(): daemon health + license status + tool usage stats.'
|
|
4373
|
+
content: 'config(action="list_employees"): view roster. config(action="agent_spend"): token usage per agent. config(action="daemon_health"): check exed status. config(action="license_status"): check license. config(action="cloud_sync"): force sync. config(action="memory_audit"): health check (dupes, null vectors). config(action="run_consolidation"): trigger memory consolidation. config(action="company_procedure", subaction="store|list|deactivate"): manage company procedures. config(action="global_procedure"): list all procedures (platform + company). config(action="create_trigger|list_triggers"): scheduled agent jobs. config(action="export_orchestration|import_orchestration"): portable org state. diagnostics(action="healthcheck|doctor|status_brief|check_update|cloud_status"): system diagnostics. diagnostics(action="tool_search"): semantic tool discovery \u2014 find relevant MCP tools by natural language query. Returns top-K tools ranked by relevance. diagnostics(action="drift"): identity drift detection \u2014 score how far an agent has drifted from its role identity. Returns drift score + recommendations. mcp_ping(): daemon health + license status + tool usage stats.'
|
|
4323
4374
|
}
|
|
4324
4375
|
];
|
|
4325
4376
|
PLATFORM_PROCEDURE_TITLES = new Set(
|
|
@@ -5003,6 +5054,8 @@ async function writeMemory(record) {
|
|
|
5003
5054
|
source_type: record.source_type ?? null,
|
|
5004
5055
|
tier: record.tier ?? classifyTier(record),
|
|
5005
5056
|
supersedes_id: record.supersedes_id ?? null,
|
|
5057
|
+
valid_from: record.valid_from ?? record.timestamp,
|
|
5058
|
+
invalid_at: record.invalid_at ?? null,
|
|
5006
5059
|
draft: record.draft ? 1 : 0,
|
|
5007
5060
|
memory_type: memoryType,
|
|
5008
5061
|
trajectory: record.trajectory ? JSON.stringify(record.trajectory) : null,
|
|
@@ -5021,7 +5074,8 @@ async function writeMemory(record) {
|
|
|
5021
5074
|
token_cost: record.token_cost ?? null,
|
|
5022
5075
|
audience: record.audience ?? null,
|
|
5023
5076
|
language_type: record.language_type ?? inferLanguageType(record),
|
|
5024
|
-
parent_memory_id: record.parent_memory_id ?? null
|
|
5077
|
+
parent_memory_id: record.parent_memory_id ?? null,
|
|
5078
|
+
procedure_for: record.procedure_for ?? null
|
|
5025
5079
|
};
|
|
5026
5080
|
_pendingRecords.push(dbRow);
|
|
5027
5081
|
orgBus.emit({
|
|
@@ -5076,6 +5130,8 @@ async function flushBatch() {
|
|
|
5076
5130
|
const sourceType = row.source_type ?? null;
|
|
5077
5131
|
const tier = row.tier ?? 3;
|
|
5078
5132
|
const supersedesId = row.supersedes_id ?? null;
|
|
5133
|
+
const validFrom = row.valid_from ?? row.timestamp;
|
|
5134
|
+
const invalidAt = row.invalid_at ?? null;
|
|
5079
5135
|
const draft = row.draft ? 1 : 0;
|
|
5080
5136
|
const memoryType = row.memory_type ?? "raw";
|
|
5081
5137
|
const trajectory = row.trajectory ?? null;
|
|
@@ -5095,15 +5151,16 @@ async function flushBatch() {
|
|
|
5095
5151
|
const audience = row.audience ?? null;
|
|
5096
5152
|
const languageType = row.language_type ?? null;
|
|
5097
5153
|
const parentMemoryId = row.parent_memory_id ?? null;
|
|
5154
|
+
const procedureFor = row.procedure_for ?? null;
|
|
5098
5155
|
const cols = `id, agent_id, agent_role, session_id, timestamp,
|
|
5099
5156
|
tool_name, project_name,
|
|
5100
5157
|
has_error, raw_text, vector, version, task_id, importance, status,
|
|
5101
5158
|
confidence, last_accessed,
|
|
5102
5159
|
workspace_id, document_id, user_id, char_offset, page_number,
|
|
5103
|
-
source_path, source_type, tier, supersedes_id, draft, memory_type, trajectory, content_hash,
|
|
5160
|
+
source_path, source_type, tier, supersedes_id, valid_from, invalid_at, draft, memory_type, trajectory, content_hash,
|
|
5104
5161
|
intent, outcome, domain, referenced_entities, retrieval_count,
|
|
5105
5162
|
chain_position, review_status, context_window_pct, file_paths, commit_hash,
|
|
5106
|
-
duration_ms, token_cost, audience, language_type, parent_memory_id`;
|
|
5163
|
+
duration_ms, token_cost, audience, language_type, parent_memory_id, procedure_for`;
|
|
5107
5164
|
const metaArgs = [
|
|
5108
5165
|
intent,
|
|
5109
5166
|
outcome,
|
|
@@ -5119,7 +5176,8 @@ async function flushBatch() {
|
|
|
5119
5176
|
tokenCost,
|
|
5120
5177
|
audience,
|
|
5121
5178
|
languageType,
|
|
5122
|
-
parentMemoryId
|
|
5179
|
+
parentMemoryId,
|
|
5180
|
+
procedureFor
|
|
5123
5181
|
];
|
|
5124
5182
|
const baseArgs = [
|
|
5125
5183
|
row.id,
|
|
@@ -5148,6 +5206,8 @@ async function flushBatch() {
|
|
|
5148
5206
|
sourceType,
|
|
5149
5207
|
tier,
|
|
5150
5208
|
supersedesId,
|
|
5209
|
+
validFrom,
|
|
5210
|
+
invalidAt,
|
|
5151
5211
|
draft,
|
|
5152
5212
|
memoryType,
|
|
5153
5213
|
trajectory,
|
|
@@ -5155,8 +5215,8 @@ async function flushBatch() {
|
|
|
5155
5215
|
];
|
|
5156
5216
|
return {
|
|
5157
5217
|
sql: hasVector ? `INSERT OR IGNORE INTO memories (${cols})
|
|
5158
|
-
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, vector32(?), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)` : `INSERT OR IGNORE INTO memories (${cols})
|
|
5159
|
-
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, NULL, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`,
|
|
5218
|
+
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, vector32(?), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)` : `INSERT OR IGNORE INTO memories (${cols})
|
|
5219
|
+
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, NULL, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`,
|
|
5160
5220
|
args: hasVector ? [...baseArgs, vectorToBlob(row.vector), ...sharedArgs, ...metaArgs] : [...baseArgs, ...sharedArgs, ...metaArgs]
|
|
5161
5221
|
};
|
|
5162
5222
|
};
|
|
@@ -5272,6 +5332,12 @@ async function searchMemories(queryVector, agentId, options) {
|
|
|
5272
5332
|
AND vector IS NOT NULL${statusFilter}${draftFilter}
|
|
5273
5333
|
AND COALESCE(confidence, 0.7) >= 0.3`;
|
|
5274
5334
|
const args = [agentId];
|
|
5335
|
+
if (options?.asOf) {
|
|
5336
|
+
sql += ` AND (valid_from IS NULL OR valid_from <= ?) AND (invalid_at IS NULL OR invalid_at > ?)`;
|
|
5337
|
+
args.push(options.asOf, options.asOf);
|
|
5338
|
+
} else {
|
|
5339
|
+
sql += ` AND invalid_at IS NULL`;
|
|
5340
|
+
}
|
|
5275
5341
|
const scope = buildWikiScopeFilter(options, "");
|
|
5276
5342
|
sql += scope.clause;
|
|
5277
5343
|
args.push(...scope.args);
|
|
@@ -6593,6 +6659,19 @@ init_store();
|
|
|
6593
6659
|
init_store();
|
|
6594
6660
|
init_database();
|
|
6595
6661
|
var RRF_K = 60;
|
|
6662
|
+
function buildTemporalFilter(options, columnPrefix) {
|
|
6663
|
+
const asOf = options?.asOf;
|
|
6664
|
+
if (asOf) {
|
|
6665
|
+
return {
|
|
6666
|
+
clause: ` AND (${columnPrefix}valid_from IS NULL OR ${columnPrefix}valid_from <= ?) AND (${columnPrefix}invalid_at IS NULL OR ${columnPrefix}invalid_at > ?)`,
|
|
6667
|
+
args: [asOf, asOf]
|
|
6668
|
+
};
|
|
6669
|
+
}
|
|
6670
|
+
return {
|
|
6671
|
+
clause: ` AND ${columnPrefix}invalid_at IS NULL`,
|
|
6672
|
+
args: []
|
|
6673
|
+
};
|
|
6674
|
+
}
|
|
6596
6675
|
function appendMemoryTypeFilter(sql, args, column, options) {
|
|
6597
6676
|
if (options?.memoryTypes && options.memoryTypes.length > 0) {
|
|
6598
6677
|
const uniqueTypes = [...new Set(options.memoryTypes)];
|
|
@@ -6825,6 +6904,9 @@ async function estimateCardinality(agentId, options) {
|
|
|
6825
6904
|
AND COALESCE(status, 'active') = 'active'
|
|
6826
6905
|
AND COALESCE(confidence, 0.7) >= 0.3`;
|
|
6827
6906
|
const args = [agentId];
|
|
6907
|
+
const temporal = buildTemporalFilter(options, "");
|
|
6908
|
+
sql += temporal.clause;
|
|
6909
|
+
args.push(...temporal.args);
|
|
6828
6910
|
const rawVisibility = buildRawVisibilityFilter(options, "");
|
|
6829
6911
|
sql += rawVisibility.clause;
|
|
6830
6912
|
args.push(...rawVisibility.args);
|
|
@@ -6950,6 +7032,9 @@ async function ftsQuery(client, matchExpr, agentId, options, limit) {
|
|
|
6950
7032
|
AND m.agent_id = ?${statusFilter}${draftFilter}
|
|
6951
7033
|
AND COALESCE(m.confidence, 0.7) >= 0.3`;
|
|
6952
7034
|
const args = [matchExpr, agentId];
|
|
7035
|
+
const temporal = buildTemporalFilter(options, "m.");
|
|
7036
|
+
sql += temporal.clause;
|
|
7037
|
+
args.push(...temporal.args);
|
|
6953
7038
|
const scope = buildWikiScopeFilter(options, "m.");
|
|
6954
7039
|
sql += scope.clause;
|
|
6955
7040
|
args.push(...scope.args);
|
|
@@ -7062,6 +7147,9 @@ async function recentRecords(agentId, options, limit, textFilter) {
|
|
|
7062
7147
|
WHERE agent_id = ?${statusFilter}${draftFilter}
|
|
7063
7148
|
AND COALESCE(confidence, 0.7) >= 0.3`;
|
|
7064
7149
|
const args = [agentId];
|
|
7150
|
+
const temporal = buildTemporalFilter(options, "");
|
|
7151
|
+
sql += temporal.clause;
|
|
7152
|
+
args.push(...temporal.args);
|
|
7065
7153
|
const scope = buildWikiScopeFilter(options, "");
|
|
7066
7154
|
sql += scope.clause;
|
|
7067
7155
|
args.push(...scope.args);
|
|
@@ -7174,6 +7262,9 @@ async function trajectoryBypass(queryText, agentId, options, limit) {
|
|
|
7174
7262
|
AND json_extract(trajectory, '$.tool') = ?
|
|
7175
7263
|
AND agent_id = ?${statusFilter}${draftFilter}`;
|
|
7176
7264
|
const args = [toolName, agentId];
|
|
7265
|
+
const temporal = buildTemporalFilter(options, "");
|
|
7266
|
+
sql += temporal.clause;
|
|
7267
|
+
args.push(...temporal.args);
|
|
7177
7268
|
const rawVisibility = buildRawVisibilityFilter(options, "");
|
|
7178
7269
|
sql += rawVisibility.clause;
|
|
7179
7270
|
args.push(...rawVisibility.args);
|