@barnum/troupe 0.0.0-main-0b45c5f4

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.
package/README.md ADDED
@@ -0,0 +1,32 @@
1
+ # @barnum/troupe
2
+
3
+ Troupe - agent pool daemon for managing workers with file-based task dispatch.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install -g @barnum/troupe
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ```bash
14
+ # Start the agent pool server
15
+ troupe start ./workspace
16
+
17
+ # Submit a task and wait for result
18
+ troupe submit ./workspace "task payload"
19
+
20
+ # Stop a running server
21
+ troupe stop ./workspace
22
+ ```
23
+
24
+ Or with npx:
25
+
26
+ ```bash
27
+ npx @barnum/troupe start ./workspace
28
+ ```
29
+
30
+ ## Agent Protocol
31
+
32
+ See [AGENT_PROTOCOL.md](https://github.com/barnum-circus/barnum/blob/master/crates/troupe/protocols/AGENT_PROTOCOL.md) for how agents communicate with the daemon.
Binary file
Binary file
Binary file
Binary file
Binary file
package/cli.js ADDED
@@ -0,0 +1,20 @@
1
+ #!/usr/bin/env node
2
+ 'use strict';
3
+
4
+ var bin = require('.');
5
+ var spawn = require('child_process').spawn;
6
+ var chmodSync = require('fs').chmodSync;
7
+
8
+ var input = process.argv.slice(2);
9
+
10
+ if (bin != null) {
11
+ try {
12
+ chmodSync(bin, 0o755);
13
+ } catch {}
14
+
15
+ spawn(bin, input, { stdio: 'inherit' }).on('exit', process.exit);
16
+ } else {
17
+ throw new Error(
18
+ `Platform "${process.platform} (${process.arch})" not supported.`
19
+ );
20
+ }
package/index.js ADDED
@@ -0,0 +1,23 @@
1
+ 'use strict';
2
+
3
+ const path = require('path');
4
+
5
+ let binary;
6
+
7
+ if (process.platform === 'darwin' && process.arch === 'x64') {
8
+ binary = path.join(__dirname, 'artifacts', 'macos-x64', 'troupe');
9
+ } else if (process.platform === 'darwin' && process.arch === 'arm64') {
10
+ binary = path.join(__dirname, 'artifacts', 'macos-arm64', 'troupe');
11
+ } else if (process.platform === 'linux' && process.arch === 'x64') {
12
+ binary = path.join(__dirname, 'artifacts', 'linux-x64', 'troupe');
13
+ } else if (process.platform === 'linux' && process.arch === 'arm64') {
14
+ binary = path.join(__dirname, 'artifacts', 'linux-arm64', 'troupe');
15
+ } else if (process.platform === 'win32' && process.arch === 'x64') {
16
+ binary = path.join(__dirname, 'artifacts', 'win-x64', 'troupe.exe');
17
+ } else {
18
+ throw new Error(
19
+ `Platform "${process.platform} (${process.arch})" not supported.`
20
+ );
21
+ }
22
+
23
+ module.exports = binary;
package/package.json ADDED
@@ -0,0 +1,32 @@
1
+ {
2
+ "name": "@barnum/troupe",
3
+ "version": "0.0.0-main-0b45c5f4",
4
+ "description": "Troupe - agent pool daemon for managing workers with file-based task dispatch.",
5
+ "main": "index.js",
6
+ "bin": {
7
+ "troupe": "cli.js"
8
+ },
9
+ "author": "Robert Balicki",
10
+ "license": "MIT",
11
+ "repository": {
12
+ "type": "git",
13
+ "url": "git+https://github.com/barnum-circus/barnum.git"
14
+ },
15
+ "publishConfig": {
16
+ "access": "public",
17
+ "registry": "https://registry.npmjs.org"
18
+ },
19
+ "keywords": [
20
+ "agent",
21
+ "pool",
22
+ "task-queue",
23
+ "cli",
24
+ "troupe"
25
+ ],
26
+ "files": [
27
+ "index.js",
28
+ "cli.js",
29
+ "artifacts/**/*"
30
+ ],
31
+ "sideEffects": false
32
+ }