studiograph 1.3.48-next.21 → 1.3.48-next.210
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/README.md +26 -16
- package/dist/agent/agent-pool.d.ts +87 -3
- package/dist/agent/agent-pool.js +188 -15
- package/dist/agent/agent-pool.js.map +1 -1
- package/dist/agent/followups.d.ts +34 -0
- package/dist/agent/followups.js +52 -0
- package/dist/agent/followups.js.map +1 -0
- package/dist/agent/orchestrator.d.ts +101 -4
- package/dist/agent/orchestrator.js +464 -66
- package/dist/agent/orchestrator.js.map +1 -1
- package/dist/agent/prompts/entity-types-section.d.ts +34 -0
- package/dist/agent/prompts/entity-types-section.js +76 -0
- package/dist/agent/prompts/entity-types-section.js.map +1 -0
- package/dist/agent/prompts/system.md +112 -54
- package/dist/agent/skill-loader.d.ts +30 -17
- package/dist/agent/skill-loader.js +63 -30
- package/dist/agent/skill-loader.js.map +1 -1
- package/dist/agent/skills/artifact-canvas/skill.md +152 -0
- package/dist/agent/skills/entity-schema.md +75 -431
- package/dist/agent/skills/interview/entity-templates.md +38 -37
- package/dist/agent/skills/interview/question-domains.md +54 -49
- package/dist/agent/skills/interview/skill.md +84 -16
- package/dist/agent/skills/schema-rules.md +28 -28
- package/dist/agent/tools/artifact-tools.d.ts +124 -0
- package/dist/agent/tools/artifact-tools.js +207 -0
- package/dist/agent/tools/artifact-tools.js.map +1 -0
- package/dist/agent/tools/capture-tools.d.ts +31 -0
- package/dist/agent/tools/capture-tools.js +40 -0
- package/dist/agent/tools/capture-tools.js.map +1 -0
- package/dist/agent/tools/folder-tools.d.ts +47 -0
- package/dist/agent/tools/folder-tools.js +249 -0
- package/dist/agent/tools/folder-tools.js.map +1 -0
- package/dist/agent/tools/fs-tools.d.ts +6 -5
- package/dist/agent/tools/fs-tools.js +5 -5
- package/dist/agent/tools/fs-tools.js.map +1 -1
- package/dist/agent/tools/graph-tools.d.ts +48 -72
- package/dist/agent/tools/graph-tools.js +852 -329
- package/dist/agent/tools/graph-tools.js.map +1 -1
- package/dist/agent/tools/history-tools.d.ts +95 -0
- package/dist/agent/tools/history-tools.js +461 -0
- package/dist/agent/tools/history-tools.js.map +1 -0
- package/dist/agent/tools/load-skill.d.ts +6 -5
- package/dist/agent/tools/load-skill.js +3 -3
- package/dist/agent/tools/load-skill.js.map +1 -1
- package/dist/agent/tools/ops-tools.d.ts +5 -4
- package/dist/agent/tools/ops-tools.js +130 -236
- package/dist/agent/tools/ops-tools.js.map +1 -1
- package/dist/agent/tools/permission-tools.d.ts +87 -17
- package/dist/agent/tools/permission-tools.js +233 -43
- package/dist/agent/tools/permission-tools.js.map +1 -1
- package/dist/agent/tools/tool-loader.js +5 -4
- package/dist/agent/tools/tool-loader.js.map +1 -1
- package/dist/agent/tools/web-tools.js +58 -9
- package/dist/agent/tools/web-tools.js.map +1 -1
- package/dist/cli/commands/about.d.ts +1 -0
- package/dist/cli/commands/about.js +55 -3
- package/dist/cli/commands/about.js.map +1 -1
- package/dist/cli/commands/admin/audit-workspace.d.ts +23 -0
- package/dist/cli/commands/admin/audit-workspace.js +133 -0
- package/dist/cli/commands/admin/audit-workspace.js.map +1 -0
- package/dist/cli/commands/admin/audit.d.ts +21 -0
- package/dist/cli/commands/admin/audit.js +174 -0
- package/dist/cli/commands/admin/audit.js.map +1 -0
- package/dist/cli/commands/admin/backup.d.ts +54 -0
- package/dist/cli/commands/admin/backup.js +207 -0
- package/dist/cli/commands/admin/backup.js.map +1 -0
- package/dist/cli/commands/admin/folder.d.ts +11 -0
- package/dist/cli/commands/{collection.js → admin/folder.js} +33 -32
- package/dist/cli/commands/admin/folder.js.map +1 -0
- package/dist/cli/commands/admin/index.d.ts +16 -0
- package/dist/cli/commands/admin/index.js +46 -0
- package/dist/cli/commands/admin/index.js.map +1 -0
- package/dist/cli/commands/admin/migrate-assets.d.ts +53 -0
- package/dist/cli/commands/admin/migrate-assets.js +184 -0
- package/dist/cli/commands/admin/migrate-assets.js.map +1 -0
- package/dist/cli/commands/admin/migrate.d.ts +56 -0
- package/dist/cli/commands/admin/migrate.js +263 -0
- package/dist/cli/commands/admin/migrate.js.map +1 -0
- package/dist/cli/commands/admin/restore.d.ts +24 -0
- package/dist/cli/commands/admin/restore.js +228 -0
- package/dist/cli/commands/admin/restore.js.map +1 -0
- package/dist/cli/commands/admin/secrets.d.ts +23 -0
- package/dist/cli/commands/admin/secrets.js +256 -0
- package/dist/cli/commands/admin/secrets.js.map +1 -0
- package/dist/cli/commands/admin/settings.d.ts +28 -0
- package/dist/cli/commands/admin/settings.js +284 -0
- package/dist/cli/commands/admin/settings.js.map +1 -0
- package/dist/cli/commands/admin/token.d.ts +42 -0
- package/dist/cli/commands/admin/token.js +126 -0
- package/dist/cli/commands/admin/token.js.map +1 -0
- package/dist/cli/commands/admin/transfer-ownership.d.ts +15 -0
- package/dist/cli/commands/admin/transfer-ownership.js +106 -0
- package/dist/cli/commands/admin/transfer-ownership.js.map +1 -0
- package/dist/cli/commands/admin/user.d.ts +11 -0
- package/dist/cli/commands/admin/user.js +187 -0
- package/dist/cli/commands/admin/user.js.map +1 -0
- package/dist/cli/commands/clone.d.ts +25 -3
- package/dist/cli/commands/clone.js +142 -36
- package/dist/cli/commands/clone.js.map +1 -1
- package/dist/cli/commands/config.d.ts +23 -107
- package/dist/cli/commands/config.js +52 -260
- package/dist/cli/commands/config.js.map +1 -1
- package/dist/cli/commands/connector.d.ts +10 -13
- package/dist/cli/commands/connector.js +16 -58
- package/dist/cli/commands/connector.js.map +1 -1
- package/dist/cli/commands/deploy.js +215 -68
- package/dist/cli/commands/deploy.js.map +1 -1
- package/dist/cli/commands/index.js +5 -1
- package/dist/cli/commands/index.js.map +1 -1
- package/dist/cli/commands/init.js +10 -30
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/mcp.js +54 -6
- package/dist/cli/commands/mcp.js.map +1 -1
- package/dist/cli/commands/r2.d.ts +3 -0
- package/dist/cli/commands/r2.js +223 -204
- package/dist/cli/commands/r2.js.map +1 -1
- package/dist/cli/commands/redeploy.js +65 -12
- package/dist/cli/commands/redeploy.js.map +1 -1
- package/dist/cli/commands/reset.d.ts +22 -6
- package/dist/cli/commands/reset.js +132 -34
- package/dist/cli/commands/reset.js.map +1 -1
- package/dist/cli/commands/serve.js +231 -26
- package/dist/cli/commands/serve.js.map +1 -1
- package/dist/cli/commands/sync.d.ts +1 -1
- package/dist/cli/commands/sync.js +237 -227
- package/dist/cli/commands/sync.js.map +1 -1
- package/dist/cli/crypto-bundle.d.ts +39 -0
- package/dist/cli/crypto-bundle.js +94 -0
- package/dist/cli/crypto-bundle.js.map +1 -0
- package/dist/cli/index.js +24 -26
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/railway-pin.d.ts +68 -0
- package/dist/cli/railway-pin.js +96 -0
- package/dist/cli/railway-pin.js.map +1 -0
- package/dist/cli/railway-provisioning.d.ts +53 -0
- package/dist/cli/railway-provisioning.js +85 -0
- package/dist/cli/railway-provisioning.js.map +1 -0
- package/dist/cli/setup-wizard.d.ts +30 -49
- package/dist/cli/setup-wizard.js +39 -40
- package/dist/cli/setup-wizard.js.map +1 -1
- package/dist/core/accent-palette.d.ts +22 -0
- package/dist/core/accent-palette.js +47 -0
- package/dist/core/accent-palette.js.map +1 -0
- package/dist/core/artifact-asset-urls.d.ts +51 -0
- package/dist/core/artifact-asset-urls.js +79 -0
- package/dist/core/artifact-asset-urls.js.map +1 -0
- package/dist/core/artifact-bundle.d.ts +69 -0
- package/dist/core/artifact-bundle.js +305 -0
- package/dist/core/artifact-bundle.js.map +1 -0
- package/dist/core/artifact-escape.d.ts +5 -0
- package/dist/core/artifact-escape.js +26 -0
- package/dist/core/artifact-escape.js.map +1 -0
- package/dist/core/artifact-export.d.ts +17 -0
- package/dist/core/artifact-export.js +529 -0
- package/dist/core/artifact-export.js.map +1 -0
- package/dist/core/cell-anchor.d.ts +29 -0
- package/dist/core/cell-anchor.js +53 -0
- package/dist/core/cell-anchor.js.map +1 -0
- package/dist/core/comment-anchor.d.ts +41 -0
- package/dist/core/comment-anchor.js +147 -0
- package/dist/core/comment-anchor.js.map +1 -0
- package/dist/core/commit-messages.d.ts +57 -0
- package/dist/core/commit-messages.js +85 -0
- package/dist/core/commit-messages.js.map +1 -0
- package/dist/core/embeds.d.ts +96 -0
- package/dist/core/embeds.js +187 -0
- package/dist/core/embeds.js.map +1 -0
- package/dist/core/entity-body-templates.d.ts +21 -0
- package/dist/core/entity-body-templates.js +67 -0
- package/dist/core/entity-body-templates.js.map +1 -0
- package/dist/core/entity-types-catalog.d.ts +65 -0
- package/dist/core/entity-types-catalog.js +142 -0
- package/dist/core/entity-types-catalog.js.map +1 -0
- package/dist/core/field-library.d.ts +62 -0
- package/dist/core/field-library.js +129 -0
- package/dist/core/field-library.js.map +1 -0
- package/dist/core/folder-paths.d.ts +41 -0
- package/dist/core/folder-paths.js +95 -0
- package/dist/core/folder-paths.js.map +1 -0
- package/dist/core/folder-sidecar.d.ts +36 -0
- package/dist/core/folder-sidecar.js +91 -0
- package/dist/core/folder-sidecar.js.map +1 -0
- package/dist/core/format-registry.d.ts +170 -0
- package/dist/core/format-registry.js +412 -0
- package/dist/core/format-registry.js.map +1 -0
- package/dist/core/graph.d.ts +773 -14
- package/dist/core/graph.js +2269 -308
- package/dist/core/graph.js.map +1 -1
- package/dist/core/history-diff.d.ts +35 -0
- package/dist/core/history-diff.js +114 -0
- package/dist/core/history-diff.js.map +1 -0
- package/dist/core/refs.d.ts +41 -0
- package/dist/core/refs.js +80 -0
- package/dist/core/refs.js.map +1 -0
- package/dist/core/schema-registry.d.ts +66 -0
- package/dist/core/schema-registry.js +198 -37
- package/dist/core/schema-registry.js.map +1 -1
- package/dist/core/schemas/connector.d.ts +67 -0
- package/dist/core/schemas/connector.js +100 -0
- package/dist/core/schemas/connector.js.map +1 -0
- package/dist/core/schemas/workspace.d.ts +122 -0
- package/dist/core/schemas/workspace.js +211 -0
- package/dist/core/schemas/workspace.js.map +1 -0
- package/dist/core/secrets/SecretStore.d.ts +77 -0
- package/dist/core/secrets/SecretStore.js +13 -0
- package/dist/core/secrets/SecretStore.js.map +1 -0
- package/dist/core/secrets/SettingsResolver.d.ts +54 -0
- package/dist/core/secrets/SettingsResolver.js +80 -0
- package/dist/core/secrets/SettingsResolver.js.map +1 -0
- package/dist/core/secrets/SettingsStore.d.ts +30 -0
- package/dist/core/secrets/SettingsStore.js +9 -0
- package/dist/core/secrets/SettingsStore.js.map +1 -0
- package/dist/core/secrets/SqliteEncryptedStore.d.ts +90 -0
- package/dist/core/secrets/SqliteEncryptedStore.js +598 -0
- package/dist/core/secrets/SqliteEncryptedStore.js.map +1 -0
- package/dist/core/secrets/audit.d.ts +36 -0
- package/dist/core/secrets/audit.js +60 -0
- package/dist/core/secrets/audit.js.map +1 -0
- package/dist/core/secrets/auth-db-migration.d.ts +129 -0
- package/dist/core/secrets/auth-db-migration.js +653 -0
- package/dist/core/secrets/auth-db-migration.js.map +1 -0
- package/dist/core/secrets/bundle.d.ts +141 -0
- package/dist/core/secrets/bundle.js +435 -0
- package/dist/core/secrets/bundle.js.map +1 -0
- package/dist/core/secrets/dual-write.d.ts +81 -0
- package/dist/core/secrets/dual-write.js +247 -0
- package/dist/core/secrets/dual-write.js.map +1 -0
- package/dist/core/secrets/encryption.d.ts +44 -0
- package/dist/core/secrets/encryption.js +97 -0
- package/dist/core/secrets/encryption.js.map +1 -0
- package/dist/core/secrets/index.d.ts +49 -0
- package/dist/core/secrets/index.js +74 -0
- package/dist/core/secrets/index.js.map +1 -0
- package/dist/core/secrets/master-key.d.ts +38 -0
- package/dist/core/secrets/master-key.js +122 -0
- package/dist/core/secrets/master-key.js.map +1 -0
- package/dist/core/secrets/probes/anthropic.d.ts +98 -0
- package/dist/core/secrets/probes/anthropic.js +300 -0
- package/dist/core/secrets/probes/anthropic.js.map +1 -0
- package/dist/core/secrets/probes/brave.d.ts +9 -0
- package/dist/core/secrets/probes/brave.js +15 -0
- package/dist/core/secrets/probes/brave.js.map +1 -0
- package/dist/core/secrets/probes/r2.d.ts +15 -0
- package/dist/core/secrets/probes/r2.js +14 -0
- package/dist/core/secrets/probes/r2.js.map +1 -0
- package/dist/core/secrets/probes/tavily.d.ts +18 -0
- package/dist/core/secrets/probes/tavily.js +58 -0
- package/dist/core/secrets/probes/tavily.js.map +1 -0
- package/dist/core/secrets/probes/voyage.d.ts +13 -0
- package/dist/core/secrets/probes/voyage.js +52 -0
- package/dist/core/secrets/probes/voyage.js.map +1 -0
- package/dist/core/secrets/r2-structural-migration.d.ts +39 -0
- package/dist/core/secrets/r2-structural-migration.js +109 -0
- package/dist/core/secrets/r2-structural-migration.js.map +1 -0
- package/dist/core/secrets/read-flip.d.ts +59 -0
- package/dist/core/secrets/read-flip.js +87 -0
- package/dist/core/secrets/read-flip.js.map +1 -0
- package/dist/core/secrets/registry.d.ts +188 -0
- package/dist/core/secrets/registry.js +616 -0
- package/dist/core/secrets/registry.js.map +1 -0
- package/dist/core/types.d.ts +77 -483
- package/dist/core/types.js +25 -3
- package/dist/core/types.js.map +1 -1
- package/dist/core/user-config.d.ts +75 -12
- package/dist/core/user-config.js +155 -14
- package/dist/core/user-config.js.map +1 -1
- package/dist/core/validation.d.ts +786 -1373
- package/dist/core/validation.js +458 -147
- package/dist/core/validation.js.map +1 -1
- package/dist/core/workspace-manager.d.ts +87 -14
- package/dist/core/workspace-manager.js +222 -94
- package/dist/core/workspace-manager.js.map +1 -1
- package/dist/core/workspace.d.ts +19 -5
- package/dist/core/workspace.js +67 -39
- package/dist/core/workspace.js.map +1 -1
- package/dist/mcp/comment-virtual-entity.d.ts +36 -0
- package/dist/mcp/comment-virtual-entity.js +71 -0
- package/dist/mcp/comment-virtual-entity.js.map +1 -0
- package/dist/mcp/connector-manager.d.ts +72 -2
- package/dist/mcp/connector-manager.js +211 -32
- package/dist/mcp/connector-manager.js.map +1 -1
- package/dist/mcp/oauth-provider.d.ts +0 -5
- package/dist/mcp/oauth-provider.js +10 -22
- package/dist/mcp/oauth-provider.js.map +1 -1
- package/dist/mcp/oauth-registry.d.ts +46 -8
- package/dist/mcp/oauth-registry.js +52 -13
- package/dist/mcp/oauth-registry.js.map +1 -1
- package/dist/mcp/server-discovery.d.ts +73 -0
- package/dist/mcp/server-discovery.js +164 -0
- package/dist/mcp/server-discovery.js.map +1 -0
- package/dist/mcp/server.d.ts +24 -3
- package/dist/mcp/server.js +53 -10
- package/dist/mcp/server.js.map +1 -1
- package/dist/mcp/state-signer.d.ts +62 -0
- package/dist/mcp/state-signer.js +205 -0
- package/dist/mcp/state-signer.js.map +1 -0
- package/dist/mcp/stdio-proxy.d.ts +67 -0
- package/dist/mcp/stdio-proxy.js +149 -0
- package/dist/mcp/stdio-proxy.js.map +1 -0
- package/dist/mcp/tools.d.ts +65 -2
- package/dist/mcp/tools.js +1772 -124
- package/dist/mcp/tools.js.map +1 -1
- package/dist/server/__tests__/helpers/graph-api.d.ts +16 -0
- package/dist/server/__tests__/helpers/graph-api.js +16 -0
- package/dist/server/__tests__/helpers/graph-api.js.map +1 -0
- package/dist/server/artifact-asset-mint.d.ts +41 -0
- package/dist/server/artifact-asset-mint.js +59 -0
- package/dist/server/artifact-asset-mint.js.map +1 -0
- package/dist/server/asset-index-queue.d.ts +98 -0
- package/dist/server/asset-index-queue.js +193 -0
- package/dist/server/asset-index-queue.js.map +1 -0
- package/dist/server/body-write-coordinator.d.ts +161 -0
- package/dist/server/body-write-coordinator.js +182 -0
- package/dist/server/body-write-coordinator.js.map +1 -0
- package/dist/server/cloud-billing-flow.d.ts +32 -0
- package/dist/server/cloud-billing-flow.js +75 -0
- package/dist/server/cloud-billing-flow.js.map +1 -0
- package/dist/server/commit-audit.d.ts +26 -0
- package/dist/server/commit-audit.js +30 -0
- package/dist/server/commit-audit.js.map +1 -0
- package/dist/server/index.d.ts +29 -3
- package/dist/server/index.js +657 -269
- package/dist/server/index.js.map +1 -1
- package/dist/server/middleware/sanitize.d.ts +46 -0
- package/dist/server/middleware/sanitize.js +182 -0
- package/dist/server/middleware/sanitize.js.map +1 -0
- package/dist/server/routes/artifact-export-api.d.ts +11 -0
- package/dist/server/routes/artifact-export-api.js +159 -0
- package/dist/server/routes/artifact-export-api.js.map +1 -0
- package/dist/server/routes/asset-api.d.ts +76 -1
- package/dist/server/routes/asset-api.js +761 -61
- package/dist/server/routes/asset-api.js.map +1 -1
- package/dist/server/routes/audit-api.d.ts +24 -0
- package/dist/server/routes/audit-api.js +117 -0
- package/dist/server/routes/audit-api.js.map +1 -0
- package/dist/server/routes/auth-api.js +532 -63
- package/dist/server/routes/auth-api.js.map +1 -1
- package/dist/server/routes/capture-api.d.ts +10 -3
- package/dist/server/routes/capture-api.js +213 -25
- package/dist/server/routes/capture-api.js.map +1 -1
- package/dist/server/routes/chat-sessions-api.d.ts +13 -0
- package/dist/server/routes/chat-sessions-api.js +455 -0
- package/dist/server/routes/chat-sessions-api.js.map +1 -0
- package/dist/server/routes/chat.d.ts +35 -1
- package/dist/server/routes/chat.js +699 -54
- package/dist/server/routes/chat.js.map +1 -1
- package/dist/server/routes/comments-api.d.ts +15 -0
- package/dist/server/routes/comments-api.js +444 -0
- package/dist/server/routes/comments-api.js.map +1 -0
- package/dist/server/routes/config-api.d.ts +3 -2
- package/dist/server/routes/config-api.js +179 -49
- package/dist/server/routes/config-api.js.map +1 -1
- package/dist/server/routes/connectors-api.js +177 -42
- package/dist/server/routes/connectors-api.js.map +1 -1
- package/dist/server/routes/event-ingest-api.d.ts +15 -0
- package/dist/server/routes/{meeting-ingest-api.js → event-ingest-api.js} +35 -20
- package/dist/server/routes/event-ingest-api.js.map +1 -0
- package/dist/server/routes/field-library-api.d.ts +28 -0
- package/dist/server/routes/field-library-api.js +126 -0
- package/dist/server/routes/field-library-api.js.map +1 -0
- package/dist/server/routes/git-http.d.ts +2 -2
- package/dist/server/routes/git-http.js +86 -39
- package/dist/server/routes/git-http.js.map +1 -1
- package/dist/server/routes/graph-api-access.d.ts +57 -0
- package/dist/server/routes/graph-api-access.js +112 -0
- package/dist/server/routes/graph-api-access.js.map +1 -0
- package/dist/server/routes/graph-api.d.ts +1 -1
- package/dist/server/routes/graph-api.js +1455 -325
- package/dist/server/routes/graph-api.js.map +1 -1
- package/dist/server/routes/health.d.ts +18 -0
- package/dist/server/routes/health.js +74 -0
- package/dist/server/routes/health.js.map +1 -0
- package/dist/server/routes/import-batch.d.ts +24 -0
- package/dist/server/routes/import-batch.js +33 -0
- package/dist/server/routes/import-batch.js.map +1 -0
- package/dist/server/routes/insights-api.d.ts +9 -2
- package/dist/server/routes/insights-api.js +355 -61
- package/dist/server/routes/insights-api.js.map +1 -1
- package/dist/server/routes/mcp.d.ts +7 -3
- package/dist/server/routes/mcp.js +24 -8
- package/dist/server/routes/mcp.js.map +1 -1
- package/dist/server/routes/oauth-api.d.ts +67 -0
- package/dist/server/routes/oauth-api.js +421 -0
- package/dist/server/routes/oauth-api.js.map +1 -0
- package/dist/server/routes/permissions-api.d.ts +9 -2
- package/dist/server/routes/permissions-api.js +87 -31
- package/dist/server/routes/permissions-api.js.map +1 -1
- package/dist/server/routes/r2-api.d.ts +25 -0
- package/dist/server/routes/r2-api.js +276 -0
- package/dist/server/routes/r2-api.js.map +1 -0
- package/dist/server/routes/secrets-api.d.ts +36 -0
- package/dist/server/routes/secrets-api.js +308 -0
- package/dist/server/routes/secrets-api.js.map +1 -0
- package/dist/server/routes/settings-api.d.ts +29 -0
- package/dist/server/routes/settings-api.js +180 -0
- package/dist/server/routes/settings-api.js.map +1 -0
- package/dist/server/routes/share-api.d.ts +32 -0
- package/dist/server/routes/share-api.js +234 -0
- package/dist/server/routes/share-api.js.map +1 -0
- package/dist/server/routes/views-api.js +51 -0
- package/dist/server/routes/views-api.js.map +1 -1
- package/dist/server/routes/workspace-api.d.ts +2 -1
- package/dist/server/routes/workspace-api.js +142 -23
- package/dist/server/routes/workspace-api.js.map +1 -1
- package/dist/server/routes/ws.d.ts +3 -2
- package/dist/server/routes/ws.js +68 -17
- package/dist/server/routes/ws.js.map +1 -1
- package/dist/server/session-manager.d.ts +48 -5
- package/dist/server/session-manager.js +182 -14
- package/dist/server/session-manager.js.map +1 -1
- package/dist/server/ws-hub.d.ts +124 -37
- package/dist/server/ws-hub.js +0 -0
- package/dist/server/ws-hub.js.map +1 -1
- package/dist/server/yjs-manager.d.ts +278 -7
- package/dist/server/yjs-manager.js +830 -38
- package/dist/server/yjs-manager.js.map +1 -1
- package/dist/server/yjs-persistence.d.ts +165 -0
- package/dist/server/yjs-persistence.js +557 -0
- package/dist/server/yjs-persistence.js.map +1 -0
- package/dist/server/yjs-text-diff.d.ts +32 -0
- package/dist/server/yjs-text-diff.js +61 -0
- package/dist/server/yjs-text-diff.js.map +1 -0
- package/dist/services/access-control.d.ts +73 -0
- package/dist/services/access-control.js +165 -0
- package/dist/services/access-control.js.map +1 -0
- package/dist/services/artifact-asset-token.d.ts +69 -0
- package/dist/services/artifact-asset-token.js +94 -0
- package/dist/services/artifact-asset-token.js.map +1 -0
- package/dist/services/artifact-library-sources.d.ts +3 -0
- package/dist/services/artifact-library-sources.js +44 -0
- package/dist/services/artifact-library-sources.js.map +1 -0
- package/dist/services/artifact-render-export.d.ts +97 -0
- package/dist/services/artifact-render-export.js +467 -0
- package/dist/services/artifact-render-export.js.map +1 -0
- package/dist/services/asset-caption-service.d.ts +103 -0
- package/dist/services/asset-caption-service.js +186 -0
- package/dist/services/asset-caption-service.js.map +1 -0
- package/dist/services/asset-delete-authz.d.ts +31 -0
- package/dist/services/asset-delete-authz.js +61 -0
- package/dist/services/asset-delete-authz.js.map +1 -0
- package/dist/services/asset-finalize-service.d.ts +58 -0
- package/dist/services/asset-finalize-service.js +216 -0
- package/dist/services/asset-finalize-service.js.map +1 -0
- package/dist/services/asset-import-service.d.ts +111 -0
- package/dist/services/asset-import-service.js +394 -0
- package/dist/services/asset-import-service.js.map +1 -0
- package/dist/services/asset-index-sweep.d.ts +95 -0
- package/dist/services/asset-index-sweep.js +249 -0
- package/dist/services/asset-index-sweep.js.map +1 -0
- package/dist/services/asset-lifecycle-check.d.ts +22 -0
- package/dist/services/asset-lifecycle-check.js +80 -0
- package/dist/services/asset-lifecycle-check.js.map +1 -0
- package/dist/services/asset-listing.d.ts +72 -0
- package/dist/services/asset-listing.js +321 -0
- package/dist/services/asset-listing.js.map +1 -0
- package/dist/services/asset-presign-service.d.ts +68 -0
- package/dist/services/asset-presign-service.js +124 -0
- package/dist/services/asset-presign-service.js.map +1 -0
- package/dist/services/asset-sidecar-service.d.ts +28 -0
- package/dist/services/asset-sidecar-service.js +79 -0
- package/dist/services/asset-sidecar-service.js.map +1 -0
- package/dist/services/asset-upload-errors.d.ts +41 -0
- package/dist/services/asset-upload-errors.js +45 -0
- package/dist/services/asset-upload-errors.js.map +1 -0
- package/dist/services/asset-upload-service.d.ts +56 -0
- package/dist/services/asset-upload-service.js +200 -0
- package/dist/services/asset-upload-service.js.map +1 -0
- package/dist/services/asset-upload-token.d.ts +58 -0
- package/dist/services/asset-upload-token.js +75 -0
- package/dist/services/asset-upload-token.js.map +1 -0
- package/dist/services/assets/asset-index-service.d.ts +127 -0
- package/dist/services/assets/asset-index-service.js +227 -0
- package/dist/services/assets/asset-index-service.js.map +1 -0
- package/dist/services/assets/base.d.ts +128 -2
- package/dist/services/assets/base.js +98 -1
- package/dist/services/assets/base.js.map +1 -1
- package/dist/services/assets/index.d.ts +114 -1
- package/dist/services/assets/index.js +221 -0
- package/dist/services/assets/index.js.map +1 -1
- package/dist/services/assets/local.d.ts +16 -1
- package/dist/services/assets/local.js +110 -1
- package/dist/services/assets/local.js.map +1 -1
- package/dist/services/assets/r2-sync.d.ts +88 -0
- package/dist/services/assets/r2-sync.js +412 -0
- package/dist/services/assets/r2-sync.js.map +1 -0
- package/dist/services/assets/r2.d.ts +87 -1
- package/dist/services/assets/r2.js +203 -1
- package/dist/services/assets/r2.js.map +1 -1
- package/dist/services/auth-service.d.ts +312 -45
- package/dist/services/auth-service.js +1011 -195
- package/dist/services/auth-service.js.map +1 -1
- package/dist/services/chat-session-service.d.ts +188 -0
- package/dist/services/chat-session-service.js +512 -0
- package/dist/services/chat-session-service.js.map +1 -0
- package/dist/services/cloud-inference-billing.d.ts +64 -0
- package/dist/services/cloud-inference-billing.js +313 -0
- package/dist/services/cloud-inference-billing.js.map +1 -0
- package/dist/services/comment-service.d.ts +97 -0
- package/dist/services/comment-service.js +341 -0
- package/dist/services/comment-service.js.map +1 -0
- package/dist/services/comment-virtual-entity.d.ts +36 -0
- package/dist/services/comment-virtual-entity.js +71 -0
- package/dist/services/comment-virtual-entity.js.map +1 -0
- package/dist/services/convert-service.d.ts +64 -0
- package/dist/services/convert-service.js +68 -0
- package/dist/services/convert-service.js.map +1 -0
- package/dist/services/csv-service.d.ts +22 -17
- package/dist/services/csv-service.js +55 -92
- package/dist/services/csv-service.js.map +1 -1
- package/dist/services/entity-mutations.d.ts +213 -0
- package/dist/services/entity-mutations.js +380 -0
- package/dist/services/entity-mutations.js.map +1 -0
- package/dist/services/{meeting-processor.d.ts → event-processor.d.ts} +15 -8
- package/dist/services/{meeting-processor.js → event-processor.js} +124 -65
- package/dist/services/event-processor.js.map +1 -0
- package/dist/services/extract/docx.d.ts +1 -0
- package/dist/services/extract/docx.js +233 -0
- package/dist/services/extract/docx.js.map +1 -0
- package/dist/services/extract/index.d.ts +9 -0
- package/dist/services/extract/index.js +10 -0
- package/dist/services/extract/index.js.map +1 -0
- package/dist/services/extract/pdf.d.ts +13 -0
- package/dist/services/extract/pdf.js +69 -0
- package/dist/services/extract/pdf.js.map +1 -0
- package/dist/services/folder-creation.d.ts +33 -0
- package/dist/services/folder-creation.js +103 -0
- package/dist/services/folder-creation.js.map +1 -0
- package/dist/services/git.d.ts +58 -0
- package/dist/services/git.js +194 -55
- package/dist/services/git.js.map +1 -1
- package/dist/services/graph-maintenance.js +4 -4
- package/dist/services/graph-maintenance.js.map +1 -1
- package/dist/services/import-service.d.ts +51 -2
- package/dist/services/import-service.js +254 -107
- package/dist/services/import-service.js.map +1 -1
- package/dist/services/lint-service.js +10 -17
- package/dist/services/lint-service.js.map +1 -1
- package/dist/services/markdown.d.ts +12 -1
- package/dist/services/markdown.js +77 -9
- package/dist/services/markdown.js.map +1 -1
- package/dist/services/mention-detector.d.ts +23 -0
- package/dist/services/mention-detector.js +47 -0
- package/dist/services/mention-detector.js.map +1 -0
- package/dist/services/model-capabilities.d.ts +41 -0
- package/dist/services/model-capabilities.js +107 -0
- package/dist/services/model-capabilities.js.map +1 -0
- package/dist/services/notification-broadcast.d.ts +32 -0
- package/dist/services/notification-broadcast.js +38 -0
- package/dist/services/notification-broadcast.js.map +1 -0
- package/dist/services/notification-service.d.ts +41 -0
- package/dist/services/notification-service.js +100 -0
- package/dist/services/notification-service.js.map +1 -0
- package/dist/services/oauth-server-store.d.ts +147 -0
- package/dist/services/oauth-server-store.js +319 -0
- package/dist/services/oauth-server-store.js.map +1 -0
- package/dist/services/orphan-service.js +2 -2
- package/dist/services/orphan-service.js.map +1 -1
- package/dist/services/personal-folder.d.ts +40 -0
- package/dist/services/personal-folder.js +101 -0
- package/dist/services/personal-folder.js.map +1 -0
- package/dist/services/scratch-asset-promote.d.ts +57 -0
- package/dist/services/scratch-asset-promote.js +95 -0
- package/dist/services/scratch-asset-promote.js.map +1 -0
- package/dist/services/scratch-attachment-service.d.ts +196 -0
- package/dist/services/scratch-attachment-service.js +347 -0
- package/dist/services/scratch-attachment-service.js.map +1 -0
- package/dist/services/share-link-service.d.ts +57 -0
- package/dist/services/share-link-service.js +142 -0
- package/dist/services/share-link-service.js.map +1 -0
- package/dist/services/user-person-bridge.d.ts +136 -0
- package/dist/services/user-person-bridge.js +340 -0
- package/dist/services/user-person-bridge.js.map +1 -0
- package/dist/services/vector-service.d.ts +282 -5
- package/dist/services/vector-service.js +585 -29
- package/dist/services/vector-service.js.map +1 -1
- package/dist/services/workspace-access.d.ts +108 -0
- package/dist/services/workspace-access.js +149 -0
- package/dist/services/workspace-access.js.map +1 -0
- package/dist/services/workspace-assets-folder.d.ts +46 -0
- package/dist/services/workspace-assets-folder.js +75 -0
- package/dist/services/workspace-assets-folder.js.map +1 -0
- package/dist/utils/git.d.ts +17 -2
- package/dist/utils/git.js +23 -7
- package/dist/utils/git.js.map +1 -1
- package/dist/utils/log.d.ts +42 -0
- package/dist/utils/log.js +137 -0
- package/dist/utils/log.js.map +1 -0
- package/dist/utils/preflight.js +2 -2
- package/dist/utils/preflight.js.map +1 -1
- package/dist/utils/version-checker.d.ts +12 -19
- package/dist/utils/version-checker.js +14 -104
- package/dist/utils/version-checker.js.map +1 -1
- package/dist/web/_app/immutable/assets/0.Bs_z3Z86.css +2 -0
- package/dist/web/_app/immutable/assets/12.DlIf1mKh.css +1 -0
- package/dist/web/_app/immutable/assets/14.7d-Q37wc.css +1 -0
- package/dist/web/_app/immutable/assets/15.BwBFdc1D.css +1 -0
- package/dist/web/_app/immutable/assets/16.CmLrbzZp.css +1 -0
- package/dist/web/_app/immutable/assets/17.DcuK5ZVm.css +1 -0
- package/dist/web/_app/immutable/assets/2.DATnR31c.css +1 -0
- package/dist/web/_app/immutable/assets/3.Cz4H8n_O.css +1 -0
- package/dist/web/_app/immutable/assets/4.aDHteTDy.css +1 -0
- package/dist/web/_app/immutable/assets/6.CF1i5Bon.css +1 -0
- package/dist/web/_app/immutable/assets/ArtifactEntityView.C4ooklFD.css +1 -0
- package/dist/web/_app/immutable/assets/AssetLibraryPicker.BOFW0MvF.css +1 -0
- package/dist/web/_app/immutable/assets/BulkActionsBar.cmKvHzRK.css +1 -0
- package/dist/web/_app/immutable/assets/CalendarView.lBCvS3X5.css +1 -0
- package/dist/web/_app/immutable/assets/CodeMirrorEditor.D6hf2pNJ.css +1 -0
- package/dist/web/_app/immutable/assets/CopyField.DVGZtw4U.css +1 -0
- package/dist/web/_app/immutable/assets/FolderMembersPanel.kiYnDFHu.css +1 -0
- package/dist/web/_app/immutable/assets/FolderMutationDialogs.BMRF6Z3z.css +1 -0
- package/dist/web/_app/immutable/assets/FolderPicker.Cp46GHe2.css +1 -0
- package/dist/web/_app/immutable/assets/GalleryView.WBGxxUQc.css +1 -0
- package/dist/web/_app/immutable/assets/GraphView.BJtGL9py.css +1 -0
- package/dist/web/_app/immutable/assets/KanbanView.BOaI5KFL.css +1 -0
- package/dist/web/_app/immutable/assets/Link.vV0ne105.css +1 -0
- package/dist/web/_app/immutable/assets/Markdown.BZnsSOSf.css +1 -0
- package/dist/web/_app/immutable/assets/Rail.ilusFgD4.css +1 -0
- package/dist/web/_app/immutable/assets/SettingsDialog.D7-BO6S_.css +1 -0
- package/dist/web/_app/immutable/assets/Spinner.UBfl0pab.css +1 -0
- package/dist/web/_app/immutable/assets/StopFilledAlt.fNlDN65D.css +1 -0
- package/dist/web/_app/immutable/assets/TimelineView.xAZBJhHw.css +1 -0
- package/dist/web/_app/immutable/assets/WorkspaceView.C8ErUJAY.css +1 -0
- package/dist/web/_app/immutable/assets/button.BlLm4Dg1.css +1 -0
- package/dist/web/_app/immutable/assets/history-summary.LpmHXasl.css +1 -0
- package/dist/web/_app/immutable/assets/ibm-plex-mono-latin-400-normal.CvHOgSBP.woff +0 -0
- package/dist/web/_app/immutable/assets/ibm-plex-mono-latin-400-normal.DMJ8VG8y.woff2 +0 -0
- package/dist/web/_app/immutable/assets/ibm-plex-mono-latin-500-normal.CB9ihrfo.woff +0 -0
- package/dist/web/_app/immutable/assets/ibm-plex-mono-latin-500-normal.DSY6xOcd.woff2 +0 -0
- package/dist/web/_app/immutable/assets/ibm-plex-sans-latin-400-italic.CZTNEAuW.woff2 +0 -0
- package/dist/web/_app/immutable/assets/ibm-plex-sans-latin-400-italic.CsGl1sm0.woff +0 -0
- package/dist/web/_app/immutable/assets/ibm-plex-sans-latin-400-normal.CDDApCn2.woff2 +0 -0
- package/dist/web/_app/immutable/assets/ibm-plex-sans-latin-400-normal.CYLoc0-x.woff +0 -0
- package/dist/web/_app/immutable/assets/ibm-plex-sans-latin-500-italic.BNK2_mGO.woff2 +0 -0
- package/dist/web/_app/immutable/assets/ibm-plex-sans-latin-500-italic.DpEwFAQM.woff +0 -0
- package/dist/web/_app/immutable/assets/ibm-plex-sans-latin-500-normal.6ng42L7E.woff2 +0 -0
- package/dist/web/_app/immutable/assets/ibm-plex-sans-latin-500-normal.BgVn5rGT.woff +0 -0
- package/dist/web/_app/immutable/assets/ibm-plex-sans-latin-600-normal.Cu4Hd6ag.woff +0 -0
- package/dist/web/_app/immutable/assets/ibm-plex-sans-latin-600-normal.CuJfVYMP.woff2 +0 -0
- package/dist/web/_app/immutable/assets/inline-list.cqga56xT.css +1 -0
- package/dist/web/_app/immutable/assets/list-columns.BgnafZ4K.css +1 -0
- package/dist/web/_app/immutable/assets/realtime.DDCWxn3B.css +1 -0
- package/dist/web/_app/immutable/assets/select.B90KUqR4.css +1 -0
- package/dist/web/_app/immutable/assets/sheet.RF9RBmml.css +1 -0
- package/dist/web/_app/immutable/chunks/22qYtvr82.js +1 -0
- package/dist/web/_app/immutable/chunks/3anKjXOb.js +1 -0
- package/dist/web/_app/immutable/chunks/6S9WOky52.js +1 -0
- package/dist/web/_app/immutable/chunks/7xJ91z7d.js +2 -0
- package/dist/web/_app/immutable/chunks/9K8VREGP.js +1 -0
- package/dist/web/_app/immutable/chunks/B-TGZnCt2.js +1 -0
- package/dist/web/_app/immutable/chunks/B-n5q6ku.js +1 -0
- package/dist/web/_app/immutable/chunks/B0p2fSEV2.js +1 -0
- package/dist/web/_app/immutable/chunks/B2oi87jG.js +2 -0
- package/dist/web/_app/immutable/chunks/B4DG5QOL.js +1 -0
- package/dist/web/_app/immutable/chunks/B6Lt-qaJ.js +1 -0
- package/dist/web/_app/immutable/chunks/B6qeIQZz.js +2 -0
- package/dist/web/_app/immutable/chunks/B9KfEsQw2.js +1 -0
- package/dist/web/_app/immutable/chunks/B9VRF5aH2.js +1 -0
- package/dist/web/_app/immutable/chunks/BCQQzpbj.js +1 -0
- package/dist/web/_app/immutable/chunks/BF0vIqH9.js +1 -0
- package/dist/web/_app/immutable/chunks/BFp1K70l.js +8 -0
- package/dist/web/_app/immutable/chunks/BFr7Funh.js +1 -0
- package/dist/web/_app/immutable/chunks/BFx32D20.js +2 -0
- package/dist/web/_app/immutable/chunks/BLs1h0Rh2.js +1 -0
- package/dist/web/_app/immutable/chunks/BPzV_xOS2.js +1 -0
- package/dist/web/_app/immutable/chunks/BRvMjAzW.js +2 -0
- package/dist/web/_app/immutable/chunks/BV-iCKqa.js +1 -0
- package/dist/web/_app/immutable/chunks/BZi3uKF4.js +1 -0
- package/dist/web/_app/immutable/chunks/B_PyL87x.js +2 -0
- package/dist/web/_app/immutable/chunks/BbfHGU9n2.js +1 -0
- package/dist/web/_app/immutable/chunks/Bbqu2-5G2.js +1 -0
- package/dist/web/_app/immutable/chunks/BdWZJpmv.js +2 -0
- package/dist/web/_app/immutable/chunks/BfnFtsiY.js +1 -0
- package/dist/web/_app/immutable/chunks/BlgjVmFM2.js +14 -0
- package/dist/web/_app/immutable/chunks/BmgXvmIG.js +5 -0
- package/dist/web/_app/immutable/chunks/BpCG9m962.js +1 -0
- package/dist/web/_app/immutable/chunks/BrveeylZ.js +1 -0
- package/dist/web/_app/immutable/chunks/BsW72fyR2.js +1 -0
- package/dist/web/_app/immutable/chunks/Bti_XKwx.js +2692 -0
- package/dist/web/_app/immutable/chunks/BuhW5Fr0.js +689 -0
- package/dist/web/_app/immutable/chunks/Bx74EEyn2.js +1 -0
- package/dist/web/_app/immutable/chunks/BxPN0T61.js +1 -0
- package/dist/web/_app/immutable/chunks/Bxk27YWG.js +1 -0
- package/dist/web/_app/immutable/chunks/Bz9lrgGs.js +1 -0
- package/dist/web/_app/immutable/chunks/BzaxZ6j12.js +1 -0
- package/dist/web/_app/immutable/chunks/C1B4xDs0.js +1 -0
- package/dist/web/_app/immutable/chunks/C1trcC8M.js +7 -0
- package/dist/web/_app/immutable/chunks/C3F_NMTk.js +3 -0
- package/dist/web/_app/immutable/chunks/C4PZmGUQ.js +2 -0
- package/dist/web/_app/immutable/chunks/C6wYiSz8.js +1 -0
- package/dist/web/_app/immutable/chunks/C70saxIl.js +1 -0
- package/dist/web/_app/immutable/chunks/C9tvkk7Y2.js +22 -0
- package/dist/web/_app/immutable/chunks/CE1XZ5DE.js +1 -0
- package/dist/web/_app/immutable/chunks/CEahbtnP.js +1 -0
- package/dist/web/_app/immutable/chunks/CGkd0a-c2.js +2 -0
- package/dist/web/_app/immutable/chunks/CIoNEHQ82.js +184 -0
- package/dist/web/_app/immutable/chunks/CK4z74w5.js +1 -0
- package/dist/web/_app/immutable/chunks/COo3HgCZ.js +1 -0
- package/dist/web/_app/immutable/chunks/CP8_U450.js +1 -0
- package/dist/web/_app/immutable/chunks/CQ1eQ93t2.js +6 -0
- package/dist/web/_app/immutable/chunks/CQyBDccA.js +1 -0
- package/dist/web/_app/immutable/chunks/CUFQMEBn2.js +1 -0
- package/dist/web/_app/immutable/chunks/CV5OSCJc.js +1 -0
- package/dist/web/_app/immutable/chunks/CYEYDNwO2.js +1 -0
- package/dist/web/_app/immutable/chunks/CZgFaimi2.js +83 -0
- package/dist/web/_app/immutable/chunks/CZqvCTCv.js +1 -0
- package/dist/web/_app/immutable/chunks/CcWaWbrI2.js +1 -0
- package/dist/web/_app/immutable/chunks/CdtzRVZK.js +1 -0
- package/dist/web/_app/immutable/chunks/CfYG72Hc.js +1 -0
- package/dist/web/_app/immutable/chunks/Cg-ND0cl.js +1 -0
- package/dist/web/_app/immutable/chunks/Ch1kmm3J2.js +1 -0
- package/dist/web/_app/immutable/chunks/CjiMLTwX2.js +1 -0
- package/dist/web/_app/immutable/chunks/CkoeSJ8K.js +6 -0
- package/dist/web/_app/immutable/chunks/Cp87MaaW.js +1 -0
- package/dist/web/_app/immutable/chunks/Cqm5wAin.js +1 -0
- package/dist/web/_app/immutable/chunks/Ct1uesdW.js +2 -0
- package/dist/web/_app/immutable/chunks/CuYPXpWU.js +1 -0
- package/dist/web/_app/immutable/chunks/Cuq8J2Td.js +1 -0
- package/dist/web/_app/immutable/chunks/CvSEodTA.js +1 -0
- package/dist/web/_app/immutable/chunks/CvqqrTrj.js +1 -0
- package/dist/web/_app/immutable/chunks/CzXdOgVl2.js +7 -0
- package/dist/web/_app/immutable/chunks/D0W7c6Sg.js +185 -0
- package/dist/web/_app/immutable/chunks/D0rBhnqB2.js +1 -0
- package/dist/web/_app/immutable/chunks/D1-GZSN1.js +1 -0
- package/dist/web/_app/immutable/chunks/D1BLcNJ7.js +1 -0
- package/dist/web/_app/immutable/chunks/D1yvtriI.js +1 -0
- package/dist/web/_app/immutable/chunks/D25NMRpl.js +1 -0
- package/dist/web/_app/immutable/chunks/D3F675fu2.js +2 -0
- package/dist/web/_app/immutable/chunks/D4UrtGC1.js +1 -0
- package/dist/web/_app/immutable/chunks/D8wZ2xul.js +4 -0
- package/dist/web/_app/immutable/chunks/DA3HEX3X.js +1 -0
- package/dist/web/_app/immutable/chunks/DE2TCESD2.js +1 -0
- package/dist/web/_app/immutable/chunks/DN-gIRdd2.js +1 -0
- package/dist/web/_app/immutable/chunks/DPUVu0T0.js +1 -0
- package/dist/web/_app/immutable/chunks/DPcejqKZ.js +1 -0
- package/dist/web/_app/immutable/chunks/DQMWa2t7.js +1 -0
- package/dist/web/_app/immutable/chunks/DRPMJ-3M.js +2 -0
- package/dist/web/_app/immutable/chunks/DRPnwQAm.js +1 -0
- package/dist/web/_app/immutable/chunks/DXmfl4Hq2.js +1 -0
- package/dist/web/_app/immutable/chunks/DXsFrDer2.js +1 -0
- package/dist/web/_app/immutable/chunks/DYc5KW3F.js +1 -0
- package/dist/web/_app/immutable/chunks/DcPrzUMJ.js +1 -0
- package/dist/web/_app/immutable/chunks/DdQVGKgM.js +1 -0
- package/dist/web/_app/immutable/chunks/DiFfW--R2.js +2 -0
- package/dist/web/_app/immutable/chunks/DjIqa1_y.js +2 -0
- package/dist/web/_app/immutable/chunks/Dl63IUnH2.js +224 -0
- package/dist/web/_app/immutable/chunks/DmFdD6zT.js +1 -0
- package/dist/web/_app/immutable/chunks/Dn3R8S-U.js +1 -0
- package/dist/web/_app/immutable/chunks/DpNr1GQ2.js +1 -0
- package/dist/web/_app/immutable/chunks/DsFEd8vL2.js +1 -0
- package/dist/web/_app/immutable/chunks/DuxziNnw.js +1 -0
- package/dist/web/_app/immutable/chunks/FuiJnZG0.js +1 -0
- package/dist/web/_app/immutable/chunks/Izkulod7.js +1 -0
- package/dist/web/_app/immutable/chunks/LYL8znYR2.js +23 -0
- package/dist/web/_app/immutable/chunks/ON7Gta0d.js +1 -0
- package/dist/web/_app/immutable/chunks/PhN6tXuJ2.js +1 -0
- package/dist/web/_app/immutable/chunks/PyLyCpuL.js +1 -0
- package/dist/web/_app/immutable/chunks/RG7IUVLn2.js +2 -0
- package/dist/web/_app/immutable/chunks/RK4gCWN0.js +2 -0
- package/dist/web/_app/immutable/chunks/SnzlL4ZV.js +1 -0
- package/dist/web/_app/immutable/chunks/XcWejFm_.js +5 -0
- package/dist/web/_app/immutable/chunks/Xkp5hSA1.js +1 -0
- package/dist/web/_app/immutable/chunks/al_nidE9.js +1 -0
- package/dist/web/_app/immutable/chunks/e50-izZO2.js +1 -0
- package/dist/web/_app/immutable/chunks/golz20La2.js +2 -0
- package/dist/web/_app/immutable/chunks/hG-QCarB.js +1 -0
- package/dist/web/_app/immutable/chunks/kNaey6uv.js +1 -0
- package/dist/web/_app/immutable/chunks/nXReuy-5.js +3 -0
- package/dist/web/_app/immutable/chunks/o61aZZFZ2.js +66 -0
- package/dist/web/_app/immutable/chunks/qwr5boV8.js +1 -0
- package/dist/web/_app/immutable/chunks/rjjyuGhb.js +1 -0
- package/dist/web/_app/immutable/chunks/uBgoVlsx.js +3 -0
- package/dist/web/_app/immutable/chunks/xY0c-UfG.js +3 -0
- package/dist/web/_app/immutable/chunks/xeNvx4Bl2.js +1 -0
- package/dist/web/_app/immutable/chunks/xihTtKlq.js +1 -0
- package/dist/web/_app/immutable/entry/app.dqA31fjy.js +2 -0
- package/dist/web/_app/immutable/entry/start.BB1XrAea.js +1 -0
- package/dist/web/_app/immutable/nodes/0.dALEQAnu.js +2 -0
- package/dist/web/_app/immutable/nodes/1.aFU32Ukj.js +1 -0
- package/dist/web/_app/immutable/nodes/10.C2wB-OnW.js +1 -0
- package/dist/web/_app/immutable/nodes/11.CI3a8Rj5.js +1 -0
- package/dist/web/_app/immutable/nodes/12.CsTvsKzB.js +1 -0
- package/dist/web/_app/immutable/nodes/13.CYrHXCA8.js +1 -0
- package/dist/web/_app/immutable/nodes/14.B31HrQ26.js +1 -0
- package/dist/web/_app/immutable/nodes/15.DxgnZ61h.js +1 -0
- package/dist/web/_app/immutable/nodes/16.DAP8cwVb.js +1 -0
- package/dist/web/_app/immutable/nodes/17.CmwXtCDY.js +77 -0
- package/dist/web/_app/immutable/nodes/2.BuGXEIlN.js +122 -0
- package/dist/web/_app/immutable/nodes/3.CmhZJWHE.js +6 -0
- package/dist/web/_app/immutable/nodes/4.BRfoPTm-.js +11 -0
- package/dist/web/_app/immutable/nodes/5.C7gPuZM_.js +1 -0
- package/dist/web/_app/immutable/nodes/6.qKODVbya.js +6 -0
- package/dist/web/_app/immutable/nodes/7.BZO37zAJ.js +1 -0
- package/dist/web/_app/immutable/nodes/8.xF_Dd1BO.js +1 -0
- package/dist/web/_app/immutable/nodes/9.Bow4UyKV.js +1 -0
- package/dist/web/_app/version.json +1 -1
- package/dist/web/favicon-16.png +0 -0
- package/dist/web/favicon-180.png +0 -0
- package/dist/web/favicon-32.png +0 -0
- package/dist/web/favicon-48.png +0 -0
- package/dist/web/favicon-512.png +0 -0
- package/dist/web/favicon.ico +0 -0
- package/dist/web/favicon.svg +8 -0
- package/dist/web/index.html +56 -21
- package/dist/web/studiograph-logomark.svg +29 -0
- package/package.json +35 -14
- package/dist/agent/skills/enrich-entities.md +0 -136
- package/dist/agent/skills/sync-configuration.md +0 -119
- package/dist/agent/skills/sync-setup.md +0 -82
- package/dist/agent/tools/message-tools.d.ts +0 -42
- package/dist/agent/tools/message-tools.js +0 -106
- package/dist/agent/tools/message-tools.js.map +0 -1
- package/dist/cli/commands/app.d.ts +0 -7
- package/dist/cli/commands/app.js +0 -268
- package/dist/cli/commands/app.js.map +0 -1
- package/dist/cli/commands/clear.d.ts +0 -5
- package/dist/cli/commands/clear.js +0 -36
- package/dist/cli/commands/clear.js.map +0 -1
- package/dist/cli/commands/collection.d.ts +0 -10
- package/dist/cli/commands/collection.js.map +0 -1
- package/dist/cli/commands/join.d.ts +0 -9
- package/dist/cli/commands/join.js +0 -255
- package/dist/cli/commands/join.js.map +0 -1
- package/dist/cli/commands/start.d.ts +0 -7
- package/dist/cli/commands/start.js +0 -584
- package/dist/cli/commands/start.js.map +0 -1
- package/dist/cli/commands/update.d.ts +0 -8
- package/dist/cli/commands/update.js +0 -155
- package/dist/cli/commands/update.js.map +0 -1
- package/dist/cli/commands/user.d.ts +0 -7
- package/dist/cli/commands/user.js +0 -175
- package/dist/cli/commands/user.js.map +0 -1
- package/dist/cli/scaffolding.d.ts +0 -12
- package/dist/cli/scaffolding.js +0 -397
- package/dist/cli/scaffolding.js.map +0 -1
- package/dist/integrations/registry.d.ts +0 -8
- package/dist/integrations/registry.js +0 -7
- package/dist/integrations/registry.js.map +0 -1
- package/dist/integrations/types.d.ts +0 -43
- package/dist/integrations/types.js +0 -5
- package/dist/integrations/types.js.map +0 -1
- package/dist/lib/lib/utils.d.ts +0 -2
- package/dist/lib/lib/utils.js +0 -6
- package/dist/lib/lib/utils.js.map +0 -1
- package/dist/server/chrome/chrome.css +0 -691
- package/dist/server/chrome/chrome.js +0 -374
- package/dist/server/commit-scheduler.d.ts +0 -39
- package/dist/server/commit-scheduler.js +0 -113
- package/dist/server/commit-scheduler.js.map +0 -1
- package/dist/server/plugin-loader.d.ts +0 -53
- package/dist/server/plugin-loader.js +0 -155
- package/dist/server/plugin-loader.js.map +0 -1
- package/dist/server/routes/meeting-ingest-api.d.ts +0 -14
- package/dist/server/routes/meeting-ingest-api.js.map +0 -1
- package/dist/server/routes/messages-api.d.ts +0 -15
- package/dist/server/routes/messages-api.js +0 -385
- package/dist/server/routes/messages-api.js.map +0 -1
- package/dist/services/batch-processor.d.ts +0 -49
- package/dist/services/batch-processor.js +0 -166
- package/dist/services/batch-processor.js.map +0 -1
- package/dist/services/briefing.d.ts +0 -26
- package/dist/services/briefing.js +0 -230
- package/dist/services/briefing.js.map +0 -1
- package/dist/services/heartbeat.d.ts +0 -28
- package/dist/services/heartbeat.js +0 -183
- package/dist/services/heartbeat.js.map +0 -1
- package/dist/services/image-import-service.d.ts +0 -24
- package/dist/services/image-import-service.js +0 -108
- package/dist/services/image-import-service.js.map +0 -1
- package/dist/services/insights.d.ts +0 -38
- package/dist/services/insights.js +0 -269
- package/dist/services/insights.js.map +0 -1
- package/dist/services/meeting-processor.js.map +0 -1
- package/dist/services/message-service.d.ts +0 -68
- package/dist/services/message-service.js +0 -220
- package/dist/services/message-service.js.map +0 -1
- package/dist/utils/workspace-config.d.ts +0 -8
- package/dist/utils/workspace-config.js +0 -22
- package/dist/utils/workspace-config.js.map +0 -1
- package/dist/web/_app/immutable/assets/0.uPSqtsC5.css +0 -1
- package/dist/web/_app/immutable/assets/11.2jzI3cZY.css +0 -1
- package/dist/web/_app/immutable/assets/12.CT4xL4K3.css +0 -1
- package/dist/web/_app/immutable/assets/13.BUrHkYry.css +0 -1
- package/dist/web/_app/immutable/assets/2.DpQWr6q6.css +0 -1
- package/dist/web/_app/immutable/assets/3.BxdqT7zi.css +0 -1
- package/dist/web/_app/immutable/assets/4.DdNqjd0T.css +0 -1
- package/dist/web/_app/immutable/assets/5.DFeGxLYf.css +0 -1
- package/dist/web/_app/immutable/assets/6.DXZr_rI_.css +0 -1
- package/dist/web/_app/immutable/assets/GraphView.D9ePpZez.css +0 -1
- package/dist/web/_app/immutable/assets/Toaster.rN8r_Hzv.css +0 -1
- package/dist/web/_app/immutable/assets/ViewToolbar.BWE03S64.css +0 -1
- package/dist/web/_app/immutable/assets/WorkspaceView.CgGDi_Zb.css +0 -1
- package/dist/web/_app/immutable/assets/wikilinks.CzMBkUMB.css +0 -1
- package/dist/web/_app/immutable/chunks/-jG4Obyh.js +0 -4
- package/dist/web/_app/immutable/chunks/2nrc8f_O.js +0 -1
- package/dist/web/_app/immutable/chunks/7S2LGqoP.js +0 -2
- package/dist/web/_app/immutable/chunks/8Q3ZJIYu.js +0 -1
- package/dist/web/_app/immutable/chunks/B8ydT5xX.js +0 -2
- package/dist/web/_app/immutable/chunks/BB_5th5W.js +0 -3383
- package/dist/web/_app/immutable/chunks/BEn6N5c2.js +0 -1
- package/dist/web/_app/immutable/chunks/BFNNbCAM.js +0 -1
- package/dist/web/_app/immutable/chunks/BFZZEUd5.js +0 -1
- package/dist/web/_app/immutable/chunks/BGk8kfOE.js +0 -2
- package/dist/web/_app/immutable/chunks/BIBCr278.js +0 -1
- package/dist/web/_app/immutable/chunks/BPCkkwqe.js +0 -1
- package/dist/web/_app/immutable/chunks/BhlvzGQx.js +0 -1
- package/dist/web/_app/immutable/chunks/BlMknQeF.js +0 -1
- package/dist/web/_app/immutable/chunks/BpjqrlCg.js +0 -1
- package/dist/web/_app/immutable/chunks/BrebtJNG.js +0 -18
- package/dist/web/_app/immutable/chunks/ByBZ7JIT.js +0 -1
- package/dist/web/_app/immutable/chunks/Bz0ZjVQE.js +0 -2
- package/dist/web/_app/immutable/chunks/BzJTZOK2.js +0 -1
- package/dist/web/_app/immutable/chunks/C0LVZhvn.js +0 -1
- package/dist/web/_app/immutable/chunks/C3uBrOS5.js +0 -1
- package/dist/web/_app/immutable/chunks/C8R1sDpW.js +0 -1
- package/dist/web/_app/immutable/chunks/CDRHrs0g.js +0 -1
- package/dist/web/_app/immutable/chunks/CN5_py1I.js +0 -1
- package/dist/web/_app/immutable/chunks/CPne482a.js +0 -1
- package/dist/web/_app/immutable/chunks/CSVbGg_b.js +0 -5
- package/dist/web/_app/immutable/chunks/CWyU-seV.js +0 -1
- package/dist/web/_app/immutable/chunks/CX_61fY8.js +0 -5
- package/dist/web/_app/immutable/chunks/CYrVHOHA.js +0 -1
- package/dist/web/_app/immutable/chunks/ChsiIm-E.js +0 -1
- package/dist/web/_app/immutable/chunks/CojKppbh.js +0 -1
- package/dist/web/_app/immutable/chunks/CqkleIqs.js +0 -1
- package/dist/web/_app/immutable/chunks/CtYLtD7K.js +0 -1
- package/dist/web/_app/immutable/chunks/D-HDy5qS.js +0 -1
- package/dist/web/_app/immutable/chunks/D5aIYSkd.js +0 -1
- package/dist/web/_app/immutable/chunks/DBBXARVf.js +0 -1
- package/dist/web/_app/immutable/chunks/DFYOFE3o.js +0 -1
- package/dist/web/_app/immutable/chunks/DKaafS50.js +0 -1
- package/dist/web/_app/immutable/chunks/DUMOo1Pn.js +0 -1
- package/dist/web/_app/immutable/chunks/DWX9f6AF.js +0 -1
- package/dist/web/_app/immutable/chunks/DY8-EONP.js +0 -1
- package/dist/web/_app/immutable/chunks/DkoHPElM.js +0 -1
- package/dist/web/_app/immutable/chunks/DnL9f0lc.js +0 -7
- package/dist/web/_app/immutable/chunks/DsnmJJEf.js +0 -1
- package/dist/web/_app/immutable/chunks/DujahU3W.js +0 -1
- package/dist/web/_app/immutable/chunks/FBn-ES5k.js +0 -1
- package/dist/web/_app/immutable/chunks/HQpwSOb3.js +0 -1
- package/dist/web/_app/immutable/chunks/KyjzlWRN.js +0 -2
- package/dist/web/_app/immutable/chunks/PPVm8Dsz.js +0 -1
- package/dist/web/_app/immutable/chunks/UwYfmrPx.js +0 -2
- package/dist/web/_app/immutable/chunks/W25ZVI8L.js +0 -2
- package/dist/web/_app/immutable/chunks/WSUKABI_.js +0 -1
- package/dist/web/_app/immutable/chunks/XjsuEnNE.js +0 -5
- package/dist/web/_app/immutable/chunks/ZD6ARAtb.js +0 -1
- package/dist/web/_app/immutable/chunks/pBTf4stg.js +0 -2
- package/dist/web/_app/immutable/chunks/rGIarcnp.js +0 -1
- package/dist/web/_app/immutable/chunks/vxEtkL8z.js +0 -1
- package/dist/web/_app/immutable/chunks/wDIGUaoU.js +0 -3
- package/dist/web/_app/immutable/entry/app.ZHiTM8WS.js +0 -2
- package/dist/web/_app/immutable/entry/start.C9-FfAVc.js +0 -1
- package/dist/web/_app/immutable/nodes/0.D92Orz8k.js +0 -2
- package/dist/web/_app/immutable/nodes/1.BMdyglM_.js +0 -1
- package/dist/web/_app/immutable/nodes/10.BilVDHSL.js +0 -1
- package/dist/web/_app/immutable/nodes/11.CS9E0Hic.js +0 -1
- package/dist/web/_app/immutable/nodes/12.D3BOxYzG.js +0 -1
- package/dist/web/_app/immutable/nodes/13.CClMKYtN.js +0 -1
- package/dist/web/_app/immutable/nodes/2.C8KKElPL.js +0 -267
- package/dist/web/_app/immutable/nodes/3.C5n5uiWU.js +0 -5
- package/dist/web/_app/immutable/nodes/4.DcGVvgiL.js +0 -11
- package/dist/web/_app/immutable/nodes/5.DxIjnFQO.js +0 -4
- package/dist/web/_app/immutable/nodes/6.lkh6kKLj.js +0 -1
- package/dist/web/_app/immutable/nodes/7.Bg7SbfhA.js +0 -1
- package/dist/web/_app/immutable/nodes/8.DcXWCNBE.js +0 -1
- package/dist/web/_app/immutable/nodes/9.Cefi8Jfm.js +0 -1
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Public read-only share links.
|
|
3
|
+
*
|
|
4
|
+
* The app's first anonymous surface. Three routes:
|
|
5
|
+
*
|
|
6
|
+
* POST /api/repos/:repo/entities/:type/:id/share-link (AUTHED) — mint/reuse
|
|
7
|
+
* GET /api/share/:token (PUBLIC) — read body
|
|
8
|
+
* GET /api/share/:token/asset/:assetId/:filename (PUBLIC) — embedded asset
|
|
9
|
+
*
|
|
10
|
+
* Authorization model:
|
|
11
|
+
* - Mint is write-gated (mirrors revoke). Personal folders ARE publishable by
|
|
12
|
+
* their owner — the publish right is orthogonal to teammate visibility, and
|
|
13
|
+
* the single mint caller is already owner-gated. Today read ⟺ write for
|
|
14
|
+
* shared folders, so write-gating is a no-op now but keeps publish/unpublish
|
|
15
|
+
* coherent and pre-empts a future read-only role from minting a link it
|
|
16
|
+
* couldn't revoke.
|
|
17
|
+
* - The two PUBLIC routes are bypassed in the global auth hook; the opaque
|
|
18
|
+
* token (looked up in share_links, fail-closed on missing/revoked) IS the
|
|
19
|
+
* authorization. A revoked token stops resolving for BOTH the body and its
|
|
20
|
+
* assets immediately.
|
|
21
|
+
* - The public read returns ONLY { title, entityType, content } — frontmatter
|
|
22
|
+
* and metadata never cross the boundary (test-enforced). Asset URLs in the
|
|
23
|
+
* body are rewritten to token-scoped /api/share/:token/asset/... links.
|
|
24
|
+
* - A public asset must be EMBEDDED in the shared entry (and so belong to the
|
|
25
|
+
* same repo), so a crafted body can't republish another entry's, another
|
|
26
|
+
* repo's, or an un-embedded asset.
|
|
27
|
+
*/
|
|
28
|
+
import * as access from '../../services/access-control.js';
|
|
29
|
+
import { rewriteImmutableAssetUrls, extractImmutableAssetRefs } from '../../core/embeds.js';
|
|
30
|
+
import { serveIndexedAsset } from './asset-api.js';
|
|
31
|
+
/**
|
|
32
|
+
* Whether a folder may be published at all. Personal folders ARE publishable:
|
|
33
|
+
* the owner's right to publish their own content externally is orthogonal to
|
|
34
|
+
* teammate visibility, and the single `mint()` caller is already owner-gated
|
|
35
|
+
* (a non-owner 404s on a personal folder before reaching here). The gate now
|
|
36
|
+
* degrades to a repo-existence check, but it stays a named gate — and keeps its
|
|
37
|
+
* four call sites — because it's where a future non-publishable repo class
|
|
38
|
+
* (e.g. a `system` / workspace-wide asset store added to RepoConfig) would be
|
|
39
|
+
* rejected. Read the flag off the repo config directly — `isRestrictedPersonalFolder`
|
|
40
|
+
* in access-control is unexported and user-scoped (a per-user access check),
|
|
41
|
+
* whereas this is a publish gate.
|
|
42
|
+
*/
|
|
43
|
+
function isPublishableRepo(workspaceManager, repo) {
|
|
44
|
+
const config = workspaceManager.getRepoConfig(repo);
|
|
45
|
+
if (!config)
|
|
46
|
+
return false;
|
|
47
|
+
return true;
|
|
48
|
+
}
|
|
49
|
+
function entityTitle(data, fallbackId) {
|
|
50
|
+
const name = data?.name ?? data?.title;
|
|
51
|
+
return typeof name === 'string' && name.trim() ? name : fallbackId;
|
|
52
|
+
}
|
|
53
|
+
/** The entry's stable creation timestamp, used to detect a delete+recreate at
|
|
54
|
+
* the same coords. Returns null when absent (then identity isn't enforced). */
|
|
55
|
+
function entityTimestamp(entity) {
|
|
56
|
+
const ts = entity?.data?.created_at;
|
|
57
|
+
return typeof ts === 'string' && ts ? ts : null;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Resolve the entry a live share link points at, applying the existence +
|
|
61
|
+
* entity-identity guards both public routes share: the repo + entry must still
|
|
62
|
+
* exist, and when both the link and the current entry carry a created_at they
|
|
63
|
+
* must match (else the original entry was deleted and a new one took its coords
|
|
64
|
+
* — fail closed so the old token can't serve unrelated content). Returns the
|
|
65
|
+
* entity, or null when any guard trips. Callers have already validated the
|
|
66
|
+
* token + publishable gate.
|
|
67
|
+
*/
|
|
68
|
+
function resolveSharedEntity(workspaceManager, link) {
|
|
69
|
+
let graph;
|
|
70
|
+
try {
|
|
71
|
+
graph = workspaceManager.getGraph(link.repo);
|
|
72
|
+
}
|
|
73
|
+
catch {
|
|
74
|
+
return null;
|
|
75
|
+
}
|
|
76
|
+
let entity;
|
|
77
|
+
try {
|
|
78
|
+
entity = graph.get(link.entryType, link.entryId);
|
|
79
|
+
}
|
|
80
|
+
catch {
|
|
81
|
+
return null;
|
|
82
|
+
}
|
|
83
|
+
if (!entity)
|
|
84
|
+
return null;
|
|
85
|
+
const currentTs = entityTimestamp(entity);
|
|
86
|
+
if (link.entityCreatedAt && currentTs && currentTs !== link.entityCreatedAt)
|
|
87
|
+
return null;
|
|
88
|
+
return entity;
|
|
89
|
+
}
|
|
90
|
+
export async function registerShareApiRoutes(fastify, workspaceManager, authService, shareLinkService) {
|
|
91
|
+
// POST /api/repos/:repo/entities/:type/:id/share-link — mint or reuse the
|
|
92
|
+
// active public link for an entry. Authed (not bypassed in the auth hook).
|
|
93
|
+
fastify.post('/api/repos/:repo/entities/:type/:id/share-link', async (req, reply) => {
|
|
94
|
+
const user = req.user;
|
|
95
|
+
if (!user)
|
|
96
|
+
return reply.status(401).send({ error: 'Authentication required' });
|
|
97
|
+
const { repo, type, id } = req.params;
|
|
98
|
+
if (!access.hasRepoAccess(user, repo, workspaceManager, authService)) {
|
|
99
|
+
return reply.status(404).send({ error: `Folder "${repo}" not found` });
|
|
100
|
+
}
|
|
101
|
+
// Write-gate publishing to match revoke (DELETE below). Today read ⟺ write
|
|
102
|
+
// for shared folders, so this is a no-op, but it keeps the two halves of
|
|
103
|
+
// the feature coherent and pre-empts a future read-only/viewer role from
|
|
104
|
+
// being able to mint a permanent public link it couldn't revoke.
|
|
105
|
+
if (!access.canWriteRepo(user, repo, workspaceManager, authService)) {
|
|
106
|
+
return reply.status(403).send({ error: 'You do not have write access to this folder' });
|
|
107
|
+
}
|
|
108
|
+
if (!isPublishableRepo(workspaceManager, repo)) {
|
|
109
|
+
return reply.status(403).send({ error: 'This folder cannot be shared publicly.' });
|
|
110
|
+
}
|
|
111
|
+
// Confirm the entity exists before minting, and capture its created_at so
|
|
112
|
+
// a later delete+recreate at the same coords can't inherit this token.
|
|
113
|
+
let graph;
|
|
114
|
+
try {
|
|
115
|
+
graph = workspaceManager.getGraph(repo);
|
|
116
|
+
}
|
|
117
|
+
catch (err) {
|
|
118
|
+
return reply.status(404).send({ error: err.message });
|
|
119
|
+
}
|
|
120
|
+
let entityCreatedAt = null;
|
|
121
|
+
try {
|
|
122
|
+
const entity = graph.get(type, id);
|
|
123
|
+
if (!entity)
|
|
124
|
+
return reply.status(404).send({ error: `Entity not found: ${type}/${id}` });
|
|
125
|
+
entityCreatedAt = entityTimestamp(entity);
|
|
126
|
+
}
|
|
127
|
+
catch (err) {
|
|
128
|
+
return reply.status(404).send({ error: err.message ?? `Entity not found: ${type}/${id}` });
|
|
129
|
+
}
|
|
130
|
+
const link = shareLinkService.mint(repo, type, id, user.id, entityCreatedAt);
|
|
131
|
+
return reply.send({ path: `/share/${link.token}`, token: link.token });
|
|
132
|
+
});
|
|
133
|
+
// GET /api/repos/:repo/entities/:type/:id/share-link — share status for an
|
|
134
|
+
// entry, so the entry view can show "Unshare" only when a live link exists.
|
|
135
|
+
// Read-gated (authed). Returns the active link, or nulls when not shared.
|
|
136
|
+
fastify.get('/api/repos/:repo/entities/:type/:id/share-link', async (req, reply) => {
|
|
137
|
+
const user = req.user;
|
|
138
|
+
if (!user)
|
|
139
|
+
return reply.status(401).send({ error: 'Authentication required' });
|
|
140
|
+
const { repo, type, id } = req.params;
|
|
141
|
+
if (!access.hasRepoAccess(user, repo, workspaceManager, authService)) {
|
|
142
|
+
return reply.status(404).send({ error: `Folder "${repo}" not found` });
|
|
143
|
+
}
|
|
144
|
+
// Defense in depth against a future non-publishable repo class: report
|
|
145
|
+
// not-shared rather than handing out a token that the read path would
|
|
146
|
+
// refuse to resolve anyway.
|
|
147
|
+
if (!isPublishableRepo(workspaceManager, repo)) {
|
|
148
|
+
return reply.send({ path: null, token: null });
|
|
149
|
+
}
|
|
150
|
+
const link = shareLinkService.getActiveByEntry(repo, type, id);
|
|
151
|
+
return reply.send(link ? { path: `/share/${link.token}`, token: link.token } : { path: null, token: null });
|
|
152
|
+
});
|
|
153
|
+
// DELETE /api/repos/:repo/entities/:type/:id/share-link — revoke the entry's
|
|
154
|
+
// active public link (the per-entry "Unshare" action). Write-gated: anyone
|
|
155
|
+
// who can edit the entry can take it offline (publicness is a property of the
|
|
156
|
+
// entry, not of whoever first shared it). Idempotent — revoked:false when the
|
|
157
|
+
// entry wasn't shared.
|
|
158
|
+
fastify.delete('/api/repos/:repo/entities/:type/:id/share-link', async (req, reply) => {
|
|
159
|
+
const user = req.user;
|
|
160
|
+
if (!user)
|
|
161
|
+
return reply.status(401).send({ error: 'Authentication required' });
|
|
162
|
+
const { repo, type, id } = req.params;
|
|
163
|
+
if (!access.hasRepoAccess(user, repo, workspaceManager, authService)) {
|
|
164
|
+
return reply.status(404).send({ error: `Folder "${repo}" not found` });
|
|
165
|
+
}
|
|
166
|
+
if (!access.canWriteRepo(user, repo, workspaceManager, authService)) {
|
|
167
|
+
return reply.status(403).send({ error: 'You do not have write access to this folder' });
|
|
168
|
+
}
|
|
169
|
+
return reply.send({ revoked: shareLinkService.revokeByEntry(repo, type, id) });
|
|
170
|
+
});
|
|
171
|
+
// GET /api/share/:token — PUBLIC read. Returns title + body only.
|
|
172
|
+
fastify.get('/api/share/:token', async (req, reply) => {
|
|
173
|
+
const link = shareLinkService.resolve(req.params.token);
|
|
174
|
+
// Missing OR revoked → 404 (fail-closed, no existence oracle).
|
|
175
|
+
if (!link)
|
|
176
|
+
return reply.status(404).send({ error: 'Share link not found' });
|
|
177
|
+
// Defense in depth: even a valid token never serves a now-unpublishable
|
|
178
|
+
// folder (a future non-publishable repo class).
|
|
179
|
+
if (!isPublishableRepo(workspaceManager, link.repo)) {
|
|
180
|
+
return reply.status(404).send({ error: 'Share link not found' });
|
|
181
|
+
}
|
|
182
|
+
// Existence + entity-identity guard (a delete+recreate at the same coords
|
|
183
|
+
// fails closed). Shared with the asset route below.
|
|
184
|
+
const entity = resolveSharedEntity(workspaceManager, link);
|
|
185
|
+
if (!entity)
|
|
186
|
+
return reply.status(404).send({ error: 'Share link not found' });
|
|
187
|
+
const rawContent = entity.document?.content ?? '';
|
|
188
|
+
// Mutable + security-sensitive: never let a proxy/CDN cache it, so edits
|
|
189
|
+
// and a revoke take effect immediately (D4).
|
|
190
|
+
reply.header('Cache-Control', 'no-store');
|
|
191
|
+
// SECURITY BOUNDARY: title + body + type ONLY. Frontmatter / metadata must
|
|
192
|
+
// never cross to a guest (test-enforced in share-api.test.ts).
|
|
193
|
+
return reply.send({
|
|
194
|
+
title: entityTitle(entity.data, link.entryId),
|
|
195
|
+
entityType: entity.entityType ?? link.entryType,
|
|
196
|
+
content: rewriteImmutableAssetUrls(rawContent, (assetId, filename) => `/api/share/${link.token}/asset/${assetId}/${filename}`),
|
|
197
|
+
});
|
|
198
|
+
});
|
|
199
|
+
// GET / HEAD /api/share/:token/asset/:assetId/:filename — PUBLIC asset.
|
|
200
|
+
fastify.route({
|
|
201
|
+
method: ['GET', 'HEAD'],
|
|
202
|
+
url: '/api/share/:token/asset/:assetId/:filename',
|
|
203
|
+
handler: async (req, reply) => {
|
|
204
|
+
const { token, assetId, filename } = req.params;
|
|
205
|
+
const isHead = req.method === 'HEAD';
|
|
206
|
+
const link = shareLinkService.resolve(token);
|
|
207
|
+
if (!link)
|
|
208
|
+
return reply.status(404).send({ error: 'Asset not found' });
|
|
209
|
+
if (!isPublishableRepo(workspaceManager, link.repo)) {
|
|
210
|
+
return reply.status(404).send({ error: 'Asset not found' });
|
|
211
|
+
}
|
|
212
|
+
const row = workspaceManager.getAssetIndex().get(assetId);
|
|
213
|
+
// Unknown id, filename mismatch, or an asset owned by a DIFFERENT repo
|
|
214
|
+
// than the shared entry all fail-closed.
|
|
215
|
+
if (!row || row.filename !== filename || row.repo !== link.repo) {
|
|
216
|
+
return reply.status(404).send({ error: 'Asset not found' });
|
|
217
|
+
}
|
|
218
|
+
// The asset must be EMBEDDED in the shared entry — not merely a same-repo
|
|
219
|
+
// sibling. Re-resolve the entry through the same existence + identity
|
|
220
|
+
// guard the body read uses (so an asset 404s after a delete+recreate),
|
|
221
|
+
// then confirm the body references this immutable asset URL. Uses the
|
|
222
|
+
// same grammar `rewriteImmutableAssetUrls` rewrote it from on the read.
|
|
223
|
+
const entity = resolveSharedEntity(workspaceManager, link);
|
|
224
|
+
if (!entity)
|
|
225
|
+
return reply.status(404).send({ error: 'Asset not found' });
|
|
226
|
+
const embedded = extractImmutableAssetRefs(entity.document?.content ?? '');
|
|
227
|
+
if (!embedded.some((ref) => ref.assetId === assetId && ref.filename === filename)) {
|
|
228
|
+
return reply.status(404).send({ error: 'Asset not found' });
|
|
229
|
+
}
|
|
230
|
+
return serveIndexedAsset(workspaceManager, reply, { assetId, filename, repo: row.repo, isHead });
|
|
231
|
+
},
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
//# sourceMappingURL=share-api.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"share-api.js","sourceRoot":"","sources":["../../../src/server/routes/share-api.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAKH,OAAO,KAAK,MAAM,MAAM,kCAAkC,CAAC;AAG3D,OAAO,EAAE,yBAAyB,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AAC5F,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAEnD;;;;;;;;;;;GAWG;AACH,SAAS,iBAAiB,CAAC,gBAAkC,EAAE,IAAY;IACzE,MAAM,MAAM,GAAG,gBAAgB,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;IACpD,IAAI,CAAC,MAAM;QAAE,OAAO,KAAK,CAAC;IAC1B,OAAO,IAAI,CAAC;AACd,CAAC;AAED,SAAS,WAAW,CAAC,IAAyC,EAAE,UAAkB;IAChF,MAAM,IAAI,GAAG,IAAI,EAAE,IAAI,IAAI,IAAI,EAAE,KAAK,CAAC;IACvC,OAAO,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC;AACrE,CAAC;AAED;gFACgF;AAChF,SAAS,eAAe,CAAC,MAAW;IAClC,MAAM,EAAE,GAAG,MAAM,EAAE,IAAI,EAAE,UAAU,CAAC;IACpC,OAAO,OAAO,EAAE,KAAK,QAAQ,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;AAClD,CAAC;AAED;;;;;;;;GAQG;AACH,SAAS,mBAAmB,CAAC,gBAAkC,EAAE,IAA0F;IACzJ,IAAI,KAAK,CAAC;IACV,IAAI,CAAC;QAAC,KAAK,GAAG,gBAAgB,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAAC,CAAC;IACrD,M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IAAI,GAAG,CAAC,QAAQ,KAAK,QAAQ,IAAI,GAAG,CAAC,IAAI,KAAK,IAAI,CAAC,IAAI,EAAE,CAAC;gBAChE,OAAO,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,iBAAiB,EAAE,CAAC,CAAC;YAC9D,CAAC;YAED,0EAA0E;YAC1E,sEAAsE;YACtE,uEAAuE;YACvE,sEAAsE;YACtE,wEAAwE;YACxE,MAAM,MAAM,GAAG,mBAAmB,CAAC,gBAAgB,EAAE,IAAI,CAAC,CAAC;YAC3D,IAAI,CAAC,MAAM;gBAAE,OAAO,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,iBAAiB,EAAE,CAAC,CAAC;YACzE,MAAM,QAAQ,GAAG,yBAAyB,CAAC,MAAM,CAAC,QAAQ,EAAE,OAAO,IAAI,EAAE,CAAC,CAAC;YAC3E,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,OAAO,KAAK,OAAO,IAAI,GAAG,CAAC,QAAQ,KAAK,QAAQ,CAAC,EAAE,CAAC;gBAClF,OAAO,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,iBAAiB,EAAE,CAAC,CAAC;YAC9D,CAAC;YAED,OAAO,iBAAiB,CAAC,gBAAgB,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC;QACnG,CAAC;KACF,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -79,5 +79,56 @@ export async function registerViewsApiRoutes(fastify, authService, workspaceMana
|
|
|
79
79
|
authService.deleteUserView(viewId, userId);
|
|
80
80
|
return reply.send({ ok: true });
|
|
81
81
|
});
|
|
82
|
+
// ── Workspace views (folder-views redesign) ──
|
|
83
|
+
// Workspace-shared, scope-keyed view sets. Scope is `folder:<id>` |
|
|
84
|
+
// `type:<entityType>` | `recent`. Not per-user — everyone sees the same set.
|
|
85
|
+
const VIEW_TYPES = new Set(['list', 'gallery', 'kanban', 'timeline', 'calendar', 'graph']);
|
|
86
|
+
// GET /api/workspace-views?scope=… — ordered views for a scope (seeds defaults
|
|
87
|
+
// on first access: a List, plus Calendar+Graph for `recent`).
|
|
88
|
+
fastify.get('/api/workspace-views', async (req, reply) => {
|
|
89
|
+
const scope = req.query?.scope;
|
|
90
|
+
if (!scope)
|
|
91
|
+
return reply.status(400).send({ error: 'scope is required' });
|
|
92
|
+
return reply.send(authService.ensureViewsForScope(scope));
|
|
93
|
+
});
|
|
94
|
+
// POST /api/workspace-views — add a view to a scope. One-of-each is enforced
|
|
95
|
+
// by the DB.
|
|
96
|
+
fastify.post('/api/workspace-views', async (req, reply) => {
|
|
97
|
+
const user = req.user;
|
|
98
|
+
const { scope, viewType, config } = req.body ?? {};
|
|
99
|
+
if (!scope)
|
|
100
|
+
return reply.status(400).send({ error: 'scope is required' });
|
|
101
|
+
if (!viewType || !VIEW_TYPES.has(viewType)) {
|
|
102
|
+
return reply.status(400).send({ error: 'valid viewType is required' });
|
|
103
|
+
}
|
|
104
|
+
const view = authService.createWorkspaceView(scope, viewType, config ?? {}, user?.displayName ?? user?.email);
|
|
105
|
+
return reply.send(view);
|
|
106
|
+
});
|
|
107
|
+
// PUT /api/workspace-views/:id — update config / position / name.
|
|
108
|
+
fastify.put('/api/workspace-views/:id', async (req, reply) => {
|
|
109
|
+
const viewId = Number(req.params.id);
|
|
110
|
+
const existing = authService.getWorkspaceView(viewId);
|
|
111
|
+
if (!existing)
|
|
112
|
+
return reply.status(404).send({ error: 'View not found' });
|
|
113
|
+
authService.updateWorkspaceView(viewId, {
|
|
114
|
+
config: req.body?.config,
|
|
115
|
+
position: req.body?.position,
|
|
116
|
+
name: req.body?.name,
|
|
117
|
+
});
|
|
118
|
+
return reply.send({ ok: true });
|
|
119
|
+
});
|
|
120
|
+
// DELETE /api/workspace-views/:id — remove a view. List is un-removable
|
|
121
|
+
// (every scope keeps ≥1 view); every other view is removable from any scope.
|
|
122
|
+
fastify.delete('/api/workspace-views/:id', async (req, reply) => {
|
|
123
|
+
const viewId = Number(req.params.id);
|
|
124
|
+
const existing = authService.getWorkspaceView(viewId);
|
|
125
|
+
if (!existing)
|
|
126
|
+
return reply.status(404).send({ error: 'View not found' });
|
|
127
|
+
if (existing.viewType === 'list') {
|
|
128
|
+
return reply.status(400).send({ error: 'The List view cannot be removed' });
|
|
129
|
+
}
|
|
130
|
+
authService.deleteWorkspaceView(viewId);
|
|
131
|
+
return reply.send({ ok: true });
|
|
132
|
+
});
|
|
82
133
|
}
|
|
83
134
|
//# sourceMappingURL=views-api.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"views-api.js","sourceRoot":"","sources":["../../../src/server/routes/views-api.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAC1C,OAAwB,EACxB,WAAwB,EACxB,gBAAkC;IAGlC,SAAS,SAAS,CAAC,GAAQ;QACzB,OAAS,GAAW,CAAC,IAA6B,EAAE,EAAE,IAAI,CAAC,CAAC;IAC9D,CAAC;IAED,SAAS,mBAAmB;QAC1B,MAAM,MAAM,GAA2B,EAAE,CAAC;QAC1C,IAAI,CAAC;YACH,KAAK,MAAM,IAAI,IAAI,gBAAgB,CAAC,iBAAiB,EAAE,EAAE,CAAC;gBACxD,MAAM,KAAK,GAAG,gBAAgB,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;gBACnD,MAAM,QAAQ,GAAG,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;gBAClC,KAAK,MAAM,CAAC,IAAI,QAAQ,EAAE,CAAC;oBACzB,MAAM,IAAI,GAAG,CAAC,CAAC,IAAI,EAAE,WAAqB,CA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E;QACnB,MAAM,MAAM,GAAG,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QACrC,MAAM,QAAQ,GAAG,WAAW,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC;QACtD,IAAI,CAAC,QAAQ;YAAE,OAAO,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,gBAAgB,EAAE,CAAC,CAAC;QAC1E,IAAI,QAAQ,CAAC,QAAQ,KAAK,MAAM,EAAE,CAAC;YACjC,OAAO,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,iCAAiC,EAAE,CAAC,CAAC;QAC9E,CAAC;QACD,WAAW,CAAC,mBAAmB,CAAC,MAAM,CAAC,CAAC;QACxC,OAAO,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;IAClC,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -6,4 +6,5 @@
|
|
|
6
6
|
import type { FastifyInstance } from 'fastify';
|
|
7
7
|
import { WorkspaceManager } from '../../core/workspace-manager.js';
|
|
8
8
|
import { GitUser } from '../../services/git.js';
|
|
9
|
-
|
|
9
|
+
import { type AuthService } from '../../services/auth-service.js';
|
|
10
|
+
export declare function registerWorkspaceApiRoutes(fastify: FastifyInstance, workspaceManager: WorkspaceManager, gitUser: GitUser, authService: AuthService): Promise<void>;
|
|
@@ -3,14 +3,32 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Git operations: status, commit, push, pull across all repos.
|
|
5
5
|
*/
|
|
6
|
-
|
|
6
|
+
import { existsSync, statSync } from 'fs';
|
|
7
|
+
import { join } from 'path';
|
|
8
|
+
import archiver from 'archiver';
|
|
9
|
+
import * as access from '../../services/access-control.js';
|
|
10
|
+
import { log } from '../../utils/log.js';
|
|
11
|
+
/** Repo names eligible for local git ops (status, commit, revert) — includes personal. */
|
|
7
12
|
function getLocalRepoNames(wm) {
|
|
8
13
|
return wm.getAllRepoConfigs().map(r => r.name);
|
|
9
14
|
}
|
|
10
|
-
|
|
15
|
+
function getReadableLocalRepoNames(user, wm, authService) {
|
|
16
|
+
return getLocalRepoNames(wm).filter(name => access.hasRepoAccess(user, name, wm, authService));
|
|
17
|
+
}
|
|
18
|
+
function getWritableLocalRepoNames(user, wm, authService) {
|
|
19
|
+
return getLocalRepoNames(wm).filter(name => access.canWriteRepo(user, name, wm, authService));
|
|
20
|
+
}
|
|
21
|
+
function getWritableSyncRepoNames(user, wm, authService) {
|
|
22
|
+
return wm
|
|
23
|
+
.getAllRepoConfigs()
|
|
24
|
+
.filter(repo => !repo.personal && access.canWriteRepo(user, repo.name, wm, authService))
|
|
25
|
+
.map(repo => repo.name);
|
|
26
|
+
}
|
|
27
|
+
export async function registerWorkspaceApiRoutes(fastify, workspaceManager, gitUser, authService) {
|
|
11
28
|
// GET /api/status — git status across all repos
|
|
12
|
-
fastify.get('/api/status', async (
|
|
13
|
-
const
|
|
29
|
+
fastify.get('/api/status', async (req, reply) => {
|
|
30
|
+
const user = req.user;
|
|
31
|
+
const repoNames = getReadableLocalRepoNames(user, workspaceManager, authService);
|
|
14
32
|
const results = [];
|
|
15
33
|
for (const name of repoNames) {
|
|
16
34
|
try {
|
|
@@ -72,7 +90,8 @@ export async function registerWorkspaceApiRoutes(fastify, workspaceManager, gitU
|
|
|
72
90
|
const { message } = req.body ?? {};
|
|
73
91
|
const commitMessage = message || 'Update from web UI';
|
|
74
92
|
try {
|
|
75
|
-
const
|
|
93
|
+
const user = req.user;
|
|
94
|
+
const repoNames = getWritableLocalRepoNames(user, workspaceManager, authService);
|
|
76
95
|
const committed = [];
|
|
77
96
|
for (const name of repoNames) {
|
|
78
97
|
try {
|
|
@@ -96,19 +115,20 @@ export async function registerWorkspaceApiRoutes(fastify, workspaceManager, gitU
|
|
|
96
115
|
return reply.status(500).send({ error: err.message });
|
|
97
116
|
}
|
|
98
117
|
});
|
|
99
|
-
// POST /api/push — push
|
|
100
|
-
fastify.post('/api/push', async (
|
|
118
|
+
// POST /api/push — push writable repos (skip personal)
|
|
119
|
+
fastify.post('/api/push', async (req, reply) => {
|
|
101
120
|
try {
|
|
102
|
-
const
|
|
121
|
+
const user = req.user;
|
|
122
|
+
const repoNames = getWritableSyncRepoNames(user, workspaceManager, authService);
|
|
103
123
|
const pushed = [];
|
|
104
|
-
for (const
|
|
124
|
+
for (const name of repoNames) {
|
|
105
125
|
try {
|
|
106
|
-
const graph = workspaceManager.getGraph(
|
|
126
|
+
const graph = workspaceManager.getGraph(name);
|
|
107
127
|
const git = graph.gitService;
|
|
108
128
|
if (!git)
|
|
109
129
|
continue;
|
|
110
130
|
await git.push();
|
|
111
|
-
pushed.push(
|
|
131
|
+
pushed.push(name);
|
|
112
132
|
}
|
|
113
133
|
catch {
|
|
114
134
|
// Skip individual repo failures
|
|
@@ -120,19 +140,23 @@ export async function registerWorkspaceApiRoutes(fastify, workspaceManager, gitU
|
|
|
120
140
|
return reply.status(500).send({ error: err.message });
|
|
121
141
|
}
|
|
122
142
|
});
|
|
123
|
-
// POST /api/pull — pull
|
|
124
|
-
fastify.post('/api/pull', async (
|
|
143
|
+
// POST /api/pull — pull writable repos (skip personal)
|
|
144
|
+
fastify.post('/api/pull', async (req, reply) => {
|
|
125
145
|
try {
|
|
126
|
-
const
|
|
146
|
+
const user = req.user;
|
|
147
|
+
const repoNames = getWritableSyncRepoNames(user, workspaceManager, authService);
|
|
127
148
|
const pulled = [];
|
|
128
|
-
for (const
|
|
149
|
+
for (const name of repoNames) {
|
|
129
150
|
try {
|
|
130
|
-
const graph = workspaceManager.getGraph(
|
|
131
|
-
|
|
132
|
-
if (!git)
|
|
151
|
+
const graph = workspaceManager.getGraph(name);
|
|
152
|
+
if (!graph)
|
|
133
153
|
continue;
|
|
134
|
-
|
|
135
|
-
|
|
154
|
+
// pullAndReconcile runs the pull AND smart-merges the new disk
|
|
155
|
+
// content into any live editor Y.Doc the pull changed — without it,
|
|
156
|
+
// a user editing a pulled-updated entry overwrites the pulled
|
|
157
|
+
// changes on their next autosave (silent loss).
|
|
158
|
+
await graph.pullAndReconcile();
|
|
159
|
+
pulled.push(name);
|
|
136
160
|
}
|
|
137
161
|
catch {
|
|
138
162
|
// Skip individual repo failures
|
|
@@ -145,9 +169,10 @@ export async function registerWorkspaceApiRoutes(fastify, workspaceManager, gitU
|
|
|
145
169
|
}
|
|
146
170
|
});
|
|
147
171
|
// POST /api/revert — revert all uncommitted changes across all repos
|
|
148
|
-
fastify.post('/api/revert', async (
|
|
172
|
+
fastify.post('/api/revert', async (req, reply) => {
|
|
149
173
|
try {
|
|
150
|
-
const
|
|
174
|
+
const user = req.user;
|
|
175
|
+
const repoNames = getWritableLocalRepoNames(user, workspaceManager, authService);
|
|
151
176
|
const reverted = [];
|
|
152
177
|
for (const name of repoNames) {
|
|
153
178
|
try {
|
|
@@ -173,6 +198,10 @@ export async function registerWorkspaceApiRoutes(fastify, workspaceManager, gitU
|
|
|
173
198
|
});
|
|
174
199
|
// GET /api/repos/:repo/status — git status for a single repo
|
|
175
200
|
fastify.get('/api/repos/:repo/status', async (req, reply) => {
|
|
201
|
+
const user = req.user;
|
|
202
|
+
if (!access.hasRepoAccess(user, req.params.repo, workspaceManager, authService)) {
|
|
203
|
+
return reply.status(404).send({ error: 'Repo not found' });
|
|
204
|
+
}
|
|
176
205
|
try {
|
|
177
206
|
const graph = workspaceManager.getGraph(req.params.repo);
|
|
178
207
|
const git = graph.gitService;
|
|
@@ -200,6 +229,11 @@ export async function registerWorkspaceApiRoutes(fastify, workspaceManager, gitU
|
|
|
200
229
|
});
|
|
201
230
|
// POST /api/repos/:repo/publish — commit + push a single repo
|
|
202
231
|
fastify.post('/api/repos/:repo/publish', async (req, reply) => {
|
|
232
|
+
const user = req.user;
|
|
233
|
+
// Publish writes to the shared remote — require write access.
|
|
234
|
+
if (!access.canWriteRepo(user, req.params.repo, workspaceManager, authService)) {
|
|
235
|
+
return reply.status(404).send({ error: 'Repo not found' });
|
|
236
|
+
}
|
|
203
237
|
try {
|
|
204
238
|
const graph = workspaceManager.getGraph(req.params.repo);
|
|
205
239
|
const git = graph.gitService;
|
|
@@ -222,6 +256,12 @@ export async function registerWorkspaceApiRoutes(fastify, workspaceManager, gitU
|
|
|
222
256
|
});
|
|
223
257
|
// POST /api/repos/:repo/revert — revert uncommitted changes in a single repo
|
|
224
258
|
fastify.post('/api/repos/:repo/revert', async (req, reply) => {
|
|
259
|
+
const user = req.user;
|
|
260
|
+
// Revert is destructive — require write access. A non-member must
|
|
261
|
+
// not be able to discard another user's uncommitted work.
|
|
262
|
+
if (!access.canWriteRepo(user, req.params.repo, workspaceManager, authService)) {
|
|
263
|
+
return reply.status(404).send({ error: 'Repo not found' });
|
|
264
|
+
}
|
|
225
265
|
try {
|
|
226
266
|
const graph = workspaceManager.getGraph(req.params.repo);
|
|
227
267
|
const git = graph.gitService;
|
|
@@ -242,7 +282,7 @@ export async function registerWorkspaceApiRoutes(fastify, workspaceManager, gitU
|
|
|
242
282
|
for (const repoConfig of repos) {
|
|
243
283
|
try {
|
|
244
284
|
const graph = workspaceManager.getGraph(repoConfig.name);
|
|
245
|
-
const entities = graph.search({})
|
|
285
|
+
const entities = graph.search({});
|
|
246
286
|
totalEntities += entities.length;
|
|
247
287
|
for (const e of entities) {
|
|
248
288
|
totalLinks += (e.document?.wikilinks?.length ?? 0);
|
|
@@ -257,5 +297,84 @@ export async function registerWorkspaceApiRoutes(fastify, workspaceManager, gitU
|
|
|
257
297
|
links: totalLinks,
|
|
258
298
|
});
|
|
259
299
|
});
|
|
300
|
+
// GET /api/workspace/export — stream a zip of the caller's accessible
|
|
301
|
+
// workspace (all shared folders they're a member of + their personal
|
|
302
|
+
// folder, plus a filtered .studiograph). Honours the same access scope
|
|
303
|
+
// as `studiograph clone` — owners do NOT see other users' personal
|
|
304
|
+
// folders, since those are local-only by design.
|
|
305
|
+
//
|
|
306
|
+
// The zip preserves each repo's .git directory so users can keep working
|
|
307
|
+
// from the export (commit history intact). Excluded from .studiograph:
|
|
308
|
+
// auth.db, server-auth.json, populate-cache/, memory/, *.log — same
|
|
309
|
+
// exclusion list the CLI clone .gitignore enforces. Secrets and per-user
|
|
310
|
+
// server state shouldn't leave the server in a portable archive.
|
|
311
|
+
fastify.get('/api/workspace/export', async (req, reply) => {
|
|
312
|
+
const user = req.user;
|
|
313
|
+
const repos = user
|
|
314
|
+
? access.getAccessibleRepos(user, workspaceManager, authService)
|
|
315
|
+
: workspaceManager.getAllRepoConfigs();
|
|
316
|
+
const workspacePath = workspaceManager.getWorkspacePath();
|
|
317
|
+
const dateStamp = new Date().toISOString().slice(0, 10);
|
|
318
|
+
const slug = workspaceManager.config?.team_name
|
|
319
|
+
? String(workspaceManager.config.team_name).toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/^-|-$/g, '')
|
|
320
|
+
: 'studiograph';
|
|
321
|
+
const filename = `${slug || 'studiograph'}-${dateStamp}.zip`;
|
|
322
|
+
reply.header('Content-Type', 'application/zip');
|
|
323
|
+
reply.header('Content-Disposition', `attachment; filename="${filename}"`);
|
|
324
|
+
const archive = archiver('zip', { zlib: { level: 6 } });
|
|
325
|
+
archive.on('warning', (err) => {
|
|
326
|
+
// ENOENT on missing optional files is fine; bail on anything else.
|
|
327
|
+
if (err?.code !== 'ENOENT')
|
|
328
|
+
log.error('[export] archive warning:', err);
|
|
329
|
+
});
|
|
330
|
+
archive.on('error', (err) => {
|
|
331
|
+
log.error('[export] archive error:', err);
|
|
332
|
+
reply.raw.destroy(err);
|
|
333
|
+
});
|
|
334
|
+
// Pipe directly to the underlying socket — Fastify's reply.send() would
|
|
335
|
+
// try to serialize the stream and add headers we've already set.
|
|
336
|
+
archive.pipe(reply.raw);
|
|
337
|
+
// Each accessible repo, with its .git history. Repos live at
|
|
338
|
+
// `${workspacePath}/${repo.path}` per WorkspaceManager's layout.
|
|
339
|
+
for (const repo of repos) {
|
|
340
|
+
const repoPath = join(workspacePath, repo.path);
|
|
341
|
+
if (!existsSync(repoPath))
|
|
342
|
+
continue;
|
|
343
|
+
try {
|
|
344
|
+
if (!statSync(repoPath).isDirectory())
|
|
345
|
+
continue;
|
|
346
|
+
}
|
|
347
|
+
catch {
|
|
348
|
+
continue;
|
|
349
|
+
}
|
|
350
|
+
archive.directory(repoPath, repo.path);
|
|
351
|
+
}
|
|
352
|
+
// .studiograph — workspace.json, sources, connectors, ABOUT.md, schema.
|
|
353
|
+
// Mirrors the CLI clone .gitignore exclusion list so secrets, per-user
|
|
354
|
+
// server state, caches, and logs stay on the server.
|
|
355
|
+
const studiographPath = join(workspacePath, '.studiograph');
|
|
356
|
+
if (existsSync(studiographPath)) {
|
|
357
|
+
archive.glob('**/*', {
|
|
358
|
+
cwd: studiographPath,
|
|
359
|
+
ignore: [
|
|
360
|
+
'auth.db',
|
|
361
|
+
'auth.db-journal',
|
|
362
|
+
'auth-seed.json',
|
|
363
|
+
'server-auth.json',
|
|
364
|
+
// Public share-link bearer tokens — exporting these would hand every
|
|
365
|
+
// active anonymous link (and its entry mapping) to the recipient.
|
|
366
|
+
'share-links.db',
|
|
367
|
+
'share-links.db-wal',
|
|
368
|
+
'share-links.db-shm',
|
|
369
|
+
'populate-cache/**',
|
|
370
|
+
'memory/**',
|
|
371
|
+
'sessions/**',
|
|
372
|
+
'*.log',
|
|
373
|
+
],
|
|
374
|
+
dot: true,
|
|
375
|
+
}, { prefix: '.studiograph' });
|
|
376
|
+
}
|
|
377
|
+
await archive.finalize();
|
|
378
|
+
});
|
|
260
379
|
}
|
|
261
380
|
//# sourceMappingURL=workspace-api.js.map
|