@vm0/cli 9.145.9 → 9.145.10
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/{chunk-K4JU76G2.js → chunk-2TVOATAU.js} +17 -36
- package/{chunk-K4JU76G2.js.map → chunk-2TVOATAU.js.map} +1 -1
- package/index.js +9 -9
- package/index.js.map +1 -1
- package/package.json +1 -1
- package/zero.js +24 -25
- package/zero.js.map +1 -1
package/package.json
CHANGED
package/zero.js
CHANGED
|
@@ -70,7 +70,6 @@ import {
|
|
|
70
70
|
initSlackFileUpload,
|
|
71
71
|
initTelegramFileUpload,
|
|
72
72
|
inviteZeroOrgMember,
|
|
73
|
-
isFeatureEnabled,
|
|
74
73
|
isFirewallConnectorType,
|
|
75
74
|
isInteractive,
|
|
76
75
|
isUUID,
|
|
@@ -105,6 +104,7 @@ import {
|
|
|
105
104
|
saveConfig,
|
|
106
105
|
searchConnectors,
|
|
107
106
|
searchZeroChat,
|
|
107
|
+
searchZeroConnectors,
|
|
108
108
|
searchZeroLogs,
|
|
109
109
|
sendChatMessage,
|
|
110
110
|
sendSlackMessage,
|
|
@@ -128,7 +128,7 @@ import {
|
|
|
128
128
|
upsertZeroOrgModelProvider,
|
|
129
129
|
withErrorHandler,
|
|
130
130
|
zeroAgentCustomSkillNameSchema
|
|
131
|
-
} from "./chunk-
|
|
131
|
+
} from "./chunk-2TVOATAU.js";
|
|
132
132
|
import {
|
|
133
133
|
__toESM,
|
|
134
134
|
init_esm_shims
|
|
@@ -1897,11 +1897,14 @@ function padEndAnsi(s, width) {
|
|
|
1897
1897
|
}
|
|
1898
1898
|
|
|
1899
1899
|
// src/commands/zero/connector/list.ts
|
|
1900
|
+
function isConnectorType(type) {
|
|
1901
|
+
return type in CONNECTOR_TYPES;
|
|
1902
|
+
}
|
|
1900
1903
|
var listCommand6 = new Command().name("list").alias("ls").description("List all connectors and their status").option("--agent <id>", "Show per-agent authorization column").action(
|
|
1901
1904
|
withErrorHandler(async (options) => {
|
|
1902
|
-
const [{ connectors },
|
|
1905
|
+
const [{ connectors }, availableCatalog, agentCtx] = await Promise.all([
|
|
1903
1906
|
listZeroConnectors(),
|
|
1904
|
-
|
|
1907
|
+
searchZeroConnectors(),
|
|
1905
1908
|
resolveAgentContext(options.agent)
|
|
1906
1909
|
]);
|
|
1907
1910
|
const connectedMap = new Map(
|
|
@@ -1909,17 +1912,9 @@ var listCommand6 = new Command().name("list").alias("ls").description("List all
|
|
|
1909
1912
|
return [c.type, c];
|
|
1910
1913
|
})
|
|
1911
1914
|
);
|
|
1912
|
-
const
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
const config = CONNECTOR_TYPES[type];
|
|
1916
|
-
const flag = config.featureFlag;
|
|
1917
|
-
const hasApiToken = "api-token" in config.authMethods;
|
|
1918
|
-
if (flag && !isFeatureEnabled(flag, { orgId }) && (!hasApiToken || config.strictFeatureFlag)) {
|
|
1919
|
-
continue;
|
|
1920
|
-
}
|
|
1921
|
-
allTypes.push(type);
|
|
1922
|
-
}
|
|
1915
|
+
const allTypes = availableCatalog.connectors.map((connector) => {
|
|
1916
|
+
return connector.id;
|
|
1917
|
+
}).filter(isConnectorType);
|
|
1923
1918
|
const typeWidth = Math.max(
|
|
1924
1919
|
4,
|
|
1925
1920
|
...allTypes.map((t) => {
|
|
@@ -1961,6 +1956,9 @@ var listCommand6 = new Command().name("list").alias("ls").description("List all
|
|
|
1961
1956
|
init_esm_shims();
|
|
1962
1957
|
var DEFAULT_LIMIT = 5;
|
|
1963
1958
|
var EXACT_MATCH_THRESHOLD = 80;
|
|
1959
|
+
function isConnectorType2(type) {
|
|
1960
|
+
return type in CONNECTOR_TYPES;
|
|
1961
|
+
}
|
|
1964
1962
|
function parseLimit(raw) {
|
|
1965
1963
|
const n = Number.parseInt(raw, 10);
|
|
1966
1964
|
if (!Number.isFinite(n) || n <= 0) {
|
|
@@ -1980,9 +1978,9 @@ var searchCommand = new Command().name("search").description("Search connectors
|
|
|
1980
1978
|
if (!trimmed) {
|
|
1981
1979
|
throw new Error("Keyword cannot be empty.");
|
|
1982
1980
|
}
|
|
1983
|
-
const [{ connectors },
|
|
1981
|
+
const [{ connectors }, availableCatalog, agentCtx] = await Promise.all([
|
|
1984
1982
|
listZeroConnectors(),
|
|
1985
|
-
|
|
1983
|
+
searchZeroConnectors(),
|
|
1986
1984
|
resolveAgentContext(options.agent)
|
|
1987
1985
|
]);
|
|
1988
1986
|
const connectedMap = new Map(
|
|
@@ -1990,16 +1988,17 @@ var searchCommand = new Command().name("search").description("Search connectors
|
|
|
1990
1988
|
return [c.type, c];
|
|
1991
1989
|
})
|
|
1992
1990
|
);
|
|
1993
|
-
const
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
};
|
|
1991
|
+
const availableTypes = new Set(
|
|
1992
|
+
availableCatalog.connectors.map((connector) => {
|
|
1993
|
+
return connector.id;
|
|
1994
|
+
}).filter(isConnectorType2)
|
|
1995
|
+
);
|
|
1999
1996
|
const { results, total } = searchConnectors(
|
|
2000
1997
|
trimmed,
|
|
2001
1998
|
options.limit,
|
|
2002
|
-
|
|
1999
|
+
(type) => {
|
|
2000
|
+
return availableTypes.has(type);
|
|
2001
|
+
}
|
|
2003
2002
|
);
|
|
2004
2003
|
if (results.length === 0) {
|
|
2005
2004
|
console.log("No matches found.");
|
|
@@ -7450,7 +7449,7 @@ function registerZeroCommands(prog, commands) {
|
|
|
7450
7449
|
var program = new Command();
|
|
7451
7450
|
program.name("zero").description(
|
|
7452
7451
|
"Zero CLI \u2014 interact with the zero platform from inside the sandbox"
|
|
7453
|
-
).version("9.145.
|
|
7452
|
+
).version("9.145.10").addHelpText(
|
|
7454
7453
|
"after",
|
|
7455
7454
|
`
|
|
7456
7455
|
Examples:
|