oh-my-opencode-unguarded 3.9.4 → 3.10.0

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/cli/index.js CHANGED
@@ -7109,11 +7109,14 @@ var init_constants = __esm(() => {
7109
7109
  });
7110
7110
 
7111
7111
  // src/features/hook-message-injector/injector.ts
7112
+ import { randomBytes } from "crypto";
7113
+ var processPrefix;
7112
7114
  var init_injector = __esm(() => {
7113
7115
  init_constants();
7114
7116
  init_logger();
7115
7117
  init_opencode_storage_detection();
7116
7118
  init_shared();
7119
+ processPrefix = randomBytes(4).toString("hex");
7117
7120
  });
7118
7121
 
7119
7122
  // src/features/hook-message-injector/index.ts
@@ -9329,7 +9332,7 @@ var {
9329
9332
  // package.json
9330
9333
  var package_default = {
9331
9334
  name: "oh-my-opencode-unguarded",
9332
- version: "3.9.4",
9335
+ version: "3.10.0",
9333
9336
  description: "The Best AI Agent Harness - Batteries-Included OpenCode Plugin with Multi-Model Orchestration, Parallel Background Agents, and Crafted LSP/AST Tools",
9334
9337
  main: "dist/index.js",
9335
9338
  types: "dist/index.d.ts",
@@ -9379,10 +9382,6 @@ var package_default = {
9379
9382
  url: "https://github.com/D4ch1au/evil-oh-my-opencode/issues"
9380
9383
  },
9381
9384
  homepage: "https://github.com/D4ch1au/evil-oh-my-opencode#readme",
9382
- publishConfig: {
9383
- registry: "https://registry.npmjs.org",
9384
- access: "public"
9385
- },
9386
9385
  dependencies: {
9387
9386
  "@ast-grep/cli": "^0.40.0",
9388
9387
  "@ast-grep/napi": "^0.40.0",
@@ -9408,23 +9407,27 @@ var package_default = {
9408
9407
  typescript: "^5.7.3"
9409
9408
  },
9410
9409
  optionalDependencies: {
9411
- "oh-my-opencode-darwin-arm64": "3.9.0",
9412
- "oh-my-opencode-darwin-x64": "3.9.0",
9413
- "oh-my-opencode-darwin-x64-baseline": "3.9.0",
9414
- "oh-my-opencode-linux-arm64": "3.9.0",
9415
- "oh-my-opencode-linux-arm64-musl": "3.9.0",
9416
- "oh-my-opencode-linux-x64": "3.9.0",
9417
- "oh-my-opencode-linux-x64-baseline": "3.9.0",
9418
- "oh-my-opencode-linux-x64-musl": "3.9.0",
9419
- "oh-my-opencode-linux-x64-musl-baseline": "3.9.0",
9420
- "oh-my-opencode-windows-x64": "3.9.0",
9421
- "oh-my-opencode-windows-x64-baseline": "3.9.0"
9410
+ "oh-my-opencode-darwin-arm64": "3.10.0",
9411
+ "oh-my-opencode-darwin-x64": "3.10.0",
9412
+ "oh-my-opencode-darwin-x64-baseline": "3.10.0",
9413
+ "oh-my-opencode-linux-arm64": "3.10.0",
9414
+ "oh-my-opencode-linux-arm64-musl": "3.10.0",
9415
+ "oh-my-opencode-linux-x64": "3.10.0",
9416
+ "oh-my-opencode-linux-x64-baseline": "3.10.0",
9417
+ "oh-my-opencode-linux-x64-musl": "3.10.0",
9418
+ "oh-my-opencode-linux-x64-musl-baseline": "3.10.0",
9419
+ "oh-my-opencode-windows-x64": "3.10.0",
9420
+ "oh-my-opencode-windows-x64-baseline": "3.10.0"
9422
9421
  },
9423
9422
  trustedDependencies: [
9424
9423
  "@ast-grep/cli",
9425
9424
  "@ast-grep/napi",
9426
9425
  "@code-yeongyu/comment-checker"
9427
- ]
9426
+ ],
9427
+ publishConfig: {
9428
+ registry: "https://registry.npmjs.org",
9429
+ access: "public"
9430
+ }
9428
9431
  };
9429
9432
 
9430
9433
  // src/cli/cli-installer.ts
@@ -28259,10 +28262,10 @@ async function findAvailablePort2(startPort = DEFAULT_PORT) {
28259
28262
 
28260
28263
  // src/features/mcp-oauth/oauth-authorization-flow.ts
28261
28264
  import { spawn as spawn2 } from "child_process";
28262
- import { createHash, randomBytes } from "crypto";
28265
+ import { createHash, randomBytes as randomBytes2 } from "crypto";
28263
28266
  import { createServer } from "http";
28264
28267
  function generateCodeVerifier() {
28265
- return randomBytes(32).toString("base64url");
28268
+ return randomBytes2(32).toString("base64url");
28266
28269
  }
28267
28270
  function generateCodeChallenge(verifier) {
28268
28271
  return createHash("sha256").update(verifier).digest("base64url");
@@ -28347,7 +28350,7 @@ function openBrowser(url2) {
28347
28350
  async function runAuthorizationCodeRedirect(options) {
28348
28351
  const verifier = generateCodeVerifier();
28349
28352
  const challenge = generateCodeChallenge(verifier);
28350
- const state = randomBytes(16).toString("hex");
28353
+ const state = randomBytes2(16).toString("hex");
28351
28354
  const authorizationUrl = buildAuthorizationUrl(options.authorizationEndpoint, {
28352
28355
  clientId: options.clientId,
28353
28356
  redirectUri: options.redirectUri,
package/dist/index.js CHANGED
@@ -18032,8 +18032,10 @@ function isAnyProviderConnected(providers, availableModels) {
18032
18032
  }
18033
18033
  // src/features/hook-message-injector/injector.ts
18034
18034
  import { existsSync as existsSync11, mkdirSync as mkdirSync4, readFileSync as readFileSync7, readdirSync, writeFileSync as writeFileSync4 } from "fs";
18035
+ import { randomBytes } from "crypto";
18035
18036
  import { join as join12 } from "path";
18036
18037
  init_logger();
18038
+ var processPrefix = randomBytes(4).toString("hex");
18037
18039
  function convertSDKMessageToStoredMessage(msg) {
18038
18040
  const info = msg.info;
18039
18041
  if (!info)
@@ -36667,6 +36669,7 @@ function isHookCommandDisabled(eventType, command, config2) {
36667
36669
 
36668
36670
  // src/hooks/claude-code-hooks/execute-http-hook.ts
36669
36671
  var DEFAULT_HTTP_HOOK_TIMEOUT_S = 30;
36672
+ var ALLOWED_SCHEMES = new Set(["http:", "https:"]);
36670
36673
  function interpolateEnvVars(value, allowedEnvVars) {
36671
36674
  const allowedSet = new Set(allowedEnvVars);
36672
36675
  return value.replace(/\$\{(\w+)\}|\$(\w+)/g, (_match, bracedVar, bareVar) => {
@@ -36690,6 +36693,17 @@ function resolveHeaders(hook) {
36690
36693
  return headers;
36691
36694
  }
36692
36695
  async function executeHttpHook(hook, stdin) {
36696
+ try {
36697
+ const parsed = new URL(hook.url);
36698
+ if (!ALLOWED_SCHEMES.has(parsed.protocol)) {
36699
+ return {
36700
+ exitCode: 1,
36701
+ stderr: `HTTP hook URL scheme "${parsed.protocol}" is not allowed. Only http: and https: are permitted.`
36702
+ };
36703
+ }
36704
+ } catch {
36705
+ return { exitCode: 1, stderr: `HTTP hook URL is invalid: ${hook.url}` };
36706
+ }
36693
36707
  const timeoutS = hook.timeout ?? DEFAULT_HTTP_HOOK_TIMEOUT_S;
36694
36708
  const headers = resolveHeaders(hook);
36695
36709
  try {
@@ -36779,8 +36793,9 @@ async function executeUserPromptSubmitHooks(ctx, config2, extendedConfig) {
36779
36793
  for (const hook of matcher.hooks) {
36780
36794
  if (hook.type !== "command" && hook.type !== "http")
36781
36795
  continue;
36782
- if (hook.type === "command" && isHookCommandDisabled("UserPromptSubmit", hook.command, extendedConfig ?? null)) {
36783
- log("UserPromptSubmit hook command skipped (disabled by config)", { command: hook.command });
36796
+ const hookName = getHookIdentifier(hook);
36797
+ if (isHookCommandDisabled("UserPromptSubmit", hookName, extendedConfig ?? null)) {
36798
+ log("UserPromptSubmit hook command skipped (disabled by config)", { command: hookName });
36784
36799
  continue;
36785
36800
  }
36786
36801
  const result = await dispatchHook(hook, JSON.stringify(stdinData), ctx.cwd);
@@ -37062,11 +37077,11 @@ async function executePreCompactHooks(ctx, config2, extendedConfig) {
37062
37077
  for (const hook of matcher.hooks) {
37063
37078
  if (hook.type !== "command" && hook.type !== "http")
37064
37079
  continue;
37065
- if (hook.type === "command" && isHookCommandDisabled("PreCompact", hook.command, extendedConfig ?? null)) {
37066
- log("PreCompact hook command skipped (disabled by config)", { command: hook.command });
37080
+ const hookName = getHookIdentifier(hook);
37081
+ if (isHookCommandDisabled("PreCompact", hookName, extendedConfig ?? null)) {
37082
+ log("PreCompact hook command skipped (disabled by config)", { command: hookName });
37067
37083
  continue;
37068
37084
  }
37069
- const hookName = getHookIdentifier(hook);
37070
37085
  if (!firstHookName)
37071
37086
  firstHookName = hookName;
37072
37087
  const result = await dispatchHook(hook, JSON.stringify(stdinData), ctx.cwd);
@@ -37169,8 +37184,9 @@ async function executeStopHooks(ctx, config2, extendedConfig) {
37169
37184
  for (const hook of matcher.hooks) {
37170
37185
  if (hook.type !== "command" && hook.type !== "http")
37171
37186
  continue;
37172
- if (hook.type === "command" && isHookCommandDisabled("Stop", hook.command, extendedConfig ?? null)) {
37173
- log("Stop hook command skipped (disabled by config)", { command: hook.command });
37187
+ const hookName = getHookIdentifier(hook);
37188
+ if (isHookCommandDisabled("Stop", hookName, extendedConfig ?? null)) {
37189
+ log("Stop hook command skipped (disabled by config)", { command: hookName });
37174
37190
  continue;
37175
37191
  }
37176
37192
  const result = await dispatchHook(hook, JSON.stringify(stdinData), ctx.cwd);
@@ -37324,11 +37340,11 @@ async function executePostToolUseHooks(ctx, config2, extendedConfig) {
37324
37340
  for (const hook of matcher.hooks) {
37325
37341
  if (hook.type !== "command" && hook.type !== "http")
37326
37342
  continue;
37327
- if (hook.type === "command" && isHookCommandDisabled("PostToolUse", hook.command, extendedConfig ?? null)) {
37328
- log("PostToolUse hook command skipped (disabled by config)", { command: hook.command, toolName: ctx.toolName });
37343
+ const hookName = getHookIdentifier(hook);
37344
+ if (isHookCommandDisabled("PostToolUse", hookName, extendedConfig ?? null)) {
37345
+ log("PostToolUse hook command skipped (disabled by config)", { command: hookName, toolName: ctx.toolName });
37329
37346
  continue;
37330
37347
  }
37331
- const hookName = getHookIdentifier(hook);
37332
37348
  if (!firstHookName)
37333
37349
  firstHookName = hookName;
37334
37350
  const result = await dispatchHook(hook, JSON.stringify(stdinData), ctx.cwd);
@@ -37561,11 +37577,11 @@ async function executePreToolUseHooks(ctx, config2, extendedConfig) {
37561
37577
  for (const hook of matcher.hooks) {
37562
37578
  if (hook.type !== "command" && hook.type !== "http")
37563
37579
  continue;
37564
- if (hook.type === "command" && isHookCommandDisabled("PreToolUse", hook.command, extendedConfig ?? null)) {
37565
- log("PreToolUse hook command skipped (disabled by config)", { command: hook.command, toolName: ctx.toolName });
37580
+ const hookName = getHookIdentifier(hook);
37581
+ if (isHookCommandDisabled("PreToolUse", hookName, extendedConfig ?? null)) {
37582
+ log("PreToolUse hook command skipped (disabled by config)", { command: hookName, toolName: ctx.toolName });
37566
37583
  continue;
37567
37584
  }
37568
- const hookName = getHookIdentifier(hook);
37569
37585
  if (!firstHookName)
37570
37586
  firstHookName = hookName;
37571
37587
  const result = await dispatchHook(hook, JSON.stringify(stdinData), ctx.cwd);
@@ -49955,6 +49971,8 @@ function extractBase64Data(imageData) {
49955
49971
  }
49956
49972
 
49957
49973
  // src/hooks/read-image-resizer/image-dimensions.ts
49974
+ var HEADER_BYTES = 32768;
49975
+ var HEADER_BASE64_CHARS = Math.ceil(HEADER_BYTES / 3) * 4;
49958
49976
  function toImageDimensions(width, height) {
49959
49977
  if (!Number.isFinite(width) || !Number.isFinite(height)) {
49960
49978
  return null;
@@ -50068,7 +50086,8 @@ function parseImageDimensions(base64DataUrl, mimeType) {
50068
50086
  if (!rawBase64) {
50069
50087
  return null;
50070
50088
  }
50071
- const buffer = Buffer.from(rawBase64, "base64");
50089
+ const headerBase64 = rawBase64.length > HEADER_BASE64_CHARS ? rawBase64.slice(0, HEADER_BASE64_CHARS) : rawBase64;
50090
+ const buffer = Buffer.from(headerBase64, "base64");
50072
50091
  if (buffer.length === 0) {
50073
50092
  return null;
50074
50093
  }
@@ -59656,7 +59675,7 @@ function createToolGuardHooks(args) {
59656
59675
  const rulesInjector = isHookEnabled("rules-injector") ? safeHook("rules-injector", () => createRulesInjectorHook(ctx, modelCacheState)) : null;
59657
59676
  const tasksTodowriteDisabler = isHookEnabled("tasks-todowrite-disabler") ? safeHook("tasks-todowrite-disabler", () => createTasksTodowriteDisablerHook({ experimental: pluginConfig.experimental })) : null;
59658
59677
  const writeExistingFileGuard = isHookEnabled("write-existing-file-guard") ? safeHook("write-existing-file-guard", () => createWriteExistingFileGuardHook(ctx)) : null;
59659
- const hashlineReadEnhancer = isHookEnabled("hashline-read-enhancer") ? safeHook("hashline-read-enhancer", () => createHashlineReadEnhancerHook(ctx, { hashline_edit: { enabled: pluginConfig.hashline_edit ?? true } })) : null;
59678
+ const hashlineReadEnhancer = isHookEnabled("hashline-read-enhancer") ? safeHook("hashline-read-enhancer", () => createHashlineReadEnhancerHook(ctx, { hashline_edit: { enabled: pluginConfig.hashline_edit ?? false } })) : null;
59660
59679
  const jsonErrorRecovery = isHookEnabled("json-error-recovery") ? safeHook("json-error-recovery", () => createJsonErrorRecoveryHook(ctx)) : null;
59661
59680
  const readImageResizer = isHookEnabled("read-image-resizer") ? safeHook("read-image-resizer", () => createReadImageResizerHook(ctx)) : null;
59662
59681
  return {
@@ -64382,8 +64401,8 @@ async function random(size) {
64382
64401
  const evenDistCutoff = Math.pow(2, 8) - Math.pow(2, 8) % mask.length;
64383
64402
  let result = "";
64384
64403
  while (result.length < size) {
64385
- const randomBytes = await getRandomValues(size - result.length);
64386
- for (const randomByte of randomBytes) {
64404
+ const randomBytes2 = await getRandomValues(size - result.length);
64405
+ for (const randomByte of randomBytes2) {
64387
64406
  if (randomByte < evenDistCutoff) {
64388
64407
  result += mask[randomByte % mask.length];
64389
64408
  }
@@ -65888,10 +65907,10 @@ async function findAvailablePort2(startPort = DEFAULT_PORT) {
65888
65907
 
65889
65908
  // src/features/mcp-oauth/oauth-authorization-flow.ts
65890
65909
  import { spawn as spawn13 } from "child_process";
65891
- import { createHash as createHash2, randomBytes } from "crypto";
65910
+ import { createHash as createHash2, randomBytes as randomBytes2 } from "crypto";
65892
65911
  import { createServer } from "http";
65893
65912
  function generateCodeVerifier() {
65894
- return randomBytes(32).toString("base64url");
65913
+ return randomBytes2(32).toString("base64url");
65895
65914
  }
65896
65915
  function generateCodeChallenge(verifier) {
65897
65916
  return createHash2("sha256").update(verifier).digest("base64url");
@@ -65976,7 +65995,7 @@ function openBrowser(url2) {
65976
65995
  async function runAuthorizationCodeRedirect(options) {
65977
65996
  const verifier = generateCodeVerifier();
65978
65997
  const challenge = generateCodeChallenge(verifier);
65979
- const state3 = randomBytes(16).toString("hex");
65998
+ const state3 = randomBytes2(16).toString("hex");
65980
65999
  const authorizationUrl = buildAuthorizationUrl(options.authorizationEndpoint, {
65981
66000
  clientId: options.clientId,
65982
66001
  redirectUri: options.redirectUri,
@@ -76530,7 +76549,7 @@ function createToolRegistry(args) {
76530
76549
  task_list: createTaskList(pluginConfig),
76531
76550
  task_update: createTaskUpdateTool(pluginConfig, ctx)
76532
76551
  } : {};
76533
- const hashlineEnabled = pluginConfig.hashline_edit ?? true;
76552
+ const hashlineEnabled = pluginConfig.hashline_edit ?? false;
76534
76553
  const hashlineToolsRecord = hashlineEnabled ? { edit: createHashlineEditTool() } : {};
76535
76554
  const allTools = {
76536
76555
  ...builtinTools,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oh-my-opencode-unguarded",
3
- "version": "3.9.4",
3
+ "version": "3.10.0",
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",
@@ -50,10 +50,6 @@
50
50
  "url": "https://github.com/D4ch1au/evil-oh-my-opencode/issues"
51
51
  },
52
52
  "homepage": "https://github.com/D4ch1au/evil-oh-my-opencode#readme",
53
- "publishConfig": {
54
- "registry": "https://registry.npmjs.org",
55
- "access": "public"
56
- },
57
53
  "dependencies": {
58
54
  "@ast-grep/cli": "^0.40.0",
59
55
  "@ast-grep/napi": "^0.40.0",
@@ -79,21 +75,25 @@
79
75
  "typescript": "^5.7.3"
80
76
  },
81
77
  "optionalDependencies": {
82
- "oh-my-opencode-darwin-arm64": "3.9.0",
83
- "oh-my-opencode-darwin-x64": "3.9.0",
84
- "oh-my-opencode-darwin-x64-baseline": "3.9.0",
85
- "oh-my-opencode-linux-arm64": "3.9.0",
86
- "oh-my-opencode-linux-arm64-musl": "3.9.0",
87
- "oh-my-opencode-linux-x64": "3.9.0",
88
- "oh-my-opencode-linux-x64-baseline": "3.9.0",
89
- "oh-my-opencode-linux-x64-musl": "3.9.0",
90
- "oh-my-opencode-linux-x64-musl-baseline": "3.9.0",
91
- "oh-my-opencode-windows-x64": "3.9.0",
92
- "oh-my-opencode-windows-x64-baseline": "3.9.0"
78
+ "oh-my-opencode-darwin-arm64": "3.10.0",
79
+ "oh-my-opencode-darwin-x64": "3.10.0",
80
+ "oh-my-opencode-darwin-x64-baseline": "3.10.0",
81
+ "oh-my-opencode-linux-arm64": "3.10.0",
82
+ "oh-my-opencode-linux-arm64-musl": "3.10.0",
83
+ "oh-my-opencode-linux-x64": "3.10.0",
84
+ "oh-my-opencode-linux-x64-baseline": "3.10.0",
85
+ "oh-my-opencode-linux-x64-musl": "3.10.0",
86
+ "oh-my-opencode-linux-x64-musl-baseline": "3.10.0",
87
+ "oh-my-opencode-windows-x64": "3.10.0",
88
+ "oh-my-opencode-windows-x64-baseline": "3.10.0"
93
89
  },
94
90
  "trustedDependencies": [
95
91
  "@ast-grep/cli",
96
92
  "@ast-grep/napi",
97
93
  "@code-yeongyu/comment-checker"
98
- ]
94
+ ],
95
+ "publishConfig": {
96
+ "registry": "https://registry.npmjs.org",
97
+ "access": "public"
98
+ }
99
99
  }