@quolu/lattice 0.71.0 → 0.71.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/bin/lattice.mjs +21 -0
- package/package.json +1 -1
package/bin/lattice.mjs
CHANGED
|
@@ -8,6 +8,8 @@ import packageJson from '../package.json' with { type: 'json' };
|
|
|
8
8
|
installPipeCloseGuard();
|
|
9
9
|
|
|
10
10
|
const args = process.argv.slice(2);
|
|
11
|
+
// 作業ディレクトリを読まないsurface。cwdが消えた席(閉じたworktree)からでも動かす。
|
|
12
|
+
const CWD_FREE_COMMANDS = new Set(['runtime-errors', 'bridge', 'hooks', 'setup', 'factory-diagnostics']);
|
|
11
13
|
installSqliteExperimentalWarningFilter();
|
|
12
14
|
const help = renderCliHelp(args);
|
|
13
15
|
|
|
@@ -15,6 +17,16 @@ if (help !== null) {
|
|
|
15
17
|
process.stdout.write(help);
|
|
16
18
|
} else if (args.length === 1 && args[0] === '--version') {
|
|
17
19
|
process.stdout.write(`${packageJson.version}\n`);
|
|
20
|
+
} else if (!CWD_FREE_COMMANDS.has(args[0]) && workingDirectory() === null) {
|
|
21
|
+
// 呼び出し元のcwdが削除済み(閉じたworktreeに残ったshell等)。`process.cwd()`のENOENTが
|
|
22
|
+
// 各分岐で生のstackや内部故障(LATTICE.CLI_INTERNAL_FAILED)として漏れていた。製品の故障ではなく
|
|
23
|
+
// 呼び出し環境の不備なので、観測せずtyped契約で原因と直し方を返す。
|
|
24
|
+
process.stderr.write(`${JSON.stringify({
|
|
25
|
+
schema: 'lattice.cli_error.v2', code: 'CWD_UNAVAILABLE',
|
|
26
|
+
message: 'current working directory no longer exists',
|
|
27
|
+
detail: { next_action: 'cd_to_existing_project_directory_then_retry' },
|
|
28
|
+
})}\n`);
|
|
29
|
+
process.exitCode = 1;
|
|
18
30
|
} else if (args.length === 2 && args[0] === 'session-context' && args[1] === '--json') {
|
|
19
31
|
const { runSessionContext } = await import('../src/project-cli.mjs');
|
|
20
32
|
process.exitCode = await runSessionContext({
|
|
@@ -160,6 +172,15 @@ if (help !== null) {
|
|
|
160
172
|
}
|
|
161
173
|
}
|
|
162
174
|
|
|
175
|
+
function workingDirectory() {
|
|
176
|
+
try {
|
|
177
|
+
return process.cwd();
|
|
178
|
+
} catch (error) {
|
|
179
|
+
if (error?.code === 'ENOENT') return null;
|
|
180
|
+
throw error;
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
|
|
163
184
|
async function runRuntimeErrorsCli(rest) {
|
|
164
185
|
const runtimeErrors = await import('../src/runtime-errors.mjs');
|
|
165
186
|
const usage = () => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quolu/lattice",
|
|
3
|
-
"version": "0.71.
|
|
3
|
+
"version": "0.71.1",
|
|
4
4
|
"description": "Schedulability compiler for multi-agent development: observe real code boundaries, refactor the conflicting seam, recompile the plan for parallel execution",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Quo / クオ at kitepon.dev",
|