@xemahq/xema 0.1.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/LICENSE +201 -0
- package/README.md +60 -0
- package/dist/cli.d.ts +4 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +43 -0
- package/dist/cli.js.map +1 -0
- package/dist/commands/biome.d.ts +3 -0
- package/dist/commands/biome.d.ts.map +1 -0
- package/dist/commands/biome.js +89 -0
- package/dist/commands/biome.js.map +1 -0
- package/dist/commands/dev.d.ts +3 -0
- package/dist/commands/dev.d.ts.map +1 -0
- package/dist/commands/dev.js +32 -0
- package/dist/commands/dev.js.map +1 -0
- package/dist/commands/doctor.d.ts +16 -0
- package/dist/commands/doctor.d.ts.map +1 -0
- package/dist/commands/doctor.js +128 -0
- package/dist/commands/doctor.js.map +1 -0
- package/dist/commands/objects.d.ts +3 -0
- package/dist/commands/objects.d.ts.map +1 -0
- package/dist/commands/objects.js +17 -0
- package/dist/commands/objects.js.map +1 -0
- package/dist/commands/run.d.ts +3 -0
- package/dist/commands/run.d.ts.map +1 -0
- package/dist/commands/run.js +18 -0
- package/dist/commands/run.js.map +1 -0
- package/dist/commands/serve.d.ts +3 -0
- package/dist/commands/serve.d.ts.map +1 -0
- package/dist/commands/serve.js +18 -0
- package/dist/commands/serve.js.map +1 -0
- package/dist/commands/shell.d.ts +3 -0
- package/dist/commands/shell.d.ts.map +1 -0
- package/dist/commands/shell.js +16 -0
- package/dist/commands/shell.js.map +1 -0
- package/dist/dev/dev-orchestrator.d.ts +7 -0
- package/dist/dev/dev-orchestrator.d.ts.map +1 -0
- package/dist/dev/dev-orchestrator.js +366 -0
- package/dist/dev/dev-orchestrator.js.map +1 -0
- package/dist/dev/env-defaults.d.ts +6 -0
- package/dist/dev/env-defaults.d.ts.map +1 -0
- package/dist/dev/env-defaults.js +115 -0
- package/dist/dev/env-defaults.js.map +1 -0
- package/dist/dev/forked-worker.d.ts +14 -0
- package/dist/dev/forked-worker.d.ts.map +1 -0
- package/dist/dev/forked-worker.js +126 -0
- package/dist/dev/forked-worker.js.map +1 -0
- package/dist/dev/infra-preflight.d.ts +31 -0
- package/dist/dev/infra-preflight.d.ts.map +1 -0
- package/dist/dev/infra-preflight.js +138 -0
- package/dist/dev/infra-preflight.js.map +1 -0
- package/dist/lib/command-registry.d.ts +5 -0
- package/dist/lib/command-registry.d.ts.map +1 -0
- package/dist/lib/command-registry.js +13 -0
- package/dist/lib/command-registry.js.map +1 -0
- package/dist/lib/exit-codes.d.ts +10 -0
- package/dist/lib/exit-codes.d.ts.map +1 -0
- package/dist/lib/exit-codes.js +25 -0
- package/dist/lib/exit-codes.js.map +1 -0
- package/package.json +70 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for describing the origin of the Work and
|
|
141
|
+
reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Support. While redistributing the Work or
|
|
166
|
+
Derivative Works thereof, You may choose to offer, and charge a
|
|
167
|
+
fee for, acceptance of support, warranty, indemnity, or other
|
|
168
|
+
liability obligations and/or rights consistent with this License.
|
|
169
|
+
However, in accepting such obligations, You may act only on Your
|
|
170
|
+
own behalf and on Your sole responsibility, not on behalf of any
|
|
171
|
+
other Contributor, and only if You agree to indemnify, defend, and
|
|
172
|
+
hold each Contributor harmless for any liability incurred by, or
|
|
173
|
+
claims asserted against, such Contributor by reason of your
|
|
174
|
+
accepting any such warranty or support.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright 2026 Xema
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<svg width="680" height="120" viewBox="0 0 680 120" fill="none" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="@xemahq/xema">
|
|
3
|
+
<rect width="680" height="120" rx="14" fill="#0B1020"/>
|
|
4
|
+
<g transform="translate(28,34)">
|
|
5
|
+
<path d="M26 0 L52 15 L52 45 L26 60 L0 45 L0 15 Z" fill="#8B5CF6" opacity="0.18"/>
|
|
6
|
+
<path d="M26 12 L41 21 L41 39 L26 48 L11 39 L11 21 Z" fill="#8B5CF6"/>
|
|
7
|
+
</g>
|
|
8
|
+
<text x="92" y="52" font-family="ui-monospace,SFMono-Regular,Menlo,monospace" font-size="22" fill="#F8FAFC" font-weight="700">@xemahq/xema</text>
|
|
9
|
+
<text x="92" y="80" font-family="ui-sans-serif,system-ui,sans-serif" font-size="15" fill="#94A3B8">The Xema OS command-line interface</text>
|
|
10
|
+
<text x="652" y="105" text-anchor="end" font-family="ui-sans-serif,system-ui,sans-serif" font-size="12" fill="#475569">xema.dev</text>
|
|
11
|
+
</svg>
|
|
12
|
+
</p>
|
|
13
|
+
|
|
14
|
+
<p align="center">
|
|
15
|
+
<a href="https://xema.dev">Website</a> ·
|
|
16
|
+
<a href="https://www.npmjs.com/package/@xemahq/xema">npm</a>
|
|
17
|
+
</p>
|
|
18
|
+
|
|
19
|
+
<p align="center">
|
|
20
|
+
<img alt="npm" src="https://img.shields.io/npm/v/%40xemahq%2Fxema?color=2563eb&label=npm">
|
|
21
|
+
<img alt="license" src="https://img.shields.io/npm/l/%40xemahq%2Fxema?color=10b981">
|
|
22
|
+
<img alt="types" src="https://img.shields.io/npm/types/%40xemahq%2Fxema?color=3178c6">
|
|
23
|
+
</p>
|
|
24
|
+
|
|
25
|
+
# @xemahq/xema
|
|
26
|
+
|
|
27
|
+
> The Xema OS command-line interface
|
|
28
|
+
|
|
29
|
+
## Overview
|
|
30
|
+
|
|
31
|
+
The single global binary for Xema. Install it once to boot the local stack,
|
|
32
|
+
author and ship biomes, and invoke capabilities from your terminal. It scaffolds,
|
|
33
|
+
installs, publishes, and lints biomes; runs capabilities by name; and ships a
|
|
34
|
+
`doctor` check for diagnosing your environment. It works as a standalone tool —
|
|
35
|
+
no monorepo checkout required.
|
|
36
|
+
|
|
37
|
+
## When to use it
|
|
38
|
+
|
|
39
|
+
- Use it for day-0 onboarding and everyday authoring: boot the stack, scaffold a
|
|
40
|
+
biome, and run a capability without wiring up tooling by hand.
|
|
41
|
+
|
|
42
|
+
## Installation
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
npm i -g @xemahq/xema
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Usage
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
xema dev # boot the local stack
|
|
52
|
+
xema biome scaffold <name> # author a new biome
|
|
53
|
+
xema biome publish <path> # ship a biome
|
|
54
|
+
xema run <capability> # invoke a capability by name
|
|
55
|
+
xema doctor # diagnose your environment
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## License
|
|
59
|
+
|
|
60
|
+
Apache-2.0 © Xema — [xema.dev](https://xema.dev)
|
package/dist/cli.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAYpC,wBAAgB,YAAY,IAAI,OAAO,CAkBtC;AAED,wBAAsB,IAAI,CAAC,IAAI,GAAE,aAAa,CAAC,MAAM,CAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAMpF"}
|
package/dist/cli.js
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.buildProgram = buildProgram;
|
|
5
|
+
exports.main = main;
|
|
6
|
+
const commander_1 = require("commander");
|
|
7
|
+
const biome_1 = require("./commands/biome");
|
|
8
|
+
const dev_1 = require("./commands/dev");
|
|
9
|
+
const doctor_1 = require("./commands/doctor");
|
|
10
|
+
const objects_1 = require("./commands/objects");
|
|
11
|
+
const run_1 = require("./commands/run");
|
|
12
|
+
const serve_1 = require("./commands/serve");
|
|
13
|
+
const shell_1 = require("./commands/shell");
|
|
14
|
+
const CLI_VERSION = '0.1.0';
|
|
15
|
+
function buildProgram() {
|
|
16
|
+
const program = new commander_1.Command();
|
|
17
|
+
program
|
|
18
|
+
.name('xema')
|
|
19
|
+
.description('Xema OS global CLI — boot, scaffold, install, run.')
|
|
20
|
+
.version(CLI_VERSION, '-v, --version', 'print the CLI version')
|
|
21
|
+
.showHelpAfterError(true)
|
|
22
|
+
.configureHelp({ sortSubcommands: true });
|
|
23
|
+
(0, dev_1.registerCommand)(program);
|
|
24
|
+
(0, serve_1.registerCommand)(program);
|
|
25
|
+
(0, biome_1.registerCommand)(program);
|
|
26
|
+
(0, run_1.registerCommand)(program);
|
|
27
|
+
(0, shell_1.registerCommand)(program);
|
|
28
|
+
(0, objects_1.registerCommand)(program);
|
|
29
|
+
(0, doctor_1.registerCommand)(program);
|
|
30
|
+
return program;
|
|
31
|
+
}
|
|
32
|
+
async function main(argv = process.argv) {
|
|
33
|
+
const program = buildProgram();
|
|
34
|
+
await program.parseAsync([...argv]);
|
|
35
|
+
}
|
|
36
|
+
if (require.main === module) {
|
|
37
|
+
void main().catch((err) => {
|
|
38
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
39
|
+
console.error(`xema: ${message}`);
|
|
40
|
+
process.exit(1);
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";;AAsBA,oCAkBC;AAED,oBAMC;AAtCD,yCAAoC;AAEpC,4CAAoE;AACpE,wCAAgE;AAChE,8CAAsE;AACtE,gDAAwE;AACxE,wCAAgE;AAChE,4CAAoE;AACpE,4CAAoE;AAEpE,MAAM,WAAW,GAAG,OAAO,CAAC;AAE5B,SAAgB,YAAY;IAC1B,MAAM,OAAO,GAAG,IAAI,mBAAO,EAAE,CAAC;IAC9B,OAAO;SACJ,IAAI,CAAC,MAAM,CAAC;SACZ,WAAW,CAAC,oDAAoD,CAAC;SACjE,OAAO,CAAC,WAAW,EAAE,eAAe,EAAE,uBAAuB,CAAC;SAC9D,kBAAkB,CAAC,IAAI,CAAC;SACxB,aAAa,CAAC,EAAE,eAAe,EAAE,IAAI,EAAE,CAAC,CAAC;IAE5C,IAAA,qBAAW,EAAC,OAAO,CAAC,CAAC;IACrB,IAAA,uBAAa,EAAC,OAAO,CAAC,CAAC;IACvB,IAAA,uBAAa,EAAC,OAAO,CAAC,CAAC;IACvB,IAAA,qBAAW,EAAC,OAAO,CAAC,CAAC;IACrB,IAAA,uBAAa,EAAC,OAAO,CAAC,CAAC;IACvB,IAAA,yBAAe,EAAC,OAAO,CAAC,CAAC;IACzB,IAAA,wBAAc,EAAC,OAAO,CAAC,CAAC;IAExB,OAAO,OAAO,CAAC;AACjB,CAAC;AAEM,KAAK,UAAU,IAAI,CAAC,OAA8B,OAAO,CAAC,IAAI;IACnE,MAAM,OAAO,GAAG,YAAY,EAAE,CAAC;IAI/B,MAAM,OAAO,CAAC,UAAU,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC;AACtC,CAAC;AAID,IAAI,OAAO,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;IAC5B,KAAK,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,GAAY,EAAE,EAAE;QACjC,MAAM,OAAO,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QACjE,OAAO,CAAC,KAAK,CAAC,SAAS,OAAO,EAAE,CAAC,CAAC;QAClC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"biome.d.ts","sourceRoot":"","sources":["../../src/commands/biome.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAezC,wBAAgB,eAAe,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAuDtD"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.registerCommand = registerCommand;
|
|
4
|
+
const node_child_process_1 = require("node:child_process");
|
|
5
|
+
const node_fs_1 = require("node:fs");
|
|
6
|
+
const node_path_1 = require("node:path");
|
|
7
|
+
const exit_codes_1 = require("../lib/exit-codes");
|
|
8
|
+
function registerCommand(program) {
|
|
9
|
+
const biome = program
|
|
10
|
+
.command('biome')
|
|
11
|
+
.summary('Author / install / publish / lint biomes');
|
|
12
|
+
biome
|
|
13
|
+
.command('scaffold <name>')
|
|
14
|
+
.description('Scaffold a new biome (wraps create-xema-biome if present)')
|
|
15
|
+
.action((name) => {
|
|
16
|
+
(0, exit_codes_1.exitWith)(exit_codes_1.XemaCliExitCode.NotImplemented, `xema biome scaffold ${name}: not wired up yet.\n` +
|
|
17
|
+
'The scaffold wrapper depends on the `create-xema-biome` package ' +
|
|
18
|
+
'which is part of Phase K carve-out. Tracked in plan v4.3 §6 J.1.');
|
|
19
|
+
});
|
|
20
|
+
biome
|
|
21
|
+
.command('install <ref>')
|
|
22
|
+
.description('Install a biome (OCI / file / https / sideload)')
|
|
23
|
+
.action((ref) => {
|
|
24
|
+
(0, exit_codes_1.exitWith)(exit_codes_1.XemaCliExitCode.NotImplemented, `xema biome install ${ref}: requires a running biome-host-api / ` +
|
|
25
|
+
'biome-fetcher-api. Wiring lives in plan v4.3 §6 Phase J.2 ' +
|
|
26
|
+
'follow-up (full 11-service composition).');
|
|
27
|
+
});
|
|
28
|
+
biome
|
|
29
|
+
.command('publish <path>')
|
|
30
|
+
.description('Publish a biome as a signed OCI artifact (Cosign)')
|
|
31
|
+
.action((path) => {
|
|
32
|
+
(0, exit_codes_1.exitWith)(exit_codes_1.XemaCliExitCode.NotImplemented, `xema biome publish ${path}: OCI + Cosign packaging lands in ` +
|
|
33
|
+
'Phase WB.4. See plan v4.3 §6 J.1.');
|
|
34
|
+
});
|
|
35
|
+
biome
|
|
36
|
+
.command('lint')
|
|
37
|
+
.description('Run boundary + manifest checks across the workspace')
|
|
38
|
+
.option('--strict', 'Forward --strict to underlying boundary scripts', false)
|
|
39
|
+
.action((opts) => {
|
|
40
|
+
runBiomeLint({ strict: opts.strict === true });
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
function findToolingBoundariesDir() {
|
|
44
|
+
let cursor = process.cwd();
|
|
45
|
+
for (let i = 0; i < 12; i += 1) {
|
|
46
|
+
const candidate = (0, node_path_1.resolve)(cursor, 'tooling', 'boundaries');
|
|
47
|
+
if ((0, node_fs_1.existsSync)(candidate)) {
|
|
48
|
+
return candidate;
|
|
49
|
+
}
|
|
50
|
+
const parent = (0, node_path_1.resolve)(cursor, '..');
|
|
51
|
+
if (parent === cursor) {
|
|
52
|
+
return null;
|
|
53
|
+
}
|
|
54
|
+
cursor = parent;
|
|
55
|
+
}
|
|
56
|
+
return null;
|
|
57
|
+
}
|
|
58
|
+
const LINT_SCRIPTS = [
|
|
59
|
+
'check-no-deprecated-names.mjs',
|
|
60
|
+
'check-biome-layout.mjs',
|
|
61
|
+
'check-no-hardcoded-mcp-tool-names.mjs',
|
|
62
|
+
];
|
|
63
|
+
function runBiomeLint(options) {
|
|
64
|
+
const dir = findToolingBoundariesDir();
|
|
65
|
+
if (dir === null) {
|
|
66
|
+
(0, exit_codes_1.exitWith)(exit_codes_1.XemaCliExitCode.NotFound, 'xema biome lint: could not locate tooling/boundaries/ from the ' +
|
|
67
|
+
'current directory. Run this command from inside a Xema repo.');
|
|
68
|
+
}
|
|
69
|
+
let failed = false;
|
|
70
|
+
for (const script of LINT_SCRIPTS) {
|
|
71
|
+
const scriptPath = (0, node_path_1.resolve)(dir, script);
|
|
72
|
+
if (!(0, node_fs_1.existsSync)(scriptPath)) {
|
|
73
|
+
console.warn(`[xema biome lint] skipping missing script: ${script}`);
|
|
74
|
+
continue;
|
|
75
|
+
}
|
|
76
|
+
const args = options.strict ? [scriptPath, '--strict'] : [scriptPath];
|
|
77
|
+
const result = (0, node_child_process_1.spawnSync)(process.execPath, args, {
|
|
78
|
+
stdio: 'inherit',
|
|
79
|
+
});
|
|
80
|
+
if (result.status !== 0) {
|
|
81
|
+
failed = true;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
if (failed) {
|
|
85
|
+
(0, exit_codes_1.exitWith)(exit_codes_1.XemaCliExitCode.GenericError, 'xema biome lint: one or more boundary scripts reported findings.');
|
|
86
|
+
}
|
|
87
|
+
(0, exit_codes_1.exitWith)(exit_codes_1.XemaCliExitCode.Ok);
|
|
88
|
+
}
|
|
89
|
+
//# sourceMappingURL=biome.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"biome.js","sourceRoot":"","sources":["../../src/commands/biome.ts"],"names":[],"mappings":";;AAqBA,0CAuDC;AA5ED,2DAA+C;AAC/C,qCAAqC;AACrC,yCAAmD;AAEnD,kDAA8D;AAiB9D,SAAgB,eAAe,CAAC,OAAgB;IAC9C,MAAM,KAAK,GAAG,OAAO;SAClB,OAAO,CAAC,OAAO,CAAC;SAChB,OAAO,CAAC,0CAA0C,CAAC,CAAC;IAEvD,KAAK;SACF,OAAO,CAAC,iBAAiB,CAAC;SAC1B,WAAW,CAAC,2DAA2D,CAAC;SACxE,MAAM,CAAC,CAAC,IAAY,EAAE,EAAE;QAKvB,IAAA,qBAAQ,EACN,4BAAe,CAAC,cAAc,EAC9B,uBAAuB,IAAI,uBAAuB;YAChD,kEAAkE;YAClE,kEAAkE,CACrE,CAAC;IACJ,CAAC,CAAC,CAAC;IAEL,KAAK;SACF,OAAO,CAAC,eAAe,CAAC;SACxB,WAAW,CAAC,iDAAiD,CAAC;SAC9D,MAAM,CAAC,CAAC,GAAW,EAAE,EAAE;QACtB,IAAA,qBAAQ,EACN,4BAAe,CAAC,cAAc,EAC9B,sBAAsB,GAAG,wCAAwC;YAC/D,4DAA4D;YAC5D,0CAA0C,CAC7C,CAAC;IACJ,CAAC,CAAC,CAAC;IAEL,KAAK;SACF,OAAO,CAAC,gBAAgB,CAAC;SACzB,WAAW,CAAC,mDAAmD,CAAC;SAChE,MAAM,CAAC,CAAC,IAAY,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,CAAC,QAAQ,EACxB,iEAAiE;YAC/D,8DAA8D,CACjE,CAAC;IACJ,CAAC;IAED,IAAI,MAAM,GAAG,KAAK,CAAC;IACnB,KAAK,MAAM,MAAM,IAAI,YAAY,EAAE,CAAC;QAClC,MAAM,UAAU,GAAG,IAAA,mBAAW,EAAC,GAAG,EAAE,MAAM,CAAC,CAAC;QAC5C,IAAI,CAAC,IAAA,oBAAU,EAAC,UAAU,CAAC,EAAE,CAAC;YAC5B,OAAO,CAAC,IAAI,CAAC,8CAA8C,MAAM,EAAE,CAAC,CAAC;YACrE,SAAS;QACX,CAAC;QACD,MAAM,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC;QACtE,MAAM,MAAM,GAAG,IAAA,8BAAS,EAAC,OAAO,CAAC,QAAQ,EAAE,IAAI,EAAE;YAC/C,KAAK,EAAE,SAAS;SACjB,CAAC,CAAC;QACH,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACxB,MAAM,GAAG,IAAI,CAAC;QAChB,CAAC;IACH,CAAC;IAED,IAAI,MAAM,EAAE,CAAC;QACX,IAAA,qBAAQ,EACN,4BAAe,CAAC,YAAY,EAC5B,kEAAkE,CACnE,CAAC;IACJ,CAAC;IACD,IAAA,qBAAQ,EAAC,4BAAe,CAAC,EAAE,CAAC,CAAC;AAC/B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dev.d.ts","sourceRoot":"","sources":["../../src/commands/dev.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAmBzC,wBAAgB,eAAe,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA+CtD"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.registerCommand = registerCommand;
|
|
4
|
+
const dev_orchestrator_1 = require("../dev/dev-orchestrator");
|
|
5
|
+
const exit_codes_1 = require("../lib/exit-codes");
|
|
6
|
+
function registerCommand(program) {
|
|
7
|
+
program
|
|
8
|
+
.command('dev')
|
|
9
|
+
.summary('Boot Xema in single-binary mode (in-process)')
|
|
10
|
+
.description('Boots Xema services for local development via a mix of in-process ' +
|
|
11
|
+
'and forked-worker modes. Probes Postgres / Redis / event-hub-api ' +
|
|
12
|
+
'first; exits with an actionable `docker compose up` message if ' +
|
|
13
|
+
'any are unreachable. Wires 29/29 candidate services into the ' +
|
|
14
|
+
'boot loop; per-service skip-mode tolerates individual failures.')
|
|
15
|
+
.option('--kernel-port <port>', 'HTTP port for xema-kernel-server', (raw) => Number.parseInt(raw, 10))
|
|
16
|
+
.option('--router-port <port>', 'HTTP port for xema-capability-router', (raw) => Number.parseInt(raw, 10))
|
|
17
|
+
.option('--skip-preflight', 'Skip the infra TCP probe (debugging only — masks real outages).')
|
|
18
|
+
.action(async (opts) => {
|
|
19
|
+
try {
|
|
20
|
+
await (0, dev_orchestrator_1.runDevOrchestrator)({
|
|
21
|
+
kernelPort: opts.kernelPort,
|
|
22
|
+
routerPort: opts.routerPort,
|
|
23
|
+
skipPreflight: opts.skipPreflight,
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
catch (err) {
|
|
27
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
28
|
+
(0, exit_codes_1.exitWith)(exit_codes_1.XemaCliExitCode.GenericError, `xema dev failed: ${message}`);
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=dev.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dev.js","sourceRoot":"","sources":["../../src/commands/dev.ts"],"names":[],"mappings":";;AAsBA,0CA+CC;AArED,8DAA6D;AAC7D,kDAA8D;AAqB9D,SAAgB,eAAe,CAAC,OAAgB;IAC9C,OAAO;SACJ,OAAO,CAAC,KAAK,CAAC;SACd,OAAO,CAAC,8CAA8C,CAAC;SACvD,WAAW,CACV,oEAAoE;QAClE,mEAAmE;QACnE,iEAAiE;QACjE,+DAA+D;QAC/D,iEAAiE,CACpE;SACA,MAAM,CACL,sBAAsB,EACtB,kCAAkC,EAClC,CAAC,GAAG,EAAE,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,EAAE,EAAE,CAAC,CAClC;SACA,MAAM,CACL,sBAAsB,EACtB,sCAAsC,EACtC,CAAC,GAAG,EAAE,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,EAAE,EAAE,CAAC,CAClC;SACA,MAAM,CACL,kBAAkB,EAClB,iEAAiE,CAClE;SACA,MAAM,CACL,KAAK,EAAE,IAIN,EAAE,EAAE;QACH,IAAI,CAAC;YACH,MAAM,IAAA,qCAAkB,EAAC;gBACvB,UAAU,EAAE,IAAI,CAAC,UAAU;gBAC3B,UAAU,EAAE,IAAI,CAAC,UAAU;gBAC3B,aAAa,EAAE,IAAI,CAAC,aAAa;aAClC,CAAC,CAAC;QACL,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,MAAM,OAAO,GACX,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;YACnD,IAAA,qBAAQ,EACN,4BAAe,CAAC,YAAY,EAC5B,oBAAoB,OAAO,EAAE,CAC9B,CAAC;QACJ,CAAC;IACH,CAAC,CACF,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { Command } from 'commander';
|
|
2
|
+
export declare function registerCommand(program: Command): void;
|
|
3
|
+
export interface DoctorCheck {
|
|
4
|
+
readonly name: string;
|
|
5
|
+
readonly ok: boolean;
|
|
6
|
+
readonly detail: string;
|
|
7
|
+
}
|
|
8
|
+
export interface DoctorResult {
|
|
9
|
+
readonly checks: ReadonlyArray<DoctorCheck>;
|
|
10
|
+
readonly failed: boolean;
|
|
11
|
+
}
|
|
12
|
+
export interface RunDoctorOptions {
|
|
13
|
+
readonly infra?: boolean;
|
|
14
|
+
}
|
|
15
|
+
export declare function runDoctor(opts?: RunDoctorOptions): Promise<DoctorResult>;
|
|
16
|
+
//# sourceMappingURL=doctor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"doctor.d.ts","sourceRoot":"","sources":["../../src/commands/doctor.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAiBzC,wBAAgB,eAAe,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAqBtD;AAED,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAC,WAAW,CAAC,CAAC;IAC5C,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;CAC1B;AAED,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC;CAC1B;AAWD,wBAAsB,SAAS,CAC7B,IAAI,GAAE,gBAAqB,GAC1B,OAAO,CAAC,YAAY,CAAC,CAkCvB"}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.registerCommand = registerCommand;
|
|
4
|
+
exports.runDoctor = runDoctor;
|
|
5
|
+
const node_fs_1 = require("node:fs");
|
|
6
|
+
const node_os_1 = require("node:os");
|
|
7
|
+
const node_path_1 = require("node:path");
|
|
8
|
+
const infra_preflight_1 = require("../dev/infra-preflight");
|
|
9
|
+
const exit_codes_1 = require("../lib/exit-codes");
|
|
10
|
+
function registerCommand(program) {
|
|
11
|
+
program
|
|
12
|
+
.command('doctor')
|
|
13
|
+
.summary('Diagnose the local Xema environment')
|
|
14
|
+
.description('Checks node version, the ~/.xema/ config directory, and reports ' +
|
|
15
|
+
'whether a dev KernelState file is present. Pass `--infra` to ' +
|
|
16
|
+
'also probe the Postgres/Redis/event-hub-api dependencies that ' +
|
|
17
|
+
'`xema dev` needs.')
|
|
18
|
+
.option('--infra', 'Also TCP-probe the infra dependencies of `xema dev` (Postgres, Redis, event-hub-api).')
|
|
19
|
+
.action(async (opts) => {
|
|
20
|
+
const result = await runDoctor({ infra: opts.infra === true });
|
|
21
|
+
if (result.failed) {
|
|
22
|
+
(0, exit_codes_1.exitWith)(exit_codes_1.XemaCliExitCode.GenericError);
|
|
23
|
+
}
|
|
24
|
+
(0, exit_codes_1.exitWith)(exit_codes_1.XemaCliExitCode.Ok);
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
async function runDoctor(opts = {}) {
|
|
28
|
+
const checks = [];
|
|
29
|
+
checks.push(checkNodeVersion());
|
|
30
|
+
checks.push(checkXemaHomeDir());
|
|
31
|
+
checks.push(checkDevKernelStateFile());
|
|
32
|
+
const lineWidth = checks.reduce((acc, c) => Math.max(acc, c.name.length), 0);
|
|
33
|
+
console.log('xema doctor — environment checks');
|
|
34
|
+
console.log('-'.repeat(40));
|
|
35
|
+
for (const c of checks) {
|
|
36
|
+
const marker = c.ok ? 'OK ' : 'FAIL';
|
|
37
|
+
console.log(`[${marker}] ${c.name.padEnd(lineWidth, ' ')} ${c.detail}`);
|
|
38
|
+
}
|
|
39
|
+
const failed = checks.some((c) => !c.ok);
|
|
40
|
+
if (failed) {
|
|
41
|
+
console.log('');
|
|
42
|
+
console.log('One or more checks failed. See lines marked [FAIL] above.');
|
|
43
|
+
}
|
|
44
|
+
if (opts.infra === true) {
|
|
45
|
+
console.log('');
|
|
46
|
+
const report = await (0, infra_preflight_1.runInfraPreflight)();
|
|
47
|
+
printInfraReport(report);
|
|
48
|
+
}
|
|
49
|
+
return { checks, failed };
|
|
50
|
+
}
|
|
51
|
+
function checkNodeVersion() {
|
|
52
|
+
const raw = process.versions.node;
|
|
53
|
+
const major = Number.parseInt(raw.split('.')[0] ?? '0', 10);
|
|
54
|
+
const ok = major >= 20;
|
|
55
|
+
return {
|
|
56
|
+
name: 'node version',
|
|
57
|
+
ok,
|
|
58
|
+
detail: ok
|
|
59
|
+
? `v${raw} (>= 20.0.0)`
|
|
60
|
+
: `v${raw} — Xema CLI requires Node 20+`,
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
function checkXemaHomeDir() {
|
|
64
|
+
const dir = (0, node_path_1.join)((0, node_os_1.homedir)(), '.xema');
|
|
65
|
+
if (!(0, node_fs_1.existsSync)(dir)) {
|
|
66
|
+
return {
|
|
67
|
+
name: '~/.xema/',
|
|
68
|
+
ok: true,
|
|
69
|
+
detail: `not yet created (will be initialized on first \`xema dev\`): ${dir}`,
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
const stat = (0, node_fs_1.statSync)(dir);
|
|
73
|
+
return {
|
|
74
|
+
name: '~/.xema/',
|
|
75
|
+
ok: stat.isDirectory(),
|
|
76
|
+
detail: stat.isDirectory()
|
|
77
|
+
? `present at ${dir}`
|
|
78
|
+
: `exists but is not a directory: ${dir}`,
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
function checkDevKernelStateFile() {
|
|
82
|
+
const file = (0, node_path_1.join)((0, node_os_1.homedir)(), '.xema', 'dev', 'kernel-state.sqlite');
|
|
83
|
+
if (!(0, node_fs_1.existsSync)(file)) {
|
|
84
|
+
return {
|
|
85
|
+
name: 'dev KernelState',
|
|
86
|
+
ok: true,
|
|
87
|
+
detail: `no SQLite file yet at ${file} (created on first \`xema dev\`)`,
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
const stat = (0, node_fs_1.statSync)(file);
|
|
91
|
+
return {
|
|
92
|
+
name: 'dev KernelState',
|
|
93
|
+
ok: stat.isFile(),
|
|
94
|
+
detail: stat.isFile()
|
|
95
|
+
? `present (${stat.size} bytes) at ${file}`
|
|
96
|
+
: `exists but is not a file: ${file}`,
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
function printInfraReport(report) {
|
|
100
|
+
console.log('xema doctor --infra — `xema dev` infra dependencies');
|
|
101
|
+
console.log('-'.repeat(60));
|
|
102
|
+
const nameWidth = Math.max(...infra_preflight_1.DEFAULT_INFRA_DEPENDENCIES.map((d) => (0, infra_preflight_1.labelFor)(d.kind).length), 10);
|
|
103
|
+
for (const r of report.results) {
|
|
104
|
+
const dep = r.dependency;
|
|
105
|
+
const marker = r.reachable ? 'OK ' : 'MISS';
|
|
106
|
+
const addr = `${dep.host}:${dep.port}`;
|
|
107
|
+
const why = r.reachable
|
|
108
|
+
? ''
|
|
109
|
+
: ` — ${r.errorCode ?? 'unreachable'} — run \`docker compose up -d ${dep.composeServiceName}\``;
|
|
110
|
+
console.log(`[${marker}] ${(0, infra_preflight_1.labelFor)(dep.kind).padEnd(nameWidth, ' ')} ${addr.padEnd(20, ' ')}${why}`);
|
|
111
|
+
}
|
|
112
|
+
console.log('');
|
|
113
|
+
if (report.missing.length === 0) {
|
|
114
|
+
console.log('All infra dependencies reachable.');
|
|
115
|
+
}
|
|
116
|
+
else {
|
|
117
|
+
const composeNames = report.missing
|
|
118
|
+
.map((r) => r.dependency.composeServiceName)
|
|
119
|
+
.join(' ');
|
|
120
|
+
console.log(`${report.missing.length}/${report.results.length} dependencies missing. Quick fix:`);
|
|
121
|
+
console.log(` cd test-suite && docker compose up -d ${composeNames}`);
|
|
122
|
+
}
|
|
123
|
+
console.log('');
|
|
124
|
+
console.log('Note: `xema dev` wires 29/29 services into its candidate list — a mix');
|
|
125
|
+
console.log('of in-process and forked-worker boot. Individual boot failures are');
|
|
126
|
+
console.log('routed through skip-mode (see dev-orchestrator.ts header for details).');
|
|
127
|
+
}
|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