@akala/pm 15.3.3 → 15.3.4

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/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "pm": "dist/esm/cli.js",
5
5
  "pm-fork": "dist/esm/fork.js"
6
6
  },
7
- "version": "15.3.3",
7
+ "version": "15.3.4",
8
8
  "scripts": {
9
9
  "test": "echo 1",
10
10
  "generate": "akala sdk generate dist/esm/commands commands.json --name pm && akala sdk generate dist/esm/cli-commands cli-commands.json --name pm",
@@ -30,8 +30,8 @@
30
30
  ],
31
31
  "dependencies": {
32
32
  "@akala/cli": "^5.10.1",
33
- "@akala/commands": "^16.1.3",
34
- "@akala/config": "^6.0.78",
33
+ "@akala/commands": "^17.0.0",
34
+ "@akala/config": "^6.0.79",
35
35
  "@akala/core": "^39.5.1",
36
36
  "@akala/json-rpc-ws": "^12.0.1",
37
37
  "reflect-metadata": "^0.2.2",
package/src/akala.mts CHANGED
@@ -8,6 +8,7 @@ import commands from './container.js';
8
8
  import cliCommands from './cli-container.js';
9
9
  import Configuration from '@akala/config';
10
10
  import { IpcAdapter } from './ipc-adapter.js';
11
+ import { FSFileSystemProvider } from '@akala/fs';
11
12
 
12
13
  const log = logger('akala:pm');
13
14
 
@@ -60,7 +61,7 @@ export default async function (_config, program: NamespaceMiddleware<{ configFil
60
61
  const pm = new Container('pm-cli', {});
61
62
 
62
63
  const root = new URL('../../', import.meta.url);
63
- const fs = new Processors.FileSystem(root);
64
+ const fs = new Processors.FileSystem(new FSFileSystemProvider(root, true));
64
65
 
65
66
  registerCommands(cliCommands.meta.commands, fs, pm);
66
67
 
@@ -2,7 +2,8 @@
2
2
  "$schema": "https://raw.githubusercontent.com/npenin/akala/main/packages/commands/command-schema.json",
3
3
  "cli": {
4
4
  "inject": [
5
- "context"
5
+ "context",
6
+ "$container"
6
7
  ],
7
8
  "options": {
8
9
  "pmSock": {
@@ -1,5 +1,5 @@
1
1
  import program, { CliContext } from "@akala/cli";
2
- import { StateConfiguration } from "../state.js";
2
+ import State, { StateConfiguration } from "../state.js";
3
3
  import { connect, Container } from "@akala/commands";
4
4
  import { platform } from "os";
5
5
  import { Triggers } from "@akala/commands";
@@ -9,7 +9,7 @@ import commands from "../container.js";
9
9
 
10
10
  type CliOptions = { pmSock: string | number, tls: boolean };
11
11
 
12
- export default async function (c: CliContext<CliOptions, ProxyConfiguration<{ pm?: StateConfiguration }>>)
12
+ export default async function (c: CliContext<CliOptions, ProxyConfiguration<{ pm?: StateConfiguration }>>, pm: Container<Partial<State>>)
13
13
  {
14
14
  let container: Container<unknown>;
15
15
 
@@ -51,6 +51,8 @@ export default async function (c: CliContext<CliOptions, ProxyConfiguration<{ pm
51
51
 
52
52
  if (container)
53
53
  await container.attach(Triggers.cli, program.command('pm'));
54
+ else
55
+ pm.state.config = c.state.pm;
54
56
  // throw new ErrorWithStatus(HttpStatusCode.BadGateway, 'no connection option specified');
55
57
 
56
58
  }
@@ -1,7 +1,7 @@
1
1
  import pmContainer from '../container.js';
2
2
  import map from './map.js'
3
3
  import { logger } from "@akala/core";
4
- import fsHandler, { OpenFlags } from "@akala/fs";
4
+ import fsHandler, { hasAccess, OpenFlags } from "@akala/fs";
5
5
 
6
6
 
7
7
  type Unpromise<T> = T extends Promise<infer X> ? X : never;
@@ -50,8 +50,7 @@ export default async function discover(path: string | URL, pm: pmContainer.conta
50
50
  }
51
51
  }
52
52
 
53
- const commandsJsonFile = await moduleFs.access('./commands.json', OpenFlags.Read).then(() => true, () => false);
54
- if (commandsJsonFile)
53
+ if (await hasAccess(moduleFs, './commands.json', OpenFlags.Read))
55
54
  return pm.dispatch('map', name ?? packageConfig.name, new URL('./commands.json', moduleFs.root), 'nodejs', null, { commandable: true });
56
55
 
57
56
  return pm.dispatch('map', name ?? packageConfig.name, new URL('./' + packageConfig.main, moduleFs.root), 'nodejs', null, { commandable: false });
@@ -2,6 +2,7 @@
2
2
  "$schema": "https://raw.githubusercontent.com/npenin/akala/main/packages/commands/command-schema.json",
3
3
  "": {
4
4
  "inject": [
5
+ "$state.config",
5
6
  "params.0",
6
7
  "params.1",
7
8
  "params.2",
@@ -11,6 +12,7 @@
11
12
  },
12
13
  "cli": {
13
14
  "inject": [
15
+ "context.state",
14
16
  "options.name",
15
17
  "options.path",
16
18
  "options.runtime",
@@ -1,11 +1,11 @@
1
1
  import State, { SidecarMetadata } from '../state.js';
2
2
  import { isAbsolute, resolve } from "path";
3
3
 
4
- export default async function map<TName extends string>(this: State, name: TName, targetPath: string | URL, runtime: SidecarMetadata['type'], cwd?: string, options?: { commandable?: boolean })
4
+ export default async function map<TName extends string>(config: State['config'], name: TName, targetPath: string | URL, runtime: SidecarMetadata['type'], cwd?: string, options?: { commandable?: boolean })
5
5
  {
6
6
  if (typeof targetPath == 'string' && !URL.canParse(targetPath) && !isAbsolute(targetPath))
7
7
  targetPath = resolve(cwd || process.cwd(), targetPath);
8
- this.config.containers.set(name, { type: runtime, path: targetPath.toString(), commandable: !!options?.commandable });
9
- await this.config.commit();
8
+ config.containers.set(name, { type: runtime, path: targetPath.toString(), commandable: !!options?.commandable });
9
+ await config.commit();
10
10
  return name
11
11
  }
@@ -77,8 +77,10 @@ export default async function run(program: string, name: string, c: CliContext<{
77
77
  subContext.options.configFile = c.options.configFile + '#' + c.options.name;
78
78
  subContext.state = c.state[c.options.name];
79
79
  if (!subContext.state)
80
+ {
80
81
  c.state[c.options.name] = {};
81
- subContext.state = c.state[c.options.name];
82
+ subContext.state = c.state[c.options.name];
83
+ }
82
84
 
83
85
  await cli.process(subContext);
84
86
  }
@@ -8,37 +8,37 @@ namespace cliCommands
8
8
  {
9
9
  export interface container
10
10
  {
11
- dispatch (cmd:'$init', ...args: [Argument0<typeof import('./cli-commands/$init.js').default>]): ReturnType<typeof import('./cli-commands/$init.js').default>
12
- dispatch (cmd:'connect', ...args: [Argument0<typeof import('./cli-commands/connect.js').default>, Argument1<typeof import('./cli-commands/connect.js').default>]): ReturnType<typeof import('./cli-commands/connect.js').default>
13
- dispatch (cmd:'discover', ...args: [Argument0<typeof import('./cli-commands/discover.js').default>, Argument1<typeof import('./cli-commands/discover.js').default>]): ReturnType<typeof import('./cli-commands/discover.js').default>
14
- dispatch (cmd:'install', ...args: [Argument0<typeof import('./cli-commands/install.js').default>]): ReturnType<typeof import('./cli-commands/install.js').default>
15
- dispatch (cmd:'link', ...args: [Argument0<typeof import('./cli-commands/link.js').default>, Argument1<typeof import('./cli-commands/link.js').default>]): ReturnType<typeof import('./cli-commands/link.js').default>
16
- dispatch (cmd:'log', ...args: [Argument0<typeof import('./cli-commands/log.js').default>]): ReturnType<typeof import('./cli-commands/log.js').default>
17
- dispatch (cmd:'ls', ...args: []): ReturnType<typeof import('./cli-commands/ls.js').default>
18
- dispatch (cmd:'map', ...args: [Argument0<typeof import('./cli-commands/map.js').default>, Argument1<typeof import('./cli-commands/map.js').default>, Argument2<typeof import('./cli-commands/map.js').default>, Argument3<typeof import('./cli-commands/map.js').default>, Argument4<typeof import('./cli-commands/map.js').default>]): ReturnType<typeof import('./cli-commands/map.js').default>
19
- dispatch (cmd:'run', ...args: [Argument0<typeof import('./cli-commands/run.js').default>, Argument1<typeof import('./cli-commands/run.js').default>]): ReturnType<typeof import('./cli-commands/run.js').default>
20
- dispatch (cmd:'start', ...args: [Argument0<typeof import('./cli-commands/start.js').default>, Argument1<typeof import('./cli-commands/start.js').default>]): ReturnType<typeof import('./cli-commands/start.js').default>
21
- dispatch (cmd:'uninstall', ...args: [Argument0<typeof import('./cli-commands/uninstall.js').default>]): ReturnType<typeof import('./cli-commands/uninstall.js').default>
22
- dispatch (cmd:'update', ...args: [Argument0<typeof import('./cli-commands/update.js').default>, Argument1<typeof import('./cli-commands/update.js').default>, Argument2<typeof import('./cli-commands/update.js').default>]): ReturnType<typeof import('./cli-commands/update.js').default>
23
- dispatch (cmd:'version', ...args: [Argument0<typeof import('./cli-commands/version.js').default>, Argument1<typeof import('./cli-commands/version.js').default>]): ReturnType<typeof import('./cli-commands/version.js').default>
11
+ dispatch (cmd:'$init', ...args: [Argument0<typeof import('./cli-commands/$init.ts').default>, Argument1<typeof import('./cli-commands/$init.ts').default>]): ReturnType<typeof import('./cli-commands/$init.ts').default>
12
+ dispatch (cmd:'connect', ...args: [Argument0<typeof import('./cli-commands/connect.ts').default>, Argument1<typeof import('./cli-commands/connect.ts').default>]): ReturnType<typeof import('./cli-commands/connect.ts').default>
13
+ dispatch (cmd:'discover', ...args: [Argument0<typeof import('./cli-commands/discover.ts').default>, Argument2<typeof import('./cli-commands/discover.ts').default>]): ReturnType<typeof import('./cli-commands/discover.ts').default>
14
+ dispatch (cmd:'install', ...args: [Argument0<typeof import('./cli-commands/install.ts').default>]): ReturnType<typeof import('./cli-commands/install.ts').default>
15
+ dispatch (cmd:'link', ...args: [Argument0<typeof import('./cli-commands/link.ts').default>, Argument1<typeof import('./cli-commands/link.ts').default>]): ReturnType<typeof import('./cli-commands/link.ts').default>
16
+ dispatch (cmd:'log', ...args: [Argument0<typeof import('./cli-commands/log.ts').default>]): ReturnType<typeof import('./cli-commands/log.ts').default>
17
+ dispatch (cmd:'ls', ...args: []): ReturnType<typeof import('./cli-commands/ls.ts').default>
18
+ dispatch (cmd:'map', ...args: [Argument1<typeof import('./cli-commands/map.ts').default>, Argument2<typeof import('./cli-commands/map.ts').default>, Argument3<typeof import('./cli-commands/map.ts').default>, Argument4<typeof import('./cli-commands/map.ts').default>, Argument5<typeof import('./cli-commands/map.ts').default>]): ReturnType<typeof import('./cli-commands/map.ts').default>
19
+ dispatch (cmd:'run', ...args: [Argument0<typeof import('./cli-commands/run.ts').default>, Argument1<typeof import('./cli-commands/run.ts').default>]): ReturnType<typeof import('./cli-commands/run.ts').default>
20
+ dispatch (cmd:'start', ...args: [Argument0<typeof import('./cli-commands/start.ts').default>, Argument1<typeof import('./cli-commands/start.ts').default>]): ReturnType<typeof import('./cli-commands/start.ts').default>
21
+ dispatch (cmd:'uninstall', ...args: [Argument0<typeof import('./cli-commands/uninstall.ts').default>]): ReturnType<typeof import('./cli-commands/uninstall.ts').default>
22
+ dispatch (cmd:'update', ...args: [Argument0<typeof import('./cli-commands/update.ts').default>, Argument1<typeof import('./cli-commands/update.ts').default>, Argument2<typeof import('./cli-commands/update.ts').default>]): ReturnType<typeof import('./cli-commands/update.ts').default>
23
+ dispatch (cmd:'version', ...args: [Argument0<typeof import('./cli-commands/version.ts').default>, Argument1<typeof import('./cli-commands/version.ts').default>]): ReturnType<typeof import('./cli-commands/version.ts').default>
24
24
  }
25
25
  export interface proxy
26
26
  {
27
- '$init'(...args: [Argument0<typeof import('./cli-commands/$init.js').default>]): ReturnType<typeof import('./cli-commands/$init.js').default>
28
- 'connect'(...args: [Argument0<typeof import('./cli-commands/connect.js').default>, Argument1<typeof import('./cli-commands/connect.js').default>]): ReturnType<typeof import('./cli-commands/connect.js').default>
29
- 'discover'(...args: [Argument0<typeof import('./cli-commands/discover.js').default>, Argument1<typeof import('./cli-commands/discover.js').default>]): ReturnType<typeof import('./cli-commands/discover.js').default>
30
- 'install'(...args: [Argument0<typeof import('./cli-commands/install.js').default>]): ReturnType<typeof import('./cli-commands/install.js').default>
31
- 'link'(...args: [Argument0<typeof import('./cli-commands/link.js').default>, Argument1<typeof import('./cli-commands/link.js').default>]): ReturnType<typeof import('./cli-commands/link.js').default>
32
- 'log'(...args: [Argument0<typeof import('./cli-commands/log.js').default>]): ReturnType<typeof import('./cli-commands/log.js').default>
33
- 'ls'(...args: []): ReturnType<typeof import('./cli-commands/ls.js').default>
34
- 'map'(...args: [Argument0<typeof import('./cli-commands/map.js').default>, Argument1<typeof import('./cli-commands/map.js').default>, Argument2<typeof import('./cli-commands/map.js').default>, Argument3<typeof import('./cli-commands/map.js').default>, Argument4<typeof import('./cli-commands/map.js').default>]): ReturnType<typeof import('./cli-commands/map.js').default>
35
- 'run'(...args: [Argument0<typeof import('./cli-commands/run.js').default>, Argument1<typeof import('./cli-commands/run.js').default>]): ReturnType<typeof import('./cli-commands/run.js').default>
36
- 'start'(...args: [Argument0<typeof import('./cli-commands/start.js').default>, Argument1<typeof import('./cli-commands/start.js').default>]): ReturnType<typeof import('./cli-commands/start.js').default>
37
- 'uninstall'(...args: [Argument0<typeof import('./cli-commands/uninstall.js').default>]): ReturnType<typeof import('./cli-commands/uninstall.js').default>
38
- 'update'(...args: [Argument0<typeof import('./cli-commands/update.js').default>, Argument1<typeof import('./cli-commands/update.js').default>, Argument2<typeof import('./cli-commands/update.js').default>]): ReturnType<typeof import('./cli-commands/update.js').default>
39
- 'version'(...args: [Argument0<typeof import('./cli-commands/version.js').default>, Argument1<typeof import('./cli-commands/version.js').default>]): ReturnType<typeof import('./cli-commands/version.js').default>
27
+ '$init'(...args: [Argument0<typeof import('./cli-commands/$init.ts').default>, Argument1<typeof import('./cli-commands/$init.ts').default>]): ReturnType<typeof import('./cli-commands/$init.ts').default>
28
+ 'connect'(...args: [Argument0<typeof import('./cli-commands/connect.ts').default>, Argument1<typeof import('./cli-commands/connect.ts').default>]): ReturnType<typeof import('./cli-commands/connect.ts').default>
29
+ 'discover'(...args: [Argument0<typeof import('./cli-commands/discover.ts').default>, Argument2<typeof import('./cli-commands/discover.ts').default>]): ReturnType<typeof import('./cli-commands/discover.ts').default>
30
+ 'install'(...args: [Argument0<typeof import('./cli-commands/install.ts').default>]): ReturnType<typeof import('./cli-commands/install.ts').default>
31
+ 'link'(...args: [Argument0<typeof import('./cli-commands/link.ts').default>, Argument1<typeof import('./cli-commands/link.ts').default>]): ReturnType<typeof import('./cli-commands/link.ts').default>
32
+ 'log'(...args: [Argument0<typeof import('./cli-commands/log.ts').default>]): ReturnType<typeof import('./cli-commands/log.ts').default>
33
+ 'ls'(...args: []): ReturnType<typeof import('./cli-commands/ls.ts').default>
34
+ 'map'(...args: [Argument1<typeof import('./cli-commands/map.ts').default>, Argument2<typeof import('./cli-commands/map.ts').default>, Argument3<typeof import('./cli-commands/map.ts').default>, Argument4<typeof import('./cli-commands/map.ts').default>, Argument5<typeof import('./cli-commands/map.ts').default>]): ReturnType<typeof import('./cli-commands/map.ts').default>
35
+ 'run'(...args: [Argument0<typeof import('./cli-commands/run.ts').default>, Argument1<typeof import('./cli-commands/run.ts').default>]): ReturnType<typeof import('./cli-commands/run.ts').default>
36
+ 'start'(...args: [Argument0<typeof import('./cli-commands/start.ts').default>, Argument1<typeof import('./cli-commands/start.ts').default>]): ReturnType<typeof import('./cli-commands/start.ts').default>
37
+ 'uninstall'(...args: [Argument0<typeof import('./cli-commands/uninstall.ts').default>]): ReturnType<typeof import('./cli-commands/uninstall.ts').default>
38
+ 'update'(...args: [Argument0<typeof import('./cli-commands/update.ts').default>, Argument1<typeof import('./cli-commands/update.ts').default>, Argument2<typeof import('./cli-commands/update.ts').default>]): ReturnType<typeof import('./cli-commands/update.ts').default>
39
+ 'version'(...args: [Argument0<typeof import('./cli-commands/version.ts').default>, Argument1<typeof import('./cli-commands/version.ts').default>]): ReturnType<typeof import('./cli-commands/version.ts').default>
40
40
  }
41
- export const meta={"name":"pm","commands":[{"name":"$init","config":{"fs":{"path":"dist/esm/cli-commands/$init.js","source":"src/cli-commands/$init.ts","inject":["params.0"]},"cli":{"inject":["context"],"options":{"pmSock":{"aliases":["pm-sock"],"needsValue":true}}},"":{"inject":["params.0"]}}},{"name":"connect","config":{"fs":{"path":"dist/esm/cli-commands/connect.js","source":"src/cli-commands/connect.ts","inject":["params.0","params.1"]},"":{"inject":["params.0","params.1"]},"cli":{"usage":"connect <name>","inject":["options.name","context"],"options":{"tcpPort":{"needsValue":true,"aliases":["tcp-port"]},"port":{"needsValue":true},"key":{"needsValue":true},"cert":{"needsValue":true}}}}},{"name":"discover","config":{"fs":{"path":"dist/esm/cli-commands/discover.js","source":"src/cli-commands/discover.ts","inject":["params.0","params.1","$container"]},"":{"inject":["params.0","params.1","$container"]},"cli":{"usage":"discover <name> <folder>","options":{"folder":{"normalize":true}},"inject":["options.name","options.folder","$container"]}}},{"name":"install","config":{"fs":{"path":"dist/esm/cli-commands/install.js","source":"src/cli-commands/install.ts","inject":["params.0","$container"]},"":{"inject":["params.0","$container"]},"cli":{"inject":["params.0","$container"]}}},{"name":"link","config":{"fs":{"path":"dist/esm/cli-commands/link.js","source":"src/cli-commands/link.ts","inject":["params.0","params.1","$container"]},"":{"inject":["params.0","params.1","$container"]},"cli":{"inject":["params.0","params.1","$container"]}}},{"name":"log","config":{"fs":{"path":"dist/esm/cli-commands/log.js","source":"src/cli-commands/log.ts","inject":["params.0"]},"":{"inject":["params.0"]},"cli":{"inject":["params.0"]}}},{"name":"ls","config":{"fs":{"path":"dist/esm/cli-commands/ls.js","source":"src/cli-commands/ls.ts","inject":[]},"":{"inject":[]},"cli":{"inject":[]},"html-form":{"inject":[]}}},{"name":"map","config":{"fs":{"path":"dist/esm/cli-commands/map.js","source":"src/cli-commands/map.ts","inject":["params.0","params.1","params.2","params.3","params.4"]},"":{"inject":["params.0","params.1","params.2","params.3","params.4"]},"cli":{"inject":["options.name","options.path","options.runtime","cwd","options"],"options":{"commandable":{"aliases":["c"],"needsValue":false},"stateless":{"aliases":["s"],"needsValue":false},"runtime":{"aliases":["r"],"needsValue":true}},"usage":"map <name> <path>"}}},{"name":"run","config":{"fs":{"path":"dist/esm/cli-commands/run.js","source":"src/cli-commands/run.ts","inject":["params.0","params.1"]},"":{"inject":["params.0","params.1"]},"jsonrpc":false,"cli":{"options":{"output":{"aliases":["o"],"needsValue":true,"doc":"output as `table` if array otherwise falls back to standard node output"},"verbose":{"aliases":["v"]},"tls":{"doc":"enables tls connection to the `pmSock`"},"pmSock":{"aliases":["pm-sock"],"needsValue":true,"doc":"path to the unix socket or destination in the form host:port"},"help":{"doc":"displays this help message"},"keepAttached":{"aliases":["keep-attached"],"needsValue":false,"doc":"keeps the process attached to the current terminal"},"wait":{"aliases":["w"],"needsValue":false,"doc":"waits for the program to be started before returning, otherwise, returns after the start command is sent to the pm daemon"},"inspect":{"needsValue":false,"doc":"starts the process with --inspect-brk parameter to help debugging"},"new":{"needsValue":false},"name":{"doc":"name to assign to the process","needsValue":true},"program":{"doc":"program to start"}},"inject":["options.program","options.name","context","options.pmSock"],"usage":"run <name> [...args]"}}},{"name":"start","config":{"fs":{"path":"dist/esm/cli-commands/start.js","source":"src/cli-commands/start.ts","inject":["params.0","params.1"]},"":{"inject":["params.0","params.1"]},"cli":{"options":{"output":{"aliases":["o"],"needsValue":true,"doc":"output as `table` if array otherwise falls back to standard node output"},"verbose":{"aliases":["v"]},"tls":{"doc":"enables tls connection to the `pmSock`"},"pmSock":{"aliases":["pm-sock"],"needsValue":true,"doc":"path to the unix socket or destination in the form host:port"},"help":{"doc":"displays this help message"},"keepAttached":{"aliases":["keep-attached"],"needsValue":false,"doc":"keeps the process attached to the current terminal"},"wait":{"aliases":["w"],"needsValue":false,"doc":"waits for the program to be started before returning, otherwise, returns after the start command is sent to the pm daemon"},"inspect":{"needsValue":false,"doc":"starts the process with --inspect-brk parameter to help debugging"}},"inject":["options.program","context"],"usage":"start pm"}}},{"name":"uninstall","config":{"fs":{"path":"dist/esm/cli-commands/uninstall.js","source":"src/cli-commands/uninstall.ts","inject":["params.0","$container"]},"":{"inject":["params.0","$container"]},"cli":{"inject":["params.0","$container"]}}},{"name":"update","config":{"fs":{"path":"dist/esm/cli-commands/update.js","source":"src/cli-commands/update.ts","inject":["params.0","params.1","params.2"]},"cli":{"inject":["params.0","params.1","$container"]},"":{"inject":["params.0","params.1","params.2"]}}},{"name":"version","config":{"fs":{"path":"dist/esm/cli-commands/version.js","source":"src/cli-commands/version.ts","inject":["params.0","params.1"]},"":{"inject":["params.0","params.1"]},"cli":{"inject":["options.packageName","options.folder"],"usage":"version <packageName> [folder]"},"schema":{"inject":["params.0","params.1"],"$defs":{"params.0":{"type":"string"},"params.1":{"type":"string"}}}}}],"$schema":"https://raw.githubusercontent.com/npenin/akala/main/packages/commands/container-schema.json"} as Metadata.Container;
41
+ export const meta={"name":"pm","commands":[{"name":"$init","config":{"fs":{"path":"dist/esm/cli-commands/$init.js","source":"src/cli-commands/$init.ts","inject":["params.0","params.1"]},"cli":{"inject":["context","$container"],"options":{"pmSock":{"aliases":["pm-sock"],"needsValue":true}}},"":{"inject":["params.0","params.1"]}}},{"name":"connect","config":{"fs":{"path":"dist/esm/cli-commands/connect.js","source":"src/cli-commands/connect.ts","inject":["params.0","params.1"]},"":{"inject":["params.0","params.1"]},"cli":{"usage":"connect <name>","inject":["options.name","context"],"options":{"tcpPort":{"needsValue":true,"aliases":["tcp-port"]},"port":{"needsValue":true},"key":{"needsValue":true},"cert":{"needsValue":true}}}}},{"name":"discover","config":{"fs":{"path":"dist/esm/cli-commands/discover.js","source":"src/cli-commands/discover.ts","inject":["params.0","$container","params.1"]},"":{"inject":["params.0","$container","params.1"]},"cli":{"usage":"discover <path> [name]","options":{"path":{"normalize":true}},"inject":["options.path","$container","options.name"]}}},{"name":"install","config":{"fs":{"path":"dist/esm/cli-commands/install.js","source":"src/cli-commands/install.ts","inject":["params.0","$container"]},"":{"inject":["params.0","$container"]},"cli":{"inject":["params.0","$container"]}}},{"name":"link","config":{"fs":{"path":"dist/esm/cli-commands/link.js","source":"src/cli-commands/link.ts","inject":["params.0","params.1","$container"]},"":{"inject":["params.0","params.1","$container"]},"cli":{"inject":["params.0","params.1","$container"]}}},{"name":"log","config":{"fs":{"path":"dist/esm/cli-commands/log.js","source":"src/cli-commands/log.ts","inject":["params.0"]},"":{"inject":["params.0"]},"cli":{"inject":["params.0"]}}},{"name":"ls","config":{"fs":{"path":"dist/esm/cli-commands/ls.js","source":"src/cli-commands/ls.ts","inject":[]},"":{"inject":[]},"cli":{"inject":[]},"html-form":{"inject":[]}}},{"name":"map","config":{"fs":{"path":"dist/esm/cli-commands/map.js","source":"src/cli-commands/map.ts","inject":["$state.config","params.0","params.1","params.2","params.3","params.4"]},"":{"inject":["$state.config","params.0","params.1","params.2","params.3","params.4"]},"cli":{"inject":["context.state","options.name","options.path","options.runtime","cwd","options"],"options":{"commandable":{"aliases":["c"],"needsValue":false},"stateless":{"aliases":["s"],"needsValue":false},"runtime":{"aliases":["r"],"needsValue":true}},"usage":"map <name> <path>"}}},{"name":"run","config":{"fs":{"path":"dist/esm/cli-commands/run.js","source":"src/cli-commands/run.ts","inject":["params.0","params.1"]},"":{"inject":["params.0","params.1"]},"jsonrpc":false,"cli":{"options":{"output":{"aliases":["o"],"needsValue":true,"doc":"output as `table` if array otherwise falls back to standard node output"},"verbose":{"aliases":["v"]},"tls":{"doc":"enables tls connection to the `pmSock`"},"pmSock":{"aliases":["pm-sock"],"needsValue":true,"doc":"path to the unix socket or destination in the form host:port"},"help":{"doc":"displays this help message"},"keepAttached":{"aliases":["keep-attached"],"needsValue":false,"doc":"keeps the process attached to the current terminal"},"wait":{"aliases":["w"],"needsValue":false,"doc":"waits for the program to be started before returning, otherwise, returns after the start command is sent to the pm daemon"},"inspect":{"needsValue":false,"doc":"starts the process with --inspect-brk parameter to help debugging"},"new":{"needsValue":false},"name":{"doc":"name to assign to the process","needsValue":true},"program":{"doc":"program to start"}},"inject":["options.program","options.name","context","options.pmSock"],"usage":"run <name> [...args]"}}},{"name":"start","config":{"fs":{"path":"dist/esm/cli-commands/start.js","source":"src/cli-commands/start.ts","inject":["params.0","params.1"]},"":{"inject":["params.0","params.1"]},"cli":{"options":{"output":{"aliases":["o"],"needsValue":true,"doc":"output as `table` if array otherwise falls back to standard node output"},"verbose":{"aliases":["v"]},"tls":{"doc":"enables tls connection to the `pmSock`"},"pmSock":{"aliases":["pm-sock"],"needsValue":true,"doc":"path to the unix socket or destination in the form host:port"},"help":{"doc":"displays this help message"},"keepAttached":{"aliases":["keep-attached"],"needsValue":false,"doc":"keeps the process attached to the current terminal"},"wait":{"aliases":["w"],"needsValue":false,"doc":"waits for the program to be started before returning, otherwise, returns after the start command is sent to the pm daemon"},"inspect":{"needsValue":false,"doc":"starts the process with --inspect-brk parameter to help debugging"}},"inject":["options.program","context"],"usage":"start pm"}}},{"name":"uninstall","config":{"fs":{"path":"dist/esm/cli-commands/uninstall.js","source":"src/cli-commands/uninstall.ts","inject":["params.0","$container"]},"":{"inject":["params.0","$container"]},"cli":{"inject":["params.0","$container"]}}},{"name":"update","config":{"fs":{"path":"dist/esm/cli-commands/update.js","source":"src/cli-commands/update.ts","inject":["params.0","params.1","params.2"]},"cli":{"inject":["params.0","params.1","$container"]},"":{"inject":["params.0","params.1","params.2"]}}},{"name":"version","config":{"fs":{"path":"dist/esm/cli-commands/version.js","source":"src/cli-commands/version.ts","inject":["params.0","params.1"]},"":{"inject":["params.0","params.1"]},"cli":{"inject":["options.packageName","options.folder"],"usage":"version <packageName> [folder]"},"schema":{"inject":["params.0","params.1"],"$defs":{"params.0":{"type":"string"},"params.1":{"type":"string"}}}}}],"$schema":"https://raw.githubusercontent.com/npenin/akala/main/packages/commands/container-schema.json"} as Metadata.Container;
42
42
 
43
43
  export function connect(processor?:ICommandProcessor) {
44
44
  const container = new Container<void>("cliCommands", void 0);
package/src/container.ts CHANGED
@@ -8,51 +8,51 @@ namespace commands
8
8
  {
9
9
  export interface container
10
10
  {
11
- dispatch (cmd:'bridge', ...args: [Argument0<typeof import('./commands/bridge.js').default>, Argument1<typeof import('./commands/bridge.js').default>]): ReturnType<typeof import('./commands/bridge.js').default>
12
- dispatch (cmd:'name', ...args: [Argument0<typeof import('./commands/name.js').default>]): ReturnType<typeof import('./commands/name.js').default>
13
- dispatch (cmd:'proxy', ...args: [Argument0<typeof import('./commands/proxy.js').default>, Argument1<typeof import('./commands/proxy.js').default>]): ReturnType<typeof import('./commands/proxy.js').default>
14
- dispatch (cmd:'ready', ...args: [Argument1<typeof import('./commands/ready.js').default>]): ReturnType<typeof import('./commands/ready.js').default>
15
- dispatch (cmd:'reload-metadata', ...args: [Argument0<typeof import('./commands/reload-metadata.js').default>]): ReturnType<typeof import('./commands/reload-metadata.js').default>
16
- dispatch (cmd:'restart', ...args: [Argument1<typeof import('./commands/restart.js').default>, Argument2<typeof import('./commands/restart.js').default>]): ReturnType<typeof import('./commands/restart.js').default>
17
- dispatch (cmd:'start', ...args: [Argument1<typeof import('./commands/start.js').default>, Argument2<typeof import('./commands/start.js').default>, Argument3<typeof import('./commands/start.js').default>]): ReturnType<typeof import('./commands/start.js').default>
18
- dispatch (cmd:'status', ...args: [Argument0<typeof import('./commands/status.js').default>]): ReturnType<typeof import('./commands/status.js').default>
19
- dispatch (cmd:'stop', ...args: [Argument0<typeof import('./commands/stop.js').default>]): ReturnType<typeof import('./commands/stop.js').default>
20
- dispatch (cmd:'connect', ...args: [Argument0<typeof import('./cli-commands/connect.js').default>, Argument1<typeof import('./cli-commands/connect.js').default>]): ReturnType<typeof import('./cli-commands/connect.js').default>
21
- dispatch (cmd:'discover', ...args: [Argument0<typeof import('./cli-commands/discover.js').default>, Argument1<typeof import('./cli-commands/discover.js').default>]): ReturnType<typeof import('./cli-commands/discover.js').default>
22
- dispatch (cmd:'install', ...args: [Argument0<typeof import('./cli-commands/install.js').default>]): ReturnType<typeof import('./cli-commands/install.js').default>
23
- dispatch (cmd:'link', ...args: [Argument0<typeof import('./cli-commands/link.js').default>, Argument1<typeof import('./cli-commands/link.js').default>]): ReturnType<typeof import('./cli-commands/link.js').default>
24
- dispatch (cmd:'log', ...args: [Argument0<typeof import('./cli-commands/log.js').default>]): ReturnType<typeof import('./cli-commands/log.js').default>
25
- dispatch (cmd:'ls', ...args: []): ReturnType<typeof import('./cli-commands/ls.js').default>
26
- dispatch (cmd:'map', ...args: [Argument0<typeof import('./cli-commands/map.js').default>, Argument1<typeof import('./cli-commands/map.js').default>, Argument2<typeof import('./cli-commands/map.js').default>, Argument3<typeof import('./cli-commands/map.js').default>, Argument4<typeof import('./cli-commands/map.js').default>]): ReturnType<typeof import('./cli-commands/map.js').default>
27
- dispatch (cmd:'run', ...args: [Argument0<typeof import('./cli-commands/run.js').default>, Argument1<typeof import('./cli-commands/run.js').default>]): ReturnType<typeof import('./cli-commands/run.js').default>
28
- dispatch (cmd:'uninstall', ...args: [Argument0<typeof import('./cli-commands/uninstall.js').default>]): ReturnType<typeof import('./cli-commands/uninstall.js').default>
29
- dispatch (cmd:'update', ...args: [Argument0<typeof import('./cli-commands/update.js').default>, Argument1<typeof import('./cli-commands/update.js').default>, Argument2<typeof import('./cli-commands/update.js').default>]): ReturnType<typeof import('./cli-commands/update.js').default>
30
- dispatch (cmd:'version', ...args: [Argument0<typeof import('./cli-commands/version.js').default>, Argument1<typeof import('./cli-commands/version.js').default>]): ReturnType<typeof import('./cli-commands/version.js').default>
11
+ dispatch (cmd:'bridge', ...args: [Argument0<typeof import('./commands/bridge.ts').default>, Argument1<typeof import('./commands/bridge.ts').default>]): ReturnType<typeof import('./commands/bridge.ts').default>
12
+ dispatch (cmd:'name', ...args: [Argument0<typeof import('./commands/name.ts').default>]): ReturnType<typeof import('./commands/name.ts').default>
13
+ dispatch (cmd:'proxy', ...args: [Argument0<typeof import('./commands/proxy.ts').default>, Argument1<typeof import('./commands/proxy.ts').default>]): ReturnType<typeof import('./commands/proxy.ts').default>
14
+ dispatch (cmd:'ready', ...args: [Argument1<typeof import('./commands/ready.ts').default>]): ReturnType<typeof import('./commands/ready.ts').default>
15
+ dispatch (cmd:'reload-metadata', ...args: [Argument0<typeof import('./commands/reload-metadata.ts').default>]): ReturnType<typeof import('./commands/reload-metadata.ts').default>
16
+ dispatch (cmd:'restart', ...args: [Argument1<typeof import('./commands/restart.ts').default>, Argument2<typeof import('./commands/restart.ts').default>]): ReturnType<typeof import('./commands/restart.ts').default>
17
+ dispatch (cmd:'start', ...args: [Argument1<typeof import('./commands/start.ts').default>, Argument2<typeof import('./commands/start.ts').default>, Argument3<typeof import('./commands/start.ts').default>]): ReturnType<typeof import('./commands/start.ts').default>
18
+ dispatch (cmd:'status', ...args: [Argument0<typeof import('./commands/status.ts').default>]): ReturnType<typeof import('./commands/status.ts').default>
19
+ dispatch (cmd:'stop', ...args: [Argument0<typeof import('./commands/stop.ts').default>]): ReturnType<typeof import('./commands/stop.ts').default>
20
+ dispatch (cmd:'connect', ...args: [Argument0<typeof import('./cli-commands/connect.ts').default>, Argument1<typeof import('./cli-commands/connect.ts').default>]): ReturnType<typeof import('./cli-commands/connect.ts').default>
21
+ dispatch (cmd:'discover', ...args: [Argument0<typeof import('./cli-commands/discover.ts').default>, Argument2<typeof import('./cli-commands/discover.ts').default>]): ReturnType<typeof import('./cli-commands/discover.ts').default>
22
+ dispatch (cmd:'install', ...args: [Argument0<typeof import('./cli-commands/install.ts').default>]): ReturnType<typeof import('./cli-commands/install.ts').default>
23
+ dispatch (cmd:'link', ...args: [Argument0<typeof import('./cli-commands/link.ts').default>, Argument1<typeof import('./cli-commands/link.ts').default>]): ReturnType<typeof import('./cli-commands/link.ts').default>
24
+ dispatch (cmd:'log', ...args: [Argument0<typeof import('./cli-commands/log.ts').default>]): ReturnType<typeof import('./cli-commands/log.ts').default>
25
+ dispatch (cmd:'ls', ...args: []): ReturnType<typeof import('./cli-commands/ls.ts').default>
26
+ dispatch (cmd:'map', ...args: [Argument1<typeof import('./cli-commands/map.ts').default>, Argument2<typeof import('./cli-commands/map.ts').default>, Argument3<typeof import('./cli-commands/map.ts').default>, Argument4<typeof import('./cli-commands/map.ts').default>, Argument5<typeof import('./cli-commands/map.ts').default>]): ReturnType<typeof import('./cli-commands/map.ts').default>
27
+ dispatch (cmd:'run', ...args: [Argument0<typeof import('./cli-commands/run.ts').default>, Argument1<typeof import('./cli-commands/run.ts').default>]): ReturnType<typeof import('./cli-commands/run.ts').default>
28
+ dispatch (cmd:'uninstall', ...args: [Argument0<typeof import('./cli-commands/uninstall.ts').default>]): ReturnType<typeof import('./cli-commands/uninstall.ts').default>
29
+ dispatch (cmd:'update', ...args: [Argument0<typeof import('./cli-commands/update.ts').default>, Argument1<typeof import('./cli-commands/update.ts').default>, Argument2<typeof import('./cli-commands/update.ts').default>]): ReturnType<typeof import('./cli-commands/update.ts').default>
30
+ dispatch (cmd:'version', ...args: [Argument0<typeof import('./cli-commands/version.ts').default>, Argument1<typeof import('./cli-commands/version.ts').default>]): ReturnType<typeof import('./cli-commands/version.ts').default>
31
31
  }
32
32
  export interface proxy
33
33
  {
34
- 'bridge'(...args: [Argument0<typeof import('./commands/bridge.js').default>, Argument1<typeof import('./commands/bridge.js').default>]): ReturnType<typeof import('./commands/bridge.js').default>
35
- 'name'(...args: [Argument0<typeof import('./commands/name.js').default>]): ReturnType<typeof import('./commands/name.js').default>
36
- 'proxy'(...args: [Argument0<typeof import('./commands/proxy.js').default>, Argument1<typeof import('./commands/proxy.js').default>]): ReturnType<typeof import('./commands/proxy.js').default>
37
- 'ready'(...args: [Argument1<typeof import('./commands/ready.js').default>]): ReturnType<typeof import('./commands/ready.js').default>
38
- 'reload-metadata'(...args: [Argument0<typeof import('./commands/reload-metadata.js').default>]): ReturnType<typeof import('./commands/reload-metadata.js').default>
39
- 'restart'(...args: [Argument1<typeof import('./commands/restart.js').default>, Argument2<typeof import('./commands/restart.js').default>]): ReturnType<typeof import('./commands/restart.js').default>
40
- 'start'(...args: [Argument1<typeof import('./commands/start.js').default>, Argument2<typeof import('./commands/start.js').default>, Argument3<typeof import('./commands/start.js').default>]): ReturnType<typeof import('./commands/start.js').default>
41
- 'status'(...args: [Argument0<typeof import('./commands/status.js').default>]): ReturnType<typeof import('./commands/status.js').default>
42
- 'stop'(...args: [Argument0<typeof import('./commands/stop.js').default>]): ReturnType<typeof import('./commands/stop.js').default>
43
- 'connect'(...args: [Argument0<typeof import('./cli-commands/connect.js').default>, Argument1<typeof import('./cli-commands/connect.js').default>]): ReturnType<typeof import('./cli-commands/connect.js').default>
44
- 'discover'(...args: [Argument0<typeof import('./cli-commands/discover.js').default>, Argument1<typeof import('./cli-commands/discover.js').default>]): ReturnType<typeof import('./cli-commands/discover.js').default>
45
- 'install'(...args: [Argument0<typeof import('./cli-commands/install.js').default>]): ReturnType<typeof import('./cli-commands/install.js').default>
46
- 'link'(...args: [Argument0<typeof import('./cli-commands/link.js').default>, Argument1<typeof import('./cli-commands/link.js').default>]): ReturnType<typeof import('./cli-commands/link.js').default>
47
- 'log'(...args: [Argument0<typeof import('./cli-commands/log.js').default>]): ReturnType<typeof import('./cli-commands/log.js').default>
48
- 'ls'(...args: []): ReturnType<typeof import('./cli-commands/ls.js').default>
49
- 'map'(...args: [Argument0<typeof import('./cli-commands/map.js').default>, Argument1<typeof import('./cli-commands/map.js').default>, Argument2<typeof import('./cli-commands/map.js').default>, Argument3<typeof import('./cli-commands/map.js').default>, Argument4<typeof import('./cli-commands/map.js').default>]): ReturnType<typeof import('./cli-commands/map.js').default>
50
- 'run'(...args: [Argument0<typeof import('./cli-commands/run.js').default>, Argument1<typeof import('./cli-commands/run.js').default>]): ReturnType<typeof import('./cli-commands/run.js').default>
51
- 'uninstall'(...args: [Argument0<typeof import('./cli-commands/uninstall.js').default>]): ReturnType<typeof import('./cli-commands/uninstall.js').default>
52
- 'update'(...args: [Argument0<typeof import('./cli-commands/update.js').default>, Argument1<typeof import('./cli-commands/update.js').default>, Argument2<typeof import('./cli-commands/update.js').default>]): ReturnType<typeof import('./cli-commands/update.js').default>
53
- 'version'(...args: [Argument0<typeof import('./cli-commands/version.js').default>, Argument1<typeof import('./cli-commands/version.js').default>]): ReturnType<typeof import('./cli-commands/version.js').default>
34
+ 'bridge'(...args: [Argument0<typeof import('./commands/bridge.ts').default>, Argument1<typeof import('./commands/bridge.ts').default>]): ReturnType<typeof import('./commands/bridge.ts').default>
35
+ 'name'(...args: [Argument0<typeof import('./commands/name.ts').default>]): ReturnType<typeof import('./commands/name.ts').default>
36
+ 'proxy'(...args: [Argument0<typeof import('./commands/proxy.ts').default>, Argument1<typeof import('./commands/proxy.ts').default>]): ReturnType<typeof import('./commands/proxy.ts').default>
37
+ 'ready'(...args: [Argument1<typeof import('./commands/ready.ts').default>]): ReturnType<typeof import('./commands/ready.ts').default>
38
+ 'reload-metadata'(...args: [Argument0<typeof import('./commands/reload-metadata.ts').default>]): ReturnType<typeof import('./commands/reload-metadata.ts').default>
39
+ 'restart'(...args: [Argument1<typeof import('./commands/restart.ts').default>, Argument2<typeof import('./commands/restart.ts').default>]): ReturnType<typeof import('./commands/restart.ts').default>
40
+ 'start'(...args: [Argument1<typeof import('./commands/start.ts').default>, Argument2<typeof import('./commands/start.ts').default>, Argument3<typeof import('./commands/start.ts').default>]): ReturnType<typeof import('./commands/start.ts').default>
41
+ 'status'(...args: [Argument0<typeof import('./commands/status.ts').default>]): ReturnType<typeof import('./commands/status.ts').default>
42
+ 'stop'(...args: [Argument0<typeof import('./commands/stop.ts').default>]): ReturnType<typeof import('./commands/stop.ts').default>
43
+ 'connect'(...args: [Argument0<typeof import('./cli-commands/connect.ts').default>, Argument1<typeof import('./cli-commands/connect.ts').default>]): ReturnType<typeof import('./cli-commands/connect.ts').default>
44
+ 'discover'(...args: [Argument0<typeof import('./cli-commands/discover.ts').default>, Argument2<typeof import('./cli-commands/discover.ts').default>]): ReturnType<typeof import('./cli-commands/discover.ts').default>
45
+ 'install'(...args: [Argument0<typeof import('./cli-commands/install.ts').default>]): ReturnType<typeof import('./cli-commands/install.ts').default>
46
+ 'link'(...args: [Argument0<typeof import('./cli-commands/link.ts').default>, Argument1<typeof import('./cli-commands/link.ts').default>]): ReturnType<typeof import('./cli-commands/link.ts').default>
47
+ 'log'(...args: [Argument0<typeof import('./cli-commands/log.ts').default>]): ReturnType<typeof import('./cli-commands/log.ts').default>
48
+ 'ls'(...args: []): ReturnType<typeof import('./cli-commands/ls.ts').default>
49
+ 'map'(...args: [Argument1<typeof import('./cli-commands/map.ts').default>, Argument2<typeof import('./cli-commands/map.ts').default>, Argument3<typeof import('./cli-commands/map.ts').default>, Argument4<typeof import('./cli-commands/map.ts').default>, Argument5<typeof import('./cli-commands/map.ts').default>]): ReturnType<typeof import('./cli-commands/map.ts').default>
50
+ 'run'(...args: [Argument0<typeof import('./cli-commands/run.ts').default>, Argument1<typeof import('./cli-commands/run.ts').default>]): ReturnType<typeof import('./cli-commands/run.ts').default>
51
+ 'uninstall'(...args: [Argument0<typeof import('./cli-commands/uninstall.ts').default>]): ReturnType<typeof import('./cli-commands/uninstall.ts').default>
52
+ 'update'(...args: [Argument0<typeof import('./cli-commands/update.ts').default>, Argument1<typeof import('./cli-commands/update.ts').default>, Argument2<typeof import('./cli-commands/update.ts').default>]): ReturnType<typeof import('./cli-commands/update.ts').default>
53
+ 'version'(...args: [Argument0<typeof import('./cli-commands/version.ts').default>, Argument1<typeof import('./cli-commands/version.ts').default>]): ReturnType<typeof import('./cli-commands/version.ts').default>
54
54
  }
55
- export const meta={"name":"pm","commands":[{"name":"$init","config":{"fs":{"disabled":true,"path":"dist/esm/commands/$init.js","source":"src/commands/$init.ts","inject":["$container","params.0"]},"":{"inject":["$container","params.0"]},"cli":{"inject":["$container","context"],"usage":"$init [...args]","options":{"configFile":{"needsValue":true,"aliases":["c"]},"keepAttached":{"aliases":["keep-attached"],"needsValue":false,"doc":"keeps the process attached to the current terminal"},"wait":{"aliases":["w"],"needsValue":false,"doc":"waits for the program to be started before returning, otherwise, returns after the start command is sent to the pm daemon"},"tcpPort":{"needsValue":true,"aliases":["tcp-port"]},"port":{"needsValue":true},"key":{"needsValue":true},"cert":{"needsValue":true}}}}},{"name":"bridge","config":{"fs":{"path":"dist/esm/commands/bridge.js","source":"src/commands/bridge.ts","inject":["params.0","params.1"]},"jsonrpc":{"inject":["params.0","socket"]},"":{"inject":["params.0","params.1"]}}},{"name":"name","config":{"fs":{"path":"dist/esm/commands/name.js","source":"src/commands/name.ts","inject":["params.0"]},"":{"inject":["params.0"]}}},{"name":"proxy","config":{"fs":{"path":"dist/esm/commands/proxy.js","source":"src/commands/proxy.ts","inject":["params.0","params.1"]},"jsonrpc":{"inject":["params.0","socket"]},"":{"inject":["params.0","params.1"]}}},{"name":"ready","config":{"fs":{"path":"dist/esm/commands/ready.js","source":"src/commands/ready.ts","inject":["$container","params.0"]},"jsonrpc":{"inject":["$container","dummy","connectionAsContainer"]},"pm":{"inject":["$container","params.0"]},"":{"inject":["$container","params.0"]}}},{"name":"reload-metadata","config":{"fs":{"inject":["params.0"],"path":"dist/esm/commands/reload-metadata.js","source":"src/commands/reload-metadata.ts"},"jsonrpc":{"inject":["connectionAsContainer"]},"":{"inject":["params.0"]}}},{"name":"restart","config":{"fs":{"path":"dist/esm/commands/restart.js","source":"src/commands/restart.ts","inject":["$container","params.0","params.1"]},"":{"inject":["$container","params.0","params.1"]},"cli":{"options":{"wait":{"aliases":["w"],"needsValue":false,"doc":"waits for the program to be started before returning, otherwise, returns after the start command is sent to the pm daemon"},"inspect":{"needsValue":false,"doc":"starts the process with --inspect-brk parameter to help debugging"},"new":{"needsValue":false},"name":{"doc":"name to assign to the process","needsValue":true},"program":{"doc":"program to start"}},"inject":["$container","params.0","context"],"usage":"restart <program>"},"schema":{"inject":["$container","params.0","params.1"],"$defs":{"params.0":{"type":"string"},"params.1":{"type":"object","properties":{"wait":{"type":"boolean"}}}}},"html-form":{"inject":["$container","params.0","params.1"]}}},{"name":"start","config":{"fs":{"path":"dist/esm/commands/start.js","source":"src/commands/start.ts","inject":["$container","params.0","params.1","params.2"]},"":{"inject":["$container","params.0","params.1","params.2"]},"cli":{"options":{"wait":{"aliases":["w"],"needsValue":false,"doc":"waits for the program to be started before returning, otherwise, returns after the start command is sent to the pm daemon"},"inspect":{"needsValue":false,"doc":"starts the process with --inspect-brk parameter to help debugging"},"new":{"needsValue":false},"name":{"doc":"name to assign to the process","needsValue":true},"program":{"doc":"program to start"},"autostart":{"doc":"start automatically when pm starts"}},"inject":["$container","options.program","options","context"],"usage":"start <program>"},"html-form":{"inject":["$container","params.0","params.1","params.2"]},"schema":{"inject":["$container","params.0","params.1","params.2"],"$defs":{"params.0":{"type":"string"},"params.1":{"type":"object","properties":{"wait":{"type":"boolean"},"inspect":{"type":"boolean"},"new":{"type":"boolean"},"name":{"type":"string"},"program":{"type":"string"}}},"params.2":{"type":"object","properties":{"args":{"type":"array","items":{"type":"string"}}}}}}}},{"name":"status","config":{"fs":{"path":"dist/esm/commands/status.js","source":"src/commands/status.ts","inject":["params.0"]},"":{"inject":["params.0"]},"cli":{"inject":["params.0"]},"html-form":{"inject":["params.0"]},"schema":{"inject":["params.0"],"$defs":{"params.0":{"type":"string","description":"The name of the container to get the status of"}}}}},{"name":"stop","config":{"fs":{"path":"dist/esm/commands/stop.js","source":"src/commands/stop.ts","inject":["params.0","$container"]},"":{"inject":["params.0","$container"]},"cli":{"inject":["options.process","$container"],"options":{"process":{"doc":"process to stop. Stops all the processes otherwise (including pm)."}},"usage":"stop [process]"},"html-form":{"inject":["params.0","$container"]},"schema":{"inject":["params.0","$container"],"$defs":{"params.0":{"type":"string"}}}}},{"name":"connect","config":{"fs":{"path":"dist/esm/cli-commands/connect.js","source":"src/cli-commands/connect.ts","inject":["params.0","params.1"]},"":{"inject":["params.0","params.1"]},"cli":{"usage":"connect <name>","inject":["options.name","context"],"options":{"tcpPort":{"needsValue":true,"aliases":["tcp-port"]},"port":{"needsValue":true},"key":{"needsValue":true},"cert":{"needsValue":true}}}}},{"name":"discover","config":{"fs":{"path":"dist/esm/cli-commands/discover.js","source":"src/cli-commands/discover.ts","inject":["params.0","params.1","$container"]},"":{"inject":["params.0","params.1","$container"]},"cli":{"usage":"discover <name> <folder>","options":{"folder":{"normalize":true}},"inject":["options.name","options.folder","$container"]}}},{"name":"install","config":{"fs":{"path":"dist/esm/cli-commands/install.js","source":"src/cli-commands/install.ts","inject":["params.0","$container"]},"":{"inject":["params.0","$container"]},"cli":{"inject":["params.0","$container"]}}},{"name":"link","config":{"fs":{"path":"dist/esm/cli-commands/link.js","source":"src/cli-commands/link.ts","inject":["params.0","params.1","$container"]},"":{"inject":["params.0","params.1","$container"]},"cli":{"inject":["params.0","params.1","$container"]}}},{"name":"log","config":{"fs":{"path":"dist/esm/cli-commands/log.js","source":"src/cli-commands/log.ts","inject":["params.0"]},"":{"inject":["params.0"]},"cli":{"inject":["params.0"]}}},{"name":"ls","config":{"fs":{"path":"dist/esm/cli-commands/ls.js","source":"src/cli-commands/ls.ts","inject":[]},"":{"inject":[]},"cli":{"inject":[]},"html-form":{"inject":[]}}},{"name":"map","config":{"fs":{"path":"dist/esm/cli-commands/map.js","source":"src/cli-commands/map.ts","inject":["params.0","params.1","params.2","params.3","params.4"]},"":{"inject":["params.0","params.1","params.2","params.3","params.4"]},"cli":{"inject":["options.name","options.path","options.runtime","cwd","options"],"options":{"commandable":{"aliases":["c"],"needsValue":false},"stateless":{"aliases":["s"],"needsValue":false},"runtime":{"aliases":["r"],"needsValue":true}},"usage":"map <name> <path>"}}},{"name":"run","config":{"fs":{"path":"dist/esm/cli-commands/run.js","source":"src/cli-commands/run.ts","inject":["params.0","params.1"]},"":{"inject":["params.0","params.1"]},"jsonrpc":false,"cli":{"options":{"output":{"aliases":["o"],"needsValue":true,"doc":"output as `table` if array otherwise falls back to standard node output"},"verbose":{"aliases":["v"]},"tls":{"doc":"enables tls connection to the `pmSock`"},"pmSock":{"aliases":["pm-sock"],"needsValue":true,"doc":"path to the unix socket or destination in the form host:port"},"help":{"doc":"displays this help message"},"keepAttached":{"aliases":["keep-attached"],"needsValue":false,"doc":"keeps the process attached to the current terminal"},"wait":{"aliases":["w"],"needsValue":false,"doc":"waits for the program to be started before returning, otherwise, returns after the start command is sent to the pm daemon"},"inspect":{"needsValue":false,"doc":"starts the process with --inspect-brk parameter to help debugging"},"new":{"needsValue":false},"name":{"doc":"name to assign to the process","needsValue":true},"program":{"doc":"program to start"}},"inject":["options.program","options.name","context","options.pmSock"],"usage":"run <name> [...args]"}}},{"name":"uninstall","config":{"fs":{"path":"dist/esm/cli-commands/uninstall.js","source":"src/cli-commands/uninstall.ts","inject":["params.0","$container"]},"":{"inject":["params.0","$container"]},"cli":{"inject":["params.0","$container"]}}},{"name":"update","config":{"fs":{"path":"dist/esm/cli-commands/update.js","source":"src/cli-commands/update.ts","inject":["params.0","params.1","params.2"]},"cli":{"inject":["params.0","params.1","$container"]},"":{"inject":["params.0","params.1","params.2"]}}},{"name":"version","config":{"fs":{"path":"dist/esm/cli-commands/version.js","source":"src/cli-commands/version.ts","inject":["params.0","params.1"]},"":{"inject":["params.0","params.1"]},"cli":{"inject":["options.packageName","options.folder"],"usage":"version <packageName> [folder]"},"schema":{"inject":["params.0","params.1"],"$defs":{"params.0":{"type":"string"},"params.1":{"type":"string"}}}}}],"extends":["./cli-commands.json"],"$schema":"https://raw.githubusercontent.com/npenin/akala/main/packages/commands/container-schema.json"} as Metadata.Container;
55
+ export const meta={"name":"pm","commands":[{"name":"$init","config":{"fs":{"disabled":true,"path":"dist/esm/commands/$init.js","source":"src/commands/$init.ts","inject":["$container","params.0"]},"":{"inject":["$container","params.0"]},"cli":{"inject":["$container","context"],"usage":"$init [...args]","options":{"configFile":{"needsValue":true,"aliases":["c"]},"keepAttached":{"aliases":["keep-attached"],"needsValue":false,"doc":"keeps the process attached to the current terminal"},"wait":{"aliases":["w"],"needsValue":false,"doc":"waits for the program to be started before returning, otherwise, returns after the start command is sent to the pm daemon"},"tcpPort":{"needsValue":true,"aliases":["tcp-port"]},"port":{"needsValue":true},"key":{"needsValue":true},"cert":{"needsValue":true}}}}},{"name":"bridge","config":{"fs":{"path":"dist/esm/commands/bridge.js","source":"src/commands/bridge.ts","inject":["params.0","params.1"]},"jsonrpc":{"inject":["params.0","socket"]},"":{"inject":["params.0","params.1"]}}},{"name":"name","config":{"fs":{"path":"dist/esm/commands/name.js","source":"src/commands/name.ts","inject":["params.0"]},"":{"inject":["params.0"]}}},{"name":"proxy","config":{"fs":{"path":"dist/esm/commands/proxy.js","source":"src/commands/proxy.ts","inject":["params.0","params.1"]},"jsonrpc":{"inject":["params.0","socket"]},"":{"inject":["params.0","params.1"]}}},{"name":"ready","config":{"fs":{"path":"dist/esm/commands/ready.js","source":"src/commands/ready.ts","inject":["$container","params.0"]},"jsonrpc":{"inject":["$container","dummy","connectionAsContainer"]},"pm":{"inject":["$container","params.0"]},"":{"inject":["$container","params.0"]}}},{"name":"reload-metadata","config":{"fs":{"inject":["params.0"],"path":"dist/esm/commands/reload-metadata.js","source":"src/commands/reload-metadata.ts"},"jsonrpc":{"inject":["connectionAsContainer"]},"":{"inject":["params.0"]}}},{"name":"restart","config":{"fs":{"path":"dist/esm/commands/restart.js","source":"src/commands/restart.ts","inject":["$container","params.0","params.1"]},"":{"inject":["$container","params.0","params.1"]},"cli":{"options":{"wait":{"aliases":["w"],"needsValue":false,"doc":"waits for the program to be started before returning, otherwise, returns after the start command is sent to the pm daemon"},"inspect":{"needsValue":false,"doc":"starts the process with --inspect-brk parameter to help debugging"},"new":{"needsValue":false},"name":{"doc":"name to assign to the process","needsValue":true},"program":{"doc":"program to start"}},"inject":["$container","params.0","context"],"usage":"restart <program>"},"schema":{"inject":["$container","params.0","params.1"],"$defs":{"params.0":{"type":"string"},"params.1":{"type":"object","properties":{"wait":{"type":"boolean"}}}}},"html-form":{"inject":["$container","params.0","params.1"]}}},{"name":"start","config":{"fs":{"path":"dist/esm/commands/start.js","source":"src/commands/start.ts","inject":["$container","params.0","params.1","params.2"]},"":{"inject":["$container","params.0","params.1","params.2"]},"cli":{"options":{"wait":{"aliases":["w"],"needsValue":false,"doc":"waits for the program to be started before returning, otherwise, returns after the start command is sent to the pm daemon"},"inspect":{"needsValue":false,"doc":"starts the process with --inspect-brk parameter to help debugging"},"new":{"needsValue":false},"name":{"doc":"name to assign to the process","needsValue":true},"program":{"doc":"program to start"},"autostart":{"doc":"start automatically when pm starts"}},"inject":["$container","options.program","options","context"],"usage":"start <program>"},"html-form":{"inject":["$container","params.0","params.1","params.2"]},"schema":{"inject":["$container","params.0","params.1","params.2"],"$defs":{"params.0":{"type":"string"},"params.1":{"type":"object","properties":{"wait":{"type":"boolean"},"inspect":{"type":"boolean"},"new":{"type":"boolean"},"name":{"type":"string"},"program":{"type":"string"}}},"params.2":{"type":"object","properties":{"args":{"type":"array","items":{"type":"string"}}}}}}}},{"name":"status","config":{"fs":{"path":"dist/esm/commands/status.js","source":"src/commands/status.ts","inject":["params.0"]},"":{"inject":["params.0"]},"cli":{"inject":["params.0"]},"html-form":{"inject":["params.0"]},"schema":{"inject":["params.0"],"$defs":{"params.0":{"type":"string","description":"The name of the container to get the status of"}}}}},{"name":"stop","config":{"fs":{"path":"dist/esm/commands/stop.js","source":"src/commands/stop.ts","inject":["params.0","$container"]},"":{"inject":["params.0","$container"]},"cli":{"inject":["options.process","$container"],"options":{"process":{"doc":"process to stop. Stops all the processes otherwise (including pm)."}},"usage":"stop [process]"},"html-form":{"inject":["params.0","$container"]},"schema":{"inject":["params.0","$container"],"$defs":{"params.0":{"type":"string"}}}}},{"name":"connect","config":{"fs":{"path":"dist/esm/cli-commands/connect.js","source":"src/cli-commands/connect.ts","inject":["params.0","params.1"]},"":{"inject":["params.0","params.1"]},"cli":{"usage":"connect <name>","inject":["options.name","context"],"options":{"tcpPort":{"needsValue":true,"aliases":["tcp-port"]},"port":{"needsValue":true},"key":{"needsValue":true},"cert":{"needsValue":true}}}}},{"name":"discover","config":{"fs":{"path":"dist/esm/cli-commands/discover.js","source":"src/cli-commands/discover.ts","inject":["params.0","$container","params.1"]},"":{"inject":["params.0","$container","params.1"]},"cli":{"usage":"discover <path> [name]","options":{"path":{"normalize":true}},"inject":["options.path","$container","options.name"]}}},{"name":"install","config":{"fs":{"path":"dist/esm/cli-commands/install.js","source":"src/cli-commands/install.ts","inject":["params.0","$container"]},"":{"inject":["params.0","$container"]},"cli":{"inject":["params.0","$container"]}}},{"name":"link","config":{"fs":{"path":"dist/esm/cli-commands/link.js","source":"src/cli-commands/link.ts","inject":["params.0","params.1","$container"]},"":{"inject":["params.0","params.1","$container"]},"cli":{"inject":["params.0","params.1","$container"]}}},{"name":"log","config":{"fs":{"path":"dist/esm/cli-commands/log.js","source":"src/cli-commands/log.ts","inject":["params.0"]},"":{"inject":["params.0"]},"cli":{"inject":["params.0"]}}},{"name":"ls","config":{"fs":{"path":"dist/esm/cli-commands/ls.js","source":"src/cli-commands/ls.ts","inject":[]},"":{"inject":[]},"cli":{"inject":[]},"html-form":{"inject":[]}}},{"name":"map","config":{"fs":{"path":"dist/esm/cli-commands/map.js","source":"src/cli-commands/map.ts","inject":["$state.config","params.0","params.1","params.2","params.3","params.4"]},"":{"inject":["$state.config","params.0","params.1","params.2","params.3","params.4"]},"cli":{"inject":["context.state","options.name","options.path","options.runtime","cwd","options"],"options":{"commandable":{"aliases":["c"],"needsValue":false},"stateless":{"aliases":["s"],"needsValue":false},"runtime":{"aliases":["r"],"needsValue":true}},"usage":"map <name> <path>"}}},{"name":"run","config":{"fs":{"path":"dist/esm/cli-commands/run.js","source":"src/cli-commands/run.ts","inject":["params.0","params.1"]},"":{"inject":["params.0","params.1"]},"jsonrpc":false,"cli":{"options":{"output":{"aliases":["o"],"needsValue":true,"doc":"output as `table` if array otherwise falls back to standard node output"},"verbose":{"aliases":["v"]},"tls":{"doc":"enables tls connection to the `pmSock`"},"pmSock":{"aliases":["pm-sock"],"needsValue":true,"doc":"path to the unix socket or destination in the form host:port"},"help":{"doc":"displays this help message"},"keepAttached":{"aliases":["keep-attached"],"needsValue":false,"doc":"keeps the process attached to the current terminal"},"wait":{"aliases":["w"],"needsValue":false,"doc":"waits for the program to be started before returning, otherwise, returns after the start command is sent to the pm daemon"},"inspect":{"needsValue":false,"doc":"starts the process with --inspect-brk parameter to help debugging"},"new":{"needsValue":false},"name":{"doc":"name to assign to the process","needsValue":true},"program":{"doc":"program to start"}},"inject":["options.program","options.name","context","options.pmSock"],"usage":"run <name> [...args]"}}},{"name":"uninstall","config":{"fs":{"path":"dist/esm/cli-commands/uninstall.js","source":"src/cli-commands/uninstall.ts","inject":["params.0","$container"]},"":{"inject":["params.0","$container"]},"cli":{"inject":["params.0","$container"]}}},{"name":"update","config":{"fs":{"path":"dist/esm/cli-commands/update.js","source":"src/cli-commands/update.ts","inject":["params.0","params.1","params.2"]},"cli":{"inject":["params.0","params.1","$container"]},"":{"inject":["params.0","params.1","params.2"]}}},{"name":"version","config":{"fs":{"path":"dist/esm/cli-commands/version.js","source":"src/cli-commands/version.ts","inject":["params.0","params.1"]},"":{"inject":["params.0","params.1"]},"cli":{"inject":["options.packageName","options.folder"],"usage":"version <packageName> [folder]"},"schema":{"inject":["params.0","params.1"],"$defs":{"params.0":{"type":"string"},"params.1":{"type":"string"}}}}}],"extends":["./cli-commands.json"],"$schema":"https://raw.githubusercontent.com/npenin/akala/main/packages/commands/container-schema.json"} as Metadata.Container;
56
56
 
57
57
  export function connect(processor?:ICommandProcessor) {
58
58
  const container = new Container<void>("commands", void 0);
package/src/standalone.ts CHANGED
@@ -55,9 +55,9 @@ program.option<string, 'program'>('program', { needsValue: true, normalize: true
55
55
  cliContainer = new ac.Container('cli', {});
56
56
 
57
57
  if (folderOrFile.isFile)
58
- processor = new ac.Processors.FileSystem(new URL('./', c.options.program));
58
+ processor = new ac.Processors.FileSystem(fs.newChroot(new URL('./', c.options.program)));
59
59
  else
60
- processor = new ac.Processors.FileSystem(new URL(c.options.program));
60
+ processor = new ac.Processors.FileSystem(fs.newChroot(new URL(c.options.program)));
61
61
  }).
62
62
  useMiddleware(null, MiddlewareCompositeAsync.new(logMiddleware,
63
63
  convertToMiddleware(async c =>