@moxxy/cli 0.0.1 → 0.0.3
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 +91 -0
- package/dist/chunk-6DZX6EAA.mjs +37 -0
- package/dist/chunk-C46NSEKG.mjs +211 -0
- package/dist/chunk-NGVL4Q5C.mjs +1102 -0
- package/dist/cli-7MK4YGOP.mjs +7 -0
- package/dist/dist-7LTHRYKA.mjs +11569 -0
- package/dist/dist-FAXRJMEN.mjs +6812 -0
- package/dist/dist-LKIOZQ42.mjs +17 -0
- package/dist/dist-UYA4RJUH.mjs +2792 -0
- package/dist/index.js +23868 -111
- package/dist/index.mjs +3 -2
- package/dist/src-D5HMDDVE.mjs +1324 -0
- package/package.json +13 -12
package/README.md
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
# @moxxy/cli
|
|
2
|
+
|
|
3
|
+
User-facing CLI for [Moxxy](https://github.com/webeferen/moxxy) agent orchestration.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install -g @moxxy/cli
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Quick Start
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
# Interactive setup — walks you through each config step
|
|
15
|
+
moxxy config init
|
|
16
|
+
|
|
17
|
+
# Or pass flags directly
|
|
18
|
+
moxxy config init --sdk claude --github-token ghp_xxx
|
|
19
|
+
|
|
20
|
+
# Add a repository to watch
|
|
21
|
+
moxxy repo add owner/repo --events issues.opened,issues.labeled
|
|
22
|
+
|
|
23
|
+
# Start orchestration
|
|
24
|
+
moxxy start
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Commands
|
|
28
|
+
|
|
29
|
+
### `moxxy config init`
|
|
30
|
+
|
|
31
|
+
Initialize configuration. Launches an interactive wizard when called without flags.
|
|
32
|
+
|
|
33
|
+
| Flag | Description | Default |
|
|
34
|
+
|------|-------------|---------|
|
|
35
|
+
| `--sdk <provider>` | `molt` or `claude` | _(interactive)_ |
|
|
36
|
+
| `--github-token <token>` | GitHub personal access token | _(interactive)_ |
|
|
37
|
+
| `--gateway-url <url>` | Molt Gateway URL (molt only) | |
|
|
38
|
+
| `--auth-token <token>` | Molt Gateway auth token | |
|
|
39
|
+
| `--claude-api-key <key>` | Anthropic API key (claude only) | |
|
|
40
|
+
| `--claude-model <model>` | Claude model | `claude-sonnet-4-5` |
|
|
41
|
+
| `--claude-cli-path <path>` | Path to Claude CLI binary | `claude` |
|
|
42
|
+
| `--webhook-secret <secret>` | GitHub webhook secret | |
|
|
43
|
+
| `--webhook-port <port>` | Webhook server port | `3456` |
|
|
44
|
+
| `--agent-id <id>` | Agent ID | |
|
|
45
|
+
|
|
46
|
+
### `moxxy config set <key> <value>`
|
|
47
|
+
|
|
48
|
+
Set a config value using dot notation (e.g. `moxxy config set webhook.port 8080`).
|
|
49
|
+
|
|
50
|
+
### `moxxy config get <key>`
|
|
51
|
+
|
|
52
|
+
Read a config value using dot notation.
|
|
53
|
+
|
|
54
|
+
### `moxxy repo add <owner/repo>`
|
|
55
|
+
|
|
56
|
+
Add a repository to watch.
|
|
57
|
+
|
|
58
|
+
| Flag | Description | Default |
|
|
59
|
+
|------|-------------|---------|
|
|
60
|
+
| `--branch <branch>` | Default branch | `main` |
|
|
61
|
+
| `--events <events>` | Comma-separated events | `issues.opened,issues.labeled` |
|
|
62
|
+
|
|
63
|
+
### `moxxy repo list`
|
|
64
|
+
|
|
65
|
+
List all configured repositories.
|
|
66
|
+
|
|
67
|
+
### `moxxy repo remove <owner/repo>`
|
|
68
|
+
|
|
69
|
+
Remove a repository from the watch list.
|
|
70
|
+
|
|
71
|
+
### `moxxy start`
|
|
72
|
+
|
|
73
|
+
Start the orchestration server. Connects to the configured SDK, initializes the agent supervisor, and starts the webhook server to listen for GitHub events on watched repositories.
|
|
74
|
+
|
|
75
|
+
### `moxxy status`
|
|
76
|
+
|
|
77
|
+
Display current configuration: SDK provider, GitHub token status, webhook settings, watched repositories, and agent configuration.
|
|
78
|
+
|
|
79
|
+
## Programmatic Usage
|
|
80
|
+
|
|
81
|
+
```typescript
|
|
82
|
+
import { createProgram, ConfigManager } from '@moxxy/cli';
|
|
83
|
+
|
|
84
|
+
const manager = new ConfigManager();
|
|
85
|
+
await manager.load();
|
|
86
|
+
console.log(manager.get('sdk'));
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## License
|
|
90
|
+
|
|
91
|
+
MIT
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
8
|
+
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
9
|
+
}) : x)(function(x) {
|
|
10
|
+
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
11
|
+
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
12
|
+
});
|
|
13
|
+
var __commonJS = (cb, mod) => function __require2() {
|
|
14
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
15
|
+
};
|
|
16
|
+
var __copyProps = (to, from, except, desc) => {
|
|
17
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
18
|
+
for (let key of __getOwnPropNames(from))
|
|
19
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
20
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
21
|
+
}
|
|
22
|
+
return to;
|
|
23
|
+
};
|
|
24
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
25
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
26
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
27
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
28
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
29
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
30
|
+
mod
|
|
31
|
+
));
|
|
32
|
+
|
|
33
|
+
export {
|
|
34
|
+
__require,
|
|
35
|
+
__commonJS,
|
|
36
|
+
__toESM
|
|
37
|
+
};
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
// ../integration-base/dist/index.mjs
|
|
2
|
+
var IntegrationError = class extends Error {
|
|
3
|
+
constructor(message, integration, code, cause) {
|
|
4
|
+
super(message);
|
|
5
|
+
this.integration = integration;
|
|
6
|
+
this.code = code;
|
|
7
|
+
this.cause = cause;
|
|
8
|
+
this.name = "IntegrationError";
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
var IntegrationConnectionError = class extends IntegrationError {
|
|
12
|
+
constructor(message, integration, cause) {
|
|
13
|
+
super(message, integration, "CONNECTION_ERROR", cause);
|
|
14
|
+
this.name = "IntegrationConnectionError";
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
var IntegrationConfigError = class extends IntegrationError {
|
|
18
|
+
constructor(message, integration, cause) {
|
|
19
|
+
super(message, integration, "CONFIG_ERROR", cause);
|
|
20
|
+
this.name = "IntegrationConfigError";
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
var IntegrationNotFoundError = class extends IntegrationError {
|
|
24
|
+
constructor(integration) {
|
|
25
|
+
super(`Integration "${integration}" not found`, integration, "NOT_FOUND");
|
|
26
|
+
this.name = "IntegrationNotFoundError";
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
var BaseIntegration = class {
|
|
30
|
+
constructor(name, type) {
|
|
31
|
+
this.name = name;
|
|
32
|
+
this.type = type;
|
|
33
|
+
}
|
|
34
|
+
_status = "disconnected";
|
|
35
|
+
handlers = /* @__PURE__ */ new Map();
|
|
36
|
+
get status() {
|
|
37
|
+
return this._status;
|
|
38
|
+
}
|
|
39
|
+
async connect(config) {
|
|
40
|
+
if (this._status === "connected" || this._status === "watching") {
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
this._status = "connecting";
|
|
44
|
+
try {
|
|
45
|
+
await this.onConnect(config);
|
|
46
|
+
this._status = "connected";
|
|
47
|
+
} catch (error) {
|
|
48
|
+
this._status = "error";
|
|
49
|
+
throw new IntegrationConnectionError(
|
|
50
|
+
`Failed to connect integration "${this.name}": ${error instanceof Error ? error.message : String(error)}`,
|
|
51
|
+
this.name,
|
|
52
|
+
error instanceof Error ? error : void 0
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
async disconnect() {
|
|
57
|
+
if (this._status === "disconnected") {
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
try {
|
|
61
|
+
await this.onDisconnect();
|
|
62
|
+
} finally {
|
|
63
|
+
this._status = "disconnected";
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
async watch(targets) {
|
|
67
|
+
if (this._status !== "connected" && this._status !== "watching") {
|
|
68
|
+
throw new IntegrationConnectionError(
|
|
69
|
+
`Cannot watch: integration "${this.name}" is not connected`,
|
|
70
|
+
this.name
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
await this.onWatch(targets);
|
|
74
|
+
this._status = "watching";
|
|
75
|
+
}
|
|
76
|
+
async unwatch(targets) {
|
|
77
|
+
if (this._status !== "watching") {
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
await this.onUnwatch(targets);
|
|
81
|
+
this._status = "connected";
|
|
82
|
+
}
|
|
83
|
+
async dispose() {
|
|
84
|
+
if (this._status !== "disconnected") {
|
|
85
|
+
await this.disconnect();
|
|
86
|
+
}
|
|
87
|
+
this.handlers.clear();
|
|
88
|
+
}
|
|
89
|
+
on(event, handler) {
|
|
90
|
+
let set = this.handlers.get(event);
|
|
91
|
+
if (!set) {
|
|
92
|
+
set = /* @__PURE__ */ new Set();
|
|
93
|
+
this.handlers.set(event, set);
|
|
94
|
+
}
|
|
95
|
+
set.add(handler);
|
|
96
|
+
}
|
|
97
|
+
off(event, handler) {
|
|
98
|
+
const set = this.handlers.get(event);
|
|
99
|
+
if (set) {
|
|
100
|
+
set.delete(handler);
|
|
101
|
+
if (set.size === 0) {
|
|
102
|
+
this.handlers.delete(event);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
emit(type, data) {
|
|
107
|
+
const event = {
|
|
108
|
+
type,
|
|
109
|
+
integration: this.name,
|
|
110
|
+
data,
|
|
111
|
+
timestamp: Date.now()
|
|
112
|
+
};
|
|
113
|
+
const specificHandlers = this.handlers.get(type);
|
|
114
|
+
if (specificHandlers) {
|
|
115
|
+
for (const handler of specificHandlers) {
|
|
116
|
+
handler(event);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
const wildcardHandlers = this.handlers.get("*");
|
|
120
|
+
if (wildcardHandlers) {
|
|
121
|
+
for (const handler of wildcardHandlers) {
|
|
122
|
+
handler(event);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
};
|
|
127
|
+
var IntegrationManager = class {
|
|
128
|
+
integrations = /* @__PURE__ */ new Map();
|
|
129
|
+
handlers = /* @__PURE__ */ new Map();
|
|
130
|
+
integrationListeners = /* @__PURE__ */ new Map();
|
|
131
|
+
register(integration) {
|
|
132
|
+
this.integrations.set(integration.name, integration);
|
|
133
|
+
const listener = (event) => {
|
|
134
|
+
this.emitToHandlers(event);
|
|
135
|
+
};
|
|
136
|
+
this.integrationListeners.set(integration.name, listener);
|
|
137
|
+
integration.on("*", listener);
|
|
138
|
+
}
|
|
139
|
+
unregister(name) {
|
|
140
|
+
const integration = this.integrations.get(name);
|
|
141
|
+
if (!integration) {
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
144
|
+
const listener = this.integrationListeners.get(name);
|
|
145
|
+
if (listener) {
|
|
146
|
+
integration.off("*", listener);
|
|
147
|
+
this.integrationListeners.delete(name);
|
|
148
|
+
}
|
|
149
|
+
this.integrations.delete(name);
|
|
150
|
+
}
|
|
151
|
+
get(name) {
|
|
152
|
+
return this.integrations.get(name);
|
|
153
|
+
}
|
|
154
|
+
getAll() {
|
|
155
|
+
return Array.from(this.integrations.values());
|
|
156
|
+
}
|
|
157
|
+
async startAll() {
|
|
158
|
+
const promises = [];
|
|
159
|
+
for (const integration of this.integrations.values()) {
|
|
160
|
+
promises.push(integration.connect({}));
|
|
161
|
+
}
|
|
162
|
+
await Promise.all(promises);
|
|
163
|
+
}
|
|
164
|
+
async stopAll() {
|
|
165
|
+
const promises = [];
|
|
166
|
+
for (const integration of this.integrations.values()) {
|
|
167
|
+
promises.push(integration.disconnect());
|
|
168
|
+
}
|
|
169
|
+
await Promise.all(promises);
|
|
170
|
+
}
|
|
171
|
+
on(event, handler) {
|
|
172
|
+
let set = this.handlers.get(event);
|
|
173
|
+
if (!set) {
|
|
174
|
+
set = /* @__PURE__ */ new Set();
|
|
175
|
+
this.handlers.set(event, set);
|
|
176
|
+
}
|
|
177
|
+
set.add(handler);
|
|
178
|
+
}
|
|
179
|
+
off(event, handler) {
|
|
180
|
+
const set = this.handlers.get(event);
|
|
181
|
+
if (set) {
|
|
182
|
+
set.delete(handler);
|
|
183
|
+
if (set.size === 0) {
|
|
184
|
+
this.handlers.delete(event);
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
emitToHandlers(event) {
|
|
189
|
+
const specificHandlers = this.handlers.get(event.type);
|
|
190
|
+
if (specificHandlers) {
|
|
191
|
+
for (const handler of specificHandlers) {
|
|
192
|
+
handler(event);
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
const wildcardHandlers = this.handlers.get("*");
|
|
196
|
+
if (wildcardHandlers) {
|
|
197
|
+
for (const handler of wildcardHandlers) {
|
|
198
|
+
handler(event);
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
};
|
|
203
|
+
|
|
204
|
+
export {
|
|
205
|
+
IntegrationError,
|
|
206
|
+
IntegrationConnectionError,
|
|
207
|
+
IntegrationConfigError,
|
|
208
|
+
IntegrationNotFoundError,
|
|
209
|
+
BaseIntegration,
|
|
210
|
+
IntegrationManager
|
|
211
|
+
};
|