@spacefast/common 0.0.20 → 0.0.23

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.
@@ -93,15 +93,18 @@ export declare function vscodeHostedMcpServersJson(mcpEndpoint: string): {
93
93
  };
94
94
  };
95
95
  };
96
- /** A complete, schema-pinned OpenCode V2 config for the hosted MCP server. */
96
+ /**
97
+ * A complete, schema-pinned OpenCode V2 config for the hosted MCP server.
98
+ * OpenCode's `mcp` key is a flat map keyed by server name (no `servers` level) —
99
+ * the same shape `sf mcp install` writes (packages/cli/src/agent-setup.ts).
100
+ */
97
101
  export declare function opencodeHostedMcpConfig(mcpEndpoint: string): {
98
102
  $schema: string;
99
103
  mcp: {
100
- servers: {
101
- spacefast: {
102
- type: string;
103
- url: string;
104
- };
104
+ spacefast: {
105
+ type: string;
106
+ url: string;
107
+ enabled: boolean;
105
108
  };
106
109
  };
107
110
  };
@@ -165,16 +165,19 @@ export function vscodeHostedMcpServersJson(mcpEndpoint) {
165
165
  },
166
166
  };
167
167
  }
168
- /** A complete, schema-pinned OpenCode V2 config for the hosted MCP server. */
168
+ /**
169
+ * A complete, schema-pinned OpenCode V2 config for the hosted MCP server.
170
+ * OpenCode's `mcp` key is a flat map keyed by server name (no `servers` level) —
171
+ * the same shape `sf mcp install` writes (packages/cli/src/agent-setup.ts).
172
+ */
169
173
  export function opencodeHostedMcpConfig(mcpEndpoint) {
170
174
  return {
171
175
  $schema: "https://opencode.ai/config.json",
172
176
  mcp: {
173
- servers: {
174
- [LOCAL_MCP_PACKAGE]: {
175
- type: "remote",
176
- url: mcpEndpoint,
177
- },
177
+ [LOCAL_MCP_PACKAGE]: {
178
+ type: "remote",
179
+ url: mcpEndpoint,
180
+ enabled: true,
178
181
  },
179
182
  },
180
183
  };
@@ -217,12 +217,16 @@ export declare const teamUsageResponseSchema: z.ZodObject<{
217
217
  storageQuotaBytes: z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"unlimited">]>;
218
218
  storageOverageBytes: z.ZodNumber;
219
219
  storageCalculatedAt: z.ZodNullable<z.ZodString>;
220
- storageOverQuotaSince: z.ZodNullable<z.ZodString>;
221
- storageWarningSentAt: z.ZodNullable<z.ZodString>;
222
220
  buildsDeploysThisMonth: z.ZodNumber;
223
221
  buildsDeploysMonthly: z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"unlimited">]>;
224
222
  meterStartedAt: z.ZodNullable<z.ZodString>;
225
223
  }, z.core.$strip>;
224
+ spaceStorage: z.ZodArray<z.ZodObject<{
225
+ spaceId: z.ZodString;
226
+ slug: z.ZodString;
227
+ title: z.ZodString;
228
+ storageBytes: z.ZodNumber;
229
+ }, z.core.$strip>>;
226
230
  }, z.core.$strip>;
227
231
  export declare const teamInvitationPreviewSchema: z.ZodObject<{
228
232
  id: z.ZodString;
@@ -144,14 +144,6 @@ export const teamUsageResponseSchema = z.object({
144
144
  .string()
145
145
  .nullable()
146
146
  .describe("Instant when storage was last accounted."),
147
- storageOverQuotaSince: z
148
- .string()
149
- .nullable()
150
- .describe("Instant when the team first went over its storage quota."),
151
- storageWarningSentAt: z
152
- .string()
153
- .nullable()
154
- .describe("Instant when the over-quota warning went out."),
155
147
  buildsDeploysThisMonth: z
156
148
  .number()
157
149
  .int()
@@ -163,6 +155,16 @@ export const teamUsageResponseSchema = z.object({
163
155
  .describe("Instant when the current metering month started."),
164
156
  })
165
157
  .describe("Usage counters against the named plan limits."),
158
+ spaceStorage: z
159
+ .array(z.object({
160
+ spaceId: z.string().describe("Space id."),
161
+ slug: z.string().describe("Space slug."),
162
+ title: z.string().describe("Space display title."),
163
+ storageBytes: z
164
+ .number()
165
+ .describe("Deduplicated bytes this space's ready versions hold. Spaces sharing files each count them, so the sum can exceed the team total."),
166
+ }))
167
+ .describe("Per-space storage breakdown for spaces the caller can read."),
166
168
  });
167
169
  // Served by `GET /v1/teams/invitations/{invitationId}/preview`: the unauthenticated
168
170
  // invite landing view (email is masked, never the full address).
@@ -65,8 +65,8 @@ export const POSITIONING_PROSE = [
65
65
  "optimizes for agent-safe one-shot publish, claim, versioning, rollback, and continuation.",
66
66
  ].join("\n");
67
67
  export const EXPLAIN_TO_USER_PROSE = [
68
- "Present Open and Claim as the only actions. State anonymous expiry in user terms: the Space",
69
- "exists until `data.claim.expiresAt` unless claimed; claiming preserves Open and removes its expiry.",
68
+ "Present Access and Claim as the only actions. State anonymous expiry in user terms: the Space",
69
+ "exists until `data.claim.expiresAt` unless claimed; claiming preserves Access and removes its expiry.",
70
70
  "Keep live and immutable Version addresses as receipt metadata. After claim, the agent key is named",
71
71
  "and revocable in the dashboard.",
72
72
  ].join("\n");
@@ -88,7 +88,7 @@ export const HOW_TO_RESEARCH_PROSE = [
88
88
  /** Curl/API skill lane: docs URLs only — no MCP or CLI tools required. */
89
89
  export const HOW_TO_RESEARCH_API_PROSE = [
90
90
  "For an error, fetch the problem document's `type` URL. For capability questions, append `.md` to website docs",
91
- "URLs (for example `https://spacefast.com/docs/getting-started/agents.md`) or read",
91
+ "URLs (for example `https://spacefast.com/docs/agents.md`) or read",
92
92
  "`https://spacefast.com/llms.txt`. For contracts, read `https://spacefast.com/publish-spec.json`",
93
93
  "or the OpenAPI linked from the API docs. Never guess limits: publish, then read diagnostics.",
94
94
  ].join("\n");
@@ -107,7 +107,7 @@ export const ENV_NOTES_API_PROSE = [
107
107
  "claude.ai: allow `api.spacefast.com` in egress settings. Codex sandbox: escalate only the",
108
108
  "network call to `api.spacefast.com`. This skill is complete with curl and the docs links above;",
109
109
  "CLI and MCP are optional upgrades documented at https://spacefast.com/docs/cli and",
110
- "https://spacefast.com/docs/getting-started/agents.",
110
+ "https://spacefast.com/docs/agents.",
111
111
  ].join("\n");
112
112
  /**
113
113
  * The CHECK verb: before ever creating a space, look for the one the project
@@ -378,10 +378,10 @@ export const RECEIPT_SHAPE_PROSE = [
378
378
  "The JSON receipt is the source of truth:",
379
379
  "",
380
380
  "- `data.space.liveUrl` — the live URL.",
381
- "- `data.open.url` and `data.open.expiresAt` — reusable access; claim preserves the URL and changes its expiry to null.",
381
+ "- `data.access.url` and `data.access.expiresAt` — reusable access; claim preserves the URL and changes its expiry to null.",
382
382
  " It is not a stable URL or recipient Link; clients must not persist it as Space state.",
383
383
  "- `data.version.immutableUrl` — the permanent address of the frozen Version. The bare URL",
384
- " carries no authority: use the receipt's Open URL for the author's browser or create a scoped",
384
+ " carries no authority: use the receipt's Access URL for the author's browser or create a scoped",
385
385
  " Link for a recipient. It is reserved in the initial receipt. If the publish is still",
386
386
  " finalizing, poll `data.links.status` with the claim token until the status is `ready`.",
387
387
  "- `data.upload` — signed upload instructions for manifest publishes when file bytes were not sent",
@@ -306,9 +306,9 @@ export function aiInstructionsText() {
306
306
  "If `sf` is already on PATH, use it. The package is `spacefast`; the default binary is `sf`.",
307
307
  "",
308
308
  "```bash",
309
- "sf setup agent --agent auto --connect # pick the right MCP lane and write client config",
309
+ "sf setup agent --agent auto # pick the right MCP lane and write client config",
310
310
  "sf publish {file-or-dir} # publish; prints live, version, and claim URLs",
311
- "sf versions # list versions",
311
+ "sf versions ls # list versions",
312
312
  "sf rollback {version} # make an earlier ready version live, no rebuild",
313
313
  "sf login # device flow; mints a scoped API key",
314
314
  "sf --help # the full command surface",
@@ -346,9 +346,9 @@ export function aiInstructionsText() {
346
346
  "Use On-Device MCP when the agent needs path-based publish from the user's checkout:",
347
347
  "",
348
348
  "```bash",
349
- "sf setup agent --agent auto --connect",
350
- "sf mcp install --agent codex --mode hosted --connect",
351
- "sf mcp install --agent codex --mode local --transport stdio --connect",
349
+ "sf setup agent --agent auto",
350
+ "sf mcp install --agent codex --remote --oauth",
351
+ "sf mcp install --agent codex",
352
352
  "sf mcp",
353
353
  "sf mcp http --host 127.0.0.1 --port 3945 --path /mcp",
354
354
  "```",
@@ -391,7 +391,7 @@ export function aiInstructionsText() {
391
391
  "## Agent-aware routing",
392
392
  "",
393
393
  `${BRAND.productName} supports an \`Agent=true\` condition in \`_redirects\` — a browser gets the HTML`,
394
- "page, an agent fetch gets plain text at the same URL. This very page uses it:",
394
+ "page, an agent fetch gets plain text at the same URL. For example:",
395
395
  "",
396
396
  "```text",
397
397
  "/ai /ai.txt 200! Agent=true",
@@ -401,15 +401,14 @@ export function aiInstructionsText() {
401
401
  "",
402
402
  "- Docs index for agents: https://spacefast.com/llms.txt",
403
403
  "- One-click connect (Claude Code, Claude, Codex, Cursor, VS Code): https://spacefast.com/agents",
404
- "- Agent guide: https://spacefast.com/docs/getting-started/agents",
404
+ "- Agent guide: https://spacefast.com/docs/agents",
405
405
  "- CLI reference: https://spacefast.com/docs/cli",
406
406
  "- REST API + OpenAPI: https://spacefast.com/docs/api",
407
407
  "- Publish contract (machine-readable): https://spacefast.com/publish-spec.json",
408
408
  "- Connectors-directory manifest (hosted MCP listing): https://spacefast.com/.well-known/connector.json",
409
409
  "- Every error code: https://spacefast.com/docs/errors",
410
410
  "",
411
- "Append `.md` to any docs URL for Markdown, or just fetch — agent user agents get",
412
- "Markdown automatically.",
411
+ "Append `.md` to any docs URL for Markdown.",
413
412
  "",
414
413
  "## Environment notes",
415
414
  "",
@@ -571,7 +570,7 @@ export function agentSetupMarkdown() {
571
570
  buildHermesMcpAddCommand(mcpEndpoint),
572
571
  "```",
573
572
  "",
574
- "OpenCode V2 — merge this schema-pinned config into `~/.config/opencode/opencode.jsonc`:",
573
+ "OpenCode V2 — merge this schema-pinned config into `~/.config/opencode/opencode.json`:",
575
574
  "",
576
575
  "```json",
577
576
  JSON.stringify(opencodeHostedMcpConfig(mcpEndpoint), null, 2),
@@ -54,7 +54,7 @@ export declare const agentSolutions: readonly [{
54
54
  readonly summary: "Recommended: direct hosted MCP.";
55
55
  readonly description: "Connect ChatGPT-style cloud agents to Spacefast through hosted MCP; use inline files or signed uploads instead of local paths.";
56
56
  readonly commands: readonly ["https://mcp.spacefast.com"];
57
- readonly guideUrl: `${string}/getting-started/agents`;
57
+ readonly guideUrl: `${string}/agents`;
58
58
  readonly setupText: string;
59
59
  }, {
60
60
  readonly id: "claude-ai";
@@ -64,7 +64,7 @@ export declare const agentSolutions: readonly [{
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
66
  readonly commands: readonly ["https://mcp.spacefast.com"];
67
- readonly guideUrl: `${string}/getting-started/agents`;
67
+ readonly guideUrl: `${string}/agents`;
68
68
  readonly setupText: string;
69
69
  }, {
70
70
  readonly id: "raycast";
@@ -74,7 +74,7 @@ export declare const agentSolutions: readonly [{
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
76
  readonly commands: readonly ["https://mcp.spacefast.com"];
77
- readonly guideUrl: `${string}/getting-started/agents`;
77
+ readonly guideUrl: `${string}/agents`;
78
78
  readonly setupText: string;
79
79
  }, {
80
80
  readonly id: "cursor";
@@ -84,7 +84,7 @@ export declare const agentSolutions: readonly [{
84
84
  readonly summary: "Recommended: local MCP when it needs the checkout.";
85
85
  readonly description: "Use On-Device MCP for editor agents that need local files; use hosted MCP instead when they only need cloud-safe tools.";
86
86
  readonly commands: readonly ["sf setup agent --agent auto --connect", "sf mcp install --agent auto --mode local --transport stdio --connect"];
87
- readonly guideUrl: `${string}/getting-started/agents`;
87
+ readonly guideUrl: `${string}/agents`;
88
88
  readonly setupText: string;
89
89
  }, {
90
90
  readonly id: "terminal";
@@ -89,8 +89,8 @@ export const agentSolutions = [
89
89
  summary: "Recommended: direct hosted MCP.",
90
90
  description: `Connect ChatGPT-style cloud agents to ${BRAND.productName} through hosted MCP; use inline files or signed uploads instead of local paths.`,
91
91
  commands: [hostedMcpEndpointUrl],
92
- guideUrl: `${DOCS_BASE_URL}/getting-started/agents`,
93
- setupText: hostedMcpText("ChatGPT", `${DOCS_BASE_URL}/getting-started/agents`),
92
+ guideUrl: `${DOCS_BASE_URL}/agents`,
93
+ setupText: hostedMcpText("ChatGPT", `${DOCS_BASE_URL}/agents`),
94
94
  },
95
95
  {
96
96
  id: "claude-ai",
@@ -100,8 +100,8 @@ export const agentSolutions = [
100
100
  summary: "Recommended: direct hosted MCP.",
101
101
  description: `Connect the web Claude app to ${BRAND.productName} through hosted MCP when it cannot read your local checkout.`,
102
102
  commands: [hostedMcpEndpointUrl],
103
- guideUrl: `${DOCS_BASE_URL}/getting-started/agents`,
104
- setupText: hostedMcpText("Claude.ai", `${DOCS_BASE_URL}/getting-started/agents`),
103
+ guideUrl: `${DOCS_BASE_URL}/agents`,
104
+ setupText: hostedMcpText("Claude.ai", `${DOCS_BASE_URL}/agents`),
105
105
  },
106
106
  {
107
107
  id: "raycast",
@@ -111,8 +111,8 @@ export const agentSolutions = [
111
111
  summary: "Recommended: direct hosted MCP.",
112
112
  description: `Use hosted MCP for Raycast and similar clients that can connect to a remote MCP server but should not need a local ${BRAND.productName} install.`,
113
113
  commands: [hostedMcpEndpointUrl],
114
- guideUrl: `${DOCS_BASE_URL}/getting-started/agents`,
115
- setupText: hostedMcpText("Raycast", `${DOCS_BASE_URL}/getting-started/agents`),
114
+ guideUrl: `${DOCS_BASE_URL}/agents`,
115
+ setupText: hostedMcpText("Raycast", `${DOCS_BASE_URL}/agents`),
116
116
  },
117
117
  {
118
118
  id: "cursor",
@@ -125,8 +125,8 @@ export const agentSolutions = [
125
125
  "sf setup agent --agent auto --connect",
126
126
  "sf mcp install --agent auto --mode local --transport stdio --connect",
127
127
  ],
128
- guideUrl: `${DOCS_BASE_URL}/getting-started/agents`,
129
- setupText: localMcpText("Cursor or another MCP client", `${DOCS_BASE_URL}/getting-started/agents`),
128
+ guideUrl: `${DOCS_BASE_URL}/agents`,
129
+ setupText: localMcpText("Cursor or another MCP client", `${DOCS_BASE_URL}/agents`),
130
130
  },
131
131
  {
132
132
  id: "terminal",
@@ -39,7 +39,7 @@ export declare const SPACEFAST_SKILLS: readonly [{
39
39
  readonly recipe: {
40
40
  readonly slug: "recipes/create-and-publish-site";
41
41
  readonly tier: "full";
42
- readonly url: `${string}/getting-started/agents`;
42
+ readonly url: `${string}/agents`;
43
43
  };
44
44
  }, {
45
45
  readonly name: "publish-and-verify";
@@ -212,7 +212,7 @@ export declare const SPACEFAST_PROMPT_SKILLS: ({
212
212
  readonly recipe: {
213
213
  readonly slug: "recipes/create-and-publish-site";
214
214
  readonly tier: "full";
215
- readonly url: `${string}/getting-started/agents`;
215
+ readonly url: `${string}/agents`;
216
216
  };
217
217
  } | {
218
218
  readonly name: "publish-and-verify";
@@ -385,7 +385,7 @@ export declare const SPACEFAST_RECIPE_SKILLS: (({
385
385
  readonly recipe: {
386
386
  readonly slug: "recipes/create-and-publish-site";
387
387
  readonly tier: "full";
388
- readonly url: `${string}/getting-started/agents`;
388
+ readonly url: `${string}/agents`;
389
389
  };
390
390
  } | {
391
391
  readonly name: "publish-and-verify";
@@ -31,7 +31,7 @@ export const SPACEFAST_SKILLS = [
31
31
  recipe: {
32
32
  slug: "recipes/create-and-publish-site",
33
33
  tier: "full",
34
- url: `${DOCS_BASE_URL}/getting-started/agents`,
34
+ url: `${DOCS_BASE_URL}/agents`,
35
35
  },
36
36
  },
37
37
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spacefast/common",
3
- "version": "0.0.20",
3
+ "version": "0.0.23",
4
4
  "license": "MIT",
5
5
  "description": "Shared TypeScript contracts and utilities for Spacefast packages.",
6
6
  "repository": {