@ultrst-armada/kloks 1.22.0 → 1.22.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schema": 1,
|
|
3
3
|
"packageName": "@ultrst-armada/kloks",
|
|
4
|
-
"version": "1.22.
|
|
5
|
-
"sourceCommit": "
|
|
4
|
+
"version": "1.22.2",
|
|
5
|
+
"sourceCommit": "27518ba86f7f0a405ec7ce1582b4ba485f71b550",
|
|
6
6
|
"releaseWorkflow": "npm Release",
|
|
7
|
-
"workflowRunId": "
|
|
7
|
+
"workflowRunId": "41128230877"
|
|
8
8
|
}
|
package/package.json
CHANGED
|
@@ -55,14 +55,6 @@ import {
|
|
|
55
55
|
useBackend,
|
|
56
56
|
useBackendClient
|
|
57
57
|
} from "./chunk-N7OUR5R5.js";
|
|
58
|
-
import {
|
|
59
|
-
AuditLogger,
|
|
60
|
-
ControlPlaneManager,
|
|
61
|
-
DatabaseClusterManager,
|
|
62
|
-
detectDatabaseEngine,
|
|
63
|
-
getSystemDatabaseUrls,
|
|
64
|
-
resolveSystemDatabaseClusterNodes
|
|
65
|
-
} from "./chunk-RCCQ7IRM.js";
|
|
66
58
|
import {
|
|
67
59
|
BackendRegistry,
|
|
68
60
|
ConcurrencyConflictError,
|
|
@@ -87,6 +79,14 @@ import {
|
|
|
87
79
|
WebSocketTransport,
|
|
88
80
|
createBackendClient
|
|
89
81
|
} from "./chunk-NIP22V2G.js";
|
|
82
|
+
import {
|
|
83
|
+
AuditLogger,
|
|
84
|
+
ControlPlaneManager,
|
|
85
|
+
DatabaseClusterManager,
|
|
86
|
+
detectDatabaseEngine,
|
|
87
|
+
getSystemDatabaseUrls,
|
|
88
|
+
resolveSystemDatabaseClusterNodes
|
|
89
|
+
} from "./chunk-RCCQ7IRM.js";
|
|
90
90
|
import {
|
|
91
91
|
AgentHarnessRuntime,
|
|
92
92
|
AgentHarnessServiceDefinition,
|
|
@@ -336,11 +336,14 @@ interface SrklAccountManifest {
|
|
|
336
336
|
appName?: string;
|
|
337
337
|
categories?: EcosystemServiceCategory[];
|
|
338
338
|
requiredServices?: string[];
|
|
339
|
+
includeCredentials?: boolean;
|
|
339
340
|
}
|
|
340
341
|
interface SrklAccountClientOptions {
|
|
341
342
|
baseUrl: string;
|
|
342
343
|
userId: string;
|
|
343
344
|
appId: string;
|
|
345
|
+
token?: string;
|
|
346
|
+
sessionToken?: string;
|
|
344
347
|
fetchImpl?: typeof fetch;
|
|
345
348
|
}
|
|
346
349
|
interface SrklAccountSyncResult {
|
|
@@ -354,10 +357,17 @@ declare class SrklAccountClient {
|
|
|
354
357
|
private readonly baseUrl;
|
|
355
358
|
private readonly userId;
|
|
356
359
|
private readonly appId;
|
|
360
|
+
private readonly token?;
|
|
361
|
+
private readonly sessionToken?;
|
|
362
|
+
private cachedAccounts;
|
|
357
363
|
constructor(options: SrklAccountClientOptions);
|
|
358
364
|
sync(manifest?: SrklAccountManifest): Promise<SrklAccountSyncResult>;
|
|
359
365
|
list(manifest?: SrklAccountManifest): Promise<SrklAccountSyncResult>;
|
|
360
|
-
|
|
366
|
+
getCachedAccounts(): SrklAccount[];
|
|
367
|
+
getCachedByService(serviceId: string): SrklAccount | undefined;
|
|
368
|
+
getByService(serviceId: string, options?: {
|
|
369
|
+
forceSync?: boolean;
|
|
370
|
+
}): Promise<SrklAccount | undefined>;
|
|
361
371
|
}
|
|
362
372
|
declare function createSrklAccountClient(options: SrklAccountClientOptions): SrklAccountClient;
|
|
363
373
|
declare function mergeSrklAccounts<T extends {
|
|
@@ -2607,30 +2607,64 @@ var SrklAccountClient = class {
|
|
|
2607
2607
|
baseUrl;
|
|
2608
2608
|
userId;
|
|
2609
2609
|
appId;
|
|
2610
|
+
token;
|
|
2611
|
+
sessionToken;
|
|
2612
|
+
cachedAccounts = [];
|
|
2610
2613
|
constructor(options) {
|
|
2611
2614
|
this.fetchImpl = options.fetchImpl || fetch;
|
|
2612
2615
|
this.baseUrl = options.baseUrl.replace(/\/+$/, "");
|
|
2613
2616
|
this.userId = options.userId;
|
|
2614
2617
|
this.appId = options.appId;
|
|
2618
|
+
this.token = options.token;
|
|
2619
|
+
this.sessionToken = options.sessionToken;
|
|
2615
2620
|
}
|
|
2616
2621
|
async sync(manifest = {}) {
|
|
2622
|
+
const payload = {
|
|
2623
|
+
...manifest,
|
|
2624
|
+
appId: manifest.appId || this.appId,
|
|
2625
|
+
includeCredentials: manifest.includeCredentials ?? true
|
|
2626
|
+
};
|
|
2627
|
+
const headers = {
|
|
2628
|
+
"content-type": "application/json",
|
|
2629
|
+
"x-user-id": this.userId,
|
|
2630
|
+
"x-app-id": this.appId
|
|
2631
|
+
};
|
|
2632
|
+
if (this.token) {
|
|
2633
|
+
headers.authorization = this.token.startsWith("Bearer ") ? this.token : `Bearer ${this.token}`;
|
|
2634
|
+
}
|
|
2635
|
+
if (this.sessionToken) {
|
|
2636
|
+
headers["x-session-token"] = this.sessionToken;
|
|
2637
|
+
}
|
|
2617
2638
|
const response = await this.fetchImpl(`${this.baseUrl}/api/ecosystem/accounts`, {
|
|
2618
2639
|
method: "POST",
|
|
2619
|
-
headers
|
|
2620
|
-
|
|
2621
|
-
"x-user-id": this.userId,
|
|
2622
|
-
"x-app-id": this.appId
|
|
2623
|
-
},
|
|
2624
|
-
body: JSON.stringify({ ...manifest, appId: manifest.appId || this.appId })
|
|
2640
|
+
headers,
|
|
2641
|
+
body: JSON.stringify(payload)
|
|
2625
2642
|
});
|
|
2626
2643
|
if (!response.ok) throw new Error(`SRKL account sync failed: ${response.status}`);
|
|
2627
|
-
|
|
2644
|
+
const result = await response.json();
|
|
2645
|
+
this.cachedAccounts = result.accounts || [];
|
|
2646
|
+
return result;
|
|
2628
2647
|
}
|
|
2629
2648
|
async list(manifest = {}) {
|
|
2630
|
-
return this.sync(
|
|
2649
|
+
return this.sync({
|
|
2650
|
+
...manifest,
|
|
2651
|
+
includeCredentials: manifest.includeCredentials ?? false
|
|
2652
|
+
});
|
|
2631
2653
|
}
|
|
2632
|
-
|
|
2633
|
-
|
|
2654
|
+
getCachedAccounts() {
|
|
2655
|
+
return this.cachedAccounts;
|
|
2656
|
+
}
|
|
2657
|
+
getCachedByService(serviceId) {
|
|
2658
|
+
return this.cachedAccounts.find(
|
|
2659
|
+
(account) => account.serviceId.toLowerCase() === serviceId.toLowerCase() || account.provider.toLowerCase() === serviceId.toLowerCase()
|
|
2660
|
+
);
|
|
2661
|
+
}
|
|
2662
|
+
async getByService(serviceId, options) {
|
|
2663
|
+
if (!options?.forceSync) {
|
|
2664
|
+
const cached = this.getCachedByService(serviceId);
|
|
2665
|
+
if (cached) return cached;
|
|
2666
|
+
}
|
|
2667
|
+
const result = await this.sync({ requiredServices: [serviceId], includeCredentials: true });
|
|
2634
2668
|
return result.accounts.find(
|
|
2635
2669
|
(account) => account.serviceId.toLowerCase() === serviceId.toLowerCase() || account.provider.toLowerCase() === serviceId.toLowerCase()
|
|
2636
2670
|
);
|
|
@@ -7,15 +7,6 @@ import {
|
|
|
7
7
|
instantiateSubgraph
|
|
8
8
|
} from "./chunk-S22PMERU.js";
|
|
9
9
|
import "./chunk-RHRXPY2U.js";
|
|
10
|
-
import {
|
|
11
|
-
LifecycleCycleError,
|
|
12
|
-
LifecycleGraph,
|
|
13
|
-
SKIPO_STATE,
|
|
14
|
-
SkipoStateEngine,
|
|
15
|
-
useLifecycleScope,
|
|
16
|
-
useSkipoBind,
|
|
17
|
-
useSkipoState
|
|
18
|
-
} from "./chunk-EW4ACSZB.js";
|
|
19
10
|
import {
|
|
20
11
|
AttractionEngine,
|
|
21
12
|
GhostInferenceEngine,
|
|
@@ -58,6 +49,15 @@ import {
|
|
|
58
49
|
import {
|
|
59
50
|
CompatibilityMatrix
|
|
60
51
|
} from "./chunk-ISFNY7EZ.js";
|
|
52
|
+
import {
|
|
53
|
+
LifecycleCycleError,
|
|
54
|
+
LifecycleGraph,
|
|
55
|
+
SKIPO_STATE,
|
|
56
|
+
SkipoStateEngine,
|
|
57
|
+
useLifecycleScope,
|
|
58
|
+
useSkipoBind,
|
|
59
|
+
useSkipoState
|
|
60
|
+
} from "./chunk-EW4ACSZB.js";
|
|
61
61
|
import "./chunk-QGM4M3NI.js";
|
|
62
62
|
|
|
63
63
|
// ../../node_modules/.pnpm/@ultrst-armada+krnl@1.0.9_@types+node@22.20.5/node_modules/@ultrst-armada/krnl/packages/core/dist/index.js
|