@contractspec/lib.contracts-integrations 2.0.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/README.md +3 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +3676 -0
- package/dist/integrations/binding.d.ts +14 -0
- package/dist/integrations/binding.js +1 -0
- package/dist/integrations/connection.d.ts +47 -0
- package/dist/integrations/connection.js +1 -0
- package/dist/integrations/docs/integrations.docblock.d.ts +2 -0
- package/dist/integrations/docs/integrations.docblock.js +110 -0
- package/dist/integrations/health.d.ts +17 -0
- package/dist/integrations/health.js +73 -0
- package/dist/integrations/health.test.d.ts +1 -0
- package/dist/integrations/index.d.ts +11 -0
- package/dist/integrations/index.js +3264 -0
- package/dist/integrations/integrations.capability.d.ts +1 -0
- package/dist/integrations/integrations.capability.js +18 -0
- package/dist/integrations/integrations.feature.d.ts +5 -0
- package/dist/integrations/integrations.feature.js +33 -0
- package/dist/integrations/meeting-recorder/contracts/index.d.ts +7 -0
- package/dist/integrations/meeting-recorder/contracts/index.js +474 -0
- package/dist/integrations/meeting-recorder/contracts/meetings.d.ts +451 -0
- package/dist/integrations/meeting-recorder/contracts/meetings.js +219 -0
- package/dist/integrations/meeting-recorder/contracts/transcripts.d.ts +166 -0
- package/dist/integrations/meeting-recorder/contracts/transcripts.js +287 -0
- package/dist/integrations/meeting-recorder/contracts/webhooks.d.ts +85 -0
- package/dist/integrations/meeting-recorder/contracts/webhooks.js +172 -0
- package/dist/integrations/meeting-recorder/meeting-recorder.capability.d.ts +1 -0
- package/dist/integrations/meeting-recorder/meeting-recorder.capability.js +18 -0
- package/dist/integrations/meeting-recorder/meeting-recorder.feature.d.ts +5 -0
- package/dist/integrations/meeting-recorder/meeting-recorder.feature.js +33 -0
- package/dist/integrations/meeting-recorder/models.d.ts +402 -0
- package/dist/integrations/meeting-recorder/models.js +122 -0
- package/dist/integrations/meeting-recorder/telemetry.d.ts +13 -0
- package/dist/integrations/meeting-recorder/telemetry.js +54 -0
- package/dist/integrations/openbanking/contracts/accounts.d.ts +282 -0
- package/dist/integrations/openbanking/contracts/accounts.js +328 -0
- package/dist/integrations/openbanking/contracts/balances.d.ts +158 -0
- package/dist/integrations/openbanking/contracts/balances.js +292 -0
- package/dist/integrations/openbanking/contracts/index.d.ts +7 -0
- package/dist/integrations/openbanking/contracts/index.js +644 -0
- package/dist/integrations/openbanking/contracts/transactions.d.ts +206 -0
- package/dist/integrations/openbanking/contracts/transactions.js +298 -0
- package/dist/integrations/openbanking/guards.d.ts +8 -0
- package/dist/integrations/openbanking/guards.js +42 -0
- package/dist/integrations/openbanking/guards.test.d.ts +1 -0
- package/dist/integrations/openbanking/models.d.ts +223 -0
- package/dist/integrations/openbanking/models.js +110 -0
- package/dist/integrations/openbanking/openbanking.capability.d.ts +1 -0
- package/dist/integrations/openbanking/openbanking.capability.js +18 -0
- package/dist/integrations/openbanking/openbanking.feature.d.ts +5 -0
- package/dist/integrations/openbanking/openbanking.feature.js +35 -0
- package/dist/integrations/openbanking/telemetry.d.ts +12 -0
- package/dist/integrations/openbanking/telemetry.js +51 -0
- package/dist/integrations/operations.d.ts +430 -0
- package/dist/integrations/operations.js +297 -0
- package/dist/integrations/operations.test.d.ts +1 -0
- package/dist/integrations/providers/analytics-reader.d.ts +103 -0
- package/dist/integrations/providers/analytics-reader.js +1 -0
- package/dist/integrations/providers/analytics-writer.d.ts +6 -0
- package/dist/integrations/providers/analytics-writer.js +1 -0
- package/dist/integrations/providers/analytics.d.ts +47 -0
- package/dist/integrations/providers/analytics.js +1 -0
- package/dist/integrations/providers/calendar.d.ts +75 -0
- package/dist/integrations/providers/calendar.js +1 -0
- package/dist/integrations/providers/database.d.ts +12 -0
- package/dist/integrations/providers/database.js +1 -0
- package/dist/integrations/providers/elevenlabs.d.ts +3 -0
- package/dist/integrations/providers/elevenlabs.js +86 -0
- package/dist/integrations/providers/email.d.ts +83 -0
- package/dist/integrations/providers/email.js +1 -0
- package/dist/integrations/providers/embedding.d.ts +21 -0
- package/dist/integrations/providers/embedding.js +1 -0
- package/dist/integrations/providers/fal.d.ts +3 -0
- package/dist/integrations/providers/fal.js +112 -0
- package/dist/integrations/providers/fathom.d.ts +3 -0
- package/dist/integrations/providers/fathom.js +126 -0
- package/dist/integrations/providers/fireflies.d.ts +3 -0
- package/dist/integrations/providers/fireflies.js +106 -0
- package/dist/integrations/providers/gcs-storage.d.ts +3 -0
- package/dist/integrations/providers/gcs-storage.js +97 -0
- package/dist/integrations/providers/gmail.d.ts +3 -0
- package/dist/integrations/providers/gmail.js +109 -0
- package/dist/integrations/providers/google-calendar.d.ts +3 -0
- package/dist/integrations/providers/google-calendar.js +92 -0
- package/dist/integrations/providers/gradium.d.ts +3 -0
- package/dist/integrations/providers/gradium.js +110 -0
- package/dist/integrations/providers/granola.d.ts +3 -0
- package/dist/integrations/providers/granola.js +107 -0
- package/dist/integrations/providers/index.d.ts +38 -0
- package/dist/integrations/providers/index.js +2094 -0
- package/dist/integrations/providers/jira.d.ts +3 -0
- package/dist/integrations/providers/jira.js +108 -0
- package/dist/integrations/providers/linear.d.ts +3 -0
- package/dist/integrations/providers/linear.js +107 -0
- package/dist/integrations/providers/llm.d.ts +79 -0
- package/dist/integrations/providers/llm.js +1 -0
- package/dist/integrations/providers/meeting-recorder.d.ts +129 -0
- package/dist/integrations/providers/meeting-recorder.js +1 -0
- package/dist/integrations/providers/mistral.d.ts +3 -0
- package/dist/integrations/providers/mistral.js +94 -0
- package/dist/integrations/providers/notion.d.ts +3 -0
- package/dist/integrations/providers/notion.js +113 -0
- package/dist/integrations/providers/openbanking.d.ts +125 -0
- package/dist/integrations/providers/openbanking.js +1 -0
- package/dist/integrations/providers/payments.d.ts +106 -0
- package/dist/integrations/providers/payments.js +1 -0
- package/dist/integrations/providers/posthog-llm-telemetry.d.ts +51 -0
- package/dist/integrations/providers/posthog-llm-telemetry.js +176 -0
- package/dist/integrations/providers/posthog.d.ts +3 -0
- package/dist/integrations/providers/posthog.js +106 -0
- package/dist/integrations/providers/postmark.d.ts +3 -0
- package/dist/integrations/providers/postmark.js +98 -0
- package/dist/integrations/providers/powens.d.ts +3 -0
- package/dist/integrations/providers/powens.js +124 -0
- package/dist/integrations/providers/project-management.d.ts +32 -0
- package/dist/integrations/providers/project-management.js +1 -0
- package/dist/integrations/providers/providers.test.d.ts +1 -0
- package/dist/integrations/providers/qdrant.d.ts +3 -0
- package/dist/integrations/providers/qdrant.js +101 -0
- package/dist/integrations/providers/registry.d.ts +6 -0
- package/dist/integrations/providers/registry.js +1878 -0
- package/dist/integrations/providers/sms.d.ts +31 -0
- package/dist/integrations/providers/sms.js +1 -0
- package/dist/integrations/providers/storage.d.ts +57 -0
- package/dist/integrations/providers/storage.js +1 -0
- package/dist/integrations/providers/stripe.d.ts +3 -0
- package/dist/integrations/providers/stripe.js +105 -0
- package/dist/integrations/providers/supabase-postgres.d.ts +3 -0
- package/dist/integrations/providers/supabase-postgres.js +87 -0
- package/dist/integrations/providers/supabase-vector.d.ts +3 -0
- package/dist/integrations/providers/supabase-vector.js +107 -0
- package/dist/integrations/providers/tldv.d.ts +3 -0
- package/dist/integrations/providers/tldv.js +106 -0
- package/dist/integrations/providers/twilio-sms.d.ts +3 -0
- package/dist/integrations/providers/twilio-sms.js +91 -0
- package/dist/integrations/providers/vector-store.d.ts +39 -0
- package/dist/integrations/providers/vector-store.js +1 -0
- package/dist/integrations/providers/voice.d.ts +31 -0
- package/dist/integrations/providers/voice.js +1 -0
- package/dist/integrations/runtime.d.ts +95 -0
- package/dist/integrations/runtime.js +209 -0
- package/dist/integrations/runtime.test.d.ts +1 -0
- package/dist/integrations/secrets/aws-secret-manager.d.ts +28 -0
- package/dist/integrations/secrets/aws-secret-manager.js +346 -0
- package/dist/integrations/secrets/env-secret-provider.d.ts +28 -0
- package/dist/integrations/secrets/env-secret-provider.js +159 -0
- package/dist/integrations/secrets/gcp-secret-manager.d.ts +29 -0
- package/dist/integrations/secrets/gcp-secret-manager.js +347 -0
- package/dist/integrations/secrets/index.d.ts +6 -0
- package/dist/integrations/secrets/index.js +1129 -0
- package/dist/integrations/secrets/manager.d.ts +44 -0
- package/dist/integrations/secrets/manager.js +183 -0
- package/dist/integrations/secrets/provider.d.ts +49 -0
- package/dist/integrations/secrets/provider.js +74 -0
- package/dist/integrations/secrets/provider.test.d.ts +1 -0
- package/dist/integrations/secrets/scaleway-secret-manager.d.ts +35 -0
- package/dist/integrations/secrets/scaleway-secret-manager.js +375 -0
- package/dist/integrations/secrets-types.d.ts +14 -0
- package/dist/integrations/secrets-types.js +1 -0
- package/dist/integrations/spec.d.ts +72 -0
- package/dist/integrations/spec.js +22 -0
- package/dist/integrations/spec.test.d.ts +1 -0
- package/dist/node/index.js +3675 -0
- package/dist/node/integrations/binding.js +0 -0
- package/dist/node/integrations/connection.js +0 -0
- package/dist/node/integrations/docs/integrations.docblock.js +109 -0
- package/dist/node/integrations/health.js +72 -0
- package/dist/node/integrations/index.js +3263 -0
- package/dist/node/integrations/integrations.capability.js +17 -0
- package/dist/node/integrations/integrations.feature.js +32 -0
- package/dist/node/integrations/meeting-recorder/contracts/index.js +473 -0
- package/dist/node/integrations/meeting-recorder/contracts/meetings.js +218 -0
- package/dist/node/integrations/meeting-recorder/contracts/transcripts.js +286 -0
- package/dist/node/integrations/meeting-recorder/contracts/webhooks.js +171 -0
- package/dist/node/integrations/meeting-recorder/meeting-recorder.capability.js +17 -0
- package/dist/node/integrations/meeting-recorder/meeting-recorder.feature.js +32 -0
- package/dist/node/integrations/meeting-recorder/models.js +121 -0
- package/dist/node/integrations/meeting-recorder/telemetry.js +53 -0
- package/dist/node/integrations/openbanking/contracts/accounts.js +327 -0
- package/dist/node/integrations/openbanking/contracts/balances.js +291 -0
- package/dist/node/integrations/openbanking/contracts/index.js +643 -0
- package/dist/node/integrations/openbanking/contracts/transactions.js +297 -0
- package/dist/node/integrations/openbanking/guards.js +41 -0
- package/dist/node/integrations/openbanking/models.js +109 -0
- package/dist/node/integrations/openbanking/openbanking.capability.js +17 -0
- package/dist/node/integrations/openbanking/openbanking.feature.js +34 -0
- package/dist/node/integrations/openbanking/telemetry.js +50 -0
- package/dist/node/integrations/operations.js +296 -0
- package/dist/node/integrations/providers/analytics-reader.js +0 -0
- package/dist/node/integrations/providers/analytics-writer.js +0 -0
- package/dist/node/integrations/providers/analytics.js +0 -0
- package/dist/node/integrations/providers/calendar.js +0 -0
- package/dist/node/integrations/providers/database.js +0 -0
- package/dist/node/integrations/providers/elevenlabs.js +85 -0
- package/dist/node/integrations/providers/email.js +0 -0
- package/dist/node/integrations/providers/embedding.js +0 -0
- package/dist/node/integrations/providers/fal.js +111 -0
- package/dist/node/integrations/providers/fathom.js +125 -0
- package/dist/node/integrations/providers/fireflies.js +105 -0
- package/dist/node/integrations/providers/gcs-storage.js +96 -0
- package/dist/node/integrations/providers/gmail.js +108 -0
- package/dist/node/integrations/providers/google-calendar.js +91 -0
- package/dist/node/integrations/providers/gradium.js +109 -0
- package/dist/node/integrations/providers/granola.js +106 -0
- package/dist/node/integrations/providers/index.js +2093 -0
- package/dist/node/integrations/providers/jira.js +107 -0
- package/dist/node/integrations/providers/linear.js +106 -0
- package/dist/node/integrations/providers/llm.js +0 -0
- package/dist/node/integrations/providers/meeting-recorder.js +0 -0
- package/dist/node/integrations/providers/mistral.js +93 -0
- package/dist/node/integrations/providers/notion.js +112 -0
- package/dist/node/integrations/providers/openbanking.js +0 -0
- package/dist/node/integrations/providers/payments.js +0 -0
- package/dist/node/integrations/providers/posthog-llm-telemetry.js +175 -0
- package/dist/node/integrations/providers/posthog.js +105 -0
- package/dist/node/integrations/providers/postmark.js +97 -0
- package/dist/node/integrations/providers/powens.js +123 -0
- package/dist/node/integrations/providers/project-management.js +0 -0
- package/dist/node/integrations/providers/qdrant.js +100 -0
- package/dist/node/integrations/providers/registry.js +1877 -0
- package/dist/node/integrations/providers/sms.js +0 -0
- package/dist/node/integrations/providers/storage.js +0 -0
- package/dist/node/integrations/providers/stripe.js +104 -0
- package/dist/node/integrations/providers/supabase-postgres.js +86 -0
- package/dist/node/integrations/providers/supabase-vector.js +106 -0
- package/dist/node/integrations/providers/tldv.js +105 -0
- package/dist/node/integrations/providers/twilio-sms.js +90 -0
- package/dist/node/integrations/providers/vector-store.js +0 -0
- package/dist/node/integrations/providers/voice.js +0 -0
- package/dist/node/integrations/runtime.js +208 -0
- package/dist/node/integrations/secrets/aws-secret-manager.js +345 -0
- package/dist/node/integrations/secrets/env-secret-provider.js +158 -0
- package/dist/node/integrations/secrets/gcp-secret-manager.js +346 -0
- package/dist/node/integrations/secrets/index.js +1128 -0
- package/dist/node/integrations/secrets/manager.js +182 -0
- package/dist/node/integrations/secrets/provider.js +73 -0
- package/dist/node/integrations/secrets/scaleway-secret-manager.js +374 -0
- package/dist/node/integrations/secrets-types.js +0 -0
- package/dist/node/integrations/spec.js +21 -0
- package/package.json +1029 -0
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
// src/integrations/spec.ts
|
|
2
|
+
import { SpecContractRegistry } from "@contractspec/lib.contracts-spec/registry";
|
|
3
|
+
var integrationKey = (meta) => `${meta.key}.v${meta.version}`;
|
|
4
|
+
|
|
5
|
+
class IntegrationSpecRegistry extends SpecContractRegistry {
|
|
6
|
+
constructor(items) {
|
|
7
|
+
super("integration", items);
|
|
8
|
+
}
|
|
9
|
+
getByCategory(category) {
|
|
10
|
+
return this.list().filter((spec) => spec.meta.category === category);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
function makeIntegrationSpecKey(meta) {
|
|
14
|
+
return integrationKey(meta);
|
|
15
|
+
}
|
|
16
|
+
var defineIntegration = (spec) => spec;
|
|
17
|
+
|
|
18
|
+
// src/integrations/providers/jira.ts
|
|
19
|
+
import { StabilityEnum } from "@contractspec/lib.contracts-spec/ownership";
|
|
20
|
+
var jiraIntegrationSpec = defineIntegration({
|
|
21
|
+
meta: {
|
|
22
|
+
key: "project-management.jira",
|
|
23
|
+
version: "1.0.0",
|
|
24
|
+
category: "project-management",
|
|
25
|
+
title: "Jira Cloud",
|
|
26
|
+
description: "Jira Cloud integration for creating and tracking work items.",
|
|
27
|
+
domain: "productivity",
|
|
28
|
+
owners: ["@platform.integrations"],
|
|
29
|
+
tags: ["project-management", "jira"],
|
|
30
|
+
stability: StabilityEnum.Beta
|
|
31
|
+
},
|
|
32
|
+
supportedModes: ["managed", "byok"],
|
|
33
|
+
capabilities: {
|
|
34
|
+
provides: [{ key: "project-management.work-items", version: "1.0.0" }]
|
|
35
|
+
},
|
|
36
|
+
configSchema: {
|
|
37
|
+
schema: {
|
|
38
|
+
type: "object",
|
|
39
|
+
required: ["siteUrl"],
|
|
40
|
+
properties: {
|
|
41
|
+
siteUrl: {
|
|
42
|
+
type: "string",
|
|
43
|
+
description: "Jira Cloud site URL (e.g., https://acme.atlassian.net)."
|
|
44
|
+
},
|
|
45
|
+
projectKey: {
|
|
46
|
+
type: "string",
|
|
47
|
+
description: "Default Jira project key for new issues."
|
|
48
|
+
},
|
|
49
|
+
issueType: {
|
|
50
|
+
type: "string",
|
|
51
|
+
description: "Default Jira issue type (e.g., Task, Story)."
|
|
52
|
+
},
|
|
53
|
+
defaultLabels: {
|
|
54
|
+
type: "array",
|
|
55
|
+
items: { type: "string" },
|
|
56
|
+
description: "Labels applied to each issue by default."
|
|
57
|
+
},
|
|
58
|
+
issueTypeMap: {
|
|
59
|
+
type: "object",
|
|
60
|
+
additionalProperties: { type: "string" },
|
|
61
|
+
description: "Optional mapping from work item types to Jira issue types."
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
example: {
|
|
66
|
+
siteUrl: "https://acme.atlassian.net",
|
|
67
|
+
projectKey: "PM",
|
|
68
|
+
issueType: "Task"
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
secretSchema: {
|
|
72
|
+
schema: {
|
|
73
|
+
type: "object",
|
|
74
|
+
required: ["email", "apiToken"],
|
|
75
|
+
properties: {
|
|
76
|
+
email: {
|
|
77
|
+
type: "string",
|
|
78
|
+
description: "Jira account email used for API token auth."
|
|
79
|
+
},
|
|
80
|
+
apiToken: {
|
|
81
|
+
type: "string",
|
|
82
|
+
description: "Jira Cloud API token for the account."
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
example: {
|
|
87
|
+
email: "user@acme.com",
|
|
88
|
+
apiToken: "jira_api_token"
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
healthCheck: {
|
|
92
|
+
method: "custom",
|
|
93
|
+
timeoutMs: 4000
|
|
94
|
+
},
|
|
95
|
+
docsUrl: "https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/",
|
|
96
|
+
constraints: {},
|
|
97
|
+
byokSetup: {
|
|
98
|
+
setupInstructions: "Create a Jira API token and store it with the associated account email."
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
function registerJiraIntegration(registry) {
|
|
102
|
+
return registry.register(jiraIntegrationSpec);
|
|
103
|
+
}
|
|
104
|
+
export {
|
|
105
|
+
registerJiraIntegration,
|
|
106
|
+
jiraIntegrationSpec
|
|
107
|
+
};
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
// src/integrations/spec.ts
|
|
2
|
+
import { SpecContractRegistry } from "@contractspec/lib.contracts-spec/registry";
|
|
3
|
+
var integrationKey = (meta) => `${meta.key}.v${meta.version}`;
|
|
4
|
+
|
|
5
|
+
class IntegrationSpecRegistry extends SpecContractRegistry {
|
|
6
|
+
constructor(items) {
|
|
7
|
+
super("integration", items);
|
|
8
|
+
}
|
|
9
|
+
getByCategory(category) {
|
|
10
|
+
return this.list().filter((spec) => spec.meta.category === category);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
function makeIntegrationSpecKey(meta) {
|
|
14
|
+
return integrationKey(meta);
|
|
15
|
+
}
|
|
16
|
+
var defineIntegration = (spec) => spec;
|
|
17
|
+
|
|
18
|
+
// src/integrations/providers/linear.ts
|
|
19
|
+
import { StabilityEnum } from "@contractspec/lib.contracts-spec/ownership";
|
|
20
|
+
var linearIntegrationSpec = defineIntegration({
|
|
21
|
+
meta: {
|
|
22
|
+
key: "project-management.linear",
|
|
23
|
+
version: "1.0.0",
|
|
24
|
+
category: "project-management",
|
|
25
|
+
title: "Linear",
|
|
26
|
+
description: "Linear integration for issue tracking and project management workflows.",
|
|
27
|
+
domain: "productivity",
|
|
28
|
+
owners: ["@platform.integrations"],
|
|
29
|
+
tags: ["project-management", "linear"],
|
|
30
|
+
stability: StabilityEnum.Beta
|
|
31
|
+
},
|
|
32
|
+
supportedModes: ["managed", "byok"],
|
|
33
|
+
capabilities: {
|
|
34
|
+
provides: [{ key: "project-management.work-items", version: "1.0.0" }]
|
|
35
|
+
},
|
|
36
|
+
configSchema: {
|
|
37
|
+
schema: {
|
|
38
|
+
type: "object",
|
|
39
|
+
required: ["teamId"],
|
|
40
|
+
properties: {
|
|
41
|
+
teamId: {
|
|
42
|
+
type: "string",
|
|
43
|
+
description: "Linear team ID that owns created issues."
|
|
44
|
+
},
|
|
45
|
+
projectId: {
|
|
46
|
+
type: "string",
|
|
47
|
+
description: "Optional default project ID for new issues."
|
|
48
|
+
},
|
|
49
|
+
stateId: {
|
|
50
|
+
type: "string",
|
|
51
|
+
description: "Optional default workflow state ID."
|
|
52
|
+
},
|
|
53
|
+
assigneeId: {
|
|
54
|
+
type: "string",
|
|
55
|
+
description: "Optional default assignee ID."
|
|
56
|
+
},
|
|
57
|
+
labelIds: {
|
|
58
|
+
type: "array",
|
|
59
|
+
items: { type: "string" },
|
|
60
|
+
description: "Optional label IDs applied to each issue."
|
|
61
|
+
},
|
|
62
|
+
tagLabelMap: {
|
|
63
|
+
type: "object",
|
|
64
|
+
additionalProperties: { type: "string" },
|
|
65
|
+
description: "Optional mapping of tags to Linear label IDs (tag -> labelId)."
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
example: {
|
|
70
|
+
teamId: "team_123",
|
|
71
|
+
projectId: "proj_456",
|
|
72
|
+
labelIds: ["label_1", "label_2"]
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
secretSchema: {
|
|
76
|
+
schema: {
|
|
77
|
+
type: "object",
|
|
78
|
+
required: ["apiKey"],
|
|
79
|
+
properties: {
|
|
80
|
+
apiKey: {
|
|
81
|
+
type: "string",
|
|
82
|
+
description: "Linear API key (personal or service token)."
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
example: {
|
|
87
|
+
apiKey: "lin_api_key"
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
healthCheck: {
|
|
91
|
+
method: "custom",
|
|
92
|
+
timeoutMs: 4000
|
|
93
|
+
},
|
|
94
|
+
docsUrl: "https://developers.linear.app",
|
|
95
|
+
constraints: {},
|
|
96
|
+
byokSetup: {
|
|
97
|
+
setupInstructions: "Create a Linear API key with issue:write permission and store it as a secret."
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
function registerLinearIntegration(registry) {
|
|
101
|
+
return registry.register(linearIntegrationSpec);
|
|
102
|
+
}
|
|
103
|
+
export {
|
|
104
|
+
registerLinearIntegration,
|
|
105
|
+
linearIntegrationSpec
|
|
106
|
+
};
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
// src/integrations/spec.ts
|
|
2
|
+
import { SpecContractRegistry } from "@contractspec/lib.contracts-spec/registry";
|
|
3
|
+
var integrationKey = (meta) => `${meta.key}.v${meta.version}`;
|
|
4
|
+
|
|
5
|
+
class IntegrationSpecRegistry extends SpecContractRegistry {
|
|
6
|
+
constructor(items) {
|
|
7
|
+
super("integration", items);
|
|
8
|
+
}
|
|
9
|
+
getByCategory(category) {
|
|
10
|
+
return this.list().filter((spec) => spec.meta.category === category);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
function makeIntegrationSpecKey(meta) {
|
|
14
|
+
return integrationKey(meta);
|
|
15
|
+
}
|
|
16
|
+
var defineIntegration = (spec) => spec;
|
|
17
|
+
|
|
18
|
+
// src/integrations/providers/mistral.ts
|
|
19
|
+
import { StabilityEnum } from "@contractspec/lib.contracts-spec/ownership";
|
|
20
|
+
var mistralIntegrationSpec = defineIntegration({
|
|
21
|
+
meta: {
|
|
22
|
+
key: "ai-llm.mistral",
|
|
23
|
+
version: "1.0.0",
|
|
24
|
+
category: "ai-llm",
|
|
25
|
+
title: "Mistral Large Language Model",
|
|
26
|
+
description: "Mistral integration providing chat completions and embedding generation.",
|
|
27
|
+
domain: "ai",
|
|
28
|
+
owners: ["platform.ai"],
|
|
29
|
+
tags: ["ai", "llm", "embeddings"],
|
|
30
|
+
stability: StabilityEnum.Experimental
|
|
31
|
+
},
|
|
32
|
+
supportedModes: ["managed", "byok"],
|
|
33
|
+
capabilities: {
|
|
34
|
+
provides: [
|
|
35
|
+
{ key: "ai.chat", version: "1.0.0" },
|
|
36
|
+
{ key: "ai.embeddings", version: "1.0.0" }
|
|
37
|
+
]
|
|
38
|
+
},
|
|
39
|
+
configSchema: {
|
|
40
|
+
schema: {
|
|
41
|
+
type: "object",
|
|
42
|
+
properties: {
|
|
43
|
+
model: {
|
|
44
|
+
type: "string",
|
|
45
|
+
description: "Default chat completion model (e.g., mistral-large-latest)."
|
|
46
|
+
},
|
|
47
|
+
embeddingModel: {
|
|
48
|
+
type: "string",
|
|
49
|
+
description: "Embedding model identifier."
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
example: {
|
|
54
|
+
model: "mistral-large-latest",
|
|
55
|
+
embeddingModel: "mistral-embed"
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
secretSchema: {
|
|
59
|
+
schema: {
|
|
60
|
+
type: "object",
|
|
61
|
+
required: ["apiKey"],
|
|
62
|
+
properties: {
|
|
63
|
+
apiKey: {
|
|
64
|
+
type: "string",
|
|
65
|
+
description: "Mistral API key with access to chat and embeddings endpoints."
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
example: {
|
|
70
|
+
apiKey: "mistral-***"
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
healthCheck: {
|
|
74
|
+
method: "custom",
|
|
75
|
+
timeoutMs: 5000
|
|
76
|
+
},
|
|
77
|
+
docsUrl: "https://docs.mistral.ai/platform/endpoints",
|
|
78
|
+
constraints: {
|
|
79
|
+
rateLimit: {
|
|
80
|
+
rpm: 600
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
byokSetup: {
|
|
84
|
+
setupInstructions: "Generate an API key within the Mistral console and ensure the selected models are enabled for the account."
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
function registerMistralIntegration(registry) {
|
|
88
|
+
return registry.register(mistralIntegrationSpec);
|
|
89
|
+
}
|
|
90
|
+
export {
|
|
91
|
+
registerMistralIntegration,
|
|
92
|
+
mistralIntegrationSpec
|
|
93
|
+
};
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
// src/integrations/spec.ts
|
|
2
|
+
import { SpecContractRegistry } from "@contractspec/lib.contracts-spec/registry";
|
|
3
|
+
var integrationKey = (meta) => `${meta.key}.v${meta.version}`;
|
|
4
|
+
|
|
5
|
+
class IntegrationSpecRegistry extends SpecContractRegistry {
|
|
6
|
+
constructor(items) {
|
|
7
|
+
super("integration", items);
|
|
8
|
+
}
|
|
9
|
+
getByCategory(category) {
|
|
10
|
+
return this.list().filter((spec) => spec.meta.category === category);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
function makeIntegrationSpecKey(meta) {
|
|
14
|
+
return integrationKey(meta);
|
|
15
|
+
}
|
|
16
|
+
var defineIntegration = (spec) => spec;
|
|
17
|
+
|
|
18
|
+
// src/integrations/providers/notion.ts
|
|
19
|
+
import { StabilityEnum } from "@contractspec/lib.contracts-spec/ownership";
|
|
20
|
+
var notionIntegrationSpec = defineIntegration({
|
|
21
|
+
meta: {
|
|
22
|
+
key: "project-management.notion",
|
|
23
|
+
version: "1.0.0",
|
|
24
|
+
category: "project-management",
|
|
25
|
+
title: "Notion",
|
|
26
|
+
description: "Notion integration for creating shared project summaries and task entries.",
|
|
27
|
+
domain: "productivity",
|
|
28
|
+
owners: ["@platform.integrations"],
|
|
29
|
+
tags: ["project-management", "notion"],
|
|
30
|
+
stability: StabilityEnum.Beta
|
|
31
|
+
},
|
|
32
|
+
supportedModes: ["managed", "byok"],
|
|
33
|
+
capabilities: {
|
|
34
|
+
provides: [{ key: "project-management.work-items", version: "1.0.0" }]
|
|
35
|
+
},
|
|
36
|
+
configSchema: {
|
|
37
|
+
schema: {
|
|
38
|
+
type: "object",
|
|
39
|
+
properties: {
|
|
40
|
+
databaseId: {
|
|
41
|
+
type: "string",
|
|
42
|
+
description: "Optional Notion database ID to store tasks."
|
|
43
|
+
},
|
|
44
|
+
summaryParentPageId: {
|
|
45
|
+
type: "string",
|
|
46
|
+
description: "Optional parent page ID for summary pages."
|
|
47
|
+
},
|
|
48
|
+
titleProperty: {
|
|
49
|
+
type: "string",
|
|
50
|
+
description: 'Database title property name (defaults to "Name").'
|
|
51
|
+
},
|
|
52
|
+
statusProperty: {
|
|
53
|
+
type: "string",
|
|
54
|
+
description: "Database status/select property name."
|
|
55
|
+
},
|
|
56
|
+
priorityProperty: {
|
|
57
|
+
type: "string",
|
|
58
|
+
description: "Database priority/select property name."
|
|
59
|
+
},
|
|
60
|
+
tagsProperty: {
|
|
61
|
+
type: "string",
|
|
62
|
+
description: "Database multi-select tags property name."
|
|
63
|
+
},
|
|
64
|
+
dueDateProperty: {
|
|
65
|
+
type: "string",
|
|
66
|
+
description: "Database date property name for due dates."
|
|
67
|
+
},
|
|
68
|
+
descriptionProperty: {
|
|
69
|
+
type: "string",
|
|
70
|
+
description: "Database rich-text property for descriptions."
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
example: {
|
|
75
|
+
databaseId: "xxxxxxxxxxxxxxxx",
|
|
76
|
+
summaryParentPageId: "yyyyyyyyyyyyyyyy",
|
|
77
|
+
titleProperty: "Name",
|
|
78
|
+
statusProperty: "Status"
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
secretSchema: {
|
|
82
|
+
schema: {
|
|
83
|
+
type: "object",
|
|
84
|
+
required: ["apiKey"],
|
|
85
|
+
properties: {
|
|
86
|
+
apiKey: {
|
|
87
|
+
type: "string",
|
|
88
|
+
description: "Notion integration secret token."
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
example: {
|
|
93
|
+
apiKey: "secret_notion_token"
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
healthCheck: {
|
|
97
|
+
method: "custom",
|
|
98
|
+
timeoutMs: 4000
|
|
99
|
+
},
|
|
100
|
+
docsUrl: "https://developers.notion.com",
|
|
101
|
+
constraints: {},
|
|
102
|
+
byokSetup: {
|
|
103
|
+
setupInstructions: "Create a Notion internal integration, share the target database/page with it, and store the secret token."
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
function registerNotionIntegration(registry) {
|
|
107
|
+
return registry.register(notionIntegrationSpec);
|
|
108
|
+
}
|
|
109
|
+
export {
|
|
110
|
+
registerNotionIntegration,
|
|
111
|
+
notionIntegrationSpec
|
|
112
|
+
};
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
// src/integrations/providers/posthog-llm-telemetry.ts
|
|
2
|
+
import { StabilityEnum } from "@contractspec/lib.contracts-spec/ownership";
|
|
3
|
+
var posthogLLMTelemetrySpec = {
|
|
4
|
+
meta: {
|
|
5
|
+
key: "analytics.posthog.llm",
|
|
6
|
+
version: "1.0.0",
|
|
7
|
+
title: "PostHog LLM Analytics Telemetry",
|
|
8
|
+
description: "Telemetry events for PostHog LLM Analytics: generation tracing, token usage, and evaluation-ready metadata.",
|
|
9
|
+
domain: "analytics",
|
|
10
|
+
owners: ["@platform.integrations"],
|
|
11
|
+
tags: ["analytics", "posthog", "llm", "ai", "telemetry"],
|
|
12
|
+
stability: StabilityEnum.Beta
|
|
13
|
+
},
|
|
14
|
+
events: [
|
|
15
|
+
{
|
|
16
|
+
key: "posthog.llm.generation",
|
|
17
|
+
version: "1.0.0",
|
|
18
|
+
semantics: {
|
|
19
|
+
who: "AI agent or LLM consumer",
|
|
20
|
+
what: "Captures an LLM generation call with full observability metadata",
|
|
21
|
+
why: "Enable LLM performance monitoring, cost tracking, and automated quality evaluations via PostHog"
|
|
22
|
+
},
|
|
23
|
+
properties: {
|
|
24
|
+
$ai_model: {
|
|
25
|
+
type: "string",
|
|
26
|
+
required: true,
|
|
27
|
+
description: "The LLM model identifier (e.g., gpt-4o, claude-sonnet-4-20250514)"
|
|
28
|
+
},
|
|
29
|
+
$ai_provider: {
|
|
30
|
+
type: "string",
|
|
31
|
+
required: true,
|
|
32
|
+
description: "The LLM provider (e.g., openai, anthropic, contractspec)"
|
|
33
|
+
},
|
|
34
|
+
$ai_latency: {
|
|
35
|
+
type: "number",
|
|
36
|
+
required: false,
|
|
37
|
+
description: "LLM call latency in seconds"
|
|
38
|
+
},
|
|
39
|
+
$ai_input_tokens: {
|
|
40
|
+
type: "number",
|
|
41
|
+
required: false,
|
|
42
|
+
description: "Number of input/prompt tokens consumed"
|
|
43
|
+
},
|
|
44
|
+
$ai_output_tokens: {
|
|
45
|
+
type: "number",
|
|
46
|
+
required: false,
|
|
47
|
+
description: "Number of output/completion tokens generated"
|
|
48
|
+
},
|
|
49
|
+
$ai_total_cost_usd: {
|
|
50
|
+
type: "number",
|
|
51
|
+
required: false,
|
|
52
|
+
description: "Total cost in USD (input + output)"
|
|
53
|
+
},
|
|
54
|
+
$ai_is_error: {
|
|
55
|
+
type: "boolean",
|
|
56
|
+
required: false,
|
|
57
|
+
description: "Whether the generation resulted in an error"
|
|
58
|
+
},
|
|
59
|
+
$ai_trace_id: {
|
|
60
|
+
type: "string",
|
|
61
|
+
required: false,
|
|
62
|
+
description: "Trace ID for grouping related generations"
|
|
63
|
+
},
|
|
64
|
+
$ai_stream: {
|
|
65
|
+
type: "boolean",
|
|
66
|
+
required: false,
|
|
67
|
+
description: "Whether the response was streamed"
|
|
68
|
+
},
|
|
69
|
+
$ai_time_to_first_token: {
|
|
70
|
+
type: "number",
|
|
71
|
+
required: false,
|
|
72
|
+
description: "Time to first token in seconds (streaming only)"
|
|
73
|
+
},
|
|
74
|
+
$ai_tools: {
|
|
75
|
+
type: "json",
|
|
76
|
+
required: false,
|
|
77
|
+
description: "Tools/functions available to the LLM"
|
|
78
|
+
},
|
|
79
|
+
$ai_input: {
|
|
80
|
+
type: "json",
|
|
81
|
+
required: false,
|
|
82
|
+
pii: true,
|
|
83
|
+
redact: true,
|
|
84
|
+
description: "Messages sent to the LLM (may contain PII)"
|
|
85
|
+
},
|
|
86
|
+
$ai_output_choices: {
|
|
87
|
+
type: "json",
|
|
88
|
+
required: false,
|
|
89
|
+
pii: true,
|
|
90
|
+
redact: true,
|
|
91
|
+
description: "Response choices from the LLM (may contain PII)"
|
|
92
|
+
},
|
|
93
|
+
contractspec_operation: {
|
|
94
|
+
type: "string",
|
|
95
|
+
required: false,
|
|
96
|
+
description: "ContractSpec operation name"
|
|
97
|
+
},
|
|
98
|
+
contractspec_version: {
|
|
99
|
+
type: "string",
|
|
100
|
+
required: false,
|
|
101
|
+
description: "ContractSpec operation version"
|
|
102
|
+
},
|
|
103
|
+
contractspec_agent_id: {
|
|
104
|
+
type: "string",
|
|
105
|
+
required: false,
|
|
106
|
+
description: "ContractSpec agent identifier"
|
|
107
|
+
},
|
|
108
|
+
contractspec_finish_reason: {
|
|
109
|
+
type: "string",
|
|
110
|
+
required: false,
|
|
111
|
+
description: "AI SDK finish reason (stop, tool-calls, error, etc.)"
|
|
112
|
+
},
|
|
113
|
+
contractspec_tool_count: {
|
|
114
|
+
type: "number",
|
|
115
|
+
required: false,
|
|
116
|
+
description: "Number of tool calls made in this step"
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
privacy: "internal",
|
|
120
|
+
tags: ["llm", "generation", "posthog"]
|
|
121
|
+
}
|
|
122
|
+
],
|
|
123
|
+
config: {
|
|
124
|
+
defaultRetentionDays: 90,
|
|
125
|
+
defaultSamplingRate: 1,
|
|
126
|
+
providers: [
|
|
127
|
+
{
|
|
128
|
+
type: "posthog",
|
|
129
|
+
config: {
|
|
130
|
+
eventName: "$ai_generation",
|
|
131
|
+
enableEvaluations: true,
|
|
132
|
+
evaluationTemplates: [
|
|
133
|
+
"relevance",
|
|
134
|
+
"helpfulness",
|
|
135
|
+
"jailbreak",
|
|
136
|
+
"hallucination",
|
|
137
|
+
"toxicity"
|
|
138
|
+
]
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
]
|
|
142
|
+
}
|
|
143
|
+
};
|
|
144
|
+
var POSTHOG_LLM_PII_FIELDS = [
|
|
145
|
+
"$ai_input",
|
|
146
|
+
"$ai_output_choices"
|
|
147
|
+
];
|
|
148
|
+
var POSTHOG_LLM_TELEMETRY_EVENTS = {
|
|
149
|
+
generation: "$ai_generation",
|
|
150
|
+
span: "$ai_span",
|
|
151
|
+
evaluation: "$ai_evaluation"
|
|
152
|
+
};
|
|
153
|
+
var POSTHOG_EVALUATION_TEMPLATES = {
|
|
154
|
+
relevance: "relevance",
|
|
155
|
+
helpfulness: "helpfulness",
|
|
156
|
+
jailbreak: "jailbreak",
|
|
157
|
+
hallucination: "hallucination",
|
|
158
|
+
toxicity: "toxicity"
|
|
159
|
+
};
|
|
160
|
+
function redactPostHogLLMTelemetryPayload(payload) {
|
|
161
|
+
const redacted = { ...payload };
|
|
162
|
+
for (const field of POSTHOG_LLM_PII_FIELDS) {
|
|
163
|
+
if (field in redacted) {
|
|
164
|
+
redacted[field] = "[REDACTED]";
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
return redacted;
|
|
168
|
+
}
|
|
169
|
+
export {
|
|
170
|
+
redactPostHogLLMTelemetryPayload,
|
|
171
|
+
posthogLLMTelemetrySpec,
|
|
172
|
+
POSTHOG_LLM_TELEMETRY_EVENTS,
|
|
173
|
+
POSTHOG_LLM_PII_FIELDS,
|
|
174
|
+
POSTHOG_EVALUATION_TEMPLATES
|
|
175
|
+
};
|