@ultrst-armada/kloks 2.2.9 → 3.0.1
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/.krusbl-release-attestation.json +3 -3
- package/package.json +1 -1
- package/packages/backend/dist/auth/LuthOAuthUserInfo.d.ts +10 -0
- package/packages/backend/dist/auth/OidcBff.d.ts +3 -2
- package/packages/backend/dist/auth/OidcBffEnv.d.ts +6 -7
- package/packages/backend/dist/auth/index.d.ts +0 -3
- package/packages/backend/dist/auth/index.js +2 -26
- package/packages/backend/dist/{chunk-AKVBFHHD.js → chunk-2SNWR4FI.js} +88 -57
- package/packages/backend/dist/{chunk-UI7AYFAU.js → chunk-363J52AF.js} +0 -48
- package/packages/backend/dist/{chunk-GCVR257U.js → chunk-3SDRLTD6.js} +1 -1
- package/packages/backend/dist/chunk-7HD7OEUY.js +177 -0
- package/packages/backend/dist/chunk-B5DCG4UC.js +602 -0
- package/packages/backend/dist/{chunk-7XTURV44.js → chunk-F7BO3GLA.js} +2 -2
- package/packages/backend/dist/{chunk-RHW75K46.js → chunk-IAW6N73D.js} +49 -1
- package/packages/backend/dist/{chunk-IRKJ6HKP.js → chunk-IXEKOWY4.js} +1 -1
- package/packages/backend/dist/{chunk-4X4QGVAO.js → chunk-NRW4TECO.js} +1 -1
- package/packages/backend/dist/{chunk-3ZL2DX73.js → chunk-PAU25K7F.js} +5 -172
- package/packages/backend/dist/{chunk-NUBA6A5T.js → chunk-VN2NR3KT.js} +1 -1
- package/packages/backend/dist/{chunk-R4B3KPHY.js → chunk-YFISFDBW.js} +36 -15
- package/packages/backend/dist/control-plane/ControlPlaneManager.d.ts +6 -3
- package/packages/backend/dist/index.d.ts +0 -2
- package/packages/backend/dist/index.js +7 -25
- package/packages/backend/dist/krnl-services.js +6 -6
- package/packages/backend/dist/node.d.ts +0 -1
- package/packages/backend/dist/node.js +20 -95
- package/packages/backend/dist/provider-services/index.js +7 -7
- package/packages/backend/dist/provider-services/node.d.ts +2 -0
- package/packages/backend/dist/provider-services/node.js +15 -4
- package/packages/backend/dist/provider-services/saved-account-crypto.d.ts +19 -0
- package/packages/backend/dist/provider-services/saved-account-probe.d.ts +26 -0
- package/packages/backend/dist/provider-services/saved-account-store.d.ts +29 -0
- package/packages/backend/dist/services/node.js +5 -4
- package/packages/backend/dist/srkl/index.js +3 -2
- package/packages/backend/dist/workspace/node.js +5 -4
- package/packages/backend/dist/{workspaceFileCore-XPT6WTFY.js → workspaceFileCore-2KCVSECY.js} +3 -2
- package/packages/client/dist/auth.d.ts +9 -21
- package/packages/client/dist/auth.js +1 -23
- package/packages/client/dist/chunk-QGZHKLOK.js +75 -0
- package/packages/client/dist/index.d.ts +2 -3
- package/packages/client/dist/index.js +1 -23
- package/packages/backend/dist/auth/BaseAccountProvider.d.ts +0 -7
- package/packages/backend/dist/auth/CanonicalAuthClient.d.ts +0 -6
- package/packages/backend/dist/auth/UnifiedAuthCore.d.ts +0 -23
- package/packages/backend/dist/auth/UniversalLuthInitialization.d.ts +0 -55
- package/packages/backend/dist/chunk-2COYZMUJ.js +0 -78
- package/packages/backend/dist/chunk-MDTLU7H4.js +0 -58
- package/packages/backend/dist/chunk-U5VPYALB.js +0 -261
- package/packages/backend/dist/luth/LuthDiscoveryService.d.ts +0 -15
- package/packages/backend/dist/luth/index.d.ts +0 -1
- package/packages/client/dist/chunk-4HR374IB.js +0 -148
- /package/packages/backend/dist/{auth/UnifiedAuthCore.test.d.ts → provider-services/saved-account-store.test.d.ts} +0 -0
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export
|
|
3
|
-
export { ApplicationAuthClient, ApplicationAuthClientConfig, LuthAuthClient as CanonicalAuthClient, DEFAULT_LUTH_URL, DeploymentEnvironment, EmailSignInCredentials, EmailSignUpData, GoogleSignInOptions, LuthAuthClient, LuthAuthClientConfig, LuthAuthError, LuthAuthTokenStore, LuthSession, LuthSessionResult, LuthUser, RegisterApplicationResult, createApplicationAuthClient, createLuthAuthClient as createCanonicalAuthClient, createLuthAuthClient, hydrateLuthTokenFromUrl, resolveClientEnvironment, resolveClientOrigin } from '@dinilmusick/gutts/auth';
|
|
1
|
+
export { DEFAULT_LUTH_URL } from '@dinilmusick/gutts/auth';
|
|
2
|
+
export { CANONICAL_PUBLIC_ROUTES, LuthPrincipal, extractLuthToken, isPublicRoute, verifyLuthRequest } from './auth.js';
|
|
4
3
|
|
|
5
4
|
/**
|
|
6
5
|
* @file queueContracts.ts
|
|
@@ -1,21 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
|
-
ApplicationAuthClient,
|
|
3
2
|
CANONICAL_PUBLIC_ROUTES,
|
|
4
3
|
DEFAULT_LUTH_URL,
|
|
5
|
-
LuthAuthClient,
|
|
6
|
-
LuthAuthClient2,
|
|
7
|
-
LuthAuthError,
|
|
8
|
-
createApplicationAuthClient,
|
|
9
|
-
createLuthAuthClient,
|
|
10
|
-
createLuthAuthClient2,
|
|
11
|
-
createUniversalAuthFetch,
|
|
12
4
|
extractLuthToken,
|
|
13
|
-
hydrateLuthTokenFromUrl,
|
|
14
5
|
isPublicRoute,
|
|
15
|
-
resolveClientEnvironment,
|
|
16
|
-
resolveClientOrigin,
|
|
17
6
|
verifyLuthRequest
|
|
18
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-QGZHKLOK.js";
|
|
19
8
|
|
|
20
9
|
// src/browserExecutionClient.ts
|
|
21
10
|
var BrowserExecutionClient = class {
|
|
@@ -190,24 +179,13 @@ var OPFSWorkspaceStorage = class {
|
|
|
190
179
|
}
|
|
191
180
|
};
|
|
192
181
|
export {
|
|
193
|
-
ApplicationAuthClient,
|
|
194
182
|
BrowserExecutionClient,
|
|
195
183
|
CANONICAL_PUBLIC_ROUTES,
|
|
196
|
-
LuthAuthClient2 as CanonicalAuthClient,
|
|
197
184
|
DEFAULT_LUTH_URL,
|
|
198
|
-
LuthAuthClient,
|
|
199
|
-
LuthAuthError,
|
|
200
185
|
OPFSWorkspaceStorage,
|
|
201
186
|
WorkspaceAutosaveController,
|
|
202
|
-
createApplicationAuthClient,
|
|
203
187
|
createBrowserExecutionClient,
|
|
204
|
-
createLuthAuthClient2 as createCanonicalAuthClient,
|
|
205
|
-
createLuthAuthClient,
|
|
206
|
-
createUniversalAuthFetch,
|
|
207
188
|
extractLuthToken,
|
|
208
|
-
hydrateLuthTokenFromUrl,
|
|
209
189
|
isPublicRoute,
|
|
210
|
-
resolveClientEnvironment,
|
|
211
|
-
resolveClientOrigin,
|
|
212
190
|
verifyLuthRequest
|
|
213
191
|
};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Canonical account-provider compatibility type.
|
|
3
|
-
*
|
|
4
|
-
* Auth is owned by Luth; this alias exists only for control-plane APIs that
|
|
5
|
-
* historically accepted a BaseAccountProvider.
|
|
6
|
-
*/
|
|
7
|
-
export { LuthAuthClient as BaseAccountProvider, createLuthAuthClient as createBaseAccountProvider, } from '@dinilmusick/gutts';
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export { LuthAuthClient, createLuthAuthClient, resolveClientOrigin, resolveClientEnvironment, } from '@dinilmusick/gutts/auth';
|
|
2
|
-
export type { DeploymentEnvironment, EmailSignInCredentials, EmailSignUpData, GoogleSignInOptions, LuthAuthClientConfig, LuthAuthTokenStore, LuthSessionResult, RegisterApplicationResult, LuthUser, LuthSession, } from '@dinilmusick/gutts/auth';
|
|
3
|
-
export { LuthAuthError } from '@dinilmusick/gutts/auth';
|
|
4
|
-
export { LuthAuthClient as CanonicalAuthClient } from '@dinilmusick/gutts/auth';
|
|
5
|
-
export { createLuthAuthClient as createCanonicalAuthClient } from '@dinilmusick/gutts/auth';
|
|
6
|
-
export type { LuthUser as CanonicalAuthUser, LuthSession as CanonicalAuthSession } from '@dinilmusick/gutts/auth';
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
export interface SystemUser {
|
|
2
|
-
id: string;
|
|
3
|
-
email: string;
|
|
4
|
-
name: string;
|
|
5
|
-
username: string;
|
|
6
|
-
role: string;
|
|
7
|
-
status: string;
|
|
8
|
-
appProfiles?: Record<string, unknown>;
|
|
9
|
-
emailVerified?: boolean;
|
|
10
|
-
}
|
|
11
|
-
export type AuthEnvironment = Record<string, unknown>;
|
|
12
|
-
export declare function loginSystemUser(email: string, rawPass: string, isAdmin: boolean, _queryDb: (sql: string, params?: unknown[]) => Promise<{
|
|
13
|
-
rows: any[];
|
|
14
|
-
}>, env?: AuthEnvironment): Promise<{
|
|
15
|
-
success: boolean;
|
|
16
|
-
status: number;
|
|
17
|
-
token?: string;
|
|
18
|
-
user?: SystemUser;
|
|
19
|
-
error?: string;
|
|
20
|
-
}>;
|
|
21
|
-
export declare function resolveUserFromToken(tokenOrUserId: string, _queryDb: (sql: string, params?: unknown[]) => Promise<{
|
|
22
|
-
rows: any[];
|
|
23
|
-
}>, env?: AuthEnvironment): Promise<SystemUser | null>;
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
/** Structural invocation type only. The actual wire validator lives in GutTS. */
|
|
2
|
-
type UniversalRuntimeKind = 'browser' | 'cloudflare-worker' | 'serverless' | 'server' | 'desktop' | 'android' | 'ios' | 'headless';
|
|
3
|
-
type UniversalAuthReadiness = 'discovery' | 'unauthenticated' | 'authenticating' | 'authenticated' | 'configuring' | 'ready' | 'denied' | 'unavailable';
|
|
4
|
-
interface UniversalDiscoveryV1 {
|
|
5
|
-
application: {
|
|
6
|
-
appId: string;
|
|
7
|
-
ecosystemId: string;
|
|
8
|
-
name: string;
|
|
9
|
-
};
|
|
10
|
-
issuer: string;
|
|
11
|
-
configurationUrl: string;
|
|
12
|
-
}
|
|
13
|
-
interface UniversalConfigurationV1 {
|
|
14
|
-
application: {
|
|
15
|
-
appId: string;
|
|
16
|
-
ecosystemId: string;
|
|
17
|
-
name: string;
|
|
18
|
-
};
|
|
19
|
-
principal: {
|
|
20
|
-
userId: string;
|
|
21
|
-
};
|
|
22
|
-
settings: {
|
|
23
|
-
supportedServices: string[];
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Canonical Kloks service for public discovery and least-privilege user
|
|
28
|
-
* configuration. All schema validation, issuer pinning and retries live in
|
|
29
|
-
* GutTS; this runtime adapter does not recreate the identity protocol.
|
|
30
|
-
*
|
|
31
|
-
* This is NOT a way to fetch OAuth client secrets, BFF encryption keys, or
|
|
32
|
-
* database credentials. The existing OIDC BFF keeps its protected bootstrap
|
|
33
|
-
* until authenticated confidential workload provisioning is implemented.
|
|
34
|
-
*/
|
|
35
|
-
export interface UniversalLuthRuntimeAdapter {
|
|
36
|
-
runtime: UniversalRuntimeKind;
|
|
37
|
-
appId: string;
|
|
38
|
-
/** Existing Luth issuer origin; pinned before accepting discovery URLs. */
|
|
39
|
-
issuerOrigin: string;
|
|
40
|
-
/** Adapter may supply verified session cookies or OAuth bearer transport. */
|
|
41
|
-
authorizationHeaders?: () => Promise<HeadersInit>;
|
|
42
|
-
/** Injectable URL for local and integration fixtures only. */
|
|
43
|
-
discoveryUrl?: string;
|
|
44
|
-
fetcher?: typeof fetch;
|
|
45
|
-
onStateChange?: (state: UniversalAuthReadiness) => void;
|
|
46
|
-
}
|
|
47
|
-
export interface UniversalLuthRuntimeService {
|
|
48
|
-
discover(): Promise<UniversalDiscoveryV1>;
|
|
49
|
-
getConfiguration(): Promise<UniversalConfigurationV1>;
|
|
50
|
-
invalidate(): void;
|
|
51
|
-
readonly readiness: UniversalAuthReadiness;
|
|
52
|
-
}
|
|
53
|
-
/** Runtime privilege is never inferred from app ID or APP_URL. */
|
|
54
|
-
export declare function createUniversalLuthRuntimeService(adapter: UniversalLuthRuntimeAdapter): UniversalLuthRuntimeService;
|
|
55
|
-
export {};
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
// src/auth/UnifiedAuthCore.ts
|
|
2
|
-
import {
|
|
3
|
-
LuthAuthClient,
|
|
4
|
-
DEFAULT_LUTH_URL
|
|
5
|
-
} from "@dinilmusick/gutts/auth";
|
|
6
|
-
function tokenStore(initial = "") {
|
|
7
|
-
let token = initial;
|
|
8
|
-
return {
|
|
9
|
-
get: () => token,
|
|
10
|
-
set: (value) => {
|
|
11
|
-
token = value;
|
|
12
|
-
},
|
|
13
|
-
clear: () => {
|
|
14
|
-
token = "";
|
|
15
|
-
}
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
function createClient(_env, token = "") {
|
|
19
|
-
return new LuthAuthClient({
|
|
20
|
-
ecosystemId: "ultrst-armada",
|
|
21
|
-
applicationId: "kloks-backend",
|
|
22
|
-
luthUrl: DEFAULT_LUTH_URL,
|
|
23
|
-
origin: process.env.APP_URL || DEFAULT_LUTH_URL,
|
|
24
|
-
autoRegister: false,
|
|
25
|
-
tokenStore: tokenStore(token)
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
function toSystemUser(user) {
|
|
29
|
-
return {
|
|
30
|
-
...user,
|
|
31
|
-
username: user.email.split("@")[0],
|
|
32
|
-
role: "user",
|
|
33
|
-
status: "ACTIVE"
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
async function loginSystemUser(email, rawPass, isAdmin, _queryDb, env) {
|
|
37
|
-
if (!email?.trim() || !rawPass) return { success: false, status: 400, error: "Email and password are required" };
|
|
38
|
-
if (isAdmin) return { success: false, status: 403, error: "Administrative authentication is not provided by canonical Luth user login." };
|
|
39
|
-
try {
|
|
40
|
-
const client = createClient(env);
|
|
41
|
-
await client.signInWithEmail({ email: email.trim(), password: rawPass });
|
|
42
|
-
const session = await client.getSession();
|
|
43
|
-
if (!session.authenticated || !session.user || !session.session) {
|
|
44
|
-
return { success: false, status: 401, error: "Canonical authentication service did not establish a session." };
|
|
45
|
-
}
|
|
46
|
-
const user = toSystemUser(session.user);
|
|
47
|
-
const authorization = client.getAuthHeaders().Authorization || "";
|
|
48
|
-
const token = authorization.replace(/^Bearer\s+/i, "").trim();
|
|
49
|
-
if (!token) return { success: false, status: 502, error: "Luth did not return a usable bearer session token." };
|
|
50
|
-
return {
|
|
51
|
-
success: true,
|
|
52
|
-
status: 200,
|
|
53
|
-
user,
|
|
54
|
-
token
|
|
55
|
-
};
|
|
56
|
-
} catch (error) {
|
|
57
|
-
const status = error && typeof error === "object" && "status" in error && typeof error.status === "number" ? error.status : 503;
|
|
58
|
-
return { success: false, status, error: error instanceof Error ? error.message : "Canonical authentication service unavailable" };
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
async function resolveUserFromToken(tokenOrUserId, _queryDb, env) {
|
|
62
|
-
if (!tokenOrUserId) return null;
|
|
63
|
-
try {
|
|
64
|
-
const credential = tokenOrUserId.trim().replace(/^Bearer[ \t]+/i, "").trim();
|
|
65
|
-
if (!credential) return null;
|
|
66
|
-
const client = createClient(env, credential);
|
|
67
|
-
const session = await client.getSession();
|
|
68
|
-
if (!session.authenticated || !session.user) return null;
|
|
69
|
-
return toSystemUser(session.user);
|
|
70
|
-
} catch {
|
|
71
|
-
return null;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
export {
|
|
76
|
-
loginSystemUser,
|
|
77
|
-
resolveUserFromToken
|
|
78
|
-
};
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
// src/auth/CanonicalAuthClient.ts
|
|
2
|
-
import {
|
|
3
|
-
LuthAuthClient,
|
|
4
|
-
createLuthAuthClient,
|
|
5
|
-
resolveClientOrigin,
|
|
6
|
-
resolveClientEnvironment
|
|
7
|
-
} from "@dinilmusick/gutts/auth";
|
|
8
|
-
import { LuthAuthError } from "@dinilmusick/gutts/auth";
|
|
9
|
-
import { LuthAuthClient as LuthAuthClient2 } from "@dinilmusick/gutts/auth";
|
|
10
|
-
import { createLuthAuthClient as createLuthAuthClient2 } from "@dinilmusick/gutts/auth";
|
|
11
|
-
|
|
12
|
-
// src/auth/UniversalLuthInitialization.ts
|
|
13
|
-
import * as PortableLuthAuth from "@dinilmusick/gutts/auth";
|
|
14
|
-
function requiredGutTSFactory() {
|
|
15
|
-
const source = PortableLuthAuth;
|
|
16
|
-
const factory = source.createUniversalInitializationClient;
|
|
17
|
-
if (typeof factory !== "function") {
|
|
18
|
-
throw new Error("UNIVERSAL_INITIALIZATION_CONTRACT_UNAVAILABLE");
|
|
19
|
-
}
|
|
20
|
-
return factory;
|
|
21
|
-
}
|
|
22
|
-
function createUniversalLuthRuntimeService(adapter) {
|
|
23
|
-
if (adapter.runtime === "headless") {
|
|
24
|
-
throw new Error("VERIFIED_WORKLOAD_AUTHENTICATION_REQUIRED");
|
|
25
|
-
}
|
|
26
|
-
const client = requiredGutTSFactory()(
|
|
27
|
-
{
|
|
28
|
-
appId: adapter.appId,
|
|
29
|
-
runtime: adapter.runtime,
|
|
30
|
-
...adapter.discoveryUrl ? { discoveryUrl: adapter.discoveryUrl } : {}
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
expectedIssuerOrigin: adapter.issuerOrigin,
|
|
34
|
-
...adapter.authorizationHeaders ? { authorize: adapter.authorizationHeaders } : {},
|
|
35
|
-
...adapter.fetcher ? { fetcher: adapter.fetcher } : {},
|
|
36
|
-
...adapter.onStateChange ? { onStateChange: adapter.onStateChange } : {}
|
|
37
|
-
}
|
|
38
|
-
);
|
|
39
|
-
return {
|
|
40
|
-
discover: () => client.discover(),
|
|
41
|
-
getConfiguration: () => client.configuration(),
|
|
42
|
-
invalidate: () => client.invalidate(),
|
|
43
|
-
get readiness() {
|
|
44
|
-
return client.readiness;
|
|
45
|
-
}
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
export {
|
|
50
|
-
LuthAuthClient,
|
|
51
|
-
createLuthAuthClient,
|
|
52
|
-
resolveClientOrigin,
|
|
53
|
-
resolveClientEnvironment,
|
|
54
|
-
LuthAuthError,
|
|
55
|
-
LuthAuthClient2,
|
|
56
|
-
createLuthAuthClient2,
|
|
57
|
-
createUniversalLuthRuntimeService
|
|
58
|
-
};
|
|
@@ -1,261 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
fetchCloudflareCapacity,
|
|
3
|
-
fetchVercelCapacity
|
|
4
|
-
} from "./chunk-RHW75K46.js";
|
|
5
|
-
import {
|
|
6
|
-
getGeminiQuotaStatus,
|
|
7
|
-
listGeminiModels
|
|
8
|
-
} from "./chunk-GIUAFRAA.js";
|
|
9
|
-
import {
|
|
10
|
-
getGoogleAccountProfile,
|
|
11
|
-
listCloudflareAccounts,
|
|
12
|
-
listCloudflarePages,
|
|
13
|
-
listCloudflareWorkers,
|
|
14
|
-
listVercelDeployments,
|
|
15
|
-
listVercelProjects
|
|
16
|
-
} from "./chunk-LAKCKX3I.js";
|
|
17
|
-
import {
|
|
18
|
-
continueDropboxFolder,
|
|
19
|
-
listDropboxFolder,
|
|
20
|
-
listGitHubRepositories,
|
|
21
|
-
listGitHubRepositoryContents,
|
|
22
|
-
listGitLabProjects,
|
|
23
|
-
listGitLabRepositoryTree
|
|
24
|
-
} from "./chunk-AMI5MY6E.js";
|
|
25
|
-
import {
|
|
26
|
-
b2ListBuckets,
|
|
27
|
-
b2ListFileNames
|
|
28
|
-
} from "./chunk-I6T64MLT.js";
|
|
29
|
-
import {
|
|
30
|
-
GoogleDriveWorkspaceService
|
|
31
|
-
} from "./chunk-EMSSTOOK.js";
|
|
32
|
-
|
|
33
|
-
// src/provider-services/facades.ts
|
|
34
|
-
import { createService, createServiceDefinition } from "@ultrst-armada/krnl";
|
|
35
|
-
var defs = {
|
|
36
|
-
cloudflare: createServiceDefinition({
|
|
37
|
-
id: "kloks.external.cloudflare",
|
|
38
|
-
name: "Cloudflare Provider Service",
|
|
39
|
-
version: "1.0.0",
|
|
40
|
-
operations: {
|
|
41
|
-
listAccounts: {
|
|
42
|
-
id: "cloudflare.listAccounts",
|
|
43
|
-
name: "listAccounts",
|
|
44
|
-
handler: (input) => listCloudflareAccounts(input.connection)
|
|
45
|
-
},
|
|
46
|
-
listWorkers: {
|
|
47
|
-
id: "cloudflare.listWorkers",
|
|
48
|
-
name: "listWorkers",
|
|
49
|
-
handler: (input) => listCloudflareWorkers(input.connection)
|
|
50
|
-
},
|
|
51
|
-
listPages: {
|
|
52
|
-
id: "cloudflare.listPages",
|
|
53
|
-
name: "listPages",
|
|
54
|
-
handler: (input) => listCloudflarePages(input.connection)
|
|
55
|
-
},
|
|
56
|
-
quota: {
|
|
57
|
-
id: "cloudflare.quota",
|
|
58
|
-
name: "quota",
|
|
59
|
-
handler: (input) => fetchCloudflareCapacity(input.connection, input.plan)
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
}),
|
|
63
|
-
vercel: createServiceDefinition({
|
|
64
|
-
id: "kloks.external.vercel",
|
|
65
|
-
name: "Vercel Provider Service",
|
|
66
|
-
version: "1.0.0",
|
|
67
|
-
operations: {
|
|
68
|
-
listProjects: {
|
|
69
|
-
id: "vercel.listProjects",
|
|
70
|
-
name: "listProjects",
|
|
71
|
-
handler: (input) => listVercelProjects(input.connection)
|
|
72
|
-
},
|
|
73
|
-
listDeployments: {
|
|
74
|
-
id: "vercel.listDeployments",
|
|
75
|
-
name: "listDeployments",
|
|
76
|
-
handler: (input) => listVercelDeployments(input.connection)
|
|
77
|
-
},
|
|
78
|
-
quota: {
|
|
79
|
-
id: "vercel.quota",
|
|
80
|
-
name: "quota",
|
|
81
|
-
handler: (input) => fetchVercelCapacity(input.connection, input.options)
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
}),
|
|
85
|
-
google: createServiceDefinition({
|
|
86
|
-
id: "kloks.external.google",
|
|
87
|
-
name: "Google Account Service",
|
|
88
|
-
version: "1.0.0",
|
|
89
|
-
operations: {
|
|
90
|
-
profile: {
|
|
91
|
-
id: "google.profile",
|
|
92
|
-
name: "profile",
|
|
93
|
-
handler: (input) => getGoogleAccountProfile(input.connection)
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
}),
|
|
97
|
-
gemini: createServiceDefinition({
|
|
98
|
-
id: "kloks.external.google.gemini",
|
|
99
|
-
name: "Google Gemini Service",
|
|
100
|
-
version: "1.0.0",
|
|
101
|
-
operations: {
|
|
102
|
-
listModels: {
|
|
103
|
-
id: "gemini.listModels",
|
|
104
|
-
name: "listModels",
|
|
105
|
-
handler: (input) => listGeminiModels(input.connection)
|
|
106
|
-
},
|
|
107
|
-
quota: {
|
|
108
|
-
id: "gemini.quota",
|
|
109
|
-
name: "quota",
|
|
110
|
-
handler: (input) => getGeminiQuotaStatus(input.connection.accountId)
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
})
|
|
114
|
-
};
|
|
115
|
-
function facade(definition) {
|
|
116
|
-
const instance = createService(definition);
|
|
117
|
-
return {
|
|
118
|
-
id: definition.id,
|
|
119
|
-
name: definition.name,
|
|
120
|
-
version: definition.version,
|
|
121
|
-
runtime: "server",
|
|
122
|
-
deployment: "local",
|
|
123
|
-
definition,
|
|
124
|
-
get telemetry() {
|
|
125
|
-
return instance.telemetry;
|
|
126
|
-
},
|
|
127
|
-
createInstance: () => createService(definition),
|
|
128
|
-
execute: async (operation, input) => {
|
|
129
|
-
await instance.start();
|
|
130
|
-
return instance.call(operation, input);
|
|
131
|
-
}
|
|
132
|
-
};
|
|
133
|
-
}
|
|
134
|
-
var CloudflareProviderService = facade(defs.cloudflare);
|
|
135
|
-
var VercelProviderService = facade(defs.vercel);
|
|
136
|
-
var GoogleAccountProviderService = facade(defs.google);
|
|
137
|
-
var GeminiProviderService = facade(defs.gemini);
|
|
138
|
-
|
|
139
|
-
// src/provider-services/storage-facades.ts
|
|
140
|
-
import { createService as createService2, createServiceDefinition as createServiceDefinition2 } from "@ultrst-armada/krnl";
|
|
141
|
-
var github = createServiceDefinition2({
|
|
142
|
-
id: "kloks.external.github",
|
|
143
|
-
name: "GitHub Provider Service",
|
|
144
|
-
version: "1.0.0",
|
|
145
|
-
operations: {
|
|
146
|
-
listRepositories: {
|
|
147
|
-
id: "github.listRepositories",
|
|
148
|
-
name: "listRepositories",
|
|
149
|
-
handler: ({ connection }) => listGitHubRepositories(connection)
|
|
150
|
-
},
|
|
151
|
-
listContents: {
|
|
152
|
-
id: "github.listContents",
|
|
153
|
-
name: "listContents",
|
|
154
|
-
handler: (input) => listGitHubRepositoryContents(input.connection, input.owner, input.repo, input.path)
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
});
|
|
158
|
-
var gitlab = createServiceDefinition2({
|
|
159
|
-
id: "kloks.external.gitlab",
|
|
160
|
-
name: "GitLab Provider Service",
|
|
161
|
-
version: "1.0.0",
|
|
162
|
-
operations: {
|
|
163
|
-
listProjects: {
|
|
164
|
-
id: "gitlab.listProjects",
|
|
165
|
-
name: "listProjects",
|
|
166
|
-
handler: ({ connection }) => listGitLabProjects(connection)
|
|
167
|
-
},
|
|
168
|
-
listTree: {
|
|
169
|
-
id: "gitlab.listTree",
|
|
170
|
-
name: "listTree",
|
|
171
|
-
handler: (input) => listGitLabRepositoryTree(input.connection, input.project, input.path)
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
});
|
|
175
|
-
var dropbox = createServiceDefinition2({
|
|
176
|
-
id: "kloks.external.dropbox",
|
|
177
|
-
name: "Dropbox Provider Service",
|
|
178
|
-
version: "1.0.0",
|
|
179
|
-
operations: {
|
|
180
|
-
listFolder: {
|
|
181
|
-
id: "dropbox.listFolder",
|
|
182
|
-
name: "listFolder",
|
|
183
|
-
handler: (input) => listDropboxFolder(input.connection, input.path)
|
|
184
|
-
},
|
|
185
|
-
continueFolder: {
|
|
186
|
-
id: "dropbox.continueFolder",
|
|
187
|
-
name: "continueFolder",
|
|
188
|
-
handler: (input) => continueDropboxFolder(input.connection, input.cursor)
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
});
|
|
192
|
-
var backblaze = createServiceDefinition2({
|
|
193
|
-
id: "kloks.external.backblaze-b2",
|
|
194
|
-
name: "Backblaze B2 Provider Service",
|
|
195
|
-
version: "1.0.0",
|
|
196
|
-
operations: {
|
|
197
|
-
listBuckets: {
|
|
198
|
-
id: "backblaze.listBuckets",
|
|
199
|
-
name: "listBuckets",
|
|
200
|
-
handler: (input) => b2ListBuckets(input.keyId, input.applicationKey)
|
|
201
|
-
},
|
|
202
|
-
listFiles: {
|
|
203
|
-
id: "backblaze.listFiles",
|
|
204
|
-
name: "listFiles",
|
|
205
|
-
handler: (input) => b2ListFileNames(input.keyId, input.applicationKey, input.bucketName)
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
});
|
|
209
|
-
var drive = createServiceDefinition2({
|
|
210
|
-
id: "kloks.external.google.drive",
|
|
211
|
-
name: "Google Drive Provider Service",
|
|
212
|
-
version: "1.0.0",
|
|
213
|
-
operations: {
|
|
214
|
-
listFolders: {
|
|
215
|
-
id: "google.drive.listFolders",
|
|
216
|
-
name: "listFolders",
|
|
217
|
-
handler: (input) => new GoogleDriveWorkspaceService(input.options).listFolders(input.parentFolderId)
|
|
218
|
-
},
|
|
219
|
-
listFiles: {
|
|
220
|
-
id: "google.drive.listFiles",
|
|
221
|
-
name: "listFiles",
|
|
222
|
-
handler: (input) => new GoogleDriveWorkspaceService(input.options).list(input.path)
|
|
223
|
-
}
|
|
224
|
-
}
|
|
225
|
-
});
|
|
226
|
-
function serviceFacade(definition) {
|
|
227
|
-
const instance = createService2(definition);
|
|
228
|
-
return {
|
|
229
|
-
id: definition.id,
|
|
230
|
-
name: definition.name,
|
|
231
|
-
version: definition.version,
|
|
232
|
-
runtime: "server",
|
|
233
|
-
deployment: "local",
|
|
234
|
-
definition,
|
|
235
|
-
get telemetry() {
|
|
236
|
-
return instance.telemetry;
|
|
237
|
-
},
|
|
238
|
-
createInstance: () => createService2(definition),
|
|
239
|
-
execute: async (operation, input) => {
|
|
240
|
-
await instance.start();
|
|
241
|
-
return instance.call(operation, input);
|
|
242
|
-
}
|
|
243
|
-
};
|
|
244
|
-
}
|
|
245
|
-
var GitHubProviderService = serviceFacade(github);
|
|
246
|
-
var GitLabProviderService = serviceFacade(gitlab);
|
|
247
|
-
var DropboxProviderService = serviceFacade(dropbox);
|
|
248
|
-
var BackblazeB2ProviderService = serviceFacade(backblaze);
|
|
249
|
-
var GoogleDriveProviderService = serviceFacade(drive);
|
|
250
|
-
|
|
251
|
-
export {
|
|
252
|
-
CloudflareProviderService,
|
|
253
|
-
VercelProviderService,
|
|
254
|
-
GoogleAccountProviderService,
|
|
255
|
-
GeminiProviderService,
|
|
256
|
-
GitHubProviderService,
|
|
257
|
-
GitLabProviderService,
|
|
258
|
-
DropboxProviderService,
|
|
259
|
-
BackblazeB2ProviderService,
|
|
260
|
-
GoogleDriveProviderService
|
|
261
|
-
};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @file LuthDiscoveryService.ts
|
|
3
|
-
* @description Universal Luth Auth Service Discovery with multi-deployment fallback and round-robin.
|
|
4
|
-
* Runs identically in Node.js, Vercel Serverless, and Cloudflare Workers (< 200 lines).
|
|
5
|
-
*/
|
|
6
|
-
export declare function getRegisteredLuthDeploymentUrls(queryDb?: (sql: string, params?: unknown[]) => Promise<{
|
|
7
|
-
rows: any[];
|
|
8
|
-
}>): Promise<string[]>;
|
|
9
|
-
export declare function getPrimaryLuthDeploymentUrl(queryDb?: (sql: string, params?: unknown[]) => Promise<{
|
|
10
|
-
rows: any[];
|
|
11
|
-
}>): Promise<string>;
|
|
12
|
-
export declare function getNextLuthDeploymentUrl(queryDb?: (sql: string, params?: unknown[]) => Promise<{
|
|
13
|
-
rows: any[];
|
|
14
|
-
}>): Promise<string>;
|
|
15
|
-
export declare function clearLuthDiscoveryCache(): void;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './LuthDiscoveryService.js';
|