@quolu/lattice 0.12.22 → 0.12.23
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/package.json +1 -1
- package/src/runtime-cli.mjs +25 -0
package/package.json
CHANGED
package/src/runtime-cli.mjs
CHANGED
|
@@ -1230,6 +1230,20 @@ export function reconstructHoldResultFromJournal({ journal, runId, requestId, in
|
|
|
1230
1230
|
return result;
|
|
1231
1231
|
}
|
|
1232
1232
|
|
|
1233
|
+
/** 現在registryが持つadapter kindを返す。registryが無ければ空配列(推測で埋めない)。 */
|
|
1234
|
+
async function registeredAdapterKinds(repoRoot) {
|
|
1235
|
+
try {
|
|
1236
|
+
const registry = JSON.parse(await readFile(
|
|
1237
|
+
path.join(repoRoot, '.lattice/runtime/adapter-registry/registry.json'), 'utf8',
|
|
1238
|
+
));
|
|
1239
|
+
if (!Array.isArray(registry?.entries)) return [];
|
|
1240
|
+
return registry.entries
|
|
1241
|
+
.map((entry) => entry?.adapter_kind)
|
|
1242
|
+
.filter((kind) => typeof kind === 'string')
|
|
1243
|
+
.sort();
|
|
1244
|
+
} catch { return []; }
|
|
1245
|
+
}
|
|
1246
|
+
|
|
1233
1247
|
async function runActivate({ runDir, runRef, repoRoot, stdout, requestId = null }) {
|
|
1234
1248
|
return withLifecycleLock(runDir, async () => {
|
|
1235
1249
|
const { events, meta, managed } = await readRunStore(runDir);
|
|
@@ -1280,6 +1294,17 @@ async function runActivate({ runDir, runRef, repoRoot, stdout, requestId = null
|
|
|
1280
1294
|
}
|
|
1281
1295
|
await new Promise((resolve) => setTimeout(resolve, 20));
|
|
1282
1296
|
}
|
|
1297
|
+
// ADAPTER_NOT_REGISTEREDは「registryが無い/そのadapterのentryが無い」だけを意味し、
|
|
1298
|
+
// 何をどこへ置けば解決するかをそれ自体は伝えない。行き止まりにしないため、
|
|
1299
|
+
// 必要な成果物と現在registryが持つadapterを返す(ADR 0123と同じdiagnosability規律)。
|
|
1300
|
+
if (code === 'ADAPTER_NOT_REGISTERED') {
|
|
1301
|
+
throw new CliContractError(code, `managed activateが${response.outcome}で終了した: ${response.result?.unmet?.[1] ?? code}`, {
|
|
1302
|
+
adapter_kind: meta?.executor_adapter ?? null,
|
|
1303
|
+
required_artifact: '.lattice/runtime/adapter-registry/registry.json',
|
|
1304
|
+
registered_adapters: await registeredAdapterKinds(repoRoot),
|
|
1305
|
+
reason: 'run activateは登録済みexecutor adapterを要求する。adapter登録は現時点で公開CLI面ではない',
|
|
1306
|
+
});
|
|
1307
|
+
}
|
|
1283
1308
|
throw new CliContractError(code, `managed activateが${response.outcome}で終了した: ${response.result?.unmet?.[1] ?? code}`);
|
|
1284
1309
|
}
|
|
1285
1310
|
// daemonがpointerまでcommitしたことを再読してから成功を返す。
|