@thyn-ai/sqai 0.1.11 → 0.1.13
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/dist/index.cjs +24 -24
- package/dist/index.d.cts +303 -165
- package/dist/index.d.ts +303 -165
- package/dist/index.js +24 -24
- package/dist/unsafe.cjs +0 -3
- package/dist/unsafe.d.cts +3 -7
- package/dist/unsafe.d.ts +3 -7
- package/dist/unsafe.js +0 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1626,7 +1626,7 @@ var RuntimeProvisioner = class _RuntimeProvisioner {
|
|
|
1626
1626
|
await removeQuietly(extractDir);
|
|
1627
1627
|
}
|
|
1628
1628
|
}
|
|
1629
|
-
/** Spawn the installed bundle's daemon through
|
|
1629
|
+
/** Spawn the installed bundle's daemon through managed runtime auto-start. */
|
|
1630
1630
|
async spawnInstalled(platformKey, installed, endpoint) {
|
|
1631
1631
|
const version = installed.manifest.runtime_bundle_version;
|
|
1632
1632
|
let entryRelative;
|
|
@@ -1913,7 +1913,7 @@ function matchesWireType(type, value) {
|
|
|
1913
1913
|
// src/sqai.ts
|
|
1914
1914
|
var SQAI = class {
|
|
1915
1915
|
mode;
|
|
1916
|
-
|
|
1916
|
+
runtimeClient;
|
|
1917
1917
|
rawRuntime;
|
|
1918
1918
|
policy;
|
|
1919
1919
|
tenantId;
|
|
@@ -1954,12 +1954,12 @@ var SQAI = class {
|
|
|
1954
1954
|
...config.maxRetries !== void 0 ? { maxRetries: config.maxRetries } : {}
|
|
1955
1955
|
});
|
|
1956
1956
|
}
|
|
1957
|
-
this.
|
|
1957
|
+
this.runtimeClient = this.rawRuntime;
|
|
1958
1958
|
}
|
|
1959
1959
|
// ── Query plane ────────────────────────────────────────────────────────────
|
|
1960
1960
|
async connect(source = null, options = {}) {
|
|
1961
1961
|
try {
|
|
1962
|
-
const registration = await this.
|
|
1962
|
+
const registration = await this.runtimeClient.connect(source, options);
|
|
1963
1963
|
const mapped = mapSource(registration);
|
|
1964
1964
|
if (this.sources.has(mapped.name)) {
|
|
1965
1965
|
const existing = this.sources.get(mapped.name);
|
|
@@ -1980,78 +1980,78 @@ var SQAI = class {
|
|
|
1980
1980
|
}
|
|
1981
1981
|
}
|
|
1982
1982
|
async createConnector(request2) {
|
|
1983
|
-
const createConnector = this.
|
|
1983
|
+
const createConnector = this.runtimeClient.createConnector;
|
|
1984
1984
|
if (typeof createConnector !== "function") {
|
|
1985
1985
|
throw unsupportedSubstrateOperation("createConnector");
|
|
1986
1986
|
}
|
|
1987
1987
|
try {
|
|
1988
|
-
return await createConnector.call(this.
|
|
1988
|
+
return await createConnector.call(this.runtimeClient, request2);
|
|
1989
1989
|
} catch (error) {
|
|
1990
1990
|
throw fromEngineError(error);
|
|
1991
1991
|
}
|
|
1992
1992
|
}
|
|
1993
1993
|
async listConnectors(options = {}) {
|
|
1994
|
-
const listConnectors = this.
|
|
1994
|
+
const listConnectors = this.runtimeClient.listConnectors;
|
|
1995
1995
|
if (typeof listConnectors !== "function") {
|
|
1996
1996
|
throw unsupportedSubstrateOperation("listConnectors");
|
|
1997
1997
|
}
|
|
1998
1998
|
try {
|
|
1999
|
-
return await listConnectors.call(this.
|
|
1999
|
+
return await listConnectors.call(this.runtimeClient, options);
|
|
2000
2000
|
} catch (error) {
|
|
2001
2001
|
throw fromEngineError(error);
|
|
2002
2002
|
}
|
|
2003
2003
|
}
|
|
2004
2004
|
async getConnector(connectorId) {
|
|
2005
|
-
const getConnector = this.
|
|
2005
|
+
const getConnector = this.runtimeClient.getConnector;
|
|
2006
2006
|
if (typeof getConnector !== "function") {
|
|
2007
2007
|
throw unsupportedSubstrateOperation("getConnector");
|
|
2008
2008
|
}
|
|
2009
2009
|
try {
|
|
2010
|
-
return await getConnector.call(this.
|
|
2010
|
+
return await getConnector.call(this.runtimeClient, connectorId);
|
|
2011
2011
|
} catch (error) {
|
|
2012
2012
|
throw fromEngineError(error);
|
|
2013
2013
|
}
|
|
2014
2014
|
}
|
|
2015
2015
|
async updateConnector(connectorId, request2) {
|
|
2016
|
-
const updateConnector = this.
|
|
2016
|
+
const updateConnector = this.runtimeClient.updateConnector;
|
|
2017
2017
|
if (typeof updateConnector !== "function") {
|
|
2018
2018
|
throw unsupportedSubstrateOperation("updateConnector");
|
|
2019
2019
|
}
|
|
2020
2020
|
try {
|
|
2021
|
-
return await updateConnector.call(this.
|
|
2021
|
+
return await updateConnector.call(this.runtimeClient, connectorId, request2);
|
|
2022
2022
|
} catch (error) {
|
|
2023
2023
|
throw fromEngineError(error);
|
|
2024
2024
|
}
|
|
2025
2025
|
}
|
|
2026
2026
|
async testConnector(connectorIdOrConnector) {
|
|
2027
|
-
const testConnector = this.
|
|
2027
|
+
const testConnector = this.runtimeClient.testConnector;
|
|
2028
2028
|
if (typeof testConnector !== "function") {
|
|
2029
2029
|
throw unsupportedSubstrateOperation("testConnector");
|
|
2030
2030
|
}
|
|
2031
2031
|
try {
|
|
2032
|
-
return await testConnector.call(this.
|
|
2032
|
+
return await testConnector.call(this.runtimeClient, connectorIdOrConnector);
|
|
2033
2033
|
} catch (error) {
|
|
2034
2034
|
throw fromEngineError(error);
|
|
2035
2035
|
}
|
|
2036
2036
|
}
|
|
2037
2037
|
async browseConnector(connectorIdOrConnector) {
|
|
2038
|
-
const browseConnector = this.
|
|
2038
|
+
const browseConnector = this.runtimeClient.browseConnector;
|
|
2039
2039
|
if (typeof browseConnector !== "function") {
|
|
2040
2040
|
throw unsupportedSubstrateOperation("browseConnector");
|
|
2041
2041
|
}
|
|
2042
2042
|
try {
|
|
2043
|
-
return await browseConnector.call(this.
|
|
2043
|
+
return await browseConnector.call(this.runtimeClient, connectorIdOrConnector);
|
|
2044
2044
|
} catch (error) {
|
|
2045
2045
|
throw fromEngineError(error);
|
|
2046
2046
|
}
|
|
2047
2047
|
}
|
|
2048
2048
|
async deleteConnector(connectorId) {
|
|
2049
|
-
const deleteConnector = this.
|
|
2049
|
+
const deleteConnector = this.runtimeClient.deleteConnector;
|
|
2050
2050
|
if (typeof deleteConnector !== "function") {
|
|
2051
2051
|
throw unsupportedSubstrateOperation("deleteConnector");
|
|
2052
2052
|
}
|
|
2053
2053
|
try {
|
|
2054
|
-
await deleteConnector.call(this.
|
|
2054
|
+
await deleteConnector.call(this.runtimeClient, connectorId);
|
|
2055
2055
|
} catch (error) {
|
|
2056
2056
|
throw fromEngineError(error);
|
|
2057
2057
|
}
|
|
@@ -2062,28 +2062,28 @@ var SQAI = class {
|
|
|
2062
2062
|
async resolve(spec) {
|
|
2063
2063
|
this.checkQueryPolicy(spec);
|
|
2064
2064
|
try {
|
|
2065
|
-
return await this.
|
|
2065
|
+
return await this.runtimeClient.resolve(spec);
|
|
2066
2066
|
} catch (error) {
|
|
2067
2067
|
throw fromEngineError(error);
|
|
2068
2068
|
}
|
|
2069
2069
|
}
|
|
2070
2070
|
async query(plan) {
|
|
2071
2071
|
try {
|
|
2072
|
-
return await this.
|
|
2072
|
+
return await this.runtimeClient.query(plan);
|
|
2073
2073
|
} catch (error) {
|
|
2074
2074
|
throw fromEngineError(error);
|
|
2075
2075
|
}
|
|
2076
2076
|
}
|
|
2077
2077
|
async queryWithMetadata(plan) {
|
|
2078
2078
|
try {
|
|
2079
|
-
return await this.
|
|
2079
|
+
return await this.runtimeClient.queryWithMetadata(plan);
|
|
2080
2080
|
} catch (error) {
|
|
2081
2081
|
throw fromEngineError(error);
|
|
2082
2082
|
}
|
|
2083
2083
|
}
|
|
2084
2084
|
async verify(plan) {
|
|
2085
2085
|
try {
|
|
2086
|
-
return await this.
|
|
2086
|
+
return await this.runtimeClient.verify(plan);
|
|
2087
2087
|
} catch (error) {
|
|
2088
2088
|
throw fromEngineError(error);
|
|
2089
2089
|
}
|
|
@@ -2104,7 +2104,7 @@ var SQAI = class {
|
|
|
2104
2104
|
for (const column of columns) {
|
|
2105
2105
|
checkFieldAllowed(this.policy, sourceName, column);
|
|
2106
2106
|
}
|
|
2107
|
-
if (typeof this.
|
|
2107
|
+
if (typeof this.runtimeClient.extractColumns !== "function") {
|
|
2108
2108
|
throw new SqaiError(
|
|
2109
2109
|
"unsupported_operation",
|
|
2110
2110
|
"The installed SQAI package does not provide extractColumns; upgrade SQAI.",
|
|
@@ -2112,7 +2112,7 @@ var SQAI = class {
|
|
|
2112
2112
|
);
|
|
2113
2113
|
}
|
|
2114
2114
|
try {
|
|
2115
|
-
return await this.
|
|
2115
|
+
return await this.runtimeClient.extractColumns(sourceName, columns, options);
|
|
2116
2116
|
} catch (error) {
|
|
2117
2117
|
throw fromEngineError(error);
|
|
2118
2118
|
}
|
package/dist/unsafe.cjs
CHANGED
|
@@ -20,7 +20,6 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
20
20
|
// src/unsafe.ts
|
|
21
21
|
var unsafe_exports = {};
|
|
22
22
|
__export(unsafe_exports, {
|
|
23
|
-
getUnsafeAlgentaRuntime: () => getUnsafeAlgentaRuntime,
|
|
24
23
|
getUnsafeRuntime: () => getUnsafeRuntime
|
|
25
24
|
});
|
|
26
25
|
module.exports = __toCommonJS(unsafe_exports);
|
|
@@ -32,9 +31,7 @@ function getUnsafeRuntime(options = {}) {
|
|
|
32
31
|
...options.baseUrl ? { baseUrl: options.baseUrl } : {}
|
|
33
32
|
});
|
|
34
33
|
}
|
|
35
|
-
var getUnsafeAlgentaRuntime = getUnsafeRuntime;
|
|
36
34
|
// Annotate the CommonJS export names for ESM import in node:
|
|
37
35
|
0 && (module.exports = {
|
|
38
|
-
getUnsafeAlgentaRuntime,
|
|
39
36
|
getUnsafeRuntime
|
|
40
37
|
});
|
package/dist/unsafe.d.cts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { Runtime } from 'algenta-sdk';
|
|
2
|
-
|
|
3
1
|
/** Explicit escape hatch — NOT part of the SQAI contract.
|
|
4
2
|
*
|
|
5
3
|
* The read-only, deterministic, policy, provenance, and compatibility
|
|
@@ -9,14 +7,12 @@ import { Runtime } from 'algenta-sdk';
|
|
|
9
7
|
* @thyn-ai/sqai-ai-sdk. Import from "@thyn-ai/sqai/unsafe" only when you own the
|
|
10
8
|
* consequences.
|
|
11
9
|
*/
|
|
12
|
-
|
|
13
10
|
interface UnsafeRuntimeOptions {
|
|
14
11
|
mode?: "local" | "api" | "deployment";
|
|
15
12
|
apiKey?: string;
|
|
16
13
|
baseUrl?: string;
|
|
17
14
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
declare const getUnsafeAlgentaRuntime: typeof getUnsafeRuntime;
|
|
15
|
+
type UnsafeRuntime = unknown;
|
|
16
|
+
declare function getUnsafeRuntime(options?: UnsafeRuntimeOptions): UnsafeRuntime;
|
|
21
17
|
|
|
22
|
-
export { type
|
|
18
|
+
export { type UnsafeRuntime, type UnsafeRuntimeOptions, getUnsafeRuntime };
|
package/dist/unsafe.d.ts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { Runtime } from 'algenta-sdk';
|
|
2
|
-
|
|
3
1
|
/** Explicit escape hatch — NOT part of the SQAI contract.
|
|
4
2
|
*
|
|
5
3
|
* The read-only, deterministic, policy, provenance, and compatibility
|
|
@@ -9,14 +7,12 @@ import { Runtime } from 'algenta-sdk';
|
|
|
9
7
|
* @thyn-ai/sqai-ai-sdk. Import from "@thyn-ai/sqai/unsafe" only when you own the
|
|
10
8
|
* consequences.
|
|
11
9
|
*/
|
|
12
|
-
|
|
13
10
|
interface UnsafeRuntimeOptions {
|
|
14
11
|
mode?: "local" | "api" | "deployment";
|
|
15
12
|
apiKey?: string;
|
|
16
13
|
baseUrl?: string;
|
|
17
14
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
declare const getUnsafeAlgentaRuntime: typeof getUnsafeRuntime;
|
|
15
|
+
type UnsafeRuntime = unknown;
|
|
16
|
+
declare function getUnsafeRuntime(options?: UnsafeRuntimeOptions): UnsafeRuntime;
|
|
21
17
|
|
|
22
|
-
export { type
|
|
18
|
+
export { type UnsafeRuntime, type UnsafeRuntimeOptions, getUnsafeRuntime };
|
package/dist/unsafe.js
CHANGED
package/package.json
CHANGED