@aopslabs/aops-server 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 +28 -0
- package/THIRD_PARTY_NOTICES +13409 -0
- package/THIRD_PARTY_NOTICES.inventory.json +2768 -0
- package/build/client/_app/immutable/chunks/2_TffmqH.js +1 -0
- package/build/client/_app/immutable/chunks/3DOfIKW0.js +1 -0
- package/build/client/_app/immutable/chunks/B2EkC-sy.js +1 -0
- package/build/client/_app/immutable/chunks/BlANKL2r.js +1 -0
- package/build/client/_app/immutable/chunks/CMkIcmi1.js +2 -0
- package/build/client/_app/immutable/chunks/rqnVXeyB.js +1 -0
- package/build/client/_app/immutable/chunks/wbPk3Yxo.js +81 -0
- package/build/client/_app/immutable/entry/app.a0iGCm6X.js +2 -0
- package/build/client/_app/immutable/entry/start.Df7u6fQ1.js +1 -0
- package/build/client/_app/immutable/nodes/0.BYBfjxZ5.js +1 -0
- package/build/client/_app/immutable/nodes/1.BtbjYUHR.js +1 -0
- package/build/client/_app/version.json +1 -0
- package/build/env.js +69 -0
- package/build/handler.js +15 -0
- package/build/index.js +138 -0
- package/build/server/chunks/0-RfB6m2nq.js +6 -0
- package/build/server/chunks/1-UJuUicIe.js +8 -0
- package/build/server/chunks/_server.ts-6bdzoHJH.js +83 -0
- package/build/server/chunks/_server.ts-AwMeEYiZ.js +9 -0
- package/build/server/chunks/_server.ts-B9gjXi95.js +260 -0
- package/build/server/chunks/_server.ts-BX4X0tW0.js +16 -0
- package/build/server/chunks/_server.ts-BkxSxdd0.js +172 -0
- package/build/server/chunks/_server.ts-Bly8fCZa.js +90 -0
- package/build/server/chunks/_server.ts-Bz-Erv-1.js +43 -0
- package/build/server/chunks/_server.ts-CRKd0KAC.js +43 -0
- package/build/server/chunks/_server.ts-CjzSQgpk.js +95 -0
- package/build/server/chunks/_server.ts-Cv-yaXZI.js +6 -0
- package/build/server/chunks/_server.ts-DQWRrk5C.js +14 -0
- package/build/server/chunks/_server.ts-DQzYSH_C.js +125 -0
- package/build/server/chunks/_server.ts-DaIr3NkR.js +10 -0
- package/build/server/chunks/_server.ts-DbdAfdYo.js +8 -0
- package/build/server/chunks/_server.ts-De9ZrSV0.js +84 -0
- package/build/server/chunks/_server.ts-DsTeOL2P.js +17 -0
- package/build/server/chunks/_server.ts-N61POKjl.js +84 -0
- package/build/server/chunks/_server.ts-Ua5Ieisy.js +37 -0
- package/build/server/chunks/_server.ts-XmKDT59M.js +37 -0
- package/build/server/chunks/_server.ts-o9pJceJP.js +54 -0
- package/build/server/chunks/_server.ts-u2UWBqNN.js +276 -0
- package/build/server/chunks/admission-snapshot-C2wGfTWE.js +1034 -0
- package/build/server/chunks/agent-gateway-runtime-C7Kvvy0H.js +2614 -0
- package/build/server/chunks/aops-runtime-config-CHpDUCdE.js +185 -0
- package/build/server/chunks/auth-provider-C07OUlnz.js +18 -0
- package/build/server/chunks/canonical-text-order-DbXJJnFD.js +5 -0
- package/build/server/chunks/commercial-admission-loader-V_vXHdVa.js +2077 -0
- package/build/server/chunks/discovery-BvDEgiqC.js +897 -0
- package/build/server/chunks/error.svelte-B9R6O_Hn.js +44 -0
- package/build/server/chunks/handler-DurXhqww.js +1472 -0
- package/build/server/chunks/hooks.server-DYGrWbgh.js +62 -0
- package/build/server/chunks/index.js-BQnOaW3H.js +11573 -0
- package/build/server/chunks/manifest.js-CCJDdahY.js +180 -0
- package/build/server/chunks/plugin-error-normalize-DNeRsopQ.js +309 -0
- package/build/server/chunks/project-alias-BdnRxWft.js +28 -0
- package/build/server/chunks/registry-DO8ob5o1.js +660 -0
- package/build/server/chunks/request-base-url-zKJpVUv5.js +35 -0
- package/build/server/chunks/request-context-9wzBoKrz.js +421 -0
- package/build/server/chunks/xf-result-BRDjvftr.js +16 -0
- package/build/shims.js +32 -0
- package/cockpit/.vite/manifest.json +198 -0
- package/cockpit/assets/dm-sans-latin-400-normal-BwCSEQnW.woff +0 -0
- package/cockpit/assets/dm-sans-latin-400-normal-CW0RaeGs.woff2 +0 -0
- package/cockpit/assets/dm-sans-latin-500-normal-B9HHJjqV.woff2 +0 -0
- package/cockpit/assets/dm-sans-latin-500-normal-Dr3UlScf.woff +0 -0
- package/cockpit/assets/dm-sans-latin-700-normal-CUSSCpQX.woff +0 -0
- package/cockpit/assets/dm-sans-latin-700-normal-DvUfVpUG.woff2 +0 -0
- package/cockpit/assets/dm-sans-latin-ext-400-normal-BjWJ59Pq.woff +0 -0
- package/cockpit/assets/dm-sans-latin-ext-400-normal-BtiwyxMk.woff2 +0 -0
- package/cockpit/assets/dm-sans-latin-ext-500-normal-BJfUCQsA.woff2 +0 -0
- package/cockpit/assets/dm-sans-latin-ext-500-normal-DR84L5F-.woff +0 -0
- package/cockpit/assets/dm-sans-latin-ext-700-normal-BLI3TTWz.woff +0 -0
- package/cockpit/assets/dm-sans-latin-ext-700-normal-CJIcxD6K.woff2 +0 -0
- package/cockpit/assets/index-CkhZWZ2f.js +18 -0
- package/cockpit/assets/index-TSfC5rf2.css +1 -0
- package/cockpit/assets/jetbrains-mono-cyrillic-400-normal-BEIGL1Tu.woff2 +0 -0
- package/cockpit/assets/jetbrains-mono-cyrillic-400-normal-ugxPyKxw.woff +0 -0
- package/cockpit/assets/jetbrains-mono-greek-400-normal-B9oWc5Lo.woff +0 -0
- package/cockpit/assets/jetbrains-mono-greek-400-normal-C190GLew.woff2 +0 -0
- package/cockpit/assets/jetbrains-mono-latin-400-normal-6-qcROiO.woff +0 -0
- package/cockpit/assets/jetbrains-mono-latin-400-normal-V6pRDFza.woff2 +0 -0
- package/cockpit/assets/jetbrains-mono-latin-ext-400-normal-Bc8Ftmh3.woff2 +0 -0
- package/cockpit/assets/jetbrains-mono-latin-ext-400-normal-fXTG6kC5.woff +0 -0
- package/cockpit/assets/jetbrains-mono-vietnamese-400-normal-CqNFfHCs.woff +0 -0
- package/cockpit/assets/outfit-latin-400-normal-BGsTXAXT.woff2 +0 -0
- package/cockpit/assets/outfit-latin-400-normal-DMwTpYkH.woff +0 -0
- package/cockpit/assets/outfit-latin-600-normal-B7SfZ07L.woff2 +0 -0
- package/cockpit/assets/outfit-latin-600-normal-BEfTtDA7.woff +0 -0
- package/cockpit/assets/outfit-latin-ext-400-normal-5tcqmc2S.woff2 +0 -0
- package/cockpit/assets/outfit-latin-ext-400-normal-DHm7mdGe.woff +0 -0
- package/cockpit/assets/outfit-latin-ext-600-normal-B85nYjL1.woff2 +0 -0
- package/cockpit/assets/outfit-latin-ext-600-normal-CWJcPgd7.woff +0 -0
- package/cockpit/assets/unbounded-cyrillic-600-normal-B-s5c2Kn.woff +0 -0
- package/cockpit/assets/unbounded-cyrillic-600-normal-DW6uzIMB.woff2 +0 -0
- package/cockpit/assets/unbounded-latin-600-normal-BPdB_PEv.woff +0 -0
- package/cockpit/assets/unbounded-latin-600-normal-oRSANpZr.woff2 +0 -0
- package/cockpit/assets/unbounded-latin-ext-600-normal-0iZLtTDV.woff2 +0 -0
- package/cockpit/assets/unbounded-latin-ext-600-normal-ClMPf-bu.woff +0 -0
- package/cockpit/assets/unbounded-vietnamese-600-normal-BzfrgZ_C.woff +0 -0
- package/cockpit/assets/unbounded-vietnamese-600-normal-Cx2bTSHN.woff2 +0 -0
- package/cockpit/community.module-inventory.json +2439 -0
- package/cockpit/index.html +14 -0
- package/community-postgres.json +13 -0
- package/migrations/agentspace/0000_thin_carlie_cooper.sql +764 -0
- package/migrations/agentspace/meta/_journal.json +13 -0
- package/migrations/chatv3/0000_dry_ego.sql +218 -0
- package/migrations/chatv3/0001_nosy_obadiah_stane.sql +35 -0
- package/migrations/chatv3/0002_narrow_darkhawk.sql +4 -0
- package/migrations/chatv3/0003_damp_zarek.sql +2 -0
- package/migrations/chatv3/0004_nervous_martin_li.sql +60 -0
- package/migrations/chatv3/0005_chatv3_server_encrypted_mode.sql +1 -0
- package/migrations/chatv3/0006_chatv3_database_server_keyring.sql +21 -0
- package/migrations/chatv3/meta/_journal.json +55 -0
- package/migrations/docman/0000_curvy_valeria_richards.sql +257 -0
- package/migrations/docman/0001_massive_risque.sql +2 -0
- package/migrations/docman/0002_simple_logan.sql +50 -0
- package/migrations/docman/0003_quick_index.sql +45 -0
- package/migrations/docman/0004_known_summary.sql +9 -0
- package/migrations/docman/0005_vector_signal.sql +9 -0
- package/migrations/docman/0006_document_version_current_invariant.sql +15 -0
- package/migrations/docman/meta/_journal.json +55 -0
- package/migrations/projectman/0000_smooth_klaw.sql +257 -0
- package/migrations/projectman/0001_worthless_zodiak.sql +9 -0
- package/migrations/projectman/0002_board_rename.sql +108 -0
- package/migrations/projectman/0003_review_request.sql +62 -0
- package/migrations/projectman/0004_review_request_idempotency.sql +3 -0
- package/migrations/projectman/0005_allow_multi_sprint_per_task.sql +1 -0
- package/migrations/projectman/meta/_journal.json +48 -0
- package/migrations/sys/0000_loose_praxagora.sql +31 -0
- package/migrations/sys/0001_awesome_ronan.sql +2 -0
- package/migrations/sys/0002_steady_maximus.sql +2 -0
- package/migrations/sys/0003_escalating_rate_limiter.sql +2 -0
- package/migrations/sys/0004_rate_limiter_timestamptz.sql +22 -0
- package/migrations/sys/0005_sys_counters.sql +21 -0
- package/migrations/sys/meta/_journal.json +48 -0
- package/npm-shrinkwrap.json +5069 -0
- package/package.json +88 -0
- package/runtime/agentspace-host-adapter.mjs +64 -0
- package/runtime/agentspace-tooling.mjs +389 -0
- package/runtime/commercial-integrity-worker.mjs +1643 -0
- package/runtime/docman-host-adapter.mjs +177 -0
- package/runtime/docman-policy.mjs +450 -0
- package/runtime/docman-tooling.mjs +20 -0
- package/runtime/projectman-host-adapter.mjs +597 -0
- package/runtime/scope-context.mjs +99 -0
- package/runtime-closure.package.json +376 -0
- package/scripts/community-host.mjs +919 -0
- package/scripts/community-migration-policy-package-v1.json +11854 -0
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { j as json } from './index.js-BQnOaW3H.js';
|
|
2
|
+
import { g as getAgentGateway } from './agent-gateway-runtime-C7Kvvy0H.js';
|
|
3
|
+
import { b as buildAgentDiscoveryDocument } from './discovery-BvDEgiqC.js';
|
|
4
|
+
import { g as getHostConfig } from './registry-DO8ob5o1.js';
|
|
5
|
+
import { r as resolveRequestBaseUrl } from './request-base-url-zKJpVUv5.js';
|
|
6
|
+
import '@aopslabs/host-core';
|
|
7
|
+
import '@aopslabs/manifest';
|
|
8
|
+
import 'node:path';
|
|
9
|
+
import 'node:child_process';
|
|
10
|
+
import 'node:module';
|
|
11
|
+
import 'node:url';
|
|
12
|
+
import 'node:util';
|
|
13
|
+
import './project-alias-BdnRxWft.js';
|
|
14
|
+
import 'node:crypto';
|
|
15
|
+
import './canonical-text-order-DbXJJnFD.js';
|
|
16
|
+
import './admission-snapshot-C2wGfTWE.js';
|
|
17
|
+
import 'ajv';
|
|
18
|
+
import 'zod';
|
|
19
|
+
import './auth-provider-C07OUlnz.js';
|
|
20
|
+
import './aops-runtime-config-CHpDUCdE.js';
|
|
21
|
+
import 'node:fs';
|
|
22
|
+
import 'pg';
|
|
23
|
+
import 'node:worker_threads';
|
|
24
|
+
|
|
25
|
+
const AGENT_FLOW_OVERVIEW = {
|
|
26
|
+
version: "1.0",
|
|
27
|
+
appliesTo: "all-domains",
|
|
28
|
+
summary: "Use /api/agent/tools for tool orchestration; use /api/{domain}/... for direct domain routes.",
|
|
29
|
+
routes: {
|
|
30
|
+
agentCatalog: "/api/agent/tools",
|
|
31
|
+
agentInvoke: "/api/agent/tools/{toolId}/invoke",
|
|
32
|
+
domainApi: "/api/{domain}/..."
|
|
33
|
+
},
|
|
34
|
+
semantics: {
|
|
35
|
+
agentGateway: "Tool catalog + schema-aware invoke + local/remote source routing.",
|
|
36
|
+
domainApi: "Direct host domain router to plugin route projection."
|
|
37
|
+
},
|
|
38
|
+
ascii: {
|
|
39
|
+
agentInvoke: [
|
|
40
|
+
"client -> /api/agent/tools/{toolId}/invoke",
|
|
41
|
+
"-> agent gateway",
|
|
42
|
+
"-> local plugin route OR remote source",
|
|
43
|
+
"-> operation",
|
|
44
|
+
"-> response"
|
|
45
|
+
],
|
|
46
|
+
domainApi: [
|
|
47
|
+
"client -> /api/{domain}/...",
|
|
48
|
+
"-> host domain router",
|
|
49
|
+
"-> domain plugin route",
|
|
50
|
+
"-> operation",
|
|
51
|
+
"-> response"
|
|
52
|
+
]
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
const GET = async ({ request, url }) => {
|
|
56
|
+
try {
|
|
57
|
+
const domain = url.searchParams.get("domain")?.trim().toLowerCase();
|
|
58
|
+
const gateway = getAgentGateway();
|
|
59
|
+
const result = await gateway.listTools(domain);
|
|
60
|
+
const serverBaseUrl = resolveRequestBaseUrl(request, url);
|
|
61
|
+
const hostConfig = getHostConfig();
|
|
62
|
+
const discovery = buildAgentDiscoveryDocument({
|
|
63
|
+
listResult: result,
|
|
64
|
+
serverBaseUrl,
|
|
65
|
+
domain,
|
|
66
|
+
manifestProviders: hostConfig.agentGateway?.catalog?.manifestProviders
|
|
67
|
+
});
|
|
68
|
+
return json(
|
|
69
|
+
{
|
|
70
|
+
ok: true,
|
|
71
|
+
catalogVersion: result.catalogVersion,
|
|
72
|
+
generatedAt: result.generatedAt,
|
|
73
|
+
partial: result.errors.length > 0,
|
|
74
|
+
flow: AGENT_FLOW_OVERVIEW,
|
|
75
|
+
discovery: {
|
|
76
|
+
routes: discovery.routes,
|
|
77
|
+
auth: discovery.auth,
|
|
78
|
+
invoke: discovery.invoke,
|
|
79
|
+
provenance: discovery.provenance,
|
|
80
|
+
domains: discovery.domains,
|
|
81
|
+
taxonomy: discovery.taxonomy,
|
|
82
|
+
recommendations: discovery.recommendations
|
|
83
|
+
},
|
|
84
|
+
tools: result.tools,
|
|
85
|
+
errors: result.errors
|
|
86
|
+
},
|
|
87
|
+
{ status: 200 }
|
|
88
|
+
);
|
|
89
|
+
} catch (error) {
|
|
90
|
+
const message = error instanceof Error ? error.message : String(error ?? "unknown_error");
|
|
91
|
+
return json({ ok: false, error: "tool_list_failed", message }, { status: 500 });
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
export { GET };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { j as json } from './index.js-BQnOaW3H.js';
|
|
2
|
+
|
|
3
|
+
const API_ROOT_ERROR = {
|
|
4
|
+
ok: false,
|
|
5
|
+
error: "api_root_not_available",
|
|
6
|
+
next: "/api-info.json"
|
|
7
|
+
};
|
|
8
|
+
const GET = async () => json(API_ROOT_ERROR, { status: 404 });
|
|
9
|
+
const HEAD = async () => new Response(null, {
|
|
10
|
+
status: 404,
|
|
11
|
+
headers: { "content-type": "application/json; charset=utf-8" }
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
export { GET, HEAD };
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { createSvelteKitPluginHandler } from '@aopslabs/host-adapter-sveltekit';
|
|
2
|
+
import { j as json } from './index.js-BQnOaW3H.js';
|
|
3
|
+
import { d as checkHostDomainAdmission, e as getHostPluginRegistry } from './registry-DO8ob5o1.js';
|
|
4
|
+
import { a as toSafeDiagnosticLabel, n as normalizePluginFailure, t as toSafePluginFailureLogDetails, i as inferFailureStatusFromPayload } from './plugin-error-normalize-DNeRsopQ.js';
|
|
5
|
+
import { a as attachResolvedProjectScope, r as resolveHostRequestContext } from './request-context-9wzBoKrz.js';
|
|
6
|
+
import 'node:path';
|
|
7
|
+
import 'node:module';
|
|
8
|
+
import 'node:url';
|
|
9
|
+
import '@aopslabs/host-core';
|
|
10
|
+
import './aops-runtime-config-CHpDUCdE.js';
|
|
11
|
+
import 'node:fs';
|
|
12
|
+
import 'pg';
|
|
13
|
+
import 'node:worker_threads';
|
|
14
|
+
import './admission-snapshot-C2wGfTWE.js';
|
|
15
|
+
import 'node:crypto';
|
|
16
|
+
import '@aopslabs/xf-dm-kits/appConfig';
|
|
17
|
+
import '@aopslabs/xf-dm-kits';
|
|
18
|
+
import '@aopslabs/domain-kit-agentspace';
|
|
19
|
+
import './project-alias-BdnRxWft.js';
|
|
20
|
+
import './xf-result-BRDjvftr.js';
|
|
21
|
+
import 'effect';
|
|
22
|
+
|
|
23
|
+
const handler = createSvelteKitPluginHandler(getHostPluginRegistry, {
|
|
24
|
+
resolveContext: (event) => resolveHostRequestContext(event)
|
|
25
|
+
});
|
|
26
|
+
const SAFE_RUNTIME_ERROR_MESSAGE = "Runtime operation failed. Check server logs for details.";
|
|
27
|
+
async function normalizePluginErrorResponse(response) {
|
|
28
|
+
const contentType = response.headers.get("content-type")?.toLowerCase() ?? "";
|
|
29
|
+
if (!contentType.includes("application/json")) {
|
|
30
|
+
if (response.status < 400) return response;
|
|
31
|
+
const safeMessage = response.status === 401 ? "Unauthorized" : response.status === 403 ? "Forbidden" : response.status === 404 ? "Record not found" : SAFE_RUNTIME_ERROR_MESSAGE;
|
|
32
|
+
console.warn("[api-domain] normalized non-json error response", {
|
|
33
|
+
status: response.status
|
|
34
|
+
});
|
|
35
|
+
const headers2 = new Headers(response.headers);
|
|
36
|
+
headers2.delete("content-length");
|
|
37
|
+
headers2.delete("content-encoding");
|
|
38
|
+
headers2.delete("transfer-encoding");
|
|
39
|
+
headers2.set("content-type", "application/json; charset=utf-8");
|
|
40
|
+
return new Response(
|
|
41
|
+
JSON.stringify({
|
|
42
|
+
ok: false,
|
|
43
|
+
error: "plugin_response_invalid",
|
|
44
|
+
message: safeMessage
|
|
45
|
+
}),
|
|
46
|
+
{
|
|
47
|
+
status: response.status,
|
|
48
|
+
headers: headers2
|
|
49
|
+
}
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
let payload;
|
|
53
|
+
try {
|
|
54
|
+
payload = await response.clone().json();
|
|
55
|
+
} catch {
|
|
56
|
+
return response;
|
|
57
|
+
}
|
|
58
|
+
const normalized = normalizePluginFailure(response.status, payload);
|
|
59
|
+
let nextStatus = normalized.status;
|
|
60
|
+
let nextPayload = normalized.payload;
|
|
61
|
+
if (normalized.sanitized) {
|
|
62
|
+
console.warn(
|
|
63
|
+
"[api-domain] sanitized plugin error response",
|
|
64
|
+
toSafePluginFailureLogDetails(normalized.payload)
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
if (nextStatus < 400) {
|
|
68
|
+
const inferredStatus = inferFailureStatusFromPayload(nextPayload, nextStatus);
|
|
69
|
+
if (inferredStatus !== nextStatus) {
|
|
70
|
+
console.warn("[api-domain] remapped semantic failure response", {
|
|
71
|
+
...toSafePluginFailureLogDetails(nextPayload),
|
|
72
|
+
fromStatus: nextStatus,
|
|
73
|
+
toStatus: inferredStatus
|
|
74
|
+
});
|
|
75
|
+
nextStatus = inferredStatus;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
if (!normalized.sanitized && nextStatus === response.status) return response;
|
|
79
|
+
const headers = new Headers(response.headers);
|
|
80
|
+
headers.delete("content-length");
|
|
81
|
+
headers.delete("content-encoding");
|
|
82
|
+
headers.delete("transfer-encoding");
|
|
83
|
+
return new Response(JSON.stringify(nextPayload), {
|
|
84
|
+
status: nextStatus,
|
|
85
|
+
headers
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
const wrappedHandler = async (event) => {
|
|
89
|
+
await attachResolvedProjectScope(event);
|
|
90
|
+
const domain = String(event.params.domain ?? "").trim().toLowerCase();
|
|
91
|
+
const admission = checkHostDomainAdmission(domain);
|
|
92
|
+
if (!admission.allowed) {
|
|
93
|
+
return json(
|
|
94
|
+
{ ok: false, error: "domain_not_available", domain, reason: admission.reason },
|
|
95
|
+
{ status: 404 }
|
|
96
|
+
);
|
|
97
|
+
}
|
|
98
|
+
try {
|
|
99
|
+
const response = await handler(event);
|
|
100
|
+
return normalizePluginErrorResponse(response);
|
|
101
|
+
} catch {
|
|
102
|
+
console.error("[api-domain] handler execution failed", {
|
|
103
|
+
domain: toSafeDiagnosticLabel(domain),
|
|
104
|
+
method: toSafeDiagnosticLabel(event.request.method)
|
|
105
|
+
});
|
|
106
|
+
return json(
|
|
107
|
+
{
|
|
108
|
+
ok: false,
|
|
109
|
+
error: "domain_route_failed",
|
|
110
|
+
domain,
|
|
111
|
+
message: SAFE_RUNTIME_ERROR_MESSAGE
|
|
112
|
+
},
|
|
113
|
+
{ status: 500 }
|
|
114
|
+
);
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
const GET = wrappedHandler;
|
|
118
|
+
const POST = wrappedHandler;
|
|
119
|
+
const PUT = wrappedHandler;
|
|
120
|
+
const PATCH = wrappedHandler;
|
|
121
|
+
const DELETE = wrappedHandler;
|
|
122
|
+
const OPTIONS = wrappedHandler;
|
|
123
|
+
const HEAD = wrappedHandler;
|
|
124
|
+
|
|
125
|
+
export { DELETE, GET, HEAD, OPTIONS, PATCH, POST, PUT };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { j as json } from './index.js-BQnOaW3H.js';
|
|
2
|
+
import { r as readRuntimeConfigAdmin } from './aops-runtime-config-CHpDUCdE.js';
|
|
3
|
+
import { o as okResult } from './xf-result-BRDjvftr.js';
|
|
4
|
+
import 'node:fs';
|
|
5
|
+
import 'node:path';
|
|
6
|
+
import 'pg';
|
|
7
|
+
|
|
8
|
+
const GET = async () => json(okResult(readRuntimeConfigAdmin()), { status: 200 });
|
|
9
|
+
|
|
10
|
+
export { GET };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { handleChatv3SseRequest } from '@aopslabs/domain-host-plugin-chatv3';
|
|
2
|
+
|
|
3
|
+
const GET = async (event) => {
|
|
4
|
+
const token = event.url.searchParams.get("token") ?? event.request.headers.get("authorization")?.replace(/^Bearer\s+/i, "") ?? null;
|
|
5
|
+
return handleChatv3SseRequest({ token, signal: event.request.signal });
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export { GET };
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { j as json } from './index.js-BQnOaW3H.js';
|
|
2
|
+
import { g as getAgentGateway } from './agent-gateway-runtime-C7Kvvy0H.js';
|
|
3
|
+
import { r as resolveRequestBaseUrl } from './request-base-url-zKJpVUv5.js';
|
|
4
|
+
import { g as getAuthProvider, i as isTrustedLocalAuthProvider } from './auth-provider-C07OUlnz.js';
|
|
5
|
+
import '@aopslabs/host-core';
|
|
6
|
+
import '@aopslabs/manifest';
|
|
7
|
+
import './registry-DO8ob5o1.js';
|
|
8
|
+
import 'node:path';
|
|
9
|
+
import 'node:module';
|
|
10
|
+
import 'node:url';
|
|
11
|
+
import './aops-runtime-config-CHpDUCdE.js';
|
|
12
|
+
import 'node:fs';
|
|
13
|
+
import 'pg';
|
|
14
|
+
import 'node:worker_threads';
|
|
15
|
+
import './admission-snapshot-C2wGfTWE.js';
|
|
16
|
+
import 'node:crypto';
|
|
17
|
+
import 'node:child_process';
|
|
18
|
+
import 'node:util';
|
|
19
|
+
import './project-alias-BdnRxWft.js';
|
|
20
|
+
import './canonical-text-order-DbXJJnFD.js';
|
|
21
|
+
import 'ajv';
|
|
22
|
+
import 'zod';
|
|
23
|
+
|
|
24
|
+
const GET = async ({ request, url }) => {
|
|
25
|
+
const gateway = getAgentGateway();
|
|
26
|
+
const domain = url.searchParams.get("domain")?.trim().toLowerCase() || void 0;
|
|
27
|
+
const serverBaseUrl = resolveRequestBaseUrl(request, url);
|
|
28
|
+
const withDomain = (path) => domain ? `${path}${path.includes("?") ? "&" : "?"}domain=${encodeURIComponent(domain)}` : path;
|
|
29
|
+
try {
|
|
30
|
+
const authProvider = getAuthProvider();
|
|
31
|
+
const usesTrustedLocalAuth = isTrustedLocalAuthProvider(authProvider);
|
|
32
|
+
const openApi = await gateway.getOpenApi({ domain, serverBaseUrl });
|
|
33
|
+
openApi["x-agent-discovery"] = {
|
|
34
|
+
landingPage: serverBaseUrl ? `${serverBaseUrl}${withDomain("/api-info")}` : withDomain("/api-info"),
|
|
35
|
+
document: serverBaseUrl ? `${serverBaseUrl}${withDomain("/api-info.json")}` : withDomain("/api-info.json"),
|
|
36
|
+
rawDocument: serverBaseUrl ? `${serverBaseUrl}${withDomain("/api/agent/discovery.json")}` : withDomain("/api/agent/discovery.json"),
|
|
37
|
+
toolCatalog: serverBaseUrl ? `${serverBaseUrl}${withDomain("/api/agent/tools")}` : withDomain("/api/agent/tools"),
|
|
38
|
+
toolDetailTemplate: serverBaseUrl ? `${serverBaseUrl}/api/agent/tools/{toolId}` : "/api/agent/tools/{toolId}",
|
|
39
|
+
invokeTemplate: serverBaseUrl ? `${serverBaseUrl}/api/agent/tools/{toolId}/invoke` : "/api/agent/tools/{toolId}/invoke",
|
|
40
|
+
publicOpenApi: serverBaseUrl ? `${serverBaseUrl}${withDomain("/openapi.json")}` : withDomain("/openapi.json"),
|
|
41
|
+
rawOpenApi: serverBaseUrl ? `${serverBaseUrl}${withDomain("/api/agent/openapi.json")}` : withDomain("/api/agent/openapi.json"),
|
|
42
|
+
bodyModes: ["raw-input", "envelope"],
|
|
43
|
+
canonicalSource: "Domain Capability Manifest (DCM)",
|
|
44
|
+
discoveryMetadataContract: {
|
|
45
|
+
domainSummary: {
|
|
46
|
+
preferred: "manifest.docs.domain.summary",
|
|
47
|
+
fallback: "manifest.domain.description"
|
|
48
|
+
},
|
|
49
|
+
humanReadableResources: {
|
|
50
|
+
preferred: [
|
|
51
|
+
"manifest.capabilities.resources[].title",
|
|
52
|
+
"manifest.docs.resources[resourceId].summary"
|
|
53
|
+
],
|
|
54
|
+
fallback: ["resource:* tag", "service:* tag", "operationId prefix"]
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
system: {
|
|
58
|
+
kind: "manifest-synced-tooling-host",
|
|
59
|
+
firstContactStatement: "AOPS stands for Agentic Operations System. Treat it as a manifest-synced tool gateway and discovery surface, not as an internal architecture map.",
|
|
60
|
+
notThis: [
|
|
61
|
+
"Do not treat this endpoint as a microservice architecture description.",
|
|
62
|
+
"Do not infer event-driven topology or internal service boundaries from this endpoint."
|
|
63
|
+
]
|
|
64
|
+
},
|
|
65
|
+
usageProtocol: {
|
|
66
|
+
helpFirstRule: "If a sibling help-like tool exists (`*.help`, `*.describe`, `*.usage`), inspect that first. Otherwise use tool detail and OpenAPI before invoke.",
|
|
67
|
+
steps: [
|
|
68
|
+
"GET /api-info.json",
|
|
69
|
+
"GET /api/agent/tools",
|
|
70
|
+
"GET /api/agent/tools/{toolId}",
|
|
71
|
+
"GET /openapi.json only if schema detail is needed",
|
|
72
|
+
usesTrustedLocalAuth ? "POST /api/agent/tools/{toolId}/invoke (trusted-local runtime principal)" : "POST /api/agent/tools/{toolId}/invoke with auth"
|
|
73
|
+
]
|
|
74
|
+
},
|
|
75
|
+
authProvider
|
|
76
|
+
};
|
|
77
|
+
return json(openApi, { status: 200 });
|
|
78
|
+
} catch (error) {
|
|
79
|
+
const message = error instanceof Error ? error.message : String(error ?? "unknown_error");
|
|
80
|
+
return json({ ok: false, error: "openapi_generation_failed", message }, { status: 500 });
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
export { GET };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { j as json } from './index.js-BQnOaW3H.js';
|
|
2
|
+
import { t as testRuntimeConfigAdminTarget } from './aops-runtime-config-CHpDUCdE.js';
|
|
3
|
+
import { o as okResult, e as errResult } from './xf-result-BRDjvftr.js';
|
|
4
|
+
import 'node:fs';
|
|
5
|
+
import 'node:path';
|
|
6
|
+
import 'pg';
|
|
7
|
+
|
|
8
|
+
const POST = async () => {
|
|
9
|
+
try {
|
|
10
|
+
return json(okResult(await testRuntimeConfigAdminTarget()), { status: 200 });
|
|
11
|
+
} catch (error) {
|
|
12
|
+
const code = error instanceof Error && error.message === "aops_pg_url_required" ? error.message : "runtime_config_test_failed";
|
|
13
|
+
return json(errResult(code), { status: code === "aops_pg_url_required" ? 503 : 500 });
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export { POST };
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { j as json } from './index.js-BQnOaW3H.js';
|
|
2
|
+
import { g as getAgentGateway } from './agent-gateway-runtime-C7Kvvy0H.js';
|
|
3
|
+
import { r as resolveRequestBaseUrl } from './request-base-url-zKJpVUv5.js';
|
|
4
|
+
import { g as getAuthProvider, i as isTrustedLocalAuthProvider } from './auth-provider-C07OUlnz.js';
|
|
5
|
+
import '@aopslabs/host-core';
|
|
6
|
+
import '@aopslabs/manifest';
|
|
7
|
+
import './registry-DO8ob5o1.js';
|
|
8
|
+
import 'node:path';
|
|
9
|
+
import 'node:module';
|
|
10
|
+
import 'node:url';
|
|
11
|
+
import './aops-runtime-config-CHpDUCdE.js';
|
|
12
|
+
import 'node:fs';
|
|
13
|
+
import 'pg';
|
|
14
|
+
import 'node:worker_threads';
|
|
15
|
+
import './admission-snapshot-C2wGfTWE.js';
|
|
16
|
+
import 'node:crypto';
|
|
17
|
+
import 'node:child_process';
|
|
18
|
+
import 'node:util';
|
|
19
|
+
import './project-alias-BdnRxWft.js';
|
|
20
|
+
import './canonical-text-order-DbXJJnFD.js';
|
|
21
|
+
import 'ajv';
|
|
22
|
+
import 'zod';
|
|
23
|
+
|
|
24
|
+
const GET = async ({ request, url }) => {
|
|
25
|
+
const gateway = getAgentGateway();
|
|
26
|
+
const domain = url.searchParams.get("domain")?.trim().toLowerCase() || void 0;
|
|
27
|
+
const serverBaseUrl = resolveRequestBaseUrl(request, url);
|
|
28
|
+
const withDomain = (path) => domain ? `${path}${path.includes("?") ? "&" : "?"}domain=${encodeURIComponent(domain)}` : path;
|
|
29
|
+
try {
|
|
30
|
+
const authProvider = getAuthProvider();
|
|
31
|
+
const usesTrustedLocalAuth = isTrustedLocalAuthProvider(authProvider);
|
|
32
|
+
const openApi = await gateway.getOpenApi({ domain, serverBaseUrl });
|
|
33
|
+
openApi["x-agent-discovery"] = {
|
|
34
|
+
landingPage: serverBaseUrl ? `${serverBaseUrl}${withDomain("/api-info")}` : withDomain("/api-info"),
|
|
35
|
+
document: serverBaseUrl ? `${serverBaseUrl}${withDomain("/api-info.json")}` : withDomain("/api-info.json"),
|
|
36
|
+
rawDocument: serverBaseUrl ? `${serverBaseUrl}${withDomain("/api/agent/discovery.json")}` : withDomain("/api/agent/discovery.json"),
|
|
37
|
+
toolCatalog: serverBaseUrl ? `${serverBaseUrl}${withDomain("/api/agent/tools")}` : withDomain("/api/agent/tools"),
|
|
38
|
+
toolDetailTemplate: serverBaseUrl ? `${serverBaseUrl}/api/agent/tools/{toolId}` : "/api/agent/tools/{toolId}",
|
|
39
|
+
invokeTemplate: serverBaseUrl ? `${serverBaseUrl}/api/agent/tools/{toolId}/invoke` : "/api/agent/tools/{toolId}/invoke",
|
|
40
|
+
publicOpenApi: serverBaseUrl ? `${serverBaseUrl}${withDomain("/openapi.json")}` : withDomain("/openapi.json"),
|
|
41
|
+
rawOpenApi: serverBaseUrl ? `${serverBaseUrl}${withDomain("/api/agent/openapi.json")}` : withDomain("/api/agent/openapi.json"),
|
|
42
|
+
bodyModes: ["raw-input", "envelope"],
|
|
43
|
+
canonicalSource: "Domain Capability Manifest (DCM)",
|
|
44
|
+
discoveryMetadataContract: {
|
|
45
|
+
domainSummary: {
|
|
46
|
+
preferred: "manifest.docs.domain.summary",
|
|
47
|
+
fallback: "manifest.domain.description"
|
|
48
|
+
},
|
|
49
|
+
humanReadableResources: {
|
|
50
|
+
preferred: [
|
|
51
|
+
"manifest.capabilities.resources[].title",
|
|
52
|
+
"manifest.docs.resources[resourceId].summary"
|
|
53
|
+
],
|
|
54
|
+
fallback: ["resource:* tag", "service:* tag", "operationId prefix"]
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
system: {
|
|
58
|
+
kind: "manifest-synced-tooling-host",
|
|
59
|
+
firstContactStatement: "AOPS stands for Agentic Operations System. Treat it as a manifest-synced tool gateway and discovery surface, not as an internal architecture map.",
|
|
60
|
+
notThis: [
|
|
61
|
+
"Do not treat this endpoint as a microservice architecture description.",
|
|
62
|
+
"Do not infer event-driven topology or internal service boundaries from this endpoint."
|
|
63
|
+
]
|
|
64
|
+
},
|
|
65
|
+
usageProtocol: {
|
|
66
|
+
helpFirstRule: "If a sibling help-like tool exists (`*.help`, `*.describe`, `*.usage`), inspect that first. Otherwise use tool detail and OpenAPI before invoke.",
|
|
67
|
+
steps: [
|
|
68
|
+
"GET /api-info.json",
|
|
69
|
+
"GET /api/agent/tools",
|
|
70
|
+
"GET /api/agent/tools/{toolId}",
|
|
71
|
+
"GET /openapi.json only if schema detail is needed",
|
|
72
|
+
usesTrustedLocalAuth ? "POST /api/agent/tools/{toolId}/invoke (trusted-local runtime principal)" : "POST /api/agent/tools/{toolId}/invoke with auth"
|
|
73
|
+
]
|
|
74
|
+
},
|
|
75
|
+
authProvider
|
|
76
|
+
};
|
|
77
|
+
return json(openApi, { status: 200 });
|
|
78
|
+
} catch (error) {
|
|
79
|
+
const message = error instanceof Error ? error.message : String(error ?? "unknown_error");
|
|
80
|
+
return json({ ok: false, error: "openapi_generation_failed", message }, { status: 500 });
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
export { GET };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { j as json } from './index.js-BQnOaW3H.js';
|
|
2
|
+
import { g as getAgentDiscoveryDocument } from './discovery-BvDEgiqC.js';
|
|
3
|
+
import { r as resolveRequestBaseUrl } from './request-base-url-zKJpVUv5.js';
|
|
4
|
+
import './agent-gateway-runtime-C7Kvvy0H.js';
|
|
5
|
+
import '@aopslabs/host-core';
|
|
6
|
+
import '@aopslabs/manifest';
|
|
7
|
+
import './registry-DO8ob5o1.js';
|
|
8
|
+
import 'node:path';
|
|
9
|
+
import 'node:module';
|
|
10
|
+
import 'node:url';
|
|
11
|
+
import './aops-runtime-config-CHpDUCdE.js';
|
|
12
|
+
import 'node:fs';
|
|
13
|
+
import 'pg';
|
|
14
|
+
import 'node:worker_threads';
|
|
15
|
+
import './admission-snapshot-C2wGfTWE.js';
|
|
16
|
+
import 'node:crypto';
|
|
17
|
+
import 'node:child_process';
|
|
18
|
+
import 'node:util';
|
|
19
|
+
import './project-alias-BdnRxWft.js';
|
|
20
|
+
import './canonical-text-order-DbXJJnFD.js';
|
|
21
|
+
import 'ajv';
|
|
22
|
+
import 'zod';
|
|
23
|
+
import './auth-provider-C07OUlnz.js';
|
|
24
|
+
|
|
25
|
+
const GET = async ({ request, url }) => {
|
|
26
|
+
try {
|
|
27
|
+
const domain = url.searchParams.get("domain")?.trim().toLowerCase() || void 0;
|
|
28
|
+
const serverBaseUrl = resolveRequestBaseUrl(request, url);
|
|
29
|
+
const discovery = await getAgentDiscoveryDocument({ domain, serverBaseUrl });
|
|
30
|
+
return json(discovery, { status: 200 });
|
|
31
|
+
} catch (error) {
|
|
32
|
+
const message = error instanceof Error ? error.message : String(error ?? "unknown_error");
|
|
33
|
+
return json({ ok: false, error: "agent_discovery_failed", message }, { status: 500 });
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export { GET };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { j as json } from './index.js-BQnOaW3H.js';
|
|
2
|
+
import { g as getAgentDiscoveryDocument } from './discovery-BvDEgiqC.js';
|
|
3
|
+
import { r as resolveRequestBaseUrl } from './request-base-url-zKJpVUv5.js';
|
|
4
|
+
import './agent-gateway-runtime-C7Kvvy0H.js';
|
|
5
|
+
import '@aopslabs/host-core';
|
|
6
|
+
import '@aopslabs/manifest';
|
|
7
|
+
import './registry-DO8ob5o1.js';
|
|
8
|
+
import 'node:path';
|
|
9
|
+
import 'node:module';
|
|
10
|
+
import 'node:url';
|
|
11
|
+
import './aops-runtime-config-CHpDUCdE.js';
|
|
12
|
+
import 'node:fs';
|
|
13
|
+
import 'pg';
|
|
14
|
+
import 'node:worker_threads';
|
|
15
|
+
import './admission-snapshot-C2wGfTWE.js';
|
|
16
|
+
import 'node:crypto';
|
|
17
|
+
import 'node:child_process';
|
|
18
|
+
import 'node:util';
|
|
19
|
+
import './project-alias-BdnRxWft.js';
|
|
20
|
+
import './canonical-text-order-DbXJJnFD.js';
|
|
21
|
+
import 'ajv';
|
|
22
|
+
import 'zod';
|
|
23
|
+
import './auth-provider-C07OUlnz.js';
|
|
24
|
+
|
|
25
|
+
const GET = async ({ request, url }) => {
|
|
26
|
+
try {
|
|
27
|
+
const domain = url.searchParams.get("domain")?.trim().toLowerCase() || void 0;
|
|
28
|
+
const serverBaseUrl = resolveRequestBaseUrl(request, url);
|
|
29
|
+
const discovery = await getAgentDiscoveryDocument({ domain, serverBaseUrl });
|
|
30
|
+
return json(discovery, { status: 200 });
|
|
31
|
+
} catch (error) {
|
|
32
|
+
const message = error instanceof Error ? error.message : String(error ?? "unknown_error");
|
|
33
|
+
return json({ ok: false, error: "agent_discovery_failed", message }, { status: 500 });
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export { GET };
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { j as json } from './index.js-BQnOaW3H.js';
|
|
2
|
+
import { r as readRuntimeConfigAdmin, g as getResolvedAopsServerRuntimeConfig } from './aops-runtime-config-CHpDUCdE.js';
|
|
3
|
+
import { g as getAuthProvider } from './auth-provider-C07OUlnz.js';
|
|
4
|
+
import { o as okResult } from './xf-result-BRDjvftr.js';
|
|
5
|
+
import 'node:fs';
|
|
6
|
+
import 'node:path';
|
|
7
|
+
import 'pg';
|
|
8
|
+
|
|
9
|
+
async function readBootstrapHealth() {
|
|
10
|
+
const runtime = getResolvedAopsServerRuntimeConfig();
|
|
11
|
+
const admin = readRuntimeConfigAdmin();
|
|
12
|
+
const errors = runtime.repoUrl ? [] : ["AOPS_PG_URL is required."];
|
|
13
|
+
const authProvider = getAuthProvider();
|
|
14
|
+
const storage = {
|
|
15
|
+
envPath: null,
|
|
16
|
+
envExists: false,
|
|
17
|
+
repoDialect: runtime.repoDialect,
|
|
18
|
+
repoUrlSource: runtime.repoUrlSource,
|
|
19
|
+
redactedRepoUrl: admin.effective.redactedRepoUrl ?? ""
|
|
20
|
+
};
|
|
21
|
+
return {
|
|
22
|
+
authProvider,
|
|
23
|
+
authRequired: false,
|
|
24
|
+
configOk: errors.length === 0,
|
|
25
|
+
storage,
|
|
26
|
+
auth: {
|
|
27
|
+
provider: authProvider,
|
|
28
|
+
loginSupported: false,
|
|
29
|
+
storagePolicyOk: true,
|
|
30
|
+
adminKeyConfigured: false,
|
|
31
|
+
firstAdminState: "not-applicable",
|
|
32
|
+
userCount: null,
|
|
33
|
+
adminUserCount: null
|
|
34
|
+
},
|
|
35
|
+
env: { hasPgUrl: Boolean(runtime.repoUrl) },
|
|
36
|
+
errors,
|
|
37
|
+
warnings: []
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
const GET = async () => {
|
|
41
|
+
const bootstrap = await readBootstrapHealth();
|
|
42
|
+
const ready = bootstrap.configOk;
|
|
43
|
+
const data = {
|
|
44
|
+
status: ready ? "ok" : "unavailable",
|
|
45
|
+
service: "aops-server",
|
|
46
|
+
bootstrap
|
|
47
|
+
};
|
|
48
|
+
return json(
|
|
49
|
+
ready ? okResult(data) : { ok: false, data },
|
|
50
|
+
{ status: ready ? 200 : 503 }
|
|
51
|
+
);
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export { GET };
|