synsema 0.6.2

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 (3) hide show
  1. package/README.md +24 -0
  2. package/bin/synsema.js +60 -0
  3. package/package.json +35 -0
package/README.md ADDED
@@ -0,0 +1,24 @@
1
+ # synsema
2
+
3
+ [Synsema](https://docs.synsema.com) — the programming language for AI agents — installed from npm.
4
+ This package puts the **native `synsema` binary** (Rust, single static executable) on your
5
+ PATH; it is the same binary as the GitHub release, wrapped for the Node ecosystem.
6
+
7
+ ```sh
8
+ npm i -g synsema # global: `synsema run app.syn`
9
+ npx synsema run app.syn # or per project, no global install
10
+ npx synsema init # scaffold a project (hello.syn, .env.example, .gitignore)
11
+ ```
12
+
13
+ How it works: `synsema` depends on one platform package per target
14
+ (`@synsema/cli-linux-x64`, `@synsema/cli-darwin-arm64`, `@synsema/cli-darwin-x64`,
15
+ `@synsema/cli-win32-x64`) as `optionalDependencies` with `os`/`cpu` filters, so npm
16
+ installs only the binary for your machine. `bin/synsema.js` is a 40-line launcher that
17
+ runs it with your arguments — no `postinstall`, no downloads at install time, works with
18
+ `--ignore-scripts` and mirrored registries.
19
+
20
+ Updating: `npm i -g synsema@latest` (the binary's own `synsema update` notices it was
21
+ installed by npm and tells you the same). Other install paths — `curl -fsSL
22
+ https://synsema.com/install.sh | sh`, PowerShell, Docker, the WebAssembly artifacts and
23
+ the embeddable [`@synsema/wasm`](https://www.npmjs.com/package/@synsema/wasm) — are in the
24
+ [docs](https://docs.synsema.com/en/latest/00-quickstart).
package/bin/synsema.js ADDED
@@ -0,0 +1,60 @@
1
+ #!/usr/bin/env node
2
+ // Launcher de `synsema` instalado por npm: localiza el binario nativo de la plataforma
3
+ // (paquete @synsema/cli-<os>-<cpu>, instalado como optionalDependency por os/cpu) y lo
4
+ // ejecuta con los mismos argumentos, stdio heredado y el mismo exit code. Sin
5
+ // postinstall ni descargas: el binario viene dentro del paquete de plataforma, así
6
+ // `--ignore-scripts` y los registries espejo funcionan igual.
7
+ "use strict";
8
+
9
+ const { spawnSync } = require("node:child_process");
10
+ const { createRequire } = require("node:module");
11
+ const path = require("node:path");
12
+
13
+ const PLATFORMS = {
14
+ "linux-x64": "@synsema/cli-linux-x64",
15
+ "darwin-arm64": "@synsema/cli-darwin-arm64",
16
+ "darwin-x64": "@synsema/cli-darwin-x64",
17
+ "win32-x64": "@synsema/cli-win32-x64",
18
+ };
19
+
20
+ function binaryPath() {
21
+ const key = `${process.platform}-${process.arch}`;
22
+ const pkg = PLATFORMS[key];
23
+ if (!pkg) {
24
+ console.error(
25
+ `synsema: no prebuilt binary for ${key} (supported: ${Object.keys(PLATFORMS).join(", ")}).\n` +
26
+ "Install the native binary instead: https://docs.synsema.com/en/latest/00-quickstart",
27
+ );
28
+ process.exit(2);
29
+ }
30
+ const exe = process.platform === "win32" ? "synsema.exe" : "synsema";
31
+ try {
32
+ // require.resolve desde ESTE archivo: encuentra el paquete de plataforma tanto en una
33
+ // instalación global como en node_modules del proyecto (npx).
34
+ const req = createRequire(__filename);
35
+ return path.join(path.dirname(req.resolve(`${pkg}/package.json`)), exe);
36
+ } catch {
37
+ console.error(
38
+ `synsema: the platform package ${pkg} is not installed. npm skips it when the install\n` +
39
+ "ran with --no-optional or on a different os/cpu; reinstall with `npm i -g synsema`\n" +
40
+ "(or `npm i synsema` in the project) without --no-optional.",
41
+ );
42
+ process.exit(2);
43
+ }
44
+ }
45
+
46
+ const r = spawnSync(binaryPath(), process.argv.slice(2), {
47
+ stdio: "inherit",
48
+ // Le dice al binario que lo administra npm: `synsema update` no se sobreescribe a sí
49
+ // mismo, sugiere `npm i -g synsema@latest`.
50
+ env: { ...process.env, SYNSEMA_INSTALLED_BY: "npm" },
51
+ windowsHide: true,
52
+ });
53
+ if (r.error) {
54
+ console.error(`synsema: could not launch the binary: ${r.error.message}`);
55
+ process.exit(2);
56
+ }
57
+ if (r.signal) {
58
+ process.kill(process.pid, r.signal);
59
+ }
60
+ process.exit(r.status ?? 1);
package/package.json ADDED
@@ -0,0 +1,35 @@
1
+ {
2
+ "name": "synsema",
3
+ "version": "0.6.2",
4
+ "description": "Synsema — the programming language for AI agents. This package installs the native `synsema` binary (Linux, macOS, Windows) from npm: `npm i -g synsema` or `npx synsema run app.syn`.",
5
+ "license": "MIT",
6
+ "bin": {
7
+ "synsema": "bin/synsema.js"
8
+ },
9
+ "files": [
10
+ "bin/synsema.js",
11
+ "README.md"
12
+ ],
13
+ "engines": {
14
+ "node": ">=18"
15
+ },
16
+ "optionalDependencies": {
17
+ "@synsema/cli-linux-x64": "0.6.2",
18
+ "@synsema/cli-darwin-arm64": "0.6.2",
19
+ "@synsema/cli-darwin-x64": "0.6.2",
20
+ "@synsema/cli-win32-x64": "0.6.2"
21
+ },
22
+ "repository": {
23
+ "type": "git",
24
+ "url": "git+https://github.com/kitecosmic/synsema.git",
25
+ "directory": "packages/synsema-cli"
26
+ },
27
+ "homepage": "https://docs.synsema.com",
28
+ "keywords": [
29
+ "synsema",
30
+ "agents",
31
+ "llm",
32
+ "language",
33
+ "cli"
34
+ ]
35
+ }