@xiashe/sdk 0.1.35-superconnector.3 → 0.1.37
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 +29 -2
- package/package.json +1 -1
- package/runtime.mjs +1 -1
package/index.mjs
CHANGED
|
@@ -5,7 +5,7 @@ import os from 'node:os';
|
|
|
5
5
|
import path from 'node:path';
|
|
6
6
|
import { ConvexHttpClient } from 'convex/browser';
|
|
7
7
|
import { anyApi as api } from 'convex/server';
|
|
8
|
-
export { installRuntimePackage, runtimePrincipal, writeRuntimeRecord } from './runtime.mjs';
|
|
8
|
+
export { verifyDirectory as verifyRuntimePackageDirectory, inspectRuntimeArchive, installRuntimePackage, runtimePrincipal, writeRuntimeRecord } from './runtime.mjs';
|
|
9
9
|
export { reportRuntimeResult, retryRuntimeResults } from './runtimeOutbox.mjs';
|
|
10
10
|
export { runRuntimeScript } from './runtimeScript.mjs';
|
|
11
11
|
export { serveRuntimeScriptHost, retryRuntimeHostResults } from './runtimeHost.mjs';
|
|
@@ -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.37';
|
|
17
17
|
export { probeRuntimeGateway, runtimeSetupTemplate } from './runtimeSetup.mjs';
|
|
18
18
|
|
|
19
19
|
export const DEFAULTS = {
|
|
@@ -452,6 +452,33 @@ 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 skillNumberAnalytics(number) {
|
|
471
|
+
this.assertNumbersEnvironment();
|
|
472
|
+
return this.query(api.skillNumbers.analytics, this.authArgs({ number: String(number) }));
|
|
473
|
+
}
|
|
474
|
+
async acquireSkillNumber(number) {
|
|
475
|
+
this.assertNumbersEnvironment();
|
|
476
|
+
return this.mutation(api.skillNumbers.acquire, this.authArgs({ number: String(number) }));
|
|
477
|
+
}
|
|
478
|
+
async setSkillNumberPublic(registryEntryId, enabled) {
|
|
479
|
+
this.assertNumbersEnvironment();
|
|
480
|
+
return this.mutation(api.skillNumbers.setPublic, this.authArgs({ registryEntryId, enabled }));
|
|
481
|
+
}
|
|
455
482
|
async listConnections() {
|
|
456
483
|
return this.query(api.connections.listForUser, this.authArgs());
|
|
457
484
|
}
|
package/package.json
CHANGED
package/runtime.mjs
CHANGED
|
@@ -72,7 +72,7 @@ export function runtimePrincipal(client) {
|
|
|
72
72
|
return digest(`${new URL(client.profile.convexUrl).origin}\0${userId}`);
|
|
73
73
|
}
|
|
74
74
|
|
|
75
|
-
async function verifyDirectory(directory, files) {
|
|
75
|
+
export async function verifyDirectory(directory, files) {
|
|
76
76
|
const expected = new Map(files.map(file => [file.path, file]));
|
|
77
77
|
let count = 0;
|
|
78
78
|
const walk = async (folder, prefix = '') => {
|