@targlobal/mission-control 1.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.
package/.gitattributes ADDED
@@ -0,0 +1,2 @@
1
+ # Ensure shell scripts always use LF line endings
2
+ *.sh text eol=lf
package/README.md ADDED
@@ -0,0 +1,142 @@
1
+ # Mission Control CLI
2
+
3
+ ```
4
+ ╔══════════════════════════════════════════════════════════╗
5
+ ║ ███╗ ███╗ ██╗ ███████╗ ███████╗ ██╗ ██████╗ ███╗ ██╗ ║
6
+ ║ ████╗ ████║ ██║ ██╔════╝ ██╔════╝ ██║ ██╔═══██╗ ████╗ ██║ ║
7
+ ║ ██╔████╔██║ ██║ ███████╗ ███████╗ ██║ ██║ ██║ ██╔██╗ ██║ ║
8
+ ║ ██║╚██╔╝██║ ██║ ╚════██║ ╚════██║ ██║ ██║ ██║ ██║╚██╗██║ ║
9
+ ║ ██║ ╚═╝ ██║ ██║ ███████║ ███████║ ██║ ╚██████╔╝ ██║ ╚████║ ║
10
+ ║ ╚═╝ ╚═╝ ╚═╝ ╚══════╝ ╚══════╝ ╚═╝ ╚═════╝ ╚═╝ ╚═══╝ ║
11
+ ║ ║
12
+ ║ ⚡ CONTROL TAR Global Internal Task Management ║
13
+ ╚══════════════════════════════════════════════════════════════╝
14
+ ```
15
+
16
+ A powerful CLI tool for managing tasks in TAR Global's Mission Control system.
17
+
18
+ ## Installation
19
+
20
+ ### Quick Install (Linux/macOS/Termux)
21
+
22
+ ```bash
23
+ curl -fsSL https://targlobal.org/download/mc | bash
24
+ ```
25
+
26
+ ### Via npm (Alternative)
27
+
28
+ ```bash
29
+ npm install -g @targlobal/mission-control
30
+ ```
31
+
32
+ ### Termux (Android)
33
+
34
+ The installer automatically detects Termux and installs to `$PREFIX/bin`:
35
+
36
+ ```bash
37
+ pkg install nodejs
38
+ curl -fsSL https://targlobal.org/download/mc | bash
39
+ ```
40
+
41
+ ## Quick Start
42
+
43
+ ```bash
44
+ # 1. Login with your token
45
+ mc login
46
+
47
+ # 2. View your tasks
48
+ mc tasks
49
+
50
+ # 3. Create a new task
51
+ mc new "Fix the login bug" --type bug --priority high
52
+
53
+ # 4. Start working on a task
54
+ mc start 1001
55
+
56
+ # 5. Complete a task
57
+ mc done 1001
58
+ ```
59
+
60
+ ## Commands
61
+
62
+ | Command | Alias | Description |
63
+ |---------|-------|-------------|
64
+ | `mc login` | - | Authenticate with Mission Control |
65
+ | `mc logout` | - | Clear stored credentials |
66
+ | `mc tasks` | `ls` | List your assigned tasks |
67
+ | `mc show <id>` | `view` | Show task details |
68
+ | `mc new <title>` | `create` | Create a new task |
69
+ | `mc start <id>` | - | Move task to In Progress |
70
+ | `mc done <id>` | `complete` | Mark task as complete |
71
+ | `mc comment <id> <msg>` | `note` | Add a comment to a task |
72
+ | `mc boards` | - | List available boards |
73
+ | `mc stats` | - | Show your task statistics |
74
+ | `mc urgent` | - | Show critical tasks |
75
+ | `mc whoami` | - | Show current configuration |
76
+
77
+ ## Options
78
+
79
+ ### Creating Tasks
80
+
81
+ ```bash
82
+ mc new "Task title" [options]
83
+
84
+ Options:
85
+ -d, --description <desc> Task description
86
+ -p, --priority <priority> critical, high, medium, low (default: medium)
87
+ -t, --type <type> bug, feature, improvement, task (default: task)
88
+ -b, --board <board> Board slug (default: backend)
89
+ ```
90
+
91
+ ### Listing Tasks
92
+
93
+ ```bash
94
+ mc tasks [options]
95
+
96
+ Options:
97
+ -a, --all Show all tasks, not just mine
98
+ -b, --board <board> Filter by board
99
+ -p, --priority <priority> Filter by priority
100
+ ```
101
+
102
+ ## Examples
103
+
104
+ ```bash
105
+ # Create a high priority bug
106
+ mc new "Fix null pointer exception" -t bug -p high -b backend
107
+
108
+ # Create a feature request
109
+ mc new "Add dark mode" -t feature -d "Users want dark mode support"
110
+
111
+ # View task details
112
+ mc show MC-1001
113
+
114
+ # Add a comment
115
+ mc comment 1001 "Found the issue - missing validation on line 47"
116
+
117
+ # View stats
118
+ mc stats
119
+
120
+ # See urgent tasks
121
+ mc urgent
122
+ ```
123
+
124
+ ## Configuration
125
+
126
+ Config is stored in `~/.config/mission-control/config.json`
127
+
128
+ ```bash
129
+ # View current config
130
+ mc whoami
131
+
132
+ # Change API URL
133
+ mc login --url https://api.custom.com
134
+ ```
135
+
136
+ ## Support
137
+
138
+ For issues or questions, contact the TAR Global development team.
139
+
140
+ ---
141
+
142
+ Built with ❤️ by TAR Global
package/dist/api.d.ts ADDED
@@ -0,0 +1,119 @@
1
+ import { AxiosInstance } from 'axios';
2
+ export declare const getApiClient: () => AxiosInstance;
3
+ export declare const resetApiClient: () => void;
4
+ export interface Task {
5
+ id: string;
6
+ task_number: number;
7
+ display_id: string;
8
+ title: string;
9
+ description?: string;
10
+ board: string;
11
+ board_name: string;
12
+ column: string;
13
+ column_name: string;
14
+ priority: 'critical' | 'high' | 'medium' | 'low';
15
+ task_type: 'bug' | 'feature' | 'improvement' | 'task' | 'escalation';
16
+ assignees: {
17
+ id: number;
18
+ display_name: string;
19
+ }[];
20
+ labels: {
21
+ id: string;
22
+ name: string;
23
+ color: string;
24
+ }[];
25
+ due_date: string | null;
26
+ is_overdue: boolean;
27
+ is_completed: boolean;
28
+ completed_at: string | null;
29
+ created_by_name: string;
30
+ created_at: string;
31
+ comment_count: number;
32
+ has_support_ticket: boolean;
33
+ support_ticket_id: string | null;
34
+ }
35
+ export interface Board {
36
+ id: string;
37
+ name: string;
38
+ slug: string;
39
+ team: string;
40
+ task_count: number;
41
+ }
42
+ export interface Column {
43
+ id: string;
44
+ name: string;
45
+ position: number;
46
+ is_done_column: boolean;
47
+ color: string;
48
+ }
49
+ export declare const api: {
50
+ listTasks(params?: {
51
+ board?: string;
52
+ mine?: boolean;
53
+ priority?: string;
54
+ }): Promise<any>;
55
+ getMyTasks(): Promise<any>;
56
+ getTask(taskNumber: string | number): Promise<any>;
57
+ createTask(data: {
58
+ title: string;
59
+ description?: string;
60
+ board: string;
61
+ priority?: string;
62
+ task_type?: string;
63
+ }): Promise<any>;
64
+ updateTask(taskNumber: string | number, data: Partial<Task>): Promise<any>;
65
+ moveTask(taskNumber: string | number, columnId: string, position?: number): Promise<any>;
66
+ completeTask(taskNumber: string | number): Promise<any>;
67
+ addComment(taskNumber: string | number, content: string): Promise<any>;
68
+ getComments(taskNumber: string | number): Promise<any>;
69
+ getActivity(taskNumber: string | number): Promise<any>;
70
+ listBoards(): Promise<any>;
71
+ getBoard(slug: string): Promise<any>;
72
+ getBoardTasks(slug: string): Promise<any>;
73
+ getStats(): Promise<any>;
74
+ listLabels(): Promise<any>;
75
+ getCurrentUser(): Promise<any>;
76
+ getPayoutMetrics(plan?: string): Promise<any>;
77
+ listPayouts(params?: {
78
+ status?: string;
79
+ plan?: string;
80
+ search?: string;
81
+ page?: number;
82
+ limit?: number;
83
+ }): Promise<any>;
84
+ getPayout(id: number): Promise<any>;
85
+ batchApprovePayouts(payoutIds: number[]): Promise<any>;
86
+ batchCancelPayouts(payoutIds: number[], options?: {
87
+ cooldown_hours?: number;
88
+ cooldown_reason?: string;
89
+ }): Promise<any>;
90
+ processPayouts(): Promise<any>;
91
+ };
92
+ export interface Payout {
93
+ id: number;
94
+ user_id: number;
95
+ user_email: string;
96
+ amount: number;
97
+ crypto_type: string;
98
+ crypto_network: string;
99
+ wallet_address: string;
100
+ plan: string;
101
+ payed: boolean;
102
+ triggered: boolean;
103
+ trackid: string | null;
104
+ transaction_hash: string | null;
105
+ created_at: string;
106
+ valid_address: boolean;
107
+ tarpay_id: string | null;
108
+ tarpay_status: string | null;
109
+ }
110
+ export interface PayoutMetrics {
111
+ total_payouts: number;
112
+ pending_payouts: number;
113
+ completed_payouts: number;
114
+ failed_payouts: number;
115
+ total_amount: number;
116
+ paid_amount: number;
117
+ pending_amount: number;
118
+ }
119
+ //# sourceMappingURL=api.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":"AAAA,OAAc,EAAE,aAAa,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,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,OAAO,CAAC;IACf,SAAS,EAAE,OAAO,CAAC;IACnB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,OAAO,CAAC;IACvB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9B;AAED,MAAM,WAAW,aAAa;IAC5B,aAAa,EAAE,MAAM,CAAC;IACtB,eAAe,EAAE,MAAM,CAAC;IACxB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,MAAM,CAAC;CACxB"}
package/dist/api.js ADDED
@@ -0,0 +1,137 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.api = exports.resetApiClient = exports.getApiClient = void 0;
7
+ const axios_1 = __importDefault(require("axios"));
8
+ const config_1 = require("./config");
9
+ let apiClient = null;
10
+ const getApiClient = () => {
11
+ if (!apiClient) {
12
+ const { apiUrl, token, tokenType } = (0, config_1.getConfig)();
13
+ const authPrefix = tokenType === 'bearer' ? 'Bearer' : 'Token';
14
+ apiClient = axios_1.default.create({
15
+ baseURL: apiUrl,
16
+ headers: {
17
+ Authorization: `${authPrefix} ${token}`,
18
+ 'Content-Type': 'application/json',
19
+ },
20
+ });
21
+ }
22
+ return apiClient;
23
+ };
24
+ exports.getApiClient = getApiClient;
25
+ const resetApiClient = () => {
26
+ apiClient = null;
27
+ };
28
+ exports.resetApiClient = resetApiClient;
29
+ // API Functions
30
+ exports.api = {
31
+ // Tasks
32
+ async listTasks(params) {
33
+ const response = await (0, exports.getApiClient)().get('/api/tasks/', { params });
34
+ return response.data;
35
+ },
36
+ async getMyTasks() {
37
+ const response = await (0, exports.getApiClient)().get('/api/tasks/my-tasks/');
38
+ return response.data;
39
+ },
40
+ async getTask(taskNumber) {
41
+ const response = await (0, exports.getApiClient)().get(`/api/tasks/${taskNumber}/`);
42
+ return response.data;
43
+ },
44
+ async createTask(data) {
45
+ const response = await (0, exports.getApiClient)().post('/api/tasks/', data);
46
+ return response.data;
47
+ },
48
+ async updateTask(taskNumber, data) {
49
+ const response = await (0, exports.getApiClient)().patch(`/api/tasks/${taskNumber}/`, data);
50
+ return response.data;
51
+ },
52
+ async moveTask(taskNumber, columnId, position) {
53
+ const response = await (0, exports.getApiClient)().post(`/api/tasks/${taskNumber}/move/`, {
54
+ column_id: columnId,
55
+ position: position ?? 0,
56
+ });
57
+ return response.data;
58
+ },
59
+ async completeTask(taskNumber) {
60
+ const response = await (0, exports.getApiClient)().post(`/api/tasks/${taskNumber}/complete/`);
61
+ return response.data;
62
+ },
63
+ async addComment(taskNumber, content) {
64
+ const response = await (0, exports.getApiClient)().post(`/api/tasks/${taskNumber}/comments/`, {
65
+ content,
66
+ });
67
+ return response.data;
68
+ },
69
+ async getComments(taskNumber) {
70
+ const response = await (0, exports.getApiClient)().get(`/api/tasks/${taskNumber}/comments/`);
71
+ return response.data;
72
+ },
73
+ async getActivity(taskNumber) {
74
+ const response = await (0, exports.getApiClient)().get(`/api/tasks/${taskNumber}/activity/`);
75
+ return response.data;
76
+ },
77
+ // Boards
78
+ async listBoards() {
79
+ const response = await (0, exports.getApiClient)().get('/api/tasks/boards/');
80
+ return response.data;
81
+ },
82
+ async getBoard(slug) {
83
+ const response = await (0, exports.getApiClient)().get(`/api/tasks/boards/${slug}/`);
84
+ return response.data;
85
+ },
86
+ async getBoardTasks(slug) {
87
+ const response = await (0, exports.getApiClient)().get(`/api/tasks/boards/${slug}/tasks/`);
88
+ return response.data;
89
+ },
90
+ // Stats
91
+ async getStats() {
92
+ const response = await (0, exports.getApiClient)().get('/api/tasks/stats/');
93
+ return response.data;
94
+ },
95
+ // Labels
96
+ async listLabels() {
97
+ const response = await (0, exports.getApiClient)().get('/api/tasks/labels/');
98
+ return response.data;
99
+ },
100
+ // User
101
+ async getCurrentUser() {
102
+ const response = await (0, exports.getApiClient)().get('/api/admin/sso/agents/me/');
103
+ return response.data;
104
+ },
105
+ // ==================== PAYOUTS (Admin) ====================
106
+ async getPayoutMetrics(plan) {
107
+ const params = plan ? { plan } : {};
108
+ const response = await (0, exports.getApiClient)().get('/api/admin/payout/metrics/', { params });
109
+ return response.data;
110
+ },
111
+ async listPayouts(params) {
112
+ const response = await (0, exports.getApiClient)().get('/api/admin/payout/payouts/', { params });
113
+ return response.data;
114
+ },
115
+ async getPayout(id) {
116
+ const response = await (0, exports.getApiClient)().get(`/api/admin/payout/payouts/${id}/`);
117
+ return response.data;
118
+ },
119
+ async batchApprovePayouts(payoutIds) {
120
+ const response = await (0, exports.getApiClient)().post('/api/admin/payout/payouts/batch-approve/', {
121
+ payout_ids: payoutIds,
122
+ });
123
+ return response.data;
124
+ },
125
+ async batchCancelPayouts(payoutIds, options) {
126
+ const response = await (0, exports.getApiClient)().post('/api/admin/payout/payouts/batch-cancel/', {
127
+ payout_ids: payoutIds,
128
+ ...options,
129
+ });
130
+ return response.data;
131
+ },
132
+ async processPayouts() {
133
+ const response = await (0, exports.getApiClient)().post('/api/admin/payout/process/');
134
+ return response.data;
135
+ },
136
+ };
137
+ //# sourceMappingURL=api.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api.js","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings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;QACH,OAAO,QAAQ,CAAC,IAAI,CAAC;IACvB,CAAC;IAED,KAAK,CAAC,cAAc;QAClB,MAAM,QAAQ,GAAG,MAAM,IAAA,oBAAY,GAAE,CAAC,IAAI,CAAC,4BAA4B,CAAC,CAAC;QACzE,OAAO,QAAQ,CAAC,IAAI,CAAC;IACvB,CAAC;CACF,CAAC"}
@@ -0,0 +1,21 @@
1
+ import Conf from 'conf';
2
+ interface UserInfo {
3
+ name: string;
4
+ email: string;
5
+ }
6
+ declare const config: Conf<any>;
7
+ export declare const getConfig: () => {
8
+ apiUrl: string;
9
+ token: string;
10
+ tokenType: string;
11
+ defaultBoard: string;
12
+ user: UserInfo | null;
13
+ compact: string;
14
+ };
15
+ export declare const setConfig: (key: string, value: any) => void;
16
+ export declare const setUser: (user: UserInfo | null) => void;
17
+ export declare const getUser: () => UserInfo | null;
18
+ export declare const isAuthenticated: () => boolean;
19
+ export declare const clearConfig: () => void;
20
+ export default config;
21
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,UAAU,QAAQ;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf;AAGD,QAAA,MAAM,MAAM,WAUV,CAAC;AAEH,eAAO,MAAM,SAAS;YACY,MAAM;WACR,MAAM;eACE,MAAM;kBACA,MAAM;UACtB,QAAQ,GAAG,IAAI;aACT,MAAM;CACxC,CAAC;AAEH,eAAO,MAAM,SAAS,GAAI,KAAK,MAAM,EAAE,OAAO,GAAG,SAEhD,CAAC;AAEF,eAAO,MAAM,OAAO,GAAI,MAAM,QAAQ,GAAG,IAAI,SAE5C,CAAC;AAEF,eAAO,MAAM,OAAO,QAAO,QAAQ,GAAG,IAErC,CAAC;AAEF,eAAO,MAAM,eAAe,eAE3B,CAAC;AAEF,eAAO,MAAM,WAAW,YAEvB,CAAC;AAEF,eAAe,MAAM,CAAC"}
package/dist/config.js ADDED
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.clearConfig = exports.isAuthenticated = exports.getUser = exports.setUser = exports.setConfig = exports.getConfig = void 0;
7
+ const conf_1 = __importDefault(require("conf"));
8
+ // Use any to avoid strict type issues with different conf versions
9
+ const config = new conf_1.default({
10
+ projectName: 'mission-control',
11
+ defaults: {
12
+ apiUrl: 'https://api.targlobal.org',
13
+ token: '',
14
+ tokenType: 'bearer',
15
+ defaultBoard: 'backend',
16
+ user: null,
17
+ compact: 'auto', // 'auto' | 'on' | 'off'
18
+ },
19
+ });
20
+ const getConfig = () => ({
21
+ apiUrl: config.get('apiUrl'),
22
+ token: config.get('token'),
23
+ tokenType: config.get('tokenType'),
24
+ defaultBoard: config.get('defaultBoard'),
25
+ user: config.get('user'),
26
+ compact: config.get('compact'),
27
+ });
28
+ exports.getConfig = getConfig;
29
+ const setConfig = (key, value) => {
30
+ config.set(key, value);
31
+ };
32
+ exports.setConfig = setConfig;
33
+ const setUser = (user) => {
34
+ config.set('user', user);
35
+ };
36
+ exports.setUser = setUser;
37
+ const getUser = () => {
38
+ return config.get('user');
39
+ };
40
+ exports.getUser = getUser;
41
+ const isAuthenticated = () => {
42
+ return !!config.get('token');
43
+ };
44
+ exports.isAuthenticated = isAuthenticated;
45
+ const clearConfig = () => {
46
+ config.clear();
47
+ };
48
+ exports.clearConfig = clearConfig;
49
+ exports.default = config;
50
+ //# sourceMappingURL=config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AAOxB,mEAAmE;AACnE,MAAM,MAAM,GAAG,IAAI,cAAI,CAAM;IAC3B,WAAW,EAA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