oh-my-opencode-slim 1.1.1 → 2.0.0-beta.1
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 +19 -10
- 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/hooks/phase-reminder/index.d.ts +1 -1
- 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 +483 -78
- package/dist/tui.js +4 -63
- 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/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 → choose the best parallelized path based on your capabilities and agents delegation rules → recall session reuse rules → execute → verify.
|
|
73
|
-
If delegating, launch the specialist in the same turn you mention it !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"];
|
|
@@ -460,65 +458,6 @@ var CUSTOM_SKILLS = [
|
|
|
460
458
|
}
|
|
461
459
|
];
|
|
462
460
|
|
|
463
|
-
// src/cli/skills.ts
|
|
464
|
-
var RECOMMENDED_SKILLS = [
|
|
465
|
-
{
|
|
466
|
-
name: "agent-browser",
|
|
467
|
-
repo: "https://github.com/vercel-labs/agent-browser",
|
|
468
|
-
skillName: "agent-browser",
|
|
469
|
-
allowedAgents: ["designer"],
|
|
470
|
-
description: "High-performance browser automation",
|
|
471
|
-
postInstallCommands: [
|
|
472
|
-
"npm install -g agent-browser",
|
|
473
|
-
"agent-browser install"
|
|
474
|
-
]
|
|
475
|
-
}
|
|
476
|
-
];
|
|
477
|
-
var PERMISSION_ONLY_SKILLS = [
|
|
478
|
-
{
|
|
479
|
-
name: "requesting-code-review",
|
|
480
|
-
allowedAgents: ["oracle"],
|
|
481
|
-
description: "Code review template for reviewer subagents in multi-step workflows"
|
|
482
|
-
}
|
|
483
|
-
];
|
|
484
|
-
function getSkillPermissionsForAgent(agentName, skillList) {
|
|
485
|
-
const permissions = {
|
|
486
|
-
"*": agentName === "orchestrator" ? "allow" : "deny"
|
|
487
|
-
};
|
|
488
|
-
if (skillList) {
|
|
489
|
-
permissions["*"] = "deny";
|
|
490
|
-
for (const name of skillList) {
|
|
491
|
-
if (name === "*") {
|
|
492
|
-
permissions["*"] = "allow";
|
|
493
|
-
} else if (name.startsWith("!")) {
|
|
494
|
-
permissions[name.slice(1)] = "deny";
|
|
495
|
-
} else {
|
|
496
|
-
permissions[name] = "allow";
|
|
497
|
-
}
|
|
498
|
-
}
|
|
499
|
-
return permissions;
|
|
500
|
-
}
|
|
501
|
-
for (const skill of RECOMMENDED_SKILLS) {
|
|
502
|
-
const isAllowed = skill.allowedAgents.includes("*") || skill.allowedAgents.includes(agentName);
|
|
503
|
-
if (isAllowed) {
|
|
504
|
-
permissions[skill.skillName] = "allow";
|
|
505
|
-
}
|
|
506
|
-
}
|
|
507
|
-
for (const skill of CUSTOM_SKILLS) {
|
|
508
|
-
const isAllowed = skill.allowedAgents.includes("*") || skill.allowedAgents.includes(agentName);
|
|
509
|
-
if (isAllowed) {
|
|
510
|
-
permissions[skill.name] = "allow";
|
|
511
|
-
}
|
|
512
|
-
}
|
|
513
|
-
for (const skill of PERMISSION_ONLY_SKILLS) {
|
|
514
|
-
const isAllowed = skill.allowedAgents.includes("*") || skill.allowedAgents.includes(agentName);
|
|
515
|
-
if (isAllowed) {
|
|
516
|
-
permissions[skill.name] = "allow";
|
|
517
|
-
}
|
|
518
|
-
}
|
|
519
|
-
return permissions;
|
|
520
|
-
}
|
|
521
|
-
|
|
522
461
|
// src/cli/config-io.ts
|
|
523
462
|
function stripJsonComments(json) {
|
|
524
463
|
const commentPattern = /\\"|"(?:\\"|[^"])*"|(\/\/.*|\/\*[\s\S]*?\*\/)/g;
|
|
@@ -533,7 +472,9 @@ function loadConfigFromPath(configPath, options) {
|
|
|
533
472
|
const content = fs.readFileSync(configPath, "utf-8");
|
|
534
473
|
let rawConfig;
|
|
535
474
|
try {
|
|
536
|
-
|
|
475
|
+
const stripped = stripJsonComments(content);
|
|
476
|
+
const interpolated = stripped.replace(/\{env:([^}]+)\}/g, (_, varName) => process.env[varName] ?? "");
|
|
477
|
+
rawConfig = JSON.parse(interpolated);
|
|
537
478
|
} catch (error) {
|
|
538
479
|
const message = error instanceof Error ? error.message : String(error);
|
|
539
480
|
options?.onWarning?.({
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { type TaskOutputState } from './task';
|
|
2
|
+
export type BackgroundJobState = TaskOutputState | 'reconciled';
|
|
3
|
+
export interface BackgroundJobRecord {
|
|
4
|
+
taskID: string;
|
|
5
|
+
parentSessionID: string;
|
|
6
|
+
agent: string;
|
|
7
|
+
description: string;
|
|
8
|
+
objective?: string;
|
|
9
|
+
state: BackgroundJobState;
|
|
10
|
+
timedOut: boolean;
|
|
11
|
+
terminalUnreconciled: boolean;
|
|
12
|
+
launchedAt: number;
|
|
13
|
+
updatedAt: number;
|
|
14
|
+
completedAt?: number;
|
|
15
|
+
resultSummary?: string;
|
|
16
|
+
alias: string;
|
|
17
|
+
}
|
|
18
|
+
export interface BackgroundJobLaunchInput {
|
|
19
|
+
taskID: string;
|
|
20
|
+
parentSessionID: string;
|
|
21
|
+
agent: string;
|
|
22
|
+
description?: string;
|
|
23
|
+
objective?: string;
|
|
24
|
+
now?: number;
|
|
25
|
+
}
|
|
26
|
+
export interface BackgroundJobStatusInput {
|
|
27
|
+
taskID: string;
|
|
28
|
+
state: TaskOutputState;
|
|
29
|
+
timedOut?: boolean;
|
|
30
|
+
resultSummary?: string;
|
|
31
|
+
now?: number;
|
|
32
|
+
}
|
|
33
|
+
export declare class BackgroundJobBoard {
|
|
34
|
+
private readonly jobs;
|
|
35
|
+
private readonly counters;
|
|
36
|
+
registerLaunch(input: BackgroundJobLaunchInput): BackgroundJobRecord;
|
|
37
|
+
updateStatus(input: BackgroundJobStatusInput): BackgroundJobRecord | undefined;
|
|
38
|
+
updateFromStatusOutput(output: string): BackgroundJobRecord | undefined;
|
|
39
|
+
markReconciled(taskID: string, now?: number): BackgroundJobRecord | undefined;
|
|
40
|
+
get(taskID: string): BackgroundJobRecord | undefined;
|
|
41
|
+
list(parentSessionID?: string): BackgroundJobRecord[];
|
|
42
|
+
hasRunning(parentSessionID: string): boolean;
|
|
43
|
+
hasTerminalUnreconciled(parentSessionID: string): boolean;
|
|
44
|
+
formatForPrompt(parentSessionID: string): string | undefined;
|
|
45
|
+
clearParent(parentSessionID: string): void;
|
|
46
|
+
drop(taskID: string): void;
|
|
47
|
+
private nextAlias;
|
|
48
|
+
}
|
package/dist/utils/index.d.ts
CHANGED
package/dist/utils/task.d.ts
CHANGED
|
@@ -1,4 +1,20 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Parse Task tool output to recover a session/task ID for resumption.
|
|
3
3
|
*/
|
|
4
|
+
export type TaskOutputState = 'running' | 'completed' | 'error' | 'cancelled';
|
|
5
|
+
export interface TaskLaunchOutput {
|
|
6
|
+
taskID: string;
|
|
7
|
+
state: 'running';
|
|
8
|
+
result?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface TaskStatusOutput {
|
|
11
|
+
taskID: string;
|
|
12
|
+
state: TaskOutputState;
|
|
13
|
+
timedOut: boolean;
|
|
14
|
+
result?: string;
|
|
15
|
+
}
|
|
4
16
|
export declare function parseTaskIdFromTaskOutput(output: string): string | undefined;
|
|
17
|
+
export declare function parseTaskLaunchOutput(output: string): TaskLaunchOutput | undefined;
|
|
18
|
+
export declare function parseTaskStatusOutput(output: string): TaskStatusOutput | undefined;
|
|
19
|
+
export declare function parseTaskStateFromOutput(output: string): TaskOutputState | undefined;
|
|
20
|
+
export declare function parseTaskResultFromOutput(output: string): string | undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "oh-my-opencode-slim",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0-beta.1",
|
|
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",
|
|
@@ -67,7 +67,9 @@
|
|
|
67
67
|
"prepublishOnly": "bun run build",
|
|
68
68
|
"release:patch": "npm version patch && git push --follow-tags && npm publish",
|
|
69
69
|
"release:minor": "npm version minor && git push --follow-tags && npm publish",
|
|
70
|
-
"release:major": "npm version major && git push --follow-tags && npm publish"
|
|
70
|
+
"release:major": "npm version major && git push --follow-tags && npm publish",
|
|
71
|
+
"release:beta": "npm version premajor --preid beta && git push --follow-tags && npm publish --tag beta",
|
|
72
|
+
"release:beta:next": "npm version prerelease --preid beta && git push --follow-tags && npm publish --tag beta"
|
|
71
73
|
},
|
|
72
74
|
"dependencies": {
|
|
73
75
|
"@ast-grep/cli": "^0.42.1",
|