overlord-cli 0.2605101225.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.
Files changed (42) hide show
  1. package/README.md +128 -0
  2. package/bin/_cli/attach.mjs +357 -0
  3. package/bin/_cli/auth.mjs +696 -0
  4. package/bin/_cli/cli-update.mjs +119 -0
  5. package/bin/_cli/credentials.mjs +723 -0
  6. package/bin/_cli/index.mjs +170 -0
  7. package/bin/_cli/launcher.mjs +474 -0
  8. package/bin/_cli/new-ticket.mjs +306 -0
  9. package/bin/_cli/postinstall.mjs +43 -0
  10. package/bin/_cli/protocol.mjs +1799 -0
  11. package/bin/_cli/setup.mjs +1634 -0
  12. package/bin/_cli/ticket.mjs +55 -0
  13. package/bin/_cli/tickets.mjs +121 -0
  14. package/bin/_cli/version.mjs +7 -0
  15. package/bin/ovld.mjs +13 -0
  16. package/package.json +36 -0
  17. package/plugins/claude/.claude-plugin/plugin.json +34 -0
  18. package/plugins/claude/README.md +42 -0
  19. package/plugins/claude/commands/connect.md +19 -0
  20. package/plugins/claude/commands/create.md +17 -0
  21. package/plugins/claude/commands/load.md +19 -0
  22. package/plugins/claude/commands/spawn.md +17 -0
  23. package/plugins/claude/hooks/hooks.json +15 -0
  24. package/plugins/claude/scripts/permission-hook.sh +21 -0
  25. package/plugins/claude/skills/overlord-ticket/SKILL.md +164 -0
  26. package/plugins/cursor/.cursor-plugin/plugin.json +14 -0
  27. package/plugins/cursor/commands/connect.md +3 -0
  28. package/plugins/cursor/commands/create.md +11 -0
  29. package/plugins/cursor/commands/load.md +3 -0
  30. package/plugins/cursor/commands/spawn.md +3 -0
  31. package/plugins/cursor/mcp.json +8 -0
  32. package/plugins/cursor/rules/overlord-local.mdc +10 -0
  33. package/plugins/cursor/scripts/overlord-mcp.mjs +150 -0
  34. package/plugins/cursor/skills/overlord-ticket/SKILL.md +49 -0
  35. package/plugins/overlord/.codex-plugin/plugin.json +35 -0
  36. package/plugins/overlord/.mcp.json +11 -0
  37. package/plugins/overlord/README.md +42 -0
  38. package/plugins/overlord/assets/icon.png +0 -0
  39. package/plugins/overlord/assets/logo.png +0 -0
  40. package/plugins/overlord/assets/screenshot.svg +28 -0
  41. package/plugins/overlord/scripts/overlord-mcp.mjs +688 -0
  42. package/plugins/overlord/skills/overlord-ticket/SKILL.md +146 -0
@@ -0,0 +1,119 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { spawnSync } from 'node:child_process';
4
+ import { createRequire } from 'node:module';
5
+
6
+ const require = createRequire(import.meta.url);
7
+ const cliPackage = require('../../package.json');
8
+
9
+ const CURRENT_CLI_VERSION = typeof cliPackage.version === 'string' ? cliPackage.version : '0.0.0';
10
+ const CLI_PACKAGE_NAME =
11
+ typeof cliPackage.name === 'string' && cliPackage.name ? cliPackage.name : 'overlord-cli';
12
+
13
+ const ORANGE = '\x1b[38;5;208m';
14
+ const RESET = '\x1b[0m';
15
+
16
+ function colorizeOrange(text) {
17
+ return `${ORANGE}${text}${RESET}`;
18
+ }
19
+
20
+ export function getCurrentCliVersion() {
21
+ return CURRENT_CLI_VERSION;
22
+ }
23
+
24
+ export function getCliPackageName() {
25
+ return CLI_PACKAGE_NAME;
26
+ }
27
+
28
+ export async function fetchLatestCliVersion({
29
+ fetchImpl = fetch,
30
+ packageName = CLI_PACKAGE_NAME,
31
+ timeoutMs = 2500
32
+ } = {}) {
33
+ const controller = new AbortController();
34
+ const timeout = setTimeout(() => controller.abort(), timeoutMs);
35
+
36
+ try {
37
+ const response = await fetchImpl(`https://registry.npmjs.org/${packageName}/latest`, {
38
+ signal: controller.signal,
39
+ headers: { Accept: 'application/json' }
40
+ });
41
+
42
+ if (!response.ok) return null;
43
+
44
+ const payload = await response.json();
45
+ return typeof payload?.version === 'string' ? payload.version : null;
46
+ } catch {
47
+ return null;
48
+ } finally {
49
+ clearTimeout(timeout);
50
+ }
51
+ }
52
+
53
+ export async function checkForCliUpdate(options = {}) {
54
+ const currentVersion = options.currentVersion ?? CURRENT_CLI_VERSION;
55
+ const latestVersion = await fetchLatestCliVersion(options);
56
+ if (!latestVersion || latestVersion === currentVersion) return null;
57
+ return latestVersion;
58
+ }
59
+
60
+ export function formatCliUpdateNotice(latestVersion, { currentVersion = CURRENT_CLI_VERSION } = {}) {
61
+ return `New Overlord CLI version available: v${latestVersion} (installed v${currentVersion}). Run \`ovld update\` to update via npm.`;
62
+ }
63
+
64
+ export function printCliUpdateNotice(
65
+ latestVersion,
66
+ { currentVersion = CURRENT_CLI_VERSION, stream = process.stderr } = {}
67
+ ) {
68
+ if (!latestVersion) return false;
69
+ stream.write(`${colorizeOrange(formatCliUpdateNotice(latestVersion, { currentVersion }))}\n`);
70
+ return true;
71
+ }
72
+
73
+ export async function runCliUpdateCommand({
74
+ currentVersion = CURRENT_CLI_VERSION,
75
+ fetchLatestVersionFn = fetchLatestCliVersion,
76
+ logger = console,
77
+ npmCommand = 'npm',
78
+ packageName = CLI_PACKAGE_NAME,
79
+ spawnSyncImpl = spawnSync
80
+ } = {}) {
81
+ const latestVersion = await fetchLatestVersionFn({ currentVersion, packageName });
82
+
83
+ if (latestVersion && latestVersion === currentVersion) {
84
+ logger.log(`Overlord CLI ${currentVersion} is already the latest version.`);
85
+ return { alreadyLatest: true, currentVersion, latestVersion };
86
+ }
87
+
88
+ const target = `${packageName}@latest`;
89
+ if (latestVersion) {
90
+ logger.log(`Updating Overlord CLI ${currentVersion} -> ${latestVersion} via npm...`);
91
+ } else {
92
+ logger.log(`Updating Overlord CLI via npm...`);
93
+ }
94
+
95
+ const result = spawnSyncImpl(npmCommand, ['install', '-g', target], {
96
+ env: process.env,
97
+ stdio: 'inherit'
98
+ });
99
+
100
+ if (result.error) {
101
+ throw result.error;
102
+ }
103
+
104
+ if (typeof result.status === 'number' && result.status !== 0) {
105
+ throw new Error(`\`${npmCommand} install -g ${target}\` exited with status ${result.status}.`);
106
+ }
107
+
108
+ if (typeof result.signal === 'string') {
109
+ throw new Error(`\`${npmCommand} install -g ${target}\` was terminated by ${result.signal}.`);
110
+ }
111
+
112
+ if (latestVersion) {
113
+ logger.log(`Overlord CLI updated to v${latestVersion}.`);
114
+ } else {
115
+ logger.log('Overlord CLI update complete. Run `ovld version` to confirm the installed version.');
116
+ }
117
+
118
+ return { alreadyLatest: false, currentVersion, latestVersion, result };
119
+ }