deepspace 0.3.9 → 0.3.11
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/cli.js +96 -18
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +160 -1
- package/dist/index.js +283 -126
- package/dist/index.js.map +1 -1
- package/dist/server.d.ts +172 -2
- package/dist/server.js +581 -1
- package/dist/server.js.map +1 -1
- package/dist/worker.d.ts +252 -2
- package/dist/worker.js +588 -1
- package/dist/worker.js.map +1 -1
- package/features/admin-page/feature.json +29 -0
- package/features/admin-page/src/AdminPage.tsx +292 -0
- package/features/admin-page/src/admin-schema.ts +20 -0
- package/features/ai-chat/feature.json +41 -0
- package/features/ai-chat/src/AiChatPage.tsx +692 -0
- package/features/ai-chat/src/ChatPanel.tsx +1098 -0
- package/features/ai-chat/src/ai-chat-schema.ts +11 -0
- package/features/canvas/feature.json +45 -0
- package/features/canvas/src/CanvasEditorPage.tsx +87 -0
- package/features/canvas/src/CanvasListPage.tsx +202 -0
- package/features/canvas/src/canvas-schema.ts +33 -0
- package/features/canvas/src/components/CanvasToolbar.tsx +170 -0
- package/features/canvas/src/components/CanvasView.tsx +369 -0
- package/features/canvas/src/components/ShapeRenderer.tsx +114 -0
- package/features/cron/feature.json +33 -0
- package/features/cron/src/CronLogPage.tsx +100 -0
- package/features/cron/src/cron.ts +25 -0
- package/features/docs/feature.json +96 -0
- package/features/docs/src/DocsEditorPage.tsx +1012 -0
- package/features/docs/src/DocsListPage.tsx +951 -0
- package/features/docs/src/DocsOutlinePanel.tsx +68 -0
- package/features/docs/src/DocsPresence.tsx +138 -0
- package/features/docs/src/InviteDialog.tsx +336 -0
- package/features/docs/src/LibrarySidebar.tsx +464 -0
- package/features/docs/src/docs-favorites.ts +18 -0
- package/features/docs/src/docs-library-types.ts +15 -0
- package/features/docs/src/docs-schema.ts +80 -0
- package/features/docs/src/docs-ui.css +309 -0
- package/features/docs/src/editor/DocEditorSurface.tsx +257 -0
- package/features/docs/src/editor/DocsTiptapToolbar.tsx +560 -0
- package/features/docs/src/editor/useDocEditor.ts +206 -0
- package/features/docs/src/use-yjs-room-with-awareness.ts +285 -0
- package/features/file-attachments/feature.json +42 -0
- package/features/file-attachments/src/AttachmentsPage.tsx +864 -0
- package/features/file-attachments/src/attachments-constants.ts +9 -0
- package/features/file-attachments/src/attachments-schema.ts +45 -0
- package/features/file-attachments/src/useFilePreview.ts +471 -0
- package/features/file-attachments/src/useMimeTypeDetection.ts +138 -0
- package/features/file-manager/feature.json +24 -0
- package/features/file-manager/src/FileManagerPage.tsx +330 -0
- package/features/integration-test/feature.json +18 -0
- package/features/integration-test/src/IntegrationTestPage.tsx +423 -0
- package/features/integration-test/src/integration.spec.ts +42 -0
- package/features/items/feature.json +33 -0
- package/features/items/src/ItemsPage.tsx +325 -0
- package/features/items/src/items-constants.ts +10 -0
- package/features/items/src/items-schema.ts +27 -0
- package/features/kanban/feature.json +18 -0
- package/features/kanban/src/Kanban.tsx +283 -0
- package/features/landing/feature.json +62 -0
- package/features/landing/src/LandingPage.tsx +627 -0
- package/features/landing/src/primitives.tsx +389 -0
- package/features/landing/src/sections/FAQSection.tsx +110 -0
- package/features/landing/src/sections/FeaturesGridSection.tsx +311 -0
- package/features/landing/src/sections/HowItWorksSection.tsx +62 -0
- package/features/landing/src/sections/LogoCloudSection.tsx +58 -0
- package/features/landing/src/sections/ShowcaseSection.tsx +63 -0
- package/features/landing/src/sections/StatsSection.tsx +31 -0
- package/features/landing/src/sections/TeamSection.tsx +86 -0
- package/features/landing/src/sections/TestimonialsSection.tsx +68 -0
- package/features/landing/src/sections/VideoSection.tsx +71 -0
- package/features/leaderboard/feature.json +33 -0
- package/features/leaderboard/src/LeaderboardPage.tsx +372 -0
- package/features/leaderboard/src/leaderboard-constants.ts +21 -0
- package/features/leaderboard/src/leaderboard-schema.ts +36 -0
- package/features/messaging/feature.json +111 -0
- package/features/messaging/src/ChatMultiPage.tsx +300 -0
- package/features/messaging/src/ChatPage.tsx +75 -0
- package/features/messaging/src/components/chat/ChatHeader.tsx +76 -0
- package/features/messaging/src/components/chat/MessageActionSheet.tsx +168 -0
- package/features/messaging/src/components/chat/MessageInput.tsx +65 -0
- package/features/messaging/src/components/chat/MessageItem.tsx +352 -0
- package/features/messaging/src/components/chat/MessageList.tsx +248 -0
- package/features/messaging/src/components/chat/ReactionPicker.tsx +2 -0
- package/features/messaging/src/components/chat/ThreadPanel.tsx +107 -0
- package/features/messaging/src/components/chat/UserProfilePopover.tsx +158 -0
- package/features/messaging/src/components/chat-multi/AddMemberModal.tsx +188 -0
- package/features/messaging/src/components/chat-multi/BrowseGroupsModal.tsx +163 -0
- package/features/messaging/src/components/chat-multi/ChannelListItem.tsx +147 -0
- package/features/messaging/src/components/chat-multi/ChannelSettingsPanel.tsx +344 -0
- package/features/messaging/src/components/chat-multi/ChannelSidebar.tsx +460 -0
- package/features/messaging/src/components/chat-multi/CreateGroupModal.tsx +190 -0
- package/features/messaging/src/components/chat-multi/InvitationList.tsx +149 -0
- package/features/messaging/src/components/chat-multi/NewMessageModal.tsx +159 -0
- package/features/messaging/src/hooks/useChatChannel.ts +64 -0
- package/features/messaging/src/hooks/useLongPress.ts +74 -0
- package/features/messaging/src/hooks/useMultiChannel.ts +142 -0
- package/features/messaging/src/messaging-schema.ts +25 -0
- package/features/presence-test/feature.json +21 -0
- package/features/presence-test/src/PresenceTestPage.tsx +120 -0
- package/features/sidebar/feature.json +19 -0
- package/features/sidebar/src/AppSidebar.tsx +558 -0
- package/features/tasks/feature.json +33 -0
- package/features/tasks/src/TasksPage.tsx +598 -0
- package/features/tasks/src/tasks-constants.ts +43 -0
- package/features/tasks/src/tasks-schema.ts +56 -0
- package/features/testing/feature.json +49 -0
- package/features/testing/src/TestPage.tsx +145 -0
- package/features/testing/src/cpu-burn-action.ts +51 -0
- package/features/testing/src/subrequest-burn-action.ts +53 -0
- package/features/testing/src/test-schema.ts +23 -0
- package/features/topbar/feature.json +18 -0
- package/features/topbar/src/Topbar.tsx +353 -0
- package/features/tree/feature.json +26 -0
- package/features/tree/src/TreeSidebar.tsx +607 -0
- package/features/tree/src/tree-constants.ts +68 -0
- package/features/tree/src/tree-hooks.ts +258 -0
- package/package.json +4 -2
- package/scripts/add-feature.cjs +654 -0
package/dist/cli.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
// src/cli/cli.ts
|
|
4
|
-
import { defineCommand as
|
|
4
|
+
import { defineCommand as defineCommand18, runMain } from "citty";
|
|
5
5
|
import { execSync as execSync5 } from "child_process";
|
|
6
6
|
import { readFileSync as readFileSync10, existsSync as existsSync13 } from "fs";
|
|
7
|
-
import { dirname as dirname2, join as
|
|
7
|
+
import { dirname as dirname2, join as join14 } from "path";
|
|
8
8
|
import { fileURLToPath } from "url";
|
|
9
9
|
|
|
10
10
|
// src/cli/commands/login.ts
|
|
@@ -93,10 +93,10 @@ function sanitizeAppName(raw) {
|
|
|
93
93
|
|
|
94
94
|
// src/cli/env.ts
|
|
95
95
|
var ENV_URLS = {
|
|
96
|
-
auth: "https://
|
|
97
|
-
api: "https://
|
|
98
|
-
platform: "https://
|
|
99
|
-
deploy: "https://
|
|
96
|
+
auth: "https://auth.deep.space",
|
|
97
|
+
api: "https://api-worker.deep.space",
|
|
98
|
+
platform: "https://platform-worker.deep.space",
|
|
99
|
+
deploy: "https://deploy-worker.deep.space"
|
|
100
100
|
};
|
|
101
101
|
var ENVS = {
|
|
102
102
|
dev: ENV_URLS,
|
|
@@ -530,16 +530,16 @@ var DIR2 = join4(homedir3(), ".deepspace");
|
|
|
530
530
|
var SESSION_PATH2 = join4(DIR2, "session");
|
|
531
531
|
var TOKEN_PATH2 = join4(DIR2, "token");
|
|
532
532
|
async function ensureToken() {
|
|
533
|
-
if (!existsSync3(SESSION_PATH2)) {
|
|
534
|
-
throw new Error("Not logged in. Run `deepspace login` first.");
|
|
535
|
-
}
|
|
536
|
-
const sessionToken = readFileSync3(SESSION_PATH2, "utf-8").trim();
|
|
537
533
|
if (existsSync3(TOKEN_PATH2)) {
|
|
538
534
|
const existing = readFileSync3(TOKEN_PATH2, "utf-8").trim();
|
|
539
535
|
if (isTokenValid(existing)) {
|
|
540
536
|
return existing;
|
|
541
537
|
}
|
|
542
538
|
}
|
|
539
|
+
if (!existsSync3(SESSION_PATH2)) {
|
|
540
|
+
throw new Error("Not logged in. Run `deepspace login` first.");
|
|
541
|
+
}
|
|
542
|
+
const sessionToken = readFileSync3(SESSION_PATH2, "utf-8").trim();
|
|
543
543
|
const token2 = await exchangeSession(AUTH_URL3, sessionToken);
|
|
544
544
|
if (!token2) {
|
|
545
545
|
throw new Error("Session expired. Run `deepspace login` to re-authenticate.");
|
|
@@ -2096,8 +2096,10 @@ import { existsSync as existsSync10 } from "fs";
|
|
|
2096
2096
|
import { resolve as resolve6, join as join10 } from "path";
|
|
2097
2097
|
import { execSync as execSync3 } from "child_process";
|
|
2098
2098
|
function findScript(from) {
|
|
2099
|
-
const
|
|
2100
|
-
if (existsSync10(
|
|
2099
|
+
const inNodeModules = join10(from, "node_modules", "deepspace", "scripts", "add-feature.cjs");
|
|
2100
|
+
if (existsSync10(inNodeModules)) return inNodeModules;
|
|
2101
|
+
const inDotDeepspace = join10(from, ".deepspace", "scripts", "add-feature.cjs");
|
|
2102
|
+
if (existsSync10(inDotDeepspace)) return inDotDeepspace;
|
|
2101
2103
|
return null;
|
|
2102
2104
|
}
|
|
2103
2105
|
var add_default = defineCommand11({
|
|
@@ -2132,8 +2134,11 @@ var add_default = defineCommand11({
|
|
|
2132
2134
|
const appDir = resolve6(args.dir ?? ".");
|
|
2133
2135
|
const script = findScript(appDir);
|
|
2134
2136
|
if (!script) {
|
|
2135
|
-
console.error("
|
|
2136
|
-
console.error("
|
|
2137
|
+
console.error("Could not find the deepspace feature installer.");
|
|
2138
|
+
console.error("Looked in:");
|
|
2139
|
+
console.error(` ${join10(appDir, "node_modules", "deepspace", "scripts", "add-feature.cjs")}`);
|
|
2140
|
+
console.error(` ${join10(appDir, ".deepspace", "scripts", "add-feature.cjs")}`);
|
|
2141
|
+
console.error("Are you in a DeepSpace app directory? Try `npm install` first.");
|
|
2137
2142
|
process.exit(1);
|
|
2138
2143
|
}
|
|
2139
2144
|
const passArgs = [];
|
|
@@ -3326,13 +3331,85 @@ var library_default = defineCommand16({
|
|
|
3326
3331
|
}
|
|
3327
3332
|
});
|
|
3328
3333
|
|
|
3334
|
+
// src/cli/commands/admin.ts
|
|
3335
|
+
import { defineCommand as defineCommand17 } from "citty";
|
|
3336
|
+
import { mkdirSync as mkdirSync4, writeFileSync as writeFileSync5 } from "fs";
|
|
3337
|
+
import { homedir as homedir5 } from "os";
|
|
3338
|
+
import { join as join13 } from "path";
|
|
3339
|
+
var AUTH_URL5 = process.env.DEEPSPACE_AUTH_URL ?? ENVS.prod.auth;
|
|
3340
|
+
var impersonate = defineCommand17({
|
|
3341
|
+
meta: {
|
|
3342
|
+
name: "impersonate",
|
|
3343
|
+
description: "Store a short-lived CLI token for another user"
|
|
3344
|
+
},
|
|
3345
|
+
args: {
|
|
3346
|
+
email: {
|
|
3347
|
+
type: "string",
|
|
3348
|
+
description: "Target user email",
|
|
3349
|
+
required: false
|
|
3350
|
+
},
|
|
3351
|
+
userId: {
|
|
3352
|
+
type: "string",
|
|
3353
|
+
description: "Target user id",
|
|
3354
|
+
required: false
|
|
3355
|
+
},
|
|
3356
|
+
secret: {
|
|
3357
|
+
type: "string",
|
|
3358
|
+
description: "Admin secret; defaults to DEEPSPACE_ADMIN_SECRET",
|
|
3359
|
+
required: false
|
|
3360
|
+
}
|
|
3361
|
+
},
|
|
3362
|
+
async run({ args }) {
|
|
3363
|
+
const secret = args.secret ?? process.env.DEEPSPACE_ADMIN_SECRET;
|
|
3364
|
+
if (!secret) {
|
|
3365
|
+
console.error("Missing admin secret. Set DEEPSPACE_ADMIN_SECRET or pass --secret.");
|
|
3366
|
+
process.exit(1);
|
|
3367
|
+
}
|
|
3368
|
+
if (!args.email && !args.userId) {
|
|
3369
|
+
console.error("Pass --email or --userId.");
|
|
3370
|
+
process.exit(1);
|
|
3371
|
+
}
|
|
3372
|
+
const res = await fetch(`${AUTH_URL5}/api/auth/admin/impersonate`, {
|
|
3373
|
+
method: "POST",
|
|
3374
|
+
headers: {
|
|
3375
|
+
"Content-Type": "application/json",
|
|
3376
|
+
Authorization: `Bearer ${secret}`
|
|
3377
|
+
},
|
|
3378
|
+
body: JSON.stringify({
|
|
3379
|
+
email: args.email,
|
|
3380
|
+
userId: args.userId
|
|
3381
|
+
})
|
|
3382
|
+
});
|
|
3383
|
+
const data = await res.json().catch(() => ({}));
|
|
3384
|
+
if (!res.ok || !data.token || !data.user) {
|
|
3385
|
+
console.error(`Failed: ${data.error ?? `HTTP ${res.status}`}`);
|
|
3386
|
+
process.exit(1);
|
|
3387
|
+
}
|
|
3388
|
+
const dir = join13(homedir5(), ".deepspace");
|
|
3389
|
+
mkdirSync4(dir, { recursive: true });
|
|
3390
|
+
writeFileSync5(TOKEN_PATH2, data.token, { mode: 384 });
|
|
3391
|
+
console.log(`Impersonating ${data.user.name ?? data.user.email ?? data.user.id}`);
|
|
3392
|
+
console.log(`Email: ${data.user.email ?? "(none)"}`);
|
|
3393
|
+
console.log(`UserID: ${data.user.id}`);
|
|
3394
|
+
}
|
|
3395
|
+
});
|
|
3396
|
+
var admin_default = defineCommand17({
|
|
3397
|
+
meta: {
|
|
3398
|
+
name: "admin",
|
|
3399
|
+
description: "Maintainer-only admin commands"
|
|
3400
|
+
},
|
|
3401
|
+
subCommands: {
|
|
3402
|
+
impersonate
|
|
3403
|
+
}
|
|
3404
|
+
});
|
|
3405
|
+
|
|
3329
3406
|
// src/cli/cli.ts
|
|
3330
3407
|
var __dirname = dirname2(fileURLToPath(import.meta.url));
|
|
3331
|
-
var pkg = JSON.parse(readFileSync10(
|
|
3408
|
+
var pkg = JSON.parse(readFileSync10(join14(__dirname, "..", "package.json"), "utf-8"));
|
|
3332
3409
|
if (process.platform === "linux" && !process.env.SSL_CERT_FILE && existsSync13("/etc/ssl/certs/ca-certificates.crt")) {
|
|
3333
3410
|
process.env.SSL_CERT_FILE = "/etc/ssl/certs/ca-certificates.crt";
|
|
3334
3411
|
}
|
|
3335
|
-
var create3 =
|
|
3412
|
+
var create3 = defineCommand18({
|
|
3336
3413
|
meta: {
|
|
3337
3414
|
name: "create",
|
|
3338
3415
|
description: "Create a new DeepSpace app"
|
|
@@ -3351,7 +3428,7 @@ var create3 = defineCommand17({
|
|
|
3351
3428
|
execSync5(`npm create deepspace@latest${name}`, { stdio: "inherit" });
|
|
3352
3429
|
}
|
|
3353
3430
|
});
|
|
3354
|
-
var main =
|
|
3431
|
+
var main = defineCommand18({
|
|
3355
3432
|
meta: {
|
|
3356
3433
|
name: "deepspace",
|
|
3357
3434
|
version: pkg.version,
|
|
@@ -3374,7 +3451,8 @@ var main = defineCommand17({
|
|
|
3374
3451
|
deploy: deploy_default,
|
|
3375
3452
|
undeploy: undeploy_default,
|
|
3376
3453
|
domain: domain_default,
|
|
3377
|
-
library: library_default
|
|
3454
|
+
library: library_default,
|
|
3455
|
+
admin: admin_default
|
|
3378
3456
|
}
|
|
3379
3457
|
// No `run()` here — citty cascades parent run() AFTER subcommand finishes,
|
|
3380
3458
|
// which corrupts agent-friendly output (`--json`) and prints noise on every
|