@spacefast/common 0.0.12 → 0.0.17
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/agents/client-registry.d.ts +22 -0
- package/dist/agents/client-registry.js +41 -0
- package/dist/agents/connect-targets.d.ts +51 -6
- package/dist/agents/connect-targets.js +93 -28
- package/dist/brand.d.ts +0 -11
- package/dist/brand.js +0 -20
- package/dist/config/domains.d.ts +15 -6
- package/dist/config/domains.js +24 -10
- package/dist/config/postgres-budget.d.ts +3 -0
- package/dist/config/postgres-budget.js +6 -1
- package/dist/config/postgres-budget.json +2 -1
- package/dist/contracts/abuse.js +1 -1
- package/dist/contracts/access.d.ts +486 -1196
- package/dist/contracts/access.js +323 -1054
- package/dist/contracts/activity.d.ts +1 -1
- package/dist/contracts/activity.js +11 -15
- package/dist/contracts/api-keys.d.ts +16 -0
- package/dist/contracts/api-keys.js +11 -9
- package/dist/contracts/archives.d.ts +1 -2
- package/dist/contracts/archives.js +15 -17
- package/dist/contracts/beta.js +1 -1
- package/dist/contracts/builds.js +14 -14
- package/dist/contracts/channels.js +2 -2
- package/dist/contracts/comments.d.ts +143 -99
- package/dist/contracts/comments.js +194 -79
- package/dist/contracts/common.d.ts +12 -12
- package/dist/contracts/common.js +33 -30
- package/dist/contracts/continuation.js +5 -5
- package/dist/contracts/countries.js +2 -7
- package/dist/contracts/data-source-routes.d.ts +20 -0
- package/dist/contracts/data-source-routes.js +15 -0
- package/dist/contracts/device-auth.d.ts +13 -9
- package/dist/contracts/device-auth.js +12 -12
- package/dist/contracts/docs.d.ts +10 -10
- package/dist/contracts/domains.js +39 -33
- package/dist/contracts/enums.d.ts +4 -14
- package/dist/contracts/enums.js +3 -10
- package/dist/contracts/error-code-meta.d.ts +122 -56
- package/dist/contracts/error-code-meta.js +43 -19
- package/dist/contracts/error-codes.d.ts +7 -4
- package/dist/contracts/error-codes.js +48 -24
- package/dist/contracts/events.d.ts +22 -15
- package/dist/contracts/events.js +33 -5
- package/dist/contracts/execution.d.ts +238 -0
- package/dist/contracts/execution.js +309 -0
- package/dist/contracts/feature-lifecycle.d.ts +39 -188
- package/dist/contracts/feature-lifecycle.js +52 -196
- package/dist/contracts/features.d.ts +13 -115
- package/dist/contracts/features.js +5 -35
- package/dist/contracts/functions.d.ts +597 -0
- package/dist/contracts/functions.js +475 -0
- package/dist/contracts/grants.d.ts +1175 -0
- package/dist/contracts/grants.js +783 -0
- package/dist/contracts/ids.d.ts +7 -5
- package/dist/contracts/ids.js +7 -7
- package/dist/contracts/internal.js +2 -2
- package/dist/contracts/mcp.d.ts +17 -556
- package/dist/contracts/mcp.js +9 -103
- package/dist/contracts/me.js +3 -4
- package/dist/contracts/notifications.d.ts +108 -0
- package/dist/contracts/notifications.js +54 -0
- package/dist/contracts/oauth-resources.d.ts +22 -5
- package/dist/contracts/oauth-resources.js +23 -2
- package/dist/contracts/operations.d.ts +0 -48
- package/dist/contracts/operations.js +0 -19
- package/dist/contracts/pages.d.ts +10 -14
- package/dist/contracts/pages.js +17 -21
- package/dist/contracts/plan-policy.d.ts +1 -8
- package/dist/contracts/plan-policy.js +1 -4
- package/dist/contracts/platform.d.ts +78 -30
- package/dist/contracts/platform.js +69 -20
- package/dist/contracts/problem-document.d.ts +14 -0
- package/dist/contracts/problem-document.js +35 -0
- package/dist/contracts/push-new.d.ts +41 -2
- package/dist/contracts/push-new.js +4 -0
- package/dist/contracts/quotas.d.ts +0 -1
- package/dist/contracts/quotas.js +0 -5
- package/dist/contracts/repository-connections.d.ts +1 -1
- package/dist/contracts/resources.d.ts +16 -71
- package/dist/contracts/resources.js +13 -16
- package/dist/contracts/runtime-api.d.ts +666 -303
- package/dist/contracts/runtime-api.js +272 -113
- package/dist/contracts/runtime-app.d.ts +168 -0
- package/dist/contracts/runtime-app.js +42 -0
- package/dist/contracts/runtime-db.d.ts +424 -0
- package/dist/contracts/runtime-db.js +108 -0
- package/dist/contracts/runtime-storage.d.ts +120 -0
- package/dist/contracts/runtime-storage.js +40 -0
- package/dist/contracts/sf-config-v1.d.ts +54 -1
- package/dist/contracts/sf-config-v1.js +2 -2
- package/dist/contracts/sites.d.ts +6 -0
- package/dist/contracts/sites.js +30 -11
- package/dist/contracts/space-config.d.ts +91 -121
- package/dist/contracts/space-config.js +464 -42
- package/dist/contracts/spaces.d.ts +300 -171
- package/dist/contracts/spaces.js +128 -98
- package/dist/contracts/superadmin-emails.d.ts +2 -2
- package/dist/contracts/superadmin-spaces.d.ts +26 -130
- package/dist/contracts/superadmin-spaces.js +22 -0
- package/dist/contracts/superadmin-tenants.js +4 -4
- package/dist/contracts/superadmin.d.ts +4 -0
- package/dist/contracts/superadmin.js +14 -1
- package/dist/contracts/tags.d.ts +6 -6
- package/dist/contracts/tags.js +1 -1
- package/dist/contracts/teams.d.ts +9 -9
- package/dist/contracts/teams.js +25 -16
- package/dist/contracts/theme-json.js +1 -1
- package/dist/contracts/transfers.d.ts +0 -1
- package/dist/contracts/transfers.js +4 -4
- package/dist/contracts/variables.js +3 -3
- package/dist/contracts/zero.d.ts +384 -596
- package/dist/contracts/zero.js +167 -299
- package/dist/dashboard-paths/index.d.ts +18 -3
- package/dist/dashboard-paths/index.js +19 -0
- package/dist/docs/agent-handoff-document.d.ts +2 -2
- package/dist/docs/agent-handoff-document.js +8 -7
- package/dist/docs/agent-prose.d.ts +22 -3
- package/dist/docs/agent-prose.js +227 -55
- package/dist/docs/agent-setup.d.ts +14 -11
- package/dist/docs/agent-setup.js +289 -61
- package/dist/docs/agent-solutions.d.ts +6 -6
- package/dist/docs/agent-solutions.js +24 -22
- package/dist/docs/catalog.d.ts +53 -98
- package/dist/docs/catalog.js +90 -117
- package/dist/docs/error-docs.js +304 -236
- package/dist/docs/skill-distribution.d.ts +2 -0
- package/dist/docs/skill-distribution.js +7 -4
- package/dist/docs/skills.d.ts +546 -0
- package/dist/docs/skills.js +340 -0
- package/dist/utils/auth-redirect.d.ts +1 -3
- package/dist/utils/auth-redirect.js +1 -21
- package/dist/utils/browser-credential.d.ts +19 -0
- package/dist/utils/browser-credential.js +62 -0
- package/dist/utils/build-settings.d.ts +2 -0
- package/dist/utils/build-settings.js +61 -9
- package/dist/utils/comment-avatars.d.ts +7 -0
- package/dist/utils/comment-avatars.js +42 -0
- package/dist/utils/content-type.d.ts +3 -3
- package/dist/utils/content-type.js +38 -61
- package/dist/utils/credential-policy.d.ts +1 -1
- package/dist/utils/credential-policy.js +4 -0
- package/dist/utils/domain-diagnostics.d.ts +5 -5
- package/dist/utils/domain-diagnostics.js +21 -10
- package/dist/utils/egress-policy.fixtures.json +1 -1
- package/dist/utils/grants.d.ts +53 -0
- package/dist/utils/grants.js +160 -0
- package/dist/utils/local-space-state.d.ts +78 -4
- package/dist/utils/local-space-state.js +384 -82
- package/dist/utils/one-shot-replay.d.ts +14 -0
- package/dist/utils/one-shot-replay.js +21 -0
- package/dist/utils/page-preview.d.ts +7 -0
- package/dist/utils/page-preview.js +9 -0
- package/dist/utils/pages.d.ts +2 -5
- package/dist/utils/pages.js +64 -33
- package/dist/utils/publish-form-data.d.ts +22 -0
- package/dist/utils/publish-form-data.js +26 -0
- package/dist/utils/publish-policy.d.ts +34 -4
- package/dist/utils/publish-policy.js +149 -62
- package/dist/utils/query-keys.d.ts +8 -10
- package/dist/utils/query-keys.js +14 -10
- package/dist/utils/runtime-paths.d.ts +3 -0
- package/dist/utils/runtime-paths.js +7 -0
- package/dist/utils/secure-local-file.d.ts +73 -0
- package/dist/utils/secure-local-file.js +1373 -0
- package/dist/utils/space-config.d.ts +17 -4
- package/dist/utils/space-config.js +151 -8
- package/dist/utils/static-runtime-policy.d.ts +5 -0
- package/dist/utils/static-runtime-policy.js +54 -10
- package/dist/utils/storage-policy.d.ts +20 -0
- package/dist/utils/storage-policy.fixtures.json +174 -0
- package/dist/utils/storage-policy.js +193 -0
- package/dist/utils/upload-session.d.ts +15 -1
- package/dist/utils/upload-session.js +68 -2
- package/dist/utils/version-file-browser.d.ts +13 -0
- package/dist/utils/version-file-browser.js +59 -0
- package/package.json +20 -1
- package/dist/contracts/mounts.d.ts +0 -142
- package/dist/contracts/mounts.js +0 -56
- package/dist/utils/access-grant.d.ts +0 -14
- package/dist/utils/access-grant.js +0 -88
- package/dist/utils/access-match.d.ts +0 -46
- package/dist/utils/access-match.fixtures.json +0 -513
- package/dist/utils/access-match.js +0 -312
- package/dist/utils/access-verdict.fixtures.json +0 -421
- package/dist/utils/asset-fingerprint.d.ts +0 -53
- package/dist/utils/asset-fingerprint.js +0 -574
- package/dist/utils/sf-config-v1.d.ts +0 -2
- package/dist/utils/sf-config-v1.fixtures.json +0 -9
- package/dist/utils/sf-config-v1.js +0 -551
|
@@ -13,7 +13,7 @@ export const FEATURE_OVERRIDE_STATES = ["enabled", "disabled", "kill_switch"];
|
|
|
13
13
|
export const featureOverrideStateSchema = z.enum(FEATURE_OVERRIDE_STATES);
|
|
14
14
|
export const planLimitValueSchema = z
|
|
15
15
|
.union([z.number().int().nonnegative(), z.literal("unlimited")])
|
|
16
|
-
.describe('Plan limit value; "unlimited" when the plan does not
|
|
16
|
+
.describe('Plan limit value; "unlimited" when the plan does not limit this axis.');
|
|
17
17
|
// Named plan limit table (internal-docs/platform.md "Plans And Limits",
|
|
18
18
|
// Free/Personal/Work columns verbatim). Keys mirror `PlanPolicyResponse.limits`
|
|
19
19
|
// so plan policy is a projection of this data, never a re-derivation.
|
|
@@ -23,7 +23,6 @@ export const planLimitsSchema = z
|
|
|
23
23
|
teamMembers: planLimitValueSchema,
|
|
24
24
|
subTeams: planLimitValueSchema,
|
|
25
25
|
externalDomainGroups: planLimitValueSchema,
|
|
26
|
-
publicImmutableVersionWindowDays: planLimitValueSchema,
|
|
27
26
|
// Version retention (charter arbitration A3, internal plan data — never on
|
|
28
27
|
// the PlanPolicyResponse wire shape): `versionRetentionDays` is the included
|
|
29
28
|
// full-retention window; after it versions stay stored but gated until
|
|
@@ -48,12 +47,7 @@ export const planLimitsSchema = z
|
|
|
48
47
|
// Queryable analytics history window. Storage retains rollups for everyone
|
|
49
48
|
// (env-bounded); this only clamps how far back the analytics API serves.
|
|
50
49
|
analyticsRetentionDays: planLimitValueSchema,
|
|
51
|
-
// Access-surface abuse ceilings
|
|
52
|
-
// default, enterprise unlimited — never upsell levers. Per-plan tightening
|
|
53
|
-
// (if ever) happens here, never as constants in route code.
|
|
54
|
-
// Cloud-lane rules per space (incl. TTL'd blocks; managed blocks excluded
|
|
55
|
-
// from the count).
|
|
56
|
-
cloudRulesPerSpace: planLimitValueSchema,
|
|
50
|
+
// Access-surface abuse ceilings: generous by default, enterprise unlimited.
|
|
57
51
|
// Active (non-revoked, non-expired) share links per space.
|
|
58
52
|
shareLinksPerSpace: planLimitValueSchema,
|
|
59
53
|
// Active invites per space (§5.3 — enforced when invites land).
|
|
@@ -63,12 +57,6 @@ export const planLimitsSchema = z
|
|
|
63
57
|
inviteEmailsPerAccountDaily: planLimitValueSchema,
|
|
64
58
|
// Pending access requests per space (§5.4).
|
|
65
59
|
pendingAccessRequestsPerSpace: planLimitValueSchema,
|
|
66
|
-
// Service tokens per team (§5.5).
|
|
67
|
-
serviceTokensPerTeam: planLimitValueSchema,
|
|
68
|
-
// OIDC + external issuer connections per team (§6).
|
|
69
|
-
connectionsPerTeam: planLimitValueSchema,
|
|
70
|
-
// Team-default rules (X-24).
|
|
71
|
-
teamDefaultRules: planLimitValueSchema,
|
|
72
60
|
})
|
|
73
61
|
.describe("Named plan limit table.");
|
|
74
62
|
// Resolved team entitlements: plan limits after add-on grants plus the
|
|
@@ -78,9 +66,6 @@ export const teamEntitlementsSchema = z
|
|
|
78
66
|
.object({
|
|
79
67
|
planCode: planCodeSchema,
|
|
80
68
|
limits: planLimitsSchema,
|
|
81
|
-
headersBasicAuth: z
|
|
82
|
-
.boolean()
|
|
83
|
-
.describe("Whether `_headers` Basic-Auth rules compile on this plan."),
|
|
84
69
|
externalProxy: z.boolean().describe("Whether external proxy upstreams compile on this plan."),
|
|
85
70
|
dedicatedRuntime: z.boolean().describe("Whether the team can use dedicated runtime sites."),
|
|
86
71
|
pagesTemplates: z
|
|
@@ -119,7 +104,6 @@ const UNLIMITED_LIMITS = {
|
|
|
119
104
|
teamMembers: "unlimited",
|
|
120
105
|
subTeams: "unlimited",
|
|
121
106
|
externalDomainGroups: "unlimited",
|
|
122
|
-
publicImmutableVersionWindowDays: "unlimited",
|
|
123
107
|
versionRetentionDays: "unlimited",
|
|
124
108
|
versionGatedKeepDays: "unlimited",
|
|
125
109
|
egressBytesPerDay: "unlimited",
|
|
@@ -130,29 +114,21 @@ const UNLIMITED_LIMITS = {
|
|
|
130
114
|
buildAccessLogRetentionHours: "unlimited",
|
|
131
115
|
buildsDeploysMonthly: "unlimited",
|
|
132
116
|
analyticsRetentionDays: "unlimited",
|
|
133
|
-
cloudRulesPerSpace: "unlimited",
|
|
134
117
|
shareLinksPerSpace: "unlimited",
|
|
135
118
|
invitesPerSpace: "unlimited",
|
|
136
119
|
inviteEmailsPerSpaceDaily: "unlimited",
|
|
137
120
|
inviteEmailsPerAccountDaily: "unlimited",
|
|
138
121
|
pendingAccessRequestsPerSpace: "unlimited",
|
|
139
|
-
serviceTokensPerTeam: "unlimited",
|
|
140
|
-
connectionsPerTeam: "unlimited",
|
|
141
|
-
teamDefaultRules: "unlimited",
|
|
142
122
|
};
|
|
143
123
|
// The §5.1 access abuse-ceiling table (X-40): applied verbatim to every
|
|
144
124
|
// self-serve plan; enterprise/internal stay unlimited. These sit far above
|
|
145
125
|
// honest use — they are abuse ceilings, not upsell levers.
|
|
146
126
|
const ACCESS_QUOTA_DEFAULTS = {
|
|
147
|
-
cloudRulesPerSpace: 200,
|
|
148
127
|
shareLinksPerSpace: 100,
|
|
149
128
|
invitesPerSpace: 500,
|
|
150
129
|
inviteEmailsPerSpaceDaily: 200,
|
|
151
130
|
inviteEmailsPerAccountDaily: 500,
|
|
152
131
|
pendingAccessRequestsPerSpace: 100,
|
|
153
|
-
serviceTokensPerTeam: 50,
|
|
154
|
-
connectionsPerTeam: 10,
|
|
155
|
-
teamDefaultRules: 50,
|
|
156
132
|
};
|
|
157
133
|
export const PLAN_DEFINITIONS = {
|
|
158
134
|
free: {
|
|
@@ -164,7 +140,6 @@ export const PLAN_DEFINITIONS = {
|
|
|
164
140
|
teamMembers: 3,
|
|
165
141
|
subTeams: 0,
|
|
166
142
|
externalDomainGroups: 3,
|
|
167
|
-
publicImmutableVersionWindowDays: 7,
|
|
168
143
|
versionRetentionDays: 30, // included full-retention window (charter A3)
|
|
169
144
|
versionGatedKeepDays: 183, // kept gated ~6 months from readyAt, then deleted
|
|
170
145
|
egressBytesPerDay: 100 * GB, // = worst-case ceiling; tunable per plan
|
|
@@ -177,7 +152,6 @@ export const PLAN_DEFINITIONS = {
|
|
|
177
152
|
analyticsRetentionDays: 30,
|
|
178
153
|
...ACCESS_QUOTA_DEFAULTS,
|
|
179
154
|
},
|
|
180
|
-
headersBasicAuth: false,
|
|
181
155
|
externalProxy: false,
|
|
182
156
|
dedicatedRuntime: false,
|
|
183
157
|
pagesTemplates: false,
|
|
@@ -203,7 +177,6 @@ export const PLAN_DEFINITIONS = {
|
|
|
203
177
|
analyticsRetentionDays: 365,
|
|
204
178
|
...ACCESS_QUOTA_DEFAULTS,
|
|
205
179
|
},
|
|
206
|
-
headersBasicAuth: true,
|
|
207
180
|
externalProxy: true,
|
|
208
181
|
dedicatedRuntime: false,
|
|
209
182
|
pagesTemplates: true,
|
|
@@ -225,7 +198,6 @@ export const PLAN_DEFINITIONS = {
|
|
|
225
198
|
subTeams: 0,
|
|
226
199
|
...ACCESS_QUOTA_DEFAULTS,
|
|
227
200
|
},
|
|
228
|
-
headersBasicAuth: true,
|
|
229
201
|
externalProxy: true,
|
|
230
202
|
dedicatedRuntime: false,
|
|
231
203
|
pagesTemplates: true,
|
|
@@ -239,7 +211,6 @@ export const PLAN_DEFINITIONS = {
|
|
|
239
211
|
name: "Enterprise",
|
|
240
212
|
monthlyPriceUsd: null,
|
|
241
213
|
limits: { ...UNLIMITED_LIMITS },
|
|
242
|
-
headersBasicAuth: true,
|
|
243
214
|
externalProxy: true,
|
|
244
215
|
dedicatedRuntime: true,
|
|
245
216
|
pagesTemplates: true,
|
|
@@ -252,7 +223,6 @@ export const PLAN_DEFINITIONS = {
|
|
|
252
223
|
name: "Internal",
|
|
253
224
|
monthlyPriceUsd: null,
|
|
254
225
|
limits: { ...UNLIMITED_LIMITS },
|
|
255
|
-
headersBasicAuth: true,
|
|
256
226
|
externalProxy: true,
|
|
257
227
|
dedicatedRuntime: true,
|
|
258
228
|
pagesTemplates: true,
|
|
@@ -264,7 +234,7 @@ export const PLAN_DEFINITIONS = {
|
|
|
264
234
|
export const FEATURE_DEFINITIONS = FEATURE_RUNTIME_DEFINITIONS;
|
|
265
235
|
export const featureStateSourceSchema = z
|
|
266
236
|
.enum(["kill_switch", "env", "override", "default"])
|
|
267
|
-
.describe("Layer that
|
|
237
|
+
.describe("Layer that decides the flag: kill_switch (emergency off), env (SPACEFAST_FLAG_* variable), " +
|
|
268
238
|
"override (feature_overrides row), default (plan/code default).");
|
|
269
239
|
export const FeatureStateSchema = z.object({
|
|
270
240
|
key: featureKeySchema,
|
|
@@ -272,10 +242,10 @@ export const FeatureStateSchema = z.object({
|
|
|
272
242
|
source: featureStateSourceSchema,
|
|
273
243
|
});
|
|
274
244
|
export const FeatureStateResponseSchema = z.object({
|
|
275
|
-
planCode: planCodeSchema.describe("Plan
|
|
245
|
+
planCode: planCodeSchema.describe("Plan used to evaluate the flags."),
|
|
276
246
|
features: z
|
|
277
247
|
.record(featureKeySchema, FeatureStateSchema)
|
|
278
|
-
.describe("Evaluated state
|
|
248
|
+
.describe("Evaluated state of every known feature flag."),
|
|
279
249
|
});
|
|
280
250
|
export function normalizePlanCode(planCode) {
|
|
281
251
|
if (!planCode) {
|