@talotrace/connect 0.0.0-stage → 0.2.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.
@@ -0,0 +1,30 @@
1
+ #!/usr/bin/env node
2
+ 'use strict';
3
+
4
+ const { spawn } = require('node:child_process');
5
+ const { binaryPath } = require('../lib/resolve');
6
+
7
+ let binary;
8
+ try {
9
+ binary = binaryPath(process.platform, process.arch, require.resolve);
10
+ } catch (error) {
11
+ console.error(error.message);
12
+ process.exit(1);
13
+ }
14
+
15
+ // stdio is inherited: `mcp` speaks the protocol on this process's stdin and stdout.
16
+ const child = spawn(binary, process.argv.slice(2), { stdio: 'inherit' });
17
+ for (const signal of ['SIGINT', 'SIGTERM', 'SIGHUP']) {
18
+ process.on(signal, () => child.kill(signal));
19
+ }
20
+ child.on('error', (error) => {
21
+ console.error(`could not start ${binary}: ${error.message}`);
22
+ process.exit(1);
23
+ });
24
+ child.on('exit', (code, signal) => {
25
+ if (signal) {
26
+ process.kill(process.pid, signal);
27
+ } else {
28
+ process.exit(code ?? 1);
29
+ }
30
+ });
@@ -0,0 +1,27 @@
1
+ 'use strict';
2
+
3
+ // The one table that says which npm package carries the Go build for which OS and CPU. The release
4
+ // script (npm/scripts/stage.mjs) builds its package list from the same names.
5
+ const SCOPE = '@talotrace';
6
+ const PLATFORMS = {
7
+ 'darwin-arm64': { pkg: `${SCOPE}/connect-darwin-arm64`, binary: 'talotrace-connect' },
8
+ 'darwin-x64': { pkg: `${SCOPE}/connect-darwin-x64`, binary: 'talotrace-connect' },
9
+ 'linux-arm64': { pkg: `${SCOPE}/connect-linux-arm64`, binary: 'talotrace-connect' },
10
+ 'linux-x64': { pkg: `${SCOPE}/connect-linux-x64`, binary: 'talotrace-connect' },
11
+ 'win32-x64': { pkg: `${SCOPE}/connect-win32-x64`, binary: 'talotrace-connect.exe' },
12
+ };
13
+
14
+ /** The platform entry for an OS and CPU, or null when no build exists for them. */
15
+ function platformFor(platform, arch) {
16
+ return PLATFORMS[`${platform}-${arch}`] || null;
17
+ }
18
+
19
+ /** An error message that names what was asked for and what is supported. */
20
+ function unsupportedMessage(platform, arch) {
21
+ return (
22
+ `@talotrace/connect has no build for ${platform}/${arch}. ` +
23
+ `Supported: ${Object.keys(PLATFORMS).join(', ')}.`
24
+ );
25
+ }
26
+
27
+ module.exports = { PLATFORMS, platformFor, unsupportedMessage };
package/lib/resolve.js ADDED
@@ -0,0 +1,27 @@
1
+ 'use strict';
2
+
3
+ const path = require('node:path');
4
+ const { platformFor, unsupportedMessage } = require('./platform');
5
+
6
+ /**
7
+ * The absolute path of the Go binary for this machine. `resolvePackage` finds a package's
8
+ * directory (require.resolve of its package.json); tests pass a fake one.
9
+ */
10
+ function binaryPath(platform, arch, resolvePackage) {
11
+ const entry = platformFor(platform, arch);
12
+ if (!entry) {
13
+ throw new Error(unsupportedMessage(platform, arch));
14
+ }
15
+ let manifest;
16
+ try {
17
+ manifest = resolvePackage(`${entry.pkg}/package.json`);
18
+ } catch {
19
+ throw new Error(
20
+ `${entry.pkg} is not installed. It is an optional dependency of @talotrace/connect; ` +
21
+ 'reinstall without --no-optional / --omit=optional.',
22
+ );
23
+ }
24
+ return path.join(path.dirname(manifest), 'bin', entry.binary);
25
+ }
26
+
27
+ module.exports = { binaryPath };
package/package.json CHANGED
@@ -1,6 +1,26 @@
1
1
  {
2
2
  "name": "@talotrace/connect",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.2.0",
4
+ "description": "TaloTrace Connect: the TaloTrace MCP server for your coding agent, with a tunnel to the app on your laptop.",
5
+ "license": "UNLICENSED",
6
+ "bin": {
7
+ "talotrace-connect": "bin/talotrace-connect.js"
8
+ },
9
+ "files": [
10
+ "bin",
11
+ "lib"
12
+ ],
13
+ "engines": {
14
+ "node": ">=18"
15
+ },
16
+ "publishConfig": {
17
+ "access": "public"
18
+ },
19
+ "optionalDependencies": {
20
+ "@talotrace/connect-darwin-arm64": "0.2.0",
21
+ "@talotrace/connect-darwin-x64": "0.2.0",
22
+ "@talotrace/connect-linux-arm64": "0.2.0",
23
+ "@talotrace/connect-linux-x64": "0.2.0",
24
+ "@talotrace/connect-win32-x64": "0.2.0"
25
+ }
26
+ }
package/README.md DELETED
@@ -1,3 +0,0 @@
1
- # Temporary Holding Version
2
-
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.