robrain 2.0.1 → 2.3.1

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 (56) hide show
  1. package/LICENSE +17 -0
  2. package/dist/commands/doctor.d.ts +2 -0
  3. package/dist/commands/doctor.d.ts.map +1 -0
  4. package/dist/commands/doctor.js +195 -0
  5. package/dist/commands/doctor.js.map +1 -0
  6. package/dist/commands/export-interchange.d.ts +62 -0
  7. package/dist/commands/export-interchange.d.ts.map +1 -0
  8. package/dist/commands/export-interchange.js +109 -0
  9. package/dist/commands/export-interchange.js.map +1 -0
  10. package/dist/commands/export-interchange.test.d.ts +2 -0
  11. package/dist/commands/export-interchange.test.d.ts.map +1 -0
  12. package/dist/commands/export-interchange.test.js +94 -0
  13. package/dist/commands/export-interchange.test.js.map +1 -0
  14. package/dist/commands/inject.d.ts.map +1 -1
  15. package/dist/commands/inject.js +12 -1
  16. package/dist/commands/inject.js.map +1 -1
  17. package/dist/commands/install.d.ts.map +1 -1
  18. package/dist/commands/install.js +29 -21
  19. package/dist/commands/install.js.map +1 -1
  20. package/dist/commands/outcomes.d.ts +41 -0
  21. package/dist/commands/outcomes.d.ts.map +1 -0
  22. package/dist/commands/outcomes.js +274 -0
  23. package/dist/commands/outcomes.js.map +1 -0
  24. package/dist/commands/outcomes.test.d.ts +2 -0
  25. package/dist/commands/outcomes.test.d.ts.map +1 -0
  26. package/dist/commands/outcomes.test.js +118 -0
  27. package/dist/commands/outcomes.test.js.map +1 -0
  28. package/dist/commands/review.d.ts.map +1 -1
  29. package/dist/commands/review.js +24 -0
  30. package/dist/commands/review.js.map +1 -1
  31. package/dist/commands/up.d.ts +34 -0
  32. package/dist/commands/up.d.ts.map +1 -0
  33. package/dist/commands/up.js +257 -0
  34. package/dist/commands/up.js.map +1 -0
  35. package/dist/commands/up.test.d.ts +2 -0
  36. package/dist/commands/up.test.d.ts.map +1 -0
  37. package/dist/commands/up.test.js +70 -0
  38. package/dist/commands/up.test.js.map +1 -0
  39. package/dist/index.js +65 -5
  40. package/dist/index.js.map +1 -1
  41. package/dist/lib/mcp-bundle.d.ts +24 -2
  42. package/dist/lib/mcp-bundle.d.ts.map +1 -1
  43. package/dist/lib/mcp-bundle.js +83 -6
  44. package/dist/lib/mcp-bundle.js.map +1 -1
  45. package/dist/lib/mcp-bundle.test.d.ts +2 -0
  46. package/dist/lib/mcp-bundle.test.d.ts.map +1 -0
  47. package/dist/lib/mcp-bundle.test.js +97 -0
  48. package/dist/lib/mcp-bundle.test.js.map +1 -0
  49. package/dist/lib/project.d.ts.map +1 -1
  50. package/dist/lib/project.js +17 -1
  51. package/dist/lib/project.js.map +1 -1
  52. package/package.json +12 -10
  53. package/scripts/vendor-sensing-mcp.mjs +32 -0
  54. package/scripts/verify-publish-tarball.mjs +55 -0
  55. package/vendor/sensing-mcp/dist/index.js +23421 -0
  56. package/vendor/sensing-mcp/package.json +7 -0
@@ -0,0 +1,55 @@
1
+ #!/usr/bin/env node
2
+ // CI gate: mimic `pnpm publish` tarball shape without touching the registry.
3
+ // Catches workspace: leaks and resolver paths that miss vendor/sensing-mcp.
4
+ import { execFileSync } from 'child_process'
5
+ import { existsSync, mkdirSync, readFileSync, rmSync } from 'fs'
6
+ import { tmpdir } from 'os'
7
+ import { dirname, join } from 'path'
8
+ import { fileURLToPath, pathToFileURL } from 'url'
9
+
10
+ const cliRoot = join(dirname(fileURLToPath(import.meta.url)), '..')
11
+ const work = join(tmpdir(), `robrain-pack-verify-${process.pid}`)
12
+
13
+ function fail(msg) {
14
+ console.error(`pack:verify FAILED — ${msg}`)
15
+ process.exit(1)
16
+ }
17
+
18
+ mkdirSync(work, { recursive: true })
19
+
20
+ try {
21
+ execFileSync('node', ['scripts/vendor-sensing-mcp.mjs'], { cwd: cliRoot, stdio: 'inherit' })
22
+
23
+ execFileSync('pnpm', ['pack', '--pack-destination', work], { cwd: cliRoot, stdio: 'inherit' })
24
+
25
+ const version = JSON.parse(readFileSync(join(cliRoot, 'package.json'), 'utf8')).version
26
+ const tarball = join(work, `robrain-${version}.tgz`)
27
+ if (!existsSync(tarball)) fail(`tarball not found: ${tarball}`)
28
+
29
+ execFileSync('tar', ['-xzf', tarball, '-C', work], { stdio: 'inherit' })
30
+ const extracted = join(work, 'package')
31
+
32
+ const published = JSON.parse(readFileSync(join(extracted, 'package.json'), 'utf8'))
33
+ for (const [dep, spec] of Object.entries(published.dependencies ?? {})) {
34
+ if (String(spec).startsWith('workspace:')) {
35
+ fail(`workspace: dep leaked to tarball: ${dep}=${spec}`)
36
+ }
37
+ }
38
+
39
+ const vendorEntry = join(extracted, 'vendor', 'sensing-mcp', 'dist', 'index.js')
40
+ if (!existsSync(vendorEntry)) {
41
+ fail('vendor/sensing-mcp/dist/index.js missing from tarball')
42
+ }
43
+
44
+ const bundleUrl = pathToFileURL(join(extracted, 'dist', 'lib', 'mcp-bundle.js')).href
45
+ const { resolveInstalledSensingMcpDir } = await import(bundleUrl)
46
+ const dir = resolveInstalledSensingMcpDir()
47
+ if (!dir) fail('resolveInstalledSensingMcpDir() returned undefined in extracted tarball')
48
+ if (!existsSync(join(dir, 'dist', 'index.js'))) {
49
+ fail(`resolved dir has no dist/index.js: ${dir}`)
50
+ }
51
+
52
+ console.log(`pack:verify ok — vendor resolves from ${dir}`)
53
+ } finally {
54
+ rmSync(work, { recursive: true, force: true })
55
+ }