@spacefast/common 0.0.5 → 0.0.6

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.
Files changed (150) hide show
  1. package/dist/agents/connect-targets.d.ts +133 -0
  2. package/dist/agents/connect-targets.js +224 -0
  3. package/dist/brand.d.ts +1 -0
  4. package/dist/brand.js +5 -0
  5. package/dist/config/domains.d.ts +12 -6
  6. package/dist/config/domains.js +30 -38
  7. package/dist/contracts/access.d.ts +825 -125
  8. package/dist/contracts/access.js +771 -148
  9. package/dist/contracts/activity.d.ts +1 -1
  10. package/dist/contracts/activity.js +28 -2
  11. package/dist/contracts/annotations.d.ts +2 -4
  12. package/dist/contracts/api-keys.d.ts +3 -4
  13. package/dist/contracts/api-keys.js +9 -6
  14. package/dist/contracts/archives.d.ts +8 -2
  15. package/dist/contracts/archives.js +11 -4
  16. package/dist/contracts/billing.d.ts +0 -9
  17. package/dist/contracts/builds.d.ts +25 -21
  18. package/dist/contracts/builds.js +12 -0
  19. package/dist/contracts/common.d.ts +2 -0
  20. package/dist/contracts/common.js +4 -0
  21. package/dist/contracts/continuation.d.ts +0 -3
  22. package/dist/contracts/countries.d.ts +2 -0
  23. package/dist/contracts/countries.js +261 -0
  24. package/dist/contracts/deployments.d.ts +34 -34
  25. package/dist/contracts/device-auth.d.ts +4 -11
  26. package/dist/contracts/device-auth.js +4 -0
  27. package/dist/contracts/docs.d.ts +119 -0
  28. package/dist/contracts/docs.js +51 -0
  29. package/dist/contracts/domains.d.ts +96 -54
  30. package/dist/contracts/domains.js +26 -4
  31. package/dist/contracts/enums.d.ts +15 -16
  32. package/dist/contracts/enums.js +25 -14
  33. package/dist/contracts/error-code-meta.d.ts +72 -0
  34. package/dist/contracts/error-code-meta.js +96 -10
  35. package/dist/contracts/error-codes.d.ts +1 -1
  36. package/dist/contracts/error-codes.js +14 -0
  37. package/dist/contracts/events.d.ts +1 -1
  38. package/dist/contracts/features.d.ts +76 -6
  39. package/dist/contracts/features.js +178 -13
  40. package/dist/contracts/git.d.ts +2 -8
  41. package/dist/contracts/ids.d.ts +5 -0
  42. package/dist/contracts/ids.js +5 -0
  43. package/dist/contracts/mcp.d.ts +8 -10
  44. package/dist/contracts/me.js +1 -1
  45. package/dist/contracts/oauth-resources.d.ts +19 -8
  46. package/dist/contracts/oauth-resources.js +44 -13
  47. package/dist/contracts/platform.d.ts +0 -102
  48. package/dist/contracts/platform.js +0 -50
  49. package/dist/contracts/push-new.d.ts +4 -4
  50. package/dist/contracts/quotas.d.ts +2 -0
  51. package/dist/contracts/quotas.js +8 -0
  52. package/dist/contracts/repository-connections.d.ts +6 -8
  53. package/dist/contracts/resources.d.ts +97 -13
  54. package/dist/contracts/resources.js +26 -2
  55. package/dist/contracts/routes.d.ts +0 -2
  56. package/dist/contracts/runtime-api.d.ts +361 -39
  57. package/dist/contracts/runtime-api.js +275 -6
  58. package/dist/contracts/sites.d.ts +19 -2
  59. package/dist/contracts/sites.js +21 -0
  60. package/dist/contracts/space-config.d.ts +201 -2
  61. package/dist/contracts/space-config.js +135 -5
  62. package/dist/contracts/spaces.d.ts +364 -193
  63. package/dist/contracts/spaces.js +40 -8
  64. package/dist/contracts/superadmin-emails.d.ts +4 -2
  65. package/dist/contracts/superadmin-emails.js +8 -0
  66. package/dist/contracts/superadmin-queues.d.ts +26 -26
  67. package/dist/contracts/superadmin-spaces.d.ts +170 -42
  68. package/dist/contracts/superadmin.d.ts +6 -93
  69. package/dist/contracts/superadmin.js +6 -14
  70. package/dist/contracts/tags.d.ts +10 -9
  71. package/dist/contracts/tags.js +2 -1
  72. package/dist/contracts/teams.d.ts +21 -22
  73. package/dist/contracts/teams.js +0 -1
  74. package/dist/contracts/theme-json.d.ts +30 -0
  75. package/dist/contracts/theme-json.js +48 -0
  76. package/dist/contracts/variables.d.ts +0 -2
  77. package/dist/contracts/variables.js +0 -5
  78. package/dist/contracts/webhooks.d.ts +2 -0
  79. package/dist/contracts/webhooks.js +1 -1
  80. package/dist/contracts/zero.d.ts +5 -10
  81. package/dist/docs/agent-prose.d.ts +43 -3
  82. package/dist/docs/agent-prose.js +146 -7
  83. package/dist/docs/agent-setup.js +45 -13
  84. package/dist/docs/agent-solutions.d.ts +5 -5
  85. package/dist/docs/agent-solutions.js +2 -2
  86. package/dist/docs/catalog.d.ts +650 -0
  87. package/dist/docs/catalog.js +758 -0
  88. package/dist/docs/error-docs.d.ts +0 -2
  89. package/dist/docs/error-docs.js +77 -35
  90. package/dist/docs/index-build.d.ts +17 -0
  91. package/dist/docs/index-build.js +24 -0
  92. package/dist/docs/search.d.ts +54 -0
  93. package/dist/docs/search.js +96 -0
  94. package/dist/docs/skill-distribution.d.ts +5 -3
  95. package/dist/docs/skill-distribution.js +8 -8
  96. package/dist/utils/access-match.d.ts +39 -0
  97. package/dist/utils/access-match.js +296 -0
  98. package/dist/utils/auth-redirect.d.ts +3 -1
  99. package/dist/utils/auth-redirect.js +21 -1
  100. package/dist/utils/build-settings.d.ts +6 -0
  101. package/dist/utils/build-settings.js +429 -46
  102. package/dist/utils/claim-token.d.ts +8 -0
  103. package/dist/utils/claim-token.js +23 -2
  104. package/dist/utils/content-type.d.ts +1 -0
  105. package/dist/utils/content-type.js +1 -1
  106. package/dist/utils/credential-policy.d.ts +54 -0
  107. package/dist/utils/{access-policy.js → credential-policy.js} +28 -2
  108. package/dist/utils/gate-theme.d.ts +61 -0
  109. package/dist/utils/gate-theme.js +217 -0
  110. package/dist/utils/git-repository.d.ts +0 -1
  111. package/dist/utils/git-repository.js +0 -3
  112. package/dist/utils/id-hints.d.ts +8 -0
  113. package/dist/utils/id-hints.js +61 -0
  114. package/dist/utils/local-space-state.d.ts +91 -0
  115. package/dist/utils/local-space-state.js +251 -0
  116. package/dist/utils/oauth-signed-query.d.ts +8 -0
  117. package/dist/utils/oauth-signed-query.js +26 -0
  118. package/dist/utils/publish-detection.d.ts +0 -8
  119. package/dist/utils/publish-detection.js +0 -93
  120. package/dist/utils/publish-policy.d.ts +6 -5
  121. package/dist/utils/publish-policy.js +71 -7
  122. package/dist/utils/query-keys.d.ts +15 -4
  123. package/dist/utils/query-keys.js +27 -4
  124. package/dist/utils/runtime-paths.d.ts +0 -1
  125. package/dist/utils/runtime-paths.js +0 -1
  126. package/dist/utils/runtime-upload-batch.d.ts +18 -0
  127. package/dist/utils/runtime-upload-batch.js +90 -0
  128. package/dist/utils/runtime-upload.d.ts +2 -0
  129. package/dist/utils/runtime-upload.js +5 -0
  130. package/dist/utils/space-config.d.ts +4 -0
  131. package/dist/utils/space-config.js +10 -1
  132. package/dist/utils/space-theme.d.ts +2 -0
  133. package/dist/utils/space-theme.js +9 -0
  134. package/dist/utils/static-runtime-policy.d.ts +0 -21
  135. package/dist/utils/static-runtime-policy.js +19 -103
  136. package/dist/utils/upload-session.d.ts +1 -1
  137. package/dist/utils/wpcom-auth-redirects.d.ts +32 -2
  138. package/dist/utils/wpcom-auth-redirects.js +26 -10
  139. package/dist/vocabulary.d.ts +130 -30
  140. package/dist/vocabulary.js +77 -36
  141. package/package.json +16 -1
  142. package/dist/contracts/account.d.ts +0 -28
  143. package/dist/contracts/account.js +0 -54
  144. package/dist/contracts/intercom.d.ts +0 -6
  145. package/dist/contracts/intercom.js +0 -5
  146. package/dist/contracts/telemetry.d.ts +0 -2
  147. package/dist/contracts/telemetry.js +0 -1
  148. package/dist/utils/access-policy.d.ts +0 -39
  149. package/dist/utils/error-display.d.ts +0 -7
  150. package/dist/utils/error-display.js +0 -42
@@ -16,6 +16,7 @@ import { BRAND } from "../brand.js";
16
16
  // the receipt shape or secret handling changes, change it here once.
17
17
  const API_ORIGIN = BRAND.apiOrigin;
18
18
  const PUBLISH_ENDPOINT = `${API_ORIGIN}/v1/publish`;
19
+ const EXCHANGE_ENDPOINT = `${API_ORIGIN}/v1/anonymous-claim/exchange`;
19
20
  // Centralized secret/credential patterns excluded from a publish archive. The
20
21
  // `find` preflight and the `zip -x` exclusions are derived from the same list so
21
22
  // they can never disagree, and the no-install / skill copies stay identical.
@@ -24,7 +25,7 @@ export const ARCHIVE_SECRET_GLOBS = [
24
25
  ".npmrc",
25
26
  ".netrc",
26
27
  "*/.git/*",
27
- "*/.stattic/*",
28
+ "*/.spacefast/*",
28
29
  "*/.ssh/*",
29
30
  "*/.aws/*",
30
31
  "*/.kube/*",
@@ -43,9 +44,18 @@ function findExpr(globs) {
43
44
  .join(" -o ");
44
45
  }
45
46
  function zipExcludeExpr(globs) {
46
- // zip uses relative patterns: a leading "*/" is just a directory match, so
47
- // collapse it to the directory glob the archive root sees.
48
- return globs.map((glob) => `"${glob.replace(/^\*\//, "")}"`).join(" ");
47
+ // zip -x patterns need both the archive-root form and an any-depth form:
48
+ // ".spacefast/*" excludes only at the root, while "*/.spacefast/*" catches
49
+ // nested copies.
50
+ return globs
51
+ .flatMap((glob) => {
52
+ if (glob.startsWith("*/")) {
53
+ return [glob.slice(2), glob];
54
+ }
55
+ return [glob, `*/${glob}`];
56
+ })
57
+ .map((glob) => `"${glob}"`)
58
+ .join(" ");
49
59
  }
50
60
  /**
51
61
  * The credential rules every surface must repeat. Treat tokens as secrets, keep
@@ -58,6 +68,121 @@ export const SECRET_RULES_PROSE = [
58
68
  "present. On shared hosts, prefer one-off environment variables or restrictive temporary files,",
59
69
  "clear them after use, and avoid durable auth unless the user explicitly asks.",
60
70
  ].join("\n");
71
+ export const POSITIONING_PROSE = [
72
+ "Spacefast is a static host for AI-made web artifacts: permanent live URLs, immutable version",
73
+ "URLs, anonymous publish with a claim link, and agent continuation after claim. It serves",
74
+ "static files. It does not execute server code, run databases, or build-on-push on the",
75
+ "anonymous lane.",
76
+ "",
77
+ "Honest comparisons an agent can relay: Vercel and Netlify are broader app platforms;",
78
+ "Cloudflare Pages is edge-first static hosting; GitHub Pages is repository-native. Spacefast",
79
+ "optimizes for agent-safe one-shot publish, claim, versioning, rollback, and continuation.",
80
+ ].join("\n");
81
+ export const EXPLAIN_TO_USER_PROSE = [
82
+ "Relay `data.shareBlurb` verbatim when present. State anonymous expiry in user terms:",
83
+ "the space expires unless claimed by `data.claim.expiresAt`. After claim, the agent key is",
84
+ "named and revocable in the dashboard.",
85
+ ].join("\n");
86
+ export const FAILURE_CONDUCT_PROSE = [
87
+ "On failure, surface `error.code`, `error.docsUrl`, and `error.requestId`, then stop.",
88
+ "Do not invent undocumented endpoints. Do not read credentials out of auth files. Do not",
89
+ "retry a one-shot operation without reusing its `Idempotency-Key`.",
90
+ ].join("\n");
91
+ export const LANE_PICKER_PROSE = [
92
+ "Pick the lane by environment: filesystem plus repeat work means CLI or On-Device MCP; no",
93
+ "filesystem means hosted MCP; one-off publish means curl; CI means an agent account. After",
94
+ "success, recommend the best next-time setup for the user's client.",
95
+ ].join("\n");
96
+ export const HOW_TO_RESEARCH_PROSE = [
97
+ "For an error, fetch `error.docsUrl`. For capability questions, use `search_docs` or append",
98
+ "`.md` to website docs URLs. For contracts, read `publish-spec.json` or OpenAPI. Never guess",
99
+ "limits: publish, then read diagnostics.",
100
+ ].join("\n");
101
+ export const ENV_NOTES_PROSE = [
102
+ "claude.ai: allow `api.spacefast.com` in egress settings. Codex sandbox: escalate only the",
103
+ "network call. Terminal agents: use the CLI when filesystem access matters.",
104
+ ].join("\n");
105
+ /**
106
+ * The CHECK verb: before ever creating a space, look for the one the project
107
+ * already has. This is what keeps a returning agent from pushing a duplicate
108
+ * anonymous space instead of a new version.
109
+ */
110
+ export const CHECK_BEFORE_PUBLISH_PROSE = [
111
+ "Before creating a space, check whether this project already has one:",
112
+ "",
113
+ "- Look for `.spacefast/space.json` or `.spacefast/state.json`, walking up from the working",
114
+ " directory toward the filesystem root.",
115
+ "- Look for a publish receipt earlier in this conversation.",
116
+ "- When authenticated, list existing spaces (`sf spaces list`, or the `spaces_list` MCP tool).",
117
+ "",
118
+ "If any of these finds a space, publish a new version to that `spaceId` (see the update",
119
+ "instructions) instead of creating another space. Only create a new space when none exists",
120
+ "and the user wants a new site.",
121
+ ].join("\n");
122
+ /**
123
+ * The SAVE verb: persist the space id and credential after a first publish so
124
+ * every later publish targets the same space. The CLI and On-Device MCP write
125
+ * this state automatically; curl-only agents write the same files themselves.
126
+ */
127
+ export const SAVE_STATE_PROSE = [
128
+ "After the first publish, persist the space id and credential so every later publish updates",
129
+ "the same space instead of creating a new one. The CLI and On-Device MCP do this automatically",
130
+ "in `.spacefast/`; when publishing with curl, write the files yourself from the receipt:",
131
+ "",
132
+ "```bash",
133
+ "mkdir -p .spacefast",
134
+ "# non-secret, committable:",
135
+ `printf '{"space":"<spc_id>"}' > .spacefast/space.json`,
136
+ "# secret — never publish, never print:",
137
+ `printf '{"spaceId":"<spc_id>","claimToken":"<token>","apiUrl":"${API_ORIGIN}"}' > .spacefast/state.json`,
138
+ "grep -qx '.spacefast/state.json' .gitignore 2>/dev/null || echo '.spacefast/state.json' >> .gitignore",
139
+ "```",
140
+ "",
141
+ "`<spc_id>` is `data.space.id` and `<token>` is `data.claim.token` from the receipt. Keep",
142
+ "`.spacefast/state.json` out of publish archives, commits, logs, and chat.",
143
+ ].join("\n");
144
+ /**
145
+ * The UPDATE verb: a new version to the SAME space. Never re-run the
146
+ * first-publish recipe when saved state exists.
147
+ */
148
+ export const UPDATE_SPACE_PROSE = [
149
+ "To publish a new version of an existing space, send the same `spaceId` with bearer auth —",
150
+ "never re-run the first-publish recipe when saved state exists:",
151
+ "",
152
+ "```bash",
153
+ 'curl -sS -H "Authorization: Bearer <claim-token-or-access-token>" \\',
154
+ " -F 'spaceId=<spc_id>' \\",
155
+ ' -F "files=@index.html" \\',
156
+ ` ${PUBLISH_ENDPOINT}`,
157
+ "```",
158
+ "",
159
+ "Use the saved claim token for an unclaimed anonymous space, or an access token for owned",
160
+ "spaces. Send a folder as `-F archive=@site.zip` exactly like a first publish; the receipt",
161
+ "shape is identical.",
162
+ ].join("\n");
163
+ /**
164
+ * The CLAIM / CONTINUE verb: show the claim link, and after the user claims,
165
+ * self-correct by exchanging the claim token once for a durable credential.
166
+ */
167
+ export const CONTINUE_AFTER_CLAIM_PROSE = [
168
+ "Always show the user the claim link (`data.claim.url`) and its expiry (`data.claim.expiresAt`).",
169
+ 'If the user says "claimed", check claim status and exchange the saved claim token; do not wait',
170
+ "for a publish failure before continuing.",
171
+ "After the user claims the space in the browser, the saved claim token stops authorizing",
172
+ "publishes: the next publish fails with error code `space_claimed_credential_available`. That",
173
+ "failure is the signal to upgrade your credential — call the exchange endpoint exactly once:",
174
+ "",
175
+ "```bash",
176
+ 'curl -sS -X POST -H "Authorization: Bearer <claim-token>" \\',
177
+ ` ${EXCHANGE_ENDPOINT}`,
178
+ "```",
179
+ "",
180
+ 'It returns `{ "data": { "space": {...}, "credential": { "accessToken": "...", "label": "..." } } }`.',
181
+ "Save `data.credential.accessToken` into `.spacefast/state.json` (replace the `claimToken`",
182
+ 'field with `"accessToken"`), then retry the publish with the new bearer. The exchange works',
183
+ "exactly once; if it returns `continuation_used` or `continuation_unavailable`, ask the user",
184
+ "to mint an access token in the dashboard (Account → Access tokens).",
185
+ ].join("\n");
61
186
  /**
62
187
  * The zero-install publish sequence: one curl for a file, a secret-preflighted
63
188
  * zip for a folder. This is the load-bearing rung 0 — an agent that stops here
@@ -102,7 +227,9 @@ export const RECEIPT_SHAPE_PROSE = [
102
227
  " always show the user the claim link and the deadline so the space becomes theirs.",
103
228
  "- `data.claim.token` — a secret capability. For anonymous spaces, use it as",
104
229
  " `Authorization: Bearer <claim-token>` when polling `data.links.status`, finalizing uploads,",
105
- " or updating the same `spaceId`.",
230
+ " or updating the same `spaceId`. Save it to `.spacefast/state.json` so the next publish",
231
+ " updates this space. After the user claims the space, exchange it once at",
232
+ ` \`POST ${EXCHANGE_ENDPOINT}\` for a durable credential.`,
106
233
  " Never print it back to the user.",
107
234
  "- `data.links.status`, `resume`, `finalize`, and `promote` — follow-up API paths.",
108
235
  "- `error.code`, `error.docsUrl`, and `error.hint` — stable error code plus exact recovery docs and a next step.",
@@ -144,14 +271,26 @@ export const SIGNED_UPLOAD_PROSE = [
144
271
  "Do not base64 large archives into chat or MCP tool arguments.",
145
272
  ].join("\n");
146
273
  /**
147
- * Named fragments for the skill-template generator. The template carries
274
+ * Named fragments for the skill-template generator. The templates carry
148
275
  * `{{prose.secretRules}}`, `{{prose.publishSequence}}`,
149
- * `{{prose.receiptShape}}`, and `{{prose.signedUpload}}` placeholders;
276
+ * `{{prose.receiptShape}}`, `{{prose.signedUpload}}`,
277
+ * `{{prose.checkBeforePublish}}`, `{{prose.saveState}}`,
278
+ * `{{prose.updateSpace}}`, and `{{prose.continueAfterClaim}}` placeholders;
150
279
  * generate-skill.mjs substitutes these.
151
280
  */
152
281
  export const AGENT_PROSE = {
282
+ positioning: POSITIONING_PROSE,
153
283
  secretRules: SECRET_RULES_PROSE,
284
+ explainToUser: EXPLAIN_TO_USER_PROSE,
285
+ failureConduct: FAILURE_CONDUCT_PROSE,
154
286
  publishSequence: PUBLISH_SEQUENCE_PROSE,
155
287
  receiptShape: RECEIPT_SHAPE_PROSE,
156
288
  signedUpload: SIGNED_UPLOAD_PROSE,
289
+ checkBeforePublish: CHECK_BEFORE_PUBLISH_PROSE,
290
+ saveState: SAVE_STATE_PROSE,
291
+ updateSpace: UPDATE_SPACE_PROSE,
292
+ continueAfterClaim: CONTINUE_AFTER_CLAIM_PROSE,
293
+ lanePicker: LANE_PICKER_PROSE,
294
+ howToResearch: HOW_TO_RESEARCH_PROSE,
295
+ envNotes: ENV_NOTES_PROSE,
157
296
  };
@@ -1,11 +1,11 @@
1
1
  import { BRAND } from "@spacefast/common/brand";
2
- import { PUBLISH_SEQUENCE_PROSE, RECEIPT_SHAPE_PROSE, SECRET_RULES_PROSE, SIGNED_UPLOAD_PROSE, } from "@spacefast/common/docs/agent-prose";
3
- import { spacefastInstallCurlCommand, spacefastInstallPowerShellCommand, spacefastSkillInstallCommand, spacefastSkillUrl, } from "@spacefast/common/docs/skill-distribution";
2
+ import { CHECK_BEFORE_PUBLISH_PROSE, CONTINUE_AFTER_CLAIM_PROSE, ENV_NOTES_PROSE, FAILURE_CONDUCT_PROSE, HOW_TO_RESEARCH_PROSE, LANE_PICKER_PROSE, POSITIONING_PROSE, PUBLISH_SEQUENCE_PROSE, RECEIPT_SHAPE_PROSE, SAVE_STATE_PROSE, SECRET_RULES_PROSE, SIGNED_UPLOAD_PROSE, UPDATE_SPACE_PROSE, } from "@spacefast/common/docs/agent-prose";
3
+ import { spacefastInstallCurlCommand, spacefastInstallPowerShellCommand, spacefastSkillFetchCommand, spacefastSkillInstallCommand, spacefastSkillUrl, } from "@spacefast/common/docs/skill-distribution";
4
4
  export const agentSetupUrl = `${BRAND.agentSetupOrigin}/ai`;
5
5
  export const agentSetupTextUrl = `${BRAND.agentSetupOrigin}/ai.txt`;
6
6
  const agentSetupParsedUrl = new URL(agentSetupUrl);
7
7
  export const agentSetupHostLabel = agentSetupParsedUrl.host + agentSetupParsedUrl.pathname;
8
- export const agentSetupPrompt = `Fetch ${agentSetupUrl} and follow the instructions to publish for me. Ask me what I want to publish if it isn't obvious.`;
8
+ export const agentSetupPrompt = `Fetch ${agentSetupUrl} and follow it to publish this project — or update it if it's already on ${BRAND.productName}. Ask me what I want to publish if it isn't obvious.`;
9
9
  export function renderAgentSetupTemplate(value) {
10
10
  return value
11
11
  .replaceAll("{{AGENT_SETUP_URL}}", agentSetupUrl)
@@ -19,9 +19,13 @@ export function aiInstructionsText() {
19
19
  return [
20
20
  `# ${BRAND.productName} for AI agents`,
21
21
  "",
22
- `Official instructions for AI agents publishing to ${BRAND.productName}, the static host where`,
23
- "AI-made things are kept: permanent URLs, immutable versions, anonymous publish",
24
- "with a claim link. Static files only — server code is never executed.",
22
+ `Official instructions for AI agents publishing to ${BRAND.productName}.`,
23
+ "",
24
+ POSITIONING_PROSE,
25
+ "",
26
+ "## Before you publish (check for an existing space)",
27
+ "",
28
+ CHECK_BEFORE_PUBLISH_PROSE,
25
29
  "",
26
30
  "## Publish with curl (no install, no account)",
27
31
  "",
@@ -29,6 +33,14 @@ export function aiInstructionsText() {
29
33
  "",
30
34
  RECEIPT_SHAPE_PROSE,
31
35
  "",
36
+ "## Save your state",
37
+ "",
38
+ SAVE_STATE_PROSE,
39
+ "",
40
+ "## Update a space",
41
+ "",
42
+ UPDATE_SPACE_PROSE,
43
+ "",
32
44
  "## Big files and cloud agents",
33
45
  "",
34
46
  SIGNED_UPLOAD_PROSE,
@@ -37,6 +49,14 @@ export function aiInstructionsText() {
37
49
  "",
38
50
  SECRET_RULES_PROSE,
39
51
  "",
52
+ "## Failure conduct",
53
+ "",
54
+ FAILURE_CONDUCT_PROSE,
55
+ "",
56
+ "## How to research",
57
+ "",
58
+ HOW_TO_RESEARCH_PROSE,
59
+ "",
40
60
  'Add a bearer access token with `-H "Authorization: Bearer ..."` to publish into the user\'s',
41
61
  "team instead of anonymously. Agent clients should prefer OAuth client credentials. Errors come back as JSON with stable `code` values and a",
42
62
  "`docsUrl`; fetch the `docsUrl` when you need recovery steps.",
@@ -69,15 +89,17 @@ export function aiInstructionsText() {
69
89
  "```",
70
90
  "",
71
91
  "Use `--json` on any command when the output will be parsed. Publishing the same",
72
- "directory again updates the space saved in `.stattic/state.json`.",
92
+ "directory again updates the space saved in `.spacefast/state.json`.",
73
93
  "",
74
94
  "## MCP for agent clients",
75
95
  "",
96
+ LANE_PICKER_PROSE,
97
+ "",
76
98
  "Hosted MCP is the no-download cloud lane for ChatGPT, Codex, Claude, Cursor, and browser",
77
99
  "clients that can authenticate with OAuth/API bearer credentials:",
78
100
  "",
79
101
  "```text",
80
- "https://mcp.spacefast.com/mcp",
102
+ "https://mcp.spacefast.com",
81
103
  "```",
82
104
  "",
83
105
  "Request `mcp:tools` plus the API scopes the tools need: `teams:read` for team context,",
@@ -98,8 +120,8 @@ export function aiInstructionsText() {
98
120
  "`spacefast://account/current`, `spacefast://teams/current`, `spacefast://spaces/recent`,",
99
121
  "`spacefast://spaces/{spaceId}`, and `spacefast://policy/current` for bounded read-only",
100
122
  "context.",
101
- "`execute_spacefast` is dry-run-first; mutating multi-step workflows can return",
102
- "`approval_required` and continue through `resume_spacefast` after the user approves.",
123
+ "`execute` is dry-run-first; mutating multi-step workflows can return",
124
+ "`approval_required` and continue through `resume` after the user approves.",
103
125
  "",
104
126
  "Use On-Device MCP when the agent needs the user's checkout, path-based publish, or file edits:",
105
127
  "",
@@ -115,15 +137,19 @@ export function aiInstructionsText() {
115
137
  "`SPACEFAST_AGENT_CONFIG` with private_key_jwt when available; otherwise use one-job",
116
138
  "`SPACEFAST_TOKEN` secrets and mask logs. Do not persist personal auth in ephemeral runners.",
117
139
  "",
118
- "If your environment supports skill import, fetch the official skill for the",
119
- `complete command reference: \`${spacefastSkillInstallCommand}\` (source: ${spacefastSkillUrl}).`,
140
+ "If your environment supports skill import, install the official skill:",
141
+ `\`${spacefastSkillInstallCommand}\`. Raw markdown source: \`${spacefastSkillFetchCommand}\` (${spacefastSkillUrl}).`,
120
142
  "",
121
143
  "## After publishing",
122
144
  "",
123
145
  "- Share the live URL, the immutable version URL when ready, and — for anonymous spaces —",
124
146
  " the claim link with its expiry. If the receipt's immutable URL is null, poll the",
125
147
  " operation and version links with the claim token as bearer auth until the version is ready.",
126
- "- Never print access tokens, claim tokens, auth files, or `.stattic/state.json`.",
148
+ "- Never print access tokens, claim tokens, auth files, or `.spacefast/state.json`.",
149
+ "",
150
+ "## After the user claims",
151
+ "",
152
+ CONTINUE_AFTER_CLAIM_PROSE,
127
153
  "",
128
154
  "## Space conventions",
129
155
  "",
@@ -152,14 +178,20 @@ export function aiInstructionsText() {
152
178
  "## Going deeper",
153
179
  "",
154
180
  "- Docs index for agents: https://spacefast.com/llms.txt",
181
+ "- One-click connect (Claude Code, Claude, Codex, Cursor, VS Code): https://spacefast.com/agents",
155
182
  "- Agent guide: https://spacefast.com/docs/agents",
156
183
  "- CLI reference: https://spacefast.com/docs/cli",
157
184
  "- REST API + OpenAPI: https://spacefast.com/docs/api",
158
185
  "- Publish contract (machine-readable): https://spacefast.com/publish-spec.json",
186
+ "- Connectors-directory manifest (hosted MCP listing): https://spacefast.com/.well-known/connector.json",
159
187
  "- Every error code: https://spacefast.com/docs/errors",
160
188
  "",
161
189
  "Append `.md` to any docs URL for Markdown, or just fetch — agent user agents get",
162
190
  "Markdown automatically.",
163
191
  "",
192
+ "## Environment notes",
193
+ "",
194
+ ENV_NOTES_PROSE,
195
+ "",
164
196
  ].join("\n");
165
197
  }
@@ -1,4 +1,4 @@
1
- export declare const hostedMcpEndpointUrl = "https://mcp.spacefast.com/mcp";
1
+ export declare const hostedMcpEndpointUrl = "https://mcp.spacefast.com";
2
2
  export type AgentSolutionLane = "plugin" | "hosted-mcp" | "local-mcp" | "cli" | "prompt";
3
3
  export type AgentSolutionId = "codex" | "claude-code" | "claude-cowork" | "chatgpt" | "claude-ai" | "raycast" | "cursor" | "terminal" | "generic";
4
4
  export type AgentSolution = {
@@ -20,7 +20,7 @@ export declare const agentSolutions: readonly [{
20
20
  readonly lane: "plugin";
21
21
  readonly summary: "Recommended: Codex plugin.";
22
22
  readonly description: "Install the Spacefast skill/plugin so Codex can publish, update, and inspect spaces from the same setup path.";
23
- readonly commands: readonly ["npx skills add spacefast/plugins --skill spacefast -g"];
23
+ readonly commands: readonly ["npx -y skills add spacefast/plugins --skill spacefast -g -a codex -y"];
24
24
  readonly guideUrl: `${string}/for-codex`;
25
25
  readonly detailGuideUrl: `${string}/guides/how-to-use-with-codex`;
26
26
  readonly setupText: string;
@@ -53,7 +53,7 @@ export declare const agentSolutions: readonly [{
53
53
  readonly lane: "hosted-mcp";
54
54
  readonly summary: "Recommended: direct hosted MCP.";
55
55
  readonly description: "Connect ChatGPT-style cloud agents to Spacefast through hosted MCP; use the virtual workspace or signed uploads instead of local paths.";
56
- readonly commands: readonly ["https://mcp.spacefast.com/mcp"];
56
+ readonly commands: readonly ["https://mcp.spacefast.com"];
57
57
  readonly guideUrl: `${string}/docs/agents`;
58
58
  readonly setupText: string;
59
59
  }, {
@@ -63,7 +63,7 @@ export declare const agentSolutions: readonly [{
63
63
  readonly lane: "hosted-mcp";
64
64
  readonly summary: "Recommended: direct hosted MCP.";
65
65
  readonly description: "Connect the web Claude app to Spacefast through hosted MCP when it cannot read your local checkout.";
66
- readonly commands: readonly ["https://mcp.spacefast.com/mcp"];
66
+ readonly commands: readonly ["https://mcp.spacefast.com"];
67
67
  readonly guideUrl: `${string}/docs/agents`;
68
68
  readonly setupText: string;
69
69
  }, {
@@ -73,7 +73,7 @@ export declare const agentSolutions: readonly [{
73
73
  readonly lane: "hosted-mcp";
74
74
  readonly summary: "Recommended: direct hosted MCP.";
75
75
  readonly description: "Use hosted MCP for Raycast and similar clients that can connect to a remote MCP server but should not need a local Spacefast install.";
76
- readonly commands: readonly ["https://mcp.spacefast.com/mcp"];
76
+ readonly commands: readonly ["https://mcp.spacefast.com"];
77
77
  readonly guideUrl: `${string}/docs/agents`;
78
78
  readonly setupText: string;
79
79
  }, {
@@ -1,7 +1,7 @@
1
1
  import { BRAND } from "../brand.js";
2
2
  import { agentSetupPrompt, agentSetupTextUrl, agentSetupUrl } from "./agent-setup.js";
3
3
  import { spacefastClaudePluginAddCommand, spacefastClaudePluginInstallCommand, spacefastCodexSkillInstallCommand, spacefastInstallCurlCommand, } from "./skill-distribution.js";
4
- export const hostedMcpEndpointUrl = "https://mcp.spacefast.com/mcp";
4
+ export const hostedMcpEndpointUrl = "https://mcp.spacefast.com";
5
5
  function pluginText(label, commands, guideUrl) {
6
6
  return [
7
7
  `Set up ${BRAND.productName} for ${label}.`,
@@ -20,7 +20,7 @@ function hostedMcpText(label, guideUrl) {
20
20
  "",
21
21
  `MCP endpoint: ${hostedMcpEndpointUrl}`,
22
22
  "Transport: Streamable HTTP",
23
- "Resource: https://api.spacefast.com/mcp",
23
+ "Resource: https://mcp.spacefast.com",
24
24
  "Minimum scope: mcp:tools",
25
25
  "Common scopes: teams:read spaces:read spaces:write publish:write domains:read domains:write",
26
26
  "",