saasfunnels 0.4.1 → 0.4.3

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 CHANGED
@@ -146,3 +146,84 @@ file. No source files or credentials belong in either upload.
146
146
  Changes to those files or application source require a fresh run. Use `--resume`
147
147
  only for unchanged interrupted work. The scan identity includes reviewed inputs
148
148
  and scanner contract version, so accepted old submissions cannot hide corrections.
149
+
150
+ ### Lifecycle findings for Funnel preparation
151
+
152
+ The plans stage can also submit `.saasfunnels/setup-lifecycle.json`, a JSON array
153
+ of reviewed application findings. The coding agent should inspect the actual
154
+ billing and entitlement code and include only established facts with relative
155
+ source paths and line numbers. This file is a structured discovery input, not an
156
+ authorization to change subscriptions or publish Funnels. It is sent only through
157
+ the existing approved setup upload.
158
+
159
+ Each finding has `family`, `subjectKey`, `state` (`supported`, `not_applicable`, or
160
+ `unknown`), `provenance`, `reason`, nullable `entry`/`action`, and family-specific
161
+ `terms`. For example:
162
+
163
+ ```json
164
+ [
165
+ {
166
+ "family": "trial_conversion",
167
+ "subjectKey": null,
168
+ "state": "supported",
169
+ "provenance": [{ "file": "src/billing.ts", "line": 42 }],
170
+ "reason": "Subscription creation configures a trial.",
171
+ "entry": null,
172
+ "action": null,
173
+ "terms": {
174
+ "durationDays": 14,
175
+ "endBehavior": "paid_conversion",
176
+ "paymentRequirement": "required",
177
+ "paidPlanKey": "pro"
178
+ }
179
+ }
180
+ ]
181
+ ```
182
+
183
+ These example terms are not defaults. Use `null`/`unknown` for unresolved terms
184
+ and real discovered keys for references. Supported families and their terms are:
185
+
186
+ - `trial_conversion`: durationDays, endBehavior, paymentRequirement, paidPlanKey.
187
+ - `feature_trial`: durationDays, endBehavior, paymentRequirement, trialKey; subjectKey identifies the feature.
188
+ - `cancellation_save`: cancellationTiming.
189
+ - `failed_payment_recovery`: recoveryAction, providerRecovery.
190
+ - `reactivation`: restoration, paidPlanKey.
191
+ - `seat_expansion` and `add_on_expansion`: quantitySourceKey, quantityBasis, includedQuantity, billingTiming; subjectKey identifies the quantity dimension or add-on.
192
+
193
+ See `src/setup-lifecycle-contract.ts` for the exact enum values and bounds. Missing
194
+ findings do not establish that a journey is unsupported. A supported or
195
+ not-applicable finding requires source evidence. Do not infer cancellation,
196
+ recovery, restoration or seat semantics from a plan name. Runtime connection
197
+ verification always remains a separate application check; submitted connections
198
+ are classified as discovered even when a local declaration says tested.
199
+
200
+ Changes to this file require a fresh scan; `--resume` rejects changed input.
201
+ Files larger than 200 KB, invalid or duplicate findings, and sensitive source
202
+ paths are rejected. No raw source or credentials belong in the findings. This
203
+ structured input path does not itself automatically infer lifecycle behavior
204
+ from arbitrary application code.
205
+
206
+ During the ordinary source scan, Setup also discovers a bounded set of billing
207
+ patterns automatically. It recognizes a locally imported Stripe client, literal
208
+ subscription/Checkout `trial_period_days`, trial-end settings needing review,
209
+ subscription cancellation calls and `cancel_at_period_end`. An invoice-payment
210
+ call is surfaced as an unknown recovery capability, because ordinary invoice
211
+ payment does not establish failed-payment recovery.
212
+
213
+ Findings contain only structured terms and source locations. Payment collection,
214
+ application access after expiry, destination plans, entry/action bindings and
215
+ provider recovery policies remain unknown unless reviewed evidence establishes
216
+ them. Conflicting durations or cancellation timings remain unknown rather than
217
+ being resolved by file order. Source declarations do not prove installation.
218
+ Tests, demos, ignored/sensitive files, shadowed clients and ambiguous expressions
219
+ are excluded. This first recognizer handles direct JavaScript/TypeScript client
220
+ calls; imported client factories, other languages, new item-level Trial Offer
221
+ APIs and custom lifecycle implementations still need reviewed evidence. Explicit
222
+ reviewed declarations take precedence per family/subject, as with reviewed
223
+ pricing declarations; they are still presented for workspace approval.
224
+
225
+ Provider references: [subscription cancellation](https://docs.stripe.com/billing/subscriptions/cancel),
226
+ [Checkout free trials](https://docs.stripe.com/payments/checkout/free-trials), and
227
+ [invoice payment](https://docs.stripe.com/api/invoices/pay). New
228
+ [Trial Offers](https://docs.stripe.com/billing/subscriptions/trials) are a different
229
+ contract; this recognizer does not infer their terms from older trial parameters.
package/dist/library.js CHANGED
@@ -235858,7 +235858,7 @@ function validateFeatureCatalogManifest(value) {
235858
235858
 
235859
235859
  // src/identity.ts
235860
235860
  var SAASFUNNELS_CLI_NAME = "saasfunnels";
235861
- var SAASFUNNELS_CLI_VERSION = "0.4.1";
235861
+ var SAASFUNNELS_CLI_VERSION = "0.4.3";
235862
235862
  var SAASFUNNELS_PRODUCT_NAME = "SaaSFunnels";
235863
235863
  var SAASFUNNELS_DEFAULT_API_BASE_URL = "https://app.saasfunnels.ai";
235864
235864
  var SAASFUNNELS_ENV = Object.freeze({