@syntica/mcp 2.5.0 → 2.5.1
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.js +124 -20
- package/package.json +1 -1
- package/skills/skills/connections/SKILL.md +35 -0
package/dist/index.js
CHANGED
|
@@ -40684,9 +40684,9 @@ var require_connect = __commonJS({
|
|
|
40684
40684
|
if (config3 === void 0) {
|
|
40685
40685
|
config3 = DEFAULT_CONFIG;
|
|
40686
40686
|
}
|
|
40687
|
-
var
|
|
40687
|
+
var connector2 = config3.connector;
|
|
40688
40688
|
return lift_1.operate(function(source, subscriber) {
|
|
40689
|
-
var subject =
|
|
40689
|
+
var subject = connector2();
|
|
40690
40690
|
innerFrom_1.innerFrom(selector(fromSubscribable_1.fromSubscribable(subject))).subscribe(subscriber);
|
|
40691
40691
|
subscriber.add(source.subscribe(subject));
|
|
40692
40692
|
});
|
|
@@ -41574,13 +41574,13 @@ var require_groupBy = __commonJS({
|
|
|
41574
41574
|
var Subject_1 = require_Subject();
|
|
41575
41575
|
var lift_1 = require_lift();
|
|
41576
41576
|
var OperatorSubscriber_1 = require_OperatorSubscriber();
|
|
41577
|
-
function groupBy(keySelector, elementOrOptions, duration3,
|
|
41577
|
+
function groupBy(keySelector, elementOrOptions, duration3, connector2) {
|
|
41578
41578
|
return lift_1.operate(function(source, subscriber) {
|
|
41579
41579
|
var element;
|
|
41580
41580
|
if (!elementOrOptions || typeof elementOrOptions === "function") {
|
|
41581
41581
|
element = elementOrOptions;
|
|
41582
41582
|
} else {
|
|
41583
|
-
duration3 = elementOrOptions.duration, element = elementOrOptions.element,
|
|
41583
|
+
duration3 = elementOrOptions.duration, element = elementOrOptions.element, connector2 = elementOrOptions.connector;
|
|
41584
41584
|
}
|
|
41585
41585
|
var groups = /* @__PURE__ */ new Map();
|
|
41586
41586
|
var notify = function(cb) {
|
|
@@ -41599,7 +41599,7 @@ var require_groupBy = __commonJS({
|
|
|
41599
41599
|
var key_1 = keySelector(value);
|
|
41600
41600
|
var group_1 = groups.get(key_1);
|
|
41601
41601
|
if (!group_1) {
|
|
41602
|
-
groups.set(key_1, group_1 =
|
|
41602
|
+
groups.set(key_1, group_1 = connector2 ? connector2() : new Subject_1.Subject());
|
|
41603
41603
|
var grouped = createGroupedObservable(key_1, group_1);
|
|
41604
41604
|
subscriber.next(grouped);
|
|
41605
41605
|
if (duration3) {
|
|
@@ -43132,7 +43132,7 @@ var require_share = __commonJS({
|
|
|
43132
43132
|
if (options === void 0) {
|
|
43133
43133
|
options = {};
|
|
43134
43134
|
}
|
|
43135
|
-
var _a = options.connector,
|
|
43135
|
+
var _a = options.connector, connector2 = _a === void 0 ? function() {
|
|
43136
43136
|
return new Subject_1.Subject();
|
|
43137
43137
|
} : _a, _b = options.resetOnError, resetOnError = _b === void 0 ? true : _b, _c = options.resetOnComplete, resetOnComplete = _c === void 0 ? true : _c, _d = options.resetOnRefCountZero, resetOnRefCountZero = _d === void 0 ? true : _d;
|
|
43138
43138
|
return function(wrapperSource) {
|
|
@@ -43161,7 +43161,7 @@ var require_share = __commonJS({
|
|
|
43161
43161
|
if (!hasErrored && !hasCompleted) {
|
|
43162
43162
|
cancelReset();
|
|
43163
43163
|
}
|
|
43164
|
-
var dest = subject = subject !== null && subject !== void 0 ? subject :
|
|
43164
|
+
var dest = subject = subject !== null && subject !== void 0 ? subject : connector2();
|
|
43165
43165
|
subscriber.add(function() {
|
|
43166
43166
|
refCount--;
|
|
43167
43167
|
if (refCount === 0 && !hasErrored && !hasCompleted) {
|
|
@@ -52660,9 +52660,9 @@ var require_FailoverDetector = __commonJS({
|
|
|
52660
52660
|
var CHANNEL_NAME = "+switch-master";
|
|
52661
52661
|
var FailoverDetector = class {
|
|
52662
52662
|
// sentinels can't be used for regular commands after this
|
|
52663
|
-
constructor(
|
|
52663
|
+
constructor(connector2, sentinels) {
|
|
52664
52664
|
this.isDisconnected = false;
|
|
52665
|
-
this.connector =
|
|
52665
|
+
this.connector = connector2;
|
|
52666
52666
|
this.sentinels = sentinels;
|
|
52667
52667
|
}
|
|
52668
52668
|
cleanup() {
|
|
@@ -68161,7 +68161,8 @@ var CONNECTORS = [
|
|
|
68161
68161
|
SAP_PASSWORD: "Password, hidden after saving"
|
|
68162
68162
|
},
|
|
68163
68163
|
pitch: { title: "Let your apps work with SAP data", examples: "Sales orders, stock, customers. Read straight from the system your business runs on.", effort: "About 30 minutes. You need an SAP basis admin." },
|
|
68164
|
-
docsUrl: "https://help.sap.com/docs/SAP_NETWEAVER_750/68bf513362174d54b58cddec28794093/"
|
|
68164
|
+
docsUrl: "https://help.sap.com/docs/SAP_NETWEAVER_750/68bf513362174d54b58cddec28794093/",
|
|
68165
|
+
gateway: { baseUrlVar: "SAP_ODATA_URL", upstream: { fromVar: "SAP_ODATA_URL" }, credentialVars: ["SAP_PASSWORD"], auth: ["basic"], basicUserVar: "SAP_USER" }
|
|
68165
68166
|
},
|
|
68166
68167
|
{
|
|
68167
68168
|
id: "sharepoint",
|
|
@@ -68331,7 +68332,8 @@ var CONNECTORS = [
|
|
|
68331
68332
|
GEMINI_API_KEY: "API key, starts AIza"
|
|
68332
68333
|
},
|
|
68333
68334
|
pitch: { title: "Let your apps use Gemini", examples: "Summaries, extraction, chat. Billed to your own Google account.", effort: "About 5 minutes. You need a Google Cloud project." },
|
|
68334
|
-
docsUrl: "https://ai.google.dev/gemini-api/docs"
|
|
68335
|
+
docsUrl: "https://ai.google.dev/gemini-api/docs",
|
|
68336
|
+
gateway: { baseUrlVar: "GOOGLE_GEMINI_BASE_URL", upstream: "https://generativelanguage.googleapis.com", credentialVars: ["GEMINI_API_KEY"], auth: ["x-goog-api-key"], ai: true }
|
|
68335
68337
|
},
|
|
68336
68338
|
{
|
|
68337
68339
|
id: "openai",
|
|
@@ -68357,7 +68359,8 @@ var CONNECTORS = [
|
|
|
68357
68359
|
OPENAI_API_KEY: "API key, starts sk-"
|
|
68358
68360
|
},
|
|
68359
68361
|
pitch: { title: "Let your apps use OpenAI", examples: "Summaries, extraction, chat. Billed to your own OpenAI account.", effort: "About 5 minutes. You need an OpenAI admin login." },
|
|
68360
|
-
docsUrl: "https://platform.openai.com/docs/api-reference"
|
|
68362
|
+
docsUrl: "https://platform.openai.com/docs/api-reference",
|
|
68363
|
+
gateway: { baseUrlVar: "OPENAI_BASE_URL", upstream: "https://api.openai.com/v1", credentialVars: ["OPENAI_API_KEY"], auth: ["bearer"], ai: true }
|
|
68361
68364
|
},
|
|
68362
68365
|
{
|
|
68363
68366
|
id: "anthropic",
|
|
@@ -68382,10 +68385,32 @@ var CONNECTORS = [
|
|
|
68382
68385
|
ANTHROPIC_API_KEY: "API key, starts sk-ant-"
|
|
68383
68386
|
},
|
|
68384
68387
|
pitch: { title: "Let your apps use Claude", examples: "Summaries, extraction, chat. Billed to your own Anthropic account.", effort: "About 5 minutes. You need an Anthropic admin login." },
|
|
68385
|
-
docsUrl: "https://docs.claude.com/en/api/overview"
|
|
68388
|
+
docsUrl: "https://docs.claude.com/en/api/overview",
|
|
68389
|
+
gateway: { baseUrlVar: "ANTHROPIC_BASE_URL", upstream: "https://api.anthropic.com", credentialVars: ["ANTHROPIC_API_KEY"], auth: ["x-api-key", "bearer"], ai: true }
|
|
68390
|
+
},
|
|
68391
|
+
// Internal: an https echo server, to test the connector gateway end to end (#1469).
|
|
68392
|
+
{
|
|
68393
|
+
id: "echo",
|
|
68394
|
+
name: "Echo",
|
|
68395
|
+
category: "Internal",
|
|
68396
|
+
tone: "blue",
|
|
68397
|
+
blurb: "An echo server for testing the connector gateway.",
|
|
68398
|
+
long: "Internal test fixture. Not offered to customers.",
|
|
68399
|
+
vars: ["ECHO_URL", "ECHO_API_KEY"],
|
|
68400
|
+
steps: ["Deploy an https echo server and note its URL."],
|
|
68401
|
+
tagline: "An echo server for testing the connector gateway.",
|
|
68402
|
+
points: [],
|
|
68403
|
+
varDescriptions: { ECHO_URL: "The echo server URL", ECHO_API_KEY: "Any key, echoed back" },
|
|
68404
|
+
pitch: { title: "Echo", examples: "Internal test fixture.", effort: "Internal only." },
|
|
68405
|
+
docsUrl: "https://syntica.io",
|
|
68406
|
+
gateway: { baseUrlVar: "ECHO_URL", upstream: { fromVar: "ECHO_URL" }, credentialVars: ["ECHO_API_KEY"], auth: ["bearer"] },
|
|
68407
|
+
hidden: true
|
|
68386
68408
|
}
|
|
68387
68409
|
];
|
|
68388
|
-
var CONNECTOR_CATEGORIES = Array.from(new Set(CONNECTORS.map((c) => c.category)));
|
|
68410
|
+
var CONNECTOR_CATEGORIES = Array.from(new Set(CONNECTORS.filter((c) => c.hidden !== true).map((c) => c.category)));
|
|
68411
|
+
function connector(id) {
|
|
68412
|
+
return CONNECTORS.find((c) => c.id === id);
|
|
68413
|
+
}
|
|
68389
68414
|
|
|
68390
68415
|
// libs/shared/src/types/resource.ts
|
|
68391
68416
|
var MIN_BACKUP_RETENTION_DAYS = 1;
|
|
@@ -70004,6 +70029,23 @@ var UserClient = class {
|
|
|
70004
70029
|
role
|
|
70005
70030
|
});
|
|
70006
70031
|
}
|
|
70032
|
+
/** Whether the actor may add someone to these groups now (an invite that carries groups). */
|
|
70033
|
+
canAddToGroups(orgId, actorUserId, groupIds) {
|
|
70034
|
+
return this.request("POST", "/access-control/internal/can-add-to-groups", {
|
|
70035
|
+
orgId,
|
|
70036
|
+
actorUserId,
|
|
70037
|
+
groupIds
|
|
70038
|
+
});
|
|
70039
|
+
}
|
|
70040
|
+
/** Adds a member who accepted an invite to its groups, as the inviter. Groups the inviter may no longer add to are skipped. */
|
|
70041
|
+
addInviteeToGroups(orgId, actorUserId, userId, groupIds) {
|
|
70042
|
+
return this.request("POST", "/access-control/internal/groups/add-invitee", {
|
|
70043
|
+
orgId,
|
|
70044
|
+
actorUserId,
|
|
70045
|
+
userId,
|
|
70046
|
+
groupIds
|
|
70047
|
+
});
|
|
70048
|
+
}
|
|
70007
70049
|
addMember(orgId, options) {
|
|
70008
70050
|
return this.request("POST", `/organisations/internal/${orgId}/members`, options);
|
|
70009
70051
|
}
|
|
@@ -71380,8 +71422,9 @@ var NOTIFICATION_TYPES = {
|
|
|
71380
71422
|
target: () => "cloud-accounts"
|
|
71381
71423
|
},
|
|
71382
71424
|
// Day 1 after the CloudFormation stack of an org cloud account was deleted
|
|
71383
|
-
// (RFC #1248). Apps keep running in
|
|
71384
|
-
// addresses stop working at the end of
|
|
71425
|
+
// (RFC #1248), or an admin left Syntica for it (#1476). Apps keep running in
|
|
71426
|
+
// the customer's account, but default addresses stop working at the end of
|
|
71427
|
+
// the grace period. `cause` says which, notices sent before it carry none.
|
|
71385
71428
|
"cloud_account.disconnected": {
|
|
71386
71429
|
key: "cloud_account.disconnected",
|
|
71387
71430
|
category: "connection",
|
|
@@ -71391,7 +71434,7 @@ var NOTIFICATION_TYPES = {
|
|
|
71391
71434
|
emailDefault: true,
|
|
71392
71435
|
emailTemplateId: "cloud-account-disconnected",
|
|
71393
71436
|
title: (x) => `Cloud account disconnected \xB7 ${v(x, "accountName")}`,
|
|
71394
|
-
body: (x) => `The Syntica stack in ${v(x, "accountName")} (${v(x, "region")}) was deleted
|
|
71437
|
+
body: (x) => `${v(x, "cause") || `The Syntica stack in ${v(x, "accountName")} (${v(x, "region")}) was deleted.`} Its apps keep running in your AWS account, but the default addresses of its ${environments(x)} stop working on ${v(x, "defaultAddressesUntil")}. Apps that already have their own domain keep working.`,
|
|
71395
71438
|
target: () => "cloud-accounts"
|
|
71396
71439
|
},
|
|
71397
71440
|
// Day 5 of the same grace period: the last reminder before the default addresses go.
|
|
@@ -71440,6 +71483,19 @@ var NOTIFICATION_TYPES = {
|
|
|
71440
71483
|
body: (x) => `No connection with the ${v(x, "environment")} node of ${v(x, "appName")} since ${v(x, "lastContact")}. The app keeps running on its last settings, but deploys and changes cannot reach it. ${v(x, "reason")}${v(x, "exitNote") !== "" ? ` ${v(x, "exitNote")}` : ""}`,
|
|
71441
71484
|
target: appTarget
|
|
71442
71485
|
},
|
|
71486
|
+
// Emitted by agent-gateway from the agent's connectors.gateway.report, once per crossing into down.
|
|
71487
|
+
"connectors.gateway.down": {
|
|
71488
|
+
key: "connectors.gateway.down",
|
|
71489
|
+
category: "connection",
|
|
71490
|
+
severity: "error",
|
|
71491
|
+
audience: "admins",
|
|
71492
|
+
inAppDefault: true,
|
|
71493
|
+
emailDefault: true,
|
|
71494
|
+
emailTemplateId: "connectors-gateway-down",
|
|
71495
|
+
title: (x) => `Connector gateway down \xB7 ${v(x, "appName")}`,
|
|
71496
|
+
body: (x) => `The connector gateway on the ${v(x, "environment")} node of ${v(x, "appName")} stopped answering. Connections in gateway mode fail until it is back.`,
|
|
71497
|
+
target: appTarget
|
|
71498
|
+
},
|
|
71443
71499
|
// Confirmation to the person that their account is scheduled for deletion (userId-targeted).
|
|
71444
71500
|
"user.erasure.scheduled": {
|
|
71445
71501
|
key: "user.erasure.scheduled",
|
|
@@ -72670,7 +72726,7 @@ var tools6 = [
|
|
|
72670
72726
|
// apps/mcp-server/src/tools/connections.ts
|
|
72671
72727
|
var appDescribeConnectionsTool = {
|
|
72672
72728
|
name: "app_describe_connections",
|
|
72673
|
-
description: "Describe the platform connections granted to an application environment \u2014 mail, storage, databases, payments, AI and the rest of the connector catalogue. Returns each granted connection's connector, its name, and the environment variable NAMES the platform injects at deploy time. Never returns a credential. ALWAYS call this before writing or changing code that talks to an external system: write against the injected variables, never hardcode a credential, and never add a client library that contradicts the granted connector. If nothing is granted, say so and point the user at Connections rather than inventing a path of your own.",
|
|
72729
|
+
description: "Describe the platform connections granted to an application environment \u2014 mail, storage, databases, payments, AI and the rest of the connector catalogue. Returns each granted connection's connector, its name, and the environment variable NAMES the platform injects at deploy time. Never returns a credential. ALWAYS call this before writing or changing code that talks to an external system: write against the injected variables, never hardcode a credential or a vendor host (an AI SDK reads its base URL from OPENAI_BASE_URL, ANTHROPIC_BASE_URL or GOOGLE_GEMINI_BASE_URL), and never add a client library that contradicts the granted connector. If nothing is granted, say so and point the user at Connections rather than inventing a path of your own. Where a connection carries baseUrl, call the vendor through baseUrl.variable, never through another URL variable: in gateway mode only that one reaches the gateway. Use the fallback only when the variable is unset.",
|
|
72674
72730
|
annotations: { readOnlyHint: true, destructiveHint: false },
|
|
72675
72731
|
inputSchema: {
|
|
72676
72732
|
type: "object",
|
|
@@ -72700,11 +72756,28 @@ async function handleAppDescribeConnections(args) {
|
|
|
72700
72756
|
if (!res.ok) {
|
|
72701
72757
|
return { content: [{ type: "text", text: `Error: ${json.error ?? res.statusText}` }], isError: true };
|
|
72702
72758
|
}
|
|
72703
|
-
|
|
72759
|
+
const connections = Array.isArray(json.data) ? json.data.map(withBaseUrl) : json.data;
|
|
72760
|
+
return { content: [{ type: "text", text: JSON.stringify({ connections }, null, 2) }] };
|
|
72704
72761
|
} catch (err) {
|
|
72705
72762
|
return fromCatch(err);
|
|
72706
72763
|
}
|
|
72707
72764
|
}
|
|
72765
|
+
function withBaseUrl(c) {
|
|
72766
|
+
const def = typeof c.connectorId === "string" ? connector(c.connectorId) : void 0;
|
|
72767
|
+
if (def?.gateway === void 0 || def.vars.includes(def.gateway.baseUrlVar)) {
|
|
72768
|
+
return c;
|
|
72769
|
+
}
|
|
72770
|
+
const upstream = def.gateway.upstream;
|
|
72771
|
+
const fallback = typeof upstream === "string" ? { fallbackUrl: upstream } : { fallbackVariable: upstream.fromVar };
|
|
72772
|
+
return {
|
|
72773
|
+
...c,
|
|
72774
|
+
baseUrl: {
|
|
72775
|
+
variable: def.gateway.baseUrlVar,
|
|
72776
|
+
...fallback,
|
|
72777
|
+
note: "Call the vendor through this variable. Use the fallback only when it is unset, never ahead of it."
|
|
72778
|
+
}
|
|
72779
|
+
};
|
|
72780
|
+
}
|
|
72708
72781
|
var appRequestConnectionTool = {
|
|
72709
72782
|
name: "app_request_connection",
|
|
72710
72783
|
description: 'Ask an organisation admin for a connection on one application environment. Use this when app_describe_connections returns nothing for the system you need \u2014 instead of asking the user for a credential or telling them to go and configure one. Names a connector from the catalogue (e.g. "smtp", "stripe", "slack"); the admin decides which of their connections satisfies it and is notified in the platform and by email. Repeating a request that is already pending returns the open one rather than queueing another.',
|
|
@@ -73759,12 +73832,43 @@ async function handleAppReplaceInstance(args) {
|
|
|
73759
73832
|
{ confirm }
|
|
73760
73833
|
);
|
|
73761
73834
|
}
|
|
73835
|
+
var appSetSleepWhenIdleTool = {
|
|
73836
|
+
name: "app_set_sleep_when_idle",
|
|
73837
|
+
description: "Set sleep when idle for an environment. Only for environments in the customer's own cloud account (AWS). Stops the environment after that many minutes without visitors and wakes it again on the next visit. The saving lands on the customer's own AWS bill. Pass minutes 0 to turn it off.",
|
|
73838
|
+
annotations: { readOnlyHint: false, destructiveHint: false },
|
|
73839
|
+
inputSchema: {
|
|
73840
|
+
type: "object",
|
|
73841
|
+
properties: {
|
|
73842
|
+
...NODE_ACTION_SCHEMA.properties,
|
|
73843
|
+
minutes: { type: "number", enum: [0, 15, 30, 60, 120], description: "Minutes without visitors before it sleeps. 0 turns it off." }
|
|
73844
|
+
},
|
|
73845
|
+
required: [...NODE_ACTION_SCHEMA.required, "minutes"]
|
|
73846
|
+
}
|
|
73847
|
+
};
|
|
73848
|
+
async function handleAppSetSleepWhenIdle(args) {
|
|
73849
|
+
const token = args["token"];
|
|
73850
|
+
if (!token) {
|
|
73851
|
+
return notAuthenticatedResult();
|
|
73852
|
+
}
|
|
73853
|
+
const minutes = args["minutes"];
|
|
73854
|
+
const res = await fetch(`${config2.services.deployServiceUrl}/deploy/nodes/sleep-when-idle`, {
|
|
73855
|
+
method: "PATCH",
|
|
73856
|
+
headers: { "Content-Type": "application/json", Authorization: `Bearer ${token}` },
|
|
73857
|
+
body: JSON.stringify({ applicationId: args["applicationId"], environment: args["environment"], minutes: minutes === 0 ? null : minutes })
|
|
73858
|
+
});
|
|
73859
|
+
if (!res.ok) {
|
|
73860
|
+
return failFromResponse(res, "Setting sleep when idle failed");
|
|
73861
|
+
}
|
|
73862
|
+
const text2 = minutes === 0 ? "Sleep when idle is off. The environment keeps running." : `Sleep when idle is on. The environment stops after ${String(minutes)} minutes without visitors and starts again on the next visit.`;
|
|
73863
|
+
return { content: [{ type: "text", text: text2 }] };
|
|
73864
|
+
}
|
|
73762
73865
|
var tools14 = [
|
|
73763
73866
|
{ definition: appRestartInstanceTool, handle: handleAppRestartInstance },
|
|
73764
73867
|
{ definition: appStopInstanceTool, handle: handleAppStopInstance },
|
|
73765
73868
|
{ definition: appStartInstanceTool, handle: handleAppStartInstance },
|
|
73766
73869
|
{ definition: appReprovisionInstanceTool, handle: handleAppReprovisionInstance },
|
|
73767
|
-
{ definition: appReplaceInstanceTool, handle: handleAppReplaceInstance }
|
|
73870
|
+
{ definition: appReplaceInstanceTool, handle: handleAppReplaceInstance },
|
|
73871
|
+
{ definition: appSetSleepWhenIdleTool, handle: handleAppSetSleepWhenIdle }
|
|
73768
73872
|
];
|
|
73769
73873
|
|
|
73770
73874
|
// apps/mcp-server/src/tools/node-tiers.ts
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@syntica/mcp",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.1",
|
|
4
4
|
"description": "MCP server and skills for deploying applications on Syntica from your coding agent (Claude Code, OpenCode, Codex CLI, Gemini CLI, Copilot CLI, Cursor)",
|
|
5
5
|
"mcpName": "io.syntica/mcp",
|
|
6
6
|
"bin": {
|
|
@@ -34,6 +34,11 @@ Note the names carefully. A grant may carry a **prefix**, so a second mailbox
|
|
|
34
34
|
arrives as `SUPPORT_SMTP_HOST` rather than `SMTP_HOST`. Use exactly what the tool
|
|
35
35
|
returns.
|
|
36
36
|
|
|
37
|
+
A connection to an HTTP API, such as OpenAI or Anthropic, may also carry
|
|
38
|
+
`baseUrl`: the variable to call the vendor through, such as `OPENAI_BASE_URL`.
|
|
39
|
+
Its names are unprefixed like the others, so apply the grant's prefix to both
|
|
40
|
+
`baseUrl.variable` and `baseUrl.fallbackVariable`.
|
|
41
|
+
|
|
37
42
|
## Step 2 — If nothing is granted, stop and say so
|
|
38
43
|
|
|
39
44
|
An empty list is a real answer, not an error. Tell the user:
|
|
@@ -66,6 +71,17 @@ Read them from the environment. Use the ordinary library for the language and th
|
|
|
66
71
|
vendor — `stripe`, `@slack/web-api`, `nodemailer`, `smtplib` — except where the
|
|
67
72
|
connector's own notes say otherwise.
|
|
68
73
|
|
|
74
|
+
**Call the vendor through `baseUrl.variable`** when the connection has one. In
|
|
75
|
+
gateway mode the platform points it at its connector gateway, which holds the
|
|
76
|
+
real key, and the key variable holds only a placeholder. A call to any other URL
|
|
77
|
+
skips the gateway and fails. The variable may be unset in direct mode, so fall
|
|
78
|
+
back to `baseUrl.fallbackUrl`, or to the variable named in
|
|
79
|
+
`baseUrl.fallbackVariable`, only then:
|
|
80
|
+
|
|
81
|
+
```ts
|
|
82
|
+
const baseUrl = process.env.OPENAI_BASE_URL ?? 'https://api.openai.com/v1';
|
|
83
|
+
```
|
|
84
|
+
|
|
69
85
|
Two that are worth knowing:
|
|
70
86
|
|
|
71
87
|
- **Microsoft 365 mail** is two HTTPS calls and needs no dependency at all: a
|
|
@@ -75,6 +91,22 @@ Two that are worth knowing:
|
|
|
75
91
|
on 465, STARTTLS otherwise. Unlike every other connector, SMTP code does not
|
|
76
92
|
work at all without the grant — the node drops the connection (see Step 2).
|
|
77
93
|
Do not write it until the environment holds an SMTP grant.
|
|
94
|
+
- **AI (OpenAI, Anthropic, Gemini)**: use the official SDK and let it read its
|
|
95
|
+
base URL from the environment: `OPENAI_BASE_URL`, `ANTHROPIC_BASE_URL` or
|
|
96
|
+
`GOOGLE_GEMINI_BASE_URL`. The platform injects it next to the key. **Never
|
|
97
|
+
hardcode a vendor host** (`api.openai.com`, `api.anthropic.com`,
|
|
98
|
+
`generativelanguage.googleapis.com`) or pass a fixed `baseURL` ahead of the
|
|
99
|
+
variable (a fallback for when it is unset is fine): in gateway mode
|
|
100
|
+
the key is a placeholder that only works through the injected base URL, so a
|
|
101
|
+
hardcoded host fails. For Gemini use `@google/genai` (Node) or `google-genai`
|
|
102
|
+
(Python), not the legacy SDK, which ignores the variable. An admin may limit an
|
|
103
|
+
AI connection to certain models and a monthly token budget. A refusal arrives in
|
|
104
|
+
the vendor's own error shape (403 for a model that is not allowed, 429 when the
|
|
105
|
+
budget is spent), so handle it as you would the vendor's. Under a model
|
|
106
|
+
allowlist every call must name its model, and under a budget only chat,
|
|
107
|
+
responses, messages, token counting and OpenAI embedding calls go through, as
|
|
108
|
+
plain JSON: no file uploads, batches, background responses, Gemini embeddings,
|
|
109
|
+
audio or realtime sessions.
|
|
78
110
|
|
|
79
111
|
Send, post or authenticate only as the identity the connection carries
|
|
80
112
|
(`MAIL_FROM`, the granted channel, the granted site). Pin it: read the identity
|
|
@@ -93,6 +125,9 @@ Check for them at startup and fail with a clear message:
|
|
|
93
125
|
> No `<system>` connection is injected here. Grant one for this environment, or
|
|
94
126
|
> run against the dev environment.
|
|
95
127
|
|
|
128
|
+
The `baseUrl` variable is the exception. It may be unset, so use its fallback
|
|
129
|
+
instead of failing.
|
|
130
|
+
|
|
96
131
|
This matters more than it looks. The variables are absent when running locally —
|
|
97
132
|
they exist only on the platform's instances, never on a laptop — and an
|
|
98
133
|
unexplained local failure is exactly what tempts someone into pasting a
|