HAL 제어 평면(릴리스·서버·Agent·작업·모듈 배포·운영자 계정·긴급 복구·재해복구·공개 상태), Node Agent, 배포 스크립트·유닛·nginx 템플릿, 릴리스 도구, 포털 HAL 클라이언트 (§28·§29·§32~§34)
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5.1
parent
403d0fb845
commit
6b5a014041
@@ -0,0 +1,24 @@
|
||||
/**
|
||||
* hal/deps.mjs — HAL 의존성 묶음(deps) 만들기. index.mjs(운영)와 테스트가 같은 함수를 쓴다.
|
||||
* deps = { store, vault, config, jobs, log, version, instanceId, serviceauth, notifyLib, fetch, emergencyRunner, jobsRunning, stopping }
|
||||
*/
|
||||
import { openDb } from '../lib/db.mjs';
|
||||
import { openVault } from '../lib/vault.mjs';
|
||||
import { createJobEngine } from '../lib/jobs.mjs';
|
||||
import * as serviceauth from '../lib/serviceauth.mjs';
|
||||
import * as notifyLib from '../lib/notify.mjs';
|
||||
import { newId } from '../lib/crypto.mjs';
|
||||
import { MIGRATIONS } from './schema.mjs';
|
||||
import { registerKinds } from './jobs.mjs';
|
||||
import { readFileSync } from 'node:fs';
|
||||
import { join } from 'node:path';
|
||||
|
||||
export const VERSION = JSON.parse(readFileSync(new URL('../package.json', import.meta.url), 'utf8')).version;
|
||||
export function createHalDeps({ config, dbFile = null, log = () => {}, fetchImpl = null, version = VERSION, concurrency = 64 } = {}) {
|
||||
const store = openDb(dbFile || join(config.dataDir, 'hal.sqlite'), MIGRATIONS);
|
||||
const vault = openVault(config.dataDir);
|
||||
const d = { store, vault, config, log, version, instanceId: newId('hal_'), serviceauth, notifyLib, fetch: fetchImpl, emergencyRunner: null, jobsRunning: false, stopping: false };
|
||||
d.jobs = createJobEngine(store, { log, workerId: `hal@${process.pid}`, concurrency, pollMs: 500 });
|
||||
registerKinds(d.jobs, d);
|
||||
return d;
|
||||
}
|
||||
Reference in New Issue
Block a user