@skj1724/oh-my-opencode 3.19.4 → 3.19.5
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/oh-my-opencode.js +39 -32
- package/dist/cli/index.js +21 -2
- package/dist/config/schema.d.ts +30 -0
- package/dist/features/background-agent/manager.d.ts +3 -0
- package/dist/features/hook-message-injector/injector.d.ts +0 -6
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/perf-profiler/index.d.ts +2 -0
- package/dist/hooks/perf-profiler/index.test.d.ts +1 -0
- package/dist/hooks/perf-profiler/types.d.ts +42 -0
- package/dist/hooks/think-mode/index.d.ts +26 -2
- package/dist/hooks/think-mode/types.d.ts +14 -12
- package/dist/index.js +1173 -737
- package/dist/shared/fileio-monitor.d.ts +10 -0
- package/dist/shared/fileio-monitor.test.d.ts +1 -0
- package/dist/shared/index.d.ts +2 -0
- package/dist/shared/perf-tracer.d.ts +73 -0
- package/dist/shared/perf-tracer.test.d.ts +1 -0
- package/dist/tools/perf-profiler/client-patch.d.ts +2 -0
- package/package.json +1 -1
- package/postinstall.mjs +20 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { PerfTracer } from "./perf-tracer";
|
|
2
|
+
export interface FileIOMonitor {
|
|
3
|
+
readdirSync(path: string): string[];
|
|
4
|
+
readFileSync(path: string, options?: any): string | Buffer;
|
|
5
|
+
writeFileSync(path: string, data: any, options?: any): void;
|
|
6
|
+
existsSync(path: string): boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare function setFileIOMonitor(monitor: FileIOMonitor | null): void;
|
|
9
|
+
export declare function getFileIOMonitor(): FileIOMonitor | null;
|
|
10
|
+
export declare function createFileIOMonitor(tracer: PerfTracer): FileIOMonitor;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/shared/index.d.ts
CHANGED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
export interface HookSpan {
|
|
2
|
+
t: string;
|
|
3
|
+
type: "hook";
|
|
4
|
+
pipeline: "event" | "tool.execute.before" | "tool.execute.after" | "chat.message";
|
|
5
|
+
hook: string;
|
|
6
|
+
durationMs: number;
|
|
7
|
+
sessionID: string;
|
|
8
|
+
tool?: string;
|
|
9
|
+
error?: string;
|
|
10
|
+
}
|
|
11
|
+
export interface PipelineSpan {
|
|
12
|
+
t: string;
|
|
13
|
+
type: "pipeline";
|
|
14
|
+
name: "event" | "tool.execute.before" | "tool.execute.after" | "chat.message";
|
|
15
|
+
totalDurationMs: number;
|
|
16
|
+
hookCount: number;
|
|
17
|
+
sessionID: string;
|
|
18
|
+
}
|
|
19
|
+
export interface ApiCallSpan {
|
|
20
|
+
t: string;
|
|
21
|
+
type: "api";
|
|
22
|
+
method: string;
|
|
23
|
+
durationMs: number;
|
|
24
|
+
sessionID: string;
|
|
25
|
+
messageCount?: number;
|
|
26
|
+
error?: string;
|
|
27
|
+
}
|
|
28
|
+
export interface FileIOSpan {
|
|
29
|
+
t: string;
|
|
30
|
+
type: "fileio";
|
|
31
|
+
operation: string;
|
|
32
|
+
path: string;
|
|
33
|
+
durationMs: number;
|
|
34
|
+
fileCount?: number;
|
|
35
|
+
}
|
|
36
|
+
export interface PollingSpan {
|
|
37
|
+
t: string;
|
|
38
|
+
type: "polling";
|
|
39
|
+
durationMs: number;
|
|
40
|
+
taskCount: number;
|
|
41
|
+
sessionCount: number;
|
|
42
|
+
}
|
|
43
|
+
export interface MemorySnapshot {
|
|
44
|
+
t: string;
|
|
45
|
+
type: "memory";
|
|
46
|
+
trigger: string;
|
|
47
|
+
mapSizes: Record<string, number>;
|
|
48
|
+
}
|
|
49
|
+
export type PerfSpan = HookSpan | PipelineSpan | ApiCallSpan | FileIOSpan | PollingSpan | MemorySnapshot;
|
|
50
|
+
export declare class PerfTracer {
|
|
51
|
+
private buffer;
|
|
52
|
+
private enabled;
|
|
53
|
+
private outputDir;
|
|
54
|
+
private slowThreshold;
|
|
55
|
+
private eventCount;
|
|
56
|
+
private memorySnapshotInterval;
|
|
57
|
+
constructor(config: {
|
|
58
|
+
enabled: boolean;
|
|
59
|
+
outputDir?: string;
|
|
60
|
+
slowThreshold?: number;
|
|
61
|
+
memorySnapshotInterval?: number;
|
|
62
|
+
});
|
|
63
|
+
isEnabled(): boolean;
|
|
64
|
+
isSlowHook(durationMs: number): boolean;
|
|
65
|
+
recordHook(pipeline: string, hook: string, durationMs: number, sessionID: string, tool?: string, error?: string): void;
|
|
66
|
+
recordPipeline(name: string, totalDurationMs: number, hookCount: number, sessionID: string): void;
|
|
67
|
+
recordApiCall(method: string, durationMs: number, sessionID: string, messageCount?: number, error?: string): void;
|
|
68
|
+
recordFileIO(operation: string, path: string, durationMs: number, fileCount?: number): void;
|
|
69
|
+
recordPolling(durationMs: number, taskCount: number, sessionCount: number): void;
|
|
70
|
+
snapshotMemory(trigger: string, mapSizes: Record<string, number>): void;
|
|
71
|
+
flush(): void;
|
|
72
|
+
reset(): void;
|
|
73
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@skj1724/oh-my-opencode",
|
|
3
|
-
"version": "3.19.
|
|
3
|
+
"version": "3.19.5",
|
|
4
4
|
"description": "The Best AI Agent Harness - Batteries-Included OpenCode Plugin with Multi-Model Orchestration, Parallel Background Agents, and Crafted LSP/AST Tools",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
package/postinstall.mjs
CHANGED
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
// Runs after npm install to verify platform binary is available
|
|
3
3
|
|
|
4
4
|
import { createRequire } from "node:module";
|
|
5
|
+
import { existsSync } from "node:fs";
|
|
6
|
+
import { homedir } from "node:os";
|
|
7
|
+
import { join } from "node:path";
|
|
5
8
|
import { getPlatformPackage, getBinaryPath } from "./bin/platform.js";
|
|
6
9
|
|
|
7
10
|
const require = createRequire(import.meta.url);
|
|
@@ -26,6 +29,23 @@ function main() {
|
|
|
26
29
|
const { platform, arch } = process;
|
|
27
30
|
const libcFamily = getLibcFamily();
|
|
28
31
|
|
|
32
|
+
// Check for conflicting Bun binary stub
|
|
33
|
+
const home = homedir();
|
|
34
|
+
const bunExe = platform === "win32" ? "oh-my-opencode.exe" : "oh-my-opencode";
|
|
35
|
+
const bunBinPath = join(home, ".bun", "bin", bunExe);
|
|
36
|
+
|
|
37
|
+
if (existsSync(bunBinPath)) {
|
|
38
|
+
console.warn(`⚠ oh-my-opencode: Detected Bun binary stub. This may conflict with the npm installation.`);
|
|
39
|
+
console.warn(` Stub location: ${bunBinPath}`);
|
|
40
|
+
console.warn(` To fix, remove the Bun stub:`);
|
|
41
|
+
if (platform === "win32") {
|
|
42
|
+
console.warn(` Remove-Item "${bunBinPath}"`);
|
|
43
|
+
} else {
|
|
44
|
+
console.warn(` rm "${bunBinPath}"`);
|
|
45
|
+
}
|
|
46
|
+
console.warn();
|
|
47
|
+
}
|
|
48
|
+
|
|
29
49
|
try {
|
|
30
50
|
const pkg = getPlatformPackage({ platform, arch, libcFamily });
|
|
31
51
|
const binPath = getBinaryPath(pkg, platform);
|