@keemakr/operator-sdk 0.3.0 → 0.4.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/package.json +1 -1
- package/src/conformance/index.ts +9 -0
- package/src/index.ts +11 -0
- package/src/manifest.ts +8 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@keemakr/operator-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "The keemakr connector contract: defineProvider + ConnectionProvider/ConnectionOperation types + OperationContext (governed fetch) + the connector manifest schema, shared by keemakr-core's built-in adapters and external connector repos. One shape, two consumers.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
package/src/conformance/index.ts
CHANGED
|
@@ -68,6 +68,15 @@ export async function runConformance(
|
|
|
68
68
|
!manifest.auth_kind || provider.authKind === manifest.auth_kind,
|
|
69
69
|
`code '${provider.authKind}' vs manifest '${manifest.auth_kind ?? '—'}'`,
|
|
70
70
|
);
|
|
71
|
+
// The credential alias is a reviewed dependency: when either side declares
|
|
72
|
+
// it, both must, and they must agree (a code-only alias would ride a
|
|
73
|
+
// connection reviewers never saw).
|
|
74
|
+
add(
|
|
75
|
+
'credential-alias',
|
|
76
|
+
'credential alias matches the manifest (when either declares it)',
|
|
77
|
+
(provider.credentialProvider ?? null) === (manifest.credential_provider ?? null),
|
|
78
|
+
`code '${provider.credentialProvider ?? '—'}' vs manifest '${manifest.credential_provider ?? '—'}'`,
|
|
79
|
+
);
|
|
71
80
|
|
|
72
81
|
// 6 — code may not claim MORE network than the reviewed manifest.
|
|
73
82
|
const undeclared = (provider.allowedDomains ?? []).filter(
|
package/src/index.ts
CHANGED
|
@@ -130,6 +130,17 @@ export interface ConnectionProvider {
|
|
|
130
130
|
// omit it (first-party).
|
|
131
131
|
publisher?: string;
|
|
132
132
|
|
|
133
|
+
// Credential alias — the agent-tool chain's "one key opens many doors" seam.
|
|
134
|
+
// A connector that fronts one facet of a wider platform (an Apify actor, a
|
|
135
|
+
// Composio toolkit) declares the provider whose TENANT CONNECTION it rides:
|
|
136
|
+
// when a tenant has no row for THIS provider, getConnection falls back to the
|
|
137
|
+
// alias provider's row (tenant connects 'apify' once; every actor connector
|
|
138
|
+
// works). A tenant-pasted key for this provider still wins — the alias is the
|
|
139
|
+
// fallback, not the override. Refresh semantics follow the ALIAS provider's
|
|
140
|
+
// adapter. One hop only; the alias must name a concrete provider, never
|
|
141
|
+
// another aliased one.
|
|
142
|
+
credentialProvider?: string;
|
|
143
|
+
|
|
133
144
|
// Inline connect-form spec for api_key / app_password shapes. Omitted by pure
|
|
134
145
|
// oauth2 adapters (they render a Connect button instead). For a dual-mode
|
|
135
146
|
// provider (WordPress), this describes the NON-oauth fallback form; the UI
|
package/src/manifest.ts
CHANGED
|
@@ -92,6 +92,14 @@ export const connectorManifestSchema = z
|
|
|
92
92
|
allowed_domains: z
|
|
93
93
|
.array(z.string().regex(domainPattern, 'each entry is a bare host or *.host, optional :port'))
|
|
94
94
|
.min(1, 'declare at least one allowed domain'),
|
|
95
|
+
// Credential alias (see ConnectionProvider.credentialProvider): the provider
|
|
96
|
+
// whose tenant connection this connector rides when the tenant has not
|
|
97
|
+
// connected THIS provider directly. Declared here so reviewers see the
|
|
98
|
+
// dependency; the adapter's copy is authoritative at runtime.
|
|
99
|
+
credential_provider: z
|
|
100
|
+
.string()
|
|
101
|
+
.regex(kebab, 'credential_provider must be a lowercase-kebab provider key')
|
|
102
|
+
.optional(),
|
|
95
103
|
// Connector-level config keys the platform must supply (resolved from the
|
|
96
104
|
// encrypted config store — values are set by staff at publish, never bundled).
|
|
97
105
|
env: z
|