struere 0.9.2 → 0.9.4
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/bin/struere.js +457 -16
- package/dist/cli/commands/integration.d.ts +3 -0
- package/dist/cli/commands/integration.d.ts.map +1 -0
- package/dist/cli/commands/sync.d.ts.map +1 -1
- package/dist/cli/index.js +462 -16
- package/dist/cli/utils/convex.d.ts +1 -2
- package/dist/cli/utils/convex.d.ts.map +1 -1
- package/dist/cli/utils/credentials.d.ts +1 -0
- package/dist/cli/utils/credentials.d.ts.map +1 -1
- package/dist/cli/utils/extractor.d.ts +0 -1
- package/dist/cli/utils/extractor.d.ts.map +1 -1
- package/dist/cli/utils/integrations.d.ts +27 -0
- package/dist/cli/utils/integrations.d.ts.map +1 -0
- package/package.json +1 -1
package/dist/bin/struere.js
CHANGED
|
@@ -19402,6 +19402,30 @@ var CONVEX_URL = process.env.STRUERE_CONVEX_URL || "https://rapid-wildebeest-172
|
|
|
19402
19402
|
function getSiteUrl() {
|
|
19403
19403
|
return CONVEX_URL.replace(".cloud", ".site");
|
|
19404
19404
|
}
|
|
19405
|
+
async function refreshToken() {
|
|
19406
|
+
const credentials = loadCredentials();
|
|
19407
|
+
if (!credentials?.sessionId)
|
|
19408
|
+
return null;
|
|
19409
|
+
const siteUrl = getSiteUrl();
|
|
19410
|
+
try {
|
|
19411
|
+
const response = await fetch(`${siteUrl}/v1/auth/refresh`, {
|
|
19412
|
+
method: "POST",
|
|
19413
|
+
headers: { "Content-Type": "application/json" },
|
|
19414
|
+
body: JSON.stringify({ sessionId: credentials.sessionId }),
|
|
19415
|
+
signal: AbortSignal.timeout(1e4)
|
|
19416
|
+
});
|
|
19417
|
+
if (!response.ok)
|
|
19418
|
+
return null;
|
|
19419
|
+
const data = await response.json();
|
|
19420
|
+
if (!data.token)
|
|
19421
|
+
return null;
|
|
19422
|
+
credentials.token = data.token;
|
|
19423
|
+
saveCredentials(credentials);
|
|
19424
|
+
return data.token;
|
|
19425
|
+
} catch {
|
|
19426
|
+
return null;
|
|
19427
|
+
}
|
|
19428
|
+
}
|
|
19405
19429
|
async function listMyOrganizations(token) {
|
|
19406
19430
|
const response = await fetch(`${CONVEX_URL}/api/query`, {
|
|
19407
19431
|
method: "POST",
|
|
@@ -19517,7 +19541,11 @@ async function syncOrganization(payload) {
|
|
|
19517
19541
|
if (apiKey && !credentials?.token) {
|
|
19518
19542
|
return syncViaHttp(apiKey, payload);
|
|
19519
19543
|
}
|
|
19520
|
-
|
|
19544
|
+
if (credentials?.sessionId) {
|
|
19545
|
+
await refreshToken();
|
|
19546
|
+
}
|
|
19547
|
+
const freshCredentials = loadCredentials();
|
|
19548
|
+
const token = apiKey || freshCredentials?.token;
|
|
19521
19549
|
if (!token) {
|
|
19522
19550
|
return { success: false, error: "Not authenticated" };
|
|
19523
19551
|
}
|
|
@@ -19584,7 +19612,11 @@ async function getSyncState(organizationId, environment) {
|
|
|
19584
19612
|
return { error: `Network error: ${err instanceof Error ? err.message : String(err)}` };
|
|
19585
19613
|
}
|
|
19586
19614
|
}
|
|
19587
|
-
|
|
19615
|
+
if (credentials?.sessionId) {
|
|
19616
|
+
await refreshToken();
|
|
19617
|
+
}
|
|
19618
|
+
const freshCredentials = loadCredentials();
|
|
19619
|
+
const token = apiKey || freshCredentials?.token;
|
|
19588
19620
|
if (!token) {
|
|
19589
19621
|
return { error: "Not authenticated" };
|
|
19590
19622
|
}
|
|
@@ -19636,7 +19668,11 @@ async function getPullState(organizationId, environment = "development") {
|
|
|
19636
19668
|
return { error: `Network error: ${err instanceof Error ? err.message : String(err)}` };
|
|
19637
19669
|
}
|
|
19638
19670
|
}
|
|
19639
|
-
|
|
19671
|
+
if (credentials?.sessionId) {
|
|
19672
|
+
await refreshToken();
|
|
19673
|
+
}
|
|
19674
|
+
const freshCredentials = loadCredentials();
|
|
19675
|
+
const token = apiKey || freshCredentials?.token;
|
|
19640
19676
|
if (!token) {
|
|
19641
19677
|
return { error: "Not authenticated" };
|
|
19642
19678
|
}
|
|
@@ -19693,6 +19729,7 @@ async function browserLogin(spinner) {
|
|
|
19693
19729
|
if (result) {
|
|
19694
19730
|
printNextSteps();
|
|
19695
19731
|
}
|
|
19732
|
+
process.exit(0);
|
|
19696
19733
|
}
|
|
19697
19734
|
async function browserLoginInternal(spinner) {
|
|
19698
19735
|
spinner.start("Starting authentication server");
|
|
@@ -19743,7 +19780,7 @@ async function browserLoginInternal(spinner) {
|
|
|
19743
19780
|
}
|
|
19744
19781
|
spinner.start("Waiting for authentication");
|
|
19745
19782
|
try {
|
|
19746
|
-
const { token } = await authPromise;
|
|
19783
|
+
const { token, sessionId } = await authPromise;
|
|
19747
19784
|
spinner.text = "Fetching user info";
|
|
19748
19785
|
const { userInfo, error } = await getUserInfo(token);
|
|
19749
19786
|
if (error || !userInfo) {
|
|
@@ -19752,6 +19789,7 @@ async function browserLoginInternal(spinner) {
|
|
|
19752
19789
|
const { user, organizations } = userInfo;
|
|
19753
19790
|
const credentials = {
|
|
19754
19791
|
token,
|
|
19792
|
+
sessionId,
|
|
19755
19793
|
user: {
|
|
19756
19794
|
id: user.id,
|
|
19757
19795
|
email: user.email,
|
|
@@ -21458,7 +21496,8 @@ var BUILTIN_TOOLS = [
|
|
|
21458
21496
|
"airtable.getRecord",
|
|
21459
21497
|
"airtable.createRecords",
|
|
21460
21498
|
"airtable.updateRecords",
|
|
21461
|
-
"airtable.deleteRecords"
|
|
21499
|
+
"airtable.deleteRecords",
|
|
21500
|
+
"email.send"
|
|
21462
21501
|
];
|
|
21463
21502
|
function extractSyncPayload(resources) {
|
|
21464
21503
|
const customToolsMap = new Map;
|
|
@@ -21566,8 +21605,7 @@ function extractAgentPayload(agent, customToolsMap) {
|
|
|
21566
21605
|
return {
|
|
21567
21606
|
name: toolName,
|
|
21568
21607
|
description: getBuiltinToolDescription(toolName),
|
|
21569
|
-
parameters: getBuiltinToolParameters(toolName)
|
|
21570
|
-
isBuiltin: true
|
|
21608
|
+
parameters: getBuiltinToolParameters(toolName)
|
|
21571
21609
|
};
|
|
21572
21610
|
}
|
|
21573
21611
|
const customTool = customToolsMap.get(toolName);
|
|
@@ -21579,8 +21617,7 @@ function extractAgentPayload(agent, customToolsMap) {
|
|
|
21579
21617
|
name: customTool.name,
|
|
21580
21618
|
description: customTool.description,
|
|
21581
21619
|
parameters: customTool.parameters || { type: "object", properties: {} },
|
|
21582
|
-
handlerCode: extractHandlerCode(customTool._originalHandler || customTool.handler)
|
|
21583
|
-
isBuiltin: false
|
|
21620
|
+
handlerCode: extractHandlerCode(customTool._originalHandler || customTool.handler)
|
|
21584
21621
|
};
|
|
21585
21622
|
});
|
|
21586
21623
|
return {
|
|
@@ -21630,7 +21667,8 @@ function getBuiltinToolDescription(name) {
|
|
|
21630
21667
|
"airtable.getRecord": "Get a single record from an Airtable table by ID",
|
|
21631
21668
|
"airtable.createRecords": "Create up to 10 records in an Airtable table",
|
|
21632
21669
|
"airtable.updateRecords": "Update up to 10 records in an Airtable table",
|
|
21633
|
-
"airtable.deleteRecords": "Delete up to 10 records from an Airtable table"
|
|
21670
|
+
"airtable.deleteRecords": "Delete up to 10 records from an Airtable table",
|
|
21671
|
+
"email.send": "Send an email via Resend"
|
|
21634
21672
|
};
|
|
21635
21673
|
return descriptions[name] || name;
|
|
21636
21674
|
}
|
|
@@ -21927,6 +21965,17 @@ function getBuiltinToolParameters(name) {
|
|
|
21927
21965
|
recordIds: { type: "array", items: { type: "string" }, description: "Array of record IDs to delete (max 10)" }
|
|
21928
21966
|
},
|
|
21929
21967
|
required: ["baseId", "tableIdOrName", "recordIds"]
|
|
21968
|
+
},
|
|
21969
|
+
"email.send": {
|
|
21970
|
+
type: "object",
|
|
21971
|
+
properties: {
|
|
21972
|
+
to: { type: "string", description: "Recipient email address" },
|
|
21973
|
+
subject: { type: "string", description: "Email subject line" },
|
|
21974
|
+
html: { type: "string", description: "HTML body content" },
|
|
21975
|
+
text: { type: "string", description: "Plain text body content" },
|
|
21976
|
+
replyTo: { type: "string", description: "Reply-to email address" }
|
|
21977
|
+
},
|
|
21978
|
+
required: ["to", "subject"]
|
|
21930
21979
|
}
|
|
21931
21980
|
};
|
|
21932
21981
|
return schemas[name] || { type: "object", properties: {} };
|
|
@@ -22215,13 +22264,32 @@ var syncCommand = new Command("sync").description("Sync resources to Convex and
|
|
|
22215
22264
|
}));
|
|
22216
22265
|
}
|
|
22217
22266
|
} catch (error) {
|
|
22218
|
-
if (jsonMode) {
|
|
22219
|
-
|
|
22267
|
+
if (isAuthError(error) && interactive && !jsonMode) {
|
|
22268
|
+
output.fail("Session expired - re-authenticating...");
|
|
22269
|
+
clearCredentials();
|
|
22270
|
+
const newCredentials = await performLogin();
|
|
22271
|
+
if (!newCredentials) {
|
|
22272
|
+
output.error("Authentication failed");
|
|
22273
|
+
process.exit(1);
|
|
22274
|
+
}
|
|
22275
|
+
output.start("Syncing to Convex");
|
|
22276
|
+
try {
|
|
22277
|
+
const result = await syncToEnvironment(cwd, project.organization.id, environment);
|
|
22278
|
+
output.succeed(`Synced to ${environment}`);
|
|
22279
|
+
} catch (retryError) {
|
|
22280
|
+
output.fail("Sync failed");
|
|
22281
|
+
output.error(retryError instanceof Error ? retryError.message : String(retryError));
|
|
22282
|
+
process.exit(1);
|
|
22283
|
+
}
|
|
22220
22284
|
} else {
|
|
22221
|
-
|
|
22222
|
-
|
|
22285
|
+
if (jsonMode) {
|
|
22286
|
+
console.log(JSON.stringify({ success: false, error: error instanceof Error ? error.message : String(error) }));
|
|
22287
|
+
} else {
|
|
22288
|
+
output.fail("Sync failed");
|
|
22289
|
+
output.error(error instanceof Error ? error.message : String(error));
|
|
22290
|
+
}
|
|
22291
|
+
process.exit(1);
|
|
22223
22292
|
}
|
|
22224
|
-
process.exit(1);
|
|
22225
22293
|
}
|
|
22226
22294
|
});
|
|
22227
22295
|
|
|
@@ -25012,10 +25080,382 @@ templatesCommand.command("status <name>").description("Check template approval s
|
|
|
25012
25080
|
console.log();
|
|
25013
25081
|
}
|
|
25014
25082
|
});
|
|
25083
|
+
|
|
25084
|
+
// src/cli/utils/integrations.ts
|
|
25085
|
+
var CONVEX_URL5 = process.env.STRUERE_CONVEX_URL || "https://rapid-wildebeest-172.convex.cloud";
|
|
25086
|
+
function getToken4() {
|
|
25087
|
+
const credentials = loadCredentials();
|
|
25088
|
+
const apiKey = getApiKey();
|
|
25089
|
+
return apiKey || credentials?.token || null;
|
|
25090
|
+
}
|
|
25091
|
+
async function convexQuery4(path, args) {
|
|
25092
|
+
const token = getToken4();
|
|
25093
|
+
if (!token)
|
|
25094
|
+
return { error: "Not authenticated" };
|
|
25095
|
+
const response = await fetch(`${CONVEX_URL5}/api/query`, {
|
|
25096
|
+
method: "POST",
|
|
25097
|
+
headers: {
|
|
25098
|
+
"Content-Type": "application/json",
|
|
25099
|
+
Authorization: `Bearer ${token}`
|
|
25100
|
+
},
|
|
25101
|
+
body: JSON.stringify({ path, args })
|
|
25102
|
+
});
|
|
25103
|
+
const text = await response.text();
|
|
25104
|
+
let json;
|
|
25105
|
+
try {
|
|
25106
|
+
json = JSON.parse(text);
|
|
25107
|
+
} catch {
|
|
25108
|
+
return { error: text || `HTTP ${response.status}` };
|
|
25109
|
+
}
|
|
25110
|
+
if (!response.ok) {
|
|
25111
|
+
const msg = json.errorData?.message || json.message || json.errorMessage || text;
|
|
25112
|
+
return { error: String(msg) };
|
|
25113
|
+
}
|
|
25114
|
+
if (json.status === "success")
|
|
25115
|
+
return { data: json.value };
|
|
25116
|
+
if (json.status === "error")
|
|
25117
|
+
return { error: String(json.errorMessage || "Unknown error") };
|
|
25118
|
+
return { error: `Unexpected response: ${text}` };
|
|
25119
|
+
}
|
|
25120
|
+
async function convexMutation3(path, args) {
|
|
25121
|
+
const token = getToken4();
|
|
25122
|
+
if (!token)
|
|
25123
|
+
return { error: "Not authenticated" };
|
|
25124
|
+
const response = await fetch(`${CONVEX_URL5}/api/mutation`, {
|
|
25125
|
+
method: "POST",
|
|
25126
|
+
headers: {
|
|
25127
|
+
"Content-Type": "application/json",
|
|
25128
|
+
Authorization: `Bearer ${token}`
|
|
25129
|
+
},
|
|
25130
|
+
body: JSON.stringify({ path, args })
|
|
25131
|
+
});
|
|
25132
|
+
const text = await response.text();
|
|
25133
|
+
let json;
|
|
25134
|
+
try {
|
|
25135
|
+
json = JSON.parse(text);
|
|
25136
|
+
} catch {
|
|
25137
|
+
return { error: text || `HTTP ${response.status}` };
|
|
25138
|
+
}
|
|
25139
|
+
if (!response.ok) {
|
|
25140
|
+
const msg = json.errorData?.message || json.message || json.errorMessage || text;
|
|
25141
|
+
return { error: String(msg) };
|
|
25142
|
+
}
|
|
25143
|
+
if (json.status === "success")
|
|
25144
|
+
return { data: json.value };
|
|
25145
|
+
if (json.status === "error")
|
|
25146
|
+
return { error: String(json.errorMessage || "Unknown error") };
|
|
25147
|
+
return { error: `Unexpected response: ${text}` };
|
|
25148
|
+
}
|
|
25149
|
+
async function convexAction2(path, args) {
|
|
25150
|
+
const token = getToken4();
|
|
25151
|
+
if (!token)
|
|
25152
|
+
return { error: "Not authenticated" };
|
|
25153
|
+
const response = await fetch(`${CONVEX_URL5}/api/action`, {
|
|
25154
|
+
method: "POST",
|
|
25155
|
+
headers: {
|
|
25156
|
+
"Content-Type": "application/json",
|
|
25157
|
+
Authorization: `Bearer ${token}`
|
|
25158
|
+
},
|
|
25159
|
+
body: JSON.stringify({ path, args })
|
|
25160
|
+
});
|
|
25161
|
+
const text = await response.text();
|
|
25162
|
+
let json;
|
|
25163
|
+
try {
|
|
25164
|
+
json = JSON.parse(text);
|
|
25165
|
+
} catch {
|
|
25166
|
+
return { error: text || `HTTP ${response.status}` };
|
|
25167
|
+
}
|
|
25168
|
+
if (!response.ok) {
|
|
25169
|
+
const msg = json.errorData?.message || json.message || json.errorMessage || text;
|
|
25170
|
+
return { error: String(msg) };
|
|
25171
|
+
}
|
|
25172
|
+
if (json.status === "success")
|
|
25173
|
+
return { data: json.value };
|
|
25174
|
+
if (json.status === "error")
|
|
25175
|
+
return { error: String(json.errorMessage || "Unknown error") };
|
|
25176
|
+
return { error: `Unexpected response: ${text}` };
|
|
25177
|
+
}
|
|
25178
|
+
async function getIntegrationConfig(provider, env2) {
|
|
25179
|
+
return convexQuery4("integrations:getConfig", { provider, environment: env2 });
|
|
25180
|
+
}
|
|
25181
|
+
async function updateIntegrationConfig(provider, env2, config) {
|
|
25182
|
+
return convexMutation3("integrations:updateConfig", { provider, environment: env2, config });
|
|
25183
|
+
}
|
|
25184
|
+
async function testIntegrationConnection(provider, env2) {
|
|
25185
|
+
return convexAction2("integrations:testConnection", { provider, environment: env2 });
|
|
25186
|
+
}
|
|
25187
|
+
async function deleteIntegrationConfig(provider, env2) {
|
|
25188
|
+
return convexMutation3("integrations:deleteConfig", { provider, environment: env2 });
|
|
25189
|
+
}
|
|
25190
|
+
async function listIntegrationConfigs(env2) {
|
|
25191
|
+
return convexQuery4("integrations:listConfigs", { environment: env2 });
|
|
25192
|
+
}
|
|
25193
|
+
async function setIntegrationStatus(provider, env2, status) {
|
|
25194
|
+
return convexMutation3("integrations:setConfigStatus", { provider, environment: env2, status });
|
|
25195
|
+
}
|
|
25196
|
+
|
|
25197
|
+
// src/cli/commands/integration.ts
|
|
25198
|
+
var VALID_PROVIDERS = ["airtable", "resend"];
|
|
25199
|
+
async function ensureAuth3() {
|
|
25200
|
+
const cwd = process.cwd();
|
|
25201
|
+
const nonInteractive = !isInteractive2();
|
|
25202
|
+
if (!hasProject(cwd)) {
|
|
25203
|
+
if (nonInteractive) {
|
|
25204
|
+
console.error(source_default.red("No struere.json found. Run struere init first."));
|
|
25205
|
+
process.exit(1);
|
|
25206
|
+
}
|
|
25207
|
+
console.log(source_default.yellow("No struere.json found - initializing project..."));
|
|
25208
|
+
console.log();
|
|
25209
|
+
const success = await runInit(cwd);
|
|
25210
|
+
if (!success) {
|
|
25211
|
+
process.exit(1);
|
|
25212
|
+
}
|
|
25213
|
+
console.log();
|
|
25214
|
+
}
|
|
25215
|
+
let credentials = loadCredentials();
|
|
25216
|
+
const apiKey = getApiKey();
|
|
25217
|
+
if (!credentials && !apiKey) {
|
|
25218
|
+
if (nonInteractive) {
|
|
25219
|
+
console.error(source_default.red("Not authenticated. Set STRUERE_API_KEY or run struere login."));
|
|
25220
|
+
process.exit(1);
|
|
25221
|
+
}
|
|
25222
|
+
console.log(source_default.yellow("Not logged in - authenticating..."));
|
|
25223
|
+
console.log();
|
|
25224
|
+
credentials = await performLogin();
|
|
25225
|
+
if (!credentials) {
|
|
25226
|
+
console.log(source_default.red("Authentication failed"));
|
|
25227
|
+
process.exit(1);
|
|
25228
|
+
}
|
|
25229
|
+
console.log();
|
|
25230
|
+
}
|
|
25231
|
+
return true;
|
|
25232
|
+
}
|
|
25233
|
+
function statusColor3(status) {
|
|
25234
|
+
switch (status) {
|
|
25235
|
+
case "active":
|
|
25236
|
+
return source_default.green(status);
|
|
25237
|
+
case "inactive":
|
|
25238
|
+
return source_default.yellow(status);
|
|
25239
|
+
case "error":
|
|
25240
|
+
return source_default.red(status);
|
|
25241
|
+
default:
|
|
25242
|
+
return source_default.gray(status);
|
|
25243
|
+
}
|
|
25244
|
+
}
|
|
25245
|
+
function getProviderHelp(provider) {
|
|
25246
|
+
switch (provider) {
|
|
25247
|
+
case "airtable":
|
|
25248
|
+
return `Usage: struere integration airtable --token <pat> [--base-id <id>] [--test]`;
|
|
25249
|
+
case "resend":
|
|
25250
|
+
return `Usage: struere integration resend --from-email <email> [--from-name <name>] [--reply-to <email>]`;
|
|
25251
|
+
default:
|
|
25252
|
+
return "";
|
|
25253
|
+
}
|
|
25254
|
+
}
|
|
25255
|
+
function buildConfigFromOpts(provider, opts) {
|
|
25256
|
+
if (provider === "airtable") {
|
|
25257
|
+
const config = {};
|
|
25258
|
+
if (opts.token)
|
|
25259
|
+
config.personalAccessToken = opts.token;
|
|
25260
|
+
if (opts.baseId)
|
|
25261
|
+
config.defaultBaseId = opts.baseId;
|
|
25262
|
+
if (Object.keys(config).length === 0)
|
|
25263
|
+
return null;
|
|
25264
|
+
return config;
|
|
25265
|
+
}
|
|
25266
|
+
if (provider === "resend") {
|
|
25267
|
+
const config = {};
|
|
25268
|
+
if (opts.fromEmail)
|
|
25269
|
+
config.fromEmail = opts.fromEmail;
|
|
25270
|
+
if (opts.fromName)
|
|
25271
|
+
config.fromName = opts.fromName;
|
|
25272
|
+
if (opts.replyTo)
|
|
25273
|
+
config.replyTo = opts.replyTo;
|
|
25274
|
+
if (Object.keys(config).length === 0)
|
|
25275
|
+
return null;
|
|
25276
|
+
return config;
|
|
25277
|
+
}
|
|
25278
|
+
return null;
|
|
25279
|
+
}
|
|
25280
|
+
var integrationCommand = new Command("integration").description("Manage integrations").argument("[provider]", "Integration provider (airtable, resend)").option("--env <environment>", "Environment (development|production)", "development").option("--token <pat>", "Personal access token (airtable)").option("--base-id <id>", "Default base ID (airtable)").option("--from-email <email>", "From email address (resend)").option("--from-name <name>", "From display name (resend)").option("--reply-to <email>", "Reply-to address (resend)").option("--test", "Test the connection after saving").option("--remove", "Remove integration config").option("--enable", "Enable integration").option("--disable", "Disable integration").option("--status", "Show current config status").option("--yes", "Skip confirmation prompts").option("--json", "Output raw JSON").action(async (provider, opts) => {
|
|
25281
|
+
await ensureAuth3();
|
|
25282
|
+
const env2 = opts.env;
|
|
25283
|
+
const out = createOutput();
|
|
25284
|
+
if (!provider || provider === "list") {
|
|
25285
|
+
out.start("Fetching integrations");
|
|
25286
|
+
const { data, error } = await listIntegrationConfigs(env2);
|
|
25287
|
+
if (error) {
|
|
25288
|
+
out.fail("Failed to fetch integrations");
|
|
25289
|
+
out.error(error);
|
|
25290
|
+
process.exit(1);
|
|
25291
|
+
}
|
|
25292
|
+
const configs = data ?? [];
|
|
25293
|
+
out.succeed(`Found ${configs.length} integration${configs.length !== 1 ? "s" : ""}`);
|
|
25294
|
+
if (opts.json) {
|
|
25295
|
+
console.log(JSON.stringify(configs, null, 2));
|
|
25296
|
+
return;
|
|
25297
|
+
}
|
|
25298
|
+
console.log();
|
|
25299
|
+
if (configs.length === 0) {
|
|
25300
|
+
console.log(source_default.gray(" No integrations configured"));
|
|
25301
|
+
console.log();
|
|
25302
|
+
console.log(` ${source_default.gray("Available:")} ${VALID_PROVIDERS.join(", ")}`);
|
|
25303
|
+
console.log(` ${source_default.gray("Example:")} struere integration airtable --token <pat>`);
|
|
25304
|
+
console.log();
|
|
25305
|
+
return;
|
|
25306
|
+
}
|
|
25307
|
+
renderTable([
|
|
25308
|
+
{ key: "provider", label: "Provider", width: 16 },
|
|
25309
|
+
{ key: "status", label: "Status", width: 12 },
|
|
25310
|
+
{ key: "lastVerified", label: "Last Verified", width: 22 }
|
|
25311
|
+
], configs.map((c) => ({
|
|
25312
|
+
provider: c.provider,
|
|
25313
|
+
status: statusColor3(String(c.status ?? "")),
|
|
25314
|
+
lastVerified: c.lastVerifiedAt ? new Date(c.lastVerifiedAt).toLocaleString() : source_default.gray("never")
|
|
25315
|
+
})));
|
|
25316
|
+
console.log();
|
|
25317
|
+
return;
|
|
25318
|
+
}
|
|
25319
|
+
if (!VALID_PROVIDERS.includes(provider)) {
|
|
25320
|
+
out.fail(`Unknown provider: ${provider}`);
|
|
25321
|
+
console.log(` ${source_default.gray("Available:")} ${VALID_PROVIDERS.join(", ")}`);
|
|
25322
|
+
process.exit(1);
|
|
25323
|
+
}
|
|
25324
|
+
if (opts.remove) {
|
|
25325
|
+
if (!opts.yes && isInteractive2()) {
|
|
25326
|
+
const confirmed = await esm_default2({
|
|
25327
|
+
message: `Remove ${provider} integration config? This cannot be undone.`,
|
|
25328
|
+
default: false
|
|
25329
|
+
});
|
|
25330
|
+
if (!confirmed) {
|
|
25331
|
+
console.log(source_default.gray("Cancelled"));
|
|
25332
|
+
return;
|
|
25333
|
+
}
|
|
25334
|
+
}
|
|
25335
|
+
out.start(`Removing ${provider} config`);
|
|
25336
|
+
const { data, error } = await deleteIntegrationConfig(provider, env2);
|
|
25337
|
+
if (error) {
|
|
25338
|
+
out.fail(`Failed to remove ${provider} config`);
|
|
25339
|
+
out.error(error);
|
|
25340
|
+
process.exit(1);
|
|
25341
|
+
}
|
|
25342
|
+
const result = data;
|
|
25343
|
+
if (result?.success) {
|
|
25344
|
+
out.succeed(`${provider} config removed`);
|
|
25345
|
+
} else {
|
|
25346
|
+
out.fail(`No ${provider} config found`);
|
|
25347
|
+
}
|
|
25348
|
+
console.log();
|
|
25349
|
+
return;
|
|
25350
|
+
}
|
|
25351
|
+
if (opts.enable || opts.disable) {
|
|
25352
|
+
const newStatus = opts.enable ? "active" : "inactive";
|
|
25353
|
+
out.start(`Setting ${provider} to ${newStatus}`);
|
|
25354
|
+
const { data, error } = await setIntegrationStatus(provider, env2, newStatus);
|
|
25355
|
+
if (error) {
|
|
25356
|
+
out.fail(`Failed to update ${provider} status`);
|
|
25357
|
+
out.error(error);
|
|
25358
|
+
process.exit(1);
|
|
25359
|
+
}
|
|
25360
|
+
const result = data;
|
|
25361
|
+
if (result?.success) {
|
|
25362
|
+
out.succeed(`${provider} set to ${statusColor3(newStatus)}`);
|
|
25363
|
+
} else {
|
|
25364
|
+
out.fail(`No ${provider} config found`);
|
|
25365
|
+
}
|
|
25366
|
+
console.log();
|
|
25367
|
+
return;
|
|
25368
|
+
}
|
|
25369
|
+
const config = buildConfigFromOpts(provider, opts);
|
|
25370
|
+
if (config) {
|
|
25371
|
+
out.start(`Saving ${provider} config`);
|
|
25372
|
+
const { error } = await updateIntegrationConfig(provider, env2, config);
|
|
25373
|
+
if (error) {
|
|
25374
|
+
out.fail(`Failed to save ${provider} config`);
|
|
25375
|
+
out.error(error);
|
|
25376
|
+
process.exit(1);
|
|
25377
|
+
}
|
|
25378
|
+
out.succeed(`${provider} config saved`);
|
|
25379
|
+
if (opts.test) {
|
|
25380
|
+
out.start(`Testing ${provider} connection`);
|
|
25381
|
+
const { data: testData, error: testError } = await testIntegrationConnection(provider, env2);
|
|
25382
|
+
if (testError) {
|
|
25383
|
+
out.fail(`Connection test failed`);
|
|
25384
|
+
out.error(testError);
|
|
25385
|
+
process.exit(1);
|
|
25386
|
+
}
|
|
25387
|
+
const testResult = testData;
|
|
25388
|
+
if (testResult.success) {
|
|
25389
|
+
out.succeed(testResult.message);
|
|
25390
|
+
} else {
|
|
25391
|
+
out.fail(testResult.message);
|
|
25392
|
+
process.exit(1);
|
|
25393
|
+
}
|
|
25394
|
+
}
|
|
25395
|
+
console.log();
|
|
25396
|
+
return;
|
|
25397
|
+
}
|
|
25398
|
+
if (opts.test) {
|
|
25399
|
+
out.start(`Testing ${provider} connection`);
|
|
25400
|
+
const { data: testData, error: testError } = await testIntegrationConnection(provider, env2);
|
|
25401
|
+
if (testError) {
|
|
25402
|
+
out.fail(`Connection test failed`);
|
|
25403
|
+
out.error(testError);
|
|
25404
|
+
process.exit(1);
|
|
25405
|
+
}
|
|
25406
|
+
const testResult = testData;
|
|
25407
|
+
if (testResult.success) {
|
|
25408
|
+
out.succeed(testResult.message);
|
|
25409
|
+
} else {
|
|
25410
|
+
out.fail(testResult.message);
|
|
25411
|
+
process.exit(1);
|
|
25412
|
+
}
|
|
25413
|
+
console.log();
|
|
25414
|
+
return;
|
|
25415
|
+
}
|
|
25416
|
+
out.start(`Fetching ${provider} config`);
|
|
25417
|
+
const { data: configData, error: configError } = await getIntegrationConfig(provider, env2);
|
|
25418
|
+
if (configError) {
|
|
25419
|
+
out.fail(`Failed to fetch ${provider} config`);
|
|
25420
|
+
out.error(configError);
|
|
25421
|
+
process.exit(1);
|
|
25422
|
+
}
|
|
25423
|
+
if (!configData) {
|
|
25424
|
+
out.fail(`No ${provider} config found`);
|
|
25425
|
+
console.log();
|
|
25426
|
+
console.log(` ${source_default.gray(getProviderHelp(provider))}`);
|
|
25427
|
+
console.log();
|
|
25428
|
+
return;
|
|
25429
|
+
}
|
|
25430
|
+
out.succeed(`${provider} config loaded`);
|
|
25431
|
+
if (opts.json) {
|
|
25432
|
+
console.log(JSON.stringify(configData, null, 2));
|
|
25433
|
+
return;
|
|
25434
|
+
}
|
|
25435
|
+
const cfg = configData;
|
|
25436
|
+
const cfgData = cfg.config;
|
|
25437
|
+
console.log();
|
|
25438
|
+
console.log(source_default.bold(` ${provider}`));
|
|
25439
|
+
console.log(source_default.gray(" " + "\u2500".repeat(48)));
|
|
25440
|
+
console.log(` ${source_default.gray("Status:")} ${statusColor3(String(cfg.status ?? ""))}`);
|
|
25441
|
+
console.log(` ${source_default.gray("Environment:")} ${cfg.environment}`);
|
|
25442
|
+
console.log(` ${source_default.gray("Last Verified:")} ${cfg.lastVerifiedAt ? new Date(cfg.lastVerifiedAt).toLocaleString() : source_default.gray("never")}`);
|
|
25443
|
+
console.log(` ${source_default.gray("Updated:")} ${new Date(cfg.updatedAt).toLocaleString()}`);
|
|
25444
|
+
if (cfgData && Object.keys(cfgData).length > 0) {
|
|
25445
|
+
console.log();
|
|
25446
|
+
console.log(source_default.bold(" Config"));
|
|
25447
|
+
console.log(source_default.gray(" " + "\u2500".repeat(48)));
|
|
25448
|
+
const maxKeyLen = Math.max(...Object.keys(cfgData).map((k) => k.length));
|
|
25449
|
+
for (const [key, value] of Object.entries(cfgData)) {
|
|
25450
|
+
console.log(` ${source_default.gray(key.padEnd(maxKeyLen))} ${String(value ?? "")}`);
|
|
25451
|
+
}
|
|
25452
|
+
}
|
|
25453
|
+
console.log();
|
|
25454
|
+
});
|
|
25015
25455
|
// package.json
|
|
25016
25456
|
var package_default = {
|
|
25017
25457
|
name: "struere",
|
|
25018
|
-
version: "0.9.
|
|
25458
|
+
version: "0.9.4",
|
|
25019
25459
|
description: "Build, test, and deploy AI agents",
|
|
25020
25460
|
keywords: [
|
|
25021
25461
|
"ai",
|
|
@@ -25129,4 +25569,5 @@ program.addCommand(entitiesCommand);
|
|
|
25129
25569
|
program.addCommand(docsCommand);
|
|
25130
25570
|
program.addCommand(evalCommand);
|
|
25131
25571
|
program.addCommand(templatesCommand);
|
|
25572
|
+
program.addCommand(integrationCommand);
|
|
25132
25573
|
program.parse();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"integration.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/integration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAsGnC,eAAO,MAAM,kBAAkB,SAqO3B,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sync.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/sync.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAKnC,OAAO,EAAkC,KAAK,UAAU,EAAE,KAAK,WAAW,EAAE,MAAM,iBAAiB,CAAA;AACnG,OAAO,EAAoB,KAAK,eAAe,EAAE,MAAM,iBAAiB,CAAA;
|
|
1
|
+
{"version":3,"file":"sync.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/sync.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAKnC,OAAO,EAAkC,KAAK,UAAU,EAAE,KAAK,WAAW,EAAE,MAAM,iBAAiB,CAAA;AACnG,OAAO,EAAoB,KAAK,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAKxE,KAAK,WAAW,GAAG,WAAW,CAAC,aAAa,CAAC,CAAA;AAE7C,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,MAAM,CAAA;IACd,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,MAAM,EAAE,CAAA;CAClB;AAED,wBAAsB,cAAc,CAAC,GAAG,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CAsC7F;AAED,wBAAsB,iBAAiB,CACrC,SAAS,EAAE,eAAe,EAC1B,cAAc,EAAE,MAAM,GAAG,SAAS,EAClC,WAAW,EAAE,WAAW,GACvB,OAAO,CAAC,eAAe,EAAE,CAAC,CAiC5B;AAwCD,eAAO,MAAM,WAAW,SAyMpB,CAAA"}
|
package/dist/cli/index.js
CHANGED
|
@@ -65,6 +65,30 @@ var CONVEX_URL = process.env.STRUERE_CONVEX_URL || "https://rapid-wildebeest-172
|
|
|
65
65
|
function getSiteUrl() {
|
|
66
66
|
return CONVEX_URL.replace(".cloud", ".site");
|
|
67
67
|
}
|
|
68
|
+
async function refreshToken() {
|
|
69
|
+
const credentials = loadCredentials();
|
|
70
|
+
if (!credentials?.sessionId)
|
|
71
|
+
return null;
|
|
72
|
+
const siteUrl = getSiteUrl();
|
|
73
|
+
try {
|
|
74
|
+
const response = await fetch(`${siteUrl}/v1/auth/refresh`, {
|
|
75
|
+
method: "POST",
|
|
76
|
+
headers: { "Content-Type": "application/json" },
|
|
77
|
+
body: JSON.stringify({ sessionId: credentials.sessionId }),
|
|
78
|
+
signal: AbortSignal.timeout(1e4)
|
|
79
|
+
});
|
|
80
|
+
if (!response.ok)
|
|
81
|
+
return null;
|
|
82
|
+
const data = await response.json();
|
|
83
|
+
if (!data.token)
|
|
84
|
+
return null;
|
|
85
|
+
credentials.token = data.token;
|
|
86
|
+
saveCredentials(credentials);
|
|
87
|
+
return data.token;
|
|
88
|
+
} catch {
|
|
89
|
+
return null;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
68
92
|
async function listMyOrganizations(token) {
|
|
69
93
|
const response = await fetch(`${CONVEX_URL}/api/query`, {
|
|
70
94
|
method: "POST",
|
|
@@ -180,7 +204,11 @@ async function syncOrganization(payload) {
|
|
|
180
204
|
if (apiKey && !credentials?.token) {
|
|
181
205
|
return syncViaHttp(apiKey, payload);
|
|
182
206
|
}
|
|
183
|
-
|
|
207
|
+
if (credentials?.sessionId) {
|
|
208
|
+
await refreshToken();
|
|
209
|
+
}
|
|
210
|
+
const freshCredentials = loadCredentials();
|
|
211
|
+
const token = apiKey || freshCredentials?.token;
|
|
184
212
|
if (!token) {
|
|
185
213
|
return { success: false, error: "Not authenticated" };
|
|
186
214
|
}
|
|
@@ -247,7 +275,11 @@ async function getSyncState(organizationId, environment) {
|
|
|
247
275
|
return { error: `Network error: ${err instanceof Error ? err.message : String(err)}` };
|
|
248
276
|
}
|
|
249
277
|
}
|
|
250
|
-
|
|
278
|
+
if (credentials?.sessionId) {
|
|
279
|
+
await refreshToken();
|
|
280
|
+
}
|
|
281
|
+
const freshCredentials = loadCredentials();
|
|
282
|
+
const token = apiKey || freshCredentials?.token;
|
|
251
283
|
if (!token) {
|
|
252
284
|
return { error: "Not authenticated" };
|
|
253
285
|
}
|
|
@@ -299,7 +331,11 @@ async function getPullState(organizationId, environment = "development") {
|
|
|
299
331
|
return { error: `Network error: ${err instanceof Error ? err.message : String(err)}` };
|
|
300
332
|
}
|
|
301
333
|
}
|
|
302
|
-
|
|
334
|
+
if (credentials?.sessionId) {
|
|
335
|
+
await refreshToken();
|
|
336
|
+
}
|
|
337
|
+
const freshCredentials = loadCredentials();
|
|
338
|
+
const token = apiKey || freshCredentials?.token;
|
|
303
339
|
if (!token) {
|
|
304
340
|
return { error: "Not authenticated" };
|
|
305
341
|
}
|
|
@@ -356,6 +392,7 @@ async function browserLogin(spinner) {
|
|
|
356
392
|
if (result) {
|
|
357
393
|
printNextSteps();
|
|
358
394
|
}
|
|
395
|
+
process.exit(0);
|
|
359
396
|
}
|
|
360
397
|
async function browserLoginInternal(spinner) {
|
|
361
398
|
spinner.start("Starting authentication server");
|
|
@@ -406,7 +443,7 @@ async function browserLoginInternal(spinner) {
|
|
|
406
443
|
}
|
|
407
444
|
spinner.start("Waiting for authentication");
|
|
408
445
|
try {
|
|
409
|
-
const { token } = await authPromise;
|
|
446
|
+
const { token, sessionId } = await authPromise;
|
|
410
447
|
spinner.text = "Fetching user info";
|
|
411
448
|
const { userInfo, error } = await getUserInfo(token);
|
|
412
449
|
if (error || !userInfo) {
|
|
@@ -415,6 +452,7 @@ async function browserLoginInternal(spinner) {
|
|
|
415
452
|
const { user, organizations } = userInfo;
|
|
416
453
|
const credentials = {
|
|
417
454
|
token,
|
|
455
|
+
sessionId,
|
|
418
456
|
user: {
|
|
419
457
|
id: user.id,
|
|
420
458
|
email: user.email,
|
|
@@ -2134,7 +2172,8 @@ var BUILTIN_TOOLS = [
|
|
|
2134
2172
|
"airtable.getRecord",
|
|
2135
2173
|
"airtable.createRecords",
|
|
2136
2174
|
"airtable.updateRecords",
|
|
2137
|
-
"airtable.deleteRecords"
|
|
2175
|
+
"airtable.deleteRecords",
|
|
2176
|
+
"email.send"
|
|
2138
2177
|
];
|
|
2139
2178
|
function extractSyncPayload(resources) {
|
|
2140
2179
|
const customToolsMap = new Map;
|
|
@@ -2242,8 +2281,7 @@ function extractAgentPayload(agent, customToolsMap) {
|
|
|
2242
2281
|
return {
|
|
2243
2282
|
name: toolName,
|
|
2244
2283
|
description: getBuiltinToolDescription(toolName),
|
|
2245
|
-
parameters: getBuiltinToolParameters(toolName)
|
|
2246
|
-
isBuiltin: true
|
|
2284
|
+
parameters: getBuiltinToolParameters(toolName)
|
|
2247
2285
|
};
|
|
2248
2286
|
}
|
|
2249
2287
|
const customTool = customToolsMap.get(toolName);
|
|
@@ -2255,8 +2293,7 @@ function extractAgentPayload(agent, customToolsMap) {
|
|
|
2255
2293
|
name: customTool.name,
|
|
2256
2294
|
description: customTool.description,
|
|
2257
2295
|
parameters: customTool.parameters || { type: "object", properties: {} },
|
|
2258
|
-
handlerCode: extractHandlerCode(customTool._originalHandler || customTool.handler)
|
|
2259
|
-
isBuiltin: false
|
|
2296
|
+
handlerCode: extractHandlerCode(customTool._originalHandler || customTool.handler)
|
|
2260
2297
|
};
|
|
2261
2298
|
});
|
|
2262
2299
|
return {
|
|
@@ -2306,7 +2343,8 @@ function getBuiltinToolDescription(name) {
|
|
|
2306
2343
|
"airtable.getRecord": "Get a single record from an Airtable table by ID",
|
|
2307
2344
|
"airtable.createRecords": "Create up to 10 records in an Airtable table",
|
|
2308
2345
|
"airtable.updateRecords": "Update up to 10 records in an Airtable table",
|
|
2309
|
-
"airtable.deleteRecords": "Delete up to 10 records from an Airtable table"
|
|
2346
|
+
"airtable.deleteRecords": "Delete up to 10 records from an Airtable table",
|
|
2347
|
+
"email.send": "Send an email via Resend"
|
|
2310
2348
|
};
|
|
2311
2349
|
return descriptions[name] || name;
|
|
2312
2350
|
}
|
|
@@ -2603,6 +2641,17 @@ function getBuiltinToolParameters(name) {
|
|
|
2603
2641
|
recordIds: { type: "array", items: { type: "string" }, description: "Array of record IDs to delete (max 10)" }
|
|
2604
2642
|
},
|
|
2605
2643
|
required: ["baseId", "tableIdOrName", "recordIds"]
|
|
2644
|
+
},
|
|
2645
|
+
"email.send": {
|
|
2646
|
+
type: "object",
|
|
2647
|
+
properties: {
|
|
2648
|
+
to: { type: "string", description: "Recipient email address" },
|
|
2649
|
+
subject: { type: "string", description: "Email subject line" },
|
|
2650
|
+
html: { type: "string", description: "HTML body content" },
|
|
2651
|
+
text: { type: "string", description: "Plain text body content" },
|
|
2652
|
+
replyTo: { type: "string", description: "Reply-to email address" }
|
|
2653
|
+
},
|
|
2654
|
+
required: ["to", "subject"]
|
|
2606
2655
|
}
|
|
2607
2656
|
};
|
|
2608
2657
|
return schemas[name] || { type: "object", properties: {} };
|
|
@@ -2891,13 +2940,32 @@ var syncCommand = new Command4("sync").description("Sync resources to Convex and
|
|
|
2891
2940
|
}));
|
|
2892
2941
|
}
|
|
2893
2942
|
} catch (error) {
|
|
2894
|
-
if (jsonMode) {
|
|
2895
|
-
|
|
2943
|
+
if (isAuthError(error) && interactive && !jsonMode) {
|
|
2944
|
+
output.fail("Session expired - re-authenticating...");
|
|
2945
|
+
clearCredentials();
|
|
2946
|
+
const newCredentials = await performLogin();
|
|
2947
|
+
if (!newCredentials) {
|
|
2948
|
+
output.error("Authentication failed");
|
|
2949
|
+
process.exit(1);
|
|
2950
|
+
}
|
|
2951
|
+
output.start("Syncing to Convex");
|
|
2952
|
+
try {
|
|
2953
|
+
const result = await syncToEnvironment(cwd, project.organization.id, environment);
|
|
2954
|
+
output.succeed(`Synced to ${environment}`);
|
|
2955
|
+
} catch (retryError) {
|
|
2956
|
+
output.fail("Sync failed");
|
|
2957
|
+
output.error(retryError instanceof Error ? retryError.message : String(retryError));
|
|
2958
|
+
process.exit(1);
|
|
2959
|
+
}
|
|
2896
2960
|
} else {
|
|
2897
|
-
|
|
2898
|
-
|
|
2961
|
+
if (jsonMode) {
|
|
2962
|
+
console.log(JSON.stringify({ success: false, error: error instanceof Error ? error.message : String(error) }));
|
|
2963
|
+
} else {
|
|
2964
|
+
output.fail("Sync failed");
|
|
2965
|
+
output.error(error instanceof Error ? error.message : String(error));
|
|
2966
|
+
}
|
|
2967
|
+
process.exit(1);
|
|
2899
2968
|
}
|
|
2900
|
-
process.exit(1);
|
|
2901
2969
|
}
|
|
2902
2970
|
});
|
|
2903
2971
|
|
|
@@ -5719,10 +5787,387 @@ templatesCommand.command("status <name>").description("Check template approval s
|
|
|
5719
5787
|
console.log();
|
|
5720
5788
|
}
|
|
5721
5789
|
});
|
|
5790
|
+
|
|
5791
|
+
// src/cli/commands/integration.ts
|
|
5792
|
+
import { Command as Command15 } from "commander";
|
|
5793
|
+
import chalk17 from "chalk";
|
|
5794
|
+
import { confirm as confirm6 } from "@inquirer/prompts";
|
|
5795
|
+
|
|
5796
|
+
// src/cli/utils/integrations.ts
|
|
5797
|
+
var CONVEX_URL5 = process.env.STRUERE_CONVEX_URL || "https://rapid-wildebeest-172.convex.cloud";
|
|
5798
|
+
function getToken4() {
|
|
5799
|
+
const credentials = loadCredentials();
|
|
5800
|
+
const apiKey = getApiKey();
|
|
5801
|
+
return apiKey || credentials?.token || null;
|
|
5802
|
+
}
|
|
5803
|
+
async function convexQuery4(path, args) {
|
|
5804
|
+
const token = getToken4();
|
|
5805
|
+
if (!token)
|
|
5806
|
+
return { error: "Not authenticated" };
|
|
5807
|
+
const response = await fetch(`${CONVEX_URL5}/api/query`, {
|
|
5808
|
+
method: "POST",
|
|
5809
|
+
headers: {
|
|
5810
|
+
"Content-Type": "application/json",
|
|
5811
|
+
Authorization: `Bearer ${token}`
|
|
5812
|
+
},
|
|
5813
|
+
body: JSON.stringify({ path, args })
|
|
5814
|
+
});
|
|
5815
|
+
const text = await response.text();
|
|
5816
|
+
let json;
|
|
5817
|
+
try {
|
|
5818
|
+
json = JSON.parse(text);
|
|
5819
|
+
} catch {
|
|
5820
|
+
return { error: text || `HTTP ${response.status}` };
|
|
5821
|
+
}
|
|
5822
|
+
if (!response.ok) {
|
|
5823
|
+
const msg = json.errorData?.message || json.message || json.errorMessage || text;
|
|
5824
|
+
return { error: String(msg) };
|
|
5825
|
+
}
|
|
5826
|
+
if (json.status === "success")
|
|
5827
|
+
return { data: json.value };
|
|
5828
|
+
if (json.status === "error")
|
|
5829
|
+
return { error: String(json.errorMessage || "Unknown error") };
|
|
5830
|
+
return { error: `Unexpected response: ${text}` };
|
|
5831
|
+
}
|
|
5832
|
+
async function convexMutation3(path, args) {
|
|
5833
|
+
const token = getToken4();
|
|
5834
|
+
if (!token)
|
|
5835
|
+
return { error: "Not authenticated" };
|
|
5836
|
+
const response = await fetch(`${CONVEX_URL5}/api/mutation`, {
|
|
5837
|
+
method: "POST",
|
|
5838
|
+
headers: {
|
|
5839
|
+
"Content-Type": "application/json",
|
|
5840
|
+
Authorization: `Bearer ${token}`
|
|
5841
|
+
},
|
|
5842
|
+
body: JSON.stringify({ path, args })
|
|
5843
|
+
});
|
|
5844
|
+
const text = await response.text();
|
|
5845
|
+
let json;
|
|
5846
|
+
try {
|
|
5847
|
+
json = JSON.parse(text);
|
|
5848
|
+
} catch {
|
|
5849
|
+
return { error: text || `HTTP ${response.status}` };
|
|
5850
|
+
}
|
|
5851
|
+
if (!response.ok) {
|
|
5852
|
+
const msg = json.errorData?.message || json.message || json.errorMessage || text;
|
|
5853
|
+
return { error: String(msg) };
|
|
5854
|
+
}
|
|
5855
|
+
if (json.status === "success")
|
|
5856
|
+
return { data: json.value };
|
|
5857
|
+
if (json.status === "error")
|
|
5858
|
+
return { error: String(json.errorMessage || "Unknown error") };
|
|
5859
|
+
return { error: `Unexpected response: ${text}` };
|
|
5860
|
+
}
|
|
5861
|
+
async function convexAction2(path, args) {
|
|
5862
|
+
const token = getToken4();
|
|
5863
|
+
if (!token)
|
|
5864
|
+
return { error: "Not authenticated" };
|
|
5865
|
+
const response = await fetch(`${CONVEX_URL5}/api/action`, {
|
|
5866
|
+
method: "POST",
|
|
5867
|
+
headers: {
|
|
5868
|
+
"Content-Type": "application/json",
|
|
5869
|
+
Authorization: `Bearer ${token}`
|
|
5870
|
+
},
|
|
5871
|
+
body: JSON.stringify({ path, args })
|
|
5872
|
+
});
|
|
5873
|
+
const text = await response.text();
|
|
5874
|
+
let json;
|
|
5875
|
+
try {
|
|
5876
|
+
json = JSON.parse(text);
|
|
5877
|
+
} catch {
|
|
5878
|
+
return { error: text || `HTTP ${response.status}` };
|
|
5879
|
+
}
|
|
5880
|
+
if (!response.ok) {
|
|
5881
|
+
const msg = json.errorData?.message || json.message || json.errorMessage || text;
|
|
5882
|
+
return { error: String(msg) };
|
|
5883
|
+
}
|
|
5884
|
+
if (json.status === "success")
|
|
5885
|
+
return { data: json.value };
|
|
5886
|
+
if (json.status === "error")
|
|
5887
|
+
return { error: String(json.errorMessage || "Unknown error") };
|
|
5888
|
+
return { error: `Unexpected response: ${text}` };
|
|
5889
|
+
}
|
|
5890
|
+
async function getIntegrationConfig(provider, env) {
|
|
5891
|
+
return convexQuery4("integrations:getConfig", { provider, environment: env });
|
|
5892
|
+
}
|
|
5893
|
+
async function updateIntegrationConfig(provider, env, config) {
|
|
5894
|
+
return convexMutation3("integrations:updateConfig", { provider, environment: env, config });
|
|
5895
|
+
}
|
|
5896
|
+
async function testIntegrationConnection(provider, env) {
|
|
5897
|
+
return convexAction2("integrations:testConnection", { provider, environment: env });
|
|
5898
|
+
}
|
|
5899
|
+
async function deleteIntegrationConfig(provider, env) {
|
|
5900
|
+
return convexMutation3("integrations:deleteConfig", { provider, environment: env });
|
|
5901
|
+
}
|
|
5902
|
+
async function listIntegrationConfigs(env) {
|
|
5903
|
+
return convexQuery4("integrations:listConfigs", { environment: env });
|
|
5904
|
+
}
|
|
5905
|
+
async function setIntegrationStatus(provider, env, status) {
|
|
5906
|
+
return convexMutation3("integrations:setConfigStatus", { provider, environment: env, status });
|
|
5907
|
+
}
|
|
5908
|
+
|
|
5909
|
+
// src/cli/commands/integration.ts
|
|
5910
|
+
var VALID_PROVIDERS = ["airtable", "resend"];
|
|
5911
|
+
async function ensureAuth3() {
|
|
5912
|
+
const cwd = process.cwd();
|
|
5913
|
+
const nonInteractive = !isInteractive();
|
|
5914
|
+
if (!hasProject(cwd)) {
|
|
5915
|
+
if (nonInteractive) {
|
|
5916
|
+
console.error(chalk17.red("No struere.json found. Run struere init first."));
|
|
5917
|
+
process.exit(1);
|
|
5918
|
+
}
|
|
5919
|
+
console.log(chalk17.yellow("No struere.json found - initializing project..."));
|
|
5920
|
+
console.log();
|
|
5921
|
+
const success = await runInit(cwd);
|
|
5922
|
+
if (!success) {
|
|
5923
|
+
process.exit(1);
|
|
5924
|
+
}
|
|
5925
|
+
console.log();
|
|
5926
|
+
}
|
|
5927
|
+
let credentials = loadCredentials();
|
|
5928
|
+
const apiKey = getApiKey();
|
|
5929
|
+
if (!credentials && !apiKey) {
|
|
5930
|
+
if (nonInteractive) {
|
|
5931
|
+
console.error(chalk17.red("Not authenticated. Set STRUERE_API_KEY or run struere login."));
|
|
5932
|
+
process.exit(1);
|
|
5933
|
+
}
|
|
5934
|
+
console.log(chalk17.yellow("Not logged in - authenticating..."));
|
|
5935
|
+
console.log();
|
|
5936
|
+
credentials = await performLogin();
|
|
5937
|
+
if (!credentials) {
|
|
5938
|
+
console.log(chalk17.red("Authentication failed"));
|
|
5939
|
+
process.exit(1);
|
|
5940
|
+
}
|
|
5941
|
+
console.log();
|
|
5942
|
+
}
|
|
5943
|
+
return true;
|
|
5944
|
+
}
|
|
5945
|
+
function statusColor3(status) {
|
|
5946
|
+
switch (status) {
|
|
5947
|
+
case "active":
|
|
5948
|
+
return chalk17.green(status);
|
|
5949
|
+
case "inactive":
|
|
5950
|
+
return chalk17.yellow(status);
|
|
5951
|
+
case "error":
|
|
5952
|
+
return chalk17.red(status);
|
|
5953
|
+
default:
|
|
5954
|
+
return chalk17.gray(status);
|
|
5955
|
+
}
|
|
5956
|
+
}
|
|
5957
|
+
function getProviderHelp(provider) {
|
|
5958
|
+
switch (provider) {
|
|
5959
|
+
case "airtable":
|
|
5960
|
+
return `Usage: struere integration airtable --token <pat> [--base-id <id>] [--test]`;
|
|
5961
|
+
case "resend":
|
|
5962
|
+
return `Usage: struere integration resend --from-email <email> [--from-name <name>] [--reply-to <email>]`;
|
|
5963
|
+
default:
|
|
5964
|
+
return "";
|
|
5965
|
+
}
|
|
5966
|
+
}
|
|
5967
|
+
function buildConfigFromOpts(provider, opts) {
|
|
5968
|
+
if (provider === "airtable") {
|
|
5969
|
+
const config = {};
|
|
5970
|
+
if (opts.token)
|
|
5971
|
+
config.personalAccessToken = opts.token;
|
|
5972
|
+
if (opts.baseId)
|
|
5973
|
+
config.defaultBaseId = opts.baseId;
|
|
5974
|
+
if (Object.keys(config).length === 0)
|
|
5975
|
+
return null;
|
|
5976
|
+
return config;
|
|
5977
|
+
}
|
|
5978
|
+
if (provider === "resend") {
|
|
5979
|
+
const config = {};
|
|
5980
|
+
if (opts.fromEmail)
|
|
5981
|
+
config.fromEmail = opts.fromEmail;
|
|
5982
|
+
if (opts.fromName)
|
|
5983
|
+
config.fromName = opts.fromName;
|
|
5984
|
+
if (opts.replyTo)
|
|
5985
|
+
config.replyTo = opts.replyTo;
|
|
5986
|
+
if (Object.keys(config).length === 0)
|
|
5987
|
+
return null;
|
|
5988
|
+
return config;
|
|
5989
|
+
}
|
|
5990
|
+
return null;
|
|
5991
|
+
}
|
|
5992
|
+
var integrationCommand = new Command15("integration").description("Manage integrations").argument("[provider]", "Integration provider (airtable, resend)").option("--env <environment>", "Environment (development|production)", "development").option("--token <pat>", "Personal access token (airtable)").option("--base-id <id>", "Default base ID (airtable)").option("--from-email <email>", "From email address (resend)").option("--from-name <name>", "From display name (resend)").option("--reply-to <email>", "Reply-to address (resend)").option("--test", "Test the connection after saving").option("--remove", "Remove integration config").option("--enable", "Enable integration").option("--disable", "Disable integration").option("--status", "Show current config status").option("--yes", "Skip confirmation prompts").option("--json", "Output raw JSON").action(async (provider, opts) => {
|
|
5993
|
+
await ensureAuth3();
|
|
5994
|
+
const env = opts.env;
|
|
5995
|
+
const out = createOutput();
|
|
5996
|
+
if (!provider || provider === "list") {
|
|
5997
|
+
out.start("Fetching integrations");
|
|
5998
|
+
const { data, error } = await listIntegrationConfigs(env);
|
|
5999
|
+
if (error) {
|
|
6000
|
+
out.fail("Failed to fetch integrations");
|
|
6001
|
+
out.error(error);
|
|
6002
|
+
process.exit(1);
|
|
6003
|
+
}
|
|
6004
|
+
const configs = data ?? [];
|
|
6005
|
+
out.succeed(`Found ${configs.length} integration${configs.length !== 1 ? "s" : ""}`);
|
|
6006
|
+
if (opts.json) {
|
|
6007
|
+
console.log(JSON.stringify(configs, null, 2));
|
|
6008
|
+
return;
|
|
6009
|
+
}
|
|
6010
|
+
console.log();
|
|
6011
|
+
if (configs.length === 0) {
|
|
6012
|
+
console.log(chalk17.gray(" No integrations configured"));
|
|
6013
|
+
console.log();
|
|
6014
|
+
console.log(` ${chalk17.gray("Available:")} ${VALID_PROVIDERS.join(", ")}`);
|
|
6015
|
+
console.log(` ${chalk17.gray("Example:")} struere integration airtable --token <pat>`);
|
|
6016
|
+
console.log();
|
|
6017
|
+
return;
|
|
6018
|
+
}
|
|
6019
|
+
renderTable([
|
|
6020
|
+
{ key: "provider", label: "Provider", width: 16 },
|
|
6021
|
+
{ key: "status", label: "Status", width: 12 },
|
|
6022
|
+
{ key: "lastVerified", label: "Last Verified", width: 22 }
|
|
6023
|
+
], configs.map((c) => ({
|
|
6024
|
+
provider: c.provider,
|
|
6025
|
+
status: statusColor3(String(c.status ?? "")),
|
|
6026
|
+
lastVerified: c.lastVerifiedAt ? new Date(c.lastVerifiedAt).toLocaleString() : chalk17.gray("never")
|
|
6027
|
+
})));
|
|
6028
|
+
console.log();
|
|
6029
|
+
return;
|
|
6030
|
+
}
|
|
6031
|
+
if (!VALID_PROVIDERS.includes(provider)) {
|
|
6032
|
+
out.fail(`Unknown provider: ${provider}`);
|
|
6033
|
+
console.log(` ${chalk17.gray("Available:")} ${VALID_PROVIDERS.join(", ")}`);
|
|
6034
|
+
process.exit(1);
|
|
6035
|
+
}
|
|
6036
|
+
if (opts.remove) {
|
|
6037
|
+
if (!opts.yes && isInteractive()) {
|
|
6038
|
+
const confirmed = await confirm6({
|
|
6039
|
+
message: `Remove ${provider} integration config? This cannot be undone.`,
|
|
6040
|
+
default: false
|
|
6041
|
+
});
|
|
6042
|
+
if (!confirmed) {
|
|
6043
|
+
console.log(chalk17.gray("Cancelled"));
|
|
6044
|
+
return;
|
|
6045
|
+
}
|
|
6046
|
+
}
|
|
6047
|
+
out.start(`Removing ${provider} config`);
|
|
6048
|
+
const { data, error } = await deleteIntegrationConfig(provider, env);
|
|
6049
|
+
if (error) {
|
|
6050
|
+
out.fail(`Failed to remove ${provider} config`);
|
|
6051
|
+
out.error(error);
|
|
6052
|
+
process.exit(1);
|
|
6053
|
+
}
|
|
6054
|
+
const result = data;
|
|
6055
|
+
if (result?.success) {
|
|
6056
|
+
out.succeed(`${provider} config removed`);
|
|
6057
|
+
} else {
|
|
6058
|
+
out.fail(`No ${provider} config found`);
|
|
6059
|
+
}
|
|
6060
|
+
console.log();
|
|
6061
|
+
return;
|
|
6062
|
+
}
|
|
6063
|
+
if (opts.enable || opts.disable) {
|
|
6064
|
+
const newStatus = opts.enable ? "active" : "inactive";
|
|
6065
|
+
out.start(`Setting ${provider} to ${newStatus}`);
|
|
6066
|
+
const { data, error } = await setIntegrationStatus(provider, env, newStatus);
|
|
6067
|
+
if (error) {
|
|
6068
|
+
out.fail(`Failed to update ${provider} status`);
|
|
6069
|
+
out.error(error);
|
|
6070
|
+
process.exit(1);
|
|
6071
|
+
}
|
|
6072
|
+
const result = data;
|
|
6073
|
+
if (result?.success) {
|
|
6074
|
+
out.succeed(`${provider} set to ${statusColor3(newStatus)}`);
|
|
6075
|
+
} else {
|
|
6076
|
+
out.fail(`No ${provider} config found`);
|
|
6077
|
+
}
|
|
6078
|
+
console.log();
|
|
6079
|
+
return;
|
|
6080
|
+
}
|
|
6081
|
+
const config = buildConfigFromOpts(provider, opts);
|
|
6082
|
+
if (config) {
|
|
6083
|
+
out.start(`Saving ${provider} config`);
|
|
6084
|
+
const { error } = await updateIntegrationConfig(provider, env, config);
|
|
6085
|
+
if (error) {
|
|
6086
|
+
out.fail(`Failed to save ${provider} config`);
|
|
6087
|
+
out.error(error);
|
|
6088
|
+
process.exit(1);
|
|
6089
|
+
}
|
|
6090
|
+
out.succeed(`${provider} config saved`);
|
|
6091
|
+
if (opts.test) {
|
|
6092
|
+
out.start(`Testing ${provider} connection`);
|
|
6093
|
+
const { data: testData, error: testError } = await testIntegrationConnection(provider, env);
|
|
6094
|
+
if (testError) {
|
|
6095
|
+
out.fail(`Connection test failed`);
|
|
6096
|
+
out.error(testError);
|
|
6097
|
+
process.exit(1);
|
|
6098
|
+
}
|
|
6099
|
+
const testResult = testData;
|
|
6100
|
+
if (testResult.success) {
|
|
6101
|
+
out.succeed(testResult.message);
|
|
6102
|
+
} else {
|
|
6103
|
+
out.fail(testResult.message);
|
|
6104
|
+
process.exit(1);
|
|
6105
|
+
}
|
|
6106
|
+
}
|
|
6107
|
+
console.log();
|
|
6108
|
+
return;
|
|
6109
|
+
}
|
|
6110
|
+
if (opts.test) {
|
|
6111
|
+
out.start(`Testing ${provider} connection`);
|
|
6112
|
+
const { data: testData, error: testError } = await testIntegrationConnection(provider, env);
|
|
6113
|
+
if (testError) {
|
|
6114
|
+
out.fail(`Connection test failed`);
|
|
6115
|
+
out.error(testError);
|
|
6116
|
+
process.exit(1);
|
|
6117
|
+
}
|
|
6118
|
+
const testResult = testData;
|
|
6119
|
+
if (testResult.success) {
|
|
6120
|
+
out.succeed(testResult.message);
|
|
6121
|
+
} else {
|
|
6122
|
+
out.fail(testResult.message);
|
|
6123
|
+
process.exit(1);
|
|
6124
|
+
}
|
|
6125
|
+
console.log();
|
|
6126
|
+
return;
|
|
6127
|
+
}
|
|
6128
|
+
out.start(`Fetching ${provider} config`);
|
|
6129
|
+
const { data: configData, error: configError } = await getIntegrationConfig(provider, env);
|
|
6130
|
+
if (configError) {
|
|
6131
|
+
out.fail(`Failed to fetch ${provider} config`);
|
|
6132
|
+
out.error(configError);
|
|
6133
|
+
process.exit(1);
|
|
6134
|
+
}
|
|
6135
|
+
if (!configData) {
|
|
6136
|
+
out.fail(`No ${provider} config found`);
|
|
6137
|
+
console.log();
|
|
6138
|
+
console.log(` ${chalk17.gray(getProviderHelp(provider))}`);
|
|
6139
|
+
console.log();
|
|
6140
|
+
return;
|
|
6141
|
+
}
|
|
6142
|
+
out.succeed(`${provider} config loaded`);
|
|
6143
|
+
if (opts.json) {
|
|
6144
|
+
console.log(JSON.stringify(configData, null, 2));
|
|
6145
|
+
return;
|
|
6146
|
+
}
|
|
6147
|
+
const cfg = configData;
|
|
6148
|
+
const cfgData = cfg.config;
|
|
6149
|
+
console.log();
|
|
6150
|
+
console.log(chalk17.bold(` ${provider}`));
|
|
6151
|
+
console.log(chalk17.gray(" " + "\u2500".repeat(48)));
|
|
6152
|
+
console.log(` ${chalk17.gray("Status:")} ${statusColor3(String(cfg.status ?? ""))}`);
|
|
6153
|
+
console.log(` ${chalk17.gray("Environment:")} ${cfg.environment}`);
|
|
6154
|
+
console.log(` ${chalk17.gray("Last Verified:")} ${cfg.lastVerifiedAt ? new Date(cfg.lastVerifiedAt).toLocaleString() : chalk17.gray("never")}`);
|
|
6155
|
+
console.log(` ${chalk17.gray("Updated:")} ${new Date(cfg.updatedAt).toLocaleString()}`);
|
|
6156
|
+
if (cfgData && Object.keys(cfgData).length > 0) {
|
|
6157
|
+
console.log();
|
|
6158
|
+
console.log(chalk17.bold(" Config"));
|
|
6159
|
+
console.log(chalk17.gray(" " + "\u2500".repeat(48)));
|
|
6160
|
+
const maxKeyLen = Math.max(...Object.keys(cfgData).map((k) => k.length));
|
|
6161
|
+
for (const [key, value] of Object.entries(cfgData)) {
|
|
6162
|
+
console.log(` ${chalk17.gray(key.padEnd(maxKeyLen))} ${String(value ?? "")}`);
|
|
6163
|
+
}
|
|
6164
|
+
}
|
|
6165
|
+
console.log();
|
|
6166
|
+
});
|
|
5722
6167
|
// package.json
|
|
5723
6168
|
var package_default = {
|
|
5724
6169
|
name: "struere",
|
|
5725
|
-
version: "0.9.
|
|
6170
|
+
version: "0.9.4",
|
|
5726
6171
|
description: "Build, test, and deploy AI agents",
|
|
5727
6172
|
keywords: [
|
|
5728
6173
|
"ai",
|
|
@@ -5836,4 +6281,5 @@ program.addCommand(entitiesCommand);
|
|
|
5836
6281
|
program.addCommand(docsCommand);
|
|
5837
6282
|
program.addCommand(evalCommand);
|
|
5838
6283
|
program.addCommand(templatesCommand);
|
|
6284
|
+
program.addCommand(integrationCommand);
|
|
5839
6285
|
program.parse();
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export declare function refreshToken(): Promise<string | null>;
|
|
1
2
|
export interface UserInfo {
|
|
2
3
|
user: {
|
|
3
4
|
id: string;
|
|
@@ -38,7 +39,6 @@ export interface SyncPayload {
|
|
|
38
39
|
description: string;
|
|
39
40
|
parameters: unknown;
|
|
40
41
|
handlerCode?: string;
|
|
41
|
-
isBuiltin: boolean;
|
|
42
42
|
}>;
|
|
43
43
|
}>;
|
|
44
44
|
entityTypes: Array<{
|
|
@@ -220,7 +220,6 @@ export interface PullStateAgent {
|
|
|
220
220
|
description: string;
|
|
221
221
|
parameters: unknown;
|
|
222
222
|
handlerCode?: string;
|
|
223
|
-
isBuiltin: boolean;
|
|
224
223
|
}>;
|
|
225
224
|
}
|
|
226
225
|
export interface PullStateEntityType {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"convex.d.ts","sourceRoot":"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EAAE,CAAA;IAClC,KAAK,EAAE,aAAa,EAAE,CAAA;IACtB,QAAQ,EAAE,gBAAgB,EAAE,CAAA;CAC7B;AAED,wBAAsB,YAAY,CAChC,cAAc,CAAC,EAAE,MAAM,EACvB,WAAW,GAAE,aAAa,GAAG,YAAY,GAAG,MAAsB,GACjE,OAAO,CAAC;IAAE,KAAK,CAAC,EAAE,SAAS,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CAmEhD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"credentials.d.ts","sourceRoot":"","sources":["../../../src/cli/utils/credentials.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,IAAI,EAAE;QACJ,EAAE,EAAE,MAAM,CAAA;QACV,KAAK,EAAE,MAAM,CAAA;QACb,IAAI,EAAE,MAAM,CAAA;QACZ,cAAc,CAAC,EAAE,MAAM,CAAA;KACxB,CAAA;IACD,YAAY,CAAC,EAAE;QACb,EAAE,EAAE,MAAM,CAAA;QACV,IAAI,EAAE,MAAM,CAAA;QACZ,IAAI,EAAE,MAAM,CAAA;KACb,CAAA;IACD,SAAS,EAAE,MAAM,CAAA;CAClB;AAWD,wBAAgB,eAAe,CAAC,WAAW,EAAE,WAAW,GAAG,IAAI,CAG9D;AAED,wBAAgB,eAAe,IAAI,WAAW,GAAG,IAAI,CAkBpD;AAED,wBAAgB,gBAAgB,IAAI,IAAI,CAIvC;AAED,wBAAgB,SAAS,IAAI,MAAM,GAAG,IAAI,CAMzC"}
|
|
1
|
+
{"version":3,"file":"credentials.d.ts","sourceRoot":"","sources":["../../../src/cli/utils/credentials.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,CAAA;IACb,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,IAAI,EAAE;QACJ,EAAE,EAAE,MAAM,CAAA;QACV,KAAK,EAAE,MAAM,CAAA;QACb,IAAI,EAAE,MAAM,CAAA;QACZ,cAAc,CAAC,EAAE,MAAM,CAAA;KACxB,CAAA;IACD,YAAY,CAAC,EAAE;QACb,EAAE,EAAE,MAAM,CAAA;QACV,IAAI,EAAE,MAAM,CAAA;QACZ,IAAI,EAAE,MAAM,CAAA;KACb,CAAA;IACD,SAAS,EAAE,MAAM,CAAA;CAClB;AAWD,wBAAgB,eAAe,CAAC,WAAW,EAAE,WAAW,GAAG,IAAI,CAG9D;AAED,wBAAgB,eAAe,IAAI,WAAW,GAAG,IAAI,CAkBpD;AAED,wBAAgB,gBAAgB,IAAI,IAAI,CAIvC;AAED,wBAAgB,SAAS,IAAI,MAAM,GAAG,IAAI,CAMzC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extractor.d.ts","sourceRoot":"","sources":["../../../src/cli/utils/extractor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"extractor.d.ts","sourceRoot":"","sources":["../../../src/cli/utils/extractor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AA2C/C,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,KAAK,CAAC;QACZ,IAAI,EAAE,MAAM,CAAA;QACZ,IAAI,EAAE,MAAM,CAAA;QACZ,OAAO,EAAE,MAAM,CAAA;QACf,WAAW,CAAC,EAAE,MAAM,CAAA;QACpB,uBAAuB,CAAC,EAAE,MAAM,EAAE,CAAA;QAClC,mBAAmB,CAAC,EAAE,KAAK,CAAC;YAC1B,IAAI,EAAE,MAAM,CAAA;YACZ,IAAI,EAAE,QAAQ,GAAG,QAAQ,GAAG,SAAS,CAAA;YACrC,QAAQ,CAAC,EAAE,OAAO,CAAA;YAClB,WAAW,C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AAC,CAAA;SACnC,CAAC,CAAA;KACH,CAAC,CAAA;CACH;AAED,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,eAAe,GAAG,WAAW,CAuG1E"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
type Environment = 'development' | 'production';
|
|
2
|
+
export declare function getIntegrationConfig(provider: string, env: Environment): Promise<{
|
|
3
|
+
data?: unknown;
|
|
4
|
+
error?: string;
|
|
5
|
+
}>;
|
|
6
|
+
export declare function updateIntegrationConfig(provider: string, env: Environment, config: Record<string, unknown>): Promise<{
|
|
7
|
+
data?: unknown;
|
|
8
|
+
error?: string;
|
|
9
|
+
}>;
|
|
10
|
+
export declare function testIntegrationConnection(provider: string, env: Environment): Promise<{
|
|
11
|
+
data?: unknown;
|
|
12
|
+
error?: string;
|
|
13
|
+
}>;
|
|
14
|
+
export declare function deleteIntegrationConfig(provider: string, env: Environment): Promise<{
|
|
15
|
+
data?: unknown;
|
|
16
|
+
error?: string;
|
|
17
|
+
}>;
|
|
18
|
+
export declare function listIntegrationConfigs(env: Environment): Promise<{
|
|
19
|
+
data?: unknown;
|
|
20
|
+
error?: string;
|
|
21
|
+
}>;
|
|
22
|
+
export declare function setIntegrationStatus(provider: string, env: Environment, status: 'active' | 'inactive'): Promise<{
|
|
23
|
+
data?: unknown;
|
|
24
|
+
error?: string;
|
|
25
|
+
}>;
|
|
26
|
+
export {};
|
|
27
|
+
//# sourceMappingURL=integrations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"integrations.d.ts","sourceRoot":"","sources":["../../../src/cli/utils/integrations.ts"],"names":[],"mappings":"AAIA,KAAK,WAAW,GAAG,aAAa,GAAG,YAAY,CAAA;AAqG/C,wBAAsB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,WAAW;WA7Fa,OAAO;YAAU,MAAM;GA+FhH;AAED,wBAAsB,uBAAuB,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;WAlEpB,OAAO;YAAU,MAAM;GAoEnH;AAED,wBAAsB,yBAAyB,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,WAAW;WAvCS,OAAO;YAAU,MAAM;GAyCjH;AAED,wBAAsB,uBAAuB,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,WAAW;WA1Ea,OAAO;YAAU,MAAM;GA4EnH;AAED,wBAAsB,sBAAsB,CAAC,GAAG,EAAE,WAAW;WA7G6B,OAAO;YAAU,MAAM;GA+GhH;AAED,wBAAsB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,WAAW,EAAE,MAAM,EAAE,QAAQ,GAAG,UAAU;WAlFf,OAAO;YAAU,MAAM;GAoFnH"}
|