@kweaver-ai/kweaver-sdk 0.6.8 → 0.6.9
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,11 +1,11 @@
|
|
|
1
|
-
import { ensureValidToken, formatHttpError, with401RefreshRetry } from "../auth/oauth.js";
|
|
1
|
+
import { ensureValidToken, formatHttpError, resolveActivePlatform, with401RefreshRetry } from "../auth/oauth.js";
|
|
2
2
|
import { knSearch, knSchemaSearch, queryObjectInstance, queryInstanceSubgraph, getLogicPropertiesValues, getActionInfo, listTools, listResources, readResource, listResourceTemplates, listPrompts, getPrompt, } from "../api/context-loader.js";
|
|
3
|
-
import { addContextLoaderEntry, getCurrentContextLoaderKn,
|
|
3
|
+
import { addContextLoaderEntry, getCurrentContextLoaderKn, loadContextLoaderConfig, removeContextLoaderEntry, setCurrentContextLoader, } from "../config/store.js";
|
|
4
4
|
const MCP_NOT_CONFIGURED = "Context-loader MCP is not configured. Run: kweaver context-loader config set --kn-id <kn-id>";
|
|
5
5
|
function ensureContextLoaderConfig() {
|
|
6
|
-
const
|
|
7
|
-
if (!
|
|
8
|
-
throw new Error("No platform selected.
|
|
6
|
+
const active = resolveActivePlatform();
|
|
7
|
+
if (!active) {
|
|
8
|
+
throw new Error("No platform selected. Set KWEAVER_BASE_URL or run: kweaver auth <platform-url>");
|
|
9
9
|
}
|
|
10
10
|
const kn = getCurrentContextLoaderKn();
|
|
11
11
|
if (!kn) {
|
|
@@ -118,11 +118,12 @@ Subcommands:
|
|
|
118
118
|
show Show current config (knId + mcpUrl)`);
|
|
119
119
|
return 0;
|
|
120
120
|
}
|
|
121
|
-
const
|
|
122
|
-
if (!
|
|
123
|
-
console.error("No platform selected.
|
|
121
|
+
const active = resolveActivePlatform();
|
|
122
|
+
if (!active) {
|
|
123
|
+
console.error("No platform selected. Set KWEAVER_BASE_URL or run: kweaver auth <platform-url>");
|
|
124
124
|
return 1;
|
|
125
125
|
}
|
|
126
|
+
const platform = active.url;
|
|
126
127
|
if (action === "show") {
|
|
127
128
|
const kn = getCurrentContextLoaderKn();
|
|
128
129
|
if (!kn) {
|
package/package.json
CHANGED