panopticon-cli 0.4.30 → 0.4.32
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/dist/{agents-ZG4JIPO2.js → agents-BDFHF4T3.js} +4 -3
- package/dist/{chunk-42O6XJWZ.js → chunk-2NIAOCIC.js} +14 -14
- package/dist/{chunk-SIAUVHVO.js → chunk-3XAB4IXF.js} +4 -2
- package/dist/{chunk-SIAUVHVO.js.map → chunk-3XAB4IXF.js.map} +1 -1
- package/dist/chunk-ELK6Q7QI.js +545 -0
- package/dist/chunk-ELK6Q7QI.js.map +1 -0
- package/dist/chunk-LYSBSZYV.js +1523 -0
- package/dist/chunk-LYSBSZYV.js.map +1 -0
- package/dist/{chunk-VTMXR7JF.js → chunk-VU4FLXV5.js} +47 -40
- package/dist/{chunk-VTMXR7JF.js.map → chunk-VU4FLXV5.js.map} +1 -1
- package/dist/{chunk-VH27COUW.js → chunk-XP2DXWYP.js} +49 -10
- package/dist/chunk-XP2DXWYP.js.map +1 -0
- package/dist/cli/index.js +52 -29
- package/dist/cli/index.js.map +1 -1
- package/dist/{config-QWTS63TU.js → config-BOAMSKTF.js} +4 -2
- package/dist/dashboard/public/assets/{index-Dhwz2I7n.js → index-ClYqpcAJ.js} +84 -84
- package/dist/dashboard/public/index.html +1 -1
- package/dist/dashboard/server.js +93512 -23114
- package/dist/index.js +16 -14
- package/dist/index.js.map +1 -1
- package/dist/{remote-workspace-FNXLMNBG.js → remote-workspace-2G6V2KNP.js} +7 -5
- package/dist/{remote-workspace-FNXLMNBG.js.map → remote-workspace-2G6V2KNP.js.map} +1 -1
- package/dist/{specialist-context-QVRSHPYN.js → specialist-context-N32QBNNQ.js} +2 -2
- package/dist/{specialist-logs-7TQMHCUN.js → specialist-logs-GF3YV4KL.js} +2 -2
- package/dist/{specialists-UUXB5KFV.js → specialists-JBIW6MP4.js} +2 -2
- package/dist/{traefik-7OLLXUD7.js → traefik-CUJM6K5Z.js} +3 -3
- package/package.json +3 -2
- package/scripts/record-cost-event.js +243 -79
- package/scripts/record-cost-event.ts +128 -68
- package/dist/chunk-J3J32DIR.js +0 -279
- package/dist/chunk-J3J32DIR.js.map +0 -1
- package/dist/chunk-SUMIHS2B.js +0 -1714
- package/dist/chunk-SUMIHS2B.js.map +0 -1
- package/dist/chunk-VH27COUW.js.map +0 -1
- /package/dist/{agents-ZG4JIPO2.js.map → agents-BDFHF4T3.js.map} +0 -0
- /package/dist/{chunk-42O6XJWZ.js.map → chunk-2NIAOCIC.js.map} +0 -0
- /package/dist/{config-QWTS63TU.js.map → config-BOAMSKTF.js.map} +0 -0
- /package/dist/{specialist-context-QVRSHPYN.js.map → specialist-context-N32QBNNQ.js.map} +0 -0
- /package/dist/{specialist-logs-7TQMHCUN.js.map → specialist-logs-GF3YV4KL.js.map} +0 -0
- /package/dist/{specialists-UUXB5KFV.js.map → specialists-JBIW6MP4.js.map} +0 -0
- /package/dist/{traefik-7OLLXUD7.js.map → traefik-CUJM6K5Z.js.map} +0 -0
|
@@ -17,10 +17,11 @@ import {
|
|
|
17
17
|
saveSessionId,
|
|
18
18
|
spawnAgent,
|
|
19
19
|
stopAgent
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-XP2DXWYP.js";
|
|
21
21
|
import "./chunk-VIWUCJ4V.js";
|
|
22
|
-
import "./chunk-
|
|
22
|
+
import "./chunk-LYSBSZYV.js";
|
|
23
23
|
import "./chunk-BBCUK6N2.js";
|
|
24
|
+
import "./chunk-VU4FLXV5.js";
|
|
24
25
|
import "./chunk-6HXKTOD7.js";
|
|
25
26
|
import "./chunk-ZHC57RCV.js";
|
|
26
27
|
init_agents();
|
|
@@ -43,4 +44,4 @@ export {
|
|
|
43
44
|
spawnAgent,
|
|
44
45
|
stopAgent
|
|
45
46
|
};
|
|
46
|
-
//# sourceMappingURL=agents-
|
|
47
|
+
//# sourceMappingURL=agents-BDFHF4T3.js.map
|
|
@@ -553,9 +553,9 @@ function recordWake(name, sessionId) {
|
|
|
553
553
|
}
|
|
554
554
|
async function spawnEphemeralSpecialist(projectKey, specialistType, task) {
|
|
555
555
|
ensureProjectSpecialistDir(projectKey, specialistType);
|
|
556
|
-
const { loadContextDigest } = await import("./specialist-context-
|
|
556
|
+
const { loadContextDigest } = await import("./specialist-context-N32QBNNQ.js");
|
|
557
557
|
const contextDigest = loadContextDigest(projectKey, specialistType);
|
|
558
|
-
const { createRunLog: createRunLog2 } = await import("./specialist-logs-
|
|
558
|
+
const { createRunLog: createRunLog2 } = await import("./specialist-logs-GF3YV4KL.js");
|
|
559
559
|
const { runId, filePath: logFilePath } = createRunLog2(
|
|
560
560
|
projectKey,
|
|
561
561
|
specialistType,
|
|
@@ -596,7 +596,7 @@ echo "## Specialist completed task"
|
|
|
596
596
|
`tmux new-session -d -s "${tmuxSession}" "bash '${launcherScript}'"`,
|
|
597
597
|
{ encoding: "utf-8" }
|
|
598
598
|
);
|
|
599
|
-
const { saveAgentRuntimeState } = await import("./agents-
|
|
599
|
+
const { saveAgentRuntimeState } = await import("./agents-BDFHF4T3.js");
|
|
600
600
|
saveAgentRuntimeState(tmuxSession, {
|
|
601
601
|
state: "active",
|
|
602
602
|
lastActivity: (/* @__PURE__ */ new Date()).toISOString(),
|
|
@@ -781,7 +781,7 @@ async function terminateSpecialist(projectKey, specialistType) {
|
|
|
781
781
|
console.error(`[specialist] Failed to kill tmux session ${tmuxSession}:`, error);
|
|
782
782
|
}
|
|
783
783
|
if (metadata.currentRun) {
|
|
784
|
-
const { finalizeRunLog: finalizeRunLog2 } = await import("./specialist-logs-
|
|
784
|
+
const { finalizeRunLog: finalizeRunLog2 } = await import("./specialist-logs-GF3YV4KL.js");
|
|
785
785
|
try {
|
|
786
786
|
finalizeRunLog2(projectKey, specialistType, metadata.currentRun, {
|
|
787
787
|
status: metadata.lastRunStatus || "incomplete",
|
|
@@ -794,19 +794,19 @@ async function terminateSpecialist(projectKey, specialistType) {
|
|
|
794
794
|
}
|
|
795
795
|
const key = `${projectKey}-${specialistType}`;
|
|
796
796
|
gracePeriodStates.delete(key);
|
|
797
|
-
const { saveAgentRuntimeState } = await import("./agents-
|
|
797
|
+
const { saveAgentRuntimeState } = await import("./agents-BDFHF4T3.js");
|
|
798
798
|
saveAgentRuntimeState(tmuxSession, {
|
|
799
799
|
state: "suspended",
|
|
800
800
|
lastActivity: (/* @__PURE__ */ new Date()).toISOString()
|
|
801
801
|
});
|
|
802
|
-
const { scheduleDigestGeneration } = await import("./specialist-context-
|
|
802
|
+
const { scheduleDigestGeneration } = await import("./specialist-context-N32QBNNQ.js");
|
|
803
803
|
scheduleDigestGeneration(projectKey, specialistType);
|
|
804
804
|
scheduleLogCleanup(projectKey, specialistType);
|
|
805
805
|
}
|
|
806
806
|
function scheduleLogCleanup(projectKey, specialistType) {
|
|
807
807
|
Promise.resolve().then(async () => {
|
|
808
808
|
try {
|
|
809
|
-
const { cleanupOldLogs: cleanupOldLogs2 } = await import("./specialist-logs-
|
|
809
|
+
const { cleanupOldLogs: cleanupOldLogs2 } = await import("./specialist-logs-GF3YV4KL.js");
|
|
810
810
|
const { getSpecialistRetention } = await import("./projects-VXRUCMLM.js");
|
|
811
811
|
const retention = getSpecialistRetention(projectKey);
|
|
812
812
|
const deleted = cleanupOldLogs2(projectKey, specialistType, { maxDays: retention.max_days, maxRuns: retention.max_runs });
|
|
@@ -985,7 +985,7 @@ async function getSpecialistStatus(name, projectKey) {
|
|
|
985
985
|
const sessionId = getSessionId(name);
|
|
986
986
|
const running = await isRunning(name, projectKey);
|
|
987
987
|
const contextTokens = countContextTokens(name);
|
|
988
|
-
const { getAgentRuntimeState } = await import("./agents-
|
|
988
|
+
const { getAgentRuntimeState } = await import("./agents-BDFHF4T3.js");
|
|
989
989
|
const tmuxSession = getTmuxSessionName(name, projectKey);
|
|
990
990
|
const runtimeState = getAgentRuntimeState(tmuxSession);
|
|
991
991
|
let state;
|
|
@@ -1177,7 +1177,7 @@ async function wakeSpecialist(name, taskPrompt, options = {}) {
|
|
|
1177
1177
|
await sendKeysAsync(tmuxSession, taskPrompt);
|
|
1178
1178
|
}
|
|
1179
1179
|
recordWake(name, sessionId || void 0);
|
|
1180
|
-
const { saveAgentRuntimeState } = await import("./agents-
|
|
1180
|
+
const { saveAgentRuntimeState } = await import("./agents-BDFHF4T3.js");
|
|
1181
1181
|
saveAgentRuntimeState(tmuxSession, {
|
|
1182
1182
|
state: "active",
|
|
1183
1183
|
lastActivity: (/* @__PURE__ */ new Date()).toISOString(),
|
|
@@ -1247,7 +1247,7 @@ Use the send-feedback-to-agent skill to report findings back to the issue agent.
|
|
|
1247
1247
|
});
|
|
1248
1248
|
console.log(`[specialist] review-agent: auto-passed ${task.issueId} (stale branch)`);
|
|
1249
1249
|
const tmuxSession = getTmuxSessionName("review-agent");
|
|
1250
|
-
const { saveAgentRuntimeState } = await import("./agents-
|
|
1250
|
+
const { saveAgentRuntimeState } = await import("./agents-BDFHF4T3.js");
|
|
1251
1251
|
saveAgentRuntimeState(tmuxSession, {
|
|
1252
1252
|
state: "idle",
|
|
1253
1253
|
lastActivity: (/* @__PURE__ */ new Date()).toISOString()
|
|
@@ -1414,7 +1414,7 @@ IMPORTANT: Do NOT hand off to merge-agent. Human clicks Merge button when ready.
|
|
|
1414
1414
|
async function wakeSpecialistOrQueue(name, task, options = {}) {
|
|
1415
1415
|
const { priority = "normal", source = "handoff" } = options;
|
|
1416
1416
|
const running = await isRunning(name);
|
|
1417
|
-
const { getAgentRuntimeState } = await import("./agents-
|
|
1417
|
+
const { getAgentRuntimeState } = await import("./agents-BDFHF4T3.js");
|
|
1418
1418
|
const tmuxSession = getTmuxSessionName(name);
|
|
1419
1419
|
const runtimeState = getAgentRuntimeState(tmuxSession);
|
|
1420
1420
|
const idle = runtimeState?.state === "idle" || runtimeState?.state === "suspended";
|
|
@@ -1445,7 +1445,7 @@ async function wakeSpecialistOrQueue(name, task, options = {}) {
|
|
|
1445
1445
|
};
|
|
1446
1446
|
}
|
|
1447
1447
|
}
|
|
1448
|
-
const { saveAgentRuntimeState } = await import("./agents-
|
|
1448
|
+
const { saveAgentRuntimeState } = await import("./agents-BDFHF4T3.js");
|
|
1449
1449
|
saveAgentRuntimeState(tmuxSession, {
|
|
1450
1450
|
state: "active",
|
|
1451
1451
|
lastActivity: (/* @__PURE__ */ new Date()).toISOString(),
|
|
@@ -1564,7 +1564,7 @@ async function sendFeedbackToAgent(feedback) {
|
|
|
1564
1564
|
return false;
|
|
1565
1565
|
}
|
|
1566
1566
|
try {
|
|
1567
|
-
const { messageAgent } = await import("./agents-
|
|
1567
|
+
const { messageAgent } = await import("./agents-BDFHF4T3.js");
|
|
1568
1568
|
const msg = `SPECIALIST FEEDBACK: ${fromSpecialist} reported ${feedback.feedbackType.toUpperCase()} for ${toIssueId}.
|
|
1569
1569
|
Read and address: ${fileResult.relativePath}`;
|
|
1570
1570
|
await messageAgent(agentSession, msg);
|
|
@@ -2055,4 +2055,4 @@ export {
|
|
|
2055
2055
|
getFeedbackStats,
|
|
2056
2056
|
init_specialists
|
|
2057
2057
|
};
|
|
2058
|
-
//# sourceMappingURL=chunk-
|
|
2058
|
+
//# sourceMappingURL=chunk-2NIAOCIC.js.map
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
|
+
init_config,
|
|
2
3
|
loadConfig
|
|
3
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-VU4FLXV5.js";
|
|
4
5
|
import {
|
|
5
6
|
SOURCE_TRAEFIK_TEMPLATES,
|
|
6
7
|
TRAEFIK_DYNAMIC_DIR,
|
|
@@ -13,6 +14,7 @@ import {
|
|
|
13
14
|
// src/lib/traefik.ts
|
|
14
15
|
init_esm_shims();
|
|
15
16
|
init_paths();
|
|
17
|
+
init_config();
|
|
16
18
|
import { existsSync, readFileSync, writeFileSync, mkdirSync, unlinkSync } from "fs";
|
|
17
19
|
import { join } from "path";
|
|
18
20
|
function generatePanopticonTraefikConfig() {
|
|
@@ -46,4 +48,4 @@ export {
|
|
|
46
48
|
generatePanopticonTraefikConfig,
|
|
47
49
|
cleanupTemplateFiles
|
|
48
50
|
};
|
|
49
|
-
//# sourceMappingURL=chunk-
|
|
51
|
+
//# sourceMappingURL=chunk-3XAB4IXF.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/lib/traefik.ts"],"sourcesContent":["/**\n * Traefik Configuration Generator\n *\n * Generates the Panopticon dashboard Traefik routing config\n * from a template, substituting values from config.toml.\n */\n\nimport { existsSync, readFileSync, writeFileSync, mkdirSync, unlinkSync } from 'fs';\nimport { join } from 'path';\nimport { TRAEFIK_DYNAMIC_DIR, SOURCE_TRAEFIK_TEMPLATES } from './paths.js';\nimport { loadConfig } from './config.js';\n\n/**\n * Generate panopticon.yml from template using current config values.\n * Safe to call multiple times (idempotent).\n * Returns true if file was written, false if template not found.\n */\nexport function generatePanopticonTraefikConfig(): boolean {\n const templatePath = join(SOURCE_TRAEFIK_TEMPLATES, 'dynamic', 'panopticon.yml.template');\n if (!existsSync(templatePath)) {\n return false;\n }\n\n const config = loadConfig();\n const placeholders: Record<string, string> = {\n TRAEFIK_DOMAIN: config.traefik?.domain || 'pan.localhost',\n DASHBOARD_PORT: String(config.dashboard.port),\n DASHBOARD_API_PORT: String(config.dashboard.api_port),\n };\n\n let content = readFileSync(templatePath, 'utf-8');\n for (const [key, value] of Object.entries(placeholders)) {\n content = content.replace(new RegExp(`\\\\{\\\\{${key}\\\\}\\\\}`, 'g'), value);\n }\n\n mkdirSync(TRAEFIK_DYNAMIC_DIR, { recursive: true });\n const outputPath = join(TRAEFIK_DYNAMIC_DIR, 'panopticon.yml');\n writeFileSync(outputPath, content, 'utf-8');\n return true;\n}\n\n/**\n * Remove any accidentally-copied .template files from the runtime Traefik dir.\n * Called after copyDirectoryRecursive in pan install.\n */\nexport function cleanupTemplateFiles(): void {\n const copiedTemplate = join(TRAEFIK_DYNAMIC_DIR, 'panopticon.yml.template');\n if (existsSync(copiedTemplate)) {\n unlinkSync(copiedTemplate);\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/lib/traefik.ts"],"sourcesContent":["/**\n * Traefik Configuration Generator\n *\n * Generates the Panopticon dashboard Traefik routing config\n * from a template, substituting values from config.toml.\n */\n\nimport { existsSync, readFileSync, writeFileSync, mkdirSync, unlinkSync } from 'fs';\nimport { join } from 'path';\nimport { TRAEFIK_DYNAMIC_DIR, SOURCE_TRAEFIK_TEMPLATES } from './paths.js';\nimport { loadConfig } from './config.js';\n\n/**\n * Generate panopticon.yml from template using current config values.\n * Safe to call multiple times (idempotent).\n * Returns true if file was written, false if template not found.\n */\nexport function generatePanopticonTraefikConfig(): boolean {\n const templatePath = join(SOURCE_TRAEFIK_TEMPLATES, 'dynamic', 'panopticon.yml.template');\n if (!existsSync(templatePath)) {\n return false;\n }\n\n const config = loadConfig();\n const placeholders: Record<string, string> = {\n TRAEFIK_DOMAIN: config.traefik?.domain || 'pan.localhost',\n DASHBOARD_PORT: String(config.dashboard.port),\n DASHBOARD_API_PORT: String(config.dashboard.api_port),\n };\n\n let content = readFileSync(templatePath, 'utf-8');\n for (const [key, value] of Object.entries(placeholders)) {\n content = content.replace(new RegExp(`\\\\{\\\\{${key}\\\\}\\\\}`, 'g'), value);\n }\n\n mkdirSync(TRAEFIK_DYNAMIC_DIR, { recursive: true });\n const outputPath = join(TRAEFIK_DYNAMIC_DIR, 'panopticon.yml');\n writeFileSync(outputPath, content, 'utf-8');\n return true;\n}\n\n/**\n * Remove any accidentally-copied .template files from the runtime Traefik dir.\n * Called after copyDirectoryRecursive in pan install.\n */\nexport function cleanupTemplateFiles(): void {\n const copiedTemplate = join(TRAEFIK_DYNAMIC_DIR, 'panopticon.yml.template');\n if (existsSync(copiedTemplate)) {\n unlinkSync(copiedTemplate);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;AAAA;AASA;AACA;AAHA,SAAS,YAAY,cAAc,eAAe,WAAW,kBAAkB;AAC/E,SAAS,YAAY;AASd,SAAS,kCAA2C;AACzD,QAAM,eAAe,KAAK,0BAA0B,WAAW,yBAAyB;AACxF,MAAI,CAAC,WAAW,YAAY,GAAG;AAC7B,WAAO;AAAA,EACT;AAEA,QAAM,SAAS,WAAW;AAC1B,QAAM,eAAuC;AAAA,IAC3C,gBAAgB,OAAO,SAAS,UAAU;AAAA,IAC1C,gBAAgB,OAAO,OAAO,UAAU,IAAI;AAAA,IAC5C,oBAAoB,OAAO,OAAO,UAAU,QAAQ;AAAA,EACtD;AAEA,MAAI,UAAU,aAAa,cAAc,OAAO;AAChD,aAAW,CAAC,KAAK,KAAK,KAAK,OAAO,QAAQ,YAAY,GAAG;AACvD,cAAU,QAAQ,QAAQ,IAAI,OAAO,SAAS,GAAG,UAAU,GAAG,GAAG,KAAK;AAAA,EACxE;AAEA,YAAU,qBAAqB,EAAE,WAAW,KAAK,CAAC;AAClD,QAAM,aAAa,KAAK,qBAAqB,gBAAgB;AAC7D,gBAAc,YAAY,SAAS,OAAO;AAC1C,SAAO;AACT;AAMO,SAAS,uBAA6B;AAC3C,QAAM,iBAAiB,KAAK,qBAAqB,yBAAyB;AAC1E,MAAI,WAAW,cAAc,GAAG;AAC9B,eAAW,cAAc;AAAA,EAC3B;AACF;","names":[]}
|