@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, getCurrentPlatform, loadContextLoaderConfig, removeContextLoaderEntry, setCurrentContextLoader, } from "../config/store.js";
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 platform = getCurrentPlatform();
7
- if (!platform) {
8
- throw new Error("No platform selected. Run: kweaver auth <platform-url>");
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 platform = getCurrentPlatform();
122
- if (!platform) {
123
- console.error("No platform selected. Run: kweaver auth <platform-url>");
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kweaver-ai/kweaver-sdk",
3
- "version": "0.6.8",
3
+ "version": "0.6.9",
4
4
  "description": "KWeaver TypeScript SDK — CLI tool and programmatic API for knowledge networks and Decision Agents.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",