@rse/ase 0.0.6 → 0.0.8
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/dst/ase-agent-base.js +16 -25
- package/dst/ase-agent-biz.js +18 -27
- package/dst/ase-agent-dev.js +18 -27
- package/dst/ase-agent-ops.js +18 -27
- package/dst/ase-agent-prd.js +18 -27
- package/dst/ase-agent-prj.js +18 -27
- package/dst/ase-agent.js +19 -29
- package/dst/ase-config.js +375 -44
- package/dst/ase-log.js +69 -0
- package/dst/ase-service.js +376 -216
- package/dst/ase-setup.js +9 -10
- package/dst/ase.1 +51 -4
- package/dst/ase.js +48 -35
- package/package.json +9 -4
- package/README.md +0 -42
package/dst/ase-agent-base.js
CHANGED
|
@@ -7,37 +7,28 @@
|
|
|
7
7
|
export const createAgentCommandModule = (category, description, subCommands) => {
|
|
8
8
|
/* create sub-command handler */
|
|
9
9
|
const createSubCommandHandler = (subCommand) => {
|
|
10
|
-
return (
|
|
11
|
-
|
|
10
|
+
return (_opts, cmd) => {
|
|
11
|
+
const opts = cmd.optsWithGlobals();
|
|
12
|
+
if (opts.debug)
|
|
12
13
|
console.log(`DEBUG: agent ${category} ${subCommand} command`);
|
|
13
|
-
if (
|
|
14
|
+
if (opts.verbose)
|
|
14
15
|
console.log(`VERBOSE: executing agent ${category} ${subCommand}...`);
|
|
15
16
|
console.log(`Executing agent ${category} ${subCommand}...`);
|
|
16
17
|
/* TODO: implement agent ${category} sub-command logic */
|
|
17
18
|
};
|
|
18
19
|
};
|
|
19
|
-
return {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
.demandCommand(1, `You need to specify a ${category} subcommand`);
|
|
31
|
-
/* register all sub-commands */
|
|
32
|
-
for (const subCmd of subCommands) {
|
|
33
|
-
builder = builder.command(subCmd, `Execute agent ${category} ${subCmd} operation`, () => { }, createSubCommandHandler(subCmd));
|
|
34
|
-
}
|
|
35
|
-
return builder;
|
|
36
|
-
},
|
|
37
|
-
handler: (argv) => {
|
|
38
|
-
/* this handler is not called when sub-commands are used */
|
|
39
|
-
if (argv.debug)
|
|
40
|
-
console.log(`DEBUG: agent ${category} command (no subcommand)`);
|
|
20
|
+
return (parent) => {
|
|
21
|
+
const agent = parent
|
|
22
|
+
.command(`${category}`)
|
|
23
|
+
.description(`Execute ${description} agent operations`)
|
|
24
|
+
.option("-v, --verbose", "Enable verbose output", false);
|
|
25
|
+
/* register all sub-commands */
|
|
26
|
+
for (const subCmd of subCommands) {
|
|
27
|
+
agent
|
|
28
|
+
.command(subCmd)
|
|
29
|
+
.description(`Execute agent ${category} ${subCmd} operation`)
|
|
30
|
+
.action(createSubCommandHandler(subCmd));
|
|
41
31
|
}
|
|
32
|
+
return agent;
|
|
42
33
|
};
|
|
43
34
|
};
|
package/dst/ase-agent-biz.js
CHANGED
|
@@ -12,38 +12,29 @@ const bizSubCommands = [
|
|
|
12
12
|
];
|
|
13
13
|
/* create sub-command handler */
|
|
14
14
|
const createSubCommandHandler = (subCommand) => {
|
|
15
|
-
return (
|
|
16
|
-
|
|
15
|
+
return (_opts, cmd) => {
|
|
16
|
+
const opts = cmd.optsWithGlobals();
|
|
17
|
+
if (opts.debug)
|
|
17
18
|
console.log(`DEBUG: agent biz ${subCommand} command`);
|
|
18
|
-
if (
|
|
19
|
+
if (opts.verbose)
|
|
19
20
|
console.log(`VERBOSE: executing agent biz ${subCommand}...`);
|
|
20
21
|
console.log(`Executing agent biz ${subCommand}...`);
|
|
21
22
|
/* TODO: implement agent biz sub-command logic */
|
|
22
23
|
};
|
|
23
24
|
};
|
|
24
|
-
/*
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
.demandCommand(1, "You need to specify a biz subcommand");
|
|
37
|
-
/* register all sub-commands */
|
|
38
|
-
for (const subCmd of bizSubCommands) {
|
|
39
|
-
builder = builder.command(subCmd, `Execute agent biz ${subCmd} operation`, () => { }, createSubCommandHandler(subCmd));
|
|
40
|
-
}
|
|
41
|
-
return builder;
|
|
42
|
-
},
|
|
43
|
-
handler: (argv) => {
|
|
44
|
-
/* this handler is not called when sub-commands are used */
|
|
45
|
-
if (argv.debug)
|
|
46
|
-
console.log("DEBUG: agent biz command (no subcommand)");
|
|
25
|
+
/* register biz command on the given parent */
|
|
26
|
+
const registerBizCommand = (parent) => {
|
|
27
|
+
const biz = parent
|
|
28
|
+
.command("biz")
|
|
29
|
+
.description("Execute business agent operations")
|
|
30
|
+
.option("-v, --verbose", "Enable verbose output", false);
|
|
31
|
+
/* register all sub-commands */
|
|
32
|
+
for (const subCmd of bizSubCommands) {
|
|
33
|
+
biz
|
|
34
|
+
.command(subCmd)
|
|
35
|
+
.description(`Execute agent biz ${subCmd} operation`)
|
|
36
|
+
.action(createSubCommandHandler(subCmd));
|
|
47
37
|
}
|
|
38
|
+
return biz;
|
|
48
39
|
};
|
|
49
|
-
export default
|
|
40
|
+
export default registerBizCommand;
|
package/dst/ase-agent-dev.js
CHANGED
|
@@ -12,38 +12,29 @@ const devSubCommands = [
|
|
|
12
12
|
];
|
|
13
13
|
/* create sub-command handler */
|
|
14
14
|
const createSubCommandHandler = (subCommand) => {
|
|
15
|
-
return (
|
|
16
|
-
|
|
15
|
+
return (_opts, cmd) => {
|
|
16
|
+
const opts = cmd.optsWithGlobals();
|
|
17
|
+
if (opts.debug)
|
|
17
18
|
console.log(`DEBUG: agent dev ${subCommand} command`);
|
|
18
|
-
if (
|
|
19
|
+
if (opts.verbose)
|
|
19
20
|
console.log(`VERBOSE: executing agent dev ${subCommand}...`);
|
|
20
21
|
console.log(`Executing agent dev ${subCommand}...`);
|
|
21
22
|
/* TODO: implement agent dev sub-command logic */
|
|
22
23
|
};
|
|
23
24
|
};
|
|
24
|
-
/*
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
.demandCommand(1, "You need to specify a dev subcommand");
|
|
37
|
-
/* register all sub-commands */
|
|
38
|
-
for (const subCmd of devSubCommands) {
|
|
39
|
-
builder = builder.command(subCmd, `Execute agent dev ${subCmd} operation`, () => { }, createSubCommandHandler(subCmd));
|
|
40
|
-
}
|
|
41
|
-
return builder;
|
|
42
|
-
},
|
|
43
|
-
handler: (argv) => {
|
|
44
|
-
/* this handler is not called when sub-commands are used */
|
|
45
|
-
if (argv.debug)
|
|
46
|
-
console.log("DEBUG: agent dev command (no subcommand)");
|
|
25
|
+
/* register dev command on the given parent */
|
|
26
|
+
const registerDevCommand = (parent) => {
|
|
27
|
+
const dev = parent
|
|
28
|
+
.command("dev")
|
|
29
|
+
.description("Execute development agent operations")
|
|
30
|
+
.option("-v, --verbose", "Enable verbose output", false);
|
|
31
|
+
/* register all sub-commands */
|
|
32
|
+
for (const subCmd of devSubCommands) {
|
|
33
|
+
dev
|
|
34
|
+
.command(subCmd)
|
|
35
|
+
.description(`Execute agent dev ${subCmd} operation`)
|
|
36
|
+
.action(createSubCommandHandler(subCmd));
|
|
47
37
|
}
|
|
38
|
+
return dev;
|
|
48
39
|
};
|
|
49
|
-
export default
|
|
40
|
+
export default registerDevCommand;
|
package/dst/ase-agent-ops.js
CHANGED
|
@@ -12,38 +12,29 @@ const opsSubCommands = [
|
|
|
12
12
|
];
|
|
13
13
|
/* create sub-command handler */
|
|
14
14
|
const createSubCommandHandler = (subCommand) => {
|
|
15
|
-
return (
|
|
16
|
-
|
|
15
|
+
return (_opts, cmd) => {
|
|
16
|
+
const opts = cmd.optsWithGlobals();
|
|
17
|
+
if (opts.debug)
|
|
17
18
|
console.log(`DEBUG: agent ops ${subCommand} command`);
|
|
18
|
-
if (
|
|
19
|
+
if (opts.verbose)
|
|
19
20
|
console.log(`VERBOSE: executing agent ops ${subCommand}...`);
|
|
20
21
|
console.log(`Executing agent ops ${subCommand}...`);
|
|
21
22
|
/* TODO: implement agent ops sub-command logic */
|
|
22
23
|
};
|
|
23
24
|
};
|
|
24
|
-
/*
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
.demandCommand(1, "You need to specify an ops subcommand");
|
|
37
|
-
/* register all sub-commands */
|
|
38
|
-
for (const subCmd of opsSubCommands) {
|
|
39
|
-
builder = builder.command(subCmd, `Execute agent ops ${subCmd} operation`, () => { }, createSubCommandHandler(subCmd));
|
|
40
|
-
}
|
|
41
|
-
return builder;
|
|
42
|
-
},
|
|
43
|
-
handler: (argv) => {
|
|
44
|
-
/* this handler is not called when sub-commands are used */
|
|
45
|
-
if (argv.debug)
|
|
46
|
-
console.log("DEBUG: agent ops command (no subcommand)");
|
|
25
|
+
/* register ops command on the given parent */
|
|
26
|
+
const registerOpsCommand = (parent) => {
|
|
27
|
+
const ops = parent
|
|
28
|
+
.command("ops")
|
|
29
|
+
.description("Execute operations agent operations")
|
|
30
|
+
.option("-v, --verbose", "Enable verbose output", false);
|
|
31
|
+
/* register all sub-commands */
|
|
32
|
+
for (const subCmd of opsSubCommands) {
|
|
33
|
+
ops
|
|
34
|
+
.command(subCmd)
|
|
35
|
+
.description(`Execute agent ops ${subCmd} operation`)
|
|
36
|
+
.action(createSubCommandHandler(subCmd));
|
|
47
37
|
}
|
|
38
|
+
return ops;
|
|
48
39
|
};
|
|
49
|
-
export default
|
|
40
|
+
export default registerOpsCommand;
|
package/dst/ase-agent-prd.js
CHANGED
|
@@ -12,38 +12,29 @@ const prdSubCommands = [
|
|
|
12
12
|
];
|
|
13
13
|
/* create sub-command handler */
|
|
14
14
|
const createSubCommandHandler = (subCommand) => {
|
|
15
|
-
return (
|
|
16
|
-
|
|
15
|
+
return (_opts, cmd) => {
|
|
16
|
+
const opts = cmd.optsWithGlobals();
|
|
17
|
+
if (opts.debug)
|
|
17
18
|
console.log(`DEBUG: agent prd ${subCommand} command`);
|
|
18
|
-
if (
|
|
19
|
+
if (opts.verbose)
|
|
19
20
|
console.log(`VERBOSE: executing agent prd ${subCommand}...`);
|
|
20
21
|
console.log(`Executing agent prd ${subCommand}...`);
|
|
21
22
|
/* TODO: implement agent prd sub-command logic */
|
|
22
23
|
};
|
|
23
24
|
};
|
|
24
|
-
/*
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
.demandCommand(1, "You need to specify a prd subcommand");
|
|
37
|
-
/* register all sub-commands */
|
|
38
|
-
for (const subCmd of prdSubCommands) {
|
|
39
|
-
builder = builder.command(subCmd, `Execute agent prd ${subCmd} operation`, () => { }, createSubCommandHandler(subCmd));
|
|
40
|
-
}
|
|
41
|
-
return builder;
|
|
42
|
-
},
|
|
43
|
-
handler: (argv) => {
|
|
44
|
-
/* this handler is not called when sub-commands are used */
|
|
45
|
-
if (argv.debug)
|
|
46
|
-
console.log("DEBUG: agent prd command (no subcommand)");
|
|
25
|
+
/* register prd command on the given parent */
|
|
26
|
+
const registerPrdCommand = (parent) => {
|
|
27
|
+
const prd = parent
|
|
28
|
+
.command("prd")
|
|
29
|
+
.description("Execute production agent operations")
|
|
30
|
+
.option("-v, --verbose", "Enable verbose output", false);
|
|
31
|
+
/* register all sub-commands */
|
|
32
|
+
for (const subCmd of prdSubCommands) {
|
|
33
|
+
prd
|
|
34
|
+
.command(subCmd)
|
|
35
|
+
.description(`Execute agent prd ${subCmd} operation`)
|
|
36
|
+
.action(createSubCommandHandler(subCmd));
|
|
47
37
|
}
|
|
38
|
+
return prd;
|
|
48
39
|
};
|
|
49
|
-
export default
|
|
40
|
+
export default registerPrdCommand;
|
package/dst/ase-agent-prj.js
CHANGED
|
@@ -12,38 +12,29 @@ const prjSubCommands = [
|
|
|
12
12
|
];
|
|
13
13
|
/* create sub-command handler */
|
|
14
14
|
const createSubCommandHandler = (subCommand) => {
|
|
15
|
-
return (
|
|
16
|
-
|
|
15
|
+
return (_opts, cmd) => {
|
|
16
|
+
const opts = cmd.optsWithGlobals();
|
|
17
|
+
if (opts.debug)
|
|
17
18
|
console.log(`DEBUG: agent prj ${subCommand} command`);
|
|
18
|
-
if (
|
|
19
|
+
if (opts.verbose)
|
|
19
20
|
console.log(`VERBOSE: executing agent prj ${subCommand}...`);
|
|
20
21
|
console.log(`Executing agent prj ${subCommand}...`);
|
|
21
22
|
/* TODO: implement agent prj sub-command logic */
|
|
22
23
|
};
|
|
23
24
|
};
|
|
24
|
-
/*
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
.demandCommand(1, "You need to specify a prj subcommand");
|
|
37
|
-
/* register all sub-commands */
|
|
38
|
-
for (const subCmd of prjSubCommands) {
|
|
39
|
-
builder = builder.command(subCmd, `Execute agent prj ${subCmd} operation`, () => { }, createSubCommandHandler(subCmd));
|
|
40
|
-
}
|
|
41
|
-
return builder;
|
|
42
|
-
},
|
|
43
|
-
handler: (argv) => {
|
|
44
|
-
/* this handler is not called when sub-commands are used */
|
|
45
|
-
if (argv.debug)
|
|
46
|
-
console.log("DEBUG: agent prj command (no subcommand)");
|
|
25
|
+
/* register prj command on the given parent */
|
|
26
|
+
const registerPrjCommand = (parent) => {
|
|
27
|
+
const prj = parent
|
|
28
|
+
.command("prj")
|
|
29
|
+
.description("Execute project agent operations")
|
|
30
|
+
.option("-v, --verbose", "Enable verbose output", false);
|
|
31
|
+
/* register all sub-commands */
|
|
32
|
+
for (const subCmd of prjSubCommands) {
|
|
33
|
+
prj
|
|
34
|
+
.command(subCmd)
|
|
35
|
+
.description(`Execute agent prj ${subCmd} operation`)
|
|
36
|
+
.action(createSubCommandHandler(subCmd));
|
|
47
37
|
}
|
|
38
|
+
return prj;
|
|
48
39
|
};
|
|
49
|
-
export default
|
|
40
|
+
export default registerPrjCommand;
|
package/dst/ase-agent.js
CHANGED
|
@@ -3,33 +3,23 @@
|
|
|
3
3
|
** Copyright (c) 2025-2026 Dr. Ralf S. Engelschall <rse@engelschall.com>
|
|
4
4
|
** Licensed under GPL 3.0 <https://spdx.org/licenses/GPL-3.0-only>
|
|
5
5
|
*/
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
.command(opsCommand)
|
|
25
|
-
.command(prdCommand)
|
|
26
|
-
.command(prjCommand)
|
|
27
|
-
.demandCommand(1, "You need to specify an agent subcommand");
|
|
28
|
-
},
|
|
29
|
-
handler: (argv) => {
|
|
30
|
-
/* this handler is not called when sub-commands are used */
|
|
31
|
-
if (argv.debug)
|
|
32
|
-
console.log("DEBUG: agent command (no subcommand)");
|
|
33
|
-
}
|
|
6
|
+
import registerBizCommand from "./ase-agent-biz.js";
|
|
7
|
+
import registerDevCommand from "./ase-agent-dev.js";
|
|
8
|
+
import registerOpsCommand from "./ase-agent-ops.js";
|
|
9
|
+
import registerPrdCommand from "./ase-agent-prd.js";
|
|
10
|
+
import registerPrjCommand from "./ase-agent-prj.js";
|
|
11
|
+
/* register agent command on the given program */
|
|
12
|
+
const registerAgentCommand = (program) => {
|
|
13
|
+
const agent = program
|
|
14
|
+
.command("agent")
|
|
15
|
+
.description("Execute agent operations")
|
|
16
|
+
.option("-v, --verbose", "Enable verbose output", false);
|
|
17
|
+
/* register all agent sub-commands */
|
|
18
|
+
registerBizCommand(agent);
|
|
19
|
+
registerDevCommand(agent);
|
|
20
|
+
registerOpsCommand(agent);
|
|
21
|
+
registerPrdCommand(agent);
|
|
22
|
+
registerPrjCommand(agent);
|
|
23
|
+
return agent;
|
|
34
24
|
};
|
|
35
|
-
export default
|
|
25
|
+
export default registerAgentCommand;
|