@tangle-network/agent-integrations 0.8.0 → 0.9.0

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 CHANGED
@@ -4296,6 +4296,95 @@ function getIntegrationFamily(id) {
4296
4296
  return INTEGRATION_FAMILIES[id];
4297
4297
  }
4298
4298
 
4299
+ // src/specs/overrides.ts
4300
+ var INTEGRATION_OVERRIDES = {
4301
+ // ── Stripe pack ────────────────────────────────────────────────────
4302
+ // Stripe issues two key types: secret keys (sk_*) and restricted keys
4303
+ // (rk_*). For voice-agent workloads, restricted keys are the right call
4304
+ // — least-privilege scoped to the specific resources the agent can
4305
+ // touch. The hint nudges operators toward that path.
4306
+ "stripe-pack": {
4307
+ consoleUrl: "https://dashboard.stripe.com/apikeys",
4308
+ credentialFields: [
4309
+ {
4310
+ label: "Stripe secret key",
4311
+ description: "Restricted key recommended. Dashboard \u2192 Developers \u2192 API keys \u2192 Create restricted key. Grant write access on Customers, Invoices, and Checkout Sessions.",
4312
+ example: "sk_live_\u2026 or rk_live_\u2026 (use sk_test_\u2026 / rk_test_\u2026 for staging)",
4313
+ regex: "^(sk|rk)_(live|test)_[A-Za-z0-9]+$",
4314
+ secret: true
4315
+ }
4316
+ ],
4317
+ consoleSteps: [
4318
+ {
4319
+ id: "open-keys",
4320
+ title: "Open Stripe API keys",
4321
+ detail: "Visit https://dashboard.stripe.com/apikeys",
4322
+ copyValue: "https://dashboard.stripe.com/apikeys"
4323
+ },
4324
+ {
4325
+ id: "create-restricted",
4326
+ title: "Create a restricted key",
4327
+ detail: 'Click "Create restricted key". Name it something descriptive (e.g. "ph0ny voice agent \u2014 prod"). Grant WRITE on Customers, Invoices, and Checkout Sessions. Leave everything else NONE.'
4328
+ },
4329
+ {
4330
+ id: "paste",
4331
+ title: "Paste the key",
4332
+ detail: "Copy the key Stripe shows once (rk_live_\u2026 or sk_live_\u2026). Paste it into ph0ny. The key is sealed before persistence."
4333
+ }
4334
+ ]
4335
+ },
4336
+ // ── Twilio SMS ─────────────────────────────────────────────────────
4337
+ // Twilio's REST API uses Basic auth with two parts: Account SID
4338
+ // (public-ish, AC…) + Auth Token (secret). The default api-key family
4339
+ // only exposes one field, which doesn't fit. Providing both fields
4340
+ // explicitly lets the consumer's UI render two inputs.
4341
+ "twilio-sms": {
4342
+ consoleUrl: "https://console.twilio.com/",
4343
+ credentialFields: [
4344
+ {
4345
+ label: "Account SID",
4346
+ description: "Your Twilio Account SID. Console \u2192 Account \u2192 API keys & tokens.",
4347
+ example: "AC\u2026 (34 hex chars)",
4348
+ regex: "^AC[a-f0-9]{32}$",
4349
+ secret: false
4350
+ },
4351
+ {
4352
+ label: "Auth Token",
4353
+ description: "Your Twilio Auth Token (or Standard API Key secret). Use a non-primary auth token in production so rotating it won't break other Twilio integrations.",
4354
+ secret: true
4355
+ }
4356
+ ],
4357
+ consoleSteps: [
4358
+ {
4359
+ id: "open",
4360
+ title: "Open Twilio console",
4361
+ detail: "Visit https://console.twilio.com/",
4362
+ copyValue: "https://console.twilio.com/"
4363
+ },
4364
+ {
4365
+ id: "find",
4366
+ title: "Find your Account SID + Auth Token",
4367
+ detail: "Account info is on the dashboard home. For better security, create a Standard API Key (Account \u2192 API keys & tokens \u2192 Create API Key) and use the SID + Secret pair instead of the primary auth token."
4368
+ },
4369
+ {
4370
+ id: "paste",
4371
+ title: "Paste both values",
4372
+ detail: "Account SID is non-secret; Auth Token is sealed before persistence."
4373
+ }
4374
+ ],
4375
+ knownQuirks: [
4376
+ {
4377
+ id: "subaccount-tokens",
4378
+ severity: "info",
4379
+ message: "If you use Twilio subaccounts, paste the SID/Token of the subaccount that owns the phone numbers your agent calls \u2014 not the master account."
4380
+ }
4381
+ ]
4382
+ }
4383
+ };
4384
+ function getIntegrationOverride(kind) {
4385
+ return INTEGRATION_OVERRIDES[kind];
4386
+ }
4387
+
4299
4388
  // src/specs/registry.ts
4300
4389
  var EXECUTABLE_KINDS = /* @__PURE__ */ new Set([
4301
4390
  "google-calendar",
@@ -4364,6 +4453,8 @@ function specFromCoverage(coverage, connector) {
4364
4453
  const permissions = permissionsFor(coverage, connector.actions);
4365
4454
  const auth = authFor(coverage, family, permissions);
4366
4455
  const status = statusFor(kind);
4456
+ const override = getIntegrationOverride(kind) ?? getIntegrationOverride(coverage.id);
4457
+ const knownQuirks = override?.knownQuirks ? [...familySpec.knownQuirks ?? [], ...override.knownQuirks] : familySpec.knownQuirks;
4367
4458
  return {
4368
4459
  kind,
4369
4460
  title: connector.title,
@@ -4375,12 +4466,13 @@ function specFromCoverage(coverage, connector) {
4375
4466
  actions: connector.actions,
4376
4467
  triggers: connector.triggers,
4377
4468
  setup: {
4378
- consoleUrl: familySpec.consoleUrl,
4379
- consoleSteps: familySpec.consoleSteps,
4380
- credentialFields: credentialFieldsFor(auth),
4469
+ consoleUrl: override?.consoleUrl ?? familySpec.consoleUrl,
4470
+ consoleSteps: override?.consoleSteps ?? familySpec.consoleSteps,
4471
+ credentialFields: override?.credentialFields ?? credentialFieldsFor(auth),
4381
4472
  redirectUriTemplate: auth.mode === "oauth2" ? auth.redirectUriTemplate : familySpec.redirectUriTemplate,
4382
- knownQuirks: familySpec.knownQuirks,
4383
- healthcheck: healthcheckFor(kind, status, auth)
4473
+ knownQuirks,
4474
+ postSetup: override?.postSetup,
4475
+ healthcheck: override?.healthcheck ?? healthcheckFor(kind, status, auth)
4384
4476
  },
4385
4477
  lifecycle: familySpec.lifecycle,
4386
4478
  plannerHints: plannerHintsFor(coverage, connector.actions),