@northflare/runner 0.0.30 → 0.0.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/bin/northflare-runner +1 -1
- package/dist/chunk-3QTLJ4CG.js +33622 -0
- package/dist/chunk-3QTLJ4CG.js.map +1 -0
- package/dist/chunk-7D4SUZUM.js +38 -0
- package/dist/chunk-7D4SUZUM.js.map +1 -0
- package/dist/dist-W7DZRE4U.js +365 -0
- package/dist/dist-W7DZRE4U.js.map +1 -0
- package/dist/index.d.ts +764 -5
- package/dist/index.js +9872 -202
- package/dist/index.js.map +1 -1
- package/dist/sdk-query-TRMSGGID-EIENWDKW.js +14 -0
- package/dist/sdk-query-TRMSGGID-EIENWDKW.js.map +1 -0
- package/package.json +17 -17
- package/tsup.config.ts +5 -2
- package/dist/components/claude-sdk-manager.d.ts +0 -60
- package/dist/components/claude-sdk-manager.d.ts.map +0 -1
- package/dist/components/claude-sdk-manager.js +0 -1378
- package/dist/components/claude-sdk-manager.js.map +0 -1
- package/dist/components/codex-sdk-manager.d.ts +0 -94
- package/dist/components/codex-sdk-manager.d.ts.map +0 -1
- package/dist/components/codex-sdk-manager.js +0 -1450
- package/dist/components/codex-sdk-manager.js.map +0 -1
- package/dist/components/enhanced-repository-manager.d.ts +0 -173
- package/dist/components/enhanced-repository-manager.d.ts.map +0 -1
- package/dist/components/enhanced-repository-manager.js +0 -1097
- package/dist/components/enhanced-repository-manager.js.map +0 -1
- package/dist/components/message-handler-sse.d.ts +0 -77
- package/dist/components/message-handler-sse.d.ts.map +0 -1
- package/dist/components/message-handler-sse.js +0 -1224
- package/dist/components/message-handler-sse.js.map +0 -1
- package/dist/components/northflare-agent-sdk-manager.d.ts +0 -58
- package/dist/components/northflare-agent-sdk-manager.d.ts.map +0 -1
- package/dist/components/northflare-agent-sdk-manager.js +0 -2032
- package/dist/components/northflare-agent-sdk-manager.js.map +0 -1
- package/dist/components/repository-manager.d.ts +0 -51
- package/dist/components/repository-manager.d.ts.map +0 -1
- package/dist/components/repository-manager.js +0 -256
- package/dist/components/repository-manager.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/runner-sse.d.ts +0 -102
- package/dist/runner-sse.d.ts.map +0 -1
- package/dist/runner-sse.js +0 -877
- package/dist/runner-sse.js.map +0 -1
- package/dist/services/RunnerAPIClient.d.ts +0 -61
- package/dist/services/RunnerAPIClient.d.ts.map +0 -1
- package/dist/services/RunnerAPIClient.js +0 -187
- package/dist/services/RunnerAPIClient.js.map +0 -1
- package/dist/services/SSEClient.d.ts +0 -62
- package/dist/services/SSEClient.d.ts.map +0 -1
- package/dist/services/SSEClient.js +0 -225
- package/dist/services/SSEClient.js.map +0 -1
- package/dist/types/claude.d.ts +0 -80
- package/dist/types/claude.d.ts.map +0 -1
- package/dist/types/claude.js +0 -5
- package/dist/types/claude.js.map +0 -1
- package/dist/types/index.d.ts +0 -52
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/index.js +0 -7
- package/dist/types/index.js.map +0 -1
- package/dist/types/messages.d.ts +0 -33
- package/dist/types/messages.d.ts.map +0 -1
- package/dist/types/messages.js +0 -5
- package/dist/types/messages.js.map +0 -1
- package/dist/types/runner-interface.d.ts +0 -38
- package/dist/types/runner-interface.d.ts.map +0 -1
- package/dist/types/runner-interface.js +0 -5
- package/dist/types/runner-interface.js.map +0 -1
- package/dist/utils/StateManager.d.ts +0 -61
- package/dist/utils/StateManager.d.ts.map +0 -1
- package/dist/utils/StateManager.js +0 -170
- package/dist/utils/StateManager.js.map +0 -1
- package/dist/utils/config.d.ts +0 -48
- package/dist/utils/config.d.ts.map +0 -1
- package/dist/utils/config.js +0 -378
- package/dist/utils/config.js.map +0 -1
- package/dist/utils/console.d.ts +0 -8
- package/dist/utils/console.d.ts.map +0 -1
- package/dist/utils/console.js +0 -31
- package/dist/utils/console.js.map +0 -1
- package/dist/utils/debug.d.ts +0 -12
- package/dist/utils/debug.d.ts.map +0 -1
- package/dist/utils/debug.js +0 -94
- package/dist/utils/debug.js.map +0 -1
- package/dist/utils/expand-env.d.ts +0 -2
- package/dist/utils/expand-env.d.ts.map +0 -1
- package/dist/utils/expand-env.js +0 -17
- package/dist/utils/expand-env.js.map +0 -1
- package/dist/utils/inactivity-timeout.d.ts +0 -19
- package/dist/utils/inactivity-timeout.d.ts.map +0 -1
- package/dist/utils/inactivity-timeout.js +0 -72
- package/dist/utils/inactivity-timeout.js.map +0 -1
- package/dist/utils/logger.d.ts +0 -10
- package/dist/utils/logger.d.ts.map +0 -1
- package/dist/utils/logger.js +0 -129
- package/dist/utils/logger.js.map +0 -1
- package/dist/utils/message-log.d.ts +0 -23
- package/dist/utils/message-log.d.ts.map +0 -1
- package/dist/utils/message-log.js +0 -69
- package/dist/utils/message-log.js.map +0 -1
- package/dist/utils/model.d.ts +0 -8
- package/dist/utils/model.d.ts.map +0 -1
- package/dist/utils/model.js +0 -37
- package/dist/utils/model.js.map +0 -1
- package/dist/utils/status-line.d.ts +0 -34
- package/dist/utils/status-line.d.ts.map +0 -1
- package/dist/utils/status-line.js +0 -131
- package/dist/utils/status-line.js.map +0 -1
- package/dist/utils/tool-response-sanitizer.d.ts +0 -9
- package/dist/utils/tool-response-sanitizer.d.ts.map +0 -1
- package/dist/utils/tool-response-sanitizer.js +0 -118
- package/dist/utils/tool-response-sanitizer.js.map +0 -1
- package/dist/utils/update-coordinator.d.ts +0 -53
- package/dist/utils/update-coordinator.d.ts.map +0 -1
- package/dist/utils/update-coordinator.js +0 -159
- package/dist/utils/update-coordinator.js.map +0 -1
- package/dist/utils/version.d.ts +0 -10
- package/dist/utils/version.d.ts.map +0 -1
- package/dist/utils/version.js +0 -33
- package/dist/utils/version.js.map +0 -1
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Utilities for parsing and formatting inactivity timeout values
|
|
3
|
-
*/
|
|
4
|
-
const UNIT_METADATA = {
|
|
5
|
-
s: {
|
|
6
|
-
multiplier: 1000,
|
|
7
|
-
unit: "seconds",
|
|
8
|
-
singular: "second",
|
|
9
|
-
plural: "seconds",
|
|
10
|
-
},
|
|
11
|
-
m: {
|
|
12
|
-
multiplier: 60_000,
|
|
13
|
-
unit: "minutes",
|
|
14
|
-
singular: "minute",
|
|
15
|
-
plural: "minutes",
|
|
16
|
-
},
|
|
17
|
-
h: {
|
|
18
|
-
multiplier: 3_600_000,
|
|
19
|
-
unit: "hours",
|
|
20
|
-
singular: "hour",
|
|
21
|
-
plural: "hours",
|
|
22
|
-
},
|
|
23
|
-
};
|
|
24
|
-
/**
|
|
25
|
-
* Parse CLI-provided inactivity timeout values (e.g. 30s, 5m, 1h, 45)
|
|
26
|
-
*/
|
|
27
|
-
export function parseInactivityTimeout(rawValue) {
|
|
28
|
-
if (!rawValue) {
|
|
29
|
-
throw new Error("Inactivity timeout value cannot be empty");
|
|
30
|
-
}
|
|
31
|
-
const trimmed = rawValue.trim().toLowerCase();
|
|
32
|
-
const match = trimmed.match(/^(\d+)([smh])?$/);
|
|
33
|
-
if (!match) {
|
|
34
|
-
throw new Error("Invalid inactivity timeout format. Use a number optionally suffixed with s, m, or h (e.g. 30s, 5m, 1h).");
|
|
35
|
-
}
|
|
36
|
-
const value = Number(match[1]);
|
|
37
|
-
if (!Number.isFinite(value) || value <= 0) {
|
|
38
|
-
throw new Error("Inactivity timeout must be a number greater than zero");
|
|
39
|
-
}
|
|
40
|
-
const unitKey = (match[2] || "s");
|
|
41
|
-
const metadata = UNIT_METADATA[unitKey];
|
|
42
|
-
if (!metadata) {
|
|
43
|
-
throw new Error(`Unsupported inactivity timeout unit: ${unitKey}`);
|
|
44
|
-
}
|
|
45
|
-
const milliseconds = value * metadata.multiplier;
|
|
46
|
-
const unitLabel = value === 1 ? metadata.singular : metadata.plural;
|
|
47
|
-
return {
|
|
48
|
-
milliseconds,
|
|
49
|
-
value,
|
|
50
|
-
unit: metadata.unit,
|
|
51
|
-
display: `${value} ${unitLabel}`,
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* Best-effort formatter for a timeout expressed in milliseconds.
|
|
56
|
-
*/
|
|
57
|
-
export function formatInactivityTimeoutFromMs(ms) {
|
|
58
|
-
if (!Number.isFinite(ms) || ms <= 0) {
|
|
59
|
-
return "unknown duration";
|
|
60
|
-
}
|
|
61
|
-
if (ms % UNIT_METADATA.h.multiplier === 0) {
|
|
62
|
-
const hours = ms / UNIT_METADATA.h.multiplier;
|
|
63
|
-
return `${hours} ${hours === 1 ? "hour" : "hours"}`;
|
|
64
|
-
}
|
|
65
|
-
if (ms % UNIT_METADATA.m.multiplier === 0) {
|
|
66
|
-
const minutes = ms / UNIT_METADATA.m.multiplier;
|
|
67
|
-
return `${minutes} ${minutes === 1 ? "minute" : "minutes"}`;
|
|
68
|
-
}
|
|
69
|
-
const seconds = Math.round(ms / 1000);
|
|
70
|
-
return `${seconds} ${seconds === 1 ? "second" : "seconds"}`;
|
|
71
|
-
}
|
|
72
|
-
//# sourceMappingURL=inactivity-timeout.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"inactivity-timeout.js","sourceRoot":"","sources":["../../src/utils/inactivity-timeout.ts"],"names":[],"mappings":"AAAA;;GAEG;AAmBH,MAAM,aAAa,GAAG;IACpB,CAAC,EAAE;QACD,UAAU,EAAE,IAAI;QAChB,IAAI,EAAE,SAAS;QACf,QAAQ,EAAE,QAAQ;QAClB,MAAM,EAAE,SAAS;KAClB;IACD,CAAC,EAAE;QACD,UAAU,EAAE,MAAM;QAClB,IAAI,EAAE,SAAS;QACf,QAAQ,EAAE,QAAQ;QAClB,MAAM,EAAE,SAAS;KAClB;IACD,CAAC,EAAE;QACD,UAAU,EAAE,SAAS;QACrB,IAAI,EAAE,OAAO;QACb,QAAQ,EAAE,MAAM;QAChB,MAAM,EAAE,OAAO;KAChB;CACsC,CAAC;AAE1C;;GAEG;AACH,MAAM,UAAU,sBAAsB,CACpC,QAAgB;IAEhB,IAAI,CAAC,QAAQ,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,IAAI,CAAC,EAAE,CAAC;QACpC,OAAO,kBAAkB,CAAC;IAC5B,CAAC;IAED,IAAI,EAAE,GAAG,aAAa,CAAC,CAAC,CAAC,UAAU,KAAK,CAAC,EAAE,CAAC;QAC1C,MAAM,KAAK,GAAG,EAAE,GAAG,aAAa,CAAC,CAAC,CAAC,UAAU,CAAC;QAC9C,OAAO,GAAG,KAAK,IAAI,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;IACtD,CAAC;IAED,IAAI,EAAE,GAAG,aAAa,CAAC,CAAC,CAAC,UAAU,KAAK,CAAC,EAAE,CAAC;QAC1C,MAAM,OAAO,GAAG,EAAE,GAAG,aAAa,CAAC,CAAC,CAAC,UAAU,CAAC;QAChD,OAAO,GAAG,OAAO,IAAI,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC;IAC9D,CAAC;IAED,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,GAAG,IAAI,CAAC,CAAC;IACtC,OAAO,GAAG,OAAO,IAAI,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC;AAC9D,CAAC"}
|
package/dist/utils/logger.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Logger configuration using Winston
|
|
3
|
-
*/
|
|
4
|
-
import winston from "winston";
|
|
5
|
-
import { DebugSubsystem } from './debug.js';
|
|
6
|
-
export declare const logger: winston.Logger;
|
|
7
|
-
export declare function configureFileLogging(logDir: string): void;
|
|
8
|
-
export declare function createLogger(component: string, subsystem?: DebugSubsystem): winston.Logger;
|
|
9
|
-
export default logger;
|
|
10
|
-
//# sourceMappingURL=logger.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/utils/logger.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,OAAO,MAAM,SAAS,CAAC;AAE9B,OAAO,EACL,cAAc,EAGf,MAAM,YAAY,CAAC;AAiGpB,eAAO,MAAM,MAAM,gBAUjB,CAAC;AAGH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAkCzD;AAGD,wBAAgB,YAAY,CAC1B,SAAS,EAAE,MAAM,EACjB,SAAS,CAAC,EAAE,cAAc,GACzB,OAAO,CAAC,MAAM,CAIhB;AAeD,eAAe,MAAM,CAAC"}
|
package/dist/utils/logger.js
DELETED
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Logger configuration using Winston
|
|
3
|
-
*/
|
|
4
|
-
import winston from "winston";
|
|
5
|
-
import path from "path";
|
|
6
|
-
import { getDebugConfig, isDebugEnabledFor, } from './debug.js';
|
|
7
|
-
// Custom log levels
|
|
8
|
-
const levels = {
|
|
9
|
-
error: 0,
|
|
10
|
-
warn: 1,
|
|
11
|
-
info: 2,
|
|
12
|
-
http: 3,
|
|
13
|
-
verbose: 4,
|
|
14
|
-
debug: 5,
|
|
15
|
-
silly: 6,
|
|
16
|
-
};
|
|
17
|
-
// Log colors
|
|
18
|
-
const colors = {
|
|
19
|
-
error: "red",
|
|
20
|
-
warn: "yellow",
|
|
21
|
-
info: "green",
|
|
22
|
-
http: "magenta",
|
|
23
|
-
verbose: "cyan",
|
|
24
|
-
debug: "blue",
|
|
25
|
-
silly: "gray",
|
|
26
|
-
};
|
|
27
|
-
winston.addColors(colors);
|
|
28
|
-
// Use a getter function so debug state is checked at call time, not module load time
|
|
29
|
-
function isDebugEnabled() {
|
|
30
|
-
return getDebugConfig().enabled;
|
|
31
|
-
}
|
|
32
|
-
const componentSubsystemMap = {
|
|
33
|
-
MessageHandler: "rpc",
|
|
34
|
-
RunnerApp: "runner",
|
|
35
|
-
SSEClient: "sse",
|
|
36
|
-
RunnerAPIClient: "rpc",
|
|
37
|
-
ConfigManager: "runner",
|
|
38
|
-
StateManager: "state",
|
|
39
|
-
MessageFlow: "messages",
|
|
40
|
-
};
|
|
41
|
-
function resolveSubsystem(value) {
|
|
42
|
-
if (value && typeof value === "string") {
|
|
43
|
-
return value.toLowerCase();
|
|
44
|
-
}
|
|
45
|
-
return "runner";
|
|
46
|
-
}
|
|
47
|
-
const subsystemFilter = winston.format((info) => {
|
|
48
|
-
if (info.level !== "debug")
|
|
49
|
-
return info;
|
|
50
|
-
const subsystem = resolveSubsystem(info.subsystem || info.component);
|
|
51
|
-
return isDebugEnabledFor(subsystem) ? info : false;
|
|
52
|
-
});
|
|
53
|
-
// Format for console output
|
|
54
|
-
const consoleFormat = winston.format.combine(subsystemFilter(), winston.format.colorize({ all: true }), winston.format.timestamp({ format: "YYYY-MM-DD HH:mm:ss" }), winston.format.printf(({ timestamp, level, message, stack, component, subsystem, ...metadata }) => {
|
|
55
|
-
const scopeParts = [subsystem, component].filter(Boolean);
|
|
56
|
-
const scope = scopeParts.length ? ` ${scopeParts.join('/')}` : "";
|
|
57
|
-
let msg = `${timestamp} [${level}]${scope}: ${message}`;
|
|
58
|
-
// Only show stack traces and metadata in debug mode
|
|
59
|
-
if (isDebugEnabled()) {
|
|
60
|
-
if (stack) {
|
|
61
|
-
msg += `\n${stack}`;
|
|
62
|
-
}
|
|
63
|
-
const filteredMetadata = { ...metadata };
|
|
64
|
-
delete filteredMetadata["component"];
|
|
65
|
-
delete filteredMetadata["subsystem"];
|
|
66
|
-
if (Object.keys(filteredMetadata).length > 0) {
|
|
67
|
-
msg += ` ${JSON.stringify(filteredMetadata)}`;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
return msg;
|
|
71
|
-
}));
|
|
72
|
-
// Format for file output
|
|
73
|
-
const fileFormat = winston.format.combine(subsystemFilter(), winston.format.timestamp({ format: "YYYY-MM-DD HH:mm:ss" }), winston.format.errors({ stack: true }), winston.format.json());
|
|
74
|
-
// Create logger instance
|
|
75
|
-
// Set level to debug unconditionally - the subsystemFilter will decide what to actually output
|
|
76
|
-
// This avoids issues with env vars not being set at module load time
|
|
77
|
-
export const logger = winston.createLogger({
|
|
78
|
-
level: "debug",
|
|
79
|
-
levels,
|
|
80
|
-
transports: [
|
|
81
|
-
// Console transport set to debug - subsystemFilter handles the actual filtering
|
|
82
|
-
new winston.transports.Console({
|
|
83
|
-
format: consoleFormat,
|
|
84
|
-
level: "debug",
|
|
85
|
-
}),
|
|
86
|
-
],
|
|
87
|
-
});
|
|
88
|
-
// Add file transports if log directory is configured
|
|
89
|
-
export function configureFileLogging(logDir) {
|
|
90
|
-
// Error log file
|
|
91
|
-
logger.add(new winston.transports.File({
|
|
92
|
-
filename: path.join(logDir, "error.log"),
|
|
93
|
-
level: "error",
|
|
94
|
-
format: fileFormat,
|
|
95
|
-
maxsize: 10 * 1024 * 1024, // 10MB
|
|
96
|
-
maxFiles: 5,
|
|
97
|
-
}));
|
|
98
|
-
// Combined log file
|
|
99
|
-
logger.add(new winston.transports.File({
|
|
100
|
-
filename: path.join(logDir, "combined.log"),
|
|
101
|
-
format: fileFormat,
|
|
102
|
-
maxsize: 50 * 1024 * 1024, // 50MB
|
|
103
|
-
maxFiles: 10,
|
|
104
|
-
}));
|
|
105
|
-
// Debug log file (only in debug mode)
|
|
106
|
-
if (isDebugEnabled()) {
|
|
107
|
-
logger.add(new winston.transports.File({
|
|
108
|
-
filename: path.join(logDir, "debug.log"),
|
|
109
|
-
level: "debug",
|
|
110
|
-
format: fileFormat,
|
|
111
|
-
maxsize: 100 * 1024 * 1024, // 100MB
|
|
112
|
-
maxFiles: 3,
|
|
113
|
-
}));
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
// Create child logger for specific components
|
|
117
|
-
export function createLogger(component, subsystem) {
|
|
118
|
-
const resolvedSubsystem = subsystem || componentSubsystemMap[component] || "runner";
|
|
119
|
-
return logger.child({ component, subsystem: resolvedSubsystem });
|
|
120
|
-
}
|
|
121
|
-
// Log unhandled errors
|
|
122
|
-
// Route unhandled exceptions/rejections to the console so we don't litter local
|
|
123
|
-
// directories with log files when the runner boots.
|
|
124
|
-
const exceptionTransportOptions = { format: consoleFormat };
|
|
125
|
-
logger.exceptions.handle(new winston.transports.Console(exceptionTransportOptions));
|
|
126
|
-
logger.rejections.handle(new winston.transports.Console(exceptionTransportOptions));
|
|
127
|
-
// Export default logger
|
|
128
|
-
export default logger;
|
|
129
|
-
//# sourceMappingURL=logger.js.map
|
package/dist/utils/logger.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../../src/utils/logger.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,OAAO,MAAM,SAAS,CAAC;AAC9B,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAEL,cAAc,EACd,iBAAiB,GAClB,MAAM,YAAY,CAAC;AAEpB,oBAAoB;AACpB,MAAM,MAAM,GAAG;IACb,KAAK,EAAE,CAAC;IACR,IAAI,EAAE,CAAC;IACP,IAAI,EAAE,CAAC;IACP,IAAI,EAAE,CAAC;IACP,OAAO,EAAE,CAAC;IACV,KAAK,EAAE,CAAC;IACR,KAAK,EAAE,CAAC;CACT,CAAC;AAEF,aAAa;AACb,MAAM,MAAM,GAAG;IACb,KAAK,EAAE,KAAK;IACZ,IAAI,EAAE,QAAQ;IACd,IAAI,EAAE,OAAO;IACb,IAAI,EAAE,SAAS;IACf,OAAO,EAAE,MAAM;IACf,KAAK,EAAE,MAAM;IACb,KAAK,EAAE,MAAM;CACd,CAAC;AAEF,OAAO,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;AAE1B,qFAAqF;AACrF,SAAS,cAAc;IACrB,OAAO,cAAc,EAAE,CAAC,OAAO,CAAC;AAClC,CAAC;AAED,MAAM,qBAAqB,GAAmC;IAC5D,cAAc,EAAE,KAAK;IACrB,SAAS,EAAE,QAAQ;IACnB,SAAS,EAAE,KAAK;I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AS,EAAE,SAAS,EAAE,iBAAiB,EAAE,CAAC,CAAC;AACnE,CAAC;AAED,uBAAuB;AACvB,gFAAgF;AAChF,oDAAoD;AACpD,MAAM,yBAAyB,GAAG,EAAE,MAAM,EAAE,aAAa,EAAW,CAAC;AAErE,MAAM,CAAC,UAAU,CAAC,MAAM,CACtB,IAAI,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,yBAAyB,CAAC,CAC1D,CAAC;AACF,MAAM,CAAC,UAAU,CAAC,MAAM,CACtB,IAAI,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,yBAAyB,CAAC,CAC1D,CAAC;AAEF,wBAAwB;AACxB,eAAe,MAAM,CAAC"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import type { JsonRpcMessage, RunnerMessage } from '../types/index.js';
|
|
2
|
-
export declare const MESSAGE_LOG_SEGMENT = 500;
|
|
3
|
-
export declare const messageFlowLogger: import("winston").Logger;
|
|
4
|
-
export declare const messagesDebugEnabled: () => boolean;
|
|
5
|
-
/**
|
|
6
|
-
* Trim a long string by keeping the first and last segments.
|
|
7
|
-
*/
|
|
8
|
-
export declare function trimStringForLog(value: string, segment?: number): string;
|
|
9
|
-
/**
|
|
10
|
-
* Recursively clone a payload for logging, trimming long string values when requested.
|
|
11
|
-
*/
|
|
12
|
-
export declare function clonePayloadForLog<T>(payload: T, options: {
|
|
13
|
-
trimLongStrings: boolean;
|
|
14
|
-
}): T;
|
|
15
|
-
/**
|
|
16
|
-
* Prepare a concise log entry for an incoming RunnerMessage.
|
|
17
|
-
*/
|
|
18
|
-
export declare function buildIncomingMessageLog(message: RunnerMessage): Record<string, unknown>;
|
|
19
|
-
/**
|
|
20
|
-
* Prepare a verbose log entry for an outgoing JsonRpcMessage.
|
|
21
|
-
*/
|
|
22
|
-
export declare function buildOutgoingMessageLog(message: JsonRpcMessage): Record<string, unknown>;
|
|
23
|
-
//# sourceMappingURL=message-log.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"message-log.d.ts","sourceRoot":"","sources":["../../src/utils/message-log.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAGvE,eAAO,MAAM,mBAAmB,MAAM,CAAC;AAGvC,eAAO,MAAM,iBAAiB,0BAA0C,CAAC;AACzE,eAAO,MAAM,oBAAoB,QAAO,OAAwC,CAAC;AAEjF;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,GAAE,MAA4B,GAAG,MAAM,CAI7F;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,EAAE;IAAE,eAAe,EAAE,OAAO,CAAA;CAAE,GAAG,CAAC,CA0B1F;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAWvF;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CASxF"}
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import { createLogger } from './logger.js';
|
|
2
|
-
import { isDebugEnabledFor } from './debug.js';
|
|
3
|
-
// Limit used when trimming long content fields
|
|
4
|
-
export const MESSAGE_LOG_SEGMENT = 500;
|
|
5
|
-
// Shared logger + flag for message flow tracing
|
|
6
|
-
export const messageFlowLogger = createLogger("MessageFlow", "messages");
|
|
7
|
-
export const messagesDebugEnabled = () => isDebugEnabledFor("messages");
|
|
8
|
-
/**
|
|
9
|
-
* Trim a long string by keeping the first and last segments.
|
|
10
|
-
*/
|
|
11
|
-
export function trimStringForLog(value, segment = MESSAGE_LOG_SEGMENT) {
|
|
12
|
-
if (value.length <= segment * 2)
|
|
13
|
-
return value;
|
|
14
|
-
const omitted = value.length - segment * 2;
|
|
15
|
-
return `${value.slice(0, segment)}...[${omitted} chars trimmed]...${value.slice(-segment)}`;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Recursively clone a payload for logging, trimming long string values when requested.
|
|
19
|
-
*/
|
|
20
|
-
export function clonePayloadForLog(payload, options) {
|
|
21
|
-
if (!options.trimLongStrings) {
|
|
22
|
-
return payload;
|
|
23
|
-
}
|
|
24
|
-
const clone = (value) => {
|
|
25
|
-
if (typeof value === "string") {
|
|
26
|
-
return trimStringForLog(value);
|
|
27
|
-
}
|
|
28
|
-
if (Array.isArray(value)) {
|
|
29
|
-
return value.map(clone);
|
|
30
|
-
}
|
|
31
|
-
if (value && typeof value === "object") {
|
|
32
|
-
const result = {};
|
|
33
|
-
for (const [key, val] of Object.entries(value)) {
|
|
34
|
-
result[key] = clone(val);
|
|
35
|
-
}
|
|
36
|
-
return result;
|
|
37
|
-
}
|
|
38
|
-
return value;
|
|
39
|
-
};
|
|
40
|
-
return clone(payload);
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* Prepare a concise log entry for an incoming RunnerMessage.
|
|
44
|
-
*/
|
|
45
|
-
export function buildIncomingMessageLog(message) {
|
|
46
|
-
return {
|
|
47
|
-
direction: message.direction,
|
|
48
|
-
messageId: message.id,
|
|
49
|
-
method: message.payload?.method,
|
|
50
|
-
taskId: message.taskId,
|
|
51
|
-
conversationId: message.conversationId || message.payload?.params?.conversationId || null,
|
|
52
|
-
workspaceId: message.workspaceId,
|
|
53
|
-
payload: clonePayloadForLog(message.payload, { trimLongStrings: true }),
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
/**
|
|
57
|
-
* Prepare a verbose log entry for an outgoing JsonRpcMessage.
|
|
58
|
-
*/
|
|
59
|
-
export function buildOutgoingMessageLog(message) {
|
|
60
|
-
return {
|
|
61
|
-
direction: "to_orchestrator",
|
|
62
|
-
method: message.method,
|
|
63
|
-
id: message.id,
|
|
64
|
-
params: message.params,
|
|
65
|
-
result: message.result,
|
|
66
|
-
error: message.error,
|
|
67
|
-
};
|
|
68
|
-
}
|
|
69
|
-
//# sourceMappingURL=message-log.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"message-log.js","sourceRoot":"","sources":["../../src/utils/message-log.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAG/C,+CAA+C;AAC/C,MAAM,CAAC,MAAM,mBAAmB,GAAG,GAAG,CAAC;AAEvC,gDAAgD;AAChD,MAAM,CAAC,MAAM,iBAAiB,GAAG,YAAY,CAAC,aAAa,EAAE,UAAU,CAAC,CAAC;AACzE,MAAM,CAAC,MAAM,oBAAoB,GAAG,GAAY,EAAE,CAAC,iBAAiB,CAAC,UAAU,CAAC,CAAC;AAEjF;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAAC,KAAa,EAAE,UAAkB,mBAAmB;IACnF,IAAI,KAAK,CAAC,MAAM,IAAI,OAAO,GAAG,CAAC;QAAE,OAAO,KAAK,CAAC;IAC9C,MAAM,OAAO,GAAG,KAAK,CAAC,MAAM,GAAG,OAAO,GAAG,CAAC,CAAC;IAC3C,OAAO,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,OAAO,CAAC,OAAO,OAAO,qBAAqB,KAAK,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;AAC9F,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,kBAAkB,CAAI,OAAU,EAAE,OAAqC;IACrF,IAAI,CAAC,OAAO,CAAC,eAAe,EAAE,CAAC;QAC7B,OAAO,OAAO,CAAC;IACjB,CAAC;IAED,MAAM,KAAK,GAAG,CAAC,KAAU,EAAO,EAAE;QAChC,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;YAC9B,OAAO,gBAAgB,CAAC,KAAK,CAAC,CAAC;QACjC,CAAC;QAED,IAA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M;QACtB,KAAK,EAAE,OAAO,CAAC,KAAK;KACrB,CAAC;AACJ,CAAC"}
|
package/dist/utils/model.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { ModelReasoningEffort as CodexModelReasoningEffort } from "@northflare/codex-sdk";
|
|
2
|
-
export type ModelReasoningEffort = "low" | "medium" | "high" | "xhigh";
|
|
3
|
-
export declare function parseModelValue(value?: string | null): {
|
|
4
|
-
baseModel?: string;
|
|
5
|
-
reasoningEffort?: ModelReasoningEffort;
|
|
6
|
-
};
|
|
7
|
-
export declare function mapReasoningEffortForCodex(effort?: ModelReasoningEffort): CodexModelReasoningEffort | undefined;
|
|
8
|
-
//# sourceMappingURL=model.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../../src/utils/model.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,IAAI,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AAE/F,MAAM,MAAM,oBAAoB,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAC;AASvE,wBAAgB,eAAe,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG;IACtD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,eAAe,CAAC,EAAE,oBAAoB,CAAC;CACxC,CAiBA;AAED,wBAAgB,0BAA0B,CACxC,MAAM,CAAC,EAAE,oBAAoB,GAC5B,yBAAyB,GAAG,SAAS,CAgBvC"}
|
package/dist/utils/model.js
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
const REASONING_VALUES = [
|
|
2
|
-
"low",
|
|
3
|
-
"medium",
|
|
4
|
-
"high",
|
|
5
|
-
"xhigh",
|
|
6
|
-
];
|
|
7
|
-
export function parseModelValue(value) {
|
|
8
|
-
if (!value) {
|
|
9
|
-
return {};
|
|
10
|
-
}
|
|
11
|
-
const [model, possibleEffort] = value.split(":");
|
|
12
|
-
if (possibleEffort &&
|
|
13
|
-
REASONING_VALUES.includes(possibleEffort)) {
|
|
14
|
-
return {
|
|
15
|
-
baseModel: model,
|
|
16
|
-
reasoningEffort: possibleEffort,
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
return { baseModel: value };
|
|
20
|
-
}
|
|
21
|
-
export function mapReasoningEffortForCodex(effort) {
|
|
22
|
-
if (!effort) {
|
|
23
|
-
return undefined;
|
|
24
|
-
}
|
|
25
|
-
switch (effort) {
|
|
26
|
-
case "xhigh":
|
|
27
|
-
// Pass xhigh through directly - Codex SDK now supports it
|
|
28
|
-
return "xhigh";
|
|
29
|
-
case "low":
|
|
30
|
-
case "medium":
|
|
31
|
-
case "high":
|
|
32
|
-
return effort;
|
|
33
|
-
default:
|
|
34
|
-
return undefined;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
//# sourceMappingURL=model.js.map
|
package/dist/utils/model.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"model.js","sourceRoot":"","sources":["../../src/utils/model.ts"],"names":[],"mappings":"AAIA,MAAM,gBAAgB,GAAoC;IACxD,KAAK;IACL,QAAQ;IACR,MAAM;IACN,OAAO;CACR,CAAC;AAEF,MAAM,UAAU,eAAe,CAAC,KAAqB;IAInD,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,MAAM,CAAC,KAAK,EAAE,cAAc,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACjD,IACE,cAAc;QACd,gBAAgB,CAAC,QAAQ,CAAC,cAAsC,CAAC,EACjE,CAAC;QACD,OAAO;YACL,SAAS,EAAE,KAAK;YAChB,eAAe,EAAE,cAAsC;SACxD,CAAC;IACJ,CAAC;IAED,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;AAC9B,CAAC;AAED,MAAM,UAAU,0BAA0B,CACxC,MAA6B;IAE7B,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,QAAQ,MAAM,EAAE,CAAC;QACf,KAAK,OAAO;YACV,0DAA0D;YAC1D,OAAO,OAAO,CAAC;QACjB,KAAK,KAAK,CAAC;QACX,KAAK,QAAQ,CAAC;QACd,KAAK,MAAM;YACT,OAAO,MAAM,CAAC;QAChB;YACE,OAAO,SAAS,CAAC;IACrB,CAAC;AACH,CAAC"}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
export declare class StatusLineManager {
|
|
2
|
-
private intervalId?;
|
|
3
|
-
private alignTimeoutId?;
|
|
4
|
-
private activeCount;
|
|
5
|
-
private lastLine;
|
|
6
|
-
private isEnabledCached;
|
|
7
|
-
constructor();
|
|
8
|
-
/**
|
|
9
|
-
* Check if status line is enabled (only enabled when not in debug mode)
|
|
10
|
-
*/
|
|
11
|
-
private get isEnabled();
|
|
12
|
-
/**
|
|
13
|
-
* Updates the count of active conversations
|
|
14
|
-
*/
|
|
15
|
-
updateActiveCount(count: number): void;
|
|
16
|
-
/**
|
|
17
|
-
* Starts the status line interval
|
|
18
|
-
*/
|
|
19
|
-
private startInterval;
|
|
20
|
-
/**
|
|
21
|
-
* Stops the status line interval
|
|
22
|
-
*/
|
|
23
|
-
private stopInterval;
|
|
24
|
-
/**
|
|
25
|
-
* Shows the current status
|
|
26
|
-
*/
|
|
27
|
-
private showStatus;
|
|
28
|
-
/**
|
|
29
|
-
* Cleans up the status line manager
|
|
30
|
-
*/
|
|
31
|
-
dispose(): void;
|
|
32
|
-
}
|
|
33
|
-
export declare const statusLineManager: StatusLineManager;
|
|
34
|
-
//# sourceMappingURL=status-line.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"status-line.d.ts","sourceRoot":"","sources":["../../src/utils/status-line.ts"],"names":[],"mappings":"AAUA,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,UAAU,CAAC,CAAiB;IACpC,OAAO,CAAC,cAAc,CAAC,CAAiB;IACxC,OAAO,CAAC,WAAW,CAAa;IAChC,OAAO,CAAC,QAAQ,CAAc;IAC9B,OAAO,CAAC,eAAe,CAAwB;;IAO/C;;OAEG;IACH,OAAO,KAAK,SAAS,GAMpB;IAED;;OAEG;IACH,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAqBtC;;OAEG;IACH,OAAO,CAAC,aAAa;IAmBrB;;OAEG;IACH,OAAO,CAAC,YAAY;IAWpB;;OAEG;IACH,OAAO,CAAC,UAAU;IAmClB;;OAEG;IACH,OAAO,IAAI,IAAI;CAOhB;AAGD,eAAO,MAAM,iBAAiB,mBAA0B,CAAC"}
|
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* StatusLineManager - Manages persistent status line output for active agent processes
|
|
3
|
-
*
|
|
4
|
-
* This component maintains a single-line status output that updates every minute to show
|
|
5
|
-
* the count of active agent processes. It prevents the machine from entering idle
|
|
6
|
-
* state while processes are running and provides clear visual feedback without cluttering
|
|
7
|
-
* the terminal with multiple log lines.
|
|
8
|
-
*/
|
|
9
|
-
import { isRunnerDebugEnabled } from './debug.js';
|
|
10
|
-
export class StatusLineManager {
|
|
11
|
-
intervalId;
|
|
12
|
-
alignTimeoutId;
|
|
13
|
-
activeCount = 0;
|
|
14
|
-
lastLine = "";
|
|
15
|
-
isEnabledCached = null;
|
|
16
|
-
constructor() {
|
|
17
|
-
// Don't cache debug state here - defer until first use
|
|
18
|
-
// This allows env vars to be set after module load
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Check if status line is enabled (only enabled when not in debug mode)
|
|
22
|
-
*/
|
|
23
|
-
get isEnabled() {
|
|
24
|
-
// Cache on first call, after env vars have been set
|
|
25
|
-
if (this.isEnabledCached === null) {
|
|
26
|
-
this.isEnabledCached = !isRunnerDebugEnabled();
|
|
27
|
-
}
|
|
28
|
-
return this.isEnabledCached;
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Updates the count of active conversations
|
|
32
|
-
*/
|
|
33
|
-
updateActiveCount(count) {
|
|
34
|
-
const previousCount = this.activeCount;
|
|
35
|
-
const wasZero = previousCount === 0;
|
|
36
|
-
const isZero = count === 0;
|
|
37
|
-
const countChanged = count !== previousCount;
|
|
38
|
-
this.activeCount = count;
|
|
39
|
-
// Start interval when transitioning from 0 to active
|
|
40
|
-
if (wasZero && !isZero) {
|
|
41
|
-
this.startInterval();
|
|
42
|
-
}
|
|
43
|
-
// Stop interval when transitioning to 0
|
|
44
|
-
else if (!wasZero && isZero) {
|
|
45
|
-
this.stopInterval();
|
|
46
|
-
}
|
|
47
|
-
if (countChanged) {
|
|
48
|
-
this.showStatus();
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* Starts the status line interval
|
|
53
|
-
*/
|
|
54
|
-
startInterval() {
|
|
55
|
-
if (!this.isEnabled || this.intervalId || this.alignTimeoutId)
|
|
56
|
-
return;
|
|
57
|
-
// Update every minute on the minute
|
|
58
|
-
const now = new Date();
|
|
59
|
-
const msUntilNextMinute = (60 - now.getSeconds()) * 1000 - now.getMilliseconds();
|
|
60
|
-
// First timeout to align with the minute
|
|
61
|
-
this.alignTimeoutId = setTimeout(() => {
|
|
62
|
-
this.alignTimeoutId = undefined;
|
|
63
|
-
this.showStatus();
|
|
64
|
-
// Then set up regular interval
|
|
65
|
-
this.intervalId = setInterval(() => {
|
|
66
|
-
this.showStatus();
|
|
67
|
-
}, 60000); // Every 60 seconds
|
|
68
|
-
}, msUntilNextMinute);
|
|
69
|
-
}
|
|
70
|
-
/**
|
|
71
|
-
* Stops the status line interval
|
|
72
|
-
*/
|
|
73
|
-
stopInterval() {
|
|
74
|
-
if (this.alignTimeoutId) {
|
|
75
|
-
clearTimeout(this.alignTimeoutId);
|
|
76
|
-
this.alignTimeoutId = undefined;
|
|
77
|
-
}
|
|
78
|
-
if (this.intervalId) {
|
|
79
|
-
clearInterval(this.intervalId);
|
|
80
|
-
this.intervalId = undefined;
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
/**
|
|
84
|
-
* Shows the current status
|
|
85
|
-
*/
|
|
86
|
-
showStatus() {
|
|
87
|
-
if (!this.isEnabled)
|
|
88
|
-
return;
|
|
89
|
-
const now = new Date();
|
|
90
|
-
const timeStr = now.toTimeString().slice(0, 5); // HH:MM format
|
|
91
|
-
if (this.activeCount === 0) {
|
|
92
|
-
if (this.lastLine) {
|
|
93
|
-
process.stdout.write('\r' + ' '.repeat(this.lastLine.length) + '\r');
|
|
94
|
-
this.lastLine = "";
|
|
95
|
-
}
|
|
96
|
-
return;
|
|
97
|
-
}
|
|
98
|
-
let newLine;
|
|
99
|
-
if (this.activeCount === 1) {
|
|
100
|
-
newLine = `${timeStr} 1 active agent process`;
|
|
101
|
-
}
|
|
102
|
-
else {
|
|
103
|
-
newLine = `${timeStr} ${this.activeCount} active agent processes`;
|
|
104
|
-
}
|
|
105
|
-
// If this is the first status line, position it
|
|
106
|
-
if (!this.lastLine) {
|
|
107
|
-
// Move to start of line and save cursor position
|
|
108
|
-
process.stdout.write('\r');
|
|
109
|
-
}
|
|
110
|
-
else {
|
|
111
|
-
// Clear the current line
|
|
112
|
-
process.stdout.write('\r' + ' '.repeat(this.lastLine.length) + '\r');
|
|
113
|
-
}
|
|
114
|
-
// Write the new status without newline
|
|
115
|
-
process.stdout.write(newLine);
|
|
116
|
-
this.lastLine = newLine;
|
|
117
|
-
}
|
|
118
|
-
/**
|
|
119
|
-
* Cleans up the status line manager
|
|
120
|
-
*/
|
|
121
|
-
dispose() {
|
|
122
|
-
this.stopInterval();
|
|
123
|
-
// Add a newline to ensure next output starts on a new line
|
|
124
|
-
if (this.lastLine) {
|
|
125
|
-
process.stdout.write('\n');
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
// Singleton instance
|
|
130
|
-
export const statusLineManager = new StatusLineManager();
|
|
131
|
-
//# sourceMappingURL=status-line.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"status-line.js","sourceRoot":"","sources":["../../src/utils/status-line.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAElD,MAAM,OAAO,iBAAiB;IACpB,UAAU,CAAkB;IAC5B,cAAc,CAAkB;IAChC,WAAW,GAAW,CAAC,CAAC;IACxB,QAAQ,GAAW,EAAE,CAAC;IACtB,eAAe,GAAmB,IAAI,CAAC;IAE/C;QACE,uDAAuD;QACvD,mDAAmD;IACrD,CAAC;IAED;;OAEG;IACH,IAAY,SAAS;QACnB,oDAAoD;QACpD,IAAI,IAAI,CAAC,eAAe,KAAK,IAAI,EAAE,CAAC;YAClC,IAAI,CAAC,eAAe,GAAG,CAAC,oBAAoB,EAAE,CAAC;QACjD,CAAC;QACD,OAAO,IAAI,CAAC,eAAe,CAAC;IAC9B,CAAC;IAED;;OAEG;IACH,iBAAiB,CAAC,KAAa;QAC7B,MAAM,aAAa,GAAG,IAAI,CAAC,WAAW,CAAC;QACvC,MAAM,OAAO,GAAG,aAAa,KAAK,CAAC,CAAC;QACpC,MAAM,MAAM,GAAG,KAAK,KAAK,CAAC,CAAC;QAC3B,MAAM,YAAY,GAAG,KAAK,KAAK,aAAa,CAAC;QAC7C,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC;QAEzB,qDAAqD;QACrD,IAAI,OAAO,IAAI,CAAC,MAAM,EAAE,CAAC;YACvB,IAAI,CAAC,aAAa,EAAE,CAAC;QACvB,CAAC;QACD,wCAAwC;aACnC,IAAI,CAAC,OAAO,IAAI,MAAM,EAAE,CAAC;YAC5B,IAAI,CAAC,YAAY,EAAE,CAAC;QACtB,CAAC;QAED,IAAI,YAAY,EAAE,CAAC;YACjB,IAAI,CAAC,UAAU,EAAE,CAAC;QACpB,CAAC;IACH,CAAC;IAED;;OAEG;IACK,aAAa;QACnB,IAAI,CAAC,IAAI,C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-1,9 +0,0 @@
|
|
|
1
|
-
export declare const TOOL_RESPONSE_BYTE_LIMIT: number;
|
|
2
|
-
export declare const TOOL_RESPONSE_SUFFIX = "... [truncated]";
|
|
3
|
-
export interface ToolResponseSanitizationResult {
|
|
4
|
-
params: any;
|
|
5
|
-
truncated: boolean;
|
|
6
|
-
toolUseId?: string;
|
|
7
|
-
}
|
|
8
|
-
export declare function sanitizeToolResponsePayload(method: string | undefined, params: any): ToolResponseSanitizationResult;
|
|
9
|
-
//# sourceMappingURL=tool-response-sanitizer.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tool-response-sanitizer.d.ts","sourceRoot":"","sources":["../../src/utils/tool-response-sanitizer.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,wBAAwB,QAAa,CAAC;AACnD,eAAO,MAAM,oBAAoB,oBAAoB,CAAC;AAEtD,MAAM,WAAW,8BAA8B;IAC7C,MAAM,EAAE,GAAG,CAAC;IACZ,SAAS,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAOD,wBAAgB,2BAA2B,CACzC,MAAM,EAAE,MAAM,GAAG,SAAS,EAC1B,MAAM,EAAE,GAAG,GACV,8BAA8B,CAyBhC"}
|