oh-my-opencode-slim 2.0.2 → 2.0.3

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.
@@ -0,0 +1,3 @@
1
+ import { type ToolDefinition } from '@opencode-ai/plugin';
2
+ import type { AcpAgentsConfig } from '../config';
3
+ export declare function createAcpRunTool(agents?: AcpAgentsConfig): ToolDefinition;
@@ -1,3 +1,4 @@
1
+ export { createAcpRunTool } from './acp-run';
1
2
  export { ast_grep_replace, ast_grep_search } from './ast-grep';
2
3
  export { createCancelTaskTool } from './cancel-task';
3
4
  export { createCouncilTool } from './council';
@@ -18,6 +18,13 @@ export declare function decideSecondaryModelUse(fetchResult: CachedFetch, prompt
18
18
  use: boolean;
19
19
  reason: "prompt_present";
20
20
  };
21
+ /**
22
+ * Exposed for tests so they can avoid real wall-clock sleeps.
23
+ * Not part of the public API.
24
+ */
25
+ export declare const _testConfig: {
26
+ deleteRetryDelayMs: number;
27
+ };
21
28
  export declare function runSecondaryModelWithFallback(client: OpenCodeClient, directory: string, models: SecondaryModel[], prompt: string, content: string): Promise<{
22
29
  model: SecondaryModel;
23
30
  text: string;
package/dist/tui.js CHANGED
@@ -30,8 +30,72 @@ var __toESM = (mod, isNodeMode, target) => {
30
30
  return to;
31
31
  };
32
32
  var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
33
+ var __returnValue = (v) => v;
34
+ function __exportSetter(name, newValue) {
35
+ this[name] = __returnValue.bind(null, newValue);
36
+ }
37
+ var __export = (target, all) => {
38
+ for (var name in all)
39
+ __defProp(target, name, {
40
+ get: all[name],
41
+ enumerable: true,
42
+ configurable: true,
43
+ set: __exportSetter.bind(all, name)
44
+ });
45
+ };
46
+ var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
33
47
  var __require = /* @__PURE__ */ createRequire(import.meta.url);
34
48
 
49
+ // src/utils/compat.ts
50
+ import { spawn as nodeSpawn } from "node:child_process";
51
+ import { writeFile as fsWriteFile } from "node:fs/promises";
52
+ function collectStream(stream) {
53
+ if (!stream)
54
+ return () => Promise.resolve("");
55
+ const chunks = [];
56
+ stream.on("data", (chunk) => chunks.push(chunk));
57
+ return () => new Promise((resolve, reject) => {
58
+ if (!stream.readable) {
59
+ resolve(Buffer.concat(chunks).toString("utf-8"));
60
+ return;
61
+ }
62
+ stream.on("end", () => resolve(Buffer.concat(chunks).toString("utf-8")));
63
+ stream.on("error", reject);
64
+ });
65
+ }
66
+ function crossSpawn(command, options) {
67
+ const [cmd, ...args] = command;
68
+ const proc = nodeSpawn(cmd, args, {
69
+ stdio: [
70
+ options?.stdin ?? "ignore",
71
+ options?.stdout ?? "pipe",
72
+ options?.stderr ?? "pipe"
73
+ ],
74
+ cwd: options?.cwd,
75
+ env: options?.env
76
+ });
77
+ const stdoutCollector = collectStream(proc.stdout);
78
+ const stderrCollector = collectStream(proc.stderr);
79
+ const exited = new Promise((resolve, reject) => {
80
+ proc.on("error", reject);
81
+ proc.on("close", (code) => resolve(code ?? 1));
82
+ });
83
+ return {
84
+ proc,
85
+ stdout: stdoutCollector,
86
+ stderr: stderrCollector,
87
+ exited,
88
+ kill: (signal) => proc.kill(signal),
89
+ get exitCode() {
90
+ return proc.exitCode;
91
+ }
92
+ };
93
+ }
94
+ async function crossWrite(path, data) {
95
+ await fsWriteFile(path, Buffer.from(data));
96
+ }
97
+ var init_compat = () => {};
98
+
35
99
  // src/tui.ts
36
100
  import { createElement, insert, setProp } from "@opentui/solid";
37
101
 
@@ -91,54 +155,8 @@ var DEFAULT_DISABLED_AGENTS = ["observer"];
91
155
  import * as fs from "node:fs";
92
156
  import * as path from "node:path";
93
157
 
94
- // src/utils/compat.ts
95
- import { spawn as nodeSpawn } from "node:child_process";
96
- import { writeFile as fsWriteFile } from "node:fs/promises";
97
- function collectStream(stream) {
98
- if (!stream)
99
- return () => Promise.resolve("");
100
- const chunks = [];
101
- stream.on("data", (chunk) => chunks.push(chunk));
102
- return () => new Promise((resolve, reject) => {
103
- if (!stream.readable) {
104
- resolve(Buffer.concat(chunks).toString("utf-8"));
105
- return;
106
- }
107
- stream.on("end", () => resolve(Buffer.concat(chunks).toString("utf-8")));
108
- stream.on("error", reject);
109
- });
110
- }
111
- function crossSpawn(command, options) {
112
- const [cmd, ...args] = command;
113
- const proc = nodeSpawn(cmd, args, {
114
- stdio: [
115
- options?.stdin ?? "ignore",
116
- options?.stdout ?? "pipe",
117
- options?.stderr ?? "pipe"
118
- ],
119
- cwd: options?.cwd,
120
- env: options?.env
121
- });
122
- const stdoutCollector = collectStream(proc.stdout);
123
- const stderrCollector = collectStream(proc.stderr);
124
- const exited = new Promise((resolve, reject) => {
125
- proc.on("error", reject);
126
- proc.on("close", (code) => resolve(code ?? 1));
127
- });
128
- return {
129
- proc,
130
- stdout: stdoutCollector,
131
- stderr: stderrCollector,
132
- exited,
133
- kill: (signal) => proc.kill(signal),
134
- get exitCode() {
135
- return proc.exitCode;
136
- }
137
- };
138
- }
139
- async function crossWrite(path, data) {
140
- await fsWriteFile(path, Buffer.from(data));
141
- }
158
+ // src/cli/config-io.ts
159
+ init_compat();
142
160
 
143
161
  // src/cli/paths.ts
144
162
  import { homedir } from "node:os";
@@ -326,9 +344,28 @@ var FailoverConfigSchema = z2.object({
326
344
  }).strict();
327
345
  var CompanionConfigSchema = z2.object({
328
346
  enabled: z2.boolean().optional(),
347
+ binaryPath: z2.string().min(1).optional().describe("Path to a custom companion binary to launch."),
329
348
  position: z2.enum(["bottom-right", "bottom-left", "top-right", "top-left"]).optional(),
330
- size: z2.enum(["small", "medium", "large"]).optional()
349
+ size: z2.enum(["small", "medium", "large"]).optional(),
350
+ gifPack: z2.enum(["default"]).optional().describe("Bundled companion animation pack to use."),
351
+ loopStyle: z2.enum(["classic", "smooth"]).optional().describe("Companion animation playback style: classic loops or smooth ping-pong playback."),
352
+ speed: z2.number().min(0.25).max(4).optional().describe("Companion animation playback speed multiplier. Defaults to 1."),
353
+ debug: z2.boolean().optional().describe("Enable verbose native companion debug logs.")
331
354
  });
355
+ var AcpAgentPermissionModeSchema = z2.enum(["ask", "allow", "reject"]);
356
+ var AcpAgentConfigSchema = z2.object({
357
+ command: z2.string().min(1),
358
+ args: z2.array(z2.string()).default([]),
359
+ env: z2.record(z2.string(), z2.string()).default({}),
360
+ cwd: z2.string().min(1).optional(),
361
+ description: z2.string().min(1).optional(),
362
+ prompt: z2.string().min(1).optional(),
363
+ orchestratorPrompt: z2.string().min(1).optional(),
364
+ wrapperModel: ProviderModelIdSchema.optional(),
365
+ timeoutMs: z2.number().int().min(1000).max(900000).default(300000),
366
+ permissionMode: AcpAgentPermissionModeSchema.default("ask")
367
+ }).strict();
368
+ var AcpAgentsConfigSchema = z2.record(z2.string(), AcpAgentConfigSchema);
332
369
  function validateCustomOnlyPromptFields(overrides, ctx, pathPrefix) {
333
370
  for (const [name, override] of Object.entries(overrides)) {
334
371
  const isBuiltInOrAlias = ALL_AGENT_NAMES.includes(name) || AGENT_ALIASES[name] !== undefined;
@@ -366,7 +403,8 @@ var PluginConfigSchema = z2.object({
366
403
  backgroundJobs: BackgroundJobsConfigSchema.optional(),
367
404
  fallback: FailoverConfigSchema.optional(),
368
405
  council: CouncilConfigSchema.optional(),
369
- companion: CompanionConfigSchema.optional()
406
+ companion: CompanionConfigSchema.optional(),
407
+ acpAgents: AcpAgentsConfigSchema.optional()
370
408
  }).superRefine((value, ctx) => {
371
409
  if (value.agents) {
372
410
  validateCustomOnlyPromptFields(value.agents, ctx, ["agents"]);
@@ -391,6 +429,9 @@ function getCustomAgentNames(config) {
391
429
  return !ALL_AGENT_NAMES.includes(name);
392
430
  });
393
431
  }
432
+ function getAcpAgentNames(config) {
433
+ return Object.keys(config?.acpAgents ?? {});
434
+ }
394
435
  // src/config/agent-mcps.ts
395
436
  var DEFAULT_AGENT_MCPS = {
396
437
  orchestrator: ["*", "!context7"],
@@ -567,6 +608,7 @@ function mergePluginConfigs(base, override) {
567
608
  backgroundJobs: deepMerge(base.backgroundJobs, override.backgroundJobs),
568
609
  fallback: deepMerge(base.fallback, override.fallback),
569
610
  council: deepMerge(base.council, override.council),
611
+ acpAgents: deepMerge(base.acpAgents, override.acpAgents),
570
612
  companion: deepMerge(base.companion, override.companion)
571
613
  };
572
614
  }
@@ -620,8 +662,13 @@ function loadPluginConfig(directory, options) {
620
662
  if (config.companion) {
621
663
  config.companion = {
622
664
  enabled: config.companion.enabled ?? false,
665
+ binaryPath: config.companion.binaryPath,
623
666
  position: config.companion.position ?? "bottom-right",
624
- size: config.companion.size ?? "medium"
667
+ size: config.companion.size ?? "medium",
668
+ gifPack: config.companion.gifPack ?? "default",
669
+ loopStyle: config.companion.loopStyle ?? "classic",
670
+ speed: config.companion.speed ?? 1,
671
+ debug: config.companion.debug ?? false
625
672
  };
626
673
  }
627
674
  return config;
@@ -416,6 +416,11 @@
416
416
  "enabled": {
417
417
  "type": "boolean"
418
418
  },
419
+ "binaryPath": {
420
+ "description": "Path to a custom companion binary to launch.",
421
+ "type": "string",
422
+ "minLength": 1
423
+ },
419
424
  "position": {
420
425
  "type": "string",
421
426
  "enum": [
@@ -432,8 +437,104 @@
432
437
  "medium",
433
438
  "large"
434
439
  ]
440
+ },
441
+ "gifPack": {
442
+ "description": "Bundled companion animation pack to use.",
443
+ "type": "string",
444
+ "enum": [
445
+ "default"
446
+ ]
447
+ },
448
+ "loopStyle": {
449
+ "description": "Companion animation playback style: classic loops or smooth ping-pong playback.",
450
+ "type": "string",
451
+ "enum": [
452
+ "classic",
453
+ "smooth"
454
+ ]
455
+ },
456
+ "speed": {
457
+ "description": "Companion animation playback speed multiplier. Defaults to 1.",
458
+ "type": "number",
459
+ "minimum": 0.25,
460
+ "maximum": 4
461
+ },
462
+ "debug": {
463
+ "description": "Enable verbose native companion debug logs.",
464
+ "type": "boolean"
435
465
  }
436
466
  }
467
+ },
468
+ "acpAgents": {
469
+ "type": "object",
470
+ "propertyNames": {
471
+ "type": "string"
472
+ },
473
+ "additionalProperties": {
474
+ "type": "object",
475
+ "properties": {
476
+ "command": {
477
+ "type": "string",
478
+ "minLength": 1
479
+ },
480
+ "args": {
481
+ "default": [],
482
+ "type": "array",
483
+ "items": {
484
+ "type": "string"
485
+ }
486
+ },
487
+ "env": {
488
+ "default": {},
489
+ "type": "object",
490
+ "propertyNames": {
491
+ "type": "string"
492
+ },
493
+ "additionalProperties": {
494
+ "type": "string"
495
+ }
496
+ },
497
+ "cwd": {
498
+ "type": "string",
499
+ "minLength": 1
500
+ },
501
+ "description": {
502
+ "type": "string",
503
+ "minLength": 1
504
+ },
505
+ "prompt": {
506
+ "type": "string",
507
+ "minLength": 1
508
+ },
509
+ "orchestratorPrompt": {
510
+ "type": "string",
511
+ "minLength": 1
512
+ },
513
+ "wrapperModel": {
514
+ "type": "string",
515
+ "pattern": "^[^/\\s]+\\/[^\\s]+$"
516
+ },
517
+ "timeoutMs": {
518
+ "default": 300000,
519
+ "type": "integer",
520
+ "minimum": 1000,
521
+ "maximum": 900000
522
+ },
523
+ "permissionMode": {
524
+ "default": "ask",
525
+ "type": "string",
526
+ "enum": [
527
+ "ask",
528
+ "allow",
529
+ "reject"
530
+ ]
531
+ }
532
+ },
533
+ "required": [
534
+ "command"
535
+ ],
536
+ "additionalProperties": false
537
+ }
437
538
  }
438
539
  },
439
540
  "title": "oh-my-opencode-slim",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oh-my-opencode-slim",
3
- "version": "2.0.2",
3
+ "version": "2.0.3",
4
4
  "description": "Lightweight agent orchestration plugin for OpenCode - a slimmed-down fork of oh-my-opencode",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -40,6 +40,7 @@
40
40
  "homepage": "https://github.com/alvinunreal/oh-my-opencode-slim#readme",
41
41
  "files": [
42
42
  "dist",
43
+ "src/companion/companion-manifest.json",
43
44
  "src/skills",
44
45
  "oh-my-opencode-slim.schema.json",
45
46
  "README.md",
@@ -0,0 +1,12 @@
1
+ {
2
+ "version": "0.1.3",
3
+ "tag": "companion-v0.1.3",
4
+ "repo": "alvinunreal/oh-my-opencode-slim",
5
+ "checksums": {
6
+ "oh-my-opencode-slim-companion-v0.1.3-aarch64-apple-darwin.tar.gz": "b4885f9b1900c02376e5f8f5ae6f3b8a89d26f7514b03f836d7e3d618164a0ed",
7
+ "oh-my-opencode-slim-companion-v0.1.3-aarch64-unknown-linux-gnu.tar.gz": "ed7cffc583e1eaa78c9bea702e6b6aa3bbc5bb4d881713fb2050237ba6b7aca5",
8
+ "oh-my-opencode-slim-companion-v0.1.3-x86_64-apple-darwin.tar.gz": "98d8ea7c7bc4415b18e0d4c524adb4eb9a84c872919840fdc021f0f50c61f808",
9
+ "oh-my-opencode-slim-companion-v0.1.3-x86_64-pc-windows-msvc.zip": "9316a49bf01f3b4fb1ce2d62edfc46094e73bb153d6ce023fb7df085afcf77bd",
10
+ "oh-my-opencode-slim-companion-v0.1.3-x86_64-unknown-linux-gnu.tar.gz": "33f5fd4b6c80155a019391e5efb13904ca9531ba8dd8c6cba30a161f1b07b764"
11
+ }
12
+ }