@tobos/cli 0.4.18 → 0.4.19

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.
@@ -0,0 +1,55 @@
1
+ #!/usr/bin/env node
2
+ import { createRequire as __tobosRequire } from 'node:module';
3
+ const require = __tobosRequire(import.meta.url);
4
+ import {
5
+ init_define_TOBOS_PRESENT_TYPES,
6
+ init_define_TOBOS_SKILL,
7
+ init_define_TOBOS_TOOLCHAIN
8
+ } from "./chunk-O52ON2LV.js";
9
+
10
+ // src/out.ts
11
+ init_define_TOBOS_PRESENT_TYPES();
12
+ init_define_TOBOS_SKILL();
13
+ init_define_TOBOS_TOOLCHAIN();
14
+ var EXIT = { ok: 0, error: 1, problems: 2, auth: 3, conflict: 4, limit: 5 };
15
+ var ASK_THE_PERSON = "This is for the person you work for to decide: show them the above, and wait for their answer. Don\u2019t work around it, for instance by building the deck outside Tobos.";
16
+ var CliError = class extends Error {
17
+ exit;
18
+ extra;
19
+ constructor(message, exit = EXIT.error, extra = {}) {
20
+ super(message);
21
+ this.exit = exit;
22
+ this.extra = extra;
23
+ }
24
+ };
25
+ var update;
26
+ function offerUpdate(line) {
27
+ update = line;
28
+ }
29
+ function createOutput(json) {
30
+ return {
31
+ json,
32
+ note(message, always = false) {
33
+ if (!json || always) process.stderr.write(`${message}
34
+ `);
35
+ },
36
+ result(value, human) {
37
+ if (json) process.stdout.write(`${JSON.stringify(update ? { ...value, update } : value)}
38
+ `);
39
+ else {
40
+ const text = human();
41
+ if (text) process.stdout.write(text.endsWith("\n") ? text : `${text}
42
+ `);
43
+ }
44
+ }
45
+ };
46
+ }
47
+
48
+ export {
49
+ EXIT,
50
+ ASK_THE_PERSON,
51
+ CliError,
52
+ update,
53
+ offerUpdate,
54
+ createOutput
55
+ };