mirror of
https://github.com/BradGroux/veritas-kanban.git
synced 2026-08-28 02:44:59 +00:00
refactor: isolate remaining process file IO
This commit is contained in:
parent
5493c022cd
commit
1e06849d3f
8 changed files with 20 additions and 61 deletions
|
|
@ -1,42 +1,5 @@
|
|||
{
|
||||
"schemaVersion": 1,
|
||||
"maximumEntries": 6,
|
||||
"entries": [
|
||||
{
|
||||
"path": "server/src/services/clawdbot-agent-service.ts",
|
||||
"category": "transient-process-io",
|
||||
"owner": "#1189",
|
||||
"rationale": "Remaining process I/O migration is tracked in issue #1189."
|
||||
},
|
||||
{
|
||||
"path": "server/src/services/file-lock.ts",
|
||||
"category": "transient-process-io",
|
||||
"owner": "#1189",
|
||||
"rationale": "Remaining process I/O migration is tracked in issue #1189."
|
||||
},
|
||||
{
|
||||
"path": "server/src/services/gateway-chat-client.ts",
|
||||
"category": "transient-process-io",
|
||||
"owner": "#1189",
|
||||
"rationale": "Remaining process I/O migration is tracked in issue #1189."
|
||||
},
|
||||
{
|
||||
"path": "server/src/services/pdf-report-service.ts",
|
||||
"category": "transient-process-io",
|
||||
"owner": "#1189",
|
||||
"rationale": "Remaining process I/O migration is tracked in issue #1189."
|
||||
},
|
||||
{
|
||||
"path": "server/src/services/sqlite-portability-service.ts",
|
||||
"category": "transient-process-io",
|
||||
"owner": "#1189",
|
||||
"rationale": "Remaining process I/O migration is tracked in issue #1189."
|
||||
},
|
||||
{
|
||||
"path": "server/src/services/text-extraction-service.ts",
|
||||
"category": "transient-process-io",
|
||||
"owner": "#1189",
|
||||
"rationale": "Remaining process I/O migration is tracked in issue #1189."
|
||||
}
|
||||
]
|
||||
"maximumEntries": 0,
|
||||
"entries": []
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
import { EventEmitter } from 'events';
|
||||
import { spawn, type ChildProcessWithoutNullStreams } from 'child_process';
|
||||
import { nanoid } from 'nanoid';
|
||||
import fs from 'fs/promises';
|
||||
import * as fs from '../storage/fs-helpers.js';
|
||||
import path from 'path';
|
||||
import { createHash } from 'node:crypto';
|
||||
import { ConfigService } from './config-service.js';
|
||||
|
|
@ -3284,9 +3284,7 @@ export class ClawdbotAgentService {
|
|||
{
|
||||
summary: this.redactTraceText(startError.message || `Failed to start ${adapter.label}`),
|
||||
phase: 'launch',
|
||||
...(failedDependencyCircuits
|
||||
? { dependencyCircuits: failedDependencyCircuits }
|
||||
: {}),
|
||||
...(failedDependencyCircuits ? { dependencyCircuits: failedDependencyCircuits } : {}),
|
||||
},
|
||||
{
|
||||
provider,
|
||||
|
|
@ -3348,8 +3346,7 @@ export class ClawdbotAgentService {
|
|||
harnessSupport: this.harnessTelemetry(harnessSupport, 'launch-failed'),
|
||||
...(failedDependencyCircuits
|
||||
? {
|
||||
dependencyCircuits:
|
||||
this.dependencyCircuitTelemetry(failedDependencyCircuits),
|
||||
dependencyCircuits: this.dependencyCircuitTelemetry(failedDependencyCircuits),
|
||||
}
|
||||
: {}),
|
||||
});
|
||||
|
|
@ -4416,8 +4413,7 @@ export class ClawdbotAgentService {
|
|||
),
|
||||
...(dependencyCircuits
|
||||
? {
|
||||
dependencyCircuits:
|
||||
this.dependencyCircuitTelemetry(dependencyCircuits),
|
||||
dependencyCircuits: this.dependencyCircuitTelemetry(dependencyCircuits),
|
||||
}
|
||||
: {}),
|
||||
}),
|
||||
|
|
@ -5653,12 +5649,8 @@ export class ClawdbotAgentService {
|
|||
selectedHost: string
|
||||
): Promise<RunDependencyCircuitEvidence> {
|
||||
const [providerCircuit, agentHostCircuit] = await Promise.all([
|
||||
this.dependencyExecution.inspect(
|
||||
providerDependencyIdentity(provider, model, workspaceId)
|
||||
),
|
||||
this.dependencyExecution.inspect(
|
||||
agentHostDependencyIdentity(selectedHost, workspaceId)
|
||||
),
|
||||
this.dependencyExecution.inspect(providerDependencyIdentity(provider, model, workspaceId)),
|
||||
this.dependencyExecution.inspect(agentHostDependencyIdentity(selectedHost, workspaceId)),
|
||||
]);
|
||||
return {
|
||||
schemaVersion: RUN_DEPENDENCY_CIRCUIT_EVIDENCE_SCHEMA_VERSION,
|
||||
|
|
@ -9192,7 +9184,7 @@ export class ClawdbotAgentService {
|
|||
? event.payload.summary
|
||||
: outputArtifact && typeof outputArtifact.content === 'string'
|
||||
? outputArtifact.content
|
||||
: undefined;
|
||||
: undefined;
|
||||
if (!content?.trim()) return;
|
||||
const type: AgentOutput['type'] =
|
||||
event.source.provider === 'operator'
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import fs from 'fs/promises';
|
||||
import * as fs from '../storage/fs-helpers.js';
|
||||
import path from 'path';
|
||||
import { createLogger } from '../lib/logger.js';
|
||||
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@
|
|||
import WebSocket from 'ws';
|
||||
import { randomUUID } from 'crypto';
|
||||
import { createLogger } from '../lib/logger.js';
|
||||
import { readFile } from '../storage/fs-helpers.js';
|
||||
|
||||
const log = createLogger('gateway-chat');
|
||||
|
||||
|
|
@ -259,10 +260,9 @@ export async function loadGatewayToken(): Promise<string> {
|
|||
}
|
||||
|
||||
try {
|
||||
const fs = await import('fs/promises');
|
||||
const path = await import('path');
|
||||
const configPath = path.join(process.env.HOME || '', '.clawdbot', 'clawdbot.json');
|
||||
const raw = await fs.readFile(configPath, 'utf-8');
|
||||
const raw = await readFile(configPath, 'utf-8');
|
||||
const config = JSON.parse(raw);
|
||||
const token = config?.gateway?.auth?.token;
|
||||
if (token) {
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
*/
|
||||
|
||||
import { createLogger } from '../lib/logger.js';
|
||||
import * as fs from 'node:fs/promises';
|
||||
import * as fs from '../storage/fs-helpers.js';
|
||||
import * as path from 'node:path';
|
||||
import sanitizeHtml from 'sanitize-html';
|
||||
import { getReportsOutputDir, getRuntimeDir } from '../utils/paths.js';
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import fs from 'fs/promises';
|
||||
import { createReadStream } from 'fs';
|
||||
import * as fs from '../storage/fs-helpers.js';
|
||||
import { createReadStream } from '../storage/fs-helpers.js';
|
||||
import path from 'path';
|
||||
import readline from 'readline';
|
||||
import { createGunzip } from 'zlib';
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import fs from 'fs/promises';
|
||||
import * as fs from '../storage/fs-helpers.js';
|
||||
import { extractText as unpdfExtract } from 'unpdf';
|
||||
import mammoth from 'mammoth';
|
||||
import ExcelJS from 'exceljs';
|
||||
|
|
|
|||
|
|
@ -14,7 +14,9 @@ import type { FSWatcher } from 'node:fs';
|
|||
import { EventEmitter } from 'node:events';
|
||||
import {
|
||||
access,
|
||||
appendFile as appendFileAsync,
|
||||
copyFile as copyFileAsync,
|
||||
cp as cpAsync,
|
||||
lstat as lstatAsync,
|
||||
mkdir as mkdirAsync,
|
||||
open as openAsync,
|
||||
|
|
@ -77,7 +79,9 @@ export const createWriteStream = fs.createWriteStream;
|
|||
export const mkdir = mkdirAsync;
|
||||
export const open = openAsync;
|
||||
export { access };
|
||||
export const appendFile = appendFileAsync;
|
||||
export const copyFile = copyFileAsync;
|
||||
export const cp = cpAsync;
|
||||
export const lstat = lstatAsync;
|
||||
export const readFile = readFileAsync;
|
||||
export const readdir = readdirAsync;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue