@xiashe/sdk 0.1.35-superconnector.3 → 0.1.36
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/index.mjs +24 -1
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -13,7 +13,7 @@ export { createRuntimeAgentHost } from './runtimeAgentHost.mjs';
|
|
|
13
13
|
export { createRuntimeAgentSession } from './runtimeAgent.mjs';
|
|
14
14
|
export { serveRuntimeMcp } from './runtimeMcp.mjs';
|
|
15
15
|
|
|
16
|
-
export const VERSION = '0.1.
|
|
16
|
+
export const VERSION = '0.1.36';
|
|
17
17
|
export { probeRuntimeGateway, runtimeSetupTemplate } from './runtimeSetup.mjs';
|
|
18
18
|
|
|
19
19
|
export const DEFAULTS = {
|
|
@@ -452,6 +452,29 @@ export class XiasheClient {
|
|
|
452
452
|
return this.query(api.users.getById, this.authArgs({ userId: this.profile.session.userId }));
|
|
453
453
|
}
|
|
454
454
|
|
|
455
|
+
assertNumbersEnvironment() {
|
|
456
|
+
const pairs = new Map([
|
|
457
|
+
['https://actions.xiashe.chat', 'https://api.xiashe.chat'],
|
|
458
|
+
['https://actions.projectphenix.site', 'https://api.projectphenix.site']
|
|
459
|
+
]);
|
|
460
|
+
const actions = normalizeBaseUrl(this.profile.actionsUrl);
|
|
461
|
+
if (this.profile.market !== 'cn' || !pairs.has(actions) || pairs.get(actions) !== normalizeBaseUrl(this.profile.convexUrl)) {
|
|
462
|
+
throw new XiasheError('Skill numbers require matching official XiaShe backend and actions URLs.', { code: 'NUMBER_ENVIRONMENT_INVALID' });
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
async resolveSkillNumber(number) {
|
|
467
|
+
this.assertNumbersEnvironment();
|
|
468
|
+
return this.query(api.skillNumbers.resolve, { number: String(number) });
|
|
469
|
+
}
|
|
470
|
+
async acquireSkillNumber(number) {
|
|
471
|
+
this.assertNumbersEnvironment();
|
|
472
|
+
return this.mutation(api.skillNumbers.acquire, this.authArgs({ number: String(number) }));
|
|
473
|
+
}
|
|
474
|
+
async setSkillNumberPublic(registryEntryId, enabled) {
|
|
475
|
+
this.assertNumbersEnvironment();
|
|
476
|
+
return this.mutation(api.skillNumbers.setPublic, this.authArgs({ registryEntryId, enabled }));
|
|
477
|
+
}
|
|
455
478
|
async listConnections() {
|
|
456
479
|
return this.query(api.connections.listForUser, this.authArgs());
|
|
457
480
|
}
|