@probelabs/visor 0.1.141-ee → 0.1.142-ee
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/ai-review-service.d.ts.map +1 -1
- package/dist/index.js +20 -5
- package/dist/providers/api-tool-executor.d.ts.map +1 -1
- package/dist/sdk/{check-provider-registry-4XMVWKTZ.mjs → check-provider-registry-MDJ7OQRY.mjs} +4 -3
- package/dist/sdk/{check-provider-registry-C5UOX4YX.mjs → check-provider-registry-SNVE22YQ.mjs} +4 -3
- package/dist/sdk/{chunk-YVSU5WUL.mjs → chunk-CNNQTDJZ.mjs} +26 -8
- package/dist/sdk/chunk-CNNQTDJZ.mjs.map +1 -0
- package/dist/sdk/{chunk-IU2I3ING.mjs → chunk-KUSF5IBV.mjs} +26 -8
- package/dist/sdk/chunk-KUSF5IBV.mjs.map +1 -0
- package/dist/sdk/chunk-M3BYMES6.mjs +228 -0
- package/dist/sdk/chunk-M3BYMES6.mjs.map +1 -0
- package/dist/sdk/{host-RF2UEKMG.mjs → host-7KYBK53Q.mjs} +2 -2
- package/dist/sdk/{host-YDQC5HZQ.mjs → host-WEUEA7OZ.mjs} +2 -2
- package/dist/sdk/{schedule-tool-handler-7FICUAKF.mjs → schedule-tool-handler-UCCJYJXR.mjs} +3 -2
- package/dist/sdk/{schedule-tool-handler-TKSRMVOI.mjs → schedule-tool-handler-XHNZW6UW.mjs} +3 -2
- package/dist/sdk/sdk.js +451 -438
- package/dist/sdk/sdk.js.map +1 -1
- package/dist/sdk/sdk.mjs +2 -1
- package/dist/sdk/sdk.mjs.map +1 -1
- package/dist/sdk/{slack-frontend-JS2VAZWB.mjs → slack-frontend-TZU2HIK7.mjs} +10 -215
- package/dist/sdk/slack-frontend-TZU2HIK7.mjs.map +1 -0
- package/dist/sdk/{workflow-check-provider-PWCAGFNW.mjs → workflow-check-provider-HDX3ZABR.mjs} +3 -2
- package/dist/sdk/{workflow-check-provider-ZDO5KBUG.mjs → workflow-check-provider-INZUO2WJ.mjs} +3 -2
- package/dist/state-machine/dispatch/execution-invoker.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/sdk/chunk-IU2I3ING.mjs.map +0 -1
- package/dist/sdk/chunk-YVSU5WUL.mjs.map +0 -1
- package/dist/sdk/slack-frontend-JS2VAZWB.mjs.map +0 -1
- /package/dist/sdk/{check-provider-registry-4XMVWKTZ.mjs.map → check-provider-registry-MDJ7OQRY.mjs.map} +0 -0
- /package/dist/sdk/{check-provider-registry-C5UOX4YX.mjs.map → check-provider-registry-SNVE22YQ.mjs.map} +0 -0
- /package/dist/sdk/{host-RF2UEKMG.mjs.map → host-7KYBK53Q.mjs.map} +0 -0
- /package/dist/sdk/{host-YDQC5HZQ.mjs.map → host-WEUEA7OZ.mjs.map} +0 -0
- /package/dist/sdk/{schedule-tool-handler-7FICUAKF.mjs.map → schedule-tool-handler-UCCJYJXR.mjs.map} +0 -0
- /package/dist/sdk/{schedule-tool-handler-TKSRMVOI.mjs.map → schedule-tool-handler-XHNZW6UW.mjs.map} +0 -0
- /package/dist/sdk/{workflow-check-provider-PWCAGFNW.mjs.map → workflow-check-provider-HDX3ZABR.mjs.map} +0 -0
- /package/dist/sdk/{workflow-check-provider-ZDO5KBUG.mjs.map → workflow-check-provider-INZUO2WJ.mjs.map} +0 -0
package/dist/sdk/sdk.mjs
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
StateMachineExecutionEngine,
|
|
3
3
|
init_state_machine_execution_engine
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-CNNQTDJZ.mjs";
|
|
5
5
|
import "./chunk-KFKHU6CM.mjs";
|
|
6
|
+
import "./chunk-M3BYMES6.mjs";
|
|
6
7
|
import "./chunk-LG4AUKHB.mjs";
|
|
7
8
|
import "./chunk-B7BVQM5K.mjs";
|
|
8
9
|
import "./chunk-XXAEN5KU.mjs";
|
package/dist/sdk/sdk.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/sdk.ts"],"sourcesContent":["/*\n Thin SDK façade for programmatic use of Visor.\n - No new execution logic; delegates to existing engine and config manager.\n - Dual ESM/CJS bundle via tsup.\n*/\n\nimport { StateMachineExecutionEngine } from './state-machine-execution-engine';\nimport { ConfigManager } from './config';\nimport type { AnalysisResult } from './output-formatters';\nimport type { VisorConfig, TagFilter, HumanInputRequest } from './types/config';\nimport type { ExecutionContext } from './providers/check-provider.interface';\n\nexport type { VisorConfig, TagFilter, HumanInputRequest, ExecutionContext };\n\nexport interface VisorOptions {\n cwd?: string;\n debug?: boolean;\n maxParallelism?: number;\n failFast?: boolean;\n tagFilter?: TagFilter;\n}\n\nexport interface RunOptions extends VisorOptions {\n config?: VisorConfig;\n configPath?: string;\n checks?: string[]; // default: all checks from config\n timeoutMs?: number;\n output?: { format?: 'table' | 'json' | 'markdown' | 'sarif' };\n /** Strict mode: treat config warnings (like unknown keys) as errors (default: false) */\n strictValidation?: boolean;\n /** Execution context for providers (CLI message, hooks, etc.) */\n executionContext?: ExecutionContext;\n}\n\n/**\n * Load and validate a Visor config.\n * @param configOrPath - Config object, file path, or omit to discover defaults\n * @param options - Validation options\n * @returns Validated config with defaults applied\n */\nexport async function loadConfig(\n configOrPath?: string | Partial<VisorConfig>,\n options?: { strict?: boolean }\n): Promise<VisorConfig> {\n const cm = new ConfigManager();\n\n // If it's an object, validate and return with defaults\n if (typeof configOrPath === 'object' && configOrPath !== null) {\n cm.validateConfig(configOrPath, options?.strict ?? false);\n\n // Apply lightweight defaults without expensive file system operations\n const defaultConfig: Partial<VisorConfig> = {\n version: '1.0',\n checks: {},\n max_parallelism: 3,\n fail_fast: false,\n };\n\n return {\n ...defaultConfig,\n ...configOrPath,\n checks: configOrPath.checks || {},\n } as VisorConfig;\n }\n\n // If it's a string, load from file\n if (typeof configOrPath === 'string') {\n return cm.loadConfig(configOrPath);\n }\n\n // Otherwise discover default config file\n return cm.findAndLoadConfig();\n}\n\n/** Expand check IDs by including their dependencies (shallow->deep). */\nexport function resolveChecks(checkIds: string[], config: VisorConfig | undefined): string[] {\n if (!config?.checks) return Array.from(new Set(checkIds));\n const resolved = new Set<string>();\n const visiting = new Set<string>();\n const result: string[] = [];\n\n const dfs = (id: string, stack: string[] = []) => {\n if (resolved.has(id)) return;\n if (visiting.has(id)) {\n const cycle = [...stack, id].join(' -> ');\n throw new Error(`Circular dependency detected involving check: ${id} (path: ${cycle})`);\n }\n visiting.add(id);\n const deps = config.checks![id]?.depends_on || [];\n for (const d of deps) dfs(d, [...stack, id]);\n if (!result.includes(id)) result.push(id);\n visiting.delete(id);\n resolved.add(id);\n };\n\n for (const id of checkIds) dfs(id);\n return result;\n}\n\n/**\n * Run Visor checks programmatically. Returns the same AnalysisResult shape used by the CLI.\n * Thin wrapper around CheckExecutionEngine.executeChecks.\n */\nexport async function runChecks(opts: RunOptions = {}): Promise<AnalysisResult> {\n const cm = new ConfigManager();\n let config: VisorConfig;\n\n if (opts.config) {\n // Validate manually constructed config\n // In strict mode, unknown keys are treated as errors\n cm.validateConfig(opts.config, opts.strictValidation ?? false);\n config = opts.config;\n } else if (opts.configPath) {\n config = await cm.loadConfig(opts.configPath);\n } else {\n config = await cm.findAndLoadConfig();\n }\n\n const checks =\n opts.checks && opts.checks.length > 0\n ? resolveChecks(opts.checks, config)\n : Object.keys(config.checks || {});\n\n // Always use StateMachineExecutionEngine\n const engine = new StateMachineExecutionEngine(opts.cwd);\n\n // Set execution context if provided\n if (opts.executionContext) {\n engine.setExecutionContext(opts.executionContext);\n }\n\n const result = await engine.executeChecks({\n checks,\n workingDirectory: opts.cwd,\n timeout: opts.timeoutMs,\n maxParallelism: opts.maxParallelism,\n failFast: opts.failFast,\n outputFormat: opts.output?.format,\n config,\n debug: opts.debug,\n tagFilter: opts.tagFilter,\n });\n\n return result;\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/sdk.ts"],"sourcesContent":["/*\n Thin SDK façade for programmatic use of Visor.\n - No new execution logic; delegates to existing engine and config manager.\n - Dual ESM/CJS bundle via tsup.\n*/\n\nimport { StateMachineExecutionEngine } from './state-machine-execution-engine';\nimport { ConfigManager } from './config';\nimport type { AnalysisResult } from './output-formatters';\nimport type { VisorConfig, TagFilter, HumanInputRequest } from './types/config';\nimport type { ExecutionContext } from './providers/check-provider.interface';\n\nexport type { VisorConfig, TagFilter, HumanInputRequest, ExecutionContext };\n\nexport interface VisorOptions {\n cwd?: string;\n debug?: boolean;\n maxParallelism?: number;\n failFast?: boolean;\n tagFilter?: TagFilter;\n}\n\nexport interface RunOptions extends VisorOptions {\n config?: VisorConfig;\n configPath?: string;\n checks?: string[]; // default: all checks from config\n timeoutMs?: number;\n output?: { format?: 'table' | 'json' | 'markdown' | 'sarif' };\n /** Strict mode: treat config warnings (like unknown keys) as errors (default: false) */\n strictValidation?: boolean;\n /** Execution context for providers (CLI message, hooks, etc.) */\n executionContext?: ExecutionContext;\n}\n\n/**\n * Load and validate a Visor config.\n * @param configOrPath - Config object, file path, or omit to discover defaults\n * @param options - Validation options\n * @returns Validated config with defaults applied\n */\nexport async function loadConfig(\n configOrPath?: string | Partial<VisorConfig>,\n options?: { strict?: boolean }\n): Promise<VisorConfig> {\n const cm = new ConfigManager();\n\n // If it's an object, validate and return with defaults\n if (typeof configOrPath === 'object' && configOrPath !== null) {\n cm.validateConfig(configOrPath, options?.strict ?? false);\n\n // Apply lightweight defaults without expensive file system operations\n const defaultConfig: Partial<VisorConfig> = {\n version: '1.0',\n checks: {},\n max_parallelism: 3,\n fail_fast: false,\n };\n\n return {\n ...defaultConfig,\n ...configOrPath,\n checks: configOrPath.checks || {},\n } as VisorConfig;\n }\n\n // If it's a string, load from file\n if (typeof configOrPath === 'string') {\n return cm.loadConfig(configOrPath);\n }\n\n // Otherwise discover default config file\n return cm.findAndLoadConfig();\n}\n\n/** Expand check IDs by including their dependencies (shallow->deep). */\nexport function resolveChecks(checkIds: string[], config: VisorConfig | undefined): string[] {\n if (!config?.checks) return Array.from(new Set(checkIds));\n const resolved = new Set<string>();\n const visiting = new Set<string>();\n const result: string[] = [];\n\n const dfs = (id: string, stack: string[] = []) => {\n if (resolved.has(id)) return;\n if (visiting.has(id)) {\n const cycle = [...stack, id].join(' -> ');\n throw new Error(`Circular dependency detected involving check: ${id} (path: ${cycle})`);\n }\n visiting.add(id);\n const deps = config.checks![id]?.depends_on || [];\n for (const d of deps) dfs(d, [...stack, id]);\n if (!result.includes(id)) result.push(id);\n visiting.delete(id);\n resolved.add(id);\n };\n\n for (const id of checkIds) dfs(id);\n return result;\n}\n\n/**\n * Run Visor checks programmatically. Returns the same AnalysisResult shape used by the CLI.\n * Thin wrapper around CheckExecutionEngine.executeChecks.\n */\nexport async function runChecks(opts: RunOptions = {}): Promise<AnalysisResult> {\n const cm = new ConfigManager();\n let config: VisorConfig;\n\n if (opts.config) {\n // Validate manually constructed config\n // In strict mode, unknown keys are treated as errors\n cm.validateConfig(opts.config, opts.strictValidation ?? false);\n config = opts.config;\n } else if (opts.configPath) {\n config = await cm.loadConfig(opts.configPath);\n } else {\n config = await cm.findAndLoadConfig();\n }\n\n const checks =\n opts.checks && opts.checks.length > 0\n ? resolveChecks(opts.checks, config)\n : Object.keys(config.checks || {});\n\n // Always use StateMachineExecutionEngine\n const engine = new StateMachineExecutionEngine(opts.cwd);\n\n // Set execution context if provided\n if (opts.executionContext) {\n engine.setExecutionContext(opts.executionContext);\n }\n\n const result = await engine.executeChecks({\n checks,\n workingDirectory: opts.cwd,\n timeout: opts.timeoutMs,\n maxParallelism: opts.maxParallelism,\n failFast: opts.failFast,\n outputFormat: opts.output?.format,\n config,\n debug: opts.debug,\n tagFilter: opts.tagFilter,\n });\n\n return result;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA;AACA;AAiCA,eAAsB,WACpB,cACA,SACsB;AACtB,QAAM,KAAK,IAAI,cAAc;AAG7B,MAAI,OAAO,iBAAiB,YAAY,iBAAiB,M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,MAAI,KAAK,QAAQ;AAGf,OAAG,eAAe,KAAK,QAAQ,KAAK,oBAAoB,KAAK;AAC7D,aAAS,KAAK;AAAA,EAChB,WAAW,KAAK,YAAY;AAC1B,aAAS,MAAM,GAAG,WAAW,KAAK,UAAU;AAAA,EAC9C,OAAO;AACL,aAAS,MAAM,GAAG,kBAAkB;AAAA,EACtC;AAEA,QAAM,SACJ,KAAK,UAAU,KAAK,OAAO,SAAS,IAChC,cAAc,KAAK,QAAQ,MAAM,IACjC,OAAO,KAAK,OAAO,UAAU,CAAC,CAAC;AAGrC,QAAM,SAAS,IAAI,4BAA4B,KAAK,GAAG;AAGvD,MAAI,KAAK,kBAAkB;AACzB,WAAO,oBAAoB,KAAK,gBAAgB;AAAA,EAClD;AAEA,QAAM,SAAS,MAAM,OAAO,cAAc;AAAA,IACxC;AAAA,IACA,kBAAkB,KAAK;AAAA,IACvB,SAAS,KAAK;AAAA,IACd,gBAAgB,KAAK;AAAA,IACrB,UAAU,KAAK;AAAA,IACf,cAAc,KAAK,QAAQ;AAAA,IAC3B;AAAA,IACA,OAAO,KAAK;AAAA,IACZ,WAAW,KAAK;AAAA,EAClB,CAAC;AAED,SAAO;AACT;","names":[]}
|
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
import {
|
|
2
|
+
extractFileSections,
|
|
3
|
+
extractMermaidDiagrams,
|
|
4
|
+
formatSlackText,
|
|
5
|
+
init_markdown,
|
|
6
|
+
renderMermaidToPng,
|
|
7
|
+
replaceFileSections,
|
|
8
|
+
replaceMermaidBlocks
|
|
9
|
+
} from "./chunk-M3BYMES6.mjs";
|
|
1
10
|
import {
|
|
2
11
|
context,
|
|
3
12
|
init_lazy_otel,
|
|
@@ -300,220 +309,6 @@ var init_client = __esm({
|
|
|
300
309
|
}
|
|
301
310
|
});
|
|
302
311
|
|
|
303
|
-
// src/slack/markdown.ts
|
|
304
|
-
import { spawn } from "child_process";
|
|
305
|
-
import * as fs from "fs";
|
|
306
|
-
import * as path from "path";
|
|
307
|
-
import * as os from "os";
|
|
308
|
-
function extractMermaidDiagrams(text) {
|
|
309
|
-
const diagrams = [];
|
|
310
|
-
const regex = /```mermaid\s*\n([\s\S]*?)```/g;
|
|
311
|
-
let match;
|
|
312
|
-
while ((match = regex.exec(text)) !== null) {
|
|
313
|
-
diagrams.push({
|
|
314
|
-
fullMatch: match[0],
|
|
315
|
-
code: match[1].trim(),
|
|
316
|
-
startIndex: match.index,
|
|
317
|
-
endIndex: match.index + match[0].length
|
|
318
|
-
});
|
|
319
|
-
}
|
|
320
|
-
return diagrams;
|
|
321
|
-
}
|
|
322
|
-
async function renderMermaidToPng(mermaidCode) {
|
|
323
|
-
const tmpDir = os.tmpdir();
|
|
324
|
-
const inputFile = path.join(
|
|
325
|
-
tmpDir,
|
|
326
|
-
`mermaid-${Date.now()}-${Math.random().toString(36).slice(2)}.mmd`
|
|
327
|
-
);
|
|
328
|
-
const outputFile = path.join(
|
|
329
|
-
tmpDir,
|
|
330
|
-
`mermaid-${Date.now()}-${Math.random().toString(36).slice(2)}.png`
|
|
331
|
-
);
|
|
332
|
-
try {
|
|
333
|
-
fs.writeFileSync(inputFile, mermaidCode, "utf-8");
|
|
334
|
-
const chromiumPaths = [
|
|
335
|
-
"/usr/bin/chromium",
|
|
336
|
-
"/usr/bin/chromium-browser",
|
|
337
|
-
"/usr/bin/google-chrome",
|
|
338
|
-
"/usr/bin/chrome"
|
|
339
|
-
];
|
|
340
|
-
let chromiumPath;
|
|
341
|
-
for (const p of chromiumPaths) {
|
|
342
|
-
if (fs.existsSync(p)) {
|
|
343
|
-
chromiumPath = p;
|
|
344
|
-
break;
|
|
345
|
-
}
|
|
346
|
-
}
|
|
347
|
-
const env = { ...process.env };
|
|
348
|
-
if (chromiumPath) {
|
|
349
|
-
env.PUPPETEER_EXECUTABLE_PATH = chromiumPath;
|
|
350
|
-
}
|
|
351
|
-
const result = await new Promise((resolve) => {
|
|
352
|
-
const proc = spawn(
|
|
353
|
-
"npx",
|
|
354
|
-
[
|
|
355
|
-
"--yes",
|
|
356
|
-
"@mermaid-js/mermaid-cli",
|
|
357
|
-
"-i",
|
|
358
|
-
inputFile,
|
|
359
|
-
"-o",
|
|
360
|
-
outputFile,
|
|
361
|
-
"-e",
|
|
362
|
-
"png",
|
|
363
|
-
"-b",
|
|
364
|
-
"white",
|
|
365
|
-
"-w",
|
|
366
|
-
"1200"
|
|
367
|
-
],
|
|
368
|
-
{
|
|
369
|
-
timeout: 6e4,
|
|
370
|
-
// 60 second timeout (first run may download packages)
|
|
371
|
-
stdio: ["pipe", "pipe", "pipe"],
|
|
372
|
-
env
|
|
373
|
-
}
|
|
374
|
-
);
|
|
375
|
-
let stderr = "";
|
|
376
|
-
proc.stderr?.on("data", (data) => {
|
|
377
|
-
stderr += data.toString();
|
|
378
|
-
});
|
|
379
|
-
proc.on("close", (code) => {
|
|
380
|
-
if (code === 0) {
|
|
381
|
-
resolve({ success: true });
|
|
382
|
-
} else {
|
|
383
|
-
resolve({ success: false, error: stderr || `Exit code ${code}` });
|
|
384
|
-
}
|
|
385
|
-
});
|
|
386
|
-
proc.on("error", (err) => {
|
|
387
|
-
resolve({ success: false, error: err.message });
|
|
388
|
-
});
|
|
389
|
-
});
|
|
390
|
-
if (!result.success) {
|
|
391
|
-
console.warn(`Mermaid rendering failed: ${result.error}`);
|
|
392
|
-
return null;
|
|
393
|
-
}
|
|
394
|
-
if (!fs.existsSync(outputFile)) {
|
|
395
|
-
console.warn("Mermaid output file not created");
|
|
396
|
-
return null;
|
|
397
|
-
}
|
|
398
|
-
const pngBuffer = fs.readFileSync(outputFile);
|
|
399
|
-
return pngBuffer;
|
|
400
|
-
} catch (e) {
|
|
401
|
-
console.warn(`Mermaid rendering error: ${e instanceof Error ? e.message : String(e)}`);
|
|
402
|
-
return null;
|
|
403
|
-
} finally {
|
|
404
|
-
try {
|
|
405
|
-
if (fs.existsSync(inputFile)) fs.unlinkSync(inputFile);
|
|
406
|
-
if (fs.existsSync(outputFile)) fs.unlinkSync(outputFile);
|
|
407
|
-
} catch {
|
|
408
|
-
}
|
|
409
|
-
}
|
|
410
|
-
}
|
|
411
|
-
function replaceMermaidBlocks(text, diagrams, replacement = "_(See diagram above)_") {
|
|
412
|
-
if (diagrams.length === 0) return text;
|
|
413
|
-
const sorted = [...diagrams].sort((a, b) => b.startIndex - a.startIndex);
|
|
414
|
-
let result = text;
|
|
415
|
-
sorted.forEach((diagram, sortedIndex) => {
|
|
416
|
-
const originalIndex = diagrams.length - 1 - sortedIndex;
|
|
417
|
-
const rep = typeof replacement === "function" ? replacement(originalIndex) : replacement;
|
|
418
|
-
result = result.slice(0, diagram.startIndex) + rep + result.slice(diagram.endIndex);
|
|
419
|
-
});
|
|
420
|
-
return result;
|
|
421
|
-
}
|
|
422
|
-
function markdownToSlack(text) {
|
|
423
|
-
if (!text || typeof text !== "string") return "";
|
|
424
|
-
let out = text;
|
|
425
|
-
out = out.replace(
|
|
426
|
-
/!\[([^\]]*)\]\(([^)\s]+)(?:\s+"[^"]*")?\)/g,
|
|
427
|
-
(_m, alt, url) => `<${url}|${alt || "image"}>`
|
|
428
|
-
);
|
|
429
|
-
out = out.replace(
|
|
430
|
-
/\[([^\]]+)\]\(([^)\s]+)(?:\s+"[^"]*")?\)/g,
|
|
431
|
-
(_m, label, url) => `<${url}|${label}>`
|
|
432
|
-
);
|
|
433
|
-
out = out.replace(/\*\*([^*]+)\*\*/g, (_m, inner) => `*${inner}*`);
|
|
434
|
-
out = out.replace(/__([^_]+)__/g, (_m, inner) => `*${inner}*`);
|
|
435
|
-
const lines = out.split(/\r?\n/);
|
|
436
|
-
let inCodeBlock = false;
|
|
437
|
-
for (let i = 0; i < lines.length; i++) {
|
|
438
|
-
const line = lines[i];
|
|
439
|
-
const trimmed = line.trimStart();
|
|
440
|
-
if (/^```/.test(trimmed)) {
|
|
441
|
-
inCodeBlock = !inCodeBlock;
|
|
442
|
-
continue;
|
|
443
|
-
}
|
|
444
|
-
if (inCodeBlock) continue;
|
|
445
|
-
const headerMatch = /^(#{1,6})\s+(.+)$/.exec(trimmed);
|
|
446
|
-
if (headerMatch) {
|
|
447
|
-
const [, hashes, headerText] = headerMatch;
|
|
448
|
-
const prevLine = i > 0 ? lines[i - 1].trim() : "";
|
|
449
|
-
const prevIsHeaderOrFence = /^#{1,6}\s+/.test(prevLine) || /^\*[^*]+\*$/.test(prevLine) || /^```/.test(prevLine);
|
|
450
|
-
if (hashes.length <= 2 && i > 0 && prevLine !== "" && !prevIsHeaderOrFence) {
|
|
451
|
-
lines[i] = `
|
|
452
|
-
*${headerText.trim()}*`;
|
|
453
|
-
} else {
|
|
454
|
-
lines[i] = `*${headerText.trim()}*`;
|
|
455
|
-
}
|
|
456
|
-
continue;
|
|
457
|
-
}
|
|
458
|
-
const bulletMatch = /^(\s*)([-*])\s+(.+)$/.exec(line);
|
|
459
|
-
if (bulletMatch) {
|
|
460
|
-
const [, indent, , rest] = bulletMatch;
|
|
461
|
-
lines[i] = `${indent}\u2022 ${rest}`;
|
|
462
|
-
}
|
|
463
|
-
}
|
|
464
|
-
out = lines.join("\n");
|
|
465
|
-
return out;
|
|
466
|
-
}
|
|
467
|
-
function extractFileSections(text) {
|
|
468
|
-
const sections = [];
|
|
469
|
-
const delimRegex = /^--- ([\w][\w.\-]*\.\w+) ---$/gm;
|
|
470
|
-
const delimiters = [];
|
|
471
|
-
let m;
|
|
472
|
-
while ((m = delimRegex.exec(text)) !== null) {
|
|
473
|
-
delimiters.push({
|
|
474
|
-
filename: m[1],
|
|
475
|
-
start: m.index,
|
|
476
|
-
end: m.index + m[0].length
|
|
477
|
-
});
|
|
478
|
-
}
|
|
479
|
-
if (delimiters.length === 0) return sections;
|
|
480
|
-
for (let i = 0; i < delimiters.length; i++) {
|
|
481
|
-
const open = delimiters[i];
|
|
482
|
-
const contentStart = open.end < text.length && text[open.end] === "\n" ? open.end + 1 : open.end;
|
|
483
|
-
const sectionEnd = i + 1 < delimiters.length ? delimiters[i + 1].start : text.length;
|
|
484
|
-
const content = text.substring(contentStart, sectionEnd).trim();
|
|
485
|
-
if (content.length > 0) {
|
|
486
|
-
sections.push({
|
|
487
|
-
fullMatch: text.substring(open.start, sectionEnd),
|
|
488
|
-
filename: open.filename,
|
|
489
|
-
content,
|
|
490
|
-
startIndex: open.start,
|
|
491
|
-
endIndex: sectionEnd
|
|
492
|
-
});
|
|
493
|
-
}
|
|
494
|
-
}
|
|
495
|
-
return sections;
|
|
496
|
-
}
|
|
497
|
-
function replaceFileSections(text, sections, replacement = (idx) => `_(See file: ${sections[idx].filename} above)_`) {
|
|
498
|
-
if (sections.length === 0) return text;
|
|
499
|
-
const sorted = [...sections].sort((a, b) => b.startIndex - a.startIndex);
|
|
500
|
-
let result = text;
|
|
501
|
-
sorted.forEach((section, sortedIndex) => {
|
|
502
|
-
const originalIndex = sections.length - 1 - sortedIndex;
|
|
503
|
-
const rep = typeof replacement === "function" ? replacement(originalIndex) : replacement;
|
|
504
|
-
result = result.slice(0, section.startIndex) + rep + result.slice(section.endIndex);
|
|
505
|
-
});
|
|
506
|
-
return result;
|
|
507
|
-
}
|
|
508
|
-
function formatSlackText(text) {
|
|
509
|
-
return markdownToSlack(text);
|
|
510
|
-
}
|
|
511
|
-
var init_markdown = __esm({
|
|
512
|
-
"src/slack/markdown.ts"() {
|
|
513
|
-
"use strict";
|
|
514
|
-
}
|
|
515
|
-
});
|
|
516
|
-
|
|
517
312
|
// src/frontends/slack-frontend.ts
|
|
518
313
|
var SlackFrontend;
|
|
519
314
|
var init_slack_frontend = __esm({
|
|
@@ -1077,4 +872,4 @@ init_slack_frontend();
|
|
|
1077
872
|
export {
|
|
1078
873
|
SlackFrontend
|
|
1079
874
|
};
|
|
1080
|
-
//# sourceMappingURL=slack-frontend-
|
|
875
|
+
//# sourceMappingURL=slack-frontend-TZU2HIK7.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/slack/client.ts","../../src/frontends/slack-frontend.ts"],"sourcesContent":["// Lightweight Slack Web API wrapper implemented with fetch (no external deps).\n// Only methods needed by SlackFrontend are implemented.\n\nexport class SlackClient {\n private token: string;\n\n constructor(botToken: string) {\n if (!botToken || typeof botToken !== 'string') {\n throw new Error('SlackClient: botToken is required');\n }\n this.token = botToken;\n }\n\n public readonly reactions = {\n add: async ({\n channel,\n timestamp,\n name,\n }: {\n channel: string;\n timestamp: string;\n name: string;\n }) => {\n const resp: any = await this.api('reactions.add', { channel, timestamp, name });\n if (!resp || resp.ok !== true) {\n // Non-fatal in CLI/test runs – log and continue\n const err = (resp && resp.error) || 'unknown_error';\n console.warn(`Slack reactions.add failed (non-fatal): ${err}`);\n return { ok: false as const };\n }\n return { ok: true } as const;\n },\n remove: async ({\n channel,\n timestamp,\n name,\n }: {\n channel: string;\n timestamp: string;\n name: string;\n }) => {\n const resp: any = await this.api('reactions.remove', { channel, timestamp, name });\n if (!resp || resp.ok !== true) {\n const err = (resp && resp.error) || 'unknown_error';\n console.warn(`Slack reactions.remove failed (non-fatal): ${err}`);\n return { ok: false as const };\n }\n return { ok: true } as const;\n },\n };\n\n public readonly chat = {\n postMessage: async ({\n channel,\n text,\n thread_ts,\n }: {\n channel: string;\n text: string;\n thread_ts?: string;\n }) => {\n try {\n const resp: any = await this.api('chat.postMessage', { channel, text, thread_ts });\n if (!resp || resp.ok !== true) {\n const err = (resp && resp.error) || 'unknown_error';\n const warnings = Array.isArray(resp?.response_metadata?.warnings)\n ? resp.response_metadata.warnings.join(',')\n : '';\n console.warn(\n `Slack chat.postMessage failed (non-fatal): error=${err} channel=${channel} thread_ts=${\n thread_ts || '-'\n } text_len=${text.length}${warnings ? ` warnings=${warnings}` : ''}`\n );\n return {\n ok: false as const,\n ts: undefined,\n message: undefined,\n data: resp,\n error: err,\n };\n }\n // Normalize common fields for tests/frontend\n return {\n ok: true as const,\n ts: resp.ts || (resp.message && resp.message.ts) || undefined,\n message: resp.message,\n data: resp,\n error: undefined,\n };\n } catch (e) {\n console.warn(\n `Slack chat.postMessage threw (non-fatal): channel=${channel} thread_ts=${thread_ts || '-'} text_len=${\n text.length\n } error=${e instanceof Error ? e.message : String(e)}`\n );\n return {\n ok: false as const,\n ts: undefined,\n message: undefined,\n data: undefined,\n error: e instanceof Error ? e.message : String(e),\n };\n }\n },\n update: async ({ channel, ts, text }: { channel: string; ts: string; text: string }) => {\n try {\n const resp: any = await this.api('chat.update', { channel, ts, text });\n if (!resp || resp.ok !== true) {\n const err = (resp && resp.error) || 'unknown_error';\n const warnings = Array.isArray(resp?.response_metadata?.warnings)\n ? resp.response_metadata.warnings.join(',')\n : '';\n console.warn(\n `Slack chat.update failed (non-fatal): error=${err} channel=${channel} ts=${ts} text_len=${\n text.length\n }${warnings ? ` warnings=${warnings}` : ''}`\n );\n return { ok: false as const, ts, error: err, data: resp };\n }\n return { ok: true as const, ts: resp.ts || ts, error: undefined, data: resp };\n } catch (e) {\n console.warn(\n `Slack chat.update threw (non-fatal): channel=${channel} ts=${ts} text_len=${text.length} error=${\n e instanceof Error ? e.message : String(e)\n }`\n );\n return {\n ok: false as const,\n ts,\n error: e instanceof Error ? e.message : String(e),\n data: undefined,\n };\n }\n },\n };\n\n async getBotUserId(): Promise<string> {\n const resp: any = await this.api('auth.test', {});\n if (!resp || resp.ok !== true || !resp.user_id) {\n console.warn('Slack auth.test failed (non-fatal); bot user id unavailable');\n return 'UNKNOWN_BOT';\n }\n return String(resp.user_id);\n }\n\n /**\n * Fetch user info from Slack API.\n * Returns user profile including guest status flags, email, display name, and timezone.\n */\n async getUserInfo(userId: string): Promise<{\n ok: boolean;\n user?: {\n id: string;\n name?: string; // username\n real_name?: string; // full name\n email?: string; // requires users:read.email scope\n is_restricted?: boolean; // Multi-channel guest\n is_ultra_restricted?: boolean; // Single-channel guest\n is_bot?: boolean;\n is_app_user?: boolean;\n deleted?: boolean;\n tz?: string; // IANA timezone (e.g., \"America/New_York\")\n tz_offset?: number; // Timezone offset in seconds from UTC\n };\n }> {\n try {\n const resp: any = await this.api('users.info', { user: userId });\n if (!resp || resp.ok !== true || !resp.user) {\n return { ok: false };\n }\n return {\n ok: true,\n user: {\n id: resp.user.id,\n name: resp.user.name,\n real_name: resp.user.real_name || resp.user.profile?.real_name,\n email: resp.user.profile?.email,\n is_restricted: resp.user.is_restricted,\n is_ultra_restricted: resp.user.is_ultra_restricted,\n is_bot: resp.user.is_bot,\n is_app_user: resp.user.is_app_user,\n deleted: resp.user.deleted,\n tz: resp.user.tz,\n tz_offset: resp.user.tz_offset,\n },\n };\n } catch (e) {\n console.warn(`Slack users.info failed: ${e instanceof Error ? e.message : String(e)}`);\n return { ok: false };\n }\n }\n\n /**\n * Open a DM channel with a user.\n * Returns the DM channel ID.\n */\n async openDM(userId: string): Promise<{ ok: boolean; channel?: string }> {\n try {\n const resp: any = await this.api('conversations.open', { users: userId });\n if (!resp || resp.ok !== true || !resp.channel?.id) {\n console.warn(`Slack conversations.open failed: ${resp?.error || 'unknown_error'}`);\n return { ok: false };\n }\n return { ok: true, channel: resp.channel.id };\n } catch (e) {\n console.warn(\n `Slack conversations.open failed: ${e instanceof Error ? e.message : String(e)}`\n );\n return { ok: false };\n }\n }\n\n async fetchThreadReplies(\n channel: string,\n thread_ts: string,\n limit: number = 40\n ): Promise<\n Array<{\n ts: string;\n user?: string;\n text?: string;\n bot_id?: string;\n thread_ts?: string;\n files?: any[];\n }>\n > {\n try {\n // Use query-string GET semantics similar to Slack WebClient to avoid\n // subtle JSON/form encoding issues that can cause invalid_arguments\n const params = new URLSearchParams({\n channel,\n ts: thread_ts,\n limit: String(limit),\n });\n const res = await fetch(`https://slack.com/api/conversations.replies?${params.toString()}`, {\n method: 'GET',\n headers: {\n Authorization: `Bearer ${this.token}`,\n },\n });\n const resp: any = await res.json();\n if (!resp || resp.ok !== true || !Array.isArray(resp.messages)) {\n const err = (resp && resp.error) || 'unknown_error';\n console.warn(\n `Slack conversations.replies failed (non-fatal): ${err} (channel=${channel}, ts=${thread_ts}, limit=${limit})`\n );\n return [];\n }\n return resp.messages.map((m: any) => ({\n ts: String(m.ts || ''),\n user: m.user,\n text: m.text,\n bot_id: m.bot_id,\n thread_ts: m.thread_ts,\n files: Array.isArray(m.files) ? m.files : undefined,\n }));\n } catch (e) {\n console.warn(\n `Slack conversations.replies failed (non-fatal): ${\n e instanceof Error ? e.message : String(e)\n } (channel=${channel}, ts=${thread_ts}, limit=${limit})`\n );\n return [];\n }\n }\n\n public readonly files = {\n /**\n * Upload a file to Slack using files.uploadV2 API\n * @param options Upload options including file content, filename, channel, and thread_ts\n */\n uploadV2: async ({\n content,\n filename,\n channel,\n thread_ts,\n title,\n initial_comment,\n }: {\n content: Buffer;\n filename: string;\n channel: string;\n thread_ts?: string;\n title?: string;\n initial_comment?: string;\n }): Promise<{ ok: boolean; file?: { id: string; permalink?: string } }> => {\n try {\n // Step 1: Get upload URL (uses form-urlencoded — this endpoint rejects JSON bodies)\n const getUrlResp: any = await this.apiForm('files.getUploadURLExternal', {\n filename,\n length: String(content.length),\n });\n if (!getUrlResp || getUrlResp.ok !== true || !getUrlResp.upload_url) {\n console.warn(\n `Slack files.getUploadURLExternal failed: ${getUrlResp?.error || 'unknown'}`\n );\n return { ok: false };\n }\n\n // Step 2: Upload file content to the URL\n const uploadResp = await fetch(getUrlResp.upload_url, {\n method: 'POST',\n body: content,\n });\n if (!uploadResp.ok) {\n console.warn(`Slack file upload to URL failed: ${uploadResp.status}`);\n return { ok: false };\n }\n\n // Step 3: Complete the upload and share to channel\n const completeResp: any = await this.api('files.completeUploadExternal', {\n files: [{ id: getUrlResp.file_id, title: title || filename }],\n channel_id: channel,\n thread_ts,\n initial_comment,\n });\n if (!completeResp || completeResp.ok !== true) {\n console.warn(\n `Slack files.completeUploadExternal failed: ${completeResp?.error || 'unknown'}`\n );\n return { ok: false };\n }\n\n return {\n ok: true,\n file: completeResp.files?.[0] || { id: getUrlResp.file_id },\n };\n } catch (e) {\n console.warn(`Slack file upload failed: ${e instanceof Error ? e.message : String(e)}`);\n return { ok: false };\n }\n },\n };\n\n getWebClient(): any {\n return {\n conversations: {\n history: async ({ channel, limit }: { channel: string; limit?: number }) =>\n (await this.api('conversations.history', { channel, limit })) as any,\n open: async ({ users }: { users: string }) =>\n (await this.api('conversations.open', { users })) as any,\n replies: async ({ channel, ts, limit }: { channel: string; ts: string; limit?: number }) =>\n (await this.api('conversations.replies', { channel, ts, limit })) as any,\n },\n };\n }\n\n private async api(method: string, body: Record<string, unknown>): Promise<unknown> {\n // Node 18+ global fetch\n const res = await fetch(`https://slack.com/api/${method}`, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json; charset=utf-8',\n Authorization: `Bearer ${this.token}`,\n },\n body: JSON.stringify(body),\n });\n return (await res.json()) as unknown;\n }\n\n /** Send a Slack API request as application/x-www-form-urlencoded (required by some file methods). */\n private async apiForm(method: string, params: Record<string, string>): Promise<unknown> {\n const body = new URLSearchParams(params);\n const res = await fetch(`https://slack.com/api/${method}`, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/x-www-form-urlencoded',\n Authorization: `Bearer ${this.token}`,\n },\n body: body.toString(),\n });\n return (await res.json()) as unknown;\n }\n}\n","/**\n * Slack Frontend for Visor workflows.\n *\n * Features:\n * - Posts AI replies to Slack threads\n * - Converts Markdown to Slack mrkdwn format\n * - Renders mermaid diagrams to PNG and uploads as images\n * - Manages 👀/👍 reactions for acknowledgement\n * - Handles human input prompts via prompt-state\n *\n * Mermaid Diagram Rendering:\n * - Detects ```mermaid code blocks in AI responses\n * - Renders to PNG using @mermaid-js/mermaid-cli (mmdc)\n * - Uploads rendered images to Slack thread\n * - Replaces mermaid blocks with \"_(See diagram above)_\" placeholder\n *\n * Requirements for mermaid rendering:\n * - Node.js and npx in PATH\n * - Puppeteer/Chromium dependencies (mermaid-cli uses headless browser)\n * - On Linux: apt-get install chromium-browser libatk-bridge2.0-0 libgtk-3-0\n */\nimport type { Frontend, FrontendContext } from './host';\nimport { SlackClient } from '../slack/client';\nimport {\n formatSlackText,\n extractMermaidDiagrams,\n renderMermaidToPng,\n replaceMermaidBlocks,\n extractFileSections,\n replaceFileSections,\n} from '../slack/markdown';\nimport { context as otContext, trace } from '../telemetry/lazy-otel';\n\ntype SlackFrontendConfig = {\n defaultChannel?: string;\n groupChannels?: Record<string, string>;\n debounceMs?: number;\n maxWaitMs?: number;\n showRawOutput?: boolean;\n telemetry?: {\n enabled?: boolean;\n };\n};\n\nexport class SlackFrontend implements Frontend {\n public readonly name = 'slack';\n private subs: Array<{ unsubscribe(): void }> = [];\n private cfg: SlackFrontendConfig;\n // Reactions ack/done per run (inbound Slack events only)\n private acked: boolean = false;\n private ackRef: { channel: string; ts: string } | null = null;\n private ackName: string = 'eyes';\n private doneName: string = 'thumbsup';\n private errorNotified: boolean = false;\n private cachedTraceInfo: { traceId: string; spanId: string } | null = null;\n\n constructor(config?: SlackFrontendConfig) {\n this.cfg = config || {};\n }\n\n start(ctx: FrontendContext): void {\n const bus = ctx.eventBus;\n\n // Capture trace info now while the OTel span may still be active.\n // EventBus handlers run in a different async context where the span is lost.\n if (!this.cachedTraceInfo) {\n this.cachedTraceInfo = this.getTraceInfo();\n }\n // Also check ctx.run.traceId which is injected by the execution engine\n if (!this.cachedTraceInfo) {\n const runTraceId = (ctx as any)?.run?.traceId;\n if (typeof runTraceId === 'string' && runTraceId) {\n this.cachedTraceInfo = { traceId: runTraceId, spanId: '' };\n }\n }\n\n // Info-level boot log\n try {\n const hasClient = !!(\n (ctx as any).slack ||\n (ctx as any).slackClient ||\n (this.cfg as any)?.botToken ||\n process.env.SLACK_BOT_TOKEN\n );\n ctx.logger.info(`[slack-frontend] started; hasClient=${hasClient} defaultChannel=unset`);\n } catch {}\n\n // If this run was triggered by a Slack event, log key attributes\n try {\n const payload = this.getInboundSlackPayload(ctx);\n if (payload) {\n const ev: any = payload.event || {};\n const ch = String(ev.channel || '-');\n const ts = String(ev.ts || ev.event_ts || '-');\n const user = String(ev.user || ev.bot_id || '-');\n const type = String(ev.type || '-');\n const thread = String(ev.thread_ts || '');\n ctx.logger.info(\n `[slack-frontend] inbound event received: type=${type} channel=${ch} ts=${ts}` +\n (thread ? ` thread_ts=${thread}` : '') +\n ` user=${user}`\n );\n }\n } catch {}\n\n // Listen to check lifecycle; we only post on completion/error (no queued placeholders)\n this.subs.push(\n bus.on('CheckCompleted', async (env: any) => {\n const ev = (env && env.payload) || env;\n // For chat-style AI checks, post direct replies into the Slack thread\n await this.maybePostDirectReply(ctx, ev.checkId, ev.result).catch(() => {});\n // Post execution failure notices when a check completes with fatal issues\n await this.maybePostExecutionFailure(ctx, ev.checkId, ev.result).catch(() => {});\n })\n );\n this.subs.push(\n bus.on('CheckErrored', async (env: any) => {\n const ev = (env && env.payload) || env;\n const message = ev?.error?.message || 'Execution error';\n await this.maybePostError(ctx, 'Check failed', message, ev?.checkId).catch(() => {});\n })\n );\n\n // On terminal state, replace 👀 with 👍 if we acked an inbound Slack message\n this.subs.push(\n bus.on('StateTransition', async (env: any) => {\n const ev = (env && env.payload) || env;\n if (ev && (ev.to === 'Completed' || ev.to === 'Error')) {\n await this.finalizeReactions(ctx).catch(() => {});\n }\n })\n );\n this.subs.push(\n bus.on('Shutdown', async (env: any) => {\n const ev = (env && env.payload) || env;\n const message = ev?.error?.message || 'Fatal error';\n await this.maybePostError(ctx, 'Run failed', message).catch(() => {});\n })\n );\n // Add 👀 acknowledgement as soon as first check is scheduled for Slack-driven runs\n this.subs.push(\n bus.on('CheckScheduled', async () => {\n await this.ensureAcknowledgement(ctx).catch(() => {});\n })\n );\n\n // Human-input requests: post prompt to Slack and mark waiting using prompt-state\n this.subs.push(\n bus.on('HumanInputRequested', async (env: any) => {\n try {\n const ev = (env && env.payload) || env;\n if (!ev || typeof ev.prompt !== 'string' || !ev.checkId) return;\n // Determine channel/thread (Slack SocketMode); if we can't, just ignore.\n let channel = ev.channel as string | undefined;\n let threadTs = ev.threadTs as string | undefined;\n if (!channel || !threadTs) {\n const payload = this.getInboundSlackPayload(ctx);\n const e: any = payload?.event;\n const derivedTs = String(e?.thread_ts || e?.ts || e?.event_ts || '');\n const derivedCh = String(e?.channel || '');\n if (derivedCh && derivedTs) {\n channel = channel || derivedCh;\n threadTs = threadTs || derivedTs;\n }\n }\n if (!channel || !threadTs) return;\n\n // Mark waiting in prompt-state without posting the prompt text to Slack.\n const { getPromptStateManager } = await import('../slack/prompt-state');\n const mgr = getPromptStateManager();\n const prev = mgr.getWaiting(channel, threadTs);\n const text = String(ev.prompt);\n mgr.setWaiting(channel, threadTs, {\n checkName: String(ev.checkId),\n prompt: text,\n promptMessageTs: prev?.promptMessageTs,\n promptsPosted: ((prev?.promptsPosted || 0) + 1) as any,\n });\n try {\n ctx.logger.info(\n `[slack-frontend] registered human-input waiting state for ${channel} thread=${threadTs}`\n );\n } catch {}\n } catch (e) {\n try {\n ctx.logger.warn(\n `[slack-frontend] HumanInputRequested handling failed: ${\n e instanceof Error ? e.message : String(e)\n }`\n );\n } catch {}\n }\n })\n );\n\n // SnapshotSaved: attach snapshot path to waiting entry for this thread\n this.subs.push(\n bus.on('SnapshotSaved', async (env: any) => {\n try {\n const ev = (env && env.payload) || env;\n const channel = String(ev?.channel || '');\n const threadTs = String(ev?.threadTs || '');\n const filePath = String(ev?.filePath || '');\n if (!channel || !threadTs || !filePath) return;\n const { getPromptStateManager } = await import('../slack/prompt-state');\n const mgr = getPromptStateManager();\n mgr.update(channel, threadTs, { snapshotPath: filePath });\n try {\n ctx.logger.info(\n `[slack-frontend] snapshot path attached to waiting prompt: ${filePath}`\n );\n } catch {}\n } catch {}\n })\n );\n }\n\n stop(): void {\n for (const s of this.subs) s.unsubscribe();\n this.subs = [];\n }\n\n private getSlack(ctx: FrontendContext): any | undefined {\n // Prefer injected fake client in tests: ctx.slack or ctx.slackClient\n const injected = (ctx as any).slack || (ctx as any).slackClient;\n if (injected) return injected;\n // Else try to lazy-create from env or frontend config\n try {\n const token = (this.cfg as any)?.botToken || process.env.SLACK_BOT_TOKEN;\n if (typeof token === 'string' && token.trim()) {\n return new SlackClient(token.trim());\n }\n } catch {}\n return undefined;\n }\n\n private getInboundSlackPayload(ctx: FrontendContext): any | null {\n try {\n const anyCfg: any = ctx.config || {};\n const slackCfg: any = anyCfg.slack || {};\n const endpoint: string = slackCfg.endpoint || '/bots/slack/support';\n const payload: any = (ctx as any).webhookContext?.webhookData?.get(endpoint);\n return payload || null;\n } catch {\n return null;\n }\n }\n\n private getInboundSlackEvent(ctx: FrontendContext): { channel: string; ts: string } | null {\n try {\n const payload = this.getInboundSlackPayload(ctx);\n const ev: any = payload?.event;\n const channel = String(ev?.channel || '');\n const ts = String(ev?.ts || ev?.event_ts || '');\n if (channel && ts) return { channel, ts };\n } catch {}\n return null;\n }\n\n private isTelemetryEnabled(ctx: FrontendContext): boolean {\n try {\n const anyCfg: any = ctx.config || {};\n const slackCfg: any = anyCfg.slack || {};\n const telemetryCfg = slackCfg.telemetry ?? (this.cfg as any)?.telemetry;\n return (\n telemetryCfg === true ||\n (telemetryCfg && typeof telemetryCfg === 'object' && telemetryCfg.enabled === true)\n );\n } catch {\n return false;\n }\n }\n\n private async maybePostError(\n ctx: FrontendContext,\n title: string,\n message: string,\n checkId?: string\n ): Promise<void> {\n if (this.errorNotified) return;\n const slack = this.getSlack(ctx);\n if (!slack) return;\n const payload = this.getInboundSlackPayload(ctx);\n const ev: any = payload?.event;\n const channel = String(ev?.channel || '');\n const threadTs = String(ev?.thread_ts || ev?.ts || ev?.event_ts || '');\n if (!channel || !threadTs) {\n try {\n ctx.logger.warn(\n `[slack-frontend] skip posting error notice: missing channel/thread (channel=${\n channel || '-'\n } thread=${threadTs || '-'})`\n );\n } catch {}\n return;\n }\n\n let text = `❌ ${title}`;\n if (checkId) text += `\\nCheck: ${checkId}`;\n if (message) text += `\\n${message}`;\n\n if (this.isTelemetryEnabled(ctx)) {\n const traceInfo = this.getTraceInfo() || this.cachedTraceInfo;\n if (traceInfo?.traceId) {\n text += `\\n\\n\\`trace_id: ${traceInfo.traceId}\\``;\n }\n }\n\n const formattedText = formatSlackText(text);\n const postResult = await slack.chat.postMessage({\n channel,\n text: formattedText,\n thread_ts: threadTs,\n });\n if (!postResult?.ok) {\n try {\n ctx.logger.warn(\n `[slack-frontend] failed to post error notice to ${channel} thread=${threadTs} check=${\n checkId || 'run'\n } error=${postResult?.error || 'unknown_error'}`\n );\n } catch {}\n return;\n }\n try {\n ctx.logger.info(\n `[slack-frontend] posted error notice to ${channel} thread=${threadTs} check=${checkId || 'run'}`\n );\n } catch {}\n this.errorNotified = true;\n }\n\n private isExecutionFailureIssue(issue: any): boolean {\n const ruleId = String(issue?.ruleId || '');\n const msg = String(issue?.message || '');\n const msgLower = msg.toLowerCase();\n return (\n ruleId.endsWith('/error') ||\n ruleId.includes('/execution_error') ||\n ruleId.includes('timeout') ||\n ruleId.includes('sandbox_runner_error') ||\n msgLower.includes('timed out') ||\n msg.includes('Command execution failed')\n );\n }\n\n private async maybePostExecutionFailure(\n ctx: FrontendContext,\n checkId: string,\n result: { issues?: any[] }\n ): Promise<void> {\n try {\n if (this.errorNotified) return;\n const cfg: any = ctx.config || {};\n const checkCfg: any = cfg.checks?.[checkId];\n if (!checkCfg) return;\n if (checkCfg.type === 'human-input') return;\n if (checkCfg.criticality === 'internal') return;\n const issues = (result as any)?.issues;\n if (!Array.isArray(issues) || issues.length === 0) return;\n\n const failureIssue = issues.find(issue => this.isExecutionFailureIssue(issue));\n if (!failureIssue) return;\n if (\n typeof failureIssue.message === 'string' &&\n failureIssue.message.toLowerCase().includes('awaiting human input')\n ) {\n return;\n }\n\n const msg =\n typeof failureIssue.message === 'string' && failureIssue.message.trim().length > 0\n ? failureIssue.message.trim()\n : `Execution failed (${String(failureIssue.ruleId || 'unknown')})`;\n await this.maybePostError(ctx, 'Check failed', msg, checkId);\n } catch {}\n }\n\n private async ensureAcknowledgement(ctx: FrontendContext): Promise<void> {\n if (this.acked) return;\n const ref = this.getInboundSlackEvent(ctx);\n if (!ref) return;\n const slack = this.getSlack(ctx);\n if (!slack) return;\n // Skip ack for our own bot messages to avoid loops (allow other bots)\n try {\n const payload = this.getInboundSlackPayload(ctx);\n const ev: any = payload?.event;\n // If we can resolve bot user id, skip if the sender is the bot\n try {\n const botId = await slack.getBotUserId?.();\n if (botId && ev?.user && String(ev.user) === String(botId)) return;\n } catch {}\n } catch {}\n // Allow overrides via config\n try {\n const anyCfg: any = ctx.config || {};\n const slackCfg: any = anyCfg.slack || {};\n if (slackCfg?.reactions?.enabled === false) return;\n this.ackName = slackCfg?.reactions?.ack || this.ackName;\n this.doneName = slackCfg?.reactions?.done || this.doneName;\n } catch {}\n await slack.reactions.add({ channel: ref.channel, timestamp: ref.ts, name: this.ackName });\n try {\n ctx.logger.info(\n `[slack-frontend] added acknowledgement reaction :${this.ackName}: channel=${ref.channel} ts=${ref.ts}`\n );\n } catch {}\n this.acked = true;\n this.ackRef = ref;\n // Capture trace info while span is active (event handlers lose OTel context)\n if (!this.cachedTraceInfo) {\n this.cachedTraceInfo = this.getTraceInfo();\n }\n }\n\n private async finalizeReactions(ctx: FrontendContext): Promise<void> {\n if (!this.acked || !this.ackRef) return;\n const slack = this.getSlack(ctx);\n if (!slack) return;\n try {\n try {\n await slack.reactions.remove({\n channel: this.ackRef.channel,\n timestamp: this.ackRef.ts,\n name: this.ackName,\n });\n } catch {}\n await slack.reactions.add({\n channel: this.ackRef.channel,\n timestamp: this.ackRef.ts,\n name: this.doneName,\n });\n try {\n ctx.logger.info(\n `[slack-frontend] replaced acknowledgement with completion reaction :${this.doneName}: channel=${this.ackRef.channel} ts=${this.ackRef.ts}`\n );\n } catch {}\n } finally {\n // Reset for safety\n this.acked = false;\n this.ackRef = null;\n }\n }\n\n /**\n * Post direct replies into the originating Slack thread when appropriate.\n * This is independent of summary messages and is intended for chat-style flows\n * (e.g., AI answers and explicit chat/notify steps).\n */\n private async maybePostDirectReply(\n ctx: FrontendContext,\n checkId: string,\n result: { output?: any; content?: string }\n ): Promise<void> {\n try {\n const cfg: any = ctx.config || {};\n const checkCfg: any = cfg.checks?.[checkId];\n if (!checkCfg) return;\n\n // Per-workflow / per-frontend flag to allow posting raw JSON\n // outputs for AI steps (useful for debugging router outputs).\n const slackRoot: any = (cfg as any).slack || {};\n const showRawOutput =\n slackRoot.show_raw_output === true || (this.cfg as any)?.showRawOutput === true;\n const telemetryCfg = slackRoot.telemetry ?? (this.cfg as any)?.telemetry;\n\n const providerType = (checkCfg.type as string) || '';\n const isAi = providerType === 'ai';\n const isLogChat = providerType === 'log' && checkCfg.group === 'chat';\n const isWorkflow = providerType === 'workflow';\n\n // Allow ai, log-chat, and workflow types; skip everything else\n if (!isAi && !isLogChat && !isWorkflow) return;\n\n // Skip internal steps - they're intermediate processing and shouldn't post to Slack\n if (checkCfg.criticality === 'internal') return;\n\n // For AI checks, only post when using simple/unstructured schemas (or none).\n if (isAi) {\n const schema = checkCfg.schema;\n // String schemas: allow only simple/plain ones\n if (typeof schema === 'string') {\n const simpleSchemas = ['code-review', 'markdown', 'text', 'plain'];\n if (!simpleSchemas.includes(schema)) return;\n }\n // Object schemas (custom JSON): treat as structured; require output.text\n }\n\n const slack = this.getSlack(ctx);\n if (!slack) return;\n\n const payload = this.getInboundSlackPayload(ctx);\n const ev: any = payload?.event;\n const channel = String(ev?.channel || '');\n const threadTs = String(ev?.thread_ts || ev?.ts || ev?.event_ts || '');\n if (!channel || !threadTs) {\n ctx.logger.warn(\n `[slack-frontend] skip posting AI reply for ${checkId}: missing channel/thread (channel=${\n channel || '-'\n } thread=${threadTs || '-'})`\n );\n return;\n }\n\n // Prefer output.text; fall back to content ONLY for string/simple schemas.\n const out: any = (result as any)?.output;\n let text: string | undefined;\n if (out && typeof out.text === 'string' && out.text.trim().length > 0) {\n text = out.text.trim();\n } else if (isAi && typeof checkCfg.schema === 'string') {\n if (\n typeof (result as any)?.content === 'string' &&\n (result as any).content.trim().length > 0\n ) {\n text = (result as any).content.trim();\n }\n } else if (isLogChat && typeof (result as any)?.logOutput === 'string') {\n // For log-based chat checks, render the formatted log output as the\n // Slack message when no structured text field is present.\n const raw = (result as any).logOutput;\n if (raw.trim().length > 0) {\n text = raw.trim();\n }\n } else if (isAi && showRawOutput && out !== undefined) {\n try {\n text = JSON.stringify(out, null, 2);\n } catch {\n text = String(out);\n }\n }\n // Append raw output from DSL execute_plan (bypasses LLM rewriting chain)\n if (out && typeof out._rawOutput === 'string' && out._rawOutput.trim().length > 0) {\n text = (text || '') + '\\n\\n' + out._rawOutput.trim();\n }\n\n if (!text) {\n ctx.logger.info(\n `[slack-frontend] skip posting AI reply for ${checkId}: no renderable text in check output`\n );\n return;\n }\n\n // Extract and render mermaid diagrams before posting\n const diagrams = extractMermaidDiagrams(text);\n let processedText = text;\n\n if (diagrams.length > 0) {\n try {\n ctx.logger.info(\n `[slack-frontend] found ${diagrams.length} mermaid diagram(s) to render for ${checkId}`\n );\n } catch {}\n\n // Render and upload each diagram\n const uploadedCount: number[] = [];\n for (let i = 0; i < diagrams.length; i++) {\n const diagram = diagrams[i];\n try {\n ctx.logger.info(`[slack-frontend] rendering mermaid diagram ${i + 1}...`);\n const pngBuffer = await renderMermaidToPng(diagram.code);\n if (pngBuffer) {\n ctx.logger.info(\n `[slack-frontend] rendered diagram ${i + 1}, size=${pngBuffer.length} bytes, uploading...`\n );\n const filename = `diagram-${i + 1}.png`;\n const uploadResult = await slack.files.uploadV2({\n content: pngBuffer,\n filename,\n channel,\n thread_ts: threadTs,\n title: `Diagram ${i + 1}`,\n });\n if (uploadResult.ok) {\n uploadedCount.push(i);\n ctx.logger.info(`[slack-frontend] uploaded mermaid diagram ${i + 1} to ${channel}`);\n } else {\n ctx.logger.warn(`[slack-frontend] upload failed for diagram ${i + 1}`);\n }\n } else {\n ctx.logger.warn(\n `[slack-frontend] mermaid rendering returned null for diagram ${i + 1} (mmdc failed or not installed)`\n );\n }\n } catch (e) {\n ctx.logger.warn(\n `[slack-frontend] failed to render/upload mermaid diagram ${i + 1}: ${\n e instanceof Error ? e.message : String(e)\n }`\n );\n }\n }\n\n // Replace mermaid blocks with placeholder text\n if (uploadedCount.length > 0) {\n processedText = replaceMermaidBlocks(text, diagrams, idx =>\n uploadedCount.includes(idx) ? '_(See diagram above)_' : '_(Diagram rendering failed)_'\n );\n }\n }\n\n // Normalize literal \\n escape sequences from DSL output buffer before extraction.\n // AI-generated DSL code often writes \"\\\\n\" producing literal backslash-n instead of\n // actual newlines, which prevents the --- delimiter --- from matching on its own line.\n processedText = processedText.replace(/\\\\n/g, '\\n');\n\n // Extract and upload file sections (--- filename.ext --- delimiters)\n const fileSections = extractFileSections(processedText);\n if (fileSections.length > 0) {\n const uploadedFileIndices: number[] = [];\n for (let i = 0; i < fileSections.length; i++) {\n const section = fileSections[i];\n try {\n const buffer = Buffer.from(section.content, 'utf-8');\n const uploadResult = await slack.files.uploadV2({\n content: buffer,\n filename: section.filename,\n channel,\n thread_ts: threadTs,\n title: section.filename,\n });\n if (uploadResult.ok) {\n uploadedFileIndices.push(i);\n ctx.logger.info(`[slack-frontend] uploaded file ${section.filename} to ${channel}`);\n } else {\n ctx.logger.warn(`[slack-frontend] upload failed for file ${section.filename}`);\n }\n } catch (e) {\n ctx.logger.warn(\n `[slack-frontend] failed to upload file ${section.filename}: ${\n e instanceof Error ? e.message : String(e)\n }`\n );\n }\n }\n processedText = replaceFileSections(processedText, fileSections, idx =>\n uploadedFileIndices.includes(idx)\n ? `_(See file: ${fileSections[idx].filename} above)_`\n : `_(File upload failed: ${fileSections[idx].filename})_`\n );\n }\n\n let decoratedText = processedText;\n const telemetryEnabled =\n telemetryCfg === true ||\n (telemetryCfg && typeof telemetryCfg === 'object' && telemetryCfg.enabled === true);\n if (telemetryEnabled) {\n const traceInfo = this.getTraceInfo() || this.cachedTraceInfo;\n if (traceInfo?.traceId) {\n const suffix = `\\`trace_id: ${traceInfo.traceId}\\``;\n decoratedText = `${decoratedText}\\n\\n${suffix}`;\n }\n }\n\n const formattedText = formatSlackText(decoratedText);\n const postResult = await slack.chat.postMessage({\n channel,\n text: formattedText,\n thread_ts: threadTs,\n });\n if (!postResult?.ok) {\n ctx.logger.warn(\n `[slack-frontend] failed to post AI reply for ${checkId} to ${channel} thread=${threadTs} error=${\n postResult?.error || 'unknown_error'\n }`\n );\n return;\n }\n ctx.logger.info(\n `[slack-frontend] posted AI reply for ${checkId} to ${channel} thread=${threadTs} ts=${\n postResult.ts || '-'\n }`\n );\n\n // Capture response for scheduled reminders (allows storing previousResponse)\n const responseCapture = (ctx as any).responseCapture as ((text: string) => void) | undefined;\n if (responseCapture && typeof responseCapture === 'function') {\n try {\n // Store the original text (before mrkdwn formatting) for continuity\n responseCapture(processedText);\n } catch {}\n }\n } catch (outerErr) {\n // Log errors instead of silently swallowing them\n try {\n ctx.logger.warn(\n `[slack-frontend] maybePostDirectReply failed for ${checkId}: ${\n outerErr instanceof Error ? outerErr.message : String(outerErr)\n }`\n );\n } catch {}\n }\n }\n\n private getTraceInfo(): { traceId: string; spanId: string } | null {\n try {\n const span = trace.getSpan(otContext.active());\n if (!span) return null;\n const ctx = span.spanContext();\n if (!ctx || !ctx.traceId) return null;\n return { traceId: ctx.traceId, spanId: ctx.spanId };\n } catch {\n return null;\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA,IAGa;AAHb;AAAA;AAAA;AAGO,IAAM,cAAN,MAAkB;AAAA,MACf;AAAA,MAER,YAAY,UAAkB;AAC5B,YAAI,CAAC,YAAY,OAAO,aAAa,UAAU;AAC7C,gBAAM,IAAI,MAAM,mCAAmC;AAAA,QACrD;AACA,aAAK,QAAQ;AAAA,MACf;AAAA,MAEgB,YAAY;AAAA,QAC1B,KAAK,OAAO;AAAA,UACV;AAAA,UACA;AAAA,UACA;AAAA,QACF,MAIM;AACJ,gBAAM,OAAY,MAAM,KAAK,IAAI,iBAAiB,EAAE,SAAS,WAAW,KAAK,CAAC;AAC9E,cAAI,CAAC,QAAQ,KAAK,OAAO,MAAM;AAE7B,kBAAM,MAAO,QAAQ,KAAK,SAAU;AACpC,oBAAQ,KAAK,2CAA2C,GAAG,EAAE;AAC7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;AAAA,UACF;AAGA,gBAAM,kBAAmB,IAAY;AACrC,cAAI,mBAAmB,OAAO,oBAAoB,YAAY;AAC5D,gBAAI;AAEF,8BAAgB,aAAa;AAAA,YAC/B,QAAQ;AAAA,YAAC;AAAA,UACX;AAAA,QACF,SAAS,UAAU;AAEjB,cAAI;AACF,gBAAI,OAAO;AAAA,cACT,oDAAoD,OAAO,KACzD,oBAAoB,QAAQ,SAAS,UAAU,OAAO,QAAQ,CAChE;AAAA,YACF;AAAA,UACF,QAAQ;AAAA,UAAC;AAAA,QACX;AAAA,MACF;AAAA,MAEQ,eAA2D;AACjE,YAAI;AACF,gBAAM,OAAO,MAAM,QAAQ,QAAU,OAAO,CAAC;AAC7C,cAAI,CAAC,KAAM,QAAO;AAClB,gBAAM,MAAM,KAAK,YAAY;AAC7B,cAAI,CAAC,OAAO,CAAC,IAAI,QAAS,QAAO;AACjC,iBAAO,EAAE,SAAS,IAAI,SAAS,QAAQ,IAAI,OAAO;AAAA,QACpD,QAAQ;AACN,iBAAO;AAAA,QACT;AAAA,MACF;AAAA,IACF;AAAA;AAAA;","names":[]}
|
package/dist/sdk/{workflow-check-provider-PWCAGFNW.mjs → workflow-check-provider-HDX3ZABR.mjs}
RENAMED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
WorkflowCheckProvider,
|
|
3
3
|
init_workflow_check_provider
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-CNNQTDJZ.mjs";
|
|
5
5
|
import "./chunk-KFKHU6CM.mjs";
|
|
6
|
+
import "./chunk-M3BYMES6.mjs";
|
|
6
7
|
import "./chunk-LG4AUKHB.mjs";
|
|
7
8
|
import "./chunk-B7BVQM5K.mjs";
|
|
8
9
|
import "./chunk-XXAEN5KU.mjs";
|
|
@@ -26,4 +27,4 @@ init_workflow_check_provider();
|
|
|
26
27
|
export {
|
|
27
28
|
WorkflowCheckProvider
|
|
28
29
|
};
|
|
29
|
-
//# sourceMappingURL=workflow-check-provider-
|
|
30
|
+
//# sourceMappingURL=workflow-check-provider-HDX3ZABR.mjs.map
|
package/dist/sdk/{workflow-check-provider-ZDO5KBUG.mjs → workflow-check-provider-INZUO2WJ.mjs}
RENAMED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
WorkflowCheckProvider,
|
|
3
3
|
init_workflow_check_provider
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-KUSF5IBV.mjs";
|
|
5
|
+
import "./chunk-M3BYMES6.mjs";
|
|
5
6
|
import "./chunk-LG4AUKHB.mjs";
|
|
6
7
|
import "./chunk-KFKHU6CM.mjs";
|
|
7
8
|
import "./chunk-B7BVQM5K.mjs";
|
|
@@ -26,4 +27,4 @@ init_workflow_check_provider();
|
|
|
26
27
|
export {
|
|
27
28
|
WorkflowCheckProvider
|
|
28
29
|
};
|
|
29
|
-
//# sourceMappingURL=workflow-check-provider-
|
|
30
|
+
//# sourceMappingURL=workflow-check-provider-INZUO2WJ.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"execution-invoker.d.ts","sourceRoot":"","sources":["file:///home/runner/work/visor/visor/src/state-machine/dispatch/execution-invoker.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC5F,OAAO,KAAK,EAAe,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAEjE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAkRtD;;;;;GAKG;AACH,wBAAsB,kBAAkB,CACtC,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,aAAa,EACtB,KAAK,EAAE,QAAQ,EACf,SAAS,EAAE,CAAC,KAAK,EAAE,WAAW,KAAK,IAAI,EACvC,UAAU,EAAE,CAAC,QAAQ,EAAE,WAAW,KAAK,IAAI,EAC3C,UAAU,EAAE,CACV,OAAO,EAAE,MAAM,EACf,WAAW,EAAE,WAAW,EACxB,OAAO,EAAE,aAAa,EACtB,KAAK,EAAE,QAAQ,KACZ,OAAO,CAAC,OAAO,CAAC,EACrB,aAAa,CAAC,EAAE,KAAK,CAAC;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC,GACtD,OAAO,CAAC,aAAa,CAAC,
|
|
1
|
+
{"version":3,"file":"execution-invoker.d.ts","sourceRoot":"","sources":["file:///home/runner/work/visor/visor/src/state-machine/dispatch/execution-invoker.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC5F,OAAO,KAAK,EAAe,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAEjE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAkRtD;;;;;GAKG;AACH,wBAAsB,kBAAkB,CACtC,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,aAAa,EACtB,KAAK,EAAE,QAAQ,EACf,SAAS,EAAE,CAAC,KAAK,EAAE,WAAW,KAAK,IAAI,EACvC,UAAU,EAAE,CAAC,QAAQ,EAAE,WAAW,KAAK,IAAI,EAC3C,UAAU,EAAE,CACV,OAAO,EAAE,MAAM,EACf,WAAW,EAAE,WAAW,EACxB,OAAO,EAAE,aAAa,EACtB,KAAK,EAAE,QAAQ,KACZ,OAAO,CAAC,OAAO,CAAC,EACrB,aAAa,CAAC,EAAE,KAAK,CAAC;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC,GACtD,OAAO,CAAC,aAAa,CAAC,CAopBxB"}
|