oh-my-opencode-slim 2.0.0-beta.0 → 2.0.0-beta.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.
- package/README.md +2 -2
- package/dist/cli/index.js +6 -0
- package/dist/config/constants.d.ts +1 -1
- package/dist/hooks/deepwork/index.d.ts +13 -0
- package/dist/hooks/{session-goal → goal}/index.d.ts +1 -1
- package/dist/hooks/index.d.ts +2 -1
- package/dist/hooks/phase-reminder/index.d.ts +1 -1
- package/dist/index.js +517 -918
- package/dist/tools/index.d.ts +0 -2
- package/dist/tui.js +7 -3
- package/package.json +3 -2
- package/src/skills/codemap.md +3 -2
- package/src/skills/deepwork/SKILL.md +92 -0
- package/dist/agents/council-master.d.ts +0 -2
- package/dist/background/background-manager.d.ts +0 -203
- package/dist/background/index.d.ts +0 -3
- package/dist/background/multiplexer-session-manager.d.ts +0 -70
- package/dist/background/subagent-depth.d.ts +0 -35
- package/dist/cli/divoom.d.ts +0 -23
- package/dist/goal/index.d.ts +0 -3
- package/dist/goal/manager.d.ts +0 -41
- package/dist/goal/prompts.d.ts +0 -4
- package/dist/goal/store.d.ts +0 -15
- package/dist/goal/types.d.ts +0 -28
- package/dist/integrations/divoom/index.d.ts +0 -3
- package/dist/integrations/divoom/status-manager.d.ts +0 -31
- package/dist/integrations/divoom/swift-helper-source.d.ts +0 -1
- package/dist/integrations/divoom/swift-transport.d.ts +0 -26
- package/dist/integrations/divoom/types.d.ts +0 -41
- package/dist/tools/background.d.ts +0 -13
- package/dist/tools/fork/command.d.ts +0 -28
- package/dist/tools/fork/files.d.ts +0 -33
- package/dist/tools/fork/index.d.ts +0 -10
- package/dist/tools/fork/state.d.ts +0 -7
- package/dist/tools/fork/tools.d.ts +0 -23
- package/dist/tools/fork/vendor.d.ts +0 -28
- package/dist/tools/handoff/command.d.ts +0 -29
- package/dist/tools/handoff/files.d.ts +0 -33
- package/dist/tools/handoff/index.d.ts +0 -10
- package/dist/tools/handoff/state.d.ts +0 -7
- package/dist/tools/handoff/tools.d.ts +0 -23
- package/dist/tools/handoff/vendor.d.ts +0 -28
- package/dist/tools/lsp/client.d.ts +0 -81
- package/dist/tools/lsp/config-store.d.ts +0 -29
- package/dist/tools/lsp/config.d.ts +0 -5
- package/dist/tools/lsp/constants.d.ts +0 -24
- package/dist/tools/lsp/index.d.ts +0 -4
- package/dist/tools/lsp/tools.d.ts +0 -5
- package/dist/tools/lsp/types.d.ts +0 -45
- package/dist/tools/lsp/utils.d.ts +0 -34
- package/dist/tools/subtask/command.d.ts +0 -30
- package/dist/tools/subtask/files.d.ts +0 -34
- package/dist/tools/subtask/index.d.ts +0 -11
- package/dist/tools/subtask/state.d.ts +0 -7
- package/dist/tools/subtask/tools.d.ts +0 -23
- package/dist/tools/subtask/vendor.d.ts +0 -27
- package/dist/utils/tmux-debug-log.d.ts +0 -2
package/dist/tools/index.d.ts
CHANGED
|
@@ -3,5 +3,3 @@ export { createCouncilTool } from './council';
|
|
|
3
3
|
export type { PresetManager } from './preset-manager';
|
|
4
4
|
export { createPresetManager } from './preset-manager';
|
|
5
5
|
export { createWebfetchTool } from './smartfetch';
|
|
6
|
-
export type { SubtaskCommandManager } from './subtask';
|
|
7
|
-
export { createReadSessionTool, createSubtaskCommandManager, createSubtaskState, createSubtaskTool, } from './subtask';
|
package/dist/tui.js
CHANGED
|
@@ -68,9 +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!
|
|
72
|
-
Understand → build a short work graph with independent lanes, dependencies, and advisory ownership → dispatch independent specialists as background tasks → record task/session IDs → continue orchestration → poll task_status for terminal results → reconcile → verify.
|
|
73
|
-
Only consume outputs or advance dependent work when background results are terminal. !END!`;
|
|
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!`;
|
|
74
72
|
var TMUX_SPAWN_DELAY_MS = 500;
|
|
75
73
|
var COUNCILLOR_STAGGER_MS = 250;
|
|
76
74
|
var DEFAULT_DISABLED_AGENTS = ["observer"];
|
|
@@ -457,6 +455,12 @@ var CUSTOM_SKILLS = [
|
|
|
457
455
|
description: "Clone important dependency source for local inspection",
|
|
458
456
|
allowedAgents: ["orchestrator"],
|
|
459
457
|
sourcePath: "src/skills/clonedeps"
|
|
458
|
+
},
|
|
459
|
+
{
|
|
460
|
+
name: "deepwork",
|
|
461
|
+
description: "Heavy/complex coding sessions and large modifications workflow",
|
|
462
|
+
allowedAgents: ["orchestrator"],
|
|
463
|
+
sourcePath: "src/skills/deepwork"
|
|
460
464
|
}
|
|
461
465
|
];
|
|
462
466
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "oh-my-opencode-slim",
|
|
3
|
-
"version": "2.0.0-beta.
|
|
3
|
+
"version": "2.0.0-beta.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",
|
|
@@ -46,10 +46,11 @@
|
|
|
46
46
|
"LICENSE"
|
|
47
47
|
],
|
|
48
48
|
"scripts": {
|
|
49
|
+
"clean:dist": "bun -e \"import { rmSync } from 'node:fs'; rmSync('dist', { recursive: true, force: true })\"",
|
|
49
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",
|
|
50
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
52
|
"copy:divoom-assets": "bun run scripts/copy-divoom-assets.ts",
|
|
52
|
-
"build": "bun run build:plugin && bun run build:cli && bun run copy:divoom-assets && tsc --emitDeclarationOnly && bun run generate-schema",
|
|
53
|
+
"build": "bun run clean:dist && bun run build:plugin && bun run build:cli && bun run copy:divoom-assets && tsc --emitDeclarationOnly && bun run generate-schema",
|
|
53
54
|
"prepare": "bun run build",
|
|
54
55
|
"contributors:add": "all-contributors add",
|
|
55
56
|
"contributors:check": "all-contributors check",
|
package/src/skills/codemap.md
CHANGED
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
- `src/skills/codemap/` (command-style repository mapping skill)
|
|
19
19
|
- `src/skills/clonedeps/` (workflow skill for dependency source mirroring)
|
|
20
20
|
- `src/skills/simplify/` (readability/refactor guidance skill)
|
|
21
|
+
- `src/skills/deepwork/` (orchestrator-only workflow for heavy coding sessions)
|
|
21
22
|
- Files are considered static runtime payload. No plugin TS module in `src/` imports these files directly; they
|
|
22
23
|
are loaded by OpenCode via filesystem installation.
|
|
23
24
|
|
|
@@ -38,6 +39,6 @@
|
|
|
38
39
|
bundled skills when agent policy is derived from built-in recommendations.
|
|
39
40
|
- `verify-release-artifact.ts` enforces artifact completeness by asserting key
|
|
40
41
|
bundled skill payloads such as `src/skills/simplify/SKILL.md`,
|
|
41
|
-
`src/skills/codemap/SKILL.md`,
|
|
42
|
-
in the tarball.
|
|
42
|
+
`src/skills/codemap/SKILL.md`, `src/skills/clonedeps/SKILL.md`, and
|
|
43
|
+
`src/skills/deepwork/SKILL.md` are present in the tarball.
|
|
43
44
|
- `package.json` scripts (`verify:release`, `build`) rely on these assets to ensure install-time skill availability.
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: deepwork
|
|
3
|
+
description: Orchestrator-only workflow for heavy coding sessions, multi-phase implementation, and risky refactors. Use for complex work that needs planning, review gates, and persistent progress tracking.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Deepwork
|
|
7
|
+
|
|
8
|
+
Deepwork is an orchestrator workflow for heavy coding sessions. Use it when the
|
|
9
|
+
work is broad, risky, multi-file, or likely to span several implementation
|
|
10
|
+
phases. Do not use it for trivial edits, quick docs changes, or simple bug fixes.
|
|
11
|
+
|
|
12
|
+
## Core Contract
|
|
13
|
+
|
|
14
|
+
When deepwork is active, the orchestrator must manage the work as a scheduler,
|
|
15
|
+
not as the default implementation worker.
|
|
16
|
+
|
|
17
|
+
Required behavior:
|
|
18
|
+
|
|
19
|
+
- keep OpenCode todos aligned with the active deepwork phase;
|
|
20
|
+
- create and maintain a local markdown progress file under `.slim/deepwork/`;
|
|
21
|
+
- draft a plan before implementation;
|
|
22
|
+
- ask `@oracle` to review the plan and revise it until acceptable;
|
|
23
|
+
- create a phased implementation/delegation plan;
|
|
24
|
+
- ask `@oracle` to review that implementation plan before execution;
|
|
25
|
+
- execute phase by phase with specialist delegation where useful;
|
|
26
|
+
- after each phase, validate, update the deepwork file, ask `@oracle` to review
|
|
27
|
+
the phase result, fix actionable issues, then continue;
|
|
28
|
+
- ask `@oracle` phase reviews to include simplify/readability feedback alongside
|
|
29
|
+
correctness, blockers, risks, and plan adherence;
|
|
30
|
+
- finish with final validation and a concise summary.
|
|
31
|
+
|
|
32
|
+
## Deepwork File
|
|
33
|
+
|
|
34
|
+
Create a task-specific file such as:
|
|
35
|
+
|
|
36
|
+
```text
|
|
37
|
+
.slim/deepwork/<short-task-slug>.md
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Keep `.slim/deepwork/` out of git, but make it readable to OpenCode. Ensure the
|
|
41
|
+
project ignore files include:
|
|
42
|
+
|
|
43
|
+
```gitignore
|
|
44
|
+
# .gitignore
|
|
45
|
+
.slim/deepwork/
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
```gitignore
|
|
49
|
+
# .ignore
|
|
50
|
+
!.slim/deepwork/
|
|
51
|
+
!.slim/deepwork/**
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Do not follow a rigid template. Choose whatever markdown structure best fits the
|
|
55
|
+
work. The file only needs to remain useful as persistent session state and should
|
|
56
|
+
capture, as applicable:
|
|
57
|
+
|
|
58
|
+
- current goal and understanding;
|
|
59
|
+
- assumptions, constraints, and decisions;
|
|
60
|
+
- plan drafts and oracle review notes;
|
|
61
|
+
- implementation phases and status;
|
|
62
|
+
- validation results;
|
|
63
|
+
- unresolved questions, blockers, and follow-ups.
|
|
64
|
+
|
|
65
|
+
Update this file after major decisions, reviews, phase completions, validation
|
|
66
|
+
results, and scope changes.
|
|
67
|
+
|
|
68
|
+
## Scheduler Discipline
|
|
69
|
+
|
|
70
|
+
Use the V2 scheduler model throughout:
|
|
71
|
+
|
|
72
|
+
- dispatch `@explorer`, `@librarian`, `@fixer`, `@designer`, `@oracle`, or
|
|
73
|
+
`@council` lanes as background tasks when useful;
|
|
74
|
+
- record task/session IDs and ownership boundaries;
|
|
75
|
+
- poll `task_status` before consuming background results;
|
|
76
|
+
- reconcile terminal results before dependent work;
|
|
77
|
+
- keep write scopes separate when parallelizing;
|
|
78
|
+
- do not advance to the next phase while relevant jobs are running or terminal
|
|
79
|
+
results are unreconciled.
|
|
80
|
+
|
|
81
|
+
`@oracle` owns review and risk assessment. It should review plans and completed
|
|
82
|
+
phase outputs, not become the default implementer. For phase reviews, explicitly
|
|
83
|
+
ask oracle to use its simplify skill when available and report readability,
|
|
84
|
+
maintainability, and unnecessary-complexity findings separately from blocking
|
|
85
|
+
correctness issues.
|
|
86
|
+
|
|
87
|
+
## Lightweight Judgment
|
|
88
|
+
|
|
89
|
+
Deepwork is meant to prevent chaotic long sessions, not create paperwork. Keep
|
|
90
|
+
the markdown concise, batch small related checks when reasonable, and scale the
|
|
91
|
+
number of review gates to the risk of the work. If the task becomes small and
|
|
92
|
+
obvious, finish simply while preserving validation and the final summary.
|
|
@@ -1,203 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Background Task Manager
|
|
3
|
-
*
|
|
4
|
-
* Manages long-running AI agent tasks that execute in separate sessions.
|
|
5
|
-
* Background tasks run independently from the main conversation flow, allowing
|
|
6
|
-
* the user to continue working while tasks complete asynchronously.
|
|
7
|
-
*
|
|
8
|
-
* Key features:
|
|
9
|
-
* - Fire-and-forget launch (returns task_id immediately)
|
|
10
|
-
* - Creates isolated sessions for background work
|
|
11
|
-
* - Event-driven completion detection via session.status
|
|
12
|
-
* - Start queue with configurable concurrency limit
|
|
13
|
-
* - Supports task cancellation and result retrieval
|
|
14
|
-
*/
|
|
15
|
-
import type { PluginInput } from '@opencode-ai/plugin';
|
|
16
|
-
import type { BackgroundTaskConfig, PluginConfig } from '../config';
|
|
17
|
-
import type { MultiplexerConfig } from '../config/schema';
|
|
18
|
-
import { SubagentDepthTracker } from './subagent-depth';
|
|
19
|
-
export declare function loadPersistedTask(taskId: string): BackgroundTask | null;
|
|
20
|
-
/**
|
|
21
|
-
* Represents a background task running in an isolated session.
|
|
22
|
-
* Tasks are tracked from creation through completion or failure.
|
|
23
|
-
*/
|
|
24
|
-
export interface BackgroundTask {
|
|
25
|
-
id: string;
|
|
26
|
-
sessionId?: string;
|
|
27
|
-
description: string;
|
|
28
|
-
agent: string;
|
|
29
|
-
status: 'pending' | 'starting' | 'running' | 'completed' | 'failed' | 'cancelled';
|
|
30
|
-
result?: string;
|
|
31
|
-
error?: string;
|
|
32
|
-
config: BackgroundTaskConfig;
|
|
33
|
-
parentSessionId: string;
|
|
34
|
-
startedAt: Date;
|
|
35
|
-
completedAt?: Date;
|
|
36
|
-
prompt: string;
|
|
37
|
-
questions: string[];
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* Options for launching a new background task.
|
|
41
|
-
*/
|
|
42
|
-
export interface LaunchOptions {
|
|
43
|
-
agent: string;
|
|
44
|
-
prompt: string;
|
|
45
|
-
description: string;
|
|
46
|
-
parentSessionId: string;
|
|
47
|
-
}
|
|
48
|
-
export declare class BackgroundTaskManager {
|
|
49
|
-
private tasks;
|
|
50
|
-
private tasksBySessionId;
|
|
51
|
-
private agentBySessionId;
|
|
52
|
-
private depthTracker;
|
|
53
|
-
private client;
|
|
54
|
-
private directory;
|
|
55
|
-
private tmuxEnabled;
|
|
56
|
-
private config?;
|
|
57
|
-
private backgroundConfig;
|
|
58
|
-
private disabledAgents;
|
|
59
|
-
private startQueue;
|
|
60
|
-
private activeStarts;
|
|
61
|
-
private maxConcurrentStarts;
|
|
62
|
-
private completionResolvers;
|
|
63
|
-
constructor(ctx: PluginInput, multiplexerConfig?: MultiplexerConfig, config?: PluginConfig);
|
|
64
|
-
/**
|
|
65
|
-
* Look up the delegation rules for an agent type.
|
|
66
|
-
* Unknown agent types default to explorer-only access, making it easy
|
|
67
|
-
* to add new background agent types without updating SUBAGENT_DELEGATION_RULES.
|
|
68
|
-
*/
|
|
69
|
-
private getSubagentRules;
|
|
70
|
-
/**
|
|
71
|
-
* Resolve the agent associated with a session.
|
|
72
|
-
* Untracked sessions are treated as orchestrator sessions by default.
|
|
73
|
-
*/
|
|
74
|
-
private getSessionAgent;
|
|
75
|
-
/**
|
|
76
|
-
* Check if a parent session is allowed to delegate to a specific agent type.
|
|
77
|
-
* @param parentSessionId - The session ID of the parent
|
|
78
|
-
* @param requestedAgent - The agent type being requested
|
|
79
|
-
* @returns true if allowed, false if not
|
|
80
|
-
*/
|
|
81
|
-
isAgentAllowed(parentSessionId: string, requestedAgent: string): boolean;
|
|
82
|
-
/**
|
|
83
|
-
* Get the list of allowed subagents for a parent session.
|
|
84
|
-
* @param parentSessionId - The session ID of the parent
|
|
85
|
-
* @returns Array of allowed agent names, empty if none
|
|
86
|
-
*/
|
|
87
|
-
getAllowedSubagents(parentSessionId: string): readonly string[];
|
|
88
|
-
/**
|
|
89
|
-
* Launch a new background task (fire-and-forget).
|
|
90
|
-
*
|
|
91
|
-
* Phase A (sync): Creates task record and returns immediately.
|
|
92
|
-
* Phase B (async): Session creation and prompt sending happen in background.
|
|
93
|
-
*
|
|
94
|
-
* @param opts - Task configuration options
|
|
95
|
-
* @returns The created background task with pending status
|
|
96
|
-
*/
|
|
97
|
-
launch(opts: LaunchOptions): BackgroundTask;
|
|
98
|
-
/**
|
|
99
|
-
* Enqueue task for background start.
|
|
100
|
-
*/
|
|
101
|
-
private enqueueStart;
|
|
102
|
-
/**
|
|
103
|
-
* Process start queue with concurrency limit.
|
|
104
|
-
*/
|
|
105
|
-
private processQueue;
|
|
106
|
-
private resolveFallbackChain;
|
|
107
|
-
/**
|
|
108
|
-
* Calculate tool permissions for a spawned agent based on its own delegation rules.
|
|
109
|
-
* Agents that cannot delegate (leaf nodes) get delegation tools disabled entirely,
|
|
110
|
-
* preventing models from even seeing tools they can never use.
|
|
111
|
-
*
|
|
112
|
-
* @param agentName - The agent type being spawned
|
|
113
|
-
* @returns Tool permissions object with background_task and task enabled/disabled
|
|
114
|
-
*/
|
|
115
|
-
private calculateToolPermissions;
|
|
116
|
-
/**
|
|
117
|
-
* Start a task in the background (Phase B).
|
|
118
|
-
*/
|
|
119
|
-
private startTask;
|
|
120
|
-
/**
|
|
121
|
-
* Handle session.status events for completion detection.
|
|
122
|
-
* Uses session.status instead of deprecated session.idle.
|
|
123
|
-
*/
|
|
124
|
-
handleSessionStatus(event: {
|
|
125
|
-
type: string;
|
|
126
|
-
properties?: {
|
|
127
|
-
sessionID?: string;
|
|
128
|
-
status?: {
|
|
129
|
-
type: string;
|
|
130
|
-
};
|
|
131
|
-
};
|
|
132
|
-
}): Promise<void>;
|
|
133
|
-
/**
|
|
134
|
-
* Handle session.deleted events for cleanup.
|
|
135
|
-
* When a session is deleted, cancel associated tasks and clean up.
|
|
136
|
-
*/
|
|
137
|
-
handleSessionDeleted(event: {
|
|
138
|
-
type: string;
|
|
139
|
-
properties?: {
|
|
140
|
-
info?: {
|
|
141
|
-
id?: string;
|
|
142
|
-
};
|
|
143
|
-
sessionID?: string;
|
|
144
|
-
};
|
|
145
|
-
}): Promise<void>;
|
|
146
|
-
/**
|
|
147
|
-
* Extract task result and mark complete.
|
|
148
|
-
* When retry_on_empty is enabled (default), empty responses are
|
|
149
|
-
* treated as failures so the fallback chain can retry.
|
|
150
|
-
* When disabled, empty responses succeed with an empty string result.
|
|
151
|
-
*/
|
|
152
|
-
private extractAndCompleteTask;
|
|
153
|
-
/**
|
|
154
|
-
* Complete a task and notify waiting callers.
|
|
155
|
-
*/
|
|
156
|
-
private completeTask;
|
|
157
|
-
/**
|
|
158
|
-
* Send completion notification to parent session.
|
|
159
|
-
*/
|
|
160
|
-
private sendCompletionNotification;
|
|
161
|
-
/**
|
|
162
|
-
* Retrieve the current state of a background task.
|
|
163
|
-
*
|
|
164
|
-
* Checks in-memory first. If not found (e.g. after plugin reinitialization
|
|
165
|
-
* caused by context compaction), falls back to the persisted state on disk.
|
|
166
|
-
*
|
|
167
|
-
* @param taskId - The task ID to retrieve
|
|
168
|
-
* @returns The task object, or null if not found in memory or on disk
|
|
169
|
-
*/
|
|
170
|
-
getResult(taskId: string): BackgroundTask | null;
|
|
171
|
-
/**
|
|
172
|
-
* Add a question relayed from a background subagent via ask_orchestrator.
|
|
173
|
-
* Resolves the task from the session ID in toolContext.
|
|
174
|
-
* Returns true if the question was recorded, false if the task wasn't found
|
|
175
|
-
* or is no longer active (completed/failed/cancelled).
|
|
176
|
-
*
|
|
177
|
-
* Questions are persisted to disk immediately for crash safety.
|
|
178
|
-
*/
|
|
179
|
-
addQuestion(sessionId: string, question: string): 'recorded' | 'not-found' | 'terminal' | 'cap-reached';
|
|
180
|
-
/**
|
|
181
|
-
* Wait for a task to complete.
|
|
182
|
-
*
|
|
183
|
-
* @param taskId - The task ID to wait for
|
|
184
|
-
* @param timeout - Maximum time to wait in milliseconds (0 = no timeout)
|
|
185
|
-
* @returns The completed task, or null if not found/timeout
|
|
186
|
-
*/
|
|
187
|
-
waitForCompletion(taskId: string, timeout?: number): Promise<BackgroundTask | null>;
|
|
188
|
-
/**
|
|
189
|
-
* Cancel one or all running background tasks.
|
|
190
|
-
*
|
|
191
|
-
* @param taskId - Optional task ID to cancel. If omitted, cancels all pending/running tasks.
|
|
192
|
-
* @returns Number of tasks cancelled
|
|
193
|
-
*/
|
|
194
|
-
cancel(taskId?: string): number;
|
|
195
|
-
/**
|
|
196
|
-
* Clean up all tasks.
|
|
197
|
-
*/
|
|
198
|
-
cleanup(): void;
|
|
199
|
-
/**
|
|
200
|
-
* Get the depth tracker instance for use by other managers.
|
|
201
|
-
*/
|
|
202
|
-
getDepthTracker(): SubagentDepthTracker;
|
|
203
|
-
}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
export { type BackgroundTask, BackgroundTaskManager, type LaunchOptions, loadPersistedTask, } from './background-manager';
|
|
2
|
-
export { MultiplexerSessionManager, TmuxSessionManager, } from './multiplexer-session-manager';
|
|
3
|
-
export { SubagentDepthTracker } from './subagent-depth';
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import type { PluginInput } from '@opencode-ai/plugin';
|
|
2
|
-
import type { MultiplexerConfig } from '../config/schema';
|
|
3
|
-
/**
|
|
4
|
-
* Event shape for session events
|
|
5
|
-
*/
|
|
6
|
-
interface SessionEvent {
|
|
7
|
-
type: string;
|
|
8
|
-
properties?: {
|
|
9
|
-
info?: {
|
|
10
|
-
id?: string;
|
|
11
|
-
parentID?: string;
|
|
12
|
-
title?: string;
|
|
13
|
-
directory?: string;
|
|
14
|
-
};
|
|
15
|
-
sessionID?: string;
|
|
16
|
-
status?: {
|
|
17
|
-
type: string;
|
|
18
|
-
};
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* MultiplexerSessionManager tracks child sessions and spawns/closes multiplexer panes for them.
|
|
23
|
-
*
|
|
24
|
-
* Uses session.status events for completion detection instead of polling.
|
|
25
|
-
* Supports both tmux and zellij multiplexers.
|
|
26
|
-
*/
|
|
27
|
-
export declare class MultiplexerSessionManager {
|
|
28
|
-
private client;
|
|
29
|
-
private serverUrl;
|
|
30
|
-
private directory;
|
|
31
|
-
private multiplexer;
|
|
32
|
-
private sessions;
|
|
33
|
-
private pollInterval?;
|
|
34
|
-
private enabled;
|
|
35
|
-
constructor(ctx: PluginInput, config: MultiplexerConfig);
|
|
36
|
-
/**
|
|
37
|
-
* Handle session.created events.
|
|
38
|
-
* Spawns a multiplexer pane for child sessions (those with parentID).
|
|
39
|
-
*/
|
|
40
|
-
onSessionCreated(event: SessionEvent): Promise<void>;
|
|
41
|
-
/**
|
|
42
|
-
* Handle session.status events for completion detection.
|
|
43
|
-
* Uses session.status instead of deprecated session.idle.
|
|
44
|
-
*
|
|
45
|
-
* When a session becomes idle (completed), close its pane.
|
|
46
|
-
*/
|
|
47
|
-
onSessionStatus(event: SessionEvent): Promise<void>;
|
|
48
|
-
/**
|
|
49
|
-
* Handle session.deleted events.
|
|
50
|
-
* When a session is deleted, close its multiplexer pane immediately.
|
|
51
|
-
*/
|
|
52
|
-
onSessionDeleted(event: SessionEvent): Promise<void>;
|
|
53
|
-
private startPolling;
|
|
54
|
-
private stopPolling;
|
|
55
|
-
/**
|
|
56
|
-
* Poll sessions for status updates (fallback for reliability).
|
|
57
|
-
* Also handles timeout and missing session detection.
|
|
58
|
-
*/
|
|
59
|
-
private pollSessions;
|
|
60
|
-
private closeSession;
|
|
61
|
-
/**
|
|
62
|
-
* Clean up all tracked sessions.
|
|
63
|
-
*/
|
|
64
|
-
cleanup(): Promise<void>;
|
|
65
|
-
}
|
|
66
|
-
/**
|
|
67
|
-
* @deprecated Use MultiplexerSessionManager instead
|
|
68
|
-
*/
|
|
69
|
-
export declare const TmuxSessionManager: typeof MultiplexerSessionManager;
|
|
70
|
-
export {};
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Tracks subagent spawn depth to prevent excessive nesting.
|
|
3
|
-
*
|
|
4
|
-
* Depth 0 = root session (user's main conversation)
|
|
5
|
-
* Depth 1 = agent spawned by root (e.g., explorer, council)
|
|
6
|
-
* Depth 2 = agent spawned by depth-1 agent (e.g., councillor spawned by council)
|
|
7
|
-
* Depth 3 = agent spawned by depth-2 agent (max depth by default)
|
|
8
|
-
*
|
|
9
|
-
* When max depth is exceeded, the spawn is blocked.
|
|
10
|
-
*/
|
|
11
|
-
export declare class SubagentDepthTracker {
|
|
12
|
-
private depthBySession;
|
|
13
|
-
private readonly _maxDepth;
|
|
14
|
-
constructor(maxDepth?: number);
|
|
15
|
-
/** Maximum allowed depth. */
|
|
16
|
-
get maxDepth(): number;
|
|
17
|
-
/**
|
|
18
|
-
* Get the current depth of a session.
|
|
19
|
-
* Root sessions (not tracked) have depth 0.
|
|
20
|
-
*/
|
|
21
|
-
getDepth(sessionId: string): number;
|
|
22
|
-
/**
|
|
23
|
-
* Register a child session and check if the spawn is allowed.
|
|
24
|
-
* @returns true if allowed, false if max depth exceeded
|
|
25
|
-
*/
|
|
26
|
-
registerChild(parentSessionId: string, childSessionId: string): boolean;
|
|
27
|
-
/**
|
|
28
|
-
* Clean up session tracking when a session is deleted.
|
|
29
|
-
*/
|
|
30
|
-
cleanup(sessionId: string): void;
|
|
31
|
-
/**
|
|
32
|
-
* Clean up all tracking data.
|
|
33
|
-
*/
|
|
34
|
-
cleanupAll(): void;
|
|
35
|
-
}
|
package/dist/cli/divoom.d.ts
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import type { DivoomStatus } from '../integrations/divoom/types';
|
|
2
|
-
export type DivoomCliResult = {
|
|
3
|
-
exitCode: number;
|
|
4
|
-
message?: string;
|
|
5
|
-
error?: string;
|
|
6
|
-
};
|
|
7
|
-
export type DivoomCliOptions = {
|
|
8
|
-
cwd?: string;
|
|
9
|
-
dryRun?: boolean;
|
|
10
|
-
detector?: () => Promise<string | null>;
|
|
11
|
-
transportFactory?: (config: {
|
|
12
|
-
status: DivoomStatus;
|
|
13
|
-
directory: string;
|
|
14
|
-
}) => {
|
|
15
|
-
sendStatus(update: {
|
|
16
|
-
status: DivoomStatus;
|
|
17
|
-
reason: string;
|
|
18
|
-
timestamp: number;
|
|
19
|
-
}): Promise<void>;
|
|
20
|
-
};
|
|
21
|
-
};
|
|
22
|
-
export declare function runDivoomCli(args: string[], options?: DivoomCliOptions): Promise<DivoomCliResult>;
|
|
23
|
-
export declare function detectDivoomAddress(): Promise<string | null>;
|
package/dist/goal/index.d.ts
DELETED
package/dist/goal/manager.d.ts
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import type { PluginInput } from '@opencode-ai/plugin';
|
|
2
|
-
import type { GoalConfig } from './types';
|
|
3
|
-
interface MessagePart {
|
|
4
|
-
type?: string;
|
|
5
|
-
text?: string;
|
|
6
|
-
[key: string]: unknown;
|
|
7
|
-
}
|
|
8
|
-
interface ChatTransformMessage {
|
|
9
|
-
info: {
|
|
10
|
-
role?: string;
|
|
11
|
-
agent?: string;
|
|
12
|
-
sessionID?: string;
|
|
13
|
-
};
|
|
14
|
-
parts: MessagePart[];
|
|
15
|
-
}
|
|
16
|
-
export declare function createGoalManager(ctx: PluginInput, config?: GoalConfig): {
|
|
17
|
-
registerCommand: (opencodeConfig: Record<string, unknown>) => void;
|
|
18
|
-
handleCommandExecuteBefore: (input: {
|
|
19
|
-
command: string;
|
|
20
|
-
sessionID: string;
|
|
21
|
-
arguments: string;
|
|
22
|
-
}, output: {
|
|
23
|
-
parts: Array<{
|
|
24
|
-
type: string;
|
|
25
|
-
text?: string;
|
|
26
|
-
}>;
|
|
27
|
-
}) => Promise<void>;
|
|
28
|
-
handleMessagesTransform: (output: {
|
|
29
|
-
messages: ChatTransformMessage[];
|
|
30
|
-
}) => Promise<void>;
|
|
31
|
-
handleEvent: (input: {
|
|
32
|
-
event: {
|
|
33
|
-
type: string;
|
|
34
|
-
properties?: Record<string, unknown>;
|
|
35
|
-
};
|
|
36
|
-
}) => Promise<void>;
|
|
37
|
-
hasActiveGoal: (sessionID: string) => boolean;
|
|
38
|
-
hasRunningGoal: (sessionID: string) => boolean;
|
|
39
|
-
};
|
|
40
|
-
export type GoalManager = ReturnType<typeof createGoalManager>;
|
|
41
|
-
export {};
|
package/dist/goal/prompts.d.ts
DELETED
package/dist/goal/store.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { GoalRecord } from './types';
|
|
2
|
-
interface GoalStoreSnapshot {
|
|
3
|
-
version: 1;
|
|
4
|
-
goals: GoalRecord[];
|
|
5
|
-
}
|
|
6
|
-
export declare function getGoalStorePath(): string;
|
|
7
|
-
export declare class GoalStore {
|
|
8
|
-
read(): GoalStoreSnapshot;
|
|
9
|
-
write(snapshot: GoalStoreSnapshot): void;
|
|
10
|
-
list(): GoalRecord[];
|
|
11
|
-
save(goal: GoalRecord): void;
|
|
12
|
-
findActiveBySession(sessionID: string): GoalRecord | undefined;
|
|
13
|
-
findLatestByDirectory(directory: string): GoalRecord | undefined;
|
|
14
|
-
}
|
|
15
|
-
export {};
|
package/dist/goal/types.d.ts
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
export type GoalStatus = 'running' | 'paused' | 'blocked' | 'completed' | 'archived';
|
|
2
|
-
export interface GoalCheckpoint {
|
|
3
|
-
id: string;
|
|
4
|
-
createdAt: string;
|
|
5
|
-
note: string;
|
|
6
|
-
}
|
|
7
|
-
export interface GoalRecord {
|
|
8
|
-
version: 1;
|
|
9
|
-
id: string;
|
|
10
|
-
directory: string;
|
|
11
|
-
sessionID: string;
|
|
12
|
-
objective: string;
|
|
13
|
-
stopCondition?: string;
|
|
14
|
-
validationCommands: string[];
|
|
15
|
-
artifacts: string[];
|
|
16
|
-
status: GoalStatus;
|
|
17
|
-
createdAt: string;
|
|
18
|
-
updatedAt: string;
|
|
19
|
-
maxCycles: number;
|
|
20
|
-
completedCycles: number;
|
|
21
|
-
checkpoints: GoalCheckpoint[];
|
|
22
|
-
lastError?: string;
|
|
23
|
-
}
|
|
24
|
-
export interface GoalConfig {
|
|
25
|
-
maxCycles?: number;
|
|
26
|
-
cooldownMs?: number;
|
|
27
|
-
shouldManageSession?: (sessionID: string) => boolean;
|
|
28
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import type { DivoomEvent, DivoomStatus, DivoomStatusManagerOptions, DivoomStatusUpdate, DivoomTransport } from './types';
|
|
2
|
-
export declare class DryRunDivoomTransport implements DivoomTransport {
|
|
3
|
-
sendStatus(update: DivoomStatusUpdate): Promise<void>;
|
|
4
|
-
}
|
|
5
|
-
export declare class DivoomStatusManager {
|
|
6
|
-
private readonly enabled;
|
|
7
|
-
private readonly debounceMs;
|
|
8
|
-
private readonly transport;
|
|
9
|
-
private readonly now;
|
|
10
|
-
private readonly schedule;
|
|
11
|
-
private readonly clearSchedule;
|
|
12
|
-
private readonly sessions;
|
|
13
|
-
private currentStatus;
|
|
14
|
-
private pendingStatus;
|
|
15
|
-
private pendingReason;
|
|
16
|
-
private pendingTimer;
|
|
17
|
-
private quiescentIdleTimer;
|
|
18
|
-
private readonly beforeExitHandler?;
|
|
19
|
-
constructor(options?: DivoomStatusManagerOptions);
|
|
20
|
-
handleEvent(input: {
|
|
21
|
-
event: DivoomEvent;
|
|
22
|
-
}): Promise<void>;
|
|
23
|
-
dispose(): Promise<void>;
|
|
24
|
-
getStatus(): DivoomStatus;
|
|
25
|
-
private deriveStatus;
|
|
26
|
-
private requestStatus;
|
|
27
|
-
private flushPendingStatus;
|
|
28
|
-
private scheduleQuiescentIdle;
|
|
29
|
-
private clearQuiescentIdle;
|
|
30
|
-
}
|
|
31
|
-
export declare function createDivoomStatusManager(options?: DivoomStatusManagerOptions): DivoomStatusManager;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const DIVOOM_SWIFT_HELPER_SOURCE: string;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import type { DivoomConfig } from '../../config';
|
|
2
|
-
import type { CommandRunner, DivoomStatusUpdate, DivoomTransport } from './types';
|
|
3
|
-
export type SwiftDivoomTransportOptions = {
|
|
4
|
-
config: DivoomConfig;
|
|
5
|
-
storageDir?: string;
|
|
6
|
-
runner?: CommandRunner;
|
|
7
|
-
platform?: NodeJS.Platform;
|
|
8
|
-
};
|
|
9
|
-
export declare class SwiftDivoomTransport implements DivoomTransport {
|
|
10
|
-
private readonly deviceAddress;
|
|
11
|
-
private readonly faces;
|
|
12
|
-
private readonly storageDir;
|
|
13
|
-
private readonly runner;
|
|
14
|
-
private readonly platform;
|
|
15
|
-
private helperPath;
|
|
16
|
-
private preparePromise;
|
|
17
|
-
constructor(options: SwiftDivoomTransportOptions);
|
|
18
|
-
sendStatus(update: DivoomStatusUpdate): Promise<void>;
|
|
19
|
-
private prepareHelper;
|
|
20
|
-
private compileHelper;
|
|
21
|
-
}
|
|
22
|
-
export declare function createDivoomTransport(options: {
|
|
23
|
-
config?: DivoomConfig;
|
|
24
|
-
storageDir?: string;
|
|
25
|
-
runner?: CommandRunner;
|
|
26
|
-
}): DivoomTransport | undefined;
|