@executor-js/plugin-openapi 1.5.14 → 1.5.16

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.
Files changed (62) hide show
  1. package/dist/AddOpenApiSource-U7AYB224.js +369 -0
  2. package/dist/AddOpenApiSource-U7AYB224.js.map +1 -0
  3. package/dist/{OpenApiAccountsPanel-Y2RGBSSL.js → OpenApiAccountsPanel-GHFHHE6P.js} +15 -39
  4. package/dist/OpenApiAccountsPanel-GHFHHE6P.js.map +1 -0
  5. package/dist/{UpdateSpecSection-MIZ5GLBM.js → UpdateSpecSection-PLCBUU4I.js} +4 -4
  6. package/dist/UpdateSpecSection-PLCBUU4I.js.map +1 -0
  7. package/dist/api/group.d.ts +0 -21
  8. package/dist/api/index.d.ts +0 -21
  9. package/dist/{chunk-PNOEE3ET.js → chunk-3FM2SWM4.js} +643 -569
  10. package/dist/chunk-3FM2SWM4.js.map +1 -0
  11. package/dist/chunk-CKBX4SXK.js +95 -0
  12. package/dist/chunk-CKBX4SXK.js.map +1 -0
  13. package/dist/{chunk-GS5YN6J4.js → chunk-CPPTKUOW.js} +5 -14
  14. package/dist/chunk-CPPTKUOW.js.map +1 -0
  15. package/dist/{chunk-RFSMGUBJ.js → chunk-KVPUDOJZ.js} +83 -8
  16. package/dist/chunk-KVPUDOJZ.js.map +1 -0
  17. package/dist/{chunk-PAHWRRS3.js → chunk-QQFCICLX.js} +4 -13
  18. package/dist/chunk-QQFCICLX.js.map +1 -0
  19. package/dist/client.js +4 -5
  20. package/dist/client.js.map +1 -1
  21. package/dist/core.js +25 -15
  22. package/dist/core.js.map +1 -1
  23. package/dist/index.js +4 -5
  24. package/dist/index.js.map +1 -1
  25. package/dist/react/atoms.d.ts +0 -22
  26. package/dist/react/client.d.ts +0 -21
  27. package/dist/react/index.d.ts +2 -0
  28. package/dist/sdk/backing.d.ts +54 -0
  29. package/dist/sdk/config.d.ts +0 -2
  30. package/dist/sdk/derive-auth.d.ts +5 -3
  31. package/dist/sdk/extract.d.ts +12 -1
  32. package/dist/sdk/index.d.ts +2 -1
  33. package/dist/sdk/invoke.d.ts +12 -1
  34. package/dist/sdk/plugin.d.ts +4 -10
  35. package/dist/sdk/presets.d.ts +0 -1
  36. package/dist/sdk/preview.d.ts +79 -0
  37. package/dist/sdk/types.d.ts +53 -0
  38. package/dist/testing/index.d.ts +0 -6
  39. package/package.json +6 -5
  40. package/dist/AddOpenApiSource-7TI5XUUY.js +0 -765
  41. package/dist/AddOpenApiSource-7TI5XUUY.js.map +0 -1
  42. package/dist/OpenApiAccountsPanel-Y2RGBSSL.js.map +0 -1
  43. package/dist/UpdateSpecSection-MIZ5GLBM.js.map +0 -1
  44. package/dist/chunk-GS5YN6J4.js.map +0 -1
  45. package/dist/chunk-I2XDCVVM.js +0 -712
  46. package/dist/chunk-I2XDCVVM.js.map +0 -1
  47. package/dist/chunk-MZWZQ24W.js +0 -226
  48. package/dist/chunk-MZWZQ24W.js.map +0 -1
  49. package/dist/chunk-PAHWRRS3.js.map +0 -1
  50. package/dist/chunk-PNOEE3ET.js.map +0 -1
  51. package/dist/chunk-RFSMGUBJ.js.map +0 -1
  52. package/dist/react/GoogleProductPicker.d.ts +0 -9
  53. package/dist/sdk/google-discovery.d.ts +0 -43
  54. package/dist/sdk/google-discovery.test.d.ts +0 -1
  55. package/dist/sdk/google-oauth-batches.d.ts +0 -13
  56. package/dist/sdk/google-oauth-batches.test.d.ts +0 -1
  57. package/dist/sdk/google-oauth-scopes.d.ts +0 -3
  58. package/dist/sdk/google-oauth-scopes.test.d.ts +0 -1
  59. package/dist/sdk/google-presets.d.ts +0 -16
  60. package/dist/sdk/google-presets.test.d.ts +0 -1
  61. package/dist/sdk/google-product-picker-scopes.test.d.ts +0 -1
  62. /package/dist/sdk/{google-bundle.test.d.ts → store.test.d.ts} +0 -0
package/dist/core.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/sdk/index.ts","../src/sdk/migrate-config.ts","../src/sdk/output-schema-migration.ts","../src/sdk/spec-blob-migration.ts"],"sourcesContent":["export { parse, resolveSpecText, fetchSpecText } from \"./parse\";\nexport {\n convertGoogleDiscoveryBundleToOpenApi,\n convertGoogleDiscoveryToOpenApi,\n fetchGoogleDiscoveryDocument,\n isGoogleDiscoveryUrl,\n type GoogleDiscoveryOpenApiConversion,\n} from \"./google-discovery\";\nexport { extract } from \"./extract\";\nexport { invoke, invokeWithLayer, annotationsForOperation } from \"./invoke\";\nexport {\n openApiPlugin,\n type OpenApiSpecConfig,\n type OpenApiConfigureInput,\n type OpenApiSpecInput,\n type OpenApiPreviewInput,\n type OpenApiPluginExtension,\n type OpenApiPluginOptions,\n} from \"./plugin\";\nexport { type OpenapiStore, type StoredOperation, makeDefaultOpenapiStore } from \"./store\";\nexport {\n decodeOpenApiIntegrationConfig,\n renderAuthTemplate,\n AuthenticationSchema,\n OpenApiIntegrationConfigSchema,\n type OpenApiIntegrationConfig,\n type RenderedAuth,\n} from \"./config\";\nexport {\n previewSpec,\n SecurityScheme,\n AuthStrategy,\n HeaderPreset,\n OAuth2Preset,\n OAuth2Flows,\n OAuth2AuthorizationCodeFlow,\n OAuth2ClientCredentialsFlow,\n PreviewOperation,\n SpecPreview,\n} from \"./preview\";\nexport {\n DocResolver,\n resolveServerUrl,\n substituteUrlVariables,\n preferredContent,\n} from \"./openapi-utils\";\n\nexport {\n OpenApiParseError,\n OpenApiExtractionError,\n OpenApiInvocationError,\n OpenApiOAuthError,\n OpenApiAuthRequiredError,\n} from \"./errors\";\n\nexport {\n EncodingObject,\n ExtractedOperation,\n ExtractionResult,\n InvocationResult,\n MediaBinding,\n OperationBinding,\n OperationParameter,\n OperationRequestBody,\n ServerInfo,\n ServerVariable,\n OperationId,\n HttpMethod,\n ParameterLocation,\n TOKEN_VARIABLE,\n normalizeOpenApiAuthInputs,\n type Authentication,\n type AuthenticationInput,\n type APIKeyAuthentication,\n} from \"./types\";\n// Request-shaped authoring: `headers: { Authorization: [\"Bearer \", variable(\"token\")] }`.\nexport { variable, type ApiKeyAuthTemplate } from \"@executor-js/sdk/http-auth\";\n\nexport { migrateOpenApiAuthConfig } from \"./migrate-config\";\n\nexport {\n openApiOutputSchemaDataMigration,\n runSqliteOpenApiOutputSchemaMigration,\n unwrapOpenApiTransportEnvelope,\n} from \"./output-schema-migration\";\n\nexport { openApiSpecBlobDataMigration } from \"./spec-blob-migration\";\n","// ---------------------------------------------------------------------------\n// One-off config migration — rewrite pre-canonical OpenAPI integration\n// `config` blobs into the canonical placements model. Runs once per database\n// (boot for local/selfhost, out-of-band script for cloud); runtime code\n// decodes ONLY the canonical shape (`decodeOpenApiIntegrationConfig`).\n//\n// The retired shape is the `variable()`-templated apiKey:\n// { slug, type: \"apiKey\", headers/queryParams: Record<name,\n// string | (string | {type:\"variable\", name})[]> }\n// Each entry becomes one placement: prefix = literals before the first\n// variable, the variable name preserved VERBATIM (it keys the connections'\n// stored `item_ids`; the canonical `token` is stored as absent), a\n// literal-only value becomes a `literal` placement. OAuth templates\n// re-key from the retired `type: \"oauth\"` spelling to `kind: \"oauth2\"`.\n// ---------------------------------------------------------------------------\n\nimport { Option } from \"effect\";\nimport {\n apiKeyMethodFromLegacyTemplate,\n decodeLegacyApiKeyTemplate,\n} from \"@executor-js/sdk/http-auth\";\n\nimport { decodeOpenApiIntegrationConfig } from \"./config\";\n\nconst isCanonicalEntry = (entry: unknown): boolean =>\n typeof entry === \"object\" &&\n entry !== null &&\n \"kind\" in entry &&\n ((entry as { kind: unknown }).kind === \"apikey\" ||\n (entry as { kind: unknown }).kind === \"oauth2\");\n\n/** The retired oauth spelling: `type: \"oauth\"` instead of `kind: \"oauth2\"`. */\nconst isLegacyOAuthEntry = (\n entry: unknown,\n): entry is { readonly type: \"oauth\" } & Record<string, unknown> =>\n typeof entry === \"object\" &&\n entry !== null &&\n \"type\" in entry &&\n (entry as { type: unknown }).type === \"oauth\";\n\nconst migrateEntry = (entry: unknown): unknown | null => {\n if (isCanonicalEntry(entry)) return entry;\n if (isLegacyOAuthEntry(entry)) {\n const { type: _type, ...rest } = entry;\n return { ...rest, kind: \"oauth2\" };\n }\n const legacy = Option.getOrNull(decodeLegacyApiKeyTemplate(entry));\n if (legacy !== null) return apiKeyMethodFromLegacyTemplate(legacy);\n return null;\n};\n\n/** Rewrite a stored OpenAPI integration config blob into the canonical shape.\n * Returns the rewritten config, or `null` when no rewrite is needed (already\n * canonical, no auth templates, or not this plugin's shape). Idempotent. */\nexport const migrateOpenApiAuthConfig = (config: unknown): unknown | null => {\n if (typeof config !== \"object\" || config === null) return null;\n if (!(\"spec\" in config) && !(\"specHash\" in config)) return null;\n if (!(\"authenticationTemplate\" in config)) return null;\n\n const entries = (config as { authenticationTemplate: unknown }).authenticationTemplate;\n if (!Array.isArray(entries)) return null;\n\n const migrated = entries.map(migrateEntry);\n if (migrated.some((entry) => entry === null)) return null;\n const changed = migrated.some((entry, index) => entry !== entries[index]);\n if (!changed) return null;\n\n const next = { ...config, authenticationTemplate: migrated };\n return decodeOpenApiIntegrationConfig(next) !== null ? next : null;\n};\n","// ---------------------------------------------------------------------------\n// Data migration: unwrap the retired {status, headers, data} transport\n// envelope from persisted OpenAPI tool output schemas. The runtime returns\n// the upstream payload as `data` (status/headers live in the ToolResult\n// `http` side channel), so persisted schemas must describe the payload\n// only — otherwise describe previews show an envelope invocations no\n// longer return. Mirrors the cloud drizzle migration\n// (apps/cloud/drizzle/0002_unwrap_openapi_output_envelope.sql) for the\n// libSQL-backed apps, where it runs once through the data-migration ledger.\n//\n// Idempotent: payload-shaped rows don't match the envelope signature, so\n// re-running plans zero updates.\n// ---------------------------------------------------------------------------\n\nimport { Effect, Option, Schema } from \"effect\";\nimport { DataMigrationError, type SqliteDataMigrationClient } from \"@executor-js/sdk/core\";\n\nconst MIGRATION_NAME = \"2026-06-11-openapi-output-envelope-unwrap\";\n\nconst isRecord = (value: unknown): value is Record<string, unknown> =>\n typeof value === \"object\" && value !== null && !Array.isArray(value);\n\n// `{\"type\": \"integer\"}` — the envelope's `status` property schema, exactly.\nconst isEnvelopeStatusSchema = (value: unknown): boolean =>\n isRecord(value) && Object.keys(value).length === 1 && value.type === \"integer\";\n\n// `{\"type\": \"object\", \"additionalProperties\": {\"type\": \"string\"}}` — the\n// envelope's `headers` property schema, exactly.\nconst isEnvelopeHeadersSchema = (value: unknown): boolean =>\n isRecord(value) &&\n Object.keys(value).length === 2 &&\n value.type === \"object\" &&\n isRecord(value.additionalProperties) &&\n Object.keys(value.additionalProperties).length === 1 &&\n value.additionalProperties.type === \"string\";\n\n/**\n * If `schema` is the retired transport envelope, return the payload schema\n * to persist instead (`null` when the envelope carried an empty `{}` data\n * schema — the new producer persists no output schema for those). Returns\n * undefined when the schema is not an envelope and the row must be left\n * untouched.\n */\nexport const unwrapOpenApiTransportEnvelope = (\n schema: unknown,\n): { readonly outputSchema: unknown | null } | undefined => {\n if (!isRecord(schema)) return undefined;\n if (schema.type !== \"object\" || schema.additionalProperties !== false) return undefined;\n const required = schema.required;\n if (!Array.isArray(required) || required.length !== 3) return undefined;\n if (![\"status\", \"headers\", \"data\"].every((key) => required.includes(key))) return undefined;\n const properties = schema.properties;\n if (!isRecord(properties) || !(\"data\" in properties)) return undefined;\n if (!isEnvelopeStatusSchema(properties.status)) return undefined;\n if (!isEnvelopeHeadersSchema(properties.headers)) return undefined;\n const data = properties.data;\n const outputSchema = isRecord(data) && Object.keys(data).length === 0 ? null : data;\n return { outputSchema };\n};\n\nconst decodeJsonOption = Schema.decodeUnknownOption(Schema.UnknownFromJsonString);\n\nconst execute = (\n client: SqliteDataMigrationClient,\n stmt: string | { readonly sql: string; readonly args: readonly unknown[] },\n) =>\n Effect.tryPromise({\n try: () => client.execute(stmt),\n catch: (cause) => new DataMigrationError({ migration: MIGRATION_NAME, cause }),\n });\n\n/** Unwrap envelope-shaped openapi tool output schemas in a SQLite database.\n * Returns the number of rows rewritten. The `tool` table may not exist yet\n * on a fresh database — that counts as nothing to migrate. */\nexport const runSqliteOpenApiOutputSchemaMigration = (\n client: SqliteDataMigrationClient,\n): Effect.Effect<number, DataMigrationError> =>\n Effect.gen(function* () {\n const exists = yield* execute(\n client,\n \"SELECT name FROM sqlite_master WHERE type = 'table' AND name = 'tool'\",\n );\n if (exists.rows.length === 0) return 0;\n\n const result = yield* execute(\n client,\n \"SELECT row_id, output_schema FROM tool WHERE plugin_id = 'openapi' AND output_schema IS NOT NULL\",\n );\n const updates: { readonly rowId: string; readonly outputSchema: unknown | null }[] = [];\n for (const row of result.rows) {\n if (typeof row.row_id !== \"string\" || typeof row.output_schema !== \"string\") continue;\n const schema = decodeJsonOption(row.output_schema);\n if (Option.isNone(schema)) continue;\n const unwrapped = unwrapOpenApiTransportEnvelope(schema.value);\n if (unwrapped !== undefined) updates.push({ rowId: row.row_id, ...unwrapped });\n }\n if (updates.length === 0) return 0;\n\n const applyAll = Effect.gen(function* () {\n for (const update of updates) {\n yield* execute(client, {\n sql: \"UPDATE tool SET output_schema = ? WHERE row_id = ?\",\n args: [\n update.outputSchema === null ? null : JSON.stringify(update.outputSchema),\n update.rowId,\n ],\n });\n }\n yield* execute(client, \"COMMIT\");\n });\n\n yield* execute(client, \"BEGIN\");\n yield* applyAll.pipe(Effect.tapError(() => execute(client, \"ROLLBACK\").pipe(Effect.ignore)));\n return updates.length;\n });\n\n/** Registry entry for the boot-time data-migration ledger. */\nexport const openApiOutputSchemaDataMigration = {\n name: MIGRATION_NAME,\n run: (client: SqliteDataMigrationClient) =>\n runSqliteOpenApiOutputSchemaMigration(client).pipe(Effect.asVoid),\n};\n","// ---------------------------------------------------------------------------\n// Data migration: move inline OpenAPI spec text out of `integration.config`\n// into the blob table (`spec/<sha256>`, config keeps `specHash`) — the\n// libSQL-ledger counterpart of cloud's out-of-band migrate-specs-to-blobs\n// script. Runs once per database through the data-migration ledger; the\n// shared body lives in @executor-js/sdk (`runSqliteConfigBlobMigration`).\n// ---------------------------------------------------------------------------\n\nimport { Effect } from \"effect\";\nimport {\n runSqliteConfigBlobMigration,\n type SqliteDataMigrationClient,\n} from \"@executor-js/sdk/core\";\n\nconst MIGRATION_NAME = \"2026-06-12-openapi-spec-to-blob\";\n\n/** Registry entry for the boot-time data-migration ledger. */\nexport const openApiSpecBlobDataMigration = {\n name: MIGRATION_NAME,\n run: (client: SqliteDataMigrationClient) =>\n runSqliteConfigBlobMigration(client, {\n migrationName: MIGRATION_NAME,\n pluginId: \"openapi\",\n inlineField: \"spec\",\n hashField: \"specHash\",\n blobKeyPrefix: \"spec\",\n }).pipe(Effect.asVoid),\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4EA,SAAS,gBAAyC;;;AC5DlD,SAAS,cAAc;AACvB;AAAA,EACE;AAAA,EACA;AAAA,OACK;AAIP,IAAM,mBAAmB,CAAC,UACxB,OAAO,UAAU,YACjB,UAAU,QACV,UAAU,UACR,MAA4B,SAAS,YACpC,MAA4B,SAAS;AAG1C,IAAM,qBAAqB,CACzB,UAEA,OAAO,UAAU,YACjB,UAAU,QACV,UAAU,SACT,MAA4B,SAAS;AAExC,IAAM,eAAe,CAAC,UAAmC;AACvD,MAAI,iBAAiB,KAAK,EAAG,QAAO;AACpC,MAAI,mBAAmB,KAAK,GAAG;AAC7B,UAAM,EAAE,MAAM,OAAO,GAAG,KAAK,IAAI;AACjC,WAAO,EAAE,GAAG,MAAM,MAAM,SAAS;AAAA,EACnC;AACA,QAAM,SAAS,OAAO,UAAU,2BAA2B,KAAK,CAAC;AACjE,MAAI,WAAW,KAAM,QAAO,+BAA+B,MAAM;AACjE,SAAO;AACT;AAKO,IAAM,2BAA2B,CAAC,WAAoC;AAC3E,MAAI,OAAO,WAAW,YAAY,WAAW,KAAM,QAAO;AAC1D,MAAI,EAAE,UAAU,WAAW,EAAE,cAAc,QAAS,QAAO;AAC3D,MAAI,EAAE,4BAA4B,QAAS,QAAO;AAElD,QAAM,UAAW,OAA+C;AAChE,MAAI,CAAC,MAAM,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AO;AAAA,QACT;AAAA,MACF,CAAC;AAAA,IACH;AACA,WAAO,QAAQ,QAAQ,QAAQ;AAAA,EACjC,CAAC;AAED,SAAO,QAAQ,QAAQ,OAAO;AAC9B,SAAO,SAAS,KAAK,OAAO,SAAS,MAAM,QAAQ,QAAQ,UAAU,EAAE,KAAK,OAAO,MAAM,CAAC,CAAC;AAC3F,SAAO,QAAQ;AACjB,CAAC;AAGI,IAAM,mCAAmC;AAAA,EAC9C,MAAM;AAAA,EACN,KAAK,CAAC,WACJ,sCAAsC,MAAM,EAAE,KAAK,OAAO,MAAM;AACpE;;;ACjHA,SAAS,UAAAC,eAAc;AACvB;AAAA,EACE;AAAA,OAEK;AAEP,IAAMC,kBAAiB;AAGhB,IAAM,+BAA+B;AAAA,EAC1C,MAAMA;AAAA,EACN,KAAK,CAAC,WACJ,6BAA6B,QAAQ;AAAA,IACnC,eAAeA;AAAA,IACf,UAAU;AAAA,IACV,aAAa;AAAA,IACb,WAAW;AAAA,IACX,eAAe;AAAA,EACjB,CAAC,EAAE,KAAKD,QAAO,MAAM;AACzB;","names":["Option","Effect","MIGRATION_NAME"]}
1
+ {"version":3,"sources":["../src/sdk/index.ts","../src/sdk/migrate-config.ts","../src/sdk/output-schema-migration.ts","../src/sdk/spec-blob-migration.ts"],"sourcesContent":["export { parse, resolveSpecText, fetchSpecText } from \"./parse\";\nexport { extract } from \"./extract\";\nexport { invoke, invokeWithLayer, annotationsForOperation } from \"./invoke\";\nexport {\n compileOpenApiDocument,\n compileOpenApiSpec,\n extractOpenApiUpstreamMessage,\n invokeOpenApiBackedTool,\n loadOpenApiSpecText,\n normalizeOpenApiRefs,\n openApiStoredOperationsFromCompiled,\n openApiToolDefsFromCompiled,\n resolveOpenApiBackedAnnotations,\n resolveOpenApiBackedTools,\n type CompiledOpenApiSpec,\n} from \"./backing\";\nexport type { ParsedDocument } from \"./parse\";\nexport {\n openApiPlugin,\n type OpenApiSpecConfig,\n type OpenApiConfigureInput,\n type OpenApiSpecInput,\n type OpenApiPreviewInput,\n type OpenApiPluginExtension,\n type OpenApiPluginOptions,\n} from \"./plugin\";\nexport { type OpenapiStore, type StoredOperation, makeDefaultOpenapiStore } from \"./store\";\nexport {\n decodeOpenApiIntegrationConfig,\n renderAuthTemplate,\n AuthenticationSchema,\n OpenApiIntegrationConfigSchema,\n type OpenApiIntegrationConfig,\n type RenderedAuth,\n} from \"./config\";\nexport {\n previewSpec,\n SecurityScheme,\n AuthStrategy,\n HeaderPreset,\n OAuth2Preset,\n OAuth2Flows,\n OAuth2AuthorizationCodeFlow,\n OAuth2ClientCredentialsFlow,\n PreviewOperation,\n SpecPreview,\n} from \"./preview\";\nexport {\n DocResolver,\n resolveServerUrl,\n substituteUrlVariables,\n preferredContent,\n} from \"./openapi-utils\";\n\nexport {\n OpenApiParseError,\n OpenApiExtractionError,\n OpenApiInvocationError,\n OpenApiOAuthError,\n OpenApiAuthRequiredError,\n} from \"./errors\";\n\nexport {\n EncodingObject,\n ExtractedOperation,\n ExtractionResult,\n InvocationResult,\n MediaBinding,\n OperationBinding,\n OperationParameter,\n OperationRequestBody,\n ServerInfo,\n ServerVariable,\n OperationId,\n HttpMethod,\n ParameterLocation,\n TOKEN_VARIABLE,\n normalizeOpenApiAuthInputs,\n type Authentication,\n type AuthenticationInput,\n type APIKeyAuthentication,\n} from \"./types\";\n// Request-shaped authoring: `headers: { Authorization: [\"Bearer \", variable(\"token\")] }`.\nexport { variable, type ApiKeyAuthTemplate } from \"@executor-js/sdk/http-auth\";\n\nexport { migrateOpenApiAuthConfig } from \"./migrate-config\";\n\nexport {\n openApiOutputSchemaDataMigration,\n runSqliteOpenApiOutputSchemaMigration,\n unwrapOpenApiTransportEnvelope,\n} from \"./output-schema-migration\";\n\nexport { openApiSpecBlobDataMigration } from \"./spec-blob-migration\";\n","// ---------------------------------------------------------------------------\n// One-off config migration — rewrite pre-canonical OpenAPI integration\n// `config` blobs into the canonical placements model. Runs once per database\n// (boot for local/selfhost, out-of-band script for cloud); runtime code\n// decodes ONLY the canonical shape (`decodeOpenApiIntegrationConfig`).\n//\n// The retired shape is the `variable()`-templated apiKey:\n// { slug, type: \"apiKey\", headers/queryParams: Record<name,\n// string | (string | {type:\"variable\", name})[]> }\n// Each entry becomes one placement: prefix = literals before the first\n// variable, the variable name preserved VERBATIM (it keys the connections'\n// stored `item_ids`; the canonical `token` is stored as absent), a\n// literal-only value becomes a `literal` placement. OAuth templates\n// re-key from the retired `type: \"oauth\"` spelling to `kind: \"oauth2\"`.\n// ---------------------------------------------------------------------------\n\nimport { Option } from \"effect\";\nimport {\n apiKeyMethodFromLegacyTemplate,\n decodeLegacyApiKeyTemplate,\n} from \"@executor-js/sdk/http-auth\";\n\nimport { decodeOpenApiIntegrationConfig } from \"./config\";\n\nconst isCanonicalEntry = (entry: unknown): boolean =>\n typeof entry === \"object\" &&\n entry !== null &&\n \"kind\" in entry &&\n ((entry as { kind: unknown }).kind === \"apikey\" ||\n (entry as { kind: unknown }).kind === \"oauth2\");\n\n/** The retired oauth spelling: `type: \"oauth\"` instead of `kind: \"oauth2\"`. */\nconst isLegacyOAuthEntry = (\n entry: unknown,\n): entry is { readonly type: \"oauth\" } & Record<string, unknown> =>\n typeof entry === \"object\" &&\n entry !== null &&\n \"type\" in entry &&\n (entry as { type: unknown }).type === \"oauth\";\n\nconst migrateEntry = (entry: unknown): unknown | null => {\n if (isCanonicalEntry(entry)) return entry;\n if (isLegacyOAuthEntry(entry)) {\n const { type: _type, ...rest } = entry;\n return { ...rest, kind: \"oauth2\" };\n }\n const legacy = Option.getOrNull(decodeLegacyApiKeyTemplate(entry));\n if (legacy !== null) return apiKeyMethodFromLegacyTemplate(legacy);\n return null;\n};\n\n/** Rewrite a stored OpenAPI integration config blob into the canonical shape.\n * Returns the rewritten config, or `null` when no rewrite is needed (already\n * canonical, no auth templates, or not this plugin's shape). Idempotent. */\nexport const migrateOpenApiAuthConfig = (config: unknown): unknown | null => {\n if (typeof config !== \"object\" || config === null) return null;\n if (!(\"spec\" in config) && !(\"specHash\" in config)) return null;\n if (!(\"authenticationTemplate\" in config)) return null;\n\n const entries = (config as { authenticationTemplate: unknown }).authenticationTemplate;\n if (!Array.isArray(entries)) return null;\n\n const migrated = entries.map(migrateEntry);\n if (migrated.some((entry) => entry === null)) return null;\n const changed = migrated.some((entry, index) => entry !== entries[index]);\n if (!changed) return null;\n\n const next = { ...config, authenticationTemplate: migrated };\n return decodeOpenApiIntegrationConfig(next) !== null ? next : null;\n};\n","// ---------------------------------------------------------------------------\n// Data migration: unwrap the retired {status, headers, data} transport\n// envelope from persisted OpenAPI tool output schemas. The runtime returns\n// the upstream payload as `data` (status/headers live in the ToolResult\n// `http` side channel), so persisted schemas must describe the payload\n// only — otherwise describe previews show an envelope invocations no\n// longer return. Mirrors the cloud drizzle migration\n// (apps/cloud/drizzle/0002_unwrap_openapi_output_envelope.sql) for the\n// libSQL-backed apps, where it runs once through the data-migration ledger.\n//\n// Idempotent: payload-shaped rows don't match the envelope signature, so\n// re-running plans zero updates.\n// ---------------------------------------------------------------------------\n\nimport { Effect, Option, Schema } from \"effect\";\nimport { DataMigrationError, type SqliteDataMigrationClient } from \"@executor-js/sdk/core\";\n\nconst MIGRATION_NAME = \"2026-06-11-openapi-output-envelope-unwrap\";\n\nconst isRecord = (value: unknown): value is Record<string, unknown> =>\n typeof value === \"object\" && value !== null && !Array.isArray(value);\n\n// `{\"type\": \"integer\"}` — the envelope's `status` property schema, exactly.\nconst isEnvelopeStatusSchema = (value: unknown): boolean =>\n isRecord(value) && Object.keys(value).length === 1 && value.type === \"integer\";\n\n// `{\"type\": \"object\", \"additionalProperties\": {\"type\": \"string\"}}` — the\n// envelope's `headers` property schema, exactly.\nconst isEnvelopeHeadersSchema = (value: unknown): boolean =>\n isRecord(value) &&\n Object.keys(value).length === 2 &&\n value.type === \"object\" &&\n isRecord(value.additionalProperties) &&\n Object.keys(value.additionalProperties).length === 1 &&\n value.additionalProperties.type === \"string\";\n\n/**\n * If `schema` is the retired transport envelope, return the payload schema\n * to persist instead (`null` when the envelope carried an empty `{}` data\n * schema — the new producer persists no output schema for those). Returns\n * undefined when the schema is not an envelope and the row must be left\n * untouched.\n */\nexport const unwrapOpenApiTransportEnvelope = (\n schema: unknown,\n): { readonly outputSchema: unknown | null } | undefined => {\n if (!isRecord(schema)) return undefined;\n if (schema.type !== \"object\" || schema.additionalProperties !== false) return undefined;\n const required = schema.required;\n if (!Array.isArray(required) || required.length !== 3) return undefined;\n if (![\"status\", \"headers\", \"data\"].every((key) => required.includes(key))) return undefined;\n const properties = schema.properties;\n if (!isRecord(properties) || !(\"data\" in properties)) return undefined;\n if (!isEnvelopeStatusSchema(properties.status)) return undefined;\n if (!isEnvelopeHeadersSchema(properties.headers)) return undefined;\n const data = properties.data;\n const outputSchema = isRecord(data) && Object.keys(data).length === 0 ? null : data;\n return { outputSchema };\n};\n\nconst decodeJsonOption = Schema.decodeUnknownOption(Schema.UnknownFromJsonString);\n\nconst execute = (\n client: SqliteDataMigrationClient,\n stmt: string | { readonly sql: string; readonly args: readonly unknown[] },\n) =>\n Effect.tryPromise({\n try: () => client.execute(stmt),\n catch: (cause) => new DataMigrationError({ migration: MIGRATION_NAME, cause }),\n });\n\n/** Unwrap envelope-shaped openapi tool output schemas in a SQLite database.\n * Returns the number of rows rewritten. The `tool` table may not exist yet\n * on a fresh database — that counts as nothing to migrate. */\nexport const runSqliteOpenApiOutputSchemaMigration = (\n client: SqliteDataMigrationClient,\n): Effect.Effect<number, DataMigrationError> =>\n Effect.gen(function* () {\n const exists = yield* execute(\n client,\n \"SELECT name FROM sqlite_master WHERE type = 'table' AND name = 'tool'\",\n );\n if (exists.rows.length === 0) return 0;\n\n const result = yield* execute(\n client,\n \"SELECT row_id, output_schema FROM tool WHERE plugin_id = 'openapi' AND output_schema IS NOT NULL\",\n );\n const updates: { readonly rowId: string; readonly outputSchema: unknown | null }[] = [];\n for (const row of result.rows) {\n if (typeof row.row_id !== \"string\" || typeof row.output_schema !== \"string\") continue;\n const schema = decodeJsonOption(row.output_schema);\n if (Option.isNone(schema)) continue;\n const unwrapped = unwrapOpenApiTransportEnvelope(schema.value);\n if (unwrapped !== undefined) updates.push({ rowId: row.row_id, ...unwrapped });\n }\n if (updates.length === 0) return 0;\n\n const applyAll = Effect.gen(function* () {\n for (const update of updates) {\n yield* execute(client, {\n sql: \"UPDATE tool SET output_schema = ? WHERE row_id = ?\",\n args: [\n update.outputSchema === null ? null : JSON.stringify(update.outputSchema),\n update.rowId,\n ],\n });\n }\n yield* execute(client, \"COMMIT\");\n });\n\n yield* execute(client, \"BEGIN\");\n yield* applyAll.pipe(Effect.tapError(() => execute(client, \"ROLLBACK\").pipe(Effect.ignore)));\n return updates.length;\n });\n\n/** Registry entry for the boot-time data-migration ledger. */\nexport const openApiOutputSchemaDataMigration = {\n name: MIGRATION_NAME,\n run: (client: SqliteDataMigrationClient) =>\n runSqliteOpenApiOutputSchemaMigration(client).pipe(Effect.asVoid),\n};\n","// ---------------------------------------------------------------------------\n// Data migration: move inline OpenAPI spec text out of `integration.config`\n// into the blob table (`spec/<sha256>`, config keeps `specHash`) — the\n// libSQL-ledger counterpart of cloud's out-of-band migrate-specs-to-blobs\n// script. Runs once per database through the data-migration ledger; the\n// shared body lives in @executor-js/sdk (`runSqliteConfigBlobMigration`).\n// ---------------------------------------------------------------------------\n\nimport { Effect } from \"effect\";\nimport {\n runSqliteConfigBlobMigration,\n type SqliteDataMigrationClient,\n} from \"@executor-js/sdk/core\";\n\nconst MIGRATION_NAME = \"2026-06-12-openapi-spec-to-blob\";\n\n/** Registry entry for the boot-time data-migration ledger. */\nexport const openApiSpecBlobDataMigration = {\n name: MIGRATION_NAME,\n run: (client: SqliteDataMigrationClient) =>\n runSqliteConfigBlobMigration(client, {\n migrationName: MIGRATION_NAME,\n pluginId: \"openapi\",\n inlineField: \"spec\",\n hashField: \"specHash\",\n blobKeyPrefix: \"spec\",\n }).pipe(Effect.asVoid),\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;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AM;AACpE;;;ACjHA,SAAS,UAAAC,eAAc;AACvB;AAAA,EACE;AAAA,OAEK;AAEP,IAAMC,kBAAiB;AAGhB,IAAM,+BAA+B;AAAA,EAC1C,MAAMA;AAAA,EACN,KAAK,CAAC,WACJ,6BAA6B,QAAQ;AAAA,IACnC,eAAeA;AAAA,IACf,UAAU;AAAA,IACV,aAAa;AAAA,IACb,WAAW;AAAA,IACX,eAAe;AAAA,EACjB,CAAC,EAAE,KAAKD,QAAO,MAAM;AACzB;","names":["Option","Effect","MIGRATION_NAME"]}
package/dist/index.js CHANGED
@@ -1,12 +1,11 @@
1
1
  import {
2
2
  openApiPlugin
3
- } from "./chunk-PNOEE3ET.js";
4
- import "./chunk-I2XDCVVM.js";
5
- import "./chunk-PAHWRRS3.js";
6
- import "./chunk-MZWZQ24W.js";
3
+ } from "./chunk-3FM2SWM4.js";
4
+ import "./chunk-CKBX4SXK.js";
5
+ import "./chunk-QQFCICLX.js";
7
6
  import {
8
7
  TOKEN_VARIABLE
9
- } from "./chunk-RFSMGUBJ.js";
8
+ } from "./chunk-KVPUDOJZ.js";
10
9
 
11
10
  // src/promise.ts
12
11
  import { variable } from "@executor-js/sdk/http-auth";
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/promise.ts"],"sourcesContent":["export { openApiPlugin } from \"./sdk/plugin\";\nexport type {\n OpenApiPluginOptions,\n OpenApiPluginExtension,\n OpenApiSpecConfig,\n OpenApiSpecInput,\n OpenApiPreviewInput,\n} from \"./sdk/plugin\";\n\n// Auth-template authoring helpers. Author apikey methods as canonical\n// placements, or request-shaped: `headers: { Authorization: [\"Bearer \",\n// variable(\"token\")] }` — both normalize to the same stored model.\nexport { TOKEN_VARIABLE } from \"./sdk/types\";\nexport type { Authentication, AuthenticationInput, APIKeyAuthentication } from \"./sdk/types\";\nexport { variable, type ApiKeyAuthTemplate } from \"@executor-js/sdk/http-auth\";\n"],"mappings":";;;;;;;;;;;AAcA,SAAS,gBAAyC;","names":[]}
1
+ {"version":3,"sources":["../src/promise.ts"],"sourcesContent":["export { openApiPlugin } from \"./sdk/plugin\";\nexport type {\n OpenApiPluginOptions,\n OpenApiPluginExtension,\n OpenApiSpecConfig,\n OpenApiSpecInput,\n OpenApiPreviewInput,\n} from \"./sdk/plugin\";\n\n// Auth-template authoring helpers. Author apikey methods as canonical\n// placements, or request-shaped: `headers: { Authorization: [\"Bearer \",\n// variable(\"token\")] }` — both normalize to the same stored model.\nexport { TOKEN_VARIABLE } from \"./sdk/types\";\nexport type { Authentication, AuthenticationInput, APIKeyAuthentication } from \"./sdk/types\";\nexport { variable, type ApiKeyAuthTemplate } from \"@executor-js/sdk/http-auth\";\n"],"mappings":";;;;;;;;;;AAcA,SAAS,gBAAyC;","names":[]}
@@ -15,7 +15,6 @@ export declare const openApiConfigAtom: (slug: IntegrationSlug) => Atom.Atom<imp
15
15
  readonly [x: string]: string;
16
16
  } | undefined;
17
17
  readonly sourceUrl?: string | undefined;
18
- readonly googleDiscoveryUrls?: readonly string[] | undefined;
19
18
  readonly baseUrl?: string | undefined;
20
19
  readonly authenticationTemplate?: readonly ({
21
20
  readonly slug: string;
@@ -44,14 +43,6 @@ export declare const previewOpenApiSpec: Atom.AtomResultFn<{
44
43
  readonly reactivityKeys?: readonly unknown[] | import("effect/Record").ReadonlyRecord<string, readonly unknown[]> | undefined;
45
44
  }, {
46
45
  readonly version: import("effect/Option").Option<string>;
47
- readonly operations: readonly {
48
- readonly method: "post" | "options" | "delete" | "get" | "put" | "patch" | "head" | "trace";
49
- readonly deprecated: boolean;
50
- readonly path: string;
51
- readonly summary: import("effect/Option").Option<string>;
52
- readonly tags: readonly string[];
53
- readonly operationId: string;
54
- }[];
55
46
  readonly description: import("effect/Option").Option<string>;
56
47
  readonly title: import("effect/Option").Option<string>;
57
48
  readonly servers: readonly {
@@ -126,12 +117,6 @@ export declare const addOpenApiSpec: Atom.AtomResultFn<{
126
117
  } | {
127
118
  readonly value: string;
128
119
  readonly kind: "blob";
129
- } | {
130
- readonly kind: "googleDiscovery";
131
- readonly url: string;
132
- } | {
133
- readonly kind: "googleDiscoveryBundle";
134
- readonly urls: readonly string[];
135
120
  };
136
121
  readonly name?: string | undefined;
137
122
  readonly description?: string | undefined;
@@ -193,12 +178,6 @@ export declare const updateOpenApiSpec: Atom.AtomResultFn<{
193
178
  } | {
194
179
  readonly value: string;
195
180
  readonly kind: "blob";
196
- } | {
197
- readonly kind: "googleDiscovery";
198
- readonly url: string;
199
- } | {
200
- readonly kind: "googleDiscoveryBundle";
201
- readonly urls: readonly string[];
202
181
  } | undefined;
203
182
  };
204
183
  readonly responseMode?: "decoded-only" | undefined;
@@ -276,7 +255,6 @@ export declare const openApiConfigFamily: (arg: string & import("effect/Brand").
276
255
  readonly [x: string]: string;
277
256
  } | undefined;
278
257
  readonly sourceUrl?: string | undefined;
279
- readonly googleDiscoveryUrls?: readonly string[] | undefined;
280
258
  readonly baseUrl?: string | undefined;
281
259
  readonly authenticationTemplate?: readonly ({
282
260
  readonly slug: string;
@@ -14,14 +14,6 @@ export declare const OpenApiClient: import("effect/unstable/reactivity/AtomHttpA
14
14
  }>>>;
15
15
  }>>;
16
16
  readonly operationCount: import("effect/Schema").Number;
17
- readonly operations: import("effect/Schema").$Array<import("effect/Schema").Struct<{
18
- readonly operationId: import("effect/Schema").String;
19
- readonly method: import("effect/Schema").Literals<readonly ["get", "put", "post", "delete", "patch", "head", "options", "trace"]>;
20
- readonly path: import("effect/Schema").String;
21
- readonly summary: import("effect/Schema").OptionFromOptional<import("effect/Schema").String>;
22
- readonly tags: import("effect/Schema").$Array<import("effect/Schema").String>;
23
- readonly deprecated: import("effect/Schema").Boolean;
24
- }>>;
25
17
  readonly tags: import("effect/Schema").$Array<import("effect/Schema").String>;
26
18
  readonly securitySchemes: import("effect/Schema").$Array<import("effect/Schema").Struct<{
27
19
  readonly name: import("effect/Schema").String;
@@ -71,12 +63,6 @@ export declare const OpenApiClient: import("effect/unstable/reactivity/AtomHttpA
71
63
  }>, import("effect/Schema").Struct<{
72
64
  readonly kind: import("effect/Schema").Literal<"blob">;
73
65
  readonly value: import("effect/Schema").String;
74
- }>, import("effect/Schema").Struct<{
75
- readonly kind: import("effect/Schema").Literal<"googleDiscovery">;
76
- readonly url: import("effect/Schema").String;
77
- }>, import("effect/Schema").Struct<{
78
- readonly kind: import("effect/Schema").Literal<"googleDiscoveryBundle">;
79
- readonly urls: import("effect/Schema").$Array<import("effect/Schema").String>;
80
66
  }>]>;
81
67
  readonly slug: import("effect/Schema").String;
82
68
  readonly name: import("effect/Schema").optional<import("effect/Schema").String>;
@@ -118,7 +104,6 @@ export declare const OpenApiClient: import("effect/unstable/reactivity/AtomHttpA
118
104
  slug: import("effect/Schema").String;
119
105
  }>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").NullOr<import("effect/Schema").Struct<{
120
106
  readonly sourceUrl: import("effect/Schema").optional<import("effect/Schema").String>;
121
- readonly googleDiscoveryUrls: import("effect/Schema").optional<import("effect/Schema").$Array<import("effect/Schema").String>>;
122
107
  readonly baseUrl: import("effect/Schema").optional<import("effect/Schema").String>;
123
108
  readonly headers: import("effect/Schema").optional<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").String>>;
124
109
  readonly queryParams: import("effect/Schema").optional<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").String>>;
@@ -191,12 +176,6 @@ export declare const OpenApiClient: import("effect/unstable/reactivity/AtomHttpA
191
176
  }>, import("effect/Schema").Struct<{
192
177
  readonly kind: import("effect/Schema").Literal<"blob">;
193
178
  readonly value: import("effect/Schema").String;
194
- }>, import("effect/Schema").Struct<{
195
- readonly kind: import("effect/Schema").Literal<"googleDiscovery">;
196
- readonly url: import("effect/Schema").String;
197
- }>, import("effect/Schema").Struct<{
198
- readonly kind: import("effect/Schema").Literal<"googleDiscoveryBundle">;
199
- readonly urls: import("effect/Schema").$Array<import("effect/Schema").String>;
200
179
  }>]>>;
201
180
  }>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
202
181
  readonly slug: import("effect/Schema").brand<import("effect/Schema").String, "IntegrationSlug">;
@@ -1,3 +1,5 @@
1
1
  export { openApiIntegrationPlugin } from "./source-plugin";
2
2
  export { OpenApiClient } from "./client";
3
+ export { OpenApiSourceDetailsFields } from "./OpenApiSourceDetailsFields";
4
+ export { authenticationFromEditorValue, authMethodsFromConfig, editorValueFromAuthentication, openApiWireAuthInput, placementsFromApiKey, templateFromPlacements, } from "./auth-method-config";
3
5
  export { previewOpenApiSpec, addOpenApiSpec, removeOpenApiSpec, openapiConfigure, openApiConfigAtom, openApiConfigFamily, openApiIntegrationAtom, openApiIntegrationFamily, } from "./atoms";
@@ -0,0 +1,54 @@
1
+ import { Effect } from "effect";
2
+ import type { Layer } from "effect";
3
+ import { HttpClient } from "effect/unstable/http";
4
+ import { type PluginCtx, type ResolveToolsResult, type StorageFailure, type ToolDef, type ToolInvocationCredential } from "@executor-js/sdk/core";
5
+ import { type OpenApiIntegrationConfig } from "./config";
6
+ import { OpenApiExtractionError, OpenApiParseError } from "./errors";
7
+ import { type ToolDefinition } from "./definitions";
8
+ import { type ParsedDocument } from "./parse";
9
+ import { type OpenapiStore, type StoredOperation } from "./store";
10
+ export declare const extractOpenApiUpstreamMessage: (body: unknown, status: number) => string;
11
+ /** Rewrite OpenAPI `#/components/schemas/X` refs to standard `#/$defs/X`. */
12
+ export declare const normalizeOpenApiRefs: (node: unknown) => unknown;
13
+ export interface CompiledOpenApiSpec {
14
+ readonly definitions: readonly ToolDefinition[];
15
+ readonly hoistedDefs: Record<string, unknown>;
16
+ readonly title: string | undefined;
17
+ readonly description: string | undefined;
18
+ }
19
+ export declare const compileOpenApiDocument: (doc: ParsedDocument) => Effect.Effect<CompiledOpenApiSpec, OpenApiExtractionError>;
20
+ export declare const compileOpenApiSpec: (specText: string) => Effect.Effect<CompiledOpenApiSpec, OpenApiParseError | OpenApiExtractionError>;
21
+ export declare const openApiToolDefsFromCompiled: (compiled: CompiledOpenApiSpec) => readonly ToolDef[];
22
+ export declare const openApiStoredOperationsFromCompiled: (integration: string, compiled: CompiledOpenApiSpec) => readonly StoredOperation[];
23
+ export declare const loadOpenApiSpecText: (storage: OpenapiStore, config: OpenApiIntegrationConfig) => Effect.Effect<string | null, StorageFailure>;
24
+ export declare const resolveOpenApiBackedTools: ({ config, storage, }: {
25
+ readonly config: unknown;
26
+ readonly storage: OpenapiStore;
27
+ }) => Effect.Effect<ResolveToolsResult, StorageFailure>;
28
+ export declare const invokeOpenApiBackedTool: (input: {
29
+ readonly ctx: PluginCtx<OpenapiStore>;
30
+ readonly toolRow: {
31
+ readonly integration: string;
32
+ readonly name: string;
33
+ };
34
+ readonly credential: ToolInvocationCredential;
35
+ readonly args: unknown;
36
+ readonly httpClientLayer: Layer.Layer<HttpClient.HttpClient, never, never>;
37
+ }) => Effect.Effect<{
38
+ readonly ok: false;
39
+ readonly error: import("@executor-js/sdk/core").ToolError;
40
+ } | {
41
+ readonly ok: true;
42
+ readonly data: unknown;
43
+ readonly http?: import("@executor-js/sdk/core").ToolHttpMeta;
44
+ }, StorageFailure | OpenApiExtractionError | import("./errors").OpenApiInvocationError, never>;
45
+ export declare const resolveOpenApiBackedAnnotations: (input: {
46
+ readonly ctx: PluginCtx<OpenapiStore>;
47
+ readonly integration: string;
48
+ readonly toolRows: readonly {
49
+ readonly name: string;
50
+ }[];
51
+ }) => Effect.Effect<Record<string, {
52
+ requiresApproval?: boolean;
53
+ approvalDescription?: string;
54
+ }>, StorageFailure, never>;
@@ -24,8 +24,6 @@ export declare const OpenApiIntegrationConfigSchema: Schema.Struct<{
24
24
  readonly specHash: Schema.optional<Schema.String>;
25
25
  /** Origin URL the spec was fetched from, when known. Enables refresh. */
26
26
  readonly sourceUrl: Schema.optional<Schema.String>;
27
- /** Google Discovery bundle URLs, when the spec came from a Google bundle. */
28
- readonly googleDiscoveryUrls: Schema.optional<Schema.$Array<Schema.String>>;
29
27
  /** Optional base URL override. */
30
28
  readonly baseUrl: Schema.optional<Schema.String>;
31
29
  /** Static headers applied to every request (no secret material). */
@@ -1,9 +1,11 @@
1
- import type { HeaderPreset, OAuth2Preset, SpecPreview } from "./preview";
1
+ import type { HeaderPreset, OAuth2Preset, SpecPreview, SpecPreviewSummary } from "./preview";
2
2
  import type { Authentication } from "./types";
3
+ type PreviewAuthMetadata = SpecPreview | SpecPreviewSummary;
3
4
  export declare function resolveOAuthUrl(url: string, baseUrl: string): string;
4
5
  export declare const resolvedOAuthScopes: (apiScopes: Iterable<string>, identityScopes: OAuth2Preset["identityScopes"]) => string[];
5
6
  export declare const detectedAuthenticationTemplates: (headerPresets: readonly HeaderPreset[], oauth2Presets: readonly OAuth2Preset[], baseUrl: string) => readonly Authentication[];
6
- export declare const firstBaseUrlForPreview: (preview: SpecPreview) => string;
7
+ export declare const firstBaseUrlForPreview: (preview: PreviewAuthMetadata) => string;
7
8
  /** The fallback `addSpec` uses when no explicit template was passed: every
8
9
  * spec-detected method, resolved against the integration's base URL. */
9
- export declare const deriveAuthenticationTemplateFromPreview: (preview: SpecPreview, baseUrl: string | undefined) => readonly Authentication[];
10
+ export declare const deriveAuthenticationTemplateFromPreview: (preview: PreviewAuthMetadata, baseUrl: string | undefined) => readonly Authentication[];
11
+ export {};
@@ -40,7 +40,6 @@ export declare const extract: (doc: ParsedDocument) => Effect.Effect<{
40
40
  readonly contentType: string;
41
41
  readonly contents: Option.Option<readonly {
42
42
  readonly schema: Option.Option<unknown>;
43
- readonly contentType: string;
44
43
  readonly encoding: Option.Option<{
45
44
  readonly [x: string]: {
46
45
  readonly style: Option.Option<string>;
@@ -49,8 +48,20 @@ export declare const extract: (doc: ParsedDocument) => Effect.Effect<{
49
48
  readonly allowReserved: Option.Option<boolean>;
50
49
  };
51
50
  }>;
51
+ readonly contentType: string;
52
52
  }[]>;
53
53
  }>;
54
+ readonly responseBody: Option.Option<{
55
+ readonly schema: Option.Option<unknown>;
56
+ readonly contentType: string;
57
+ readonly fileHint: Option.Option<{
58
+ readonly kind: "binaryResponse" | "byteField";
59
+ readonly encoding: Option.Option<"base64" | "base64url">;
60
+ readonly mimeType: Option.Option<string>;
61
+ readonly dataField: Option.Option<string>;
62
+ readonly sizeField: Option.Option<string>;
63
+ }>;
64
+ }>;
54
65
  readonly operationId: string & import("effect/Brand").Brand<"OperationId">;
55
66
  readonly pathTemplate: string;
56
67
  }[];
@@ -1,7 +1,8 @@
1
1
  export { parse, resolveSpecText, fetchSpecText } from "./parse";
2
- export { convertGoogleDiscoveryBundleToOpenApi, convertGoogleDiscoveryToOpenApi, fetchGoogleDiscoveryDocument, isGoogleDiscoveryUrl, type GoogleDiscoveryOpenApiConversion, } from "./google-discovery";
3
2
  export { extract } from "./extract";
4
3
  export { invoke, invokeWithLayer, annotationsForOperation } from "./invoke";
4
+ export { compileOpenApiDocument, compileOpenApiSpec, extractOpenApiUpstreamMessage, invokeOpenApiBackedTool, loadOpenApiSpecText, normalizeOpenApiRefs, openApiStoredOperationsFromCompiled, openApiToolDefsFromCompiled, resolveOpenApiBackedAnnotations, resolveOpenApiBackedTools, type CompiledOpenApiSpec, } from "./backing";
5
+ export type { ParsedDocument } from "./parse";
5
6
  export { openApiPlugin, type OpenApiSpecConfig, type OpenApiConfigureInput, type OpenApiSpecInput, type OpenApiPreviewInput, type OpenApiPluginExtension, type OpenApiPluginOptions, } from "./plugin";
6
7
  export { type OpenapiStore, type StoredOperation, makeDefaultOpenapiStore } from "./store";
7
8
  export { decodeOpenApiIntegrationConfig, renderAuthTemplate, AuthenticationSchema, OpenApiIntegrationConfigSchema, type OpenApiIntegrationConfig, type RenderedAuth, } from "./config";
@@ -20,7 +20,6 @@ export declare const invoke: (operation: {
20
20
  readonly contentType: string;
21
21
  readonly contents: Option.Option<readonly {
22
22
  readonly schema: Option.Option<unknown>;
23
- readonly contentType: string;
24
23
  readonly encoding: Option.Option<{
25
24
  readonly [x: string]: {
26
25
  readonly style: Option.Option<string>;
@@ -29,8 +28,20 @@ export declare const invoke: (operation: {
29
28
  readonly allowReserved: Option.Option<boolean>;
30
29
  };
31
30
  }>;
31
+ readonly contentType: string;
32
32
  }[]>;
33
33
  }>;
34
+ readonly responseBody: Option.Option<{
35
+ readonly schema: Option.Option<unknown>;
36
+ readonly contentType: string;
37
+ readonly fileHint: Option.Option<{
38
+ readonly kind: "binaryResponse" | "byteField";
39
+ readonly encoding: Option.Option<"base64" | "base64url">;
40
+ readonly mimeType: Option.Option<string>;
41
+ readonly dataField: Option.Option<string>;
42
+ readonly sizeField: Option.Option<string>;
43
+ }>;
44
+ }>;
34
45
  readonly pathTemplate: string;
35
46
  readonly servers?: readonly {
36
47
  readonly description: Option.Option<string>;
@@ -29,7 +29,7 @@ export interface OpenApiSpecConfig {
29
29
  readonly headers?: Record<string, string>;
30
30
  /** Static query params applied to every request. */
31
31
  readonly queryParams?: Record<string, string>;
32
- /** Auth methods a connection's value renders through canonical
32
+ /** Auth methods a connection's value renders through - canonical
33
33
  * placements or the request-shaped authoring dialect. */
34
34
  readonly authenticationTemplate?: readonly AuthenticationInput[];
35
35
  }
@@ -47,7 +47,7 @@ export interface OpenApiConfigureInput {
47
47
  readonly mode?: "merge" | "replace";
48
48
  }
49
49
  /** What changed in the tool catalog when a spec was updated in place. Tool
50
- * names, not addresses the same diff applies to every connection. */
50
+ * names, not addresses - the same diff applies to every connection. */
51
51
  export interface UpdateSpecResult {
52
52
  readonly slug: IntegrationSlug;
53
53
  readonly toolCount: number;
@@ -56,7 +56,7 @@ export interface UpdateSpecResult {
56
56
  }
57
57
  export interface OpenApiUpdateSpecInput {
58
58
  /** New spec source. Omit to re-fetch from the integration's stored
59
- * `sourceUrl` / Google Discovery bundle URLs. */
59
+ * `sourceUrl`. */
60
60
  readonly spec?: OpenApiSpecInput;
61
61
  }
62
62
  export interface OpenApiPluginExtension {
@@ -66,7 +66,7 @@ export interface OpenApiPluginExtension {
66
66
  readonly toolCount: number;
67
67
  }, OpenApiParseError | OpenApiExtractionError | OpenApiOAuthError | IntegrationAlreadyExistsError | StorageFailure>;
68
68
  /** Re-resolve the integration's spec (from its stored source URL, or the
69
- * provided input) and rebuild its tools IN PLACE connections,
69
+ * provided input) and rebuild its tools IN PLACE - connections,
70
70
  * credentials, policies, and the curated description are untouched. */
71
71
  readonly updateSpec: (slug: string, input?: OpenApiUpdateSpecInput) => Effect.Effect<UpdateSpecResult, OpenApiParseError | OpenApiExtractionError | OpenApiOAuthError | IntegrationNotFoundError | StorageFailure>;
72
72
  readonly removeSpec: (slug: string) => Effect.Effect<void, StorageFailure>;
@@ -84,12 +84,6 @@ declare const OpenApiSpecInputSchema: Schema.Union<readonly [Schema.Struct<{
84
84
  }>, Schema.Struct<{
85
85
  readonly kind: Schema.Literal<"blob">;
86
86
  readonly value: Schema.String;
87
- }>, Schema.Struct<{
88
- readonly kind: Schema.Literal<"googleDiscovery">;
89
- readonly url: Schema.String;
90
- }>, Schema.Struct<{
91
- readonly kind: Schema.Literal<"googleDiscoveryBundle">;
92
- readonly urls: Schema.$Array<Schema.String>;
93
87
  }>]>;
94
88
  export declare const describeOpenApiAuthMethods: (record: IntegrationRecord) => readonly AuthMethodDescriptor[];
95
89
  export declare const describeOpenApiIntegrationDisplay: (record: IntegrationRecord) => {
@@ -6,5 +6,4 @@ export interface OpenApiPreset {
6
6
  readonly icon?: string;
7
7
  readonly featured?: boolean;
8
8
  }
9
- export { googleOpenApiPresets, googleStandardUserOAuthPresets } from "./google-presets";
10
9
  export declare const openApiPresets: readonly OpenApiPreset[];
@@ -193,6 +193,85 @@ export declare const SpecPreview: Schema.Struct<{
193
193
  }>>;
194
194
  }>;
195
195
  export type SpecPreview = typeof SpecPreview.Type;
196
+ export declare const SpecPreviewSummary: Schema.Struct<{
197
+ readonly title: Schema.OptionFromOptional<Schema.String>;
198
+ readonly description: Schema.OptionFromOptional<Schema.String>;
199
+ readonly version: Schema.OptionFromOptional<Schema.String>;
200
+ readonly servers: Schema.$Array<Schema.Struct<{
201
+ readonly url: Schema.String;
202
+ readonly description: Schema.OptionFromOptional<Schema.String>;
203
+ readonly variables: Schema.OptionFromOptional<Schema.$Record<Schema.String, Schema.Struct<{
204
+ readonly default: Schema.String;
205
+ readonly enum: Schema.OptionFromOptional<Schema.$Array<Schema.String>>;
206
+ readonly description: Schema.OptionFromOptional<Schema.String>;
207
+ }>>>;
208
+ }>>;
209
+ readonly operationCount: Schema.Number;
210
+ readonly tags: Schema.$Array<Schema.String>;
211
+ readonly securitySchemes: Schema.$Array<Schema.Struct<{
212
+ /** Key name in components.securitySchemes (e.g. "api_token") */
213
+ readonly name: Schema.String;
214
+ /** OpenAPI security scheme type */
215
+ readonly type: Schema.Literals<readonly ["http", "apiKey", "oauth2", "openIdConnect"]>;
216
+ /** For type: "http" — e.g. "bearer", "basic" */
217
+ readonly scheme: Schema.OptionFromOptional<Schema.String>;
218
+ /** For type: "http" with scheme "bearer" — e.g. "JWT" */
219
+ readonly bearerFormat: Schema.OptionFromOptional<Schema.String>;
220
+ /** For type: "apiKey" — where the key goes */
221
+ readonly in: Schema.OptionFromOptional<Schema.Literals<readonly ["header", "query", "cookie"]>>;
222
+ /** For type: "apiKey" — the header/query/cookie name */
223
+ readonly headerName: Schema.OptionFromOptional<Schema.String>;
224
+ readonly description: Schema.OptionFromOptional<Schema.String>;
225
+ /** For type: "oauth2" — declared flows (authorizationCode / clientCredentials only; implicit and password are deprecated). */
226
+ readonly flows: Schema.OptionFromOptional<Schema.Struct<{
227
+ readonly authorizationCode: Schema.OptionFromOptional<Schema.Struct<{
228
+ readonly authorizationUrl: Schema.String;
229
+ readonly tokenUrl: Schema.String;
230
+ readonly refreshUrl: Schema.OptionFromOptional<Schema.String>;
231
+ readonly scopes: Schema.$Record<Schema.String, Schema.String>;
232
+ }>>;
233
+ readonly clientCredentials: Schema.OptionFromOptional<Schema.Struct<{
234
+ readonly tokenUrl: Schema.String;
235
+ readonly refreshUrl: Schema.OptionFromOptional<Schema.String>;
236
+ readonly scopes: Schema.$Record<Schema.String, Schema.String>;
237
+ }>>;
238
+ }>>;
239
+ /** For type: "openIdConnect" — the discovery URL. */
240
+ readonly openIdConnectUrl: Schema.OptionFromOptional<Schema.String>;
241
+ }>>;
242
+ readonly authStrategies: Schema.$Array<Schema.Struct<{
243
+ /** The security schemes required together for this strategy */
244
+ readonly schemes: Schema.$Array<Schema.String>;
245
+ }>>;
246
+ readonly headerPresets: Schema.$Array<Schema.Struct<{
247
+ /** Human-readable label for the UI (e.g. "Bearer Token", "API Key + Email") */
248
+ readonly label: Schema.String;
249
+ /** Headers this strategy needs. Value is null when the user must provide it. */
250
+ readonly headers: Schema.$Record<Schema.String, Schema.NullOr<Schema.String>>;
251
+ /** Which headers should be stored as secrets */
252
+ readonly secretHeaders: Schema.$Array<Schema.String>;
253
+ }>>;
254
+ readonly oauth2Presets: Schema.$Array<Schema.Struct<{
255
+ /** Human-readable label for the UI (e.g. "OAuth2 (Authorization Code) — oauth_app") */
256
+ readonly label: Schema.String;
257
+ /** The source security scheme this preset came from (components.securitySchemes key). */
258
+ readonly securitySchemeName: Schema.String;
259
+ /** Which OAuth2 flow this preset uses. */
260
+ readonly flow: Schema.Literals<readonly ["authorizationCode", "clientCredentials"]>;
261
+ /** For authorizationCode: user-agent redirect URL (from the spec). */
262
+ readonly authorizationUrl: Schema.OptionFromOptional<Schema.String>;
263
+ /** Token endpoint to exchange the code / refresh. */
264
+ readonly tokenUrl: Schema.String;
265
+ /** Optional refresh endpoint if the spec declares one separately. */
266
+ readonly refreshUrl: Schema.OptionFromOptional<Schema.String>;
267
+ /** Declared scopes for this flow: `{ scope: description }`. */
268
+ readonly scopes: Schema.$Record<Schema.String, Schema.String>;
269
+ /** Identity scopes to request alongside API scopes. `"auto"` discovers standard OIDC scopes. */
270
+ readonly identityScopes: Schema.Union<readonly [Schema.Literal<"auto">, Schema.Literal<false>, Schema.$Array<Schema.String>]>;
271
+ }>>;
272
+ }>;
273
+ export type SpecPreviewSummary = typeof SpecPreviewSummary.Type;
274
+ export declare const specPreviewSummary: (preview: SpecPreview) => SpecPreviewSummary;
196
275
  /** Preview already-resolved spec text — extract metadata without registering
197
276
  * anything and without any HTTP dependency. */
198
277
  export declare const previewSpecText: (specText: string) => Effect.Effect<{
@@ -85,6 +85,26 @@ export declare const OperationRequestBody: Schema.Struct<{
85
85
  }>>>;
86
86
  }>;
87
87
  export type OperationRequestBody = typeof OperationRequestBody.Type;
88
+ export declare const OperationFileHint: Schema.Struct<{
89
+ readonly kind: Schema.Literals<readonly ["binaryResponse", "byteField"]>;
90
+ readonly mimeType: Schema.OptionFromOptional<Schema.String>;
91
+ readonly dataField: Schema.OptionFromOptional<Schema.String>;
92
+ readonly sizeField: Schema.OptionFromOptional<Schema.String>;
93
+ readonly encoding: Schema.OptionFromOptional<Schema.Literals<readonly ["base64", "base64url"]>>;
94
+ }>;
95
+ export type OperationFileHint = typeof OperationFileHint.Type;
96
+ export declare const OperationResponseBody: Schema.Struct<{
97
+ readonly contentType: Schema.String;
98
+ readonly schema: Schema.OptionFromOptional<Schema.Unknown>;
99
+ readonly fileHint: Schema.OptionFromOptional<Schema.Struct<{
100
+ readonly kind: Schema.Literals<readonly ["binaryResponse", "byteField"]>;
101
+ readonly mimeType: Schema.OptionFromOptional<Schema.String>;
102
+ readonly dataField: Schema.OptionFromOptional<Schema.String>;
103
+ readonly sizeField: Schema.OptionFromOptional<Schema.String>;
104
+ readonly encoding: Schema.OptionFromOptional<Schema.Literals<readonly ["base64", "base64url"]>>;
105
+ }>>;
106
+ }>;
107
+ export type OperationResponseBody = typeof OperationResponseBody.Type;
88
108
  export declare const ServerVariable: Schema.Struct<{
89
109
  readonly default: Schema.String;
90
110
  readonly enum: Schema.OptionFromOptional<Schema.$Array<Schema.String>>;
@@ -150,6 +170,17 @@ export declare const ExtractedOperation: Schema.Struct<{
150
170
  }>>>;
151
171
  }>>>;
152
172
  }>>;
173
+ readonly responseBody: Schema.OptionFromOptional<Schema.Struct<{
174
+ readonly contentType: Schema.String;
175
+ readonly schema: Schema.OptionFromOptional<Schema.Unknown>;
176
+ readonly fileHint: Schema.OptionFromOptional<Schema.Struct<{
177
+ readonly kind: Schema.Literals<readonly ["binaryResponse", "byteField"]>;
178
+ readonly mimeType: Schema.OptionFromOptional<Schema.String>;
179
+ readonly dataField: Schema.OptionFromOptional<Schema.String>;
180
+ readonly sizeField: Schema.OptionFromOptional<Schema.String>;
181
+ readonly encoding: Schema.OptionFromOptional<Schema.Literals<readonly ["base64", "base64url"]>>;
182
+ }>>;
183
+ }>>;
153
184
  readonly inputSchema: Schema.OptionFromOptional<Schema.Unknown>;
154
185
  readonly outputSchema: Schema.OptionFromOptional<Schema.Unknown>;
155
186
  readonly deprecated: Schema.Boolean;
@@ -218,6 +249,17 @@ export declare const ExtractionResult: Schema.Struct<{
218
249
  }>>>;
219
250
  }>>>;
220
251
  }>>;
252
+ readonly responseBody: Schema.OptionFromOptional<Schema.Struct<{
253
+ readonly contentType: Schema.String;
254
+ readonly schema: Schema.OptionFromOptional<Schema.Unknown>;
255
+ readonly fileHint: Schema.OptionFromOptional<Schema.Struct<{
256
+ readonly kind: Schema.Literals<readonly ["binaryResponse", "byteField"]>;
257
+ readonly mimeType: Schema.OptionFromOptional<Schema.String>;
258
+ readonly dataField: Schema.OptionFromOptional<Schema.String>;
259
+ readonly sizeField: Schema.OptionFromOptional<Schema.String>;
260
+ readonly encoding: Schema.OptionFromOptional<Schema.Literals<readonly ["base64", "base64url"]>>;
261
+ }>>;
262
+ }>>;
221
263
  readonly inputSchema: Schema.OptionFromOptional<Schema.Unknown>;
222
264
  readonly outputSchema: Schema.OptionFromOptional<Schema.Unknown>;
223
265
  readonly deprecated: Schema.Boolean;
@@ -268,6 +310,17 @@ export declare const OperationBinding: Schema.Struct<{
268
310
  }>>>;
269
311
  }>>>;
270
312
  }>>;
313
+ readonly responseBody: Schema.OptionFromOptional<Schema.Struct<{
314
+ readonly contentType: Schema.String;
315
+ readonly schema: Schema.OptionFromOptional<Schema.Unknown>;
316
+ readonly fileHint: Schema.OptionFromOptional<Schema.Struct<{
317
+ readonly kind: Schema.Literals<readonly ["binaryResponse", "byteField"]>;
318
+ readonly mimeType: Schema.OptionFromOptional<Schema.String>;
319
+ readonly dataField: Schema.OptionFromOptional<Schema.String>;
320
+ readonly sizeField: Schema.OptionFromOptional<Schema.String>;
321
+ readonly encoding: Schema.OptionFromOptional<Schema.Literals<readonly ["base64", "base64url"]>>;
322
+ }>>;
323
+ }>>;
271
324
  }>;
272
325
  export type OperationBinding = typeof OperationBinding.Type;
273
326
  export declare const InvocationResult: Schema.Struct<{
@@ -129,12 +129,6 @@ export declare const makeOpenApiHttpApiTestAddSpecPayload: (api: HttpApi.Any, op
129
129
  } | {
130
130
  readonly value: string;
131
131
  readonly kind: "blob";
132
- } | {
133
- readonly kind: "googleDiscovery";
134
- readonly url: string;
135
- } | {
136
- readonly kind: "googleDiscoveryBundle";
137
- readonly urls: readonly string[];
138
132
  };
139
133
  slug: string;
140
134
  baseUrl: string | undefined;