oh-my-opencode-slim 2.0.0-beta.7 → 2.0.0-beta.9

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.
@@ -1,5 +1,6 @@
1
1
  import type { PluginInput } from '@opencode-ai/plugin';
2
2
  import type { MultiplexerConfig } from '../config/schema';
3
+ import type { BackgroundJobBoard } from '../utils/background-job-board';
3
4
  interface SessionEvent {
4
5
  type: string;
5
6
  properties?: {
@@ -23,6 +24,7 @@ export declare function resetMultiplexerSessionManagerState(): void;
23
24
  * with polling kept as a fallback for reliability.
24
25
  */
25
26
  export declare class MultiplexerSessionManager {
27
+ private readonly backgroundJobBoard?;
26
28
  private instanceId;
27
29
  private serverUrl;
28
30
  private directory;
@@ -33,7 +35,7 @@ export declare class MultiplexerSessionManager {
33
35
  private closingSessions;
34
36
  private pollInterval?;
35
37
  private enabled;
36
- constructor(ctx: PluginInput, config: MultiplexerConfig);
38
+ constructor(ctx: PluginInput, config: MultiplexerConfig, backgroundJobBoard?: BackgroundJobBoard | undefined);
37
39
  onSessionCreated(event: SessionEvent): Promise<void>;
38
40
  onSessionStatus(event: SessionEvent): Promise<void>;
39
41
  onSessionDeleted(event: SessionEvent): Promise<void>;
@@ -46,6 +48,7 @@ export declare class MultiplexerSessionManager {
46
48
  private isTrackedOrSpawning;
47
49
  private updatePolling;
48
50
  private getSessionId;
51
+ private isRunningBackgroundJob;
49
52
  cleanup(): Promise<void>;
50
53
  }
51
54
  /**
@@ -1,3 +1,3 @@
1
- import { type ToolDefinition } from '@opencode-ai/plugin/tool';
1
+ import { type ToolDefinition } from '@opencode-ai/plugin';
2
2
  export declare const ast_grep_search: ToolDefinition;
3
3
  export declare const ast_grep_replace: ToolDefinition;
@@ -0,0 +1,10 @@
1
+ import { type PluginInput, type ToolDefinition } from '@opencode-ai/plugin';
2
+ import type { BackgroundJobBoard } from '../utils/background-job-board';
3
+ interface CancelTaskToolOptions {
4
+ client: PluginInput['client'];
5
+ backgroundJobBoard: BackgroundJobBoard;
6
+ shouldManageSession: (sessionID: string) => boolean;
7
+ abortTimeoutMs?: number;
8
+ }
9
+ export declare function createCancelTaskTool(options: CancelTaskToolOptions): Record<string, ToolDefinition>;
10
+ export {};
@@ -1,4 +1,5 @@
1
1
  export { ast_grep_replace, ast_grep_search } from './ast-grep';
2
+ export { createCancelTaskTool } from './cancel-task';
2
3
  export { createCouncilTool } from './council';
3
4
  export type { PresetManager } from './preset-manager';
4
5
  export { createPresetManager } from './preset-manager';
package/dist/tui.js CHANGED
@@ -68,7 +68,7 @@ var POLL_INTERVAL_BACKGROUND_MS = 2000;
68
68
  var DEFAULT_TIMEOUT_MS = 2 * 60 * 1000;
69
69
  var MAX_POLL_TIME_MS = 5 * 60 * 1000;
70
70
  var DEFAULT_MAX_SUBAGENT_DEPTH = 3;
71
- var PHASE_REMINDER_TEXT = `!IMPORTANT! Scheduler workflow: plan lanes/dependencies → dispatch background specialists → track task IDs → poll task_status → reconcile terminal results → verify. Do not consume running-job output or advance dependent work. !END!`;
71
+ var PHASE_REMINDER_TEXT = `!IMPORTANT! Scheduler workflow: plan lanes/dependencies → dispatch background specialists → track task IDs → wait for hook-driven completion or use task_status only when needed → reconcile terminal results → verify. Do not consume running-job output or advance dependent work. !END!`;
72
72
  var TMUX_SPAWN_DELAY_MS = 500;
73
73
  var COUNCILLOR_STAGGER_MS = 250;
74
74
  var DEFAULT_DISABLED_AGENTS = ["observer"];
@@ -10,6 +10,7 @@ export interface BackgroundJobRecord {
10
10
  timedOut: boolean;
11
11
  terminalUnreconciled: boolean;
12
12
  launchedAt: number;
13
+ lastLaunchedAt: number;
13
14
  updatedAt: number;
14
15
  completedAt?: number;
15
16
  resultSummary?: string;
@@ -37,11 +38,13 @@ export declare class BackgroundJobBoard {
37
38
  updateStatus(input: BackgroundJobStatusInput): BackgroundJobRecord | undefined;
38
39
  updateFromStatusOutput(output: string): BackgroundJobRecord | undefined;
39
40
  markReconciled(taskID: string, now?: number): BackgroundJobRecord | undefined;
41
+ markCancelled(taskID: string, reason?: string, now?: number): BackgroundJobRecord | undefined;
40
42
  get(taskID: string): BackgroundJobRecord | undefined;
43
+ resolve(parentSessionID: string, taskIDOrAlias: string): BackgroundJobRecord | undefined;
41
44
  list(parentSessionID?: string): BackgroundJobRecord[];
42
45
  hasRunning(parentSessionID: string): boolean;
43
46
  hasTerminalUnreconciled(parentSessionID: string): boolean;
44
- formatForPrompt(parentSessionID: string): string | undefined;
47
+ formatForPrompt(parentSessionID: string, now?: number): string | undefined;
45
48
  clearParent(parentSessionID: string): void;
46
49
  drop(taskID: string): void;
47
50
  private nextAlias;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oh-my-opencode-slim",
3
- "version": "2.0.0-beta.7",
3
+ "version": "2.0.0-beta.9",
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",
@@ -43,12 +43,13 @@
43
43
  "src/skills",
44
44
  "oh-my-opencode-slim.schema.json",
45
45
  "README.md",
46
+ "README.zh-CN.md",
46
47
  "LICENSE"
47
48
  ],
48
49
  "scripts": {
49
50
  "clean:dist": "bun -e \"import { rmSync } from 'node:fs'; rmSync('dist', { recursive: true, force: true })\"",
50
- "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",
51
- "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",
51
+ "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/plugin/* --external @opencode-ai/sdk --external @opencode-ai/sdk/* --external @opentui/core --external @opentui/solid --external jsdom --external zod",
52
+ "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/plugin/* --external @opencode-ai/sdk --external @opencode-ai/sdk/* --external jsdom --external zod",
52
53
  "copy:divoom-assets": "bun run scripts/copy-divoom-assets.ts",
53
54
  "build": "bun run clean:dist && bun run build:plugin && bun run build:cli && bun run copy:divoom-assets && tsc --emitDeclarationOnly && bun run generate-schema",
54
55
  "prepare": "bun run build",