oh-my-opencode-slim 1.0.3 → 1.0.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.
@@ -29,6 +29,7 @@ export declare class MultiplexerSessionManager {
29
29
  private sessions;
30
30
  private knownSessions;
31
31
  private spawningSessions;
32
+ private closingSessions;
32
33
  private pollInterval?;
33
34
  private enabled;
34
35
  constructor(ctx: PluginInput, config: MultiplexerConfig);
@@ -41,6 +42,8 @@ export declare class MultiplexerSessionManager {
41
42
  private closeSession;
42
43
  private respawnIfKnown;
43
44
  private isTrackedOrSpawning;
45
+ private updatePolling;
46
+ private getSessionId;
44
47
  cleanup(): Promise<void>;
45
48
  }
46
49
  /**
package/dist/tui.d.ts ADDED
@@ -0,0 +1,5 @@
1
+ import type { TuiPluginModule } from '@opencode-ai/plugin/tui';
2
+ declare const plugin: TuiPluginModule & {
3
+ id: string;
4
+ };
5
+ export default plugin;
package/dist/tui.js ADDED
@@ -0,0 +1,86 @@
1
+ import { createRequire } from "node:module";
2
+ var __create = Object.create;
3
+ var __getProtoOf = Object.getPrototypeOf;
4
+ var __defProp = Object.defineProperty;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ function __accessProp(key) {
8
+ return this[key];
9
+ }
10
+ var __toESMCache_node;
11
+ var __toESMCache_esm;
12
+ var __toESM = (mod, isNodeMode, target) => {
13
+ var canCache = mod != null && typeof mod === "object";
14
+ if (canCache) {
15
+ var cache = isNodeMode ? __toESMCache_node ??= new WeakMap : __toESMCache_esm ??= new WeakMap;
16
+ var cached = cache.get(mod);
17
+ if (cached)
18
+ return cached;
19
+ }
20
+ target = mod != null ? __create(__getProtoOf(mod)) : {};
21
+ const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
22
+ for (let key of __getOwnPropNames(mod))
23
+ if (!__hasOwnProp.call(to, key))
24
+ __defProp(to, key, {
25
+ get: __accessProp.bind(mod, key),
26
+ enumerable: true
27
+ });
28
+ if (canCache)
29
+ cache.set(mod, to);
30
+ return to;
31
+ };
32
+ var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
33
+ var __require = /* @__PURE__ */ createRequire(import.meta.url);
34
+
35
+ // src/tui.ts
36
+ import { createElement, insert, setProp } from "@opentui/solid";
37
+ var PLUGIN_NAME = "oh-my-opencode-slim";
38
+ var PLUGIN_LABEL = "OMOS";
39
+ async function readPackageVersion() {
40
+ try {
41
+ const packageJson = await Bun.file(new URL("../package.json", import.meta.url)).json();
42
+ return typeof packageJson.version === "string" ? packageJson.version : undefined;
43
+ } catch {
44
+ return;
45
+ }
46
+ }
47
+ function element(tag, props, children = []) {
48
+ const node = createElement(tag);
49
+ for (const [key, value] of Object.entries(props)) {
50
+ if (value !== undefined)
51
+ setProp(node, key, value);
52
+ }
53
+ for (const child of children) {
54
+ if (child === null || child === undefined || child === false)
55
+ continue;
56
+ insert(node, child);
57
+ }
58
+ return node;
59
+ }
60
+ function text(props, children) {
61
+ return element("text", props, children);
62
+ }
63
+ var plugin = {
64
+ id: `${PLUGIN_NAME}:tui`,
65
+ tui: async (api, _options, meta) => {
66
+ const version = meta.version ?? await readPackageVersion() ?? "dev";
67
+ const versionText = `${PLUGIN_LABEL} ${version}`;
68
+ api.slots.register({
69
+ order: 900,
70
+ slots: {
71
+ home_prompt_right() {
72
+ const theme = api.theme.current;
73
+ return text({ fg: theme.textMuted }, [versionText]);
74
+ },
75
+ session_prompt_right() {
76
+ const theme = api.theme.current;
77
+ return text({ fg: theme.textMuted }, [versionText]);
78
+ }
79
+ }
80
+ });
81
+ }
82
+ };
83
+ var tui_default = plugin;
84
+ export {
85
+ tui_default as default
86
+ };
package/package.json CHANGED
@@ -1,9 +1,19 @@
1
1
  {
2
2
  "name": "oh-my-opencode-slim",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
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",
7
+ "exports": {
8
+ ".": {
9
+ "import": "./dist/index.js",
10
+ "types": "./dist/index.d.ts"
11
+ },
12
+ "./tui": {
13
+ "import": "./dist/tui.js",
14
+ "types": "./dist/tui.d.ts"
15
+ }
16
+ },
7
17
  "bin": {
8
18
  "oh-my-opencode-slim": "./dist/cli/index.js"
9
19
  },
@@ -36,7 +46,7 @@
36
46
  "LICENSE"
37
47
  ],
38
48
  "scripts": {
39
- "build:plugin": "bun build src/index.ts --outdir dist --target node --format esm --external @ast-grep/napi --external @opencode-ai/plugin --external @opencode-ai/sdk --external jsdom --external zod",
49
+ "build:plugin": "bun build src/index.ts src/tui.ts --outdir dist --target node --format esm --external @ast-grep/napi --external @opencode-ai/plugin --external @opencode-ai/sdk --external @opentui/core --external @opentui/solid --external jsdom --external zod",
40
50
  "build:cli": "bun build src/cli/index.ts --outdir dist/cli --target node --format esm --external @ast-grep/napi --external @opencode-ai/plugin --external @opencode-ai/sdk --external jsdom --external zod",
41
51
  "build": "bun run build:plugin && bun run build:cli && tsc --emitDeclarationOnly && bun run generate-schema",
42
52
  "prepare": "bun run build",
@@ -68,6 +78,9 @@
68
78
  "lru-cache": "^11.3.3",
69
79
  "turndown": "^7.2.4"
70
80
  },
81
+ "optionalDependencies": {
82
+ "@opentui/solid": "^0.1.97"
83
+ },
71
84
  "devDependencies": {
72
85
  "@biomejs/biome": "2.4.11",
73
86
  "@types/jsdom": "^21.1.7",