gaslighting-engine 0.3.0 → 0.4.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/README.md +147 -18
- package/desktop-dist/assets/index-BoI6eWtN.js +44 -0
- package/desktop-dist/assets/index-oFTvTTu8.css +1 -0
- package/desktop-dist/index.html +13 -0
- package/dist/agent-runtimes/permissions.js +34 -0
- package/dist/agent-runtimes/prompts.js +30 -0
- package/dist/agent-runtimes/registry.js +214 -0
- package/dist/agent-runtimes/types.js +1 -0
- package/dist/cli.js +145 -4
- package/dist/commands/agent.js +11 -0
- package/dist/commands/apiRun.js +32 -0
- package/dist/commands/cockpit.js +61 -7
- package/dist/commands/desktop.js +37 -0
- package/dist/commands/doctor.js +8 -1
- package/dist/commands/loop.js +64 -0
- package/dist/commands/mcp.js +43 -0
- package/dist/commands/skill.js +23 -0
- package/dist/core/cockpitHtml.js +4 -2
- package/dist/core/codexRuntime.js +44 -32
- package/dist/core/generateDocs.js +16 -10
- package/dist/core/generateOtherMarkdown.js +27 -27
- package/dist/core/generateStructuredDocs.js +405 -0
- package/dist/core/mcpRegistry.js +103 -0
- package/dist/core/missionLoop.js +179 -0
- package/dist/core/skillRegistry.js +62 -0
- package/dist/desktop/main.js +186 -0
- package/dist/desktop/preload.js +22 -0
- package/dist/utils/logger.js +1 -1
- package/dist/version.js +1 -1
- package/docs/codex-usage.md +36 -3
- package/examples/ecommerce/.agents/config.json +10 -0
- package/examples/ecommerce/.agents/mcp/manifest.json +5 -0
- package/examples/ecommerce/.agents/runtimes/claude.json +6 -0
- package/examples/ecommerce/.agents/runtimes/codex.json +6 -0
- package/examples/ecommerce/.agents/runtimes/kimi.json +6 -0
- package/examples/ecommerce/.agents/runtimes/local.json +6 -0
- package/examples/ecommerce/.agents/runtimes/openai_compatible.json +6 -0
- package/examples/ecommerce/.agents/runtimes/opencode.json +6 -0
- package/examples/ecommerce/.agents/runtimes/qwen.json +6 -0
- package/examples/ecommerce/.codex/prompts/gaslighting.md +9 -9
- package/examples/ecommerce/.gaslighting/AGENTS.md +9 -9
- package/examples/ecommerce/.gaslighting/AGENT_RUNTIME.md +1 -1
- package/examples/ecommerce/.gaslighting/CODEX_PROMPT.md +9 -9
- package/examples/ecommerce/.gaslighting/DECISION_LOG.md +1 -1
- package/examples/ecommerce/.gaslighting/GASLIGHTING.md +2 -2
- package/examples/ecommerce/.gaslighting/INDEX.md +39 -0
- package/examples/ecommerce/.gaslighting/MEMORY.md +1 -1
- package/examples/ecommerce/.gaslighting/PRD.md +1 -1
- package/examples/ecommerce/.gaslighting/PROJECT_CARE.md +1 -1
- package/examples/ecommerce/.gaslighting/checkpoints/latest.md +7 -0
- package/examples/ecommerce/.gaslighting/config.json +7 -0
- package/examples/ecommerce/.gaslighting/decisions/ADR-0001-stack.md +11 -0
- package/examples/ecommerce/.gaslighting/decisions/ADR-0002-agent-runtime.md +11 -0
- package/examples/ecommerce/.gaslighting/features/core-scope/DECISIONS.md +5 -0
- package/examples/ecommerce/.gaslighting/features/core-scope/FEATURE.md +7 -0
- package/examples/ecommerce/.gaslighting/features/core-scope/RISKS.md +5 -0
- package/examples/ecommerce/.gaslighting/features/core-scope/TASKS.md +18 -0
- package/examples/ecommerce/.gaslighting/loops/current-session.json +9 -0
- package/examples/ecommerce/.gaslighting/memory/OPEN_QUESTIONS.md +5 -0
- package/examples/ecommerce/.gaslighting/memory/PROJECT_MEMORY.md +5 -0
- package/examples/ecommerce/.gaslighting/memory/SESSION_LOG.md +3 -0
- package/examples/ecommerce/.gaslighting/mission/COMPLETION_STANDARD.md +11 -0
- package/examples/ecommerce/.gaslighting/mission/EXECUTION_RULES.md +20 -0
- package/examples/ecommerce/.gaslighting/mission/PROJECT_PURPOSE.md +20 -0
- package/examples/ecommerce/.gaslighting/operations/DEPLOYMENT.md +6 -0
- package/examples/ecommerce/.gaslighting/operations/DOMAIN.md +6 -0
- package/examples/ecommerce/.gaslighting/operations/ENV.md +5 -0
- package/examples/ecommerce/.gaslighting/operations/GIT.md +7 -0
- package/examples/ecommerce/.gaslighting/operations/GITHUB.md +7 -0
- package/examples/ecommerce/.gaslighting/operations/PROJECT_CARE.md +76 -0
- package/examples/ecommerce/.gaslighting/pages/admin-products/ACCEPTANCE.md +7 -0
- package/examples/ecommerce/.gaslighting/pages/admin-products/PAGE_PRD.md +15 -0
- package/examples/ecommerce/.gaslighting/pages/cart/ACCEPTANCE.md +7 -0
- package/examples/ecommerce/.gaslighting/pages/cart/PAGE_PRD.md +15 -0
- package/examples/ecommerce/.gaslighting/pages/checkout/ACCEPTANCE.md +7 -0
- package/examples/ecommerce/.gaslighting/pages/checkout/PAGE_PRD.md +15 -0
- package/examples/ecommerce/.gaslighting/pages/home/ACCEPTANCE.md +7 -0
- package/examples/ecommerce/.gaslighting/pages/home/PAGE_PRD.md +15 -0
- package/examples/ecommerce/.gaslighting/pages/my-orders/ACCEPTANCE.md +7 -0
- package/examples/ecommerce/.gaslighting/pages/my-orders/PAGE_PRD.md +15 -0
- package/examples/ecommerce/.gaslighting/pages/order-complete/ACCEPTANCE.md +7 -0
- package/examples/ecommerce/.gaslighting/pages/order-complete/PAGE_PRD.md +15 -0
- package/examples/ecommerce/.gaslighting/pages/product-detail/ACCEPTANCE.md +7 -0
- package/examples/ecommerce/.gaslighting/pages/product-detail/PAGE_PRD.md +15 -0
- package/examples/ecommerce/.gaslighting/pages/product-list/ACCEPTANCE.md +7 -0
- package/examples/ecommerce/.gaslighting/pages/product-list/PAGE_PRD.md +15 -0
- package/examples/ecommerce/.gaslighting/product/PAGE_MAP.md +11 -0
- package/examples/ecommerce/.gaslighting/product/PRD.md +115 -0
- package/examples/ecommerce/.gaslighting/product/USER_FLOWS.md +22 -0
- package/examples/ecommerce/.gaslighting/tasks/TASK-0001.md +17 -0
- package/examples/ecommerce/.gaslighting/verification/latest-report.md +3 -0
- package/examples/ecommerce/AGENTS.md +12 -10
- package/examples/hospital-homepage/.agents/config.json +10 -0
- package/examples/hospital-homepage/.agents/mcp/manifest.json +5 -0
- package/examples/hospital-homepage/.agents/runtimes/claude.json +6 -0
- package/examples/hospital-homepage/.agents/runtimes/codex.json +6 -0
- package/examples/hospital-homepage/.agents/runtimes/kimi.json +6 -0
- package/examples/hospital-homepage/.agents/runtimes/local.json +6 -0
- package/examples/hospital-homepage/.agents/runtimes/openai_compatible.json +6 -0
- package/examples/hospital-homepage/.agents/runtimes/opencode.json +6 -0
- package/examples/hospital-homepage/.agents/runtimes/qwen.json +6 -0
- package/examples/hospital-homepage/.codex/prompts/gaslighting.md +9 -9
- package/examples/hospital-homepage/.gaslighting/AGENTS.md +9 -9
- package/examples/hospital-homepage/.gaslighting/CODEX_PROMPT.md +9 -9
- package/examples/hospital-homepage/.gaslighting/INDEX.md +37 -0
- package/examples/hospital-homepage/.gaslighting/checkpoints/latest.md +7 -0
- package/examples/hospital-homepage/.gaslighting/config.json +7 -0
- package/examples/hospital-homepage/.gaslighting/decisions/ADR-0001-stack.md +11 -0
- package/examples/hospital-homepage/.gaslighting/decisions/ADR-0002-agent-runtime.md +11 -0
- package/examples/hospital-homepage/.gaslighting/features/core-scope/DECISIONS.md +5 -0
- package/examples/hospital-homepage/.gaslighting/features/core-scope/FEATURE.md +7 -0
- package/examples/hospital-homepage/.gaslighting/features/core-scope/RISKS.md +5 -0
- package/examples/hospital-homepage/.gaslighting/features/core-scope/TASKS.md +17 -0
- package/examples/hospital-homepage/.gaslighting/loops/current-session.json +9 -0
- package/examples/hospital-homepage/.gaslighting/memory/OPEN_QUESTIONS.md +5 -0
- package/examples/hospital-homepage/.gaslighting/memory/PROJECT_MEMORY.md +5 -0
- package/examples/hospital-homepage/.gaslighting/memory/SESSION_LOG.md +3 -0
- package/examples/hospital-homepage/.gaslighting/mission/COMPLETION_STANDARD.md +11 -0
- package/examples/hospital-homepage/.gaslighting/mission/EXECUTION_RULES.md +20 -0
- package/examples/hospital-homepage/.gaslighting/mission/PROJECT_PURPOSE.md +20 -0
- package/examples/hospital-homepage/.gaslighting/operations/DEPLOYMENT.md +6 -0
- package/examples/hospital-homepage/.gaslighting/operations/DOMAIN.md +6 -0
- package/examples/hospital-homepage/.gaslighting/operations/ENV.md +5 -0
- package/examples/hospital-homepage/.gaslighting/operations/GIT.md +7 -0
- package/examples/hospital-homepage/.gaslighting/operations/GITHUB.md +7 -0
- package/examples/hospital-homepage/.gaslighting/operations/PROJECT_CARE.md +76 -0
- package/examples/hospital-homepage/.gaslighting/pages/consultation-contact/ACCEPTANCE.md +7 -0
- package/examples/hospital-homepage/.gaslighting/pages/consultation-contact/PAGE_PRD.md +15 -0
- package/examples/hospital-homepage/.gaslighting/pages/departments-treatments/ACCEPTANCE.md +7 -0
- package/examples/hospital-homepage/.gaslighting/pages/departments-treatments/PAGE_PRD.md +15 -0
- package/examples/hospital-homepage/.gaslighting/pages/doctor-profiles/ACCEPTANCE.md +7 -0
- package/examples/hospital-homepage/.gaslighting/pages/doctor-profiles/PAGE_PRD.md +15 -0
- package/examples/hospital-homepage/.gaslighting/pages/home/ACCEPTANCE.md +7 -0
- package/examples/hospital-homepage/.gaslighting/pages/home/PAGE_PRD.md +15 -0
- package/examples/hospital-homepage/.gaslighting/pages/hospital-introduction/ACCEPTANCE.md +7 -0
- package/examples/hospital-homepage/.gaslighting/pages/hospital-introduction/PAGE_PRD.md +15 -0
- package/examples/hospital-homepage/.gaslighting/pages/location/ACCEPTANCE.md +7 -0
- package/examples/hospital-homepage/.gaslighting/pages/location/PAGE_PRD.md +15 -0
- package/examples/hospital-homepage/.gaslighting/pages/privacy-policy/ACCEPTANCE.md +7 -0
- package/examples/hospital-homepage/.gaslighting/pages/privacy-policy/PAGE_PRD.md +15 -0
- package/examples/hospital-homepage/.gaslighting/product/PAGE_MAP.md +9 -0
- package/examples/hospital-homepage/.gaslighting/product/PRD.md +119 -0
- package/examples/hospital-homepage/.gaslighting/product/USER_FLOWS.md +20 -0
- package/examples/hospital-homepage/.gaslighting/tasks/TASK-0001.md +17 -0
- package/examples/hospital-homepage/.gaslighting/verification/latest-report.md +3 -0
- package/examples/hospital-homepage/AGENTS.md +12 -10
- package/examples/landing-page/.agents/config.json +10 -0
- package/examples/landing-page/.agents/mcp/manifest.json +5 -0
- package/examples/landing-page/.agents/runtimes/claude.json +6 -0
- package/examples/landing-page/.agents/runtimes/codex.json +6 -0
- package/examples/landing-page/.agents/runtimes/kimi.json +6 -0
- package/examples/landing-page/.agents/runtimes/local.json +6 -0
- package/examples/landing-page/.agents/runtimes/openai_compatible.json +6 -0
- package/examples/landing-page/.agents/runtimes/opencode.json +6 -0
- package/examples/landing-page/.agents/runtimes/qwen.json +6 -0
- package/examples/landing-page/.codex/prompts/gaslighting.md +9 -9
- package/examples/landing-page/.gaslighting/AGENTS.md +9 -9
- package/examples/landing-page/.gaslighting/AGENT_RUNTIME.md +1 -1
- package/examples/landing-page/.gaslighting/CODEX_PROMPT.md +9 -9
- package/examples/landing-page/.gaslighting/DECISION_LOG.md +1 -1
- package/examples/landing-page/.gaslighting/GASLIGHTING.md +2 -2
- package/examples/landing-page/.gaslighting/INDEX.md +31 -0
- package/examples/landing-page/.gaslighting/MEMORY.md +1 -1
- package/examples/landing-page/.gaslighting/PRD.md +1 -1
- package/examples/landing-page/.gaslighting/PROJECT_CARE.md +1 -1
- package/examples/landing-page/.gaslighting/checkpoints/latest.md +7 -0
- package/examples/landing-page/.gaslighting/config.json +7 -0
- package/examples/landing-page/.gaslighting/decisions/ADR-0001-stack.md +11 -0
- package/examples/landing-page/.gaslighting/decisions/ADR-0002-agent-runtime.md +11 -0
- package/examples/landing-page/.gaslighting/features/core-scope/DECISIONS.md +5 -0
- package/examples/landing-page/.gaslighting/features/core-scope/FEATURE.md +7 -0
- package/examples/landing-page/.gaslighting/features/core-scope/RISKS.md +5 -0
- package/examples/landing-page/.gaslighting/features/core-scope/TASKS.md +11 -0
- package/examples/landing-page/.gaslighting/loops/current-session.json +9 -0
- package/examples/landing-page/.gaslighting/memory/OPEN_QUESTIONS.md +5 -0
- package/examples/landing-page/.gaslighting/memory/PROJECT_MEMORY.md +5 -0
- package/examples/landing-page/.gaslighting/memory/SESSION_LOG.md +3 -0
- package/examples/landing-page/.gaslighting/mission/COMPLETION_STANDARD.md +11 -0
- package/examples/landing-page/.gaslighting/mission/EXECUTION_RULES.md +20 -0
- package/examples/landing-page/.gaslighting/mission/PROJECT_PURPOSE.md +19 -0
- package/examples/landing-page/.gaslighting/operations/DEPLOYMENT.md +6 -0
- package/examples/landing-page/.gaslighting/operations/DOMAIN.md +6 -0
- package/examples/landing-page/.gaslighting/operations/ENV.md +5 -0
- package/examples/landing-page/.gaslighting/operations/GIT.md +7 -0
- package/examples/landing-page/.gaslighting/operations/GITHUB.md +7 -0
- package/examples/landing-page/.gaslighting/operations/PROJECT_CARE.md +75 -0
- package/examples/landing-page/.gaslighting/pages/single-landing-page-with-hero-problem-solution-benefits-social-p/ACCEPTANCE.md +7 -0
- package/examples/landing-page/.gaslighting/pages/single-landing-page-with-hero-problem-solution-benefits-social-p/PAGE_PRD.md +15 -0
- package/examples/landing-page/.gaslighting/product/PAGE_MAP.md +3 -0
- package/examples/landing-page/.gaslighting/product/PRD.md +103 -0
- package/examples/landing-page/.gaslighting/product/USER_FLOWS.md +14 -0
- package/examples/landing-page/.gaslighting/tasks/TASK-0001.md +17 -0
- package/examples/landing-page/.gaslighting/verification/latest-report.md +3 -0
- package/examples/landing-page/AGENTS.md +12 -10
- package/package.json +22 -5
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
2
|
+
import { dirname, join } from "node:path";
|
|
3
|
+
export function createSharedSkill(root, name, description) {
|
|
4
|
+
const normalized = normalizeSkillName(name);
|
|
5
|
+
const path = join(root, ".agents", "skills", normalized, "SKILL.md");
|
|
6
|
+
writeText(path, `---
|
|
7
|
+
name: ${normalized}
|
|
8
|
+
description: ${description || `Shared Gaslighting-engine skill for ${normalized}.`}
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# ${normalized}
|
|
12
|
+
|
|
13
|
+
Use this skill when the project requires the ${normalized} workflow.
|
|
14
|
+
|
|
15
|
+
## Rules
|
|
16
|
+
|
|
17
|
+
- Preserve full requested scope.
|
|
18
|
+
- Do not fake completion.
|
|
19
|
+
- Record assumptions, missing information, decisions, and operational risk.
|
|
20
|
+
- If work is incomplete, say it is incomplete.
|
|
21
|
+
`);
|
|
22
|
+
return path;
|
|
23
|
+
}
|
|
24
|
+
export function installSharedSkill(root, name, runtime) {
|
|
25
|
+
const normalized = normalizeSkillName(name);
|
|
26
|
+
const source = join(root, ".agents", "skills", normalized, "SKILL.md");
|
|
27
|
+
if (!existsSync(source))
|
|
28
|
+
createSharedSkill(root, normalized);
|
|
29
|
+
const content = readFileSync(source, "utf8");
|
|
30
|
+
if (runtime === "codex") {
|
|
31
|
+
const target = join(root, ".codex", "skills", normalized, "SKILL.md");
|
|
32
|
+
writeText(target, content);
|
|
33
|
+
return target;
|
|
34
|
+
}
|
|
35
|
+
if (runtime === "claude") {
|
|
36
|
+
const target = join(root, ".claude", "skills", normalized, "SKILL.md");
|
|
37
|
+
writeText(target, content);
|
|
38
|
+
return target;
|
|
39
|
+
}
|
|
40
|
+
const target = join(root, ".agents", "exports", runtime, "skills", normalized, "SKILL.md");
|
|
41
|
+
writeText(target, content);
|
|
42
|
+
return target;
|
|
43
|
+
}
|
|
44
|
+
export function doctorSkills(root) {
|
|
45
|
+
return [
|
|
46
|
+
{
|
|
47
|
+
ok: existsSync(join(root, ".agents", "skills")),
|
|
48
|
+
message: ".agents/skills exists as shared skill source.",
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
ok: existsSync(join(root, ".codex", "skills")),
|
|
52
|
+
message: ".codex/skills exists as Codex export target.",
|
|
53
|
+
},
|
|
54
|
+
];
|
|
55
|
+
}
|
|
56
|
+
function normalizeSkillName(name) {
|
|
57
|
+
return name.toLowerCase().replace(/[^a-z0-9_-]+/g, "-").replace(/^-+|-+$/g, "") || "gaslighting-skill";
|
|
58
|
+
}
|
|
59
|
+
function writeText(path, content) {
|
|
60
|
+
mkdirSync(dirname(path), { recursive: true });
|
|
61
|
+
writeFileSync(path, content, "utf8");
|
|
62
|
+
}
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import { app, BrowserWindow, dialog, ipcMain } from "electron";
|
|
2
|
+
import { spawn } from "node:child_process";
|
|
3
|
+
import { existsSync } from "node:fs";
|
|
4
|
+
import { join, resolve } from "node:path";
|
|
5
|
+
import { fileURLToPath } from "node:url";
|
|
6
|
+
import { platform } from "node:os";
|
|
7
|
+
import { analyze } from "../core/analyze.js";
|
|
8
|
+
import { pageList, projectPurpose } from "../core/content.js";
|
|
9
|
+
import { generateCodexInstallDocs, generateDocs } from "../core/generateDocs.js";
|
|
10
|
+
import { inspectProjectCare } from "../core/projectCare.js";
|
|
11
|
+
import { detectAgentRuntimes, getAgentRuntimeAdapter, listAgentRuntimeAdapters } from "../agent-runtimes/registry.js";
|
|
12
|
+
import { getMissionLoopStatus, resumeMissionLoop, startMissionLoop, stopMissionLoop } from "../core/missionLoop.js";
|
|
13
|
+
import { doctorMcp, installMcpServer, listInstalledMcpServers, searchMcpServers } from "../core/mcpRegistry.js";
|
|
14
|
+
import { createSharedSkill, doctorSkills, installSharedSkill } from "../core/skillRegistry.js";
|
|
15
|
+
import { writeDocs } from "../utils/file.js";
|
|
16
|
+
import { packageVersion } from "../version.js";
|
|
17
|
+
const initialRoot = resolve(process.env.GASLIGHTING_DESKTOP_ROOT || process.cwd());
|
|
18
|
+
const initialRequest = process.env.GASLIGHTING_DESKTOP_REQUEST || "";
|
|
19
|
+
let currentRoot = initialRoot;
|
|
20
|
+
let currentRequest = initialRequest || "Build a practical MVP without shrinking scope.";
|
|
21
|
+
let mainWindow;
|
|
22
|
+
async function createWindow() {
|
|
23
|
+
mainWindow = new BrowserWindow({
|
|
24
|
+
width: 1440,
|
|
25
|
+
height: 940,
|
|
26
|
+
minWidth: 1120,
|
|
27
|
+
minHeight: 760,
|
|
28
|
+
title: "Gaslighting Mission Control",
|
|
29
|
+
backgroundColor: "#f5f5f3",
|
|
30
|
+
webPreferences: {
|
|
31
|
+
preload: join(app.getAppPath(), "dist", "desktop", "preload.js"),
|
|
32
|
+
contextIsolation: true,
|
|
33
|
+
nodeIntegration: false,
|
|
34
|
+
},
|
|
35
|
+
});
|
|
36
|
+
if (process.env.GASLIGHTING_DESKTOP_DEV) {
|
|
37
|
+
await mainWindow.loadURL("http://127.0.0.1:5173");
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
await mainWindow.loadFile(join(app.getAppPath(), "desktop-dist", "index.html"));
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
app.whenReady().then(createWindow);
|
|
44
|
+
app.on("window-all-closed", () => {
|
|
45
|
+
if (process.platform !== "darwin")
|
|
46
|
+
app.quit();
|
|
47
|
+
});
|
|
48
|
+
app.on("activate", () => {
|
|
49
|
+
if (BrowserWindow.getAllWindows().length === 0)
|
|
50
|
+
void createWindow();
|
|
51
|
+
});
|
|
52
|
+
ipcMain.handle("project:select", async () => {
|
|
53
|
+
const result = await dialog.showOpenDialog({ properties: ["openDirectory", "createDirectory"] });
|
|
54
|
+
if (!result.canceled && result.filePaths[0])
|
|
55
|
+
currentRoot = result.filePaths[0];
|
|
56
|
+
return buildDesktopState();
|
|
57
|
+
});
|
|
58
|
+
ipcMain.handle("mission:state", () => buildDesktopState());
|
|
59
|
+
ipcMain.handle("mission:generate", (_event, input) => {
|
|
60
|
+
updateCurrent(input);
|
|
61
|
+
const generateInput = toGenerateInput(input);
|
|
62
|
+
writeDocs(currentRoot, generateDocs(generateInput, currentRoot).docs, true, false);
|
|
63
|
+
writeDocs(currentRoot, generateCodexInstallDocs(), true, false);
|
|
64
|
+
return buildDesktopState(input);
|
|
65
|
+
});
|
|
66
|
+
ipcMain.handle("agent:start", async (event, input) => {
|
|
67
|
+
updateCurrent(input);
|
|
68
|
+
const runtime = input.runtime ?? "codex";
|
|
69
|
+
const adapter = getAgentRuntimeAdapter(runtime);
|
|
70
|
+
const spawnInput = adapter.buildSpawn({
|
|
71
|
+
root: currentRoot,
|
|
72
|
+
request: currentRequest,
|
|
73
|
+
runtime,
|
|
74
|
+
model: input.model,
|
|
75
|
+
permissionMode: input.permissionMode ?? "auto_review",
|
|
76
|
+
loopMode: input.loopMode ?? "off",
|
|
77
|
+
extraArgs: input.extraArgs,
|
|
78
|
+
});
|
|
79
|
+
event.sender.send("terminal:data", `\r\n$ ${adapter.buildCommand({ root: currentRoot, request: currentRequest, runtime, model: input.model, permissionMode: input.permissionMode ?? "auto_review", loopMode: input.loopMode ?? "off", extraArgs: input.extraArgs })}\r\n`);
|
|
80
|
+
await startTerminalProcess(event.sender, spawnInput.file, spawnInput.args, currentRoot);
|
|
81
|
+
return { ok: true, message: `${adapter.label} started.` };
|
|
82
|
+
});
|
|
83
|
+
ipcMain.handle("loop:start", (_event, input) => {
|
|
84
|
+
updateCurrent(input);
|
|
85
|
+
startMissionLoop({ root: currentRoot, request: currentRequest, runtime: input.runtime, permissionMode: input.permissionMode });
|
|
86
|
+
return buildDesktopState(input);
|
|
87
|
+
});
|
|
88
|
+
ipcMain.handle("loop:resume", (_event, input) => {
|
|
89
|
+
updateCurrent(input);
|
|
90
|
+
resumeMissionLoop({
|
|
91
|
+
root: currentRoot,
|
|
92
|
+
runtime: input.runtime,
|
|
93
|
+
permissionMode: input.permissionMode,
|
|
94
|
+
approve: input.approve,
|
|
95
|
+
maxIterations: input.maxIterations ?? 1,
|
|
96
|
+
extraArgs: input.extraArgs,
|
|
97
|
+
});
|
|
98
|
+
return buildDesktopState(input);
|
|
99
|
+
});
|
|
100
|
+
ipcMain.handle("loop:stop", () => {
|
|
101
|
+
stopMissionLoop(currentRoot);
|
|
102
|
+
return buildDesktopState();
|
|
103
|
+
});
|
|
104
|
+
ipcMain.handle("mcp:search", (_event, query) => searchMcpServers(query));
|
|
105
|
+
ipcMain.handle("mcp:install", (_event, input) => {
|
|
106
|
+
const result = installMcpServer(currentRoot, input.name, input.runtime ?? "codex");
|
|
107
|
+
return { result, state: buildDesktopState() };
|
|
108
|
+
});
|
|
109
|
+
ipcMain.handle("mcp:list", () => listInstalledMcpServers(currentRoot));
|
|
110
|
+
ipcMain.handle("mcp:doctor", () => doctorMcp(currentRoot));
|
|
111
|
+
ipcMain.handle("skill:create", (_event, input) => {
|
|
112
|
+
const path = createSharedSkill(currentRoot, input.name, input.description);
|
|
113
|
+
return { path, state: buildDesktopState() };
|
|
114
|
+
});
|
|
115
|
+
ipcMain.handle("skill:install", (_event, input) => {
|
|
116
|
+
const path = installSharedSkill(currentRoot, input.name, input.runtime ?? "codex");
|
|
117
|
+
return { path, state: buildDesktopState() };
|
|
118
|
+
});
|
|
119
|
+
ipcMain.handle("skill:doctor", () => doctorSkills(currentRoot));
|
|
120
|
+
function buildDesktopState(input = {}) {
|
|
121
|
+
const generateInput = toGenerateInput(input);
|
|
122
|
+
const analysis = analyze(generateInput);
|
|
123
|
+
const docs = [
|
|
124
|
+
"AGENTS.md",
|
|
125
|
+
".gaslighting/INDEX.md",
|
|
126
|
+
".gaslighting/mission/PROJECT_PURPOSE.md",
|
|
127
|
+
".gaslighting/product/PRD.md",
|
|
128
|
+
".gaslighting/loops/current-session.json",
|
|
129
|
+
".agents/config.json",
|
|
130
|
+
".codex/skills/gaslighting/SKILL.md",
|
|
131
|
+
];
|
|
132
|
+
return {
|
|
133
|
+
version: packageVersion,
|
|
134
|
+
root: currentRoot,
|
|
135
|
+
request: currentRequest,
|
|
136
|
+
analysis,
|
|
137
|
+
purpose: projectPurpose(analysis.projectType),
|
|
138
|
+
pages: pageList(analysis.projectType),
|
|
139
|
+
care: inspectProjectCare(currentRoot),
|
|
140
|
+
runtimes: detectAgentRuntimes(),
|
|
141
|
+
modelsByRuntime: Object.fromEntries(listAgentRuntimeAdapters().map((adapter) => [adapter.id, adapter.listModels()])),
|
|
142
|
+
loop: getMissionLoopStatus(currentRoot),
|
|
143
|
+
mcp: listInstalledMcpServers(currentRoot),
|
|
144
|
+
skills: doctorSkills(currentRoot),
|
|
145
|
+
docsPresent: Object.fromEntries(docs.map((doc) => [doc, existsSync(join(currentRoot, doc))])),
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
function updateCurrent(input) {
|
|
149
|
+
if (input.root)
|
|
150
|
+
currentRoot = resolve(input.root);
|
|
151
|
+
if (input.request)
|
|
152
|
+
currentRequest = input.request;
|
|
153
|
+
}
|
|
154
|
+
function toGenerateInput(input) {
|
|
155
|
+
return {
|
|
156
|
+
rawUserRequest: input.request || currentRequest,
|
|
157
|
+
runtime: input.runtime ?? "codex",
|
|
158
|
+
permissionMode: input.permissionMode ?? "auto_review",
|
|
159
|
+
loopMode: input.loopMode ?? "off",
|
|
160
|
+
mode: "hardcore",
|
|
161
|
+
fullScope: true,
|
|
162
|
+
noTodo: true,
|
|
163
|
+
noShortcut: true,
|
|
164
|
+
force: true,
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
async function startTerminalProcess(sender, file, args, cwd) {
|
|
168
|
+
try {
|
|
169
|
+
const pty = await import("node-pty");
|
|
170
|
+
const command = platform() === "win32" ? "cmd.exe" : file;
|
|
171
|
+
const ptyArgs = platform() === "win32" ? ["/d", "/s", "/c", file, ...args] : args;
|
|
172
|
+
const terminal = pty.spawn(command, ptyArgs, { cwd, cols: 120, rows: 32, name: "xterm-color" });
|
|
173
|
+
terminal.onData((data) => sender.send("terminal:data", data));
|
|
174
|
+
terminal.onExit((event) => sender.send("terminal:data", `\r\n[process exited ${event.exitCode}]\r\n`));
|
|
175
|
+
return;
|
|
176
|
+
}
|
|
177
|
+
catch {
|
|
178
|
+
const child = platform() === "win32"
|
|
179
|
+
? spawn("cmd.exe", ["/d", "/s", "/c", file, ...args], { cwd })
|
|
180
|
+
: spawn(file, args, { cwd });
|
|
181
|
+
child.stdout?.on("data", (chunk) => sender.send("terminal:data", chunk.toString()));
|
|
182
|
+
child.stderr?.on("data", (chunk) => sender.send("terminal:data", chunk.toString()));
|
|
183
|
+
child.on("exit", (code) => sender.send("terminal:data", `\r\n[process exited ${code ?? 0}]\r\n`));
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
export const __filename = fileURLToPath(import.meta.url);
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { contextBridge, ipcRenderer } from "electron";
|
|
2
|
+
contextBridge.exposeInMainWorld("gaslighting", {
|
|
3
|
+
selectProject: () => ipcRenderer.invoke("project:select"),
|
|
4
|
+
getState: () => ipcRenderer.invoke("mission:state"),
|
|
5
|
+
generate: (input) => ipcRenderer.invoke("mission:generate", input),
|
|
6
|
+
startAgent: (input) => ipcRenderer.invoke("agent:start", input),
|
|
7
|
+
loopStart: (input) => ipcRenderer.invoke("loop:start", input),
|
|
8
|
+
loopResume: (input) => ipcRenderer.invoke("loop:resume", input),
|
|
9
|
+
loopStop: () => ipcRenderer.invoke("loop:stop"),
|
|
10
|
+
mcpSearch: (query) => ipcRenderer.invoke("mcp:search", query),
|
|
11
|
+
mcpInstall: (input) => ipcRenderer.invoke("mcp:install", input),
|
|
12
|
+
mcpList: () => ipcRenderer.invoke("mcp:list"),
|
|
13
|
+
mcpDoctor: () => ipcRenderer.invoke("mcp:doctor"),
|
|
14
|
+
skillCreate: (input) => ipcRenderer.invoke("skill:create", input),
|
|
15
|
+
skillInstall: (input) => ipcRenderer.invoke("skill:install", input),
|
|
16
|
+
skillDoctor: () => ipcRenderer.invoke("skill:doctor"),
|
|
17
|
+
onTerminalData: (callback) => {
|
|
18
|
+
const listener = (_event, data) => callback(data);
|
|
19
|
+
ipcRenderer.on("terminal:data", listener);
|
|
20
|
+
return () => ipcRenderer.removeListener("terminal:data", listener);
|
|
21
|
+
},
|
|
22
|
+
});
|
package/dist/utils/logger.js
CHANGED
|
@@ -31,5 +31,5 @@ export function printSummary(analysis, modeLines, results, care) {
|
|
|
31
31
|
console.log(`- WARN ${warning.label}: ${warning.message} Next: ${warning.action}`);
|
|
32
32
|
}
|
|
33
33
|
console.log('\nNext:\nOpen Codex and say:\n');
|
|
34
|
-
console.log('"Read AGENTS.md, .gaslighting/
|
|
34
|
+
console.log('"Read AGENTS.md, .gaslighting/INDEX.md, .gaslighting/mission/PROJECT_PURPOSE.md, .gaslighting/mission/EXECUTION_RULES.md, .gaslighting/product/PRD.md, .gaslighting/features/core-scope/TASKS.md, .gaslighting/operations/PROJECT_CARE.md, and .gaslighting/GASLIGHTING.md. Implement the MVP without shrinking scope, without TODO escape, and without fake completion."');
|
|
35
35
|
}
|
package/dist/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export const packageName = "gaslighting-engine";
|
|
2
|
-
export const packageVersion = "0.
|
|
2
|
+
export const packageVersion = "0.4.0";
|
package/docs/codex-usage.md
CHANGED
|
@@ -48,12 +48,28 @@ This is the recommended update flow. It overwrites the local Codex skill and pro
|
|
|
48
48
|
|
|
49
49
|
## Generate Discipline Docs
|
|
50
50
|
|
|
51
|
-
|
|
51
|
+
Open the desktop Mission Control app:
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
npx gaslighting-engine@latest desktop "I want to build a hospital website."
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
The desktop app lets you generate the structured `.gaslighting/` docs, review project care warnings, choose runtime and permission mode, install MCP/skills, and start the agent from one surface.
|
|
58
|
+
|
|
59
|
+
Generate documents and open the legacy browser cockpit:
|
|
52
60
|
|
|
53
61
|
```bash
|
|
54
62
|
npx gaslighting-engine@latest start "I want to build a hospital website."
|
|
55
63
|
```
|
|
56
64
|
|
|
65
|
+
`Start Codex` continues in the same terminal by default. Use `--new-terminal` only when you intentionally want a separate terminal window.
|
|
66
|
+
|
|
67
|
+
Custom Codex flags:
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
npx gaslighting-engine@latest start "I want to build a hospital website." --codex-args="--search --dangerously-bypass-approvals-and-sandbox"
|
|
71
|
+
```
|
|
72
|
+
|
|
57
73
|
Open the GUI for an existing Gaslighting project:
|
|
58
74
|
|
|
59
75
|
```bash
|
|
@@ -69,10 +85,27 @@ npx gaslighting-engine@latest run "I want to build a hospital website."
|
|
|
69
85
|
Then ask Codex:
|
|
70
86
|
|
|
71
87
|
```txt
|
|
72
|
-
Read AGENTS.md
|
|
88
|
+
Read AGENTS.md and .gaslighting/INDEX.md first. Then read the mission, product, operations, decisions, tasks, memory, and verification files referenced by the index.
|
|
73
89
|
Implement the MVP without shrinking scope, without TODO escape, and without fake completion.
|
|
74
90
|
```
|
|
75
91
|
|
|
76
|
-
Codex should treat root `AGENTS.md` as the project guidance pointer and `.gaslighting/GASLIGHTING.md` as the anti-escape contract.
|
|
92
|
+
Codex should treat root `AGENTS.md` as the project guidance pointer and `.gaslighting/mission/GASLIGHTING.md` as the anti-escape contract.
|
|
77
93
|
|
|
78
94
|
The CLI also generates Codex Skill files, prompt fallback files, `.gaslighting/CODEX_GASLIGHTING.md`, `.gaslighting/AGENT_RUNTIME.md`, and `.gaslighting/PROJECT_CARE.md` so the workflow still works when a specific Codex surface does not expose a custom slash entry.
|
|
95
|
+
|
|
96
|
+
## Runtime, Permissions, And Loop
|
|
97
|
+
|
|
98
|
+
Check runtime availability:
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
npx gaslighting-engine@latest agent list
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
Start a task loop only when you want long-running task-by-task execution:
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
npx gaslighting-engine@latest loop start "Build the hospital homepage"
|
|
108
|
+
npx gaslighting-engine@latest loop resume
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
Default permission mode is `auto_review`: normal work proceeds, but publish, deploy, push, MCP install, secret/env changes, DB migration, and domain/DNS changes require explicit approval.
|
|
@@ -2,16 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
Read the Gaslighting-engine project-control files before doing any work:
|
|
4
4
|
|
|
5
|
-
1. `.gaslighting/
|
|
6
|
-
2. `.gaslighting/
|
|
7
|
-
3. `.gaslighting/
|
|
8
|
-
4. `.gaslighting/
|
|
9
|
-
5. `.gaslighting/
|
|
10
|
-
6. `.gaslighting/
|
|
5
|
+
1. `.gaslighting/INDEX.md`
|
|
6
|
+
2. `.gaslighting/mission/PROJECT_PURPOSE.md`
|
|
7
|
+
3. `.gaslighting/mission/EXECUTION_RULES.md`
|
|
8
|
+
4. `.gaslighting/product/PRD.md`
|
|
9
|
+
5. `.gaslighting/features/core-scope/TASKS.md`
|
|
10
|
+
6. `.gaslighting/operations/PROJECT_CARE.md`
|
|
11
11
|
7. `AGENTS.md`
|
|
12
|
-
8. `.gaslighting/
|
|
13
|
-
9. `.gaslighting/
|
|
14
|
-
10. `.gaslighting/
|
|
12
|
+
8. `.gaslighting/GASLIGHTING.md`
|
|
13
|
+
9. `.gaslighting/MISSING_INFO.md`
|
|
14
|
+
10. `.gaslighting/DECISION_LOG.md`
|
|
15
15
|
|
|
16
16
|
Then execute the user's requested implementation.
|
|
17
17
|
|
|
@@ -4,15 +4,15 @@ This repository uses Gaslighting-engine.
|
|
|
4
4
|
|
|
5
5
|
Before doing any work, read these files in order:
|
|
6
6
|
|
|
7
|
-
1. `.gaslighting/
|
|
8
|
-
2. `.gaslighting/
|
|
9
|
-
3. `.gaslighting/
|
|
10
|
-
4. `.gaslighting/
|
|
11
|
-
5. `.gaslighting/
|
|
12
|
-
6. `.gaslighting/
|
|
13
|
-
7. `.gaslighting/
|
|
14
|
-
8. `.gaslighting/
|
|
15
|
-
9. `.gaslighting/
|
|
7
|
+
1. `.gaslighting/INDEX.md`
|
|
8
|
+
2. `.gaslighting/mission/PROJECT_PURPOSE.md`
|
|
9
|
+
3. `.gaslighting/mission/EXECUTION_RULES.md`
|
|
10
|
+
4. `.gaslighting/mission/COMPLETION_STANDARD.md`
|
|
11
|
+
5. `.gaslighting/product/PRD.md`
|
|
12
|
+
6. `.gaslighting/features/core-scope/TASKS.md`
|
|
13
|
+
7. `.gaslighting/operations/PROJECT_CARE.md`
|
|
14
|
+
8. `.gaslighting/loops/current-session.json`
|
|
15
|
+
9. `.gaslighting/GASLIGHTING.md`
|
|
16
16
|
|
|
17
17
|
## Prime Directive
|
|
18
18
|
|
|
@@ -8,7 +8,7 @@ It is the runtime loop.
|
|
|
8
8
|
|
|
9
9
|
## Mission
|
|
10
10
|
|
|
11
|
-
- Original request: Build an ecommerce MVP
|
|
11
|
+
- Original request: Build an ecommerce MVP.
|
|
12
12
|
- Project type: ecommerce
|
|
13
13
|
- Classification confidence: high
|
|
14
14
|
- Runtime stance: Codex-first, full-scope, no fake completion.
|
|
@@ -6,16 +6,16 @@ Copy and paste this into Codex:
|
|
|
6
6
|
|
|
7
7
|
Read the following files before doing any work:
|
|
8
8
|
|
|
9
|
-
1. `.gaslighting/
|
|
10
|
-
2. `.gaslighting/
|
|
11
|
-
3. `.gaslighting/
|
|
12
|
-
4. `.gaslighting/
|
|
13
|
-
5. `.gaslighting/
|
|
14
|
-
6. `.gaslighting/
|
|
9
|
+
1. `.gaslighting/INDEX.md`
|
|
10
|
+
2. `.gaslighting/mission/PROJECT_PURPOSE.md`
|
|
11
|
+
3. `.gaslighting/mission/EXECUTION_RULES.md`
|
|
12
|
+
4. `.gaslighting/product/PRD.md`
|
|
13
|
+
5. `.gaslighting/features/core-scope/TASKS.md`
|
|
14
|
+
6. `.gaslighting/operations/PROJECT_CARE.md`
|
|
15
15
|
7. `AGENTS.md`
|
|
16
|
-
8. `.gaslighting/
|
|
17
|
-
9. `.gaslighting/
|
|
18
|
-
10. `.gaslighting/
|
|
16
|
+
8. `.gaslighting/GASLIGHTING.md`
|
|
17
|
+
9. `.gaslighting/MISSING_INFO.md`
|
|
18
|
+
10. `.gaslighting/DECISION_LOG.md`
|
|
19
19
|
|
|
20
20
|
Then implement the project MVP.
|
|
21
21
|
|
|
@@ -121,7 +121,7 @@ Project type: `ecommerce`
|
|
|
121
121
|
|
|
122
122
|
Original request:
|
|
123
123
|
|
|
124
|
-
> Build an ecommerce MVP
|
|
124
|
+
> Build an ecommerce MVP.
|
|
125
125
|
|
|
126
126
|
The purpose is:
|
|
127
127
|
|
|
@@ -142,7 +142,7 @@ The purpose is:
|
|
|
142
142
|
|
|
143
143
|
## 3. Confirmed Information
|
|
144
144
|
|
|
145
|
-
- The user requested: Build an ecommerce MVP
|
|
145
|
+
- The user requested: Build an ecommerce MVP.
|
|
146
146
|
- Classified project type: ecommerce
|
|
147
147
|
- Classification confidence: high
|
|
148
148
|
- No stack hints were provided. Use the default practical web stack unless the user later changes it.
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# Gaslighting-engine Index
|
|
2
|
+
|
|
3
|
+
This is the structured source of truth for the project discipline layer.
|
|
4
|
+
|
|
5
|
+
## Mission
|
|
6
|
+
|
|
7
|
+
- Original request: Build an ecommerce MVP.
|
|
8
|
+
- Project type: ecommerce
|
|
9
|
+
- Classification confidence: high
|
|
10
|
+
- Default runtime: codex
|
|
11
|
+
- Loop mode: off
|
|
12
|
+
- Permission mode: auto_review
|
|
13
|
+
|
|
14
|
+
## Read Order For Agents
|
|
15
|
+
|
|
16
|
+
1. `mission/PROJECT_PURPOSE.md`
|
|
17
|
+
2. `mission/EXECUTION_RULES.md`
|
|
18
|
+
3. `mission/COMPLETION_STANDARD.md`
|
|
19
|
+
4. `product/PRD.md`
|
|
20
|
+
5. `product/PAGE_MAP.md`
|
|
21
|
+
6. `features/core-scope/TASKS.md`
|
|
22
|
+
7. `operations/PROJECT_CARE.md`
|
|
23
|
+
8. `loops/current-session.json`
|
|
24
|
+
|
|
25
|
+
## Pages
|
|
26
|
+
|
|
27
|
+
- Home
|
|
28
|
+
- Product List
|
|
29
|
+
- Product Detail
|
|
30
|
+
- Cart
|
|
31
|
+
- Checkout
|
|
32
|
+
- Order Complete
|
|
33
|
+
- My Orders
|
|
34
|
+
- Admin Products
|
|
35
|
+
- Admin Orders
|
|
36
|
+
|
|
37
|
+
## Compatibility Files
|
|
38
|
+
|
|
39
|
+
Older agents may still read the root compatibility markdown files in `.gaslighting/`. Those files remain generated for backward compatibility, but this index is the preferred entrypoint.
|
|
@@ -10,7 +10,7 @@ Keep required rules in root `AGENTS.md`, `.gaslighting/GASLIGHTING.md`, and chec
|
|
|
10
10
|
|
|
11
11
|
## Stable Project Facts
|
|
12
12
|
|
|
13
|
-
- Original request: Build an ecommerce MVP
|
|
13
|
+
- Original request: Build an ecommerce MVP.
|
|
14
14
|
- Project type: ecommerce
|
|
15
15
|
- Classification confidence: high
|
|
16
16
|
- Stack hints: none
|
|
@@ -11,7 +11,7 @@ The agent must treat this project as mission-critical. If something can put deli
|
|
|
11
11
|
## Project Snapshot
|
|
12
12
|
|
|
13
13
|
- Date: 2026-05-23
|
|
14
|
-
- Original request: Build an ecommerce MVP
|
|
14
|
+
- Original request: Build an ecommerce MVP.
|
|
15
15
|
- Project type: ecommerce
|
|
16
16
|
- Classification confidence: high
|
|
17
17
|
- Project purpose:
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# ADR-0001: Stack Policy
|
|
2
|
+
|
|
3
|
+
Date: 2026-05-23
|
|
4
|
+
|
|
5
|
+
## Decision
|
|
6
|
+
|
|
7
|
+
No stack hints were provided. Use the default practical web stack unless the user later changes it.
|
|
8
|
+
|
|
9
|
+
## Consequence
|
|
10
|
+
|
|
11
|
+
The agent must avoid over-engineering and choose technology that serves the project purpose.
|