oh-my-opencode-slim 1.1.0 โ 2.0.0-beta.0
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 +26 -12
- package/dist/cli/index.js +4 -82
- package/dist/cli/skills.d.ts +2 -30
- package/dist/cli/types.d.ts +0 -1
- package/dist/config/constants.d.ts +1 -1
- package/dist/goal/index.d.ts +3 -0
- package/dist/goal/manager.d.ts +41 -0
- package/dist/goal/prompts.d.ts +4 -0
- package/dist/goal/store.d.ts +15 -0
- package/dist/goal/types.d.ts +28 -0
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/phase-reminder/index.d.ts +1 -1
- package/dist/hooks/session-goal/index.d.ts +38 -0
- package/dist/hooks/task-session-manager/index.d.ts +9 -0
- package/dist/hooks/todo-continuation/index.d.ts +2 -0
- package/dist/index.js +1015 -397
- package/dist/multiplexer/session-manager.d.ts +3 -1
- package/dist/tui.js +5 -62
- package/dist/utils/background-job-board.d.ts +48 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/task.d.ts +16 -0
- package/package.json +4 -2
package/README.md
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
<div align="center">
|
|
2
|
-
<
|
|
3
|
-
|
|
2
|
+
<a href="https://github.com/alvinunreal/oh-my-opencode-slim/stargazers">
|
|
3
|
+
<img src="img/4k.png" alt="4K GitHub Stars Milestone" style="border-radius: 10px;">
|
|
4
|
+
</a>
|
|
5
|
+
<h3>๐ 4,000+ Stars! Thank you! ๐</h3>
|
|
6
|
+
<p><i>We are incredibly grateful to our community for helping us reach this milestone.<br>The Pantheon grows stronger every day because of your feedback, contributions, and support!</i></p>
|
|
7
|
+
|
|
4
8
|
<p><b>Open Multi Agent Suite</b> ยท Mix any models ยท Auto delegate tasks</p>
|
|
5
9
|
|
|
6
10
|
<p><sub>by <b>Boring Dystopia Development</b></sub></p>
|
|
@@ -37,12 +41,18 @@ Install and configure oh-my-opencode-slim: https://raw.githubusercontent.com/alv
|
|
|
37
41
|
bunx oh-my-opencode-slim@latest install
|
|
38
42
|
```
|
|
39
43
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
### V2 Background-Orchestration Beta
|
|
45
|
+
|
|
46
|
+
V2 changes the orchestrator from the default execution worker into a scheduler:
|
|
47
|
+
it plans work, dispatches specialists as background tasks, polls their status,
|
|
48
|
+
then reconciles results before continuing. This requires OpenCode's native
|
|
49
|
+
background subagent support, so beta users must start OpenCode with the
|
|
50
|
+
experimental flag enabled.
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
bunx oh-my-opencode-slim@beta install
|
|
54
|
+
OPENCODE_EXPERIMENTAL_BACKGROUND_SUBAGENTS=1 opencode
|
|
55
|
+
```
|
|
46
56
|
|
|
47
57
|
### Getting Started
|
|
48
58
|
|
|
@@ -79,7 +89,7 @@ The default generated configuration includes both `openai` and `opencode-go` pre
|
|
|
79
89
|
"oracle": { "model": "openai/gpt-5.5", "variant": "high", "skills": ["simplify"], "mcps": [] },
|
|
80
90
|
"librarian": { "model": "openai/gpt-5.4-mini", "variant": "low", "skills": [], "mcps": ["websearch", "context7", "grep_app"] },
|
|
81
91
|
"explorer": { "model": "openai/gpt-5.4-mini", "variant": "low", "skills": [], "mcps": [] },
|
|
82
|
-
"designer": { "model": "openai/gpt-5.4-mini", "variant": "medium", "skills": [
|
|
92
|
+
"designer": { "model": "openai/gpt-5.4-mini", "variant": "medium", "skills": [], "mcps": [] },
|
|
83
93
|
"fixer": { "model": "openai/gpt-5.4-mini", "variant": "low", "skills": [], "mcps": [] }
|
|
84
94
|
},
|
|
85
95
|
"opencode-go": {
|
|
@@ -88,7 +98,7 @@ The default generated configuration includes both `openai` and `opencode-go` pre
|
|
|
88
98
|
"council": { "model": "opencode-go/deepseek-v4-pro", "variant": "high", "skills": [], "mcps": [] },
|
|
89
99
|
"librarian": { "model": "opencode-go/minimax-m2.7", "skills": [], "mcps": [ "websearch", "context7", "grep_app" ] },
|
|
90
100
|
"explorer": { "model": "opencode-go/minimax-m2.7", "skills": [], "mcps": [] },
|
|
91
|
-
"designer": { "model": "opencode-go/kimi-k2.6", "variant": "medium", "skills": [
|
|
101
|
+
"designer": { "model": "opencode-go/kimi-k2.6", "variant": "medium", "skills": [], "mcps": [] },
|
|
92
102
|
"fixer": { "model": "opencode-go/deepseek-v4-flash", "variant": "high", "skills": [], "mcps": [] }
|
|
93
103
|
}
|
|
94
104
|
}
|
|
@@ -486,8 +496,10 @@ Use this section as a map: start with installation, then jump to features, confi
|
|
|
486
496
|
| Doc | What it covers |
|
|
487
497
|
|-----|----------------|
|
|
488
498
|
| **[Council](docs/council.md)** | Run multiple models in parallel and synthesize a single answer with `@council` |
|
|
499
|
+
| **[V2 Background Orchestration](docs/v2-background-orchestration.md)** | Scheduler-first orchestrator model built around native background subagents |
|
|
489
500
|
| **[Multiplexer Integration](docs/multiplexer-integration.md)** | Watch agents work live in Tmux or Zellij panes |
|
|
490
501
|
| **[Session Management](docs/session-management.md)** | Reuse recent child-agent sessions with short aliases instead of starting over |
|
|
502
|
+
| **[Session Goal](docs/session-goal.md)** | Pin a session objective with `/goal` so todos, delegation, and verification stay aligned |
|
|
491
503
|
| **[Todo Continuation](docs/todo-continuation.md)** | Auto-continue orchestrator sessions with cooldowns and safety checks |
|
|
492
504
|
| **[Preset Switching](docs/preset-switching.md)** | Switch agent model presets at runtime with `/preset` |
|
|
493
505
|
| **[Subtask](docs/subtask.md)** | Run a bounded child worker with `/subtask` and return a structured summary to the main session |
|
|
@@ -502,7 +514,7 @@ Use this section as a map: start with installation, then jump to features, confi
|
|
|
502
514
|
|-----|----------------|
|
|
503
515
|
| **[Configuration](docs/configuration.md)** | Config file locations, JSONC support, prompt overrides, and full option reference |
|
|
504
516
|
| **[Maintainer Guide](docs/maintainers.md)** | Issue triage rules, label meanings, support routing, and repo maintenance workflow |
|
|
505
|
-
| **[Skills](docs/skills.md)** |
|
|
517
|
+
| **[Skills](docs/skills.md)** | Bundled skills such as `simplify`, `codemap`, and `clonedeps` |
|
|
506
518
|
| **[MCPs](docs/mcps.md)** | `websearch`, `context7`, `grep_app`, and how MCP permissions work per agent |
|
|
507
519
|
| **[Tools](docs/tools.md)** | Built-in tool capabilities like `webfetch`, LSP tools, code search, and formatters |
|
|
508
520
|
|
|
@@ -523,7 +535,7 @@ Use this section as a map: start with installation, then jump to features, confi
|
|
|
523
535
|
<p><sub>Every merged contribution leaves a mark on the realm.</sub></p>
|
|
524
536
|
|
|
525
537
|
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
|
|
526
|
-
[](#contributors-)
|
|
527
539
|
<!-- ALL-CONTRIBUTORS-BADGE:END -->
|
|
528
540
|
</div>
|
|
529
541
|
|
|
@@ -595,6 +607,8 @@ Use this section as a map: start with installation, then jump to features, confi
|
|
|
595
607
|
<td align="center" valign="top" width="16.66%"><a href="https://github.com/ThomasMldr"><img src="https://avatars.githubusercontent.com/u/6631765?v=4?s=100" width="100px;" alt="Thomas Mulder"/><br /><sub><b>Thomas Mulder</b></sub></a><br /><a href="https://github.com/alvinunreal/oh-my-opencode-slim/commits?author=ThomasMldr" title="Code">๐ป</a></td>
|
|
596
608
|
<td align="center" valign="top" width="16.66%"><a href="https://github.com/maou-shonen"><img src="https://avatars.githubusercontent.com/u/22576780?v=4?s=100" width="100px;" alt="้ญ็ๅฐๅนด(maou shonen)"/><br /><sub><b>้ญ็ๅฐๅนด(maou shonen)</b></sub></a><br /><a href="https://github.com/alvinunreal/oh-my-opencode-slim/commits?author=maou-shonen" title="Code">๐ป</a></td>
|
|
597
609
|
<td align="center" valign="top" width="16.66%"><a href="https://github.com/jelasin"><img src="https://avatars.githubusercontent.com/u/97788570?v=4?s=100" width="100px;" alt=" Jelasin"/><br /><sub><b> Jelasin</b></sub></a><br /><a href="https://github.com/alvinunreal/oh-my-opencode-slim/commits?author=jelasin" title="Code">๐ป</a></td>
|
|
610
|
+
<td align="center" valign="top" width="16.66%"><a href="https://github.com/hannespr"><img src="https://avatars.githubusercontent.com/u/40021505?v=4?s=100" width="100px;" alt="Hannes"/><br /><sub><b>Hannes</b></sub></a><br /><a href="https://github.com/alvinunreal/oh-my-opencode-slim/commits?author=hannespr" title="Code">๐ป</a></td>
|
|
611
|
+
<td align="center" valign="top" width="16.66%"><a href="https://qwtoe.github.io/"><img src="https://avatars.githubusercontent.com/u/36733893?v=4?s=100" width="100px;" alt="mooozfxs"/><br /><sub><b>mooozfxs</b></sub></a><br /><a href="https://github.com/alvinunreal/oh-my-opencode-slim/commits?author=qwtoe" title="Code">๐ป</a></td>
|
|
598
612
|
</tr>
|
|
599
613
|
</tbody>
|
|
600
614
|
</table>
|
package/dist/cli/index.js
CHANGED
|
@@ -515,56 +515,6 @@ function installCustomSkill(skill) {
|
|
|
515
515
|
}
|
|
516
516
|
}
|
|
517
517
|
|
|
518
|
-
// src/cli/skills.ts
|
|
519
|
-
import { spawnSync } from "node:child_process";
|
|
520
|
-
var RECOMMENDED_SKILLS = [
|
|
521
|
-
{
|
|
522
|
-
name: "agent-browser",
|
|
523
|
-
repo: "https://github.com/vercel-labs/agent-browser",
|
|
524
|
-
skillName: "agent-browser",
|
|
525
|
-
allowedAgents: ["designer"],
|
|
526
|
-
description: "High-performance browser automation",
|
|
527
|
-
postInstallCommands: [
|
|
528
|
-
"npm install -g agent-browser",
|
|
529
|
-
"agent-browser install"
|
|
530
|
-
]
|
|
531
|
-
}
|
|
532
|
-
];
|
|
533
|
-
function installSkill(skill) {
|
|
534
|
-
const args = [
|
|
535
|
-
"skills",
|
|
536
|
-
"add",
|
|
537
|
-
skill.repo,
|
|
538
|
-
"--skill",
|
|
539
|
-
skill.skillName,
|
|
540
|
-
"-a",
|
|
541
|
-
"opencode",
|
|
542
|
-
"-y",
|
|
543
|
-
"--global"
|
|
544
|
-
];
|
|
545
|
-
try {
|
|
546
|
-
const result = spawnSync("npx", args, { stdio: "inherit" });
|
|
547
|
-
if (result.status !== 0) {
|
|
548
|
-
return false;
|
|
549
|
-
}
|
|
550
|
-
if (skill.postInstallCommands && skill.postInstallCommands.length > 0) {
|
|
551
|
-
console.log(`Running post-install commands for ${skill.name}...`);
|
|
552
|
-
for (const cmd of skill.postInstallCommands) {
|
|
553
|
-
console.log(`> ${cmd}`);
|
|
554
|
-
const [command, ...cmdArgs] = cmd.split(" ");
|
|
555
|
-
const cmdResult = spawnSync(command, cmdArgs, { stdio: "inherit" });
|
|
556
|
-
if (cmdResult.status !== 0) {
|
|
557
|
-
console.warn(`Post-install command failed: ${cmd}`);
|
|
558
|
-
}
|
|
559
|
-
}
|
|
560
|
-
}
|
|
561
|
-
return true;
|
|
562
|
-
} catch (error) {
|
|
563
|
-
console.error(`Failed to install skill: ${skill.name}`, error);
|
|
564
|
-
return false;
|
|
565
|
-
}
|
|
566
|
-
}
|
|
567
|
-
|
|
568
518
|
// src/cli/providers.ts
|
|
569
519
|
var SCHEMA_URL = "https://unpkg.com/oh-my-opencode-slim@latest/oh-my-opencode-slim.schema.json";
|
|
570
520
|
var GENERATED_PRESETS = ["openai", "opencode-go"];
|
|
@@ -637,12 +587,8 @@ function generateLiteConfig(installConfig) {
|
|
|
637
587
|
const createAgentConfig = (agentName, modelInfo) => {
|
|
638
588
|
const isOrchestrator = agentName === "orchestrator";
|
|
639
589
|
const skills = isOrchestrator ? ["*"] : [
|
|
640
|
-
...RECOMMENDED_SKILLS.filter((s) => s.allowedAgents.includes("*") || s.allowedAgents.includes(agentName)).map((s) => s.skillName),
|
|
641
590
|
...CUSTOM_SKILLS.filter((s) => s.allowedAgents.includes("*") || s.allowedAgents.includes(agentName)).map((s) => s.name)
|
|
642
591
|
];
|
|
643
|
-
if (agentName === "designer" && !skills.includes("agent-browser")) {
|
|
644
|
-
skills.push("agent-browser");
|
|
645
|
-
}
|
|
646
592
|
return {
|
|
647
593
|
model: modelInfo.model,
|
|
648
594
|
variant: modelInfo.variant,
|
|
@@ -1355,13 +1301,13 @@ Options:
|
|
|
1355
1301
|
import { existsSync as existsSync5 } from "node:fs";
|
|
1356
1302
|
import { createInterface } from "node:readline/promises";
|
|
1357
1303
|
// src/cli/system.ts
|
|
1358
|
-
import { spawnSync
|
|
1304
|
+
import { spawnSync } from "node:child_process";
|
|
1359
1305
|
import { statSync as statSync4 } from "node:fs";
|
|
1360
1306
|
var cachedOpenCodePath = null;
|
|
1361
1307
|
function resolvePathCommand(command) {
|
|
1362
1308
|
try {
|
|
1363
1309
|
const resolver = process.platform === "win32" ? "where" : "which";
|
|
1364
|
-
const result =
|
|
1310
|
+
const result = spawnSync(resolver, [command], {
|
|
1365
1311
|
encoding: "utf-8",
|
|
1366
1312
|
stdio: ["ignore", "pipe", "ignore"]
|
|
1367
1313
|
});
|
|
@@ -1376,7 +1322,7 @@ function resolvePathCommand(command) {
|
|
|
1376
1322
|
}
|
|
1377
1323
|
function canExecute(command, args) {
|
|
1378
1324
|
try {
|
|
1379
|
-
const result =
|
|
1325
|
+
const result = spawnSync(command, args, {
|
|
1380
1326
|
stdio: "ignore"
|
|
1381
1327
|
});
|
|
1382
1328
|
return result.status === 0;
|
|
@@ -1578,8 +1524,6 @@ async function runInstall(config) {
|
|
|
1578
1524
|
const isUpdate = detected.isInstalled;
|
|
1579
1525
|
printHeader(isUpdate);
|
|
1580
1526
|
let totalSteps = 6;
|
|
1581
|
-
if (config.installSkills)
|
|
1582
|
-
totalSteps += 1;
|
|
1583
1527
|
if (config.installCustomSkills)
|
|
1584
1528
|
totalSteps += 1;
|
|
1585
1529
|
totalSteps += 1;
|
|
@@ -1658,27 +1602,6 @@ ${JSON.stringify(liteConfig, null, 2)}
|
|
|
1658
1602
|
return 1;
|
|
1659
1603
|
}
|
|
1660
1604
|
}
|
|
1661
|
-
if (config.installSkills) {
|
|
1662
|
-
printStep(step++, totalSteps, "Installing recommended skills...");
|
|
1663
|
-
if (config.dryRun) {
|
|
1664
|
-
printInfo("Dry run mode - would install skills:");
|
|
1665
|
-
for (const skill of RECOMMENDED_SKILLS) {
|
|
1666
|
-
printInfo(` - ${skill.name}`);
|
|
1667
|
-
}
|
|
1668
|
-
} else {
|
|
1669
|
-
let skillsInstalled = 0;
|
|
1670
|
-
for (const skill of RECOMMENDED_SKILLS) {
|
|
1671
|
-
printInfo(`Installing ${skill.name}...`);
|
|
1672
|
-
if (installSkill(skill)) {
|
|
1673
|
-
printSuccess(`Installed: ${skill.name}`);
|
|
1674
|
-
skillsInstalled++;
|
|
1675
|
-
} else {
|
|
1676
|
-
printInfo(`Skipped: ${skill.name} (already installed)`);
|
|
1677
|
-
}
|
|
1678
|
-
}
|
|
1679
|
-
printSuccess(`${skillsInstalled}/${RECOMMENDED_SKILLS.length} skills processed`);
|
|
1680
|
-
}
|
|
1681
|
-
}
|
|
1682
1605
|
if (config.installCustomSkills) {
|
|
1683
1606
|
printStep(step++, totalSteps, "Installing custom skills...");
|
|
1684
1607
|
if (config.dryRun) {
|
|
@@ -1735,7 +1658,6 @@ ${JSON.stringify(liteConfig, null, 2)}
|
|
|
1735
1658
|
async function install(args) {
|
|
1736
1659
|
const config = {
|
|
1737
1660
|
hasTmux: false,
|
|
1738
|
-
installSkills: args.skills === "yes",
|
|
1739
1661
|
installCustomSkills: args.skills === "yes",
|
|
1740
1662
|
preset: args.preset,
|
|
1741
1663
|
promptForStar: args.tui,
|
|
@@ -1792,7 +1714,7 @@ Usage:
|
|
|
1792
1714
|
bunx oh-my-opencode-slim doctor [OPTIONS]
|
|
1793
1715
|
|
|
1794
1716
|
Options:
|
|
1795
|
-
--skills=yes|no Install
|
|
1717
|
+
--skills=yes|no Install bundled skills (default: yes)
|
|
1796
1718
|
--preset=<name> Active generated config preset (default: openai)
|
|
1797
1719
|
--no-tui Non-interactive mode
|
|
1798
1720
|
--dry-run Simulate install without writing files
|
package/dist/cli/skills.d.ts
CHANGED
|
@@ -1,20 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* A recommended skill to install via `npx skills add`.
|
|
3
|
-
*/
|
|
4
|
-
export interface RecommendedSkill {
|
|
5
|
-
/** Human-readable name for prompts */
|
|
6
|
-
name: string;
|
|
7
|
-
/** GitHub repo URL for `npx skills add` */
|
|
8
|
-
repo: string;
|
|
9
|
-
/** Skill name within the repo (--skill flag) */
|
|
10
|
-
skillName: string;
|
|
11
|
-
/** List of agents that should auto-allow this skill */
|
|
12
|
-
allowedAgents: string[];
|
|
13
|
-
/** Description shown to user during install */
|
|
14
|
-
description: string;
|
|
15
|
-
/** Optional commands to run after the skill is added */
|
|
16
|
-
postInstallCommands?: string[];
|
|
17
|
-
}
|
|
18
1
|
/**
|
|
19
2
|
* A skill that is managed externally (e.g. user-installed) and needs
|
|
20
3
|
* permission grants but is NOT installed by this plugin's CLI.
|
|
@@ -27,26 +10,15 @@ export interface PermissionOnlySkill {
|
|
|
27
10
|
/** Human-readable description (for documentation only) */
|
|
28
11
|
description: string;
|
|
29
12
|
}
|
|
30
|
-
/**
|
|
31
|
-
* List of recommended skills.
|
|
32
|
-
* Add new skills here to include them in the installation flow.
|
|
33
|
-
*/
|
|
34
|
-
export declare const RECOMMENDED_SKILLS: RecommendedSkill[];
|
|
35
13
|
/**
|
|
36
14
|
* Skills managed externally (not installed by this plugin's CLI).
|
|
37
15
|
* Entries here only affect agent permission grants โ nothing is installed.
|
|
38
16
|
*/
|
|
39
17
|
export declare const PERMISSION_ONLY_SKILLS: PermissionOnlySkill[];
|
|
40
18
|
/**
|
|
41
|
-
*
|
|
42
|
-
* @param skill - The skill to install
|
|
43
|
-
* @returns True if installation succeeded, false otherwise
|
|
44
|
-
*/
|
|
45
|
-
export declare function installSkill(skill: RecommendedSkill): boolean;
|
|
46
|
-
/**
|
|
47
|
-
* Get permission presets for a specific agent based on recommended skills.
|
|
19
|
+
* Get permission presets for a specific agent based on bundled skills.
|
|
48
20
|
* @param agentName - The name of the agent
|
|
49
|
-
* @param skillList - Optional explicit list of skills to allow (overrides
|
|
21
|
+
* @param skillList - Optional explicit list of skills to allow (overrides defaults)
|
|
50
22
|
* @returns Permission rules for the skill permission type
|
|
51
23
|
*/
|
|
52
24
|
export declare function getSkillPermissionsForAgent(agentName: string, skillList?: string[]): Record<string, 'allow' | 'ask' | 'deny'>;
|
package/dist/cli/types.d.ts
CHANGED
|
@@ -20,7 +20,7 @@ export declare const DEFAULT_TIMEOUT_MS: number;
|
|
|
20
20
|
export declare const MAX_POLL_TIME_MS: number;
|
|
21
21
|
export declare const FALLBACK_FAILOVER_TIMEOUT_MS = 15000;
|
|
22
22
|
export declare const DEFAULT_MAX_SUBAGENT_DEPTH = 3;
|
|
23
|
-
export declare const PHASE_REMINDER_TEXT = "!IMPORTANT! Recall the workflow rules:\nUnderstand \u2192
|
|
23
|
+
export declare const PHASE_REMINDER_TEXT = "!IMPORTANT! Recall the workflow rules:\nUnderstand \u2192 build a short work graph with independent lanes, dependencies, and advisory ownership \u2192 dispatch independent specialists as background tasks \u2192 record task/session IDs \u2192 continue orchestration \u2192 poll task_status for terminal results \u2192 reconcile \u2192 verify.\nOnly consume outputs or advance dependent work when background results are terminal. !END!";
|
|
24
24
|
export declare const TMUX_SPAWN_DELAY_MS = 500;
|
|
25
25
|
export declare const COUNCILLOR_STAGGER_MS = 250;
|
|
26
26
|
export declare const STABLE_POLLS_THRESHOLD = 3;
|
|
@@ -0,0 +1,41 @@
|
|
|
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 {};
|
|
@@ -0,0 +1,15 @@
|
|
|
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 {};
|
|
@@ -0,0 +1,28 @@
|
|
|
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
|
+
}
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -9,5 +9,6 @@ export { processImageAttachments } from './image-hook';
|
|
|
9
9
|
export { createJsonErrorRecoveryHook } from './json-error-recovery';
|
|
10
10
|
export { createPhaseReminderHook } from './phase-reminder';
|
|
11
11
|
export { createPostFileToolNudgeHook } from './post-file-tool-nudge';
|
|
12
|
+
export { createSessionGoalHook } from './session-goal';
|
|
12
13
|
export { createTaskSessionManagerHook } from './task-session-manager';
|
|
13
14
|
export { createTodoContinuationHook } from './todo-continuation';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const PHASE_REMINDER = "<internal_reminder>!IMPORTANT! Recall the workflow rules:\nUnderstand \u2192
|
|
1
|
+
export declare const PHASE_REMINDER = "<internal_reminder>!IMPORTANT! Recall the workflow rules:\nUnderstand \u2192 build a short work graph with independent lanes, dependencies, and advisory ownership \u2192 dispatch independent specialists as background tasks \u2192 record task/session IDs \u2192 continue orchestration \u2192 poll task_status for terminal results \u2192 reconcile \u2192 verify.\nOnly consume outputs or advance dependent work when background results are terminal. !END!</internal_reminder>";
|
|
2
2
|
interface MessageInfo {
|
|
3
3
|
role: string;
|
|
4
4
|
agent?: string;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { PluginInput } from '@opencode-ai/plugin';
|
|
2
|
+
import type { PluginConfig } from '../../config';
|
|
3
|
+
interface GoalState {
|
|
4
|
+
text: string;
|
|
5
|
+
source?: 'manual' | 'interview';
|
|
6
|
+
sourcePath?: string;
|
|
7
|
+
inheritedFrom?: string;
|
|
8
|
+
createdAt: number;
|
|
9
|
+
}
|
|
10
|
+
interface SystemTransformOutput {
|
|
11
|
+
system: string[];
|
|
12
|
+
}
|
|
13
|
+
export declare function createSessionGoalHook(ctx: PluginInput, config: PluginConfig, options?: {
|
|
14
|
+
getAgentName?: (sessionID: string) => string | undefined;
|
|
15
|
+
}): {
|
|
16
|
+
registerCommand: (config: Record<string, unknown>) => void;
|
|
17
|
+
handleCommandExecuteBefore: (input: {
|
|
18
|
+
command: string;
|
|
19
|
+
sessionID: string;
|
|
20
|
+
arguments: string;
|
|
21
|
+
}, output: {
|
|
22
|
+
parts: Array<{
|
|
23
|
+
type: string;
|
|
24
|
+
text?: string;
|
|
25
|
+
}>;
|
|
26
|
+
}) => Promise<void>;
|
|
27
|
+
handleEvent: (input: {
|
|
28
|
+
event: {
|
|
29
|
+
type: string;
|
|
30
|
+
properties?: Record<string, unknown>;
|
|
31
|
+
};
|
|
32
|
+
}) => void;
|
|
33
|
+
handleSystemTransform: (input: {
|
|
34
|
+
sessionID?: string;
|
|
35
|
+
}, output: SystemTransformOutput) => void;
|
|
36
|
+
getGoal: (sessionID: string) => GoalState | undefined;
|
|
37
|
+
};
|
|
38
|
+
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { PluginInput } from '@opencode-ai/plugin';
|
|
2
|
+
import { BackgroundJobBoard } from '../../utils';
|
|
2
3
|
interface ChatMessagePart {
|
|
3
4
|
type: string;
|
|
4
5
|
text?: string;
|
|
@@ -9,6 +10,7 @@ interface ChatMessage {
|
|
|
9
10
|
role: string;
|
|
10
11
|
agent?: string;
|
|
11
12
|
sessionID?: string;
|
|
13
|
+
id?: string;
|
|
12
14
|
};
|
|
13
15
|
parts: ChatMessagePart[];
|
|
14
16
|
}
|
|
@@ -16,6 +18,7 @@ export declare function createTaskSessionManagerHook(_ctx: PluginInput, options:
|
|
|
16
18
|
maxSessionsPerAgent: number;
|
|
17
19
|
readContextMinLines?: number;
|
|
18
20
|
readContextMaxFiles?: number;
|
|
21
|
+
backgroundJobBoard?: BackgroundJobBoard;
|
|
19
22
|
shouldManageSession: (sessionID: string) => boolean;
|
|
20
23
|
}): {
|
|
21
24
|
'tool.execute.before': (input: {
|
|
@@ -45,6 +48,12 @@ export declare function createTaskSessionManagerHook(_ctx: PluginInput, options:
|
|
|
45
48
|
parentID?: string;
|
|
46
49
|
};
|
|
47
50
|
sessionID?: string;
|
|
51
|
+
status?: {
|
|
52
|
+
type?: string;
|
|
53
|
+
};
|
|
54
|
+
error?: {
|
|
55
|
+
name?: string;
|
|
56
|
+
};
|
|
48
57
|
};
|
|
49
58
|
};
|
|
50
59
|
}) => Promise<void>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { PluginInput } from '@opencode-ai/plugin';
|
|
2
|
+
import { type BackgroundJobBoard } from '../../utils';
|
|
2
3
|
interface MessagePart {
|
|
3
4
|
type?: string;
|
|
4
5
|
text?: string;
|
|
@@ -18,6 +19,7 @@ export declare function createTodoContinuationHook(ctx: PluginInput, config?: {
|
|
|
18
19
|
cooldownMs?: number;
|
|
19
20
|
autoEnable?: boolean;
|
|
20
21
|
autoEnableThreshold?: number;
|
|
22
|
+
backgroundJobBoard?: BackgroundJobBoard;
|
|
21
23
|
}): {
|
|
22
24
|
tool: Record<string, unknown>;
|
|
23
25
|
handleToolExecuteAfter: (input: {
|