@nice-code/commander 0.70.0

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,23 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
+ <title>nice-commander</title>
7
+ <style>
8
+ html, body, #root { height: 100%; }
9
+ body {
10
+ margin: 0;
11
+ background: #0e1116;
12
+ color: #cbd2dc;
13
+ font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
14
+ }
15
+ button, input, select { font: inherit; }
16
+ * { box-sizing: border-box; }
17
+ </style>
18
+ <script type="module" crossorigin src="/assets/index-CGcBzzm0.js"></script>
19
+ </head>
20
+ <body>
21
+ <div id="root"></div>
22
+ </body>
23
+ </html>
@@ -0,0 +1,12 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_types = require("./types-CIdWQGjF.cjs");
3
+ //#region src/config.ts
4
+ /** Identity helper so `commander.config.ts` files are typed end to end. */
5
+ function defineCommanderConfig(config) {
6
+ return config;
7
+ }
8
+ //#endregion
9
+ exports.COMMANDER_ID_PATTERN = require_types.COMMANDER_ID_PATTERN;
10
+ exports.defineCommanderConfig = defineCommanderConfig;
11
+
12
+ //# sourceMappingURL=config.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.cjs","names":[],"sources":["../src/config.ts"],"sourcesContent":["// The `./config` subpath — what a `commander.config.ts` imports. Lightweight by contract:\n// types + the identity helper only (the loader, validation and their deps stay daemon-side).\n\nimport type { ICommanderConfig } from \"./config/types\";\n\nexport {\n COMMANDER_ID_PATTERN,\n type ICommanderConfig,\n type ICommanderDefaults,\n type ICommanderEndpoint,\n type ICommanderEndpointHealth,\n type ICommanderGroupDefinition,\n type ICommanderProcessDefinition,\n type TCommanderEndpointOwnership,\n type TCommanderEndpointProtocol,\n type TCommanderReady,\n type TCommanderTagQuery,\n type TCommanderTagQueryOr,\n} from \"./config/types\";\n\n/** Identity helper so `commander.config.ts` files are typed end to end. */\nexport function defineCommanderConfig<T extends ICommanderConfig>(config: T): T {\n return config;\n}\n"],"mappings":";;;;AAqBA,SAAgB,sBAAkD,QAAc;CAC9E,OAAO;AACT"}
@@ -0,0 +1,120 @@
1
+ import { INiceProcessRestartOptions, INiceProcessStopOptions, TNiceProcessKind, TNiceProcessReady, TNiceProcessRun, TNiceProcessShell } from "@nice-code/process";
2
+
3
+ //#region src/config/types.d.ts
4
+ /** Ids appear in CLI selectors, URLs and ledger filenames — never option-shaped (edge 31). */
5
+ declare const COMMANDER_ID_PATTERN: RegExp;
6
+ type TCommanderEndpointProtocol = "tcp" | "http";
7
+ type TCommanderEndpointOwnership = "exclusive" | "shared" | "observed";
8
+ interface ICommanderEndpointHealth {
9
+ /** HTTP path probed for readiness sugar / health badges. Default "/". */
10
+ path?: string;
11
+ /** Bounded body read must contain this marker. */
12
+ match?: string;
13
+ }
14
+ interface ICommanderEndpoint {
15
+ /** Unique per process; referenced by `ready: { kind: "endpoint" }` and UI badges. */
16
+ name: string;
17
+ protocol: TCommanderEndpointProtocol;
18
+ host?: string;
19
+ port: number;
20
+ /**
21
+ * `exclusive` must resolve to this owned tree; `shared` must match a compatible explicit
22
+ * sharing declaration; `observed` may be external and is never killed or claimed.
23
+ */
24
+ ownership: TCommanderEndpointOwnership;
25
+ url?: string;
26
+ health?: ICommanderEndpointHealth;
27
+ }
28
+ /**
29
+ * Readiness sugar: `ready: { kind: "endpoint", endpoint: "web" }` expands against the named
30
+ * endpoint — tcp → `port` readiness, http → `httpOk` against `health.path` (+ `health.match`).
31
+ */
32
+ type TCommanderReady = TNiceProcessReady | {
33
+ kind: "endpoint";
34
+ endpoint: string;
35
+ timeoutMs?: number;
36
+ healthProbeMs?: number;
37
+ };
38
+ interface ICommanderProcessDefinition {
39
+ id: string;
40
+ /** Default from `defaults.kind`, else "service". */
41
+ kind?: TNiceProcessKind;
42
+ /** Relative cwd resolves against the config file's realpath directory, never the shell's. */
43
+ cwd?: string;
44
+ run: TNiceProcessRun;
45
+ shell?: TNiceProcessShell;
46
+ /** Merged over the daemon's base env; `null` unsets. */
47
+ env?: Record<string, string | null>;
48
+ /** Default "pipe" (held open until stop); "ignore" is an instant EOF. */
49
+ stdin?: "pipe" | "ignore";
50
+ /** Free-form; `role` and `project` are the house convention. */
51
+ tags?: Record<string, string>;
52
+ /**
53
+ * Transitive: starting this starts each dependency first and waits for it — service
54
+ * dependencies until ready, task dependencies until succeeded. Acyclic, validated at load.
55
+ */
56
+ dependsOn?: string[];
57
+ endpoints?: ICommanderEndpoint[];
58
+ /** Primary "open" link when no endpoint owns it. */
59
+ url?: string;
60
+ ready?: TCommanderReady;
61
+ stop?: INiceProcessStopOptions;
62
+ /** Automatic restart is service-only in v1; a task is explicitly rerun. */
63
+ restart?: INiceProcessRestartOptions;
64
+ /** Ring tuning only — the on-disk sink is daemon-anchored (D6), not config-addressable. */
65
+ log?: {
66
+ ringLines?: number;
67
+ ringBytes?: number;
68
+ lineBytes?: number;
69
+ };
70
+ /** Tasks only: hard cap on run time so a hung check can't hang a task group forever. */
71
+ timeoutMs?: number;
72
+ }
73
+ /** Tag query: every entry must match (AND). An array of queries is OR'd. */
74
+ type TCommanderTagQuery = Record<string, string>;
75
+ type TCommanderTagQueryOr = TCommanderTagQuery | readonly TCommanderTagQuery[];
76
+ interface ICommanderGroupDefinition {
77
+ /** Tag-equality selection: OR of AND-maps. */
78
+ where?: TCommanderTagQueryOr;
79
+ /** Process ids and/or other group names. Group references must be acyclic. */
80
+ include?: readonly string[];
81
+ /** Excluded ids and/or tag queries, applied last. */
82
+ exclude?: readonly (string | TCommanderTagQuery)[] | TCommanderTagQuery;
83
+ /** Delay between spawns within this group (no thundering herd of 17 tsc watchers). */
84
+ staggerMs?: number;
85
+ }
86
+ interface ICommanderDefaults {
87
+ kind?: TNiceProcessKind;
88
+ stop?: INiceProcessStopOptions;
89
+ restart?: INiceProcessRestartOptions;
90
+ log?: {
91
+ ringLines?: number;
92
+ ringBytes?: number;
93
+ lineBytes?: number;
94
+ };
95
+ tags?: Record<string, string>;
96
+ }
97
+ interface ICommanderConfig {
98
+ /** Config name — also the data-dir slug seed (D6). Same charset as ids. */
99
+ name: string;
100
+ defaults?: ICommanderDefaults;
101
+ processes: ICommanderProcessDefinition[];
102
+ groups?: Record<string, ICommanderGroupDefinition>;
103
+ /**
104
+ * Selection used by a bare `up` (group name or id). Without it, bare `up` prints the
105
+ * available groups and exits without mutating anything.
106
+ */
107
+ defaultSelection?: string;
108
+ /** Local config helpers the D2 loader cannot discover automatically (repo-relative). */
109
+ watchFiles?: readonly string[];
110
+ daemon?: {
111
+ /** Base port for the bounded scan-up on collision. Default 4900. */port?: number;
112
+ };
113
+ }
114
+ //#endregion
115
+ //#region src/config.d.ts
116
+ /** Identity helper so `commander.config.ts` files are typed end to end. */
117
+ declare function defineCommanderConfig<T extends ICommanderConfig>(config: T): T;
118
+ //#endregion
119
+ export { COMMANDER_ID_PATTERN, type ICommanderConfig, type ICommanderDefaults, type ICommanderEndpoint, type ICommanderEndpointHealth, type ICommanderGroupDefinition, type ICommanderProcessDefinition, type TCommanderEndpointOwnership, type TCommanderEndpointProtocol, type TCommanderReady, type TCommanderTagQuery, type TCommanderTagQueryOr, defineCommanderConfig };
120
+ //# sourceMappingURL=config.d.cts.map
@@ -0,0 +1,120 @@
1
+ import { INiceProcessRestartOptions, INiceProcessStopOptions, TNiceProcessKind, TNiceProcessReady, TNiceProcessRun, TNiceProcessShell } from "@nice-code/process";
2
+
3
+ //#region src/config/types.d.ts
4
+ /** Ids appear in CLI selectors, URLs and ledger filenames — never option-shaped (edge 31). */
5
+ declare const COMMANDER_ID_PATTERN: RegExp;
6
+ type TCommanderEndpointProtocol = "tcp" | "http";
7
+ type TCommanderEndpointOwnership = "exclusive" | "shared" | "observed";
8
+ interface ICommanderEndpointHealth {
9
+ /** HTTP path probed for readiness sugar / health badges. Default "/". */
10
+ path?: string;
11
+ /** Bounded body read must contain this marker. */
12
+ match?: string;
13
+ }
14
+ interface ICommanderEndpoint {
15
+ /** Unique per process; referenced by `ready: { kind: "endpoint" }` and UI badges. */
16
+ name: string;
17
+ protocol: TCommanderEndpointProtocol;
18
+ host?: string;
19
+ port: number;
20
+ /**
21
+ * `exclusive` must resolve to this owned tree; `shared` must match a compatible explicit
22
+ * sharing declaration; `observed` may be external and is never killed or claimed.
23
+ */
24
+ ownership: TCommanderEndpointOwnership;
25
+ url?: string;
26
+ health?: ICommanderEndpointHealth;
27
+ }
28
+ /**
29
+ * Readiness sugar: `ready: { kind: "endpoint", endpoint: "web" }` expands against the named
30
+ * endpoint — tcp → `port` readiness, http → `httpOk` against `health.path` (+ `health.match`).
31
+ */
32
+ type TCommanderReady = TNiceProcessReady | {
33
+ kind: "endpoint";
34
+ endpoint: string;
35
+ timeoutMs?: number;
36
+ healthProbeMs?: number;
37
+ };
38
+ interface ICommanderProcessDefinition {
39
+ id: string;
40
+ /** Default from `defaults.kind`, else "service". */
41
+ kind?: TNiceProcessKind;
42
+ /** Relative cwd resolves against the config file's realpath directory, never the shell's. */
43
+ cwd?: string;
44
+ run: TNiceProcessRun;
45
+ shell?: TNiceProcessShell;
46
+ /** Merged over the daemon's base env; `null` unsets. */
47
+ env?: Record<string, string | null>;
48
+ /** Default "pipe" (held open until stop); "ignore" is an instant EOF. */
49
+ stdin?: "pipe" | "ignore";
50
+ /** Free-form; `role` and `project` are the house convention. */
51
+ tags?: Record<string, string>;
52
+ /**
53
+ * Transitive: starting this starts each dependency first and waits for it — service
54
+ * dependencies until ready, task dependencies until succeeded. Acyclic, validated at load.
55
+ */
56
+ dependsOn?: string[];
57
+ endpoints?: ICommanderEndpoint[];
58
+ /** Primary "open" link when no endpoint owns it. */
59
+ url?: string;
60
+ ready?: TCommanderReady;
61
+ stop?: INiceProcessStopOptions;
62
+ /** Automatic restart is service-only in v1; a task is explicitly rerun. */
63
+ restart?: INiceProcessRestartOptions;
64
+ /** Ring tuning only — the on-disk sink is daemon-anchored (D6), not config-addressable. */
65
+ log?: {
66
+ ringLines?: number;
67
+ ringBytes?: number;
68
+ lineBytes?: number;
69
+ };
70
+ /** Tasks only: hard cap on run time so a hung check can't hang a task group forever. */
71
+ timeoutMs?: number;
72
+ }
73
+ /** Tag query: every entry must match (AND). An array of queries is OR'd. */
74
+ type TCommanderTagQuery = Record<string, string>;
75
+ type TCommanderTagQueryOr = TCommanderTagQuery | readonly TCommanderTagQuery[];
76
+ interface ICommanderGroupDefinition {
77
+ /** Tag-equality selection: OR of AND-maps. */
78
+ where?: TCommanderTagQueryOr;
79
+ /** Process ids and/or other group names. Group references must be acyclic. */
80
+ include?: readonly string[];
81
+ /** Excluded ids and/or tag queries, applied last. */
82
+ exclude?: readonly (string | TCommanderTagQuery)[] | TCommanderTagQuery;
83
+ /** Delay between spawns within this group (no thundering herd of 17 tsc watchers). */
84
+ staggerMs?: number;
85
+ }
86
+ interface ICommanderDefaults {
87
+ kind?: TNiceProcessKind;
88
+ stop?: INiceProcessStopOptions;
89
+ restart?: INiceProcessRestartOptions;
90
+ log?: {
91
+ ringLines?: number;
92
+ ringBytes?: number;
93
+ lineBytes?: number;
94
+ };
95
+ tags?: Record<string, string>;
96
+ }
97
+ interface ICommanderConfig {
98
+ /** Config name — also the data-dir slug seed (D6). Same charset as ids. */
99
+ name: string;
100
+ defaults?: ICommanderDefaults;
101
+ processes: ICommanderProcessDefinition[];
102
+ groups?: Record<string, ICommanderGroupDefinition>;
103
+ /**
104
+ * Selection used by a bare `up` (group name or id). Without it, bare `up` prints the
105
+ * available groups and exits without mutating anything.
106
+ */
107
+ defaultSelection?: string;
108
+ /** Local config helpers the D2 loader cannot discover automatically (repo-relative). */
109
+ watchFiles?: readonly string[];
110
+ daemon?: {
111
+ /** Base port for the bounded scan-up on collision. Default 4900. */port?: number;
112
+ };
113
+ }
114
+ //#endregion
115
+ //#region src/config.d.ts
116
+ /** Identity helper so `commander.config.ts` files are typed end to end. */
117
+ declare function defineCommanderConfig<T extends ICommanderConfig>(config: T): T;
118
+ //#endregion
119
+ export { COMMANDER_ID_PATTERN, type ICommanderConfig, type ICommanderDefaults, type ICommanderEndpoint, type ICommanderEndpointHealth, type ICommanderGroupDefinition, type ICommanderProcessDefinition, type TCommanderEndpointOwnership, type TCommanderEndpointProtocol, type TCommanderReady, type TCommanderTagQuery, type TCommanderTagQueryOr, defineCommanderConfig };
120
+ //# sourceMappingURL=config.d.mts.map
@@ -0,0 +1,10 @@
1
+ import { t as COMMANDER_ID_PATTERN } from "./types-B3WIUo4S.mjs";
2
+ //#region src/config.ts
3
+ /** Identity helper so `commander.config.ts` files are typed end to end. */
4
+ function defineCommanderConfig(config) {
5
+ return config;
6
+ }
7
+ //#endregion
8
+ export { COMMANDER_ID_PATTERN, defineCommanderConfig };
9
+
10
+ //# sourceMappingURL=config.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.mjs","names":[],"sources":["../src/config.ts"],"sourcesContent":["// The `./config` subpath — what a `commander.config.ts` imports. Lightweight by contract:\n// types + the identity helper only (the loader, validation and their deps stay daemon-side).\n\nimport type { ICommanderConfig } from \"./config/types\";\n\nexport {\n COMMANDER_ID_PATTERN,\n type ICommanderConfig,\n type ICommanderDefaults,\n type ICommanderEndpoint,\n type ICommanderEndpointHealth,\n type ICommanderGroupDefinition,\n type ICommanderProcessDefinition,\n type TCommanderEndpointOwnership,\n type TCommanderEndpointProtocol,\n type TCommanderReady,\n type TCommanderTagQuery,\n type TCommanderTagQueryOr,\n} from \"./config/types\";\n\n/** Identity helper so `commander.config.ts` files are typed end to end. */\nexport function defineCommanderConfig<T extends ICommanderConfig>(config: T): T {\n return config;\n}\n"],"mappings":";;;AAqBA,SAAgB,sBAAkD,QAAc;CAC9E,OAAO;AACT"}