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
|
@@ -15,6 +15,7 @@ interface SessionEvent {
|
|
|
15
15
|
};
|
|
16
16
|
};
|
|
17
17
|
}
|
|
18
|
+
export declare function resetMultiplexerSessionManagerState(): void;
|
|
18
19
|
/**
|
|
19
20
|
* Tracks child sessions and spawns/closes multiplexer panes for them.
|
|
20
21
|
*
|
|
@@ -22,7 +23,7 @@ interface SessionEvent {
|
|
|
22
23
|
* with polling kept as a fallback for reliability.
|
|
23
24
|
*/
|
|
24
25
|
export declare class MultiplexerSessionManager {
|
|
25
|
-
private
|
|
26
|
+
private instanceId;
|
|
26
27
|
private serverUrl;
|
|
27
28
|
private directory;
|
|
28
29
|
private multiplexer;
|
|
@@ -39,6 +40,7 @@ export declare class MultiplexerSessionManager {
|
|
|
39
40
|
private startPolling;
|
|
40
41
|
private stopPolling;
|
|
41
42
|
private pollSessions;
|
|
43
|
+
private fetchSessionStatuses;
|
|
42
44
|
private closeSession;
|
|
43
45
|
private respawnIfKnown;
|
|
44
46
|
private isTrackedOrSpawning;
|
package/dist/tui.js
CHANGED
|
@@ -69,8 +69,8 @@ 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
71
|
var PHASE_REMINDER_TEXT = `!IMPORTANT! Recall the workflow rules:
|
|
72
|
-
Understand →
|
|
73
|
-
|
|
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!`;
|
|
74
74
|
var TMUX_SPAWN_DELAY_MS = 500;
|
|
75
75
|
var COUNCILLOR_STAGGER_MS = 250;
|
|
76
76
|
var DEFAULT_DISABLED_AGENTS = ["observer"];
|
|
@@ -460,65 +460,6 @@ var CUSTOM_SKILLS = [
|
|
|
460
460
|
}
|
|
461
461
|
];
|
|
462
462
|
|
|
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
463
|
// src/cli/config-io.ts
|
|
523
464
|
function stripJsonComments(json) {
|
|
524
465
|
const commentPattern = /\\"|"(?:\\"|[^"])*"|(\/\/.*|\/\*[\s\S]*?\*\/)/g;
|
|
@@ -533,7 +474,9 @@ function loadConfigFromPath(configPath, options) {
|
|
|
533
474
|
const content = fs.readFileSync(configPath, "utf-8");
|
|
534
475
|
let rawConfig;
|
|
535
476
|
try {
|
|
536
|
-
|
|
477
|
+
const stripped = stripJsonComments(content);
|
|
478
|
+
const interpolated = stripped.replace(/\{env:([^}]+)\}/g, (_, varName) => process.env[varName] ?? "");
|
|
479
|
+
rawConfig = JSON.parse(interpolated);
|
|
537
480
|
} catch (error) {
|
|
538
481
|
const message = error instanceof Error ? error.message : String(error);
|
|
539
482
|
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.0",
|
|
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",
|