saasfunnels 0.1.0-beta.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +48 -3
- package/dist/library.js +25514 -0
- package/dist/saasfunnels.js +839 -83
- package/dist/types/capabilities.d.ts +14 -0
- package/dist/types/check-summary.d.ts +26 -0
- package/dist/types/feature-setup.d.ts +258 -0
- package/dist/types/identity.d.ts +14 -0
- package/dist/types/library.d.ts +3 -0
- package/dist/types/mcp.d.ts +91 -0
- package/dist/types/runtime-contracts.d.ts +73 -0
- package/package.json +12 -5
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export type AgentCapabilityId = "account.funnel_fit.simulate" | "account.strategy.read" | "developer.event.validate" | "developer.feature_manifest.validate" | "developer.handoff.generate" | "developer.workspace.read" | "funnel.entry.apply" | "funnel.entry.evidence.submit" | "funnel.entry.inspect" | "funnel.entry.plan" | "funnel.entry.test" | "setup.test_event.send";
|
|
2
|
+
type AgentExecutionBoundary = "api_key" | "hosted_mcp" | "in_app" | "local_cli" | "local_mcp" | "scheduled_agent";
|
|
3
|
+
type AgentOperationClass = "external_write" | "plan" | "prepare" | "read" | "reversible_write" | "simulate" | "validate";
|
|
4
|
+
type Capability = {
|
|
5
|
+
boundaries: AgentExecutionBoundary[];
|
|
6
|
+
enabled: true;
|
|
7
|
+
id: AgentCapabilityId;
|
|
8
|
+
operationClass: AgentOperationClass;
|
|
9
|
+
};
|
|
10
|
+
export declare function getAgentCapability(id: AgentCapabilityId): Capability;
|
|
11
|
+
export declare function agentCapabilityAllowedAtBoundary(id: AgentCapabilityId, boundary: AgentExecutionBoundary, { mutationsEnabled }?: {
|
|
12
|
+
mutationsEnabled?: boolean;
|
|
13
|
+
}): boolean;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Renders a drift response as a GitHub check summary.
|
|
3
|
+
*
|
|
4
|
+
* Lives in the CLI package rather than the Action because this is the only part
|
|
5
|
+
* of the Action carrying logic worth testing; the Action itself is a thin
|
|
6
|
+
* wrapper around `features handoff` plus this formatter.
|
|
7
|
+
*/
|
|
8
|
+
export type FeatureDriftEntry = {
|
|
9
|
+
featureKey: string | null;
|
|
10
|
+
kind: "added" | "moved" | "removed" | "renamed";
|
|
11
|
+
location: string | null;
|
|
12
|
+
};
|
|
13
|
+
export type FeatureDriftRejection = {
|
|
14
|
+
featureKey: string | null;
|
|
15
|
+
reason: string;
|
|
16
|
+
};
|
|
17
|
+
export declare function formatFeatureDriftCheckSummary(input: {
|
|
18
|
+
drift: FeatureDriftEntry[];
|
|
19
|
+
proposedFeatureKeys?: string[];
|
|
20
|
+
rejectedBindings?: FeatureDriftRejection[];
|
|
21
|
+
targetedFeatureKeys?: string[];
|
|
22
|
+
}): {
|
|
23
|
+
conclusion: "neutral";
|
|
24
|
+
summary: string;
|
|
25
|
+
title: string;
|
|
26
|
+
};
|
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
import { mkdir, rename, rm, writeFile } from "node:fs/promises";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
declare const featureBindingKinds: readonly ["server_enforcement", "browser_presentation", "usage_reporter", "funnel_trigger", "discovery"];
|
|
4
|
+
export declare const defaultRoots: string[];
|
|
5
|
+
export declare const ignoredSegments: Set<string>;
|
|
6
|
+
export declare const sensitivePathPattern: RegExp;
|
|
7
|
+
export declare const featureCatalogManifestSchema: z.ZodObject<{
|
|
8
|
+
environment: z.ZodEnum<{
|
|
9
|
+
test: "test";
|
|
10
|
+
production: "production";
|
|
11
|
+
}>;
|
|
12
|
+
features: z.ZodArray<z.ZodObject<{
|
|
13
|
+
accessModel: z.ZodEnum<{
|
|
14
|
+
boolean: "boolean";
|
|
15
|
+
limit: "limit";
|
|
16
|
+
}>;
|
|
17
|
+
aliases: z.ZodArray<z.ZodString>;
|
|
18
|
+
description: z.ZodString;
|
|
19
|
+
evidence: z.ZodArray<z.ZodObject<{
|
|
20
|
+
bindingIdentityFingerprint: z.ZodString;
|
|
21
|
+
bindingKind: z.ZodEnum<{
|
|
22
|
+
server_enforcement: "server_enforcement";
|
|
23
|
+
browser_presentation: "browser_presentation";
|
|
24
|
+
usage_reporter: "usage_reporter";
|
|
25
|
+
funnel_trigger: "funnel_trigger";
|
|
26
|
+
discovery: "discovery";
|
|
27
|
+
}>;
|
|
28
|
+
confidenceBasisPoints: z.ZodNumber;
|
|
29
|
+
file: z.ZodString;
|
|
30
|
+
fingerprint: z.ZodString;
|
|
31
|
+
line: z.ZodNumber;
|
|
32
|
+
rationale: z.ZodString;
|
|
33
|
+
symbol: z.ZodString;
|
|
34
|
+
}, z.core.$strict>>;
|
|
35
|
+
key: z.ZodString;
|
|
36
|
+
name: z.ZodString;
|
|
37
|
+
unit: z.ZodNullable<z.ZodString>;
|
|
38
|
+
}, z.core.$strict>>;
|
|
39
|
+
generatedBy: z.ZodLiteral<"saasfunnels features setup">;
|
|
40
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
41
|
+
}, z.core.$strict>;
|
|
42
|
+
export type FeatureCatalogManifest = z.infer<typeof featureCatalogManifestSchema>;
|
|
43
|
+
export type FeatureCandidate = {
|
|
44
|
+
accessModel: "boolean" | "limit";
|
|
45
|
+
bindingIdentityFingerprint: string;
|
|
46
|
+
bindingKind: (typeof featureBindingKinds)[number];
|
|
47
|
+
confidenceBasisPoints: number;
|
|
48
|
+
file: string;
|
|
49
|
+
fingerprint: string;
|
|
50
|
+
id: string;
|
|
51
|
+
line: number;
|
|
52
|
+
name: string;
|
|
53
|
+
rationale: string;
|
|
54
|
+
suggestedKey: string;
|
|
55
|
+
symbol: string;
|
|
56
|
+
unit: string | null;
|
|
57
|
+
};
|
|
58
|
+
export type FeatureSetupEdit = {
|
|
59
|
+
afterHash: string;
|
|
60
|
+
beforeHash: string | null;
|
|
61
|
+
diff: string;
|
|
62
|
+
id: string;
|
|
63
|
+
kind: "generated_constants" | "manifest";
|
|
64
|
+
path: string;
|
|
65
|
+
selected: boolean;
|
|
66
|
+
};
|
|
67
|
+
export type FeatureSetupInput = {
|
|
68
|
+
accept?: string[];
|
|
69
|
+
accountId?: string;
|
|
70
|
+
apiBaseUrl: string;
|
|
71
|
+
apply: boolean;
|
|
72
|
+
cwd: string;
|
|
73
|
+
environment: "test" | "production";
|
|
74
|
+
exclude?: string[];
|
|
75
|
+
fetch?: typeof fetch;
|
|
76
|
+
include?: string[];
|
|
77
|
+
manifestOnly: boolean;
|
|
78
|
+
mappings?: Record<string, string>;
|
|
79
|
+
prompt?: (message: string) => Promise<string>;
|
|
80
|
+
reject?: string[];
|
|
81
|
+
serverKey?: string;
|
|
82
|
+
};
|
|
83
|
+
export type FeatureRuntimeCheckResult = {
|
|
84
|
+
decision?: {
|
|
85
|
+
allowed: boolean;
|
|
86
|
+
reasonCode: string;
|
|
87
|
+
source: string;
|
|
88
|
+
value: unknown;
|
|
89
|
+
};
|
|
90
|
+
featureKey?: string;
|
|
91
|
+
reason?: string;
|
|
92
|
+
state: "failed" | "passed" | "skipped";
|
|
93
|
+
};
|
|
94
|
+
export type FeatureSetupResult = {
|
|
95
|
+
applied: boolean;
|
|
96
|
+
candidates: FeatureCandidate[];
|
|
97
|
+
changeRecordPath?: string;
|
|
98
|
+
edits: FeatureSetupEdit[];
|
|
99
|
+
environment: "test" | "production";
|
|
100
|
+
framework: {
|
|
101
|
+
framework: "nextjs" | "unsupported";
|
|
102
|
+
packageManager: "bun" | "npm" | "pnpm" | "unknown" | "yarn";
|
|
103
|
+
saasFunnelsPackages: string[];
|
|
104
|
+
roots: string[];
|
|
105
|
+
};
|
|
106
|
+
idempotent: boolean;
|
|
107
|
+
instructions: Array<{
|
|
108
|
+
featureKey: string;
|
|
109
|
+
file: string;
|
|
110
|
+
line: number;
|
|
111
|
+
message: string;
|
|
112
|
+
symbol: string;
|
|
113
|
+
}>;
|
|
114
|
+
manifest: FeatureCatalogManifest;
|
|
115
|
+
manifestPath: string;
|
|
116
|
+
ok: boolean;
|
|
117
|
+
reviewUrl: string;
|
|
118
|
+
runtimeCheck: {
|
|
119
|
+
featureKey?: string;
|
|
120
|
+
reason?: string;
|
|
121
|
+
state: "failed" | "passed" | "skipped";
|
|
122
|
+
};
|
|
123
|
+
scannedFileCount: number;
|
|
124
|
+
validation: {
|
|
125
|
+
errors: string[];
|
|
126
|
+
ok: boolean;
|
|
127
|
+
};
|
|
128
|
+
};
|
|
129
|
+
declare function readable(path: string): Promise<string | null>;
|
|
130
|
+
type FeatureSetupAtomicIo = {
|
|
131
|
+
mkdir: typeof mkdir;
|
|
132
|
+
read: typeof readable;
|
|
133
|
+
rename: typeof rename;
|
|
134
|
+
remove: typeof rm;
|
|
135
|
+
write: typeof writeFile;
|
|
136
|
+
};
|
|
137
|
+
export declare function applyFeatureSetupChangesAtomically(cwd: string, changes: Array<{
|
|
138
|
+
contents: string;
|
|
139
|
+
path: string;
|
|
140
|
+
}>, io?: FeatureSetupAtomicIo): Promise<void>;
|
|
141
|
+
export declare function validateFeatureCatalogManifest(value: unknown): {
|
|
142
|
+
errors: never[];
|
|
143
|
+
manifest: {
|
|
144
|
+
environment: "test" | "production";
|
|
145
|
+
features: {
|
|
146
|
+
accessModel: "boolean" | "limit";
|
|
147
|
+
aliases: string[];
|
|
148
|
+
description: string;
|
|
149
|
+
evidence: {
|
|
150
|
+
bindingIdentityFingerprint: string;
|
|
151
|
+
bindingKind: "server_enforcement" | "browser_presentation" | "usage_reporter" | "funnel_trigger" | "discovery";
|
|
152
|
+
confidenceBasisPoints: number;
|
|
153
|
+
file: string;
|
|
154
|
+
fingerprint: string;
|
|
155
|
+
line: number;
|
|
156
|
+
rationale: string;
|
|
157
|
+
symbol: string;
|
|
158
|
+
}[];
|
|
159
|
+
key: string;
|
|
160
|
+
name: string;
|
|
161
|
+
unit: string | null;
|
|
162
|
+
}[];
|
|
163
|
+
generatedBy: "saasfunnels features setup";
|
|
164
|
+
schemaVersion: 1;
|
|
165
|
+
};
|
|
166
|
+
ok: true;
|
|
167
|
+
} | {
|
|
168
|
+
errors: string[];
|
|
169
|
+
manifest: null;
|
|
170
|
+
ok: false;
|
|
171
|
+
};
|
|
172
|
+
export declare function readFeatureCatalogManifest(path: string): Promise<{
|
|
173
|
+
errors: never[];
|
|
174
|
+
manifest: {
|
|
175
|
+
environment: "test" | "production";
|
|
176
|
+
features: {
|
|
177
|
+
accessModel: "boolean" | "limit";
|
|
178
|
+
aliases: string[];
|
|
179
|
+
description: string;
|
|
180
|
+
evidence: {
|
|
181
|
+
bindingIdentityFingerprint: string;
|
|
182
|
+
bindingKind: "server_enforcement" | "browser_presentation" | "usage_reporter" | "funnel_trigger" | "discovery";
|
|
183
|
+
confidenceBasisPoints: number;
|
|
184
|
+
file: string;
|
|
185
|
+
fingerprint: string;
|
|
186
|
+
line: number;
|
|
187
|
+
rationale: string;
|
|
188
|
+
symbol: string;
|
|
189
|
+
}[];
|
|
190
|
+
key: string;
|
|
191
|
+
name: string;
|
|
192
|
+
unit: string | null;
|
|
193
|
+
}[];
|
|
194
|
+
generatedBy: "saasfunnels features setup";
|
|
195
|
+
schemaVersion: 1;
|
|
196
|
+
};
|
|
197
|
+
ok: true;
|
|
198
|
+
} | {
|
|
199
|
+
errors: string[];
|
|
200
|
+
manifest: null;
|
|
201
|
+
ok: false;
|
|
202
|
+
}>;
|
|
203
|
+
export declare function isFeatureKey(value: string): boolean;
|
|
204
|
+
export declare function runFeatureRuntimeCheck(input: {
|
|
205
|
+
accountId?: string;
|
|
206
|
+
apiBaseUrl: string;
|
|
207
|
+
featureKey?: string;
|
|
208
|
+
fetch?: typeof fetch;
|
|
209
|
+
serverKey?: string;
|
|
210
|
+
}): Promise<FeatureRuntimeCheckResult>;
|
|
211
|
+
export declare function runFeatureSetup(input: FeatureSetupInput): Promise<FeatureSetupResult>;
|
|
212
|
+
export declare function parseFeatureMappings(values: string[]): {
|
|
213
|
+
[k: string]: string;
|
|
214
|
+
};
|
|
215
|
+
export declare function parseFeatureManifestSource(source: string): {
|
|
216
|
+
errors: never[];
|
|
217
|
+
manifest: {
|
|
218
|
+
environment: "test" | "production";
|
|
219
|
+
features: {
|
|
220
|
+
accessModel: "boolean" | "limit";
|
|
221
|
+
aliases: string[];
|
|
222
|
+
description: string;
|
|
223
|
+
evidence: {
|
|
224
|
+
bindingIdentityFingerprint: string;
|
|
225
|
+
bindingKind: "server_enforcement" | "browser_presentation" | "usage_reporter" | "funnel_trigger" | "discovery";
|
|
226
|
+
confidenceBasisPoints: number;
|
|
227
|
+
file: string;
|
|
228
|
+
fingerprint: string;
|
|
229
|
+
line: number;
|
|
230
|
+
rationale: string;
|
|
231
|
+
symbol: string;
|
|
232
|
+
}[];
|
|
233
|
+
key: string;
|
|
234
|
+
name: string;
|
|
235
|
+
unit: string | null;
|
|
236
|
+
}[];
|
|
237
|
+
generatedBy: "saasfunnels features setup";
|
|
238
|
+
schemaVersion: 1;
|
|
239
|
+
};
|
|
240
|
+
ok: true;
|
|
241
|
+
} | {
|
|
242
|
+
errors: string[];
|
|
243
|
+
manifest: null;
|
|
244
|
+
ok: false;
|
|
245
|
+
};
|
|
246
|
+
export declare function buildFeatureInstrumentationHandoff(input: {
|
|
247
|
+
discoveryRoots?: readonly string[];
|
|
248
|
+
manifest: FeatureCatalogManifest;
|
|
249
|
+
producer?: "cli" | "github_action" | "github_app";
|
|
250
|
+
repositoryKey: string;
|
|
251
|
+
repositoryRevision: string;
|
|
252
|
+
scanRole?: "series" | "candidate";
|
|
253
|
+
sdkVersions?: readonly string[];
|
|
254
|
+
validatedAt?: string;
|
|
255
|
+
}): unknown;
|
|
256
|
+
export declare function featureSdkVersionsFromPackageJson(value: unknown): string[];
|
|
257
|
+
export declare function featureSetupSummary(result: FeatureSetupResult): string;
|
|
258
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare const SAASFUNNELS_CLI_NAME = "saasfunnels";
|
|
2
|
+
export declare const SAASFUNNELS_CLI_VERSION = "0.2.1";
|
|
3
|
+
export declare const SAASFUNNELS_PRODUCT_NAME = "SaaSFunnels";
|
|
4
|
+
export declare const SAASFUNNELS_DEFAULT_API_BASE_URL = "https://app.saasfunnels.ai";
|
|
5
|
+
export declare const SAASFUNNELS_ENV: Readonly<{
|
|
6
|
+
apiBaseUrl: string[];
|
|
7
|
+
apiKey: string[];
|
|
8
|
+
funnelsServerKey: string[];
|
|
9
|
+
ingestApiKey: string[];
|
|
10
|
+
mcpEnableFunnelWrites: string[];
|
|
11
|
+
mcpEnableFunnelTests: string[];
|
|
12
|
+
mcpEnableSendTestEvent: string[];
|
|
13
|
+
}>;
|
|
14
|
+
export declare function saasFunnelsPublicText(value: string): string;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { formatFeatureDriftCheckSummary, type FeatureDriftEntry, type FeatureDriftRejection, } from "./check-summary.js";
|
|
2
|
+
export { callSaaSFunnelsMcpTool, handleSaaSFunnelsMcpMessage, hostedSaaSFunnelsMcpToolDefinitions, readSaaSFunnelsMcpResource, saasFunnelsMcpCapabilityForTool, saasFunnelsMcpResources, saasFunnelsMcpToolCapabilityIds, saasFunnelsMcpToolDefinitions, SAASFUNNELS_MCP_PROTOCOL_VERSION, SAASFUNNELS_MCP_SERVER_VERSION, serveSaaSFunnelsMcp, type SaaSFunnelsMcpJsonObject, type SaaSFunnelsMcpOptions, type SaaSFunnelsMcpResourceDefinition, type SaaSFunnelsMcpToolDefinition, type SaaSFunnelsMcpToolName, } from "./mcp.js";
|
|
3
|
+
export { SAASFUNNELS_CLI_NAME, SAASFUNNELS_CLI_VERSION, SAASFUNNELS_DEFAULT_API_BASE_URL, SAASFUNNELS_ENV, SAASFUNNELS_PRODUCT_NAME, } from "./identity.js";
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { type AgentCapabilityId } from "./capabilities.js";
|
|
2
|
+
type McpEnv = Record<string, string | undefined>;
|
|
3
|
+
export type SaaSFunnelsMcpJsonObject = Record<string, unknown>;
|
|
4
|
+
type JsonObject = SaaSFunnelsMcpJsonObject;
|
|
5
|
+
type JsonRpcId = number | string | null;
|
|
6
|
+
type JsonRpcResponse = {
|
|
7
|
+
error?: {
|
|
8
|
+
code: number;
|
|
9
|
+
data?: unknown;
|
|
10
|
+
message: string;
|
|
11
|
+
};
|
|
12
|
+
id: JsonRpcId;
|
|
13
|
+
jsonrpc: "2.0";
|
|
14
|
+
result?: unknown;
|
|
15
|
+
};
|
|
16
|
+
export type SaaSFunnelsMcpToolDefinition = {
|
|
17
|
+
annotations?: Record<string, unknown>;
|
|
18
|
+
description: string;
|
|
19
|
+
inputSchema: JsonObject;
|
|
20
|
+
name: string;
|
|
21
|
+
outputSchema?: JsonObject;
|
|
22
|
+
title: string;
|
|
23
|
+
};
|
|
24
|
+
type McpToolDefinition = SaaSFunnelsMcpToolDefinition;
|
|
25
|
+
export type SaaSFunnelsMcpResourceDefinition = {
|
|
26
|
+
description: string;
|
|
27
|
+
mimeType: string;
|
|
28
|
+
name: string;
|
|
29
|
+
title: string;
|
|
30
|
+
uri: string;
|
|
31
|
+
};
|
|
32
|
+
type McpResourceDefinition = SaaSFunnelsMcpResourceDefinition;
|
|
33
|
+
export declare const saasFunnelsMcpToolCapabilityIds: {
|
|
34
|
+
readonly get_account_strategy: "account.strategy.read";
|
|
35
|
+
readonly apply_funnel_entry: "funnel.entry.apply";
|
|
36
|
+
readonly generate_direct_api_handoff: "developer.handoff.generate";
|
|
37
|
+
readonly get_integration_health: "developer.workspace.read";
|
|
38
|
+
readonly get_signal_payload_preview: "developer.workspace.read";
|
|
39
|
+
readonly get_workspace_readiness: "developer.workspace.read";
|
|
40
|
+
readonly inspect_funnel_entry: "funnel.entry.inspect";
|
|
41
|
+
readonly list_mapping_gaps: "developer.workspace.read";
|
|
42
|
+
readonly list_recent_signals: "developer.workspace.read";
|
|
43
|
+
readonly simulate_account_funnel_fit: "account.funnel_fit.simulate";
|
|
44
|
+
readonly propose_funnel_entry_installation: "funnel.entry.plan";
|
|
45
|
+
readonly run_funnel_binding_test: "funnel.entry.test";
|
|
46
|
+
readonly send_test_event: "setup.test_event.send";
|
|
47
|
+
readonly submit_funnel_entry_evidence: "funnel.entry.evidence.submit";
|
|
48
|
+
readonly validate_event_payload: "developer.event.validate";
|
|
49
|
+
readonly validate_feature_catalog_manifest: "developer.feature_manifest.validate";
|
|
50
|
+
};
|
|
51
|
+
export type SaaSFunnelsMcpToolName = keyof typeof saasFunnelsMcpToolCapabilityIds;
|
|
52
|
+
export declare function saasFunnelsMcpCapabilityForTool(name: string): {
|
|
53
|
+
boundaries: ("api_key" | "hosted_mcp" | "in_app" | "local_cli" | "local_mcp" | "scheduled_agent")[];
|
|
54
|
+
enabled: true;
|
|
55
|
+
id: AgentCapabilityId;
|
|
56
|
+
operationClass: "external_write" | "plan" | "prepare" | "read" | "reversible_write" | "simulate" | "validate";
|
|
57
|
+
} | null;
|
|
58
|
+
export type SaaSFunnelsMcpOptions = {
|
|
59
|
+
apiBaseUrlOverride?: string;
|
|
60
|
+
allowFunnelWrites?: boolean;
|
|
61
|
+
allowFunnelTests?: boolean;
|
|
62
|
+
allowTestWrites?: boolean;
|
|
63
|
+
authorizationHeader?: string;
|
|
64
|
+
env?: McpEnv;
|
|
65
|
+
fetch?: typeof fetch;
|
|
66
|
+
hostedMode?: boolean;
|
|
67
|
+
input?: NodeJS.ReadableStream;
|
|
68
|
+
output?: Pick<NodeJS.WritableStream, "write">;
|
|
69
|
+
};
|
|
70
|
+
declare const mcpProtocolVersion = "2025-06-18";
|
|
71
|
+
declare const mcpServerVersion = "0.2.1";
|
|
72
|
+
export declare function saasFunnelsMcpResources(): McpResourceDefinition[];
|
|
73
|
+
export declare function readSaaSFunnelsMcpResource(uri: string, options?: SaaSFunnelsMcpOptions): string;
|
|
74
|
+
export declare function saasFunnelsMcpToolDefinitions({ allowFunnelTests, allowFunnelWrites, allowTestWrites, includeHostedAccountTools, }?: {
|
|
75
|
+
allowFunnelTests?: boolean;
|
|
76
|
+
allowFunnelWrites?: boolean;
|
|
77
|
+
allowTestWrites?: boolean;
|
|
78
|
+
includeHostedAccountTools?: boolean;
|
|
79
|
+
}): McpToolDefinition[];
|
|
80
|
+
export declare function hostedSaaSFunnelsMcpToolDefinitions(): SaaSFunnelsMcpToolDefinition[];
|
|
81
|
+
export declare function callSaaSFunnelsMcpTool(name: string, args: JsonObject, options?: SaaSFunnelsMcpOptions): Promise<{
|
|
82
|
+
content: {
|
|
83
|
+
text: string;
|
|
84
|
+
type: string;
|
|
85
|
+
}[];
|
|
86
|
+
isError: boolean;
|
|
87
|
+
structuredContent: SaaSFunnelsMcpJsonObject;
|
|
88
|
+
}>;
|
|
89
|
+
export declare function handleSaaSFunnelsMcpMessage(message: unknown, options?: SaaSFunnelsMcpOptions): Promise<JsonRpcResponse | undefined>;
|
|
90
|
+
export declare function serveSaaSFunnelsMcp(options?: SaaSFunnelsMcpOptions): Promise<void>;
|
|
91
|
+
export { mcpProtocolVersion as SAASFUNNELS_MCP_PROTOCOL_VERSION, mcpServerVersion as SAASFUNNELS_MCP_SERVER_VERSION, };
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
export type DeveloperToolEventSource = "direct" | "posthog" | "segment";
|
|
2
|
+
|
|
3
|
+
export type DeveloperToolValidationIssue = {
|
|
4
|
+
code: string;
|
|
5
|
+
message: string;
|
|
6
|
+
path?: string;
|
|
7
|
+
severity: "error" | "info" | "warning";
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export type DeveloperToolSourceContract = {
|
|
11
|
+
auth_summary: string;
|
|
12
|
+
docs_url: string;
|
|
13
|
+
endpoint: string;
|
|
14
|
+
key: DeveloperToolEventSource;
|
|
15
|
+
name: string;
|
|
16
|
+
recommended_allowlist: string[];
|
|
17
|
+
required_fields: string[];
|
|
18
|
+
sample_payload: Record<string, unknown>;
|
|
19
|
+
scope: string;
|
|
20
|
+
setup_steps: string[];
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export const DEVELOPER_TOOLS_CONTRACT_SCHEMA_VERSION: string;
|
|
24
|
+
export const developerToolEventSources: readonly DeveloperToolEventSource[];
|
|
25
|
+
export const eventKinds: readonly string[];
|
|
26
|
+
export const eventSentimentSources: readonly string[];
|
|
27
|
+
export const eventSentiments: readonly string[];
|
|
28
|
+
export const semanticEventTypes: readonly string[];
|
|
29
|
+
export const signalFamilyContracts: readonly Array<{
|
|
30
|
+
description: string;
|
|
31
|
+
label: string;
|
|
32
|
+
optionalSemanticTypes: string[];
|
|
33
|
+
requiredSemanticTypes: string[];
|
|
34
|
+
signalFamilyKey: string;
|
|
35
|
+
}>;
|
|
36
|
+
|
|
37
|
+
export const featureInstrumentationManifestSchema: import("zod").ZodTypeAny;
|
|
38
|
+
|
|
39
|
+
export function getDeveloperToolAgentHandoffArtifacts(input: {
|
|
40
|
+
endpoint: string;
|
|
41
|
+
eventPlan?: unknown;
|
|
42
|
+
}): Record<
|
|
43
|
+
"claude-code" | "codex" | "cursor" | "markdown",
|
|
44
|
+
{
|
|
45
|
+
file_contents: string;
|
|
46
|
+
install_command?: string;
|
|
47
|
+
label: string;
|
|
48
|
+
prompt: string;
|
|
49
|
+
target: string;
|
|
50
|
+
target_path: string;
|
|
51
|
+
version: string;
|
|
52
|
+
}
|
|
53
|
+
>;
|
|
54
|
+
|
|
55
|
+
export function getDeveloperToolSourceContract(
|
|
56
|
+
source: DeveloperToolEventSource,
|
|
57
|
+
): DeveloperToolSourceContract;
|
|
58
|
+
|
|
59
|
+
export function validateDeveloperToolEventPayload(input: {
|
|
60
|
+
payload: unknown;
|
|
61
|
+
source: DeveloperToolEventSource;
|
|
62
|
+
}): {
|
|
63
|
+
errors: DeveloperToolValidationIssue[];
|
|
64
|
+
idempotency: Record<string, unknown>;
|
|
65
|
+
mapping_hints: Record<string, unknown>;
|
|
66
|
+
normalized_event?: Record<string, unknown>;
|
|
67
|
+
ok: boolean;
|
|
68
|
+
redaction: Record<string, unknown>;
|
|
69
|
+
revenue_relevant?: boolean;
|
|
70
|
+
schema_version: string;
|
|
71
|
+
source: DeveloperToolEventSource;
|
|
72
|
+
warnings: DeveloperToolValidationIssue[];
|
|
73
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "saasfunnels",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "SaaSFunnels CLI and local stdio MCP server",
|
|
6
6
|
"author": "SaaSFunnels",
|
|
@@ -24,20 +24,26 @@
|
|
|
24
24
|
"bin": {
|
|
25
25
|
"saasfunnels": "dist/saasfunnels.js"
|
|
26
26
|
},
|
|
27
|
+
"exports": {
|
|
28
|
+
"./library": {
|
|
29
|
+
"types": "./dist/types/library.d.ts",
|
|
30
|
+
"import": "./dist/library.js"
|
|
31
|
+
}
|
|
32
|
+
},
|
|
27
33
|
"engines": {
|
|
28
34
|
"node": ">=22"
|
|
29
35
|
},
|
|
30
36
|
"files": [
|
|
31
37
|
"LICENSE",
|
|
32
38
|
"README.md",
|
|
33
|
-
"dist
|
|
39
|
+
"dist"
|
|
34
40
|
],
|
|
35
41
|
"license": "MIT",
|
|
36
42
|
"publishConfig": {
|
|
37
43
|
"access": "public",
|
|
38
|
-
"provenance":
|
|
44
|
+
"provenance": true,
|
|
39
45
|
"registry": "https://registry.npmjs.org/",
|
|
40
|
-
"tag": "
|
|
46
|
+
"tag": "latest"
|
|
41
47
|
},
|
|
42
48
|
"scripts": {
|
|
43
49
|
"build": "node scripts/build.mjs",
|
|
@@ -51,7 +57,8 @@
|
|
|
51
57
|
"verify:metadata": "node scripts/verify-package-metadata.mjs",
|
|
52
58
|
"verify:pack": "node scripts/verify-pack.mjs",
|
|
53
59
|
"verify:installed": "node scripts/smoke-installed-package.mjs",
|
|
54
|
-
"release:verify": "npm run typecheck && npm test && npm run security:secrets && npm run security:audit && npm run verify:metadata && npm run verify:pack && npm run verify:installed"
|
|
60
|
+
"release:verify": "npm run typecheck && npm test && npm run security:secrets && npm run security:audit && npm run verify:metadata && npm run verify:pack && npm run verify:installed",
|
|
61
|
+
"eval": "node eval/run.mjs"
|
|
55
62
|
},
|
|
56
63
|
"devDependencies": {
|
|
57
64
|
"@npmcli/package-json": "7.0.5",
|