opencode-orchestrator 0.6.0 → 0.6.2

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,9 +1,19 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  // scripts/postinstall.ts
4
- import { existsSync, mkdirSync, readFileSync, writeFileSync } from "fs";
5
- import { homedir } from "os";
4
+ import { existsSync, mkdirSync, readFileSync, writeFileSync, appendFileSync } from "fs";
5
+ import { homedir, tmpdir } from "os";
6
6
  import { join } from "path";
7
+ var LOG_FILE = join(tmpdir(), "opencode-orchestrator.log");
8
+ function log(message, data) {
9
+ try {
10
+ const timestamp = (/* @__PURE__ */ new Date()).toISOString();
11
+ const entry = `[${timestamp}] [postinstall] ${message} ${data ? JSON.stringify(data) : ""}
12
+ `;
13
+ appendFileSync(LOG_FILE, entry);
14
+ } catch {
15
+ }
16
+ }
7
17
  function formatError(err, context) {
8
18
  if (err instanceof Error) {
9
19
  const nodeErr = err;
@@ -79,7 +89,9 @@ function registerInConfig(configDir) {
79
89
  }
80
90
  try {
81
91
  console.log("\u{1F3AF} OpenCode Orchestrator - Installing...");
92
+ log("Installation started", { platform: process.platform });
82
93
  const configPaths = getConfigPaths();
94
+ log("Config paths to check", configPaths);
83
95
  let registered = false;
84
96
  let alreadyRegistered = false;
85
97
  for (const configDir of configPaths) {
@@ -96,18 +108,23 @@ try {
96
108
  }
97
109
  if (registerInConfig(configDir)) {
98
110
  console.log(`\u2705 Plugin registered: ${configFile}`);
111
+ log("Plugin registered successfully", { configFile });
99
112
  registered = true;
100
113
  }
101
114
  }
102
115
  if (!registered && alreadyRegistered) {
103
116
  console.log("\u2705 Plugin already registered.");
117
+ log("Plugin was already registered");
104
118
  } else if (!registered) {
105
119
  console.log("\u26A0\uFE0F Could not register plugin in any config location.");
120
+ log("Failed to register plugin in any location");
106
121
  }
107
122
  console.log("");
108
123
  console.log("\u{1F680} Ready! Restart OpenCode to use.");
109
124
  console.log("");
125
+ log("Installation completed", { registered, alreadyRegistered });
110
126
  } catch (error) {
127
+ log("Installation error", { error: String(error) });
111
128
  console.error(formatError(error, "register plugin"));
112
129
  process.exit(0);
113
130
  }
@@ -1,9 +1,19 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  // scripts/preuninstall.ts
4
- import { existsSync, readFileSync, writeFileSync } from "fs";
5
- import { homedir } from "os";
4
+ import { existsSync, readFileSync, writeFileSync, appendFileSync } from "fs";
5
+ import { homedir, tmpdir } from "os";
6
6
  import { join } from "path";
7
+ var LOG_FILE = join(tmpdir(), "opencode-orchestrator.log");
8
+ function log(message, data) {
9
+ try {
10
+ const timestamp = (/* @__PURE__ */ new Date()).toISOString();
11
+ const entry = `[${timestamp}] [preuninstall] ${message} ${data ? JSON.stringify(data) : ""}
12
+ `;
13
+ appendFileSync(LOG_FILE, entry);
14
+ } catch {
15
+ }
16
+ }
7
17
  function formatError(err, context) {
8
18
  if (err instanceof Error) {
9
19
  const nodeErr = err;
@@ -72,19 +82,25 @@ function removeFromConfig(configDir) {
72
82
  }
73
83
  try {
74
84
  console.log("\u{1F9F9} OpenCode Orchestrator - Uninstalling...");
85
+ log("Uninstallation started", { platform: process.platform });
75
86
  const configPaths = getConfigPaths();
87
+ log("Config paths to check", configPaths);
76
88
  let removed = false;
77
89
  for (const configDir of configPaths) {
78
90
  const configFile = join(configDir, "opencode.json");
79
91
  if (removeFromConfig(configDir)) {
80
92
  console.log(`\u2705 Plugin removed: ${configFile}`);
93
+ log("Plugin removed successfully", { configFile });
81
94
  removed = true;
82
95
  }
83
96
  }
84
97
  if (!removed) {
85
98
  console.log("\u2705 Plugin was not registered. Nothing to clean up.");
99
+ log("Plugin was not registered");
86
100
  }
101
+ log("Uninstallation completed", { removed });
87
102
  } catch (error) {
103
+ log("Uninstallation error", { error: String(error) });
88
104
  console.error(formatError(error, "clean up config"));
89
105
  process.exit(0);
90
106
  }
@@ -24,6 +24,7 @@ export declare const PARALLEL_TASK: {
24
24
  readonly DEFAULT_CONCURRENCY: 10;
25
25
  readonly MAX_CONCURRENCY: 50;
26
26
  readonly SYNC_TIMEOUT_MS: number;
27
+ readonly MAX_DEPTH: 3;
27
28
  };
28
29
  export declare const MEMORY_LIMITS: {
29
30
  readonly MAX_TASKS_IN_MEMORY: 1000;
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "opencode-orchestrator",
3
3
  "displayName": "OpenCode Orchestrator",
4
4
  "description": "Distributed Cognitive Architecture for OpenCode. Turns simple prompts into specialized multi-agent workflows (Planner, Coder, Reviewer).",
5
- "version": "0.6.0",
5
+ "version": "0.6.2",
6
6
  "author": "agnusdei1207",
7
7
  "license": "MIT",
8
8
  "repository": {
@@ -59,7 +59,8 @@
59
59
  "dev:cache": "npm run build && rm -rf ~/.cache/opencode/node_modules/opencode-orchestrator && cp -r . ~/.cache/opencode/node_modules/opencode-orchestrator && echo 'SUCCESS: Copied to OpenCode cache. Restart OpenCode.'",
60
60
  "reset:local": "brew uninstall opencode 2>/dev/null; rm -rf ~/.config/opencode ~/.opencode ~/.local/share/opencode ~/.cache/opencode/node_modules/opencode-orchestrator && echo '=== Clean done ===' && brew install opencode && echo '{\"plugin\": [\"opencode-orchestrator\"], \"$schema\": \"https://opencode.ai/config.json\"}' > ~/.config/opencode/opencode.json && echo '=== Reset (Dev) complete. Run: opencode ==='",
61
61
  "reset:prod": "brew uninstall opencode 2>/dev/null; rm -rf ~/.config/opencode ~/.opencode ~/.local/share/opencode ~/.cache/opencode/node_modules/opencode-orchestrator && echo '=== Clean done ===' && brew install opencode && echo '{\"plugin\": [\"opencode-orchestrator\"], \"$schema\": \"https://opencode.ai/config.json\"}' > ~/.config/opencode/opencode.json && npm install -g opencode-orchestrator && echo '=== Reset (Prod) complete. Run: opencode ==='",
62
- "ginstall": "npm install -g opencode-orchestrator"
62
+ "ginstall": "npm install -g opencode-orchestrator",
63
+ "log": "tail -f \"$(node -e 'console.log(require(\"os\").tmpdir())')/opencode-orchestrator.log\""
63
64
  },
64
65
  "dependencies": {
65
66
  "@opencode-ai/plugin": "^1.1.1",
@@ -1,17 +0,0 @@
1
- /**
2
- * Task - A single task in the orchestration DAG
3
- */
4
- import { TaskStatus } from "../types/task-status.js";
5
- import { TaskType } from "../types/task-type.js";
6
- export interface Task {
7
- id: string;
8
- description: string;
9
- action: string;
10
- file: string;
11
- dependencies: string[];
12
- status: TaskStatus;
13
- result?: string;
14
- retryCount: number;
15
- complexity: number;
16
- type: TaskType;
17
- }
@@ -1,17 +0,0 @@
1
- /**
2
- * TaskGraph - DAG for task orchestration
3
- */
4
- import { Task } from "./interfaces/task.js";
5
- export declare class TaskGraph {
6
- private tasks;
7
- constructor(tasks?: Task[]);
8
- addTask(task: Task): void;
9
- getTask(id: string): Task | undefined;
10
- updateTask(id: string, updates: Partial<Task>): void;
11
- getReadyTasks(): Task[];
12
- isCompleted(): boolean;
13
- hasFailed(): boolean;
14
- getTaskSummary(): string;
15
- toJSON(): string;
16
- static fromJSON(json: string): TaskGraph;
17
- }
@@ -1,4 +0,0 @@
1
- /**
2
- * TaskType - Type of task in the orchestration DAG
3
- */
4
- export type TaskType = "infrastructure" | "logic" | "integration";