@aopslabs/aops 0.3.0 → 0.3.2
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/README.md +11 -12
- package/THIRD_PARTY_NOTICES +16169 -0
- package/dist/commands/community-server.js +5 -2
- package/dist/commands/host.js +16 -67
- package/dist/lib/community-diagnostic.js +1 -1
- package/dist/lib/community-native-lifecycle.js +70 -7
- package/dist/lib/setup-readiness.js +2 -2
- package/dist/main.js +70 -7
- package/native/tui/win32-x64/aops-tui.exe +0 -0
- package/package.json +6 -3
|
@@ -13,7 +13,7 @@ import { resolveCommunityOfflineRelease, resolveCommunityPublishedRelease, } fro
|
|
|
13
13
|
import { inspectCommunityDoctor } from './community-doctor.js';
|
|
14
14
|
import { buildCommunityInstanceContract, } from '../lib/community-instance-contract.js';
|
|
15
15
|
import { asCommunityDiagnosticError } from '../lib/community-diagnostic.js';
|
|
16
|
-
import { assertCommunityNativePathLayout, attestCommunityNativeExternalSnapshot, inspectCommunityNativeInstall, inspectCommunityNativeRuntime, loadExternalPostgresUrl, loadExternalServerAuthConfig, planCommunityNativeInstalledMigration, readCommunityNativeLogs, rollbackCommunityNativeApplication, resolveCommunityNativeLaunchMode, resolveCommunityNativePaths, setupCommunityNativeInstall, startCommunityNativeInstall, stopCommunityNativeInstall, } from '../lib/community-native-lifecycle.js';
|
|
16
|
+
import { assertCommunityNativePathLayout, attestCommunityNativeExternalSnapshot, inspectCommunityNativeInstall, inspectCommunityNativeRuntime, loadExternalPostgresUrl, loadExternalServerAuthConfig, planCommunityNativeInstalledMigration, readCommunityNativeLogs, rollbackCommunityNativeApplication, resolveCommunityNativeInstalledNpmSourceRoot, resolveCommunityNativeLaunchMode, resolveCommunityNativePaths, setupCommunityNativeInstall, startCommunityNativeInstall, stopCommunityNativeInstall, } from '../lib/community-native-lifecycle.js';
|
|
17
17
|
import { inspectCommunityNativeApplicationRecoveryStatus } from '../lib/community-native-application-recovery.js';
|
|
18
18
|
import { inspectCommunityNativeDatabaseRecoveryStatus, restoreCommunityNativeDatabaseForUpdate, } from '../lib/community-native-database-recovery.js';
|
|
19
19
|
import { inspectCommunityNativePostgres, removeCommunityNativePostgresContainerForReset, removeCommunityNativeManagedPostgres, } from '../lib/community-native-postgres.js';
|
|
@@ -214,6 +214,8 @@ function resolveDependencies(dependencies = {}) {
|
|
|
214
214
|
planNativeMigration: dependencies.planNativeMigration ?? planCommunityNativeInstalledMigration,
|
|
215
215
|
attestNativeExternalSnapshot: dependencies.attestNativeExternalSnapshot ?? attestCommunityNativeExternalSnapshot,
|
|
216
216
|
setupNativeInstall: dependencies.setupNativeInstall ?? setupCommunityNativeInstall,
|
|
217
|
+
startNativeInstall: dependencies.startNativeInstall ?? startCommunityNativeInstall,
|
|
218
|
+
resolveNativeInstalledNpmSourceRoot: dependencies.resolveNativeInstalledNpmSourceRoot ?? resolveCommunityNativeInstalledNpmSourceRoot,
|
|
217
219
|
rollbackNativeApplication: dependencies.rollbackNativeApplication ?? rollbackCommunityNativeApplication,
|
|
218
220
|
restoreNativeDatabase: dependencies.restoreNativeDatabase ?? restoreCommunityNativeDatabaseForUpdate,
|
|
219
221
|
stopNativeCockpit: dependencies.stopNativeCockpit ?? stopCommunityNativeCockpit,
|
|
@@ -764,8 +766,9 @@ export async function runCommunityServerStart(options, dependencies = {}) {
|
|
|
764
766
|
await withMutatingCommandScope(dependencies, async (runtime, signal) => {
|
|
765
767
|
const native = inspectNativeFrom(options);
|
|
766
768
|
if (native.status === 'installed') {
|
|
767
|
-
const launch = await withNativeOperation(options, 'start', runtime, signal, () =>
|
|
769
|
+
const launch = await withNativeOperation(options, 'start', runtime, signal, () => runtime.startNativeInstall({
|
|
768
770
|
...installSelection(options),
|
|
771
|
+
adoptSourceRoot: runtime.resolveNativeInstalledNpmSourceRoot(),
|
|
769
772
|
mode: resolveCommunityNativeLaunchMode(options),
|
|
770
773
|
signal,
|
|
771
774
|
}));
|
package/dist/commands/host.js
CHANGED
|
@@ -4,7 +4,7 @@ import path from 'node:path';
|
|
|
4
4
|
import { spawn } from 'node:child_process';
|
|
5
5
|
import { Command } from 'commander';
|
|
6
6
|
import { banner, logError, logInfo, logSuccess } from '@aopslabs/xf-cli-ui';
|
|
7
|
-
import { getHostRegistrationsDir, listInstalledHostRegistrations,
|
|
7
|
+
import { getHostRegistrationsDir, listInstalledHostRegistrations, mergeHostRegistrationsIntoConfig, unregisterHostRegistration, } from '@aopslabs/aops-host-registration';
|
|
8
8
|
import { getAopsServerEnvPath, inferAopsRepoDialect, readAopsServerEnvConfig, redactAopsRepoUrl, writeAopsServerEnvConfig, } from '@aopslabs/aops-runtime-config';
|
|
9
9
|
import { createCliApiClientFromOptions, fetchCliHealth } from '../utils/api.js';
|
|
10
10
|
import { applyCommonOptions, compactPayload } from '../utils/command.js';
|
|
@@ -325,71 +325,20 @@ function printHostRegistrationResult(payload, options) {
|
|
|
325
325
|
}
|
|
326
326
|
console.log(JSON.stringify(payload, null, 2));
|
|
327
327
|
}
|
|
328
|
-
function requireCommunityRegistrationJsonPath(options) {
|
|
329
|
-
const from = options.from?.trim();
|
|
330
|
-
if (!from)
|
|
331
|
-
throw new Error('Missing registration source. Use --from /path/to/host-registration.json.');
|
|
332
|
-
const filePath = path.resolve(process.cwd(), from);
|
|
333
|
-
if (path.extname(filePath).toLowerCase() !== '.json') {
|
|
334
|
-
throw new Error('Community host registration accepts JSON files only.');
|
|
335
|
-
}
|
|
336
|
-
const stats = fs.lstatSync(filePath);
|
|
337
|
-
if (!stats.isFile() || stats.isSymbolicLink()) {
|
|
338
|
-
throw new Error(`Community host registration must be a regular JSON file: ${filePath}`);
|
|
339
|
-
}
|
|
340
|
-
return fs.realpathSync(filePath);
|
|
341
|
-
}
|
|
342
|
-
function loadCommunityHostRegistrationJson(filePath) {
|
|
343
|
-
let parsed;
|
|
344
|
-
try {
|
|
345
|
-
parsed = JSON.parse(fs.readFileSync(filePath, 'utf8'));
|
|
346
|
-
}
|
|
347
|
-
catch (error) {
|
|
348
|
-
throw new Error(`Host registration JSON parse failed: ${error instanceof Error ? error.message : String(error)}`);
|
|
349
|
-
}
|
|
350
|
-
const materialized = materializeHostRegistrationManifest(normalizeHostRegistrationManifest(parsed), path.dirname(filePath));
|
|
351
|
-
return normalizeHostRegistrationManifest({
|
|
352
|
-
...materialized,
|
|
353
|
-
provenance: {
|
|
354
|
-
...materialized.provenance,
|
|
355
|
-
source: filePath,
|
|
356
|
-
sourceType: 'file',
|
|
357
|
-
registeredAt: new Date().toISOString(),
|
|
358
|
-
},
|
|
359
|
-
});
|
|
360
|
-
}
|
|
361
328
|
export async function runHostRegister(options = {}) {
|
|
362
|
-
const
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
}
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
});
|
|
376
|
-
if (!options.json)
|
|
377
|
-
logSuccess(`Registered ${manifest.domain}.`);
|
|
378
|
-
printHostRegistrationResult({
|
|
379
|
-
ok: true,
|
|
380
|
-
domain: manifest.domain,
|
|
381
|
-
displayName: manifest.displayName ?? null,
|
|
382
|
-
packageName: manifest.packageName ?? null,
|
|
383
|
-
filePath,
|
|
384
|
-
registrationsDir,
|
|
385
|
-
manifest,
|
|
386
|
-
}, options);
|
|
387
|
-
}
|
|
388
|
-
catch (error) {
|
|
389
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
390
|
-
logError(`Registration failed: ${message}`);
|
|
391
|
-
process.exitCode = 1;
|
|
392
|
-
}
|
|
329
|
+
const unsupported = {
|
|
330
|
+
ok: false,
|
|
331
|
+
schemaVersion: 1,
|
|
332
|
+
error: 'commercial_profile_required',
|
|
333
|
+
profile: 'trusted-local',
|
|
334
|
+
action: 'host.register',
|
|
335
|
+
message: 'External domain registration is not available in the public trusted-local profile.',
|
|
336
|
+
};
|
|
337
|
+
if (options.json)
|
|
338
|
+
console.log(JSON.stringify(unsupported, null, 2));
|
|
339
|
+
else
|
|
340
|
+
logError(`${unsupported.error}: ${unsupported.message}`);
|
|
341
|
+
process.exitCode = 1;
|
|
393
342
|
}
|
|
394
343
|
export async function runHostRegistrations(options = {}) {
|
|
395
344
|
const interactive = !options.yes && !options.json;
|
|
@@ -995,8 +944,8 @@ export function makeHostCommand() {
|
|
|
995
944
|
}), { withAuth: false, withProject: false });
|
|
996
945
|
applyHostRegistrationOptions(applyCommonOptions(cmd
|
|
997
946
|
.command('register')
|
|
998
|
-
.description('
|
|
999
|
-
.
|
|
947
|
+
.description('Return commercial_profile_required; external domains are disabled in trusted-local')
|
|
948
|
+
.option('--from <path>', 'Ignored registration source; retained only for a stable refusal contract')
|
|
1000
949
|
.action(async (options) => {
|
|
1001
950
|
await runHostRegister(options);
|
|
1002
951
|
}), { withAuth: false, withProject: false }));
|
|
@@ -66,7 +66,7 @@ function guidance(code) {
|
|
|
66
66
|
return {
|
|
67
67
|
summary: 'The installed npm server package no longer matches the source or build fingerprint AOPS previously verified.',
|
|
68
68
|
nextActions: Object.freeze([
|
|
69
|
-
'Reinstall the
|
|
69
|
+
'Reinstall the public `@aopslabs/aops` package so npm restores its exact Server dependency.',
|
|
70
70
|
'Re-run `aops setup init` for the selected path after the verified package bytes have been restored.',
|
|
71
71
|
]),
|
|
72
72
|
};
|
|
@@ -7,6 +7,7 @@ import { fileURLToPath } from 'node:url';
|
|
|
7
7
|
import { parseEnv } from 'node:util';
|
|
8
8
|
import { COMMUNITY_NATIVE_CHILD_PROTOCOL, COMMUNITY_NATIVE_CONTROL_PROTOCOL, } from './community-native-child.js';
|
|
9
9
|
import { resolveCommunityInstallPaths } from './community-lifecycle.js';
|
|
10
|
+
import { buildCommunityInstanceContract, } from './community-instance-contract.js';
|
|
10
11
|
import { COMMUNITY_NATIVE_POSTGRES_CONTRACT_PATH, assertCommunityNativePostgresInstanceState, assertCommunityNativePostgresState, buildCommunityNativePostgresUrl, setupCommunityNativePostgres, startCommunityNativePostgres, stopCommunityNativePostgres, } from './community-native-postgres.js';
|
|
11
12
|
import { COMMUNITY_NATIVE_MIGRATION_POLICY_PATH, assertCommunityNativeMigrationReceiptV1, planCommunityNativeMigration, runCommunityNativeMigration, } from './community-native-migration.js';
|
|
12
13
|
import { createCommunityExternalSnapshotAttestationV1, writeCommunityExternalSnapshotAttestationV1, } from './community-migration-snapshot.js';
|
|
@@ -660,20 +661,29 @@ function sourceLayout(root, manifest = sourcePackage(root)) {
|
|
|
660
661
|
function isPackagedCommunityServerSource(source) {
|
|
661
662
|
return sourceLayout(source.root).kind === 'npm-package';
|
|
662
663
|
}
|
|
664
|
+
function isPersistedPackagedCommunityServerState(state) {
|
|
665
|
+
return samePhysicalPath(state.build.hostEntry, path.join(state.source.root, PACKAGE_BUILD_PATHS.hostEntry)) &&
|
|
666
|
+
samePhysicalPath(state.build.handlerEntry, path.join(state.source.root, PACKAGE_BUILD_PATHS.handlerEntry)) &&
|
|
667
|
+
samePhysicalPath(state.build.cockpitIndex, path.join(state.source.root, PACKAGE_BUILD_PATHS.cockpitIndex));
|
|
668
|
+
}
|
|
663
669
|
export function isCommunityNativeNpmPackageSource(sourceRoot) {
|
|
664
670
|
const resolved = path.resolve(sourceRoot);
|
|
665
671
|
return sourceLayout(realpathSync(resolved)).kind === 'npm-package';
|
|
666
672
|
}
|
|
667
673
|
export function resolveCommunityNativeDefaultSourceRoot(fallbackRoot = process.cwd(), moduleUrl = import.meta.url) {
|
|
674
|
+
return resolveCommunityNativeInstalledNpmSourceRoot(moduleUrl) ?? path.resolve(fallbackRoot);
|
|
675
|
+
}
|
|
676
|
+
export function resolveCommunityNativeInstalledNpmSourceRoot(moduleUrl = import.meta.url) {
|
|
668
677
|
try {
|
|
669
678
|
const require = createRequire(moduleUrl);
|
|
670
679
|
const packageJsonPath = require.resolve(`${PUBLIC_SERVER_PACKAGE_NAME}/package.json`);
|
|
671
680
|
const packageRoot = path.dirname(packageJsonPath);
|
|
672
|
-
sourceLayout(packageRoot)
|
|
681
|
+
if (sourceLayout(packageRoot).kind !== 'npm-package')
|
|
682
|
+
return null;
|
|
673
683
|
return packageRoot;
|
|
674
684
|
}
|
|
675
685
|
catch {
|
|
676
|
-
return
|
|
686
|
+
return null;
|
|
677
687
|
}
|
|
678
688
|
}
|
|
679
689
|
export function inspectCommunityNativeSource(sourceRoot = process.cwd()) {
|
|
@@ -827,6 +837,12 @@ export function reconcileCommunityNativePriorApplication(params) {
|
|
|
827
837
|
throw new Error('community_native_container_postgres_contract_required');
|
|
828
838
|
}
|
|
829
839
|
if (!samePhysicalPath(state.source.root, selectedSource.root)) {
|
|
840
|
+
if (sourceLayout(selectedSource.root).kind === 'npm-package') {
|
|
841
|
+
const comparison = compareCommunityReleaseVersions(selectedSource.releaseVersion, state.source.releaseVersion);
|
|
842
|
+
if (comparison < 0) {
|
|
843
|
+
throw new Error(`community_native_application_downgrade_refused:${state.source.releaseVersion}:to:${selectedSource.releaseVersion}`);
|
|
844
|
+
}
|
|
845
|
+
}
|
|
830
846
|
return 'application-source-adopted';
|
|
831
847
|
}
|
|
832
848
|
try {
|
|
@@ -2443,15 +2459,62 @@ export async function startCommunityNativeInstall(params) {
|
|
|
2443
2459
|
if (inspection.status !== 'installed' || !inspection.state) {
|
|
2444
2460
|
throw new Error(`community_native_not_installed:${inspection.status}:${inspection.error ?? 'run_server_setup'}`);
|
|
2445
2461
|
}
|
|
2462
|
+
const runtime = params.runtime ?? communityNativeRuntime;
|
|
2463
|
+
const now = params.now ?? (() => new Date());
|
|
2464
|
+
const createId = params.createId ?? randomUUID;
|
|
2465
|
+
const mode = params.mode ?? 'detached';
|
|
2466
|
+
const readyTimeoutMs = params.readyTimeoutMs ?? DEFAULT_READY_TIMEOUT_MS;
|
|
2467
|
+
if (params.adoptSourceRoot
|
|
2468
|
+
&& isPersistedPackagedCommunityServerState(inspection.state)
|
|
2469
|
+
&& inspection.state.server.host === '127.0.0.1'
|
|
2470
|
+
&& inspection.state.server.exposure === 'loopback'
|
|
2471
|
+
&& inspection.state.server.authProvider === 'trusted-local') {
|
|
2472
|
+
const selectedSource = inspectCommunityNativeSource(params.adoptSourceRoot);
|
|
2473
|
+
const state = inspection.state;
|
|
2474
|
+
const contract = buildCommunityInstanceContract({
|
|
2475
|
+
runtime: 'native',
|
|
2476
|
+
postgres: state.postgres.mode,
|
|
2477
|
+
postgresConfig: state.postgres.mode === 'external' ? state.postgres.configRef : undefined,
|
|
2478
|
+
postgresTls: state.postgres.mode === 'external' ? state.postgres.tlsPolicy : undefined,
|
|
2479
|
+
exposure: state.server.exposure,
|
|
2480
|
+
auth: state.server.authProvider,
|
|
2481
|
+
publicPort: state.server.publicPort,
|
|
2482
|
+
instance: state.instanceName,
|
|
2483
|
+
port: state.server.port,
|
|
2484
|
+
processEnv: params.env,
|
|
2485
|
+
});
|
|
2486
|
+
const reconciliation = reconcileCommunityNativePriorApplication({
|
|
2487
|
+
state,
|
|
2488
|
+
selectedSource,
|
|
2489
|
+
contract,
|
|
2490
|
+
selectedExternalConfigRef: state.postgres.mode === 'external' ? state.postgres.configRef : undefined,
|
|
2491
|
+
});
|
|
2492
|
+
if (reconciliation === 'application-source-adopted') {
|
|
2493
|
+
const refreshed = await setupCommunityNativeInstall({
|
|
2494
|
+
contract,
|
|
2495
|
+
sourceRoot: selectedSource.root,
|
|
2496
|
+
dataRoot: params.dataRoot,
|
|
2497
|
+
mode,
|
|
2498
|
+
runtime,
|
|
2499
|
+
postgresRuntime: params.postgresRuntime,
|
|
2500
|
+
now,
|
|
2501
|
+
createId,
|
|
2502
|
+
readyTimeoutMs,
|
|
2503
|
+
env: params.env,
|
|
2504
|
+
signal: params.signal,
|
|
2505
|
+
});
|
|
2506
|
+
return refreshed.launch;
|
|
2507
|
+
}
|
|
2508
|
+
}
|
|
2446
2509
|
return launchInstalledNative({
|
|
2447
2510
|
paths: inspection.paths,
|
|
2448
2511
|
state: inspection.state,
|
|
2449
|
-
mode
|
|
2450
|
-
runtime
|
|
2512
|
+
mode,
|
|
2513
|
+
runtime,
|
|
2451
2514
|
postgresRuntime: params.postgresRuntime,
|
|
2452
|
-
now
|
|
2453
|
-
createId
|
|
2454
|
-
readyTimeoutMs
|
|
2515
|
+
now,
|
|
2516
|
+
createId,
|
|
2517
|
+
readyTimeoutMs,
|
|
2455
2518
|
env: params.env,
|
|
2456
2519
|
signal: params.signal,
|
|
2457
2520
|
});
|
|
@@ -709,12 +709,12 @@ export async function inspectSetupReadiness(options = {}) {
|
|
|
709
709
|
: 'Native source runtime requirements are available.'
|
|
710
710
|
: needsDocker
|
|
711
711
|
? 'The installed npm server runtime (or an explicit source checkout) and a running Docker daemon are required.'
|
|
712
|
-
: 'Install
|
|
712
|
+
: 'Install or update @aopslabs/aops so its matching Server dependency is present, or provide a valid development checkout with pnpm 11.',
|
|
713
713
|
next: runtimeReady
|
|
714
714
|
? undefined
|
|
715
715
|
: needsDocker
|
|
716
716
|
? 'Install and start Docker Desktop/Engine, then retry the npm-server setup.'
|
|
717
|
-
: 'Install
|
|
717
|
+
: 'Install or update the @aopslabs/aops package, or provide a valid Community source checkout.',
|
|
718
718
|
data: {
|
|
719
719
|
node: process.version,
|
|
720
720
|
sourceRoot: selectedSourceRoot,
|
package/dist/main.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { Command } from 'commander';
|
|
3
|
+
import { createCliProgram, runCli } from '@aopslabs/cli-kit';
|
|
3
4
|
import { logError } from '@aopslabs/xf-cli-ui';
|
|
4
5
|
import { resolveCommunityCliIdentity } from './lib/community-client-contract.js';
|
|
5
6
|
import { makeInitCommand } from './commands/init.js';
|
|
@@ -28,7 +29,6 @@ import { makeMissionCommand } from './commands/mission.js';
|
|
|
28
29
|
import { makePlaybookCommand } from './commands/playbook.js';
|
|
29
30
|
import { makeResourceCommand } from './commands/resource.js';
|
|
30
31
|
import { makeArtifactCommand } from './commands/artifact.js';
|
|
31
|
-
import { makeCommercialLicenseCommand } from './commands/commercial-license.js';
|
|
32
32
|
import { makeActivityCommand } from './commands/activity.js';
|
|
33
33
|
import { makeSkillCommand } from './commands/skill.js';
|
|
34
34
|
import { makeDocCommand } from './commands/doc.js';
|
|
@@ -40,6 +40,61 @@ import { makeTargetCommand } from './commands/target.js';
|
|
|
40
40
|
import { makeVersionCommand } from './commands/version.js';
|
|
41
41
|
import { launchBundledTui, shouldLaunchBundledTui } from './lib/tui-launcher.js';
|
|
42
42
|
import { CommunityDiagnosticError, formatCommunityDiagnostic, } from './lib/community-diagnostic.js';
|
|
43
|
+
import { resolveCliApiBaseUrl } from './utils/api.js';
|
|
44
|
+
const KERNEL_COMMANDS_REPLACED_BY_AOPS = new Set(['agent', 'api', 'auth', 'client', 'host']);
|
|
45
|
+
function removeReplacedKernelCommands(program) {
|
|
46
|
+
const mutable = program;
|
|
47
|
+
mutable.commands = mutable.commands.filter((command) => !KERNEL_COMMANDS_REPLACED_BY_AOPS.has(command.name()));
|
|
48
|
+
}
|
|
49
|
+
function renderTrustedLocalLicenseStatus(command) {
|
|
50
|
+
const payload = {
|
|
51
|
+
ok: true,
|
|
52
|
+
schemaVersion: 1,
|
|
53
|
+
contract: 'aops-trusted-local-license-status-v1',
|
|
54
|
+
profile: 'trusted-local',
|
|
55
|
+
commercialAvailable: false,
|
|
56
|
+
southRequired: false,
|
|
57
|
+
builtInDomains: ['agentspace', 'chatv3', 'docman', 'projectman', 'sys'],
|
|
58
|
+
next: 'South-backed licensing and external domains are not available in this public profile.',
|
|
59
|
+
};
|
|
60
|
+
const json = command.optsWithGlobals().json === true;
|
|
61
|
+
process.stdout.write(`${JSON.stringify(payload, null, json ? 0 : 2)}\n`);
|
|
62
|
+
}
|
|
63
|
+
function refuseTrustedLocalCommercialActivation(command) {
|
|
64
|
+
const payload = {
|
|
65
|
+
ok: false,
|
|
66
|
+
schemaVersion: 1,
|
|
67
|
+
error: 'commercial_profile_required',
|
|
68
|
+
profile: 'trusted-local',
|
|
69
|
+
action: 'license.activate',
|
|
70
|
+
message: 'South-backed licensing is not available in the public trusted-local profile.',
|
|
71
|
+
};
|
|
72
|
+
const json = command.optsWithGlobals().json === true;
|
|
73
|
+
const output = `${JSON.stringify(payload, null, json ? 0 : 2)}\n`;
|
|
74
|
+
if (json)
|
|
75
|
+
process.stdout.write(output);
|
|
76
|
+
else
|
|
77
|
+
process.stderr.write(output);
|
|
78
|
+
process.exitCode = 1;
|
|
79
|
+
}
|
|
80
|
+
function makeTrustedLocalLicenseCommand() {
|
|
81
|
+
const command = new Command('license')
|
|
82
|
+
.description('Inspect the public trusted-local license profile; commercial activation is unavailable');
|
|
83
|
+
command
|
|
84
|
+
.command('status')
|
|
85
|
+
.description('Show the free built-in domain profile')
|
|
86
|
+
.option('--json', 'Emit compact JSON')
|
|
87
|
+
.action((_options, actionCommand) => renderTrustedLocalLicenseStatus(actionCommand));
|
|
88
|
+
command
|
|
89
|
+
.command('activate')
|
|
90
|
+
.description('Return commercial_profile_required without accepting commercial evidence')
|
|
91
|
+
.allowUnknownOption(true)
|
|
92
|
+
.allowExcessArguments(true)
|
|
93
|
+
.argument('[args...]')
|
|
94
|
+
.option('--json', 'Emit compact JSON')
|
|
95
|
+
.action((_args, _options, actionCommand) => refuseTrustedLocalCommercialActivation(actionCommand));
|
|
96
|
+
return command;
|
|
97
|
+
}
|
|
43
98
|
for (const stream of [process.stdout, process.stderr]) {
|
|
44
99
|
stream.on('error', (error) => {
|
|
45
100
|
if (error?.code === 'EPIPE') {
|
|
@@ -49,13 +104,18 @@ for (const stream of [process.stdout, process.stderr]) {
|
|
|
49
104
|
});
|
|
50
105
|
}
|
|
51
106
|
export function buildCommunityProgram() {
|
|
52
|
-
const program = new Command();
|
|
53
107
|
const version = resolveCommunityCliIdentity().version;
|
|
108
|
+
const program = createCliProgram({
|
|
109
|
+
name: 'aops',
|
|
110
|
+
version,
|
|
111
|
+
description: 'AOPS Community operator CLI for local-trusted, self-hosted workflows',
|
|
112
|
+
brand: 'aops',
|
|
113
|
+
defaultApiBaseUrl: resolveCliApiBaseUrl(),
|
|
114
|
+
moduleSearchRoot: process.cwd(),
|
|
115
|
+
});
|
|
116
|
+
removeReplacedKernelCommands(program);
|
|
54
117
|
program
|
|
55
|
-
.name('aops')
|
|
56
|
-
.description('AOPS Community operator CLI for local-trusted, self-hosted workflows')
|
|
57
118
|
.enablePositionalOptions()
|
|
58
|
-
.version(version)
|
|
59
119
|
.version(version, '--cli-version', 'output the CLI version (legacy alias)');
|
|
60
120
|
program.addCommand(makeInitCommand());
|
|
61
121
|
program.addCommand(makeCommunitySetupCommand());
|
|
@@ -83,7 +143,7 @@ export function buildCommunityProgram() {
|
|
|
83
143
|
program.addCommand(makePlaybookCommand());
|
|
84
144
|
program.addCommand(makeResourceCommand());
|
|
85
145
|
program.addCommand(makeArtifactCommand());
|
|
86
|
-
program.addCommand(
|
|
146
|
+
program.addCommand(makeTrustedLocalLicenseCommand());
|
|
87
147
|
program.addCommand(makeActivityCommand());
|
|
88
148
|
program.addCommand(makeSkillCommand());
|
|
89
149
|
program.addCommand(makeDocCommand());
|
|
@@ -124,7 +184,10 @@ async function main() {
|
|
|
124
184
|
: process.argv;
|
|
125
185
|
guardChatv3UnknownSubcommand(argv);
|
|
126
186
|
guardCommunitySecretArgv(argv);
|
|
127
|
-
|
|
187
|
+
const kernelArgv = argv.includes('--no-client-plugin')
|
|
188
|
+
? argv
|
|
189
|
+
: [argv[0], argv[1], '--no-client-plugin', ...argv.slice(2)];
|
|
190
|
+
await runCli(program, kernelArgv);
|
|
128
191
|
}
|
|
129
192
|
catch (error) {
|
|
130
193
|
if (error instanceof CommunityDiagnosticError) {
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aopslabs/aops",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "AOPS CLI and terminal setup application.",
|
|
6
|
-
"aopsDockerServerVersion": "0.2.
|
|
6
|
+
"aopsDockerServerVersion": "0.2.4",
|
|
7
7
|
"license": "SEE LICENSE IN LICENSE",
|
|
8
8
|
"repository": {
|
|
9
9
|
"type": "git",
|
|
@@ -47,6 +47,7 @@
|
|
|
47
47
|
"test:r6-cutover-baseline": "node scripts/verify-r6-cutover-baseline.mjs",
|
|
48
48
|
"test:r6-auth-cutover": "node --test test/r6-auth-cutover.test.mjs",
|
|
49
49
|
"test:container-runtime": "node --test test/container-runtime.test.mjs",
|
|
50
|
+
"test:kernel-alignment": "node --test test/kernel-alignment.test.mjs",
|
|
50
51
|
"test:home": "node --test test/home-menu.test.mjs",
|
|
51
52
|
"test:launchers": "node --test test/terminal-launchers.test.mjs",
|
|
52
53
|
"test:shortcuts": "pnpm run test:home && pnpm run test:cockpit && pnpm run test:launchers && pnpm run test:assets-menu && pnpm run test:agent-assets-content && pnpm run test:setup-install && pnpm run test:container-runtime && pnpm run test:native-lifecycle && pnpm run test:operation-journal && pnpm run test:commercial-canonical-order && pnpm run test:commercial-runtime-closure && pnpm run test:commercial-artifact && pnpm run test:commercial-final-readiness && pnpm run test:commercial-admission && pnpm run test:commercial-license && pnpm run test:commercial-runbook && pnpm run test:package-identity && pnpm run test:skill-discovery && pnpm run test:target-transport && pnpm run test:target-auth && pnpm run test:r6-auth-cutover && pnpm run test:r6-cutover-baseline",
|
|
@@ -54,7 +55,9 @@
|
|
|
54
55
|
"start": "node dist/main.js"
|
|
55
56
|
},
|
|
56
57
|
"dependencies": {
|
|
57
|
-
"@aopslabs/
|
|
58
|
+
"@aopslabs/aops-server": "0.2.4",
|
|
59
|
+
"@aopslabs/artifact-trust-contracts": "0.3.0",
|
|
60
|
+
"@aopslabs/cli-kit": "0.1.0",
|
|
58
61
|
"@aopslabs/aops-host-registration": "0.2.0",
|
|
59
62
|
"@aopslabs/aops-pg-bootstrap": "0.2.0",
|
|
60
63
|
"@aopslabs/aops-runtime-config": "0.2.0",
|