backeer-codex 0.11.1 → 0.13.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/src/opencode.mjs CHANGED
@@ -1,3 +1,4 @@
1
+ import { VERSION } from "./version.mjs";
1
2
  import path from "node:path";
2
3
  import { createInterface } from "node:readline/promises";
3
4
  import { loadConnectionProfiles, saveConnectionProfiles, connectionProfile } from "backeer-opencode/live-profiles";
@@ -74,7 +75,7 @@ export async function runOpenCodeCLI(args, { env = process.env, output = process
74
75
  const file = connectionsFile(env);
75
76
  const [command = "connections", ...values] = args;
76
77
  const discovery = discoveryDefaults(env);
77
- if (command === "mcp" && values.length === 0) return runManagedLiveMcp({ profilesFile: file, discovery });
78
+ if (command === "mcp" && values.length === 0) return runManagedLiveMcp({ profilesFile: file, discovery, adapterVersion: VERSION });
78
79
  if (["setup", "discover"].includes(command) && values.length === 0) {
79
80
  let prompt;
80
81
  if (command === "setup" && !ask) {
@@ -82,7 +83,7 @@ export async function runOpenCodeCLI(args, { env = process.env, output = process
82
83
  prompt = createInterface({ input, output });
83
84
  ask = question => prompt.question(question);
84
85
  }
85
- const manager = new LiveSessionManager({ profilesFile: file, discovery });
86
+ const manager = new LiveSessionManager({ profilesFile: file, discovery, adapterVersion: VERSION });
86
87
  try {
87
88
  if (command === "setup") return await setupOpenCode(manager, { ask, output });
88
89
  const result = await manager.discover();
@@ -91,15 +92,23 @@ export async function runOpenCodeCLI(args, { env = process.env, output = process
91
92
  } finally { prompt?.close(); await manager.close(); }
92
93
  }
93
94
  if (command === "verify" && values.length === 2) {
94
- const manager = new LiveSessionManager({ profilesFile: file });
95
+ const manager = new LiveSessionManager({ profilesFile: file, adapterVersion: VERSION });
95
96
  try {
96
97
  const result = await manager.verifyConnection({ connection: values[0], sessionTitle: values[1] });
97
98
  output.write(`${JSON.stringify(result, null, 2)}\n`);
98
99
  return result;
99
100
  } finally { await manager.close(); }
100
101
  }
102
+ if (command === "report" && values.length === 1) {
103
+ const manager = new LiveSessionManager({ profilesFile: file, adapterVersion: VERSION });
104
+ try {
105
+ const result = await manager.report({ connection: values[0] });
106
+ output.write(`${JSON.stringify(result, null, 2)}\n`);
107
+ return result;
108
+ } finally { await manager.close(); }
109
+ }
101
110
  if (command === "diagnose" && values.length === 1) {
102
- const manager = new LiveSessionManager({ profilesFile: file });
111
+ const manager = new LiveSessionManager({ profilesFile: file, adapterVersion: VERSION });
103
112
  try {
104
113
  const result = await manager.diagnose({ connection: values[0] });
105
114
  output.write(`${JSON.stringify(result, null, 2)}\n`);
@@ -128,10 +137,10 @@ export async function runOpenCodeCLI(args, { env = process.env, output = process
128
137
  return;
129
138
  }
130
139
  if (command === "sessions" && (values.length === 1 || (values.length === 2 && values[1] === "--include-subagents"))) {
131
- const manager = new LiveSessionManager({ profilesFile: file });
140
+ const manager = new LiveSessionManager({ profilesFile: file, adapterVersion: VERSION });
132
141
  try { output.write(`${JSON.stringify(await manager.listSessions(values[0], { includeChildren: values.length === 2 }), null, 2)}\n`); }
133
142
  finally { await manager.close(); }
134
143
  return;
135
144
  }
136
- throw new Error("Usage: backeer-codex opencode [setup|discover|diagnose <name>|verify <name> <exact-session-title>|connections|add <name> <loopback-url> <token-file> <remote-project-directory>|remove <name>|sessions <name> [--include-subagents]|mcp]");
145
+ throw new Error("Usage: backeer-codex opencode [setup|discover|report <name>|diagnose <name>|verify <name> <exact-session-title>|connections|add <name> <loopback-url> <token-file> <remote-project-directory>|remove <name>|sessions <name> [--include-subagents]|mcp]");
137
146
  }
@@ -0,0 +1 @@
1
+ export const VERSION = "0.13.0";