@plurnk/plurnk-execs 3.2.0 → 4.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/SPEC.md CHANGED
@@ -274,10 +274,11 @@ reclassifies the materialized path.
274
274
  | `pure` | Has no externally observable side effect. | Automatically accepted. |
275
275
 
276
276
  The classification controls admission policy and may be reused as operational
277
- metadata; it never changes within the invocation. After acceptance, every execution
277
+ metadata; it never changes within the invocation. After acceptance, an external execution
278
278
  uses the same background stream path: output is not returned in the dispatching
279
279
  turn. Core owns that composed behavior in {§exec-host-proposes},
280
- {§exec-readpure-ungated}, and {§exec-stream}.
280
+ {§exec-readpure-ungated}, and {§exec-stream}; its ordered subsystem commands use
281
+ {§functionality-model-mutation}.
281
282
 
282
283
  ### §executor-probe Availability is per runtime tag
283
284
 
@@ -601,7 +602,7 @@ package discovery also returns them in `Discovery.disabled`.
601
602
  Workspace and loop admission remain consumer concerns;
602
603
  the framework does not define a second Active/Available state machine.
603
604
 
604
- §executor-spawn-account **Every subprocess runtime spawns as one configured account.** `PLURNK_EXECS_SPAWN_USER` names the account each subprocess runtime's child runs as: an account name, resolved once through the host's account database, or `uid[:gid]` taken as written; unset, the daemon's own. The child's environment names it, `HOME`, `USER` and `LOGNAME` following a named account, applied after the composed environment the service hands over and before the spawn. Availability probes run as the same account, so a runtime the account cannot execute is not advertised. A value that resolves to no account is an invalid configuration at the spawn, named by the knob. The key sits outside the runtime policy grammar above; the privilege to assume the account is the daemon's to have, nothing here grants it.
605
+ §executor-spawn-account **Every subprocess runtime spawns as one configured account.** `PLURNK_EXECS_SPAWN_USER` names the account each subprocess runtime's child runs as: an account name, resolved once through the host's account database with `getent passwd`, or `uid[:gid]` taken as written; unset, the daemon's own. A host without `getent` names the account as `uid[:gid]`. The child's environment names it, `HOME`, `USER` and `LOGNAME` following a named account, applied after the composed environment the service hands over and before the spawn. Availability probes run as the same account, so a runtime the account cannot execute is not advertised. A value that resolves to no account is an invalid configuration at the spawn, named by the knob: a name the database does not hold `names no account on this host`; a lookup that did not run, exited otherwise or answered another record `was not resolved`, with what the lookup did, and is never reported as an absent account. An account the daemon may not assume fails the spawn with the host's error; nothing runs as the daemon's own account in its place. The key sits outside the runtime policy grammar above; the privilege to assume the account is the daemon's to have, nothing here grants it.
605
606
 
606
607
  ## §executor-default-inventory Current installed set
607
608
 
@@ -642,11 +643,18 @@ interface SpawnArgs {
642
643
 
643
644
  | Runtime | No-target spawn |
644
645
  | -------------------------- | -------------------------------------------------------------------- |
645
- | `sh` | Shell command line. |
646
+ | `sh` | `<shell> -c <body>`, the environment's shell ({§executor-shell}). |
646
647
  | `node` | `node -e <body>`. |
647
648
  | `python3` | `python3 -c <body>`. |
648
649
  | Other default-base runtime | `<runtime> -c <body>`; specialized executors override this fallback. |
649
650
 
651
+ §executor-shell **`sh` runs the environment's shell, and says which.** The shell is `$SHELL` when it
652
+ is an absolute path to an executable file, and `/bin/sh`, the system shell, otherwise. It is resolved
653
+ once per daemon process, and that one resolution serves both the spawn and the declaration's summary,
654
+ which names the program the path runs, the version its `--version` reports when it reports one, and
655
+ the path: `Run shell commands and scripts with bash 5.2.37 (/bin/bash).` A script target runs under
656
+ the same shell. Nothing about the dialect is promised beyond what the summary names.
657
+
650
658
  With a target, the target is the program and the body is its stdin. Each executor
651
659
  uses its interpreter's file form (`awk -f <target>`, for example). The working
652
660
  directory is the consumer's `cwd` — the project root, or the directory a
@@ -0,0 +1,13 @@
1
+ export interface ShellChoice {
2
+ readonly path: string;
3
+ readonly program: string;
4
+ readonly version: string | null;
5
+ }
6
+ export default class Shell {
7
+ #private;
8
+ static readonly SYSTEM = "/bin/sh";
9
+ static resolve(env?: NodeJS.ProcessEnv): ShellChoice;
10
+ static current(): ShellChoice;
11
+ static summary({ path, program, version }: ShellChoice): string;
12
+ }
13
+ //# sourceMappingURL=Shell.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Shell.d.ts","sourceRoot":"","sources":["../src/Shell.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,WAAW;IAExB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IAEzB,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;CACnC;AAED,MAAM,CAAC,OAAO,OAAO,KAAK;;IACtB,MAAM,CAAC,QAAQ,CAAC,MAAM,aAAa;IAGnC,MAAM,CAAC,OAAO,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,WAAW,CAIhE;IAGD,MAAM,CAAC,OAAO,IAAI,WAAW,CAE5B;IAED,MAAM,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,WAAW,GAAG,MAAM,CAE9D;CAuBJ"}
package/dist/Shell.js ADDED
@@ -0,0 +1,51 @@
1
+ // {§executor-shell} The shell `sh` runs: the environment's `$SHELL` when it names an executable file, else
2
+ // the system shell. One resolution per process serves both the declaration's summary and the spawn.
3
+ import { spawnSync } from "node:child_process";
4
+ import { accessSync, constants, realpathSync, statSync } from "node:fs";
5
+ import { basename, isAbsolute } from "node:path";
6
+ import SpawnAccounts from "./SpawnAccount.js";
7
+ export default class Shell {
8
+ static SYSTEM = "/bin/sh";
9
+ static #current = null;
10
+ static resolve(env = process.env) {
11
+ const declared = env.SHELL;
12
+ const path = declared !== undefined && isAbsolute(declared) && Shell.#executable(declared) ? declared : Shell.SYSTEM;
13
+ return { path, program: Shell.#program(path), version: Shell.#version(path, env) };
14
+ }
15
+ // Resolved on first use and held for the process, so what the summary names is what runs.
16
+ static current() {
17
+ return Shell.#current ??= Shell.resolve();
18
+ }
19
+ static summary({ path, program, version }) {
20
+ return `Run shell commands and scripts with ${program}${version === null ? "" : ` ${version}`} (${path}).`;
21
+ }
22
+ static #executable(path) {
23
+ try {
24
+ if (!statSync(path).isFile())
25
+ return false;
26
+ accessSync(path, constants.X_OK);
27
+ return true;
28
+ }
29
+ catch {
30
+ return false;
31
+ }
32
+ }
33
+ static #program(path) {
34
+ try {
35
+ return basename(realpathSync(path));
36
+ }
37
+ catch {
38
+ return basename(path);
39
+ }
40
+ }
41
+ // The first dotted number on the first line; a shell without `--version` (dash) reports none.
42
+ static #version(path, env) {
43
+ const probe = spawnSync(path, ["--version"], {
44
+ encoding: "utf8", timeout: 2_000, stdio: ["ignore", "pipe", "ignore"], ...SpawnAccounts.options(env), // {§executor-spawn-account}
45
+ });
46
+ if (probe.status !== 0)
47
+ return null;
48
+ return /\d+(?:\.\d+)+/u.exec(probe.stdout.split("\n")[0] ?? "")?.[0] ?? null;
49
+ }
50
+ }
51
+ //# sourceMappingURL=Shell.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Shell.js","sourceRoot":"","sources":["../src/Shell.ts"],"names":[],"mappings":"AAAA,2GAA2G;AAC3G,oGAAoG;AACpG,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACxE,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,aAAa,MAAM,mBAAmB,CAAC;AAW9C,MAAM,CAAC,OAAO,OAAO,KAAK;IACtB,MAAM,CAAU,MAAM,GAAG,SAAS,CAAC;IACnC,MAAM,CAAC,QAAQ,GAAuB,IAAI,CAAC;IAE3C,MAAM,CAAC,OAAO,CAAC,GAAG,GAAsB,OAAO,CAAC,GAAG;QAC/C,MAAM,QAAQ,GAAG,GAAG,CAAC,KAAK,CAAC;QAC3B,MAAM,IAAI,GAAG,QAAQ,KAAK,SAAS,IAAI,UAAU,CAAC,QAAQ,CAAC,IAAI,KAAK,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC;QACrH,OAAO,EAAE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,MAAM,EAAE,QAAQ,CAAC,EAAE,GAAG,aAAa,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,4BAA4B;SACrI,CAAC,CAAC;QACH,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO,IAAI,CAAC;QACpC,OAAO,gBAAgB,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC;IACjF,CAAC;CACJ"}
@@ -5,6 +5,13 @@ export type SpawnAccount = {
5
5
  readonly gid: number;
6
6
  readonly home: string | null;
7
7
  };
8
+ /** What the host's account lookup answered: the fields of `spawnSync` this resolver reads. */
9
+ export type AccountLookup = (name: string) => {
10
+ readonly error?: Error;
11
+ readonly status: number | null;
12
+ readonly signal?: NodeJS.Signals | null;
13
+ readonly stdout: string;
14
+ };
8
15
  export default class SpawnAccounts {
9
16
  #private;
10
17
  static configured(env?: NodeJS.ProcessEnv): SpawnAccount | null;
@@ -13,5 +20,6 @@ export default class SpawnAccounts {
13
20
  gid?: number;
14
21
  };
15
22
  static environment(base: NodeJS.ProcessEnv, env?: NodeJS.ProcessEnv): NodeJS.ProcessEnv;
23
+ static resolve(value: string, lookup?: AccountLookup): SpawnAccount;
16
24
  }
17
25
  //# sourceMappingURL=SpawnAccount.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"SpawnAccount.d.ts","sourceRoot":"","sources":["../src/SpawnAccount.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,UAAU,4BAA4B,CAAC;AAEpD,MAAM,MAAM,YAAY,GAAG;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,IA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IAAI,CAQ3E;IAGD,MAAM,CAAC,OAAO,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG;QAAE,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,CAAA;KAAE,CAGnF;IAID,MAAM,CAAC,WAAW,CAAC,IAAI,EAAE,MAAM,CAAC,UAAU,EAAE,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,MAAM,CAAC,UAAU,CAInG;IAID,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,GAAE,aAAsB,GAAG,YAAY,CAoB1E;CACJ"}
@@ -1,5 +1,8 @@
1
1
  import { spawnSync } from "node:child_process";
2
2
  export const SPAWN_USER = "PLURNK_EXECS_SPAWN_USER";
3
+ // getent(1): 2 is "the key is not in the database", distinct from a lookup that failed.
4
+ const GETENT_ABSENT = 2;
5
+ const getent = (name) => spawnSync("getent", ["passwd", name], { encoding: "utf8" });
3
6
  // {§executor-spawn-account} — the account every subprocess runtime spawns as. Unset, the
4
7
  // daemon's own; a name is resolved once through the host's account database, `uid[:gid]`
5
8
  // is taken as written. An unresolvable value is an invalid configuration at the spawn.
@@ -12,7 +15,7 @@ export default class SpawnAccounts {
12
15
  const known = SpawnAccounts.#resolved.get(value);
13
16
  if (known !== undefined)
14
17
  return known;
15
- const account = SpawnAccounts.#resolve(value);
18
+ const account = SpawnAccounts.resolve(value);
16
19
  SpawnAccounts.#resolved.set(value, account);
17
20
  return account;
18
21
  }
@@ -29,16 +32,26 @@ export default class SpawnAccounts {
29
32
  return base;
30
33
  return { ...base, ...(account.home === null ? {} : { HOME: account.home }), USER: account.name, LOGNAME: account.name };
31
34
  }
32
- static #resolve(value) {
35
+ // One value resolved, uncached. A lookup that did not run or did not answer says nothing about
36
+ // the account, so it is never reported as an absent one.
37
+ static resolve(value, lookup = getent) {
33
38
  const numeric = /^(\d+)(?::(\d+))?$/u.exec(value);
34
39
  if (numeric !== null) {
35
40
  return { name: null, uid: Number(numeric[1]), gid: Number(numeric[2] ?? numeric[1]), home: null };
36
41
  }
37
- const lookup = spawnSync("getent", ["passwd", value], { encoding: "utf8" });
38
- const fields = lookup.status === 0 ? lookup.stdout.trim().split(":") : [];
39
- if (fields.length < 7 || fields[0] !== value) {
42
+ const answer = lookup(value);
43
+ const unresolved = (what, cause) => new Error(`${SPAWN_USER}='${value}' was not resolved: the host's account lookup, \`getent passwd\`, ${what}; write uid[:gid] to name the account without a lookup.`, cause === undefined ? undefined : { cause });
44
+ if (answer.error !== undefined)
45
+ throw unresolved(`did not run (${answer.error.message})`, answer.error);
46
+ if (answer.status === GETENT_ABSENT) {
40
47
  throw new Error(`${SPAWN_USER}='${value}' names no account on this host; write an account name or uid[:gid].`);
41
48
  }
49
+ if (answer.status !== 0)
50
+ throw unresolved(answer.status === null ? `was ended by ${answer.signal ?? "a signal"}` : `exited ${answer.status}`);
51
+ const fields = answer.stdout.trim().split(":");
52
+ if (fields.length < 7 || fields[0] !== value || !/^\d+$/u.test(fields[2]) || !/^\d+$/u.test(fields[3])) {
53
+ throw unresolved("answered a record that is not this account's");
54
+ }
42
55
  return { name: fields[0], uid: Number(fields[2]), gid: Number(fields[3]), home: fields[5] === "" ? null : fields[5] };
43
56
  }
44
57
  }
@@ -1 +1 @@
1
- {"version":3,"file":"SpawnAccount.js","sourceRoot":"","sources":["../src/SpawnAccount.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE/C,MAAM,CAAC,MAAM,UAAU,GAAG,yBAAyB,CAAC;AASpD,yFAAyF;AACzF,yFAAyF;AACzF,uFAAuF;AACvF,MAAM,CAAC,OAAO,OAAO,aAAa;IAC9B,MAAM,CAAC,SAAS,GAAG,IAAI,GAAG,EAAwB,CAAC;IAEnD,MAAM,CAAC,UAAU,CAAC,GAAG,GAAsB,OAAO,CAAC,GAAG;QAClD,MAAM,KAAK,GAAG,GAAG,CAAC,UAAU,CAAC,EAAE,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AC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAE,EAAE,CAAC;IAC3H,CAAC;CACJ"}
package/dist/index.d.ts CHANGED
@@ -5,6 +5,8 @@ export { default as SubprocessInput } from "./SubprocessInput.ts";
5
5
  export { default as InvocationMetadata } from "./InvocationMetadata.ts";
6
6
  export { default as ErrorDetail, ERROR_DETAIL_LIMIT } from "./ErrorDetail.ts";
7
7
  export { default as SpawnAccounts, SPAWN_USER } from "./SpawnAccount.ts";
8
+ export { default as Shell } from "./Shell.ts";
9
+ export type { ShellChoice } from "./Shell.ts";
8
10
  export type { SpawnAccount } from "./SpawnAccount.ts";
9
11
  export { CommandSyntaxError, tokenizeArgv } from "./tokenizeArgv.ts";
10
12
  export { default as RuntimeTag } from "./RuntimeTag.ts";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,eAAe,CAAC;AAGrC,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AACxE,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAClE,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AACxE,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAC9E,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACzE,YAAY,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACrE,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,EAAE,OAAO,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YAAY,EACZ,WAAW,EACX,gBAAgB,EAChB,QAAQ,EACR,SAAS,EACT,gBAAgB,EAChB,iBAAiB,EACjB,eAAe,EACf,UAAU,EACV,MAAM,EACN,mBAAmB,EACnB,eAAe,EACf,iBAAiB,EACjB,iBAAiB,EACjB,wBAAwB,EACxB,iBAAiB,IAAI,qBAAqB,EAC1C,qBAAqB,EACrB,mBAAmB,EACnB,kBAAkB,EAClB,WAAW,EACX,gBAAgB,EAChB,QAAQ,EACR,YAAY,EACZ,SAAS,EACT,eAAe,EACf,SAAS,GACZ,MAAM,YAAY,CAAC;AAEpB,YAAY,EAAE,QAAQ,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAGvE,YAAY,EAAE,MAAM,EAAE,WAAW,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACrF,YAAY,EACR,2BAA2B,EAC3B,+BAA+B,EAC/B,0BAA0B,GAC7B,MAAM,qBAAqB,CAAC"}
package/dist/index.js CHANGED
@@ -6,6 +6,7 @@ export { default as SubprocessInput } from "./SubprocessInput.js";
6
6
  export { default as InvocationMetadata } from "./InvocationMetadata.js";
7
7
  export { default as ErrorDetail, ERROR_DETAIL_LIMIT } from "./ErrorDetail.js";
8
8
  export { default as SpawnAccounts, SPAWN_USER } from "./SpawnAccount.js";
9
+ export { default as Shell } from "./Shell.js";
9
10
  export { CommandSyntaxError, tokenizeArgv } from "./tokenizeArgv.js";
10
11
  export { default as RuntimeTag } from "./RuntimeTag.js";
11
12
  export { default as RuntimeInvocation } from "./RuntimeInvocation.js";
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,eAAe,CAAC;AAErC,oBAAoB;AACpB,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM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AEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAE5C,MAAM,CAAC,OAAO,OAAO,OAAO;IACxB,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,GAAE,MAAM,GAAG,IAAW,GAAG,SAAS,CAaxF;CACJ"}
1
+ {"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../src/runtime.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAG5C,MAAM,CAAC,OAAO,OAAO,OAAO;IACxB,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,GAAE,MAAM,GAAG,IAAW,GAAG,SAAS,CAexF;CACJ"}
package/dist/runtime.js CHANGED
@@ -1,15 +1,18 @@
1
1
  // Spawn-argument recipes used internally by SubprocessExecutor.
2
+ import Shell from "./Shell.js";
2
3
  export default class Runtime {
3
4
  static resolve(runtime, command, target = null) {
5
+ // {§executor-shell} `sh` runs the environment's shell.
4
6
  const shell = runtime === "" || runtime === "sh";
7
+ const cmd = shell ? Shell.current().path : runtime;
5
8
  // With a target the program IS the target and the body is its stdin
6
9
  // ({§executor-subprocess-routing}). Every interpreter reads one script
7
10
  // file; neither shell command parsing nor an executable bit is required.
8
11
  if (target !== null) {
9
- return { cmd: runtime || "sh", args: [target], useShell: false, stdin: command };
12
+ return { cmd, args: [target], useShell: false, stdin: command };
10
13
  }
11
14
  if (shell)
12
- return { cmd: runtime || "sh", args: ["-c", command], useShell: false };
15
+ return { cmd, args: ["-c", command], useShell: false };
13
16
  if (runtime === "node")
14
17
  return { cmd: "node", args: ["-e", command], useShell: false };
15
18
  if (runtime === "python3")
@@ -1 +1 @@
1
- {"version":3,"file":"runtime.js","sourceRoot":"","sources":["../src/runtime.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAIhE,MAAM,CAAC,OAA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AkB,IAAI;QACzE,uDAAuD;QACvD,MAAM,KAAK,GAAG,OAAO,KAAK,EAAE,IAAI,OAAO,KAAK,IAAI,CAAC;QACjD,MAAM,GAAG,GAAG,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC;QACnD,oEAAoE;QACpE,uEAAuE;QACvE,yEAAyE;QACzE,IAAI,MAAM,KAAK,IAAI,EAAE,CAAC;YAClB,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC;QACpE,CAAC;QACD,IAAI,KAAK;YAAE,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC,IAAI,EAAE,OAAO,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;QAClE,IAAI,OAAO,KAAK,MAAM;YAAE,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,IAAI,EAAE,OAAO,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;QACvF,IAAI,OAAO,KAAK,SAAS;YAAE,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,IAAI,EAAE,OAAO,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;QAC7F,kEAAkE;QAClE,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,IAAI,EAAE,OAAO,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;IACpE,CAAC;CACJ"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plurnk/plurnk-execs",
3
- "version": "3.2.0",
3
+ "version": "4.0.1",
4
4
  "description": "Framework + contract for the @plurnk/plurnk-execs-* runtime executor packages.",
5
5
  "keywords": [
6
6
  "plurnk",
@@ -50,10 +50,10 @@
50
50
  "prepublishOnly": "npm audit --audit-level=moderate && npm test"
51
51
  },
52
52
  "dependencies": {
53
- "@plurnk/plurnk-contracts": "^3.3.0",
54
- "@plurnk/plurnk-parser": "^3.0.1",
53
+ "@plurnk/plurnk-contracts": "^5.0.0",
54
+ "@plurnk/plurnk-parser": "^4.2.0",
55
55
  "@plurnk/plurnk-meta": "^2.1.0",
56
56
  "@plurnk/plurnk-schemes": "^3.2.0"
57
57
  },
58
- "gitHead": "1dcf640b6bad0f5972443dd59354a5fc094acf46"
58
+ "gitHead": "c75c4bc760db609905a8a0932bd1f50bb4d8886c"
59
59
  }