@superglue/cli 1.1.11 → 1.1.12
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/.claude-plugin/plugin.json +9 -2
- package/dist/cli.js +131 -78
- package/dist/dist/cli.js +24047 -0
- package/dist/dist/skills/superglue/SKILL.md +667 -0
- package/dist/dist/skills/superglue/agents/openai.yaml +7 -0
- package/dist/dist/skills/superglue/assets/superglue.png +0 -0
- package/dist/dist/skills/superglue/references/databases.md +88 -0
- package/dist/dist/skills/superglue/references/file-servers.md +136 -0
- package/dist/dist/skills/superglue/references/integration.md +279 -0
- package/dist/dist/skills/superglue/references/redis.md +190 -0
- package/dist/dist/skills/superglue/references/transforms-and-output.md +92 -0
- package/dist/skills/superglue/SKILL.md +2 -2
- package/package.json +1 -2
- package/skills/superglue/SKILL.md +2 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "superglue",
|
|
3
3
|
"description": "Build, test, and manage superglue tools via the sg CLI. Use when working with superglue tools, systems, APIs, SDKs, or the sg command.",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "1.1.12",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "superglue",
|
|
7
7
|
"email": "hello@superglue.cloud"
|
|
@@ -9,5 +9,12 @@
|
|
|
9
9
|
"homepage": "https://superglue.cloud",
|
|
10
10
|
"repository": "https://github.com/superglue-ai/cli",
|
|
11
11
|
"license": "MIT",
|
|
12
|
-
"keywords": [
|
|
12
|
+
"keywords": [
|
|
13
|
+
"systems",
|
|
14
|
+
"integration",
|
|
15
|
+
"cli",
|
|
16
|
+
"tools",
|
|
17
|
+
"automation",
|
|
18
|
+
"api"
|
|
19
|
+
]
|
|
13
20
|
}
|
package/dist/cli.js
CHANGED
|
@@ -1742,21 +1742,67 @@ var require_json_schema = __commonJS({
|
|
|
1742
1742
|
}
|
|
1743
1743
|
});
|
|
1744
1744
|
|
|
1745
|
+
// ../shared/dist/rbac-utils.js
|
|
1746
|
+
var require_rbac_utils = __commonJS({
|
|
1747
|
+
"../shared/dist/rbac-utils.js"(exports2) {
|
|
1748
|
+
"use strict";
|
|
1749
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
1750
|
+
exports2.RESERVED_ROLE_NAMES = exports2.RESERVED_ROLE_IDS = exports2.PREDEFINED_ROLE_IDS = void 0;
|
|
1751
|
+
exports2.isCustomRulePermission = isCustomRulePermission;
|
|
1752
|
+
exports2.getSystemRules = getSystemRules;
|
|
1753
|
+
exports2.isPredefinedRole = isPredefinedRole;
|
|
1754
|
+
exports2.isReservedRoleId = isReservedRoleId;
|
|
1755
|
+
exports2.isReservedRoleName = isReservedRoleName;
|
|
1756
|
+
exports2.hasRole = hasRole;
|
|
1757
|
+
exports2.getRoleIds = getRoleIds;
|
|
1758
|
+
exports2.getBaseRole = getBaseRole;
|
|
1759
|
+
exports2.getBaseRoleId = getBaseRoleId;
|
|
1760
|
+
function isCustomRulePermission(p) {
|
|
1761
|
+
return typeof p === "object" && p !== null && "rules" in p;
|
|
1762
|
+
}
|
|
1763
|
+
function getSystemRules(systems2, systemId) {
|
|
1764
|
+
if (systems2 === "ALL" || !systems2[systemId])
|
|
1765
|
+
return [];
|
|
1766
|
+
const p = systems2[systemId];
|
|
1767
|
+
return isCustomRulePermission(p) ? p.rules : [];
|
|
1768
|
+
}
|
|
1769
|
+
exports2.PREDEFINED_ROLE_IDS = ["admin", "member", "enduser"];
|
|
1770
|
+
exports2.RESERVED_ROLE_IDS = ["admin", "member", "enduser", "__admin__"];
|
|
1771
|
+
exports2.RESERVED_ROLE_NAMES = ["member", "end user", "enduser", "admin"];
|
|
1772
|
+
function isPredefinedRole(roleId) {
|
|
1773
|
+
return exports2.PREDEFINED_ROLE_IDS.includes(roleId);
|
|
1774
|
+
}
|
|
1775
|
+
function isReservedRoleId(roleId) {
|
|
1776
|
+
return exports2.RESERVED_ROLE_IDS.includes(roleId);
|
|
1777
|
+
}
|
|
1778
|
+
function isReservedRoleName(name) {
|
|
1779
|
+
return exports2.RESERVED_ROLE_NAMES.includes(name.toLowerCase().trim());
|
|
1780
|
+
}
|
|
1781
|
+
function hasRole(roles, roleId) {
|
|
1782
|
+
return roles.some((r) => r.id === roleId);
|
|
1783
|
+
}
|
|
1784
|
+
function getRoleIds(roles) {
|
|
1785
|
+
return roles.map((r) => r.id);
|
|
1786
|
+
}
|
|
1787
|
+
function getBaseRole(roles) {
|
|
1788
|
+
const baseRoles = roles.filter((r) => r.isBaseRole);
|
|
1789
|
+
return baseRoles.length === 1 ? baseRoles[0] : null;
|
|
1790
|
+
}
|
|
1791
|
+
function getBaseRoleId(roles) {
|
|
1792
|
+
const base = getBaseRole(roles);
|
|
1793
|
+
return base ? base.id : null;
|
|
1794
|
+
}
|
|
1795
|
+
}
|
|
1796
|
+
});
|
|
1797
|
+
|
|
1745
1798
|
// ../shared/dist/types.js
|
|
1746
1799
|
var require_types = __commonJS({
|
|
1747
1800
|
"../shared/dist/types.js"(exports2) {
|
|
1748
1801
|
"use strict";
|
|
1749
1802
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
1750
|
-
exports2.ConfirmationAction = exports2.FileStatus = exports2.DiscoveryRunStatus = exports2.RemoveScope = exports2.FilterAction = exports2.FilterTarget = exports2.RequestSource = exports2.RunStatus = exports2.CredentialMode = exports2.UpsertMode = exports2.LogLevel = exports2.PaginationType = exports2.DecompressionMethod = exports2.AuthType = exports2.FileType = exports2.CacheMode = exports2.HttpMethod = exports2.SupportedFileType =
|
|
1803
|
+
exports2.SystemAccessLevel = exports2.ConfirmationAction = exports2.FileStatus = exports2.DiscoveryRunStatus = exports2.RemoveScope = exports2.FilterAction = exports2.FilterTarget = exports2.RequestSource = exports2.RunStatus = exports2.CredentialMode = exports2.UpsertMode = exports2.LogLevel = exports2.PaginationType = exports2.DecompressionMethod = exports2.AuthType = exports2.FileType = exports2.CacheMode = exports2.HttpMethod = exports2.SupportedFileType = void 0;
|
|
1751
1804
|
exports2.isRequestConfig = isRequestConfig;
|
|
1752
1805
|
exports2.isTransformConfig = isTransformConfig;
|
|
1753
|
-
exports2.getToolSystemIds = getToolSystemIds;
|
|
1754
|
-
exports2.isProductionSystem = isProductionSystem;
|
|
1755
|
-
var UserRole;
|
|
1756
|
-
(function(UserRole2) {
|
|
1757
|
-
UserRole2["ADMIN"] = "admin";
|
|
1758
|
-
UserRole2["MEMBER"] = "member";
|
|
1759
|
-
})(UserRole || (exports2.UserRole = UserRole = {}));
|
|
1760
1806
|
var SupportedFileType;
|
|
1761
1807
|
(function(SupportedFileType2) {
|
|
1762
1808
|
SupportedFileType2["JSON"] = "JSON";
|
|
@@ -1884,20 +1930,6 @@ var require_types = __commonJS({
|
|
|
1884
1930
|
function isTransformConfig(config) {
|
|
1885
1931
|
return config?.type === "transform";
|
|
1886
1932
|
}
|
|
1887
|
-
function getToolSystemIds(tool) {
|
|
1888
|
-
if (!tool.steps)
|
|
1889
|
-
return [];
|
|
1890
|
-
const ids = /* @__PURE__ */ new Set();
|
|
1891
|
-
for (const step of tool.steps) {
|
|
1892
|
-
if (step.config && isRequestConfig(step.config) && step.config.systemId) {
|
|
1893
|
-
ids.add(step.config.systemId);
|
|
1894
|
-
}
|
|
1895
|
-
}
|
|
1896
|
-
return Array.from(ids);
|
|
1897
|
-
}
|
|
1898
|
-
function isProductionSystem(system) {
|
|
1899
|
-
return system.environment !== "dev";
|
|
1900
|
-
}
|
|
1901
1933
|
var DiscoveryRunStatus;
|
|
1902
1934
|
(function(DiscoveryRunStatus2) {
|
|
1903
1935
|
DiscoveryRunStatus2["PENDING"] = "PENDING";
|
|
@@ -1922,6 +1954,12 @@ var require_types = __commonJS({
|
|
|
1922
1954
|
ConfirmationAction2["OAUTH_SUCCESS"] = "oauth_success";
|
|
1923
1955
|
ConfirmationAction2["OAUTH_FAILURE"] = "oauth_failure";
|
|
1924
1956
|
})(ConfirmationAction || (exports2.ConfirmationAction = ConfirmationAction = {}));
|
|
1957
|
+
var SystemAccessLevel;
|
|
1958
|
+
(function(SystemAccessLevel2) {
|
|
1959
|
+
SystemAccessLevel2["NONE"] = "none";
|
|
1960
|
+
SystemAccessLevel2["READ_ONLY"] = "read-only";
|
|
1961
|
+
SystemAccessLevel2["READ_WRITE"] = "read-write";
|
|
1962
|
+
})(SystemAccessLevel || (exports2.SystemAccessLevel = SystemAccessLevel = {}));
|
|
1925
1963
|
}
|
|
1926
1964
|
});
|
|
1927
1965
|
|
|
@@ -20098,7 +20136,6 @@ var require_utils = __commonJS({
|
|
|
20098
20136
|
exports2.generateUniqueId = generateUniqueId;
|
|
20099
20137
|
exports2.waitForSystemProcessing = waitForSystemProcessing;
|
|
20100
20138
|
exports2.inferJsonSchema = inferJsonSchema;
|
|
20101
|
-
exports2.mapUserRole = mapUserRole;
|
|
20102
20139
|
exports2.resolveOAuthCertAndKey = resolveOAuthCertAndKey;
|
|
20103
20140
|
exports2.isArrowFunction = isArrowFunction;
|
|
20104
20141
|
exports2.assertValidArrowFunction = assertValidArrowFunction;
|
|
@@ -20115,6 +20152,8 @@ var require_utils = __commonJS({
|
|
|
20115
20152
|
exports2.normalizeToolDiffs = normalizeToolDiffs;
|
|
20116
20153
|
exports2.composeUrl = composeUrl;
|
|
20117
20154
|
exports2.truncateRunResult = truncateRunResult;
|
|
20155
|
+
exports2.getToolSystemIds = getToolSystemIds;
|
|
20156
|
+
exports2.isProductionSystem = isProductionSystem;
|
|
20118
20157
|
var json_schema_js_1 = require_json_schema();
|
|
20119
20158
|
var types_js_1 = require_types();
|
|
20120
20159
|
var truncate_json_1 = __importDefault((init_main5(), __toCommonJS(main_exports)));
|
|
@@ -20364,16 +20403,6 @@ var require_utils = __commonJS({
|
|
|
20364
20403
|
}
|
|
20365
20404
|
return buildArraySchemaFromData(data);
|
|
20366
20405
|
}
|
|
20367
|
-
function mapUserRole(role) {
|
|
20368
|
-
switch (role) {
|
|
20369
|
-
case "admin":
|
|
20370
|
-
return types_js_1.UserRole.ADMIN;
|
|
20371
|
-
case "member":
|
|
20372
|
-
return types_js_1.UserRole.MEMBER;
|
|
20373
|
-
default:
|
|
20374
|
-
return types_js_1.UserRole.MEMBER;
|
|
20375
|
-
}
|
|
20376
|
-
}
|
|
20377
20406
|
function resolveOAuthCertAndKey(oauthCert, oauthKey) {
|
|
20378
20407
|
let parsedCert = null;
|
|
20379
20408
|
let parsedKey = null;
|
|
@@ -20767,6 +20796,20 @@ var require_utils = __commonJS({
|
|
|
20767
20796
|
};
|
|
20768
20797
|
}
|
|
20769
20798
|
}
|
|
20799
|
+
function getToolSystemIds(tool) {
|
|
20800
|
+
if (!tool.steps)
|
|
20801
|
+
return [];
|
|
20802
|
+
const ids = /* @__PURE__ */ new Set();
|
|
20803
|
+
for (const step of tool.steps) {
|
|
20804
|
+
if (step.config && (0, types_js_1.isRequestConfig)(step.config) && step.config.systemId) {
|
|
20805
|
+
ids.add(step.config.systemId);
|
|
20806
|
+
}
|
|
20807
|
+
}
|
|
20808
|
+
return Array.from(ids);
|
|
20809
|
+
}
|
|
20810
|
+
function isProductionSystem(system) {
|
|
20811
|
+
return system.environment !== "dev";
|
|
20812
|
+
}
|
|
20770
20813
|
}
|
|
20771
20814
|
});
|
|
20772
20815
|
|
|
@@ -21611,15 +21654,19 @@ var require_superglue_client = __commonJS({
|
|
|
21611
21654
|
if (err.message?.includes("404") || err.message?.includes("not found")) {
|
|
21612
21655
|
return null;
|
|
21613
21656
|
}
|
|
21657
|
+
if (err.message?.includes("403") || err.message?.includes("not allowed")) {
|
|
21658
|
+
return null;
|
|
21659
|
+
}
|
|
21614
21660
|
throw err;
|
|
21615
21661
|
}
|
|
21616
21662
|
}
|
|
21617
21663
|
async archiveWorkflow(id, archived = true) {
|
|
21618
21664
|
return this.upsertWorkflow(id, { archived });
|
|
21619
21665
|
}
|
|
21620
|
-
async listWorkflows(limit = 10, offset = 0) {
|
|
21666
|
+
async listWorkflows(limit = 10, offset = 0, includeArchived = false) {
|
|
21621
21667
|
const page = Math.floor(offset / limit) + 1;
|
|
21622
|
-
const
|
|
21668
|
+
const archiveParam = includeArchived ? "&includeArchived=true" : "";
|
|
21669
|
+
const response = await this.restRequest("GET", `/v1/tools?limit=${limit}&page=${page}${archiveParam}`);
|
|
21623
21670
|
return { items: response.data, total: response.total };
|
|
21624
21671
|
}
|
|
21625
21672
|
async upsertWorkflow(id, input) {
|
|
@@ -21657,11 +21704,6 @@ var require_superglue_client = __commonJS({
|
|
|
21657
21704
|
const response = await this.restRequest("GET", `/v1/systems?${params.toString()}`);
|
|
21658
21705
|
return { items: response.data, total: response.total };
|
|
21659
21706
|
}
|
|
21660
|
-
async findRelevantTools(searchTerms) {
|
|
21661
|
-
const params = searchTerms ? `?q=${encodeURIComponent(searchTerms)}` : "";
|
|
21662
|
-
const response = await this.restRequest("GET", `/v1/tools/search${params}`);
|
|
21663
|
-
return response.data;
|
|
21664
|
-
}
|
|
21665
21707
|
async getSystem(id, options) {
|
|
21666
21708
|
const queryParams = options?.environment ? `?env=${options.environment}` : "";
|
|
21667
21709
|
const response = await this.restRequest("GET", `/v1/systems/${encodeURIComponent(id)}${queryParams}`);
|
|
@@ -21817,6 +21859,7 @@ var require_dist2 = __commonJS({
|
|
|
21817
21859
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
21818
21860
|
exports2.SSELogSubscriptionManager = exports2.SuperglueClient = void 0;
|
|
21819
21861
|
__exportStar(require_json_schema(), exports2);
|
|
21862
|
+
__exportStar(require_rbac_utils(), exports2);
|
|
21820
21863
|
__exportStar(require_seed_config(), exports2);
|
|
21821
21864
|
__exportStar(require_templates(), exports2);
|
|
21822
21865
|
__exportStar(require_type_utils(), exports2);
|
|
@@ -21836,7 +21879,7 @@ var require_dist2 = __commonJS({
|
|
|
21836
21879
|
});
|
|
21837
21880
|
|
|
21838
21881
|
// src/cli.ts
|
|
21839
|
-
var
|
|
21882
|
+
var import_commander6 = require("commander");
|
|
21840
21883
|
|
|
21841
21884
|
// src/config.ts
|
|
21842
21885
|
var fs = __toESM(require("fs"));
|
|
@@ -21922,6 +21965,7 @@ function createClient(config) {
|
|
|
21922
21965
|
var fs2 = __toESM(require("fs"));
|
|
21923
21966
|
var path2 = __toESM(require("path"));
|
|
21924
21967
|
var os2 = __toESM(require("os"));
|
|
21968
|
+
var import_commander = require("commander");
|
|
21925
21969
|
var import_shared2 = __toESM(require_dist2());
|
|
21926
21970
|
|
|
21927
21971
|
// src/output.ts
|
|
@@ -21934,7 +21978,7 @@ var import_node_util = require("util");
|
|
|
21934
21978
|
// package.json
|
|
21935
21979
|
var package_default = {
|
|
21936
21980
|
name: "@superglue/cli",
|
|
21937
|
-
version: "1.1.
|
|
21981
|
+
version: "1.1.12",
|
|
21938
21982
|
bin: {
|
|
21939
21983
|
sg: "./dist/cli.js"
|
|
21940
21984
|
},
|
|
@@ -22459,8 +22503,13 @@ async function choose(message, options, defaultIndex = 0) {
|
|
|
22459
22503
|
|
|
22460
22504
|
// src/commands/init.ts
|
|
22461
22505
|
function registerInitCommand(program2) {
|
|
22462
|
-
program2.command("init").description("Set up superglue CLI configuration").option("--
|
|
22463
|
-
|
|
22506
|
+
program2.command("init").description("Set up superglue CLI configuration").option("--web-endpoint <url>", "Web endpoint for OAuth callbacks").addOption(
|
|
22507
|
+
new import_commander.Option("--output-mode <mode>", "Output mode: stdout or stdout+file").choices(["stdout", "stdout+file"]).default("stdout")
|
|
22508
|
+
).option("--output-dir <dir>", "Output directory for stdout+file mode", ".superglue/output").option("--global", "Save config globally (~/.superglue/) instead of locally").action(async function(opts) {
|
|
22509
|
+
const parentOpts = this.parent?.opts() ?? {};
|
|
22510
|
+
const resolvedApiKey = parentOpts.apiKey || process.env.SUPERGLUE_API_KEY;
|
|
22511
|
+
const resolvedEndpoint = parentOpts.endpoint || process.env.SUPERGLUE_API_ENDPOINT;
|
|
22512
|
+
const isNonInteractive = resolvedApiKey || !process.stdin.isTTY;
|
|
22464
22513
|
let apiKey;
|
|
22465
22514
|
let endpoint;
|
|
22466
22515
|
let webEndpoint;
|
|
@@ -22468,12 +22517,12 @@ function registerInitCommand(program2) {
|
|
|
22468
22517
|
let outputDir;
|
|
22469
22518
|
let preferLocal;
|
|
22470
22519
|
if (isNonInteractive) {
|
|
22471
|
-
apiKey =
|
|
22520
|
+
apiKey = resolvedApiKey;
|
|
22472
22521
|
if (!apiKey) {
|
|
22473
22522
|
error("API key is required (--api-key or SUPERGLUE_API_KEY)");
|
|
22474
22523
|
process.exit(1);
|
|
22475
22524
|
}
|
|
22476
|
-
endpoint =
|
|
22525
|
+
endpoint = resolvedEndpoint || "https://api.superglue.cloud";
|
|
22477
22526
|
const defaultWeb = endpoint.replace(/:3002\b/, ":3001").replace(/api\.superglue/, "app.superglue");
|
|
22478
22527
|
webEndpoint = opts.webEndpoint || defaultWeb;
|
|
22479
22528
|
outputMode = opts.outputMode === "stdout+file" ? "stdout+file" : "stdout";
|
|
@@ -22504,7 +22553,10 @@ function registerInitCommand(program2) {
|
|
|
22504
22553
|
error("API key is required");
|
|
22505
22554
|
process.exit(1);
|
|
22506
22555
|
}
|
|
22507
|
-
endpoint = await prompt(
|
|
22556
|
+
endpoint = await prompt(
|
|
22557
|
+
" API Endpoint",
|
|
22558
|
+
resolvedEndpoint || "https://api.superglue.cloud"
|
|
22559
|
+
);
|
|
22508
22560
|
const defaultWeb = endpoint.replace(/:3002\b/, ":3001").replace(/api\.superglue/, "app.superglue");
|
|
22509
22561
|
webEndpoint = await prompt(" Web Endpoint (for OAuth callbacks)", defaultWeb);
|
|
22510
22562
|
const spin = spinner("Verifying connection...");
|
|
@@ -23030,10 +23082,9 @@ function registerFindCommand(parent, getContext2) {
|
|
|
23030
23082
|
parent.command("list").description("List all tools").action(async () => {
|
|
23031
23083
|
const { client } = getContext2();
|
|
23032
23084
|
try {
|
|
23033
|
-
const { items } = await client.listWorkflows(
|
|
23034
|
-
const tools = items.filter((t) => !t.archived);
|
|
23085
|
+
const { items } = await client.listWorkflows(1e3);
|
|
23035
23086
|
table(
|
|
23036
|
-
|
|
23087
|
+
items.map((t) => ({
|
|
23037
23088
|
id: t.id,
|
|
23038
23089
|
instruction: (t.instruction || "").slice(0, 60),
|
|
23039
23090
|
steps: t.steps?.length || 0
|
|
@@ -23058,25 +23109,29 @@ function registerFindCommand(parent, getContext2) {
|
|
|
23058
23109
|
return;
|
|
23059
23110
|
}
|
|
23060
23111
|
const searchQuery = (query || "").trim() || "*";
|
|
23061
|
-
|
|
23062
|
-
|
|
23063
|
-
const
|
|
23112
|
+
const { items } = await client.listWorkflows(1e3);
|
|
23113
|
+
const filtered = searchQuery === "*" ? items : (() => {
|
|
23114
|
+
const keywords = searchQuery.toLowerCase().split(/\s+/).filter((k) => k.length > 0);
|
|
23115
|
+
const scored = items.map((t) => {
|
|
23116
|
+
const text = [t.id, t.name, t.instruction].filter(Boolean).join(" ").toLowerCase();
|
|
23117
|
+
return {
|
|
23118
|
+
tool: t,
|
|
23119
|
+
score: keywords.filter((kw) => text.includes(kw)).length
|
|
23120
|
+
};
|
|
23121
|
+
});
|
|
23122
|
+
const matches = scored.filter((s) => s.score > 0);
|
|
23123
|
+
if (matches.length === 0) return items;
|
|
23124
|
+
matches.sort((a, b) => b.score - a.score);
|
|
23125
|
+
return matches.map((m) => m.tool);
|
|
23126
|
+
})();
|
|
23127
|
+
output({
|
|
23128
|
+
success: true,
|
|
23129
|
+
tools: filtered.map((t) => ({
|
|
23064
23130
|
id: t.id,
|
|
23065
23131
|
instruction: (t.instruction || "").slice(0, 80),
|
|
23066
23132
|
steps: t.steps?.length || 0
|
|
23067
|
-
}))
|
|
23068
|
-
|
|
23069
|
-
} else {
|
|
23070
|
-
const tools = await client.findRelevantTools(searchQuery);
|
|
23071
|
-
output({
|
|
23072
|
-
success: true,
|
|
23073
|
-
tools: tools.map((t) => ({
|
|
23074
|
-
id: t.id,
|
|
23075
|
-
instruction: (t.instruction || "").slice(0, 80),
|
|
23076
|
-
steps: t.steps?.length || 0
|
|
23077
|
-
}))
|
|
23078
|
-
});
|
|
23079
|
-
}
|
|
23133
|
+
}))
|
|
23134
|
+
});
|
|
23080
23135
|
} catch (err) {
|
|
23081
23136
|
error(err.message);
|
|
23082
23137
|
process.exit(1);
|
|
@@ -23096,7 +23151,7 @@ function registerToolCommands(program2, getContext2) {
|
|
|
23096
23151
|
|
|
23097
23152
|
// src/commands/system/create.ts
|
|
23098
23153
|
var fs8 = __toESM(require("fs"));
|
|
23099
|
-
var
|
|
23154
|
+
var import_commander2 = require("commander");
|
|
23100
23155
|
var import_shared6 = __toESM(require_dist2());
|
|
23101
23156
|
async function collectSensitiveCredentials(fields) {
|
|
23102
23157
|
const creds = {};
|
|
@@ -23119,7 +23174,7 @@ function registerCreateCommand(parent, getContext2) {
|
|
|
23119
23174
|
"--template <id>",
|
|
23120
23175
|
"Template ID \u2014 auto-fills URL, OAuth config, and credentials. Auto-detected from URL if omitted."
|
|
23121
23176
|
).option("--instructions <text>", "Specific instructions").option("--credentials <json>", "Non-sensitive credentials JSON").option("--sensitive-credentials <fields>", "Comma-separated sensitive credential field names").option("--docs-url <url>", "Documentation URL to scrape").option("--openapi-url <url>", "OpenAPI spec URL").addOption(
|
|
23122
|
-
new
|
|
23177
|
+
new import_commander2.Option("--env <environment>", "Environment: dev or prod (default: prod)").choices([
|
|
23123
23178
|
"dev",
|
|
23124
23179
|
"prod"
|
|
23125
23180
|
])
|
|
@@ -23258,10 +23313,10 @@ ${oauthTemplates}
|
|
|
23258
23313
|
}
|
|
23259
23314
|
|
|
23260
23315
|
// src/commands/system/edit.ts
|
|
23261
|
-
var
|
|
23316
|
+
var import_commander3 = require("commander");
|
|
23262
23317
|
function registerEditCommand2(parent, getContext2) {
|
|
23263
23318
|
parent.command("edit").description("Edit an existing system").requiredOption("--id <id>", "System ID").option("--name <name>", "New name").option("--url <url>", "New URL").option("--instructions <text>", "New specific instructions").option("--credentials <json>", "Non-sensitive credentials JSON to merge").option("--sensitive-credentials <fields>", "Comma-separated sensitive credential field names").option("--scrape-url <url>", "Documentation URL to scrape").option("--scrape-keywords <keywords>", "Space-separated scrape keywords").addOption(
|
|
23264
|
-
new
|
|
23319
|
+
new import_commander3.Option("--env <environment>", "Environment: dev or prod").choices(["dev", "prod"])
|
|
23265
23320
|
).action(async (opts) => {
|
|
23266
23321
|
const { client } = getContext2();
|
|
23267
23322
|
const patchPayload = { id: opts.id };
|
|
@@ -23332,7 +23387,7 @@ function registerEditCommand2(parent, getContext2) {
|
|
|
23332
23387
|
}
|
|
23333
23388
|
|
|
23334
23389
|
// src/commands/system/find.ts
|
|
23335
|
-
var
|
|
23390
|
+
var import_commander4 = require("commander");
|
|
23336
23391
|
var import_shared7 = __toESM(require_dist2());
|
|
23337
23392
|
function filterSystemFields(system) {
|
|
23338
23393
|
const credentialKeys = Object.keys(system.credentials || {});
|
|
@@ -23366,7 +23421,7 @@ function registerFindCommand2(parent, getContext2) {
|
|
|
23366
23421
|
}
|
|
23367
23422
|
});
|
|
23368
23423
|
parent.command("find [query]").description("Find systems by query or exact ID").option("--id <exactId>", "Exact system ID lookup").addOption(
|
|
23369
|
-
new
|
|
23424
|
+
new import_commander4.Option("--env <environment>", "Environment: dev or prod").choices(["dev", "prod"])
|
|
23370
23425
|
).action(async (query, opts) => {
|
|
23371
23426
|
const { client } = getContext2();
|
|
23372
23427
|
try {
|
|
@@ -23412,7 +23467,7 @@ function registerFindCommand2(parent, getContext2) {
|
|
|
23412
23467
|
}
|
|
23413
23468
|
|
|
23414
23469
|
// src/commands/system/call.ts
|
|
23415
|
-
var
|
|
23470
|
+
var import_commander5 = require("commander");
|
|
23416
23471
|
var import_shared8 = __toESM(require_dist2());
|
|
23417
23472
|
function registerCallCommand(parent, getContext2) {
|
|
23418
23473
|
parent.command("call").description("Call a system (API, database, file server)").requiredOption("--url <url>", "Full URL including protocol").option("--system-id <id>", "System ID for credential injection").option("--method <method>", "HTTP method", "GET").option("--headers <json>", "HTTP headers JSON").option("--body <string>", "Request body").option(
|
|
@@ -23424,7 +23479,7 @@ function registerCallCommand(parent, getContext2) {
|
|
|
23424
23479
|
},
|
|
23425
23480
|
[]
|
|
23426
23481
|
).addOption(
|
|
23427
|
-
new
|
|
23482
|
+
new import_commander5.Option("--env <environment>", "Environment: dev or prod").choices(["dev", "prod"])
|
|
23428
23483
|
).action(async (opts) => {
|
|
23429
23484
|
const { client } = getContext2();
|
|
23430
23485
|
const method = opts.method || "GET";
|
|
@@ -23861,9 +23916,7 @@ function registerSkillCommand(program2) {
|
|
|
23861
23916
|
if (topic) {
|
|
23862
23917
|
const refsDir = path6.join(SKILLS_DIR, "references");
|
|
23863
23918
|
const available = fs9.existsSync(refsDir) ? fs9.readdirSync(refsDir).filter((f) => f.endsWith(".md")).map((f) => f.replace(".md", "")) : [];
|
|
23864
|
-
error(
|
|
23865
|
-
`Topic not found: ${topic}. Available: ${available.join(", ") || "none"}`
|
|
23866
|
-
);
|
|
23919
|
+
error(`Topic not found: ${topic}. Available: ${available.join(", ") || "none"}`);
|
|
23867
23920
|
} else {
|
|
23868
23921
|
error(`Skill file not found: ${file}`);
|
|
23869
23922
|
}
|
|
@@ -23874,7 +23927,7 @@ function registerSkillCommand(program2) {
|
|
|
23874
23927
|
}
|
|
23875
23928
|
|
|
23876
23929
|
// src/cli.ts
|
|
23877
|
-
var program = new
|
|
23930
|
+
var program = new import_commander6.Command();
|
|
23878
23931
|
program.name("sg").description("superglue CLI \u2014 build, run, and manage integration tools").version(CLI_VERSION).option("--api-key <key>", "superglue API key").option("--endpoint <url>", "superglue API endpoint").option("--json", "force JSON output").addHelpText(
|
|
23879
23932
|
"after",
|
|
23880
23933
|
`
|