@cgh567/agent 2.4.2 → 2.4.3
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/daemon/adapters/tui_wakeup.js +8 -0
- package/daemon/daemon-manager.js +1 -1
- package/daemon/db/email-infrastructure-migrate.js +192 -0
- package/daemon/db/hbo-core-migrate.js +189 -0
- package/daemon/helios-api.js +574 -20
- package/daemon/helios-company-daemon.js +103 -13
- package/daemon/lib/hbo-bridge.js +1 -1
- package/daemon/lib/hed-engine.js +25 -0
- package/daemon/lib/task-completion-processor.js +11 -0
- package/daemon/lib/wizard-engine.js +57 -6
- package/daemon/routes/hbo.js +253 -47
- package/daemon/routes/project.js +190 -59
- package/daemon/routes/routines.js +14 -0
- package/daemon/routes/tasks.js +15 -1
- package/daemon/schema-apply.js +174 -0
- package/daemon/schema-definitions.js +423 -0
- package/daemon/schema-migrations-hbo.js +10 -0
- package/daemon/schema-migrations-hed.js +18 -0
- package/daemon/schema-migrations-proj.js +131 -0
- package/extensions/cortex/wal-replay.ts +91 -0
- package/extensions/hema-dispatch-v3/index.ts +13 -7
- package/extensions/warm-tick/warm-tick-maintenance.ts +8 -0
- package/lib/__tests__/hbo-core-store.test.js +238 -0
- package/lib/event-bus.mts +1 -1
- package/lib/graph-availability.js +62 -0
- package/lib/hbo-core-store.compiled.js +834 -0
- package/lib/hbo-core-store.js +124 -0
- package/lib/hbo-core-store.ts +908 -0
- package/lib/triage-core/classifier.ts +3 -2
- package/lib/triage-core/graph/schema.cypher +10 -0
- package/lib/triage-core/mental-model/key-facts.ts +1 -2
- package/lib/triage-core/orchestrator.ts +4 -11
- package/package.json +9 -5
|
@@ -52,8 +52,9 @@ import * as senderPrestige from './signals/prestige-scorer.ts';
|
|
|
52
52
|
import * as personalImportance from './signals/personal-importance.ts';
|
|
53
53
|
import * as goalRelevance from './signals/goal-relevance.ts';
|
|
54
54
|
|
|
55
|
-
//
|
|
56
|
-
|
|
55
|
+
// C5: HELIOS_SELF_ID is structurally required — throw at startup if missing
|
|
56
|
+
if (!process.env.HELIOS_SELF_ID) throw new Error('HELIOS_SELF_ID env var is required — set it in .env');
|
|
57
|
+
const SELF_ID = process.env.HELIOS_SELF_ID;
|
|
57
58
|
|
|
58
59
|
// B11: Load goal-lifecycle at module init (not inside hot path) to avoid repeated require() calls.
|
|
59
60
|
// If the module is not found, goal boost is disabled and a warning is emitted once at startup.
|
|
@@ -52,6 +52,16 @@ CREATE INDEX ON :FAVEESnapshot(week) IF NOT EXISTS;
|
|
|
52
52
|
// NODE LABEL REFERENCE (no DDL needed — Memgraph creates on first write)
|
|
53
53
|
// ---------------------------------------------------------------------------
|
|
54
54
|
//
|
|
55
|
+
// DraftAction:
|
|
56
|
+
// id (string), type (email|slack), triggeredBy (string), content (JSON string),
|
|
57
|
+
// personId (string nullable), status (created|approved|executed|expired),
|
|
58
|
+
// createdAt (datetime), expiresAt (datetime)
|
|
59
|
+
//
|
|
60
|
+
// SEC-5 TTL POLICY: DraftAction nodes store PII (email body, recipient handle).
|
|
61
|
+
// 30-day TTL enforced by warm-tick-maintenance.ts daily cleanup:
|
|
62
|
+
// MATCH (da:DraftAction) WHERE da.expiresAt < datetime() DETACH DELETE da
|
|
63
|
+
// All new DraftAction writes MUST set expiresAt = datetime() + duration({days: 30}).
|
|
64
|
+
//
|
|
55
65
|
// Identity:
|
|
56
66
|
// id (UUID), handle (string), platform (email|imessage|phone),
|
|
57
67
|
// displayName (string), createdAt (ISO), verified (boolean)
|
|
@@ -13,8 +13,7 @@ import { createRequire } from 'module';
|
|
|
13
13
|
import { KEY_FACTS_MODEL_ID } from './bedrock-config.ts';
|
|
14
14
|
|
|
15
15
|
function getSelfId(): string {
|
|
16
|
-
const id = process.env.HELIOS_SELF_ID
|
|
17
|
-
if (!id) throw new Error('[key-facts] HELIOS_SELF_ID env var is required -- set it in .env');
|
|
16
|
+
const id = process.env.HELIOS_SELF_ID ?? (() => { throw new Error('[key-facts] HELIOS_SELF_ID env var is required -- set it in .env'); })();
|
|
18
17
|
return id;
|
|
19
18
|
}
|
|
20
19
|
|
|
@@ -537,7 +537,8 @@ export class TriageOrchestrator {
|
|
|
537
537
|
}),
|
|
538
538
|
personId: (item.senderModel as any)?.personId || null,
|
|
539
539
|
status: 'created',
|
|
540
|
-
|
|
540
|
+
// SEC-5: 30-day TTL — DraftAction nodes contain PII; cleaned up by warm-tick daily maintenance
|
|
541
|
+
expiresAt: new Date(Date.now() + 30 * 24 * 60 * 60 * 1000).toISOString(),
|
|
541
542
|
}));
|
|
542
543
|
await rawWrite(
|
|
543
544
|
`UNWIND $batch AS d
|
|
@@ -1478,11 +1479,7 @@ export class TriageOrchestrator {
|
|
|
1478
1479
|
}
|
|
1479
1480
|
|
|
1480
1481
|
private checkExtractionTriggers(personIds: string[]): void {
|
|
1481
|
-
const selfId = process.env.HELIOS_SELF_ID
|
|
1482
|
-
if (!selfId) {
|
|
1483
|
-
this.log('warn', 'self_id.missing', { fn: 'checkExtractionTriggers' });
|
|
1484
|
-
return; // early exit, not fatal
|
|
1485
|
-
}
|
|
1482
|
+
const selfId = process.env.HELIOS_SELF_ID ?? (() => { throw new Error('HELIOS_SELF_ID env var is required'); })();
|
|
1486
1483
|
const unique = [...new Set(personIds.filter(id => id && id !== selfId))];
|
|
1487
1484
|
if (unique.length === 0) return;
|
|
1488
1485
|
|
|
@@ -1544,11 +1541,7 @@ export class TriageOrchestrator {
|
|
|
1544
1541
|
try {
|
|
1545
1542
|
const { rawRead } = require('../safe-memgraph.js');
|
|
1546
1543
|
let md = briefing.markdown || '';
|
|
1547
|
-
const selfId = process.env.HELIOS_SELF_ID
|
|
1548
|
-
if (!selfId) {
|
|
1549
|
-
this.log('warn', 'self_id.missing', { fn: 'enrichBriefingWithSecretary' });
|
|
1550
|
-
return; // early exit, not fatal
|
|
1551
|
-
}
|
|
1544
|
+
const selfId = process.env.HELIOS_SELF_ID ?? (() => { throw new Error('HELIOS_SELF_ID env var is required'); })();
|
|
1552
1545
|
|
|
1553
1546
|
if (!md.includes('<!-- active-situations -->')) {
|
|
1554
1547
|
// NOTE: briefing.markdown uses emoji. All consumers must parse as UTF-8.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cgh567/agent",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.3",
|
|
4
4
|
"description": "Helios agent runtime \u2014 full stack: extensions, skills, daemon, brain-v2, HEMA, governance",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"bin": {
|
|
@@ -97,14 +97,13 @@
|
|
|
97
97
|
"puppeteer-extra-plugin-stealth": "^2.11.2",
|
|
98
98
|
"qrcode-terminal": "^0.12.0",
|
|
99
99
|
"signal-sdk": "^0.2.4",
|
|
100
|
-
"tree-sitter": "^0.
|
|
101
|
-
"tree-sitter-javascript": "^0.
|
|
102
|
-
"tree-sitter-python": "^0.
|
|
100
|
+
"tree-sitter": "^0.21.1",
|
|
101
|
+
"tree-sitter-javascript": "^0.23.1",
|
|
102
|
+
"tree-sitter-python": "^0.21.0",
|
|
103
103
|
"tree-sitter-typescript": "^0.23.2",
|
|
104
104
|
"write-file-atomic": "^7.0.1"
|
|
105
105
|
},
|
|
106
106
|
"devDependencies": {
|
|
107
|
-
"@esbuild/linux-x64": "^0.28.0",
|
|
108
107
|
"ts-morph": "^27.0.2",
|
|
109
108
|
"tsx": "^4.21.0",
|
|
110
109
|
"typescript": "^6.0.3",
|
|
@@ -124,7 +123,12 @@
|
|
|
124
123
|
"daemon/schema-migrations-harada.js",
|
|
125
124
|
"daemon/schema-migrations-hbo.js",
|
|
126
125
|
"daemon/schema-migrations-hitl.js",
|
|
126
|
+
"daemon/schema-migrations-proj.js",
|
|
127
|
+
"daemon/schema-migrations-hed.js",
|
|
127
128
|
"daemon/schema-migrations.js",
|
|
129
|
+
"daemon/schema-apply.js",
|
|
130
|
+
"daemon/schema-definitions.js",
|
|
131
|
+
"daemon/db/",
|
|
128
132
|
"daemon/context-enrichment.js",
|
|
129
133
|
"daemon/agent-discovery.js",
|
|
130
134
|
"daemon/daemon-manager.js",
|