atmn 2.0.137 → 2.0.139
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/dist/bin.js +67 -6
- package/package.json +2 -2
- package/src/actions/login/keyless.ts +7 -2
- package/src/auth/keyless.ts +5 -3
- package/src/generated/apiRoutes.ts +70 -0
- package/src/generated/skills.ts +2 -2
package/dist/bin.js
CHANGED
|
@@ -1147,6 +1147,18 @@ var API_ROUTES = [
|
|
|
1147
1147
|
required: false,
|
|
1148
1148
|
description: "Custom line items that override the auto-generated proration invoice. Only valid for immediate plan changes (eg. upgrades or one off plans)."
|
|
1149
1149
|
},
|
|
1150
|
+
{
|
|
1151
|
+
name: "remove_lines",
|
|
1152
|
+
type: "json",
|
|
1153
|
+
required: false,
|
|
1154
|
+
description: "Lines to remove from the invoice this request creates. Never changes the subscription or later invoices."
|
|
1155
|
+
},
|
|
1156
|
+
{
|
|
1157
|
+
name: "add_lines",
|
|
1158
|
+
type: "json",
|
|
1159
|
+
required: false,
|
|
1160
|
+
description: "Lines to add to the invoice this request creates. Never changes the subscription or later invoices."
|
|
1161
|
+
},
|
|
1150
1162
|
{
|
|
1151
1163
|
name: "processor_subscription_id",
|
|
1152
1164
|
type: "string",
|
|
@@ -1574,6 +1586,18 @@ var API_ROUTES = [
|
|
|
1574
1586
|
required: false,
|
|
1575
1587
|
description: "Custom line items that override the auto-generated proration invoice. Only valid for immediate plan changes (eg. upgrades or one off plans)."
|
|
1576
1588
|
},
|
|
1589
|
+
{
|
|
1590
|
+
name: "remove_lines",
|
|
1591
|
+
type: "json",
|
|
1592
|
+
required: false,
|
|
1593
|
+
description: "Lines to remove from the invoice this request creates. Never changes the subscription or later invoices."
|
|
1594
|
+
},
|
|
1595
|
+
{
|
|
1596
|
+
name: "add_lines",
|
|
1597
|
+
type: "json",
|
|
1598
|
+
required: false,
|
|
1599
|
+
description: "Lines to add to the invoice this request creates. Never changes the subscription or later invoices."
|
|
1600
|
+
},
|
|
1577
1601
|
{
|
|
1578
1602
|
name: "processor_subscription_id",
|
|
1579
1603
|
type: "string",
|
|
@@ -1854,6 +1878,18 @@ var API_ROUTES = [
|
|
|
1854
1878
|
required: false,
|
|
1855
1879
|
description: "Custom line items that replace the auto-generated proration invoice, or bill a standalone invoice when nothing else changes. Only valid on an existing recurring subscription."
|
|
1856
1880
|
},
|
|
1881
|
+
{
|
|
1882
|
+
name: "remove_lines",
|
|
1883
|
+
type: "json",
|
|
1884
|
+
required: false,
|
|
1885
|
+
description: "Lines to remove from the invoice this request creates. Never changes the subscription or later invoices."
|
|
1886
|
+
},
|
|
1887
|
+
{
|
|
1888
|
+
name: "add_lines",
|
|
1889
|
+
type: "json",
|
|
1890
|
+
required: false,
|
|
1891
|
+
description: "Lines to add to the invoice this request creates. Never changes the subscription or later invoices."
|
|
1892
|
+
},
|
|
1857
1893
|
{
|
|
1858
1894
|
name: "cancel_action",
|
|
1859
1895
|
type: "string",
|
|
@@ -1995,6 +2031,18 @@ var API_ROUTES = [
|
|
|
1995
2031
|
required: false,
|
|
1996
2032
|
description: "Custom line items that replace the auto-generated proration invoice, or bill a standalone invoice when nothing else changes. Only valid on an existing recurring subscription."
|
|
1997
2033
|
},
|
|
2034
|
+
{
|
|
2035
|
+
name: "remove_lines",
|
|
2036
|
+
type: "json",
|
|
2037
|
+
required: false,
|
|
2038
|
+
description: "Lines to remove from the invoice this request creates. Never changes the subscription or later invoices."
|
|
2039
|
+
},
|
|
2040
|
+
{
|
|
2041
|
+
name: "add_lines",
|
|
2042
|
+
type: "json",
|
|
2043
|
+
required: false,
|
|
2044
|
+
description: "Lines to add to the invoice this request creates. Never changes the subscription or later invoices."
|
|
2045
|
+
},
|
|
1998
2046
|
{
|
|
1999
2047
|
name: "cancel_action",
|
|
2000
2048
|
type: "string",
|
|
@@ -2253,6 +2301,18 @@ var API_ROUTES = [
|
|
|
2253
2301
|
required: false,
|
|
2254
2302
|
description: "Custom line items that override the auto-generated proration invoice. Only valid for immediate plan changes (eg. upgrades or one off plans)."
|
|
2255
2303
|
},
|
|
2304
|
+
{
|
|
2305
|
+
name: "remove_lines",
|
|
2306
|
+
type: "json",
|
|
2307
|
+
required: false,
|
|
2308
|
+
description: "Lines to remove from the invoice this request creates. Never changes the subscription or later invoices."
|
|
2309
|
+
},
|
|
2310
|
+
{
|
|
2311
|
+
name: "add_lines",
|
|
2312
|
+
type: "json",
|
|
2313
|
+
required: false,
|
|
2314
|
+
description: "Lines to add to the invoice this request creates. Never changes the subscription or later invoices."
|
|
2315
|
+
},
|
|
2256
2316
|
{
|
|
2257
2317
|
name: "processor_subscription_id",
|
|
2258
2318
|
type: "string",
|
|
@@ -7696,7 +7756,7 @@ var createClient = (options) => ({
|
|
|
7696
7756
|
});
|
|
7697
7757
|
|
|
7698
7758
|
// src/version.ts
|
|
7699
|
-
var version = "2.0.
|
|
7759
|
+
var version = "2.0.139";
|
|
7700
7760
|
|
|
7701
7761
|
// src/http/autumnFetch.ts
|
|
7702
7762
|
var runtime = typeof Bun !== "undefined" ? `bun ${Bun.version}` : `node ${process.versions.node}`;
|
|
@@ -8524,7 +8584,7 @@ var provisionKeylessOrg = async ({
|
|
|
8524
8584
|
organizationSlug: String(body.organization_slug),
|
|
8525
8585
|
apiKey: String(body.api_key),
|
|
8526
8586
|
claimToken: String(body.claim_token),
|
|
8527
|
-
claimExpiresAt: String(body.claim_expires_at)
|
|
8587
|
+
claimExpiresAt: body.claim_expires_at ? String(body.claim_expires_at) : null
|
|
8528
8588
|
};
|
|
8529
8589
|
};
|
|
8530
8590
|
var startClaim = async ({
|
|
@@ -8579,6 +8639,7 @@ var daysUntil = (iso) => {
|
|
|
8579
8639
|
const days = Math.max(1, Math.round(ms / 86400000));
|
|
8580
8640
|
return `${days} day${days === 1 ? "" : "s"}`;
|
|
8581
8641
|
};
|
|
8642
|
+
var linkWindow = (claimExpiresAt) => claimExpiresAt ? `Link it within ${daysUntil(claimExpiresAt)}` : "Link it to an account any time";
|
|
8582
8643
|
var runKeylessLogin = async ({
|
|
8583
8644
|
repoRoot,
|
|
8584
8645
|
envDirs,
|
|
@@ -8594,7 +8655,7 @@ var runKeylessLogin = async ({
|
|
|
8594
8655
|
process.env.AUTUMN_SECRET_KEY = provisioned.apiKey;
|
|
8595
8656
|
prompter.write(`${done(`Created sandbox org ${provisioned.organizationSlug} (keyless). Wrote AUTUMN_SECRET_KEY to ${envPath}`)}
|
|
8596
8657
|
`);
|
|
8597
|
-
prompter.write(` This org has no owner yet.
|
|
8658
|
+
prompter.write(` This org has no owner yet. ${linkWindow(provisioned.claimExpiresAt)}: atmn login --claim you@example.com
|
|
8598
8659
|
`);
|
|
8599
8660
|
return {
|
|
8600
8661
|
envPath,
|
|
@@ -10044,7 +10105,7 @@ Then:
|
|
|
10044
10105
|
4. Connect the way they chose, by running \`init\` again with the flag:
|
|
10045
10106
|
|
|
10046
10107
|
- **Sign in** → say a browser window is coming, then \`atmn init --login\`. It opens the browser to sign in and create or pick an org, prints the sign-in URL, and waits — that's normal, it's not stuck. If the browser doesn't open (SSH, sandbox), that's not a failure: send the user the printed URL as-is and wait. Keys get saved to \`.env\`. Fails → retry once, then stop and tell the user what failed. Offer the ways forward — go keyless, or they copy their own sandbox key from app.useautumn.com into \`.env\` as \`AUTUMN_SECRET_KEY\` — and wait for their answer. Never switch to keyless on your own.
|
|
10047
|
-
- **Keyless** → \`atmn init --keyless\`. It provisions a sandbox org and saves its key to \`.env\` as \`AUTUMN_SECRET_KEY\`. No account, no browser, nothing for the user to do. The org is a real one: pushing, customers, and billing all work the same. It has no owner until Phase 7 links one, and the key doesn't change when that happens.
|
|
10108
|
+
- **Keyless** → \`atmn init --keyless\`. It provisions a sandbox org and saves its key to \`.env\` as \`AUTUMN_SECRET_KEY\`. No account, no browser, nothing for the user to do. The org is a real one: pushing, customers, and billing all work the same. It has no owner until Phase 7 links one, and the key doesn't change when that happens. For what provisioning and linking do underneath, and their limits, read \`references/keyless.md\`.
|
|
10048
10109
|
|
|
10049
10110
|
5. \`init\` pulled the org's catalog into the config. If plans showed up ("Pulled N entries"), say so and go through them with the user before changing anything. A brand-new or keyless org is empty; the config is a scaffold for Phase 4 to fill.
|
|
10050
10111
|
|
|
@@ -10103,7 +10164,7 @@ Offer once, right after they've seen the integration work, because that's when t
|
|
|
10103
10164
|
|
|
10104
10165
|
No → fine, drop it and say the offer stands whenever. Yes → ask which email to send the link to, run \`atmn login --claim <email>\`, and give them the returned claim URL. Autumn also emails that same URL — say so, naming the address, so they know where to find it later ("Also sent to you@example.com"). Whoever opens the link and signs in becomes the owner — the email is only where the link is delivered, so treat the link like the key and give it to the user alone. Linking makes them the owner: same key, same plans, same customers, plus the dashboard. An account that already exists works the same way; the new org is added beside their existing ones and becomes active after confirmation.
|
|
10105
10166
|
|
|
10106
|
-
|
|
10167
|
+
There's no deadline for linking, so it can wait until the user is ready. If linking fails, nothing is lost: the key keeps working and they can try again, or sign up normally and push the same config. What the commands do underneath: \`references/keyless.md\`.
|
|
10107
10168
|
|
|
10108
10169
|
## Phase 8 — Done
|
|
10109
10170
|
|
|
@@ -10113,7 +10174,7 @@ Then stop. Don't keep building, don't tour the dashboard, don't deploy anything.
|
|
|
10113
10174
|
references: [
|
|
10114
10175
|
{
|
|
10115
10176
|
path: "references/keyless.md",
|
|
10116
|
-
contents: "# Keyless orgs\n\nA keyless org is a real sandbox org with no owner yet. One call creates it and hands back a secret key; pushing a catalog, creating customers, and billing all work normally. The user links their account later, and the key stays the same.\n\nThe CLI does both: `atmn init --keyless` (or `atmn login --keyless`) provisions, and `atmn login --claim <email>` creates the browser claim flow. Use those. The HTTP calls below are what they do underneath, for when you need to know the fields or limits. Base URL is `https://api.useautumn.com`. The same flow, in the [auth.md](https://workos.com/auth-md) convention agents discover on their own, is at `https://useautumn.com/auth.md`.\n\n## Provision\n\n`POST /agent.provision`\n\nSend `name` and `slug`, both derived from the project (repo name, or the `name` in package.json). The slug is lowercase letters and numbers, with `-` or `_` between words.\n\nBack comes `organization_id`, `organization_slug`, `api_key`, `claim_token`, and `claim_expires_at`.\n\n- Write `api_key` into `.env` as `AUTUMN_SECRET_KEY`. It is a sandbox secret key — never print it or read it back into the chat.\n- `claim_token` works only on `/agent.start_claim`, as an alternative to the key for that one call. It is not an API credential — it can't read or write catalogs, customers, or anything else. Claiming with the key is simpler, so normally you can ignore it. It is still as secret as the key.\n- `claim_expires_at` is
|
|
10177
|
+
contents: "# Keyless orgs\n\nA keyless org is a real sandbox org with no owner yet. One call creates it and hands back a secret key; pushing a catalog, creating customers, and billing all work normally. The user links their account later, and the key stays the same.\n\nThe CLI does both: `atmn init --keyless` (or `atmn login --keyless`) provisions, and `atmn login --claim <email>` creates the browser claim flow. Use those. The HTTP calls below are what they do underneath, for when you need to know the fields or limits. Base URL is `https://api.useautumn.com`. The same flow, in the [auth.md](https://workos.com/auth-md) convention agents discover on their own, is at `https://useautumn.com/auth.md`.\n\n## Provision\n\n`POST /agent.provision`\n\nSend `name` and `slug`, both derived from the project (repo name, or the `name` in package.json). The slug is lowercase letters and numbers, with `-` or `_` between words.\n\nBack comes `organization_id`, `organization_slug`, `api_key`, `claim_token`, and `claim_expires_at`.\n\n- Write `api_key` into `.env` as `AUTUMN_SECRET_KEY`. It is a sandbox secret key — never print it or read it back into the chat.\n- `claim_token` works only on `/agent.start_claim`, as an alternative to the key for that one call. It is not an API credential — it can't read or write catalogs, customers, or anything else. Claiming with the key is simpler, so normally you can ignore it. It is still as secret as the key.\n- `claim_expires_at` is `null`: an unclaimed org can be linked at any time.\n- Provisioning is rate limited per machine. If it fails, tell the user and offer sign-in — never loop on it.\n\n## Claim the org\n\n`POST /agent.start_claim` with an `Authorization: Bearer <AUTUMN_SECRET_KEY>` header and an `email` in the body. Autumn returns `claim_url` and `expires_at`, and emails the same URL to that address.\n\nGive the URL to the user in the chat as well, and tell them which address it was emailed to. They open it, sign in with any account, review the organization, and confirm the claim. Autumn then adds that account as owner and switches their dashboard to the claimed organization.\n\nThe email is only where the link is delivered — it is not checked at claim time. The link itself is the credential: anyone who opens it and signs in owns the org, so share it only with the user.\n\nIf you're using the claim token instead of the key, send `claim_token` in the body and no `Authorization` header. Send exactly one of the two — both, or neither, is refused.\n\nNotes that matter:\n\n- The browser link expires in minutes. If it expires, call `/agent.start_claim` again to replace it. Only the newest link works.\n- Never ask the user for a verification code; completion happens in the browser.\n- The same URL is emailed, so the user still has it if the agent session is lost.\n- The provisioned key keeps working after linking. Don't rotate it, don't provision a second org.\n- Linking an org that's already linked fails on purpose. These errors are deliberately vague so they can't be probed — don't guess at what went wrong, just tell the user it didn't go through and what you'll try next."
|
|
10117
10178
|
}
|
|
10118
10179
|
]
|
|
10119
10180
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "atmn",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.139",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "The CLI for Autumn — define your pricing in code, sync it to Autumn, and keep everything in version control.",
|
|
6
6
|
"bin": {
|
|
@@ -49,5 +49,5 @@
|
|
|
49
49
|
"open": "10.2.0",
|
|
50
50
|
"yaml": "2.9.0"
|
|
51
51
|
},
|
|
52
|
-
"gitHead": "
|
|
52
|
+
"gitHead": "58f264d596db1ce6ad122f526cea6424b309c316"
|
|
53
53
|
}
|
|
@@ -63,11 +63,16 @@ const daysUntil = (iso: string): string => {
|
|
|
63
63
|
return `${days} day${days === 1 ? "" : "s"}`;
|
|
64
64
|
};
|
|
65
65
|
|
|
66
|
+
const linkWindow = (claimExpiresAt: string | null) =>
|
|
67
|
+
claimExpiresAt
|
|
68
|
+
? `Link it within ${daysUntil(claimExpiresAt)}`
|
|
69
|
+
: "Link it to an account any time";
|
|
70
|
+
|
|
66
71
|
export type KeylessLoginResult = {
|
|
67
72
|
envPath: string;
|
|
68
73
|
orgId: string;
|
|
69
74
|
orgSlug: string;
|
|
70
|
-
claimExpiresAt: string;
|
|
75
|
+
claimExpiresAt: string | null;
|
|
71
76
|
};
|
|
72
77
|
|
|
73
78
|
/** A sandbox org with no owner, its key in .env; the account comes later. */
|
|
@@ -95,7 +100,7 @@ export const runKeylessLogin = async ({
|
|
|
95
100
|
`${done(`Created sandbox org ${provisioned.organizationSlug} (keyless). Wrote AUTUMN_SECRET_KEY to ${envPath}`)}\n`,
|
|
96
101
|
);
|
|
97
102
|
prompter.write(
|
|
98
|
-
` This org has no owner yet.
|
|
103
|
+
` This org has no owner yet. ${linkWindow(provisioned.claimExpiresAt)}: atmn login --claim you@example.com\n`,
|
|
99
104
|
);
|
|
100
105
|
return {
|
|
101
106
|
envPath,
|
package/src/auth/keyless.ts
CHANGED
|
@@ -12,8 +12,8 @@ export type ProvisionedOrg = {
|
|
|
12
12
|
organizationSlug: string;
|
|
13
13
|
apiKey: string;
|
|
14
14
|
claimToken: string;
|
|
15
|
-
/** ISO 8601
|
|
16
|
-
claimExpiresAt: string;
|
|
15
|
+
/** ISO 8601 deadline for linking, or null when the org can be linked at any time. */
|
|
16
|
+
claimExpiresAt: string | null;
|
|
17
17
|
};
|
|
18
18
|
|
|
19
19
|
export type ClaimStarted = {
|
|
@@ -76,7 +76,9 @@ export const provisionKeylessOrg = async ({
|
|
|
76
76
|
organizationSlug: String(body.organization_slug),
|
|
77
77
|
apiKey: String(body.api_key),
|
|
78
78
|
claimToken: String(body.claim_token),
|
|
79
|
-
claimExpiresAt:
|
|
79
|
+
claimExpiresAt: body.claim_expires_at
|
|
80
|
+
? String(body.claim_expires_at)
|
|
81
|
+
: null,
|
|
80
82
|
};
|
|
81
83
|
};
|
|
82
84
|
|
|
@@ -1138,6 +1138,20 @@ export const API_ROUTES: readonly ApiRoute[] = [
|
|
|
1138
1138
|
description:
|
|
1139
1139
|
"Custom line items that override the auto-generated proration invoice. Only valid for immediate plan changes (eg. upgrades or one off plans).",
|
|
1140
1140
|
},
|
|
1141
|
+
{
|
|
1142
|
+
name: "remove_lines",
|
|
1143
|
+
type: "json",
|
|
1144
|
+
required: false,
|
|
1145
|
+
description:
|
|
1146
|
+
"Lines to remove from the invoice this request creates. Never changes the subscription or later invoices.",
|
|
1147
|
+
},
|
|
1148
|
+
{
|
|
1149
|
+
name: "add_lines",
|
|
1150
|
+
type: "json",
|
|
1151
|
+
required: false,
|
|
1152
|
+
description:
|
|
1153
|
+
"Lines to add to the invoice this request creates. Never changes the subscription or later invoices.",
|
|
1154
|
+
},
|
|
1141
1155
|
{
|
|
1142
1156
|
name: "processor_subscription_id",
|
|
1143
1157
|
type: "string",
|
|
@@ -1617,6 +1631,20 @@ export const API_ROUTES: readonly ApiRoute[] = [
|
|
|
1617
1631
|
description:
|
|
1618
1632
|
"Custom line items that override the auto-generated proration invoice. Only valid for immediate plan changes (eg. upgrades or one off plans).",
|
|
1619
1633
|
},
|
|
1634
|
+
{
|
|
1635
|
+
name: "remove_lines",
|
|
1636
|
+
type: "json",
|
|
1637
|
+
required: false,
|
|
1638
|
+
description:
|
|
1639
|
+
"Lines to remove from the invoice this request creates. Never changes the subscription or later invoices.",
|
|
1640
|
+
},
|
|
1641
|
+
{
|
|
1642
|
+
name: "add_lines",
|
|
1643
|
+
type: "json",
|
|
1644
|
+
required: false,
|
|
1645
|
+
description:
|
|
1646
|
+
"Lines to add to the invoice this request creates. Never changes the subscription or later invoices.",
|
|
1647
|
+
},
|
|
1620
1648
|
{
|
|
1621
1649
|
name: "processor_subscription_id",
|
|
1622
1650
|
type: "string",
|
|
@@ -1932,6 +1960,20 @@ export const API_ROUTES: readonly ApiRoute[] = [
|
|
|
1932
1960
|
description:
|
|
1933
1961
|
"Custom line items that replace the auto-generated proration invoice, or bill a standalone invoice when nothing else changes. Only valid on an existing recurring subscription.",
|
|
1934
1962
|
},
|
|
1963
|
+
{
|
|
1964
|
+
name: "remove_lines",
|
|
1965
|
+
type: "json",
|
|
1966
|
+
required: false,
|
|
1967
|
+
description:
|
|
1968
|
+
"Lines to remove from the invoice this request creates. Never changes the subscription or later invoices.",
|
|
1969
|
+
},
|
|
1970
|
+
{
|
|
1971
|
+
name: "add_lines",
|
|
1972
|
+
type: "json",
|
|
1973
|
+
required: false,
|
|
1974
|
+
description:
|
|
1975
|
+
"Lines to add to the invoice this request creates. Never changes the subscription or later invoices.",
|
|
1976
|
+
},
|
|
1935
1977
|
{
|
|
1936
1978
|
name: "cancel_action",
|
|
1937
1979
|
type: "string",
|
|
@@ -2092,6 +2134,20 @@ export const API_ROUTES: readonly ApiRoute[] = [
|
|
|
2092
2134
|
description:
|
|
2093
2135
|
"Custom line items that replace the auto-generated proration invoice, or bill a standalone invoice when nothing else changes. Only valid on an existing recurring subscription.",
|
|
2094
2136
|
},
|
|
2137
|
+
{
|
|
2138
|
+
name: "remove_lines",
|
|
2139
|
+
type: "json",
|
|
2140
|
+
required: false,
|
|
2141
|
+
description:
|
|
2142
|
+
"Lines to remove from the invoice this request creates. Never changes the subscription or later invoices.",
|
|
2143
|
+
},
|
|
2144
|
+
{
|
|
2145
|
+
name: "add_lines",
|
|
2146
|
+
type: "json",
|
|
2147
|
+
required: false,
|
|
2148
|
+
description:
|
|
2149
|
+
"Lines to add to the invoice this request creates. Never changes the subscription or later invoices.",
|
|
2150
|
+
},
|
|
2095
2151
|
{
|
|
2096
2152
|
name: "cancel_action",
|
|
2097
2153
|
type: "string",
|
|
@@ -2381,6 +2437,20 @@ export const API_ROUTES: readonly ApiRoute[] = [
|
|
|
2381
2437
|
description:
|
|
2382
2438
|
"Custom line items that override the auto-generated proration invoice. Only valid for immediate plan changes (eg. upgrades or one off plans).",
|
|
2383
2439
|
},
|
|
2440
|
+
{
|
|
2441
|
+
name: "remove_lines",
|
|
2442
|
+
type: "json",
|
|
2443
|
+
required: false,
|
|
2444
|
+
description:
|
|
2445
|
+
"Lines to remove from the invoice this request creates. Never changes the subscription or later invoices.",
|
|
2446
|
+
},
|
|
2447
|
+
{
|
|
2448
|
+
name: "add_lines",
|
|
2449
|
+
type: "json",
|
|
2450
|
+
required: false,
|
|
2451
|
+
description:
|
|
2452
|
+
"Lines to add to the invoice this request creates. Never changes the subscription or later invoices.",
|
|
2453
|
+
},
|
|
2384
2454
|
{
|
|
2385
2455
|
name: "processor_subscription_id",
|
|
2386
2456
|
type: "string",
|
package/src/generated/skills.ts
CHANGED
|
@@ -23,12 +23,12 @@ export const SKILLS: readonly BundledSkill[] = [
|
|
|
23
23
|
"First-time Autumn setup — install the atmn CLI, connect to an org (sign in, or keyless with no account), turn the user's pricing into autumn.config.ts, and push it to a sandbox org. Use when the user is new to Autumn, pastes an Autumn setup prompt, or asks to set up Autumn, add billing, monetization, subscriptions, usage-based billing, pricing, or plans. If Autumn is already set up, use autumn-catalog instead.",
|
|
24
24
|
version: "2.0.120",
|
|
25
25
|
markdown:
|
|
26
|
-
"---\nname: autumn-setup\ndescription: First-time Autumn setup — install the atmn CLI, connect to an org (sign in, or keyless with no account), turn the user's pricing into autumn.config.ts, and push it to a sandbox org. Use when the user is new to Autumn, pastes an Autumn setup prompt, or asks to set up Autumn, add billing, monetization, subscriptions, usage-based billing, pricing, or plans. If Autumn is already set up, use autumn-catalog instead.\nversion: 2.0.120\n---\n\n# Setup\n\nTake the user from \"I want billing\" to pricing that is live in a sandbox org and working in their app — with as little between those two points as possible. You run the flow; two other skills do the heavy parts. `autumn-catalog` turns their pricing into `autumn.config.ts`. `autumn-integrate` puts the first calls in their code. Never do either of those jobs yourself.\n\n## Ground rules\n\nThese apply the whole time, not just in one phase.\n\n- CLI-first: everything happens in `autumn.config.ts` and `atmn`. The only browser moments are signing in, or claiming a keyless org later. Never send the user to the dashboard to do the work.\n- Never invent a price, limit, or plan name. A missing number is a question, never a guess.\n- Push only after the user approves the pricing (Phase 4), or when they already told you to go ahead without a review.\n- Sandbox by default: `AUTUMN_SECRET_KEY` is the sandbox key. Don't touch production during setup.\n- Keys: check that a key exists by its name only. Never read, print, or ask the user to paste a key into the chat. Same for a keyless org's claim token. A one-time email code is not a key — that one does come through the chat.\n- Two tries max to fix any failing command, then stop and show the error.\n- Never run `atmn reset`, and never remove existing plans unless the user clearly asked.\n- If a step is already done, say so in one line (\"Already signed in — skipping login\") and move on.\n\n## How to talk\n\nYou are a competent engineer pairing with the user, not an installer wizard and not a marketer.\n\n- Simple, everyday words: \"plans\", \"what's included\", \"extra usage\". No jargon in chat — schema words like `consumable`, `prepaid`, `usage_based` stay in the config. If a simpler word says the same thing, use it.\n- 1–3 sentences per message. The pricing summary is the only large thing you send.\n- One message, one purpose: a status, a question, or the pricing summary.\n- Don't ask permission for harmless work — reading the repo, drafting the config, building the summary. Ask only for decisions and approvals.\n- Say what's about to happen before it does: one line before the browser opens, one before the push.\n- When you need input, ask at most three short numbered questions — the ones that unblock you, nothing more. If your platform has a built-in way to ask questions with options, use it. Never re-ask something they answered.\n- Always end a message with something: the question, what you're doing next, or that you're done.\n- Don't paste the config or command output into chat; name the file and summarize. Errors are the exception — quote those exactly.\n- If you're stuck, send three lines: what failed, the exact error, what you need to continue.\n- No emoji, no hype, no \"Great question\". Plain and concrete: \"Connected to Acme (sandbox).\"\n\n## Progress\n\nCopy this checklist into your first message and keep it up to date. If you skip an item, say why in one line.\n\n- [ ] 1 Skills installed; checked for an existing config, key, and pricing\n- [ ] 2 Connected to Autumn — `atmn` installed, signed in or keyless\n- [ ] 3 Got the user's pricing — rough plans and prices to build from\n- [ ] 4 Pricing modeled and approved (the `autumn-catalog` skill runs this part)\n- [ ] 5 Pushed to Autumn and verified\n- [ ] 6 Working in the app — one plan bought, one feature gated (the `autumn-integrate` skill runs this part)\n- [ ] 7 Account linked (keyless only — drop this line if they signed in)\n- [ ] 8 Done\n\nFor items 4 and 6, another skill owns the conversation and its checklist replaces this one for the duration — show theirs, not this one. Come back here when they're finished.\n\n## Phase 1 — Check the project (silent)\n\nDon't message the user yet — just find out where things stand.\n\nFour skills share this job, and they ship inside the `atmn` CLI: `atmn init` writes them next to the config and prints the `npx skills add <that folder> -y` line that registers them with your agent, and `atmn skills update` refreshes them when `push` or `pull` say they are older than the CLI. If any is missing here, that is Phase 2's job — never fetch them from anywhere else.\n\n`autumn-setup` (this file) is the flow. `autumn-catalog` is how to build the pricing, plus the exact `atmn` commands — load it in Phase 4. `autumn-integrate` is how the app calls Autumn — load it in Phase 6. `autumn-concepts` explains Autumn's objects — the other two load it themselves.\n\nThen check three things:\n\n- `autumn.config.ts` exists → Autumn is already set up here. Say so, treat the file as the truth, and use `autumn-catalog` for the changes; come back at Phase 5 (push) when there's something to push.\n- An `AUTUMN_SECRET_KEY` exists (shell env, `.env`, `.env.local`) → already connected; skip the connect step in Phase 2.\n- They already told you the pricing (their message, a pricing page, the README) → Phase 3 is a quick confirm, not a list of questions.\n\n## Phase 2 — Introduce and connect\n\nStart with two or three sentences: what's going to happen (connect this project to an Autumn org → write the pricing into `autumn.config.ts` → approve the pricing → push). Something like this, in your own words:\n\n> Setting up Autumn. I'll connect this project to an Autumn org, write your pricing into `autumn.config.ts`, and show it to you to approve before anything is pushed.\n\nThen:\n\n1. Run `atmn init` from the project root with the user's package manager (`bunx atmn init`, `pnpm exec atmn init`, `yarn atmn init`, `npx atmn init` — read it off the lockfile). Every `atmn …` command below means that run command. One command does the whole connect step: it adds `atmn` as a dependency, places the config in `autumn/` (its own package in a monorepo — it asks where, or takes `--path` and `--name`), pulls whatever the org already holds, and installs these skills beside the config. Each run prints what it did and, when it needs an answer, the flag to pass; run it again with the flag.\n2. Key already there → `init` says who it's connected to and moves on. Say so in one line.\n3. No key → `init` stops and asks how to connect. Ask the user the same thing, one question, two options, plain words:\n\n > Two ways to start: sign in to an Autumn account (I'll open a browser), or go keyless — I set up a sandbox for you right now and you link an account later. Which do you want?\n\n Always ask this one, even if the user told you to handle everything yourself — a keyless org has no owner until they link it, and that is their call, not yours. Pick keyless without asking only when there is genuinely nobody in the chat to answer (an unattended run), and say in one line that you did.\n4. Connect the way they chose, by running `init` again with the flag:\n\n - **Sign in** → say a browser window is coming, then `atmn init --login`. It opens the browser to sign in and create or pick an org, prints the sign-in URL, and waits — that's normal, it's not stuck. If the browser doesn't open (SSH, sandbox), that's not a failure: send the user the printed URL as-is and wait. Keys get saved to `.env`. Fails → retry once, then stop and tell the user what failed. Offer the ways forward — go keyless, or they copy their own sandbox key from app.useautumn.com into `.env` as `AUTUMN_SECRET_KEY` — and wait for their answer. Never switch to keyless on your own.\n - **Keyless** → `atmn init --keyless`. It provisions a sandbox org and saves its key to `.env` as `AUTUMN_SECRET_KEY`. No account, no browser, nothing for the user to do. The org is a real one: pushing, customers, and billing all work the same. It has no owner until Phase 7 links one, and the key doesn't change when that happens. `init` prints the deadline for linking; note it for Phase 7. For what provisioning and linking do underneath, and their limits, read `references/keyless.md`.\n\n5. `init` pulled the org's catalog into the config. If plans showed up (\"Pulled N entries\"), say so and go through them with the user before changing anything. A brand-new or keyless org is empty; the config is a scaffold for Phase 4 to fill.\n\nDone when `init` finished and you know whether the org already has plans. Say so in one line — including whether it's keyless, since that decides how you finish.\n\n## Phase 3 — Get a starting point\n\nYou need the pricing in the user's own words — not the details, just what to build.\n\n- They already told you (their message, a pricing page, the README) → repeat it back in one or two sentences and move on. If they gave you everything, ask nothing.\n- They haven't → ask what they're building and what they want to charge. A pricing page, or a competitor's page they like, is a full answer too.\n\nDon't dig into details here — what to ask, what to assume, and how to handle unclear pricing is `autumn-catalog`'s job, next phase.\n\nDone when you have rough plans and prices to build from.\n\n## Phase 4 — Model, write, approve\n\nLoad `autumn-catalog` now — from here it owns the conversation: its Shape/Fill flow, its checklist (shown instead of this skill's), its questions, its catalog display, and the approval. Your speaking rules above still apply to its questions.\n\nThis whole phase is the catalog skill's: structure agreed → config written and valid → pricing shown in its format → user approved. Only come back here when that's done; don't push yet.\n\n## Phase 5 — Push\n\nOnly after the yes. Push with `atmn` using `autumn-catalog`'s atmn reference — it has the exact commands, flags, and versioning choices. If the push asks for decisions (new version of a live plan, deleting things), bring them to the user; never decide alone. Check the push output shows every plan and feature made it — a push that errored is not done, and after two failed fixes you stop and show the error.\n\n## Phase 6 — Get it working in the app\n\nPricing in a sandbox is invisible. The user believes Autumn works when their own app creates a customer, blocks something, and takes money — so go there next, in one short pass, before anything else gets built.\n\nSay what's now live (plans and features, which org, sandbox) and where the config file is, then offer it:\n\n> Plans are live. Want me to wire up the basics now — customers created on signup, buying a plan, one feature gated / tracked — so you can see it running in your app?\n\nThey say no → skip to Phase 7. They say yes, or already asked for the integration up front → this phase runs. Either way it's their call; never start editing app code unasked.\n\nScope it before handing over. The first pass is the thinnest thing that proves the loop, and nothing else:\n\n- a customer created where the app already knows who the user is\n- buying a plan: the main free → paid move, so real money moves once\n- `check` and `track` on the **one** feature that matters most — ask which if it isn't obvious, don't gate everything\n\nAnything else — every remaining feature, entities, seats, billing controls, the billing page — waits for a second pass. Say that out loud when you scope, so the user doesn't read a small first pass as a small integration.\n\nLoad `autumn-integrate` now with that scope — from here it owns the conversation and the code: its order of operations, its checklist, its verification. Your speaking rules above still apply.\n\nCome back when its verification passes: a customer that exists in sandbox, a check that denied, usage that landed, a plan that attached.\n\n## Phase 7 — Link the account (keyless only)\n\nSkip this entirely if the user signed in — they already own their org.\n\nOffer once, right after they've seen the integration work, because that's when there's something worth logging in to look at:\n\n> Want to link this to your account? I’ll create a secure sign-in link so you can claim the org and open everything that just ran in the dashboard.\n\nNo → fine, drop it and say the offer stands whenever. Yes → ask which email to send the link to, run `atmn login --claim <email>`, and give them the returned claim URL. Autumn also emails that same URL — say so, naming the address, so they know where to find it later (\"Also sent to you@example.com\"). Whoever opens the link and signs in becomes the owner — the email is only where the link is delivered, so treat the link like the key and give it to the user alone. Linking makes them the owner: same key, same plans, same customers, plus the dashboard. An account that already exists works the same way; the new org is added beside their existing ones and becomes active after confirmation.\n\nUnclaimed orgs don't wait forever, so mention the window `init` printed when you offer — as a fact, not a threat. If linking fails, nothing is lost: the key keeps working and they can try again, or sign up normally and push the same config. What the commands do underneath: `references/keyless.md`.\n\n## Phase 8 — Done\n\nThree lines: what's live and working, where it lives (`autumn.config.ts`, and the handlers if Phase 6 ran), and the obvious next thing — the rest of the features, or going to production when they're ready. A linked or signed-in user can see it all at app.useautumn.com; a keyless user who declined can't, so don't send them there.\n\nThen stop. Don't keep building, don't tour the dashboard, don't deploy anything.",
|
|
26
|
+
"---\nname: autumn-setup\ndescription: First-time Autumn setup — install the atmn CLI, connect to an org (sign in, or keyless with no account), turn the user's pricing into autumn.config.ts, and push it to a sandbox org. Use when the user is new to Autumn, pastes an Autumn setup prompt, or asks to set up Autumn, add billing, monetization, subscriptions, usage-based billing, pricing, or plans. If Autumn is already set up, use autumn-catalog instead.\nversion: 2.0.120\n---\n\n# Setup\n\nTake the user from \"I want billing\" to pricing that is live in a sandbox org and working in their app — with as little between those two points as possible. You run the flow; two other skills do the heavy parts. `autumn-catalog` turns their pricing into `autumn.config.ts`. `autumn-integrate` puts the first calls in their code. Never do either of those jobs yourself.\n\n## Ground rules\n\nThese apply the whole time, not just in one phase.\n\n- CLI-first: everything happens in `autumn.config.ts` and `atmn`. The only browser moments are signing in, or claiming a keyless org later. Never send the user to the dashboard to do the work.\n- Never invent a price, limit, or plan name. A missing number is a question, never a guess.\n- Push only after the user approves the pricing (Phase 4), or when they already told you to go ahead without a review.\n- Sandbox by default: `AUTUMN_SECRET_KEY` is the sandbox key. Don't touch production during setup.\n- Keys: check that a key exists by its name only. Never read, print, or ask the user to paste a key into the chat. Same for a keyless org's claim token. A one-time email code is not a key — that one does come through the chat.\n- Two tries max to fix any failing command, then stop and show the error.\n- Never run `atmn reset`, and never remove existing plans unless the user clearly asked.\n- If a step is already done, say so in one line (\"Already signed in — skipping login\") and move on.\n\n## How to talk\n\nYou are a competent engineer pairing with the user, not an installer wizard and not a marketer.\n\n- Simple, everyday words: \"plans\", \"what's included\", \"extra usage\". No jargon in chat — schema words like `consumable`, `prepaid`, `usage_based` stay in the config. If a simpler word says the same thing, use it.\n- 1–3 sentences per message. The pricing summary is the only large thing you send.\n- One message, one purpose: a status, a question, or the pricing summary.\n- Don't ask permission for harmless work — reading the repo, drafting the config, building the summary. Ask only for decisions and approvals.\n- Say what's about to happen before it does: one line before the browser opens, one before the push.\n- When you need input, ask at most three short numbered questions — the ones that unblock you, nothing more. If your platform has a built-in way to ask questions with options, use it. Never re-ask something they answered.\n- Always end a message with something: the question, what you're doing next, or that you're done.\n- Don't paste the config or command output into chat; name the file and summarize. Errors are the exception — quote those exactly.\n- If you're stuck, send three lines: what failed, the exact error, what you need to continue.\n- No emoji, no hype, no \"Great question\". Plain and concrete: \"Connected to Acme (sandbox).\"\n\n## Progress\n\nCopy this checklist into your first message and keep it up to date. If you skip an item, say why in one line.\n\n- [ ] 1 Skills installed; checked for an existing config, key, and pricing\n- [ ] 2 Connected to Autumn — `atmn` installed, signed in or keyless\n- [ ] 3 Got the user's pricing — rough plans and prices to build from\n- [ ] 4 Pricing modeled and approved (the `autumn-catalog` skill runs this part)\n- [ ] 5 Pushed to Autumn and verified\n- [ ] 6 Working in the app — one plan bought, one feature gated (the `autumn-integrate` skill runs this part)\n- [ ] 7 Account linked (keyless only — drop this line if they signed in)\n- [ ] 8 Done\n\nFor items 4 and 6, another skill owns the conversation and its checklist replaces this one for the duration — show theirs, not this one. Come back here when they're finished.\n\n## Phase 1 — Check the project (silent)\n\nDon't message the user yet — just find out where things stand.\n\nFour skills share this job, and they ship inside the `atmn` CLI: `atmn init` writes them next to the config and prints the `npx skills add <that folder> -y` line that registers them with your agent, and `atmn skills update` refreshes them when `push` or `pull` say they are older than the CLI. If any is missing here, that is Phase 2's job — never fetch them from anywhere else.\n\n`autumn-setup` (this file) is the flow. `autumn-catalog` is how to build the pricing, plus the exact `atmn` commands — load it in Phase 4. `autumn-integrate` is how the app calls Autumn — load it in Phase 6. `autumn-concepts` explains Autumn's objects — the other two load it themselves.\n\nThen check three things:\n\n- `autumn.config.ts` exists → Autumn is already set up here. Say so, treat the file as the truth, and use `autumn-catalog` for the changes; come back at Phase 5 (push) when there's something to push.\n- An `AUTUMN_SECRET_KEY` exists (shell env, `.env`, `.env.local`) → already connected; skip the connect step in Phase 2.\n- They already told you the pricing (their message, a pricing page, the README) → Phase 3 is a quick confirm, not a list of questions.\n\n## Phase 2 — Introduce and connect\n\nStart with two or three sentences: what's going to happen (connect this project to an Autumn org → write the pricing into `autumn.config.ts` → approve the pricing → push). Something like this, in your own words:\n\n> Setting up Autumn. I'll connect this project to an Autumn org, write your pricing into `autumn.config.ts`, and show it to you to approve before anything is pushed.\n\nThen:\n\n1. Run `atmn init` from the project root with the user's package manager (`bunx atmn init`, `pnpm exec atmn init`, `yarn atmn init`, `npx atmn init` — read it off the lockfile). Every `atmn …` command below means that run command. One command does the whole connect step: it adds `atmn` as a dependency, places the config in `autumn/` (its own package in a monorepo — it asks where, or takes `--path` and `--name`), pulls whatever the org already holds, and installs these skills beside the config. Each run prints what it did and, when it needs an answer, the flag to pass; run it again with the flag.\n2. Key already there → `init` says who it's connected to and moves on. Say so in one line.\n3. No key → `init` stops and asks how to connect. Ask the user the same thing, one question, two options, plain words:\n\n > Two ways to start: sign in to an Autumn account (I'll open a browser), or go keyless — I set up a sandbox for you right now and you link an account later. Which do you want?\n\n Always ask this one, even if the user told you to handle everything yourself — a keyless org has no owner until they link it, and that is their call, not yours. Pick keyless without asking only when there is genuinely nobody in the chat to answer (an unattended run), and say in one line that you did.\n4. Connect the way they chose, by running `init` again with the flag:\n\n - **Sign in** → say a browser window is coming, then `atmn init --login`. It opens the browser to sign in and create or pick an org, prints the sign-in URL, and waits — that's normal, it's not stuck. If the browser doesn't open (SSH, sandbox), that's not a failure: send the user the printed URL as-is and wait. Keys get saved to `.env`. Fails → retry once, then stop and tell the user what failed. Offer the ways forward — go keyless, or they copy their own sandbox key from app.useautumn.com into `.env` as `AUTUMN_SECRET_KEY` — and wait for their answer. Never switch to keyless on your own.\n - **Keyless** → `atmn init --keyless`. It provisions a sandbox org and saves its key to `.env` as `AUTUMN_SECRET_KEY`. No account, no browser, nothing for the user to do. The org is a real one: pushing, customers, and billing all work the same. It has no owner until Phase 7 links one, and the key doesn't change when that happens. For what provisioning and linking do underneath, and their limits, read `references/keyless.md`.\n\n5. `init` pulled the org's catalog into the config. If plans showed up (\"Pulled N entries\"), say so and go through them with the user before changing anything. A brand-new or keyless org is empty; the config is a scaffold for Phase 4 to fill.\n\nDone when `init` finished and you know whether the org already has plans. Say so in one line — including whether it's keyless, since that decides how you finish.\n\n## Phase 3 — Get a starting point\n\nYou need the pricing in the user's own words — not the details, just what to build.\n\n- They already told you (their message, a pricing page, the README) → repeat it back in one or two sentences and move on. If they gave you everything, ask nothing.\n- They haven't → ask what they're building and what they want to charge. A pricing page, or a competitor's page they like, is a full answer too.\n\nDon't dig into details here — what to ask, what to assume, and how to handle unclear pricing is `autumn-catalog`'s job, next phase.\n\nDone when you have rough plans and prices to build from.\n\n## Phase 4 — Model, write, approve\n\nLoad `autumn-catalog` now — from here it owns the conversation: its Shape/Fill flow, its checklist (shown instead of this skill's), its questions, its catalog display, and the approval. Your speaking rules above still apply to its questions.\n\nThis whole phase is the catalog skill's: structure agreed → config written and valid → pricing shown in its format → user approved. Only come back here when that's done; don't push yet.\n\n## Phase 5 — Push\n\nOnly after the yes. Push with `atmn` using `autumn-catalog`'s atmn reference — it has the exact commands, flags, and versioning choices. If the push asks for decisions (new version of a live plan, deleting things), bring them to the user; never decide alone. Check the push output shows every plan and feature made it — a push that errored is not done, and after two failed fixes you stop and show the error.\n\n## Phase 6 — Get it working in the app\n\nPricing in a sandbox is invisible. The user believes Autumn works when their own app creates a customer, blocks something, and takes money — so go there next, in one short pass, before anything else gets built.\n\nSay what's now live (plans and features, which org, sandbox) and where the config file is, then offer it:\n\n> Plans are live. Want me to wire up the basics now — customers created on signup, buying a plan, one feature gated / tracked — so you can see it running in your app?\n\nThey say no → skip to Phase 7. They say yes, or already asked for the integration up front → this phase runs. Either way it's their call; never start editing app code unasked.\n\nScope it before handing over. The first pass is the thinnest thing that proves the loop, and nothing else:\n\n- a customer created where the app already knows who the user is\n- buying a plan: the main free → paid move, so real money moves once\n- `check` and `track` on the **one** feature that matters most — ask which if it isn't obvious, don't gate everything\n\nAnything else — every remaining feature, entities, seats, billing controls, the billing page — waits for a second pass. Say that out loud when you scope, so the user doesn't read a small first pass as a small integration.\n\nLoad `autumn-integrate` now with that scope — from here it owns the conversation and the code: its order of operations, its checklist, its verification. Your speaking rules above still apply.\n\nCome back when its verification passes: a customer that exists in sandbox, a check that denied, usage that landed, a plan that attached.\n\n## Phase 7 — Link the account (keyless only)\n\nSkip this entirely if the user signed in — they already own their org.\n\nOffer once, right after they've seen the integration work, because that's when there's something worth logging in to look at:\n\n> Want to link this to your account? I’ll create a secure sign-in link so you can claim the org and open everything that just ran in the dashboard.\n\nNo → fine, drop it and say the offer stands whenever. Yes → ask which email to send the link to, run `atmn login --claim <email>`, and give them the returned claim URL. Autumn also emails that same URL — say so, naming the address, so they know where to find it later (\"Also sent to you@example.com\"). Whoever opens the link and signs in becomes the owner — the email is only where the link is delivered, so treat the link like the key and give it to the user alone. Linking makes them the owner: same key, same plans, same customers, plus the dashboard. An account that already exists works the same way; the new org is added beside their existing ones and becomes active after confirmation.\n\nThere's no deadline for linking, so it can wait until the user is ready. If linking fails, nothing is lost: the key keeps working and they can try again, or sign up normally and push the same config. What the commands do underneath: `references/keyless.md`.\n\n## Phase 8 — Done\n\nThree lines: what's live and working, where it lives (`autumn.config.ts`, and the handlers if Phase 6 ran), and the obvious next thing — the rest of the features, or going to production when they're ready. A linked or signed-in user can see it all at app.useautumn.com; a keyless user who declined can't, so don't send them there.\n\nThen stop. Don't keep building, don't tour the dashboard, don't deploy anything.",
|
|
27
27
|
references: [
|
|
28
28
|
{
|
|
29
29
|
path: "references/keyless.md",
|
|
30
30
|
contents:
|
|
31
|
-
"# Keyless orgs\n\nA keyless org is a real sandbox org with no owner yet. One call creates it and hands back a secret key; pushing a catalog, creating customers, and billing all work normally. The user links their account later, and the key stays the same.\n\nThe CLI does both: `atmn init --keyless` (or `atmn login --keyless`) provisions, and `atmn login --claim <email>` creates the browser claim flow. Use those. The HTTP calls below are what they do underneath, for when you need to know the fields or limits. Base URL is `https://api.useautumn.com`. The same flow, in the [auth.md](https://workos.com/auth-md) convention agents discover on their own, is at `https://useautumn.com/auth.md`.\n\n## Provision\n\n`POST /agent.provision`\n\nSend `name` and `slug`, both derived from the project (repo name, or the `name` in package.json). The slug is lowercase letters and numbers, with `-` or `_` between words.\n\nBack comes `organization_id`, `organization_slug`, `api_key`, `claim_token`, and `claim_expires_at`.\n\n- Write `api_key` into `.env` as `AUTUMN_SECRET_KEY`. It is a sandbox secret key — never print it or read it back into the chat.\n- `claim_token` works only on `/agent.start_claim`, as an alternative to the key for that one call. It is not an API credential — it can't read or write catalogs, customers, or anything else. Claiming with the key is simpler, so normally you can ignore it. It is still as secret as the key.\n- `claim_expires_at` is
|
|
31
|
+
"# Keyless orgs\n\nA keyless org is a real sandbox org with no owner yet. One call creates it and hands back a secret key; pushing a catalog, creating customers, and billing all work normally. The user links their account later, and the key stays the same.\n\nThe CLI does both: `atmn init --keyless` (or `atmn login --keyless`) provisions, and `atmn login --claim <email>` creates the browser claim flow. Use those. The HTTP calls below are what they do underneath, for when you need to know the fields or limits. Base URL is `https://api.useautumn.com`. The same flow, in the [auth.md](https://workos.com/auth-md) convention agents discover on their own, is at `https://useautumn.com/auth.md`.\n\n## Provision\n\n`POST /agent.provision`\n\nSend `name` and `slug`, both derived from the project (repo name, or the `name` in package.json). The slug is lowercase letters and numbers, with `-` or `_` between words.\n\nBack comes `organization_id`, `organization_slug`, `api_key`, `claim_token`, and `claim_expires_at`.\n\n- Write `api_key` into `.env` as `AUTUMN_SECRET_KEY`. It is a sandbox secret key — never print it or read it back into the chat.\n- `claim_token` works only on `/agent.start_claim`, as an alternative to the key for that one call. It is not an API credential — it can't read or write catalogs, customers, or anything else. Claiming with the key is simpler, so normally you can ignore it. It is still as secret as the key.\n- `claim_expires_at` is `null`: an unclaimed org can be linked at any time.\n- Provisioning is rate limited per machine. If it fails, tell the user and offer sign-in — never loop on it.\n\n## Claim the org\n\n`POST /agent.start_claim` with an `Authorization: Bearer <AUTUMN_SECRET_KEY>` header and an `email` in the body. Autumn returns `claim_url` and `expires_at`, and emails the same URL to that address.\n\nGive the URL to the user in the chat as well, and tell them which address it was emailed to. They open it, sign in with any account, review the organization, and confirm the claim. Autumn then adds that account as owner and switches their dashboard to the claimed organization.\n\nThe email is only where the link is delivered — it is not checked at claim time. The link itself is the credential: anyone who opens it and signs in owns the org, so share it only with the user.\n\nIf you're using the claim token instead of the key, send `claim_token` in the body and no `Authorization` header. Send exactly one of the two — both, or neither, is refused.\n\nNotes that matter:\n\n- The browser link expires in minutes. If it expires, call `/agent.start_claim` again to replace it. Only the newest link works.\n- Never ask the user for a verification code; completion happens in the browser.\n- The same URL is emailed, so the user still has it if the agent session is lost.\n- The provisioned key keeps working after linking. Don't rotate it, don't provision a second org.\n- Linking an org that's already linked fails on purpose. These errors are deliberately vague so they can't be probed — don't guess at what went wrong, just tell the user it didn't go through and what you'll try next.",
|
|
32
32
|
},
|
|
33
33
|
],
|
|
34
34
|
},
|