@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
package/dist/utils/query-keys.js
CHANGED
|
@@ -10,7 +10,6 @@ export const qk = {
|
|
|
10
10
|
agentAccounts: (teamId) => ["agent-accounts", teamId],
|
|
11
11
|
myShelf: () => ["my-shelf"],
|
|
12
12
|
mcpDashboard: (teamId) => ["mcp", "dashboard", teamId],
|
|
13
|
-
mcpApproval: (teamId, id) => ["mcp", "approval", teamId, id],
|
|
14
13
|
// The teams LIST gets its own leaf so invalidating it never cascades into
|
|
15
14
|
// ["teams", id, ...] resource queries (members, spaces, domains, ...).
|
|
16
15
|
teams: () => ["teams", "list"],
|
|
@@ -71,7 +70,6 @@ export const qk = {
|
|
|
71
70
|
: ["spaces", id, "versions", versionId, "comments", status],
|
|
72
71
|
spaceVersionFiles: (id, versionId) => ["spaces", id, "versions", versionId, "files"],
|
|
73
72
|
spaceVersionFile: (id, versionId, path) => ["spaces", id, "versions", versionId, "files", path],
|
|
74
|
-
spaceVersionFileDirectUrl: (id, versionId, path) => ["spaces", id, "versions", versionId, "files", path, "direct-url"],
|
|
75
73
|
spaceVersionFileUrlPreview: (id, versionId, path) => ["spaces", id, "versions", versionId, "files", path, "url-preview"],
|
|
76
74
|
spaceVersionFileDiff: (id, versionId, baseVersionId) => ["spaces", id, "versions", versionId, "files", "diff", baseVersionId ?? ""],
|
|
77
75
|
spaceVersionConventionArtifacts: (id, versionId) => ["spaces", id, "versions", versionId, "convention-artifacts"],
|
|
@@ -81,20 +79,21 @@ export const qk = {
|
|
|
81
79
|
spaceDomains: (id) => ["spaces", id, "domains"],
|
|
82
80
|
spaceRuntimeStatus: (id) => ["spaces", id, "runtime"],
|
|
83
81
|
spaceApplyState: (id) => ["spaces", id, "apply-state"],
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
82
|
+
// A space has one database, whichever runtime claims it — the key says `db`,
|
|
83
|
+
// not `zero`, for the same reason the route does.
|
|
84
|
+
spaceDatabase: (id) => ["spaces", id, "db"],
|
|
85
|
+
// Row reads are per table and per page size; the bare prefix above sweeps
|
|
86
|
+
// every dump alongside the schema read.
|
|
87
|
+
spaceDatabaseDump: (id, table, limit) => [...qk.spaceDatabase(id), "dump", table ?? "", limit],
|
|
88
|
+
spaceStorage: (id) => ["spaces", id, "storage"],
|
|
89
|
+
spaceRuntimeLogs: (id, limit) => ["spaces", id, "logs", "runtime", limit],
|
|
90
|
+
spaceRuntimeRealtimeEvents: (id, limit) => [...qk.spaceRuntimeStatus(id), "realtime", "events", limit],
|
|
88
91
|
spaceVariables: (id) => ["spaces", id, "variables"],
|
|
89
92
|
spaceCertificates: (id) => ["spaces", id, "runtime", "certificates"],
|
|
90
93
|
spaceLogs: (id, kind) => ["spaces", id, "logs", kind],
|
|
91
94
|
spaceAnalytics: (id, window) => ["spaces", id, "analytics", window],
|
|
92
|
-
spaceFirewall: (id) => ["spaces", id, "access", "firewall"],
|
|
93
|
-
spaceAccessViews: (id, since) => ["spaces", id, "access", "views", since ?? ""],
|
|
94
|
-
teamServiceTokens: (teamId) => ["teams", teamId, "access", "service-tokens"],
|
|
95
95
|
teamAgentHandoffs: (teamId) => ["teams", teamId, "agent-handoffs"],
|
|
96
96
|
teamAccessDefaults: (teamId) => ["teams", teamId, "access", "defaults"],
|
|
97
|
-
teamAccessConnections: (teamId) => ["teams", teamId, "access", "connections"],
|
|
98
97
|
domain: (teamId, ref) => ["teams", teamId, "domains", ref],
|
|
99
98
|
domainDiagnostics: (teamId, domainId) => ["teams", teamId, "domains", domainId, "diagnostics"],
|
|
100
99
|
domainDnsCapabilities: (domainId) => ["domains", domainId, "dns", "capabilities"],
|
|
@@ -102,4 +101,9 @@ export const qk = {
|
|
|
102
101
|
domainDnsOperations: (domainId) => ["domains", domainId, "dns", "operations"],
|
|
103
102
|
domainActions: (domainId) => ["domains", domainId, "actions"],
|
|
104
103
|
domainProviderConnections: (teamId) => ["domains", "provider-connections", teamId],
|
|
104
|
+
// The shell's notification bell. The bare prefix is the invalidate-all sweep
|
|
105
|
+
// that a "mark read" performs across both the count and every list view.
|
|
106
|
+
notifications: () => ["notifications"],
|
|
107
|
+
notificationsList: (unreadOnly) => ["notifications", "list", unreadOnly],
|
|
108
|
+
notificationsUnreadCount: () => ["notifications", "unread-count"],
|
|
105
109
|
};
|
|
@@ -2,5 +2,8 @@ export declare const SPACEFAST_RUNTIME_NAMESPACE: "/__spacefast";
|
|
|
2
2
|
export declare const RUNTIME_MANAGEMENT_API_PATH: "/__spacefast/api.php";
|
|
3
3
|
export declare const RUNTIME_UPLOAD_API_PATH: "/__spacefast/upload.php";
|
|
4
4
|
export declare const RUNTIME_HEALTH_PATH: "/__spacefast/health.php";
|
|
5
|
+
export declare const RUNTIME_COMMENTS_CONFIG_PATH: "/__spacefast/comments/config";
|
|
6
|
+
export declare const RUNTIME_COMMENTS_TICKET_PATH: "/__spacefast/comments/ticket";
|
|
7
|
+
export declare const RUNTIME_COMMENTS_VERSION_URLS_PATH: "/__spacefast/comments/version-urls";
|
|
5
8
|
export declare function runtimeManagementPath(suffix: string): string;
|
|
6
9
|
export declare function runtimeUploadPath(params: URLSearchParams | Record<string, string>): string;
|
|
@@ -2,6 +2,13 @@ export const SPACEFAST_RUNTIME_NAMESPACE = "/__spacefast";
|
|
|
2
2
|
export const RUNTIME_MANAGEMENT_API_PATH = `${SPACEFAST_RUNTIME_NAMESPACE}/api.php`;
|
|
3
3
|
export const RUNTIME_UPLOAD_API_PATH = `${SPACEFAST_RUNTIME_NAMESPACE}/upload.php`;
|
|
4
4
|
export const RUNTIME_HEALTH_PATH = `${SPACEFAST_RUNTIME_NAMESPACE}/health.php`;
|
|
5
|
+
// Same-origin Comments exchange paths served on every published host. The PHP
|
|
6
|
+
// mirror is SPACEFAST_COMMENTS_*_PATH in runtime/engine/shared/context.php;
|
|
7
|
+
// runtime/tests/spacefast-sdk.test.ts pins the PHP side and
|
|
8
|
+
// packages/collab-sdk/test/entry.test.ts pins the SDK side to these literals.
|
|
9
|
+
export const RUNTIME_COMMENTS_CONFIG_PATH = `${SPACEFAST_RUNTIME_NAMESPACE}/comments/config`;
|
|
10
|
+
export const RUNTIME_COMMENTS_TICKET_PATH = `${SPACEFAST_RUNTIME_NAMESPACE}/comments/ticket`;
|
|
11
|
+
export const RUNTIME_COMMENTS_VERSION_URLS_PATH = `${SPACEFAST_RUNTIME_NAMESPACE}/comments/version-urls`;
|
|
5
12
|
export function runtimeManagementPath(suffix) {
|
|
6
13
|
const route = normalizeRuntimeRoute(suffix);
|
|
7
14
|
if (route === "/") {
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { type FileHandle } from "node:fs/promises";
|
|
2
|
+
export declare class SecureLocalFileError extends Error {
|
|
3
|
+
name: string;
|
|
4
|
+
}
|
|
5
|
+
export declare class SecureLocalFileConflictError extends SecureLocalFileError {
|
|
6
|
+
name: string;
|
|
7
|
+
}
|
|
8
|
+
export type SecureWriteOptions = {
|
|
9
|
+
root: string;
|
|
10
|
+
relativePath: string;
|
|
11
|
+
data?: Uint8Array | string;
|
|
12
|
+
write?: (file: FileHandle) => Promise<void>;
|
|
13
|
+
overwrite?: boolean;
|
|
14
|
+
mode?: number;
|
|
15
|
+
rootMode?: number;
|
|
16
|
+
expectedContent?: Uint8Array | string | null;
|
|
17
|
+
beforeCommit?: () => void | Promise<void>;
|
|
18
|
+
/** Fault-injection hook after rollback custody exists but before the atomic rename. */
|
|
19
|
+
afterBackup?: () => void | Promise<void>;
|
|
20
|
+
};
|
|
21
|
+
export type SecureReadOptions = {
|
|
22
|
+
root: string;
|
|
23
|
+
relativePath: string;
|
|
24
|
+
encoding?: BufferEncoding;
|
|
25
|
+
};
|
|
26
|
+
export type SecureDirectoryOptions = {
|
|
27
|
+
root: string;
|
|
28
|
+
relativePath: string;
|
|
29
|
+
mode?: number;
|
|
30
|
+
};
|
|
31
|
+
export type SecureLocalEntryIdentity = {
|
|
32
|
+
ctimeNs: bigint;
|
|
33
|
+
dev: bigint;
|
|
34
|
+
ino: bigint;
|
|
35
|
+
mode: bigint;
|
|
36
|
+
};
|
|
37
|
+
export type SecureRemoveOptions = {
|
|
38
|
+
root: string;
|
|
39
|
+
relativePath: string;
|
|
40
|
+
expectedIdentity: SecureLocalEntryIdentity;
|
|
41
|
+
};
|
|
42
|
+
export type SecureCreatedDirectory = {
|
|
43
|
+
path: string;
|
|
44
|
+
validate: () => Promise<void>;
|
|
45
|
+
commit: () => Promise<void>;
|
|
46
|
+
rollback: () => Promise<void>;
|
|
47
|
+
};
|
|
48
|
+
export declare function secureOutputLocation(trustedPath: string, outputPath: string): {
|
|
49
|
+
root: string;
|
|
50
|
+
relativePath: string;
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* Writes beneath an explicitly trusted root without following output-tree
|
|
54
|
+
* symlinks. Linux uses descriptor-relative operations; other supported
|
|
55
|
+
* platforms use exclusive staging plus before-and-after ancestor identity
|
|
56
|
+
* validation and fail closed if any binding changes.
|
|
57
|
+
*/
|
|
58
|
+
export declare function secureWriteFile(options: SecureWriteOptions): Promise<void>;
|
|
59
|
+
export declare function secureReadFile(options: SecureReadOptions & {
|
|
60
|
+
encoding: BufferEncoding;
|
|
61
|
+
}): Promise<string>;
|
|
62
|
+
export declare function secureReadFile(options: SecureReadOptions): Promise<Buffer>;
|
|
63
|
+
/**
|
|
64
|
+
* Removes only the exact non-directory leaf identity previously inspected.
|
|
65
|
+
* The same leaf lock used by secureWriteFile covers the identity check and
|
|
66
|
+
* rename, so a cooperating writer cannot replace the leaf between them.
|
|
67
|
+
*/
|
|
68
|
+
export declare function secureRemoveLocalEntry(options: SecureRemoveOptions): Promise<boolean>;
|
|
69
|
+
/**
|
|
70
|
+
* Creates one new directory leaf beneath a trusted root. The returned rollback
|
|
71
|
+
* removes only the exact directory inode created by this call.
|
|
72
|
+
*/
|
|
73
|
+
export declare function secureCreateDirectory(options: SecureDirectoryOptions): Promise<SecureCreatedDirectory>;
|