scaledthought 0.3.4 → 0.3.5

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
@@ -36,7 +36,9 @@ account could be sent: a `us` account that signed up with an ad click and hasn't
36
36
  `ad_measurement_opt_out` (the stored preference). Neither flag is a secret.
37
37
 
38
38
  Inference is prepaid, and a new account has no credits: until your human pays, completions return
39
- `402 insufficient_credits`. So the first thing after `init` is a top-up your human approves:
39
+ `402 insufficient_credits`. (Only when `init` prints `"trial": "after_email_confirmation"`: the account should get
40
+ limited usage to try it once your human confirms their email, in the US region while that offer lasts; its `next_steps`
41
+ say what to do. Otherwise, or once that is used, top up as below.) So the first thing after `init` is usually a top-up your human approves:
40
42
 
41
43
  ```bash
42
44
  npx -y scaledthought@0.3 billing topup --amount-usd 20 # prints approval_url and topup_id
package/dist/index.js CHANGED
@@ -581,7 +581,7 @@ import { join } from "node:path";
581
581
  // package.json
582
582
  var package_default = {
583
583
  name: "scaledthought",
584
- version: "0.3.4",
584
+ version: "0.3.5",
585
585
  description: "OpenAI-compatible inference for open-weight models, set up by your coding agent. Prepaid, pay per token, no subscription. US live; Canada coming soon.",
586
586
  license: "MIT",
587
587
  keywords: [
@@ -724,6 +724,7 @@ var HINTS = {
724
724
  network_error: "Could not reach the API. Check the network (and ST_API_URL / ST_BASE_URL if set). Safe to retry.",
725
725
  bad_region: "Use --region us or --region ca.",
726
726
  confirmation_mismatch: "Pass your own account id: `account delete --confirm <account_id>` (see `account`).",
727
+ signup_rate_limited: "Don't create another account. Reuse an existing account's key, or have your human buy credits on one (`billing topup`) or sign in to its dashboard. If the error has retry_after, you may retry after that many seconds.",
727
728
  region_not_open: "This region doesn't take new accounts yet. Run `init --region us` for a US account, or check scaledthought.com.",
728
729
  bad_argument: "Pass a positive number.",
729
730
  usage_error: "Run the command with --help for its flags."
@@ -8945,6 +8946,22 @@ var REPLAY_MAX_CHUNKS_PER_SEGMENT = 360;
8945
8946
 
8946
8947
  // ../../packages/growth/src/insights.ts
8947
8948
  var TRACKED_COUNTRIES = ["US", "CA"];
8949
+ var COVERAGE_REASONS = [
8950
+ "tracked",
8951
+ "no_fetch_metadata",
8952
+ "not_a_page",
8953
+ "gpc",
8954
+ "dnt",
8955
+ "opted_out",
8956
+ "country",
8957
+ "subdivision",
8958
+ "not_a_browser"
8959
+ ];
8960
+ var SiteCoverage = object({
8961
+ country: string2().regex(/^[A-Z]{2}$/),
8962
+ reason: _enum(COVERAGE_REASONS)
8963
+ }).strict();
8964
+ var SiteCoverageHit = object({ coverage: SiteCoverage }).strict();
8948
8965
  var Ms = number2().int().nonnegative();
8949
8966
  var Path = string2().regex(/^\/[^\s?#]{0,199}$/);
8950
8967
  var Selector = string2().min(1).max(200);
@@ -9997,7 +10014,7 @@ var SiteTouch = object({
9997
10014
  }).strict();
9998
10015
  var SiteTouchHit = object({ touch: SiteTouch }).strict();
9999
10016
  // ../../packages/schemas/src/legal.ts
10000
- var TERMS_VERSION = "2026-10-13";
10017
+ var TERMS_VERSION = "2026-10-13.2";
10001
10018
  var LEGAL_SITE = "https://scaledthought.com";
10002
10019
  var LEGAL_PATHS = {
10003
10020
  index: "/legal",
@@ -10011,7 +10028,7 @@ var TERMS_URL = `${LEGAL_SITE}${LEGAL_PATHS.terms}`;
10011
10028
  var PRIVACY_URL = `${LEGAL_SITE}${LEGAL_PATHS.privacy}`;
10012
10029
  var ACCEPTABLE_USE_URL = `${LEGAL_SITE}${LEGAL_PATHS.acceptableUse}`;
10013
10030
  var REFUND_POLICY_URL = `${LEGAL_SITE}${LEGAL_PATHS.creditsAndRefunds}`;
10014
- var TERMS_NOTICE = `Nothing has been accepted on your behalf. You accept the ScaledThought Terms of Service (${TERMS_URL}) and the ` + `Credits & Refunds policy (${REFUND_POLICY_URL}) yourself when you buy credits. Privacy Policy: ${PRIVACY_URL}.`;
10031
+ var TERMS_NOTICE = `Nothing has been accepted on your behalf. You accept the ScaledThought Terms of Service (${TERMS_URL}) and the ` + `Credits & Refunds policy (${REFUND_POLICY_URL}) yourself when you buy credits (or, while a trial credit is offered, ` + `when you accept them on the email confirmation page to receive it). Privacy Policy: ${PRIVACY_URL}.`;
10015
10032
 
10016
10033
  // src/connect.ts
10017
10034
  import { chmodSync as chmodSync2, existsSync as existsSync3, mkdirSync as mkdirSync2, readFileSync as readFileSync4, rmSync, writeFileSync as writeFileSync2 } from "node:fs";
@@ -10516,6 +10533,7 @@ var CREDIT_STEPS = [
10516
10533
  var OWNER_EMAIL_QUESTION = "What email should own this account? You'll use it to sign in to the ScaledThought dashboard (billing, credits, keys). We only send it account email, such as this confirmation, sign-in links and security notices, never marketing.";
10517
10534
  var OWNER_EMAIL_COMMAND = `${NPX} account email set <their email>`;
10518
10535
  var OWNER_EMAIL_STEP = `This account has no owner email yet. Ask your human one question: "${OWNER_EMAIL_QUESTION}" Then run: ${OWNER_EMAIL_COMMAND} (we email them one confirmation link; relay message_for_human). If they'd rather not, carry on without it.`;
10536
+ var TRIAL_STEP = `Try it free: once your human clicks the confirmation link we emailed them and ticks the box accepting the Terms on that page (relay message_for_human), this account should get limited free usage to try it (US region, while available). After they confirm, run ${NPX} billing status: if balance_usd is above 0, make the call below; if it is still 0, do the top-up steps. When completions later return 402 insufficient_credits, the free usage is used up: do the top-up steps.`;
10519
10537
  function ownerEmailFields(given, r) {
10520
10538
  const owner = r.owner_email ?? (r.email_confirmation === "sent" ? "pending" : given ? undefined : "none");
10521
10539
  return {
@@ -10656,6 +10674,7 @@ async function init(ctx, opts) {
10656
10674
  ...owner,
10657
10675
  ...summary,
10658
10676
  ...owner.missing ? { next_steps: [OWNER_EMAIL_STEP, ...summary.next_steps] } : {},
10677
+ ...acct.trial === "after_email_confirmation" && summary.needs_credits ? { trial: acct.trial, next_steps: [TRIAL_STEP, ...summary.next_steps] } : {},
10659
10678
  ...attribution.warnings.length ? { warnings: attribution.warnings } : {}
10660
10679
  };
10661
10680
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "scaledthought",
3
- "version": "0.3.4",
3
+ "version": "0.3.5",
4
4
  "description": "OpenAI-compatible inference for open-weight models, set up by your coding agent. Prepaid, pay per token, no subscription. US live; Canada coming soon.",
5
5
  "license": "MIT",
6
6
  "keywords": [