@manica/agent 0.0.0-stage → 0.1.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,35 @@
1
+ #!/usr/bin/env node
2
+ // The `manica-agent` command of the @manica/agent npm package: runs the
3
+ // executable of the platform package the package manager installed next to
4
+ // it. Signals are forwarded, so a SIGTERM still lets running jobs finish.
5
+ import { spawn } from 'node:child_process'
6
+ import { createRequire } from 'node:module'
7
+
8
+ const name = `@manica/agent-${process.platform}-${process.arch}`
9
+
10
+ let binary
11
+ try {
12
+ binary = createRequire(import.meta.url).resolve(`${name}/bin/manica-agent`)
13
+ } catch {
14
+ console.error(
15
+ `manica-agent: ${name} is not installed. Either ${process.platform}-${process.arch} is not supported, or optional dependencies were skipped while installing @manica/agent.`,
16
+ )
17
+ process.exit(1)
18
+ }
19
+
20
+ const child = spawn(binary, process.argv.slice(2), { stdio: 'inherit' })
21
+ for (const signal of ['SIGINT', 'SIGTERM', 'SIGHUP']) {
22
+ process.on(signal, () => child.kill(signal))
23
+ }
24
+ child.on('error', (error) => {
25
+ console.error(`manica-agent: ${error.message}`)
26
+ process.exit(1)
27
+ })
28
+ child.on('exit', (code, signal) => {
29
+ if (signal) {
30
+ process.removeAllListeners(signal)
31
+ process.kill(process.pid, signal)
32
+ } else {
33
+ process.exit(code ?? 1)
34
+ }
35
+ })
package/package.json CHANGED
@@ -1,6 +1,24 @@
1
1
  {
2
2
  "name": "@manica/agent",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.0",
4
+ "homepage": "https://github.com/getmanica/manica",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "git+https://github.com/getmanica/manica.git",
8
+ "directory": "apps/agent"
9
+ },
10
+ "description": "Run your own GitHub Actions runners on your own machines",
11
+ "type": "module",
12
+ "bin": {
13
+ "manica-agent": "bin/manica-agent.js"
14
+ },
15
+ "files": [
16
+ "bin"
17
+ ],
18
+ "optionalDependencies": {
19
+ "@manica/agent-darwin-arm64": "0.1.0",
20
+ "@manica/agent-darwin-x64": "0.1.0",
21
+ "@manica/agent-linux-arm64": "0.1.0",
22
+ "@manica/agent-linux-x64": "0.1.0"
23
+ }
24
+ }
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.