@aopslabs/aops 0.2.0
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 +19 -0
- package/NOTICE +7 -0
- package/README.md +203 -0
- package/assets/agent-assets/core/SKILL.md +49 -0
- package/assets/agent-assets/core/references/agentspace/SKILL.md +78 -0
- package/assets/agent-assets/core/references/aops-cli-core/SKILL.md +108 -0
- package/assets/agent-assets/core/references/chatv3/SKILL.md +48 -0
- package/assets/agent-assets/core/references/collaborative-work/SKILL.md +85 -0
- package/assets/agent-assets/core/references/discuss/SKILL.md +66 -0
- package/assets/agent-assets/core/references/docman/SKILL.md +69 -0
- package/assets/agent-assets/core/references/hosted-chat/SKILL.md +64 -0
- package/assets/agent-assets/core/references/mission/SKILL.md +54 -0
- package/assets/agent-assets/core/references/projectman/SKILL.md +86 -0
- package/assets/agent-assets/core/references/sys/SKILL.md +36 -0
- package/assets/agent-assets/core/references/view/SKILL.md +58 -0
- package/assets/agent-assets/core/references/working-disciplines/SKILL.md +69 -0
- package/assets/agent-assets/core/user-guides/agent-assets.md +81 -0
- package/assets/agent-assets/core/user-guides/agentspace.md +1098 -0
- package/assets/agent-assets/core/user-guides/aops-cli.md +1107 -0
- package/assets/agent-assets/core/user-guides/aops-system.md +63 -0
- package/assets/agent-assets/core/user-guides/chatv3.md +113 -0
- package/assets/agent-assets/core/user-guides/docman.md +162 -0
- package/assets/agent-assets/core/user-guides/projectman.md +212 -0
- package/assets/agent-assets/core/user-guides/sys.md +94 -0
- package/assets/agent-assets/core/user-guides/working-disciplines.md +588 -0
- package/assets/agent-assets/gateway/aops/SKILL.md +14 -0
- package/assets/r6-remote-session-baseline.json +19 -0
- package/assets/skills/aops-install/SKILL.md +231 -0
- package/assets/skills/aops-install/agents/openai.yaml +4 -0
- package/dist/commands/activity.js +352 -0
- package/dist/commands/agent-profile.js +653 -0
- package/dist/commands/agent.js +710 -0
- package/dist/commands/agents-md.js +125 -0
- package/dist/commands/api.js +84 -0
- package/dist/commands/archive.js +873 -0
- package/dist/commands/artifact.js +535 -0
- package/dist/commands/assets.js +1414 -0
- package/dist/commands/auth/device-login.js +1 -0
- package/dist/commands/auth/legacy-export.js +177 -0
- package/dist/commands/auth/login.js +426 -0
- package/dist/commands/chat.js +1363 -0
- package/dist/commands/chatv3.js +1684 -0
- package/dist/commands/checkpoint.js +549 -0
- package/dist/commands/commercial-artifact.js +475 -0
- package/dist/commands/commercial-license.js +594 -0
- package/dist/commands/community-auth.js +62 -0
- package/dist/commands/community-cockpit.js +185 -0
- package/dist/commands/community-console.js +109 -0
- package/dist/commands/community-doctor.js +335 -0
- package/dist/commands/community-server.js +2062 -0
- package/dist/commands/community-setup.js +284 -0
- package/dist/commands/discuss.js +1448 -0
- package/dist/commands/doc.js +5219 -0
- package/dist/commands/experience.js +922 -0
- package/dist/commands/host.js +1127 -0
- package/dist/commands/init.js +118 -0
- package/dist/commands/memory.js +3129 -0
- package/dist/commands/mission.js +562 -0
- package/dist/commands/official-catalog.js +134 -0
- package/dist/commands/plan.js +84 -0
- package/dist/commands/playbook.js +415 -0
- package/dist/commands/pm/context.js +6 -0
- package/dist/commands/pm/index.js +701 -0
- package/dist/commands/pm/projectman.js +6266 -0
- package/dist/commands/project.js +1080 -0
- package/dist/commands/prompt.js +1024 -0
- package/dist/commands/repo-sync.js +1907 -0
- package/dist/commands/resource.js +527 -0
- package/dist/commands/skill.js +1211 -0
- package/dist/commands/start-disciplines.js +510 -0
- package/dist/commands/start.js +1343 -0
- package/dist/commands/target.js +309 -0
- package/dist/commands/version.js +42 -0
- package/dist/commands/view.js +1852 -0
- package/dist/launchers/cockpit.js +28 -0
- package/dist/launchers/options.js +74 -0
- package/dist/launchers/server.js +41 -0
- package/dist/lib/agent-assets/envelope.js +83 -0
- package/dist/lib/agent-assets/gateway.js +15 -0
- package/dist/lib/agent-assets/guards.js +23 -0
- package/dist/lib/agent-assets/hosted-discovery.js +148 -0
- package/dist/lib/agent-assets/hosted-package-input.js +154 -0
- package/dist/lib/agent-assets/legacy-pointer-migration.js +677 -0
- package/dist/lib/agent-assets/native-fs.js +589 -0
- package/dist/lib/agent-assets/package-manifest.js +324 -0
- package/dist/lib/agent-assets/portable-path.js +67 -0
- package/dist/lib/agent-assets/release-input.js +177 -0
- package/dist/lib/agent-assets/roots.js +45 -0
- package/dist/lib/agent-assets/runtime-binding-reader.js +545 -0
- package/dist/lib/agent-assets/runtime-targets.js +50 -0
- package/dist/lib/agent-assets/store-reader.js +1212 -0
- package/dist/lib/agent-assets/store-types.js +1 -0
- package/dist/lib/agent-assets/store-writer.js +1484 -0
- package/dist/lib/agent-assets/types.js +1 -0
- package/dist/lib/agent-assets/unicode-case-folding-v15-1.generated.js +1548 -0
- package/dist/lib/commercial-final-readiness.js +504 -0
- package/dist/lib/commercial-lifecycle-smoke-isolation.js +236 -0
- package/dist/lib/commercial-managed-postgres-docker-adapter.js +274 -0
- package/dist/lib/commercial-setup-readiness-adapter.js +179 -0
- package/dist/lib/community-client-contract.js +164 -0
- package/dist/lib/community-cockpit-lifecycle.js +601 -0
- package/dist/lib/community-command-abort.js +59 -0
- package/dist/lib/community-diagnostic.js +237 -0
- package/dist/lib/community-docker-adapter.js +498 -0
- package/dist/lib/community-home.js +31 -0
- package/dist/lib/community-instance-contract.js +148 -0
- package/dist/lib/community-instance-layout.js +97 -0
- package/dist/lib/community-lifecycle.js +1631 -0
- package/dist/lib/community-migration-snapshot.js +770 -0
- package/dist/lib/community-native-application-recovery.js +425 -0
- package/dist/lib/community-native-child.js +240 -0
- package/dist/lib/community-native-database-recovery.js +456 -0
- package/dist/lib/community-native-lifecycle.js +2458 -0
- package/dist/lib/community-native-migration.js +339 -0
- package/dist/lib/community-native-postgres.js +596 -0
- package/dist/lib/community-operation-journal.js +773 -0
- package/dist/lib/community-operation-lock.js +596 -0
- package/dist/lib/community-release-resolver.js +291 -0
- package/dist/lib/community-release-verifier.js +475 -0
- package/dist/lib/community-repo-discovery.js +252 -0
- package/dist/lib/community-setup-server-env.js +203 -0
- package/dist/lib/external-url.js +110 -0
- package/dist/lib/official-catalog-gateway.js +108 -0
- package/dist/lib/official-catalog.js +364 -0
- package/dist/lib/server-bootstrap.js +240 -0
- package/dist/lib/setup-agent-assets-bridge.js +176 -0
- package/dist/lib/setup-agent-assets-release.js +52 -0
- package/dist/lib/setup-external-postgres.js +108 -0
- package/dist/lib/setup-init-orchestrator.js +990 -0
- package/dist/lib/setup-install-guide.js +52 -0
- package/dist/lib/setup-installer-release.js +47 -0
- package/dist/lib/setup-local-postgres.js +329 -0
- package/dist/lib/setup-official-catalog-bridge.js +148 -0
- package/dist/lib/setup-readiness.js +888 -0
- package/dist/lib/tui-launcher.js +59 -0
- package/dist/main.js +150 -0
- package/dist/seeds/agents-md.js +54 -0
- package/dist/utils/agent-gateway.js +275 -0
- package/dist/utils/agents-md.js +281 -0
- package/dist/utils/api.js +255 -0
- package/dist/utils/chatv3-session-store.js +185 -0
- package/dist/utils/command.js +67 -0
- package/dist/utils/community-host-runtime.js +376 -0
- package/dist/utils/config.js +1015 -0
- package/dist/utils/discussion-workspace.js +552 -0
- package/dist/utils/experience-workspace.js +326 -0
- package/dist/utils/guide-paths.js +67 -0
- package/dist/utils/hosted-sugar.js +56 -0
- package/dist/utils/hosted-workspace.js +229 -0
- package/dist/utils/memory-workspace.js +537 -0
- package/dist/utils/operator-runtime.js +199 -0
- package/dist/utils/password-crypto.js +39 -0
- package/dist/utils/playbook-workspace.js +479 -0
- package/dist/utils/project-context.js +255 -0
- package/dist/utils/prompts.js +70 -0
- package/dist/utils/refresh-race.js +28 -0
- package/dist/utils/repo-config.js +109 -0
- package/dist/utils/repo-first-projectman.js +194 -0
- package/dist/utils/repo-first-storage.js +13 -0
- package/dist/utils/repo-first-view.js +305 -0
- package/dist/utils/session-guidance.js +278 -0
- package/dist/utils/session-state.js +137 -0
- package/dist/utils/table.js +39 -0
- package/dist/utils/transient-fs.js +49 -0
- package/dist/utils/workspace-root.js +1 -0
- package/launchers/aops-cockpit.ps1 +15 -0
- package/launchers/aops-cockpit.sh +16 -0
- package/launchers/aops-server.ps1 +15 -0
- package/launchers/aops-server.sh +16 -0
- package/native/tui/win32-x64/aops-tui.exe +0 -0
- package/package.json +81 -0
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import fs from 'node:fs/promises';
|
|
2
|
+
import { existsSync } from 'node:fs';
|
|
3
|
+
import path from 'node:path';
|
|
4
|
+
import { Command } from 'commander';
|
|
5
|
+
import { banner, logError, logInfo, logSuccess, logWarn } from '@aopslabs/xf-cli-ui';
|
|
6
|
+
import { findWorkspaceRoot } from '../utils/workspace-root.js';
|
|
7
|
+
import { promptConfirm, promptInput } from '../utils/prompts.js';
|
|
8
|
+
import { buildAopsRepoConfig } from '../utils/repo-config.js';
|
|
9
|
+
function nonEmpty(value) {
|
|
10
|
+
if (typeof value !== 'string')
|
|
11
|
+
return undefined;
|
|
12
|
+
const normalized = value.trim();
|
|
13
|
+
return normalized || undefined;
|
|
14
|
+
}
|
|
15
|
+
async function readJsonFile(filePath) {
|
|
16
|
+
try {
|
|
17
|
+
return JSON.parse(await fs.readFile(filePath, 'utf8'));
|
|
18
|
+
}
|
|
19
|
+
catch {
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
function communityInitSection() {
|
|
24
|
+
return `#INIT
|
|
25
|
+
|
|
26
|
+
This section is generated by AOPS Community.
|
|
27
|
+
|
|
28
|
+
Server-first model:
|
|
29
|
+
- The local AOPS server is canonical for Projectman, Agentspace, and Docman writes.
|
|
30
|
+
- .aops/aops.config.json stores repo metadata; hosted mirror and planning views under .aops are read-only caches.
|
|
31
|
+
- Use aops-cli agent tools for capability discovery and aops-cli host health for readiness.
|
|
32
|
+
- ChatV3 runs self-hosted/local-trusted in this distribution.
|
|
33
|
+
`;
|
|
34
|
+
}
|
|
35
|
+
async function writeCommunityAgentsSection(rootDir) {
|
|
36
|
+
const filePath = path.join(rootDir, 'AGENTS.md');
|
|
37
|
+
const section = `${communityInitSection().trimEnd()}\n\n`;
|
|
38
|
+
const current = existsSync(filePath) ? await fs.readFile(filePath, 'utf8') : '';
|
|
39
|
+
const match = current.match(/^#\s*INIT\b.*$/im);
|
|
40
|
+
let remainder = current;
|
|
41
|
+
if (match?.index !== undefined) {
|
|
42
|
+
const afterHeader = match.index + match[0].length;
|
|
43
|
+
const nextHeader = current.slice(afterHeader).match(/^\s*#(?!\s*INIT\b)/m);
|
|
44
|
+
const end = nextHeader?.index === undefined ? current.length : afterHeader + nextHeader.index;
|
|
45
|
+
remainder = `${current.slice(0, match.index)}${current.slice(end)}`;
|
|
46
|
+
}
|
|
47
|
+
await fs.writeFile(filePath, `${section}${remainder.trimStart()}`.trimEnd() + '\n', 'utf8');
|
|
48
|
+
}
|
|
49
|
+
export async function runInit(options = {}) {
|
|
50
|
+
const startDir = process.cwd();
|
|
51
|
+
const rootDir = options.root ? path.resolve(startDir, options.root) : findWorkspaceRoot(startDir);
|
|
52
|
+
const configPath = path.join(rootDir, '.aops', 'aops.config.json');
|
|
53
|
+
const interactive = options.yes !== true && options.json !== true;
|
|
54
|
+
const existingConfig = existsSync(configPath) ? await readJsonFile(configPath) : null;
|
|
55
|
+
if (interactive)
|
|
56
|
+
banner('AOPS Community Init');
|
|
57
|
+
if (existsSync(configPath) && options.force !== true) {
|
|
58
|
+
const overwrite = interactive
|
|
59
|
+
? await promptConfirm({ message: `${configPath} exists. Overwrite?`, default: false })
|
|
60
|
+
: false;
|
|
61
|
+
if (!overwrite) {
|
|
62
|
+
logError('aops.config.json already exists. Use --force to overwrite.');
|
|
63
|
+
process.exitCode = 1;
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
const existingRepoName = nonEmpty(existingConfig?.repo?.name);
|
|
68
|
+
let repoName = nonEmpty(options.repoName);
|
|
69
|
+
const fallbackRepoName = path.basename(rootDir);
|
|
70
|
+
if (!repoName && interactive) {
|
|
71
|
+
repoName = nonEmpty(await promptInput({ message: 'Repository name:', default: existingRepoName ?? fallbackRepoName }));
|
|
72
|
+
}
|
|
73
|
+
repoName ??= existingRepoName ?? fallbackRepoName;
|
|
74
|
+
if (!repoName) {
|
|
75
|
+
logError('Repository name is required.');
|
|
76
|
+
process.exitCode = 1;
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
const existingProjectName = nonEmpty(existingConfig?.activeProjectName)
|
|
80
|
+
?? nonEmpty(existingConfig?.projects?.[0]?.name);
|
|
81
|
+
const existingProjectSlug = nonEmpty(existingConfig?.projects?.[0]?.slug);
|
|
82
|
+
const existingProjectId = nonEmpty(existingConfig?.projects?.[0]?.projectId);
|
|
83
|
+
const projectName = nonEmpty(options.projectName) ?? existingProjectName ?? repoName;
|
|
84
|
+
const projectSlug = nonEmpty(options.projectSlug) ?? existingProjectSlug;
|
|
85
|
+
const projectId = nonEmpty(options.projectId) ?? existingProjectId ?? projectName;
|
|
86
|
+
const config = buildAopsRepoConfig({ repoName, projectName, projectSlug, projectId });
|
|
87
|
+
await fs.mkdir(path.dirname(configPath), { recursive: true });
|
|
88
|
+
await fs.writeFile(configPath, `${JSON.stringify(config, null, 2)}\n`, 'utf8');
|
|
89
|
+
if (options.agentsMd !== false) {
|
|
90
|
+
try {
|
|
91
|
+
await writeCommunityAgentsSection(rootDir);
|
|
92
|
+
}
|
|
93
|
+
catch (error) {
|
|
94
|
+
logWarn(`Failed to update AGENTS.md: ${error instanceof Error ? error.message : String(error)}`);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
if (options.json) {
|
|
98
|
+
console.log(JSON.stringify(config, null, 2));
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
logSuccess(`Created ${configPath}`);
|
|
102
|
+
logInfo('Next: start the packaged AOPS Community runtime, then run `aops-cli host health`.');
|
|
103
|
+
}
|
|
104
|
+
export function makeInitCommand() {
|
|
105
|
+
const command = new Command('init').description('Initialize repo-local AOPS Community metadata (.aops)');
|
|
106
|
+
command
|
|
107
|
+
.option('--root <path>', 'Workspace root override')
|
|
108
|
+
.option('--repo-name <name>', 'Repository display name')
|
|
109
|
+
.option('--project-name <name>', 'Project name')
|
|
110
|
+
.option('--project-slug <text>', 'Project slug to persist')
|
|
111
|
+
.option('--project-id <id>', 'Project id')
|
|
112
|
+
.option('--force', 'Overwrite existing aops.config.json')
|
|
113
|
+
.option('--no-agents-md', 'Skip AGENTS.md #INIT update')
|
|
114
|
+
.option('--yes', 'Use defaults and skip prompts')
|
|
115
|
+
.option('--json', 'Output JSON only')
|
|
116
|
+
.action(async (options) => runInit(options));
|
|
117
|
+
return command;
|
|
118
|
+
}
|