canary-test-cli 5.15.0 → 6.0.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 (79) hide show
  1. package/agent/frameworks/registry.json +655 -0
  2. package/bin/canary.js +20 -15
  3. package/dist/doctor-manifest.d.ts +94 -0
  4. package/dist/doctor.d.ts +67 -0
  5. package/dist/engine/analysis/cli.js +270 -0
  6. package/dist/engine/analysis/engine.js +146 -0
  7. package/dist/engine/analysis/reports.js +0 -0
  8. package/dist/engine/analysis/rows.js +9 -0
  9. package/dist/engine/cli-commands.js +618 -0
  10. package/dist/engine/cli-common.js +60 -0
  11. package/dist/engine/cli.core.js +208 -0
  12. package/dist/engine/cli.js +31 -0
  13. package/dist/engine/company-knowledge-cli.js +201 -0
  14. package/dist/engine/core/ci-env.js +33 -0
  15. package/dist/engine/core/classifier.js +192 -0
  16. package/dist/engine/core/company-knowledge.js +765 -0
  17. package/dist/engine/core/config-validation.js +74 -0
  18. package/dist/engine/core/detection.js +48 -0
  19. package/dist/engine/core/domain-scanner.js +212 -0
  20. package/dist/engine/core/environment-detect.js +410 -0
  21. package/dist/engine/core/executor.js +181 -0
  22. package/dist/engine/core/feedback.js +93 -0
  23. package/dist/engine/core/fixture-scanner.js +173 -0
  24. package/dist/engine/core/framework-registry.js +123 -0
  25. package/dist/engine/core/mcp-validator.js +218 -0
  26. package/dist/engine/core/metadata-scanner.js +147 -0
  27. package/dist/engine/core/migrator.js +1112 -0
  28. package/dist/engine/core/overlays.js +176 -0
  29. package/dist/engine/core/pattern-healer.js +147 -0
  30. package/dist/engine/core/pattern-matcher.js +255 -0
  31. package/dist/engine/core/quality-scorer.js +213 -0
  32. package/dist/engine/core/recommender.js +152 -0
  33. package/dist/engine/core/reporter.js +211 -0
  34. package/dist/engine/core/scaffolder.js +236 -0
  35. package/dist/engine/core/skill-registry.js +522 -0
  36. package/dist/engine/core/static-linter.js +237 -0
  37. package/dist/engine/core/ticket-updater.js +639 -0
  38. package/dist/engine/core/workflow-discovery.js +693 -0
  39. package/dist/engine/guardian/agent-tier.js +338 -0
  40. package/dist/engine/guardian/analysis-emit.js +201 -0
  41. package/dist/engine/guardian/cli.js +787 -0
  42. package/dist/engine/guardian/coverage.js +1055 -0
  43. package/dist/engine/guardian/delta-emitter.js +46 -0
  44. package/dist/engine/guardian/diff-extractor.js +257 -0
  45. package/dist/engine/guardian/hard-gate.js +373 -0
  46. package/dist/engine/guardian/impact-mapper.js +121 -0
  47. package/dist/engine/guardian/pr-check.js +975 -0
  48. package/dist/engine/guardian/pr-comment.js +200 -0
  49. package/dist/engine/guardian/summary-emitter.js +94 -0
  50. package/dist/engine/guardian/tier.js +58 -0
  51. package/dist/engine/history/cli.js +303 -0
  52. package/dist/engine/history/detector.js +68 -0
  53. package/dist/engine/history/ndjson-store.js +177 -0
  54. package/dist/engine/history/record.js +14 -0
  55. package/dist/engine/history/schema.js +59 -0
  56. package/dist/engine/history/store.js +47 -0
  57. package/dist/engine/history/supabase-store.js +113 -0
  58. package/dist/engine/main-deps.js +105 -0
  59. package/dist/engine/mcp-server.js +647 -0
  60. package/dist/engine/package.json +4 -0
  61. package/dist/engine/skills-cli.js +181 -0
  62. package/dist/engine/ui/banner.js +50 -0
  63. package/dist/engine/util/coalesce.js +12 -0
  64. package/dist/engine/util/round.js +43 -0
  65. package/dist/engine/workflow-cli.js +242 -0
  66. package/dist/engine-checks.d.ts +49 -0
  67. package/dist/overlay-commands.d.ts +81 -0
  68. package/dist/overlay-conflicts.d.ts +33 -0
  69. package/dist/overlay-lint.d.ts +19 -0
  70. package/dist/overlays-registry.d.ts +74 -0
  71. package/dist/reporters/testtracker.d.ts +89 -0
  72. package/dist/reporters/testtracker.js +195 -0
  73. package/dist/router.d.ts +12 -0
  74. package/dist/router.js +4 -4
  75. package/dist/skill-requirements.d.ts +57 -0
  76. package/dist/source-spec.d.ts +20 -0
  77. package/package.json +30 -6
  78. package/bin/canary +0 -0
  79. package/scripts/install.js +0 -104
@@ -1,104 +0,0 @@
1
- #!/usr/bin/env node
2
- 'use strict';
3
-
4
- const https = require('node:https');
5
- const fs = require('node:fs');
6
- const path = require('node:path');
7
-
8
- const SUPPORTED = {
9
- 'linux-x64': true,
10
- 'darwin-arm64': true,
11
- 'win32-x64': true,
12
- };
13
-
14
- function getPlatformKey(platform, arch) {
15
- const key = `${platform}-${arch}`;
16
- if (!SUPPORTED[key]) {
17
- throw new Error(
18
- `Unsupported platform: ${key}. Supported: ${Object.keys(SUPPORTED).join(', ')}`,
19
- );
20
- }
21
- return key;
22
- }
23
-
24
- function getBinaryName(platformKey) {
25
- return platformKey.startsWith('win32')
26
- ? `canary-${platformKey}.exe`
27
- : `canary-${platformKey}`;
28
- }
29
-
30
- function getDownloadUrl(version, binaryName) {
31
- return `https://github.com/bop-clocktower/canary/releases/download/v${version}/${binaryName}`;
32
- }
33
-
34
- const TRUSTED_HOSTS = new Set([
35
- 'github.com',
36
- 'objects.githubusercontent.com',
37
- 'release-assets.githubusercontent.com',
38
- ]);
39
-
40
- function validateRedirectHost(location) {
41
- const { hostname } = new URL(location);
42
- if (!TRUSTED_HOSTS.has(hostname)) {
43
- throw new Error(`Redirect to untrusted host: ${hostname}`);
44
- }
45
- }
46
-
47
- function download(url, destPath, redirectsLeft = 5) {
48
- return new Promise((resolve, reject) => {
49
- if (redirectsLeft === 0) return reject(new Error('Too many redirects'));
50
- https
51
- .get(url, (res) => {
52
- if (res.statusCode === 301 || res.statusCode === 302) {
53
- res.resume(); // drain redirect response to free the socket
54
- try {
55
- validateRedirectHost(res.headers.location);
56
- } catch (e) {
57
- return reject(e);
58
- }
59
- return resolve(
60
- download(res.headers.location, destPath, redirectsLeft - 1),
61
- );
62
- }
63
- if (res.statusCode !== 200) {
64
- return reject(new Error(`HTTP ${res.statusCode} fetching ${url}`));
65
- }
66
- const file = fs.createWriteStream(destPath);
67
- res.pipe(file);
68
- file.on('finish', () => file.close(resolve));
69
- file.on('error', reject);
70
- })
71
- .on('error', reject);
72
- });
73
- }
74
-
75
- async function main() {
76
- const pkg = require('../package.json');
77
- const version = pkg.version;
78
- const platformKey = getPlatformKey(process.platform, process.arch);
79
- const binaryName = getBinaryName(platformKey);
80
- const url = getDownloadUrl(version, binaryName);
81
- const destDir = path.join(__dirname, '..', 'bin');
82
- const destName = process.platform === 'win32' ? 'canary.exe' : 'canary';
83
- const destPath = path.join(destDir, destName);
84
-
85
- fs.mkdirSync(destDir, { recursive: true });
86
-
87
- process.stdout.write(`Downloading canary ${version} for ${platformKey}...\n`);
88
- await download(url, destPath);
89
- fs.chmodSync(destPath, 0o755);
90
- process.stdout.write(`Done. Binary at: ${destPath}\n`);
91
- }
92
-
93
- // Export pure functions for testing; run main() only when executed directly.
94
- module.exports = {
95
- getPlatformKey,
96
- getBinaryName,
97
- getDownloadUrl,
98
- validateRedirectHost,
99
- };
100
- if (require.main === module)
101
- main().catch((e) => {
102
- process.stderr.write(e.message + '\n');
103
- process.exit(1);
104
- });