@chrisromp/copilot-bridge 0.6.0-dev.4 → 0.6.0-dev.5

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chrisromp/copilot-bridge",
3
- "version": "0.6.0-dev.4",
3
+ "version": "0.6.0-dev.5",
4
4
  "description": "Mattermost ↔ GitHub Copilot bridge",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
package/scripts/check.ts CHANGED
@@ -16,6 +16,7 @@ import { getConfigPath, getConfigDir } from './lib/config-gen.js';
16
16
  import { detectPlatform, getServiceStatus } from './lib/service.js';
17
17
 
18
18
  async function main() {
19
+ const isCli = process.env.COPILOT_BRIDGE_CLI === '1';
19
20
  console.log();
20
21
  heading('🔍 copilot-bridge check');
21
22
  dim('Validating your installation...\n');
@@ -38,7 +39,7 @@ async function main() {
38
39
  const result: CheckResult = { status: 'fail', label: 'Config file', detail: `not found at ${configPath}` };
39
40
  printCheck(result);
40
41
  results.push(result);
41
- info(process.env.COPILOT_BRIDGE_CLI === '1'
42
+ info(isCli
42
43
  ? 'Run "copilot-bridge init" to create a config file.'
43
44
  : 'Run "npm run init" to create a config file.');
44
45
  printSummary(results);
@@ -227,7 +228,6 @@ async function main() {
227
228
  printCheck(result);
228
229
  results.push(result);
229
230
  } else {
230
- const isCli = process.env.COPILOT_BRIDGE_CLI === '1';
231
231
  const platform = detectPlatform();
232
232
  const serviceHint = platform === 'macos'
233
233
  ? `install with: ${isCli ? 'copilot-bridge install-service' : 'npm run install-service'}`
package/scripts/init.ts CHANGED
@@ -16,6 +16,7 @@ import { buildConfig, writeConfig, configExists, getConfigPath, getConfigDir, ty
16
16
  import { detectPlatform } from './lib/service.js';
17
17
 
18
18
  async function main() {
19
+ const isCli = process.env.COPILOT_BRIDGE_CLI === '1';
19
20
  console.log();
20
21
  heading('🚀 copilot-bridge setup');
21
22
  dim('Interactive wizard to configure copilot-bridge.\n');
@@ -50,7 +51,9 @@ async function main() {
50
51
  blank();
51
52
  warn(`Existing config found at ${getConfigPath()}`);
52
53
  if (!await confirm('Overwrite with a new config?', false)) {
53
- info('Run "npm run check" to validate your existing config.');
54
+ info(isCli
55
+ ? 'Run "copilot-bridge check" to validate your existing config.'
56
+ : 'Run "npm run check" to validate your existing config.');
54
57
  closePrompts();
55
58
  process.exit(0);
56
59
  }
@@ -103,7 +106,9 @@ async function main() {
103
106
  });
104
107
  success(`Added bot "${validation.bot.username}"${isAdmin ? ' (admin)' : ''}`);
105
108
  } else {
106
- warn('Token validation failed. The token was still added — verify it later with "npm run check".');
109
+ warn(isCli
110
+ ? 'Token validation failed. The token was still added — verify it later with "copilot-bridge check".'
111
+ : 'Token validation failed. The token was still added — verify it later with "npm run check".');
107
112
  let name = await askRequired('Bot username (for config)');
108
113
  name = name.replace(/^@/, '');
109
114
  bots.push({ name, token, admin: false });
@@ -214,14 +219,16 @@ async function main() {
214
219
  const osPlatform = detectPlatform();
215
220
  if (osPlatform === 'macos') {
216
221
  info('To run as a launchd service (auto-start at login):');
217
- dim(' npm run install-service\n');
222
+ dim(isCli ? ' copilot-bridge install-service\n' : ' npm run install-service\n');
218
223
  } else if (osPlatform === 'linux') {
219
224
  info('To run as a systemd service (auto-start at boot):');
220
- dim(' npm run install-service');
225
+ dim(isCli ? ' copilot-bridge install-service' : ' npm run install-service');
221
226
  dim(' (requires sudo — installs to /etc/systemd/system/)\n');
222
- dim(' Note: build first with npm run build\n');
227
+ if (!isCli) dim(' Note: build first with npm run build\n');
223
228
  } else {
224
- info('Run the bridge manually: npm run dev (development) or npm start (production)');
229
+ info(isCli
230
+ ? 'Run the bridge manually: copilot-bridge start'
231
+ : 'Run the bridge manually: npm run dev (development) or npm start (production)');
225
232
  }
226
233
 
227
234
  // --- Done ---
@@ -233,8 +240,6 @@ async function main() {
233
240
  info('DMs: enabled automatically');
234
241
  blank();
235
242
 
236
- // Detect if running via the copilot-bridge CLI (global install)
237
- const isCli = process.env.COPILOT_BRIDGE_CLI === '1';
238
243
  dim('Next steps:');
239
244
  if (isCli) {
240
245
  dim(' copilot-bridge check Validate your setup');
@@ -21,6 +21,7 @@ import {
21
21
  import { execSync } from 'node:child_process';
22
22
 
23
23
  function main() {
24
+ const isCli = process.env.COPILOT_BRIDGE_CLI === '1';
24
25
  const osPlatform = detectPlatform();
25
26
  const bridgePath = process.cwd();
26
27
  const homePath = os.homedir();
@@ -35,7 +36,7 @@ function main() {
35
36
 
36
37
  const distPath = path.join(bridgePath, 'dist', 'index.js');
37
38
  if (!fs.existsSync(distPath)) {
38
- fail(process.env.COPILOT_BRIDGE_CLI === '1'
39
+ fail(isCli
39
40
  ? 'dist/index.js not found. Package may be corrupted — try reinstalling.'
40
41
  : 'dist/index.js not found. Run "npm run build" first.');
41
42
  process.exit(1);
@@ -71,7 +72,7 @@ function main() {
71
72
 
72
73
  const distPath = path.join(bridgePath, 'dist', 'index.js');
73
74
  if (!fs.existsSync(distPath)) {
74
- fail(process.env.COPILOT_BRIDGE_CLI === '1'
75
+ fail(isCli
75
76
  ? 'dist/index.js not found. Package may be corrupted — try reinstalling.'
76
77
  : 'dist/index.js not found. Run "npm run build" first.');
77
78
  process.exit(1);
@@ -118,7 +119,7 @@ function main() {
118
119
 
119
120
  } else {
120
121
  fail('Unsupported platform for automatic service install.');
121
- info(process.env.COPILOT_BRIDGE_CLI === '1'
122
+ info(isCli
122
123
  ? 'Run the bridge manually: copilot-bridge start'
123
124
  : 'Run the bridge manually: npm run dev (development) or npm start (production)');
124
125
  process.exit(1);