@aiassesstech/jessie 0.1.0 → 0.2.0
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/LICENSE +25 -0
- package/agent/AGENTS.md +143 -0
- package/agent/IDENTITY.md +13 -0
- package/agent/MISSION_CONTROL.md +121 -0
- package/agent/SOUL.md +146 -0
- package/agent/USER.md +41 -0
- package/dist/cli/bin.d.ts +3 -0
- package/dist/cli/bin.d.ts.map +1 -0
- package/dist/cli/bin.js +10 -0
- package/dist/cli/bin.js.map +1 -0
- package/dist/cli/runner.d.ts +9 -0
- package/dist/cli/runner.d.ts.map +1 -0
- package/dist/cli/runner.js +45 -0
- package/dist/cli/runner.js.map +1 -0
- package/dist/cli/setup.d.ts +20 -0
- package/dist/cli/setup.d.ts.map +1 -0
- package/dist/cli/setup.js +185 -0
- package/dist/cli/setup.js.map +1 -0
- package/dist/command/decision-store.d.ts +42 -0
- package/dist/command/decision-store.d.ts.map +1 -0
- package/dist/command/decision-store.js +176 -0
- package/dist/command/decision-store.js.map +1 -0
- package/dist/command/types.d.ts +103 -0
- package/dist/command/types.d.ts.map +1 -0
- package/dist/command/types.js +26 -0
- package/dist/command/types.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/memory/jessie-memory.d.ts +21 -0
- package/dist/memory/jessie-memory.d.ts.map +1 -0
- package/dist/memory/jessie-memory.js +64 -0
- package/dist/memory/jessie-memory.js.map +1 -0
- package/dist/plugin.d.ts +18 -7
- package/dist/plugin.d.ts.map +1 -1
- package/dist/plugin.js +147 -30
- package/dist/plugin.js.map +1 -1
- package/dist/tools/jessie-briefing.d.ts +39 -0
- package/dist/tools/jessie-briefing.d.ts.map +1 -0
- package/dist/tools/jessie-briefing.js +97 -0
- package/dist/tools/jessie-briefing.js.map +1 -0
- package/dist/tools/jessie-decide.d.ts +63 -0
- package/dist/tools/jessie-decide.d.ts.map +1 -0
- package/dist/tools/jessie-decide.js +174 -0
- package/dist/tools/jessie-decide.js.map +1 -0
- package/dist/tools/jessie-delegate.d.ts +60 -0
- package/dist/tools/jessie-delegate.d.ts.map +1 -0
- package/dist/tools/jessie-delegate.js +135 -0
- package/dist/tools/jessie-delegate.js.map +1 -0
- package/dist/tools/jessie-report.d.ts +39 -0
- package/dist/tools/jessie-report.d.ts.map +1 -0
- package/dist/tools/jessie-report.js +149 -0
- package/dist/tools/jessie-report.js.map +1 -0
- package/dist/tools/jessie-status.d.ts +29 -0
- package/dist/tools/jessie-status.d.ts.map +1 -0
- package/dist/tools/jessie-status.js +55 -0
- package/dist/tools/jessie-status.js.map +1 -0
- package/openclaw.plugin.json +15 -2
- package/package.json +19 -7
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Jessie Setup Command
|
|
3
|
+
*
|
|
4
|
+
* npx @aiassesstech/jessie setup --model anthropic/claude-haiku-4-5 --force
|
|
5
|
+
*
|
|
6
|
+
* Handles the default agent constraint: Jessie may be agent ID "main"
|
|
7
|
+
* (not "jessie") in openclaw.json. The setup command detects this.
|
|
8
|
+
*
|
|
9
|
+
* Setup actions:
|
|
10
|
+
* 1. Read openclaw.json
|
|
11
|
+
* 2. Resolve workspace path (detect default agent)
|
|
12
|
+
* 3. Write identity files (SOUL.md, AGENTS.md, IDENTITY.md, USER.md, MISSION_CONTROL.md)
|
|
13
|
+
* 4. Dual-write: workspace/agent/ AND workspace/ (OpenClaw reads from root)
|
|
14
|
+
* 5. Create data directories (.jessie-data/)
|
|
15
|
+
* 6. Create memory directories (<workspace>/memory/)
|
|
16
|
+
* 7. Update openclaw.json with plugin config
|
|
17
|
+
*/
|
|
18
|
+
import * as fs from 'node:fs';
|
|
19
|
+
import * as path from 'node:path';
|
|
20
|
+
import { fileURLToPath } from 'node:url';
|
|
21
|
+
const IDENTITY_FILES = ['SOUL.md', 'AGENTS.md', 'IDENTITY.md', 'USER.md', 'MISSION_CONTROL.md'];
|
|
22
|
+
const MEMORY_DIRS = ['decisions', 'operations', 'strategic'];
|
|
23
|
+
const DATA_DIRS = ['decisions', 'delegations', 'briefings', 'trends'];
|
|
24
|
+
export async function runSetup(flags) {
|
|
25
|
+
console.log('\n Jessie — Fleet Commander Setup (JESSIE2)\n');
|
|
26
|
+
// 1. Find openclaw.json
|
|
27
|
+
const openclawHome = flags.openclawHome || findOpenClawHome();
|
|
28
|
+
if (!openclawHome) {
|
|
29
|
+
console.error(' ERROR: Could not find openclaw.json. Use --openclaw-home to specify.');
|
|
30
|
+
process.exit(1);
|
|
31
|
+
}
|
|
32
|
+
const configPath = path.join(openclawHome, 'openclaw.json');
|
|
33
|
+
if (!fs.existsSync(configPath)) {
|
|
34
|
+
console.error(` ERROR: ${configPath} not found`);
|
|
35
|
+
process.exit(1);
|
|
36
|
+
}
|
|
37
|
+
const config = JSON.parse(fs.readFileSync(configPath, 'utf-8'));
|
|
38
|
+
console.log(` Config: ${configPath}`);
|
|
39
|
+
// 2. Resolve workspace
|
|
40
|
+
const workspace = flags.workspace || resolveWorkspace(config);
|
|
41
|
+
if (!workspace) {
|
|
42
|
+
console.error(' ERROR: Could not determine Jessie workspace. Use --workspace to specify.');
|
|
43
|
+
process.exit(1);
|
|
44
|
+
}
|
|
45
|
+
console.log(` Workspace: ${workspace}`);
|
|
46
|
+
// 3. Find agent source files
|
|
47
|
+
const agentSourceDir = resolveAgentSourceDir();
|
|
48
|
+
if (!agentSourceDir) {
|
|
49
|
+
console.error(' ERROR: Could not find agent/ directory in package');
|
|
50
|
+
process.exit(1);
|
|
51
|
+
}
|
|
52
|
+
// 4. Write identity files (dual-write)
|
|
53
|
+
const agentDir = path.join(workspace, 'agent');
|
|
54
|
+
if (!fs.existsSync(agentDir)) {
|
|
55
|
+
fs.mkdirSync(agentDir, { recursive: true });
|
|
56
|
+
}
|
|
57
|
+
for (const file of IDENTITY_FILES) {
|
|
58
|
+
const src = path.join(agentSourceDir, file);
|
|
59
|
+
if (!fs.existsSync(src)) {
|
|
60
|
+
console.log(` SKIP: ${file} not found in package`);
|
|
61
|
+
continue;
|
|
62
|
+
}
|
|
63
|
+
let content = fs.readFileSync(src, 'utf-8');
|
|
64
|
+
// Template token replacement for AGENTS.md
|
|
65
|
+
if (file === 'AGENTS.md') {
|
|
66
|
+
content = content
|
|
67
|
+
.replace('{{MODEL}}', flags.model)
|
|
68
|
+
.replace('{{DATA_DIR}}', '.jessie-data')
|
|
69
|
+
.replace('{{MORNING_BRIEFING_AUTO_TRIGGER}}', 'true')
|
|
70
|
+
.replace('{{FLEET_SIZE}}', '6');
|
|
71
|
+
}
|
|
72
|
+
// Dual-write: agent/ subdirectory (canonical)
|
|
73
|
+
const agentDest = path.join(agentDir, file);
|
|
74
|
+
if (flags.force || !fs.existsSync(agentDest)) {
|
|
75
|
+
if (flags.force && fs.existsSync(agentDest)) {
|
|
76
|
+
const backupPath = `${agentDest}.backup.${Date.now()}`;
|
|
77
|
+
fs.copyFileSync(agentDest, backupPath);
|
|
78
|
+
console.log(` Backup: ${file} → ${path.basename(backupPath)}`);
|
|
79
|
+
}
|
|
80
|
+
fs.writeFileSync(agentDest, content);
|
|
81
|
+
console.log(` Write: agent/${file}`);
|
|
82
|
+
}
|
|
83
|
+
else {
|
|
84
|
+
console.log(` EXISTS: agent/${file} (use --force to overwrite)`);
|
|
85
|
+
}
|
|
86
|
+
// Dual-write: workspace root (where OpenClaw reads)
|
|
87
|
+
const rootDest = path.join(workspace, file);
|
|
88
|
+
if (flags.force || !fs.existsSync(rootDest)) {
|
|
89
|
+
if (flags.force && fs.existsSync(rootDest)) {
|
|
90
|
+
const backupPath = `${rootDest}.backup.${Date.now()}`;
|
|
91
|
+
fs.copyFileSync(rootDest, backupPath);
|
|
92
|
+
}
|
|
93
|
+
fs.writeFileSync(rootDest, content);
|
|
94
|
+
console.log(` Write: ${file} (workspace root)`);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
// 5. Create data directories
|
|
98
|
+
const dataDir = path.join(workspace, '.jessie-data');
|
|
99
|
+
for (const sub of DATA_DIRS) {
|
|
100
|
+
const dir = path.join(dataDir, sub);
|
|
101
|
+
if (!fs.existsSync(dir)) {
|
|
102
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
103
|
+
console.log(` Create: .jessie-data/${sub}/`);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
// 6. Create memory directories
|
|
107
|
+
for (const sub of MEMORY_DIRS) {
|
|
108
|
+
const dir = path.join(workspace, 'memory', sub);
|
|
109
|
+
if (!fs.existsSync(dir)) {
|
|
110
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
111
|
+
console.log(` Create: memory/${sub}/`);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
// 7. Update openclaw.json
|
|
115
|
+
if (!config.plugins)
|
|
116
|
+
config.plugins = {};
|
|
117
|
+
if (!config.plugins.entries)
|
|
118
|
+
config.plugins.entries = {};
|
|
119
|
+
config.plugins.entries['jessie'] = {
|
|
120
|
+
enabled: true,
|
|
121
|
+
config: {
|
|
122
|
+
dataDir: '.jessie-data',
|
|
123
|
+
morningBriefingAutoTrigger: true,
|
|
124
|
+
},
|
|
125
|
+
};
|
|
126
|
+
// Update agent entry tools.allow if we can find the agent
|
|
127
|
+
const agent = findJessieAgent(config);
|
|
128
|
+
if (agent) {
|
|
129
|
+
if (!agent.tools)
|
|
130
|
+
agent.tools = {};
|
|
131
|
+
if (!agent.tools.allow)
|
|
132
|
+
agent.tools.allow = [];
|
|
133
|
+
const commanderTools = [
|
|
134
|
+
'jessie_status', 'jessie_briefing', 'jessie_delegate',
|
|
135
|
+
'jessie_decide', 'jessie_report',
|
|
136
|
+
];
|
|
137
|
+
for (const tool of commanderTools) {
|
|
138
|
+
if (!agent.tools.allow.includes(tool)) {
|
|
139
|
+
agent.tools.allow.push(tool);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
console.log(' Updated: tools.allow with Commander tools');
|
|
143
|
+
}
|
|
144
|
+
fs.writeFileSync(configPath, JSON.stringify(config, null, 2));
|
|
145
|
+
console.log(' Updated: openclaw.json');
|
|
146
|
+
console.log('\n Setup complete! Restart openclaw-gateway to load the plugin.\n');
|
|
147
|
+
}
|
|
148
|
+
function findOpenClawHome() {
|
|
149
|
+
const home = process.env.HOME || '~';
|
|
150
|
+
const candidates = [
|
|
151
|
+
process.env.OPENCLAW_HOME,
|
|
152
|
+
path.join(home, '.clawdbot'),
|
|
153
|
+
path.join(home, '.openclaw'),
|
|
154
|
+
].filter(Boolean);
|
|
155
|
+
for (const dir of candidates) {
|
|
156
|
+
if (fs.existsSync(path.join(dir, 'openclaw.json')))
|
|
157
|
+
return dir;
|
|
158
|
+
}
|
|
159
|
+
return null;
|
|
160
|
+
}
|
|
161
|
+
function resolveWorkspace(config) {
|
|
162
|
+
const agent = findJessieAgent(config);
|
|
163
|
+
return agent?.workspace ?? null;
|
|
164
|
+
}
|
|
165
|
+
function findJessieAgent(config) {
|
|
166
|
+
const agents = config?.agents?.list || config?.agents || [];
|
|
167
|
+
if (!Array.isArray(agents))
|
|
168
|
+
return null;
|
|
169
|
+
return agents.find((a) => a.name === 'jessie' || a.id === 'main' || a.id === 'jessie') ?? null;
|
|
170
|
+
}
|
|
171
|
+
function resolveAgentSourceDir() {
|
|
172
|
+
try {
|
|
173
|
+
const thisFile = fileURLToPath(import.meta.url);
|
|
174
|
+
const packageRoot = path.resolve(path.dirname(thisFile), '..', '..');
|
|
175
|
+
const agentDir = path.join(packageRoot, 'agent');
|
|
176
|
+
if (fs.existsSync(agentDir))
|
|
177
|
+
return agentDir;
|
|
178
|
+
const altDir = path.join(packageRoot, '..', 'agent');
|
|
179
|
+
if (fs.existsSync(altDir))
|
|
180
|
+
return altDir;
|
|
181
|
+
}
|
|
182
|
+
catch { /* fallback */ }
|
|
183
|
+
return null;
|
|
184
|
+
}
|
|
185
|
+
//# sourceMappingURL=setup.js.map
|
|
@@ -0,0 +1 @@
|
|
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AC,QAAQ,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;QACrE,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;QACjD,IAAI,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC;YAAE,OAAO,QAAQ,CAAC;QAE7C,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;QACrD,IAAI,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC;YAAE,OAAO,MAAM,CAAC;IAC3C,CAAC;IAAC,MAAM,CAAC,CAAC,cAAc,CAAC,CAAC;IAE1B,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DecisionStore — JSON persistence for Commander decisions
|
|
3
|
+
*
|
|
4
|
+
* Tracks vetoes, approvals, delegations, and briefing state
|
|
5
|
+
* across gateway restarts. Analogous to Sam's PipelineManager.
|
|
6
|
+
*/
|
|
7
|
+
import type { VetoRecord, ApprovalRecord, DelegationRecord, DelegationStatus, BriefingRecord, JessiePluginConfig, VetoTrendEntry } from './types.js';
|
|
8
|
+
export declare class DecisionStore {
|
|
9
|
+
private data;
|
|
10
|
+
private readonly dataDir;
|
|
11
|
+
private readonly storePath;
|
|
12
|
+
constructor(config: JessiePluginConfig);
|
|
13
|
+
initialize(): Promise<void>;
|
|
14
|
+
private save;
|
|
15
|
+
addVeto(record: Omit<VetoRecord, 'id'>): VetoRecord;
|
|
16
|
+
getVetoes(limit?: number): VetoRecord[];
|
|
17
|
+
addApproval(record: Omit<ApprovalRecord, 'id'>): ApprovalRecord;
|
|
18
|
+
getApprovals(limit?: number): ApprovalRecord[];
|
|
19
|
+
addDelegation(record: Omit<DelegationRecord, 'id'>): DelegationRecord;
|
|
20
|
+
updateDelegation(id: string, status: DelegationStatus): DelegationRecord | null;
|
|
21
|
+
closeDelegation(id: string): DelegationRecord | null;
|
|
22
|
+
getActiveDelegations(): DelegationRecord[];
|
|
23
|
+
getAllDelegations(limit?: number): DelegationRecord[];
|
|
24
|
+
getDelegation(id: string): DelegationRecord | null;
|
|
25
|
+
recordBriefing(record: BriefingRecord): void;
|
|
26
|
+
getLatestBriefing(): BriefingRecord | null;
|
|
27
|
+
private updateVetoTrend;
|
|
28
|
+
getVetoTrend(periodDays?: number): {
|
|
29
|
+
trend: 'declining' | 'stable' | 'increasing';
|
|
30
|
+
entries: VetoTrendEntry[];
|
|
31
|
+
};
|
|
32
|
+
getSummary(): {
|
|
33
|
+
totalVetoes: number;
|
|
34
|
+
totalApprovals: number;
|
|
35
|
+
activeDelegations: number;
|
|
36
|
+
totalDelegations: number;
|
|
37
|
+
vetoTrend: "declining" | "stable" | "increasing";
|
|
38
|
+
lastBriefing: string | null;
|
|
39
|
+
lastUpdated: string;
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=decision-store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decision-store.d.ts","sourceRoot":"","sources":["../../src/command/decision-store.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,KAAK,EAEV,UAAU,EACV,cAAc,EACd,gBAAgB,EAChB,gBAAgB,EAChB,cAAc,EACd,kBAAkB,EAClB,cAAc,EACf,MAAM,YAAY,CAAC;AAiBpB,qBAAa,aAAa;IACxB,OAAO,CAAC,IAAI,CAAoB;IAChC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;IACjC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;gBAEvB,MAAM,EAAE,kBAAkB;IAMhC,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAoBjC,OAAO,CAAC,IAAI;IAWZ,OAAO,CAAC,MAAM,EAAE,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,GAAG,UAAU;IAUnD,SAAS,CAAC,KAAK,SAAK,GAAG,UAAU,EAAE;IAMnC,WAAW,CAAC,MAAM,EAAE,IAAI,CAAC,cAAc,EAAE,IAAI,CAAC,GAAG,cAAc;IAS/D,YAAY,CAAC,KAAK,SAAK,GAAG,cAAc,EAAE;IAM1C,aAAa,CAAC,MAAM,EAAE,IAAI,CAAC,gBAAgB,EAAE,IAAI,CAAC,GAAG,gBAAgB;IASrE,gBAAgB,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,gBAAgB,GAAG,gBAAgB,GAAG,IAAI;IAa/E,eAAe,CAAC,EAAE,EAAE,MAAM,GAAG,gBAAgB,GAAG,IAAI;IAIpD,oBAAoB,IAAI,gBAAgB,EAAE;IAI1C,iBAAiB,CAAC,KAAK,SAAK,GAAG,gBAAgB,EAAE;IAIjD,aAAa,CAAC,EAAE,EAAE,MAAM,GAAG,gBAAgB,GAAG,IAAI;IAMlD,cAAc,CAAC,MAAM,EAAE,cAAc,GAAG,IAAI;IAK5C,iBAAiB,IAAI,cAAc,GAAG,IAAI;IAM1C,OAAO,CAAC,eAAe;IAevB,YAAY,CAAC,UAAU,SAAK,GAAG;QAAE,KAAK,EAAE,WAAW,GAAG,QAAQ,GAAG,YAAY,CAAC;QAAC,OAAO,EAAE,cAAc,EAAE,CAAA;KAAE;IAuB1G,UAAU;;;;;;;;;CAaX"}
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DecisionStore — JSON persistence for Commander decisions
|
|
3
|
+
*
|
|
4
|
+
* Tracks vetoes, approvals, delegations, and briefing state
|
|
5
|
+
* across gateway restarts. Analogous to Sam's PipelineManager.
|
|
6
|
+
*/
|
|
7
|
+
import * as fs from 'node:fs';
|
|
8
|
+
import * as path from 'node:path';
|
|
9
|
+
function createEmptyStore() {
|
|
10
|
+
return {
|
|
11
|
+
version: 1,
|
|
12
|
+
vetoes: [],
|
|
13
|
+
approvals: [],
|
|
14
|
+
delegations: [],
|
|
15
|
+
latestBriefing: null,
|
|
16
|
+
vetoTrend: [],
|
|
17
|
+
nextVetoId: 1,
|
|
18
|
+
nextApprovalId: 1,
|
|
19
|
+
nextDelegationId: 1,
|
|
20
|
+
lastUpdated: new Date().toISOString(),
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
export class DecisionStore {
|
|
24
|
+
data;
|
|
25
|
+
dataDir;
|
|
26
|
+
storePath;
|
|
27
|
+
constructor(config) {
|
|
28
|
+
this.dataDir = config.dataDir;
|
|
29
|
+
this.storePath = path.join(this.dataDir, 'store.json');
|
|
30
|
+
this.data = createEmptyStore();
|
|
31
|
+
}
|
|
32
|
+
async initialize() {
|
|
33
|
+
const subdirs = ['decisions', 'delegations', 'briefings', 'trends'];
|
|
34
|
+
for (const sub of subdirs) {
|
|
35
|
+
const dir = path.join(this.dataDir, sub);
|
|
36
|
+
if (!fs.existsSync(dir)) {
|
|
37
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
if (fs.existsSync(this.storePath)) {
|
|
41
|
+
try {
|
|
42
|
+
const raw = fs.readFileSync(this.storePath, 'utf-8');
|
|
43
|
+
this.data = JSON.parse(raw);
|
|
44
|
+
}
|
|
45
|
+
catch {
|
|
46
|
+
console.warn('[jessie] Decision store corrupted, starting fresh');
|
|
47
|
+
this.data = createEmptyStore();
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
save() {
|
|
52
|
+
this.data.lastUpdated = new Date().toISOString();
|
|
53
|
+
try {
|
|
54
|
+
fs.writeFileSync(this.storePath, JSON.stringify(this.data, null, 2));
|
|
55
|
+
}
|
|
56
|
+
catch (err) {
|
|
57
|
+
console.error('[jessie] Failed to save decision store:', err);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
// ── Vetoes ──────────────────────────────────────────────────────
|
|
61
|
+
addVeto(record) {
|
|
62
|
+
const id = `VETO-${new Date().getFullYear()}-${String(this.data.nextVetoId).padStart(3, '0')}`;
|
|
63
|
+
const veto = { id, ...record };
|
|
64
|
+
this.data.vetoes.push(veto);
|
|
65
|
+
this.data.nextVetoId++;
|
|
66
|
+
this.updateVetoTrend();
|
|
67
|
+
this.save();
|
|
68
|
+
return veto;
|
|
69
|
+
}
|
|
70
|
+
getVetoes(limit = 20) {
|
|
71
|
+
return this.data.vetoes.slice(-limit).reverse();
|
|
72
|
+
}
|
|
73
|
+
// ── Approvals ───────────────────────────────────────────────────
|
|
74
|
+
addApproval(record) {
|
|
75
|
+
const id = `APPR-${new Date().getFullYear()}-${String(this.data.nextApprovalId).padStart(3, '0')}`;
|
|
76
|
+
const approval = { id, ...record };
|
|
77
|
+
this.data.approvals.push(approval);
|
|
78
|
+
this.data.nextApprovalId++;
|
|
79
|
+
this.save();
|
|
80
|
+
return approval;
|
|
81
|
+
}
|
|
82
|
+
getApprovals(limit = 20) {
|
|
83
|
+
return this.data.approvals.slice(-limit).reverse();
|
|
84
|
+
}
|
|
85
|
+
// ── Delegations ─────────────────────────────────────────────────
|
|
86
|
+
addDelegation(record) {
|
|
87
|
+
const id = `DEL-${new Date().getFullYear()}-${String(this.data.nextDelegationId).padStart(3, '0')}`;
|
|
88
|
+
const delegation = { id, ...record };
|
|
89
|
+
this.data.delegations.push(delegation);
|
|
90
|
+
this.data.nextDelegationId++;
|
|
91
|
+
this.save();
|
|
92
|
+
return delegation;
|
|
93
|
+
}
|
|
94
|
+
updateDelegation(id, status) {
|
|
95
|
+
const delegation = this.data.delegations.find(d => d.id === id);
|
|
96
|
+
if (!delegation)
|
|
97
|
+
return null;
|
|
98
|
+
delegation.status = status;
|
|
99
|
+
delegation.lastUpdate = new Date().toISOString();
|
|
100
|
+
if (status === 'complete') {
|
|
101
|
+
delegation.completedAt = delegation.lastUpdate;
|
|
102
|
+
}
|
|
103
|
+
this.save();
|
|
104
|
+
return delegation;
|
|
105
|
+
}
|
|
106
|
+
closeDelegation(id) {
|
|
107
|
+
return this.updateDelegation(id, 'complete');
|
|
108
|
+
}
|
|
109
|
+
getActiveDelegations() {
|
|
110
|
+
return this.data.delegations.filter(d => d.status !== 'complete');
|
|
111
|
+
}
|
|
112
|
+
getAllDelegations(limit = 20) {
|
|
113
|
+
return this.data.delegations.slice(-limit).reverse();
|
|
114
|
+
}
|
|
115
|
+
getDelegation(id) {
|
|
116
|
+
return this.data.delegations.find(d => d.id === id) ?? null;
|
|
117
|
+
}
|
|
118
|
+
// ── Briefings ───────────────────────────────────────────────────
|
|
119
|
+
recordBriefing(record) {
|
|
120
|
+
this.data.latestBriefing = record;
|
|
121
|
+
this.save();
|
|
122
|
+
}
|
|
123
|
+
getLatestBriefing() {
|
|
124
|
+
return this.data.latestBriefing;
|
|
125
|
+
}
|
|
126
|
+
// ── Trend Analysis ──────────────────────────────────────────────
|
|
127
|
+
updateVetoTrend() {
|
|
128
|
+
const now = new Date();
|
|
129
|
+
const weekKey = `${now.getFullYear()}-W${String(Math.ceil((now.getDate()) / 7)).padStart(2, '0')}`;
|
|
130
|
+
const existing = this.data.vetoTrend.find(e => e.week === weekKey);
|
|
131
|
+
if (existing) {
|
|
132
|
+
existing.count++;
|
|
133
|
+
}
|
|
134
|
+
else {
|
|
135
|
+
this.data.vetoTrend.push({ week: weekKey, count: 1 });
|
|
136
|
+
if (this.data.vetoTrend.length > 52) {
|
|
137
|
+
this.data.vetoTrend.shift();
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
getVetoTrend(periodDays = 30) {
|
|
142
|
+
const entries = this.data.vetoTrend;
|
|
143
|
+
if (entries.length < 2)
|
|
144
|
+
return { trend: 'stable', entries };
|
|
145
|
+
const weeksToCheck = Math.ceil(periodDays / 7);
|
|
146
|
+
const recent = entries.slice(-weeksToCheck);
|
|
147
|
+
if (recent.length < 2)
|
|
148
|
+
return { trend: 'stable', entries: recent };
|
|
149
|
+
const midpoint = Math.floor(recent.length / 2);
|
|
150
|
+
const firstHalf = recent.slice(0, midpoint);
|
|
151
|
+
const secondHalf = recent.slice(midpoint);
|
|
152
|
+
const avgFirst = firstHalf.reduce((s, e) => s + e.count, 0) / firstHalf.length;
|
|
153
|
+
const avgSecond = secondHalf.reduce((s, e) => s + e.count, 0) / secondHalf.length;
|
|
154
|
+
const threshold = 0.2;
|
|
155
|
+
if (avgSecond < avgFirst * (1 - threshold))
|
|
156
|
+
return { trend: 'declining', entries: recent };
|
|
157
|
+
if (avgSecond > avgFirst * (1 + threshold))
|
|
158
|
+
return { trend: 'increasing', entries: recent };
|
|
159
|
+
return { trend: 'stable', entries: recent };
|
|
160
|
+
}
|
|
161
|
+
// ── Summary ─────────────────────────────────────────────────────
|
|
162
|
+
getSummary() {
|
|
163
|
+
const active = this.getActiveDelegations();
|
|
164
|
+
const { trend } = this.getVetoTrend();
|
|
165
|
+
return {
|
|
166
|
+
totalVetoes: this.data.vetoes.length,
|
|
167
|
+
totalApprovals: this.data.approvals.length,
|
|
168
|
+
activeDelegations: active.length,
|
|
169
|
+
totalDelegations: this.data.delegations.length,
|
|
170
|
+
vetoTrend: trend,
|
|
171
|
+
lastBriefing: this.data.latestBriefing?.timestamp ?? null,
|
|
172
|
+
lastUpdated: this.data.lastUpdated,
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
//# sourceMappingURL=decision-store.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decision-store.js","sourceRoot":"","sources":["../../src/command/decision-store.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAYlC,SAAS,gBAAgB;IACvB,OAAO;QACL,OAAO,EAAE,CAAC;QACV,MAAM,EAAE,EAAE;QACV,SAAS,EAAE,EAAE;QACb,WAAW,EAAE,EAAE;QACf,cAAc,EAAE,IAAI;QACpB,SAAS,EAAE,EAAE;QACb,UAAU,EAAE,CAAC;QACb,cAAc,EAAE,CAAC;QACjB,gBAAgB,EAAE,CAA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EAAE,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,SAAS,IAAI,IAAI;YACzD,WAAW,EAAE,IAAI,CAAC,IAAI,CAAC,WAAW;SACnC,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* JESSIE2 Commander Types & Interfaces
|
|
3
|
+
*
|
|
4
|
+
* All structured data shapes for the Commander plugin:
|
|
5
|
+
* decisions, delegations, briefings, and fleet state.
|
|
6
|
+
*/
|
|
7
|
+
export type DecisionAction = 'veto' | 'approve';
|
|
8
|
+
export type RiskLevel = 'low' | 'medium' | 'high' | 'critical';
|
|
9
|
+
export declare const AUTO_APPROVAL_TIMEOUTS: Record<RiskLevel, number | null>;
|
|
10
|
+
export interface VetoRecord {
|
|
11
|
+
id: string;
|
|
12
|
+
timestamp: string;
|
|
13
|
+
targetAgent: string;
|
|
14
|
+
proposalId: string;
|
|
15
|
+
proposalSummary: string;
|
|
16
|
+
reasoning: string;
|
|
17
|
+
grilloScore?: number;
|
|
18
|
+
fleetBusDelivered: boolean;
|
|
19
|
+
memoryFileWritten: boolean;
|
|
20
|
+
}
|
|
21
|
+
export interface ApprovalRecord {
|
|
22
|
+
id: string;
|
|
23
|
+
timestamp: string;
|
|
24
|
+
targetAgent: string;
|
|
25
|
+
proposalId: string;
|
|
26
|
+
proposalSummary: string;
|
|
27
|
+
reasoning: string;
|
|
28
|
+
fleetBusDelivered: boolean;
|
|
29
|
+
memoryFileWritten: boolean;
|
|
30
|
+
}
|
|
31
|
+
export type DelegationPriority = 'critical' | 'high' | 'normal' | 'low';
|
|
32
|
+
export type DelegationStatus = 'pending' | 'acknowledged' | 'in-progress' | 'blocked' | 'complete';
|
|
33
|
+
export interface DelegationRecord {
|
|
34
|
+
id: string;
|
|
35
|
+
timestamp: string;
|
|
36
|
+
targetAgent: string;
|
|
37
|
+
description: string;
|
|
38
|
+
priority: DelegationPriority;
|
|
39
|
+
status: DelegationStatus;
|
|
40
|
+
fleetBusDispatched: boolean;
|
|
41
|
+
lastUpdate?: string;
|
|
42
|
+
completedAt?: string;
|
|
43
|
+
}
|
|
44
|
+
export type BriefingFormat = 'full' | 'summary' | 'telegram';
|
|
45
|
+
export interface BriefingRecord {
|
|
46
|
+
timestamp: string;
|
|
47
|
+
format: BriefingFormat;
|
|
48
|
+
agentStatuses: Record<string, string>;
|
|
49
|
+
overallStatus: 'GREEN' | 'YELLOW' | 'RED';
|
|
50
|
+
}
|
|
51
|
+
export interface DecisionStoreData {
|
|
52
|
+
version: number;
|
|
53
|
+
vetoes: VetoRecord[];
|
|
54
|
+
approvals: ApprovalRecord[];
|
|
55
|
+
delegations: DelegationRecord[];
|
|
56
|
+
latestBriefing: BriefingRecord | null;
|
|
57
|
+
vetoTrend: VetoTrendEntry[];
|
|
58
|
+
nextVetoId: number;
|
|
59
|
+
nextApprovalId: number;
|
|
60
|
+
nextDelegationId: number;
|
|
61
|
+
lastUpdated: string;
|
|
62
|
+
}
|
|
63
|
+
export interface VetoTrendEntry {
|
|
64
|
+
week: string;
|
|
65
|
+
count: number;
|
|
66
|
+
}
|
|
67
|
+
export interface JessiePluginConfig {
|
|
68
|
+
dataDir: string;
|
|
69
|
+
morningBriefingAutoTrigger: boolean;
|
|
70
|
+
}
|
|
71
|
+
export declare const DEFAULT_CONFIG: JessiePluginConfig;
|
|
72
|
+
export type FleetBusState = 'connected' | 'observer' | 'standalone';
|
|
73
|
+
export interface JessieStatusResult {
|
|
74
|
+
agent: {
|
|
75
|
+
name: string;
|
|
76
|
+
role: string;
|
|
77
|
+
version: string;
|
|
78
|
+
internalName: string;
|
|
79
|
+
product: string;
|
|
80
|
+
};
|
|
81
|
+
fleet: {
|
|
82
|
+
agentCount: number;
|
|
83
|
+
};
|
|
84
|
+
decisions: {
|
|
85
|
+
pendingCount: number;
|
|
86
|
+
totalVetoes: number;
|
|
87
|
+
totalApprovals: number;
|
|
88
|
+
vetoTrend: 'declining' | 'stable' | 'increasing';
|
|
89
|
+
};
|
|
90
|
+
delegations: {
|
|
91
|
+
activeCount: number;
|
|
92
|
+
totalCount: number;
|
|
93
|
+
};
|
|
94
|
+
lastBriefing: string | null;
|
|
95
|
+
memory: {
|
|
96
|
+
lastWrite: string | null;
|
|
97
|
+
};
|
|
98
|
+
fleetBus: FleetBusState;
|
|
99
|
+
}
|
|
100
|
+
export type ReportType = 'fleet-summary' | 'decisions' | 'delegations' | 'escalations';
|
|
101
|
+
export type MemoryEventType = 'veto' | 'approval' | 'escalation' | 'fleet-alert' | 'delegation' | 'delegation-closed' | 'morning-briefing';
|
|
102
|
+
export declare const MEMORY_SUBDIRECTORY_MAP: Record<MemoryEventType, string>;
|
|
103
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/command/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,SAAS,CAAC;AAEhD,MAAM,MAAM,SAAS,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,UAAU,CAAC;AAE/D,eAAO,MAAM,sBAAsB,EAAE,MAAM,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAKnE,CAAC;AAEF,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,EAAE,MAAM,CAAC;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,iBAAiB,EAAE,OAAO,CAAC;CAC5B;AAED,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,U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B,eAAO,MAAM,uBAAuB,EAAE,MAAM,CAAC,eAAe,EAAE,MAAM,CAQnE,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* JESSIE2 Commander Types & Interfaces
|
|
3
|
+
*
|
|
4
|
+
* All structured data shapes for the Commander plugin:
|
|
5
|
+
* decisions, delegations, briefings, and fleet state.
|
|
6
|
+
*/
|
|
7
|
+
export const AUTO_APPROVAL_TIMEOUTS = {
|
|
8
|
+
low: 24 * 60 * 60 * 1000,
|
|
9
|
+
medium: 48 * 60 * 60 * 1000,
|
|
10
|
+
high: 72 * 60 * 60 * 1000,
|
|
11
|
+
critical: null,
|
|
12
|
+
};
|
|
13
|
+
export const DEFAULT_CONFIG = {
|
|
14
|
+
dataDir: '.jessie-data',
|
|
15
|
+
morningBriefingAutoTrigger: true,
|
|
16
|
+
};
|
|
17
|
+
export const MEMORY_SUBDIRECTORY_MAP = {
|
|
18
|
+
'veto': 'decisions',
|
|
19
|
+
'approval': 'decisions',
|
|
20
|
+
'escalation': 'decisions',
|
|
21
|
+
'fleet-alert': 'operations',
|
|
22
|
+
'delegation': 'operations',
|
|
23
|
+
'delegation-closed': 'operations',
|
|
24
|
+
'morning-briefing': 'strategic',
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/command/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAQH,MAAM,CAAC,MAAM,sBAAsB,GAAqC;IACtE,GAAG,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI;IACxB,MAAM,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI;IAC3B,IAAI,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI;IACzB,QAAQ,EAAE,IAAI;CACf,CAAC;AAsFF,MAAM,CAAC,MAAM,cAAc,GAAuB;IAChD,OAAO,EAAE,cAAc;IACvB,0BAA0B,EAAE,IAAI;CACjC,CAAC;AAiDF,MAAM,CAAC,MAAM,uBAAuB,GAAoC;IACtE,MAAM,EAAE,WAAW;IACnB,UAAU,EAAE,WAAW;IACvB,YAAY,EAAE,WAAW;IACzB,aAAa,EAAE,YAAY;IAC3B,YAAY,EAAE,YAAY;IAC1B,mBAAmB,EAAE,YAAY;IACjC,kBAAkB,EAAE,WAAW;CAChC,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,4 @@
|
|
|
1
1
|
export { default } from './plugin.js';
|
|
2
|
+
export { DecisionStore } from './command/decision-store.js';
|
|
3
|
+
export type { JessiePluginConfig, JessieStatusResult, FleetBusState, VetoRecord, ApprovalRecord, DelegationRecord, DecisionStoreData, BriefingFormat, BriefingRecord, ReportType, MemoryEventType, } from './command/types.js';
|
|
2
4
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,YAAY,EACV,kBAAkB,EAClB,kBAAkB,EAClB,aAAa,EACb,UAAU,EACV,cAAc,EACd,gBAAgB,EAChB,iBAAiB,EACjB,cAAc,EACd,cAAc,EACd,UAAU,EACV,eAAe,GAChB,MAAM,oBAAoB,CAAC"}
|
package/dist/index.js
CHANGED
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* JessieMemory — MemoryWriter integration for Commander events
|
|
3
|
+
*
|
|
4
|
+
* Writes structured memory files for decisions, delegations,
|
|
5
|
+
* briefings, and escalations. Uses @aiassesstech/mighty-mark
|
|
6
|
+
* MemoryWriter as an optional dependency.
|
|
7
|
+
*/
|
|
8
|
+
import type { MemoryEventType } from '../command/types.js';
|
|
9
|
+
interface MemoryWriteOptions {
|
|
10
|
+
type: MemoryEventType;
|
|
11
|
+
tags: string[];
|
|
12
|
+
date: string;
|
|
13
|
+
metadata: Record<string, unknown>;
|
|
14
|
+
content: string;
|
|
15
|
+
}
|
|
16
|
+
export declare function initMemory(): Promise<boolean>;
|
|
17
|
+
export declare function writeMemory(opts: MemoryWriteOptions): Promise<boolean>;
|
|
18
|
+
export declare function isMemoryAvailable(): boolean;
|
|
19
|
+
export declare function getLastWriteTimestamp(): string | null;
|
|
20
|
+
export {};
|
|
21
|
+
//# sourceMappingURL=jessie-memory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jessie-memory.d.ts","sourceRoot":"","sources":["../../src/memory/jessie-memory.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAG3D,UAAU,kBAAkB;IAC1B,IAAI,EAAE,eAAe,CAAC;IACtB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,OAAO,EAAE,MAAM,CAAC;CACjB;AAKD,wBAAsB,UAAU,IAAI,OAAO,CAAC,OAAO,CAAC,CAkBnD;AAED,wBAAsB,WAAW,CAAC,IAAI,EAAE,kBAAkB,GAAG,OAAO,CAAC,OAAO,CAAC,CAoB5E;AAED,wBAAgB,iBAAiB,IAAI,OAAO,CAE3C;AAED,wBAAgB,qBAAqB,IAAI,MAAM,GAAG,IAAI,CAOrD"}
|