@spacefast/common 0.0.3 → 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 (159) 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 +829 -129
  8. package/dist/contracts/access.js +771 -148
  9. package/dist/contracts/activity.d.ts +5 -5
  10. package/dist/contracts/activity.js +28 -2
  11. package/dist/contracts/annotations.d.ts +3 -5
  12. package/dist/contracts/api-keys.d.ts +9 -10
  13. package/dist/contracts/api-keys.js +9 -6
  14. package/dist/contracts/archives.d.ts +22 -16
  15. package/dist/contracts/archives.js +11 -4
  16. package/dist/contracts/billing.d.ts +21 -30
  17. package/dist/contracts/builds.d.ts +21 -17
  18. package/dist/contracts/builds.js +12 -0
  19. package/dist/contracts/channels.d.ts +2 -2
  20. package/dist/contracts/common.d.ts +7 -5
  21. package/dist/contracts/common.js +4 -0
  22. package/dist/contracts/continuation.d.ts +63 -0
  23. package/dist/contracts/continuation.js +91 -0
  24. package/dist/contracts/countries.d.ts +2 -0
  25. package/dist/contracts/countries.js +261 -0
  26. package/dist/contracts/deployments.d.ts +34 -34
  27. package/dist/contracts/device-auth.d.ts +4 -11
  28. package/dist/contracts/device-auth.js +4 -0
  29. package/dist/contracts/docs.d.ts +119 -0
  30. package/dist/contracts/docs.js +51 -0
  31. package/dist/contracts/domains.d.ts +295 -253
  32. package/dist/contracts/domains.js +26 -4
  33. package/dist/contracts/enums.d.ts +17 -18
  34. package/dist/contracts/enums.js +25 -14
  35. package/dist/contracts/error-code-meta.d.ts +84 -0
  36. package/dist/contracts/error-code-meta.js +99 -10
  37. package/dist/contracts/error-codes.d.ts +1 -1
  38. package/dist/contracts/error-codes.js +17 -0
  39. package/dist/contracts/events.d.ts +13 -13
  40. package/dist/contracts/features.d.ts +93 -23
  41. package/dist/contracts/features.js +178 -13
  42. package/dist/contracts/git.d.ts +3 -9
  43. package/dist/contracts/ids.d.ts +5 -0
  44. package/dist/contracts/ids.js +5 -0
  45. package/dist/contracts/internal.d.ts +3 -3
  46. package/dist/contracts/mcp.d.ts +34 -36
  47. package/dist/contracts/me.d.ts +8 -8
  48. package/dist/contracts/me.js +1 -1
  49. package/dist/contracts/oauth-resources.d.ts +19 -8
  50. package/dist/contracts/oauth-resources.js +44 -13
  51. package/dist/contracts/operations.d.ts +2 -2
  52. package/dist/contracts/plan-policy.d.ts +4 -4
  53. package/dist/contracts/platform.d.ts +3 -105
  54. package/dist/contracts/platform.js +0 -50
  55. package/dist/contracts/push-new.d.ts +4 -4
  56. package/dist/contracts/quotas.d.ts +2 -0
  57. package/dist/contracts/quotas.js +8 -0
  58. package/dist/contracts/repository-connections.d.ts +1 -3
  59. package/dist/contracts/resources.d.ts +112 -28
  60. package/dist/contracts/resources.js +26 -2
  61. package/dist/contracts/routes.d.ts +0 -2
  62. package/dist/contracts/runtime-api.d.ts +365 -43
  63. package/dist/contracts/runtime-api.js +275 -6
  64. package/dist/contracts/sites.d.ts +45 -28
  65. package/dist/contracts/sites.js +21 -0
  66. package/dist/contracts/space-config.d.ts +201 -2
  67. package/dist/contracts/space-config.js +135 -5
  68. package/dist/contracts/spaces.d.ts +423 -162
  69. package/dist/contracts/spaces.js +94 -8
  70. package/dist/contracts/superadmin-emails.d.ts +7 -5
  71. package/dist/contracts/superadmin-emails.js +8 -0
  72. package/dist/contracts/superadmin-queues.d.ts +32 -32
  73. package/dist/contracts/superadmin-spaces.d.ts +418 -24
  74. package/dist/contracts/superadmin-spaces.js +24 -0
  75. package/dist/contracts/superadmin-tenants.d.ts +8 -8
  76. package/dist/contracts/superadmin.d.ts +17 -104
  77. package/dist/contracts/superadmin.js +6 -14
  78. package/dist/contracts/tags.d.ts +42 -41
  79. package/dist/contracts/tags.js +2 -1
  80. package/dist/contracts/teams.d.ts +40 -23
  81. package/dist/contracts/teams.js +20 -1
  82. package/dist/contracts/theme-json.d.ts +30 -0
  83. package/dist/contracts/theme-json.js +48 -0
  84. package/dist/contracts/transfers.d.ts +9 -9
  85. package/dist/contracts/variables.d.ts +14 -16
  86. package/dist/contracts/variables.js +0 -5
  87. package/dist/contracts/webhooks.d.ts +6 -4
  88. package/dist/contracts/webhooks.js +1 -1
  89. package/dist/contracts/zero.d.ts +13 -18
  90. package/dist/docs/agent-prose.d.ts +43 -3
  91. package/dist/docs/agent-prose.js +153 -10
  92. package/dist/docs/agent-setup.js +48 -15
  93. package/dist/docs/agent-solutions.d.ts +5 -5
  94. package/dist/docs/agent-solutions.js +2 -2
  95. package/dist/docs/catalog.d.ts +650 -0
  96. package/dist/docs/catalog.js +758 -0
  97. package/dist/docs/error-docs.d.ts +0 -2
  98. package/dist/docs/error-docs.js +89 -35
  99. package/dist/docs/index-build.d.ts +17 -0
  100. package/dist/docs/index-build.js +24 -0
  101. package/dist/docs/search.d.ts +54 -0
  102. package/dist/docs/search.js +96 -0
  103. package/dist/docs/skill-distribution.d.ts +5 -3
  104. package/dist/docs/skill-distribution.js +8 -8
  105. package/dist/utils/access-match.d.ts +39 -0
  106. package/dist/utils/access-match.js +296 -0
  107. package/dist/utils/auth-redirect.d.ts +3 -1
  108. package/dist/utils/auth-redirect.js +21 -1
  109. package/dist/utils/build-settings.d.ts +6 -0
  110. package/dist/utils/build-settings.js +429 -46
  111. package/dist/utils/claim-token.d.ts +8 -0
  112. package/dist/utils/claim-token.js +23 -2
  113. package/dist/utils/content-type.d.ts +1 -0
  114. package/dist/utils/content-type.js +1 -1
  115. package/dist/utils/credential-policy.d.ts +54 -0
  116. package/dist/utils/{access-policy.js → credential-policy.js} +28 -2
  117. package/dist/utils/gate-theme.d.ts +61 -0
  118. package/dist/utils/gate-theme.js +217 -0
  119. package/dist/utils/git-repository.d.ts +0 -1
  120. package/dist/utils/git-repository.js +0 -3
  121. package/dist/utils/id-hints.d.ts +8 -0
  122. package/dist/utils/id-hints.js +61 -0
  123. package/dist/utils/local-space-state.d.ts +91 -0
  124. package/dist/utils/local-space-state.js +251 -0
  125. package/dist/utils/oauth-signed-query.d.ts +8 -0
  126. package/dist/utils/oauth-signed-query.js +26 -0
  127. package/dist/utils/publish-detection.d.ts +0 -8
  128. package/dist/utils/publish-detection.js +0 -93
  129. package/dist/utils/publish-policy.d.ts +6 -5
  130. package/dist/utils/publish-policy.js +71 -7
  131. package/dist/utils/query-keys.d.ts +17 -6
  132. package/dist/utils/query-keys.js +27 -4
  133. package/dist/utils/runtime-paths.d.ts +0 -1
  134. package/dist/utils/runtime-paths.js +0 -1
  135. package/dist/utils/runtime-upload-batch.d.ts +18 -0
  136. package/dist/utils/runtime-upload-batch.js +90 -0
  137. package/dist/utils/runtime-upload.d.ts +2 -0
  138. package/dist/utils/runtime-upload.js +5 -0
  139. package/dist/utils/space-config.d.ts +4 -0
  140. package/dist/utils/space-config.js +10 -1
  141. package/dist/utils/space-theme.d.ts +2 -0
  142. package/dist/utils/space-theme.js +9 -0
  143. package/dist/utils/static-runtime-policy.d.ts +1 -1
  144. package/dist/utils/static-runtime-policy.js +47 -15
  145. package/dist/utils/upload-session.d.ts +1 -1
  146. package/dist/utils/wpcom-auth-redirects.d.ts +32 -2
  147. package/dist/utils/wpcom-auth-redirects.js +26 -10
  148. package/dist/vocabulary.d.ts +130 -30
  149. package/dist/vocabulary.js +77 -36
  150. package/package.json +16 -1
  151. package/dist/contracts/account.d.ts +0 -28
  152. package/dist/contracts/account.js +0 -54
  153. package/dist/contracts/intercom.d.ts +0 -6
  154. package/dist/contracts/intercom.js +0 -5
  155. package/dist/contracts/telemetry.d.ts +0 -2
  156. package/dist/contracts/telemetry.js +0 -1
  157. package/dist/utils/access-policy.d.ts +0 -39
  158. package/dist/utils/error-display.d.ts +0 -7
  159. package/dist/utils/error-display.js +0 -42
@@ -0,0 +1,133 @@
1
+ export declare const LOCAL_MCP_PACKAGE = "spacefast";
2
+ export declare const LOCAL_MCP_COMMAND = "npx";
3
+ export declare const LOCAL_MCP_ARGS: readonly ["-y", "spacefast", "mcp"];
4
+ /** The copy-paste one-liner form, e.g. `npx -y spacefast mcp`. */
5
+ export declare const LOCAL_MCP_COMMAND_LINE: string;
6
+ /**
7
+ * base64 of a UTF-8 string, without Buffer. Byte-identical to
8
+ * `Buffer.from(value, "utf8").toString("base64")`, so deeplinks stay stable
9
+ * whether they are built at the Astro build (Node) or in the dashboard (browser).
10
+ */
11
+ export declare function base64Utf8(value: string): string;
12
+ /** The on-device MCP server entry, byte-identical to the committed plugin `.mcp.json`. */
13
+ export declare function localMcpServersJson(): {
14
+ mcpServers: {
15
+ spacefast: {
16
+ command: string;
17
+ args: ("mcp" | "spacefast" | "-y")[];
18
+ env: {};
19
+ };
20
+ };
21
+ };
22
+ /**
23
+ * VS Code's `.vscode/mcp.json` uses a top-level `servers` key (not the
24
+ * `mcpServers` key Cursor/Claude Code use), so it gets its own generator —
25
+ * single-sourced from the same command/args/package so it can never drift.
26
+ * See https://code.visualstudio.com/docs/agent-customization/mcp-servers.
27
+ */
28
+ export declare function vscodeMcpServersJson(): {
29
+ servers: {
30
+ spacefast: {
31
+ type: string;
32
+ command: string;
33
+ args: ("mcp" | "spacefast" | "-y")[];
34
+ };
35
+ };
36
+ };
37
+ export declare function cursorHostedMcpDeeplink(mcpEndpoint: string): string;
38
+ export declare function vscodeHostedMcpDeeplink(mcpEndpoint: string): string;
39
+ /**
40
+ * The hosted server entry for Claude Code's `.mcp.json`. Claude Code rejects a
41
+ * bare `{ url }` as invalid, so the entry carries `type: "http"` — byte-identical
42
+ * to the committed `plugins/claude-code/.mcp.json`.
43
+ */
44
+ export declare function hostedMcpServersJson(mcpEndpoint: string): {
45
+ mcpServers: {
46
+ spacefast: {
47
+ type: string;
48
+ url: string;
49
+ };
50
+ };
51
+ };
52
+ /**
53
+ * The hosted server entry for Cursor's `~/.cursor/mcp.json`. Cursor's known-good
54
+ * shape is a bare `{ url }` (no `type`) — matching the committed
55
+ * `plugins/cursor/.mcp.json`. Kept separate from the Claude Code generator
56
+ * rather than adding `type` everywhere, since `type: "http"` in Cursor's file is
57
+ * untested territory.
58
+ */
59
+ export declare function cursorHostedMcpServersJson(mcpEndpoint: string): {
60
+ mcpServers: {
61
+ spacefast: {
62
+ url: string;
63
+ };
64
+ };
65
+ };
66
+ /** The hosted server entry for VS Code's `.vscode/mcp.json` (`servers` + `type: http`). */
67
+ export declare function vscodeHostedMcpServersJson(mcpEndpoint: string): {
68
+ servers: {
69
+ spacefast: {
70
+ type: string;
71
+ url: string;
72
+ };
73
+ };
74
+ };
75
+ export declare function codexHostedMcpToml(mcpEndpoint: string): string;
76
+ export declare const CODEX_MCP_TOML: string;
77
+ /**
78
+ * Claude Code's one-command hosted-MCP connect (`claude mcp add`). Parameterized
79
+ * by the hosted endpoint so the dashboard can point it at the runtime-derived
80
+ * endpoint while the marketing site passes the prod constant.
81
+ */
82
+ export declare function buildClaudeMcpAddCommand(mcpEndpoint: string): string;
83
+ /**
84
+ * Codex's hosted-MCP connect. `codex mcp add` registers the server; OAuth is a
85
+ * separate `codex mcp login` step, so both are chained — a bare `add` leaves the
86
+ * connection unauthenticated and the tools 401.
87
+ */
88
+ export declare function buildCodexMcpAddCommand(mcpEndpoint: string): string;
89
+ export type ConnectCopyLanguage = "bash" | "json" | "toml" | "text";
90
+ export type ConnectCopy = Readonly<{
91
+ /** Short label for the affordance and the copied-value toast. */
92
+ label: string;
93
+ /** The string written to the clipboard. */
94
+ value: string;
95
+ language: ConnectCopyLanguage;
96
+ }>;
97
+ export type ConnectDeeplink = Readonly<{
98
+ href: string;
99
+ label: string;
100
+ }>;
101
+ /** A downloadable artifact that wires the agent (e.g. the Claude desktop extension). */
102
+ export type ConnectDownload = Readonly<{
103
+ href: string;
104
+ label: string;
105
+ }>;
106
+ /**
107
+ * A single connect card: one agent, one primary action (a one-click deeplink or
108
+ * a copy of the command/endpoint that wires it), plus an optional secondary
109
+ * "copy the client config file" affordance.
110
+ */
111
+ export type ConnectTarget = Readonly<{
112
+ id: string;
113
+ name: string;
114
+ /** One short line on how this agent connects. */
115
+ blurb: string;
116
+ /** One-click URL-scheme install, when the client supports one. */
117
+ deeplink?: ConnectDeeplink;
118
+ /** The primary copy action when there is no deeplink (command or endpoint). */
119
+ primary?: ConnectCopy;
120
+ /** Secondary copy-the-config affordance (the client's MCP config file). */
121
+ config?: ConnectCopy;
122
+ /** A downloadable installer for clients that ship one (Claude Desktop). */
123
+ download?: ConnectDownload;
124
+ }>;
125
+ /**
126
+ * The per-agent connect catalog, parameterized by the hosted MCP endpoint.
127
+ * Every one-click and copy-config path carries the hosted endpoint (OAuth,
128
+ * nothing to install); on-device stdio is the CLI users' alternative and
129
+ * lives in the docs/marketing setup lanes, not here.
130
+ */
131
+ export declare function buildConnectTargets({ mcpEndpoint }: {
132
+ mcpEndpoint: string;
133
+ }): ConnectTarget[];
@@ -0,0 +1,224 @@
1
+ /*
2
+ * Shared, browser-safe agent connect catalog.
3
+ *
4
+ * One source of truth for "add Spacefast to your agent": the MCP launch config,
5
+ * the one-click deeplinks, and the per-agent connect entries. Both the marketing
6
+ * site (apps/www/src/lib/llmo.ts + agent-targets.ts, with the hardcoded prod
7
+ * endpoint) and the dashboard (apps/my /account/agents, with the runtime-derived
8
+ * hosted endpoint) consume these, so every "connect an agent" surface advertises
9
+ * the identical command, package, and config — they can never drift apart.
10
+ *
11
+ * ISOMORPHIC ON PURPOSE: no Buffer, no process, no Node-only APIs. The dashboard
12
+ * renders this in the browser, so base64 goes through TextEncoder + btoa (both
13
+ * standard in browsers, Node 16+, and Bun) rather than Buffer.
14
+ */
15
+ import { spacefastClaudePluginAddCommand, spacefastClaudePluginInstallCommand, spacefastCodexPluginAddCommand, spacefastCodexPluginInstallCommand, } from "../docs/skill-distribution.js";
16
+ export const LOCAL_MCP_PACKAGE = "spacefast";
17
+ export const LOCAL_MCP_COMMAND = "npx";
18
+ export const LOCAL_MCP_ARGS = ["-y", LOCAL_MCP_PACKAGE, "mcp"];
19
+ /** The copy-paste one-liner form, e.g. `npx -y spacefast mcp`. */
20
+ export const LOCAL_MCP_COMMAND_LINE = `${LOCAL_MCP_COMMAND} ${LOCAL_MCP_ARGS.join(" ")}`;
21
+ /**
22
+ * base64 of a UTF-8 string, without Buffer. Byte-identical to
23
+ * `Buffer.from(value, "utf8").toString("base64")`, so deeplinks stay stable
24
+ * whether they are built at the Astro build (Node) or in the dashboard (browser).
25
+ */
26
+ export function base64Utf8(value) {
27
+ const bytes = new TextEncoder().encode(value);
28
+ let binary = "";
29
+ for (const byte of bytes) {
30
+ binary += String.fromCharCode(byte);
31
+ }
32
+ return btoa(binary);
33
+ }
34
+ /** The on-device MCP server entry, byte-identical to the committed plugin `.mcp.json`. */
35
+ export function localMcpServersJson() {
36
+ return {
37
+ mcpServers: {
38
+ [LOCAL_MCP_PACKAGE]: {
39
+ command: LOCAL_MCP_COMMAND,
40
+ args: [...LOCAL_MCP_ARGS],
41
+ env: {},
42
+ },
43
+ },
44
+ };
45
+ }
46
+ /**
47
+ * VS Code's `.vscode/mcp.json` uses a top-level `servers` key (not the
48
+ * `mcpServers` key Cursor/Claude Code use), so it gets its own generator —
49
+ * single-sourced from the same command/args/package so it can never drift.
50
+ * See https://code.visualstudio.com/docs/agent-customization/mcp-servers.
51
+ */
52
+ export function vscodeMcpServersJson() {
53
+ return {
54
+ servers: {
55
+ [LOCAL_MCP_PACKAGE]: {
56
+ type: "stdio",
57
+ command: LOCAL_MCP_COMMAND,
58
+ args: [...LOCAL_MCP_ARGS],
59
+ },
60
+ },
61
+ };
62
+ }
63
+ /*
64
+ * ONE-CLICK PATHS ARE ALWAYS HOSTED. Policy: hosted MCP for cloud agents,
65
+ * on-device for local ones — but a one-click install must never depend on the
66
+ * user having npm/npx. The hosted URL server needs no runtime at all (the
67
+ * client speaks HTTP + OAuth), so every deeplink and every primary action
68
+ * carries the hosted endpoint. On-device stdio (`npx -y spacefast mcp`) stays
69
+ * available as the explicitly-labeled alternative for people who run the CLI —
70
+ * their environment already provides npx.
71
+ */
72
+ // Cursor one-click MCP install link — the canonical form Cursor's own directory
73
+ // badges emit is the HTTPS web link (`https://cursor.com/install-mcp`), which
74
+ // renders as a normal anchor everywhere; the `cursor://` scheme still works but
75
+ // isn't what Cursor advertises. The inner config is the hosted URL entry
76
+ // (base64-encoded); Cursor handles the OAuth dance itself.
77
+ export function cursorHostedMcpDeeplink(mcpEndpoint) {
78
+ return `https://cursor.com/install-mcp?name=${LOCAL_MCP_PACKAGE}&config=${encodeURIComponent(base64Utf8(JSON.stringify({ url: mcpEndpoint })))}`;
79
+ }
80
+ // VS Code one-click MCP install link — the HTTPS redirect service GitHub's
81
+ // install badges use, which works for stable VS Code (not just Insiders). The
82
+ // config is the server object WITHOUT the name (name is the query param), and
83
+ // `type: "http"` is mandatory — VS Code treats a bare `url` as a stdio command
84
+ // and fails confusingly.
85
+ export function vscodeHostedMcpDeeplink(mcpEndpoint) {
86
+ return `https://insiders.vscode.dev/redirect/mcp/install?name=${LOCAL_MCP_PACKAGE}&config=${encodeURIComponent(JSON.stringify({ type: "http", url: mcpEndpoint }))}`;
87
+ }
88
+ /**
89
+ * The hosted server entry for Claude Code's `.mcp.json`. Claude Code rejects a
90
+ * bare `{ url }` as invalid, so the entry carries `type: "http"` — byte-identical
91
+ * to the committed `plugins/claude-code/.mcp.json`.
92
+ */
93
+ export function hostedMcpServersJson(mcpEndpoint) {
94
+ return {
95
+ mcpServers: {
96
+ [LOCAL_MCP_PACKAGE]: { type: "http", url: mcpEndpoint },
97
+ },
98
+ };
99
+ }
100
+ /**
101
+ * The hosted server entry for Cursor's `~/.cursor/mcp.json`. Cursor's known-good
102
+ * shape is a bare `{ url }` (no `type`) — matching the committed
103
+ * `plugins/cursor/.mcp.json`. Kept separate from the Claude Code generator
104
+ * rather than adding `type` everywhere, since `type: "http"` in Cursor's file is
105
+ * untested territory.
106
+ */
107
+ export function cursorHostedMcpServersJson(mcpEndpoint) {
108
+ return {
109
+ mcpServers: {
110
+ [LOCAL_MCP_PACKAGE]: { url: mcpEndpoint },
111
+ },
112
+ };
113
+ }
114
+ /** The hosted server entry for VS Code's `.vscode/mcp.json` (`servers` + `type: http`). */
115
+ export function vscodeHostedMcpServersJson(mcpEndpoint) {
116
+ return {
117
+ servers: {
118
+ [LOCAL_MCP_PACKAGE]: { type: "http", url: mcpEndpoint },
119
+ },
120
+ };
121
+ }
122
+ // Codex reads MCP servers from `~/.codex/config.toml`; the hosted entry is a
123
+ // bare streamable-HTTP url (same lane the committed codex plugin ships).
124
+ export function codexHostedMcpToml(mcpEndpoint) {
125
+ return [`[mcp_servers.${LOCAL_MCP_PACKAGE}]`, `url = ${JSON.stringify(mcpEndpoint)}`].join("\n");
126
+ }
127
+ // The on-device stdio TOML, for CLI users whose environment provides npx.
128
+ export const CODEX_MCP_TOML = [
129
+ `[mcp_servers.${LOCAL_MCP_PACKAGE}]`,
130
+ `command = ${JSON.stringify(LOCAL_MCP_COMMAND)}`,
131
+ `args = [${LOCAL_MCP_ARGS.map((arg) => JSON.stringify(arg)).join(", ")}]`,
132
+ ].join("\n");
133
+ /**
134
+ * Claude Code's one-command hosted-MCP connect (`claude mcp add`). Parameterized
135
+ * by the hosted endpoint so the dashboard can point it at the runtime-derived
136
+ * endpoint while the marketing site passes the prod constant.
137
+ */
138
+ export function buildClaudeMcpAddCommand(mcpEndpoint) {
139
+ return `claude mcp add --transport http ${LOCAL_MCP_PACKAGE} ${mcpEndpoint}`;
140
+ }
141
+ /**
142
+ * Codex's hosted-MCP connect. `codex mcp add` registers the server; OAuth is a
143
+ * separate `codex mcp login` step, so both are chained — a bare `add` leaves the
144
+ * connection unauthenticated and the tools 401.
145
+ */
146
+ export function buildCodexMcpAddCommand(mcpEndpoint) {
147
+ return `codex mcp add ${LOCAL_MCP_PACKAGE} --url ${mcpEndpoint} && codex mcp login ${LOCAL_MCP_PACKAGE}`;
148
+ }
149
+ /**
150
+ * The per-agent connect catalog, parameterized by the hosted MCP endpoint.
151
+ * Every one-click and copy-config path carries the hosted endpoint (OAuth,
152
+ * nothing to install); on-device stdio is the CLI users' alternative and
153
+ * lives in the docs/marketing setup lanes, not here.
154
+ */
155
+ export function buildConnectTargets({ mcpEndpoint }) {
156
+ const cursorConfigJson = JSON.stringify(cursorHostedMcpServersJson(mcpEndpoint), null, 2);
157
+ const vscodeHostedConfigJson = JSON.stringify(vscodeHostedMcpServersJson(mcpEndpoint), null, 2);
158
+ return [
159
+ {
160
+ // The plugin is the recommended lane for CLI agents that support one:
161
+ // one paste ships the publish skill AND the MCP servers (hosted primary)
162
+ // and stays updated through the marketplace. `claude mcp add` remains
163
+ // the minimal MCP-only path in the config slot and on /agents.
164
+ id: "claude-code",
165
+ name: "Claude Code",
166
+ blurb: "One paste installs the plugin: publish skill plus MCP, updated from the marketplace.",
167
+ primary: {
168
+ label: "Install plugin",
169
+ value: `${spacefastClaudePluginAddCommand} && ${spacefastClaudePluginInstallCommand}`,
170
+ language: "bash",
171
+ },
172
+ config: {
173
+ label: "MCP only: claude mcp add",
174
+ value: buildClaudeMcpAddCommand(mcpEndpoint),
175
+ language: "bash",
176
+ },
177
+ },
178
+ {
179
+ id: "cursor",
180
+ name: "Cursor",
181
+ blurb: "One click adds hosted MCP. OAuth sign-in, nothing to install.",
182
+ deeplink: { href: cursorHostedMcpDeeplink(mcpEndpoint), label: "Add to Cursor" },
183
+ config: { label: "~/.cursor/mcp.json", value: cursorConfigJson, language: "json" },
184
+ },
185
+ {
186
+ id: "vscode",
187
+ name: "VS Code",
188
+ blurb: "One click adds hosted MCP for Copilot agent mode.",
189
+ deeplink: { href: vscodeHostedMcpDeeplink(mcpEndpoint), label: "Add to VS Code" },
190
+ config: { label: ".vscode/mcp.json", value: vscodeHostedConfigJson, language: "json" },
191
+ },
192
+ {
193
+ id: "codex",
194
+ name: "Codex",
195
+ blurb: "One paste installs the plugin: publish skill plus MCP, updated from the marketplace.",
196
+ primary: {
197
+ label: "Install plugin",
198
+ value: `${spacefastCodexPluginAddCommand} && ${spacefastCodexPluginInstallCommand}`,
199
+ language: "bash",
200
+ },
201
+ config: {
202
+ label: "MCP only: codex mcp add",
203
+ value: buildCodexMcpAddCommand(mcpEndpoint),
204
+ language: "bash",
205
+ },
206
+ },
207
+ {
208
+ id: "claude",
209
+ name: "Claude",
210
+ blurb: "Settings → Connectors → Add custom connector, paste this endpoint. Or grab the desktop extension.",
211
+ primary: { label: "MCP endpoint", value: mcpEndpoint, language: "text" },
212
+ download: {
213
+ href: "https://github.com/spacefast/plugins/releases/latest/download/claude-desktop.mcpb",
214
+ label: "Download desktop extension",
215
+ },
216
+ },
217
+ {
218
+ id: "chatgpt",
219
+ name: "ChatGPT",
220
+ blurb: "Turn on Developer mode (Settings → Apps & Connectors → Advanced), then Connectors → Create with this endpoint.",
221
+ primary: { label: "MCP endpoint", value: mcpEndpoint, language: "text" },
222
+ },
223
+ ];
224
+ }
package/dist/brand.d.ts CHANGED
@@ -13,3 +13,4 @@ export declare const BRAND: {
13
13
  readonly managementHostnameApex: "view.fast";
14
14
  };
15
15
  export declare const ERROR_DOCS_BASE_URL: `${string}/docs/errors`;
16
+ export declare const GITHUB_CHECK_RUN_NAME: "Spacefast Builds";
package/dist/brand.js CHANGED
@@ -22,3 +22,8 @@ export const BRAND = {
22
22
  // plan: `${websiteOrigin}/docs/errors/{code}` forever). Lives next to the
23
23
  // brand origin it derives from; `error-codes.ts` consumes it.
24
24
  export const ERROR_DOCS_BASE_URL = `${BRAND.websiteOrigin}/docs/errors`;
25
+ // The GitHub check-run name every build reports under. One constant because the
26
+ // create and update paths live in different modules and drifted once
27
+ // ("Stattic" vs "Spacefast") — GitHub keys check runs by name, so a mismatch
28
+ // shows two orphaned checks per commit.
29
+ export const GITHUB_CHECK_RUN_NAME = `${BRAND.productName} Builds`;
@@ -12,14 +12,20 @@ export type EnvDomains = {
12
12
  /** Fully-qualified hostname per service. */
13
13
  readonly hosts: Readonly<Record<Service, string>>;
14
14
  };
15
- /** The full domain map for an environment. */
16
- export declare function domainsFor(env: DeployEnv): EnvDomains;
15
+ /** The production apex. Everything else about prod derives from this string. */
16
+ export declare const PROD_ENV_DOMAIN: "spacefast.com";
17
+ /** The local-dev apex (portless serves every subdomain over HTTPS). */
18
+ export declare const DEV_ENV_DOMAIN: "sf.localhost";
19
+ /**
20
+ * Construct the full per-service host map from a single env domain
21
+ * (`spacefast.com`, `sf.localhost`, …). One knob — services are always
22
+ * `<service>.<domain>` over https, with two deliberate exceptions:
23
+ * the marketing site sits on the bare prod apex, and the internal handbook
24
+ * lives on the view.fast infra apex in prod.
25
+ */
26
+ export declare function envDomainsFor(domain: string): EnvDomains;
17
27
  /** Origin (scheme + host, no trailing slash) for a service in an environment. */
18
28
  export declare function serviceOrigin(service: Service, env: DeployEnv): string;
19
- /** Cookie domain that scopes auth across all subdomains of an environment. */
20
- export declare function cookieDomainFor(env: DeployEnv): string;
21
- /** Domain Search Terminal (Fly.io); its web redirects to spacefast.com/domains. */
22
- export declare const FAST_DOMAIN_SEARCH_APEX: "fastdomainsearch.com";
23
29
  /** Atomic infrastructure apex used for public managed/custom domains. */
24
30
  export declare const VIEW_FAST_APEX: "view.fast";
25
31
  /** Apex for default space hostnames: `{hostLabel}.view.fast`. */
@@ -5,37 +5,39 @@
5
5
  //
6
6
  // Env-var NAMES intentionally stay `SPACEFAST_*` (see migration plan); only the
7
7
  // VALUES they carry are produced from this registry.
8
- const PROD = {
9
- apex: "spacefast.com",
10
- cookieDomain: ".spacefast.com",
11
- protocol: "https",
12
- hosts: {
13
- www: "spacefast.com",
14
- api: "api.spacefast.com",
15
- dashboard: "my.spacefast.com",
16
- superadmin: "superadmin.spacefast.com",
17
- cast: "cast.spacefast.com",
18
- mcp: "mcp.spacefast.com",
19
- fieldguide: "fieldguide.view.fast",
20
- },
21
- };
8
+ /** The production apex. Everything else about prod derives from this string. */
9
+ export const PROD_ENV_DOMAIN = "spacefast.com";
10
+ /** The local-dev apex (portless serves every subdomain over HTTPS). */
11
+ export const DEV_ENV_DOMAIN = "sf.localhost";
12
+ /**
13
+ * Construct the full per-service host map from a single env domain
14
+ * (`spacefast.com`, `sf.localhost`, …). One knob — services are always
15
+ * `<service>.<domain>` over https, with two deliberate exceptions:
16
+ * the marketing site sits on the bare prod apex, and the internal handbook
17
+ * lives on the view.fast infra apex in prod.
18
+ */
19
+ export function envDomainsFor(domain) {
20
+ const prod = domain === PROD_ENV_DOMAIN;
21
+ return {
22
+ apex: domain,
23
+ cookieDomain: `.${domain}`,
24
+ protocol: "https",
25
+ hosts: {
26
+ www: prod ? domain : `www.${domain}`,
27
+ api: `api.${domain}`,
28
+ dashboard: `my.${domain}`,
29
+ superadmin: `superadmin.${domain}`,
30
+ cast: `cast.${domain}`,
31
+ mcp: `mcp.${domain}`,
32
+ fieldguide: prod ? "fieldguide.view.fast" : `fieldguide.${domain}`,
33
+ },
34
+ };
35
+ }
36
+ const PROD = envDomainsFor(PROD_ENV_DOMAIN);
22
37
  // Local dev runs every service under *.sf.localhost via portless (HTTPS, no
23
38
  // ports in the URL — portless proxies the raw dev ports). `remove all other
24
39
  // portless records` per the migration spec: sf.localhost is the only TLD.
25
- const DEV = {
26
- apex: "sf.localhost",
27
- cookieDomain: ".sf.localhost",
28
- protocol: "https",
29
- hosts: {
30
- www: "www.sf.localhost",
31
- api: "api.sf.localhost",
32
- dashboard: "my.sf.localhost",
33
- superadmin: "superadmin.sf.localhost",
34
- cast: "cast.sf.localhost",
35
- mcp: "mcp.sf.localhost",
36
- fieldguide: "fieldguide.sf.localhost",
37
- },
38
- };
40
+ const DEV = envDomainsFor(DEV_ENV_DOMAIN);
39
41
  // The test stack shares the sf.localhost hostname scheme but runs as its own
40
42
  // isolated compose project on its own ports/resources (see ports config), so it
41
43
  // can run side-by-side with dev. URL host scheme is identical to dev.
@@ -45,23 +47,13 @@ const BY_ENV = {
45
47
  test: TEST,
46
48
  prod: PROD,
47
49
  };
48
- /** The full domain map for an environment. */
49
- export function domainsFor(env) {
50
- return BY_ENV[env];
51
- }
52
50
  /** Origin (scheme + host, no trailing slash) for a service in an environment. */
53
51
  export function serviceOrigin(service, env) {
54
52
  const d = BY_ENV[env];
55
53
  return `${d.protocol}://${d.hosts[service]}`;
56
54
  }
57
- /** Cookie domain that scopes auth across all subdomains of an environment. */
58
- export function cookieDomainFor(env) {
59
- return BY_ENV[env].cookieDomain;
60
- }
61
55
  // --- Apexes that are NOT spacefast.com subdomains -------------------------------
62
56
  // These live outside the per-env map because they are stable infra identities.
63
- /** Domain Search Terminal (Fly.io); its web redirects to spacefast.com/domains. */
64
- export const FAST_DOMAIN_SEARCH_APEX = "fastdomainsearch.com";
65
57
  /** Atomic infrastructure apex used for public managed/custom domains. */
66
58
  export const VIEW_FAST_APEX = "view.fast";
67
59
  // D-4 resolved 2026-06-26: default space hostnames are