@agentics/taskman 0.1.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.
package/bin/run.js ADDED
@@ -0,0 +1,75 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { spawn } from 'child_process';
4
+ import { fileURLToPath } from 'url';
5
+ import { dirname, join } from 'path';
6
+ import { existsSync } from 'fs';
7
+
8
+ const __dirname = dirname(fileURLToPath(import.meta.url));
9
+
10
+ function getPlatform() {
11
+ const platform = process.platform;
12
+ const arch = process.arch;
13
+
14
+ let os;
15
+ switch (platform) {
16
+ case 'darwin':
17
+ os = 'darwin';
18
+ break;
19
+ case 'linux':
20
+ os = 'linux';
21
+ break;
22
+ case 'win32':
23
+ os = 'windows';
24
+ break;
25
+ default:
26
+ throw new Error(`Unsupported platform: ${platform}`);
27
+ }
28
+
29
+ let cpu;
30
+ switch (arch) {
31
+ case 'x64':
32
+ cpu = 'amd64';
33
+ break;
34
+ case 'arm64':
35
+ cpu = 'arm64';
36
+ break;
37
+ default:
38
+ throw new Error(`Unsupported architecture: ${arch}`);
39
+ }
40
+
41
+ return { os, cpu };
42
+ }
43
+
44
+ function getBinaryName() {
45
+ const { os, cpu } = getPlatform();
46
+ const ext = os === 'windows' ? '.exe' : '';
47
+ return `taskman-${os}-${cpu}${ext}`;
48
+ }
49
+
50
+ function run() {
51
+ const binaryName = getBinaryName();
52
+ const binaryPath = join(__dirname, binaryName);
53
+
54
+ if (!existsSync(binaryPath)) {
55
+ console.error(`Binary not found: ${binaryPath}`);
56
+ console.error('Please reinstall the package: npm install -g @agentics/taskman');
57
+ process.exit(1);
58
+ }
59
+
60
+ const child = spawn(binaryPath, process.argv.slice(2), {
61
+ stdio: 'inherit',
62
+ env: process.env
63
+ });
64
+
65
+ child.on('error', (err) => {
66
+ console.error(`Failed to start: ${err.message}`);
67
+ process.exit(1);
68
+ });
69
+
70
+ child.on('exit', (code) => {
71
+ process.exit(code ?? 0);
72
+ });
73
+ }
74
+
75
+ run();
Binary file
Binary file
Binary file
Binary file
Binary file
package/package.json ADDED
@@ -0,0 +1,48 @@
1
+ {
2
+ "name": "@agentics/taskman",
3
+ "version": "0.1.1",
4
+ "description": "Taskman - AI-powered task and project manager by Agentics",
5
+ "type": "module",
6
+ "private": false,
7
+ "license": "MIT",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://gitlab.com/agentics-ai/taskman.git"
11
+ },
12
+ "homepage": "https://agentics.co.za",
13
+ "author": "Agentics <connor@agentics.co.za>",
14
+ "keywords": [
15
+ "ai",
16
+ "cli",
17
+ "agentics",
18
+ "taskman",
19
+ "task",
20
+ "project",
21
+ "manager",
22
+ "todo",
23
+ "productivity"
24
+ ],
25
+ "bin": {
26
+ "taskman": "bin/run.js"
27
+ },
28
+ "files": [
29
+ "bin",
30
+ "scripts"
31
+ ],
32
+ "scripts": {
33
+ "postinstall": "node scripts/postinstall.js",
34
+ "build": "./scripts/build.sh"
35
+ },
36
+ "os": [
37
+ "darwin",
38
+ "linux",
39
+ "win32"
40
+ ],
41
+ "cpu": [
42
+ "x64",
43
+ "arm64"
44
+ ],
45
+ "engines": {
46
+ "node": ">=16"
47
+ }
48
+ }
@@ -0,0 +1,33 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { chmod } from 'fs/promises';
4
+ import { existsSync } from 'fs';
5
+ import { fileURLToPath } from 'url';
6
+ import { dirname, join } from 'path';
7
+
8
+ const __dirname = dirname(fileURLToPath(import.meta.url));
9
+ const binDir = join(__dirname, '..', 'bin');
10
+
11
+ async function postinstall() {
12
+ const binaries = [
13
+ 'taskman-darwin-amd64',
14
+ 'taskman-darwin-arm64',
15
+ 'taskman-linux-amd64',
16
+ 'taskman-linux-arm64'
17
+ ];
18
+
19
+ for (const binary of binaries) {
20
+ const binaryPath = join(binDir, binary);
21
+ if (existsSync(binaryPath)) {
22
+ try {
23
+ await chmod(binaryPath, 0o755);
24
+ } catch (err) {
25
+ }
26
+ }
27
+ }
28
+
29
+ console.log('⚡ Taskman installed successfully!');
30
+ console.log(' Run "npx taskman" to get started.');
31
+ }
32
+
33
+ postinstall().catch(console.error);