@otto-assistant/bridge 0.4.101 → 0.4.102

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/opencode.js CHANGED
@@ -335,6 +335,9 @@ async function startSingleServer() {
335
335
  const opencodeConfigDir = path
336
336
  .join(os.homedir(), '.config', 'opencode')
337
337
  .replaceAll('\\', '/');
338
+ const opensrcDir = path
339
+ .join(os.homedir(), '.opensrc')
340
+ .replaceAll('\\', '/');
338
341
  const kimakiDataDir = path
339
342
  .join(os.homedir(), '.kimaki')
340
343
  .replaceAll('\\', '/');
@@ -349,6 +352,8 @@ async function startSingleServer() {
349
352
  [`${tmpdir}/*`]: 'allow',
350
353
  [opencodeConfigDir]: 'allow',
351
354
  [`${opencodeConfigDir}/*`]: 'allow',
355
+ [opensrcDir]: 'allow',
356
+ [`${opensrcDir}/*`]: 'allow',
352
357
  [kimakiDataDir]: 'allow',
353
358
  [`${kimakiDataDir}/*`]: 'allow',
354
359
  };
@@ -388,11 +393,14 @@ async function startSingleServer() {
388
393
  // priority chain, so project-level opencode.json can override kimaki defaults.
389
394
  // OPENCODE_CONFIG_CONTENT was loaded last and overrode user project configs,
390
395
  // causing issue #90 (project permissions not being respected).
396
+ const isDev = import.meta.url.endsWith('.ts') || import.meta.url.endsWith('.tsx');
391
397
  const opencodeConfig = {
392
398
  $schema: 'https://opencode.ai/config.json',
393
399
  lsp: false,
394
400
  formatter: false,
395
- plugin: [new URL('../src/kimaki-opencode-plugin.ts', import.meta.url).href],
401
+ plugin: [
402
+ new URL(isDev ? './kimaki-opencode-plugin.ts' : './kimaki-opencode-plugin.js', import.meta.url).href,
403
+ ],
396
404
  permission: {
397
405
  edit: 'allow',
398
406
  bash: 'allow',
@@ -668,6 +676,12 @@ export function buildSessionPermissions({ directory, originalRepoDirectory, }) {
668
676
  .join(os.homedir(), '.config', 'opencode')
669
677
  .replaceAll('\\', '/');
670
678
  rules.push({ permission: 'external_directory', pattern: opencodeConfigDir, action: 'allow' }, { permission: 'external_directory', pattern: `${opencodeConfigDir}/*`, action: 'allow' });
679
+ // Allow ~/.opensrc so agents can inspect cached opensrc checkouts without
680
+ // permission prompts.
681
+ const opensrcDir = path
682
+ .join(os.homedir(), '.opensrc')
683
+ .replaceAll('\\', '/');
684
+ rules.push({ permission: 'external_directory', pattern: opensrcDir, action: 'allow' }, { permission: 'external_directory', pattern: `${opensrcDir}/*`, action: 'allow' });
671
685
  // Allow ~/.kimaki so the agent can access kimaki data dir (logs, db, etc.)
672
686
  // without permission prompts.
673
687
  const kimakiDataDir = path
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@otto-assistant/bridge",
3
3
  "module": "index.ts",
4
4
  "type": "module",
5
- "version": "0.4.101",
5
+ "version": "0.4.102",
6
6
  "scripts": {
7
7
  "dev": "tsx src/bin.ts",
8
8
  "prepublishOnly": "pnpm generate && pnpm tsc",
package/src/opencode.ts CHANGED
@@ -489,6 +489,9 @@ async function startSingleServer(): Promise<ServerStartError | SingleServer> {
489
489
  const opencodeConfigDir = path
490
490
  .join(os.homedir(), '.config', 'opencode')
491
491
  .replaceAll('\\', '/')
492
+ const opensrcDir = path
493
+ .join(os.homedir(), '.opensrc')
494
+ .replaceAll('\\', '/')
492
495
  const kimakiDataDir = path
493
496
  .join(os.homedir(), '.kimaki')
494
497
  .replaceAll('\\', '/')
@@ -503,6 +506,8 @@ async function startSingleServer(): Promise<ServerStartError | SingleServer> {
503
506
  [`${tmpdir}/*`]: 'allow',
504
507
  [opencodeConfigDir]: 'allow',
505
508
  [`${opencodeConfigDir}/*`]: 'allow',
509
+ [opensrcDir]: 'allow',
510
+ [`${opensrcDir}/*`]: 'allow',
506
511
  [kimakiDataDir]: 'allow',
507
512
  [`${kimakiDataDir}/*`]: 'allow',
508
513
  }
@@ -543,11 +548,17 @@ async function startSingleServer(): Promise<ServerStartError | SingleServer> {
543
548
  // priority chain, so project-level opencode.json can override kimaki defaults.
544
549
  // OPENCODE_CONFIG_CONTENT was loaded last and overrode user project configs,
545
550
  // causing issue #90 (project permissions not being respected).
551
+ const isDev = import.meta.url.endsWith('.ts') || import.meta.url.endsWith('.tsx')
546
552
  const opencodeConfig = {
547
553
  $schema: 'https://opencode.ai/config.json',
548
554
  lsp: false,
549
555
  formatter: false,
550
- plugin: [new URL('../src/kimaki-opencode-plugin.ts', import.meta.url).href],
556
+ plugin: [
557
+ new URL(
558
+ isDev ? './kimaki-opencode-plugin.ts' : './kimaki-opencode-plugin.js',
559
+ import.meta.url,
560
+ ).href,
561
+ ],
551
562
  permission: {
552
563
  edit: 'allow',
553
564
  bash: 'allow',
@@ -878,6 +889,16 @@ export function buildSessionPermissions({
878
889
  { permission: 'external_directory', pattern: `${opencodeConfigDir}/*`, action: 'allow' },
879
890
  )
880
891
 
892
+ // Allow ~/.opensrc so agents can inspect cached opensrc checkouts without
893
+ // permission prompts.
894
+ const opensrcDir = path
895
+ .join(os.homedir(), '.opensrc')
896
+ .replaceAll('\\', '/')
897
+ rules.push(
898
+ { permission: 'external_directory', pattern: opensrcDir, action: 'allow' },
899
+ { permission: 'external_directory', pattern: `${opensrcDir}/*`, action: 'allow' },
900
+ )
901
+
881
902
  // Allow ~/.kimaki so the agent can access kimaki data dir (logs, db, etc.)
882
903
  // without permission prompts.
883
904
  const kimakiDataDir = path