@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,125 @@
|
|
|
1
|
+
import path from 'node:path';
|
|
2
|
+
import { Command } from 'commander';
|
|
3
|
+
import { logInfo, logSuccess, logWarn } from '@aopslabs/xf-cli-ui';
|
|
4
|
+
import { resetAgentsMdFile, updateAgentsMdFile, } from '../utils/agents-md.js';
|
|
5
|
+
function serializableUpdateResult(result) {
|
|
6
|
+
return {
|
|
7
|
+
action: result.action,
|
|
8
|
+
rootDir: result.rootDir,
|
|
9
|
+
filePath: result.filePath,
|
|
10
|
+
changed: result.changed,
|
|
11
|
+
selectedTemplates: result.selectedTemplates.map((seed) => ({
|
|
12
|
+
slug: seed.slug,
|
|
13
|
+
title: seed.title,
|
|
14
|
+
mirrorPath: seed.mirrorPath,
|
|
15
|
+
promptRef: seed.promptRef,
|
|
16
|
+
})),
|
|
17
|
+
warnings: result.warnings,
|
|
18
|
+
syncHosted: result.syncHosted,
|
|
19
|
+
content: result.content,
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
function serializableResetResult(result) {
|
|
23
|
+
return {
|
|
24
|
+
action: result.action,
|
|
25
|
+
rootDir: result.rootDir,
|
|
26
|
+
filePath: result.filePath,
|
|
27
|
+
changed: result.changed,
|
|
28
|
+
warnings: result.warnings,
|
|
29
|
+
content: result.content,
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
function printWarnings(warnings) {
|
|
33
|
+
warnings.forEach((warning) => logWarn(warning));
|
|
34
|
+
}
|
|
35
|
+
export async function runAgentsMdUpdate(options = {}) {
|
|
36
|
+
const result = await updateAgentsMdFile(options);
|
|
37
|
+
if (options.json) {
|
|
38
|
+
console.log(JSON.stringify({
|
|
39
|
+
command: 'agents-md.update',
|
|
40
|
+
result: serializableUpdateResult(result),
|
|
41
|
+
}, null, 2));
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
printWarnings(result.warnings);
|
|
45
|
+
if (options.preview) {
|
|
46
|
+
logInfo(`Preview for ${path.relative(result.rootDir, result.filePath) || result.filePath}`);
|
|
47
|
+
process.stdout.write(result.content ?? '');
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
logSuccess(`${result.changed ? 'Updated' : 'Checked'} ${result.filePath}`);
|
|
51
|
+
logInfo(`Templates: ${result.selectedTemplates.map((seed) => seed.slug).join(', ')}`);
|
|
52
|
+
if (result.syncHosted)
|
|
53
|
+
logInfo(`Refreshed hosted mirrors with: ${result.syncHosted.command}`);
|
|
54
|
+
}
|
|
55
|
+
export async function runAgentsMdPreview(options = {}) {
|
|
56
|
+
await runAgentsMdUpdate({ ...options, preview: true, apply: false, syncHosted: false });
|
|
57
|
+
}
|
|
58
|
+
export async function runAgentsMdReset(options = {}) {
|
|
59
|
+
const result = await resetAgentsMdFile(options);
|
|
60
|
+
if (options.json) {
|
|
61
|
+
console.log(JSON.stringify({
|
|
62
|
+
command: 'agents-md.reset',
|
|
63
|
+
result: serializableResetResult(result),
|
|
64
|
+
}, null, 2));
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
printWarnings(result.warnings);
|
|
68
|
+
if (options.preview) {
|
|
69
|
+
logInfo(`Reset preview for ${path.relative(result.rootDir, result.filePath) || result.filePath}`);
|
|
70
|
+
process.stdout.write(result.content ?? '');
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
logSuccess(`${result.changed ? 'Removed managed block from' : 'No managed block found in'} ${result.filePath}`);
|
|
74
|
+
}
|
|
75
|
+
function addTemplateSelectionOptions(cmd) {
|
|
76
|
+
return cmd
|
|
77
|
+
.option('--root <path>', 'Workspace root override (default: nearest package.json ancestor)')
|
|
78
|
+
.option('--discuss', 'Also include the standalone discuss / decision-ritual template (aops-cli-discuss skill)')
|
|
79
|
+
.option('--all', 'Include all bundled AOPS AGENTS.md prompt template snippets')
|
|
80
|
+
.option('--no-default-task', 'Do not include the default starter template (aops-collaborative-startup)')
|
|
81
|
+
.option('--embed-prompts', 'Embed prompt bodies from local hosted mirrors when available')
|
|
82
|
+
.option('--json', 'Output JSON only');
|
|
83
|
+
}
|
|
84
|
+
export function makeAgentsMdCommand() {
|
|
85
|
+
const cmd = new Command('agents-md').description('Manage AOPS prompt-template bootstrap blocks in AGENTS.md');
|
|
86
|
+
cmd.addCommand(addTemplateSelectionOptions(new Command('update')
|
|
87
|
+
.description('Insert or replace the managed AOPS AGENTS.md prompt-template block')
|
|
88
|
+
.option('--preview', 'Print the merged AGENTS.md content without writing')
|
|
89
|
+
.option('--apply', 'Write the merged AGENTS.md content')
|
|
90
|
+
.option('--sync-hosted', 'Refresh hosted prompt/skill mirrors before rendering'))
|
|
91
|
+
.action(async (options) => {
|
|
92
|
+
await runAgentsMdUpdate(options);
|
|
93
|
+
})
|
|
94
|
+
.addHelpText('after', `
|
|
95
|
+
Examples:
|
|
96
|
+
aops-cli agents-md update --apply
|
|
97
|
+
aops-cli agents-md update --discuss --apply
|
|
98
|
+
aops-cli agents-md update --sync-hosted --apply
|
|
99
|
+
`));
|
|
100
|
+
cmd.addCommand(addTemplateSelectionOptions(new Command('preview').description('Print merged AGENTS.md content without writing'))
|
|
101
|
+
.action(async (options) => {
|
|
102
|
+
await runAgentsMdPreview(options);
|
|
103
|
+
})
|
|
104
|
+
.addHelpText('after', `
|
|
105
|
+
Examples:
|
|
106
|
+
aops-cli agents-md preview
|
|
107
|
+
aops-cli agents-md preview --discuss --json
|
|
108
|
+
`));
|
|
109
|
+
cmd.addCommand(new Command('reset')
|
|
110
|
+
.description('Remove the managed AOPS AGENTS.md prompt-template block')
|
|
111
|
+
.option('--root <path>', 'Workspace root override (default: nearest package.json ancestor)')
|
|
112
|
+
.option('--preview', 'Print the resulting AGENTS.md content without writing')
|
|
113
|
+
.option('--apply', 'Write the resulting AGENTS.md content')
|
|
114
|
+
.option('--confirm', 'Confirm removal of the managed block')
|
|
115
|
+
.option('--json', 'Output JSON only')
|
|
116
|
+
.action(async (options) => {
|
|
117
|
+
await runAgentsMdReset(options);
|
|
118
|
+
})
|
|
119
|
+
.addHelpText('after', `
|
|
120
|
+
Examples:
|
|
121
|
+
aops-cli agents-md reset --preview
|
|
122
|
+
aops-cli agents-md reset --apply --confirm
|
|
123
|
+
`));
|
|
124
|
+
return cmd;
|
|
125
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { Command } from 'commander';
|
|
2
|
+
import { banner, logError, logInfo, logSuccess } from '@aopslabs/xf-cli-ui';
|
|
3
|
+
import { appendQueryToPath, buildDomainApiPath, parseJsonInput, } from '../utils/operator-runtime.js';
|
|
4
|
+
import { applyCommonOptions, normalizeNonEmpty, } from '../utils/command.js';
|
|
5
|
+
import { buildAgentContextHeaders, requireApiState } from '../utils/agent-gateway.js';
|
|
6
|
+
import { promptInput } from '../utils/prompts.js';
|
|
7
|
+
export async function runApiCall(options = {}) {
|
|
8
|
+
const interactive = !options.yes && !options.json;
|
|
9
|
+
const apiState = await requireApiState(options);
|
|
10
|
+
if (!apiState)
|
|
11
|
+
return;
|
|
12
|
+
let domain = normalizeNonEmpty(options.domain);
|
|
13
|
+
if (!domain && interactive) {
|
|
14
|
+
domain = normalizeNonEmpty(await promptInput({ message: 'Domain (e.g. docman):' }));
|
|
15
|
+
}
|
|
16
|
+
if (!domain) {
|
|
17
|
+
logError('Missing domain. Provide --domain <id>.');
|
|
18
|
+
process.exitCode = 1;
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
const method = (normalizeNonEmpty(options.method) ?? 'GET').toUpperCase();
|
|
22
|
+
let body;
|
|
23
|
+
let query;
|
|
24
|
+
let headers;
|
|
25
|
+
try {
|
|
26
|
+
body = parseJsonInput(options.body, 'body');
|
|
27
|
+
query = parseJsonInput(options.query, 'query');
|
|
28
|
+
headers = await buildAgentContextHeaders(options);
|
|
29
|
+
}
|
|
30
|
+
catch (error) {
|
|
31
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
32
|
+
logError(message);
|
|
33
|
+
process.exitCode = 1;
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
const path = appendQueryToPath(buildDomainApiPath(domain, options.path), query);
|
|
37
|
+
if (interactive) {
|
|
38
|
+
banner('AOPS Domain API');
|
|
39
|
+
logInfo(`API: ${apiState.baseUrl}`);
|
|
40
|
+
logInfo(`${method} ${path}`);
|
|
41
|
+
}
|
|
42
|
+
try {
|
|
43
|
+
const payload = await apiState.client.fetchJson(path, {
|
|
44
|
+
method,
|
|
45
|
+
body: method === 'GET' || method === 'HEAD' ? undefined : body,
|
|
46
|
+
headers,
|
|
47
|
+
timeoutMs: options.timeoutMs,
|
|
48
|
+
});
|
|
49
|
+
if (!options.json)
|
|
50
|
+
logSuccess(`${method} ${path} -> ok`);
|
|
51
|
+
console.log(JSON.stringify(payload, null, 2));
|
|
52
|
+
}
|
|
53
|
+
catch (error) {
|
|
54
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
55
|
+
logError(`Domain API call failed: ${message}`);
|
|
56
|
+
process.exitCode = 1;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
export function makeApiCommand() {
|
|
60
|
+
const cmd = new Command('api').description('Direct domain API escape hatch (/api/{domain}/...)');
|
|
61
|
+
applyCommonOptions(cmd
|
|
62
|
+
.command('call')
|
|
63
|
+
.description('Call direct domain route via dynamic host router (escape hatch, not primary tool plane)')
|
|
64
|
+
.option('--domain <id>', 'Domain id (e.g. docman)')
|
|
65
|
+
.option('--path <route>', 'Route path under domain (e.g. documents/123)')
|
|
66
|
+
.option('--method <method>', 'HTTP method (GET|POST|PUT|PATCH|DELETE)', 'GET')
|
|
67
|
+
.option('--query <json>', 'Query params JSON or @file.json')
|
|
68
|
+
.option('--body <json>', 'Body JSON or @file.json')
|
|
69
|
+
.option('--project-id <id>', 'Project id header (x-project-id)')
|
|
70
|
+
.option('--project-name <name>', 'Project name header (x-project-name)')
|
|
71
|
+
.option('--tenant-id <id>', 'Tenant id header (x-tenant-id)')
|
|
72
|
+
.option('--locale <locale>', 'Locale header (x-locale)')
|
|
73
|
+
.option('--fallback-locale <locale>', 'Fallback locale header (x-fallback-locale)')
|
|
74
|
+
.action(async (options) => {
|
|
75
|
+
await runApiCall(options);
|
|
76
|
+
}), { withProject: false });
|
|
77
|
+
cmd.addHelpText('after', `
|
|
78
|
+
Examples:
|
|
79
|
+
aops-cli api call --domain docman --path documents --method GET --project-id <project-id>
|
|
80
|
+
aops-cli api call --domain docman --path documents --method GET --scope-id <scope-id>
|
|
81
|
+
aops-cli api call --domain projectman --path kanban/boards --method POST --body @./payload.json
|
|
82
|
+
`);
|
|
83
|
+
return cmd;
|
|
84
|
+
}
|